diff --git a/app.css b/app.css index 434080a..6bfebcc 100644 --- a/app.css +++ b/app.css @@ -23,7 +23,7 @@ body { box-sizing: border-box; grid-template-columns: 2fr 1fr; - grid-template-rows: 5rem 1fr; + grid-template-rows: auto 1fr; @media screen and (max-width: 512px) { grid-template-columns: 1fr; diff --git a/db_worker.bc.js b/db_worker.bc.js index d793d5d..2b90a69 100644 --- a/db_worker.bc.js +++ b/db_worker.bc.js @@ -5,33 +5,39 @@ globalThis!=="object"&&(this?b():(a.defineProperty(a.prototype,"_T_",{configurab b(){var b=this||self;b.globalThis=b;delete a.prototype._T_}}(Object));(function(N){"use strict";var -nM="SH",o1="Budget",nL="console",gY="int_of_string",p0="member",nK="ImageBlurHashes",fc=427938126,i2="fields",cE=0xff,rn="%a",ro="%ni",d5=240,nJ=815,nI="tc",b5="J",rl="ThemeVideoIds",rm="SeasonUserData",fl=-211558048,o0="aa",rk="Out_of_memory",L=963043957,cC=870828711,jJ="Failure",gX="Unix.Unix_error",gW="\\b",oZ="Program",rj="src/core/CCString.pp.ml",oY="DateLastMediaAdded",fr="false",oX=", characters ",gV=869834347,i1="ou",ea="SortName",nH="MusicArtist",oW="MediaSources",g9="Map.bal",eg=-211555818,nG="ChannelFolderItem",pY=30214610,pZ=143365725,aX="v",jg="recursive",cD="ae",i0=16620,a5="w",pX="ids",nF="ProviderIds",pW="closedir",ri="Match_failure",nE=-32,oV="%s",d7="illegal",pV="MusicAlbum",e="",rh="pathname",nD="Year",jf="fut",cd=434236056,nC=": ",g8="Id",rg="']')",pU="ChildCount",pT=851,fb="end",pS=0xe0,hg="object",iZ="Jellyfin",rf="EEXIST",oU=826371656,oT="Studios",re="Locations",oS="Height",pR="Undefined_recursive_module",rd="RecursiveItemCount",nB="AirTime",b3=2147483647,g7="\\t",rc="%.16g",ef=224,g6="array",rb="SpecialEpisodeNumbers",je="surrogate",pQ=204,hf=192,cZ=0x3f,pO="Taglines",pP="CustomRating",pN="Settings",gU="'",he=": No such file or directory",nA="CanDelete",pM=" dst=",pL="enableUserData",ra="av",bP="ts",cn=256,z="A",oR="PresentationUniqueKey",q$="[]",pK="SpecialFeatureCount",nz=832,ny=3456159,jI=":",aC="T",q_="Printexc.handle_uncaught_exception",oQ="Type",jd=" : flags Open_rdonly and Open_wronly are not compatible",q9="BasicSyncInfo",d$=123,q8="item.Id",nx="6",jc="sorts",oP="@;",pJ=822,q7="LiveTvChannel",oO="Genre",jH="{feng}",pH="PlayAccess",pI=">",oN=667,oM=239,d_="Name",cB=127,cp=0xffff,pG="Sys_blocked_io",oL="ExternalEtag",W="I",bQ="Unexpected end of input",nw="People",oJ=642,oK="_",q6="AggregateFolder",gM="_bigarr02",pF=245,iY="not",nv=357,jG="compare: functional value",jv="mkdir",q5="parentId",fq=1000,nu="@[",gT="\\\\",q4="Primary",nt="BoxSet",ns=225181919,d6=-826170817,oI="/static/",q3=14596,R="s",dz="lib/db/stores.ml",hd="4",pE="Assert_failure",q2="Movie",nr="start_index",q0="%X",q1="OCAMLRUNPARAM",nq=253,oH=122,gS="canon",jb="in",qZ=".0",dx="genres",fk="src/uutf.ml",jF="views",oG="CommunityRating",oF=8232,iX=" ms",iW="items",aB=852405675,pD=429931233,qY="ThemeSongIds",qX="Recording",np="lone",ja="2",gL="Set.bal",qW="HomePageUrl",ju=120,d4=1024,pC=1027,iV=246,B="U",no="Season",aW="m",qV="includeItemTypes",dv=-752863768,oE="SyncInfo",nn="AlbumArtist",oD="tracks",nm="stream",oC="ScreenshotImageTags",c3="or",gR=1017453041,js="Album",jt="Fatal error: exception ",aP="camlinternalFormat.ml",qU=273,nk="CriticRating",nl="ui",fp=708012133,oB="RefreshState",bn="j",aL="c",oA=24029,qT=144,iU="ItemId",qS=713199754,nj=827,iT="date_added",oz="ENOTEMPTY",b2="dz",i$=1255,qR=726711616,qQ="sortBy",pB=508493173,a="@ ",oy="Overview",pA="Ascending",hc="JSON",ni="Book",pz="Stack_overflow",al="G",qP="Random",v="a",i_="string",g5="Path",qO=211,fo=-48,aU="P",qN=732461442,ah="t",ox="TvProgram",d3="",qM="Folder",qL="limit",nh=-10,py=65535,qK=400,ng="UserView",ow="CumulativeRunTimeTicks",px="LocalTrailerCount",gK="ParentId",qJ=814,i9="AV",cg="/",g4=605782321,pw="Tags",cJ=3654863,qI="Episode",qH="Width",ov=297,qG="DZ",ou="includeExternalContent",pv="RemoteTrailers",s="O",nf="enableImages",ne="Fatal error: exception %s\n",pu=153884648,os="sorts.views",ot="InheritedParentalRatingValue",pt="ChannelImage",bh="F",nd=818,nc="input",iS="jsError",fn="ng",ps=823,nb="UserRootFolder",or="AudioBook",qF="ue",na="ManualPlaylistsFolder",bz="0",qE=197,oq="hv",ab="n",m_="%u",m$=32752,iR=881518886,r="r",m9="Series",jr=8100,bT="Q",m7="LiveTvProgram",m8=0x7ff0,ce="|",c2=684370880,pr="End_of_file",qD="ProductionLocations",oo="AlbumId",op="comment",on="^",pq=819,qC=244,O="i",qA="Audio",qB="Genres",ad="L",om="DateLastRefreshed",i8="ENOTDIR",fj="null",qz="{}",dw=17732,d9=992790154,ee="+",fi=726928360,jE=8097,qy=65533,co=3455931,m6="Chapters",fh=1023,ed=125,ol="Pervasives.do_at_exit",fa=57343,pp="%c",d8=65536,m5=",@ ",i6=-133,i7=0xf,aQ="k",m4=-588596599,jq=3299808,aT="B",fg=659980059,b4="X",po="SeriesStudio",qx="Photo",pn="infinity",pm="CollectionFolder",qw="fd ",m3="Playlist",a$="M",ok=290,pl=233,qv="sortOrder",oj=0xf0,jD='\\"',pj="5",pk="Sys_error",b1=0x80,$="z",am="N",qu="PhotoAlbum",jp=1073741823,oi="(','",aA="K",n="e",aa="d",qt="PremiereDate",i5="ENOENT",gQ="item",cm=0x8000,pi=0x800,qs=257,og="OE",oh="Division_by_zero",ph="@{",m2="(Program not linked with -g, cannot print stack backtrace)\n",of="Channel",pg="MusicGenre",iQ=55296,ag=106380200,bi="V",bA="x",m1="total_record_count",jo=56320,aK="Y",jn=" : file already exists",M=128,cH="sh",c1=255,jC=56319,bm="id",gP=100,oe="OriginalTitle",h=848054398,pf="Revenue",qr="DisplayPreferencesId",f=-976970511,od=1114111,ff="true",jm="src/jsonm.ml",gJ=102,e_="Items",jB=-97,ay="H",jA="album_id",qq="IsHD",qp=836,jl="TH",ai="D",iP=2047,i4="separator",g3=237,qo="([^/]+)",cG="sort_name",an="Z",oc="CanDownload",qn=225,_="S",ob="MusicVideo",pe="Etag",aV="W",oa=266,gO="\\n",n$=570,m0="DateLastSaved",af="R",bS=" ",g2=191,qm="to",mZ=-67383738,iO="fs",pd="ExternalSeriesId",n_="ExtraIds",g1="StartIndex",ql="%i",mY=65279,qk="SeriesPresentationUniqueKey",n9="0x",fe=14610,n8=0xdfff,qj="PlayCount",a_=365180284,n7=": closedir failed",n6=17718,mX=160,bl="p",ax="C",n5=223,pc="ServerId",aw="y",qi="Not_found",pb=397,n4="Studio",n3="EnableMediaSourceDisplay",n2="bytes.ml",qh="%Li",pa="Invalid_argument",cI="oe",dy=254,o$="GenreItems",cF=0xffffff,hb="DateCreated",mW=847,qg="MediaSourceCount",qf="ls",o_="Trailer",qe="{rams}",qd="Video",mV=850,g0=512,jz=", ",qc="Descending",o8="%li",o9=1026,jy=133,n1="BasePluginFolder",ha="tsh",aJ="b",mU="Person",gI="\\r",iN="nan",qb="%.17g",U="h",jk="rmdir",qa="Cstruct.blit_from_string src=",n0="startIndex",mT="'}')",nZ="DatePlayed",nY=" ",o7=831,d="o",J=248,D="l",V="g",p_="ChannelInfo",p$="low",nX=837,p9="PrimaryImageAspectRatio",jj="by-id",gH="character",d2="value",nW=826,jx=" : flags Open_text and Open_binary are not compatible",p8=846,jw=": Not a directory",nV="ExternalUrls",nU="TS",u="u",mS=" : is a directory",g$="error",gZ=1006505782,o6="userId",c4=".",e9=-364210971,o5="ServiceName",mR=438511779,nT=363,o4="CollectionType",bR="name",p7="Artist",c0="q",ba=737456202,g_="server_id",o3=194,p6="genres_by_canon_name",fm="th",mP="ItemCounts",mQ=271,p5="ProductionYear",ji=",",jh="index out of bounds",mO=322,mN="{SUPERTRIANGULAR}",ec=252,o2="Runtime",iM="%d",p4=292,p2="PlaylistsFolder",p3=": file descriptor already closed",cf="-",iL="EBADF",iK=" len=",bO=-633954146,nS=12520,e$="AE",mM="items_by_date_added",nR="AO",nQ="3",fd=250,gN="TotalRecordCount",i3="ph",mL="MediaStreams",gG=103,c5='"',b0="f",mK="%.0f",p1=0xdc00,nP="TvChannel",nO="SeriesPrimaryImage",nN="buffer.ml",F="E",eb="lz";function -LV(a,b,c,d,e){if(d<=b)for(var +oq="SH",pC="Budget",op="console",cO="int_of_string",qC="member",on="ImageBlurHashes",oo=408,fn=427938126,jo="fields",cN=0xff,r2="%a",r3="%ni",ec=240,om=815,ol="tc",b_="J",r0="ThemeVideoIds",r1="SeasonUserData",fv=-211558048,pB="aa",rZ="Out_of_memory",K=963043957,cL=870828711,j8="Failure",g$="Unix.Unix_error",g_="\\b",pA="Program",rY="src/core/CCString.pp.ml",pz="DateLastMediaAdded",fB="false",py=", characters ",g9=869834347,jn="ou",ej="SortName",ok="MusicArtist",px="MediaSources",hk="Map.bal",ep=-211555818,oj="ChannelFolderItem",qA=30214610,qB=143365725,aX="v",jE="recursive",cM="ae",jm=16620,a4="w",qz="ids",oi="ProviderIds",qy="closedir",rX="Match_failure",pw="%s",ee="illegal",qx="MusicAlbum",e="",rW="pathname",oh="Year",jD="fut",ci=434236056,og=": ",hj="Id",rV="']')",qw="ChildCount",qv=851,fm="end",qu=0xe0,ht="object",jl="Jellyfin",rU="EEXIST",pv=826371656,pu="Studios",rT="Locations",pt="Height",qt="Undefined_recursive_module",rS="RecursiveItemCount",of="AirTime",b8=2147483647,hi="\\t",rR="%.16g",eo=224,hh="array",rQ="SpecialEpisodeNumbers",jC="surrogate",qs=204,hs=192,c8=0x3f,qq="Taglines",qr="CustomRating",qp="Settings",g8="'",hr=": No such file or directory",oe="CanDelete",qo=" dst=",qn="enableUserData",rP="av",bV="ts",cu=256,z="A",ps="PresentationUniqueKey",rO="[]",qm="SpecialFeatureCount",od=832,oc=3456159,j7=":",aC="T",rN="Printexc.handle_uncaught_exception",pr="Type",jB=" : flags Open_rdonly and Open_wronly are not compatible",rM="BasicSyncInfo",ei=123,rL="item.Id",ob="6",jA="sorts",pq="@;",ql=822,rK="LiveTvChannel",pp="Genre",j6="{feng}",qj="PlayAccess",qk=">",po=239,eh="Name",cK=127,cn=0xffff,qi="Sys_blocked_io",pn="ExternalEtag",W="I",bX="Unexpected end of input",oa="People",pm="_",rJ="AggregateFolder",g0="_bigarr02",jU=245,jk="not",n$=357,j5="compare: functional value",jT="mkdir",rI="parentId",fA=1000,n_="@[",g7="\\\\",rH="Primary",n9="BoxSet",n8=225181919,ed=-826170817,pl="/static/",rG=14596,R="s",dF="lib/db/stores.ml",hq="4",qh="Assert_failure",rF="Movie",n7="start_index",rD="%X",rE="OCAMLRUNPARAM",n6=253,pk=122,g6="canon",jz="in",rC=".0",dD="genres",fu="src/uutf.ml",j4="views",pj="CommunityRating",pi=8232,jj=" ms",ji="items",aB=852405675,qg=429931233,rB="ThemeSongIds",rA="Recording",n5="lone",jy="2",rz=369,gZ="Set.bal",ry="HomePageUrl",jS=120,eb=1024,qf=1027,B="U",n4="Season",aW="m",rx="includeItemTypes",dB=-752863768,ph="SyncInfo",n3="AlbumArtist",pg="tracks",n2="stream",pf="ScreenshotImageTags",da="or",g5=1017453041,jQ="Album",jR="Fatal error: exception ",aP="camlinternalFormat.ml",rw=273,n0="CriticRating",n1="ui",fz=708012133,pe="RefreshState",bq="j",aL="c",bD=24029,rv=144,jh="ItemId",ru=713199754,nZ=827,jg="date_added",pd="ENOTEMPTY",b7="dz",jx=1255,rt=726711616,rs="sortBy",qe=508493173,a="@ ",rr="Bigarray.blit: dimension mismatch",pc="Overview",qd="Ascending",hp="JSON",nY="Book",qc="Stack_overflow",ak="G",rq="Random",x="a",jw="string",hg="Path",rp=211,fy=-48,aU="P",ro=732461442,ag="t",pb="TvProgram",ea="",rn="Folder",rm="limit",nX=-10,qb=65535,nW="UserView",pa="CumulativeRunTimeTicks",qa="LocalTrailerCount",gY="ParentId",rl=814,jv="AV",cm="/",hf=605782321,p$="Tags",cS=3654863,rk="Episode",rj="Width",o$=297,ri="DZ",o_="includeExternalContent",p_="RemoteTrailers",s="O",nV="enableImages",nU="Fatal error: exception %s\n",p9=153884648,o8="sorts.views",o9="InheritedParentalRatingValue",p8="ChannelImage",bh="F",nT=818,nS="input",jf="jsError",fx="ng",p7=823,nR="UserRootFolder",o7="AudioBook",rh="ue",nQ="ManualPlaylistsFolder",bC="0",rg=197,o6="hv",ab="n",p6=679,nP="%u",je=881518886,r="r",nO="Series",jP=8100,b0="Q",nM="LiveTvProgram",nN=0x7ff0,cj="|",c$=684370880,p5="End_of_file",rf="ProductionLocations",o4="AlbumId",o5="comment",o3="^",p4=819,re=244,P="i",rc="Audio",rd="Genres",ad="L",o2="DateLastRefreshed",ju="ENOTDIR",ft="null",rb="{}",dC=17732,eg=992790154,en="+",fs=726928360,j3=8097,ra=65533,cv=3455931,nL="Chapters",fr=1023,em=125,o1="Pervasives.do_at_exit",fl=57343,p3="%c",ef=65536,nK=",@ ",js=-133,jt=0xf,aQ="k",nJ=-588596599,jO=3299808,aT="B",fq=659980059,b9="X",p2="SeriesStudio",q$="Photo",p1="infinity",o0=571,p0="CollectionFolder",q_="fd ",nI="Playlist",bb="M",oZ=290,pZ=233,q9="sortOrder",oY=0xf0,j2='\\"',pX="5",pY="Sys_error",b6=0x80,$="z",ao="N",q8="PhotoAlbum",pW=1073741823,oX="(','",aA="K",n="e",aa="d",q7="PremiereDate",jr="ENOENT",g4="item",ck=0x8000,pV=0x800,q6=257,oV="OE",oW="Division_by_zero",pU="@{",nH="(Program not linked with -g, cannot print stack backtrace)\n",oU="Channel",pT="MusicGenre",jd=55296,af=106380200,bi="V",bW="x",nG="total_record_count",jN=56320,aK="Y",jM=" : file already exists",M=128,cQ="sh",c_=255,j1=56319,bp="id",g3=100,oT="OriginalTitle",h=848054398,pS="Revenue",q5="DisplayPreferencesId",f=-976970511,oS=1114111,fp="true",jL="src/jsonm.ml",gX=102,fj="Items",j0=-97,az="H",jZ="album_id",q4="IsHD",q3=836,jK="TH",ah="D",jc=2047,jq="separator",he=237,q2="([^/]+)",cP="sort_name",ap="Z",oR="CanDownload",q1=225,_="S",oQ="MusicVideo",pR="Etag",aV="W",oP=266,g2="\\n",nF="DateLastSaved",ae="R",bZ=" ",hd=191,q0="to",nE=-67383738,jb="fs",pQ="ExternalSeriesId",oO="ExtraIds",hc="StartIndex",qZ="%i",nD=65279,qY="SeriesPresentationUniqueKey",oN="0x",fo=14610,oM=0xdfff,qX="PlayCount",ba=365180284,oL=": closedir failed",oK=17718,nC=160,bo="p",ay="C",oJ=223,pP="ServerId",ax="y",qW="Not_found",pO=397,oI="Studio",oH="EnableMediaSourceDisplay",oG="bytes.ml",qV="%Li",pN="Invalid_argument",cR="oe",dE=254,pM="GenreItems",ct=0xffffff,ho="DateCreated",nB=847,qU="MediaSourceCount",qT="ls",pL="Trailer",qS="{rams}",qR="Video",nA=850,hb=512,jY=", ",qQ="Descending",pJ="%li",pK=1026,jX=133,oF="BasePluginFolder",hn="tsh",aJ="b",nz="Person",gW="\\r",ja="nan",qP="%.17g",U="h",jJ="rmdir",qO="Cstruct.blit_from_string src=",oE="startIndex",ny="'}')",oD="DatePlayed",oC=" ",pI=831,d="o",L=248,D="l",V="g",qM="ChannelInfo",qN="low",oB=837,qL="PrimaryImageAspectRatio",jI="by-id",gV="character",d$="value",oA=826,jW=" : flags Open_text and Open_binary are not compatible",qK=846,jV=": Not a directory",oz="ExternalUrls",oy="TS",t="u",nx=" : is a directory",hm="error",ha=1006505782,pH="userId",db=".",fi=-364210971,pG="ServiceName",nw=438511779,ox=363,pF="CollectionType",bY="name",qJ="Artist",c9="q",bc=737456202,hl="server_id",pE=194,qI="genres_by_canon_name",fw="th",nu="ItemCounts",nv=271,qH="ProductionYear",jH=",",jG="index out of bounds",nt="{SUPERTRIANGULAR}",el=252,pD="Runtime",i$="%d",qG=292,qE="PlaylistsFolder",qF=": file descriptor already closed",cl="-",i_="EBADF",i9=" len=",bU=-633954146,ow=12520,fk="AE",ns="items_by_date_added",ov="AO",ou="3",jF=250,g1="TotalRecordCount",jp="ph",nr="MediaStreams",ot=654,gU=103,dc='"',b5="f",nq="%.0f",qD=0xdc00,os="TvChannel",np=", line",or="SeriesPrimaryImage",F="E",ek="lz";function +MY(a,b,c,d,e){if(d<=b)for(var f=1;f<=e;f++)c[d+f]=a[b+f];else for(var f=e;f>=1;f--)c[d+f]=a[b+f];return 0}function -LW(a,b,c,d){for(var +MZ(a,b,c,d){for(var e=0;ea.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.lo>24),c=-this.hi+(b>>24);return new @@ -63,7 +69,7 @@ b=this.lo+a.lo,c=this.mi+a.mi+(b>>24),d=this.hi+a.hi+(c>>24);return new w(b,c,d)};w.prototype.sub=function(a){var b=this.lo-a.lo,c=this.mi-a.mi+(b>>24),d=this.hi-a.hi+(c>>24);return new w(b,c,d)};w.prototype.mul=function(a){var -b=this.lo*a.lo,c=(b*rD|0)+this.mi*a.lo+this.lo*a.mi,d=(c*rD|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new +b=this.lo*a.lo,c=(b*sl|0)+this.mi*a.lo+this.lo*a.mi,d=(c*sl|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new w(b,c,d)};w.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};w.prototype.isNeg=function(){return this.hi<<16<0};w.prototype.and=function(a){return new w(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};w.prototype.or=function(a){return new w(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};w.prototype.xor=function(a){return new @@ -77,47 +83,47 @@ w(this.hi>>a-48,0,0)};w.prototype.shift_right=function(a){a=a&63;if(a==0)return c=this.hi<<16>>16;if(a<24)return new w(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var b=this.hi<<16>>31;if(a<48)return new -w(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&cp);return new -w(this.hi<<16>>a-32,b,b)};w.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&cF;this.lo=this.lo<<1&cF};w.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&cF;this.mi=(this.mi>>>1|this.hi<<23)&cF;this.hi=this.hi>>>1};w.prototype.udivmod=function(a){var +w(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&cn);return new +w(this.hi<<16>>a-32,b,b)};w.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&ct;this.lo=this.lo<<1&ct};w.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&ct;this.mi=(this.mi>>>1|this.hi<<23)&ct;this.hi=this.hi>>>1};w.prototype.udivmod=function(a){var d=0,c=this.copy(),b=a.copy(),e=new w(0,0,0);while(c.ucompare(b)>0){d++;b.lsl1()}while(d>=0){d--;e.lsl1();if(c.ucompare(b)>=0){e.lo++;c=c.sub(b)}b.lsr1()}return{quotient:e,modulus:c}};w.prototype.div=function(a){var -b=this;if(a.isZero())j1();var -d=b.hi^a.hi;if(b.hi&cm)b=b.neg();if(a.hi&cm)a=a.neg();var -c=b.udivmod(a).quotient;if(d&cm)c=c.neg();return c};w.prototype.mod=function(a){var -b=this;if(a.isZero())j1();var -d=b.hi;if(b.hi&cm)b=b.neg();if(a.hi&cm)a=a.neg();var -c=b.udivmod(a).modulus;if(d&cm)c=c.neg();return c};w.prototype.toInt=function(){return this.lo|this.mi<<24};w.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};w.prototype.toArray=function(){return[this.hi>>8,this.hi&cE,this.mi>>16,this.mi>>8&cE,this.mi&cE,this.lo>>16,this.lo>>8&cE,this.lo&cE]};w.prototype.lo32=function(){return this.lo|(this.mi&cE)<<24};w.prototype.hi32=function(){return this.mi>>>8&cp|this.hi<<16};function -Ml(a,b){return new -w(a&cF,a>>>24&cE|(b&cp)<<8,b>>>16&cp)}function -jU(a){return a.hi32()}function -jV(a){return a.lo32()}function -dB(){az(jh)}var -LY=gM;function -c6(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}c6.prototype.caml_custom=LY;c6.prototype.offset=function(a){var +b=this;if(a.isZero())sA();var +d=b.hi^a.hi;if(b.hi&ck)b=b.neg();if(a.hi&ck)a=a.neg();var +c=b.udivmod(a).quotient;if(d&ck)c=c.neg();return c};w.prototype.mod=function(a){var +b=this;if(a.isZero())sA();var +d=b.hi;if(b.hi&ck)b=b.neg();if(a.hi&ck)a=a.neg();var +c=b.udivmod(a).modulus;if(d&ck)c=c.neg();return c};w.prototype.toInt=function(){return this.lo|this.mi<<24};w.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};w.prototype.toArray=function(){return[this.hi>>8,this.hi&cN,this.mi>>16,this.mi>>8&cN,this.mi&cN,this.lo>>16,this.lo>>8&cN,this.lo&cN]};w.prototype.lo32=function(){return this.lo|(this.mi&cN)<<24};w.prototype.hi32=function(){return this.mi>>>8&cn|this.hi<<16};function +Nt(a,b){return new +w(a&ct,a>>>24&cN|(b&cn)<<8,b>>>16&cn)}function +kj(a){return a.hi32()}function +kk(a){return a.lo32()}function +dH(){aq(jG)}var +M3=g0;function +dd(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}dd.prototype.caml_custom=M3;dd.prototype.offset=function(a){var c=0;if(typeof a==="number")a=[a];if(!(a instanceof -Array))az("bigarray.js: invalid offset");if(this.dims.length!=a.length)az("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var -b=0;b=this.dims[b])dB();c=c*this.dims[b]+a[b]}else +Array))aq("bigarray.js: invalid offset");if(this.dims.length!=a.length)aq("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var +b=0;b=this.dims[b])dH();c=c*this.dims[b]+a[b]}else for(var -b=this.dims.length-1;b>=0;b--){if(a[b]<1||a[b]>this.dims[b])dB();c=c*this.dims[b]+(a[b]-1)}return c};c6.prototype.get=function(a){switch(this.kind){case +b=this.dims.length-1;b>=0;b--){if(a[b]<1||a[b]>this.dims[b])dH();c=c*this.dims[b]+(a[b]-1)}return c};dd.prototype.get=function(a){switch(this.kind){case 7:var -d=this.data[a*2+0],b=this.data[a*2+1];return Ml(d,b);case +d=this.data[a*2+0],b=this.data[a*2+1];return Nt(d,b);case 10:case 11:var -e=this.data[a*2+0],c=this.data[a*2+1];return[dy,e,c];default:return this.data[a]}};c6.prototype.set=function(a,b){switch(this.kind){case -7:this.data[a*2+0]=jV(b);this.data[a*2+1]=jU(b);break;case +e=this.data[a*2+0],c=this.data[a*2+1];return[dE,e,c];default:return this.data[a]}};dd.prototype.set=function(a,b){switch(this.kind){case +7:this.data[a*2+0]=kk(b);this.data[a*2+1]=kj(b);break;case 10:case -11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};c6.prototype.fill=function(a){switch(this.kind){case +11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};dd.prototype.fill=function(a){switch(this.kind){case 7:var -c=jV(a),e=jU(a);if(c==e)this.data.fill(c);else +c=kk(a),e=kj(a);if(c==e)this.data.fill(c);else for(var b=0;ba.data[c])return 1}break}return 0};function -eh(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}eh.prototype=new -c6();eh.prototype.offset=function(a){if(typeof +eq(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}eq.prototype=new +dd();eq.prototype.offset=function(a){if(typeof a!=="number")if(a instanceof Array&&a.length==1)a=a[0];else -az("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])dB();return a};eh.prototype.get=function(a){return this.data[a]};eh.prototype.set=function(a,b){this.data[a]=b;return 0};eh.prototype.fill=function(a){this.data.fill(a);return 0};function -jK(a,b,c,d){var -e=rt(a);if(hi(c)*e!=d.length)az("length doesn't match dims");if(b==0&&c.length==1&&e==1)return new -eh(a,b,c,d);return new -c6(a,b,c,d)}function -el(a){return a.slice(1)}function -LX(a,b,c){var -d=el(c),e=rr(a,hi(d));return jK(a,b,d,e)}function -LZ(a,b){if(b<0||b>=a.dims.length)az("Bigarray.dim");return a.dims[b]}function -L0(a){return LZ(a,0)}function -L1(a,b){return a.get(a.offset(b))}function -fD(a,b,c){var +aq("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])dH();return a};eq.prototype.get=function(a){return this.data[a]};eq.prototype.set=function(a,b){this.data[a]=b;return 0};eq.prototype.fill=function(a){this.data.fill(a);return 0};function +j$(a,b,c,d){var +e=r9(a);if(hv(c)*e!=d.length)aq("length doesn't match dims");if(b==0&&c.length==1&&e==1)return new +eq(a,b,c,d);return new +dd(a,b,c,d)}function +ev(a){return a.slice(1)}function +M2(a,b,c){var +d=ev(c),e=r6(a,hv(d));return j$(a,b,d,e)}function +M4(a,b){if(b<0||b>=a.dims.length)aq("Bigarray.dim");return a.dims[b]}function +M5(a){return M4(a,0)}function +r8(a,b){return a.get(a.offset(b))}function +fD(a,b,c){a.set(a.offset(b),c);return 0}function +fN(a,b,c){var d=String.fromCharCode;if(b==0&&c<=4096&&c==a.length)return d.apply(null,a);var -f=e;for(;0=c.l||c.t==2&&e>=c.c.length)){c.c=a.t==4?fD(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else if(c.t==2&&d==c.c.length){c.c+=a.t==4?fD(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else{if(c.t!=4)hk(c);var +b$(a,b,c,d,e){if(e==0)return 0;if(d==0&&(e>=c.l||c.t==2&&e>=c.c.length)){c.c=a.t==4?fN(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else if(c.t==2&&d==c.c.length){c.c+=a.t==4?fN(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else{if(c.t!=4)hy(c);var g=a.c,h=c.c;if(a.t==4)if(d<=b)for(var f=0;f=0;f--)h[d+f]=g[b+f];else{var i=Math.min(e,g.length-b);for(var f=0;f>=1;if(a==0)return d;b+=b;c++;if(c==9)b.slice(0,1)}}function -fu(a){if(a.t==2)a.c+=eo(a.l-a.c.length,"\0");else -a.c=fD(a.c,0,a.c.length);a.t=0}function -j4(a){if(a.length<24){for(var -b=0;bcB)return false;return true}else +fF(a){if(a.t==2)a.c+=ex(a.l-a.c.length,"\0");else +a.c=fN(a.c,0,a.c.length);a.t=0}function +kt(a){if(a.length<24){for(var +b=0;bcK)return false;return true}else return!/[^\x00-\x7f]/.test(a)}function -rS(a){for(var -k=e,d=e,h,g,i,b,c=0,j=a.length;cg0){d.substr(0,1);k+=d;d=e;k+=a.slice(c,f)}else -d+=a.slice(c,f);if(f==j)break;c=f}b=1;if(++c=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c0x10ffff)b=3}}}}}if(b<4){c-=b;d+="\ufffd"}else if(b>cp)d+=String.fromCharCode(0xd7c0+(b>>10),p1+(b&0x3FF));else -d+=String.fromCharCode(b);if(d.length>d4){d.substr(0,1);k+=d;d=e}}return k+d}function -cK(a,b,c){this.t=a;this.c=b;this.l=c}cK.prototype.toString=function(){switch(this.t){case -9:return this.c;default:fu(this);case -0:if(j4(this.c)){this.t=9;return this.c}this.t=8;case -8:return this.c}};cK.prototype.toUtf16=function(){var -a=this.toString();if(this.t==9)return a;return rS(a)};cK.prototype.slice=function(){var +sF(a){for(var +k=e,d=e,h,g,i,b,c=0,j=a.length;chb){d.substr(0,1);k+=d;d=e;k+=a.slice(c,f)}else +d+=a.slice(c,f);if(f==j)break;c=f}b=1;if(++c=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c0x10ffff)b=3}}}}}if(b<4){c-=b;d+="\ufffd"}else if(b>cn)d+=String.fromCharCode(0xd7c0+(b>>10),qD+(b&0x3FF));else +d+=String.fromCharCode(b);if(d.length>eb){d.substr(0,1);k+=d;d=e}}return k+d}function +cT(a,b,c){this.t=a;this.c=b;this.l=c}cT.prototype.toString=function(){switch(this.t){case +9:return this.c;default:fF(this);case +0:if(kt(this.c)){this.t=9;return this.c}this.t=8;case +8:return this.c}};cT.prototype.toUtf16=function(){var +a=this.toString();if(this.t==9)return a;return sF(a)};cT.prototype.slice=function(){var a=this.t==4?this.c.slice():this.c;return new -cK(this.t,a,this.l)};function -rx(a){return new -cK(0,a,a.length)}function -ci(a){return a}function -c8(a){return rx(ci(a))}function -c7(a,b,c,d,e){b6(c8(a),b,c,d,e);return 0}function +cT(this.t,a,this.l)};function +sa(a){return new +cT(0,a,a.length)}function +cp(a){return a}function +df(a){return sa(cp(a))}function +de(a,b,c,d,e){b$(df(a),b,c,d,e);return 0}function m(a){return a.length}function -bd(a,b){return a.charCodeAt(b)}function -rR(a){var +a6(a,b){return a.charCodeAt(b)}function +sE(a){var d=m(a),c=new -Uint8Array(d),b=0;for(;bm(a))dB();if(f+e>c.data.length)dB();var -g=rR(a).slice(b,b+e);c.data.set(g,f);return 0}var -L3=L2;function -rw(){az(jh)}function -c9(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case +Uint8Array(d),b=0;for(;bm(a))dH();if(f+e>c.data.length)dH();var +g=sE(a).slice(b,b+e);c.data.set(g,f);return 0}var +M7=M6;function +hw(){aq(jG)}function +cU(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case 0:return a.c.charCodeAt(b);case 4:return a.c[b]}}function -ft(a,b){if(b>>>0>=a.l)rw();return c9(a,b)}function -ao(a,b,c){c&=cE;if(a.t!=4){if(b==a.c.length){a.c+=String.fromCharCode(c);if(b+1==a.l)a.t=0;return 0}hk(a)}a.c[b]=c;return 0}function -dC(a,b,c){if(b>>>0>=a.l)rw();return ao(a,b,c)}function -cL(d,c){var +fE(a,b){if(b>>>0>=a.l)hw();return cU(a,b)}function +et(a){return new +w(a[7]<<0|a[6]<<8|a[5]<<16,a[4]<<0|a[3]<<8|a[2]<<16,a[1]<<0|a[0]<<8)}function +M_(a,b){if(b>>>0>=a.l-7)hw();var +d=new +Array(8);for(var +c=0;c<8;c++)d[7-c]=cU(a,b+c);return et(d)}function +al(a,b,c){c&=cN;if(a.t!=4){if(b==a.c.length){a.c+=String.fromCharCode(c);if(b+1==a.l)a.t=0;return 0}hy(a)}a.c[b]=c;return 0}function +cw(a,b,c){if(b>>>0>=a.l)hw();return al(a,b,c)}function +eu(a){return a.toArray()}function +M$(a,b,c){if(b>>>0>=a.l-7)hw();var +e=eu(c);for(var +d=0;d<8;d++)al(a,b+7-d,e[d]);return 0}function +cV(d,c){var f=d.l>=0?d.l:d.l=d.length,e=c.length,b=f-e;if(b==0)return d.apply(null,c);else if(b<0){var a=d.apply(null,c.slice(0,f));if(typeof -a!=="function")return a;return cL(a,c.slice(f))}else{switch(b){case +a!=="function")return a;return cV(a,c.slice(f))}else{switch(b){case 1:{var a=function(a){var f=new @@ -224,30 +241,29 @@ a=function(){var e=arguments.length==0?1:arguments.length,b=new Array(c.length+e);for(var a=0;a>>0>=a.length-1)dB();return a}function -jM(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function -rE(a){return 0}var -M1=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function -M0(a){if(M1)return Math.floor(Math.log2(a));var +a=0;a>>0>=a.length-1)dH();return a}function +kb(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function +so(a){return a==jU?1:0}var +N6=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function +N5(a){if(N6)return Math.floor(Math.log2(a));var b=0;if(a==0)return-Infinity;if(a>=1)while(a>=2){a/=2;b++}else while(a<1){a*=2;b--}return b}function -jS(a){var +kh(a){var b=new Float32Array(1);b[0]=a;var c=new Int32Array(b.buffer);return c[0]|0}function -dD(a,b,c){return new +bk(a,b,c){return new w(a,b,c)}function -hm(a){if(!isFinite(a)){if(isNaN(a))return dD(1,0,m8);return a>0?dD(0,0,m8):dD(0,0,0xfff0)}var -f=a==0&&1/a==-Infinity?cm:a>=0?0:cm;if(f)a=-a;var -b=M0(a)+fh;if(b<=0){b=0;a/=Math.pow(2,-o9)}else{a/=Math.pow(2,b-pC);if(a<16){a*=2;b-=1}if(b==0)a/=2}var +hB(a){if(!isFinite(a)){if(isNaN(a))return bk(1,0,nN);return a>0?bk(0,0,nN):bk(0,0,0xfff0)}var +f=a==0&&1/a==-Infinity?ck:a>=0?0:ck;if(f)a=-a;var +b=N5(a)+fr;if(b<=0){b=0;a/=Math.pow(2,-pK)}else{a/=Math.pow(2,b-qf);if(a<16){a*=2;b-=1}if(b==0)a/=2}var d=Math.pow(2,24),c=a|0;a=(a-c)*d;var e=a|0;a=(a-e)*d;var -g=a|0;c=c&i7|f|b<<4;return dD(g,e,c)}function -fz(a){return a.toArray()}function -rv(a,b,c){a.write(32,b.dims.length);a.write(32,b.kind|b.layout<<8);if(b.caml_custom==gM)for(var -d=0;d>4;if(d==iP)return(f|g|c&i7)==0?c&cm?-Infinity:Infinity:NaN;var -e=Math.pow(2,-24),b=(f*e+g)*e+(c&i7);if(d>0){b+=16;b*=Math.pow(2,d-pC)}else -b*=Math.pow(2,-o9);if(c&cm)b=-b;return b}function -bB(a){if(!bb.Failure)bb.Failure=[J,bV(jJ),-3];j0(bb.Failure,a)}function -rs(a,b,c){var -k=a.read32s();if(k<0||k>16)bB("input_value: wrong number of bigarray dimensions");var -r=a.read32s(),l=r&cE,q=r>>8&1,j=[];if(c==gM)for(var +es(a){var +f=a.lo,g=a.mi,c=a.hi,d=(c&0x7fff)>>4;if(d==jc)return(f|g|c&jt)==0?c&ck?-Infinity:Infinity:NaN;var +e=Math.pow(2,-24),b=(f*e+g)*e+(c&jt);if(d>0){b+=16;b*=Math.pow(2,d-qf)}else +b*=Math.pow(2,-pK);if(c&ck)b=-b;return b}function +aZ(a){if(!bd.Failure)bd.Failure=[L,bF(j8),-3];kq(bd.Failure,a)}function +r7(a,b,c){var +k=a.read32s();if(k<0||k>16)aZ("input_value: wrong number of bigarray dimensions");var +r=a.read32s(),l=r&cN,q=r>>8&1,j=[];if(c==g0)for(var d=0;d>>32-15;b=hq(b,0x1b873593);a^=b;a=a<<13|a>>>32-13;return(a+(a<<2)|0)+(0xe6546b64|0)|0}function -Mg(a,b){a=bc(a,jV(b));a=bc(a,jU(b));return a}function -jQ(a,b){return Mg(a,hm(b))}function -ru(a){var -c=hi(a.dims),d=0;switch(a.kind){case +n=es(et(g));i.set(d,[dE,o,n])}break}b[0]=(4+k)*4;return j$(l,q,j,h)}function +r5(a,b,c){return a.compare(b,c)}function +hF(a,b){return Math.imul(a,b)}function +be(a,b){b=hF(b,0xcc9e2d51|0);b=b<<15|b>>>32-15;b=hF(b,0x1b873593);a^=b;a=a<<13|a>>>32-13;return(a+(a<<2)|0)+(0xe6546b64|0)|0}function +No(a,b){a=be(a,kk(b));a=be(a,kj(b));return a}function +kf(a,b){return No(a,hB(b))}function +r_(a){var +c=hv(a.dims),d=0;switch(a.kind){case 2:case 3:case -12:if(c>cn)c=cn;var -e=0,b=0;for(b=0;b+4<=a.data.length;b+=4){e=a.data[b+0]|a.data[b+1]<<8|a.data[b+2]<<16|a.data[b+3]<<24;d=bc(d,e)}e=0;switch(c&3){case +12:if(c>cu)c=cu;var +e=0,b=0;for(b=0;b+4<=a.data.length;b+=4){e=a.data[b+0]|a.data[b+1]<<8|a.data[b+2]<<16|a.data[b+3]<<24;d=be(d,e)}e=0;switch(c&3){case 3:e=a.data[b+2]<<16;case 2:e|=a.data[b+1]<<8;case -1:e|=a.data[b+0];d=bc(d,e)}break;case +1:e|=a.data[b+0];d=be(d,e)}break;case 4:case 5:if(c>M)c=M;var -e=0,b=0;for(b=0;b+2<=a.data.length;b+=2){e=a.data[b+0]|a.data[b+1]<<16;d=bc(d,e)}if((c&1)!=0)d=bc(d,a.data[b]);break;case +e=0,b=0;for(b=0;b+2<=a.data.length;b+=2){e=a.data[b+0]|a.data[b+1]<<16;d=be(d,e)}if((c&1)!=0)d=be(d,a.data[b]);break;case 6:if(c>64)c=64;for(var -b=0;b64)c=64;for(var -b=0;b32)c=32;c*=2;for(var -b=0;b64)c=64;for(var -b=0;b32)c=32;for(var -b=0;b0?f(b,a,d):f(a,b,d);if(d&&e!=e)return c;if(+e!=+e)return+e;if((e|0)!=0)return e|0}return c}function -ho(a){return typeof +hD(a){return typeof a==="string"&&!/[^\x00-\xff]/.test(a)}function -hn(a){return a +hC(a){return a instanceof -cK}function -rz(a){if(typeof -a==="number")return fq;else if(hn(a))return ec;else if(ho(a))return 1252;else if(a +cT}function +sc(a){if(typeof +a==="number")return fA;else if(hC(a))return el;else if(hD(a))return 1252;else if(a instanceof -Array&&a[0]===a[0]>>>0&&a[0]<=c1){var -b=a[0]|0;return b==dy?0:b}else if(a +Array&&a[0]===a[0]>>>0&&a[0]<=c_){var +b=a[0]|0;return b==dE?0:b}else if(a instanceof -String)return nS;else if(typeof -a=="string")return nS;else if(a +String)return ow;else if(typeof +a=="string")return ow;else if(a instanceof -Number)return fq;else if(a&&a.caml_custom)return i$;else if(a&&a.compare)return 1256;else if(typeof +Number)return fA;else if(a&&a.caml_custom)return jx;else if(a&&a.compare)return 1256;else if(typeof a=="function")return 1247;else if(typeof a=="symbol")return 1251;return 1001}function -jW(a,b){if(ab?1:0}function -L5(a,b){a.t&6&&fu(a);b.t&6&&fu(b);return a.cb.c?1:0}function -ej(a,b,c){var +km(a,b){if(ab?1:0}function +M9(a,b){a.t&6&&fF(a);b.t&6&&fF(b);return a.cb.c?1:0}function +er(a,b,c){var f=[];for(;;){if(!(c&&a===b)){var -e=rz(a);if(e==fd){a=a[1];continue}var -g=rz(b);if(g==fd){b=b[1];continue}if(e!==g){if(e==fq){if(g==i$)return ry(a,b,-1,c);return-1}if(g==fq){if(e==i$)return ry(b,a,1,c);return 1}return eb)return 1;if(a!=b){if(!c)return NaN;if(a==a)return 1;if(b==b)return-1}break;case 1251:if(a!==b){if(!c)return NaN;return 1}break;case 1252:var -a=ci(a),b=ci(b);if(a!==b){if(ab)return 1}break;case +a=cp(a),b=cp(b);if(a!==b){if(ab)return 1}break;case 12520:var a=a.toString(),b=b.toString();if(a!==b){if(ab)return 1}break;case 246:case -254:default:if(rE(e)){az("compare: continuation value");break}if(a.length!=b.length)return a.length1)f.push(a,b,1);break}}if(f.length==0)return 0;var +254:default:if(so(e)){aq("compare: continuation value");break}if(a.length!=b.length)return a.length1)f.push(a,b,1);break}}if(f.length==0)return 0;var h=f.pop();b=f.pop();a=f.pop();if(h+10)if(b==0&&(c>=a.l||a.t==2&&c>=a.c.length))if(d==0){a.c=e;a.t=2}else{a.c=eo(c,String.fromCharCode(d));a.t=c==a.l?0:2}else{if(a.t!=4)hk(a);for(c+=b;b0&&b===b)return b;a=a.replace(/_/g,e);b=+a;if(a.length>0&&b===b||/^[+-]?nan$/i.test(a))return b;var +dI(a,b){return er(a,b,true)}function +Na(){return[0]}function +am(a){if(a<0)aq("Bytes.create");return new +cT(a?2:9,e,a)}var +hz=[0];function +Nc(a,b){if(hz!==a)return 0;hz=b;return 1}function +sd(a){return hz}function +Nd(a){hz=a}function +Ne(a,b){return+(er(a,b,false)==0)}function +Ng(a,b,c,d){if(c>0)if(b==0&&(c>=a.l||a.t==2&&c>=a.c.length))if(d==0){a.c=e;a.t=2}else{a.c=ex(c,String.fromCharCode(d));a.t=c==a.l?0:2}else{if(a.t!=4)hy(a);for(c+=b;b0&&b===b)return b;a=a.replace(/_/g,e);b=+a;if(a.length>0&&b===b||/^[+-]?nan$/i.test(a))return b;var c=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(a);if(c){var -d=c[3].replace(/0+$/,e),g=parseInt(c[1]+c[2]+d,16),f=(c[5]|0)-4*d.length;b=g*Math.pow(2,f);return b}if(/^\+?inf(inity)?$/i.test(a))return Infinity;if(/^-inf(inity)?$/i.test(a))return-Infinity;bB("float_of_string")}function -jZ(a){a=ci(a);var -e=a.length;if(e>31)az("format_int: format too long");var -b={justify:ee,signstyle:cf,filler:bS,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:b0};for(var +d=c[3].replace(/0+$/,e),g=parseInt(c[1]+c[2]+d,16),f=(c[5]|0)-4*d.length;b=g*Math.pow(2,f);return b}if(/^\+?inf(inity)?$/i.test(a))return Infinity;if(/^-inf(inity)?$/i.test(a))return-Infinity;aZ("float_of_string")}function +kp(a){a=cp(a);var +e=a.length;if(e>31)aq("format_int: format too long");var +b={justify:en,signstyle:cl,filler:bZ,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:b5};for(var d=0;d=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case".":b.prec=0;d++;while(c=a.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;case"d":case"i":b.signedconv=true;case"u":b.base=10;break;case"x":b.base=16;break;case"X":b.base=16;b.uppercase=true;break;case"o":b.base=8;break;case"e":case"f":case"g":b.signedconv=true;b.conv=c;break;case"E":case"F":case"G":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function -jO(a,b){if(a.uppercase)b=b.toUpperCase();var -f=b.length;if(a.signedconv&&(a.sign<0||a.signstyle!=cf))f++;if(a.alternate){if(a.base==8)f+=1;if(a.base==16)f+=2}var -c=e;if(a.justify==ee&&a.filler==bS)for(var -d=f;d=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case".":b.prec=0;d++;while(c=a.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;case"d":case"i":b.signedconv=true;case"u":b.base=10;break;case"x":b.base=16;break;case"X":b.base=16;b.uppercase=true;break;case"o":b.base=8;break;case"e":case"f":case"g":b.signedconv=true;b.conv=c;break;case"E":case"F":case"G":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function +kd(a,b){if(a.uppercase)b=b.toUpperCase();var +f=b.length;if(a.signedconv&&(a.sign<0||a.signstyle!=cl))f++;if(a.alternate){if(a.base==8)f+=1;if(a.base==16)f+=2}var +c=e;if(a.justify==en&&a.filler==bZ)for(var +d=f;d20){c-=20;a/=Math.pow(10,c);a+=new -Array(c+1).join(bz);if(b>0)a=a+c4+new -Array(b+1).join(bz);return a}else +c=parseInt(a.toString().split(en)[1]);if(c>20){c-=20;a/=Math.pow(10,c);a+=new +Array(c+1).join(bC);if(b>0)a=a+db+new +Array(b+1).join(bC);return a}else return a.toFixed(b)}}var -c,f=jZ(a),e=f.prec<0?6:f.prec;if(b<0||b==0&&1/b==-Infinity){f.sign=-1;b=-b}if(isNaN(b)){c=iN;f.filler=bS}else if(!isFinite(b)){c="inf";f.filler=bS}else +c,f=kp(a),e=f.prec<0?6:f.prec;if(b<0||b==0&&1/b==-Infinity){f.sign=-1;b=-b}if(isNaN(b)){c=ja;f.filler=bZ}else if(!isFinite(b)){c="inf";f.filler=bZ}else switch(f.conv){case"e":var -c=b.toExponential(e),d=c.length;if(c.charAt(d-3)==n)c=c.slice(0,d-1)+bz+c.slice(d-1);break;case"f":c=j(b,e);break;case"g":e=e?e:1;c=b.toExponential(e-1);var +c=b.toExponential(e),d=c.length;if(c.charAt(d-3)==n)c=c.slice(0,d-1)+bC+c.slice(d-1);break;case"f":c=j(b,e);break;case"g":e=e?e:1;c=b.toExponential(e-1);var i=c.indexOf(n),h=+c.slice(i+1);if(h<-4||b>=1e21||b.toFixed(0).length>e){var -d=i-1;while(c.charAt(d)==bz)d--;if(c.charAt(d)==c4)d--;c=c.slice(0,d+1)+c.slice(i);d=c.length;if(c.charAt(d-3)==n)c=c.slice(0,d-1)+bz+c.slice(d-1);break}else{var +d=i-1;while(c.charAt(d)==bC)d--;if(c.charAt(d)==db)d--;c=c.slice(0,d+1)+c.slice(i);d=c.length;if(c.charAt(d-3)==n)c=c.slice(0,d-1)+bC+c.slice(d-1);break}else{var g=e;if(h<0){g-=h+1;c=b.toFixed(g)}else while(c=b.toFixed(g),c.length>e+1)g--;if(g){var -d=c.length-1;while(c.charAt(d)==bz)d--;if(c.charAt(d)==c4)d--;c=c.slice(0,d+1)}}break}return jO(f,c)}function -fx(a,b){if(ci(a)==iM)return bV(e+b);var -c=jZ(a);if(b<0)if(c.signedconv){c.sign=-1;b=-b}else +d=c.length-1;while(c.charAt(d)==bC)d--;if(c.charAt(d)==db)d--;c=c.slice(0,d+1)}}break}return kd(f,c)}function +fI(a,b){if(cp(a)==i$)return bF(e+b);var +c=kp(a);if(b<0)if(c.signedconv){c.sign=-1;b=-b}else b>>>=0;var -d=b.toString(c.base);if(c.prec>=0){c.filler=bS;var -f=c.prec-d.length;if(f>0)d=eo(f,bz)+d}return jO(c,d)}var -MP=0;function -aZ(){return MP++}function -bU(a){if(j4(a))return a;return rS(a)}function -fF(){return typeof +d=b.toString(c.base);if(c.prec>=0){c.filler=bZ;var +f=c.prec-d.length;if(f>0)d=ex(f,bC)+d}return kd(c,d)}var +NV=0;function +a5(){return NV++}function +b1(a){if(kt(a))return a;return sF(a)}function +fP(){return typeof N.process!=="undefined"&&typeof N.process.versions!=="undefined"&&typeof N.process.versions.node!=="undefined"}function -M2(){function -a(a){if(a.charAt(0)===cg)return[e,a.substring(1)];return}function +N7(){function +a(a){if(a.charAt(0)===cm)return[e,a.substring(1)];return}function b(a){var -h=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b=h.exec(a),c=b[1]||e,f=Boolean(c&&c.charAt(1)!==jI);if(Boolean(b[2]||f)){var -d=b[1]||e,g=b[2]||e;return[d,a.substring(d.length+g.length)]}return}return fF()&&N.process&&N.process.platform?N.process.platform==="win32"?b:a:a}var -j5=M2();function -rQ(a){return a.slice(-1)!==cg?a+cg:a}if(fF()&&N.process&&N.process.cwd)var -fv=N.process.cwd().replace(/\\/g,cg);else +h=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b=h.exec(a),c=b[1]||e,f=Boolean(c&&c.charAt(1)!==j7);if(Boolean(b[2]||f)){var +d=b[1]||e,g=b[2]||e;return[d,a.substring(d.length+g.length)]}return}return fP()&&N.process&&N.process.platform?N.process.platform==="win32"?b:a:a}var +ku=N7();function +sD(a){return a.slice(-1)!==cm?a+cm:a}if(fP()&&N.process&&N.process.cwd)var +fG=N.process.cwd().replace(/\\/g,cm);else var -fv="/static";fv=rQ(fv);function -MB(a){a=bU(a);if(!j5(a))a=fv+a;var -e=j5(a),d=e[1].split(cg),b=[];for(var +fG="/static";fG=sD(fG);function +NJ(a){a=b1(a);if(!ku(a))a=fG+a;var +e=ku(a),d=e[1].split(cm),b=[];for(var c=0;c1)b.pop();break;case".":break;case"":break;default:b.push(d[c]);break}b.unshift(e[0]);b.orig=a;return b}function -MZ(a){for(var -g=e,c=g,b,i,d=0,h=a.length;dg0){c.substr(0,1);g+=c;c=e;g+=a.slice(d,f)}else -c+=a.slice(d,f);if(f==h)break;d=f}if(b>6);c+=String.fromCharCode(b1|b&cZ)}else if(b<0xd800||b>=n8)c+=String.fromCharCode(pS|b>>12,b1|b>>6&cZ,b1|b&cZ);else if(b>=0xdbff||d+1==h||(i=a.charCodeAt(d+1))n8)c+="\xef\xbf\xbd";else{d++;b=(b<<10)+i-0x35fdc00;c+=String.fromCharCode(oj|b>>18,b1|b>>12&cZ,b1|b>>6&cZ,b1|b&cZ)}if(c.length>d4){c.substr(0,1);g+=c;c=e}}return g+c}function -b8(a){return j4(a)?bV(a):bV(MZ(a))}var -M3=["E2BIG","EACCES","EAGAIN",iL,"EBUSY","ECHILD","EDEADLK","EDOM",rf,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",i5,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",i8,oz,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function -cP(a,b,c,d){var -f=M3.indexOf(a);if(f<0){if(d==null)d=-9999;f=[0,d]}var -g=[f,b8(b||e),b8(c||e)];return g}var -rK={};function -da(a){return rK[a]}function -cN(a,b){throw i([0,a].concat(b))}function -jL(a){if(!(a +N4(a){for(var +g=e,c=g,b,i,d=0,h=a.length;dhb){c.substr(0,1);g+=c;c=e;g+=a.slice(d,f)}else +c+=a.slice(d,f);if(f==h)break;d=f}if(b>6);c+=String.fromCharCode(b6|b&c8)}else if(b<0xd800||b>=oM)c+=String.fromCharCode(qu|b>>12,b6|b>>6&c8,b6|b&c8);else if(b>=0xdbff||d+1==h||(i=a.charCodeAt(d+1))oM)c+="\xef\xbf\xbd";else{d++;b=(b<<10)+i-0x35fdc00;c+=String.fromCharCode(oY|b>>18,b6|b>>12&c8,b6|b>>6&c8,b6|b&c8)}if(c.length>eb){c.substr(0,1);g+=c;c=e}}return g+c}function +cb(a){return kt(a)?bF(a):bF(N4(a))}var +N8=["E2BIG","EACCES","EAGAIN",i_,"EBUSY","ECHILD","EDEADLK","EDOM",rU,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",jr,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",ju,pd,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function +cX(a,b,c,d){var +f=N8.indexOf(a);if(f<0){if(d==null)d=-9999;f=[0,d]}var +g=[f,cb(b||e),cb(c||e)];return g}var +sv={};function +di(a){return sv[a]}function +cW(a,b){throw i([0,a].concat(b))}function +ka(a){if(!(a instanceof Uint8Array))a=new Uint8Array(a);return new -cK(4,a,a.length)}function -H(a){j0(bb.Sys_error,a)}function -rN(a){H(a+he)}function -fE(a){if(a.t!=4)hk(a);return a.c}function +cT(4,a,a.length)}function +I(a){kq(bd.Sys_error,a)}function +sz(a){I(a+hr)}function +fO(a){if(a.t!=4)hy(a);return a.c}function aR(a){return a.l}function -rp(){}function +r4(){}function bj(a){this.data=a}bj.prototype=new -rp();bj.prototype.constructor=bj;bj.prototype.truncate=function(a){var -b=this.data;this.data=ap(a|0);b6(b,0,this.data,0,a)};bj.prototype.length=function(){return aR(this.data)};bj.prototype.write=function(a,b,c,d){var +r4();bj.prototype.constructor=bj;bj.prototype.truncate=function(a){var +b=this.data;this.data=am(a|0);b$(b,0,this.data,0,a)};bj.prototype.length=function(){return aR(this.data)};bj.prototype.write=function(a,b,c,d){var e=this.length();if(a+d>=e){var -f=ap(a+d),g=this.data;this.data=f;b6(g,0,this.data,0,e)}b6(jL(b),c,this.data,a,d);return 0};bj.prototype.read=function(a,b,c,d){var +f=am(a+d),g=this.data;this.data=f;b$(g,0,this.data,0,e)}b$(ka(b),c,this.data,a,d);return 0};bj.prototype.read=function(a,b,c,d){var e=this.length();if(a+d>=e)d=e-a;if(d){var -f=ap(d|0);b6(this.data,a,f,0,d);b.set(fE(f),c)}return d};function -dA(a,b,c){this.file=b;this.name=a;this.flags=c}dA.prototype.err_closed=function(){H(this.name+p3)};dA.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()};dA.prototype.write=function(a,b,c,d){if(this.file)return this.file.write(a,b,c,d);this.err_closed()};dA.prototype.read=function(a,b,c,d){if(this.file)return this.file.read(a,b,c,d);this.err_closed()};dA.prototype.close=function(){this.file=undefined};function +f=am(d|0);b$(this.data,a,f,0,d);b.set(fO(f),c)}return d};function +dG(a,b,c){this.file=b;this.name=a;this.flags=c}dG.prototype.err_closed=function(){I(this.name+qF)};dG.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()};dG.prototype.write=function(a,b,c,d){if(this.file)return this.file.write(a,b,c,d);this.err_closed()};dG.prototype.read=function(a,b,c,d){if(this.file)return this.file.read(a,b,c,d);this.err_closed()};dG.prototype.close=function(){this.file=undefined};function aY(a,b){this.content={};this.root=a;this.lookupFun=b}aY.prototype.nm=function(a){return this.root+a};aY.prototype.create_dir_if_needed=function(a){var -d=a.split(cg),c=e;for(var -b=0;b=0)}function -jR(a,b){var -e=b.length,c,d;for(c=0;c+4<=e;c+=4){d=b.charCodeAt(c)|b.charCodeAt(c+1)<<8|b.charCodeAt(c+2)<<16|b.charCodeAt(c+3)<<24;a=bc(a,d)}d=0;switch(e&3){case +a=0;a=0)}function +kg(a,b){var +e=b.length,c,d;for(c=0;c+4<=e;c+=4){d=b.charCodeAt(c)|b.charCodeAt(c+1)<<8|b.charCodeAt(c+2)<<16|b.charCodeAt(c+3)<<24;a=be(a,d)}d=0;switch(e&3){case 3:d=b.charCodeAt(c+2)<<16;case 2:d|=b.charCodeAt(c+1)<<8;case -1:d|=b.charCodeAt(c);a=bc(a,d)}a^=e;return a}function -Mh(a,b){return jR(a,ci(b))}function -Me(a,b){var -e=b.length,c,d;for(c=0;c+4<=e;c+=4){d=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24;a=bc(a,d)}d=0;switch(e&3){case +1:d|=b.charCodeAt(c);a=be(a,d)}a^=e;return a}function +Np(a,b){return kg(a,cp(b))}function +Nm(a,b){var +e=b.length,c,d;for(c=0;c+4<=e;c+=4){d=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24;a=be(a,d)}d=0;switch(e&3){case 3:d=b[c+2]<<16;case 2:d|=b[c+1]<<8;case -1:d|=b[c];a=bc(a,d)}a^=e;return a}function -ME(a){switch(a.t&6){default:fu(a);case +1:d|=b[c];a=be(a,d)}a^=e;return a}function +NM(a){switch(a.t&6){default:fF(a);case 0:return a.c;case 4:return a.c}}function -Md(a,b){var -c=ME(b);return typeof -c==="string"?jR(a,c):Me(a,c)}function -Mf(a){a^=a>>>16;a=hq(a,0x85ebca6b|0);a^=a>>>13;a=hq(a,0xc2b2ae35|0);a^=a>>>16;return a}function -rC(a,b,c,d){var -j,k,l,h,g,f,e,i,m;h=b;if(h<0||h>cn)h=cn;g=a;f=c;j=[d];k=0;l=1;while(k0){e=j[k++];if(e&&e.caml_custom){if(fw[e.caml_custom]&&fw[e.caml_custom].hash){var -n=fw[e.caml_custom].hash(e);f=bc(f,n);g--}}else if(e +Nl(a,b){var +c=NM(b);return typeof +c==="string"?kg(a,c):Nm(a,c)}function +Nn(a){a^=a>>>16;a=hF(a,0x85ebca6b|0);a^=a>>>13;a=hF(a,0xc2b2ae35|0);a^=a>>>16;return a}function +sg(a,b,c,d){var +j,k,l,h,g,f,e,i,m;h=b;if(h<0||h>cu)h=cu;g=a;f=c;j=[d];k=0;l=1;while(k0){e=j[k++];if(e&&e.caml_custom){if(fH[e.caml_custom]&&fH[e.caml_custom].hash){var +n=fH[e.caml_custom].hash(e);f=be(f,n);g--}}else if(e instanceof Array&&e[0]===(e[0]|0))switch(e[0]){case -248:f=bc(f,e[2]);g--;break;case -250:j[--k]=e[1];break;default:if(rE(e[0]))break;var -o=e.length-1<<10|e[0];f=bc(f,o);for(i=1,m=e.length;i=h)break;j[l++]=e[i]}break}else if(hn(e)){f=Md(f,e);g--}else if(ho(e)){f=Mh(f,e);g--}else if(typeof -e==="string"){f=jR(f,e);g--}else if(e===(e|0)){f=bc(f,e+e+1);g--}else if(typeof -e==="number"){f=jQ(f,e);g--}}f=Mf(f);return f&0x3FFFFFFF}function -Mi(a,b,c){if(!isFinite(a)){if(isNaN(a))return b8(iN);return b8(a>0?pn:"-infinity")}var +248:f=be(f,e[2]);g--;break;case +250:j[--k]=e[1];break;default:if(so(e[0]))break;var +o=e.length-1<<10|e[0];f=be(f,o);for(i=1,m=e.length;i=h)break;j[l++]=e[i]}break}else if(hC(e)){f=Nl(f,e);g--}else if(hD(e)){f=Np(f,e);g--}else if(typeof +e==="string"){f=kg(f,e);g--}else if(e===(e|0)){f=be(f,e+e+1);g--}else if(typeof +e==="number"){f=kf(f,e);g--}}f=Nn(f);return f&0x3FFFFFFF}function +Nq(a,b,c){if(!isFinite(a)){if(isNaN(a))return cb(ja);return cb(a>0?p1:"-infinity")}var k=a==0&&1/a==-Infinity?1:a>=0?0:1;if(k)a=-a;var f=0;if(a==0);else if(a<1)while(a<1&&f>-1022){a*=2;f--}else while(a>=2){a/=2;f++}var -l=f<0?e:ee,g=e;if(k)g=cf;else +l=f<0?e:en,g=e;if(k)g=cl;else switch(c){case -43:g=ee;break;case -32:g=bS;break;default:break}if(b>=0&&b<13){var +43:g=en;break;case +32:g=bZ;break;default:break}if(b>=0&&b<13){var i=Math.pow(2,b*4);a=Math.round(a*i)/i}var d=a.toString(16);if(b>=0){var -j=d.indexOf(c4);if(j<0)d+=c4+eo(b,bz);else{var -h=j+1+b;if(d.length>24&cF,a>>31&cp)}function -Mt(a){return a.toInt()}function -Mo(a){return+a.isNeg()}function -Mr(a){return a.neg()}function -Mm(a,b){var -c=jZ(a);if(c.signedconv&&Mo(b)){c.sign=-1;b=Mr(b)}var -d=e,i=Ms(c.base),h="0123456789abcdef";do{var -g=b.udivmod(i);b=g.quotient;d=h.charAt(Mt(g.modulus))+d}while(!Mp(b));if(c.prec>=0){c.filler=bS;var -f=c.prec-d.length;if(f>0)d=eo(f,bz)+d}return jO(c,d)}function -MQ(a){var -b=0,e=m(a),c=10,d=1;if(e>0)switch(bd(a,b)){case +j=d.indexOf(db);if(j<0)d+=db+ex(b,bC);else{var +h=j+1+b;if(d.length>24&ct,a>>31&cn)}function +sn(a){return a.toInt()}function +Nw(a){return+a.isNeg()}function +sj(a){return a.neg()}function +Nu(a,b){var +c=kp(a);if(c.signedconv&&Nw(b)){c.sign=-1;b=sj(b)}var +d=e,i=fJ(c.base),h="0123456789abcdef";do{var +g=b.udivmod(i);b=g.quotient;d=h.charAt(sn(g.modulus))+d}while(!Nx(b));if(c.prec>=0){c.filler=bZ;var +f=c.prec-d.length;if(f>0)d=ex(f,bC)+d}return kd(c,d)}function +sm(a,b){return a.or(b)}function +sx(a){var +b=0,e=m(a),c=10,d=1;if(e>0)switch(a6(a,b)){case 45:b++;d=-1;break;case -43:b++;d=1;break}if(b+10)switch(bd(a,b)){case 66:c=2;b+=2;break;case 117:case 85:b+=2;break}return[b,d,c]}function -rL(a){if(a>=48&&a<=57)return a-48;if(a>=65&&a<=90)return a-55;if(a>=97&&a<=oH)return a-87;return-1}function -Mv(a){var -h=MQ(a),d=h[0],i=h[1],e=h[2],g=m(a),j=-1>>>0,f=d=e)bB(gY);var -b=c;for(d++;d=e)break;b=e*b+c;if(b>j)bB(gY)}if(d!=g)bB(gY);b=i*b;if(e==10&&(b|0)!=b)bB(gY);return b|0}function -c_(a,b,c){return a[bU(b)].apply(a,el(c))}function -Mx(a,b){switch(b.length){case +hG(a){if(a>=48&&a<=57)return a-48;if(a>=65&&a<=90)return a-55;if(a>=97&&a<=pk)return a-87;return-1}function +ND(a){var +h=sx(a),d=h[0],i=h[1],e=h[2],g=m(a),j=-1>>>0,f=d=e)aZ(cO);var +b=c;for(d++;d=e)break;b=e*b+c;if(b>j)aZ(cO)}if(d!=g)aZ(cO);b=i*b;if(e==10&&(b|0)!=b)aZ(cO);return b|0}function +dg(a,b,c){return a[b1(b)].apply(a,ev(c))}function +NF(a,b){switch(b.length){case 1:return new a;case 2:return new @@ -716,53 +735,77 @@ a(b[1],b[2],b[3],b[4],b[5]);case a(b[1],b[2],b[3],b[4],b[5],b[6]);case 8:return new a(b[1],b[2],b[3],b[4],b[5],b[6],b[7])}function -c(){return a.apply(this,el(b))}c.prototype=a.prototype;return new +c(){return a.apply(this,ev(b))}c.prototype=a.prototype;return new c}function -rF(a){var +sp(a){var c={};for(var b=1;b>16;return c}function -rG(a,b,c){var -o=2,p=3,s=5,e=6,i=7,h=8,k=9,n=1,m=2,r=3,t=4,q=5;if(!a.lex_default){a.lex_base=fB(a[n]);a.lex_backtrk=fB(a[m]);a.lex_check=fB(a[q]);a.lex_trans=fB(a[t]);a.lex_default=fB(a[r])}var -f,d=b,l=fE(c[o]);if(d>=0){c[i]=c[s]=c[e];c[h]=-1}else +sq(a,b,c){var +o=2,p=3,s=5,e=6,i=7,h=8,k=9,n=1,m=2,r=3,t=4,q=5;if(!a.lex_default){a.lex_base=fL(a[n]);a.lex_backtrk=fL(a[m]);a.lex_check=fL(a[q]);a.lex_trans=fL(a[t]);a.lex_default=fL(a[r])}var +f,d=b,l=fO(c[o]);if(d>=0){c[i]=c[s]=c[e];c[h]=-1}else d=-d-1;for(;;){var g=a.lex_base[d];if(g<0)return-g-1;var j=a.lex_backtrk[d];if(j>=0){c[i]=c[e];c[h]=j}if(c[e]>=c[p])if(c[k]==0)return-d-1;else -f=cn;else{f=l[c[e]];c[e]++}if(a.lex_check[g+f]==d)d=a.lex_trans[g+f];else -d=a.lex_default[d];if(d<0){c[e]=c[i];if(c[h]==-1)bB("lexing: empty token");else -return c[h]}else if(f==cn)c[k]=0}}function -hp(a){var +f=cu;else{f=l[c[e]];c[e]++}if(a.lex_check[g+f]==d)d=a.lex_trans[g+f];else +d=a.lex_default[d];if(d<0){c[e]=c[i];if(c[h]==-1)aZ("lexing: empty token");else +return c[h]}else if(f==cu)c[k]=0}}function +hE(a){var c=0;for(var b=a.length-1;b>=0;b--){var d=a[b];c=[0,d,c]}return c}function -MA(a){var +NI(a){var b=[];for(;a!==0;a=a[2])b.push(a[1]);return b}function -cM(a,b){if(a<0)dB();var +sw(a){return bF(a)}function +sh(a,b){return a.add(b)}function +si(a,b){return a.mul(b)}function +kl(a,b){return a.ucompare(b)<0}function +sk(a){var +g=sx(a),f=g[0],i=g[1],d=g[2],h=fJ(d),j=new +w(ct,0xfffffff,cn).udivmod(h).quotient,e=a6(a,f),b=hG(e);if(b<0||b>=d)aZ(cO);var +c=fJ(b);for(;;){f++;e=a6(a,f);if(e==95)continue;b=hG(e);if(b<0||b>=d)break;if(kl(j,c))aZ(cO);b=fJ(b);c=sh(si(h,c),b);if(kl(c,b))aZ(cO)}if(f!=m(a))aZ(cO);if(d==10&&kl(new +w(0,0,ck),c))aZ(cO);if(i<0)c=sj(c);return c}function +NC(a,b){return a.xor(b)}function +NA(a,b){return a.shift_right_unsigned(b)}function +Nz(a,b){return a.shift_left(b)}function +sr(a){function +o(a,b){return Nz(a,b)}function +h(a,b){return NA(a,b)}function +s(a,b){return sm(a,b)}function +f(a,b){return NC(a,b)}function +k(a,b){return sh(a,b)}function +i(a,b){return si(a,b)}function +m(a,b){return s(o(a,b),h(a,64-b))}function +g(a,b){return r8(a,b)}function +j(a,b,c){return fD(a,b,c)}var +q=sk(sw("0xd1342543de82ef95")),l=sk(sw("0xdaba0b6eb09322e3")),b,d,c,e=a,r=g(e,0),n=g(e,1),p=g(e,2),t=g(e,3);b=k(n,p);b=i(f(b,h(b,32)),l);b=i(f(b,h(b,32)),l);b=f(b,h(b,32));j(e,1,k(i(n,q),r));var +d=p,c=t;c=f(c,d);d=m(d,24);d=f(f(d,c),o(c,16));c=m(c,37);j(e,2,d);j(e,3,c);return b}function +cx(a,b){if(a<0)dH();var a=a+1|0,c=new Array(a);c[0]=0;for(var d=1;d>>32-e,c)}function g(a,b,c,d,e,f,g){return l(b&c|~b&d,a,b,e,f,g)}function @@ -770,53 +813,53 @@ h(a,b,c,d,e,f,g){return l(b&d|c&~d,a,b,e,f,g)}function i(a,b,c,d,e,f,g){return l(b^c^d,a,b,e,f,g)}function j(a,b,c,d,e,f,g){return l(c^(b|~d),a,b,e,f,g)}return function(a,b){var c=a[0],d=a[1],e=a[2],f=a[3];c=g(c,d,e,f,b[0],7,0xD76AA478);f=g(f,c,d,e,b[1],12,0xE8C7B756);e=g(e,f,c,d,b[2],17,0x242070DB);d=g(d,e,f,c,b[3],22,0xC1BDCEEE);c=g(c,d,e,f,b[4],7,0xF57C0FAF);f=g(f,c,d,e,b[5],12,0x4787C62A);e=g(e,f,c,d,b[6],17,0xA8304613);d=g(d,e,f,c,b[7],22,0xFD469501);c=g(c,d,e,f,b[8],7,0x698098D8);f=g(f,c,d,e,b[9],12,0x8B44F7AF);e=g(e,f,c,d,b[10],17,0xFFFF5BB1);d=g(d,e,f,c,b[11],22,0x895CD7BE);c=g(c,d,e,f,b[12],7,0x6B901122);f=g(f,c,d,e,b[13],12,0xFD987193);e=g(e,f,c,d,b[14],17,0xA679438E);d=g(d,e,f,c,b[15],22,0x49B40821);c=h(c,d,e,f,b[1],5,0xF61E2562);f=h(f,c,d,e,b[6],9,0xC040B340);e=h(e,f,c,d,b[11],14,0x265E5A51);d=h(d,e,f,c,b[0],20,0xE9B6C7AA);c=h(c,d,e,f,b[5],5,0xD62F105D);f=h(f,c,d,e,b[10],9,0x02441453);e=h(e,f,c,d,b[15],14,0xD8A1E681);d=h(d,e,f,c,b[4],20,0xE7D3FBC8);c=h(c,d,e,f,b[9],5,0x21E1CDE6);f=h(f,c,d,e,b[14],9,0xC33707D6);e=h(e,f,c,d,b[3],14,0xF4D50D87);d=h(d,e,f,c,b[8],20,0x455A14ED);c=h(c,d,e,f,b[13],5,0xA9E3E905);f=h(f,c,d,e,b[2],9,0xFCEFA3F8);e=h(e,f,c,d,b[7],14,0x676F02D9);d=h(d,e,f,c,b[12],20,0x8D2A4C8A);c=i(c,d,e,f,b[5],4,0xFFFA3942);f=i(f,c,d,e,b[8],11,0x8771F681);e=i(e,f,c,d,b[11],16,0x6D9D6122);d=i(d,e,f,c,b[14],23,0xFDE5380C);c=i(c,d,e,f,b[1],4,0xA4BEEA44);f=i(f,c,d,e,b[4],11,0x4BDECFA9);e=i(e,f,c,d,b[7],16,0xF6BB4B60);d=i(d,e,f,c,b[10],23,0xBEBFBC70);c=i(c,d,e,f,b[13],4,0x289B7EC6);f=i(f,c,d,e,b[0],11,0xEAA127FA);e=i(e,f,c,d,b[3],16,0xD4EF3085);d=i(d,e,f,c,b[6],23,0x04881D05);c=i(c,d,e,f,b[9],4,0xD9D4D039);f=i(f,c,d,e,b[12],11,0xE6DB99E5);e=i(e,f,c,d,b[15],16,0x1FA27CF8);d=i(d,e,f,c,b[2],23,0xC4AC5665);c=j(c,d,e,f,b[0],6,0xF4292244);f=j(f,c,d,e,b[7],10,0x432AFF97);e=j(e,f,c,d,b[14],15,0xAB9423A7);d=j(d,e,f,c,b[5],21,0xFC93A039);c=j(c,d,e,f,b[12],6,0x655B59C3);f=j(f,c,d,e,b[3],10,0x8F0CCC92);e=j(e,f,c,d,b[10],15,0xFFEFF47D);d=j(d,e,f,c,b[1],21,0x85845DD1);c=j(c,d,e,f,b[8],6,0x6FA87E4F);f=j(f,c,d,e,b[15],10,0xFE2CE6E0);e=j(e,f,c,d,b[6],15,0xA3014314);d=j(d,e,f,c,b[13],21,0x4E0811A1);c=j(c,d,e,f,b[4],6,0xF7537E82);f=j(f,c,d,e,b[11],10,0xBD3AF235);e=j(e,f,c,d,b[2],15,0x2AD7D2BB);d=j(d,e,f,c,b[9],21,0xEB86D391);a[0]=k(c,a[0]);a[1]=k(d,a[1]);a[2]=k(e,a[2]);a[3]=k(f,a[3])}}();function -LU(a,b,c){var -e=a.len&cZ,d=0;a.len+=c;if(e){var -f=64-e;if(c=64){a.b8.set(b.subarray(d,d+64),0);hh(a.w,a.b32);c-=64;d+=64}if(c)a.b8.set(b.subarray(d,d+c),0)}function -LS(a){var -c=a.len&cZ;a.b8[c]=b1;c++;if(c>56){for(var -b=c;b<64;b++)a.b8[b]=0;hh(a.w,a.b32);for(var +MX(a,b,c){var +e=a.len&c8,d=0;a.len+=c;if(e){var +f=64-e;if(c=64){a.b8.set(b.subarray(d,d+64),0);hu(a.w,a.b32);c-=64;d+=64}if(c)a.b8.set(b.subarray(d,d+c),0)}function +MV(a){var +c=a.len&c8;a.b8[c]=b6;c++;if(c>56){for(var +b=c;b<64;b++)a.b8[b]=0;hu(a.w,a.b32);for(var b=0;b<56;b++)a.b8[b]=0}else for(var -b=c;b<56;b++)a.b8[b]=0;a.b32[14]=a.len<<3;a.b32[15]=a.len>>29&0x1FFFFFFF;hh(a.w,a.b32);var +b=c;b<56;b++)a.b8[b]=0;a.b32[14]=a.len<<3;a.b32[15]=a.len>>29&0x1FFFFFFF;hu(a.w,a.b32);var e=new Uint8Array(16);for(var d=0;d<4;d++)for(var b=0;b<4;b++)e[d*4+b]=a.w[d]>>8*b&0xFF;return e}function -MW(a){return bV(fD(a,0,a.length))}function -MC(a,b,c){var -d=LT(),e=fE(a);LU(d,e.subarray(b,b+c),c);return MW(LS(d))}function -MD(a,b,c){return MC(c8(a),b,c)}function -MF(){return 0}var -c$=new +N1(a){return bF(fN(a,0,a.length))}function +NK(a,b,c){var +d=MW(),e=fO(a);MX(d,e.subarray(b,b+c),c);return N1(MV(d))}function +NL(a,b,c){return NK(df(a),b,c)}function +NN(){return 0}var +dh=new Array();function -jX(a){return c$[a]}function -dE(a){var -b=jX(a);if(!b.opened)H("Cannot flush a closed channel");if(!b.buffer||b.buffer_curr==0)return 0;if(b.output)b.output(fD(b.buffer,0,b.buffer_curr));else +kn(a){return dh[a]}function +dJ(a){var +b=kn(a);if(!b.opened)I("Cannot flush a closed channel");if(!b.buffer||b.buffer_curr==0)return 0;if(b.output)b.output(fN(b.buffer,0,b.buffer_curr));else b.file.write(b.offset,b.buffer,0,b.buffer_curr);b.offset+=b.buffer_curr;b.buffer_curr=0;return 0}function -MT(a){if(a.refill!=null){var -e=a.refill(),b=rR(e);if(b.length==0)a.refill=null;else{if(a.buffer.length0){b.set(e.buffer.subarray(e.buffer_curr,e.buffer_curr+f),c);e.buffer_curr+=f;g=f}else{e.buffer_curr=0;e.buffer_max=0;MT(e);var +NP(a,b,c,d){var +e=kn(a),g=d,f=e.buffer_max-e.buffer_curr;if(d<=f){b.set(e.buffer.subarray(e.buffer_curr,e.buffer_curr+d),c);e.buffer_curr+=d}else if(f>0){b.set(e.buffer.subarray(e.buffer_curr,e.buffer_curr+f),c);e.buffer_curr+=f;g=f}else{e.buffer_curr=0;e.buffer_max=0;NY(e);var f=e.buffer_max-e.buffer_curr;if(g>f)g=f;b.set(e.buffer.subarray(e.buffer_curr,e.buffer_curr+g),c);e.buffer_curr+=g}return g|0}function -MG(a,b,c,d){var -e=fE(b);return MH(a,e,c,d)}function -MY(a,b){if(b.name)try{var -d=require(iO),c=d.openSync(b.name,"rs");return new -ch(c,b)}catch(f){}return new -ch(a,b)}var -ht=new +NO(a,b,c,d){var +e=fO(b);return NP(a,e,c,d)}function +N3(a,b){if(b.name)try{var +d=require(jb),c=d.openSync(b.name,"rs");return new +co(c,b)}catch(f){}return new +co(a,b)}var +hJ=new Array(3);function -fs(a,b){bj.call(this,ap(0));this.log=function(a){return 0};if(a==1&&typeof +fC(a,b){bj.call(this,am(0));this.log=function(a){return 0};if(a==1&&typeof console.log=="function")this.log=console.log;else if(a==2&&typeof console.error=="function")this.log=console.error;else if(typeof -console.log=="function")this.log=console.log;this.flags=b}fs.prototype.length=function(){return 0};fs.prototype.write=function(a,b,c,d){if(this.log){if(d>0&&c>=0&&c+d<=b.length&&b[c+d-1]==10)d--;var -e=ap(d);b6(jL(b),c,e,0,d);this.log(e.toUtf16());return 0}H(this.fd+p3)};fs.prototype.read=function(a,b,c,d){H(this.fd+": file descriptor is write only")};fs.prototype.close=function(){this.log=undefined};function -hu(a,b){if(b==undefined)b=ht.length;ht[b]=a;return b|0}function -M5(a,b,c){var +console.log=="function")this.log=console.log;this.flags=b}fC.prototype.length=function(){return 0};fC.prototype.write=function(a,b,c,d){if(this.log){if(d>0&&c>=0&&c+d<=b.length&&b[c+d-1]==10)d--;var +e=am(d);b$(ka(b),c,e,0,d);this.log(e.toUtf16());return 0}I(this.fd+qF)};fC.prototype.read=function(a,b,c,d){I(this.fd+": file descriptor is write only")};fC.prototype.close=function(){this.log=undefined};function +hK(a,b){if(b==undefined)b=hJ.length;hJ[b]=a;return b|0}function +N_(a,b,c){var d={};while(b){switch(b[1]){case 0:d.rdonly=1;break;case 1:d.wronly=1;break;case @@ -826,322 +869,342 @@ d={};while(b){switch(b[1]){case 5:d.excl=1;break;case 6:d.binary=1;break;case 7:d.text=1;break;case -8:d.nonblock=1;break}b=b[2]}if(d.rdonly&&d.wronly)H(ci(a)+jd);if(d.text&&d.binary)H(ci(a)+jx);var -e=rV(a),f=e.device.open(e.rest,d);return hu(f,undefined)}(function(){function -a(a,b){return fF()?MY(a,b):new -fs(a,b)}hu(a(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:true}),0);hu(a(1,{buffered:2,wronly:1,isCharacterDevice:true}),1);hu(a(2,{buffered:2,wronly:1,isCharacterDevice:true}),2)}());function -MI(a){var -b=ht[a];if(b.flags.wronly)H(qw+a+" is writeonly");var +8:d.nonblock=1;break}b=b[2]}if(d.rdonly&&d.wronly)I(cp(a)+jB);if(d.text&&d.binary)I(cp(a)+jW);var +e=sI(a),f=e.device.open(e.rest,d);return hK(f,undefined)}(function(){function +a(a,b){return fP()?N3(a,b):new +fC(a,b)}hK(a(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:true}),0);hK(a(1,{buffered:2,wronly:1,isCharacterDevice:true}),1);hK(a(2,{buffered:2,wronly:1,isCharacterDevice:true}),2)}());function +NQ(a){var +b=hJ[a];if(b.flags.wronly)I(q_+a+" is writeonly");var d=null,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:false,buffer_curr:0,buffer_max:0,buffer:new -Uint8Array(d8),refill:d};c$[c.fd]=c;return c.fd}function -rH(a){var -b=ht[a];if(b.flags.rdonly)H(qw+a+" is readonly");var +Uint8Array(ef),refill:d};dh[c.fd]=c;return c.fd}function +ss(a){var +b=hJ[a];if(b.flags.rdonly)I(q_+a+" is readonly");var d=b.flags.buffered!==undefined?b.flags.buffered:1,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:true,buffer_curr:0,buffer:new -Uint8Array(d8),buffered:d};c$[c.fd]=c;return c.fd}function -MJ(){var +Uint8Array(ef),buffered:d};dh[c.fd]=c;return c.fd}function +NR(){var b=0;for(var -a=0;ae.buffer.length){var +a=0;ae.buffer.length){var g=new Uint8Array(e.buffer_curr+b.length);g.set(e.buffer);e.buffer=g}switch(e.buffered){case -0:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;dE(a);break;case -1:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)dE(a);break;case +0:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;dJ(a);break;case +1:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)dJ(a);break;case 2:var -f=b.lastIndexOf(10);if(f<0){e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)dE(a)}else{e.buffer.set(b.subarray(0,f+1),e.buffer_curr);e.buffer_curr+=f+1;dE(a);e.buffer.set(b.subarray(f+1),e.buffer_curr);e.buffer_curr+=b.length-f-1}break}return 0}function -MK(a,b,c,d){var -b=fE(b);return ML(a,b,c,d)}function -jY(a,b,c,d){return MK(a,c8(b),c,d)}function -rI(a,b){var -c=bV(String.fromCharCode(b));jY(a,c,0,1);return 0}function -MM(a,b){if(b==0)j1();return a%b}function -rJ(a){if(isFinite(a)){var +f=b.lastIndexOf(10);if(f<0){e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)dJ(a)}else{e.buffer.set(b.subarray(0,f+1),e.buffer_curr);e.buffer_curr+=f+1;dJ(a);e.buffer.set(b.subarray(f+1),e.buffer_curr);e.buffer_curr+=b.length-f-1}break}return 0}function +NS(a,b,c,d){var +b=fO(b);return NT(a,b,c,d)}function +ko(a,b,c,d){return NS(a,df(b),c,d)}function +st(a,b){var +c=bF(String.fromCharCode(b));ko(a,c,0,1);return 0}function +su(a){if(isFinite(a)){var d=1/a<0;a=Math.abs(a);var b=Math.floor(a),c=a-b;if(d){b=-b;c=-c}return[0,c,b]}if(isNaN(a))return[0,NaN,NaN];return[0,1/a,a]}function -fC(a,b){return+(ej(a,b,false)!=0)}function -MO(a,b){a[0]=fd;a[1]=b;return 0}function -en(a){if(a +dK(a,b){return+(er(a,b,false)!=0)}function +fM(a){if(a instanceof -Array&&a[0]==a[0]>>>0)return a[0];else if(hn(a))return ec;else if(ho(a))return ec;else if(a +Array&&a[0]==a[0]>>>0)return a[0];else if(hC(a))return el;else if(hD(a))return el;else if(a instanceof Function||typeof -a=="function")return 247;else if(a&&a.caml_custom)return c1;else -return fq}function -L4(a){var +a=="function")return 247;else if(a&&a.caml_custom)return c_;else +return fA}function +M8(a){var c={};if(a)for(var -b=1;b=0)a=e;else -bB("caml_register_global: cannot locate "+d)}}bb[a+1]=b;if(c)bb[c]=b}function -j3(a,b){rK[ci(a)]=b;return 0}function -MV(){az(jh)}function -X(a,b){if(b>>>0>=m(a))MV();return bd(a,b)}function -hs(a){a.t&6&&fu(a);return bV(a.c)}function -MX(){return 0x7FFFFFFF/4|0}function -MR(){rM(bb.Not_found)}function -rO(a){var -b=rU(bU(a));if(b===undefined)MR();return b8(b)}function -rP(){if(N.crypto)if(N.crypto.getRandomValues){var +b=1;b=0)a=e;else +aZ("caml_register_global: cannot locate "+d)}}bd[a+1]=b;if(c)bd[c]=b}function +ks(a,b){sv[cp(a)]=b;return 0}function +N0(){aq(jG)}function +ai(a,b){if(b>>>0>=m(a))N0();return a6(a,b)}function +hI(a){a.t&6&&fF(a);return bF(a.c)}function +N2(){return 0x7FFFFFFF/4|0}function +NW(){sy(bd.Not_found)}function +sB(a){var +b=sH(b1(a));if(b===undefined)NW();return cb(b)}function +sC(){if(N.crypto)if(N.crypto.getRandomValues){var a=N.crypto.getRandomValues(new Int32Array(4));return[0,a[0],a[1],a[2],a[3]]}else if(N.crypto.randomBytes){var a=new Int32Array(N.crypto.randomBytes(16).buffer);return[0,a[0],a[1],a[2],a[3]]}var b=new Date().getTime(),c=b^0xffffffff*Math.random();return[0,c]}function -cO(a){var +cq(a){var b=1;while(a&&a.joo_tramp){a=a.joo_tramp.apply(null,a.joo_args);b++}return a}function -y(a,b){return{joo_tramp:a,joo_args:b}}function -aj(a){{if(a +v(a,b){return{joo_tramp:a,joo_args:b}}function +an(a){{if(a instanceof Array)return a;var b;if(N.RangeError&&a instanceof -N.RangeError&&a.message&&a.message.match(/maximum call stack/i))b=bb.Stack_overflow;else if(N.InternalError&&a +N.RangeError&&a.message&&a.message.match(/maximum call stack/i))b=bd.Stack_overflow;else if(N.InternalError&&a instanceof -N.InternalError&&a.message&&a.message.match(/too much recursion/i))b=bb.Stack_overflow;else if(a +N.InternalError&&a.message&&a.message.match(/too much recursion/i))b=bd.Stack_overflow;else if(a instanceof -N.Error&&da(iS))b=[0,da(iS),a];else -b=[0,bb.Failure,b8(String(a))];if(a +N.Error&&di(jf))b=[0,di(jf),a];else +b=[0,bd.Failure,cb(String(a))];if(a instanceof N.Error)b.js_error=a;return b}}function -Mw(a){switch(a[2]){case-8:case-11:case-12:return 1;default:return 0}}function -L$(a){var -b=e;if(a[0]==0){b+=a[1][1];if(a.length==3&&a[2][0]==0&&Mw(a[1]))var +NE(a){switch(a[2]){case-8:case-11:case-12:return 1;default:return 0}}function +Nh(a){var +b=e;if(a[0]==0){b+=a[1][1];if(a.length==3&&a[2][0]==0&&NE(a[1]))var f=a[2],g=1;else var g=2,f=a;b+="(";for(var -d=g;dg)b+=jz;var +d=g;dg)b+=jY;var c=f[d];if(typeof c=="number")b+=c.toString();else if(c instanceof -cK)b+=c5+c.toString()+c5;else if(typeof -c=="string")b+=c5+c.toString()+c5;else -b+=oK}b+=")"}else if(a[0]==J)b+=a[1];return b}function -rA(a){if(a +cT)b+=dc+c.toString()+dc;else if(typeof +c=="string")b+=dc+c.toString()+dc;else +b+=pm}b+=")"}else if(a[0]==L)b+=a[1];return b}function +se(a){if(a instanceof -Array&&(a[0]==0||a[0]==J)){var -c=da(q_);if(c)hj(c,[a,false]);else{var -d=L$(a),b=da(ol);if(b)hj(b,[0]);console.error(jt+d);if(a.js_error)throw a.js_error}}else +Array&&(a[0]==0||a[0]==L)){var +c=di(rN);if(c)hx(c,[a,false]);else{var +d=Nh(a),b=di(o1);if(b)hx(b,[0]);console.error(jR+d);if(a.js_error)throw a.js_error}}else throw a}function -MU(){var -c=N.process;if(c&&c.on)c.on("uncaughtException",function(a,b){rA(a);c.exit(2)});else if(N.addEventListener)N.addEventListener(g$,function(a){if(a.error)rA(a.error)})}MU();function -g(a,b){return(a.l>=0?a.l:a.l=a.length)==1?a(b):cL(a,[b])}function -j(a,b,c){return(a.l>=0?a.l:a.l=a.length)==2?a(b,c):cL(a,[b,c])}function -bN(a,b,c,d){return(a.l>=0?a.l:a.l=a.length)==3?a(b,c,d):cL(a,[b,c,d])}function -e8(a,b,c,d,e){return(a.l>=0?a.l:a.l=a.length)==4?a(b,c,d,e):cL(a,[b,c,d,e])}function -du(a,b,c,d,e,f){return(a.l>=0?a.l:a.l=a.length)==5?a(b,c,d,e,f):cL(a,[b,c,d,e,f])}function -LR(a,b,c,d,e,f,g,h){return(a.l>=0?a.l:a.l=a.length)==7?a(b,c,d,e,f,g,h):cL(a,[b,c,d,e,f,g,h])}var -M4=undefined;Ma();var -hy=[J,rk,-1],j9=[J,pk,-2],eq=[J,jJ,-3],hx=[J,pa,-4],bD=[J,qi,-7],j7=[J,ri,-8],j8=[J,pz,-9],t=[J,pE,-11],j_=[J,pR,-12],hM=[0,e,0,0,-1],kw=[0,e,1,0,0],LF=[4,0,0,0,[12,45,[4,0,0,0,0]]],hU=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,oX,[4,0,0,0,[12,45,[4,0,0,0,[11,nC,[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],LG=[17,[0,a,1,0],[11,nm,[17,0,0]]],LH=[17,[0,a,1,0],[12,40,0]],LI=[11,"('\"'",[17,[0,a,1,0],[11,c3,[17,[0,a,1,0],[11,mT,[17,0,0]]]]]],LJ=[0,a,1,0],LK=[11,oi,[17,[0,a,1,0],[11,c3,[17,[0,a,1,0],[11,mT,[17,0,0]]]]]],LL=[0,a,1,0],LM=[11,c3,[17,[0,a,1,0],[11,rg,[17,0,0]]]],LN=[0,a,1,0],LO=[11,oi,[17,[0,a,1,0],[11,c3,[17,[0,a,1,0],[11,rg,[17,0,0]]]]]],LP=[0,a,1,0],LQ=[17,[0,a,1,0],[12,40,[15,[12,41,[17,0,0]]]]],l1=[0,ag,[0,cd,-991563951]],l2=[0,ag,[0,cd,oU]],md=hp([9,10,11,12,13,32,jy,mX,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,oF,8233,8239,8287,12288]),a9=[0,"\0\0\xec\xff\xed\xff\x03\0\xef\xff\x10\0\xf2\xff\xf3\xff\xf4\xff\xf5\xff\0\0\x1f\0\xf9\xffU\0\x01\0\0\0\0\0\x01\0\0\0\x01\0\x02\0\xff\xff\0\0\0\0\x03\0\xfe\xff\x01\0\x04\0\xfd\xff\x0b\0\xfc\xff\x03\0\x01\0\x03\0\x02\0\x03\0\0\0\xfb\xff\x15\0a\0\n\0\x16\0\x14\0\x10\0\x16\0\f\0\b\0\xfa\xffw\0\x81\0\x8b\0\xa1\0\xab\0\xb5\0\xc1\0\xd1\0\xf0\xff\x0b\0&\0\xfc\xffA\0\xfe\xff\xff\xffn\0\xfc\xff\xa3\0\xfe\xff\xff\xff\xea\0\xf7\xff\xf8\xff0\x01\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xffG\x01~\x01\x95\x01\xf9\xff'\0\xfd\xff\xfe\xff&\0\xbb\x01\xd2\x01\xf8\x01\x0f\x02\xff\xff\xdc\0\xfd\xff\xff\xff\xf5\0'\x02m\x02\x0e\x01X\x02\xa4\x02\xbb\x02\xe1\x02\r\0\xfc\xff\xfd\xff\xfe\xff\xff\xff\x0e\0\xfd\xff\xfe\xff\xff\xff\x1e\0\xfd\xff\xfe\xff\xff\xff\x0f\0\xfd\xff\xfe\xff\xff\xff\x11\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\x13\0\xfc\xff\xfd\xff\xfe\xff\x0f\0\xff\xff\x10\0\xff\xff\b\x01\x05\0\xfd\xff\x17\0\xfe\xff\x14\0\xff\xff.\0\xfd\xff\xfe\xff*\x004\x005\0\xff\xff5\x000\0[\0\\\0\xff\xff\x1b\x01\xfa\xff\xfb\xff\x89\0h\0Y\0X\0j\0\xff\xff\x8f\0\x89\0\xb1\0\xfe\xff\xb7\0\xa8\0\xa6\0\xb7\0\x02\0\xfd\xff\xb1\0\xac\0\xbb\0\x04\0\xfc\xff5\x02\xfb\xff\xfc\xff\xfd\xffg\x01\xff\xff\xf8\x02\xfe\xff\x06\x03\x1e\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff(\x032\x03J\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff=\x03T\x03l\x03\xf9\xff\xfa\xff\xfb\xff\xf4\0x\x03\x8e\x03\xb3\0\xc2\0\x0f\0\xff\xff\xbe\0\xbc\0\xbb\0\xc1\0\xb7\0\xb3\0\xfe\xff\xbf\0\xc9\0\xc8\0\xc4\0\xcb\0\xc1\0\xbd\0\xfd\xff\x9d\x03_\x03\xae\x03\xc4\x03\xce\x03\xd8\x03\xe4\x03\xef\x03<\0\xfd\xff\xfe\xff\xff\xff\f\x04\xfc\xff\xfd\xffW\x04\xff\xff\x91\x04\xfc\xff\xfd\xff\xdd\x04\xff\xff\xe5\0\xfd\xff\xfe\xff\xff\xff\xe7\0\xfd\xff\xfe\xff\xff\xff\x02\0\xff\xff\x12\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\"\x01\xfd\xff\xfe\xff\xff\xff\0\0\xff\xff\x03\0\xfe\xff\xff\xff&\x01\xfc\xff\xfd\xff\xfe\xff\xff\xffx\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\xd0\0\xfd\xff\xfe\xff\xff\xff\xd3\0\xfd\xff\xfe\xff\xff\xff\xbd\0\xff\xff\x8f\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\r\x01\xfd\xff\xfe\xff\xff\xff_\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff2\x01\xfd\xff\xfe\xff\xff\xff\x1a\x01\xfd\xff\xfe\xff\xff\xff\xe9\0\xfd\xff\xfe\xff\xff\xff\xde\0\xfd\xff\xfe\xff\xff\xffO\x05\xed\xff\xee\xff\n\0\xf0\xff,\x01\xf3\xff\xf4\xff\xf5\xff\xf6\xff=\x01\x02\x04\xf9\xff-\x05\xd1\0\xe4\0\xd3\0\xe8\0\xe1\0\xdf\0\xf0\0\xff\xff\xeb\0\xea\0\b\x01\xfe\xff\x04\x01\x17\x01\xfd\xff6\x01\xfc\xff\x1f\x01\x1d\x01 \x01'\x011\x01-\x01\xfb\xff9\x01R\x01P\x01N\x01T\x01J\x01V\x01\xfa\xffn\x05\f\x04{\x05\x9b\x05\xa5\x05\xb1\x05\xbb\x05\xc5\x05\xf1\xff\xc7\x01M\x02\xfd\xff\xff\xff\x9a\x02\xde\x05\xd1\x05\x9b\x02\xef\x055\x06L\x06r\x06\x10\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x98\x06\xfc\xff\xfd\xff\xe3\x06\xff\xffU\x07\xf4\xff\xf5\xff\x0b\0\xf7\xffL\x02\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\x1f\x02\xf3\x053\x07d\x01s\x01h\x01\x85\x01v\x01\x9a\x01\xab\x01\xff\xff\xad\x01\xb0\x01\xbf\x01\xb9\x01\xbb\x01\xfd\x01\xe6\x01\xe6\x01\xea\x01\xf7\x01\xed\x01\xea\x01\t\x02\x13\x02\x13\x02\x0f\x02\x15\x02\x0b\x02\x07\x02\x8e\x06\x98\x06t\x07\xaa\x07\xb4\x07\xbe\x07\xc8\x07\xd2\x07\xf8\xffx\x02\xa7\x02\xfd\xff\xff\xff\xd8\x02R\x07\xdc\x07\xec\x02\xf4\x07:\bQ\bw\bL\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x9d\b\xfc\xff\xfd\xff\xe8\b\xff\xff\x87\x02x\x02\xfd\xffd\x02\xfe\xff\xb6\x02\xff\xff\x0b\x02\xff\xff\xcc\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff.\x02\xff\xff\xb2\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x17\0\xff\xff\xb7\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\xbb\x02\xfd\xff\xfe\xff\xff\xffy\x02\xfd\xff\xfe\xff\xff\xff\xb8\x02\xfc\xff\xfd\xff\xfe\xff\x13\0\xff\xff","\xff\xff\xff\xff\xff\xff\x11\0\xff\xff\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x13\0\x13\0\x13\0\x13\0\x13\0\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\t\0\xff\xff\t\0\xff\xff\xff\xff\x0e\0\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x04\0\x04\0\x04\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\0\0\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\x03\0\x05\0\x05\0\x05\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x03\0\xff\xff\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x10\0\xff\xff\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x12\0\x12\0\x12\0\x12\0\x12\0\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\xff\xff\b\0\xff\xff\b\0\xff\xff\xff\xff\r\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\x06\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff","\x01\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\x009\0<\0\0\0<\0\0\0\0\0A\0\0\0A\0\0\0\0\0F\0\0\0\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0T\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0^\0\0\0\0\0a\0\xff\xff\xff\xffa\0\xff\xff\xff\xff\xff\xff\xff\xffh\0\0\0\0\0\0\0\0\0m\0\0\0\0\0\0\0q\0\0\0\0\0\0\0u\0\0\0\0\0\0\0y\0\0\0\0\0\0\0\0\0\0\0~\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\x8a\0\0\0\x8e\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x9a\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xb2\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xbb\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc2\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc9\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xeb\0\0\0\0\0\0\0\xef\0\0\0\0\0\xff\xff\0\0\xf4\0\0\0\0\0\xff\xff\0\0\xf9\0\0\0\0\0\0\0\xfd\0\0\0\0\0\0\0\xff\xff\0\0\x03\x01\0\0\0\0\0\0\0\0\b\x01\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\x11\x01\0\0\0\0\0\0\0\0\x16\x01\0\0\0\0\0\0\0\0\0\0\x1c\x01\0\0\0\0\0\0 \x01\0\0\0\0\0\0\xff\xff\0\0&\x01\0\0\0\0\0\0\0\0+\x01\0\0\0\0\0\0/\x01\0\0\0\0\0\0\0\x004\x01\0\0\0\0\0\x008\x01\0\0\0\0\0\0<\x01\0\0\0\0\0\0@\x01\0\0\0\0\0\0C\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0y\x01}\x01\0\0\0\0\x80\x01\xff\xff\xff\xff\x80\x01\xff\xff\xff\xff\xff\xff\xff\xff\x87\x01\0\0\0\0\0\0\0\0\x8c\x01\0\0\0\0\xff\xff\0\0\x90\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xc1\x01\xc5\x01\0\0\0\0\xc8\x01\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcf\x01\0\0\0\0\0\0\0\0\xd4\x01\0\0\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xdc\x01\0\0\xff\xff\0\0\xe2\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xe9\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xf0\x01\0\0\0\0\0\0\0\0\xf5\x01\0\0\0\0\0\0\xf9\x01\0\0\0\0\0\0\xfc\x01\0\0\0\0\0\0\xff\xff\0\0","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x03\0\x04\0\0\0\x03\0\x03\0\x86\0\0\0\x03\0\0\0\x86\0E\x01\x92\x01\xff\xff\0\0E\x01\x92\x01\0\0\0\0\0\0\0\0\x7f\0\x8b\0\0\0\x03\0\0\0\f\0\x03\0\xaa\0\x86\0\xaf\0\0\0\x07\0\x0b\x01E\x01\x92\x01\x0e\x01\r\x001\0\x05\0\n\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\x008\0v\0\x06\0\x81\0\x82\x009\0\xed\x01\x89\0\0\x021\0\0\x000\0\x8a\0j\0>\0\x0e\0n\0i\0\0\x001\0\x0f\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1e\x000\0\b\0r\0\xd1\0\xec\0\0\x01\r\x01\x1d\0\x16\0\xff\xff0\x000\0\x11\0\x15\0\x19\0 \0!\0#\0\x17\0\x1b\0\x10\0\x1f\0\x1c\0\"\0\x13\0\x18\0\x12\0\x1a\0\x14\0$\0)\0%\x000\0\t\0*\0+\0,\0-\0.\0/\0=\0U\x000\0&\0'\0'\0'\0'\0'\0'\0'\0'\0'\x001\0C\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0V\0\x8f\0\xff\xff(\0\x90\0\x91\0\x92\x007\0\x94\x007\0\x95\x000\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0\xff\xff0\0\x96\0\x97\0\xa1\0B\0\x9e\x005\0\x9f\x005\0\xa0\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\0\xa5\x003\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa2\0\xa3\0\xa6\0]\0\xff\xff\x02\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xff\xffM\0g\0l\0t\0\x84\0\x86\0\x87\0\x80\0\x8b\0\x86\0\xa4\0]\0\xab\0M\0\xa7\0\xa8\0\xa9\0\xac\0p\0\xad\0\xae\0\xd2\0\xe2\0\xd0\0\xd3\0\xd4\0;\0S\0\x86\0\xd5\0\xd6\0\xd7\0\xd8\0\xda\0\x8d\0\xdb\0]\0\xdc\0\xdd\0{\0\xde\0\xdf\0\xe0\0\x88\0_\0\xe1\0#\x01A\x01\xea\0\x9b\0\x05\x01a\x01\xfa\0\xff\xff\xfe\x009\x01=\x01_\x01M\0,\x01\\\x01X\x01\t\x01\x1d\x01L\0|\0!\x01\x12\x01K\0b\0\x13\x01U\x01V\x01W\x01x\x01Y\x01J\0\xe1\x005\x01y\x01I\0Z\x01H\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0b\0q\x01z\0[\x01@\0\x04\x01]\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0\x9c\0p\x01^\x01`\x01b\x01c\x011\x01O\0O\0O\0O\0O\0O\0d\x01\x9d\0e\x01N\0N\0N\0N\0N\0N\0\xb7\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\x18\x01p\x01\xff\xff\x19\x01f\x01g\x01i\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0j\x01k\x010\x01(\x01l\x01m\x01n\x01P\0P\0P\0P\0P\0P\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0o\x01\x1b\x01\xff\xff\xab\x01\x1f\x01\xaa\x01\x17\x01Q\0Q\0Q\0Q\0Q\0Q\0\\\0\xa8\x01?\x01P\0P\0P\0P\0P\0P\0\xf8\0\xa5\x01\xfc\0\xa2\x01;\x01E\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0\xff\xffQ\0Q\0Q\0Q\0Q\0Q\0W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0X\0X\0X\0X\0'\x01*\x01\xff\xff\xa3\x01\xa4\x01x\0\x02\x01X\0X\0X\0X\0X\0X\0\xa6\x017\x01\x99\0W\0W\0W\0W\0W\0W\0\x07\x01\xa7\x01\xa4\x01\xa9\x01\x10\x01\xa4\x01Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\x003\x01X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0a\0\x89\x01\xa4\x01\xac\x01\xb9\x01\x88\x01\xad\x01Z\0Z\0Z\0Z\0Z\0Z\0a\0\xb3\0\xae\x01Y\0Y\0Y\0Y\0Y\0Y\0.\x01\xaf\x01\xb0\x01\xb4\0\xa4\x01\xb8\x01\xb5\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0|\x01Z\0Z\0Z\0Z\0Z\0Z\0\xc0\x01\xb2\x01\x15\x01\xb3\x01a\0\xc1\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xa4\x01\xd8\x01\xff\xffa\0\xb8\x01\xd8\x01\xd1\x01a\0\xdf\x01a\0\xd0\x01\xe6\x01\0\0a\0\xdb\x01%\x01\xd8\x01\xd9\x01\0\0\xdc\x01\xd8\x01a\0\0\0\0\0\xd8\x01a\0\0\0a\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xd8\x01\0\0~\x01\0\0\0\0\0\0\0\0c\0c\0c\0c\0c\0c\0a\0\0\0\xda\x01\xfa\x01\0\0\0\0a\0\0\0|\x01|\x01a\0\0\0\xdd\x01\0\0\xfd\x01\0\0\0\0\0\0a\0\xff\xff\0\0\xc4\x01a\0\0\0a\0`\0c\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xeb\x01\0\0\xf1\x01\0\0\xff\x01\xf2\x01\0\0d\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xf6\x01\x81\x01\x81\x01\xe4\x01\0\0\xc4\x01\0\0e\0e\0e\0e\0e\0e\0\0\0\xc6\x01\0\0d\0d\0d\0d\0d\0d\0\0\0\0\0\0\0\xc4\x01\xea\x01\x86\x01a\0a\0a\0a\0a\0a\0a\0a\0a\0a\0\0\0e\0e\0e\0e\0e\0e\0a\0a\0a\0a\0a\0a\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\0\0\0\0\xc9\x01\xb1\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xbc\0\0\0a\0a\0a\0a\0a\0a\0\xc9\x01\xe3\x01\0\0\xbf\0\xce\x01{\x01\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xc3\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc6\0\xff\xff\xf8\x01\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xca\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xcd\0\xff\xff\xff\xff\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe2\0\xc3\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\x01\0\0\0\0\xce\0\xdd\x01\xef\x01\xfe\x01\0\0\xcf\0\xf4\x01\0\0\xe1\0\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\0\0\0\xe8\0\0\0\xe1\x01\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xd9\0\xff\xff\0\0\0\0\0\0\0\0\xe1\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\0\0\0\0\0\0\0\0\xff\xff\0\0\0\0\xe6\0\0\0\xe6\0\0\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\0\0\xe4\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xba\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\0\0\0\0\0\0\0\0\0\0\xf1\0\0\0q\x01\0\0M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01\0\0p\x01\0\0\0\0\xc1\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0p\x01\0\0\0\0\0\0\xf0\0\xc8\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\xf6\0\0\0\0\0\xf0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xee\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0E\x01F\x01\0\0\0\0E\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0E\x01\0\0N\x01\0\0\0\0\0\0\0\0h\x01I\x01\0\0\0\0\0\0\0\0O\x01\0\0G\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0H\x01\0\0\0\0\0\0\0\0\0\0\xf3\0\0\0\0\0\0\0\0\0\0\0\0\0P\x01w\x01\0\0w\x01\0\0Q\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\0\0J\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01S\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0R\x01\0\0\0\0s\x01\0\0\0\0T\x01\0\0\0\0u\x01\0\0u\x01\0\0K\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\0\0s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\xb9\x01\0\0\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xb8\x01\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\0\0\0\0D\x01\x80\x01\x80\x01\x80\x01\x7f\x01\0\0\x80\x01\0\0\0\0\xb8\x01\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\x80\x01\x7f\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\xbf\x01\x8e\x01\xbf\x01\0\0\0\0\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x92\x01\x93\x01\0\0\0\0\x92\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\x92\x01\0\0\x99\x01\0\0\0\0\0\0\0\0\xb1\x01\x96\x01\0\0\0\0\0\0\xc8\x01\x9c\x01\0\0\x94\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\x95\x01\0\0\0\0\0\0\0\0\0\0\0\0\x8b\x01\0\0\0\0\0\0\0\0\0\0\x9d\x01\0\0\0\0\0\0\0\0\x9e\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc8\x01\0\0\x97\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\xbb\x01\0\0\xa0\x01\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\x9f\x01\xc8\x01\0\0\xc8\x01\xc7\x01\0\0\xa1\x01\0\0\0\0\0\0\0\0\0\0\0\0\x98\x01\0\0\0\0\0\0\0\0\xbd\x01\0\0\xbd\x01\0\0\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\x91\x01\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\xc8\x01\xc7\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xd6\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd3\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0","\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\xff\xff\x03\0\0\0\x86\0\xff\xff\x03\0\xff\xff\x86\0E\x01\x92\x019\0\xff\xffE\x01\x92\x01\xff\xff\xff\xff\xff\xff\xff\xff}\0\x8a\0\xff\xff\0\0\xff\xff\0\0\x03\0\xa9\0\x86\0\xae\0\xff\xff\0\0\n\x01E\x01\x92\x01\f\x01\0\0\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x05\0s\0\0\0}\0\x81\0\x05\0\xec\x01\x88\0\xff\x01&\0\xff\xff\n\0\x88\0f\0:\0\0\0k\0f\0\xff\xff\x0b\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1d\0&\0\0\0o\0\xd0\0\xe9\0\xff\0\f\x01\x0f\0\x11\0<\0\x0b\0\n\0\0\0\x14\0\x18\0\x1f\0 \0\"\0\x16\0\x1a\0\0\0\x0e\0\x1b\0!\0\x12\0\x17\0\0\0\x10\0\x13\0#\0(\0$\0&\0\0\0)\0*\0+\0,\0-\0.\0:\0R\0\x0b\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0'\0?\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0U\0\x8c\0<\0\r\0\x8f\0\x90\0\x91\x000\0\x93\x000\0\x94\0'\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x001\x001\x001\x001\x001\x001\x001\x001\x001\x001\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0A\0'\0\x95\0\x96\0\x9c\0?\0\x9d\x003\0\x9e\x003\0\x9f\x002\x003\x003\x003\x003\x003\x003\x003\x003\x003\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x005\x005\x005\x005\x005\x005\x005\x005\x005\x005\0\x9b\x002\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa1\0\xa2\0\x9b\0[\0A\0\0\x007\x007\x007\x007\x007\x007\x007\x007\x007\x007\x009\0D\0f\0k\0s\0\x83\0\x85\0\x85\0}\0\x8a\0\x85\0\xa3\0^\0\xa5\0D\0\xa6\0\xa7\0\xa8\0\xab\0o\0\xac\0\xad\0\xce\0\xcb\0\xcf\0\xd2\0\xd3\0:\0R\0\x85\0\xd4\0\xd5\0\xd6\0\xd7\0\xd9\0\x8c\0\xda\0a\0\xdb\0\xdc\0w\0\xdd\0\xde\0\xdf\0\x85\0[\0\xcb\0\"\x01>\x01\xe9\0\x98\0\x01\x01P\x01\xf7\0<\0\xfb\x006\x01:\x01Q\x01D\0)\x01R\x01S\x01\x06\x01\x1a\x01D\0w\0\x1e\x01\x0f\x01D\0^\0\x0f\x01T\x01U\x01V\x01G\x01X\x01D\0\xcb\x002\x01G\x01D\0Y\x01D\0D\0G\0G\0G\0G\0G\0G\0G\0G\0G\0G\0a\0L\x01w\0Z\x01?\0\x01\x01\\\x01G\0G\0G\0G\0G\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0\x98\0L\x01]\x01_\x01a\x01b\x01-\x01N\0N\0N\0N\0N\0N\0c\x01\x98\0d\x01G\0G\0G\0G\0G\0G\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\x14\x01L\x01A\0\x14\x01e\x01f\x01h\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0i\x01j\x01-\x01$\x01k\x01l\x01m\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0n\x01\x1a\x01y\x01\x9d\x01\x1e\x01\x9e\x01\x14\x01P\0P\0P\0P\0P\0P\0[\0\x9f\x01>\x01O\0O\0O\0O\0O\0O\0\xf7\0\xa0\x01\xfb\0\xa1\x01:\x01D\0V\0V\0V\0V\0V\0V\0V\0V\0V\0V\0^\0P\0P\0P\0P\0P\0P\0V\0V\0V\0V\0V\0V\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0$\x01)\x01a\0\xa2\x01\xa3\x01w\0\x01\x01W\0W\0W\0W\0W\0W\0\xa5\x016\x01\x98\0V\0V\0V\0V\0V\0V\0\x06\x01\xa6\x01\xa7\x01\xa8\x01\x0f\x01\xa9\x01X\0X\0X\0X\0X\0X\0X\0X\0X\0X\x002\x01W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0_\0\x85\x01\xaa\x01\xab\x01\x9a\x01\x85\x01\xac\x01Y\0Y\0Y\0Y\0Y\0Y\0_\0\xb0\0\xad\x01X\0X\0X\0X\0X\0X\0-\x01\xae\x01\xaf\x01\xb0\0\xb0\x01\x9a\x01\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0z\x01Y\0Y\0Y\0Y\0Y\0Y\0\x94\x01\xb1\x01\x14\x01\xb2\x01b\0\x94\x01\xb3\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xd8\x01\xc1\x01_\0\x9a\x01\xd8\x01\xcd\x01b\0\xde\x01_\0\xcd\x01\xe5\x01\xff\xff_\0\xda\x01$\x01\xd7\x01\xd7\x01\xff\xff\xda\x01\xd7\x01_\0\xff\xff\xff\xff\xd8\x01_\0\xff\xff_\0_\0`\0`\0`\0`\0`\0`\0`\0`\0`\0`\0\xd7\x01\xff\xffz\x01\xff\xff\xff\xff\xff\xff\xff\xff`\0`\0`\0`\0`\0`\0b\0\xff\xff\xd7\x01\xf7\x01\xff\xff\xff\xffb\0\xff\xff}\x01\x80\x01b\0\xff\xff\xdc\x01\xff\xff\xfb\x01\xff\xff\xff\xff\xff\xffb\0y\x01\xff\xff\xc2\x01b\0\xff\xffb\0b\0`\0`\0`\0`\0`\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xe7\x01\xff\xff\xee\x01\xff\xff\xfb\x01\xee\x01\xff\xffc\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xf3\x01}\x01\x80\x01\xe0\x01\xff\xff\xc5\x01\xff\xffd\0d\0d\0d\0d\0d\0\xff\xff\xc2\x01\xff\xffc\0c\0c\0c\0c\0c\0\xff\xff\xff\xff\xff\xff\xc8\x01\xe7\x01\x85\x01e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xff\xffd\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xff\xff\xff\xff\xc5\x01\xb0\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb9\0\xff\xffe\0e\0e\0e\0e\0e\0\xc8\x01\xe0\x01\xff\xff\xb9\0\xcd\x01z\x01\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xc0\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc0\0\xc1\x01\xf7\x01\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc7\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xc7\0}\x01\x80\x01\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xcc\0\xc2\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe7\x01\xff\xff\xff\xff\xc7\0\xdc\x01\xee\x01\xfb\x01\xff\xff\xc7\0\xf3\x01\xff\xff\xcc\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xe1\0\xff\xff\xe1\0\xff\xff\xe0\x01\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xcd\0\xc5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcc\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xff\xff\xff\xff\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xe4\0\xff\xff\xe4\0\xff\xff\xe3\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xff\xff\xe3\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xb9\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xed\0\xff\xffM\x01\xff\xffM\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01\xff\xffM\x01\xff\xff\xff\xff\xc0\0\xff\xff\xff\xff\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0M\x01\xff\xff\xff\xff\xff\xff\xed\0\xc7\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xf2\0\xff\xff\xff\xff\xf0\0\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xed\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0B\x01B\x01\xff\xff\xff\xffB\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xffO\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01p\x01\xff\xffp\x01\xff\xffB\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01\xff\xff\xff\xffB\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xff\xff\xffr\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xffs\x01\xff\xffs\x01\xff\xffB\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\xff\xffr\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01\xff\xff~\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\x81\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x9b\x01\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01~\x01\xff\xff\xff\xffB\x01~\x01\x81\x01~\x01~\x01\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\x81\x01\x81\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xb8\x01\x8a\x01\xb8\x01\xff\xff\xff\xff\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x9c\x01\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xba\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\x8f\x01\xc6\x01\xff\xff\xc6\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xbb\x01\xff\xff\xbb\x01\xff\xff\xba\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xc9\x01\xc9\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",e,e,e,e,e,e],e2="lib/data_source/jellyfin_api.ml.Types.order",a4="lib/data_source/jellyfin_api.ml.Types.sort",gl="lib/data_source/jellyfin_api.ml.Item.genre_item",iE="lib/data_source/jellyfin_api.ml.Item.image_blur_hashes",E="lib/data_source/jellyfin_api.ml.Item.type_",l="lib/data_source/jellyfin_api.ml.Item.field",gm="lib/data_source/jellyfin_api.ml.Item.t",gn="lib/data_source/jellyfin_api.ml.Items.params",gq="lib/data_source/jellyfin_api.ml.Items.response",gv="lib/data_source/jellyfin_api.ml.Views.params",gw="lib/data_source/jellyfin_api.ml.Views.response",gx="lib/data_source/jellyfin_api.ml.Virtual_folders.virtual_folder",e4="lib/db/generic_schema.ml.Id.t",gy="lib/db/generic_schema.ml.Collection.t",gz="lib/db/generic_schema.ml.Genre.t",gA="lib/db/generic_schema.ml.Album.t",gB="lib/db/generic_schema.ml.Track.t",gC="lib/db/stores.ml.Items.sorts",gD="lib/db/stores.ml.Items.t",mB=[0,17,[0,16,[0,1,[0,18,[0,11,0]]]]];b7(11,j_,pR);b7(10,t,pE);b7(9,[J,pG,nh],pG);b7(8,j8,pz);b7(7,j7,ri);b7(6,bD,qi);b7(5,[J,oh,-6],oh);b7(4,[J,pr,-5],pr);b7(3,hx,pa);b7(2,eq,jJ);b7(1,j9,pk);b7(0,hy,rk);var -sd=nc,sb="output_substring",r9=c4,r6=ff,r7=fr,rW="Stdlib.Exit",rZ=dD(0,0,m$),r1=dD(0,0,65520),r3=dD(1,0,m$),sg="CamlinternalLazy.Undefined",sn=gT,so="\\'",sp=gW,sq=g7,sr=gO,ss=gI,sl="Char.chr",sx=" is not an Unicode scalar value",sI="List.init",sF="hd",s5=[0,n2,oJ,20],s4=[0,n2,oN,9],sR="String.blit / Bytes.blit_string",sQ="Bytes.blit",sP="String.sub / Bytes.sub",tf="String.contains_from / Bytes.contains_from",td="String.index_from / Bytes.index_from",s_=e,s7="String.concat",tw=[0,"array.ml",mO,4],tr="Array.map2: arrays must have the same length",to="Array.blit",tm="Array.fill",tk="Array.init",tu="Stdlib.Array.Bottom",tG=[0,"set.ml",n$,18],tC=gL,tD=gL,tE=gL,tF=gL,tM="Map.remove_min_elt",tN=[0,0,0,0],tO=[0,"map.ml",qK,10],tI=g9,tJ=g9,tK=g9,tL=g9,tQ="Stdlib.Queue.Empty",t1="Buffer.add_substring/add_subbytes",t0="Buffer.add: cannot grow buffer",tZ=[0,nN,93,2],tY=[0,nN,94,2],tV="Buffer.sub",ub=pp,uc=oV,ud=ql,ue=o8,uf=ro,ug=qh,uh="%f",ui="%B",uj="%{",uk="%}",ul="%(",um="%)",un=rn,uo="%t",up="%?",uq="%r",ur="%_r",us=[0,aP,mV,23],uD=[0,aP,qJ,21],uv=[0,aP,nJ,21],uE=[0,aP,nd,21],uw=[0,aP,pq,21],uF=[0,aP,pJ,19],ux=[0,aP,ps,19],uG=[0,aP,nW,22],uy=[0,aP,nj,22],uH=[0,aP,o7,30],uz=[0,aP,nz,30],uB=[0,aP,qp,26],ut=[0,aP,nX,26],uC=[0,aP,p8,28],uu=[0,aP,mW,28],uA=[0,aP,pT,23],vT=[0,aP,1558,4],vU="Printf: bad conversion %[",vV=[0,aP,1626,39],vW=[0,aP,1649,31],vX=[0,aP,1650,31],vY="Printf: bad conversion %_",vZ=ph,v0=nu,v1=ph,v2=nu,v5=[0,[11,"invalid box description ",[3,0,0]],"invalid box description %S"],v4=[0,0,4],vO=iN,vM="neg_infinity",vN=pn,vL=c4,vG=[0,gG],vu="%+nd",vv="% nd",vx="%+ni",vy="% ni",vz="%nx",vA="%#nx",vB="%nX",vC="%#nX",vD="%no",vE="%#no",vt="%nd",vw=ro,vF="%nu",vg="%+ld",vh="% ld",vj="%+li",vk="% li",vl="%lx",vm="%#lx",vn="%lX",vo="%#lX",vp="%lo",vq="%#lo",vf="%ld",vi=o8,vr="%lu",u4="%+Ld",u5="% Ld",u7="%+Li",u8="% Li",u9="%Lx",u_="%#Lx",u$="%LX",va="%#LX",vb="%Lo",vc="%#Lo",u3="%Ld",u6=qh,vd="%Lu",uQ="%+d",uR="% d",uT="%+i",uU="% i",uV="%x",uW="%#x",uX=q0,uY="%#X",uZ="%o",u0="%#o",uP=iM,uS=ql,u1=m_,t5="@]",t6="@}",t7="@?",t8="@\n",t9="@.",t_="@@",t$="@%",ua="@",uI="CamlinternalFormat.Type_mismatch",v_=e,v$=[0,[11,jz,[2,0,[2,0,0]]],", %s%s"],wH=[0,[11,jt,[2,0,[12,10,0]]],ne],wI=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],"Fatal error in uncaught exception handler: exception %s\n"],wG="Fatal error: out of memory in uncaught exception handler",wD=[0,[11,jt,[2,0,[12,10,0]]],ne],wx=[0,[2,0,[12,10,0]],"%s\n"],wy=[0,[11,m2,0],m2],wo="Raised at",wp="Re-raised at",wq="Raised by primitive operation at",wr="Called from",ws=" (inlined)",wu=e,wt=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,", line ",[4,0,0,0,[11,oX,LF]]]]]]]]]],'%s %s in file "%s"%s, line %d, characters %d-%d'],wv=[0,[2,0,[11," unknown location",0]],"%s unknown location"],wh="Out of memory",wi="Stack overflow",wj="Pattern matching failed",wk="Assertion failed",wl="Undefined recursive module",wb=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],wc=e,wd=e,we=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],v9=[0,[4,0,0,0,0],iM],v7=[0,[3,0,0],"%S"],v8=oK,wA=[0,e,"(Cannot print locations:\n bytecode executable program file not found)","(Cannot print locations:\n bytecode executable program file appears to be corrupt)","(Cannot print locations:\n bytecode executable program file has wrong magic number)","(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)"],wM="Fun.Finally_raised: ",wK="Stdlib.Fun.Finally_raised",wP=bA,wT=[0,987910699,495797812,364182224,414272206,318284740,990407751,383018966,270373319,840823159,24560019,536292337,512266505,189156120,730249596,143776328,51606627,140166561,366354223,1003410265,700563762,981890670,913149062,526082594,1021425055,784300257,667753350,630144451,949649812,48546892,415514493,258888527,511570777,89983870,283659902,308386020,242688715,482270760,865188196,1027664170,207196989,193777847,619708188,671350186,149669678,257044018,87658204,558145612,183450813,28133145,901332182,710253903,510646120,652377910,409934019,801085050],w5="Hashtbl: unsupported hash table format",wY=e,xN=[3,0,3],xO=c4,xH=pI,xI="<\/",xJ=e,xD=pI,xE="<",xF=e,xB="\n",xv=e,xw=e,xx=e,xy=e,xm=[0,e],xh=e,xi=e,xj=e,xk=e,xd=[0,e,0,e],w$="Stdlib.Format.String_tag",x0="Jsoo_runtime.Error.Exn",x1=iS,yh=[0,"src/fut.ml",34,25],yz="info",yy=g$,yx="log",yw="search",yq=[0,1],yo=rh,yA="isSecureContext",yF="cache",yG="credentials",yH="headers",yI="integrity",yJ="keepalive",yK="method",yL="mode",yM="redirect",yN="referrer",yO="referrerPolicy",zl="open",zh="unique",zb="autoIncrement",zc="keyPath",zd="new object store with options:",y9="readonly",y_="readwrite",y$="readwriteflush",y3="next",y4="nextUnique",y5="prev",y6="prevUnique",zr=[0,[11,"\x1b[",[4,0,0,0,[12,109,0]]],"\x1b[%dm"],zB="CCResult.Get_error",zO=[0,rj,119,10],zL=[0,rj,92,10],zH=e,z5=[0,[17,[0,oP,1,0],0],oP],z4=[0,[12,32,0],bS],z3=[0,[11,nY,0],nY],z6=[0,[15,[4,6,0,[0,2],[15,0]]],"%a%.2x%a"],zY=[0,[11,qa,[15,[11,pM,[15,[11," dst-off=",[4,0,0,0,[11,iK,[4,0,0,0,0]]]]]]]],"Cstruct.blit_from_string src=%a dst=%a dst-off=%d len=%d"],zW=[0,[11,qa,[15,[11,pM,[15,[11," src-off=",[4,0,0,0,[11,iK,[4,0,0,0,0]]]]]]]],"Cstruct.blit_from_string src=%a dst=%a src-off=%d len=%d"],zU=[0,[12,91,[4,0,0,0,[12,93,0]]],"[%d]"],zT=[0,[12,91,[4,0,0,0,[12,44,[4,0,0,0,[11,"](",[4,0,0,0,[12,41,0]]]]]]],"[%d,%d](%d)"],z7=[0,[17,3,[15,[17,4,0]]],"@\n%a@."],z8=e,AE=[0,[8,[0,0,0],0,[0,0],0],mK],An=[0,[12,44,0],ji],Au=[0,[15,[12,58,[15,0]]],"%a:%a"],At=[0,[12,44,0],ji],Am=[0,[11,fj,0],fj],Ap=[0,[11,ff,0],ff],Aq=[0,[11,fr,0],fr],Ar=[0,[8,[0,0,0],0,[0,0],0],mK],As=[0,[8,[0,0,3],0,0,0],"%g"],Av=[0,[12,d$,[15,[12,ed,0]]],"{%a}"],Ao=[0,[12,91,[15,[12,93,0]]],"[%a]"],Aw=[0,[12,44,[17,[0,a,1,0],0]],m5],AA=[0,[18,[1,[0,[11,d3,0],d3]],[15,[12,58,[17,[0,a,1,0],[15,[17,0,0]]]]]],"@[%a:@ %a@]"],Az=[0,[12,44,[17,[0,a,1,0],0]],m5],AB=[0,[18,[1,[0,[11,d3,0],d3]],[11,"{ ",[15,[11," }",[17,0,0]]]]],"@[{ %a }@]"],AC=[0,[11,qz,0],qz],Ax=[0,[18,[1,[0,[11,d3,0],d3]],[11,"[ ",[15,[11," ]",[17,0,0]]]]],"@[[ %a ]@]"],Ay=[0,[11,q$,0],q$],Ab=[0,[12,34,0],c5],Af=[0,[0,0],pp],Ae=[0,[11,gT,0],gT],Ah=[0,[11,gW,0],gW],Ai=[0,[11,g7,0],g7],Aj=[0,[11,gO,0],gO],Ak=[0,[11,gI,0],gI],Ad=[0,[11,jD,0],jD],Ag=[0,[11,"\\u",[4,6,[0,2,4],0,0]],"\\u%04x"],Ac=[0,[12,34,0],c5],A2=[0,fk,nT,9],AV=[0,eg,jq],AQ=[0,fl,jq],AW=[0,c2,jq],AU=[0,c2,fc],AR=[0,fl,fc],AS=[0,fk,153,55],AT=[0,c2,fc],AX=[0,fk,152,55],AY=[0,fk,154,55],AZ=[0,c2,co],AO=[0,fk,ju,9],AG=[0,[11,"invalid bounds (index ",[4,0,0,0,[11,", length ",[4,0,0,0,[12,41,0]]]]],"invalid bounds (index %d, length %d)"],AN=[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0],Cf=[0,bO,[0,ba,1]],Cg=[0,bO,cC],Ch=[0,bO,[0,ba,0]],Cj=[0,bO,fe],Ci=[0,bO,dw],Cu=[0,jm,pb,27],Co=[0,bO,n6],Cl=[0,bO,q3],Cd=[0,jm,qO,8],Cc=[0,jm,pQ,45],BK=[0,[18,[1,[0,0,e]],[11,d7,[17,[0,a,1,0],[11,"initial",[17,[0,a,1,0],[11,"BOM",[17,[0,a,1,0],[11,jb,[17,[0,a,1,0],[11,gH,LG]]]]]]]]]],"@[illegal@ initial@ BOM@ in@ character@ stream@]"],BL=[0,[18,[1,[0,0,e]],[11,d7,[17,[0,a,1,0],[11,"escape,",[17,[0,a,1,0],0]]]]],"@[illegal@ escape,@ "],BN=[0,[15,[17,[0,a,1,0],[11,iY,[17,[0,a,1,0],[11,"an",[17,[0,a,1,0],[11,"escaped",[17,[0,a,1,0],[11,gH,[17,0,0]]]]]]]]]],"%a@ not@ an@ escaped@ character@]"],BO=[0,[15,[17,[0,a,1,0],[11,np,[17,[0,a,1,0],[11,p$,[17,[0,a,1,0],[11,je,[17,0,0]]]]]]]],"%a@ lone@ low@ surrogate@]"],BP=[0,[15,[17,[0,a,1,0],[11,np,[17,[0,a,1,0],[11,"high",[17,[0,a,1,0],[11,je,[17,0,0]]]]]]]],"%a@ lone@ high@ surrogate@]"],BQ=[0,[15,[17,[0,a,1,0],[11,iY,[17,[0,a,1,0],[12,97,[17,[0,a,1,0],[11,"hex",[17,[0,a,1,0],[11,"digit",[17,0,0]]]]]]]]]],"%a@ not@ a@ hex@ digit@]"],BM=[0,[15,[17,[0,a,1,0],[11,iY,[17,[0,a,1,0],[12,97,[17,[0,a,1,0],[11,p$,[17,[0,a,1,0],[11,je,[17,0,0]]]]]]]]]],"%a@ not@ a@ low@ surrogate@]"],BR=[0,[18,[1,[0,0,e]],[11,d7,[17,[0,a,1,0],[11,"bytes",[17,[0,a,1,0],[11,jb,[17,[0,a,1,0],[11,gH,[17,[0,a,1,0],[11,nm,LH]]]]]]]]]],"@[illegal@ bytes@ in@ character@ stream@ ("],BS=[0,[4,8,[0,2,2],0,0],"%02X"],BU=[0,[12,32,[4,8,[0,2,2],0,0]]," %02X"],BT=[0,[12,41,[17,0,0]],")@]"],BV=[0,[18,[1,[0,0,e]],[11,"expected",[17,[0,a,1,0],0]]],"@[expected@ "],BW=[0,[11,p0,[17,[0,a,1,0],[11,bR,[17,0,0]]]],"member@ name@]"],BX=[0,[11,hc,[17,[0,a,1,0],[11,"text (JSON value)",[17,0,0]]]],"JSON@ text (JSON value)@]"],BY=[0,[11,bR,[17,[0,a,1,0],[11,i4,[17,[0,a,1,0],[11,"(':')",[17,0,0]]]]]],"name@ separator@ (':')@]"],BZ=[0,[11,fb,[17,[0,a,1,0],[11,"of",[17,[0,a,1,0],[11,nc,[17,0,0]]]]]],"end@ of@ input@]"],B0=[0,[11,"JavaScript",[17,[0,a,1,0],[11,op,[17,0,0]]]],"JavaScript@ comment@]"],B1=[0,[11,hc,[17,[0,a,1,0],[11,d2,[17,0,0]]]],"JSON@ value@]"],B2=[0,[11,p0,[17,[0,a,1,0],[11,bR,[17,[0,a,1,0],[11,c3,[17,[0,a,1,0],[11,hg,[17,[0,a,1,0],[11,fb,[17,LJ,LI]]]]]]]]]],"member@ name@ or@ object@ end@ ('\"'@ or@ '}')@]"],B3=[0,[11,d2,[17,[0,a,1,0],[11,i4,[17,[0,a,1,0],[11,c3,[17,[0,a,1,0],[11,hg,[17,[0,a,1,0],[11,fb,[17,LL,LK]]]]]]]]]],"value@ separator@ or@ object@ end@ (','@ or@ '}')@]"],B4=[0,[11,d2,[17,[0,a,1,0],[11,c3,[17,[0,a,1,0],[11,g6,[17,[0,a,1,0],[11,fb,[17,[0,a,1,0],[11,"(value",[17,LN,LM]]]]]]]]]],"value@ or@ array@ end@ (value@ or@ ']')@]"],B5=[0,[11,d2,[17,[0,a,1,0],[11,i4,[17,[0,a,1,0],[11,c3,[17,[0,a,1,0],[11,g6,[17,[0,a,1,0],[11,fb,[17,LP,LO]]]]]]]]]],"value@ separator@ or@ array@ end@ (','@ or@ ']')@]"],B6=[0,[18,[1,[0,0,e]],[11,d7,[17,[0,a,1,0],[11,"number",[17,[0,a,1,0],[12,40,[2,0,[12,41,[17,0,0]]]]]]]]],"@[illegal@ number@ (%s)@]"],Ca=[0,[18,[1,[0,0,e]],[11,d7,[17,[0,a,1,0],[11,"literal",[17,[0,a,1,0],[12,40,[2,0,[12,41,[17,0,0]]]]]]]]],"@[illegal@ literal@ (%s)@]"],Cb=[0,[18,[1,[0,0,e]],[11,d7,[17,[0,a,1,0],[11,gH,[17,[0,a,1,0],[11,jb,[17,[0,a,1,0],[11,hc,[17,[0,a,1,0],[11,i_,LQ]]]]]]]]]],"@[illegal@ character@ in@ JSON@ string@ (%a)@]"],B7=[0,[18,[1,[0,0,e]],[11,"unclosed",[17,[0,a,1,0],0]]],"@[unclosed@ "],B8=[0,[11,hg,[17,0,0]],"object@]"],B9=[0,[11,g6,[17,0,0]],"array@]"],B_=[0,[11,op,[17,0,0]],"comment@]"],B$=[0,[11,i_,[17,0,0]],"string@]"],BI=[0,[12,39,[2,0,[11,"' (",[15,[12,41,0]]]]],"'%s' (%a)"],BH=[0,[11,"U+",[4,8,[0,2,4],0,0]],"U+%04X"],Bm=[0,ag,-543455433],Bt=[0,ag,[0,e9,d6]],Bu=[0,ag,[0,e9,f]],Bv=[0,ag,[0,e9,fe]],Bw=[0,ag,[0,e9,dw]],Bz=[0,ag,[0,cd,d6]],BA=[0,ag,[0,cd,gV]],BB=[0,ag,[0,cd,qS]],BC=[0,ag,[0,cd,[0,qR,1]]],BD=[0,ag,[0,cd,[0,qR,0]]],BE=[0,ag,[0,cd,[0,iR,1]]],BF=[0,ag,[0,cd,[0,iR,0]]],BG=[0,ag,[0,cd,ny]],CO="not a valid JSON array/object",CL=[0,[11,"JSON.of_buffer ",[2,0,0]],"JSON.of_buffer %s"],CG=[0,[11,bQ,0],bQ],CH=[0,[11,"Unexpected input when parsing a ",[2,0,0]],"Unexpected input when parsing a %s"],CI=[0,[15,0],rn],CF="We expected a well-formed JSON document (array or object)",CA=d2,CB="object fields",Cy=[0,"lib/ezjsonm.ml",61,19],Cz=[0,gR,357123046],Cx="Abort",CC="Ezjsonm.Parse_error",CQ=hp([[0,hf,z],[0,193,z],[0,o3,z],[0,195,z],[0,196,z],[0,qE,z],[0,198,e$],[0,199,ax],[0,200,F],[0,201,F],[0,202,F],[0,203,F],[0,pQ,W],[0,205,W],[0,206,W],[0,207,W],[0,208,ai],[0,209,am],[0,210,s],[0,qO,s],[0,212,s],[0,213,s],[0,214,s],[0,216,s],[0,217,B],[0,218,B],[0,219,B],[0,220,B],[0,221,aK],[0,222,jl],[0,n5,R],[0,ef,v],[0,qn,v],[0,226,v],[0,227,v],[0,228,v],[0,229,v],[0,230,cD],[0,231,aL],[0,232,n],[0,pl,n],[0,234,n],[0,235,n],[0,236,O],[0,g3,O],[0,238,O],[0,oM,O],[0,d5,aa],[0,241,ab],[0,242,d],[0,243,d],[0,qC,d],[0,pF,d],[0,iV,d],[0,J,d],[0,249,u],[0,fd,u],[0,251,u],[0,ec,u],[0,nq,aw],[0,dy,fm],[0,c1,aw],[0,cn,z],[0,qs,v],[0,258,z],[0,259,v],[0,260,z],[0,261,v],[0,262,ax],[0,263,aL],[0,264,ax],[0,265,aL],[0,oa,ax],[0,267,aL],[0,268,ax],[0,269,aL],[0,270,ai],[0,mQ,aa],[0,272,ai],[0,qU,aa],[0,274,F],[0,275,n],[0,276,F],[0,277,n],[0,278,F],[0,279,n],[0,280,F],[0,281,n],[0,282,F],[0,283,n],[0,284,al],[0,285,V],[0,286,al],[0,287,V],[0,288,al],[0,289,V],[0,ok,al],[0,291,V],[0,p4,ay],[0,293,U],[0,294,ay],[0,295,U],[0,296,W],[0,ov,O],[0,298,W],[0,299,O],[0,300,W],[0,301,O],[0,302,W],[0,303,O],[0,304,W],[0,305,O],[0,306,"IJ"],[0,307,"ij"],[0,308,b5],[0,309,bn],[0,310,aA],[0,311,aQ],[0,312,"kra"],[0,313,ad],[0,314,D],[0,315,ad],[0,316,D],[0,317,ad],[0,318,D],[0,319,ad],[0,320,D],[0,321,ad],[0,mO,D],[0,323,am],[0,324,ab],[0,325,am],[0,326,ab],[0,327,am],[0,328,ab],[0,329,ab],[0,330,"NG"],[0,331,fn],[0,332,s],[0,333,d],[0,334,s],[0,335,d],[0,336,s],[0,337,d],[0,338,og],[0,339,cI],[0,340,af],[0,341,r],[0,342,af],[0,343,r],[0,344,af],[0,345,r],[0,346,_],[0,347,R],[0,348,_],[0,349,R],[0,350,_],[0,351,R],[0,352,_],[0,353,R],[0,354,aC],[0,355,ah],[0,356,aC],[0,nv,ah],[0,358,aC],[0,359,ah],[0,360,B],[0,361,u],[0,362,B],[0,nT,u],[0,364,B],[0,365,u],[0,366,B],[0,367,u],[0,368,B],[0,369,u],[0,370,B],[0,371,u],[0,372,aV],[0,373,a5],[0,374,aK],[0,375,aw],[0,376,aK],[0,377,an],[0,378,$],[0,379,an],[0,380,$],[0,381,an],[0,382,$],[0,383,R],[0,384,aJ],[0,385,aT],[0,386,aT],[0,387,aJ],[0,388,nx],[0,389,nx],[0,390,s],[0,391,ax],[0,392,aL],[0,393,ai],[0,394,ai],[0,395,ai],[0,396,aa],[0,pb,aa],[0,398,F],[0,399,F],[0,qK,F],[0,401,bh],[0,402,b0],[0,403,al],[0,404,al],[0,405,oq],[0,406,W],[0,407,W],[0,408,aA],[0,409,aQ],[0,410,D],[0,411,D],[0,412,a$],[0,413,am],[0,414,ab],[0,415,s],[0,416,s],[0,417,d],[0,418,"OI"],[0,419,"oi"],[0,420,aU],[0,421,bl],[0,422,"YR"],[0,423,ja],[0,424,ja],[0,425,nM],[0,426,cH],[0,427,ah],[0,428,aC],[0,429,ah],[0,430,aC],[0,431,B],[0,432,u],[0,433,B],[0,434,bi],[0,435,aK],[0,436,aw],[0,437,an],[0,438,$],[0,439,an],[0,440,an],[0,441,$],[0,442,$],[0,443,ja],[0,444,pj],[0,445,pj],[0,446,bP],[0,447,a5],[0,448,ce],[0,449,ce],[0,450,ce],[0,451,ce],[0,452,qG],[0,453,ai],[0,454,b2],[0,455,"LJ"],[0,456,ad],[0,457,"lj"],[0,458,"NJ"],[0,459,am],[0,460,"nj"],[0,461,z],[0,462,v],[0,463,W],[0,464,O],[0,465,s],[0,466,d],[0,467,B],[0,468,u],[0,469,B],[0,470,u],[0,471,B],[0,472,u],[0,473,B],[0,474,u],[0,475,B],[0,476,u],[0,477,n],[0,478,z],[0,479,v],[0,480,z],[0,481,v],[0,482,e$],[0,483,cD],[0,484,al],[0,485,V],[0,486,al],[0,487,V],[0,488,aA],[0,489,aQ],[0,490,s],[0,491,d],[0,492,s],[0,493,d],[0,494,an],[0,495,$],[0,496,bn],[0,497,qG],[0,498,ai],[0,499,b2],[0,500,al],[0,501,V],[0,502,"HW"],[0,503,aV],[0,504,am],[0,505,ab],[0,506,z],[0,507,v],[0,508,e$],[0,509,cD],[0,510,s],[0,511,d],[0,g0,z],[0,513,v],[0,514,z],[0,515,v],[0,516,F],[0,517,n],[0,518,F],[0,519,n],[0,520,W],[0,521,O],[0,522,W],[0,523,O],[0,524,s],[0,525,d],[0,526,s],[0,527,d],[0,528,af],[0,529,r],[0,530,af],[0,531,r],[0,532,B],[0,533,u],[0,534,B],[0,535,u],[0,536,_],[0,537,R],[0,538,aC],[0,539,ah],[0,540,"GH"],[0,541,"gh"],[0,542,ay],[0,543,U],[0,544,am],[0,545,aa],[0,546,"OU"],[0,547,i1],[0,548,an],[0,549,$],[0,550,z],[0,551,v],[0,552,F],[0,553,n],[0,554,s],[0,555,d],[0,556,s],[0,557,d],[0,558,s],[0,559,d],[0,560,s],[0,561,d],[0,562,aK],[0,563,aw],[0,564,D],[0,565,ab],[0,566,ah],[0,567,bn],[0,568,"db"],[0,569,"qp"],[0,n$,z],[0,571,ax],[0,572,aL],[0,573,ad],[0,574,aC],[0,575,R],[0,576,$],[0,577,nU],[0,578,bP],[0,579,aT],[0,580,B],[0,581,bi],[0,582,F],[0,583,n],[0,584,b5],[0,585,bn],[0,586,bT],[0,587,c0],[0,588,af],[0,589,r],[0,590,aK],[0,591,aw],[0,592,v],[0,593,v],[0,594,v],[0,595,aJ],[0,596,d],[0,597,aL],[0,598,aa],[0,599,aa],[0,600,n],[0,601,n],[0,602,n],[0,603,n],[0,604,n],[0,605,n],[0,606,n],[0,607,bn],[0,608,V],[0,609,V],[0,610,V],[0,611,V],[0,612,qe],[0,613,U],[0,614,U],[0,615,U],[0,616,O],[0,617,O],[0,618,O],[0,619,D],[0,620,D],[0,621,D],[0,622,eb],[0,623,aW],[0,624,aW],[0,625,aW],[0,626,ab],[0,627,ab],[0,628,ab],[0,629,d],[0,630,cI],[0,631,d],[0,632,i3],[0,633,r],[0,634,r],[0,635,r],[0,636,r],[0,637,r],[0,638,r],[0,639,r],[0,640,r],[0,641,r],[0,oJ,R],[0,643,cH],[0,644,bn],[0,645,"{squat}"],[0,646,cH],[0,647,ah],[0,648,ah],[0,649,u],[0,650,u],[0,651,aX],[0,652,aX],[0,653,a5],[0,654,aw],[0,655,aw],[0,656,$],[0,657,$],[0,658,$],[0,659,$],[0,660,nU],[0,661,"{voiced}"],[0,662,bP],[0,663,aL],[0,664,ce],[0,665,aJ],[0,666,n],[0,oN,V],[0,668,U],[0,669,bn],[0,670,aQ],[0,671,D],[0,672,c0],[0,673,bP],[0,674,bP],[0,675,b2],[0,676,b2],[0,677,b2],[0,678,bP],[0,679,ha],[0,680,nI],[0,681,jH],[0,682,qf],[0,683,eb],[0,684,"{percussive}"],[0,685,"{bipercussive}"],[0,686,U],[0,687,U],[0,688,U],[0,689,U],[0,690,bn],[0,691,r],[0,692,r],[0,693,r],[0,694,r],[0,695,a5],[0,696,aw],[0,736,V],[0,737,D],[0,738,R],[0,739,bA],[0,740,bP],[0,768,e],[0,769,e],[0,770,e],[0,771,e],[0,772,e],[0,773,e],[0,774,e],[0,775,e],[0,776,e],[0,777,e],[0,778,e],[0,779,e],[0,780,e],[0,781,e],[0,782,e],[0,783,e],[0,784,e],[0,785,e],[0,786,e],[0,787,e],[0,788,e],[0,789,e],[0,790,e],[0,791,e],[0,792,e],[0,793,e],[0,794,e],[0,795,e],[0,796,e],[0,797,e],[0,798,e],[0,799,e],[0,800,e],[0,801,e],[0,802,e],[0,803,e],[0,804,e],[0,805,e],[0,806,e],[0,807,e],[0,808,e],[0,809,e],[0,810,e],[0,811,e],[0,812,e],[0,813,e],[0,qJ,e],[0,nJ,e],[0,816,e],[0,817,e],[0,nd,e],[0,pq,e],[0,820,e],[0,821,e],[0,pJ,e],[0,ps,e],[0,824,e],[0,825,e],[0,nW,e],[0,nj,e],[0,828,e],[0,829,e],[0,830,e],[0,o7,e],[0,nz,e],[0,833,e],[0,834,e],[0,835,e],[0,qp,e],[0,nX,e],[0,838,e],[0,839,e],[0,840,e],[0,841,e],[0,842,e],[0,843,e],[0,844,e],[0,845,e],[0,p8,e],[0,mW,e],[0,848,e],[0,849,e],[0,mV,e],[0,pT,e],[0,852,e],[0,853,e],[0,854,e],[0,855,e],[0,856,e],[0,857,e],[0,858,e],[0,859,e],[0,860,e],[0,861,e],[0,862,e],[0,863,e],[0,864,e],[0,865,e],[0,866,e],[0,867,e],[0,868,e],[0,869,e],[0,870,e],[0,871,e],[0,872,e],[0,873,e],[0,874,e],[0,875,e],[0,876,e],[0,877,e],[0,878,e],[0,879,e],[0,1155,e],[0,1156,e],[0,1157,e],[0,1158,e],[0,1159,e],[0,1160,e],[0,1161,e],[0,2027,e],[0,2028,e],[0,2029,e],[0,2030,e],[0,2031,e],[0,2032,e],[0,2033,e],[0,2034,e],[0,2035,e],[0,3072,e],[0,3076,e],[0,3315,e],[0,3328,e],[0,4957,e],[0,4958,e],[0,4959,e],[0,6783,e],[0,6832,e],[0,6833,e],[0,6834,e],[0,6835,e],[0,6836,e],[0,6837,e],[0,6838,e],[0,6839,e],[0,6840,e],[0,6841,e],[0,6842,e],[0,6843,e],[0,6844,e],[0,6845,e],[0,6846,e],[0,6847,e],[0,6848,e],[0,6849,e],[0,6850,e],[0,6851,e],[0,6852,e],[0,6853,e],[0,6854,e],[0,6855,e],[0,6856,e],[0,6857,e],[0,6858,e],[0,6859,e],[0,6860,e],[0,6861,e],[0,6862,e],[0,6863,e],[0,6864,e],[0,6865,e],[0,6866,e],[0,6867,e],[0,6868,e],[0,6869,e],[0,6870,e],[0,6871,e],[0,6872,e],[0,6873,e],[0,6874,e],[0,6875,e],[0,6876,e],[0,6877,e],[0,6878,e],[0,6879,e],[0,6880,e],[0,6881,e],[0,6882,e],[0,6883,e],[0,6884,e],[0,6885,e],[0,6886,e],[0,6887,e],[0,6888,e],[0,6889,e],[0,6890,e],[0,6891,e],[0,6892,e],[0,6893,e],[0,6894,e],[0,6895,e],[0,6896,e],[0,6897,e],[0,6898,e],[0,6899,e],[0,6900,e],[0,6901,e],[0,6902,e],[0,6903,e],[0,6904,e],[0,6905,e],[0,6906,e],[0,6907,e],[0,6908,e],[0,6909,e],[0,6910,e],[0,6911,e],[0,7019,e],[0,7020,e],[0,7021,e],[0,7022,e],[0,7023,e],[0,7024,e],[0,7025,e],[0,7026,e],[0,7027,e],[0,7424,v],[0,7425,cD],[0,7426,cD],[0,7427,aJ],[0,7428,aL],[0,7429,aa],[0,7430,aa],[0,7431,n],[0,7432,n],[0,7433,O],[0,7434,bn],[0,7435,aQ],[0,7436,D],[0,7437,aW],[0,7438,ab],[0,7439,d],[0,7440,d],[0,7441,d],[0,7442,d],[0,7443,d],[0,7444,cI],[0,7445,i1],[0,7446,d],[0,7447,d],[0,7448,bl],[0,7449,r],[0,7450,r],[0,7451,ah],[0,7452,u],[0,7453,u],[0,7454,u],[0,7455,aW],[0,7456,aX],[0,7457,a5],[0,7458,$],[0,7459,$],[0,7460,"{spirant}"],[0,7461,d],[0,7468,v],[0,7469,cD],[0,7470,aJ],[0,7471,aJ],[0,7472,aa],[0,7473,n],[0,7474,n],[0,7475,V],[0,7476,U],[0,7477,O],[0,7478,bn],[0,7479,aQ],[0,7480,D],[0,7481,aW],[0,7482,ab],[0,7483,ab],[0,7484,d],[0,7485,i1],[0,7486,bl],[0,7487,r],[0,7488,ah],[0,7489,u],[0,7490,a5],[0,7491,v],[0,7492,v],[0,7493,v],[0,7494,cD],[0,7495,aJ],[0,7496,aa],[0,7497,n],[0,7498,n],[0,7499,n],[0,7500,n],[0,7501,V],[0,7502,O],[0,7503,aQ],[0,7504,aW],[0,7505,fn],[0,7506,d],[0,7507,d],[0,7508,d],[0,7509,d],[0,7510,bl],[0,7511,ah],[0,7512,u],[0,7513,u],[0,7514,aW],[0,7515,aX],[0,7516,d],[0,7531,qF],[0,7532,aJ],[0,7533,aa],[0,7534,b0],[0,7535,aW],[0,7536,ab],[0,7537,bl],[0,7538,r],[0,7539,r],[0,7540,R],[0,7541,ah],[0,7542,$],[0,7543,V],[0,7545,V],[0,7546,fm],[0,7547,O],[0,7548,O],[0,7549,bl],[0,7550,u],[0,7551,u],[0,7552,aJ],[0,7553,aa],[0,7554,b0],[0,7555,V],[0,7556,aQ],[0,7557,D],[0,7558,aW],[0,7559,ab],[0,7560,bl],[0,7561,r],[0,7562,R],[0,7563,cH],[0,7564,aX],[0,7565,bA],[0,7566,$],[0,7567,v],[0,7568,v],[0,7569,aa],[0,7570,n],[0,7571,n],[0,7572,n],[0,7573,n],[0,7574,O],[0,7575,d],[0,7576,cH],[0,7577,u],[0,7578,$],[0,7579,v],[0,7580,aL],[0,7581,aL],[0,7582,aa],[0,7583,n],[0,7584,b0],[0,7585,bn],[0,7586,V],[0,7587,U],[0,7588,O],[0,7589,O],[0,7590,O],[0,7591,O],[0,7592,bn],[0,7593,D],[0,7594,D],[0,7595,D],[0,7596,aW],[0,7597,aW],[0,7598,ab],[0,7599,ab],[0,7600,ab],[0,7601,d],[0,7602,i3],[0,7603,R],[0,7604,cH],[0,7605,ah],[0,7606,u],[0,7607,u],[0,7608,u],[0,7609,aX],[0,7610,aX],[0,7611,$],[0,7612,$],[0,7613,$],[0,7614,$],[0,7616,e],[0,7617,e],[0,7618,e],[0,7619,e],[0,7620,e],[0,7621,e],[0,7622,e],[0,7623,e],[0,7624,e],[0,7625,e],[0,7626,af],[0,7627,e],[0,7628,e],[0,7629,e],[0,7630,e],[0,7631,e],[0,7632,e],[0,7633,e],[0,7634,e],[0,7635,z],[0,7636,e$],[0,7637,nR],[0,7638,i9],[0,7639,ax],[0,7640,ai],[0,7641,ai],[0,7642,al],[0,7643,al],[0,7644,aA],[0,7645,ad],[0,7646,ad],[0,7647,a$],[0,7648,am],[0,7649,am],[0,7650,af],[0,7651,af],[0,7652,_],[0,7653,_],[0,7654,an],[0,7655,z],[0,7656,aT],[0,7657,aT],[0,7658,F],[0,7659,bh],[0,7660,ad],[0,7661,s],[0,7662,aU],[0,7663,nM],[0,7664,B],[0,7665,aV],[0,7666,z],[0,7667,s],[0,7668,B],[0,7669,e],[0,7670,e],[0,7671,e],[0,7672,e],[0,7673,e],[0,7674,e],[0,7675,e],[0,7676,e],[0,7677,e],[0,7678,e],[0,7679,e],[0,7680,z],[0,7681,v],[0,7682,aT],[0,7683,aJ],[0,7684,aT],[0,7685,aJ],[0,7686,aT],[0,7687,aJ],[0,7688,ax],[0,7689,aL],[0,7690,ai],[0,7691,aa],[0,7692,ai],[0,7693,aa],[0,7694,ai],[0,7695,aa],[0,7696,ai],[0,7697,aa],[0,7698,ai],[0,7699,aa],[0,7700,F],[0,7701,n],[0,7702,F],[0,7703,n],[0,7704,F],[0,7705,n],[0,7706,F],[0,7707,n],[0,7708,F],[0,7709,n],[0,7710,bh],[0,7711,b0],[0,7712,al],[0,7713,V],[0,7714,ay],[0,7715,U],[0,7716,ay],[0,7717,U],[0,7718,ay],[0,7719,U],[0,7720,ay],[0,7721,U],[0,7722,ay],[0,7723,U],[0,7724,W],[0,7725,O],[0,7726,W],[0,7727,O],[0,7728,aA],[0,7729,aQ],[0,7730,aA],[0,7731,aQ],[0,7732,aA],[0,7733,aQ],[0,7734,ad],[0,7735,D],[0,7736,ad],[0,7737,D],[0,7738,ad],[0,7739,D],[0,7740,ad],[0,7741,D],[0,7742,a$],[0,7743,aW],[0,7744,a$],[0,7745,aW],[0,7746,a$],[0,7747,aW],[0,7748,am],[0,7749,ab],[0,7750,am],[0,7751,ab],[0,7752,am],[0,7753,ab],[0,7754,am],[0,7755,ab],[0,7756,s],[0,7757,d],[0,7758,s],[0,7759,d],[0,7760,s],[0,7761,d],[0,7762,s],[0,7763,d],[0,7764,aU],[0,7765,bl],[0,7766,aU],[0,7767,bl],[0,7768,af],[0,7769,r],[0,7770,af],[0,7771,r],[0,7772,af],[0,7773,r],[0,7774,af],[0,7775,r],[0,7776,_],[0,7777,R],[0,7778,_],[0,7779,R],[0,7780,_],[0,7781,R],[0,7782,_],[0,7783,R],[0,7784,_],[0,7785,R],[0,7786,aC],[0,7787,ah],[0,7788,aC],[0,7789,ah],[0,7790,aC],[0,7791,ah],[0,7792,aC],[0,7793,ah],[0,7794,B],[0,7795,u],[0,7796,B],[0,7797,u],[0,7798,B],[0,7799,u],[0,7800,B],[0,7801,u],[0,7802,B],[0,7803,u],[0,7804,bi],[0,7805,aX],[0,7806,bi],[0,7807,aX],[0,7808,aV],[0,7809,a5],[0,7810,aV],[0,7811,a5],[0,7812,aV],[0,7813,a5],[0,7814,aV],[0,7815,a5],[0,7816,aV],[0,7817,a5],[0,7818,b4],[0,7819,bA],[0,7820,b4],[0,7821,bA],[0,7822,aK],[0,7823,aw],[0,7824,an],[0,7825,$],[0,7826,an],[0,7827,$],[0,7828,an],[0,7829,$],[0,7830,U],[0,7831,ah],[0,7832,a5],[0,7833,aw],[0,7834,v],[0,7835,R],[0,7836,R],[0,7837,R],[0,7838,_],[0,7839,aa],[0,7840,z],[0,7841,v],[0,7842,z],[0,7843,v],[0,7844,z],[0,7845,v],[0,7846,z],[0,7847,v],[0,7848,z],[0,7849,v],[0,7850,z],[0,7851,v],[0,7852,z],[0,7853,v],[0,7854,z],[0,7855,v],[0,7856,z],[0,7857,v],[0,7858,z],[0,7859,v],[0,7860,z],[0,7861,v],[0,7862,z],[0,7863,v],[0,7864,F],[0,7865,n],[0,7866,F],[0,7867,n],[0,7868,F],[0,7869,n],[0,7870,F],[0,7871,n],[0,7872,F],[0,7873,n],[0,7874,F],[0,7875,n],[0,7876,F],[0,7877,n],[0,7878,F],[0,7879,n],[0,7880,W],[0,7881,O],[0,7882,W],[0,7883,O],[0,7884,s],[0,7885,d],[0,7886,s],[0,7887,d],[0,7888,s],[0,7889,d],[0,7890,s],[0,7891,d],[0,7892,s],[0,7893,d],[0,7894,s],[0,7895,d],[0,7896,s],[0,7897,d],[0,7898,s],[0,7899,d],[0,7900,s],[0,7901,d],[0,7902,s],[0,7903,d],[0,7904,s],[0,7905,d],[0,7906,s],[0,7907,d],[0,7908,B],[0,7909,u],[0,7910,B],[0,7911,u],[0,7912,B],[0,7913,u],[0,7914,B],[0,7915,u],[0,7916,B],[0,7917,u],[0,7918,B],[0,7919,u],[0,7920,B],[0,7921,u],[0,7922,aK],[0,7923,aw],[0,7924,aK],[0,7925,aw],[0,7926,aK],[0,7927,aw],[0,7928,aK],[0,7929,aw],[0,7930,"LL"],[0,7931,"ll"],[0,7932,bi],[0,7933,aX],[0,7934,aK],[0,7935,aw],[0,8305,O],[0,8319,ab],[0,8400,e],[0,8401,e],[0,8402,e],[0,8403,e],[0,8404,e],[0,8405,e],[0,8406,e],[0,8407,e],[0,8408,e],[0,8409,e],[0,8410,e],[0,8411,e],[0,8412,e],[0,8413,e],[0,8414,e],[0,8415,e],[0,8416,e],[0,8417,e],[0,8418,e],[0,8419,e],[0,8420,e],[0,8421,e],[0,8422,e],[0,8423,e],[0,8424,e],[0,8425,e],[0,8426,e],[0,8427,e],[0,8428,e],[0,8429,e],[0,8430,e],[0,8431,e],[0,8432,e],[0,8580,aL],[0,9372,z],[0,9373,aT],[0,9374,ax],[0,9375,ai],[0,9376,F],[0,9377,bh],[0,9378,al],[0,9379,ay],[0,9380,W],[0,9381,b5],[0,9382,aA],[0,9383,ad],[0,9384,a$],[0,9385,am],[0,9386,s],[0,9387,aU],[0,9388,bT],[0,9389,af],[0,9390,_],[0,9391,aC],[0,9392,B],[0,9393,bi],[0,9394,aV],[0,9395,b4],[0,9396,aK],[0,9397,an],[0,9398,z],[0,9399,aT],[0,9400,ax],[0,9401,ai],[0,9402,F],[0,9403,bh],[0,9404,al],[0,9405,ay],[0,9406,W],[0,9407,b5],[0,9408,aA],[0,9409,ad],[0,9410,a$],[0,9411,am],[0,9412,s],[0,9413,aU],[0,9414,bT],[0,9415,af],[0,9416,_],[0,9417,aC],[0,9418,B],[0,9419,bi],[0,9420,aV],[0,9421,b4],[0,9422,aK],[0,9423,an],[0,9424,v],[0,9425,aJ],[0,9426,aL],[0,9427,aa],[0,9428,n],[0,9429,b0],[0,9430,V],[0,9431,U],[0,9432,O],[0,9433,bn],[0,9434,aQ],[0,9435,D],[0,9436,aW],[0,9437,ab],[0,9438,d],[0,9439,bl],[0,9440,c0],[0,9441,r],[0,9442,R],[0,9443,ah],[0,9444,u],[0,9445,aX],[0,9446,a5],[0,9447,bA],[0,9448,aw],[0,9449,$],[0,11360,ad],[0,11361,D],[0,11362,ad],[0,11363,aU],[0,11364,af],[0,11365,v],[0,11366,ah],[0,11367,ay],[0,11368,U],[0,11369,aA],[0,11370,aQ],[0,11371,an],[0,11372,$],[0,11373,z],[0,11374,a$],[0,11375,z],[0,11376,z],[0,11377,aX],[0,11378,aV],[0,11379,a5],[0,11380,aX],[0,11381,ay],[0,11382,U],[0,11383,i3],[0,11384,n],[0,11385,r],[0,11386,d],[0,11387,n],[0,11389,aX],[0,11390,_],[0,11391,an],[0,11503,e],[0,11504,e],[0,11505,e],[0,12441,e],[0,12442,e],[0,42607,e],[0,42608,e],[0,42609,e],[0,42610,e],[0,42620,e],[0,42621,e],[0,42736,e],[0,42737,e],[0,42786,"{ALEF}"],[0,42787,"{alef}"],[0,42788,s],[0,42789,d],[0,42790,ay],[0,42791,U],[0,42792,"TZ"],[0,42793,"tz"],[0,42794,nQ],[0,42795,nQ],[0,42796,hd],[0,42797,hd],[0,42798,hd],[0,42799,hd],[0,42800,b0],[0,42801,R],[0,42802,"AA"],[0,42803,o0],[0,42804,nR],[0,42805,"ao"],[0,42806,"AU"],[0,42807,"au"],[0,42808,i9],[0,42809,ra],[0,42810,i9],[0,42811,ra],[0,42812,"AY"],[0,42813,"ay"],[0,42814,ax],[0,42815,aL],[0,42816,aA],[0,42817,aQ],[0,42818,aA],[0,42819,aQ],[0,42820,aA],[0,42821,aQ],[0,42822,ad],[0,42823,D],[0,42824,ad],[0,42825,D],[0,42826,s],[0,42827,d],[0,42828,s],[0,42829,d],[0,42830,"OO"],[0,42831,"oo"],[0,42832,aU],[0,42833,bl],[0,42834,aU],[0,42835,bl],[0,42836,aU],[0,42837,bl],[0,42838,bT],[0,42839,c0],[0,42840,bT],[0,42841,c0],[0,42842,af],[0,42843,r],[0,42844,af],[0,42845,r],[0,42846,bi],[0,42847,aX],[0,42848,"VY"],[0,42849,"vy"],[0,42850,an],[0,42851,$],[0,42852,jl],[0,42853,fm],[0,42854,jl],[0,42855,fm],[0,42856,bi],[0,42857,aX],[0,42858,"ET"],[0,42859,"et"],[0,42860,"IS"],[0,42861,"is"],[0,42862,"CON"],[0,42863,"con"],[0,42864,"us"],[0,42865,"dum"],[0,42866,"lum"],[0,42867,"mum"],[0,42868,"num"],[0,42869,r],[0,42870,r],[0,42871,"tum"],[0,42872,"um"],[0,42873,ai],[0,42874,aa],[0,42875,bh],[0,42876,b0],[0,42877,al],[0,42878,al],[0,42879,V],[0,42880,ad],[0,42881,D],[0,42882,af],[0,42883,r],[0,42884,_],[0,42885,R],[0,42886,aC],[0,42887,ah],[0,42891,gU],[0,42892,gU],[0,42893,ay],[0,42894,D],[0,42895,jI],[0,42896,am],[0,42897,ab],[0,42898,ax],[0,42899,aL],[0,42900,aL],[0,42901,U],[0,42902,aT],[0,42903,aJ],[0,42904,bh],[0,42905,b0],[0,42906,e$],[0,42907,cD],[0,42908,og],[0,42909,cI],[0,42910,"UE"],[0,42911,qF],[0,42912,al],[0,42913,V],[0,42914,aA],[0,42915,aQ],[0,42916,am],[0,42917,ab],[0,42918,af],[0,42919,r],[0,42920,_],[0,42921,R],[0,42922,ay],[0,42923,F],[0,42924,al],[0,42925,ad],[0,42926,W],[0,42927,c0],[0,42928,aA],[0,42929,aC],[0,42930,b5],[0,42931,b4],[0,42932,aT],[0,42933,aJ],[0,42934,s],[0,42935,d],[0,42936,B],[0,42937,u],[0,42938,z],[0,42939,v],[0,42940,W],[0,42941,O],[0,42942,B],[0,42943,u],[0,42944,s],[0,42945,d],[0,42946,aV],[0,42947,a5],[0,42948,ax],[0,42949,_],[0,42950,an],[0,42951,ai],[0,42952,aa],[0,42953,_],[0,42954,R],[0,42960,al],[0,42961,V],[0,42963,fm],[0,42965,a5],[0,42966,_],[0,42967,R],[0,42968,_],[0,42969,R],[0,42994,ax],[0,42995,bh],[0,42996,bT],[0,42997,ay],[0,42998,U],[0,42999,W],[0,43000,U],[0,43001,"{letter}"],[0,43002,aW],[0,43003,bh],[0,43004,aU],[0,43005,a$],[0,43006,W],[0,43007,a$],[0,43232,e],[0,43233,e],[0,43234,e],[0,43235,e],[0,43236,e],[0,43237,e],[0,43238,e],[0,43239,e],[0,43240,e],[0,43241,e],[0,43249,e],[0,43824,v],[0,43825,v],[0,43826,n],[0,43827,n],[0,43828,n],[0,43829,b0],[0,43830,V],[0,43831,D],[0,43832,D],[0,43833,D],[0,43834,aW],[0,43835,ab],[0,43836,fn],[0,43837,d],[0,43838,d],[0,43839,d],[0,43840,cI],[0,43841,cI],[0,43842,cI],[0,43843,d],[0,43844,d],[0,43845,r],[0,43846,r],[0,43847,r],[0,43848,r],[0,43849,r],[0,43850,r],[0,43851,r],[0,43852,r],[0,43853,cH],[0,43854,u],[0,43855,u],[0,43856,nl],[0,43857,nl],[0,43858,u],[0,43859,bA],[0,43860,bA],[0,43861,bA],[0,43862,bA],[0,43863,bA],[0,43864,bA],[0,43865,bA],[0,43866,aw],[0,43868,U],[0,43869,D],[0,43870,D],[0,43871,u],[0,43872,"wa"],[0,43873,n],[0,43874,cI],[0,43875,"uo"],[0,43876,v],[0,43878,b2],[0,43879,bP],[0,43880,r],[0,43881,a5],[0,64256,"ff"],[0,64257,"fi"],[0,64258,"fl"],[0,64259,"ffi"],[0,64260,"ffl"],[0,64261,R],[0,64262,"st"],[0,65056,e],[0,65057,e],[0,65058,e],[0,65059,e],[0,65060,e],[0,65061,e],[0,65062,e],[0,65063,e],[0,65064,e],[0,65065,e],[0,65066,e],[0,65067,e],[0,65068,e],[0,65069,e],[0,65070,e],[0,65071,e],[0,65313,z],[0,65314,aT],[0,65315,ax],[0,65316,ai],[0,65317,F],[0,65318,bh],[0,65319,al],[0,65320,ay],[0,65321,W],[0,65322,b5],[0,65323,aA],[0,65324,ad],[0,65325,a$],[0,65326,am],[0,65327,s],[0,65328,aU],[0,65329,bT],[0,65330,af],[0,65331,_],[0,65332,aC],[0,65333,B],[0,65334,bi],[0,65335,aV],[0,65336,b4],[0,65337,aK],[0,65338,an],[0,65345,v],[0,65346,aJ],[0,65347,aL],[0,65348,aa],[0,65349,n],[0,65350,b0],[0,65351,V],[0,65352,U],[0,65353,O],[0,65354,bn],[0,65355,aQ],[0,65356,D],[0,65357,aW],[0,65358,ab],[0,65359,d],[0,65360,bl],[0,65361,c0],[0,65362,r],[0,65363,R],[0,65364,ah],[0,65365,u],[0,65366,aX],[0,65367,a5],[0,65368,bA],[0,65369,aw],[0,65370,$],[0,66045,e],[0,67456,o0],[0,67457,mN],[0,67458,mN],[0,67459,cD],[0,67460,aJ],[0,67461,aJ],[0,67463,b2],[0,67464,b2],[0,67465,b2],[0,67466,b2],[0,67467,aa],[0,67468,aa],[0,67469,aa],[0,67470,n],[0,67471,n],[0,67472,jH],[0,67473,qe],[0,67474,V],[0,67475,V],[0,67476,V],[0,67477,U],[0,67478,U],[0,67479,U],[0,67480,bn],[0,67481,qf],[0,67482,eb],[0,67483,D],[0,67484,D],[0,67485,D],[0,67486,eb],[0,67487,eb],[0,67488,aw],[0,67489,aw],[0,67490,d],[0,67491,cI],[0,67492,d],[0,67493,c0],[0,67494,r],[0,67495,r],[0,67496,r],[0,67497,r],[0,67498,r],[0,67499,nI],[0,67500,bP],[0,67501,bP],[0,67502,ha],[0,67503,ah],[0,67504,aX],[0,67506,aw],[0,67507,bP],[0,67508,bP],[0,67509,ce],[0,67510,ce],[0,67511,ce],[0,67512,ce],[0,67513,ce],[0,67514,R],[0,69291,e],[0,69292,e],[0,69446,e],[0,69447,e],[0,69448,e],[0,69449,e],[0,69450,e],[0,69451,e],[0,69452,e],[0,69453,e],[0,69454,e],[0,69455,e],[0,69456,e],[0,69506,e],[0,69507,e],[0,69508,e],[0,69509,e],[0,70400,e],[0,70459,e],[0,70502,e],[0,70503,e],[0,70504,e],[0,70505,e],[0,70506,e],[0,70507,e],[0,70508,e],[0,92912,e],[0,92913,e],[0,92914,e],[0,92915,e],[0,92916,e],[0,118528,e],[0,118529,e],[0,118530,e],[0,118531,e],[0,118532,e],[0,118533,e],[0,118534,e],[0,118535,e],[0,118536,e],[0,118537,e],[0,118538,e],[0,118539,e],[0,118540,e],[0,118541,e],[0,118542,e],[0,118543,e],[0,118544,e],[0,118545,e],[0,118546,e],[0,118547,e],[0,118548,e],[0,118549,e],[0,118550,e],[0,118551,e],[0,118552,e],[0,118553,e],[0,118554,e],[0,118555,e],[0,118556,e],[0,118557,e],[0,118558,e],[0,118559,e],[0,118560,e],[0,118561,e],[0,118562,e],[0,118563,e],[0,118564,e],[0,118565,e],[0,118566,e],[0,118567,e],[0,118568,e],[0,118569,e],[0,118570,e],[0,118571,e],[0,118572,e],[0,118573,e],[0,118576,e],[0,118577,e],[0,118578,e],[0,118579,e],[0,118580,e],[0,118581,e],[0,118582,e],[0,118583,e],[0,118584,e],[0,118585,e],[0,118586,e],[0,118587,e],[0,118588,e],[0,118589,e],[0,118590,e],[0,118591,e],[0,118592,e],[0,118593,e],[0,119141,e],[0,119142,e],[0,119143,e],[0,119144,e],[0,119145,e],[0,119149,e],[0,119150,e],[0,119151,e],[0,119152,e],[0,119153,e],[0,119154,e],[0,119163,e],[0,119164,e],[0,119165,e],[0,119166,e],[0,119167,e],[0,119168,e],[0,119169,e],[0,119170,e],[0,119173,e],[0,119174,e],[0,119175,e],[0,119176,e],[0,119177,e],[0,119178,e],[0,119179,e],[0,119210,e],[0,119211,e],[0,119212,e],[0,119213,e],[0,119362,e],[0,119363,e],[0,119364,e],[0,122624,jH],[0,122625,V],[0,122626,V],[0,122627,aQ],[0,122628,D],[0,122629,eb],[0,122630,aw],[0,122631,fn],[0,122632,r],[0,122633,ah],[0,122634,ce],[0,122635,cH],[0,122636,cH],[0,122637,ah],[0,122638,bP],[0,122639,aL],[0,122640,aQ],[0,122641,D],[0,122642,b2],[0,122643,D],[0,122644,fn],[0,122645,r],[0,122646,r],[0,122647,ha],[0,122648,$],[0,122649,b2],[0,122650,O],[0,122651,d],[0,122652,ha],[0,122653,aL],[0,122654,R],[0,122661,aa],[0,122662,D],[0,122663,ab],[0,122664,r],[0,122665,R],[0,122666,ah],[0,125136,e],[0,125137,e],[0,125138,e],[0,125139,e],[0,125140,e],[0,125141,e],[0,125142,e],[0,127248,z],[0,127249,aT],[0,127250,ax],[0,127251,ai],[0,127252,F],[0,127253,bh],[0,127254,al],[0,127255,ay],[0,127256,W],[0,127257,b5],[0,127258,aA],[0,127259,ad],[0,127260,a$],[0,127261,am],[0,127262,s],[0,127263,aU],[0,127264,bT],[0,127265,af],[0,127266,_],[0,127267,aC],[0,127268,B],[0,127269,bi],[0,127270,aV],[0,127271,b4],[0,127272,aK],[0,127273,an],[0,127274,_],[0,127275,ax],[0,127276,af],[0,127280,z],[0,127281,aT],[0,127282,ax],[0,127283,ai],[0,127284,F],[0,127285,bh],[0,127286,al],[0,127287,ay],[0,127288,W],[0,127289,b5],[0,127290,aA],[0,127291,ad],[0,127292,a$],[0,127293,am],[0,127294,s],[0,127295,aU],[0,127296,bT],[0,127297,af],[0,127298,_],[0,127299,aC],[0,127300,B],[0,127301,bi],[0,127302,aV],[0,127303,b4],[0,127304,aK],[0,127305,an],[0,127312,z],[0,127313,aT],[0,127314,ax],[0,127315,ai],[0,127316,F],[0,127317,bh],[0,127318,al],[0,127319,ay],[0,127320,W],[0,127321,b5],[0,127322,aA],[0,127323,ad],[0,127324,a$],[0,127325,am],[0,127326,s],[0,127327,aU],[0,127328,bT],[0,127329,af],[0,127330,_],[0,127331,aC],[0,127332,B],[0,127333,bi],[0,127334,aV],[0,127335,b4],[0,127336,aK],[0,127337,an],[0,127344,z],[0,127345,aT],[0,127346,ax],[0,127347,ai],[0,127348,F],[0,127349,bh],[0,127350,al],[0,127351,ay],[0,127352,W],[0,127353,b5],[0,127354,aA],[0,127355,ad],[0,127356,a$],[0,127357,am],[0,127358,s],[0,127359,aU],[0,127360,bT],[0,127361,af],[0,127362,_],[0,127363,aC],[0,127364,B],[0,127365,bi],[0,127366,aV],[0,127367,b4],[0,127368,aK],[0,127369,an],[0,127370,aU],[0,127397,ai],[0,917569,z],[0,917570,aT],[0,917571,ax],[0,917572,ai],[0,917573,F],[0,917574,bh],[0,917575,al],[0,917576,ay],[0,917577,W],[0,917578,b5],[0,917579,aA],[0,917580,ad],[0,917581,a$],[0,917582,am],[0,917583,s],[0,917584,aU],[0,917585,bT],[0,917586,af],[0,917587,_],[0,917588,aC],[0,917589,B],[0,917590,bi],[0,917591,aV],[0,917592,b4],[0,917593,aK],[0,917594,an],[0,917601,z],[0,917602,aT],[0,917603,ax],[0,917604,ai],[0,917605,F],[0,917606,bh],[0,917607,al],[0,917608,ay],[0,917609,W],[0,917610,b5],[0,917611,aA],[0,917612,ad],[0,917613,a$],[0,917614,am],[0,917615,s],[0,917616,aU],[0,917617,bT],[0,917618,af],[0,917619,_],[0,917620,aC],[0,917621,B],[0,917622,bi],[0,917623,aV],[0,917624,b4],[0,917625,aK],[0,917626,an]]),CS=bS,CR=hp([[0,170,v],[0,186,d],[0,n5,"ss"],[0,8208,cf],[0,8211,cf],[0,8212,cf],[0,8216,gU],[0,8217,gU],[0,8220,c5],[0,8221,c5],[0,8230,"..."],[0,8722,cf]]),CZ="?",C4=[0,e],C2=[1,[0,3854881,"Failed to unmarshal data"]],C0=[0,1],C5=[0,"lib/codec.ml",32,4],C8="Yojson__Common.Json_error",C_="Yojson__Common.End_of_array",C$="Yojson__Common.End_of_object",Da="Yojson__Common.End_of_tuple",Db="Yojson__Common.End_of_input",Dd=[0,"\0\0\xfe\xff\xff\xff","\xff\xff\xff\xff\xff\xff","\x01\0\0\0\0\0","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x02\0","\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0",e,e,e,e,e,e],Ev=[0,ba,1],Ew=[0,ba,0],Ex=bQ,Ey="Invalid token",Ez=bQ,EA="Invalid escape sequence",EB=bQ,EC="Invalid low surrogate for code point beyond U+FFFF",ED="Missing escape sequence representing low surrogate for code point beyond U+FFFF",EE=bQ,EF="Expected ':' or '>' but found",EG=bQ,EH="Expected '>' but found",EI=bQ,EJ="Unterminated comment",EK="Expected string or identifier but found",EL=bQ,EM="Expected ',' or ']' but found",EN=bQ,EO="Expected ',' or ')' but found",EP=bQ,EQ="Expected ',' or '}' but found",ER=bQ,ES="Expected ':' but found",ET=bQ,Fd="Expected string, got ",Fc="Expected object, got ",E2=fj,E4=hg,E5="floatlit",E6=g6,E7="tuple",E3="bool",E9="variant",E_="float",E$="int",Fa=i_,E8="intlit",EY="Blank input data",EV="Junk after end of JSON value:",D3=[0,[2,0,[11," '",[2,0,[2,0,[12,39,0]]]]],"%s '%s%s'"],DY=[0,[11,"File ",[2,0,[11,", line",0]]],"File %s, line"],D2="Line",DZ=[0,[11,"byte ",[4,3,0,0,0]],"byte %i"],D1=[0,[11,"bytes ",[4,3,0,0,[12,45,[4,3,0,0,0]]]],"bytes %i-%i"],D0=[0,[2,0,[12,32,[4,3,0,0,[11,jz,[2,0,[11,":\n",[2,0,0]]]]]]],"%s %i, %s:\n%s"],DX=[0,"lib/read.mll",41,13],DW=e,DU=e,DG="NaN value not allowed in standard JSON",DH=[0,[8,[0,0,3],0,[0,16],0],rc],DJ=[0,[8,[0,0,3],0,[0,17],0],qb],DI=qZ,DE="Infinity value not allowed in standard JSON",DF="-Infinity value not allowed in standard JSON",Dz="NaN",DA=[0,[8,[0,0,3],0,[0,16],0],rc],DC=[0,[8,[0,0,3],0,[0,17],0],qb],DB=qZ,Dx="Infinity",Dy="-Infinity",Dt=ff,Du=fr,Ds=fj,Dm=gW,Dn=g7,Do=gO,Dp="\\f",Dq=gI,Dr=jD,Dl=gT,Dj=[0,[11,"src=",[3,0,[11," start=",[4,3,0,0,[11,iK,[4,3,0,0,[12,10,[10,0]]]]]]]],"src=%S start=%i len=%i\n%!"],Dh="\\u00",D4="Yojson__Safe.Int_overflow",EZ="Yojson__Safe.Util.Type_error",Fj="list_of_yojson: list needed",Fi="int_of_yojson: integer needed",Fh="string_of_yojson: string needed",Fg="bool_of_yojson: true/false needed",Fe="Ppx_yojson_conv_lib__Yojson_conv.Of_yojson_error",Fx=bS,Fz="_of_yojson: list instead of atom for record expected",Fy=[0,[2,0,[11,"_of_yojson: the following record elements were undefined: ",[2,0,0]]],"%s_of_yojson: the following record elements were undefined: %s"],Fv="extra fields",Fu="duplicate fields",Fs=bS,Ft=[0,[2,0,[11,"_of_yojson: ",[2,0,[11,nC,[2,0,0]]]]],"%s_of_yojson: %s: %s"],Fr="_of_yojson: unexpected variant constructor",Fq="_of_yojson: expected a variant type, saw an empty list",Fp="_of_yojson: expected a variant type, saw a nested list",Fo="_of_yojson: this constructor requires arguments",Fm=[0,[2,0,[11,"_of_yojson: sum tag ",[3,0,[11," has incorrect number of arguments",0]]]],"%s_of_yojson: sum tag %S has incorrect number of arguments"],Fk="_of_yojson: this constructor does not take arguments",IR="An error occured while decoding response: ",IM=[0,[11,", Token=",[3,0,0]],", Token=%S"],IP=e,IN=e,IO=[0,[11,'MediaBrowser Client="Ocamix", Device="Firefox", DeviceId="',[2,0,[11,'", Version="0.1"',[2,0,0]]]],'MediaBrowser Client="Ocamix", Device="Firefox", DeviceId="%s", Version="0.1"%s'],IH=iU,II=re,IJ=d_,ID="item_id",IE="locations",IF=bR,IA=[0,"Views",0],IB="Users",Iv=g1,Iw=gN,Ix=e_,Ir=nr,Is=m1,It=iW,Ip=ou,In="include_external_content",Il=[0,e_,0],Ii=g1,Ij=gN,Ik=e_,If=nr,Ig=m1,Ih=iW,H5=nf,H6=pL,H7=jg,H8=qQ,H9=qv,H_=qL,H$=n0,Ia=qV,Ib=i2,Ic=o6,Id=q5,Ie=pX,HY="enable_images",HZ="enable_user_data",H0=jg,H1="sort_by",H2="include_item_types",H3=i2,H4="user_id",HX=o4,HN=o$,HO=oQ,HP=nK,HQ=pc,HR=gK,HS=oo,HT=g5,HU=g8,HV=ea,HW=d_,HI="type_",HJ="image_blur_hashes",HK=g_,HL=bm,HM=bR,HH=[0,"lib/data_source/jellyfin_api.ml",qE,64],GI=[0,h,[0,[0,f,nB],0]],GJ=[0,h,[0,[0,f,q9],0]],GK=[0,h,[0,[0,f,nA],0]],GL=[0,h,[0,[0,f,oc],0]],GM=[0,h,[0,[0,f,pt],0]],GN=[0,h,[0,[0,f,p_],0]],GO=[0,h,[0,[0,f,m6],0]],GP=[0,h,[0,[0,f,pU],0]],GQ=[0,h,[0,[0,f,ow],0]],GR=[0,h,[0,[0,f,pP],0]],GS=[0,h,[0,[0,f,hb],0]],GT=[0,h,[0,[0,f,oY],0]],GU=[0,h,[0,[0,f,om],0]],GV=[0,h,[0,[0,f,m0],0]],GW=[0,h,[0,[0,f,qr],0]],GX=[0,h,[0,[0,f,n3],0]],GY=[0,h,[0,[0,f,pe],0]],GZ=[0,h,[0,[0,f,oL],0]],G0=[0,h,[0,[0,f,pd],0]],G1=[0,h,[0,[0,f,nV],0]],G2=[0,h,[0,[0,f,n_],0]],G3=[0,h,[0,[0,f,qB],0]],G4=[0,h,[0,[0,f,oS],0]],G5=[0,h,[0,[0,f,qW],0]],G6=[0,h,[0,[0,f,ot],0]],G7=[0,h,[0,[0,f,qq],0]],G8=[0,h,[0,[0,f,mP],0]],G9=[0,h,[0,[0,f,px],0]],G_=[0,h,[0,[0,f,qg],0]],G$=[0,h,[0,[0,f,oW],0]],Ha=[0,h,[0,[0,f,mL],0]],Hb=[0,h,[0,[0,f,oe],0]],Hc=[0,h,[0,[0,f,oy],0]],Hd=[0,h,[0,[0,f,gK],0]],He=[0,h,[0,[0,f,g5],0]],Hf=[0,h,[0,[0,f,nw],0]],Hg=[0,h,[0,[0,f,pH],0]],Hh=[0,h,[0,[0,f,oR],0]],Hi=[0,h,[0,[0,f,p9],0]],Hj=[0,h,[0,[0,f,qD],0]],Hk=[0,h,[0,[0,f,nF],0]],Hl=[0,h,[0,[0,f,rd],0]],Hm=[0,h,[0,[0,f,oB],0]],Hn=[0,h,[0,[0,f,pv],0]],Ho=[0,h,[0,[0,f,oC],0]],Hp=[0,h,[0,[0,f,rm],0]],Hq=[0,h,[0,[0,f,qk],0]],Hr=[0,h,[0,[0,f,nO],0]],Hs=[0,h,[0,[0,f,po],0]],Ht=[0,h,[0,[0,f,o5],0]],Hu=[0,h,[0,[0,f,pN],0]],Hv=[0,h,[0,[0,f,ea],0]],Hw=[0,h,[0,[0,f,rb],0]],Hx=[0,h,[0,[0,f,pK],0]],Hy=[0,h,[0,[0,f,oT],0]],Hz=[0,h,[0,[0,f,oE],0]],HA=[0,h,[0,[0,f,pO],0]],HB=[0,h,[0,[0,f,pw],0]],HC=[0,h,[0,[0,f,qY],0]],HD=[0,h,[0,[0,f,rl],0]],HE=[0,h,[0,[0,f,qH],0]],F7=[0,h,[0,[0,f,q6],0]],F8=[0,h,[0,[0,f,qA],0]],F9=[0,h,[0,[0,f,or],0]],F_=[0,h,[0,[0,f,n1],0]],F$=[0,h,[0,[0,f,ni],0]],Ga=[0,h,[0,[0,f,nt],0]],Gb=[0,h,[0,[0,f,of],0]],Gc=[0,h,[0,[0,f,nG],0]],Gd=[0,h,[0,[0,f,pm],0]],Ge=[0,h,[0,[0,f,qI],0]],Gf=[0,h,[0,[0,f,qM],0]],Gg=[0,h,[0,[0,f,oO],0]],Gh=[0,h,[0,[0,f,q7],0]],Gi=[0,h,[0,[0,f,m7],0]],Gj=[0,h,[0,[0,f,na],0]],Gk=[0,h,[0,[0,f,q2],0]],Gl=[0,h,[0,[0,f,pV],0]],Gm=[0,h,[0,[0,f,nH],0]],Gn=[0,h,[0,[0,f,pg],0]],Go=[0,h,[0,[0,f,ob],0]],Gp=[0,h,[0,[0,f,mU],0]],Gq=[0,h,[0,[0,f,qx],0]],Gr=[0,h,[0,[0,f,qu],0]],Gs=[0,h,[0,[0,f,m3],0]],Gt=[0,h,[0,[0,f,p2],0]],Gu=[0,h,[0,[0,f,oZ],0]],Gv=[0,h,[0,[0,f,qX],0]],Gw=[0,h,[0,[0,f,no],0]],Gx=[0,h,[0,[0,f,m9],0]],Gy=[0,h,[0,[0,f,n4],0]],Gz=[0,h,[0,[0,f,o_],0]],GA=[0,h,[0,[0,f,nP],0]],GB=[0,h,[0,[0,f,ox],0]],GC=[0,h,[0,[0,f,nb],0]],GD=[0,h,[0,[0,f,ng],0]],GE=[0,h,[0,[0,f,qd],0]],GF=[0,h,[0,[0,f,nD],0]],F6=q4,F2=g8,F3=d_,FZ=bm,F0=bR,FH=[0,h,[0,[0,f,js],0]],FI=[0,h,[0,[0,f,nn],0]],FJ=[0,h,[0,[0,f,p7],0]],FK=[0,h,[0,[0,f,o1],0]],FL=[0,h,[0,[0,f,oG],0]],FM=[0,h,[0,[0,f,nk],0]],FN=[0,h,[0,[0,f,hb],0]],FO=[0,h,[0,[0,f,nZ],0]],FP=[0,h,[0,[0,f,qj],0]],FQ=[0,h,[0,[0,f,qt],0]],FR=[0,h,[0,[0,f,p5],0]],FS=[0,h,[0,[0,f,ea],0]],FT=[0,h,[0,[0,f,qP],0]],FU=[0,h,[0,[0,f,pf],0]],FV=[0,h,[0,[0,f,o2],0]],FD=[0,h,[0,[0,f,qc],0]],FE=[0,h,[0,[0,f,pA],0]],IX=";",IY="allgenres",Jp=g_,Jq=dx,Jr=cG,Js=jA,Jt=bm,Jj=g_,Jk=dx,Jl=cG,Jm=jA,Jn=bm,Jf=dx,Jg=cG,Jh=bm,Jb=dx,Jc=cG,Jd=bm,I_=gS,I$=bR,I7=gS,I8=bR,I4=bR,I5=bm,I1=bR,I2=bm,IZ=[0,f,iZ],Kd=[0,dz,qU,15],J_=[0,dz,pl,15],JR=[0,dz,141,11],JN=[0,dz,96,13],JM=[0,dz,87,19],JL=[0,dz,81,13],JK=[0,dz,75,19],JI=gQ,JJ=jc,JF=gQ,JG=jc,JB=cG,JC=jF,JD=iT,Jx=cG,Jy=jF,Jz=iT,Jv=e,Ju=mM,JO=iW,JP="virtual_folders",J3="collections",J6=dx,J9="albums",Kc=oD,KP=[0,1,0],KE=[0,6,0],KF=[0,0],KG=[0,33,[0,34,[0,21,0]]],KM=js,KH=[0,1],KI=jj,KJ=[0,"objs",0],KK=p6,KL=e,KN=[0,"lib/db/sync.ml",nv,6],KB=[0,jI,0],KC=qm,KD="Fetching items",KA=[0,1],Kx=[0,34,0],Kw=[0,33,0],Kr=[0,1],Ks=e,Kt="music",Ku=[0,0],Kl=[0,0],Km=[0,2],Kh=[0,6,0],Ki=[0,0],Kj=[0,0],Ko=[0,0,0],KU=qm,KV="Upgrading indexed_db schema from version",KW=[0,"Erasing existing stores",0],KX=[0,bm],KY=[0,0],KZ=[0,"sorts.date_added"],K0=mM,K1=os,K2="item.Name",K3=q8,K4=[0,0],K5=[0,q8],K6="items_by_id",K7=os,K8="item.Type",K9="items_by_view_and_kind",K_="sorts.sort_name",K$="item.CollectionType",La="items_by_type_and_name",Lb=[0,iU],Lc=[0,0],Ld=[0,1],Le=[0,1],Lf=[0,bm],Lg=jj,Lh=[0,1],Li=[0,1],Lj=[0,gS],Lk=p6,Ll=[0,bm],Lm=jj,Ln="Stores created:",LC="An error occured while loading item",LB="Unknown genre",Lw=[0,[2,0,0],oV],Lu=[0,iX,0],Lv="Get all keys ",Lx=[0,iX,0],Ly="Filter took ",Lz=[0,iX,0],LA="Sort took ",Ls=oD,Lt=[0,2];function -aq(a){if(typeof +NZ(){var +c=N.process;if(c&&c.on)c.on("uncaughtException",function(a,b){se(a);c.exit(2)});else if(N.addEventListener)N.addEventListener(hm,function(a){if(a.error)se(a.error)})}NZ();function +g(a,b){return(a.l>=0?a.l:a.l=a.length)==1?a(b):cV(a,[b])}function +j(a,b,c){return(a.l>=0?a.l:a.l=a.length)==2?a(b,c):cV(a,[b,c])}function +bT(a,b,c,d){return(a.l>=0?a.l:a.l=a.length)==3?a(b,c,d):cV(a,[b,c,d])}function +fh(a,b,c,d,e){return(a.l>=0?a.l:a.l=a.length)==4?a(b,c,d,e):cV(a,[b,c,d,e])}function +dA(a,b,c,d,e,f){return(a.l>=0?a.l:a.l=a.length)==5?a(b,c,d,e,f):cV(a,[b,c,d,e,f])}function +MU(a,b,c,d,e,f,g,h){return(a.l>=0?a.l:a.l=a.length)==7?a(b,c,d,e,f,g,h):cV(a,[b,c,d,e,f,g,h])}var +N9=undefined;Ni();var +hL=[L,rZ,-1],ky=[L,pY,-2],ez=[L,j8,-3],fQ=[L,pN,-4],bG=[L,qW,-7],kw=[L,rX,-8],kx=[L,qc,-9],u=[L,qh,-11],kz=[L,qt,-12],hZ=[0,e,0,0,-1],kX=[0,e,1,0,0],MI=[4,0,0,0,[12,45,[4,0,0,0,0]]],h9=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,py,[4,0,0,0,[12,45,[4,0,0,0,[11,og,[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],MJ=[17,[0,a,1,0],[11,n2,[17,0,0]]],MK=[17,[0,a,1,0],[12,40,0]],ML=[11,"('\"'",[17,[0,a,1,0],[11,da,[17,[0,a,1,0],[11,ny,[17,0,0]]]]]],MM=[0,a,1,0],MN=[11,oX,[17,[0,a,1,0],[11,da,[17,[0,a,1,0],[11,ny,[17,0,0]]]]]],MO=[0,a,1,0],MP=[11,da,[17,[0,a,1,0],[11,rV,[17,0,0]]]],MQ=[0,a,1,0],MR=[11,oX,[17,[0,a,1,0],[11,da,[17,[0,a,1,0],[11,rV,[17,0,0]]]]]],MS=[0,a,1,0],MT=[17,[0,a,1,0],[12,40,[15,[12,41,[17,0,0]]]]],mE=[0,af,[0,ci,-991563951]],mF=[0,af,[0,ci,pv]],mS=hE([9,10,11,12,13,32,jX,nC,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,pi,8233,8239,8287,12288]),a$=[0,"\0\0\xec\xff\xed\xff\x03\0\xef\xff\x10\0\xf2\xff\xf3\xff\xf4\xff\xf5\xff\0\0\x1f\0\xf9\xffU\0\x01\0\0\0\0\0\x01\0\0\0\x01\0\x02\0\xff\xff\0\0\0\0\x03\0\xfe\xff\x01\0\x04\0\xfd\xff\x0b\0\xfc\xff\x03\0\x01\0\x03\0\x02\0\x03\0\0\0\xfb\xff\x15\0a\0\n\0\x16\0\x14\0\x10\0\x16\0\f\0\b\0\xfa\xffw\0\x81\0\x8b\0\xa1\0\xab\0\xb5\0\xc1\0\xd1\0\xf0\xff\x0b\0&\0\xfc\xffA\0\xfe\xff\xff\xffn\0\xfc\xff\xa3\0\xfe\xff\xff\xff\xea\0\xf7\xff\xf8\xff0\x01\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xffG\x01~\x01\x95\x01\xf9\xff'\0\xfd\xff\xfe\xff&\0\xbb\x01\xd2\x01\xf8\x01\x0f\x02\xff\xff\xdc\0\xfd\xff\xff\xff\xf5\0'\x02m\x02\x0e\x01X\x02\xa4\x02\xbb\x02\xe1\x02\r\0\xfc\xff\xfd\xff\xfe\xff\xff\xff\x0e\0\xfd\xff\xfe\xff\xff\xff\x1e\0\xfd\xff\xfe\xff\xff\xff\x0f\0\xfd\xff\xfe\xff\xff\xff\x11\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\x13\0\xfc\xff\xfd\xff\xfe\xff\x0f\0\xff\xff\x10\0\xff\xff\b\x01\x05\0\xfd\xff\x17\0\xfe\xff\x14\0\xff\xff.\0\xfd\xff\xfe\xff*\x004\x005\0\xff\xff5\x000\0[\0\\\0\xff\xff\x1b\x01\xfa\xff\xfb\xff\x89\0h\0Y\0X\0j\0\xff\xff\x8f\0\x89\0\xb1\0\xfe\xff\xb7\0\xa8\0\xa6\0\xb7\0\x02\0\xfd\xff\xb1\0\xac\0\xbb\0\x04\0\xfc\xff5\x02\xfb\xff\xfc\xff\xfd\xffg\x01\xff\xff\xf8\x02\xfe\xff\x06\x03\x1e\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff(\x032\x03J\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff=\x03T\x03l\x03\xf9\xff\xfa\xff\xfb\xff\xf4\0x\x03\x8e\x03\xb3\0\xc2\0\x0f\0\xff\xff\xbe\0\xbc\0\xbb\0\xc1\0\xb7\0\xb3\0\xfe\xff\xbf\0\xc9\0\xc8\0\xc4\0\xcb\0\xc1\0\xbd\0\xfd\xff\x9d\x03_\x03\xae\x03\xc4\x03\xce\x03\xd8\x03\xe4\x03\xef\x03<\0\xfd\xff\xfe\xff\xff\xff\f\x04\xfc\xff\xfd\xffW\x04\xff\xff\x91\x04\xfc\xff\xfd\xff\xdd\x04\xff\xff\xe5\0\xfd\xff\xfe\xff\xff\xff\xe7\0\xfd\xff\xfe\xff\xff\xff\x02\0\xff\xff\x12\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\"\x01\xfd\xff\xfe\xff\xff\xff\0\0\xff\xff\x03\0\xfe\xff\xff\xff&\x01\xfc\xff\xfd\xff\xfe\xff\xff\xffx\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\xd0\0\xfd\xff\xfe\xff\xff\xff\xd3\0\xfd\xff\xfe\xff\xff\xff\xbd\0\xff\xff\x8f\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\r\x01\xfd\xff\xfe\xff\xff\xff_\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff2\x01\xfd\xff\xfe\xff\xff\xff\x1a\x01\xfd\xff\xfe\xff\xff\xff\xe9\0\xfd\xff\xfe\xff\xff\xff\xde\0\xfd\xff\xfe\xff\xff\xffO\x05\xed\xff\xee\xff\n\0\xf0\xff,\x01\xf3\xff\xf4\xff\xf5\xff\xf6\xff=\x01\x02\x04\xf9\xff-\x05\xd1\0\xe4\0\xd3\0\xe8\0\xe1\0\xdf\0\xf0\0\xff\xff\xeb\0\xea\0\b\x01\xfe\xff\x04\x01\x17\x01\xfd\xff6\x01\xfc\xff\x1f\x01\x1d\x01 \x01'\x011\x01-\x01\xfb\xff9\x01R\x01P\x01N\x01T\x01J\x01V\x01\xfa\xffn\x05\f\x04{\x05\x9b\x05\xa5\x05\xb1\x05\xbb\x05\xc5\x05\xf1\xff\xc7\x01M\x02\xfd\xff\xff\xff\x9a\x02\xde\x05\xd1\x05\x9b\x02\xef\x055\x06L\x06r\x06\x10\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x98\x06\xfc\xff\xfd\xff\xe3\x06\xff\xffU\x07\xf4\xff\xf5\xff\x0b\0\xf7\xffL\x02\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\x1f\x02\xf3\x053\x07d\x01s\x01h\x01\x85\x01v\x01\x9a\x01\xab\x01\xff\xff\xad\x01\xb0\x01\xbf\x01\xb9\x01\xbb\x01\xfd\x01\xe6\x01\xe6\x01\xea\x01\xf7\x01\xed\x01\xea\x01\t\x02\x13\x02\x13\x02\x0f\x02\x15\x02\x0b\x02\x07\x02\x8e\x06\x98\x06t\x07\xaa\x07\xb4\x07\xbe\x07\xc8\x07\xd2\x07\xf8\xffx\x02\xa7\x02\xfd\xff\xff\xff\xd8\x02R\x07\xdc\x07\xec\x02\xf4\x07:\bQ\bw\bL\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x9d\b\xfc\xff\xfd\xff\xe8\b\xff\xff\x87\x02x\x02\xfd\xffd\x02\xfe\xff\xb6\x02\xff\xff\x0b\x02\xff\xff\xcc\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff.\x02\xff\xff\xb2\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x17\0\xff\xff\xb7\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\xbb\x02\xfd\xff\xfe\xff\xff\xffy\x02\xfd\xff\xfe\xff\xff\xff\xb8\x02\xfc\xff\xfd\xff\xfe\xff\x13\0\xff\xff","\xff\xff\xff\xff\xff\xff\x11\0\xff\xff\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x13\0\x13\0\x13\0\x13\0\x13\0\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\t\0\xff\xff\t\0\xff\xff\xff\xff\x0e\0\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x04\0\x04\0\x04\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\0\0\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\x03\0\x05\0\x05\0\x05\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x03\0\xff\xff\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x10\0\xff\xff\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x12\0\x12\0\x12\0\x12\0\x12\0\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\xff\xff\b\0\xff\xff\b\0\xff\xff\xff\xff\r\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\x06\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff","\x01\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\x009\0<\0\0\0<\0\0\0\0\0A\0\0\0A\0\0\0\0\0F\0\0\0\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0T\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0^\0\0\0\0\0a\0\xff\xff\xff\xffa\0\xff\xff\xff\xff\xff\xff\xff\xffh\0\0\0\0\0\0\0\0\0m\0\0\0\0\0\0\0q\0\0\0\0\0\0\0u\0\0\0\0\0\0\0y\0\0\0\0\0\0\0\0\0\0\0~\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\x8a\0\0\0\x8e\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x9a\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xb2\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xbb\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc2\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc9\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xeb\0\0\0\0\0\0\0\xef\0\0\0\0\0\xff\xff\0\0\xf4\0\0\0\0\0\xff\xff\0\0\xf9\0\0\0\0\0\0\0\xfd\0\0\0\0\0\0\0\xff\xff\0\0\x03\x01\0\0\0\0\0\0\0\0\b\x01\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\x11\x01\0\0\0\0\0\0\0\0\x16\x01\0\0\0\0\0\0\0\0\0\0\x1c\x01\0\0\0\0\0\0 \x01\0\0\0\0\0\0\xff\xff\0\0&\x01\0\0\0\0\0\0\0\0+\x01\0\0\0\0\0\0/\x01\0\0\0\0\0\0\0\x004\x01\0\0\0\0\0\x008\x01\0\0\0\0\0\0<\x01\0\0\0\0\0\0@\x01\0\0\0\0\0\0C\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0y\x01}\x01\0\0\0\0\x80\x01\xff\xff\xff\xff\x80\x01\xff\xff\xff\xff\xff\xff\xff\xff\x87\x01\0\0\0\0\0\0\0\0\x8c\x01\0\0\0\0\xff\xff\0\0\x90\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xc1\x01\xc5\x01\0\0\0\0\xc8\x01\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcf\x01\0\0\0\0\0\0\0\0\xd4\x01\0\0\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xdc\x01\0\0\xff\xff\0\0\xe2\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xe9\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xf0\x01\0\0\0\0\0\0\0\0\xf5\x01\0\0\0\0\0\0\xf9\x01\0\0\0\0\0\0\xfc\x01\0\0\0\0\0\0\xff\xff\0\0","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x03\0\x04\0\0\0\x03\0\x03\0\x86\0\0\0\x03\0\0\0\x86\0E\x01\x92\x01\xff\xff\0\0E\x01\x92\x01\0\0\0\0\0\0\0\0\x7f\0\x8b\0\0\0\x03\0\0\0\f\0\x03\0\xaa\0\x86\0\xaf\0\0\0\x07\0\x0b\x01E\x01\x92\x01\x0e\x01\r\x001\0\x05\0\n\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\x008\0v\0\x06\0\x81\0\x82\x009\0\xed\x01\x89\0\0\x021\0\0\x000\0\x8a\0j\0>\0\x0e\0n\0i\0\0\x001\0\x0f\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1e\x000\0\b\0r\0\xd1\0\xec\0\0\x01\r\x01\x1d\0\x16\0\xff\xff0\x000\0\x11\0\x15\0\x19\0 \0!\0#\0\x17\0\x1b\0\x10\0\x1f\0\x1c\0\"\0\x13\0\x18\0\x12\0\x1a\0\x14\0$\0)\0%\x000\0\t\0*\0+\0,\0-\0.\0/\0=\0U\x000\0&\0'\0'\0'\0'\0'\0'\0'\0'\0'\x001\0C\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0V\0\x8f\0\xff\xff(\0\x90\0\x91\0\x92\x007\0\x94\x007\0\x95\x000\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0\xff\xff0\0\x96\0\x97\0\xa1\0B\0\x9e\x005\0\x9f\x005\0\xa0\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\0\xa5\x003\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa2\0\xa3\0\xa6\0]\0\xff\xff\x02\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xff\xffM\0g\0l\0t\0\x84\0\x86\0\x87\0\x80\0\x8b\0\x86\0\xa4\0]\0\xab\0M\0\xa7\0\xa8\0\xa9\0\xac\0p\0\xad\0\xae\0\xd2\0\xe2\0\xd0\0\xd3\0\xd4\0;\0S\0\x86\0\xd5\0\xd6\0\xd7\0\xd8\0\xda\0\x8d\0\xdb\0]\0\xdc\0\xdd\0{\0\xde\0\xdf\0\xe0\0\x88\0_\0\xe1\0#\x01A\x01\xea\0\x9b\0\x05\x01a\x01\xfa\0\xff\xff\xfe\x009\x01=\x01_\x01M\0,\x01\\\x01X\x01\t\x01\x1d\x01L\0|\0!\x01\x12\x01K\0b\0\x13\x01U\x01V\x01W\x01x\x01Y\x01J\0\xe1\x005\x01y\x01I\0Z\x01H\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0b\0q\x01z\0[\x01@\0\x04\x01]\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0\x9c\0p\x01^\x01`\x01b\x01c\x011\x01O\0O\0O\0O\0O\0O\0d\x01\x9d\0e\x01N\0N\0N\0N\0N\0N\0\xb7\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\x18\x01p\x01\xff\xff\x19\x01f\x01g\x01i\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0j\x01k\x010\x01(\x01l\x01m\x01n\x01P\0P\0P\0P\0P\0P\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0o\x01\x1b\x01\xff\xff\xab\x01\x1f\x01\xaa\x01\x17\x01Q\0Q\0Q\0Q\0Q\0Q\0\\\0\xa8\x01?\x01P\0P\0P\0P\0P\0P\0\xf8\0\xa5\x01\xfc\0\xa2\x01;\x01E\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0\xff\xffQ\0Q\0Q\0Q\0Q\0Q\0W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0X\0X\0X\0X\0'\x01*\x01\xff\xff\xa3\x01\xa4\x01x\0\x02\x01X\0X\0X\0X\0X\0X\0\xa6\x017\x01\x99\0W\0W\0W\0W\0W\0W\0\x07\x01\xa7\x01\xa4\x01\xa9\x01\x10\x01\xa4\x01Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\x003\x01X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0a\0\x89\x01\xa4\x01\xac\x01\xb9\x01\x88\x01\xad\x01Z\0Z\0Z\0Z\0Z\0Z\0a\0\xb3\0\xae\x01Y\0Y\0Y\0Y\0Y\0Y\0.\x01\xaf\x01\xb0\x01\xb4\0\xa4\x01\xb8\x01\xb5\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0|\x01Z\0Z\0Z\0Z\0Z\0Z\0\xc0\x01\xb2\x01\x15\x01\xb3\x01a\0\xc1\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xa4\x01\xd8\x01\xff\xffa\0\xb8\x01\xd8\x01\xd1\x01a\0\xdf\x01a\0\xd0\x01\xe6\x01\0\0a\0\xdb\x01%\x01\xd8\x01\xd9\x01\0\0\xdc\x01\xd8\x01a\0\0\0\0\0\xd8\x01a\0\0\0a\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xd8\x01\0\0~\x01\0\0\0\0\0\0\0\0c\0c\0c\0c\0c\0c\0a\0\0\0\xda\x01\xfa\x01\0\0\0\0a\0\0\0|\x01|\x01a\0\0\0\xdd\x01\0\0\xfd\x01\0\0\0\0\0\0a\0\xff\xff\0\0\xc4\x01a\0\0\0a\0`\0c\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xeb\x01\0\0\xf1\x01\0\0\xff\x01\xf2\x01\0\0d\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xf6\x01\x81\x01\x81\x01\xe4\x01\0\0\xc4\x01\0\0e\0e\0e\0e\0e\0e\0\0\0\xc6\x01\0\0d\0d\0d\0d\0d\0d\0\0\0\0\0\0\0\xc4\x01\xea\x01\x86\x01a\0a\0a\0a\0a\0a\0a\0a\0a\0a\0\0\0e\0e\0e\0e\0e\0e\0a\0a\0a\0a\0a\0a\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\0\0\0\0\xc9\x01\xb1\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xbc\0\0\0a\0a\0a\0a\0a\0a\0\xc9\x01\xe3\x01\0\0\xbf\0\xce\x01{\x01\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xc3\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc6\0\xff\xff\xf8\x01\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xca\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xcd\0\xff\xff\xff\xff\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe2\0\xc3\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\x01\0\0\0\0\xce\0\xdd\x01\xef\x01\xfe\x01\0\0\xcf\0\xf4\x01\0\0\xe1\0\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\0\0\0\xe8\0\0\0\xe1\x01\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xd9\0\xff\xff\0\0\0\0\0\0\0\0\xe1\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\0\0\0\0\0\0\0\0\xff\xff\0\0\0\0\xe6\0\0\0\xe6\0\0\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\0\0\xe4\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xba\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\0\0\0\0\0\0\0\0\0\0\xf1\0\0\0q\x01\0\0M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01\0\0p\x01\0\0\0\0\xc1\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0p\x01\0\0\0\0\0\0\xf0\0\xc8\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\xf6\0\0\0\0\0\xf0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xee\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0E\x01F\x01\0\0\0\0E\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0E\x01\0\0N\x01\0\0\0\0\0\0\0\0h\x01I\x01\0\0\0\0\0\0\0\0O\x01\0\0G\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0H\x01\0\0\0\0\0\0\0\0\0\0\xf3\0\0\0\0\0\0\0\0\0\0\0\0\0P\x01w\x01\0\0w\x01\0\0Q\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\0\0J\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01S\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0R\x01\0\0\0\0s\x01\0\0\0\0T\x01\0\0\0\0u\x01\0\0u\x01\0\0K\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\0\0s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\xb9\x01\0\0\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xb8\x01\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\0\0\0\0D\x01\x80\x01\x80\x01\x80\x01\x7f\x01\0\0\x80\x01\0\0\0\0\xb8\x01\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\x80\x01\x7f\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\xbf\x01\x8e\x01\xbf\x01\0\0\0\0\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x92\x01\x93\x01\0\0\0\0\x92\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\x92\x01\0\0\x99\x01\0\0\0\0\0\0\0\0\xb1\x01\x96\x01\0\0\0\0\0\0\xc8\x01\x9c\x01\0\0\x94\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\x95\x01\0\0\0\0\0\0\0\0\0\0\0\0\x8b\x01\0\0\0\0\0\0\0\0\0\0\x9d\x01\0\0\0\0\0\0\0\0\x9e\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc8\x01\0\0\x97\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\xbb\x01\0\0\xa0\x01\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\x9f\x01\xc8\x01\0\0\xc8\x01\xc7\x01\0\0\xa1\x01\0\0\0\0\0\0\0\0\0\0\0\0\x98\x01\0\0\0\0\0\0\0\0\xbd\x01\0\0\xbd\x01\0\0\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\x91\x01\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\xc8\x01\xc7\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xd6\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd3\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0","\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\xff\xff\x03\0\0\0\x86\0\xff\xff\x03\0\xff\xff\x86\0E\x01\x92\x019\0\xff\xffE\x01\x92\x01\xff\xff\xff\xff\xff\xff\xff\xff}\0\x8a\0\xff\xff\0\0\xff\xff\0\0\x03\0\xa9\0\x86\0\xae\0\xff\xff\0\0\n\x01E\x01\x92\x01\f\x01\0\0\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x05\0s\0\0\0}\0\x81\0\x05\0\xec\x01\x88\0\xff\x01&\0\xff\xff\n\0\x88\0f\0:\0\0\0k\0f\0\xff\xff\x0b\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1d\0&\0\0\0o\0\xd0\0\xe9\0\xff\0\f\x01\x0f\0\x11\0<\0\x0b\0\n\0\0\0\x14\0\x18\0\x1f\0 \0\"\0\x16\0\x1a\0\0\0\x0e\0\x1b\0!\0\x12\0\x17\0\0\0\x10\0\x13\0#\0(\0$\0&\0\0\0)\0*\0+\0,\0-\0.\0:\0R\0\x0b\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0'\0?\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0U\0\x8c\0<\0\r\0\x8f\0\x90\0\x91\x000\0\x93\x000\0\x94\0'\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x001\x001\x001\x001\x001\x001\x001\x001\x001\x001\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0A\0'\0\x95\0\x96\0\x9c\0?\0\x9d\x003\0\x9e\x003\0\x9f\x002\x003\x003\x003\x003\x003\x003\x003\x003\x003\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x005\x005\x005\x005\x005\x005\x005\x005\x005\x005\0\x9b\x002\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa1\0\xa2\0\x9b\0[\0A\0\0\x007\x007\x007\x007\x007\x007\x007\x007\x007\x007\x009\0D\0f\0k\0s\0\x83\0\x85\0\x85\0}\0\x8a\0\x85\0\xa3\0^\0\xa5\0D\0\xa6\0\xa7\0\xa8\0\xab\0o\0\xac\0\xad\0\xce\0\xcb\0\xcf\0\xd2\0\xd3\0:\0R\0\x85\0\xd4\0\xd5\0\xd6\0\xd7\0\xd9\0\x8c\0\xda\0a\0\xdb\0\xdc\0w\0\xdd\0\xde\0\xdf\0\x85\0[\0\xcb\0\"\x01>\x01\xe9\0\x98\0\x01\x01P\x01\xf7\0<\0\xfb\x006\x01:\x01Q\x01D\0)\x01R\x01S\x01\x06\x01\x1a\x01D\0w\0\x1e\x01\x0f\x01D\0^\0\x0f\x01T\x01U\x01V\x01G\x01X\x01D\0\xcb\x002\x01G\x01D\0Y\x01D\0D\0G\0G\0G\0G\0G\0G\0G\0G\0G\0G\0a\0L\x01w\0Z\x01?\0\x01\x01\\\x01G\0G\0G\0G\0G\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0\x98\0L\x01]\x01_\x01a\x01b\x01-\x01N\0N\0N\0N\0N\0N\0c\x01\x98\0d\x01G\0G\0G\0G\0G\0G\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\x14\x01L\x01A\0\x14\x01e\x01f\x01h\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0i\x01j\x01-\x01$\x01k\x01l\x01m\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0n\x01\x1a\x01y\x01\x9d\x01\x1e\x01\x9e\x01\x14\x01P\0P\0P\0P\0P\0P\0[\0\x9f\x01>\x01O\0O\0O\0O\0O\0O\0\xf7\0\xa0\x01\xfb\0\xa1\x01:\x01D\0V\0V\0V\0V\0V\0V\0V\0V\0V\0V\0^\0P\0P\0P\0P\0P\0P\0V\0V\0V\0V\0V\0V\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0$\x01)\x01a\0\xa2\x01\xa3\x01w\0\x01\x01W\0W\0W\0W\0W\0W\0\xa5\x016\x01\x98\0V\0V\0V\0V\0V\0V\0\x06\x01\xa6\x01\xa7\x01\xa8\x01\x0f\x01\xa9\x01X\0X\0X\0X\0X\0X\0X\0X\0X\0X\x002\x01W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0_\0\x85\x01\xaa\x01\xab\x01\x9a\x01\x85\x01\xac\x01Y\0Y\0Y\0Y\0Y\0Y\0_\0\xb0\0\xad\x01X\0X\0X\0X\0X\0X\0-\x01\xae\x01\xaf\x01\xb0\0\xb0\x01\x9a\x01\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0z\x01Y\0Y\0Y\0Y\0Y\0Y\0\x94\x01\xb1\x01\x14\x01\xb2\x01b\0\x94\x01\xb3\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xd8\x01\xc1\x01_\0\x9a\x01\xd8\x01\xcd\x01b\0\xde\x01_\0\xcd\x01\xe5\x01\xff\xff_\0\xda\x01$\x01\xd7\x01\xd7\x01\xff\xff\xda\x01\xd7\x01_\0\xff\xff\xff\xff\xd8\x01_\0\xff\xff_\0_\0`\0`\0`\0`\0`\0`\0`\0`\0`\0`\0\xd7\x01\xff\xffz\x01\xff\xff\xff\xff\xff\xff\xff\xff`\0`\0`\0`\0`\0`\0b\0\xff\xff\xd7\x01\xf7\x01\xff\xff\xff\xffb\0\xff\xff}\x01\x80\x01b\0\xff\xff\xdc\x01\xff\xff\xfb\x01\xff\xff\xff\xff\xff\xffb\0y\x01\xff\xff\xc2\x01b\0\xff\xffb\0b\0`\0`\0`\0`\0`\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xe7\x01\xff\xff\xee\x01\xff\xff\xfb\x01\xee\x01\xff\xffc\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xf3\x01}\x01\x80\x01\xe0\x01\xff\xff\xc5\x01\xff\xffd\0d\0d\0d\0d\0d\0\xff\xff\xc2\x01\xff\xffc\0c\0c\0c\0c\0c\0\xff\xff\xff\xff\xff\xff\xc8\x01\xe7\x01\x85\x01e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xff\xffd\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xff\xff\xff\xff\xc5\x01\xb0\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb9\0\xff\xffe\0e\0e\0e\0e\0e\0\xc8\x01\xe0\x01\xff\xff\xb9\0\xcd\x01z\x01\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xc0\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc0\0\xc1\x01\xf7\x01\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc7\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xc7\0}\x01\x80\x01\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xcc\0\xc2\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe7\x01\xff\xff\xff\xff\xc7\0\xdc\x01\xee\x01\xfb\x01\xff\xff\xc7\0\xf3\x01\xff\xff\xcc\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xe1\0\xff\xff\xe1\0\xff\xff\xe0\x01\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xcd\0\xc5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcc\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xff\xff\xff\xff\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xe4\0\xff\xff\xe4\0\xff\xff\xe3\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xff\xff\xe3\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xb9\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xed\0\xff\xffM\x01\xff\xffM\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01\xff\xffM\x01\xff\xff\xff\xff\xc0\0\xff\xff\xff\xff\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0M\x01\xff\xff\xff\xff\xff\xff\xed\0\xc7\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xf2\0\xff\xff\xff\xff\xf0\0\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xed\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0B\x01B\x01\xff\xff\xff\xffB\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xffO\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01p\x01\xff\xffp\x01\xff\xffB\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01\xff\xff\xff\xffB\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xff\xff\xffr\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xffs\x01\xff\xffs\x01\xff\xffB\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\xff\xffr\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01\xff\xff~\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\x81\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x9b\x01\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01~\x01\xff\xff\xff\xffB\x01~\x01\x81\x01~\x01~\x01\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\x81\x01\x81\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xb8\x01\x8a\x01\xb8\x01\xff\xff\xff\xff\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x9c\x01\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xba\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\x8f\x01\xc6\x01\xff\xff\xc6\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xbb\x01\xff\xff\xbb\x01\xff\xff\xba\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xc9\x01\xc9\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",e,e,e,e,e,e],fb="lib/data_source/jellyfin_api.ml.Types.order",a3="lib/data_source/jellyfin_api.ml.Types.sort",gz="lib/data_source/jellyfin_api.ml.Item.genre_item",i1="lib/data_source/jellyfin_api.ml.Item.image_blur_hashes",E="lib/data_source/jellyfin_api.ml.Item.type_",l="lib/data_source/jellyfin_api.ml.Item.field",gA="lib/data_source/jellyfin_api.ml.Item.t",gB="lib/data_source/jellyfin_api.ml.Items.params",gE="lib/data_source/jellyfin_api.ml.Items.response",gJ="lib/data_source/jellyfin_api.ml.Views.params",gK="lib/data_source/jellyfin_api.ml.Views.response",gL="lib/data_source/jellyfin_api.ml.Virtual_folders.virtual_folder",fd="lib/db/generic_schema.ml.Id.t",gM="lib/db/generic_schema.ml.Collection.t",gN="lib/db/generic_schema.ml.Genre.t",gO="lib/db/generic_schema.ml.Album.t",gP="lib/db/generic_schema.ml.Track.t",gQ="lib/db/stores.ml.Items.sorts",gR="lib/db/stores.ml.Items.t",ne=[0,17,[0,16,[0,1,[0,18,[0,11,0]]]]];ca(11,kz,qt);ca(10,u,qh);ca(9,[L,qi,nX],qi);ca(8,kx,qc);ca(7,kw,rX);ca(6,bG,qW);ca(5,[L,oW,-6],oW);ca(4,[L,p5,-5],p5);ca(3,fQ,pN);ca(2,ez,j8);ca(1,ky,pY);ca(0,hL,rZ);var +s1=nS,sZ="output_substring",sW=db,sT=fp,sU=fB,sJ="Stdlib.Exit",sM=bk(0,0,32752),sO=bk(0,0,65520),sQ=bk(1,0,32760),s8=g7,s9="\\'",s_=g_,s$=hi,ta=g2,tb=gW,s6="Char.chr",tg=" is not an Unicode scalar value",ts="List.init",to="hd",tY=[0,oG,ot,20],tX=[0,oG,p6,9],tI="String.blit / Bytes.blit_string",tH="Bytes.blit",tG="String.sub / Bytes.sub",t_="String.contains_from / Bytes.contains_from",t8="String.index_from / Bytes.index_from",t3=e,t0="String.concat",up=[0,"array.ml",rz,4],uk="Array.map2: arrays must have the same length",uh="Array.blit",uf="Array.fill",ud="Array.init",un="Stdlib.Array.Bottom",uz=[0,"set.ml",o0,18],uv=gZ,uw=gZ,ux=gZ,uy=gZ,uF="Map.remove_min_elt",uG=[0,0,0,0],uH=[0,"map.ml",oo,10],uB=hk,uC=hk,uD=hk,uE=hk,uJ="Stdlib.Queue.Empty",uR="Buffer.add_substring/add_subbytes",uQ="Buffer.add: cannot grow buffer",uO="Buffer.sub",uZ="first domain already spawned",uW=[0,"domain.ml",184,13],u_=p3,u$=pw,va=qZ,vb=pJ,vc=r3,vd=qV,ve="%f",vf="%B",vg="%{",vh="%}",vi="%(",vj="%)",vk=r2,vl="%t",vm="%?",vn="%r",vo="%_r",vp=[0,aP,nA,23],vA=[0,aP,rl,21],vs=[0,aP,om,21],vB=[0,aP,nT,21],vt=[0,aP,p4,21],vC=[0,aP,ql,19],vu=[0,aP,p7,19],vD=[0,aP,oA,22],vv=[0,aP,nZ,22],vE=[0,aP,pI,30],vw=[0,aP,od,30],vy=[0,aP,q3,26],vq=[0,aP,oB,26],vz=[0,aP,qK,28],vr=[0,aP,nB,28],vx=[0,aP,qv,23],wQ=[0,aP,1558,4],wR="Printf: bad conversion %[",wS=[0,aP,1626,39],wT=[0,aP,1649,31],wU=[0,aP,1650,31],wV="Printf: bad conversion %_",wW=pU,wX=n_,wY=pU,wZ=n_,w2=[0,[11,"invalid box description ",[3,0,0]],"invalid box description %S"],w1=[0,0,4],wL=ja,wJ="neg_infinity",wK=p1,wI=db,wD=[0,gU],wr="%+nd",ws="% nd",wu="%+ni",wv="% ni",ww="%nx",wx="%#nx",wy="%nX",wz="%#nX",wA="%no",wB="%#no",wq="%nd",wt=r3,wC="%nu",wd="%+ld",we="% ld",wg="%+li",wh="% li",wi="%lx",wj="%#lx",wk="%lX",wl="%#lX",wm="%lo",wn="%#lo",wc="%ld",wf=pJ,wo="%lu",v1="%+Ld",v2="% Ld",v4="%+Li",v5="% Li",v6="%Lx",v7="%#Lx",v8="%LX",v9="%#LX",v_="%Lo",v$="%#Lo",v0="%Ld",v3=qV,wa="%Lu",vN="%+d",vO="% d",vQ="%+i",vR="% i",vS="%x",vT="%#x",vU=rD,vV="%#X",vW="%o",vX="%#o",vM=i$,vP=qZ,vY=nP,u2="@]",u3="@}",u4="@?",u5="@\n",u6="@.",u7="@@",u8="@%",u9="@",vF="CamlinternalFormat.Type_mismatch",w7=e,w8=[0,[11,jY,[2,0,[2,0,0]]],", %s%s"],xI=[0,[11,jR,[2,0,[12,10,0]]],nU],xJ=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],"Fatal error in uncaught exception handler: exception %s\n"],xH="Fatal error: out of memory in uncaught exception handler",xE=[0,[11,jR,[2,0,[12,10,0]]],nU],xy=[0,[2,0,[12,10,0]],"%s\n"],xz=[0,[11,nH,0],nH],xn="Raised at",xo="Re-raised at",xp="Raised by primitive operation at",xq="Called from",xr=[0,[12,32,[4,0,0,0,0]]," %d"],xv=[0,[11,"s ",[4,0,0,0,[12,45,[4,0,0,0,0]]]],"s %d-%d"],xs=" (inlined)",xu=e,xt=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,np,[2,0,[11,py,MI]]]]]]]]]],'%s %s in file "%s"%s, line%s, characters %d-%d'],xw=[0,[2,0,[11," unknown location",0]],"%s unknown location"],xg="Out of memory",xh="Stack overflow",xi="Pattern matching failed",xj="Assertion failed",xk="Undefined recursive module",w_=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],w$=e,xa=e,xb=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],w6=[0,[4,0,0,0,0],i$],w4=[0,[3,0,0],"%S"],w5=pm,xB=[0,e,"(Cannot print locations:\n bytecode executable program file not found)","(Cannot print locations:\n bytecode executable program file appears to be corrupt)","(Cannot print locations:\n bytecode executable program file has wrong magic number)","(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)"],xN="Fun.Finally_raised: ",xL="Stdlib.Fun.Finally_raised",xO="Digest.BLAKE2: wrong hash size",x1=bk(14371852,15349651,22696),x2=bk(12230193,11438743,35013),x3=bk(1424933,15549263,2083),x4=bk(9492471,4696708,43520),xS=bk(1,0,0),xT=bk(0,0,0),xW=bk(1,0,0),xU=bk(0,0,0),xV=bk(2,0,0),yf="Hashtbl: unsupported hash table format",x9=e,yV=[3,0,3],yW=db,yQ=qk,yR="<\/",yS=e,yM=qk,yN="<",yO=e,yK="\n",yG=e,yH=e,yI=e,yJ=e,yy=[0,e],yt=e,yu=e,yv=e,yw=e,yp=[0,e,0,e],yl="Stdlib.Format.String_tag",y4="Jsoo_runtime.Error.Exn",y5=jf,zl=[0,"src/fut.ml",34,25],zD="info",zC=hm,zB="log",zA="search",zu=[0,1],zs=rW,zE="isSecureContext",zJ="cache",zK="credentials",zL="headers",zM="integrity",zN="keepalive",zO="method",zP="mode",zQ="redirect",zR="referrer",zS="referrerPolicy",Ap="open",Al="unique",Af="autoIncrement",Ag="keyPath",Ah="new object store with options:",Ab="readonly",Ac="readwrite",Ad="readwriteflush",z7="next",z8="nextUnique",z9="prev",z_="prevUnique",Av=[0,[11,"\x1b[",[4,0,0,0,[12,109,0]]],"\x1b[%dm"],AE="CCResult.Get_error",AR=[0,rY,119,10],AO=[0,rY,92,10],AK=e,A8=[0,[17,[0,pq,1,0],0],pq],A7=[0,[12,32,0],bZ],A6=[0,[11,oC,0],oC],A9=[0,[15,[4,6,0,[0,2],[15,0]]],"%a%.2x%a"],A1=[0,[11,qO,[15,[11,qo,[15,[11," dst-off=",[4,0,0,0,[11,i9,[4,0,0,0,0]]]]]]]],"Cstruct.blit_from_string src=%a dst=%a dst-off=%d len=%d"],AZ=[0,[11,qO,[15,[11,qo,[15,[11," src-off=",[4,0,0,0,[11,i9,[4,0,0,0,0]]]]]]]],"Cstruct.blit_from_string src=%a dst=%a src-off=%d len=%d"],AX=[0,[12,91,[4,0,0,0,[12,93,0]]],"[%d]"],AW=[0,[12,91,[4,0,0,0,[12,44,[4,0,0,0,[11,"](",[4,0,0,0,[12,41,0]]]]]]],"[%d,%d](%d)"],A_=[0,[17,3,[15,[17,4,0]]],"@\n%a@."],A$=e,BH=[0,[8,[0,0,0],0,[0,0],0],nq],Bq=[0,[12,44,0],jH],Bx=[0,[15,[12,58,[15,0]]],"%a:%a"],Bw=[0,[12,44,0],jH],Bp=[0,[11,ft,0],ft],Bs=[0,[11,fp,0],fp],Bt=[0,[11,fB,0],fB],Bu=[0,[8,[0,0,0],0,[0,0],0],nq],Bv=[0,[8,[0,0,3],0,0,0],"%g"],By=[0,[12,ei,[15,[12,em,0]]],"{%a}"],Br=[0,[12,91,[15,[12,93,0]]],"[%a]"],Bz=[0,[12,44,[17,[0,a,1,0],0]],nK],BD=[0,[18,[1,[0,[11,ea,0],ea]],[15,[12,58,[17,[0,a,1,0],[15,[17,0,0]]]]]],"@[%a:@ %a@]"],BC=[0,[12,44,[17,[0,a,1,0],0]],nK],BE=[0,[18,[1,[0,[11,ea,0],ea]],[11,"{ ",[15,[11," }",[17,0,0]]]]],"@[{ %a }@]"],BF=[0,[11,rb,0],rb],BA=[0,[18,[1,[0,[11,ea,0],ea]],[11,"[ ",[15,[11," ]",[17,0,0]]]]],"@[[ %a ]@]"],BB=[0,[11,rO,0],rO],Be=[0,[12,34,0],dc],Bi=[0,[0,0],p3],Bh=[0,[11,g7,0],g7],Bk=[0,[11,g_,0],g_],Bl=[0,[11,hi,0],hi],Bm=[0,[11,g2,0],g2],Bn=[0,[11,gW,0],gW],Bg=[0,[11,j2,0],j2],Bj=[0,[11,"\\u",[4,6,[0,2,4],0,0]],"\\u%04x"],Bf=[0,[12,34,0],dc],B5=[0,fu,ox,9],BY=[0,ep,jO],BT=[0,fv,jO],BZ=[0,c$,jO],BX=[0,c$,fn],BU=[0,fv,fn],BV=[0,fu,153,55],BW=[0,c$,fn],B0=[0,fu,152,55],B1=[0,fu,154,55],B2=[0,c$,cv],BR=[0,fu,jS,9],BJ=[0,[11,"invalid bounds (index ",[4,0,0,0,[11,", length ",[4,0,0,0,[12,41,0]]]]],"invalid bounds (index %d, length %d)"],BQ=[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0],Di=[0,bU,[0,bc,1]],Dj=[0,bU,cL],Dk=[0,bU,[0,bc,0]],Dm=[0,bU,fo],Dl=[0,bU,dC],Dx=[0,jL,pO,27],Dr=[0,bU,oK],Do=[0,bU,rG],Dg=[0,jL,rp,8],Df=[0,jL,qs,45],CN=[0,[18,[1,[0,0,e]],[11,ee,[17,[0,a,1,0],[11,"initial",[17,[0,a,1,0],[11,"BOM",[17,[0,a,1,0],[11,jz,[17,[0,a,1,0],[11,gV,MJ]]]]]]]]]],"@[illegal@ initial@ BOM@ in@ character@ stream@]"],CO=[0,[18,[1,[0,0,e]],[11,ee,[17,[0,a,1,0],[11,"escape,",[17,[0,a,1,0],0]]]]],"@[illegal@ escape,@ "],CQ=[0,[15,[17,[0,a,1,0],[11,jk,[17,[0,a,1,0],[11,"an",[17,[0,a,1,0],[11,"escaped",[17,[0,a,1,0],[11,gV,[17,0,0]]]]]]]]]],"%a@ not@ an@ escaped@ character@]"],CR=[0,[15,[17,[0,a,1,0],[11,n5,[17,[0,a,1,0],[11,qN,[17,[0,a,1,0],[11,jC,[17,0,0]]]]]]]],"%a@ lone@ low@ surrogate@]"],CS=[0,[15,[17,[0,a,1,0],[11,n5,[17,[0,a,1,0],[11,"high",[17,[0,a,1,0],[11,jC,[17,0,0]]]]]]]],"%a@ lone@ high@ surrogate@]"],CT=[0,[15,[17,[0,a,1,0],[11,jk,[17,[0,a,1,0],[12,97,[17,[0,a,1,0],[11,"hex",[17,[0,a,1,0],[11,"digit",[17,0,0]]]]]]]]]],"%a@ not@ a@ hex@ digit@]"],CP=[0,[15,[17,[0,a,1,0],[11,jk,[17,[0,a,1,0],[12,97,[17,[0,a,1,0],[11,qN,[17,[0,a,1,0],[11,jC,[17,0,0]]]]]]]]]],"%a@ not@ a@ low@ surrogate@]"],CU=[0,[18,[1,[0,0,e]],[11,ee,[17,[0,a,1,0],[11,"bytes",[17,[0,a,1,0],[11,jz,[17,[0,a,1,0],[11,gV,[17,[0,a,1,0],[11,n2,MK]]]]]]]]]],"@[illegal@ bytes@ in@ character@ stream@ ("],CV=[0,[4,8,[0,2,2],0,0],"%02X"],CX=[0,[12,32,[4,8,[0,2,2],0,0]]," %02X"],CW=[0,[12,41,[17,0,0]],")@]"],CY=[0,[18,[1,[0,0,e]],[11,"expected",[17,[0,a,1,0],0]]],"@[expected@ "],CZ=[0,[11,qC,[17,[0,a,1,0],[11,bY,[17,0,0]]]],"member@ name@]"],C0=[0,[11,hp,[17,[0,a,1,0],[11,"text (JSON value)",[17,0,0]]]],"JSON@ text (JSON value)@]"],C1=[0,[11,bY,[17,[0,a,1,0],[11,jq,[17,[0,a,1,0],[11,"(':')",[17,0,0]]]]]],"name@ separator@ (':')@]"],C2=[0,[11,fm,[17,[0,a,1,0],[11,"of",[17,[0,a,1,0],[11,nS,[17,0,0]]]]]],"end@ of@ input@]"],C3=[0,[11,"JavaScript",[17,[0,a,1,0],[11,o5,[17,0,0]]]],"JavaScript@ comment@]"],C4=[0,[11,hp,[17,[0,a,1,0],[11,d$,[17,0,0]]]],"JSON@ value@]"],C5=[0,[11,qC,[17,[0,a,1,0],[11,bY,[17,[0,a,1,0],[11,da,[17,[0,a,1,0],[11,ht,[17,[0,a,1,0],[11,fm,[17,MM,ML]]]]]]]]]],"member@ name@ or@ object@ end@ ('\"'@ or@ '}')@]"],C6=[0,[11,d$,[17,[0,a,1,0],[11,jq,[17,[0,a,1,0],[11,da,[17,[0,a,1,0],[11,ht,[17,[0,a,1,0],[11,fm,[17,MO,MN]]]]]]]]]],"value@ separator@ or@ object@ end@ (','@ or@ '}')@]"],C7=[0,[11,d$,[17,[0,a,1,0],[11,da,[17,[0,a,1,0],[11,hh,[17,[0,a,1,0],[11,fm,[17,[0,a,1,0],[11,"(value",[17,MQ,MP]]]]]]]]]],"value@ or@ array@ end@ (value@ or@ ']')@]"],C8=[0,[11,d$,[17,[0,a,1,0],[11,jq,[17,[0,a,1,0],[11,da,[17,[0,a,1,0],[11,hh,[17,[0,a,1,0],[11,fm,[17,MS,MR]]]]]]]]]],"value@ separator@ or@ array@ end@ (','@ or@ ']')@]"],C9=[0,[18,[1,[0,0,e]],[11,ee,[17,[0,a,1,0],[11,"number",[17,[0,a,1,0],[12,40,[2,0,[12,41,[17,0,0]]]]]]]]],"@[illegal@ number@ (%s)@]"],Dd=[0,[18,[1,[0,0,e]],[11,ee,[17,[0,a,1,0],[11,"literal",[17,[0,a,1,0],[12,40,[2,0,[12,41,[17,0,0]]]]]]]]],"@[illegal@ literal@ (%s)@]"],De=[0,[18,[1,[0,0,e]],[11,ee,[17,[0,a,1,0],[11,gV,[17,[0,a,1,0],[11,jz,[17,[0,a,1,0],[11,hp,[17,[0,a,1,0],[11,jw,MT]]]]]]]]]],"@[illegal@ character@ in@ JSON@ string@ (%a)@]"],C_=[0,[18,[1,[0,0,e]],[11,"unclosed",[17,[0,a,1,0],0]]],"@[unclosed@ "],C$=[0,[11,ht,[17,0,0]],"object@]"],Da=[0,[11,hh,[17,0,0]],"array@]"],Db=[0,[11,o5,[17,0,0]],"comment@]"],Dc=[0,[11,jw,[17,0,0]],"string@]"],CL=[0,[12,39,[2,0,[11,"' (",[15,[12,41,0]]]]],"'%s' (%a)"],CK=[0,[11,"U+",[4,8,[0,2,4],0,0]],"U+%04X"],Cp=[0,af,-543455433],Cw=[0,af,[0,fi,ed]],Cx=[0,af,[0,fi,f]],Cy=[0,af,[0,fi,fo]],Cz=[0,af,[0,fi,dC]],CC=[0,af,[0,ci,ed]],CD=[0,af,[0,ci,g9]],CE=[0,af,[0,ci,ru]],CF=[0,af,[0,ci,[0,rt,1]]],CG=[0,af,[0,ci,[0,rt,0]]],CH=[0,af,[0,ci,[0,je,1]]],CI=[0,af,[0,ci,[0,je,0]]],CJ=[0,af,[0,ci,oc]],DR="not a valid JSON array/object",DO=[0,[11,"JSON.of_buffer ",[2,0,0]],"JSON.of_buffer %s"],DJ=[0,[11,bX,0],bX],DK=[0,[11,"Unexpected input when parsing a ",[2,0,0]],"Unexpected input when parsing a %s"],DL=[0,[15,0],r2],DI="We expected a well-formed JSON document (array or object)",DD=d$,DE="object fields",DB=[0,"lib/ezjsonm.ml",61,19],DC=[0,g5,357123046],DA="Abort",DF="Ezjsonm.Parse_error",DT=hE([[0,hs,z],[0,193,z],[0,pE,z],[0,195,z],[0,196,z],[0,rg,z],[0,198,fk],[0,199,ay],[0,200,F],[0,201,F],[0,202,F],[0,203,F],[0,qs,W],[0,205,W],[0,206,W],[0,207,W],[0,208,ah],[0,209,ao],[0,210,s],[0,rp,s],[0,212,s],[0,213,s],[0,214,s],[0,216,s],[0,217,B],[0,218,B],[0,219,B],[0,220,B],[0,221,aK],[0,222,jK],[0,oJ,R],[0,eo,x],[0,q1,x],[0,226,x],[0,227,x],[0,228,x],[0,229,x],[0,230,cM],[0,231,aL],[0,232,n],[0,pZ,n],[0,234,n],[0,235,n],[0,236,P],[0,he,P],[0,238,P],[0,po,P],[0,ec,aa],[0,241,ab],[0,242,d],[0,243,d],[0,re,d],[0,jU,d],[0,246,d],[0,L,d],[0,249,t],[0,jF,t],[0,251,t],[0,el,t],[0,n6,ax],[0,dE,fw],[0,c_,ax],[0,cu,z],[0,q6,x],[0,258,z],[0,259,x],[0,260,z],[0,261,x],[0,262,ay],[0,263,aL],[0,264,ay],[0,265,aL],[0,oP,ay],[0,267,aL],[0,268,ay],[0,269,aL],[0,270,ah],[0,nv,aa],[0,272,ah],[0,rw,aa],[0,274,F],[0,275,n],[0,276,F],[0,277,n],[0,278,F],[0,279,n],[0,280,F],[0,281,n],[0,282,F],[0,283,n],[0,284,ak],[0,285,V],[0,286,ak],[0,287,V],[0,288,ak],[0,289,V],[0,oZ,ak],[0,291,V],[0,qG,az],[0,293,U],[0,294,az],[0,295,U],[0,296,W],[0,o$,P],[0,298,W],[0,299,P],[0,300,W],[0,301,P],[0,302,W],[0,303,P],[0,304,W],[0,305,P],[0,306,"IJ"],[0,307,"ij"],[0,308,b_],[0,309,bq],[0,310,aA],[0,311,aQ],[0,312,"kra"],[0,313,ad],[0,314,D],[0,315,ad],[0,316,D],[0,317,ad],[0,318,D],[0,319,ad],[0,320,D],[0,321,ad],[0,322,D],[0,323,ao],[0,324,ab],[0,325,ao],[0,326,ab],[0,327,ao],[0,328,ab],[0,329,ab],[0,330,"NG"],[0,331,fx],[0,332,s],[0,333,d],[0,334,s],[0,335,d],[0,336,s],[0,337,d],[0,338,oV],[0,339,cR],[0,340,ae],[0,341,r],[0,342,ae],[0,343,r],[0,344,ae],[0,345,r],[0,346,_],[0,347,R],[0,348,_],[0,349,R],[0,350,_],[0,351,R],[0,352,_],[0,353,R],[0,354,aC],[0,355,ag],[0,356,aC],[0,n$,ag],[0,358,aC],[0,359,ag],[0,360,B],[0,361,t],[0,362,B],[0,ox,t],[0,364,B],[0,365,t],[0,366,B],[0,367,t],[0,368,B],[0,rz,t],[0,370,B],[0,371,t],[0,372,aV],[0,373,a4],[0,374,aK],[0,375,ax],[0,376,aK],[0,377,ap],[0,378,$],[0,379,ap],[0,380,$],[0,381,ap],[0,382,$],[0,383,R],[0,384,aJ],[0,385,aT],[0,386,aT],[0,387,aJ],[0,388,ob],[0,389,ob],[0,390,s],[0,391,ay],[0,392,aL],[0,393,ah],[0,394,ah],[0,395,ah],[0,396,aa],[0,pO,aa],[0,398,F],[0,399,F],[0,400,F],[0,401,bh],[0,402,b5],[0,403,ak],[0,404,ak],[0,405,o6],[0,406,W],[0,407,W],[0,oo,aA],[0,409,aQ],[0,410,D],[0,411,D],[0,412,bb],[0,413,ao],[0,414,ab],[0,415,s],[0,416,s],[0,417,d],[0,418,"OI"],[0,419,"oi"],[0,420,aU],[0,421,bo],[0,422,"YR"],[0,423,jy],[0,424,jy],[0,425,oq],[0,426,cQ],[0,427,ag],[0,428,aC],[0,429,ag],[0,430,aC],[0,431,B],[0,432,t],[0,433,B],[0,434,bi],[0,435,aK],[0,436,ax],[0,437,ap],[0,438,$],[0,439,ap],[0,440,ap],[0,441,$],[0,442,$],[0,443,jy],[0,444,pX],[0,445,pX],[0,446,bV],[0,447,a4],[0,448,cj],[0,449,cj],[0,450,cj],[0,451,cj],[0,452,ri],[0,453,ah],[0,454,b7],[0,455,"LJ"],[0,456,ad],[0,457,"lj"],[0,458,"NJ"],[0,459,ao],[0,460,"nj"],[0,461,z],[0,462,x],[0,463,W],[0,464,P],[0,465,s],[0,466,d],[0,467,B],[0,468,t],[0,469,B],[0,470,t],[0,471,B],[0,472,t],[0,473,B],[0,474,t],[0,475,B],[0,476,t],[0,477,n],[0,478,z],[0,479,x],[0,480,z],[0,481,x],[0,482,fk],[0,483,cM],[0,484,ak],[0,485,V],[0,486,ak],[0,487,V],[0,488,aA],[0,489,aQ],[0,490,s],[0,491,d],[0,492,s],[0,493,d],[0,494,ap],[0,495,$],[0,496,bq],[0,497,ri],[0,498,ah],[0,499,b7],[0,500,ak],[0,501,V],[0,502,"HW"],[0,503,aV],[0,504,ao],[0,505,ab],[0,506,z],[0,507,x],[0,508,fk],[0,509,cM],[0,510,s],[0,511,d],[0,hb,z],[0,513,x],[0,514,z],[0,515,x],[0,516,F],[0,517,n],[0,518,F],[0,519,n],[0,520,W],[0,521,P],[0,522,W],[0,523,P],[0,524,s],[0,525,d],[0,526,s],[0,527,d],[0,528,ae],[0,529,r],[0,530,ae],[0,531,r],[0,532,B],[0,533,t],[0,534,B],[0,535,t],[0,536,_],[0,537,R],[0,538,aC],[0,539,ag],[0,540,"GH"],[0,541,"gh"],[0,542,az],[0,543,U],[0,544,ao],[0,545,aa],[0,546,"OU"],[0,547,jn],[0,548,ap],[0,549,$],[0,550,z],[0,551,x],[0,552,F],[0,553,n],[0,554,s],[0,555,d],[0,556,s],[0,557,d],[0,558,s],[0,559,d],[0,560,s],[0,561,d],[0,562,aK],[0,563,ax],[0,564,D],[0,565,ab],[0,566,ag],[0,567,bq],[0,568,"db"],[0,569,"qp"],[0,570,z],[0,o0,ay],[0,572,aL],[0,573,ad],[0,574,aC],[0,575,R],[0,576,$],[0,577,oy],[0,578,bV],[0,579,aT],[0,580,B],[0,581,bi],[0,582,F],[0,583,n],[0,584,b_],[0,585,bq],[0,586,b0],[0,587,c9],[0,588,ae],[0,589,r],[0,590,aK],[0,591,ax],[0,592,x],[0,593,x],[0,594,x],[0,595,aJ],[0,596,d],[0,597,aL],[0,598,aa],[0,599,aa],[0,600,n],[0,601,n],[0,602,n],[0,603,n],[0,604,n],[0,605,n],[0,606,n],[0,607,bq],[0,608,V],[0,609,V],[0,610,V],[0,611,V],[0,612,qS],[0,613,U],[0,614,U],[0,615,U],[0,616,P],[0,617,P],[0,618,P],[0,619,D],[0,620,D],[0,621,D],[0,622,ek],[0,623,aW],[0,624,aW],[0,625,aW],[0,626,ab],[0,627,ab],[0,628,ab],[0,629,d],[0,630,cR],[0,631,d],[0,632,jp],[0,633,r],[0,634,r],[0,635,r],[0,636,r],[0,637,r],[0,638,r],[0,639,r],[0,640,r],[0,641,r],[0,642,R],[0,643,cQ],[0,644,bq],[0,645,"{squat}"],[0,646,cQ],[0,647,ag],[0,648,ag],[0,649,t],[0,650,t],[0,651,aX],[0,652,aX],[0,653,a4],[0,ot,ax],[0,655,ax],[0,656,$],[0,657,$],[0,658,$],[0,659,$],[0,660,oy],[0,661,"{voiced}"],[0,662,bV],[0,663,aL],[0,664,cj],[0,665,aJ],[0,666,n],[0,667,V],[0,668,U],[0,669,bq],[0,670,aQ],[0,671,D],[0,672,c9],[0,673,bV],[0,674,bV],[0,675,b7],[0,676,b7],[0,677,b7],[0,678,bV],[0,p6,hn],[0,680,ol],[0,681,j6],[0,682,qT],[0,683,ek],[0,684,"{percussive}"],[0,685,"{bipercussive}"],[0,686,U],[0,687,U],[0,688,U],[0,689,U],[0,690,bq],[0,691,r],[0,692,r],[0,693,r],[0,694,r],[0,695,a4],[0,696,ax],[0,736,V],[0,737,D],[0,738,R],[0,739,bW],[0,740,bV],[0,768,e],[0,769,e],[0,770,e],[0,771,e],[0,772,e],[0,773,e],[0,774,e],[0,775,e],[0,776,e],[0,777,e],[0,778,e],[0,779,e],[0,780,e],[0,781,e],[0,782,e],[0,783,e],[0,784,e],[0,785,e],[0,786,e],[0,787,e],[0,788,e],[0,789,e],[0,790,e],[0,791,e],[0,792,e],[0,793,e],[0,794,e],[0,795,e],[0,796,e],[0,797,e],[0,798,e],[0,799,e],[0,800,e],[0,801,e],[0,802,e],[0,803,e],[0,804,e],[0,805,e],[0,806,e],[0,807,e],[0,808,e],[0,809,e],[0,810,e],[0,811,e],[0,812,e],[0,813,e],[0,rl,e],[0,om,e],[0,816,e],[0,817,e],[0,nT,e],[0,p4,e],[0,820,e],[0,821,e],[0,ql,e],[0,p7,e],[0,824,e],[0,825,e],[0,oA,e],[0,nZ,e],[0,828,e],[0,829,e],[0,830,e],[0,pI,e],[0,od,e],[0,833,e],[0,834,e],[0,835,e],[0,q3,e],[0,oB,e],[0,838,e],[0,839,e],[0,840,e],[0,841,e],[0,842,e],[0,843,e],[0,844,e],[0,845,e],[0,qK,e],[0,nB,e],[0,848,e],[0,849,e],[0,nA,e],[0,qv,e],[0,852,e],[0,853,e],[0,854,e],[0,855,e],[0,856,e],[0,857,e],[0,858,e],[0,859,e],[0,860,e],[0,861,e],[0,862,e],[0,863,e],[0,864,e],[0,865,e],[0,866,e],[0,867,e],[0,868,e],[0,869,e],[0,870,e],[0,871,e],[0,872,e],[0,873,e],[0,874,e],[0,875,e],[0,876,e],[0,877,e],[0,878,e],[0,879,e],[0,1155,e],[0,1156,e],[0,1157,e],[0,1158,e],[0,1159,e],[0,1160,e],[0,1161,e],[0,2027,e],[0,2028,e],[0,2029,e],[0,2030,e],[0,2031,e],[0,2032,e],[0,2033,e],[0,2034,e],[0,2035,e],[0,3072,e],[0,3076,e],[0,3315,e],[0,3328,e],[0,4957,e],[0,4958,e],[0,4959,e],[0,6783,e],[0,6832,e],[0,6833,e],[0,6834,e],[0,6835,e],[0,6836,e],[0,6837,e],[0,6838,e],[0,6839,e],[0,6840,e],[0,6841,e],[0,6842,e],[0,6843,e],[0,6844,e],[0,6845,e],[0,6846,e],[0,6847,e],[0,6848,e],[0,6849,e],[0,6850,e],[0,6851,e],[0,6852,e],[0,6853,e],[0,6854,e],[0,6855,e],[0,6856,e],[0,6857,e],[0,6858,e],[0,6859,e],[0,6860,e],[0,6861,e],[0,6862,e],[0,6863,e],[0,6864,e],[0,6865,e],[0,6866,e],[0,6867,e],[0,6868,e],[0,6869,e],[0,6870,e],[0,6871,e],[0,6872,e],[0,6873,e],[0,6874,e],[0,6875,e],[0,6876,e],[0,6877,e],[0,6878,e],[0,6879,e],[0,6880,e],[0,6881,e],[0,6882,e],[0,6883,e],[0,6884,e],[0,6885,e],[0,6886,e],[0,6887,e],[0,6888,e],[0,6889,e],[0,6890,e],[0,6891,e],[0,6892,e],[0,6893,e],[0,6894,e],[0,6895,e],[0,6896,e],[0,6897,e],[0,6898,e],[0,6899,e],[0,6900,e],[0,6901,e],[0,6902,e],[0,6903,e],[0,6904,e],[0,6905,e],[0,6906,e],[0,6907,e],[0,6908,e],[0,6909,e],[0,6910,e],[0,6911,e],[0,7019,e],[0,7020,e],[0,7021,e],[0,7022,e],[0,7023,e],[0,7024,e],[0,7025,e],[0,7026,e],[0,7027,e],[0,7424,x],[0,7425,cM],[0,7426,cM],[0,7427,aJ],[0,7428,aL],[0,7429,aa],[0,7430,aa],[0,7431,n],[0,7432,n],[0,7433,P],[0,7434,bq],[0,7435,aQ],[0,7436,D],[0,7437,aW],[0,7438,ab],[0,7439,d],[0,7440,d],[0,7441,d],[0,7442,d],[0,7443,d],[0,7444,cR],[0,7445,jn],[0,7446,d],[0,7447,d],[0,7448,bo],[0,7449,r],[0,7450,r],[0,7451,ag],[0,7452,t],[0,7453,t],[0,7454,t],[0,7455,aW],[0,7456,aX],[0,7457,a4],[0,7458,$],[0,7459,$],[0,7460,"{spirant}"],[0,7461,d],[0,7468,x],[0,7469,cM],[0,7470,aJ],[0,7471,aJ],[0,7472,aa],[0,7473,n],[0,7474,n],[0,7475,V],[0,7476,U],[0,7477,P],[0,7478,bq],[0,7479,aQ],[0,7480,D],[0,7481,aW],[0,7482,ab],[0,7483,ab],[0,7484,d],[0,7485,jn],[0,7486,bo],[0,7487,r],[0,7488,ag],[0,7489,t],[0,7490,a4],[0,7491,x],[0,7492,x],[0,7493,x],[0,7494,cM],[0,7495,aJ],[0,7496,aa],[0,7497,n],[0,7498,n],[0,7499,n],[0,7500,n],[0,7501,V],[0,7502,P],[0,7503,aQ],[0,7504,aW],[0,7505,fx],[0,7506,d],[0,7507,d],[0,7508,d],[0,7509,d],[0,7510,bo],[0,7511,ag],[0,7512,t],[0,7513,t],[0,7514,aW],[0,7515,aX],[0,7516,d],[0,7531,rh],[0,7532,aJ],[0,7533,aa],[0,7534,b5],[0,7535,aW],[0,7536,ab],[0,7537,bo],[0,7538,r],[0,7539,r],[0,7540,R],[0,7541,ag],[0,7542,$],[0,7543,V],[0,7545,V],[0,7546,fw],[0,7547,P],[0,7548,P],[0,7549,bo],[0,7550,t],[0,7551,t],[0,7552,aJ],[0,7553,aa],[0,7554,b5],[0,7555,V],[0,7556,aQ],[0,7557,D],[0,7558,aW],[0,7559,ab],[0,7560,bo],[0,7561,r],[0,7562,R],[0,7563,cQ],[0,7564,aX],[0,7565,bW],[0,7566,$],[0,7567,x],[0,7568,x],[0,7569,aa],[0,7570,n],[0,7571,n],[0,7572,n],[0,7573,n],[0,7574,P],[0,7575,d],[0,7576,cQ],[0,7577,t],[0,7578,$],[0,7579,x],[0,7580,aL],[0,7581,aL],[0,7582,aa],[0,7583,n],[0,7584,b5],[0,7585,bq],[0,7586,V],[0,7587,U],[0,7588,P],[0,7589,P],[0,7590,P],[0,7591,P],[0,7592,bq],[0,7593,D],[0,7594,D],[0,7595,D],[0,7596,aW],[0,7597,aW],[0,7598,ab],[0,7599,ab],[0,7600,ab],[0,7601,d],[0,7602,jp],[0,7603,R],[0,7604,cQ],[0,7605,ag],[0,7606,t],[0,7607,t],[0,7608,t],[0,7609,aX],[0,7610,aX],[0,7611,$],[0,7612,$],[0,7613,$],[0,7614,$],[0,7616,e],[0,7617,e],[0,7618,e],[0,7619,e],[0,7620,e],[0,7621,e],[0,7622,e],[0,7623,e],[0,7624,e],[0,7625,e],[0,7626,ae],[0,7627,e],[0,7628,e],[0,7629,e],[0,7630,e],[0,7631,e],[0,7632,e],[0,7633,e],[0,7634,e],[0,7635,z],[0,7636,fk],[0,7637,ov],[0,7638,jv],[0,7639,ay],[0,7640,ah],[0,7641,ah],[0,7642,ak],[0,7643,ak],[0,7644,aA],[0,7645,ad],[0,7646,ad],[0,7647,bb],[0,7648,ao],[0,7649,ao],[0,7650,ae],[0,7651,ae],[0,7652,_],[0,7653,_],[0,7654,ap],[0,7655,z],[0,7656,aT],[0,7657,aT],[0,7658,F],[0,7659,bh],[0,7660,ad],[0,7661,s],[0,7662,aU],[0,7663,oq],[0,7664,B],[0,7665,aV],[0,7666,z],[0,7667,s],[0,7668,B],[0,7669,e],[0,7670,e],[0,7671,e],[0,7672,e],[0,7673,e],[0,7674,e],[0,7675,e],[0,7676,e],[0,7677,e],[0,7678,e],[0,7679,e],[0,7680,z],[0,7681,x],[0,7682,aT],[0,7683,aJ],[0,7684,aT],[0,7685,aJ],[0,7686,aT],[0,7687,aJ],[0,7688,ay],[0,7689,aL],[0,7690,ah],[0,7691,aa],[0,7692,ah],[0,7693,aa],[0,7694,ah],[0,7695,aa],[0,7696,ah],[0,7697,aa],[0,7698,ah],[0,7699,aa],[0,7700,F],[0,7701,n],[0,7702,F],[0,7703,n],[0,7704,F],[0,7705,n],[0,7706,F],[0,7707,n],[0,7708,F],[0,7709,n],[0,7710,bh],[0,7711,b5],[0,7712,ak],[0,7713,V],[0,7714,az],[0,7715,U],[0,7716,az],[0,7717,U],[0,7718,az],[0,7719,U],[0,7720,az],[0,7721,U],[0,7722,az],[0,7723,U],[0,7724,W],[0,7725,P],[0,7726,W],[0,7727,P],[0,7728,aA],[0,7729,aQ],[0,7730,aA],[0,7731,aQ],[0,7732,aA],[0,7733,aQ],[0,7734,ad],[0,7735,D],[0,7736,ad],[0,7737,D],[0,7738,ad],[0,7739,D],[0,7740,ad],[0,7741,D],[0,7742,bb],[0,7743,aW],[0,7744,bb],[0,7745,aW],[0,7746,bb],[0,7747,aW],[0,7748,ao],[0,7749,ab],[0,7750,ao],[0,7751,ab],[0,7752,ao],[0,7753,ab],[0,7754,ao],[0,7755,ab],[0,7756,s],[0,7757,d],[0,7758,s],[0,7759,d],[0,7760,s],[0,7761,d],[0,7762,s],[0,7763,d],[0,7764,aU],[0,7765,bo],[0,7766,aU],[0,7767,bo],[0,7768,ae],[0,7769,r],[0,7770,ae],[0,7771,r],[0,7772,ae],[0,7773,r],[0,7774,ae],[0,7775,r],[0,7776,_],[0,7777,R],[0,7778,_],[0,7779,R],[0,7780,_],[0,7781,R],[0,7782,_],[0,7783,R],[0,7784,_],[0,7785,R],[0,7786,aC],[0,7787,ag],[0,7788,aC],[0,7789,ag],[0,7790,aC],[0,7791,ag],[0,7792,aC],[0,7793,ag],[0,7794,B],[0,7795,t],[0,7796,B],[0,7797,t],[0,7798,B],[0,7799,t],[0,7800,B],[0,7801,t],[0,7802,B],[0,7803,t],[0,7804,bi],[0,7805,aX],[0,7806,bi],[0,7807,aX],[0,7808,aV],[0,7809,a4],[0,7810,aV],[0,7811,a4],[0,7812,aV],[0,7813,a4],[0,7814,aV],[0,7815,a4],[0,7816,aV],[0,7817,a4],[0,7818,b9],[0,7819,bW],[0,7820,b9],[0,7821,bW],[0,7822,aK],[0,7823,ax],[0,7824,ap],[0,7825,$],[0,7826,ap],[0,7827,$],[0,7828,ap],[0,7829,$],[0,7830,U],[0,7831,ag],[0,7832,a4],[0,7833,ax],[0,7834,x],[0,7835,R],[0,7836,R],[0,7837,R],[0,7838,_],[0,7839,aa],[0,7840,z],[0,7841,x],[0,7842,z],[0,7843,x],[0,7844,z],[0,7845,x],[0,7846,z],[0,7847,x],[0,7848,z],[0,7849,x],[0,7850,z],[0,7851,x],[0,7852,z],[0,7853,x],[0,7854,z],[0,7855,x],[0,7856,z],[0,7857,x],[0,7858,z],[0,7859,x],[0,7860,z],[0,7861,x],[0,7862,z],[0,7863,x],[0,7864,F],[0,7865,n],[0,7866,F],[0,7867,n],[0,7868,F],[0,7869,n],[0,7870,F],[0,7871,n],[0,7872,F],[0,7873,n],[0,7874,F],[0,7875,n],[0,7876,F],[0,7877,n],[0,7878,F],[0,7879,n],[0,7880,W],[0,7881,P],[0,7882,W],[0,7883,P],[0,7884,s],[0,7885,d],[0,7886,s],[0,7887,d],[0,7888,s],[0,7889,d],[0,7890,s],[0,7891,d],[0,7892,s],[0,7893,d],[0,7894,s],[0,7895,d],[0,7896,s],[0,7897,d],[0,7898,s],[0,7899,d],[0,7900,s],[0,7901,d],[0,7902,s],[0,7903,d],[0,7904,s],[0,7905,d],[0,7906,s],[0,7907,d],[0,7908,B],[0,7909,t],[0,7910,B],[0,7911,t],[0,7912,B],[0,7913,t],[0,7914,B],[0,7915,t],[0,7916,B],[0,7917,t],[0,7918,B],[0,7919,t],[0,7920,B],[0,7921,t],[0,7922,aK],[0,7923,ax],[0,7924,aK],[0,7925,ax],[0,7926,aK],[0,7927,ax],[0,7928,aK],[0,7929,ax],[0,7930,"LL"],[0,7931,"ll"],[0,7932,bi],[0,7933,aX],[0,7934,aK],[0,7935,ax],[0,8305,P],[0,8319,ab],[0,8400,e],[0,8401,e],[0,8402,e],[0,8403,e],[0,8404,e],[0,8405,e],[0,8406,e],[0,8407,e],[0,8408,e],[0,8409,e],[0,8410,e],[0,8411,e],[0,8412,e],[0,8413,e],[0,8414,e],[0,8415,e],[0,8416,e],[0,8417,e],[0,8418,e],[0,8419,e],[0,8420,e],[0,8421,e],[0,8422,e],[0,8423,e],[0,8424,e],[0,8425,e],[0,8426,e],[0,8427,e],[0,8428,e],[0,8429,e],[0,8430,e],[0,8431,e],[0,8432,e],[0,8580,aL],[0,9372,z],[0,9373,aT],[0,9374,ay],[0,9375,ah],[0,9376,F],[0,9377,bh],[0,9378,ak],[0,9379,az],[0,9380,W],[0,9381,b_],[0,9382,aA],[0,9383,ad],[0,9384,bb],[0,9385,ao],[0,9386,s],[0,9387,aU],[0,9388,b0],[0,9389,ae],[0,9390,_],[0,9391,aC],[0,9392,B],[0,9393,bi],[0,9394,aV],[0,9395,b9],[0,9396,aK],[0,9397,ap],[0,9398,z],[0,9399,aT],[0,9400,ay],[0,9401,ah],[0,9402,F],[0,9403,bh],[0,9404,ak],[0,9405,az],[0,9406,W],[0,9407,b_],[0,9408,aA],[0,9409,ad],[0,9410,bb],[0,9411,ao],[0,9412,s],[0,9413,aU],[0,9414,b0],[0,9415,ae],[0,9416,_],[0,9417,aC],[0,9418,B],[0,9419,bi],[0,9420,aV],[0,9421,b9],[0,9422,aK],[0,9423,ap],[0,9424,x],[0,9425,aJ],[0,9426,aL],[0,9427,aa],[0,9428,n],[0,9429,b5],[0,9430,V],[0,9431,U],[0,9432,P],[0,9433,bq],[0,9434,aQ],[0,9435,D],[0,9436,aW],[0,9437,ab],[0,9438,d],[0,9439,bo],[0,9440,c9],[0,9441,r],[0,9442,R],[0,9443,ag],[0,9444,t],[0,9445,aX],[0,9446,a4],[0,9447,bW],[0,9448,ax],[0,9449,$],[0,11360,ad],[0,11361,D],[0,11362,ad],[0,11363,aU],[0,11364,ae],[0,11365,x],[0,11366,ag],[0,11367,az],[0,11368,U],[0,11369,aA],[0,11370,aQ],[0,11371,ap],[0,11372,$],[0,11373,z],[0,11374,bb],[0,11375,z],[0,11376,z],[0,11377,aX],[0,11378,aV],[0,11379,a4],[0,11380,aX],[0,11381,az],[0,11382,U],[0,11383,jp],[0,11384,n],[0,11385,r],[0,11386,d],[0,11387,n],[0,11389,aX],[0,11390,_],[0,11391,ap],[0,11503,e],[0,11504,e],[0,11505,e],[0,12441,e],[0,12442,e],[0,42607,e],[0,42608,e],[0,42609,e],[0,42610,e],[0,42620,e],[0,42621,e],[0,42736,e],[0,42737,e],[0,42786,"{ALEF}"],[0,42787,"{alef}"],[0,42788,s],[0,42789,d],[0,42790,az],[0,42791,U],[0,42792,"TZ"],[0,42793,"tz"],[0,42794,ou],[0,42795,ou],[0,42796,hq],[0,42797,hq],[0,42798,hq],[0,42799,hq],[0,42800,b5],[0,42801,R],[0,42802,"AA"],[0,42803,pB],[0,42804,ov],[0,42805,"ao"],[0,42806,"AU"],[0,42807,"au"],[0,42808,jv],[0,42809,rP],[0,42810,jv],[0,42811,rP],[0,42812,"AY"],[0,42813,"ay"],[0,42814,ay],[0,42815,aL],[0,42816,aA],[0,42817,aQ],[0,42818,aA],[0,42819,aQ],[0,42820,aA],[0,42821,aQ],[0,42822,ad],[0,42823,D],[0,42824,ad],[0,42825,D],[0,42826,s],[0,42827,d],[0,42828,s],[0,42829,d],[0,42830,"OO"],[0,42831,"oo"],[0,42832,aU],[0,42833,bo],[0,42834,aU],[0,42835,bo],[0,42836,aU],[0,42837,bo],[0,42838,b0],[0,42839,c9],[0,42840,b0],[0,42841,c9],[0,42842,ae],[0,42843,r],[0,42844,ae],[0,42845,r],[0,42846,bi],[0,42847,aX],[0,42848,"VY"],[0,42849,"vy"],[0,42850,ap],[0,42851,$],[0,42852,jK],[0,42853,fw],[0,42854,jK],[0,42855,fw],[0,42856,bi],[0,42857,aX],[0,42858,"ET"],[0,42859,"et"],[0,42860,"IS"],[0,42861,"is"],[0,42862,"CON"],[0,42863,"con"],[0,42864,"us"],[0,42865,"dum"],[0,42866,"lum"],[0,42867,"mum"],[0,42868,"num"],[0,42869,r],[0,42870,r],[0,42871,"tum"],[0,42872,"um"],[0,42873,ah],[0,42874,aa],[0,42875,bh],[0,42876,b5],[0,42877,ak],[0,42878,ak],[0,42879,V],[0,42880,ad],[0,42881,D],[0,42882,ae],[0,42883,r],[0,42884,_],[0,42885,R],[0,42886,aC],[0,42887,ag],[0,42891,g8],[0,42892,g8],[0,42893,az],[0,42894,D],[0,42895,j7],[0,42896,ao],[0,42897,ab],[0,42898,ay],[0,42899,aL],[0,42900,aL],[0,42901,U],[0,42902,aT],[0,42903,aJ],[0,42904,bh],[0,42905,b5],[0,42906,fk],[0,42907,cM],[0,42908,oV],[0,42909,cR],[0,42910,"UE"],[0,42911,rh],[0,42912,ak],[0,42913,V],[0,42914,aA],[0,42915,aQ],[0,42916,ao],[0,42917,ab],[0,42918,ae],[0,42919,r],[0,42920,_],[0,42921,R],[0,42922,az],[0,42923,F],[0,42924,ak],[0,42925,ad],[0,42926,W],[0,42927,c9],[0,42928,aA],[0,42929,aC],[0,42930,b_],[0,42931,b9],[0,42932,aT],[0,42933,aJ],[0,42934,s],[0,42935,d],[0,42936,B],[0,42937,t],[0,42938,z],[0,42939,x],[0,42940,W],[0,42941,P],[0,42942,B],[0,42943,t],[0,42944,s],[0,42945,d],[0,42946,aV],[0,42947,a4],[0,42948,ay],[0,42949,_],[0,42950,ap],[0,42951,ah],[0,42952,aa],[0,42953,_],[0,42954,R],[0,42960,ak],[0,42961,V],[0,42963,fw],[0,42965,a4],[0,42966,_],[0,42967,R],[0,42968,_],[0,42969,R],[0,42994,ay],[0,42995,bh],[0,42996,b0],[0,42997,az],[0,42998,U],[0,42999,W],[0,43000,U],[0,43001,"{letter}"],[0,43002,aW],[0,43003,bh],[0,43004,aU],[0,43005,bb],[0,43006,W],[0,43007,bb],[0,43232,e],[0,43233,e],[0,43234,e],[0,43235,e],[0,43236,e],[0,43237,e],[0,43238,e],[0,43239,e],[0,43240,e],[0,43241,e],[0,43249,e],[0,43824,x],[0,43825,x],[0,43826,n],[0,43827,n],[0,43828,n],[0,43829,b5],[0,43830,V],[0,43831,D],[0,43832,D],[0,43833,D],[0,43834,aW],[0,43835,ab],[0,43836,fx],[0,43837,d],[0,43838,d],[0,43839,d],[0,43840,cR],[0,43841,cR],[0,43842,cR],[0,43843,d],[0,43844,d],[0,43845,r],[0,43846,r],[0,43847,r],[0,43848,r],[0,43849,r],[0,43850,r],[0,43851,r],[0,43852,r],[0,43853,cQ],[0,43854,t],[0,43855,t],[0,43856,n1],[0,43857,n1],[0,43858,t],[0,43859,bW],[0,43860,bW],[0,43861,bW],[0,43862,bW],[0,43863,bW],[0,43864,bW],[0,43865,bW],[0,43866,ax],[0,43868,U],[0,43869,D],[0,43870,D],[0,43871,t],[0,43872,"wa"],[0,43873,n],[0,43874,cR],[0,43875,"uo"],[0,43876,x],[0,43878,b7],[0,43879,bV],[0,43880,r],[0,43881,a4],[0,64256,"ff"],[0,64257,"fi"],[0,64258,"fl"],[0,64259,"ffi"],[0,64260,"ffl"],[0,64261,R],[0,64262,"st"],[0,65056,e],[0,65057,e],[0,65058,e],[0,65059,e],[0,65060,e],[0,65061,e],[0,65062,e],[0,65063,e],[0,65064,e],[0,65065,e],[0,65066,e],[0,65067,e],[0,65068,e],[0,65069,e],[0,65070,e],[0,65071,e],[0,65313,z],[0,65314,aT],[0,65315,ay],[0,65316,ah],[0,65317,F],[0,65318,bh],[0,65319,ak],[0,65320,az],[0,65321,W],[0,65322,b_],[0,65323,aA],[0,65324,ad],[0,65325,bb],[0,65326,ao],[0,65327,s],[0,65328,aU],[0,65329,b0],[0,65330,ae],[0,65331,_],[0,65332,aC],[0,65333,B],[0,65334,bi],[0,65335,aV],[0,65336,b9],[0,65337,aK],[0,65338,ap],[0,65345,x],[0,65346,aJ],[0,65347,aL],[0,65348,aa],[0,65349,n],[0,65350,b5],[0,65351,V],[0,65352,U],[0,65353,P],[0,65354,bq],[0,65355,aQ],[0,65356,D],[0,65357,aW],[0,65358,ab],[0,65359,d],[0,65360,bo],[0,65361,c9],[0,65362,r],[0,65363,R],[0,65364,ag],[0,65365,t],[0,65366,aX],[0,65367,a4],[0,65368,bW],[0,65369,ax],[0,65370,$],[0,66045,e],[0,67456,pB],[0,67457,nt],[0,67458,nt],[0,67459,cM],[0,67460,aJ],[0,67461,aJ],[0,67463,b7],[0,67464,b7],[0,67465,b7],[0,67466,b7],[0,67467,aa],[0,67468,aa],[0,67469,aa],[0,67470,n],[0,67471,n],[0,67472,j6],[0,67473,qS],[0,67474,V],[0,67475,V],[0,67476,V],[0,67477,U],[0,67478,U],[0,67479,U],[0,67480,bq],[0,67481,qT],[0,67482,ek],[0,67483,D],[0,67484,D],[0,67485,D],[0,67486,ek],[0,67487,ek],[0,67488,ax],[0,67489,ax],[0,67490,d],[0,67491,cR],[0,67492,d],[0,67493,c9],[0,67494,r],[0,67495,r],[0,67496,r],[0,67497,r],[0,67498,r],[0,67499,ol],[0,67500,bV],[0,67501,bV],[0,67502,hn],[0,67503,ag],[0,67504,aX],[0,67506,ax],[0,67507,bV],[0,67508,bV],[0,67509,cj],[0,67510,cj],[0,67511,cj],[0,67512,cj],[0,67513,cj],[0,67514,R],[0,69291,e],[0,69292,e],[0,69446,e],[0,69447,e],[0,69448,e],[0,69449,e],[0,69450,e],[0,69451,e],[0,69452,e],[0,69453,e],[0,69454,e],[0,69455,e],[0,69456,e],[0,69506,e],[0,69507,e],[0,69508,e],[0,69509,e],[0,70400,e],[0,70459,e],[0,70502,e],[0,70503,e],[0,70504,e],[0,70505,e],[0,70506,e],[0,70507,e],[0,70508,e],[0,92912,e],[0,92913,e],[0,92914,e],[0,92915,e],[0,92916,e],[0,118528,e],[0,118529,e],[0,118530,e],[0,118531,e],[0,118532,e],[0,118533,e],[0,118534,e],[0,118535,e],[0,118536,e],[0,118537,e],[0,118538,e],[0,118539,e],[0,118540,e],[0,118541,e],[0,118542,e],[0,118543,e],[0,118544,e],[0,118545,e],[0,118546,e],[0,118547,e],[0,118548,e],[0,118549,e],[0,118550,e],[0,118551,e],[0,118552,e],[0,118553,e],[0,118554,e],[0,118555,e],[0,118556,e],[0,118557,e],[0,118558,e],[0,118559,e],[0,118560,e],[0,118561,e],[0,118562,e],[0,118563,e],[0,118564,e],[0,118565,e],[0,118566,e],[0,118567,e],[0,118568,e],[0,118569,e],[0,118570,e],[0,118571,e],[0,118572,e],[0,118573,e],[0,118576,e],[0,118577,e],[0,118578,e],[0,118579,e],[0,118580,e],[0,118581,e],[0,118582,e],[0,118583,e],[0,118584,e],[0,118585,e],[0,118586,e],[0,118587,e],[0,118588,e],[0,118589,e],[0,118590,e],[0,118591,e],[0,118592,e],[0,118593,e],[0,119141,e],[0,119142,e],[0,119143,e],[0,119144,e],[0,119145,e],[0,119149,e],[0,119150,e],[0,119151,e],[0,119152,e],[0,119153,e],[0,119154,e],[0,119163,e],[0,119164,e],[0,119165,e],[0,119166,e],[0,119167,e],[0,119168,e],[0,119169,e],[0,119170,e],[0,119173,e],[0,119174,e],[0,119175,e],[0,119176,e],[0,119177,e],[0,119178,e],[0,119179,e],[0,119210,e],[0,119211,e],[0,119212,e],[0,119213,e],[0,119362,e],[0,119363,e],[0,119364,e],[0,122624,j6],[0,122625,V],[0,122626,V],[0,122627,aQ],[0,122628,D],[0,122629,ek],[0,122630,ax],[0,122631,fx],[0,122632,r],[0,122633,ag],[0,122634,cj],[0,122635,cQ],[0,122636,cQ],[0,122637,ag],[0,122638,bV],[0,122639,aL],[0,122640,aQ],[0,122641,D],[0,122642,b7],[0,122643,D],[0,122644,fx],[0,122645,r],[0,122646,r],[0,122647,hn],[0,122648,$],[0,122649,b7],[0,122650,P],[0,122651,d],[0,122652,hn],[0,122653,aL],[0,122654,R],[0,122661,aa],[0,122662,D],[0,122663,ab],[0,122664,r],[0,122665,R],[0,122666,ag],[0,125136,e],[0,125137,e],[0,125138,e],[0,125139,e],[0,125140,e],[0,125141,e],[0,125142,e],[0,127248,z],[0,127249,aT],[0,127250,ay],[0,127251,ah],[0,127252,F],[0,127253,bh],[0,127254,ak],[0,127255,az],[0,127256,W],[0,127257,b_],[0,127258,aA],[0,127259,ad],[0,127260,bb],[0,127261,ao],[0,127262,s],[0,127263,aU],[0,127264,b0],[0,127265,ae],[0,127266,_],[0,127267,aC],[0,127268,B],[0,127269,bi],[0,127270,aV],[0,127271,b9],[0,127272,aK],[0,127273,ap],[0,127274,_],[0,127275,ay],[0,127276,ae],[0,127280,z],[0,127281,aT],[0,127282,ay],[0,127283,ah],[0,127284,F],[0,127285,bh],[0,127286,ak],[0,127287,az],[0,127288,W],[0,127289,b_],[0,127290,aA],[0,127291,ad],[0,127292,bb],[0,127293,ao],[0,127294,s],[0,127295,aU],[0,127296,b0],[0,127297,ae],[0,127298,_],[0,127299,aC],[0,127300,B],[0,127301,bi],[0,127302,aV],[0,127303,b9],[0,127304,aK],[0,127305,ap],[0,127312,z],[0,127313,aT],[0,127314,ay],[0,127315,ah],[0,127316,F],[0,127317,bh],[0,127318,ak],[0,127319,az],[0,127320,W],[0,127321,b_],[0,127322,aA],[0,127323,ad],[0,127324,bb],[0,127325,ao],[0,127326,s],[0,127327,aU],[0,127328,b0],[0,127329,ae],[0,127330,_],[0,127331,aC],[0,127332,B],[0,127333,bi],[0,127334,aV],[0,127335,b9],[0,127336,aK],[0,127337,ap],[0,127344,z],[0,127345,aT],[0,127346,ay],[0,127347,ah],[0,127348,F],[0,127349,bh],[0,127350,ak],[0,127351,az],[0,127352,W],[0,127353,b_],[0,127354,aA],[0,127355,ad],[0,127356,bb],[0,127357,ao],[0,127358,s],[0,127359,aU],[0,127360,b0],[0,127361,ae],[0,127362,_],[0,127363,aC],[0,127364,B],[0,127365,bi],[0,127366,aV],[0,127367,b9],[0,127368,aK],[0,127369,ap],[0,127370,aU],[0,127397,ah],[0,917569,z],[0,917570,aT],[0,917571,ay],[0,917572,ah],[0,917573,F],[0,917574,bh],[0,917575,ak],[0,917576,az],[0,917577,W],[0,917578,b_],[0,917579,aA],[0,917580,ad],[0,917581,bb],[0,917582,ao],[0,917583,s],[0,917584,aU],[0,917585,b0],[0,917586,ae],[0,917587,_],[0,917588,aC],[0,917589,B],[0,917590,bi],[0,917591,aV],[0,917592,b9],[0,917593,aK],[0,917594,ap],[0,917601,z],[0,917602,aT],[0,917603,ay],[0,917604,ah],[0,917605,F],[0,917606,bh],[0,917607,ak],[0,917608,az],[0,917609,W],[0,917610,b_],[0,917611,aA],[0,917612,ad],[0,917613,bb],[0,917614,ao],[0,917615,s],[0,917616,aU],[0,917617,b0],[0,917618,ae],[0,917619,_],[0,917620,aC],[0,917621,B],[0,917622,bi],[0,917623,aV],[0,917624,b9],[0,917625,aK],[0,917626,ap]]),DV=bZ,DU=hE([[0,170,x],[0,186,d],[0,oJ,"ss"],[0,8208,cl],[0,8211,cl],[0,8212,cl],[0,8216,g8],[0,8217,g8],[0,8220,dc],[0,8221,dc],[0,8230,"..."],[0,8722,cl]]),D2="?",D7=[0,e],D5=[1,[0,3854881,"Failed to unmarshal data"]],D3=[0,1],D8=[0,"lib/codec.ml",32,4],D$="Yojson__Common.Json_error",Eb="Yojson__Common.End_of_array",Ec="Yojson__Common.End_of_object",Ed="Yojson__Common.End_of_tuple",Ee="Yojson__Common.End_of_input",Eg=[0,"\0\0\xfe\xff\xff\xff","\xff\xff\xff\xff\xff\xff","\x01\0\0\0\0\0","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x02\0","\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0",e,e,e,e,e,e],Fy=[0,bc,1],Fz=[0,bc,0],FA=bX,FB="Invalid token",FC=bX,FD="Invalid escape sequence",FE=bX,FF="Invalid low surrogate for code point beyond U+FFFF",FG="Missing escape sequence representing low surrogate for code point beyond U+FFFF",FH=bX,FI="Expected ':' or '>' but found",FJ=bX,FK="Expected '>' but found",FL=bX,FM="Unterminated comment",FN="Expected string or identifier but found",FO=bX,FP="Expected ',' or ']' but found",FQ=bX,FR="Expected ',' or ')' but found",FS=bX,FT="Expected ',' or '}' but found",FU=bX,FV="Expected ':' but found",FW=bX,Gg="Expected string, got ",Gf="Expected object, got ",F5=ft,F7=ht,F8="floatlit",F9=hh,F_="tuple",F6="bool",Ga="variant",Gb="float",Gc="int",Gd=jw,F$="intlit",F1="Blank input data",FY="Junk after end of JSON value:",E6=[0,[2,0,[11," '",[2,0,[2,0,[12,39,0]]]]],"%s '%s%s'"],E1=[0,[11,"File ",[2,0,[11,np,0]]],"File %s, line"],E5="Line",E2=[0,[11,"byte ",[4,3,0,0,0]],"byte %i"],E4=[0,[11,"bytes ",[4,3,0,0,[12,45,[4,3,0,0,0]]]],"bytes %i-%i"],E3=[0,[2,0,[12,32,[4,3,0,0,[11,jY,[2,0,[11,":\n",[2,0,0]]]]]]],"%s %i, %s:\n%s"],E0=[0,"lib/read.mll",41,13],EZ=e,EX=e,EJ="NaN value not allowed in standard JSON",EK=[0,[8,[0,0,3],0,[0,16],0],rR],EM=[0,[8,[0,0,3],0,[0,17],0],qP],EL=rC,EH="Infinity value not allowed in standard JSON",EI="-Infinity value not allowed in standard JSON",EC="NaN",ED=[0,[8,[0,0,3],0,[0,16],0],rR],EF=[0,[8,[0,0,3],0,[0,17],0],qP],EE=rC,EA="Infinity",EB="-Infinity",Ew=fp,Ex=fB,Ev=ft,Ep=g_,Eq=hi,Er=g2,Es="\\f",Et=gW,Eu=j2,Eo=g7,Em=[0,[11,"src=",[3,0,[11," start=",[4,3,0,0,[11,i9,[4,3,0,0,[12,10,[10,0]]]]]]]],"src=%S start=%i len=%i\n%!"],Ek="\\u00",E7="Yojson__Safe.Int_overflow",F2="Yojson__Safe.Util.Type_error",Gm="list_of_yojson: list needed",Gl="int_of_yojson: integer needed",Gk="string_of_yojson: string needed",Gj="bool_of_yojson: true/false needed",Gh="Ppx_yojson_conv_lib__Yojson_conv.Of_yojson_error",GA=bZ,GC="_of_yojson: list instead of atom for record expected",GB=[0,[2,0,[11,"_of_yojson: the following record elements were undefined: ",[2,0,0]]],"%s_of_yojson: the following record elements were undefined: %s"],Gy="extra fields",Gx="duplicate fields",Gv=bZ,Gw=[0,[2,0,[11,"_of_yojson: ",[2,0,[11,og,[2,0,0]]]]],"%s_of_yojson: %s: %s"],Gu="_of_yojson: unexpected variant constructor",Gt="_of_yojson: expected a variant type, saw an empty list",Gs="_of_yojson: expected a variant type, saw a nested list",Gr="_of_yojson: this constructor requires arguments",Gp=[0,[2,0,[11,"_of_yojson: sum tag ",[3,0,[11," has incorrect number of arguments",0]]]],"%s_of_yojson: sum tag %S has incorrect number of arguments"],Gn="_of_yojson: this constructor does not take arguments",JU="An error occured while decoding response: ",JP=[0,[11,", Token=",[3,0,0]],", Token=%S"],JS=e,JQ=e,JR=[0,[11,'MediaBrowser Client="Ocamix", Device="Firefox", DeviceId="',[2,0,[11,'", Version="0.1"',[2,0,0]]]],'MediaBrowser Client="Ocamix", Device="Firefox", DeviceId="%s", Version="0.1"%s'],JK=jh,JL=rT,JM=eh,JG="item_id",JH="locations",JI=bY,JD=[0,"Views",0],JE="Users",Jy=hc,Jz=g1,JA=fj,Ju=n7,Jv=nG,Jw=ji,Js=o_,Jq="include_external_content",Jo=[0,fj,0],Jl=hc,Jm=g1,Jn=fj,Ji=n7,Jj=nG,Jk=ji,I8=nV,I9=qn,I_=jE,I$=rs,Ja=q9,Jb=rm,Jc=oE,Jd=rx,Je=jo,Jf=pH,Jg=rI,Jh=qz,I1="enable_images",I2="enable_user_data",I3=jE,I4="sort_by",I5="include_item_types",I6=jo,I7="user_id",I0=pF,IQ=pM,IR=pr,IS=on,IT=pP,IU=gY,IV=o4,IW=hg,IX=hj,IY=ej,IZ=eh,IL="type_",IM="image_blur_hashes",IN=hl,IO=bp,IP=bY,IK=[0,"lib/data_source/jellyfin_api.ml",rg,64],HL=[0,h,[0,[0,f,of],0]],HM=[0,h,[0,[0,f,rM],0]],HN=[0,h,[0,[0,f,oe],0]],HO=[0,h,[0,[0,f,oR],0]],HP=[0,h,[0,[0,f,p8],0]],HQ=[0,h,[0,[0,f,qM],0]],HR=[0,h,[0,[0,f,nL],0]],HS=[0,h,[0,[0,f,qw],0]],HT=[0,h,[0,[0,f,pa],0]],HU=[0,h,[0,[0,f,qr],0]],HV=[0,h,[0,[0,f,ho],0]],HW=[0,h,[0,[0,f,pz],0]],HX=[0,h,[0,[0,f,o2],0]],HY=[0,h,[0,[0,f,nF],0]],HZ=[0,h,[0,[0,f,q5],0]],H0=[0,h,[0,[0,f,oH],0]],H1=[0,h,[0,[0,f,pR],0]],H2=[0,h,[0,[0,f,pn],0]],H3=[0,h,[0,[0,f,pQ],0]],H4=[0,h,[0,[0,f,oz],0]],H5=[0,h,[0,[0,f,oO],0]],H6=[0,h,[0,[0,f,rd],0]],H7=[0,h,[0,[0,f,pt],0]],H8=[0,h,[0,[0,f,ry],0]],H9=[0,h,[0,[0,f,o9],0]],H_=[0,h,[0,[0,f,q4],0]],H$=[0,h,[0,[0,f,nu],0]],Ia=[0,h,[0,[0,f,qa],0]],Ib=[0,h,[0,[0,f,qU],0]],Ic=[0,h,[0,[0,f,px],0]],Id=[0,h,[0,[0,f,nr],0]],Ie=[0,h,[0,[0,f,oT],0]],If=[0,h,[0,[0,f,pc],0]],Ig=[0,h,[0,[0,f,gY],0]],Ih=[0,h,[0,[0,f,hg],0]],Ii=[0,h,[0,[0,f,oa],0]],Ij=[0,h,[0,[0,f,qj],0]],Ik=[0,h,[0,[0,f,ps],0]],Il=[0,h,[0,[0,f,qL],0]],Im=[0,h,[0,[0,f,rf],0]],In=[0,h,[0,[0,f,oi],0]],Io=[0,h,[0,[0,f,rS],0]],Ip=[0,h,[0,[0,f,pe],0]],Iq=[0,h,[0,[0,f,p_],0]],Ir=[0,h,[0,[0,f,pf],0]],Is=[0,h,[0,[0,f,r1],0]],It=[0,h,[0,[0,f,qY],0]],Iu=[0,h,[0,[0,f,or],0]],Iv=[0,h,[0,[0,f,p2],0]],Iw=[0,h,[0,[0,f,pG],0]],Ix=[0,h,[0,[0,f,qp],0]],Iy=[0,h,[0,[0,f,ej],0]],Iz=[0,h,[0,[0,f,rQ],0]],IA=[0,h,[0,[0,f,qm],0]],IB=[0,h,[0,[0,f,pu],0]],IC=[0,h,[0,[0,f,ph],0]],ID=[0,h,[0,[0,f,qq],0]],IE=[0,h,[0,[0,f,p$],0]],IF=[0,h,[0,[0,f,rB],0]],IG=[0,h,[0,[0,f,r0],0]],IH=[0,h,[0,[0,f,rj],0]],G_=[0,h,[0,[0,f,rJ],0]],G$=[0,h,[0,[0,f,rc],0]],Ha=[0,h,[0,[0,f,o7],0]],Hb=[0,h,[0,[0,f,oF],0]],Hc=[0,h,[0,[0,f,nY],0]],Hd=[0,h,[0,[0,f,n9],0]],He=[0,h,[0,[0,f,oU],0]],Hf=[0,h,[0,[0,f,oj],0]],Hg=[0,h,[0,[0,f,p0],0]],Hh=[0,h,[0,[0,f,rk],0]],Hi=[0,h,[0,[0,f,rn],0]],Hj=[0,h,[0,[0,f,pp],0]],Hk=[0,h,[0,[0,f,rK],0]],Hl=[0,h,[0,[0,f,nM],0]],Hm=[0,h,[0,[0,f,nQ],0]],Hn=[0,h,[0,[0,f,rF],0]],Ho=[0,h,[0,[0,f,qx],0]],Hp=[0,h,[0,[0,f,ok],0]],Hq=[0,h,[0,[0,f,pT],0]],Hr=[0,h,[0,[0,f,oQ],0]],Hs=[0,h,[0,[0,f,nz],0]],Ht=[0,h,[0,[0,f,q$],0]],Hu=[0,h,[0,[0,f,q8],0]],Hv=[0,h,[0,[0,f,nI],0]],Hw=[0,h,[0,[0,f,qE],0]],Hx=[0,h,[0,[0,f,pA],0]],Hy=[0,h,[0,[0,f,rA],0]],Hz=[0,h,[0,[0,f,n4],0]],HA=[0,h,[0,[0,f,nO],0]],HB=[0,h,[0,[0,f,oI],0]],HC=[0,h,[0,[0,f,pL],0]],HD=[0,h,[0,[0,f,os],0]],HE=[0,h,[0,[0,f,pb],0]],HF=[0,h,[0,[0,f,nR],0]],HG=[0,h,[0,[0,f,nW],0]],HH=[0,h,[0,[0,f,qR],0]],HI=[0,h,[0,[0,f,oh],0]],G9=rH,G5=hj,G6=eh,G2=bp,G3=bY,GK=[0,h,[0,[0,f,jQ],0]],GL=[0,h,[0,[0,f,n3],0]],GM=[0,h,[0,[0,f,qJ],0]],GN=[0,h,[0,[0,f,pC],0]],GO=[0,h,[0,[0,f,pj],0]],GP=[0,h,[0,[0,f,n0],0]],GQ=[0,h,[0,[0,f,ho],0]],GR=[0,h,[0,[0,f,oD],0]],GS=[0,h,[0,[0,f,qX],0]],GT=[0,h,[0,[0,f,q7],0]],GU=[0,h,[0,[0,f,qH],0]],GV=[0,h,[0,[0,f,ej],0]],GW=[0,h,[0,[0,f,rq],0]],GX=[0,h,[0,[0,f,pS],0]],GY=[0,h,[0,[0,f,pD],0]],GG=[0,h,[0,[0,f,qQ],0]],GH=[0,h,[0,[0,f,qd],0]],J0=";",J1="allgenres",Ks=hl,Kt=dD,Ku=cP,Kv=jZ,Kw=bp,Km=hl,Kn=dD,Ko=cP,Kp=jZ,Kq=bp,Ki=dD,Kj=cP,Kk=bp,Ke=dD,Kf=cP,Kg=bp,Kb=g6,Kc=bY,J_=g6,J$=bY,J7=bY,J8=bp,J4=bY,J5=bp,J2=[0,f,jl],Lg=[0,dF,rw,15],Lb=[0,dF,pZ,15],KU=[0,dF,141,11],KQ=[0,dF,96,13],KP=[0,dF,87,19],KO=[0,dF,81,13],KN=[0,dF,75,19],KL=g4,KM=jA,KI=g4,KJ=jA,KE=cP,KF=j4,KG=jg,KA=cP,KB=j4,KC=jg,Ky=e,Kx=ns,KR=ji,KS="virtual_folders",K6="collections",K9=dD,La="albums",Lf=pg,LS=[0,1,0],LH=[0,6,0],LI=[0,0],LJ=[0,33,[0,34,[0,21,0]]],LP=jQ,LK=[0,1],LL=jI,LM=[0,"objs",0],LN=qI,LO=e,LQ=[0,"lib/db/sync.ml",n$,6],LE=[0,j7,0],LF=q0,LG="Fetching items",LD=[0,1],LA=[0,34,0],Lz=[0,33,0],Lu=[0,1],Lv=e,Lw="music",Lx=[0,0],Lo=[0,0],Lp=[0,2],Lk=[0,6,0],Ll=[0,0],Lm=[0,0],Lr=[0,0,0],LX=q0,LY="Upgrading indexed_db schema from version",LZ=[0,"Erasing existing stores",0],L0=[0,bp],L1=[0,0],L2=[0,"sorts.date_added"],L3=ns,L4=o8,L5="item.Name",L6=rL,L7=[0,0],L8=[0,rL],L9="items_by_id",L_=o8,L$="item.Type",Ma="items_by_view_and_kind",Mb="sorts.sort_name",Mc="item.CollectionType",Md="items_by_type_and_name",Me=[0,jh],Mf=[0,0],Mg=[0,1],Mh=[0,1],Mi=[0,bp],Mj=jI,Mk=[0,1],Ml=[0,1],Mm=[0,g6],Mn=qI,Mo=[0,bp],Mp=jI,Mq="Stores created:",MF="An error occured while loading item",ME="Unknown genre",Mz=[0,[2,0,0],pw],Mx=[0,jj,0],My="Get all keys ",MA=[0,jj,0],MB="Filter took ",MC=[0,jj,0],MD="Sort took ",Mv=pg,Mw=[0,2];function +ar(a){if(typeof a==="number")return 0;switch(a[0]){case -0:return[0,aq(a[1])];case -1:return[1,aq(a[1])];case -2:return[2,aq(a[1])];case -3:return[3,aq(a[1])];case -4:return[4,aq(a[1])];case -5:return[5,aq(a[1])];case -6:return[6,aq(a[1])];case -7:return[7,aq(a[1])];case +0:return[0,ar(a[1])];case +1:return[1,ar(a[1])];case +2:return[2,ar(a[1])];case +3:return[3,ar(a[1])];case +4:return[4,ar(a[1])];case +5:return[5,ar(a[1])];case +6:return[6,ar(a[1])];case +7:return[7,ar(a[1])];case 8:var -c=a[1];return[8,c,aq(a[2])];case +c=a[1];return[8,c,ar(a[2])];case 9:var -b=a[1];return[9,b,b,aq(a[3])];case -10:return[10,aq(a[1])];case -11:return[11,aq(a[1])];case -12:return[12,aq(a[1])];case -13:return[13,aq(a[1])];default:return[14,aq(a[1])]}}function -be(a,b){if(typeof +b=a[1];return[9,b,b,ar(a[3])];case +10:return[10,ar(a[1])];case +11:return[11,ar(a[1])];case +12:return[12,ar(a[1])];case +13:return[13,ar(a[1])];default:return[14,ar(a[1])]}}function +bf(a,b){if(typeof a==="number")return b;switch(a[0]){case -0:return[0,be(a[1],b)];case -1:return[1,be(a[1],b)];case -2:return[2,be(a[1],b)];case -3:return[3,be(a[1],b)];case -4:return[4,be(a[1],b)];case -5:return[5,be(a[1],b)];case -6:return[6,be(a[1],b)];case -7:return[7,be(a[1],b)];case +0:return[0,bf(a[1],b)];case +1:return[1,bf(a[1],b)];case +2:return[2,bf(a[1],b)];case +3:return[3,bf(a[1],b)];case +4:return[4,bf(a[1],b)];case +5:return[5,bf(a[1],b)];case +6:return[6,bf(a[1],b)];case +7:return[7,bf(a[1],b)];case 8:var -c=a[1];return[8,c,be(a[2],b)];case +c=a[1];return[8,c,bf(a[2],b)];case 9:var -d=a[2],e=a[1];return[9,e,d,be(a[3],b)];case -10:return[10,be(a[1],b)];case -11:return[11,be(a[1],b)];case -12:return[12,be(a[1],b)];case -13:return[13,be(a[1],b)];default:return[14,be(a[1],b)]}}function -ak(a,b){if(typeof +d=a[2],e=a[1];return[9,e,d,bf(a[3],b)];case +10:return[10,bf(a[1],b)];case +11:return[11,bf(a[1],b)];case +12:return[12,bf(a[1],b)];case +13:return[13,bf(a[1],b)];default:return[14,bf(a[1],b)]}}function +aj(a,b){if(typeof a==="number")return b;switch(a[0]){case -0:return[0,ak(a[1],b)];case -1:return[1,ak(a[1],b)];case +0:return[0,aj(a[1],b)];case +1:return[1,aj(a[1],b)];case 2:var -c=a[1];return[2,c,ak(a[2],b)];case +c=a[1];return[2,c,aj(a[2],b)];case 3:var -d=a[1];return[3,d,ak(a[2],b)];case +d=a[1];return[3,d,aj(a[2],b)];case 4:var -e=a[3],f=a[2],g=a[1];return[4,g,f,e,ak(a[4],b)];case +e=a[3],f=a[2],g=a[1];return[4,g,f,e,aj(a[4],b)];case 5:var -h=a[3],i=a[2],j=a[1];return[5,j,i,h,ak(a[4],b)];case +h=a[3],i=a[2],j=a[1];return[5,j,i,h,aj(a[4],b)];case 6:var -k=a[3],l=a[2],m=a[1];return[6,m,l,k,ak(a[4],b)];case +k=a[3],l=a[2],m=a[1];return[6,m,l,k,aj(a[4],b)];case 7:var -n=a[3],o=a[2],p=a[1];return[7,p,o,n,ak(a[4],b)];case +n=a[3],o=a[2],p=a[1];return[7,p,o,n,aj(a[4],b)];case 8:var -q=a[3],r=a[2],s=a[1];return[8,s,r,q,ak(a[4],b)];case +q=a[3],r=a[2],s=a[1];return[8,s,r,q,aj(a[4],b)];case 9:var -t=a[1];return[9,t,ak(a[2],b)];case -10:return[10,ak(a[1],b)];case +t=a[1];return[9,t,aj(a[2],b)];case +10:return[10,aj(a[1],b)];case 11:var -u=a[1];return[11,u,ak(a[2],b)];case +u=a[1];return[11,u,aj(a[2],b)];case 12:var -v=a[1];return[12,v,ak(a[2],b)];case +v=a[1];return[12,v,aj(a[2],b)];case 13:var -w=a[2],x=a[1];return[13,x,w,ak(a[3],b)];case +w=a[2],x=a[1];return[13,x,w,aj(a[3],b)];case 14:var -y=a[2],z=a[1];return[14,z,y,ak(a[3],b)];case -15:return[15,ak(a[1],b)];case -16:return[16,ak(a[1],b)];case +y=a[2],z=a[1];return[14,z,y,aj(a[3],b)];case +15:return[15,aj(a[1],b)];case +16:return[16,aj(a[1],b)];case 17:var -A=a[1];return[17,A,ak(a[2],b)];case +A=a[1];return[17,A,aj(a[2],b)];case 18:var -B=a[1];return[18,B,ak(a[2],b)];case -19:return[19,ak(a[1],b)];case +B=a[1];return[18,B,aj(a[2],b)];case +19:return[19,aj(a[1],b)];case 20:var -C=a[2],D=a[1];return[20,D,C,ak(a[3],b)];case +C=a[2],D=a[1];return[20,D,C,aj(a[3],b)];case 21:var -E=a[1];return[21,E,ak(a[2],b)];case -22:return[22,ak(a[1],b)];case +E=a[1];return[21,E,aj(a[2],b)];case +22:return[22,aj(a[1],b)];case 23:var -F=a[1];return[23,F,ak(a[2],b)];default:var -G=a[2],H=a[1];return[24,H,G,ak(a[3],b)]}}function -hv(a){return[0,a]}function -fG(a){return a[1]}function -hw(a,b,c){return a[1]===b?(a[1]=c,1):0}function -fH(a){throw i([0,eq,a],1)}function -P(a){throw i([0,hx,a],1)}var -j6=[J,rW,aZ(0)];function -j$(a,b){return My(a,b)?a:b}function -er(a){return 0<=a?a:-a|0}var -fI=b3;function -a0(a,b){return a+b}function -ka(a){return e+a}function -r8(b){var +F=a[1];return[23,F,aj(a[2],b)];default:var +G=a[2],H=a[1];return[24,H,G,aj(a[3],b)]}}function +fR(a){throw i([0,ez,a],1)}function +O(a){throw i([0,fQ,a],1)}var +kv=[L,sJ,a5(0)];function +kA(a,b){return NG(a,b)?a:b}function +eA(a){return 0<=a?a:-a|0}var +fS=b8;function +a7(a,b){return a+b}function +kB(a){return e+a}function +sV(b){var e=m(b);return function(a){var -c=a;for(;;){if(e<=c)return a0(b,r9);var -d=X(b,c);a:{if(48<=d){if(58>d)break a}else if(45===d)break a;return b}c=c+1|0}}(0)}function -hz(a,b){if(!a)return b;var -c=a[1];return[0,c,hz(a[2],b)]}MI(0);var -r$=rH(1),cj=rH(2);function -es(a,b){jY(a,b,0,m(b));return}function -kb(a){es(cj,a);rI(cj,10);return dE(cj)}var -hA=hv(function(a){return function(a){var +c=a;for(;;){if(e<=c)return a7(b,sW);var +d=ai(b,c);a:{if(48<=d){if(58>d)break a}else if(45===d)break a;return b}c=c+1|0}}(0)}function +kC(a,b){if(!a)return b;var +c=a[2],d=a[1];if(!c)return[0,d,b];var +e=c[2],f=c[1];if(!e)return[0,d,[0,f,b]];var +g=[0,e[1],bD];sY(g,1,e[2],b);return[0,d,[0,f,g]]}function +sY(a,b,c,d){var +f=a,e=b,g=c;for(;;){if(!g){f[1+e]=d;return}var +h=g[2],i=g[1];if(!h){f[1+e]=[0,i,d];return}var +j=h[2],k=h[1];if(!j){f[1+e]=[0,i,[0,k,d]];return}var +l=[0,j[1],bD],m=j[2];f[1+e]=[0,i,[0,k,l]];f=l;e=1;g=m}}NQ(0);var +hM=ss(1),b2=ss(2);function +eB(a,b){ko(a,b,0,m(b));return}function +kD(a,b,c,d){if(0<=c&&0<=d&&(m(b)-d|0)>=c)return ko(a,b,c,d);return O(sZ)}function +kE(a){eB(b2,a);st(b2,10);return dJ(b2)}var +hN=[0,function(a){return function(a){var b=a;for(;;){if(!b)return 0;var -d=b[2],e=b[1];try{dE(e)}catch(f){var -c=aj(f);if(c[1]!==j9)throw i(c,0)}b=d}}(MJ(0))});function -hB(a){return g(fG(hA),0)}j3(ol,hB);function -rX(a,b){return Mc(a,b)?a:b}var -rY=-2147483648,r0=ek(rZ),r2=ek(r1),r4=ek(r3);function -r5(a){return a?r6:r7}function -r_(a){return r8(jP("%.12g",a))}function -sa(a,b,c,d){if(0<=c&&0<=d&&(m(b)-d|0)>=c)return jY(a,b,c,d);return P(sb)}function -sc(a,b,c,d){if(0<=c&&0<=d&&(aR(b)-d|0)>=c)return MG(a,b,c,d);return P(sd)}function -se(c){for(;;){var -d=hv(1),a=fG(hA);let -e=d,f=a;var -b=1-hw(hA,a,function(a){if(hw(e,1,0))g(c,0);return g(f,0)});if(!b)return b}}function -fJ(a){return dE(a)}function -sf(a,b){rI(a,b);return}var -hC=MX(0),et=(4*hC|0)-1|0;function -kc(a){return 1-(typeof -a==="number"?1:0)}var -sh=[J,sg,aZ(0)];function -si(a){throw i(sh,1)}function -sj(a){var -d=a[1];a[1]=si;try{var -c=g(d,0);MO(a,c);return c}catch(f){var -b=aj(f);a[1]=function(a){throw i(b,0)};throw i(b,0)}}function -hD(a,b){return b?[0,g(a,b[1])]:0}function -sk(a,b){return 0===b[0]?[0,g(a,b[1])]:b}function -at(a){if(0<=a&&c1>=a)return a;return P(sl)}function -sv(a,b){return a-b|0}function -kd(a,b){return 0===sv(a,b)?1:0}function -sm(a){a:{if(40<=a){if(92===a)return sn;if(cB>a)break a}else{if(32<=a){if(39<=a)return so;break a}if(14>a)switch(a){case -8:return sp;case -9:return sq;case -10:return sr;case -13:return ss}}var -b=ap(4);ao(b,0,92);ao(b,1,48+(a/gP|0)|0);ao(b,2,48+((a/10|0)%10|0)|0);ao(b,3,48+(a%10|0)|0);return hs(b)}var -c=ap(1);ao(c,0,a);return hs(c)}function -st(a){return 25>>0?a:a+32|0}function -su(a){return 25>>0?a:a+nE|0}function -sw(a){return a0(fx(q0,a),sx)}function -sy(a){var +d=b[2],e=b[1];try{dJ(e)}catch(f){var +c=an(f);if(c[1]!==ky)throw i(c,0)}b=d}}(NR(0))}],kF=[0,function(a){return}];function +hO(a){g(kF[1],0);return g(j_(hN),0)}ks(o1,hO);function +eC(a){return dJ(a)}function +sK(a,b){return Nk(a,b)?a:b}var +sL=-2147483648,sN=es(sM),sP=es(sO),sR=es(sQ);function +sS(a){return a?sT:sU}function +sX(a){return sV(ke("%.12g",a))}function +s0(a,b,c,d){if(0<=c&&0<=d&&(aR(b)-d|0)>=c)return NO(a,b,c,d);return O(s1)}function +s2(c){for(;;){var +a=j_(hN);let +d=[0,1],e=a;var +b=1-j9(hN,a,function(a){if(j9(d,1,0))g(c,0);return g(e,0)});if(!b)return b}}function +s3(a,b){st(a,b);return}var +hP=N2(0),eD=(4*hP|0)-1|0;function +kG(a){return 1-(typeof +a==="number"?1:0)}function +kH(a,b,c){return j9(a,b,c)}function +eE(a){return j_(a)}function +eF(a){return[0,a]}function +s4(a,b){return M0(a,b)}function +hQ(a,b){return b?[0,g(a,b[1])]:0}function +s5(a,b){return 0===b[0]?[0,g(a,b[1])]:b}function +au(a){if(0<=a&&c_>=a)return a;return O(s6)}function +te(a,b){return a-b|0}function +kI(a,b){return 0===te(a,b)?1:0}function +s7(a){a:{if(40<=a){if(92===a)return s8;if(cK>a)break a}else{if(32<=a){if(39<=a)return s9;break a}if(14>a)switch(a){case +8:return s_;case +9:return s$;case +10:return ta;case +13:return tb}}var +b=am(4);al(b,0,92);al(b,1,48+(a/g3|0)|0);al(b,2,48+((a/10|0)%10|0)|0);al(b,3,48+(a%10|0)|0);return hI(b)}var +c=am(1);al(c,0,a);return hI(c)}function +tc(a){return 25>>0?a:a+32|0}function +td(a){return 25>>0?a:a-32|0}function +tf(a){return a7(fI(rD,a),tg)}function +th(a){var b=0<=a?1:0,c=b?a<=55295?1:0:b;if(c)var d=c;else var -e=57344<=a?1:0,d=e?a<=od?1:0:e;return d}function -hE(a){return sy(a)?a:P(sw(a))}function -Q(a){return a<<24|qy}function -bo(a){return a}function -bE(a){return a}function -sz(a){return 1===(a>>>27|0)?1:0}function -sA(a){return(a>>>24|0)&7}function -sB(a){return a&16777215}function -sC(a,b){return(8|a)<<24|b}function -sD(a,b){var +e=57344<=a?1:0,d=e?a<=oS?1:0:e;return d}function +hR(a){return th(a)?a:O(tf(a))}function +Q(a){return a<<24|ra}function +br(a){return a}function +bH(a){return a}function +ti(a){return 1===(a>>>27|0)?1:0}function +tj(a){return(a>>>24|0)&7}function +tk(a){return a&16777215}function +tl(a,b){return(8|a)<<24|b}function +tm(a,b){var d=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function -ke(a){return sD(0,a)}function -dF(a,b){var +kJ(a){return tm(0,a)}function +eG(a,b){var c=a,d=b;for(;;){if(!c)return d;var e=[0,c[1],d];c=c[2];d=e}}function -a6(a){return dF(a,0)}function -kf(a,b,c){if(b<=a)return 0;var -d=g(c,a);return[0,d,kf(a+1|0,b,c)]}function -sE(a){return a?a[1]:fH(sF)}function -sG(a,b,c,d){var -f=a,e=b;for(;;){if(c<=e)return f;f=[0,g(d,e),f];e=e+1|0}}function -kg(a){if(!a)return 0;var -b=a[1];return hz(b,kg(a[2]))}function -eu(a,b){if(!b)return 0;var -c=b[2],d=g(a,b[1]);return[0,d,eu(a,c)]}function -kh(e,b){return function(a,b){var +bI(a){return eG(a,0)}function +tp(a,b,c){if(b>1,s=h(r,b),D=s[1],t=h(a-r|0,s[2]),E=t[2];return[0,A(D,t[1],0),E]}var -a=ke(b);return 2<=a?h(a,b)[1]:b}function -kk(a,b){return a<=b?a:b}function -kl(a,b){return b<=a?a:b}function -km(a){return e+a}function -sN(a,b){return jW(a,b)}function -db(a,b){var -c=ap(a);L_(c,0,a,b);return c}var -fL=ap(0);function -kn(a){var -b=aR(a),c=ap(b);b6(a,0,c,0,b);return c}function -fM(a,b,c){if(0<=b&&0<=c&&(aR(a)-c|0)>=b){var -d=ap(c);b6(a,b,d,0,c);return d}return P(sP)}function -dG(a,b,c){return hs(fM(a,b,c))}function -ko(a,b,c,d,e){if(0<=e&&0<=b&&(aR(a)-e|0)>=b&&0<=d&&(aR(c)-e|0)>=d){b6(a,b,c,d,e);return}return P(sQ)}function -cq(a,b,c,d,e){if(0<=e&&0<=b&&(m(a)-e|0)>=b&&0<=d&&(aR(c)-e|0)>=d){c7(a,b,c,d,e);return}return P(sR)}function -kp(a){var +a=kJ(b);return 2<=a?h(a,b)[1]:b}function +kO(a,b){return a<=b?a:b}function +tB(a,b){return km(a,b)}function +tC(a,b){return b<=a?a:b}function +tD(a){return e+a}function +dj(a,b){var +c=am(a);Ng(c,0,a,b);return c}var +fT=am(0);function +tE(a){var +b=aR(a),c=am(b);b$(a,0,c,0,b);return c}function +fU(a,b,c){if(0<=b&&0<=c&&(aR(a)-c|0)>=b){var +d=am(c);b$(a,b,d,0,c);return d}return O(tG)}function +dL(a,b,c){return hI(fU(a,b,c))}function +kP(a,b,c,d,e){if(0<=e&&0<=b&&(aR(a)-e|0)>=b&&0<=d&&(aR(c)-e|0)>=d){b$(a,b,c,d,e);return}return O(tH)}function +cc(a,b,c,d,e){if(0<=e&&0<=b&&(m(a)-e|0)>=b&&0<=d&&(aR(c)-e|0)>=d){de(a,b,c,d,e);return}return O(tI)}function +kQ(a){var b=a-9|0;a:{if(4>>0){if(23!==b)break a}else if(2===b)break a;return 1}return 0}function -kq(a,b){var +kR(a,b){var d=aR(b);if(0===d)return b;var -e=ap(d),f=d-1|0,h=0;if(f>=0){var -c=h;for(;;){ao(e,c,g(a,c9(b,c)));var +e=am(d),f=d-1|0,h=0;if(f>=0){var +c=h;for(;;){al(e,c,g(a,cU(b,c)));var i=c+1|0;if(f===c)break;c=i}}return e}function -fN(a,b,c){dC(a,b,c);return}function -cQ(a,b){return sC(a,bE(b))}function -bW(a){return 2!==(a>>>6|0)?1:0}function -sX(a){return 5!==(a>>>5|0)?1:0}function -sY(a){return 4!==(a>>>5|0)?1:0}function -sZ(a){var -b=a>>4|0)?1:0}function -s1(a,b){return(a&31)<<6|b&63}function -hF(a,b,c){return(a&15)<<12|(b&63)<<6|c&63}function -hG(a,b,c,d){return(a&7)<<18|(b&63)<<12|(c&63)<<6|d&63}function -dc(a){return c8(a)}function -bf(a){return hs(a)}function -sO(a){return kn(c8(a))}function -sS(a,b){var -c=aR(a),e=aR(b),d=ap(c+e|0);b6(a,0,d,0,c);b6(b,0,d,c,e);return d}function -sT(a){var -d=aR(a),b=[0,0];for(;;){if(b[1]>=d)break;if(!kp(c9(a,b[1])))break;b[1]++}var -c=[0,d-1|0];for(;;){if(b[1]<=c[1]&&kp(c9(a,c[1]))){c[1]--;continue}return b[1]<=c[1]?fM(a,b[1],(c[1]-b[1]|0)+1|0):fL}}function -sU(a){var +fV(a,b,c){cw(a,b,c);return}function +cY(a,b){return tl(a,bH(b))}function +b3(a){return 2!==(a>>>6|0)?1:0}function +tQ(a){return 5!==(a>>>5|0)?1:0}function +tR(a){return 4!==(a>>>5|0)?1:0}function +tS(a){var +b=a>>4|0)?1:0}function +tU(a,b){return(a&31)<<6|b&63}function +hS(a,b,c){return(a&15)<<12|(b&63)<<6|c&63}function +hT(a,b,c,d){return(a&7)<<18|(b&63)<<12|(c&63)<<6|d&63}function +cZ(a){return df(a)}function +a8(a){return hI(a)}function +tF(a){return tE(df(a))}function +tJ(a,b){var +c=aR(a),e=aR(b),d=am(c+e|0);b$(a,0,d,0,c);b$(b,0,d,c,e);return d}function +tK(a){var +d=aR(a),b=[0,0];for(;;){if(b[1]>=d)break;if(!kQ(cU(a,b[1])))break;b[1]++}var +c=[0,d-1|0];for(;;){if(b[1]<=c[1]&&kQ(cU(a,c[1]))){c[1]--;continue}return b[1]<=c[1]?fU(a,b[1],(c[1]-b[1]|0)+1|0):fT}}function +tL(a){var b=[0,0],j=aR(a)-1|0,l=0;if(j>=0){var g=l;for(;;){var -e=c9(a,g);a:{b:{c:{if(32<=e){var +e=cU(a,g);a:{b:{c:{if(32<=e){var h=e-34|0;if(58>>0){if(93<=h)break c}else if(56>>0)break b;var i=1;break a}if(11<=e){if(13===e)break b}else if(8<=e)break b}var i=4;break a}var i=2}b[1]=b[1]+i|0;var -o=g+1|0;if(j===g)break;g=o}}if(b[1]===aR(a))return kn(a);var -c=ap(b[1]);b[1]=0;var +o=g+1|0;if(j===g)break;g=o}}if(b[1]===aR(a))return a;var +c=am(b[1]);b[1]=0;var k=aR(a)-1|0,m=0;if(k>=0){var f=m;for(;;){var -d=c9(a,f);a:{b:{c:{if(35<=d){if(92!==d){if(cB<=d)break c;break b}}else{if(32>d){if(14<=d)break c;switch(d){case -8:ao(c,b[1],92);b[1]++;ao(c,b[1],98);break a;case -9:ao(c,b[1],92);b[1]++;ao(c,b[1],116);break a;case -10:ao(c,b[1],92);b[1]++;ao(c,b[1],110);break a;case -13:ao(c,b[1],92);b[1]++;ao(c,b[1],114);break a;default:break c}}if(34>d)break b}ao(c,b[1],92);b[1]++;ao(c,b[1],d);break a}ao(c,b[1],92);b[1]++;ao(c,b[1],48+(d/gP|0)|0);b[1]++;ao(c,b[1],48+((d/10|0)%10|0)|0);b[1]++;ao(c,b[1],48+(d%10|0)|0);break a}ao(c,b[1],d)}b[1]++;var +d=cU(a,f);a:{b:{c:{if(35<=d){if(92!==d){if(cK<=d)break c;break b}}else{if(32>d){if(14<=d)break c;switch(d){case +8:al(c,b[1],92);b[1]++;al(c,b[1],98);break a;case +9:al(c,b[1],92);b[1]++;al(c,b[1],116);break a;case +10:al(c,b[1],92);b[1]++;al(c,b[1],110);break a;case +13:al(c,b[1],92);b[1]++;al(c,b[1],114);break a;default:break c}}if(34>d)break b}al(c,b[1],92);b[1]++;al(c,b[1],d);break a}al(c,b[1],92);b[1]++;al(c,b[1],48+(d/g3|0)|0);b[1]++;al(c,b[1],48+((d/10|0)%10|0)|0);b[1]++;al(c,b[1],48+(d%10|0)|0);break a}al(c,b[1],d)}b[1]++;var n=f+1|0;if(k===f)break;f=n}}return c}function -sV(a){return kq(su,a)}function -sW(a){return kq(st,a)}function -s2(a,b){var -e=ft(a,b);function -c(a,b){return c9(a,b)}var -d=aR(a)-1|0;a:{if(ef<=e){if(g3<=e){if(pF<=e)break a;switch(e-237|0){case +tM(a){return kR(td,a)}function +tN(a){return kR(tc,a)}function +tO(a,b){return M_(a,b)}function +tP(a,b,c){M$(a,b,c);return}function +tV(a,b){var +e=fE(a,b);function +c(a,b){return cU(a,b)}var +d=aR(a)-1|0;a:{if(eo<=e){if(he<=e){if(jU<=e)break a;switch(e-237|0){case 0:var f=b+1|0;if(de){var +B=c(a,A);return b3(B)?Q(3):cY(4,hT(e,y,z,B))}}else if(q1>e){var n=b+1|0;if(de)return cQ(1,e);if(o3<=e){var +t=c(a,s);return b3(t)?Q(2):cY(3,hS(e,r,t))}if(M>e)return cY(1,e);if(pE<=e){var J=b+1|0;if(dd)throw i([0,t,s5],1);if(cB>=d){fN(a,b,d);return 1}if(iP>=d){var -j=b+1|0;return f>>6|0),e(a,j,M|d&63),2)}if(py>=d){var -h=b+2|0;return f>>12|0),e(a,b+1|0,M|(d>>>6|0)&63),e(a,h,M|d&63),3)}if(od>>18|0),e(a,b+1|0,M|(d>>>12|0)&63),e(a,b+2|0,M|(d>>>6|0)&63),e(a,g,M|d&63),4)}function -ew(a,b){return bf(db(a,b))}function -fO(a,b,c){return bf(fM(dc(a),b,c))}function -s6(a,b){return b<=a?a:P(s7)}function -s8(a,b,c){var +K=c(a,J);return b3(K)?Q(1):cY(2,tU(e,K))}}return Q(1)}function +tW(a,b,c){function +e(a,b,c){al(a,b,c);return}var +f=aR(a)-1|0,d=br(c);if(0>d)throw i([0,u,tY],1);if(cK>=d){fV(a,b,d);return 1}if(jc>=d){var +j=b+1|0;return f>>6|0),e(a,j,M|d&63),2)}if(qb>=d){var +h=b+2|0;return f>>12|0),e(a,b+1|0,M|(d>>>6|0)&63),e(a,h,M|d&63),3)}if(oS>>18|0),e(a,b+1|0,M|(d>>>12|0)&63),e(a,b+2|0,M|(d>>>6|0)&63),e(a,g,M|d&63),4)}function +eJ(a,b){return a8(dj(a,b))}function +fW(a,b,c){return a8(fU(cZ(a),b,c))}function +tZ(a,b){return b<=a?a:O(t0)}function +t1(a,b,c){var e=a,d=c;for(;;){if(!d)return e;var f=d[1];if(!d[2])return m(f)+e|0;var -g=d[2];e=s6((m(f)+b|0)+e|0,e);d=g}}function -s9(a,b,c,d,e){var +g=d[2];e=tZ((m(f)+b|0)+e|0,e);d=g}}function +t2(a,b,c,d,e){var h=b,g=e;for(;;){if(!g)return a;var -f=g[1];if(!g[2]){c7(f,0,a,h,m(f));return a}var -i=g[2];c7(f,0,a,h,m(f));c7(c,0,a,h+m(f)|0,d);h=(h+m(f)|0)+d|0;g=i}}function -hH(a,b){if(!b)return s_;var -c=m(a);return bf(s9(ap(s8(0,c,b)),0,a,c,b))}function -kr(a){var +f=g[1];if(!g[2]){de(f,0,a,h,m(f));return a}var +i=g[2];de(f,0,a,h,m(f));de(c,0,a,h+m(f)|0,d);h=(h+m(f)|0)+d|0;g=i}}function +hU(a,b){if(!b)return t3;var +c=m(a);return a8(t2(am(t1(0,c,b)),0,a,c,b))}function +kS(a){var b=a-9|0;a:{if(4>>0){if(23!==b)break a}else if(2===b)break a;return 1}return 0}function -ks(a,b,c,d){var -e=c;for(;;){if(b<=e)throw i(bD,1);if(bd(a,e)===d)return e;e=e+1|0}}function -te(a,b,c){var -d=m(a);if(0<=b&&d>=b)try{ks(a,d,b,c);var +kT(a,b,c,d){var +e=c;for(;;){if(b<=e)throw i(bG,1);if(a6(a,e)===d)return e;e=e+1|0}}function +t9(a,b,c){var +d=m(a);if(0<=b&&d>=b)try{kT(a,d,b,c);var f=1;return f}catch(f){var -e=aj(f);if(e===bD)return 0;throw i(e,0)}return P(tf)}function -hI(a){return bf(sW(dc(a)))}function -kt(a,b){var +e=an(f);if(e===bG)return 0;throw i(e,0)}return O(t_)}function +hV(a){return a8(tN(cZ(a)))}function +kU(a,b){var d=[0,0],e=[0,m(b)],f=m(b)-1|0;if(f>=0){var -c=f;for(;;){if(bd(b,c)===a){var -h=d[1];d[1]=[0,fO(b,c+1|0,(e[1]-c|0)-1|0),h];e[1]=c}var +c=f;for(;;){if(a6(b,c)===a){var +h=d[1];d[1]=[0,fW(b,c+1|0,(e[1]-c|0)-1|0),h];e[1]=c}var i=c-1|0;if(0===c)break;c=i}}var -g=d[1];return[0,fO(b,0,e[1]),g]}function -hJ(a,b){return bC(a,b)}function -ku(a,b){return a==b?1:0}function -s$(a,b){var +g=d[1];return[0,fW(b,0,e[1]),g]}function +hW(a,b){return bE(a,b)}function +fX(a,b){return tO(cZ(a),b)}function +kV(a,b){return a==b?1:0}function +t4(a,b){var d=m(b)-1|0,e=0;if(d>=0){var -c=e;for(;;){g(a,bd(b,c));var +c=e;for(;;){g(a,a6(b,c));var f=c+1|0;if(d===c)break;c=f}}return}function -ta(a){if(a==e)return a;if(!kr(bd(a,0))&&!kr(bd(a,m(a)-1|0)))return a;return bf(sT(dc(a)))}function -tb(a){return function(a,b,c){var -d=c;for(;;){if(b<=d)return a;var -e=bd(a,d)+nE|0;a:{if(59>>0){if(33>>0)break a}else if(2===e)break a;d=d+1|0;continue}return bf(sU(dc(a)))}}(a,m(a),0)}function -tc(a,b,c){var -d=m(a);if(0<=b&&d>=b)return ks(a,d,b,c);return P(td)}function -tg(a,b){return te(a,0,b)}function -th(a){return bf(sV(dc(a)))}function -ti(a,b){return s2(dc(a),b)}function -kv(a,b){var +t5(a){if(a==e)return a;if(!kS(a6(a,0))&&!kS(a6(a,m(a)-1|0)))return a;return a8(tK(cZ(a)))}function +t6(a){return a8(tL(cZ(a)))}function +t7(a,b,c){var +d=m(a);if(0<=b&&d>=b)return kT(a,d,b,c);return O(t8)}function +t$(a,b){return t9(a,0,b)}function +ua(a){return a8(tM(cZ(a)))}function +ub(a,b){return tV(cZ(a),b)}function +kW(a,b){var d=b.length-1;if(0===d)return[0];var -e=cM(d,g(a,b[1])),f=d-1|0,h=1;if(f>=1){var +e=cx(d,g(a,b[1])),f=d-1|0,h=1;if(f>=1){var c=h;for(;;){e[1+c]=g(a,b[1+c]);var i=c+1|0;if(f===c)break;c=i}}return e}function -ts(a,b){var +ul(a,b){var d=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function -hK(a){if(!a)return[0];var -b=a[2],c=a[1],e=cM(ts(0,a),c);return function(a,b){var +hX(a){if(!a)return[0];var +b=a[2],c=a[1],e=cx(ul(0,a),c);return function(a,b){var d=a,c=b;for(;;){if(!c)return e;var f=c[2];e[1+d]=c[1];d=d+1|0;c=f}}(1,b)}var -hL=[J,tu,aZ(0)];function -tj(a,b){if(0===a)return[0];if(0>a)return P(tk);var -d=cM(a,g(b,0)),e=a-1|0,f=1;if(e>=1){var +hY=[L,un,a5(0)];function +uc(a,b){if(0===a)return[0];if(0>a)return O(ud);var +d=cx(a,g(b,0)),e=a-1|0,f=1;if(e>=1){var c=f;for(;;){d[1+c]=g(b,c);var h=c+1|0;if(e===c)break;c=h}}return d}function -tl(a,b,c,d){if(0<=b&&0<=c&&(a.length-1-c|0)>=b){LW(a,b,c,d);return}return P(tm)}function -tn(a,b,c,d,e){if(0<=e&&0<=b&&(a.length-1-e|0)>=b&&0<=d&&(c.length-1-e|0)>=d){LV(a,b,c,d,e);return}return P(to)}function -tp(a,b){var +ue(a,b,c,d){if(0<=b&&0<=c&&(a.length-1-c|0)>=b){MZ(a,b,c,d);return}return O(uf)}function +ug(a,b,c,d,e){if(0<=e&&0<=b&&(a.length-1-e|0)>=b&&0<=d&&(c.length-1-e|0)>=d){MY(a,b,c,d,e);return}return O(uh)}function +ui(a,b){var d=b.length-2|0,e=0;if(d>=0){var c=e;for(;;){g(a,b[1+c]);var f=c+1|0;if(d===c)break;c=f}}return}function -tq(a,b,c){var -e=b.length-1;if(e!==c.length-1)return P(tr);if(0===e)return[0];var -f=cM(e,j(a,b[1],c[1])),g=e-1|0,h=1;if(g>=1){var +uj(a,b,c){var +e=b.length-1;if(e!==c.length-1)return O(uk);if(0===e)return[0];var +f=cx(e,j(a,b[1],c[1])),g=e-1|0,h=1;if(g>=1){var d=h;for(;;){f[1+d]=j(a,b[1+d],c[1+d]);var i=d+1|0;if(g===d)break;d=i}}return f}function -tt(a,b,c){var +um(a,b,c){var e=[0,b],f=c.length-2|0,g=0;if(f>=0){var d=g;for(;;){e[1]=j(a,e[1],c[1+d]);var h=d+1|0;if(f===d)break;d=h}}return e[1]}function -tv(f,d){function +uo(f,d){function h(a,b){var c=((b+b|0)+b|0)+1|0,e=[0,c];if((c+2|0)j(f,o(d,c)[1+c],p))return c+1|0}if(cj(f,p(d,c)[1+c],o))return c+1|0}if(c=j(f,o(d,g)[1+g],c)){o(d,e)[1+e]=c;return}var -i=o(d,g)[1+g];o(d,e)[1+e]=i;e=g}}function +g=h(a,e);if(0>=j(f,p(d,g)[1+g],c)){p(d,e)[1+e]=c;return}var +i=p(d,g)[1+g];p(d,e)[1+e]=i;e=g}}function m(a,b){var c=b;for(;;){var -e=h(a,c),f=o(d,e)[1+e];o(d,c)[1+c]=f;c=e}}var +e=h(a,c),f=p(d,e)[1+e];p(d,c)[1+c]=f;c=e}}var c=d.length-1,e=((c+1|0)/3|0)-1|0;function l(a,b,c){try{k(a,b,c);return}catch(f){var -e=aj(f);if(e[1]!==hL)throw i(e,0);var -g=e[2];o(d,g)[1+g]=c;return}}function +e=an(f);if(e[1]!==hY)throw i(e,0);var +g=e[2];p(d,g)[1+g]=c;return}}function n(a,b){try{var d=m(a,b);return d}catch(f){var -c=aj(f);if(c[1]===hL)return c[2];throw i(c,0)}}function -p(a,b){var +c=an(f);if(c[1]===hY)return c[2];throw i(c,0)}}function +o(a,b){var c=a;for(;;){var -e=(c-1|0)/3|0;if(c===e)throw i([0,t,tw],1);if(0<=j(f,o(d,e)[1+e],b)){o(d,c)[1+c]=b;return}var -g=o(d,e)[1+e];o(d,c)[1+c]=g;if(0>=e){o(d,0)[1]=b;return}c=e}}if(e>=0){var -b=e;for(;;){l(c,b,o(d,b)[1+b]);var -u=b-1|0;if(0===b)break;b=u}}var +e=(c-1|0)/3|0;if(c===e)throw i([0,u,up],1);if(0<=j(f,p(d,e)[1+e],b)){p(d,c)[1+c]=b;return}var +g=p(d,e)[1+e];p(d,c)[1+c]=g;if(0>=e){p(d,0)[1]=b;return}c=e}}if(e>=0){var +b=e;for(;;){l(c,b,p(d,b)[1+b]);var +t=b-1|0;if(0===b)break;b=t}}var g=c-1|0;if(g>=2){var a=g;for(;;){var -r=o(d,a)[1+a];d[1+a]=o(d,0)[1];p(n(a,0),r);var +r=p(d,a)[1+a];d[1+a]=p(d,0)[1];o(n(a,0),r);var s=a-1|0;if(2===a)break;a=s}}if(1=i){var -v=i<=g?g+1|0:i+1|0;return[0,a,b,c,v]}if(!c)return P(tF);var -k=c[3],m=c[2],f=c[1],r=h(f);if(r<=h(k))return d(d(a,b,f),m,k);if(!f)return P(tE);var +v=i<=g?g+1|0:i+1|0;return[0,a,b,c,v]}if(!c)return O(uy);var +k=c[3],m=c[2],f=c[1],r=h(f);if(r<=h(k))return d(d(a,b,f),m,k);if(!f)return O(ux);var s=f[2],t=f[1],u=d(f[3],m,k);return d(d(a,b,t),s,u)}function c(a,b){if(!b)return[0,0,a,0,1];var d=b[3],e=b[2],g=b[1],h=j(f[1],a,e);if(0===h)return b;if(0<=h){var @@ -1445,37 +1509,37 @@ c(a,b){if(3>=a>>>0)switch(a){case f=b[2];if(f)return[0,[0,[0,0,b[1],0,1],f[1],0,2],f[2]]}break;default:if(b){var g=b[2];if(g){var h=g[2];if(h)return[0,[0,[0,0,b[1],0,1],g[1],[0,0,h[1],0,1],2],h[2]]}}}var -j=a/2|0,k=c(j,b),e=k[2],m=k[1];if(!e)throw i([0,t,tG],1);var -n=e[1],l=c((a-j|0)-1|0,e[2]),o=l[2];return[0,d(m,n,l[1]),o]}return c(ke(a),a)[1]}return[0,,,,c,,,,,,,,,,,,,l,,,,,,,,,,,,,e,m,,,,,,,,function(a){return n(0,a)},,,,,,,,,,,function(a,b){var +j=a/2|0,k=c(j,b),e=k[2],m=k[1];if(!e)throw i([0,u,uz],1);var +n=e[1],l=c((a-j|0)-1|0,e[2]),o=l[2];return[0,d(m,n,l[1]),o]}return c(kJ(a),a)[1]}return[0,,,,c,,,,,,,,,,,,,l,,,,,,,,,,,,,e,m,,,,,,,,function(a){return n(0,a)},,,,,,,,,,,function(a,b){var c=b;for(;;){if(!c)return;var -d=c[2],e=c[3],f=c[1];if(g(a,d))return o(d,a,e);c=f}},,,,,,,function(a){if(!a)return l;var +d=c[2],e=c[3],f=c[1];if(g(a,d))return o(d,a,e);c=f}},,,,,,,,function(a){if(!a)return l;var g=a[2],d=a[1];if(!g)return b(d);var h=g[2],e=g[1];if(!h)return c(e,b(d));var i=h[2],j=h[1];if(!i)return c(j,c(e,b(d)));var -k=i[2],m=i[1];if(!k)return c(m,c(j,c(e,b(d))));if(k[2])return p(sM(f[1],a));var +k=i[2],m=i[1];if(!k)return c(m,c(j,c(e,b(d))));if(k[2])return p(tA(f[1],a));var n=k[1];return c(n,c(m,c(j,c(e,b(d)))))}]}function -kx(a){var -b=tB(a);return[0,b[17],,,b[4],,,,,,,,,b[30],b[31],,,,,,,,,b[39],,,,,,,,,,,,,b[50],b[57]]}function -tH(d){function +kY(a){var +b=uu(a);return[0,b[17],b[4],,,,,,,,b[39],,,,,,,,,,,,b[50],b[31],,,,,,,,,,,b[30],,,,b[58]]}function +uA(d){function h(a){return a?a[5]:0}function e(a,b,c,d){var e=h(a),f=h(d),g=f<=e?e+1|0:f+1|0;return[0,a,b,c,d,g]}function q(a,b){return[0,0,a,b,0,1]}function f(a,b,c,d){var -i=a?a[5]:0,j=d?d[5]:0;if((j+2|0)=j){var -A=j<=i?i+1|0:j+1|0;return[0,a,b,c,d,A]}if(!d)return P(tL);var -l=d[4],o=d[3],p=d[2],g=d[1],v=h(g);if(v<=h(l))return e(e(a,b,c,g),p,o,l);if(!g)return P(tK);var +A=j<=i?i+1|0:j+1|0;return[0,a,b,c,d,A]}if(!d)return O(uE);var +l=d[4],o=d[3],p=d[2],g=d[1],v=h(g);if(v<=h(l))return e(e(a,b,c,g),p,o,l);if(!g)return O(uD);var w=g[3],x=g[2],y=g[1],z=e(g[4],p,o,l);return e(e(a,b,c,y),x,w,z)}function n(a,b,c){if(!c)return[0,0,a,b,0,1];var e=c[4],h=c[3],i=c[2],g=c[1],o=c[5],k=j(d[1],a,i);if(0===k)return h===b?c:[0,g,a,b,e,o];if(0<=k){var l=n(a,b,e);return e===l?c:f(g,i,h,l)}var m=n(a,b,g);return g===m?c:f(m,i,h,e)}function r(a){var -b=a;for(;;){if(!b)throw i(bD,1);var +b=a;for(;;){if(!b)throw i(bG,1);var c=b[1];if(!c)return[0,b[2],b[3]];b=c}}function -c(a){if(!a)return P(tM);var +c(a){if(!a)return O(uF);var b=a[1];if(!b)return a[4];var d=a[4],e=a[3],g=a[2];return f(c(b),g,e,d)}function y(a,b){if(!a)return b;if(!b)return a;var @@ -1492,9 +1556,9 @@ c=b;for(;;){if(!c)return;var d=c[4],e=c[3],f=c[2];s(a,c[1]);j(a,f,e);c=d}}function p(a,b){if(!b)return 0;var c=b[2],d=b[5],e=b[4],f=b[3],g=p(a,b[1]),h=j(a,c,f);return[0,g,c,h,p(a,e),d]}function -u(a,b,c){var +t(a,b,c){var d=b,e=c;for(;;){if(!d)return e;var -f=d[4],g=d[3],h=d[2],i=bN(a,h,g,u(a,d[1],e));d=f;e=i}}function +f=d[4],g=d[3],h=d[2],i=bT(a,h,g,t(a,d[1],e));d=f;e=i}}function v(a,b,c){if(!c)return q(a,b);var d=c[4],e=c[3],g=c[2];return f(v(a,b,c[1]),g,e,d)}function w(a,b,c){if(!c)return q(a,b);var @@ -1504,123 +1568,150 @@ g=d[5],h=a[5],i=d[4],j=d[3],l=d[2],m=d[1],n=a[4],o=a[3],p=a[2],q=a[1];return(g+2 z(a,b){if(!a)return b;if(!b)return a;var d=r(b),e=d[2],f=d[1];return k(a,f,e,c(b))}function x(a,b,c,d){return c?k(a,b,c[1],d):z(a,d)}function -m(a,b){if(!b)return tN;var +m(a,b){if(!b)return uG;var c=b[4],e=b[3],f=b[2],g=b[1],l=j(d[1],a,f);if(0===l)return[0,g,[0,e],c];if(0<=l){var h=m(a,c),n=h[3],o=h[2];return[0,k(g,f,e,h[1]),o,n]}var i=m(a,g),p=i[2],q=i[1];return[0,q,p,k(i[3],f,e,c)]}function l(a,b,c){if(b){var d=b[2],j=b[5],k=b[4],n=b[3],o=b[1];if(h(c)<=j){var -e=m(d,c),p=e[2],q=e[1],r=l(a,k,e[3]),s=bN(a,d,[0,n],p);return x(l(a,o,q),d,s,r)}}else if(!c)return 0;if(!c)throw i([0,t,tO],1);var -f=c[2],u=c[4],v=c[3],w=c[1],g=m(f,b),y=g[2],z=g[1],A=l(a,g[3],u),B=bN(a,f,y,[0,v]);return x(l(a,z,w),f,B,A)}return[0,,,,,0,,n,function(a,b){var -c=b;for(;;){if(!c)throw i(bD,1);var +e=m(d,c),p=e[2],q=e[1],r=l(a,k,e[3]),s=bT(a,d,[0,n],p);return x(l(a,o,q),d,s,r)}}else if(!c)return 0;if(!c)throw i([0,u,uH],1);var +f=c[2],t=c[4],v=c[3],w=c[1],g=m(f,b),y=g[2],z=g[1],A=l(a,g[3],t),B=bT(a,f,y,[0,v]);return x(l(a,z,w),f,B,A)}return[0,,,,,0,,n,function(a,b){var +c=b;for(;;){if(!c)throw i(bG,1);var f=c[4],g=c[1],e=j(d[1],a,c[2]);if(0===e)return;var h=0<=e?f:g;c=h}},,,,,,,,,function(a,b){var c=b;for(;;){if(!c)return 0;var f=c[4],g=c[3],h=c[1],e=j(d[1],a,c[2]);if(0===e)return[0,g];var -i=0<=e?f:h;c=i}},,,,,,,,o,s,,p,u,,,,,,,,,l]}function -ky(a){var -b=tH(a);return[0,b[5],,,b[7],b[25],,,b[38],,,,b[26],b[29],,,,,,,,,,,,,,,b[8],b[17],,,,,,b[28]]}function -ex(a){return[0,0,0]}function -ey(a){a[1]=0;a[2]=0;return}function -dd(a,b){b[1]=[0,a,b[1]];b[2]=b[2]+1|0;return 0}function -dH(a){var +i=0<=e?f:h;c=i}},,,,,,,,o,,s,,p,t,,,,,,,,,l]}function +kZ(a){var +b=uA(a);return[0,b[5],b[7],,b[25],,,b[39],,,,,,,,,,b[8],b[17],,,,,b[27],b[30],,b[29]]}function +eK(a){return[0,0,0]}function +eL(a){a[1]=0;a[2]=0;return}function +dk(a,b){b[1]=[0,a,b[1]];b[2]=b[2]+1|0;return 0}function +dM(a){var b=a[1];if(!b)return 0;var c=b[1];a[1]=b[2];a[2]=a[2]-1|0;return[0,c]}function -dI(a){var +dN(a){var b=a[1];return b?[0,b[1]]:0}function -tP(a,b){return fK(a,b[1])}var -tR=[J,tQ,aZ(0)];function -kz(a){return[0,0,0,0]}function -hN(a){a[1]=0;a[2]=0;a[3]=0;return}function -hO(a,b){var +uI(a,b){return eH(a,b[1])}var +uK=[L,uJ,a5(0)];function +k0(a){return[0,0,0,0]}function +h0(a){a[1]=0;a[2]=0;a[3]=0;return}function +h1(a,b){var c=[0,a,0],d=b[3];return d?(b[1]=b[1]+1|0,d[2]=c,b[3]=c,0):(b[1]=1,b[2]=c,b[3]=c,0)}function -kA(a){var +k1(a){var b=a[2];if(!b)return 0;var c=b[1];if(b[2]){var -d=b[2];a[1]=a[1]-1|0;a[2]=d;return[0,c]}hN(a);return[0,c]}function -kB(a){return a[1]}function -tS(a){var +d=b[2];a[1]=a[1]-1|0;a[2]=d;return[0,c]}h0(a);return[0,c]}function +k2(a){return a[1]}function +uL(a){var b=a[2];return b?[0,b[1]]:0}function -tT(a){var -b=a[2];if(!b)throw i(tR,1);if(b[2]){var -c=b[2];a[1]=a[1]-1|0;a[2]=c;return}hN(a);return}function -bX(a){var -b=1<=a?a:1,c=et=(d+b|0))break;c[1]=2*c[1]|0}if(eta[3])throw i([0,t,tZ],1);if((d+b|0)<=a[3])return;throw i([0,t,tY],1)}function -p(a,b){var -c=a[2];if(a[3]<=c)eA(a,1);ao(a[1],c,b);a[2]=c+1|0;return 0}var -kC=4;function -kD(a,b){for(;;){var -c=a[2];if(a[3]<=c)eA(a,kC);var -d=s3(a[1],c,b);if(0!==d){a[2]=c+d|0;return}eA(a,kC)}}function -eB(a,b,c,d){var +uM(a){var +b=a[2];if(!b)throw i(uK,1);if(b[2]){var +c=b[2];a[1]=a[1]-1|0;a[2]=c;return}h0(a);return}function +bs(a){var +b=1<=a?a:1,c=eD=(d+b|0))break;c[1]=2*c[1]|0}if(eD=b)return dG(a[1],b,c);return P(tV)}function -tW(a){return a[2]}function -tX(a){a[2]=0;a[1]=a[4];a[3]=aR(a[1]);return}function -t2(a,b,c,d){return eB(a,bf(b),c,d)}function -hP(a){return 5===a[2]?12:-6}function -kE(a){return[0,0,ap(a)]}function -kF(a,b){var +c=m(b),d=a[2],e=a[1],f=d+c|0,g=e[1];if(e[2]=b)return dL(a[1][1],b,c);return O(uO)}function +uP(a){a[2]=0;a[1]=[0,a[3],aR(a[3])];return}function +uS(a,b,c,d){return dP(a,a8(b),c,d)}var +h2=[0,0];function +k6(a){return a}function +k7(a){return a!==h2?1:0}function +k8(a){return a}(function(a){Nd(cx(8,h2));return}(0));var +uT=eF(0),k9=eF(0);function +uU(a){for(;;){var +b=eE(k9),c=1-kH(k9,b,[0,a,b]);if(!c)return c}}function +cz(a,b){var +c=[0,s4(uT,1),b];if(a)uU([0,c,a[1]]);return c}function +k_(d){for(;;){var +a=sd(0),b=a.length-1;if(de){if(32!==e){if(43>e)break a;switch(e-43|0){case -5:c:if(c<(d+2|0)&&1e){if(32!==e){if(43>e)break a;switch(e-43|0){case +5:c:if(c<(d+2|0)&&1=(d+1|0))break a;var -f=db(d+1|0,48);dC(f,0,e);cq(b,1,f,(d-c|0)+2|0,c-1|0);return bf(f)}if(71<=e){if(5>>0)break a}else if(65>e)break a}if(c>>0)break a}else if(65>e)break a}if(ca)return b;var +14:return wt;default:return wC}}function +le(a,b){var +d=eA(b),e=u0(wD,a),c=la(16);dQ(c,37);u1(c,a);dQ(c,46);a0(c,tD(d));dQ(c,e);return lc(c)}function +f0(a,b){if(13>a)return b;var h=[0,0],i=m(b)-1|0,o=0;if(i>=0){var -d=o;for(;;){if(9>=bd(b,d)+fo>>>0)h[1]++;var +d=o;for(;;){if(9>=a6(b,d)+fy>>>0)h[1]++;var r=d+1|0;if(i===d)break;d=r}}var -j=h[1],k=ap(m(b)+((j-1|0)/3|0)|0),l=[0,0];function -e(a){dC(k,l[1],a);l[1]++;return}var +j=h[1],k=am(m(b)+((j-1|0)/3|0)|0),l=[0,0];function +e(a){cw(k,l[1],a);l[1]++;return}var f=[0,((j-1|0)%3|0)+1|0],n=m(b)-1|0,p=0;if(n>=0){var c=p;for(;;){var -g=bd(b,c);if(9>>0)e(g);else{if(0===f[1]){e(95);f[1]=3}f[1]--;e(g)}var -q=c+1|0;if(n===c)break;c=q}}return bf(k)}function -vH(a,b){return fR(a,fx(uO(a),b))}function -vI(a,b){return fR(a,fx(ve(a),b))}function -vJ(a,b){return fR(a,fx(vs(a),b))}function -vK(a,b){return fR(a,Mm(u2(a),b))}function -cs(d,b,c){function +g=a6(b,c);if(9>>0)e(g);else{if(0===f[1]){e(95);f[1]=3}f[1]--;e(g)}var +q=c+1|0;if(n===c)break;c=q}}return a8(k)}function +wE(a,b){return f0(a,fI(vL(a),b))}function +wF(a,b){return f0(a,fI(wb(a),b))}function +wG(a,b){return f0(a,fI(wp(a),b))}function +wH(a,b){return f0(a,Nu(vZ(a),b))}function +cA(d,b,c){function a(a){switch(d[1]){case 0:var e=45;break;case 1:var e=43;break;default:var -e=32}return Mi(c,b,e)}function +e=32}return Nq(c,b,e)}function e(a){var -b=jM(c);return 3===b?c<0.?vM:vN:4<=b?vO:a}function +b=kb(c);return 3===b?c<0.?wJ:wK:4<=b?wL:a}function f(b){var e=m(b);return function(a){var c=a;for(;;){if(c===e)return 0;var -d=X(b,c)-46|0;a:{if(23>>0){if(55===d)break a}else if(21>>0)break a;c=c+1|0;continue}return 1}}(0)?b:a0(b,vL)}switch(d[2]){case -5:return e(f(jP(kI(d,b),c)));case +d=ai(b,c)-46|0;a:{if(23>>0){if(55===d)break a}else if(21>>0)break a;c=c+1|0;continue}return 1}}(0)?b:a7(b,wI)}switch(d[2]){case +5:return e(f(ke(le(d,b),c)));case 6:return a(0);case -7:return th(a(0));case -8:return e(a(0));default:return jP(kI(d,b),c)}}function -vP(a){var -b=sm(a),c=m(b),d=db(c+2|0,39);c7(b,0,d,1,c);return bf(d)}function -vQ(a){var -b=kE(16);hQ(b,a);return kG(b)}function -e5(a,b,c,d){var +7:return ua(a(0));case +8:return e(a(0));default:return ke(le(d,b),c)}}function +wM(a){var +b=s7(a),c=m(b),d=dj(c+2|0,39);de(b,0,d,1,c);return a8(d)}function +wN(a){var +b=la(16);h5(b,a);return lc(b)}function +fe(a,b,c,d){var h=b,f=c,e=d;for(;;){if(typeof e==="number")return g(h,f);switch(e[0]){case 0:var -q=e[1];return function(a){return I(h,[5,f,a],q)};case +q=e[1];return function(a){return G(h,[5,f,a],q)};case 1:var -r=e[1];return function(a){return I(h,[4,f,vP(a)],r)};case -2:return hR(h,f,e[2],e[1],function(a){return a});case -3:return hR(h,f,e[2],e[1],uN);case -4:return fS(h,f,e[4],e[2],e[3],vH,e[1]);case -5:return fS(h,f,e[4],e[2],e[3],vI,e[1]);case -6:return fS(h,f,e[4],e[2],e[3],vJ,e[1]);case -7:return fS(h,f,e[4],e[2],e[3],vK,e[1]);case -8:return vR(h,f,e[4],e[2],e[3],e[1]);case -9:return hR(h,f,e[2],e[1],r5);case +r=e[1];return function(a){return G(h,[4,f,wM(a)],r)};case +2:return h6(h,f,e[2],e[1],function(a){return a});case +3:return h6(h,f,e[2],e[1],vK);case +4:return f1(h,f,e[4],e[2],e[3],wE,e[1]);case +5:return f1(h,f,e[4],e[2],e[3],wF,e[1]);case +6:return f1(h,f,e[4],e[2],e[3],wG,e[1]);case +7:return f1(h,f,e[4],e[2],e[3],wH,e[1]);case +8:return wO(h,f,e[4],e[2],e[3],e[1]);case +9:return h6(h,f,e[2],e[1],sS);case 10:f=[7,f];e=e[1];break;case 11:f=[2,f,e[1]];e=e[2];break;case 12:f=[3,f,e[1]];e=e[2];break;case 13:var -s=e[3],u=vQ(e[2]);return function(a){return I(h,[4,f,u],s)};case +s=e[3],t=wN(e[2]);return function(a){return G(h,[4,f,t],s)};case 14:var -v=e[3],w=e[2];return function(a){return I(h,f,ak(uM(a[1],w),v))};case +w=e[3],x=e[2];return function(a){return G(h,f,aj(vJ(a[1],x),w))};case 15:var -x=e[1];return function(c,b){return I(h,[6,f,function(a){return j(c,a,b)}],x)};case +y=e[1];return function(c,b){return G(h,[6,f,function(a){return j(c,a,b)}],y)};case 16:var -z=e[1];return function(a){return I(h,[6,f,a],z)};case +z=e[1];return function(a){return G(h,[6,f,a],z)};case 17:f=[0,f,e[1]];e=e[2];break;case 18:var k=e[1];if(0===k[0]){let -b=f,c=h,d=e[2];h=function(a){return I(c,[1,b,[0,a]],d)};f=0;e=k[1][1]}else{let -b=f,c=h,d=e[2];h=function(a){return I(c,[1,b,[1,a]],d)};f=0;e=k[1][1]}break;case -19:throw i([0,t,vT],1);case +b=f,c=h,d=e[2];h=function(a){return G(c,[1,b,[0,a]],d)};f=0;e=k[1][1]}else{let +b=f,c=h,d=e[2];h=function(a){return G(c,[1,b,[1,a]],d)};f=0;e=k[1][1]}break;case +19:throw i([0,u,wQ],1);case 20:var -A=e[3],B=[8,f,vU];return function(a){return I(h,B,A)};case +A=e[3],B=[8,f,wR];return function(a){return G(h,B,A)};case 21:var -C=e[2];return function(a){return I(h,[4,f,fx(m_,a)],C)};case +C=e[2];return function(a){return G(h,[4,f,fI(nP,a)],C)};case 22:var -D=e[1];return function(a){return I(h,[5,f,a],D)};case +D=e[1];return function(a){return G(h,[5,f,a],D)};case 23:var -l=e[2],m=e[1];return a<50?mE(a+1|0,h,f,m,l):y(mE,[0,h,f,m,l]);default:var -n=e[3],o=e[1],p=g(e[2],0);return a<50?iH(a+1|0,h,f,n,o,p):y(iH,[0,h,f,n,o,p])}}}function -I(a,b,c){return cO(e5(0,a,b,c))}function -mE(a,b,c,d,e){if(typeof +l=e[2],m=e[1];return a<50?nj(a+1|0,h,f,m,l):v(nj,[0,h,f,m,l]);default:var +n=e[3],o=e[1],p=g(e[2],0);return a<50?i6(a+1|0,h,f,n,o,p):v(i6,[0,h,f,n,o,p])}}}function +G(a,b,c){return cq(fe(0,a,b,c))}function +nj(a,b,c,d,e){if(typeof d==="number")switch(d){case -0:return a<50?Z(a+1|0,b,c,e):y(Z,[0,b,c,e]);case -1:return a<50?Z(a+1|0,b,c,e):y(Z,[0,b,c,e]);case -2:throw i([0,t,vV],1);default:return a<50?Z(a+1|0,b,c,e):y(Z,[0,b,c,e])}switch(d[0]){case -0:return a<50?Z(a+1|0,b,c,e):y(Z,[0,b,c,e]);case -1:return a<50?Z(a+1|0,b,c,e):y(Z,[0,b,c,e]);case -2:return a<50?Z(a+1|0,b,c,e):y(Z,[0,b,c,e]);case -3:return a<50?Z(a+1|0,b,c,e):y(Z,[0,b,c,e]);case -4:return a<50?Z(a+1|0,b,c,e):y(Z,[0,b,c,e]);case -5:return a<50?Z(a+1|0,b,c,e):y(Z,[0,b,c,e]);case -6:return a<50?Z(a+1|0,b,c,e):y(Z,[0,b,c,e]);case -7:return a<50?Z(a+1|0,b,c,e):y(Z,[0,b,c,e]);case -8:return a<50?Z(a+1|0,b,c,e):y(Z,[0,b,c,e]);case +0:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case +1:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case +2:throw i([0,u,wS],1);default:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e])}switch(d[0]){case +0:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case +1:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case +2:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case +3:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case +4:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case +5:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case +6:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case +7:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case +8:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);case 9:var -f=d[2];return a<50?iI(a+1|0,b,c,f,e):y(iI,[0,b,c,f,e]);case -10:return a<50?Z(a+1|0,b,c,e):y(Z,[0,b,c,e]);default:return a<50?Z(a+1|0,b,c,e):y(Z,[0,b,c,e])}}function -iI(a,f,c,d,e){if(typeof -d==="number")return a<50?Z(a+1|0,f,c,e):y(Z,[0,f,c,e]);switch(d[0]){case +f=d[2];return a<50?i7(a+1|0,b,c,f,e):v(i7,[0,b,c,f,e]);case +10:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e]);default:return a<50?Z(a+1|0,b,c,e):v(Z,[0,b,c,e])}}function +i7(a,f,c,d,e){if(typeof +d==="number")return a<50?Z(a+1|0,f,c,e):v(Z,[0,f,c,e]);switch(d[0]){case 0:var -b=d[1];return function(a){return bF(f,c,b,e)};case +b=d[1];return function(a){return bL(f,c,b,e)};case 1:var -g=d[1];return function(a){return bF(f,c,g,e)};case +g=d[1];return function(a){return bL(f,c,g,e)};case 2:var -h=d[1];return function(a){return bF(f,c,h,e)};case +h=d[1];return function(a){return bL(f,c,h,e)};case 3:var -j=d[1];return function(a){return bF(f,c,j,e)};case +j=d[1];return function(a){return bL(f,c,j,e)};case 4:var -k=d[1];return function(a){return bF(f,c,k,e)};case +k=d[1];return function(a){return bL(f,c,k,e)};case 5:var -l=d[1];return function(a){return bF(f,c,l,e)};case +l=d[1];return function(a){return bL(f,c,l,e)};case 6:var -m=d[1];return function(a){return bF(f,c,m,e)};case +m=d[1];return function(a){return bL(f,c,m,e)};case 7:var -n=d[1];return function(a){return bF(f,c,n,e)};case +n=d[1];return function(a){return bL(f,c,n,e)};case 8:var -o=d[2];return function(a){return bF(f,c,o,e)};case +o=d[2];return function(a){return bL(f,c,o,e)};case 9:var -p=d[3],q=d[2],r=aN(aE(d[1]),q);return function(a){return bF(f,c,be(r,p),e)};case +p=d[3],q=d[2],r=aN(aE(d[1]),q);return function(a){return bL(f,c,bf(r,p),e)};case 10:var -s=d[1];return function(a,b){return bF(f,c,s,e)};case +s=d[1];return function(a,b){return bL(f,c,s,e)};case 11:var -u=d[1];return function(a){return bF(f,c,u,e)};case +t=d[1];return function(a){return bL(f,c,t,e)};case 12:var -v=d[1];return function(a){return bF(f,c,v,e)};case -13:throw i([0,t,vW],1);default:throw i([0,t,vX],1)}}function -bF(a,b,c,d){return cO(iI(0,a,b,c,d))}function +w=d[1];return function(a){return bL(f,c,w,e)};case +13:throw i([0,u,wT],1);default:throw i([0,u,wU],1)}}function +bL(a,b,c,d){return cq(i7(0,a,b,c,d))}function Z(a,b,c,d){var -e=[8,c,vY];return a<50?e5(a+1|0,b,e,d):y(e5,[0,b,e,d])}function -hR(h,f,c,d,e){if(typeof -d==="number")return function(a){return I(h,[4,f,g(e,a)],c)};if(0===d[0]){var -b=d[2],i=d[1];return function(a){return I(h,[4,f,bq(i,b,g(e,a))],c)}}var -j=d[1];return function(a,b){return I(h,[4,f,bq(j,a,g(e,b))],c)}}function -fS(k,i,h,d,e,f,g){if(typeof +e=[8,c,wV];return a<50?fe(a+1|0,b,e,d):v(fe,[0,b,e,d])}function +h6(h,f,c,d,e){if(typeof +d==="number")return function(a){return G(h,[4,f,g(e,a)],c)};if(0===d[0]){var +b=d[2],i=d[1];return function(a){return G(h,[4,f,bu(i,b,g(e,a))],c)}}var +j=d[1];return function(a,b){return G(h,[4,f,bu(j,a,g(e,b))],c)}}function +f1(k,i,h,d,e,f,g){if(typeof d==="number"){if(typeof -e==="number")return e?function(a,b){return I(k,[4,i,dK(a,j(f,g,b))],h)}:function(a){return I(k,[4,i,j(f,g,a)],h)};var -b=e[1];return function(a){return I(k,[4,i,dK(b,j(f,g,a))],h)}}if(0===d[0]){var +e==="number")return e?function(a,b){return G(k,[4,i,dR(a,j(f,g,b))],h)}:function(a){return G(k,[4,i,j(f,g,a)],h)};var +b=e[1];return function(a){return G(k,[4,i,dR(b,j(f,g,a))],h)}}if(0===d[0]){var c=d[2],l=d[1];if(typeof -e==="number")return e?function(a,b){return I(k,[4,i,bq(l,c,dK(a,j(f,g,b)))],h)}:function(a){return I(k,[4,i,bq(l,c,j(f,g,a))],h)};var -n=e[1];return function(a){return I(k,[4,i,bq(l,c,dK(n,j(f,g,a)))],h)}}var +e==="number")return e?function(a,b){return G(k,[4,i,bu(l,c,dR(a,j(f,g,b)))],h)}:function(a){return G(k,[4,i,bu(l,c,j(f,g,a))],h)};var +n=e[1];return function(a){return G(k,[4,i,bu(l,c,dR(n,j(f,g,a)))],h)}}var m=d[1];if(typeof -e==="number")return e?function(a,b,c){return I(k,[4,i,bq(m,a,dK(b,j(f,g,c)))],h)}:function(a,b){return I(k,[4,i,bq(m,a,j(f,g,b))],h)};var -o=e[1];return function(a,b){return I(k,[4,i,bq(m,a,dK(o,j(f,g,b)))],h)}}function -vR(i,h,g,d,e,f){if(typeof +e==="number")return e?function(a,b,c){return G(k,[4,i,bu(m,a,dR(b,j(f,g,c)))],h)}:function(a,b){return G(k,[4,i,bu(m,a,j(f,g,b))],h)};var +o=e[1];return function(a,b){return G(k,[4,i,bu(m,a,dR(o,j(f,g,b)))],h)}}function +wO(i,h,g,d,e,f){if(typeof d==="number"){if(typeof -e==="number")return e?function(a,b){return I(i,[4,h,cs(f,a,b)],g)}:function(a){return I(i,[4,h,cs(f,hP(f),a)],g)};var -b=e[1];return function(a){return I(i,[4,h,cs(f,b,a)],g)}}if(0===d[0]){var +e==="number")return e?function(a,b){return G(i,[4,h,cA(f,a,b)],g)}:function(a){return G(i,[4,h,cA(f,h4(f),a)],g)};var +b=e[1];return function(a){return G(i,[4,h,cA(f,b,a)],g)}}if(0===d[0]){var c=d[2],j=d[1];if(typeof -e==="number")return e?function(a,b){return I(i,[4,h,bq(j,c,cs(f,a,b))],g)}:function(a){return I(i,[4,h,bq(j,c,cs(f,hP(f),a))],g)};var -l=e[1];return function(a){return I(i,[4,h,bq(j,c,cs(f,l,a))],g)}}var +e==="number")return e?function(a,b){return G(i,[4,h,bu(j,c,cA(f,a,b))],g)}:function(a){return G(i,[4,h,bu(j,c,cA(f,h4(f),a))],g)};var +l=e[1];return function(a){return G(i,[4,h,bu(j,c,cA(f,l,a))],g)}}var k=d[1];if(typeof -e==="number")return e?function(a,b,c){return I(i,[4,h,bq(k,a,cs(f,b,c))],g)}:function(a,b){return I(i,[4,h,bq(k,a,cs(f,hP(f),b))],g)};var -m=e[1];return function(a,b){return I(i,[4,h,bq(k,a,cs(f,m,b))],g)}}function -iH(a,b,c,d,e,f){if(e){var -i=e[1];return function(a){return vS(b,c,d,i,g(f,a))}}var -h=[4,c,f];return a<50?e5(a+1|0,b,h,d):y(e5,[0,b,h,d])}function -vS(a,b,c,d,e){return cO(iH(0,a,b,c,d,e))}function -ct(a,b){var +e==="number")return e?function(a,b,c){return G(i,[4,h,bu(k,a,cA(f,b,c))],g)}:function(a,b){return G(i,[4,h,bu(k,a,cA(f,h4(f),b))],g)};var +m=e[1];return function(a,b){return G(i,[4,h,bu(k,a,cA(f,m,b))],g)}}function +i6(a,b,c,d,e,f){if(e){var +i=e[1];return function(a){return wP(b,c,d,i,g(f,a))}}var +h=[4,c,f];return a<50?fe(a+1|0,b,h,d):v(fe,[0,b,h,d])}function +wP(a,b,c,d,e){return cq(i6(0,a,b,c,d,e))}function +cB(a,b){var c=b;for(;;){if(typeof c==="number")return;switch(c[0]){case 0:var -f=c[1],h=kH(c[2]);ct(a,f);return es(a,h);case +f=c[1],h=ld(c[2]);cB(a,f);return eB(a,h);case 1:var d=c[2],e=c[1];if(0===d[0]){var -i=d[1];ct(a,e);es(a,vZ);c=i}else{var -j=d[1];ct(a,e);es(a,v0);c=j}break;case +i=d[1];cB(a,e);eB(a,wW);c=i}else{var +j=d[1];cB(a,e);eB(a,wX);c=j}break;case 6:var -m=c[2];ct(a,c[1]);return g(m,a);case -7:ct(a,c[1]);return fJ(a);case +m=c[2];cB(a,c[1]);return g(m,a);case +7:cB(a,c[1]);return eC(a);case 8:var -n=c[2];ct(a,c[1]);return P(n);case +n=c[2];cB(a,c[1]);return O(n);case 2:case 4:var -k=c[2];ct(a,c[1]);return es(a,k);default:var -l=c[2];ct(a,c[1]);return sf(a,l)}}}function -cu(a,b){var +k=c[2];cB(a,c[1]);return eB(a,k);default:var +l=c[2];cB(a,c[1]);return s3(a,l)}}}function +cC(a,b){var c=b;for(;;){if(typeof c==="number")return;switch(c[0]){case 0:var -f=c[1],h=kH(c[2]);cu(a,f);return aD(a,h);case +f=c[1],h=ld(c[2]);cC(a,f);return aD(a,h);case 1:var d=c[2],e=c[1];if(0===d[0]){var -i=d[1];cu(a,e);aD(a,v1);c=i}else{var -j=d[1];cu(a,e);aD(a,v2);c=j}break;case +i=d[1];cC(a,e);aD(a,wY);c=i}else{var +j=d[1];cC(a,e);aD(a,wZ);c=j}break;case 6:var -m=c[2];cu(a,c[1]);return aD(a,g(m,0));case +m=c[2];cC(a,c[1]);return aD(a,g(m,0));case 7:c=c[1];break;case 8:var -n=c[2];cu(a,c[1]);return P(n);case +n=c[2];cC(a,c[1]);return O(n);case 2:case 4:var -k=c[2];cu(a,c[1]);return aD(a,k);default:var -l=c[2];cu(a,c[1]);return p(a,l)}}}function -v3(a){var -c=a[1],b=bX(cn);return I(function(a){cu(b,a);return fH(bY(b))},0,c)}function -kJ(c){if(c==e)return v4;var +k=c[2];cC(a,c[1]);return aD(a,k);default:var +l=c[2];cC(a,c[1]);return o(a,l)}}}function +w0(a){var +c=a[1],b=bs(cu);return G(function(a){cC(b,a);return fR(bJ(b))},0,c)}function +lf(c){if(c==e)return w1;var f=m(c);function -j(a){return g(v3(v5),c)}function +j(a){return g(w0(w2),c)}function k(a){var b=a;for(;;){if(b===f)return b;var -d=X(c,b);if(9!==d&&32!==d)return b;b=b+1|0}}var +d=ai(c,b);if(9!==d&&32!==d)return b;b=b+1|0}}var h=k(0),o=function(a,b){var -d=b;for(;;){if(d===f)return d;if(25>>0)return d;d=d+1|0}}(h,h),a=fO(c,h,o-h|0),d=k(o),l=function(a,b){var +d=b;for(;;){if(d===f)return d;if(25>>0)return d;d=d+1|0}}(h,h),a=fW(c,h,o-h|0),d=k(o),l=function(a,b){var d=b;for(;;){if(d===f)return d;var -e=X(c,d);a:{if(48<=e){if(58>e)break a}else if(45===e)break a;return d}d=d+1|0}}(d,d);if(d===l)var +e=ai(c,d);a:{if(48<=e){if(58>e)break a}else if(45===e)break a;return d}d=d+1|0}}(d,d);if(d===l)var n=0;else try{var -r=Mv(fO(c,d,l-d|0)),n=r}catch(f){var -p=aj(f);if(p[1]!==eq)throw i(p,0);var +r=ND(fW(c,d,l-d|0)),n=r}catch(f){var +p=an(f);if(p[1]!==ez)throw i(p,0);var q=j(0),n=q}if(k(l)!==f)j(0);a:{if(a!==e&&a!==aJ){if(a===U){var b=0;break a}if(a==="hov"){var -b=3;break a}if(a===oq){var +b=3;break a}if(a===o6){var b=2;break a}if(a!==aX){var b=j(0);break a}var b=1;break a}var b=4}return[0,n,b]}function -v6(d,b,c){return I(function(a){ct(b,a);return g(d,b)},0,c[1])}function -hS(a,b){return v6(function(a){return 0},a,b)}function -fT(a){return hS(cj,a)}function -kK(c,b){return I(function(a){var -b=bX(64);cu(b,a);return g(c,bY(b))},0,b[1])}function -ae(a){return kK(function(a){return a},a)}var -hT=hv(0);function -hV(a,b){var -c=a[1+b];return kc(c)?en(c)===ec?g(ae(v7),c):en(c)===nq?r_(c):v8:g(ae(v9),c)}function -kL(a,b){if(a.length-1<=b)return v_;var -c=kL(a,b+1|0),d=hV(a,b);return j(ae(v$),d,c)}function -wa(a){var +w3(d,b,c){return G(function(a){cB(b,a);return g(d,b)},0,c[1])}function +h7(a,b){return w3(function(a){return 0},a,b)}function +f2(a){return h7(b2,a)}function +lg(c,b){return G(function(a){var +b=bs(64);cC(b,a);return g(c,bJ(b))},0,b[1])}function +X(a){return lg(function(a){return a},a)}var +h8=eF(0);function +h_(a,b){var +c=a[1+b];return kG(c)?fM(c)===el?g(X(w4),c):fM(c)===n6?sX(c):w5:g(X(w6),c)}function +lh(a,b){if(a.length-1<=b)return w7;var +c=lh(a,b+1|0),d=h_(a,b);return j(X(w8),d,c)}function +w9(a){var b=a.length-1;if(2>=b>>>0)switch(b){case -0:return wc;case -1:return wd;default:var -e=hV(a,1);return g(ae(we),e)}var -c=kL(a,2),d=hV(a,1);return j(ae(wb),d,c)}function -wf(d){return function(a){var +0:return w$;case +1:return xa;default:var +e=h_(a,1);return g(X(xb),e)}var +c=lh(a,2),d=h_(a,1);return j(X(w_),d,c)}function +xc(d){return function(a){var b=a;for(;;){if(!b)return 0;var e=b[2],f=b[1];a:{try{var -c=g(f,d)}catch(f){break a}if(c)return[0,c[1]]}b=e}}(fG(hT))}function -wg(a){if(a===hy)return wh;if(a===j8)return wi;if(a[1]===j7){var -b=a[2],e=b[3],h=b[2],i=b[1];return du(ae(hU),i,h,e,e+5|0,wj)}if(a[1]===t){var -c=a[2],f=c[3],j=c[2],k=c[1];return du(ae(hU),k,j,f,f+6|0,wk)}if(a[1]===j_){var -d=a[2],g=d[3],l=d[2],m=d[1];return du(ae(hU),m,l,g,g+6|0,wl)}if(0!==en(a))return a[1];var -n=a[1][1];return a0(n,wa(a))}function -fU(a){var -b=wf(a);return b?b[1]:wg(a)}function -wm(a){var -b=[0,L6(a)];return b}function -wn(c,b){function -a(a){return a?0===c?wo:wp:0===c?wq:wr}if(0===b[0]){var -d=b[5],e=b[4],f=b[3],h=b[6]?ws:wu,i=b[2],j=b[7],k=a(b[1]);return[0,LR(ae(wt),k,j,i,h,f,e,d)]}if(b[1])return 0;var -l=a(0);return[0,g(ae(wv),l)]}function -ww(a,b){if(!b)return hS(a,wy);var +c=g(f,d)}catch(f){break a}if(c)return[0,c[1]]}b=e}}(eE(h8))}function +xd(a){if(0!==fM(a))return[0,a[1],0];var +b=a[1][1];return[0,b,[0,w9(a)]]}function +xe(a){var +b=xd(a),c=b[2],d=b[1];return c?a7(d,c[1]):d}function +xf(a){if(a===hL)return xg;if(a===kx)return xh;if(a[1]===kw){var +b=a[2],e=b[3],h=b[2],i=b[1];return dA(X(h9),i,h,e,e+5|0,xi)}if(a[1]===u){var +c=a[2],f=c[3],j=c[2],k=c[1];return dA(X(h9),k,j,f,f+6|0,xj)}if(a[1]!==kz)return xe(a);var +d=a[2],g=d[3],l=d[2],m=d[1];return dA(X(h9),m,l,g,g+6|0,xk)}function +f3(a){var +b=xc(a);return b?b[1]:xf(a)}function +xl(a){var +b=[0,Na(a)];return b}function +xm(c,b){function +a(a){return a?0===c?xn:xo:0===c?xp:xq}if(0!==b[0]){if(b[1])return 0;var +p=a(0);return[0,g(X(xw),p)]}if(b[3]===b[6])var +e=b[3],d=g(X(xr),e);else +var +n=b[6],o=b[3],d=j(X(xv),o,n);var +f=b[7],h=b[4],i=b[8]?xs:xu,k=b[2],l=b[9],m=a(b[1]);return[0,MU(X(xt),m,l,k,i,d,h,f)]}function +xx(a,b){if(!b)return h7(a,xz);var d=b[1],e=d.length-2|0,h=0;if(e>=0){var c=h;for(;;){var -f=wn(c,o(d,c)[1+c]);if(f){var -i=f[1];g(hS(a,wx),i)}var +f=xm(c,p(d,c)[1+c]);if(f){var +i=f[1];g(h7(a,xy),i)}var j=c+1|0;if(e===c)break;c=j}}return}function -hW(a,b){return ww(a,wm(b))}var -wB=wA.slice();function -wC(a,b){var -e=fU(a);g(fT(wD),e);hW(cj,b);var -c=MF(0);if(c<0){var -d=er(c);kb(o(wB,d)[1+d])}return fJ(cj)}var -wE=[0];function -kM(a){var -b=Mb(0);return b}function -wF(a,b){try{var -d=b?wE:kM(0);try{hB(0)}catch(f){}try{var -f=wC(a,d),e=f}catch(f){var -h=aj(f),j=kM(0),k=fU(a);g(fT(wH),k);hW(cj,d);var -l=fU(h);g(fT(wI),l);hW(cj,j);var -e=fJ(cj)}return e}catch(f){var -c=aj(f);if(c===hy)return kb(wG);throw i(c,0)}}j3(q_,function(a,b){try{var -c=wF(a,b);return c}catch(f){return 0}});function -wz(a){for(;;){var -b=fG(hT),c=1-hw(hT,b,[0,a,b]);if(!c)return c}}var -wL=[J,wK,aZ(0)];wz(function(a){return a[1]===wL?[0,a0(wM,fU(a[2]))]:0});function -wJ(a,b,c){return j(a,c,b)}function -wN(a){return MD(a,0,m(a))}function -kN(a){return[0,cM(55,0),0]}function -wO(a,b){tn(b[1],0,a[1],0,55);a[2]=b[2];return}function -kO(a,b){function -k(a,b){return wN(a0(a,km(b)))}function -l(a){var -b=X(a,3)<<24,c=X(a,2)<<16,d=X(a,1)<<8;return((X(a,0)+d|0)+c|0)+b|0}var -g=0===b.length-1?[0,0]:b,h=g.length-1,c=0;for(;;){o(a[1],c)[1+c]=c;var -s=c+1|0;if(54===c)break;c=s}var -f=[0,wP],i=54+kl(55,h)|0,m=0;if(i>=0){var -d=m;for(;;){var -e=d%55|0,j=MM(d,h),n=o(g,j)[1+j];f[1]=k(f[1],n);var -p=l(f[1]),q=(o(a[1],e)[1+e]^p)&jp;o(a[1],e)[1+e]=q;var -r=d+1|0;if(i===d)break;d=r}}a[2]=0;return}function -wQ(a){var -b=kN(0);kO(b,a);return b}function -kP(a){return wQ(rP(0))}function -wR(a){var -b=kN(0);wO(b,a);return b}function -wS(a){a[2]=(a[2]+1|0)%55|0;var -b=a[2],c=o(a[1],b)[1+b],d=(a[2]+24|0)%55|0,e=(o(a[1],d)[1+d]+(c^(c>>>25|0)&31)|0)&jp,f=a[2];o(a[1],f)[1+f]=e;return e}var -kQ=[0,wT.slice(),0];function -wU(a){return kO(kQ,a)}function -wV(a){return wU(rP(0))}function -wW(a){return wR(kQ)}function -wX(a){var +h$(a,b){return xx(a,xl(b))}var +xC=xB.slice();function +xD(a,b){var +e=f3(a);g(f2(xE),e);h$(b2,b);var +c=NN(0);if(c<0){var +d=eA(c);kE(p(xC,d)[1+d])}return eC(b2)}var +xF=[0];function +li(a){var +b=Nj(0);return b}function +xG(a,b){try{var +d=b?xF:li(0);try{hO(0)}catch(f){}try{var +f=xD(a,d),e=f}catch(f){var +h=an(f),j=li(0),k=f3(a);g(f2(xI),k);h$(b2,d);var +l=f3(h);g(f2(xJ),l);h$(b2,j);var +e=eC(b2)}return e}catch(f){var +c=an(f);if(c===hL)return kE(xH);throw i(c,0)}}ks(rN,function(a,b){try{var +c=xG(a,b);return c}catch(f){return 0}});function +xA(a){for(;;){var +b=eE(h8),c=1-kH(h8,b,[0,a,b]);if(!c)return c}}var +xM=[L,xL,a5(0)];xA(function(a){return a[1]===xM?[0,a7(xN,f3(a[2]))]:0});function +xK(a,b,c){return j(a,c,b)}function +ia(a){var +b=a[1]<1?1:0,c=b||(64=0){var +c=i;for(;;){tP(d,c*8|0,fJ(p(b,c)[1+c]));var +m=c+1|0;if(f===c)break;c=m}}cw(d,e*8|0,1);var +g=lj(d);cw(d,e*8|0,2);var +h=lj(d),j=fX(h,8),k=fX(h,0),l=fX(g,8);return ll(a,fX(g,0),l,k,j)}function +xZ(a){var +b=ib(0);ln(b,a);return b}function +lo(a){return xZ(sC(0))}function +f4(a){return sr(a)}function +xY(a){var +b=ib(0);xX(b,a);return b}function +x0(a){return sn(sr(a))&pW}var +lp=cz([0,function(a){var +b=f4(a),c=f4(a),d=f4(a);return lm(b,c,d,f4(a))}],function(a){return lm(x4,x3,x2,x1)});function +x5(a){return ln(bK(lp),a)}function +x6(a){return x5(sC(0))}function +x7(a){return xY(bK(lp))}function +x8(a){var b=a.length-1<4?1:0,c=b||(a[4]<0?1:0);return c}try{var -LE=rO(q1),kU=LE}catch(f){var -kR=aj(f);if(kR!==bD)throw i(kR,0);try{var -LD=rO("CAMLRUNPARAM"),kT=LD}catch(f){var -kS=aj(f);if(kS!==bD)throw i(kS,0);var -kT=wY}var -kU=kT}var -fV=[iV,function(a){return kP(0)}],wZ=tg(kU,82);function -w0(a,b){var -c=a;for(;;){if(b<=c)return c;if(hC<(c*2|0))return c;c=c*2|0}}function -fW(a,b){var -f=a?a[1]:wZ,c=w0(16,b);if(f)var -d=en(fV),g=fd===d?fV[1]:iV===d?sj(fV):fV,e=wS(g);else -var -e=0;return[0,0,cM(c,0),e,c]}function -w2(l,b,c,d){var -h=d.length-1,f=cM(h,0),i=c.length-2|0;function +MH=sB(rE),lt=MH}catch(f){var +lq=an(f);if(lq!==bG)throw i(lq,0);try{var +MG=sB("CAMLRUNPARAM"),ls=MG}catch(f){var +lr=an(f);if(lr!==bG)throw i(lr,0);var +ls=x9}var +lt=ls}var +x_=eF(t$(lt,82)),x$=cz(0,lo);function +ya(a,b){var +c=a;for(;;){if(b<=c)return c;if(hP<(c*2|0))return c;c=c*2|0}}function +f5(a,b){var +d=a?a[1]:eE(x_),c=ya(16,b),e=d?x0(bK(x$)):0;return[0,0,cx(c,0),e,c]}function +yc(l,b,c,d){var +h=d.length-1,f=cx(h,0),i=c.length-2|0;function m(a){var c=a;for(;;){if(!c)return;var -i=c[1],k=c[2],m=c[3],h=b?c:[0,i,k,0],e=g(l,i),j=o(f,e)[1+e];if(j)j[3]=h;else -o(d,e)[1+e]=h;o(f,e)[1+e]=h;c=m}}var +i=c[1],k=c[2],m=c[3],h=b?c:[0,i,k,0],e=g(l,i),j=p(f,e)[1+e];if(j)j[3]=h;else +p(d,e)[1+e]=h;p(f,e)[1+e]=h;c=m}}var n=0;if(i>=0){var -e=n;for(;;){m(o(c,e)[1+e]);var +e=n;for(;;){m(p(c,e)[1+e]);var r=e+1|0;if(i===e)break;e=r}}if(b){var -j=h-1|0,p=0;if(j>=0){var -a=p;for(;;){var -k=o(f,a)[1+a];if(k)k[3]=0;var +j=h-1|0,o=0;if(j>=0){var +a=o;for(;;){var +k=p(f,a)[1+a];if(k)k[3]=0;var q=a+1|0;if(j===a)break;a=q}}}return}function -w3(a,b){var -c=b[2],d=(c.length-1)*2|0,e=d>>0)return;return k0(a,d)}function -xf(a){var -b=kA(a[28]);if(!b)return;var +h=f[3];if(0===dI(f[1],c)){a[1]=a[1]-1|0;if(g){g[3]=h;return}p(a[2],b)[1+b]=h;return}g=f;f=h}}function +yj(a,b){var +c=b;for(;;){if(!c)throw i(bG,1);var +d=c[2],e=c[3];if(0===dI(a,c[1]))return d;c=e}}function +lu(a,b){var +f=eP(a,b),c=p(a[2],f)[1+f];if(!c)throw i(bG,1);var +d=c[3],g=c[2];if(0===dI(b,c[1]))return g;if(!d)throw i(bG,1);var +e=d[3],h=d[2];if(0===dI(b,d[1]))return h;if(!e)throw i(bG,1);var +j=e[2],k=e[3];return 0===dI(b,e[1])?j:yj(b,k)}function +yb(a){var +b=0>>0)return;return lz(a,d)}function +yr(a){var +b=k1(a[28]);if(!b)return;var c=b[1],d=c[1];a[12]=a[12]-c[3]|0;var -e=a7(d);a[9]=a[9]+e|0;return}function -xg(a,b,c){if(typeof +e=a9(d);a[9]=a[9]+e|0;return}function +ys(a,b,c){if(typeof c==="number")switch(c){case 0:var -j=dI(a[3]);if(!j)return;var +j=dN(a[3]);if(!j)return;var k=j[1][1],l=function(a,b){if(!b)return[0,a,0];var -c=b[1],d=b[2];return Mz(a,c)?[0,a,b]:[0,c,l(a,d)]};k[1]=l(a[6]-a[9]|0,k[1]);return;case -1:dH(a[2]);return;case -2:dH(a[3]);return;case +c=b[1],d=b[2];return NH(a,c)?[0,a,b]:[0,c,l(a,d)]};k[1]=l(a[6]-a[9]|0,k[1]);return;case +1:dM(a[2]);return;case +2:dM(a[3]);return;case 3:var -n=dI(a[2]);return n?k0(a,n[1][2]):fZ(a);case +n=dN(a[2]);return n?lz(a,n[1][2]):f8(a);case 4:var -o=a[10]!==(a[6]-a[9]|0)?1:0;return o?xf(a):o;default:var -p=dH(a[5]);if(p)return hX(a,g(a[25],p[1]));return}switch(c[0]){case -0:return kZ(a,b,c[1]);case +o=a[10]!==(a[6]-a[9]|0)?1:0;return o?yr(a):o;default:var +p=dM(a[5]);if(p)return ic(a,g(a[25],p[1]));return}switch(c[0]){case +0:return ly(a,b,c[1]);case 1:var -d=c[2],f=c[1],q=d[1],z=d[2],r=dI(a[2]);if(!r)return;var +d=c[2],f=c[1],q=d[1],z=d[2],r=dN(a[2]);if(!r)return;var s=r[1],e=s[2];switch(s[1]){case -0:return dL(a,f);case -1:return de(a,d,e);case -2:return de(a,d,e);case -3:return a[9]<(b+m(q)|0)?de(a,d,e):dL(a,f);case -4:return a[11]?dL(a,f):a[9]<(b+m(q)|0)?de(a,d,e):((a[6]-e|0)+z|0)=a[14]){a[13]=kY;k1(a);if(b)fZ(a);return xp(a)}h0(a,0)}}function -dM(a,b,c){var -d=a[14]=a[14]){a[13]=lx;lA(a);if(b)f8(a);return yA(a)}ig(a,0)}}function +dT(a,b,c){var +d=a[14]=c)return bN(a[17],k9,0,c);bN(a[17],k9,0,80);c=c-80|0}}function -xC(a){return a[1]===fY?a0(xE,a0(a[2],xD)):xF}function -xG(a){return a[1]===fY?a0(xI,a0(a[2],xH)):xJ}function -xK(a){return 0}function -xL(a){return 0}function -xM(a,b,c,d,e){var -g=kz(0),h=[0,kW,xN,0];hO(h,g);var -f=ex(0);hY(f);dd([0,1,h],f);var -i=78,j=ex(0),k=ex(0),l=ex(0);return[0,f,ex(0),l,k,j,i,10,68,i,0,1,1,1,1,fI,xO,a,b,c,d,e,0,0,xC,xG,xK,xL,g]}function -k$(a,b){var -c=xM(a,b,function(a){return 0},function(a){return 0},function(a){return 0});c[19]=function(a){return xA(c,a)};c[20]=function(a){return k_(c,a)};c[21]=function(a){return k_(c,a)};return c}function -la(d){return k$(function(a,b,c){return sa(d,a,b,c)},function(a){return fJ(d)})}function -eF(d){return k$(function(a,b,c){return eB(d,a,b,c)},function(a){return 0})}var -xP=g0;function -h3(a){return bX(xP)}var -lb=h3(0),lc=la(r$),xQ=la(cj),ld=eF(lb);function -xs(a,b){h1(a,1);return g(a[18],0)}function -xt(a,b){var -c=a[14]=c)return bT(a[17],lL,0,c);bT(a[17],lL,0,80);c=c-80|0}}function +yL(a){return a[1]===f7?a7(yN,a7(a[2],yM)):yO}function +yP(a){return a[1]===f7?a7(yR,a7(a[2],yQ)):yS}function +yT(a){return 0}function +yU(a){return 0}function +ik(a,b,c,d,e){var +g=k0(0),h=[0,lv,yV,0];h1(h,g);var +f=eK(0);id(f);dk([0,1,h],f);var +i=78,j=eK(0),k=eK(0),l=eK(0);return[0,f,eK(0),l,k,j,i,10,68,i,0,1,1,1,1,fS,yW,a,b,c,d,e,0,0,yL,yP,yT,yU,g]}function +lM(a,b){var +c=ik(a,b,function(a){return 0},function(a){return 0},function(a){return 0});c[19]=function(a){return ij(c,a)};c[20]=function(a){return dV(c,a)};c[21]=function(a){return dV(c,a)};return c}function +lN(d){return lM(function(a,b,c){return kD(d,a,b,c)},function(a){return eC(d)})}function +dW(d){return lM(function(a,b,c){return dP(d,a,b,c)},function(a){return 0})}var +il=hb;function +f$(a){return bs(il)}var +lO=f$(0),im=lN(hM),io=lN(b2),lP=dW(lO),ip=cz(0,f$);eN(ip,lO);var +lQ=cz(0,function(a){return dW(bK(ip))});eN(lQ,lP);function +ga(a,b,c,d){return dP(bK(a),b,c,d)}function +gb(a,b,c){var +d=bK(b),e=k3(d);kD(a,bJ(d),0,e);eC(a);return dO(d)}var +gc=cz(0,function(a){return bs(il)}),gd=cz(0,function(a){return bs(il)}),iq=cz(0,function(a){var +b=ik(function(a,b,c){return ga(gc,a,b,c)},function(a){return gb(hM,gc,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return ij(b,a)};b[20]=function(a){return dV(b,a)};b[21]=function(a){return dV(b,a)};k$(function(a){return cD(b,a)});return b});eN(iq,im);var +lR=cz(0,function(a){var +b=ik(function(a,b,c){return ga(gd,a,b,c)},function(a){return gb(b2,gd,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return ij(b,a)};b[20]=function(a){return dV(b,a)};b[21]=function(a){return dV(b,a)};k$(function(a){return cD(b,a)});return b});eN(lR,io);function +yD(a,b){ih(a,1);return g(a[18],0)}function +yE(a,b){var +c=a[14]=0){var -c=h;for(;;){e[c]=g(a,o(b,c)[1+c]);var +l0(a){return a["length"]}function +gg(c,b){return uc(l0(b),function(a){return g(c,b[a])})}function +l1(a,b){var +d=b.length-1,e=it(d),f=d-1|0,h=0;if(f>=0){var +c=h;for(;;){e[c]=g(a,p(b,c)[1+c]);var i=c+1|0;if(f===c)break;c=i}}return e}function -dO(c,b){return sH(ll(b),function(a){return g(c,b[a])})}function -dP(f,b){return function(a,b,c){var +dX(c,b){return tr(l0(b),function(a){return g(c,b[a])})}function +dY(f,b){return function(a,b,c){var e=a,d=c;for(;;){if(!d)return b;var -h=d[2];b[e]=g(f,d[1]);e=e+1|0;d=h}}(0,h6(0),b)}function -yc(a,b){var +h=d[2];b[e]=g(f,d[1]);e=e+1|0;d=h}}(0,it(0),b)}function +zg(a,b){var c=new -C["Error"](b);return a?(c[bR]=a[1],c):c}var -h7=C["Promise"];function -dQ(a){return h7.resolve(a)}function -eI(a,b){return a.then(fA(1,b))}function -ln(a){return h7.all(a)}function -bt(a){return b8(a)}function -aF(a){return bU(a)}function -x9(a,b,c){if(!c)return;a[b]=c[1];return}function -x_(a,b){a[b];return}function -ya(a,b,c){if(c)return x$(a,b,c[1]);return}function -yb(a,b){return a[b]}function -yd(a,b){return g(function(a){throw a},yc(a,b))}function -ye(a){return new -h7(fA(2,function(c,b){return j(a,function(a){return c(a)},function(a){return b(a)})}))}function -yf(a,b,c){return a.then(fA(1,b),fA(1,c))}function -dR(a){return{fut:a}}function -f5(a){return a[jf]}function -yg(a){return a[jf]}function -h8(a){var -c=[0,function(a){throw i([0,t,yh],1)}];function -b(a){return yd(0,"The future is already set")}return[0,dR(ye(function(a,b){c[1]=a;return 0})),function(a){g(c[1],a);c[1]=b;return 0}]}function -eJ(a){return dR(dQ(a))}function -eK(a,b){return dR(eI(f5(a),function(a){return f5(g(b,a))}))}function -dh(c,b){return eK(b,function(a){return eJ(g(c,a))})}function -lo(a,b){var -c=f5(a);return dR(function(a){return eI(c,a)}(function(c){var -d=f5(b);return function(a){return eI(d,a)}(function(a){return dQ([0,c,a])})}))}function -f6(a){return dR(eI(ln(dP(yg,a)),function(a){return dQ(dO(function(a){return a},a))}))}function -eL(a){return eJ([0,a])}function -yi(d,b,c){return dR(yf(c,function(a){return dQ([0,g(d,a)])},function(a){return dQ([1,g(b,a)])}))}function -lp(a,b){return yi(a,function(a){return a},b)}function -eM(a,b){return dh(b,a)}function -bG(c,b){return function(a){return eK(c,a)}(function(a){return 0===a[0]?g(b,a[1]):eJ(a)})}function -bu(a,b){return dh(function(a){return sk(b,a)},a)}C["Event"];function -eN(a,b,c,d){var -e=a?a[1]:{};d.addEventListener(b,fA(1,c),e);return}C["ArrayBuffer"];C["DataView"];function -yj(a){return a["currentTarget"]}C["Blob"];C["File"];var -lq=C[hc];function -lr(a){return lq.stringify(a)}function -h9(a){try{var -c=lq.parse(a)}catch(f){var -b=aj(f);if(b[1]===eG)return[1,b[2]];throw i(b,0)}return[0,c]}C["encodeURI"];C["decodeURI"];var -yk=C["encodeURIComponent"],yl=C["decodeURIComponent"],f7=C["URL"],h_=cg;function -yn(a){return yb(a,yo)}var -ys=C["URLSearchParams"];function -yt(a){return a.toString()}function -ls(a){return a.toString()}var -lt=C["document"];function -ym(a,b){return a?new -f7(b,a[1]):new -f7(b)}function -yp(a){function -d(a){return yl(a)}try{var -c=yn(a),e=x6(h_,c)?x4(yq,0,c):c,f=[0,eu(d,x5(h_,e))];return f}catch(f){var -b=aj(f);if(b[1]===eG)return[1,b[2]];throw i(b,0)}}function -yr(a,b){function -e(a){return x2(h_,yk(a))}try{var +C["Error"](b);return a?(c[bY]=a[1],c):c}var +iu=C["Promise"];function +dZ(a){return iu.resolve(a)}function +eT(a,b){return a.then(fK(1,b))}function +l2(a){return iu.all(a)}function +bw(a){return cb(a)}function +aF(a){return b1(a)}function +zb(a,b,c){if(!c)return;a[b]=c[1];return}function +zc(a,b){a[b];return}function +ze(a,b,c){if(c)return zd(a,b,c[1]);return}function +zf(a,b){return a[b]}function +zh(a,b){return g(function(a){throw a},zg(a,b))}function +zi(a){return new +iu(fK(2,function(c,b){return j(a,function(a){return c(a)},function(a){return b(a)})}))}function +zj(a,b,c){return a.then(fK(1,b),fK(1,c))}function +d0(a){return{fut:a}}function +gh(a){return a[jD]}function +zk(a){return a[jD]}function +iv(a){var +c=[0,function(a){throw i([0,u,zl],1)}];function +b(a){return zh(0,"The future is already set")}return[0,d0(zi(function(a,b){c[1]=a;return 0})),function(a){g(c[1],a);c[1]=b;return 0}]}function +eU(a){return d0(dZ(a))}function +eV(a,b){return d0(eT(gh(a),function(a){return gh(g(b,a))}))}function +dn(c,b){return eV(b,function(a){return eU(g(c,a))})}function +l3(a,b){var +c=gh(a);return d0(function(a){return eT(c,a)}(function(c){var +d=gh(b);return function(a){return eT(d,a)}(function(a){return dZ([0,c,a])})}))}function +gi(a){return d0(eT(l2(dY(zk,a)),function(a){return dZ(dX(function(a){return a},a))}))}function +eW(a){return eU([0,a])}function +zm(d,b,c){return d0(zj(c,function(a){return dZ([0,g(d,a)])},function(a){return dZ([1,g(b,a)])}))}function +l4(a,b){return zm(a,function(a){return a},b)}function +eX(a,b){return dn(b,a)}function +bM(c,b){return function(a){return eV(c,a)}(function(a){return 0===a[0]?g(b,a[1]):eU(a)})}function +bx(a,b){return dn(function(a){return s5(b,a)},a)}C["Event"];function +eY(a,b,c,d){var +e=a?a[1]:{};d.addEventListener(b,fK(1,c),e);return}C["ArrayBuffer"];C["DataView"];function +zn(a){return a["currentTarget"]}C["Blob"];C["File"];var +l5=C[hp];function +l6(a){return l5.stringify(a)}function +iw(a){try{var +c=l5.parse(a)}catch(f){var +b=an(f);if(b[1]===eR)return[1,b[2]];throw i(b,0)}return[0,c]}C["encodeURI"];C["decodeURI"];var +zo=C["encodeURIComponent"],zp=C["decodeURIComponent"],gj=C["URL"],ix=cm;function +zr(a){return zf(a,zs)}var +zw=C["URLSearchParams"];function +zx(a){return a.toString()}function +l7(a){return a.toString()}var +l8=C["document"];function +zq(a,b){return a?new +gj(b,a[1]):new +gj(b)}function +zt(a){function +d(a){return zp(a)}try{var +c=zr(a),e=y_(ix,c)?y8(zu,0,c):c,f=[0,bl(d,y9(ix,e))];return f}catch(f){var +b=an(f);if(b[1]===eR)return[1,b[2]];throw i(b,0)}}function +zv(a,b){function +e(a){return y6(ix,zo(a))}try{var d=new -f7(a);d[rh]=x3(0,eu(e,b));var +gj(a);d[rW]=y7(0,bl(e,b));var f=[0,d];return f}catch(f){var -c=aj(f);if(c[1]===eG)return[1,c[2]];throw i(c,0)}}function -yu(a){return new -ys(a)}function -yv(a,b){var +c=an(f);if(c[1]===eR)return[1,c[2]];throw i(c,0)}}function +zy(a){return new +zw(a)}function +zz(a,b){var c=new -f7(a);lk(c,yw,yt(b));return c}if(!lj(lt))lt["documentElement"];function -h$(a,b,c){c_(a,b,c);return 0}var -ia=C[nL];function -ib(a){return em(function(a,b,c){var +gj(a);lZ(c,zA,zx(b));return c}if(!lY(l8))l8["documentElement"];function +iy(a,b,c){dg(a,b,c);return 0}var +iz=C[op];function +iA(a){return ew(function(a,b,c){var e=b,d=c;for(;;){if(!d)return a;var -f=d[2];a[e]=d[1];e=e+1|0;d=f}}(h6(0),0,a))}function -di(a){return h$(ia,yx,ib(a))}function -lu(a){return h$(ia,yy,ib(a))}function -eO(a){return h$(ia,yz,ib(a))}function -dS(a){return a.now()}C[nL];C["navigator"];var -dT=C["performance"];C["window"];x_(C,yA);C["ClipboardItem"];C["FormData"];var -yD=C["Headers"];function -lv(a,b,c,d,e,f,g,h,i,j,k,l,m){var -n={};n["body"]=h5(eH,function(a){return a},a);cR(n,yF,b);cR(n,yG,c);x9(n,yH,hD(function(a){return a},d));cR(n,yI,e);ya(n,yJ,f);cR(n,yK,g);cR(n,yL,h);cR(n,yM,i);cR(n,yN,j);cR(n,yO,k);n["signal"]=h5(eH,function(a){return a},l);return n}var -yP=C["Request"];C["Response"];var -yR=C["fetch"];C["MediaStream"];C["MediaRecorder"];C["MessageChannel"];C["BroadcastChannel"];var -lw="message";function -lx(a){return a["data"]}C["Notification"];C["WebSocket"];function -yB(a){return a}function -yC(a){return lp(function(a){return a},a.text())}function -yE(a,b){var -d=a?[0,a[1]]:[0],c=Mx(yD,d);function -e(a,b){a.append(b[1],b[2]);return 0}fK(function(a){return e(c,a)},b);return c}function -yQ(a,b){var +f=d[2];a[e]=d[1];e=e+1|0;d=f}}(it(0),0,a))}function +dp(a){return iy(iz,zB,iA(a))}function +l9(a){return iy(iz,zC,iA(a))}function +eZ(a){return iy(iz,zD,iA(a))}function +d1(a){return a.now()}C[op];C["navigator"];var +d2=C["performance"];C["window"];zc(C,zE);C["ClipboardItem"];C["FormData"];var +zH=C["Headers"];function +l_(a,b,c,d,e,f,g,h,i,j,k,l,m){var +n={};n["body"]=is(eS,function(a){return a},a);c0(n,zJ,b);c0(n,zK,c);zb(n,zL,hQ(function(a){return a},d));c0(n,zM,e);ze(n,zN,f);c0(n,zO,g);c0(n,zP,h);c0(n,zQ,i);c0(n,zR,j);c0(n,zS,k);n["signal"]=is(eS,function(a){return a},l);return n}var +zT=C["Request"];C["Response"];var +zV=C["fetch"];C["MediaStream"];C["MediaRecorder"];C["MessageChannel"];C["BroadcastChannel"];var +l$="message";function +ma(a){return a["data"]}C["Notification"];C["WebSocket"];function +zF(a){return a}function +zG(a){return l4(function(a){return a},a.text())}function +zI(a,b){var +d=a?[0,a[1]]:[0],c=NF(zH,d);function +e(a,b){a.append(b[1],b[2]);return 0}eH(function(a){return e(c,a)},b);return c}function +zU(a,b){var c=a?a[1]:{};return new -yP(b,c)}function -yS(a){function -b(a){return a}return function(a){return lp(b,a)}(yR(a))}var -yT=C["Worker"];C["SharedWorker"];function -ly(a,b){var -c=a?a[1]:eH;C.postMessage(b,c);return 0}C["clients"];C["registration"];C["serviceWorker"];function -yU(a,b){var -c=a?a[1]:eH;return new -yT(b,c)}function -lz(a){return 0===a[0]?aF(a[1]):lm(aF,a[1])}C["IDBKeyRange"];var -yY="success",yZ=g$;function -b9(a,b){return[0,b,a]}function -y0(a){return a[1][g$]}function -f8(a){var +zT(b,c)}function +zW(a){function +b(a){return a}return function(a){return l4(b,a)}(zV(a))}var +zX=C["Worker"];C["SharedWorker"];function +mb(a,b){var +c=a?a[1]:eS;C.postMessage(b,c);return 0}C["clients"];C["registration"];C["serviceWorker"];function +zY(a,b){var +c=a?a[1]:eS;return new +zX(b,c)}function +mc(a){return 0===a[0]?aF(a[1]):l1(aF,a[1])}C["IDBKeyRange"];var +z2="success",z3=hm;function +cd(a,b){return[0,b,a]}function +z4(a){return a[1][hm]}function +gk(a){var b=a[1]["result"];return g(a[2],b)}function -ic(c,b){eN(0,yY,function(a){return j(c,a,b)},b[1]);return b}function -y1(c,b){eN(0,yZ,function(a){return j(c,a,b)},b[1]);return b}function -dj(a){var -b=h8(0),c=b[2],d=b[1];ic(function(a,b){return c([0,f8(b)])},a);y1(function(a,b){return c([1,y0(b)])},a);return d}var -lA=[0,function(a){return a},function(a){return a}],yX="upgradeneeded";function -y2(a){switch(a){case -0:return y3;case -1:return y4;case -2:return y5;default:return y6}}function -y7(a){return aF(y2(a))}function -lB(e,d,c){var +iB(c,b){eY(0,z2,function(a){return j(c,a,b)},b[1]);return b}function +z5(c,b){eY(0,z3,function(a){return j(c,a,b)},b[1]);return b}function +dq(a){var +b=iv(0),c=b[2],d=b[1];iB(function(a,b){return c([0,gk(b)])},a);z5(function(a,b){return c([1,z4(b)])},a);return d}var +md=[0,function(a){return a},function(a){return a}],z1="upgradeneeded";function +z6(a){switch(a){case +0:return z7;case +1:return z8;case +2:return z9;default:return z_}}function +z$(a){return aF(z6(a))}function +me(e,d,c){var a=[0,function(a){var -b=a["key"],d=c[2];return function(a){return dg(d,a)}(b)},function(a){var -b=a["primaryKey"],c=d[2];return function(a){return dg(c,a)}(b)},function(a,b){b.advance(a);return b},function(a,b){var -c=a?[0,g(d[1],a[1])]:[0];c_(b,"continue",c);return 0}];return[0,e,d,,function(a,b){function -d(a){return dg(function(a){return g(e[3],a)},a)}return function(a){return b9(d,a)}(b.get(g(c[1],a)))},function(a,b){function -e(a){return dg(function(a){return g(d[2],a)},a)}return function(a){return b9(e,a)}(b.getKey(g(c[1],a)))},function(a){function -b(a){return f4(function(a){return g(e[3],a)},a)}return function(a){return b9(b,a)}(a.getAll())},function(a,b){var +b=a["key"],d=c[2];return function(a){return dm(d,a)}(b)},function(a){var +b=a["primaryKey"],c=d[2];return function(a){return dm(c,a)}(b)},function(a,b){b.advance(a);return b},function(a,b){var +c=a?[0,g(d[1],a[1])]:[0];dg(b,"continue",c);return 0}];return[0,e,d,,function(a,b){function +d(a){return dm(function(a){return g(e[3],a)},a)}return function(a){return cd(d,a)}(b.get(g(c[1],a)))},function(a,b){function +e(a){return dm(function(a){return g(d[2],a)},a)}return function(a){return cd(e,a)}(b.getKey(g(c[1],a)))},function(a){function +b(a){return gg(function(a){return g(e[3],a)},a)}return function(a){return cd(b,a)}(a.getAll())},function(a,b){var c=a?[0,a[1]]:[0];function -e(a){return f4(function(a){return g(d[2],a)},a)}return function(a){return b9(e,a)}(c_(b,"getAllKeys",c))},,[0,a[1],a[2],a[3],a[4],function(a){return dg(function(a){return g(e[3],a)},a[d2])},function(a){function -b(a){return 0}return function(a){return b9(b,a)}(a.delete())},function(a,b){var -c=b.update(g(e[2],a)),f=d[2];return function(a){return b9(f,a)}(c)}],function(a,b,c){var -d=hD(y7,b);if(a)var +e(a){return gg(function(a){return g(d[2],a)},a)}return function(a){return cd(e,a)}(dg(b,"getAllKeys",c))},,[0,a[1],a[2],a[3],a[4],function(a){return dm(function(a){return g(e[3],a)},a[d$])},function(a){function +b(a){return 0}return function(a){return cd(b,a)}(a.delete())},function(a,b){var +c=b.update(g(e[2],a)),f=d[2];return function(a){return cd(f,a)}(c)}],function(a,b,c){var +d=hQ(z$,b);if(a)var e=a[1],g=d?[0,e,d[1]]:[0,e],f=g;else var -f=d?[0,li,d[1]]:[0];function -h(a){return dg(function(a){return a},a)}return function(a){return b9(h,a)}(c_(c,"openCursor",f))}]}function -y8(a){switch(a){case -0:return y9;case -1:return y_;default:return y$}}function -ck(b){return function(a){var -c=a.objectStore(aF(b[2][1]));return g(b[1],c)}}function -za(d){return function(a,b,c){var -h=b?b[1]:0,e=[0,[0,zb,!!h],0],i=a?[0,[0,zc,lz(a[1])],e]:e,f=rF(hK(i));eO([0,zd,[0,f,0]]);var -j=c.createObjectStore(aF(d[2][1]),f);return g(d[1],j)}}function -eP(a,b,c){var -d=b?b[1]:0,e=aF(y8(d));return c.transaction(dP(function(a){return aF(a[2][1])},a),e)}function -zg(c,b){function -h(a,b){return lB(c,a,b)}var +f=d?[0,lX,d[1]]:[0];function +h(a){return dm(function(a){return a},a)}return function(a){return cd(h,a)}(dg(c,"openCursor",f))}]}function +Aa(a){switch(a){case +0:return Ab;case +1:return Ac;default:return Ad}}function +cr(a,b){var +c=b.objectStore(aF(a[2][1]));return g(a[1],c)}function +Ae(a,b,c,d){var +h=c?c[1]:0,e=[0,[0,Af,!!h],0],i=b?[0,[0,Ag,mc(b[1])],e]:e,f=sp(hX(i));eZ([0,Ah,[0,f,0]]);var +j=d.createObjectStore(aF(a[2][1]),f);return g(a[1],j)}function +e0(a,b,c){var +d=b?b[1]:0,e=aF(Aa(d));return c.transaction(dY(function(a){return aF(a[2][1])},a),e)}function +Ak(c,b){function +h(a,b){return me(c,a,b)}var a=function(a){return h(b,a)}(b),e=a[1],f=a[2],d=[0,e,f,,a[4],,a[6],a[7],,a[9],a[10],,,function(a,b,c){if(b)var h=g(f[1],b[1]),d=[0,g(e[2],a),h];else var d=[0,g(e[2],a)];var -i=c_(c,"add",d),j=f[2];return function(a){return b9(j,a)}(i)},function(e){return function(a,b,c,d){var -f=[0,hD(function(a){return[0,zh,!!a]},c),0],h=rF(hK(sL(function(a){return a})(f))),i=lz(b),j=d.createIndex(aF(a),i,h);return g(e[1],j)}},function(c){return function(a,b){var -d=b.index(aF(a));return g(c[1],d)}},function(a,b,c){if(b)var +i=dg(c,"add",d),j=f[2];return function(a){return cd(j,a)}(i)},function(a,b,c,d,e){function +f(a){return a}var +h=sp(hX(function(a){return tx(f,a)}([0,hQ(function(a){return[0,Al,!!a]},d),0]))),i=mc(c),j=e.createIndex(aF(b),i,h);return g(a[1],j)},function(a,b,c){var +d=c.index(aF(b));return g(a[1],d)},function(a,b,c){if(b)var h=g(f[1],b[1]),d=[0,g(e[2],a),h];else var d=[0,g(e[2],a)];var -i=c_(c,"put",d),j=f[2];return function(a){return b9(j,a)}(i)}];return[0,,d[1],d[2],,d[4],,d[6],d[7],,d[9],d[10],,,d[13],d[14],d[15],d[16],function(a,b,c){return za([0,function(a){return a},d[1],d[2],d[13],d[14],d[15],d[16]])(a,b,c)}]}function -zi(e,b){var +i=dg(c,"put",d),j=f[2];return function(a){return cd(j,a)}(i)}];return[0,,d[1],d[2],,d[4],,d[6],d[7],,d[9],d[10],,,d[13],d[14],d[15],d[16],function(a,b,c){return Ae([0,function(a){return a},d[1],d[2],d[13],d[14],d[15],d[16]],a,b,c)}]}function +Am(e,b){var c=e[3],d=e[2];function -g(a,b){return lB(d,a,b)}var -f=[0,,,,,function(a){return g(c,a)}(b)[5],,,,,,,,b];return[0,,,,,,f[5],,,,,,,,f[13],function(a,b,c,d){return du(e[5],[0,function(a){return a},f[13]],a,b,c,d)}]}function -dk(a,b){var -c=zi(a,b);return[0,c[14],function(a){return a},,,,,,,c[6],,,,,,c[15]]}function -dl(a,b){var -c=zg(a,b);return[0,,c[10],,c[5],,c[7],c[8],,c[11],,function(a){return a},c[2],c[3],c[14],c[15],c[16],c[17],c[18]]}function -yV(a){return a["oldVersion"]}function -yW(a){return a["newVersion"]}function -ze(a,b){a.deleteObjectStore(aF(b));return 0}function -zf(a){return function(a){return f4(bt,a)}(a["objectStoreNames"])}function -zj(c,b){eN(0,yX,function(a){function -b(a){return a}return j(c,a,function(a){return b9(b,a)}(yj(a)))},b[1]);return b}function -zk(a,b,c){var -d=b?[0,a,ka(b[1])]:[0,a];function -e(a,b,c){return c_(a,b,c)}function -f(a){return a}return function(a){return b9(f,a)}(function(a){return e(c,zl,a)}(kv(aF,d)))}function -zm(a,b){var +g(a,b){return me(d,a,b)}var +f=[0,,,,,function(a){return g(c,a)}(b)[5],,,,,,,,b];return[0,,,,,,f[5],,,,,,,,f[13],function(a,b,c,d){return dA(e[5],[0,function(a){return a},f[13]],a,b,c,d)}]}function +dr(a,b){var +c=Am(a,b);return[0,c[14],function(a){return a},,,,,,,c[6],,,,,,c[15]]}function +ds(a,b){var +c=Ak(a,b);return[0,,c[10],,c[5],,c[7],c[8],,c[11],,function(a){return a},c[2],c[3],c[14],c[15],c[16],c[17],c[18]]}function +zZ(a){return a["oldVersion"]}function +z0(a){return a["newVersion"]}function +Ai(a,b){a.deleteObjectStore(aF(b));return 0}function +Aj(a){return function(a){return gg(bw,a)}(a["objectStoreNames"])}function +An(c,b){eY(0,z1,function(a){function +b(a){return a}return j(c,a,function(a){return cd(b,a)}(zn(a)))},b[1]);return b}function +Ao(a,b,c){var +d=b?[0,a,kB(b[1])]:[0,a];function +e(a,b,c){return dg(a,b,c)}function +f(a){return a}return function(a){return cd(f,a)}(function(a){return e(c,Ap,a)}(kW(aF,d)))}function +Aq(a,b){var c=a?a[1]:C;return c["indexedDB"]}function -dm(a,b){return a===b?1:0}function -eQ(a,b){return a=0){var b=g;for(;;){var -e=(c-1|0)-b|0,h=o(a,b)[1+b];a[1+b]=o(a,e)[1+e];var -f=(c-1|0)-b|0;o(a,f)[1+f]=h;var +e=(c-1|0)-b|0,h=p(a,b)[1+b];a[1+b]=p(a,e)[1+e];var +f=(c-1|0)-b|0;p(a,f)[1+f]=h;var i=b+1|0;if(d===b)break;b=i}}}return}function -zo(i,e){return function(a,b){var -d=a,c=b;for(;;){if(dm(c,e.length-1)){var -f=hK(d);zn(f);return f}var -h=g(i,o(e,c)[1+c]);if(h){d=[0,h[1],d];c=c+1|0}else +As(i,e){return function(a,b){var +d=a,c=b;for(;;){if(dt(c,e.length-1)){var +f=hX(d);Ar(f);return f}var +h=g(i,p(e,c)[1+c]);if(h){d=[0,h[1],d];c=c+1|0}else c=c+1|0}}(0,0)}function -id(c,b){return zo(function(a){return g(c,a)?[0,a]:0},b)}function -zp(a){return a}function -ie(a,b){return L8(a,b)}function -lD(a){return 82908052<=a?749039939<=a?756711075<=a?2:6:737308346<=a?4:3:m4<=a?4100401<=a?1:7:-605101559<=a?5:0}function -zq(a){return typeof -a==="number"?737455525<=a?1:0:15681<=a[1]?30+lD(a[2])|0:40+lD(a[2])|0}(function(a){var -b=zq(a);return g(ae(zr),b)}(-101336657));function -lE(a,b){return sN(a,b)}function -zs(a){return w4(a)}function -b_(a,b){if(!b)return 0;var -d=b[2],c=[0,g(a,b[1]),oA];zu(c,1,a,d);return c}function -zu(a,b,c,d){var -h=a,f=b,e=d;for(;;){if(!e){h[1+f]=0;return}var -j=e[2],i=[0,g(c,e[1]),oA];h[1+f]=i;h=i;f=1;e=j}}function -ig(f,b){return function(a,b){var -d=a,c=b;for(;;){if(!c)return a6(d);var +iC(c,b){return As(function(a){return g(c,a)?[0,a]:0},b)}function +At(a){return a}function +iD(a,b){return Ne(a,b)}function +mg(a){return 82908052<=a?749039939<=a?756711075<=a?2:6:737308346<=a?4:3:nJ<=a?4100401<=a?1:7:-605101559<=a?5:0}function +Au(a){return typeof +a==="number"?737455525<=a?1:0:15681<=a[1]?30+mg(a[2])|0:40+mg(a[2])|0}(function(a){var +b=Au(a);return g(X(Av),b)}(-101336657));function +mh(a,b){return tB(a,b)}function +Aw(a){return ye(a)}function +iE(f,b){return function(a,b){var +d=a,c=b;for(;;){if(!c)return bI(d);var h=c[2],e=g(f,c[1]),i=e?[0,e[1],d]:d;d=i;c=h}}(0,b)}function -zt(a){return a?0:1}function -zv(a,b){return function(a,b,c){var +Ax(a){return a?0:1}function +Ay(a,b){return function(a,b,c){var e=b,d=c;for(;;){if(!d)return 0;var f=d[2];j(a,e,d[1]);e=e+1|0;d=f}}(a,0,b)}function -zw(a){var -b=ky(a),d=b[5];return[0,,,b[1],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[35],,,,,,,,,,,,,,,,,,,function(e,b,c){function -f(a,b,c){return c?[0,bN(e,a,b,c[1])]:[0,b]}return ev(function(a,b){var +Az(a){var +b=kZ(a),d=b[4];return[0,,,b[1],,,,,,,,,,,,,,,,,,,,,,,,,b[26],,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,b,c){function +f(a,b,c){return c?[0,bT(e,a,b,c[1])]:[0,b]}return eI(function(a,b){var c=b[1],e=b[2];return d(c,function(a){return f(c,e,a)},a)},b,c)}]}function -lF(a){var -b=zw(a);return[0,b[3],,,,,,,,,,,,,,,,,,,,,,,,,,,b[37],,,,,,,,,,,,,,,,,,,,,,,,,,b[56]]}function -ih(a,b){return b?[0,g(a,b[1])]:0}function -f_(a,b){return a?a[1]:b}function -zx(a){return a?0:1}function -zy(a,b){return b?g(a,b[1]):0}function -zz(a,b){return b?b[1]:a}kP(0);function -lG(a,b){return 0===b[0]?b:[1,g(a,b[1])]}function -zA(a,b){if(0!==b[0])return;g(a,b[1]);return}var -zC=[J,zB,aZ(0)];function -bH(a){if(0===a[0])return a[1];throw i(zC,1)}function -lH(a,b){return zA(b,a)}function -zD(a,b){return 0===a[0]?a[1]:b}function -zE(a){return function(a,b){var -d=a,c=b;for(;;){if(!c)return[0,a6(d)];var +mi(a){var +b=Az(a);return[0,b[3],,,,,,,,,,,,,,,,,,b[28],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[57]]}function +iF(a,b){return b?[0,g(a,b[1])]:0}function +gm(a,b){return a?a[1]:b}function +AA(a){return a?0:1}function +AB(a,b){return b?g(a,b[1]):0}function +AC(a,b){return b?b[1]:a}lo(0);function +mj(a,b){return 0===b[0]?b:[1,g(a,b[1])]}function +AD(a,b){if(0!==b[0])return;g(a,b[1]);return}var +AF=[L,AE,a5(0)];function +bN(a){if(0===a[0])return a[1];throw i(AF,1)}function +mk(a,b){return AD(b,a)}function +AG(a,b){return 0===a[0]?a[1]:b}function +AH(a){return function(a,b){var +d=a,c=b;for(;;){if(!c)return[0,bI(d)];var e=c[1];if(0!==e[0])return[1,e[1]];d=[0,e[1],d];c=c[2]}}(0,a)}function -zF(a){var -b=kx(a);return[0,,,,b[1],,,b[4],,,,,,,,,b[13],,,,,,,,,,,,,,,,,,,,,,,,b[37],,,,,,,,,,,b[23]]}function -lI(a){var -b=zF(a);return[0,b[4],,,b[7],,,,,,,,,b[16],,,,,,,,,,,,,,,,b[40],,,,,,,,,,,,,,,,,,,,b[51]]}function -ii(a){return m(a)}function -zI(a){return m(a[2])}function -zJ(a){return a?function(a,b){return X(a,(m(a)-b|0)-1|0)}:function(a,b){return X(a,b)}}function -zK(a,b){var -f=ii(b),g=zJ(a);if(0===f)return[0,[0],b];if(1===f)return[0,[0,-1],b];var -e=cM(f,0);o(e,0)[1]=-1;var -d=[0,2],c=[0,0];for(;;){if(!eQ(d[1],f))return[0,e,b];var -l=c[1],m=g(b,c[1]);if(kd(g(b,d[1]-1|0),m)){c[1]++;var -h=d[1],n=c[1];o(e,h)[1+h]=n;d[1]++}else if(0===l){var -j=d[1];o(e,j)[1+j]=0;d[1]++}else{if(!dU(c[1],0))throw i([0,t,zL],1);var -k=c[1];c[1]=o(e,k)[1+k]}}}function -zM(a){return zK(0,a)}function -zN(a,b,c){var -e=[0,c],d=[0,0],j=ii(b),g=zI(a);for(;;){if(eQ(d[1],g)&&eQ(e[1]+d[1]|0,j)){var -k=X(b,e[1]+d[1]|0);if(kd(k,X(a[2],d[1])))d[1]++;else{var -h=d[1],f=o(a[1],h)[1+h];if(f9(f,0)){if(!eQ(f,d[1]))throw i([0,t,zO],1);e[1]=(e[1]+d[1]|0)-f|0;d[1]=f}else{d[1]=0;e[1]++}}continue}return dm(d[1],g)?e[1]:-1}}function -zG(a){return ku(a,zH)}function -zP(a){return dm(ii(a),1)?[0,X(a,0)]:[1,zM(a)]}function -zQ(a,b){var -c=a?a[1]:0;return function(a){if(0!==b[0])return zN(b[1],a,c);var -e=b[1];try{var -f=tc(a,c,e);return f}catch(f){var -d=aj(f);if(d===bD)return-1;throw i(d,0)}}}function -zR(d,b){var -e=m(d);return dU(e,m(b))?0:function(a){var -c=a;for(;;){if(dm(c,e))return 1;if(bd(b,c)!==bd(d,c))return 0;c=c+1|0}}(0)}function -zS(d,b){var -c=bX(m(b));s$(function(a){var -b=g(d,a);return b?p(c,a):b},b);return bY(c)}function -lJ(a,b){var -c=L0(b[1]),d=b[3],e=b[2];return bN(k(a)(zT),e,d,c)}function -lK(a,b){return g(k(a)(zU),m(b))}function -lL(a){var -b=bX(20);return lf(function(a){df(a,0);return P(bY(b))},eF(b),a)}function -lM(a){return[0,xZ(xX,xY,a),0,a]}lM(0);function -zV(a,b){return e8(lL(zW),lK,a,lJ,b)}function -zX(a,b){return e8(lL(zY),lK,a,lJ,b)}function -zZ(a,b,c,d,e){if(0<=e&&0<=b&&0<=d&&(m(a)-b|0)>=e)return(c[3]-d|0)=e)return(c[3]-d|0)=0){var c=h;for(;;){var -e=c%16|0,i=L1(b[1],b[2]+c|0);du(k(a)(z6),f,e,i,g,e);var -j=c+1|0;if(d===c)break;c=j}}return h0(a,0)});function -z2(a,b,c,d){return z1(zZ,function(a){return m(a)},a,b,c,d)}z2(0,0,0,z8);function -z9(a,b){return eu(b,a)}function -z_(a,c){function +e=c%16|0,i=r8(b[1],b[2]+c|0);dA(k(a)(A9),f,e,i,g,e);var +j=c+1|0;if(d===c)break;c=j}}return ig(a,0)});function +A5(a,b,c,d){return A4(A2,function(a){return m(a)},a,b,c,d)}A5(0,0,0,A$);function +Ba(a,b){return bl(b,a)}function +Bb(a,c){function o(a,b){var e=a,d=b;for(;;){if(!d)return e;var c=d[1];e=[0,c[1],[0,c[2],[0,c[3],[0,c[4],[0,c[5],[0,c[6],[0,c[7],[0,c[8],[0,c[9],e]]]]]]]]];d=d[2]}}return function(a,b){var @@ -3018,1328 +3131,1328 @@ k=j[2];if(k){var l=k[2];if(l){var m=l[2];if(m){var n=m[2];if(n){var -p=n[2],q=n[1],r=m[1],s=l[1],t=k[1],u=j[1],v=i[1],w=h[1],x=f[1],y=g(c,d[1]),z=g(c,x),A=g(c,w),B=g(c,v),C=g(c,u),D=g(c,t),E=g(c,s),F=g(c,r);e=[0,[0,y,z,A,B,C,D,E,F,g(c,q)],e];d=p;continue}}}}}}}}}return o(z9(d,c),e)}}(0,a)}function -lN(a,b,c){if(!b)return 0;var +p=n[2],q=n[1],r=m[1],s=l[1],t=k[1],u=j[1],v=i[1],w=h[1],x=f[1],y=g(c,d[1]),z=g(c,x),A=g(c,w),B=g(c,v),C=g(c,u),D=g(c,t),E=g(c,s),F=g(c,r);e=[0,[0,y,z,A,B,C,D,E,F,g(c,q)],e];d=p;continue}}}}}}}}}return o(Ba(d,c),e)}}(0,a)}function +mq(a,b,c){if(!b)return 0;var f=b[2],d=b[1];if(!f)return[0,g(a,d),0];var h=f[2],e=f[1];if(!h){var z=g(a,d);return[0,z,[0,g(a,e),0]]}var i=h[2],j=h[1];if(!i){var x=g(a,d),y=g(a,e);return[0,x,[0,y,[0,g(a,j),0]]]}var k=i[2],l=i[1];if(k){var -m=k[2],n=k[1],o=g(a,d),p=g(a,e),q=g(a,j),r=g(a,l),s=g(a,n),t=50=0){var d=f;for(;;){var -c=X(b,d);a:if(34===c)k(a)(Ad);else if(32<=c)if(92===c)k(a)(Ae);else -g(k(a)(Af),c);else{if(14>c)switch(c){case -8:k(a)(Ah);break a;case -9:k(a)(Ai);break a;case -10:k(a)(Aj);break a;case -13:k(a)(Ak);break a}g(k(a)(Ag),c)}var -h=d+1|0;if(e===d)break;d=h}}return k(a)(Ac)}var -z$=[0,function(a){if(typeof -a==="number")return cC;var -b=a[1];if(fp>b)return cJ<=b?a_<=b?[0,a_,a[2]]:[0,a_,a[2]]:dv<=b?[0,f,a[2]]:[0,f,a[2]];if(fi===b)return[0,65,a[2]];if(h<=b)return L<=b?[0,79,a[2]]:[0,65,a[2]];if(ba<=b)return[0,ba,a[2]];var +c=ai(b,d);a:if(34===c)k(a)(Bg);else if(32<=c)if(92===c)k(a)(Bh);else +g(k(a)(Bi),c);else{if(14>c)switch(c){case +8:k(a)(Bk);break a;case +9:k(a)(Bl);break a;case +10:k(a)(Bm);break a;case +13:k(a)(Bn);break a}g(k(a)(Bj),c)}var +h=d+1|0;if(e===d)break;d=h}}return k(a)(Bf)}var +Bc=[0,function(a){if(typeof +a==="number")return cL;var +b=a[1];if(fz>b)return cS<=b?ba<=b?[0,ba,a[2]]:[0,ba,a[2]]:dB<=b?[0,f,a[2]]:[0,f,a[2]];if(fs===b)return[0,65,a[2]];if(h<=b)return K<=b?[0,79,a[2]]:[0,65,a[2]];if(bc<=b)return[0,bc,a[2]];var c=a[2],d=c[2],e=c[1];return d?[0,65,[0,[0,f,e],[0,d[1],0]]]:[0,f,e]},function(a){if(typeof -a==="number")return cC;var -b=a[1];return 65===b?[0,h,a[2]]:a_<=b?ba<=b?[0,ba,a[2]]:[0,a_,a[2]]:79<=b?[0,L,a[2]]:[0,f,a[2]]},function(a){return[0,0]}(0)];function -Al(a,b,c){var -d=a?a[1]:0,h=b?b[1]:Aa;return function(a,b){function -e(a,b){var +a==="number")return cL;var +b=a[1];return 65===b?[0,h,a[2]]:ba<=b?bc<=b?[0,bc,a[2]]:[0,ba,a[2]]:79<=b?[0,K,a[2]]:[0,f,a[2]]},function(a){return[0,0]}(0)];function +Bo(a,b,c,d,e){var +l=a?a[1]:0,h=b?b[1]:Bd;function +f(a,b){var d=g(c[1],b);if(typeof -d==="number")return k(a)(Am);var -f=d[1];if(65===f){var -n=[0,function(a,b){return k(a)(An)}],m=d[2];return j(k(a)(Ao),function(a,b){return f2(n,e,a,b)},m)}if(a_<=f){if(ba<=f)return d[2]?k(a)(Ap):k(a)(Aq);var -i=d[2],l=rJ(i),o=l[2];return l[1]==0.?g(k(a)(Ar),o):g(k(a)(As),i)}if(79>f)return j(h,a,d[2]);function +d==="number")return k(a)(Bp);var +e=d[1];if(65===e){var +n=[0,function(a,b){return k(a)(Bq)}],m=d[2];return j(k(a)(Br),function(a,b){return ge(n,f,a,b)},m)}if(ba<=e){if(bc<=e)return d[2]?k(a)(Bs):k(a)(Bt);var +i=d[2],l=su(i),o=l[2];return l[1]==0.?g(k(a)(Bu),o):g(k(a)(Bv),i)}if(79>e)return j(h,a,d[2]);function q(a,b){var -c=b[2],d=b[1];return e8(k(a)(Au),h,d,e,c)}var -r=[0,function(a,b){return k(a)(At)}],p=d[2];return j(k(a)(Av),function(a,b){return f2(r,q,a,b)},p)}function -f(a,b){var +c=b[2],d=b[1];return fh(k(a)(Bx),h,d,f,c)}var +r=[0,function(a,b){return k(a)(Bw)}],p=d[2];return j(k(a)(By),function(a,b){return ge(r,q,a,b)},p)}function +i(a,b){var d=g(c[1],b);if(typeof d!=="number"){var -i=d[1];if(65===i){var -l=d[2];if(!l)return k(a)(Ay);var -n=[0,function(a,b){return k(a)(Aw)}];return j(k(a)(Ax),function(a,b){return f2(n,f,a,b)},l)}if(79===i){var -m=d[2];if(!m)return k(a)(AC);var +e=d[1];if(65===e){var +l=d[2];if(!l)return k(a)(BB);var +n=[0,function(a,b){return k(a)(Bz)}];return j(k(a)(BA),function(a,b){return ge(n,i,a,b)},l)}if(79===e){var +m=d[2];if(!m)return k(a)(BF);var o=function(a,b){var -c=b[2],d=b[1];return e8(k(a)(AA),h,d,f,c)},p=[0,function(a,b){return k(a)(Az)}];return j(k(a)(AB),function(a,b){return f2(p,o,a,b)},m)}}return e(a,b)}return d?e(a,b):f(a,b)}}function -AD(a){function +c=b[2],d=b[1];return fh(k(a)(BD),h,d,i,c)},p=[0,function(a,b){return k(a)(BC)}];return j(k(a)(BE),function(a,b){return ge(p,o,a,b)},m)}}return f(a,b)}return l?f(d,e):i(d,e)}function +BG(a){function d(a){if(typeof -a==="number")return cC;var -b=a[1];if(65===b)return[0,h,lO(d,a[2])];if(a_>b)return 79<=b?[0,L,lO(function(a){var -b=a[1];return[0,b,d(a[2])]},a[2])]:[0,f,a[2]];if(ba<=b)return[0,ba,a[2]];var -e=a[2],i=rJ(e),c=i[2];if(i[1]!=0.)return[0,a_,e];if(-1073741824.<=c&&c<=jp)return[0,cJ,c|0];return[0,dv,g(ae(AE),c)]}return d(a)}function -au(a,b){return c9(a,b)}function -dV(a,b,c){ao(a,b,c);return}var -lP=bE(mY);function -aG(a,b,c){return[0,fg,dG(a,b,c)]}function -f$(a,b,c,d,e){var -f=ap(2),i=fM(c,d,e);if(a)var +a==="number")return cL;var +b=a[1];if(65===b)return[0,h,mr(d,a[2])];if(ba>b)return 79<=b?[0,K,mr(function(a){var +b=a[1];return[0,b,d(a[2])]},a[2])]:[0,f,a[2]];if(bc<=b)return[0,bc,a[2]];var +e=a[2],i=su(e),c=i[2];if(i[1]!=0.)return[0,ba,e];if(-1073741824.<=c&&c<=pW)return[0,cS,c|0];return[0,dB,g(X(BH),c)]}return d(a)}function +av(a,b){return cU(a,b)}function +d4(a,b,c){al(a,b,c);return}var +ms=bH(nD);function +aG(a,b,c){return[0,fq,dL(a,b,c)]}function +gn(a,b,c,d,e){var +f=am(2),i=fU(c,d,e);if(a)var h=1,g=0;else var -h=0,g=1;dV(f,g,b>>>8|0);dV(f,h,b&c1);return[0,fg,bf(sS(f,i))]}var -AK=bE(qy),eR=AN.slice();function -AF(a,b){return P(j(ae(AG),a,b))}function -AH(a){return a}function -AI(a,b,c,d,e){b6(a,b,c,d,e);return}function -AJ(a,b){return a[1+b]}function -AL(a,b){var -c=au(a,b);return cB>>0)throw i([0,t,AO],1);switch(l){case -0:return d(au(a,b));case +h=0,g=1;d4(f,g,b>>>8|0);d4(f,h,b&c_);return[0,fq,a8(tJ(f,i))]}var +BN=bH(ra),e2=BQ.slice();function +BI(a,b){return O(j(X(BJ),a,b))}function +BK(a){return a}function +BL(a,b,c,d,e){b$(a,b,c,d,e);return}function +BM(a,b){return a[1+b]}function +BO(a,b){var +c=av(a,b);return cK>>0)throw i([0,u,BR],1);switch(l){case +0:return d(av(a,b));case 1:var -q=au(a,b),m=au(a,b+1|0);return 2===(m>>>6|0)?d((q&31)<<6|m&63):aG(a,b,c);case +q=av(a,b),m=av(a,b+1|0);return 2===(m>>>6|0)?d((q&31)<<6|m&63):aG(a,b,c);case 2:var -g=au(a,b),e=au(a,b+1|0),n=au(a,b+2|0),h=(g&15)<<12|(e&63)<<6|n&63;if(2!==(n>>>6|0))return aG(a,b,c);if(ef===g){if(mX<=e&&g2>=e)return d(h);return aG(a,b,c)}if(g3!==g)return 2===(e>>>6|0)?d(h):aG(a,b,c);if(M<=e&&159>=e)return d(h);return aG(a,b,c);default:var -j=au(a,b),f=au(a,b+1|0),o=au(a,b+2|0),p=au(a,b+3|0),k=(j&7)<<18|(f&63)<<12|(o&63)<<6|p&63;if(2===(p>>>6|0)&&2===(o>>>6|0)){if(d5===j){if(qT<=f&&g2>=f)return d(k);return aG(a,b,c)}if(qC!==j)return 2===(f>>>6|0)?d(k):aG(a,b,c);if(M<=f&&143>=f)return d(k);return aG(a,b,c)}return aG(a,b,c)}}function -eS(a,b,c){var -e=au(a,b),d=e<<8|au(a,c);if(iQ<=d&&fa>=d)return jC=e)return[0,aB,bE(((a&fh)<<10|e&fh)+d8|0)];return f$(c=(c+d|0)){if(0===d)return lQ(a);a[5]=b;a[6]=c;a[7]=(c+d|0)-1|0;return}return AF(c,d)}function -dW(a,b){var +g=av(a,b),e=av(a,b+1|0),n=av(a,b+2|0),h=(g&15)<<12|(e&63)<<6|n&63;if(2!==(n>>>6|0))return aG(a,b,c);if(eo===g){if(nC<=e&&hd>=e)return d(h);return aG(a,b,c)}if(he!==g)return 2===(e>>>6|0)?d(h):aG(a,b,c);if(M<=e&&159>=e)return d(h);return aG(a,b,c);default:var +j=av(a,b),f=av(a,b+1|0),o=av(a,b+2|0),p=av(a,b+3|0),k=(j&7)<<18|(f&63)<<12|(o&63)<<6|p&63;if(2===(p>>>6|0)&&2===(o>>>6|0)){if(ec===j){if(rv<=f&&hd>=f)return d(k);return aG(a,b,c)}if(re!==j)return 2===(f>>>6|0)?d(k):aG(a,b,c);if(M<=f&&143>=f)return d(k);return aG(a,b,c)}return aG(a,b,c)}}function +e3(a,b,c){var +e=av(a,b),d=e<<8|av(a,c);if(jd<=d&&fl>=d)return j1=e)return[0,aB,bH(((a&fr)<<10|e&fr)+ef|0)];return gn(c=(c+d|0)){if(0===d)return mt(a);a[5]=b;a[6]=c;a[7]=(c+d|0)-1|0;return}return BI(c,d)}function +d5(a,b){var c=b[1];if(typeof -c==="number"){b[18]=a;return gZ}if(mR<=c[1]){var -d=sc(c[2],b[5],0,aR(b[5]));A0(b,b[5],0,d);return g(a,b)}lQ(b);return g(a,b)}function -dX(a,b){a[9]=0;a[10]=b;return}function -b$(c,b){function -d(a,b){AI(a[5],a[6],a[8],a[9],b);a[6]=a[6]+b|0;a[9]=a[9]+b|0;return}var -a=cS(b);if(0>a)return g(c,b);var -e=b[10]-b[9]|0;return aa)return g(c,b);var +e=b[10]-b[9]|0;return a=b)return 0<=b?dW(ij,a):co;var -c=a[6];a[6]=a[6]+1|0;return S(ij,AL(a[5],c),1,a)}function -ik(a){var -b=cS(a);if(0>=b)return 0<=b?dW(ik,a):co;var -c=a[6];a[6]=a[6]+1|0;return S(ik,AM(a[5],c),1,a)}function -gb(a){if(a[9]=b)return 0<=b?d5(iH,a):cv;var +c=a[6];a[6]=a[6]+1|0;return S(iH,BO(a[5],c),1,a)}function +iI(a){var +b=c1(a);if(0>=b)return 0<=b?d5(iI,a):cv;var +c=a[6];a[6]=a[6]+1|0;return S(iI,BP(a[5],c),1,a)}function +gp(a){if(a[9]=c)return 0<=c?dW(bg,a):co;var -b=AJ(eR,au(a[5],a[6]));if(c=a[10])return lT(eS(a[8],0,1),a);var -b=a[9];return S(ca,aG(a[8],0,a[9]),b,a)}function -lT(a,b){if(fg<=a[1])return S(ca,a,2,b);var -c=a[2];if(2<=cS(b)){var -d=b[6];b[6]=b[6]+2|0;return S(ca,ga(c,b[5],d,d+1|0),4,b)}dX(b,2);return b$(function(a){return lR(c,a)},b)}function -ca(a){var -b=cS(a);if(0>=b)return 0<=b?dW(ca,a):co;if(2<=b){var -c=a[6];a[6]=a[6]+2|0;return lT(eS(a[5],c,c+1|0),a)}dX(a,2);return b$(lS,a)}function -lU(a,b){var -c=b[9]+2|0;return b[9]=a[10])return lW(eS(a[8],1,0),a);var -b=a[9];return S(cl,aG(a[8],0,a[9]),b,a)}function -lW(a,b){if(fg<=a[1])return S(cl,a,2,b);var -c=a[2];if(2<=cS(b)){var -d=b[6];b[6]=b[6]+2|0;return S(cl,ga(c,b[5],d+1|0,d),4,b)}dX(b,2);return b$(function(a){return lU(c,a)},b)}function -cl(a){var -b=cS(a);if(0>=b)return 0<=b?dW(cl,a):co;if(2<=b){var -c=a[6];a[6]=a[6]+2|0;return lW(eS(a[5],c+1|0,c),a)}dX(a,2);return b$(lV,a)}function -A1(a){function +c=c1(a);if(0>=c)return 0<=c?d5(bg,a):cv;var +b=BM(e2,av(a[5],a[6]));if(c=a[10])return mw(e3(a[8],0,1),a);var +b=a[9];return S(cf,aG(a[8],0,a[9]),b,a)}function +mw(a,b){if(fq<=a[1])return S(cf,a,2,b);var +c=a[2];if(2<=c1(b)){var +d=b[6];b[6]=b[6]+2|0;return S(cf,go(c,b[5],d,d+1|0),4,b)}d6(b,2);return ce(function(a){return mu(c,a)},b)}function +cf(a){var +b=c1(a);if(0>=b)return 0<=b?d5(cf,a):cv;if(2<=b){var +c=a[6];a[6]=a[6]+2|0;return mw(e3(a[5],c,c+1|0),a)}d6(a,2);return ce(mv,a)}function +mx(a,b){var +c=b[9]+2|0;return b[9]=a[10])return mz(e3(a[8],1,0),a);var +b=a[9];return S(cs,aG(a[8],0,a[9]),b,a)}function +mz(a,b){if(fq<=a[1])return S(cs,a,2,b);var +c=a[2];if(2<=c1(b)){var +d=b[6];b[6]=b[6]+2|0;return S(cs,go(c,b[5],d+1|0,d),4,b)}d6(b,2);return ce(function(a){return mx(c,a)},b)}function +cs(a){var +b=c1(a);if(0>=b)return 0<=b?d5(cs,a):cv;if(2<=b){var +c=a[6];a[6]=a[6]+2|0;return mz(e3(a[5],c+1|0,c),a)}d6(a,2);return ce(my,a)}function +B4(a){function d(a){var -b=au(a[8],2),c=o(eR,b)[1+b];return 0===c?S(bg,aG(a[8],2,1),1,a):(a[10]=c,a[9]=1,dV(a[8],0,b),b$(gb,a))}var -b=au(a[8],0);function +b=av(a[8],2),c=p(e2,b)[1+b];return 0===c?S(bg,aG(a[8],2,1),1,a):(a[10]=c,a[9]=1,d4(a[8],0,b),ce(gp,a))}var +b=av(a[8],0);function f(a){var -b=au(a[8],1),e=2>>0)throw i([0,t,A2],1);switch(e){case +b=av(a[8],1),e=2>>0)throw i([0,u,B5],1);switch(e){case 0:return S(c,aG(a[8],0,1),1,a);case -1:return S(c,dn(a[8],0,1),1,a);case -2:return 2<=a[9]?3<=a[9]?S(d,dn(a[8],0,2),2,a):S(bg,dn(a[8],0,2),2,a):S(bg,aG(a[8],0,1),1,a);case -3:if(3<=a[9])return S(bg,dn(a[8],0,3),3,a);var -g=a[9];return S(bg,aG(a[8],0,a[9]),g,a);default:if(3<=a[9]){a[10]=4;return b$(gb,a)}var +1:return S(c,du(a[8],0,1),1,a);case +2:return 2<=a[9]?3<=a[9]?S(d,du(a[8],0,2),2,a):S(bg,du(a[8],0,2),2,a):S(bg,aG(a[8],0,1),1,a);case +3:if(3<=a[9])return S(bg,du(a[8],0,3),3,a);var +g=a[9];return S(bg,aG(a[8],0,a[9]),g,a);default:if(3<=a[9]){a[10]=4;return ce(gp,a)}var h=a[9];return S(bg,aG(a[8],0,a[9]),h,a)}}function -lX(a,b,c){if(b)var -j=1,i=0,h=lR,d=lS,f=ca;else +mA(a,b,c){if(b)var +j=1,i=0,h=mu,d=mv,f=cf;else var -j=0,i=1,h=lU,d=lV,f=cl;function +j=0,i=1,h=mx,d=my,f=cs;function e(a,b){if(3>b[9])return f(b);b[10]=2;b[9]=1;var -c=au(b[8],2);dV(b[8],0,c);return b$(a,b)}if(typeof -c!=="number")return S(function(a){return e(d,a)},[0,aB,bE(c[2])],2,a);if(fc>c)return S(function(a){return e(d,a)},[0,aB,lP],2,a);var -g=eS(a[8],i,j);if(fg<=g[1])return S(function(a){return e(d,a)},g,2,a);var +c=av(b[8],2);d4(b[8],0,c);return ce(a,b)}if(typeof +c!=="number")return S(function(a){return e(d,a)},[0,aB,bH(c[2])],2,a);if(fn>c)return S(function(a){return e(d,a)},[0,aB,ms],2,a);var +g=e3(a[8],i,j);if(fq<=g[1])return S(function(a){return e(d,a)},g,2,a);var k=g[2];if(3<=a[9]){var l=function(a){return h(k,a)};return function(a){return e(l,a)}(a)}var -m=a[9];return S(f,f$(b,k,fL,0,0),m,a)}function -A3(a){dX(a,3);return b$(function(a){var -b=AP(a[8],0,a[9]),c=b[1];if(eg===c){var -e=b[2];a[2]=eg;a[18]=cl;return lX(a,0,e)}if(c2<=c){var -d=b[2];a[2]=c2;a[18]=bg;return co===d?co:fc<=d?A1(a):S(bg,[0,aB,lP],3,a)}var -f=b[2];a[2]=fl;a[18]=ca;return lX(a,1,f)},a)}function -bI(a){a[14]=0;a[13]=a[13]+1|0;return}function -cT(a){a[14]=a[14]+1|0;return}function +m=a[9];return S(f,gn(b,k,fT,0,0),m,a)}function +B6(a){d6(a,3);return ce(function(a){var +b=BS(a[8],0,a[9]),c=b[1];if(ep===c){var +e=b[2];a[2]=ep;a[18]=cs;return mA(a,0,e)}if(c$<=c){var +d=b[2];a[2]=c$;a[18]=bg;return cv===d?cv:fn<=d?B4(a):S(bg,[0,aB,ms],3,a)}var +f=b[2];a[2]=fv;a[18]=cf;return mA(a,1,f)},a)}function +bO(a){a[14]=0;a[13]=a[13]+1|0;return}function +c2(a){a[14]=a[14]+1|0;return}function aH(a){a[16]=a[16]+1|0;return}function aI(a,b){a[12]=b;return}function -A4(a,b,c,d){if(aB>d[1]){c[11]=0;c[17]=b;return j(c[17],c,d)}var -e=bo(d[2]);if(mY===e){if(a){c[2]=fl;c[18]=ca}c[11]=1;c[17]=b;return g(c[18],c)}if(65534===e&&a){c[2]=eg;c[18]=cl;c[11]=1;c[17]=b;return g(c[18],c)}c[11]=0;c[17]=b;return j(c[17],c,d)}function -A5(a,b){if(aB>b[1]){aI(a,0);aH(a);cT(a);return b}var -c=bo(b[2])+i6|0;a:{if(jr>>0){var -d=c+d$|0;if(3>>0)break a;switch(d){case +B7(a,b,c,d){if(aB>d[1]){c[11]=0;c[17]=b;return j(c[17],c,d)}var +e=br(d[2]);if(nD===e){if(a){c[2]=fv;c[18]=cf}c[11]=1;c[17]=b;return g(c[18],c)}if(65534===e&&a){c[2]=ep;c[18]=cs;c[11]=1;c[17]=b;return g(c[18],c)}c[11]=0;c[17]=b;return j(c[17],c,d)}function +B8(a,b){if(aB>b[1]){aI(a,0);aH(a);c2(a);return b}var +c=br(b[2])+js|0;a:{if(jP>>0){var +d=c+ei|0;if(3>>0)break a;switch(d){case 0:var -e=a[12];aI(a,0);aH(a);return e?b:(bI(a),b);case +e=a[12];aI(a,0);aH(a);return e?b:(bO(a),b);case 1:break a;case -2:break;default:aI(a,1);aH(a);bI(a);return b}}else if(jE>=c-1>>>0)break a;aI(a,0);aH(a);bI(a);return b}aI(a,0);aH(a);cT(a);return b}function -A6(a,b){if(aB>b[1]){aI(a,0);aH(a);cT(a);return b}var -c=bo(b[2])+i6|0;a:{if(jr>>0){var -d=c+d$|0;if(3>>0)break a;switch(d){case +2:break;default:aI(a,1);aH(a);bO(a);return b}}else if(j3>=c-1>>>0)break a;aI(a,0);aH(a);bO(a);return b}aI(a,0);aH(a);c2(a);return b}function +B9(a,b){if(aB>b[1]){aI(a,0);aH(a);c2(a);return b}var +c=br(b[2])+js|0;a:{if(jP>>0){var +d=c+ei|0;if(3>>0)break a;switch(d){case 0:var -e=a[12];aI(a,0);return e?g(a[18],a):(aH(a),bI(a),[0,aB,a[4]]);case +e=a[12];aI(a,0);return e?g(a[18],a):(aH(a),bO(a),[0,aB,a[4]]);case 1:break a;case -2:break;default:aI(a,1);aH(a);bI(a);return[0,aB,a[4]]}}else if(jE>=c-1>>>0)break a;aI(a,0);aH(a);bI(a);return[0,aB,a[4]]}aI(a,0);aH(a);cT(a);return b}function -A7(a,b){if(aB>b[1]){aI(a,0);aH(a);cT(a);return b}var -c=bo(b[2]);a:{if(14<=c){if(oF<=c){if(8234>c)break a}else if(jy===c){aI(a,0);aH(a);bI(a);return[0,aB,a[4]]}}else if(10<=c)switch(c+nh|0){case +2:break;default:aI(a,1);aH(a);bO(a);return[0,aB,a[4]]}}else if(j3>=c-1>>>0)break a;aI(a,0);aH(a);bO(a);return[0,aB,a[4]]}aI(a,0);aH(a);c2(a);return b}function +B_(a,b){if(aB>b[1]){aI(a,0);aH(a);c2(a);return b}var +c=br(b[2]);a:{if(14<=c){if(pi<=c){if(8234>c)break a}else if(jX===c){aI(a,0);aH(a);bO(a);return[0,aB,a[4]]}}else if(10<=c)switch(c+nX|0){case 0:var -d=a[12];aI(a,0);return d?g(a[18],a):(aH(a),bI(a),[0,aB,a[4]]);case +d=a[12];aI(a,0);return d?g(a[18],a):(aH(a),bO(a),[0,aB,a[4]]);case 1:break;case -2:break a;default:aI(a,1);aH(a);bI(a);return[0,aB,a[4]]}aI(a,0);aH(a);cT(a);return b}aI(a,0);aH(a);bI(a);return b}function -A8(a,b){if(aB>b[1]){aI(a,0);aH(a);cT(a);return b}var -c=bo(b[2])+i6|0;a:{if(jr>>0){var -d=c+d$|0;if(3>>0)break a;switch(d){case +2:break a;default:aI(a,1);aH(a);bO(a);return[0,aB,a[4]]}aI(a,0);aH(a);c2(a);return b}aI(a,0);aH(a);bO(a);return b}function +B$(a,b){if(aB>b[1]){aI(a,0);aH(a);c2(a);return b}var +c=br(b[2])+js|0;a:{if(jP>>0){var +d=c+ei|0;if(3>>0)break a;switch(d){case 0:var -e=a[12];aI(a,0);return e?g(a[18],a):(aH(a),bI(a),[0,aB,a[4]]);case +e=a[12];aI(a,0);return e?g(a[18],a):(aH(a),bO(a),[0,aB,a[4]]);case 1:break a;case -2:break;default:aI(a,1);aH(a);bI(a);return[0,aB,a[4]]}}else if(jE>=c-1>>>0)break a;aI(a,0);aH(a);bI(a);return b}aI(a,0);aH(a);cT(a);return b}function -A9(a){return pZ<=a?423112016<=a?c2<=a?bg:ij:338302576<=a?ik:ca:eg<=a?cl:ca}function -il(a){return a[13]}function -im(a){return a[14]}function -io(d,b){var -a=bo(b);function -c(a){return p(d,AH(a))}return cB>>18|0),c(M|(a>>>12|0)&63),c(M|(a>>>6|0)&63),c(M|a&63)):(c(ef|a>>>12|0),c(M|(a>>>6|0)&63),c(M|a&63)):(c(hf|a>>>6|0),c(M|a&63)):c(a)}function -A_(a,b,c){if(a){var +2:break;default:aI(a,1);aH(a);bO(a);return[0,aB,a[4]]}}else if(j3>=c-1>>>0)break a;aI(a,0);aH(a);bO(a);return b}aI(a,0);aH(a);c2(a);return b}function +Ca(a){return qB<=a?423112016<=a?c$<=a?bg:iH:338302576<=a?iI:cf:ep<=a?cs:cf}function +iJ(a){return a[13]}function +iK(a){return a[14]}function +iL(d,b){var +a=br(b);function +c(a){return o(d,BK(a))}return cK>>18|0),c(M|(a>>>12|0)&63),c(M|(a>>>6|0)&63),c(M|a&63)):(c(eo|a>>>12|0),c(M|(a>>>6|0)&63),c(M|a&63)):(c(hs|a>>>6|0),c(M|a&63)):c(a)}function +Cb(a,b,c){if(a){var d=a[1],k=d[1];if(3895880===k)var -f=d[2],e=A7;else if(g4<=k)var -f=d[2],e=A8;else +f=d[2],e=B_;else if(hf<=k)var +f=d[2],e=B$;else var -f=d[2],e=A6}else +f=d[2],e=B9}else var -f=bE(10),e=A5;if(b)var -l=b[1],n=A9(l),g=l;else +f=bH(10),e=B8;if(b)var +l=b[1],n=Ca(l),g=l;else var -n=A3,g=c2;if(typeof +n=B6,g=c$;if(typeof c==="number")var -j=0,i=1,h=fL;else if(mR<=c[1])var -j=0,i=1,h=ap(d8);else +j=0,i=1,h=fT;else if(nw<=c[1])var +j=0,i=1,h=am(ef);else var -o=c[2],j=m(o)-1|0,i=0,h=dc(o);var -p=pZ===g?1:0;return[0,c,g,a,f,h,i,j,ap(4),0,0,0,0,1,0,0,0,function(a,b){return A4(p,e,a,b)},n]}function -A$(a){return g(a[18],a)}function -Ba(a){return a[11]}var -lY=44,gc=bo(AK),Bc=10,Bd=34,Be=93,Bf=ed,Bg=47,Bh=92,Bi=42;function -Bj(a){var +o=c[2],j=m(o)-1|0,i=0,h=cZ(o);var +p=qB===g?1:0;return[0,c,g,a,f,h,i,j,am(4),0,0,0,0,1,0,0,0,function(a,b){return B7(p,e,a,b)},n]}function +Cc(a){return g(a[18],a)}function +Cd(a){return a[11]}var +mB=44,gq=br(BN),Cf=10,Cg=34,Ch=93,Ci=em,Cj=47,Ck=92,Cl=42;function +Cm(a){var b=a<=31?1:0;if(b)var c=b;else var d=34===a?1:0,c=d||(92===a?1:0);return c}function -Bk(a){var +Cn(a){var b=48<=a?1:0,c=b?a<=57?1:0:b;return c}function -Bl(a){var +Co(a){var c=48<=a?1:0,d=c?a<=57?1:0:c;if(d)var b=d;else{var e=65<=a?1:0,f=e?a<=70?1:0:e;if(f)var b=f;else var -g=97<=a?1:0,b=g?a<=gJ?1:0:g}return b}function -gd(a){a:{if(11<=a){if(32===a)break a}else if(9<=a)break a;return 0}return 1}function -lZ(a){a:{if(44<=a){var +g=97<=a?1:0,b=g?a<=gX?1:0:g}return b}function +gr(a){a:{if(11<=a){if(32===a)break a}else if(9<=a)break a;return 0}return 1}function +mC(a){a:{if(44<=a){var b=a-45|0;if(79>>0){if(81<=b)break a}else if(48!==b)break a}else if(11<=a){if(32!==a)break a}else if(9>a)break a;return 1}return 0}function -Bn(a){return[0,ag,[0,d9,[0,-542918501,hE(a)]]]}function -Bo(a){return[0,ag,[0,d9,[0,pB,hE(a)]]]}function -Bp(a){return[0,ag,[0,d9,[0,pu,a]]]}function -Bq(a){return[0,ag,[0,d9,[0,pD,a]]]}function -l0(a){return[0,ag,[0,d9,[0,ns,a]]]}function -Br(a){return[0,ag,[0,-635137946,hE(a)]]}function -Bs(a){return[0,ag,[0,qN,a]]}function -Bx(a){return[0,ag,[0,pY,a]]}function -By(a){return[0,ag,[0,mZ,a]]}function -eT(a,b){return g(k(a)(BH),b)}function -ip(a,b){if(31>=bo(b))return eT(a,bo(b));var -c=bX(4);io(c,b);var -d=bo(b),e=bY(c);return bN(k(a)(BI),e,eT,d)}function -bv(a,b){var -c=bE(b);return io(a[2],c)}function -cU(a){var -b=bE(a[8]);return io(a[2],b)}function -dp(a){var -b=bY(a[2]);ez(a[2]);return b}function -l3(a){var -b=im(a[1]);return[0,il(a[1]),b]}function -bJ(a){a[4]=il(a[1]);a[5]=im(a[1]);return}function -aO(a){a[6]=il(a[1]);a[7]=im(a[1]);return}function -l4(a){var -b=a[9];if(!b)throw i([0,t,Cc],1);var +Cq(a){return[0,af,[0,eg,[0,-542918501,hR(a)]]]}function +Cr(a){return[0,af,[0,eg,[0,qe,hR(a)]]]}function +Cs(a){return[0,af,[0,eg,[0,p9,a]]]}function +Ct(a){return[0,af,[0,eg,[0,qg,a]]]}function +mD(a){return[0,af,[0,eg,[0,n8,a]]]}function +Cu(a){return[0,af,[0,-635137946,hR(a)]]}function +Cv(a){return[0,af,[0,ro,a]]}function +CA(a){return[0,af,[0,qA,a]]}function +CB(a){return[0,af,[0,nE,a]]}function +e4(a,b){return g(k(a)(CK),b)}function +iM(a,b){if(31>=br(b))return e4(a,br(b));var +c=bs(4);iL(c,b);var +d=br(b),e=bJ(c);return bT(k(a)(CL),e,e4,d)}function +by(a,b){var +c=bH(b);return iL(a[2],c)}function +c3(a){var +b=bH(a[8]);return iL(a[2],b)}function +dv(a){var +b=bJ(a[2]);dO(a[2]);return b}function +mG(a){var +b=iK(a[1]);return[0,iJ(a[1]),b]}function +bP(a){a[4]=iJ(a[1]);a[5]=iK(a[1]);return}function +aO(a){a[6]=iJ(a[1]);a[7]=iK(a[1]);return}function +mH(a){var +b=a[9];if(!b)throw i([0,u,Df],1);var c=b[1][2],d=c[2];a[4]=c[1];a[5]=d;return aO(a)}function -l5(a){bJ(a);aO(a);var -c=a[9];if(!c)throw i([0,t,Cd],1);var -b=c[2];if(!b){a[10]=0;a[9]=0;return}if(dw<=b[1][1]){a[10]=1;a[9]=b;return}a[10]=0;a[9]=b;return}function -dY(a){return co}function +mI(a){bP(a);aO(a);var +c=a[9];if(!c)throw i([0,u,Dg],1);var +b=c[2];if(!b){a[10]=0;a[9]=0;return}if(dC<=b[1][1]){a[10]=1;a[9]=b;return}a[10]=0;a[9]=b;return}function +d7(a){return cv}function Y(a,b,c){c[12]=b;return a}function A(c,b){var -a=A$(b[1]);if(typeof -a==="number")return gZ<=a?Y(gZ,function(a){return A(c,a)},b):(b[8]=fI,g(c,b));if(aB<=a[1]){b[8]=bo(a[2]);return g(c,b)}var -d=a[2];b[8]=gc;aO(b);return Y(Bs(d),c,b)}function -l6(c,b){if(b[8]!==10&&b[8]!==b3){cU(b);return A(function(a){return l6(c,a)},b)}aO(b);return Y([0,d6,[0,83,dp(b)]],function(a){return A(c,a)},b)}function -eU(a,b,c){if(c[8]===b3){aO(c);return Y(Bt,dY,c)}if(a){if(c[8]===47){aO(c);return Y([0,d6,[0,77,dp(c)]],function(a){return A(b,a)},c)}if(c[8]===42){cU(c);var -d=1;return A(function(a){return eU(d,b,a)},c)}bv(c,Bi);cU(c);var -e=0;return A(function(a){return eU(e,b,a)},c)}if(c[8]===42){var -f=1;return A(function(a){return eU(f,b,a)},c)}cU(c);var -g=0;return A(function(a){return eU(g,b,a)},c)}function -Ce(c,b){if(b[8]===47)return A(function(a){return l6(c,a)},b);if(b[8]===42){var -d=0;return A(function(a){return eU(d,c,a)},b)}aO(b);return Y(Bz,c,b)}function -l7(c,b){return gd(b[8])?(aO(b),cU(b),A(function(a){return l7(c,a)},b)):Y([0,m4,dp(b)],c,b)}function -iq(c,b){if(gd(b[8])){bJ(b);return l7(function(a){return iq(c,a)},b)}if(b[8]!==47)return g(c,b);bJ(b);function -d(a){return iq(c,a)}return A(function(a){return Ce(d,a)},b)}function -l8(c,b){return gd(b[8])?A(function(a){return l8(c,a)},b):g(c,b)}function -cv(a,b){return b[3]?iq(a,b):l8(a,b)}function -ir(h,b,c,d,e){function -f(a,b,c){bv(c,gc);return Y(a,b,c)}if(0=b)return jC=b){bv(e,((k&fh)<<10|b&fh)+d8|0);return g(d,e)}return f(Bp(b),d,e)}function -l9(c,b){var -a=b[8];if(34===a){bv(b,Bd);return A(c,b)}if(92<=a){if(118>a)switch(a-92|0){case -0:bv(b,Bh);return A(c,b);case -6:bv(b,8);return A(c,b);case -10:bv(b,12);return A(c,b);case -18:bv(b,Bc);return A(c,b);case -22:bv(b,13);return A(c,b);case -24:bv(b,9);return A(c,b);case +a=Cc(b[1]);if(typeof +a==="number")return ha<=a?Y(ha,function(a){return A(c,a)},b):(b[8]=fS,g(c,b));if(aB<=a[1]){b[8]=br(a[2]);return g(c,b)}var +d=a[2];b[8]=gq;aO(b);return Y(Cv(d),c,b)}function +mJ(c,b){if(b[8]!==10&&b[8]!==b8){c3(b);return A(function(a){return mJ(c,a)},b)}aO(b);return Y([0,ed,[0,83,dv(b)]],function(a){return A(c,a)},b)}function +e5(a,b,c){if(c[8]===b8){aO(c);return Y(Cw,d7,c)}if(a){if(c[8]===47){aO(c);return Y([0,ed,[0,77,dv(c)]],function(a){return A(b,a)},c)}if(c[8]===42){c3(c);var +d=1;return A(function(a){return e5(d,b,a)},c)}by(c,Cl);c3(c);var +e=0;return A(function(a){return e5(e,b,a)},c)}if(c[8]===42){var +f=1;return A(function(a){return e5(f,b,a)},c)}c3(c);var +g=0;return A(function(a){return e5(g,b,a)},c)}function +Dh(c,b){if(b[8]===47)return A(function(a){return mJ(c,a)},b);if(b[8]===42){var +d=0;return A(function(a){return e5(d,c,a)},b)}aO(b);return Y(CC,c,b)}function +mK(c,b){return gr(b[8])?(aO(b),c3(b),A(function(a){return mK(c,a)},b)):Y([0,nJ,dv(b)],c,b)}function +iN(c,b){if(gr(b[8])){bP(b);return mK(function(a){return iN(c,a)},b)}if(b[8]!==47)return g(c,b);bP(b);function +d(a){return iN(c,a)}return A(function(a){return Dh(d,a)},b)}function +mL(c,b){return gr(b[8])?A(function(a){return mL(c,a)},b):g(c,b)}function +cE(a,b){return b[3]?iN(a,b):mL(a,b)}function +iO(h,b,c,d,e){function +f(a,b,c){by(c,gq);return Y(a,b,c)}if(0=b)return j1=b){by(e,((k&fr)<<10|b&fr)+ef|0);return g(d,e)}return f(Cs(b),d,e)}function +mM(c,b){var +a=b[8];if(34===a){by(b,Cg);return A(c,b)}if(92<=a){if(118>a)switch(a-92|0){case +0:by(b,Ck);return A(c,b);case +6:by(b,8);return A(c,b);case +10:by(b,12);return A(c,b);case +18:by(b,Cf);return A(c,b);case +22:by(b,13);return A(c,b);case +24:by(b,9);return A(c,b);case 25:var -d=4,e=0,f=0;return A(function(a){return ir(f,e,d,c,a)},b)}}else if(47===a){bv(b,Bg);return A(c,b)}aO(b);bv(b,gc);return Y(Bo(a),function(a){return A(c,a)},b)}function -eV(c,b){if(b[8]===b3){aO(b);return Y(Bu,dY,b)}if(!Bj(b[8])){cU(b);return A(function(a){return eV(c,a)},b)}if(b[8]===34){aO(b);return A(c,b)}if(b[8]===92){var -d=function(a){return eV(c,a)};return A(function(a){return l9(d,a)},b)}aO(b);bv(b,gc);function -e(a){return eV(c,a)}return Y(Br(b[8]),function(a){return A(e,a)},b)}function -l_(c,b){if(!lZ(b[8])&&b[8]!==b3){aO(b);cU(b);return A(function(a){return l_(c,a)},b)}var -a=dp(b);try{var -e=Y([0,bO,[0,a_,hl(a)]],c,b);return e}catch(f){var -d=aj(f);if(d[1]===eq)return Y(Bx(a),c,b);throw i(d,0)}}function -l$(c,b){if(!lZ(b[8])&&b[8]!==b3){aO(b);cU(b);return A(function(a){return l$(c,a)},b)}var -a=dp(b);return a!==fr?a!==fj?a!==ff?Y(By(a),c,b):Y(Cf,c,b):Y(Cg,c,b):Y(Ch,c,b)}function -ge(a,b,c){var -d=c[8];a:{if(gG<=d){var -e=d-110|0;if(6>>0){if(13!==e)break a;bJ(c);aO(c);c[11]=1;c[10]=1;var -g=c[9];c[9]=[0,[0,dw,l3(c)],g];return Y(Ci,function(a){return A(b,a)},c)}if(4>=e-1>>>0)break a}else{if(34===d){bJ(c);var -h=function(a,b){return Y([0,bO,[0,f,dp(b)]],a,b)},i=function(a){return h(b,a)};return A(function(a){return eV(i,a)},c)}if(91===d){bJ(c);aO(c);c[11]=1;var -k=c[9];c[9]=[0,[0,fe,l3(c)],k];return Y(Cj,function(a){return A(b,a)},c)}if(gJ>d)break a}bJ(c);return l$(b,c)}if(!Bk(d)&&d!==45)return j(a,b,c);bJ(c);return l_(b,c)}function -gf(f,b,c,d,e){if(e[8]!==f&&e[8]!==b&&e[8]!==b3){aO(e);return A(function(a){return gf(f,b,c,d,a)},e)}return Y(c,d,e)}function -Ck(c,b){function -d(a,b,c){bJ(c);return gf(lY,Be,a,b,c)}var -a=b[11];b[11]=0;if(b[8]===b3){l4(b);return Y(Bv,dY,b)}if(b[8]===93){l5(b);return Y(Cl,function(a){return A(c,a)},b)}if(a)return ge(function(a,b){return d(BC,a,b)},c,b);if(b[8]!==44)return d(BD,c,b);function -e(a,b){return d(l1,a,b)}function -f(a){return ge(e,c,a)}return A(function(a){return cv(f,a)},b)}function -gg(a,b,c){bJ(c);c[10]=1;return gf(lY,Bf,a,b,c)}function -Cm(c,b){b[10]=1;if(b[8]!==58)return gg(BB,c,b);function -d(a,b){return gg(l1,a,b)}function -e(a){return ge(d,c,a)}return A(function(a){return cv(e,a)},b)}function -Cn(c,b){function +d=4,e=0,f=0;return A(function(a){return iO(f,e,d,c,a)},b)}}else if(47===a){by(b,Cj);return A(c,b)}aO(b);by(b,gq);return Y(Cr(a),function(a){return A(c,a)},b)}function +e6(c,b){if(b[8]===b8){aO(b);return Y(Cx,d7,b)}if(!Cm(b[8])){c3(b);return A(function(a){return e6(c,a)},b)}if(b[8]===34){aO(b);return A(c,b)}if(b[8]===92){var +d=function(a){return e6(c,a)};return A(function(a){return mM(d,a)},b)}aO(b);by(b,gq);function +e(a){return e6(c,a)}return Y(Cu(b[8]),function(a){return A(e,a)},b)}function +mN(c,b){if(!mC(b[8])&&b[8]!==b8){aO(b);c3(b);return A(function(a){return mN(c,a)},b)}var +a=dv(b);try{var +e=Y([0,bU,[0,ba,hA(a)]],c,b);return e}catch(f){var +d=an(f);if(d[1]===ez)return Y(CA(a),c,b);throw i(d,0)}}function +mO(c,b){if(!mC(b[8])&&b[8]!==b8){aO(b);c3(b);return A(function(a){return mO(c,a)},b)}var +a=dv(b);return a!==fB?a!==ft?a!==fp?Y(CB(a),c,b):Y(Di,c,b):Y(Dj,c,b):Y(Dk,c,b)}function +gs(a,b,c){var +d=c[8];a:{if(gU<=d){var +e=d-110|0;if(6>>0){if(13!==e)break a;bP(c);aO(c);c[11]=1;c[10]=1;var +g=c[9];c[9]=[0,[0,dC,mG(c)],g];return Y(Dl,function(a){return A(b,a)},c)}if(4>=e-1>>>0)break a}else{if(34===d){bP(c);var +h=function(a,b){return Y([0,bU,[0,f,dv(b)]],a,b)},i=function(a){return h(b,a)};return A(function(a){return e6(i,a)},c)}if(91===d){bP(c);aO(c);c[11]=1;var +k=c[9];c[9]=[0,[0,fo,mG(c)],k];return Y(Dm,function(a){return A(b,a)},c)}if(gX>d)break a}bP(c);return mO(b,c)}if(!Cn(d)&&d!==45)return j(a,b,c);bP(c);return mN(b,c)}function +gt(f,b,c,d,e){if(e[8]!==f&&e[8]!==b&&e[8]!==b8){aO(e);return A(function(a){return gt(f,b,c,d,a)},e)}return Y(c,d,e)}function +Dn(c,b){function +d(a,b,c){bP(c);return gt(mB,Ch,a,b,c)}var +a=b[11];b[11]=0;if(b[8]===b8){mH(b);return Y(Cy,d7,b)}if(b[8]===93){mI(b);return Y(Do,function(a){return A(c,a)},b)}if(a)return gs(function(a,b){return d(CF,a,b)},c,b);if(b[8]!==44)return d(CG,c,b);function +e(a,b){return d(mE,a,b)}function +f(a){return gs(e,c,a)}return A(function(a){return cE(f,a)},b)}function +gu(a,b,c){bP(c);c[10]=1;return gt(mB,Ci,a,b,c)}function +Dp(c,b){b[10]=1;if(b[8]!==58)return gu(CE,c,b);function +d(a,b){return gu(mE,a,b)}function +e(a){return gs(d,c,a)}return A(function(a){return cE(e,a)},b)}function +Dq(c,b){function d(a,b,c){function -d(a,b){return Y([0,bO,[0,gV,dp(b)]],a,b)}if(c[8]!==34)return gg(a,b,c);bJ(c);function -e(a){return d(b,a)}return A(function(a){return eV(e,a)},c)}var -a=b[11];b[11]=0;b[10]=0;if(b[8]===b3){l4(b);return Y(Bw,dY,b)}if(b[8]===ed){l5(b);return Y(Co,function(a){return A(c,a)},b)}if(a)return d(BE,c,b);if(b[8]!==44)return gg(BF,c,b);function -e(a){return d(BA,c,a)}return A(function(a){return cv(e,a)},b)}function -Cp(a,b){return b[8]===b3?Y(co,dY,b):function(a,b){bJ(b);return gf(fI,fI,BG,a,b)}(dY,b)}function -eW(a){var -b=a[9];return b?dw<=b[1][1]?a[10]?cv(function(a){return Cn(eW,a)},a):cv(function(a){return Cm(eW,a)},a):cv(function(a){return Ck(eW,a)},a):cv(function(a){return Cp(eW,a)},a)}function -ma(d,b,c){if(!gd(c[8])&&c[8]!==b3){aO(c);return A(function(a){return ma(d,b,a)},c)}return Y(d,b,c)}function -mb(a,b){function -c(c,b){bJ(b);function -d(a){return mb(c,a)}return ma(l2,function(a){return cv(d,a)},b)}return b[8]!==b3?ge(c,a,b):Y(l2,a,b)}var -Bb=2147483646;function -Cq(a){function -b(a,b){return Ba(b[1])?Y(Bm,a,b):g(a,b)}function -c(a){return mb(eW,a)}function -d(a){return cv(c,a)}return A(function(a){return b(d,a)},a)}var -Cr=[0,g4,bE(10)];function -BJ(a,b){if(typeof -b==="number")return k(a)(BK);var -d=b[1];if(pY>d){if(e9===d){var -l=b[2];k(a)(B7);return fe<=l?dw<=l?k(a)(B8):k(a)(B9):d6<=l?k(a)(B_):k(a)(B$)}if(mZ<=d){var -z=b[2];return g(k(a)(Ca),z)}var -A=b[2];return j(k(a)(Cb),ip,A)}if(qN>d){if(cd<=d){var -c=b[2];k(a)(BV);return typeof -c==="number"?ny<=c?oU<=c?gV<=c?k(a)(BW):k(a)(BX):qS<=c?k(a)(BY):k(a)(BZ):d6<=c?k(a)(B0):k(a)(B1):iR<=c[1]?c[2]?k(a)(B2):k(a)(B3):c[2]?k(a)(B4):k(a)(B5)}var -y=b[2];return g(k(a)(B6),y)}if(d9<=d){var -e=b[2];k(a)(BL);var -f=e[1];if(pu===f){var -p=e[2];return j(k(a)(BM),eT,p)}if(pD<=f){if(pB<=f){var -q=e[2];return j(k(a)(BN),ip,q)}var -r=e[2];return j(k(a)(BO),eT,r)}if(ns<=f){var -s=e[2];return j(k(a)(BP),eT,s)}var -t=e[2];return j(k(a)(BQ),ip,t)}var -i=b[2],n=m(i);k(a)(BR);if(0d){if(fi===d){var +l=b[2];k(a)(C_);return fo<=l?dC<=l?k(a)(C$):k(a)(Da):ed<=l?k(a)(Db):k(a)(Dc)}if(nE<=d){var +z=b[2];return g(k(a)(Dd),z)}var +A=b[2];return j(k(a)(De),iM,A)}if(ro>d){if(ci<=d){var +c=b[2];k(a)(CY);return typeof +c==="number"?oc<=c?pv<=c?g9<=c?k(a)(CZ):k(a)(C0):ru<=c?k(a)(C1):k(a)(C2):ed<=c?k(a)(C3):k(a)(C4):je<=c[1]?c[2]?k(a)(C5):k(a)(C6):c[2]?k(a)(C7):k(a)(C8)}var +y=b[2];return g(k(a)(C9),y)}if(eg<=d){var +e=b[2];k(a)(CO);var +f=e[1];if(p9===f){var +p=e[2];return j(k(a)(CP),e4,p)}if(qg<=f){if(qe<=f){var +q=e[2];return j(k(a)(CQ),iM,q)}var +r=e[2];return j(k(a)(CR),e4,r)}if(n8<=f){var +s=e[2];return j(k(a)(CS),e4,s)}var +t=e[2];return j(k(a)(CT),iM,t)}var +i=b[2],n=m(i);k(a)(CU);if(0=1){var h=v;for(;;){var -w=X(i,h);g(k(a)(BU),w);var -x=h+1|0;if(o===h)break;h=x}}return k(a)(BT)}function -Cs(a,b){var -c=A_([0,Cr],a,b);return[0,c,bX(d4),0,1,0,1,0,Bb,0,0,0,Cq]}function -Ct(a){a[3]=0;var +w=ai(i,h);g(k(a)(CX),w);var +x=h+1|0;if(o===h)break;h=x}}return k(a)(CW)}function +Dv(a,b){var +c=Cb([0,Du],a,b);return[0,c,bs(eb),0,1,0,1,0,Ce,0,0,0,Dt]}function +Dw(a){a[3]=0;var b=g(a[12],a);if(typeof b!=="number"){var -c=b[1];if(bO!==c&&ag>c)throw i([0,t,Cu],1)}return b}function -Cv(a){return[0,[0,a[4],a[5]],[0,a[6],a[7]]]}var -mc=[J,CC,aZ(0)];function -Cw(a){var -c=Cs(0,a),e=[J,Cx,aZ(0)];function -l(a){return Cv(c)}function +c=b[1];if(bU!==c&&af>c)throw i([0,u,Dx],1)}return b}function +Dy(a){return[0,[0,a[4],a[5]],[0,a[6],a[7]]]}var +mR=[L,DF,a5(0)];function +Dz(a){var +c=Dv(0,a),e=[L,DA,a5(0)];function +l(a){return Dy(c)}function h(a){var -b=Ct(c);if(typeof -b==="number"){if(gZ<=b)throw i([0,t,Cy],1);throw i([0,e,Cz],1)}if(ag>b[1])return b[2];var -d=b[2];throw i([0,e,[0,ag,[0,l(0),d]]],1)}function +b=Dw(c);if(typeof +b==="number"){if(ha<=b)throw i([0,u,DB],1);throw i([0,e,DC],1)}if(af>b[1])return b[2];var +d=b[2];throw i([0,e,[0,af,[0,l(0),d]]],1)}function g(a,b,c){a:{if(typeof -b==="number"){if(fe===b){var -h=0;return a<50?k(a+1|0,h,c):y(k,[0,h,c])}if(dw===b){var -m=0;return a<50?j(a+1|0,m,c):y(j,[0,m,c])}if(cC===b)break a}else{var -g=b[1];if(f===g||a_===g||ba===g)break a}throw i([0,e,[0,gR,[0,bO,[0,l(0),b,CA]]]],1)}return a<50?d(a+1|0,b,c):y(d,[0,b,c])}function +b==="number"){if(fo===b){var +h=0;return a<50?k(a+1|0,h,c):v(k,[0,h,c])}if(dC===b){var +m=0;return a<50?j(a+1|0,m,c):v(j,[0,m,c])}if(cL===b)break a}else{var +g=b[1];if(f===g||ba===g||bc===g)break a}throw i([0,e,[0,g5,[0,bU,[0,l(0),b,DD]]]],1)}return a<50?d(a+1|0,b,c):v(d,[0,b,c])}function k(a,b,c){var -e=h(0);if(q3===e){var -f=[0,65,a6(b)];return a<50?d(a+1|0,f,c):y(d,[0,f,c])}var -i=[0,b,c];return a<50?g(a+1|0,e,i):y(g,[0,e,i])}function +e=h(0);if(typeof +e==="number"&&rG===e){var +f=[0,65,bI(b)];return a<50?d(a+1|0,f,c):v(d,[0,f,c])}var +i=[0,b,c];return a<50?g(a+1|0,e,i):v(g,[0,e,i])}function j(a,b,c){var f=h(0);if(typeof -f==="number"){if(n6===f){var -j=[0,79,a6(b)];return a<50?d(a+1|0,j,c):y(d,[0,j,c])}}else if(gV===f[1]){var -k=[1,f[2],b,c],m=h(0);return a<50?g(a+1|0,m,k):y(g,[0,m,k])}throw i([0,e,[0,gR,[0,bO,[0,l(0),f,CB]]]],1)}function +f==="number"){if(oK===f){var +j=[0,79,bI(b)];return a<50?d(a+1|0,j,c):v(d,[0,j,c])}}else if(g9===f[1]){var +k=[1,f[2],b,c],m=h(0);return a<50?g(a+1|0,m,k):v(g,[0,m,k])}throw i([0,e,[0,g5,[0,bU,[0,l(0),f,DE]]]],1)}function d(a,b,c){if(typeof c==="number")return b;if(0===c[0]){var -d=c[2],e=[0,b,c[1]];return a<50?k(a+1|0,e,d):y(k,[0,e,d])}var -f=c[3],g=[0,[0,c[1],b],c[2]];return a<50?j(a+1|0,g,f):y(j,[0,g,f])}function -m(a,b){return cO(g(0,a,b))}try{var +d=c[2],e=[0,b,c[1]];return a<50?k(a+1|0,e,d):v(k,[0,e,d])}var +f=c[3],g=[0,[0,c[1],b],c[2]];return a<50?j(a+1|0,g,f):v(j,[0,g,f])}function +m(a,b){return cq(g(0,a,b))}try{var n=[0,m(h(0),0)];return n}catch(f){var -b=aj(f);if(b[1]===e)return[1,b[2]];throw i(b,0)}}function -CD(c,b){return kK(function(a){throw i([0,mc,c,a],1)},b)}function -CE(a){var -b=a[1];if(381139274===b)return CF;if(gR>b){var -e=a[2][2];return j(xV(CI),BJ,e)}var +b=an(f);if(b[1]===e)return[1,b[2]];throw i(b,0)}}function +DG(c,b){return lg(function(a){throw i([0,mR,c,a],1)},b)}function +DH(a){var +b=a[1];if(381139274===b)return DI;if(g5>b){var +e=a[2][2];return j(y2(DL),CM,e)}var c=a[2];if(typeof -c==="number")return lg(CG);var -d=c[2][3];return g(lg(CH),d)}function -CJ(a){return Cw(a)}function -CK(a){var -b=CJ(a);if(0===b[0])return b[1];var -c=CE(b[1]);return g(CD(cC,CL),c)}function -CM(a){return CK([0,f,a])}function -CN(a){a:if(typeof +c==="number")return lU(DJ);var +d=c[2][3];return g(lU(DK),d)}function +DM(a){return Dz(a)}function +DN(a){var +b=DM(a);if(0===b[0])return b[1];var +c=DH(b[1]);return g(DG(cL,DO),c)}function +DP(a){return DN([0,f,a])}function +DQ(a){a:if(typeof a!=="number"){var -b=a[1];if(65!==b&&79!==b)break a;return a}throw i([0,mc,a,CO],1)}function -CP(a){return CN(CM(a))}var -CT=eu(function(a){return[0,a,CS]},sK(function(a){return cB>>a|0)?1:0}if(c(7,b))return p(a,at(b));if(c(11,b)){p(a,at(hf|(b>>>6|0)&31));return p(a,at(M|b&63))}if(c(16,b)){p(a,at(ef|(b>>>12|0)&15));p(a,at(M|(b>>>6|0)&63));return p(a,at(M|b&63))}if(c(21,b)){p(a,at(d5|(b>>>18|0)&7));p(a,at(M|(b>>>12|0)&63));p(a,at(M|(b>>>6|0)&63));return p(a,at(M|b&63))}if(c(26,b)){p(a,at(J|(b>>>24|0)&3));p(a,at(M|(b>>>18|0)&63));p(a,at(M|(b>>>12|0)&63));p(a,at(M|(b>>>6|0)&63));return p(a,at(M|b&63))}if(!c(31,b))throw i([0,t,C5],1);p(a,at(ec|(b>>>30|0)&1));p(a,at(M|(b>>>24|0)&63));p(a,at(M|(b>>>18|0)&63));p(a,at(M|(b>>>12|0)&63));p(a,at(M|(b>>>6|0)&63));return p(a,at(M|b&63))}function -C6(a,b){return d8+((a-55296|0)<<10|b-56320|0)|0}function -C7(a,b,c){return mi(a,C6(b,c))}var -C9=[J,C8,aZ(0)];function -gh(a){throw i([0,C9,a],1)}var -ix=[J,C_,aZ(0)],iy=[J,C$,aZ(0)],iz=[J,Da,aZ(0)],mj=[J,Db,aZ(0)];function -Dc(a,b,c,d){var -e=c?c[1]:1,f=a?a[1]:bX(cn);return[0,f,e,0,b]}function -iJ(a,b,c,d){var -e=0;return a<50?mF(a+1|0,b,c,d,e):y(mF,[0,b,c,d,e])}function -De(a,b,c){return cO(iJ(0,a,b,c))}function -mF(a,b,c,d,e){var +f=gl(b,48);if(f)return mf(b,57);var +e=f}return e}return function(a){return AV(b,a)}(hV(D1(0,D7,a)))}function +mX(a,b){function +c(a,b){return 0===(b>>>a|0)?1:0}if(c(7,b))return o(a,au(b));if(c(11,b)){o(a,au(hs|(b>>>6|0)&31));return o(a,au(M|b&63))}if(c(16,b)){o(a,au(eo|(b>>>12|0)&15));o(a,au(M|(b>>>6|0)&63));return o(a,au(M|b&63))}if(c(21,b)){o(a,au(ec|(b>>>18|0)&7));o(a,au(M|(b>>>12|0)&63));o(a,au(M|(b>>>6|0)&63));return o(a,au(M|b&63))}if(c(26,b)){o(a,au(L|(b>>>24|0)&3));o(a,au(M|(b>>>18|0)&63));o(a,au(M|(b>>>12|0)&63));o(a,au(M|(b>>>6|0)&63));return o(a,au(M|b&63))}if(!c(31,b))throw i([0,u,D8],1);o(a,au(el|(b>>>30|0)&1));o(a,au(M|(b>>>24|0)&63));o(a,au(M|(b>>>18|0)&63));o(a,au(M|(b>>>12|0)&63));o(a,au(M|(b>>>6|0)&63));return o(a,au(M|b&63))}function +D9(a,b){return ef+((a-55296|0)<<10|b-56320|0)|0}function +D_(a,b,c){return mX(a,D9(b,c))}var +Ea=[L,D$,a5(0)];function +gv(a){throw i([0,Ea,a],1)}var +iU=[L,Eb,a5(0)],iV=[L,Ec,a5(0)],iW=[L,Ed,a5(0)],mY=[L,Ee,a5(0)];function +Ef(a,b,c,d){var +e=c?c[1]:1,f=a?a[1]:bs(cu);return[0,f,e,0,b]}function +i8(a,b,c,d){var +e=0;return a<50?nk(a+1|0,b,c,d,e):v(nk,[0,b,c,d,e])}function +Eh(a,b,c){return cq(i8(0,a,b,c))}function +nk(a,b,c,d,e){var h=e;for(;;){var -f=tx(Dd,h,d);if(0===f)return;if(1===f){if(0>=c)return;p(b,tA(d,0));var -i=c-1|0;return a<50?iJ(a+1|0,b,i,d):y(iJ,[0,b,i,d])}g(d[1],d);h=f}}function -Df(a,b,c){var -d=c[4],e=c[5];De(a,b,c);c[5]=e+1|0;c[4]=d;return}function -mk(a){var -b=10<=a?a+87|0:a+48|0;return at(b)}function -dq(a,b,c,d,e){eB(d,a,b[1],c-b[1]|0);aD(d,e);b[1]=c+1|0;return}function -Dg(a,b,c,d,e){eB(d,a,b[1],c-b[1]|0);aD(d,Dh);p(d,mk(e>>>4|0));p(d,mk(e&15));b[1]=c+1|0;return}function -Di(a,b,c){try{eB(c,a,b[1],m(a)-b[1]|0);return}catch(f){var -d=aj(f),e=m(a)-b[1]|0,g=b[1];bN(fT(Dj),a,g,e);throw i(d,0)}}function -Dk(a,b){var +f=uq(Eg,h,d);if(0===f)return;if(1===f){if(0>=c)return;o(b,ut(d,0));var +i=c-1|0;return a<50?i8(a+1|0,b,i,d):v(i8,[0,b,i,d])}g(d[1],d);h=f}}function +Ei(a,b,c){var +d=c[4],e=c[5];Eh(a,b,c);c[5]=e+1|0;c[4]=d;return}function +mZ(a){var +b=10<=a?a+87|0:a+48|0;return au(b)}function +dw(a,b,c,d,e){dP(d,a,b[1],c-b[1]|0);aD(d,e);b[1]=c+1|0;return}function +Ej(a,b,c,d,e){dP(d,a,b[1],c-b[1]|0);aD(d,Ek);o(d,mZ(e>>>4|0));o(d,mZ(e&15));b[1]=c+1|0;return}function +El(a,b,c){try{dP(c,a,b[1],m(a)-b[1]|0);return}catch(f){var +d=an(f),e=m(a)-b[1]|0,g=b[1];bT(f2(Em),a,g,e);throw i(d,0)}}function +En(a,b){var d=[0,0],f=m(b)-1|0,g=0;if(f>=0){var c=g;for(;;){var -e=X(b,c);a:if(92===e)dq(b,d,c,a,Dl);else{b:{c:{if(35>e){if(8>e)break b;switch(e-8|0){case -0:dq(b,d,c,a,Dm);break;case -1:dq(b,d,c,a,Dn);break;case -2:dq(b,d,c,a,Do);break;case -4:dq(b,d,c,a,Dp);break;case -5:dq(b,d,c,a,Dq);break;case -26:dq(b,d,c,a,Dr);break;case +e=ai(b,c);a:if(92===e)dw(b,d,c,a,Eo);else{b:{c:{if(35>e){if(8>e)break b;switch(e-8|0){case +0:dw(b,d,c,a,Ep);break;case +1:dw(b,d,c,a,Eq);break;case +2:dw(b,d,c,a,Er);break;case +4:dw(b,d,c,a,Es);break;case +5:dw(b,d,c,a,Et);break;case +26:dw(b,d,c,a,Eu);break;case 24:case -25:break c;default:break b}break a}if(cB===e)break b}break a}Dg(b,d,c,a,e)}var -h=c+1|0;if(f===c)break;c=h}}return Di(b,d,a)}function -dr(a,b){p(a,34);Dk(a,b);return p(a,34)}function -ml(a,b){return aD(a,Ds)}function -mm(a,b){var -c=b?Dt:Du;return aD(a,c)}function -Dv(a){return at(a+48|0)}function -iA(a,b){return 0===b?0:(iA(a,b/10|0),p(a,Dv(er(b%10|0))))}function -mn(a,b){return 0=0){var b=f;for(;;){var -c=X(a,b);a:{if(48<=c){if(58>c)break a}else if(45===c)break a;throw i(j6,1)}var +c=ai(a,b);a:{if(48<=c){if(58>c)break a}else if(45===c)break a;throw i(kv,1)}var h=b+1|0;if(e===b)break;b=h}}var g=1;return g}catch(f){var -d=aj(f);if(d===j6)return 0;throw i(d,0)}}function -Dw(a,b){var -c=jM(b);if(3===c){var -h=0.c)return cJ<=c?a_<=c?Dw(a,b[2]):mn(a,b[2]):dv<=c?aD(a,b[2]):dr(a,b[2]);if(fi===c)return DN(a,b[2]);if(h<=c)return L<=c?DL(a,b[2]):DM(a,b[2]);if(ba<=c)return mm(a,b[2]);var -d=b[2];return DO(a,d[1],d[2])}function -DL(a,b){p(a,d$);dZ(function(a,b){var -c=b[2];dr(a,b[1]);p(a,58);return eX(a,c)},d0,a,b);return p(a,ed)}function -DM(a,b){p(a,91);dZ(eX,d0,a,b);return p(a,93)}function -DN(a,b){p(a,40);dZ(eX,d0,a,b);return p(a,41)}function -DO(a,b,c){p(a,60);dr(a,b);if(c){var -d=c[1];p(a,58);eX(a,d)}return p(a,62)}function -eY(a,b){if(typeof -b==="number")return ml(a,0);var -c=b[1];if(fp>c)return cJ<=c?a_<=c?DD(a,b[2]):mn(a,b[2]):dv<=c?aD(a,b[2]):dr(a,b[2]);if(fi===c)return DR(a,b[2]);if(h<=c)return L<=c?DP(a,b[2]):DQ(a,b[2]);if(ba<=c)return mm(a,b[2]);var -d=b[2];return DS(a,d[1],d[2])}function -DP(a,b){p(a,d$);dZ(function(a,b){var -c=b[2];dr(a,b[1]);p(a,58);return eY(a,c)},d0,a,b);return p(a,ed)}function -DQ(a,b){p(a,91);dZ(eY,d0,a,b);return p(a,93)}function -DR(a,b){p(a,91);dZ(eY,d0,a,b);return p(a,93)}function -DS(a,b,c){if(!c)return dr(a,b);var -d=c[1];p(a,91);dr(a,b);p(a,44);eY(a,d);return p(a,93)}function -DT(a,b,c,d){var -e=a?a[1]:DU,f=b?b[1]:0;if(f)eY(c,d);else -eX(c,d);return aD(c,e)}function -a8(a,b,c){return rG(a,b,c)}function -mp(a){return a+fo|0}function -cV(a){if(65<=a){if(97<=a){if(gG>a)return(a-97|0)+10|0}else if(71>a)return(a-65|0)+10|0}else if(9>=a+fo>>>0)return a-48|0;throw i([0,t,DX],1)}function -bZ(a,b,c){var -e=c[4]-1|0,f=b[3],d=((e+c[5]|0)-f|0)-1|0,h=rX(d,(e+c[6]|0)-f|0),i=b[4];if(i)var -l=i[1],k=g(ae(DY),l);else +d8(a,b,c,d){if(!d)return;var +e=d[2];j(a,c,d[1]);return EN(a,b,c,e)}function +d9(a){return o(a,44)}function +e8(a,b){if(typeof +b==="number")return m0(a,0);var +c=b[1];if(fz>c)return cS<=c?ba<=c?Ez(a,b[2]):m2(a,b[2]):dB<=c?aD(a,b[2]):dx(a,b[2]);if(fs===c)return EQ(a,b[2]);if(h<=c)return K<=c?EO(a,b[2]):EP(a,b[2]);if(bc<=c)return m1(a,b[2]);var +d=b[2];return ER(a,d[1],d[2])}function +EO(a,b){o(a,ei);d8(function(a,b){var +c=b[2];dx(a,b[1]);o(a,58);return e8(a,c)},d9,a,b);return o(a,em)}function +EP(a,b){o(a,91);d8(e8,d9,a,b);return o(a,93)}function +EQ(a,b){o(a,40);d8(e8,d9,a,b);return o(a,41)}function +ER(a,b,c){o(a,60);dx(a,b);if(c){var +d=c[1];o(a,58);e8(a,d)}return o(a,62)}function +e9(a,b){if(typeof +b==="number")return m0(a,0);var +c=b[1];if(fz>c)return cS<=c?ba<=c?EG(a,b[2]):m2(a,b[2]):dB<=c?aD(a,b[2]):dx(a,b[2]);if(fs===c)return EU(a,b[2]);if(h<=c)return K<=c?ES(a,b[2]):ET(a,b[2]);if(bc<=c)return m1(a,b[2]);var +d=b[2];return EV(a,d[1],d[2])}function +ES(a,b){o(a,ei);d8(function(a,b){var +c=b[2];dx(a,b[1]);o(a,58);return e9(a,c)},d9,a,b);return o(a,em)}function +ET(a,b){o(a,91);d8(e9,d9,a,b);return o(a,93)}function +EU(a,b){o(a,91);d8(e9,d9,a,b);return o(a,93)}function +EV(a,b,c){if(!c)return dx(a,b);var +d=c[1];o(a,91);dx(a,b);o(a,44);e9(a,d);return o(a,93)}function +EW(a,b,c,d){var +e=a?a[1]:EX,f=b?b[1]:0;if(f)e9(c,d);else +e8(c,d);return aD(c,e)}function +a_(a,b,c){return sq(a,b,c)}function +m4(a){return a+fy|0}function +c4(a){if(65<=a){if(97<=a){if(gU>a)return(a-97|0)+10|0}else if(71>a)return(a-65|0)+10|0}else if(9>=a+fy>>>0)return a-48|0;throw i([0,u,E0],1)}function +b4(a,b,c){var +e=c[4]-1|0,f=b[3],d=((e+c[5]|0)-f|0)-1|0,h=sK(d,(e+c[6]|0)-f|0),i=b[4];if(i)var +l=i[1],k=g(X(E1),l);else var -k=D2;var -m=d===h?g(ae(DZ),d+1|0):j(ae(D1),d+1|0,h+1|0),n=b[2];return gh(e8(ae(D0),k,n,m,a))}function -bK(a,b,c){var -d=32,f=fP(c),e=bX(d);Df(e,d,c);var -g=bY(e);return bZ(bN(ae(D3),a,f,g),b,c)}function -DV(a,b,c,d,e){var -h=b?b[1]:cn,i=c?c[1]:DW;if(a){var -g=a[1];ez(g);var +k=E5;var +m=d===h?g(X(E2),d+1|0):j(X(E4),d+1|0,h+1|0),n=b[2];return gv(fh(X(E3),k,n,m,a))}function +bQ(a,b,c){var +d=32,f=fY(c),e=bs(d);Ei(e,d,c);var +g=bJ(e);return b4(bT(X(E6),a,f,g),b,c)}function +EY(a,b,c,d,e){var +h=b?b[1]:cu,i=c?c[1]:EZ;if(a){var +g=a[1];dO(g);var f=g}else var -f=bX(h);DT([0,i],d,f,e);var -j=bY(f);ez(f);return j}var -d1=[J,D4,aZ(0)];function -D5(a){var +f=bs(h);EW([0,i],d,f,e);var +j=bJ(f);dO(f);return j}var +d_=[L,E7,a5(0)];function +E8(a){var d=a[5],b=[0,0],e=a[6]-1|0,f=a[2];if(e>=d){var -c=d;for(;;){if(214748365<=b[1])throw i(d1,1);var -g=mp(ft(f,c));b[1]=(10*b[1]|0)+g|0;var -h=c+1|0;if(e===c)break;c=h}}if(0<=b[1])return b[1];throw i(d1,1)}function -D6(a,b){try{var -d=[0,cJ,D5(b)];return d}catch(f){var -c=aj(f);if(c===d1)return[0,dv,fP(b)];throw i(c,0)}}function -D7(a){var +c=d;for(;;){if(214748365<=b[1])throw i(d_,1);var +g=m4(fE(f,c));b[1]=(10*b[1]|0)+g|0;var +h=c+1|0;if(e===c)break;c=h}}if(0<=b[1])return b[1];throw i(d_,1)}function +E9(a,b){try{var +d=[0,cS,E8(b)];return d}catch(f){var +c=an(f);if(c===d_)return[0,dB,fY(b)];throw i(c,0)}}function +E_(a){var d=a[5]+1|0,b=[0,0],e=a[6]-1|0,f=a[2];if(e>=d){var -c=d;for(;;){if(b[1]<=-214748365)throw i(d1,1);var -g=mp(ft(f,c));b[1]=(10*b[1]|0)-g|0;var -h=c+1|0;if(e===c)break;c=h}}if(0>>0){g(c[1],c);m=l}else +l=a_(a$,m,c);if(19>>0){g(c[1],c);m=l}else switch(l){case -0:return Ev;case -1:return Ew;case -2:return cC;case -3:return[0,a_,r4];case -4:return[0,a_,r0];case -5:return[0,a_,r2];case -6:ez(b[1]);return[0,f,mq(b,c)];case -7:return D6(b,c);case -8:return D8(b,c);case -9:return[0,a_,hl(fP(c))];case +0:return Fy;case +1:return Fz;case +2:return cL;case +3:return[0,ba,sR];case +4:return[0,ba,sN];case +5:return[0,ba,sP];case +6:dO(b[1]);return[0,f,m5(b,c)];case +7:return E9(b,c);case +8:return E$(b,c);case +9:return[0,ba,hA(fY(c))];case 10:var -e=[0,0];try{a3(b,c);Eq(c);var -q=iB(b,c);a3(b,c);mt(b,c);a3(b,c);var -r=e[1];e[1]=[0,[0,q,cW(b,c)],r];for(;;){a3(b,c);Es(b,c);a3(b,c);var -s=iB(b,c);a3(b,c);mt(b,c);a3(b,c);var -t=e[1];e[1]=[0,[0,s,cW(b,c)],t]}}catch(f){var -n=aj(f);if(n===iy)return[0,L,a6(e[1])];throw i(n,0)}break;case +e=[0,0];try{a2(b,c);Ft(c);var +q=iY(b,c);a2(b,c);m8(b,c);a2(b,c);var +r=e[1];e[1]=[0,[0,q,c5(b,c)],r];for(;;){a2(b,c);Fv(b,c);a2(b,c);var +s=iY(b,c);a2(b,c);m8(b,c);a2(b,c);var +t=e[1];e[1]=[0,[0,s,c5(b,c)],t]}}catch(f){var +n=an(f);if(n===iV)return[0,K,bI(e[1])];throw i(n,0)}break;case 11:var -j=[0,0];try{a3(b,c);Ei(c);var -u=j[1];j[1]=[0,cW(b,c),u];for(;;){a3(b,c);Ek(b,c);a3(b,c);var -v=j[1];j[1]=[0,cW(b,c),v]}}catch(f){var -o=aj(f);if(o===ix)return[0,h,a6(j[1])];throw i(o,0)}break;case +j=[0,0];try{a2(b,c);Fl(c);var +u=j[1];j[1]=[0,c5(b,c),u];for(;;){a2(b,c);Fn(b,c);a2(b,c);var +w=j[1];j[1]=[0,c5(b,c),w]}}catch(f){var +o=an(f);if(o===iU)return[0,h,bI(j[1])];throw i(o,0)}break;case 12:var -k=[0,0];try{a3(b,c);Em(c);var -w=k[1];k[1]=[0,cW(b,c),w];for(;;){a3(b,c);Eo(b,c);a3(b,c);var -x=k[1];k[1]=[0,cW(b,c),x]}}catch(f){var -p=aj(f);if(p===iz)return[0,fi,a6(k[1])];throw i(p,0)}break;case -13:a3(b,c);var -z=iB(b,c);a3(b,c);return[0,fp,[0,z,Ec(b,c)]];case -14:return a<50?cA(a+1|0,b,c):y(cA,[0,b,c]);case -15:mr(b,c);return a<50?cA(a+1|0,b,c):y(cA,[0,b,c]);case -16:gi(b,c);return a<50?cA(a+1|0,b,c):y(cA,[0,b,c]);case -17:return a<50?cA(a+1|0,b,c):y(cA,[0,b,c]);case -18:return bZ(Ex,b,c);default:return bK(Ey,b,c)}}}function -e7(a,b,c){var -d=58;return a<50?mI(a+1|0,b,c,d):y(mI,[0,b,c,d])}function -mq(a,b){return cO(e7(0,a,b))}function -mI(a,b,c,d){var +k=[0,0];try{a2(b,c);Fp(c);var +x=k[1];k[1]=[0,c5(b,c),x];for(;;){a2(b,c);Fr(b,c);a2(b,c);var +y=k[1];k[1]=[0,c5(b,c),y]}}catch(f){var +p=an(f);if(p===iW)return[0,fs,bI(k[1])];throw i(p,0)}break;case +13:a2(b,c);var +z=iY(b,c);a2(b,c);return[0,fz,[0,z,Ff(b,c)]];case +14:return a<50?cJ(a+1|0,b,c):v(cJ,[0,b,c]);case +15:m6(b,c);return a<50?cJ(a+1|0,b,c):v(cJ,[0,b,c]);case +16:gw(b,c);return a<50?cJ(a+1|0,b,c):v(cJ,[0,b,c]);case +17:return a<50?cJ(a+1|0,b,c):v(cJ,[0,b,c]);case +18:return b4(FA,b,c);default:return bQ(FB,b,c)}}}function +fg(a,b,c){var +d=58;return a<50?nn(a+1|0,b,c,d):v(nn,[0,b,c,d])}function +m5(a,b){return cq(fg(0,a,b))}function +nn(a,b,c,d){var f=d;for(;;){var -e=a8(a9,f,c);if(3>=e>>>0)switch(e){case -0:return bY(b[1]);case -1:D_(b,c);return a<50?e7(a+1|0,b,c):y(e7,[0,b,c]);case -2:D9(b[1],c);return a<50?e7(a+1|0,b,c):y(e7,[0,b,c]);default:return bZ(Ez,b,c)}g(c[1],c);f=e}}function -D_(a,b){return D$(a,b,68)}function -D$(a,b,c){var +e=a_(a$,f,c);if(3>=e>>>0)switch(e){case +0:return bJ(b[1]);case +1:Fb(b,c);return a<50?fg(a+1|0,b,c):v(fg,[0,b,c]);case +2:Fa(b[1],c);return a<50?fg(a+1|0,b,c):v(fg,[0,b,c]);default:return b4(FC,b,c)}g(c[1],c);f=e}}function +Fb(a,b){return Fc(a,b,68)}function +Fc(a,b,c){var f=c;for(;;){var -e=a8(a9,f,b);if(8>=e>>>0)switch(e){case +e=a_(a$,f,b);if(8>=e>>>0)switch(e){case 0:var -h=cr(b,b[5]);return p(a[1],h);case -1:return p(a[1],8);case -2:return p(a[1],12);case -3:return p(a[1],10);case -4:return p(a[1],13);case -5:return p(a[1],9);case +h=cy(b,b[5]);return o(a[1],h);case +1:return o(a[1],8);case +2:return o(a[1],12);case +3:return o(a[1],10);case +4:return o(a[1],13);case +5:return o(a[1],9);case 6:var -i=cr(b,b[5]+1|0),j=cr(b,b[5]+2|0),k=cr(b,b[5]+3|0),l=cV(cr(b,b[5]+4|0)),m=cV(k)<<4,n=cV(j)<<8,d=cV(i)<<12|n|m|l;if(iQ<=d&&jC>=d)return Ea(a,d,b);return mi(a[1],d);case -7:return bK(EA,a,b);default:return bZ(EB,a,b)}g(b[1],b);f=e}}function -Ea(a,b,c){return Eb(a,b,c,82)}function -Eb(a,b,c,d){var +i=cy(b,b[5]+1|0),j=cy(b,b[5]+2|0),k=cy(b,b[5]+3|0),l=c4(cy(b,b[5]+4|0)),m=c4(k)<<4,n=c4(j)<<8,d=c4(i)<<12|n|m|l;if(jd<=d&&j1>=d)return Fd(a,d,b);return mX(a[1],d);case +7:return bQ(FD,a,b);default:return b4(FE,a,b)}g(b[1],b);f=e}}function +Fd(a,b,c){return Fe(a,b,c,82)}function +Fe(a,b,c,d){var h=d;for(;;){var -e=a8(a9,h,c);if(2>=e>>>0)switch(e){case +e=a_(a$,h,c);if(2>=e>>>0)switch(e){case 0:var -i=cr(c,c[5]+2|0),j=cr(c,c[5]+3|0),k=cr(c,c[5]+4|0),l=cV(cr(c,c[5]+5|0)),m=cV(k)<<4,n=cV(j)<<8,f=cV(i)<<12|n|m|l;if(jo<=f&&fa>=f)return C7(a[1],b,f);return bK(EC,a,c);case -1:return bK(ED,a,c);default:return bZ(EE,a,c)}g(c[1],c);h=e}}function -Ec(a,b){return Ed(a,b,gJ)}function -Ed(a,b,c){var +i=cy(c,c[5]+2|0),j=cy(c,c[5]+3|0),k=cy(c,c[5]+4|0),l=c4(cy(c,c[5]+5|0)),m=c4(k)<<4,n=c4(j)<<8,f=c4(i)<<12|n|m|l;if(jN<=f&&fl>=f)return D_(a[1],b,f);return bQ(FF,a,c);case +1:return bQ(FG,a,c);default:return b4(FH,a,c)}g(c[1],c);h=e}}function +Ff(a,b){return Fg(a,b,gX)}function +Fg(a,b,c){var e=c;for(;;){var -d=a8(a9,e,b);if(3>=d>>>0)switch(d){case +d=a_(a$,e,b);if(3>=d>>>0)switch(d){case 0:var -f=cW(a,b);a3(a,b);Ee(a,b);return[0,f];case +f=c5(a,b);a2(a,b);Fh(a,b);return[0,f];case 1:return 0;case -2:return bK(EF,a,b);default:return bZ(EG,a,b)}g(b[1],b);e=d}}function -Ee(a,b){return Ef(a,b,111)}function -Ef(a,b,c){var +2:return bQ(FI,a,b);default:return b4(FJ,a,b)}g(b[1],b);e=d}}function +Fh(a,b){return Fi(a,b,111)}function +Fi(a,b,c){var e=c;for(;;){var -d=a8(a9,e,b);if(2>=d>>>0)switch(d){case +d=a_(a$,e,b);if(2>=d>>>0)switch(d){case 0:return;case -1:return bK(EH,a,b);default:return bZ(EI,a,b)}g(b[1],b);e=d}}function -e6(a,b,c){var -d=ed;return a<50?mH(a+1|0,b,c,d):y(mH,[0,b,c,d])}function -mr(a,b){return cO(e6(0,a,b))}function -mH(a,b,c,d){var +1:return bQ(FK,a,b);default:return b4(FL,a,b)}g(b[1],b);e=d}}function +ff(a,b,c){var +d=em;return a<50?nm(a+1|0,b,c,d):v(nm,[0,b,c,d])}function +m6(a,b){return cq(ff(0,a,b))}function +nm(a,b,c,d){var f=d;for(;;){var -e=a8(a9,f,c);if(3>=e>>>0)switch(e){case +e=a_(a$,f,c);if(3>=e>>>0)switch(e){case 0:return;case -1:return bK(EJ,b,c);case -2:gi(b,c);return a<50?e6(a+1|0,b,c):y(e6,[0,b,c]);default:return a<50?e6(a+1|0,b,c):y(e6,[0,b,c])}g(c[1],c);f=e}}function -ms(a){return Eg(a,131)}function -Eg(a,b){var +1:return bQ(FM,b,c);case +2:gw(b,c);return a<50?ff(a+1|0,b,c):v(ff,[0,b,c]);default:return a<50?ff(a+1|0,b,c):v(ff,[0,b,c])}g(c[1],c);f=e}}function +m7(a){return Fj(a,131)}function +Fj(a,b){var d=b;for(;;){var -c=a8(a9,d,a);if(0===c)return 1;if(1===c)return 0;g(a[1],a);d=c}}function -cz(a,b,c){var -d=jy;return a<50?mG(a+1|0,b,c,d):y(mG,[0,b,c,d])}function -a3(a,b){return cO(cz(0,a,b))}function -mG(a,b,c,d){var +c=a_(a$,d,a);if(0===c)return 1;if(1===c)return 0;g(a[1],a);d=c}}function +cI(a,b,c){var +d=jX;return a<50?nl(a+1|0,b,c,d):v(nl,[0,b,c,d])}function +a2(a,b){return cq(cI(0,a,b))}function +nl(a,b,c,d){var f=d;for(;;){var -e=a8(a9,f,c);if(4>=e>>>0)switch(e){case -0:gi(b,c);return a<50?cz(a+1|0,b,c):y(cz,[0,b,c]);case -1:mr(b,c);return a<50?cz(a+1|0,b,c):y(cz,[0,b,c]);case -2:gi(b,c);return a<50?cz(a+1|0,b,c):y(cz,[0,b,c]);case -3:return a<50?cz(a+1|0,b,c):y(cz,[0,b,c]);default:return}g(c[1],c);f=e}}function -iB(a,b){return Eh(a,b,g3)}function -Eh(a,b,c){var +e=a_(a$,f,c);if(4>=e>>>0)switch(e){case +0:gw(b,c);return a<50?cI(a+1|0,b,c):v(cI,[0,b,c]);case +1:m6(b,c);return a<50?cI(a+1|0,b,c):v(cI,[0,b,c]);case +2:gw(b,c);return a<50?cI(a+1|0,b,c):v(cI,[0,b,c]);case +3:return a<50?cI(a+1|0,b,c):v(cI,[0,b,c]);default:return}g(c[1],c);f=e}}function +iY(a,b){return Fk(a,b,he)}function +Fk(a,b,c){var e=c;for(;;){var -d=a8(a9,e,b);if(3>=d>>>0)switch(d){case -0:ez(a[1]);return mq(a,b);case -1:return tz(b,b[5],b[6]);case -2:return bK(EK,a,b);default:return bZ(EL,a,b)}g(b[1],b);e=d}}function -Ei(a){return Ej(a,c1)}function -Ej(a,b){var +d=a_(a$,e,b);if(3>=d>>>0)switch(d){case +0:dO(a[1]);return m5(a,b);case +1:return us(b,b[5],b[6]);case +2:return bQ(FN,a,b);default:return b4(FO,a,b)}g(b[1],b);e=d}}function +Fl(a){return Fm(a,c_)}function +Fm(a,b){var d=b;for(;;){var -c=a8(a9,d,a);if(0===c)throw i(ix,1);if(1===c)return;g(a[1],a);d=c}}function -Ek(a,b){return El(a,b,qs)}function -El(a,b,c){var +c=a_(a$,d,a);if(0===c)throw i(iU,1);if(1===c)return;g(a[1],a);d=c}}function +Fn(a,b){return Fo(a,b,q6)}function +Fo(a,b,c){var e=c;for(;;){var -d=a8(a9,e,b);if(3>=d>>>0)switch(d){case +d=a_(a$,e,b);if(3>=d>>>0)switch(d){case 0:return;case -1:throw i(ix,1);case -2:return bK(EM,a,b);default:return bZ(EN,a,b)}g(b[1],b);e=d}}function -Em(a){return En(a,oa)}function -En(a,b){var +1:throw i(iU,1);case +2:return bQ(FP,a,b);default:return b4(FQ,a,b)}g(b[1],b);e=d}}function +Fp(a){return Fq(a,oP)}function +Fq(a,b){var d=b;for(;;){var -c=a8(a9,d,a);if(0===c)throw i(iz,1);if(1===c)return;g(a[1],a);d=c}}function -Eo(a,b){return Ep(a,b,mQ)}function -Ep(a,b,c){var +c=a_(a$,d,a);if(0===c)throw i(iW,1);if(1===c)return;g(a[1],a);d=c}}function +Fr(a,b){return Fs(a,b,nv)}function +Fs(a,b,c){var e=c;for(;;){var -d=a8(a9,e,b);if(3>=d>>>0)switch(d){case +d=a_(a$,e,b);if(3>=d>>>0)switch(d){case 0:return;case -1:throw i(iz,1);case -2:return bK(EO,a,b);default:return bZ(EP,a,b)}g(b[1],b);e=d}}function -Eq(a){return Er(a,ok)}function -Er(a,b){var +1:throw i(iW,1);case +2:return bQ(FR,a,b);default:return b4(FS,a,b)}g(b[1],b);e=d}}function +Ft(a){return Fu(a,oZ)}function +Fu(a,b){var d=b;for(;;){var -c=a8(a9,d,a);if(0===c)throw i(iy,1);if(1===c)return;g(a[1],a);d=c}}function -Es(a,b){return Et(a,b,p4)}function -Et(a,b,c){var +c=a_(a$,d,a);if(0===c)throw i(iV,1);if(1===c)return;g(a[1],a);d=c}}function +Fv(a,b){return Fw(a,b,qG)}function +Fw(a,b,c){var e=c;for(;;){var -d=a8(a9,e,b);if(3>=d>>>0)switch(d){case +d=a_(a$,e,b);if(3>=d>>>0)switch(d){case 0:return;case -1:throw i(iy,1);case -2:return bK(EQ,a,b);default:return bZ(ER,a,b)}g(b[1],b);e=d}}function -mt(a,b){return Eu(a,b,ov)}function -Eu(a,b,c){var +1:throw i(iV,1);case +2:return bQ(FT,a,b);default:return b4(FU,a,b)}g(b[1],b);e=d}}function +m8(a,b){return Fx(a,b,o$)}function +Fx(a,b,c){var e=c;for(;;){var -d=a8(a9,e,b);if(2>=d>>>0)switch(d){case +d=a_(a$,e,b);if(2>=d>>>0)switch(d){case 0:return;case -1:return bK(ES,a,b);default:return bZ(ET,a,b)}g(b[1],b);e=d}}function -EU(a,b){a3(a,b);var -c=1-ms(b);return c?bK(EV,a,b):c}function -EW(a,b,c){var -d=b?b[1]:0;a3(a,c);if(ms(c))throw i(mj,1);var -e=cW(a,c);if(1-d)EU(a,c);return e}var -E0=[J,EZ,aZ(0)];function -E1(a){if(typeof -a==="number")return E2;var -b=a[1];return fi<=b?ba===b?E3:928231259<=b?L<=b?E4:E5:h<=b?E6:E7:dv===b?E8:a_<=b?fp<=b?E9:E_:cJ<=b?E$:Fa}function -mu(a,b){throw i([0,E0,a0(a,E1(b)),b],1)}function -mv(a){if(typeof -a!=="number"&&f===a[1])return a[2];return mu(Fd,a)}function -EX(a,b,c,d){try{var -f=ty(0,d),g=EW(Dc(a,b,c,0),0,f);return g}catch(f){var -e=aj(f);if(e===mj)return gh(EY);throw i(e,0)}}function -Fb(a){if(typeof -a!=="number"&&L===a[1])return a[2];return mu(Fc,a)}function -gj(a){return[0,ba,a]}function -ar(a){return[0,f,a]}function -cw(a){return[0,cJ,a]}function -iC(a,b){return b?g(a,b[1]):cC}function -cb(a,b){return[0,h,a6(kh(a,b))]}var -cx=[0,1],Ff=[J,Fe,aZ(0)];function -bL(a,b){throw i([0,Ff,[0,eq,a],b],1)}function -gk(a){if(typeof -a!=="number"&&ba===a[1])return a[2];return bL(Fg,a)}function -as(a){if(typeof -a!=="number"&&f===a[1])return a[2];return bL(Fh,a)}function -cy(a){if(typeof -a!=="number"&&cJ===a[1])return a[2];return bL(Fi,a)}function -iD(a,b){return cC===b?0:[0,g(a,b)]}function -cc(a,b){if(typeof -b!=="number"&&h===b[1])return a6(kh(a,b[2]));return bL(Fj,b)}function -c(a,b){return bL(a0(a,Fk),b)}function -eZ(a,b){return bL(a0(a,Fp),b)}function -e0(a,b){return bL(a0(a,Fq),b)}function -e1(a,b){return bL(a0(a,Fr),b)}function -mw(a,b,c,d){var -e=hH(Fs,a6(c));return bL(bN(ae(Ft),b,a,e),d)}function -bw(a,b,c){return mw(Fu,a,b,c)}function -bx(a,b,c){return mw(Fv,a,b,c)}function -Fw(a,b){var -d=a,c=b;for(;;){if(!c)return hH(Fx,a6(d));var +1:return bQ(FV,a,b);default:return b4(FW,a,b)}g(b[1],b);e=d}}function +FX(a,b){a2(a,b);var +c=1-m7(b);return c?bQ(FY,a,b):c}function +FZ(a,b,c){var +d=b?b[1]:0;a2(a,c);if(m7(c))throw i(mY,1);var +e=c5(a,c);if(1-d)FX(a,c);return e}var +F3=[L,F2,a5(0)];function +F4(a){if(typeof +a==="number")return F5;var +b=a[1];return fs<=b?bc===b?F6:928231259<=b?K<=b?F7:F8:h<=b?F9:F_:dB===b?F$:ba<=b?fz<=b?Ga:Gb:cS<=b?Gc:Gd}function +m9(a,b){throw i([0,F3,a7(a,F4(b)),b],1)}function +m_(a){if(typeof +a!=="number"&&f===a[1])return a[2];return m9(Gg,a)}function +F0(a,b,c,d){try{var +f=ur(0,d),g=FZ(Ef(a,b,c,0),0,f);return g}catch(f){var +e=an(f);if(e===mY)return gv(F1);throw i(e,0)}}function +Ge(a){if(typeof +a!=="number"&&K===a[1])return a[2];return m9(Gf,a)}function +gx(a){return[0,bc,a]}function +as(a){return[0,f,a]}function +cF(a){return[0,cS,a]}function +iZ(a,b){return b?g(a,b[1]):cL}function +cg(a,b){return[0,h,bI(kL(a,b))]}var +cG=[0,1],Gi=[L,Gh,a5(0)];function +bR(a,b){throw i([0,Gi,[0,ez,a],b],1)}function +gy(a){if(typeof +a!=="number"&&bc===a[1])return a[2];return bR(Gj,a)}function +at(a){if(typeof +a!=="number"&&f===a[1])return a[2];return bR(Gk,a)}function +cH(a){if(typeof +a!=="number"&&cS===a[1])return a[2];return bR(Gl,a)}function +i0(a,b){if(typeof +b==="number"&&cL===b)return 0;return[0,g(a,b)]}function +ch(a,b){if(typeof +b!=="number"&&h===b[1])return bI(kL(a,b[2]));return bR(Gm,b)}function +c(a,b){return bR(a7(a,Gn),b)}function +e_(a,b){return bR(a7(a,Gs),b)}function +e$(a,b){return bR(a7(a,Gt),b)}function +fa(a,b){return bR(a7(a,Gu),b)}function +m$(a,b,c,d){var +e=hU(Gv,bI(c));return bR(bT(X(Gw),b,a,e),d)}function +bz(a,b,c){return m$(Gx,a,b,c)}function +bA(a,b,c){return m$(Gy,a,b,c)}function +Gz(a,b){var +d=a,c=b;for(;;){if(!c)return hU(GA,bI(d));var e=c[1];if(e[1]){d=[0,e[2],d];c=c[2]}else c=c[2]}}function -bM(a,b,c){var -d=Fw(0,c);return bL(j(ae(Fy),a,d),b)}function -by(a,b){return bL(a0(a,Fz),b)}function -Fl(a,b,c){return bL(j(ae(Fm),a,b),c)}function -Fn(a,b){return bL(a0(a,Fo),b)}function +bS(a,b,c){var +d=Gz(0,c);return bR(j(X(GB),a,d),b)}function +bB(a,b){return bR(a7(a,GC),b)}function +Go(a,b,c){return bR(j(X(Gp),a,b),c)}function +Gq(a,b){return bR(a7(a,Gr),b)}function b(a){return a[1]}function -FB(a){if(typeof +GE(a){if(typeof a!=="number"&&h===a[1]){var -b=a[2];if(!b)return e0(e2,a);var +b=a[2];if(!b)return e$(fb,a);var d=b[1];if(typeof d!=="number"){var e=d[1];if(f===e){var -g=d[2];if(g===pA)return b[2]?c(e2,a):0;if(g===qc)return b[2]?c(e2,a):1}else if(h===e)return eZ(e2,a)}}return e1(e2,a)}function -FC(a){return a?FD:FE}function -FF(a){if(typeof +g=d[2];if(g===qd)return b[2]?c(fb,a):0;if(g===qQ)return b[2]?c(fb,a):1}else if(h===e)return e_(fb,a)}}return fa(fb,a)}function +GF(a){return a?GG:GH}function +GI(a){if(typeof a!=="number"&&h===a[1]){var -b=a[2];if(!b)return e0(a4,a);var +b=a[2];if(!b)return e$(a3,a);var e=b[1];if(typeof e!=="number"){var g=e[1];if(f===g){var -d=e[2],i=bC(d,nZ);if(0<=i){if(0>=i)return b[2]?c(a4,a):7;if(d===qj)return b[2]?c(a4,a):8;if(d===qt)return b[2]?c(a4,a):9;if(d===p5)return b[2]?c(a4,a):10;if(d===qP)return b[2]?c(a4,a):12;if(d===pf)return b[2]?c(a4,a):13;if(d===o2)return b[2]?c(a4,a):14;if(d===ea)return b[2]?c(a4,a):11}else{if(d===js)return b[2]?c(a4,a):0;if(d===nn)return b[2]?c(a4,a):1;if(d===p7)return b[2]?c(a4,a):2;if(d===o1)return b[2]?c(a4,a):3;if(d===oG)return b[2]?c(a4,a):4;if(d===nk)return b[2]?c(a4,a):5;if(d===hb)return b[2]?c(a4,a):6}}else if(h===g)return eZ(a4,a)}}return e1(a4,a)}function -FG(a){switch(a){case -0:return FH;case -1:return FI;case -2:return FJ;case -3:return FK;case -4:return FL;case -5:return FM;case -6:return FN;case -7:return FO;case -8:return FP;case -9:return FQ;case -10:return FR;case -11:return FS;case -12:return FT;case -13:return FU;default:return FV}}function -FW(a){return b_(function(a){var -b=a[1];return[0,b,mv(a[2])]},Fb(a))}function -FX(a){return[0,L,b_(function(a){return[0,a[1],[0,f,a[2]]]},a)]}function -FY(a){if(typeof -a!=="number"&&L===a[1]){var +d=e[2],i=bE(d,oD);if(0<=i){if(0>=i)return b[2]?c(a3,a):7;if(d===qX)return b[2]?c(a3,a):8;if(d===q7)return b[2]?c(a3,a):9;if(d===qH)return b[2]?c(a3,a):10;if(d===rq)return b[2]?c(a3,a):12;if(d===pS)return b[2]?c(a3,a):13;if(d===pD)return b[2]?c(a3,a):14;if(d===ej)return b[2]?c(a3,a):11}else{if(d===jQ)return b[2]?c(a3,a):0;if(d===n3)return b[2]?c(a3,a):1;if(d===qJ)return b[2]?c(a3,a):2;if(d===pC)return b[2]?c(a3,a):3;if(d===pj)return b[2]?c(a3,a):4;if(d===n0)return b[2]?c(a3,a):5;if(d===ho)return b[2]?c(a3,a):6}}else if(h===g)return e_(a3,a)}}return fa(a3,a)}function +GJ(a){switch(a){case +0:return GK;case +1:return GL;case +2:return GM;case +3:return GN;case +4:return GO;case +5:return GP;case +6:return GQ;case +7:return GR;case +8:return GS;case +9:return GT;case +10:return GU;case +11:return GV;case +12:return GW;case +13:return GX;default:return GY}}function +GZ(a){return bl(function(a){var +b=a[1];return[0,b,m_(a[2])]},Ge(a))}function +G0(a){return[0,K,bl(function(a){return[0,a[1],[0,f,a[2]]]},a)]}function +G1(a){if(typeof +a!=="number"&&K===a[1]){var e=[0,0],f=[0,0],c=[0,0],g=[0,0];(function(a){var h=a;for(;;){if(!h)return;var -i=h[1],j=i[2],d=i[1],k=h[2];if(d!==g8)if(d!==d_){if(b(cx))g[1]=[0,d,b(g)]}else if(b(e))c[1]=[0,d,b(c)];else -e[1]=[0,as(j)];else if(b(f))c[1]=[0,d,b(c)];else -f[1]=[0,as(j)];h=k}}(a[2]));if(b(c))return bw(gl,b(c),a);if(b(g))return bx(gl,b(g),a);var +i=h[1],j=i[2],d=i[1],k=h[2];if(d!==hj)if(d!==eh){if(b(cG))g[1]=[0,d,b(g)]}else if(b(e))c[1]=[0,d,b(c)];else +e[1]=[0,at(j)];else if(b(f))c[1]=[0,d,b(c)];else +f[1]=[0,at(j)];h=k}}(a[2]));if(b(c))return bz(gz,b(c),a);if(b(g))return bA(gz,b(g),a);var d=b(e),h=b(f);if(d&&h)return[0,d[1],h[1]];var -i=[0,[0,0===b(f)?1:0,FZ],0];return bM(gl,a,[0,[0,0===b(e)?1:0,F0],i])}return by(gl,a)}function -F1(a){var -b=a[1],c=[0,[0,F2,ar(a[2])],0];return[0,L,[0,[0,F3,ar(b)],c]]}function -F4(a){if(typeof -a!=="number"&&L===a[1]){var +i=[0,[0,0===b(f)?1:0,G2],0];return bS(gz,a,[0,[0,0===b(e)?1:0,G3],i])}return bB(gz,a)}function +G4(a){var +b=a[1],c=[0,[0,G5,as(a[2])],0];return[0,K,[0,[0,G6,as(b)],c]]}function +G7(a){if(typeof +a!=="number"&&K===a[1]){var e=[0,0],c=[0,0],d=[0,0];(function(a){var d=a;for(;;){if(!d)return;var -f=d[1],g=f[1],h=d[2],i=f[2];if(g===q4)if(b(e))c[1]=[0,g,b(c)];else -e[1]=[0,FW(i)];d=h}}(a[2]));return b(c)?bw(iE,b(c),a):b(d)?bx(iE,b(d),a):[0,b(e)]}return by(iE,a)}function -F5(a){var -b=a[1],c=0,d=b?[0,[0,F6,FX(b[1])],c]:c;return[0,L,d]}function -mx(a){if(typeof +f=d[1],g=f[1],h=d[2],i=f[2];if(g===rH)if(b(e))c[1]=[0,g,b(c)];else +e[1]=[0,GZ(i)];d=h}}(a[2]));return b(c)?bz(i1,b(c),a):b(d)?bA(i1,b(d),a):[0,b(e)]}return bB(i1,a)}function +G8(a){var +b=a[1],c=0,d=b?[0,[0,G9,G0(b[1])],c]:c;return[0,K,d]}function +na(a){if(typeof a!=="number"&&h===a[1]){var -b=a[2];if(!b)return e0(E,a);var +b=a[2];if(!b)return e$(E,a);var e=b[1];if(typeof e!=="number"){var g=e[1];if(f===g){var -d=e[2],i=bC(d,pg);if(0<=i){if(0>=i)return b[2]?c(E,a):18;var -j=bC(d,m9);if(0<=j){if(0>=j)return b[2]?c(E,a):28;if(d===n4)return b[2]?c(E,a):29;if(d===o_)return b[2]?c(E,a):30;if(d===nP)return b[2]?c(E,a):31;if(d===ox)return b[2]?c(E,a):32;if(d===nb)return b[2]?c(E,a):33;if(d===ng)return b[2]?c(E,a):34;if(d===qd)return b[2]?c(E,a):35;if(d===nD)return b[2]?c(E,a):36}else{if(d===ob)return b[2]?c(E,a):19;if(d===mU)return b[2]?c(E,a):20;if(d===qx)return b[2]?c(E,a):21;if(d===qu)return b[2]?c(E,a):22;if(d===m3)return b[2]?c(E,a):23;if(d===p2)return b[2]?c(E,a):24;if(d===oZ)return b[2]?c(E,a):25;if(d===qX)return b[2]?c(E,a):26;if(d===no)return b[2]?c(E,a):27}}else{var -k=bC(d,qI);if(0<=k){if(0>=k)return b[2]?c(E,a):9;if(d===qM)return b[2]?c(E,a):10;if(d===oO)return b[2]?c(E,a):11;if(d===q7)return b[2]?c(E,a):12;if(d===m7)return b[2]?c(E,a):13;if(d===na)return b[2]?c(E,a):14;if(d===q2)return b[2]?c(E,a):15;if(d===pV)return b[2]?c(E,a):16;if(d===nH)return b[2]?c(E,a):17}else{if(d===q6)return b[2]?c(E,a):0;if(d===qA)return b[2]?c(E,a):1;if(d===or)return b[2]?c(E,a):2;if(d===n1)return b[2]?c(E,a):3;if(d===ni)return b[2]?c(E,a):4;if(d===nt)return b[2]?c(E,a):5;if(d===of)return b[2]?c(E,a):6;if(d===nG)return b[2]?c(E,a):7;if(d===pm)return b[2]?c(E,a):8}}}else if(h===g)return eZ(E,a)}}return e1(E,a)}function -my(a){switch(a){case -0:return F7;case -1:return F8;case -2:return F9;case -3:return F_;case -4:return F$;case -5:return Ga;case -6:return Gb;case -7:return Gc;case -8:return Gd;case -9:return Ge;case -10:return Gf;case -11:return Gg;case -12:return Gh;case -13:return Gi;case -14:return Gj;case -15:return Gk;case -16:return Gl;case -17:return Gm;case -18:return Gn;case -19:return Go;case -20:return Gp;case -21:return Gq;case -22:return Gr;case -23:return Gs;case -24:return Gt;case -25:return Gu;case -26:return Gv;case -27:return Gw;case -28:return Gx;case -29:return Gy;case -30:return Gz;case -31:return GA;case -32:return GB;case -33:return GC;case -34:return GD;case -35:return GE;default:return GF}}function -GG(a){if(typeof +d=e[2],i=bE(d,pT);if(0<=i){if(0>=i)return b[2]?c(E,a):18;var +j=bE(d,nO);if(0<=j){if(0>=j)return b[2]?c(E,a):28;if(d===oI)return b[2]?c(E,a):29;if(d===pL)return b[2]?c(E,a):30;if(d===os)return b[2]?c(E,a):31;if(d===pb)return b[2]?c(E,a):32;if(d===nR)return b[2]?c(E,a):33;if(d===nW)return b[2]?c(E,a):34;if(d===qR)return b[2]?c(E,a):35;if(d===oh)return b[2]?c(E,a):36}else{if(d===oQ)return b[2]?c(E,a):19;if(d===nz)return b[2]?c(E,a):20;if(d===q$)return b[2]?c(E,a):21;if(d===q8)return b[2]?c(E,a):22;if(d===nI)return b[2]?c(E,a):23;if(d===qE)return b[2]?c(E,a):24;if(d===pA)return b[2]?c(E,a):25;if(d===rA)return b[2]?c(E,a):26;if(d===n4)return b[2]?c(E,a):27}}else{var +k=bE(d,rk);if(0<=k){if(0>=k)return b[2]?c(E,a):9;if(d===rn)return b[2]?c(E,a):10;if(d===pp)return b[2]?c(E,a):11;if(d===rK)return b[2]?c(E,a):12;if(d===nM)return b[2]?c(E,a):13;if(d===nQ)return b[2]?c(E,a):14;if(d===rF)return b[2]?c(E,a):15;if(d===qx)return b[2]?c(E,a):16;if(d===ok)return b[2]?c(E,a):17}else{if(d===rJ)return b[2]?c(E,a):0;if(d===rc)return b[2]?c(E,a):1;if(d===o7)return b[2]?c(E,a):2;if(d===oF)return b[2]?c(E,a):3;if(d===nY)return b[2]?c(E,a):4;if(d===n9)return b[2]?c(E,a):5;if(d===oU)return b[2]?c(E,a):6;if(d===oj)return b[2]?c(E,a):7;if(d===p0)return b[2]?c(E,a):8}}}else if(h===g)return e_(E,a)}}return fa(E,a)}function +nb(a){switch(a){case +0:return G_;case +1:return G$;case +2:return Ha;case +3:return Hb;case +4:return Hc;case +5:return Hd;case +6:return He;case +7:return Hf;case +8:return Hg;case +9:return Hh;case +10:return Hi;case +11:return Hj;case +12:return Hk;case +13:return Hl;case +14:return Hm;case +15:return Hn;case +16:return Ho;case +17:return Hp;case +18:return Hq;case +19:return Hr;case +20:return Hs;case +21:return Ht;case +22:return Hu;case +23:return Hv;case +24:return Hw;case +25:return Hx;case +26:return Hy;case +27:return Hz;case +28:return HA;case +29:return HB;case +30:return HC;case +31:return HD;case +32:return HE;case +33:return HF;case +34:return HG;case +35:return HH;default:return HI}}function +HJ(a){if(typeof a!=="number"&&h===a[1]){var -b=a[2];if(!b)return e0(l,a);var +b=a[2];if(!b)return e$(l,a);var e=b[1];if(typeof e!=="number"){var g=e[1];if(f===g){var -d=e[2],i=bC(d,mL);if(0<=i){if(0>=i)return b[2]?c(l,a):30;var -j=bC(d,qk);if(0<=j){if(0>=j)return b[2]?c(l,a):46;var -k=bC(d,oT);if(0<=k){if(0>=k)return b[2]?c(l,a):54;if(d===oE)return b[2]?c(l,a):55;if(d===pO)return b[2]?c(l,a):56;if(d===pw)return b[2]?c(l,a):57;if(d===qY)return b[2]?c(l,a):58;if(d===rl)return b[2]?c(l,a):59;if(d===qH)return b[2]?c(l,a):60}else{if(d===nO)return b[2]?c(l,a):47;if(d===po)return b[2]?c(l,a):48;if(d===o5)return b[2]?c(l,a):49;if(d===pN)return b[2]?c(l,a):50;if(d===ea)return b[2]?c(l,a):51;if(d===rb)return b[2]?c(l,a):52;if(d===pK)return b[2]?c(l,a):53}}else{var -m=bC(d,p9);if(0<=m){if(0>=m)return b[2]?c(l,a):38;if(d===qD)return b[2]?c(l,a):39;if(d===nF)return b[2]?c(l,a):40;if(d===rd)return b[2]?c(l,a):41;if(d===oB)return b[2]?c(l,a):42;if(d===pv)return b[2]?c(l,a):43;if(d===oC)return b[2]?c(l,a):44;if(d===rm)return b[2]?c(l,a):45}else{if(d===oe)return b[2]?c(l,a):31;if(d===oy)return b[2]?c(l,a):32;if(d===gK)return b[2]?c(l,a):33;if(d===g5)return b[2]?c(l,a):34;if(d===nw)return b[2]?c(l,a):35;if(d===pH)return b[2]?c(l,a):36;if(d===oR)return b[2]?c(l,a):37}}}else{var -n=bC(d,n3);if(0<=n){if(0>=n)return b[2]?c(l,a):15;var -o=bC(d,qW);if(0<=o){if(0>=o)return b[2]?c(l,a):23;if(d===ot)return b[2]?c(l,a):24;if(d===qq)return b[2]?c(l,a):25;if(d===mP)return b[2]?c(l,a):26;if(d===px)return b[2]?c(l,a):27;if(d===qg)return b[2]?c(l,a):28;if(d===oW)return b[2]?c(l,a):29}else{if(d===pe)return b[2]?c(l,a):16;if(d===oL)return b[2]?c(l,a):17;if(d===pd)return b[2]?c(l,a):18;if(d===nV)return b[2]?c(l,a):19;if(d===n_)return b[2]?c(l,a):20;if(d===qB)return b[2]?c(l,a):21;if(d===oS)return b[2]?c(l,a):22}}else{var -p=bC(d,pU);if(0<=p){if(0>=p)return b[2]?c(l,a):7;if(d===ow)return b[2]?c(l,a):8;if(d===pP)return b[2]?c(l,a):9;if(d===hb)return b[2]?c(l,a):10;if(d===oY)return b[2]?c(l,a):11;if(d===om)return b[2]?c(l,a):12;if(d===m0)return b[2]?c(l,a):13;if(d===qr)return b[2]?c(l,a):14}else{if(d===nB)return b[2]?c(l,a):0;if(d===q9)return b[2]?c(l,a):1;if(d===nA)return b[2]?c(l,a):2;if(d===oc)return b[2]?c(l,a):3;if(d===pt)return b[2]?c(l,a):4;if(d===p_)return b[2]?c(l,a):5;if(d===m6)return b[2]?c(l,a):6}}}}else if(h===g)return eZ(l,a)}}return e1(l,a)}function -GH(a){var +d=e[2],i=bE(d,nr);if(0<=i){if(0>=i)return b[2]?c(l,a):30;var +j=bE(d,qY);if(0<=j){if(0>=j)return b[2]?c(l,a):46;var +k=bE(d,pu);if(0<=k){if(0>=k)return b[2]?c(l,a):54;if(d===ph)return b[2]?c(l,a):55;if(d===qq)return b[2]?c(l,a):56;if(d===p$)return b[2]?c(l,a):57;if(d===rB)return b[2]?c(l,a):58;if(d===r0)return b[2]?c(l,a):59;if(d===rj)return b[2]?c(l,a):60}else{if(d===or)return b[2]?c(l,a):47;if(d===p2)return b[2]?c(l,a):48;if(d===pG)return b[2]?c(l,a):49;if(d===qp)return b[2]?c(l,a):50;if(d===ej)return b[2]?c(l,a):51;if(d===rQ)return b[2]?c(l,a):52;if(d===qm)return b[2]?c(l,a):53}}else{var +m=bE(d,qL);if(0<=m){if(0>=m)return b[2]?c(l,a):38;if(d===rf)return b[2]?c(l,a):39;if(d===oi)return b[2]?c(l,a):40;if(d===rS)return b[2]?c(l,a):41;if(d===pe)return b[2]?c(l,a):42;if(d===p_)return b[2]?c(l,a):43;if(d===pf)return b[2]?c(l,a):44;if(d===r1)return b[2]?c(l,a):45}else{if(d===oT)return b[2]?c(l,a):31;if(d===pc)return b[2]?c(l,a):32;if(d===gY)return b[2]?c(l,a):33;if(d===hg)return b[2]?c(l,a):34;if(d===oa)return b[2]?c(l,a):35;if(d===qj)return b[2]?c(l,a):36;if(d===ps)return b[2]?c(l,a):37}}}else{var +n=bE(d,oH);if(0<=n){if(0>=n)return b[2]?c(l,a):15;var +o=bE(d,ry);if(0<=o){if(0>=o)return b[2]?c(l,a):23;if(d===o9)return b[2]?c(l,a):24;if(d===q4)return b[2]?c(l,a):25;if(d===nu)return b[2]?c(l,a):26;if(d===qa)return b[2]?c(l,a):27;if(d===qU)return b[2]?c(l,a):28;if(d===px)return b[2]?c(l,a):29}else{if(d===pR)return b[2]?c(l,a):16;if(d===pn)return b[2]?c(l,a):17;if(d===pQ)return b[2]?c(l,a):18;if(d===oz)return b[2]?c(l,a):19;if(d===oO)return b[2]?c(l,a):20;if(d===rd)return b[2]?c(l,a):21;if(d===pt)return b[2]?c(l,a):22}}else{var +p=bE(d,qw);if(0<=p){if(0>=p)return b[2]?c(l,a):7;if(d===pa)return b[2]?c(l,a):8;if(d===qr)return b[2]?c(l,a):9;if(d===ho)return b[2]?c(l,a):10;if(d===pz)return b[2]?c(l,a):11;if(d===o2)return b[2]?c(l,a):12;if(d===nF)return b[2]?c(l,a):13;if(d===q5)return b[2]?c(l,a):14}else{if(d===of)return b[2]?c(l,a):0;if(d===rM)return b[2]?c(l,a):1;if(d===oe)return b[2]?c(l,a):2;if(d===oR)return b[2]?c(l,a):3;if(d===p8)return b[2]?c(l,a):4;if(d===qM)return b[2]?c(l,a):5;if(d===nL)return b[2]?c(l,a):6}}}}else if(h===g)return e_(l,a)}}return fa(l,a)}function +HK(a){var b=a;if(31<=b)switch(b){case -31:return Hb;case -32:return Hc;case -33:return Hd;case -34:return He;case -35:return Hf;case -36:return Hg;case -37:return Hh;case -38:return Hi;case -39:return Hj;case -40:return Hk;case -41:return Hl;case -42:return Hm;case -43:return Hn;case -44:return Ho;case -45:return Hp;case -46:return Hq;case -47:return Hr;case -48:return Hs;case -49:return Ht;case -50:return Hu;case -51:return Hv;case -52:return Hw;case -53:return Hx;case -54:return Hy;case -55:return Hz;case -56:return HA;case -57:return HB;case -58:return HC;case -59:return HD;default:return HE}switch(b){case -0:return GI;case -1:return GJ;case -2:return GK;case -3:return GL;case -4:return GM;case -5:return GN;case -6:return GO;case -7:return GP;case -8:return GQ;case -9:return GR;case -10:return GS;case -11:return GT;case -12:return GU;case -13:return GV;case -14:return GW;case -15:return GX;case -16:return GY;case -17:return GZ;case -18:return G0;case -19:return G1;case -20:return G2;case -21:return G3;case -22:return G4;case -23:return G5;case -24:return G6;case -25:return G7;case -26:return G8;case -27:return G9;case -28:return G_;case -29:return G$;default:return Ha}}function -HF(a){return mx([0,h,[0,[0,f,mv(a)],0]])}function -HG(a){var -b=my(a);if(typeof +31:return Ie;case +32:return If;case +33:return Ig;case +34:return Ih;case +35:return Ii;case +36:return Ij;case +37:return Ik;case +38:return Il;case +39:return Im;case +40:return In;case +41:return Io;case +42:return Ip;case +43:return Iq;case +44:return Ir;case +45:return Is;case +46:return It;case +47:return Iu;case +48:return Iv;case +49:return Iw;case +50:return Ix;case +51:return Iy;case +52:return Iz;case +53:return IA;case +54:return IB;case +55:return IC;case +56:return ID;case +57:return IE;case +58:return IF;case +59:return IG;default:return IH}switch(b){case +0:return HL;case +1:return HM;case +2:return HN;case +3:return HO;case +4:return HP;case +5:return HQ;case +6:return HR;case +7:return HS;case +8:return HT;case +9:return HU;case +10:return HV;case +11:return HW;case +12:return HX;case +13:return HY;case +14:return HZ;case +15:return H0;case +16:return H1;case +17:return H2;case +18:return H3;case +19:return H4;case +20:return H5;case +21:return H6;case +22:return H7;case +23:return H8;case +24:return H9;case +25:return H_;case +26:return H$;case +27:return Ia;case +28:return Ib;case +29:return Ic;default:return Id}}function +II(a){return na([0,h,[0,[0,f,m_(a)],0]])}function +IJ(a){var +b=nb(a);if(typeof b!=="number"&&h===b[1]){var -c=b[2];if(c&&!c[2])return c[1]}throw i([0,t,HH],1)}function -iF(a){if(typeof -a!=="number"&&L===a[1]){var +c=b[2];if(c&&!c[2])return c[1]}throw i([0,u,IK],1)}function +i2(a){if(typeof +a!=="number"&&K===a[1]){var f=[0,0],l=[0,0],g=[0,0],m=[0,0],n=[0,0],o=[0,0],h=[0,0],i=[0,0],j=[0,0],p=[0,0],q=[0,0],c=[0,0],d=[0,0];(function(a){var k=a;for(;;){if(!k)return;var -r=k[1],e=r[2],d=r[1],s=bC(d,d_);a:b:{var -t=k[2];if(0<=s)if(0=a){var -c=a;for(;;){q[17].call(null,[0,c,0],0,f);var -g=c+1|0;if(b===c)break;c=g}}return}function -b(f,b){return bG(Kq(c,e),function(a){return bG(Kv(c,a),function(o){eO([0,KD,[0,f,[0,KC,[0,b,KB]]]]);var -d=kz(0);(function(a,b){var -f=a,e=b;for(;;){var -h=dU(e,0);if(!h)return h;var -g=kk(e,Kf);hO([0,0,0,c[2][1][4],KG,mB,[0,f],[0,g],KF,KE,1,0,1],d);f=f+g|0;e=e-g|0}}(f,(b-f|0)+1|0));var -l=kB(d);function +b=c[2][1][4],d=[0,iS[49].call(null,a),0,b,LA,0,0,0,0,0,0,0,0];return bx(fc(c)(0,[0,gD,gC,gG,gF,gH,gI],d,0),function(a){return iE(function(a){var +b=a[3];return iF(function(a){return[0,b,a]},a[4])},a[1])})}return eX(gi(bl(function(a){var +b=a[3];return bM(d(a),function(a){return bx(e(a),function(a){return[0,b,a]})})},b[1])),function(a){return AH(a)})}function +LB(a,b){return iE(function(a){var +c=a[1];return kM(function(a){return AU(a[2],b)},a[2])?[0,c]:0},a)}function +LC(a,d,c){var +j=a?a[1]:function(a){return};function +e(a,b){var +e=e0([0,[0,q[11],q[12],q[13],q[14],q[15],q[16],q[17]],0],LD,c),f=cr([0,q[11],q[12],q[13],q[14],q[15],q[16],q[17]],e);if(b>=a){var +d=a;for(;;){q[17].call(null,[0,d,0],0,f);var +g=d+1|0;if(b===d)break;d=g}}return}function +b(f,b){return bM(Lt(d,c),function(a){return bM(Ly(d,a),function(n){eZ([0,LG,[0,f,[0,LF,[0,b,LE]]]]);var +e=k0(0);(function(a,b){var +f=a,c=b;for(;;){var +h=d3(c,0);if(!h)return h;var +g=kO(c,Li);h1([0,0,0,d[2][1][4],LJ,ne,[0,f],[0,g],LI,LH,1,0,1],e);f=f+g|0;c=c-g|0}}(f,(b-f|0)+1|0));var +k=k2(e);function h(a,f){var -b=a?a[1]:2;if(dU(b,0))return eK(f6(b_(function(a){return bu(j(e3(c)(0,[0,gp,go,gs,gr,gt,gu]),a,0),function(a){var -b=a[3],c=a[1];g(k,[0,[0,l,kB(d)]]);return function(p,b){return zv(function(a,b){var -h=b[9],f=b[3],g=b[1],r=b[7],s=b[5],t=b[4],c=eP([0,[0,q[11],q[12],q[13],q[14],q[15],q[16],q[17]],[0,[0,K[11],K[12],K[13],K[14],K[15],K[16],K[17]],[0,[0,x[11],x[12],x[13],x[14],x[15],x[16],x[17]],[0,[0,T[11],T[12],T[13],T[14],T[15],T[16],T[17]],[0,[0,av[11],av[12],av[13],av[14],av[15],av[16],av[17]],[0,[0,G[11],G[12],G[13],G[14],G[15],G[16],G[17]],0]]]]]],KH,e),u=ck([0,q[11],q[12],q[13],q[14],q[15],q[16],q[17]])(c),v=ck([0,K[11],K[12],K[13],K[14],K[15],K[16],K[17]])(c),w=ck([0,x[11],x[12],x[13],x[14],x[15],x[16],x[17]])(c),y=j(x[16].call(null,[0,gE[2],gE[1]]),KI,w);di(KJ);var -k=ck([0,T[11],T[12],T[13],T[14],T[15],T[16],T[17]])(c),z=j(T[16].call(null,[0,gF[2],gF[1]]),KK,k),A=ck([0,av[11],av[12],av[13],av[14],av[15],av[16],av[17]])(c);function -C(b){var -c=C3(b);function -d(a){if(0!==a[0])throw i([0,eG,a[1]],1);var -d=a[1];return d?eJ(d[1]):function(a){return dh(bH,a)}(dj(T[14].call(null,[0,b,c],0,k)))}return function(a){return wJ(eK,d,a)}(dj(gF[9].call(null,c,z)))}function -l(a){return f6(kj(function(a){var +b=a?a[1]:2;if(d3(b,0))return eV(gi(bl(function(a){return bx(fc(d)(0,[0,gD,gC,gG,gF,gH,gI],a,0),function(a){var +b=a[3],d=a[1];g(j,[0,[0,k,k2(e)]]);return function(o,b){return Ay(function(a,b){var +h=b[9],f=b[3],g=b[1],p=b[7],r=b[5],s=b[4],d=e0([0,[0,q[11],q[12],q[13],q[14],q[15],q[16],q[17]],[0,[0,J[11],J[12],J[13],J[14],J[15],J[16],J[17]],[0,[0,y[11],y[12],y[13],y[14],y[15],y[16],y[17]],[0,[0,T[11],T[12],T[13],T[14],T[15],T[16],T[17]],[0,[0,aw[11],aw[12],aw[13],aw[14],aw[15],aw[16],aw[17]],[0,[0,H[11],H[12],H[13],H[14],H[15],H[16],H[17]],0]]]]]],LK,c),t=cr([0,q[11],q[12],q[13],q[14],q[15],q[16],q[17]],d),u=cr([0,J[11],J[12],J[13],J[14],J[15],J[16],J[17]],d),v=cr([0,y[11],y[12],y[13],y[14],y[15],y[16],y[17]],d),w=y[16].call(null,[0,gS[2],gS[1]],LL,v);dp(LM);var +j=cr([0,T[11],T[12],T[13],T[14],T[15],T[16],T[17]],d),x=T[16].call(null,[0,gT[2],gT[1]],LN,j),z=cr([0,aw[11],aw[12],aw[13],aw[14],aw[15],aw[16],aw[17]],d);function +B(b){var +c=D6(b);function +d(a){if(0!==a[0])throw i([0,eR,a[1]],1);var +d=a[1];return d?eU(d[1]):function(a){return dn(bN,a)}(dq(T[14].call(null,[0,b,c],0,j)))}return function(a){return xK(eV,d,a)}(dq(gT[9].call(null,c,x)))}function +k(a){return gi(kN(function(a){var b=44;function -c(a){return kt(b,a)}return function(a){return b_(C,a)}(function(a){return b_(ta,a)}(function(a){return kj(c,a)}(kt(59,a[1]))))},a))}var -m=p+a|0,B=ck([0,G[11],G[12],G[13],G[14],G[15],G[16],G[17]])(c),n=Ky(o,f_(t,KL)),d=f_(b[2],g);q[17].call(null,[0,m,[0,f]],0,u);if(1===h){var -D=function(a){return zD(a,0)},E=function(a){return ig(D,a)},F=function(a){return dh(E,a)}(f6(b_(function(a){return dj(gE[9].call(null,[0,a],y))},n))),H=function(a){var -b=a[2],c=[0,g,b,a[1]],e=[0,[0,f],ih(function(a){return[0,a]},s),d,b,[0,r]];return G[14].call(null,e,[0,c],B)};(function(a){return dh(H,a)}(function(a){return lo(F,a)}(l(b[10]))));return 0}if(16===h){var -I=function(a){var -b=[0,g,a],c=[0,f];di([0,KM,[0,b,[0,c,[0,d,[0,a,0]]]]]);return av[14].call(null,[0,c,d,a],[0,b],A)};(function(a){return dh(I,a)}(l(b[10])));return 0}K[17].call(null,[0,[0,m,n,d],b],0,v);return 0},b)}(b,c)})},function(a,b){var -c=a,d=b;for(;;){if(dm(d,0))return a6(c);var -e=kA(f);if(!e)return a6(c);c=[0,e[1],c];d=d-1|0}}(0,b))),function(a){return zt(a)?eL(0):h(0,f)});throw i([0,t,KN],1)}return h(0,d)})})}return function(a){if(typeof -a==="number")return 2===a?eL(0):eL(0);if(0!==a[0])return b(a[1],a[2]);var -c=a[3],e=a[2];d(a[1],c);return b(e,c)}}}var -mC=IV([0]);function -KO(d,b,c){return bG(Kp(b,c),function(a){var -e=[0,a,Ko[2]];return bu(g(Kz(ih(function(b){g(b,e);return function(a){return g(b,[0,e[1],a])}},d),b)(c),a),function(a){return zy(function(a){return g(a,KP)},d)})})}var -KQ=mC[2],KR=mC[3],KS=K[18];function -KT(a,b){var -f=yW(a);eO([0,KV,[0,yV(a),[0,KU,[0,f,0]]]]);var -c=f8(b),h=zf(c);eO(KW);tp(function(a){return ze(c,a)},h);var -e=q[18].call(null,[0,KX],KY,c);JW[15].call(null,K0,KZ,0,e);var -d=KS([0,[1,[0,K3,K2,K1]]],K4,c);J0[15].call(null,K6,K5,0,d);JY[15].call(null,K9,[1,[0,K8,K7]],0,d);J2[15].call(null,La,[1,[0,K$,K_]],0,d);var -i=JU[18].call(null,[0,Lb],Lc,c),k=x[18].call(null,0,Ld,c),l=gE[15];g(function(a){var -b=a;return l(Lg,Lf,Le,b)},k);var -m=T[18].call(null,0,Lh,c),n=gF[15];g(function(a){var -b=a;return n(Lk,Lj,Li,b)},m);var -o=av[18].call(null,0,0,c),p=Kb[15];j(function(a,b){var -d=b,c=a;return p(Lm,Ll,c,d)},0,o);G[18].call(null,0,0,c);return eO([0,Ln,[0,e,[0,d,[0,i,0]]]])}function -Lo(d,b,c){function -e(a,b){return g(c,f8(b))}(function(a){return ic(e,a)}(function(a){return zj(KT,a)}(function(a){return zk(b,d,a)}(zm(0,0)))));return}wV(0);function -Lp(a){return eM(a,function(a){return lG(function(a){return[0,i0,a]},a)})}function -mD(a){return Lp(dj(a))}function -Lq(a){return function(a){return{fut:a}}(eI(ln(lm(function(a){return a[jf]},a)),function(a){return dQ(f4(function(a){return a},a))}))}function -Lr(a){var -f=fW(0,64),d=h8(0),e=d[1],k=d[2];(function(a){return Lo(Lt,Ls,a)}(function(a){k([0,a]);return 0}));function -b(c){return function(a,b){var -d=a?a[1]:0;return bu(e,function(a){var -b=eP([0,c,0],[0,d],a);return ck(c)(b)})}}var -h=fW(0,64);function +c(a){return kU(b,a)}return function(a){return bl(B,a)}(function(a){return bl(t5,a)}(function(a){return kN(c,a)}(kU(59,a[1]))))},a))}var +l=o+a|0,A=cr([0,H[11],H[12],H[13],H[14],H[15],H[16],H[17]],d),m=LB(n,gm(s,LO)),e=gm(b[2],g);q[17].call(null,[0,l,[0,f]],0,t);if(1===h){var +C=function(a){return AG(a,0)},D=function(a){return iE(C,a)},E=function(a){return dn(D,a)}(gi(bl(function(a){return dq(gS[9].call(null,[0,a],w))},m))),F=function(a){var +b=a[2],c=[0,g,b,a[1]],d=[0,[0,f],iF(function(a){return[0,a]},r),e,b,[0,p]];return H[14].call(null,d,[0,c],A)};(function(a){return dn(F,a)}(function(a){return l3(E,a)}(k(b[10]))));return 0}if(16===h){var +G=function(a){var +b=[0,g,a],c=[0,f];dp([0,LP,[0,b,[0,c,[0,e,[0,a,0]]]]]);return aw[14].call(null,[0,c,e,a],[0,b],z)};(function(a){return dn(G,a)}(k(b[10])));return 0}J[17].call(null,[0,[0,l,m,e],b],0,u);return 0},b)}(b,d)})},function(a,b){var +c=a,d=b;for(;;){if(dt(d,0))return bI(c);var +e=k1(f);if(!e)return bI(c);c=[0,e[1],c];d=d-1|0}}(0,b))),function(a){return Ax(a)?eW(0):h(0,f)});throw i([0,u,LQ],1)}return h(0,e)})})}return function(a){if(typeof +a==="number")return 2===a?eW(0):eW(0);if(0!==a[0])return b(a[1],a[2]);var +c=a[3],d=a[2];e(a[1],c);return b(d,c)}}var +nf=JY([0]);function +LR(d,b,c){return bM(Ls(b,c),function(a){var +e=[0,a,Lr[2]];return bx(LC(iF(function(b){g(b,e);return function(a){return g(b,[0,e[1],a])}},d),b,c)(a),function(a){return AB(function(a){return g(a,LS)},d)})})}var +LT=nf[2],LU=nf[3],LV=J[18];function +LW(a,b){var +f=z0(a);eZ([0,LY,[0,zZ(a),[0,LX,[0,f,0]]]]);var +c=gk(b),h=Aj(c);eZ(LZ);ui(function(a){return Ai(c,a)},h);var +e=q[18].call(null,[0,L0],L1,c);KZ[15].call(null,L3,L2,0,e);var +d=LV([0,[1,[0,L6,L5,L4]]],L7,c);K3[15].call(null,L9,L8,0,d);K1[15].call(null,Ma,[1,[0,L$,L_]],0,d);K5[15].call(null,Md,[1,[0,Mc,Mb]],0,d);var +i=KX[18].call(null,[0,Me],Mf,c),k=y[18].call(null,0,Mg,c),l=gS[15];g(function(a){var +b=a;return l(Mj,Mi,Mh,b)},k);var +m=T[18].call(null,0,Mk,c),n=gT[15];g(function(a){var +b=a;return n(Mn,Mm,Ml,b)},m);var +o=aw[18].call(null,0,0,c),p=Le[15];j(function(a,b){var +d=b,c=a;return p(Mp,Mo,c,d)},0,o);H[18].call(null,0,0,c);return eZ([0,Mq,[0,e,[0,d,[0,i,0]]]])}function +Mr(d,b,c){function +e(a,b){return g(c,gk(b))}(function(a){return iB(e,a)}(function(a){return An(LW,a)}(function(a){return Ao(b,d,a)}(Aq(0,0)))));return}x6(0);function +Ms(a){return eX(a,function(a){return mj(function(a){return[0,jm,a]},a)})}function +ng(a){return Ms(dq(a))}function +Mt(a){return function(a){return{fut:a}}(eT(l2(l1(function(a){return a[jD]},a)),function(a){return dZ(gg(function(a){return a},a))}))}function +Mu(a){var +f=f5(0,64),d=iv(0),e=d[1],k=d[2];(function(a){return Mr(Mw,Mv,a)}(function(a){k([0,a]);return 0}));function +b(d,b,c){var +f=b?b[1]:0;return bx(e,function(a){return function(a){return cr(d,a)}(e0([0,d,0],[0,f],a))})}var +h=f5(0,64);function j(a,b){var -c=b[1];return KO([0,function(a){w1(f);return KQ(0,[0,c,a])}],b[2],a)}function +c=b[1];return LR([0,function(a){yb(f);return LT(0,[0,c,a])}],b[2],a)}function c(a,b){var d=b[2],j=b[4],k=b[3];try{var -e=eL(function(a){return kV(h,a)}(mA(b)));return e}catch(f){var -c=aj(f);if(c!==bD)throw i(c,0);var -l=dS(dT);return bu(mD(G[7].call(null,0,a)),function(a){di([0,Lv,[0,dS(dT)-l,Lu]]);var -f=dS(dT);if(d)var -i=d[1],e=id(function(a){return ki(function(a){return sJ(a,i)},a[3])},a);else +e=eW(function(a){return lu(h,a)}(nd(b)));return e}catch(f){var +c=an(f);if(c!==bG)throw i(c,0);var +l=d1(d2);return bx(ng(H[7].call(null,0,a)),function(a){dp([0,My,[0,d1(d2)-l,Mx]]);var +f=d1(d2);if(d)var +i=d[1],e=iC(function(a){return kM(function(a){return tu(a,i)},a[3])},a);else var e=a;var -c=ev(function(a,b){if(0===b[0]){var -c=b[1];if(!zG(c)){var -e=hI(c),f=zP(g(ae(Lw),e));return id(function(a){var -b=hI(a[1]);return f9(zQ(0,f)(b),0)},a)}}else{var +c=eI(function(a,b){if(0===b[0]){var +c=b[1];if(!AJ(c)){var +e=hV(c),f=AS(g(X(Mz),e));return iC(function(a){return gl(AT(0,f,hV(a[1])),0)},a)}}else{var d=b[1];if(d){var -h=d[1];return id(function(a){var -b=it[29].call(null,a[2]);return it[13].call(null,b,h)},a)}}return a},e,j);di([0,Ly,[0,dS(dT)-f,Lx]]);var -m=dS(dT);if(k)tv(function(a,b){return hJ(a[1],b[1])},c);di([0,LA,[0,dS(dT)-m,Lz]]);w6(h,mA(b),c);return c})}}return[0,,,,,,,function(a){switch(a[0]){case -0:IK(a[1]);return eL(0);case +h=d[1];return iC(function(a){var +b=iQ[29].call(null,a[2]);return iQ[26].call(null,b,h)},a)}}return a},e,j);dp([0,MB,[0,d1(d2)-f,MA]]);var +m=d1(d2);if(k)uo(function(a,b){return hW(a[1],b[1])},c);dp([0,MD,[0,d1(d2)-m,MC]]);yg(h,nd(b),c);return c})}}return[0,,,,,,,function(a){switch(a[0]){case +0:JN(a[1]);return eW(0);case 1:var -h=a[1];return bG(e,function(a){return eM(j(a,sE(h)),function(a){return lG(function(a){return[0,i0,a]},a)})});case -2:return bG(b([0,x[11],x[12],x[13],x[14],x[15],x[16],x[17]])(0,0),function(a){var -b=dj(x[7].call(null,0,a));function +h=a[1];return bM(e,function(a){return eX(j(a,tn(h)),function(a){return mj(function(a){return[0,jm,a]},a)})});case +2:return bM(b([0,y[11],y[12],y[13],y[14],y[15],y[16],y[17]],0,0),function(a){var +b=dq(y[7].call(null,0,a));function c(a){var b=a[1];a:{if(0===b[0]){var -c=a[2],e=b[1];if(0===c[0])return[0,tq(function(a,b){return[0,a,b]},e,c[1])]}else{var +c=a[2],e=b[1];if(0===c[0])return[0,uj(function(a,b){return[0,a,b]},e,c[1])]}else{var f=b[1];if(0===a[2][0]){var d=f;break a}}var -d=a[2][1]}return[1,[0,i0,d]]}return function(a){return dh(c,a)}(lo(b,dj(x[6].call(null,a))))});case +d=a[2][1]}return[1,[0,jm,d]]}return function(a){return dn(c,a)}(l3(b,dq(y[6].call(null,a))))});case 3:var -f=a[1];return bG(b([0,G[11],G[12],G[13],G[14],G[15],G[16],G[17]])(0,0),function(a){return bu(c(a,f),function(a){return[0,f,0,a.length-1]})});case +f=a[1];return bM(b([0,H[11],H[12],H[13],H[14],H[15],H[16],H[17]],0,0),function(a){return bx(c(a,f),function(a){return[0,f,0,a.length-1]})});case 4:var -k=a[1];return bG(b([0,G[11],G[12],G[13],G[14],G[15],G[16],G[17]])(0,0),function(a){return bG(c(a,k[1]),function(c){return bG(b([0,T[11],T[12],T[13],T[14],T[15],T[16],T[17]])(0,0),function(a){return bu(mD(T[6].call(null,a)),function(e){var -a=tt(function(a,b){var -c=b_(function(a){return[0,a,1]},b[2]);return iu[54].call(null,function(a){return function(a,b){return a+b|0}},a,c)},iu[1],c);function +k=a[1];return bM(b([0,H[11],H[12],H[13],H[14],H[15],H[16],H[17]],0,0),function(a){return bM(c(a,k[1]),function(c){return bM(b([0,T[11],T[12],T[13],T[14],T[15],T[16],T[17]],0,0),function(a){return bx(ng(T[6].call(null,a)),function(e){var +a=um(function(a,b){var +c=bl(function(a){return[0,a,1]},b[2]);return iR[55].call(null,function(a){return function(a,b){return a+b|0}},a,c)},iR[1],c);function b(a,b){try{var -d=a-1|0,f=[0,b,o(e,d)[1+d]];return f}catch(f){var -c=aj(f);if(c[1]===hx)return fH(LB);throw i(c,0)}}var -d=iu[28];return g(function(a){var +d=a-1|0,f=[0,b,p(e,d)[1+d]];return f}catch(f){var +c=an(f);if(c[1]===fQ)return fR(ME);throw i(c,0)}}var +d=iR[19];return g(function(a){var c=a;return d(b,c)},a)})})})});default:var -d=a[1],l=a[3],m=a[2];return bG(b([0,G[11],G[12],G[13],G[14],G[15],G[16],G[17]])(0,0),function(e){return bG(c(e,d[1]),function(f){return eM(Lq(kv(function(a){try{var -c=IW(m,d[3],a+d[2]|0),b=o(f,c)[1+c],g=eM(dj(G[4].call(null,b,e)),function(a){if(0===a[0]){var -c=a[1];return c?[0,[0,b,c[1]]]:0}lu([0,LC,[0,b,[0,a[1],0]]]);return 0});return g}catch(f){return eJ(0)}},l)),function(a){return[0,a]})})})}}]}KR(function(a){return[0,Lr(a)[7]]});hB(0);return}(globalThis)); +d=a[1],l=a[3],m=a[2];return bM(b([0,H[11],H[12],H[13],H[14],H[15],H[16],H[17]],0,0),function(e){return bM(c(e,d[1]),function(f){return eX(Mt(kW(function(a){try{var +c=JZ(m,d[3],a+d[2]|0),b=p(f,c)[1+c],g=eX(dq(H[4].call(null,b,e)),function(a){if(0===a[0]){var +c=a[1];return c?[0,[0,b,c[1]]]:0}l9([0,MF,[0,b,[0,a[1],0]]]);return 0});return g}catch(f){return eU(0)}},l)),function(a){return[0,a]})})})}}]}LU(function(a){return[0,Mu(a)[7]]});hO(0);return}(globalThis)); diff --git a/main.bc.js b/main.bc.js index 7dce557..a90e3b3 100644 --- a/main.bc.js +++ b/main.bc.js @@ -5,35 +5,41 @@ globalThis!=="object"&&(this?b():(a.defineProperty(a.prototype,"_T_",{configurab b(){var b=this||self;b.globalThis=b;delete a.prototype._T_}}(Object));(function(K){"use strict";var -uv=317,q3="SH",q2="console",hX="int_of_string",tl="member",q1="ImageBlurHashes",fJ=427938126,cR=0xff,ut="%a",uu="%ni",eE=240,q0=815,si=362,qZ="tc",b_="J",kT=218,us=338,fR=-211558048,sh="aa",sf=19067,sg="Pw",ur="Out_of_memory",J=963043957,cP=870828711,ln="Failure",hW="Unix.Unix_error",hV="\\b",qY="length",se="Program",sd=321,qX=375,fY="false",sc=", characters ",tk=238,hU=869834347,ky="ou",qW=296,tj="SortName",qV="MusicArtist",h7="Map.bal",eS=-211555818,qU="ChannelFolderItem",th=30214610,ti=143365725,aZ="v",cQ="ae",qT=260,a7="w",tg="closedir",uq="Match_failure",qS=-32,sb="%s",eG="illegal",tf="MusicAlbum",e="",up="pathname",qR="Year",ck=434236056,hM=": ",te="append",eL="Id",uo="']')",un=517,td=851,qQ=371,fI="end",tc=0xe0,ib="object",kx="Jellyfin",sa=346,um="EEXIST",r$=826371656,tb="px",ul=459,uk="Locations",r_=546,ta="Undefined_recursive_module",bV=2147483647,h6="\\t",uj="%.16g",fX=224,h5="array",kS="surrogate",s$=204,s_="random",lm=192,dk=0x3f,s9=492,hT="'",ia=": No such file or directory",s8=" dst=",ui="av",bT="ts",cw=256,x="A",uh="[]",qP="height: ",s7=651,qO=832,kR=383,qN=3456159,ug=":",r9="grid-column:1/-1",aG="T",uf="Printexc.handle_uncaught_exception",r8="Type",kQ=" : flags Open_rdonly and Open_wronly are not compatible",eK=123,qM=499,qL="6",r6="class",r7=386,kw=82908052,kP="sorts",r5="@;",s6=822,ue="LiveTvChannel",r4="Genre",ll="{feng}",s5=">",r3=239,cV="Name",dW=127,cy=0xffff,s4="Sys_blocked_io",U="I",bU="Unexpected end of input",r1="ServerName",r2="_",s3=205,ud="AggregateFolder",hL="_bigarr02",r0=367,kv="not",s2="Synchronized",qK=357,lk="compare: functional value",k9="mkdir",fW=1000,bp="vendor/lwd/lib/lwd/lwd_seq.pp.ml",qJ="@[",hS="\\\\",ub="window",uc="Primary",qI="BoxSet",qH=225181919,eF=-826170817,rZ="/static/",ua=14596,N="s",d1="lib/db/stores.ml",h$="4",ku=749039939,s1="Assert_failure",t$="Movie",s0=152,t9="%X",t_="OCAMLRUNPARAM",kt=253,sZ=425,kO="canon",sY=553,kN="in",t8=".0",dY="genres",fQ="src/uutf.ml",lj="views",qG="src",rY=8232,qF="Lwd_seq.rank: node is marked",qE=391,aF=852405675,sX=429931233,t7="Recording",qD="lone",kM="2",hK="Set.bal",k8=120,eD=1024,sW=1027,dV=246,A="U",qB="Season",qC="%s--id",rX=389604418,aY="m",rW=557,dU=-752863768,t6="AccessToken",sV="%s/Items/%s/Images/Primary?width=500&format=Jpg",t5=309,qA="stream",dp="or",hR=1017453041,k7="Fatal error: exception ",aS="camlinternalFormat.ml",t4=273,qz="ui",fV=708012133,bv="j",t3=305,sU=560,aN="c",hQ=24029,qy="ItemId",t2=713199754,qx=827,rV=372,dT="date_added",rU="ENOTEMPTY",b8="dz",kL=1255,t1=726711616,sT=508493173,a="@ ",h_="JSON",qw="Book",sS="Stack_overflow",qv="Failed to unmarshal data",al="G",u="a",kK="string",sR="Path",t0=211,fU=-48,aW="P",tZ=732461442,ai="t",rT="TvProgram",eC="",rS=480,tX="Folder",tY=513,qu=-10,h9="desc",tW=400,qt="UserView",rR=193,qs="ParentId",tV=814,kJ="AV",tU=-937474657,cn="/",h4=605782321,rQ="body",cX=3654863,tT="Episode",rP=297,tS="DZ",rO="Title",sQ="--id",q="O",M="vendor/lwd/lib/lwd/lwd_table.ml",kI=756711075,qr="Fatal error: exception %s\n",sP=153884648,bo="F",sO=686,qq=818,hJ="input",ks="jsError",tR="vertical-picker",fT="ng",kH=737308346,ao="vendor/lwd/lib/lwd/lwd.ml",sN=823,qp="UserRootFolder",rN="AudioBook",tQ="ue",qo="ManualPlaylistsFolder",sM="rem",bD="0",tP=197,rL="hv",rM=368,$="n",tO="duration",qm="%u",qn=32752,kr=881518886,o="r",ql="Series",k6=8100,qk=423,ct=737455525,bW="Q",qi="LiveTvProgram",qj=0x7ff0,cl="|",dn=684370880,sL="End_of_file",rJ="AlbumId",rK="comment",rI="^",sK=819,tN=244,L="i",k5="text",tM="Audio",ae="L",kG="ENOTDIR",fP="null",tL="{}",dX=17732,eJ=992790154,eR="+",fO=726928360,li=8097,qh=858694086,sJ=523,cx=3455931,rH=395,fN=1023,eQ=125,rG="Pervasives.do_at_exit",fH=57343,sI="%c",eI=65536,qf=",@ ",qg=186,kE=-133,kF=0xf,aT="k",hI=-588596599,k4=3299808,aV="B",fM=659980059,sH="background-image: url(",b9="X",tK="Photo",sG="infinity",rF=571,sF="CollectionFolder",tJ="fd ",qd="Playlist",qe=315,qc="em",bi="M",rE=290,k3=233,rD=0xf0,lh='\\"',sC="5rem",sD="5",sE="Sys_error",b7=0x80,Z="z",an="N",tI="PhotoAlbum",fL=1073741823,rB=377,rC="(','",sB="asc",aE="K",k="e",_="d",kD="ENOENT",bh=15681,k2=-605101559,rA=544,hP="item",cv=0x8000,rz="playbackRate",sA=0x800,tH=257,rx="OE",ry="Division_by_zero",sz="@{",qb="(Program not linked with -g, cannot print stack backtrace)\n",kC="track.png",rw="Channel",sy="MusicGenre",kq=55296,qa=462,ah=106380200,bq="V",bE="x",k1=56320,aM="Y",k0=" : file already exists",ad=128,cU="sh",dm=255,sx="vendor/lwd/lib/brr-lwd/elwd.ml",lg=56319,bC="id",hO=100,r=848054398,n=-976970511,p$="background-image: url(%S)",rv=3854881,dZ="true",kZ="src/jsonm.ml",sw=337,hH=102,ru="box",lf=-97,az="H",le="album_id",tG=836,kB=4100401,kY="TH",sv=334,aj="D",kX=199,p_=2047,kA="separator",h3=237,tE=394,tF="([^/]+)",rt=759637122,cT="sort_name",ap="Z",p9="documentElement",Y="S",rs="MusicVideo",ld="Form submitted:",aX="W",rr=266,hN="\\n",rp=-101336657,rq=570,eP=3850876,af="R",bF=" ",h2=191,p8=-67383738,kp="fs",su=550,tD="%i",p7=65279,ro="0x",fK=14610,rn=0xdfff,p6=435,bg=365180284,tC=201,rm=": closedir failed",rl=17718,p5=160,bt="p",ay="C",rk=223,eH="ServerId",ax="y",tB="Not_found",st=397,ri="style",rj="Studio",tA="button",rh=" unfetched: ",tz="%Li",ss="Invalid_argument",cW="oe",d0=254,sr="GenreItems",cS=0xffffff,p4=847,ty="ls",sq="Trailer",tx="{rams}",tw="Video",p3="submit",p2=850,h1=512,lc=", ",so="%li",sp=1026,tv="Cover",lb=133,rg="BasePluginFolder",h8="tsh",aL="b",h0="/Items/",p1="Person",hG="\\r",ko="nan",tu="%.17g",S="h",sn=531,kW="rmdir",tt="Cstruct.blit_from_string src=",p0="'}')",rf=" ",sm=831,c="o",sl=174,B=248,C="l",T="g",sk="User",ts="low",re=837,hF="character",cO="value",rd=826,la=" : flags Open_text and Open_binary are not compatible",tr=846,k$=": Not a directory",rc="Nothing playing",rb="TS",s="u",pZ=" : is a directory",k_="error",pY="classList",hZ=1006505782,dq=".",fF=-364210971,tq="/Images/Primary?width=500&format=Jpg",pX=438511779,ra=363,sj="CollectionType",bj="name",pW=457,dl="q",bu=737456202,eO="server_id",fS="th",pV=271,hY="lwd-to-remove",kV=",",pU="checked",kU="index out of bounds",pT=322,pS="{SUPERTRIANGULAR}",eN=252,kn="%d",q$="lwdui-virtual-table-row",tp=292,tn="PlaylistsFolder",to=": file descriptor already closed",cm="-",km="EBADF",kl=" len=",bS=-633954146,q_=12520,q9="Username",fG="AE",q8="AO",q7="3",cu=250,kz="ph",hE=103,dr='"',b6="f",pQ="%.0f",pR=420,q6=538,tm=0xdc00,q5="TvChannel",q4="buffer.ml",E="E",eM="lz";function -S7(a,b,c,d,e){if(d<=b)for(var +u9=317,rF="SH",rE="console",cZ="int_of_string",t0="member",rC="ImageBlurHashes",rD=408,fT=427938126,cY=0xff,u7="%a",u8="%ni",eQ=240,rB=815,sV=362,rA="tc",ce="J",lc=218,u6=338,f0=-211558048,sU="aa",sS=19067,sT="Pw",u5="Out_of_memory",J=963043957,cW=870828711,lI="Failure",h6="Unix.Unix_error",h5="\\b",rz="length",sR="Program",sQ=321,ry=375,f7="false",sP=", characters ",tZ=238,h4=869834347,kT="ou",rx=296,tY="SortName",rw="MusicArtist",ig="Map.bal",e4=-211555818,rv="ChannelFolderItem",tW=30214610,tX=143365725,aZ="v",cX="ae",ru=260,a8="w",tV="closedir",u4="Match_failure",sO="%s",eS="illegal",tU="MusicAlbum",e="",u3="pathname",rt="Year",cq=434236056,hX=": ",tT="append",eX="Id",u2="']')",u1=517,tS=851,rs=371,fS="end",tR=0xe0,im="object",kS="Jellyfin",sN=346,u0="EEXIST",sM=826371656,tQ="px",uZ=459,uY="Locations",sL=546,tP="Undefined_recursive_module",b0=2147483647,ie="\\t",uX="%.16g",f6=224,id="array",lb="surrogate",tO=204,tN="random",lH=192,dq=0x3f,tM=492,h3="'",il=": No such file or directory",tL=" dst=",uW="av",bX="ts",cG=256,x="A",uV="[]",rr="height: ",tK=651,rq=832,sK=383,rp=3456159,uU=":",sJ="grid-column:1/-1",aG="T",uT="Printexc.handle_uncaught_exception",sI="Type",la=" : flags Open_rdonly and Open_wronly are not compatible",eW=123,ro=499,rn="6",sG="class",sH=386,kR=82908052,k$="sorts",sF="@;",tJ=822,uS="LiveTvChannel",sE="Genre",lG="{feng}",tI=">",sD=239,c3="Name",d5=127,cv=0xffff,tH="Sys_blocked_io",U="I",bZ="Unexpected end of input",sB="ServerName",sC="_",tG=205,uR="AggregateFolder",hW="_bigarr02",sA=367,tF=245,kQ="not",tE="Synchronized",lF="compare: functional value",ls="mkdir",f5=1000,bp="vendor/lwd/lib/lwd/lwd_seq.pp.ml",rm="@[",h2="\\\\",uP="window",uQ="Primary",rl="BoxSet",rk=225181919,eR=-826170817,sz="/static/",uO=14596,N="s",d_="lib/db/stores.ml",ik="4",kP=749039939,tD="Assert_failure",uN="Movie",tC=152,uL="%X",uM="OCAMLRUNPARAM",kO=253,tB=425,k_="canon",tA=553,k9="in",uK=".0",d7="genres",fZ="src/uutf.ml",lE="views",rj="src",sy=8232,ri="Lwd_seq.rank: node is marked",rh=391,aF=852405675,tz=429931233,uJ="Recording",rg="lone",k8="2",hV="Set.bal",lr=120,eP=1024,ty=1027,d4=246,A="U",re="Season",rf="%s--id",sx=389604418,aY="m",sw=557,d3=-752863768,uI="AccessToken",tx="%s/Items/%s/Images/Primary?width=500&format=Jpg",uH=309,rd="stream",du="or",h1=1017453041,lq="Fatal error: exception ",aS="camlinternalFormat.ml",uG=273,rc="ui",f4=708012133,by="j",uF=305,tw=560,aN="c",ca=24029,rb="ItemId",uE=713199754,ra=827,sv=372,d2="date_added",su="ENOTEMPTY",cc="dz",k7=1255,uD=726711616,tv=508493173,a="@ ",uC="Bigarray.blit: dimension mismatch",ij="JSON",q$="Book",tu="Stack_overflow",q_="Failed to unmarshal data",am="G",v="a",k6="string",tt="Path",uB=211,f3=-48,aW="P",uA=732461442,ah="t",st="TvProgram",eO="",ss=480,uy="Folder",uz=513,q9=-10,ii="desc",q8="UserView",sr=193,q7="ParentId",ux=814,k5="AV",uw=-937474657,cu="/",ic=605782321,sq="body",c5=3654863,uv="Episode",sp=297,uu="DZ",so="Title",ts="--id",q="O",M="vendor/lwd/lib/lwd/lwd_table.ml",k4=756711075,q6="Fatal error: exception %s\n",tr=153884648,bo="F",tq=686,q5=818,hU="input",kN="jsError",ut="vertical-picker",f2="ng",k3=737308346,ao="vendor/lwd/lib/lwd/lwd.ml",tp=823,q4="UserRootFolder",sn="AudioBook",us="ue",q3="ManualPlaylistsFolder",to="rem",bF="0",ur=197,sl="hv",sm=368,_="n",uq="duration",q2="%u",kM=881518886,o="r",q1="Series",lp=8100,q0=423,cE=737455525,b1="Q",qY="LiveTvProgram",qZ=0x7ff0,cr="|",dt=684370880,tn="End_of_file",sj="AlbumId",sk="comment",si="^",tm=819,L="i",dx=244,lo="text",up="Audio",ad="L",k2="ENOTDIR",fY="null",uo="{}",d6=17732,eV=992790154,e3="+",fX=726928360,lD=8097,qX=858694086,tl=523,cH=3455931,sh=395,fW=1023,e2=125,sg="Pervasives.do_at_exit",fR=57343,tk="%c",eU=65536,qV=",@ ",qW=186,k0=-133,k1=0xf,aT="k",hT=-588596599,ln=3299808,aV="B",fV=659980059,tj="background-image: url(",cd="X",un="Photo",ti="infinity",kZ=571,th="CollectionFolder",um="fd ",qT="Playlist",qU=315,qS="em",bi="M",sf=290,lm=233,se=0xf0,lC='\\"',te="5rem",tf="5",tg="Sys_error",cb=0x80,Y="z",an="N",ul="PhotoAlbum",ib=1073741823,sc=377,sd="(','",td="asc",aE="K",d="e",Z="d",kY="ENOENT",tc=358,bh=15681,ll=-605101559,sb=544,h0="item",cs=0x8000,sa="playbackRate",tb=0x800,uk=257,r_="OE",r$="Division_by_zero",ta="@{",qR="(Program not linked with -g, cannot print stack backtrace)\n",kX="track.png",r9="Channel",s$="MusicGenre",kL=55296,qQ=462,ag=106380200,bq="V",bY="x",lk=56320,aM="Y",lj=" : file already exists",ac=128,c2="sh",ds=255,s_="vendor/lwd/lib/brr-lwd/elwd.ml",lB=56319,bE="id",hZ=100,r=848054398,n=-976970511,qP="background-image: url(%S)",r8=3854881,d8="true",li="src/jsonm.ml",s9=337,hS=102,r7="box",lA=-97,aA="H",lz="album_id",uj=836,kW=4100401,lh="TH",s8=334,ai="D",lg=199,qO=2047,kV="separator",ia=237,uh=394,ui="([^/]+)",r6=759637122,c1="sort_name",ap="Z",qN="documentElement",X="S",r5="MusicVideo",ly="Form submitted:",aX="W",r4=266,hY="\\n",r3=-101336657,e1=3850876,ae="R",bG=" ",h$=191,qM=-67383738,kK="fs",s7=550,ug="%i",qL=65279,r2="0x",fU=14610,r1=0xdfff,qK=435,bg=365180284,uf=201,r0=": closedir failed",rZ=17718,qJ=160,bw="p",az="C",rY=384,rX=223,eT="ServerId",ay="y",ue="Not_found",s6=397,rV="style",rW="Studio",ud="button",rU=" unfetched: ",uc="%Li",s5="Invalid_argument",c4="oe",d9=254,s4="GenreItems",cF=0xffffff,qI=847,ub="ls",s3="Trailer",ua="{rams}",t$="Video",qH="submit",qG=850,h_=512,lx=", ",s1="%li",s2=1026,t_="Cover",lw=133,rT="BasePluginFolder",ih="tsh",aL="b",h9="/Items/",qF="Person",hR="\\r",kJ="nan",t9="%.17g",S="h",s0=531,lf="rmdir",t8="Cstruct.blit_from_string src=",qE="'}')",rS=" ",sZ=831,c="o",sY=174,B=248,C="l",T="g",sX="User",t7="low",rR=837,hQ="character",cV="value",rQ=826,lv=" : flags Open_text and Open_binary are not compatible",t6=846,lu=": Not a directory",rP="Nothing playing",rO="TS",s="u",qD=" : is a directory",lt="error",qC="classList",h8=1006505782,dv=".",fP=-364210971,t5="/Images/Primary?width=500&format=Jpg",qB=438511779,rN=363,sW="CollectionType",bj="name",qA=457,dr="q",bx=737456202,e0="server_id",f1="th",qz=271,h7="lwd-to-remove",le=",",qy="checked",ld="index out of bounds",qx=322,qw="{SUPERTRIANGULAR}",eZ=252,kI="%d",rM="lwdui-virtual-table-row",t4=292,t2="PlaylistsFolder",t3=": file descriptor already closed",ct="-",kH="EBADF",kG=" len=",bW=-633954146,rL=12520,rK="Username",fQ="AE",rJ="AO",rI="3",c0=250,kU="ph",hP=103,dw='"',b$="f",qu="%.0f",qv=420,rH=538,t1=0xdc00,rG="TvChannel",qt=", line",E="E",eY="lz";function +T7(a,b,c,d,e){if(d<=b)for(var f=1;f<=e;f++)c[d+f]=a[b+f];else for(var f=e;f>=1;f--)c[d+f]=a[b+f];return 0}function -S8(a,b,c){var +T8(a,b,c){var d=new Array(c+1);d[0]=0;for(var e=1,f=b+1;e<=c;e++,f++)d[e]=a[f];return d}function -u5(a){var +lJ(a,b,c){if(a[1]===b){a[1]=c;return 1}return 0}function +T9(a,b){var +c=a[1];a[1]+=b;return c}function +lK(a){return a[1]}function +vO(a){var b=K.process;if(b&&b.env&&b.env[a]!=undefined)return b.env[a];if(K.jsoo_static_env&&K.jsoo_static_env[a])return K.jsoo_static_env[a]}var -lH=0;(function(){var -c=u5(t_);if(c!==undefined){var -b=c.split(kV);for(var -a=0;aa.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.loa.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.lo>24),c=-this.hi+(b>>24);return new -w(a,b,c)};w.prototype.add=function(a){var +u(a,b,c)};u.prototype.add=function(a){var b=this.lo+a.lo,c=this.mi+a.mi+(b>>24),d=this.hi+a.hi+(c>>24);return new -w(b,c,d)};w.prototype.sub=function(a){var +u(b,c,d)};u.prototype.sub=function(a){var b=this.lo-a.lo,c=this.mi-a.mi+(b>>24),d=this.hi-a.hi+(c>>24);return new -w(b,c,d)};w.prototype.mul=function(a){var -b=this.lo*a.lo,c=(b*uL|0)+this.mi*a.lo+this.lo*a.mi,d=(c*uL|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new -w(b,c,d)};w.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};w.prototype.isNeg=function(){return this.hi<<16<0};w.prototype.and=function(a){return new -w(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};w.prototype.or=function(a){return new -w(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};w.prototype.xor=function(a){return new -w(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};w.prototype.shift_left=function(a){a=a&63;if(a==0)return this;if(a<24)return new -w(this.lo<>24-a,this.hi<>24-a);if(a<48)return new -w(0,this.lo<>48-a);return new -w(0,0,this.lo<>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a);if(a<48)return new -w(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0);return new -w(this.hi>>a-48,0,0)};w.prototype.shift_right=function(a){a=a&63;if(a==0)return this;var +u(b,c,d)};u.prototype.mul=function(a){var +b=this.lo*a.lo,c=(b*vu|0)+this.mi*a.lo+this.lo*a.mi,d=(c*vu|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new +u(b,c,d)};u.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};u.prototype.isNeg=function(){return this.hi<<16<0};u.prototype.and=function(a){return new +u(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};u.prototype.or=function(a){return new +u(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};u.prototype.xor=function(a){return new +u(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};u.prototype.shift_left=function(a){a=a&63;if(a==0)return this;if(a<24)return new +u(this.lo<>24-a,this.hi<>24-a);if(a<48)return new +u(0,this.lo<>48-a);return new +u(0,0,this.lo<>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a);if(a<48)return new +u(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0);return new +u(this.hi>>a-48,0,0)};u.prototype.shift_right=function(a){a=a&63;if(a==0)return this;var c=this.hi<<16>>16;if(a<24)return new -w(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var +u(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var b=this.hi<<16>>31;if(a<48)return new -w(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&cy);return new -w(this.hi<<16>>a-32,b,b)};w.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&cS;this.lo=this.lo<<1&cS};w.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&cS;this.mi=(this.mi>>>1|this.hi<<23)&cS;this.hi=this.hi>>>1};w.prototype.udivmod=function(a){var +u(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&cv);return new +u(this.hi<<16>>a-32,b,b)};u.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&cF;this.lo=this.lo<<1&cF};u.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&cF;this.mi=(this.mi>>>1|this.hi<<23)&cF;this.hi=this.hi>>>1};u.prototype.udivmod=function(a){var d=0,c=this.copy(),b=a.copy(),e=new -w(0,0,0);while(c.ucompare(b)>0){d++;b.lsl1()}while(d>=0){d--;e.lsl1();if(c.ucompare(b)>=0){e.lo++;c=c.sub(b)}b.lsr1()}return{quotient:e,modulus:c}};w.prototype.div=function(a){var -b=this;if(a.isZero())lG();var -d=b.hi^a.hi;if(b.hi&cv)b=b.neg();if(a.hi&cv)a=a.neg();var -c=b.udivmod(a).quotient;if(d&cv)c=c.neg();return c};w.prototype.mod=function(a){var -b=this;if(a.isZero())lG();var -d=b.hi;if(b.hi&cv)b=b.neg();if(a.hi&cv)a=a.neg();var -c=b.udivmod(a).modulus;if(d&cv)c=c.neg();return c};w.prototype.toInt=function(){return this.lo|this.mi<<24};w.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};w.prototype.toArray=function(){return[this.hi>>8,this.hi&cR,this.mi>>16,this.mi>>8&cR,this.mi&cR,this.lo>>16,this.lo>>8&cR,this.lo&cR]};w.prototype.lo32=function(){return this.lo|(this.mi&cR)<<24};w.prototype.hi32=function(){return this.mi>>>8&cy|this.hi<<16};function -Ty(a,b){return new -w(a&cS,a>>>24&cR|(b&cy)<<8,b>>>16&cy)}function -ly(a){return a.hi32()}function -lz(a){return a.lo32()}function -d3(){aA(kU)}var -S_=hL;function -ds(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}ds.prototype.caml_custom=S_;ds.prototype.offset=function(a){var +u(0,0,0);while(c.ucompare(b)>0){d++;b.lsl1()}while(d>=0){d--;e.lsl1();if(c.ucompare(b)>=0){e.lo++;c=c.sub(b)}b.lsr1()}return{quotient:e,modulus:c}};u.prototype.div=function(a){var +b=this;if(a.isZero())l5();var +d=b.hi^a.hi;if(b.hi&cs)b=b.neg();if(a.hi&cs)a=a.neg();var +c=b.udivmod(a).quotient;if(d&cs)c=c.neg();return c};u.prototype.mod=function(a){var +b=this;if(a.isZero())l5();var +d=b.hi;if(b.hi&cs)b=b.neg();if(a.hi&cs)a=a.neg();var +c=b.udivmod(a).modulus;if(d&cs)c=c.neg();return c};u.prototype.toInt=function(){return this.lo|this.mi<<24};u.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};u.prototype.toArray=function(){return[this.hi>>8,this.hi&cY,this.mi>>16,this.mi>>8&cY,this.mi&cY,this.lo>>16,this.lo>>8&cY,this.lo&cY]};u.prototype.lo32=function(){return this.lo|(this.mi&cY)<<24};u.prototype.hi32=function(){return this.mi>>>8&cv|this.hi<<16};function +UB(a,b){return new +u(a&cF,a>>>24&cY|(b&cv)<<8,b>>>16&cv)}function +lU(a){return a.hi32()}function +lV(a){return a.lo32()}function +ea(){as(ld)}var +Ua=hW;function +dy(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}dy.prototype.caml_custom=Ua;dy.prototype.offset=function(a){var c=0;if(typeof a==="number")a=[a];if(!(a instanceof -Array))aA("bigarray.js: invalid offset");if(this.dims.length!=a.length)aA("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var -b=0;b=this.dims[b])d3();c=c*this.dims[b]+a[b]}else +Array))as("bigarray.js: invalid offset");if(this.dims.length!=a.length)as("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var +b=0;b=this.dims[b])ea();c=c*this.dims[b]+a[b]}else for(var -b=this.dims.length-1;b>=0;b--){if(a[b]<1||a[b]>this.dims[b])d3();c=c*this.dims[b]+(a[b]-1)}return c};ds.prototype.get=function(a){switch(this.kind){case +b=this.dims.length-1;b>=0;b--){if(a[b]<1||a[b]>this.dims[b])ea();c=c*this.dims[b]+(a[b]-1)}return c};dy.prototype.get=function(a){switch(this.kind){case 7:var -d=this.data[a*2+0],b=this.data[a*2+1];return Ty(d,b);case +d=this.data[a*2+0],b=this.data[a*2+1];return UB(d,b);case 10:case 11:var -e=this.data[a*2+0],c=this.data[a*2+1];return[d0,e,c];default:return this.data[a]}};ds.prototype.set=function(a,b){switch(this.kind){case -7:this.data[a*2+0]=lz(b);this.data[a*2+1]=ly(b);break;case +e=this.data[a*2+0],c=this.data[a*2+1];return[d9,e,c];default:return this.data[a]}};dy.prototype.set=function(a,b){switch(this.kind){case +7:this.data[a*2+0]=lV(b);this.data[a*2+1]=lU(b);break;case 10:case -11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};ds.prototype.fill=function(a){switch(this.kind){case +11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};dy.prototype.fill=function(a){switch(this.kind){case 7:var -c=lz(a),e=ly(a);if(c==e)this.data.fill(c);else +c=lV(a),e=lU(a);if(c==e)this.data.fill(c);else for(var b=0;ba.data[c])return 1}break}return 0};function -eT(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}eT.prototype=new -ds();eT.prototype.offset=function(a){if(typeof +e5(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}e5.prototype=new +dy();e5.prototype.offset=function(a){if(typeof a!=="number")if(a instanceof Array&&a.length==1)a=a[0];else -aA("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])d3();return a};eT.prototype.get=function(a){return this.data[a]};eT.prototype.set=function(a,b){this.data[a]=b;return 0};eT.prototype.fill=function(a){this.data.fill(a);return 0};function -lo(a,b,c,d){var -e=uA(a);if(id(c)*e!=d.length)aA("length doesn't match dims");if(b==0&&c.length==1&&e==1)return new -eT(a,b,c,d);return new -ds(a,b,c,d)}function -eX(a){return a.slice(1)}function -S9(a,b,c){var -d=eX(c),e=uy(a,id(d));return lo(a,b,d,e)}function -S$(a,b){if(b<0||b>=a.dims.length)aA("Bigarray.dim");return a.dims[b]}function -Ta(a){return S$(a,0)}function -Tb(a,b){return a.get(a.offset(b))}function -f9(a,b,c){var +as("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])ea();return a};e5.prototype.get=function(a){return this.data[a]};e5.prototype.set=function(a,b){this.data[a]=b;return 0};e5.prototype.fill=function(a){this.data.fill(a);return 0};function +lL(a,b,c,d){var +e=vd(a);if(ip(c)*e!=d.length)as("length doesn't match dims");if(b==0&&c.length==1&&e==1)return new +e5(a,b,c,d);return new +dy(a,b,c,d)}function +e8(a){return a.slice(1)}function +T$(a,b,c){var +d=e8(c),e=va(a,ip(d));return lL(a,b,d,e)}function +Ub(a,b){if(b<0||b>=a.dims.length)as("Bigarray.dim");return a.dims[b]}function +Uc(a){return Ub(a,0)}function +vc(a,b){return a.get(a.offset(b))}function +f9(a,b,c){a.set(a.offset(b),c);return 0}function +gh(a,b,c){var d=String.fromCharCode;if(b==0&&c<=4096&&c==a.length)return d.apply(null,a);var -f=e;for(;0=c.l||c.t==2&&e>=c.c.length)){c.c=a.t==4?f9(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else if(c.t==2&&d==c.c.length){c.c+=a.t==4?f9(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else{if(c.t!=4)ih(c);var +cf(a,b,c,d,e){if(e==0)return 0;if(d==0&&(e>=c.l||c.t==2&&e>=c.c.length)){c.c=a.t==4?gh(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else if(c.t==2&&d==c.c.length){c.c+=a.t==4?gh(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else{if(c.t!=4)it(c);var g=a.c,h=c.c;if(a.t==4)if(d<=b)for(var f=0;f=0;f--)h[d+f]=g[b+f];else{var i=Math.min(e,g.length-b);for(var f=0;f>=1;if(a==0)return d;b+=b;c++;if(c==9)b.slice(0,1)}}function -f1(a){if(a.t==2)a.c+=eZ(a.l-a.c.length,"\0");else -a.c=f9(a.c,0,a.c.length);a.t=0}function -lJ(a){if(a.length<24){for(var -b=0;bdW)return false;return true}else +f$(a){if(a.t==2)a.c+=e_(a.l-a.c.length,"\0");else +a.c=gh(a.c,0,a.c.length);a.t=0}function +l8(a){if(a.length<24){for(var +b=0;bd5)return false;return true}else return!/[^\x00-\x7f]/.test(a)}function -u3(a){for(var -k=e,d=e,h,g,i,b,c=0,j=a.length;ch1){d.substr(0,1);k+=d;d=e;k+=a.slice(c,f)}else -d+=a.slice(c,f);if(f==j)break;c=f}b=1;if(++c=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c0x10ffff)b=3}}}}}if(b<4){c-=b;d+="\ufffd"}else if(b>cy)d+=String.fromCharCode(0xd7c0+(b>>10),tm+(b&0x3FF));else -d+=String.fromCharCode(b);if(d.length>eD){d.substr(0,1);k+=d;d=e}}return k+d}function -cY(a,b,c){this.t=a;this.c=b;this.l=c}cY.prototype.toString=function(){switch(this.t){case -9:return this.c;default:f1(this);case -0:if(lJ(this.c)){this.t=9;return this.c}this.t=8;case -8:return this.c}};cY.prototype.toUtf16=function(){var -a=this.toString();if(this.t==9)return a;return u3(a)};cY.prototype.slice=function(){var +vM(a){for(var +k=e,d=e,h,g,i,b,c=0,j=a.length;ch_){d.substr(0,1);k+=d;d=e;k+=a.slice(c,f)}else +d+=a.slice(c,f);if(f==j)break;c=f}b=1;if(++c=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c0x10ffff)b=3}}}}}if(b<4){c-=b;d+="\ufffd"}else if(b>cv)d+=String.fromCharCode(0xd7c0+(b>>10),t1+(b&0x3FF));else +d+=String.fromCharCode(b);if(d.length>eP){d.substr(0,1);k+=d;d=e}}return k+d}function +c6(a,b,c){this.t=a;this.c=b;this.l=c}c6.prototype.toString=function(){switch(this.t){case +9:return this.c;default:f$(this);case +0:if(l8(this.c)){this.t=9;return this.c}this.t=8;case +8:return this.c}};c6.prototype.toUtf16=function(){var +a=this.toString();if(this.t==9)return a;return vM(a)};c6.prototype.slice=function(){var a=this.t==4?this.c.slice():this.c;return new -cY(this.t,a,this.l)};function -uD(a){return new -cY(0,a,a.length)}function -cp(a){return a}function -du(a){return uD(cp(a))}function -dt(a,b,c,d,e){b$(du(a),b,c,d,e);return 0}function +c6(this.t,a,this.l)};function +vg(a){return new +c6(0,a,a.length)}function +cx(a){return a}function +dA(a){return vg(cx(a))}function +dz(a,b,c,d,e){cf(dA(a),b,c,d,e);return 0}function p(a){return a.length}function -bw(a,b){return a.charCodeAt(b)}function -u2(a){var +bt(a,b){return a.charCodeAt(b)}function +vL(a){var d=p(a),c=new -Uint8Array(d),b=0;for(;bp(a))d3();if(f+e>c.data.length)d3();var -g=u2(a).slice(b,b+e);c.data.set(g,f);return 0}var -Td=Tc;function -lp(){aA(kU)}function -d4(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case +Uint8Array(d),b=0;for(;bp(a))ea();if(f+e>c.data.length)ea();var +g=vL(a).slice(b,b+e);c.data.set(g,f);return 0}var +Ue=Ud;function +iq(){as(ld)}function +dB(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case 0:return a.c.charCodeAt(b);case 4:return a.c[b]}}function -f0(a,b){if(b>>>0>=a.l)lp();return d4(a,b)}function -aq(a,b,c){c&=cR;if(a.t!=4){if(b==a.c.length){a.c+=String.fromCharCode(c);if(b+1==a.l)a.t=0;return 0}ih(a)}a.c[b]=c;return 0}function -cZ(a,b,c){if(b>>>0>=a.l)lp();return aq(a,b,c)}function -d7(a){return a.toArray()}function -Tg(a,b,c){if(b>>>0>=a.l-7)lp();var -e=d7(c);for(var +f_(a,b){if(b>>>0>=a.l)iq();return dB(a,b)}function +eb(a){return new +u(a[7]<<0|a[6]<<8|a[5]<<16,a[4]<<0|a[3]<<8|a[2]<<16,a[1]<<0|a[0]<<8)}function +Uh(a,b){if(b>>>0>=a.l-7)iq();var +d=new +Array(8);for(var +c=0;c<8;c++)d[7-c]=dB(a,b+c);return eb(d)}function +aq(a,b,c){c&=cY;if(a.t!=4){if(b==a.c.length){a.c+=String.fromCharCode(c);if(b+1==a.l)a.t=0;return 0}it(a)}a.c[b]=c;return 0}function +cg(a,b,c){if(b>>>0>=a.l)iq();return aq(a,b,c)}function +ec(a){return a.toArray()}function +vh(a,b,c){if(b>>>0>=a.l-7)iq();var +e=ec(c);for(var d=0;d<8;d++)aq(a,b+7-d,e[d]);return 0}function -c0(d,c){var +c7(d,c){var f=d.l>=0?d.l:d.l=d.length,e=c.length,b=f-e;if(b==0)return d.apply(null,c);else if(b<0){var a=d.apply(null,c.slice(0,f));if(typeof -a!=="function")return a;return c0(a,c.slice(f))}else{switch(b){case +a!=="function")return a;return c7(a,c.slice(f))}else{switch(b){case 1:{var a=function(a){var f=new @@ -230,29 +243,29 @@ a=function(){var e=arguments.length==0?1:arguments.length,b=new Array(c.length+e);for(var a=0;a>>0>=a.length-1)d3();return a}function -ig(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function -uP(a){return 0}var -Uc=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function -Ub(a){if(Uc)return Math.floor(Math.log2(a));var +a=0;a>>0>=a.length-1)ea();return a}function +is(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function +vx(a){return a==tF?1:0}var +Vh=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function +Vg(a){if(Vh)return Math.floor(Math.log2(a));var b=0;if(a==0)return-Infinity;if(a>=1)while(a>=2){a/=2;b++}else while(a<1){a*=2;b--}return b}function -lw(a){var +lS(a){var b=new Float32Array(1);b[0]=a;var c=new Int32Array(b.buffer);return c[0]|0}function -d6(a,b,c){return new -w(a,b,c)}function -ii(a){if(!isFinite(a)){if(isNaN(a))return d6(1,0,qj);return a>0?d6(0,0,qj):d6(0,0,0xfff0)}var -f=a==0&&1/a==-Infinity?cv:a>=0?0:cv;if(f)a=-a;var -b=Ub(a)+fN;if(b<=0){b=0;a/=Math.pow(2,-sp)}else{a/=Math.pow(2,b-sW);if(a<16){a*=2;b-=1}if(b==0)a/=2}var +bs(a,b,c){return new +u(a,b,c)}function +iv(a){if(!isFinite(a)){if(isNaN(a))return bs(1,0,qZ);return a>0?bs(0,0,qZ):bs(0,0,0xfff0)}var +f=a==0&&1/a==-Infinity?cs:a>=0?0:cs;if(f)a=-a;var +b=Vg(a)+fW;if(b<=0){b=0;a/=Math.pow(2,-s2)}else{a/=Math.pow(2,b-ty);if(a<16){a*=2;b-=1}if(b==0)a/=2}var d=Math.pow(2,24),c=a|0;a=(a-c)*d;var e=a|0;a=(a-e)*d;var -g=a|0;c=c&kF|f|b<<4;return d6(g,e,c)}function -uC(a,b,c){a.write(32,b.dims.length);a.write(32,b.kind|b.layout<<8);if(b.caml_custom==hL)for(var -d=0;d>4;if(d==p_)return(f|g|c&kF)==0?c&cv?-Infinity:Infinity:NaN;var -e=Math.pow(2,-24),b=(f*e+g)*e+(c&kF);if(d>0){b+=16;b*=Math.pow(2,d-sW)}else -b*=Math.pow(2,-sp);if(c&cv)b=-b;return b}function -bG(a){if(!bk.Failure)bk.Failure=[B,bX(ln),-3];lF(bk.Failure,a)}function -uz(a,b,c){var -k=a.read32s();if(k<0||k>16)bG("input_value: wrong number of bigarray dimensions");var -r=a.read32s(),l=r&cR,q=r>>8&1,j=[];if(c==hL)for(var +e7(a){var +f=a.lo,g=a.mi,c=a.hi,d=(c&0x7fff)>>4;if(d==qO)return(f|g|c&k1)==0?c&cs?-Infinity:Infinity:NaN;var +e=Math.pow(2,-24),b=(f*e+g)*e+(c&k1);if(d>0){b+=16;b*=Math.pow(2,d-ty)}else +b*=Math.pow(2,-s2);if(c&cs)b=-b;return b}function +a1(a){if(!bk.Failure)bk.Failure=[B,bH(lI),-3];l4(bk.Failure,a)}function +vb(a,b,c){var +k=a.read32s();if(k<0||k>16)a1("input_value: wrong number of bigarray dimensions");var +r=a.read32s(),l=r&cY,q=r>>8&1,j=[];if(c==hW)for(var d=0;d>>32-15;b=f7(b,0x1b873593);a^=b;a=a<<13|a>>>32-13;return(a+(a<<2)|0)+(0xe6546b64|0)|0}function -Ts(a,b){a=bl(a,lz(b));a=bl(a,ly(b));return a}function -lu(a,b){return Ts(a,ii(b))}function -uB(a){var -c=id(a.dims),d=0;switch(a.kind){case +n=e7(eb(g));i.set(d,[d9,o,n])}break}b[0]=(4+k)*4;return lL(l,q,j,h)}function +u$(a,b,c){return a.compare(b,c)}function +gg(a,b){return Math.imul(a,b)}function +bl(a,b){b=gg(b,0xcc9e2d51|0);b=b<<15|b>>>32-15;b=gg(b,0x1b873593);a^=b;a=a<<13|a>>>32-13;return(a+(a<<2)|0)+(0xe6546b64|0)|0}function +Uv(a,b){a=bl(a,lV(b));a=bl(a,lU(b));return a}function +lQ(a,b){return Uv(a,iv(b))}function +ve(a){var +c=ip(a.dims),d=0;switch(a.kind){case 2:case 3:case -12:if(c>cw)c=cw;var +12:if(c>cG)c=cG;var e=0,b=0;for(b=0;b+4<=a.data.length;b+=4){e=a.data[b+0]|a.data[b+1]<<8|a.data[b+2]<<16|a.data[b+3]<<24;d=bl(d,e)}e=0;switch(c&3){case 3:e=a.data[b+2]<<16;case 2:e|=a.data[b+1]<<8;case 1:e|=a.data[b+0];d=bl(d,e)}break;case 4:case -5:if(c>ad)c=ad;var +5:if(c>ac)c=ac;var e=0,b=0;for(b=0;b+2<=a.data.length;b+=2){e=a.data[b+0]|a.data[b+1]<<16;d=bl(d,e)}if((c&1)!=0)d=bl(d,a.data[b]);break;case 6:if(c>64)c=64;for(var b=0;b64)c=64;for(var -b=0;b32)c=32;for(var -b=0;b0?f(b,a,d):f(a,b,d);if(d&&e!=e)return c;if(+e!=+e)return+e;if((e|0)!=0)return e|0}return c}function -il(a){return typeof +ix(a){return typeof a==="string"&&!/[^\x00-\xff]/.test(a)}function -ik(a){return a +iw(a){return a instanceof -cY}function -uF(a){if(typeof -a==="number")return fW;else if(ik(a))return eN;else if(il(a))return 1252;else if(a +c6}function +vj(a){if(typeof +a==="number")return f5;else if(iw(a))return eZ;else if(ix(a))return 1252;else if(a instanceof -Array&&a[0]===a[0]>>>0&&a[0]<=dm){var -b=a[0]|0;return b==d0?0:b}else if(a +Array&&a[0]===a[0]>>>0&&a[0]<=ds){var +b=a[0]|0;return b==d9?0:b}else if(a instanceof -String)return q_;else if(typeof -a=="string")return q_;else if(a +String)return rL;else if(typeof +a=="string")return rL;else if(a instanceof -Number)return fW;else if(a&&a.caml_custom)return kL;else if(a&&a.compare)return 1256;else if(typeof +Number)return f5;else if(a&&a.caml_custom)return k7;else if(a&&a.compare)return 1256;else if(typeof a=="function")return 1247;else if(typeof a=="symbol")return 1251;return 1001}function -lB(a,b){if(ab?1:0}function -Tf(a,b){a.t&6&&f1(a);b.t&6&&f1(b);return a.cb.c?1:0}function -eU(a,b,c){var +lY(a,b){if(ab?1:0}function +Ug(a,b){a.t&6&&f$(a);b.t&6&&f$(b);return a.cb.c?1:0}function +e6(a,b,c){var f=[];for(;;){if(!(c&&a===b)){var -e=uF(a);if(e==cu){a=a[1];continue}var -g=uF(b);if(g==cu){b=b[1];continue}if(e!==g){if(e==fW){if(g==kL)return uE(a,b,-1,c);return-1}if(g==fW){if(e==kL)return uE(b,a,1,c);return 1}return eb)return 1;if(a!=b){if(!c)return NaN;if(a==a)return 1;if(b==b)return-1}break;case 1251:if(a!==b){if(!c)return NaN;return 1}break;case 1252:var -a=cp(a),b=cp(b);if(a!==b){if(ab)return 1}break;case +a=cx(a),b=cx(b);if(a!==b){if(ab)return 1}break;case 12520:var a=a.toString(),b=b.toString();if(a!==b){if(ab)return 1}break;case 246:case -254:default:if(uP(e)){aA("compare: continuation value");break}if(a.length!=b.length)return a.length1)f.push(a,b,1);break}}if(f.length==0)return 0;var +254:default:if(vx(e)){as("compare: continuation value");break}if(a.length!=b.length)return a.length1)f.push(a,b,1);break}}if(f.length==0)return 0;var h=f.pop();b=f.pop();a=f.pop();if(h+10)if(b==0&&(c>=a.l||a.t==2&&c>=a.c.length))if(d==0){a.c=e;a.t=2}else{a.c=eZ(c,String.fromCharCode(d));a.t=c==a.l?0:2}else{if(a.t!=4)ih(a);for(c+=b;b0&&b===b)return b;a=a.replace(/_/g,e);b=+a;if(a.length>0&&b===b||/^[+-]?nan$/i.test(a))return b;var +dC(a,b){return e6(a,b,true)}function +Ui(){return[0]}function +aj(a){if(a<0)as("Bytes.create");return new +c6(a?2:9,e,a)}var +iu=[0];function +Uk(a,b){if(iu!==a)return 0;iu=b;return 1}function +vk(a){return iu}function +Ul(a){iu=a}function +vl(a,b){return+(e6(a,b,false)==0)}function +Un(a,b,c,d){if(c>0)if(b==0&&(c>=a.l||a.t==2&&c>=a.c.length))if(d==0){a.c=e;a.t=2}else{a.c=e_(c,String.fromCharCode(d));a.t=c==a.l?0:2}else{if(a.t!=4)it(a);for(c+=b;b0&&b===b)return b;a=a.replace(/_/g,e);b=+a;if(a.length>0&&b===b||/^[+-]?nan$/i.test(a))return b;var c=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(a);if(c){var -d=c[3].replace(/0+$/,e),g=parseInt(c[1]+c[2]+d,16),f=(c[5]|0)-4*d.length;b=g*Math.pow(2,f);return b}if(/^\+?inf(inity)?$/i.test(a))return Infinity;if(/^-inf(inity)?$/i.test(a))return-Infinity;bG("float_of_string")}function -lE(a){a=cp(a);var -e=a.length;if(e>31)aA("format_int: format too long");var -b={justify:eR,signstyle:cm,filler:bF,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:b6};for(var +d=c[3].replace(/0+$/,e),g=parseInt(c[1]+c[2]+d,16),f=(c[5]|0)-4*d.length;b=g*Math.pow(2,f);return b}if(/^\+?inf(inity)?$/i.test(a))return Infinity;if(/^-inf(inity)?$/i.test(a))return-Infinity;a1("float_of_string")}function +l3(a){a=cx(a);var +e=a.length;if(e>31)as("format_int: format too long");var +b={justify:e3,signstyle:ct,filler:bG,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:b$};for(var d=0;d=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case".":b.prec=0;d++;while(c=a.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;case"d":case"i":b.signedconv=true;case"u":b.base=10;break;case"x":b.base=16;break;case"X":b.base=16;b.uppercase=true;break;case"o":b.base=8;break;case"e":case"f":case"g":b.signedconv=true;b.conv=c;break;case"E":case"F":case"G":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function -ls(a,b){if(a.uppercase)b=b.toUpperCase();var -f=b.length;if(a.signedconv&&(a.sign<0||a.signstyle!=cm))f++;if(a.alternate){if(a.base==8)f+=1;if(a.base==16)f+=2}var -c=e;if(a.justify==eR&&a.filler==bF)for(var -d=f;d20){c-=20;a/=Math.pow(10,c);a+=new -Array(c+1).join(bD);if(b>0)a=a+dq+new -Array(b+1).join(bD);return a}else +c=a.charAt(d);switch(c){case"-":b.justify=ct;break;case"+":case" ":b.signstyle=c;break;case"0":b.filler=bF;break;case"#":b.alternate=true;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":b.width=0;while(c=a.charCodeAt(d)-48,c>=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case".":b.prec=0;d++;while(c=a.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;case"d":case"i":b.signedconv=true;case"u":b.base=10;break;case"x":b.base=16;break;case"X":b.base=16;b.uppercase=true;break;case"o":b.base=8;break;case"e":case"f":case"g":b.signedconv=true;b.conv=c;break;case"E":case"F":case"G":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function +lO(a,b){if(a.uppercase)b=b.toUpperCase();var +f=b.length;if(a.signedconv&&(a.sign<0||a.signstyle!=ct))f++;if(a.alternate){if(a.base==8)f+=1;if(a.base==16)f+=2}var +c=e;if(a.justify==e3&&a.filler==bG)for(var +d=f;d20){c-=20;a/=Math.pow(10,c);a+=new +Array(c+1).join(bF);if(b>0)a=a+dv+new +Array(b+1).join(bF);return a}else return a.toFixed(b)}}var -c,f=lE(a),e=f.prec<0?6:f.prec;if(b<0||b==0&&1/b==-Infinity){f.sign=-1;b=-b}if(isNaN(b)){c=ko;f.filler=bF}else if(!isFinite(b)){c="inf";f.filler=bF}else -switch(f.conv){case"e":var -c=b.toExponential(e),d=c.length;if(c.charAt(d-3)==k)c=c.slice(0,d-1)+bD+c.slice(d-1);break;case"f":c=j(b,e);break;case"g":e=e?e:1;c=b.toExponential(e-1);var -i=c.indexOf(k),h=+c.slice(i+1);if(h<-4||b>=1e21||b.toFixed(0).length>e){var -d=i-1;while(c.charAt(d)==bD)d--;if(c.charAt(d)==dq)d--;c=c.slice(0,d+1)+c.slice(i);d=c.length;if(c.charAt(d-3)==k)c=c.slice(0,d-1)+bD+c.slice(d-1);break}else{var -g=e;if(h<0){g-=h+1;c=b.toFixed(g)}else -while(c=b.toFixed(g),c.length>e+1)g--;if(g){var -d=c.length-1;while(c.charAt(d)==bD)d--;if(c.charAt(d)==dq)d--;c=c.slice(0,d+1)}}break}return ls(f,c)}function -f5(a,b){if(cp(a)==kn)return bX(e+b);var -c=lE(a);if(b<0)if(c.signedconv){c.sign=-1;b=-b}else +c,g=l3(a),f=g.prec<0?6:g.prec;if(b<0||b==0&&1/b==-Infinity){g.sign=-1;b=-b}if(isNaN(b)){c=kJ;g.filler=bG}else if(!isFinite(b)){c="inf";g.filler=bG}else +switch(g.conv){case"e":var +c=b.toExponential(f),e=c.length;if(c.charAt(e-3)==d)c=c.slice(0,e-1)+bF+c.slice(e-1);break;case"f":c=k(b,f);break;case"g":f=f?f:1;c=b.toExponential(f-1);var +j=c.indexOf(d),i=+c.slice(j+1);if(i<-4||b>=1e21||b.toFixed(0).length>f){var +e=j-1;while(c.charAt(e)==bF)e--;if(c.charAt(e)==dv)e--;c=c.slice(0,e+1)+c.slice(j);e=c.length;if(c.charAt(e-3)==d)c=c.slice(0,e-1)+bF+c.slice(e-1);break}else{var +h=f;if(i<0){h-=i+1;c=b.toFixed(h)}else +while(c=b.toFixed(h),c.length>f+1)h--;if(h){var +e=c.length-1;while(c.charAt(e)==bF)e--;if(c.charAt(e)==dv)e--;c=c.slice(0,e+1)}}break}return lO(g,c)}function +gd(a,b){if(cx(a)==kI)return bH(e+b);var +c=l3(a);if(b<0)if(c.signedconv){c.sign=-1;b=-b}else b>>>=0;var -d=b.toString(c.base);if(c.prec>=0){c.filler=bF;var -f=c.prec-d.length;if(f>0)d=eZ(f,bD)+d}return ls(c,d)}var -T0=0;function -ar(){return T0++}function -O(a){if(lJ(a))return a;return u3(a)}function -f$(){return typeof +d=b.toString(c.base);if(c.prec>=0){c.filler=bG;var +f=c.prec-d.length;if(f>0)d=e_(f,bF)+d}return lO(c,d)}var +U6=0;function +ar(){return U6++}function +O(a){if(l8(a))return a;return vM(a)}function +gj(){return typeof K.process!=="undefined"&&typeof K.process.versions!=="undefined"&&typeof K.process.versions.node!=="undefined"}function -Ud(){function -a(a){if(a.charAt(0)===cn)return[e,a.substring(1)];return}function +Vi(){function +a(a){if(a.charAt(0)===cu)return[e,a.substring(1)];return}function b(a){var -h=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b=h.exec(a),c=b[1]||e,f=Boolean(c&&c.charAt(1)!==ug);if(Boolean(b[2]||f)){var -d=b[1]||e,g=b[2]||e;return[d,a.substring(d.length+g.length)]}return}return f$()&&K.process&&K.process.platform?K.process.platform==="win32"?b:a:a}var -lK=Ud();function -u1(a){return a.slice(-1)!==cn?a+cn:a}if(f$()&&K.process&&K.process.cwd)var -f2=K.process.cwd().replace(/\\/g,cn);else +h=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b=h.exec(a),c=b[1]||e,f=Boolean(c&&c.charAt(1)!==uU);if(Boolean(b[2]||f)){var +d=b[1]||e,g=b[2]||e;return[d,a.substring(d.length+g.length)]}return}return gj()&&K.process&&K.process.platform?K.process.platform==="win32"?b:a:a}var +l9=Vi();function +vK(a){return a.slice(-1)!==cu?a+cu:a}if(gj()&&K.process&&K.process.cwd)var +ga=K.process.cwd().replace(/\\/g,cu);else var -f2="/static";f2=u1(f2);function -TN(a){a=O(a);if(!lK(a))a=f2+a;var -e=lK(a),d=e[1].split(cn),b=[];for(var +ga="/static";ga=vK(ga);function +UT(a){a=O(a);if(!l9(a))a=ga+a;var +e=l9(a),d=e[1].split(cu),b=[];for(var c=0;c1)b.pop();break;case".":break;case"":break;default:b.push(d[c]);break}b.unshift(e[0]);b.orig=a;return b}function -Ua(a){for(var -g=e,c=g,b,i,d=0,h=a.length;dh1){c.substr(0,1);g+=c;c=e;g+=a.slice(d,f)}else -c+=a.slice(d,f);if(f==h)break;d=f}if(b>6);c+=String.fromCharCode(b7|b&dk)}else if(b<0xd800||b>=rn)c+=String.fromCharCode(tc|b>>12,b7|b>>6&dk,b7|b&dk);else if(b>=0xdbff||d+1==h||(i=a.charCodeAt(d+1))rn)c+="\xef\xbf\xbd";else{d++;b=(b<<10)+i-0x35fdc00;c+=String.fromCharCode(rD|b>>18,b7|b>>12&dk,b7|b>>6&dk,b7|b&dk)}if(c.length>eD){c.substr(0,1);g+=c;c=e}}return g+c}function -bH(a){return lJ(a)?bX(a):bX(Ua(a))}var -Ue=["E2BIG","EACCES","EAGAIN",km,"EBUSY","ECHILD","EDEADLK","EDOM",um,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",kD,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",kG,rU,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function -c4(a,b,c,d){var -f=Ue.indexOf(a);if(f<0){if(d==null)d=-9999;f=[0,d]}var -g=[f,bH(b||e),bH(c||e)];return g}var -uW={};function -dx(a){return uW[a]}function -c3(a,b){throw g([0,a].concat(b))}function -lq(a){if(!(a +Vf(a){for(var +g=e,c=g,b,i,d=0,h=a.length;dh_){c.substr(0,1);g+=c;c=e;g+=a.slice(d,f)}else +c+=a.slice(d,f);if(f==h)break;d=f}if(b>6);c+=String.fromCharCode(cb|b&dq)}else if(b<0xd800||b>=r1)c+=String.fromCharCode(tR|b>>12,cb|b>>6&dq,cb|b&dq);else if(b>=0xdbff||d+1==h||(i=a.charCodeAt(d+1))r1)c+="\xef\xbf\xbd";else{d++;b=(b<<10)+i-0x35fdc00;c+=String.fromCharCode(se|b>>18,cb|b>>12&dq,cb|b>>6&dq,cb|b&dq)}if(c.length>eP){c.substr(0,1);g+=c;c=e}}return g+c}function +bI(a){return l8(a)?bH(a):bH(Vf(a))}var +Vj=["E2BIG","EACCES","EAGAIN",kH,"EBUSY","ECHILD","EDEADLK","EDOM",u0,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",kY,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",k2,su,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function +c_(a,b,c,d){var +f=Vj.indexOf(a);if(f<0){if(d==null)d=-9999;f=[0,d]}var +g=[f,bI(b||e),bI(c||e)];return g}var +vE={};function +dF(a){return vE[a]}function +c9(a,b){throw g([0,a].concat(b))}function +lM(a){if(!(a instanceof Uint8Array))a=new Uint8Array(a);return new -cY(4,a,a.length)}function -F(a){lF(bk.Sys_error,a)}function -uZ(a){F(a+ia)}function -f_(a){if(a.t!=4)ih(a);return a.c}function -a8(a){return a.l}function -uw(){}function +c6(4,a,a.length)}function +G(a){l4(bk.Sys_error,a)}function +vI(a){G(a+il)}function +gi(a){if(a.t!=4)it(a);return a.c}function +a9(a){return a.l}function +u_(){}function br(a){this.data=a}br.prototype=new -uw();br.prototype.constructor=br;br.prototype.truncate=function(a){var -b=this.data;this.data=am(a|0);b$(b,0,this.data,0,a)};br.prototype.length=function(){return a8(this.data)};br.prototype.write=function(a,b,c,d){var +u_();br.prototype.constructor=br;br.prototype.truncate=function(a){var +b=this.data;this.data=aj(a|0);cf(b,0,this.data,0,a)};br.prototype.length=function(){return a9(this.data)};br.prototype.write=function(a,b,c,d){var e=this.length();if(a+d>=e){var -f=am(a+d),g=this.data;this.data=f;b$(g,0,this.data,0,e)}b$(lq(b),c,this.data,a,d);return 0};br.prototype.read=function(a,b,c,d){var +f=aj(a+d),g=this.data;this.data=f;cf(g,0,this.data,0,e)}cf(lM(b),c,this.data,a,d);return 0};br.prototype.read=function(a,b,c,d){var e=this.length();if(a+d>=e)d=e-a;if(d){var -f=am(d|0);b$(this.data,a,f,0,d);b.set(f_(f),c)}return d};function -d2(a,b,c){this.file=b;this.name=a;this.flags=c}d2.prototype.err_closed=function(){F(this.name+to)};d2.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()};d2.prototype.write=function(a,b,c,d){if(this.file)return this.file.write(a,b,c,d);this.err_closed()};d2.prototype.read=function(a,b,c,d){if(this.file)return this.file.read(a,b,c,d);this.err_closed()};d2.prototype.close=function(){this.file=undefined};function +f=aj(d|0);cf(this.data,a,f,0,d);b.set(gi(f),c)}return d};function +d$(a,b,c){this.file=b;this.name=a;this.flags=c}d$.prototype.err_closed=function(){G(this.name+t3)};d$.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()};d$.prototype.write=function(a,b,c,d){if(this.file)return this.file.write(a,b,c,d);this.err_closed()};d$.prototype.read=function(a,b,c,d){if(this.file)return this.file.read(a,b,c,d);this.err_closed()};d$.prototype.close=function(){this.file=undefined};function a0(a,b){this.content={};this.root=a;this.lookupFun=b}a0.prototype.nm=function(a){return this.root+a};a0.prototype.create_dir_if_needed=function(a){var -d=a.split(cn),c=e;for(var -b=0;b=0)}function -lv(a,b){var +a=0;a=0)}function +lR(a,b){var e=b.length,c,d;for(c=0;c+4<=e;c+=4){d=b.charCodeAt(c)|b.charCodeAt(c+1)<<8|b.charCodeAt(c+2)<<16|b.charCodeAt(c+3)<<24;a=bl(a,d)}d=0;switch(e&3){case 3:d=b.charCodeAt(c+2)<<16;case 2:d|=b.charCodeAt(c+1)<<8;case 1:d|=b.charCodeAt(c);a=bl(a,d)}a^=e;return a}function -Tt(a,b){return lv(a,cp(b))}function -Tq(a,b){var +Uw(a,b){return lR(a,cx(b))}function +Ut(a,b){var e=b.length,c,d;for(c=0;c+4<=e;c+=4){d=b[c]|b[c+1]<<8|b[c+2]<<16|b[c+3]<<24;a=bl(a,d)}d=0;switch(e&3){case 3:d=b[c+2]<<16;case 2:d|=b[c+1]<<8;case 1:d|=b[c];a=bl(a,d)}a^=e;return a}function -TQ(a){switch(a.t&6){default:f1(a);case +UW(a){switch(a.t&6){default:f$(a);case 0:return a.c;case 4:return a.c}}function -Tp(a,b){var -c=TQ(b);return typeof -c==="string"?lv(a,c):Tq(a,c)}function -Tr(a){a^=a>>>16;a=f7(a,0x85ebca6b|0);a^=a>>>13;a=f7(a,0xc2b2ae35|0);a^=a>>>16;return a}function -uK(a,b,c,d){var -j,k,l,h,g,f,e,i,m;h=b;if(h<0||h>cw)h=cw;g=a;f=c;j=[d];k=0;l=1;while(k0){e=j[k++];if(e&&e.caml_custom){if(f3[e.caml_custom]&&f3[e.caml_custom].hash){var -n=f3[e.caml_custom].hash(e);f=bl(f,n);g--}}else if(e +Us(a,b){var +c=UW(b);return typeof +c==="string"?lR(a,c):Ut(a,c)}function +Uu(a){a^=a>>>16;a=gg(a,0x85ebca6b|0);a^=a>>>13;a=gg(a,0xc2b2ae35|0);a^=a>>>16;return a}function +vp(a,b,c,d){var +j,k,l,h,g,f,e,i,m;h=b;if(h<0||h>cG)h=cG;g=a;f=c;j=[d];k=0;l=1;while(k0){e=j[k++];if(e&&e.caml_custom){if(gb[e.caml_custom]&&gb[e.caml_custom].hash){var +n=gb[e.caml_custom].hash(e);f=bl(f,n);g--}}else if(e instanceof Array&&e[0]===(e[0]|0))switch(e[0]){case 248:f=bl(f,e[2]);g--;break;case -250:j[--k]=e[1];break;default:if(uP(e[0]))break;var -o=e.length-1<<10|e[0];f=bl(f,o);for(i=1,m=e.length;i=h)break;j[l++]=e[i]}break}else if(ik(e)){f=Tp(f,e);g--}else if(il(e)){f=Tt(f,e);g--}else if(typeof -e==="string"){f=lv(f,e);g--}else if(e===(e|0)){f=bl(f,e+e+1);g--}else if(typeof -e==="number"){f=lu(f,e);g--}}f=Tr(f);return f&0x3FFFFFFF}function -Tu(a,b,c){if(!isFinite(a)){if(isNaN(a))return bH(ko);return bH(a>0?sG:"-infinity")}var +250:j[--k]=e[1];break;default:if(vx(e[0]))break;var +o=e.length-1<<10|e[0];f=bl(f,o);for(i=1,m=e.length;i=h)break;j[l++]=e[i]}break}else if(iw(e)){f=Us(f,e);g--}else if(ix(e)){f=Uw(f,e);g--}else if(typeof +e==="string"){f=lR(f,e);g--}else if(e===(e|0)){f=bl(f,e+e+1);g--}else if(typeof +e==="number"){f=lQ(f,e);g--}}f=Uu(f);return f&0x3FFFFFFF}function +Ux(a,b,c){if(!isFinite(a)){if(isNaN(a))return bI(kJ);return bI(a>0?ti:"-infinity")}var k=a==0&&1/a==-Infinity?1:a>=0?0:1;if(k)a=-a;var f=0;if(a==0);else if(a<1)while(a<1&&f>-1022){a*=2;f--}else while(a>=2){a/=2;f++}var -l=f<0?e:eR,g=e;if(k)g=cm;else +l=f<0?e:e3,g=e;if(k)g=ct;else switch(c){case -43:g=eR;break;case -32:g=bF;break;default:break}if(b>=0&&b<13){var +43:g=e3;break;case +32:g=bG;break;default:break}if(b>=0&&b<13){var i=Math.pow(2,b*4);a=Math.round(a*i)/i}var d=a.toString(16);if(b>=0){var -j=d.indexOf(dq);if(j<0)d+=dq+eZ(b,bD);else{var -h=j+1+b;if(d.length>24&cS,a>>31&cy)}function -TF(a){return a.toInt()}function -TB(a){return+a.isNeg()}function -TE(a){return a.neg()}function -Tz(a,b){var -c=lE(a);if(c.signedconv&&TB(b)){c.sign=-1;b=TE(b)}var -d=e,i=ij(c.base),h="0123456789abcdef";do{var -g=b.udivmod(i);b=g.quotient;d=h.charAt(TF(g.modulus))+d}while(!TC(b));if(c.prec>=0){c.filler=bF;var -f=c.prec-d.length;if(f>0)d=eZ(f,bD)+d}return ls(c,d)}function -uM(a,b){return a.or(b)}function -uN(a,b){return a.shift_left(b)}function -lA(a,b){return a.shift_right_unsigned(b)}function -T1(a){var -b=0,e=p(a),c=10,d=1;if(e>0)switch(bw(a,b)){case +j=d.indexOf(dv);if(j<0)d+=dv+e_(b,bF);else{var +h=j+1+b;if(d.length>24&cF,a>>31&cv)}function +lW(a){return a.toInt()}function +UE(a){return+a.isNeg()}function +vs(a){return a.neg()}function +UC(a,b){var +c=l3(a);if(c.signedconv&&UE(b)){c.sign=-1;b=vs(b)}var +d=e,i=ge(c.base),h="0123456789abcdef";do{var +g=b.udivmod(i);b=g.quotient;d=h.charAt(lW(g.modulus))+d}while(!UF(b));if(c.prec>=0){c.filler=bG;var +f=c.prec-d.length;if(f>0)d=e_(f,bF)+d}return lO(c,d)}function +vv(a,b){return a.or(b)}function +vG(a){var +b=0,e=p(a),c=10,d=1;if(e>0)switch(bt(a,b)){case 45:b++;d=-1;break;case -43:b++;d=1;break}if(b+10)switch(bw(a,b)){case 66:c=2;b+=2;break;case 117:case 85:b+=2;break}return[b,d,c]}function -uX(a){if(a>=48&&a<=57)return a-48;if(a>=65&&a<=90)return a-55;if(a>=97&&a<=122)return a-87;return-1}function -uO(a){var -h=T1(a),d=h[0],i=h[1],e=h[2],g=p(a),j=-1>>>0,f=d=e)bG(hX);var -b=c;for(d++;d=e)break;b=e*b+c;if(b>j)bG(hX)}if(d!=g)bG(hX);b=i*b;if(e==10&&(b|0)!=b)bG(hX);return b|0}function -dv(a,b,c){return a[O(b)].apply(a,eX(c))}function -TI(a,b){switch(b.length){case +iz(a){if(a>=48&&a<=57)return a-48;if(a>=65&&a<=90)return a-55;if(a>=97&&a<=122)return a-87;return-1}function +vw(a){var +h=vG(a),d=h[0],i=h[1],e=h[2],g=p(a),j=-1>>>0,f=d=e)a1(cZ);var +b=c;for(d++;d=e)break;b=e*b+c;if(b>j)a1(cZ)}if(d!=g)a1(cZ);b=i*b;if(e==10&&(b|0)!=b)a1(cZ);return b|0}function +dD(a,b,c){return a[O(b)].apply(a,e8(c))}function +UM(a,b){switch(b.length){case 1:return new a;case 2:return new @@ -727,54 +740,84 @@ a(b[1],b[2],b[3],b[4],b[5]);case a(b[1],b[2],b[3],b[4],b[5],b[6]);case 8:return new a(b[1],b[2],b[3],b[4],b[5],b[6],b[7])}function -c(){return a.apply(this,eX(b))}c.prototype=a.prototype;return new +c(){return a.apply(this,e8(b))}c.prototype=a.prototype;return new c}function -uQ(a){var +vy(a){var c={};for(var b=1;b>>0&&l2(a,d4,dx)?0:1}function +vz(a){l2(a,dx,c0);return 0}function +UQ(a,b){return+(e6(a,b,false)<=0)}function +UR(a,b){return+(e6(a,b,false)<0)}function +gf(a){a=cx(a);var d=a.length/2,c=new Array(d);for(var b=0;b>16;return c}function -uR(a,b,c){var -o=2,p=3,s=5,e=6,i=7,h=8,k=9,n=1,m=2,r=3,t=4,q=5;if(!a.lex_default){a.lex_base=f6(a[n]);a.lex_backtrk=f6(a[m]);a.lex_check=f6(a[q]);a.lex_trans=f6(a[t]);a.lex_default=f6(a[r])}var -f,d=b,l=f_(c[o]);if(d>=0){c[i]=c[s]=c[e];c[h]=-1}else +vA(a,b,c){var +o=2,p=3,s=5,e=6,i=7,h=8,k=9,n=1,m=2,r=3,t=4,q=5;if(!a.lex_default){a.lex_base=gf(a[n]);a.lex_backtrk=gf(a[m]);a.lex_check=gf(a[q]);a.lex_trans=gf(a[t]);a.lex_default=gf(a[r])}var +f,d=b,l=gi(c[o]);if(d>=0){c[i]=c[s]=c[e];c[h]=-1}else d=-d-1;for(;;){var g=a.lex_base[d];if(g<0)return-g-1;var j=a.lex_backtrk[d];if(j>=0){c[i]=c[e];c[h]=j}if(c[e]>=c[p])if(c[k]==0)return-d-1;else -f=cw;else{f=l[c[e]];c[e]++}if(a.lex_check[g+f]==d)d=a.lex_trans[g+f];else -d=a.lex_default[d];if(d<0){c[e]=c[i];if(c[h]==-1)bG("lexing: empty token");else -return c[h]}else if(f==cw)c[k]=0}}function -im(a){var +f=cG;else{f=l[c[e]];c[e]++}if(a.lex_check[g+f]==d)d=a.lex_trans[g+f];else +d=a.lex_default[d];if(d<0){c[e]=c[i];if(c[h]==-1)a1("lexing: empty token");else +return c[h]}else if(f==cG)c[k]=0}}function +iy(a){var c=0;for(var b=a.length-1;b>=0;b--){var d=a[b];c=[0,d,c]}return c}function -TM(a){var +US(a){var b=[];for(;a!==0;a=a[2])b.push(a[1]);return b}function -cz(a,b){if(a<0)d3();var +vF(a){return bH(a)}function +vq(a,b){return a.add(b)}function +vr(a,b){return a.mul(b)}function +lX(a,b){return a.ucompare(b)<0}function +vt(a){var +g=vG(a),f=g[0],i=g[1],d=g[2],h=ge(d),j=new +u(cF,0xfffffff,cv).udivmod(h).quotient,e=bt(a,f),b=iz(e);if(b<0||b>=d)a1(cZ);var +c=ge(b);for(;;){f++;e=bt(a,f);if(e==95)continue;b=iz(e);if(b<0||b>=d)break;if(lX(j,c))a1(cZ);b=ge(b);c=vq(vr(h,c),b);if(lX(c,b))a1(cZ)}if(f!=p(a))a1(cZ);if(d==10&&lX(new +u(0,0,cs),c))a1(cZ);if(i<0)c=vs(c);return c}function +UK(a,b){return a.xor(b)}function +UI(a,b){return a.shift_right_unsigned(b)}function +UH(a,b){return a.shift_left(b)}function +lZ(a){function +o(a,b){return UH(a,b)}function +h(a,b){return UI(a,b)}function +s(a,b){return vv(a,b)}function +f(a,b){return UK(a,b)}function +k(a,b){return vq(a,b)}function +i(a,b){return vr(a,b)}function +m(a,b){return s(o(a,b),h(a,64-b))}function +g(a,b){return vc(a,b)}function +j(a,b,c){return f9(a,b,c)}var +q=vt(vF("0xd1342543de82ef95")),l=vt(vF("0xdaba0b6eb09322e3")),b,d,c,e=a,r=g(e,0),n=g(e,1),p=g(e,2),t=g(e,3);b=k(n,p);b=i(f(b,h(b,32)),l);b=i(f(b,h(b,32)),l);b=f(b,h(b,32));j(e,1,k(i(n,q),r));var +d=p,c=t;c=f(c,d);d=m(d,24);d=f(f(d,c),o(c,16));c=m(c,37);j(e,2,d);j(e,3,c);return b}function +cy(a,b){if(a<0)ea();var a=a+1|0,c=new Array(a);c[0]=0;for(var d=1;d>>32-e,c)}function g(a,b,c,d,e,f,g){return l(b&c|~b&d,a,b,e,f,g)}function @@ -782,53 +825,53 @@ h(a,b,c,d,e,f,g){return l(b&d|c&~d,a,b,e,f,g)}function i(a,b,c,d,e,f,g){return l(b^c^d,a,b,e,f,g)}function j(a,b,c,d,e,f,g){return l(c^(b|~d),a,b,e,f,g)}return function(a,b){var c=a[0],d=a[1],e=a[2],f=a[3];c=g(c,d,e,f,b[0],7,0xD76AA478);f=g(f,c,d,e,b[1],12,0xE8C7B756);e=g(e,f,c,d,b[2],17,0x242070DB);d=g(d,e,f,c,b[3],22,0xC1BDCEEE);c=g(c,d,e,f,b[4],7,0xF57C0FAF);f=g(f,c,d,e,b[5],12,0x4787C62A);e=g(e,f,c,d,b[6],17,0xA8304613);d=g(d,e,f,c,b[7],22,0xFD469501);c=g(c,d,e,f,b[8],7,0x698098D8);f=g(f,c,d,e,b[9],12,0x8B44F7AF);e=g(e,f,c,d,b[10],17,0xFFFF5BB1);d=g(d,e,f,c,b[11],22,0x895CD7BE);c=g(c,d,e,f,b[12],7,0x6B901122);f=g(f,c,d,e,b[13],12,0xFD987193);e=g(e,f,c,d,b[14],17,0xA679438E);d=g(d,e,f,c,b[15],22,0x49B40821);c=h(c,d,e,f,b[1],5,0xF61E2562);f=h(f,c,d,e,b[6],9,0xC040B340);e=h(e,f,c,d,b[11],14,0x265E5A51);d=h(d,e,f,c,b[0],20,0xE9B6C7AA);c=h(c,d,e,f,b[5],5,0xD62F105D);f=h(f,c,d,e,b[10],9,0x02441453);e=h(e,f,c,d,b[15],14,0xD8A1E681);d=h(d,e,f,c,b[4],20,0xE7D3FBC8);c=h(c,d,e,f,b[9],5,0x21E1CDE6);f=h(f,c,d,e,b[14],9,0xC33707D6);e=h(e,f,c,d,b[3],14,0xF4D50D87);d=h(d,e,f,c,b[8],20,0x455A14ED);c=h(c,d,e,f,b[13],5,0xA9E3E905);f=h(f,c,d,e,b[2],9,0xFCEFA3F8);e=h(e,f,c,d,b[7],14,0x676F02D9);d=h(d,e,f,c,b[12],20,0x8D2A4C8A);c=i(c,d,e,f,b[5],4,0xFFFA3942);f=i(f,c,d,e,b[8],11,0x8771F681);e=i(e,f,c,d,b[11],16,0x6D9D6122);d=i(d,e,f,c,b[14],23,0xFDE5380C);c=i(c,d,e,f,b[1],4,0xA4BEEA44);f=i(f,c,d,e,b[4],11,0x4BDECFA9);e=i(e,f,c,d,b[7],16,0xF6BB4B60);d=i(d,e,f,c,b[10],23,0xBEBFBC70);c=i(c,d,e,f,b[13],4,0x289B7EC6);f=i(f,c,d,e,b[0],11,0xEAA127FA);e=i(e,f,c,d,b[3],16,0xD4EF3085);d=i(d,e,f,c,b[6],23,0x04881D05);c=i(c,d,e,f,b[9],4,0xD9D4D039);f=i(f,c,d,e,b[12],11,0xE6DB99E5);e=i(e,f,c,d,b[15],16,0x1FA27CF8);d=i(d,e,f,c,b[2],23,0xC4AC5665);c=j(c,d,e,f,b[0],6,0xF4292244);f=j(f,c,d,e,b[7],10,0x432AFF97);e=j(e,f,c,d,b[14],15,0xAB9423A7);d=j(d,e,f,c,b[5],21,0xFC93A039);c=j(c,d,e,f,b[12],6,0x655B59C3);f=j(f,c,d,e,b[3],10,0x8F0CCC92);e=j(e,f,c,d,b[10],15,0xFFEFF47D);d=j(d,e,f,c,b[1],21,0x85845DD1);c=j(c,d,e,f,b[8],6,0x6FA87E4F);f=j(f,c,d,e,b[15],10,0xFE2CE6E0);e=j(e,f,c,d,b[6],15,0xA3014314);d=j(d,e,f,c,b[13],21,0x4E0811A1);c=j(c,d,e,f,b[4],6,0xF7537E82);f=j(f,c,d,e,b[11],10,0xBD3AF235);e=j(e,f,c,d,b[2],15,0x2AD7D2BB);d=j(d,e,f,c,b[9],21,0xEB86D391);a[0]=k(c,a[0]);a[1]=k(d,a[1]);a[2]=k(e,a[2]);a[3]=k(f,a[3])}}();function -S6(a,b,c){var -e=a.len&dk,d=0;a.len+=c;if(e){var -f=64-e;if(c=64){a.b8.set(b.subarray(d,d+64),0);ic(a.w,a.b32);c-=64;d+=64}if(c)a.b8.set(b.subarray(d,d+c),0)}function -S4(a){var -c=a.len&dk;a.b8[c]=b7;c++;if(c>56){for(var -b=c;b<64;b++)a.b8[b]=0;ic(a.w,a.b32);for(var +T6(a,b,c){var +e=a.len&dq,d=0;a.len+=c;if(e){var +f=64-e;if(c=64){a.b8.set(b.subarray(d,d+64),0);io(a.w,a.b32);c-=64;d+=64}if(c)a.b8.set(b.subarray(d,d+c),0)}function +T4(a){var +c=a.len&dq;a.b8[c]=cb;c++;if(c>56){for(var +b=c;b<64;b++)a.b8[b]=0;io(a.w,a.b32);for(var b=0;b<56;b++)a.b8[b]=0}else for(var -b=c;b<56;b++)a.b8[b]=0;a.b32[14]=a.len<<3;a.b32[15]=a.len>>29&0x1FFFFFFF;ic(a.w,a.b32);var +b=c;b<56;b++)a.b8[b]=0;a.b32[14]=a.len<<3;a.b32[15]=a.len>>29&0x1FFFFFFF;io(a.w,a.b32);var e=new Uint8Array(16);for(var d=0;d<4;d++)for(var b=0;b<4;b++)e[d*4+b]=a.w[d]>>8*b&0xFF;return e}function -T7(a){return bX(f9(a,0,a.length))}function -TO(a,b,c){var -d=S5(),e=f_(a);S6(d,e.subarray(b,b+c),c);return T7(S4(d))}function -TP(a,b,c){return TO(du(a),b,c)}function -TR(){return 0}var -dw=new +Va(a){return bH(gh(a,0,a.length))}function +UU(a,b,c){var +d=T5(),e=gi(a);T6(d,e.subarray(b,b+c),c);return Va(T4(d))}function +UV(a,b,c){return UU(dA(a),b,c)}function +UX(){return 0}var +dE=new Array();function -lC(a){return dw[a]}function -d8(a){var -b=lC(a);if(!b.opened)F("Cannot flush a closed channel");if(!b.buffer||b.buffer_curr==0)return 0;if(b.output)b.output(f9(b.buffer,0,b.buffer_curr));else +l0(a){return dE[a]}function +ed(a){var +b=l0(a);if(!b.opened)G("Cannot flush a closed channel");if(!b.buffer||b.buffer_curr==0)return 0;if(b.output)b.output(gh(b.buffer,0,b.buffer_curr));else b.file.write(b.offset,b.buffer,0,b.buffer_curr);b.offset+=b.buffer_curr;b.buffer_curr=0;return 0}function -T4(a){if(a.refill!=null){var -e=a.refill(),b=u2(e);if(b.length==0)a.refill=null;else{if(a.buffer.length0){b.set(e.buffer.subarray(e.buffer_curr,e.buffer_curr+f),c);e.buffer_curr+=f;g=f}else{e.buffer_curr=0;e.buffer_max=0;T4(e);var +UZ(a,b,c,d){var +e=l0(a),g=d,f=e.buffer_max-e.buffer_curr;if(d<=f){b.set(e.buffer.subarray(e.buffer_curr,e.buffer_curr+d),c);e.buffer_curr+=d}else if(f>0){b.set(e.buffer.subarray(e.buffer_curr,e.buffer_curr+f),c);e.buffer_curr+=f;g=f}else{e.buffer_curr=0;e.buffer_max=0;U9(e);var f=e.buffer_max-e.buffer_curr;if(g>f)g=f;b.set(e.buffer.subarray(e.buffer_curr,e.buffer_curr+g),c);e.buffer_curr+=g}return g|0}function -TS(a,b,c,d){var -e=f_(b);return TT(a,e,c,d)}function -T9(a,b){if(b.name)try{var -d=require(kp),c=d.openSync(b.name,"rs");return new -co(c,b)}catch(f){}return new -co(a,b)}var -iq=new +UY(a,b,c,d){var +e=gi(b);return UZ(a,e,c,d)}function +Vc(a,b){if(b.name)try{var +d=require(kK),c=d.openSync(b.name,"rs");return new +cw(c,b)}catch(f){}return new +cw(a,b)}var +iC=new Array(3);function -fZ(a,b){br.call(this,am(0));this.log=function(a){return 0};if(a==1&&typeof +f8(a,b){br.call(this,aj(0));this.log=function(a){return 0};if(a==1&&typeof console.log=="function")this.log=console.log;else if(a==2&&typeof console.error=="function")this.log=console.error;else if(typeof -console.log=="function")this.log=console.log;this.flags=b}fZ.prototype.length=function(){return 0};fZ.prototype.write=function(a,b,c,d){if(this.log){if(d>0&&c>=0&&c+d<=b.length&&b[c+d-1]==10)d--;var -e=am(d);b$(lq(b),c,e,0,d);this.log(e.toUtf16());return 0}F(this.fd+to)};fZ.prototype.read=function(a,b,c,d){F(this.fd+": file descriptor is write only")};fZ.prototype.close=function(){this.log=undefined};function -ir(a,b){if(b==undefined)b=iq.length;iq[b]=a;return b|0}function -Ug(a,b,c){var +console.log=="function")this.log=console.log;this.flags=b}f8.prototype.length=function(){return 0};f8.prototype.write=function(a,b,c,d){if(this.log){if(d>0&&c>=0&&c+d<=b.length&&b[c+d-1]==10)d--;var +e=aj(d);cf(lM(b),c,e,0,d);this.log(e.toUtf16());return 0}G(this.fd+t3)};f8.prototype.read=function(a,b,c,d){G(this.fd+": file descriptor is write only")};f8.prototype.close=function(){this.log=undefined};function +iD(a,b){if(b==undefined)b=iC.length;iC[b]=a;return b|0}function +Vl(a,b,c){var d={};while(b){switch(b[1]){case 0:d.rdonly=1;break;case 1:d.wronly=1;break;case @@ -838,73 +881,72 @@ d={};while(b){switch(b[1]){case 5:d.excl=1;break;case 6:d.binary=1;break;case 7:d.text=1;break;case -8:d.nonblock=1;break}b=b[2]}if(d.rdonly&&d.wronly)F(cp(a)+kQ);if(d.text&&d.binary)F(cp(a)+la);var -e=u6(a),f=e.device.open(e.rest,d);return ir(f,undefined)}(function(){function -a(a,b){return f$()?T9(a,b):new -fZ(a,b)}ir(a(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:true}),0);ir(a(1,{buffered:2,wronly:1,isCharacterDevice:true}),1);ir(a(2,{buffered:2,wronly:1,isCharacterDevice:true}),2)}());function -TU(a){var -b=iq[a];if(b.flags.wronly)F(tJ+a+" is writeonly");var +8:d.nonblock=1;break}b=b[2]}if(d.rdonly&&d.wronly)G(cx(a)+la);if(d.text&&d.binary)G(cx(a)+lv);var +e=vP(a),f=e.device.open(e.rest,d);return iD(f,undefined)}(function(){function +a(a,b){return gj()?Vc(a,b):new +f8(a,b)}iD(a(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:true}),0);iD(a(1,{buffered:2,wronly:1,isCharacterDevice:true}),1);iD(a(2,{buffered:2,wronly:1,isCharacterDevice:true}),2)}());function +U0(a){var +b=iC[a];if(b.flags.wronly)G(um+a+" is writeonly");var d=null,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:false,buffer_curr:0,buffer_max:0,buffer:new -Uint8Array(eI),refill:d};dw[c.fd]=c;return c.fd}function -uS(a){var -b=iq[a];if(b.flags.rdonly)F(tJ+a+" is readonly");var +Uint8Array(eU),refill:d};dE[c.fd]=c;return c.fd}function +vB(a){var +b=iC[a];if(b.flags.rdonly)G(um+a+" is readonly");var d=b.flags.buffered!==undefined?b.flags.buffered:1,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:true,buffer_curr:0,buffer:new -Uint8Array(eI),buffered:d};dw[c.fd]=c;return c.fd}function -TV(){var +Uint8Array(eU),buffered:d};dE[c.fd]=c;return c.fd}function +U1(){var b=0;for(var -a=0;ae.buffer.length){var +a=0;ae.buffer.length){var g=new Uint8Array(e.buffer_curr+b.length);g.set(e.buffer);e.buffer=g}switch(e.buffered){case -0:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;d8(a);break;case -1:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)d8(a);break;case +0:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;ed(a);break;case +1:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)ed(a);break;case 2:var -f=b.lastIndexOf(10);if(f<0){e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)d8(a)}else{e.buffer.set(b.subarray(0,f+1),e.buffer_curr);e.buffer_curr+=f+1;d8(a);e.buffer.set(b.subarray(f+1),e.buffer_curr);e.buffer_curr+=b.length-f-1}break}return 0}function -TW(a,b,c,d){var -b=f_(b);return TX(a,b,c,d)}function -lD(a,b,c,d){return TW(a,du(b),c,d)}function -uT(a,b){var -c=bX(String.fromCharCode(b));lD(a,c,0,1);return 0}function -uU(a,b){if(b==0)lG();return a%b}function -uV(a){if(isFinite(a)){var +f=b.lastIndexOf(10);if(f<0){e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)ed(a)}else{e.buffer.set(b.subarray(0,f+1),e.buffer_curr);e.buffer_curr+=f+1;ed(a);e.buffer.set(b.subarray(f+1),e.buffer_curr);e.buffer_curr+=b.length-f-1}break}return 0}function +U2(a,b,c,d){var +b=gi(b);return U3(a,b,c,d)}function +l1(a,b,c,d){return U2(a,dA(b),c,d)}function +vC(a,b){var +c=bH(String.fromCharCode(b));l1(a,c,0,1);return 0}function +U4(a,b){if(b==0)l5();return a%b}function +vD(a){if(isFinite(a)){var d=1/a<0;a=Math.abs(a);var b=Math.floor(a),c=a-b;if(d){b=-b;c=-c}return[0,c,b]}if(isNaN(a))return[0,NaN,NaN];return[0,1/a,a]}function -f8(a,b){return+(eU(a,b,false)!=0)}function -TZ(a,b){a[0]=cu;a[1]=b;return 0}function -c2(a){if(a +ee(a,b){return+(e6(a,b,false)!=0)}function +dG(a){if(a instanceof -Array&&a[0]==a[0]>>>0)return a[0];else if(ik(a))return eN;else if(il(a))return eN;else if(a +Array&&a[0]==a[0]>>>0)return a[0];else if(iw(a))return eZ;else if(ix(a))return eZ;else if(a instanceof Function||typeof -a=="function")return 247;else if(a&&a.caml_custom)return dm;else -return fW}function -Te(a){var +a=="function")return 247;else if(a&&a.caml_custom)return ds;else +return f5}function +Uf(a){var c={};if(a)for(var b=1;b=0)a=e;else -bG("caml_register_global: cannot locate "+d)}}bk[a+1]=b;if(c)bk[c]=b}function -lI(a,b){uW[cp(a)]=b;return 0}function -T6(){aA(kU)}function -V(a,b){if(b>>>0>=p(a))T6();return bw(a,b)}function -ip(a){a.t&6&&f1(a);return bX(a.c)}function -T8(){return 0x7FFFFFFF/4|0}function -T2(){uY(bk.Not_found)}function -u0(a){var -b=u5(O(a));if(b===undefined)T2();return bH(b)}function -T_(){if(K.crypto)if(K.crypto.getRandomValues){var +a1("caml_register_global: cannot locate "+d)}}bk[a+1]=b;if(c)bk[c]=b}function +l7(a,b){vE[cx(a)]=b;return 0}function +U$(){as(ld)}function +ak(a,b){if(b>>>0>=p(a))U$();return bt(a,b)}function +iB(a){a.t&6&&f$(a);return bH(a.c)}function +Vb(){return 0x7FFFFFFF/4|0}function +U7(){vH(bk.Not_found)}function +vJ(a){var +b=vO(O(a));if(b===undefined)U7();return bI(b)}function +Vd(){if(K.crypto)if(K.crypto.getRandomValues){var a=K.crypto.getRandomValues(new Int32Array(4));return[0,a[0],a[1],a[2],a[3]]}else if(K.crypto.randomBytes){var a=new Int32Array(K.crypto.randomBytes(16).buffer);return[0,a[0],a[1],a[2],a[3]]}var b=new Date().getTime(),c=b^0xffffffff*Math.random();return[0,c]}function -bI(a){var +bJ(a){var b=1;while(a&&a.joo_tramp){a=a.joo_tramp.apply(null,a.joo_args);b++}return a}function l(a,b){return{joo_tramp:a,joo_args:b}}function -T$(a,b){if(b.fun){a.fun=b.fun;return 0}if(typeof +Ve(a,b){if(b.fun){a.fun=b.fun;return 0}if(typeof b==="function"){a.fun=b;return 0}var c=b.length;while(c--)a[c]=b[c];return 0}function P(a){{if(a @@ -916,58 +958,58 @@ K.RangeError&&a.message&&a.message.match(/maximum call stack/i))b=bk.Stack_overf instanceof K.InternalError&&a.message&&a.message.match(/too much recursion/i))b=bk.Stack_overflow;else if(a instanceof -K.Error&&dx(ks))b=[0,dx(ks),a];else -b=[0,bk.Failure,bH(String(a))];if(a +K.Error&&dF(kN))b=[0,dF(kN),a];else +b=[0,bk.Failure,bI(String(a))];if(a instanceof K.Error)b.js_error=a;return b}}function -TH(a){switch(a[2]){case-8:case-11:case-12:return 1;default:return 0}}function -Tl(a){var -b=e;if(a[0]==0){b+=a[1][1];if(a.length==3&&a[2][0]==0&&TH(a[1]))var +UL(a){switch(a[2]){case-8:case-11:case-12:return 1;default:return 0}}function +Uo(a){var +b=e;if(a[0]==0){b+=a[1][1];if(a.length==3&&a[2][0]==0&&UL(a[1]))var f=a[2],g=1;else var g=2,f=a;b+="(";for(var -d=g;dg)b+=lc;var +d=g;dg)b+=lx;var c=f[d];if(typeof c=="number")b+=c.toString();else if(c instanceof -cY)b+=dr+c.toString()+dr;else if(typeof -c=="string")b+=dr+c.toString()+dr;else -b+=r2}b+=")"}else if(a[0]==B)b+=a[1];return b}function -uH(a){if(a +c6)b+=dw+c.toString()+dw;else if(typeof +c=="string")b+=dw+c.toString()+dw;else +b+=sC}b+=")"}else if(a[0]==B)b+=a[1];return b}function +vm(a){if(a instanceof Array&&(a[0]==0||a[0]==B)){var -c=dx(uf);if(c)ie(c,[a,false]);else{var -d=Tl(a),b=dx(rG);if(b)ie(b,[0]);console.error(k7+d);if(a.js_error)throw a.js_error}}else +c=dF(uT);if(c)ir(c,[a,false]);else{var +d=Uo(a),b=dF(sg);if(b)ir(b,[0]);console.error(lq+d);if(a.js_error)throw a.js_error}}else throw a}function -T5(){var -c=K.process;if(c&&c.on)c.on("uncaughtException",function(a,b){uH(a);c.exit(2)});else if(K.addEventListener)K.addEventListener(k_,function(a){if(a.error)uH(a.error)})}T5();function -h(a,b){return(a.l>=0?a.l:a.l=a.length)==1?a(b):c0(a,[b])}function -i(a,b,c){return(a.l>=0?a.l:a.l=a.length)==2?a(b,c):c0(a,[b,c])}function -a6(a,b,c,d){return(a.l>=0?a.l:a.l=a.length)==3?a(b,c,d):c0(a,[b,c,d])}function -fE(a,b,c,d,e){return(a.l>=0?a.l:a.l=a.length)==4?a(b,c,d,e):c0(a,[b,c,d,e])}function -eB(a,b,c,d,e,f){return(a.l>=0?a.l:a.l=a.length)==5?a(b,c,d,e,f):c0(a,[b,c,d,e,f])}function -S3(a,b,c,d,e,f,g,h){return(a.l>=0?a.l:a.l=a.length)==7?a(b,c,d,e,f,g,h):c0(a,[b,c,d,e,f,g,h])}var -Uf=undefined;Tm();var -iu=[B,ur,-1],lP=[B,sE,-2],dy=[B,ln,-3],lL=[B,ss,-4],a9=[B,tB,-7],lN=[B,uq,-8],lO=[B,sS,-9],f=[B,s1,-11],lQ=[B,ta,-12],iD=[0,e,0,0,-1],l$=[0,e,1,0,0],SR=[4,0,0,0,[12,45,[4,0,0,0,0]]],iP=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,sc,[4,0,0,0,[12,45,[4,0,0,0,[11,hM,[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],n7=[0,0],SS=[17,[0,a,1,0],[11,qA,[17,0,0]]],ST=[17,[0,a,1,0],[12,40,0]],SU=[11,"('\"'",[17,[0,a,1,0],[11,dp,[17,[0,a,1,0],[11,p0,[17,0,0]]]]]],SV=[0,a,1,0],SW=[11,rC,[17,[0,a,1,0],[11,dp,[17,[0,a,1,0],[11,p0,[17,0,0]]]]]],SX=[0,a,1,0],SY=[11,dp,[17,[0,a,1,0],[11,uo,[17,0,0]]]],SZ=[0,a,1,0],S0=[11,rC,[17,[0,a,1,0],[11,dp,[17,[0,a,1,0],[11,uo,[17,0,0]]]]]],S1=[0,a,1,0],S2=[17,[0,a,1,0],[12,40,[15,[12,41,[17,0,0]]]]],oO=[0,ah,[0,ck,-991563951]],oP=[0,ah,[0,ck,r$]],o2=im([9,10,11,12,13,32,lb,p5,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,rY,8233,8239,8287,12288]),bf=[0,"\0\0\xec\xff\xed\xff\x03\0\xef\xff\x10\0\xf2\xff\xf3\xff\xf4\xff\xf5\xff\0\0\x1f\0\xf9\xffU\0\x01\0\0\0\0\0\x01\0\0\0\x01\0\x02\0\xff\xff\0\0\0\0\x03\0\xfe\xff\x01\0\x04\0\xfd\xff\x0b\0\xfc\xff\x03\0\x01\0\x03\0\x02\0\x03\0\0\0\xfb\xff\x15\0a\0\n\0\x16\0\x14\0\x10\0\x16\0\f\0\b\0\xfa\xffw\0\x81\0\x8b\0\xa1\0\xab\0\xb5\0\xc1\0\xd1\0\xf0\xff\x0b\0&\0\xfc\xffA\0\xfe\xff\xff\xffn\0\xfc\xff\xa3\0\xfe\xff\xff\xff\xea\0\xf7\xff\xf8\xff0\x01\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xffG\x01~\x01\x95\x01\xf9\xff'\0\xfd\xff\xfe\xff&\0\xbb\x01\xd2\x01\xf8\x01\x0f\x02\xff\xff\xdc\0\xfd\xff\xff\xff\xf5\0'\x02m\x02\x0e\x01X\x02\xa4\x02\xbb\x02\xe1\x02\r\0\xfc\xff\xfd\xff\xfe\xff\xff\xff\x0e\0\xfd\xff\xfe\xff\xff\xff\x1e\0\xfd\xff\xfe\xff\xff\xff\x0f\0\xfd\xff\xfe\xff\xff\xff\x11\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\x13\0\xfc\xff\xfd\xff\xfe\xff\x0f\0\xff\xff\x10\0\xff\xff\b\x01\x05\0\xfd\xff\x17\0\xfe\xff\x14\0\xff\xff.\0\xfd\xff\xfe\xff*\x004\x005\0\xff\xff5\x000\0[\0\\\0\xff\xff\x1b\x01\xfa\xff\xfb\xff\x89\0h\0Y\0X\0j\0\xff\xff\x8f\0\x89\0\xb1\0\xfe\xff\xb7\0\xa8\0\xa6\0\xb7\0\x02\0\xfd\xff\xb1\0\xac\0\xbb\0\x04\0\xfc\xff5\x02\xfb\xff\xfc\xff\xfd\xffg\x01\xff\xff\xf8\x02\xfe\xff\x06\x03\x1e\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff(\x032\x03J\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff=\x03T\x03l\x03\xf9\xff\xfa\xff\xfb\xff\xf4\0x\x03\x8e\x03\xb3\0\xc2\0\x0f\0\xff\xff\xbe\0\xbc\0\xbb\0\xc1\0\xb7\0\xb3\0\xfe\xff\xbf\0\xc9\0\xc8\0\xc4\0\xcb\0\xc1\0\xbd\0\xfd\xff\x9d\x03_\x03\xae\x03\xc4\x03\xce\x03\xd8\x03\xe4\x03\xef\x03<\0\xfd\xff\xfe\xff\xff\xff\f\x04\xfc\xff\xfd\xffW\x04\xff\xff\x91\x04\xfc\xff\xfd\xff\xdd\x04\xff\xff\xe5\0\xfd\xff\xfe\xff\xff\xff\xe7\0\xfd\xff\xfe\xff\xff\xff\x02\0\xff\xff\x12\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\"\x01\xfd\xff\xfe\xff\xff\xff\0\0\xff\xff\x03\0\xfe\xff\xff\xff&\x01\xfc\xff\xfd\xff\xfe\xff\xff\xffx\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\xd0\0\xfd\xff\xfe\xff\xff\xff\xd3\0\xfd\xff\xfe\xff\xff\xff\xbd\0\xff\xff\x8f\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\r\x01\xfd\xff\xfe\xff\xff\xff_\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff2\x01\xfd\xff\xfe\xff\xff\xff\x1a\x01\xfd\xff\xfe\xff\xff\xff\xe9\0\xfd\xff\xfe\xff\xff\xff\xde\0\xfd\xff\xfe\xff\xff\xffO\x05\xed\xff\xee\xff\n\0\xf0\xff,\x01\xf3\xff\xf4\xff\xf5\xff\xf6\xff=\x01\x02\x04\xf9\xff-\x05\xd1\0\xe4\0\xd3\0\xe8\0\xe1\0\xdf\0\xf0\0\xff\xff\xeb\0\xea\0\b\x01\xfe\xff\x04\x01\x17\x01\xfd\xff6\x01\xfc\xff\x1f\x01\x1d\x01 \x01'\x011\x01-\x01\xfb\xff9\x01R\x01P\x01N\x01T\x01J\x01V\x01\xfa\xffn\x05\f\x04{\x05\x9b\x05\xa5\x05\xb1\x05\xbb\x05\xc5\x05\xf1\xff\xc7\x01M\x02\xfd\xff\xff\xff\x9a\x02\xde\x05\xd1\x05\x9b\x02\xef\x055\x06L\x06r\x06\x10\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x98\x06\xfc\xff\xfd\xff\xe3\x06\xff\xffU\x07\xf4\xff\xf5\xff\x0b\0\xf7\xffL\x02\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\x1f\x02\xf3\x053\x07d\x01s\x01h\x01\x85\x01v\x01\x9a\x01\xab\x01\xff\xff\xad\x01\xb0\x01\xbf\x01\xb9\x01\xbb\x01\xfd\x01\xe6\x01\xe6\x01\xea\x01\xf7\x01\xed\x01\xea\x01\t\x02\x13\x02\x13\x02\x0f\x02\x15\x02\x0b\x02\x07\x02\x8e\x06\x98\x06t\x07\xaa\x07\xb4\x07\xbe\x07\xc8\x07\xd2\x07\xf8\xffx\x02\xa7\x02\xfd\xff\xff\xff\xd8\x02R\x07\xdc\x07\xec\x02\xf4\x07:\bQ\bw\bL\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x9d\b\xfc\xff\xfd\xff\xe8\b\xff\xff\x87\x02x\x02\xfd\xffd\x02\xfe\xff\xb6\x02\xff\xff\x0b\x02\xff\xff\xcc\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff.\x02\xff\xff\xb2\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x17\0\xff\xff\xb7\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\xbb\x02\xfd\xff\xfe\xff\xff\xffy\x02\xfd\xff\xfe\xff\xff\xff\xb8\x02\xfc\xff\xfd\xff\xfe\xff\x13\0\xff\xff","\xff\xff\xff\xff\xff\xff\x11\0\xff\xff\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x13\0\x13\0\x13\0\x13\0\x13\0\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\t\0\xff\xff\t\0\xff\xff\xff\xff\x0e\0\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x04\0\x04\0\x04\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\0\0\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\x03\0\x05\0\x05\0\x05\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x03\0\xff\xff\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x10\0\xff\xff\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x12\0\x12\0\x12\0\x12\0\x12\0\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\xff\xff\b\0\xff\xff\b\0\xff\xff\xff\xff\r\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\x06\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff","\x01\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\x009\0<\0\0\0<\0\0\0\0\0A\0\0\0A\0\0\0\0\0F\0\0\0\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0T\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0^\0\0\0\0\0a\0\xff\xff\xff\xffa\0\xff\xff\xff\xff\xff\xff\xff\xffh\0\0\0\0\0\0\0\0\0m\0\0\0\0\0\0\0q\0\0\0\0\0\0\0u\0\0\0\0\0\0\0y\0\0\0\0\0\0\0\0\0\0\0~\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\x8a\0\0\0\x8e\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x9a\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xb2\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xbb\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc2\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc9\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xeb\0\0\0\0\0\0\0\xef\0\0\0\0\0\xff\xff\0\0\xf4\0\0\0\0\0\xff\xff\0\0\xf9\0\0\0\0\0\0\0\xfd\0\0\0\0\0\0\0\xff\xff\0\0\x03\x01\0\0\0\0\0\0\0\0\b\x01\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\x11\x01\0\0\0\0\0\0\0\0\x16\x01\0\0\0\0\0\0\0\0\0\0\x1c\x01\0\0\0\0\0\0 \x01\0\0\0\0\0\0\xff\xff\0\0&\x01\0\0\0\0\0\0\0\0+\x01\0\0\0\0\0\0/\x01\0\0\0\0\0\0\0\x004\x01\0\0\0\0\0\x008\x01\0\0\0\0\0\0<\x01\0\0\0\0\0\0@\x01\0\0\0\0\0\0C\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0y\x01}\x01\0\0\0\0\x80\x01\xff\xff\xff\xff\x80\x01\xff\xff\xff\xff\xff\xff\xff\xff\x87\x01\0\0\0\0\0\0\0\0\x8c\x01\0\0\0\0\xff\xff\0\0\x90\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xc1\x01\xc5\x01\0\0\0\0\xc8\x01\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcf\x01\0\0\0\0\0\0\0\0\xd4\x01\0\0\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xdc\x01\0\0\xff\xff\0\0\xe2\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xe9\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xf0\x01\0\0\0\0\0\0\0\0\xf5\x01\0\0\0\0\0\0\xf9\x01\0\0\0\0\0\0\xfc\x01\0\0\0\0\0\0\xff\xff\0\0","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x03\0\x04\0\0\0\x03\0\x03\0\x86\0\0\0\x03\0\0\0\x86\0E\x01\x92\x01\xff\xff\0\0E\x01\x92\x01\0\0\0\0\0\0\0\0\x7f\0\x8b\0\0\0\x03\0\0\0\f\0\x03\0\xaa\0\x86\0\xaf\0\0\0\x07\0\x0b\x01E\x01\x92\x01\x0e\x01\r\x001\0\x05\0\n\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\x008\0v\0\x06\0\x81\0\x82\x009\0\xed\x01\x89\0\0\x021\0\0\x000\0\x8a\0j\0>\0\x0e\0n\0i\0\0\x001\0\x0f\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1e\x000\0\b\0r\0\xd1\0\xec\0\0\x01\r\x01\x1d\0\x16\0\xff\xff0\x000\0\x11\0\x15\0\x19\0 \0!\0#\0\x17\0\x1b\0\x10\0\x1f\0\x1c\0\"\0\x13\0\x18\0\x12\0\x1a\0\x14\0$\0)\0%\x000\0\t\0*\0+\0,\0-\0.\0/\0=\0U\x000\0&\0'\0'\0'\0'\0'\0'\0'\0'\0'\x001\0C\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0V\0\x8f\0\xff\xff(\0\x90\0\x91\0\x92\x007\0\x94\x007\0\x95\x000\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0\xff\xff0\0\x96\0\x97\0\xa1\0B\0\x9e\x005\0\x9f\x005\0\xa0\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\0\xa5\x003\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa2\0\xa3\0\xa6\0]\0\xff\xff\x02\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xff\xffM\0g\0l\0t\0\x84\0\x86\0\x87\0\x80\0\x8b\0\x86\0\xa4\0]\0\xab\0M\0\xa7\0\xa8\0\xa9\0\xac\0p\0\xad\0\xae\0\xd2\0\xe2\0\xd0\0\xd3\0\xd4\0;\0S\0\x86\0\xd5\0\xd6\0\xd7\0\xd8\0\xda\0\x8d\0\xdb\0]\0\xdc\0\xdd\0{\0\xde\0\xdf\0\xe0\0\x88\0_\0\xe1\0#\x01A\x01\xea\0\x9b\0\x05\x01a\x01\xfa\0\xff\xff\xfe\x009\x01=\x01_\x01M\0,\x01\\\x01X\x01\t\x01\x1d\x01L\0|\0!\x01\x12\x01K\0b\0\x13\x01U\x01V\x01W\x01x\x01Y\x01J\0\xe1\x005\x01y\x01I\0Z\x01H\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0b\0q\x01z\0[\x01@\0\x04\x01]\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0\x9c\0p\x01^\x01`\x01b\x01c\x011\x01O\0O\0O\0O\0O\0O\0d\x01\x9d\0e\x01N\0N\0N\0N\0N\0N\0\xb7\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\x18\x01p\x01\xff\xff\x19\x01f\x01g\x01i\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0j\x01k\x010\x01(\x01l\x01m\x01n\x01P\0P\0P\0P\0P\0P\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0o\x01\x1b\x01\xff\xff\xab\x01\x1f\x01\xaa\x01\x17\x01Q\0Q\0Q\0Q\0Q\0Q\0\\\0\xa8\x01?\x01P\0P\0P\0P\0P\0P\0\xf8\0\xa5\x01\xfc\0\xa2\x01;\x01E\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0\xff\xffQ\0Q\0Q\0Q\0Q\0Q\0W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0X\0X\0X\0X\0'\x01*\x01\xff\xff\xa3\x01\xa4\x01x\0\x02\x01X\0X\0X\0X\0X\0X\0\xa6\x017\x01\x99\0W\0W\0W\0W\0W\0W\0\x07\x01\xa7\x01\xa4\x01\xa9\x01\x10\x01\xa4\x01Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\x003\x01X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0a\0\x89\x01\xa4\x01\xac\x01\xb9\x01\x88\x01\xad\x01Z\0Z\0Z\0Z\0Z\0Z\0a\0\xb3\0\xae\x01Y\0Y\0Y\0Y\0Y\0Y\0.\x01\xaf\x01\xb0\x01\xb4\0\xa4\x01\xb8\x01\xb5\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0|\x01Z\0Z\0Z\0Z\0Z\0Z\0\xc0\x01\xb2\x01\x15\x01\xb3\x01a\0\xc1\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xa4\x01\xd8\x01\xff\xffa\0\xb8\x01\xd8\x01\xd1\x01a\0\xdf\x01a\0\xd0\x01\xe6\x01\0\0a\0\xdb\x01%\x01\xd8\x01\xd9\x01\0\0\xdc\x01\xd8\x01a\0\0\0\0\0\xd8\x01a\0\0\0a\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xd8\x01\0\0~\x01\0\0\0\0\0\0\0\0c\0c\0c\0c\0c\0c\0a\0\0\0\xda\x01\xfa\x01\0\0\0\0a\0\0\0|\x01|\x01a\0\0\0\xdd\x01\0\0\xfd\x01\0\0\0\0\0\0a\0\xff\xff\0\0\xc4\x01a\0\0\0a\0`\0c\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xeb\x01\0\0\xf1\x01\0\0\xff\x01\xf2\x01\0\0d\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xf6\x01\x81\x01\x81\x01\xe4\x01\0\0\xc4\x01\0\0e\0e\0e\0e\0e\0e\0\0\0\xc6\x01\0\0d\0d\0d\0d\0d\0d\0\0\0\0\0\0\0\xc4\x01\xea\x01\x86\x01a\0a\0a\0a\0a\0a\0a\0a\0a\0a\0\0\0e\0e\0e\0e\0e\0e\0a\0a\0a\0a\0a\0a\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\0\0\0\0\xc9\x01\xb1\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xbc\0\0\0a\0a\0a\0a\0a\0a\0\xc9\x01\xe3\x01\0\0\xbf\0\xce\x01{\x01\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xc3\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc6\0\xff\xff\xf8\x01\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xca\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xcd\0\xff\xff\xff\xff\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe2\0\xc3\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\x01\0\0\0\0\xce\0\xdd\x01\xef\x01\xfe\x01\0\0\xcf\0\xf4\x01\0\0\xe1\0\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\0\0\0\xe8\0\0\0\xe1\x01\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xd9\0\xff\xff\0\0\0\0\0\0\0\0\xe1\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\0\0\0\0\0\0\0\0\xff\xff\0\0\0\0\xe6\0\0\0\xe6\0\0\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\0\0\xe4\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xba\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\0\0\0\0\0\0\0\0\0\0\xf1\0\0\0q\x01\0\0M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01\0\0p\x01\0\0\0\0\xc1\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0p\x01\0\0\0\0\0\0\xf0\0\xc8\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\xf6\0\0\0\0\0\xf0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xee\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0E\x01F\x01\0\0\0\0E\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0E\x01\0\0N\x01\0\0\0\0\0\0\0\0h\x01I\x01\0\0\0\0\0\0\0\0O\x01\0\0G\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0H\x01\0\0\0\0\0\0\0\0\0\0\xf3\0\0\0\0\0\0\0\0\0\0\0\0\0P\x01w\x01\0\0w\x01\0\0Q\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\0\0J\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01S\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0R\x01\0\0\0\0s\x01\0\0\0\0T\x01\0\0\0\0u\x01\0\0u\x01\0\0K\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\0\0s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\xb9\x01\0\0\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xb8\x01\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\0\0\0\0D\x01\x80\x01\x80\x01\x80\x01\x7f\x01\0\0\x80\x01\0\0\0\0\xb8\x01\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\x80\x01\x7f\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\xbf\x01\x8e\x01\xbf\x01\0\0\0\0\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x92\x01\x93\x01\0\0\0\0\x92\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\x92\x01\0\0\x99\x01\0\0\0\0\0\0\0\0\xb1\x01\x96\x01\0\0\0\0\0\0\xc8\x01\x9c\x01\0\0\x94\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\x95\x01\0\0\0\0\0\0\0\0\0\0\0\0\x8b\x01\0\0\0\0\0\0\0\0\0\0\x9d\x01\0\0\0\0\0\0\0\0\x9e\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc8\x01\0\0\x97\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\xbb\x01\0\0\xa0\x01\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\x9f\x01\xc8\x01\0\0\xc8\x01\xc7\x01\0\0\xa1\x01\0\0\0\0\0\0\0\0\0\0\0\0\x98\x01\0\0\0\0\0\0\0\0\xbd\x01\0\0\xbd\x01\0\0\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\x91\x01\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\xc8\x01\xc7\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xd6\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd3\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0","\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\xff\xff\x03\0\0\0\x86\0\xff\xff\x03\0\xff\xff\x86\0E\x01\x92\x019\0\xff\xffE\x01\x92\x01\xff\xff\xff\xff\xff\xff\xff\xff}\0\x8a\0\xff\xff\0\0\xff\xff\0\0\x03\0\xa9\0\x86\0\xae\0\xff\xff\0\0\n\x01E\x01\x92\x01\f\x01\0\0\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x05\0s\0\0\0}\0\x81\0\x05\0\xec\x01\x88\0\xff\x01&\0\xff\xff\n\0\x88\0f\0:\0\0\0k\0f\0\xff\xff\x0b\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1d\0&\0\0\0o\0\xd0\0\xe9\0\xff\0\f\x01\x0f\0\x11\0<\0\x0b\0\n\0\0\0\x14\0\x18\0\x1f\0 \0\"\0\x16\0\x1a\0\0\0\x0e\0\x1b\0!\0\x12\0\x17\0\0\0\x10\0\x13\0#\0(\0$\0&\0\0\0)\0*\0+\0,\0-\0.\0:\0R\0\x0b\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0'\0?\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0U\0\x8c\0<\0\r\0\x8f\0\x90\0\x91\x000\0\x93\x000\0\x94\0'\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x001\x001\x001\x001\x001\x001\x001\x001\x001\x001\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0A\0'\0\x95\0\x96\0\x9c\0?\0\x9d\x003\0\x9e\x003\0\x9f\x002\x003\x003\x003\x003\x003\x003\x003\x003\x003\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x005\x005\x005\x005\x005\x005\x005\x005\x005\x005\0\x9b\x002\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa1\0\xa2\0\x9b\0[\0A\0\0\x007\x007\x007\x007\x007\x007\x007\x007\x007\x007\x009\0D\0f\0k\0s\0\x83\0\x85\0\x85\0}\0\x8a\0\x85\0\xa3\0^\0\xa5\0D\0\xa6\0\xa7\0\xa8\0\xab\0o\0\xac\0\xad\0\xce\0\xcb\0\xcf\0\xd2\0\xd3\0:\0R\0\x85\0\xd4\0\xd5\0\xd6\0\xd7\0\xd9\0\x8c\0\xda\0a\0\xdb\0\xdc\0w\0\xdd\0\xde\0\xdf\0\x85\0[\0\xcb\0\"\x01>\x01\xe9\0\x98\0\x01\x01P\x01\xf7\0<\0\xfb\x006\x01:\x01Q\x01D\0)\x01R\x01S\x01\x06\x01\x1a\x01D\0w\0\x1e\x01\x0f\x01D\0^\0\x0f\x01T\x01U\x01V\x01G\x01X\x01D\0\xcb\x002\x01G\x01D\0Y\x01D\0D\0G\0G\0G\0G\0G\0G\0G\0G\0G\0G\0a\0L\x01w\0Z\x01?\0\x01\x01\\\x01G\0G\0G\0G\0G\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0\x98\0L\x01]\x01_\x01a\x01b\x01-\x01N\0N\0N\0N\0N\0N\0c\x01\x98\0d\x01G\0G\0G\0G\0G\0G\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\x14\x01L\x01A\0\x14\x01e\x01f\x01h\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0i\x01j\x01-\x01$\x01k\x01l\x01m\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0n\x01\x1a\x01y\x01\x9d\x01\x1e\x01\x9e\x01\x14\x01P\0P\0P\0P\0P\0P\0[\0\x9f\x01>\x01O\0O\0O\0O\0O\0O\0\xf7\0\xa0\x01\xfb\0\xa1\x01:\x01D\0V\0V\0V\0V\0V\0V\0V\0V\0V\0V\0^\0P\0P\0P\0P\0P\0P\0V\0V\0V\0V\0V\0V\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0$\x01)\x01a\0\xa2\x01\xa3\x01w\0\x01\x01W\0W\0W\0W\0W\0W\0\xa5\x016\x01\x98\0V\0V\0V\0V\0V\0V\0\x06\x01\xa6\x01\xa7\x01\xa8\x01\x0f\x01\xa9\x01X\0X\0X\0X\0X\0X\0X\0X\0X\0X\x002\x01W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0_\0\x85\x01\xaa\x01\xab\x01\x9a\x01\x85\x01\xac\x01Y\0Y\0Y\0Y\0Y\0Y\0_\0\xb0\0\xad\x01X\0X\0X\0X\0X\0X\0-\x01\xae\x01\xaf\x01\xb0\0\xb0\x01\x9a\x01\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0z\x01Y\0Y\0Y\0Y\0Y\0Y\0\x94\x01\xb1\x01\x14\x01\xb2\x01b\0\x94\x01\xb3\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xd8\x01\xc1\x01_\0\x9a\x01\xd8\x01\xcd\x01b\0\xde\x01_\0\xcd\x01\xe5\x01\xff\xff_\0\xda\x01$\x01\xd7\x01\xd7\x01\xff\xff\xda\x01\xd7\x01_\0\xff\xff\xff\xff\xd8\x01_\0\xff\xff_\0_\0`\0`\0`\0`\0`\0`\0`\0`\0`\0`\0\xd7\x01\xff\xffz\x01\xff\xff\xff\xff\xff\xff\xff\xff`\0`\0`\0`\0`\0`\0b\0\xff\xff\xd7\x01\xf7\x01\xff\xff\xff\xffb\0\xff\xff}\x01\x80\x01b\0\xff\xff\xdc\x01\xff\xff\xfb\x01\xff\xff\xff\xff\xff\xffb\0y\x01\xff\xff\xc2\x01b\0\xff\xffb\0b\0`\0`\0`\0`\0`\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xe7\x01\xff\xff\xee\x01\xff\xff\xfb\x01\xee\x01\xff\xffc\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xf3\x01}\x01\x80\x01\xe0\x01\xff\xff\xc5\x01\xff\xffd\0d\0d\0d\0d\0d\0\xff\xff\xc2\x01\xff\xffc\0c\0c\0c\0c\0c\0\xff\xff\xff\xff\xff\xff\xc8\x01\xe7\x01\x85\x01e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xff\xffd\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xff\xff\xff\xff\xc5\x01\xb0\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb9\0\xff\xffe\0e\0e\0e\0e\0e\0\xc8\x01\xe0\x01\xff\xff\xb9\0\xcd\x01z\x01\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xc0\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc0\0\xc1\x01\xf7\x01\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc7\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xc7\0}\x01\x80\x01\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xcc\0\xc2\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe7\x01\xff\xff\xff\xff\xc7\0\xdc\x01\xee\x01\xfb\x01\xff\xff\xc7\0\xf3\x01\xff\xff\xcc\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xe1\0\xff\xff\xe1\0\xff\xff\xe0\x01\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xcd\0\xc5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcc\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xff\xff\xff\xff\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xe4\0\xff\xff\xe4\0\xff\xff\xe3\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xff\xff\xe3\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xb9\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xed\0\xff\xffM\x01\xff\xffM\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01\xff\xffM\x01\xff\xff\xff\xff\xc0\0\xff\xff\xff\xff\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0M\x01\xff\xff\xff\xff\xff\xff\xed\0\xc7\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xf2\0\xff\xff\xff\xff\xf0\0\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xed\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0B\x01B\x01\xff\xff\xff\xffB\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xffO\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01p\x01\xff\xffp\x01\xff\xffB\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01\xff\xff\xff\xffB\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xff\xff\xffr\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xffs\x01\xff\xffs\x01\xff\xffB\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\xff\xffr\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01\xff\xff~\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\x81\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x9b\x01\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01~\x01\xff\xff\xff\xffB\x01~\x01\x81\x01~\x01~\x01\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\x81\x01\x81\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xb8\x01\x8a\x01\xb8\x01\xff\xff\xff\xff\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x9c\x01\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xba\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\x8f\x01\xc6\x01\xff\xff\xc6\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xbb\x01\xff\xff\xbb\x01\xff\xff\xba\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xc9\x01\xc9\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",e,e,e,e,e,e],hr="lib/data_source/jellyfin_api.ml.user",hs="lib/data_source/jellyfin_api.ml.Authenticate_by_name.params",ht="lib/data_source/jellyfin_api.ml.Authenticate_by_name.response",hu="lib/data_source/jellyfin_api.ml.Item.genre_item",j8="lib/data_source/jellyfin_api.ml.Item.image_blur_hashes",D="lib/data_source/jellyfin_api.ml.Item.type_",hv="lib/data_source/jellyfin_api.ml.Item.t",hw="lib/data_source/jellyfin_api.ml.Virtual_folders.virtual_folder",fy="lib/db/generic_schema.ml.Id.t",hx="lib/db/generic_schema.ml.Collection.t",hy="lib/db/generic_schema.ml.Genre.t",hz="lib/db/generic_schema.ml.Album.t",hA="lib/db/generic_schema.ml.Track.t",hB="lib/db/stores.ml.Items.sorts",hC="lib/db/stores.ml.Items.t",pq=[0,0,0];ca(11,lQ,ta);ca(10,f,s1);ca(9,[B,s4,qu],s4);ca(8,lO,sS);ca(7,lN,uq);ca(6,a9,tB);ca(5,[B,ry,-6],ry);ca(4,[B,sL,-5],sL);ca(3,lL,ss);ca(2,dy,ln);ca(1,lP,sE);ca(0,iu,ur);var -vq=hJ,vo="output_substring",vk=dq,vg=dZ,vh=fY,u7="Stdlib.Exit",u$=d6(0,0,qn),vb=d6(0,0,65520),vd=d6(1,0,qn),vt="CamlinternalLazy.Undefined",vy="option is None",vC=hS,vD="\\'",vE=hV,vF=h6,vG=hN,vH=hG,vA="Char.chr",vK=" is not an Unicode scalar value",vS="List.init",vP="hd",v1="String.blit / Bytes.blit_string",v0="Bytes.blit",vZ="String.sub / Bytes.sub",we="String.contains_from / Bytes.contains_from",v$=e,v8="String.concat",wn="Array.iter2: arrays must have the same length",wl="Array.blit",wk="Array.sub",wi="Array.init",wz="Set.remove_min_elt",wA=[0,0,0,0],wB=[0,"set.ml",rq,18],wv=hK,ww=hK,wx=hK,wy=hK,wH="Map.remove_min_elt",wI=[0,0,0,0],wJ=[0,"map.ml",tW,10],wD=h7,wE=h7,wF=h7,wG=h7,wK="Stdlib.Stack.Empty",wO="Stdlib.Queue.Empty",wZ="Buffer.add_substring/add_subbytes",wY="Buffer.add: cannot grow buffer",wX=[0,q4,93,2],wW=[0,q4,94,2],wT="Buffer.sub",w$=sI,xa=sb,xb=tD,xc=so,xd=uu,xe=tz,xf="%f",xg="%B",xh="%{",xi="%}",xj="%(",xk="%)",xl=ut,xm="%t",xn="%?",xo="%r",xp="%_r",xq=[0,aS,p2,23],xB=[0,aS,tV,21],xt=[0,aS,q0,21],xC=[0,aS,qq,21],xu=[0,aS,sK,21],xD=[0,aS,s6,19],xv=[0,aS,sN,19],xE=[0,aS,rd,22],xw=[0,aS,qx,22],xF=[0,aS,sm,30],xx=[0,aS,qO,30],xz=[0,aS,tG,26],xr=[0,aS,re,26],xA=[0,aS,tr,28],xs=[0,aS,p4,28],xy=[0,aS,td,23],yR=[0,aS,1558,4],yS="Printf: bad conversion %[",yT=[0,aS,1626,39],yU=[0,aS,1649,31],yV=[0,aS,1650,31],yW="Printf: bad conversion %_",yX=sz,yY=qJ,yZ=sz,y0=qJ,y3=[0,[11,"invalid box description ",[3,0,0]],"invalid box description %S"],y2=[0,0,4],yM=ko,yK="neg_infinity",yL=sG,yJ=dq,yE=[0,hE],ys="%+nd",yt="% nd",yv="%+ni",yw="% ni",yx="%nx",yy="%#nx",yz="%nX",yA="%#nX",yB="%no",yC="%#no",yr="%nd",yu=uu,yD="%nu",ye="%+ld",yf="% ld",yh="%+li",yi="% li",yj="%lx",yk="%#lx",yl="%lX",ym="%#lX",yn="%lo",yo="%#lo",yd="%ld",yg=so,yp="%lu",x2="%+Ld",x3="% Ld",x5="%+Li",x6="% Li",x7="%Lx",x8="%#Lx",x9="%LX",x_="%#LX",x$="%Lo",ya="%#Lo",x1="%Ld",x4=tz,yb="%Lu",xO="%+d",xP="% d",xR="%+i",xS="% i",xT="%x",xU="%#x",xV=t9,xW="%#X",xX="%o",xY="%#o",xN=kn,xQ=tD,xZ=qm,w3="@]",w4="@}",w5="@?",w6="@\n",w7="@.",w8="@@",w9="@%",w_="@",xG="CamlinternalFormat.Type_mismatch",y8=e,y9=[0,[11,lc,[2,0,[2,0,0]]],", %s%s"],zF=[0,[11,k7,[2,0,[12,10,0]]],qr],zG=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],"Fatal error in uncaught exception handler: exception %s\n"],zE="Fatal error: out of memory in uncaught exception handler",zB=[0,[11,k7,[2,0,[12,10,0]]],qr],zv=[0,[2,0,[12,10,0]],"%s\n"],zw=[0,[11,qb,0],qb],zm="Raised at",zn="Re-raised at",zo="Raised by primitive operation at",zp="Called from",zq=" (inlined)",zs=e,zr=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,", line ",[4,0,0,0,[11,sc,SR]]]]]]]]]],'%s %s in file "%s"%s, line %d, characters %d-%d'],zt=[0,[2,0,[11," unknown location",0]],"%s unknown location"],zf="Out of memory",zg="Stack overflow",zh="Pattern matching failed",zi="Assertion failed",zj="Undefined recursive module",y$=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],za=e,zb=e,zc=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],y7=[0,[4,0,0,0,0],kn],y5=[0,[3,0,0],"%S"],y6=r2,zy=[0,e,"(Cannot print locations:\n bytecode executable program file not found)","(Cannot print locations:\n bytecode executable program file appears to be corrupt)","(Cannot print locations:\n bytecode executable program file has wrong magic number)","(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)"],zK="Fun.Finally_raised: ",zI="Stdlib.Fun.Finally_raised",zT="Random.int",zO=bE,zU=[0,987910699,495797812,364182224,414272206,318284740,990407751,383018966,270373319,840823159,24560019,536292337,512266505,189156120,730249596,143776328,51606627,140166561,366354223,1003410265,700563762,981890670,913149062,526082594,1021425055,784300257,667753350,630144451,949649812,48546892,415514493,258888527,511570777,89983870,283659902,308386020,242688715,482270760,865188196,1027664170,207196989,193777847,619708188,671350186,149669678,257044018,87658204,558145612,183450813,28133145,901332182,710253903,510646120,652377910,409934019,801085050],z3="Hashtbl: unsupported hash table format",zY=e,AP=[3,0,3],AQ=dq,AJ=s5,AK="<\/",AL=e,AF=s5,AG="<",AH=e,AD="\n",Ax=e,Ay=e,Az=e,AA=e,Al=[0,e],Ag=e,Ah=e,Ai=e,Aj=e,Ac=[0,e,0,e],z_="Stdlib.Format.String_tag",A2="Jsoo_runtime.Error.Exn",A3=ks,A7=[0,ao,157,10],A9=[0,ao,179,10],A$=[0,ao,h2,10],Bc=[0,ao,kT,17],Bm=[0,ao,r0,16],Bn=[0,ao,rM,18],Bo=[0,ao,rV,15],Bp=[0,ao,rB,15],Bq=[0,ao,kR,15],Br=[0,ao,r7,10],Bs=[0,ao,si,16],Bt=[0,ao,un,12],Bu=[0,ao,ul,14],BF=[0,ao,sO,27],BE=[0,ao,s7,27],By=[0,ao,sU,16],Bv=[0,ao,su,23],Bw=[0,ao,rA,14],Bl=[0,ao,sv,9],Bg=[0,ao,t5,9],Bf=[0,ao,t3,9],Be=[0,[11,"Lwd: unsafe mutation (variable invalidated during evaluation) at\n",[15,0]],"Lwd: unsafe mutation (variable invalidated during evaluation) at\n%a"],Bb=[0,ao,kX,14],A_=[0,ao,qg,14],A8=[0,ao,169,14],A6=[0,ao,s0,14],Bz="Lwd.Release_failure",BM=[0,M,64,12],BZ=[0,M,s3,18],BY=[0,M,kT,9],B1=[0,M,fX,18],B0=[0,M,h3,9],B2=[0,M,eE,21],B3=[0,M,cu,21],B4=[0,M,qT,21],B6=[0,M,qW,14],Cu=[0,M,sY,18],Cv=[0,M,rW,12],Cw=[0,M,r_,14],Ct=[0,M,q6,21],Cr=[0,M,sn,14],Cp=[0,M,sJ,14],Cn=[0,M,s9,29],Cm=[0,M,qM,29],Ck=[0,M,qa,21],Cf=[0,M,pR,10],Cg=[0,M,qk,15],Ch=[0,M,p6,10],Ci=[0,M,pW,2],Ca=[0,M,qQ,24],Cb=[0,M,qE,16],Cc=[0,M,tE,2],B9=[0,M,qe,18],B8=[0,M,uv,9],BV=[0,M,rR,4],BU=[0,M,kX,21],BS=[0,M,sl,4],BT=[0,M,177,14],BQ=[0,M,113,14],BO=[0,M,82,21],BK=[0,M,32,14],CZ=[0,bp,rF,12],CK=[0,bp,sd,37],CL=[0,bp,pT,37],CN=[0,bp,sa,10],CO=[0,bp,qK,42],CM=[0,bp,sw,37],CQ=[0,bp,qX,10],CR=[0,bp,kR,42],CP=[0,bp,us,37],CU=[0,bp,sZ,16],CX=[0,bp,tY,50],CV=[0,bp,rS,6],CT=[0,bp,rH,14],CC=[0,bp,sl,57],CD=[0,bp,182,57],CE=[0,bp,tk,11],Cx=qF,Cy=qF,Dp=[0,"src/fut.ml",34,25],Ep="debug",En="warn",El=k_,Ek="log",D6="scrollTop",DN="search",DH=[0,1],DF=up,Et="isSecureContext",EB="cache",EC="credentials",ED="headers",EE="integrity",EF="keepalive",EG="method",EH="mode",EI="redirect",EJ="referrer",EK="referrerPolicy",E6=[0,sx,k3,16],E4=[0,sx,tC,16],EZ=[0,0,0],EX=[0,0,0],FB=e,FA=e,Fq=[0,[0,bh,tU],0],Fr=[0,[0,bh,kw],[0,ct,0]],Fs=[0,[0,bh,hI],[0,ct,0]],Ft=[0,[0,bh,kB],[0,ct,0]],Fu=[0,[0,bh,k2],[0,ct,0]],Fv=[0,[0,bh,kI],[0,ct,0]],Fw=[0,[0,bh,ku],[0,ct,0]],Fx=[0,[0,bh,kH],[0,ct,0]],Fy=[0,[0,bh,tU],[0,ct,0]],Fh=[0,[0,bh,kw],0],Fi=[0,[0,bh,hI],0],Fj=[0,rp,0],Fk=[0,[0,bh,kB],0],Fl=[0,[0,bh,k2],0],Fm=[0,[0,bh,kI],0],Fn=[0,[0,bh,ku],0],Fo=[0,ct,0],Fp=[0,[0,bh,kH],0],Ff=[0,[11,"\x1b[",[4,0,0,0,[12,109,0]]],"\x1b[%dm"],Fg="CCFormat.ANSI_codes.No_such_style",FC="CCFormat.Style",FQ="CCResult.Get_error",FZ="CCFQueue.Empty",F0=[0,0],F9="content-box",F_="border-box",F$="device-pixel-content-box",Gi=tO,Gj=rz,Gk="position",Ge="Set metadata",Go="unique",GB="not implemented",Gy=[0,[8,[0,0,0],0,0,[11,tb,0]],"%fpx"],Gz=[0,[8,[0,0,0],0,0,[11,sM,0]],"%frem"],GA=[0,[8,[0,0,0],0,0,[11,qc,0]],"%fem"],Gv=tb,Gw=sM,Gx=qc,GD="Common.Utils.Forward_ref.Not_set",GF="Common.Utils.Forward_ref.Already_set",GJ=[1,[0,rv,qv]],GL=[1,-358247754],GQ=e,GP=[0,[12,91,[2,0,[11,"] ",[2,0,0]]]],"[%s] %s"],GV="TODO not implemented",G0=[0,80,tA],G3=[0,80,[0,"lwdui-controlled-scroll-wrapper"]],G4=[0,80,"lwdui-controlled-scroll-controls"],G5="Show playing",Hb=p3,G_=e,G$="password",G7=e,G8=k5,Hg=[0,80,k5],Hd=[0,[2,0,[11,sQ,0]],qC],He=[0,[2,0,0],sb],Hi=[0,80,k5],Hh=[0,[2,0,[11,sQ,0]],qC],Hm=[0,[2,0,[11,"-id",0]],"%s-id"],Hn=[0,80,"checkbox"],Hk=[0,[2,0,[12,45,[4,3,0,0,[12,45,[4,3,0,0,0]]]]],"%s-%i-%i"],Hy=[0,[11,qP,[2,0,0]],"height: %s"],Hu=[0,[2,0,[12,32,[2,0,0]]],"%s %s"],Hs="grid-template-columns",Ht=[0,[2,0,[11,hM,[2,0,[12,59,0]]]],"%s: %s;"],Hv=e,Hz=[1,4.],HH=[0,80,q$],HF="Row height",HG="Visible height:",HD=[0,[11,"height: calc(",[2,0,[11," * ",[4,3,0,0,[11,");",0]]]]],"height: calc(%s * %i);"],HE=[0,[11,qP,[2,0,[11," !important;",0]]],"height: %s !important;"],HI=[0,80,[0,"lwdui-lazy-table-content"]],HJ=[0,80,[0,"lwdui-lazy-table-content-wrapper"]],HK=[0,"lwdui-lazy-table",0],HA="virtual table",HO="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",H1=[0,[17,[0,r5,1,0],0],r5],H0=[0,[12,32,0],bF],HZ=[0,[11,rf,0],rf],H2=[0,[15,[4,6,0,[0,2],[15,0]]],"%a%.2x%a"],HU=[0,[11,tt,[15,[11,s8,[15,[11," dst-off=",[4,0,0,0,[11,kl,[4,0,0,0,0]]]]]]]],"Cstruct.blit_from_string src=%a dst=%a dst-off=%d len=%d"],HS=[0,[11,tt,[15,[11,s8,[15,[11," src-off=",[4,0,0,0,[11,kl,[4,0,0,0,0]]]]]]]],"Cstruct.blit_from_string src=%a dst=%a src-off=%d len=%d"],HQ=[0,[12,91,[4,0,0,0,[12,93,0]]],"[%d]"],HP=[0,[12,91,[4,0,0,0,[12,44,[4,0,0,0,[11,"](",[4,0,0,0,[12,41,0]]]]]]],"[%d,%d](%d)"],H3=[0,[17,3,[15,[17,4,0]]],"@\n%a@."],H4=e,IA=[0,[8,[0,0,0],0,[0,0],0],pQ],Ij=[0,[12,44,0],kV],Iq=[0,[15,[12,58,[15,0]]],"%a:%a"],Ip=[0,[12,44,0],kV],Ii=[0,[11,fP,0],fP],Il=[0,[11,dZ,0],dZ],Im=[0,[11,fY,0],fY],In=[0,[8,[0,0,0],0,[0,0],0],pQ],Io=[0,[8,[0,0,3],0,0,0],"%g"],Ir=[0,[12,eK,[15,[12,eQ,0]]],"{%a}"],Ik=[0,[12,91,[15,[12,93,0]]],"[%a]"],Is=[0,[12,44,[17,[0,a,1,0],0]],qf],Iw=[0,[18,[1,[0,[11,eC,0],eC]],[15,[12,58,[17,[0,a,1,0],[15,[17,0,0]]]]]],"@[%a:@ %a@]"],Iv=[0,[12,44,[17,[0,a,1,0],0]],qf],Ix=[0,[18,[1,[0,[11,eC,0],eC]],[11,"{ ",[15,[11," }",[17,0,0]]]]],"@[{ %a }@]"],Iy=[0,[11,tL,0],tL],It=[0,[18,[1,[0,[11,eC,0],eC]],[11,"[ ",[15,[11," ]",[17,0,0]]]]],"@[[ %a ]@]"],Iu=[0,[11,uh,0],uh],H9=[0,[12,34,0],dr],Ib=[0,[0,0],sI],Ia=[0,[11,hS,0],hS],Id=[0,[11,hV,0],hV],Ie=[0,[11,h6,0],h6],If=[0,[11,hN,0],hN],Ig=[0,[11,hG,0],hG],H$=[0,[11,lh,0],lh],Ic=[0,[11,"\\u",[4,6,[0,2,4],0,0]],"\\u%04x"],H_=[0,[12,34,0],dr],IY=[0,fQ,ra,9],IR=[0,eS,k4],IM=[0,fR,k4],IS=[0,dn,k4],IQ=[0,dn,fJ],IN=[0,fR,fJ],IO=[0,fQ,153,55],IP=[0,dn,fJ],IT=[0,fQ,s0,55],IU=[0,fQ,154,55],IV=[0,dn,cx],IK=[0,fQ,k8,9],IC=[0,[11,"invalid bounds (index ",[4,0,0,0,[11,", length ",[4,0,0,0,[12,41,0]]]]],"invalid bounds (index %d, length %d)"],IJ=[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0],Kb=[0,bS,[0,bu,1]],Kc=[0,bS,cP],Kd=[0,bS,[0,bu,0]],Kf=[0,bS,fK],Ke=[0,bS,dX],Kq=[0,kZ,st,27],Kk=[0,bS,rl],Kh=[0,bS,ua],J$=[0,kZ,t0,8],J_=[0,kZ,s$,45],JG=[0,[18,[1,[0,0,e]],[11,eG,[17,[0,a,1,0],[11,"initial",[17,[0,a,1,0],[11,"BOM",[17,[0,a,1,0],[11,kN,[17,[0,a,1,0],[11,hF,SS]]]]]]]]]],"@[illegal@ initial@ BOM@ in@ character@ stream@]"],JH=[0,[18,[1,[0,0,e]],[11,eG,[17,[0,a,1,0],[11,"escape,",[17,[0,a,1,0],0]]]]],"@[illegal@ escape,@ "],JJ=[0,[15,[17,[0,a,1,0],[11,kv,[17,[0,a,1,0],[11,"an",[17,[0,a,1,0],[11,"escaped",[17,[0,a,1,0],[11,hF,[17,0,0]]]]]]]]]],"%a@ not@ an@ escaped@ character@]"],JK=[0,[15,[17,[0,a,1,0],[11,qD,[17,[0,a,1,0],[11,ts,[17,[0,a,1,0],[11,kS,[17,0,0]]]]]]]],"%a@ lone@ low@ surrogate@]"],JL=[0,[15,[17,[0,a,1,0],[11,qD,[17,[0,a,1,0],[11,"high",[17,[0,a,1,0],[11,kS,[17,0,0]]]]]]]],"%a@ lone@ high@ surrogate@]"],JM=[0,[15,[17,[0,a,1,0],[11,kv,[17,[0,a,1,0],[12,97,[17,[0,a,1,0],[11,"hex",[17,[0,a,1,0],[11,"digit",[17,0,0]]]]]]]]]],"%a@ not@ a@ hex@ digit@]"],JI=[0,[15,[17,[0,a,1,0],[11,kv,[17,[0,a,1,0],[12,97,[17,[0,a,1,0],[11,ts,[17,[0,a,1,0],[11,kS,[17,0,0]]]]]]]]]],"%a@ not@ a@ low@ surrogate@]"],JN=[0,[18,[1,[0,0,e]],[11,eG,[17,[0,a,1,0],[11,"bytes",[17,[0,a,1,0],[11,kN,[17,[0,a,1,0],[11,hF,[17,[0,a,1,0],[11,qA,ST]]]]]]]]]],"@[illegal@ bytes@ in@ character@ stream@ ("],JO=[0,[4,8,[0,2,2],0,0],"%02X"],JQ=[0,[12,32,[4,8,[0,2,2],0,0]]," %02X"],JP=[0,[12,41,[17,0,0]],")@]"],JR=[0,[18,[1,[0,0,e]],[11,"expected",[17,[0,a,1,0],0]]],"@[expected@ "],JS=[0,[11,tl,[17,[0,a,1,0],[11,bj,[17,0,0]]]],"member@ name@]"],JT=[0,[11,h_,[17,[0,a,1,0],[11,"text (JSON value)",[17,0,0]]]],"JSON@ text (JSON value)@]"],JU=[0,[11,bj,[17,[0,a,1,0],[11,kA,[17,[0,a,1,0],[11,"(':')",[17,0,0]]]]]],"name@ separator@ (':')@]"],JV=[0,[11,fI,[17,[0,a,1,0],[11,"of",[17,[0,a,1,0],[11,hJ,[17,0,0]]]]]],"end@ of@ input@]"],JW=[0,[11,"JavaScript",[17,[0,a,1,0],[11,rK,[17,0,0]]]],"JavaScript@ comment@]"],JX=[0,[11,h_,[17,[0,a,1,0],[11,cO,[17,0,0]]]],"JSON@ value@]"],JY=[0,[11,tl,[17,[0,a,1,0],[11,bj,[17,[0,a,1,0],[11,dp,[17,[0,a,1,0],[11,ib,[17,[0,a,1,0],[11,fI,[17,SV,SU]]]]]]]]]],"member@ name@ or@ object@ end@ ('\"'@ or@ '}')@]"],JZ=[0,[11,cO,[17,[0,a,1,0],[11,kA,[17,[0,a,1,0],[11,dp,[17,[0,a,1,0],[11,ib,[17,[0,a,1,0],[11,fI,[17,SX,SW]]]]]]]]]],"value@ separator@ or@ object@ end@ (','@ or@ '}')@]"],J0=[0,[11,cO,[17,[0,a,1,0],[11,dp,[17,[0,a,1,0],[11,h5,[17,[0,a,1,0],[11,fI,[17,[0,a,1,0],[11,"(value",[17,SZ,SY]]]]]]]]]],"value@ or@ array@ end@ (value@ or@ ']')@]"],J1=[0,[11,cO,[17,[0,a,1,0],[11,kA,[17,[0,a,1,0],[11,dp,[17,[0,a,1,0],[11,h5,[17,[0,a,1,0],[11,fI,[17,S1,S0]]]]]]]]]],"value@ separator@ or@ array@ end@ (','@ or@ ']')@]"],J2=[0,[18,[1,[0,0,e]],[11,eG,[17,[0,a,1,0],[11,"number",[17,[0,a,1,0],[12,40,[2,0,[12,41,[17,0,0]]]]]]]]],"@[illegal@ number@ (%s)@]"],J8=[0,[18,[1,[0,0,e]],[11,eG,[17,[0,a,1,0],[11,"literal",[17,[0,a,1,0],[12,40,[2,0,[12,41,[17,0,0]]]]]]]]],"@[illegal@ literal@ (%s)@]"],J9=[0,[18,[1,[0,0,e]],[11,eG,[17,[0,a,1,0],[11,hF,[17,[0,a,1,0],[11,kN,[17,[0,a,1,0],[11,h_,[17,[0,a,1,0],[11,kK,S2]]]]]]]]]],"@[illegal@ character@ in@ JSON@ string@ (%a)@]"],J3=[0,[18,[1,[0,0,e]],[11,"unclosed",[17,[0,a,1,0],0]]],"@[unclosed@ "],J4=[0,[11,ib,[17,0,0]],"object@]"],J5=[0,[11,h5,[17,0,0]],"array@]"],J6=[0,[11,rK,[17,0,0]],"comment@]"],J7=[0,[11,kK,[17,0,0]],"string@]"],JE=[0,[12,39,[2,0,[11,"' (",[15,[12,41,0]]]]],"'%s' (%a)"],JD=[0,[11,"U+",[4,8,[0,2,4],0,0]],"U+%04X"],Ji=[0,ah,-543455433],Jp=[0,ah,[0,fF,eF]],Jq=[0,ah,[0,fF,n]],Jr=[0,ah,[0,fF,fK]],Js=[0,ah,[0,fF,dX]],Jv=[0,ah,[0,ck,eF]],Jw=[0,ah,[0,ck,hU]],Jx=[0,ah,[0,ck,t2]],Jy=[0,ah,[0,ck,[0,t1,1]]],Jz=[0,ah,[0,ck,[0,t1,0]]],JA=[0,ah,[0,ck,[0,kr,1]]],JB=[0,ah,[0,ck,[0,kr,0]]],JC=[0,ah,[0,ck,qN]],KK="not a valid JSON array/object",KH=[0,[11,"JSON.of_buffer ",[2,0,0]],"JSON.of_buffer %s"],KC=[0,[11,bU,0],bU],KD=[0,[11,"Unexpected input when parsing a ",[2,0,0]],"Unexpected input when parsing a %s"],KE=[0,[15,0],ut],KB="We expected a well-formed JSON document (array or object)",Kw=cO,Kx="object fields",Ku=[0,"lib/ezjsonm.ml",61,19],Kv=[0,hR,357123046],Kt="Abort",Ky="Ezjsonm.Parse_error",KM=im([[0,lm,x],[0,rR,x],[0,194,x],[0,195,x],[0,196,x],[0,tP,x],[0,198,fG],[0,kX,ay],[0,200,E],[0,tC,E],[0,202,E],[0,203,E],[0,s$,U],[0,s3,U],[0,206,U],[0,207,U],[0,208,aj],[0,209,an],[0,210,q],[0,t0,q],[0,212,q],[0,213,q],[0,214,q],[0,216,q],[0,217,A],[0,kT,A],[0,219,A],[0,220,A],[0,221,aM],[0,222,kY],[0,rk,N],[0,fX,u],[0,225,u],[0,226,u],[0,227,u],[0,228,u],[0,229,u],[0,230,cQ],[0,231,aN],[0,232,k],[0,k3,k],[0,234,k],[0,235,k],[0,236,L],[0,h3,L],[0,tk,L],[0,r3,L],[0,eE,_],[0,241,$],[0,242,c],[0,243,c],[0,tN,c],[0,245,c],[0,dV,c],[0,B,c],[0,249,s],[0,cu,s],[0,251,s],[0,eN,s],[0,kt,ax],[0,d0,fS],[0,dm,ax],[0,cw,x],[0,tH,u],[0,258,x],[0,259,u],[0,qT,x],[0,261,u],[0,262,ay],[0,263,aN],[0,264,ay],[0,265,aN],[0,rr,ay],[0,267,aN],[0,268,ay],[0,269,aN],[0,270,aj],[0,pV,_],[0,272,aj],[0,t4,_],[0,274,E],[0,275,k],[0,276,E],[0,277,k],[0,278,E],[0,279,k],[0,280,E],[0,281,k],[0,282,E],[0,283,k],[0,284,al],[0,285,T],[0,286,al],[0,287,T],[0,288,al],[0,289,T],[0,rE,al],[0,291,T],[0,tp,az],[0,293,S],[0,294,az],[0,295,S],[0,qW,U],[0,rP,L],[0,298,U],[0,299,L],[0,300,U],[0,301,L],[0,302,U],[0,303,L],[0,304,U],[0,t3,L],[0,306,"IJ"],[0,307,"ij"],[0,308,b_],[0,t5,bv],[0,310,aE],[0,311,aT],[0,312,"kra"],[0,313,ae],[0,314,C],[0,qe,ae],[0,316,C],[0,uv,ae],[0,318,C],[0,319,ae],[0,320,C],[0,sd,ae],[0,pT,C],[0,323,an],[0,324,$],[0,325,an],[0,326,$],[0,327,an],[0,328,$],[0,329,$],[0,330,"NG"],[0,331,fT],[0,332,q],[0,333,c],[0,sv,q],[0,335,c],[0,336,q],[0,sw,c],[0,us,rx],[0,339,cW],[0,340,af],[0,341,o],[0,342,af],[0,343,o],[0,344,af],[0,345,o],[0,sa,Y],[0,347,N],[0,348,Y],[0,349,N],[0,350,Y],[0,351,N],[0,352,Y],[0,353,N],[0,354,aG],[0,355,ai],[0,356,aG],[0,qK,ai],[0,358,aG],[0,359,ai],[0,360,A],[0,361,s],[0,si,A],[0,ra,s],[0,364,A],[0,365,s],[0,366,A],[0,r0,s],[0,rM,A],[0,369,s],[0,370,A],[0,qQ,s],[0,rV,aX],[0,373,a7],[0,374,aM],[0,qX,ax],[0,376,aM],[0,rB,ap],[0,378,Z],[0,379,ap],[0,380,Z],[0,381,ap],[0,382,Z],[0,kR,N],[0,384,aL],[0,385,aV],[0,r7,aV],[0,387,aL],[0,388,qL],[0,389,qL],[0,390,q],[0,qE,ay],[0,392,aN],[0,393,aj],[0,tE,aj],[0,rH,aj],[0,396,_],[0,st,_],[0,398,E],[0,399,E],[0,tW,E],[0,401,bo],[0,402,b6],[0,403,al],[0,404,al],[0,405,rL],[0,406,U],[0,407,U],[0,408,aE],[0,409,aT],[0,410,C],[0,411,C],[0,412,bi],[0,413,an],[0,414,$],[0,415,q],[0,416,q],[0,417,c],[0,418,"OI"],[0,419,"oi"],[0,pR,aW],[0,421,bt],[0,422,"YR"],[0,qk,kM],[0,424,kM],[0,sZ,q3],[0,426,cU],[0,427,ai],[0,428,aG],[0,429,ai],[0,430,aG],[0,431,A],[0,432,s],[0,433,A],[0,434,bq],[0,p6,aM],[0,436,ax],[0,437,ap],[0,438,Z],[0,439,ap],[0,440,ap],[0,441,Z],[0,442,Z],[0,443,kM],[0,444,sD],[0,445,sD],[0,446,bT],[0,447,a7],[0,448,cl],[0,449,cl],[0,450,cl],[0,451,cl],[0,452,tS],[0,453,aj],[0,454,b8],[0,455,"LJ"],[0,456,ae],[0,pW,"lj"],[0,458,"NJ"],[0,ul,an],[0,460,"nj"],[0,461,x],[0,qa,u],[0,463,U],[0,464,L],[0,465,q],[0,466,c],[0,467,A],[0,468,s],[0,469,A],[0,470,s],[0,471,A],[0,472,s],[0,473,A],[0,474,s],[0,475,A],[0,476,s],[0,477,k],[0,478,x],[0,479,u],[0,rS,x],[0,481,u],[0,482,fG],[0,483,cQ],[0,484,al],[0,485,T],[0,486,al],[0,487,T],[0,488,aE],[0,489,aT],[0,490,q],[0,491,c],[0,s9,q],[0,493,c],[0,494,ap],[0,495,Z],[0,496,bv],[0,497,tS],[0,498,aj],[0,qM,b8],[0,500,al],[0,501,T],[0,502,"HW"],[0,503,aX],[0,504,an],[0,505,$],[0,506,x],[0,507,u],[0,508,fG],[0,509,cQ],[0,510,q],[0,511,c],[0,h1,x],[0,tY,u],[0,514,x],[0,515,u],[0,516,E],[0,un,k],[0,518,E],[0,519,k],[0,520,U],[0,521,L],[0,522,U],[0,sJ,L],[0,524,q],[0,525,c],[0,526,q],[0,527,c],[0,528,af],[0,529,o],[0,530,af],[0,sn,o],[0,532,A],[0,533,s],[0,534,A],[0,535,s],[0,536,Y],[0,537,N],[0,q6,aG],[0,539,ai],[0,540,"GH"],[0,541,"gh"],[0,542,az],[0,543,S],[0,rA,an],[0,545,_],[0,r_,"OU"],[0,547,ky],[0,548,ap],[0,549,Z],[0,su,x],[0,551,u],[0,552,E],[0,sY,k],[0,554,q],[0,555,c],[0,556,q],[0,rW,c],[0,558,q],[0,559,c],[0,sU,q],[0,561,c],[0,562,aM],[0,563,ax],[0,564,C],[0,565,$],[0,566,ai],[0,567,bv],[0,568,"db"],[0,569,"qp"],[0,rq,x],[0,rF,ay],[0,572,aN],[0,573,ae],[0,574,aG],[0,575,N],[0,576,Z],[0,577,rb],[0,578,bT],[0,579,aV],[0,580,A],[0,581,bq],[0,582,E],[0,583,k],[0,584,b_],[0,585,bv],[0,586,bW],[0,587,dl],[0,588,af],[0,589,o],[0,590,aM],[0,591,ax],[0,592,u],[0,593,u],[0,594,u],[0,595,aL],[0,596,c],[0,597,aN],[0,598,_],[0,599,_],[0,600,k],[0,601,k],[0,602,k],[0,603,k],[0,604,k],[0,605,k],[0,606,k],[0,607,bv],[0,608,T],[0,609,T],[0,610,T],[0,611,T],[0,612,tx],[0,613,S],[0,614,S],[0,615,S],[0,616,L],[0,617,L],[0,618,L],[0,619,C],[0,620,C],[0,621,C],[0,622,eM],[0,623,aY],[0,624,aY],[0,625,aY],[0,626,$],[0,627,$],[0,628,$],[0,629,c],[0,630,cW],[0,631,c],[0,632,kz],[0,633,o],[0,634,o],[0,635,o],[0,636,o],[0,637,o],[0,638,o],[0,639,o],[0,640,o],[0,641,o],[0,642,N],[0,643,cU],[0,644,bv],[0,645,"{squat}"],[0,646,cU],[0,647,ai],[0,648,ai],[0,649,s],[0,650,s],[0,s7,aZ],[0,652,aZ],[0,653,a7],[0,654,ax],[0,655,ax],[0,656,Z],[0,657,Z],[0,658,Z],[0,659,Z],[0,660,rb],[0,661,"{voiced}"],[0,662,bT],[0,663,aN],[0,664,cl],[0,665,aL],[0,666,k],[0,667,T],[0,668,S],[0,669,bv],[0,670,aT],[0,671,C],[0,672,dl],[0,673,bT],[0,674,bT],[0,675,b8],[0,676,b8],[0,677,b8],[0,678,bT],[0,679,h8],[0,680,qZ],[0,681,ll],[0,682,ty],[0,683,eM],[0,684,"{percussive}"],[0,685,"{bipercussive}"],[0,sO,S],[0,687,S],[0,688,S],[0,689,S],[0,690,bv],[0,691,o],[0,692,o],[0,693,o],[0,694,o],[0,695,a7],[0,696,ax],[0,736,T],[0,737,C],[0,738,N],[0,739,bE],[0,740,bT],[0,768,e],[0,769,e],[0,770,e],[0,771,e],[0,772,e],[0,773,e],[0,774,e],[0,775,e],[0,776,e],[0,777,e],[0,778,e],[0,779,e],[0,780,e],[0,781,e],[0,782,e],[0,783,e],[0,784,e],[0,785,e],[0,786,e],[0,787,e],[0,788,e],[0,789,e],[0,790,e],[0,791,e],[0,792,e],[0,793,e],[0,794,e],[0,795,e],[0,796,e],[0,797,e],[0,798,e],[0,799,e],[0,800,e],[0,801,e],[0,802,e],[0,803,e],[0,804,e],[0,805,e],[0,806,e],[0,807,e],[0,808,e],[0,809,e],[0,810,e],[0,811,e],[0,812,e],[0,813,e],[0,tV,e],[0,q0,e],[0,816,e],[0,817,e],[0,qq,e],[0,sK,e],[0,820,e],[0,821,e],[0,s6,e],[0,sN,e],[0,824,e],[0,825,e],[0,rd,e],[0,qx,e],[0,828,e],[0,829,e],[0,830,e],[0,sm,e],[0,qO,e],[0,833,e],[0,834,e],[0,835,e],[0,tG,e],[0,re,e],[0,838,e],[0,839,e],[0,840,e],[0,841,e],[0,842,e],[0,843,e],[0,844,e],[0,845,e],[0,tr,e],[0,p4,e],[0,848,e],[0,849,e],[0,p2,e],[0,td,e],[0,852,e],[0,853,e],[0,854,e],[0,855,e],[0,856,e],[0,857,e],[0,858,e],[0,859,e],[0,860,e],[0,861,e],[0,862,e],[0,863,e],[0,864,e],[0,865,e],[0,866,e],[0,867,e],[0,868,e],[0,869,e],[0,870,e],[0,871,e],[0,872,e],[0,873,e],[0,874,e],[0,875,e],[0,876,e],[0,877,e],[0,878,e],[0,879,e],[0,1155,e],[0,1156,e],[0,1157,e],[0,1158,e],[0,1159,e],[0,1160,e],[0,1161,e],[0,2027,e],[0,2028,e],[0,2029,e],[0,2030,e],[0,2031,e],[0,2032,e],[0,2033,e],[0,2034,e],[0,2035,e],[0,3072,e],[0,3076,e],[0,3315,e],[0,3328,e],[0,4957,e],[0,4958,e],[0,4959,e],[0,6783,e],[0,6832,e],[0,6833,e],[0,6834,e],[0,6835,e],[0,6836,e],[0,6837,e],[0,6838,e],[0,6839,e],[0,6840,e],[0,6841,e],[0,6842,e],[0,6843,e],[0,6844,e],[0,6845,e],[0,6846,e],[0,6847,e],[0,6848,e],[0,6849,e],[0,6850,e],[0,6851,e],[0,6852,e],[0,6853,e],[0,6854,e],[0,6855,e],[0,6856,e],[0,6857,e],[0,6858,e],[0,6859,e],[0,6860,e],[0,6861,e],[0,6862,e],[0,6863,e],[0,6864,e],[0,6865,e],[0,6866,e],[0,6867,e],[0,6868,e],[0,6869,e],[0,6870,e],[0,6871,e],[0,6872,e],[0,6873,e],[0,6874,e],[0,6875,e],[0,6876,e],[0,6877,e],[0,6878,e],[0,6879,e],[0,6880,e],[0,6881,e],[0,6882,e],[0,6883,e],[0,6884,e],[0,6885,e],[0,6886,e],[0,6887,e],[0,6888,e],[0,6889,e],[0,6890,e],[0,6891,e],[0,6892,e],[0,6893,e],[0,6894,e],[0,6895,e],[0,6896,e],[0,6897,e],[0,6898,e],[0,6899,e],[0,6900,e],[0,6901,e],[0,6902,e],[0,6903,e],[0,6904,e],[0,6905,e],[0,6906,e],[0,6907,e],[0,6908,e],[0,6909,e],[0,6910,e],[0,6911,e],[0,7019,e],[0,7020,e],[0,7021,e],[0,7022,e],[0,7023,e],[0,7024,e],[0,7025,e],[0,7026,e],[0,7027,e],[0,7424,u],[0,7425,cQ],[0,7426,cQ],[0,7427,aL],[0,7428,aN],[0,7429,_],[0,7430,_],[0,7431,k],[0,7432,k],[0,7433,L],[0,7434,bv],[0,7435,aT],[0,7436,C],[0,7437,aY],[0,7438,$],[0,7439,c],[0,7440,c],[0,7441,c],[0,7442,c],[0,7443,c],[0,7444,cW],[0,7445,ky],[0,7446,c],[0,7447,c],[0,7448,bt],[0,7449,o],[0,7450,o],[0,7451,ai],[0,7452,s],[0,7453,s],[0,7454,s],[0,7455,aY],[0,7456,aZ],[0,7457,a7],[0,7458,Z],[0,7459,Z],[0,7460,"{spirant}"],[0,7461,c],[0,7468,u],[0,7469,cQ],[0,7470,aL],[0,7471,aL],[0,7472,_],[0,7473,k],[0,7474,k],[0,7475,T],[0,7476,S],[0,7477,L],[0,7478,bv],[0,7479,aT],[0,7480,C],[0,7481,aY],[0,7482,$],[0,7483,$],[0,7484,c],[0,7485,ky],[0,7486,bt],[0,7487,o],[0,7488,ai],[0,7489,s],[0,7490,a7],[0,7491,u],[0,7492,u],[0,7493,u],[0,7494,cQ],[0,7495,aL],[0,7496,_],[0,7497,k],[0,7498,k],[0,7499,k],[0,7500,k],[0,7501,T],[0,7502,L],[0,7503,aT],[0,7504,aY],[0,7505,fT],[0,7506,c],[0,7507,c],[0,7508,c],[0,7509,c],[0,7510,bt],[0,7511,ai],[0,7512,s],[0,7513,s],[0,7514,aY],[0,7515,aZ],[0,7516,c],[0,7531,tQ],[0,7532,aL],[0,7533,_],[0,7534,b6],[0,7535,aY],[0,7536,$],[0,7537,bt],[0,7538,o],[0,7539,o],[0,7540,N],[0,7541,ai],[0,7542,Z],[0,7543,T],[0,7545,T],[0,7546,fS],[0,7547,L],[0,7548,L],[0,7549,bt],[0,7550,s],[0,7551,s],[0,7552,aL],[0,7553,_],[0,7554,b6],[0,7555,T],[0,7556,aT],[0,7557,C],[0,7558,aY],[0,7559,$],[0,7560,bt],[0,7561,o],[0,7562,N],[0,7563,cU],[0,7564,aZ],[0,7565,bE],[0,7566,Z],[0,7567,u],[0,7568,u],[0,7569,_],[0,7570,k],[0,7571,k],[0,7572,k],[0,7573,k],[0,7574,L],[0,7575,c],[0,7576,cU],[0,7577,s],[0,7578,Z],[0,7579,u],[0,7580,aN],[0,7581,aN],[0,7582,_],[0,7583,k],[0,7584,b6],[0,7585,bv],[0,7586,T],[0,7587,S],[0,7588,L],[0,7589,L],[0,7590,L],[0,7591,L],[0,7592,bv],[0,7593,C],[0,7594,C],[0,7595,C],[0,7596,aY],[0,7597,aY],[0,7598,$],[0,7599,$],[0,7600,$],[0,7601,c],[0,7602,kz],[0,7603,N],[0,7604,cU],[0,7605,ai],[0,7606,s],[0,7607,s],[0,7608,s],[0,7609,aZ],[0,7610,aZ],[0,7611,Z],[0,7612,Z],[0,7613,Z],[0,7614,Z],[0,7616,e],[0,7617,e],[0,7618,e],[0,7619,e],[0,7620,e],[0,7621,e],[0,7622,e],[0,7623,e],[0,7624,e],[0,7625,e],[0,7626,af],[0,7627,e],[0,7628,e],[0,7629,e],[0,7630,e],[0,7631,e],[0,7632,e],[0,7633,e],[0,7634,e],[0,7635,x],[0,7636,fG],[0,7637,q8],[0,7638,kJ],[0,7639,ay],[0,7640,aj],[0,7641,aj],[0,7642,al],[0,7643,al],[0,7644,aE],[0,7645,ae],[0,7646,ae],[0,7647,bi],[0,7648,an],[0,7649,an],[0,7650,af],[0,7651,af],[0,7652,Y],[0,7653,Y],[0,7654,ap],[0,7655,x],[0,7656,aV],[0,7657,aV],[0,7658,E],[0,7659,bo],[0,7660,ae],[0,7661,q],[0,7662,aW],[0,7663,q3],[0,7664,A],[0,7665,aX],[0,7666,x],[0,7667,q],[0,7668,A],[0,7669,e],[0,7670,e],[0,7671,e],[0,7672,e],[0,7673,e],[0,7674,e],[0,7675,e],[0,7676,e],[0,7677,e],[0,7678,e],[0,7679,e],[0,7680,x],[0,7681,u],[0,7682,aV],[0,7683,aL],[0,7684,aV],[0,7685,aL],[0,7686,aV],[0,7687,aL],[0,7688,ay],[0,7689,aN],[0,7690,aj],[0,7691,_],[0,7692,aj],[0,7693,_],[0,7694,aj],[0,7695,_],[0,7696,aj],[0,7697,_],[0,7698,aj],[0,7699,_],[0,7700,E],[0,7701,k],[0,7702,E],[0,7703,k],[0,7704,E],[0,7705,k],[0,7706,E],[0,7707,k],[0,7708,E],[0,7709,k],[0,7710,bo],[0,7711,b6],[0,7712,al],[0,7713,T],[0,7714,az],[0,7715,S],[0,7716,az],[0,7717,S],[0,7718,az],[0,7719,S],[0,7720,az],[0,7721,S],[0,7722,az],[0,7723,S],[0,7724,U],[0,7725,L],[0,7726,U],[0,7727,L],[0,7728,aE],[0,7729,aT],[0,7730,aE],[0,7731,aT],[0,7732,aE],[0,7733,aT],[0,7734,ae],[0,7735,C],[0,7736,ae],[0,7737,C],[0,7738,ae],[0,7739,C],[0,7740,ae],[0,7741,C],[0,7742,bi],[0,7743,aY],[0,7744,bi],[0,7745,aY],[0,7746,bi],[0,7747,aY],[0,7748,an],[0,7749,$],[0,7750,an],[0,7751,$],[0,7752,an],[0,7753,$],[0,7754,an],[0,7755,$],[0,7756,q],[0,7757,c],[0,7758,q],[0,7759,c],[0,7760,q],[0,7761,c],[0,7762,q],[0,7763,c],[0,7764,aW],[0,7765,bt],[0,7766,aW],[0,7767,bt],[0,7768,af],[0,7769,o],[0,7770,af],[0,7771,o],[0,7772,af],[0,7773,o],[0,7774,af],[0,7775,o],[0,7776,Y],[0,7777,N],[0,7778,Y],[0,7779,N],[0,7780,Y],[0,7781,N],[0,7782,Y],[0,7783,N],[0,7784,Y],[0,7785,N],[0,7786,aG],[0,7787,ai],[0,7788,aG],[0,7789,ai],[0,7790,aG],[0,7791,ai],[0,7792,aG],[0,7793,ai],[0,7794,A],[0,7795,s],[0,7796,A],[0,7797,s],[0,7798,A],[0,7799,s],[0,7800,A],[0,7801,s],[0,7802,A],[0,7803,s],[0,7804,bq],[0,7805,aZ],[0,7806,bq],[0,7807,aZ],[0,7808,aX],[0,7809,a7],[0,7810,aX],[0,7811,a7],[0,7812,aX],[0,7813,a7],[0,7814,aX],[0,7815,a7],[0,7816,aX],[0,7817,a7],[0,7818,b9],[0,7819,bE],[0,7820,b9],[0,7821,bE],[0,7822,aM],[0,7823,ax],[0,7824,ap],[0,7825,Z],[0,7826,ap],[0,7827,Z],[0,7828,ap],[0,7829,Z],[0,7830,S],[0,7831,ai],[0,7832,a7],[0,7833,ax],[0,7834,u],[0,7835,N],[0,7836,N],[0,7837,N],[0,7838,Y],[0,7839,_],[0,7840,x],[0,7841,u],[0,7842,x],[0,7843,u],[0,7844,x],[0,7845,u],[0,7846,x],[0,7847,u],[0,7848,x],[0,7849,u],[0,7850,x],[0,7851,u],[0,7852,x],[0,7853,u],[0,7854,x],[0,7855,u],[0,7856,x],[0,7857,u],[0,7858,x],[0,7859,u],[0,7860,x],[0,7861,u],[0,7862,x],[0,7863,u],[0,7864,E],[0,7865,k],[0,7866,E],[0,7867,k],[0,7868,E],[0,7869,k],[0,7870,E],[0,7871,k],[0,7872,E],[0,7873,k],[0,7874,E],[0,7875,k],[0,7876,E],[0,7877,k],[0,7878,E],[0,7879,k],[0,7880,U],[0,7881,L],[0,7882,U],[0,7883,L],[0,7884,q],[0,7885,c],[0,7886,q],[0,7887,c],[0,7888,q],[0,7889,c],[0,7890,q],[0,7891,c],[0,7892,q],[0,7893,c],[0,7894,q],[0,7895,c],[0,7896,q],[0,7897,c],[0,7898,q],[0,7899,c],[0,7900,q],[0,7901,c],[0,7902,q],[0,7903,c],[0,7904,q],[0,7905,c],[0,7906,q],[0,7907,c],[0,7908,A],[0,7909,s],[0,7910,A],[0,7911,s],[0,7912,A],[0,7913,s],[0,7914,A],[0,7915,s],[0,7916,A],[0,7917,s],[0,7918,A],[0,7919,s],[0,7920,A],[0,7921,s],[0,7922,aM],[0,7923,ax],[0,7924,aM],[0,7925,ax],[0,7926,aM],[0,7927,ax],[0,7928,aM],[0,7929,ax],[0,7930,"LL"],[0,7931,"ll"],[0,7932,bq],[0,7933,aZ],[0,7934,aM],[0,7935,ax],[0,8305,L],[0,8319,$],[0,8400,e],[0,8401,e],[0,8402,e],[0,8403,e],[0,8404,e],[0,8405,e],[0,8406,e],[0,8407,e],[0,8408,e],[0,8409,e],[0,8410,e],[0,8411,e],[0,8412,e],[0,8413,e],[0,8414,e],[0,8415,e],[0,8416,e],[0,8417,e],[0,8418,e],[0,8419,e],[0,8420,e],[0,8421,e],[0,8422,e],[0,8423,e],[0,8424,e],[0,8425,e],[0,8426,e],[0,8427,e],[0,8428,e],[0,8429,e],[0,8430,e],[0,8431,e],[0,8432,e],[0,8580,aN],[0,9372,x],[0,9373,aV],[0,9374,ay],[0,9375,aj],[0,9376,E],[0,9377,bo],[0,9378,al],[0,9379,az],[0,9380,U],[0,9381,b_],[0,9382,aE],[0,9383,ae],[0,9384,bi],[0,9385,an],[0,9386,q],[0,9387,aW],[0,9388,bW],[0,9389,af],[0,9390,Y],[0,9391,aG],[0,9392,A],[0,9393,bq],[0,9394,aX],[0,9395,b9],[0,9396,aM],[0,9397,ap],[0,9398,x],[0,9399,aV],[0,9400,ay],[0,9401,aj],[0,9402,E],[0,9403,bo],[0,9404,al],[0,9405,az],[0,9406,U],[0,9407,b_],[0,9408,aE],[0,9409,ae],[0,9410,bi],[0,9411,an],[0,9412,q],[0,9413,aW],[0,9414,bW],[0,9415,af],[0,9416,Y],[0,9417,aG],[0,9418,A],[0,9419,bq],[0,9420,aX],[0,9421,b9],[0,9422,aM],[0,9423,ap],[0,9424,u],[0,9425,aL],[0,9426,aN],[0,9427,_],[0,9428,k],[0,9429,b6],[0,9430,T],[0,9431,S],[0,9432,L],[0,9433,bv],[0,9434,aT],[0,9435,C],[0,9436,aY],[0,9437,$],[0,9438,c],[0,9439,bt],[0,9440,dl],[0,9441,o],[0,9442,N],[0,9443,ai],[0,9444,s],[0,9445,aZ],[0,9446,a7],[0,9447,bE],[0,9448,ax],[0,9449,Z],[0,11360,ae],[0,11361,C],[0,11362,ae],[0,11363,aW],[0,11364,af],[0,11365,u],[0,11366,ai],[0,11367,az],[0,11368,S],[0,11369,aE],[0,11370,aT],[0,11371,ap],[0,11372,Z],[0,11373,x],[0,11374,bi],[0,11375,x],[0,11376,x],[0,11377,aZ],[0,11378,aX],[0,11379,a7],[0,11380,aZ],[0,11381,az],[0,11382,S],[0,11383,kz],[0,11384,k],[0,11385,o],[0,11386,c],[0,11387,k],[0,11389,aZ],[0,11390,Y],[0,11391,ap],[0,11503,e],[0,11504,e],[0,11505,e],[0,12441,e],[0,12442,e],[0,42607,e],[0,42608,e],[0,42609,e],[0,42610,e],[0,42620,e],[0,42621,e],[0,42736,e],[0,42737,e],[0,42786,"{ALEF}"],[0,42787,"{alef}"],[0,42788,q],[0,42789,c],[0,42790,az],[0,42791,S],[0,42792,"TZ"],[0,42793,"tz"],[0,42794,q7],[0,42795,q7],[0,42796,h$],[0,42797,h$],[0,42798,h$],[0,42799,h$],[0,42800,b6],[0,42801,N],[0,42802,"AA"],[0,42803,sh],[0,42804,q8],[0,42805,"ao"],[0,42806,"AU"],[0,42807,"au"],[0,42808,kJ],[0,42809,ui],[0,42810,kJ],[0,42811,ui],[0,42812,"AY"],[0,42813,"ay"],[0,42814,ay],[0,42815,aN],[0,42816,aE],[0,42817,aT],[0,42818,aE],[0,42819,aT],[0,42820,aE],[0,42821,aT],[0,42822,ae],[0,42823,C],[0,42824,ae],[0,42825,C],[0,42826,q],[0,42827,c],[0,42828,q],[0,42829,c],[0,42830,"OO"],[0,42831,"oo"],[0,42832,aW],[0,42833,bt],[0,42834,aW],[0,42835,bt],[0,42836,aW],[0,42837,bt],[0,42838,bW],[0,42839,dl],[0,42840,bW],[0,42841,dl],[0,42842,af],[0,42843,o],[0,42844,af],[0,42845,o],[0,42846,bq],[0,42847,aZ],[0,42848,"VY"],[0,42849,"vy"],[0,42850,ap],[0,42851,Z],[0,42852,kY],[0,42853,fS],[0,42854,kY],[0,42855,fS],[0,42856,bq],[0,42857,aZ],[0,42858,"ET"],[0,42859,"et"],[0,42860,"IS"],[0,42861,"is"],[0,42862,"CON"],[0,42863,"con"],[0,42864,"us"],[0,42865,"dum"],[0,42866,"lum"],[0,42867,"mum"],[0,42868,"num"],[0,42869,o],[0,42870,o],[0,42871,"tum"],[0,42872,"um"],[0,42873,aj],[0,42874,_],[0,42875,bo],[0,42876,b6],[0,42877,al],[0,42878,al],[0,42879,T],[0,42880,ae],[0,42881,C],[0,42882,af],[0,42883,o],[0,42884,Y],[0,42885,N],[0,42886,aG],[0,42887,ai],[0,42891,hT],[0,42892,hT],[0,42893,az],[0,42894,C],[0,42895,ug],[0,42896,an],[0,42897,$],[0,42898,ay],[0,42899,aN],[0,42900,aN],[0,42901,S],[0,42902,aV],[0,42903,aL],[0,42904,bo],[0,42905,b6],[0,42906,fG],[0,42907,cQ],[0,42908,rx],[0,42909,cW],[0,42910,"UE"],[0,42911,tQ],[0,42912,al],[0,42913,T],[0,42914,aE],[0,42915,aT],[0,42916,an],[0,42917,$],[0,42918,af],[0,42919,o],[0,42920,Y],[0,42921,N],[0,42922,az],[0,42923,E],[0,42924,al],[0,42925,ae],[0,42926,U],[0,42927,dl],[0,42928,aE],[0,42929,aG],[0,42930,b_],[0,42931,b9],[0,42932,aV],[0,42933,aL],[0,42934,q],[0,42935,c],[0,42936,A],[0,42937,s],[0,42938,x],[0,42939,u],[0,42940,U],[0,42941,L],[0,42942,A],[0,42943,s],[0,42944,q],[0,42945,c],[0,42946,aX],[0,42947,a7],[0,42948,ay],[0,42949,Y],[0,42950,ap],[0,42951,aj],[0,42952,_],[0,42953,Y],[0,42954,N],[0,42960,al],[0,42961,T],[0,42963,fS],[0,42965,a7],[0,42966,Y],[0,42967,N],[0,42968,Y],[0,42969,N],[0,42994,ay],[0,42995,bo],[0,42996,bW],[0,42997,az],[0,42998,S],[0,42999,U],[0,43000,S],[0,43001,"{letter}"],[0,43002,aY],[0,43003,bo],[0,43004,aW],[0,43005,bi],[0,43006,U],[0,43007,bi],[0,43232,e],[0,43233,e],[0,43234,e],[0,43235,e],[0,43236,e],[0,43237,e],[0,43238,e],[0,43239,e],[0,43240,e],[0,43241,e],[0,43249,e],[0,43824,u],[0,43825,u],[0,43826,k],[0,43827,k],[0,43828,k],[0,43829,b6],[0,43830,T],[0,43831,C],[0,43832,C],[0,43833,C],[0,43834,aY],[0,43835,$],[0,43836,fT],[0,43837,c],[0,43838,c],[0,43839,c],[0,43840,cW],[0,43841,cW],[0,43842,cW],[0,43843,c],[0,43844,c],[0,43845,o],[0,43846,o],[0,43847,o],[0,43848,o],[0,43849,o],[0,43850,o],[0,43851,o],[0,43852,o],[0,43853,cU],[0,43854,s],[0,43855,s],[0,43856,qz],[0,43857,qz],[0,43858,s],[0,43859,bE],[0,43860,bE],[0,43861,bE],[0,43862,bE],[0,43863,bE],[0,43864,bE],[0,43865,bE],[0,43866,ax],[0,43868,S],[0,43869,C],[0,43870,C],[0,43871,s],[0,43872,"wa"],[0,43873,k],[0,43874,cW],[0,43875,"uo"],[0,43876,u],[0,43878,b8],[0,43879,bT],[0,43880,o],[0,43881,a7],[0,64256,"ff"],[0,64257,"fi"],[0,64258,"fl"],[0,64259,"ffi"],[0,64260,"ffl"],[0,64261,N],[0,64262,"st"],[0,65056,e],[0,65057,e],[0,65058,e],[0,65059,e],[0,65060,e],[0,65061,e],[0,65062,e],[0,65063,e],[0,65064,e],[0,65065,e],[0,65066,e],[0,65067,e],[0,65068,e],[0,65069,e],[0,65070,e],[0,65071,e],[0,65313,x],[0,65314,aV],[0,65315,ay],[0,65316,aj],[0,65317,E],[0,65318,bo],[0,65319,al],[0,65320,az],[0,65321,U],[0,65322,b_],[0,65323,aE],[0,65324,ae],[0,65325,bi],[0,65326,an],[0,65327,q],[0,65328,aW],[0,65329,bW],[0,65330,af],[0,65331,Y],[0,65332,aG],[0,65333,A],[0,65334,bq],[0,65335,aX],[0,65336,b9],[0,65337,aM],[0,65338,ap],[0,65345,u],[0,65346,aL],[0,65347,aN],[0,65348,_],[0,65349,k],[0,65350,b6],[0,65351,T],[0,65352,S],[0,65353,L],[0,65354,bv],[0,65355,aT],[0,65356,C],[0,65357,aY],[0,65358,$],[0,65359,c],[0,65360,bt],[0,65361,dl],[0,65362,o],[0,65363,N],[0,65364,ai],[0,65365,s],[0,65366,aZ],[0,65367,a7],[0,65368,bE],[0,65369,ax],[0,65370,Z],[0,66045,e],[0,67456,sh],[0,67457,pS],[0,67458,pS],[0,67459,cQ],[0,67460,aL],[0,67461,aL],[0,67463,b8],[0,67464,b8],[0,67465,b8],[0,67466,b8],[0,67467,_],[0,67468,_],[0,67469,_],[0,67470,k],[0,67471,k],[0,67472,ll],[0,67473,tx],[0,67474,T],[0,67475,T],[0,67476,T],[0,67477,S],[0,67478,S],[0,67479,S],[0,67480,bv],[0,67481,ty],[0,67482,eM],[0,67483,C],[0,67484,C],[0,67485,C],[0,67486,eM],[0,67487,eM],[0,67488,ax],[0,67489,ax],[0,67490,c],[0,67491,cW],[0,67492,c],[0,67493,dl],[0,67494,o],[0,67495,o],[0,67496,o],[0,67497,o],[0,67498,o],[0,67499,qZ],[0,67500,bT],[0,67501,bT],[0,67502,h8],[0,67503,ai],[0,67504,aZ],[0,67506,ax],[0,67507,bT],[0,67508,bT],[0,67509,cl],[0,67510,cl],[0,67511,cl],[0,67512,cl],[0,67513,cl],[0,67514,N],[0,69291,e],[0,69292,e],[0,69446,e],[0,69447,e],[0,69448,e],[0,69449,e],[0,69450,e],[0,69451,e],[0,69452,e],[0,69453,e],[0,69454,e],[0,69455,e],[0,69456,e],[0,69506,e],[0,69507,e],[0,69508,e],[0,69509,e],[0,70400,e],[0,70459,e],[0,70502,e],[0,70503,e],[0,70504,e],[0,70505,e],[0,70506,e],[0,70507,e],[0,70508,e],[0,92912,e],[0,92913,e],[0,92914,e],[0,92915,e],[0,92916,e],[0,118528,e],[0,118529,e],[0,118530,e],[0,118531,e],[0,118532,e],[0,118533,e],[0,118534,e],[0,118535,e],[0,118536,e],[0,118537,e],[0,118538,e],[0,118539,e],[0,118540,e],[0,118541,e],[0,118542,e],[0,118543,e],[0,118544,e],[0,118545,e],[0,118546,e],[0,118547,e],[0,118548,e],[0,118549,e],[0,118550,e],[0,118551,e],[0,118552,e],[0,118553,e],[0,118554,e],[0,118555,e],[0,118556,e],[0,118557,e],[0,118558,e],[0,118559,e],[0,118560,e],[0,118561,e],[0,118562,e],[0,118563,e],[0,118564,e],[0,118565,e],[0,118566,e],[0,118567,e],[0,118568,e],[0,118569,e],[0,118570,e],[0,118571,e],[0,118572,e],[0,118573,e],[0,118576,e],[0,118577,e],[0,118578,e],[0,118579,e],[0,118580,e],[0,118581,e],[0,118582,e],[0,118583,e],[0,118584,e],[0,118585,e],[0,118586,e],[0,118587,e],[0,118588,e],[0,118589,e],[0,118590,e],[0,118591,e],[0,118592,e],[0,118593,e],[0,119141,e],[0,119142,e],[0,119143,e],[0,119144,e],[0,119145,e],[0,119149,e],[0,119150,e],[0,119151,e],[0,119152,e],[0,119153,e],[0,119154,e],[0,119163,e],[0,119164,e],[0,119165,e],[0,119166,e],[0,119167,e],[0,119168,e],[0,119169,e],[0,119170,e],[0,119173,e],[0,119174,e],[0,119175,e],[0,119176,e],[0,119177,e],[0,119178,e],[0,119179,e],[0,119210,e],[0,119211,e],[0,119212,e],[0,119213,e],[0,119362,e],[0,119363,e],[0,119364,e],[0,122624,ll],[0,122625,T],[0,122626,T],[0,122627,aT],[0,122628,C],[0,122629,eM],[0,122630,ax],[0,122631,fT],[0,122632,o],[0,122633,ai],[0,122634,cl],[0,122635,cU],[0,122636,cU],[0,122637,ai],[0,122638,bT],[0,122639,aN],[0,122640,aT],[0,122641,C],[0,122642,b8],[0,122643,C],[0,122644,fT],[0,122645,o],[0,122646,o],[0,122647,h8],[0,122648,Z],[0,122649,b8],[0,122650,L],[0,122651,c],[0,122652,h8],[0,122653,aN],[0,122654,N],[0,122661,_],[0,122662,C],[0,122663,$],[0,122664,o],[0,122665,N],[0,122666,ai],[0,125136,e],[0,125137,e],[0,125138,e],[0,125139,e],[0,125140,e],[0,125141,e],[0,125142,e],[0,127248,x],[0,127249,aV],[0,127250,ay],[0,127251,aj],[0,127252,E],[0,127253,bo],[0,127254,al],[0,127255,az],[0,127256,U],[0,127257,b_],[0,127258,aE],[0,127259,ae],[0,127260,bi],[0,127261,an],[0,127262,q],[0,127263,aW],[0,127264,bW],[0,127265,af],[0,127266,Y],[0,127267,aG],[0,127268,A],[0,127269,bq],[0,127270,aX],[0,127271,b9],[0,127272,aM],[0,127273,ap],[0,127274,Y],[0,127275,ay],[0,127276,af],[0,127280,x],[0,127281,aV],[0,127282,ay],[0,127283,aj],[0,127284,E],[0,127285,bo],[0,127286,al],[0,127287,az],[0,127288,U],[0,127289,b_],[0,127290,aE],[0,127291,ae],[0,127292,bi],[0,127293,an],[0,127294,q],[0,127295,aW],[0,127296,bW],[0,127297,af],[0,127298,Y],[0,127299,aG],[0,127300,A],[0,127301,bq],[0,127302,aX],[0,127303,b9],[0,127304,aM],[0,127305,ap],[0,127312,x],[0,127313,aV],[0,127314,ay],[0,127315,aj],[0,127316,E],[0,127317,bo],[0,127318,al],[0,127319,az],[0,127320,U],[0,127321,b_],[0,127322,aE],[0,127323,ae],[0,127324,bi],[0,127325,an],[0,127326,q],[0,127327,aW],[0,127328,bW],[0,127329,af],[0,127330,Y],[0,127331,aG],[0,127332,A],[0,127333,bq],[0,127334,aX],[0,127335,b9],[0,127336,aM],[0,127337,ap],[0,127344,x],[0,127345,aV],[0,127346,ay],[0,127347,aj],[0,127348,E],[0,127349,bo],[0,127350,al],[0,127351,az],[0,127352,U],[0,127353,b_],[0,127354,aE],[0,127355,ae],[0,127356,bi],[0,127357,an],[0,127358,q],[0,127359,aW],[0,127360,bW],[0,127361,af],[0,127362,Y],[0,127363,aG],[0,127364,A],[0,127365,bq],[0,127366,aX],[0,127367,b9],[0,127368,aM],[0,127369,ap],[0,127370,aW],[0,127397,aj],[0,917569,x],[0,917570,aV],[0,917571,ay],[0,917572,aj],[0,917573,E],[0,917574,bo],[0,917575,al],[0,917576,az],[0,917577,U],[0,917578,b_],[0,917579,aE],[0,917580,ae],[0,917581,bi],[0,917582,an],[0,917583,q],[0,917584,aW],[0,917585,bW],[0,917586,af],[0,917587,Y],[0,917588,aG],[0,917589,A],[0,917590,bq],[0,917591,aX],[0,917592,b9],[0,917593,aM],[0,917594,ap],[0,917601,x],[0,917602,aV],[0,917603,ay],[0,917604,aj],[0,917605,E],[0,917606,bo],[0,917607,al],[0,917608,az],[0,917609,U],[0,917610,b_],[0,917611,aE],[0,917612,ae],[0,917613,bi],[0,917614,an],[0,917615,q],[0,917616,aW],[0,917617,bW],[0,917618,af],[0,917619,Y],[0,917620,aG],[0,917621,A],[0,917622,bq],[0,917623,aX],[0,917624,b9],[0,917625,aM],[0,917626,ap]]),KO=bF,KN=im([[0,170,u],[0,qg,c],[0,rk,"ss"],[0,8208,cm],[0,8211,cm],[0,8212,cm],[0,8216,hT],[0,8217,hT],[0,8220,dr],[0,8221,dr],[0,8230,"..."],[0,8722,cm]]),KV=[1,[0,rv,qv]],KT=[0,1],KY=[0,"lib/codec.ml",32,4],K1="Yojson__Common.Json_error",K3="Yojson__Common.End_of_array",K4="Yojson__Common.End_of_object",K5="Yojson__Common.End_of_tuple",K6="Yojson__Common.End_of_input",K8=[0,"\0\0\xfe\xff\xff\xff","\xff\xff\xff\xff\xff\xff","\x01\0\0\0\0\0","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x02\0","\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0",e,e,e,e,e,e],Mo=[0,bu,1],Mp=[0,bu,0],Mq=bU,Mr="Invalid token",Ms=bU,Mt="Invalid escape sequence",Mu=bU,Mv="Invalid low surrogate for code point beyond U+FFFF",Mw="Missing escape sequence representing low surrogate for code point beyond U+FFFF",Mx=bU,My="Expected ':' or '>' but found",Mz=bU,MA="Expected '>' but found",MB=bU,MC="Unterminated comment",MD="Expected string or identifier but found",ME=bU,MF="Expected ',' or ']' but found",MG=bU,MH="Expected ',' or ')' but found",MI=bU,MJ="Expected ',' or '}' but found",MK=bU,ML="Expected ':' but found",MM=bU,M8="Expected string, got ",M7="Expected object, got ",MV=fP,MX=ib,MY="floatlit",MZ=h5,M0="tuple",MW="bool",M2="variant",M3="float",M4="int",M5=kK,M1="intlit",MR="Blank input data",MO="Junk after end of JSON value:",LW=[0,[2,0,[11," '",[2,0,[2,0,[12,39,0]]]]],"%s '%s%s'"],LR=[0,[11,"File ",[2,0,[11,", line",0]]],"File %s, line"],LV="Line",LS=[0,[11,"byte ",[4,3,0,0,0]],"byte %i"],LU=[0,[11,"bytes ",[4,3,0,0,[12,45,[4,3,0,0,0]]]],"bytes %i-%i"],LT=[0,[2,0,[12,32,[4,3,0,0,[11,lc,[2,0,[11,":\n",[2,0,0]]]]]]],"%s %i, %s:\n%s"],LQ=[0,"lib/read.mll",41,13],LP=e,LN=e,Lz="NaN value not allowed in standard JSON",LA=[0,[8,[0,0,3],0,[0,16],0],uj],LC=[0,[8,[0,0,3],0,[0,17],0],tu],LB=t8,Lx="Infinity value not allowed in standard JSON",Ly="-Infinity value not allowed in standard JSON",Ls="NaN",Lt=[0,[8,[0,0,3],0,[0,16],0],uj],Lv=[0,[8,[0,0,3],0,[0,17],0],tu],Lu=t8,Lq="Infinity",Lr="-Infinity",Lm=dZ,Ln=fY,Ll=fP,Lf=hV,Lg=h6,Lh=hN,Li="\\f",Lj=hG,Lk=lh,Le=hS,Lc=[0,[11,"src=",[3,0,[11," start=",[4,3,0,0,[11,kl,[4,3,0,0,[12,10,[10,0]]]]]]]],"src=%S start=%i len=%i\n%!"],La="\\u00",LX="Yojson__Safe.Int_overflow",MS="Yojson__Safe.Util.Type_error",Nb="list_of_yojson: list needed",Na="int_of_yojson: integer needed",M$="string_of_yojson: string needed",M9="Ppx_yojson_conv_lib__Yojson_conv.Of_yojson_error",Np=bF,Nr="_of_yojson: list instead of atom for record expected",Nq=[0,[2,0,[11,"_of_yojson: the following record elements were undefined: ",[2,0,0]]],"%s_of_yojson: the following record elements were undefined: %s"],Nn="extra fields",Nm="duplicate fields",Nk=bF,Nl=[0,[2,0,[11,"_of_yojson: ",[2,0,[11,hM,[2,0,0]]]]],"%s_of_yojson: %s: %s"],Nj="_of_yojson: unexpected variant constructor",Ni="_of_yojson: expected a variant type, saw an empty list",Nh="_of_yojson: expected a variant type, saw a nested list",Ng="_of_yojson: this constructor requires arguments",Ne=[0,[2,0,[11,"_of_yojson: sum tag ",[3,0,[11," has incorrect number of arguments",0]]]],"%s_of_yojson: sum tag %S has incorrect number of arguments"],Nc="_of_yojson: this constructor does not take arguments",Pd="An error occured while decoding response: ",O_=[0,[11,", Token=",[3,0,0]],", Token=%S"],Pb=e,O$=e,Pa=[0,[11,'MediaBrowser Client="Ocamix", Device="Firefox", DeviceId="',[2,0,[11,'", Version="0.1"',[2,0,0]]]],'MediaBrowser Client="Ocamix", Device="Firefox", DeviceId="%s", Version="0.1"%s'],O5=qy,O6=uk,O7=cV,O1="item_id",O2="locations",O3=bj,OZ=sj,OP=sr,OQ=r8,OR=q1,OS=eH,OT=qs,OU=rJ,OV=sR,OW=eL,OX=tj,OY=cV,OJ="type_",OK="image_blur_hashes",OL=eO,OM=bC,ON=bj,OH=[0,"lib/data_source/jellyfin_api.ml",tP,64],N6=[0,r,[0,[0,n,ud],0]],N7=[0,r,[0,[0,n,tM],0]],N8=[0,r,[0,[0,n,rN],0]],N9=[0,r,[0,[0,n,rg],0]],N_=[0,r,[0,[0,n,qw],0]],N$=[0,r,[0,[0,n,qI],0]],Oa=[0,r,[0,[0,n,rw],0]],Ob=[0,r,[0,[0,n,qU],0]],Oc=[0,r,[0,[0,n,sF],0]],Od=[0,r,[0,[0,n,tT],0]],Oe=[0,r,[0,[0,n,tX],0]],Of=[0,r,[0,[0,n,r4],0]],Og=[0,r,[0,[0,n,ue],0]],Oh=[0,r,[0,[0,n,qi],0]],Oi=[0,r,[0,[0,n,qo],0]],Oj=[0,r,[0,[0,n,t$],0]],Ok=[0,r,[0,[0,n,tf],0]],Ol=[0,r,[0,[0,n,qV],0]],Om=[0,r,[0,[0,n,sy],0]],On=[0,r,[0,[0,n,rs],0]],Oo=[0,r,[0,[0,n,p1],0]],Op=[0,r,[0,[0,n,tK],0]],Oq=[0,r,[0,[0,n,tI],0]],Or=[0,r,[0,[0,n,qd],0]],Os=[0,r,[0,[0,n,tn],0]],Ot=[0,r,[0,[0,n,se],0]],Ou=[0,r,[0,[0,n,t7],0]],Ov=[0,r,[0,[0,n,qB],0]],Ow=[0,r,[0,[0,n,ql],0]],Ox=[0,r,[0,[0,n,rj],0]],Oy=[0,r,[0,[0,n,sq],0]],Oz=[0,r,[0,[0,n,q5],0]],OA=[0,r,[0,[0,n,rT],0]],OB=[0,r,[0,[0,n,qp],0]],OC=[0,r,[0,[0,n,qt],0]],OD=[0,r,[0,[0,n,tw],0]],OE=[0,r,[0,[0,n,qR],0]],N3=uc,NZ=eL,N0=cV,NW=bC,NX=bj,NS=[0,"Users",[0,"AuthenticateByName",0]],NN=eH,NO=t6,NP=sk,NJ=eO,NK="access_token",NL="user",NG=sg,NH=q9,ND="pw",NE="username",Ny=eL,Nz=r1,NA=eH,NB=cV,Nu=bC,Nv=eO,Nw=bj,PM=eO,PN=dY,PO=cT,PP=le,PQ=bC,PG=eO,PH=dY,PI=cT,PJ=le,PK=bC,PC=dY,PD=cT,PE=bC,Py=dY,Pz=cT,PA=bC,Pv=kO,Pw=bj,Ps=kO,Pt=bj,Pp=bj,Pq=bC,Pm=bj,Pn=bC,Pk=[0,n,kx],Qv=[0,d1,t4,15],Qr=[0,d1,k3,15],Qd=[0,d1,141,11],P$=[0,d1,96,13],P_=[0,d1,87,19],P9=[0,d1,81,13],P8=[0,d1,75,19],P5=hP,P6=kP,P2=hP,P3=kP,PY=cT,PZ=lj,P0=dT,PU=cT,PV=lj,PW=dT,PS=e,PR="items_by_date_added",Qa="items",Qb="virtual_folders",Qk="collections",Qn=dY,Qq="albums",Qu="tracks",QG=[0,[2,0,[15,0]],"%s%a"],QE=[0,[12,40,[4,3,0,0,[12,47,[4,3,0,0,[12,41,0]]]]],"(%i/%i)"],Qy="Unknown",Qz=s2,QA="Inconsistent",QB=[0,[11,"New items: last: ",[4,3,0,0,[11," missing: ",[4,3,0,0,[11,rh,[4,3,0,0,0]]]]]],"New items: last: %i missing: %i unfetched: %i"],QC=[0,[11,"Partial: last: ",[4,3,0,0,[11,rh,[4,3,0,0,0]]]],"Partial: last: %i unfetched: %i"],QN=[0,[11,"Server ",[2,0,[11,hM,[15,0]]]],"Server %s: %a"],QK="./db_worker.bc.js",QL=e,Rd="GOT L=",Rc=[2,0],Rb=[0,"NEW REF",0],Q9=s2,Q7=[0,[11,"Sync in progress: ",[4,3,0,0,[12,47,[4,3,0,0,0]]]],"Sync in progress: %i/%i"],Q8="Desynchronized",Q2=ld,Q5=ld,Q3=ld,Q4=e,QO="ui_servers",QQ=[0,0,0,0],QR=[0,"https://demo.jellyfin.org/stable"],QS=[0,1],QU=[0,"demo"],QV=[0,1],QX=[0,0],QZ=[0,80,"Connect"],Rw=rc,Rr=[0,[2,0,[11,h0,[2,0,[11,tq,0]]]],sV],Rt=kC,Rs=[0,[11,sH,[3,0,[12,41,0]]],p$],Rp="A playback error happened. This is probably due to a codec unsupported by the browser.",Rq=[0,80,"NEXT"],Ru=[0,80,"now-playing-cover"],Rv=[0,80,"now-playing-details"],Rx=[0,80,ru],Ry=[0,80,"now-playing-display"],Rz=[0,80,"player-wrapper"],RA=[0,80,ru],Rj="Now playing:",Rk=[0,[2,0,[11,h0,[2,0,[11,tq,0]]]],sV],Rl=e,Rm=e,Rn="image/jpeg",Ro="500x500",Rh=[0,[2,0,[11,"/Audio/",[2,0,[11,"/universal?api_key=",[2,0,[11,"&audioCodec=aac&container=opus,mp3,aac,m4a,m4b,flac,wav,ogg&transcodingContainer=ts&transcodingProtocol=hls",0]]]]]],"%s/Audio/%s/universal?api_key=%s&audioCodec=aac&container=opus,mp3,aac,m4a,m4b,flac,wav,ogg&transcodingContainer=ts&transcodingProtocol=hls"],RN=[0,[2,0,[11," (",[4,3,0,0,[12,41,0]]]],"%s (%i)"],RC=dT,RD=h9,RE=e,RF=[0,[0,0,[0,0],0,0],0,0],RH="library-selection",RK=[0,80,[0,e]],RL=[0,80,[0,tR]],RO="genre-selection",RR=[0,"pouet",0,0],RT=[0,[0,dT,"Date added"],[0,[0,bj,cV],0]],RV=[0,"view-sort",dT,0],RX=[0,[0,sB,"Asc"],[0,[0,h9,"Desc"],[0,[0,s_,"Random"],0]]],RZ=[0,"view-order",h9,0],R2=[0,80,[0,tR]],R4=[0,80,[0,"genres-picker"]],R6=[0,80,[0,"filters-row"]],R9=[0,80,[0,"filters-container"]],Sl="|>",Sk=[0,[2,0,[11,h0,[2,0,[11,"/Images/Primary?width=50",0]]]],"%s/Items/%s/Images/Primary?width=50"],Sj="server-error.png",Sm=[2,4.],Sa=rO,Sb="1fr",Sc=rO,Sd=tv,Se=sC,Sf=tv,Sg="#",Sh=sC,Si="Order",SO="Persist ?",SC=[0,[2,0,[11,h0,[2,0,[11,"/Images/Primary?width=800&format=Jpg",0]]]],"%s/Items/%s/Images/Primary?width=800&format=Jpg"],SE=kC,SD=[0,[11,sH,[3,0,[12,41,0]]],p$],Sz=rc,So="session_uuid",Sq="Welcome to OCAMIX",SL=[0,"main-layout"];function -as(a){if(typeof +U_(){var +c=K.process;if(c&&c.on)c.on("uncaughtException",function(a,b){vm(a);c.exit(2)});else if(K.addEventListener)K.addEventListener(lt,function(a){if(a.error)vm(a.error)})}U_();function +h(a,b){return(a.l>=0?a.l:a.l=a.length)==1?a(b):c7(a,[b])}function +i(a,b,c){return(a.l>=0?a.l:a.l=a.length)==2?a(b,c):c7(a,[b,c])}function +a7(a,b,c,d){return(a.l>=0?a.l:a.l=a.length)==3?a(b,c,d):c7(a,[b,c,d])}function +fO(a,b,c,d,e){return(a.l>=0?a.l:a.l=a.length)==4?a(b,c,d,e):c7(a,[b,c,d,e])}function +eN(a,b,c,d,e,f){return(a.l>=0?a.l:a.l=a.length)==5?a(b,c,d,e,f):c7(a,[b,c,d,e,f])}function +T3(a,b,c,d,e,f,g,h){return(a.l>=0?a.l:a.l=a.length)==7?a(b,c,d,e,f,g,h):c7(a,[b,c,d,e,f,g,h])}var +Vk=undefined;Up();var +iF=[B,u5,-1],mb=[B,tg,-2],dH=[B,lI,-3],iE=[B,s5,-4],a_=[B,ue,-7],l$=[B,u4,-8],ma=[B,tu,-9],f=[B,tD,-11],mc=[B,tP,-12],iO=[0,e,0,0,-1],mA=[0,e,1,0,0],TR=[4,0,0,0,[12,45,[4,0,0,0,0]]],i2=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,sP,[4,0,0,0,[12,45,[4,0,0,0,[11,hX,[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],oK=[0,0],TS=[17,[0,a,1,0],[11,rd,[17,0,0]]],TT=[17,[0,a,1,0],[12,40,0]],TU=[11,"('\"'",[17,[0,a,1,0],[11,du,[17,[0,a,1,0],[11,qE,[17,0,0]]]]]],TV=[0,a,1,0],TW=[11,sd,[17,[0,a,1,0],[11,du,[17,[0,a,1,0],[11,qE,[17,0,0]]]]]],TX=[0,a,1,0],TY=[11,du,[17,[0,a,1,0],[11,u2,[17,0,0]]]],TZ=[0,a,1,0],T0=[11,sd,[17,[0,a,1,0],[11,du,[17,[0,a,1,0],[11,u2,[17,0,0]]]]]],T1=[0,a,1,0],T2=[17,[0,a,1,0],[12,40,[15,[12,41,[17,0,0]]]]],pr=[0,ag,[0,cq,-991563951]],ps=[0,ag,[0,cq,sM]],pF=iy([9,10,11,12,13,32,lw,qJ,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,sy,8233,8239,8287,12288]),bf=[0,"\0\0\xec\xff\xed\xff\x03\0\xef\xff\x10\0\xf2\xff\xf3\xff\xf4\xff\xf5\xff\0\0\x1f\0\xf9\xffU\0\x01\0\0\0\0\0\x01\0\0\0\x01\0\x02\0\xff\xff\0\0\0\0\x03\0\xfe\xff\x01\0\x04\0\xfd\xff\x0b\0\xfc\xff\x03\0\x01\0\x03\0\x02\0\x03\0\0\0\xfb\xff\x15\0a\0\n\0\x16\0\x14\0\x10\0\x16\0\f\0\b\0\xfa\xffw\0\x81\0\x8b\0\xa1\0\xab\0\xb5\0\xc1\0\xd1\0\xf0\xff\x0b\0&\0\xfc\xffA\0\xfe\xff\xff\xffn\0\xfc\xff\xa3\0\xfe\xff\xff\xff\xea\0\xf7\xff\xf8\xff0\x01\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xffG\x01~\x01\x95\x01\xf9\xff'\0\xfd\xff\xfe\xff&\0\xbb\x01\xd2\x01\xf8\x01\x0f\x02\xff\xff\xdc\0\xfd\xff\xff\xff\xf5\0'\x02m\x02\x0e\x01X\x02\xa4\x02\xbb\x02\xe1\x02\r\0\xfc\xff\xfd\xff\xfe\xff\xff\xff\x0e\0\xfd\xff\xfe\xff\xff\xff\x1e\0\xfd\xff\xfe\xff\xff\xff\x0f\0\xfd\xff\xfe\xff\xff\xff\x11\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\x13\0\xfc\xff\xfd\xff\xfe\xff\x0f\0\xff\xff\x10\0\xff\xff\b\x01\x05\0\xfd\xff\x17\0\xfe\xff\x14\0\xff\xff.\0\xfd\xff\xfe\xff*\x004\x005\0\xff\xff5\x000\0[\0\\\0\xff\xff\x1b\x01\xfa\xff\xfb\xff\x89\0h\0Y\0X\0j\0\xff\xff\x8f\0\x89\0\xb1\0\xfe\xff\xb7\0\xa8\0\xa6\0\xb7\0\x02\0\xfd\xff\xb1\0\xac\0\xbb\0\x04\0\xfc\xff5\x02\xfb\xff\xfc\xff\xfd\xffg\x01\xff\xff\xf8\x02\xfe\xff\x06\x03\x1e\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff(\x032\x03J\x03\xfc\xff\xfd\xff\xfe\xff\xff\xff=\x03T\x03l\x03\xf9\xff\xfa\xff\xfb\xff\xf4\0x\x03\x8e\x03\xb3\0\xc2\0\x0f\0\xff\xff\xbe\0\xbc\0\xbb\0\xc1\0\xb7\0\xb3\0\xfe\xff\xbf\0\xc9\0\xc8\0\xc4\0\xcb\0\xc1\0\xbd\0\xfd\xff\x9d\x03_\x03\xae\x03\xc4\x03\xce\x03\xd8\x03\xe4\x03\xef\x03<\0\xfd\xff\xfe\xff\xff\xff\f\x04\xfc\xff\xfd\xffW\x04\xff\xff\x91\x04\xfc\xff\xfd\xff\xdd\x04\xff\xff\xe5\0\xfd\xff\xfe\xff\xff\xff\xe7\0\xfd\xff\xfe\xff\xff\xff\x02\0\xff\xff\x12\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\"\x01\xfd\xff\xfe\xff\xff\xff\0\0\xff\xff\x03\0\xfe\xff\xff\xff&\x01\xfc\xff\xfd\xff\xfe\xff\xff\xffx\x01\xfb\xff\xfc\xff\xfd\xff\xfe\xff\xff\xff\xd0\0\xfd\xff\xfe\xff\xff\xff\xd3\0\xfd\xff\xfe\xff\xff\xff\xbd\0\xff\xff\x8f\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff\r\x01\xfd\xff\xfe\xff\xff\xff_\x01\xfc\xff\xfd\xff\xfe\xff\xff\xff2\x01\xfd\xff\xfe\xff\xff\xff\x1a\x01\xfd\xff\xfe\xff\xff\xff\xe9\0\xfd\xff\xfe\xff\xff\xff\xde\0\xfd\xff\xfe\xff\xff\xffO\x05\xed\xff\xee\xff\n\0\xf0\xff,\x01\xf3\xff\xf4\xff\xf5\xff\xf6\xff=\x01\x02\x04\xf9\xff-\x05\xd1\0\xe4\0\xd3\0\xe8\0\xe1\0\xdf\0\xf0\0\xff\xff\xeb\0\xea\0\b\x01\xfe\xff\x04\x01\x17\x01\xfd\xff6\x01\xfc\xff\x1f\x01\x1d\x01 \x01'\x011\x01-\x01\xfb\xff9\x01R\x01P\x01N\x01T\x01J\x01V\x01\xfa\xffn\x05\f\x04{\x05\x9b\x05\xa5\x05\xb1\x05\xbb\x05\xc5\x05\xf1\xff\xc7\x01M\x02\xfd\xff\xff\xff\x9a\x02\xde\x05\xd1\x05\x9b\x02\xef\x055\x06L\x06r\x06\x10\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x98\x06\xfc\xff\xfd\xff\xe3\x06\xff\xffU\x07\xf4\xff\xf5\xff\x0b\0\xf7\xffL\x02\xfa\xff\xfb\xff\xfc\xff\xfd\xff\xfe\xff\x1f\x02\xf3\x053\x07d\x01s\x01h\x01\x85\x01v\x01\x9a\x01\xab\x01\xff\xff\xad\x01\xb0\x01\xbf\x01\xb9\x01\xbb\x01\xfd\x01\xe6\x01\xe6\x01\xea\x01\xf7\x01\xed\x01\xea\x01\t\x02\x13\x02\x13\x02\x0f\x02\x15\x02\x0b\x02\x07\x02\x8e\x06\x98\x06t\x07\xaa\x07\xb4\x07\xbe\x07\xc8\x07\xd2\x07\xf8\xffx\x02\xa7\x02\xfd\xff\xff\xff\xd8\x02R\x07\xdc\x07\xec\x02\xf4\x07:\bQ\bw\bL\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x9d\b\xfc\xff\xfd\xff\xe8\b\xff\xff\x87\x02x\x02\xfd\xffd\x02\xfe\xff\xb6\x02\xff\xff\x0b\x02\xff\xff\xcc\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff.\x02\xff\xff\xb2\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\x17\0\xff\xff\xb7\x02\xfc\xff\xfd\xff\xfe\xff\xff\xff\xbb\x02\xfd\xff\xfe\xff\xff\xffy\x02\xfd\xff\xfe\xff\xff\xff\xb8\x02\xfc\xff\xfd\xff\xfe\xff\x13\0\xff\xff","\xff\xff\xff\xff\xff\xff\x11\0\xff\xff\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x13\0\x13\0\x13\0\x13\0\x13\0\x13\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\t\0\xff\xff\t\0\xff\xff\xff\xff\x0e\0\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x04\0\x04\0\x04\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\0\0\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\x03\0\x05\0\x05\0\x05\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff\x03\0\xff\xff\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x02\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x10\0\xff\xff\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\x07\0\x07\0\xff\xff\x12\0\x12\0\x12\0\x12\0\x12\0\x12\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\b\0\xff\xff\b\0\xff\xff\b\0\xff\xff\xff\xff\r\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\t\0\xff\xff\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\x06\0\xff\xff\xff\xff\xff\xff\x01\0\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\x04\0\x03\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\0\xff\xff","\x01\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\x009\0<\0\0\0<\0\0\0\0\0A\0\0\0A\0\0\0\0\0F\0\0\0\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0T\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0^\0\0\0\0\0a\0\xff\xff\xff\xffa\0\xff\xff\xff\xff\xff\xff\xff\xffh\0\0\0\0\0\0\0\0\0m\0\0\0\0\0\0\0q\0\0\0\0\0\0\0u\0\0\0\0\0\0\0y\0\0\0\0\0\0\0\0\0\0\0~\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\x8a\0\0\0\x8e\0\0\0\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\x9a\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xb2\0\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\xff\xff\xbb\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc2\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xc9\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xeb\0\0\0\0\0\0\0\xef\0\0\0\0\0\xff\xff\0\0\xf4\0\0\0\0\0\xff\xff\0\0\xf9\0\0\0\0\0\0\0\xfd\0\0\0\0\0\0\0\xff\xff\0\0\x03\x01\0\0\0\0\0\0\0\0\b\x01\0\0\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\x11\x01\0\0\0\0\0\0\0\0\x16\x01\0\0\0\0\0\0\0\0\0\0\x1c\x01\0\0\0\0\0\0 \x01\0\0\0\0\0\0\xff\xff\0\0&\x01\0\0\0\0\0\0\0\0+\x01\0\0\0\0\0\0/\x01\0\0\0\0\0\0\0\x004\x01\0\0\0\0\0\x008\x01\0\0\0\0\0\0<\x01\0\0\0\0\0\0@\x01\0\0\0\0\0\0C\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0y\x01}\x01\0\0\0\0\x80\x01\xff\xff\xff\xff\x80\x01\xff\xff\xff\xff\xff\xff\xff\xff\x87\x01\0\0\0\0\0\0\0\0\x8c\x01\0\0\0\0\xff\xff\0\0\x90\x01\0\0\0\0\xff\xff\0\0\xff\xff\0\0\0\0\0\0\0\0\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\xc1\x01\xc5\x01\0\0\0\0\xc8\x01\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcf\x01\0\0\0\0\0\0\0\0\xd4\x01\0\0\0\0\xff\xff\0\0\xff\xff\xff\xff\0\0\xff\xff\0\0\xdc\x01\0\0\xff\xff\0\0\xe2\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xe9\x01\0\0\0\0\0\0\0\0\xff\xff\0\0\xf0\x01\0\0\0\0\0\0\0\0\xf5\x01\0\0\0\0\0\0\xf9\x01\0\0\0\0\0\0\xfc\x01\0\0\0\0\0\0\xff\xff\0\0","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x03\0\x04\0\0\0\x03\0\x03\0\x86\0\0\0\x03\0\0\0\x86\0E\x01\x92\x01\xff\xff\0\0E\x01\x92\x01\0\0\0\0\0\0\0\0\x7f\0\x8b\0\0\0\x03\0\0\0\f\0\x03\0\xaa\0\x86\0\xaf\0\0\0\x07\0\x0b\x01E\x01\x92\x01\x0e\x01\r\x001\0\x05\0\n\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\x008\0v\0\x06\0\x81\0\x82\x009\0\xed\x01\x89\0\0\x021\0\0\x000\0\x8a\0j\0>\0\x0e\0n\0i\0\0\x001\0\x0f\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1e\x000\0\b\0r\0\xd1\0\xec\0\0\x01\r\x01\x1d\0\x16\0\xff\xff0\x000\0\x11\0\x15\0\x19\0 \0!\0#\0\x17\0\x1b\0\x10\0\x1f\0\x1c\0\"\0\x13\0\x18\0\x12\0\x1a\0\x14\0$\0)\0%\x000\0\t\0*\0+\0,\0-\0.\0/\0=\0U\x000\0&\0'\0'\0'\0'\0'\0'\0'\0'\0'\x001\0C\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0V\0\x8f\0\xff\xff(\0\x90\0\x91\0\x92\x007\0\x94\x007\0\x95\x000\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0\xff\xff0\0\x96\0\x97\0\xa1\0B\0\x9e\x005\0\x9f\x005\0\xa0\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\0\xa5\x003\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa2\0\xa3\0\xa6\0]\0\xff\xff\x02\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xff\xffM\0g\0l\0t\0\x84\0\x86\0\x87\0\x80\0\x8b\0\x86\0\xa4\0]\0\xab\0M\0\xa7\0\xa8\0\xa9\0\xac\0p\0\xad\0\xae\0\xd2\0\xe2\0\xd0\0\xd3\0\xd4\0;\0S\0\x86\0\xd5\0\xd6\0\xd7\0\xd8\0\xda\0\x8d\0\xdb\0]\0\xdc\0\xdd\0{\0\xde\0\xdf\0\xe0\0\x88\0_\0\xe1\0#\x01A\x01\xea\0\x9b\0\x05\x01a\x01\xfa\0\xff\xff\xfe\x009\x01=\x01_\x01M\0,\x01\\\x01X\x01\t\x01\x1d\x01L\0|\0!\x01\x12\x01K\0b\0\x13\x01U\x01V\x01W\x01x\x01Y\x01J\0\xe1\x005\x01y\x01I\0Z\x01H\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0b\0q\x01z\0[\x01@\0\x04\x01]\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0\x9c\0p\x01^\x01`\x01b\x01c\x011\x01O\0O\0O\0O\0O\0O\0d\x01\x9d\0e\x01N\0N\0N\0N\0N\0N\0\xb7\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\x18\x01p\x01\xff\xff\x19\x01f\x01g\x01i\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0j\x01k\x010\x01(\x01l\x01m\x01n\x01P\0P\0P\0P\0P\0P\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0Q\0o\x01\x1b\x01\xff\xff\xab\x01\x1f\x01\xaa\x01\x17\x01Q\0Q\0Q\0Q\0Q\0Q\0\\\0\xa8\x01?\x01P\0P\0P\0P\0P\0P\0\xf8\0\xa5\x01\xfc\0\xa2\x01;\x01E\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0\xff\xffQ\0Q\0Q\0Q\0Q\0Q\0W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0X\0X\0X\0X\0'\x01*\x01\xff\xff\xa3\x01\xa4\x01x\0\x02\x01X\0X\0X\0X\0X\0X\0\xa6\x017\x01\x99\0W\0W\0W\0W\0W\0W\0\x07\x01\xa7\x01\xa4\x01\xa9\x01\x10\x01\xa4\x01Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\x003\x01X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0Z\0a\0\x89\x01\xa4\x01\xac\x01\xb9\x01\x88\x01\xad\x01Z\0Z\0Z\0Z\0Z\0Z\0a\0\xb3\0\xae\x01Y\0Y\0Y\0Y\0Y\0Y\0.\x01\xaf\x01\xb0\x01\xb4\0\xa4\x01\xb8\x01\xb5\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0|\x01Z\0Z\0Z\0Z\0Z\0Z\0\xc0\x01\xb2\x01\x15\x01\xb3\x01a\0\xc1\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xa4\x01\xd8\x01\xff\xffa\0\xb8\x01\xd8\x01\xd1\x01a\0\xdf\x01a\0\xd0\x01\xe6\x01\0\0a\0\xdb\x01%\x01\xd8\x01\xd9\x01\0\0\xdc\x01\xd8\x01a\0\0\0\0\0\xd8\x01a\0\0\0a\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xd8\x01\0\0~\x01\0\0\0\0\0\0\0\0c\0c\0c\0c\0c\0c\0a\0\0\0\xda\x01\xfa\x01\0\0\0\0a\0\0\0|\x01|\x01a\0\0\0\xdd\x01\0\0\xfd\x01\0\0\0\0\0\0a\0\xff\xff\0\0\xc4\x01a\0\0\0a\0`\0c\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xeb\x01\0\0\xf1\x01\0\0\xff\x01\xf2\x01\0\0d\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xf6\x01\x81\x01\x81\x01\xe4\x01\0\0\xc4\x01\0\0e\0e\0e\0e\0e\0e\0\0\0\xc6\x01\0\0d\0d\0d\0d\0d\0d\0\0\0\0\0\0\0\xc4\x01\xea\x01\x86\x01a\0a\0a\0a\0a\0a\0a\0a\0a\0a\0\0\0e\0e\0e\0e\0e\0e\0a\0a\0a\0a\0a\0a\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\0\0\0\0\xc9\x01\xb1\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xbc\0\0\0a\0a\0a\0a\0a\0a\0\xc9\x01\xe3\x01\0\0\xbf\0\xce\x01{\x01\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbd\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xc3\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc6\0\xff\xff\xf8\x01\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc4\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xca\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xcd\0\xff\xff\xff\xff\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe2\0\xc3\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\x01\0\0\0\0\xce\0\xdd\x01\xef\x01\xfe\x01\0\0\xcf\0\xf4\x01\0\0\xe1\0\xcb\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe8\0\0\0\xe8\0\0\0\xe1\x01\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xd9\0\xff\xff\0\0\0\0\0\0\0\0\xe1\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\0\0\0\0\0\0\0\0\xff\xff\0\0\0\0\xe6\0\0\0\xe6\0\0\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\0\0\xe4\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xba\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\0\0\0\0\0\0\0\0\0\0\xf1\0\0\0q\x01\0\0M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01\0\0p\x01\0\0\0\0\xc1\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0p\x01\0\0\0\0\0\0\xf0\0\xc8\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\0\0\xf6\0\0\0\0\0\xf0\0\0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xee\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\0\0\0\0\0\0\0\0\xf5\0\0\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0E\x01F\x01\0\0\0\0E\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0E\x01\0\0N\x01\0\0\0\0\0\0\0\0h\x01I\x01\0\0\0\0\0\0\0\0O\x01\0\0G\x01L\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01\0\0\0\0H\x01\0\0\0\0\0\0\0\0\0\0\xf3\0\0\0\0\0\0\0\0\0\0\0\0\0P\x01w\x01\0\0w\x01\0\0Q\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\0\0J\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01S\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0R\x01\0\0\0\0s\x01\0\0\0\0T\x01\0\0\0\0u\x01\0\0u\x01\0\0K\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\0\0s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\xb9\x01\0\0\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xb8\x01\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\0\0\0\0D\x01\x80\x01\x80\x01\x80\x01\x7f\x01\0\0\x80\x01\0\0\0\0\xb8\x01\0\0\0\0\0\0\0\0\x80\x01\0\0\0\0\0\0\x80\x01\0\0\x80\x01\x7f\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\0\0\0\0\0\0\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\0\0\0\0\0\0\0\0\0\0\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\0\0\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\xbf\x01\x8e\x01\xbf\x01\0\0\0\0\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\0\0\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x80\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\0\0\0\0\0\0\0\0\x8d\x01\0\0\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x92\x01\x93\x01\0\0\0\0\x92\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\x92\x01\0\0\x99\x01\0\0\0\0\0\0\0\0\xb1\x01\x96\x01\0\0\0\0\0\0\xc8\x01\x9c\x01\0\0\x94\x01\x9a\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\0\0\0\0\x95\x01\0\0\0\0\0\0\0\0\0\0\0\0\x8b\x01\0\0\0\0\0\0\0\0\0\0\x9d\x01\0\0\0\0\0\0\0\0\x9e\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc8\x01\0\0\x97\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\xbb\x01\0\0\xa0\x01\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\x9f\x01\xc8\x01\0\0\xc8\x01\xc7\x01\0\0\xa1\x01\0\0\0\0\0\0\0\0\0\0\0\0\x98\x01\0\0\0\0\0\0\0\0\xbd\x01\0\0\xbd\x01\0\0\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\x91\x01\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\0\0\0\0\0\0\xc8\x01\0\0\xc8\x01\xc7\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\0\0\0\0\0\0\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\0\0\xd6\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xc8\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\xd5\x01\0\0\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\xd3\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0","\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0\0\0\xff\xff\x03\0\0\0\x86\0\xff\xff\x03\0\xff\xff\x86\0E\x01\x92\x019\0\xff\xffE\x01\x92\x01\xff\xff\xff\xff\xff\xff\xff\xff}\0\x8a\0\xff\xff\0\0\xff\xff\0\0\x03\0\xa9\0\x86\0\xae\0\xff\xff\0\0\n\x01E\x01\x92\x01\f\x01\0\0\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x05\0s\0\0\0}\0\x81\0\x05\0\xec\x01\x88\0\xff\x01&\0\xff\xff\n\0\x88\0f\0:\0\0\0k\0f\0\xff\xff\x0b\0\0\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x0b\0\x1d\0&\0\0\0o\0\xd0\0\xe9\0\xff\0\f\x01\x0f\0\x11\0<\0\x0b\0\n\0\0\0\x14\0\x18\0\x1f\0 \0\"\0\x16\0\x1a\0\0\0\x0e\0\x1b\0!\0\x12\0\x17\0\0\0\x10\0\x13\0#\0(\0$\0&\0\0\0)\0*\0+\0,\0-\0.\0:\0R\0\x0b\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0\r\0'\0?\0'\0'\0'\0'\0'\0'\0'\0'\0'\0'\0U\0\x8c\0<\0\r\0\x8f\0\x90\0\x91\x000\0\x93\x000\0\x94\0'\x000\x000\x000\x000\x000\x000\x000\x000\x000\x000\x001\x001\x001\x001\x001\x001\x001\x001\x001\x001\x002\x002\x002\x002\x002\x002\x002\x002\x002\x002\0A\0'\0\x95\0\x96\0\x9c\0?\0\x9d\x003\0\x9e\x003\0\x9f\x002\x003\x003\x003\x003\x003\x003\x003\x003\x003\x003\x004\x004\x004\x004\x004\x004\x004\x004\x004\x004\x005\x005\x005\x005\x005\x005\x005\x005\x005\x005\0\x9b\x002\x006\x006\x006\x006\x006\x006\x006\x006\x006\x006\0\xa1\0\xa2\0\x9b\0[\0A\0\0\x007\x007\x007\x007\x007\x007\x007\x007\x007\x007\x009\0D\0f\0k\0s\0\x83\0\x85\0\x85\0}\0\x8a\0\x85\0\xa3\0^\0\xa5\0D\0\xa6\0\xa7\0\xa8\0\xab\0o\0\xac\0\xad\0\xce\0\xcb\0\xcf\0\xd2\0\xd3\0:\0R\0\x85\0\xd4\0\xd5\0\xd6\0\xd7\0\xd9\0\x8c\0\xda\0a\0\xdb\0\xdc\0w\0\xdd\0\xde\0\xdf\0\x85\0[\0\xcb\0\"\x01>\x01\xe9\0\x98\0\x01\x01P\x01\xf7\0<\0\xfb\x006\x01:\x01Q\x01D\0)\x01R\x01S\x01\x06\x01\x1a\x01D\0w\0\x1e\x01\x0f\x01D\0^\0\x0f\x01T\x01U\x01V\x01G\x01X\x01D\0\xcb\x002\x01G\x01D\0Y\x01D\0D\0G\0G\0G\0G\0G\0G\0G\0G\0G\0G\0a\0L\x01w\0Z\x01?\0\x01\x01\\\x01G\0G\0G\0G\0G\0G\0N\0N\0N\0N\0N\0N\0N\0N\0N\0N\0\x98\0L\x01]\x01_\x01a\x01b\x01-\x01N\0N\0N\0N\0N\0N\0c\x01\x98\0d\x01G\0G\0G\0G\0G\0G\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\xb4\0\x14\x01L\x01A\0\x14\x01e\x01f\x01h\x01N\0N\0N\0N\0N\0N\0O\0O\0O\0O\0O\0O\0O\0O\0O\0O\0i\x01j\x01-\x01$\x01k\x01l\x01m\x01O\0O\0O\0O\0O\0O\0P\0P\0P\0P\0P\0P\0P\0P\0P\0P\0n\x01\x1a\x01y\x01\x9d\x01\x1e\x01\x9e\x01\x14\x01P\0P\0P\0P\0P\0P\0[\0\x9f\x01>\x01O\0O\0O\0O\0O\0O\0\xf7\0\xa0\x01\xfb\0\xa1\x01:\x01D\0V\0V\0V\0V\0V\0V\0V\0V\0V\0V\0^\0P\0P\0P\0P\0P\0P\0V\0V\0V\0V\0V\0V\0W\0W\0W\0W\0W\0W\0W\0W\0W\0W\0$\x01)\x01a\0\xa2\x01\xa3\x01w\0\x01\x01W\0W\0W\0W\0W\0W\0\xa5\x016\x01\x98\0V\0V\0V\0V\0V\0V\0\x06\x01\xa6\x01\xa7\x01\xa8\x01\x0f\x01\xa9\x01X\0X\0X\0X\0X\0X\0X\0X\0X\0X\x002\x01W\0W\0W\0W\0W\0W\0X\0X\0X\0X\0X\0X\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0Y\0_\0\x85\x01\xaa\x01\xab\x01\x9a\x01\x85\x01\xac\x01Y\0Y\0Y\0Y\0Y\0Y\0_\0\xb0\0\xad\x01X\0X\0X\0X\0X\0X\0-\x01\xae\x01\xaf\x01\xb0\0\xb0\x01\x9a\x01\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0\xb0\0z\x01Y\0Y\0Y\0Y\0Y\0Y\0\x94\x01\xb1\x01\x14\x01\xb2\x01b\0\x94\x01\xb3\x01\xb4\x01\xb5\x01\xb6\x01\xb7\x01\xd8\x01\xc1\x01_\0\x9a\x01\xd8\x01\xcd\x01b\0\xde\x01_\0\xcd\x01\xe5\x01\xff\xff_\0\xda\x01$\x01\xd7\x01\xd7\x01\xff\xff\xda\x01\xd7\x01_\0\xff\xff\xff\xff\xd8\x01_\0\xff\xff_\0_\0`\0`\0`\0`\0`\0`\0`\0`\0`\0`\0\xd7\x01\xff\xffz\x01\xff\xff\xff\xff\xff\xff\xff\xff`\0`\0`\0`\0`\0`\0b\0\xff\xff\xd7\x01\xf7\x01\xff\xff\xff\xffb\0\xff\xff}\x01\x80\x01b\0\xff\xff\xdc\x01\xff\xff\xfb\x01\xff\xff\xff\xff\xff\xffb\0y\x01\xff\xff\xc2\x01b\0\xff\xffb\0b\0`\0`\0`\0`\0`\0`\0c\0c\0c\0c\0c\0c\0c\0c\0c\0c\0\xe7\x01\xff\xff\xee\x01\xff\xff\xfb\x01\xee\x01\xff\xffc\0c\0c\0c\0c\0c\0d\0d\0d\0d\0d\0d\0d\0d\0d\0d\0\xf3\x01}\x01\x80\x01\xe0\x01\xff\xff\xc5\x01\xff\xffd\0d\0d\0d\0d\0d\0\xff\xff\xc2\x01\xff\xffc\0c\0c\0c\0c\0c\0\xff\xff\xff\xff\xff\xff\xc8\x01\xe7\x01\x85\x01e\0e\0e\0e\0e\0e\0e\0e\0e\0e\0\xff\xffd\0d\0d\0d\0d\0d\0e\0e\0e\0e\0e\0e\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xb6\0\xff\xff\xff\xff\xc5\x01\xb0\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb8\0\xb9\0\xff\xffe\0e\0e\0e\0e\0e\0\xc8\x01\xe0\x01\xff\xff\xb9\0\xcd\x01z\x01\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xb9\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbe\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xbf\0\xc0\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc5\0\xc0\0\xc1\x01\xf7\x01\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc0\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc6\0\xc7\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xe2\0\xc7\0}\x01\x80\x01\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xc7\0\xcc\0\xc2\x01\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xcc\0\xe7\x01\xff\xff\xff\xff\xc7\0\xdc\x01\xee\x01\xfb\x01\xff\xff\xc7\0\xf3\x01\xff\xff\xcc\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xcd\0\xe1\0\xff\xff\xe1\0\xff\xff\xe0\x01\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xe1\0\xcd\0\xc5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xcc\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xe3\0\xff\xff\xff\xff\xff\xff\xff\xff\xc8\x01\xff\xff\xff\xff\xe4\0\xff\xff\xe4\0\xff\xff\xe3\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe4\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe5\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xe6\0\xff\xff\xe3\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xe7\0\xb9\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xe8\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xed\0\xff\xffM\x01\xff\xffM\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01M\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01q\x01\xff\xffM\x01\xff\xff\xff\xff\xc0\0\xff\xff\xff\xff\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0M\x01\xff\xff\xff\xff\xff\xff\xed\0\xc7\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xed\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xff\xff\xf2\0\xff\xff\xff\xff\xf0\0\xff\xff\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf0\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xf2\0\xed\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xff\xff\xff\xff\xff\xff\xff\xff\xf5\0\xff\xff\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0\xf5\0B\x01B\x01\xff\xff\xff\xffB\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01O\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xffO\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xffB\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01B\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf2\0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01p\x01\xff\xffp\x01\xff\xffB\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01p\x01\xff\xff\xff\xffB\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01r\x01B\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffB\x01\xff\xff\xff\xffr\x01\xff\xff\xff\xffB\x01\xff\xff\xff\xffs\x01\xff\xffs\x01\xff\xffB\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01s\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01t\x01\xff\xffr\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01u\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01v\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01w\x01\xff\xff~\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\x81\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x7f\x01\x9b\x01\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff~\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01~\x01\xff\xff\xff\xffB\x01~\x01\x81\x01~\x01~\x01\xff\xff\x81\x01\xff\xff\xff\xff\x9b\x01\xff\xff\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\xff\xff\xff\xff\x81\x01\xff\xff\x81\x01\x81\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\xff\xff\xff\xff\xff\xff\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\x82\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xff\xff\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x83\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\xb8\x01\x8a\x01\xb8\x01\xff\xff\xff\xff\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb8\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xb9\x01\xff\xff\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x84\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8a\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8d\x01\xff\xff\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8d\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\x9c\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x9c\x01\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\x8f\x01\xff\xff\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\x8f\x01\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8a\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xba\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\xff\xff\xc6\x01\xba\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xc6\x01\xff\xff\xff\xff\x8f\x01\xc6\x01\xff\xff\xc6\x01\xc6\x01\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xff\xff\xff\xff\xff\xff\xff\xff\xbb\x01\xff\xff\xbb\x01\xff\xff\xba\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbb\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbc\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbd\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbe\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xbf\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xc7\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\x8f\x01\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xff\xff\xff\xff\xc9\x01\xff\xff\xc9\x01\xc9\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xff\xff\xff\xff\xff\xff\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xca\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcb\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xcc\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd2\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xd5\x01\xff\xff\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xd5\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd2\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff",e,e,e,e,e,e],hC="lib/data_source/jellyfin_api.ml.user",hD="lib/data_source/jellyfin_api.ml.Authenticate_by_name.params",hE="lib/data_source/jellyfin_api.ml.Authenticate_by_name.response",hF="lib/data_source/jellyfin_api.ml.Item.genre_item",kr="lib/data_source/jellyfin_api.ml.Item.image_blur_hashes",D="lib/data_source/jellyfin_api.ml.Item.type_",hG="lib/data_source/jellyfin_api.ml.Item.t",hH="lib/data_source/jellyfin_api.ml.Virtual_folders.virtual_folder",fI="lib/db/generic_schema.ml.Id.t",hI="lib/db/generic_schema.ml.Collection.t",hJ="lib/db/generic_schema.ml.Genre.t",hK="lib/db/generic_schema.ml.Album.t",hL="lib/db/generic_schema.ml.Track.t",hM="lib/db/stores.ml.Items.sorts",hN="lib/db/stores.ml.Items.t",p5=[0,0,0];ch(11,mc,tP);ch(10,f,tD);ch(9,[B,tH,q9],tH);ch(8,ma,tu);ch(7,l$,u4);ch(6,a_,ue);ch(5,[B,r$,-6],r$);ch(4,[B,tn,-5],tn);ch(3,iE,s5);ch(2,dH,lI);ch(1,mb,tg);ch(0,iF,u5);var +v_=hU,v8="output_substring",v5=dv,v1=d8,v2=f7,vQ="Stdlib.Exit",vU=bs(0,0,32752),vW=bs(0,0,65520),vY=bs(1,0,32760),wc="CamlinternalLazy.Undefined",wj="option is None",wn=h2,wo="\\'",wp=h5,wq=ie,wr=hY,ws=hR,wl="Char.chr",wv=" is not an Unicode scalar value",wD="List.init",wA="hd",wR="String.blit / Bytes.blit_string",wQ="Bytes.blit",wP="String.sub / Bytes.sub",w8="String.contains_from / Bytes.contains_from",w3=e,w0="String.concat",xf="Array.iter2: arrays must have the same length",xd="Array.blit",xc="Array.sub",xa="Array.init",xr="Set.remove_min_elt",xs=[0,0,0,0],xt=[0,"set.ml",kZ,18],xn=hV,xo=hV,xp=hV,xq=hV,xz="Map.remove_min_elt",xA=[0,0,0,0],xB=[0,"map.ml",rD,10],xv=ig,xw=ig,xx=ig,xy=ig,xC="Stdlib.Stack.Empty",xG="Stdlib.Queue.Empty",xO="Buffer.add_substring/add_subbytes",xN="Buffer.add: cannot grow buffer",xL="Buffer.sub",xW="first domain already spawned",xT=[0,"domain.ml",184,13],x7=tk,x8=sO,x9=ug,x_=s1,x$=u8,ya=uc,yb="%f",yc="%B",yd="%{",ye="%}",yf="%(",yg="%)",yh=u7,yi="%t",yj="%?",yk="%r",yl="%_r",ym=[0,aS,qG,23],yx=[0,aS,ux,21],yp=[0,aS,rB,21],yy=[0,aS,q5,21],yq=[0,aS,tm,21],yz=[0,aS,tJ,19],yr=[0,aS,tp,19],yA=[0,aS,rQ,22],ys=[0,aS,ra,22],yB=[0,aS,sZ,30],yt=[0,aS,rq,30],yv=[0,aS,uj,26],yn=[0,aS,rR,26],yw=[0,aS,t6,28],yo=[0,aS,qI,28],yu=[0,aS,tS,23],zN=[0,aS,1558,4],zO="Printf: bad conversion %[",zP=[0,aS,1626,39],zQ=[0,aS,1649,31],zR=[0,aS,1650,31],zS="Printf: bad conversion %_",zT=ta,zU=rm,zV=ta,zW=rm,zZ=[0,[11,"invalid box description ",[3,0,0]],"invalid box description %S"],zY=[0,0,4],zI=kJ,zG="neg_infinity",zH=ti,zF=dv,zA=[0,hP],zo="%+nd",zp="% nd",zr="%+ni",zs="% ni",zt="%nx",zu="%#nx",zv="%nX",zw="%#nX",zx="%no",zy="%#no",zn="%nd",zq=u8,zz="%nu",za="%+ld",zb="% ld",zd="%+li",ze="% li",zf="%lx",zg="%#lx",zh="%lX",zi="%#lX",zj="%lo",zk="%#lo",y$="%ld",zc=s1,zl="%lu",yY="%+Ld",yZ="% Ld",y1="%+Li",y2="% Li",y3="%Lx",y4="%#Lx",y5="%LX",y6="%#LX",y7="%Lo",y8="%#Lo",yX="%Ld",y0=uc,y9="%Lu",yK="%+d",yL="% d",yN="%+i",yO="% i",yP="%x",yQ="%#x",yR=uL,yS="%#X",yT="%o",yU="%#o",yJ=kI,yM=ug,yV=q2,xZ="@]",x0="@}",x1="@?",x2="@\n",x3="@.",x4="@@",x5="@%",x6="@",yC="CamlinternalFormat.Type_mismatch",z4=e,z5=[0,[11,lx,[2,0,[2,0,0]]],", %s%s"],AF=[0,[11,lq,[2,0,[12,10,0]]],q6],AG=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],"Fatal error in uncaught exception handler: exception %s\n"],AE="Fatal error: out of memory in uncaught exception handler",AB=[0,[11,lq,[2,0,[12,10,0]]],q6],Av=[0,[2,0,[12,10,0]],"%s\n"],Aw=[0,[11,qR,0],qR],Ak="Raised at",Al="Re-raised at",Am="Raised by primitive operation at",An="Called from",Ao=[0,[12,32,[4,0,0,0,0]]," %d"],As=[0,[11,"s ",[4,0,0,0,[12,45,[4,0,0,0,0]]]],"s %d-%d"],Ap=" (inlined)",Ar=e,Aq=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,qt,[2,0,[11,sP,TR]]]]]]]]]],'%s %s in file "%s"%s, line%s, characters %d-%d'],At=[0,[2,0,[11," unknown location",0]],"%s unknown location"],Ad="Out of memory",Ae="Stack overflow",Af="Pattern matching failed",Ag="Assertion failed",Ah="Undefined recursive module",z7=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],z8=e,z9=e,z_=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],z3=[0,[4,0,0,0,0],kI],z1=[0,[3,0,0],"%S"],z2=sC,Ay=[0,e,"(Cannot print locations:\n bytecode executable program file not found)","(Cannot print locations:\n bytecode executable program file appears to be corrupt)","(Cannot print locations:\n bytecode executable program file has wrong magic number)","(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)"],AK="Fun.Finally_raised: ",AI="Stdlib.Fun.Finally_raised",AL="Digest.BLAKE2: wrong hash size",A3=bs(14371852,15349651,22696),A4=bs(12230193,11438743,35013),A5=bs(1424933,15549263,2083),A6=bs(9492471,4696708,43520),A2="Random.int",AP=bs(1,0,0),AQ=bs(0,0,0),AT=bs(1,0,0),AR=bs(0,0,0),AS=bs(2,0,0),Be="Hashtbl: unsupported hash table format",A_=e,BY=[3,0,3],BZ=dv,BT=tI,BU="<\/",BV=e,BP=tI,BQ="<",BR=e,BN="\n",BJ=e,BK=e,BL=e,BM=e,By=[0,e],Bt=e,Bu=e,Bv=e,Bw=e,Bp=[0,e,0,e],Bl="Stdlib.Format.String_tag",B7="Jsoo_runtime.Error.Exn",B8=kN,Ca=[0,ao,157,10],Cc=[0,ao,179,10],Ce=[0,ao,h$,10],Ch=[0,ao,lc,17],Cr=[0,ao,sA,16],Cs=[0,ao,sm,18],Ct=[0,ao,sv,15],Cu=[0,ao,sc,15],Cv=[0,ao,sK,15],Cw=[0,ao,sH,10],Cx=[0,ao,sV,16],Cy=[0,ao,u1,12],Cz=[0,ao,uZ,14],CK=[0,ao,tq,27],CJ=[0,ao,tK,27],CD=[0,ao,tw,16],CA=[0,ao,s7,23],CB=[0,ao,sb,14],Cq=[0,ao,s8,9],Cl=[0,ao,uH,9],Ck=[0,ao,uF,9],Cj=[0,[11,"Lwd: unsafe mutation (variable invalidated during evaluation) at\n",[15,0]],"Lwd: unsafe mutation (variable invalidated during evaluation) at\n%a"],Cg=[0,ao,lg,14],Cd=[0,ao,qW,14],Cb=[0,ao,169,14],B$=[0,ao,tC,14],CE="Lwd.Release_failure",CR=[0,M,64,12],C4=[0,M,tG,18],C3=[0,M,lc,9],C6=[0,M,f6,18],C5=[0,M,ia,9],C7=[0,M,eQ,21],C8=[0,M,c0,21],C9=[0,M,ru,21],C$=[0,M,rx,14],Dy=[0,M,tA,18],Dz=[0,M,sw,12],DA=[0,M,sL,14],Dx=[0,M,rH,21],Dv=[0,M,s0,14],Du=[0,M,tl,14],Ds=[0,M,tM,29],Dr=[0,M,ro,29],Dp=[0,M,qQ,21],Dk=[0,M,qv,10],Dl=[0,M,q0,15],Dm=[0,M,qK,10],Dn=[0,M,qA,2],Df=[0,M,rs,24],Dg=[0,M,rh,16],Dh=[0,M,uh,2],Dc=[0,M,qU,18],Db=[0,M,u9,9],C0=[0,M,sr,4],CZ=[0,M,lg,21],CX=[0,M,sY,4],CY=[0,M,177,14],CV=[0,M,113,14],CT=[0,M,82,21],CP=[0,M,32,14],D3=[0,bp,kZ,12],DO=[0,bp,sQ,37],DP=[0,bp,qx,37],DR=[0,bp,sN,10],DS=[0,bp,tc,8],DQ=[0,bp,s9,37],DU=[0,bp,ry,10],DV=[0,bp,rY,8],DT=[0,bp,u6,37],DY=[0,bp,tB,16],D1=[0,bp,uz,50],DZ=[0,bp,ss,6],DX=[0,bp,sh,14],DG=[0,bp,sY,57],DH=[0,bp,182,57],DI=[0,bp,tZ,11],DB=ri,DC=ri,Et=[0,"src/fut.ml",34,25],Ft="debug",Fr="warn",Fp=lt,Fo="log",E_="scrollTop",ER="search",EL=[0,1],EJ=u3,Fx="isSecureContext",FF="cache",FG="credentials",FH="headers",FI="integrity",FJ="keepalive",FK="method",FL="mode",FM="redirect",FN="referrer",FO="referrerPolicy",F_=[0,s_,lm,16],F8=[0,s_,uf,16],F3=[0,0,0],F1=[0,0,0],GF=e,GE=e,Gu=[0,[0,bh,uw],0],Gv=[0,[0,bh,kR],[0,cE,0]],Gw=[0,[0,bh,hT],[0,cE,0]],Gx=[0,[0,bh,kW],[0,cE,0]],Gy=[0,[0,bh,ll],[0,cE,0]],Gz=[0,[0,bh,k4],[0,cE,0]],GA=[0,[0,bh,kP],[0,cE,0]],GB=[0,[0,bh,k3],[0,cE,0]],GC=[0,[0,bh,uw],[0,cE,0]],Gl=[0,[0,bh,kR],0],Gm=[0,[0,bh,hT],0],Gn=[0,r3,0],Go=[0,[0,bh,kW],0],Gp=[0,[0,bh,ll],0],Gq=[0,[0,bh,k4],0],Gr=[0,[0,bh,kP],0],Gs=[0,cE,0],Gt=[0,[0,bh,k3],0],Gj=[0,[11,"\x1b[",[4,0,0,0,[12,109,0]]],"\x1b[%dm"],Gk="CCFormat.ANSI_codes.No_such_style",GG="CCFormat.Style",GS="CCResult.Get_error",G1="CCFQueue.Empty",G2=[0,0],G$="content-box",Ha="border-box",Hb="device-pixel-content-box",Hk=uq,Hl=sa,Hm="position",Hg="Set metadata",Hq="unique",HD="not implemented",HA=[0,[8,[0,0,0],0,0,[11,tQ,0]],"%fpx"],HB=[0,[8,[0,0,0],0,0,[11,to,0]],"%frem"],HC=[0,[8,[0,0,0],0,0,[11,qS,0]],"%fem"],Hx=tQ,Hy=to,Hz=qS,HF="Common.Utils.Forward_ref.Not_set",HH="Common.Utils.Forward_ref.Already_set",HL=[1,[0,r8,q_]],HN=[1,-358247754],HS=e,HR=[0,[12,91,[2,0,[11,"] ",[2,0,0]]]],"[%s] %s"],HX="TODO not implemented",H2=[0,80,ud],H5=[0,80,[0,"lwdui-controlled-scroll-wrapper"]],H6=[0,80,"lwdui-controlled-scroll-controls"],H7="Show playing",Id=qH,Ia=e,Ib="password",H9=e,H_=lo,Ii=[0,80,lo],If=[0,[2,0,[11,ts,0]],rf],Ig=[0,[2,0,0],sO],Ik=[0,80,lo],Ij=[0,[2,0,[11,ts,0]],rf],Io=[0,[2,0,[11,"-id",0]],"%s-id"],Ip=[0,80,"checkbox"],Im=[0,[2,0,[12,45,[4,3,0,0,[12,45,[4,3,0,0,0]]]]],"%s-%i-%i"],IA=[0,[11,rr,[2,0,0]],"height: %s"],Iw=[0,[2,0,[12,32,[2,0,0]]],"%s %s"],Iu="grid-template-columns",Iv=[0,[2,0,[11,hX,[2,0,[12,59,0]]]],"%s: %s;"],Ix=e,IB=[1,4.],IJ=[0,80,rM],IH="Row height",II="Visible height:",IF=[0,[11,"height: calc(",[2,0,[11," * ",[4,3,0,0,[11,");",0]]]]],"height: calc(%s * %i);"],IG=[0,[11,rr,[2,0,[11," !important;",0]]],"height: %s !important;"],IK=[0,80,[0,"lwdui-lazy-table-content"]],IL=[0,80,[0,"lwdui-lazy-table-content-wrapper"]],IM=[0,"lwdui-lazy-table",0],IC="virtual table",IQ="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",I3=[0,[17,[0,sF,1,0],0],sF],I2=[0,[12,32,0],bG],I1=[0,[11,rS,0],rS],I4=[0,[15,[4,6,0,[0,2],[15,0]]],"%a%.2x%a"],IW=[0,[11,t8,[15,[11,tL,[15,[11," dst-off=",[4,0,0,0,[11,kG,[4,0,0,0,0]]]]]]]],"Cstruct.blit_from_string src=%a dst=%a dst-off=%d len=%d"],IU=[0,[11,t8,[15,[11,tL,[15,[11," src-off=",[4,0,0,0,[11,kG,[4,0,0,0,0]]]]]]]],"Cstruct.blit_from_string src=%a dst=%a src-off=%d len=%d"],IS=[0,[12,91,[4,0,0,0,[12,93,0]]],"[%d]"],IR=[0,[12,91,[4,0,0,0,[12,44,[4,0,0,0,[11,"](",[4,0,0,0,[12,41,0]]]]]]],"[%d,%d](%d)"],I5=[0,[17,3,[15,[17,4,0]]],"@\n%a@."],I6=e,JC=[0,[8,[0,0,0],0,[0,0],0],qu],Jl=[0,[12,44,0],le],Js=[0,[15,[12,58,[15,0]]],"%a:%a"],Jr=[0,[12,44,0],le],Jk=[0,[11,fY,0],fY],Jn=[0,[11,d8,0],d8],Jo=[0,[11,f7,0],f7],Jp=[0,[8,[0,0,0],0,[0,0],0],qu],Jq=[0,[8,[0,0,3],0,0,0],"%g"],Jt=[0,[12,eW,[15,[12,e2,0]]],"{%a}"],Jm=[0,[12,91,[15,[12,93,0]]],"[%a]"],Ju=[0,[12,44,[17,[0,a,1,0],0]],qV],Jy=[0,[18,[1,[0,[11,eO,0],eO]],[15,[12,58,[17,[0,a,1,0],[15,[17,0,0]]]]]],"@[%a:@ %a@]"],Jx=[0,[12,44,[17,[0,a,1,0],0]],qV],Jz=[0,[18,[1,[0,[11,eO,0],eO]],[11,"{ ",[15,[11," }",[17,0,0]]]]],"@[{ %a }@]"],JA=[0,[11,uo,0],uo],Jv=[0,[18,[1,[0,[11,eO,0],eO]],[11,"[ ",[15,[11," ]",[17,0,0]]]]],"@[[ %a ]@]"],Jw=[0,[11,uV,0],uV],I$=[0,[12,34,0],dw],Jd=[0,[0,0],tk],Jc=[0,[11,h2,0],h2],Jf=[0,[11,h5,0],h5],Jg=[0,[11,ie,0],ie],Jh=[0,[11,hY,0],hY],Ji=[0,[11,hR,0],hR],Jb=[0,[11,lC,0],lC],Je=[0,[11,"\\u",[4,6,[0,2,4],0,0]],"\\u%04x"],Ja=[0,[12,34,0],dw],J0=[0,fZ,rN,9],JT=[0,e4,ln],JO=[0,f0,ln],JU=[0,dt,ln],JS=[0,dt,fT],JP=[0,f0,fT],JQ=[0,fZ,153,55],JR=[0,dt,fT],JV=[0,fZ,tC,55],JW=[0,fZ,154,55],JX=[0,dt,cH],JM=[0,fZ,lr,9],JE=[0,[11,"invalid bounds (index ",[4,0,0,0,[11,", length ",[4,0,0,0,[12,41,0]]]]],"invalid bounds (index %d, length %d)"],JL=[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0],Ld=[0,bW,[0,bx,1]],Le=[0,bW,cW],Lf=[0,bW,[0,bx,0]],Lh=[0,bW,fU],Lg=[0,bW,d6],Ls=[0,li,s6,27],Lm=[0,bW,rZ],Lj=[0,bW,uO],Lb=[0,li,uB,8],La=[0,li,tO,45],KI=[0,[18,[1,[0,0,e]],[11,eS,[17,[0,a,1,0],[11,"initial",[17,[0,a,1,0],[11,"BOM",[17,[0,a,1,0],[11,k9,[17,[0,a,1,0],[11,hQ,TS]]]]]]]]]],"@[illegal@ initial@ BOM@ in@ character@ stream@]"],KJ=[0,[18,[1,[0,0,e]],[11,eS,[17,[0,a,1,0],[11,"escape,",[17,[0,a,1,0],0]]]]],"@[illegal@ escape,@ "],KL=[0,[15,[17,[0,a,1,0],[11,kQ,[17,[0,a,1,0],[11,"an",[17,[0,a,1,0],[11,"escaped",[17,[0,a,1,0],[11,hQ,[17,0,0]]]]]]]]]],"%a@ not@ an@ escaped@ character@]"],KM=[0,[15,[17,[0,a,1,0],[11,rg,[17,[0,a,1,0],[11,t7,[17,[0,a,1,0],[11,lb,[17,0,0]]]]]]]],"%a@ lone@ low@ surrogate@]"],KN=[0,[15,[17,[0,a,1,0],[11,rg,[17,[0,a,1,0],[11,"high",[17,[0,a,1,0],[11,lb,[17,0,0]]]]]]]],"%a@ lone@ high@ surrogate@]"],KO=[0,[15,[17,[0,a,1,0],[11,kQ,[17,[0,a,1,0],[12,97,[17,[0,a,1,0],[11,"hex",[17,[0,a,1,0],[11,"digit",[17,0,0]]]]]]]]]],"%a@ not@ a@ hex@ digit@]"],KK=[0,[15,[17,[0,a,1,0],[11,kQ,[17,[0,a,1,0],[12,97,[17,[0,a,1,0],[11,t7,[17,[0,a,1,0],[11,lb,[17,0,0]]]]]]]]]],"%a@ not@ a@ low@ surrogate@]"],KP=[0,[18,[1,[0,0,e]],[11,eS,[17,[0,a,1,0],[11,"bytes",[17,[0,a,1,0],[11,k9,[17,[0,a,1,0],[11,hQ,[17,[0,a,1,0],[11,rd,TT]]]]]]]]]],"@[illegal@ bytes@ in@ character@ stream@ ("],KQ=[0,[4,8,[0,2,2],0,0],"%02X"],KS=[0,[12,32,[4,8,[0,2,2],0,0]]," %02X"],KR=[0,[12,41,[17,0,0]],")@]"],KT=[0,[18,[1,[0,0,e]],[11,"expected",[17,[0,a,1,0],0]]],"@[expected@ "],KU=[0,[11,t0,[17,[0,a,1,0],[11,bj,[17,0,0]]]],"member@ name@]"],KV=[0,[11,ij,[17,[0,a,1,0],[11,"text (JSON value)",[17,0,0]]]],"JSON@ text (JSON value)@]"],KW=[0,[11,bj,[17,[0,a,1,0],[11,kV,[17,[0,a,1,0],[11,"(':')",[17,0,0]]]]]],"name@ separator@ (':')@]"],KX=[0,[11,fS,[17,[0,a,1,0],[11,"of",[17,[0,a,1,0],[11,hU,[17,0,0]]]]]],"end@ of@ input@]"],KY=[0,[11,"JavaScript",[17,[0,a,1,0],[11,sk,[17,0,0]]]],"JavaScript@ comment@]"],KZ=[0,[11,ij,[17,[0,a,1,0],[11,cV,[17,0,0]]]],"JSON@ value@]"],K0=[0,[11,t0,[17,[0,a,1,0],[11,bj,[17,[0,a,1,0],[11,du,[17,[0,a,1,0],[11,im,[17,[0,a,1,0],[11,fS,[17,TV,TU]]]]]]]]]],"member@ name@ or@ object@ end@ ('\"'@ or@ '}')@]"],K1=[0,[11,cV,[17,[0,a,1,0],[11,kV,[17,[0,a,1,0],[11,du,[17,[0,a,1,0],[11,im,[17,[0,a,1,0],[11,fS,[17,TX,TW]]]]]]]]]],"value@ separator@ or@ object@ end@ (','@ or@ '}')@]"],K2=[0,[11,cV,[17,[0,a,1,0],[11,du,[17,[0,a,1,0],[11,id,[17,[0,a,1,0],[11,fS,[17,[0,a,1,0],[11,"(value",[17,TZ,TY]]]]]]]]]],"value@ or@ array@ end@ (value@ or@ ']')@]"],K3=[0,[11,cV,[17,[0,a,1,0],[11,kV,[17,[0,a,1,0],[11,du,[17,[0,a,1,0],[11,id,[17,[0,a,1,0],[11,fS,[17,T1,T0]]]]]]]]]],"value@ separator@ or@ array@ end@ (','@ or@ ']')@]"],K4=[0,[18,[1,[0,0,e]],[11,eS,[17,[0,a,1,0],[11,"number",[17,[0,a,1,0],[12,40,[2,0,[12,41,[17,0,0]]]]]]]]],"@[illegal@ number@ (%s)@]"],K_=[0,[18,[1,[0,0,e]],[11,eS,[17,[0,a,1,0],[11,"literal",[17,[0,a,1,0],[12,40,[2,0,[12,41,[17,0,0]]]]]]]]],"@[illegal@ literal@ (%s)@]"],K$=[0,[18,[1,[0,0,e]],[11,eS,[17,[0,a,1,0],[11,hQ,[17,[0,a,1,0],[11,k9,[17,[0,a,1,0],[11,ij,[17,[0,a,1,0],[11,k6,T2]]]]]]]]]],"@[illegal@ character@ in@ JSON@ string@ (%a)@]"],K5=[0,[18,[1,[0,0,e]],[11,"unclosed",[17,[0,a,1,0],0]]],"@[unclosed@ "],K6=[0,[11,im,[17,0,0]],"object@]"],K7=[0,[11,id,[17,0,0]],"array@]"],K8=[0,[11,sk,[17,0,0]],"comment@]"],K9=[0,[11,k6,[17,0,0]],"string@]"],KG=[0,[12,39,[2,0,[11,"' (",[15,[12,41,0]]]]],"'%s' (%a)"],KF=[0,[11,"U+",[4,8,[0,2,4],0,0]],"U+%04X"],Kk=[0,ag,-543455433],Kr=[0,ag,[0,fP,eR]],Ks=[0,ag,[0,fP,n]],Kt=[0,ag,[0,fP,fU]],Ku=[0,ag,[0,fP,d6]],Kx=[0,ag,[0,cq,eR]],Ky=[0,ag,[0,cq,h4]],Kz=[0,ag,[0,cq,uE]],KA=[0,ag,[0,cq,[0,uD,1]]],KB=[0,ag,[0,cq,[0,uD,0]]],KC=[0,ag,[0,cq,[0,kM,1]]],KD=[0,ag,[0,cq,[0,kM,0]]],KE=[0,ag,[0,cq,rp]],LM="not a valid JSON array/object",LJ=[0,[11,"JSON.of_buffer ",[2,0,0]],"JSON.of_buffer %s"],LE=[0,[11,bZ,0],bZ],LF=[0,[11,"Unexpected input when parsing a ",[2,0,0]],"Unexpected input when parsing a %s"],LG=[0,[15,0],u7],LD="We expected a well-formed JSON document (array or object)",Ly=cV,Lz="object fields",Lw=[0,"lib/ezjsonm.ml",61,19],Lx=[0,h1,357123046],Lv="Abort",LA="Ezjsonm.Parse_error",LO=iy([[0,lH,x],[0,sr,x],[0,194,x],[0,195,x],[0,196,x],[0,ur,x],[0,198,fQ],[0,lg,az],[0,200,E],[0,uf,E],[0,202,E],[0,203,E],[0,tO,U],[0,tG,U],[0,206,U],[0,207,U],[0,208,ai],[0,209,an],[0,210,q],[0,uB,q],[0,212,q],[0,213,q],[0,214,q],[0,216,q],[0,217,A],[0,lc,A],[0,219,A],[0,220,A],[0,221,aM],[0,222,lh],[0,rX,N],[0,f6,v],[0,225,v],[0,226,v],[0,227,v],[0,228,v],[0,229,v],[0,230,cX],[0,231,aN],[0,232,d],[0,lm,d],[0,234,d],[0,235,d],[0,236,L],[0,ia,L],[0,tZ,L],[0,sD,L],[0,eQ,Z],[0,241,_],[0,242,c],[0,243,c],[0,dx,c],[0,tF,c],[0,d4,c],[0,B,c],[0,249,s],[0,c0,s],[0,251,s],[0,eZ,s],[0,kO,ay],[0,d9,f1],[0,ds,ay],[0,cG,x],[0,uk,v],[0,258,x],[0,259,v],[0,ru,x],[0,261,v],[0,262,az],[0,263,aN],[0,264,az],[0,265,aN],[0,r4,az],[0,267,aN],[0,268,az],[0,269,aN],[0,270,ai],[0,qz,Z],[0,272,ai],[0,uG,Z],[0,274,E],[0,275,d],[0,276,E],[0,277,d],[0,278,E],[0,279,d],[0,280,E],[0,281,d],[0,282,E],[0,283,d],[0,284,am],[0,285,T],[0,286,am],[0,287,T],[0,288,am],[0,289,T],[0,sf,am],[0,291,T],[0,t4,aA],[0,293,S],[0,294,aA],[0,295,S],[0,rx,U],[0,sp,L],[0,298,U],[0,299,L],[0,300,U],[0,301,L],[0,302,U],[0,303,L],[0,304,U],[0,uF,L],[0,306,"IJ"],[0,307,"ij"],[0,308,ce],[0,uH,by],[0,310,aE],[0,311,aT],[0,312,"kra"],[0,313,ad],[0,314,C],[0,qU,ad],[0,316,C],[0,u9,ad],[0,318,C],[0,319,ad],[0,320,C],[0,sQ,ad],[0,qx,C],[0,323,an],[0,324,_],[0,325,an],[0,326,_],[0,327,an],[0,328,_],[0,329,_],[0,330,"NG"],[0,331,f2],[0,332,q],[0,333,c],[0,s8,q],[0,335,c],[0,336,q],[0,s9,c],[0,u6,r_],[0,339,c4],[0,340,ae],[0,341,o],[0,342,ae],[0,343,o],[0,344,ae],[0,345,o],[0,sN,X],[0,347,N],[0,348,X],[0,349,N],[0,350,X],[0,351,N],[0,352,X],[0,353,N],[0,354,aG],[0,355,ah],[0,356,aG],[0,357,ah],[0,tc,aG],[0,359,ah],[0,360,A],[0,361,s],[0,sV,A],[0,rN,s],[0,364,A],[0,365,s],[0,366,A],[0,sA,s],[0,sm,A],[0,369,s],[0,370,A],[0,rs,s],[0,sv,aX],[0,373,a8],[0,374,aM],[0,ry,ay],[0,376,aM],[0,sc,ap],[0,378,Y],[0,379,ap],[0,380,Y],[0,381,ap],[0,382,Y],[0,sK,N],[0,rY,aL],[0,385,aV],[0,sH,aV],[0,387,aL],[0,388,rn],[0,389,rn],[0,390,q],[0,rh,az],[0,392,aN],[0,393,ai],[0,uh,ai],[0,sh,ai],[0,396,Z],[0,s6,Z],[0,398,E],[0,399,E],[0,400,E],[0,401,bo],[0,402,b$],[0,403,am],[0,404,am],[0,405,sl],[0,406,U],[0,407,U],[0,rD,aE],[0,409,aT],[0,410,C],[0,411,C],[0,412,bi],[0,413,an],[0,414,_],[0,415,q],[0,416,q],[0,417,c],[0,418,"OI"],[0,419,"oi"],[0,qv,aW],[0,421,bw],[0,422,"YR"],[0,q0,k8],[0,424,k8],[0,tB,rF],[0,426,c2],[0,427,ah],[0,428,aG],[0,429,ah],[0,430,aG],[0,431,A],[0,432,s],[0,433,A],[0,434,bq],[0,qK,aM],[0,436,ay],[0,437,ap],[0,438,Y],[0,439,ap],[0,440,ap],[0,441,Y],[0,442,Y],[0,443,k8],[0,444,tf],[0,445,tf],[0,446,bX],[0,447,a8],[0,448,cr],[0,449,cr],[0,450,cr],[0,451,cr],[0,452,uu],[0,453,ai],[0,454,cc],[0,455,"LJ"],[0,456,ad],[0,qA,"lj"],[0,458,"NJ"],[0,uZ,an],[0,460,"nj"],[0,461,x],[0,qQ,v],[0,463,U],[0,464,L],[0,465,q],[0,466,c],[0,467,A],[0,468,s],[0,469,A],[0,470,s],[0,471,A],[0,472,s],[0,473,A],[0,474,s],[0,475,A],[0,476,s],[0,477,d],[0,478,x],[0,479,v],[0,ss,x],[0,481,v],[0,482,fQ],[0,483,cX],[0,484,am],[0,485,T],[0,486,am],[0,487,T],[0,488,aE],[0,489,aT],[0,490,q],[0,491,c],[0,tM,q],[0,493,c],[0,494,ap],[0,495,Y],[0,496,by],[0,497,uu],[0,498,ai],[0,ro,cc],[0,500,am],[0,501,T],[0,502,"HW"],[0,503,aX],[0,504,an],[0,505,_],[0,506,x],[0,507,v],[0,508,fQ],[0,509,cX],[0,510,q],[0,511,c],[0,h_,x],[0,uz,v],[0,514,x],[0,515,v],[0,516,E],[0,u1,d],[0,518,E],[0,519,d],[0,520,U],[0,521,L],[0,522,U],[0,tl,L],[0,524,q],[0,525,c],[0,526,q],[0,527,c],[0,528,ae],[0,529,o],[0,530,ae],[0,s0,o],[0,532,A],[0,533,s],[0,534,A],[0,535,s],[0,536,X],[0,537,N],[0,rH,aG],[0,539,ah],[0,540,"GH"],[0,541,"gh"],[0,542,aA],[0,543,S],[0,sb,an],[0,545,Z],[0,sL,"OU"],[0,547,kT],[0,548,ap],[0,549,Y],[0,s7,x],[0,551,v],[0,552,E],[0,tA,d],[0,554,q],[0,555,c],[0,556,q],[0,sw,c],[0,558,q],[0,559,c],[0,tw,q],[0,561,c],[0,562,aM],[0,563,ay],[0,564,C],[0,565,_],[0,566,ah],[0,567,by],[0,568,"db"],[0,569,"qp"],[0,570,x],[0,kZ,az],[0,572,aN],[0,573,ad],[0,574,aG],[0,575,N],[0,576,Y],[0,577,rO],[0,578,bX],[0,579,aV],[0,580,A],[0,581,bq],[0,582,E],[0,583,d],[0,584,ce],[0,585,by],[0,586,b1],[0,587,dr],[0,588,ae],[0,589,o],[0,590,aM],[0,591,ay],[0,592,v],[0,593,v],[0,594,v],[0,595,aL],[0,596,c],[0,597,aN],[0,598,Z],[0,599,Z],[0,600,d],[0,601,d],[0,602,d],[0,603,d],[0,604,d],[0,605,d],[0,606,d],[0,607,by],[0,608,T],[0,609,T],[0,610,T],[0,611,T],[0,612,ua],[0,613,S],[0,614,S],[0,615,S],[0,616,L],[0,617,L],[0,618,L],[0,619,C],[0,620,C],[0,621,C],[0,622,eY],[0,623,aY],[0,624,aY],[0,625,aY],[0,626,_],[0,627,_],[0,628,_],[0,629,c],[0,630,c4],[0,631,c],[0,632,kU],[0,633,o],[0,634,o],[0,635,o],[0,636,o],[0,637,o],[0,638,o],[0,639,o],[0,640,o],[0,641,o],[0,642,N],[0,643,c2],[0,644,by],[0,645,"{squat}"],[0,646,c2],[0,647,ah],[0,648,ah],[0,649,s],[0,650,s],[0,tK,aZ],[0,652,aZ],[0,653,a8],[0,654,ay],[0,655,ay],[0,656,Y],[0,657,Y],[0,658,Y],[0,659,Y],[0,660,rO],[0,661,"{voiced}"],[0,662,bX],[0,663,aN],[0,664,cr],[0,665,aL],[0,666,d],[0,667,T],[0,668,S],[0,669,by],[0,670,aT],[0,671,C],[0,672,dr],[0,673,bX],[0,674,bX],[0,675,cc],[0,676,cc],[0,677,cc],[0,678,bX],[0,679,ih],[0,680,rA],[0,681,lG],[0,682,ub],[0,683,eY],[0,684,"{percussive}"],[0,685,"{bipercussive}"],[0,tq,S],[0,687,S],[0,688,S],[0,689,S],[0,690,by],[0,691,o],[0,692,o],[0,693,o],[0,694,o],[0,695,a8],[0,696,ay],[0,736,T],[0,737,C],[0,738,N],[0,739,bY],[0,740,bX],[0,768,e],[0,769,e],[0,770,e],[0,771,e],[0,772,e],[0,773,e],[0,774,e],[0,775,e],[0,776,e],[0,777,e],[0,778,e],[0,779,e],[0,780,e],[0,781,e],[0,782,e],[0,783,e],[0,784,e],[0,785,e],[0,786,e],[0,787,e],[0,788,e],[0,789,e],[0,790,e],[0,791,e],[0,792,e],[0,793,e],[0,794,e],[0,795,e],[0,796,e],[0,797,e],[0,798,e],[0,799,e],[0,800,e],[0,801,e],[0,802,e],[0,803,e],[0,804,e],[0,805,e],[0,806,e],[0,807,e],[0,808,e],[0,809,e],[0,810,e],[0,811,e],[0,812,e],[0,813,e],[0,ux,e],[0,rB,e],[0,816,e],[0,817,e],[0,q5,e],[0,tm,e],[0,820,e],[0,821,e],[0,tJ,e],[0,tp,e],[0,824,e],[0,825,e],[0,rQ,e],[0,ra,e],[0,828,e],[0,829,e],[0,830,e],[0,sZ,e],[0,rq,e],[0,833,e],[0,834,e],[0,835,e],[0,uj,e],[0,rR,e],[0,838,e],[0,839,e],[0,840,e],[0,841,e],[0,842,e],[0,843,e],[0,844,e],[0,845,e],[0,t6,e],[0,qI,e],[0,848,e],[0,849,e],[0,qG,e],[0,tS,e],[0,852,e],[0,853,e],[0,854,e],[0,855,e],[0,856,e],[0,857,e],[0,858,e],[0,859,e],[0,860,e],[0,861,e],[0,862,e],[0,863,e],[0,864,e],[0,865,e],[0,866,e],[0,867,e],[0,868,e],[0,869,e],[0,870,e],[0,871,e],[0,872,e],[0,873,e],[0,874,e],[0,875,e],[0,876,e],[0,877,e],[0,878,e],[0,879,e],[0,1155,e],[0,1156,e],[0,1157,e],[0,1158,e],[0,1159,e],[0,1160,e],[0,1161,e],[0,2027,e],[0,2028,e],[0,2029,e],[0,2030,e],[0,2031,e],[0,2032,e],[0,2033,e],[0,2034,e],[0,2035,e],[0,3072,e],[0,3076,e],[0,3315,e],[0,3328,e],[0,4957,e],[0,4958,e],[0,4959,e],[0,6783,e],[0,6832,e],[0,6833,e],[0,6834,e],[0,6835,e],[0,6836,e],[0,6837,e],[0,6838,e],[0,6839,e],[0,6840,e],[0,6841,e],[0,6842,e],[0,6843,e],[0,6844,e],[0,6845,e],[0,6846,e],[0,6847,e],[0,6848,e],[0,6849,e],[0,6850,e],[0,6851,e],[0,6852,e],[0,6853,e],[0,6854,e],[0,6855,e],[0,6856,e],[0,6857,e],[0,6858,e],[0,6859,e],[0,6860,e],[0,6861,e],[0,6862,e],[0,6863,e],[0,6864,e],[0,6865,e],[0,6866,e],[0,6867,e],[0,6868,e],[0,6869,e],[0,6870,e],[0,6871,e],[0,6872,e],[0,6873,e],[0,6874,e],[0,6875,e],[0,6876,e],[0,6877,e],[0,6878,e],[0,6879,e],[0,6880,e],[0,6881,e],[0,6882,e],[0,6883,e],[0,6884,e],[0,6885,e],[0,6886,e],[0,6887,e],[0,6888,e],[0,6889,e],[0,6890,e],[0,6891,e],[0,6892,e],[0,6893,e],[0,6894,e],[0,6895,e],[0,6896,e],[0,6897,e],[0,6898,e],[0,6899,e],[0,6900,e],[0,6901,e],[0,6902,e],[0,6903,e],[0,6904,e],[0,6905,e],[0,6906,e],[0,6907,e],[0,6908,e],[0,6909,e],[0,6910,e],[0,6911,e],[0,7019,e],[0,7020,e],[0,7021,e],[0,7022,e],[0,7023,e],[0,7024,e],[0,7025,e],[0,7026,e],[0,7027,e],[0,7424,v],[0,7425,cX],[0,7426,cX],[0,7427,aL],[0,7428,aN],[0,7429,Z],[0,7430,Z],[0,7431,d],[0,7432,d],[0,7433,L],[0,7434,by],[0,7435,aT],[0,7436,C],[0,7437,aY],[0,7438,_],[0,7439,c],[0,7440,c],[0,7441,c],[0,7442,c],[0,7443,c],[0,7444,c4],[0,7445,kT],[0,7446,c],[0,7447,c],[0,7448,bw],[0,7449,o],[0,7450,o],[0,7451,ah],[0,7452,s],[0,7453,s],[0,7454,s],[0,7455,aY],[0,7456,aZ],[0,7457,a8],[0,7458,Y],[0,7459,Y],[0,7460,"{spirant}"],[0,7461,c],[0,7468,v],[0,7469,cX],[0,7470,aL],[0,7471,aL],[0,7472,Z],[0,7473,d],[0,7474,d],[0,7475,T],[0,7476,S],[0,7477,L],[0,7478,by],[0,7479,aT],[0,7480,C],[0,7481,aY],[0,7482,_],[0,7483,_],[0,7484,c],[0,7485,kT],[0,7486,bw],[0,7487,o],[0,7488,ah],[0,7489,s],[0,7490,a8],[0,7491,v],[0,7492,v],[0,7493,v],[0,7494,cX],[0,7495,aL],[0,7496,Z],[0,7497,d],[0,7498,d],[0,7499,d],[0,7500,d],[0,7501,T],[0,7502,L],[0,7503,aT],[0,7504,aY],[0,7505,f2],[0,7506,c],[0,7507,c],[0,7508,c],[0,7509,c],[0,7510,bw],[0,7511,ah],[0,7512,s],[0,7513,s],[0,7514,aY],[0,7515,aZ],[0,7516,c],[0,7531,us],[0,7532,aL],[0,7533,Z],[0,7534,b$],[0,7535,aY],[0,7536,_],[0,7537,bw],[0,7538,o],[0,7539,o],[0,7540,N],[0,7541,ah],[0,7542,Y],[0,7543,T],[0,7545,T],[0,7546,f1],[0,7547,L],[0,7548,L],[0,7549,bw],[0,7550,s],[0,7551,s],[0,7552,aL],[0,7553,Z],[0,7554,b$],[0,7555,T],[0,7556,aT],[0,7557,C],[0,7558,aY],[0,7559,_],[0,7560,bw],[0,7561,o],[0,7562,N],[0,7563,c2],[0,7564,aZ],[0,7565,bY],[0,7566,Y],[0,7567,v],[0,7568,v],[0,7569,Z],[0,7570,d],[0,7571,d],[0,7572,d],[0,7573,d],[0,7574,L],[0,7575,c],[0,7576,c2],[0,7577,s],[0,7578,Y],[0,7579,v],[0,7580,aN],[0,7581,aN],[0,7582,Z],[0,7583,d],[0,7584,b$],[0,7585,by],[0,7586,T],[0,7587,S],[0,7588,L],[0,7589,L],[0,7590,L],[0,7591,L],[0,7592,by],[0,7593,C],[0,7594,C],[0,7595,C],[0,7596,aY],[0,7597,aY],[0,7598,_],[0,7599,_],[0,7600,_],[0,7601,c],[0,7602,kU],[0,7603,N],[0,7604,c2],[0,7605,ah],[0,7606,s],[0,7607,s],[0,7608,s],[0,7609,aZ],[0,7610,aZ],[0,7611,Y],[0,7612,Y],[0,7613,Y],[0,7614,Y],[0,7616,e],[0,7617,e],[0,7618,e],[0,7619,e],[0,7620,e],[0,7621,e],[0,7622,e],[0,7623,e],[0,7624,e],[0,7625,e],[0,7626,ae],[0,7627,e],[0,7628,e],[0,7629,e],[0,7630,e],[0,7631,e],[0,7632,e],[0,7633,e],[0,7634,e],[0,7635,x],[0,7636,fQ],[0,7637,rJ],[0,7638,k5],[0,7639,az],[0,7640,ai],[0,7641,ai],[0,7642,am],[0,7643,am],[0,7644,aE],[0,7645,ad],[0,7646,ad],[0,7647,bi],[0,7648,an],[0,7649,an],[0,7650,ae],[0,7651,ae],[0,7652,X],[0,7653,X],[0,7654,ap],[0,7655,x],[0,7656,aV],[0,7657,aV],[0,7658,E],[0,7659,bo],[0,7660,ad],[0,7661,q],[0,7662,aW],[0,7663,rF],[0,7664,A],[0,7665,aX],[0,7666,x],[0,7667,q],[0,7668,A],[0,7669,e],[0,7670,e],[0,7671,e],[0,7672,e],[0,7673,e],[0,7674,e],[0,7675,e],[0,7676,e],[0,7677,e],[0,7678,e],[0,7679,e],[0,7680,x],[0,7681,v],[0,7682,aV],[0,7683,aL],[0,7684,aV],[0,7685,aL],[0,7686,aV],[0,7687,aL],[0,7688,az],[0,7689,aN],[0,7690,ai],[0,7691,Z],[0,7692,ai],[0,7693,Z],[0,7694,ai],[0,7695,Z],[0,7696,ai],[0,7697,Z],[0,7698,ai],[0,7699,Z],[0,7700,E],[0,7701,d],[0,7702,E],[0,7703,d],[0,7704,E],[0,7705,d],[0,7706,E],[0,7707,d],[0,7708,E],[0,7709,d],[0,7710,bo],[0,7711,b$],[0,7712,am],[0,7713,T],[0,7714,aA],[0,7715,S],[0,7716,aA],[0,7717,S],[0,7718,aA],[0,7719,S],[0,7720,aA],[0,7721,S],[0,7722,aA],[0,7723,S],[0,7724,U],[0,7725,L],[0,7726,U],[0,7727,L],[0,7728,aE],[0,7729,aT],[0,7730,aE],[0,7731,aT],[0,7732,aE],[0,7733,aT],[0,7734,ad],[0,7735,C],[0,7736,ad],[0,7737,C],[0,7738,ad],[0,7739,C],[0,7740,ad],[0,7741,C],[0,7742,bi],[0,7743,aY],[0,7744,bi],[0,7745,aY],[0,7746,bi],[0,7747,aY],[0,7748,an],[0,7749,_],[0,7750,an],[0,7751,_],[0,7752,an],[0,7753,_],[0,7754,an],[0,7755,_],[0,7756,q],[0,7757,c],[0,7758,q],[0,7759,c],[0,7760,q],[0,7761,c],[0,7762,q],[0,7763,c],[0,7764,aW],[0,7765,bw],[0,7766,aW],[0,7767,bw],[0,7768,ae],[0,7769,o],[0,7770,ae],[0,7771,o],[0,7772,ae],[0,7773,o],[0,7774,ae],[0,7775,o],[0,7776,X],[0,7777,N],[0,7778,X],[0,7779,N],[0,7780,X],[0,7781,N],[0,7782,X],[0,7783,N],[0,7784,X],[0,7785,N],[0,7786,aG],[0,7787,ah],[0,7788,aG],[0,7789,ah],[0,7790,aG],[0,7791,ah],[0,7792,aG],[0,7793,ah],[0,7794,A],[0,7795,s],[0,7796,A],[0,7797,s],[0,7798,A],[0,7799,s],[0,7800,A],[0,7801,s],[0,7802,A],[0,7803,s],[0,7804,bq],[0,7805,aZ],[0,7806,bq],[0,7807,aZ],[0,7808,aX],[0,7809,a8],[0,7810,aX],[0,7811,a8],[0,7812,aX],[0,7813,a8],[0,7814,aX],[0,7815,a8],[0,7816,aX],[0,7817,a8],[0,7818,cd],[0,7819,bY],[0,7820,cd],[0,7821,bY],[0,7822,aM],[0,7823,ay],[0,7824,ap],[0,7825,Y],[0,7826,ap],[0,7827,Y],[0,7828,ap],[0,7829,Y],[0,7830,S],[0,7831,ah],[0,7832,a8],[0,7833,ay],[0,7834,v],[0,7835,N],[0,7836,N],[0,7837,N],[0,7838,X],[0,7839,Z],[0,7840,x],[0,7841,v],[0,7842,x],[0,7843,v],[0,7844,x],[0,7845,v],[0,7846,x],[0,7847,v],[0,7848,x],[0,7849,v],[0,7850,x],[0,7851,v],[0,7852,x],[0,7853,v],[0,7854,x],[0,7855,v],[0,7856,x],[0,7857,v],[0,7858,x],[0,7859,v],[0,7860,x],[0,7861,v],[0,7862,x],[0,7863,v],[0,7864,E],[0,7865,d],[0,7866,E],[0,7867,d],[0,7868,E],[0,7869,d],[0,7870,E],[0,7871,d],[0,7872,E],[0,7873,d],[0,7874,E],[0,7875,d],[0,7876,E],[0,7877,d],[0,7878,E],[0,7879,d],[0,7880,U],[0,7881,L],[0,7882,U],[0,7883,L],[0,7884,q],[0,7885,c],[0,7886,q],[0,7887,c],[0,7888,q],[0,7889,c],[0,7890,q],[0,7891,c],[0,7892,q],[0,7893,c],[0,7894,q],[0,7895,c],[0,7896,q],[0,7897,c],[0,7898,q],[0,7899,c],[0,7900,q],[0,7901,c],[0,7902,q],[0,7903,c],[0,7904,q],[0,7905,c],[0,7906,q],[0,7907,c],[0,7908,A],[0,7909,s],[0,7910,A],[0,7911,s],[0,7912,A],[0,7913,s],[0,7914,A],[0,7915,s],[0,7916,A],[0,7917,s],[0,7918,A],[0,7919,s],[0,7920,A],[0,7921,s],[0,7922,aM],[0,7923,ay],[0,7924,aM],[0,7925,ay],[0,7926,aM],[0,7927,ay],[0,7928,aM],[0,7929,ay],[0,7930,"LL"],[0,7931,"ll"],[0,7932,bq],[0,7933,aZ],[0,7934,aM],[0,7935,ay],[0,8305,L],[0,8319,_],[0,8400,e],[0,8401,e],[0,8402,e],[0,8403,e],[0,8404,e],[0,8405,e],[0,8406,e],[0,8407,e],[0,8408,e],[0,8409,e],[0,8410,e],[0,8411,e],[0,8412,e],[0,8413,e],[0,8414,e],[0,8415,e],[0,8416,e],[0,8417,e],[0,8418,e],[0,8419,e],[0,8420,e],[0,8421,e],[0,8422,e],[0,8423,e],[0,8424,e],[0,8425,e],[0,8426,e],[0,8427,e],[0,8428,e],[0,8429,e],[0,8430,e],[0,8431,e],[0,8432,e],[0,8580,aN],[0,9372,x],[0,9373,aV],[0,9374,az],[0,9375,ai],[0,9376,E],[0,9377,bo],[0,9378,am],[0,9379,aA],[0,9380,U],[0,9381,ce],[0,9382,aE],[0,9383,ad],[0,9384,bi],[0,9385,an],[0,9386,q],[0,9387,aW],[0,9388,b1],[0,9389,ae],[0,9390,X],[0,9391,aG],[0,9392,A],[0,9393,bq],[0,9394,aX],[0,9395,cd],[0,9396,aM],[0,9397,ap],[0,9398,x],[0,9399,aV],[0,9400,az],[0,9401,ai],[0,9402,E],[0,9403,bo],[0,9404,am],[0,9405,aA],[0,9406,U],[0,9407,ce],[0,9408,aE],[0,9409,ad],[0,9410,bi],[0,9411,an],[0,9412,q],[0,9413,aW],[0,9414,b1],[0,9415,ae],[0,9416,X],[0,9417,aG],[0,9418,A],[0,9419,bq],[0,9420,aX],[0,9421,cd],[0,9422,aM],[0,9423,ap],[0,9424,v],[0,9425,aL],[0,9426,aN],[0,9427,Z],[0,9428,d],[0,9429,b$],[0,9430,T],[0,9431,S],[0,9432,L],[0,9433,by],[0,9434,aT],[0,9435,C],[0,9436,aY],[0,9437,_],[0,9438,c],[0,9439,bw],[0,9440,dr],[0,9441,o],[0,9442,N],[0,9443,ah],[0,9444,s],[0,9445,aZ],[0,9446,a8],[0,9447,bY],[0,9448,ay],[0,9449,Y],[0,11360,ad],[0,11361,C],[0,11362,ad],[0,11363,aW],[0,11364,ae],[0,11365,v],[0,11366,ah],[0,11367,aA],[0,11368,S],[0,11369,aE],[0,11370,aT],[0,11371,ap],[0,11372,Y],[0,11373,x],[0,11374,bi],[0,11375,x],[0,11376,x],[0,11377,aZ],[0,11378,aX],[0,11379,a8],[0,11380,aZ],[0,11381,aA],[0,11382,S],[0,11383,kU],[0,11384,d],[0,11385,o],[0,11386,c],[0,11387,d],[0,11389,aZ],[0,11390,X],[0,11391,ap],[0,11503,e],[0,11504,e],[0,11505,e],[0,12441,e],[0,12442,e],[0,42607,e],[0,42608,e],[0,42609,e],[0,42610,e],[0,42620,e],[0,42621,e],[0,42736,e],[0,42737,e],[0,42786,"{ALEF}"],[0,42787,"{alef}"],[0,42788,q],[0,42789,c],[0,42790,aA],[0,42791,S],[0,42792,"TZ"],[0,42793,"tz"],[0,42794,rI],[0,42795,rI],[0,42796,ik],[0,42797,ik],[0,42798,ik],[0,42799,ik],[0,42800,b$],[0,42801,N],[0,42802,"AA"],[0,42803,sU],[0,42804,rJ],[0,42805,"ao"],[0,42806,"AU"],[0,42807,"au"],[0,42808,k5],[0,42809,uW],[0,42810,k5],[0,42811,uW],[0,42812,"AY"],[0,42813,"ay"],[0,42814,az],[0,42815,aN],[0,42816,aE],[0,42817,aT],[0,42818,aE],[0,42819,aT],[0,42820,aE],[0,42821,aT],[0,42822,ad],[0,42823,C],[0,42824,ad],[0,42825,C],[0,42826,q],[0,42827,c],[0,42828,q],[0,42829,c],[0,42830,"OO"],[0,42831,"oo"],[0,42832,aW],[0,42833,bw],[0,42834,aW],[0,42835,bw],[0,42836,aW],[0,42837,bw],[0,42838,b1],[0,42839,dr],[0,42840,b1],[0,42841,dr],[0,42842,ae],[0,42843,o],[0,42844,ae],[0,42845,o],[0,42846,bq],[0,42847,aZ],[0,42848,"VY"],[0,42849,"vy"],[0,42850,ap],[0,42851,Y],[0,42852,lh],[0,42853,f1],[0,42854,lh],[0,42855,f1],[0,42856,bq],[0,42857,aZ],[0,42858,"ET"],[0,42859,"et"],[0,42860,"IS"],[0,42861,"is"],[0,42862,"CON"],[0,42863,"con"],[0,42864,"us"],[0,42865,"dum"],[0,42866,"lum"],[0,42867,"mum"],[0,42868,"num"],[0,42869,o],[0,42870,o],[0,42871,"tum"],[0,42872,"um"],[0,42873,ai],[0,42874,Z],[0,42875,bo],[0,42876,b$],[0,42877,am],[0,42878,am],[0,42879,T],[0,42880,ad],[0,42881,C],[0,42882,ae],[0,42883,o],[0,42884,X],[0,42885,N],[0,42886,aG],[0,42887,ah],[0,42891,h3],[0,42892,h3],[0,42893,aA],[0,42894,C],[0,42895,uU],[0,42896,an],[0,42897,_],[0,42898,az],[0,42899,aN],[0,42900,aN],[0,42901,S],[0,42902,aV],[0,42903,aL],[0,42904,bo],[0,42905,b$],[0,42906,fQ],[0,42907,cX],[0,42908,r_],[0,42909,c4],[0,42910,"UE"],[0,42911,us],[0,42912,am],[0,42913,T],[0,42914,aE],[0,42915,aT],[0,42916,an],[0,42917,_],[0,42918,ae],[0,42919,o],[0,42920,X],[0,42921,N],[0,42922,aA],[0,42923,E],[0,42924,am],[0,42925,ad],[0,42926,U],[0,42927,dr],[0,42928,aE],[0,42929,aG],[0,42930,ce],[0,42931,cd],[0,42932,aV],[0,42933,aL],[0,42934,q],[0,42935,c],[0,42936,A],[0,42937,s],[0,42938,x],[0,42939,v],[0,42940,U],[0,42941,L],[0,42942,A],[0,42943,s],[0,42944,q],[0,42945,c],[0,42946,aX],[0,42947,a8],[0,42948,az],[0,42949,X],[0,42950,ap],[0,42951,ai],[0,42952,Z],[0,42953,X],[0,42954,N],[0,42960,am],[0,42961,T],[0,42963,f1],[0,42965,a8],[0,42966,X],[0,42967,N],[0,42968,X],[0,42969,N],[0,42994,az],[0,42995,bo],[0,42996,b1],[0,42997,aA],[0,42998,S],[0,42999,U],[0,43000,S],[0,43001,"{letter}"],[0,43002,aY],[0,43003,bo],[0,43004,aW],[0,43005,bi],[0,43006,U],[0,43007,bi],[0,43232,e],[0,43233,e],[0,43234,e],[0,43235,e],[0,43236,e],[0,43237,e],[0,43238,e],[0,43239,e],[0,43240,e],[0,43241,e],[0,43249,e],[0,43824,v],[0,43825,v],[0,43826,d],[0,43827,d],[0,43828,d],[0,43829,b$],[0,43830,T],[0,43831,C],[0,43832,C],[0,43833,C],[0,43834,aY],[0,43835,_],[0,43836,f2],[0,43837,c],[0,43838,c],[0,43839,c],[0,43840,c4],[0,43841,c4],[0,43842,c4],[0,43843,c],[0,43844,c],[0,43845,o],[0,43846,o],[0,43847,o],[0,43848,o],[0,43849,o],[0,43850,o],[0,43851,o],[0,43852,o],[0,43853,c2],[0,43854,s],[0,43855,s],[0,43856,rc],[0,43857,rc],[0,43858,s],[0,43859,bY],[0,43860,bY],[0,43861,bY],[0,43862,bY],[0,43863,bY],[0,43864,bY],[0,43865,bY],[0,43866,ay],[0,43868,S],[0,43869,C],[0,43870,C],[0,43871,s],[0,43872,"wa"],[0,43873,d],[0,43874,c4],[0,43875,"uo"],[0,43876,v],[0,43878,cc],[0,43879,bX],[0,43880,o],[0,43881,a8],[0,64256,"ff"],[0,64257,"fi"],[0,64258,"fl"],[0,64259,"ffi"],[0,64260,"ffl"],[0,64261,N],[0,64262,"st"],[0,65056,e],[0,65057,e],[0,65058,e],[0,65059,e],[0,65060,e],[0,65061,e],[0,65062,e],[0,65063,e],[0,65064,e],[0,65065,e],[0,65066,e],[0,65067,e],[0,65068,e],[0,65069,e],[0,65070,e],[0,65071,e],[0,65313,x],[0,65314,aV],[0,65315,az],[0,65316,ai],[0,65317,E],[0,65318,bo],[0,65319,am],[0,65320,aA],[0,65321,U],[0,65322,ce],[0,65323,aE],[0,65324,ad],[0,65325,bi],[0,65326,an],[0,65327,q],[0,65328,aW],[0,65329,b1],[0,65330,ae],[0,65331,X],[0,65332,aG],[0,65333,A],[0,65334,bq],[0,65335,aX],[0,65336,cd],[0,65337,aM],[0,65338,ap],[0,65345,v],[0,65346,aL],[0,65347,aN],[0,65348,Z],[0,65349,d],[0,65350,b$],[0,65351,T],[0,65352,S],[0,65353,L],[0,65354,by],[0,65355,aT],[0,65356,C],[0,65357,aY],[0,65358,_],[0,65359,c],[0,65360,bw],[0,65361,dr],[0,65362,o],[0,65363,N],[0,65364,ah],[0,65365,s],[0,65366,aZ],[0,65367,a8],[0,65368,bY],[0,65369,ay],[0,65370,Y],[0,66045,e],[0,67456,sU],[0,67457,qw],[0,67458,qw],[0,67459,cX],[0,67460,aL],[0,67461,aL],[0,67463,cc],[0,67464,cc],[0,67465,cc],[0,67466,cc],[0,67467,Z],[0,67468,Z],[0,67469,Z],[0,67470,d],[0,67471,d],[0,67472,lG],[0,67473,ua],[0,67474,T],[0,67475,T],[0,67476,T],[0,67477,S],[0,67478,S],[0,67479,S],[0,67480,by],[0,67481,ub],[0,67482,eY],[0,67483,C],[0,67484,C],[0,67485,C],[0,67486,eY],[0,67487,eY],[0,67488,ay],[0,67489,ay],[0,67490,c],[0,67491,c4],[0,67492,c],[0,67493,dr],[0,67494,o],[0,67495,o],[0,67496,o],[0,67497,o],[0,67498,o],[0,67499,rA],[0,67500,bX],[0,67501,bX],[0,67502,ih],[0,67503,ah],[0,67504,aZ],[0,67506,ay],[0,67507,bX],[0,67508,bX],[0,67509,cr],[0,67510,cr],[0,67511,cr],[0,67512,cr],[0,67513,cr],[0,67514,N],[0,69291,e],[0,69292,e],[0,69446,e],[0,69447,e],[0,69448,e],[0,69449,e],[0,69450,e],[0,69451,e],[0,69452,e],[0,69453,e],[0,69454,e],[0,69455,e],[0,69456,e],[0,69506,e],[0,69507,e],[0,69508,e],[0,69509,e],[0,70400,e],[0,70459,e],[0,70502,e],[0,70503,e],[0,70504,e],[0,70505,e],[0,70506,e],[0,70507,e],[0,70508,e],[0,92912,e],[0,92913,e],[0,92914,e],[0,92915,e],[0,92916,e],[0,118528,e],[0,118529,e],[0,118530,e],[0,118531,e],[0,118532,e],[0,118533,e],[0,118534,e],[0,118535,e],[0,118536,e],[0,118537,e],[0,118538,e],[0,118539,e],[0,118540,e],[0,118541,e],[0,118542,e],[0,118543,e],[0,118544,e],[0,118545,e],[0,118546,e],[0,118547,e],[0,118548,e],[0,118549,e],[0,118550,e],[0,118551,e],[0,118552,e],[0,118553,e],[0,118554,e],[0,118555,e],[0,118556,e],[0,118557,e],[0,118558,e],[0,118559,e],[0,118560,e],[0,118561,e],[0,118562,e],[0,118563,e],[0,118564,e],[0,118565,e],[0,118566,e],[0,118567,e],[0,118568,e],[0,118569,e],[0,118570,e],[0,118571,e],[0,118572,e],[0,118573,e],[0,118576,e],[0,118577,e],[0,118578,e],[0,118579,e],[0,118580,e],[0,118581,e],[0,118582,e],[0,118583,e],[0,118584,e],[0,118585,e],[0,118586,e],[0,118587,e],[0,118588,e],[0,118589,e],[0,118590,e],[0,118591,e],[0,118592,e],[0,118593,e],[0,119141,e],[0,119142,e],[0,119143,e],[0,119144,e],[0,119145,e],[0,119149,e],[0,119150,e],[0,119151,e],[0,119152,e],[0,119153,e],[0,119154,e],[0,119163,e],[0,119164,e],[0,119165,e],[0,119166,e],[0,119167,e],[0,119168,e],[0,119169,e],[0,119170,e],[0,119173,e],[0,119174,e],[0,119175,e],[0,119176,e],[0,119177,e],[0,119178,e],[0,119179,e],[0,119210,e],[0,119211,e],[0,119212,e],[0,119213,e],[0,119362,e],[0,119363,e],[0,119364,e],[0,122624,lG],[0,122625,T],[0,122626,T],[0,122627,aT],[0,122628,C],[0,122629,eY],[0,122630,ay],[0,122631,f2],[0,122632,o],[0,122633,ah],[0,122634,cr],[0,122635,c2],[0,122636,c2],[0,122637,ah],[0,122638,bX],[0,122639,aN],[0,122640,aT],[0,122641,C],[0,122642,cc],[0,122643,C],[0,122644,f2],[0,122645,o],[0,122646,o],[0,122647,ih],[0,122648,Y],[0,122649,cc],[0,122650,L],[0,122651,c],[0,122652,ih],[0,122653,aN],[0,122654,N],[0,122661,Z],[0,122662,C],[0,122663,_],[0,122664,o],[0,122665,N],[0,122666,ah],[0,125136,e],[0,125137,e],[0,125138,e],[0,125139,e],[0,125140,e],[0,125141,e],[0,125142,e],[0,127248,x],[0,127249,aV],[0,127250,az],[0,127251,ai],[0,127252,E],[0,127253,bo],[0,127254,am],[0,127255,aA],[0,127256,U],[0,127257,ce],[0,127258,aE],[0,127259,ad],[0,127260,bi],[0,127261,an],[0,127262,q],[0,127263,aW],[0,127264,b1],[0,127265,ae],[0,127266,X],[0,127267,aG],[0,127268,A],[0,127269,bq],[0,127270,aX],[0,127271,cd],[0,127272,aM],[0,127273,ap],[0,127274,X],[0,127275,az],[0,127276,ae],[0,127280,x],[0,127281,aV],[0,127282,az],[0,127283,ai],[0,127284,E],[0,127285,bo],[0,127286,am],[0,127287,aA],[0,127288,U],[0,127289,ce],[0,127290,aE],[0,127291,ad],[0,127292,bi],[0,127293,an],[0,127294,q],[0,127295,aW],[0,127296,b1],[0,127297,ae],[0,127298,X],[0,127299,aG],[0,127300,A],[0,127301,bq],[0,127302,aX],[0,127303,cd],[0,127304,aM],[0,127305,ap],[0,127312,x],[0,127313,aV],[0,127314,az],[0,127315,ai],[0,127316,E],[0,127317,bo],[0,127318,am],[0,127319,aA],[0,127320,U],[0,127321,ce],[0,127322,aE],[0,127323,ad],[0,127324,bi],[0,127325,an],[0,127326,q],[0,127327,aW],[0,127328,b1],[0,127329,ae],[0,127330,X],[0,127331,aG],[0,127332,A],[0,127333,bq],[0,127334,aX],[0,127335,cd],[0,127336,aM],[0,127337,ap],[0,127344,x],[0,127345,aV],[0,127346,az],[0,127347,ai],[0,127348,E],[0,127349,bo],[0,127350,am],[0,127351,aA],[0,127352,U],[0,127353,ce],[0,127354,aE],[0,127355,ad],[0,127356,bi],[0,127357,an],[0,127358,q],[0,127359,aW],[0,127360,b1],[0,127361,ae],[0,127362,X],[0,127363,aG],[0,127364,A],[0,127365,bq],[0,127366,aX],[0,127367,cd],[0,127368,aM],[0,127369,ap],[0,127370,aW],[0,127397,ai],[0,917569,x],[0,917570,aV],[0,917571,az],[0,917572,ai],[0,917573,E],[0,917574,bo],[0,917575,am],[0,917576,aA],[0,917577,U],[0,917578,ce],[0,917579,aE],[0,917580,ad],[0,917581,bi],[0,917582,an],[0,917583,q],[0,917584,aW],[0,917585,b1],[0,917586,ae],[0,917587,X],[0,917588,aG],[0,917589,A],[0,917590,bq],[0,917591,aX],[0,917592,cd],[0,917593,aM],[0,917594,ap],[0,917601,x],[0,917602,aV],[0,917603,az],[0,917604,ai],[0,917605,E],[0,917606,bo],[0,917607,am],[0,917608,aA],[0,917609,U],[0,917610,ce],[0,917611,aE],[0,917612,ad],[0,917613,bi],[0,917614,an],[0,917615,q],[0,917616,aW],[0,917617,b1],[0,917618,ae],[0,917619,X],[0,917620,aG],[0,917621,A],[0,917622,bq],[0,917623,aX],[0,917624,cd],[0,917625,aM],[0,917626,ap]]),LQ=bG,LP=iy([[0,170,v],[0,qW,c],[0,rX,"ss"],[0,8208,ct],[0,8211,ct],[0,8212,ct],[0,8216,h3],[0,8217,h3],[0,8220,dw],[0,8221,dw],[0,8230,"..."],[0,8722,ct]]),LX=[1,[0,r8,q_]],LV=[0,1],L0=[0,"lib/codec.ml",32,4],L3="Yojson__Common.Json_error",L5="Yojson__Common.End_of_array",L6="Yojson__Common.End_of_object",L7="Yojson__Common.End_of_tuple",L8="Yojson__Common.End_of_input",L_=[0,"\0\0\xfe\xff\xff\xff","\xff\xff\xff\xff\xff\xff","\x01\0\0\0\0\0","\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x02\0","\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\0\0",e,e,e,e,e,e],Nq=[0,bx,1],Nr=[0,bx,0],Ns=bZ,Nt="Invalid token",Nu=bZ,Nv="Invalid escape sequence",Nw=bZ,Nx="Invalid low surrogate for code point beyond U+FFFF",Ny="Missing escape sequence representing low surrogate for code point beyond U+FFFF",Nz=bZ,NA="Expected ':' or '>' but found",NB=bZ,NC="Expected '>' but found",ND=bZ,NE="Unterminated comment",NF="Expected string or identifier but found",NG=bZ,NH="Expected ',' or ']' but found",NI=bZ,NJ="Expected ',' or ')' but found",NK=bZ,NL="Expected ',' or '}' but found",NM=bZ,NN="Expected ':' but found",NO=bZ,N_="Expected string, got ",N9="Expected object, got ",NX=fY,NZ=im,N0="floatlit",N1=id,N2="tuple",NY="bool",N4="variant",N5="float",N6="int",N7=k6,N3="intlit",NT="Blank input data",NQ="Junk after end of JSON value:",MY=[0,[2,0,[11," '",[2,0,[2,0,[12,39,0]]]]],"%s '%s%s'"],MT=[0,[11,"File ",[2,0,[11,qt,0]]],"File %s, line"],MX="Line",MU=[0,[11,"byte ",[4,3,0,0,0]],"byte %i"],MW=[0,[11,"bytes ",[4,3,0,0,[12,45,[4,3,0,0,0]]]],"bytes %i-%i"],MV=[0,[2,0,[12,32,[4,3,0,0,[11,lx,[2,0,[11,":\n",[2,0,0]]]]]]],"%s %i, %s:\n%s"],MS=[0,"lib/read.mll",41,13],MR=e,MP=e,MB="NaN value not allowed in standard JSON",MC=[0,[8,[0,0,3],0,[0,16],0],uX],ME=[0,[8,[0,0,3],0,[0,17],0],t9],MD=uK,Mz="Infinity value not allowed in standard JSON",MA="-Infinity value not allowed in standard JSON",Mu="NaN",Mv=[0,[8,[0,0,3],0,[0,16],0],uX],Mx=[0,[8,[0,0,3],0,[0,17],0],t9],Mw=uK,Ms="Infinity",Mt="-Infinity",Mo=d8,Mp=f7,Mn=fY,Mh=h5,Mi=ie,Mj=hY,Mk="\\f",Ml=hR,Mm=lC,Mg=h2,Me=[0,[11,"src=",[3,0,[11," start=",[4,3,0,0,[11,kG,[4,3,0,0,[12,10,[10,0]]]]]]]],"src=%S start=%i len=%i\n%!"],Mc="\\u00",MZ="Yojson__Safe.Int_overflow",NU="Yojson__Safe.Util.Type_error",Od="list_of_yojson: list needed",Oc="int_of_yojson: integer needed",Ob="string_of_yojson: string needed",N$="Ppx_yojson_conv_lib__Yojson_conv.Of_yojson_error",Or=bG,Ot="_of_yojson: list instead of atom for record expected",Os=[0,[2,0,[11,"_of_yojson: the following record elements were undefined: ",[2,0,0]]],"%s_of_yojson: the following record elements were undefined: %s"],Op="extra fields",Oo="duplicate fields",Om=bG,On=[0,[2,0,[11,"_of_yojson: ",[2,0,[11,hX,[2,0,0]]]]],"%s_of_yojson: %s: %s"],Ol="_of_yojson: unexpected variant constructor",Ok="_of_yojson: expected a variant type, saw an empty list",Oj="_of_yojson: expected a variant type, saw a nested list",Oi="_of_yojson: this constructor requires arguments",Og=[0,[2,0,[11,"_of_yojson: sum tag ",[3,0,[11," has incorrect number of arguments",0]]]],"%s_of_yojson: sum tag %S has incorrect number of arguments"],Oe="_of_yojson: this constructor does not take arguments",Qf="An error occured while decoding response: ",Qa=[0,[11,", Token=",[3,0,0]],", Token=%S"],Qd=e,Qb=e,Qc=[0,[11,'MediaBrowser Client="Ocamix", Device="Firefox", DeviceId="',[2,0,[11,'", Version="0.1"',[2,0,0]]]],'MediaBrowser Client="Ocamix", Device="Firefox", DeviceId="%s", Version="0.1"%s'],P7=rb,P8=uY,P9=c3,P3="item_id",P4="locations",P5=bj,P1=sW,PR=s4,PS=sI,PT=rC,PU=eT,PV=q7,PW=sj,PX=tt,PY=eX,PZ=tY,P0=c3,PL="type_",PM="image_blur_hashes",PN=e0,PO=bE,PP=bj,PJ=[0,"lib/data_source/jellyfin_api.ml",ur,64],O8=[0,r,[0,[0,n,uR],0]],O9=[0,r,[0,[0,n,up],0]],O_=[0,r,[0,[0,n,sn],0]],O$=[0,r,[0,[0,n,rT],0]],Pa=[0,r,[0,[0,n,q$],0]],Pb=[0,r,[0,[0,n,rl],0]],Pc=[0,r,[0,[0,n,r9],0]],Pd=[0,r,[0,[0,n,rv],0]],Pe=[0,r,[0,[0,n,th],0]],Pf=[0,r,[0,[0,n,uv],0]],Pg=[0,r,[0,[0,n,uy],0]],Ph=[0,r,[0,[0,n,sE],0]],Pi=[0,r,[0,[0,n,uS],0]],Pj=[0,r,[0,[0,n,qY],0]],Pk=[0,r,[0,[0,n,q3],0]],Pl=[0,r,[0,[0,n,uN],0]],Pm=[0,r,[0,[0,n,tU],0]],Pn=[0,r,[0,[0,n,rw],0]],Po=[0,r,[0,[0,n,s$],0]],Pp=[0,r,[0,[0,n,r5],0]],Pq=[0,r,[0,[0,n,qF],0]],Pr=[0,r,[0,[0,n,un],0]],Ps=[0,r,[0,[0,n,ul],0]],Pt=[0,r,[0,[0,n,qT],0]],Pu=[0,r,[0,[0,n,t2],0]],Pv=[0,r,[0,[0,n,sR],0]],Pw=[0,r,[0,[0,n,uJ],0]],Px=[0,r,[0,[0,n,re],0]],Py=[0,r,[0,[0,n,q1],0]],Pz=[0,r,[0,[0,n,rW],0]],PA=[0,r,[0,[0,n,s3],0]],PB=[0,r,[0,[0,n,rG],0]],PC=[0,r,[0,[0,n,st],0]],PD=[0,r,[0,[0,n,q4],0]],PE=[0,r,[0,[0,n,q8],0]],PF=[0,r,[0,[0,n,t$],0]],PG=[0,r,[0,[0,n,rt],0]],O5=uQ,O1=eX,O2=c3,OY=bE,OZ=bj,OU=[0,"Users",[0,"AuthenticateByName",0]],OP=eT,OQ=uI,OR=sX,OL=e0,OM="access_token",ON="user",OI=sT,OJ=rK,OF="pw",OG="username",OA=eX,OB=sB,OC=eT,OD=c3,Ow=bE,Ox=e0,Oy=bj,QO=e0,QP=d7,QQ=c1,QR=lz,QS=bE,QI=e0,QJ=d7,QK=c1,QL=lz,QM=bE,QE=d7,QF=c1,QG=bE,QA=d7,QB=c1,QC=bE,Qx=k_,Qy=bj,Qu=k_,Qv=bj,Qr=bj,Qs=bE,Qo=bj,Qp=bE,Qm=[0,n,kS],Rx=[0,d_,uG,15],Rt=[0,d_,lm,15],Rf=[0,d_,141,11],Rb=[0,d_,96,13],Ra=[0,d_,87,19],Q$=[0,d_,81,13],Q_=[0,d_,75,19],Q7=h0,Q8=k$,Q4=h0,Q5=k$,Q0=c1,Q1=lE,Q2=d2,QW=c1,QX=lE,QY=d2,QU=e,QT="items_by_date_added",Rc="items",Rd="virtual_folders",Rm="collections",Rp=d7,Rs="albums",Rw="tracks",RI=[0,[2,0,[15,0]],"%s%a"],RG=[0,[12,40,[4,3,0,0,[12,47,[4,3,0,0,[12,41,0]]]]],"(%i/%i)"],RA="Unknown",RB=tE,RC="Inconsistent",RD=[0,[11,"New items: last: ",[4,3,0,0,[11," missing: ",[4,3,0,0,[11,rU,[4,3,0,0,0]]]]]],"New items: last: %i missing: %i unfetched: %i"],RE=[0,[11,"Partial: last: ",[4,3,0,0,[11,rU,[4,3,0,0,0]]]],"Partial: last: %i unfetched: %i"],RP=[0,[11,"Server ",[2,0,[11,hX,[15,0]]]],"Server %s: %a"],RM="./db_worker.bc.js",RN=e,Sf="GOT L=",Se=[2,0],Sd=[0,"NEW REF",0],R$=tE,R9=[0,[11,"Sync in progress: ",[4,3,0,0,[12,47,[4,3,0,0,0]]]],"Sync in progress: %i/%i"],R_="Desynchronized",R4=ly,R7=ly,R5=ly,R6=e,RQ="ui_servers",RS=[0,0,0,0],RT=[0,"https://demo.jellyfin.org/stable"],RU=[0,1],RW=[0,"demo"],RX=[0,1],RZ=[0,0],R1=[0,80,"Connect"],Sy=rP,St=[0,[2,0,[11,h9,[2,0,[11,t5,0]]]],tx],Sv=kX,Su=[0,[11,tj,[3,0,[12,41,0]]],qP],Sr="A playback error happened. This is probably due to a codec unsupported by the browser.",Ss=[0,80,"NEXT"],Sw=[0,80,"now-playing-cover"],Sx=[0,80,"now-playing-details"],Sz=[0,80,r7],SA=[0,80,"now-playing-display"],SB=[0,80,"player-wrapper"],SC=[0,80,r7],Sl="Now playing:",Sm=[0,[2,0,[11,h9,[2,0,[11,t5,0]]]],tx],Sn=e,So=e,Sp="image/jpeg",Sq="500x500",Sj=[0,[2,0,[11,"/Audio/",[2,0,[11,"/universal?api_key=",[2,0,[11,"&audioCodec=aac&container=opus,mp3,aac,m4a,m4b,flac,wav,ogg&transcodingContainer=ts&transcodingProtocol=hls",0]]]]]],"%s/Audio/%s/universal?api_key=%s&audioCodec=aac&container=opus,mp3,aac,m4a,m4b,flac,wav,ogg&transcodingContainer=ts&transcodingProtocol=hls"],SP=[0,[2,0,[11," (",[4,3,0,0,[12,41,0]]]],"%s (%i)"],SE=d2,SF=ii,SG=e,SH=[0,[0,0,[0,0],0,0],0,0],SJ="library-selection",SM=[0,80,[0,e]],SN=[0,80,[0,ut]],SQ="genre-selection",ST=[0,"pouet",0,0],SV=[0,[0,d2,"Date added"],[0,[0,bj,c3],0]],SW=[0,"view-sort",d2,0],SY=[0,[0,td,"Asc"],[0,[0,ii,"Desc"],[0,[0,tN,"Random"],0]]],SZ=[0,"view-order",ii,0],S2=[0,80,[0,ut]],S4=[0,80,[0,"genres-picker"]],S6=[0,80,[0,"filters-row"]],S9=[0,80,[0,"filters-container"]],Tl="|>",Tk=[0,[2,0,[11,h9,[2,0,[11,"/Images/Primary?width=50",0]]]],"%s/Items/%s/Images/Primary?width=50"],Tj="server-error.png",Tm=[2,4.],Ta=so,Tb="1fr",Tc=so,Td=t_,Te=te,Tf=t_,Tg="#",Th=te,Ti="Order",TO="Persist ?",TC=[0,[2,0,[11,h9,[2,0,[11,"/Images/Primary?width=800&format=Jpg",0]]]],"%s/Items/%s/Images/Primary?width=800&format=Jpg"],TE=kX,TD=[0,[11,tj,[3,0,[12,41,0]]],qP],Tz=rP,To="session_uuid",Tq="Welcome to OCAMIX",TL=[0,"main-layout"];function +at(a){if(typeof a==="number")return 0;switch(a[0]){case -0:return[0,as(a[1])];case -1:return[1,as(a[1])];case -2:return[2,as(a[1])];case -3:return[3,as(a[1])];case -4:return[4,as(a[1])];case -5:return[5,as(a[1])];case -6:return[6,as(a[1])];case -7:return[7,as(a[1])];case +0:return[0,at(a[1])];case +1:return[1,at(a[1])];case +2:return[2,at(a[1])];case +3:return[3,at(a[1])];case +4:return[4,at(a[1])];case +5:return[5,at(a[1])];case +6:return[6,at(a[1])];case +7:return[7,at(a[1])];case 8:var -c=a[1];return[8,c,as(a[2])];case +c=a[1];return[8,c,at(a[2])];case 9:var -b=a[1];return[9,b,b,as(a[3])];case -10:return[10,as(a[1])];case -11:return[11,as(a[1])];case -12:return[12,as(a[1])];case -13:return[13,as(a[1])];default:return[14,as(a[1])]}}function +b=a[1];return[9,b,b,at(a[3])];case +10:return[10,at(a[1])];case +11:return[11,at(a[1])];case +12:return[12,at(a[1])];case +13:return[13,at(a[1])];default:return[14,at(a[1])]}}function bm(a,b){if(typeof a==="number")return b;switch(a[0]){case 0:return[0,bm(a[1],b)];case @@ -986,176 +1028,200 @@ d=a[2],e=a[1];return[9,e,d,bm(a[3],b)];case 11:return[11,bm(a[1],b)];case 12:return[12,bm(a[1],b)];case 13:return[13,bm(a[1],b)];default:return[14,bm(a[1],b)]}}function -ak(a,b){if(typeof +al(a,b){if(typeof a==="number")return b;switch(a[0]){case -0:return[0,ak(a[1],b)];case -1:return[1,ak(a[1],b)];case +0:return[0,al(a[1],b)];case +1:return[1,al(a[1],b)];case 2:var -c=a[1];return[2,c,ak(a[2],b)];case +c=a[1];return[2,c,al(a[2],b)];case 3:var -d=a[1];return[3,d,ak(a[2],b)];case +d=a[1];return[3,d,al(a[2],b)];case 4:var -e=a[3],f=a[2],g=a[1];return[4,g,f,e,ak(a[4],b)];case +e=a[3],f=a[2],g=a[1];return[4,g,f,e,al(a[4],b)];case 5:var -h=a[3],i=a[2],j=a[1];return[5,j,i,h,ak(a[4],b)];case +h=a[3],i=a[2],j=a[1];return[5,j,i,h,al(a[4],b)];case 6:var -k=a[3],l=a[2],m=a[1];return[6,m,l,k,ak(a[4],b)];case +k=a[3],l=a[2],m=a[1];return[6,m,l,k,al(a[4],b)];case 7:var -n=a[3],o=a[2],p=a[1];return[7,p,o,n,ak(a[4],b)];case +n=a[3],o=a[2],p=a[1];return[7,p,o,n,al(a[4],b)];case 8:var -q=a[3],r=a[2],s=a[1];return[8,s,r,q,ak(a[4],b)];case +q=a[3],r=a[2],s=a[1];return[8,s,r,q,al(a[4],b)];case 9:var -t=a[1];return[9,t,ak(a[2],b)];case -10:return[10,ak(a[1],b)];case +t=a[1];return[9,t,al(a[2],b)];case +10:return[10,al(a[1],b)];case 11:var -u=a[1];return[11,u,ak(a[2],b)];case +u=a[1];return[11,u,al(a[2],b)];case 12:var -v=a[1];return[12,v,ak(a[2],b)];case +v=a[1];return[12,v,al(a[2],b)];case 13:var -w=a[2],x=a[1];return[13,x,w,ak(a[3],b)];case +w=a[2],x=a[1];return[13,x,w,al(a[3],b)];case 14:var -y=a[2],z=a[1];return[14,z,y,ak(a[3],b)];case -15:return[15,ak(a[1],b)];case -16:return[16,ak(a[1],b)];case +y=a[2],z=a[1];return[14,z,y,al(a[3],b)];case +15:return[15,al(a[1],b)];case +16:return[16,al(a[1],b)];case 17:var -A=a[1];return[17,A,ak(a[2],b)];case +A=a[1];return[17,A,al(a[2],b)];case 18:var -B=a[1];return[18,B,ak(a[2],b)];case -19:return[19,ak(a[1],b)];case +B=a[1];return[18,B,al(a[2],b)];case +19:return[19,al(a[1],b)];case 20:var -C=a[2],D=a[1];return[20,D,C,ak(a[3],b)];case +C=a[2],D=a[1];return[20,D,C,al(a[3],b)];case 21:var -E=a[1];return[21,E,ak(a[2],b)];case -22:return[22,ak(a[1],b)];case +E=a[1];return[21,E,al(a[2],b)];case +22:return[22,al(a[1],b)];case 23:var -F=a[1];return[23,F,ak(a[2],b)];default:var -G=a[2],H=a[1];return[24,H,G,ak(a[3],b)]}}function -is(a){return[0,a]}function -ga(a){return a[1]}function -it(a,b,c){return a[1]===b?(a[1]=c,1):0}function -e2(a){throw g([0,dy,a],1)}function -H(a){throw g([0,lL,a],1)}var -lM=[B,u7,ar(0)];function -lR(a,b){return TK(a,b)?a:b}function -e3(a){return 0<=a?a:-a|0}var -gb=bV;function -a1(a,b){return a+b}function -vj(b){var +F=a[1];return[23,F,al(a[2],b)];default:var +G=a[2],H=a[1];return[24,H,G,al(a[3],b)]}}function +fb(a){throw g([0,dH,a],1)}function +H(a){throw g([0,iE,a],1)}var +l_=[B,vQ,ar(0)];function +md(a,b){return UQ(a,b)?a:b}function +fc(a){return 0<=a?a:-a|0}var +gk=b0;function +a$(a,b){return a+b}function +v4(b){var e=p(b);return function(a){var -c=a;for(;;){if(e<=c)return a1(b,vk);var -d=V(b,c);a:{if(48<=d){if(58>d)break a}else if(45===d)break a;return b}c=c+1|0}}(0)}function -iv(a,b){if(!a)return b;var -c=a[1];return[0,c,iv(a[2],b)]}TU(0);var -vm=uS(1),cb=uS(2);function -e4(a,b){lD(a,b,0,p(b));return}function -lS(a){e4(cb,a);uT(cb,10);return d8(cb)}var -iw=is(function(a){return function(a){var +c=a;for(;;){if(e<=c)return a$(b,v5);var +d=ak(b,c);a:{if(48<=d){if(58>d)break a}else if(45===d)break a;return b}c=c+1|0}}(0)}function +me(a,b){if(!a)return b;var +c=a[2],d=a[1];if(!c)return[0,d,b];var +e=c[2],f=c[1];if(!e)return[0,d,[0,f,b]];var +g=[0,e[1],ca];v7(g,1,e[2],b);return[0,d,[0,f,g]]}function +v7(a,b,c,d){var +f=a,e=b,g=c;for(;;){if(!g){f[1+e]=d;return}var +h=g[2],i=g[1];if(!h){f[1+e]=[0,i,d];return}var +j=h[2],k=h[1];if(!j){f[1+e]=[0,i,[0,k,d]];return}var +l=[0,j[1],ca],m=j[2];f[1+e]=[0,i,[0,k,l]];f=l;e=1;g=m}}U0(0);var +iG=vB(1),bK=vB(2);function +fd(a,b){l1(a,b,0,p(b));return}function +mf(a,b,c,d){if(0<=c&&0<=d&&(p(b)-d|0)>=c)return l1(a,b,c,d);return H(v8)}function +mg(a){fd(bK,a);vC(bK,10);return ed(bK)}var +iH=[0,function(a){return function(a){var b=a;for(;;){if(!b)return 0;var -d=b[2],e=b[1];try{d8(e)}catch(f){var -c=P(f);if(c[1]!==lP)throw g(c,0)}b=d}}(TV(0))});function -ix(a){return h(ga(iw),0)}lI(rG,ix);function -u8(a,b){return To(a,b)?a:b}function -u9(a){return a^-1}var -u_=-2147483648,va=eV(u$),vc=eV(vb),ve=eV(vd);function -vf(a){return a?vg:vh}function -vi(a){return e+a}function -vl(a){return vj(lt("%.12g",a))}function -vn(a,b,c,d){if(0<=c&&0<=d&&(p(b)-d|0)>=c)return lD(a,b,c,d);return H(vo)}function -vp(a,b,c,d){if(0<=c&&0<=d&&(a8(b)-d|0)>=c)return TS(a,b,c,d);return H(vq)}function -vr(c){for(;;){var -d=is(1),a=ga(iw);let -e=d,f=a;var -b=1-it(iw,a,function(a){if(it(e,1,0))h(c,0);return h(f,0)});if(!b)return b}}function -gc(a){return d8(a)}function -vs(a,b){uT(a,b);return}var -iy=T8(0),e5=(4*iy|0)-1|0;function -lT(a){return 1-(typeof -a==="number"?1:0)}var -vu=[B,vt,ar(0)];function -vv(a){throw g(vu,1)}function -iz(a){var -d=a[1];a[1]=vv;try{var -c=h(d,0);TZ(a,c);return c}catch(f){var -b=P(f);a[1]=function(a){throw g(b,0)};throw g(b,0)}}function -vw(a){var -b=c2(a);if(b!==cu&&b!==dV&&b!==kt)return a;return TJ(a)}function -iA(a,b){return b?[0,h(a,b[1])]:0}function -lU(a){return a?1:0}function -vx(a){return a?a[1]:H(vy)}function -vz(a,b){return 0===b[0]?[0,h(a,b[1])]:b}function -au(a){if(0<=a&&dm>=a)return a;return H(vA)}function -vB(a){a:{if(40<=a){if(92===a)return vC;if(dW>a)break a}else{if(32<=a){if(39<=a)return vD;break a}if(14>a)switch(a){case -8:return vE;case -9:return vF;case -10:return vG;case -13:return vH}}var -b=am(4);aq(b,0,92);aq(b,1,48+(a/hO|0)|0);aq(b,2,48+((a/10|0)%10|0)|0);aq(b,3,48+(a%10|0)|0);return ip(b)}var -c=am(1);aq(c,0,a);return ip(c)}function -vI(a){return 25>>0?a:a+qS|0}function -vJ(a){return a1(f5(t9,a),vK)}function -vL(a){var +d=b[2],e=b[1];try{ed(e)}catch(f){var +c=P(f);if(c[1]!==mb)throw g(c,0)}b=d}}(U1(0))}],mh=[0,function(a){return}];function +iI(a){h(mh[1],0);return h(lK(iH),0)}l7(sg,iI);function +fe(a){return ed(a)}function +vR(a,b){return Ur(a,b)?a:b}function +vS(a){return a^-1}var +vT=-2147483648,vV=e7(vU),vX=e7(vW),vZ=e7(vY);function +v0(a){return a?v1:v2}function +v3(a){return e+a}function +v6(a){return v4(lP("%.12g",a))}function +v9(a,b,c,d){if(0<=c&&0<=d&&(a9(b)-d|0)>=c)return UY(a,b,c,d);return H(v_)}function +v$(c){for(;;){var +a=lK(iH);let +d=[0,1],e=a;var +b=1-lJ(iH,a,function(a){if(lJ(d,1,0))h(c,0);return h(e,0)});if(!b)return b}}function +wa(a,b){vC(a,b);return}var +iJ=Vb(0),ff=(4*iJ|0)-1|0;function +mi(a){return 1-(typeof +a==="number"?1:0)}function +mj(a,b,c){return lJ(a,b,c)}function +fg(a){return lK(a)}function +fh(a){return[0,a]}function +wb(a,b){return T9(a,b)}var +wd=[B,wc,ar(0)];function +we(a){var +d=a[1];a[1]=0;try{var +c=h(d,0);a[1]=c;vz(a);return c}catch(f){var +b=P(f);a[1]=function(a){throw g(b,0)};UO(a);throw g(b,0)}}function +wf(a){var +c=a[1];a[1]=0;var +b=h(c,0);a[1]=b;vz(a);return b}function +wg(a,b){if(0===UP(b))return a?wf(b):we(b);throw g(wd,1)}function +mk(a){return wg(0,a)}function +wh(a){var +b=dG(a);if(b!==c0&&b!==d4&&b!==dx&&b!==kO)return a;return UN(a)}function +iK(a,b){return b?[0,h(a,b[1])]:0}function +ml(a){return a?1:0}function +wi(a){return a?a[1]:H(wj)}function +wk(a,b){return 0===b[0]?[0,h(a,b[1])]:b}function +av(a){if(0<=a&&ds>=a)return a;return H(wl)}function +wm(a){a:{if(40<=a){if(92===a)return wn;if(d5>a)break a}else{if(32<=a){if(39<=a)return wo;break a}if(14>a)switch(a){case +8:return wp;case +9:return wq;case +10:return wr;case +13:return ws}}var +b=aj(4);aq(b,0,92);aq(b,1,48+(a/hZ|0)|0);aq(b,2,48+((a/10|0)%10|0)|0);aq(b,3,48+(a%10|0)|0);return iB(b)}var +c=aj(1);aq(c,0,a);return iB(c)}function +wt(a){return 25>>0?a:a-32|0}function +wu(a){return a$(gd(uL,a),wv)}function +ww(a){var b=0<=a?1:0,c=b?a<=55295?1:0:b;if(c)var d=c;else var e=57344<=a?1:0,d=e?a<=1114111?1:0:e;return d}function -iB(a){return vL(a)?a:H(vJ(a))}function -cc(a){return a}function -bY(a){return a}function -vM(a,b){var +iL(a){return ww(a)?a:H(wu(a))}function +ci(a){return a}function +b2(a){return a}function +wx(a,b){var d=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function -gd(a){return vM(0,a)}function -cq(a,b){var +gl(a){return wx(0,a)}function +cz(a,b){var c=a,d=b;for(;;){if(!c)return d;var e=[0,c[1],d];c=c[2];d=e}}function -a_(a){return cq(a,0)}function -lV(a,b,c){if(b<=a)return 0;var -d=h(c,a);return[0,d,lV(a+1|0,b,c)]}function -vN(a,b){return[0,a,b]}function -vO(a){return a?a[1]:e2(vP)}function -vQ(a,b,c,d){var -f=a,e=b;for(;;){if(c<=e)return f;f=[0,h(d,e),f];e=e+1|0}}function -ge(a){if(!a)return 0;var -b=a[1];return iv(b,ge(a[2]))}function -dz(a,b){if(!b)return 0;var -c=b[2],d=h(a,b[1]);return[0,d,dz(a,c)]}function -lW(e,b){return function(a,b){var +bz(a){return cz(a,0)}function +wB(a,b,c){if(b>1,o=g(n,b),t=o[1],p=g(a-n|0,o[2]),u=p[2];return[0,q(t,p[1],0),u]}var -a=gd(b);return 2<=a?g(a,b)[1]:b}function -vW(d,b){function +a=gl(b);return 2<=a?g(a,b)[1]:b}function +wK(d,b){function A(a,b,c){var -g=a,f=b,e=c;for(;;){if(!g)return cq(f,e);if(!f)return cq(g,e);var +g=a,f=b,e=c;for(;;){if(!g)return cz(f,e);if(!f)return cz(g,e);var j=f[2],k=f[1],l=g[2],h=g[1],m=i(d,h,k);if(0===m){g=l;f=j;e=[0,h,e]}else if(0<=m){f=j;e=[0,k,e]}else{g=l;e=[0,h,e]}}}function B(a,b,c){var -g=a,f=b,e=c;for(;;){if(!g)return cq(f,e);if(!f)return cq(g,e);var +g=a,f=b,e=c;for(;;){if(!g)return cz(f,e);if(!f)return cz(g,e);var j=f[2],k=f[1],l=g[2],h=g[1],m=i(d,h,k);if(0===m){g=l;f=j;e=[0,h,e]}else if(0>1,s=h(r,b),D=s[1],t=h(a-r|0,s[2]),E=t[2];return[0,A(D,t[1],0),E]}var -a=gd(b);return 2<=a?h(a,b)[1]:b}function -gg(a,b){return b<=a?a:b}function -lZ(a){return e+a}function -vX(a,b){return lB(a,b)}function -vY(a,b){return a<=b?a:b}function -dA(a,b){var -c=am(a);Tk(c,0,a,b);return c}var -gh=am(0);function -l0(a){var -b=a8(a),c=am(b);b$(a,0,c,0,b);return c}function -l1(a){return l0(du(a))}function -gi(a,b,c){if(0<=b&&0<=c&&(a8(a)-c|0)>=b){var -d=am(c);b$(a,b,d,0,c);return d}return H(vZ)}function -d9(a,b,c){return ip(gi(a,b,c))}function -l2(a,b,c,d,e){if(0<=e&&0<=b&&(a8(a)-e|0)>=b&&0<=d&&(a8(c)-e|0)>=d){b$(a,b,c,d,e);return}return H(v0)}function -cB(a,b,c,d,e){if(0<=e&&0<=b&&(p(a)-e|0)>=b&&0<=d&&(a8(c)-e|0)>=d){dt(a,b,c,d,e);return}return H(v1)}function -l3(a){var +a=gl(b);return 2<=a?h(a,b)[1]:b}function +iM(a,b){return b<=a?a:b}function +wL(a,b){return lY(a,b)}function +wM(a,b){return a<=b?a:b}function +wN(a){return e+a}function +dI(a,b){var +c=aj(a);Un(c,0,a,b);return c}var +go=aj(0);function +wO(a){var +b=a9(a),c=aj(b);cf(a,0,c,0,b);return c}function +mq(a){return wO(dA(a))}function +gp(a,b,c){if(0<=b&&0<=c&&(a9(a)-c|0)>=b){var +d=aj(c);cf(a,b,d,0,c);return d}return H(wP)}function +ef(a,b,c){return iB(gp(a,b,c))}function +mr(a,b,c,d,e){if(0<=e&&0<=b&&(a9(a)-e|0)>=b&&0<=d&&(a9(c)-e|0)>=d){cf(a,b,c,d,e);return}return H(wQ)}function +ck(a,b,c,d,e){if(0<=e&&0<=b&&(p(a)-e|0)>=b&&0<=d&&(a9(c)-e|0)>=d){dz(a,b,c,d,e);return}return H(wR)}function +ms(a){var b=a-9|0;a:{if(4>>0){if(23!==b)break a}else if(2===b)break a;return 1}return 0}function -v5(a,b){var -d=a8(b);if(0===d)return b;var -e=am(d),f=d-1|0,g=0;if(f>=0){var -c=g;for(;;){aq(e,c,h(a,d4(b,c)));var +wV(a,b){var +d=a9(b);if(0===d)return b;var +e=aj(d),f=d-1|0,g=0;if(f>=0){var +c=g;for(;;){aq(e,c,h(a,dB(b,c)));var i=c+1|0;if(f===c)break;c=i}}return e}function -l4(a,b,c){Tg(a,b,Tw(c));return}function -l5(a,b,c){cZ(a,b,c);return}function -l6(a,b){return f0(a,b)}function -e7(a){return du(a)}function -a$(a){return ip(a)}function -v2(a,b){var -c=a8(a),e=a8(b),d=am(c+e|0);b$(a,0,d,0,c);b$(b,0,d,c,e);return d}function -v3(a){var -d=a8(a),b=[0,0];for(;;){if(b[1]>=d)break;if(!l3(d4(a,b[1])))break;b[1]++}var -c=[0,d-1|0];for(;;){if(b[1]<=c[1]&&l3(d4(a,c[1]))){c[1]--;continue}return b[1]<=c[1]?gi(a,b[1],(c[1]-b[1]|0)+1|0):gh}}function -v4(a){var -b=[0,0],j=a8(a)-1|0,l=0;if(j>=0){var +mt(a,b,c){vh(a,b,Uz(c));return}function +mu(a,b,c){cg(a,b,c);return}function +mv(a,b){return f_(a,b)}function +eg(a){return dA(a)}function +a2(a){return iB(a)}function +wS(a,b){var +c=a9(a),e=a9(b),d=aj(c+e|0);cf(a,0,d,0,c);cf(b,0,d,c,e);return d}function +wT(a){var +d=a9(a),b=[0,0];for(;;){if(b[1]>=d)break;if(!ms(dB(a,b[1])))break;b[1]++}var +c=[0,d-1|0];for(;;){if(b[1]<=c[1]&&ms(dB(a,c[1]))){c[1]--;continue}return b[1]<=c[1]?gp(a,b[1],(c[1]-b[1]|0)+1|0):go}}function +wU(a){var +b=[0,0],j=a9(a)-1|0,l=0;if(j>=0){var g=l;for(;;){var -e=d4(a,g);a:{b:{c:{if(32<=e){var +e=dB(a,g);a:{b:{c:{if(32<=e){var h=e-34|0;if(58>>0){if(93<=h)break c}else if(56>>0)break b;var i=1;break a}if(11<=e){if(13===e)break b}else if(8<=e)break b}var i=4;break a}var i=2}b[1]=b[1]+i|0;var -o=g+1|0;if(j===g)break;g=o}}if(b[1]===a8(a))return l0(a);var -c=am(b[1]);b[1]=0;var -k=a8(a)-1|0,m=0;if(k>=0){var +o=g+1|0;if(j===g)break;g=o}}if(b[1]===a9(a))return a;var +c=aj(b[1]);b[1]=0;var +k=a9(a)-1|0,m=0;if(k>=0){var f=m;for(;;){var -d=d4(a,f);a:{b:{c:{if(35<=d){if(92!==d){if(dW<=d)break c;break b}}else{if(32>d){if(14<=d)break c;switch(d){case +d=dB(a,f);a:{b:{c:{if(35<=d){if(92!==d){if(d5<=d)break c;break b}}else{if(32>d){if(14<=d)break c;switch(d){case 8:aq(c,b[1],92);b[1]++;aq(c,b[1],98);break a;case 9:aq(c,b[1],92);b[1]++;aq(c,b[1],116);break a;case 10:aq(c,b[1],92);b[1]++;aq(c,b[1],110);break a;case -13:aq(c,b[1],92);b[1]++;aq(c,b[1],114);break a;default:break c}}if(34>d)break b}aq(c,b[1],92);b[1]++;aq(c,b[1],d);break a}aq(c,b[1],92);b[1]++;aq(c,b[1],48+(d/hO|0)|0);b[1]++;aq(c,b[1],48+((d/10|0)%10|0)|0);b[1]++;aq(c,b[1],48+(d%10|0)|0);break a}aq(c,b[1],d)}b[1]++;var +13:aq(c,b[1],92);b[1]++;aq(c,b[1],114);break a;default:break c}}if(34>d)break b}aq(c,b[1],92);b[1]++;aq(c,b[1],d);break a}aq(c,b[1],92);b[1]++;aq(c,b[1],48+(d/hZ|0)|0);b[1]++;aq(c,b[1],48+((d/10|0)%10|0)|0);b[1]++;aq(c,b[1],48+(d%10|0)|0);break a}aq(c,b[1],d)}b[1]++;var n=f+1|0;if(k===f)break;f=n}}return c}function -v6(a){return v5(vI,a)}function -e8(a,b){return a$(dA(a,b))}function -iC(a,b,c){return a$(gi(e7(a),b,c))}function -v7(a,b){return b<=a?a:H(v8)}function -v9(a,b,c){var +wW(a){return wV(wt,a)}function +wX(a,b){return Uh(a,b)}function +wY(a,b,c){vh(a,b,c);return}function +fj(a,b){return a2(dI(a,b))}function +iN(a,b,c){return a2(gp(eg(a),b,c))}function +wZ(a,b){return b<=a?a:H(w0)}function +w1(a,b,c){var e=a,d=c;for(;;){if(!d)return e;var f=d[1];if(!d[2])return p(f)+e|0;var -g=d[2];e=v7((p(f)+b|0)+e|0,e);d=g}}function -v_(a,b,c,d,e){var +g=d[2];e=wZ((p(f)+b|0)+e|0,e);d=g}}function +w2(a,b,c,d,e){var h=b,g=e;for(;;){if(!g)return a;var -f=g[1];if(!g[2]){dt(f,0,a,h,p(f));return a}var -i=g[2];dt(f,0,a,h,p(f));dt(c,0,a,h+p(f)|0,d);h=(h+p(f)|0)+d|0;g=i}}function -l7(a,b){if(!b)return v$;var -c=p(a);return a$(v_(am(v9(0,c,b)),0,a,c,b))}function -l8(a){var +f=g[1];if(!g[2]){dz(f,0,a,h,p(f));return a}var +i=g[2];dz(f,0,a,h,p(f));dz(c,0,a,h+p(f)|0,d);h=(h+p(f)|0)+d|0;g=i}}function +mw(a,b){if(!b)return w3;var +c=p(a);return a2(w2(aj(w1(0,c,b)),0,a,c,b))}function +mx(a){var b=a-9|0;a:{if(4>>0){if(23!==b)break a}else if(2===b)break a;return 1}return 0}function -wc(a,b,c,d){var -e=c;for(;;){if(b<=e)throw g(a9,1);if(bw(a,e)===d)return e;e=e+1|0}}function -wd(a,b,c){var -d=p(a);if(0<=b&&d>=b)try{wc(a,d,b,c);var +w6(a,b,c,d){var +e=c;for(;;){if(b<=e)throw g(a_,1);if(bt(a,e)===d)return e;e=e+1|0}}function +w7(a,b,c){var +d=p(a);if(0<=b&&d>=b)try{w6(a,d,b,c);var f=1;return f}catch(f){var -e=P(f);if(e===a9)return 0;throw g(e,0)}return H(we)}function -e9(a,b){return e0(a,b)}function -l9(a,b){return a==b?1:0}function -wa(a){if(a==e)return a;if(!l8(bw(a,0))&&!l8(bw(a,p(a)-1|0)))return a;return a$(v3(e7(a)))}function -wb(a){return function(a,b,c){var -d=c;for(;;){if(b<=d)return a;var -e=bw(a,d)+qS|0;a:{if(59>>0){if(33>>0)break a}else if(2===e)break a;d=d+1|0;continue}return a$(v4(e7(a)))}}(a,p(a),0)}function -wf(a,b){return wd(a,0,b)}function -wg(a){return a$(v6(e7(a)))}function -l_(a,b,c,d,e){if(0<=e&&0<=b&&(a.length-1-e|0)>=b&&0<=d&&(c.length-1-e|0)>=d){S7(a,b,c,d,e);return}return H(wl)}function -wp(a,b){var +e=P(f);if(e===a_)return 0;throw g(e,0)}return H(w8)}function +fk(a,b){return e$(a,b)}function +gq(a,b){return wX(eg(a),b)}function +my(a,b){return a==b?1:0}function +w4(a){if(a==e)return a;if(!mx(bt(a,0))&&!mx(bt(a,p(a)-1|0)))return a;return a2(wT(eg(a)))}function +w5(a){return a2(wU(eg(a)))}function +w9(a,b){return w7(a,0,b)}function +w_(a){return a2(wW(eg(a)))}function +mz(a,b,c,d,e){if(0<=e&&0<=b&&(a.length-1-e|0)>=b&&0<=d&&(c.length-1-e|0)>=d){T7(a,b,c,d,e);return}return H(xd)}function +xh(a,b){var d=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function -gj(a){if(!a)return[0];var -b=a[2],c=a[1],e=cz(wp(0,a),c);return function(a,b){var +gr(a){if(!a)return[0];var +b=a[2],c=a[1],e=cy(xh(0,a),c);return function(a,b){var d=a,c=b;for(;;){if(!c)return e;var f=c[2];e[1+d]=c[1];d=d+1|0;c=f}}(1,b)}function -wh(a,b){if(0===a)return[0];if(0>a)return H(wi);var -d=cz(a,h(b,0)),e=a-1|0,f=1;if(e>=1){var +w$(a,b){if(0===a)return[0];if(0>a)return H(xa);var +d=cy(a,h(b,0)),e=a-1|0,f=1;if(e>=1){var c=f;for(;;){d[1+c]=h(b,c);var g=c+1|0;if(e===c)break;c=g}}return d}function -wj(a,b,c){if(0<=b&&0<=c&&(a.length-1-c|0)>=b)return S8(a,b,c);return H(wk)}function -wm(a,b,c){if(b.length-1!==c.length-1)return H(wn);var +xb(a,b,c){if(0<=b&&0<=c&&(a.length-1-c|0)>=b)return T8(a,b,c);return H(xc)}function +xe(a,b,c){if(b.length-1!==c.length-1)return H(xf);var e=b.length-2|0,f=0;if(e>=0){var d=f;for(;;){i(a,b[1+d],c[1+d]);var g=d+1|0;if(e===d)break;d=g}}return 0}function -wo(e){return function(a,b){var +xg(e){return function(a,b){var c=a,d=b;for(;;){if(0>c)return d;var f=[0,e[1+c],d];c=c-1|0;d=f}}(e.length-2|0,0)}function -gk(a){return d9(a[2],a[5],a[6]-a[5]|0)}function -cC(a,b){return f0(a[2],b)}function -wq(a,b,c){var -e=uR(a,b,c),f=0<=e?1:0,g=f?c[12]!==iD?1:0:f;if(g){c[11]=c[12];var +gs(a){return ef(a[2],a[5],a[6]-a[5]|0)}function +cI(a,b){return f_(a[2],b)}function +xi(a,b,c){var +e=vA(a,b,c),f=0<=e?1:0,g=f?c[12]!==iO?1:0:f;if(g){c[11]=c[12];var d=c[12];c[12]=[0,d[1],d[2],d[3],c[4]+c[6]|0]}return e}function -wr(a,b){var -c=a?a[1]:1,d=c?l$:iD,e=c?l$:iD;return[0,function(a){a[9]=1;return 0},l1(b),p(b),0,0,0,0,0,1,[0],e,d]}function -ws(a,b,c){return d9(a[2],b,c-b|0)}function -wt(a,b){return f0(a[2],a[5]+b|0)}function -wu(l){function +xj(a,b){var +c=a?a[1]:1,d=c?mA:iO,e=c?mA:iO;return[0,function(a){a[9]=1;return 0},mq(b),p(b),0,0,0,0,0,1,[0],e,d]}function +xk(a,b,c){return ef(a[2],b,c-b|0)}function +xl(a,b){return f_(a[2],a[5]+b|0)}function +xm(l){function q(a){return a?a[4]:0}function d(a,b,c){var d=a?a[4]:0,e=c?c[4]:0,f=e<=d?d+1|0:e+1|0;return[0,a,b,c,f]}function e(a,b,c){var -g=a?a[4]:0,h=c?c[4]:0;if((h+2|0)=h){var -v=h<=g?g+1|0:h+1|0;return[0,a,b,c,v]}if(!c)return H(wy);var -j=c[3],l=c[2],f=c[1],r=q(f);if(r<=q(j))return d(d(a,b,f),l,j);if(!f)return H(wx);var +v=h<=g?g+1|0:h+1|0;return[0,a,b,c,v]}if(!c)return H(xq);var +j=c[3],l=c[2],f=c[1],r=q(f);if(r<=q(j))return d(d(a,b,f),l,j);if(!f)return H(xp);var s=f[2],t=f[1],u=d(f[3],l,j);return d(d(a,b,t),s,u)}function c(a,b){if(!b)return[0,0,a,0,1];var d=b[3],f=b[2],g=b[1],h=i(l[1],a,f);if(0===h)return b;if(0<=h){var @@ -1351,14 +1418,14 @@ c=b[2],d=b[1];return e(d,c,w(a,b[3]))}function j(a,b,c){if(!a)return v(b,c);if(!c)return w(b,a);var f=c[4],g=a[4],h=c[3],i=c[2],k=c[1],l=a[3],m=a[2],n=a[1];return(f+2|0)=a>>>0)switch(a){case h=b[2];if(h)return[0,[0,[0,0,b[1],0,1],h[1],0,2],h[2]]}break;default:if(b){var i=b[2];if(i){var j=i[2];if(j)return[0,[0,[0,0,b[1],0,1],i[1],[0,0,j[1],0,1],2],j[2]]}}}var -k=a/2|0,l=c(k,b),e=l[2],n=l[1];if(!e)throw g([0,f,wB],1);var -o=e[1],m=c((a-k|0)-1|0,e[2]),p=m[2];return[0,d(n,o,m[1]),p]}return c(gd(a),a)[1]}return[0,,,,c,,,,,,,,,,,,,z,function(a){return a?0:1},,u,n,o,,,p,,,A,function(a,b){return 0===A(a,b)?1:0},s,B,C,,,,,b,,function(a){return D(0,a)},,,,,,,,,,,function(a,b){var +k=a/2|0,l=c(k,b),e=l[2],n=l[1];if(!e)throw g([0,f,xt],1);var +o=e[1],m=c((a-k|0)-1|0,e[2]),p=m[2];return[0,d(n,o,m[1]),p]}return c(gl(a),a)[1]}return[0,,,,c,,,,,,,,,,,,,z,function(a){return a?0:1},,u,n,o,,,p,,,A,function(a,b){return 0===A(a,b)?1:0},s,B,C,,,,,b,,function(a){return D(0,a)},,,,,,,,,,,function(a,b){var c=b;for(;;){if(!c)return;var -d=c[2],e=c[3],f=c[1];if(h(a,d))return G(d,a,e);c=f}},,,,,,,function(a){if(!a)return z;var +d=c[2],e=c[3],f=c[1];if(h(a,d))return G(d,a,e);c=f}},,,,,,,,function(a){if(!a)return z;var e=a[2],b=a[1];if(!e)return k(b);var f=e[2],d=e[1];if(!f)return c(d,k(b));var g=f[2],h=f[1];if(!g)return c(h,c(d,k(b)));var -i=g[2],j=g[1];if(!i)return c(j,c(h,c(d,k(b))));if(i[2])return I(vW(l[1],a));var +i=g[2],j=g[1];if(!i)return c(j,c(h,c(d,k(b))));if(i[2])return I(wK(l[1],a));var m=i[1];return c(m,c(j,c(h,c(d,k(b)))))}]}function -ma(a){var -b=wu(a);return[0,b[17],b[18],,b[4],,b[20],b[21],b[22],,b[25],b[28],b[29],b[30],b[31],,b[32],,,,,,b[37],b[39],,,,,,,,,,,,,b[50],b[57]]}function -wC(d){function +mB(a){var +b=xm(a);return[0,b[17],b[4],,b[20],b[21],b[22],,b[25],b[37],b[39],,,,,,,,,,,,b[50],b[31],b[32],,,,,,b[18],,b[29],b[28],b[30],,,,b[58]]}function +xu(d){function l(a){return a?a[5]:0}function j(a,b,c,d){var e=l(a),f=l(d),g=f<=e?e+1|0:f+1|0;return[0,a,b,c,d,g]}function s(a,b){return[0,0,a,b,0,1]}function e(a,b,c,d){var -g=a?a[5]:0,h=d?d[5]:0;if((h+2|0)=h){var -A=h<=g?g+1|0:h+1|0;return[0,a,b,c,d,A]}if(!d)return H(wG);var -k=d[4],o=d[3],p=d[2],f=d[1],v=l(f);if(v<=l(k))return j(j(a,b,c,f),p,o,k);if(!f)return H(wF);var +A=h<=g?g+1|0:h+1|0;return[0,a,b,c,d,A]}if(!d)return H(xy);var +k=d[4],o=d[3],p=d[2],f=d[1],v=l(f);if(v<=l(k))return j(j(a,b,c,f),p,o,k);if(!f)return H(xx);var w=f[3],x=f[2],y=f[1],z=j(f[4],p,o,k);return j(j(a,b,c,y),x,w,z)}function p(a,b,c){if(!c)return[0,0,a,b,0,1];var f=c[4],h=c[3],j=c[2],g=c[1],n=c[5],k=i(d[1],a,j);if(0===k)return h===b?c:[0,g,a,b,f,n];if(0<=k){var l=p(a,b,f);return f===l?c:e(g,j,h,l)}var m=p(a,b,g);return g===m?c:e(m,j,h,f)}function t(a){var -b=a;for(;;){if(!b)throw g(a9,1);var +b=a;for(;;){if(!b)throw g(a_,1);var c=b[1];if(!c)return[0,b[2],b[3]];b=c}}function -c(a){if(!a)return H(wH);var +c(a){if(!a)return H(xz);var b=a[1];if(!b)return a[4];var d=a[4],f=a[3],g=a[2];return e(c(b),g,f,d)}function u(a,b){if(!a)return b;if(!b)return a;var @@ -1469,7 +1536,7 @@ c=b;for(;;){if(!c)return;var d=c[4],e=c[3],f=c[2];v(a,c[1]);i(a,f,e);c=d}}function w(a,b,c){var d=b,e=c;for(;;){if(!d)return e;var -f=d[4],g=d[3],h=d[2],i=a6(a,h,g,w(a,d[1],e));d=f;e=i}}function +f=d[4],g=d[3],h=d[2],i=a7(a,h,g,w(a,d[1],e));d=f;e=i}}function x(a,b){var c=b;for(;;){if(!c)return 1;var g=c[4],h=c[1],d=i(a,c[2],c[3]);if(d){var @@ -1486,20 +1553,20 @@ f=d[5],g=a[5],h=d[4],i=d[3],k=d[2],l=d[1],n=a[4],o=a[3],p=a[2],q=a[1];return(f+2 B(a,b){if(!a)return b;if(!b)return a;var d=t(b),e=d[2],f=d[1];return m(a,f,e,c(b))}function A(a,b,c,d){return c?m(a,b,c[1],d):B(a,d)}function -o(a,b){if(!b)return wI;var +o(a,b){if(!b)return xA;var c=b[4],e=b[3],f=b[2],g=b[1],k=i(d[1],a,f);if(0===k)return[0,g,[0,e],c];if(0<=k){var h=o(a,c),l=h[3],n=h[2];return[0,m(g,f,e,h[1]),n,l]}var j=o(a,g),p=j[2],q=j[1];return[0,q,p,m(j[3],f,e,c)]}function n(a,b,c){if(b){var d=b[2],j=b[5],k=b[4],m=b[3],p=b[1];if(l(c)<=j){var -e=o(d,c),q=e[2],r=e[1],s=n(a,k,e[3]),t=a6(a,d,[0,m],q);return A(n(a,p,r),d,t,s)}}else if(!c)return 0;if(!c)throw g([0,f,wJ],1);var -h=c[2],u=c[4],v=c[3],w=c[1],i=o(h,b),x=i[2],y=i[1],z=n(a,i[3],u),B=a6(a,h,x,[0,v]);return A(n(a,y,w),h,B,z)}function +e=o(d,c),q=e[2],r=e[1],s=n(a,k,e[3]),t=a7(a,d,[0,m],q);return A(n(a,p,r),d,t,s)}}else if(!c)return 0;if(!c)throw g([0,f,xB],1);var +h=c[2],u=c[4],v=c[3],w=c[1],i=o(h,b),x=i[2],y=i[1],z=n(a,i[3],u),B=a7(a,h,x,[0,v]);return A(n(a,y,w),h,B,z)}function k(a,b){var c=a,d=b;for(;;){if(!c)return d;var e=[0,c[2],c[3],c[4],d];c=c[1];d=e}}function b(a){if(!a)return;var c=a[1];b(a[4]);b(c);return}return[0,,,,,0,,p,function(a,b){var -c=b;for(;;){if(!c)throw g(a9,1);var +c=b;for(;;){if(!c)throw g(a_,1);var f=c[4],h=c[3],j=c[1],e=i(d[1],a,c[2]);if(0===e)return h;var k=0<=e?f:j;c=k}},,,,,,,,,function(a,b){var c=b;for(;;){if(!c)return 0;var @@ -1507,7 +1574,7 @@ f=c[4],g=c[3],h=c[1],e=i(d[1],a,c[2]);if(0===e)return[0,g];var j=0<=e?f:h;c=j}},function(a,b){var c=b;for(;;){if(!c)return;var g=c[4],h=c[1],e=i(d[1],a,c[2]),f=0===e?1:0;if(f)return f;var -j=0<=e?g:h;c=j}},,,,,,q,r,v,,,w,x,,,,,,,,n,,,,,,function(h,b,c){var +j=0<=e?g:h;c=j}},,,,,,q,r,,v,,,w,x,,,,,,,,n,,,,,,function(h,b,c){var a=k(c,0);return function(a,b){var e=a,c=b;for(;;){if(!e){if(c)return;return}if(!c)return;var j=c[4],l=c[3],m=c[2],n=e[4],o=e[3],p=e[2],f=i(d[1],e[1],c[1]);if(0!==f)return f;var @@ -1517,110 +1584,137 @@ a=k(c,0);return function(a,b){var e=a,c=b;for(;;){if(!e){if(c)return;return}if(!c)return;var g=c[4],h=c[3],j=c[2],l=e[4],m=e[3],n=e[2];if(0===i(d[1],e[1],c[1])&&i(f,n,j)){var o=k(h,g);e=k(m,l);c=o;continue}return}}(k(b,0),a)},b]}function -iE(a){var -b=wC(a);return[0,b[5],,b[18],b[7],b[25],,b[24],b[38],,b[44],b[45],b[26],b[29],b[30],,,,,b[46],,,,,,,,,b[8],b[17]]}var -iF=[B,wK,ar(0)];function -d_(a){return[0,0,0]}function -e_(a){a[1]=0;a[2]=0;return}function -c5(a,b){b[1]=[0,a,b[1]];b[2]=b[2]+1|0;return 0}function -d$(a){var +iP(a){var +b=xu(a);return[0,b[5],b[7],,b[25],,b[24],b[39],,b[47],,,,,,,,b[8],b[17],,,,,b[27],b[30],,,,,,,,b[18],b[46],b[45],b[31]]}var +iQ=[B,xC,ar(0)];function +eh(a){return[0,0,0]}function +fl(a){a[1]=0;a[2]=0;return}function +c$(a,b){b[1]=[0,a,b[1]];b[2]=b[2]+1|0;return 0}function +ei(a){var b=a[1];if(!b)return 0;var c=b[1];a[1]=b[2];a[2]=a[2]-1|0;return[0,c]}function -ea(a){var +ej(a){var b=a[1];return b?[0,b[1]]:0}function -wL(a){var -b=a[1];if(!b)throw g(iF,1);a[1]=b[2];a[2]=a[2]-1|0;return}function -wM(a){if(a[1])return;throw g(iF,1)}function -wN(a,b){return cA(a,b[1])}var -wP=[B,wO,ar(0)];function -iG(a){return[0,0,0,0]}function -iH(a){a[1]=0;a[2]=0;a[3]=0;return}function -iI(a,b){var +xD(a){var +b=a[1];if(!b)throw g(iQ,1);a[1]=b[2];a[2]=a[2]-1|0;return}function +xE(a){if(a[1])return;throw g(iQ,1)}function +xF(a,b){return cA(a,b[1])}var +xH=[B,xG,ar(0)];function +iR(a){return[0,0,0,0]}function +iS(a){a[1]=0;a[2]=0;a[3]=0;return}function +iT(a,b){var c=[0,a,0],d=b[3];return d?(b[1]=b[1]+1|0,d[2]=c,b[3]=c,0):(b[1]=1,b[2]=c,b[3]=c,0)}function -mb(a){var -b=a[2];if(!b)throw g(wP,1);var +mC(a){var +b=a[2];if(!b)throw g(xH,1);var c=b[1];if(b[2]){var -d=b[2];a[1]=a[1]-1|0;a[2]=d;return c}iH(a);return c}function -iJ(a){return 0===a[1]?1:0}function -wQ(a){var +d=b[2];a[1]=a[1]-1|0;a[2]=d;return c}iS(a);return c}function +iU(a){return 0===a[1]?1:0}function +xI(a){var b=a[2];return b?[0,b[1]]:0}function -wR(a){var +xJ(a){var b=a[2];if(!b)return 0;var c=b[1];if(b[2]){var -d=b[2];a[1]=a[1]-1|0;a[2]=d;return[0,c]}iH(a);return[0,c]}function -cd(a){var -b=1<=a?a:1,c=e5=(d+b|0))break;c[1]=2*c[1]|0}if(e5a[3])throw g([0,f,wX],1);if((d+b|0)<=a[3])return;throw g([0,f,wW],1)}function +d=b[2];a[1]=a[1]-1|0;a[2]=d;return[0,c]}iS(a);return[0,c]}function +bL(a){var +b=1<=a?a:1,c=ff=(d+b|0))break;c[1]=2*c[1]|0}if(ff=b)return d9(a[1],b,c);return H(wT)}function -wU(a){return a[2]}function -wV(a){a[2]=0;a[1]=a[4];a[3]=a8(a[1]);return}function -w0(a,b,c,d){return fa(a,a$(b),c,d)}function -iL(a){return 5===a[2]?12:-6}function -mc(a){return[0,0,am(a)]}function -md(a,b){var -c=a8(a[2]),d=a[1]+b|0;if(c=b)return ef(a[1][1],b,c);return H(xL)}function +xM(a){a[2]=0;a[1]=[0,a[3],a9(a[3])];return}function +xP(a,b,c,d){return el(a,a2(b),c,d)}var +iW=[0,0];function +mE(a){return a}function +mF(a){return a!==iW?1:0}function +mG(a){return a}(function(a){Ul(cy(8,iW));return}(0));var +xQ=fh(0),mH=fh(0);function +xR(a){for(;;){var +b=fg(mH),c=1-mj(mH,b,[0,a,b]);if(!c)return c}}function +cJ(a,b){var +c=[0,wb(xQ,1),b];if(a)xR([0,c,a[1]]);return c}function +mI(d){for(;;){var +a=vk(0),b=a.length-1;if(de){if(32!==e){if(43>e)break a;switch(e-43|0){case -5:c:if(c<(d+2|0)&&1e){if(32!==e){if(43>e)break a;switch(e-43|0){case +5:c:if(c<(d+2|0)&&1=(d+1|0))break a;var -f=dA(d+1|0,48);cZ(f,0,e);cB(b,1,f,(d-c|0)+2|0,c-1|0);return a$(f)}if(71<=e){if(5>>0)break a}else if(65>e)break a}if(c>>0)break a}else if(65>e)break a}if(ca)return b;var +14:return zq;default:return zz}}function +mO(a,b){var +d=fc(b),e=xX(zA,a),c=mK(16);em(c,37);xY(c,a);em(c,46);a4(c,wN(d));em(c,e);return mM(c)}function +gu(a,b){if(13>a)return b;var h=[0,0],i=p(b)-1|0,n=0;if(i>=0){var -d=n;for(;;){if(9>=bw(b,d)+fU>>>0)h[1]++;var +d=n;for(;;){if(9>=bt(b,d)+f3>>>0)h[1]++;var r=d+1|0;if(i===d)break;d=r}}var -j=h[1],k=am(p(b)+((j-1|0)/3|0)|0),l=[0,0];function -e(a){cZ(k,l[1],a);l[1]++;return}var +j=h[1],k=aj(p(b)+((j-1|0)/3|0)|0),l=[0,0];function +e(a){cg(k,l[1],a);l[1]++;return}var f=[0,((j-1|0)%3|0)+1|0],m=p(b)-1|0,o=0;if(m>=0){var c=o;for(;;){var -g=bw(b,c);if(9>>0)e(g);else{if(0===f[1]){e(95);f[1]=3}f[1]--;e(g)}var -q=c+1|0;if(m===c)break;c=q}}return a$(k)}function -yF(a,b){return gm(a,f5(xM(a),b))}function -yG(a,b){return gm(a,f5(yc(a),b))}function -yH(a,b){return gm(a,f5(yq(a),b))}function -yI(a,b){return gm(a,Tz(x0(a),b))}function -cD(d,b,c){function +g=bt(b,c);if(9>>0)e(g);else{if(0===f[1]){e(95);f[1]=3}f[1]--;e(g)}var +q=c+1|0;if(m===c)break;c=q}}return a2(k)}function +zB(a,b){return gu(a,gd(yI(a),b))}function +zC(a,b){return gu(a,gd(y_(a),b))}function +zD(a,b){return gu(a,gd(zm(a),b))}function +zE(a,b){return gu(a,UC(yW(a),b))}function +cK(d,b,c){function a(a){switch(d[1]){case 0:var e=45;break;case 1:var e=43;break;default:var -e=32}return Tu(c,b,e)}function +e=32}return Ux(c,b,e)}function e(a){var -b=ig(c);return 3===b?c<0.?yK:yL:4<=b?yM:a}function +b=is(c);return 3===b?c<0.?zG:zH:4<=b?zI:a}function f(b){var e=p(b);return function(a){var c=a;for(;;){if(c===e)return 0;var -d=V(b,c)-46|0;a:{if(23>>0){if(55===d)break a}else if(21>>0)break a;c=c+1|0;continue}return 1}}(0)?b:a1(b,yJ)}switch(d[2]){case -5:return e(f(lt(mg(d,b),c)));case +d=ak(b,c)-46|0;a:{if(23>>0){if(55===d)break a}else if(21>>0)break a;c=c+1|0;continue}return 1}}(0)?b:a$(b,zF)}switch(d[2]){case +5:return e(f(lP(mO(d,b),c)));case 6:return a(0);case -7:return wg(a(0));case -8:return e(a(0));default:return lt(mg(d,b),c)}}function -yN(a){var -b=vB(a),c=p(b),d=dA(c+2|0,39);dt(b,0,d,1,c);return a$(d)}function -yO(a){var -b=mc(16);iM(b,a);return me(b)}function -fA(a,b,c,d){var +7:return w_(a(0));case +8:return e(a(0));default:return lP(mO(d,b),c)}}function +zJ(a){var +b=wm(a),c=p(b),d=dI(c+2|0,39);dz(b,0,d,1,c);return a2(d)}function +zK(a){var +b=mK(16);iZ(b,a);return mM(b)}function +fK(a,b,c,d){var k=b,j=c,e=d;for(;;){if(typeof e==="number")return h(k,j);switch(e[0]){case 0:var -s=e[1];return function(a){return G(k,[5,j,a],s)};case +s=e[1];return function(a){return F(k,[5,j,a],s)};case 1:var -t=e[1];return function(a){return G(k,[4,j,yN(a)],t)};case -2:return iN(k,j,e[2],e[1],function(a){return a});case -3:return iN(k,j,e[2],e[1],xL);case -4:return gn(k,j,e[4],e[2],e[3],yF,e[1]);case -5:return gn(k,j,e[4],e[2],e[3],yG,e[1]);case -6:return gn(k,j,e[4],e[2],e[3],yH,e[1]);case -7:return gn(k,j,e[4],e[2],e[3],yI,e[1]);case -8:return yP(k,j,e[4],e[2],e[3],e[1]);case -9:return iN(k,j,e[2],e[1],vf);case +t=e[1];return function(a){return F(k,[4,j,zJ(a)],t)};case +2:return i0(k,j,e[2],e[1],function(a){return a});case +3:return i0(k,j,e[2],e[1],yH);case +4:return gv(k,j,e[4],e[2],e[3],zB,e[1]);case +5:return gv(k,j,e[4],e[2],e[3],zC,e[1]);case +6:return gv(k,j,e[4],e[2],e[3],zD,e[1]);case +7:return gv(k,j,e[4],e[2],e[3],zE,e[1]);case +8:return zL(k,j,e[4],e[2],e[3],e[1]);case +9:return i0(k,j,e[2],e[1],v0);case 10:j=[7,j];e=e[1];break;case 11:j=[2,j,e[1]];e=e[2];break;case 12:j=[3,j,e[1]];e=e[2];break;case 13:var -u=e[3],v=yO(e[2]);return function(a){return G(k,[4,j,v],u)};case +u=e[3],v=zK(e[2]);return function(a){return F(k,[4,j,v],u)};case 14:var -w=e[3],x=e[2];return function(a){return G(k,j,ak(xK(a[1],x),w))};case +w=e[3],x=e[2];return function(a){return F(k,j,al(yG(a[1],x),w))};case 15:var -y=e[1];return function(c,b){return G(k,[6,j,function(a){return i(c,a,b)}],y)};case +y=e[1];return function(c,b){return F(k,[6,j,function(a){return i(c,a,b)}],y)};case 16:var -z=e[1];return function(a){return G(k,[6,j,a],z)};case +z=e[1];return function(a){return F(k,[6,j,a],z)};case 17:j=[0,j,e[1]];e=e[2];break;case 18:var m=e[1];if(0===m[0]){let -b=j,c=k,d=e[2];k=function(a){return G(c,[1,b,[0,a]],d)};j=0;e=m[1][1]}else{let -b=j,c=k,d=e[2];k=function(a){return G(c,[1,b,[1,a]],d)};j=0;e=m[1][1]}break;case -19:throw g([0,f,yR],1);case +b=j,c=k,d=e[2];k=function(a){return F(c,[1,b,[0,a]],d)};j=0;e=m[1][1]}else{let +b=j,c=k,d=e[2];k=function(a){return F(c,[1,b,[1,a]],d)};j=0;e=m[1][1]}break;case +19:throw g([0,f,zN],1);case 20:var -A=e[3],B=[8,j,yS];return function(a){return G(k,B,A)};case +A=e[3],B=[8,j,zO];return function(a){return F(k,B,A)};case 21:var -C=e[2];return function(a){return G(k,[4,j,f5(qm,a)],C)};case +C=e[2];return function(a){return F(k,[4,j,gd(q2,a)],C)};case 22:var -D=e[1];return function(a){return G(k,[5,j,a],D)};case +D=e[1];return function(a){return F(k,[5,j,a],D)};case 23:var -n=e[2],o=e[1];return a<50?pH(a+1|0,k,j,o,n):l(pH,[0,k,j,o,n]);default:var -p=e[3],q=e[1],r=h(e[2],0);return a<50?kg(a+1|0,k,j,p,q,r):l(kg,[0,k,j,p,q,r])}}}function -G(a,b,c){return bI(fA(0,a,b,c))}function -pH(a,b,c,d,e){if(typeof +n=e[2],o=e[1];return a<50?qk(a+1|0,k,j,o,n):l(qk,[0,k,j,o,n]);default:var +p=e[3],q=e[1],r=h(e[2],0);return a<50?kB(a+1|0,k,j,p,q,r):l(kB,[0,k,j,p,q,r])}}}function +F(a,b,c){return bJ(fK(0,a,b,c))}function +qk(a,b,c,d,e){if(typeof d==="number")switch(d){case -0:return a<50?X(a+1|0,b,c,e):l(X,[0,b,c,e]);case -1:return a<50?X(a+1|0,b,c,e):l(X,[0,b,c,e]);case -2:throw g([0,f,yT],1);default:return a<50?X(a+1|0,b,c,e):l(X,[0,b,c,e])}switch(d[0]){case -0:return a<50?X(a+1|0,b,c,e):l(X,[0,b,c,e]);case -1:return a<50?X(a+1|0,b,c,e):l(X,[0,b,c,e]);case -2:return a<50?X(a+1|0,b,c,e):l(X,[0,b,c,e]);case -3:return a<50?X(a+1|0,b,c,e):l(X,[0,b,c,e]);case -4:return a<50?X(a+1|0,b,c,e):l(X,[0,b,c,e]);case -5:return a<50?X(a+1|0,b,c,e):l(X,[0,b,c,e]);case -6:return a<50?X(a+1|0,b,c,e):l(X,[0,b,c,e]);case -7:return a<50?X(a+1|0,b,c,e):l(X,[0,b,c,e]);case -8:return a<50?X(a+1|0,b,c,e):l(X,[0,b,c,e]);case +0:return a<50?W(a+1|0,b,c,e):l(W,[0,b,c,e]);case +1:return a<50?W(a+1|0,b,c,e):l(W,[0,b,c,e]);case +2:throw g([0,f,zP],1);default:return a<50?W(a+1|0,b,c,e):l(W,[0,b,c,e])}switch(d[0]){case +0:return a<50?W(a+1|0,b,c,e):l(W,[0,b,c,e]);case +1:return a<50?W(a+1|0,b,c,e):l(W,[0,b,c,e]);case +2:return a<50?W(a+1|0,b,c,e):l(W,[0,b,c,e]);case +3:return a<50?W(a+1|0,b,c,e):l(W,[0,b,c,e]);case +4:return a<50?W(a+1|0,b,c,e):l(W,[0,b,c,e]);case +5:return a<50?W(a+1|0,b,c,e):l(W,[0,b,c,e]);case +6:return a<50?W(a+1|0,b,c,e):l(W,[0,b,c,e]);case +7:return a<50?W(a+1|0,b,c,e):l(W,[0,b,c,e]);case +8:return a<50?W(a+1|0,b,c,e):l(W,[0,b,c,e]);case 9:var -h=d[2];return a<50?kh(a+1|0,b,c,h,e):l(kh,[0,b,c,h,e]);case -10:return a<50?X(a+1|0,b,c,e):l(X,[0,b,c,e]);default:return a<50?X(a+1|0,b,c,e):l(X,[0,b,c,e])}}function -kh(a,h,c,d,e){if(typeof -d==="number")return a<50?X(a+1|0,h,c,e):l(X,[0,h,c,e]);switch(d[0]){case +h=d[2];return a<50?kC(a+1|0,b,c,h,e):l(kC,[0,b,c,h,e]);case +10:return a<50?W(a+1|0,b,c,e):l(W,[0,b,c,e]);default:return a<50?W(a+1|0,b,c,e):l(W,[0,b,c,e])}}function +kC(a,h,c,d,e){if(typeof +d==="number")return a<50?W(a+1|0,h,c,e):l(W,[0,h,c,e]);switch(d[0]){case 0:var -b=d[1];return function(a){return bJ(h,c,b,e)};case +b=d[1];return function(a){return bN(h,c,b,e)};case 1:var -i=d[1];return function(a){return bJ(h,c,i,e)};case +i=d[1];return function(a){return bN(h,c,i,e)};case 2:var -j=d[1];return function(a){return bJ(h,c,j,e)};case +j=d[1];return function(a){return bN(h,c,j,e)};case 3:var -k=d[1];return function(a){return bJ(h,c,k,e)};case +k=d[1];return function(a){return bN(h,c,k,e)};case 4:var -m=d[1];return function(a){return bJ(h,c,m,e)};case +m=d[1];return function(a){return bN(h,c,m,e)};case 5:var -n=d[1];return function(a){return bJ(h,c,n,e)};case +n=d[1];return function(a){return bN(h,c,n,e)};case 6:var -o=d[1];return function(a){return bJ(h,c,o,e)};case +o=d[1];return function(a){return bN(h,c,o,e)};case 7:var -p=d[1];return function(a){return bJ(h,c,p,e)};case +p=d[1];return function(a){return bN(h,c,p,e)};case 8:var -q=d[2];return function(a){return bJ(h,c,q,e)};case +q=d[2];return function(a){return bN(h,c,q,e)};case 9:var -r=d[3],s=d[2],t=aP(aH(d[1]),s);return function(a){return bJ(h,c,bm(t,r),e)};case +r=d[3],s=d[2],t=aP(aH(d[1]),s);return function(a){return bN(h,c,bm(t,r),e)};case 10:var -u=d[1];return function(a,b){return bJ(h,c,u,e)};case +u=d[1];return function(a,b){return bN(h,c,u,e)};case 11:var -v=d[1];return function(a){return bJ(h,c,v,e)};case +v=d[1];return function(a){return bN(h,c,v,e)};case 12:var -w=d[1];return function(a){return bJ(h,c,w,e)};case -13:throw g([0,f,yU],1);default:throw g([0,f,yV],1)}}function -bJ(a,b,c,d){return bI(kh(0,a,b,c,d))}function -X(a,b,c,d){var -e=[8,c,yW];return a<50?fA(a+1|0,b,e,d):l(fA,[0,b,e,d])}function -iN(g,f,c,d,e){if(typeof -d==="number")return function(a){return G(g,[4,f,h(e,a)],c)};if(0===d[0]){var -b=d[2],i=d[1];return function(a){return G(g,[4,f,by(i,b,h(e,a))],c)}}var -j=d[1];return function(a,b){return G(g,[4,f,by(j,a,h(e,b))],c)}}function -gn(k,j,h,d,e,f,g){if(typeof +w=d[1];return function(a){return bN(h,c,w,e)};case +13:throw g([0,f,zQ],1);default:throw g([0,f,zR],1)}}function +bN(a,b,c,d){return bJ(kC(0,a,b,c,d))}function +W(a,b,c,d){var +e=[8,c,zS];return a<50?fK(a+1|0,b,e,d):l(fK,[0,b,e,d])}function +i0(g,f,c,d,e){if(typeof +d==="number")return function(a){return F(g,[4,f,h(e,a)],c)};if(0===d[0]){var +b=d[2],i=d[1];return function(a){return F(g,[4,f,bB(i,b,h(e,a))],c)}}var +j=d[1];return function(a,b){return F(g,[4,f,bB(j,a,h(e,b))],c)}}function +gv(k,j,h,d,e,f,g){if(typeof d==="number"){if(typeof -e==="number")return e?function(a,b){return G(k,[4,j,ec(a,i(f,g,b))],h)}:function(a){return G(k,[4,j,i(f,g,a)],h)};var -b=e[1];return function(a){return G(k,[4,j,ec(b,i(f,g,a))],h)}}if(0===d[0]){var +e==="number")return e?function(a,b){return F(k,[4,j,en(a,i(f,g,b))],h)}:function(a){return F(k,[4,j,i(f,g,a)],h)};var +b=e[1];return function(a){return F(k,[4,j,en(b,i(f,g,a))],h)}}if(0===d[0]){var c=d[2],l=d[1];if(typeof -e==="number")return e?function(a,b){return G(k,[4,j,by(l,c,ec(a,i(f,g,b)))],h)}:function(a){return G(k,[4,j,by(l,c,i(f,g,a))],h)};var -n=e[1];return function(a){return G(k,[4,j,by(l,c,ec(n,i(f,g,a)))],h)}}var +e==="number")return e?function(a,b){return F(k,[4,j,bB(l,c,en(a,i(f,g,b)))],h)}:function(a){return F(k,[4,j,bB(l,c,i(f,g,a))],h)};var +n=e[1];return function(a){return F(k,[4,j,bB(l,c,en(n,i(f,g,a)))],h)}}var m=d[1];if(typeof -e==="number")return e?function(a,b,c){return G(k,[4,j,by(m,a,ec(b,i(f,g,c)))],h)}:function(a,b){return G(k,[4,j,by(m,a,i(f,g,b))],h)};var -o=e[1];return function(a,b){return G(k,[4,j,by(m,a,ec(o,i(f,g,b)))],h)}}function -yP(i,h,g,d,e,f){if(typeof +e==="number")return e?function(a,b,c){return F(k,[4,j,bB(m,a,en(b,i(f,g,c)))],h)}:function(a,b){return F(k,[4,j,bB(m,a,i(f,g,b))],h)};var +o=e[1];return function(a,b){return F(k,[4,j,bB(m,a,en(o,i(f,g,b)))],h)}}function +zL(i,h,g,d,e,f){if(typeof d==="number"){if(typeof -e==="number")return e?function(a,b){return G(i,[4,h,cD(f,a,b)],g)}:function(a){return G(i,[4,h,cD(f,iL(f),a)],g)};var -b=e[1];return function(a){return G(i,[4,h,cD(f,b,a)],g)}}if(0===d[0]){var +e==="number")return e?function(a,b){return F(i,[4,h,cK(f,a,b)],g)}:function(a){return F(i,[4,h,cK(f,iY(f),a)],g)};var +b=e[1];return function(a){return F(i,[4,h,cK(f,b,a)],g)}}if(0===d[0]){var c=d[2],j=d[1];if(typeof -e==="number")return e?function(a,b){return G(i,[4,h,by(j,c,cD(f,a,b))],g)}:function(a){return G(i,[4,h,by(j,c,cD(f,iL(f),a))],g)};var -l=e[1];return function(a){return G(i,[4,h,by(j,c,cD(f,l,a))],g)}}var +e==="number")return e?function(a,b){return F(i,[4,h,bB(j,c,cK(f,a,b))],g)}:function(a){return F(i,[4,h,bB(j,c,cK(f,iY(f),a))],g)};var +l=e[1];return function(a){return F(i,[4,h,bB(j,c,cK(f,l,a))],g)}}var k=d[1];if(typeof -e==="number")return e?function(a,b,c){return G(i,[4,h,by(k,a,cD(f,b,c))],g)}:function(a,b){return G(i,[4,h,by(k,a,cD(f,iL(f),b))],g)};var -m=e[1];return function(a,b){return G(i,[4,h,by(k,a,cD(f,m,b))],g)}}function -kg(a,b,c,d,e,f){if(e){var -i=e[1];return function(a){return yQ(b,c,d,i,h(f,a))}}var -g=[4,c,f];return a<50?fA(a+1|0,b,g,d):l(fA,[0,b,g,d])}function -yQ(a,b,c,d,e){return bI(kg(0,a,b,c,d,e))}function -cE(a,b){var +e==="number")return e?function(a,b,c){return F(i,[4,h,bB(k,a,cK(f,b,c))],g)}:function(a,b){return F(i,[4,h,bB(k,a,cK(f,iY(f),b))],g)};var +m=e[1];return function(a,b){return F(i,[4,h,bB(k,a,cK(f,m,b))],g)}}function +kB(a,b,c,d,e,f){if(e){var +i=e[1];return function(a){return zM(b,c,d,i,h(f,a))}}var +g=[4,c,f];return a<50?fK(a+1|0,b,g,d):l(fK,[0,b,g,d])}function +zM(a,b,c,d,e){return bJ(kB(0,a,b,c,d,e))}function +cL(a,b){var c=b;for(;;){if(typeof c==="number")return;switch(c[0]){case 0:var -f=c[1],g=mf(c[2]);cE(a,f);return e4(a,g);case +f=c[1],g=mN(c[2]);cL(a,f);return fd(a,g);case 1:var d=c[2],e=c[1];if(0===d[0]){var -i=d[1];cE(a,e);e4(a,yX);c=i}else{var -j=d[1];cE(a,e);e4(a,yY);c=j}break;case +i=d[1];cL(a,e);fd(a,zT);c=i}else{var +j=d[1];cL(a,e);fd(a,zU);c=j}break;case 6:var -m=c[2];cE(a,c[1]);return h(m,a);case -7:cE(a,c[1]);return gc(a);case +m=c[2];cL(a,c[1]);return h(m,a);case +7:cL(a,c[1]);return fe(a);case 8:var -n=c[2];cE(a,c[1]);return H(n);case +n=c[2];cL(a,c[1]);return H(n);case 2:case 4:var -k=c[2];cE(a,c[1]);return e4(a,k);default:var -l=c[2];cE(a,c[1]);return vs(a,l)}}}function -cF(a,b){var +k=c[2];cL(a,c[1]);return fd(a,k);default:var +l=c[2];cL(a,c[1]);return wa(a,l)}}}function +cM(a,b){var c=b;for(;;){if(typeof c==="number")return;switch(c[0]){case 0:var -f=c[1],g=mf(c[2]);cF(a,f);return a2(a,g);case +f=c[1],g=mN(c[2]);cM(a,f);return a3(a,g);case 1:var d=c[2],e=c[1];if(0===d[0]){var -i=d[1];cF(a,e);a2(a,yZ);c=i}else{var -j=d[1];cF(a,e);a2(a,y0);c=j}break;case +i=d[1];cM(a,e);a3(a,zV);c=i}else{var +j=d[1];cM(a,e);a3(a,zW);c=j}break;case 6:var -n=c[2];cF(a,c[1]);return a2(a,h(n,0));case +n=c[2];cM(a,c[1]);return a3(a,h(n,0));case 7:c=c[1];break;case 8:var -o=c[2];cF(a,c[1]);return H(o);case +o=c[2];cM(a,c[1]);return H(o);case 2:case 4:var -k=c[2];cF(a,c[1]);return a2(a,k);default:var -l=c[2];cF(a,c[1]);return m(a,l)}}}function -y1(a){var -c=a[1],b=cd(cw);return G(function(a){cF(b,a);return e2(ce(b))},0,c)}function -mh(c){if(c==e)return y2;var +k=c[2];cM(a,c[1]);return a3(a,k);default:var +l=c[2];cM(a,c[1]);return m(a,l)}}}function +zX(a){var +c=a[1],b=bL(cG);return F(function(a){cM(b,a);return fb(b3(b))},0,c)}function +mP(c){if(c==e)return zY;var f=p(c);function -j(a){return h(y1(y3),c)}function +j(a){return h(zX(zZ),c)}function k(a){var b=a;for(;;){if(b===f)return b;var -d=V(c,b);if(9!==d&&32!==d)return b;b=b+1|0}}var +d=ak(c,b);if(9!==d&&32!==d)return b;b=b+1|0}}var i=k(0),n=function(a,b){var -d=b;for(;;){if(d===f)return d;if(25>>0)return d;d=d+1|0}}(i,i),a=iC(c,i,n-i|0),d=k(n),l=function(a,b){var +d=b;for(;;){if(d===f)return d;if(25>>0)return d;d=d+1|0}}(i,i),a=iN(c,i,n-i|0),d=k(n),l=function(a,b){var d=b;for(;;){if(d===f)return d;var -e=V(c,d);a:{if(48<=e){if(58>e)break a}else if(45===e)break a;return d}d=d+1|0}}(d,d);if(d===l)var +e=ak(c,d);a:{if(48<=e){if(58>e)break a}else if(45===e)break a;return d}d=d+1|0}}(d,d);if(d===l)var m=0;else try{var -r=uO(iC(c,d,l-d|0)),m=r}catch(f){var -o=P(f);if(o[1]!==dy)throw g(o,0);var +r=vw(iN(c,d,l-d|0)),m=r}catch(f){var +o=P(f);if(o[1]!==dH)throw g(o,0);var q=j(0),m=q}if(k(l)!==f)j(0);a:{if(a!==e&&a!==aL){if(a===S){var b=0;break a}if(a==="hov"){var -b=3;break a}if(a===rL){var +b=3;break a}if(a===sl){var b=2;break a}if(a!==aZ){var b=j(0);break a}var b=1;break a}var b=4}return[0,m,b]}function -y4(d,b,c){return G(function(a){cE(b,a);return h(d,b)},0,c[1])}function -go(a,b){return y4(function(a){return 0},a,b)}function -gp(a){return go(cb,a)}function -mi(c,b){return G(function(a){var -b=cd(64);cF(b,a);return h(c,ce(b))},0,b[1])}function -t(a){return mi(function(a){return a},a)}var -iO=is(0);function -iQ(a,b){var -c=a[1+b];return lT(c)?c2(c)===eN?h(t(y5),c):c2(c)===kt?vl(c):y6:h(t(y7),c)}function -mj(a,b){if(a.length-1<=b)return y8;var -c=mj(a,b+1|0),d=iQ(a,b);return i(t(y9),d,c)}function -y_(a){var +z0(d,b,c){return F(function(a){cL(b,a);return h(d,b)},0,c[1])}function +gw(a,b){return z0(function(a){return 0},a,b)}function +gx(a){return gw(bK,a)}function +mQ(c,b){return F(function(a){var +b=bL(64);cM(b,a);return h(c,b3(b))},0,b[1])}function +t(a){return mQ(function(a){return a},a)}var +i1=fh(0);function +i3(a,b){var +c=a[1+b];return mi(c)?dG(c)===eZ?h(t(z1),c):dG(c)===kO?v6(c):z2:h(t(z3),c)}function +mR(a,b){if(a.length-1<=b)return z4;var +c=mR(a,b+1|0),d=i3(a,b);return i(t(z5),d,c)}function +z6(a){var b=a.length-1;if(2>=b>>>0)switch(b){case -0:return za;case -1:return zb;default:var -e=iQ(a,1);return h(t(zc),e)}var -c=mj(a,2),d=iQ(a,1);return i(t(y$),d,c)}function -zd(d){return function(a){var +0:return z8;case +1:return z9;default:var +e=i3(a,1);return h(t(z_),e)}var +c=mR(a,2),d=i3(a,1);return i(t(z7),d,c)}function +z$(d){return function(a){var b=a;for(;;){if(!b)return 0;var e=b[2],f=b[1];a:{try{var -c=h(f,d)}catch(f){break a}if(c)return[0,c[1]]}b=e}}(ga(iO))}function -ze(a){if(a===iu)return zf;if(a===lO)return zg;if(a[1]===lN){var -b=a[2],e=b[3],i=b[2],j=b[1];return eB(t(iP),j,i,e,e+5|0,zh)}if(a[1]===f){var -c=a[2],g=c[3],k=c[2],l=c[1];return eB(t(iP),l,k,g,g+6|0,zi)}if(a[1]===lQ){var -d=a[2],h=d[3],m=d[2],n=d[1];return eB(t(iP),n,m,h,h+6|0,zj)}if(0!==c2(a))return a[1];var -o=a[1][1];return a1(o,y_(a))}function -gq(a){var -b=zd(a);return b?b[1]:ze(a)}function -zk(a){var -b=[0,Th(a)];return b}function -zl(c,b){function -a(a){return a?0===c?zm:zn:0===c?zo:zp}if(0===b[0]){var -d=b[5],e=b[4],f=b[3],g=b[6]?zq:zs,i=b[2],j=b[7],k=a(b[1]);return[0,S3(t(zr),k,j,i,g,f,e,d)]}if(b[1])return 0;var -l=a(0);return[0,h(t(zt),l)]}function -zu(a,b){if(!b)return go(a,zw);var +c=h(f,d)}catch(f){break a}if(c)return[0,c[1]]}b=e}}(fg(i1))}function +Aa(a){if(0!==dG(a))return[0,a[1],0];var +b=a[1][1];return[0,b,[0,z6(a)]]}function +Ab(a){var +b=Aa(a),c=b[2],d=b[1];return c?a$(d,c[1]):d}function +Ac(a){if(a===iF)return Ad;if(a===ma)return Ae;if(a[1]===l$){var +b=a[2],e=b[3],i=b[2],j=b[1];return eN(t(i2),j,i,e,e+5|0,Af)}if(a[1]===f){var +c=a[2],g=c[3],k=c[2],l=c[1];return eN(t(i2),l,k,g,g+6|0,Ag)}if(a[1]!==mc)return Ab(a);var +d=a[2],h=d[3],m=d[2],n=d[1];return eN(t(i2),n,m,h,h+6|0,Ah)}function +gy(a){var +b=z$(a);return b?b[1]:Ac(a)}function +Ai(a){var +b=[0,Ui(a)];return b}function +Aj(c,b){function +a(a){return a?0===c?Ak:Al:0===c?Am:An}if(0!==b[0]){if(b[1])return 0;var +p=a(0);return[0,h(t(At),p)]}if(b[3]===b[6])var +e=b[3],d=h(t(Ao),e);else +var +n=b[6],o=b[3],d=i(t(As),o,n);var +f=b[7],g=b[4],j=b[8]?Ap:Ar,k=b[2],l=b[9],m=a(b[1]);return[0,T3(t(Aq),m,l,k,j,d,g,f)]}function +Au(a,b){if(!b)return gw(a,Aw);var d=b[1],e=d.length-2|0,g=0;if(e>=0){var c=g;for(;;){var -f=zl(c,j(d,c)[1+c]);if(f){var -i=f[1];h(go(a,zv),i)}var -k=c+1|0;if(e===c)break;c=k}}return 0}function -gr(a,b){return zu(a,zk(b))}var -zz=zy.slice();function -zA(a,b){var -e=gq(a);h(gp(zB),e);gr(cb,b);var -c=TR(0);if(c<0){var -d=e3(c);lS(j(zz,d)[1+d])}return gc(cb)}var -zC=[0];function -mk(a){var -b=uI(0);return b}function -zD(a,b){try{var -d=b?zC:mk(0);try{ix(0)}catch(f){}try{var -f=zA(a,d),e=f}catch(f){var -i=P(f),j=mk(0),k=gq(a);h(gp(zF),k);gr(cb,d);var -l=gq(i);h(gp(zG),l);gr(cb,j);var -e=gc(cb)}return e}catch(f){var -c=P(f);if(c===iu)return lS(zE);throw g(c,0)}}lI(uf,function(a,b){try{var -c=zD(a,b);return c}catch(f){return 0}});function -zx(a){for(;;){var -b=ga(iO),c=1-it(iO,b,[0,a,b]);if(!c)return c}}function -zH(a){return uI(a)}var -zJ=[B,zI,ar(0)];zx(function(a){return a[1]===zJ?[0,a1(zK,gq(a[2]))]:0});function -zL(a){return TP(a,0,p(a))}function -ml(a){return[0,cz(55,0),0]}function -zM(a,b){l_(b[1],0,a[1],0,55);a[2]=b[2];return}function -zN(a,b){function -l(a,b){return zL(a1(a,lZ(b)))}function -m(a){var -b=V(a,3)<<24,c=V(a,2)<<16,d=V(a,1)<<8;return((V(a,0)+d|0)+c|0)+b|0}var -g=0===b.length-1?[0,0]:b,h=g.length-1,c=0;for(;;){j(a[1],c)[1+c]=c;var -s=c+1|0;if(54===c)break;c=s}var -f=[0,zO],i=54+gg(55,h)|0,n=0;if(i>=0){var -d=n;for(;;){var -e=d%55|0,k=uU(d,h),o=j(g,k)[1+k];f[1]=l(f[1],o);var -p=m(f[1]),q=(j(a[1],e)[1+e]^p)&fL;j(a[1],e)[1+e]=q;var -r=d+1|0;if(i===d)break;d=r}}a[2]=0;return}function -zP(a){var -b=ml(0);zN(b,a);return b}function -mm(a){return zP(T_(0))}function -fc(a){a[2]=(a[2]+1|0)%55|0;var -b=a[2],c=j(a[1],b)[1+b],d=(a[2]+24|0)%55|0,e=(j(a[1],d)[1+d]+(c^(c>>>25|0)&31)|0)&fL,f=a[2];j(a[1],f)[1+f]=e;return e}function -zR(a,b){for(;;){var -c=fc(a),d=uU(c,b);if(((fL-b|0)+1|0)>=(c-d|0))return d}}function -zQ(a){var -b=ml(0);zM(b,a);return b}function -zS(a,b){if(fL>=b&&0=0){var +c=i;for(;;){wY(d,c*8|0,ge(k(b,c)[1+c]));var +n=c+1|0;if(f===c)break;c=n}}cg(d,e*8|0,1);var +g=mT(d);cg(d,e*8|0,2);var +h=mT(d),j=gq(h,8),l=gq(h,0),m=gq(g,8);return mV(a,gq(g,0),m,l,j)}function +AX(a){var +b=i5(0);AW(b,a);return b}function +mX(a){return AX(Vd(0))}var +AY=ib;function +A0(a,b,c){for(;;){var +d=lW(lZ(a))&c,e=U4(d,b);if(((c-b|0)+1|0)>=(d-e|0))return e}}function +eo(a){return lZ(a)}function +AV(a){var +b=i5(0);AU(b,a);return b}function +AZ(a){return lW(lZ(a))&ib}function +A1(a,b){if(ib>=b&&0=0){var -e=o;for(;;){n(j(c,e)[1+e]);var +e=o;for(;;){n(k(c,e)[1+e]);var r=e+1|0;if(i===e)break;e=r}}if(b){var -k=g-1|0,p=0;if(k>=0){var +j=g-1|0,p=0;if(j>=0){var a=p;for(;;){var -l=j(f,a)[1+a];if(l)l[3]=0;var -q=a+1|0;if(k===a)break;a=q}}}return}function -mt(a,b){var -c=b[2],d=(c.length-1)*2|0,e=d>>0)return;return mz(a,d)}function -Ae(a){var -b=wR(a[28]);if(!b)return;var +gB=0,m5=-1;function +m6(a){return 0<=a?1:0}var +ep=[B,Bl,ar(0)];function +fo(a,b){a[13]=a[13]+b[3]|0;return iT(b,a[28])}var +m7=1000000010;function +Bm(a){a[12]=1;a[13]=1;return iS(a[28])}function +i7(a,b){return a7(a[17],b,0,p(b))}function +gC(a){return h(a[19],0)}function +Bn(a,b){return h(a[20],b)}function +Bo(a,b){return h(a[21],b)}function +m8(a,b,c){a[9]=a[9]-b|0;i7(a,c);a[11]=0;return}function +gD(a,b){var +c=b!==e?1:0;return c?m8(a,p(b),b):c}function +dK(a,b,c){var +d=b[3],e=b[2];gD(a,b[1]);gC(a);a[11]=1;a[10]=wM(a[8],(a[6]-c|0)+e|0);a[9]=a[6]-a[10]|0;Bo(a,a[10]);return gD(a,d)}function +m9(a,b){return dK(a,Bp,b)}function +eq(a,b){var +c=b[2],d=b[3];gD(a,b[1]);a[9]=a[9]-c|0;Bn(a,c);return gD(a,d)}function +Bq(a){var +b=ej(a[2]);if(!b)return gC(a);var +c=b[1],d=c[2],e=a[9]>>0)return;return m9(a,d)}function +Br(a){var +b=xJ(a[28]);if(!b)return;var c=b[1],d=c[1];a[12]=a[12]-c[3]|0;var e=ba(d);a[9]=a[9]+e|0;return}function -Af(a,b,c){if(typeof +Bs(a,b,c){if(typeof c==="number")switch(c){case 0:var -j=ea(a[3]);if(!j)return;var +j=ej(a[3]);if(!j)return;var k=j[1][1],l=function(a,b){if(!b)return[0,a,0];var -c=b[1],d=b[2];return TL(a,c)?[0,a,b]:[0,c,l(a,d)]};k[1]=l(a[6]-a[9]|0,k[1]);return;case -1:d$(a[2]);return;case -2:d$(a[3]);return;case +c=b[1],d=b[2];return UR(a,c)?[0,a,b]:[0,c,l(a,d)]};k[1]=l(a[6]-a[9]|0,k[1]);return;case +1:ei(a[2]);return;case +2:ei(a[3]);return;case 3:var -m=ea(a[2]);return m?mz(a,m[1][2]):gv(a);case +m=ej(a[2]);return m?m9(a,m[1][2]):gC(a);case 4:var -n=a[10]!==(a[6]-a[9]|0)?1:0;return n?Ae(a):n;default:var -o=d$(a[5]);if(o)return iS(a,h(a[25],o[1]));return}switch(c[0]){case -0:return my(a,b,c[1]);case +n=a[10]!==(a[6]-a[9]|0)?1:0;return n?Br(a):n;default:var +o=ei(a[5]);if(o)return i7(a,h(a[25],o[1]));return}switch(c[0]){case +0:return m8(a,b,c[1]);case 1:var -d=c[2],f=c[1],q=d[1],z=d[2],r=ea(a[2]);if(!r)return;var +d=c[2],f=c[1],q=d[1],z=d[2],r=ej(a[2]);if(!r)return;var s=r[1],e=s[2];switch(s[1]){case -0:return ee(a,f);case -1:return dC(a,d,e);case -2:return dC(a,d,e);case -3:return a[9]<(b+p(q)|0)?dC(a,d,e):ee(a,f);case -4:return a[11]?ee(a,f):a[9]<(b+p(q)|0)?dC(a,d,e):((a[6]-e|0)+z|0)=a[14]){a[13]=mx;mA(a);if(b)gv(a);return Ar(a)}iV(a,0)}}function -ef(a,b,c){var -d=a[14]=a[14]){a[13]=m7;m_(a);if(b)gC(a);return BD(a)}i_(a,0)}}function +er(a,b,c){var +d=a[14]=c)return a6(a[17],mI,0,c);a6(a[17],mI,0,80);c=c-80|0}}function -AE(a){return a[1]===ed?a1(AG,a1(a[2],AF)):AH}function -AI(a){return a[1]===ed?a1(AK,a1(a[2],AJ)):AL}function -AM(a){return 0}function -AN(a){return 0}function -AO(a,b,c,d,e){var -g=iG(0),h=[0,mv,AP,0];iI(h,g);var -f=d_(0);iT(f);c5([0,1,h],f);var -i=78,j=d_(0),k=d_(0),l=d_(0);return[0,f,d_(0),l,k,j,i,10,68,i,0,1,1,1,1,gb,AQ,a,b,c,d,e,0,0,AE,AI,AM,AN,g]}function -mK(a,b){var -c=AO(a,b,function(a){return 0},function(a){return 0},function(a){return 0});c[19]=function(a){return AC(c,a)};c[20]=function(a){return mJ(c,a)};c[21]=function(a){return mJ(c,a)};return c}function -mL(d){return mK(function(a,b,c){return vn(d,a,b,c)},function(a){return gc(d)})}function -eh(d){return mK(function(a,b,c){return fa(d,a,b,c)},function(a){return 0})}var -AR=h1;function -iY(a){return cd(AR)}var -mM=iY(0),mN=mL(vm),AS=mL(cb),mO=eh(mM);function -Au(a,b){iW(a,1);return h(a[18],0)}function -Av(a,b){var -c=a[14]=c)return a7(a[17],nj,0,c);a7(a[17],nj,0,80);c=c-80|0}}function +BO(a){return a[1]===ep?a$(BQ,a$(a[2],BP)):BR}function +BS(a){return a[1]===ep?a$(BU,a$(a[2],BT)):BV}function +BW(a){return 0}function +BX(a){return 0}function +jc(a,b,c,d,e){var +g=iR(0),h=[0,m5,BY,0];iT(h,g);var +f=eh(0);i8(f);c$([0,1,h],f);var +i=78,j=eh(0),k=eh(0),l=eh(0);return[0,f,eh(0),l,k,j,i,10,68,i,0,1,1,1,1,gk,BZ,a,b,c,d,e,0,0,BO,BS,BW,BX,g]}function +nk(a,b){var +c=jc(a,b,function(a){return 0},function(a){return 0},function(a){return 0});c[19]=function(a){return jb(c,a)};c[20]=function(a){return et(c,a)};c[21]=function(a){return et(c,a)};return c}function +nl(d){return nk(function(a,b,c){return mf(d,a,b,c)},function(a){return fe(d)})}function +dL(d){return nk(function(a,b,c){return el(d,a,b,c)},function(a){return 0})}var +jd=h_;function +gF(a){return bL(jd)}var +nm=gF(0),je=nl(iG),jf=nl(bK),nn=dL(nm),jg=cJ(0,gF);fm(jg,nm);var +no=cJ(0,function(a){return dL(bM(jg))});fm(no,nn);function +gG(a,b,c,d){return el(bM(a),b,c,d)}function +gH(a,b,c){var +d=bM(b),e=mD(d);mf(a,b3(d),0,e);fe(a);return ek(d)}var +gI=cJ(0,function(a){return bL(jd)}),gJ=cJ(0,function(a){return bL(jd)}),jh=cJ(0,function(a){var +b=jc(function(a,b,c){return gG(gI,a,b,c)},function(a){return gH(iG,gI,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return jb(b,a)};b[20]=function(a){return et(b,a)};b[21]=function(a){return et(b,a)};mJ(function(a){return cB(b,a)});return b});fm(jh,je);var +np=cJ(0,function(a){var +b=jc(function(a,b,c){return gG(gJ,a,b,c)},function(a){return gH(bK,gJ,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return jb(b,a)};b[20]=function(a){return et(b,a)};b[21]=function(a){return et(b,a)};mJ(function(a){return cB(b,a)});return b});fm(np,jf);function +BG(a,b){i$(a,1);return h(a[18],0)}function +BH(a,b){var +c=a[14]=0){var -e=q;for(;;){c7(b,c,j(d[3],e)[1+e]);var -r=e+1|0;if(k===e)break;e=r}}return}}function -Bd(a){return i(go(cb,Be),gr,Tn(20))}function -gD(a,b){var -c=[0,0];c7(c,a,b);var -d=2<=c[1]?1:0;return d?Bd(0):d}function -aC(a){return ej([5,a])}function +j=p-1|0,q=0;if(j>=0){var +e=q;for(;;){da(b,c,k(d[3],e)[1+e]);var +r=e+1|0;if(j===e)break;e=r}}return}}function +Ci(a){return i(gw(bK,Cj),gz,Uq(20))}function +gP(a,b){var +c=[0,0];da(c,a,b);var +d=2<=c[1]?1:0;return d?Ci(0):d}function +aC(a){return ev([5,a])}function aD(a){return a}function -ag(a,b){if(1===a[0]){var -c=a[4];if(5===c[0]){c[1]=b;return gD(0,a)}}throw g([0,f,Bf],1)}function -at(a){if(1===a[0]){var -b=a[4];if(5===b[0])return b[1]}throw g([0,f,Bg],1)}function -ek(a,b,c){var -k=a,h=b,d=c;for(;;)switch(d[0]){case -0:return k;case +af(a,b){if(1===a[0]){var +c=a[4];if(5===c[0]){c[1]=b;return gP(0,a)}}throw g([0,f,Ck],1)}function +au(a){if(1===a[0]){var +b=a[4];if(5===b[0])return b[1]}throw g([0,f,Cl],1)}function +ew(a,b,c){var +j=a,h=b,d=c;for(;;)switch(d[0]){case +0:return j;case 1:var e=d[2];if(typeof -e==="number")throw g([0,f,Bm],1);switch(e[0]){case -0:if(e[1]!==h)throw g([0,f,Bn],1);var +e==="number")throw g([0,f,Cr],1);switch(e[0]){case +0:if(e[1]!==h)throw g([0,f,Cs],1);var o=0;break;case 1:var B=e[2],C=e[1];if(C===h)var -D=[0,B];else{if(B!==h)throw g([0,f,Bo],1);var +D=[0,B];else{if(B!==h)throw g([0,f,Ct],1);var D=[0,C]}var o=D;break;case 2:var u=e[3],v=e[2],w=e[1];if(w===h)var x=[1,v,u];else if(v===h)var -x=[1,w,u];else{if(u!==h)throw g([0,f,Bp],1);var +x=[1,w,u];else{if(u!==h)throw g([0,f,Cu],1);var x=[1,w,v]}var o=x;break;case 3:var p=e[4],q=e[3],r=e[2],s=e[1];if(s===h)var t=[2,r,q,p];else if(r===h)var t=[2,s,q,p];else if(q===h)var -t=[2,s,r,p];else{if(p!==h)throw g([0,f,Bq],1);var +t=[2,s,r,p];else{if(p!==h)throw g([0,f,Cv],1);var t=[2,s,r,q]}var o=t;break;default:var -n=ff(d,h);if(j(e[3],n)[1+n]!==h)throw g([0,f,Br],1);var +n=fq(d,h);if(k(e[3],n)[1+n]!==h)throw g([0,f,Cw],1);var m=e[2]-1|0;e[2]=m;if(n>>2|0))var -U=wj(e[3],0,K>>>1|0),L=[4,e[1],e[2],U];else +U=xb(e[3],0,K>>>1|0),L=[4,e[1],e[2],U];else var L=e;var J=L}var o=J}d[2]=o;if(typeof -o!=="number")return k;var +o!=="number")return j;var y=d[1];d[1]=1;var l=d[4];switch(l[0]){case 0:h=d;d=l[1];break;case 1:var -M=l[2];k=ek(k,d,l[1]);h=d;d=M;break;case +M=l[2];j=ew(j,d,l[1]);h=d;d=M;break;case 2:var -N=l[2];k=ek(k,d,l[1]);h=d;d=N;break;case +N=l[2];j=ew(j,d,l[1]);h=d;d=N;break;case 3:var -O=l[2];k=ek(k,d,l[1]);h=d;d=O;break;case +O=l[2];j=ew(j,d,l[1]);h=d;d=O;break;case 4:var -z=l[2],A=ek(k,d,l[1]);if(!z)return A;var -Q=z[1];l[2]=0;k=A;h=d;d=Q;break;case -5:return k;case +z=l[2],A=ew(j,d,l[1]);if(!z)return A;var +Q=z[1];l[2]=0;j=A;h=d;d=Q;break;case +5:return j;case 6:if(typeof -y==="number")return k;var -R=y[1];try{i(l[2],d,R);return k}catch(f){var -S=P(f);return[0,[0,S,zH(0)],k]}default:var -T=l[1];k=ek(k,d,l[2]);h=d;d=T}break;default:throw g([0,f,Bs],1)}}function -c8(a,b){var +y==="number")return j;var +R=y[1];try{i(l[2],d,R);return j}catch(f){var +S=P(f);return[0,[0,S,AH(0)],j]}default:var +T=l[1];j=ew(j,d,l[2]);h=d;d=T}break;default:throw g([0,f,Cx],1)}}function +db(a,b){var e=a,c=b;for(;;)switch(c[0]){case 0:return;case 1:var n=typeof c[2]==="number"?1:0,d=c[2];if(typeof d==="number")var -k=[0,e];else +j=[0,e];else switch(d[0]){case 0:var -k=[1,e,d[1]];break;case +j=[1,e,d[1]];break;case 1:var -k=[2,e,d[1],d[2]];break;case +j=[2,e,d[1],d[2]];break;case 2:var -k=[3,e,d[1],d[2],d[3]];break;case +j=[3,e,d[1],d[2],d[3]];break;case 3:var -o=[0,d[1],d[2],d[3],d[4],e,ei,ei,ei],l=0;for(;;){mS(c,l,j(o,l)[1+l]);var +o=[0,d[1],d[2],d[3],d[4],e,eu,eu,eu],l=0;for(;;){nu(c,l,k(o,l)[1+l]);var w=l+1|0;if(4===l)break;l=w}var -k=[4,5,5,o];break;default:var +j=[4,5,5,o];break;default:var i=d[2];if(i>>1|0)}function -m3(a,b,c){if(typeof -a!=="number"){if(0!==a[0]){if(a[2]!==b)throw g([0,f,BV],1);a[2]=c;return}if(a[2]===b){a[2]=c;return}if(a[4]===b){a[4]=c;return}}throw g([0,f,BU],1)}function -kj(a,b,c){if(typeof +nE(a,b){return jn(a,b>>>1|0)}function +nF(a,b,c){if(typeof +a!=="number"){if(0!==a[0]){if(a[2]!==b)throw g([0,f,C0],1);a[2]=c;return}if(a[2]===b){a[2]=c;return}if(a[4]===b){a[4]=c;return}}throw g([0,f,CZ],1)}function +kE(a,b,c){if(typeof c!=="number"&&0===c[0]){var d=c[4];if(typeof d!=="number"&&1!==d[0]){var h=c[5],e=d[2];if(typeof e==="number")var -i=0;else{if(0!==e[0])throw g([0,f,BZ],1);e[5]=c;var -i=e}d[2]=c;c[4]=i;c[5]=d;d[5]=h;m3(h,c,d);i5(b,c);return a<50?fB(a+1|0,b,d):l(fB,[0,b,d])}}throw g([0,f,BY],1)}function -BW(a,b){return bI(kj(0,a,b))}function -ki(a,b,c){if(typeof +i=0;else{if(0!==e[0])throw g([0,f,C4],1);e[5]=c;var +i=e}d[2]=c;c[4]=i;c[5]=d;d[5]=h;nF(h,c,d);jo(b,c);return a<50?fL(a+1|0,b,d):l(fL,[0,b,d])}}throw g([0,f,C3],1)}function +C1(a,b){return bJ(kE(0,a,b))}function +kD(a,b,c){if(typeof c!=="number"&&0===c[0]){var d=c[2];if(typeof d!=="number"&&1!==d[0]){var h=c[5],e=d[4];if(typeof e==="number")var -i=0;else{if(0!==e[0])throw g([0,f,B1],1);e[5]=c;var -i=e}d[4]=c;c[2]=i;c[5]=d;d[5]=h;m3(h,c,d);i5(b,c);return a<50?fB(a+1|0,b,d):l(fB,[0,b,d])}}throw g([0,f,B0],1)}function -BX(a,b){return bI(ki(0,a,b))}function -pK(a,b,c){if(typeof +i=0;else{if(0!==e[0])throw g([0,f,C6],1);e[5]=c;var +i=e}d[4]=c;c[2]=i;c[5]=d;d[5]=h;nF(h,c,d);jo(b,c);return a<50?fL(a+1|0,b,d):l(fL,[0,b,d])}}throw g([0,f,C5],1)}function +C2(a,b){return bJ(kD(0,a,b))}function +qn(a,b,c){if(typeof c!=="number"&&0===c[0]){var d=c[4];a:if(typeof d!=="number"&&0===d[0]){var -e=el(d[2]);if(i4(el(d[4]),e)){BX(b,d);break a}}return a<50?kj(a+1|0,b,c):l(kj,[0,b,c])}throw g([0,f,B2],1)}function -pJ(a,b,c){if(typeof +e=ex(d[2]);if(jn(ex(d[4]),e)){C2(b,d);break a}}return a<50?kE(a+1|0,b,c):l(kE,[0,b,c])}throw g([0,f,C7],1)}function +qm(a,b,c){if(typeof c!=="number"&&0===c[0]){var d=c[2];a:if(typeof d!=="number"&&0===d[0]){var -e=el(d[4]);if(i4(el(d[2]),e)){BW(b,d);break a}}return a<50?ki(a+1|0,b,c):l(ki,[0,b,c])}throw g([0,f,B3],1)}function -fB(a,b,c){if(typeof +e=ex(d[4]);if(jn(ex(d[2]),e)){C1(b,d);break a}}return a<50?kD(a+1|0,b,c):l(kD,[0,b,c])}throw g([0,f,C8],1)}function +fL(a,b,c){if(typeof c!=="number"&&0===c[0]){var -d=el(c[2]),e=el(c[4]);return d>>2|0}function -b0(a,b){if(typeof +nK(a,b){return a>>2|0}function +b5(a,b){if(typeof a==="number")var c=b;else{if(typeof b!=="number"){var -d=gI(b);return[1,(m8(gI(a),d)+1|0)<<2,a,b]}var +d=gU(b);return[1,(nK(gU(a),d)+1|0)<<2,a,b]}var c=a}return c}function -fg(a){return typeof +fr(a){return typeof a==="number"?0:0===a[0]?[0,a[2]]:[1,a[2],a[3]]}var -i6=1,i7=2,Cz=3;function -m9(a){return-1===a?1:0}function -i8(a){return-1!==a?1:0}function -em(a){return(a&3)===3?1:0}function -m_(a){return(a&3)===1?1:0}function -m$(a){return(a&3)===2?1:0}function -na(a){return a|3}function -CA(a){return a>>>2|0}function -nb(a){return a<<2|2}function -fh(a){return a&u9(Cz)}function -nc(a){return a[2]}function -nd(a){return a[3]}function -ne(a){return[0,0,0,0]}function -gJ(a){a[1]=a[1]+1|0;return}function -gK(a){a[2]=a[2]+1|0;return}function -gL(a){a[3]=a[3]+1|0;return}function -i9(a,b,c){var +jp=1,jq=2,DD=3;function +nL(a){return-1===a?1:0}function +jr(a){return-1!==a?1:0}function +ey(a){return(a&3)===3?1:0}function +nM(a){return(a&3)===1?1:0}function +nN(a){return(a&3)===2?1:0}function +nO(a){return a|3}function +DE(a){return a>>>2|0}function +nP(a){return a<<2|2}function +fs(a){return a&vS(DD)}function +nQ(a){return a[2]}function +nR(a){return a[3]}function +nS(a){return[0,0,0,0]}function +gV(a){a[1]=a[1]+1|0;return}function +gW(a){a[2]=a[2]+1|0;return}function +gX(a){a[3]=a[3]+1|0;return}function +js(a,b,c){var d=c;for(;;){if(typeof d==="number")return;if(0===d[0]){var -e=d[1],i=(e&3)!==3?1:0,l=i?0!==(e&3)?1:0:i;if(l){if(0!==(e&b))throw g([0,f,CC],1);gJ(a);gL(a);d[1]=e|3}return}var -h=d[1],j=(h&3)!==3?1:0,k=j?0!==(h&3)?1:0:j;if(!k)return k;if(0!==(h&b))throw g([0,f,CD],1);gJ(a);gL(a);d[1]=h|3;i9(a,b,d[2]);d=d[3]}}function -gM(a,b,c,d){if(typeof +e=d[1],i=(e&3)!==3?1:0,l=i?0!==(e&3)?1:0:i;if(l){if(0!==(e&b))throw g([0,f,DG],1);gV(a);gX(a);d[1]=e|3}return}var +h=d[1],j=(h&3)!==3?1:0,k=j?0!==(h&3)?1:0:j;if(!k)return k;if(0!==(h&b))throw g([0,f,DH],1);gV(a);gX(a);d[1]=h|3;js(a,b,d[2]);d=d[3]}}function +gY(a,b,c,d){if(typeof d==="number")return;if(0===d[0]){var -e=d[1];if(0===(e&c)){gJ(a);if(0===(e&3))d[1]=e|c;else{d[1]=-1;gL(a);gK(a)}}var -g=-1!==e?1:0,h=g?(e&3)===3?1:0:g;return h?(d[1]=-1,gK(a)):h}var -f=d[1];if(0===(f&c)){gJ(a);if(0===(f&3)){d[1]=f|c;iI(d,b)}else{d[1]=-1;gL(a);gK(a);i9(a,c,d[2]);i9(a,c,d[3])}}var -i=-1!==f?1:0,j=i?(f&3)===3?1:0:i;return j?(d[1]=-1,gK(a)):j}function -i_(a,b,c){var -d=mb(b);if(typeof +e=d[1];if(0===(e&c)){gV(a);if(0===(e&3))d[1]=e|c;else{d[1]=-1;gX(a);gW(a)}}var +g=-1!==e?1:0,h=g?(e&3)===3?1:0:g;return h?(d[1]=-1,gW(a)):h}var +f=d[1];if(0===(f&c)){gV(a);if(0===(f&3)){d[1]=f|c;iT(d,b)}else{d[1]=-1;gX(a);gW(a);js(a,c,d[2]);js(a,c,d[3])}}var +i=-1!==f?1:0,j=i?(f&3)===3?1:0:i;return j?(d[1]=-1,gW(a)):j}function +jt(a,b,c){var +d=mC(b);if(typeof d!=="number"&&1===d[0]){var -e=(d[1]&3)===c?1:0;return e?(gM(a,b,c,d[2]),gM(a,b,c,d[3])):e}throw g([0,f,CE],1)}function -nf(a,b,c){for(;;){if(iJ(b))return;i_(a,b,c)}}function -CF(a,b,c,d){for(;;){if(iJ(c))return nf(b,d,i7);if(iJ(d))return nf(a,c,i6);i_(a,c,i6);i_(b,d,i7)}}function -i$(a){var +e=(d[1]&3)===c?1:0;return e?(gY(a,b,c,d[2]),gY(a,b,c,d[3])):e}throw g([0,f,DI],1)}function +nT(a,b,c){for(;;){if(iU(b))return;jt(a,b,c)}}function +DJ(a,b,c,d){for(;;){if(iU(c))return nT(b,d,jq);if(iU(d))return nT(a,c,jp);jt(a,c,jp);jt(b,d,jq)}}function +ju(a){var b=a[6];a[6]=b+1|0;return b}function -ja(a){var +jv(a){var b=a;for(;;){if(typeof b==="number")return;if(0===b[0]){var c=b[1];if(typeof c!=="number"&&0===c[0]){var -e=c[1],i=i8(e),l=i?em(e):i;if(l)c[1]=fh(e);return}throw g([0,f,CK],1)}var +e=c[1],i=jr(e),l=i?ey(e):i;if(l)c[1]=fs(e);return}throw g([0,f,DO],1)}var d=b[1];if(typeof d!=="number"&&1===d[0]){var -h=d[1],m=b[4],n=b[3],j=i8(h),k=j?em(h):j;if(!k)return k;d[1]=fh(h);ja(n);b=m;continue}throw g([0,f,CL],1)}}function -ng(a,b){var +h=d[1],m=b[4],n=b[3],j=jr(h),k=j?ey(h):j;if(!k)return k;d[1]=fs(h);jv(n);b=m;continue}throw g([0,f,DP],1)}}function +nU(a,b){var c=b;for(;;){if(typeof c==="number")return;if(0===c[0]){var d=c[1];if(typeof d!=="number"&&0===d[0]){var -e=d[1],u=c[2];if(!m_(e)){if(m9(e)){var -k=i$(a);j(a[4],k)[1+k]=d;j(a[5],k)[1+k]=[0,c,0];d[1]=nb(k);return}if(m$(e)){var -n=CA(e),v=[0,c,j(a[5],n)[1+n]];j(a[5],n)[1+n]=v;return}var -q=em(e);if(q)throw g([0,f,CO],1);return q}var -m=a[2];if(-1a[3])throw g([0,f,CN],1)}d[1]=fh(e);return}throw g([0,f,CM],1)}var +e=d[1],u=c[2];if(!nM(e)){if(nL(e)){var +j=ju(a);k(a[4],j)[1+j]=d;k(a[5],j)[1+j]=[0,c,0];d[1]=nP(j);return}if(nN(e)){var +n=DE(e),v=[0,c,k(a[5],n)[1+n]];k(a[5],n)[1+n]=v;return}var +q=ey(e);if(q)throw g([0,f,DS],1);return q}var +m=a[2];if(-1a[3])throw g([0,f,DR],1)}d[1]=fs(e);return}throw g([0,f,DQ],1)}var h=c[1];if(typeof h!=="number"&&1===h[0]){var -r=c[4],s=c[3],i=h[1],w=c[2];if(m9(i)){var -l=i$(a);j(a[4],l)[1+l]=h;j(a[5],l)[1+l]=[0,c,0];h[1]=nb(l);ja(s);return ja(r)}if(!m_(i)){if(m$(i)){var -o=i>>>2|0,x=[0,c,j(a[5],o)[1+o]];j(a[5],o)[1+o]=x;return}var -t=em(i);if(t)throw g([0,f,CR],1);return t}if(-1a[3])throw g([0,f,CQ],1)}h[1]=fh(i);ng(a,s);c=r;continue}throw g([0,f,CP],1)}}function -fi(a,b){if(typeof +r=c[4],s=c[3],i=h[1],w=c[2];if(nL(i)){var +l=ju(a);k(a[4],l)[1+l]=h;k(a[5],l)[1+l]=[0,c,0];h[1]=nP(l);jv(s);return jv(r)}if(!nM(i)){if(nN(i)){var +o=i>>>2|0,x=[0,c,k(a[5],o)[1+o]];k(a[5],o)[1+o]=x;return}var +t=ey(i);if(t)throw g([0,f,DV],1);return t}if(-1a[3])throw g([0,f,DU],1)}h[1]=fs(i);nU(a,s);c=r;continue}throw g([0,f,DT],1)}}function +ft(a,b){if(typeof b==="number")return 0;if(0!==b[0]){var i=b[1];if(-1===i){var -l=i$(a);b[1]=0;j(a[4],l)[1+l]=b;var -p=fi(a,b[2]);return[1,b,0,p,fi(a,b[3])]}if(!em(i)){b[1]=fh(b[1]);var -r=fi(a,b[2]);return[1,b,0,r,fi(a,b[3])]}var -d=i>>>2|0,k=j(a[5],d)[1+d];if(!k)throw g([0,f,CU],1);var -m=k[2],q=k[1];j(a[5],d)[1+d]=m;if(0===m)b[1]=0;return q}var -e=b[1];if(i8(e)&&em(e)){var -c=e>>>2|0,h=j(a[5],c)[1+c];if(!h)return[0,b,0];var -n=h[2],o=h[1];j(a[5],c)[1+c]=n;return o}b[1]=0;return[0,b,0]}var -jb=[0,0,[0],0,0];function -CB(a){return a[1]}function -CG(a){return a[1]}function -CH(a){return a[2]}function -CI(a,b){var -c=ne(0),d=ne(0),e=iG(0),f=iG(0);gM(c,e,i6,a);gM(d,f,i7,b);CF(c,d,e,f);return[0,c,d]}function -CJ(a){if(typeof +l=ju(a);b[1]=0;k(a[4],l)[1+l]=b;var +p=ft(a,b[2]);return[1,b,0,p,ft(a,b[3])]}if(!ey(i)){b[1]=fs(b[1]);var +r=ft(a,b[2]);return[1,b,0,r,ft(a,b[3])]}var +d=i>>>2|0,j=k(a[5],d)[1+d];if(!j)throw g([0,f,DY],1);var +m=j[2],q=j[1];k(a[5],d)[1+d]=m;if(0===m)b[1]=0;return q}var +e=b[1];if(jr(e)&&ey(e)){var +c=e>>>2|0,h=k(a[5],c)[1+c];if(!h)return[0,b,0];var +n=h[2],o=h[1];k(a[5],c)[1+c]=n;return o}b[1]=0;return[0,b,0]}var +jw=[0,0,[0],0,0];function +DF(a){return a[1]}function +DK(a){return a[1]}function +DL(a){return a[2]}function +DM(a,b){var +c=nS(0),d=nS(0),e=iR(0),f=iR(0);gY(c,e,jp,a);gY(d,f,jq,b);DJ(c,d,e,f);return[0,c,d]}function +DN(a){if(typeof a==="number")return;if(0===a[0]){a[1]=0;return}var -b=gI(a[3]);a[1]=(m8(gI(a[2]),b)+1|0)<<2;return}function -CS(a){var +b=gU(a[3]);a[1]=(nK(gU(a[2]),b)+1|0)<<2;return}function +DW(a){var e=a[6]-1|0,h=0;if(e>=0){var b=h;for(;;){var -c=j(a[4],b)[1+b];if(typeof -c!=="number")if(0===c[0])c[1]=na(c[1]);else -c[1]=na(c[1]);var -d=j(a[5],b)[1+b];if(!d)throw g([0,f,CT],1);if(d[2]){var -i=a_(d);j(a[5],b)[1+b]=i}var -k=b+1|0;if(e===b)break;b=k}}return}function -nh(a,b,c){if(typeof +c=k(a[4],b)[1+b];if(typeof +c!=="number")if(0===c[0])c[1]=nO(c[1]);else +c[1]=nO(c[1]);var +d=k(a[5],b)[1+b];if(!d)throw g([0,f,DX],1);if(d[2]){var +i=bz(d);k(a[5],b)[1+b]=i}var +j=b+1|0;if(e===b)break;b=j}}return}function +nV(a,b,c){if(typeof b==="number"){if(typeof -c==="number")return[0,jb,0]}else if(b[1]===c)return[0,jb,b];var +c==="number")return[0,jw,0]}else if(b[1]===c)return[0,jw,b];var t=typeof -b==="number"?bK:b[1],m=CI(t,c),i=CG(m),n=CH(m),u=nd(n),v=nd(i)+u|0,o=CB(i)-v|0,w=nc(n),p=nc(i)+w|0,x=0,y=cz(p,0),z=cz(p,0),A=a?o:-1,B=a?0:-1,C=a?cz(o,0):[0],d=[0,C,B,A,z,y,x];ng(d,b);if(d[2]!==d[3])throw g([0,f,CV],1);CS(d);var -q=fi(d,c),r=d[6]-1|0;if(r>=0){var -h=r;for(;;){CJ(j(d[4],h)[1+h]);var -F=h-1|0;if(0===h)break;h=F}}if(!a)return[0,jb,q];var -k=[0,0],l=[0,0],s=d[6]-1|0,D=0;if(s>=0){var +b==="number"?bO:b[1],m=DM(t,c),i=DK(m),n=DL(m),u=nR(n),v=nR(i)+u|0,o=DF(i)-v|0,w=nQ(n),p=nQ(i)+w|0,x=0,y=cy(p,0),z=cy(p,0),A=a?o:-1,B=a?0:-1,C=a?cy(o,0):[0],d=[0,C,B,A,z,y,x];nU(d,b);if(d[2]!==d[3])throw g([0,f,DZ],1);DW(d);var +q=ft(d,c),r=d[6]-1|0;if(r>=0){var +h=r;for(;;){DN(k(d[4],h)[1+h]);var +F=h-1|0;if(0===h)break;h=F}}if(!a)return[0,jw,q];var +j=[0,0],l=[0,0],s=d[6]-1|0,D=0;if(s>=0){var e=D;for(;;){cA(function(a){if(typeof a!=="number")if(0===a[0]){var -b=a[2];if(b){k[1]=[0,b[1],k[1]];return 0}}else{var -c=a[2];if(c){l[1]=[0,c[1],l[1]];return 0}}return 0},j(d[5],e)[1+e]);var -E=e+1|0;if(s===e)break;e=E}}return[0,[0,d[2],d[1],k[1],l[1]],q]}function -CW(d,b){if(typeof +b=a[2];if(b){j[1]=[0,b[1],j[1]];return 0}}else{var +c=a[2];if(c){l[1]=[0,c[1],l[1]];return 0}}return 0},k(d[5],e)[1+e]);var +E=e+1|0;if(s===e)break;e=E}}return[0,[0,d[2],d[1],j[1],l[1]],q]}function +D0(d,b){if(typeof b==="number")return 0;function c(a){a:if(typeof a!=="number"){b:{if(0===a[0]){var @@ -3221,649 +3338,646 @@ j=e[1];break b}var k=h(d[1],b[2]);a[2]=[0,k];return k}break a}var l=a[2];if(!l){var n=c(a[3]),o=c(a[4]),m=i(d[2],n,o);a[2]=[0,m];return m}var -j=l[1]}return j}throw g([0,f,CX],1)}return[0,c(b)]}function -gN(a,b){return[0,[0,a,b],0]}function -gO(a){return CW(a[1],a[2])}function -CY(a,b){var -c=a[1];return[0,c,nh(0,a[2],b)[2]]}function -jc(a,b){var -d=a[1],c=nh(1,a[2],b);return[0,c[1],[0,d,c[2]]]}function -gP(a,b,c,d){var -e=[0,d];if(eP===a)var -h=c[1],g=0;else if(qh<=a)var +j=l[1]}return j}throw g([0,f,D1],1)}return[0,c(b)]}function +gZ(a,b){return[0,[0,a,b],0]}function +g0(a){return D0(a[1],a[2])}function +D2(a,b){var +c=a[1];return[0,c,nV(0,a[2],b)[2]]}function +jx(a,b){var +d=a[1],c=nV(1,a[2],b);return[0,c[1],[0,d,c[2]]]}function +g1(a,b,c,d){var +e=[0,d];if(e1===a)var +h=c[1],g=0;else if(qX<=a)var h=c[2].length-1,g=c[1];else var h=c[2].length-1,g=0;var -k=h-1|0;if(k>=g){var +j=h-1|0;if(j>=g){var f=g;for(;;){var -l=j(c[2],f)[1+f];if(l)e[1]=i(b,l[1],e[1]);var -m=f+1|0;if(k===f)break;f=m}}if(qh>a)cA(function(a){e[1]=i(b,a,e[1]);return 0},c[3]);if(eP!==a)cA(function(a){e[1]=i(b,a,e[1]);return 0},c[4]);return}function -jd(a,b,c){if(typeof -c==="number")throw g([0,f,CZ],1);if(0===c[0])return h(a,c[2]);var -d=jd(a,b,c[3]);return i(b,jd(a,b,c[2]),d)}function -c_(a,b,c){var -d=b[2],e=b[1],f=gB(c);if(f){var +l=k(c[2],f)[1+f];if(l)e[1]=i(b,l[1],e[1]);var +m=f+1|0;if(j===f)break;f=m}}if(qX>a)cA(function(a){e[1]=i(b,a,e[1]);return 0},c[3]);if(e1!==a)cA(function(a){e[1]=i(b,a,e[1]);return 0},c[4]);return}function +jy(a,b,c){if(typeof +c==="number")throw g([0,f,D3],1);if(0===c[0])return h(a,c[2]);var +d=jy(a,b,c[3]);return i(b,jy(a,b,c[2]),d)}function +dd(a,b,c){var +d=b[2],e=b[1],f=gN(c);if(f){var g=f[1];return typeof -g==="number"?aB(e):aB(jd(a,d,g))}var -h=[0,gN(a,d)];return y(c,function(a){var -b=CY(h[1],a);h[1]=b;var -c=gO(b);return c?c[1]:e})}var -fj=[0,bK,b0];function -C0(a,b){return gG(b,fj,a)}function -en(a){return C0(a,bb)}function -je(a,b,c,d){if(d=0){var -c=g;for(;;){e[c]=h(a,j(b,c)[1+c]);var +w["Error"](b);return a?(c[bj]=a[1],c):c}function +n0(a,b){return h(function(a){throw a},En(a,b))}var +n1=w["Promise"];function +Ek(a){return bI(a)}function +jG(a){return n1.resolve(a)}function +dM(a,b,c){return dD(a,Ek(b),c)}function +bc(a){return bI(a)}function +aw(a){return O(a)}function +Ed(a,b,c){if(!c)return;a[b]=c[1];return}var +Ee=true;function +Ef(a,b){a[b];return}function +Eh(a,b,c){if(c)return Eg(a,b,c[1]);return}function +Ei(a,b){return a[b]}function +Ej(a,b){return a[b]}function +Em(a,b){var +d=b.length-1,e=jF(d),f=d-1|0,g=0;if(f>=0){var +c=g;for(;;){e[c]=h(a,k(b,c)[1+c]);var i=c+1|0;if(f===c)break;c=i}}return e}function -Dk(a){return new -nn(c1(2,function(c,b){return i(a,function(a){return c(a)},function(a){return b(a)})}))}function -Dl(a,b){a.then(c1(1,b));return}function -Dm(a,b){return a.then(c1(1,b))}function -Dn(a,b,c){return a.then(c1(1,b),c1(1,c))}function -gS(a){return{fut:a}}function -jm(a){return a["fut"]}function -jn(a){return gS(jl(a))}function -no(a,b){return gS(Dm(jm(a),function(a){return jm(h(b,a))}))}function -gT(c,b){return no(b,function(a){return jn(h(c,a))})}function -Ds(d,b,c){return gS(Dn(c,function(a){return jl([0,h(d,a)])},function(a){return jl([1,h(b,a)])}))}function -jo(a,b){return Ds(a,function(a){return a},b)}function -np(c,b){return function(a){return no(c,a)}(function(a){return 0===a[0]?h(b,a[1]):jn(a)})}function -cI(a,b){return gT(function(a){return vz(b,a)},a)}function -Do(a){var -c=[0,function(a){throw g([0,f,Dp],1)}];function -b(a){return nm(0,"The future is already set")}return[0,gS(Dk(function(a,b){c[1]=a;return 0})),function(a){h(c[1],a);c[1]=b;return 0}]}function -Dq(a,b){return Dl(jm(a),b)}function -Dr(a){return jn([0,a])}v["Event"];function -gU(a){return a["target"]}function -nq(a){a.preventDefault();return 0}function -dE(a,b,c,d){var -e=a?a[1]:{},f=c1(1,c);d.addEventListener(b,f,e);return function(a){d.removeEventListener(b,f,e);return 0}}function -nr(a){return h(a,0)}var -jp="change",gV="click",ns=hJ;v["ArrayBuffer"];v["DataView"];function -Dt(a){a.stopImmediatePropagation();return}var -Du="DOMContentLoaded",Dv="ended",Dw=k_,Dx="keyup",Dy="play",Dz="scroll",DA="wheel";v["Blob"];v["File"];var -nt=v[h_];function -jq(a){return nt.stringify(a)}function -gW(a){try{var -c=nt.parse(a)}catch(f){var -b=P(f);if(b[1]===fe)return[1,b[2]];throw g(b,0)}return[0,c]}v["encodeURI"];v["decodeURI"];var -DB=v["encodeURIComponent"],DC=v["decodeURIComponent"],gX=v["URL"],jr=cn;function -DE(a){return Df(a,DF)}var -DJ=v["URLSearchParams"];function -DK(a){return a.toString()}function -nu(a){return a.toString()}function -bL(a,b){return[0,a,b]}var -gY=[0,c$,c$];function -js(a){return[0,a,c$]}function -nv(a){return a}var -cf=r6,gZ=bC,jt=bj,nw="placeholder",ju=ri,fm="type",g0=cO,DQ="for";function -cg(a){return bL(cf,a)}function -jv(a){return bL(DQ,a)}var -DT=js(pU),DV=js("required");function -DP(a,b){return[0,a,C6(0,b)]}var -DR=qG,DS="width";function -nx(a){return bL(DR,a)}function -dF(a){return bL(ju,a)}function -ny(a){return bL(g0,a)}var -DW=js("selected"),dG=v["document"];function -DD(a,b){return a?new -gX(b,a[1]):new -gX(b)}function -DG(a){function -d(a){return DC(a)}try{var -c=DE(a),e=C_(jr,c)?C8(DH,0,c):c,f=[0,dz(d,C9(jr,e))];return f}catch(f){var -b=P(f);if(b[1]===fe)return[1,b[2]];throw g(b,0)}}function -DI(a,b){function -e(a){return C7(jr,DB(a))}try{var +Eo(a){return new +n1(c8(2,function(c,b){return i(a,function(a){return c(a)},function(a){return b(a)})}))}function +Ep(a,b){a.then(c8(1,b));return}function +Eq(a,b){return a.then(c8(1,b))}function +Er(a,b,c){return a.then(c8(1,b),c8(1,c))}function +g4(a){return{fut:a}}function +jH(a){return a["fut"]}function +jI(a){return g4(jG(a))}function +n2(a,b){return g4(Eq(jH(a),function(a){return jH(h(b,a))}))}function +g5(c,b){return n2(b,function(a){return jI(h(c,a))})}function +Ew(d,b,c){return g4(Er(c,function(a){return jG([0,h(d,a)])},function(a){return jG([1,h(b,a)])}))}function +jJ(a,b){return Ew(a,function(a){return a},b)}function +n3(c,b){return function(a){return n2(c,a)}(function(a){return 0===a[0]?h(b,a[1]):jI(a)})}function +cP(a,b){return g5(function(a){return wk(b,a)},a)}function +Es(a){var +c=[0,function(a){throw g([0,f,Et],1)}];function +b(a){return n0(0,"The future is already set")}return[0,g4(Eo(function(a,b){c[1]=a;return 0})),function(a){h(c[1],a);c[1]=b;return 0}]}function +Eu(a,b){return Ep(jH(a),b)}function +Ev(a){return jI([0,a])}w["Event"];function +g6(a){return a["target"]}function +n4(a){a.preventDefault();return 0}function +dN(a,b,c,d){var +e=a?a[1]:{},f=c8(1,c);d.addEventListener(b,f,e);return function(a){d.removeEventListener(b,f,e);return 0}}function +n5(a){return h(a,0)}var +jK="change",g7="click",n6=hU;w["ArrayBuffer"];w["DataView"];function +Ex(a){a.stopImmediatePropagation();return}var +Ey="DOMContentLoaded",Ez="ended",EA=lt,EB="keyup",EC="play",ED="scroll",EE="wheel";w["Blob"];w["File"];var +n7=w[ij];function +jL(a){return n7.stringify(a)}function +g8(a){try{var +c=n7.parse(a)}catch(f){var +b=P(f);if(b[1]===fp)return[1,b[2]];throw g(b,0)}return[0,c]}w["encodeURI"];w["decodeURI"];var +EF=w["encodeURIComponent"],EG=w["decodeURIComponent"],g9=w["URL"],jM=cu;function +EI(a){return Ej(a,EJ)}var +EN=w["URLSearchParams"];function +EO(a){return a.toString()}function +n8(a){return a.toString()}function +bP(a,b){return[0,a,b]}var +g_=[0,de,de];function +jN(a){return[0,a,de]}function +n9(a){return a}var +cl=sG,g$=bE,jO=bj,n_="placeholder",jP=rV,fx="type",ha=cV,EU="for";function +cm(a){return bP(cl,a)}function +jQ(a){return bP(EU,a)}var +EX=jN(qy),EZ=jN("required");function +ET(a,b){return[0,a,D_(0,b)]}var +EV=rj,EW="width";function +n$(a){return bP(EV,a)}function +dO(a){return bP(jP,a)}function +oa(a){return bP(ha,a)}var +E0=jN("selected"),dP=w["document"];function +EH(a,b){return a?new +g9(b,a[1]):new +g9(b)}function +EK(a){function +d(a){return EG(a)}try{var +c=EI(a),e=Ec(jM,c)?Ea(EL,0,c):c,f=[0,cj(d,Eb(jM,e))];return f}catch(f){var +b=P(f);if(b[1]===fp)return[1,b[2]];throw g(b,0)}}function +EM(a,b){function +e(a){return D$(jM,EF(a))}try{var d=new -gX(a);d[up]=jf(0,dz(e,b));var +g9(a);d[u3]=jA(0,cj(e,b));var f=[0,d];return f}catch(f){var -c=P(f);if(c[1]===fe)return[1,c[2]];throw g(c,0)}}function -DL(a){return new -DJ(a)}function -DM(a,b){var +c=P(f);if(c[1]===fp)return[1,c[2]];throw g(c,0)}}function +EP(a){return new +EN(a)}function +EQ(a,b){var c=new -gX(a);nl(c,DN,DK(b));return c}function -DO(a,b){return a?b:gY}function -DU(a){return bL(gZ,a)}function -DX(a){return bL(fm,a)}function -DY(a){return DP(DS,a)}function -DZ(a){return a["ownerDocument"]}if(!gR(dG))dG[p9];function -D0(a,b){a.appendChild(b);return 0}function -D1(a,b,c,d){var -g=b,f=c,e=d;for(;;){if(!e){if(0!==g)a.setAttribute(ri,jf([0,";"],a_(g)));if(0!==f)a.setAttribute(r6,jf([0,bF],a_(f)));return}var -h=e[2],k=e[1],i=k[2],j=k[1];if(jg(j))e=h;else if(gQ(j,ju)){g=[0,i,g];e=h}else if(gQ(j,cf)){var -l=jg(i)?f:[0,i,f];f=l;e=h}else{a.setAttribute(j,i);e=h}}}function -nz(a,b,c,d){var -f=a?a[1]:dG,g=b?b[1]:0,e=f.createElement(c);D1(e,0,0,g);cA(function(a){return D0(e,a)},d);return e}function +g9(a);nZ(c,ER,EO(b));return c}function +ES(a,b){return a?b:g_}function +EY(a){return bP(g$,a)}function +E1(a){return bP(fx,a)}function +E2(a){return ET(EW,a)}function +E3(a){return a["ownerDocument"]}if(!g3(dP))dP[qN];function +E4(a,b){a.appendChild(b);return 0}function +E5(a,b,c,d){var +g=b,f=c,e=d;for(;;){if(!e){if(0!==g)a.setAttribute(rV,jA([0,";"],bz(g)));if(0!==f)a.setAttribute(sG,jA([0,bG],bz(f)));return}var +h=e[2],k=e[1],i=k[2],j=k[1];if(jB(j))e=h;else if(g2(j,jP)){g=[0,i,g];e=h}else if(g2(j,cl)){var +l=jB(i)?f:[0,i,f];f=l;e=h}else{a.setAttribute(j,i);e=h}}}function +ob(a,b,c,d){var +f=a?a[1]:dP,g=b?b[1]:0,e=f.createElement(c);E5(e,0,0,g);cA(function(a){return E4(e,a)},d);return e}function bd(a,b){var -c=a?a[1]:dG;return c.createTextNode(av(b))}function -jw(a,b,c){return jg(a)?0:b?(c.setAttribute(a,b[1]),0):(c.removeAttribute(a),0)}function -D3(a){return nj(a)?0.:a}function -jx(a){return[0,a,D3,function(a){return a}]}function -jy(a,b){var +c=a?a[1]:dP;return c.createTextNode(aw(b))}function +jR(a,b,c){return jB(a)?0:b?(c.setAttribute(a,b[1]),0):(c.removeAttribute(a),0)}function +E7(a){return nX(a)?0.:a}function +jS(a){return[0,a,E7,function(a){return a}]}function +jT(a,b){var c=b[a[1]];return h(a[2],c)}function -nA(a,b,c){return b?(c[pY].add(a),0):(c[pY].remove(a),0)}var -nB="div",nC="span",D8="audio",D$="h1";function -g1(a,b,c,d){return nz(b,c,a,d)}function -g2(a,b,c){return g1(nB,a,b,c)}function -nD(a){return a[p9]}function -g3(a,b,c){dv(a,b,c);return 0}var -g4=v[q2];function -g5(a){return eY(function(a,b,c){var +oc(a,b,c){return b?(c[qC].add(a),0):(c[qC].remove(a),0)}var +od="div",oe="span",Fa="audio",Fd="h1";function +hb(a,b,c,d){return ob(b,c,a,d)}function +hc(a,b,c){return hb(od,a,b,c)}function +of(a){return a[qN]}function +hd(a,b,c){dD(a,b,c);return 0}var +he=w[rE];function +hf(a){return e9(function(a,b,c){var e=b,d=c;for(;;){if(!d)return a;var -f=d[2];a[e]=d[1];e=e+1|0;d=f}}(jk(0),0,a))}function -b1(a){return g3(g4,Ek,g5(a))}function -nE(a){return g3(g4,El,g5(a))}v[q2];var -jz=v["navigator"],Es=v["performance"],nF=v[ub];Db(v,Et);function -D2(a,b){dv(a,te,gj(b));return}function -D4(a,b,c){var -e=a?a[1]:v[ub],d=e.getComputedStyle(c)[b];return gR(d)?c$:d}function -D5(a){return De(a,D6)}function -D7(a,b){var -c=a?a[1]:rX,d=rX<=c?1:0;b.scrollIntoView(!!d);return 0}var -D9=tA,D_="form",Ea="img",Eb=hJ,Ec="label",Ed="option",Ee="select";function -Ef(a,b,c){return g1(D8,a,b,c)}function -Eg(a,b,c){return g1(D$,a,b,c)}function -Eh(a,b,c){return g1(nC,a,b,c)}function -Ei(a){var -b=a[rQ];return nk(b)?b:nm(0,"Document body is null. Try to defer your script execution.")}function -Ej(a){return ji(function(a){return a},a["activeElement"])}function -Em(a){return g3(g4,En,g5(a))}function -Eo(a){return g3(g4,Ep,g5(a))}function -Eq(a){return a}function -Er(a){return a.now()}function -Eu(a,b){return v.setTimeout(c1(1,b),a)}function -Ev(a){v.clearTimeout(a);return}function -Ew(a){v.requestAnimationFrame(c1(1,a));return}v["ClipboardItem"];v["FormData"];var -Ez=v["Headers"];function -nG(a,b,c,d,e,f,g,h,i,j,k,l,m){var -n={};n[rQ]=jj(eo,function(a){return a},a);da(n,EB,b);da(n,EC,c);C$(n,ED,iA(function(a){return a},d));da(n,EE,e);Dd(n,EF,f);da(n,EG,g);da(n,EH,h);da(n,EI,i);da(n,EJ,j);da(n,EK,k);n["signal"]=jj(eo,function(a){return a},l);return n}var -EL=v["Request"];v["Response"];var -EN=v["fetch"];v["MediaStream"];v["MediaRecorder"];v["MessageChannel"];v["BroadcastChannel"];var -nH="message";function -nI(a){return a["data"]}v["Notification"];v["WebSocket"];function -Ex(a){return a}function -Ey(a){return jo(function(a){return a},a.text())}function -EA(a,b){var -d=a?[0,a[1]]:[0],c=TI(Ez,d);function +f=d[2];a[e]=d[1];e=e+1|0;d=f}}(jF(0),0,a))}function +b6(a){return hd(he,Fo,hf(a))}function +og(a){return hd(he,Fp,hf(a))}w[rE];var +jU=w["navigator"],Fw=w["performance"],oh=w[uP];Ef(w,Fx);function +E6(a,b){dD(a,tT,gr(b));return}function +E8(a,b,c){var +e=a?a[1]:w[uP],d=e.getComputedStyle(c)[b];return g3(d)?de:d}function +E9(a){return Ei(a,E_)}function +E$(a,b){var +c=a?a[1]:sx,d=sx<=c?1:0;b.scrollIntoView(!!d);return 0}var +Fb=ud,Fc="form",Fe="img",Ff=hU,Fg="label",Fh="option",Fi="select";function +Fj(a,b,c){return hb(Fa,a,b,c)}function +Fk(a,b,c){return hb(Fd,a,b,c)}function +Fl(a,b,c){return hb(oe,a,b,c)}function +Fm(a){var +b=a[sq];return nY(b)?b:n0(0,"Document body is null. Try to defer your script execution.")}function +Fn(a){return jD(function(a){return a},a["activeElement"])}function +Fq(a){return hd(he,Fr,hf(a))}function +Fs(a){return hd(he,Ft,hf(a))}function +Fu(a){return a}function +Fv(a){return a.now()}function +Fy(a,b){return w.setTimeout(c8(1,b),a)}function +Fz(a){w.clearTimeout(a);return}function +FA(a){w.requestAnimationFrame(c8(1,a));return}w["ClipboardItem"];w["FormData"];var +FD=w["Headers"];function +oi(a,b,c,d,e,f,g,h,i,j,k,l,m){var +n={};n[sq]=jE(eA,function(a){return a},a);df(n,FF,b);df(n,FG,c);Ed(n,FH,iK(function(a){return a},d));df(n,FI,e);Eh(n,FJ,f);df(n,FK,g);df(n,FL,h);df(n,FM,i);df(n,FN,j);df(n,FO,k);n["signal"]=jE(eA,function(a){return a},l);return n}var +FP=w["Request"];w["Response"];var +FR=w["fetch"];w["MediaStream"];w["MediaRecorder"];w["MessageChannel"];w["BroadcastChannel"];var +oj="message";function +ok(a){return a["data"]}w["Notification"];w["WebSocket"];function +FB(a){return a}function +FC(a){return jJ(function(a){return a},a.text())}function +FE(a,b){var +d=a?[0,a[1]]:[0],c=UM(FD,d);function e(a,b){a.append(b[1],b[2]);return 0}cA(function(a){return e(c,a)},b);return c}function -EM(a,b){var +FQ(a,b){var c=a?a[1]:{};return new -EL(b,c)}function -EO(a){function -b(a){return a}return function(a){return jo(b,a)}(EN(a))}function -EP(a){return a["localStorage"]}function -EQ(a,b){function -c(a){return a}return function(a){return ji(c,a)}(a.getItem(b))}function -ER(a,b,c){try{a.setItem(b,c);return}catch(f){var -d=P(f);if(d[1]===fe)return;throw g(d,0)}}var -ES=v["Worker"];v["SharedWorker"];v["clients"];v["registration"];v["serviceWorker"];function -ET(a,b){var -c=a?a[1]:eo;return new -ES(b,c)}function -EU(a,b,c){var -d=a?a[1]:eo;b.postMessage(c,d);return}function -EV(a,b){var -c=a?a[1]:eo;v.postMessage(b,c);return 0}function -ch(a,b,c){return[0,a,b,c]}function -nJ(a){var -b=a[1];return 82===b?lU(gB(a[2])):83<=b?lU(gB(a[2])):1}function -g6(a){return vx(gB(a))}function -EW(a){return ge(dz(function(a){var -b=a[1];return 82===b?[0,g6(a[2]),0]:83<=b?cG(g6(a[2])):[0,a[2],0]},a))}function -nK(a){if(!a)return EX;var -b=vU(nJ,a),c=b[2];return[0,EW(b[1]),c]}var -nL=te,jA="before";function -E0(a){return[0,a]}function -E1(a,b){return[1,jh,a,b]}var -E2="remove",E3="contains";function -nM(a){var -b=Ej(DZ(a));return b?dD(a,E3,[0,b[1]])|0:0}function -nN(e,b){var -c=[0,gN(E0,E1)];return y(b,function(a){var -b=jc(c[1],a),d=b[2],g=b[1];c[1]=d;gP(eP,function(a,b){return 0===a[0]?a[1][hY]=Da:0},g,0);var -h=nM(e),i=gO(d);if(i){var -f=function(d,b){if(0!==b[0]){if(!fk(b[1]))return b[1];var +FP(b,c)}function +FS(a){function +b(a){return a}return function(a){return jJ(b,a)}(FR(a))}function +FT(a){return a["localStorage"]}function +FU(a,b){function +c(a){return a}return function(a){return jD(c,a)}(a.getItem(b))}function +FV(a,b,c){try{a.setItem(b,c);return}catch(f){var +d=P(f);if(d[1]===fp)return;throw g(d,0)}}var +FW=w["Worker"];w["SharedWorker"];w["clients"];w["registration"];w["serviceWorker"];function +FX(a,b){var +c=a?a[1]:eA;return new +FW(b,c)}function +FY(a,b,c){var +d=a?a[1]:eA;b.postMessage(c,d);return}function +FZ(a,b){var +c=a?a[1]:eA;w.postMessage(b,c);return 0}function +cn(a,b,c){return[0,a,b,c]}function +ol(a){var +b=a[1];return 82===b?ml(gN(a[2])):83<=b?ml(gN(a[2])):1}function +hg(a){return wi(gN(a))}function +F0(a){return gm(cj(function(a){var +b=a[1];return 82===b?[0,hg(a[2]),0]:83<=b?cN(hg(a[2])):[0,a[2],0]},a))}function +om(a){if(!a)return F1;var +b=wI(ol,a),c=b[2];return[0,F0(b[1]),c]}var +on=tT,jV="before";function +F4(a){return[0,a]}function +F5(a,b){return[1,jC,a,b]}var +F6="remove",F7="contains";function +oo(a){var +b=Fn(E3(a));return b?dM(a,F7,[0,b[1]])|0:0}function +op(e,b){var +c=[0,gZ(F4,F5)];return y(b,function(a){var +b=jx(c[1],a),d=b[2],g=b[1];c[1]=d;g1(e1,function(a,b){return 0===a[0]?a[1][h7]=Ee:0},g,0);var +h=oo(e),i=g0(d);if(i){var +f=function(d,b){if(0!==b[0]){if(!fv(b[1]))return b[1];var l=f(d,b[3]),k=f(l,b[2]);b[1]=k;return k}var c=b[1];delete -c[hY];if(c.parentNode!==e)if(fk(d))dD(e,nL,[0,c]);else -dD(d,jA,[0,c]);else{var +c[h7];if(c.parentNode!==e)if(fv(d))dM(e,on,[0,c]);else +dM(d,jV,[0,c]);else{var a=c.nextSibling!==d?1:0;if(a){if(h)var -g=nM(c),i=g?function(a){for(;;){var -b=c.nextSibling;if(b===d)return 1;if(fk(b))return 0;dD(c,jA,[0,b])}}(0):g;else +g=oo(c),i=g?function(a){for(;;){var +b=c.nextSibling;if(b===d)return 1;if(fv(b))return 0;dM(c,jV,[0,b])}}(0):g;else var i=h;var j=1-i}else var -j=a;if(j)if(fk(d))dD(e,nL,[0,c]);else -dD(d,jA,[0,c])}return c};f(jh,i[1])}gP(eP,function(a,b){if(0!==a[0])return 0;var -c=a[1],d=nk(c[hY]),e=d?(delete -c[hY],dD(c,E2,[0]),0):d;return e},g,0);return e})}var -g7=aB(0),jB=[0,c$,c$];function -EY(a){if(!a)return EZ;var +j=a;if(j)if(fv(d))dM(e,on,[0,c]);else +dM(d,jV,[0,c])}return c};f(jC,i[1])}g1(e1,function(a,b){if(0!==a[0])return 0;var +c=a[1],d=nY(c[h7]),e=d?(delete +c[h7],dM(c,F6,[0]),0):d;return e},g,0);return e})}var +hh=aB(0),jW=[0,de,de];function +F2(a){if(!a)return F3;var b=a[1],c=b[1];if(82===c){if(!a[2])return[0,0,[0,y(b[2],bb)]]}else -if(83<=c){if(!a[2])return[0,0,[0,b[2]]]}else if(!a[2])return[0,[0,b[2],0],0];return vT(nJ,a)?[0,ge(dz(function(a){var -b=a[1];return 82===b?[0,g6(a[2]),0]:83<=b?cG(g6(a[2])):[0,a[2],0]},a)),0]:[0,0,[0,gG(function(a){var -b=a[1];return 82===b?y(a[2],bb):83<=b?a[2]:aB(bb(a[2]))},ni,a)]]}function -nO(c,b){function +if(83<=c){if(!a[2])return[0,0,[0,b[2]]]}else if(!a[2])return[0,[0,b[2],0],0];return wF(ol,a)?[0,gm(cj(function(a){var +b=a[1];return 82===b?[0,hg(a[2]),0]:83<=b?cN(hg(a[2])):[0,a[2],0]},a)),0]:[0,0,[0,gS(function(a){var +b=a[1];return 82===b?y(a[2],bb):83<=b?a[2]:aB(bb(a[2]))},nW,a)]]}function +oq(c,b){function d(a){var -b=a[2],d=a[1];return gQ(d,cf)?nA(b,1,c):jw(d,[0,b],c)}function +b=a[2],d=a[1];return g2(d,cl)?oc(b,1,c):jR(d,[0,b],c)}function e(a){var -b=a[1],d=a[2];return gQ(b,cf)?nA(d,0,c):jw(b,0,c)}function +b=a[1],d=a[2];return g2(b,cl)?oc(d,0,c):jR(b,0,c)}function h(a){var -b=[0,jB];return function(a){if(b[1]!==jB)e(b[1]);var -c=nv(a);d(c);b[1]=c;return 0}}return gG(function(a){var +b=[0,jW];return function(a){if(b[1]!==jW)e(b[1]);var +c=n9(a);d(c);b[1]=c;return 0}}return gS(function(a){var b=a[1];if(82===b){var -i=a[2];return y(i,h(0))}if(83>b)throw g([0,f,E4],1);var -j=a[2],c=[0,gN(function(a){var -b=nv(a);d(b);return b},function(a,b){return jB})];return y(j,function(a){var -b=jc(c[1],a),d=b[2],f=b[1];c[1]=d;gP(eP,function(a,b){return e(a)},f,0);gO(d);return 0})},[0,g7,function(a,b){return g7}],b)}function -jC(a,b){return dE(b[1],b[2],b[3],a)}function -E5(c,b){return gG(function(a){var +i=a[2];return y(i,h(0))}if(83>b)throw g([0,f,F8],1);var +j=a[2],c=[0,gZ(function(a){var +b=n9(a);d(b);return b},function(a,b){return jW})];return y(j,function(a){var +b=jx(c[1],a),d=b[2],f=b[1];c[1]=d;g1(e1,function(a,b){return e(a)},f,0);g0(d);return 0})},[0,hh,function(a,b){return hh}],b)}function +jX(a,b){return dN(b[1],b[2],b[3],a)}function +F9(c,b){return gS(function(a){var b=a[1];if(82===b){var d=[0,0];return y(a[2],function(a){var -b=d[1];if(b)nr(b[1]);d[1]=[0,jC(c,a)];return 0})}if(83>b)throw g([0,f,E6],1);var -h=a[2],e=[0,gN(function(a){return jC(c,a)},function(a,b){return a})];return y(h,function(a){var -b=jc(e[1],a),c=b[2],d=b[1];e[1]=c;gP(eP,function(a,b){return nr(a)},d,0);gO(c);return 0})},[0,g7,function(a,b){return g7}],b)}function -nP(a,b,c,d,e,f){var -p=b?b[1]:0,q=c?c[1]:0,r=d?d[1]:function(a){return},l=nK(p),k=l[2],s=l[1],m=nK(q),n=m[2],t=m[1],o=EY(f),i=o[2],g=nz(a,[0,s],e,o[1]);h(r,g);if(k)if(i)var -u=nN(g,i[1]),j=bZ(nO(g,k),u,function(a,b){return b});else +b=d[1];if(b)n5(b[1]);d[1]=[0,jX(c,a)];return 0})}if(83>b)throw g([0,f,F_],1);var +h=a[2],e=[0,gZ(function(a){return jX(c,a)},function(a,b){return a})];return y(h,function(a){var +b=jx(e[1],a),c=b[2],d=b[1];e[1]=c;g1(e1,function(a,b){return n5(a)},d,0);g0(c);return 0})},[0,hh,function(a,b){return hh}],b)}function +or(a,b,c,d,e,f){var +p=b?b[1]:0,q=c?c[1]:0,r=d?d[1]:function(a){return},l=om(p),k=l[2],s=l[1],m=om(q),n=m[2],t=m[1],o=F2(f),i=o[2],g=ob(a,[0,s],e,o[1]);h(r,g);if(k)if(i)var +u=op(g,i[1]),j=b4(oq(g,k),u,function(a,b){return b});else var -j=y(nO(g,k),function(a){return g});else +j=y(oq(g,k),function(a){return g});else var -j=i?nN(g,i[1]):aB(g);cA(function(a){jC(g,a);return 0},t);var -v=n?bZ(E5(g,n),j,function(a,b){return b}):j;return v}function -dH(a,b,c,d,e,f){return nP(b,c,d,e,a,f)}function -nQ(a,b,c,d,e,f){return nP(b,c,d,e,a,0)}function -Q(a,b,c,d,e){return dH(nB,a,b,c,d,e)}function -g8(a,b,c,d,e){return nQ(Eb,a,b,c,d,e)}function -jD(a,b,c,d,e){return dH(Ec,a,b,c,d,e)}function -nR(a,b,c,d,e){return dH(nC,a,b,c,d,e)}function -E7(a,b,c,d,e){return dH(D9,a,b,c,d,e)}function -E8(a,b,c,d,e){return dH(D_,a,b,c,d,e)}function -E9(a,b,c,d,e){return nQ(Ea,a,b,c,d,e)}function -E_(a,b,c,d,e){return dH(Ed,a,b,c,d,e)}function -E$(a,b,c,d,e){return dH(Ee,a,b,c,d,e)}function -g9(a,b){return a===b?1:0}function -nS(a,b){return a!==b?1:0}function -g_(a,b){return b=i){var e=g;for(;;){var -f=h(a,e+1|0),k=j(b,f)[1+f];b[1+f]=j(b,e)[1+e];b[1+e]=k;var +f=h(a,e+1|0),j=k(b,f)[1+f];b[1+f]=k(b,e)[1+e];b[1+e]=j;var l=e-1|0;if(i===e)break;e=l}}return}function -Fc(a){return Fb(zV,a,0,a.length-1)}function -g$(a,b){return uG(a,b)}function -jF(a){try{var -c=[0,f4(a)];return c}catch(f){var -b=P(f);if(b[1]===dy)return 0;throw g(b,0)}}function -Fd(a){return 4===ig(a)?1:0}function -nU(a){return kw<=a?ku<=a?kI<=a?2:6:kH<=a?4:3:hI<=a?kB<=a?1:7:k2<=a?5:0}function -Fe(a){return typeof -a==="number"?ct<=a?1:0:bh<=a[1]?30+nU(a[2])|0:40+nU(a[2])|0}(function(a){var -b=Fe(a);return h(t(Ff),b)}(rp));var -jG=[B,Fg,ar(0)];function -nV(a){var -b=wa(a),c=e0(b,"blue");if(0<=c){if(0>=c)return Fp;if(b==="bold")return Fo;if(b==="cyan")return Fn;if(b==="green")return Fm;if(b==="magenta")return Fl;if(b==="red")return Fk;if(b==="reset")return Fj;if(b==="white")return Fi;if(b==="yellow")return Fh}else{if(b==="Black")return Fy;if(b==="Blue")return Fx;if(b==="Cyan")return Fw;if(b==="Green")return Fv;if(b==="Magenta")return Fu;if(b==="Red")return Ft;if(b==="White")return Fs;if(b==="Yellow")return Fr;if(b==="black")return Fq}throw g(jG,1)}function -nW(a,b){c5(b,a);return FA}function -nX(a){try{wL(a);wM(a)}catch(f){var -b=P(f);if(b!==iF)throw g(b,0)}return FB}var -nY=[B,FC,ar(0)],Fz=0;function -FD(a,b,c){if(c[1]===nY)return nW(a,c[2]);if(c[1]!==ed)return h(b,c);var +Gg(a){return Gf(A7,a,0,a.length-1)}function +hk(a,b){return vl(a,b)}function +j0(a){try{var +c=[0,gc(a)];return c}catch(f){var +b=P(f);if(b[1]===dH)return 0;throw g(b,0)}}function +Gh(a){return 4===is(a)?1:0}function +ox(a){return kR<=a?kP<=a?k4<=a?2:6:k3<=a?4:3:hT<=a?kW<=a?1:7:ll<=a?5:0}function +Gi(a){return typeof +a==="number"?cE<=a?1:0:bh<=a[1]?30+ox(a[2])|0:40+ox(a[2])|0}(function(a){var +b=Gi(a);return h(t(Gj),b)}(r3));var +j1=[B,Gk,ar(0)];function +oy(a){var +b=w4(a),c=e$(b,"blue");if(0<=c){if(0>=c)return Gt;if(b==="bold")return Gs;if(b==="cyan")return Gr;if(b==="green")return Gq;if(b==="magenta")return Gp;if(b==="red")return Go;if(b==="reset")return Gn;if(b==="white")return Gm;if(b==="yellow")return Gl}else{if(b==="Black")return GC;if(b==="Blue")return GB;if(b==="Cyan")return GA;if(b==="Green")return Gz;if(b==="Magenta")return Gy;if(b==="Red")return Gx;if(b==="White")return Gw;if(b==="Yellow")return Gv;if(b==="black")return Gu}throw g(j1,1)}function +oz(a,b){c$(b,a);return GE}function +oA(a){try{xD(a);xE(a)}catch(f){var +b=P(f);if(b!==iQ)throw g(b,0)}return GF}var +oB=[B,GG,ar(0)],GD=0;function +GH(a,b,c){if(c[1]===oB)return oz(a,c[2]);if(c[1]!==ep)return h(b,c);var e=c[2];try{var -f=nW(a,nV(e));return f}catch(f){var -d=P(f);if(d===jG)return h(b,c);throw g(d,0)}}function -FE(a,b,c){if(c[1]===nY)return nX(a);if(c[1]!==ed)return h(b,c);var -e=c[2];try{nV(e)}catch(f){var -d=P(f);if(d===jG)return h(b,c);throw g(d,0)}return nX(a)}function -FF(a){var -c=d_(0);Ao(a,1);var -b=Ap(a,0),d=b[2],e=b[1];return Aq(a,[0,function(a){return FD(c,e,a)},function(a){return FE(c,d,a)},b[3],b[4]])}function -FG(a,b){var -d=cd(64),c=eh(d),e=a?Fz:a;if(e)FF(c);return i0(function(a){c6(c,0);return ce(d)},c,b)}function -jH(a){return FG(1,a)}function -ha(a,b){return vX(a,b)}function -nZ(a){return a|0}function -FH(a){try{var -c=[0,uO(a)];return c}catch(f){var -b=P(f);if(b[1]===dy)return 0;throw g(b,0)}}function -n0(a,b){try{var -d=[0,mu(a,b)];return d}catch(f){var -c=P(f);if(c===a9)return 0;throw g(c,0)}}function -fn(a,b){if(!b)return 0;var -d=b[2],c=[0,h(a,b[1]),hQ];FI(c,1,a,d);return c}function -FI(a,b,c,d){var -g=a,f=b,e=d;for(;;){if(!e){g[1+f]=0;return}var -j=e[2],i=[0,h(c,e[1]),hQ];g[1+f]=i;g=i;f=1;e=j}}function -FJ(a,b){function -e(a,b,c,d,e){var -i=a,g=b,f=c;for(;;){if(g9(f,d)){i[1+g]=0;return}var -j=[0,h(e,f),hQ];i[1+g]=j;i=j;g=1;f=f+1|0}}return function(a,b,c){if(g9(a,b))return 0;var -d=[0,h(c,a),hQ];e(d,1,a+1|0,b,c);return d}(0,a,b)}function -FK(a){var -b=iE(a)[13];return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(a){return b(function(a,b,c){return[0,[0,a,b],c]},a,0)}]}function -n1(a){return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,FK(a)[59]]}function -dI(a,b){return b?[0,h(a,b[1])]:0}function -n2(a,b,c){return c?h(b,c[1]):a}function -FM(a,b){if(b)return h(a,b[1]);return}function -n3(a,b){return FM(b,a)}function -n4(a,b){if(b)return h(a,b[1]);return}function -eq(a,b){return a?a[1]:b}function -n5(a,b){return dI(b,a)}function -FL(a){return a?1:0}function -FN(a,b){return b?b[1]:a}function -FO(a){return a?[0,a[1],0]:0}mm(0);function -FP(a,b){if(0!==b[0])return;h(a,b[1]);return}var -FR=[B,FQ,ar(0)];function -b2(a){if(0===a[0])return a[1];throw g(FR,1)}function -FT(a,b){return 0===b[0]?h(a,b[1]):[1,b[1]]}function -n6(a,b){return FP(b,a)}function -FS(a,b){return 0===a[0]?a[1]:b}function -FU(a,b){return FT(b,a)}function -FV(a){var -b=ma(a);return[0,,,,b[1],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[37],,,,,,,,,,,b[23]]}function -jI(a){var -b=FV(a);return[0,b[4],,,,,,,,,,,,,,,,,,,,,,,,,,,,b[40],,,,,,,,,,,,,,,,,,,,b[51]]}function -FW(e,b){var -d=p(e);if(g_(d,p(b)))return 0;var +f=oz(a,oy(e));return f}catch(f){var +d=P(f);if(d===j1)return h(b,c);throw g(d,0)}}function +GI(a,b,c){if(c[1]===oB)return oA(a);if(c[1]!==ep)return h(b,c);var +e=c[2];try{oy(e)}catch(f){var +d=P(f);if(d===j1)return h(b,c);throw g(d,0)}return oA(a)}function +GJ(a){var +c=eh(0);BA(a,1);var +b=BB(a,0),d=b[2],e=b[1];return BC(a,[0,function(a){return GH(c,e,a)},function(a){return GI(c,d,a)},b[3],b[4]])}function +GK(a,b){var +d=bL(64),c=dL(d),e=a?GD:a;if(e)GJ(c);return jj(function(a){cB(c,0);return b3(d)},c,b)}function +j2(a){return GK(1,a)}function +hl(a,b){return wL(a,b)}function +oC(a){return a|0}function +GL(a){try{var +c=[0,vw(a)];return c}catch(f){var +b=P(f);if(b[1]===dH)return 0;throw g(b,0)}}function +oD(a,b){try{var +d=[0,m4(a,b)];return d}catch(f){var +c=P(f);if(c===a_)return 0;throw g(c,0)}}function +GM(a){var +b=iP(a)[24];return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(a){return b(function(a,b,c){return[0,[0,a,b],c]},a,0)}]}function +oE(a){return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,GM(a)[60]]}function +dR(a,b){return b?[0,h(a,b[1])]:0}function +oF(a,b,c){return c?h(b,c[1]):a}function +GO(a,b){if(b)return h(a,b[1]);return}function +oG(a,b){return GO(b,a)}function +oH(a,b){if(b)return h(a,b[1]);return}function +eC(a,b){return a?a[1]:b}function +oI(a,b){return dR(b,a)}function +GN(a){return a?1:0}function +GP(a,b){return b?b[1]:a}function +GQ(a){return a?[0,a[1],0]:0}mX(0);function +GR(a,b){if(0!==b[0])return;h(a,b[1]);return}var +GT=[B,GS,ar(0)];function +b7(a){if(0===a[0])return a[1];throw g(GT,1)}function +GV(a,b){return 0===b[0]?h(a,b[1]):[1,b[1]]}function +oJ(a,b){return GR(b,a)}function +GU(a,b){return 0===a[0]?a[1]:b}function +GW(a,b){return GV(b,a)}function +GX(a){var +b=mB(a);return[0,,,,b[1],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[38],,,,,,,,,,,b[10]]}function +j3(a){var +b=GX(a);return[0,b[4],,,,,,,,,,,,,,,,,,,,,,,,,,,,b[40],,,,,,,,,,,,,,,,,,,,b[51]]}function +GY(e,b){var +d=p(e);if(hj(d,p(b)))return 0;var f=p(b)-d|0;return function(a){var -c=a;for(;;){if(g9(c,d))return 1;if(bw(b,f+c|0)!==bw(e,c))return 0;c=c+1|0}}(0)}function -jJ(a,b){return FW(a,b)?[0,iC(b,0,p(b)-p(a)|0)]:0}function -FX(a,b){return}function -FY(a,b){FX(a,b);return}var -n8=[B,FZ,ar(0)];function -n9(a){return[0,[0,a]]}function -dJ(a,b,c,d){return[1,a,b,c,d]}function -F1(a){if(0===a[0]&&typeof +c=a;for(;;){if(ou(c,d))return 1;if(bt(b,f+c|0)!==bt(e,c))return 0;c=c+1|0}}(0)}function +j4(a,b){return GY(a,b)?[0,iN(b,0,p(b)-p(a)|0)]:0}function +GZ(a,b){return}function +G0(a,b){GZ(a,b);return}var +oL=[B,G1,ar(0)];function +oM(a){return[0,[0,a]]}function +dS(a,b,c,d){return[1,a,b,c,d]}function +G3(a){if(0===a[0]&&typeof a[1]==="number")return 1;return 0}function -n_(a,b){if(0===b[0]){var +oN(a,b){if(0===b[0]){var c=b[1];if(typeof -c==="number")return n9(a);switch(c[0]){case +c==="number")return oM(a);switch(c[0]){case 0:return[0,[1,a,c[1]]];case -1:return[0,[2,a,c[1],c[2]]];default:return dJ(4,[1,a,c[1]],F0,[1,c[2],c[3]])}}var +1:return[0,[2,a,c[1],c[2]]];default:return dS(4,[1,a,c[1]],G2,[1,c[2],c[3]])}}var d=b[2],f=b[1];if(typeof d!=="number")switch(d[0]){case 0:break;case -1:return dJ(f+1|0,[2,a,d[1],d[2]],b[3],b[4]);default:var -e=b[3],h=d[3],i=d[2],j=d[1],g=c2(e),k=cu===g?e[1]:dV===g?iz(e):e;return dJ(f+1|0,[1,a,j],[dV,function(a){return n_([0,i,h],k)}],b[4])}return dJ(f+1|0,[1,a,d[1]],b[3],b[4])}function -n$(a){if(0===a[0]){var +1:return dS(f+1|0,[2,a,d[1],d[2]],b[3],b[4]);default:var +e=b[3],i=d[3],j=d[2],k=d[1],g=dG(e);a:if(c0===g)var +h=e[1];else{if(d4!==g&&dx!==g){var +h=e;break a}var +h=mk(e)}return dS(f+1|0,[1,a,k],[d4,function(a){return oN([0,j,i],h)}],b[4])}return dS(f+1|0,[1,a,d[1]],b[3],b[4])}function +oO(a){if(0===a[0]){var b=a[1];if(typeof -b==="number")throw g(n8,1);switch(b[0]){case -0:return[0,n7,b[1]];case +b==="number")throw g(oL,1);switch(b[0]){case +0:return[0,oK,b[1]];case 1:var -n=b[2];return[0,n9(b[1]),n];default:return[0,[0,[1,b[1],b[2]]],b[3]]}}var -d=a[3],e=a[2],f=a[1],i=c2(d),j=cu===i?d[1]:dV===i?iz(d):d,h=a[4];if(typeof -h!=="number"&&0!==h[0]){var +n=b[2];return[0,oM(b[1]),n];default:return[0,[0,[1,b[1],b[2]]],b[3]]}}var +d=a[3],e=a[2],h=a[1],i=dG(d);a:if(c0===i)var +f=d[1];else{if(d4!==i&&dx!==i){var +f=d;break a}var +f=mk(d)}var +j=a[4];if(typeof +j!=="number"&&0!==j[0]){var c=a[4];if(typeof c!=="number"&&2===c[0]){var -q=c[3];return[0,dJ(f-1|0,e,d,[1,c[1],c[2]]),q]}var -p=c[2];return[0,dJ(f-1|0,e,d,[0,c[1]]),p]}var -k=h[1];if(F1(j))return[0,[0,e],k];var -l=n$(j),m=l[2],o=[1,m[1],m[2]];return[0,dJ(f-1|0,e,vw(l[1]),o),k]}function -F3(a){if(typeof +q=c[3];return[0,dS(h-1|0,e,d,[1,c[1],c[2]]),q]}var +p=c[2];return[0,dS(h-1|0,e,d,[0,c[1]]),p]}var +k=j[1];if(G3(f))return[0,[0,e],k];var +l=oO(f),m=l[2],o=[1,m[1],m[2]];return[0,dS(h-1|0,e,wh(l[1]),o),k]}function +G5(a){if(typeof a==="number")return 0;switch(a[0]){case 0:return 1;case 1:return 2;default:return 3}}function -F2(a){try{var -c=[0,n$(a)];return c}catch(f){var -b=P(f);if(b===n8)return 0;throw g(b,0)}}function -F4(a){return 0===a[0]?F3(a[1]):a[1]}function -F5(a){return a["height"]}function -F6(a){return a}function -F8(a){switch(a){case -0:return F9;case -1:return F_;default:return F$}}function -F7(a){return F6(a["contentRect"])}function -Ga(a,b,c){var -d=b?[0,c,{box:av(F8(b[1]))}]:[0,c];dv(a,"observe",d);return 0}function -Gb(c){return new -v["ResizeObserver"](function(a,b){return i(c,ep(function(a){return a},a),b)})}function -oa(a){return a["mediaSession"]}function -Gc(a){var -b=av(a[3]),c=av(a[2]);return{src:av(a[1]),sizes:c,type:b}}function -ob(a){var -b=fl(Gc,a[4]),c=av(a[3]),d=av(a[2]);return{title:av(a[1]),artist:d,album:c,artwork:b}}function -oc(a,b,c){a.setActionHandler(b,c1(1,c));return}function -Gd(a,b){b1([0,Ge,[0,ob(b),0]]);var -c=ob(b);a["metadata"]=new -v["MediaMetadata"](c);return}var -Gf="nexttrack",Gg="previoustrack";function -Gh(a,b,c,d){function -e(c,b){return iA(function(a){return[0,c,a]},b)}var -g=e(Gi,a),h=e(Gj,b),i=[0,g,[0,h,[0,e(Gk,c),0]]],f=lY(function(a){return a})(i),j=f?[0,uQ(gj(f))]:[0];dv(d,"setPositionState",j);return 0}v["IDBKeyRange"];function -od(a,b){return[0,b,a]}var -oe=[0,function(a){return a},function(a){return a}];function -Gl(a){return 0===a[0]?av(a[1]):Di(av,a[1])}function -Gm(a,b,c){return[0,a,b]}function -Gn(f,b){function -g(a,b){return Gm(f,a,b)}var +G4(a){try{var +c=[0,oO(a)];return c}catch(f){var +b=P(f);if(b===oL)return 0;throw g(b,0)}}function +G6(a){return 0===a[0]?G5(a[1]):a[1]}function +G7(a){return a["height"]}function +G8(a){return a}function +G_(a){switch(a){case +0:return G$;case +1:return Ha;default:return Hb}}function +G9(a){return G8(a["contentRect"])}function +Hc(a,b,c){var +d=b?[0,c,{box:aw(G_(b[1]))}]:[0,c];dD(a,"observe",d);return 0}function +Hd(c){return new +w["ResizeObserver"](function(a,b){return i(c,eB(function(a){return a},a),b)})}function +oP(a){return a["mediaSession"]}function +He(a){var +b=aw(a[3]),c=aw(a[2]);return{src:aw(a[1]),sizes:c,type:b}}function +oQ(a){var +b=fw(He,a[4]),c=aw(a[3]),d=aw(a[2]);return{title:aw(a[1]),artist:d,album:c,artwork:b}}function +oR(a,b,c){a.setActionHandler(b,c8(1,c));return}function +Hf(a,b){b6([0,Hg,[0,oQ(b),0]]);var +c=oQ(b);a["metadata"]=new +w["MediaMetadata"](c);return}var +Hh="nexttrack",Hi="previoustrack";function +Hj(a,b,c,d){function +e(c,b){return iK(function(a){return[0,c,a]},b)}var +g=e(Hk,a),h=e(Hl,b),f=mp(function(a){return a},[0,g,[0,h,[0,e(Hm,c),0]]]),i=f?[0,vy(gr(f))]:[0];dD(d,"setPositionState",i);return 0}w["IDBKeyRange"];function +oS(a,b){return[0,b,a]}var +oT=[0,function(a){return a},function(a){return a}];function +Hn(a){return 0===a[0]?aw(a[1]):Em(aw,a[1])}function +Ho(a,b,c){return[0,a,b]}function +Hp(f,b){function +g(a,b){return Ho(f,a,b)}var c=function(a){return g(b,a)}(b),d=c[1],e=c[2],a=[0,d,e,,,,,,,,,,,function(a,b,c){if(b)var g=h(e[1],b[1]),f=[0,h(d[2],a),g];else var f=[0,h(d[2],a)];var -i=dv(c,"add",f),j=e[2];return function(a){return od(j,a)}(i)},function(e){return function(a,b,c,d){var -f=[0,iA(function(a){return[0,Go,!!a]},c),0],g=uQ(gj(lY(function(a){return a})(f))),i=Gl(b),j=d.createIndex(av(a),i,g);return h(e[1],j)}},function(c){return function(a,b){var -d=b.index(av(a));return h(c[1],d)}},function(a,b,c){if(b)var +i=dD(c,"add",f),j=e[2];return function(a){return oS(j,a)}(i)},function(a,b,c,d,e){function +f(a){return a}var +g=vy(gr(function(a){return mp(f,a)}([0,iK(function(a){return[0,Hq,!!a]},d),0]))),i=Hn(c),j=e.createIndex(aw(b),i,g);return h(a[1],j)},function(a,b,c){var +d=c.index(aw(b));return h(a[1],d)},function(a,b,c){if(b)var g=h(e[1],b[1]),f=[0,h(d[2],a),g];else var f=[0,h(d[2],a)];var -i=dv(c,"put",f),j=e[2];return function(a){return od(j,a)}(i)}];return[0,,a[1],a[2],,,,,,,,,,,,a[14]]}function -dK(a,b){return}function -dL(a,b){var -c=Gn(a,b);return[0,,,,,,,,,,,,c[2],c[3],,c[15]]}var -Gp=p3,Gq="pattern";function -Gr(a){function -b(a){return a|0}return function(a){return jo(b,a)}(a.persist())}function -Gs(a){return a["storage"]}var -of=jI([0,e9]);function -Gt(a,b){h(a,b);return b}function -Gu(a){var -b=jJ(Gv,a);if(b){var -c=b[1],d=FH(c);if(d)return[0,[0,d[1]]];var -g=function(a){return[0,a]};return function(a){return dI(g,a)}(jF(c))}var -e=jJ(Gw,a);if(e){var -h=function(a){return[1,a]};return function(a){return dI(h,a)}(jF(e[1]))}var -f=jJ(Gx,a);if(!f)return 0;function -i(a){return[1,a]}return function(a){return dI(i,a)}(jF(f[1]))}function -og(a){switch(a[0]){case +i=dD(c,"put",f),j=e[2];return function(a){return oS(j,a)}(i)}];return[0,,a[1],a[2],,,,,,,,,,,,a[14]]}function +dT(a,b){return}function +dU(a,b){var +c=Hp(a,b);return[0,,,,,,,,,,,,c[2],c[3],,c[15]]}var +Hr=qH,Hs="pattern";function +Ht(a){function +b(a){return a|0}return function(a){return jJ(b,a)}(a.persist())}function +Hu(a){return a["storage"]}var +oU=j3([0,fk]);function +Hv(a,b){h(a,b);return b}function +Hw(a){var +b=j4(Hx,a);if(b){var +c=b[1],d=GL(c);if(d)return[0,[0,d[1]]];var +g=function(a){return[0,a]};return function(a){return dR(g,a)}(j0(c))}var +e=j4(Hy,a);if(e){var +h=function(a){return[1,a]};return function(a){return dR(h,a)}(j0(e[1]))}var +f=j4(Hz,a);if(!f)return 0;function +i(a){return[1,a]}return function(a){return dR(i,a)}(j0(f[1]))}function +oV(a){switch(a[0]){case 0:var -b=a[1];return h(t(Gy),b);case +b=a[1];return h(t(HA),b);case 1:var -c=a[1];return h(t(Gz),c);default:var -d=a[1];return h(t(GA),d)}}function -jK(a){var -c=a?a[1]:nD(dG);function +c=a[1];return h(t(HB),c);default:var +d=a[1];return h(t(HC),d)}}function +j5(a){var +c=a?a[1]:of(dP);function b(a){var -b=Gu(bH(D4(0,"font-size",a)));if(!b)return 16.;var -c=b[1];return 0===c[0]?c[1]:e2(GB)}return function(a){switch(a[0]){case +b=Hw(bI(E8(0,"font-size",a)));if(!b)return 16.;var +c=b[1];return 0===c[0]?c[1]:fb(HD)}return function(a){switch(a[0]){case 0:return a[1];case 1:var -d=a[1];return d*b(nD(dG));default:var +d=a[1];return d*b(of(dP));default:var e=a[1];return e*b(c)}}}function -oh(e,b,c,d){function -f(a,b){return bZ(d,a,b)}function -g(a,b){return a6(e,b[1],b[2],a)}return function(a){return f(a,g)}(bZ(b,c,function(a,b){return[0,a,b]}))}var -GE=[B,GD,ar(0)],GG=[B,GF,ar(0)];function -oi(a){return[0,0]}function -oj(a,b){if(a[1])throw g(GG,1);a[1]=[0,b];return 0}function -jL(a){var -b=a[1];if(b)return b[1];throw g(GE,1)}function -GC(a,b,c){return oh(function(a,b,c){return[0,a,b,c]},a,b,c)}function -GH(a){return jq(a)}function -GI(a){var -b=gW(a);return 0===b[0]?[0,b[1]]:(nE([0,b[1],0]),GJ)}var -ok=EP(nF);function -ol(c,b){return function(a){return ER(ok,c,a)}(GH(b))}function -GK(a){var -b=EQ(ok,a);function -c(a){return GI(a)}var -d=b?[0,b[1]]:GL;return FU(d,c)}function -GM(a,b){var -c=GK(a);if(0===c[0])return c[1];var +oW(e,b,c,d){function +f(a,b){return a7(e,b[1],b[2],a)}function +g(a,b){return b4(d,a,b)}return function(a){return g(a,f)}(b4(b,c,function(a,b){return[0,a,b]}))}var +HG=[B,HF,ar(0)],HI=[B,HH,ar(0)];function +oX(a){return[0,0]}function +oY(a,b){if(a[1])throw g(HI,1);a[1]=[0,b];return 0}function +j6(a){var +b=a[1];if(b)return b[1];throw g(HG,1)}function +HE(a,b,c){return oW(function(a,b,c){return[0,a,b,c]},a,b,c)}function +HJ(a){return jL(a)}function +HK(a){var +b=g8(a);return 0===b[0]?[0,b[1]]:(og([0,b[1],0]),HL)}var +oZ=FT(oh);function +o0(c,b){return function(a){return FV(oZ,c,a)}(HJ(b))}function +HM(a){var +b=FU(oZ,a);function +c(a){return HK(a)}var +d=b?[0,b[1]]:HN;return GW(d,c)}function +HO(a,b){var +c=HM(a);if(0===c[0])return c[1];var d=c[1];return typeof -d==="number"?h(b,0):(Em([0,d[2],0]),h(b,0))}function -GN(d,b){ol(d,b);var -a=aC(b),c=gE(0,aD(a));gF(c,function(a){ol(d,c9(c));return 0});c9(c);return a}function -om(a,b){var -c=O(a);return GN(c,GM(c,b))}function -hb(a,b){return om(a,function(a){return b})}function -GO(d){function +d==="number"?h(b,0):(Fq([0,d[2],0]),h(b,0))}function +HP(d,b){o0(d,b);var +a=aC(b),c=gQ(0,aD(a));gR(c,function(a){o0(d,dc(c));return 0});dc(c);return a}function +o1(a,b){var +c=O(a);return HP(c,HO(c,b))}function +hm(a,b){return o1(a,function(a){return b})}function +HQ(d){function c(a,b,c){var -e=b?b[1]:GQ;return h(a,[0,i(t(GP),d,e),c])}function -b(a,b){return c(Eo,a,b)}return[0,,,,function(a){return b(0,a)}]}var -GS=of[49],GR=of[29];function -GT(a){return fn(function(a){return[0,80,cg(O(a))]},GS(a))}var -GU=0;function -on(a,b){var -d=GT(b[1]),e=b[2],c=function(a){return cq(e,a)}(d);return a?[0,[0,80,DU(O(a[1]))],c]:c}function -oo(a){return[0,GR(a),GU]}function +e=b?b[1]:HS;return h(a,[0,i(t(HR),d,e),c])}function +b(a,b){return c(Fs,a,b)}return[0,,,,function(a){return b(0,a)}]}var +HU=oU[49],HT=oU[29];function +HV(a){return cj(function(a){return[0,80,cm(O(a))]},HU(a))}var +HW=0;function +o2(a,b){var +d=HV(b[1]),e=b[2],c=function(a){return cz(e,a)}(d);return a?[0,[0,80,EY(O(a[1]))],c]:c}function +o3(a){return[0,HT(a),HW]}function aQ(d,b,c){var -a=b[1],e=82===a?[0,82,y(b[2],function(a){return function(a){return bL(d,a)}(O(a))})]:83<=a?e2(GV):[0,80,function(a){return bL(d,a)}(O(b[2]))];return[0,e,c]}function -hc(d,b,c){return b?[0,[0,80,function(a){return bL(d,a)}(O(b[1]))],c]:c}function -op(a,b){var -c=b[1];return 82===c?[0,82,y(b[2],a)]:83<=c?[0,83,cH(a,b[2])]:[0,80,h(a,b[2])]}function -GX(a){return 0===a[0]?cg(O(a[1])):a[1]}function -jM(a,b){return[0,op(GX,a),b]}function -db(a){return jM(a,0)}function -hd(a,b){return jM(a,b)}function -GW(a,b,c){return b?[0,[0,80,a],c]:c}function -GY(a){return jM(op(function(a){return[0,a]},a),0)}function -GZ(a,b,c,d){var -e=b?b[1]:0;return g8(a,[0,function(a){return aQ(g0,d,a)}(aQ(fm,G0,e))],c,0,0)}function -G1(a,b){return 0===b[0]?(a.scroll(0,b[1]),0):D7(0,b[1])}function -G2(a,b,c,d,e){var -g=a?a[1]:0,h=b?b[1]:0,f=aC(1),i=hd(G3,hd([0,82,y(aD(f),function(a){return a?[1,cg("locked")]:[1,gY]})],g)),j=GY(G4),k=[0,[0,80,ch(0,gV,function(a){return ag(f,1)})],0],l=Q(0,[0,j],[0,k],0,[0,[0,82,E7(0,0,0,0,[0,[0,80,bd(0,G5)],0])],0]),m=ch(0,DA,function(a){var -b=at(f);return b?ag(f,0):b});return Q(0,[0,i],[0,[0,[0,80,m],h]],c,[0,[0,82,y(GC(e,aD(f),d),function(a){var -b=a[1],c=a[3];if(a[2])n4(function(a){return G1(b,a)},c);return b})],[0,[0,82,l],0]])}function -G6(e,b,c){var -d=aC(c);return[0,ch(0,b,function(a){return ag(d,h(e,gU(a)[cO]))}),d]}function -jN(a,b,c,d,e,f,g,h,i,j){var -l=d?d[1]:0,m=f?f[1]:0,n=function(a){return hc(Gq,h,a)}(function(a){return GW(DV,m,a)}([0,[0,80,DX(O(i))],l])),o=eq(b,function(a){return[0,a]}),k=G6(a,g,j),p=k[2],q=k[1];return[0,g8(c,[0,n],[0,[0,[0,80,q],FO(e)]],0,0),p,o]}function -oq(a,b,c,d,e,f,g,h){var -i=c?c[1]:0,j=function(a){return hc(g0,h,a)}(function(a){return hc(nw,g,a)}(i));return jN(bc,a,b,[0,j],d,e,ns,f,G8,FN(G7,h))}function -G9(a,b,c,d,e,f,g,h){var -i=c?c[1]:0;return jN(bc,a,b,[0,function(a){return hc(nw,g,a)}(i)],d,e,ns,f,G$,G_)}function -Ha(a,b,c,d){var -e=b?b[1]:0;return jN(function(a){return 0},0,a,[0,aQ(g0,d,e)],c,0,jp,0,Hb,0)}function -he(a,b){return y(a,function(a){return[0,a,b]})}function -Hc(a,b,c,d){return function(g){var -i=[0,[0,bK,function(a){return a}],function(a,b){var -c=b[2],d=a[2];return[0,b0(a[1],b[1]),function(a){return h(c,h(d,a))}]}];function +a=b[1],e=82===a?[0,82,y(b[2],function(a){return function(a){return bP(d,a)}(O(a))})]:83<=a?fb(HX):[0,80,function(a){return bP(d,a)}(O(b[2]))];return[0,e,c]}function +hn(d,b,c){return b?[0,[0,80,function(a){return bP(d,a)}(O(b[1]))],c]:c}function +o4(a,b){var +c=b[1];return 82===c?[0,82,y(b[2],a)]:83<=c?[0,83,cO(a,b[2])]:[0,80,h(a,b[2])]}function +HZ(a){return 0===a[0]?cm(O(a[1])):a[1]}function +j7(a,b){return[0,o4(HZ,a),b]}function +dg(a){return j7(a,0)}function +ho(a,b){return j7(a,b)}function +HY(a,b,c){return b?[0,[0,80,a],c]:c}function +H0(a){return j7(o4(function(a){return[0,a]},a),0)}function +H1(a,b,c,d){var +e=b?b[1]:0;return hi(a,[0,function(a){return aQ(ha,d,a)}(aQ(fx,H2,e))],c,0,0)}function +H3(a,b){return 0===b[0]?(a.scroll(0,b[1]),0):E$(0,b[1])}function +H4(a,b,c,d,e){var +g=a?a[1]:0,h=b?b[1]:0,f=aC(1),i=ho(H5,ho([0,82,y(aD(f),function(a){return a?[1,cm("locked")]:[1,g_]})],g)),j=H0(H6),k=[0,[0,80,cn(0,g7,function(a){return af(f,1)})],0],l=Q(0,[0,j],[0,k],0,[0,[0,82,F$(0,0,0,0,[0,[0,80,bd(0,H7)],0])],0]),m=cn(0,EE,function(a){var +b=au(f);return b?af(f,0):b});return Q(0,[0,i],[0,[0,[0,80,m],h]],c,[0,[0,82,y(HE(e,aD(f),d),function(a){var +b=a[1],c=a[3];if(a[2])oH(function(a){return H3(b,a)},c);return b})],[0,[0,82,l],0]])}function +H8(e,b,c){var +d=aC(c);return[0,cn(0,b,function(a){return af(d,h(e,g6(a)[cV]))}),d]}function +j8(a,b,c,d,e,f,g,h,i,j){var +l=d?d[1]:0,m=f?f[1]:0,n=function(a){return hn(Hs,h,a)}(function(a){return HY(EZ,m,a)}([0,[0,80,E1(O(i))],l])),o=eC(b,function(a){return[0,a]}),k=H8(a,g,j),p=k[2],q=k[1];return[0,hi(c,[0,n],[0,[0,[0,80,q],GQ(e)]],0,0),p,o]}function +o5(a,b,c,d,e,f,g,h){var +i=c?c[1]:0,j=function(a){return hn(ha,h,a)}(function(a){return hn(n_,g,a)}(i));return j8(bc,a,b,[0,j],d,e,n6,f,H_,GP(H9,h))}function +H$(a,b,c,d,e,f,g,h){var +i=c?c[1]:0;return j8(bc,a,b,[0,function(a){return hn(n_,g,a)}(i)],d,e,n6,f,Ib,Ia)}function +Ic(a,b,c,d){var +e=b?b[1]:0;return j8(function(a){return 0},0,a,[0,aQ(ha,d,e)],c,0,jK,0,Id,0)}function +hp(a,b){return y(a,function(a){return[0,a,b]})}function +Ie(a,b,c,d,e){var +i=[0,[0,bO,function(a){return a}],function(a,b){var +c=b[2],d=a[2];return[0,b5(a[1],b[1]),function(a){return h(c,h(d,a))}]}];function j(a){var b=a[1],c=a[2];function d(a){var -c=at(b[2]);return h(b[3],c)}return[0,bb(b[1]),function(a){var +c=au(b[2]);return h(b[3],c)}return[0,bb(b[1]),function(a){var b=d(0);return h(h(c,a),b)}]}var -e=function(a){return c_(j,i,a)}(cr(d[2])),f=[0,82,y(e,function(a){var -b=a[2];return ch(0,Gp,function(a){h(g,h(b,d[1]));return nq(a)})})],k=y(e,function(a){return a[1]}),l=n2([0,f,0],function(a){return vN(f,a)},c);return E8(a,b,[0,l],0,[0,[0,83,cr(k)],0])}}function -or(a,b){return a?h(t(Hd),b):h(t(He),b)}function -Hf(a,b,c,d){var -k=a?a[1]:0,l=b?b[1]:0,g=c?c[1]:function(a){return 0},e=or(1,d[1]),m=or(0,d[1]),f=hb(e,d[2]);(function(a){return n4(g,a)}(at(f)));var -n=d[3];jD(0,[0,[0,[0,80,jv(O(e))],0]],0,0,n);var -o=[0,80,m],i=function(a){return aQ(fm,Hg,a)}(function(a){return aQ(jt,o,a)}(aQ(gZ,[0,80,e],k))),j=at(f),p=j?[0,[0,80,ny(O(j[1]))],i]:i;return[0,g8(0,[0,p],[0,[0,[0,80,ch(0,Dx,function(a){var -b=bc(gU(a)[cO]);h(g,b);return ag(f,[0,b])})],l]],0,0)]}function -os(a,b){return a?h(t(Hh),b):b}function -ot(a,b,c,d,e){var -g=a?a[1]:1,i=b?b[1]:0,j=c?c[1]:0,f=d?d[1]:function(a){return};return function(a){var -b=os(1,e[1]),d=os(0,e[1]),c=g?hb(b,e[2]):aC(e[2]);h(f,at(c));var -k=e[3];jD(0,[0,[0,[0,80,jv(O(b))],0]],0,0,k);var -l=[0,80,d],m=function(a){return aQ(fm,Hi,a)}(function(a){return aQ(jt,l,a)}(aQ(gZ,[0,80,b],i))),n=[0,[0,80,ch(0,jp,function(a){var -b=bc(gU(a)[cO]);h(f,b);return ag(c,b)})],j];return[0,E$(0,[0,m],[0,n],0,[0,[0,83,cr(cH(function(a){var -b=a[1],d=a[2],e=db([0,80,[1,ny(O(b))]]),f=hd([0,82,y(aD(c),function(a){return[1,DO(g$(a,b),DW)]})],e);return E_(0,[0,f],0,0,[0,[0,80,bd(0,d)],0])},a))],0])]}}function -Hj(a,b,c){return a6(t(Hk),c,a,b)}function -Hl(a,b,c,d,e,f,g){var -l=b?b[1]:0,m=c?c[1]:function(a){return},j=h(jH(Hm),d);function +f=function(a){return dd(j,i,a)}(cC(d[2])),g=[0,82,y(f,function(a){var +b=a[2];return cn(0,Hr,function(a){h(e,h(b,d[1]));return n4(a)})})],k=y(f,function(a){return a[1]}),l=oF([0,g,0],function(a){return wy(g,a)},c);return Ga(a,b,[0,l],0,[0,[0,83,cC(k)],0])}function +o6(a,b){return a?h(t(If),b):h(t(Ig),b)}function +Ih(a,b,c,d){var +k=a?a[1]:0,l=b?b[1]:0,g=c?c[1]:function(a){return 0},e=o6(1,d[1]),m=o6(0,d[1]),f=hm(e,d[2]);(function(a){return oH(g,a)}(au(f)));var +n=d[3];jY(0,[0,[0,[0,80,jQ(O(e))],0]],0,0,n);var +o=[0,80,m],i=function(a){return aQ(fx,Ii,a)}(function(a){return aQ(jO,o,a)}(aQ(g$,[0,80,e],k))),j=au(f),p=j?[0,[0,80,oa(O(j[1]))],i]:i;return[0,hi(0,[0,p],[0,[0,[0,80,cn(0,EB,function(a){var +b=bc(g6(a)[cV]);h(g,b);return af(f,[0,b])})],l]],0,0)]}function +o7(a,b){return a?h(t(Ij),b):b}function +o8(a,b,c,d,e,f){var +k=a?a[1]:1,l=b?b[1]:0,m=c?c[1]:0,j=d?d[1]:function(a){return},g=o7(1,e[1]),n=o7(0,e[1]),i=k?hm(g,e[2]):aC(e[2]);h(j,au(i));var +o=e[3];jY(0,[0,[0,[0,80,jQ(O(g))],0]],0,0,o);var +p=[0,80,n],q=function(a){return aQ(fx,Ik,a)}(function(a){return aQ(jO,p,a)}(aQ(g$,[0,80,g],l))),r=[0,[0,80,cn(0,jK,function(a){var +b=bc(g6(a)[cV]);h(j,b);return af(i,b)})],m];return[0,Gd(0,[0,q],[0,r],0,[0,[0,83,cC(cO(function(a){var +b=a[1],c=a[2],d=dg([0,80,[1,oa(O(b))]]),e=ho([0,82,y(aD(i),function(a){return[1,ES(hk(a,b),E0)]})],d);return Gc(0,[0,e],0,0,[0,[0,80,bd(0,c)],0])},f))],0])]}function +Il(a,b,c){return a7(t(Im),c,a,b)}function +In(a,b,c,d,e,f,g){var +l=b?b[1]:0,m=c?c[1]:function(a){return},j=h(j2(Io),d);function k(a){return a?[0,e]:0}a:{if(a&&a[1]){var -n=hb(j,k(g)),i=n;break a}var +n=hm(j,k(g)),i=n;break a}var i=aC(k(g))}var -o=jD(0,[0,[0,[0,80,jv(O(j))],0]],0,0,f),p=[0,80,d],q=function(a){return aQ(fm,Hn,a)}(function(a){return aQ(jt,p,a)}(aQ(gZ,[0,80,j],0))),r=[0,[0,82,y(aD(i),function(a){return a?DT:gY})],q];return[0,Q(0,0,0,0,[0,[0,82,g8(0,[0,r],[0,[0,[0,80,ch(0,jp,function(a){var -b=k(gU(a)[pU]|0);h(m,b);return ag(i,b)})],l]],0,0)],[0,[0,82,o],0]]),i]}function -ou(a,b,c){var -e=b?b[1]:1,d=function(f,b){return cH(function(a){var -b=a[1],g=a[3],h=a[2],i=z2(b),d=Hl([0,e],0,0,Hj(f,i,c[1]),b,h,g);return[0,d[1],d[2]]},b)}(0,c[2]),f=cH(function(a){return a[1]},d);function +o=jY(0,[0,[0,[0,80,jQ(O(j))],0]],0,0,f),p=[0,80,d],q=function(a){return aQ(fx,Ip,a)}(function(a){return aQ(jO,p,a)}(aQ(g$,[0,80,j],0))),r=[0,[0,82,y(aD(i),function(a){return a?EX:g_})],q];return[0,Q(0,0,0,0,[0,[0,82,hi(0,[0,r],[0,[0,[0,80,cn(0,jK,function(a){var +b=k(g6(a)[qy]|0);h(m,b);return af(i,b)})],l]],0,0)],[0,[0,82,o],0]]),i]}function +o9(a,b,c){var +e=b?b[1]:1,d=function(f,b){return cO(function(a){var +b=a[1],g=a[3],h=a[2],i=Bd(b),d=In([0,e],0,0,Il(f,i,c[1]),b,h,g);return[0,d[1],d[2]]},b)}(0,c[2]),f=cO(function(a){return a[1]},d);function g(a){return a}var -h=function(a){return C3(g,a)}(cr(c_(function(a){return bb(aD(a[2]))},fj,d)));return[0,Q(0,a,0,0,[0,[0,83,cr(f)],0]),h]}function -Ho(a){var -d=iE(a);return[0,,function(a){return F4(a[1])},function(a){return[0,n7,d[1]]},,function(a,b,c){var -e=d[4].call(null,b,c,a[2]);return[0,n_(b,a[1]),e]},function(a){var -c=F2(a[1]);if(!c)return[0,a,0];var -e=c[1],b=e[2],f=e[1],g=[0,[0,b,d[28].call(null,b,a[2])]];return[0,[0,f,d[7].call(null,b,a[2])],g]},function(a,b){return d[29].call(null,b,a[2])}]}function -Hp(a){var -f=Ho(a);function +h=function(a){return D7(g,a)}(cC(dd(function(a){return bb(aD(a[2]))},fu,d)));return[0,Q(0,a,0,0,[0,[0,83,cC(f)],0]),h]}function +Iq(a){var +d=iP(a);return[0,,function(a){return G6(a[1])},function(a){return[0,oK,d[1]]},,function(a,b,c){var +e=d[2].call(null,b,c,a[2]);return[0,oN(b,a[1]),e]},function(a){var +c=G4(a[1]);if(!c)return[0,a,0];var +e=c[1],b=e[2],f=e[1],g=[0,[0,b,d[17].call(null,b,a[2])]];return[0,[0,f,d[6].call(null,b,a[2])],g]},function(a,b){return d[18].call(null,b,a[2])}]}function +Ir(a){var +f=Iq(a);function g(a,b){return c(a,b)}function e(a,b,c){var d=c;for(;;){var e=f[6].call(null,d[2]),g=e[2],i=e[1];if(!g)return a<50?n(a+1|0,b,d):l(n,[0,b,d]);var j=g[1],k=j[2],m=k[1],o=j[1];if(!k[2][1]){h(b,m);return[0,d[1],i,d[3]]}var p=f[5].call(null,d[1],o,[0,m,[0,0]]);d=[0,p,i,d[3]]}}function -c(a,b){return bI(e(0,a,b))}function +c(a,b){return bJ(e(0,a,b))}function n(a,b,c){var d=c;for(;;){var g=f[6].call(null,d[1]),i=g[2],j=g[1];if(!i)return a<50?e(a+1|0,b,d):l(e,[0,b,d]);var @@ -3876,106 +3990,106 @@ b=f[3].call(null,0);return[0,b,f[3].call(null,0),a]},function(a,b,c,d,e){var k=b?b[1]:function(a){return},l=c?c[1]:function(a){return 0},g=f[7].call(null,a[1],d);if(g){g[1][2][1]=1;return[0,a,0]}var i=f[7].call(null,a[2],d);if(i){i[1][2][1]=1;return[0,a,0]}var m=f[5].call(null,a[1],d,[0,e,[0,0]]);h(k,e);return[0,j(l,[0,m,a[2],a[3]]),1]}]}function -jO(a,b,c){return[0,a,b,c]}function -Hq(a){return c_(function(a){return bb(Q(0,0,0,0,a[3]))},fj,a)}function -Hr(a){return BG(c_(function(a){return a[2]},[0,Hv,function(a,b){return i(t(Hu),a,b)}],a),function(a){return i(t(Ht),Hs,a)})}jK(0)(Hz);function -Hw(a){return Hr(a[1][1])}function -Hx(a){var -b=og(a[2]),c=[0,[0,80,cg(q$)],0],d=[0,[0,80,cg("lwdui-lazy-table-header")],c],e=[0,[0,80,dF(O(h(t(Hy),b)))],d];return Q(0,[0,e],0,0,[0,[0,83,cr(Hq(a[1][1]))],0])}var -HB=GO(HA),ov=Hp([0,ha]);function -HC(d,b,c){return function(a){var -x=a[3],z=a[2],A=a[1],j=oi(0),p=oi(0),q=og(d[2]),C=h(t(HE),q),k=BJ(0),e=gt(0,2048);function -r(a){return ov[1].call(null,50)}var -l=[0,r(0)];function -D(a){n3(n0(e,a),function(b){return n5(m0(b),function(a){return i3(b,[0,a[1],0,a[3]])})});return 0}var -f=aC(0);function -E(a,b,c){var -d=e6(function(a,b){var -c=a[2],d=ov[2].call(null,a[1],0,[0,D],b,b),e=d[1];return d[2]?[0,e,[0,b,c]]:[0,e,c]},[0,l[1],0],c),j=d[2];l[1]=d[1];var -f=gj(j);function -i(b){cI(h(a,b),function(a){return wm(function(a,b){n3(n0(e,a),function(c){return n5(m0(c),function(a){if(!b)throw g(a9,1);var -d=b[1],f=a[2],e=1-function(a){return g$(f,a)}([0,d]);return e?i3(c,[0,a[1],[0,d],a[3]]):e})});return 0},b,a)});return 0}return f.length-1?i(f):0}function -F(a){var -f=jL(p),c=D5(f);function +j9(a,b,c){return[0,a,b,c]}function +Is(a){return dd(function(a){return bb(Q(0,0,0,0,a[3]))},fu,a)}function +It(a){return CL(dd(function(a){return a[2]},[0,Ix,function(a,b){return i(t(Iw),a,b)}],a),function(a){return i(t(Iv),Iu,a)})}j5(0)(IB);function +Iy(a){return It(a[1][1])}function +Iz(a){var +b=oV(a[2]),c=[0,[0,80,cm(rM)],0],d=[0,[0,80,cm("lwdui-lazy-table-header")],c],e=[0,[0,80,dO(O(h(t(IA),b)))],d];return Q(0,[0,e],0,0,[0,[0,83,cC(Is(a[1][1]))],0])}var +ID=HQ(IC),o_=Ir([0,hl]);function +IE(e,b,c,d){var +z=d[3],A=d[2],B=d[1],k=oX(0),q=oX(0),r=oV(e[2]),D=h(t(IG),r),l=CO(0),f=gA(0,2048);function +s(a){return o_[1].call(null,50)}var +m=[0,s(0)];function +E(a){oG(oD(f,a),function(b){return oI(nC(b),function(a){return jm(b,[0,a[1],0,a[3]])})});return 0}var +j=aC(0);function +F(a,b,c){var +d=fi(function(a,b){var +c=a[2],d=o_[2].call(null,a[1],0,[0,E],b,b),e=d[1];return d[2]?[0,e,[0,b,c]]:[0,e,c]},[0,m[1],0],c),j=d[2];m[1]=d[1];var +e=gr(j);function +i(b){cP(h(a,b),function(a){return xe(function(a,b){oG(oD(f,a),function(c){return oI(nC(c),function(a){if(!b)throw g(a_,1);var +d=b[1],f=a[2],e=1-function(a){return hk(f,a)}([0,d]);return e?jm(c,[0,a[1],[0,d],a[3]]):e})});return 0},b,a)});return 0}return e.length-1?i(e):0}function +G(a){var +f=j6(q),c=E9(f);function l(a){return a["offsetHeight"]}var -g=nT(c,a[1])?rt:sf;a[1]=c;var -h=l(f),m=jL(j),n=d[2],e=jK([0,m])(n);HB[4].call(null,[0,HG,[0,h,[0,HF,[0,e,0]]]]);var -b=nZ(Math.ceil(h/e)),i=c/e|0,o=i+b|0,q=sf===g?b:b/2|0,r=0,k=function(a){return gg(r,a)}(i-q|0),s=rt===g?b:b/2|0;return FJ((o+s|0)-k|0,function(a){return k+a|0})}var -H=[0,0.];function -G(a,b){l[1]=r(0);var -c=[0,0],d=[0,Cs(k)];for(;;){if(!FL(d[1])&&!jE(c[1],a-1|0))return;var +g=ow(c,a[1])?r6:sS;a[1]=c;var +h=l(f),m=j6(k),n=e[2],d=j5([0,m])(n);ID[4].call(null,[0,II,[0,h,[0,IH,[0,d,0]]]]);var +b=oC(Math.ceil(h/d)),i=c/d|0,o=i+b|0,p=sS===g?b:b/2|0,r=0,j=function(a){return iM(r,a)}(i-p|0),s=r6===g?b:b/2|0;return mm((o+s|0)-j|0,function(a){return j+a|0})}var +I=[0,0.];function +H(a,b){m[1]=s(0);var +c=[0,0],d=[0,Dw(l)];for(;;){if(!GN(d[1])&&!jZ(c[1],a-1|0))return;var g=d[1];if(g){var -f=g[1];if(jE(c[1],a-1|0)){z9(e,c[1],f);i3(f,[0,c[1],0,b])}else -BR(f);c[1]++;d[1]=m7(f)}else if(jE(c[1],a-1|0)){var -h=BN([0,[0,c[1],0,b]],k);iR(e,c[1],h);c[1]++;d[1]=m7(h)}}}var -s=bZ(A,y(z,function(a,b){var -c=F(H);return E(a,[0,4*gd(c)|0],c)}),function(a,b){G(a,x);return b}),b=gE(0,A4(s,aD(f)));gF(b,function(a){var -c=c9(b);return c[2]?h(c[1],0):0});c9(b);function -B(a){return i(t(HD),q,a)}function -m(a){var -b=[0,cg("row_spacer"),0];return g2(0,[0,[0,dF(O(B(a))),b]],0)}var -I=y(Cl(function(a,b){var -c=b[2],d=b[3],e=b[1],f=aQ(cf,HH,0),g=[0,80,dF(O(C))];if(!c)return[0,1,bK,0];var -h=c[1];return[0,0,bb(Q(0,[0,[0,g,f]],0,0,[0,[0,83,cr(y(d,function(a){return en(fn(function(a){return Q(0,0,0,0,[0,a,0])},i(a,e,h)))}))],0])),0]},[0,[0,0,bK,0],function(a,b){var -f=b[3],g=b[2],c=b[1],d=a[3],e=a[2],h=a[1],j=fg(e),i=fg(g);if(typeof +e=g[1];if(jZ(c[1],a-1|0)){Bk(f,c[1],e);jm(e,[0,c[1],0,b])}else +CW(e);c[1]++;d[1]=nJ(e)}else if(jZ(c[1],a-1|0)){var +h=CS([0,[0,c[1],0,b]],l);i6(f,c[1],h);c[1]++;d[1]=nJ(h)}}}var +u=b4(B,y(A,function(a,b){var +c=G(I);return F(a,[0,4*gl(c)|0],c)}),function(a,b){H(a,z);return b}),n=gQ(0,B9(u,aD(j)));gR(n,function(a){var +b=dc(n);return b[2]?h(b[1],0):0});dc(n);function +C(a){return i(t(IF),r,a)}function +o(a){var +b=[0,cm("row_spacer"),0];return hc(0,[0,[0,dO(O(C(a))),b]],0)}var +J=y(Dq(function(a,b){var +c=b[2],d=b[3],e=b[1],f=aQ(cl,IJ,0),g=[0,80,dO(O(D))];if(!c)return[0,1,bO,0];var +h=c[1];return[0,0,bb(Q(0,[0,[0,g,f]],0,0,[0,[0,83,cC(y(d,function(a){return ez(cj(function(a){return Q(0,0,0,0,[0,a,0])},i(a,e,h)))}))],0])),0]},[0,[0,0,bO,0],function(a,b){var +f=b[3],g=b[2],c=b[1],d=a[3],e=a[2],h=a[1],j=fr(e),i=fr(g);if(typeof j==="number")return typeof i==="number"?[0,((h+d|0)+c|0)+f|0,e,0]:[0,(h+d|0)+c|0,g,f];if(typeof i==="number")return[0,h,e,(d+c|0)+f|0];var -k=g_(d+c|0,0)?function(a){return b0(e,a)}(b0(bb(aB(m(d+c|0))),g)):b0(e,g);return[0,h,k,f]}],k),function(a){var -b=a[3],c=a[2],d=a[1],e=g_(d,0)?b0(bb(aB(m(d))),c):c;return g_(b,0)?b0(e,bb(aB(m(b)))):e}),J=Hx(d),K=Gb(function(a,b){var -c=F5(F7(vO(a))),d=at(f);return d?nS(d[1],c)?ag(f,[0,c]):0:ag(f,[0,c])}),L=db(HI),u=Q(0,[0,L],0,[0,function(a){return oj(j,a)}],[0,[0,83,cr(I)],0]),n=db(HJ),o=[0,[0,82,y(s,function(c){var -d=[0,0.],b=[0,-1];return ch(0,Dz,function(a){var -e=50,f=Er(Es);if(Fa(b[1],0))Ev(b[1]);b[1]=Eu(e,function(a){return h(c,0)});var -g=nT(f-d[1],e);return g?(d[1]=f,h(c,0)):g})})],0];function -v(a){return oj(p,a)}if(c)var -M=y(c[1],function(a){var -b=jL(j),c=d[2];return[0,[0,f7(a,nZ(jK([0,b])(c)))]]}),w=G2([0,n],[0,o],0,M,Q(0,[0,n],[0,o],[0,v],[0,[0,82,u],0]));else +k=hj(d+c|0,0)?function(a){return b5(e,a)}(b5(bb(aB(o(d+c|0))),g)):b5(e,g);return[0,h,k,f]}],l),function(a){var +b=a[3],c=a[2],d=a[1],e=hj(d,0)?b5(bb(aB(o(d))),c):c;return hj(b,0)?b5(e,bb(aB(o(b)))):e}),K=Iz(e),L=Hd(function(a,b){var +c=G7(G9(wz(a))),d=au(j);return d?ov(d[1],c)?af(j,[0,c]):0:af(j,[0,c])}),M=dg(IK),v=Q(0,[0,M],0,[0,function(a){return oY(k,a)}],[0,[0,83,cC(J)],0]),a=dg(IL),p=[0,[0,82,y(u,function(c){var +d=[0,0.],b=[0,-1];return cn(0,ED,function(a){var +e=50,f=Fv(Fw);if(Ge(b[1],0))Fz(b[1]);b[1]=Fy(e,function(a){return h(c,0)});var +g=ow(f-d[1],e);return g?(d[1]=f,h(c,0)):g})})],0];function +w(a){return oY(q,a)}if(c)var +N=y(c[1],function(a){var +b=j6(k),c=e[2];return[0,[0,gg(a,oC(j5([0,b])(c)))]]}),x=H4([0,a],[0,p],0,N,Q(0,[0,a],[0,p],[0,w],[0,[0,82,v],0]));else var -w=Q(0,[0,n],[0,o],[0,v],[0,[0,82,u],0]);function -N(a){return Ga(K,0,a)}function -P(a){return Gt(N,a)}var -R=function(a){return y(a,P)}(w),S=on(0,oo(HK));return Q(0,[0,[0,[0,82,y(Hw(d),function(a){return dF(O(a))})],S]],0,0,[0,[0,82,J],[0,[0,82,R],0]])}}function -HL(a,b){var -c=b<<4|l6(a,6)&15,d=ad|l6(a,8)&63;l5(a,6,c);l5(a,8,d);return a$(a)}function -HM(a){var -c=mn(a),b=am(16),d=mn(a);l4(b,0,c);l4(b,8,d);return HL(b,4)}function -jP(a,b){var +x=Q(0,[0,a],[0,p],[0,w],[0,[0,82,v],0]);function +P(a){return Hc(L,0,a)}function +R(a){return Hv(P,a)}var +S=function(a){return y(a,R)}(x),T=o2(0,o3(IM));return Q(0,[0,[0,[0,82,y(Iy(e),function(a){return dO(O(a))})],T]],0,0,[0,[0,82,K],[0,[0,82,S],0]])}function +IN(a,b){var +c=b<<4|mv(a,6)&15,d=ac|mv(a,8)&63;mu(a,6,c);mu(a,8,d);return a2(a)}function +IO(a){var +c=eo(a),b=aj(16),d=eo(a);mt(b,0,c);mt(b,8,d);return IN(b,4)}function +j_(a,b){var i=a?a[1]:0,g=i?55:87;function h(a,b){return 10<=b?a+b|0:48+b|0}var -e=l1(HO),c=[0,0],d=[0,0];function +e=mq(IQ),c=[0,0],d=[0,0];function f(d,b,c){function -e(a,b,c){cZ(a,b,c);return}(function(a){return e(d,b,a)}(h(g,c>>>4|0)));var +e(a,b,c){cg(a,b,c);return}(function(a){return e(d,b,a)}(h(g,c>>>4|0)));var f=b+1|0;function -i(a,b,c){cZ(a,b,c);return}return function(a){return i(d,f,a)}(h(g,c&15))}for(;;){if(4<=d[1])break;var -n=V(b,d[1]);f(e,c[1],n);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(6<=d[1])break;var -m=V(b,d[1]);f(e,c[1],m);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(8<=d[1])break;var -l=V(b,d[1]);f(e,c[1],l);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(10<=d[1])break;var -k=V(b,d[1]);f(e,c[1],k);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(16<=d[1])return a$(e);var -j=V(b,d[1]);f(e,c[1],j);c[1]=c[1]+2|0;d[1]++}}function -HN(a,b){return HM(a)}function -ow(a,b){var -c=Ta(b[1]),e=b[3],f=b[2];return a6(d(a)(HP),f,e,c)}function -ox(a,b){return h(d(a)(HQ),p(b))}function -oy(a){var -b=cd(20);return i0(function(a){c6(a,0);return H(ce(b))},eh(b),a)}function -oz(a){return[0,A1(AZ,A0,a),0,a]}oz(0);function -HR(a,b){return fE(oy(HS),ox,a,ow,b)}function -HT(a,b){return fE(oy(HU),ox,a,ow,b)}function -HV(a,b,c,d,e){if(0<=e&&0<=b&&0<=d&&(p(a)-b|0)>=e)return(c[3]-d|0)=0){var -c=i;for(;;){var -f=c%16|0,j=Tb(b[1],b[2]+c|0);eB(d(a)(H2),g,f,j,h,f);var -k=c+1|0;if(e===c)break;c=k}}return iV(a,0)});function -HY(a,b,c,d){return HX(HV,function(a){return p(a)},a,b,c,d)}HY(0,0,0,H4);function -H5(a,b){return dz(b,a)}function -H6(a,c){function +i(a,b,c){cg(a,b,c);return}return function(a){return i(d,f,a)}(h(g,c&15))}for(;;){if(4<=d[1])break;var +n=ak(b,d[1]);f(e,c[1],n);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(6<=d[1])break;var +m=ak(b,d[1]);f(e,c[1],m);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(8<=d[1])break;var +l=ak(b,d[1]);f(e,c[1],l);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(10<=d[1])break;var +k=ak(b,d[1]);f(e,c[1],k);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(16<=d[1])return a2(e);var +j=ak(b,d[1]);f(e,c[1],j);c[1]=c[1]+2|0;d[1]++}}function +IP(a,b){return IO(a)}function +o$(a,b){var +c=Uc(b[1]),d=b[3],e=b[2];return a7(j(a)(IR),e,d,c)}function +pa(a,b){return h(j(a)(IS),p(b))}function +pb(a){var +b=bL(20);return jj(function(a){cB(a,0);return H(b3(b))},dL(b),a)}function +pc(a){return[0,mU(AN,AO,a),0,a]}pc(0);function +IT(a,b){return fO(pb(IU),pa,a,o$,b)}function +IV(a,b){return fO(pb(IW),pa,a,o$,b)}function +IX(a,b,c,d,e){if(0<=e&&0<=b&&0<=d&&(p(a)-b|0)>=e)return(c[3]-d|0)=0){var +c=h;for(;;){var +e=c%16|0,i=vc(b[1],b[2]+c|0);eN(j(a)(I4),f,e,i,g,e);var +k=c+1|0;if(d===c)break;c=k}}return i_(a,0)});function +I0(a,b,c,d){return IZ(IX,function(a){return p(a)},a,b,c,d)}I0(0,0,0,I6);function +I7(a,b){return cj(b,a)}function +I8(a,c){function o(a,b){var e=a,d=b;for(;;){if(!d)return e;var c=d[1];e=[0,c[1],[0,c[2],[0,c[3],[0,c[4],[0,c[5],[0,c[6],[0,c[7],[0,c[8],[0,c[9],e]]]]]]]]];d=d[2]}}return function(a,b){var @@ -3988,1184 +4102,1186 @@ k=j[2];if(k){var l=k[2];if(l){var m=l[2];if(m){var n=m[2];if(n){var -p=n[2],q=n[1],r=m[1],s=l[1],t=k[1],u=j[1],v=i[1],w=g[1],x=f[1],y=h(c,d[1]),z=h(c,x),A=h(c,w),B=h(c,v),C=h(c,u),D=h(c,t),E=h(c,s),F=h(c,r);e=[0,[0,y,z,A,B,C,D,E,F,h(c,q)],e];d=p;continue}}}}}}}}}return o(H5(d,c),e)}}(0,a)}function -oA(a,b,c){if(!b)return 0;var +p=n[2],q=n[1],r=m[1],s=l[1],t=k[1],u=j[1],v=i[1],w=g[1],x=f[1],y=h(c,d[1]),z=h(c,x),A=h(c,w),B=h(c,v),C=h(c,u),D=h(c,t),E=h(c,s),F=h(c,r);e=[0,[0,y,z,A,B,C,D,E,F,h(c,q)],e];d=p;continue}}}}}}}}}return o(I7(d,c),e)}}(0,a)}function +pd(a,b,c){if(!b)return 0;var f=b[2],d=b[1];if(!f)return[0,h(a,d),0];var g=f[2],e=f[1];if(!g){var z=h(a,d);return[0,z,[0,h(a,e),0]]}var i=g[2],j=g[1];if(!i){var x=h(a,d),y=h(a,e);return[0,x,[0,y,[0,h(a,j),0]]]}var k=i[2],l=i[1];if(k){var -m=k[2],n=k[1],o=h(a,d),p=h(a,e),q=h(a,j),r=h(a,l),s=h(a,n),t=50=0){var -e=g;for(;;){var -c=V(b,e);a:if(34===c)d(a)(H$);else if(32<=c)if(92===c)d(a)(Ia);else -h(d(a)(Ib),c);else{if(14>c)switch(c){case -8:d(a)(Id);break a;case -9:d(a)(Ie);break a;case -10:d(a)(If);break a;case -13:d(a)(Ig);break a}h(d(a)(Ic),c)}var -i=e+1|0;if(f===e)break;e=i}}return d(a)(H_)}var -H7=[0,function(a){if(typeof -a==="number")return cP;var -b=a[1];if(fV>b)return cX<=b?bg<=b?[0,bg,a[2]]:[0,bg,a[2]]:dU<=b?[0,n,a[2]]:[0,n,a[2]];if(fO===b)return[0,65,a[2]];if(r<=b)return J<=b?[0,79,a[2]]:[0,65,a[2]];if(bu<=b)return[0,bu,a[2]];var +pe(a,b){return pd(a,b,0)}function +I_(a,b){j(a)(I$);var +e=p(b)-1|0,f=0;if(e>=0){var +d=f;for(;;){var +c=ak(b,d);a:if(34===c)j(a)(Jb);else if(32<=c)if(92===c)j(a)(Jc);else +h(j(a)(Jd),c);else{if(14>c)switch(c){case +8:j(a)(Jf);break a;case +9:j(a)(Jg);break a;case +10:j(a)(Jh);break a;case +13:j(a)(Ji);break a}h(j(a)(Je),c)}var +g=d+1|0;if(e===d)break;d=g}}return j(a)(Ja)}var +I9=[0,function(a){if(typeof +a==="number")return cW;var +b=a[1];if(f4>b)return c5<=b?bg<=b?[0,bg,a[2]]:[0,bg,a[2]]:d3<=b?[0,n,a[2]]:[0,n,a[2]];if(fX===b)return[0,65,a[2]];if(r<=b)return J<=b?[0,79,a[2]]:[0,65,a[2]];if(bx<=b)return[0,bx,a[2]];var c=a[2],d=c[2],e=c[1];return d?[0,65,[0,[0,n,e],[0,d[1],0]]]:[0,n,e]},function(a){if(typeof -a==="number")return cP;var -b=a[1];return 65===b?[0,r,a[2]]:bg<=b?bu<=b?[0,bu,a[2]]:[0,bg,a[2]]:79<=b?[0,J,a[2]]:[0,n,a[2]]},function(a){return[0,0]}(0)];function -Ih(a,b,c){var -e=a?a[1]:0,j=b?b[1]:H8;return function(a,b){function +a==="number")return cW;var +b=a[1];return 65===b?[0,r,a[2]]:bg<=b?bx<=b?[0,bx,a[2]]:[0,bg,a[2]]:79<=b?[0,J,a[2]]:[0,n,a[2]]},function(a){return[0,0]}(0)];function +Jj(a,b,c,d,e){var +l=a?a[1]:0,g=b?b[1]:I_;function f(a,b){var -e=h(c[1],b);if(typeof -e==="number")return d(a)(Ii);var -g=e[1];if(65===g){var -n=[0,function(a,b){return d(a)(Ij)}],m=e[2];return i(d(a)(Ik),function(a,b){return gy(n,f,a,b)},m)}if(bg<=g){if(bu<=g)return e[2]?d(a)(Il):d(a)(Im);var -k=e[2],l=uV(k),o=l[2];return l[1]==0.?h(d(a)(In),o):h(d(a)(Io),k)}if(79>g)return i(j,a,e[2]);function +d=h(c[1],b);if(typeof +d==="number")return j(a)(Jk);var +e=d[1];if(65===e){var +n=[0,function(a,b){return j(a)(Jl)}],m=d[2];return i(j(a)(Jm),function(a,b){return gK(n,f,a,b)},m)}if(bg<=e){if(bx<=e)return d[2]?j(a)(Jn):j(a)(Jo);var +k=d[2],l=vD(k),o=l[2];return l[1]==0.?h(j(a)(Jp),o):h(j(a)(Jq),k)}if(79>e)return i(g,a,d[2]);function q(a,b){var -c=b[2],e=b[1];return fE(d(a)(Iq),j,e,f,c)}var -r=[0,function(a,b){return d(a)(Ip)}],p=e[2];return i(d(a)(Ir),function(a,b){return gy(r,q,a,b)},p)}function -g(a,b){var -e=h(c[1],b);if(typeof -e!=="number"){var -k=e[1];if(65===k){var -l=e[2];if(!l)return d(a)(Iu);var -n=[0,function(a,b){return d(a)(Is)}];return i(d(a)(It),function(a,b){return gy(n,g,a,b)},l)}if(79===k){var -m=e[2];if(!m)return d(a)(Iy);var +c=b[2],d=b[1];return fO(j(a)(Js),g,d,f,c)}var +r=[0,function(a,b){return j(a)(Jr)}],p=d[2];return i(j(a)(Jt),function(a,b){return gK(r,q,a,b)},p)}function +k(a,b){var +d=h(c[1],b);if(typeof +d!=="number"){var +e=d[1];if(65===e){var +l=d[2];if(!l)return j(a)(Jw);var +n=[0,function(a,b){return j(a)(Ju)}];return i(j(a)(Jv),function(a,b){return gK(n,k,a,b)},l)}if(79===e){var +m=d[2];if(!m)return j(a)(JA);var o=function(a,b){var -c=b[2],e=b[1];return fE(d(a)(Iw),j,e,g,c)},p=[0,function(a,b){return d(a)(Iv)}];return i(d(a)(Ix),function(a,b){return gy(p,o,a,b)},m)}}return f(a,b)}return e?f(a,b):g(a,b)}}function -Iz(a){function +c=b[2],d=b[1];return fO(j(a)(Jy),g,d,k,c)},p=[0,function(a,b){return j(a)(Jx)}];return i(j(a)(Jz),function(a,b){return gK(p,o,a,b)},m)}}return f(a,b)}return l?f(d,e):k(d,e)}function +JB(a){function d(a){if(typeof -a==="number")return cP;var -b=a[1];if(65===b)return[0,r,oB(d,a[2])];if(bg>b)return 79<=b?[0,J,oB(function(a){var -b=a[1];return[0,b,d(a[2])]},a[2])]:[0,n,a[2]];if(bu<=b)return[0,bu,a[2]];var -e=a[2],f=uV(e),c=f[2];if(f[1]!=0.)return[0,bg,e];if(-1073741824.<=c&&c<=fL)return[0,cX,c|0];return[0,dU,h(t(IA),c)]}return d(a)}function -aw(a,b){return d4(a,b)}function -er(a,b,c){aq(a,b,c);return}var -oC=bY(p7);function -aI(a,b,c){return[0,fM,d9(a,b,c)]}function -hf(a,b,c,d,e){var -f=am(2),i=gi(c,d,e);if(a)var +a==="number")return cW;var +b=a[1];if(65===b)return[0,r,pe(d,a[2])];if(bg>b)return 79<=b?[0,J,pe(function(a){var +b=a[1];return[0,b,d(a[2])]},a[2])]:[0,n,a[2]];if(bx<=b)return[0,bx,a[2]];var +e=a[2],f=vD(e),c=f[2];if(f[1]!=0.)return[0,bg,e];if(-1073741824.<=c&&c<=ib)return[0,c5,c|0];return[0,d3,h(t(JC),c)]}return d(a)}function +ax(a,b){return dB(a,b)}function +eD(a,b,c){aq(a,b,c);return}var +pf=b2(qL);function +aI(a,b,c){return[0,fV,ef(a,b,c)]}function +hq(a,b,c,d,e){var +f=aj(2),i=gp(c,d,e);if(a)var h=1,g=0;else var -h=0,g=1;er(f,g,b>>>8|0);er(f,h,b&dm);return[0,fM,a$(v2(f,i))]}var -IG=bY(65533),fo=IJ.slice();function -IB(a,b){return H(i(t(IC),a,b))}function -ID(a){return a}function -IE(a,b,c,d,e){b$(a,b,c,d,e);return}function -IF(a,b){return a[1+b]}function -IH(a,b){var -c=aw(a,b);return dW>>0)throw g([0,f,IK],1);switch(m){case -0:return d(aw(a,b));case +h=0,g=1;eD(f,g,b>>>8|0);eD(f,h,b&ds);return[0,fV,a2(wS(f,i))]}var +JI=b2(65533),fy=JL.slice();function +JD(a,b){return H(i(t(JE),a,b))}function +JF(a){return a}function +JG(a,b,c,d,e){cf(a,b,c,d,e);return}function +JH(a,b){return a[1+b]}function +JJ(a,b){var +c=ax(a,b);return d5>>0)throw g([0,f,JM],1);switch(m){case +0:return d(ax(a,b));case 1:var -r=aw(a,b),n=aw(a,b+1|0);return 2===(n>>>6|0)?d((r&31)<<6|n&63):aI(a,b,c);case +r=ax(a,b),n=ax(a,b+1|0);return 2===(n>>>6|0)?d((r&31)<<6|n&63):aI(a,b,c);case 2:var -i=aw(a,b),e=aw(a,b+1|0),o=aw(a,b+2|0),j=(i&15)<<12|(e&63)<<6|o&63;if(2!==(o>>>6|0))return aI(a,b,c);if(fX===i){if(p5<=e&&h2>=e)return d(j);return aI(a,b,c)}if(h3!==i)return 2===(e>>>6|0)?d(j):aI(a,b,c);if(ad<=e&&159>=e)return d(j);return aI(a,b,c);default:var -k=aw(a,b),h=aw(a,b+1|0),p=aw(a,b+2|0),q=aw(a,b+3|0),l=(k&7)<<18|(h&63)<<12|(p&63)<<6|q&63;if(2===(q>>>6|0)&&2===(p>>>6|0)){if(eE===k){if(144<=h&&h2>=h)return d(l);return aI(a,b,c)}if(tN!==k)return 2===(h>>>6|0)?d(l):aI(a,b,c);if(ad<=h&&143>=h)return d(l);return aI(a,b,c)}return aI(a,b,c)}}function -fp(a,b,c){var -e=aw(a,b),d=e<<8|aw(a,c);if(kq<=d&&fH>=d)return lg=e)return[0,aF,bY(((a&fN)<<10|e&fN)+eI|0)];return hf(c=(c+d|0)){if(0===d)return oD(a);a[5]=b;a[6]=c;a[7]=(c+d|0)-1|0;return}return IB(c,d)}function -es(a,b){var +i=ax(a,b),e=ax(a,b+1|0),o=ax(a,b+2|0),j=(i&15)<<12|(e&63)<<6|o&63;if(2!==(o>>>6|0))return aI(a,b,c);if(f6===i){if(qJ<=e&&h$>=e)return d(j);return aI(a,b,c)}if(ia!==i)return 2===(e>>>6|0)?d(j):aI(a,b,c);if(ac<=e&&159>=e)return d(j);return aI(a,b,c);default:var +k=ax(a,b),h=ax(a,b+1|0),p=ax(a,b+2|0),q=ax(a,b+3|0),l=(k&7)<<18|(h&63)<<12|(p&63)<<6|q&63;if(2===(q>>>6|0)&&2===(p>>>6|0)){if(eQ===k){if(144<=h&&h$>=h)return d(l);return aI(a,b,c)}if(dx!==k)return 2===(h>>>6|0)?d(l):aI(a,b,c);if(ac<=h&&143>=h)return d(l);return aI(a,b,c)}return aI(a,b,c)}}function +fz(a,b,c){var +e=ax(a,b),d=e<<8|ax(a,c);if(kL<=d&&fR>=d)return lB=e)return[0,aF,b2(((a&fW)<<10|e&fW)+eU|0)];return hq(c=(c+d|0)){if(0===d)return pg(a);a[5]=b;a[6]=c;a[7]=(c+d|0)-1|0;return}return JD(c,d)}function +eE(a,b){var c=b[1];if(typeof -c==="number"){b[18]=a;return hZ}if(pX<=c[1]){var -d=vp(c[2],b[5],0,a8(b[5]));IW(b,b[5],0,d);return h(a,b)}oD(b);return h(a,b)}function -et(a,b){a[9]=0;a[10]=b;return}function -ci(c,b){function -d(a,b){IE(a[5],a[6],a[8],a[9],b);a[6]=a[6]+b|0;a[9]=a[9]+b|0;return}var -a=dc(b);if(0>a)return h(c,b);var -e=b[10]-b[9]|0;return aa)return h(c,b);var +e=b[10]-b[9]|0;return a=b)return 0<=b?es(jQ,a):cx;var -c=a[6];a[6]=a[6]+1|0;return R(jQ,IH(a[5],c),1,a)}function -jR(a){var -b=dc(a);if(0>=b)return 0<=b?es(jR,a):cx;var -c=a[6];a[6]=a[6]+1|0;return R(jR,II(a[5],c),1,a)}function -hh(a){if(a[9]=b)return 0<=b?eE(j$,a):cH;var +c=a[6];a[6]=a[6]+1|0;return R(j$,JJ(a[5],c),1,a)}function +ka(a){var +b=dh(a);if(0>=b)return 0<=b?eE(ka,a):cH;var +c=a[6];a[6]=a[6]+1|0;return R(ka,JK(a[5],c),1,a)}function +hs(a){if(a[9]=c)return 0<=c?es(bn,a):cx;var -b=IF(fo,aw(a[5],a[6]));if(c=a[10])return oG(fp(a[8],0,1),a);var -b=a[9];return R(cj,aI(a[8],0,a[9]),b,a)}function -oG(a,b){if(fM<=a[1])return R(cj,a,2,b);var -c=a[2];if(2<=dc(b)){var -d=b[6];b[6]=b[6]+2|0;return R(cj,hg(c,b[5],d,d+1|0),4,b)}et(b,2);return ci(function(a){return oE(c,a)},b)}function -cj(a){var -b=dc(a);if(0>=b)return 0<=b?es(cj,a):cx;if(2<=b){var -c=a[6];a[6]=a[6]+2|0;return oG(fp(a[5],c,c+1|0),a)}et(a,2);return ci(oF,a)}function -oH(a,b){var -c=b[9]+2|0;return b[9]=a[10])return oJ(fp(a[8],1,0),a);var -b=a[9];return R(cs,aI(a[8],0,a[9]),b,a)}function -oJ(a,b){if(fM<=a[1])return R(cs,a,2,b);var -c=a[2];if(2<=dc(b)){var -d=b[6];b[6]=b[6]+2|0;return R(cs,hg(c,b[5],d+1|0,d),4,b)}et(b,2);return ci(function(a){return oH(c,a)},b)}function -cs(a){var -b=dc(a);if(0>=b)return 0<=b?es(cs,a):cx;if(2<=b){var -c=a[6];a[6]=a[6]+2|0;return oJ(fp(a[5],c+1|0,c),a)}et(a,2);return ci(oI,a)}function -IX(a){function +c=dh(a);if(0>=c)return 0<=c?eE(bn,a):cH;var +b=JH(fy,ax(a[5],a[6]));if(c=a[10])return pj(fz(a[8],0,1),a);var +b=a[9];return R(cp,aI(a[8],0,a[9]),b,a)}function +pj(a,b){if(fV<=a[1])return R(cp,a,2,b);var +c=a[2];if(2<=dh(b)){var +d=b[6];b[6]=b[6]+2|0;return R(cp,hr(c,b[5],d,d+1|0),4,b)}eF(b,2);return co(function(a){return ph(c,a)},b)}function +cp(a){var +b=dh(a);if(0>=b)return 0<=b?eE(cp,a):cH;if(2<=b){var +c=a[6];a[6]=a[6]+2|0;return pj(fz(a[5],c,c+1|0),a)}eF(a,2);return co(pi,a)}function +pk(a,b){var +c=b[9]+2|0;return b[9]=a[10])return pm(fz(a[8],1,0),a);var +b=a[9];return R(cD,aI(a[8],0,a[9]),b,a)}function +pm(a,b){if(fV<=a[1])return R(cD,a,2,b);var +c=a[2];if(2<=dh(b)){var +d=b[6];b[6]=b[6]+2|0;return R(cD,hr(c,b[5],d+1|0,d),4,b)}eF(b,2);return co(function(a){return pk(c,a)},b)}function +cD(a){var +b=dh(a);if(0>=b)return 0<=b?eE(cD,a):cH;if(2<=b){var +c=a[6];a[6]=a[6]+2|0;return pm(fz(a[5],c+1|0,c),a)}eF(a,2);return co(pl,a)}function +JZ(a){function d(a){var -b=aw(a[8],2),c=j(fo,b)[1+b];return 0===c?R(bn,aI(a[8],2,1),1,a):(a[10]=c,a[9]=1,er(a[8],0,b),ci(hh,a))}var -b=aw(a[8],0);function +b=ax(a[8],2),c=k(fy,b)[1+b];return 0===c?R(bn,aI(a[8],2,1),1,a):(a[10]=c,a[9]=1,eD(a[8],0,b),co(hs,a))}var +b=ax(a[8],0);function h(a){var -b=aw(a[8],1),e=2>>0)throw g([0,f,IY],1);switch(e){case +b=ax(a[8],1),e=2>>0)throw g([0,f,J0],1);switch(e){case 0:return R(c,aI(a[8],0,1),1,a);case -1:return R(c,dM(a[8],0,1),1,a);case -2:return 2<=a[9]?3<=a[9]?R(d,dM(a[8],0,2),2,a):R(bn,dM(a[8],0,2),2,a):R(bn,aI(a[8],0,1),1,a);case -3:if(3<=a[9])return R(bn,dM(a[8],0,3),3,a);var -i=a[9];return R(bn,aI(a[8],0,a[9]),i,a);default:if(3<=a[9]){a[10]=4;return ci(hh,a)}var -k=a[9];return R(bn,aI(a[8],0,a[9]),k,a)}}function -oK(a,b,c){if(b)var -j=1,i=0,h=oE,d=oF,f=cj;else +1:return R(c,dV(a[8],0,1),1,a);case +2:return 2<=a[9]?3<=a[9]?R(d,dV(a[8],0,2),2,a):R(bn,dV(a[8],0,2),2,a):R(bn,aI(a[8],0,1),1,a);case +3:if(3<=a[9])return R(bn,dV(a[8],0,3),3,a);var +i=a[9];return R(bn,aI(a[8],0,a[9]),i,a);default:if(3<=a[9]){a[10]=4;return co(hs,a)}var +j=a[9];return R(bn,aI(a[8],0,a[9]),j,a)}}function +pn(a,b,c){if(b)var +j=1,i=0,h=ph,d=pi,f=cp;else var -j=0,i=1,h=oH,d=oI,f=cs;function +j=0,i=1,h=pk,d=pl,f=cD;function e(a,b){if(3>b[9])return f(b);b[10]=2;b[9]=1;var -c=aw(b[8],2);er(b[8],0,c);return ci(a,b)}if(typeof -c!=="number")return R(function(a){return e(d,a)},[0,aF,bY(c[2])],2,a);if(fJ>c)return R(function(a){return e(d,a)},[0,aF,oC],2,a);var -g=fp(a[8],i,j);if(fM<=g[1])return R(function(a){return e(d,a)},g,2,a);var +c=ax(b[8],2);eD(b[8],0,c);return co(a,b)}if(typeof +c!=="number")return R(function(a){return e(d,a)},[0,aF,b2(c[2])],2,a);if(fT>c)return R(function(a){return e(d,a)},[0,aF,pf],2,a);var +g=fz(a[8],i,j);if(fV<=g[1])return R(function(a){return e(d,a)},g,2,a);var k=g[2];if(3<=a[9]){var l=function(a){return h(k,a)};return function(a){return e(l,a)}(a)}var -m=a[9];return R(f,hf(b,k,gh,0,0),m,a)}function -IZ(a){et(a,3);return ci(function(a){var -b=IL(a[8],0,a[9]),c=b[1];if(eS===c){var -e=b[2];a[2]=eS;a[18]=cs;return oK(a,0,e)}if(dn<=c){var -d=b[2];a[2]=dn;a[18]=bn;return cx===d?cx:fJ<=d?IX(a):R(bn,[0,aF,oC],3,a)}var -f=b[2];a[2]=fR;a[18]=cj;return oK(a,1,f)},a)}function -bM(a){a[14]=0;a[13]=a[13]+1|0;return}function -dd(a){a[14]=a[14]+1|0;return}function +m=a[9];return R(f,hq(b,k,go,0,0),m,a)}function +J1(a){eF(a,3);return co(function(a){var +b=JN(a[8],0,a[9]),c=b[1];if(e4===c){var +e=b[2];a[2]=e4;a[18]=cD;return pn(a,0,e)}if(dt<=c){var +d=b[2];a[2]=dt;a[18]=bn;return cH===d?cH:fT<=d?JZ(a):R(bn,[0,aF,pf],3,a)}var +f=b[2];a[2]=f0;a[18]=cp;return pn(a,1,f)},a)}function +bQ(a){a[14]=0;a[13]=a[13]+1|0;return}function +di(a){a[14]=a[14]+1|0;return}function aJ(a){a[16]=a[16]+1|0;return}function aK(a,b){a[12]=b;return}function -I0(a,b,c,d){if(aF>d[1]){c[11]=0;c[17]=b;return i(c[17],c,d)}var -e=cc(d[2]);if(p7===e){if(a){c[2]=fR;c[18]=cj}c[11]=1;c[17]=b;return h(c[18],c)}if(65534===e&&a){c[2]=eS;c[18]=cs;c[11]=1;c[17]=b;return h(c[18],c)}c[11]=0;c[17]=b;return i(c[17],c,d)}function -I1(a,b){if(aF>b[1]){aK(a,0);aJ(a);dd(a);return b}var -c=cc(b[2])+kE|0;a:{if(k6>>0){var -d=c+eK|0;if(3>>0)break a;switch(d){case +J2(a,b,c,d){if(aF>d[1]){c[11]=0;c[17]=b;return i(c[17],c,d)}var +e=ci(d[2]);if(qL===e){if(a){c[2]=f0;c[18]=cp}c[11]=1;c[17]=b;return h(c[18],c)}if(65534===e&&a){c[2]=e4;c[18]=cD;c[11]=1;c[17]=b;return h(c[18],c)}c[11]=0;c[17]=b;return i(c[17],c,d)}function +J3(a,b){if(aF>b[1]){aK(a,0);aJ(a);di(a);return b}var +c=ci(b[2])+k0|0;a:{if(lp>>0){var +d=c+eW|0;if(3>>0)break a;switch(d){case 0:var -e=a[12];aK(a,0);aJ(a);return e?b:(bM(a),b);case +e=a[12];aK(a,0);aJ(a);return e?b:(bQ(a),b);case 1:break a;case -2:break;default:aK(a,1);aJ(a);bM(a);return b}}else if(li>=c-1>>>0)break a;aK(a,0);aJ(a);bM(a);return b}aK(a,0);aJ(a);dd(a);return b}function -I2(a,b){if(aF>b[1]){aK(a,0);aJ(a);dd(a);return b}var -c=cc(b[2])+kE|0;a:{if(k6>>0){var -d=c+eK|0;if(3>>0)break a;switch(d){case +2:break;default:aK(a,1);aJ(a);bQ(a);return b}}else if(lD>=c-1>>>0)break a;aK(a,0);aJ(a);bQ(a);return b}aK(a,0);aJ(a);di(a);return b}function +J4(a,b){if(aF>b[1]){aK(a,0);aJ(a);di(a);return b}var +c=ci(b[2])+k0|0;a:{if(lp>>0){var +d=c+eW|0;if(3>>0)break a;switch(d){case 0:var -e=a[12];aK(a,0);return e?h(a[18],a):(aJ(a),bM(a),[0,aF,a[4]]);case +e=a[12];aK(a,0);return e?h(a[18],a):(aJ(a),bQ(a),[0,aF,a[4]]);case 1:break a;case -2:break;default:aK(a,1);aJ(a);bM(a);return[0,aF,a[4]]}}else if(li>=c-1>>>0)break a;aK(a,0);aJ(a);bM(a);return[0,aF,a[4]]}aK(a,0);aJ(a);dd(a);return b}function -I3(a,b){if(aF>b[1]){aK(a,0);aJ(a);dd(a);return b}var -c=cc(b[2]);a:{if(14<=c){if(rY<=c){if(8234>c)break a}else if(lb===c){aK(a,0);aJ(a);bM(a);return[0,aF,a[4]]}}else if(10<=c)switch(c+qu|0){case +2:break;default:aK(a,1);aJ(a);bQ(a);return[0,aF,a[4]]}}else if(lD>=c-1>>>0)break a;aK(a,0);aJ(a);bQ(a);return[0,aF,a[4]]}aK(a,0);aJ(a);di(a);return b}function +J5(a,b){if(aF>b[1]){aK(a,0);aJ(a);di(a);return b}var +c=ci(b[2]);a:{if(14<=c){if(sy<=c){if(8234>c)break a}else if(lw===c){aK(a,0);aJ(a);bQ(a);return[0,aF,a[4]]}}else if(10<=c)switch(c+q9|0){case 0:var -d=a[12];aK(a,0);return d?h(a[18],a):(aJ(a),bM(a),[0,aF,a[4]]);case +d=a[12];aK(a,0);return d?h(a[18],a):(aJ(a),bQ(a),[0,aF,a[4]]);case 1:break;case -2:break a;default:aK(a,1);aJ(a);bM(a);return[0,aF,a[4]]}aK(a,0);aJ(a);dd(a);return b}aK(a,0);aJ(a);bM(a);return b}function -I4(a,b){if(aF>b[1]){aK(a,0);aJ(a);dd(a);return b}var -c=cc(b[2])+kE|0;a:{if(k6>>0){var -d=c+eK|0;if(3>>0)break a;switch(d){case +2:break a;default:aK(a,1);aJ(a);bQ(a);return[0,aF,a[4]]}aK(a,0);aJ(a);di(a);return b}aK(a,0);aJ(a);bQ(a);return b}function +J6(a,b){if(aF>b[1]){aK(a,0);aJ(a);di(a);return b}var +c=ci(b[2])+k0|0;a:{if(lp>>0){var +d=c+eW|0;if(3>>0)break a;switch(d){case 0:var -e=a[12];aK(a,0);return e?h(a[18],a):(aJ(a),bM(a),[0,aF,a[4]]);case +e=a[12];aK(a,0);return e?h(a[18],a):(aJ(a),bQ(a),[0,aF,a[4]]);case 1:break a;case -2:break;default:aK(a,1);aJ(a);bM(a);return[0,aF,a[4]]}}else if(li>=c-1>>>0)break a;aK(a,0);aJ(a);bM(a);return b}aK(a,0);aJ(a);dd(a);return b}function -I5(a){return ti<=a?423112016<=a?dn<=a?bn:jQ:338302576<=a?jR:cj:eS<=a?cs:cj}function -jS(a){return a[13]}function -jT(a){return a[14]}function -jU(d,b){var -a=cc(b);function -c(a){return m(d,ID(a))}return dW>>18|0),c(ad|(a>>>12|0)&63),c(ad|(a>>>6|0)&63),c(ad|a&63)):(c(fX|a>>>12|0),c(ad|(a>>>6|0)&63),c(ad|a&63)):(c(lm|a>>>6|0),c(ad|a&63)):c(a)}function -I6(a,b,c){if(a){var +2:break;default:aK(a,1);aJ(a);bQ(a);return[0,aF,a[4]]}}else if(lD>=c-1>>>0)break a;aK(a,0);aJ(a);bQ(a);return b}aK(a,0);aJ(a);di(a);return b}function +J7(a){return tX<=a?423112016<=a?dt<=a?bn:j$:338302576<=a?ka:cp:e4<=a?cD:cp}function +kb(a){return a[13]}function +kc(a){return a[14]}function +kd(d,b){var +a=ci(b);function +c(a){return m(d,JF(a))}return d5>>18|0),c(ac|(a>>>12|0)&63),c(ac|(a>>>6|0)&63),c(ac|a&63)):(c(f6|a>>>12|0),c(ac|(a>>>6|0)&63),c(ac|a&63)):(c(lH|a>>>6|0),c(ac|a&63)):c(a)}function +J8(a,b,c){if(a){var d=a[1],k=d[1];if(3895880===k)var -f=d[2],e=I3;else if(h4<=k)var -f=d[2],e=I4;else +f=d[2],e=J5;else if(ic<=k)var +f=d[2],e=J6;else var -f=d[2],e=I2}else +f=d[2],e=J4}else var -f=bY(10),e=I1;if(b)var -l=b[1],m=I5(l),g=l;else +f=b2(10),e=J3;if(b)var +l=b[1],m=J7(l),g=l;else var -m=IZ,g=dn;if(typeof +m=J1,g=dt;if(typeof c==="number")var -j=0,i=1,h=gh;else if(pX<=c[1])var -j=0,i=1,h=am(eI);else +j=0,i=1,h=go;else if(qB<=c[1])var +j=0,i=1,h=aj(eU);else var -n=c[2],j=p(n)-1|0,i=0,h=e7(n);var -o=ti===g?1:0;return[0,c,g,a,f,h,i,j,am(4),0,0,0,0,1,0,0,0,function(a,b){return I0(o,e,a,b)},m]}function -I7(a){return h(a[18],a)}function -I8(a){return a[11]}var -oL=44,hi=cc(IG),I_=10,I$=34,Ja=93,Jb=eQ,Jc=47,Jd=92,Je=42;function -Jf(a){var +n=c[2],j=p(n)-1|0,i=0,h=eg(n);var +o=tX===g?1:0;return[0,c,g,a,f,h,i,j,aj(4),0,0,0,0,1,0,0,0,function(a,b){return J2(o,e,a,b)},m]}function +J9(a){return h(a[18],a)}function +J_(a){return a[11]}var +po=44,ht=ci(JI),Ka=10,Kb=34,Kc=93,Kd=e2,Ke=47,Kf=92,Kg=42;function +Kh(a){var b=a<=31?1:0;if(b)var c=b;else var d=34===a?1:0,c=d||(92===a?1:0);return c}function -Jg(a){var +Ki(a){var b=48<=a?1:0,c=b?a<=57?1:0:b;return c}function -Jh(a){var +Kj(a){var c=48<=a?1:0,d=c?a<=57?1:0:c;if(d)var b=d;else{var e=65<=a?1:0,f=e?a<=70?1:0:e;if(f)var b=f;else var -g=97<=a?1:0,b=g?a<=hH?1:0:g}return b}function -hj(a){a:{if(11<=a){if(32===a)break a}else if(9<=a)break a;return 0}return 1}function -oM(a){a:{if(44<=a){var +g=97<=a?1:0,b=g?a<=hS?1:0:g}return b}function +hu(a){a:{if(11<=a){if(32===a)break a}else if(9<=a)break a;return 0}return 1}function +pp(a){a:{if(44<=a){var b=a-45|0;if(79>>0){if(81<=b)break a}else if(48!==b)break a}else if(11<=a){if(32!==a)break a}else if(9>a)break a;return 1}return 0}function -Jj(a){return[0,ah,[0,eJ,[0,-542918501,iB(a)]]]}function -Jk(a){return[0,ah,[0,eJ,[0,sT,iB(a)]]]}function -Jl(a){return[0,ah,[0,eJ,[0,sP,a]]]}function -Jm(a){return[0,ah,[0,eJ,[0,sX,a]]]}function -oN(a){return[0,ah,[0,eJ,[0,qH,a]]]}function -Jn(a){return[0,ah,[0,-635137946,iB(a)]]}function -Jo(a){return[0,ah,[0,tZ,a]]}function -Jt(a){return[0,ah,[0,th,a]]}function -Ju(a){return[0,ah,[0,p8,a]]}function -fq(a,b){return h(d(a)(JD),b)}function -jV(a,b){if(31>=cc(b))return fq(a,cc(b));var -c=cd(4);jU(c,b);var -e=cc(b),f=ce(c);return a6(d(a)(JE),f,fq,e)}function -bB(a,b){var -c=bY(b);return jU(a[2],c)}function -de(a){var -b=bY(a[8]);return jU(a[2],b)}function -dN(a){var -b=ce(a[2]);e$(a[2]);return b}function -oQ(a){var -b=jT(a[1]);return[0,jS(a[1]),b]}function -bN(a){a[4]=jS(a[1]);a[5]=jT(a[1]);return}function -aR(a){a[6]=jS(a[1]);a[7]=jT(a[1]);return}function -oR(a){var -b=a[9];if(!b)throw g([0,f,J_],1);var +Kl(a){return[0,ag,[0,eV,[0,-542918501,iL(a)]]]}function +Km(a){return[0,ag,[0,eV,[0,tv,iL(a)]]]}function +Kn(a){return[0,ag,[0,eV,[0,tr,a]]]}function +Ko(a){return[0,ag,[0,eV,[0,tz,a]]]}function +pq(a){return[0,ag,[0,eV,[0,rk,a]]]}function +Kp(a){return[0,ag,[0,-635137946,iL(a)]]}function +Kq(a){return[0,ag,[0,uA,a]]}function +Kv(a){return[0,ag,[0,tW,a]]}function +Kw(a){return[0,ag,[0,qM,a]]}function +fA(a,b){return h(j(a)(KF),b)}function +ke(a,b){if(31>=ci(b))return fA(a,ci(b));var +c=bL(4);kd(c,b);var +d=ci(b),e=b3(c);return a7(j(a)(KG),e,fA,d)}function +bD(a,b){var +c=b2(b);return kd(a[2],c)}function +dj(a){var +b=b2(a[8]);return kd(a[2],b)}function +dW(a){var +b=b3(a[2]);ek(a[2]);return b}function +pt(a){var +b=kc(a[1]);return[0,kb(a[1]),b]}function +bR(a){a[4]=kb(a[1]);a[5]=kc(a[1]);return}function +aR(a){a[6]=kb(a[1]);a[7]=kc(a[1]);return}function +pu(a){var +b=a[9];if(!b)throw g([0,f,La],1);var c=b[1][2],d=c[2];a[4]=c[1];a[5]=d;return aR(a)}function -oS(a){bN(a);aR(a);var -c=a[9];if(!c)throw g([0,f,J$],1);var -b=c[2];if(!b){a[10]=0;a[9]=0;return}if(dX<=b[1][1]){a[10]=1;a[9]=b;return}a[10]=0;a[9]=b;return}function -eu(a){return cx}function -W(a,b,c){c[12]=b;return a}function +pv(a){bR(a);aR(a);var +c=a[9];if(!c)throw g([0,f,Lb],1);var +b=c[2];if(!b){a[10]=0;a[9]=0;return}if(d6<=b[1][1]){a[10]=1;a[9]=b;return}a[10]=0;a[9]=b;return}function +eG(a){return cH}function +V(a,b,c){c[12]=b;return a}function z(c,b){var -a=I7(b[1]);if(typeof -a==="number")return hZ<=a?W(hZ,function(a){return z(c,a)},b):(b[8]=gb,h(c,b));if(aF<=a[1]){b[8]=cc(a[2]);return h(c,b)}var -d=a[2];b[8]=hi;aR(b);return W(Jo(d),c,b)}function -oT(c,b){if(b[8]!==10&&b[8]!==bV){de(b);return z(function(a){return oT(c,a)},b)}aR(b);return W([0,eF,[0,83,dN(b)]],function(a){return z(c,a)},b)}function -fr(a,b,c){if(c[8]===bV){aR(c);return W(Jp,eu,c)}if(a){if(c[8]===47){aR(c);return W([0,eF,[0,77,dN(c)]],function(a){return z(b,a)},c)}if(c[8]===42){de(c);var -d=1;return z(function(a){return fr(d,b,a)},c)}bB(c,Je);de(c);var -e=0;return z(function(a){return fr(e,b,a)},c)}if(c[8]===42){var -f=1;return z(function(a){return fr(f,b,a)},c)}de(c);var -g=0;return z(function(a){return fr(g,b,a)},c)}function -Ka(c,b){if(b[8]===47)return z(function(a){return oT(c,a)},b);if(b[8]===42){var -d=0;return z(function(a){return fr(d,c,a)},b)}aR(b);return W(Jv,c,b)}function -oU(c,b){return hj(b[8])?(aR(b),de(b),z(function(a){return oU(c,a)},b)):W([0,hI,dN(b)],c,b)}function -jW(c,b){if(hj(b[8])){bN(b);return oU(function(a){return jW(c,a)},b)}if(b[8]!==47)return h(c,b);bN(b);function -d(a){return jW(c,a)}return z(function(a){return Ka(d,a)},b)}function -oV(c,b){return hj(b[8])?z(function(a){return oV(c,a)},b):h(c,b)}function -cJ(a,b){return b[3]?jW(a,b):oV(a,b)}function -jX(g,b,c,d,e){function -f(a,b,c){bB(c,hi);return W(a,b,c)}if(0=b)return lg=b){bB(e,((k&fN)<<10|b&fN)+eI|0);return h(d,e)}return f(Jl(b),d,e)}function -oW(c,b){var -a=b[8];if(34===a){bB(b,I$);return z(c,b)}if(92<=a){if(118>a)switch(a-92|0){case -0:bB(b,Jd);return z(c,b);case -6:bB(b,8);return z(c,b);case -10:bB(b,12);return z(c,b);case -18:bB(b,I_);return z(c,b);case -22:bB(b,13);return z(c,b);case -24:bB(b,9);return z(c,b);case +a=J9(b[1]);if(typeof +a==="number")return h8<=a?V(h8,function(a){return z(c,a)},b):(b[8]=gk,h(c,b));if(aF<=a[1]){b[8]=ci(a[2]);return h(c,b)}var +d=a[2];b[8]=ht;aR(b);return V(Kq(d),c,b)}function +pw(c,b){if(b[8]!==10&&b[8]!==b0){dj(b);return z(function(a){return pw(c,a)},b)}aR(b);return V([0,eR,[0,83,dW(b)]],function(a){return z(c,a)},b)}function +fB(a,b,c){if(c[8]===b0){aR(c);return V(Kr,eG,c)}if(a){if(c[8]===47){aR(c);return V([0,eR,[0,77,dW(c)]],function(a){return z(b,a)},c)}if(c[8]===42){dj(c);var +d=1;return z(function(a){return fB(d,b,a)},c)}bD(c,Kg);dj(c);var +e=0;return z(function(a){return fB(e,b,a)},c)}if(c[8]===42){var +f=1;return z(function(a){return fB(f,b,a)},c)}dj(c);var +g=0;return z(function(a){return fB(g,b,a)},c)}function +Lc(c,b){if(b[8]===47)return z(function(a){return pw(c,a)},b);if(b[8]===42){var +d=0;return z(function(a){return fB(d,c,a)},b)}aR(b);return V(Kx,c,b)}function +px(c,b){return hu(b[8])?(aR(b),dj(b),z(function(a){return px(c,a)},b)):V([0,hT,dW(b)],c,b)}function +kf(c,b){if(hu(b[8])){bR(b);return px(function(a){return kf(c,a)},b)}if(b[8]!==47)return h(c,b);bR(b);function +d(a){return kf(c,a)}return z(function(a){return Lc(d,a)},b)}function +py(c,b){return hu(b[8])?z(function(a){return py(c,a)},b):h(c,b)}function +cQ(a,b){return b[3]?kf(a,b):py(a,b)}function +kg(g,b,c,d,e){function +f(a,b,c){bD(c,ht);return V(a,b,c)}if(0=b)return lB=b){bD(e,((k&fW)<<10|b&fW)+eU|0);return h(d,e)}return f(Kn(b),d,e)}function +pz(c,b){var +a=b[8];if(34===a){bD(b,Kb);return z(c,b)}if(92<=a){if(118>a)switch(a-92|0){case +0:bD(b,Kf);return z(c,b);case +6:bD(b,8);return z(c,b);case +10:bD(b,12);return z(c,b);case +18:bD(b,Ka);return z(c,b);case +22:bD(b,13);return z(c,b);case +24:bD(b,9);return z(c,b);case 25:var -d=4,e=0,f=0;return z(function(a){return jX(f,e,d,c,a)},b)}}else if(47===a){bB(b,Jc);return z(c,b)}aR(b);bB(b,hi);return W(Jk(a),function(a){return z(c,a)},b)}function -fs(c,b){if(b[8]===bV){aR(b);return W(Jq,eu,b)}if(!Jf(b[8])){de(b);return z(function(a){return fs(c,a)},b)}if(b[8]===34){aR(b);return z(c,b)}if(b[8]===92){var -d=function(a){return fs(c,a)};return z(function(a){return oW(d,a)},b)}aR(b);bB(b,hi);function -e(a){return fs(c,a)}return W(Jn(b[8]),function(a){return z(e,a)},b)}function -oX(c,b){if(!oM(b[8])&&b[8]!==bV){aR(b);de(b);return z(function(a){return oX(c,a)},b)}var -a=dN(b);try{var -e=W([0,bS,[0,bg,f4(a)]],c,b);return e}catch(f){var -d=P(f);if(d[1]===dy)return W(Jt(a),c,b);throw g(d,0)}}function -oY(c,b){if(!oM(b[8])&&b[8]!==bV){aR(b);de(b);return z(function(a){return oY(c,a)},b)}var -a=dN(b);return a!==fY?a!==fP?a!==dZ?W(Ju(a),c,b):W(Kb,c,b):W(Kc,c,b):W(Kd,c,b)}function -hk(a,b,c){var -d=c[8];a:{if(hE<=d){var -e=d-110|0;if(6>>0){if(13!==e)break a;bN(c);aR(c);c[11]=1;c[10]=1;var -f=c[9];c[9]=[0,[0,dX,oQ(c)],f];return W(Ke,function(a){return z(b,a)},c)}if(4>=e-1>>>0)break a}else{if(34===d){bN(c);var -g=function(a,b){return W([0,bS,[0,n,dN(b)]],a,b)},h=function(a){return g(b,a)};return z(function(a){return fs(h,a)},c)}if(91===d){bN(c);aR(c);c[11]=1;var -j=c[9];c[9]=[0,[0,fK,oQ(c)],j];return W(Kf,function(a){return z(b,a)},c)}if(hH>d)break a}bN(c);return oY(b,c)}if(!Jg(d)&&d!==45)return i(a,b,c);bN(c);return oX(b,c)}function -hl(f,b,c,d,e){if(e[8]!==f&&e[8]!==b&&e[8]!==bV){aR(e);return z(function(a){return hl(f,b,c,d,a)},e)}return W(c,d,e)}function -Kg(c,b){function -d(a,b,c){bN(c);return hl(oL,Ja,a,b,c)}var -a=b[11];b[11]=0;if(b[8]===bV){oR(b);return W(Jr,eu,b)}if(b[8]===93){oS(b);return W(Kh,function(a){return z(c,a)},b)}if(a)return hk(function(a,b){return d(Jy,a,b)},c,b);if(b[8]!==44)return d(Jz,c,b);function -e(a,b){return d(oO,a,b)}function -f(a){return hk(e,c,a)}return z(function(a){return cJ(f,a)},b)}function -hm(a,b,c){bN(c);c[10]=1;return hl(oL,Jb,a,b,c)}function -Ki(c,b){b[10]=1;if(b[8]!==58)return hm(Jx,c,b);function -d(a,b){return hm(oO,a,b)}function -e(a){return hk(d,c,a)}return z(function(a){return cJ(e,a)},b)}function -Kj(c,b){function +d=4,e=0,f=0;return z(function(a){return kg(f,e,d,c,a)},b)}}else if(47===a){bD(b,Ke);return z(c,b)}aR(b);bD(b,ht);return V(Km(a),function(a){return z(c,a)},b)}function +fC(c,b){if(b[8]===b0){aR(b);return V(Ks,eG,b)}if(!Kh(b[8])){dj(b);return z(function(a){return fC(c,a)},b)}if(b[8]===34){aR(b);return z(c,b)}if(b[8]===92){var +d=function(a){return fC(c,a)};return z(function(a){return pz(d,a)},b)}aR(b);bD(b,ht);function +e(a){return fC(c,a)}return V(Kp(b[8]),function(a){return z(e,a)},b)}function +pA(c,b){if(!pp(b[8])&&b[8]!==b0){aR(b);dj(b);return z(function(a){return pA(c,a)},b)}var +a=dW(b);try{var +e=V([0,bW,[0,bg,gc(a)]],c,b);return e}catch(f){var +d=P(f);if(d[1]===dH)return V(Kv(a),c,b);throw g(d,0)}}function +pB(c,b){if(!pp(b[8])&&b[8]!==b0){aR(b);dj(b);return z(function(a){return pB(c,a)},b)}var +a=dW(b);return a!==f7?a!==fY?a!==d8?V(Kw(a),c,b):V(Ld,c,b):V(Le,c,b):V(Lf,c,b)}function +hv(a,b,c){var +d=c[8];a:{if(hP<=d){var +e=d-110|0;if(6>>0){if(13!==e)break a;bR(c);aR(c);c[11]=1;c[10]=1;var +f=c[9];c[9]=[0,[0,d6,pt(c)],f];return V(Lg,function(a){return z(b,a)},c)}if(4>=e-1>>>0)break a}else{if(34===d){bR(c);var +g=function(a,b){return V([0,bW,[0,n,dW(b)]],a,b)},h=function(a){return g(b,a)};return z(function(a){return fC(h,a)},c)}if(91===d){bR(c);aR(c);c[11]=1;var +j=c[9];c[9]=[0,[0,fU,pt(c)],j];return V(Lh,function(a){return z(b,a)},c)}if(hS>d)break a}bR(c);return pB(b,c)}if(!Ki(d)&&d!==45)return i(a,b,c);bR(c);return pA(b,c)}function +hw(f,b,c,d,e){if(e[8]!==f&&e[8]!==b&&e[8]!==b0){aR(e);return z(function(a){return hw(f,b,c,d,a)},e)}return V(c,d,e)}function +Li(c,b){function +d(a,b,c){bR(c);return hw(po,Kc,a,b,c)}var +a=b[11];b[11]=0;if(b[8]===b0){pu(b);return V(Kt,eG,b)}if(b[8]===93){pv(b);return V(Lj,function(a){return z(c,a)},b)}if(a)return hv(function(a,b){return d(KA,a,b)},c,b);if(b[8]!==44)return d(KB,c,b);function +e(a,b){return d(pr,a,b)}function +f(a){return hv(e,c,a)}return z(function(a){return cQ(f,a)},b)}function +hx(a,b,c){bR(c);c[10]=1;return hw(po,Kd,a,b,c)}function +Lk(c,b){b[10]=1;if(b[8]!==58)return hx(Kz,c,b);function +d(a,b){return hx(pr,a,b)}function +e(a){return hv(d,c,a)}return z(function(a){return cQ(e,a)},b)}function +Ll(c,b){function d(a,b,c){function -d(a,b){return W([0,bS,[0,hU,dN(b)]],a,b)}if(c[8]!==34)return hm(a,b,c);bN(c);function -e(a){return d(b,a)}return z(function(a){return fs(e,a)},c)}var -a=b[11];b[11]=0;b[10]=0;if(b[8]===bV){oR(b);return W(Js,eu,b)}if(b[8]===eQ){oS(b);return W(Kk,function(a){return z(c,a)},b)}if(a)return d(JA,c,b);if(b[8]!==44)return hm(JB,c,b);function -e(a){return d(Jw,c,a)}return z(function(a){return cJ(e,a)},b)}function -Kl(a,b){return b[8]===bV?W(cx,eu,b):function(a,b){bN(b);return hl(gb,gb,JC,a,b)}(eu,b)}function -ft(a){var -b=a[9];return b?dX<=b[1][1]?a[10]?cJ(function(a){return Kj(ft,a)},a):cJ(function(a){return Ki(ft,a)},a):cJ(function(a){return Kg(ft,a)},a):cJ(function(a){return Kl(ft,a)},a)}function -oZ(d,b,c){if(!hj(c[8])&&c[8]!==bV){aR(c);return z(function(a){return oZ(d,b,a)},c)}return W(d,b,c)}function -o0(a,b){function -c(c,b){bN(b);function -d(a){return o0(c,a)}return oZ(oP,function(a){return cJ(d,a)},b)}return b[8]!==bV?hk(c,a,b):W(oP,a,b)}var -I9=2147483646;function -Km(a){function -b(a,b){return I8(b[1])?W(Ji,a,b):h(a,b)}function -c(a){return o0(ft,a)}function -d(a){return cJ(c,a)}return z(function(a){return b(d,a)},a)}var -Kn=[0,h4,bY(10)];function -JF(a,b){if(typeof -b==="number")return d(a)(JG);var -e=b[1];if(th>e){if(fF===e){var -l=b[2];d(a)(J3);return fK<=l?dX<=l?d(a)(J4):d(a)(J5):eF<=l?d(a)(J6):d(a)(J7)}if(p8<=e){var -z=b[2];return h(d(a)(J8),z)}var -A=b[2];return i(d(a)(J9),jV,A)}if(tZ>e){if(ck<=e){var -c=b[2];d(a)(JR);return typeof -c==="number"?qN<=c?r$<=c?hU<=c?d(a)(JS):d(a)(JT):t2<=c?d(a)(JU):d(a)(JV):eF<=c?d(a)(JW):d(a)(JX):kr<=c[1]?c[2]?d(a)(JY):d(a)(JZ):c[2]?d(a)(J0):d(a)(J1)}var -y=b[2];return h(d(a)(J2),y)}if(eJ<=e){var -f=b[2];d(a)(JH);var -g=f[1];if(sP===g){var -o=f[2];return i(d(a)(JI),fq,o)}if(sX<=g){if(sT<=g){var -q=f[2];return i(d(a)(JJ),jV,q)}var -r=f[2];return i(d(a)(JK),fq,r)}if(qH<=g){var -s=f[2];return i(d(a)(JL),fq,s)}var -t=f[2];return i(d(a)(JM),jV,t)}var -k=b[2],m=p(k);d(a)(JN);if(0d){if(fP===d){var +l=b[2];j(a)(K5);return fU<=l?d6<=l?j(a)(K6):j(a)(K7):eR<=l?j(a)(K8):j(a)(K9)}if(qM<=d){var +z=b[2];return h(j(a)(K_),z)}var +A=b[2];return i(j(a)(K$),ke,A)}if(uA>d){if(cq<=d){var +c=b[2];j(a)(KT);return typeof +c==="number"?rp<=c?sM<=c?h4<=c?j(a)(KU):j(a)(KV):uE<=c?j(a)(KW):j(a)(KX):eR<=c?j(a)(KY):j(a)(KZ):kM<=c[1]?c[2]?j(a)(K0):j(a)(K1):c[2]?j(a)(K2):j(a)(K3)}var +y=b[2];return h(j(a)(K4),y)}if(eV<=d){var +e=b[2];j(a)(KJ);var +f=e[1];if(tr===f){var +o=e[2];return i(j(a)(KK),fA,o)}if(tz<=f){if(tv<=f){var +q=e[2];return i(j(a)(KL),ke,q)}var +r=e[2];return i(j(a)(KM),fA,r)}if(rk<=f){var +s=e[2];return i(j(a)(KN),fA,s)}var +t=e[2];return i(j(a)(KO),ke,t)}var +k=b[2],m=p(k);j(a)(KP);if(0=1){var -j=v;for(;;){var -w=V(k,j);h(d(a)(JQ),w);var -x=j+1|0;if(n===j)break;j=x}}return d(a)(JP)}function -Ko(a,b){var -c=I6([0,Kn],a,b);return[0,c,cd(eD),0,1,0,1,0,I9,0,0,0,Km]}function -Kp(a){a[3]=0;var +g=v;for(;;){var +w=ak(k,g);h(j(a)(KS),w);var +x=g+1|0;if(n===g)break;g=x}}return j(a)(KR)}function +Lq(a,b){var +c=J8([0,Lp],a,b);return[0,c,bL(eP),0,1,0,1,0,J$,0,0,0,Lo]}function +Lr(a){a[3]=0;var b=h(a[12],a);if(typeof b!=="number"){var -c=b[1];if(bS!==c&&ah>c)throw g([0,f,Kq],1)}return b}function -Kr(a){return[0,[0,a[4],a[5]],[0,a[6],a[7]]]}var -o1=[B,Ky,ar(0)];function -Ks(a){var -c=Ko(0,a),e=[B,Kt,ar(0)];function -m(a){return Kr(c)}function +c=b[1];if(bW!==c&&ag>c)throw g([0,f,Ls],1)}return b}function +Lt(a){return[0,[0,a[4],a[5]],[0,a[6],a[7]]]}var +pE=[B,LA,ar(0)];function +Lu(a){var +c=Lq(0,a),e=[B,Lv,ar(0)];function +m(a){return Lt(c)}function i(a){var -b=Kp(c);if(typeof -b==="number"){if(hZ<=b)throw g([0,f,Ku],1);throw g([0,e,Kv],1)}if(ah>b[1])return b[2];var -d=b[2];throw g([0,e,[0,ah,[0,m(0),d]]],1)}function +b=Lr(c);if(typeof +b==="number"){if(h8<=b)throw g([0,f,Lw],1);throw g([0,e,Lx],1)}if(ag>b[1])return b[2];var +d=b[2];throw g([0,e,[0,ag,[0,m(0),d]]],1)}function h(a,b,c){a:{if(typeof -b==="number"){if(fK===b){var -h=0;return a<50?k(a+1|0,h,c):l(k,[0,h,c])}if(dX===b){var -i=0;return a<50?j(a+1|0,i,c):l(j,[0,i,c])}if(cP===b)break a}else{var -f=b[1];if(n===f||bg===f||bu===f)break a}throw g([0,e,[0,hR,[0,bS,[0,m(0),b,Kw]]]],1)}return a<50?d(a+1|0,b,c):l(d,[0,b,c])}function +b==="number"){if(fU===b){var +h=0;return a<50?k(a+1|0,h,c):l(k,[0,h,c])}if(d6===b){var +i=0;return a<50?j(a+1|0,i,c):l(j,[0,i,c])}if(cW===b)break a}else{var +f=b[1];if(n===f||bg===f||bx===f)break a}throw g([0,e,[0,h1,[0,bW,[0,m(0),b,Ly]]]],1)}return a<50?d(a+1|0,b,c):l(d,[0,b,c])}function k(a,b,c){var -e=i(0);if(ua===e){var -f=[0,65,a_(b)];return a<50?d(a+1|0,f,c):l(d,[0,f,c])}var +e=i(0);if(typeof +e==="number"&&uO===e){var +f=[0,65,bz(b)];return a<50?d(a+1|0,f,c):l(d,[0,f,c])}var g=[0,b,c];return a<50?h(a+1|0,e,g):l(h,[0,e,g])}function j(a,b,c){var f=i(0);if(typeof -f==="number"){if(rl===f){var -j=[0,79,a_(b)];return a<50?d(a+1|0,j,c):l(d,[0,j,c])}}else if(hU===f[1]){var -k=[1,f[2],b,c],n=i(0);return a<50?h(a+1|0,n,k):l(h,[0,n,k])}throw g([0,e,[0,hR,[0,bS,[0,m(0),f,Kx]]]],1)}function +f==="number"){if(rZ===f){var +j=[0,79,bz(b)];return a<50?d(a+1|0,j,c):l(d,[0,j,c])}}else if(h4===f[1]){var +k=[1,f[2],b,c],n=i(0);return a<50?h(a+1|0,n,k):l(h,[0,n,k])}throw g([0,e,[0,h1,[0,bW,[0,m(0),f,Lz]]]],1)}function d(a,b,c){if(typeof c==="number")return b;if(0===c[0]){var d=c[2],e=[0,b,c[1]];return a<50?k(a+1|0,e,d):l(k,[0,e,d])}var f=c[3],g=[0,[0,c[1],b],c[2]];return a<50?j(a+1|0,g,f):l(j,[0,g,f])}function -o(a,b){return bI(h(0,a,b))}try{var +o(a,b){return bJ(h(0,a,b))}try{var p=[0,o(i(0),0)];return p}catch(f){var b=P(f);if(b[1]===e)return[1,b[2]];throw g(b,0)}}function -Kz(c,b){return mi(function(a){throw g([0,o1,c,a],1)},b)}function -KA(a){var -b=a[1];if(381139274===b)return KB;if(hR>b){var -e=a[2][2];return i(mR(KE),JF,e)}var +LB(c,b){return mQ(function(a){throw g([0,pE,c,a],1)},b)}function +LC(a){var +b=a[1];if(381139274===b)return LD;if(h1>b){var +e=a[2][2];return i(ns(LG),KH,e)}var c=a[2];if(typeof -c==="number")return mQ(KC);var -d=c[2][3];return h(mQ(KD),d)}function -KF(a){return Ks(a)}function -KG(a){var -b=KF(a);if(0===b[0])return b[1];var -c=KA(b[1]);return h(Kz(cP,KH),c)}function -KI(a){return KG([0,n,a])}function -KJ(a){a:if(typeof +c==="number")return nr(LE);var +d=c[2][3];return h(nr(LF),d)}function +LH(a){return Lu(a)}function +LI(a){var +b=LH(a);if(0===b[0])return b[1];var +c=LC(b[1]);return h(LB(cW,LJ),c)}function +LK(a){return LI([0,n,a])}function +LL(a){a:if(typeof a!=="number"){var -b=a[1];if(65!==b&&79!==b)break a;return a}throw g([0,o1,a,KK],1)}function -KL(a){return KJ(KI(a))}var -KP=dz(function(a){return[0,a,KO]},lX(function(a){return dW>>a|0)?1:0}if(c(7,b))return m(a,au(b));if(c(11,b)){m(a,au(lm|(b>>>6|0)&31));return m(a,au(ad|b&63))}if(c(16,b)){m(a,au(fX|(b>>>12|0)&15));m(a,au(ad|(b>>>6|0)&63));return m(a,au(ad|b&63))}if(c(21,b)){m(a,au(eE|(b>>>18|0)&7));m(a,au(ad|(b>>>12|0)&63));m(a,au(ad|(b>>>6|0)&63));return m(a,au(ad|b&63))}if(c(26,b)){m(a,au(B|(b>>>24|0)&3));m(a,au(ad|(b>>>18|0)&63));m(a,au(ad|(b>>>12|0)&63));m(a,au(ad|(b>>>6|0)&63));return m(a,au(ad|b&63))}if(!c(31,b))throw g([0,f,KY],1);m(a,au(eN|(b>>>30|0)&1));m(a,au(ad|(b>>>24|0)&63));m(a,au(ad|(b>>>18|0)&63));m(a,au(ad|(b>>>12|0)&63));m(a,au(ad|(b>>>6|0)&63));return m(a,au(ad|b&63))}function -KZ(a,b){return eI+((a-55296|0)<<10|b-56320|0)|0}function -K0(a,b,c){return o8(a,KZ(b,c))}var -K2=[B,K1,ar(0)];function -hn(a){throw g([0,K2,a],1)}var -j1=[B,K3,ar(0)],j2=[B,K4,ar(0)],j3=[B,K5,ar(0)],o9=[B,K6,ar(0)];function -K7(a,b,c,d){var -e=c?c[1]:1,f=a?a[1]:cd(cw);return[0,f,e,0,b]}function -kk(a,b,c,d){var -e=0;return a<50?pL(a+1|0,b,c,d,e):l(pL,[0,b,c,d,e])}function -K9(a,b,c){return bI(kk(0,a,b,c))}function -pL(a,b,c,d,e){var +b=a[1];if(65!==b&&79!==b)break a;return a}throw g([0,pE,a,LM],1)}function +LN(a){return LL(LK(a))}var +LR=cj(function(a){return[0,a,LQ]},mo(function(a){return d5>>a|0)?1:0}if(c(7,b))return m(a,av(b));if(c(11,b)){m(a,av(lH|(b>>>6|0)&31));return m(a,av(ac|b&63))}if(c(16,b)){m(a,av(f6|(b>>>12|0)&15));m(a,av(ac|(b>>>6|0)&63));return m(a,av(ac|b&63))}if(c(21,b)){m(a,av(eQ|(b>>>18|0)&7));m(a,av(ac|(b>>>12|0)&63));m(a,av(ac|(b>>>6|0)&63));return m(a,av(ac|b&63))}if(c(26,b)){m(a,av(B|(b>>>24|0)&3));m(a,av(ac|(b>>>18|0)&63));m(a,av(ac|(b>>>12|0)&63));m(a,av(ac|(b>>>6|0)&63));return m(a,av(ac|b&63))}if(!c(31,b))throw g([0,f,L0],1);m(a,av(eZ|(b>>>30|0)&1));m(a,av(ac|(b>>>24|0)&63));m(a,av(ac|(b>>>18|0)&63));m(a,av(ac|(b>>>12|0)&63));m(a,av(ac|(b>>>6|0)&63));return m(a,av(ac|b&63))}function +L1(a,b){return eU+((a-55296|0)<<10|b-56320|0)|0}function +L2(a,b,c){return pL(a,L1(b,c))}var +L4=[B,L3,ar(0)];function +hy(a){throw g([0,L4,a],1)}var +kk=[B,L5,ar(0)],kl=[B,L6,ar(0)],km=[B,L7,ar(0)],pM=[B,L8,ar(0)];function +L9(a,b,c,d){var +e=c?c[1]:1,f=a?a[1]:bL(cG);return[0,f,e,0,b]}function +kF(a,b,c,d){var +e=0;return a<50?qo(a+1|0,b,c,d,e):l(qo,[0,b,c,d,e])}function +L$(a,b,c){return bJ(kF(0,a,b,c))}function +qo(a,b,c,d,e){var g=e;for(;;){var -f=wq(K8,g,d);if(0===f)return;if(1===f){if(0>=c)return;m(b,wt(d,0));var -i=c-1|0;return a<50?kk(a+1|0,b,i,d):l(kk,[0,b,i,d])}h(d[1],d);g=f}}function -K_(a,b,c){var -d=c[4],e=c[5];K9(a,b,c);c[5]=e+1|0;c[4]=d;return}function -o_(a){var -b=10<=a?a+87|0:a+48|0;return au(b)}function -dO(a,b,c,d,e){fa(d,a,b[1],c-b[1]|0);a2(d,e);b[1]=c+1|0;return}function -K$(a,b,c,d,e){fa(d,a,b[1],c-b[1]|0);a2(d,La);m(d,o_(e>>>4|0));m(d,o_(e&15));b[1]=c+1|0;return}function -Lb(a,b,c){try{fa(c,a,b[1],p(a)-b[1]|0);return}catch(f){var -d=P(f),e=p(a)-b[1]|0,h=b[1];a6(gp(Lc),a,h,e);throw g(d,0)}}function -Ld(a,b){var +f=xi(L_,g,d);if(0===f)return;if(1===f){if(0>=c)return;m(b,xl(d,0));var +i=c-1|0;return a<50?kF(a+1|0,b,i,d):l(kF,[0,b,i,d])}h(d[1],d);g=f}}function +Ma(a,b,c){var +d=c[4],e=c[5];L$(a,b,c);c[5]=e+1|0;c[4]=d;return}function +pN(a){var +b=10<=a?a+87|0:a+48|0;return av(b)}function +dX(a,b,c,d,e){el(d,a,b[1],c-b[1]|0);a3(d,e);b[1]=c+1|0;return}function +Mb(a,b,c,d,e){el(d,a,b[1],c-b[1]|0);a3(d,Mc);m(d,pN(e>>>4|0));m(d,pN(e&15));b[1]=c+1|0;return}function +Md(a,b,c){try{el(c,a,b[1],p(a)-b[1]|0);return}catch(f){var +d=P(f),e=p(a)-b[1]|0,h=b[1];a7(gx(Me),a,h,e);throw g(d,0)}}function +Mf(a,b){var d=[0,0],f=p(b)-1|0,g=0;if(f>=0){var c=g;for(;;){var -e=V(b,c);a:if(92===e)dO(b,d,c,a,Le);else{b:{c:{if(35>e){if(8>e)break b;switch(e-8|0){case -0:dO(b,d,c,a,Lf);break;case -1:dO(b,d,c,a,Lg);break;case -2:dO(b,d,c,a,Lh);break;case -4:dO(b,d,c,a,Li);break;case -5:dO(b,d,c,a,Lj);break;case -26:dO(b,d,c,a,Lk);break;case +e=ak(b,c);a:if(92===e)dX(b,d,c,a,Mg);else{b:{c:{if(35>e){if(8>e)break b;switch(e-8|0){case +0:dX(b,d,c,a,Mh);break;case +1:dX(b,d,c,a,Mi);break;case +2:dX(b,d,c,a,Mj);break;case +4:dX(b,d,c,a,Mk);break;case +5:dX(b,d,c,a,Ml);break;case +26:dX(b,d,c,a,Mm);break;case 24:case -25:break c;default:break b}break a}if(dW===e)break b}break a}K$(b,d,c,a,e)}var -h=c+1|0;if(f===c)break;c=h}}return Lb(b,d,a)}function -dP(a,b){m(a,34);Ld(a,b);return m(a,34)}function -o$(a,b){return a2(a,Ll)}function -pa(a,b){var -c=b?Lm:Ln;return a2(a,c)}function -Lo(a){return au(a+48|0)}function -j4(a,b){return 0===b?0:(j4(a,b/10|0),m(a,Lo(e3(b%10|0))))}function -pb(a,b){return 0=0){var b=f;for(;;){var -c=V(a,b);a:{if(48<=c){if(58>c)break a}else if(45===c)break a;throw g(lM,1)}var +c=ak(a,b);a:{if(48<=c){if(58>c)break a}else if(45===c)break a;throw g(l_,1)}var i=b+1|0;if(e===b)break;b=i}}var h=1;return h}catch(f){var -d=P(f);if(d===lM)return 0;throw g(d,0)}}function -Lp(a,b){var -c=ig(b);if(3===c){var -g=0.c)return cX<=c?bg<=c?Lp(a,b[2]):pb(a,b[2]):dU<=c?a2(a,b[2]):dP(a,b[2]);if(fO===c)return LG(a,b[2]);if(r<=c)return J<=c?LE(a,b[2]):LF(a,b[2]);if(bu<=c)return pa(a,b[2]);var -d=b[2];return LH(a,d[1],d[2])}function -LE(a,b){m(a,eK);ev(function(a,b){var -c=b[2];dP(a,b[1]);m(a,58);return fu(a,c)},ew,a,b);return m(a,eQ)}function -LF(a,b){m(a,91);ev(fu,ew,a,b);return m(a,93)}function -LG(a,b){m(a,40);ev(fu,ew,a,b);return m(a,41)}function -LH(a,b,c){m(a,60);dP(a,b);if(c){var -d=c[1];m(a,58);fu(a,d)}return m(a,62)}function -fv(a,b){if(typeof -b==="number")return o$(a,0);var -c=b[1];if(fV>c)return cX<=c?bg<=c?Lw(a,b[2]):pb(a,b[2]):dU<=c?a2(a,b[2]):dP(a,b[2]);if(fO===c)return LK(a,b[2]);if(r<=c)return J<=c?LI(a,b[2]):LJ(a,b[2]);if(bu<=c)return pa(a,b[2]);var -d=b[2];return LL(a,d[1],d[2])}function -LI(a,b){m(a,eK);ev(function(a,b){var -c=b[2];dP(a,b[1]);m(a,58);return fv(a,c)},ew,a,b);return m(a,eQ)}function -LJ(a,b){m(a,91);ev(fv,ew,a,b);return m(a,93)}function -LK(a,b){m(a,91);ev(fv,ew,a,b);return m(a,93)}function -LL(a,b,c){if(!c)return dP(a,b);var -d=c[1];m(a,91);dP(a,b);m(a,44);fv(a,d);return m(a,93)}function -LM(a,b,c,d){var -e=a?a[1]:LN,f=b?b[1]:0;if(f)fv(c,d);else -fu(c,d);return a2(c,e)}function -be(a,b,c){return uR(a,b,c)}function -pd(a){return a+fU|0}function -df(a){if(65<=a){if(97<=a){if(hE>a)return(a-97|0)+10|0}else if(71>a)return(a-65|0)+10|0}else if(9>=a+fU>>>0)return a-48|0;throw g([0,f,LQ],1)}function -b3(a,b,c){var -e=c[4]-1|0,f=b[3],d=((e+c[5]|0)-f|0)-1|0,g=u8(d,(e+c[6]|0)-f|0),j=b[4];if(j)var -l=j[1],k=h(t(LR),l);else +eH(a,b,c,d){if(!d)return;var +e=d[2];i(a,c,d[1]);return MF(a,b,c,e)}function +eI(a){return m(a,44)}function +fE(a,b){if(typeof +b==="number")return pO(a,0);var +c=b[1];if(f4>c)return c5<=c?bg<=c?Mr(a,b[2]):pQ(a,b[2]):d3<=c?a3(a,b[2]):dY(a,b[2]);if(fX===c)return MI(a,b[2]);if(r<=c)return J<=c?MG(a,b[2]):MH(a,b[2]);if(bx<=c)return pP(a,b[2]);var +d=b[2];return MJ(a,d[1],d[2])}function +MG(a,b){m(a,eW);eH(function(a,b){var +c=b[2];dY(a,b[1]);m(a,58);return fE(a,c)},eI,a,b);return m(a,e2)}function +MH(a,b){m(a,91);eH(fE,eI,a,b);return m(a,93)}function +MI(a,b){m(a,40);eH(fE,eI,a,b);return m(a,41)}function +MJ(a,b,c){m(a,60);dY(a,b);if(c){var +d=c[1];m(a,58);fE(a,d)}return m(a,62)}function +fF(a,b){if(typeof +b==="number")return pO(a,0);var +c=b[1];if(f4>c)return c5<=c?bg<=c?My(a,b[2]):pQ(a,b[2]):d3<=c?a3(a,b[2]):dY(a,b[2]);if(fX===c)return MM(a,b[2]);if(r<=c)return J<=c?MK(a,b[2]):ML(a,b[2]);if(bx<=c)return pP(a,b[2]);var +d=b[2];return MN(a,d[1],d[2])}function +MK(a,b){m(a,eW);eH(function(a,b){var +c=b[2];dY(a,b[1]);m(a,58);return fF(a,c)},eI,a,b);return m(a,e2)}function +ML(a,b){m(a,91);eH(fF,eI,a,b);return m(a,93)}function +MM(a,b){m(a,91);eH(fF,eI,a,b);return m(a,93)}function +MN(a,b,c){if(!c)return dY(a,b);var +d=c[1];m(a,91);dY(a,b);m(a,44);fF(a,d);return m(a,93)}function +MO(a,b,c,d){var +e=a?a[1]:MP,f=b?b[1]:0;if(f)fF(c,d);else +fE(c,d);return a3(c,e)}function +be(a,b,c){return vA(a,b,c)}function +pS(a){return a+f3|0}function +dk(a){if(65<=a){if(97<=a){if(hP>a)return(a-97|0)+10|0}else if(71>a)return(a-65|0)+10|0}else if(9>=a+f3>>>0)return a-48|0;throw g([0,f,MS],1)}function +b8(a,b,c){var +e=c[4]-1|0,f=b[3],d=((e+c[5]|0)-f|0)-1|0,g=vR(d,(e+c[6]|0)-f|0),j=b[4];if(j)var +l=j[1],k=h(t(MT),l);else var -k=LV;var -m=d===g?h(t(LS),d+1|0):i(t(LU),d+1|0,g+1|0),n=b[2];return hn(fE(t(LT),k,n,m,a))}function -bO(a,b,c){var -d=32,f=gk(c),e=cd(d);K_(e,d,c);var -g=ce(e);return b3(a6(t(LW),a,f,g),b,c)}function -LO(a,b,c,d,e){var -h=b?b[1]:cw,i=c?c[1]:LP;if(a){var -g=a[1];e$(g);var +k=MX;var +m=d===g?h(t(MU),d+1|0):i(t(MW),d+1|0,g+1|0),n=b[2];return hy(fO(t(MV),k,n,m,a))}function +bS(a,b,c){var +d=32,f=gs(c),e=bL(d);Ma(e,d,c);var +g=b3(e);return b8(a7(t(MY),a,f,g),b,c)}function +MQ(a,b,c,d,e){var +h=b?b[1]:cG,i=c?c[1]:MR;if(a){var +g=a[1];ek(g);var f=g}else var -f=cd(h);LM([0,i],d,f,e);var -j=ce(f);e$(f);return j}var -ex=[B,LX,ar(0)];function -LY(a){var +f=bL(h);MO([0,i],d,f,e);var +j=b3(f);ek(f);return j}var +eJ=[B,MZ,ar(0)];function +M0(a){var d=a[5],b=[0,0],e=a[6]-1|0,f=a[2];if(e>=d){var -c=d;for(;;){if(214748365<=b[1])throw g(ex,1);var -h=pd(f0(f,c));b[1]=(10*b[1]|0)+h|0;var -i=c+1|0;if(e===c)break;c=i}}if(0<=b[1])return b[1];throw g(ex,1)}function -LZ(a,b){try{var -d=[0,cX,LY(b)];return d}catch(f){var -c=P(f);if(c===ex)return[0,dU,gk(b)];throw g(c,0)}}function -L0(a){var +c=d;for(;;){if(214748365<=b[1])throw g(eJ,1);var +h=pS(f_(f,c));b[1]=(10*b[1]|0)+h|0;var +i=c+1|0;if(e===c)break;c=i}}if(0<=b[1])return b[1];throw g(eJ,1)}function +M1(a,b){try{var +d=[0,c5,M0(b)];return d}catch(f){var +c=P(f);if(c===eJ)return[0,d3,gs(b)];throw g(c,0)}}function +M2(a){var d=a[5]+1|0,b=[0,0],e=a[6]-1|0,f=a[2];if(e>=d){var -c=d;for(;;){if(b[1]<=-214748365)throw g(ex,1);var -h=pd(f0(f,c));b[1]=(10*b[1]|0)-h|0;var -i=c+1|0;if(e===c)break;c=i}}if(0>>0){h(c[1],c);k=f}else switch(f){case -0:return Mo;case -1:return Mp;case -2:return cP;case -3:return[0,bg,ve];case -4:return[0,bg,va];case -5:return[0,bg,vc];case -6:e$(b[1]);return[0,n,pe(b,c)];case -7:return LZ(b,c);case -8:return L1(b,c);case -9:return[0,bg,f4(gk(c))];case +0:return Nq;case +1:return Nr;case +2:return cW;case +3:return[0,bg,vZ];case +4:return[0,bg,vV];case +5:return[0,bg,vX];case +6:ek(b[1]);return[0,n,pT(b,c)];case +7:return M1(b,c);case +8:return M3(b,c);case +9:return[0,bg,gc(gs(c))];case 10:var -e=[0,0];try{a5(b,c);Mj(c);var -q=j5(b,c);a5(b,c);ph(b,c);a5(b,c);var -s=e[1];e[1]=[0,[0,q,dg(b,c)],s];for(;;){a5(b,c);Ml(b,c);a5(b,c);var -t=j5(b,c);a5(b,c);ph(b,c);a5(b,c);var -u=e[1];e[1]=[0,[0,t,dg(b,c)],u]}}catch(f){var -m=P(f);if(m===j2)return[0,J,a_(e[1])];throw g(m,0)}break;case +e=[0,0];try{a6(b,c);Nl(c);var +q=ko(b,c);a6(b,c);pW(b,c);a6(b,c);var +s=e[1];e[1]=[0,[0,q,dl(b,c)],s];for(;;){a6(b,c);Nn(b,c);a6(b,c);var +t=ko(b,c);a6(b,c);pW(b,c);a6(b,c);var +u=e[1];e[1]=[0,[0,t,dl(b,c)],u]}}catch(f){var +m=P(f);if(m===kl)return[0,J,bz(e[1])];throw g(m,0)}break;case 11:var -i=[0,0];try{a5(b,c);Mb(c);var -v=i[1];i[1]=[0,dg(b,c),v];for(;;){a5(b,c);Md(b,c);a5(b,c);var -w=i[1];i[1]=[0,dg(b,c),w]}}catch(f){var -o=P(f);if(o===j1)return[0,r,a_(i[1])];throw g(o,0)}break;case +i=[0,0];try{a6(b,c);Nd(c);var +v=i[1];i[1]=[0,dl(b,c),v];for(;;){a6(b,c);Nf(b,c);a6(b,c);var +w=i[1];i[1]=[0,dl(b,c),w]}}catch(f){var +o=P(f);if(o===kk)return[0,r,bz(i[1])];throw g(o,0)}break;case 12:var -j=[0,0];try{a5(b,c);Mf(c);var -x=j[1];j[1]=[0,dg(b,c),x];for(;;){a5(b,c);Mh(b,c);a5(b,c);var -y=j[1];j[1]=[0,dg(b,c),y]}}catch(f){var -p=P(f);if(p===j3)return[0,fO,a_(j[1])];throw g(p,0)}break;case -13:a5(b,c);var -z=j5(b,c);a5(b,c);return[0,fV,[0,z,L7(b,c)]];case -14:return a<50?cN(a+1|0,b,c):l(cN,[0,b,c]);case -15:pf(b,c);return a<50?cN(a+1|0,b,c):l(cN,[0,b,c]);case -16:ho(b,c);return a<50?cN(a+1|0,b,c):l(cN,[0,b,c]);case -17:return a<50?cN(a+1|0,b,c):l(cN,[0,b,c]);case -18:return b3(Mq,b,c);default:return bO(Mr,b,c)}}}function -fD(a,b,c){var -d=58;return a<50?pO(a+1|0,b,c,d):l(pO,[0,b,c,d])}function -pe(a,b){return bI(fD(0,a,b))}function -pO(a,b,c,d){var +j=[0,0];try{a6(b,c);Nh(c);var +x=j[1];j[1]=[0,dl(b,c),x];for(;;){a6(b,c);Nj(b,c);a6(b,c);var +y=j[1];j[1]=[0,dl(b,c),y]}}catch(f){var +p=P(f);if(p===km)return[0,fX,bz(j[1])];throw g(p,0)}break;case +13:a6(b,c);var +z=ko(b,c);a6(b,c);return[0,f4,[0,z,M9(b,c)]];case +14:return a<50?cU(a+1|0,b,c):l(cU,[0,b,c]);case +15:pU(b,c);return a<50?cU(a+1|0,b,c):l(cU,[0,b,c]);case +16:hz(b,c);return a<50?cU(a+1|0,b,c):l(cU,[0,b,c]);case +17:return a<50?cU(a+1|0,b,c):l(cU,[0,b,c]);case +18:return b8(Ns,b,c);default:return bS(Nt,b,c)}}}function +fN(a,b,c){var +d=58;return a<50?qr(a+1|0,b,c,d):l(qr,[0,b,c,d])}function +pT(a,b){return bJ(fN(0,a,b))}function +qr(a,b,c,d){var f=d;for(;;){var e=be(bf,f,c);if(3>=e>>>0)switch(e){case -0:return ce(b[1]);case -1:L3(b,c);return a<50?fD(a+1|0,b,c):l(fD,[0,b,c]);case -2:L2(b[1],c);return a<50?fD(a+1|0,b,c):l(fD,[0,b,c]);default:return b3(Ms,b,c)}h(c[1],c);f=e}}function -L3(a,b){return L4(a,b,68)}function -L4(a,b,c){var +0:return b3(b[1]);case +1:M5(b,c);return a<50?fN(a+1|0,b,c):l(fN,[0,b,c]);case +2:M4(b[1],c);return a<50?fN(a+1|0,b,c):l(fN,[0,b,c]);default:return b8(Nu,b,c)}h(c[1],c);f=e}}function +M5(a,b){return M6(a,b,68)}function +M6(a,b,c){var f=c;for(;;){var e=be(bf,f,b);if(8>=e>>>0)switch(e){case 0:var -g=cC(b,b[5]);return m(a[1],g);case +g=cI(b,b[5]);return m(a[1],g);case 1:return m(a[1],8);case 2:return m(a[1],12);case 3:return m(a[1],10);case 4:return m(a[1],13);case 5:return m(a[1],9);case 6:var -i=cC(b,b[5]+1|0),j=cC(b,b[5]+2|0),k=cC(b,b[5]+3|0),l=df(cC(b,b[5]+4|0)),n=df(k)<<4,o=df(j)<<8,d=df(i)<<12|o|n|l;if(kq<=d&&lg>=d)return L5(a,d,b);return o8(a[1],d);case -7:return bO(Mt,a,b);default:return b3(Mu,a,b)}h(b[1],b);f=e}}function -L5(a,b,c){return L6(a,b,c,82)}function -L6(a,b,c,d){var +i=cI(b,b[5]+1|0),j=cI(b,b[5]+2|0),k=cI(b,b[5]+3|0),l=dk(cI(b,b[5]+4|0)),n=dk(k)<<4,o=dk(j)<<8,d=dk(i)<<12|o|n|l;if(kL<=d&&lB>=d)return M7(a,d,b);return pL(a[1],d);case +7:return bS(Nv,a,b);default:return b8(Nw,a,b)}h(b[1],b);f=e}}function +M7(a,b,c){return M8(a,b,c,82)}function +M8(a,b,c,d){var g=d;for(;;){var e=be(bf,g,c);if(2>=e>>>0)switch(e){case 0:var -i=cC(c,c[5]+2|0),j=cC(c,c[5]+3|0),k=cC(c,c[5]+4|0),l=df(cC(c,c[5]+5|0)),m=df(k)<<4,n=df(j)<<8,f=df(i)<<12|n|m|l;if(k1<=f&&fH>=f)return K0(a[1],b,f);return bO(Mv,a,c);case -1:return bO(Mw,a,c);default:return b3(Mx,a,c)}h(c[1],c);g=e}}function -L7(a,b){return L8(a,b,hH)}function -L8(a,b,c){var +i=cI(c,c[5]+2|0),j=cI(c,c[5]+3|0),k=cI(c,c[5]+4|0),l=dk(cI(c,c[5]+5|0)),m=dk(k)<<4,n=dk(j)<<8,f=dk(i)<<12|n|m|l;if(lk<=f&&fR>=f)return L2(a[1],b,f);return bS(Nx,a,c);case +1:return bS(Ny,a,c);default:return b8(Nz,a,c)}h(c[1],c);g=e}}function +M9(a,b){return M_(a,b,hS)}function +M_(a,b,c){var e=c;for(;;){var d=be(bf,e,b);if(3>=d>>>0)switch(d){case 0:var -f=dg(a,b);a5(a,b);L9(a,b);return[0,f];case +f=dl(a,b);a6(a,b);M$(a,b);return[0,f];case 1:return 0;case -2:return bO(My,a,b);default:return b3(Mz,a,b)}h(b[1],b);e=d}}function -L9(a,b){return L_(a,b,111)}function -L_(a,b,c){var +2:return bS(NA,a,b);default:return b8(NB,a,b)}h(b[1],b);e=d}}function +M$(a,b){return Na(a,b,111)}function +Na(a,b,c){var e=c;for(;;){var d=be(bf,e,b);if(2>=d>>>0)switch(d){case 0:return;case -1:return bO(MA,a,b);default:return b3(MB,a,b)}h(b[1],b);e=d}}function -fC(a,b,c){var -d=eQ;return a<50?pN(a+1|0,b,c,d):l(pN,[0,b,c,d])}function -pf(a,b){return bI(fC(0,a,b))}function -pN(a,b,c,d){var +1:return bS(NC,a,b);default:return b8(ND,a,b)}h(b[1],b);e=d}}function +fM(a,b,c){var +d=e2;return a<50?qq(a+1|0,b,c,d):l(qq,[0,b,c,d])}function +pU(a,b){return bJ(fM(0,a,b))}function +qq(a,b,c,d){var f=d;for(;;){var e=be(bf,f,c);if(3>=e>>>0)switch(e){case 0:return;case -1:return bO(MC,b,c);case -2:ho(b,c);return a<50?fC(a+1|0,b,c):l(fC,[0,b,c]);default:return a<50?fC(a+1|0,b,c):l(fC,[0,b,c])}h(c[1],c);f=e}}function -pg(a){return L$(a,131)}function -L$(a,b){var +1:return bS(NE,b,c);case +2:hz(b,c);return a<50?fM(a+1|0,b,c):l(fM,[0,b,c]);default:return a<50?fM(a+1|0,b,c):l(fM,[0,b,c])}h(c[1],c);f=e}}function +pV(a){return Nb(a,131)}function +Nb(a,b){var d=b;for(;;){var c=be(bf,d,a);if(0===c)return 1;if(1===c)return 0;h(a[1],a);d=c}}function -cM(a,b,c){var -d=lb;return a<50?pM(a+1|0,b,c,d):l(pM,[0,b,c,d])}function -a5(a,b){return bI(cM(0,a,b))}function -pM(a,b,c,d){var +cT(a,b,c){var +d=lw;return a<50?qp(a+1|0,b,c,d):l(qp,[0,b,c,d])}function +a6(a,b){return bJ(cT(0,a,b))}function +qp(a,b,c,d){var f=d;for(;;){var e=be(bf,f,c);if(4>=e>>>0)switch(e){case -0:ho(b,c);return a<50?cM(a+1|0,b,c):l(cM,[0,b,c]);case -1:pf(b,c);return a<50?cM(a+1|0,b,c):l(cM,[0,b,c]);case -2:ho(b,c);return a<50?cM(a+1|0,b,c):l(cM,[0,b,c]);case -3:return a<50?cM(a+1|0,b,c):l(cM,[0,b,c]);default:return}h(c[1],c);f=e}}function -j5(a,b){return Ma(a,b,h3)}function -Ma(a,b,c){var +0:hz(b,c);return a<50?cT(a+1|0,b,c):l(cT,[0,b,c]);case +1:pU(b,c);return a<50?cT(a+1|0,b,c):l(cT,[0,b,c]);case +2:hz(b,c);return a<50?cT(a+1|0,b,c):l(cT,[0,b,c]);case +3:return a<50?cT(a+1|0,b,c):l(cT,[0,b,c]);default:return}h(c[1],c);f=e}}function +ko(a,b){return Nc(a,b,ia)}function +Nc(a,b,c){var e=c;for(;;){var d=be(bf,e,b);if(3>=d>>>0)switch(d){case -0:e$(a[1]);return pe(a,b);case -1:return ws(b,b[5],b[6]);case -2:return bO(MD,a,b);default:return b3(ME,a,b)}h(b[1],b);e=d}}function -Mb(a){return Mc(a,dm)}function -Mc(a,b){var +0:ek(a[1]);return pT(a,b);case +1:return xk(b,b[5],b[6]);case +2:return bS(NF,a,b);default:return b8(NG,a,b)}h(b[1],b);e=d}}function +Nd(a){return Ne(a,ds)}function +Ne(a,b){var d=b;for(;;){var -c=be(bf,d,a);if(0===c)throw g(j1,1);if(1===c)return;h(a[1],a);d=c}}function -Md(a,b){return Me(a,b,tH)}function -Me(a,b,c){var +c=be(bf,d,a);if(0===c)throw g(kk,1);if(1===c)return;h(a[1],a);d=c}}function +Nf(a,b){return Ng(a,b,uk)}function +Ng(a,b,c){var e=c;for(;;){var d=be(bf,e,b);if(3>=d>>>0)switch(d){case 0:return;case -1:throw g(j1,1);case -2:return bO(MF,a,b);default:return b3(MG,a,b)}h(b[1],b);e=d}}function -Mf(a){return Mg(a,rr)}function -Mg(a,b){var +1:throw g(kk,1);case +2:return bS(NH,a,b);default:return b8(NI,a,b)}h(b[1],b);e=d}}function +Nh(a){return Ni(a,r4)}function +Ni(a,b){var d=b;for(;;){var -c=be(bf,d,a);if(0===c)throw g(j3,1);if(1===c)return;h(a[1],a);d=c}}function -Mh(a,b){return Mi(a,b,pV)}function -Mi(a,b,c){var +c=be(bf,d,a);if(0===c)throw g(km,1);if(1===c)return;h(a[1],a);d=c}}function +Nj(a,b){return Nk(a,b,qz)}function +Nk(a,b,c){var e=c;for(;;){var d=be(bf,e,b);if(3>=d>>>0)switch(d){case 0:return;case -1:throw g(j3,1);case -2:return bO(MH,a,b);default:return b3(MI,a,b)}h(b[1],b);e=d}}function -Mj(a){return Mk(a,rE)}function -Mk(a,b){var +1:throw g(km,1);case +2:return bS(NJ,a,b);default:return b8(NK,a,b)}h(b[1],b);e=d}}function +Nl(a){return Nm(a,sf)}function +Nm(a,b){var d=b;for(;;){var -c=be(bf,d,a);if(0===c)throw g(j2,1);if(1===c)return;h(a[1],a);d=c}}function -Ml(a,b){return Mm(a,b,tp)}function -Mm(a,b,c){var +c=be(bf,d,a);if(0===c)throw g(kl,1);if(1===c)return;h(a[1],a);d=c}}function +Nn(a,b){return No(a,b,t4)}function +No(a,b,c){var e=c;for(;;){var d=be(bf,e,b);if(3>=d>>>0)switch(d){case 0:return;case -1:throw g(j2,1);case -2:return bO(MJ,a,b);default:return b3(MK,a,b)}h(b[1],b);e=d}}function -ph(a,b){return Mn(a,b,rP)}function -Mn(a,b,c){var +1:throw g(kl,1);case +2:return bS(NL,a,b);default:return b8(NM,a,b)}h(b[1],b);e=d}}function +pW(a,b){return Np(a,b,sp)}function +Np(a,b,c){var e=c;for(;;){var d=be(bf,e,b);if(2>=d>>>0)switch(d){case 0:return;case -1:return bO(ML,a,b);default:return b3(MM,a,b)}h(b[1],b);e=d}}function -MN(a,b){a5(a,b);var -c=1-pg(b);return c?bO(MO,a,b):c}function -MP(a,b,c){var -d=b?b[1]:0;a5(a,c);if(pg(c))throw g(o9,1);var -e=dg(a,c);if(1-d)MN(a,c);return e}var -MT=[B,MS,ar(0)];function -MU(a){if(typeof -a==="number")return MV;var -b=a[1];return fO<=b?bu===b?MW:928231259<=b?J<=b?MX:MY:r<=b?MZ:M0:dU===b?M1:bg<=b?fV<=b?M2:M3:cX<=b?M4:M5}function -pi(a,b){throw g([0,MT,a1(a,MU(b)),b],1)}function -pj(a){if(typeof -a!=="number"&&n===a[1])return a[2];return pi(M8,a)}function -MQ(a,b,c,d){try{var -f=wr(0,d),h=MP(K7(a,b,c,0),0,f);return h}catch(f){var -e=P(f);if(e===o9)return hn(MR);throw g(e,0)}}function -M6(a){if(typeof -a!=="number"&&J===a[1])return a[2];return pi(M7,a)}function -ab(a){return[0,n,a]}function -j6(a){return[0,cX,a]}function -hp(a,b){return b?h(a,b[1]):cP}function -fw(a,b){return[0,r,a_(lW(a,b))]}var -dh=[0,1],M_=[B,M9,ar(0)];function -b4(a,b){throw g([0,M_,[0,dy,a],b],1)}function -ac(a){if(typeof -a!=="number"&&n===a[1])return a[2];return b4(M$,a)}function -j7(a){if(typeof -a!=="number"&&cX===a[1])return a[2];return b4(Na,a)}function -hq(a,b){return cP===b?0:[0,h(a,b)]}function -fx(a,b){if(typeof -b!=="number"&&r===b[1])return a_(lW(a,b[2]));return b4(Nb,b)}function -I(a,b){return b4(a1(a,Nc),b)}function -pk(a,b){return b4(a1(a,Nh),b)}function -pl(a,b){return b4(a1(a,Ni),b)}function -pm(a,b){return b4(a1(a,Nj),b)}function -pn(a,b,c,d){var -e=l7(Nk,a_(c));return b4(a6(t(Nl),b,a,e),d)}function -bP(a,b,c){return pn(Nm,a,b,c)}function -bQ(a,b,c){return pn(Nn,a,b,c)}function -No(a,b){var -d=a,c=b;for(;;){if(!c)return l7(Np,a_(d));var +1:return bS(NN,a,b);default:return b8(NO,a,b)}h(b[1],b);e=d}}function +NP(a,b){a6(a,b);var +c=1-pV(b);return c?bS(NQ,a,b):c}function +NR(a,b,c){var +d=b?b[1]:0;a6(a,c);if(pV(c))throw g(pM,1);var +e=dl(a,c);if(1-d)NP(a,c);return e}var +NV=[B,NU,ar(0)];function +NW(a){if(typeof +a==="number")return NX;var +b=a[1];return fX<=b?bx===b?NY:928231259<=b?J<=b?NZ:N0:r<=b?N1:N2:d3===b?N3:bg<=b?f4<=b?N4:N5:c5<=b?N6:N7}function +pX(a,b){throw g([0,NV,a$(a,NW(b)),b],1)}function +pY(a){if(typeof +a!=="number"&&n===a[1])return a[2];return pX(N_,a)}function +NS(a,b,c,d){try{var +f=xj(0,d),h=NR(L9(a,b,c,0),0,f);return h}catch(f){var +e=P(f);if(e===pM)return hy(NT);throw g(e,0)}}function +N8(a){if(typeof +a!=="number"&&J===a[1])return a[2];return pX(N9,a)}function +aa(a){return[0,n,a]}function +kp(a){return[0,c5,a]}function +hA(a,b){return b?h(a,b[1]):cW}function +fG(a,b){return[0,r,bz(mn(a,b))]}var +dm=[0,1],Oa=[B,N$,ar(0)];function +b9(a,b){throw g([0,Oa,[0,dH,a],b],1)}function +ab(a){if(typeof +a!=="number"&&n===a[1])return a[2];return b9(Ob,a)}function +kq(a){if(typeof +a!=="number"&&c5===a[1])return a[2];return b9(Oc,a)}function +hB(a,b){if(typeof +b==="number"&&cW===b)return 0;return[0,h(a,b)]}function +fH(a,b){if(typeof +b!=="number"&&r===b[1])return bz(mn(a,b[2]));return b9(Od,b)}function +I(a,b){return b9(a$(a,Oe),b)}function +pZ(a,b){return b9(a$(a,Oj),b)}function +p0(a,b){return b9(a$(a,Ok),b)}function +p1(a,b){return b9(a$(a,Ol),b)}function +p2(a,b,c,d){var +e=mw(Om,bz(c));return b9(a7(t(On),b,a,e),d)}function +bT(a,b,c){return p2(Oo,a,b,c)}function +bU(a,b,c){return p2(Op,a,b,c)}function +Oq(a,b){var +d=a,c=b;for(;;){if(!c)return mw(Or,bz(d));var e=c[1];if(e[1]){d=[0,e[2],d];c=c[2]}else c=c[2]}}function -b5(a,b,c){var -d=No(0,c);return b4(i(t(Nq),a,d),b)}function -bR(a,b){return b4(a1(a,Nr),b)}function -Nd(a,b,c){return b4(i(t(Ne),a,b),c)}function -Nf(a,b){return b4(a1(a,Ng),b)}function +b_(a,b,c){var +d=Oq(0,c);return b9(i(t(Os),a,d),b)}function +bV(a,b){return b9(a$(a,Ot),b)}function +Of(a,b,c){return b9(i(t(Og),a,b),c)}function +Oh(a,b){return b9(a$(a,Oi),b)}function b(a){return a[1]}function -Nt(a){if(typeof +Ov(a){if(typeof a!=="number"&&J===a[1]){var e=[0,0],f=[0,0],j=[0,0],g=[0,0],c=[0,0],d=[0,0];(function(a){var h=a;for(;;){if(!h)return;var -k=h[1],i=k[2],d=k[1],l=h[2];if(d!==eL)if(d!==cV)if(d!==eH){if(d===r1)if(b(j))c[1]=[0,d,b(c)];else -j[1]=[0,hq(ac,i)]}else if(b(f))c[1]=[0,d,b(c)];else -f[1]=[0,ac(i)];else if(b(e))c[1]=[0,d,b(c)];else -e[1]=[0,ac(i)];else if(b(g))c[1]=[0,d,b(c)];else -g[1]=[0,ac(i)];h=l}}(a[2]));if(b(c))return bP(hr,b(c),a);if(b(d))return bQ(hr,b(d),a);var +k=h[1],i=k[2],d=k[1],l=h[2];if(d!==eX)if(d!==c3)if(d!==eT){if(d===sB)if(b(j))c[1]=[0,d,b(c)];else +j[1]=[0,hB(ab,i)]}else if(b(f))c[1]=[0,d,b(c)];else +f[1]=[0,ab(i)];else if(b(e))c[1]=[0,d,b(c)];else +e[1]=[0,ab(i)];else if(b(g))c[1]=[0,d,b(c)];else +g[1]=[0,ab(i)];h=l}}(a[2]));if(b(c))return bT(hC,b(c),a);if(b(d))return bU(hC,b(d),a);var h=b(e),i=b(f),k=b(j),l=b(g);if(h&&i&&l){var m=l[1],n=i[1],o=h[1],p=k?k[1]:0;return[0,o,n,p,m]}var -q=[0,[0,0===b(g)?1:0,Nu],0],r=[0,[0,0===b(f)?1:0,Nv],q];return b5(hr,a,[0,[0,0===b(e)?1:0,Nw],r])}return bR(hr,a)}function -Nx(a){var -b=a[3],c=a[2],d=a[1],e=[0,[0,Ny,ab(a[4])],0],f=[0,[0,Nz,hp(ab,b)],e],g=[0,[0,NA,ab(c)],f];return[0,J,[0,[0,NB,ab(d)],g]]}function -NT(a){return fn(function(a){var -b=a[1];return[0,b,pj(a[2])]},M6(a))}function -NU(a){return[0,J,fn(function(a){return[0,a[1],[0,n,a[2]]]},a)]}function -NV(a){if(typeof +q=[0,[0,0===b(g)?1:0,Ow],0],r=[0,[0,0===b(f)?1:0,Ox],q];return b_(hC,a,[0,[0,0===b(e)?1:0,Oy],r])}return bV(hC,a)}function +Oz(a){var +b=a[3],c=a[2],d=a[1],e=[0,[0,OA,aa(a[4])],0],f=[0,[0,OB,hA(aa,b)],e],g=[0,[0,OC,aa(c)],f];return[0,J,[0,[0,OD,aa(d)],g]]}function +OV(a){return cj(function(a){var +b=a[1];return[0,b,pY(a[2])]},N8(a))}function +OW(a){return[0,J,cj(function(a){return[0,a[1],[0,n,a[2]]]},a)]}function +OX(a){if(typeof a!=="number"&&J===a[1]){var e=[0,0],f=[0,0],c=[0,0],g=[0,0];(function(a){var h=a;for(;;){if(!h)return;var -i=h[1],j=i[2],d=i[1],k=h[2];if(d!==eL)if(d!==cV){if(b(dh))g[1]=[0,d,b(g)]}else if(b(e))c[1]=[0,d,b(c)];else -e[1]=[0,ac(j)];else if(b(f))c[1]=[0,d,b(c)];else -f[1]=[0,ac(j)];h=k}}(a[2]));if(b(c))return bP(hu,b(c),a);if(b(g))return bQ(hu,b(g),a);var +i=h[1],j=i[2],d=i[1],k=h[2];if(d!==eX)if(d!==c3){if(b(dm))g[1]=[0,d,b(g)]}else if(b(e))c[1]=[0,d,b(c)];else +e[1]=[0,ab(j)];else if(b(f))c[1]=[0,d,b(c)];else +f[1]=[0,ab(j)];h=k}}(a[2]));if(b(c))return bT(hF,b(c),a);if(b(g))return bU(hF,b(g),a);var d=b(e),h=b(f);if(d&&h)return[0,d[1],h[1]];var -i=[0,[0,0===b(f)?1:0,NW],0];return b5(hu,a,[0,[0,0===b(e)?1:0,NX],i])}return bR(hu,a)}function -NY(a){var -b=a[1],c=[0,[0,NZ,ab(a[2])],0];return[0,J,[0,[0,N0,ab(b)],c]]}function -N1(a){if(typeof +i=[0,[0,0===b(f)?1:0,OY],0];return b_(hF,a,[0,[0,0===b(e)?1:0,OZ],i])}return bV(hF,a)}function +O0(a){var +b=a[1],c=[0,[0,O1,aa(a[2])],0];return[0,J,[0,[0,O2,aa(b)],c]]}function +O3(a){if(typeof a!=="number"&&J===a[1]){var e=[0,0],c=[0,0],d=[0,0];(function(a){var d=a;for(;;){if(!d)return;var -f=d[1],g=f[1],h=d[2],i=f[2];if(g===uc)if(b(e))c[1]=[0,g,b(c)];else -e[1]=[0,NT(i)];d=h}}(a[2]));return b(c)?bP(j8,b(c),a):b(d)?bQ(j8,b(d),a):[0,b(e)]}return bR(j8,a)}function -N2(a){var -b=a[1],c=0,d=b?[0,[0,N3,NU(b[1])],c]:c;return[0,J,d]}function -N4(a){if(typeof +f=d[1],g=f[1],h=d[2],i=f[2];if(g===uQ)if(b(e))c[1]=[0,g,b(c)];else +e[1]=[0,OV(i)];d=h}}(a[2]));return b(c)?bT(kr,b(c),a):b(d)?bU(kr,b(d),a):[0,b(e)]}return bV(kr,a)}function +O4(a){var +b=a[1],c=0,d=b?[0,[0,O5,OW(b[1])],c]:c;return[0,J,d]}function +O6(a){if(typeof a!=="number"&&r===a[1]){var -b=a[2];if(!b)return pl(D,a);var +b=a[2];if(!b)return p0(D,a);var d=b[1];if(typeof d!=="number"){var e=d[1];if(n===e){var -c=d[2],f=e0(c,sy);if(0<=f){if(0>=f)return b[2]?I(D,a):18;var -g=e0(c,ql);if(0<=g){if(0>=g)return b[2]?I(D,a):28;if(c===rj)return b[2]?I(D,a):29;if(c===sq)return b[2]?I(D,a):30;if(c===q5)return b[2]?I(D,a):31;if(c===rT)return b[2]?I(D,a):32;if(c===qp)return b[2]?I(D,a):33;if(c===qt)return b[2]?I(D,a):34;if(c===tw)return b[2]?I(D,a):35;if(c===qR)return b[2]?I(D,a):36}else{if(c===rs)return b[2]?I(D,a):19;if(c===p1)return b[2]?I(D,a):20;if(c===tK)return b[2]?I(D,a):21;if(c===tI)return b[2]?I(D,a):22;if(c===qd)return b[2]?I(D,a):23;if(c===tn)return b[2]?I(D,a):24;if(c===se)return b[2]?I(D,a):25;if(c===t7)return b[2]?I(D,a):26;if(c===qB)return b[2]?I(D,a):27}}else{var -h=e0(c,tT);if(0<=h){if(0>=h)return b[2]?I(D,a):9;if(c===tX)return b[2]?I(D,a):10;if(c===r4)return b[2]?I(D,a):11;if(c===ue)return b[2]?I(D,a):12;if(c===qi)return b[2]?I(D,a):13;if(c===qo)return b[2]?I(D,a):14;if(c===t$)return b[2]?I(D,a):15;if(c===tf)return b[2]?I(D,a):16;if(c===qV)return b[2]?I(D,a):17}else{if(c===ud)return b[2]?I(D,a):0;if(c===tM)return b[2]?I(D,a):1;if(c===rN)return b[2]?I(D,a):2;if(c===rg)return b[2]?I(D,a):3;if(c===qw)return b[2]?I(D,a):4;if(c===qI)return b[2]?I(D,a):5;if(c===rw)return b[2]?I(D,a):6;if(c===qU)return b[2]?I(D,a):7;if(c===sF)return b[2]?I(D,a):8}}}else if(r===e)return pk(D,a)}}return pm(D,a)}function -N5(a){switch(a){case -0:return N6;case -1:return N7;case -2:return N8;case -3:return N9;case -4:return N_;case -5:return N$;case -6:return Oa;case -7:return Ob;case -8:return Oc;case -9:return Od;case -10:return Oe;case -11:return Of;case -12:return Og;case -13:return Oh;case -14:return Oi;case -15:return Oj;case -16:return Ok;case -17:return Ol;case -18:return Om;case -19:return On;case -20:return Oo;case -21:return Op;case -22:return Oq;case -23:return Or;case -24:return Os;case -25:return Ot;case -26:return Ou;case -27:return Ov;case -28:return Ow;case -29:return Ox;case -30:return Oy;case -31:return Oz;case -32:return OA;case -33:return OB;case -34:return OC;case -35:return OD;default:return OE}}function -OF(a){return N4([0,r,[0,[0,n,pj(a)],0]])}function -OG(a){var -b=N5(a);if(typeof +c=d[2],f=e$(c,s$);if(0<=f){if(0>=f)return b[2]?I(D,a):18;var +g=e$(c,q1);if(0<=g){if(0>=g)return b[2]?I(D,a):28;if(c===rW)return b[2]?I(D,a):29;if(c===s3)return b[2]?I(D,a):30;if(c===rG)return b[2]?I(D,a):31;if(c===st)return b[2]?I(D,a):32;if(c===q4)return b[2]?I(D,a):33;if(c===q8)return b[2]?I(D,a):34;if(c===t$)return b[2]?I(D,a):35;if(c===rt)return b[2]?I(D,a):36}else{if(c===r5)return b[2]?I(D,a):19;if(c===qF)return b[2]?I(D,a):20;if(c===un)return b[2]?I(D,a):21;if(c===ul)return b[2]?I(D,a):22;if(c===qT)return b[2]?I(D,a):23;if(c===t2)return b[2]?I(D,a):24;if(c===sR)return b[2]?I(D,a):25;if(c===uJ)return b[2]?I(D,a):26;if(c===re)return b[2]?I(D,a):27}}else{var +h=e$(c,uv);if(0<=h){if(0>=h)return b[2]?I(D,a):9;if(c===uy)return b[2]?I(D,a):10;if(c===sE)return b[2]?I(D,a):11;if(c===uS)return b[2]?I(D,a):12;if(c===qY)return b[2]?I(D,a):13;if(c===q3)return b[2]?I(D,a):14;if(c===uN)return b[2]?I(D,a):15;if(c===tU)return b[2]?I(D,a):16;if(c===rw)return b[2]?I(D,a):17}else{if(c===uR)return b[2]?I(D,a):0;if(c===up)return b[2]?I(D,a):1;if(c===sn)return b[2]?I(D,a):2;if(c===rT)return b[2]?I(D,a):3;if(c===q$)return b[2]?I(D,a):4;if(c===rl)return b[2]?I(D,a):5;if(c===r9)return b[2]?I(D,a):6;if(c===rv)return b[2]?I(D,a):7;if(c===th)return b[2]?I(D,a):8}}}else if(r===e)return pZ(D,a)}}return p1(D,a)}function +O7(a){switch(a){case +0:return O8;case +1:return O9;case +2:return O_;case +3:return O$;case +4:return Pa;case +5:return Pb;case +6:return Pc;case +7:return Pd;case +8:return Pe;case +9:return Pf;case +10:return Pg;case +11:return Ph;case +12:return Pi;case +13:return Pj;case +14:return Pk;case +15:return Pl;case +16:return Pm;case +17:return Pn;case +18:return Po;case +19:return Pp;case +20:return Pq;case +21:return Pr;case +22:return Ps;case +23:return Pt;case +24:return Pu;case +25:return Pv;case +26:return Pw;case +27:return Px;case +28:return Py;case +29:return Pz;case +30:return PA;case +31:return PB;case +32:return PC;case +33:return PD;case +34:return PE;case +35:return PF;default:return PG}}function +PH(a){return O6([0,r,[0,[0,n,pY(a)],0]])}function +PI(a){var +b=O7(a);if(typeof b!=="number"&&r===b[1]){var -c=b[2];if(c&&!c[2])return c[1]}throw g([0,f,OH],1)}var -po=[0,0];function -Ns(a){return a?"POST":"GET"}function -O9(a,b){if(a)var -d=a[1],c=h(t(O_),d);else +c=b[2];if(c&&!c[2])return c[1]}throw g([0,f,PJ],1)}var +p3=[0,0];function +Ou(a){return a?"POST":"GET"}function +P$(a,b){if(a)var +d=a[1],c=h(t(Qa),d);else var -c=Pb;var -e=eq(po[1],O$);return i(t(Pa),e,c)}function -NC(a){if(typeof +c=Qd;var +e=eC(p3[1],Qb);return i(t(Qc),e,c)}function +OE(a){if(typeof a!=="number"&&J===a[1]){var e=[0,0],f=[0,0],c=[0,0],g=[0,0];(function(a){var h=a;for(;;){if(!h)return;var -i=h[1],j=i[2],d=i[1],k=h[2];if(d!==sg)if(d!==q9){if(b(dh))g[1]=[0,d,b(g)]}else if(b(e))c[1]=[0,d,b(c)];else -e[1]=[0,ac(j)];else if(b(f))c[1]=[0,d,b(c)];else -f[1]=[0,ac(j)];h=k}}(a[2]));if(b(c))return bP(hs,b(c),a);if(b(g))return bQ(hs,b(g),a);var +i=h[1],j=i[2],d=i[1],k=h[2];if(d!==sT)if(d!==rK){if(b(dm))g[1]=[0,d,b(g)]}else if(b(e))c[1]=[0,d,b(c)];else +e[1]=[0,ab(j)];else if(b(f))c[1]=[0,d,b(c)];else +f[1]=[0,ab(j)];h=k}}(a[2]));if(b(c))return bT(hD,b(c),a);if(b(g))return bU(hD,b(g),a);var d=b(e),h=b(f);if(d&&h)return[0,d[1],h[1]];var -i=[0,[0,0===b(f)?1:0,ND],0];return b5(hs,a,[0,[0,0===b(e)?1:0,NE],i])}return bR(hs,a)}function -NF(a){var -b=a[1],c=[0,[0,NG,ab(a[2])],0];return[0,J,[0,[0,NH,ab(b)],c]]}function -NI(a){if(typeof +i=[0,[0,0===b(f)?1:0,OF],0];return b_(hD,a,[0,[0,0===b(e)?1:0,OG],i])}return bV(hD,a)}function +OH(a){var +b=a[1],c=[0,[0,OI,aa(a[2])],0];return[0,J,[0,[0,OJ,aa(b)],c]]}function +OK(a){if(typeof a!=="number"&&J===a[1]){var e=[0,0],f=[0,0],g=[0,0],c=[0,0],d=[0,0];(function(a){var h=a;for(;;){if(!h)return;var -j=h[1],i=j[2],d=j[1],k=h[2];if(d!==t6)if(d!==eH){if(d===sk)if(b(e))c[1]=[0,d,b(c)];else -e[1]=[0,Nt(i)]}else if(b(g))c[1]=[0,d,b(c)];else -g[1]=[0,ac(i)];else if(b(f))c[1]=[0,d,b(c)];else -f[1]=[0,ac(i)];h=k}}(a[2]));if(b(c))return bP(ht,b(c),a);if(b(d))return bQ(ht,b(d),a);var +j=h[1],i=j[2],d=j[1],k=h[2];if(d!==uI)if(d!==eT){if(d===sX)if(b(e))c[1]=[0,d,b(c)];else +e[1]=[0,Ov(i)]}else if(b(g))c[1]=[0,d,b(c)];else +g[1]=[0,ab(i)];else if(b(f))c[1]=[0,d,b(c)];else +f[1]=[0,ab(i)];h=k}}(a[2]));if(b(c))return bT(hE,b(c),a);if(b(d))return bU(hE,b(d),a);var h=b(e),i=b(f),j=b(g);if(h&&i&&j)return[0,h[1],i[1],j[1]];var -k=[0,[0,0===b(g)?1:0,NJ],0],l=[0,[0,0===b(f)?1:0,NK],k];return b5(ht,a,[0,[0,0===b(e)?1:0,NL],l])}return bR(ht,a)}function -NM(a){var -b=a[2],c=a[1],d=[0,[0,NN,ab(a[3])],0],e=[0,[0,NO,ab(b)],d];return[0,J,[0,[0,NP,Nx(c)],e]]}var -NQ=1;function -NR(a){return NS}function -OI(a){if(typeof +k=[0,[0,0===b(g)?1:0,OL],0],l=[0,[0,0===b(f)?1:0,OM],k];return b_(hE,a,[0,[0,0===b(e)?1:0,ON],l])}return bV(hE,a)}function +OO(a){var +b=a[2],c=a[1],d=[0,[0,OP,aa(a[3])],0],e=[0,[0,OQ,aa(b)],d];return[0,J,[0,[0,OR,Oz(c)],e]]}var +OS=1;function +OT(a){return OU}function +PK(a){if(typeof a!=="number"&&J===a[1]){var f=[0,0],l=[0,0],g=[0,0],m=[0,0],n=[0,0],o=[0,0],h=[0,0],i=[0,0],j=[0,0],p=[0,0],q=[0,0],c=[0,0],d=[0,0];(function(a){var k=a;for(;;){if(!k)return;var -r=k[1],e=r[2],d=r[1],s=e0(d,cV);a:b:{var -t=k[2];if(0<=s)if(0",gS="([^/]+)",gR=759637122,d9="jsError",gy=103,cr='"',al=0xffff,ec=127,gx=0xdc00,gQ="documentElement",hu="Sys_blocked_io",b="vendor/lwd/lib/lwd/lwd.ml",gw="buffer.ml",ht="_",hd="rem",cx="_bigarr02";function -sf(a,b,c,d,e){if(d<=b)for(var +bj=3850876,am=" ",R="0",ez="compare: functional value",ey="mkdir",bR=1000,M="vendor/lwd/lib/lwd/lwd_seq.pp.ml",ia="@[",h$="window",iy="console",ax="int_of_string",eo="fs",hW="%u",h_="/static/",hx="%i",ix="%ni",aw=0xff,h9="Assert_failure",hw="0x",hV=0x7ff0,iw=218,hv=0xdfff,hU="End_of_file",h8="OCAMLRUNPARAM",hu=": closedir failed",h7=253,iu=19067,iv="Out_of_memory",ht="Not_found",eC="Failure",cU="Unix.Unix_error",hs="style",bl=244,hT="^",it="length",eu="ENOTDIR",h6="Lwd_seq.rank: node is marked",hr="%Li",hq="Invalid_argument",cO=254,bk="+",cP="Set.bal",is=", characters ",al=0xffffff,hS=858694086,h5=120,h4=1027,bQ=1024,cT="Map.bal",bm=246,hR="Pervasives.do_at_exit",h3=389604418,hQ=65536,et=0xf,hp=", ",en=512,iq="Match_failure",ir="closedir",hn="%li",ho=1026,em="nan",e="",el="rmdir",ex="Fatal error: exception ",hP="infinity",C="camlinternalFormat.ml",hN=571,hO="fd ",io="append",ip=": ",hm=174,c=248,hM="em",im=0xe0,aK=24029,hL=0xf0,hK="Sys_error",ad=0x80,h2="ENOTEMPTY",il="EEXIST",ew=1255,ek=" : flags Open_text and Open_binary are not compatible",ik="px",es="e",ej=": Not a directory",er="ENOENT",h1="Stack_overflow",ij="Undefined_recursive_module",ii=2147483647,ag=0x8000,h0="a",hJ=0x800,hZ=-48,hl=" : is a directory",hH="@{",hI="Division_by_zero",hk="classList",aJ=".",hG="(Program not linked with -g, cannot print stack backtrace)\n",aL=0x3f,eq=" : file already exists",bP=128,cS=": No such file or directory",hE="vendor/lwd/lib/brr-lwd/elwd.ml",hF=255,cN="lwd-to-remove",cR=256,ep=100,hD="id",ei="index out of bounds",an="/",cM=252,ih="height: ",hj="lwdui-virtual-table-row",eh="%d",hi=": file descriptor already closed",aY="-",eg="EBADF",hC=-97,ig="Printexc.handle_uncaught_exception",hh=12520,eB=" : flags Open_rdonly and Open_wronly are not compatible",a="vendor/lwd/lib/lwd/lwd_table.ml",hY="Fatal error: exception %s\n",ie="class",aI=250,hB=199,id=">",hA="([^/]+)",hz=759637122,ev="jsError",hg=103,cL='"',eA=127,ah=0xffff,hf=0xdc00,hy="documentElement",ic="Sys_blocked_io",b="vendor/lwd/lib/lwd/lwd.ml",ib="_",hX="rem",cQ="_bigarr02";function +to(a,b,c,d,e){if(d<=b)for(var f=1;f<=e;f++)c[d+f]=a[b+f];else for(var f=e;f>=1;f--)c[d+f]=a[b+f];return 0}function -sg(a,b,c){var +tp(a,b,c){var d=new Array(c+1);d[0]=0;for(var e=1,f=b+1;e<=c;e++,f++)d[e]=a[f];return d}function -bO(a,b,c){var +eD(a,b,c){if(a[1]===b){a[1]=c;return 1}return 0}function +tq(a,b){var +c=a[1];a[1]+=b;return c}function +eE(a){return a[1]}function +jb(a){var +b=m.process;if(b&&b.env&&b.env[a]!=undefined)return b.env[a];if(m.jsoo_static_env&&m.jsoo_static_env[a])return m.jsoo_static_env[a]}var +eX=0;(function(){var +c=jb(h8);if(c!==undefined){var +b=c.split(",");for(var +a=0;aa.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.lo>24),c=-this.hi+(b>>24);return new +d(a,b,c)};d.prototype.add=function(a){var +b=this.lo+a.lo,c=this.mi+a.mi+(b>>24),e=this.hi+a.hi+(c>>24);return new +d(b,c,e)};d.prototype.sub=function(a){var +b=this.lo-a.lo,c=this.mi-a.mi+(b>>24),e=this.hi-a.hi+(c>>24);return new +d(b,c,e)};d.prototype.mul=function(a){var +b=this.lo*a.lo,c=(b*iS|0)+this.mi*a.lo+this.lo*a.mi,e=(c*iS|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new +d(b,c,e)};d.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};d.prototype.isNeg=function(){return this.hi<<16<0};d.prototype.and=function(a){return new +d(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};d.prototype.or=function(a){return new +d(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};d.prototype.xor=function(a){return new +d(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};d.prototype.shift_left=function(a){a=a&63;if(a==0)return this;if(a<24)return new +d(this.lo<>24-a,this.hi<>24-a);if(a<48)return new +d(0,this.lo<>48-a);return new +d(0,0,this.lo<>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a);if(a<48)return new +d(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0);return new +d(this.hi>>a-48,0,0)};d.prototype.shift_right=function(a){a=a&63;if(a==0)return this;var +c=this.hi<<16>>16;if(a<24)return new +d(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var +b=this.hi<<16>>31;if(a<48)return new +d(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&ah);return new +d(this.hi<<16>>a-32,b,b)};d.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&al;this.lo=this.lo<<1&al};d.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&al;this.mi=(this.mi>>>1|this.hi<<23)&al;this.hi=this.hi>>>1};d.prototype.udivmod=function(a){var +e=0,c=this.copy(),b=a.copy(),f=new +d(0,0,0);while(c.ucompare(b)>0){e++;b.lsl1()}while(e>=0){e--;f.lsl1();if(c.ucompare(b)>=0){f.lo++;c=c.sub(b)}b.lsr1()}return{quotient:f,modulus:c}};d.prototype.div=function(a){var +b=this;if(a.isZero())i8();var +d=b.hi^a.hi;if(b.hi&ag)b=b.neg();if(a.hi&ag)a=a.neg();var +c=b.udivmod(a).quotient;if(d&ag)c=c.neg();return c};d.prototype.mod=function(a){var +b=this;if(a.isZero())i8();var +d=b.hi;if(b.hi&ag)b=b.neg();if(a.hi&ag)a=a.neg();var +c=b.udivmod(a).modulus;if(d&ag)c=c.neg();return c};d.prototype.toInt=function(){return this.lo|this.mi<<24};d.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};d.prototype.toArray=function(){return[this.hi>>8,this.hi&aw,this.mi>>16,this.mi>>8&aw,this.mi&aw,this.lo>>16,this.lo>>8&aw,this.lo&aw]};d.prototype.lo32=function(){return this.lo|(this.mi&aw)<<24};d.prototype.hi32=function(){return this.mi>>>8&ah|this.hi<<16};function +tS(a,b){return new +d(a&al,a>>>24&aw|(b&ah)<<8,b>>>16&ah)}function +eQ(a){return a.hi32()}function +eR(a){return a.lo32()}function +bT(){A(ei)}var +ts=cQ;function +aM(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}aM.prototype.caml_custom=ts;aM.prototype.offset=function(a){var +c=0;if(typeof +a==="number")a=[a];if(!(a +instanceof +Array))A("bigarray.js: invalid offset");if(this.dims.length!=a.length)A("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var +b=0;b=this.dims[b])bT();c=c*this.dims[b]+a[b]}else +for(var +b=this.dims.length-1;b>=0;b--){if(a[b]<1||a[b]>this.dims[b])bT();c=c*this.dims[b]+(a[b]-1)}return c};aM.prototype.get=function(a){switch(this.kind){case +7:var +d=this.data[a*2+0],b=this.data[a*2+1];return tS(d,b);case +10:case +11:var +e=this.data[a*2+0],c=this.data[a*2+1];return[cO,e,c];default:return this.data[a]}};aM.prototype.set=function(a,b){switch(this.kind){case +7:this.data[a*2+0]=eR(b);this.data[a*2+1]=eQ(b);break;case +10:case +11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};aM.prototype.fill=function(a){switch(this.kind){case +7:var +c=eR(a),e=eQ(a);if(c==e)this.data.fill(c);else +for(var +b=0;be)return 1;if(d!=e){if(!b)return NaN;if(d==d)return 1;if(e==e)return-1}}break;case +7:for(var +c=0;ca.data[c+1])return 1;if(this.data[c]>>>0>>0)return-1;if(this.data[c]>>>0>a.data[c]>>>0)return 1}break;case +2:case +3:case +4:case +5:case +6:case +8:case +9:case +12:for(var +c=0;ca.data[c])return 1}break}return 0};function +bn(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}bn.prototype=new +aM();bn.prototype.offset=function(a){if(typeof +a!=="number")if(a +instanceof +Array&&a.length==1)a=a[0];else +A("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])bT();return a};bn.prototype.get=function(a){return this.data[a]};bn.prototype.set=function(a,b){this.data[a]=b;return 0};bn.prototype.fill=function(a){this.data.fill(a);return 0};function +eF(a,b,c,d){var +e=iD(a);if(cW(c)*e!=d.length)A("length doesn't match dims");if(b==0&&c.length==1&&e==1)return new +bn(a,b,c,d);return new +aM(a,b,c,d)}function +iX(a){return a.slice(1)}function +tr(a,b,c){var +d=iX(c),e=iB(a,cW(d));return eF(a,b,d,e)}function +bU(a,b,c){a.set(a.offset(b),c);return 0}function +b1(a,b,c){var d=String.fromCharCode;if(b==0&&c<=4096&&c==a.length)return d.apply(null,a);var -e=j;for(;0=c.l||c.t==2&&e>=c.c.length)){c.c=a.t==4?bO(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else if(c.t==2&&d==c.c.length){c.c+=a.t==4?bO(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else{if(c.t!=4)cG(c);var +aN(a,b,c,d,e){if(e==0)return 0;if(d==0&&(e>=c.l||c.t==2&&e>=c.c.length)){c.c=a.t==4?b1(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else if(c.t==2&&d==c.c.length){c.c+=a.t==4?b1(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else{if(c.t!=4)c0(c);var g=a.c,h=c.c;if(a.t==4)if(d<=b)for(var f=0;f=0;f--)h[d+f]=g[b+f];else{var i=Math.min(e,g.length-b);for(var f=0;f>=1;if(a==0)return d;b+=b;c++;if(c==9)b.slice(0,1)}}function -bI(a){if(a.t==2)a.c+=bi(a.l-a.c.length,"\0");else -a.c=bO(a.c,0,a.c.length);a.t=0}function -ez(a){if(a.length<24){for(var -b=0;bec)return false;return true}else +br(a,b){if(a==0)return e;if(b.repeat)return b.repeat(a);var +d=e,c=0;for(;;){if(a&1)d+=b;a>>=1;if(a==0)return d;b+=b;c++;if(c==9)b.slice(0,1)}}function +bX(a){if(a.t==2)a.c+=br(a.l-a.c.length,"\0");else +a.c=b1(a.c,0,a.c.length);a.t=0}function +e0(a){if(a.length<24){for(var +b=0;beA)return false;return true}else return!/[^\x00-\x7f]/.test(a)}function -ig(a){for(var -k=j,d=j,g,f,h,b,c=0,i=a.length;cd1){d.substr(0,1);k+=d;d=j;k+=a.slice(c,e)}else -d+=a.slice(c,e);if(e==i)break;c=e}b=1;if(++c=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c0x10ffff)b=3}}}}}if(b<4){c-=b;d+="\ufffd"}else if(b>al)d+=String.fromCharCode(0xd7c0+(b>>10),gx+(b&0x3FF));else -d+=String.fromCharCode(b);if(d.length>bC){d.substr(0,1);k+=d;d=j}}return k+d}function -aw(a,b,c){this.t=a;this.c=b;this.l=c}aw.prototype.toString=function(){switch(this.t){case -9:return this.c;default:bI(this);case -0:if(ez(this.c)){this.t=9;return this.c}this.t=8;case -8:return this.c}};aw.prototype.toUtf16=function(){var -a=this.toString();if(this.t==9)return a;return ig(a)};aw.prototype.slice=function(){var +i$(a){for(var +k=e,d=e,h,g,i,b,c=0,j=a.length;cen){d.substr(0,1);k+=d;d=e;k+=a.slice(c,f)}else +d+=a.slice(c,f);if(f==j)break;c=f}b=1;if(++c=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c0x10ffff)b=3}}}}}if(b<4){c-=b;d+="\ufffd"}else if(b>ah)d+=String.fromCharCode(0xd7c0+(b>>10),hf+(b&0x3FF));else +d+=String.fromCharCode(b);if(d.length>bQ){d.substr(0,1);k+=d;d=e}}return k+d}function +ay(a,b,c){this.t=a;this.c=b;this.l=c}ay.prototype.toString=function(){switch(this.t){case +9:return this.c;default:bX(this);case +0:if(e0(this.c)){this.t=9;return this.c}this.t=8;case +8:return this.c}};ay.prototype.toUtf16=function(){var +a=this.toString();if(this.t==9)return a;return i$(a)};ay.prototype.slice=function(){var a=this.t==4?this.c.slice():this.c;return new -aw(this.t,a,this.l)};function -hY(a){return new -aw(0,a,a.length)}function -an(a){return a}function -aW(a){return hY(an(a))}function -bG(a,b,c,d,e){ax(aW(a),b,c,d,e);return 0}function -ii(a){var -b=m.process;if(b&&b.env&&b.env[a]!=undefined)return b.env[a];if(m.jsoo_static_env&&m.jsoo_static_env[a])return m.jsoo_static_env[a]}var -ew=0;(function(){var -c=ii(ho);if(c!==undefined){var -b=c.split(",");for(var -a=0;a>>0>=a.l)sk();return w(a,b,c)}function -eh(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case +ay(this.t,a,this.l)};function +iG(a){return new +ay(0,a,a.length)}function +ap(a){return a}function +a0(a){return iG(ap(a))}function +bV(a,b,c,d,e){aN(a0(a),b,c,d,e);return 0}function +bo(a){return new +d(a[7]<<0|a[6]<<8|a[5]<<16,a[4]<<0|a[3]<<8|a[2]<<16,a[1]<<0|a[0]<<8)}function +cX(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case 0:return a.c.charCodeAt(b);case 4:return a.c[b]}}function -aI(d,c){var +eG(){A(ei)}function +tw(a,b){if(b>>>0>=a.l-7)eG();var +d=new +Array(8);for(var +c=0;c<8;c++)d[7-c]=cX(a,b+c);return bo(d)}function +v(a,b,c){c&=aw;if(a.t!=4){if(b==a.c.length){a.c+=String.fromCharCode(c);if(b+1==a.l)a.t=0;return 0}c0(a)}a.c[b]=c;return 0}function +az(a,b,c){if(b>>>0>=a.l)eG();return v(a,b,c)}function +bp(a){return a.toArray()}function +tx(a,b,c){if(b>>>0>=a.l-7)eG();var +e=bp(c);for(var +d=0;d<8;d++)v(a,b+7-d,e[d]);return 0}function +aO(d,c){var f=d.l>=0?d.l:d.l=d.length,e=c.length,b=f-e;if(b==0)return d.apply(null,c);else if(b<0){var a=d.apply(null,c.slice(0,f));if(typeof -a!=="function")return a;return aI(a,c.slice(f))}else{switch(b){case +a!=="function")return a;return aO(a,c.slice(f))}else{switch(b){case 1:{var a=function(a){var f=new @@ -90,67 +228,29 @@ a=function(){var e=arguments.length==0?1:arguments.length,b=new Array(c.length+e);for(var a=0;a>>0>=a.length-1)bF();return a}function -sm(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function -h7(a){return 0}var -tj=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function -ti(a){if(tj)return Math.floor(Math.log2(a));var +a=0;a>>0>=a.length-1)bT();return a}function +ty(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function +iW(a){return a==245?1:0}var +uv=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function +uu(a){if(uv)return Math.floor(Math.log2(a));var b=0;if(a==0)return-Infinity;if(a>=1)while(a>=2){a/=2;b++}else while(a<1){a*=2;b--}return b}function -en(a){var +eN(a){var b=new Float32Array(1);b[0]=a;var c=new -Int32Array(b.buffer);return c[0]|0}var -h5=Math.pow(2,-24);function -ib(a){throw a}function -ev(){ib(J.Division_by_zero)}function -d(a,b,c){this.lo=a&au;this.mi=b&au;this.hi=c&al}d.prototype.caml_custom="_j";d.prototype.copy=function(){return new -d(this.lo,this.mi,this.hi)};d.prototype.ucompare=function(a){if(this.hi>a.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.lo>24),c=-this.hi+(b>>24);return new -d(a,b,c)};d.prototype.add=function(a){var -b=this.lo+a.lo,c=this.mi+a.mi+(b>>24),e=this.hi+a.hi+(c>>24);return new -d(b,c,e)};d.prototype.sub=function(a){var -b=this.lo-a.lo,c=this.mi-a.mi+(b>>24),e=this.hi-a.hi+(c>>24);return new -d(b,c,e)};d.prototype.mul=function(a){var -b=this.lo*a.lo,c=(b*h5|0)+this.mi*a.lo+this.lo*a.mi,e=(c*h5|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new -d(b,c,e)};d.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};d.prototype.isNeg=function(){return this.hi<<16<0};d.prototype.and=function(a){return new -d(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};d.prototype.or=function(a){return new -d(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};d.prototype.xor=function(a){return new -d(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};d.prototype.shift_left=function(a){a=a&63;if(a==0)return this;if(a<24)return new -d(this.lo<>24-a,this.hi<>24-a);if(a<48)return new -d(0,this.lo<>48-a);return new -d(0,0,this.lo<>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a);if(a<48)return new -d(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0);return new -d(this.hi>>a-48,0,0)};d.prototype.shift_right=function(a){a=a&63;if(a==0)return this;var -c=this.hi<<16>>16;if(a<24)return new -d(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var -b=this.hi<<16>>31;if(a<48)return new -d(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&al);return new -d(this.hi<<16>>a-32,b,b)};d.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&au;this.lo=this.lo<<1&au};d.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&au;this.mi=(this.mi>>>1|this.hi<<23)&au;this.hi=this.hi>>>1};d.prototype.udivmod=function(a){var -e=0,c=this.copy(),b=a.copy(),f=new -d(0,0,0);while(c.ucompare(b)>0){e++;b.lsl1()}while(e>=0){e--;f.lsl1();if(c.ucompare(b)>=0){f.lo++;c=c.sub(b)}b.lsr1()}return{quotient:f,modulus:c}};d.prototype.div=function(a){var -b=this;if(a.isZero())ev();var -d=b.hi^a.hi;if(b.hi&aj)b=b.neg();if(a.hi&aj)a=a.neg();var -c=b.udivmod(a).quotient;if(d&aj)c=c.neg();return c};d.prototype.mod=function(a){var -b=this;if(a.isZero())ev();var -d=b.hi;if(b.hi&aj)b=b.neg();if(a.hi&aj)a=a.neg();var -c=b.udivmod(a).modulus;if(d&aj)c=c.neg();return c};d.prototype.toInt=function(){return this.lo|this.mi<<24};d.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};d.prototype.toArray=function(){return[this.hi>>8,this.hi&av,this.mi>>16,this.mi>>8&av,this.mi&av,this.lo>>16,this.lo>>8&av,this.lo&av]};d.prototype.lo32=function(){return this.lo|(this.mi&av)<<24};d.prototype.hi32=function(){return this.mi>>>8&al|this.hi<<16};function -cJ(a,b,c){return new +Int32Array(b.buffer);return c[0]|0}function +_(a,b,c){return new d(a,b,c)}function -cI(a){if(!isFinite(a)){if(isNaN(a))return cJ(1,0,hb);return a>0?cJ(0,0,hb):cJ(0,0,0xfff0)}var -f=a==0&&1/a==-Infinity?aj:a>=0?0:aj;if(f)a=-a;var -b=ti(a)+1023;if(b<=0){b=0;a/=Math.pow(2,-gG)}else{a/=Math.pow(2,b-hk);if(a<16){a*=2;b-=1}if(b==0)a/=2}var +c3(a){if(!isFinite(a)){if(isNaN(a))return _(1,0,hV);return a>0?_(0,0,hV):_(0,0,0xfff0)}var +f=a==0&&1/a==-Infinity?ag:a>=0?0:ag;if(f)a=-a;var +b=uu(a)+1023;if(b<=0){b=0;a/=Math.pow(2,-ho)}else{a/=Math.pow(2,b-h4);if(a<16){a*=2;b-=1}if(b==0)a/=2}var d=Math.pow(2,24),c=a|0;a=(a-c)*d;var e=a|0;a=(a-e)*d;var -g=a|0;c=c&d7|f|b<<4;return cJ(g,e,c)}function -bM(a){return a.toArray()}function -hX(a,b,c){a.write(32,b.dims.length);a.write(32,b.kind|b.layout<<8);if(b.caml_custom==cx)for(var -d=0;d>4;if(d==2047)return(f|g|c&d7)==0?c&aj?-Infinity:Infinity:NaN;var -e=Math.pow(2,-24),b=(f*e+g)*e+(c&d7);if(d>0){b+=16;b*=Math.pow(2,d-hk)}else -b*=Math.pow(2,-gG);if(c&aj)b=-b;return b}function -ef(a){var -d=a.length,c=1;for(var -b=0;b>>24&av|(b&al)<<8,b>>>16&al)}function -eq(a){return a.hi32()}function -er(a){return a.lo32()}var -si=cx;function -aH(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}aH.prototype.caml_custom=si;aH.prototype.offset=function(a){var -c=0;if(typeof -a==="number")a=[a];if(!(a -instanceof -Array))z("bigarray.js: invalid offset");if(this.dims.length!=a.length)z("Bigarray.get/set: bad number of dimensions");if(this.layout==0)for(var -b=0;b=this.dims[b])bF();c=c*this.dims[b]+a[b]}else -for(var -b=this.dims.length-1;b>=0;b--){if(a[b]<1||a[b]>this.dims[b])bF();c=c*this.dims[b]+(a[b]-1)}return c};aH.prototype.get=function(a){switch(this.kind){case -7:var -d=this.data[a*2+0],b=this.data[a*2+1];return sE(d,b);case -10:case -11:var -e=this.data[a*2+0],c=this.data[a*2+1];return[cu,e,c];default:return this.data[a]}};aH.prototype.set=function(a,b){switch(this.kind){case -7:this.data[a*2+0]=er(b);this.data[a*2+1]=eq(b);break;case -10:case -11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};aH.prototype.fill=function(a){switch(this.kind){case -7:var -c=er(a),e=eq(a);if(c==e)this.data.fill(c);else -for(var -b=0;be)return 1;if(d!=e){if(!b)return NaN;if(d==d)return 1;if(e==e)return-1}}break;case -7:for(var -c=0;ca.data[c+1])return 1;if(this.data[c]>>>0>>0)return-1;if(this.data[c]>>>0>a.data[c]>>>0)return 1}break;case -2:case -3:case -4:case -5:case -6:case -8:case -9:case -12:for(var -c=0;ca.data[c])return 1}break}return 0};function -bf(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}bf.prototype=new -aH();bf.prototype.offset=function(a){if(typeof -a!=="number")if(a -instanceof -Array&&a.length==1)a=a[0];else -z("Ml_Bigarray_c_1_1.offset");if(a<0||a>=this.dims[0])bF();return a};bf.prototype.get=function(a){return this.data[a]};bf.prototype.set=function(a,b){this.data[a]=b;return 0};bf.prototype.fill=function(a){this.data.fill(a);return 0};function -hT(a,b,c,d){var -e=hV(a);if(ef(c)*e!=d.length)z("length doesn't match dims");if(b==0&&c.length==1&&e==1)return new -bf(a,b,c,d);return new -aH(a,b,c,d)}function -W(a){if(!J.Failure)J.Failure=[c,X(ee),-3];eu(J.Failure,a)}function -hU(a,b,c){var -k=a.read32s();if(k<0||k>16)W("input_value: wrong number of bigarray dimensions");var -r=a.read32s(),l=r&av,q=r>>8&1,j=[];if(c==cx)for(var +eP(a){var +f=a.lo,g=a.mi,c=a.hi,d=(c&0x7fff)>>4;if(d==2047)return(f|g|c&et)==0?c&ag?-Infinity:Infinity:NaN;var +e=Math.pow(2,-24),b=(f*e+g)*e+(c&et);if(d>0){b+=16;b*=Math.pow(2,d-h4)}else +b*=Math.pow(2,-ho);if(c&ag)b=-b;return b}function +I(a){if(!J.Failure)J.Failure=[c,U(eC),-3];eW(J.Failure,a)}function +iC(a,b,c){var +k=a.read32s();if(k<0||k>16)I("input_value: wrong number of bigarray dimensions");var +r=a.read32s(),l=r&aw,q=r>>8&1,j=[];if(c==cQ)for(var d=0;d>>32-15;b=bh(b,0x1b873593);a^=b;a=a<<13|a>>>32-13;return(a+(a<<2)|0)+(0xe6546b64|0)|0}function -sz(a,b){a=K(a,er(b));a=K(a,eq(b));return a}function -el(a,b){return sz(a,cI(b))}function -hW(a){var -c=ef(a.dims),d=0;switch(a.kind){case +n=eP(bo(g));i.set(d,[cO,o,n])}break}b[0]=(4+k)*4;return eF(l,q,j,h)}function +iA(a,b,c){return a.compare(b,c)}function +bq(a,b){return Math.imul(a,b)}function +K(a,b){b=bq(b,0xcc9e2d51|0);b=b<<15|b>>>32-15;b=bq(b,0x1b873593);a^=b;a=a<<13|a>>>32-13;return(a+(a<<2)|0)+(0xe6546b64|0)|0}function +tN(a,b){a=K(a,eR(b));a=K(a,eQ(b));return a}function +eL(a,b){return tN(a,c3(b))}function +iE(a){var +c=cW(a.dims),d=0;switch(a.kind){case 2:case 3:case -12:if(c>cy)c=cy;var +12:if(c>cR)c=cR;var e=0,b=0;for(b=0;b+4<=a.data.length;b+=4){e=a.data[b+0]|a.data[b+1]<<8|a.data[b+2]<<16|a.data[b+3]<<24;d=K(d,e)}e=0;switch(c&3){case 3:e=a.data[b+2]<<16;case 2:e|=a.data[b+1]<<8;case 1:e|=a.data[b+0];d=K(d,e)}break;case 4:case -5:if(c>bB)c=bB;var +5:if(c>bP)c=bP;var e=0,b=0;for(b=0;b+2<=a.data.length;b+=2){e=a.data[b+0]|a.data[b+1]<<16;d=K(d,e)}if((c&1)!=0)d=K(d,a.data[b]);break;case 6:if(c>64)c=64;for(var b=0;b64)c=64;for(var -b=0;b32)c=32;for(var -b=0;b0?f(b,a,d):f(a,b,d);if(d&&e!=e)return c;if(+e!=+e)return+e;if((e|0)!=0)return e|0}return c}function -cL(a){return typeof +c5(a){return typeof a==="string"&&!/[^\x00-\xff]/.test(a)}function -cK(a){return a +c4(a){return a instanceof -aw}function -h0(a){if(typeof -a==="number")return bD;else if(cK(a))return cs;else if(cL(a))return 1252;else if(a +ay}function +iI(a){if(typeof +a==="number")return bR;else if(c4(a))return cM;else if(c5(a))return 1252;else if(a instanceof -Array&&a[0]===a[0]>>>0&&a[0]<=gX){var -b=a[0]|0;return b==cu?0:b}else if(a +Array&&a[0]===a[0]>>>0&&a[0]<=hF){var +b=a[0]|0;return b==cO?0:b}else if(a instanceof -String)return gz;else if(typeof -a=="string")return gz;else if(a +String)return hh;else if(typeof +a=="string")return hh;else if(a instanceof -Number)return bD;else if(a&&a.caml_custom)return d_;else if(a&&a.compare)return 1256;else if(typeof +Number)return bR;else if(a&&a.caml_custom)return ew;else if(a&&a.compare)return 1256;else if(typeof a=="function")return 1247;else if(typeof a=="symbol")return 1251;return 1001}function -h6(a,b){if(ab?1:0}function -sl(a,b){a.t&6&&bI(a);b.t&6&&bI(b);return a.cb.c?1:0}function -cF(a,b,c){var +iV(a,b){if(ab?1:0}function +tv(a,b){a.t&6&&bX(a);b.t&6&&bX(b);return a.cb.c?1:0}function +cZ(a,b,c){var f=[];for(;;){if(!(c&&a===b)){var -e=h0(a);if(e==at){a=a[1];continue}var -g=h0(b);if(g==at){b=b[1];continue}if(e!==g){if(e==bD){if(g==d_)return hZ(a,b,-1,c);return-1}if(g==bD){if(e==d_)return hZ(b,a,1,c);return 1}return eb)return 1;if(a!=b){if(!c)return NaN;if(a==a)return 1;if(b==b)return-1}break;case 1251:if(a!==b){if(!c)return NaN;return 1}break;case 1252:var -a=an(a),b=an(b);if(a!==b){if(ab)return 1}break;case +a=ap(a),b=ap(b);if(a!==b){if(ab)return 1}break;case 12520:var a=a.toString(),b=b.toString();if(a!==b){if(ab)return 1}break;case 246:case -254:default:if(h7(e)){z("compare: continuation value");break}if(a.length!=b.length)return a.length1)f.push(a,b,1);break}}if(f.length==0)return 0;var +254:default:if(iW(e)){A("compare: continuation value");break}if(a.length!=b.length)return a.length1)f.push(a,b,1);break}}if(f.length==0)return 0;var h=f.pop();b=f.pop();a=f.pop();if(h+10)if(b==0&&(c>=a.l||a.t==2&&c>=a.c.length))if(d==0){a.c=j;a.t=2}else{a.c=bi(c,String.fromCharCode(d));a.t=c==a.l?0:2}else{if(a.t!=4)cG(a);for(c+=b;b0&&b===b)return b;a=a.replace(/_/g,j);b=+a;if(a.length>0&&b===b||/^[+-]?nan$/i.test(a))return b;var +bW(a,b){return cZ(a,b,true)}function +tz(){return[0]}function +F(a){if(a<0)A("Bytes.create");return new +ay(a?2:9,e,a)}var +c1=[0];function +tB(a,b){if(c1!==a)return 0;c1=b;return 1}function +iJ(a){return c1}function +tC(a){c1=a}function +iK(a,b){return+(cZ(a,b,false)==0)}function +tE(a,b,c,d){if(c>0)if(b==0&&(c>=a.l||a.t==2&&c>=a.c.length))if(d==0){a.c=e;a.t=2}else{a.c=br(c,String.fromCharCode(d));a.t=c==a.l?0:2}else{if(a.t!=4)c0(a);for(c+=b;b0&&b===b)return b;a=a.replace(/_/g,e);b=+a;if(a.length>0&&b===b||/^[+-]?nan$/i.test(a))return b;var c=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(a);if(c){var -d=c[3].replace(/0+$/,j),f=parseInt(c[1]+c[2]+d,16),e=(c[5]|0)-4*d.length;b=f*Math.pow(2,e);return b}if(/^\+?inf(inity)?$/i.test(a))return Infinity;if(/^-inf(inity)?$/i.test(a))return-Infinity;W("float_of_string")}function -et(a){a=an(a);var -e=a.length;if(e>31)z("format_int: format too long");var -b={justify:bd,signstyle:aU,filler:ai,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:"f"};for(var +d=c[3].replace(/0+$/,e),g=parseInt(c[1]+c[2]+d,16),f=(c[5]|0)-4*d.length;b=g*Math.pow(2,f);return b}if(/^\+?inf(inity)?$/i.test(a))return Infinity;if(/^-inf(inity)?$/i.test(a))return-Infinity;I("float_of_string")}function +eV(a){a=ap(a);var +e=a.length;if(e>31)A("format_int: format too long");var +b={justify:bk,signstyle:aY,filler:am,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:"f"};for(var d=0;d=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case".":b.prec=0;d++;while(c=a.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;case"d":case"i":b.signedconv=true;case"u":b.base=10;break;case"x":b.base=16;break;case"X":b.base=16;b.uppercase=true;break;case"o":b.base=8;break;case"e":case"f":case"g":b.signedconv=true;b.conv=c;break;case"E":case"F":case"G":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function -ej(a,b){if(a.uppercase)b=b.toUpperCase();var -e=b.length;if(a.signedconv&&(a.sign<0||a.signstyle!=aU))e++;if(a.alternate){if(a.base==8)e+=1;if(a.base==16)e+=2}var -c=j;if(a.justify==bd&&a.filler==ai)for(var -d=e;d=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case".":b.prec=0;d++;while(c=a.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;case"d":case"i":b.signedconv=true;case"u":b.base=10;break;case"x":b.base=16;break;case"X":b.base=16;b.uppercase=true;break;case"o":b.base=8;break;case"e":case"f":case"g":b.signedconv=true;b.conv=c;break;case"E":case"F":case"G":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function +eJ(a,b){if(a.uppercase)b=b.toUpperCase();var +f=b.length;if(a.signedconv&&(a.sign<0||a.signstyle!=aY))f++;if(a.alternate){if(a.base==8)f+=1;if(a.base==16)f+=2}var +c=e;if(a.justify==bk&&a.filler==am)for(var +d=f;d20){c-=20;a/=Math.pow(10,c);a+=new -Array(c+1).join(R);if(b>0)a=a+aF+new +c=parseInt(a.toString().split(bk)[1]);if(c>20){c-=20;a/=Math.pow(10,c);a+=new +Array(c+1).join(R);if(b>0)a=a+aJ+new Array(b+1).join(R);return a}else return a.toFixed(b)}}var -c,f=et(a),e=f.prec<0?6:f.prec;if(b<0||b==0&&1/b==-Infinity){f.sign=-1;b=-b}if(isNaN(b)){c=d0;f.filler=ai}else if(!isFinite(b)){c="inf";f.filler=ai}else +c,f=eV(a),e=f.prec<0?6:f.prec;if(b<0||b==0&&1/b==-Infinity){f.sign=-1;b=-b}if(isNaN(b)){c=em;f.filler=am}else if(!isFinite(b)){c="inf";f.filler=am}else switch(f.conv){case"e":var -c=b.toExponential(e),d=c.length;if(c.charAt(d-3)==d6)c=c.slice(0,d-1)+R+c.slice(d-1);break;case"f":c=j(b,e);break;case"g":e=e?e:1;c=b.toExponential(e-1);var -i=c.indexOf(d6),h=+c.slice(i+1);if(h<-4||b>=1e21||b.toFixed(0).length>e){var -d=i-1;while(c.charAt(d)==R)d--;if(c.charAt(d)==aF)d--;c=c.slice(0,d+1)+c.slice(i);d=c.length;if(c.charAt(d-3)==d6)c=c.slice(0,d-1)+R+c.slice(d-1);break}else{var +c=b.toExponential(e),d=c.length;if(c.charAt(d-3)==es)c=c.slice(0,d-1)+R+c.slice(d-1);break;case"f":c=j(b,e);break;case"g":e=e?e:1;c=b.toExponential(e-1);var +i=c.indexOf(es),h=+c.slice(i+1);if(h<-4||b>=1e21||b.toFixed(0).length>e){var +d=i-1;while(c.charAt(d)==R)d--;if(c.charAt(d)==aJ)d--;c=c.slice(0,d+1)+c.slice(i);d=c.length;if(c.charAt(d-3)==es)c=c.slice(0,d-1)+R+c.slice(d-1);break}else{var g=e;if(h<0){g-=h+1;c=b.toFixed(g)}else while(c=b.toFixed(g),c.length>e+1)g--;if(g){var -d=c.length-1;while(c.charAt(d)==R)d--;if(c.charAt(d)==aF)d--;c=c.slice(0,d+1)}}break}return ej(f,c)}function -cH(a,b){if(an(a)==dV)return X(j+b);var -c=et(a);if(b<0)if(c.signedconv){c.sign=-1;b=-b}else +d=c.length-1;while(c.charAt(d)==R)d--;if(c.charAt(d)==aJ)d--;c=c.slice(0,d+1)}}break}return eJ(f,c)}function +c2(a,b){if(ap(a)==eh)return U(e+b);var +c=eV(a);if(b<0)if(c.signedconv){c.sign=-1;b=-b}else b>>>=0;var -d=b.toString(c.base);if(c.prec>=0){c.filler=ai;var -e=c.prec-d.length;if(e>0)d=bi(e,R)+d}return ej(c,d)}var -s7=0;function -am(){return s7++}function -S(a){if(ez(a))return a;return ig(a)}function -bP(){return typeof +d=b.toString(c.base);if(c.prec>=0){c.filler=am;var +f=c.prec-d.length;if(f>0)d=br(f,R)+d}return eJ(c,d)}var +ui=0;function +ao(){return ui++}function +S(a){if(e0(a))return a;return i$(a)}function +b2(){return typeof m.process!=="undefined"&&typeof m.process.versions!=="undefined"&&typeof m.process.versions.node!=="undefined"}function -tk(){function -a(a){if(a.charAt(0)===ak)return[j,a.substring(1)];return}function +uw(){function +a(a){if(a.charAt(0)===an)return[e,a.substring(1)];return}function b(a){var -g=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b=g.exec(a),c=b[1]||j,e=Boolean(c&&c.charAt(1)!==":");if(Boolean(b[2]||e)){var -d=b[1]||j,f=b[2]||j;return[d,a.substring(d.length+f.length)]}return}return bP()&&m.process&&m.process.platform?m.process.platform==="win32"?b:a:a}var -eA=tk();function -ie(a){return a.slice(-1)!==ak?a+ak:a}if(bP()&&m.process&&m.process.cwd)var -bJ=m.process.cwd().replace(/\\/g,ak);else +h=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b=h.exec(a),c=b[1]||e,f=Boolean(c&&c.charAt(1)!==":");if(Boolean(b[2]||f)){var +d=b[1]||e,g=b[2]||e;return[d,a.substring(d.length+g.length)]}return}return b2()&&m.process&&m.process.platform?m.process.platform==="win32"?b:a:a}var +e1=uw();function +i_(a){return a.slice(-1)!==an?a+an:a}if(b2()&&m.process&&m.process.cwd)var +bY=m.process.cwd().replace(/\\/g,an);else var -bJ="/static";bJ=ie(bJ);function -sV(a){a=S(a);if(!eA(a))a=bJ+a;var -e=eA(a),d=e[1].split(ak),b=[];for(var +bY="/static";bY=i_(bY);function +t_(a){a=S(a);if(!e1(a))a=bY+a;var +e=e1(a),d=e[1].split(an),b=[];for(var c=0;c1)b.pop();break;case".":break;case"":break;default:b.push(d[c]);break}b.unshift(e[0]);b.orig=a;return b}function -th(a){for(var -f=j,c=f,b,h,d=0,g=a.length;dd1){c.substr(0,1);f+=c;c=j;f+=a.slice(d,e)}else -c+=a.slice(d,e);if(e==g)break;d=e}if(b>6);c+=String.fromCharCode(aa|b&aG)}else if(b<0xd800||b>=gN)c+=String.fromCharCode(hE|b>>12,aa|b>>6&aG,aa|b&aG);else if(b>=0xdbff||d+1==g||(h=a.charCodeAt(d+1))gN)c+="\xef\xbf\xbd";else{d++;b=(b<<10)+h-0x35fdc00;c+=String.fromCharCode(g4|b>>18,aa|b>>12&aG,aa|b>>6&aG,aa|b&aG)}if(c.length>bC){c.substr(0,1);f+=c;c=j}}return f+c}function -ag(a){return ez(a)?X(a):X(th(a))}var -tl=["E2BIG","EACCES","EAGAIN",dU,"EBUSY","ECHILD","EDEADLK","EDOM",hD,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",d5,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",d8,hi,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function -az(a,b,c,d){var -e=tl.indexOf(a);if(e<0){if(d==null)d=-9999;e=[0,d]}var -f=[e,ag(b||j),ag(c||j)];return f}var -h$={};function -aK(a){return h$[a]}function -ay(a,b){throw g([0,a].concat(b))}function -eg(a){if(!(a +ut(a){for(var +g=e,c=g,b,i,d=0,h=a.length;den){c.substr(0,1);g+=c;c=e;g+=a.slice(d,f)}else +c+=a.slice(d,f);if(f==h)break;d=f}if(b>6);c+=String.fromCharCode(ad|b&aL)}else if(b<0xd800||b>=hv)c+=String.fromCharCode(im|b>>12,ad|b>>6&aL,ad|b&aL);else if(b>=0xdbff||d+1==h||(i=a.charCodeAt(d+1))hv)c+="\xef\xbf\xbd";else{d++;b=(b<<10)+i-0x35fdc00;c+=String.fromCharCode(hL|b>>18,ad|b>>12&aL,ad|b>>6&aL,ad|b&aL)}if(c.length>bQ){c.substr(0,1);g+=c;c=e}}return g+c}function +ak(a){return e0(a)?U(a):U(ut(a))}var +ux=["E2BIG","EACCES","EAGAIN",eg,"EBUSY","ECHILD","EDEADLK","EDOM",il,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",er,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",eu,h2,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function +aB(a,b,c,d){var +f=ux.indexOf(a);if(f<0){if(d==null)d=-9999;f=[0,d]}var +g=[f,ak(b||e),ak(c||e)];return g}var +i3={};function +aQ(a){return i3[a]}function +aA(a,b){throw g([0,a].concat(b))}function +eH(a){if(!(a instanceof Uint8Array))a=new Uint8Array(a);return new -aw(4,a,a.length)}function -l(a){eu(J.Sys_error,a)}function -ic(a){l(a+cz)}function -ey(a){if(a.t!=4)cG(a);return a.c}function -af(a){return a.l}function -hR(){}function +ay(4,a,a.length)}function +l(a){eW(J.Sys_error,a)}function +i7(a){l(a+cS)}function +eZ(a){if(a.t!=4)c0(a);return a.c}function +aq(a){return a.l}function +iz(){}function N(a){this.data=a}N.prototype=new -hR();N.prototype.constructor=N;N.prototype.truncate=function(a){var -b=this.data;this.data=F(a|0);ax(b,0,this.data,0,a)};N.prototype.length=function(){return af(this.data)};N.prototype.write=function(a,b,c,d){var +iz();N.prototype.constructor=N;N.prototype.truncate=function(a){var +b=this.data;this.data=F(a|0);aN(b,0,this.data,0,a)};N.prototype.length=function(){return aq(this.data)};N.prototype.write=function(a,b,c,d){var e=this.length();if(a+d>=e){var -f=F(a+d),g=this.data;this.data=f;ax(g,0,this.data,0,e)}ax(eg(b),c,this.data,a,d);return 0};N.prototype.read=function(a,b,c,d){var +f=F(a+d),g=this.data;this.data=f;aN(g,0,this.data,0,e)}aN(eH(b),c,this.data,a,d);return 0};N.prototype.read=function(a,b,c,d){var e=this.length();if(a+d>=e)d=e-a;if(d){var -f=F(d|0);ax(this.data,a,f,0,d);b.set(ey(f),c)}return d};function -aV(a,b,c){this.file=b;this.name=a;this.flags=c}aV.prototype.err_closed=function(){l(this.name+gA)};aV.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()};aV.prototype.write=function(a,b,c,d){if(this.file)return this.file.write(a,b,c,d);this.err_closed()};aV.prototype.read=function(a,b,c,d){if(this.file)return this.file.read(a,b,c,d);this.err_closed()};aV.prototype.close=function(){this.file=undefined};function +f=F(d|0);aN(this.data,a,f,0,d);b.set(eZ(f),c)}return d};function +aZ(a,b,c){this.file=b;this.name=a;this.flags=c}aZ.prototype.err_closed=function(){l(this.name+hi)};aZ.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()};aZ.prototype.write=function(a,b,c,d){if(this.file)return this.file.write(a,b,c,d);this.err_closed()};aZ.prototype.read=function(a,b,c,d){if(this.file)return this.file.read(a,b,c,d);this.err_closed()};aZ.prototype.close=function(){this.file=undefined};function E(a,b){this.content={};this.root=a;this.lookupFun=b}E.prototype.nm=function(a){return this.root+a};E.prototype.create_dir_if_needed=function(a){var -d=a.split(ak),c=j;for(var -b=0;b>>16;a=bh(a,0x85ebca6b|0);a^=a>>>13;a=bh(a,0xc2b2ae35|0);a^=a>>>16;return a}function -sv(a,b,c,d){var -j,k,l,h,g,f,e,i,m;h=b;if(h<0||h>cy)h=cy;g=a;f=c;j=[d];k=0;l=1;while(k0){e=j[k++];if(e&&e.caml_custom){if(bK[e.caml_custom]&&bK[e.caml_custom].hash){var -n=bK[e.caml_custom].hash(e);f=K(f,n);g--}}else if(e +tK(a,b){var +c=ub(b);return typeof +c==="string"?eM(a,c):tL(a,c)}function +tM(a){a^=a>>>16;a=bq(a,0x85ebca6b|0);a^=a>>>13;a=bq(a,0xc2b2ae35|0);a^=a>>>16;return a}function +tJ(a,b,c,d){var +j,k,l,h,g,f,e,i,m;h=b;if(h<0||h>cR)h=cR;g=a;f=c;j=[d];k=0;l=1;while(k0){e=j[k++];if(e&&e.caml_custom){if(bZ[e.caml_custom]&&bZ[e.caml_custom].hash){var +n=bZ[e.caml_custom].hash(e);f=K(f,n);g--}}else if(e instanceof Array&&e[0]===(e[0]|0))switch(e[0]){case 248:f=K(f,e[2]);g--;break;case -250:j[--k]=e[1];break;default:if(h7(e[0]))break;var -o=e.length-1<<10|e[0];f=K(f,o);for(i=1,m=e.length;i=h)break;j[l++]=e[i]}break}else if(cK(e)){f=sw(f,e);g--}else if(cL(e)){f=sA(f,e);g--}else if(typeof -e==="string"){f=em(f,e);g--}else if(e===(e|0)){f=K(f,e+e+1);g--}else if(typeof -e==="number"){f=el(f,e);g--}}f=sy(f);return f&0x3FFFFFFF}function -sB(a,b,c){if(!isFinite(a)){if(isNaN(a))return ag(d0);return ag(a>0?g7:"-infinity")}var +250:j[--k]=e[1];break;default:if(iW(e[0]))break;var +o=e.length-1<<10|e[0];f=K(f,o);for(i=1,m=e.length;i=h)break;j[l++]=e[i]}break}else if(c4(e)){f=tK(f,e);g--}else if(c5(e)){f=tO(f,e);g--}else if(typeof +e==="string"){f=eM(f,e);g--}else if(e===(e|0)){f=K(f,e+e+1);g--}else if(typeof +e==="number"){f=eL(f,e);g--}}f=tM(f);return f&0x3FFFFFFF}function +tP(a,b,c){if(!isFinite(a)){if(isNaN(a))return ak(em);return ak(a>0?hP:"-infinity")}var k=a==0&&1/a==-Infinity?1:a>=0?0:1;if(k)a=-a;var -e=0;if(a==0);else if(a<1)while(a<1&&e>-1022){a*=2;e--}else -while(a>=2){a/=2;e++}var -l=e<0?j:bd,f=j;if(k)f=aU;else +f=0;if(a==0);else if(a<1)while(a<1&&f>-1022){a*=2;f--}else +while(a>=2){a/=2;f++}var +l=f<0?e:bk,g=e;if(k)g=aY;else switch(c){case -43:f=bd;break;case -32:f=ai;break;default:break}if(b>=0&&b<13){var -h=Math.pow(2,b*4);a=Math.round(a*h)/h}var +43:g=bk;break;case +32:g=am;break;default:break}if(b>=0&&b<13){var +i=Math.pow(2,b*4);a=Math.round(a*i)/i}var d=a.toString(16);if(b>=0){var -i=d.indexOf(aF);if(i<0)d+=aF+bi(b,R);else{var -g=i+1+b;if(d.length>24&au,a>>31&al)}function -sM(a){return a.toInt()}function -sH(a){return+a.isNeg()}function -sK(a){return a.neg()}function -sF(a,b){var -c=et(a);if(c.signedconv&&sH(b)){c.sign=-1;b=sK(b)}var -d=j,h=sL(c.base),g="0123456789abcdef";do{var -f=b.udivmod(h);b=f.quotient;d=g.charAt(sM(f.modulus))+d}while(!sI(b));if(c.prec>=0){c.filler=ai;var -e=c.prec-d.length;if(e>0)d=bi(e,R)+d}return ej(c,d)}function -s8(a){var -b=0,e=p(a),c=10,d=1;if(e>0)switch(Y(a,b)){case +j=d.indexOf(aJ);if(j<0)d+=aJ+br(b,R);else{var +h=j+1+b;if(d.length>24&al,a>>31&ah)}function +iU(a){return a.toInt()}function +tV(a){return+a.isNeg()}function +iQ(a){return a.neg()}function +tT(a,b){var +c=eV(a);if(c.signedconv&&tV(b)){c.sign=-1;b=iQ(b)}var +d=e,i=b0(c.base),h="0123456789abcdef";do{var +g=b.udivmod(i);b=g.quotient;d=h.charAt(iU(g.modulus))+d}while(!tW(b));if(c.prec>=0){c.filler=am;var +f=c.prec-d.length;if(f>0)d=br(f,R)+d}return eJ(c,d)}function +iT(a,b){return a.or(b)}function +i5(a){var +b=0,e=p(a),c=10,d=1;if(e>0)switch(V(a,b)){case 45:b++;d=-1;break;case -43:b++;d=1;break}if(b+10)switch(Y(a,b)){case 66:c=2;b+=2;break;case 117:case 85:b+=2;break}return[b,d,c]}function -ia(a){if(a>=48&&a<=57)return a-48;if(a>=65&&a<=90)return a-55;if(a>=97&&a<=122)return a-87;return-1}function -sO(a){var -h=s8(a),d=h[0],i=h[1],e=h[2],g=p(a),j=-1>>>0,f=d=e)W(cC);var -b=c;for(d++;d=e)break;b=e*b+c;if(b>j)W(cC)}if(d!=g)W(cC);b=i*b;if(e==10&&(b|0)!=b)W(cC);return b|0}function -sQ(a){return a.slice(1)}function -cM(a,b,c){return a[S(b)].apply(a,sQ(c))}function -sR(a){var +c8(a){if(a>=48&&a<=57)return a-48;if(a>=65&&a<=90)return a-55;if(a>=97&&a<=122)return a-87;return-1}function +t2(a){var +h=i5(a),d=h[0],i=h[1],e=h[2],g=p(a),j=-1>>>0,f=d=e)I(ax);var +b=c;for(d++;d=e)break;b=e*b+c;if(b>j)I(ax)}if(d!=g)I(ax);b=i*b;if(e==10&&(b|0)!=b)I(ax);return b|0}function +c6(a,b,c){return a[S(b)].apply(a,iX(c))}function +t4(a){var d=a.length,c=new Array(d+1);c[0]=0;for(var b=0;b>>0&&eU(a,bm,bl)?0:1}function +iY(a){eU(a,bl,aI);return 0}function +t8(a,b){return+(cZ(a,b,false)<0)}function +t9(a){var b=[];for(;a!==0;a=a[2])b.push(a[1]);return b}function -ao(a,b){if(a<0)bF();var +i4(a){return U(a)}function +iO(a,b){return a.add(b)}function +iP(a,b){return a.mul(b)}function +eS(a,b){return a.ucompare(b)<0}function +iR(a){var +h=i5(a),g=h[0],j=h[1],e=h[2],i=b0(e),k=new +d(al,0xfffffff,ah).udivmod(i).quotient,f=V(a,g),b=c8(f);if(b<0||b>=e)I(ax);var +c=b0(b);for(;;){g++;f=V(a,g);if(f==95)continue;b=c8(f);if(b<0||b>=e)break;if(eS(k,c))I(ax);b=b0(b);c=iO(iP(i,c),b);if(eS(c,b))I(ax)}if(g!=p(a))I(ax);if(e==10&&eS(new +d(0,0,ag),c))I(ax);if(j<0)c=iQ(c);return c}function +tt(a,b){return a.get(a.offset(b))}function +t1(a,b){return a.xor(b)}function +tZ(a,b){return a.shift_right_unsigned(b)}function +tY(a,b){return a.shift_left(b)}function +iZ(a){function +o(a,b){return tY(a,b)}function +h(a,b){return tZ(a,b)}function +s(a,b){return iT(a,b)}function +f(a,b){return t1(a,b)}function +k(a,b){return iO(a,b)}function +i(a,b){return iP(a,b)}function +m(a,b){return s(o(a,b),h(a,64-b))}function +g(a,b){return tt(a,b)}function +j(a,b,c){return bU(a,b,c)}var +q=iR(i4("0xd1342543de82ef95")),l=iR(i4("0xdaba0b6eb09322e3")),b,d,c,e=a,r=g(e,0),n=g(e,1),p=g(e,2),t=g(e,3);b=k(n,p);b=i(f(b,h(b,32)),l);b=i(f(b,h(b,32)),l);b=f(b,h(b,32));j(e,1,k(i(n,q),r));var +d=p,c=t;c=f(c,d);d=m(d,24);d=f(f(d,c),o(c,16));c=m(c,37);j(e,2,d);j(e,3,c);return b}function +aj(a,b){if(a<0)bT();var a=a+1|0,c=new Array(a);c[0]=0;for(var d=1;d>>32-e,c)}function g(a,b,c,d,e,f,g){return l(b&c|~b&d,a,b,e,f,g)}function @@ -722,43 +772,43 @@ h(a,b,c,d,e,f,g){return l(b&d|c&~d,a,b,e,f,g)}function i(a,b,c,d,e,f,g){return l(b^c^d,a,b,e,f,g)}function j(a,b,c,d,e,f,g){return l(c^(b|~d),a,b,e,f,g)}return function(a,b){var c=a[0],d=a[1],e=a[2],f=a[3];c=g(c,d,e,f,b[0],7,0xD76AA478);f=g(f,c,d,e,b[1],12,0xE8C7B756);e=g(e,f,c,d,b[2],17,0x242070DB);d=g(d,e,f,c,b[3],22,0xC1BDCEEE);c=g(c,d,e,f,b[4],7,0xF57C0FAF);f=g(f,c,d,e,b[5],12,0x4787C62A);e=g(e,f,c,d,b[6],17,0xA8304613);d=g(d,e,f,c,b[7],22,0xFD469501);c=g(c,d,e,f,b[8],7,0x698098D8);f=g(f,c,d,e,b[9],12,0x8B44F7AF);e=g(e,f,c,d,b[10],17,0xFFFF5BB1);d=g(d,e,f,c,b[11],22,0x895CD7BE);c=g(c,d,e,f,b[12],7,0x6B901122);f=g(f,c,d,e,b[13],12,0xFD987193);e=g(e,f,c,d,b[14],17,0xA679438E);d=g(d,e,f,c,b[15],22,0x49B40821);c=h(c,d,e,f,b[1],5,0xF61E2562);f=h(f,c,d,e,b[6],9,0xC040B340);e=h(e,f,c,d,b[11],14,0x265E5A51);d=h(d,e,f,c,b[0],20,0xE9B6C7AA);c=h(c,d,e,f,b[5],5,0xD62F105D);f=h(f,c,d,e,b[10],9,0x02441453);e=h(e,f,c,d,b[15],14,0xD8A1E681);d=h(d,e,f,c,b[4],20,0xE7D3FBC8);c=h(c,d,e,f,b[9],5,0x21E1CDE6);f=h(f,c,d,e,b[14],9,0xC33707D6);e=h(e,f,c,d,b[3],14,0xF4D50D87);d=h(d,e,f,c,b[8],20,0x455A14ED);c=h(c,d,e,f,b[13],5,0xA9E3E905);f=h(f,c,d,e,b[2],9,0xFCEFA3F8);e=h(e,f,c,d,b[7],14,0x676F02D9);d=h(d,e,f,c,b[12],20,0x8D2A4C8A);c=i(c,d,e,f,b[5],4,0xFFFA3942);f=i(f,c,d,e,b[8],11,0x8771F681);e=i(e,f,c,d,b[11],16,0x6D9D6122);d=i(d,e,f,c,b[14],23,0xFDE5380C);c=i(c,d,e,f,b[1],4,0xA4BEEA44);f=i(f,c,d,e,b[4],11,0x4BDECFA9);e=i(e,f,c,d,b[7],16,0xF6BB4B60);d=i(d,e,f,c,b[10],23,0xBEBFBC70);c=i(c,d,e,f,b[13],4,0x289B7EC6);f=i(f,c,d,e,b[0],11,0xEAA127FA);e=i(e,f,c,d,b[3],16,0xD4EF3085);d=i(d,e,f,c,b[6],23,0x04881D05);c=i(c,d,e,f,b[9],4,0xD9D4D039);f=i(f,c,d,e,b[12],11,0xE6DB99E5);e=i(e,f,c,d,b[15],16,0x1FA27CF8);d=i(d,e,f,c,b[2],23,0xC4AC5665);c=j(c,d,e,f,b[0],6,0xF4292244);f=j(f,c,d,e,b[7],10,0x432AFF97);e=j(e,f,c,d,b[14],15,0xAB9423A7);d=j(d,e,f,c,b[5],21,0xFC93A039);c=j(c,d,e,f,b[12],6,0x655B59C3);f=j(f,c,d,e,b[3],10,0x8F0CCC92);e=j(e,f,c,d,b[10],15,0xFFEFF47D);d=j(d,e,f,c,b[1],21,0x85845DD1);c=j(c,d,e,f,b[8],6,0x6FA87E4F);f=j(f,c,d,e,b[15],10,0xFE2CE6E0);e=j(e,f,c,d,b[6],15,0xA3014314);d=j(d,e,f,c,b[13],21,0x4E0811A1);c=j(c,d,e,f,b[4],6,0xF7537E82);f=j(f,c,d,e,b[11],10,0xBD3AF235);e=j(e,f,c,d,b[2],15,0x2AD7D2BB);d=j(d,e,f,c,b[9],21,0xEB86D391);a[0]=k(c,a[0]);a[1]=k(d,a[1]);a[2]=k(e,a[2]);a[3]=k(f,a[3])}}();function -se(a,b,c){var -e=a.len&aG,d=0;a.len+=c;if(e){var -f=64-e;if(c=64){a.b8.set(b.subarray(d,d+64),0);cD(a.w,a.b32);c-=64;d+=64}if(c)a.b8.set(b.subarray(d,d+c),0)}function -sc(a){var -c=a.len&aG;a.b8[c]=aa;c++;if(c>56){for(var -b=c;b<64;b++)a.b8[b]=0;cD(a.w,a.b32);for(var +tn(a,b,c){var +e=a.len&aL,d=0;a.len+=c;if(e){var +f=64-e;if(c=64){a.b8.set(b.subarray(d,d+64),0);cV(a.w,a.b32);c-=64;d+=64}if(c)a.b8.set(b.subarray(d,d+c),0)}function +tl(a){var +c=a.len&aL;a.b8[c]=ad;c++;if(c>56){for(var +b=c;b<64;b++)a.b8[b]=0;cV(a.w,a.b32);for(var b=0;b<56;b++)a.b8[b]=0}else for(var -b=c;b<56;b++)a.b8[b]=0;a.b32[14]=a.len<<3;a.b32[15]=a.len>>29&0x1FFFFFFF;cD(a.w,a.b32);var +b=c;b<56;b++)a.b8[b]=0;a.b32[14]=a.len<<3;a.b32[15]=a.len>>29&0x1FFFFFFF;cV(a.w,a.b32);var e=new Uint8Array(16);for(var d=0;d<4;d++)for(var b=0;b<4;b++)e[d*4+b]=a.w[d]>>8*b&0xFF;return e}function -tc(a){return X(bO(a,0,a.length))}function -sW(a,b,c){var -d=sd(),e=ey(a);se(d,e.subarray(b,b+c),c);return tc(sc(d))}function -sX(a,b,c){return sW(aW(a),b,c)}function -sZ(){return 0}var -aJ=new +uo(a){return U(b1(a,0,a.length))}function +t$(a,b,c){var +d=tm(),e=eZ(a);tn(d,e.subarray(b,b+c),c);return uo(tl(d))}function +ua(a,b,c){return t$(a0(a),b,c)}function +uc(){return 0}var +aP=new Array();function -h8(a){return aJ[a]}function -aX(a){var -b=h8(a);if(!b.opened)l("Cannot flush a closed channel");if(!b.buffer||b.buffer_curr==0)return 0;if(b.output)b.output(bO(b.buffer,0,b.buffer_curr));else +i0(a){return aP[a]}function +a1(a){var +b=i0(a);if(!b.opened)l("Cannot flush a closed channel");if(!b.buffer||b.buffer_curr==0)return 0;if(b.output)b.output(b1(b.buffer,0,b.buffer_curr));else b.file.write(b.offset,b.buffer,0,b.buffer_curr);b.offset+=b.buffer_curr;b.buffer_curr=0;return 0}function -te(a,b){if(b.name)try{var -d=require(d2),c=d.openSync(b.name,"rs");return new -ae(c,b)}catch(f){}return new -ae(a,b)}var -cQ=new +uq(a,b){if(b.name)try{var +d=require(eo),c=d.openSync(b.name,"rs");return new +ai(c,b)}catch(f){}return new +ai(a,b)}var +c$=new Array(3);function -bE(a,b){N.call(this,F(0));this.log=function(a){return 0};if(a==1&&typeof +bS(a,b){N.call(this,F(0));this.log=function(a){return 0};if(a==1&&typeof console.log=="function")this.log=console.log;else if(a==2&&typeof console.error=="function")this.log=console.error;else if(typeof -console.log=="function")this.log=console.log;this.flags=b}bE.prototype.length=function(){return 0};bE.prototype.write=function(a,b,c,d){if(this.log){if(d>0&&c>=0&&c+d<=b.length&&b[c+d-1]==10)d--;var -e=F(d);ax(eg(b),c,e,0,d);this.log(e.toUtf16());return 0}l(this.fd+gA)};bE.prototype.read=function(a,b,c,d){l(this.fd+": file descriptor is write only")};bE.prototype.close=function(){this.log=undefined};function -cR(a,b){if(b==undefined)b=cQ.length;cQ[b]=a;return b|0}function -tn(a,b,c){var +console.log=="function")this.log=console.log;this.flags=b}bS.prototype.length=function(){return 0};bS.prototype.write=function(a,b,c,d){if(this.log){if(d>0&&c>=0&&c+d<=b.length&&b[c+d-1]==10)d--;var +e=F(d);aN(eH(b),c,e,0,d);this.log(e.toUtf16());return 0}l(this.fd+hi)};bS.prototype.read=function(a,b,c,d){l(this.fd+": file descriptor is write only")};bS.prototype.close=function(){this.log=undefined};function +da(a,b){if(b==undefined)b=c$.length;c$[b]=a;return b|0}function +uz(a,b,c){var d={};while(b){switch(b[1]){case 0:d.rdonly=1;break;case 1:d.wronly=1;break;case @@ -768,73 +818,71 @@ d={};while(b){switch(b[1]){case 5:d.excl=1;break;case 6:d.binary=1;break;case 7:d.text=1;break;case -8:d.nonblock=1;break}b=b[2]}if(d.rdonly&&d.wronly)l(an(a)+ed);if(d.text&&d.binary)l(an(a)+dY);var -e=ij(a),f=e.device.open(e.rest,d);return cR(f,undefined)}(function(){function -a(a,b){return bP()?te(a,b):new -bE(a,b)}cR(a(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:true}),0);cR(a(1,{buffered:2,wronly:1,isCharacterDevice:true}),1);cR(a(2,{buffered:2,wronly:1,isCharacterDevice:true}),2)}());function -s0(a){var -b=cQ[a];if(b.flags.wronly)l(g6+a+" is writeonly");var +8:d.nonblock=1;break}b=b[2]}if(d.rdonly&&d.wronly)l(ap(a)+eB);if(d.text&&d.binary)l(ap(a)+ek);var +e=jc(a),f=e.device.open(e.rest,d);return da(f,undefined)}(function(){function +a(a,b){return b2()?uq(a,b):new +bS(a,b)}da(a(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:true}),0);da(a(1,{buffered:2,wronly:1,isCharacterDevice:true}),1);da(a(2,{buffered:2,wronly:1,isCharacterDevice:true}),2)}());function +ud(a){var +b=c$[a];if(b.flags.wronly)l(hO+a+" is writeonly");var d=null,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:false,buffer_curr:0,buffer_max:0,buffer:new -Uint8Array(g8),refill:d};aJ[c.fd]=c;return c.fd}function -h9(a){var -b=cQ[a];if(b.flags.rdonly)l(g6+a+" is readonly");var +Uint8Array(hQ),refill:d};aP[c.fd]=c;return c.fd}function +i1(a){var +b=c$[a];if(b.flags.rdonly)l(hO+a+" is readonly");var d=b.flags.buffered!==undefined?b.flags.buffered:1,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:true,buffer_curr:0,buffer:new -Uint8Array(g8),buffered:d};aJ[c.fd]=c;return c.fd}function -s1(){var +Uint8Array(hQ),buffered:d};aP[c.fd]=c;return c.fd}function +ue(){var b=0;for(var -a=0;ae.buffer.length){var +a=0;ae.buffer.length){var g=new Uint8Array(e.buffer_curr+b.length);g.set(e.buffer);e.buffer=g}switch(e.buffered){case -0:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;aX(a);break;case -1:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)aX(a);break;case +0:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;a1(a);break;case +1:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)a1(a);break;case 2:var -f=b.lastIndexOf(10);if(f<0){e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)aX(a)}else{e.buffer.set(b.subarray(0,f+1),e.buffer_curr);e.buffer_curr+=f+1;aX(a);e.buffer.set(b.subarray(f+1),e.buffer_curr);e.buffer_curr+=b.length-f-1}break}return 0}function -s2(a,b,c,d){var -b=ey(b);return s3(a,b,c,d)}function -es(a,b,c,d){return s2(a,aW(b),c,d)}function -h_(a,b){var -c=X(String.fromCharCode(b));es(a,c,0,1);return 0}function -s4(a,b){if(b==0)ev();return a%b}function -bN(a,b){return+(cF(a,b,false)!=0)}function -s6(a,b){a[0]=at;a[1]=b;return 0}function -aL(a){if(a +f=b.lastIndexOf(10);if(f<0){e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)a1(a)}else{e.buffer.set(b.subarray(0,f+1),e.buffer_curr);e.buffer_curr+=f+1;a1(a);e.buffer.set(b.subarray(f+1),e.buffer_curr);e.buffer_curr+=b.length-f-1}break}return 0}function +uf(a,b,c,d){var +b=eZ(b);return ug(a,b,c,d)}function +eT(a,b,c,d){return uf(a,a0(b),c,d)}function +i2(a,b){var +c=U(String.fromCharCode(b));eT(a,c,0,1);return 0}function +a2(a,b){return+(cZ(a,b,false)!=0)}function +a3(a){if(a instanceof -Array&&a[0]==a[0]>>>0)return a[0];else if(cK(a))return cs;else if(cL(a))return cs;else if(a +Array&&a[0]==a[0]>>>0)return a[0];else if(c4(a))return cM;else if(c5(a))return cM;else if(a instanceof Function||typeof -a=="function")return 247;else if(a&&a.caml_custom)return gX;else -return bD}function -sj(a){var +a=="function")return 247;else if(a&&a.caml_custom)return hF;else +return bR}function +tu(a){var c={};if(a)for(var b=1;b=0)a=e;else -W("caml_register_global: cannot locate "+d)}}J[a+1]=b;if(c)J[c]=b}function -ex(a,b){h$[an(a)]=b;return 0}function -ta(){z(dW)}function -I(a,b){if(b>>>0>=p(a))ta();return Y(a,b)}function -cP(a){a.t&6&&bI(a);return X(a.c)}function -td(){return 0x7FFFFFFF/4|0}function -s9(){ib(J.Not_found)}function -id(a){var -b=ii(S(a));if(b===undefined)s9();return ag(b)}function -tf(){if(m.crypto)if(m.crypto.getRandomValues){var +I("caml_register_global: cannot locate "+d)}}J[a+1]=b;if(c)J[c]=b}function +eY(a,b){i3[ap(a)]=b;return 0}function +um(){A(ei)}function +T(a,b){if(b>>>0>=p(a))um();return V(a,b)}function +c_(a){a.t&6&&bX(a);return U(a.c)}function +up(){return 0x7FFFFFFF/4|0}function +uj(){i6(J.Not_found)}function +i9(a){var +b=jb(S(a));if(b===undefined)uj();return ak(b)}function +ur(){if(m.crypto)if(m.crypto.getRandomValues){var a=m.crypto.getRandomValues(new Int32Array(4));return[0,a[0],a[1],a[2],a[3]]}else if(m.crypto.randomBytes){var a=new Int32Array(m.crypto.randomBytes(16).buffer);return[0,a[0],a[1],a[2],a[3]]}var b=new Date().getTime(),c=b^0xffffffff*Math.random();return[0,c]}function -aM(a){var +aR(a){var b=1;while(a&&a.joo_tramp){a=a.joo_tramp.apply(null,a.joo_args);b++}return a}function o(a,b){return{joo_tramp:a,joo_args:b}}function -tg(a,b){if(b.fun){a.fun=b.fun;return 0}if(typeof +us(a,b){if(b.fun){a.fun=b.fun;return 0}if(typeof b==="function"){a.fun=b;return 0}var c=b.length;while(c--)a[c]=b[c];return 0}function -Z(a){{if(a +$(a){{if(a instanceof Array)return a;var b;if(m.RangeError&&a @@ -843,39 +891,39 @@ m.RangeError&&a.message&&a.message.match(/maximum call stack/i))b=J.Stack_overfl instanceof m.InternalError&&a.message&&a.message.match(/too much recursion/i))b=J.Stack_overflow;else if(a instanceof -m.Error&&aK(d9))b=[0,aK(d9),a];else -b=[0,J.Failure,ag(String(a))];if(a +m.Error&&aQ(ev))b=[0,aQ(ev),a];else +b=[0,J.Failure,ak(String(a))];if(a instanceof m.Error)b.js_error=a;return b}}function -sP(a){switch(a[2]){case-8:case-11:case-12:return 1;default:return 0}}function -ss(a){var -b=j;if(a[0]==0){b+=a[1][1];if(a.length==3&&a[2][0]==0&&sP(a[1]))var -f=a[2],g=1;else +t3(a){switch(a[2]){case-8:case-11:case-12:return 1;default:return 0}}function +tG(a){var +b=e;if(a[0]==0){b+=a[1][1];if(a.length==3&&a[2][0]==0&&t3(a[1]))var +g=a[2],h=1;else var -g=2,f=a;b+="(";for(var -e=g;eg)b+=gH;var -d=f[e];if(typeof +h=2,g=a;b+="(";for(var +f=h;fh)b+=hp;var +d=g[f];if(typeof d=="number")b+=d.toString();else if(d instanceof -aw)b+=cr+d.toString()+cr;else if(typeof -d=="string")b+=cr+d.toString()+cr;else -b+=ht}b+=")"}else if(a[0]==c)b+=a[1];return b}function -h2(a){if(a +ay)b+=cL+d.toString()+cL;else if(typeof +d=="string")b+=cL+d.toString()+cL;else +b+=ib}b+=")"}else if(a[0]==c)b+=a[1];return b}function +iL(a){if(a instanceof Array&&(a[0]==0||a[0]==c)){var -d=aK(hx);if(d)cE(d,[a,false]);else{var -e=ss(a),b=aK(g9);if(b)cE(b,[0]);console.error(d$+e);if(a.js_error)throw a.js_error}}else +d=aQ(ig);if(d)cY(d,[a,false]);else{var +e=tG(a),b=aQ(hR);if(b)cY(b,[0]);console.error(ex+e);if(a.js_error)throw a.js_error}}else throw a}function -s$(){var -c=m.process;if(c&&c.on)c.on("uncaughtException",function(a,b){h2(a);c.exit(2)});else if(m.addEventListener)m.addEventListener("error",function(a){if(a.error)h2(a.error)})}s$();function -h(a,b){return(a.l>=0?a.l:a.l=a.length)==1?a(b):aI(a,[b])}function -i(a,b,c){return(a.l>=0?a.l:a.l=a.length)==2?a(b,c):aI(a,[b,c])}function -bA(a,b,c,d){return(a.l>=0?a.l:a.l=a.length)==3?a(b,c,d):aI(a,[b,c,d])}function -dT(a,b,c,d,e,f){return(a.l>=0?a.l:a.l=a.length)==5?a(b,c,d,e,f):aI(a,[b,c,d,e,f])}function -sb(a,b,c,d,e,f,g,h){return(a.l>=0?a.l:a.l=a.length)==7?a(b,c,d,e,f,g,h):aI(a,[b,c,d,e,f,g,h])}var -tm=undefined;st();var -cU=[c,hN,-1],eE=[c,g3,-2],bS=[c,ee,-3],eB=[c,gI,-4],T=[c,gL,-7],eC=[c,hI,-8],eD=[c,hh,-9],f=[c,hp,-11],eF=[c,hB,-12],sa=[4,0,0,0,[12,45,[4,0,0,0,0]]],dd=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,hK,[4,0,0,0,[12,45,[4,0,0,0,[11,hG,[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],gf=[0,0];ab(11,eF,hB);ab(10,f,hp);ab(9,[c,hu,-10],hu);ab(8,eD,hh);ab(7,eC,hI);ab(6,T,gL);ab(5,[c,g0,-6],g0);ab(4,[c,ha,-5],ha);ab(3,eB,gI);ab(2,bS,ee);ab(1,eE,g3);ab(0,cU,hN);var -iv="output_substring",ir=aF,io="true",ip="false",iz="CamlinternalLazy.Undefined",iE="option is None",iH="\\\\",iI="\\'",iJ="\\b",iK="\\t",iL="\\n",iM="\\r",iT="List.init",iQ="hd",i3="String.blit / Bytes.blit_string",i2="Bytes.blit",i1="String.sub / Bytes.sub",i$="String.contains_from / Bytes.contains_from",ji="Array.iter2: arrays must have the same length",jg="Array.blit",je="Array.sub",jq=[0,"set.ml",570,18],jm=cw,jn=cw,jo=cw,jp=cw,jx="Map.remove_min_elt",jt=cA,ju=cA,jv=cA,jw=cA,jA="Stdlib.Queue.Empty",jK="Buffer.add_substring/add_subbytes",jH="Buffer.add: cannot grow buffer",jG=[0,gw,93,2],jF=[0,gw,94,2],jV="%c",jW="%s",jX=gP,jY=gF,jZ=hP,j0=gJ,j1="%f",j2="%B",j3="%{",j4="%}",j5="%(",j6="%)",j7="%a",j8="%t",j9="%?",j_="%r",j$="%_r",ka=[0,B,850,23],kl=[0,B,814,21],kd=[0,B,815,21],km=[0,B,818,21],ke=[0,B,819,21],kn=[0,B,822,19],kf=[0,B,823,19],ko=[0,B,826,22],kg=[0,B,827,22],kp=[0,B,831,30],kh=[0,B,832,30],kj=[0,B,836,26],kb=[0,B,837,26],kk=[0,B,846,28],kc=[0,B,847,28],ki=[0,B,851,23],lB=[0,B,1558,4],lC="Printf: bad conversion %[",lD=[0,B,1626,39],lE=[0,B,1649,31],lF=[0,B,1650,31],lG="Printf: bad conversion %_",lH=gZ,lI=hs,lJ=gZ,lK=hs,lw=d0,lu="neg_infinity",lv=g7,lt=aF,lo=[0,gy],lc="%+nd",ld="% nd",lf="%+ni",lg="% ni",lh="%nx",li="%#nx",lj="%nX",lk="%#nX",ll="%no",lm="%#no",lb="%nd",le=hP,ln="%nu",k0="%+ld",k1="% ld",k3="%+li",k4="% li",k5="%lx",k6="%#lx",k7="%lX",k8="%#lX",k9="%lo",k_="%#lo",kZ="%ld",k2=gF,k$="%lu",kM="%+Ld",kN="% Ld",kP="%+Li",kQ="% Li",kR="%Lx",kS="%#Lx",kT="%LX",kU="%#LX",kV="%Lo",kW="%#Lo",kL="%Ld",kO=gJ,kX="%Lu",ky="%+d",kz="% d",kB="%+i",kC="% i",kD="%x",kE="%#x",kF="%X",kG="%#X",kH="%o",kI="%#o",kx=dV,kA=gP,kJ=hc,jN="@]",jO="@}",jP="@?",jQ="@\n",jR="@.",jS="@@",jT="@%",jU="@",kq="CamlinternalFormat.Type_mismatch",lQ=j,lR=[0,[11,gH,[2,0,[2,0,0]]],", %s%s"],mn=[0,[11,d$,[2,0,[12,10,0]]],he],mo=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],"Fatal error in uncaught exception handler: exception %s\n"],mm="Fatal error: out of memory in uncaught exception handler",mj=[0,[11,d$,[2,0,[12,10,0]]],he],md=[0,[2,0,[12,10,0]],"%s\n"],me=[0,[11,gY,0],gY],l6="Raised at",l7="Re-raised at",l8="Raised by primitive operation at",l9="Called from",l_=" (inlined)",ma=j,l$=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,", line ",[4,0,0,0,[11,hK,sa]]]]]]]]]],'%s %s in file "%s"%s, line %d, characters %d-%d'],mb=[0,[2,0,[11," unknown location",0]],"%s unknown location"],lZ="Out of memory",l0="Stack overflow",l1="Pattern matching failed",l2="Assertion failed",l3="Undefined recursive module",lT=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],lU=j,lV=j,lW=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],lP=[0,[4,0,0,0,0],dV],lN=[0,[3,0,0],"%S"],lO=ht,mg=[0,j,"(Cannot print locations:\n bytecode executable program file not found)","(Cannot print locations:\n bytecode executable program file appears to be corrupt)","(Cannot print locations:\n bytecode executable program file has wrong magic number)","(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)"],ms="Fun.Finally_raised: ",mq="Stdlib.Fun.Finally_raised",mw="x",mG="Hashtbl: unsupported hash table format",mB=j,nm=[3,0,3],nn=aF,ng=hv,nh="<\/",ni=j,nc=hv,nd="<",ne=j,na="\n",m1=[0,j],mU=j,mV=j,mW=j,mX=j,mQ=[0,j,0,j],mM="Stdlib.Format.String_tag",nt="Jsoo_runtime.Error.Exn",nu=d9,ny=[0,b,157,10],nA=[0,b,179,10],nC=[0,b,191,10],nF=[0,b,hO,17],nO=[0,b,367,16],nP=[0,b,368,18],nQ=[0,b,372,15],nR=[0,b,377,15],nS=[0,b,hy,15],nT=[0,b,386,10],nU=[0,b,362,16],nV=[0,b,517,12],nW=[0,b,459,14],n7=[0,b,686,27],n6=[0,b,651,27],n0=[0,b,560,16],nX=[0,b,550,23],nY=[0,b,544,14],nN=[0,b,334,9],nJ=[0,b,309,9],nI=[0,b,305,9],nH=[0,[11,"Lwd: unsafe mutation (variable invalidated during evaluation) at\n",[15,0]],"Lwd: unsafe mutation (variable invalidated during evaluation) at\n%a"],nE=[0,b,gT,14],nB=[0,b,186,14],nz=[0,b,169,14],nx=[0,b,152,14],n1="Lwd.Release_failure",oc=[0,a,64,12],op=[0,a,205,18],oo=[0,a,hO,9],or=[0,a,224,18],oq=[0,a,237,9],os=[0,a,240,21],ot=[0,a,at,21],ou=[0,a,260,21],ow=[0,a,296,14],oW=[0,a,553,18],oX=[0,a,557,12],oY=[0,a,546,14],oV=[0,a,538,21],oT=[0,a,531,14],oR=[0,a,523,14],oP=[0,a,492,29],oO=[0,a,499,29],oM=[0,a,462,21],oH=[0,a,420,10],oI=[0,a,423,15],oJ=[0,a,435,10],oK=[0,a,457,2],oC=[0,a,371,24],oD=[0,a,391,16],oE=[0,a,394,2],oz=[0,a,315,18],oy=[0,a,317,9],ol=[0,a,193,4],ok=[0,a,gT,21],oi=[0,a,gE,4],oj=[0,a,177,14],og=[0,a,113,14],oe=[0,a,82,21],oa=[0,a,32,14],pp=[0,M,571,12],pa=[0,M,321,37],pb=[0,M,322,37],pd=[0,M,346,10],pe=[0,M,357,42],pc=[0,M,337,37],pg=[0,M,375,10],ph=[0,M,hy,42],pf=[0,M,338,37],pk=[0,M,425,16],pn=[0,M,513,50],pl=[0,M,480,6],pj=[0,M,395,14],o4=[0,M,gE,57],o5=[0,M,182,57],o6=[0,M,238,11],oZ=hm,o0=hm,qb="debug",p3="scrollTop",qg="isSecureContext",qu=[0,gW,233,16],qs=[0,gW,201,16],qn=[0,0,0],ql=[0,0,0],qK="CCFQueue.Empty",qL=[0,0],qU="content-box",qV="border-box",qW="device-pixel-content-box",q7="not implemented",q4=[0,[8,[0,0,0],0,0,[11,hC,0]],"%fpx"],q5=[0,[8,[0,0,0],0,0,[11,hd,0]],"%frem"],q6=[0,[8,[0,0,0],0,0,[11,g5,0]],"%fem"],q1=hC,q2=hd,q3=g5,q_="Common.Utils.Forward_ref.Not_set",ra="Common.Utils.Forward_ref.Already_set",re=j,rd=[0,[12,91,[2,0,[11,"] ",[2,0,0]]]],"[%s] %s"],rm="TODO not implemented",rr=[0,80,[0,"lwdui-controlled-scroll-wrapper"]],rs=[0,80,"lwdui-controlled-scroll-controls"],rt="Show playing",rE=[0,[11,hz,[2,0,0]],"height: %s"],rA=[0,[2,0,[12,32,[2,0,0]]],"%s %s"],ry="grid-template-columns",rz=[0,[2,0,[11,hG,[2,0,[12,59,0]]]],"%s: %s;"],rB=j,rF=[1,4.],rN=[0,80,gB],rL="Row height",rM="Visible height:",rJ=[0,[11,"height: calc(",[2,0,[11," * ",[4,3,0,0,[11,");",0]]]]],"height: calc(%s * %i);"],rK=[0,[11,hz,[2,0,[11," !important;",0]]],"height: %s !important;"],rO=[0,80,[0,"lwdui-lazy-table-content"]],rP=[0,80,[0,"lwdui-lazy-table-content-wrapper"]],rQ=[0,"lwdui-lazy-table",0],rG="virtual table",rU="square",rV="1fr",rW=hg,rY=gV,rZ="5em",r0=hg,r1=[2,5.],r4=[0,80,[0,"table"]],r6="options",r8=[0,80,[0,"flex"]];function +ul(){var +c=m.process;if(c&&c.on)c.on("uncaughtException",function(a,b){iL(a);c.exit(2)});else if(m.addEventListener)m.addEventListener("error",function(a){if(a.error)iL(a.error)})}ul();function +h(a,b){return(a.l>=0?a.l:a.l=a.length)==1?a(b):aO(a,[b])}function +i(a,b,c){return(a.l>=0?a.l:a.l=a.length)==2?a(b,c):aO(a,[b,c])}function +bO(a,b,c,d){return(a.l>=0?a.l:a.l=a.length)==3?a(b,c,d):aO(a,[b,c,d])}function +ef(a,b,c,d,e,f){return(a.l>=0?a.l:a.l=a.length)==5?a(b,c,d,e,f):aO(a,[b,c,d,e,f])}function +tk(a,b,c,d,e,f,g,h){return(a.l>=0?a.l:a.l=a.length)==7?a(b,c,d,e,f,g,h):aO(a,[b,c,d,e,f,g,h])}var +uy=undefined;tH();var +dc=[c,iv,-1],e4=[c,hK,-2],b4=[c,eC,-3],db=[c,hq,-4],W=[c,ht,-7],e2=[c,iq,-8],e3=[c,h1,-9],f=[c,h9,-11],e5=[c,ij,-12],tj=[4,0,0,0,[12,45,[4,0,0,0,0]]],dx=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,is,[4,0,0,0,[12,45,[4,0,0,0,[11,ip,[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],g0=[0,0];ae(11,e5,ij);ae(10,f,h9);ae(9,[c,ic,-10],ic);ae(8,e3,h1);ae(7,e2,iq);ae(6,W,ht);ae(5,[c,hI,-6],hI);ae(4,[c,hU,-5],hU);ae(3,db,hq);ae(2,b4,eC);ae(1,e4,hK);ae(0,dc,iv);var +jn="output_substring",jj=aJ,jg="true",jh="false",js="CamlinternalLazy.Undefined",jz="option is None",jC="\\\\",jD="\\'",jE="\\b",jF="\\t",jG="\\n",jH="\\r",jO="List.init",jL="hd",j0="String.blit / Bytes.blit_string",jZ="Bytes.blit",jY="String.sub / Bytes.sub",j_="String.contains_from / Bytes.contains_from",kg="Array.iter2: arrays must have the same length",ke="Array.blit",kd="Array.sub",ko=[0,"set.ml",hN,18],kk=cP,kl=cP,km=cP,kn=cP,kv="Map.remove_min_elt",kr=cT,ks=cT,kt=cT,ku=cT,ky="Stdlib.Queue.Empty",kG="Buffer.add_substring/add_subbytes",kE="Buffer.add: cannot grow buffer",kN="first domain already spawned",kK=[0,"domain.ml",184,13],kY="%c",kZ="%s",k0=hx,k1=hn,k2=ix,k3=hr,k4="%f",k5="%B",k6="%{",k7="%}",k8="%(",k9="%)",k_="%a",k$="%t",la="%?",lb="%r",lc="%_r",ld=[0,C,850,23],lo=[0,C,814,21],lg=[0,C,815,21],lp=[0,C,818,21],lh=[0,C,819,21],lq=[0,C,822,19],li=[0,C,823,19],lr=[0,C,826,22],lj=[0,C,827,22],ls=[0,C,831,30],lk=[0,C,832,30],lm=[0,C,836,26],le=[0,C,837,26],ln=[0,C,846,28],lf=[0,C,847,28],ll=[0,C,851,23],mE=[0,C,1558,4],mF="Printf: bad conversion %[",mG=[0,C,1626,39],mH=[0,C,1649,31],mI=[0,C,1650,31],mJ="Printf: bad conversion %_",mK=hH,mL=ia,mM=hH,mN=ia,mz=em,mx="neg_infinity",my=hP,mw=aJ,mr=[0,hg],mf="%+nd",mg="% nd",mi="%+ni",mj="% ni",mk="%nx",ml="%#nx",mm="%nX",mn="%#nX",mo="%no",mp="%#no",me="%nd",mh=ix,mq="%nu",l3="%+ld",l4="% ld",l6="%+li",l7="% li",l8="%lx",l9="%#lx",l_="%lX",l$="%#lX",ma="%lo",mb="%#lo",l2="%ld",l5=hn,mc="%lu",lP="%+Ld",lQ="% Ld",lS="%+Li",lT="% Li",lU="%Lx",lV="%#Lx",lW="%LX",lX="%#LX",lY="%Lo",lZ="%#Lo",lO="%Ld",lR=hr,l0="%Lu",lB="%+d",lC="% d",lE="%+i",lF="% i",lG="%x",lH="%#x",lI="%X",lJ="%#X",lK="%o",lL="%#o",lA=eh,lD=hx,lM=hW,kQ="@]",kR="@}",kS="@?",kT="@\n",kU="@.",kV="@@",kW="@%",kX="@",lt="CamlinternalFormat.Type_mismatch",mT=e,mU=[0,[11,hp,[2,0,[2,0,0]]],", %s%s"],nu=[0,[11,ex,[2,0,[12,10,0]]],hY],nv=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],"Fatal error in uncaught exception handler: exception %s\n"],nt="Fatal error: out of memory in uncaught exception handler",nq=[0,[11,ex,[2,0,[12,10,0]]],hY],nk=[0,[2,0,[12,10,0]],"%s\n"],nl=[0,[11,hG,0],hG],m$="Raised at",na="Re-raised at",nb="Raised by primitive operation at",nc="Called from",nd=[0,[12,32,[4,0,0,0,0]]," %d"],nh=[0,[11,"s ",[4,0,0,0,[12,45,[4,0,0,0,0]]]],"s %d-%d"],ne=" (inlined)",ng=e,nf=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,", line",[2,0,[11,is,tj]]]]]]]]]],'%s %s in file "%s"%s, line%s, characters %d-%d'],ni=[0,[2,0,[11," unknown location",0]],"%s unknown location"],m4="Out of memory",m5="Stack overflow",m6="Pattern matching failed",m7="Assertion failed",m8="Undefined recursive module",mW=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],mX=e,mY=e,mZ=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],mS=[0,[4,0,0,0,0],eh],mQ=[0,[3,0,0],"%S"],mR=ib,nn=[0,e,"(Cannot print locations:\n bytecode executable program file not found)","(Cannot print locations:\n bytecode executable program file appears to be corrupt)","(Cannot print locations:\n bytecode executable program file has wrong magic number)","(Cannot print locations:\n bytecode executable program file cannot be opened;\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)"],nz="Fun.Finally_raised: ",nx="Stdlib.Fun.Finally_raised",nA="Digest.BLAKE2: wrong hash size",nM=_(14371852,15349651,22696),nN=_(12230193,11438743,35013),nO=_(1424933,15549263,2083),nP=_(9492471,4696708,43520),nD=_(1,0,0),nE=_(0,0,0),nH=_(1,0,0),nF=_(0,0,0),nG=_(2,0,0),nX="Hashtbl: unsupported hash table format",nR=e,oA=[3,0,3],oB=aJ,ov=id,ow="<\/",ox=e,or=id,os="<",ot=e,op="\n",og=[0,e],n$=e,oa=e,ob=e,oc=e,n7=[0,e,0,e],n3="Stdlib.Format.String_tag",oE="Jsoo_runtime.Error.Exn",oF=ev,oJ=[0,b,157,10],oL=[0,b,179,10],oN=[0,b,191,10],oQ=[0,b,iw,17],oZ=[0,b,367,16],o0=[0,b,368,18],o1=[0,b,372,15],o2=[0,b,377,15],o3=[0,b,383,15],o4=[0,b,386,10],o5=[0,b,362,16],o6=[0,b,517,12],o7=[0,b,459,14],pg=[0,b,686,27],pf=[0,b,651,27],o$=[0,b,560,16],o8=[0,b,550,23],o9=[0,b,544,14],oY=[0,b,334,9],oU=[0,b,309,9],oT=[0,b,305,9],oS=[0,[11,"Lwd: unsafe mutation (variable invalidated during evaluation) at\n",[15,0]],"Lwd: unsafe mutation (variable invalidated during evaluation) at\n%a"],oP=[0,b,hB,14],oM=[0,b,186,14],oK=[0,b,169,14],oI=[0,b,152,14],pa="Lwd.Release_failure",pn=[0,a,64,12],pA=[0,a,205,18],pz=[0,a,iw,9],pC=[0,a,224,18],pB=[0,a,237,9],pD=[0,a,240,21],pE=[0,a,aI,21],pF=[0,a,260,21],pH=[0,a,296,14],p6=[0,a,553,18],p7=[0,a,557,12],p8=[0,a,546,14],p5=[0,a,538,21],p3=[0,a,531,14],p2=[0,a,523,14],p0=[0,a,492,29],pZ=[0,a,499,29],pX=[0,a,462,21],pS=[0,a,420,10],pT=[0,a,423,15],pU=[0,a,435,10],pV=[0,a,457,2],pN=[0,a,371,24],pO=[0,a,391,16],pP=[0,a,394,2],pK=[0,a,315,18],pJ=[0,a,317,9],pw=[0,a,193,4],pv=[0,a,hB,21],pt=[0,a,hm,4],pu=[0,a,177,14],pr=[0,a,113,14],pp=[0,a,82,21],pl=[0,a,32,14],qz=[0,M,hN,12],qk=[0,M,321,37],ql=[0,M,322,37],qn=[0,M,346,10],qo=[0,M,358,8],qm=[0,M,337,37],qq=[0,M,375,10],qr=[0,M,384,8],qp=[0,M,338,37],qu=[0,M,425,16],qx=[0,M,513,50],qv=[0,M,480,6],qt=[0,M,395,14],qc=[0,M,hm,57],qd=[0,M,182,57],qe=[0,M,238,11],p9=h6,p_=h6,rl="debug",rb="scrollTop",rq="isSecureContext",rE=[0,hE,233,16],rC=[0,hE,201,16],rx=[0,0,0],rv=[0,0,0],rT="CCFQueue.Empty",rU=[0,0],r3="content-box",r4="border-box",r5="device-pixel-content-box",se="not implemented",sb=[0,[8,[0,0,0],0,0,[11,ik,0]],"%fpx"],sc=[0,[8,[0,0,0],0,0,[11,hX,0]],"%frem"],sd=[0,[8,[0,0,0],0,0,[11,hM,0]],"%fem"],r_=ik,r$=hX,sa=hM,sh="Common.Utils.Forward_ref.Not_set",sj="Common.Utils.Forward_ref.Already_set",sn=e,sm=[0,[12,91,[2,0,[11,"] ",[2,0,0]]]],"[%s] %s"],sv="TODO not implemented",sA=[0,80,[0,"lwdui-controlled-scroll-wrapper"]],sB=[0,80,"lwdui-controlled-scroll-controls"],sC="Show playing",sN=[0,[11,ih,[2,0,0]],"height: %s"],sJ=[0,[2,0,[12,32,[2,0,0]]],"%s %s"],sH="grid-template-columns",sI=[0,[2,0,[11,ip,[2,0,[12,59,0]]]],"%s: %s;"],sK=e,sO=[1,4.],sW=[0,80,hj],sU="Row height",sV="Visible height:",sS=[0,[11,"height: calc(",[2,0,[11," * ",[4,3,0,0,[11,");",0]]]]],"height: calc(%s * %i);"],sT=[0,[11,ih,[2,0,[11," !important;",0]]],"height: %s !important;"],sX=[0,80,[0,"lwdui-lazy-table-content"]],sY=[0,80,[0,"lwdui-lazy-table-content-wrapper"]],sZ=[0,"lwdui-lazy-table",0],sP="virtual table",s3="square",s4="1fr",s5=h0,s7=hD,s8="5em",s9=h0,s_=[2,5.],tb=[0,80,[0,"table"]],td="options",tf=[0,80,[0,"flex"]];function u(a){if(typeof a==="number")return 0;switch(a[0]){case 0:return[0,u(a[1])];case @@ -956,103 +1004,124 @@ F=a[1];return[21,F,s(a[2],b)];case 23:var G=a[1];return[23,G,s(a[2],b)];default:var H=a[2],I=a[1];return[24,I,H,s(a[3],b)]}}function -cS(a){return[0,a]}function -bQ(a){return a[1]}function -cT(a,b,c){return a[1]===b?(a[1]=c,1):0}function -bR(a){throw g([0,bS,a],1)}function -t(a){throw g([0,eB,a],1)}function -bT(a){return 0<=a?a:-a|0}function -ah(a,b){return a+b}function -eG(a){return j+a}function -iq(b){var +b3(a){throw g([0,b4,a],1)}function +t(a){throw g([0,db,a],1)}function +b5(a){return 0<=a?a:-a|0}function +ar(a,b){return a+b}function +e6(a){return e+a}function +ji(b){var e=p(b);return function(a){var -c=a;for(;;){if(e<=c)return ah(b,ir);var -d=I(b,c);a:{if(48<=d){if(58>d)break a}else if(45===d)break a;return b}c=c+1|0}}(0)}function -eH(a,b){if(!a)return b;var -c=a[1];return[0,c,eH(a[2],b)]}s0(0);var -it=h9(1),ac=h9(2);function -bk(a,b){es(a,b,0,p(b));return}function -eI(a){bk(ac,a);h_(ac,10);return aX(ac)}var -cV=cS(function(a){return function(a){var +c=a;for(;;){if(e<=c)return ar(b,jj);var +d=T(b,c);a:{if(48<=d){if(58>d)break a}else if(45===d)break a;return b}c=c+1|0}}(0)}function +jm(a,b,c,d){var +f=a,e=b,g=c;for(;;){if(!g){f[1+e]=d;return}var +h=g[2],i=g[1];if(!h){f[1+e]=[0,i,d];return}var +j=h[2],k=h[1];if(!j){f[1+e]=[0,i,[0,k,d]];return}var +l=[0,j[1],aK],m=j[2];f[1+e]=[0,i,[0,k,l]];f=l;e=1;g=m}}ud(0);var +dd=i1(1),X=i1(2);function +bt(a,b){eT(a,b,0,p(b));return}function +e7(a,b,c,d){if(0<=c&&0<=d&&(p(b)-d|0)>=c)return eT(a,b,c,d);return t(jn)}function +e8(a){bt(X,a);i2(X,10);return a1(X)}var +de=[0,function(a){return function(a){var b=a;for(;;){if(!b)return 0;var -d=b[2],e=b[1];try{aX(e)}catch(f){var -c=Z(f);if(c[1]!==eE)throw g(c,0)}b=d}}(s1(0))});function -cW(a){return h(bQ(cV),0)}ex(g9,cW);function -ik(a){return a^-1}var -il=hA;function -im(a){return a?io:ip}function -is(a){return iq(ek("%.12g",a))}function -iu(a,b,c,d){if(0<=c&&0<=d&&(p(b)-d|0)>=c)return es(a,b,c,d);return t(iv)}function -iw(c){for(;;){var -d=cS(1),a=bQ(cV);let -e=d,f=a;var -b=1-cT(cV,a,function(a){if(cT(e,1,0))h(c,0);return h(f,0)});if(!b)return b}}function -bU(a){return aX(a)}function -ix(a,b){h_(a,b);return}var -cX=td(0),bl=(4*cX|0)-1|0;function -iy(a){return 1-(typeof -a==="number"?1:0)}var -iA=[c,iz,am(0)];function -iB(a){throw g(iA,1)}function -cY(a){var -d=a[1];a[1]=iB;try{var -c=h(d,0);s6(a,c);return c}catch(f){var -b=Z(f);a[1]=function(a){throw g(b,0)};throw g(b,0)}}function -iC(a){var -b=aL(a);if(b!==at&&b!==be&&b!==hn)return a;return sS(a)}function -eJ(a){return a?1:0}function -iD(a){return a?a[1]:t(iE)}function -iF(a,b){return 0===b[0]?[0,h(a,b[1])]:b}function -iG(a){a:{if(40<=a){if(92===a)return iH;if(ec>a)break a}else{if(32<=a){if(39<=a)return iI;break a}if(14>a)switch(a){case -8:return iJ;case -9:return iK;case -10:return iL;case -13:return iM}}var -b=F(4);w(b,0,92);w(b,1,48+(a/d3|0)|0);w(b,2,48+((a/10|0)%10|0)|0);w(b,3,48+(a%10|0)|0);return cP(b)}var -c=F(1);w(c,0,a);return cP(c)}function -iN(a){return 25>>0?a:a+hH|0}function -iO(a,b){var +d=b[2],e=b[1];try{a1(e)}catch(f){var +c=$(f);if(c[1]!==e4)throw g(c,0)}b=d}}(ue(0))}],e9=[0,function(a){return}];function +df(a){h(e9[1],0);return h(eE(de),0)}eY(hR,df);function +bu(a){return a1(a)}function +jd(a){return a^-1}var +je=ii;function +jf(a){return a?jg:jh}function +jk(a){return ji(eK("%.12g",a))}function +jl(a,b){if(!a)return b;var +c=a[2],d=a[1];if(!c)return[0,d,b];var +e=c[2],f=c[1];if(!e)return[0,d,[0,f,b]];var +g=[0,e[1],aK];jm(g,1,e[2],b);return[0,d,[0,f,g]]}function +jo(c){for(;;){var +a=eE(de);let +d=[0,1],e=a;var +b=1-eD(de,a,function(a){if(eD(d,1,0))h(c,0);return h(e,0)});if(!b)return b}}function +jp(a,b){i2(a,b);return}var +dg=up(0),bv=(4*dg|0)-1|0;function +jq(a){return 1-(typeof +a==="number"?1:0)}function +e_(a,b,c){return eD(a,b,c)}function +bw(a){return eE(a)}function +bx(a){return[0,a]}function +jr(a,b){return tq(a,b)}var +jt=[c,js,ao(0)];function +ju(a){var +d=a[1];a[1]=0;try{var +c=h(d,0);a[1]=c;iY(a);return c}catch(f){var +b=$(f);a[1]=function(a){throw g(b,0)};t6(a);throw g(b,0)}}function +jv(a){var +c=a[1];a[1]=0;var +b=h(c,0);a[1]=b;iY(a);return b}function +jw(a,b){if(0===t7(b))return a?jv(b):ju(b);throw g(jt,1)}function +e$(a){return jw(0,a)}function +jx(a){var +b=a3(a);if(b!==aI&&b!==bm&&b!==bl&&b!==h7)return a;return t5(a)}function +fa(a){return a?1:0}function +jy(a){return a?a[1]:t(jz)}function +jA(a,b){return 0===b[0]?[0,h(a,b[1])]:b}function +jB(a){a:{if(40<=a){if(92===a)return jC;if(eA>a)break a}else{if(32<=a){if(39<=a)return jD;break a}if(14>a)switch(a){case +8:return jE;case +9:return jF;case +10:return jG;case +13:return jH}}var +b=F(4);v(b,0,92);v(b,1,48+(a/ep|0)|0);v(b,2,48+((a/10|0)%10|0)|0);v(b,3,48+(a%10|0)|0);return c_(b)}var +c=F(1);v(c,0,a);return c_(c)}function +jI(a){return 25>>0?a:a-32|0}function +jJ(a,b){var d=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function -cZ(a){return iO(0,a)}function -aY(a,b){var +dh(a){return jJ(0,a)}function +a4(a,b){var c=a,d=b;for(;;){if(!c)return d;var e=[0,c[1],d];c=c[2];d=e}}function -aN(a){return aY(a,0)}function -eK(a,b,c){if(b<=a)return 0;var -d=h(c,a);return[0,d,eK(a+1|0,b,c)]}function -iP(a){return a?a[1]:bR(iQ)}function -iR(a,b,c,d){var -f=a,e=b;for(;;){if(c<=e)return f;f=[0,h(d,e),f];e=e+1|0}}function -c0(a){if(!a)return 0;var -b=a[1];return eH(b,c0(a[2]))}function -c1(a,b){if(!b)return 0;var -c=b[2],d=h(a,b[1]);return[0,d,c1(a,c)]}function -aO(a,b){var +by(a){return a4(a,0)}function +jM(a,b,c){if(b>1,s=h(r,b),D=s[1],t=h(a-r|0,s[2]),E=t[2];return[0,A(D,t[1],0),E]}var -a=cZ(b);return 2<=a?h(a,b)[1]:b}function -c3(a,b){return b<=a?a:b}function -eL(a){return j+a}function -iY(a,b){return h6(a,b)}function -iZ(a,b){return a<=b?a:b}function -aP(a,b){var -c=F(a);sq(c,0,a,b);return c}function -i0(a){var -b=af(a),c=F(b);ax(a,0,c,0,b);return c}function -eM(a,b,c){if(0<=b&&0<=c&&(af(a)-c|0)>=b){var -d=F(c);ax(a,b,d,0,c);return d}return t(i1)}function -eN(a,b,c){return cP(eM(a,b,c))}function -eO(a,b,c,d,e){if(0<=e&&0<=b&&(af(a)-e|0)>=b&&0<=d&&(af(c)-e|0)>=d){ax(a,b,c,d,e);return}return t(i2)}function -ap(a,b,c,d,e){if(0<=e&&0<=b&&(p(a)-e|0)>=b&&0<=d&&(af(c)-e|0)>=d){bG(a,b,c,d,e);return}return t(i3)}function -i5(a,b){var -d=af(b);if(0===d)return b;var +a=dh(b);return 2<=a?h(a,b)[1]:b}function +fc(a,b){return b<=a?a:b}function +jV(a,b){return iV(a,b)}function +jW(a,b){return a<=b?a:b}function +jX(a){return e+a}function +aT(a,b){var +c=F(a);tE(c,0,a,b);return c}function +fd(a,b,c){if(0<=b&&0<=c&&(aq(a)-c|0)>=b){var +d=F(c);aN(a,b,d,0,c);return d}return t(jY)}function +fe(a,b,c){return c_(fd(a,b,c))}function +ff(a,b,c,d,e){if(0<=e&&0<=b&&(aq(a)-e|0)>=b&&0<=d&&(aq(c)-e|0)>=d){aN(a,b,c,d,e);return}return t(jZ)}function +af(a,b,c,d,e){if(0<=e&&0<=b&&(p(a)-e|0)>=b&&0<=d&&(aq(c)-e|0)>=d){bV(a,b,c,d,e);return}return t(j0)}function +j2(a,b){var +d=aq(b);if(0===d)return b;var e=F(d),f=d-1|0,g=0;if(f>=0){var -c=g;for(;;){w(e,c,h(a,eh(b,c)));var +c=g;for(;;){v(e,c,h(a,cX(b,c)));var i=c+1|0;if(f===c)break;c=i}}return e}function -c4(a){return aW(a)}function -ad(a){return cP(a)}function -i4(a){var -b=[0,0],j=af(a)-1|0,l=0;if(j>=0){var +b7(a){return a0(a)}function +aa(a){return c_(a)}function +j1(a){var +b=[0,0],j=aq(a)-1|0,l=0;if(j>=0){var g=l;for(;;){var -e=eh(a,g);a:{b:{c:{if(32<=e){var +e=cX(a,g);a:{b:{c:{if(32<=e){var h=e-34|0;if(58>>0){if(93<=h)break c}else if(56>>0)break b;var i=1;break a}if(11<=e){if(13===e)break b}else if(8<=e)break b}var i=4;break a}var i=2}b[1]=b[1]+i|0;var -o=g+1|0;if(j===g)break;g=o}}if(b[1]===af(a))return i0(a);var +o=g+1|0;if(j===g)break;g=o}}if(b[1]===aq(a))return a;var c=F(b[1]);b[1]=0;var -k=af(a)-1|0,m=0;if(k>=0){var +k=aq(a)-1|0,m=0;if(k>=0){var f=m;for(;;){var -d=eh(a,f);a:{b:{c:{if(35<=d){if(92!==d){if(ec<=d)break c;break b}}else{if(32>d){if(14<=d)break c;switch(d){case -8:w(c,b[1],92);b[1]++;w(c,b[1],98);break a;case -9:w(c,b[1],92);b[1]++;w(c,b[1],116);break a;case -10:w(c,b[1],92);b[1]++;w(c,b[1],110);break a;case -13:w(c,b[1],92);b[1]++;w(c,b[1],114);break a;default:break c}}if(34>d)break b}w(c,b[1],92);b[1]++;w(c,b[1],d);break a}w(c,b[1],92);b[1]++;w(c,b[1],48+(d/d3|0)|0);b[1]++;w(c,b[1],48+((d/10|0)%10|0)|0);b[1]++;w(c,b[1],48+(d%10|0)|0);break a}w(c,b[1],d)}b[1]++;var +d=cX(a,f);a:{b:{c:{if(35<=d){if(92!==d){if(eA<=d)break c;break b}}else{if(32>d){if(14<=d)break c;switch(d){case +8:v(c,b[1],92);b[1]++;v(c,b[1],98);break a;case +9:v(c,b[1],92);b[1]++;v(c,b[1],116);break a;case +10:v(c,b[1],92);b[1]++;v(c,b[1],110);break a;case +13:v(c,b[1],92);b[1]++;v(c,b[1],114);break a;default:break c}}if(34>d)break b}v(c,b[1],92);b[1]++;v(c,b[1],d);break a}v(c,b[1],92);b[1]++;v(c,b[1],48+(d/ep|0)|0);b[1]++;v(c,b[1],48+((d/10|0)%10|0)|0);b[1]++;v(c,b[1],48+(d%10|0)|0);break a}v(c,b[1],d)}b[1]++;var n=f+1|0;if(k===f)break;f=n}}return c}function -i6(a){return i5(iN,a)}function -eP(a,b){return ad(aP(a,b))}function -i9(a,b,c,d){var -e=c;for(;;){if(b<=e)throw g(T,1);if(Y(a,e)===d)return e;e=e+1|0}}function -i_(a,b,c){var -d=p(a);if(0<=b&&d>=b)try{i9(a,d,b,c);var +j3(a){return j2(jI,a)}function +j4(a,b){return tw(a,b)}function +j5(a,b,c){tx(a,b,c);return}function +fg(a,b){return aa(aT(a,b))}function +j8(a,b,c,d){var +e=c;for(;;){if(b<=e)throw g(W,1);if(V(a,e)===d)return e;e=e+1|0}}function +j9(a,b,c){var +d=p(a);if(0<=b&&d>=b)try{j8(a,d,b,c);var f=1;return f}catch(f){var -e=Z(f);if(e===T)return 0;throw g(e,0)}return t(i$)}function -i7(a,b,c){return ad(eM(c4(a),b,c))}function -i8(a){return function(a,b,c){var -d=c;for(;;){if(b<=d)return a;var -e=Y(a,d)+hH|0;a:{if(59>>0){if(33>>0)break a}else if(2===e)break a;d=d+1|0;continue}return ad(i4(c4(a)))}}(a,p(a),0)}function -ja(a,b){return i_(a,0,b)}function -jb(a){return ad(i6(c4(a)))}function -jc(a,b){return tb(a,b)}function -jk(a,b){var +e=$(f);if(e===W)return 0;throw g(e,0)}return t(j_)}function +b8(a,b){return j4(b7(a),b)}function +j6(a,b,c){return aa(fd(b7(a),b,c))}function +j7(a){return aa(j1(b7(a)))}function +j$(a,b){return j9(a,0,b)}function +ka(a){return aa(j3(b7(a)))}function +kb(a,b){return un(a,b)}function +fh(a,b,c,d,e){if(0<=e&&0<=b&&(a.length-1-e|0)>=b&&0<=d&&(c.length-1-e|0)>=d){to(a,b,c,d,e);return}return t(ke)}function +ki(a,b){var d=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function -eQ(a){if(!a)return[0];var -b=a[2],c=a[1],e=ao(jk(0,a),c);return function(a,b){var +fi(a){if(!a)return[0];var +b=a[2],c=a[1],e=aj(ki(0,a),c);return function(a,b){var d=a,c=b;for(;;){if(!c)return e;var f=c[2];e[1+d]=c[1];d=d+1|0;c=f}}(1,b)}function -jd(a,b,c){if(0<=b&&0<=c&&(a.length-1-c|0)>=b)return sg(a,b,c);return t(je)}function -jf(a,b,c,d,e){if(0<=e&&0<=b&&(a.length-1-e|0)>=b&&0<=d&&(c.length-1-e|0)>=d){sf(a,b,c,d,e);return}return t(jg)}function -jh(a,b,c){if(b.length-1!==c.length-1)return t(ji);var +kc(a,b,c){if(0<=b&&0<=c&&(a.length-1-c|0)>=b)return tp(a,b,c);return t(kd)}function +kf(a,b,c){if(b.length-1!==c.length-1)return t(kg);var e=b.length-2|0,f=0;if(e>=0){var d=f;for(;;){i(a,b[1+d],c[1+d]);var g=d+1|0;if(e===d)break;d=g}}return 0}function -jj(a,b){var +kh(a,b){var d=b.length-1;if(0===d)return[0];var -e=ao(d,h(a,b[1])),f=d-1|0,g=1;if(f>=1){var +e=aj(d,h(a,b[1])),f=d-1|0,g=1;if(f>=1){var c=g;for(;;){e[1+c]=h(a,b[1+c]);var i=c+1|0;if(f===c)break;c=i}}return e}function -jl(k){function +kj(k){function j(a){return a?a[4]:0}function d(a,b,c){var d=a?a[4]:0,e=c?c[4]:0,f=e<=d?d+1|0:e+1|0;return[0,a,b,c,f]}function l(a,b,c){var -g=a?a[4]:0,h=c?c[4]:0;if((h+2|0)=h){var -w=h<=g?g+1|0:h+1|0;return[0,a,b,c,w]}if(!c)return t(jp);var -k=c[3],m=c[2],f=c[1],r=j(f);if(r<=j(k))return d(d(a,b,f),m,k);if(!f)return t(jo);var +w=h<=g?g+1|0:h+1|0;return[0,a,b,c,w]}if(!c)return t(kn);var +k=c[3],m=c[2],f=c[1],r=j(f);if(r<=j(k))return d(d(a,b,f),m,k);if(!f)return t(km);var s=f[2],u=f[1],v=d(f[3],m,k);return d(d(a,b,u),s,v)}function c(a,b){if(!b)return[0,0,a,0,1];var d=b[3],e=b[2],f=b[1],g=i(k[1],a,e);if(0===g)return b;if(0<=g){var @@ -1199,36 +1267,36 @@ c(a,b){if(3>=a>>>0)switch(a){case h=b[2];if(h)return[0,[0,[0,0,b[1],0,1],h[1],0,2],h[2]]}break;default:if(b){var i=b[2];if(i){var j=i[2];if(j)return[0,[0,[0,0,b[1],0,1],i[1],[0,0,j[1],0,1],2],j[2]]}}}var -k=a/2|0,l=c(k,b),e=l[2],n=l[1];if(!e)throw g([0,f,jq],1);var -o=e[1],m=c((a-k|0)-1|0,e[2]),p=m[2];return[0,d(n,o,m[1]),p]}return c(cZ(a),a)[1]}return[0,,,,c,,,,,,,,,,,,,m,,,,,,,,,,,,,,e,,,,,,,,function(a){return n(0,a)},,,,,,,,,,,function(a,b){var +k=a/2|0,l=c(k,b),e=l[2],n=l[1];if(!e)throw g([0,f,ko],1);var +o=e[1],m=c((a-k|0)-1|0,e[2]),p=m[2];return[0,d(n,o,m[1]),p]}return c(dh(a),a)[1]}return[0,,,,c,,,,,,,,,,,,,m,,,,,,,,,,,,,,e,,,,,,,,function(a){return n(0,a)},,,,,,,,,,,function(a,b){var c=b;for(;;){if(!c)return;var -d=c[2],e=c[3],f=c[1];if(h(a,d))return o(d,a,e);c=f}},,,,,,,function(a){if(!a)return m;var +d=c[2],e=c[3],f=c[1];if(h(a,d))return o(d,a,e);c=f}},,,,,,,,function(a){if(!a)return m;var f=a[2],d=a[1];if(!f)return b(d);var g=f[2],e=f[1];if(!g)return c(e,b(d));var h=g[2],i=g[1];if(!h)return c(i,c(e,b(d)));var -j=h[2],l=h[1];if(!j)return c(l,c(i,c(e,b(d))));if(j[2])return p(iX(k[1],a));var +j=h[2],l=h[1];if(!j)return c(l,c(i,c(e,b(d))));if(j[2])return p(jU(k[1],a));var n=j[1];return c(n,c(l,c(i,c(e,b(d)))))}]}function -jr(a){var -b=jl(a);return[0,b[17],,,b[4],,,,,,,,,,b[31],,,,,,,,,b[39],,,,,,,,,,,,,b[50],b[57]]}function -js(f){function +kp(a){var +b=kj(a);return[0,b[17],b[4],,,,,,,,b[39],,,,,,,,,,,,b[50],b[31],,,,,,,,,,,,,,,b[58]]}function +kq(f){function h(a){return a?a[5]:0}function e(a,b,c,d){var e=h(a),f=h(d),g=f<=e?e+1|0:f+1|0;return[0,a,b,c,d,g]}function d(a,b,c,d){var -i=a?a[5]:0,j=d?d[5]:0;if((j+2|0)=j){var -B=j<=i?i+1|0:j+1|0;return[0,a,b,c,d,B]}if(!d)return t(jw);var -l=d[4],o=d[3],p=d[2],g=d[1],w=h(g);if(w<=h(l))return e(e(a,b,c,g),p,o,l);if(!g)return t(jv);var +B=j<=i?i+1|0:j+1|0;return[0,a,b,c,d,B]}if(!d)return t(ku);var +l=d[4],o=d[3],p=d[2],g=d[1],w=h(g);if(w<=h(l))return e(e(a,b,c,g),p,o,l);if(!g)return t(kt);var x=g[3],y=g[2],z=g[1],A=e(g[4],p,o,l);return e(e(a,b,c,z),y,x,A)}function j(a,b,c){if(!c)return[0,0,a,b,0,1];var e=c[4],h=c[3],k=c[2],g=c[1],o=c[5],l=i(f[1],a,k);if(0===l)return h===b?c:[0,g,a,b,e,o];if(0<=l){var m=j(a,b,e);return e===m?c:d(g,k,h,m)}var n=j(a,b,g);return g===n?c:d(n,k,h,e)}function l(a){var -b=a;for(;;){if(!b)throw g(T,1);var +b=a;for(;;){if(!b)throw g(W,1);var c=b[1];if(!c)return[0,b[2],b[3]];b=c}}function -c(a){if(!a)return t(jx);var +c(a){if(!a)return t(kv);var b=a[1];if(!b)return a[4];var e=a[4],f=a[3],g=a[2];return d(c(b),g,f,e)}function n(a,b){if(!a)return b;if(!b)return a;var @@ -1237,107 +1305,136 @@ k(a,b){if(!b)return 0;var c=b[4],h=b[3],g=b[2],e=b[1],j=i(f[1],a,g);if(0===j)return n(e,c);if(0<=j){var l=k(a,c);return c===l?b:d(e,g,h,l)}var m=k(a,e);return e===m?b:d(m,g,h,c)}return[0,,,,,0,,j,function(a,b){var -c=b;for(;;){if(!c)throw g(T,1);var +c=b;for(;;){if(!c)throw g(W,1);var e=c[4],h=c[3],j=c[1],d=i(f[1],a,c[2]);if(0===d)return h;var k=0<=d?e:j;c=k}},,,,,,,,,function(a,b){var c=b;for(;;){if(!c)return 0;var e=c[4],g=c[3],h=c[1],d=i(f[1],a,c[2]);if(0===d)return[0,g];var j=0<=d?e:h;c=j}},,,,,,,k]}function -jy(a){var -b=js(a);return[0,b[5],,,b[7],,,b[24],,,,,,,,,,,,,,,,,,,,,b[8],b[17]]}function -bm(a){return[0,0,0]}function -bn(a){a[1]=0;a[2]=0;return}function -aZ(a,b){b[1]=[0,a,b[1]];b[2]=b[2]+1|0;return 0}function -a0(a){var +kw(a){var +b=kq(a);return[0,b[5],b[7],,,,b[24],,,,,,,,,,,b[8],b[17]]}function +bz(a){return[0,0,0]}function +bA(a){a[1]=0;a[2]=0;return}function +a5(a,b){b[1]=[0,a,b[1]];b[2]=b[2]+1|0;return 0}function +a6(a){var b=a[1];if(!b)return 0;var c=b[1];a[1]=b[2];a[2]=a[2]-1|0;return[0,c]}function -a1(a){var +a7(a){var b=a[1];return b?[0,b[1]]:0}function -jz(a,b){return aO(a,b[1])}var -jB=[c,jA,am(0)];function -c5(a){return[0,0,0,0]}function -c6(a){a[1]=0;a[2]=0;a[3]=0;return}function -c7(a,b){var +kx(a,b){return aS(a,b[1])}var +kz=[c,ky,ao(0)];function +dk(a){return[0,0,0,0]}function +dl(a){a[1]=0;a[2]=0;a[3]=0;return}function +dm(a,b){var c=[0,a,0],d=b[3];return d?(b[1]=b[1]+1|0,d[2]=c,b[3]=c,0):(b[1]=1,b[2]=c,b[3]=c,0)}function -eR(a){var -b=a[2];if(!b)throw g(jB,1);var +fj(a){var +b=a[2];if(!b)throw g(kz,1);var c=b[1];if(b[2]){var -d=b[2];a[1]=a[1]-1|0;a[2]=d;return c}c6(a);return c}function -c8(a){return 0===a[1]?1:0}function -jC(a){var +d=b[2];a[1]=a[1]-1|0;a[2]=d;return c}dl(a);return c}function +dn(a){return 0===a[1]?1:0}function +kA(a){var b=a[2];return b?[0,b[1]]:0}function -jD(a){var +kB(a){var b=a[2];if(!b)return 0;var c=b[1];if(b[2]){var -d=b[2];a[1]=a[1]-1|0;a[2]=d;return[0,c]}c6(a);return[0,c]}function -eS(a){var -b=1<=a?a:1,c=bl=(d+b|0))break;c[1]=2*c[1]|0}if(bla[3])throw g([0,f,jG],1);if((d+b|0)<=a[3])return;throw g([0,f,jF],1)}function -bo(a,b){var -c=p(b),d=a[2]+c|0;if(a[3]=(d+b|0))break;c[1]=2*c[1]|0}if(bve){if(32!==e){if(43>e)break a;switch(e-43|0){case -5:c:if(c<(d+2|0)&&1e){if(32!==e){if(43>e)break a;switch(e-43|0){case +5:c:if(c<(d+2|0)&&1=(d+1|0))break a;var -f=aP(d+1|0,48);bg(f,0,e);ap(b,1,f,(d-c|0)+2|0,c-1|0);return ad(f)}if(71<=e){if(5>>0)break a}else if(65>e)break a}if(c>>0)break a}else if(65>e)break a}if(ca)return b;var +14:return mh;default:return mq}}function +fw(a,b){var +d=b5(b),e=kO(mr,a),c=fs(16);a8(c,37);kP(c,a);a8(c,46);G(c,jX(d));a8(c,e);return fu(c)}function +b$(a,b){if(13>a)return b;var h=[0,0],i=p(b)-1|0,n=0;if(i>=0){var -d=n;for(;;){if(9>=Y(b,d)+hf>>>0)h[1]++;var +d=n;for(;;){if(9>=V(b,d)+hZ>>>0)h[1]++;var r=d+1|0;if(i===d)break;d=r}}var j=h[1],k=F(p(b)+((j-1|0)/3|0)|0),l=[0,0];function -e(a){bg(k,l[1],a);l[1]++;return}var +e(a){az(k,l[1],a);l[1]++;return}var f=[0,((j-1|0)%3|0)+1|0],m=p(b)-1|0,o=0;if(m>=0){var c=o;for(;;){var -g=Y(b,c);if(9>>0)e(g);else{if(0===f[1]){e(95);f[1]=3}f[1]--;e(g)}var -q=c+1|0;if(m===c)break;c=q}}return ad(k)}function -lp(a,b){return bW(a,cH(kw(a),b))}function -lq(a,b){return bW(a,cH(kY(a),b))}function -lr(a,b){return bW(a,cH(la(a),b))}function -ls(a,b){return bW(a,sF(kK(a),b))}function -aq(d,b,c){function +g=V(b,c);if(9>>0)e(g);else{if(0===f[1]){e(95);f[1]=3}f[1]--;e(g)}var +q=c+1|0;if(m===c)break;c=q}}return aa(k)}function +ms(a,b){return b$(a,c2(lz(a),b))}function +mt(a,b){return b$(a,c2(l1(a),b))}function +mu(a,b){return b$(a,c2(md(a),b))}function +mv(a,b){return b$(a,tT(lN(a),b))}function +at(d,b,c){function a(a){switch(d[1]){case 0:var e=45;break;case 1:var e=43;break;default:var -e=32}return sB(c,b,e)}function +e=32}return tP(c,b,e)}function e(a){var -b=sm(c);return 3===b?c<0.?lu:lv:4<=b?lw:a}function +b=ty(c);return 3===b?c<0.?mx:my:4<=b?mz:a}function f(b){var e=p(b);return function(a){var c=a;for(;;){if(c===e)return 0;var -d=I(b,c)-46|0;a:{if(23>>0){if(55===d)break a}else if(21>>0)break a;c=c+1|0;continue}return 1}}(0)?b:ah(b,lt)}switch(d[2]){case -5:return e(f(ek(eX(d,b),c)));case +d=T(b,c)-46|0;a:{if(23>>0){if(55===d)break a}else if(21>>0)break a;c=c+1|0;continue}return 1}}(0)?b:ar(b,mw)}switch(d[2]){case +5:return e(f(eK(fw(d,b),c)));case 6:return a(0);case -7:return jb(a(0));case -8:return e(a(0));default:return ek(eX(d,b),c)}}function -lx(a){var -b=iG(a),c=p(b),d=aP(c+2|0,39);bG(b,0,d,1,c);return ad(d)}function -ly(a){var -b=eT(16);c$(b,a);return eV(b)}function -by(a,b,c,d){var +7:return ka(a(0));case +8:return e(a(0));default:return eK(fw(d,b),c)}}function +mA(a){var +b=jB(a),c=p(b),d=aT(c+2|0,39);bV(b,0,d,1,c);return aa(d)}function +mB(a){var +b=fs(16);dt(b,a);return fu(b)}function +bM(a,b,c,d){var k=b,j=c,e=d;for(;;){if(typeof e==="number")return h(k,j);switch(e[0]){case 0:var u=e[1];return function(a){return n(k,[5,j,a],u)};case 1:var -v=e[1];return function(a){return n(k,[4,j,lx(a)],v)};case -2:return da(k,j,e[2],e[1],function(a){return a});case -3:return da(k,j,e[2],e[1],kv);case -4:return bX(k,j,e[4],e[2],e[3],lp,e[1]);case -5:return bX(k,j,e[4],e[2],e[3],lq,e[1]);case -6:return bX(k,j,e[4],e[2],e[3],lr,e[1]);case -7:return bX(k,j,e[4],e[2],e[3],ls,e[1]);case -8:return lz(k,j,e[4],e[2],e[3],e[1]);case -9:return da(k,j,e[2],e[1],im);case +v=e[1];return function(a){return n(k,[4,j,mA(a)],v)};case +2:return du(k,j,e[2],e[1],function(a){return a});case +3:return du(k,j,e[2],e[1],ly);case +4:return ca(k,j,e[4],e[2],e[3],ms,e[1]);case +5:return ca(k,j,e[4],e[2],e[3],mt,e[1]);case +6:return ca(k,j,e[4],e[2],e[3],mu,e[1]);case +7:return ca(k,j,e[4],e[2],e[3],mv,e[1]);case +8:return mC(k,j,e[4],e[2],e[3],e[1]);case +9:return du(k,j,e[2],e[1],jf);case 10:j=[7,j];e=e[1];break;case 11:j=[2,j,e[1]];e=e[2];break;case 12:j=[3,j,e[1]];e=e[2];break;case 13:var -w=e[3],x=ly(e[2]);return function(a){return n(k,[4,j,x],w)};case +w=e[3],x=mB(e[2]);return function(a){return n(k,[4,j,x],w)};case 14:var -y=e[3],z=e[2];return function(a){return n(k,j,s(ku(a[1],z),y))};case +y=e[3],z=e[2];return function(a){return n(k,j,s(lx(a[1],z),y))};case 15:var A=e[1];return function(c,b){return n(k,[6,j,function(a){return i(c,a,b)}],A)};case 16:var @@ -1851,22 +1948,22 @@ B=e[1];return function(a){return n(k,[6,j,a],B)};case l=e[1];if(0===l[0]){let b=j,c=k,d=e[2];k=function(a){return n(c,[1,b,[0,a]],d)};j=0;e=l[1][1]}else{let b=j,c=k,d=e[2];k=function(a){return n(c,[1,b,[1,a]],d)};j=0;e=l[1][1]}break;case -19:throw g([0,f,lB],1);case +19:throw g([0,f,mE],1);case 20:var -C=e[3],D=[8,j,lC];return function(a){return n(k,D,C)};case +C=e[3],D=[8,j,mF];return function(a){return n(k,D,C)};case 21:var -E=e[2];return function(a){return n(k,[4,j,cH(hc,a)],E)};case +E=e[2];return function(a){return n(k,[4,j,c2(hW,a)],E)};case 22:var F=e[1];return function(a){return n(k,[5,j,a],F)};case 23:var -m=e[2],p=e[1];return a<50?gs(a+1|0,k,j,p,m):o(gs,[0,k,j,p,m]);default:var -q=e[3],r=e[1],t=h(e[2],0);return a<50?dP(a+1|0,k,j,q,r,t):o(dP,[0,k,j,q,r,t])}}}function -n(a,b,c){return aM(by(0,a,b,c))}function -gs(a,b,c,d,e){if(typeof +m=e[2],p=e[1];return a<50?hb(a+1|0,k,j,p,m):o(hb,[0,k,j,p,m]);default:var +q=e[3],r=e[1],t=h(e[2],0);return a<50?eb(a+1|0,k,j,q,r,t):o(eb,[0,k,j,q,r,t])}}}function +n(a,b,c){return aR(bM(0,a,b,c))}function +hb(a,b,c,d,e){if(typeof d==="number")switch(d){case 0:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case 1:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case -2:throw g([0,f,lD],1);default:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e])}switch(d[0]){case +2:throw g([0,f,mG],1);default:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e])}switch(d[0]){case 0:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case 1:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case 2:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case @@ -1877,378 +1974,401 @@ d==="number")switch(d){case 7:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case 8:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);case 9:var -h=d[2];return a<50?dQ(a+1|0,b,c,h,e):o(dQ,[0,b,c,h,e]);case +h=d[2];return a<50?ec(a+1|0,b,c,h,e):o(ec,[0,b,c,h,e]);case 10:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e]);default:return a<50?q(a+1|0,b,c,e):o(q,[0,b,c,e])}}function -dQ(a,h,c,d,e){if(typeof +ec(a,h,c,d,e){if(typeof d==="number")return a<50?q(a+1|0,h,c,e):o(q,[0,h,c,e]);switch(d[0]){case 0:var -b=d[1];return function(a){return U(h,c,b,e)};case +b=d[1];return function(a){return Y(h,c,b,e)};case 1:var -i=d[1];return function(a){return U(h,c,i,e)};case +i=d[1];return function(a){return Y(h,c,i,e)};case 2:var -j=d[1];return function(a){return U(h,c,j,e)};case +j=d[1];return function(a){return Y(h,c,j,e)};case 3:var -k=d[1];return function(a){return U(h,c,k,e)};case +k=d[1];return function(a){return Y(h,c,k,e)};case 4:var -l=d[1];return function(a){return U(h,c,l,e)};case +l=d[1];return function(a){return Y(h,c,l,e)};case 5:var -m=d[1];return function(a){return U(h,c,m,e)};case +m=d[1];return function(a){return Y(h,c,m,e)};case 6:var -n=d[1];return function(a){return U(h,c,n,e)};case +n=d[1];return function(a){return Y(h,c,n,e)};case 7:var -p=d[1];return function(a){return U(h,c,p,e)};case +p=d[1];return function(a){return Y(h,c,p,e)};case 8:var -r=d[2];return function(a){return U(h,c,r,e)};case +r=d[2];return function(a){return Y(h,c,r,e)};case 9:var -s=d[3],t=d[2],u=A(x(d[1]),t);return function(a){return U(h,c,L(u,s),e)};case +s=d[3],t=d[2],u=B(x(d[1]),t);return function(a){return Y(h,c,L(u,s),e)};case 10:var -v=d[1];return function(a,b){return U(h,c,v,e)};case +v=d[1];return function(a,b){return Y(h,c,v,e)};case 11:var -w=d[1];return function(a){return U(h,c,w,e)};case +w=d[1];return function(a){return Y(h,c,w,e)};case 12:var -y=d[1];return function(a){return U(h,c,y,e)};case -13:throw g([0,f,lE],1);default:throw g([0,f,lF],1)}}function -U(a,b,c,d){return aM(dQ(0,a,b,c,d))}function +y=d[1];return function(a){return Y(h,c,y,e)};case +13:throw g([0,f,mH],1);default:throw g([0,f,mI],1)}}function +Y(a,b,c,d){return aR(ec(0,a,b,c,d))}function q(a,b,c,d){var -e=[8,c,lG];return a<50?by(a+1|0,b,e,d):o(by,[0,b,e,d])}function -da(g,f,c,d,e){if(typeof +e=[8,c,mJ];return a<50?bM(a+1|0,b,e,d):o(bM,[0,b,e,d])}function +du(g,f,c,d,e){if(typeof d==="number")return function(a){return n(g,[4,f,h(e,a)],c)};if(0===d[0]){var b=d[2],i=d[1];return function(a){return n(g,[4,f,Q(i,b,h(e,a))],c)}}var j=d[1];return function(a,b){return n(g,[4,f,Q(j,a,h(e,b))],c)}}function -bX(k,j,h,d,e,f,g){if(typeof +ca(k,j,h,d,e,f,g){if(typeof d==="number"){if(typeof -e==="number")return e?function(a,b){return n(k,[4,j,a3(a,i(f,g,b))],h)}:function(a){return n(k,[4,j,i(f,g,a)],h)};var -b=e[1];return function(a){return n(k,[4,j,a3(b,i(f,g,a))],h)}}if(0===d[0]){var +e==="number")return e?function(a,b){return n(k,[4,j,a9(a,i(f,g,b))],h)}:function(a){return n(k,[4,j,i(f,g,a)],h)};var +b=e[1];return function(a){return n(k,[4,j,a9(b,i(f,g,a))],h)}}if(0===d[0]){var c=d[2],l=d[1];if(typeof -e==="number")return e?function(a,b){return n(k,[4,j,Q(l,c,a3(a,i(f,g,b)))],h)}:function(a){return n(k,[4,j,Q(l,c,i(f,g,a))],h)};var -o=e[1];return function(a){return n(k,[4,j,Q(l,c,a3(o,i(f,g,a)))],h)}}var +e==="number")return e?function(a,b){return n(k,[4,j,Q(l,c,a9(a,i(f,g,b)))],h)}:function(a){return n(k,[4,j,Q(l,c,i(f,g,a))],h)};var +o=e[1];return function(a){return n(k,[4,j,Q(l,c,a9(o,i(f,g,a)))],h)}}var m=d[1];if(typeof -e==="number")return e?function(a,b,c){return n(k,[4,j,Q(m,a,a3(b,i(f,g,c)))],h)}:function(a,b){return n(k,[4,j,Q(m,a,i(f,g,b))],h)};var -p=e[1];return function(a,b){return n(k,[4,j,Q(m,a,a3(p,i(f,g,b)))],h)}}function -lz(i,h,g,d,e,f){if(typeof +e==="number")return e?function(a,b,c){return n(k,[4,j,Q(m,a,a9(b,i(f,g,c)))],h)}:function(a,b){return n(k,[4,j,Q(m,a,i(f,g,b))],h)};var +p=e[1];return function(a,b){return n(k,[4,j,Q(m,a,a9(p,i(f,g,b)))],h)}}function +mC(i,h,g,d,e,f){if(typeof d==="number"){if(typeof -e==="number")return e?function(a,b){return n(i,[4,h,aq(f,a,b)],g)}:function(a){return n(i,[4,h,aq(f,c_(f),a)],g)};var -b=e[1];return function(a){return n(i,[4,h,aq(f,b,a)],g)}}if(0===d[0]){var +e==="number")return e?function(a,b){return n(i,[4,h,at(f,a,b)],g)}:function(a){return n(i,[4,h,at(f,ds(f),a)],g)};var +b=e[1];return function(a){return n(i,[4,h,at(f,b,a)],g)}}if(0===d[0]){var c=d[2],j=d[1];if(typeof -e==="number")return e?function(a,b){return n(i,[4,h,Q(j,c,aq(f,a,b))],g)}:function(a){return n(i,[4,h,Q(j,c,aq(f,c_(f),a))],g)};var -l=e[1];return function(a){return n(i,[4,h,Q(j,c,aq(f,l,a))],g)}}var +e==="number")return e?function(a,b){return n(i,[4,h,Q(j,c,at(f,a,b))],g)}:function(a){return n(i,[4,h,Q(j,c,at(f,ds(f),a))],g)};var +l=e[1];return function(a){return n(i,[4,h,Q(j,c,at(f,l,a))],g)}}var k=d[1];if(typeof -e==="number")return e?function(a,b,c){return n(i,[4,h,Q(k,a,aq(f,b,c))],g)}:function(a,b){return n(i,[4,h,Q(k,a,aq(f,c_(f),b))],g)};var -m=e[1];return function(a,b){return n(i,[4,h,Q(k,a,aq(f,m,b))],g)}}function -dP(a,b,c,d,e,f){if(e){var -i=e[1];return function(a){return lA(b,c,d,i,h(f,a))}}var -g=[4,c,f];return a<50?by(a+1|0,b,g,d):o(by,[0,b,g,d])}function -lA(a,b,c,d,e){return aM(dP(0,a,b,c,d,e))}function -ar(a,b){var +e==="number")return e?function(a,b,c){return n(i,[4,h,Q(k,a,at(f,b,c))],g)}:function(a,b){return n(i,[4,h,Q(k,a,at(f,ds(f),b))],g)};var +m=e[1];return function(a,b){return n(i,[4,h,Q(k,a,at(f,m,b))],g)}}function +eb(a,b,c,d,e,f){if(e){var +i=e[1];return function(a){return mD(b,c,d,i,h(f,a))}}var +g=[4,c,f];return a<50?bM(a+1|0,b,g,d):o(bM,[0,b,g,d])}function +mD(a,b,c,d,e){return aR(eb(0,a,b,c,d,e))}function +au(a,b){var c=b;for(;;){if(typeof c==="number")return;switch(c[0]){case 0:var -f=c[1],g=eW(c[2]);ar(a,f);return bk(a,g);case +f=c[1],g=fv(c[2]);au(a,f);return bt(a,g);case 1:var d=c[2],e=c[1];if(0===d[0]){var -i=d[1];ar(a,e);bk(a,lH);c=i}else{var -j=d[1];ar(a,e);bk(a,lI);c=j}break;case +i=d[1];au(a,e);bt(a,mK);c=i}else{var +j=d[1];au(a,e);bt(a,mL);c=j}break;case 6:var -m=c[2];ar(a,c[1]);return h(m,a);case -7:ar(a,c[1]);return bU(a);case +m=c[2];au(a,c[1]);return h(m,a);case +7:au(a,c[1]);return bu(a);case 8:var -n=c[2];ar(a,c[1]);return t(n);case +n=c[2];au(a,c[1]);return t(n);case 2:case 4:var -k=c[2];ar(a,c[1]);return bk(a,k);default:var -l=c[2];ar(a,c[1]);return ix(a,l)}}}function -aA(a,b){var +k=c[2];au(a,c[1]);return bt(a,k);default:var +l=c[2];au(a,c[1]);return jp(a,l)}}}function +aD(a,b){var c=b;for(;;){if(typeof c==="number")return;switch(c[0]){case 0:var -f=c[1],g=eW(c[2]);aA(a,f);return bo(a,g);case +f=c[1],g=fv(c[2]);aD(a,f);return bB(a,g);case 1:var d=c[2],e=c[1];if(0===d[0]){var -i=d[1];aA(a,e);bo(a,lJ);c=i}else{var -j=d[1];aA(a,e);bo(a,lK);c=j}break;case +i=d[1];aD(a,e);bB(a,mM);c=i}else{var +j=d[1];aD(a,e);bB(a,mN);c=j}break;case 6:var -m=c[2];aA(a,c[1]);return bo(a,h(m,0));case +m=c[2];aD(a,c[1]);return bB(a,h(m,0));case 7:c=c[1];break;case 8:var -n=c[2];aA(a,c[1]);return t(n);case +n=c[2];aD(a,c[1]);return t(n);case 2:case 4:var -k=c[2];aA(a,c[1]);return bo(a,k);default:var -l=c[2];aA(a,c[1]);return jI(a,l)}}}function -lL(d,b,c){return n(function(a){ar(b,a);return h(d,b)},0,c[1])}function -bY(a,b){return lL(function(a){return 0},a,b)}function -db(a){return bY(ac,a)}function -lM(c,b){return n(function(a){var -b=eS(64);aA(b,a);return h(c,jE(b))},0,b[1])}function -D(a){return lM(function(a){return a},a)}var -dc=cS(0);function -de(a,b){var -c=a[1+b];return iy(c)?aL(c)===cs?h(D(lN),c):aL(c)===hn?is(c):lO:h(D(lP),c)}function -eY(a,b){if(a.length-1<=b)return lQ;var -c=eY(a,b+1|0),d=de(a,b);return i(D(lR),d,c)}function -lS(a){var +k=c[2];aD(a,c[1]);return bB(a,k);default:var +l=c[2];aD(a,c[1]);return kF(a,l)}}}function +mO(d,b,c){return n(function(a){au(b,a);return h(d,b)},0,c[1])}function +cb(a,b){return mO(function(a){return 0},a,b)}function +dv(a){return cb(X,a)}function +mP(c,b){return n(function(a){var +b=b9(64);aD(b,a);return h(c,fk(b))},0,b[1])}function +y(a){return mP(function(a){return a},a)}var +dw=bx(0);function +dy(a,b){var +c=a[1+b];return jq(c)?a3(c)===cM?h(y(mQ),c):a3(c)===h7?jk(c):mR:h(y(mS),c)}function +fx(a,b){if(a.length-1<=b)return mT;var +c=fx(a,b+1|0),d=dy(a,b);return i(y(mU),d,c)}function +mV(a){var b=a.length-1;if(2>=b>>>0)switch(b){case -0:return lU;case -1:return lV;default:var -e=de(a,1);return h(D(lW),e)}var -c=eY(a,2),d=de(a,1);return i(D(lT),d,c)}function -lX(d){return function(a){var +0:return mX;case +1:return mY;default:var +e=dy(a,1);return h(y(mZ),e)}var +c=fx(a,2),d=dy(a,1);return i(y(mW),d,c)}function +m0(d){return function(a){var b=a;for(;;){if(!b)return 0;var e=b[2],f=b[1];a:{try{var -c=h(f,d)}catch(f){break a}if(c)return[0,c[1]]}b=e}}(bQ(dc))}function -lY(a){if(a===cU)return lZ;if(a===eD)return l0;if(a[1]===eC){var -b=a[2],e=b[3],i=b[2],j=b[1];return dT(D(dd),j,i,e,e+5|0,l1)}if(a[1]===f){var -c=a[2],g=c[3],k=c[2],l=c[1];return dT(D(dd),l,k,g,g+6|0,l2)}if(a[1]===eF){var -d=a[2],h=d[3],m=d[2],n=d[1];return dT(D(dd),n,m,h,h+6|0,l3)}if(0!==aL(a))return a[1];var -o=a[1][1];return ah(o,lS(a))}function -bZ(a){var -b=lX(a);return b?b[1]:lY(a)}function -l4(a){var -b=[0,sn(a)];return b}function -l5(c,b){function -a(a){return a?0===c?l6:l7:0===c?l8:l9}if(0===b[0]){var -d=b[5],e=b[4],f=b[3],g=b[6]?l_:ma,i=b[2],j=b[7],k=a(b[1]);return[0,sb(D(l$),k,j,i,g,f,e,d)]}if(b[1])return 0;var -l=a(0);return[0,h(D(mb),l)]}function -mc(a,b){if(!b)return bY(a,me);var -d=b[1],f=d.length-2|0,i=0;if(f>=0){var -c=i;for(;;){var -g=l5(c,e(d,c)[1+c]);if(g){var -j=g[1];h(bY(a,md),j)}var -k=c+1|0;if(f===c)break;c=k}}return 0}function -b0(a,b){return mc(a,l4(b))}var -mh=mg.slice();function -mi(a,b){var -f=bZ(a);h(db(mj),f);b0(ac,b);var -c=sZ(0);if(c<0){var -d=bT(c);eI(e(mh,d)[1+d])}return bU(ac)}var -mk=[0];function -eZ(a){var -b=h3(0);return b}function -ml(a,b){try{var -d=b?mk:eZ(0);try{cW(0)}catch(f){}try{var -f=mi(a,d),e=f}catch(f){var -i=Z(f),j=eZ(0),k=bZ(a);h(db(mn),k);b0(ac,d);var -l=bZ(i);h(db(mo),l);b0(ac,j);var -e=bU(ac)}return e}catch(f){var -c=Z(f);if(c===cU)return eI(mm);throw g(c,0)}}ex(hx,function(a,b){try{var -c=ml(a,b);return c}catch(f){return 0}});function -mf(a){for(;;){var -b=bQ(dc),c=1-cT(dc,b,[0,a,b]);if(!c)return c}}function -mp(a){return h3(a)}var -mr=[c,mq,am(0)];mf(function(a){return a[1]===mr?[0,ah(ms,bZ(a[2]))]:0});function -mt(a){return sX(a,0,p(a))}function -mu(a){return[0,ao(55,0),0]}function -mv(a,b){function -l(a,b){return mt(ah(a,eL(b)))}function -m(a){var -b=I(a,3)<<24,c=I(a,2)<<16,d=I(a,1)<<8;return((I(a,0)+d|0)+c|0)+b|0}var -h=0===b.length-1?[0,0]:b,i=h.length-1,c=0;for(;;){e(a[1],c)[1+c]=c;var -s=c+1|0;if(54===c)break;c=s}var -g=[0,mw],j=54+c3(55,i)|0,n=0;if(j>=0){var -d=n;for(;;){var -f=d%55|0,k=s4(d,i),o=e(h,k)[1+k];g[1]=l(g[1],o);var -p=m(g[1]),q=(e(a[1],f)[1+f]^p)&g2;e(a[1],f)[1+f]=q;var -r=d+1|0;if(j===d)break;d=r}}a[2]=0;return}function -mx(a){var -b=mu(0);mv(b,a);return b}function -my(a){return mx(tf(0))}function -mz(a){a[2]=(a[2]+1|0)%55|0;var -b=a[2],c=e(a[1],b)[1+b],d=(a[2]+24|0)%55|0,f=(e(a[1],d)[1+d]+(c^(c>>>25|0)&31)|0)&g2,g=a[2];e(a[1],g)[1+g]=f;return f}function -mA(a){var +c=h(f,d)}catch(f){break a}if(c)return[0,c[1]]}b=e}}(bw(dw))}function +m1(a){if(0!==a3(a))return[0,a[1],0];var +b=a[1][1];return[0,b,[0,mV(a)]]}function +m2(a){var +b=m1(a),c=b[2],d=b[1];return c?ar(d,c[1]):d}function +m3(a){if(a===dc)return m4;if(a===e3)return m5;if(a[1]===e2){var +b=a[2],e=b[3],i=b[2],j=b[1];return ef(y(dx),j,i,e,e+5|0,m6)}if(a[1]===f){var +c=a[2],g=c[3],k=c[2],l=c[1];return ef(y(dx),l,k,g,g+6|0,m7)}if(a[1]!==e5)return m2(a);var +d=a[2],h=d[3],m=d[2],n=d[1];return ef(y(dx),n,m,h,h+6|0,m8)}function +cc(a){var +b=m0(a);return b?b[1]:m3(a)}function +m9(a){var +b=[0,tz(a)];return b}function +m_(c,b){function +a(a){return a?0===c?m$:na:0===c?nb:nc}if(0!==b[0]){if(b[1])return 0;var +p=a(0);return[0,h(y(ni),p)]}if(b[3]===b[6])var +e=b[3],d=h(y(nd),e);else +var +n=b[6],o=b[3],d=i(y(nh),o,n);var +f=b[7],g=b[4],j=b[8]?ne:ng,k=b[2],l=b[9],m=a(b[1]);return[0,tk(y(nf),m,l,k,j,d,g,f)]}function +nj(a,b){if(!b)return cb(a,nl);var +d=b[1],e=d.length-2|0,g=0;if(e>=0){var +c=g;for(;;){var +f=m_(c,j(d,c)[1+c]);if(f){var +i=f[1];h(cb(a,nk),i)}var +k=c+1|0;if(e===c)break;c=k}}return 0}function +cd(a,b){return nj(a,m9(b))}var +no=nn.slice();function +np(a,b){var +e=cc(a);h(dv(nq),e);cd(X,b);var +c=uc(0);if(c<0){var +d=b5(c);e8(j(no,d)[1+d])}return bu(X)}var +nr=[0];function +fy(a){var +b=iM(0);return b}function +ns(a,b){try{var +d=b?nr:fy(0);try{df(0)}catch(f){}try{var +f=np(a,d),e=f}catch(f){var +i=$(f),j=fy(0),k=cc(a);h(dv(nu),k);cd(X,d);var +l=cc(i);h(dv(nv),l);cd(X,j);var +e=bu(X)}return e}catch(f){var +c=$(f);if(c===dc)return e8(nt);throw g(c,0)}}eY(ig,function(a,b){try{var +c=ns(a,b);return c}catch(f){return 0}});function +nm(a){for(;;){var +b=bw(dw),c=1-e_(dw,b,[0,a,b]);if(!c)return c}}function +nw(a){return iM(a)}var +ny=[c,nx,ao(0)];nm(function(a){return a[1]===ny?[0,ar(nz,cc(a[2]))]:0});function +dz(a){var +b=a[1]<1?1:0,c=b||(64=0){var +c=i;for(;;){j5(d,c*8|0,b0(j(b,c)[1+c]));var +n=c+1|0;if(f===c)break;c=n}}az(d,e*8|0,1);var +g=fz(d);az(d,e*8|0,2);var +h=fz(d),k=b8(h,8),l=b8(h,0),m=b8(g,8);return fB(a,b8(g,0),m,l,k)}function +nJ(a){var +b=fA(0);nI(b,a);return b}function +ce(a){return iZ(a)}function +nK(a){return nJ(ur(0))}function +nL(a){return iU(iZ(a))&1073741823}as([0,function(a){var +b=ce(a),c=ce(a),d=ce(a);return fC(b,c,d,ce(a))}],function(a){return fC(nP,nO,nN,nM)});function +nQ(a){var b=a.length-1<4?1:0,c=b||(a[4]<0?1:0);return c}try{var -r$=id(ho),e3=r$}catch(f){var -e0=Z(f);if(e0!==T)throw g(e0,0);try{var -r_=id("CAMLRUNPARAM"),e2=r_}catch(f){var -e1=Z(f);if(e1!==T)throw g(e1,0);var -e2=mB}var -e3=e2}var -b1=[be,function(a){return my(0)}],mC=ja(e3,82);function -mD(a,b){var -c=a;for(;;){if(b<=c)return c;if(cX<(c*2|0))return c;c=c*2|0}}function -mF(m,b,c,d){var -i=d.length-1,g=ao(i,0),j=c.length-2|0;function +ti=i9(h8),fG=ti}catch(f){var +fD=$(f);if(fD!==W)throw g(fD,0);try{var +th=i9("CAMLRUNPARAM"),fF=th}catch(f){var +fE=$(f);if(fE!==W)throw g(fE,0);var +fF=nR}var +fG=fF}var +nS=bx(j$(fG,82)),nT=as(0,nK);function +nU(a,b){var +c=a;for(;;){if(b<=c)return c;if(dg<(c*2|0))return c;c=c*2|0}}function +nW(m,b,c,d){var +g=d.length-1,f=aj(g,0),i=c.length-2|0;function n(a){var c=a;for(;;){if(!c)return;var -j=c[1],l=c[2],n=c[3],i=b?c:[0,j,l,0],f=h(m,j),k=e(g,f)[1+f];if(k)k[3]=i;else -e(d,f)[1+f]=i;e(g,f)[1+f]=i;c=n}}var -o=0;if(j>=0){var -f=o;for(;;){n(e(c,f)[1+f]);var -r=f+1|0;if(j===f)break;f=r}}if(b){var -k=i-1|0,p=0;if(k>=0){var +i=c[1],l=c[2],n=c[3],g=b?c:[0,i,l,0],e=h(m,i),k=j(f,e)[1+e];if(k)k[3]=g;else +j(d,e)[1+e]=g;j(f,e)[1+e]=g;c=n}}var +o=0;if(i>=0){var +e=o;for(;;){n(j(c,e)[1+e]);var +r=e+1|0;if(i===e)break;e=r}}if(b){var +k=g-1|0,p=0;if(k>=0){var a=p;for(;;){var -l=e(g,a)[1+a];if(l)l[3]=0;var +l=j(f,a)[1+a];if(l)l[3]=0;var q=a+1|0;if(k===a)break;a=q}}}return}function -e4(a,b){var -c=b[2],d=(c.length-1)*2|0,e=d>>0)return;return e$(a,d)}function -mS(a){var -b=jD(a[28]);if(!b)return;var +e=d[3];if(0===bW(d[1],a)){d[1]=a;d[2]=b;return 0}d=e}}function +nV(a,b){var +d=a?a[1]:bw(nS),c=nU(16,b),e=d?nL(aC(nT)):0;return[0,0,aj(c,0),e,c]}function +nY(a,b,c){var +d=bE(a,b),f=[0,b,c,j(a[2],d)[1+d]];j(a[2],d)[1+d]=f;a[1]=a[1]+1|0;var +e=a[2].length-1<<1>>0)return;return fO(a,d)}function +n9(a){var +b=kB(a[28]);if(!b)return;var c=b[1],d=c[1];a[12]=a[12]-c[3]|0;var -e=aB(d);a[9]=a[9]+e|0;return}function -mT(a,b,c){if(typeof +e=aE(d);a[9]=a[9]+e|0;return}function +n_(a,b,c){if(typeof c==="number")switch(c){case 0:var -j=a1(a[3]);if(!j)return;var +j=a7(a[3]);if(!j)return;var k=j[1][1],l=function(a,b){if(!b)return[0,a,0];var -c=b[1],d=b[2];return sT(a,c)?[0,a,b]:[0,c,l(a,d)]};k[1]=l(a[6]-a[9]|0,k[1]);return;case -1:a0(a[2]);return;case -2:a0(a[3]);return;case +c=b[1],d=b[2];return t8(a,c)?[0,a,b]:[0,c,l(a,d)]};k[1]=l(a[6]-a[9]|0,k[1]);return;case +1:a6(a[2]);return;case +2:a6(a[3]);return;case 3:var -m=a1(a[2]);return m?e$(a,m[1][2]):b3(a);case +m=a7(a[2]);return m?fO(a,m[1][2]):cg(a);case 4:var -n=a[10]!==(a[6]-a[9]|0)?1:0;return n?mS(a):n;default:var -o=a0(a[5]);if(o)return df(a,h(a[25],o[1]));return}switch(c[0]){case -0:return e_(a,b,c[1]);case +n=a[10]!==(a[6]-a[9]|0)?1:0;return n?n9(a):n;default:var +o=a6(a[5]);if(o)return dA(a,h(a[25],o[1]));return}switch(c[0]){case +0:return fN(a,b,c[1]);case 1:var -d=c[2],f=c[1],q=d[1],z=d[2],r=a1(a[2]);if(!r)return;var +d=c[2],f=c[1],q=d[1],z=d[2],r=a7(a[2]);if(!r)return;var s=r[1],e=s[2];switch(s[1]){case -0:return a4(a,f);case -1:return aQ(a,d,e);case -2:return aQ(a,d,e);case -3:return a[9]<(b+p(q)|0)?aQ(a,d,e):a4(a,f);case -4:return a[11]?a4(a,f):a[9]<(b+p(q)|0)?aQ(a,d,e):((a[6]-e|0)+z|0)=a[14]){a[13]=e9;fa(a);if(b)b3(a);return m8(a)}m5(a,0)}}function -fb(a,b){m_(a,0);return h(a[18],0)}var -fc=eP(80,32);function -m$(a,b){return bA(a[17],na,0,1)}function -fd(a,b){var +om(a){n4(a);dB(a[1]);bA(a[2]);bA(a[3]);bA(a[4]);bA(a[5]);a[10]=0;a[14]=0;a[9]=a[6];return oj(a)}function +on(b){return kx(function(a){return ol(b,0)},b[4])}function +oo(a,b){on(a);for(;;){if(1>=a[14]){a[13]=fM;fP(a);if(b)cg(a);return om(a)}ok(a,0)}}function +ci(a,b){oo(a,0);return h(a[18],0)}function +fQ(a,b){var +c=b[5],d=b[4],e=b[3],f=b[2];a[17]=b[1];a[18]=f;a[19]=e;a[20]=d;a[21]=c;return 0}function +fR(a,b){return[0,,,a[19],a[20],a[21]]}function +dD(a,b){return bO(a[17],op,0,1)}var +fS=fg(80,32);function +a$(a,b){var c=b;for(;;){var -d=0=c)return bA(a[17],fc,0,c);bA(a[17],fc,0,80);c=c-80|0}}function -nb(a){return a[1]===e8?ah(nd,ah(a[2],nc)):ne}function -nf(a){return a[1]===e8?ah(nh,ah(a[2],ng)):ni}function -nj(a){return 0}function -nk(a){return 0}function -nl(a,b,c,d,e){var -g=c5(0),h=[0,e6,nm,0];c7(h,g);var -f=bm(0);dg(f);aZ([0,1,h],f);var -i=78,j=bm(0),k=bm(0),l=bm(0);return[0,f,bm(0),l,k,j,i,10,68,i,0,1,1,1,1,il,nn,a,b,c,d,e,0,0,nb,nf,nj,nk,g]}function -fe(a,b){var -c=nl(a,b,function(a){return 0},function(a){return 0},function(a){return 0});c[19]=function(a){return m$(c,a)};c[20]=function(a){return fd(c,a)};c[21]=function(a){return fd(c,a)};return c}function -ff(d){return fe(function(a,b,c){return iu(d,a,b,c)},function(a){return bU(d)})}var -no=d1,np=function(a){return eS(no)}(0),nq=ff(it),nr=ff(ac);(function(d){return fe(function(a,b,c){return jJ(d,a,b,c)},function(a){return 0})}(np));iw(function(a){fb(nq,0);return fb(nr,0)});function -ns(a,b){var -d=aL(b)===c?b:b[1];ex(a,d);return}ns(nu,[0,[c,nt,am(0)],[0]]);(function(a){throw a});function -V(a){return[0,a]}function -b5(a){return 0===a[0]?[0,a[1]]:0}var -a5=[0,function(a){return a}(0)];function -a6(a){return[1,0,0,0,a]}function -v(a,b){return 0===a[0]?[0,h(b,a[1])]:a6([0,a,b])}function -a7(a,b,c){if(0===a[0]){var -d=a[1];if(0===b[0])return[0,i(c,d,b[1])]}return a6([1,a,b,c])}function -fg(a,b,c){switch(c[0]){case -0:throw g([0,f,nx],1);case +d=0=c)return bO(a[17],fS,0,c);bO(a[17],fS,0,80);c=c-80|0}}function +oq(a){return a[1]===fL?ar(os,ar(a[2],or)):ot}function +ou(a){return a[1]===fL?ar(ow,ar(a[2],ov)):ox}function +oy(a){return 0}function +oz(a){return 0}function +dE(a,b,c,d,e){var +g=dk(0),h=[0,fJ,oA,0];dm(h,g);var +f=bz(0);dB(f);a5([0,1,h],f);var +i=78,j=bz(0),k=bz(0),l=bz(0);return[0,f,bz(0),l,k,j,i,10,68,i,0,1,1,1,1,je,oB,a,b,c,d,e,0,0,oq,ou,oy,oz,g]}function +fT(a,b){var +c=dE(a,b,function(a){return 0},function(a){return 0},function(a){return 0});c[19]=function(a){return dD(c,a)};c[20]=function(a){return a$(c,a)};c[21]=function(a){return a$(c,a)};return c}function +fU(d){return fT(function(a,b,c){return e7(d,a,b,c)},function(a){return bu(d)})}function +fV(d){return fT(function(a,b,c){return fl(d,a,b,c)},function(a){return 0})}var +dF=en;function +fW(a){return b9(dF)}var +fX=fW(0),dG=fU(dd),dH=fU(X),oC=fV(fX),fY=as(0,fW);bC(fY,fX);bC(as(0,function(a){return fV(aC(fY))}),oC);function +cj(a,b,c,d){return fl(aC(a),b,c,d)}function +ck(a,b,c){var +d=aC(b),e=kC(d);e7(a,fk(d),0,e);bu(a);return kD(d)}var +cl=as(0,function(a){return b9(dF)}),cm=as(0,function(a){return b9(dF)}),fZ=as(0,function(a){var +b=dE(function(a,b,c){return cj(cl,a,b,c)},function(a){return ck(dd,cl,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return dD(b,a)};b[20]=function(a){return a$(b,a)};b[21]=function(a){return a$(b,a)};fr(function(a){return ci(b,a)});return b});bC(fZ,dG);var +f0=as(0,function(a){var +b=dE(function(a,b,c){return cj(cm,a,b,c)},function(a){return ck(X,cm,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return dD(b,a)};b[20]=function(a){return a$(b,a)};b[21]=function(a){return a$(b,a)};fr(function(a){return ci(b,a)});return b});bC(f0,dH);function +f1(a){ci(aC(fZ),0);return ci(aC(f0),0)}jo(f1);kM(function(a){f1(0);var +b=fR(dG,0);fQ(dG,[0,function(a,b,c){return cj(cl,a,b,c)},function(a){return ck(dd,cl,a)},b[3],b[4],b[5]]);var +c=fR(dH,0);return fQ(dH,[0,function(a,b,c){return cj(cm,a,b,c)},function(a){return ck(X,cm,a)},c[3],c[4],c[5]])});function +oD(a,b){var +d=a3(b)===c?b:b[1];eY(a,d);return}oD(oF,[0,[c,oE,ao(0)],[0]]);(function(a){throw a});function +Z(a){return[0,a]}function +cn(a){return 0===a[0]?[0,a[1]]:0}var +ba=[0,function(a){return a}(0)];function +bb(a){return[1,0,0,0,a]}function +w(a,b){return 0===a[0]?[0,h(b,a[1])]:bb([0,a,b])}function +bc(a,b,c){if(0===a[0]){var +d=a[1];if(0===b[0])return[0,i(c,d,b[1])]}return bb([1,a,b,c])}function +f2(a,b,c){switch(c[0]){case +0:throw g([0,f,oI],1);case 1:c[3]=[0,b,a,c[3]];return;default:c[2]=[0,b,a,c[2]];return}}function -di(a,b){if(!b)throw g([0,f,ny],1);if(b[2]===a)return[0,b[1],b[3]];var -c=di(a,b[3]),d=c[1];b[3]=c[2];return[0,d,b]}function -br(a,b){switch(b[0]){case -0:throw g([0,f,nz],1);case +dI(a,b){if(!b)throw g([0,f,oJ],1);if(b[2]===a)return[0,b[1],b[3]];var +c=dI(a,b[3]),d=c[1];b[3]=c[2];return[0,d,b]}function +bF(a,b){switch(b[0]){case +0:throw g([0,f,oK],1);case 1:var -c=di(a,b[3]),e=c[1];b[3]=c[2];return e;default:var -d=di(a,b[2]),h=d[1];b[2]=d[2];return h}}function -fh(a,b,c,d){var -e=d;for(;;){if(!e)throw g([0,f,nA],1);if(e[1]===b&&e[2]===a){e[1]=c;return}e=e[3]}}function -dj(a,b,c,d){switch(d[0]){case -0:throw g([0,f,nB],1);case -1:return fh(a,b,c,d[3]);default:return fh(a,b,c,d[2])}}function -fi(a,b){var -c=b;for(;;){if(!c)throw g([0,f,nC],1);if(c[2]===a)return c[1];c=c[3]}}function -nD(a,b){switch(b[0]){case -0:throw g([0,f,nE],1);case -1:return fi(a,b[3]);default:return fi(a,b[2])}}function -as(a,b,c,d){switch(d[0]){case -0:throw g([0,f,nF],1);case +c=dI(a,b[3]),e=c[1];b[3]=c[2];return e;default:var +d=dI(a,b[2]),h=d[1];b[2]=d[2];return h}}function +f3(a,b,c,d){var +e=d;for(;;){if(!e)throw g([0,f,oL],1);if(e[1]===b&&e[2]===a){e[1]=c;return}e=e[3]}}function +dJ(a,b,c,d){switch(d[0]){case +0:throw g([0,f,oM],1);case +1:return f3(a,b,c,d[3]);default:return f3(a,b,c,d[2])}}function +f4(a,b){var +c=b;for(;;){if(!c)throw g([0,f,oN],1);if(c[2]===a)return c[1];c=c[3]}}function +oO(a,b){switch(b[0]){case +0:throw g([0,f,oP],1);case +1:return f4(a,b[3]);default:return f4(a,b[2])}}function +av(a,b,c,d){switch(d[0]){case +0:throw g([0,f,oQ],1);case 1:var j=d[1];if(typeof j==="number"&&!j){if(!c)return;if(b[1])return;b[1]=1;return}var @@ -2260,148 +2380,148 @@ l=d[1];a:{if(typeof l==="number"&&l){var e=1;break a}var e=c}d[1]=0;var -m=d[2];return a<50?gt(a+1|0,b,e,m):o(gt,[0,b,e,m]);default:var +m=d[2];return a<50?hc(a+1|0,b,e,m):o(hc,[0,b,e,m]);default:var i=d[1];d[1]=0;if(typeof i==="number"){if(!i)return;b[1]=2;return}var q=i[1];if(c)b[1]=2;return h(d[3],q)}}function -aC(a,b,c){return aM(as(0,a,b,c))}function -gt(a,b,c,d){if(typeof +aF(a,b,c){return aR(av(0,a,b,c))}function +hc(a,b,c,d){if(typeof d==="number")return;switch(d[0]){case 0:var -g=d[1];return a<50?as(a+1|0,b,c,g):o(as,[0,b,c,g]);case +f=d[1];return a<50?av(a+1|0,b,c,f):o(av,[0,b,c,f]);case 1:var -h=d[2];aC(b,c,d[1]);return a<50?as(a+1|0,b,c,h):o(as,[0,b,c,h]);case +g=d[2];aF(b,c,d[1]);return a<50?av(a+1|0,b,c,g):o(av,[0,b,c,g]);case 2:var -i=d[3],l=d[2];aC(b,c,d[1]);aC(b,c,l);return a<50?as(a+1|0,b,c,i):o(as,[0,b,c,i]);case +h=d[3],l=d[2];aF(b,c,d[1]);aF(b,c,l);return a<50?av(a+1|0,b,c,h):o(av,[0,b,c,h]);case 3:var -j=d[4],m=d[3],n=d[2];aC(b,c,d[1]);aC(b,c,n);aC(b,c,m);return a<50?as(a+1|0,b,c,j):o(as,[0,b,c,j]);default:var +i=d[4],m=d[3],n=d[2];aF(b,c,d[1]);aF(b,c,n);aF(b,c,m);return a<50?av(a+1|0,b,c,i):o(av,[0,b,c,i]);default:var p=d[1];d[1]=0;var k=p-1|0,q=0;if(k>=0){var -f=q;for(;;){aC(b,c,e(d[3],f)[1+f]);var -r=f+1|0;if(k===f)break;f=r}}return}}function -nG(a){return i(bY(ac,nH),b0,su(20))}function -b6(a,b){var -c=[0,0];aC(c,a,b);var -d=2<=c[1]?1:0;return d?nG(0):d}function -dk(a){return a6([5,a])}function -b7(a){return a}function -b8(a,b){if(1===a[0]){var -c=a[4];if(5===c[0]){c[1]=b;return b6(0,a)}}throw g([0,f,nI],1)}function -fj(a){if(1===a[0]){var -b=a[4];if(5===b[0])return b[1]}throw g([0,f,nJ],1)}function -a8(a,b,c){var -k=a,j=b,d=c;for(;;)switch(d[0]){case +e=q;for(;;){aF(b,c,j(d[3],e)[1+e]);var +r=e+1|0;if(k===e)break;e=r}}return}}function +oR(a){return i(cb(X,oS),cd,tI(20))}function +co(a,b){var +c=[0,0];aF(c,a,b);var +d=2<=c[1]?1:0;return d?oR(0):d}function +dK(a){return bb([5,a])}function +cp(a){return a}function +cq(a,b){if(1===a[0]){var +c=a[4];if(5===c[0]){c[1]=b;return co(0,a)}}throw g([0,f,oT],1)}function +f5(a){if(1===a[0]){var +b=a[4];if(5===b[0])return b[1]}throw g([0,f,oU],1)}function +bd(a,b,c){var +k=a,h=b,d=c;for(;;)switch(d[0]){case 0:return k;case 1:var -h=d[2];if(typeof -h==="number")throw g([0,f,nO],1);switch(h[0]){case -0:if(h[1]!==j)throw g([0,f,nP],1);var +e=d[2];if(typeof +e==="number")throw g([0,f,oZ],1);switch(e[0]){case +0:if(e[1]!==h)throw g([0,f,o0],1);var o=0;break;case 1:var -B=h[2],C=h[1];if(C===j)var -D=[0,B];else{if(B!==j)throw g([0,f,nQ],1);var +B=e[2],C=e[1];if(C===h)var +D=[0,B];else{if(B!==h)throw g([0,f,o1],1);var D=[0,C]}var o=D;break;case 2:var -u=h[3],v=h[2],w=h[1];if(w===j)var -x=[1,v,u];else if(v===j)var -x=[1,w,u];else{if(u!==j)throw g([0,f,nR],1);var +u=e[3],v=e[2],w=e[1];if(w===h)var +x=[1,v,u];else if(v===h)var +x=[1,w,u];else{if(u!==h)throw g([0,f,o2],1);var x=[1,w,v]}var o=x;break;case 3:var -p=h[4],q=h[3],r=h[2],s=h[1];if(s===j)var -t=[2,r,q,p];else if(r===j)var -t=[2,s,q,p];else if(q===j)var -t=[2,s,r,p];else{if(p!==j)throw g([0,f,nS],1);var +p=e[4],q=e[3],r=e[2],s=e[1];if(s===h)var +t=[2,r,q,p];else if(r===h)var +t=[2,s,q,p];else if(q===h)var +t=[2,s,r,p];else{if(p!==h)throw g([0,f,o3],1);var t=[2,s,r,q]}var o=t;break;default:var -n=br(d,j);if(e(h[3],n)[1+n]!==j)throw g([0,f,nT],1);var -m=h[2]-1|0;h[2]=m;if(n>>2|0))var -T=jd(h[3],0,K>>>1|0),L=[4,h[1],h[2],T];else +K=e[3].length-1;if(m<=(K>>>2|0))var +T=kc(e[3],0,K>>>1|0),L=[4,e[1],e[2],T];else var -L=h;var +L=e;var J=L}var o=J}d[2]=o;if(typeof o!=="number")return k;var y=d[1];d[1]=1;var l=d[4];switch(l[0]){case -0:j=d;d=l[1];break;case +0:h=d;d=l[1];break;case 1:var -M=l[2];k=a8(k,d,l[1]);j=d;d=M;break;case +M=l[2];k=bd(k,d,l[1]);h=d;d=M;break;case 2:var -N=l[2];k=a8(k,d,l[1]);j=d;d=N;break;case +N=l[2];k=bd(k,d,l[1]);h=d;d=N;break;case 3:var -O=l[2];k=a8(k,d,l[1]);j=d;d=O;break;case +O=l[2];k=bd(k,d,l[1]);h=d;d=O;break;case 4:var -z=l[2],A=a8(k,d,l[1]);if(!z)return A;var -P=z[1];l[2]=0;k=A;j=d;d=P;break;case +z=l[2],A=bd(k,d,l[1]);if(!z)return A;var +P=z[1];l[2]=0;k=A;h=d;d=P;break;case 5:return k;case 6:if(typeof y==="number")return k;var Q=y[1];try{i(l[2],d,Q);return k}catch(f){var -R=Z(f);return[0,[0,R,mp(0)],k]}default:var -S=l[1];k=a8(k,d,l[2]);j=d;d=S}break;default:throw g([0,f,nU],1)}}function -aD(a,b){var -h=a,c=b;for(;;)switch(c[0]){case +R=$(f);return[0,[0,R,nw(0)],k]}default:var +S=l[1];k=bd(k,d,l[2]);h=d;d=S}break;default:throw g([0,f,o5],1)}}function +aG(a,b){var +e=a,c=b;for(;;)switch(c[0]){case 0:return;case 1:var n=typeof c[2]==="number"?1:0,d=c[2];if(typeof d==="number")var -k=[0,h];else +k=[0,e];else switch(d[0]){case 0:var -k=[1,h,d[1]];break;case +k=[1,e,d[1]];break;case 1:var -k=[2,h,d[1],d[2]];break;case +k=[2,e,d[1],d[2]];break;case 2:var -k=[3,h,d[1],d[2],d[3]];break;case +k=[3,e,d[1],d[2],d[3]];break;case 3:var -o=[0,d[1],d[2],d[3],d[4],h,a5,a5,a5],l=0;for(;;){fg(c,l,e(o,l)[1+l]);var +o=[0,d[1],d[2],d[3],d[4],e,ba,ba,ba],l=0;for(;;){f2(c,l,j(o,l)[1+l]);var w=l+1|0;if(4===l)break;l=w}var k=[4,5,5,o];break;default:var -j=d[2];if(j>>1|0)}function -fu(a,b,c){if(typeof -a!=="number"){if(0!==a[0]){if(a[2]!==b)throw g([0,f,ol],1);a[2]=c;return}if(a[2]===b){a[2]=c;return}if(a[4]===b){a[4]=c;return}}throw g([0,f,ok],1)}function -dS(a,b,c){if(typeof +gd(a,b){return dM(a,b>>>1|0)}function +ge(a,b,c){if(typeof +a!=="number"){if(0!==a[0]){if(a[2]!==b)throw g([0,f,pw],1);a[2]=c;return}if(a[2]===b){a[2]=c;return}if(a[4]===b){a[4]=c;return}}throw g([0,f,pv],1)}function +ee(a,b,c){if(typeof c!=="number"&&0===c[0]){var d=c[4];if(typeof d!=="number"&&1!==d[0]){var h=c[5],e=d[2];if(typeof e==="number")var -i=0;else{if(0!==e[0])throw g([0,f,op],1);e[5]=c;var -i=e}d[2]=c;c[4]=i;c[5]=d;d[5]=h;fu(h,c,d);dn(b,c);return a<50?bz(a+1|0,b,d):o(bz,[0,b,d])}}throw g([0,f,oo],1)}function -om(a,b){return aM(dS(0,a,b))}function -dR(a,b,c){if(typeof +i=0;else{if(0!==e[0])throw g([0,f,pA],1);e[5]=c;var +i=e}d[2]=c;c[4]=i;c[5]=d;d[5]=h;ge(h,c,d);dN(b,c);return a<50?bN(a+1|0,b,d):o(bN,[0,b,d])}}throw g([0,f,pz],1)}function +px(a,b){return aR(ee(0,a,b))}function +ed(a,b,c){if(typeof c!=="number"&&0===c[0]){var d=c[2];if(typeof d!=="number"&&1!==d[0]){var h=c[5],e=d[4];if(typeof e==="number")var -i=0;else{if(0!==e[0])throw g([0,f,or],1);e[5]=c;var -i=e}d[4]=c;c[2]=i;c[5]=d;d[5]=h;fu(h,c,d);dn(b,c);return a<50?bz(a+1|0,b,d):o(bz,[0,b,d])}}throw g([0,f,oq],1)}function -on(a,b){return aM(dR(0,a,b))}function -gv(a,b,c){if(typeof +i=0;else{if(0!==e[0])throw g([0,f,pC],1);e[5]=c;var +i=e}d[4]=c;c[2]=i;c[5]=d;d[5]=h;ge(h,c,d);dN(b,c);return a<50?bN(a+1|0,b,d):o(bN,[0,b,d])}}throw g([0,f,pB],1)}function +py(a,b){return aR(ed(0,a,b))}function +he(a,b,c){if(typeof c!=="number"&&0===c[0]){var d=c[4];a:if(typeof d!=="number"&&0===d[0]){var -e=a9(d[2]);if(dm(a9(d[4]),e)){on(b,d);break a}}return a<50?dS(a+1|0,b,c):o(dS,[0,b,c])}throw g([0,f,os],1)}function -gu(a,b,c){if(typeof +e=be(d[2]);if(dM(be(d[4]),e)){py(b,d);break a}}return a<50?ee(a+1|0,b,c):o(ee,[0,b,c])}throw g([0,f,pD],1)}function +hd(a,b,c){if(typeof c!=="number"&&0===c[0]){var d=c[2];a:if(typeof d!=="number"&&0===d[0]){var -e=a9(d[4]);if(dm(a9(d[2]),e)){om(b,d);break a}}return a<50?dR(a+1|0,b,c):o(dR,[0,b,c])}throw g([0,f,ot],1)}function -bz(a,b,c){if(typeof +e=be(d[4]);if(dM(be(d[2]),e)){px(b,d);break a}}return a<50?ed(a+1|0,b,c):o(ed,[0,b,c])}throw g([0,f,pE],1)}function +bN(a,b,c){if(typeof c!=="number"&&0===c[0]){var -d=a9(c[2]),e=a9(c[4]);return d>>2|0}function -aE(a,b){if(typeof +d=c[4],e=gg(a),h=function(a,b){return a!==b?1:0};c[4]=jR(function(a){return h(e,a)},d);return 0}throw g([0,f,pZ],1)})),pW)}function +p4(a){if(typeof +a!=="number"&&1===a[0])return gh(a[2]);throw g([0,f,p5],1)}var +bG=0;function +ab(a){return[0,0,a]}function +gj(a,b){return a>>2|0}function +aH(a,b){if(typeof a==="number")var c=b;else{if(typeof b!=="number"){var -d=ca(b);return[1,(fz(ca(a),d)+1|0)<<2,a,b]}var +d=cu(b);return[1,(gj(cu(a),d)+1|0)<<2,a,b]}var c=a}return c}function -fA(a){return typeof +gk(a){return typeof a==="number"?0:0===a[0]?[0,a[2]]:[1,a[2],a[3]]}var -dp=1,dq=2,o1=3;function -fB(a){return-1===a?1:0}function -dr(a){return-1!==a?1:0}function -a_(a){return(a&3)===3?1:0}function -fC(a){return(a&3)===1?1:0}function -fD(a){return(a&3)===2?1:0}function -fE(a){return a|3}function -o2(a){return a>>>2|0}function -fF(a){return a<<2|2}function -bt(a){return a&ik(o1)}function -fG(a){return a[2]}function -fH(a){return a[3]}function -fI(a){return[0,0,0,0]}function -cb(a){a[1]=a[1]+1|0;return}function -cc(a){a[2]=a[2]+1|0;return}function -cd(a){a[3]=a[3]+1|0;return}function -ds(a,b,c){var +dO=1,dP=2,p$=3;function +gl(a){return-1===a?1:0}function +dQ(a){return-1!==a?1:0}function +bf(a){return(a&3)===3?1:0}function +gm(a){return(a&3)===1?1:0}function +gn(a){return(a&3)===2?1:0}function +go(a){return a|3}function +qa(a){return a>>>2|0}function +gp(a){return a<<2|2}function +bH(a){return a&jd(p$)}function +gq(a){return a[2]}function +gr(a){return a[3]}function +gs(a){return[0,0,0,0]}function +cv(a){a[1]=a[1]+1|0;return}function +cw(a){a[2]=a[2]+1|0;return}function +cx(a){a[3]=a[3]+1|0;return}function +dR(a,b,c){var d=c;for(;;){if(typeof d==="number")return;if(0===d[0]){var -e=d[1],i=(e&3)!==3?1:0,l=i?0!==(e&3)?1:0:i;if(l){if(0!==(e&b))throw g([0,f,o4],1);cb(a);cd(a);d[1]=e|3}return}var -h=d[1],j=(h&3)!==3?1:0,k=j?0!==(h&3)?1:0:j;if(!k)return k;if(0!==(h&b))throw g([0,f,o5],1);cb(a);cd(a);d[1]=h|3;ds(a,b,d[2]);d=d[3]}}function -ce(a,b,c,d){if(typeof +e=d[1],i=(e&3)!==3?1:0,l=i?0!==(e&3)?1:0:i;if(l){if(0!==(e&b))throw g([0,f,qc],1);cv(a);cx(a);d[1]=e|3}return}var +h=d[1],j=(h&3)!==3?1:0,k=j?0!==(h&3)?1:0:j;if(!k)return k;if(0!==(h&b))throw g([0,f,qd],1);cv(a);cx(a);d[1]=h|3;dR(a,b,d[2]);d=d[3]}}function +cy(a,b,c,d){if(typeof d==="number")return;if(0===d[0]){var -e=d[1];if(0===(e&c)){cb(a);if(0===(e&3))d[1]=e|c;else{d[1]=-1;cd(a);cc(a)}}var -g=-1!==e?1:0,h=g?(e&3)===3?1:0:g;return h?(d[1]=-1,cc(a)):h}var -f=d[1];if(0===(f&c)){cb(a);if(0===(f&3)){d[1]=f|c;c7(d,b)}else{d[1]=-1;cd(a);cc(a);ds(a,c,d[2]);ds(a,c,d[3])}}var -i=-1!==f?1:0,j=i?(f&3)===3?1:0:i;return j?(d[1]=-1,cc(a)):j}function -dt(a,b,c){var -d=eR(b);if(typeof +e=d[1];if(0===(e&c)){cv(a);if(0===(e&3))d[1]=e|c;else{d[1]=-1;cx(a);cw(a)}}var +g=-1!==e?1:0,h=g?(e&3)===3?1:0:g;return h?(d[1]=-1,cw(a)):h}var +f=d[1];if(0===(f&c)){cv(a);if(0===(f&3)){d[1]=f|c;dm(d,b)}else{d[1]=-1;cx(a);cw(a);dR(a,c,d[2]);dR(a,c,d[3])}}var +i=-1!==f?1:0,j=i?(f&3)===3?1:0:i;return j?(d[1]=-1,cw(a)):j}function +dS(a,b,c){var +d=fj(b);if(typeof d!=="number"&&1===d[0]){var -e=(d[1]&3)===c?1:0;return e?(ce(a,b,c,d[2]),ce(a,b,c,d[3])):e}throw g([0,f,o6],1)}function -fJ(a,b,c){for(;;){if(c8(b))return;dt(a,b,c)}}function -o7(a,b,c,d){for(;;){if(c8(c))return fJ(b,d,dq);if(c8(d))return fJ(a,c,dp);dt(a,c,dp);dt(b,d,dq)}}function -du(a){var +e=(d[1]&3)===c?1:0;return e?(cy(a,b,c,d[2]),cy(a,b,c,d[3])):e}throw g([0,f,qe],1)}function +gt(a,b,c){for(;;){if(dn(b))return;dS(a,b,c)}}function +qf(a,b,c,d){for(;;){if(dn(c))return gt(b,d,dP);if(dn(d))return gt(a,c,dO);dS(a,c,dO);dS(b,d,dP)}}function +dT(a){var b=a[6];a[6]=b+1|0;return b}function -dv(a){var +dU(a){var b=a;for(;;){if(typeof b==="number")return;if(0===b[0]){var c=b[1];if(typeof c!=="number"&&0===c[0]){var -e=c[1],i=dr(e),l=i?a_(e):i;if(l)c[1]=bt(e);return}throw g([0,f,pa],1)}var +e=c[1],i=dQ(e),l=i?bf(e):i;if(l)c[1]=bH(e);return}throw g([0,f,qk],1)}var d=b[1];if(typeof d!=="number"&&1===d[0]){var -h=d[1],m=b[4],n=b[3],j=dr(h),k=j?a_(h):j;if(!k)return k;d[1]=bt(h);dv(n);b=m;continue}throw g([0,f,pb],1)}}function -fK(a,b){var +h=d[1],m=b[4],n=b[3],j=dQ(h),k=j?bf(h):j;if(!k)return k;d[1]=bH(h);dU(n);b=m;continue}throw g([0,f,ql],1)}}function +gu(a,b){var c=b;for(;;){if(typeof c==="number")return;if(0===c[0]){var d=c[1];if(typeof d!=="number"&&0===d[0]){var -h=d[1],u=c[2];if(!fC(h)){if(fB(h)){var -k=du(a);e(a[4],k)[1+k]=d;e(a[5],k)[1+k]=[0,c,0];d[1]=fF(k);return}if(fD(h)){var -n=o2(h),v=[0,c,e(a[5],n)[1+n]];e(a[5],n)[1+n]=v;return}var -q=a_(h);if(q)throw g([0,f,pe],1);return q}var -m=a[2];if(-1a[3])throw g([0,f,pd],1)}d[1]=bt(h);return}throw g([0,f,pc],1)}var -i=c[1];if(typeof -i!=="number"&&1===i[0]){var -r=c[4],s=c[3],j=i[1],w=c[2];if(fB(j)){var -l=du(a);e(a[4],l)[1+l]=i;e(a[5],l)[1+l]=[0,c,0];i[1]=fF(l);dv(s);return dv(r)}if(!fC(j)){if(fD(j)){var -o=j>>>2|0,x=[0,c,e(a[5],o)[1+o]];e(a[5],o)[1+o]=x;return}var -t=a_(j);if(t)throw g([0,f,ph],1);return t}if(-1a[3])throw g([0,f,pg],1)}i[1]=bt(j);fK(a,s);c=r;continue}throw g([0,f,pf],1)}}function -bu(a,b){if(typeof +e=d[1],u=c[2];if(!gm(e)){if(gl(e)){var +k=dT(a);j(a[4],k)[1+k]=d;j(a[5],k)[1+k]=[0,c,0];d[1]=gp(k);return}if(gn(e)){var +n=qa(e),v=[0,c,j(a[5],n)[1+n]];j(a[5],n)[1+n]=v;return}var +q=bf(e);if(q)throw g([0,f,qo],1);return q}var +m=a[2];if(-1a[3])throw g([0,f,qn],1)}d[1]=bH(e);return}throw g([0,f,qm],1)}var +h=c[1];if(typeof +h!=="number"&&1===h[0]){var +r=c[4],s=c[3],i=h[1],w=c[2];if(gl(i)){var +l=dT(a);j(a[4],l)[1+l]=h;j(a[5],l)[1+l]=[0,c,0];h[1]=gp(l);dU(s);return dU(r)}if(!gm(i)){if(gn(i)){var +o=i>>>2|0,x=[0,c,j(a[5],o)[1+o]];j(a[5],o)[1+o]=x;return}var +t=bf(i);if(t)throw g([0,f,qr],1);return t}if(-1a[3])throw g([0,f,qq],1)}h[1]=bH(i);gu(a,s);c=r;continue}throw g([0,f,qp],1)}}function +bI(a,b){if(typeof b==="number")return 0;if(0!==b[0]){var -j=b[1];if(-1===j){var -l=du(a);b[1]=0;e(a[4],l)[1+l]=b;var -p=bu(a,b[2]);return[1,b,0,p,bu(a,b[3])]}if(!a_(j)){b[1]=bt(b[1]);var -r=bu(a,b[2]);return[1,b,0,r,bu(a,b[3])]}var -d=j>>>2|0,k=e(a[5],d)[1+d];if(!k)throw g([0,f,pk],1);var -m=k[2],q=k[1];e(a[5],d)[1+d]=m;if(0===m)b[1]=0;return q}var -h=b[1];if(dr(h)&&a_(h)){var -c=h>>>2|0,i=e(a[5],c)[1+c];if(!i)return[0,b,0];var -n=i[2],o=i[1];e(a[5],c)[1+c]=n;return o}b[1]=0;return[0,b,0]}var -dw=[0,0,[0],0,0];function -o3(a){return a[1]}function -o8(a){return a[1]}function -o9(a){return a[2]}function -o_(a,b){var -c=fI(0),d=fI(0),e=c5(0),f=c5(0);ce(c,e,dp,a);ce(d,f,dq,b);o7(c,d,e,f);return[0,c,d]}function -o$(a){if(typeof +i=b[1];if(-1===i){var +l=dT(a);b[1]=0;j(a[4],l)[1+l]=b;var +p=bI(a,b[2]);return[1,b,0,p,bI(a,b[3])]}if(!bf(i)){b[1]=bH(b[1]);var +r=bI(a,b[2]);return[1,b,0,r,bI(a,b[3])]}var +d=i>>>2|0,k=j(a[5],d)[1+d];if(!k)throw g([0,f,qu],1);var +m=k[2],q=k[1];j(a[5],d)[1+d]=m;if(0===m)b[1]=0;return q}var +e=b[1];if(dQ(e)&&bf(e)){var +c=e>>>2|0,h=j(a[5],c)[1+c];if(!h)return[0,b,0];var +n=h[2],o=h[1];j(a[5],c)[1+c]=n;return o}b[1]=0;return[0,b,0]}var +dV=[0,0,[0],0,0];function +qb(a){return a[1]}function +qg(a){return a[1]}function +qh(a){return a[2]}function +qi(a,b){var +c=gs(0),d=gs(0),e=dk(0),f=dk(0);cy(c,e,dO,a);cy(d,f,dP,b);qf(c,d,e,f);return[0,c,d]}function +qj(a){if(typeof a==="number")return;if(0===a[0]){a[1]=0;return}var -b=ca(a[3]);a[1]=(fz(ca(a[2]),b)+1|0)<<2;return}function -pi(a){var -h=a[6]-1|0,i=0;if(h>=0){var -b=i;for(;;){var -c=e(a[4],b)[1+b];if(typeof -c!=="number")if(0===c[0])c[1]=fE(c[1]);else -c[1]=fE(c[1]);var -d=e(a[5],b)[1+b];if(!d)throw g([0,f,pj],1);if(d[2]){var -j=aN(d);e(a[5],b)[1+b]=j}var -k=b+1|0;if(h===b)break;b=k}}return}function -fL(a,b,c){if(typeof +b=cu(a[3]);a[1]=(gj(cu(a[2]),b)+1|0)<<2;return}function +qs(a){var +e=a[6]-1|0,h=0;if(e>=0){var +b=h;for(;;){var +c=j(a[4],b)[1+b];if(typeof +c!=="number")if(0===c[0])c[1]=go(c[1]);else +c[1]=go(c[1]);var +d=j(a[5],b)[1+b];if(!d)throw g([0,f,qt],1);if(d[2]){var +i=by(d);j(a[5],b)[1+b]=i}var +k=b+1|0;if(e===b)break;b=k}}return}function +gv(a,b,c){if(typeof b==="number"){if(typeof -c==="number")return[0,dw,0]}else if(b[1]===c)return[0,dw,b];var +c==="number")return[0,dV,0]}else if(b[1]===c)return[0,dV,b];var t=typeof -b==="number"?bs:b[1],m=o_(t,c),j=o8(m),n=o9(m),u=fH(n),v=fH(j)+u|0,o=o3(j)-v|0,w=fG(n),p=fG(j)+w|0,x=0,y=ao(p,0),z=ao(p,0),A=a?o:-1,B=a?0:-1,C=a?ao(o,0):[0],d=[0,C,B,A,z,y,x];fK(d,b);if(d[2]!==d[3])throw g([0,f,pl],1);pi(d);var -q=bu(d,c),r=d[6]-1|0;if(r>=0){var -i=r;for(;;){o$(e(d[4],i)[1+i]);var -F=i-1|0;if(0===i)break;i=F}}if(!a)return[0,dw,q];var +b==="number"?bG:b[1],m=qi(t,c),i=qg(m),n=qh(m),u=gr(n),v=gr(i)+u|0,o=qb(i)-v|0,w=gq(n),p=gq(i)+w|0,x=0,y=aj(p,0),z=aj(p,0),A=a?o:-1,B=a?0:-1,C=a?aj(o,0):[0],d=[0,C,B,A,z,y,x];gu(d,b);if(d[2]!==d[3])throw g([0,f,qv],1);qs(d);var +q=bI(d,c),r=d[6]-1|0;if(r>=0){var +h=r;for(;;){qj(j(d[4],h)[1+h]);var +F=h-1|0;if(0===h)break;h=F}}if(!a)return[0,dV,q];var k=[0,0],l=[0,0],s=d[6]-1|0,D=0;if(s>=0){var -h=D;for(;;){aO(function(a){if(typeof +e=D;for(;;){aS(function(a){if(typeof a!=="number")if(0===a[0]){var b=a[2];if(b){k[1]=[0,b[1],k[1]];return 0}}else{var -c=a[2];if(c){l[1]=[0,c[1],l[1]];return 0}}return 0},e(d[5],h)[1+h]);var -E=h+1|0;if(s===h)break;h=E}}return[0,[0,d[2],d[1],k[1],l[1]],q]}function -pm(d,b){if(typeof +c=a[2];if(c){l[1]=[0,c[1],l[1]];return 0}}return 0},j(d[5],e)[1+e]);var +E=e+1|0;if(s===e)break;e=E}}return[0,[0,d[2],d[1],k[1],l[1]],q]}function +qw(d,b){if(typeof b==="number")return 0;function c(a){a:if(typeof a!=="number"){b:{if(0===a[0]){var @@ -2741,369 +2859,366 @@ j=e[1];break b}var k=h(d[1],b[2]);a[2]=[0,k];return k}break a}var l=a[2];if(!l){var n=c(a[3]),o=c(a[4]),m=i(d[2],n,o);a[2]=[0,m];return m}var -j=l[1]}return j}throw g([0,f,pn],1)}return[0,c(b)]}function -cf(a,b){return[0,[0,a,b],0]}function -cg(a){return pm(a[1],a[2])}function -po(a,b){var -c=a[1];return[0,c,fL(0,a[2],b)[2]]}function -dx(a,b){var -d=a[1],c=fL(1,a[2],b);return[0,c[1],[0,d,c[2]]]}function -ch(a,b,c,d){var -f=[0,d];if(bc===a)var -j=c[1],h=0;else if(g_<=a)var -j=c[2].length-1,h=c[1];else +j=l[1]}return j}throw g([0,f,qx],1)}return[0,c(b)]}function +cz(a,b){return[0,[0,a,b],0]}function +cA(a){return qw(a[1],a[2])}function +qy(a,b){var +c=a[1];return[0,c,gv(0,a[2],b)[2]]}function +dW(a,b){var +d=a[1],c=gv(1,a[2],b);return[0,c[1],[0,d,c[2]]]}function +cB(a,b,c,d){var +e=[0,d];if(bj===a)var +h=c[1],g=0;else if(hS<=a)var +h=c[2].length-1,g=c[1];else var -j=c[2].length-1,h=0;var -k=j-1|0;if(k>=h){var -g=h;for(;;){var -l=e(c[2],g)[1+g];if(l)f[1]=i(b,l[1],f[1]);var -m=g+1|0;if(k===g)break;g=m}}if(g_>a)aO(function(a){f[1]=i(b,a,f[1]);return 0},c[3]);if(bc!==a)aO(function(a){f[1]=i(b,a,f[1]);return 0},c[4]);return}function -dy(a,b,c){if(typeof -c==="number")throw g([0,f,pp],1);if(0===c[0])return h(a,c[2]);var -d=dy(a,b,c[3]);return i(b,dy(a,b,c[2]),d)}function -ci(a,b,c){var -d=b[2],e=b[1],f=b5(c);if(f){var +h=c[2].length-1,g=0;var +k=h-1|0;if(k>=g){var +f=g;for(;;){var +l=j(c[2],f)[1+f];if(l)e[1]=i(b,l[1],e[1]);var +m=f+1|0;if(k===f)break;f=m}}if(hS>a)aS(function(a){e[1]=i(b,a,e[1]);return 0},c[3]);if(bj!==a)aS(function(a){e[1]=i(b,a,e[1]);return 0},c[4]);return}function +dX(a,b,c){if(typeof +c==="number")throw g([0,f,qz],1);if(0===c[0])return h(a,c[2]);var +d=dX(a,b,c[3]);return i(b,dX(a,b,c[2]),d)}function +cC(a,b,c){var +d=b[2],e=b[1],f=cn(c);if(f){var g=f[1];return typeof -g==="number"?V(e):V(dy(a,d,g))}var -h=[0,cf(a,d)];return v(c,function(a){var -b=po(h[1],a);h[1]=b;var -c=cg(b);return c?c[1]:e})}var -dz=[0,bs,aE];function -pq(a,b){return b_(b,dz,a)}function -dA(a,b,c,d){if(db)throw g([0,f,qs],1);var -j=a[2],c=[0,cf(function(a){var -b=fW(a);d(b);return b},function(a,b){return dG})];return v(j,function(a){var -b=dx(c[1],a),d=b[2],f=b[1];c[1]=d;ch(bc,function(a,b){return e(a)},f,0);cg(d);return 0})},[0,cn,function(a,b){return cn}],b)}function -dH(a,b){return fU(b[1],b[2],b[3],a)}function -qt(c,b){return b_(function(a){var +i=a[2];return w(i,h(0))}if(83>b)throw g([0,f,rC],1);var +j=a[2],c=[0,cz(function(a){var +b=gG(a);d(b);return b},function(a,b){return d5})];return w(j,function(a){var +b=dW(c[1],a),d=b[2],f=b[1];c[1]=d;cB(bj,function(a,b){return e(a)},f,0);cA(d);return 0})},[0,cH,function(a,b){return cH}],b)}function +d6(a,b){return gE(b[1],b[2],b[3],a)}function +rD(c,b){return cs(function(a){var b=a[1];if(82===b){var -d=[0,0];return v(a[2],function(a){var -b=d[1];if(b)fV(b[1]);d[1]=[0,dH(c,a)];return 0})}if(83>b)throw g([0,f,qu],1);var -h=a[2],e=[0,cf(function(a){return dH(c,a)},function(a,b){return a})];return v(h,function(a){var -b=dx(e[1],a),c=b[2],d=b[1];e[1]=c;ch(bc,function(a,b){return fV(a)},d,0);cg(c);return 0})},[0,cn,function(a,b){return cn}],b)}function -qv(a,b,c,d,e,f){var -p=b?b[1]:0,q=c?c[1]:0,r=d?d[1]:function(a){return},l=f5(p),k=l[2],s=l[1],m=f5(q),n=m[2],t=m[1],o=qm(f),i=o[2],g=fY(a,[0,s],e,o[1]);h(r,g);if(k)if(i)var -u=f8(g,i[1]),j=a7(f9(g,k),u,function(a,b){return b});else +d=[0,0];return w(a[2],function(a){var +b=d[1];if(b)gF(b[1]);d[1]=[0,d6(c,a)];return 0})}if(83>b)throw g([0,f,rE],1);var +h=a[2],e=[0,cz(function(a){return d6(c,a)},function(a,b){return a})];return w(h,function(a){var +b=dW(e[1],a),c=b[2],d=b[1];e[1]=c;cB(bj,function(a,b){return gF(a)},d,0);cA(c);return 0})},[0,cH,function(a,b){return cH}],b)}function +rF(a,b,c,d,e,f){var +p=b?b[1]:0,q=c?c[1]:0,r=d?d[1]:function(a){return},l=gP(p),k=l[2],s=l[1],m=gP(q),n=m[2],t=m[1],o=rw(f),i=o[2],g=gI(a,[0,s],e,o[1]);h(r,g);if(k)if(i)var +u=gS(g,i[1]),j=bc(gT(g,k),u,function(a,b){return b});else var -j=v(f9(g,k),function(a){return g});else +j=w(gT(g,k),function(a){return g});else var -j=i?f8(g,i[1]):V(g);aO(function(a){dH(g,a);return 0},t);var -w=n?a7(qt(g,n),j,function(a,b){return b}):j;return w}function -f_(a,b,c,d,e,f){return qv(b,c,d,e,a,f)}function -$(a,b,c,d,e){return f_(f1,a,b,c,d,e)}function -qw(a,b,c,d,e){return f_(p5,a,b,c,d,e)}function -dI(a,b){return a===b?1:0}function -co(a,b){return b1&&(r5-=1),r5<1/6?t5+6*(e4-t5)*r5:r5<.5?e4:r5<2/3?t5+(e4-t5)*(2/3-r5)*6:t5}if(t4=x(t4,360),e3=x(e3,100),r4=x(r4,100),e3===0)n5=i4=o4=r4;else{var s3=r4<.5?r4*(1+e3):r4+e3-r4*e3,u3=2*r4-s3;n5=a3(u3,s3,t4+1/3),i4=a3(u3,s3,t4),o4=a3(u3,s3,t4-1/3)}return{r:255*n5,g:255*i4,b:255*o4}}(r3.h,o3,s2),u2=!0,c2="hsl"),r3.hasOwnProperty("a")&&(i3=r3.a)),i3=A(i3),{ok:u2,format:r3.format||c2,r:Math.min(255,Math.max(n4.r,0)),g:Math.min(255,Math.max(n4.g,0)),b:Math.min(255,Math.max(n4.b,0)),a:i3};var l2,f2,h2}(n3);this._originalInput=n3,this._r=o2.r,this._g=o2.g,this._b=o2.b,this._a=o2.a,this._roundA=Math.round(100*this._a)/100,this._format=i2.format||o2.format,this._gradientType=i2.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=o2.ok}function n2(t4,e3,r3){t4=x(t4,255),e3=x(e3,255),r3=x(r3,255);var n3,i2,o2=Math.max(t4,e3,r3),a2=Math.min(t4,e3,r3),s2=(o2+a2)/2;if(o2==a2)n3=i2=0;else{var u2=o2-a2;switch(i2=s2>.5?u2/(2-o2-a2):u2/(o2+a2),o2){case t4:n3=(e3-r3)/u2+(e3>1)+720)%360;--e3;)i2.h=(i2.h+o2)%360,a2.push(r2(i2));return a2}function b(t4,e3){e3=e3||6;for(var n3=r2(t4).toHsv(),i2=n3.h,o2=n3.s,a2=n3.v,s2=[],u2=1/e3;e3--;)s2.push(r2({h:i2,s:o2,v:a2})),a2=(a2+u2)%1;return s2}r2.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t4=this.toRgb();return(299*t4.r+587*t4.g+114*t4.b)/1e3},getLuminance:function(){var t4,e3,r3,n3=this.toRgb();return t4=n3.r/255,e3=n3.g/255,r3=n3.b/255,.2126*(t4<=.03928?t4/12.92:Math.pow((t4+.055)/1.055,2.4))+.7152*(e3<=.03928?e3/12.92:Math.pow((e3+.055)/1.055,2.4))+.0722*(r3<=.03928?r3/12.92:Math.pow((r3+.055)/1.055,2.4))},setAlpha:function(t4){return this._a=A(t4),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t4=i(this._r,this._g,this._b);return{h:360*t4.h,s:t4.s,v:t4.v,a:this._a}},toHsvString:function(){var t4=i(this._r,this._g,this._b),e3=Math.round(360*t4.h),r3=Math.round(100*t4.s),n3=Math.round(100*t4.v);return this._a==1?"hsv("+e3+", "+r3+"%, "+n3+"%)":"hsva("+e3+", "+r3+"%, "+n3+"%, "+this._roundA+")"},toHsl:function(){var t4=n2(this._r,this._g,this._b);return{h:360*t4.h,s:t4.s,l:t4.l,a:this._a}},toHslString:function(){var t4=n2(this._r,this._g,this._b),e3=Math.round(360*t4.h),r3=Math.round(100*t4.s),i2=Math.round(100*t4.l);return this._a==1?"hsl("+e3+", "+r3+"%, "+i2+"%)":"hsla("+e3+", "+r3+"%, "+i2+"%, "+this._roundA+")"},toHex:function(t4){return o(this._r,this._g,this._b,t4)},toHexString:function(t4){return"#"+this.toHex(t4)},toHex8:function(t4){return function(t5,e3,r3,n3,i2){var o2=[E(Math.round(t5).toString(16)),E(Math.round(e3).toString(16)),E(Math.round(r3).toString(16)),E(M(n3))];return i2&&o2[0].charAt(0)==o2[0].charAt(1)&&o2[1].charAt(0)==o2[1].charAt(1)&&o2[2].charAt(0)==o2[2].charAt(1)&&o2[3].charAt(0)==o2[3].charAt(1)?o2[0].charAt(0)+o2[1].charAt(0)+o2[2].charAt(0)+o2[3].charAt(0):o2.join("")}(this._r,this._g,this._b,this._a,t4)},toHex8String:function(t4){return"#"+this.toHex8(t4)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*x(this._r,255))+"%",g:Math.round(100*x(this._g,255))+"%",b:Math.round(100*x(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(100*x(this._r,255))+"%, "+Math.round(100*x(this._g,255))+"%, "+Math.round(100*x(this._b,255))+"%)":"rgba("+Math.round(100*x(this._r,255))+"%, "+Math.round(100*x(this._g,255))+"%, "+Math.round(100*x(this._b,255))+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":!(this._a<1)&&(m[o(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t4){var e3="#"+a(this._r,this._g,this._b,this._a),n3=e3,i2=this._gradientType?"GradientType = 1, ":"";if(t4){var o2=r2(t4);n3="#"+a(o2._r,o2._g,o2._b,o2._a)}return"progid:DXImageTransform.Microsoft.gradient("+i2+"startColorstr="+e3+",endColorstr="+n3+")"},toString:function(t4){var e3=!!t4;t4=t4||this._format;var r3=!1,n3=this._a<1&&this._a>=0;return e3||!n3||t4!=="hex"&&t4!=="hex6"&&t4!=="hex3"&&t4!=="hex4"&&t4!=="hex8"&&t4!=="name"?(t4==="rgb"&&(r3=this.toRgbString()),t4==="prgb"&&(r3=this.toPercentageRgbString()),t4!=="hex"&&t4!=="hex6"||(r3=this.toHexString()),t4==="hex3"&&(r3=this.toHexString(!0)),t4==="hex4"&&(r3=this.toHex8String(!0)),t4==="hex8"&&(r3=this.toHex8String()),t4==="name"&&(r3=this.toName()),t4==="hsl"&&(r3=this.toHslString()),t4==="hsv"&&(r3=this.toHsvString()),r3||this.toHexString()):t4==="name"&&this._a===0?this.toName():this.toRgbString()},clone:function(){return r2(this.toString())},_applyModification:function(t4,e3){var r3=t4.apply(null,[this].concat([].slice.call(e3)));return this._r=r3._r,this._g=r3._g,this._b=r3._b,this.setAlpha(r3._a),this},lighten:function(){return this._applyModification(l,arguments)},brighten:function(){return this._applyModification(f,arguments)},darken:function(){return this._applyModification(h,arguments)},desaturate:function(){return this._applyModification(s,arguments)},saturate:function(){return this._applyModification(u,arguments)},greyscale:function(){return this._applyModification(c,arguments)},spin:function(){return this._applyModification(d,arguments)},_applyCombination:function(t4,e3){return t4.apply(null,[this].concat([].slice.call(e3)))},analogous:function(){return this._applyCombination(v,arguments)},complement:function(){return this._applyCombination(p,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(g,[3])},tetrad:function(){return this._applyCombination(g,[4])}},r2.fromRatio=function(t4,e3){if(typeof t4=="object"){var n3={};for(var i2 in t4)t4.hasOwnProperty(i2)&&(n3[i2]=i2==="a"?t4[i2]:S(t4[i2]));t4=n3}return r2(t4,e3)},r2.equals=function(t4,e3){return!(!t4||!e3)&&r2(t4).toRgbString()==r2(e3).toRgbString()},r2.random=function(){return r2.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},r2.mix=function(t4,e3,n3){n3=n3===0?0:n3||50;var i2=r2(t4).toRgb(),o2=r2(e3).toRgb(),a2=n3/100;return r2({r:(o2.r-i2.r)*a2+i2.r,g:(o2.g-i2.g)*a2+i2.g,b:(o2.b-i2.b)*a2+i2.b,a:(o2.a-i2.a)*a2+i2.a})},r2.readability=function(t4,e3){var n3=r2(t4),i2=r2(e3);return(Math.max(n3.getLuminance(),i2.getLuminance())+.05)/(Math.min(n3.getLuminance(),i2.getLuminance())+.05)},r2.isReadable=function(t4,e3,n3){var i2,o2,a2,s2,u2,c2=r2.readability(t4,e3);switch(o2=!1,(a2=n3,(s2=((a2=a2||{level:"AA",size:"small"}).level||"AA").toUpperCase())!=="AA"&&s2!=="AAA"&&(s2="AA"),(u2=(a2.size||"small").toLowerCase())!=="small"&&u2!=="large"&&(u2="small"),i2={level:s2,size:u2}).level+i2.size){case"AAsmall":case"AAAlarge":o2=c2>=4.5;break;case"AAlarge":o2=c2>=3;break;case"AAAsmall":o2=c2>=7}return o2},r2.mostReadable=function(t4,e3,n3){var i2,o2,a2,s2,u2=null,c2=0;o2=(n3=n3||{}).includeFallbackColors,a2=n3.level,s2=n3.size;for(var l2=0;l2c2&&(c2=i2,u2=r2(e3[l2]));return r2.isReadable(t4,u2,{level:a2,size:s2})||!o2?u2:(n3.includeFallbackColors=!1,r2.mostReadable(t4,["#fff","#000"],n3))};var y=r2.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},m=r2.hexNames=function(t4){var e3={};for(var r3 in t4)t4.hasOwnProperty(r3)&&(e3[t4[r3]]=r3);return e3}(y);function A(t4){return t4=parseFloat(t4),(isNaN(t4)||t4<0||t4>1)&&(t4=1),t4}function x(t4,e3){(function(t5){return typeof t5=="string"&&t5.indexOf(".")!=-1&&parseFloat(t5)===1})(t4)&&(t4="100%");var r3=function(t5){return typeof t5=="string"&&t5.indexOf("%")!=-1}(t4);return t4=Math.min(e3,Math.max(0,parseFloat(t4))),r3&&(t4=parseInt(t4*e3,10)/100),Math.abs(t4-e3)<1e-6?1:t4%e3/parseFloat(e3)}function C(t4){return Math.min(1,Math.max(0,t4))}function w(t4){return parseInt(t4,16)}function E(t4){return t4.length==1?"0"+t4:""+t4}function S(t4){return t4<=1&&(t4=100*t4+"%"),t4}function M(t4){return Math.round(255*parseFloat(t4)).toString(16)}function O(t4){return w(t4)/255}var j,L,k,T=(L="[\\s|\\(]+("+(j="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+j+")[,|\\s]+("+j+")\\s*\\)?",k="[\\s|\\(]+("+j+")[,|\\s]+("+j+")[,|\\s]+("+j+")[,|\\s]+("+j+")\\s*\\)?",{CSS_UNIT:new RegExp(j),rgb:new RegExp("rgb"+L),rgba:new RegExp("rgba"+k),hsl:new RegExp("hsl"+L),hsla:new RegExp("hsla"+k),hsv:new RegExp("hsv"+L),hsva:new RegExp("hsva"+k),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function R(t4){return!!T.CSS_UNIT.exec(t4)}return r2}()}},e={};function r(n2){var i=e[n2];if(i!==void 0)return i.exports;var o=e[n2]={id:n2,loaded:!1,exports:{}};return t[n2].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=t2=>{var e2=t2&&t2.__esModule?()=>t2.default:()=>t2;return r.d(e2,{a:e2}),e2},r.d=(t2,e2)=>{for(var n2 in e2)r.o(e2,n2)&&!r.o(t2,n2)&&Object.defineProperty(t2,n2,{enumerable:!0,get:e2[n2]})},r.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),r.o=(t2,e2)=>Object.prototype.hasOwnProperty.call(t2,e2),r.r=t2=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t2,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t2,"__esModule",{value:!0})},r.nmd=t2=>(t2.paths=[],t2.children||(t2.children=[]),t2),r.nc=void 0;var n=r(607);return n.default})())}});var reconnectTimeoutBase,maxReconnectTimeout,messageReconnectTimeout,setupWS,WebsocketClient,init_websocket=__esm({"node_modules/lib0/websocket.js"(){init_observable();init_time();init_math();reconnectTimeoutBase=1200,maxReconnectTimeout=2500,messageReconnectTimeout=3e4,setupWS=wsclient=>{if(wsclient.shouldConnect&&wsclient.ws===null){let websocket=new WebSocket(wsclient.url),binaryType=wsclient.binaryType,pingTimeout=null;binaryType&&(websocket.binaryType=binaryType),wsclient.ws=websocket,wsclient.connecting=!0,wsclient.connected=!1,websocket.onmessage=event=>{wsclient.lastMessageReceived=getUnixTime();let data=event.data,message=typeof data=="string"?JSON.parse(data):data;message&&message.type==="pong"&&(clearTimeout(pingTimeout),pingTimeout=setTimeout(sendPing,messageReconnectTimeout/2)),wsclient.emit("message",[message,wsclient])};let onclose=error=>{wsclient.ws!==null&&(wsclient.ws=null,wsclient.connecting=!1,wsclient.connected?(wsclient.connected=!1,wsclient.emit("disconnect",[{type:"disconnect",error},wsclient])):wsclient.unsuccessfulReconnects++,setTimeout(setupWS,min(log10(wsclient.unsuccessfulReconnects+1)*reconnectTimeoutBase,maxReconnectTimeout),wsclient)),clearTimeout(pingTimeout)},sendPing=()=>{wsclient.ws===websocket&&wsclient.send({type:"ping"})};websocket.onclose=()=>onclose(null),websocket.onerror=error=>onclose(error),websocket.onopen=()=>{wsclient.lastMessageReceived=getUnixTime(),wsclient.connecting=!1,wsclient.connected=!0,wsclient.unsuccessfulReconnects=0,wsclient.emit("connect",[{type:"connect"},wsclient]),pingTimeout=setTimeout(sendPing,messageReconnectTimeout/2)}}},WebsocketClient=class extends Observable{constructor(url,{binaryType}={}){super(),this.url=url,this.ws=null,this.binaryType=binaryType||null,this.connected=!1,this.connecting=!1,this.unsuccessfulReconnects=0,this.lastMessageReceived=0,this.shouldConnect=!0,this._checkInterval=setInterval(()=>{this.connected&&messageReconnectTimeoute.key===room&&this.onmessage!==null&&this.onmessage({data:fromBase64(e.newValue||"")}),onChange(this._onChange)}postMessage(buf){varStorage.setItem(this.room,toBase64(createUint8ArrayFromArrayBuffer(buf)))}close(){offChange(this._onChange)}},BC=typeof BroadcastChannel>"u"?LocalStoragePolyfill:BroadcastChannel,getChannel=room=>setIfUndefined(channels,room,()=>{let subs=create(),bc=new BC(room);return bc.onmessage=e=>subs.forEach(sub=>sub(e.data,"broadcastchannel")),{bc,subs}}),subscribe=(room,f)=>(getChannel(room).subs.add(f),f),unsubscribe=(room,f)=>{let channel=getChannel(room),unsubscribed=channel.subs.delete(f);return unsubscribed&&channel.subs.size===0&&(channel.bc.close(),channels.delete(room)),unsubscribed},publish=(room,data,origin=null)=>{let c=getChannel(room);c.bc.postMessage(data),c.subs.forEach(sub=>sub(data,origin))}}});var createMutex,init_mutex=__esm({"node_modules/lib0/mutex.js"(){createMutex=()=>{let token=!0;return(f,g)=>{if(token){token=!1;try{f()}finally{token=!0}}else g!==void 0&&g()}}}});var require_simplepeer_min=__commonJS({"node_modules/simple-peer/simplepeer.min.js"(exports2,module2){(function(e){if(typeof exports2=="object"&&typeof module2<"u")module2.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;t=typeof window>"u"?typeof global>"u"?typeof self>"u"?this:self:global:window,t.SimplePeer=e()}})(function(){var t=Math.floor,n=Math.abs,r=Math.pow;return function(){function d(s,e,n2){function t2(o,i){if(!e[o]){if(!s[o]){var l=typeof __require=="function"&&__require;if(!i&&l)return l(o,!0);if(r2)return r2(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var a2=e[o]={exports:{}};s[o][0].call(a2.exports,function(e2){var r3=s[o][1][e2];return t2(r3||e2)},a2,a2.exports,d,s,e,n2)}return e[o].exports}for(var r2=typeof __require=="function"&&__require,a=0;a>16,l2[c2++]=255&t3>>8,l2[c2++]=255&t3;return s2===2&&(t3=u[e2.charCodeAt(n3)]<<2|u[e2.charCodeAt(n3+1)]>>4,l2[c2++]=255&t3),s2===1&&(t3=u[e2.charCodeAt(n3)]<<10|u[e2.charCodeAt(n3+1)]<<4|u[e2.charCodeAt(n3+2)]>>2,l2[c2++]=255&t3>>8,l2[c2++]=255&t3),l2}function d(e2){return c[63&e2>>18]+c[63&e2>>12]+c[63&e2>>6]+c[63&e2]}function s(e2,t3,n3){for(var r3,a2=[],o2=t3;o2l2?l2:d2+o2));return r3===1?(t3=e2[n3-1],a2.push(c[t3>>2]+c[63&t3<<4]+"==")):r3===2&&(t3=(e2[n3-2]<<8)+e2[n3-1],a2.push(c[t3>>10]+c[63&t3>>4]+c[63&t3<<2]+"=")),a2.join("")}n2.byteLength=function(e2){var t3=r2(e2),n3=t3[0],a2=t3[1];return 3*(n3+a2)/4-a2},n2.toByteArray=o,n2.fromByteArray=l;for(var c=[],u=[],p=typeof Uint8Array>"u"?Array:Uint8Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g=0,_=f.length;g<_;++g)c[g]=f[g],u[f.charCodeAt(g)]=g;u[45]=62,u[95]=63},{}],2:[function(){},{}],3:[function(e,t2,n2){(function(){(function(){"use strict";var t3=String.fromCharCode,o=Math.min;function d(e2){if(2147483647e2)throw new RangeError('The value "'+e2+'" is invalid for option "size"')}function u(e2,t4,n3){return c(e2),0>=e2||t4===void 0?d(e2):typeof n3=="string"?d(e2).fill(t4,n3):d(e2).fill(t4)}function p(e2){return c(e2),d(0>e2?0:0|m(e2))}function f(e2,t4){if((typeof t4!="string"||t4==="")&&(t4="utf8"),!s.isEncoding(t4))throw new TypeError("Unknown encoding: "+t4);var n3=0|b(e2,t4),r2=d(n3),a=r2.write(e2,t4);return a!==n3&&(r2=r2.slice(0,a)),r2}function g(e2){for(var t4=0>e2.length?0:0|m(e2.length),n3=d(t4),r2=0;r2t4||e2.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e2}function b(e2,t4){if(s.isBuffer(e2))return e2.length;if(ArrayBuffer.isView(e2)||K(e2,ArrayBuffer))return e2.byteLength;if(typeof e2!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e2);var n3=e2.length,r2=2>>1;case"base64":return z(e2).length;default:if(a)return r2?-1:H(e2).length;t4=(""+t4).toLowerCase(),a=!0}}function y(e2,t4,n3){var r2=!1;if((t4===void 0||0>t4)&&(t4=0),t4>this.length||((n3===void 0||n3>this.length)&&(n3=this.length),0>=n3)||(n3>>>=0,t4>>>=0,n3<=t4))return"";for(e2||(e2="utf8");;)switch(e2){case"hex":return P(this,t4,n3);case"utf8":case"utf-8":return x(this,t4,n3);case"ascii":return D(this,t4,n3);case"latin1":case"binary":return I(this,t4,n3);case"base64":return A(this,t4,n3);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t4,n3);default:if(r2)throw new TypeError("Unknown encoding: "+e2);e2=(e2+"").toLowerCase(),r2=!0}}function C(e2,t4,n3){var r2=e2[t4];e2[t4]=e2[n3],e2[n3]=r2}function R(e2,t4,n3,r2,a){if(e2.length===0)return-1;if(typeof n3=="string"?(r2=n3,n3=0):2147483647n3&&(n3=-2147483648),n3=+n3,X(n3)&&(n3=a?0:e2.length-1),0>n3&&(n3=e2.length+n3),n3>=e2.length){if(a)return-1;n3=e2.length-1}else if(0>n3)if(a)n3=0;else return-1;if(typeof t4=="string"&&(t4=s.from(t4,r2)),s.isBuffer(t4))return t4.length===0?-1:E(e2,t4,n3,r2,a);if(typeof t4=="number")return t4&=255,typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(e2,t4,n3):Uint8Array.prototype.lastIndexOf.call(e2,t4,n3):E(e2,[t4],n3,r2,a);throw new TypeError("val must be string, number or Buffer")}function E(e2,t4,n3,r2,a){function o2(e3,t5){return d2===1?e3[t5]:e3.readUInt16BE(t5*d2)}var d2=1,s2=e2.length,l2=t4.length;if(r2!==void 0&&(r2=(r2+"").toLowerCase(),r2==="ucs2"||r2==="ucs-2"||r2==="utf16le"||r2==="utf-16le")){if(2>e2.length||2>t4.length)return-1;d2=2,s2/=2,l2/=2,n3/=2}var c2;if(a){var u2=-1;for(c2=n3;c2s2&&(n3=s2-l2),c2=n3;0<=c2;c2--){for(var p2=!0,f2=0;f2a&&(r2=a)):r2=a;var o2=t4.length;r2>o2/2&&(r2=o2/2);for(var d2,s2=0;s2d2&&(s2=d2):l2===2?(c2=e2[a+1],(192&c2)==128&&(f2=(31&d2)<<6|63&c2,127f2||57343f2&&(s2=f2)))}s2===null?(s2=65533,l2=1):65535>>10),s2=56320|1023&s2),r2.push(s2),a+=l2}return N(r2)}function N(e2){var n3=e2.length;if(n3<=4096)return t3.apply(String,e2);for(var r2="",a=0;at4)&&(t4=0),(!n3||0>n3||n3>r2)&&(n3=r2);for(var a="",o2=t4;o2e2)throw new RangeError("offset is not uint");if(e2+t4>n3)throw new RangeError("Trying to access beyond buffer length")}function F(e2,t4,n3,r2,a,o2){if(!s.isBuffer(e2))throw new TypeError('"buffer" argument must be a Buffer instance');if(t4>a||t4e2.length)throw new RangeError("Index out of range")}function B(e2,t4,n3,r2){if(n3+r2>e2.length)throw new RangeError("Index out of range");if(0>n3)throw new RangeError("Index out of range")}function U(e2,t4,n3,r2,a){return t4=+t4,n3>>>=0,a||B(e2,t4,n3,4,34028234663852886e22,-34028234663852886e22),J.write(e2,t4,n3,r2,23,4),n3+4}function j(e2,t4,n3,r2,a){return t4=+t4,n3>>>=0,a||B(e2,t4,n3,8,17976931348623157e292,-17976931348623157e292),J.write(e2,t4,n3,r2,52,8),n3+8}function q(e2){if(e2=e2.split("=")[0],e2=e2.trim().replace(Q,""),2>e2.length)return"";for(;e2.length%4!=0;)e2+="=";return e2}function W(e2){return 16>e2?"0"+e2.toString(16):e2.toString(16)}function H(e2,t4){t4=t4||1/0;for(var n3,r2=e2.length,a=null,o2=[],d2=0;d2n3){if(!a){if(56319n3){-1<(t4-=3)&&o2.push(239,191,189),a=n3;continue}n3=(a-55296<<10|n3-56320)+65536}else a&&-1<(t4-=3)&&o2.push(239,191,189);if(a=null,128>n3){if(0>(t4-=1))break;o2.push(n3)}else if(2048>n3){if(0>(t4-=2))break;o2.push(192|n3>>6,128|63&n3)}else if(65536>n3){if(0>(t4-=3))break;o2.push(224|n3>>12,128|63&n3>>6,128|63&n3)}else if(1114112>n3){if(0>(t4-=4))break;o2.push(240|n3>>18,128|63&n3>>12,128|63&n3>>6,128|63&n3)}else throw new Error("Invalid code point")}return o2}function Y(e2){for(var t4=[],n3=0;n3(t4-=2));++d2)n3=e2.charCodeAt(d2),r2=n3>>8,a=n3%256,o2.push(a),o2.push(r2);return o2}function z(e2){return $.toByteArray(q(e2))}function G(e2,t4,n3,r2){for(var a=0;a=t4.length||a>=e2.length);++a)t4[a+n3]=e2[a];return a}function K(e2,t4){return e2 instanceof t4||e2!=null&&e2.constructor!=null&&e2.constructor.name!=null&&e2.constructor.name===t4.name}function X(e2){return e2!==e2}var $=e("base64-js"),J=e("ieee754");n2.Buffer=s,n2.SlowBuffer=function(e2){return+e2!=e2&&(e2=0),s.alloc(+e2)},n2.INSPECT_MAX_BYTES=50,n2.kMaxLength=2147483647,s.TYPED_ARRAY_SUPPORT=function(){try{var e2=new Uint8Array(1);return e2.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},e2.foo()===42}catch{return!1}}(),s.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){return s.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){return s.isBuffer(this)?this.byteOffset:void 0}}),typeof Symbol<"u"&&Symbol.species!=null&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),s.poolSize=8192,s.from=function(e2,t4,n3){return l(e2,t4,n3)},s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,s.alloc=function(e2,t4,n3){return u(e2,t4,n3)},s.allocUnsafe=function(e2){return p(e2)},s.allocUnsafeSlow=function(e2){return p(e2)},s.isBuffer=function(e2){return e2!=null&&e2._isBuffer===!0&&e2!==s.prototype},s.compare=function(e2,t4){if(K(e2,Uint8Array)&&(e2=s.from(e2,e2.offset,e2.byteLength)),K(t4,Uint8Array)&&(t4=s.from(t4,t4.offset,t4.byteLength)),!s.isBuffer(e2)||!s.isBuffer(t4))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e2===t4)return 0;for(var n3=e2.length,r2=t4.length,d2=0,l2=o(n3,r2);d2t4&&(e2+=" ... "),""},s.prototype.compare=function(e2,t4,n3,r2,a){if(K(e2,Uint8Array)&&(e2=s.from(e2,e2.offset,e2.byteLength)),!s.isBuffer(e2))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e2);if(t4===void 0&&(t4=0),n3===void 0&&(n3=e2?e2.length:0),r2===void 0&&(r2=0),a===void 0&&(a=this.length),0>t4||n3>e2.length||0>r2||a>this.length)throw new RangeError("out of range index");if(r2>=a&&t4>=n3)return 0;if(r2>=a)return-1;if(t4>=n3)return 1;if(t4>>>=0,n3>>>=0,r2>>>=0,a>>>=0,this===e2)return 0;for(var d2=a-r2,l2=n3-t4,c2=o(d2,l2),u2=this.slice(r2,a),p2=e2.slice(t4,n3),f2=0;f2>>=0,isFinite(n3)?(n3>>>=0,r2===void 0&&(r2="utf8")):(r2=n3,n3=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-t4;if((n3===void 0||n3>a)&&(n3=a),0n3||0>t4)||t4>this.length)throw new RangeError("Attempt to write outside buffer bounds");r2||(r2="utf8");for(var o2=!1;;)switch(r2){case"hex":return w(this,e2,t4,n3);case"utf8":case"utf-8":return S(this,e2,t4,n3);case"ascii":return T(this,e2,t4,n3);case"latin1":case"binary":return v(this,e2,t4,n3);case"base64":return k(this,e2,t4,n3);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e2,t4,n3);default:if(o2)throw new TypeError("Unknown encoding: "+r2);r2=(""+r2).toLowerCase(),o2=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(e2,t4){var n3=this.length;e2=~~e2,t4=t4===void 0?n3:~~t4,0>e2?(e2+=n3,0>e2&&(e2=0)):e2>n3&&(e2=n3),0>t4?(t4+=n3,0>t4&&(t4=0)):t4>n3&&(t4=n3),t4>>=0,t4>>>=0,n3||O(e2,t4,this.length);for(var r2=this[e2],a=1,o2=0;++o2>>=0,t4>>>=0,n3||O(e2,t4,this.length);for(var r2=this[e2+--t4],a=1;0>>=0,t4||O(e2,1,this.length),this[e2]},s.prototype.readUInt16LE=function(e2,t4){return e2>>>=0,t4||O(e2,2,this.length),this[e2]|this[e2+1]<<8},s.prototype.readUInt16BE=function(e2,t4){return e2>>>=0,t4||O(e2,2,this.length),this[e2]<<8|this[e2+1]},s.prototype.readUInt32LE=function(e2,t4){return e2>>>=0,t4||O(e2,4,this.length),(this[e2]|this[e2+1]<<8|this[e2+2]<<16)+16777216*this[e2+3]},s.prototype.readUInt32BE=function(e2,t4){return e2>>>=0,t4||O(e2,4,this.length),16777216*this[e2]+(this[e2+1]<<16|this[e2+2]<<8|this[e2+3])},s.prototype.readIntLE=function(e2,t4,n3){e2>>>=0,t4>>>=0,n3||O(e2,t4,this.length);for(var a=this[e2],o2=1,d2=0;++d2=o2&&(a-=r(2,8*t4)),a},s.prototype.readIntBE=function(e2,t4,n3){e2>>>=0,t4>>>=0,n3||O(e2,t4,this.length);for(var a=t4,o2=1,d2=this[e2+--a];0=o2&&(d2-=r(2,8*t4)),d2},s.prototype.readInt8=function(e2,t4){return e2>>>=0,t4||O(e2,1,this.length),128&this[e2]?-1*(255-this[e2]+1):this[e2]},s.prototype.readInt16LE=function(e2,t4){e2>>>=0,t4||O(e2,2,this.length);var n3=this[e2]|this[e2+1]<<8;return 32768&n3?4294901760|n3:n3},s.prototype.readInt16BE=function(e2,t4){e2>>>=0,t4||O(e2,2,this.length);var n3=this[e2+1]|this[e2]<<8;return 32768&n3?4294901760|n3:n3},s.prototype.readInt32LE=function(e2,t4){return e2>>>=0,t4||O(e2,4,this.length),this[e2]|this[e2+1]<<8|this[e2+2]<<16|this[e2+3]<<24},s.prototype.readInt32BE=function(e2,t4){return e2>>>=0,t4||O(e2,4,this.length),this[e2]<<24|this[e2+1]<<16|this[e2+2]<<8|this[e2+3]},s.prototype.readFloatLE=function(e2,t4){return e2>>>=0,t4||O(e2,4,this.length),J.read(this,e2,!0,23,4)},s.prototype.readFloatBE=function(e2,t4){return e2>>>=0,t4||O(e2,4,this.length),J.read(this,e2,!1,23,4)},s.prototype.readDoubleLE=function(e2,t4){return e2>>>=0,t4||O(e2,8,this.length),J.read(this,e2,!0,52,8)},s.prototype.readDoubleBE=function(e2,t4){return e2>>>=0,t4||O(e2,8,this.length),J.read(this,e2,!1,52,8)},s.prototype.writeUIntLE=function(e2,t4,n3,a){if(e2=+e2,t4>>>=0,n3>>>=0,!a){var o2=r(2,8*n3)-1;F(this,e2,t4,n3,o2,0)}var d2=1,s2=0;for(this[t4]=255&e2;++s2>>=0,n3>>>=0,!a){var o2=r(2,8*n3)-1;F(this,e2,t4,n3,o2,0)}var d2=n3-1,s2=1;for(this[t4+d2]=255&e2;0<=--d2&&(s2*=256);)this[t4+d2]=255&e2/s2;return t4+n3},s.prototype.writeUInt8=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,1,255,0),this[t4]=255&e2,t4+1},s.prototype.writeUInt16LE=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,2,65535,0),this[t4]=255&e2,this[t4+1]=e2>>>8,t4+2},s.prototype.writeUInt16BE=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,2,65535,0),this[t4]=e2>>>8,this[t4+1]=255&e2,t4+2},s.prototype.writeUInt32LE=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,4,4294967295,0),this[t4+3]=e2>>>24,this[t4+2]=e2>>>16,this[t4+1]=e2>>>8,this[t4]=255&e2,t4+4},s.prototype.writeUInt32BE=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,4,4294967295,0),this[t4]=e2>>>24,this[t4+1]=e2>>>16,this[t4+2]=e2>>>8,this[t4+3]=255&e2,t4+4},s.prototype.writeIntLE=function(e2,t4,n3,a){if(e2=+e2,t4>>>=0,!a){var o2=r(2,8*n3-1);F(this,e2,t4,n3,o2-1,-o2)}var d2=0,s2=1,l2=0;for(this[t4]=255&e2;++d2e2&&l2===0&&this[t4+d2-1]!==0&&(l2=1),this[t4+d2]=255&(e2/s2>>0)-l2;return t4+n3},s.prototype.writeIntBE=function(e2,t4,n3,a){if(e2=+e2,t4>>>=0,!a){var o2=r(2,8*n3-1);F(this,e2,t4,n3,o2-1,-o2)}var d2=n3-1,s2=1,l2=0;for(this[t4+d2]=255&e2;0<=--d2&&(s2*=256);)0>e2&&l2===0&&this[t4+d2+1]!==0&&(l2=1),this[t4+d2]=255&(e2/s2>>0)-l2;return t4+n3},s.prototype.writeInt8=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,1,127,-128),0>e2&&(e2=255+e2+1),this[t4]=255&e2,t4+1},s.prototype.writeInt16LE=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,2,32767,-32768),this[t4]=255&e2,this[t4+1]=e2>>>8,t4+2},s.prototype.writeInt16BE=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,2,32767,-32768),this[t4]=e2>>>8,this[t4+1]=255&e2,t4+2},s.prototype.writeInt32LE=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,4,2147483647,-2147483648),this[t4]=255&e2,this[t4+1]=e2>>>8,this[t4+2]=e2>>>16,this[t4+3]=e2>>>24,t4+4},s.prototype.writeInt32BE=function(e2,t4,n3){return e2=+e2,t4>>>=0,n3||F(this,e2,t4,4,2147483647,-2147483648),0>e2&&(e2=4294967295+e2+1),this[t4]=e2>>>24,this[t4+1]=e2>>>16,this[t4+2]=e2>>>8,this[t4+3]=255&e2,t4+4},s.prototype.writeFloatLE=function(e2,t4,n3){return U(this,e2,t4,!0,n3)},s.prototype.writeFloatBE=function(e2,t4,n3){return U(this,e2,t4,!1,n3)},s.prototype.writeDoubleLE=function(e2,t4,n3){return j(this,e2,t4,!0,n3)},s.prototype.writeDoubleBE=function(e2,t4,n3){return j(this,e2,t4,!1,n3)},s.prototype.copy=function(e2,t4,n3,r2){if(!s.isBuffer(e2))throw new TypeError("argument should be a Buffer");if(n3||(n3=0),r2||r2===0||(r2=this.length),t4>=e2.length&&(t4=e2.length),t4||(t4=0),0t4)throw new RangeError("targetStart out of bounds");if(0>n3||n3>=this.length)throw new RangeError("Index out of range");if(0>r2)throw new RangeError("sourceEnd out of bounds");r2>this.length&&(r2=this.length),e2.length-t4a||r2==="latin1")&&(e2=a)}}else typeof e2=="number"&&(e2&=255);if(0>t4||this.length>>=0,n3=n3===void 0?this.length:n3>>>0,e2||(e2=0);var o2;if(typeof e2=="number")for(o2=t4;o2{e3==="%%"||(r3++,e3==="%c"&&(a2=r3))}),e2.splice(a2,0,n3)},n2.save=function(e2){try{e2?n2.storage.setItem("debug",e2):n2.storage.removeItem("debug")}catch{}},n2.load=r2,n2.useColors=function(){return!!(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))||!(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&(typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},n2.storage=function(){try{return localStorage}catch{}}(),n2.destroy=(()=>{let e2=!1;return()=>{e2||(e2=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n2.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],n2.log=console.debug||console.log||(()=>{}),t2.exports=e("./common")(n2);let{formatters:o}=t2.exports;o.j=function(e2){try{return JSON.stringify(e2)}catch(e3){return"[UnexpectedJSONParseError]: "+e3.message}}}).call(this)}).call(this,e("_process"))},{"./common":5,_process:12}],5:[function(e,t2){t2.exports=function(t3){function r2(e2){function t4(...e3){if(!t4.enabled)return;let a2=t4,o3=+new Date,i=o3-(n2||o3);a2.diff=i,a2.prev=n2,a2.curr=o3,n2=o3,e3[0]=r2.coerce(e3[0]),typeof e3[0]!="string"&&e3.unshift("%O");let d=0;e3[0]=e3[0].replace(/%([a-zA-Z%])/g,(t5,n3)=>{if(t5==="%%")return"%";d++;let o4=r2.formatters[n3];if(typeof o4=="function"){let n4=e3[d];t5=o4.call(a2,n4),e3.splice(d,1),d--}return t5}),r2.formatArgs.call(a2,e3),(a2.log||r2.log).apply(a2,e3)}let n2,o2=null;return t4.namespace=e2,t4.useColors=r2.useColors(),t4.color=r2.selectColor(e2),t4.extend=a,t4.destroy=r2.destroy,Object.defineProperty(t4,"enabled",{enumerable:!0,configurable:!1,get:()=>o2===null?r2.enabled(e2):o2,set:e3=>{o2=e3}}),typeof r2.init=="function"&&r2.init(t4),t4}function a(e2,t4){let n2=r2(this.namespace+(typeof t4>"u"?":":t4)+e2);return n2.log=this.log,n2}function o(e2){return e2.toString().substring(2,e2.toString().length-2).replace(/\.\*\?$/,"*")}return r2.debug=r2,r2.default=r2,r2.coerce=function(e2){return e2 instanceof Error?e2.stack||e2.message:e2},r2.disable=function(){let e2=[...r2.names.map(o),...r2.skips.map(o).map(e3=>"-"+e3)].join(",");return r2.enable(""),e2},r2.enable=function(e2){r2.save(e2),r2.names=[],r2.skips=[];let t4,n2=(typeof e2=="string"?e2:"").split(/[\s,]+/),a2=n2.length;for(t4=0;t4{r2[e2]=t3[e2]}),r2.names=[],r2.skips=[],r2.formatters={},r2.selectColor=function(e2){let t4=0;for(let n2=0;n2d2&&!l2.warned){l2.warned=!0;var c2=new Error("Possible EventEmitter memory leak detected. "+l2.length+" "+(t3+" listeners added. Use emitter.setMaxListeners() to increase limit"));c2.name="MaxListenersExceededWarning",c2.emitter=e2,c2.type=t3,c2.count=l2.length,n2(c2)}return e2}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function s(e2,t3,n3){var r3={fired:!1,wrapFn:void 0,target:e2,type:t3,listener:n3},a2=d.bind(r3);return a2.listener=n3,r3.wrapFn=a2,a2}function l(e2,t3,n3){var r3=e2._events;if(r3===void 0)return[];var a2=r3[t3];return a2===void 0?[]:typeof a2=="function"?n3?[a2.listener||a2]:[a2]:n3?f(a2):u(a2,a2.length)}function c(e2){var t3=this._events;if(t3!==void 0){var n3=t3[e2];if(typeof n3=="function")return 1;if(n3!==void 0)return n3.length}return 0}function u(e2,t3){for(var n3=Array(t3),r3=0;r3e2||y(e2))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e2+".");C=e2}}),r2.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r2.prototype.setMaxListeners=function(e2){if(typeof e2!="number"||0>e2||y(e2))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e2+".");return this._maxListeners=e2,this},r2.prototype.getMaxListeners=function(){return o(this)},r2.prototype.emit=function(e2){for(var t3=[],n3=1;n3o2)return this;o2===0?n3.shift():p(n3,o2),n3.length===1&&(r3[e2]=n3[0]),r3.removeListener!==void 0&&this.emit("removeListener",e2,s2||t3)}return this},r2.prototype.off=r2.prototype.removeListener,r2.prototype.removeAllListeners=function(e2){var t3,n3,r3;if(n3=this._events,n3===void 0)return this;if(n3.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n3[e2]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete n3[e2]),this;if(arguments.length===0){var a2,o2=Object.keys(n3);for(r3=0;r3"u")return null;var e2={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return e2.RTCPeerConnection?e2:null}},{}],9:[function(e,a,o){o.read=function(t2,n2,a2,o2,l){var c,u,p=8*l-o2-1,f=(1<>1,_=-7,h=a2?l-1:0,b=a2?-1:1,d=t2[n2+h];for(h+=b,c=d&(1<<-_)-1,d>>=-_,_+=p;0<_;c=256*c+t2[n2+h],h+=b,_-=8);for(u=c&(1<<-_)-1,c>>=-_,_+=o2;0<_;u=256*u+t2[n2+h],h+=b,_-=8);if(c===0)c=1-g;else{if(c===f)return u?NaN:(d?-1:1)*(1/0);u+=r(2,o2),c-=g}return(d?-1:1)*u*r(2,c-o2)},o.write=function(a2,o2,l,u,p,f){var h,b,y,g=Math.LN2,_=Math.log,C=8*f-p-1,R=(1<>1,w=p===23?r(2,-24)-r(2,-77):0,S=u?0:f-1,T=u?1:-1,d=0>o2||o2===0&&0>1/o2?1:0;for(o2=n(o2),isNaN(o2)||o2===1/0?(b=isNaN(o2)?1:0,h=R):(h=t(_(o2)/g),1>o2*(y=r(2,-h))&&(h--,y*=2),o2+=1<=h+E?w/y:w*r(2,1-E),2<=o2*y&&(h++,y/=2),h+E>=R?(b=0,h=R):1<=h+E?(b=(o2*y-1)*r(2,p),h+=E):(b=o2*r(2,E-1)*r(2,p),h=0));8<=p;a2[l+S]=255&b,S+=T,b/=256,p-=8);for(h=h<=1.5*a2?"s":"")}var l=24*(60*6e4);t2.exports=function(e2,t3){t3=t3||{};var n2=typeof e2;if(n2=="string"&&0"u"?e2:window):e3=>(n2||(n2=Promise.resolve())).then(e3).catch(e4=>setTimeout(()=>{throw e4},0))}).call(this)}).call(this,typeof global>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:global)},{}],14:[function(e,t2){(function(n2,r2){(function(){"use strict";var a=e("safe-buffer").Buffer,o=r2.crypto||r2.msCrypto;t2.exports=o&&o.getRandomValues?function(e2,t3){if(e2>4294967295)throw new RangeError("requested too many random bytes");var r3=a.allocUnsafe(e2);if(0"u"?typeof self>"u"?typeof window>"u"?{}:window:self:global)},{_process:12,"safe-buffer":30}],15:[function(e,t2){"use strict";function n2(e2,t3){e2.prototype=Object.create(t3.prototype),e2.prototype.constructor=e2,e2.__proto__=t3}function r2(e2,t3,r3){function a2(e3,n3,r4){return typeof t3=="string"?t3:t3(e3,n3,r4)}r3||(r3=Error);var o2=function(e3){function t4(t5,n3,r4){return e3.call(this,a2(t5,n3,r4))||this}return n2(t4,e3),t4}(r3);o2.prototype.name=r3.name,o2.prototype.code=e2,s[e2]=o2}function a(e2,t3){if(Array.isArray(e2)){var n3=e2.length;return e2=e2.map(function(e3){return e3+""}),2n3?0:+n3,t3.length)===t3}function i(e2,t3,n3){return(n3===void 0||n3>e2.length)&&(n3=e2.length),e2.substring(n3-t3.length,n3)===t3}function d(e2,t3,n3){return typeof n3!="number"&&(n3=0),!(n3+t3.length>e2.length)&&e2.indexOf(t3,n3)!==-1}var s={};r2("ERR_INVALID_OPT_VALUE",function(e2,t3){return'The value "'+t3+'" is invalid for option "'+e2+'"'},TypeError),r2("ERR_INVALID_ARG_TYPE",function(e2,t3,n3){var r3;typeof t3=="string"&&o(t3,"not ")?(r3="must not be",t3=t3.replace(/^not /,"")):r3="must be";var s2;if(i(e2," argument"))s2="The ".concat(e2," ").concat(r3," ").concat(a(t3,"type"));else{var l=d(e2,".")?"property":"argument";s2='The "'.concat(e2,'" ').concat(l," ").concat(r3," ").concat(a(t3,"type"))}return s2+=". Received type ".concat(typeof n3),s2},TypeError),r2("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r2("ERR_METHOD_NOT_IMPLEMENTED",function(e2){return"The "+e2+" method is not implemented"}),r2("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r2("ERR_STREAM_DESTROYED",function(e2){return"Cannot call "+e2+" after a stream was destroyed"}),r2("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r2("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r2("ERR_STREAM_WRITE_AFTER_END","write after end"),r2("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r2("ERR_UNKNOWN_ENCODING",function(e2){return"Unknown encoding: "+e2},TypeError),r2("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t2.exports.codes=s},{}],16:[function(e,t2){(function(n2){(function(){"use strict";function r2(e2){return this instanceof r2?(d.call(this,e2),s.call(this,e2),this.allowHalfOpen=!0,void(e2&&(e2.readable===!1&&(this.readable=!1),e2.writable===!1&&(this.writable=!1),e2.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a))))):new r2(e2)}function a(){this._writableState.ended||n2.nextTick(o,this)}function o(e2){e2.end()}var i=Object.keys||function(e2){var t3=[];for(var n3 in e2)t3.push(n3);return t3};t2.exports=r2;var d=e("./_stream_readable"),s=e("./_stream_writable");e("inherits")(r2,d);for(var l,c=i(s.prototype),u=0;u>>1,e2|=e2>>>2,e2|=e2>>>4,e2|=e2>>>8,e2|=e2>>>16,e2++),e2}function f(e2,t3){return 0>=e2||t3.length===0&&t3.ended?0:t3.objectMode?1:e2===e2?(e2>t3.highWaterMark&&(t3.highWaterMark=p(e2)),e2<=t3.length?e2:t3.ended?t3.length:(t3.needReadable=!0,0)):t3.flowing&&t3.length?t3.buffer.head.data.length:t3.length}function g(e2,t3){if(x("onEofChunk"),!t3.ended){if(t3.decoder){var n3=t3.decoder.end();n3&&n3.length&&(t3.buffer.push(n3),t3.length+=t3.objectMode?1:n3.length)}t3.ended=!0,t3.sync?_(e2):(t3.needReadable=!1,!t3.emittedReadable&&(t3.emittedReadable=!0,h(e2)))}}function _(e2){var t3=e2._readableState;x("emitReadable",t3.needReadable,t3.emittedReadable),t3.needReadable=!1,t3.emittedReadable||(x("emitReadable",t3.flowing),t3.emittedReadable=!0,n2.nextTick(h,e2))}function h(e2){var t3=e2._readableState;x("emitReadable_",t3.destroyed,t3.length,t3.ended),!t3.destroyed&&(t3.length||t3.ended)&&(e2.emit("readable"),t3.emittedReadable=!1),t3.needReadable=!t3.flowing&&!t3.ended&&t3.length<=t3.highWaterMark,S(e2)}function m(e2,t3){t3.readingMore||(t3.readingMore=!0,n2.nextTick(b,e2,t3))}function b(e2,t3){for(;!t3.reading&&!t3.ended&&(t3.length=t3.length?(n3=t3.decoder?t3.buffer.join(""):t3.buffer.length===1?t3.buffer.first():t3.buffer.concat(t3.length),t3.buffer.clear()):n3=t3.buffer.consume(e2,t3.decoder),n3}function v(e2){var t3=e2._readableState;x("endReadable",t3.endEmitted),t3.endEmitted||(t3.ended=!0,n2.nextTick(k,t3,e2))}function k(e2,t3){if(x("endReadableNT",e2.endEmitted,e2.length),!e2.endEmitted&&e2.length===0&&(e2.endEmitted=!0,t3.readable=!1,t3.emit("end"),e2.autoDestroy)){var n3=t3._writableState;(!n3||n3.autoDestroy&&n3.finished)&&t3.destroy()}}function L(e2,t3){for(var n3=0,r3=e2.length;n3=t3.highWaterMark)||t3.ended))return x("read: emitReadable",t3.length,t3.ended),t3.length===0&&t3.ended?v(this):_(this),null;if(e2=f(e2,t3),e2===0&&t3.ended)return t3.length===0&&v(this),null;var a2=t3.needReadable;x("need readable",a2),(t3.length===0||t3.length-e2"u"?typeof self>"u"?typeof window>"u"?{}:window:self:global)},{"../errors":15,"./_stream_duplex":16,"./internal/streams/async_iterator":21,"./internal/streams/buffer_list":22,"./internal/streams/destroy":23,"./internal/streams/from":25,"./internal/streams/state":27,"./internal/streams/stream":28,_process:12,buffer:3,events:7,inherits:10,"string_decoder/":31,util:2}],19:[function(e,t2){"use strict";function n2(e2,t3){var n3=this._transformState;n3.transforming=!1;var r3=n3.writecb;if(r3===null)return this.emit("error",new s);n3.writechunk=null,n3.writecb=null,t3!=null&&this.push(t3),r3(e2);var a2=this._readableState;a2.reading=!1,(a2.needReadable||a2.length"u"?typeof self>"u"?typeof window>"u"?{}:window:self:global)},{"../errors":15,"./_stream_duplex":16,"./internal/streams/destroy":23,"./internal/streams/state":27,"./internal/streams/stream":28,_process:12,buffer:3,inherits:10,"util-deprecate":32}],21:[function(e,t2){(function(n2){(function(){"use strict";function r2(e2,t3,n3){return t3 in e2?Object.defineProperty(e2,t3,{value:n3,enumerable:!0,configurable:!0,writable:!0}):e2[t3]=n3,e2}function a(e2,t3){return{value:e2,done:t3}}function o(e2){var t3=e2[c];if(t3!==null){var n3=e2[h].read();n3!==null&&(e2[g]=null,e2[c]=null,e2[u]=null,t3(a(n3,!1)))}}function i(e2){n2.nextTick(o,e2)}function d(e2,t3){return function(n3,r3){e2.then(function(){return t3[f]?void n3(a(void 0,!0)):void t3[_](n3,r3)},r3)}}var s,l=e("./end-of-stream"),c=Symbol("lastResolve"),u=Symbol("lastReject"),p=Symbol("error"),f=Symbol("ended"),g=Symbol("lastPromise"),_=Symbol("handlePromise"),h=Symbol("stream"),m=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((s={get stream(){return this[h]},next:function(){var e2=this,t3=this[p];if(t3!==null)return Promise.reject(t3);if(this[f])return Promise.resolve(a(void 0,!0));if(this[h].destroyed)return new Promise(function(t4,r4){n2.nextTick(function(){e2[p]?r4(e2[p]):t4(a(void 0,!0))})});var r3,o2=this[g];if(o2)r3=new Promise(d(o2,this));else{var i2=this[h].read();if(i2!==null)return Promise.resolve(a(i2,!1));r3=new Promise(this[_])}return this[g]=r3,r3}},r2(s,Symbol.asyncIterator,function(){return this}),r2(s,"return",function(){var e2=this;return new Promise(function(t3,n3){e2[h].destroy(null,function(e3){return e3?void n3(e3):void t3(a(void 0,!0))})})}),s),m);t2.exports=function(e2){var t3,n3=Object.create(b,(t3={},r2(t3,h,{value:e2,writable:!0}),r2(t3,c,{value:null,writable:!0}),r2(t3,u,{value:null,writable:!0}),r2(t3,p,{value:null,writable:!0}),r2(t3,f,{value:e2._readableState.endEmitted,writable:!0}),r2(t3,_,{value:function(e3,t4){var r3=n3[h].read();r3?(n3[g]=null,n3[c]=null,n3[u]=null,e3(a(r3,!1))):(n3[c]=e3,n3[u]=t4)},writable:!0}),t3));return n3[g]=null,l(e2,function(e3){if(e3&&e3.code!=="ERR_STREAM_PREMATURE_CLOSE"){var t4=n3[u];return t4!==null&&(n3[g]=null,n3[c]=null,n3[u]=null,t4(e3)),void(n3[p]=e3)}var r3=n3[c];r3!==null&&(n3[g]=null,n3[c]=null,n3[u]=null,r3(a(void 0,!0))),n3[f]=!0}),e2.on("readable",i.bind(null,n3)),n3}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":24,_process:12}],22:[function(e,t2){"use strict";function n2(e2,t3){var n3=Object.keys(e2);if(Object.getOwnPropertySymbols){var r3=Object.getOwnPropertySymbols(e2);t3&&(r3=r3.filter(function(t4){return Object.getOwnPropertyDescriptor(e2,t4).enumerable})),n3.push.apply(n3,r3)}return n3}function r2(e2){for(var t3,r3=1;r3>>0),n3=this.head,r3=0;n3;)s(n3.data,t3,r3),r3+=n3.data.length,n3=n3.next;return t3}},{key:"consume",value:function(e3,t3){var n3;return e3o2.length?o2.length:e3;if(a2+=i2===o2.length?o2:o2.slice(0,e3),e3-=i2,e3===0){i2===o2.length?(++r3,this.head=t3.next?t3.next:this.tail=null):(this.head=t3,t3.data=o2.slice(i2));break}++r3}return this.length-=r3,a2}},{key:"_getBuffer",value:function(e3){var t3=u.allocUnsafe(e3),r3=this.head,a2=1;for(r3.data.copy(t3),e3-=r3.data.length;r3=r3.next;){var o2=r3.data,i2=e3>o2.length?o2.length:e3;if(o2.copy(t3,t3.length-e3,0,i2),e3-=i2,e3===0){i2===o2.length?(++a2,this.head=r3.next?r3.next:this.tail=null):(this.head=r3,r3.data=o2.slice(i2));break}++a2}return this.length-=a2,t3}},{key:g,value:function(e3,t3){return f(this,r2({},t3,{depth:0,customInspect:!1}))}}]),e2}()},{buffer:3,util:2}],23:[function(e,t2){(function(e2){(function(){"use strict";function n2(e3,t3){a(e3,t3),r2(e3)}function r2(e3){e3._writableState&&!e3._writableState.emitClose||e3._readableState&&!e3._readableState.emitClose||e3.emit("close")}function a(e3,t3){e3.emit("error",t3)}t2.exports={destroy:function(t3,o){var i=this,d=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return d||s?(o?o(t3):t3&&(this._writableState?!this._writableState.errorEmitted&&(this._writableState.errorEmitted=!0,e2.nextTick(a,this,t3)):e2.nextTick(a,this,t3)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t3||null,function(t4){!o&&t4?i._writableState?i._writableState.errorEmitted?e2.nextTick(r2,i):(i._writableState.errorEmitted=!0,e2.nextTick(n2,i,t4)):e2.nextTick(n2,i,t4):o?(e2.nextTick(r2,i),o(t4)):e2.nextTick(r2,i)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e3,t3){var n3=e3._readableState,r3=e3._writableState;n3&&n3.autoDestroy||r3&&r3.autoDestroy?e3.destroy(t3):e3.emit("error",t3)}}}).call(this)}).call(this,e("_process"))},{_process:12}],24:[function(e,t2){"use strict";function n2(e2){var t3=!1;return function(){if(!t3){t3=!0;for(var n3=arguments.length,r3=Array(n3),a2=0;a2t3.length)throw new u("streams");var a2,l2=t3.map(function(e3,n4){var d2=n4d){var s=i?o:"highWaterMark";throw new a(s,d)}return t(d)}return e2.objectMode?16:16384}}},{"../../../errors":15}],28:[function(e,t2){t2.exports=e("events").EventEmitter},{events:7}],29:[function(e,t2,n2){n2=t2.exports=e("./lib/_stream_readable.js"),n2.Stream=n2,n2.Readable=n2,n2.Writable=e("./lib/_stream_writable.js"),n2.Duplex=e("./lib/_stream_duplex.js"),n2.Transform=e("./lib/_stream_transform.js"),n2.PassThrough=e("./lib/_stream_passthrough.js"),n2.finished=e("./lib/internal/streams/end-of-stream.js"),n2.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":16,"./lib/_stream_passthrough.js":17,"./lib/_stream_readable.js":18,"./lib/_stream_transform.js":19,"./lib/_stream_writable.js":20,"./lib/internal/streams/end-of-stream.js":24,"./lib/internal/streams/pipeline.js":26}],30:[function(e,t2,n2){function r2(e2,t3){for(var n3 in e2)t3[n3]=e2[n3]}function a(e2,t3,n3){return i(e2,t3,n3)}var o=e("buffer"),i=o.Buffer;i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t2.exports=o:(r2(o,n2),n2.Buffer=a),a.prototype=Object.create(i.prototype),r2(i,a),a.from=function(e2,t3,n3){if(typeof e2=="number")throw new TypeError("Argument must not be a number");return i(e2,t3,n3)},a.alloc=function(e2,t3,n3){if(typeof e2!="number")throw new TypeError("Argument must be a number");var r3=i(e2);return t3===void 0?r3.fill(0):typeof n3=="string"?r3.fill(t3,n3):r3.fill(t3),r3},a.allocUnsafe=function(e2){if(typeof e2!="number")throw new TypeError("Argument must be a number");return i(e2)},a.allocUnsafeSlow=function(e2){if(typeof e2!="number")throw new TypeError("Argument must be a number");return o.SlowBuffer(e2)}},{buffer:3}],31:[function(e,t2,n2){"use strict";function r2(e2){if(!e2)return"utf8";for(var t3;;)switch(e2){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e2;default:if(t3)return;e2=(""+e2).toLowerCase(),t3=!0}}function a(e2){var t3=r2(e2);if(typeof t3!="string"&&(m.isEncoding===b||!b(e2)))throw new Error("Unknown encoding: "+e2);return t3||e2}function o(e2){this.encoding=a(e2);var t3;switch(this.encoding){case"utf16le":this.text=u,this.end=p,t3=4;break;case"utf8":this.fillLast=c,t3=4;break;case"base64":this.text=f,this.end=g,t3=3;break;default:return this.write=_,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=m.allocUnsafe(t3)}function d(e2){return 127>=e2?0:e2>>5==6?2:e2>>4==14?3:e2>>3==30?4:e2>>6==2?-1:-2}function s(e2,t3,n3){var r3=t3.length-1;if(r3=r3)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e2[e2.length-2],this.lastChar[1]=e2[e2.length-1],n3.slice(0,-1)}return n3}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e2[e2.length-1],e2.toString("utf16le",t3,e2.length-1)}function p(e2){var t3=e2&&e2.length?this.write(e2):"";if(this.lastNeed){var n3=this.lastTotal-this.lastNeed;return t3+this.lastChar.toString("utf16le",0,n3)}return t3}function f(e2,t3){var r3=(e2.length-t3)%3;return r3==0?e2.toString("base64",t3):(this.lastNeed=3-r3,this.lastTotal=3,r3==1?this.lastChar[0]=e2[e2.length-1]:(this.lastChar[0]=e2[e2.length-2],this.lastChar[1]=e2[e2.length-1]),e2.toString("base64",t3,e2.length-r3))}function g(e2){var t3=e2&&e2.length?this.write(e2):"";return this.lastNeed?t3+this.lastChar.toString("base64",0,3-this.lastNeed):t3}function _(e2){return e2.toString(this.encoding)}function h(e2){return e2&&e2.length?this.write(e2):""}var m=e("safe-buffer").Buffer,b=m.isEncoding||function(e2){switch(e2=""+e2,e2&&e2.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};n2.StringDecoder=o,o.prototype.write=function(e2){if(e2.length===0)return"";var t3,n3;if(this.lastNeed){if(t3=this.fillLast(e2),t3===void 0)return"";n3=this.lastNeed,this.lastNeed=0}else n3=0;return n3"u"?typeof self>"u"?typeof window>"u"?{}:window:self:global)},{}],"/":[function(e,t2){function n2(e2){return e2.replace(/a=ice-options:trickle\s\n/g,"")}function r2(e2){console.warn(e2)}let a=e("debug")("simple-peer"),o=e("get-browser-rtc"),i=e("randombytes"),d=e("readable-stream"),s=e("queue-microtask"),l=e("err-code"),{Buffer:c}=e("buffer"),u=65536;class p extends d.Duplex{constructor(e2){if(e2=Object.assign({allowHalfOpen:!1},e2),super(e2),this._id=i(4).toString("hex").slice(0,7),this._debug("new peer %o",e2),this.channelName=e2.initiator?e2.channelName||i(20).toString("hex"):null,this.initiator=e2.initiator||!1,this.channelConfig=e2.channelConfig||p.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},p.config,e2.config),this.offerOptions=e2.offerOptions||{},this.answerOptions=e2.answerOptions||{},this.sdpTransform=e2.sdpTransform||(e3=>e3),this.streams=e2.streams||(e2.stream?[e2.stream]:[]),this.trickle=e2.trickle===void 0||e2.trickle,this.allowHalfTrickle=e2.allowHalfTrickle!==void 0&&e2.allowHalfTrickle,this.iceCompleteTimeout=e2.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e2.wrtc&&typeof e2.wrtc=="object"?e2.wrtc:o(),!this._wrtc)throw l(typeof window>"u"?new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"):new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e3){return void this.destroy(l(e3,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc=typeof this._pc._peerConnectionId=="number",this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e3=>{this._onIceCandidate(e3)},typeof this._pc.peerIdentity=="object"&&this._pc.peerIdentity.catch(e3=>{this.destroy(l(e3,"ERR_PC_PEER_IDENTITY"))}),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e3=>{this._setupData(e3)},this.streams&&this.streams.forEach(e3=>{this.addStream(e3)}),this._pc.ontrack=e3=>{this._onTrack(e3)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&this._channel.readyState==="open"}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e2){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if(typeof e2=="string")try{e2=JSON.parse(e2)}catch{e2={}}this._debug("signal()"),e2.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e2.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e2.transceiverRequest.kind,e2.transceiverRequest.init)),e2.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e2.candidate):this._pendingCandidates.push(e2.candidate)),e2.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e2)).then(()=>{this.destroyed||(this._pendingCandidates.forEach(e3=>{this._addIceCandidate(e3)}),this._pendingCandidates=[],this._pc.remoteDescription.type==="offer"&&this._createAnswer())}).catch(e3=>{this.destroy(l(e3,"ERR_SET_REMOTE_DESCRIPTION"))}),e2.sdp||e2.candidate||e2.renegotiate||e2.transceiverRequest||this.destroy(l(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(e2){let t3=new this._wrtc.RTCIceCandidate(e2);this._pc.addIceCandidate(t3).catch(e3=>{!t3.address||t3.address.endsWith(".local")?r2("Ignoring unsupported ICE candidate."):this.destroy(l(e3,"ERR_ADD_ICE_CANDIDATE"))})}send(e2){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(e2)}}addTransceiver(e2,t3){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e2,t3),this._needsNegotiation()}catch(e3){this.destroy(l(e3,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:e2,init:t3}})}}addStream(e2){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),e2.getTracks().forEach(t3=>{this.addTrack(t3,e2)})}}addTrack(e2,t3){if(this.destroying)return;if(this.destroyed)throw l(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");let n3=this._senderMap.get(e2)||new Map,r3=n3.get(t3);if(!r3)r3=this._pc.addTrack(e2,t3),n3.set(t3,r3),this._senderMap.set(e2,n3),this._needsNegotiation();else throw r3.removed?l(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):l(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED")}replaceTrack(e2,t3,n3){if(this.destroying)return;if(this.destroyed)throw l(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");let r3=this._senderMap.get(e2),a2=r3?r3.get(n3):null;if(!a2)throw l(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");t3&&this._senderMap.set(t3,r3),a2.replaceTrack==null?this.destroy(l(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK")):a2.replaceTrack(t3)}removeTrack(e2,t3){if(this.destroying)return;if(this.destroyed)throw l(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");let n3=this._senderMap.get(e2),r3=n3?n3.get(t3):null;if(!r3)throw l(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{r3.removed=!0,this._pc.removeTrack(r3)}catch(e3){e3.name==="NS_ERROR_UNEXPECTED"?this._sendersAwaitingStable.push(r3):this.destroy(l(e3,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(e2){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),e2.getTracks().forEach(t3=>{this.removeTrack(t3,e2)})}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,s(()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1}))}negotiate(){if(!this.destroying){if(this.destroyed)throw l(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout(()=>{this._createOffer()},0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(e2){this._destroy(e2,()=>{})}_destroy(e2,t3){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",e2&&(e2.message||e2)),s(()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",e2&&(e2.message||e2)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch{}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch{}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,e2&&this.emit("error",e2),this.emit("close"),t3()}))}_setupData(e2){if(!e2.channel)return this.destroy(l(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=e2.channel,this._channel.binaryType="arraybuffer",typeof this._channel.bufferedAmountLowThreshold=="number"&&(this._channel.bufferedAmountLowThreshold=u),this.channelName=this._channel.label,this._channel.onmessage=e3=>{this._onChannelMessage(e3)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=e3=>{let t4=e3.error instanceof Error?e3.error:new Error(`Datachannel error: ${e3.message} ${e3.filename}:${e3.lineno}:${e3.colno}`);this.destroy(l(t4,"ERR_DATA_CHANNEL"))};let t3=!1;this._closingInterval=setInterval(()=>{this._channel&&this._channel.readyState==="closing"?(t3&&this._onChannelClose(),t3=!0):t3=!1},5e3)}_read(){}_write(e2,t3,n3){if(this.destroyed)return n3(l(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(e2)}catch(e3){return this.destroy(l(e3,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>u?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=n3):n3(null)}else this._debug("write before connect"),this._chunk=e2,this._cb=n3}_onFinish(){if(!this.destroyed){let e2=()=>{setTimeout(()=>this.destroy(),1e3)};this._connected?e2():this.once("connect",e2)}}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout(()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))},this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then(e2=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e2.sdp=n2(e2.sdp)),e2.sdp=this.sdpTransform(e2.sdp);let t3=()=>{if(!this.destroyed){let t4=this._pc.localDescription||e2;this._debug("signal"),this.emit("signal",{type:t4.type,sdp:t4.sdp})}};this._pc.setLocalDescription(e2).then(()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?t3():this.once("_iceComplete",t3))}).catch(e3=>{this.destroy(l(e3,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(e2=>{this.destroy(l(e2,"ERR_CREATE_OFFER"))})}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach(e2=>{e2.mid||!e2.sender.track||e2.requested||(e2.requested=!0,this.addTransceiver(e2.sender.track.kind))})}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then(e2=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e2.sdp=n2(e2.sdp)),e2.sdp=this.sdpTransform(e2.sdp);let t3=()=>{if(!this.destroyed){let t4=this._pc.localDescription||e2;this._debug("signal"),this.emit("signal",{type:t4.type,sdp:t4.sdp}),this.initiator||this._requestMissingTransceivers()}};this._pc.setLocalDescription(e2).then(()=>{this.destroyed||(this.trickle||this._iceComplete?t3():this.once("_iceComplete",t3))}).catch(e3=>{this.destroy(l(e3,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(e2=>{this.destroy(l(e2,"ERR_CREATE_ANSWER"))})}_onConnectionStateChange(){this.destroyed||this._pc.connectionState==="failed"&&this.destroy(l(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;let e2=this._pc.iceConnectionState,t3=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",e2,t3),this.emit("iceStateChange",e2,t3),(e2==="connected"||e2==="completed")&&(this._pcReady=!0,this._maybeReady()),e2==="failed"&&this.destroy(l(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),e2==="closed"&&this.destroy(l(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(e2){let t3=e3=>(Object.prototype.toString.call(e3.values)==="[object Array]"&&e3.values.forEach(t4=>{Object.assign(e3,t4)}),e3);this._pc.getStats.length===0||this._isReactNativeWebrtc?this._pc.getStats().then(n3=>{let r3=[];n3.forEach(e3=>{r3.push(t3(e3))}),e2(null,r3)},t4=>e2(t4)):0{if(this.destroyed)return;let r3=[];n3.result().forEach(e3=>{let n4={};e3.names().forEach(t4=>{n4[t4]=e3.stat(t4)}),n4.id=e3.id,n4.type=e3.type,n4.timestamp=e3.timestamp,r3.push(t3(n4))}),e2(null,r3)},t4=>e2(t4)):e2(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;let e2=()=>{this.destroyed||this.getStats((t3,n3)=>{if(this.destroyed)return;t3&&(n3=[]);let r3={},a2={},o2={},i2=!1;n3.forEach(e3=>{(e3.type==="remotecandidate"||e3.type==="remote-candidate")&&(r3[e3.id]=e3),(e3.type==="localcandidate"||e3.type==="local-candidate")&&(a2[e3.id]=e3),(e3.type==="candidatepair"||e3.type==="candidate-pair")&&(o2[e3.id]=e3)});let d2=e3=>{i2=!0;let t4=a2[e3.localCandidateId];t4&&(t4.ip||t4.address)?(this.localAddress=t4.ip||t4.address,this.localPort=+t4.port):t4&&t4.ipAddress?(this.localAddress=t4.ipAddress,this.localPort=+t4.portNumber):typeof e3.googLocalAddress=="string"&&(t4=e3.googLocalAddress.split(":"),this.localAddress=t4[0],this.localPort=+t4[1]),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let n4=r3[e3.remoteCandidateId];n4&&(n4.ip||n4.address)?(this.remoteAddress=n4.ip||n4.address,this.remotePort=+n4.port):n4&&n4.ipAddress?(this.remoteAddress=n4.ipAddress,this.remotePort=+n4.portNumber):typeof e3.googRemoteAddress=="string"&&(n4=e3.googRemoteAddress.split(":"),this.remoteAddress=n4[0],this.remotePort=+n4[1]),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(n3.forEach(e3=>{e3.type==="transport"&&e3.selectedCandidatePairId&&d2(o2[e3.selectedCandidatePairId]),(e3.type==="googCandidatePair"&&e3.googActiveConnection==="true"||(e3.type==="candidatepair"||e3.type==="candidate-pair")&&e3.selected)&&d2(e3)}),!i2&&(!Object.keys(o2).length||Object.keys(a2).length))return void setTimeout(e2,100);if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(e4){return this.destroy(l(e4,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');let e3=this._cb;this._cb=null,e3(null)}typeof this._channel.bufferedAmountLowThreshold!="number"&&(this._interval=setInterval(()=>this._onInterval(),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")})};e2()}_onInterval(){this._cb&&this._channel&&!(this._channel.bufferedAmount>u)&&this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||(this._pc.signalingState==="stable"&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach(e2=>{this._pc.removeTrack(e2),this._queuedNegotiation=!0}),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(e2){this.destroyed||(e2.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:e2.candidate.candidate,sdpMLineIndex:e2.candidate.sdpMLineIndex,sdpMid:e2.candidate.sdpMid}}):!e2.candidate&&!this._iceComplete&&(this._iceComplete=!0,this.emit("_iceComplete")),e2.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e2){if(this.destroyed)return;let t3=e2.data;t3 instanceof ArrayBuffer&&(t3=c.from(t3)),this.push(t3)}_onChannelBufferedAmountLow(){if(!this.destroyed&&this._cb){this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);let e2=this._cb;this._cb=null,e2(null)}}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(e2){this.destroyed||e2.streams.forEach(t3=>{this._debug("on track"),this.emit("track",e2.track,t3),this._remoteTracks.push({track:e2.track,stream:t3}),this._remoteStreams.some(e3=>e3.id===t3.id)||(this._remoteStreams.push(t3),s(()=>{this._debug("on stream"),this.emit("stream",t3)}))})}_debug(){let e2=[].slice.call(arguments);e2[0]="["+this._id+"] "+e2[0],a.apply(null,e2)}}p.WEBRTC_SUPPORT=!!o(),p.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},p.channelConfig={},t2.exports=p},{buffer:3,debug:4,"err-code":6,"get-browser-rtc":8,"queue-microtask":13,randombytes:14,"readable-stream":29}]},{},[])("/")})}});var messageYjsSyncStep1,messageYjsSyncStep2,messageYjsUpdate,writeSyncStep1,writeSyncStep2,readSyncStep1,readSyncStep2,writeUpdate,readUpdate2,readSyncMessage,init_sync=__esm({"node_modules/y-protocols/sync.js"(){init_encoding();init_decoding();init_yjs();messageYjsSyncStep1=0,messageYjsSyncStep2=1,messageYjsUpdate=2,writeSyncStep1=(encoder,doc2)=>{writeVarUint(encoder,messageYjsSyncStep1);let sv=encodeStateVector(doc2);writeVarUint8Array(encoder,sv)},writeSyncStep2=(encoder,doc2,encodedStateVector)=>{writeVarUint(encoder,messageYjsSyncStep2),writeVarUint8Array(encoder,encodeStateAsUpdate(doc2,encodedStateVector))},readSyncStep1=(decoder,encoder,doc2)=>writeSyncStep2(encoder,doc2,readVarUint8Array(decoder)),readSyncStep2=(decoder,doc2,transactionOrigin)=>{try{applyUpdate(doc2,readVarUint8Array(decoder),transactionOrigin)}catch(error){console.error("Caught error while handling a Yjs update",error)}},writeUpdate=(encoder,update)=>{writeVarUint(encoder,messageYjsUpdate),writeVarUint8Array(encoder,update)},readUpdate2=readSyncStep2,readSyncMessage=(decoder,encoder,doc2,transactionOrigin)=>{let messageType=readVarUint(decoder);switch(messageType){case messageYjsSyncStep1:readSyncStep1(decoder,encoder,doc2);break;case messageYjsSyncStep2:readSyncStep2(decoder,doc2,transactionOrigin);break;case messageYjsUpdate:readUpdate2(decoder,doc2,transactionOrigin);break;default:throw new Error("Unknown message type")}return messageType}}});var deriveKey,encrypt,encryptJson,decrypt,decryptJson,init_crypto=__esm({"node_modules/y-webrtc/src/crypto.js"(){init_encoding();init_decoding();init_promise();init_error();init_string();deriveKey=(secret,roomName)=>{let secretBuffer=encodeUtf8(secret).buffer,salt=encodeUtf8(roomName).buffer;return crypto.subtle.importKey("raw",secretBuffer,"PBKDF2",!1,["deriveKey"]).then(keyMaterial=>crypto.subtle.deriveKey({name:"PBKDF2",salt,iterations:1e5,hash:"SHA-256"},keyMaterial,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]))},encrypt=(data,key)=>{if(!key)return resolve(data);let iv=crypto.getRandomValues(new Uint8Array(12));return crypto.subtle.encrypt({name:"AES-GCM",iv},key,data).then(cipher=>{let encryptedDataEncoder=createEncoder();return writeVarString(encryptedDataEncoder,"AES-GCM"),writeVarUint8Array(encryptedDataEncoder,iv),writeVarUint8Array(encryptedDataEncoder,new Uint8Array(cipher)),toUint8Array(encryptedDataEncoder)})},encryptJson=(data,key)=>{let dataEncoder=createEncoder();return writeAny(dataEncoder,data),encrypt(toUint8Array(dataEncoder),key)},decrypt=(data,key)=>{if(!key)return resolve(data);let dataDecoder=createDecoder(data);readVarString(dataDecoder)!=="AES-GCM"&&reject(create2("Unknown encryption algorithm"));let iv=readVarUint8Array(dataDecoder),cipher=readVarUint8Array(dataDecoder);return crypto.subtle.decrypt({name:"AES-GCM",iv},key,cipher).then(data2=>new Uint8Array(data2))},decryptJson=(data,key)=>decrypt(data,key).then(decryptedValue=>readAny(createDecoder(new Uint8Array(decryptedValue))))}});var y_webrtc_exports={};__export(y_webrtc_exports,{Room:()=>Room,SignalingConn:()=>SignalingConn,WebrtcConn:()=>WebrtcConn,WebrtcProvider:()=>WebrtcProvider});var import_simplepeer_min,log,messageSync,messageQueryAwareness,messageAwareness,messageBcPeerId,signalingConns,rooms,checkIsSynced,readMessage,readPeerMessage,sendWebrtcConn,broadcastWebrtcConn,WebrtcConn,broadcastBcMessage,broadcastRoomMessage,announceSignalingInfo,broadcastBcPeerId,Room,openRoom,publishSignalingMessage,SignalingConn,emitStatus,WebrtcProvider,init_y_webrtc=__esm({"node_modules/y-webrtc/src/y-webrtc.js"(){init_websocket();init_map();init_error();init_random();init_encoding();init_decoding();init_observable();init_logging();init_promise();init_broadcastchannel();init_buffer();init_math();init_mutex();import_simplepeer_min=__toESM(require_simplepeer_min(),1);init_sync();init_awareness();init_crypto();log=createModuleLogger2("y-webrtc"),messageSync=0,messageQueryAwareness=3,messageAwareness=1,messageBcPeerId=4,signalingConns=new Map,rooms=new Map,checkIsSynced=room=>{let synced=!0;room.webrtcConns.forEach(peer=>{peer.synced||(synced=!1)}),(!synced&&room.synced||synced&&!room.synced)&&(room.synced=synced,room.provider.emit("synced",[{synced}]),log("synced ",BOLD,room.name,UNBOLD," with all peers"))},readMessage=(room,buf,syncedCallback)=>{let decoder=createDecoder(buf),encoder=createEncoder(),messageType=readVarUint(decoder);if(room===void 0)return null;let awareness=room.awareness,doc2=room.doc,sendReply=!1;switch(messageType){case messageSync:{writeVarUint(encoder,messageSync);let syncMessageType=readSyncMessage(decoder,encoder,doc2,room);syncMessageType===messageYjsSyncStep2&&!room.synced&&syncedCallback(),syncMessageType===messageYjsSyncStep1&&(sendReply=!0);break}case messageQueryAwareness:writeVarUint(encoder,messageAwareness),writeVarUint8Array(encoder,encodeAwarenessUpdate(awareness,Array.from(awareness.getStates().keys()))),sendReply=!0;break;case messageAwareness:applyAwarenessUpdate(awareness,readVarUint8Array(decoder),room);break;case messageBcPeerId:{let add=readUint8(decoder)===1,peerName=readVarString(decoder);if(peerName!==room.peerId&&(room.bcConns.has(peerName)&&!add||!room.bcConns.has(peerName)&&add)){let removed=[],added=[];add?(room.bcConns.add(peerName),added.push(peerName)):(room.bcConns.delete(peerName),removed.push(peerName)),room.provider.emit("peers",[{added,removed,webrtcPeers:Array.from(room.webrtcConns.keys()),bcPeers:Array.from(room.bcConns)}]),broadcastBcPeerId(room)}break}default:return console.error("Unable to compute message"),encoder}return sendReply?encoder:null},readPeerMessage=(peerConn,buf)=>{let room=peerConn.room;return log("received message from ",BOLD,peerConn.remotePeerId,GREY," (",room.name,")",UNBOLD,UNCOLOR),readMessage(room,buf,()=>{peerConn.synced=!0,log("synced ",BOLD,room.name,UNBOLD," with ",BOLD,peerConn.remotePeerId),checkIsSynced(room)})},sendWebrtcConn=(webrtcConn,encoder)=>{log("send message to ",BOLD,webrtcConn.remotePeerId,UNBOLD,GREY," (",webrtcConn.room.name,")",UNCOLOR);try{webrtcConn.peer.send(toUint8Array(encoder))}catch{}},broadcastWebrtcConn=(room,m)=>{log("broadcast message in ",BOLD,room.name,UNBOLD),room.webrtcConns.forEach(conn=>{try{conn.peer.send(m)}catch{}})},WebrtcConn=class{constructor(signalingConn,initiator,remotePeerId,room){log("establishing connection to ",BOLD,remotePeerId),this.room=room,this.remotePeerId=remotePeerId,this.glareToken=void 0,this.closed=!1,this.connected=!1,this.synced=!1,this.peer=new import_simplepeer_min.default({initiator,...room.provider.peerOpts}),this.peer.on("signal",signal=>{this.glareToken===void 0&&(this.glareToken=Date.now()+Math.random()),publishSignalingMessage(signalingConn,room,{to:remotePeerId,from:room.peerId,type:"signal",token:this.glareToken,signal})}),this.peer.on("connect",()=>{log("connected to ",BOLD,remotePeerId),this.connected=!0;let doc2=room.provider.doc,awareness=room.awareness,encoder=createEncoder();writeVarUint(encoder,messageSync),writeSyncStep1(encoder,doc2),sendWebrtcConn(this,encoder);let awarenessStates=awareness.getStates();if(awarenessStates.size>0){let encoder2=createEncoder();writeVarUint(encoder2,messageAwareness),writeVarUint8Array(encoder2,encodeAwarenessUpdate(awareness,Array.from(awarenessStates.keys()))),sendWebrtcConn(this,encoder2)}}),this.peer.on("close",()=>{this.connected=!1,this.closed=!0,room.webrtcConns.has(this.remotePeerId)&&(room.webrtcConns.delete(this.remotePeerId),room.provider.emit("peers",[{removed:[this.remotePeerId],added:[],webrtcPeers:Array.from(room.webrtcConns.keys()),bcPeers:Array.from(room.bcConns)}])),checkIsSynced(room),this.peer.destroy(),log("closed connection to ",BOLD,remotePeerId),announceSignalingInfo(room)}),this.peer.on("error",err=>{log("Error in connection to ",BOLD,remotePeerId,": ",err),announceSignalingInfo(room)}),this.peer.on("data",data=>{let answer=readPeerMessage(this,data);answer!==null&&sendWebrtcConn(this,answer)})}destroy(){this.peer.destroy()}},broadcastBcMessage=(room,m)=>encrypt(m,room.key).then(data=>room.mux(()=>publish(room.name,data))),broadcastRoomMessage=(room,m)=>{room.bcconnected&&broadcastBcMessage(room,m),broadcastWebrtcConn(room,m)},announceSignalingInfo=room=>{signalingConns.forEach(conn=>{conn.connected&&(conn.send({type:"subscribe",topics:[room.name]}),room.webrtcConns.size{if(room.provider.filterBcConns){let encoderPeerIdBc=createEncoder();writeVarUint(encoderPeerIdBc,messageBcPeerId),writeUint8(encoderPeerIdBc,1),writeVarString(encoderPeerIdBc,room.peerId),broadcastBcMessage(room,toUint8Array(encoderPeerIdBc))}},Room=class{constructor(doc2,provider,name,key){this.peerId=uuidv4(),this.doc=doc2,this.awareness=provider.awareness,this.provider=provider,this.synced=!1,this.name=name,this.key=key,this.webrtcConns=new Map,this.bcConns=new Set,this.mux=createMutex(),this.bcconnected=!1,this._bcSubscriber=data=>decrypt(new Uint8Array(data),key).then(m=>this.mux(()=>{let reply=readMessage(this,m,()=>{});reply&&broadcastBcMessage(this,toUint8Array(reply))})),this._docUpdateHandler=(update,_origin)=>{let encoder=createEncoder();writeVarUint(encoder,messageSync),writeUpdate(encoder,update),broadcastRoomMessage(this,toUint8Array(encoder))},this._awarenessUpdateHandler=({added,updated,removed},_origin)=>{let changedClients=added.concat(updated).concat(removed),encoderAwareness=createEncoder();writeVarUint(encoderAwareness,messageAwareness),writeVarUint8Array(encoderAwareness,encodeAwarenessUpdate(this.awareness,changedClients)),broadcastRoomMessage(this,toUint8Array(encoderAwareness))},this._beforeUnloadHandler=()=>{removeAwarenessStates(this.awareness,[doc2.clientID],"window unload"),rooms.forEach(room=>{room.disconnect()})},typeof window<"u"?window.addEventListener("beforeunload",this._beforeUnloadHandler):typeof process<"u"&&process.on("exit",this._beforeUnloadHandler)}connect(){this.doc.on("update",this._docUpdateHandler),this.awareness.on("update",this._awarenessUpdateHandler),announceSignalingInfo(this);let roomName=this.name;subscribe(roomName,this._bcSubscriber),this.bcconnected=!0,broadcastBcPeerId(this);let encoderSync=createEncoder();writeVarUint(encoderSync,messageSync),writeSyncStep1(encoderSync,this.doc),broadcastBcMessage(this,toUint8Array(encoderSync));let encoderState=createEncoder();writeVarUint(encoderState,messageSync),writeSyncStep2(encoderState,this.doc),broadcastBcMessage(this,toUint8Array(encoderState));let encoderAwarenessQuery=createEncoder();writeVarUint(encoderAwarenessQuery,messageQueryAwareness),broadcastBcMessage(this,toUint8Array(encoderAwarenessQuery));let encoderAwarenessState=createEncoder();writeVarUint(encoderAwarenessState,messageAwareness),writeVarUint8Array(encoderAwarenessState,encodeAwarenessUpdate(this.awareness,[this.doc.clientID])),broadcastBcMessage(this,toUint8Array(encoderAwarenessState))}disconnect(){signalingConns.forEach(conn=>{conn.connected&&conn.send({type:"unsubscribe",topics:[this.name]})}),removeAwarenessStates(this.awareness,[this.doc.clientID],"disconnect");let encoderPeerIdBc=createEncoder();writeVarUint(encoderPeerIdBc,messageBcPeerId),writeUint8(encoderPeerIdBc,0),writeVarString(encoderPeerIdBc,this.peerId),broadcastBcMessage(this,toUint8Array(encoderPeerIdBc)),unsubscribe(this.name,this._bcSubscriber),this.bcconnected=!1,this.doc.off("update",this._docUpdateHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.webrtcConns.forEach(conn=>conn.destroy())}destroy(){this.disconnect(),typeof window<"u"?window.removeEventListener("beforeunload",this._beforeUnloadHandler):typeof process<"u"&&process.off("exit",this._beforeUnloadHandler)}},openRoom=(doc2,provider,name,key)=>{if(rooms.has(name))throw create2(`A Yjs Doc connected to room "${name}" already exists!`);let room=new Room(doc2,provider,name,key);return rooms.set(name,room),room},publishSignalingMessage=(conn,room,data)=>{room.key?encryptJson(data,room.key).then(data2=>{conn.send({type:"publish",topic:room.name,data:toBase64(data2)})}):conn.send({type:"publish",topic:room.name,data})},SignalingConn=class extends WebsocketClient{constructor(url){super(url),this.providers=new Set,this.on("connect",()=>{log(`connected (${url})`);let topics=Array.from(rooms.keys());this.send({type:"subscribe",topics}),rooms.forEach(room=>publishSignalingMessage(this,room,{type:"announce",from:room.peerId}))}),this.on("message",m=>{switch(m.type){case"publish":{let roomName=m.topic,room=rooms.get(roomName);if(room==null||typeof roomName!="string")return;let execMessage=data=>{let webrtcConns=room.webrtcConns,peerId=room.peerId;if(data==null||data.from===peerId||data.to!==void 0&&data.to!==peerId||room.bcConns.has(data.from))return;let emitPeerChange=webrtcConns.has(data.from)?()=>{}:()=>room.provider.emit("peers",[{removed:[],added:[data.from],webrtcPeers:Array.from(room.webrtcConns.keys()),bcPeers:Array.from(room.bcConns)}]);switch(data.type){case"announce":webrtcConns.sizenew WebrtcConn(this,!0,data.from,room)),emitPeerChange());break;case"signal":if(data.signal.type==="offer"){let existingConn=webrtcConns.get(data.from);if(existingConn){let remoteToken=data.token,localToken=existingConn.glareToken;if(localToken&&localToken>remoteToken){log("offer rejected: ",data.from);return}existingConn.glareToken=void 0}}if(data.signal.type==="answer"){log("offer answered by: ",data.from);let existingConn=webrtcConns.get(data.from);existingConn.glareToken=void 0}data.to===peerId&&(setIfUndefined(webrtcConns,data.from,()=>new WebrtcConn(this,!1,data.from,room)).peer.signal(data.signal),emitPeerChange());break}};room.key?typeof m.data=="string"&&decryptJson(fromBase64(m.data),room.key).then(execMessage):execMessage(m.data)}}}),this.on("disconnect",()=>log(`disconnect (${url})`))}},emitStatus=provider=>{provider.emit("status",[{connected:provider.connected}])},WebrtcProvider=class extends ObservableV2{constructor(roomName,doc2,{signaling=["wss://y-webrtc-eu.fly.dev"],password=null,awareness=new Awareness(doc2),maxConns=20+floor(rand()*15),filterBcConns=!0,peerOpts={}}={}){super(),this.roomName=roomName,this.doc=doc2,this.filterBcConns=filterBcConns,this.awareness=awareness,this.shouldConnect=!1,this.signalingUrls=signaling,this.signalingConns=[],this.maxConns=maxConns,this.peerOpts=peerOpts,this.key=password?deriveKey(password,roomName):resolve(null),this.room=null,this.key.then(key=>{this.room=openRoom(doc2,this,roomName,key),this.shouldConnect?this.room.connect():this.room.disconnect(),emitStatus(this)}),this.connect(),this.destroy=this.destroy.bind(this),doc2.on("destroy",this.destroy)}get connected(){return this.room!==null&&this.shouldConnect}connect(){this.shouldConnect=!0,this.signalingUrls.forEach(url=>{let signalingConn=setIfUndefined(signalingConns,url,()=>new SignalingConn(url));this.signalingConns.push(signalingConn),signalingConn.providers.add(this)}),this.room&&(this.room.connect(),emitStatus(this))}disconnect(){this.shouldConnect=!1,this.signalingConns.forEach(conn=>{conn.providers.delete(this),conn.providers.size===0&&(conn.destroy(),signalingConns.delete(conn.url))}),this.room&&(this.room.disconnect(),emitStatus(this))}destroy(){this.doc.off("destroy",this.destroy),this.key.then(()=>{this.room.destroy(),rooms.delete(this.roomName)}),super.destroy()}}}});var y_quill_exports={};__export(y_quill_exports,{QuillBinding:()=>QuillBinding,normQuillDelta:()=>normQuillDelta});var normQuillDelta,updateCursor,QuillBinding,init_y_quill=__esm({"node_modules/y-quill/src/y-quill.js"(){init_yjs();normQuillDelta=delta=>{if(delta.length>0){let d=delta[delta.length-1],insert=d.insert;if(d.attributes===void 0&&insert!==void 0&&insert.slice(-1)===` `){delta=delta.slice();let ins=insert.slice(0,-1);for(;ins.slice(-1)===` -`;)ins=ins.slice(0,-1);return delta[delta.length-1]={insert:ins},ins.length===0&&delta.pop(),delta}}return delta},updateCursor=(quillCursors,aw,clientId,doc2,type)=>{try{if(aw&&aw.cursor&&clientId!==doc2.clientID){let user=aw.user||{},color=user.color||"#ffa500",name=user.name||`User: ${clientId}`;quillCursors.createCursor(clientId.toString(),name,color);let anchor=createAbsolutePositionFromRelativePosition(createRelativePositionFromJSON(aw.cursor.anchor),doc2),head=createAbsolutePositionFromRelativePosition(createRelativePositionFromJSON(aw.cursor.head),doc2);anchor&&head&&anchor.type===type&&quillCursors.moveCursor(clientId.toString(),{index:anchor.index,length:head.index-anchor.index})}else quillCursors.removeCursor(clientId.toString())}catch(err){console.error(err)}},QuillBinding=class{constructor(type,quill,awareness){let doc2=type.doc;this.type=type,this.doc=doc2,this.quill=quill;let quillCursors=quill.getModule("cursors")||null;this.quillCursors=quillCursors,this._negatedUsedFormats={},this.awareness=awareness,this._awarenessChange=({added,removed,updated})=>{let states=awareness.getStates();added.forEach(id2=>{updateCursor(quillCursors,states.get(id2),id2,doc2,type)}),updated.forEach(id2=>{updateCursor(quillCursors,states.get(id2),id2,doc2,type)}),removed.forEach(id2=>{quillCursors.removeCursor(id2.toString())})},this._typeObserver=event=>{if(event.transaction.origin!==this){let eventDelta=event.delta,delta=[];for(let i=0;i{if(delta&&delta.ops){let ops=delta.ops;ops.forEach(op=>{if(op.attributes!==void 0)for(let key in op.attributes)this._negatedUsedFormats[key]===void 0&&(this._negatedUsedFormats[key]=!1)}),origin!==this&&doc2.transact(()=>{type.applyDelta(ops)},this)}if(awareness&&quillCursors){let sel=quill.getSelection(),aw=awareness.getLocalState();if(sel===null)awareness.getLocalState()!==null&&awareness.setLocalStateField("cursor",null);else{let anchor=createRelativePositionFromTypeIndex(type,sel.index),head=createRelativePositionFromTypeIndex(type,sel.index+sel.length);(!aw||!aw.cursor||!compareRelativePositions(anchor,aw.cursor.anchor)||!compareRelativePositions(head,aw.cursor.head))&&awareness.setLocalStateField("cursor",{anchor,head})}awareness.getStates().forEach((aw2,clientId)=>{updateCursor(quillCursors,aw2,clientId,doc2,type)})}},quill.on("editor-change",this._quillObserver),quill.setContents(type.toDelta(),this),quillCursors!==null&&awareness&&(awareness.getStates().forEach((aw,clientId)=>{updateCursor(quillCursors,aw,clientId,doc2,type)}),awareness.on("change",this._awarenessChange))}destroy(){this.type.unobserve(this._typeObserver),this.quill.off("editor-change",this._quillObserver),this.awareness&&this.awareness.off("change",this._awarenessChange)}}}});(function(a){typeof globalThis!="object"&&(this?b():(a.defineProperty(a.prototype,"_T_",{configurable:!0,get:b}),_T_));function b(){var b2=this||self;b2.globalThis=b2,delete a.prototype._T_}})(Object);(function(a){require_quill_core(),require_quill_bubble(),require_quill_snow()})(globalThis);(function(p){"use strict";var w=3850876,aF=" ",ae="0",gb="compare: functional value",kn="synced",ga="mkdir",cx=1e3,jS="delete",X="vendor/lwd/lib/lwd/lwd_seq.pp.ml",kI="@[",kH="window",k6="console",dS="int_of_string",fT="fs",km="%u",kG="/static/",jR="%i",k5="%ni",aX=255,f$=749039939,kF="Assert_failure",aH=737455525,kl="camlinternalMod.ml",jQ="0x",kk=32752,k4=218,jP=57343,kj="End_of_file",kE="OCAMLRUNPARAM",jO=": closedir failed",kD=253,k3="Out_of_memory",kC=553,jN="Not_found",gg="Failure",dR="Unix.Unix_error",jM="style",ki="^",bY="text",k2="length",kh="green",f5="ENOTDIR",kB="Lwd_seq.rank: node is marked",bx=936573133,jL="%Li",jJ="flex",jK="Invalid_argument",dK=254,bX="+",dM="Set.bal",k1=", characters ",aV=16777215,kg=858694086,kA=120,kz=1027,cw=1024,dQ="Map.bal",bb=246,kf="Pervasives.do_at_exit",ky=389604418,ke=65536,jI="submit",c="vendor/brr_lwd_ui/examples/yjs/main.ml",f4=15,T=16620,jH=", ",dJ=512,f3=-588596599,kZ="Match_failure",k0="closedir",jF="%li",jG=1026,kY=-32,jE=157,jD="b",fS="nan",e="",fR="rmdir",f_="Fatal error: exception ",kd="infinity",L="camlinternalFormat.ml",kc="fd ",kW="append",kX=": ",jC=174,q=248,kb="em",ka="data",kV=224,kx=24029,j$=240,j_="Sys_error",ap=128,f2="vendor/brr_lwd_ui/bindings/yjs/doc.ml",kw="ENOTEMPTY",kU="EEXIST",f9=1255,jB="checkbox",j9=1073741823,dI="value",fQ=" : flags Open_text and Open_binary are not compatible",kT="px",f1="e",fP=": Not a directory",f0="ENOENT",kv="Stack_overflow",fZ=-605101559,S=15681,j8="Array",kS="Undefined_recursive_module",j7=544,kR=2147483647,aG=32768,cv="string",dL="table",j6=2048,ku=-48,jz="error",jA=" : is a directory",j4="@{",j5="Division_by_zero",jy="classList",ba=".",j3=`(Program not linked with -g, cannot print stack backtrace) -`,bu="name",bc=63,kt="red",a$=737456202,fY=" : file already exists",bw=128,dP=": No such file or directory",j1="vendor/lwd/lib/brr-lwd/elwd.ml",j2=255,dH="lwd-to-remove",cy=256,dG="checked",cu=-976970511,fX=100,j0="id",fO="index out of bounds",ks=-937474657,aI="/",fN=504440814,dF=252,kQ="height: ",jx="lwdui-virtual-table-row",fM="%d",kP=383,jv="bold",jw=": file descriptor already closed",bt="-",fL="EBADF",jZ="changes",aW=951901561,jY=102,fW=-97,kO="Printexc.handle_uncaught_exception",ju=12520,gf=" : flags Open_rdonly and Open_wronly are not compatible",a="vendor/lwd/lib/lwd/lwd_table.ml",f8=756711075,kN=499,kr=`Fatal error: exception %s -`,fV=4100401,kM="class",jt="\xE2\x9D\x8C",aE=250,jX=199,dO="bool",gd=82908052,ge="kind",bv=611392745,fU="cell",kL=">",jW="([^/]+)",kq="input",f7="jsError",js=103,dE='"',aJ=65535,gc=127,f6=737308346,jr=56320,jV="documentElement",kK="Sys_blocked_io",b="vendor/lwd/lib/lwd/lwd.ml",kp="not implemented",jq="buffer.ml",jU="Form submitted:",kJ="_",fK="target",jT=-101336657,ko="rem",dN="_bigarr02";function zY(a10,b10,c10,d10,e10){if(d10<=b10)for(var f10=1;f10<=e10;f10++)c10[d10+f10]=a10[b10+f10];else for(var f10=e10;f10>=1;f10--)c10[d10+f10]=a10[b10+f10];return 0}function zZ(a10,b10,c10){var d10=new Array(c10+1);d10[0]=0;for(var e10=1,f10=b10+1;e10<=c10;e10++,f10++)d10[e10]=a10[f10];return d10}function cI(a10,b10,c10){var d10=String.fromCharCode;if(b10==0&&c10<=4096&&c10==a10.length)return d10.apply(null,a10);for(var f10=e;0=c10.l||c10.t==2&&e10>=c10.c.length))c10.c=a10.t==4?cI(a10.c,b10,e10):b10==0&&a10.c.length==e10?a10.c:a10.c.substr(b10,e10),c10.t=c10.c.length==c10.l?0:2;else if(c10.t==2&&d10==c10.c.length)c10.c+=a10.t==4?cI(a10.c,b10,e10):b10==0&&a10.c.length==e10?a10.c:a10.c.substr(b10,e10),c10.t=c10.c.length==c10.l?0:2;else{c10.t!=4&&dW(c10);var g10=a10.c,h10=c10.c;if(a10.t==4)if(d10<=b10)for(var f10=0;f10=0;f10--)h10[d10+f10]=g10[b10+f10];else{for(var i10=Math.min(e10,g10.length-b10),f10=0;f10>=1,a10==0)return d10;b10+=b10,c10++,c10==9&&b10.slice(0,1)}}function cD(a10){a10.t==2?a10.c+=b2(a10.l-a10.c.length,"\0"):a10.c=cI(a10.c,0,a10.c.length),a10.t=0}function gD(a10){if(a10.length<24){for(var b10=0;b10gc)return!1;return!0}else return!/[^\x00-\x7f]/.test(a10)}function lC(a10){for(var k10=e,d10=e,h10,g10,i10,b10,c10=0,j10=a10.length;c10dJ?(d10.substr(0,1),k10+=d10,d10=e,k10+=a10.slice(c10,f10)):d10+=a10.slice(c10,f10),f10==j10)break;c10=f10}b10=1,++c10=55295&&b10<57344)&&(b10=2)):(b10=3,++c101114111)&&(b10=3)))))),b10<4?(c10-=b10,d10+="\uFFFD"):b10>aJ?d10+=String.fromCharCode(55232+(b10>>10),jr+(b10&1023)):d10+=String.fromCharCode(b10),d10.length>cw&&(d10.substr(0,1),k10+=d10,d10=e)}return k10+d10}function aY(a10,b10,c10){this.t=a10,this.c=b10,this.l=c10}aY.prototype.toString=function(){switch(this.t){case 9:return this.c;default:cD(this);case 0:if(gD(this.c))return this.t=9,this.c;this.t=8;case 8:return this.c}},aY.prototype.toUtf16=function(){var a10=this.toString();return this.t==9?a10:lC(a10)},aY.prototype.slice=function(){var a10=this.t==4?this.c.slice():this.c;return new aY(this.t,a10,this.l)};function lc(a10){return new aY(0,a10,a10.length)}function aK(a10){return a10}function be(a10){return lc(a10)}function cB(a10,b10,c10,d10,e10){return aZ(be(a10),b10,c10,d10,e10),0}function lE(a10){var b10=p.process;if(b10&&b10.env&&b10.env[a10]!=null)return b10.env[a10];if(p.jsoo_static_env&&p.jsoo_static_env[a10])return p.jsoo_static_env[a10]}var gA=0;(function(){var c10=lE(kE);if(c10!==void 0)for(var b10=c10.split(","),a10=0;a10=a10.c.length)return 0;case 0:return a10.c.charCodeAt(b10);case 4:return a10.c[b10]}}function z4(a10,b10){return b10>>>0>=a10.l&&gi(),b0(a10,b10)}function B(a10,b10,c10){if(c10&=aX,a10.t!=4){if(b10==a10.c.length)return a10.c+=String.fromCharCode(c10),b10+1==a10.l&&(a10.t=0),0;dW(a10)}return a10.c[b10]=c10,0}function a0(a10,b10,c10){return b10>>>0>=a10.l&&gi(),B(a10,b10,c10)}function bz(a10){return a10.toArray()}function z5(a10,b10,c10){b10>>>0>=a10.l-7&&gi();for(var e10=bz(c10),d10=0;d10<8;d10++)B(a10,b10+7-d10,e10[d10]);return 0}function bf(d10,c10){var f10=d10.l>=0?d10.l:d10.l=d10.length,e10=c10.length,b10=f10-e10;if(b10==0)return d10.apply(null,c10);if(b10<0){var a10=d10.apply(null,c10.slice(0,f10));return typeof a10!="function"?a10:bf(a10,c10.slice(f10))}else{switch(b10){case 1:{var a10=function(a11){for(var f11=new Array(e10+1),b11=0;b11>>0>=a10.length-1&&cA(),a10}function z6(a10){return isFinite(a10)?Math.abs(a10)>=22250738585072014e-324?0:a10!=0?1:2:isNaN(a10)?4:3}function lo(a10){return 0}var A7=Math.log2&&Math.log2(11235582092889474e291)==1020;function A6(a10){if(A7)return Math.floor(Math.log2(a10));var b10=0;if(a10==0)return-1/0;if(a10>=1)for(;a10>=2;)a10/=2,b10++;else for(;a10<1;)a10*=2,b10--;return b10}function gp(a10){var b10=new Float32Array(1);b10[0]=a10;var c10=new Int32Array(b10.buffer);return c10[0]|0}var lj=Math.pow(2,-24);function lw(a10){throw a10}function gz(){lw(U.Division_by_zero)}function d(a10,b10,c10){this.lo=a10&aV,this.mi=b10&aV,this.hi=c10&aJ}d.prototype.caml_custom="_j",d.prototype.copy=function(){return new d(this.lo,this.mi,this.hi)},d.prototype.ucompare=function(a10){return this.hi>a10.hi?1:this.hia10.mi?1:this.mia10.lo?1:this.loc10?1:b10a10.mi?1:this.mia10.lo?1:this.lo>24),c10=-this.hi+(b10>>24);return new d(a10,b10,c10)},d.prototype.add=function(a10){var b10=this.lo+a10.lo,c10=this.mi+a10.mi+(b10>>24),e10=this.hi+a10.hi+(c10>>24);return new d(b10,c10,e10)},d.prototype.sub=function(a10){var b10=this.lo-a10.lo,c10=this.mi-a10.mi+(b10>>24),e10=this.hi-a10.hi+(c10>>24);return new d(b10,c10,e10)},d.prototype.mul=function(a10){var b10=this.lo*a10.lo,c10=(b10*lj|0)+this.mi*a10.lo+this.lo*a10.mi,e10=(c10*lj|0)+this.hi*a10.lo+this.mi*a10.mi+this.lo*a10.hi;return new d(b10,c10,e10)},d.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0},d.prototype.isNeg=function(){return this.hi<<16<0},d.prototype.and=function(a10){return new d(this.lo&a10.lo,this.mi&a10.mi,this.hi&a10.hi)},d.prototype.or=function(a10){return new d(this.lo|a10.lo,this.mi|a10.mi,this.hi|a10.hi)},d.prototype.xor=function(a10){return new d(this.lo^a10.lo,this.mi^a10.mi,this.hi^a10.hi)},d.prototype.shift_left=function(a10){return a10=a10&63,a10==0?this:a10<24?new d(this.lo<>24-a10,this.hi<>24-a10):a10<48?new d(0,this.lo<>48-a10):new d(0,0,this.lo<>a10|this.mi<<24-a10,this.mi>>a10|this.hi<<24-a10,this.hi>>a10):a10<48?new d(this.mi>>a10-24|this.hi<<48-a10,this.hi>>a10-24,0):new d(this.hi>>a10-48,0,0)},d.prototype.shift_right=function(a10){if(a10=a10&63,a10==0)return this;var c10=this.hi<<16>>16;if(a10<24)return new d(this.lo>>a10|this.mi<<24-a10,this.mi>>a10|c10<<24-a10,this.hi<<16>>a10>>>16);var b10=this.hi<<16>>31;return a10<48?new d(this.mi>>a10-24|this.hi<<48-a10,this.hi<<16>>a10-24>>16,b10&aJ):new d(this.hi<<16>>a10-32,b10,b10)},d.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23,this.mi=(this.mi<<1|this.lo>>23)&aV,this.lo=this.lo<<1&aV},d.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&aV,this.mi=(this.mi>>>1|this.hi<<23)&aV,this.hi=this.hi>>>1},d.prototype.udivmod=function(a10){for(var e10=0,c10=this.copy(),b10=a10.copy(),f10=new d(0,0,0);c10.ucompare(b10)>0;)e10++,b10.lsl1();for(;e10>=0;)e10--,f10.lsl1(),c10.ucompare(b10)>=0&&(f10.lo++,c10=c10.sub(b10)),b10.lsr1();return{quotient:f10,modulus:c10}},d.prototype.div=function(a10){var b10=this;a10.isZero()&&gz();var d10=b10.hi^a10.hi;b10.hi&aG&&(b10=b10.neg()),a10.hi&aG&&(a10=a10.neg());var c10=b10.udivmod(a10).quotient;return d10&aG&&(c10=c10.neg()),c10},d.prototype.mod=function(a10){var b10=this;a10.isZero()&&gz();var d10=b10.hi;b10.hi&aG&&(b10=b10.neg()),a10.hi&aG&&(a10=a10.neg());var c10=b10.udivmod(a10).modulus;return d10&aG&&(c10=c10.neg()),c10},d.prototype.toInt=function(){return this.lo|this.mi<<24},d.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo},d.prototype.toArray=function(){return[this.hi>>8,this.hi&aX,this.mi>>16,this.mi>>8&aX,this.mi&aX,this.lo>>16,this.lo>>8&aX,this.lo&aX]},d.prototype.lo32=function(){return this.lo|(this.mi&aX)<<24},d.prototype.hi32=function(){return this.mi>>>8&aJ|this.hi<<16};function dZ(a10,b10,c10){return new d(a10,b10,c10)}function dY(a10){if(!isFinite(a10))return isNaN(a10)?dZ(1,0,kk):a10>0?dZ(0,0,kk):dZ(0,0,65520);var f10=a10==0&&1/a10==-1/0?aG:a10>=0?0:aG;f10&&(a10=-a10);var b10=A6(a10)+1023;b10<=0?(b10=0,a10/=Math.pow(2,-jG)):(a10/=Math.pow(2,b10-kz),a10<16&&(a10*=2,b10-=1),b10==0&&(a10/=2));var d10=Math.pow(2,24),c10=a10|0;a10=(a10-c10)*d10;var e10=a10|0;a10=(a10-e10)*d10;var g10=a10|0;return c10=c10&f4|f10|b10<<4,dZ(g10,e10,c10)}function lb(a10,b10,c10){if(a10.write(32,b10.dims.length),a10.write(32,b10.kind|b10.layout<<8),b10.caml_custom==dN)for(var d10=0;d10>4;if(d10==2047)return f10|g10|c10&f4?NaN:c10&aG?-1/0:1/0;var e10=Math.pow(2,-24),b10=(f10*e10+g10)*e10+(c10&f4);return d10>0?(b10+=16,b10*=Math.pow(2,d10-kz)):b10*=Math.pow(2,-jG),c10&aG&&(b10=-b10),b10}function gh(a10){for(var d10=a10.length,c10=1,b10=0;b10>>24&aX|(b10&aJ)<<8,b10>>>16&aJ)}function gs(a10){return a10.hi32()}function gt(a10){return a10.lo32()}var z1=dN;function bd(a10,b10,c10,d10){this.kind=a10,this.layout=b10,this.dims=c10,this.data=d10}bd.prototype.caml_custom=z1,bd.prototype.offset=function(a10){var c10=0;if(typeof a10=="number"&&(a10=[a10]),a10 instanceof Array||G("bigarray.js: invalid offset"),this.dims.length!=a10.length&&G("Bigarray.get/set: bad number of dimensions"),this.layout==0)for(var b10=0;b10=this.dims[b10])&&cA(),c10=c10*this.dims[b10]+a10[b10];else for(var b10=this.dims.length-1;b10>=0;b10--)(a10[b10]<1||a10[b10]>this.dims[b10])&&cA(),c10=c10*this.dims[b10]+(a10[b10]-1);return c10},bd.prototype.get=function(a10){switch(this.kind){case 7:var d10=this.data[a10*2+0],b10=this.data[a10*2+1];return An(d10,b10);case 10:case 11:var e10=this.data[a10*2+0],c10=this.data[a10*2+1];return[dK,e10,c10];default:return this.data[a10]}},bd.prototype.set=function(a10,b10){switch(this.kind){case 7:this.data[a10*2+0]=gt(b10),this.data[a10*2+1]=gs(b10);break;case 10:case 11:this.data[a10*2+0]=b10[1],this.data[a10*2+1]=b10[2];break;default:this.data[a10]=b10;break}return 0},bd.prototype.fill=function(a10){switch(this.kind){case 7:var c10=gt(a10),e10=gs(a10);if(c10==e10)this.data.fill(c10);else for(var b10=0;b10e10)return 1;if(d10!=e10){if(!b10)return NaN;if(d10==d10)return 1;if(e10==e10)return-1}}break;case 7:for(var c10=0;c10a10.data[c10+1])return 1;if(this.data[c10]>>>0>>0)return-1;if(this.data[c10]>>>0>a10.data[c10]>>>0)return 1}break;case 2:case 3:case 4:case 5:case 6:case 8:case 9:case 12:for(var c10=0;c10a10.data[c10])return 1}break}return 0};function bZ(a10,b10,c10,d10){this.kind=a10,this.layout=b10,this.dims=c10,this.data=d10}bZ.prototype=new bd,bZ.prototype.offset=function(a10){return typeof a10!="number"&&(a10 instanceof Array&&a10.length==1?a10=a10[0]:G("Ml_Bigarray_c_1_1.offset")),(a10<0||a10>=this.dims[0])&&cA(),a10},bZ.prototype.get=function(a10){return this.data[a10]},bZ.prototype.set=function(a10,b10){return this.data[a10]=b10,0},bZ.prototype.fill=function(a10){return this.data.fill(a10),0};function k9(a10,b10,c10,d10){var e10=k$(a10);return gh(c10)*e10!=d10.length&&G("length doesn't match dims"),b10==0&&c10.length==1&&e10==1?new bZ(a10,b10,c10,d10):new bd(a10,b10,c10,d10)}function al(a10){U.Failure||(U.Failure=[q,gg,-3]),gy(U.Failure,a10)}function k_(a10,b10,c10){var k10=a10.read32s();(k10<0||k10>16)&&al("input_value: wrong number of bigarray dimensions");var r10=a10.read32s(),l10=r10&aX,q10=r10>>8&1,j10=[];if(c10==dN)for(var d10=0;d10>>17,b10=cG(b10,461845907),a10^=b10,a10=a10<<13|a10>>>19,(a10+(a10<<2)|0)+-430675100|0}function Ah(a10,b10){return a10=V(a10,gt(b10)),a10=V(a10,gs(b10)),a10}function gn(a10,b10){return Ah(a10,dY(b10))}function la(a10){var c10=gh(a10.dims),d10=0;switch(a10.kind){case 2:case 3:case 12:c10>cy&&(c10=cy);var e10=0,b10=0;for(b10=0;b10+4<=a10.data.length;b10+=4)e10=a10.data[b10+0]|a10.data[b10+1]<<8|a10.data[b10+2]<<16|a10.data[b10+3]<<24,d10=V(d10,e10);switch(e10=0,c10&3){case 3:e10=a10.data[b10+2]<<16;case 2:e10|=a10.data[b10+1]<<8;case 1:e10|=a10.data[b10+0],d10=V(d10,e10)}break;case 4:case 5:c10>bw&&(c10=bw);var e10=0,b10=0;for(b10=0;b10+2<=a10.data.length;b10+=2)e10=a10.data[b10+0]|a10.data[b10+1]<<16,d10=V(d10,e10);c10&1&&(d10=V(d10,a10.data[b10]));break;case 6:c10>64&&(c10=64);for(var b10=0;b1064&&(c10=64);for(var b10=0;b1032&&(c10=32),c10*=2;for(var b10=0;b1064&&(c10=64);for(var b10=0;b1032&&(c10=32);for(var b10=0;b100?f10(b10,a10,d10):f10(a10,b10,d10);if(d10&&e10!=e10)return c10;if(+e10!=+e10)return+e10;if(e10|0)return e10|0}return c10}function d2(a10){return typeof a10=="string"&&!/[^\x00-\xff]/.test(a10)}function d1(a10){return a10 instanceof aY}function le(a10){if(typeof a10=="number")return cx;if(d1(a10))return dF;if(d2(a10))return 1252;if(a10 instanceof Array&&a10[0]===a10[0]>>>0&&a10[0]<=j2){var b10=a10[0]|0;return b10==dK?0:b10}else{if(a10 instanceof String)return ju;if(typeof a10=="string")return ju;if(a10 instanceof Number)return cx;if(a10&&a10.caml_custom)return f9;if(a10&&a10.compare)return 1256;if(typeof a10=="function")return 1247;if(typeof a10=="symbol")return 1251}return 1001}function lm(a10,b10){return a10b10?1:0}function z3(a10,b10){return a10.t&6&&cD(a10),b10.t&6&&cD(b10),a10.cb10.c?1:0}function dV(a10,b10,c10){for(var f10=[];;){if(!(c10&&a10===b10)){var e10=le(a10);if(e10==aE){a10=a10[1];continue}var g10=le(b10);if(g10==aE){b10=b10[1];continue}if(e10!==g10)return e10==cx?g10==f9?ld(a10,b10,-1,c10):-1:g10==cx?e10==f9?ld(b10,a10,1,c10):1:e10b10)return 1;if(a10!=b10){if(!c10)return NaN;if(a10==a10)return 1;if(b10==b10)return-1}break;case 1001:if(a10b10)return 1;if(a10!=b10){if(!c10)return NaN;if(a10==a10)return 1;if(b10==b10)return-1}break;case 1251:if(a10!==b10)return c10?1:NaN;break;case 1252:var a10=a10,b10=b10;if(a10!==b10){if(a10b10)return 1}break;case 12520:var a10=a10.toString(),b10=b10.toString();if(a10!==b10){if(a10b10)return 1}break;case 246:case 254:default:if(lo(e10)){G("compare: continuation value");break}if(a10.length!=b10.length)return a10.length1&&f10.push(a10,b10,1);break}}if(f10.length==0)return 0;var h10=f10.pop();b10=f10.pop(),a10=f10.pop(),h10+10)if(b10==0&&(c10>=a10.l||a10.t==2&&c10>=a10.c.length))d10==0?(a10.c=e,a10.t=2):(a10.c=b2(c10,String.fromCharCode(d10)),a10.t=c10==a10.l?0:2);else for(a10.t!=4&&dW(a10),c10+=b10;b100&&b10===b10||(a10=a10.replace(/_/g,e),b10=+a10,a10.length>0&&b10===b10||/^[+-]?nan$/i.test(a10)))return b10;var c10=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(a10);if(c10){var d10=c10[3].replace(/0+$/,e),g10=parseInt(c10[1]+c10[2]+d10,16),f10=(c10[5]|0)-4*d10.length;return b10=g10*Math.pow(2,f10),b10}if(/^\+?inf(inity)?$/i.test(a10))return 1/0;if(/^-inf(inity)?$/i.test(a10))return-1/0;al("float_of_string")}function gx(a10){a10=a10;var e10=a10.length;e10>31&&G("format_int: format too long");for(var b10={justify:bX,signstyle:bt,filler:aF,alternate:!1,base:0,signedconv:!1,width:0,uppercase:!1,sign:1,prec:-1,conv:"f"},d10=0;d10=0&&c10<=9;)b10.width=b10.width*10+c10,d10++;d10--;break;case".":for(b10.prec=0,d10++;c10=a10.charCodeAt(d10)-48,c10>=0&&c10<=9;)b10.prec=b10.prec*10+c10,d10++;d10--;case"d":case"i":b10.signedconv=!0;case"u":b10.base=10;break;case"x":b10.base=16;break;case"X":b10.base=16,b10.uppercase=!0;break;case"o":b10.base=8;break;case"e":case"f":case"g":b10.signedconv=!0,b10.conv=c10;break;case"E":case"F":case"G":b10.signedconv=!0,b10.uppercase=!0,b10.conv=c10.toLowerCase();break}}return b10}function gl(a10,b10){a10.uppercase&&(b10=b10.toUpperCase());var f10=b10.length;a10.signedconv&&(a10.sign<0||a10.signstyle!=bt)&&f10++,a10.alternate&&(a10.base==8&&(f10+=1),a10.base==16&&(f10+=2));var c10=e;if(a10.justify==bX&&a10.filler==aF)for(var d10=f10;d1020?(c11-=20,a11/=Math.pow(10,c11),a11+=new Array(c11+1).join(ae),b11>0&&(a11=a11+ba+new Array(b11+1).join(ae)),a11):a11.toFixed(b11)}var c10,f10=gx(a10),e10=f10.prec<0?6:f10.prec;if((b10<0||b10==0&&1/b10==-1/0)&&(f10.sign=-1,b10=-b10),isNaN(b10))c10=fS,f10.filler=aF;else if(!isFinite(b10))c10="inf",f10.filler=aF;else switch(f10.conv){case"e":var c10=b10.toExponential(e10),d10=c10.length;c10.charAt(d10-3)==f1&&(c10=c10.slice(0,d10-1)+ae+c10.slice(d10-1));break;case"f":c10=j10(b10,e10);break;case"g":e10=e10||1,c10=b10.toExponential(e10-1);var i10=c10.indexOf(f1),h10=+c10.slice(i10+1);if(h10<-4||b10>=1e21||b10.toFixed(0).length>e10){for(var d10=i10-1;c10.charAt(d10)==ae;)d10--;c10.charAt(d10)==ba&&d10--,c10=c10.slice(0,d10+1)+c10.slice(i10),d10=c10.length,c10.charAt(d10-3)==f1&&(c10=c10.slice(0,d10-1)+ae+c10.slice(d10-1));break}else{var g10=e10;if(h10<0)g10-=h10+1,c10=b10.toFixed(g10);else for(;c10=b10.toFixed(g10),c10.length>e10+1;)g10--;if(g10){for(var d10=c10.length-1;c10.charAt(d10)==ae;)d10--;c10.charAt(d10)==ba&&d10--,c10=c10.slice(0,d10+1)}}break}return gl(f10,c10)}function dX(a10,b10){if(a10==fM)return e+b10;var c10=gx(a10);b10<0&&(c10.signedconv?(c10.sign=-1,b10=-b10):b10>>>=0);var d10=b10.toString(c10.base);if(c10.prec>=0){c10.filler=aF;var f10=c10.prec-d10.length;f10>0&&(d10=b2(f10,ae)+d10)}return gl(c10,d10)}var AO=0;function af(){return AO++}function H(a10){return gD(a10)?a10:lC(a10)}function cJ(){return typeof p.process<"u"&&typeof p.process.versions<"u"&&typeof p.process.versions.node<"u"}function A8(){function a10(a11){if(a11.charAt(0)===aI)return[e,a11.substring(1)]}function b10(a11){var h10=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b11=h10.exec(a11),c10=b11[1]||e,f10=!!(c10&&c10.charAt(1)!==":");if(b11[2]||f10){var d10=b11[1]||e,g10=b11[2]||e;return[d10,a11.substring(d10.length+g10.length)]}}return cJ()&&p.process&&p.process.platform&&p.process.platform==="win32"?b10:a10}var gE=A8();function lA(a10){return a10.slice(-1)!==aI?a10+aI:a10}if(cJ()&&p.process&&p.process.cwd)var cE=p.process.cwd().replace(/\\/g,aI);else var cE="/static";cE=lA(cE);function AB(a10){a10=H(a10),gE(a10)||(a10=cE+a10);for(var e10=gE(a10),d10=e10[1].split(aI),b10=[],c10=0;c101&&b10.pop();break;case".":break;case"":break;default:b10.push(d10[c10]);break}return b10.unshift(e10[0]),b10.orig=a10,b10}function AY(a10){for(var g10=e,c10=g10,b10,i10,d10=0,h10=a10.length;d10dJ?(c10.substr(0,1),g10+=c10,c10=e,g10+=a10.slice(d10,f10)):c10+=a10.slice(d10,f10),f10==h10)break;d10=f10}b10>6),c10+=String.fromCharCode(ap|b10&bc)):b10<55296||b10>=jP?c10+=String.fromCharCode(kV|b10>>12,ap|b10>>6&bc,ap|b10&bc):b10>=56319||d10+1==h10||(i10=a10.charCodeAt(d10+1))jP?c10+="\xEF\xBF\xBD":(d10++,b10=(b10<<10)+i10-56613888,c10+=String.fromCharCode(j$|b10>>18,ap|b10>>12&bc,ap|b10>>6&bc,ap|b10&bc)),c10.length>cw&&(c10.substr(0,1),g10+=c10,c10=e)}return g10+c10}function at(a10){return gD(a10)?a10:AY(a10)}var A9=["E2BIG","EACCES","EAGAIN",fL,"EBUSY","ECHILD","EDEADLK","EDOM",kU,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",f0,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",f5,kw,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function a2(a10,b10,c10,d10){var f10=A9.indexOf(a10);f10<0&&(d10==null&&(d10=-9999),f10=[0,d10]);var g10=[f10,at(b10||e),at(c10||e)];return g10}var lu={};function bh(a10){return lu[a10]}function a1(a10,b10){throw g([0,a10].concat(b10))}function gj(a10){return a10 instanceof Uint8Array||(a10=new Uint8Array(a10)),new aY(4,a10,a10.length)}function m(a10){gy(U.Sys_error,a10)}function lx(a10){m(a10+dP)}function gC(a10){return a10.t!=4&&dW(a10),a10.c}function ar(a10){return a10.l}function k7(){}function Y(a10){this.data=a10}Y.prototype=new k7,Y.prototype.constructor=Y,Y.prototype.truncate=function(a10){var b10=this.data;this.data=F(a10|0),aZ(b10,0,this.data,0,a10)},Y.prototype.length=function(){return ar(this.data)},Y.prototype.write=function(a10,b10,c10,d10){var e10=this.length();if(a10+d10>=e10){var f10=F(a10+d10),g10=this.data;this.data=f10,aZ(g10,0,this.data,0,e10)}return aZ(gj(b10),c10,this.data,a10,d10),0},Y.prototype.read=function(a10,b10,c10,d10){var e10=this.length();if(a10+d10>=e10&&(d10=e10-a10),d10){var f10=F(d10|0);aZ(this.data,a10,f10,0,d10),b10.set(gC(f10),c10)}return d10};function by(a10,b10,c10){this.file=b10,this.name=a10,this.flags=c10}by.prototype.err_closed=function(){m(this.name+jw)},by.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()},by.prototype.write=function(a10,b10,c10,d10){if(this.file)return this.file.write(a10,b10,c10,d10);this.err_closed()},by.prototype.read=function(a10,b10,c10,d10){if(this.file)return this.file.read(a10,b10,c10,d10);this.err_closed()},by.prototype.close=function(){this.file=void 0};function O(a10,b10){this.content={},this.root=a10,this.lookupFun=b10}O.prototype.nm=function(a10){return this.root+a10},O.prototype.create_dir_if_needed=function(a10){for(var d10=a10.split(aI),c10=e,b10=0;b10>>16,a10=cG(a10,-2048144789),a10^=a10>>>13,a10=cG(a10,-1028477387),a10^=a10>>>16,a10}function Ad(a10,b10,c10,d10){var j10,k10,l10,h10,g10,f10,e10,i10,m10;for(h10=b10,(h10<0||h10>cy)&&(h10=cy),g10=a10,f10=c10,j10=[d10],k10=0,l10=1;k100;)if(e10=j10[k10++],e10&&e10.caml_custom){if(cF[e10.caml_custom]&&cF[e10.caml_custom].hash){var n10=cF[e10.caml_custom].hash(e10);f10=V(f10,n10),g10--}}else if(e10 instanceof Array&&e10[0]===(e10[0]|0))switch(e10[0]){case 248:f10=V(f10,e10[2]),g10--;break;case 250:j10[--k10]=e10[1];break;default:if(lo(e10[0]))break;var o10=e10.length-1<<10|e10[0];for(f10=V(f10,o10),i10=1,m10=e10.length;i10=h10);i10++)j10[l10++]=e10[i10];break}else d1(e10)?(f10=Ae(f10,e10),g10--):d2(e10)?(f10=Ai(f10,e10),g10--):typeof e10=="string"?(f10=go(f10,e10),g10--):e10===(e10|0)?(f10=V(f10,e10+e10+1),g10--):typeof e10=="number"&&(f10=gn(f10,e10),g10--);return f10=Ag(f10),f10&1073741823}function Aj(a10,b10,c10){if(!isFinite(a10))return isNaN(a10)?at(fS):at(a10>0?kd:"-infinity");var k10=a10==0&&1/a10==-1/0?1:a10>=0?0:1;k10&&(a10=-a10);var f10=0;if(a10!=0)if(a10<1)for(;a10<1&&f10>-1022;)a10*=2,f10--;else for(;a10>=2;)a10/=2,f10++;var l10=f10<0?e:bX,g10=e;if(k10)g10=bt;else switch(c10){case 43:g10=bX;break;case 32:g10=aF;break;default:break}if(b10>=0&&b10<13){var i10=Math.pow(2,b10*4);a10=Math.round(a10*i10)/i10}var d10=a10.toString(16);if(b10>=0){var j10=d10.indexOf(ba);if(j10<0)d10+=ba+b2(b10,ae);else{var h10=j10+1+b10;d10.length>24&aV,a10>>31&aJ)}function Au(a10){return a10.toInt()}function Aq(a10){return+a10.isNeg()}function At(a10){return a10.neg()}function Ao(a10,b10){var c10=gx(a10);c10.signedconv&&Aq(b10)&&(c10.sign=-1,b10=At(b10));var d10=e,i10=d0(c10.base),h10="0123456789abcdef";do{var g10=b10.udivmod(i10);b10=g10.quotient,d10=h10.charAt(Au(g10.modulus))+d10}while(!Ar(b10));if(c10.prec>=0){c10.filler=aF;var f10=c10.prec-d10.length;f10>0&&(d10=b2(f10,ae)+d10)}return gl(c10,d10)}function lk(a10,b10){return a10.or(b10)}function ll(a10,b10){return a10.shift_left(b10)}function gu(a10,b10){return a10.shift_right_unsigned(b10)}function AP(a10){var b10=0,e10=n(a10),c10=10,d10=1;if(e10>0)switch($(a10,b10)){case 45:b10++,d10=-1;break;case 43:b10++,d10=1;break}if(b10+1=48&&a10<=57?a10-48:a10>=65&&a10<=90?a10-55:a10>=97&&a10<=122?a10-87:-1}function ln(a10){var h10=AP(a10),d10=h10[0],i10=h10[1],e10=h10[2],g10=n(a10),j10=-1>>>0,f10=d10=e10)&&al(dS);var b10=c10;for(d10++;d10=e10)break;b10=e10*b10+c10,b10>j10&&al(dS)}return d10!=g10&&al(dS),b10=i10*b10,e10==10&&(b10|0)!=b10&&al(dS),b10|0}function lp(a10){return a10.slice(1)}function d3(a10,b10,c10){return a10[H(b10)].apply(a10,lp(c10))}function lq(a10,b10){switch(b10.length){case 1:return new a10;case 2:return new a10(b10[1]);case 3:return new a10(b10[1],b10[2]);case 4:return new a10(b10[1],b10[2],b10[3]);case 5:return new a10(b10[1],b10[2],b10[3],b10[4]);case 6:return new a10(b10[1],b10[2],b10[3],b10[4],b10[5]);case 7:return new a10(b10[1],b10[2],b10[3],b10[4],b10[5],b10[6]);case 8:return new a10(b10[1],b10[2],b10[3],b10[4],b10[5],b10[6],b10[7])}function c10(){return a10.apply(this,lp(b10))}return c10.prototype=a10.prototype,new c10}function gv(a10){for(var c10={},b10=1;b10>>32-e10,c10)}function g10(a10,b10,c10,d10,e10,f10,g11){return l10(b10&c10|~b10&d10,a10,b10,e10,f10,g11)}function h10(a10,b10,c10,d10,e10,f10,g11){return l10(b10&d10|c10&~d10,a10,b10,e10,f10,g11)}function i10(a10,b10,c10,d10,e10,f10,g11){return l10(b10^c10^d10,a10,b10,e10,f10,g11)}function j10(a10,b10,c10,d10,e10,f10,g11){return l10(c10^(b10|~d10),a10,b10,e10,f10,g11)}return function(a10,b10){var c10=a10[0],d10=a10[1],e10=a10[2],f10=a10[3];c10=g10(c10,d10,e10,f10,b10[0],7,3614090360),f10=g10(f10,c10,d10,e10,b10[1],12,3905402710),e10=g10(e10,f10,c10,d10,b10[2],17,606105819),d10=g10(d10,e10,f10,c10,b10[3],22,3250441966),c10=g10(c10,d10,e10,f10,b10[4],7,4118548399),f10=g10(f10,c10,d10,e10,b10[5],12,1200080426),e10=g10(e10,f10,c10,d10,b10[6],17,2821735955),d10=g10(d10,e10,f10,c10,b10[7],22,4249261313),c10=g10(c10,d10,e10,f10,b10[8],7,1770035416),f10=g10(f10,c10,d10,e10,b10[9],12,2336552879),e10=g10(e10,f10,c10,d10,b10[10],17,4294925233),d10=g10(d10,e10,f10,c10,b10[11],22,2304563134),c10=g10(c10,d10,e10,f10,b10[12],7,1804603682),f10=g10(f10,c10,d10,e10,b10[13],12,4254626195),e10=g10(e10,f10,c10,d10,b10[14],17,2792965006),d10=g10(d10,e10,f10,c10,b10[15],22,1236535329),c10=h10(c10,d10,e10,f10,b10[1],5,4129170786),f10=h10(f10,c10,d10,e10,b10[6],9,3225465664),e10=h10(e10,f10,c10,d10,b10[11],14,643717713),d10=h10(d10,e10,f10,c10,b10[0],20,3921069994),c10=h10(c10,d10,e10,f10,b10[5],5,3593408605),f10=h10(f10,c10,d10,e10,b10[10],9,38016083),e10=h10(e10,f10,c10,d10,b10[15],14,3634488961),d10=h10(d10,e10,f10,c10,b10[4],20,3889429448),c10=h10(c10,d10,e10,f10,b10[9],5,568446438),f10=h10(f10,c10,d10,e10,b10[14],9,3275163606),e10=h10(e10,f10,c10,d10,b10[3],14,4107603335),d10=h10(d10,e10,f10,c10,b10[8],20,1163531501),c10=h10(c10,d10,e10,f10,b10[13],5,2850285829),f10=h10(f10,c10,d10,e10,b10[2],9,4243563512),e10=h10(e10,f10,c10,d10,b10[7],14,1735328473),d10=h10(d10,e10,f10,c10,b10[12],20,2368359562),c10=i10(c10,d10,e10,f10,b10[5],4,4294588738),f10=i10(f10,c10,d10,e10,b10[8],11,2272392833),e10=i10(e10,f10,c10,d10,b10[11],16,1839030562),d10=i10(d10,e10,f10,c10,b10[14],23,4259657740),c10=i10(c10,d10,e10,f10,b10[1],4,2763975236),f10=i10(f10,c10,d10,e10,b10[4],11,1272893353),e10=i10(e10,f10,c10,d10,b10[7],16,4139469664),d10=i10(d10,e10,f10,c10,b10[10],23,3200236656),c10=i10(c10,d10,e10,f10,b10[13],4,681279174),f10=i10(f10,c10,d10,e10,b10[0],11,3936430074),e10=i10(e10,f10,c10,d10,b10[3],16,3572445317),d10=i10(d10,e10,f10,c10,b10[6],23,76029189),c10=i10(c10,d10,e10,f10,b10[9],4,3654602809),f10=i10(f10,c10,d10,e10,b10[12],11,3873151461),e10=i10(e10,f10,c10,d10,b10[15],16,530742520),d10=i10(d10,e10,f10,c10,b10[2],23,3299628645),c10=j10(c10,d10,e10,f10,b10[0],6,4096336452),f10=j10(f10,c10,d10,e10,b10[7],10,1126891415),e10=j10(e10,f10,c10,d10,b10[14],15,2878612391),d10=j10(d10,e10,f10,c10,b10[5],21,4237533241),c10=j10(c10,d10,e10,f10,b10[12],6,1700485571),f10=j10(f10,c10,d10,e10,b10[3],10,2399980690),e10=j10(e10,f10,c10,d10,b10[10],15,4293915773),d10=j10(d10,e10,f10,c10,b10[1],21,2240044497),c10=j10(c10,d10,e10,f10,b10[8],6,1873313359),f10=j10(f10,c10,d10,e10,b10[15],10,4264355552),e10=j10(e10,f10,c10,d10,b10[6],15,2734768916),d10=j10(d10,e10,f10,c10,b10[13],21,1309151649),c10=j10(c10,d10,e10,f10,b10[4],6,4149444226),f10=j10(f10,c10,d10,e10,b10[11],10,3174756917),e10=j10(e10,f10,c10,d10,b10[2],15,718787259),d10=j10(d10,e10,f10,c10,b10[9],21,3951481745),a10[0]=k10(c10,a10[0]),a10[1]=k10(d10,a10[1]),a10[2]=k10(e10,a10[2]),a10[3]=k10(f10,a10[3])}}();function zX(a10,b10,c10){var e10=a10.len&bc,d10=0;if(a10.len+=c10,e10){var f10=64-e10;if(c10=64;)a10.b8.set(b10.subarray(d10,d10+64),0),dT(a10.w,a10.b32),c10-=64,d10+=64;c10&&a10.b8.set(b10.subarray(d10,d10+c10),0)}function zV(a10){var c10=a10.len&bc;if(a10.b8[c10]=ap,c10++,c10>56){for(var b10=c10;b10<64;b10++)a10.b8[b10]=0;dT(a10.w,a10.b32);for(var b10=0;b10<56;b10++)a10.b8[b10]=0}else for(var b10=c10;b10<56;b10++)a10.b8[b10]=0;a10.b32[14]=a10.len<<3,a10.b32[15]=a10.len>>29&536870911,dT(a10.w,a10.b32);for(var e10=new Uint8Array(16),d10=0;d10<4;d10++)for(var b10=0;b10<4;b10++)e10[d10*4+b10]=a10.w[d10]>>8*b10&255;return e10}function AU(a10){return cI(a10,0,a10.length)}function AC(a10,b10,c10){var d10=zW(),e10=gC(a10);return zX(d10,e10.subarray(b10,b10+c10),c10),AU(zV(d10))}function AD(a10,b10,c10){return AC(be(a10),b10,c10)}function AF(){return 0}var bg=new Array;function lr(a10){return bg[a10]}function bB(a10){var b10=lr(a10);return b10.opened||m("Cannot flush a closed channel"),!b10.buffer||b10.buffer_curr==0||(b10.output?b10.output(cI(b10.buffer,0,b10.buffer_curr)):b10.file.write(b10.offset,b10.buffer,0,b10.buffer_curr),b10.offset+=b10.buffer_curr,b10.buffer_curr=0),0}function AW(a10,b10){if(b10.name)try{var d10=__require(fT),c10=d10.openSync(b10.name,"rs");return new ax(c10,b10)}catch{}return new ax(a10,b10)}var d6=new Array(3);function cz(a10,b10){Y.call(this,F(0)),this.log=function(a11){return 0},a10==1&&typeof console.log=="function"?this.log=console.log:a10==2&&typeof console.error=="function"?this.log=console.error:typeof console.log=="function"&&(this.log=console.log),this.flags=b10}cz.prototype.length=function(){return 0},cz.prototype.write=function(a10,b10,c10,d10){if(this.log){d10>0&&c10>=0&&c10+d10<=b10.length&&b10[c10+d10-1]==10&&d10--;var e10=F(d10);return aZ(gj(b10),c10,e10,0,d10),this.log(e10.toUtf16()),0}m(this.fd+jw)},cz.prototype.read=function(a10,b10,c10,d10){m(this.fd+": file descriptor is write only")},cz.prototype.close=function(){this.log=void 0};function d7(a10,b10){return b10==null&&(b10=d6.length),d6[b10]=a10,b10|0}function A$(a10,b10,c10){for(var d10={};b10;){switch(b10[1]){case 0:d10.rdonly=1;break;case 1:d10.wronly=1;break;case 2:d10.append=1;break;case 3:d10.create=1;break;case 4:d10.truncate=1;break;case 5:d10.excl=1;break;case 6:d10.binary=1;break;case 7:d10.text=1;break;case 8:d10.nonblock=1;break}b10=b10[2]}d10.rdonly&&d10.wronly&&m(a10+gf),d10.text&&d10.binary&&m(a10+fQ);var e10=lF(a10),f10=e10.device.open(e10.rest,d10);return d7(f10,void 0)}(function(){function a10(a11,b10){return cJ()?AW(a11,b10):new cz(a11,b10)}d7(a10(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:!0}),0),d7(a10(1,{buffered:2,wronly:1,isCharacterDevice:!0}),1),d7(a10(2,{buffered:2,wronly:1,isCharacterDevice:!0}),2)})();function AG(a10){var b10=d6[a10];b10.flags.wronly&&m(kc+a10+" is writeonly");var d10=null,c10={file:b10,offset:b10.flags.append?b10.length():0,fd:a10,opened:!0,out:!1,buffer_curr:0,buffer_max:0,buffer:new Uint8Array(ke),refill:d10};return bg[c10.fd]=c10,c10.fd}function ls(a10){var b10=d6[a10];b10.flags.rdonly&&m(kc+a10+" is readonly");var d10=b10.flags.buffered!==void 0?b10.flags.buffered:1,c10={file:b10,offset:b10.flags.append?b10.length():0,fd:a10,opened:!0,out:!0,buffer_curr:0,buffer:new Uint8Array(ke),buffered:d10};return bg[c10.fd]=c10,c10.fd}function AH(){for(var b10=0,a10=0;a10e10.buffer.length){var g10=new Uint8Array(e10.buffer_curr+b10.length);g10.set(e10.buffer),e10.buffer=g10}switch(e10.buffered){case 0:e10.buffer.set(b10,e10.buffer_curr),e10.buffer_curr+=b10.length,bB(a10);break;case 1:e10.buffer.set(b10,e10.buffer_curr),e10.buffer_curr+=b10.length,e10.buffer_curr>=e10.buffer.length&&bB(a10);break;case 2:var f10=b10.lastIndexOf(10);f10<0?(e10.buffer.set(b10,e10.buffer_curr),e10.buffer_curr+=b10.length,e10.buffer_curr>=e10.buffer.length&&bB(a10)):(e10.buffer.set(b10.subarray(0,f10+1),e10.buffer_curr),e10.buffer_curr+=f10+1,bB(a10),e10.buffer.set(b10.subarray(f10+1),e10.buffer_curr),e10.buffer_curr+=b10.length-f10-1);break}return 0}function AI(a10,b10,c10,d10){var b10=gC(b10);return AJ(a10,b10,c10,d10)}function gw(a10,b10,c10,d10){return AI(a10,be(b10),c10,d10)}function lt(a10,b10){var c10=String.fromCharCode(b10);return gw(a10,c10,0,1),0}function AK(a10,b10){return b10==0&&gz(),a10%b10}function cH(a10,b10){return+(dV(a10,b10,!1)!=0)}function AM(a10,b10){var d10=new Array(b10+1);d10[0]=a10;for(var c10=1;c10<=b10;c10++)d10[c10]=0;return d10}function AN(a10,b10){return a10[0]=aE,a10[1]=b10,0}function ay(a10){return a10 instanceof Array&&a10[0]==a10[0]>>>0?a10[0]:d1(a10)||d2(a10)?dF:a10 instanceof Function||typeof a10=="function"?247:a10&&a10.caml_custom?j2:cx}function z2(a10){var c10={};if(a10)for(var b10=1;b10=0?a10=e10:al("caml_register_global: cannot locate "+d10)}}U[a10+1]=b10,c10&&(U[c10]=b10)}function gB(a10,b10){return lu[a10]=b10,0}function AT(){G(fO)}function z(a10,b10){return b10>>>0>=n(a10)&&AT(),$(a10,b10)}function d5(a10){return a10.t&6&&cD(a10),a10.c}function AV(){return 2147483647/4|0}function AQ(){lw(U.Not_found)}function lz(a10){var b10=lE(H(a10));return b10===void 0&&AQ(),at(b10)}function AX(){if(p.crypto){if(p.crypto.getRandomValues){var a10=p.crypto.getRandomValues(new Int32Array(4));return[0,a10[0],a10[1],a10[2],a10[3]]}else if(p.crypto.randomBytes){var a10=new Int32Array(p.crypto.randomBytes(16).buffer);return[0,a10[0],a10[1],a10[2],a10[3]]}}var b10=new Date().getTime(),c10=b10^4294967295*Math.random();return[0,c10]}function bC(a10){for(var b10=1;a10&&a10.joo_tramp;)a10=a10.joo_tramp.apply(null,a10.joo_args),b10++;return a10}function r(a10,b10){return{joo_tramp:a10,joo_args:b10}}function lB(a10,b10){if(b10.fun)return a10.fun=b10.fun,0;if(typeof b10=="function")return a10.fun=b10,0;for(var c10=b10.length;c10--;)a10[c10]=b10[c10];return 0}function M(a10){{if(a10 instanceof Array)return a10;var b10;return p.RangeError&&a10 instanceof p.RangeError&&a10.message&&a10.message.match(/maximum call stack/i)||p.InternalError&&a10 instanceof p.InternalError&&a10.message&&a10.message.match(/too much recursion/i)?b10=U.Stack_overflow:a10 instanceof p.Error&&bh(f7)?b10=[0,bh(f7),a10]:b10=[0,U.Failure,at(String(a10))],a10 instanceof p.Error&&(b10.js_error=a10),b10}}function AZ(){return init_awareness(),__toCommonJS(awareness_exports)}function A0(){return(init_y_indexeddb(),__toCommonJS(y_indexeddb_exports)).IndexeddbPersistence}function A1(){return(init_quill2(),__toCommonJS(quill_exports)).default}function A2(){return require_quill_cursors()}function A3(){return(init_y_webrtc(),__toCommonJS(y_webrtc_exports)).WebrtcProvider}function A4(){return init_y_quill(),__toCommonJS(y_quill_exports)}function A5(){return init_yjs(),__toCommonJS(yjs_exports)}function Aw(a10){switch(a10[2]){case-8:case-11:case-12:return 1;default:return 0}}function Aa(a10){var b10=e;if(a10[0]==0){if(b10+=a10[1][1],a10.length==3&&a10[2][0]==0&&Aw(a10[1]))var f10=a10[2],g10=1;else var g10=2,f10=a10;b10+="(";for(var d10=g10;d10g10&&(b10+=jH);var c10=f10[d10];typeof c10=="number"?b10+=c10.toString():c10 instanceof aY||typeof c10=="string"?b10+=dE+c10.toString()+dE:b10+=kJ}b10+=")"}else a10[0]==q&&(b10+=a10[1]);return b10}function lg(a10){if(a10 instanceof Array&&(a10[0]==0||a10[0]==q)){var c10=bh(kO);if(c10)dU(c10,[a10,!1]);else{var d10=Aa(a10),b10=bh(kf);if(b10&&dU(b10,[0]),console.error(f_+d10),a10.js_error)throw a10.js_error}}else throw a10}function AS(){var c10=p.process;c10&&c10.on?c10.on("uncaughtException",function(a10,b10){lg(a10),c10.exit(2)}):p.addEventListener&&p.addEventListener(jz,function(a10){a10.error&&lg(a10.error)})}AS();function h(a10,b10){return(a10.l>=0?a10.l:a10.l=a10.length)==1?a10(b10):bf(a10,[b10])}function i(a10,b10,c10){return(a10.l>=0?a10.l:a10.l=a10.length)==2?a10(b10,c10):bf(a10,[b10,c10])}function y(a10,b10,c10,d10){return(a10.l>=0?a10.l:a10.l=a10.length)==3?a10(b10,c10,d10):bf(a10,[b10,c10,d10])}function fJ(a10,b10,c10,d10,e10,f10){return(a10.l>=0?a10.l:a10.l=a10.length)==5?a10(b10,c10,d10,e10,f10):bf(a10,[b10,c10,d10,e10,f10])}function zU(a10,b10,c10,d10,e10,f10,g10,h10){return(a10.l>=0?a10.l:a10.l=a10.length)==7?a10(b10,c10,d10,e10,f10,g10,h10):bf(a10,[b10,c10,d10,e10,f10,g10,h10])}var A_=void 0;Ab();var d_=[q,k3,-1],gH=[q,j_,-2],b4=[q,gg,-3],cL=[q,jK,-4],az=[q,jN,-7],gF=[q,kZ,-8],gG=[q,kv,-9],f=[q,kF,-11],b5=[q,kS,-12],zT=[4,0,0,0,[12,45,[4,0,0,0,0]]],ex=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,k1,[4,0,0,0,[12,45,[4,0,0,0,[11,kX,[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],jb=ge,bs="content",jh="columns",ji="rows",fD=j0,fE=ge,jj=bu,jk="page_content";as(11,b5,kS),as(10,f,kF),as(9,[q,kK,-10],kK),as(8,gG,kv),as(7,gF,kZ),as(6,az,jN),as(5,[q,j5,-6],j5),as(4,[q,kj,-5],kj),as(3,cL,jK),as(2,b4,gg),as(1,gH,j_),as(0,d_,k3);var lQ="output_substring",lM=ba,lI="true",lJ="false",lU="CamlinternalLazy.Undefined",lY="option is None",l1="\\\\",l2="\\'",l3="\\b",l4="\\t",l5="\\n",l6="\\r",mc="List.init",l$="hd",mn="String.blit / Bytes.blit_string",mm="Bytes.blit",ml="String.sub / Bytes.sub",mw="String.contains_from / Bytes.contains_from",mC="Array.blit",mB="Array.sub",mz="Array.init",mJ=[0,"set.ml",570,18],mF=dM,mG=dM,mH=dM,mI=dM,mQ="Map.remove_min_elt",mM=dQ,mN=dQ,mO=dQ,mP=dQ,mR="Stdlib.Stack.Empty",mV="Stdlib.Queue.Empty",m7="Buffer.add_substring/add_subbytes",m4="Buffer.add: cannot grow buffer",m3=[0,jq,93,2],m2=[0,jq,94,2],m0="Buffer.sub",ng="%c",nh="%s",ni=jR,nj=jF,nk=k5,nl=jL,nm="%f",nn="%B",no="%{",np="%}",nq="%(",nr="%)",ns="%a",nt="%t",nu="%?",nv="%r",nw="%_r",nx=[0,L,850,23],nI=[0,L,814,21],nA=[0,L,815,21],nJ=[0,L,818,21],nB=[0,L,819,21],nK=[0,L,822,19],nC=[0,L,823,19],nL=[0,L,826,22],nD=[0,L,827,22],nM=[0,L,831,30],nE=[0,L,832,30],nG=[0,L,836,26],ny=[0,L,837,26],nH=[0,L,846,28],nz=[0,L,847,28],nF=[0,L,851,23],oY=[0,L,1558,4],oZ="Printf: bad conversion %[",o0=[0,L,1626,39],o1=[0,L,1649,31],o2=[0,L,1650,31],o3="Printf: bad conversion %_",o4=j4,o5=kI,o6=j4,o7=kI,o$=[0,[11,"invalid box description ",[3,0,0]],"invalid box description %S"],o_=[0,0,4],oT=fS,oR="neg_infinity",oS=kd,oQ=ba,oL=[0,js],oz="%+nd",oA="% nd",oC="%+ni",oD="% ni",oE="%nx",oF="%#nx",oG="%nX",oH="%#nX",oI="%no",oJ="%#no",oy="%nd",oB=k5,oK="%nu",ol="%+ld",om="% ld",oo="%+li",op="% li",oq="%lx",or="%#lx",os="%lX",ot="%#lX",ou="%lo",ov="%#lo",ok="%ld",on=jF,ow="%lu",n9="%+Ld",n_="% Ld",oa="%+Li",ob="% Li",oc="%Lx",od="%#Lx",oe="%LX",of="%#LX",og="%Lo",oh="%#Lo",n8="%Ld",n$=jL,oi="%Lu",nV="%+d",nW="% d",nY="%+i",nZ="% i",n0="%x",n1="%#x",n2="%X",n3="%#X",n4="%o",n5="%#o",nU=fM,nX=jR,n6=km,m_="@]",m$="@}",na="@?",nb=`@ -`,nc="@.",nd="@@",ne="@%",nf="@",nN="CamlinternalFormat.Type_mismatch",pe=e,pf=[0,[11,jH,[2,0,[2,0,0]]],", %s%s"],pN=[0,[11,f_,[2,0,[12,10,0]]],kr],pO=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],`Fatal error in uncaught exception handler: exception %s -`],pM="Fatal error: out of memory in uncaught exception handler",pJ=[0,[11,f_,[2,0,[12,10,0]]],kr],pD=[0,[2,0,[12,10,0]],`%s -`],pE=[0,[11,j3,0],j3],pu="Raised at",pv="Re-raised at",pw="Raised by primitive operation at",px="Called from",py=" (inlined)",pA=e,pz=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,", line ",[4,0,0,0,[11,k1,zT]]]]]]]]]],'%s %s in file "%s"%s, line %d, characters %d-%d'],pB=[0,[2,0,[11," unknown location",0]],"%s unknown location"],pn="Out of memory",po="Stack overflow",pp="Pattern matching failed",pq="Assertion failed",pr="Undefined recursive module",ph=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],pi=e,pj=e,pk=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],pd=[0,[4,0,0,0,0],fM],pb=[0,[3,0,0],"%S"],pc=kJ,pG=[0,e,`(Cannot print locations: +`;)ins=ins.slice(0,-1);return delta[delta.length-1]={insert:ins},ins.length===0&&delta.pop(),delta}}return delta},updateCursor=(quillCursors,aw,clientId,doc2,type)=>{try{if(aw&&aw.cursor&&clientId!==doc2.clientID){let user=aw.user||{},color=user.color||"#ffa500",name=user.name||`User: ${clientId}`;quillCursors.createCursor(clientId.toString(),name,color);let anchor=createAbsolutePositionFromRelativePosition(createRelativePositionFromJSON(aw.cursor.anchor),doc2),head=createAbsolutePositionFromRelativePosition(createRelativePositionFromJSON(aw.cursor.head),doc2);anchor&&head&&anchor.type===type&&quillCursors.moveCursor(clientId.toString(),{index:anchor.index,length:head.index-anchor.index})}else quillCursors.removeCursor(clientId.toString())}catch(err){console.error(err)}},QuillBinding=class{constructor(type,quill,awareness){let doc2=type.doc;this.type=type,this.doc=doc2,this.quill=quill;let quillCursors=quill.getModule("cursors")||null;this.quillCursors=quillCursors,this._negatedUsedFormats={},this.awareness=awareness,this._awarenessChange=({added,removed,updated})=>{let states=awareness.getStates();added.forEach(id2=>{updateCursor(quillCursors,states.get(id2),id2,doc2,type)}),updated.forEach(id2=>{updateCursor(quillCursors,states.get(id2),id2,doc2,type)}),removed.forEach(id2=>{quillCursors.removeCursor(id2.toString())})},this._typeObserver=event=>{if(event.transaction.origin!==this){let eventDelta=event.delta,delta=[];for(let i=0;i{if(delta&&delta.ops){let ops=delta.ops;ops.forEach(op=>{if(op.attributes!==void 0)for(let key in op.attributes)this._negatedUsedFormats[key]===void 0&&(this._negatedUsedFormats[key]=!1)}),origin!==this&&doc2.transact(()=>{type.applyDelta(ops)},this)}if(awareness&&quillCursors){let sel=quill.getSelection(),aw=awareness.getLocalState();if(sel===null)awareness.getLocalState()!==null&&awareness.setLocalStateField("cursor",null);else{let anchor=createRelativePositionFromTypeIndex(type,sel.index),head=createRelativePositionFromTypeIndex(type,sel.index+sel.length);(!aw||!aw.cursor||!compareRelativePositions(anchor,aw.cursor.anchor)||!compareRelativePositions(head,aw.cursor.head))&&awareness.setLocalStateField("cursor",{anchor,head})}awareness.getStates().forEach((aw2,clientId)=>{updateCursor(quillCursors,aw2,clientId,doc2,type)})}},quill.on("editor-change",this._quillObserver),quill.setContents(type.toDelta(),this),quillCursors!==null&&awareness&&(awareness.getStates().forEach((aw,clientId)=>{updateCursor(quillCursors,aw,clientId,doc2,type)}),awareness.on("change",this._awarenessChange))}destroy(){this.type.unobserve(this._typeObserver),this.quill.off("editor-change",this._quillObserver),this.awareness&&this.awareness.off("change",this._awarenessChange)}}}});(function(a){typeof globalThis!="object"&&(this?b():(a.defineProperty(a.prototype,"_T_",{configurable:!0,get:b}),_T_));function b(){var b2=this||self;b2.globalThis=b2,delete a.prototype._T_}})(Object);(function(a){require_quill_core(),require_quill_bubble(),require_quill_snow()})(globalThis);(function(p){"use strict";var w=3850876,af="0",aI=" ",gA="compare: functional value",gi="mkdir",lo="synced",cP=1e3,la="delete",Y="vendor/lwd/lib/lwd/lwd_seq.pp.ml",kI="@[",kV="console",lw="window",a2="int_of_string",gb="fs",kw="%u",lv="/static/",k$="%i",lF="%ni",a1=255,gh=749039939,kH="Assert_failure",kv="camlinternalMod.ml",aJ=737455525,k_="0x",ku=32752,lE=218,k9=57343,kt="End_of_file",lu="OCAMLRUNPARAM",kG=253,k8=": closedir failed",lD="Out_of_memory",kF=553,k7="Not_found",gD="Failure",d6="Unix.Unix_error",k6="style",bE=244,ln="^",b8="text",kU="length",lm="green",gw="ENOTDIR",kE="Lwd_seq.rank: node is marked",bD=936573133,k5="%Li",kd="Invalid_argument",k4="flex",d4=254,b9="+",dY="Set.bal",lC=", characters ",aH=16777215,ks=858694086,kD=120,kC=1027,cL=1024,d1="Map.bal",bg=246,ll="Pervasives.do_at_exit",lt=389604418,kr=65536,kc="submit",c="vendor/brr_lwd_ui/examples/yjs/main.ml",U=16620,gv=15,dW=512,ge=-588596599,k3=", ",kT="closedir",lB="Match_failure",ka="%li",kb=1026,j$=157,j_="b",ga="nan",e="",f$="rmdir",gg="Fatal error: exception ",kq="infinity",L="camlinternalFormat.ml",lj=571,lk="fd ",kR="append",kS=": ",j9=174,q=248,kp="em",ko="data",kQ=224,aL=24029,li=240,kn="Sys_error",as=128,gu="vendor/brr_lwd_ui/bindings/yjs/doc.ml",ls="ENOTEMPTY",lA="EEXIST",gz=1255,k2="checkbox",dV="value",kP="px",gn=" : flags Open_text and Open_binary are not compatible",gt="e",kB="Stack_overflow",gm=": Not a directory",gs="ENOENT",gd=-605101559,T=15681,kO="Undefined_recursive_module",lh="Array",kN=2147483647,lg=544,aA=32768,dX="table",cO="string",km=2048,lr=-48,j8=" : is a directory",kl="@{",k1="error",lf="Division_by_zero",j7="classList",bf=".",kk=`(Program not linked with -g, cannot print stack backtrace) +`,bh=63,bB="name",lq="red",be=737456202,gc=" : file already exists",bz=128,d5=": No such file or directory",kj="vendor/lwd/lib/brr-lwd/elwd.ml",le=255,dU="lwd-to-remove",cM=256,dT="checked",ki="id",cN=-976970511,gr=100,f_="index out of bounds",lp=-937474657,aK="/",kM="height: ",gl=504440814,d3=252,f9="%d",k0="lwdui-virtual-table-row",kY="bold",kZ=": file descriptor already closed",bA="-",f8="EBADF",kh="changes",a0=951901561,kg=102,gq=-97,lz="Printexc.handle_uncaught_exception",kX=12520,gC=" : flags Open_rdonly and Open_wronly are not compatible",a="vendor/lwd/lib/lwd/lwd_table.ml",kL=499,gy=756711075,kA=`Fatal error: exception %s +`,gp=4100401,ly="class",j6="\xE2\x9D\x8C",aZ=250,kf=199,d0="bool",gk=82908052,gB="kind",bC=611392745,go="cell",kK=">",ld="([^/]+)",kz="input",gf="jsError",j5=103,gj=127,d2='"',aB=65535,gx=737308346,ke="documentElement",kJ="Sys_blocked_io",kW=56320,b="vendor/lwd/lib/lwd/lwd.ml",ky="not implemented",lc="Form submitted:",lx="_",f7="target",kx="rem",dZ="_bigarr02",lb=-101336657;function A2(a10,b10,c10,d10,e10){if(d10<=b10)for(var f10=1;f10<=e10;f10++)c10[d10+f10]=a10[b10+f10];else for(var f10=e10;f10>=1;f10--)c10[d10+f10]=a10[b10+f10];return 0}function A3(a10,b10,c10){var d10=new Array(c10+1);d10[0]=0;for(var e10=1,f10=b10+1;e10<=c10;e10++,f10++)d10[e10]=a10[f10];return d10}function gE(a10,b10,c10){return a10[1]===b10?(a10[1]=c10,1):0}function A4(a10,b10){var c10=a10[1];return a10[1]+=b10,c10}function gF(a10){return a10[1]}function mm(a10){var b10=p.process;if(b10&&b10.env&&b10.env[a10]!=null)return b10.env[a10];if(p.jsoo_static_env&&p.jsoo_static_env[a10])return p.jsoo_static_env[a10]}var gZ=0;(function(){var c10=mm(lu);if(c10!==void 0)for(var b10=c10.split(","),a10=0;a10a10.hi?1:this.hia10.mi?1:this.mia10.lo?1:this.loc10?1:b10a10.mi?1:this.mia10.lo?1:this.lo>24),c10=-this.hi+(b10>>24);return new d(a10,b10,c10)},d.prototype.add=function(a10){var b10=this.lo+a10.lo,c10=this.mi+a10.mi+(b10>>24),e10=this.hi+a10.hi+(c10>>24);return new d(b10,c10,e10)},d.prototype.sub=function(a10){var b10=this.lo-a10.lo,c10=this.mi-a10.mi+(b10>>24),e10=this.hi-a10.hi+(c10>>24);return new d(b10,c10,e10)},d.prototype.mul=function(a10){var b10=this.lo*a10.lo,c10=(b10*l0|0)+this.mi*a10.lo+this.lo*a10.mi,e10=(c10*l0|0)+this.hi*a10.lo+this.mi*a10.mi+this.lo*a10.hi;return new d(b10,c10,e10)},d.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0},d.prototype.isNeg=function(){return this.hi<<16<0},d.prototype.and=function(a10){return new d(this.lo&a10.lo,this.mi&a10.mi,this.hi&a10.hi)},d.prototype.or=function(a10){return new d(this.lo|a10.lo,this.mi|a10.mi,this.hi|a10.hi)},d.prototype.xor=function(a10){return new d(this.lo^a10.lo,this.mi^a10.mi,this.hi^a10.hi)},d.prototype.shift_left=function(a10){return a10=a10&63,a10==0?this:a10<24?new d(this.lo<>24-a10,this.hi<>24-a10):a10<48?new d(0,this.lo<>48-a10):new d(0,0,this.lo<>a10|this.mi<<24-a10,this.mi>>a10|this.hi<<24-a10,this.hi>>a10):a10<48?new d(this.mi>>a10-24|this.hi<<48-a10,this.hi>>a10-24,0):new d(this.hi>>a10-48,0,0)},d.prototype.shift_right=function(a10){if(a10=a10&63,a10==0)return this;var c10=this.hi<<16>>16;if(a10<24)return new d(this.lo>>a10|this.mi<<24-a10,this.mi>>a10|c10<<24-a10,this.hi<<16>>a10>>>16);var b10=this.hi<<16>>31;return a10<48?new d(this.mi>>a10-24|this.hi<<48-a10,this.hi<<16>>a10-24>>16,b10&aB):new d(this.hi<<16>>a10-32,b10,b10)},d.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23,this.mi=(this.mi<<1|this.lo>>23)&aH,this.lo=this.lo<<1&aH},d.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&aH,this.mi=(this.mi>>>1|this.hi<<23)&aH,this.hi=this.hi>>>1},d.prototype.udivmod=function(a10){for(var e10=0,c10=this.copy(),b10=a10.copy(),f10=new d(0,0,0);c10.ucompare(b10)>0;)e10++,b10.lsl1();for(;e10>=0;)e10--,f10.lsl1(),c10.ucompare(b10)>=0&&(f10.lo++,c10=c10.sub(b10)),b10.lsr1();return{quotient:f10,modulus:c10}},d.prototype.div=function(a10){var b10=this;a10.isZero()&&mf();var d10=b10.hi^a10.hi;b10.hi&aA&&(b10=b10.neg()),a10.hi&aA&&(a10=a10.neg());var c10=b10.udivmod(a10).quotient;return d10&aA&&(c10=c10.neg()),c10},d.prototype.mod=function(a10){var b10=this;a10.isZero()&&mf();var d10=b10.hi;b10.hi&aA&&(b10=b10.neg()),a10.hi&aA&&(a10=a10.neg());var c10=b10.udivmod(a10).modulus;return d10&aA&&(c10=c10.neg()),c10},d.prototype.toInt=function(){return this.lo|this.mi<<24},d.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo},d.prototype.toArray=function(){return[this.hi>>8,this.hi&a1,this.mi>>16,this.mi>>8&a1,this.mi&a1,this.lo>>16,this.lo>>8&a1,this.lo&a1]},d.prototype.lo32=function(){return this.lo|(this.mi&a1)<<24},d.prototype.hi32=function(){return this.mi>>>8&aB|this.hi<<16};function Bv(a10,b10){return new d(a10&aH,a10>>>24&a1|(b10&aB)<<8,b10>>>16&aB)}function gQ(a10){return a10.hi32()}function gR(a10){return a10.lo32()}function cR(){G(f_)}var A6=dZ;function bi(a10,b10,c10,d10){this.kind=a10,this.layout=b10,this.dims=c10,this.data=d10}bi.prototype.caml_custom=A6,bi.prototype.offset=function(a10){var c10=0;if(typeof a10=="number"&&(a10=[a10]),a10 instanceof Array||G("bigarray.js: invalid offset"),this.dims.length!=a10.length&&G("Bigarray.get/set: bad number of dimensions"),this.layout==0)for(var b10=0;b10=this.dims[b10])&&cR(),c10=c10*this.dims[b10]+a10[b10];else for(var b10=this.dims.length-1;b10>=0;b10--)(a10[b10]<1||a10[b10]>this.dims[b10])&&cR(),c10=c10*this.dims[b10]+(a10[b10]-1);return c10},bi.prototype.get=function(a10){switch(this.kind){case 7:var d10=this.data[a10*2+0],b10=this.data[a10*2+1];return Bv(d10,b10);case 10:case 11:var e10=this.data[a10*2+0],c10=this.data[a10*2+1];return[d4,e10,c10];default:return this.data[a10]}},bi.prototype.set=function(a10,b10){switch(this.kind){case 7:this.data[a10*2+0]=gR(b10),this.data[a10*2+1]=gQ(b10);break;case 10:case 11:this.data[a10*2+0]=b10[1],this.data[a10*2+1]=b10[2];break;default:this.data[a10]=b10;break}return 0},bi.prototype.fill=function(a10){switch(this.kind){case 7:var c10=gR(a10),e10=gQ(a10);if(c10==e10)this.data.fill(c10);else for(var b10=0;b10e10)return 1;if(d10!=e10){if(!b10)return NaN;if(d10==d10)return 1;if(e10==e10)return-1}}break;case 7:for(var c10=0;c10a10.data[c10+1])return 1;if(this.data[c10]>>>0>>0)return-1;if(this.data[c10]>>>0>a10.data[c10]>>>0)return 1}break;case 2:case 3:case 4:case 5:case 6:case 8:case 9:case 12:for(var c10=0;c10a10.data[c10])return 1}break}return 0};function b_(a10,b10,c10,d10){this.kind=a10,this.layout=b10,this.dims=c10,this.data=d10}b_.prototype=new bi,b_.prototype.offset=function(a10){return typeof a10!="number"&&(a10 instanceof Array&&a10.length==1?a10=a10[0]:G("Ml_Bigarray_c_1_1.offset")),(a10<0||a10>=this.dims[0])&&cR(),a10},b_.prototype.get=function(a10){return this.data[a10]},b_.prototype.set=function(a10,b10){return this.data[a10]=b10,0},b_.prototype.fill=function(a10){return this.data.fill(a10),0};function gG(a10,b10,c10,d10){var e10=lK(a10);return d8(c10)*e10!=d10.length&&G("length doesn't match dims"),b10==0&&c10.length==1&&e10==1?new b_(a10,b10,c10,d10):new bi(a10,b10,c10,d10)}function gT(a10){return a10.slice(1)}function A5(a10,b10,c10){var d10=gT(c10),e10=lI(a10,d8(d10));return gG(a10,b10,d10,e10)}function cS(a10,b10,c10){return a10.set(a10.offset(b10),c10),0}function c0(a10,b10,c10){var d10=String.fromCharCode;if(b10==0&&c10<=4096&&c10==a10.length)return d10.apply(null,a10);for(var f10=e;0=c10.l||c10.t==2&&e10>=c10.c.length))c10.c=a10.t==4?c0(a10.c,b10,e10):b10==0&&a10.c.length==e10?a10.c:a10.c.substr(b10,e10),c10.t=c10.c.length==c10.l?0:2;else if(c10.t==2&&d10==c10.c.length)c10.c+=a10.t==4?c0(a10.c,b10,e10):b10==0&&a10.c.length==e10?a10.c:a10.c.substr(b10,e10),c10.t=c10.c.length==c10.l?0:2;else{c10.t!=4&&ea(c10);var g10=a10.c,h10=c10.c;if(a10.t==4)if(d10<=b10)for(var f10=0;f10=0;f10--)h10[d10+f10]=g10[b10+f10];else{for(var i10=Math.min(e10,g10.length-b10),f10=0;f10>=1,a10==0)return d10;b10+=b10,c10++,c10==9&&b10.slice(0,1)}}function cV(a10){a10.t==2?a10.c+=b$(a10.l-a10.c.length,"\0"):a10.c=c0(a10.c,0,a10.c.length),a10.t=0}function g2(a10){if(a10.length<24){for(var b10=0;b10gj)return!1;return!0}else return!/[^\x00-\x7f]/.test(a10)}function mk(a10){for(var k10=e,d10=e,h10,g10,i10,b10,c10=0,j10=a10.length;c10dW?(d10.substr(0,1),k10+=d10,d10=e,k10+=a10.slice(c10,f10)):d10+=a10.slice(c10,f10),f10==j10)break;c10=f10}b10=1,++c10=55295&&b10<57344)&&(b10=2)):(b10=3,++c101114111)&&(b10=3)))))),b10<4?(c10-=b10,d10+="\uFFFD"):b10>aB?d10+=String.fromCharCode(55232+(b10>>10),kW+(b10&1023)):d10+=String.fromCharCode(b10),d10.length>cL&&(d10.substr(0,1),k10+=d10,d10=e)}return k10+d10}function a3(a10,b10,c10){this.t=a10,this.c=b10,this.l=c10}a3.prototype.toString=function(){switch(this.t){case 9:return this.c;default:cV(this);case 0:if(g2(this.c))return this.t=9,this.c;this.t=8;case 8:return this.c}},a3.prototype.toUtf16=function(){var a10=this.toString();return this.t==9?a10:mk(a10)},a3.prototype.slice=function(){var a10=this.t==4?this.c.slice():this.c;return new a3(this.t,a10,this.l)};function lN(a10){return new a3(0,a10,a10.length)}function aM(a10){return a10}function bj(a10){return lN(a10)}function cT(a10,b10,c10,d10,e10){return a4(bj(a10),b10,c10,d10,e10),0}function d9(){G(f_)}function bG(a10,b10){switch(a10.t&6){default:if(b10>=a10.c.length)return 0;case 0:return a10.c.charCodeAt(b10);case 4:return a10.c[b10]}}function A_(a10,b10){return b10>>>0>=a10.l&&d9(),bG(a10,b10)}function bH(a10){return new d(a10[7]<<0|a10[6]<<8|a10[5]<<16,a10[4]<<0|a10[3]<<8|a10[2]<<16,a10[1]<<0|a10[0]<<8)}function A$(a10,b10){b10>>>0>=a10.l-7&&d9();for(var d10=new Array(8),c10=0;c10<8;c10++)d10[7-c10]=bG(a10,b10+c10);return bH(d10)}function B(a10,b10,c10){if(c10&=a1,a10.t!=4){if(b10==a10.c.length)return a10.c+=String.fromCharCode(c10),b10+1==a10.l&&(a10.t=0),0;ea(a10)}return a10.c[b10]=c10,0}function at(a10,b10,c10){return b10>>>0>=a10.l&&d9(),B(a10,b10,c10)}function bI(a10){return a10.toArray()}function lO(a10,b10,c10){b10>>>0>=a10.l-7&&d9();for(var e10=bI(c10),d10=0;d10<8;d10++)B(a10,b10+7-d10,e10[d10]);return 0}function bk(d10,c10){var f10=d10.l>=0?d10.l:d10.l=d10.length,e10=c10.length,b10=f10-e10;if(b10==0)return d10.apply(null,c10);if(b10<0){var a10=d10.apply(null,c10.slice(0,f10));return typeof a10!="function"?a10:bk(a10,c10.slice(f10))}else{switch(b10){case 1:{var a10=function(a11){for(var f11=new Array(e10+1),b11=0;b11>>0>=a10.length-1&&cR(),a10}function Ba(a10){return isFinite(a10)?Math.abs(a10)>=22250738585072014e-324?0:a10!=0?1:2:isNaN(a10)?4:3}function l5(a10){return a10==245?1:0}var Cd=Math.log2&&Math.log2(11235582092889474e291)==1020;function Cc(a10){if(Cd)return Math.floor(Math.log2(a10));var b10=0;if(a10==0)return-1/0;if(a10>=1)for(;a10>=2;)a10/=2,b10++;else for(;a10<1;)a10*=2,b10--;return b10}function gN(a10){var b10=new Float32Array(1);b10[0]=a10;var c10=new Int32Array(b10.buffer);return c10[0]|0}function ao(a10,b10,c10){return new d(a10,b10,c10)}function ed(a10){if(!isFinite(a10))return isNaN(a10)?ao(1,0,ku):a10>0?ao(0,0,ku):ao(0,0,65520);var f10=a10==0&&1/a10==-1/0?aA:a10>=0?0:aA;f10&&(a10=-a10);var b10=Cc(a10)+1023;b10<=0?(b10=0,a10/=Math.pow(2,-kb)):(a10/=Math.pow(2,b10-kC),a10<16&&(a10*=2,b10-=1),b10==0&&(a10/=2));var d10=Math.pow(2,24),c10=a10|0;a10=(a10-c10)*d10;var e10=a10|0;a10=(a10-e10)*d10;var g10=a10|0;return c10=c10&gv|f10|b10<<4,ao(g10,e10,c10)}function lM(a10,b10,c10){if(a10.write(32,b10.dims.length),a10.write(32,b10.kind|b10.layout<<8),b10.caml_custom==dZ)for(var d10=0;d10>4;if(d10==2047)return f10|g10|c10&gv?NaN:c10&aA?-1/0:1/0;var e10=Math.pow(2,-24),b10=(f10*e10+g10)*e10+(c10&gv);return d10>0?(b10+=16,b10*=Math.pow(2,d10-kC)):b10*=Math.pow(2,-kb),c10&aA&&(b10=-b10),b10}function S(a10){V.Failure||(V.Failure=[q,gD,-3]),gY(V.Failure,a10)}function lJ(a10,b10,c10){var k10=a10.read32s();(k10<0||k10>16)&&S("input_value: wrong number of bigarray dimensions");var r10=a10.read32s(),l10=r10&a1,q10=r10>>8&1,j10=[];if(c10==dZ)for(var d10=0;d10>>17,b10=cZ(b10,461845907),a10^=b10,a10=a10<<13|a10>>>19,(a10+(a10<<2)|0)+-430675100|0}function Bp(a10,b10){return a10=W(a10,gR(b10)),a10=W(a10,gQ(b10)),a10}function gL(a10,b10){return Bp(a10,ed(b10))}function lL(a10){var c10=d8(a10.dims),d10=0;switch(a10.kind){case 2:case 3:case 12:c10>cM&&(c10=cM);var e10=0,b10=0;for(b10=0;b10+4<=a10.data.length;b10+=4)e10=a10.data[b10+0]|a10.data[b10+1]<<8|a10.data[b10+2]<<16|a10.data[b10+3]<<24,d10=W(d10,e10);switch(e10=0,c10&3){case 3:e10=a10.data[b10+2]<<16;case 2:e10|=a10.data[b10+1]<<8;case 1:e10|=a10.data[b10+0],d10=W(d10,e10)}break;case 4:case 5:c10>bz&&(c10=bz);var e10=0,b10=0;for(b10=0;b10+2<=a10.data.length;b10+=2)e10=a10.data[b10+0]|a10.data[b10+1]<<16,d10=W(d10,e10);c10&1&&(d10=W(d10,a10.data[b10]));break;case 6:c10>64&&(c10=64);for(var b10=0;b1064&&(c10=64);for(var b10=0;b1032&&(c10=32),c10*=2;for(var b10=0;b1064&&(c10=64);for(var b10=0;b1032&&(c10=32);for(var b10=0;b100?f10(b10,a10,d10):f10(a10,b10,d10);if(d10&&e10!=e10)return c10;if(+e10!=+e10)return+e10;if(e10|0)return e10|0}return c10}function ef(a10){return typeof a10=="string"&&!/[^\x00-\xff]/.test(a10)}function ee(a10){return a10 instanceof a3}function lQ(a10){if(typeof a10=="number")return cP;if(ee(a10))return d3;if(ef(a10))return 1252;if(a10 instanceof Array&&a10[0]===a10[0]>>>0&&a10[0]<=le){var b10=a10[0]|0;return b10==d4?0:b10}else{if(a10 instanceof String)return kX;if(typeof a10=="string")return kX;if(a10 instanceof Number)return cP;if(a10&&a10.caml_custom)return gz;if(a10&&a10.compare)return 1256;if(typeof a10=="function")return 1247;if(typeof a10=="symbol")return 1251}return 1001}function l3(a10,b10){return a10b10?1:0}function A9(a10,b10){return a10.t&6&&cV(a10),b10.t&6&&cV(b10),a10.cb10.c?1:0}function d$(a10,b10,c10){for(var f10=[];;){if(!(c10&&a10===b10)){var e10=lQ(a10);if(e10==aZ){a10=a10[1];continue}var g10=lQ(b10);if(g10==aZ){b10=b10[1];continue}if(e10!==g10)return e10==cP?g10==gz?lP(a10,b10,-1,c10):-1:g10==cP?e10==gz?lP(b10,a10,1,c10):1:e10b10)return 1;if(a10!=b10){if(!c10)return NaN;if(a10==a10)return 1;if(b10==b10)return-1}break;case 1001:if(a10b10)return 1;if(a10!=b10){if(!c10)return NaN;if(a10==a10)return 1;if(b10==b10)return-1}break;case 1251:if(a10!==b10)return c10?1:NaN;break;case 1252:var a10=a10,b10=b10;if(a10!==b10){if(a10b10)return 1}break;case 12520:var a10=a10.toString(),b10=b10.toString();if(a10!==b10){if(a10b10)return 1}break;case 246:case 254:default:if(l5(e10)){G("compare: continuation value");break}if(a10.length!=b10.length)return a10.length1&&f10.push(a10,b10,1);break}}if(f10.length==0)return 0;var h10=f10.pop();b10=f10.pop(),a10=f10.pop(),h10+10)if(b10==0&&(c10>=a10.l||a10.t==2&&c10>=a10.c.length))d10==0?(a10.c=e,a10.t=2):(a10.c=b$(c10,String.fromCharCode(d10)),a10.t=c10==a10.l?0:2);else for(a10.t!=4&&ea(a10),c10+=b10;b100&&b10===b10||(a10=a10.replace(/_/g,e),b10=+a10,a10.length>0&&b10===b10||/^[+-]?nan$/i.test(a10)))return b10;var c10=/^ *([+-]?)0x([0-9a-f]+)\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(a10);if(c10){var d10=c10[3].replace(/0+$/,e),g10=parseInt(c10[1]+c10[2]+d10,16),f10=(c10[5]|0)-4*d10.length;return b10=g10*Math.pow(2,f10),b10}if(/^\+?inf(inity)?$/i.test(a10))return 1/0;if(/^-inf(inity)?$/i.test(a10))return-1/0;S("float_of_string")}function gX(a10){a10=a10;var e10=a10.length;e10>31&&G("format_int: format too long");for(var b10={justify:b9,signstyle:bA,filler:aI,alternate:!1,base:0,signedconv:!1,width:0,uppercase:!1,sign:1,prec:-1,conv:"f"},d10=0;d10=0&&c10<=9;)b10.width=b10.width*10+c10,d10++;d10--;break;case".":for(b10.prec=0,d10++;c10=a10.charCodeAt(d10)-48,c10>=0&&c10<=9;)b10.prec=b10.prec*10+c10,d10++;d10--;case"d":case"i":b10.signedconv=!0;case"u":b10.base=10;break;case"x":b10.base=16;break;case"X":b10.base=16,b10.uppercase=!0;break;case"o":b10.base=8;break;case"e":case"f":case"g":b10.signedconv=!0,b10.conv=c10;break;case"E":case"F":case"G":b10.signedconv=!0,b10.uppercase=!0,b10.conv=c10.toLowerCase();break}}return b10}function gJ(a10,b10){a10.uppercase&&(b10=b10.toUpperCase());var f10=b10.length;a10.signedconv&&(a10.sign<0||a10.signstyle!=bA)&&f10++,a10.alternate&&(a10.base==8&&(f10+=1),a10.base==16&&(f10+=2));var c10=e;if(a10.justify==b9&&a10.filler==aI)for(var d10=f10;d1020?(c11-=20,a11/=Math.pow(10,c11),a11+=new Array(c11+1).join(af),b11>0&&(a11=a11+bf+new Array(b11+1).join(af)),a11):a11.toFixed(b11)}var c10,f10=gX(a10),e10=f10.prec<0?6:f10.prec;if((b10<0||b10==0&&1/b10==-1/0)&&(f10.sign=-1,b10=-b10),isNaN(b10))c10=ga,f10.filler=aI;else if(!isFinite(b10))c10="inf",f10.filler=aI;else switch(f10.conv){case"e":var c10=b10.toExponential(e10),d10=c10.length;c10.charAt(d10-3)==gt&&(c10=c10.slice(0,d10-1)+af+c10.slice(d10-1));break;case"f":c10=j10(b10,e10);break;case"g":e10=e10||1,c10=b10.toExponential(e10-1);var i10=c10.indexOf(gt),h10=+c10.slice(i10+1);if(h10<-4||b10>=1e21||b10.toFixed(0).length>e10){for(var d10=i10-1;c10.charAt(d10)==af;)d10--;c10.charAt(d10)==bf&&d10--,c10=c10.slice(0,d10+1)+c10.slice(i10),d10=c10.length,c10.charAt(d10-3)==gt&&(c10=c10.slice(0,d10-1)+af+c10.slice(d10-1));break}else{var g10=e10;if(h10<0)g10-=h10+1,c10=b10.toFixed(g10);else for(;c10=b10.toFixed(g10),c10.length>e10+1;)g10--;if(g10){for(var d10=c10.length-1;c10.charAt(d10)==af;)d10--;c10.charAt(d10)==bf&&d10--,c10=c10.slice(0,d10+1)}}break}return gJ(f10,c10)}function ec(a10,b10){if(a10==f9)return e+b10;var c10=gX(a10);b10<0&&(c10.signedconv?(c10.sign=-1,b10=-b10):b10>>>=0);var d10=b10.toString(c10.base);if(c10.prec>=0){c10.filler=aI;var f10=c10.prec-d10.length;f10>0&&(d10=b$(f10,af)+d10)}return gJ(c10,d10)}var BX=0;function ag(){return BX++}function H(a10){return g2(a10)?a10:mk(a10)}function c1(){return typeof p.process<"u"&&typeof p.process.versions<"u"&&typeof p.process.versions.node<"u"}function Ce(){function a10(a11){if(a11.charAt(0)===aK)return[e,a11.substring(1)]}function b10(a11){var h10=/^([a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?([\\/])?([\s\S]*?)$/,b11=h10.exec(a11),c10=b11[1]||e,f10=!!(c10&&c10.charAt(1)!==":");if(b11[2]||f10){var d10=b11[1]||e,g10=b11[2]||e;return[d10,a11.substring(d10.length+g10.length)]}}return c1()&&p.process&&p.process.platform&&p.process.platform==="win32"?b10:a10}var g3=Ce();function mi(a10){return a10.slice(-1)!==aK?a10+aK:a10}if(c1()&&p.process&&p.process.cwd)var cW=p.process.cwd().replace(/\\/g,aK);else var cW="/static";cW=mi(cW);function BM(a10){a10=H(a10),g3(a10)||(a10=cW+a10);for(var e10=g3(a10),d10=e10[1].split(aK),b10=[],c10=0;c101&&b10.pop();break;case".":break;case"":break;default:b10.push(d10[c10]);break}return b10.unshift(e10[0]),b10.orig=a10,b10}function B6(a10){for(var g10=e,c10=g10,b10,i10,d10=0,h10=a10.length;d10dW?(c10.substr(0,1),g10+=c10,c10=e,g10+=a10.slice(d10,f10)):c10+=a10.slice(d10,f10),f10==h10)break;d10=f10}b10>6),c10+=String.fromCharCode(as|b10&bh)):b10<55296||b10>=k9?c10+=String.fromCharCode(kQ|b10>>12,as|b10>>6&bh,as|b10&bh):b10>=56319||d10+1==h10||(i10=a10.charCodeAt(d10+1))k9?c10+="\xEF\xBF\xBD":(d10++,b10=(b10<<10)+i10-56613888,c10+=String.fromCharCode(li|b10>>18,as|b10>>12&bh,as|b10>>6&bh,as|b10&bh)),c10.length>cL&&(c10.substr(0,1),g10+=c10,c10=e)}return g10+c10}function aw(a10){return g2(a10)?a10:B6(a10)}var Cf=["E2BIG","EACCES","EAGAIN",f8,"EBUSY","ECHILD","EDEADLK","EDOM",lA,"EFAULT","EFBIG","EINTR","EINVAL","EIO","EISDIR","EMFILE","EMLINK","ENAMETOOLONG","ENFILE","ENODEV",gs,"ENOEXEC","ENOLCK","ENOMEM","ENOSPC","ENOSYS",gw,ls,"ENOTTY","ENXIO","EPERM","EPIPE","ERANGE","EROFS","ESPIPE","ESRCH","EXDEV","EWOULDBLOCK","EINPROGRESS","EALREADY","ENOTSOCK","EDESTADDRREQ","EMSGSIZE","EPROTOTYPE","ENOPROTOOPT","EPROTONOSUPPORT","ESOCKTNOSUPPORT","EOPNOTSUPP","EPFNOSUPPORT","EAFNOSUPPORT","EADDRINUSE","EADDRNOTAVAIL","ENETDOWN","ENETUNREACH","ENETRESET","ECONNABORTED","ECONNRESET","ENOBUFS","EISCONN","ENOTCONN","ESHUTDOWN","ETOOMANYREFS","ETIMEDOUT","ECONNREFUSED","EHOSTDOWN","EHOSTUNREACH","ELOOP","EOVERFLOW"];function a6(a10,b10,c10,d10){var f10=Cf.indexOf(a10);f10<0&&(d10==null&&(d10=-9999),f10=[0,d10]);var g10=[f10,aw(b10||e),aw(c10||e)];return g10}var ma={};function bm(a10){return ma[a10]}function a5(a10,b10){throw g([0,a10].concat(b10))}function gH(a10){return a10 instanceof Uint8Array||(a10=new Uint8Array(a10)),new a3(4,a10,a10.length)}function m(a10){gY(V.Sys_error,a10)}function me(a10){m(a10+d5)}function g1(a10){return a10.t!=4&&ea(a10),a10.c}function au(a10){return a10.l}function lG(){}function Z(a10){this.data=a10}Z.prototype=new lG,Z.prototype.constructor=Z,Z.prototype.truncate=function(a10){var b10=this.data;this.data=C(a10|0),a4(b10,0,this.data,0,a10)},Z.prototype.length=function(){return au(this.data)},Z.prototype.write=function(a10,b10,c10,d10){var e10=this.length();if(a10+d10>=e10){var f10=C(a10+d10),g10=this.data;this.data=f10,a4(g10,0,this.data,0,e10)}return a4(gH(b10),c10,this.data,a10,d10),0},Z.prototype.read=function(a10,b10,c10,d10){var e10=this.length();if(a10+d10>=e10&&(d10=e10-a10),d10){var f10=C(d10|0);a4(this.data,a10,f10,0,d10),b10.set(g1(f10),c10)}return d10};function bF(a10,b10,c10){this.file=b10,this.name=a10,this.flags=c10}bF.prototype.err_closed=function(){m(this.name+kZ)},bF.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()},bF.prototype.write=function(a10,b10,c10,d10){if(this.file)return this.file.write(a10,b10,c10,d10);this.err_closed()},bF.prototype.read=function(a10,b10,c10,d10){if(this.file)return this.file.read(a10,b10,c10,d10);this.err_closed()},bF.prototype.close=function(){this.file=void 0};function O(a10,b10){this.content={},this.root=a10,this.lookupFun=b10}O.prototype.nm=function(a10){return this.root+a10},O.prototype.create_dir_if_needed=function(a10){for(var d10=a10.split(aK),c10=e,b10=0;b10>>16,a10=cZ(a10,-2048144789),a10^=a10>>>13,a10=cZ(a10,-1028477387),a10^=a10>>>16,a10}function Bl(a10,b10,c10,d10){var j10,k10,l10,h10,g10,f10,e10,i10,m10;for(h10=b10,(h10<0||h10>cM)&&(h10=cM),g10=a10,f10=c10,j10=[d10],k10=0,l10=1;k100;)if(e10=j10[k10++],e10&&e10.caml_custom){if(cX[e10.caml_custom]&&cX[e10.caml_custom].hash){var n10=cX[e10.caml_custom].hash(e10);f10=W(f10,n10),g10--}}else if(e10 instanceof Array&&e10[0]===(e10[0]|0))switch(e10[0]){case 248:f10=W(f10,e10[2]),g10--;break;case 250:j10[--k10]=e10[1];break;default:if(l5(e10[0]))break;var o10=e10.length-1<<10|e10[0];for(f10=W(f10,o10),i10=1,m10=e10.length;i10=h10);i10++)j10[l10++]=e10[i10];break}else ee(e10)?(f10=Bm(f10,e10),g10--):ef(e10)?(f10=Bq(f10,e10),g10--):typeof e10=="string"?(f10=gM(f10,e10),g10--):e10===(e10|0)?(f10=W(f10,e10+e10+1),g10--):typeof e10=="number"&&(f10=gL(f10,e10),g10--);return f10=Bo(f10),f10&1073741823}function Br(a10,b10,c10){if(!isFinite(a10))return isNaN(a10)?aw(ga):aw(a10>0?kq:"-infinity");var k10=a10==0&&1/a10==-1/0?1:a10>=0?0:1;k10&&(a10=-a10);var f10=0;if(a10!=0)if(a10<1)for(;a10<1&&f10>-1022;)a10*=2,f10--;else for(;a10>=2;)a10/=2,f10++;var l10=f10<0?e:b9,g10=e;if(k10)g10=bA;else switch(c10){case 43:g10=b9;break;case 32:g10=aI;break;default:break}if(b10>=0&&b10<13){var i10=Math.pow(2,b10*4);a10=Math.round(a10*i10)/i10}var d10=a10.toString(16);if(b10>=0){var j10=d10.indexOf(bf);if(j10<0)d10+=bf+b$(b10,af);else{var h10=j10+1+b10;d10.length>24&aH,a10>>31&aB)}function l2(a10){return a10.toInt()}function By(a10){return+a10.isNeg()}function lY(a10){return a10.neg()}function Bw(a10,b10){var c10=gX(a10);c10.signedconv&&By(b10)&&(c10.sign=-1,b10=lY(b10));var d10=e,i10=cY(c10.base),h10="0123456789abcdef";do{var g10=b10.udivmod(i10);b10=g10.quotient,d10=h10.charAt(l2(g10.modulus))+d10}while(!Bz(b10));if(c10.prec>=0){c10.filler=aI;var f10=c10.prec-d10.length;f10>0&&(d10=b$(f10,af)+d10)}return gJ(c10,d10)}function l1(a10,b10){return a10.or(b10)}function mc(a10){var b10=0,e10=n(a10),c10=10,d10=1;if(e10>0)switch(_(a10,b10)){case 45:b10++,d10=-1;break;case 43:b10++,d10=1;break}if(b10+1=48&&a10<=57?a10-48:a10>=65&&a10<=90?a10-55:a10>=97&&a10<=122?a10-87:-1}function l4(a10){var h10=mc(a10),d10=h10[0],i10=h10[1],e10=h10[2],g10=n(a10),j10=-1>>>0,f10=d10=e10)&&S(a2);var b10=c10;for(d10++;d10=e10)break;b10=e10*b10+c10,b10>j10&&S(a2)}return d10!=g10&&S(a2),b10=i10*b10,e10==10&&(b10|0)!=b10&&S(a2),b10|0}function eg(a10,b10,c10){return a10[H(b10)].apply(a10,gT(c10))}function l6(a10,b10){switch(b10.length){case 1:return new a10;case 2:return new a10(b10[1]);case 3:return new a10(b10[1],b10[2]);case 4:return new a10(b10[1],b10[2],b10[3]);case 5:return new a10(b10[1],b10[2],b10[3],b10[4]);case 6:return new a10(b10[1],b10[2],b10[3],b10[4],b10[5]);case 7:return new a10(b10[1],b10[2],b10[3],b10[4],b10[5],b10[6]);case 8:return new a10(b10[1],b10[2],b10[3],b10[4],b10[5],b10[6],b10[7])}function c10(){return a10.apply(this,gT(b10))}return c10.prototype=a10.prototype,new c10}function gU(a10){for(var c10={},b10=1;b10>>0&&gW(a10,bg,bE)?0:1}function l7(a10){return gW(a10,bE,aZ),0}function BK(a10,b10){return+(d$(a10,b10,!1)<0)}function BL(a10){for(var b10=[];a10!==0;a10=a10[2])b10.push(a10[1]);return b10}function mb(a10){return a10}function lW(a10,b10){return a10.add(b10)}function lX(a10,b10){return a10.mul(b10)}function gS(a10,b10){return a10.ucompare(b10)<0}function lZ(a10){var h10=mc(a10),g10=h10[0],j10=h10[1],e10=h10[2],i10=cY(e10),k10=new d(aH,268435455,aB).udivmod(i10).quotient,f10=_(a10,g10),b10=eh(f10);(b10<0||b10>=e10)&&S(a2);for(var c10=cY(b10);;)if(g10++,f10=_(a10,g10),f10!=95){if(b10=eh(f10),b10<0||b10>=e10)break;gS(k10,c10)&&S(a2),b10=cY(b10),c10=lW(lX(i10,c10),b10),gS(c10,b10)&&S(a2)}return g10!=n(a10)&&S(a2),e10==10&&gS(new d(0,0,aA),c10)&&S(a2),j10<0&&(c10=lY(c10)),c10}function A7(a10,b10){return a10.get(a10.offset(b10))}function BE(a10,b10){return a10.xor(b10)}function BC2(a10,b10){return a10.shift_right_unsigned(b10)}function BB(a10,b10){return a10.shift_left(b10)}function l8(a10){function o10(a11,b11){return BB(a11,b11)}function h10(a11,b11){return BC2(a11,b11)}function s10(a11,b11){return l1(a11,b11)}function f10(a11,b11){return BE(a11,b11)}function k10(a11,b11){return lW(a11,b11)}function i10(a11,b11){return lX(a11,b11)}function m10(a11,b11){return s10(o10(a11,b11),h10(a11,64-b11))}function g10(a11,b11){return A7(a11,b11)}function j10(a11,b11,c11){return cS(a11,b11,c11)}var q10=lZ(mb("0xd1342543de82ef95")),l10=lZ(mb("0xdaba0b6eb09322e3")),b10,d10,c10,e10=a10,r10=g10(e10,0),n10=g10(e10,1),p10=g10(e10,2),t10=g10(e10,3);b10=k10(n10,p10),b10=i10(f10(b10,h10(b10,32)),l10),b10=i10(f10(b10,h10(b10,32)),l10),b10=f10(b10,h10(b10,32)),j10(e10,1,k10(i10(n10,q10),r10));var d10=p10,c10=t10;return c10=f10(c10,d10),d10=m10(d10,24),d10=f10(f10(d10,c10),o10(c10,16)),c10=m10(c10,37),j10(e10,2,d10),j10(e10,3,c10),b10}function ap(a10,b10){a10<0&&cR();var a10=a10+1|0,c10=new Array(a10);c10[0]=0;for(var d10=1;d10>>32-e10,c10)}function g10(a10,b10,c10,d10,e10,f10,g11){return l10(b10&c10|~b10&d10,a10,b10,e10,f10,g11)}function h10(a10,b10,c10,d10,e10,f10,g11){return l10(b10&d10|c10&~d10,a10,b10,e10,f10,g11)}function i10(a10,b10,c10,d10,e10,f10,g11){return l10(b10^c10^d10,a10,b10,e10,f10,g11)}function j10(a10,b10,c10,d10,e10,f10,g11){return l10(c10^(b10|~d10),a10,b10,e10,f10,g11)}return function(a10,b10){var c10=a10[0],d10=a10[1],e10=a10[2],f10=a10[3];c10=g10(c10,d10,e10,f10,b10[0],7,3614090360),f10=g10(f10,c10,d10,e10,b10[1],12,3905402710),e10=g10(e10,f10,c10,d10,b10[2],17,606105819),d10=g10(d10,e10,f10,c10,b10[3],22,3250441966),c10=g10(c10,d10,e10,f10,b10[4],7,4118548399),f10=g10(f10,c10,d10,e10,b10[5],12,1200080426),e10=g10(e10,f10,c10,d10,b10[6],17,2821735955),d10=g10(d10,e10,f10,c10,b10[7],22,4249261313),c10=g10(c10,d10,e10,f10,b10[8],7,1770035416),f10=g10(f10,c10,d10,e10,b10[9],12,2336552879),e10=g10(e10,f10,c10,d10,b10[10],17,4294925233),d10=g10(d10,e10,f10,c10,b10[11],22,2304563134),c10=g10(c10,d10,e10,f10,b10[12],7,1804603682),f10=g10(f10,c10,d10,e10,b10[13],12,4254626195),e10=g10(e10,f10,c10,d10,b10[14],17,2792965006),d10=g10(d10,e10,f10,c10,b10[15],22,1236535329),c10=h10(c10,d10,e10,f10,b10[1],5,4129170786),f10=h10(f10,c10,d10,e10,b10[6],9,3225465664),e10=h10(e10,f10,c10,d10,b10[11],14,643717713),d10=h10(d10,e10,f10,c10,b10[0],20,3921069994),c10=h10(c10,d10,e10,f10,b10[5],5,3593408605),f10=h10(f10,c10,d10,e10,b10[10],9,38016083),e10=h10(e10,f10,c10,d10,b10[15],14,3634488961),d10=h10(d10,e10,f10,c10,b10[4],20,3889429448),c10=h10(c10,d10,e10,f10,b10[9],5,568446438),f10=h10(f10,c10,d10,e10,b10[14],9,3275163606),e10=h10(e10,f10,c10,d10,b10[3],14,4107603335),d10=h10(d10,e10,f10,c10,b10[8],20,1163531501),c10=h10(c10,d10,e10,f10,b10[13],5,2850285829),f10=h10(f10,c10,d10,e10,b10[2],9,4243563512),e10=h10(e10,f10,c10,d10,b10[7],14,1735328473),d10=h10(d10,e10,f10,c10,b10[12],20,2368359562),c10=i10(c10,d10,e10,f10,b10[5],4,4294588738),f10=i10(f10,c10,d10,e10,b10[8],11,2272392833),e10=i10(e10,f10,c10,d10,b10[11],16,1839030562),d10=i10(d10,e10,f10,c10,b10[14],23,4259657740),c10=i10(c10,d10,e10,f10,b10[1],4,2763975236),f10=i10(f10,c10,d10,e10,b10[4],11,1272893353),e10=i10(e10,f10,c10,d10,b10[7],16,4139469664),d10=i10(d10,e10,f10,c10,b10[10],23,3200236656),c10=i10(c10,d10,e10,f10,b10[13],4,681279174),f10=i10(f10,c10,d10,e10,b10[0],11,3936430074),e10=i10(e10,f10,c10,d10,b10[3],16,3572445317),d10=i10(d10,e10,f10,c10,b10[6],23,76029189),c10=i10(c10,d10,e10,f10,b10[9],4,3654602809),f10=i10(f10,c10,d10,e10,b10[12],11,3873151461),e10=i10(e10,f10,c10,d10,b10[15],16,530742520),d10=i10(d10,e10,f10,c10,b10[2],23,3299628645),c10=j10(c10,d10,e10,f10,b10[0],6,4096336452),f10=j10(f10,c10,d10,e10,b10[7],10,1126891415),e10=j10(e10,f10,c10,d10,b10[14],15,2878612391),d10=j10(d10,e10,f10,c10,b10[5],21,4237533241),c10=j10(c10,d10,e10,f10,b10[12],6,1700485571),f10=j10(f10,c10,d10,e10,b10[3],10,2399980690),e10=j10(e10,f10,c10,d10,b10[10],15,4293915773),d10=j10(d10,e10,f10,c10,b10[1],21,2240044497),c10=j10(c10,d10,e10,f10,b10[8],6,1873313359),f10=j10(f10,c10,d10,e10,b10[15],10,4264355552),e10=j10(e10,f10,c10,d10,b10[6],15,2734768916),d10=j10(d10,e10,f10,c10,b10[13],21,1309151649),c10=j10(c10,d10,e10,f10,b10[4],6,4149444226),f10=j10(f10,c10,d10,e10,b10[11],10,3174756917),e10=j10(e10,f10,c10,d10,b10[2],15,718787259),d10=j10(d10,e10,f10,c10,b10[9],21,3951481745),a10[0]=k10(c10,a10[0]),a10[1]=k10(d10,a10[1]),a10[2]=k10(e10,a10[2]),a10[3]=k10(f10,a10[3])}}();function A1(a10,b10,c10){var e10=a10.len&bh,d10=0;if(a10.len+=c10,e10){var f10=64-e10;if(c10=64;)a10.b8.set(b10.subarray(d10,d10+64),0),d7(a10.w,a10.b32),c10-=64,d10+=64;c10&&a10.b8.set(b10.subarray(d10,d10+c10),0)}function AZ(a10){var c10=a10.len&bh;if(a10.b8[c10]=as,c10++,c10>56){for(var b10=c10;b10<64;b10++)a10.b8[b10]=0;d7(a10.w,a10.b32);for(var b10=0;b10<56;b10++)a10.b8[b10]=0}else for(var b10=c10;b10<56;b10++)a10.b8[b10]=0;a10.b32[14]=a10.len<<3,a10.b32[15]=a10.len>>29&536870911,d7(a10.w,a10.b32);for(var e10=new Uint8Array(16),d10=0;d10<4;d10++)for(var b10=0;b10<4;b10++)e10[d10*4+b10]=a10.w[d10]>>8*b10&255;return e10}function B2(a10){return c0(a10,0,a10.length)}function BN(a10,b10,c10){var d10=A0(),e10=g1(a10);return A1(d10,e10.subarray(b10,b10+c10),c10),B2(AZ(d10))}function BO(a10,b10,c10){return BN(bj(a10),b10,c10)}function BQ(){return 0}var bl=new Array;function l9(a10){return bl[a10]}function bK(a10){var b10=l9(a10);return b10.opened||m("Cannot flush a closed channel"),!b10.buffer||b10.buffer_curr==0||(b10.output?b10.output(c0(b10.buffer,0,b10.buffer_curr)):b10.file.write(b10.offset,b10.buffer,0,b10.buffer_curr),b10.offset+=b10.buffer_curr,b10.buffer_curr=0),0}function B4(a10,b10){if(b10.name)try{var d10=__require(gb),c10=d10.openSync(b10.name,"rs");return new aC(c10,b10)}catch{}return new aC(a10,b10)}var ek=new Array(3);function cQ(a10,b10){Z.call(this,C(0)),this.log=function(a11){return 0},a10==1&&typeof console.log=="function"?this.log=console.log:a10==2&&typeof console.error=="function"?this.log=console.error:typeof console.log=="function"&&(this.log=console.log),this.flags=b10}cQ.prototype.length=function(){return 0},cQ.prototype.write=function(a10,b10,c10,d10){if(this.log){d10>0&&c10>=0&&c10+d10<=b10.length&&b10[c10+d10-1]==10&&d10--;var e10=C(d10);return a4(gH(b10),c10,e10,0,d10),this.log(e10.toUtf16()),0}m(this.fd+kZ)},cQ.prototype.read=function(a10,b10,c10,d10){m(this.fd+": file descriptor is write only")},cQ.prototype.close=function(){this.log=void 0};function el(a10,b10){return b10==null&&(b10=ek.length),ek[b10]=a10,b10|0}function Ch(a10,b10,c10){for(var d10={};b10;){switch(b10[1]){case 0:d10.rdonly=1;break;case 1:d10.wronly=1;break;case 2:d10.append=1;break;case 3:d10.create=1;break;case 4:d10.truncate=1;break;case 5:d10.excl=1;break;case 6:d10.binary=1;break;case 7:d10.text=1;break;case 8:d10.nonblock=1;break}b10=b10[2]}d10.rdonly&&d10.wronly&&m(a10+gC),d10.text&&d10.binary&&m(a10+gn);var e10=mn(a10),f10=e10.device.open(e10.rest,d10);return el(f10,void 0)}(function(){function a10(a11,b10){return c1()?B4(a11,b10):new cQ(a11,b10)}el(a10(0,{rdonly:1,altname:"/dev/stdin",isCharacterDevice:!0}),0),el(a10(1,{buffered:2,wronly:1,isCharacterDevice:!0}),1),el(a10(2,{buffered:2,wronly:1,isCharacterDevice:!0}),2)})();function BR(a10){var b10=ek[a10];b10.flags.wronly&&m(lk+a10+" is writeonly");var d10=null,c10={file:b10,offset:b10.flags.append?b10.length():0,fd:a10,opened:!0,out:!1,buffer_curr:0,buffer_max:0,buffer:new Uint8Array(kr),refill:d10};return bl[c10.fd]=c10,c10.fd}function l_(a10){var b10=ek[a10];b10.flags.rdonly&&m(lk+a10+" is readonly");var d10=b10.flags.buffered!==void 0?b10.flags.buffered:1,c10={file:b10,offset:b10.flags.append?b10.length():0,fd:a10,opened:!0,out:!0,buffer_curr:0,buffer:new Uint8Array(kr),buffered:d10};return bl[c10.fd]=c10,c10.fd}function BS(){for(var b10=0,a10=0;a10e10.buffer.length){var g10=new Uint8Array(e10.buffer_curr+b10.length);g10.set(e10.buffer),e10.buffer=g10}switch(e10.buffered){case 0:e10.buffer.set(b10,e10.buffer_curr),e10.buffer_curr+=b10.length,bK(a10);break;case 1:e10.buffer.set(b10,e10.buffer_curr),e10.buffer_curr+=b10.length,e10.buffer_curr>=e10.buffer.length&&bK(a10);break;case 2:var f10=b10.lastIndexOf(10);f10<0?(e10.buffer.set(b10,e10.buffer_curr),e10.buffer_curr+=b10.length,e10.buffer_curr>=e10.buffer.length&&bK(a10)):(e10.buffer.set(b10.subarray(0,f10+1),e10.buffer_curr),e10.buffer_curr+=f10+1,bK(a10),e10.buffer.set(b10.subarray(f10+1),e10.buffer_curr),e10.buffer_curr+=b10.length-f10-1);break}return 0}function BT(a10,b10,c10,d10){var b10=g1(b10);return BU(a10,b10,c10,d10)}function gV(a10,b10,c10,d10){return BT(a10,bj(b10),c10,d10)}function l$(a10,b10){var c10=String.fromCharCode(b10);return gV(a10,c10,0,1),0}function bL(a10,b10){return+(d$(a10,b10,!1)!=0)}function BW(a10,b10){var d10=new Array(b10+1);d10[0]=a10;for(var c10=1;c10<=b10;c10++)d10[c10]=0;return d10}function aN(a10){return a10 instanceof Array&&a10[0]==a10[0]>>>0?a10[0]:ee(a10)||ef(a10)?d3:a10 instanceof Function||typeof a10=="function"?247:a10&&a10.caml_custom?le:cP}function A8(a10){var c10={};if(a10)for(var b10=1;b10=0?a10=e10:S("caml_register_global: cannot locate "+d10)}}V[a10+1]=b10,c10&&(V[c10]=b10)}function g0(a10,b10){return ma[a10]=b10,0}function B1(){G(f_)}function D(a10,b10){return b10>>>0>=n(a10)&&B1(),_(a10,b10)}function ej(a10){return a10.t&6&&cV(a10),a10.c}function B3(){return 2147483647/4|0}function BY(){md(V.Not_found)}function mh(a10){var b10=mm(H(a10));return b10===void 0&&BY(),aw(b10)}function B5(){if(p.crypto){if(p.crypto.getRandomValues){var a10=p.crypto.getRandomValues(new Int32Array(4));return[0,a10[0],a10[1],a10[2],a10[3]]}else if(p.crypto.randomBytes){var a10=new Int32Array(p.crypto.randomBytes(16).buffer);return[0,a10[0],a10[1],a10[2],a10[3]]}}var b10=new Date().getTime(),c10=b10^4294967295*Math.random();return[0,c10]}function bM(a10){for(var b10=1;a10&&a10.joo_tramp;)a10=a10.joo_tramp.apply(null,a10.joo_args),b10++;return a10}function r(a10,b10){return{joo_tramp:a10,joo_args:b10}}function mj(a10,b10){if(b10.fun)return a10.fun=b10.fun,0;if(typeof b10=="function")return a10.fun=b10,0;for(var c10=b10.length;c10--;)a10[c10]=b10[c10];return 0}function M(a10){{if(a10 instanceof Array)return a10;var b10;return p.RangeError&&a10 instanceof p.RangeError&&a10.message&&a10.message.match(/maximum call stack/i)||p.InternalError&&a10 instanceof p.InternalError&&a10.message&&a10.message.match(/too much recursion/i)?b10=V.Stack_overflow:a10 instanceof p.Error&&bm(gf)?b10=[0,bm(gf),a10]:b10=[0,V.Failure,aw(String(a10))],a10 instanceof p.Error&&(b10.js_error=a10),b10}}function B7(){return init_awareness(),__toCommonJS(awareness_exports)}function B8(){return(init_y_indexeddb(),__toCommonJS(y_indexeddb_exports)).IndexeddbPersistence}function B9(){return(init_quill2(),__toCommonJS(quill_exports)).default}function B_(){return require_quill_cursors()}function B$(){return(init_y_webrtc(),__toCommonJS(y_webrtc_exports)).WebrtcProvider}function Ca(){return init_y_quill(),__toCommonJS(y_quill_exports)}function Cb(){return init_yjs(),__toCommonJS(yjs_exports)}function BF(a10){switch(a10[2]){case-8:case-11:case-12:return 1;default:return 0}}function Bi(a10){var b10=e;if(a10[0]==0){if(b10+=a10[1][1],a10.length==3&&a10[2][0]==0&&BF(a10[1]))var f10=a10[2],g10=1;else var g10=2,f10=a10;b10+="(";for(var d10=g10;d10g10&&(b10+=k3);var c10=f10[d10];typeof c10=="number"?b10+=c10.toString():c10 instanceof a3||typeof c10=="string"?b10+=d2+c10.toString()+d2:b10+=lx}b10+=")"}else a10[0]==q&&(b10+=a10[1]);return b10}function lT(a10){if(a10 instanceof Array&&(a10[0]==0||a10[0]==q)){var c10=bm(lz);if(c10)d_(c10,[a10,!1]);else{var d10=Bi(a10),b10=bm(ll);if(b10&&d_(b10,[0]),console.error(gg+d10),a10.js_error)throw a10.js_error}}else throw a10}function B0(){var c10=p.process;c10&&c10.on?c10.on("uncaughtException",function(a10,b10){lT(a10),c10.exit(2)}):p.addEventListener&&p.addEventListener(k1,function(a10){a10.error&&lT(a10.error)})}B0();function h(a10,b10){return(a10.l>=0?a10.l:a10.l=a10.length)==1?a10(b10):bk(a10,[b10])}function i(a10,b10,c10){return(a10.l>=0?a10.l:a10.l=a10.length)==2?a10(b10,c10):bk(a10,[b10,c10])}function y(a10,b10,c10,d10){return(a10.l>=0?a10.l:a10.l=a10.length)==3?a10(b10,c10,d10):bk(a10,[b10,c10,d10])}function f6(a10,b10,c10,d10,e10,f10){return(a10.l>=0?a10.l:a10.l=a10.length)==5?a10(b10,c10,d10,e10,f10):bk(a10,[b10,c10,d10,e10,f10])}function AY(a10,b10,c10,d10,e10,f10,g10,h10){return(a10.l>=0?a10.l:a10.l=a10.length)==7?a10(b10,c10,d10,e10,f10,g10,h10):bk(a10,[b10,c10,d10,e10,f10,g10,h10])}var Cg=void 0;Bj();var em=[q,lD,-1],g6=[q,kn,-2],cc=[q,gD,-3],cb=[q,kd,-4],aD=[q,k7,-7],g4=[q,lB,-8],g5=[q,kB,-9],f=[q,kH,-11],cd=[q,kO,-12],AX=[4,0,0,0,[12,45,[4,0,0,0,0]]],eP=[0,[11,'File "',[2,0,[11,'", line ',[4,0,0,0,[11,lC,[4,0,0,0,[12,45,[4,0,0,0,[11,kS,[2,0,0]]]]]]]]]],'File "%s", line %d, characters %d-%d: %s'],jQ=gB,by="content",jW="columns",jX="rows",f0=ki,f1=gB,jY=bB,jZ="page_content";av(11,cd,kO),av(10,f,kH),av(9,[q,kJ,-10],kJ),av(8,g5,kB),av(7,g4,lB),av(6,aD,k7),av(5,[q,lf,-6],lf),av(4,[q,kt,-5],kt),av(3,cb,kd),av(2,cc,gD),av(1,g6,kn),av(0,em,lD);var my="output_substring",mu=bf,mq="true",mr="false",mD="CamlinternalLazy.Undefined",mJ="option is None",mM="\\\\",mN="\\'",mO="\\b",mP="\\t",mQ="\\n",mR="\\r",m0="List.init",mW="hd",nf="String.blit / Bytes.blit_string",ne="Bytes.blit",nd="String.sub / Bytes.sub",nq="String.contains_from / Bytes.contains_from",nw="Array.blit",nv="Array.sub",nt="Array.init",nD=[0,"set.ml",lj,18],nz=dY,nA=dY,nB=dY,nC=dY,nK="Map.remove_min_elt",nG=d1,nH=d1,nI=d1,nJ=d1,nL="Stdlib.Stack.Empty",nP="Stdlib.Queue.Empty",nY="Buffer.add_substring/add_subbytes",nW="Buffer.add: cannot grow buffer",nU="Buffer.sub",n5="first domain already spawned",n2=[0,"domain.ml",184,13],oe="%c",of="%s",og=k$,oh=ka,oi=lF,oj=k5,ok="%f",ol="%B",om="%{",on="%}",oo="%(",op="%)",oq="%a",or="%t",os="%?",ot="%r",ou="%_r",ov=[0,L,850,23],oG=[0,L,814,21],oy=[0,L,815,21],oH=[0,L,818,21],oz=[0,L,819,21],oI=[0,L,822,19],oA=[0,L,823,19],oJ=[0,L,826,22],oB=[0,L,827,22],oK=[0,L,831,30],oC=[0,L,832,30],oE=[0,L,836,26],ow=[0,L,837,26],oF=[0,L,846,28],ox=[0,L,847,28],oD=[0,L,851,23],pW=[0,L,1558,4],pX="Printf: bad conversion %[",pY=[0,L,1626,39],pZ=[0,L,1649,31],p0=[0,L,1650,31],p1="Printf: bad conversion %_",p2=kl,p3=kI,p4=kl,p5=kI,p9=[0,[11,"invalid box description ",[3,0,0]],"invalid box description %S"],p8=[0,0,4],pR=ga,pP="neg_infinity",pQ=kq,pO=bf,pJ=[0,j5],px="%+nd",py="% nd",pA="%+ni",pB="% ni",pC="%nx",pD="%#nx",pE="%nX",pF="%#nX",pG="%no",pH="%#no",pw="%nd",pz=lF,pI="%nu",pj="%+ld",pk="% ld",pm="%+li",pn="% li",po="%lx",pp="%#lx",pq="%lX",pr="%#lX",ps="%lo",pt="%#lo",pi="%ld",pl=ka,pu="%lu",o7="%+Ld",o8="% Ld",o_="%+Li",o$="% Li",pa="%Lx",pb="%#Lx",pc="%LX",pd="%#LX",pe="%Lo",pf="%#Lo",o6="%Ld",o9=k5,pg="%Lu",oT="%+d",oU="% d",oW="%+i",oX="% i",oY="%x",oZ="%#x",o0="%X",o1="%#X",o2="%o",o3="%#o",oS=f9,oV=k$,o4=kw,n8="@]",n9="@}",n_="@?",n$=`@ +`,oa="@.",ob="@@",oc="@%",od="@",oL="CamlinternalFormat.Type_mismatch",qc=e,qd=[0,[11,k3,[2,0,[2,0,0]]],", %s%s"],qP=[0,[11,gg,[2,0,[12,10,0]]],kA],qQ=[0,[11,"Fatal error in uncaught exception handler: exception ",[2,0,[12,10,0]]],`Fatal error in uncaught exception handler: exception %s +`],qO="Fatal error: out of memory in uncaught exception handler",qL=[0,[11,gg,[2,0,[12,10,0]]],kA],qF=[0,[2,0,[12,10,0]],`%s +`],qG=[0,[11,kk,0],kk],qu="Raised at",qv="Re-raised at",qw="Raised by primitive operation at",qx="Called from",qy=[0,[12,32,[4,0,0,0,0]]," %d"],qC=[0,[11,"s ",[4,0,0,0,[12,45,[4,0,0,0,0]]]],"s %d-%d"],qz=" (inlined)",qB=e,qA=[0,[2,0,[12,32,[2,0,[11,' in file "',[2,0,[12,34,[2,0,[11,", line",[2,0,[11,lC,AX]]]]]]]]]],'%s %s in file "%s"%s, line%s, characters %d-%d'],qD=[0,[2,0,[11," unknown location",0]],"%s unknown location"],qn="Out of memory",qo="Stack overflow",qp="Pattern matching failed",qq="Assertion failed",qr="Undefined recursive module",qf=[0,[12,40,[2,0,[2,0,[12,41,0]]]],"(%s%s)"],qg=e,qh=e,qi=[0,[12,40,[2,0,[12,41,0]]],"(%s)"],qb=[0,[4,0,0,0,0],f9],p$=[0,[3,0,0],"%S"],qa=lx,qI=[0,e,`(Cannot print locations: bytecode executable program file not found)`,`(Cannot print locations: bytecode executable program file appears to be corrupt)`,`(Cannot print locations: bytecode executable program file has wrong magic number)`,`(Cannot print locations: bytecode executable program file cannot be opened; - -- too many open files. Try running with OCAMLRUNPARAM=b=2)`],pS="Fun.Finally_raised: ",pQ="Stdlib.Fun.Finally_raised",pW="x",p4="Hashtbl: unsupported hash table format",pZ=e,qN=[3,0,3],qO=ba,qH=kL,qI=" ",yW=[0,0],yU=[0,0],yV=[0,80,"Update"],yQ=e,yR=e,yS=[0,80,[0,"cell-edit-btn"]],yT="\xE2\x9C\x8F\xEF\xB8\x8F",yZ=[0,80,[0,"cell-edit-overlay"]],y0=[0,80,[0,fU]],yB="GET",yA=[0,c,479,17],yz=[0,c,494,11],yE=[0,c,509,19],yD=[0,c,519,13],yC=[0,c,kN,13],yF=[0,c,526,11],yL=[0,c,j7,19],yK=[0,c,539,19],yG=[0,c,532,13],yI=[0,c,548,15],yJ=[0,c,552,15],yH=[0,c,kC,11],yN=e,yO=[0,c,565,17],yM=[0,c,568,11],yu=bu,yv=ka,yo="New column kind:",ym=[0,c,354,13],yi=dO,yj=bY,yk=dL,yl=cv,ye="Old value:",yf="Action: delete",yg="Key:",yh=[0,c,279,15],yd="On_change",yc=[0,c,204,22],ya="[blit v(%i) %i %i v'(%i)]",x9=[0,c,147,18],xX=kh,xY="orange",xZ=kt,xW="Received peers",xV="Received synced",xU="Received connected",xP="modules/cursors",xQ="Narines",xR=[0,[0,"wss://p2p.u31.fr",0]],xS="testroom5267564",xT="zedoc",x1=[0,80,[0,"p2p_status_icon"]],x3="\xE2\x99\xBC",x6=[0,80,[0,"p2p_status"]],yr=bu,ys=ka,zM=[0,80,"Add table"],zP=[0,80,[0,jJ]];function A(a10){if(typeof a10=="number")return 0;switch(a10[0]){case 0:return[0,A(a10[1])];case 1:return[1,A(a10[1])];case 2:return[2,A(a10[1])];case 3:return[3,A(a10[1])];case 4:return[4,A(a10[1])];case 5:return[5,A(a10[1])];case 6:return[6,A(a10[1])];case 7:return[7,A(a10[1])];case 8:var c10=a10[1];return[8,c10,A(a10[2])];case 9:var b10=a10[1];return[9,b10,b10,A(a10[3])];case 10:return[10,A(a10[1])];case 11:return[11,A(a10[1])];case 12:return[12,A(a10[1])];case 13:return[13,A(a10[1])];default:return[14,A(a10[1])]}}function W(a10,b10){if(typeof a10=="number")return b10;switch(a10[0]){case 0:return[0,W(a10[1],b10)];case 1:return[1,W(a10[1],b10)];case 2:return[2,W(a10[1],b10)];case 3:return[3,W(a10[1],b10)];case 4:return[4,W(a10[1],b10)];case 5:return[5,W(a10[1],b10)];case 6:return[6,W(a10[1],b10)];case 7:return[7,W(a10[1],b10)];case 8:var c10=a10[1];return[8,c10,W(a10[2],b10)];case 9:var d10=a10[2],e10=a10[1];return[9,e10,d10,W(a10[3],b10)];case 10:return[10,W(a10[1],b10)];case 11:return[11,W(a10[1],b10)];case 12:return[12,W(a10[1],b10)];case 13:return[13,W(a10[1],b10)];default:return[14,W(a10[1],b10)]}}function x(a10,b10){if(typeof a10=="number")return b10;switch(a10[0]){case 0:return[0,x(a10[1],b10)];case 1:return[1,x(a10[1],b10)];case 2:var c10=a10[1];return[2,c10,x(a10[2],b10)];case 3:var d10=a10[1];return[3,d10,x(a10[2],b10)];case 4:var e10=a10[3],f10=a10[2],g10=a10[1];return[4,g10,f10,e10,x(a10[4],b10)];case 5:var h10=a10[3],i10=a10[2],j10=a10[1];return[5,j10,i10,h10,x(a10[4],b10)];case 6:var k10=a10[3],l10=a10[2],m10=a10[1];return[6,m10,l10,k10,x(a10[4],b10)];case 7:var n10=a10[3],o10=a10[2],p10=a10[1];return[7,p10,o10,n10,x(a10[4],b10)];case 8:var q10=a10[3],r10=a10[2],s10=a10[1];return[8,s10,r10,q10,x(a10[4],b10)];case 9:var t10=a10[1];return[9,t10,x(a10[2],b10)];case 10:return[10,x(a10[1],b10)];case 11:var u10=a10[1];return[11,u10,x(a10[2],b10)];case 12:var v10=a10[1];return[12,v10,x(a10[2],b10)];case 13:var w10=a10[2],y10=a10[1];return[13,y10,w10,x(a10[3],b10)];case 14:var z10=a10[2],A10=a10[1];return[14,A10,z10,x(a10[3],b10)];case 15:return[15,x(a10[1],b10)];case 16:return[16,x(a10[1],b10)];case 17:var B2=a10[1];return[17,B2,x(a10[2],b10)];case 18:var C2=a10[1];return[18,C2,x(a10[2],b10)];case 19:return[19,x(a10[1],b10)];case 20:var D2=a10[2],E2=a10[1];return[20,E2,D2,x(a10[3],b10)];case 21:var F2=a10[1];return[21,F2,x(a10[2],b10)];case 22:return[22,x(a10[1],b10)];case 23:var G2=a10[1];return[23,G2,x(a10[2],b10)];default:var H2=a10[2],I2=a10[1];return[24,I2,H2,x(a10[3],b10)]}}function d8(a10){return[0,a10]}function cK(a10){return a10[1]}function d9(a10,b10,c10){return a10[1]===b10?(a10[1]=c10,1):0}function a3(a10){throw g([0,b4,a10],1)}function t(a10){throw g([0,cL,a10],1)}function cM(a10){return 0<=a10?a10:-a10|0}var gI=kR;function aA(a10,b10){return a10+b10}function lL(b10){var e10=n(b10);return function(a10){for(var c10=a10;;){if(e10<=c10)return aA(b10,lM);var d10=z(b10,c10);a:{if(48<=d10){if(58>d10)break a}else if(d10===45)break a;return b10}c10=c10+1|0}}(0)}function gJ(a10,b10){if(!a10)return b10;var c10=a10[1];return[0,c10,gJ(a10[2],b10)]}AG(0);var lO=ls(1),au=ls(2);function b6(a10,b10){gw(a10,b10,0,n(b10))}function gK(a10){return b6(au,a10),lt(au,10),bB(au)}var d$=d8(function(a10){return function(a11){for(var b10=a11;;){if(!b10)return 0;var d10=b10[2],e10=b10[1];try{bB(e10)}catch(f10){var c10=M(f10);if(c10[1]!==gH)throw g(c10,0)}b10=d10}}(AH(0))});function ea(a10){return h(cK(d$),0)}gB(kf,ea);function lG(a10){return a10^-1}function lH(a10){return a10?lI:lJ}function lK(a10){return e+a10}function lN(a10){return lL(gm("%.12g",a10))}function lP(a10,b10,c10,d10){return 0<=c10&&0<=d10&&(n(b10)-d10|0)>=c10?gw(a10,b10,c10,d10):t(lQ)}function lR(c10){for(;;){var d10=d8(1),a10=cK(d$);let e10=d10,f10=a10;var b10=1-d9(d$,a10,function(a11){return d9(e10,1,0)&&h(c10,0),h(f10,0)});if(!b10)return b10}}function cN(a10){return bB(a10)}function lS(a10,b10){lt(a10,b10)}var eb=AV(0),b7=(4*eb|0)-1|0;function lT(a10){return 1-(typeof a10=="number"?1:0)}var lV=[q,lU,af(0)];function lW(a10){throw g(lV,1)}function cO(a10){var d10=a10[1];a10[1]=lW;try{var c10=h(d10,0);return AN(a10,c10),c10}catch(f10){var b10=M(f10);throw a10[1]=function(a11){throw g(b10,0)},g(b10,0)}}function lX(a10){var b10=ay(a10);return b10!==aE&&b10!==bb&&b10!==kD?a10:Ay(a10)}function cP(a10){return a10?a10[1]:t(lY)}function b8(a10,b10){return b10?[0,h(a10,b10[1])]:0}function gL(a10){return a10?1:0}function lZ(a10){return a10?[0,a10[1],0]:0}function l0(a10){a:{if(40<=a10){if(a10===92)return l1;if(gc>a10)break a}else{if(32<=a10){if(39<=a10)return l2;break a}if(14>a10)switch(a10){case 8:return l3;case 9:return l4;case 10:return l5;case 13:return l6}}var b10=F(4);return B(b10,0,92),B(b10,1,48+(a10/fX|0)|0),B(b10,2,48+((a10/10|0)%10|0)|0),B(b10,3,48+(a10%10|0)|0),d5(b10)}var c10=F(1);return B(c10,0,a10),d5(c10)}function l7(a10){return 25>>0?a10:a10+kY|0}function l8(a10,b10){for(var d10=a10,c10=b10;;){if(!c10)return d10;d10=d10+1|0,c10=c10[2]}}function ec(a10){return l8(0,a10)}function bD(a10,b10){for(var c10=a10,d10=b10;;){if(!c10)return d10;var e10=[0,c10[1],d10];c10=c10[2],d10=e10}}function a4(a10){return bD(a10,0)}function gM(a10,b10,c10){if(b10<=a10)return 0;var d10=h(c10,a10);return[0,d10,gM(a10+1|0,b10,c10)]}function l9(a10,b10){return[0,a10,b10]}function l_(a10){return a10?a10[1]:a3(l$)}function ma(a10,b10,c10,d10){for(var f10=a10,e10=b10;;){if(c10<=e10)return f10;f10=[0,h(d10,e10),f10],e10=e10+1|0}}function ed(a10){if(!a10)return 0;var b10=a10[1];return gJ(b10,ed(a10[2]))}function cQ(a10,b10){if(!b10)return 0;var c10=b10[2],d10=h(a10,b10[1]);return[0,d10,cQ(a10,c10)]}function a5(a10,b10){for(var c10=b10;;){if(!c10)return 0;var d10=c10[2];h(a10,c10[1]),c10=d10}}function ee(a10,b10,c10){for(var e10=b10,d10=c10;;){if(!d10)return e10;var f10=d10[2];e10=i(a10,e10,d10[1]),d10=f10}}function gN(g10){function b10(a10,b11){for(var d10=a10,c11=b11;;){if(!c11)return a4(d10);var e10=c11[2],f10=c11[1];h(g10,f10)&&(d10=[0,f10,d10]),c11=e10}}var c10=0;return function(a10){return b10(c10,a10)}}function gO(g10){function b10(a10,b11){for(var d10=a10,c11=b11;;){if(!c11)return a4(d10);var e10=c11[2],f10=h(g10,c11[1]);f10&&(d10=[0,f10[1],d10]),c11=e10}}var c10=0;return function(a10){return b10(c10,a10)}}function mb(a10,b10){return 0<=a10?50>1,s10=p10(r10,b11),D2=s10[1],t10=p10(a11-r10|0,s10[2]),E2=t10[2];return[0,B2(D2,t10[1],0),E2]}function p10(a11,b11){if(a11===2){if(b11){var j10=b11[2];if(j10){var k10=j10[1],g10=b11[1],B3=j10[2],q10=i(d10,g10,k10),C2=q10===0?[0,g10,0]:0>1,s10=h10(r10,b11),D2=s10[1],t10=h10(a11-r10|0,s10[2]),E2=t10[2];return[0,A10(D2,t10[1],0),E2]}var a10=ec(b10);return 2<=a10?h10(a10,b10)[1]:b10}function gP(a10,b10){return b10<=a10?a10:b10}function gQ(a10){return e+a10}function mh(a10,b10){return lm(a10,b10)}function mi(a10,b10){return a10<=b10?a10:b10}function bi(a10,b10){var c10=F(a10);return z_(c10,0,a10,b10),c10}var mj=F(0);function gR(a10){var b10=ar(a10),c10=F(b10);return aZ(a10,0,c10,0,b10),c10}function ef(a10,b10,c10){if(0<=b10&&0<=c10&&(ar(a10)-c10|0)>=b10){var d10=F(c10);return aZ(a10,b10,d10,0,c10),d10}return t(ml)}function eg(a10,b10,c10){return d5(ef(a10,b10,c10))}function gS(a10,b10,c10,d10,e10){if(0<=e10&&0<=b10&&(ar(a10)-e10|0)>=b10&&0<=d10&&(ar(c10)-e10|0)>=d10){aZ(a10,b10,c10,d10,e10);return}return t(mm)}function aL(a10,b10,c10,d10,e10){if(0<=e10&&0<=b10&&(n(a10)-e10|0)>=b10&&0<=d10&&(ar(c10)-e10|0)>=d10){cB(a10,b10,c10,d10,e10);return}return t(mn)}function gT(a10){var b10=a10-9|0;a:{if(4>>0){if(b10!==23)break a}else if(b10===2)break a;return 1}return 0}function mq(a10,b10){var d10=ar(b10);if(d10===0)return b10;var e10=F(d10),f10=d10-1|0,g10=0;if(f10>=0)for(var c10=g10;;){B(e10,c10,h(a10,b0(b10,c10)));var i10=c10+1|0;if(f10===c10)break;c10=i10}return e10}function gU(a10,b10,c10){z5(a10,b10,Al(c10))}function gV(a10,b10,c10){a0(a10,b10,c10)}function gW(a10,b10){return z4(a10,b10)}function cR(a10){return be(a10)}function aa(a10){return d5(a10)}function mk(a10){return gR(be(a10))}function mo(a10){for(var d10=ar(a10),b10=[0,0];!(b10[1]>=d10||!gT(b0(a10,b10[1])));)b10[1]++;for(var c10=[0,d10-1|0];;){if(b10[1]<=c10[1]&&gT(b0(a10,c10[1]))){c10[1]--;continue}return b10[1]<=c10[1]?ef(a10,b10[1],(c10[1]-b10[1]|0)+1|0):mj}}function mp(a10){var b10=[0,0],j10=ar(a10)-1|0,l10=0;if(j10>=0)for(var g10=l10;;){var e10=b0(a10,g10);a:{b:{c:{if(32<=e10){var h10=e10-34|0;if(58>>0){if(93<=h10)break c}else if(56>>0)break b;var i10=1;break a}if(11<=e10){if(e10===13)break b}else if(8<=e10)break b}var i10=4;break a}var i10=2}b10[1]=b10[1]+i10|0;var o10=g10+1|0;if(j10===g10)break;g10=o10}if(b10[1]===ar(a10))return gR(a10);var c10=F(b10[1]);b10[1]=0;var k10=ar(a10)-1|0,m10=0;if(k10>=0)for(var f10=m10;;){var d10=b0(a10,f10);a:{b:{c:{if(35<=d10){if(d10!==92){if(gc<=d10)break c;break b}}else{if(32>d10){if(14<=d10)break c;switch(d10){case 8:B(c10,b10[1],92),b10[1]++,B(c10,b10[1],98);break a;case 9:B(c10,b10[1],92),b10[1]++,B(c10,b10[1],116);break a;case 10:B(c10,b10[1],92),b10[1]++,B(c10,b10[1],110);break a;case 13:B(c10,b10[1],92),b10[1]++,B(c10,b10[1],114);break a;default:break c}}if(34>d10)break b}B(c10,b10[1],92),b10[1]++,B(c10,b10[1],d10);break a}B(c10,b10[1],92),b10[1]++,B(c10,b10[1],48+(d10/fX|0)|0),b10[1]++,B(c10,b10[1],48+((d10/10|0)%10|0)|0),b10[1]++,B(c10,b10[1],48+(d10%10|0)|0);break a}B(c10,b10[1],d10)}b10[1]++;var n10=f10+1|0;if(k10===f10)break;f10=n10}return c10}function mr(a10){return mq(l7,a10)}function cS(a10,b10){return aa(bi(a10,b10))}function eh(a10,b10,c10){return aa(ef(cR(a10),b10,c10))}function gX(a10){var b10=a10-9|0;a:{if(4>>0){if(b10!==23)break a}else if(b10===2)break a;return 1}return 0}function mu(a10,b10,c10,d10){for(var e10=c10;;){if(b10<=e10)throw g(az,1);if($(a10,e10)===d10)return e10;e10=e10+1|0}}function mv(a10,b10,c10){var d10=n(a10);if(0<=b10&&d10>=b10)try{mu(a10,d10,b10,c10);var f10=1;return f10}catch(f11){var e10=M(f11);if(e10===az)return 0;throw g(e10,0)}return t(mw)}function ei(a10,b10){return ly(a10,b10)}function ej(a10,b10){return a10==b10?1:0}function ms(a10){return a10==e||!gX($(a10,0))&&!gX($(a10,n(a10)-1|0))?a10:aa(mo(cR(a10)))}function mt(a10){return function(a11,b10,c10){for(var d10=c10;;){if(b10<=d10)return a11;var e10=$(a11,d10)+kY|0;a:{if(59>>0){if(33>>0)break a}else if(e10===2)break a;d10=d10+1|0;continue}return aa(mp(cR(a11)))}}(a10,n(a10),0)}function mx(a10,b10){return mv(a10,0,b10)}function my(a10){return aa(mr(cR(a10)))}function gY(a10,b10){if(a10===0)return[0];if(0>a10)return t(mz);var d10=aq(a10,h(b10,0)),e10=a10-1|0,f10=1;if(e10>=1)for(var c10=f10;;){d10[1+c10]=h(b10,c10);var g10=c10+1|0;if(e10===c10)break;c10=g10}return d10}function cT(a10,b10,c10,d10,e10){return 0<=e10&&0<=b10&&(a10.length-1-e10|0)>=b10&&0<=d10&&(c10.length-1-e10|0)>=d10?zY(a10,b10,c10,d10,e10):t(mC)}function gZ(a10,b10){var d10=b10.length-2|0,e10=0;if(d10>=0)for(var c10=e10;;){h(a10,b10[1+c10]);var f10=c10+1|0;if(d10===c10)break;c10=f10}return 0}function g0(a10,b10){var d10=b10.length-1;if(d10===0)return[0];var e10=aq(d10,h(a10,b10[1])),f10=d10-1|0,g10=1;if(f10>=1)for(var c10=g10;;){e10[1+c10]=h(a10,b10[1+c10]);var i10=c10+1|0;if(f10===c10)break;c10=i10}return e10}function mD(a10,b10){for(var d10=a10,c10=b10;;){if(!c10)return d10;d10=d10+1|0,c10=c10[2]}}function cU(a10){if(!a10)return[0];var b10=a10[2],c10=a10[1],e10=aq(mD(0,a10),c10);return function(a11,b11){for(var d10=a11,c11=b11;;){if(!c11)return e10;var f10=c11[2];e10[1+d10]=c11[1],d10=d10+1|0,c11=f10}}(1,b10)}function mA(a10,b10,c10){return 0<=b10&&0<=c10&&(a10.length-1-c10|0)>=b10?zZ(a10,b10,c10):t(mB)}function mE(k10){function j10(a10){return a10?a10[4]:0}function d10(a10,b11,c11){var d11=a10?a10[4]:0,e11=c11?c11[4]:0,f10=e11<=d11?d11+1|0:e11+1|0;return[0,a10,b11,c11,f10]}function l10(a10,b11,c11){var g10=a10?a10[4]:0,h10=c11?c11[4]:0;if((h10+2|0)=h10){var w10=h10<=g10?g10+1|0:h10+1|0;return[0,a10,b11,c11,w10]}if(!c11)return t(mI);var k11=c11[3],m11=c11[2],f10=c11[1],r10=j10(f10);if(r10<=j10(k11))return d10(d10(a10,b11,f10),m11,k11);if(!f10)return t(mH);var s10=f10[2],u10=f10[1],v10=d10(f10[3],m11,k11);return d10(d10(a10,b11,u10),s10,v10)}function c10(a10,b11){if(!b11)return[0,0,a10,0,1];var d11=b11[3],e11=b11[2],f10=b11[1],g10=i(k10[1],a10,e11);if(g10===0)return b11;if(0<=g10){var h10=c10(a10,d11);return d11===h10?b11:l10(f10,e11,h10)}var j11=c10(a10,f10);return f10===j11?b11:l10(j11,e11,d11)}function b10(a10){return[0,0,a10,0,1]}var m10=0;function e10(a10,b11){for(var c11=b11;;){if(!c11)return;var d11=c11[3],f10=c11[2];e10(a10,c11[1]),h(a10,f10),c11=d11}}function n10(a10,b11){for(var d11=a10,c11=b11;;){if(!c11)return d11;var e11=c11[2],f10=c11[1];d11=[0,e11,n10(d11,c11[3])],c11=f10}}function o10(a10,b11,c11){for(var d11=c11;;){if(!d11)return;var e11=d11[3],f10=d11[1];d11=h(b11,d11[2])?e11:f10}}function p10(a10){function c11(a11,b11){if(3>=a11>>>0)switch(a11){case 0:return[0,0,b11];case 1:if(b11)return[0,[0,0,b11[1],0,1],b11[2]];break;case 2:if(b11){var h10=b11[2];if(h10)return[0,[0,[0,0,b11[1],0,1],h10[1],0,2],h10[2]]}break;default:if(b11){var i10=b11[2];if(i10){var j11=i10[2];if(j11)return[0,[0,[0,0,b11[1],0,1],i10[1],[0,0,j11[1],0,1],2],j11[2]]}}}var k11=a11/2|0,l11=c11(k11,b11),e11=l11[2],n11=l11[1];if(!e11)throw g([0,f,mJ],1);var o11=e11[1],m11=c11((a11-k11|0)-1|0,e11[2]),p11=m11[2];return[0,d10(n11,o11,m11[1]),p11]}return c11(ec(a10),a10)[1]}return[0,,,,c10,,,,,,,,,,,,,m10,,,,,,,,,,,,,,e10,,,,,,,,function(a10){return n10(0,a10)},,,,,,,,,,,function(a10,b11){for(var c11=b11;;){if(!c11)return;var d11=c11[2],e11=c11[3],f10=c11[1];if(h(a10,d11))return o10(d11,a10,e11);c11=f10}},,,,,,,function(a10){if(!a10)return m10;var f10=a10[2],d11=a10[1];if(!f10)return b10(d11);var g10=f10[2],e11=f10[1];if(!g10)return c10(e11,b10(d11));var h10=g10[2],i10=g10[1];if(!h10)return c10(i10,c10(e11,b10(d11)));var j11=h10[2],l11=h10[1];if(!j11)return c10(l11,c10(i10,c10(e11,b10(d11))));if(j11[2])return p10(mg(k10[1],a10));var n11=j11[1];return c10(n11,c10(l11,c10(i10,c10(e11,b10(d11)))))}]}function mK(a10){var b10=mE(a10);return[0,b10[17],,,b10[4],,,,,,,,,,b10[31],,,,,,,,,b10[39],,,,,,,,,,,,,b10[50],b10[57]]}function mL(f10){function h10(a10){return a10?a10[5]:0}function e10(a10,b10,c11,d11){var e11=h10(a10),f11=h10(d11),g10=f11<=e11?e11+1|0:f11+1|0;return[0,a10,b10,c11,d11,g10]}function d10(a10,b10,c11,d11){var i10=a10?a10[5]:0,j11=d11?d11[5]:0;if((j11+2|0)=j11){var B2=j11<=i10?i10+1|0:j11+1|0;return[0,a10,b10,c11,d11,B2]}if(!d11)return t(mP);var l11=d11[4],o11=d11[3],p10=d11[2],g10=d11[1],w10=h10(g10);if(w10<=h10(l11))return e10(e10(a10,b10,c11,g10),p10,o11,l11);if(!g10)return t(mO);var x10=g10[3],y10=g10[2],z10=g10[1],A10=e10(g10[4],p10,o11,l11);return e10(e10(a10,b10,c11,z10),y10,x10,A10)}function j10(a10,b10,c11){if(!c11)return[0,0,a10,b10,0,1];var e11=c11[4],h11=c11[3],k11=c11[2],g10=c11[1],o11=c11[5],l11=i(f10[1],a10,k11);if(l11===0)return h11===b10?c11:[0,g10,a10,b10,e11,o11];if(0<=l11){var m11=j10(a10,b10,e11);return e11===m11?c11:d10(g10,k11,h11,m11)}var n11=j10(a10,b10,g10);return g10===n11?c11:d10(n11,k11,h11,e11)}function n10(a10){for(var b10=a10;;){if(!b10)throw g(az,1);var c11=b10[1];if(!c11)return[0,b10[2],b10[3]];b10=c11}}function c10(a10){if(!a10)return t(mQ);var b10=a10[1];if(!b10)return a10[4];var e11=a10[4],f11=a10[3],g10=a10[2];return d10(c10(b10),g10,f11,e11)}function o10(a10,b10){if(!a10)return b10;if(!b10)return a10;var e11=n10(b10),f11=e11[2],g10=e11[1];return d10(a10,g10,f11,c10(b10))}function k10(a10,b10){if(!b10)return 0;var c11=b10[4],h11=b10[3],g10=b10[2],e11=b10[1],j11=i(f10[1],a10,g10);if(j11===0)return o10(e11,c11);if(0<=j11){var l11=k10(a10,c11);return c11===l11?b10:d10(e11,g10,h11,l11)}var m11=k10(a10,e11);return e11===m11?b10:d10(m11,g10,h11,c11)}function l10(a10,b10){for(var c11=b10;;){if(!c11)return 0;var d11=c11[4],e11=c11[3],f11=c11[2];l10(a10,c11[1]),i(a10,f11,e11),c11=d11}}function m10(a10,b10,c11){for(var d11=b10,e11=c11;;){if(!d11)return e11;var f11=d11[4],g10=d11[3],h11=d11[2],i10=y(a10,h11,g10,m10(a10,d11[1],e11));d11=f11,e11=i10}}return[0,,,,,0,,j10,function(a10,b10){for(var c11=b10;;){if(!c11)throw g(az,1);var e11=c11[4],h11=c11[3],j11=c11[1],d11=i(f10[1],a10,c11[2]);if(d11===0)return h11;var k11=0<=d11?e11:j11;c11=k11}},,,,,,,,,function(a10,b10){for(var c11=b10;;){if(!c11)return 0;var e11=c11[4],g10=c11[3],h11=c11[1],d11=i(f10[1],a10,c11[2]);if(d11===0)return[0,g10];var j11=0<=d11?e11:h11;c11=j11}},,,,,,,k10,,l10,,,m10]}function ek(a10){var b10=mL(a10);return[0,b10[5],,,b10[7],,,b10[24],,,,,b10[26],b10[29],,,,,,,,,,,,,,,b10[8],b10[17]]}var el=[q,mR,af(0)];function bE(a10){return[0,0,0]}function b9(a10){a10[1]=0,a10[2]=0}function a6(a10,b10){return b10[1]=[0,a10,b10[1]],b10[2]=b10[2]+1|0,0}function bF(a10){var b10=a10[1];if(!b10)return 0;var c10=b10[1];return a10[1]=b10[2],a10[2]=a10[2]-1|0,[0,c10]}function bG(a10){var b10=a10[1];return b10?[0,b10[1]]:0}function mS(a10){var b10=a10[1];if(!b10)throw g(el,1);a10[1]=b10[2],a10[2]=a10[2]-1|0}function mT(a10){if(!a10[1])throw g(el,1)}function mU(a10,b10){return a5(a10,b10[1])}var mW=[q,mV,af(0)];function em(a10){return[0,0,0,0]}function en(a10){a10[1]=0,a10[2]=0,a10[3]=0}function eo(a10,b10){var c10=[0,a10,0],d10=b10[3];return d10?(b10[1]=b10[1]+1|0,d10[2]=c10,b10[3]=c10,0):(b10[1]=1,b10[2]=c10,b10[3]=c10,0)}function g1(a10){var b10=a10[2];if(!b10)throw g(mW,1);var c10=b10[1];if(b10[2]){var d10=b10[2];return a10[1]=a10[1]-1|0,a10[2]=d10,c10}return en(a10),c10}function ep(a10){return a10[1]===0?1:0}function mX(a10){var b10=a10[2];return b10?[0,b10[1]]:0}function mY(a10){var b10=a10[2];if(!b10)return 0;var c10=b10[1];if(b10[2]){var d10=b10[2];return a10[1]=a10[1]-1|0,a10[2]=d10,[0,c10]}return en(a10),[0,c10]}function b_(a10){var b10=1<=a10?a10:1,c10=b7=(d10+b10|0));)c10[1]=2*c10[1]|0;b7a10[3])throw g([0,f,m3],1);if(!((d10+b10|0)<=a10[3]))throw g([0,f,m2],1)}function b$(a10,b10){var c10=n(b10),d10=a10[2]+c10|0;a10[3]=b10?eg(a10[1],b10,c10):t(m0)}function m1(a10){return a10[2]}function m5(a10,b10){var c10=a10[2];a10[3]<=c10&&eq2(a10,1),B(a10[1],c10,b10),a10[2]=c10+1|0}function m6(a10,b10,c10,d10){var e10=c10<0?1:0;if(e10)var f10=e10;else var h10=d10<0?1:0,f10=h10||((n(b10)-d10|0)e10){if(e10!==32){if(43>e10)break a;switch(e10-43|0){case 5:c:if(c10<(d10+2|0)&&1=(d10+1|0))break a;var f10=bi(d10+1|0,48);return a0(f10,0,e10),aL(b10,1,f10,(d10-c10|0)+2|0,c10-1|0),aa(f10)}if(71<=e10){if(5>>0)break a}else if(65>e10)break a}if(c10a10)return b10;var h10=[0,0],i10=n(b10)-1|0,o10=0;if(i10>=0)for(var d10=o10;;){9>=$(b10,d10)+ku>>>0&&h10[1]++;var r10=d10+1|0;if(i10===d10)break;d10=r10}var j10=h10[1],k10=F(n(b10)+((j10-1|0)/3|0)|0),l10=[0,0];function e10(a11){a0(k10,l10[1],a11),l10[1]++}var f10=[0,((j10-1|0)%3|0)+1|0],m10=n(b10)-1|0,p10=0;if(m10>=0)for(var c10=p10;;){var g10=$(b10,c10);9>>0||(f10[1]===0&&(e10(95),f10[1]=3),f10[1]--),e10(g10);var q10=c10+1|0;if(m10===c10)break;c10=q10}return aa(k10)}function oM(a10,b10){return cX(a10,dX(nT(a10),b10))}function oN(a10,b10){return cX(a10,dX(oj(a10),b10))}function oO(a10,b10){return cX(a10,dX(ox(a10),b10))}function oP(a10,b10){return cX(a10,Ao(n7(a10),b10))}function aM(d10,b10,c10){function a10(a11){switch(d10[1]){case 0:var e11=45;break;case 1:var e11=43;break;default:var e11=32}return Aj(c10,b10,e11)}function e10(a11){var b11=z6(c10);return b11===3?c10<0?oR:oS:4<=b11?oT:a11}function f10(b11){var e11=n(b11);return function(a11){for(var c11=a11;;){if(c11===e11)return 0;var d11=z(b11,c11)-46|0;a:{if(23>>0){if(d11===55)break a}else if(21>>0)break a;c11=c11+1|0;continue}return 1}}(0)?b11:aA(b11,oQ)}switch(d10[2]){case 5:return e10(f10(gm(g6(d10,b10),c10)));case 6:return a10(0);case 7:return my(a10(0));case 8:return e10(a10(0));default:return gm(g6(d10,b10),c10)}}function oU(a10){var b10=l0(a10),c10=n(b10),d10=bi(c10+2|0,39);return cB(b10,0,d10,1,c10),aa(d10)}function oV(a10){var b10=g2(16);return es(b10,a10),g4(b10)}function cs(a10,b10,c10,d10){for(var k10=b10,j10=c10,e10=d10;;){if(typeof e10=="number")return h(k10,j10);switch(e10[0]){case 0:var t10=e10[1];return function(a11){return o(k10,[5,j10,a11],t10)};case 1:var u10=e10[1];return function(a11){return o(k10,[4,j10,oU(a11)],u10)};case 2:return et(k10,j10,e10[2],e10[1],function(a11){return a11});case 3:return et(k10,j10,e10[2],e10[1],nS);case 4:return cY(k10,j10,e10[4],e10[2],e10[3],oM,e10[1]);case 5:return cY(k10,j10,e10[4],e10[2],e10[3],oN,e10[1]);case 6:return cY(k10,j10,e10[4],e10[2],e10[3],oO,e10[1]);case 7:return cY(k10,j10,e10[4],e10[2],e10[3],oP,e10[1]);case 8:return oW(k10,j10,e10[4],e10[2],e10[3],e10[1]);case 9:return et(k10,j10,e10[2],e10[1],lH);case 10:j10=[7,j10],e10=e10[1];break;case 11:j10=[2,j10,e10[1]],e10=e10[2];break;case 12:j10=[3,j10,e10[1]],e10=e10[2];break;case 13:var v10=e10[3],w10=oV(e10[2]);return function(a11){return o(k10,[4,j10,w10],v10)};case 14:var y10=e10[3],z10=e10[2];return function(a11){return o(k10,j10,x(nR(a11[1],z10),y10))};case 15:var A10=e10[1];return function(c11,b11){return o(k10,[6,j10,function(a11){return i(c11,a11,b11)}],A10)};case 16:var B2=e10[1];return function(a11){return o(k10,[6,j10,a11],B2)};case 17:j10=[0,j10,e10[1]],e10=e10[2];break;case 18:var l10=e10[1];if(l10[0]===0){let b11=j10,c11=k10,d11=e10[2];k10=function(a11){return o(c11,[1,b11,[0,a11]],d11)},j10=0,e10=l10[1][1]}else{let b11=j10,c11=k10,d11=e10[2];k10=function(a11){return o(c11,[1,b11,[1,a11]],d11)},j10=0,e10=l10[1][1]}break;case 19:throw g([0,f,oY],1);case 20:var C2=e10[3],D2=[8,j10,oZ];return function(a11){return o(k10,D2,C2)};case 21:var E2=e10[2];return function(a11){return o(k10,[4,j10,dX(km,a11)],E2)};case 22:var F2=e10[1];return function(a11){return o(k10,[5,j10,a11],F2)};case 23:var m10=e10[2],n10=e10[1];return a10<50?jm(a10+1|0,k10,j10,n10,m10):r(jm,[0,k10,j10,n10,m10]);default:var p10=e10[3],q10=e10[1],s10=h(e10[2],0);return a10<50?fF(a10+1|0,k10,j10,p10,q10,s10):r(fF,[0,k10,j10,p10,q10,s10])}}}function o(a10,b10,c10){return bC(cs(0,a10,b10,c10))}function jm(a10,b10,c10,d10,e10){if(typeof d10=="number")switch(d10){case 0:return a10<50?s(a10+1|0,b10,c10,e10):r(s,[0,b10,c10,e10]);case 1:return a10<50?s(a10+1|0,b10,c10,e10):r(s,[0,b10,c10,e10]);case 2:throw g([0,f,o0],1);default:return a10<50?s(a10+1|0,b10,c10,e10):r(s,[0,b10,c10,e10])}switch(d10[0]){case 0:return a10<50?s(a10+1|0,b10,c10,e10):r(s,[0,b10,c10,e10]);case 1:return a10<50?s(a10+1|0,b10,c10,e10):r(s,[0,b10,c10,e10]);case 2:return a10<50?s(a10+1|0,b10,c10,e10):r(s,[0,b10,c10,e10]);case 3:return a10<50?s(a10+1|0,b10,c10,e10):r(s,[0,b10,c10,e10]);case 4:return a10<50?s(a10+1|0,b10,c10,e10):r(s,[0,b10,c10,e10]);case 5:return a10<50?s(a10+1|0,b10,c10,e10):r(s,[0,b10,c10,e10]);case 6:return a10<50?s(a10+1|0,b10,c10,e10):r(s,[0,b10,c10,e10]);case 7:return a10<50?s(a10+1|0,b10,c10,e10):r(s,[0,b10,c10,e10]);case 8:return a10<50?s(a10+1|0,b10,c10,e10):r(s,[0,b10,c10,e10]);case 9:var h10=d10[2];return a10<50?fG(a10+1|0,b10,c10,h10,e10):r(fG,[0,b10,c10,h10,e10]);case 10:return a10<50?s(a10+1|0,b10,c10,e10):r(s,[0,b10,c10,e10]);default:return a10<50?s(a10+1|0,b10,c10,e10):r(s,[0,b10,c10,e10])}}function fG(a10,h10,c10,d10,e10){if(typeof d10=="number")return a10<50?s(a10+1|0,h10,c10,e10):r(s,[0,h10,c10,e10]);switch(d10[0]){case 0:var b10=d10[1];return function(a11){return ag(h10,c10,b10,e10)};case 1:var i10=d10[1];return function(a11){return ag(h10,c10,i10,e10)};case 2:var j10=d10[1];return function(a11){return ag(h10,c10,j10,e10)};case 3:var k10=d10[1];return function(a11){return ag(h10,c10,k10,e10)};case 4:var l10=d10[1];return function(a11){return ag(h10,c10,l10,e10)};case 5:var m10=d10[1];return function(a11){return ag(h10,c10,m10,e10)};case 6:var n10=d10[1];return function(a11){return ag(h10,c10,n10,e10)};case 7:var o10=d10[1];return function(a11){return ag(h10,c10,o10,e10)};case 8:var p10=d10[2];return function(a11){return ag(h10,c10,p10,e10)};case 9:var q10=d10[3],t10=d10[2],u10=I(D(d10[1]),t10);return function(a11){return ag(h10,c10,W(u10,q10),e10)};case 10:var v10=d10[1];return function(a11,b11){return ag(h10,c10,v10,e10)};case 11:var w10=d10[1];return function(a11){return ag(h10,c10,w10,e10)};case 12:var x10=d10[1];return function(a11){return ag(h10,c10,x10,e10)};case 13:throw g([0,f,o1],1);default:throw g([0,f,o2],1)}}function ag(a10,b10,c10,d10){return bC(fG(0,a10,b10,c10,d10))}function s(a10,b10,c10,d10){var e10=[8,c10,o3];return a10<50?cs(a10+1|0,b10,e10,d10):r(cs,[0,b10,e10,d10])}function et(g10,f10,c10,d10,e10){if(typeof d10=="number")return function(a10){return o(g10,[4,f10,h(e10,a10)],c10)};if(d10[0]===0){var b10=d10[2],i10=d10[1];return function(a10){return o(g10,[4,f10,ac(i10,b10,h(e10,a10))],c10)}}var j10=d10[1];return function(a10,b11){return o(g10,[4,f10,ac(j10,a10,h(e10,b11))],c10)}}function cY(k10,j10,h10,d10,e10,f10,g10){if(typeof d10=="number"){if(typeof e10=="number")return e10?function(a10,b11){return o(k10,[4,j10,bI(a10,i(f10,g10,b11))],h10)}:function(a10){return o(k10,[4,j10,i(f10,g10,a10)],h10)};var b10=e10[1];return function(a10){return o(k10,[4,j10,bI(b10,i(f10,g10,a10))],h10)}}if(d10[0]===0){var c10=d10[2],l10=d10[1];if(typeof e10=="number")return e10?function(a10,b11){return o(k10,[4,j10,ac(l10,c10,bI(a10,i(f10,g10,b11)))],h10)}:function(a10){return o(k10,[4,j10,ac(l10,c10,i(f10,g10,a10))],h10)};var n10=e10[1];return function(a10){return o(k10,[4,j10,ac(l10,c10,bI(n10,i(f10,g10,a10)))],h10)}}var m10=d10[1];if(typeof e10=="number")return e10?function(a10,b11,c11){return o(k10,[4,j10,ac(m10,a10,bI(b11,i(f10,g10,c11)))],h10)}:function(a10,b11){return o(k10,[4,j10,ac(m10,a10,i(f10,g10,b11))],h10)};var p10=e10[1];return function(a10,b11){return o(k10,[4,j10,ac(m10,a10,bI(p10,i(f10,g10,b11)))],h10)}}function oW(i10,h10,g10,d10,e10,f10){if(typeof d10=="number"){if(typeof e10=="number")return e10?function(a10,b11){return o(i10,[4,h10,aM(f10,a10,b11)],g10)}:function(a10){return o(i10,[4,h10,aM(f10,er(f10),a10)],g10)};var b10=e10[1];return function(a10){return o(i10,[4,h10,aM(f10,b10,a10)],g10)}}if(d10[0]===0){var c10=d10[2],j10=d10[1];if(typeof e10=="number")return e10?function(a10,b11){return o(i10,[4,h10,ac(j10,c10,aM(f10,a10,b11))],g10)}:function(a10){return o(i10,[4,h10,ac(j10,c10,aM(f10,er(f10),a10))],g10)};var l10=e10[1];return function(a10){return o(i10,[4,h10,ac(j10,c10,aM(f10,l10,a10))],g10)}}var k10=d10[1];if(typeof e10=="number")return e10?function(a10,b11,c11){return o(i10,[4,h10,ac(k10,a10,aM(f10,b11,c11))],g10)}:function(a10,b11){return o(i10,[4,h10,ac(k10,a10,aM(f10,er(f10),b11))],g10)};var m10=e10[1];return function(a10,b11){return o(i10,[4,h10,ac(k10,a10,aM(f10,m10,b11))],g10)}}function fF(a10,b10,c10,d10,e10,f10){if(e10){var i10=e10[1];return function(a11){return oX(b10,c10,d10,i10,h(f10,a11))}}var g10=[4,c10,f10];return a10<50?cs(a10+1|0,b10,g10,d10):r(cs,[0,b10,g10,d10])}function oX(a10,b10,c10,d10,e10){return bC(fF(0,a10,b10,c10,d10,e10))}function aN(a10,b10){for(var c10=b10;;){if(typeof c10=="number")return;switch(c10[0]){case 0:var f10=c10[1],g10=g5(c10[2]);return aN(a10,f10),b6(a10,g10);case 1:var d10=c10[2],e10=c10[1];if(d10[0]===0){var i10=d10[1];aN(a10,e10),b6(a10,o4),c10=i10}else{var j10=d10[1];aN(a10,e10),b6(a10,o5),c10=j10}break;case 6:var m10=c10[2];return aN(a10,c10[1]),h(m10,a10);case 7:return aN(a10,c10[1]),cN(a10);case 8:var n10=c10[2];return aN(a10,c10[1]),t(n10);case 2:case 4:var k10=c10[2];return aN(a10,c10[1]),b6(a10,k10);default:var l10=c10[2];return aN(a10,c10[1]),lS(a10,l10)}}}function aO(a10,b10){for(var c10=b10;;){if(typeof c10=="number")return;switch(c10[0]){case 0:var f10=c10[1],g10=g5(c10[2]);return aO(a10,f10),b$(a10,g10);case 1:var d10=c10[2],e10=c10[1];if(d10[0]===0){var i10=d10[1];aO(a10,e10),b$(a10,o6),c10=i10}else{var j10=d10[1];aO(a10,e10),b$(a10,o7),c10=j10}break;case 6:var m10=c10[2];return aO(a10,c10[1]),b$(a10,h(m10,0));case 7:c10=c10[1];break;case 8:var n10=c10[2];return aO(a10,c10[1]),t(n10);case 2:case 4:var k10=c10[2];return aO(a10,c10[1]),b$(a10,k10);default:var l10=c10[2];return aO(a10,c10[1]),m5(a10,l10)}}}function o8(a10){var c10=a10[1],b10=b_(cy);return o(function(a11){return aO(b10,a11),a3(cV(b10))},0,c10)}function o9(c10){if(c10==e)return o_;var f10=n(c10);function j10(a11){return h(o8(o$),c10)}function k10(a11){for(var b11=a11;;){if(b11===f10)return b11;var d11=z(c10,b11);if(d11!==9&&d11!==32)return b11;b11=b11+1|0}}var i10=k10(0),o10=function(a11,b11){for(var d11=b11;;){if(d11===f10||25>>0)return d11;d11=d11+1|0}}(i10,i10),a10=eh(c10,i10,o10-i10|0),d10=k10(o10),l10=function(a11,b11){for(var d11=b11;;){if(d11===f10)return d11;var e10=z(c10,d11);a:{if(48<=e10){if(58>e10)break a}else if(e10===45)break a;return d11}d11=d11+1|0}}(d10,d10);if(d10===l10)var m10=0;else try{var r10=ln(eh(c10,d10,l10-d10|0)),m10=r10}catch(f11){var p10=M(f11);if(p10[1]!==b4)throw g(p10,0);var q10=j10(0),m10=q10}k10(l10)!==f10&&j10(0);a:{if(a10!==e&&a10!==jD){if(a10==="h"){var b10=0;break a}if(a10==="hov"){var b10=3;break a}if(a10==="hv"){var b10=2;break a}if(a10!=="v"){var b10=j10(0);break a}var b10=1;break a}var b10=4}return[0,m10,b10]}function pa(d10,b10,c10){return o(function(a10){return aN(b10,a10),h(d10,b10)},0,c10[1])}function cZ(a10,b10){return pa(function(a11){return 0},a10,b10)}function eu(a10){return cZ(au,a10)}function ev(c10,b10){return o(function(a10){var b11=b_(64);return aO(b11,a10),h(c10,cV(b11))},0,b10[1])}function C(a10){return ev(function(a11){return a11},a10)}var ew=d8(0);function ey(a10,b10){var c10=a10[1+b10];return lT(c10)?ay(c10)===dF?h(C(pb),c10):ay(c10)===kD?lN(c10):pc:h(C(pd),c10)}function g7(a10,b10){if(a10.length-1<=b10)return pe;var c10=g7(a10,b10+1|0),d10=ey(a10,b10);return i(C(pf),d10,c10)}function pg(a10){var b10=a10.length-1;if(2>=b10>>>0)switch(b10){case 0:return pi;case 1:return pj;default:var e10=ey(a10,1);return h(C(pk),e10)}var c10=g7(a10,2),d10=ey(a10,1);return i(C(ph),d10,c10)}function pl(d10){return function(a10){for(var b10=a10;;){if(!b10)return 0;var e10=b10[2],f10=b10[1];a:{try{var c10=h(f10,d10)}catch{break a}if(c10)return[0,c10[1]]}b10=e10}}(cK(ew))}function pm(a10){if(a10===d_)return pn;if(a10===gG)return po;if(a10[1]===gF){var b10=a10[2],e10=b10[3],i10=b10[2],j10=b10[1];return fJ(C(ex),j10,i10,e10,e10+5|0,pp)}if(a10[1]===f){var c10=a10[2],g10=c10[3],k10=c10[2],l10=c10[1];return fJ(C(ex),l10,k10,g10,g10+6|0,pq)}if(a10[1]===b5){var d10=a10[2],h10=d10[3],m10=d10[2],n10=d10[1];return fJ(C(ex),n10,m10,h10,h10+6|0,pr)}if(ay(a10)!==0)return a10[1];var o10=a10[1][1];return aA(o10,pg(a10))}function c0(a10){var b10=pl(a10);return b10?b10[1]:pm(a10)}function ps(a10){var b10=[0,z7(a10)];return b10}function pt(c10,b10){function a10(a11){return a11?c10===0?pu:pv:c10===0?pw:px}if(b10[0]===0){var d10=b10[5],e10=b10[4],f10=b10[3],g10=b10[6]?py:pA,i10=b10[2],j10=b10[7],k10=a10(b10[1]);return[0,zU(C(pz),k10,j10,i10,g10,f10,e10,d10)]}if(b10[1])return 0;var l10=a10(0);return[0,h(C(pB),l10)]}function pC(a10,b10){if(!b10)return cZ(a10,pE);var d10=b10[1],e10=d10.length-2|0,g10=0;if(e10>=0)for(var c10=g10;;){var f10=pt(c10,j(d10,c10)[1+c10]);if(f10){var i10=f10[1];h(cZ(a10,pD),i10)}var k10=c10+1|0;if(e10===c10)break;c10=k10}return 0}function c1(a10,b10){return pC(a10,ps(b10))}var pH=pG.slice();function pI(a10,b10){var e10=c0(a10);h(eu(pJ),e10),c1(au,b10);var c10=AF(0);if(c10<0){var d10=cM(c10);gK(j(pH,d10)[1+d10])}return cN(au)}var pK=[0];function g8(a10){var b10=lh(0);return b10}function pL(a10,b10){try{var d10=b10?pK:g8(0);try{ea(0)}catch{}try{var f10=pI(a10,d10),e10=f10}catch(f11){var i10=M(f11),j10=g8(0),k10=c0(a10);h(eu(pN),k10),c1(au,d10);var l10=c0(i10);h(eu(pO),l10),c1(au,j10);var e10=cN(au)}return e10}catch(f11){var c10=M(f11);if(c10===d_)return gK(pM);throw g(c10,0)}}gB(kO,function(a10,b10){try{var c10=pL(a10,b10);return c10}catch{return 0}});function pF(a10){for(;;){var b10=cK(ew),c10=1-d9(ew,b10,[0,a10,b10]);if(!c10)return c10}}function pP(a10){return lh(a10)}var pR=[q,pQ,af(0)];pF(function(a10){return a10[1]===pR?[0,aA(pS,c0(a10[2]))]:0});function pT(a10){return AD(a10,0,n(a10))}function pU(a10){return[0,aq(55,0),0]}function pV(a10,b10){function l10(a11,b11){return pT(aA(a11,gQ(b11)))}function m10(a11){var b11=z(a11,3)<<24,c11=z(a11,2)<<16,d11=z(a11,1)<<8;return((z(a11,0)+d11|0)+c11|0)+b11|0}for(var g10=b10.length-1===0?[0,0]:b10,h10=g10.length-1,c10=0;;){j(a10[1],c10)[1+c10]=c10;var s10=c10+1|0;if(c10===54)break;c10=s10}var f10=[0,pW],i10=54+gP(55,h10)|0,n10=0;if(i10>=0)for(var d10=n10;;){var e10=d10%55|0,k10=AK(d10,h10),o10=j(g10,k10)[1+k10];f10[1]=l10(f10[1],o10);var p10=m10(f10[1]),q10=(j(a10[1],e10)[1+e10]^p10)&j9;j(a10[1],e10)[1+e10]=q10;var r10=d10+1|0;if(i10===d10)break;d10=r10}a10[2]=0}function pX(a10){var b10=pU(0);return pV(b10,a10),b10}function g9(a10){return pX(AX(0))}function c2(a10){a10[2]=(a10[2]+1|0)%55|0;var b10=a10[2],c10=j(a10[1],b10)[1+b10],d10=(a10[2]+24|0)%55|0,e10=(j(a10[1],d10)[1+d10]+(c10^(c10>>>25|0)&31)|0)&j9,f10=a10[2];return j(a10[1],f10)[1+f10]=e10,e10}function g_(a10){var b10=gu(d0(c2(a10)),9),c10=gu(d0(c2(a10)),9);return lk(b10,lk(ll(c10,21),ll(gu(d0(c2(a10)),8),42)))}function pY(a10){var b10=a10.length-1<4?1:0,c10=b10||(a10[4]<0?1:0);return c10}try{var zS=lz(kE),hc=zS}catch(f10){var g$=M(f10);if(g$!==az)throw g(g$,0);try{var zR=lz("CAMLRUNPARAM"),hb=zR}catch(f11){var ha=M(f11);if(ha!==az)throw g(ha,0);var hb=pZ}var hc=hb}var c3=[bb,function(a10){return g9(0)}],p0=mx(hc,82);function p1(a10,b10){for(var c10=a10;;){if(b10<=c10||eb<(c10*2|0))return c10;c10=c10*2|0}}function hd(a10,b10){var f10=a10?a10[1]:p0,c10=p1(16,b10);if(f10)var d10=ay(c3),g10=aE===d10?c3[1]:bb===d10?cO(c3):c3,e10=c2(g10);else var e10=0;return[0,0,aq(c10,0),e10,c10]}function p2(m10,b10,c10,d10){var g10=d10.length-1,f10=aq(g10,0),i10=c10.length-2|0;function n10(a11){for(var c11=a11;;){if(!c11)return;var i11=c11[1],l11=c11[2],n11=c11[3],g11=b10?c11:[0,i11,l11,0],e11=h(m10,i11),k11=j(f10,e11)[1+e11];k11?k11[3]=g11:j(d10,e11)[1+e11]=g11,j(f10,e11)[1+e11]=g11,c11=n11}}var o10=0;if(i10>=0)for(var e10=o10;;){n10(j(c10,e10)[1+e10]);var r10=e10+1|0;if(i10===e10)break;e10=r10}if(b10){var k10=g10-1|0,p10=0;if(k10>=0)for(var a10=p10;;){var l10=j(f10,a10)[1+a10];l10&&(l10[3]=0);var q10=a10+1|0;if(k10===a10)break;a10=q10}}}function p3(a10,b10){var c10=b10[2],d10=(c10.length-1)*2|0,e10=d10>>0))return hk(a10,d10)}function qb(a10){var b10=mY(a10[28]);if(b10){var c10=b10[1],d10=c10[1];a10[12]=a10[12]-c10[3]|0;var e10=d10;a10[9]=a10[9]+e10|0}}function qc(a10,b10,c10){if(typeof c10=="number")switch(c10){case 0:var j10=bG(a10[3]);if(!j10)return;var k10=j10[1][1],l10=function(a11,b11){if(!b11)return[0,a11,0];var c11=b11[1],d11=b11[2];return Az(a11,c11)?[0,a11,b11]:[0,c11,l10(a11,d11)]};k10[1]=l10(a10[6]-a10[9]|0,k10[1]);return;case 1:bF(a10[2]);return;case 2:bF(a10[3]);return;case 3:var m10=bG(a10[2]);return m10?hk(a10,m10[1][2]):c5(a10);case 4:var o10=a10[10]!==(a10[6]-a10[9]|0)?1:0;return o10&&qb(a10);default:var p10=bF(a10[5]);return p10?eA(a10,h(a10[25],p10[1])):void 0}switch(c10[0]){case 0:return hj(a10,b10,c10[1]);case 1:var d10=c10[2],f10=c10[1],q10=d10[1],z10=d10[2],r10=bG(a10[2]);if(!r10)return;var s10=r10[1],e10=s10[2];switch(s10[1]){case 0:return bJ(a10,f10);case 1:return bj(a10,d10,e10);case 2:return bj(a10,d10,e10);case 3:return a10[9]<(b10+n(q10)|0)?bj(a10,d10,e10):bJ(a10,f10);case 4:return a10[11]?bJ(a10,f10):a10[9]<(b10+n(q10)|0)||((a10[6]-e10|0)+z10|0)=a10[14])return a10[13]=hi,hl(a10),b10&&c5(a10),qp(a10);hq(a10,0)}}function eD(a10,b10,c10){var d10=a10[14]=c10)return y(a10[17],hu,0,c10);y(a10[17],hu,0,80),c10=c10-80|0}}function qC(a10){return a10[1]===cb?aA(qE,aA(a10[2],qD)):qF}function qG(a10){return a10[1]===cb?aA(qI,aA(a10[2],qH)):qJ}function qK(a10){return 0}function qL(a10){return 0}function qM(a10,b10,c10,d10,e10){var g10=em(0),h10=[0,hg,qN,0];eo(h10,g10);var f10=bE(0);eB(f10),a6([0,1,h10],f10);var i10=78,j10=bE(0),k10=bE(0),l10=bE(0);return[0,f10,bE(0),l10,k10,j10,i10,10,68,i10,0,1,1,1,1,gI,qO,a10,b10,c10,d10,e10,0,0,qC,qG,qK,qL,g10]}function hw(a10,b10){var c10=qM(a10,b10,function(a11){return 0},function(a11){return 0},function(a11){return 0});return c10[19]=function(a11){return qA(c10,a11)},c10[20]=function(a11){return hv(c10,a11)},c10[21]=function(a11){return hv(c10,a11)},c10}function hx(d10){return hw(function(a10,b10,c10){return lP(d10,a10,b10,c10)},function(a10){return cN(d10)})}function eE(d10){return hw(function(a10,b10,c10){return m6(d10,a10,b10,c10)},function(a10){return 0})}var qP=dJ,qQ=function(a10){return b_(qP)}(0),qR=hx(lO),qS=hx(au);eE(qQ);function qk(a10,b10){a10[22]&&(a6(b10,a10[4]),h(a10[26],b10));var c10=a10[23];return c10&&cc(a10,[0,c4,[5,b10],0])}function qr(a10,b10){return ht(a10,n(b10),b10)}function qs(a10,b10){return hs(a10,1),h(a10[18],0)}function qt(a10,b10){var c10=a10[14]=0)for(var c10=g10;;){qX(e10,c10,a10,j(b10,c10)[1+c10]);var h10=c10+1|0;if(f10===c10)break;c10=h10}return e10}function hA(a10,b10){return typeof b10!="number"&&b10[0]===0?hz(a10,b10[1]):a3(qY)}function qZ(a10,b10,c10,d10){if(typeof c10!="number")return c10[0]===0?hB(c10[1],a10[1+b10],d10):void 0;if(c10!==2){a10[1+b10]=d10;return}if(ay(d10)===0&&d10.length-1===4)for(var e10=0,h10=a10[1+b10];;){h10[1+e10]=d10[1+e10];var i10=e10+1|0;if(e10===3)return;e10=i10}throw g([0,f,q0],1)}function hB(a10,b10,c10){if(ay(c10)===0&&a10.length-1<=c10.length-1){var e10=a10.length-2|0,h10=0;if(e10>=0)for(var d10=h10;;){var i10=c10[1+d10];qZ(b10,d10,j(a10,d10)[1+d10],i10);var k10=d10+1|0;if(e10===d10)break;d10=k10}return}throw g([0,f,q1],1)}function hC(a10,b10,c10){return typeof a10!="number"&&a10[0]===0?hB(a10[1],b10,c10):a3(q2)}var eF=[q,q3,af(0)];qV(q4,[0,eF,[0]]);function eG(a10){return[0,a10]}function R(a10){return[0,a10]}function c7(a10){return a10[0]===0?[0,a10[1]]:0}var bL=[0,function(a10){return a10}(0)];function bM(a10){return[1,0,0,0,a10]}function k(a10,b10){return a10[0]===0?[0,h(b10,a10[1])]:bM([0,a10,b10])}function bN(a10,b10,c10){if(a10[0]===0){var d10=a10[1];if(b10[0]===0)return[0,i(c10,d10,b10[1])]}return bM([1,a10,b10,c10])}function hD(a10){return a10[0]===0?a10[1]:bM([4,a10,0])}function hE(a10,b10,c10){switch(c10[0]){case 0:throw g([0,f,q7],1);case 1:c10[3]=[0,b10,a10,c10[3]];return;default:c10[2]=[0,b10,a10,c10[2]];return}}function eH(a10,b10){if(!b10)throw g([0,f,q8],1);if(b10[2]===a10)return[0,b10[1],b10[3]];var c10=eH(a10,b10[3]),d10=c10[1];return b10[3]=c10[2],[0,d10,b10]}function ce(a10,b10){switch(b10[0]){case 0:throw g([0,f,q9],1);case 1:var c10=eH(a10,b10[3]),e10=c10[1];return b10[3]=c10[2],e10;default:var d10=eH(a10,b10[2]),h10=d10[1];return b10[2]=d10[2],h10}}function hF(a10,b10,c10,d10){for(var e10=d10;;){if(!e10)throw g([0,f,q_],1);if(e10[1]===b10&&e10[2]===a10){e10[1]=c10;return}e10=e10[3]}}function eI(a10,b10,c10,d10){switch(d10[0]){case 0:throw g([0,f,q$],1);case 1:return hF(a10,b10,c10,d10[3]);default:return hF(a10,b10,c10,d10[2])}}function hG(a10,b10){for(var c10=b10;;){if(!c10)throw g([0,f,ra],1);if(c10[2]===a10)return c10[1];c10=c10[3]}}function rb(a10,b10){switch(b10[0]){case 0:throw g([0,f,rc],1);case 1:return hG(a10,b10[3]);default:return hG(a10,b10[2])}}function aU(a10,b10,c10,d10){switch(d10[0]){case 0:throw g([0,f,rd],1);case 1:var j10=d10[1];if(typeof j10=="number"&&!j10){if(!c10||b10[1])return;b10[1]=1;return}var k10=d10[4];if(k10[0]===7){var n10=k10[2];if(n10[0]===1){var o10=n10[1];if(typeof o10=="number"){if(!o10&&c10){if(b10[1])return;b10[1]=1;return}}else if(c10)return}}var l10=d10[1];a:{if(typeof l10=="number"&&l10){var e10=1;break a}var e10=c10}d10[1]=0;var m10=d10[2];return a10<50?jn(a10+1|0,b10,e10,m10):r(jn,[0,b10,e10,m10]);default:var i10=d10[1];if(d10[1]=0,typeof i10=="number"){if(!i10)return;b10[1]=2;return}var p10=i10[1];return c10&&(b10[1]=2),h(d10[3],p10)}}function a7(a10,b10,c10){return bC(aU(0,a10,b10,c10))}function jn(a10,b10,c10,d10){if(typeof d10!="number")switch(d10[0]){case 0:var f10=d10[1];return a10<50?aU(a10+1|0,b10,c10,f10):r(aU,[0,b10,c10,f10]);case 1:var g10=d10[2];return a7(b10,c10,d10[1]),a10<50?aU(a10+1|0,b10,c10,g10):r(aU,[0,b10,c10,g10]);case 2:var h10=d10[3],l10=d10[2];return a7(b10,c10,d10[1]),a7(b10,c10,l10),a10<50?aU(a10+1|0,b10,c10,h10):r(aU,[0,b10,c10,h10]);case 3:var i10=d10[4],m10=d10[3],n10=d10[2];return a7(b10,c10,d10[1]),a7(b10,c10,n10),a7(b10,c10,m10),a10<50?aU(a10+1|0,b10,c10,i10):r(aU,[0,b10,c10,i10]);default:var o10=d10[1];d10[1]=0;var k10=o10-1|0,p10=0;if(k10>=0)for(var e10=p10;;){a7(b10,c10,j(d10[3],e10)[1+e10]);var q10=e10+1|0;if(k10===e10)break;e10=q10}return}}function re(a10){return i(cZ(au,rf),c1,Ac(20))}function c8(a10,b10){var c10=[0,0];a7(c10,a10,b10);var d10=2<=c10[1]?1:0;return d10&&re(0)}function ad(a10){return bM([5,a10])}function ao(a10){return a10}function _(a10,b10){if(a10[0]===1){var c10=a10[4];if(c10[0]===5)return c10[1]=b10,c8(0,a10)}throw g([0,f,rg],1)}function bk(a10){if(a10[0]===1){var b10=a10[4];if(b10[0]===5)return b10[1]}throw g([0,f,rh],1)}function bO(a10,b10,c10){for(var k10=a10,h10=b10,d10=c10;;)switch(d10[0]){case 0:return k10;case 1:var e10=d10[2];if(typeof e10=="number")throw g([0,f,rm],1);switch(e10[0]){case 0:if(e10[1]!==h10)throw g([0,f,rn],1);var o10=0;break;case 1:var B2=e10[2],C2=e10[1];if(C2===h10)var D2=[0,B2];else{if(B2!==h10)throw g([0,f,ro],1);var D2=[0,C2]}var o10=D2;break;case 2:var u10=e10[3],v10=e10[2],w10=e10[1];if(w10===h10)var x10=[1,v10,u10];else if(v10===h10)var x10=[1,w10,u10];else{if(u10!==h10)throw g([0,f,rp],1);var x10=[1,w10,v10]}var o10=x10;break;case 3:var p10=e10[4],q10=e10[3],r10=e10[2],s10=e10[1];if(s10===h10)var t10=[2,r10,q10,p10];else if(r10===h10)var t10=[2,s10,q10,p10];else if(q10===h10)var t10=[2,s10,r10,p10];else{if(p10!==h10)throw g([0,f,rq],1);var t10=[2,s10,r10,q10]}var o10=t10;break;default:var n10=ce(d10,h10);if(j(e10[3],n10)[1+n10]!==h10)throw g([0,f,rr],1);var m10=e10[2]-1|0;if(e10[2]=m10,n10>>2|0))var U2=mA(e10[3],0,K2>>>1|0),L2=[4,e10[1],e10[2],U2];else var L2=e10;var J2=L2}var o10=J2}if(d10[2]=o10,typeof o10!="number")return k10;var y10=d10[1];d10[1]=1;var l10=d10[4];switch(l10[0]){case 0:h10=d10,d10=l10[1];break;case 1:var N2=l10[2];k10=bO(k10,d10,l10[1]),h10=d10,d10=N2;break;case 2:var O2=l10[2];k10=bO(k10,d10,l10[1]),h10=d10,d10=O2;break;case 3:var P2=l10[2];k10=bO(k10,d10,l10[1]),h10=d10,d10=P2;break;case 4:var z10=l10[2],A10=bO(k10,d10,l10[1]);if(!z10)return A10;var Q2=z10[1];l10[2]=0,k10=A10,h10=d10,d10=Q2;break;case 5:return k10;case 6:if(typeof y10=="number")return k10;var R2=y10[1];try{return i(l10[2],d10,R2),k10}catch(f10){var S2=M(f10);return[0,[0,S2,pP(0)],k10]}default:var T2=l10[1];k10=bO(k10,d10,l10[2]),h10=d10,d10=T2}break;default:throw g([0,f,rs],1)}}function a8(a10,b10){for(var e10=a10,c10=b10;;)switch(c10[0]){case 0:return;case 1:var n10=typeof c10[2]=="number"?1:0,d10=c10[2];if(typeof d10=="number")var k10=[0,e10];else switch(d10[0]){case 0:var k10=[1,e10,d10[1]];break;case 1:var k10=[2,e10,d10[1],d10[2]];break;case 2:var k10=[3,e10,d10[1],d10[2],d10[3]];break;case 3:for(var o10=[0,d10[1],d10[2],d10[3],d10[4],e10,bL,bL,bL],l10=0;;){hE(c10,l10,j(o10,l10)[1+l10]);var w10=l10+1|0;if(l10===4)break;l10=w10}var k10=[4,5,5,o10];break;default:var i10=d10[2];if(i10>>1|0)}function hN(a10,b10,c10){if(typeof a10!="number"){if(a10[0]!==0){if(a10[2]!==b10)throw g([0,f,r2],1);a10[2]=c10;return}if(a10[2]===b10){a10[2]=c10;return}if(a10[4]===b10){a10[4]=c10;return}}throw g([0,f,r1],1)}function fI(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=c10[4];if(typeof d10!="number"&&d10[0]!==1){var h10=c10[5],e10=d10[2];if(typeof e10=="number")var i10=0;else{if(e10[0]!==0)throw g([0,f,r6],1);e10[5]=c10;var i10=e10}return d10[2]=c10,c10[4]=i10,c10[5]=d10,d10[5]=h10,hN(h10,c10,d10),eQ(b10,c10),a10<50?ct(a10+1|0,b10,d10):r(ct,[0,b10,d10])}}throw g([0,f,r5],1)}function r3(a10,b10){return bC(fI(0,a10,b10))}function fH(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=c10[2];if(typeof d10!="number"&&d10[0]!==1){var h10=c10[5],e10=d10[4];if(typeof e10=="number")var i10=0;else{if(e10[0]!==0)throw g([0,f,r8],1);e10[5]=c10;var i10=e10}return d10[4]=c10,c10[2]=i10,c10[5]=d10,d10[5]=h10,hN(h10,c10,d10),eQ(b10,c10),a10<50?ct(a10+1|0,b10,d10):r(ct,[0,b10,d10])}}throw g([0,f,r7],1)}function r4(a10,b10){return bC(fH(0,a10,b10))}function jp(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=c10[4];a:if(typeof d10!="number"&&d10[0]===0){var e10=bQ(d10[2]);if(eP(bQ(d10[4]),e10)){r4(b10,d10);break a}}return a10<50?fI(a10+1|0,b10,c10):r(fI,[0,b10,c10])}throw g([0,f,r9],1)}function jo(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=c10[2];a:if(typeof d10!="number"&&d10[0]===0){var e10=bQ(d10[4]);if(eP(bQ(d10[2]),e10)){r3(b10,d10);break a}}return a10<50?fH(a10+1|0,b10,c10):r(fH,[0,b10,c10])}throw g([0,f,r_],1)}function ct(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=bQ(c10[2]),e10=bQ(c10[4]);return d10>>2|0)}function aB(a10,b10){if(typeof a10=="number")var c10=b10;else{if(typeof b10!="number"){var d10=da(b10);return[1,(hS(da(a10),d10)+1|0)<<2,a10,b10]}var c10=a10}return c10}function hT(a10){return typeof a10=="number"?0:a10[0]===0?[0,a10[2]]:[1,a10[2],a10[3]]}var eR=1,eS=2,sF=3;function hU(a10){return a10===-1?1:0}function eT(a10){return a10!==-1?1:0}function bR(a10){return(a10&3)===3?1:0}function hV(a10){return(a10&3)===1?1:0}function hW(a10){return(a10&3)===2?1:0}function hX(a10){return a10|3}function sG(a10){return a10>>>2|0}function hY(a10){return a10<<2|2}function ci(a10){return a10&lG(sF)}function hZ(a10){return a10[2]}function h0(a10){return a10[3]}function h1(a10){return[0,0,0,0]}function db(a10){a10[1]=a10[1]+1|0}function dc(a10){a10[2]=a10[2]+1|0}function dd(a10){a10[3]=a10[3]+1|0}function eU(a10,b10,c10){for(var d10=c10;;){if(typeof d10=="number")return;if(d10[0]===0){var e10=d10[1],i10=(e10&3)!==3?1:0,l10=i10&&(e10&3?1:0);if(l10){if(e10&b10)throw g([0,f,sI],1);db(a10),dd(a10),d10[1]=e10|3}return}var h10=d10[1],j10=(h10&3)!==3?1:0,k10=j10&&(h10&3?1:0);if(!k10)return k10;if(h10&b10)throw g([0,f,sJ],1);db(a10),dd(a10),d10[1]=h10|3,eU(a10,b10,d10[2]),d10=d10[3]}}function de(a10,b10,c10,d10){if(typeof d10!="number"){if(d10[0]===0){var e10=d10[1];e10&c10||(db(a10),e10&3?(d10[1]=-1,dd(a10),dc(a10)):d10[1]=e10|c10);var g10=e10!==-1?1:0,h10=g10&&((e10&3)===3?1:0);return h10&&(d10[1]=-1,dc(a10))}var f10=d10[1];f10&c10||(db(a10),f10&3?(d10[1]=-1,dd(a10),dc(a10),eU(a10,c10,d10[2]),eU(a10,c10,d10[3])):(d10[1]=f10|c10,eo(d10,b10)));var i10=f10!==-1?1:0,j10=i10&&((f10&3)===3?1:0);return j10&&(d10[1]=-1,dc(a10))}}function eV(a10,b10,c10){var d10=g1(b10);if(typeof d10!="number"&&d10[0]===1){var e10=(d10[1]&3)===c10?1:0;return e10&&(de(a10,b10,c10,d10[2]),de(a10,b10,c10,d10[3]))}throw g([0,f,sK],1)}function h2(a10,b10,c10){for(;;){if(ep(b10))return;eV(a10,b10,c10)}}function sL(a10,b10,c10,d10){for(;;){if(ep(c10))return h2(b10,d10,eS);if(ep(d10))return h2(a10,c10,eR);eV(a10,c10,eR),eV(b10,d10,eS)}}function eW(a10){var b10=a10[6];return a10[6]=b10+1|0,b10}function eX(a10){for(var b10=a10;;){if(typeof b10=="number")return;if(b10[0]===0){var c10=b10[1];if(typeof c10!="number"&&c10[0]===0){var e10=c10[1],i10=eT(e10),l10=i10&&bR(e10);l10&&(c10[1]=ci(e10));return}throw g([0,f,sQ],1)}var d10=b10[1];if(typeof d10!="number"&&d10[0]===1){var h10=d10[1],m10=b10[4],n10=b10[3],j10=eT(h10),k10=j10&&bR(h10);if(!k10)return k10;d10[1]=ci(h10),eX(n10),b10=m10;continue}throw g([0,f,sR],1)}}function h3(a10,b10){for(var c10=b10;;){if(typeof c10=="number")return;if(c10[0]===0){var d10=c10[1];if(typeof d10!="number"&&d10[0]===0){var e10=d10[1],u10=c10[2];if(!hV(e10)){if(hU(e10)){var k10=eW(a10);j(a10[4],k10)[1+k10]=d10,j(a10[5],k10)[1+k10]=[0,c10,0],d10[1]=hY(k10);return}if(hW(e10)){var n10=sG(e10),v10=[0,c10,j(a10[5],n10)[1+n10]];j(a10[5],n10)[1+n10]=v10;return}var q10=bR(e10);if(q10)throw g([0,f,sU],1);return q10}var m10=a10[2];if(-1a10[3]))throw g([0,f,sT],1);d10[1]=ci(e10);return}throw g([0,f,sS],1)}var h10=c10[1];if(typeof h10!="number"&&h10[0]===1){var r10=c10[4],s10=c10[3],i10=h10[1],w10=c10[2];if(hU(i10)){var l10=eW(a10);return j(a10[4],l10)[1+l10]=h10,j(a10[5],l10)[1+l10]=[0,c10,0],h10[1]=hY(l10),eX(s10),eX(r10)}if(!hV(i10)){if(hW(i10)){var o10=i10>>>2|0,x10=[0,c10,j(a10[5],o10)[1+o10]];j(a10[5],o10)[1+o10]=x10;return}var t10=bR(i10);if(t10)throw g([0,f,sX],1);return t10}if(-1a10[3])throw g([0,f,sW],1)}h10[1]=ci(i10),h3(a10,s10),c10=r10;continue}throw g([0,f,sV],1)}}function cj(a10,b10){if(typeof b10=="number")return 0;if(b10[0]!==0){var i10=b10[1];if(i10===-1){var l10=eW(a10);b10[1]=0,j(a10[4],l10)[1+l10]=b10;var p10=cj(a10,b10[2]);return[1,b10,0,p10,cj(a10,b10[3])]}if(!bR(i10)){b10[1]=ci(b10[1]);var r10=cj(a10,b10[2]);return[1,b10,0,r10,cj(a10,b10[3])]}var d10=i10>>>2|0,k10=j(a10[5],d10)[1+d10];if(!k10)throw g([0,f,s0],1);var m10=k10[2],q10=k10[1];return j(a10[5],d10)[1+d10]=m10,m10===0&&(b10[1]=0),q10}var e10=b10[1];if(eT(e10)&&bR(e10)){var c10=e10>>>2|0,h10=j(a10[5],c10)[1+c10];if(!h10)return[0,b10,0];var n10=h10[2],o10=h10[1];return j(a10[5],c10)[1+c10]=n10,o10}return b10[1]=0,[0,b10,0]}var eY=[0,0,[0],0,0];function sH(a10){return a10[1]}function sM(a10){return a10[1]}function sN(a10){return a10[2]}function sO(a10,b10){var c10=h1(0),d10=h1(0),e10=em(0),f10=em(0);return de(c10,e10,eR,a10),de(d10,f10,eS,b10),sL(c10,d10,e10,f10),[0,c10,d10]}function sP(a10){if(typeof a10!="number"){if(a10[0]===0){a10[1]=0;return}var b10=da(a10[3]);a10[1]=(hS(da(a10[2]),b10)+1|0)<<2}}function sY(a10){var e10=a10[6]-1|0,h10=0;if(e10>=0)for(var b10=h10;;){var c10=j(a10[4],b10)[1+b10];typeof c10!="number"&&(c10[0],c10[1]=hX(c10[1]));var d10=j(a10[5],b10)[1+b10];if(!d10)throw g([0,f,sZ],1);if(d10[2]){var i10=a4(d10);j(a10[5],b10)[1+b10]=i10}var k10=b10+1|0;if(e10===b10)break;b10=k10}}function h4(a10,b10,c10){if(typeof b10=="number"){if(typeof c10=="number")return[0,eY,0]}else if(b10[1]===c10)return[0,eY,b10];var t10=typeof b10=="number"?ch:b10[1],m10=sO(t10,c10),i10=sM(m10),n10=sN(m10),u10=h0(n10),v10=h0(i10)+u10|0,o10=sH(i10)-v10|0,w10=hZ(n10),p10=hZ(i10)+w10|0,x10=0,y10=aq(p10,0),z10=aq(p10,0),A10=a10?o10:-1,B2=a10?0:-1,C2=a10?aq(o10,0):[0],d10=[0,C2,B2,A10,z10,y10,x10];if(h3(d10,b10),d10[2]!==d10[3])throw g([0,f,s1],1);sY(d10);var q10=cj(d10,c10),r10=d10[6]-1|0;if(r10>=0)for(var h10=r10;;){sP(j(d10[4],h10)[1+h10]);var F2=h10-1|0;if(h10===0)break;h10=F2}if(!a10)return[0,eY,q10];var k10=[0,0],l10=[0,0],s10=d10[6]-1|0,D2=0;if(s10>=0)for(var e10=D2;;){a5(function(a11){if(typeof a11!="number")if(a11[0]===0){var b11=a11[2];if(b11)return k10[1]=[0,b11[1],k10[1]],0}else{var c11=a11[2];if(c11)return l10[1]=[0,c11[1],l10[1]],0}return 0},j(d10[5],e10)[1+e10]);var E2=e10+1|0;if(s10===e10)break;e10=E2}return[0,[0,d10[2],d10[1],k10[1],l10[1]],q10]}function s2(d10,b10){if(typeof b10=="number")return 0;function c10(a10){a:if(typeof a10!="number"){b:{if(a10[0]===0){var b11=a10[1];if(typeof b11!="number"&&b11[0]===0){var e10=a10[2];if(e10){var j10=e10[1];break b}var k10=h(d10[1],b11[2]);return a10[2]=[0,k10],k10}break a}var l10=a10[2];if(!l10){var n10=c10(a10[3]),o10=c10(a10[4]),m10=i(d10[2],n10,o10);return a10[2]=[0,m10],m10}var j10=l10[1]}return j10}throw g([0,f,s3],1)}return[0,c10(b10)]}function df(a10,b10){return[0,[0,a10,b10],0]}function dg(a10){return s2(a10[1],a10[2])}function s4(a10,b10){var c10=a10[1];return[0,c10,h4(0,a10[2],b10)[2]]}function eZ(a10,b10){var d10=a10[1],c10=h4(1,a10[2],b10);return[0,c10[1],[0,d10,c10[2]]]}function dh(a10,b10,c10,d10){var e10=[0,d10];if(w===a10)var h10=c10[1],g10=0;else if(kg<=a10)var h10=c10[2].length-1,g10=c10[1];else var h10=c10[2].length-1,g10=0;var k10=h10-1|0;if(k10>=g10)for(var f10=g10;;){var l10=j(c10[2],f10)[1+f10];l10&&(e10[1]=i(b10,l10[1],e10[1]));var m10=f10+1|0;if(k10===f10)break;f10=m10}kg>a10&&a5(function(a11){return e10[1]=i(b10,a11,e10[1]),0},c10[3]),w!==a10&&a5(function(a11){return e10[1]=i(b10,a11,e10[1]),0},c10[4])}function e0(a10,b10,c10){if(typeof c10=="number")throw g([0,f,s5],1);if(c10[0]===0)return h(a10,c10[2]);var d10=e0(a10,b10,c10[3]);return i(b10,e0(a10,b10,c10[2]),d10)}function bl(a10,b10,c10){var d10=b10[2],e10=b10[1],f10=c7(c10);if(f10){var g10=f10[1];return R(typeof g10=="number"?e10:e0(a10,d10,g10))}var h10=[0,df(a10,d10)];return k(c10,function(a11){var b11=s4(h10[1],a11);h10[1]=b11;var c11=dg(b11);return c11?c11[1]:e10})}var aP=[0,ch,aB];function s6(a10,b10){return c9(b10,aP,a10)}function di(a10){return s6(a10,J)}function h5(a10){function e10(a11,b10){for(var c10=a11,d10=b10;;){if(typeof c10=="number")return d10;if(c10[0]===0)return[0,c10[2],d10];var f10=e10(c10[3],d10);c10=c10[2],d10=f10}}return e10(a10,0)}var h6=[0,R(0),function(a10,b10){return bN(a10,b10,aB)}];function e1(c10,b10){return bl(function(a10){return J(h(c10,a10))},aP,b10)}function s7(a10,b10){return hD(bl(b10,h6,a10))}function bm(a10){return s7(a10,function(a11){return k(a11,J)})}var bn=e;function s8(a10){return a10[k2]}function h7(a10,b10){var c10=a10?a10[1]:bn;return AA(b10).join(c10)}function e2(a10){return s8(a10)===0?1:0}function dj(a10,b10){return lf(a10,b10)}p.Number;var e3=null,s9=void 0;function ck(a10){return a10===e3?1:0}function s_(a10){return a10===s9?1:0}function bS(a10){var b10=ck(a10);return b10||s_(a10)}function h8(a10){return 1-bS(a10)}function dk(a10,b10){return bS(b10)?0:[0,h(a10,b10)]}var l=p;function e4(a10,b10){var c10=a10[b10];return bS(c10)?0:[0,c10]}function e5(a10){return new l[j8](a10)}function h9(a10){return a10[k2]}function h_(c10,b10){return gY(h9(b10),function(a10){return h(c10,b10[a10])})}function h$(a10,b10){var d10=b10.length-1,e10=e5(d10),f10=d10-1|0,g10=0;if(f10>=0)for(var c10=g10;;){e10[c10]=h(a10,j(b10,c10)[1+c10]);var i10=c10+1|0;if(f10===c10)break;c10=i10}return e10}function ia(c10,b10){return mb(h9(b10),function(a10){return h(c10,b10[a10])})}function e6(f10,b10){return function(a10,b11,c10){for(var e10=a10,d10=c10;;){if(!d10)return b11;var g10=d10[2];b11[e10]=h(f10,d10[1]),e10=e10+1|0,d10=g10}}(0,e5(0),b10)}function tc(a10,b10){var c10=new l.Error(b10);return a10&&(c10[bu]=a10[1]),c10}var te=Symbol.iterator;function tg(a10){return a10.next()}function th(a10){var b10=dk(function(a11){return a11|0},a10.done);return b10?b10[1]:0}function ti(a10){return a10[dI]}function ib(i10,g10,c10,d10,e10){return function(a10,b10){for(var d11=b10;;){var e11=tg(a10);if(th(e11))return d11;var f10=ti(e11),j10=h(g10,f10[1]);d11=y(c10,h(i10,f10[0]),j10,d11)}}(d10,e10)}l.Promise;function tb(a10){return at(a10)}function bo(a10,b10,c10){return d3(a10,tb(b10),c10)}function av(a10){return at(a10)}function v(a10){return H(a10)}function bT(a10,b10){return a10 instanceof b10?1:0}var s$=!0;function ta(a10,b10){a10[b10]}function td(a10,b10){return h(function(a11){throw a11},tc(a10,b10))}function tf(a10){return a10[te]()}l.Event;function dl(a10){return a10[fK]}function ic(a10,b10,c10,d10){var e10=a10?a10[1]:{},f10=bA(1,c10);return d10.addEventListener(b10,f10,e10),function(a11){return d10.removeEventListener(b10,f10,e10),0}}function id2(a10){return h(a10,0)}var e7="change",cl="click";l.ArrayBuffer,l.DataView;function tj(a10){return a10.preventDefault(),0}var tk="DOMContentLoaded",tl=kq,tm="scroll",tn="wheel";l.Blob,l.File;var ie=l.JSON;l.encodeURI,l.decodeURI,l.encodeURIComponent,l.decodeURIComponent,l.URL,l.URLSearchParams;function aQ(a10,b10){return[0,a10,b10]}var cm=[0,bn,bn];function e8(a10){return[0,a10,bn]}function ig(a10){return a10}var cn=kM,e9=j0,ih=bu,ii=jM,e_="type",e$=dI,ij=e8(dG),tr="for";function aR(a10){return aQ(cn,a10)}function ik(a10){return aQ(tr,a10)}var tu=e8("required");function dm(a10){return aQ(ii,a10)}function il(a10){return aQ(e_,a10)}var tv=e8("selected"),bp=l.document;function to(a10){return ie.stringify(a10)}function tp(a10){try{var c10=ie.parse(a10)}catch(f10){var b10=M(f10);if(b10[1]===eF)return[1,b10[2]];throw g(b10,0)}return[0,c10]}function tq(a10,b10){return a10?b10:cm}var ts="placeholder";function tt(a10){return aQ(e9,a10)}function tw(a10){return aQ(e$,a10)}function tx(a10){return a10.ownerDocument}bS(bp)||bp[jV];function ty(a10,b10){return a10.appendChild(b10),0}function tz(a10,b10,c10,d10){for(var g10=b10,f10=c10,e10=d10;;){if(!e10){g10!==0&&a10.setAttribute(jM,h7([0,";"],a4(g10))),f10!==0&&a10.setAttribute(kM,h7([0,aF],a4(f10)));return}var h10=e10[2],k10=e10[1],i10=k10[2],j10=k10[1];if(e2(j10))e10=h10;else if(dj(j10,ii))g10=[0,i10,g10],e10=h10;else if(dj(j10,cn)){var l10=e2(i10)?f10:[0,i10,f10];f10=l10,e10=h10}else a10.setAttribute(j10,i10),e10=h10}}function im(a10,b10,c10,d10){var f10=a10?a10[1]:bp,g10=b10?b10[1]:0,e10=f10.createElement(c10);return tz(e10,0,0,g10),a5(function(a11){return ty(e10,a11)},d10),e10}function aS(a10,b10){var c10=a10?a10[1]:bp;return c10.createTextNode(v(b10))}function io(a10,b10,c10){return e2(a10)?0:b10?(c10.setAttribute(a10,b10[1]),0):(c10.removeAttribute(a10),0)}function ip(a10,b10,c10){return b10?(c10[jy].add(a10),0):(c10[jy].remove(a10),0)}var iq="div";function tJ(a10,b10,c10,d10){return im(b10,c10,a10,d10)}function ir(a10,b10,c10){return tJ(iq,a10,b10,c10)}function is(a10){return a10[jV]}function dn(a10,b10,c10){return d3(a10,b10,c10),0}var dp=l[k6];function dq(a10){return Ax(function(a11,b10,c10){for(var e10=b10,d10=c10;;){if(!d10)return a11;var f10=d10[2];a11[e10]=d10[1],e10=e10+1|0,d10=f10}}(e5(0),0,a10))}function aC(a10){return dn(dp,tM,dq(a10))}function bU(a10){return dn(dp,tR,dq(a10))}l[k6],l.navigator;var tU=l.performance,dr=l[kH];ta(l,tV);function tA(a10,b10){d3(a10,kW,cU(b10))}function tB(a10,b10,c10){var e10=a10?a10[1]:l[kH],d10=e10.getComputedStyle(c10)[b10];return bS(d10)?bn:d10}function tC(a10,b10){var c10=a10?a10[1]:ky,d10=ky<=c10?1:0;return b10.scrollIntoView(!!d10),0}var tD="button",tE="form",tF=kq,tG="label",tH="option",tI="select";function tK(a10){var b10=a10.body;return h8(b10)?b10:td(0,"Document body is null. Try to defer your script execution.")}function tL(a10){return dk(function(a11){return a11},a10.activeElement)}function tN(a10){return dn(dp,tO,dq(a10))}function tP(a10){return dn(dp,tQ,dq(a10))}function tS(a10){return a10}function tT(a10){return a10.now()}function tW(a10,b10){return l.setTimeout(bA(1,b10),a10)}function tX(a10){l.clearTimeout(a10)}function tY(a10){l.requestAnimationFrame(bA(1,a10))}l.ClipboardItem,l.FormData,l.Headers,l.Request,l.Response,l.fetch,l.MediaStream,l.MediaRecorder,l.MessageChannel,l.BroadcastChannel,l.Notification,l.WebSocket;function tZ(a10){return a10.localStorage}function t0(a10,b10){function c10(a11){return a11}return function(a11){return dk(c10,a11)}(a10.getItem(b10))}function t1(a10,b10,c10){try{a10.setItem(b10,c10);return}catch(f10){var d10=M(f10);if(d10[1]===eF)return;throw g(d10,0)}}function aw(a10,b10,c10){return[0,a10,b10,c10]}function it(a10){var b10=a10[1];return b10===82||83<=b10?gL(c7(a10[2])):1}function ds(a10){return cP(c7(a10))}function t2(a10){return ed(cQ(function(a11){var b10=a11[1];return b10===82?[0,ds(a11[2]),0]:83<=b10?h5(ds(a11[2])):[0,a11[2],0]},a10))}function iu(a10){if(!a10)return t3;var b10=mf(it,a10),c10=b10[2];return[0,t2(b10[1]),c10]}var iv=kW,fa="before";function t6(a10){return[0,a10]}function t7(a10,b10){return[1,e3,a10,b10]}var t8="remove",t9="contains";function iw(a10){var b10=tL(tx(a10));return b10?bo(a10,t9,[0,b10[1]])|0:0}function ix(e10,b10){var c10=[0,df(t6,t7)];return k(b10,function(a10){var b11=eZ(c10[1],a10),d10=b11[2],g10=b11[1];c10[1]=d10,dh(w,function(a11,b12){return a11[0]===0?a11[1][dH]=s$:0},g10,0);var h10=iw(e10),i10=dg(d10);if(i10){var f10=function(d11,b12){if(b12[0]!==0){if(!ck(b12[1]))return b12[1];var l10=f10(d11,b12[3]),k10=f10(l10,b12[2]);return b12[1]=k10,k10}var c11=b12[1];if(delete c11[dH],c11.parentNode!==e10)ck(d11)?bo(e10,iv,[0,c11]):bo(d11,fa,[0,c11]);else{var a11=c11.nextSibling!==d11?1:0;if(a11){if(h10)var g11=iw(c11),i11=g11&&function(a12){for(;;){var b13=c11.nextSibling;if(b13===d11)return 1;if(ck(b13))return 0;bo(c11,fa,[0,b13])}}(0);else var i11=h10;var j10=1-i11}else var j10=a11;j10&&(ck(d11)?bo(e10,iv,[0,c11]):bo(d11,fa,[0,c11]))}return c11};f10(e3,i10[1])}return dh(w,function(a11,b12){if(a11[0]!==0)return 0;var c11=a11[1],d11=h8(c11[dH]),e11=d11&&(delete c11[dH],bo(c11,t8,[0]),0);return e11},g10,0),e10})}var dt=R(0),fb=[0,bn,bn];function t4(a10){if(!a10)return t5;var b10=a10[1],c10=b10[1];if(c10===82){if(!a10[2])return[0,0,[0,k(b10[2],J)]]}else if(83<=c10){if(!a10[2])return[0,0,[0,b10[2]]]}else if(!a10[2])return[0,[0,b10[2],0],0];return md(it,a10)?[0,ed(cQ(function(a11){var b11=a11[1];return b11===82?[0,ds(a11[2]),0]:83<=b11?h5(ds(a11[2])):[0,a11[2],0]},a10)),0]:[0,0,[0,c9(function(a11){var b11=a11[1];return b11===82?k(a11[2],J):83<=b11?a11[2]:R(J(a11[2]))},h6,a10)]]}function iy(c10,b10){function d10(a10){var b11=a10[2],d11=a10[1];return dj(d11,cn)?ip(b11,1,c10):io(d11,[0,b11],c10)}function e10(a10){var b11=a10[1],d11=a10[2];return dj(b11,cn)?ip(d11,0,c10):io(b11,0,c10)}function h10(a10){var b11=[0,fb];return function(a11){b11[1]!==fb&&e10(b11[1]);var c11=a11;return d10(c11),b11[1]=c11,0}}return c9(function(a10){var b11=a10[1];if(b11===82){var i10=a10[2];return k(i10,h10(0))}if(83>b11)throw g([0,f,t_],1);var j10=a10[2],c11=[0,df(function(a11){var b12=a11;return d10(b12),b12},function(a11,b12){return fb})];return k(j10,function(a11){var b12=eZ(c11[1],a11),d11=b12[2],f10=b12[1];return c11[1]=d11,dh(w,function(a12,b13){return e10(a12)},f10,0),dg(d11),0})},[0,dt,function(a10,b11){return dt}],b10)}function fc(a10,b10){return ic(b10[1],b10[2],b10[3],a10)}function t$(c10,b10){return c9(function(a10){var b11=a10[1];if(b11===82){var d10=[0,0];return k(a10[2],function(a11){var b12=d10[1];return b12&&id2(b12[1]),d10[1]=[0,fc(c10,a11)],0})}if(83>b11)throw g([0,f,ua],1);var h10=a10[2],e10=[0,df(function(a11){return fc(c10,a11)},function(a11,b12){return a11})];return k(h10,function(a11){var b12=eZ(e10[1],a11),c11=b12[2],d11=b12[1];return e10[1]=c11,dh(w,function(a12,b13){return id2(a12)},d11,0),dg(c11),0})},[0,dt,function(a10,b11){return dt}],b10)}function iz(a10,b10,c10,d10,e10,f10){var q10=b10?b10[1]:0,r10=c10?c10[1]:0,s10=d10?d10[1]:function(a11){},m10=iu(q10),l10=m10[2],t10=m10[1],n10=iu(r10),o10=n10[2],u10=n10[1],p10=t4(f10),i10=p10[2],g10=im(a10,[0,t10],e10,p10[1]);if(h(s10,g10),l10)if(i10)var v10=ix(g10,i10[1]),j10=bN(iy(g10,l10),v10,function(a11,b11){return b11});else var j10=k(iy(g10,l10),function(a11){return g10});else var j10=i10?ix(g10,i10[1]):R(g10);a5(function(a11){return fc(g10,a11),0},u10);var w10=o10?bN(t$(g10,o10),j10,function(a11,b11){return b11}):j10;return w10}function bV(a10,b10,c10,d10,e10,f10){return iz(b10,c10,d10,e10,a10,f10)}function ub(a10,b10,c10,d10,e10,f10){return iz(b10,c10,d10,e10,a10,0)}function fd(a10,b10,c10,d10,e10){return bV(tD,a10,b10,c10,d10,e10)}function K(a10,b10,c10,d10,e10){return bV(iq,a10,b10,c10,d10,e10)}function fe(a10,b10,c10,d10,e10){return ub(tF,a10,b10,c10,d10,e10)}function iA(a10,b10,c10,d10,e10){return bV(tG,a10,b10,c10,d10,e10)}function uc(a10,b10,c10,d10,e10){return bV(tE,a10,b10,c10,d10,e10)}function ud(a10,b10,c10,d10,e10){return bV(tH,a10,b10,c10,d10,e10)}function ue(a10,b10,c10,d10,e10){return bV(tI,a10,b10,c10,d10,e10)}function du(a10,b10){return b10=c10)return uv;if(b10===jv)return uu;if(b10==="cyan")return ut;if(b10===kh)return us;if(b10==="magenta")return ur;if(b10===kt)return uq;if(b10==="reset")return up;if(b10==="white")return uo;if(b10==="yellow")return un}else{if(b10==="Black")return uE;if(b10==="Blue")return uD;if(b10==="Cyan")return uC;if(b10==="Green")return uB;if(b10==="Magenta")return uA;if(b10==="Red")return uz;if(b10==="White")return uy;if(b10==="Yellow")return ux;if(b10==="black")return uw}throw g(fg,1)}function iD(a10,b10){return a6(b10,a10),uG}function iE(a10){try{mS(a10),mT(a10)}catch(f10){var b10=M(f10);if(b10!==el)throw g(b10,0)}return uH}var iF=[q,uI,af(0)],uF=0;function uJ(a10,b10,c10){if(c10[1]===iF)return iD(a10,c10[2]);if(c10[1]!==cb)return h(b10,c10);var e10=c10[2];try{var f10=iD(a10,iC(e10));return f10}catch(f11){var d10=M(f11);if(d10===fg)return h(b10,c10);throw g(d10,0)}}function uK(a10,b10,c10){if(c10[1]===iF)return iE(a10);if(c10[1]!==cb)return h(b10,c10);var e10=c10[2];try{iC(e10)}catch(f10){var d10=M(f10);if(d10===fg)return h(b10,c10);throw g(d10,0)}return iE(a10)}function uL(a10){var c10=bE(0);qm(a10,1);var b10=qn(a10,0),d10=b10[2],e10=b10[1];return qo(a10,[0,function(a11){return uJ(c10,e10,a11)},function(a11){return uK(c10,d10,a11)},b10[3],b10[4]])}function uM(a10,b10){var d10=b_(64),c10=eE(d10),e10=a10&&uF;return e10&&uL(c10),qU(function(a11){return bK(c10,0),cV(d10)},c10,b10)}function uN(a10){return uM(1,a10)}function uO(a10,b10){return mh(a10,b10)}function uP(a10){try{var c10=[0,ln(a10)];return c10}catch(f10){var b10=M(f10);if(b10[1]===b4)return 0;throw g(b10,0)}}function uQ(a10){return a10|0}function uS(a10,b10,c10,d10){for(var g10=a10,f10=b10,e10=d10;;){if(!e10){g10[1+f10]=0;return}var j10=e10[2],i10=[0,h(c10,e10[1]),kx];g10[1+f10]=i10,g10=i10,f10=1,e10=j10}}function uR(a10,b10){if(!b10)return 0;var d10=b10[2],c10=[0,h(a10,b10[1]),kx];return uS(c10,1,a10,d10),c10}function fh(a10,b10){return b10?[0,h(a10,b10[1])]:0}function uT(a10,b10,c10){return c10?h(b10,c10[1]):a10}function uU(a10,b10){if(b10)return h(a10,b10[1])}function uV(a10,b10){return b10?b10[1]:a10}function uW(a10,b10){return a10?a10[1]:b10}function uX(a10){return a10?[0,a10[1],0]:0}function uY(a10,b10){return b10[0]===0?h(a10,b10[1]):[1,b10[1]]}function uZ(a10,b10){return uY(b10,a10)}function u0(a10){var b10=mK(a10);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b10[37],,,,,,,,,,,b10[23]]}function u1(a10){var b10=u0(a10);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b10[40],,,,,,,,,,,,,,,,,,,,b10[51]]}function u2(e10,b10){var d10=n(e10);if(du(d10,n(b10)))return 0;var f10=n(b10)-d10|0;return function(a10){for(var c10=a10;;){if(uf(c10,d10))return 1;if($(b10,f10+c10|0)!==$(e10,c10))return 0;c10=c10+1|0}}(0)}function fi(a10,b10){return u2(a10,b10)?[0,eh(b10,0,n(b10)-n(a10)|0)]:0}var iG=[q,u4,af(0)];function iH(a10){return[0,[0,a10]]}function bq(a10,b10,c10,d10){return[1,a10,b10,c10,d10]}function u6(a10){return a10[0]===0&&typeof a10[1]=="number"?1:0}function iI(a10,b10){if(b10[0]===0){var c10=b10[1];if(typeof c10=="number")return iH(a10);switch(c10[0]){case 0:return[0,[1,a10,c10[1]]];case 1:return[0,[2,a10,c10[1],c10[2]]];default:return bq(4,[1,a10,c10[1]],u5,[1,c10[2],c10[3]])}}var d10=b10[2],f10=b10[1];if(typeof d10!="number")switch(d10[0]){case 0:break;case 1:return bq(f10+1|0,[2,a10,d10[1],d10[2]],b10[3],b10[4]);default:var e10=b10[3],h10=d10[3],i10=d10[2],j10=d10[1],g10=ay(e10),k10=aE===g10?e10[1]:bb===g10?cO(e10):e10;return bq(f10+1|0,[1,a10,j10],[bb,function(a11){return iI([0,i10,h10],k10)}],b10[4])}return bq(f10+1|0,[1,a10,d10[1]],b10[3],b10[4])}function iJ(a10){if(a10[0]===0){var b10=a10[1];if(typeof b10=="number")throw g(iG,1);switch(b10[0]){case 0:return[0,u3,b10[1]];case 1:var n10=b10[2];return[0,iH(b10[1]),n10];default:return[0,[0,[1,b10[1],b10[2]]],b10[3]]}}var d10=a10[3],e10=a10[2],f10=a10[1],i10=ay(d10),j10=aE===i10?d10[1]:bb===i10?cO(d10):d10,h10=a10[4];if(typeof h10!="number"&&h10[0]!==0){var c10=a10[4];if(typeof c10!="number"&&c10[0]===2){var q10=c10[3];return[0,bq(f10-1|0,e10,d10,[1,c10[1],c10[2]]),q10]}var p10=c10[2];return[0,bq(f10-1|0,e10,d10,[0,c10[1]]),p10]}var k10=h10[1];if(u6(j10))return[0,[0,e10],k10];var l10=iJ(j10),m10=l10[2],o10=[1,m10[1],m10[2]];return[0,bq(f10-1|0,e10,lX(l10[1]),o10),k10]}function u8(a10){if(typeof a10=="number")return 0;switch(a10[0]){case 0:return 1;case 1:return 2;default:return 3}}function u7(a10){try{var c10=[0,iJ(a10)];return c10}catch(f10){var b10=M(f10);if(b10===iG)return 0;throw g(b10,0)}}function u9(a10){return a10[0]===0?u8(a10[1]):a10[1]}function u_(a10){return a10.height}function u$(a10){return a10}function vc(a10){switch(a10){case 0:return vd;case 1:return ve;default:return vf}}function va(a10){return a10.contentRect}function vb(a10){a10[fK]}function vg(a10,b10,c10){var d10=b10?[0,c10,{box:v(vc(b10[1]))}]:[0,c10];return d3(a10,"observe",d10),0}function vh(c10){return new l.ResizeObserver(function(a10,b10){return i(c10,ia(function(a11){return a11},a10),b10)})}var vi=jI,vj="pattern",iK=u1([0,ei]);function vk(a10,b10){return h(a10,b10),b10}function vl(a10){var b10=fi(vm,a10);if(b10){var c10=b10[1],d10=uP(c10);if(d10)return[0,[0,d10[1]]];var g10=function(a11){return[0,a11]};return function(a11){return fh(g10,a11)}(ff(c10))}var e10=fi(vn,a10);if(e10){var h10=function(a11){return[1,a11]};return function(a11){return fh(h10,a11)}(ff(e10[1]))}var f10=fi(vo,a10);if(!f10)return 0;function i10(a11){return[1,a11]}return function(a11){return fh(i10,a11)}(ff(f10[1]))}function iL(a10){switch(a10[0]){case 0:var b10=a10[1];return h(C(vp),b10);case 1:var c10=a10[1];return h(C(vq),c10);default:var d10=a10[1];return h(C(vr),d10)}}function iM(a10){var c10=a10?a10[1]:is(bp);function b10(a11){var b11=vl(at(tB(0,"font-size",a11)));if(!b11)return 16;var c11=b11[1];return c11[0]===0?c11[1]:a3(vs)}return function(a11){switch(a11[0]){case 0:return a11[1];case 1:var d10=a11[1];return d10*b10(is(bp));default:var e10=a11[1];return e10*b10(c10)}}}function vt(e10,b10,c10,d10){function f10(a10,b11){return bN(d10,a10,b11)}function g10(a10,b11){return y(e10,b11[1],b11[2],a10)}return function(a10){return f10(a10,g10)}(bN(b10,c10,function(a10,b11){return[0,a10,b11]}))}var vw=[q,vv,af(0)],vy=[q,vx,af(0)];function fj(a10){return[0,0]}function fk(a10,b10){if(a10[1])throw g(vy,1);return a10[1]=[0,b10],0}function fl(a10){var b10=a10[1];if(b10)return b10[1];throw g(vw,1)}function vu(a10,b10,c10){return vt(function(a11,b11,c11){return[0,a11,b11,c11]},a10,b10,c10)}function vz(a10){return to(a10)}function vA(a10){var b10=tp(a10);return b10[0]===0?[0,b10[1]]:(tN([0,b10[1],0]),vB)}var iN=tZ(dr);function iO(c10,b10){return function(a10){return t1(iN,c10,a10)}(vz(b10))}function vC(a10){var b10=t0(iN,a10);function c10(a11){return vA(a11)}var d10=b10?[0,b10[1]]:vD;return uZ(d10,c10)}function vE(a10,b10){var c10=vC(a10);if(c10[0]===0)return c10[1];var d10=c10[1];return typeof d10=="number"||tP([0,d10[2],0]),h(b10,0)}function vF(d10,b10){iO(d10,b10);var a10=ad(b10),c10=eJ(0,a10);return eK(c10,function(a11){return iO(d10,bP(c10)),0}),bP(c10),a10}function vG(a10,b10){var c10=H(a10);return vF(c10,vE(c10,b10))}function iP(a10,b10){return vG(a10,function(a11){return b10})}var vI=iK[49],vH=iK[29];function vJ(a10){return uR(function(a11){return[0,80,aR(H(a11))]},vI(a10))}var vK=0;function a9(d10,b10,c10){var a10=b10[1],e10=a10===82?[0,82,k(b10[2],function(a11){return function(a12){return aQ(d10,a12)}(H(a11))})]:83<=a10?a3(vN):[0,80,function(a11){return aQ(d10,a11)}(H(b10[2]))];return[0,e10,c10]}function fm(d10,b10,c10){return b10?[0,[0,80,function(a10){return aQ(d10,a10)}(H(b10[1]))],c10]:c10}function iQ(a10,b10){var c10=b10[1];return c10===82?[0,82,k(b10[2],a10)]:83<=c10?[0,83,e1(a10,b10[2])]:[0,80,h(a10,b10[2])]}function vP(a10){return a10[0]===0?aR(H(a10[1])):a10[1]}function fn(a10,b10){return[0,iQ(vP,a10),b10]}function ai(a10){return fn(a10,0)}function co(a10,b10){return fn(a10,b10)}function vL(a10,b10){var d10=vJ(b10[1]),e10=b10[2],c10=function(a11){return bD(e10,a11)}(d10);return a10?[0,[0,80,tt(H(a10[1]))],c10]:c10}function vM(a10){return[0,vH(a10),vK]}function vO(a10,b10,c10){return b10?[0,[0,80,a10],c10]:c10}function vQ(a10){return fn(iQ(function(a11){return[0,a11]},a10),0)}function vR(a10,b10){return b10[0]===0?(a10.scroll(0,b10[1]),0):tC(0,b10[1])}function vS(a10,b10,c10,d10,e10){var g10=a10?a10[1]:0,h10=b10?b10[1]:0,f10=ad(1),i10=co(vT,co([0,82,k(f10,function(a11){return a11?[1,aR("locked")]:[1,cm]})],g10)),j10=vQ(vU),l10=[0,[0,80,aw(0,cl,function(a11){return _(f10,1)})],0],m10=K(0,[0,j10],[0,l10],0,[0,[0,82,fd(0,0,0,0,[0,[0,80,aS(0,vV)],0])],0]),n10=aw(0,tn,function(a11){var b11=bk(f10);return b11&&_(f10,0)});return K(0,[0,i10],[0,[0,[0,80,n10],h10]],c10,[0,[0,82,k(vu(e10,f10,d10),function(a11){var b11=a11[1],c11=a11[3];return a11[2]&&uU(function(a12){return vR(b11,a12)},c11),b11})],[0,[0,82,m10],0]])}function dv(a10,b10){return typeof b10=="number"?0:b10[0]===0?[0,h(a10,b10[1])]:[1,b10[1]]}function vW(e10,b10,c10){var d10=ad(c10);return[0,aw(0,b10,function(a10){return _(d10,h(e10,dl(a10)[dI]))}),d10]}function iR(a10,b10,c10,d10,e10,f10,g10,h10,i10,j10){var l10=d10?d10[1]:0,m10=f10?f10[1]:0,n10=function(a11){return fm(vj,h10,a11)}(function(a11){return vO(tu,m10,a11)}([0,[0,80,il(H(i10))],l10])),o10=uW(b10,function(a11){return[0,a11]}),k10=vW(a10,g10,j10),p10=k10[2],q10=k10[1];return[0,fe(c10,[0,n10],[0,[0,[0,80,q10],uX(e10)]],0,0),p10,o10]}function dw(a10,b10,c10,d10,e10,f10,g10,h10){var i10=c10?c10[1]:0,j10=function(a11){return fm(e$,h10,a11)}(function(a11){return fm(ts,g10,a11)}(i10));return iR(av,a10,b10,[0,j10],d10,e10,tl,f10,vY,uV(vX,h10))}function dx(a10,b10,c10,d10){var e10=b10?b10[1]:0;return iR(function(a11){return 0},0,a10,[0,a9(e$,d10,e10)],c10,0,e7,0,vZ,0)}function aD(a10,b10){return k(a10,function(a11){return[0,a11,b10]})}function dy(a10,b10,c10,d10){return function(g10){var i10=[0,[0,ch,function(a11){return a11}],function(a11,b11){var c11=b11[2],d11=a11[2];return[0,aB(a11[1],b11[1]),function(a12){return h(c11,h(d11,a12))}]}];function j10(a11){var b11=a11[1],c11=a11[2];function d11(a12){var c12=bk(b11[2]);return h(b11[3],c12)}return[0,J(b11[1]),function(a12){var b12=d11(0);return h(h(c11,a12),b12)}]}var e10=function(a11){return bl(j10,i10,a11)}(bm(d10[2])),f10=[0,82,k(e10,function(a11){var b11=a11[2];return aw(0,vi,function(a12){return h(g10,h(b11,d10[1])),tj(a12)})})],l10=k(e10,function(a11){return a11[1]}),m10=uT([0,f10,0],function(a11){return l9(f10,a11)},c10);return uc(a10,b10,[0,m10],0,[0,[0,83,bm(l10)],0])}}function iS(a10,b10){return a10?h(C(v0),b10):b10}function v1(a10,b10,c10,d10,e10){var g10=a10?a10[1]:1,i10=b10?b10[1]:0,j10=c10?c10[1]:0,f10=d10?d10[1]:function(a11){};return function(a11){var c11=iS(1,e10[1]),d11=iS(0,e10[1]),b11=g10?iP(c11,e10[2]):ad(e10[2]);h(f10,bk(b11));var l10=e10[3];iA(0,[0,[0,[0,80,ik(H(c11))],0]],0,0,l10);var m10=[0,80,d11],n10=function(a12){return a9(e_,v2,a12)}(function(a12){return a9(ih,m10,a12)}(a9(e9,[0,80,c11],i10))),o10=[0,[0,80,aw(0,e7,function(a12){var c12=av(dl(a12)[dI]);return h(f10,c12),_(b11,c12)})],j10];return[0,ue(0,[0,n10],[0,o10],0,[0,[0,83,bm(e1(function(a12){var c12=a12[1],d12=a12[2],e11=ai([0,80,[1,tw(H(c12))]]),f11=co([0,82,k(b11,function(a13){return[1,tq(uj(a13,c12),tv)]})],e11);return ud(0,[0,f11],0,0,[0,[0,80,aS(0,d12)],0])},a11))],0]),,b11]}}function v3(a10,b10,c10,d10,e10,f10,g10){var m10=b10?b10[1]:0,n10=c10?c10[1]:function(a11){},j10=h(uN(v4),d10);function l10(a11){return a11?[0,e10]:0}a:{if(a10&&a10[1]){var o10=iP(j10,l10(g10)),i10=o10;break a}var i10=ad(l10(g10))}var p10=iA(0,[0,[0,[0,80,ik(H(j10))],0]],0,0,f10),q10=[0,80,d10],r10=function(a11){return a9(e_,v5,a11)}(function(a11){return a9(ih,q10,a11)}(a9(e9,[0,80,j10],0))),s10=[0,[0,82,k(i10,function(a11){return a11?ij:cm})],r10];return[0,K(0,0,0,0,[0,[0,82,fe(0,[0,s10],[0,[0,[0,80,aw(0,e7,function(a11){var b11=l10(dl(a11)[dG]|0);return h(n10,b11),_(i10,b11)})],m10]],0,0)],[0,[0,82,p10],0]]),i10]}function v6(a10){var d10=ek(a10);return[0,,function(a11){return u9(a11[1])},function(a11){},,function(a11,b10,c10){var e10=d10[4].call(null,b10,c10,a11[2]);return[0,iI(b10,a11[1]),e10]},function(a11){var c10=u7(a11[1]);if(!c10)return[0,a11,0];var e10=c10[1],b10=e10[2],f10=e10[1],g10=[0,[0,b10,d10[28].call(null,b10,a11[2])]];return[0,[0,f10,d10[7].call(null,b10,a11[2])],g10]},function(a11,b10){return d10[29].call(null,b10,a11[2])}]}function v7(a10){var b10=v6(a10);return[0,function(a11){b10[3].call(null,0),b10[3].call(null,0)}]}function v9(a10){return bl(function(a11){return J(K(0,0,0,0,a11[3]))},aP,a10)}function v_(a10){return eL(bl(function(a11){return a11[2]},[0,wc,function(a11,b10){return i(C(wb),a11,b10)}],a10),function(a11){return i(C(wa),v$,a11)})}iM(0)(wg);function v8(a10,b10,c10){return[0,a10,b10,c10]}function wd(a10){return v_(a10[1][1])}function we(a10){var b10=iL(a10[2]),c10=[0,[0,80,aR(jx)],0],d10=[0,[0,80,aR("lwdui-lazy-table-header")],c10],e10=[0,[0,80,dm(H(h(C(wf),b10)))],d10];return K(0,[0,e10],0,0,[0,[0,83,bm(v9(a10[1][1]))],0])}var wh=v7([0,uO]),dz=A5(0);function wi(d10,b10,c10){return function(a10){var r10=a10[3],s10=a10[2],f10=fj(0),g10=fj(0),l10=iL(d10[2]),u10=h(C(wk),l10),v10=cg(function(a11,b12){return J([0,eO(a11),a11,r10])},aP,s10);hd(0,2048),function(a11){return wh[1].call(null,50)}(0);var e10=ad(0),m10=R(function(a11){return a11}),b11=eJ(0,q5(m10,e10));eK(b11,function(a11){var c11=bP(b11);return c11[2]?h(c11[1],0):0}),bP(b11);function t10(a11){return i(C(wj),l10,a11)}function j10(a11){var b12=[0,aR("row_spacer"),0];return ir(0,[0,[0,dm(H(t10(a11))),b12]],0)}var w10=k(bl(function(a11){var b12=a11[1],c11=a11[3],d11=a11[2],e11=a9(cn,wl,0),f11=[0,80,dm(H(u10))];return b12?[0,0,J(K(0,[0,[0,f11,e11]],0,0,[0,[0,83,bm(i(c11,d11,b12[1]))],0])),0]:[0,1,ch,0]},[0,[0,0,ch,0],function(a11,b12){var f11=b12[3],g11=b12[2],c11=b12[1],d11=a11[3],e11=a11[2],h10=a11[1],k10=hT(e11),i10=hT(g11);if(typeof k10=="number")return typeof i10=="number"?[0,((h10+d11|0)+c11|0)+f11|0,e11,0]:[0,(h10+d11|0)+c11|0,g11,f11];if(typeof i10=="number")return[0,h10,e11,(d11+c11|0)+f11|0];var l11=du(d11+c11|0,0)?function(a12){return aB(e11,a12)}(aB(J(R(j10(d11+c11|0))),g11)):aB(e11,g11);return[0,h10,l11,f11]}],v10),function(a11){var b12=a11[3],c11=a11[2],d11=a11[1],e11=du(d11,0)?aB(J(R(j10(d11))),c11):c11;return du(b12,0)?aB(e11,J(R(j10(b12)))):e11}),x10=we(d10),y10=vh(function(a11,b12){var d11=l_(a11);vb(d11);var c11=u_(va(d11)),f11=bk(e10);return f11?ug(f11[1],c11)?_(e10,[0,c11]):0:_(e10,[0,c11])}),z10=ai(wm),n10=K(0,[0,z10],0,[0,function(a11){return fk(f10,a11)}],[0,[0,83,bm(w10)],0]),o10=ai(wn),p10=[0,[0,82,k(m10,function(c11){return aw(0,tm,function(a11){var d11=[0,0],b12=[0,-1];function e11(e12){var a12=800,f11=tT(tU);uh(b12[1],0)&&tX(b12[1]),b12[1]=tW(a12,function(a13){return h(c11,e12)});var g11=ui(f11-d11[1],a12);return g11&&(d11[1]=f11,h(c11,e12))}return fl(g10),function(a12){return e11(a12)}(0),0})})],0];function q10(a11){return fk(g10,a11)}var A10=c10?vS([0,o10],[0,p10],[0,q10],k(c10[1],function(a11){var b12=fl(f10),c11=d10[2];return[0,[0,cG(a11,uQ(iM([0,b12])(c11)))]]}),n10):K(0,[0,o10],[0,p10],[0,q10],[0,[0,82,n10],0]);function B2(a11){return vg(y10,0,a11)}function D2(a11){return vk(B2,a11)}var E2=function(a11){return k(a11,D2)}(A10),F2=vL(0,vM(wo));return K(0,[0,[0,[0,82,k(wd(d10),function(a11){return dm(H(a11))})],F2]],0,0,[0,[0,82,x10],[0,[0,82,E2],0]])}}var fo=ek([0,ei]),fp=dz.Text,fq=dz[j8],fr=dz.Map,bW=hA(wt,ws),a_=hA(wv,wu);function wp(a10,b10){return[0,a10,b10]}function iT(a10){return bT(a10,fq)?[0,aW,a10]:bT(a10,fr)?[0,w,a10]:bT(a10,fp)?[0,bx,a10]:[0,T,a10]}function ww(a10){var b10=e4(a10,wx);if(b10)return[0,b10[1]];var c10=e4(a10,wy);if(c10)return[1,h_(iT,c10[1])];var d10=e4(a10,wz);if(d10)return[2,d10[1]];throw g([0,f,wA],1)}hC(wB,bW,[0,function(a10){return new fq},function(a10,b10,c10){return a10.insert(b10,h$(function(a11){var b11=a11[1];return bx<=b11?(aW<=b11,a11[2]):(w<=b11,a11[2])},c10)),0},function(a10,b10,c10){return a10.delete(b10,c10),0},function(a10,b10){return a10.push(h$(function(a11){var b11=a11[1];return bx<=b11?(aW<=b11,a11[2]):(w<=b11,a11[2])},b10)),0},function(a10,d10){return a10.forEach(function(a11,b10,c10){return y(d10,b10,iT(a11),c10)}),0},function(a10,b10){function c10(a11){return h(b10,wp(ww,a11))}return a10.observe(c10),c10}]);function fs(a10){return bT(a10,fq)?[0,aW,a10]:bT(a10,fr)?[0,w,a10]:bT(a10,fp)?[0,bx,a10]:[0,T,a10]}function iU(a10,b10){return function(a11){return dk(fs,a11)}(a10.get(v(b10)))}function wC(a10){return a10}function wD(a10){return a10[fK]}function wE(a10){var b10=av(a10.action);if(b10!=="add")if(b10!==jS){if(b10!=="update")throw g([0,cL,h(C(wF),b10)],1);var c10=1}else var c10=2;else var c10=0;var d10=a10.oldValue,e10=bS(d10)?0:[0,fs(d10)];return[0,c10,0,e10]}function iV(a10){return tf(a10.entries())}hC(wG,a_,[0,function(a10){return new fr},[0,function(d10){var a10=d10[jZ].keys.entries();return ib(av,wE,function(a11,b10,c10){var e10=iU(wD(d10),a11);return fo[4].call(null,a11,[0,b10[1],e10,b10[3]],c10)},a10,fo[1])}],iU,function(a10,b10,c10){var d10=c10[1],e10=bx<=d10?(aW<=d10,c10[2]):(w<=d10,c10[2]);return a10.set(v(b10),e10),0},function(a10,b10){return a10.delete(v(b10)),0},iV,function(a10,d10,c10){return ib(av,fs,function(a11,b10,c11){return y(d10,a11,b10,c11)},iV(a10),c10)},function(a10,b10){function c10(a11){return h(b10,a11)}return a10.observe(c10),c10}]);var wH=dz.Doc;function iW(a10,b10){return a10.getArray(v(b10))}function br(a10,b10){return a10.transact(bA(1,b10)),0}function ft(a10){return a10}var aj=a_[4],aT=a_[3],cp=a_[1],dA=bW[5],fu=bW[4],iX=bW[3],iY=bW[1];function wq(a10){var b10=a10[1];return[0,function(a11){return h_(b10,a11)}(a10[2][jZ].delta)]}function wr(a10,b10){var c10=a10?[0,v(a10[1])]:[0];return lq(fp,c10)}function wI(a10){return new wH}var wJ=a_[8],wK=a_[7],wL=a_[5],wM=a_[2][1],wN=bW[6];function wO(a10){return a10}var wP=AZ(0).Awareness;function wR(a10,b10,c10){a10.setLocalStateField(v(b10),c10)}function iZ(a10){return a10}function wQ(a10){return new wP(a10)}function wS(a10,b10,c10,d10){if(c10)var f10=[0,wT,v(c10[1])],e10=[0,[0,wU,v(b10)],f10];else var e10=[0,[0,wW,v(b10)]];return wR(a10,wV,gv(e10))}var wX=A0(0);function wY(a10,b10){var c10=b10;new wX(v(a10),c10)}var wZ=A3(0);function fv(a10,b10,c10){switch(b10){case 0:a10.on(v(w6),bA(1,function(a11){return h(c10,[0,a11.connected|0])}));return;case 1:a10.on(v(w7),bA(1,function(a11){return h(c10,[0,a11[kn]|0])}));return;default:a10.on(v(xa),bA(1,function(b11){function a11(a12){return function(a13){return ia(av,a13)}(b11[a12])}var d10=a11(w8),e10=a11(w9),f10=a11(w_);return h(c10,[0,a11(w$),f10,e10,d10])}));return}}function w0(a10,b10,c10,d10){var f10=b8(function(a11){return[0,w1,e6(v,a11)]},b10),e10=[0,[0,w4,{config:{iceServers:e6(function(a11){return a11},cQ(function(a11){return{urls:v(h(C(w3),a11))}},w2))}}]];aC([0,e10,0]);var g10=[0,f10,[0,e10,[0,b8(function(a11){return[0,w5,a11]},c10),0]]],i10=gv(cU(gO(function(a11){return a11})(g10))),j10=d10;return new wZ(v(a10),j10,i10)}var i0=A1(0),xb=A2(0);function xd(a10){switch(a10){case 0:var b10=xe;break;case 1:var b10=xf;break;case 2:var b10=xg;break;case 3:var b10=xh;break;default:var b10=xi}return v(b10)}function xc(a10,b10){i0.register(v(a10),b10)}function xj(a10,b10,c10,d10){var e10=a10?a10[1]:0,f10=e10?xk:xn,g10=b8(function(a11){return[0,xl,!!a11]},b10),h10=[0,g10,[0,b8(function(a11){return[0,xm,e6(xd,a11[1])]},c10),0]],i10=gv(cU(gO(function(a11){return a11})(h10)));return{theme:v(f10),modules:i10}}function xo(a10,b10){return new i0(a10,b10)}function xp(a10){return a10}var xq=A4(0).QuillBinding;function xr(a10,b10,c10){var d10=lZ(b8(iZ,a10)),e10=[0,c10,d10];function f10(a11,b11){lq(a11,b11)}return function(a11){return f10(xq,a11)}(cU([0,b10,e10]))}function xs(a10,b10,c10){return y(ev(t,xt),b10,c10,a10)}function i1(a10,b10,c10){var d10=0<=c10?1:0;if(d10)var e10=0<=b10?1:0,f10=e10&&((b10+c10|0)<=a10?1:0);else var f10=d10;var g10=1-f10;return g10&&xs(a10,b10,c10)}var xu=[0];function xv(a10,b10,c10,d10){var e10=aq(a10,b10);return cT(c10,0,e10,0,d10),e10}function i2(a10,b10){return b10<=a10?a10:b10}function i3(a10){return ev(t,a10)}function xw(a10,b10){var c10=a10[1];return i(i3(xx),b10,c10)}function xy(a10,b10){return i(i3(xz),a10,b10.length-1)}function cq(a10,b10){var c10=1-(a10<=b10.length-1?1:0);return c10&&xy(a10,b10)}function i4(a10){return[0,0,0,xu]}function cr(a10){return a10[1]}function xA(a10,b10){return a10[3][1+b10]}function i5(a10){var b10=a10[1],c10=a10[3];if(cq(b10,c10),0>>4|0));var f11=b11+1|0;function i11(a11,b12,c12){a0(a11,b12,c12)}return function(a11){return i11(d11,f11,a11)}(h10(g10,c11&15))}for(;!(4<=d10[1]);){var n10=z(b10,d10[1]);f10(e10,c10[1],n10),c10[1]=c10[1]+2|0,d10[1]++}for(c10[1]++;!(6<=d10[1]);){var m10=z(b10,d10[1]);f10(e10,c10[1],m10),c10[1]=c10[1]+2|0,d10[1]++}for(c10[1]++;!(8<=d10[1]);){var l10=z(b10,d10[1]);f10(e10,c10[1],l10),c10[1]=c10[1]+2|0,d10[1]++}for(c10[1]++;!(10<=d10[1]);){var k10=z(b10,d10[1]);f10(e10,c10[1],k10),c10[1]=c10[1]+2|0,d10[1]++}for(c10[1]++;;){if(16<=d10[1])return aa(e10);var j10=z(b10,d10[1]);f10(e10,c10[1],j10),c10[1]=c10[1]+2|0,d10[1]++}}var xN=g9(0),ak=wI(0),fx=wQ(ak);xc(xP,xb),wS(fx,xQ,0,0);var dB=w0(xS,xR,[0,fx],ak);wY(xT,ak),dr.yjsdoc=ak,dr.yjsprovider=dB;var fy=ad(0),i8=ad(0),i9=ad(0);fv(dB,0,function(a10){var b10=a10[1];return bU([0,xU,[0,!!b10,0]]),_(i8,b10)}),fv(dB,1,function(a10){var b10=a10[1];return bU([0,xV,[0,!!b10,0]]),_(i9,b10)});var dC=[0,0];fv(dB,2,function(a10){bU([0,xW,[0,a10,0]]);function c10(b11){return me(function(a11){return ej(b11,a11)},a10[3])}function d10(b11){var c11=[0,0],a11=dC[1];return dC[1]=gN(function(a12){return ej(b11,a12)?(c11[1]=[0,b11],1):0})(a11),c11[1]}var b10=ee(function(a11,b11){return d10(b11)?a11:(c10(b11)&&(dC[1]=[0,b11,dC[1]]),a11+1|0)},0,a10[1]),e10=ec(a10[2]);return function(a11){return _(fy,a11)}((bk(fy)+b10|0)-e10|0)});var x0=i9,x2=co(x1,ai([0,82,bN(i8,x0,function(a10,b10){var c10=a10?b10?xX:xY:xZ;return[0,c10]})])),x4=K(0,[0,x2],0,0,[0,[0,80,aS(0,x3)],0]),x5=[0,[0,82,x4],[0,[0,82,k(fy,function(a10){return aS(0,lK(a10))})],0]];function xO(a10){return xK(xN,0)}function x8(a10,b10){var c10=a10?a10[1]:64,d10=hK(0);return[0,d10,hd(0,c10)]}function i_(a10,b10,c10){var e10=he(a10[2],b10);if(e10)var d10=e10[1];else{var g10=eN(0,a10[1]);hf(a10[2],b10,g10);var d10=g10}var f10=eO(d10);return f10?_(f10[1][2],[0,c10]):rV(d10,[0,b10,ad([0,c10])])}function fz(a10,b10){var c10=he(a10[2],b10);if(c10)var d10=c10[1];else{var f10=a10[1],e10=eN([0,[0,b10,ad(0)]],f10);hf(a10[2],b10,e10);var d10=e10}return cP(eO(d10))[2]}function fA(a10,b10){return k(fz(a10,b10),function(a11){if(!a11)return 0;var b11=a11[1];if(typeof b11!="number"&&T===b11[1])return[0,av(b11[2])];throw g([0,f,x9],1)})}function x_(a10){var b10=hK(0);return[0,b10,i4(0)]}function x$(a10){try{var c10=[0,i7(a10[2],0)];return c10}catch(f10){var b10=M(f10);if(b10[1]===cL)return 0;throw g(b10,0)}}function i$(a10,b10){var c10=eN(a10,b10[1]);return xD(b10[2],c10)}function ja(a10,b10,c10,d10){var e10=[0,b10,[0,c10,[0,cr(d10),0]]];bU([0,ya,[0,cr(a10),e10]]);var f10=cr(d10),g10=i7(a10,0);return fw(d10,gY(c10,function(a11){return g10})),xH(a10,b10,d10,f10,c10)}function yb(i10,b10,c10){var e10=[0,0],j10=i10[2],d10=i4(0);gZ(function(a11){switch(a11[0]){case 0:var m10=a11[1];return ja(j10,e10[1],m10,d10),e10[1]=e10[1]+m10|0,0;case 1:var c11=a11[1];if(cr(d10)!==0){var o10=[0,i5(d10)];return fw(d10,g0(function(a12){var d11=h(b10,a12),c12=rR([0,d11],o10[1]);return o10[1]=c12,c12},c11))}var n10=x$(i10);if(!n10)return gZ(function(a12){var c12=h(b10,a12);return i$([0,c12],[0,i10[1],d10])},c11);var s10=n10[1];return fw(d10,g0(function(a12){return rP([0,h(b10,a12)],s10)},c11));default:var k11=a11[1],t10=e10[1]===0?sy(i10[1]):hR(i5(d10)),p10=[0,t10],u10=1;if(k11>=1)for(var l10=u10;;){var q10=p10[1];if(!q10)throw g([0,f,yc],1);var r10=q10[1];p10[1]=hR(r10),rY(r10);var v10=l10+1|0;if(k11===l10)break;l10=v10}return e10[1]=e10[1]+k11|0,0}},c10);var k10=e10[1],a10=cr(j10)-k10|0;return 0 ",z0=[0,0],zY=[0,0],zZ=[0,80,"Update"],zU=e,zV=e,zW=[0,80,[0,"cell-edit-btn"]],zX="\xE2\x9C\x8F\xEF\xB8\x8F",z3=[0,80,[0,"cell-edit-overlay"]],z4=[0,80,[0,go]],zF="GET",zE=[0,c,479,17],zD=[0,c,494,11],zI=[0,c,509,19],zH=[0,c,519,13],zG=[0,c,kL,13],zJ=[0,c,526,11],zP=[0,c,lg,19],zO=[0,c,539,19],zK=[0,c,532,13],zM=[0,c,548,15],zN=[0,c,552,15],zL=[0,c,kF,11],zR=e,zS=[0,c,565,17],zQ=[0,c,568,11],zy=bB,zz=ko,zs="New column kind:",zq=[0,c,354,13],zm=d0,zn=b8,zo=dX,zp=cO,zi="Old value:",zj="Action: delete",zk="Key:",zl=[0,c,279,15],zh="On_change",zg=[0,c,204,22],ze="[blit v(%i) %i %i v'(%i)]",zb=[0,c,147,18],y1=lm,y2="orange",y3=lq,y0="Received peers",yZ="Received synced",yY="Received connected",yT="modules/cursors",yU="Narines",yV=[0,[0,"wss://p2p.u31.fr",0]],yW="testroom5267564",yX="zedoc",y5=[0,80,[0,"p2p_status_icon"]],y7="\xE2\x99\xBC",y_=[0,80,[0,"p2p_status"]],zv=bB,zw=ko,AQ=[0,80,"Add table"],AT=[0,80,[0,k4]];function z(a10){if(typeof a10=="number")return 0;switch(a10[0]){case 0:return[0,z(a10[1])];case 1:return[1,z(a10[1])];case 2:return[2,z(a10[1])];case 3:return[3,z(a10[1])];case 4:return[4,z(a10[1])];case 5:return[5,z(a10[1])];case 6:return[6,z(a10[1])];case 7:return[7,z(a10[1])];case 8:var c10=a10[1];return[8,c10,z(a10[2])];case 9:var b10=a10[1];return[9,b10,b10,z(a10[3])];case 10:return[10,z(a10[1])];case 11:return[11,z(a10[1])];case 12:return[12,z(a10[1])];case 13:return[13,z(a10[1])];default:return[14,z(a10[1])]}}function X(a10,b10){if(typeof a10=="number")return b10;switch(a10[0]){case 0:return[0,X(a10[1],b10)];case 1:return[1,X(a10[1],b10)];case 2:return[2,X(a10[1],b10)];case 3:return[3,X(a10[1],b10)];case 4:return[4,X(a10[1],b10)];case 5:return[5,X(a10[1],b10)];case 6:return[6,X(a10[1],b10)];case 7:return[7,X(a10[1],b10)];case 8:var c10=a10[1];return[8,c10,X(a10[2],b10)];case 9:var d10=a10[2],e10=a10[1];return[9,e10,d10,X(a10[3],b10)];case 10:return[10,X(a10[1],b10)];case 11:return[11,X(a10[1],b10)];case 12:return[12,X(a10[1],b10)];case 13:return[13,X(a10[1],b10)];default:return[14,X(a10[1],b10)]}}function x(a10,b10){if(typeof a10=="number")return b10;switch(a10[0]){case 0:return[0,x(a10[1],b10)];case 1:return[1,x(a10[1],b10)];case 2:var c10=a10[1];return[2,c10,x(a10[2],b10)];case 3:var d10=a10[1];return[3,d10,x(a10[2],b10)];case 4:var e10=a10[3],f10=a10[2],g10=a10[1];return[4,g10,f10,e10,x(a10[4],b10)];case 5:var h10=a10[3],i10=a10[2],j10=a10[1];return[5,j10,i10,h10,x(a10[4],b10)];case 6:var k10=a10[3],l10=a10[2],m10=a10[1];return[6,m10,l10,k10,x(a10[4],b10)];case 7:var n10=a10[3],o10=a10[2],p10=a10[1];return[7,p10,o10,n10,x(a10[4],b10)];case 8:var q10=a10[3],r10=a10[2],s10=a10[1];return[8,s10,r10,q10,x(a10[4],b10)];case 9:var t10=a10[1];return[9,t10,x(a10[2],b10)];case 10:return[10,x(a10[1],b10)];case 11:var u10=a10[1];return[11,u10,x(a10[2],b10)];case 12:var v10=a10[1];return[12,v10,x(a10[2],b10)];case 13:var w10=a10[2],y10=a10[1];return[13,y10,w10,x(a10[3],b10)];case 14:var z10=a10[2],A10=a10[1];return[14,A10,z10,x(a10[3],b10)];case 15:return[15,x(a10[1],b10)];case 16:return[16,x(a10[1],b10)];case 17:var B10=a10[1];return[17,B10,x(a10[2],b10)];case 18:var C2=a10[1];return[18,C2,x(a10[2],b10)];case 19:return[19,x(a10[1],b10)];case 20:var D2=a10[2],E2=a10[1];return[20,E2,D2,x(a10[3],b10)];case 21:var F2=a10[1];return[21,F2,x(a10[2],b10)];case 22:return[22,x(a10[1],b10)];case 23:var G2=a10[1];return[23,G2,x(a10[2],b10)];default:var H2=a10[2],I2=a10[1];return[24,I2,H2,x(a10[3],b10)]}}function a7(a10){throw g([0,cc,a10],1)}function s(a10){throw g([0,cb,a10],1)}function c2(a10){return 0<=a10?a10:-a10|0}var g7=kN;function aO(a10,b10){return a10+b10}function mt(b10){var e10=n(b10);return function(a10){for(var c10=a10;;){if(e10<=c10)return aO(b10,mu);var d10=D(b10,c10);a:{if(48<=d10){if(58>d10)break a}else if(d10===45)break a;return b10}c10=c10+1|0}}(0)}function mx(a10,b10,c10,d10){for(var f10=a10,e10=b10,g10=c10;;){if(!g10){f10[1+e10]=d10;return}var h10=g10[2],i10=g10[1];if(!h10){f10[1+e10]=[0,i10,d10];return}var j10=h10[2],k10=h10[1];if(!j10){f10[1+e10]=[0,i10,[0,k10,d10]];return}var l10=[0,j10[1],aL],m10=j10[2];f10[1+e10]=[0,i10,[0,k10,l10]],f10=l10,e10=1,g10=m10}}BR(0);var en=l_(1),ai=l_(2);function ce(a10,b10){gV(a10,b10,0,n(b10))}function g8(a10,b10,c10,d10){return 0<=c10&&0<=d10&&(n(b10)-d10|0)>=c10?gV(a10,b10,c10,d10):s(my)}function g9(a10){return ce(ai,a10),l$(ai,10),bK(ai)}var eo=[0,function(a10){return function(a11){for(var b10=a11;;){if(!b10)return 0;var d10=b10[2],e10=b10[1];try{bK(e10)}catch(f10){var c10=M(f10);if(c10[1]!==g6)throw g(c10,0)}b10=d10}}(BS(0))}],g_=[0,function(a10){}];function ep(a10){return h(g_[1],0),h(gF(eo),0)}g0(ll,ep);function cf(a10){return bK(a10)}function mo(a10){return a10^-1}function mp(a10){return a10?mq:mr}function ms(a10){return e+a10}function mv(a10){return mt(gK("%.12g",a10))}function mw(a10,b10){if(!a10)return b10;var c10=a10[2],d10=a10[1];if(!c10)return[0,d10,b10];var e10=c10[2],f10=c10[1];if(!e10)return[0,d10,[0,f10,b10]];var g10=[0,e10[1],aL];return mx(g10,1,e10[2],b10),[0,d10,[0,f10,g10]]}function mz(c10){for(;;){var a10=gF(eo);let d10=[0,1],e10=a10;var b10=1-gE(eo,a10,function(a11){return gE(d10,1,0)&&h(c10,0),h(e10,0)});if(!b10)return b10}}function mA(a10,b10){l$(a10,b10)}var eq2=B3(0),cg=(4*eq2|0)-1|0;function mB(a10){return 1-(typeof a10=="number"?1:0)}function g$(a10,b10,c10){return gE(a10,b10,c10)}function ch(a10){return gF(a10)}function ci(a10){return[0,a10]}function mC(a10,b10){return A4(a10,b10)}var mE=[q,mD,ag(0)];function mF(a10){var d10=a10[1];a10[1]=0;try{var c10=h(d10,0);return a10[1]=c10,l7(a10),c10}catch(f10){var b10=M(f10);throw a10[1]=function(a11){throw g(b10,0)},BI(a10),g(b10,0)}}function mG(a10){var c10=a10[1];a10[1]=0;var b10=h(c10,0);return a10[1]=b10,l7(a10),b10}function mH(a10,b10){if(BJ(b10)===0)return a10?mG(b10):mF(b10);throw g(mE,1)}function er(a10){return mH(0,a10)}function mI(a10){var b10=aN(a10);return b10!==aZ&&b10!==bg&&b10!==bE&&b10!==kG?a10:BH(a10)}function c3(a10){return a10?a10[1]:s(mJ)}function cj(a10,b10){return b10?[0,h(a10,b10[1])]:0}function ha(a10){return a10?1:0}function mK(a10){return a10?[0,a10[1],0]:0}function mL(a10){a:{if(40<=a10){if(a10===92)return mM;if(gj>a10)break a}else{if(32<=a10){if(39<=a10)return mN;break a}if(14>a10)switch(a10){case 8:return mO;case 9:return mP;case 10:return mQ;case 13:return mR}}var b10=C(4);return B(b10,0,92),B(b10,1,48+(a10/gr|0)|0),B(b10,2,48+((a10/10|0)%10|0)|0),B(b10,3,48+(a10%10|0)|0),ej(b10)}var c10=C(1);return B(c10,0,a10),ej(c10)}function mS(a10){return 25>>0?a10:a10-32|0}function mT(a10,b10){for(var d10=a10,c10=b10;;){if(!c10)return d10;d10=d10+1|0,c10=c10[2]}}function es(a10){return mT(0,a10)}function bN(a10,b10){for(var c10=a10,d10=b10;;){if(!c10)return d10;var e10=[0,c10[1],d10];c10=c10[2],d10=e10}}function ck(a10){return bN(a10,0)}function mX(a10,b10,c10){if(b10>1,s10=p10(r10,b11),D2=s10[1],t10=p10(a11-r10|0,s10[2]),E2=t10[2];return[0,B10(D2,t10[1],0),E2]}function p10(a11,b11){if(a11===2){if(b11){var j10=b11[2];if(j10){var k10=j10[1],g10=b11[1],B11=j10[2],q10=i(d10,g10,k10),C2=q10===0?[0,g10,0]:0>1,s10=h10(r10,b11),D2=s10[1],t10=h10(a11-r10|0,s10[2]),E2=t10[2];return[0,A10(D2,t10[1],0),E2]}var a10=es(b10);return 2<=a10?h10(a10,b10)[1]:b10}function m8(a10,b10){return l3(a10,b10)}function m9(a10,b10){return a10<=b10?a10:b10}function m_(a10,b10){return b10<=a10?a10:b10}function m$(a10){return e+a10}function bn(a10,b10){var c10=C(a10);return Bg(c10,0,a10,b10),c10}var na=C(0);function nb(a10){var b10=au(a10),c10=C(b10);return a4(a10,0,c10,0,b10),c10}function ev(a10,b10,c10){if(0<=b10&&0<=c10&&(au(a10)-c10|0)>=b10){var d10=C(c10);return a4(a10,b10,d10,0,c10),d10}return s(nd)}function ew(a10,b10,c10){return ej(ev(a10,b10,c10))}function hd(a10,b10,c10,d10,e10){if(0<=e10&&0<=b10&&(au(a10)-e10|0)>=b10&&0<=d10&&(au(c10)-e10|0)>=d10){a4(a10,b10,c10,d10,e10);return}return s(ne)}function ax(a10,b10,c10,d10,e10){if(0<=e10&&0<=b10&&(n(a10)-e10|0)>=b10&&0<=d10&&(au(c10)-e10|0)>=d10){cT(a10,b10,c10,d10,e10);return}return s(nf)}function he(a10){var b10=a10-9|0;a:{if(4>>0){if(b10!==23)break a}else if(b10===2)break a;return 1}return 0}function ni(a10,b10){var d10=au(b10);if(d10===0)return b10;var e10=C(d10),f10=d10-1|0,g10=0;if(f10>=0)for(var c10=g10;;){B(e10,c10,h(a10,bG(b10,c10)));var i10=c10+1|0;if(f10===c10)break;c10=i10}return e10}function hf(a10,b10,c10){lO(a10,b10,Bt(c10))}function hg(a10,b10,c10){at(a10,b10,c10)}function hh(a10,b10){return A_(a10,b10)}function cl(a10){return bj(a10)}function $(a10){return ej(a10)}function nc(a10){return nb(bj(a10))}function ng(a10){for(var d10=au(a10),b10=[0,0];!(b10[1]>=d10||!he(bG(a10,b10[1])));)b10[1]++;for(var c10=[0,d10-1|0];;){if(b10[1]<=c10[1]&&he(bG(a10,c10[1]))){c10[1]--;continue}return b10[1]<=c10[1]?ev(a10,b10[1],(c10[1]-b10[1]|0)+1|0):na}}function nh(a10){var b10=[0,0],j10=au(a10)-1|0,l10=0;if(j10>=0)for(var g10=l10;;){var e10=bG(a10,g10);a:{b:{c:{if(32<=e10){var h10=e10-34|0;if(58>>0){if(93<=h10)break c}else if(56>>0)break b;var i10=1;break a}if(11<=e10){if(e10===13)break b}else if(8<=e10)break b}var i10=4;break a}var i10=2}b10[1]=b10[1]+i10|0;var o10=g10+1|0;if(j10===g10)break;g10=o10}if(b10[1]===au(a10))return a10;var c10=C(b10[1]);b10[1]=0;var k10=au(a10)-1|0,m10=0;if(k10>=0)for(var f10=m10;;){var d10=bG(a10,f10);a:{b:{c:{if(35<=d10){if(d10!==92){if(gj<=d10)break c;break b}}else{if(32>d10){if(14<=d10)break c;switch(d10){case 8:B(c10,b10[1],92),b10[1]++,B(c10,b10[1],98);break a;case 9:B(c10,b10[1],92),b10[1]++,B(c10,b10[1],116);break a;case 10:B(c10,b10[1],92),b10[1]++,B(c10,b10[1],110);break a;case 13:B(c10,b10[1],92),b10[1]++,B(c10,b10[1],114);break a;default:break c}}if(34>d10)break b}B(c10,b10[1],92),b10[1]++,B(c10,b10[1],d10);break a}B(c10,b10[1],92),b10[1]++,B(c10,b10[1],48+(d10/gr|0)|0),b10[1]++,B(c10,b10[1],48+((d10/10|0)%10|0)|0),b10[1]++,B(c10,b10[1],48+(d10%10|0)|0);break a}B(c10,b10[1],d10)}b10[1]++;var n10=f10+1|0;if(k10===f10)break;f10=n10}return c10}function nj(a10){return ni(mS,a10)}function nk(a10,b10){return A$(a10,b10)}function nl(a10,b10,c10){lO(a10,b10,c10)}function c5(a10,b10){return $(bn(a10,b10))}function ex(a10,b10,c10){return $(ev(cl(a10),b10,c10))}function hi(a10){var b10=a10-9|0;a:{if(4>>0){if(b10!==23)break a}else if(b10===2)break a;return 1}return 0}function no(a10,b10,c10,d10){for(var e10=c10;;){if(b10<=e10)throw g(aD,1);if(_(a10,e10)===d10)return e10;e10=e10+1|0}}function np(a10,b10,c10){var d10=n(a10);if(0<=b10&&d10>=b10)try{no(a10,d10,b10,c10);var f10=1;return f10}catch(f11){var e10=M(f11);if(e10===aD)return 0;throw g(e10,0)}return s(nq)}function ey(a10,b10){return mg(a10,b10)}function c6(a10,b10){return nk(cl(a10),b10)}function ez(a10,b10){return a10==b10?1:0}function nm(a10){return a10==e||!hi(_(a10,0))&&!hi(_(a10,n(a10)-1|0))?a10:$(ng(cl(a10)))}function nn(a10){return $(nh(cl(a10)))}function nr(a10,b10){return np(a10,0,b10)}function ns(a10){return $(nj(cl(a10)))}function hj(a10,b10){if(a10===0)return[0];if(0>a10)return s(nt);var d10=ap(a10,h(b10,0)),e10=a10-1|0,f10=1;if(e10>=1)for(var c10=f10;;){d10[1+c10]=h(b10,c10);var g10=c10+1|0;if(e10===c10)break;c10=g10}return d10}function cm(a10,b10,c10,d10,e10){return 0<=e10&&0<=b10&&(a10.length-1-e10|0)>=b10&&0<=d10&&(c10.length-1-e10|0)>=d10?A2(a10,b10,c10,d10,e10):s(nw)}function hk(a10,b10){var d10=b10.length-2|0,e10=0;if(d10>=0)for(var c10=e10;;){h(a10,b10[1+c10]);var f10=c10+1|0;if(d10===c10)break;c10=f10}return 0}function hl(a10,b10){var d10=b10.length-1;if(d10===0)return[0];var e10=ap(d10,h(a10,b10[1])),f10=d10-1|0,g10=1;if(f10>=1)for(var c10=g10;;){e10[1+c10]=h(a10,b10[1+c10]);var i10=c10+1|0;if(f10===c10)break;c10=i10}return e10}function nx(a10,b10){for(var d10=a10,c10=b10;;){if(!c10)return d10;d10=d10+1|0,c10=c10[2]}}function c7(a10){if(!a10)return[0];var b10=a10[2],c10=a10[1],e10=ap(nx(0,a10),c10);return function(a11,b11){for(var d10=a11,c11=b11;;){if(!c11)return e10;var f10=c11[2];e10[1+d10]=c11[1],d10=d10+1|0,c11=f10}}(1,b10)}function nu(a10,b10,c10){return 0<=b10&&0<=c10&&(a10.length-1-c10|0)>=b10?A3(a10,b10,c10):s(nv)}function ny(k10){function j10(a10){return a10?a10[4]:0}function d10(a10,b11,c11){var d11=a10?a10[4]:0,e11=c11?c11[4]:0,f10=e11<=d11?d11+1|0:e11+1|0;return[0,a10,b11,c11,f10]}function l10(a10,b11,c11){var g10=a10?a10[4]:0,h10=c11?c11[4]:0;if((h10+2|0)=h10){var w10=h10<=g10?g10+1|0:h10+1|0;return[0,a10,b11,c11,w10]}if(!c11)return s(nC);var k11=c11[3],m11=c11[2],f10=c11[1],r10=j10(f10);if(r10<=j10(k11))return d10(d10(a10,b11,f10),m11,k11);if(!f10)return s(nB);var t10=f10[2],u10=f10[1],v10=d10(f10[3],m11,k11);return d10(d10(a10,b11,u10),t10,v10)}function c10(a10,b11){if(!b11)return[0,0,a10,0,1];var d11=b11[3],e11=b11[2],f10=b11[1],g10=i(k10[1],a10,e11);if(g10===0)return b11;if(0<=g10){var h10=c10(a10,d11);return d11===h10?b11:l10(f10,e11,h10)}var j11=c10(a10,f10);return f10===j11?b11:l10(j11,e11,d11)}function b10(a10){return[0,0,a10,0,1]}var m10=0;function e10(a10,b11){for(var c11=b11;;){if(!c11)return;var d11=c11[3],f10=c11[2];e10(a10,c11[1]),h(a10,f10),c11=d11}}function n10(a10,b11){for(var d11=a10,c11=b11;;){if(!c11)return d11;var e11=c11[2],f10=c11[1];d11=[0,e11,n10(d11,c11[3])],c11=f10}}function o10(a10,b11,c11){for(var d11=c11;;){if(!d11)return;var e11=d11[3],f10=d11[1];d11=h(b11,d11[2])?e11:f10}}function p10(a10){function c11(a11,b11){if(3>=a11>>>0)switch(a11){case 0:return[0,0,b11];case 1:if(b11)return[0,[0,0,b11[1],0,1],b11[2]];break;case 2:if(b11){var h10=b11[2];if(h10)return[0,[0,[0,0,b11[1],0,1],h10[1],0,2],h10[2]]}break;default:if(b11){var i10=b11[2];if(i10){var j11=i10[2];if(j11)return[0,[0,[0,0,b11[1],0,1],i10[1],[0,0,j11[1],0,1],2],j11[2]]}}}var k11=a11/2|0,l11=c11(k11,b11),e11=l11[2],n11=l11[1];if(!e11)throw g([0,f,nD],1);var o11=e11[1],m11=c11((a11-k11|0)-1|0,e11[2]),p11=m11[2];return[0,d10(n11,o11,m11[1]),p11]}return c11(es(a10),a10)[1]}return[0,,,,c10,,,,,,,,,,,,,m10,,,,,,,,,,,,,,e10,,,,,,,,function(a10){return n10(0,a10)},,,,,,,,,,,function(a10,b11){for(var c11=b11;;){if(!c11)return;var d11=c11[2],e11=c11[3],f10=c11[1];if(h(a10,d11))return o10(d11,a10,e11);c11=f10}},,,,,,,,function(a10){if(!a10)return m10;var f10=a10[2],d11=a10[1];if(!f10)return b10(d11);var g10=f10[2],e11=f10[1];if(!g10)return c10(e11,b10(d11));var h10=g10[2],i10=g10[1];if(!h10)return c10(i10,c10(e11,b10(d11)));var j11=h10[2],l11=h10[1];if(!j11)return c10(l11,c10(i10,c10(e11,b10(d11))));if(j11[2])return p10(m7(k10[1],a10));var n11=j11[1];return c10(n11,c10(l11,c10(i10,c10(e11,b10(d11)))))}]}function nE(a10){var b10=ny(a10);return[0,b10[17],b10[4],,,,,,,,b10[39],,,,,,,,,,,,b10[50],b10[31],,,,,,,,,,,,,,,b10[58]]}function nF(f10){function h10(a10){return a10?a10[5]:0}function e10(a10,b10,c11,d11){var e11=h10(a10),f11=h10(d11),g10=f11<=e11?e11+1|0:f11+1|0;return[0,a10,b10,c11,d11,g10]}function d10(a10,b10,c11,d11){var i10=a10?a10[5]:0,j11=d11?d11[5]:0;if((j11+2|0)=j11){var B10=j11<=i10?i10+1|0:j11+1|0;return[0,a10,b10,c11,d11,B10]}if(!d11)return s(nJ);var l11=d11[4],o11=d11[3],p10=d11[2],g10=d11[1],w10=h10(g10);if(w10<=h10(l11))return e10(e10(a10,b10,c11,g10),p10,o11,l11);if(!g10)return s(nI);var x10=g10[3],y10=g10[2],z10=g10[1],A10=e10(g10[4],p10,o11,l11);return e10(e10(a10,b10,c11,z10),y10,x10,A10)}function j10(a10,b10,c11){if(!c11)return[0,0,a10,b10,0,1];var e11=c11[4],h11=c11[3],k11=c11[2],g10=c11[1],o11=c11[5],l11=i(f10[1],a10,k11);if(l11===0)return h11===b10?c11:[0,g10,a10,b10,e11,o11];if(0<=l11){var m11=j10(a10,b10,e11);return e11===m11?c11:d10(g10,k11,h11,m11)}var n11=j10(a10,b10,g10);return g10===n11?c11:d10(n11,k11,h11,e11)}function n10(a10){for(var b10=a10;;){if(!b10)throw g(aD,1);var c11=b10[1];if(!c11)return[0,b10[2],b10[3]];b10=c11}}function c10(a10){if(!a10)return s(nK);var b10=a10[1];if(!b10)return a10[4];var e11=a10[4],f11=a10[3],g10=a10[2];return d10(c10(b10),g10,f11,e11)}function o10(a10,b10){if(!a10)return b10;if(!b10)return a10;var e11=n10(b10),f11=e11[2],g10=e11[1];return d10(a10,g10,f11,c10(b10))}function k10(a10,b10){if(!b10)return 0;var c11=b10[4],h11=b10[3],g10=b10[2],e11=b10[1],j11=i(f10[1],a10,g10);if(j11===0)return o10(e11,c11);if(0<=j11){var l11=k10(a10,c11);return c11===l11?b10:d10(e11,g10,h11,l11)}var m11=k10(a10,e11);return e11===m11?b10:d10(m11,g10,h11,c11)}function l10(a10,b10){for(var c11=b10;;){if(!c11)return 0;var d11=c11[4],e11=c11[3],f11=c11[2];l10(a10,c11[1]),i(a10,f11,e11),c11=d11}}function m10(a10,b10,c11){for(var d11=b10,e11=c11;;){if(!d11)return e11;var f11=d11[4],g10=d11[3],h11=d11[2],i10=y(a10,h11,g10,m10(a10,d11[1],e11));d11=f11,e11=i10}}return[0,,,,,0,,j10,function(a10,b10){for(var c11=b10;;){if(!c11)throw g(aD,1);var e11=c11[4],h11=c11[3],j11=c11[1],d11=i(f10[1],a10,c11[2]);if(d11===0)return h11;var k11=0<=d11?e11:j11;c11=k11}},,,,,,,,,function(a10,b10){for(var c11=b10;;){if(!c11)return 0;var e11=c11[4],g10=c11[3],h11=c11[1],d11=i(f10[1],a10,c11[2]);if(d11===0)return[0,g10];var j11=0<=d11?e11:h11;c11=j11}},,,,,,,k10,,,l10,,,m10]}function eA(a10){var b10=nF(a10);return[0,b10[5],b10[7],,,,b10[24],,,,,,,,,,,b10[8],b10[17],,,,,b10[27],b10[30]]}var eB=[q,nL,ag(0)];function bO(a10){return[0,0,0]}function cn(a10){a10[1]=0,a10[2]=0}function a9(a10,b10){return b10[1]=[0,a10,b10[1]],b10[2]=b10[2]+1|0,0}function bP(a10){var b10=a10[1];if(!b10)return 0;var c10=b10[1];return a10[1]=b10[2],a10[2]=a10[2]-1|0,[0,c10]}function bQ(a10){var b10=a10[1];return b10?[0,b10[1]]:0}function nM(a10){var b10=a10[1];if(!b10)throw g(eB,1);a10[1]=b10[2],a10[2]=a10[2]-1|0}function nN(a10){if(!a10[1])throw g(eB,1)}function nO(a10,b10){return a8(a10,b10[1])}var nQ=[q,nP,ag(0)];function eC(a10){return[0,0,0,0]}function eD(a10){a10[1]=0,a10[2]=0,a10[3]=0}function eE(a10,b10){var c10=[0,a10,0],d10=b10[3];return d10?(b10[1]=b10[1]+1|0,d10[2]=c10,b10[3]=c10,0):(b10[1]=1,b10[2]=c10,b10[3]=c10,0)}function hm(a10){var b10=a10[2];if(!b10)throw g(nQ,1);var c10=b10[1];if(b10[2]){var d10=b10[2];return a10[1]=a10[1]-1|0,a10[2]=d10,c10}return eD(a10),c10}function eF(a10){return a10[1]===0?1:0}function nR(a10){var b10=a10[2];return b10?[0,b10[1]]:0}function nS(a10){var b10=a10[2];if(!b10)return 0;var c10=b10[1];if(b10[2]){var d10=b10[2];return a10[1]=a10[1]-1|0,a10[2]=d10,[0,c10]}return eD(a10),[0,c10]}function bo(a10){var b10=1<=a10?a10:1,c10=cg=(d10+b10|0));)c10[1]=2*c10[1]|0;cg=b10?ew(a10[1][1],b10,c10):s(nU)}function nV(a10){return a10[2]=0,0}function nX(a10,b10){var c10=a10[2],d10=a10[1],e10=d10[1];d10[2]<=c10?(eG(a10,1),at(a10[1][1],a10[2],b10)):B(e10,c10,b10),a10[2]=c10+1|0}var eH=[0,0];function hp(a10){return a10}function hq(a10){return a10!==eH?1:0}function hr(a10){return a10}(function(a10){Be(ap(8,eH))})(0);var nZ=ci(0),hs=ci(0);function n0(a10){for(;;){var b10=ch(hs),c10=1-g$(hs,b10,[0,a10,b10]);if(!c10)return c10}}function aP(a10,b10){var c10=[0,mC(nZ,1),b10];return a10&&n0([0,c10,a10[1]]),c10}function ht(d10){for(;;){var a10=lR(0),b10=a10.length-1;if(d10e10){if(e10!==32){if(43>e10)break a;switch(e10-43|0){case 5:c:if(c10<(d10+2|0)&&1=(d10+1|0))break a;var f10=bn(d10+1|0,48);return at(f10,0,e10),ax(b10,1,f10,(d10-c10|0)+2|0,c10-1|0),$(f10)}if(71<=e10){if(5>>0)break a}else if(65>e10)break a}if(c10a10)return b10;var h10=[0,0],i10=n(b10)-1|0,o10=0;if(i10>=0)for(var d10=o10;;){9>=_(b10,d10)+lr>>>0&&h10[1]++;var r10=d10+1|0;if(i10===d10)break;d10=r10}var j10=h10[1],k10=C(n(b10)+((j10-1|0)/3|0)|0),l10=[0,0];function e10(a11){at(k10,l10[1],a11),l10[1]++}var f10=[0,((j10-1|0)%3|0)+1|0],m10=n(b10)-1|0,p10=0;if(m10>=0)for(var c10=p10;;){var g10=_(b10,c10);9>>0||(f10[1]===0&&(e10(95),f10[1]=3),f10[1]--),e10(g10);var q10=c10+1|0;if(m10===c10)break;c10=q10}return $(k10)}function pK(a10,b10){return c9(a10,ec(oR(a10),b10))}function pL(a10,b10){return c9(a10,ec(ph(a10),b10))}function pM(a10,b10){return c9(a10,ec(pv(a10),b10))}function pN(a10,b10){return c9(a10,Bw(o5(a10),b10))}function aQ(d10,b10,c10){function a10(a11){switch(d10[1]){case 0:var e11=45;break;case 1:var e11=43;break;default:var e11=32}return Br(c10,b10,e11)}function e10(a11){var b11=Ba(c10);return b11===3?c10<0?pP:pQ:4<=b11?pR:a11}function f10(b11){var e11=n(b11);return function(a11){for(var c11=a11;;){if(c11===e11)return 0;var d11=D(b11,c11)-46|0;a:{if(23>>0){if(d11===55)break a}else if(21>>0)break a;c11=c11+1|0;continue}return 1}}(0)?b11:aO(b11,pO)}switch(d10[2]){case 5:return e10(f10(gK(hz(d10,b10),c10)));case 6:return a10(0);case 7:return ns(a10(0));case 8:return e10(a10(0));default:return gK(hz(d10,b10),c10)}}function pS(a10){var b10=mL(a10),c10=n(b10),d10=bn(c10+2|0,39);return cT(b10,0,d10,1,c10),$(d10)}function pT(a10){var b10=hv(16);return eK(b10,a10),hx(b10)}function cJ(a10,b10,c10,d10){for(var k10=b10,j10=c10,e10=d10;;){if(typeof e10=="number")return h(k10,j10);switch(e10[0]){case 0:var t10=e10[1];return function(a11){return o(k10,[5,j10,a11],t10)};case 1:var u10=e10[1];return function(a11){return o(k10,[4,j10,pS(a11)],u10)};case 2:return eL(k10,j10,e10[2],e10[1],function(a11){return a11});case 3:return eL(k10,j10,e10[2],e10[1],oQ);case 4:return c_(k10,j10,e10[4],e10[2],e10[3],pK,e10[1]);case 5:return c_(k10,j10,e10[4],e10[2],e10[3],pL,e10[1]);case 6:return c_(k10,j10,e10[4],e10[2],e10[3],pM,e10[1]);case 7:return c_(k10,j10,e10[4],e10[2],e10[3],pN,e10[1]);case 8:return pU(k10,j10,e10[4],e10[2],e10[3],e10[1]);case 9:return eL(k10,j10,e10[2],e10[1],mp);case 10:j10=[7,j10],e10=e10[1];break;case 11:j10=[2,j10,e10[1]],e10=e10[2];break;case 12:j10=[3,j10,e10[1]],e10=e10[2];break;case 13:var v10=e10[3],w10=pT(e10[2]);return function(a11){return o(k10,[4,j10,w10],v10)};case 14:var y10=e10[3],z10=e10[2];return function(a11){return o(k10,j10,x(oP(a11[1],z10),y10))};case 15:var A10=e10[1];return function(c11,b11){return o(k10,[6,j10,function(a11){return i(c11,a11,b11)}],A10)};case 16:var B10=e10[1];return function(a11){return o(k10,[6,j10,a11],B10)};case 17:j10=[0,j10,e10[1]],e10=e10[2];break;case 18:var l10=e10[1];if(l10[0]===0){let b11=j10,c11=k10,d11=e10[2];k10=function(a11){return o(c11,[1,b11,[0,a11]],d11)},j10=0,e10=l10[1][1]}else{let b11=j10,c11=k10,d11=e10[2];k10=function(a11){return o(c11,[1,b11,[1,a11]],d11)},j10=0,e10=l10[1][1]}break;case 19:throw g([0,f,pW],1);case 20:var C2=e10[3],D2=[8,j10,pX];return function(a11){return o(k10,D2,C2)};case 21:var E2=e10[2];return function(a11){return o(k10,[4,j10,ec(kw,a11)],E2)};case 22:var F2=e10[1];return function(a11){return o(k10,[5,j10,a11],F2)};case 23:var m10=e10[2],n10=e10[1];return a10<50?j1(a10+1|0,k10,j10,n10,m10):r(j1,[0,k10,j10,n10,m10]);default:var p10=e10[3],q10=e10[1],s10=h(e10[2],0);return a10<50?f2(a10+1|0,k10,j10,p10,q10,s10):r(f2,[0,k10,j10,p10,q10,s10])}}}function o(a10,b10,c10){return bM(cJ(0,a10,b10,c10))}function j1(a10,b10,c10,d10,e10){if(typeof d10=="number")switch(d10){case 0:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 1:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 2:throw g([0,f,pY],1);default:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10])}switch(d10[0]){case 0:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 1:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 2:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 3:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 4:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 5:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 6:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 7:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 8:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);case 9:var h10=d10[2];return a10<50?f3(a10+1|0,b10,c10,h10,e10):r(f3,[0,b10,c10,h10,e10]);case 10:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10]);default:return a10<50?t(a10+1|0,b10,c10,e10):r(t,[0,b10,c10,e10])}}function f3(a10,h10,c10,d10,e10){if(typeof d10=="number")return a10<50?t(a10+1|0,h10,c10,e10):r(t,[0,h10,c10,e10]);switch(d10[0]){case 0:var b10=d10[1];return function(a11){return aj(h10,c10,b10,e10)};case 1:var i10=d10[1];return function(a11){return aj(h10,c10,i10,e10)};case 2:var j10=d10[1];return function(a11){return aj(h10,c10,j10,e10)};case 3:var k10=d10[1];return function(a11){return aj(h10,c10,k10,e10)};case 4:var l10=d10[1];return function(a11){return aj(h10,c10,l10,e10)};case 5:var m10=d10[1];return function(a11){return aj(h10,c10,m10,e10)};case 6:var n10=d10[1];return function(a11){return aj(h10,c10,n10,e10)};case 7:var o10=d10[1];return function(a11){return aj(h10,c10,o10,e10)};case 8:var p10=d10[2];return function(a11){return aj(h10,c10,p10,e10)};case 9:var q10=d10[3],s10=d10[2],u10=I(E(d10[1]),s10);return function(a11){return aj(h10,c10,X(u10,q10),e10)};case 10:var v10=d10[1];return function(a11,b11){return aj(h10,c10,v10,e10)};case 11:var w10=d10[1];return function(a11){return aj(h10,c10,w10,e10)};case 12:var x10=d10[1];return function(a11){return aj(h10,c10,x10,e10)};case 13:throw g([0,f,pZ],1);default:throw g([0,f,p0],1)}}function aj(a10,b10,c10,d10){return bM(f3(0,a10,b10,c10,d10))}function t(a10,b10,c10,d10){var e10=[8,c10,p1];return a10<50?cJ(a10+1|0,b10,e10,d10):r(cJ,[0,b10,e10,d10])}function eL(g10,f10,c10,d10,e10){if(typeof d10=="number")return function(a10){return o(g10,[4,f10,h(e10,a10)],c10)};if(d10[0]===0){var b10=d10[2],i10=d10[1];return function(a10){return o(g10,[4,f10,ad(i10,b10,h(e10,a10))],c10)}}var j10=d10[1];return function(a10,b11){return o(g10,[4,f10,ad(j10,a10,h(e10,b11))],c10)}}function c_(k10,j10,h10,d10,e10,f10,g10){if(typeof d10=="number"){if(typeof e10=="number")return e10?function(a10,b11){return o(k10,[4,j10,bS(a10,i(f10,g10,b11))],h10)}:function(a10){return o(k10,[4,j10,i(f10,g10,a10)],h10)};var b10=e10[1];return function(a10){return o(k10,[4,j10,bS(b10,i(f10,g10,a10))],h10)}}if(d10[0]===0){var c10=d10[2],l10=d10[1];if(typeof e10=="number")return e10?function(a10,b11){return o(k10,[4,j10,ad(l10,c10,bS(a10,i(f10,g10,b11)))],h10)}:function(a10){return o(k10,[4,j10,ad(l10,c10,i(f10,g10,a10))],h10)};var n10=e10[1];return function(a10){return o(k10,[4,j10,ad(l10,c10,bS(n10,i(f10,g10,a10)))],h10)}}var m10=d10[1];if(typeof e10=="number")return e10?function(a10,b11,c11){return o(k10,[4,j10,ad(m10,a10,bS(b11,i(f10,g10,c11)))],h10)}:function(a10,b11){return o(k10,[4,j10,ad(m10,a10,i(f10,g10,b11))],h10)};var p10=e10[1];return function(a10,b11){return o(k10,[4,j10,ad(m10,a10,bS(p10,i(f10,g10,b11)))],h10)}}function pU(i10,h10,g10,d10,e10,f10){if(typeof d10=="number"){if(typeof e10=="number")return e10?function(a10,b11){return o(i10,[4,h10,aQ(f10,a10,b11)],g10)}:function(a10){return o(i10,[4,h10,aQ(f10,eJ(f10),a10)],g10)};var b10=e10[1];return function(a10){return o(i10,[4,h10,aQ(f10,b10,a10)],g10)}}if(d10[0]===0){var c10=d10[2],j10=d10[1];if(typeof e10=="number")return e10?function(a10,b11){return o(i10,[4,h10,ad(j10,c10,aQ(f10,a10,b11))],g10)}:function(a10){return o(i10,[4,h10,ad(j10,c10,aQ(f10,eJ(f10),a10))],g10)};var l10=e10[1];return function(a10){return o(i10,[4,h10,ad(j10,c10,aQ(f10,l10,a10))],g10)}}var k10=d10[1];if(typeof e10=="number")return e10?function(a10,b11,c11){return o(i10,[4,h10,ad(k10,a10,aQ(f10,b11,c11))],g10)}:function(a10,b11){return o(i10,[4,h10,ad(k10,a10,aQ(f10,eJ(f10),b11))],g10)};var m10=e10[1];return function(a10,b11){return o(i10,[4,h10,ad(k10,a10,aQ(f10,m10,b11))],g10)}}function f2(a10,b10,c10,d10,e10,f10){if(e10){var i10=e10[1];return function(a11){return pV(b10,c10,d10,i10,h(f10,a11))}}var g10=[4,c10,f10];return a10<50?cJ(a10+1|0,b10,g10,d10):r(cJ,[0,b10,g10,d10])}function pV(a10,b10,c10,d10,e10){return bM(f2(0,a10,b10,c10,d10,e10))}function aR(a10,b10){for(var c10=b10;;){if(typeof c10=="number")return;switch(c10[0]){case 0:var f10=c10[1],g10=hy(c10[2]);return aR(a10,f10),ce(a10,g10);case 1:var d10=c10[2],e10=c10[1];if(d10[0]===0){var i10=d10[1];aR(a10,e10),ce(a10,p2),c10=i10}else{var j10=d10[1];aR(a10,e10),ce(a10,p3),c10=j10}break;case 6:var m10=c10[2];return aR(a10,c10[1]),h(m10,a10);case 7:return aR(a10,c10[1]),cf(a10);case 8:var n10=c10[2];return aR(a10,c10[1]),s(n10);case 2:case 4:var k10=c10[2];return aR(a10,c10[1]),ce(a10,k10);default:var l10=c10[2];return aR(a10,c10[1]),mA(a10,l10)}}}function aS(a10,b10){for(var c10=b10;;){if(typeof c10=="number")return;switch(c10[0]){case 0:var f10=c10[1],g10=hy(c10[2]);return aS(a10,f10),cp(a10,g10);case 1:var d10=c10[2],e10=c10[1];if(d10[0]===0){var i10=d10[1];aS(a10,e10),cp(a10,p4),c10=i10}else{var j10=d10[1];aS(a10,e10),cp(a10,p5),c10=j10}break;case 6:var m10=c10[2];return aS(a10,c10[1]),cp(a10,h(m10,0));case 7:c10=c10[1];break;case 8:var n10=c10[2];return aS(a10,c10[1]),s(n10);case 2:case 4:var k10=c10[2];return aS(a10,c10[1]),cp(a10,k10);default:var l10=c10[2];return aS(a10,c10[1]),nX(a10,l10)}}}function p6(a10){var c10=a10[1],b10=bo(cM);return o(function(a11){return aS(b10,a11),a7(co(b10))},0,c10)}function p7(c10){if(c10==e)return p8;var f10=n(c10);function j10(a11){return h(p6(p9),c10)}function k10(a11){for(var b11=a11;;){if(b11===f10)return b11;var d11=D(c10,b11);if(d11!==9&&d11!==32)return b11;b11=b11+1|0}}var i10=k10(0),o10=function(a11,b11){for(var d11=b11;;){if(d11===f10||25>>0)return d11;d11=d11+1|0}}(i10,i10),a10=ex(c10,i10,o10-i10|0),d10=k10(o10),l10=function(a11,b11){for(var d11=b11;;){if(d11===f10)return d11;var e10=D(c10,d11);a:{if(48<=e10){if(58>e10)break a}else if(e10===45)break a;return d11}d11=d11+1|0}}(d10,d10);if(d10===l10)var m10=0;else try{var r10=l4(ex(c10,d10,l10-d10|0)),m10=r10}catch(f11){var p10=M(f11);if(p10[1]!==cc)throw g(p10,0);var q10=j10(0),m10=q10}k10(l10)!==f10&&j10(0);a:{if(a10!==e&&a10!==j_){if(a10==="h"){var b10=0;break a}if(a10==="hov"){var b10=3;break a}if(a10==="hv"){var b10=2;break a}if(a10!=="v"){var b10=j10(0);break a}var b10=1;break a}var b10=4}return[0,m10,b10]}function p_(d10,b10,c10){return o(function(a10){return aR(b10,a10),h(d10,b10)},0,c10[1])}function c$(a10,b10){return p_(function(a11){return 0},a10,b10)}function eM(a10){return c$(ai,a10)}function eN(c10,b10){return o(function(a10){var b11=bo(64);return aS(b11,a10),h(c10,co(b11))},0,b10[1])}function A(a10){return eN(function(a11){return a11},a10)}var eO=ci(0);function eQ(a10,b10){var c10=a10[1+b10];return mB(c10)?aN(c10)===d3?h(A(p$),c10):aN(c10)===kG?mv(c10):qa:h(A(qb),c10)}function hA(a10,b10){if(a10.length-1<=b10)return qc;var c10=hA(a10,b10+1|0),d10=eQ(a10,b10);return i(A(qd),d10,c10)}function qe(a10){var b10=a10.length-1;if(2>=b10>>>0)switch(b10){case 0:return qg;case 1:return qh;default:var e10=eQ(a10,1);return h(A(qi),e10)}var c10=hA(a10,2),d10=eQ(a10,1);return i(A(qf),d10,c10)}function qj(d10){return function(a10){for(var b10=a10;;){if(!b10)return 0;var e10=b10[2],f10=b10[1];a:{try{var c10=h(f10,d10)}catch{break a}if(c10)return[0,c10[1]]}b10=e10}}(ch(eO))}function qk(a10){if(aN(a10)!==0)return[0,a10[1],0];var b10=a10[1][1];return[0,b10,[0,qe(a10)]]}function ql(a10){var b10=qk(a10),c10=b10[2],d10=b10[1];return c10?aO(d10,c10[1]):d10}function qm(a10){if(a10===em)return qn;if(a10===g5)return qo;if(a10[1]===g4){var b10=a10[2],e10=b10[3],i10=b10[2],j10=b10[1];return f6(A(eP),j10,i10,e10,e10+5|0,qp)}if(a10[1]===f){var c10=a10[2],g10=c10[3],k10=c10[2],l10=c10[1];return f6(A(eP),l10,k10,g10,g10+6|0,qq)}if(a10[1]!==cd)return ql(a10);var d10=a10[2],h10=d10[3],m10=d10[2],n10=d10[1];return f6(A(eP),n10,m10,h10,h10+6|0,qr)}function da(a10){var b10=qj(a10);return b10?b10[1]:qm(a10)}function qs(a10){var b10=[0,Bb(a10)];return b10}function qt(c10,b10){function a10(a11){return a11?c10===0?qu:qv:c10===0?qw:qx}if(b10[0]!==0){if(b10[1])return 0;var p10=a10(0);return[0,h(A(qD),p10)]}if(b10[3]===b10[6])var e10=b10[3],d10=h(A(qy),e10);else var n10=b10[6],o10=b10[3],d10=i(A(qC),o10,n10);var f10=b10[7],g10=b10[4],j10=b10[8]?qz:qB,k10=b10[2],l10=b10[9],m10=a10(b10[1]);return[0,AY(A(qA),m10,l10,k10,j10,d10,g10,f10)]}function qE(a10,b10){if(!b10)return c$(a10,qG);var d10=b10[1],e10=d10.length-2|0,g10=0;if(e10>=0)for(var c10=g10;;){var f10=qt(c10,j(d10,c10)[1+c10]);if(f10){var i10=f10[1];h(c$(a10,qF),i10)}var k10=c10+1|0;if(e10===c10)break;c10=k10}return 0}function db(a10,b10){return qE(a10,qs(b10))}var qJ=qI.slice();function qK(a10,b10){var e10=da(a10);h(eM(qL),e10),db(ai,b10);var c10=BQ(0);if(c10<0){var d10=c2(c10);g9(j(qJ,d10)[1+d10])}return cf(ai)}var qM=[0];function hB(a10){var b10=lU(0);return b10}function qN(a10,b10){try{var d10=b10?qM:hB(0);try{ep(0)}catch{}try{var f10=qK(a10,d10),e10=f10}catch(f11){var i10=M(f11),j10=hB(0),k10=da(a10);h(eM(qP),k10),db(ai,d10);var l10=da(i10);h(eM(qQ),l10),db(ai,j10);var e10=cf(ai)}return e10}catch(f11){var c10=M(f11);if(c10===em)return g9(qO);throw g(c10,0)}}g0(lz,function(a10,b10){try{var c10=qN(a10,b10);return c10}catch{return 0}});function qH(a10){for(;;){var b10=ch(eO),c10=1-g$(eO,b10,[0,a10,b10]);if(!c10)return c10}}function qR(a10){return lU(a10)}var qT=[q,qS,ag(0)];qH(function(a10){return a10[1]===qT?[0,aO(qU,da(a10[2]))]:0});function eR(a10){var b10=a10[1]<1?1:0,c10=b10||(64=0)for(var c10=i10;;){nl(d10,c10*8|0,cY(j(b10,c10)[1+c10]));var n10=c10+1|0;if(f10===c10)break;c10=n10}at(d10,e10*8|0,1);var g10=hC(d10);at(d10,e10*8|0,2);var h10=hC(d10),k10=c6(h10,8),l10=c6(h10,0),m10=c6(g10,8);return hE(a10,c6(g10,0),m10,l10,k10)}function q4(a10){var b10=hD(0);return q3(b10,a10),b10}function hG(a10){return q4(B5(0))}function bT(a10){return l8(a10)}function q5(a10){return l2(l8(a10))&1073741823}aP([0,function(a10){var b10=bT(a10),c10=bT(a10),d10=bT(a10);return hF(b10,c10,d10,bT(a10))}],function(a10){return hF(q9,q8,q7,q6)});function q_(a10){var b10=a10.length-1<4?1:0,c10=b10||(a10[4]<0?1:0);return c10}try{var AW=mh(lu),hK=AW}catch(f10){var hH=M(f10);if(hH!==aD)throw g(hH,0);try{var AV=mh("CAMLRUNPARAM"),hJ=AV}catch(f11){var hI=M(f11);if(hI!==aD)throw g(hI,0);var hJ=q$}var hK=hJ}var ra=ci(nr(hK,82)),rb=aP(0,hG);function rc(a10,b10){for(var c10=a10;;){if(b10<=c10||eq2<(c10*2|0))return c10;c10=c10*2|0}}function hL(a10,b10){var d10=a10?a10[1]:ch(ra),c10=rc(16,b10),e10=d10?q5(a_(rb)):0;return[0,0,ap(c10,0),e10,c10]}function rd(m10,b10,c10,d10){var g10=d10.length-1,f10=ap(g10,0),i10=c10.length-2|0;function n10(a11){for(var c11=a11;;){if(!c11)return;var i11=c11[1],l11=c11[2],n11=c11[3],g11=b10?c11:[0,i11,l11,0],e11=h(m10,i11),k11=j(f10,e11)[1+e11];k11?k11[3]=g11:j(d10,e11)[1+e11]=g11,j(f10,e11)[1+e11]=g11,c11=n11}}var o10=0;if(i10>=0)for(var e10=o10;;){n10(j(c10,e10)[1+e10]);var r10=e10+1|0;if(i10===e10)break;e10=r10}if(b10){var k10=g10-1|0,p10=0;if(k10>=0)for(var a10=p10;;){var l10=j(f10,a10)[1+a10];l10&&(l10[3]=0);var q10=a10+1|0;if(k10===a10)break;a10=q10}}}function re(a10,b10){var c10=b10[2],d10=(c10.length-1)*2|0,e10=d10>>0))return hS(a10,d10)}function ro(a10){var b10=nS(a10[28]);if(b10){var c10=b10[1],d10=c10[1];a10[12]=a10[12]-c10[3]|0;var e10=d10;a10[9]=a10[9]+e10|0}}function rp(a10,b10,c10){if(typeof c10=="number")switch(c10){case 0:var j10=bQ(a10[3]);if(!j10)return;var k10=j10[1][1],l10=function(a11,b11){if(!b11)return[0,a11,0];var c11=b11[1],d11=b11[2];return BK(a11,c11)?[0,a11,b11]:[0,c11,l10(a11,d11)]};k10[1]=l10(a10[6]-a10[9]|0,k10[1]);return;case 1:bP(a10[2]);return;case 2:bP(a10[3]);return;case 3:var m10=bQ(a10[2]);return m10?hS(a10,m10[1][2]):dd(a10);case 4:var o10=a10[10]!==(a10[6]-a10[9]|0)?1:0;return o10&&ro(a10);default:var p10=bP(a10[5]);return p10?eT(a10,h(a10[25],p10[1])):void 0}switch(c10[0]){case 0:return hR(a10,b10,c10[1]);case 1:var d10=c10[2],f10=c10[1],q10=d10[1],z10=d10[2],r10=bQ(a10[2]);if(!r10)return;var s10=r10[1],e10=s10[2];switch(s10[1]){case 0:return bU(a10,f10);case 1:return bp(a10,d10,e10);case 2:return bp(a10,d10,e10);case 3:return a10[9]<(b10+n(q10)|0)?bp(a10,d10,e10):bU(a10,f10);case 4:return a10[11]?bU(a10,f10):a10[9]<(b10+n(q10)|0)||((a10[6]-e10|0)+z10|0)=a10[14])return a10[13]=hQ,hT(a10),b10&&dd(a10),rB(a10);hY(a10,0)}}function eW(a10,b10,c10){var d10=a10[14]=c10)return y(a10[17],h4,0,c10);y(a10[17],h4,0,80),c10=c10-80|0}}function rN(a10){return a10[1]===cs?aO(rP,aO(a10[2],rO)):rQ}function rR(a10){return a10[1]===cs?aO(rT,aO(a10[2],rS)):rU}function rV(a10){return 0}function rW(a10){return 0}function eY(a10,b10,c10,d10,e10){var g10=eC(0),h10=[0,hO,rX,0];eE(h10,g10);var f10=bO(0);eU(f10),a9([0,1,h10],f10);var i10=78,j10=bO(0),k10=bO(0),l10=bO(0);return[0,f10,bO(0),l10,k10,j10,i10,10,68,i10,0,1,1,1,1,g7,rY,a10,b10,c10,d10,e10,0,0,rN,rR,rV,rW,g10]}function h5(a10,b10){var c10=eY(a10,b10,function(a11){return 0},function(a11){return 0},function(a11){return 0});return c10[19]=function(a11){return eX(c10,a11)},c10[20]=function(a11){return bV(c10,a11)},c10[21]=function(a11){return bV(c10,a11)},c10}function h6(d10){return h5(function(a10,b10,c10){return g8(d10,a10,b10,c10)},function(a10){return cf(d10)})}function df(d10){return h5(function(a10,b10,c10){return ho(d10,a10,b10,c10)},function(a10){return 0})}var eZ=dW;function h7(a10){return bo(eZ)}var h8=h7(0),e0=h6(en),e1=h6(ai),rZ=df(h8),h9=aP(0,h7);cq(h9,h8),cq(aP(0,function(a10){return df(a_(h9))}),rZ);function dg(a10,b10,c10,d10){return ho(a_(a10),b10,c10,d10)}function dh(a10,b10,c10){var d10=a_(b10),e10=hn(d10);return g8(a10,co(d10),0,e10),cf(a10),nV(d10)}var di=aP(0,function(a10){return bo(eZ)}),dj=aP(0,function(a10){return bo(eZ)}),h_=aP(0,function(a10){var b10=eY(function(a11,b11,c10){return dg(di,a11,b11,c10)},function(a11){return dh(en,di,a11)},function(a11){return 0},function(a11){return 0},function(a11){return 0});return b10[19]=function(a11){return eX(b10,a11)},b10[20]=function(a11){return bV(b10,a11)},b10[21]=function(a11){return bV(b10,a11)},hu(function(a11){return a$(b10,a11)}),b10});cq(h_,e0);var h$=aP(0,function(a10){var b10=eY(function(a11,b11,c10){return dg(dj,a11,b11,c10)},function(a11){return dh(ai,dj,a11)},function(a11){return 0},function(a11){return 0},function(a11){return 0});return b10[19]=function(a11){return eX(b10,a11)},b10[20]=function(a11){return bV(b10,a11)},b10[21]=function(a11){return bV(b10,a11)},hu(function(a11){return a$(b10,a11)}),b10});cq(h$,e1);function rx(a10,b10){a10[22]&&(a9(b10,a10[4]),h(a10[26],b10));var c10=a10[23];return c10&&ct(a10,[0,dc,[5,b10],0])}function rD(a10,b10){return h1(a10,n(b10),b10)}function rE(a10,b10){return h0(a10,1),h(a10[18],0)}function rF(a10,b10){var c10=a10[14]=0)for(var c10=g10;;){r4(e10,c10,a10,j(b10,c10)[1+c10]);var h10=c10+1|0;if(f10===c10)break;c10=h10}return e10}function id2(a10,b10){return typeof b10!="number"&&b10[0]===0?ic(a10,b10[1]):a7(r5)}function r6(a10,b10,c10,d10){if(typeof c10!="number")return c10[0]===0?ie(c10[1],a10[1+b10],d10):void 0;if(c10!==2){a10[1+b10]=d10;return}if(aN(d10)===0&&d10.length-1===4)for(var e10=0,h10=a10[1+b10];;){h10[1+e10]=d10[1+e10];var i10=e10+1|0;if(e10===3)return;e10=i10}throw g([0,f,r7],1)}function ie(a10,b10,c10){if(aN(c10)===0&&a10.length-1<=c10.length-1){var e10=a10.length-2|0,h10=0;if(e10>=0)for(var d10=h10;;){var i10=c10[1+d10];r6(b10,d10,j(a10,d10)[1+d10],i10);var k10=d10+1|0;if(e10===d10)break;d10=k10}return}throw g([0,f,r8],1)}function ig(a10,b10,c10){return typeof a10!="number"&&a10[0]===0?ie(a10[1],b10,c10):a7(r9)}var e2=[q,r_,ag(0)];r2(r$,[0,e2,[0]]);function e3(a10){return[0,a10]}function R(a10){return[0,a10]}function dk(a10){return a10[0]===0?[0,a10[1]]:0}var bW=[0,function(a10){return a10}(0)];function bX(a10){return[1,0,0,0,a10]}function k(a10,b10){return a10[0]===0?[0,h(b10,a10[1])]:bX([0,a10,b10])}function bY(a10,b10,c10){if(a10[0]===0){var d10=a10[1];if(b10[0]===0)return[0,i(c10,d10,b10[1])]}return bX([1,a10,b10,c10])}function ih(a10){return a10[0]===0?a10[1]:bX([4,a10,0])}function ii(a10,b10,c10){switch(c10[0]){case 0:throw g([0,f,sc],1);case 1:c10[3]=[0,b10,a10,c10[3]];return;default:c10[2]=[0,b10,a10,c10[2]];return}}function e4(a10,b10){if(!b10)throw g([0,f,sd],1);if(b10[2]===a10)return[0,b10[1],b10[3]];var c10=e4(a10,b10[3]),d10=c10[1];return b10[3]=c10[2],[0,d10,b10]}function cv(a10,b10){switch(b10[0]){case 0:throw g([0,f,se],1);case 1:var c10=e4(a10,b10[3]),e10=c10[1];return b10[3]=c10[2],e10;default:var d10=e4(a10,b10[2]),h10=d10[1];return b10[2]=d10[2],h10}}function ij(a10,b10,c10,d10){for(var e10=d10;;){if(!e10)throw g([0,f,sf],1);if(e10[1]===b10&&e10[2]===a10){e10[1]=c10;return}e10=e10[3]}}function e5(a10,b10,c10,d10){switch(d10[0]){case 0:throw g([0,f,sg],1);case 1:return ij(a10,b10,c10,d10[3]);default:return ij(a10,b10,c10,d10[2])}}function ik(a10,b10){for(var c10=b10;;){if(!c10)throw g([0,f,sh],1);if(c10[2]===a10)return c10[1];c10=c10[3]}}function si(a10,b10){switch(b10[0]){case 0:throw g([0,f,sj],1);case 1:return ik(a10,b10[3]);default:return ik(a10,b10[2])}}function aY(a10,b10,c10,d10){switch(d10[0]){case 0:throw g([0,f,sk],1);case 1:var j10=d10[1];if(typeof j10=="number"&&!j10){if(!c10||b10[1])return;b10[1]=1;return}var k10=d10[4];if(k10[0]===7){var n10=k10[2];if(n10[0]===1){var o10=n10[1];if(typeof o10=="number"){if(!o10&&c10){if(b10[1])return;b10[1]=1;return}}else if(c10)return}}var l10=d10[1];a:{if(typeof l10=="number"&&l10){var e10=1;break a}var e10=c10}d10[1]=0;var m10=d10[2];return a10<50?j2(a10+1|0,b10,e10,m10):r(j2,[0,b10,e10,m10]);default:var i10=d10[1];if(d10[1]=0,typeof i10=="number"){if(!i10)return;b10[1]=2;return}var p10=i10[1];return c10&&(b10[1]=2),h(d10[3],p10)}}function ba(a10,b10,c10){return bM(aY(0,a10,b10,c10))}function j2(a10,b10,c10,d10){if(typeof d10!="number")switch(d10[0]){case 0:var f10=d10[1];return a10<50?aY(a10+1|0,b10,c10,f10):r(aY,[0,b10,c10,f10]);case 1:var g10=d10[2];return ba(b10,c10,d10[1]),a10<50?aY(a10+1|0,b10,c10,g10):r(aY,[0,b10,c10,g10]);case 2:var h10=d10[3],l10=d10[2];return ba(b10,c10,d10[1]),ba(b10,c10,l10),a10<50?aY(a10+1|0,b10,c10,h10):r(aY,[0,b10,c10,h10]);case 3:var i10=d10[4],m10=d10[3],n10=d10[2];return ba(b10,c10,d10[1]),ba(b10,c10,n10),ba(b10,c10,m10),a10<50?aY(a10+1|0,b10,c10,i10):r(aY,[0,b10,c10,i10]);default:var o10=d10[1];d10[1]=0;var k10=o10-1|0,p10=0;if(k10>=0)for(var e10=p10;;){ba(b10,c10,j(d10[3],e10)[1+e10]);var q10=e10+1|0;if(k10===e10)break;e10=q10}return}}function sl(a10){return i(c$(ai,sm),db,Bk(20))}function dl(a10,b10){var c10=[0,0];ba(c10,a10,b10);var d10=2<=c10[1]?1:0;return d10&&sl(0)}function ae(a10){return bX([5,a10])}function ar(a10){return a10}function ab(a10,b10){if(a10[0]===1){var c10=a10[4];if(c10[0]===5)return c10[1]=b10,dl(0,a10)}throw g([0,f,sn],1)}function bq(a10){if(a10[0]===1){var b10=a10[4];if(b10[0]===5)return b10[1]}throw g([0,f,so],1)}function bZ(a10,b10,c10){for(var k10=a10,h10=b10,d10=c10;;)switch(d10[0]){case 0:return k10;case 1:var e10=d10[2];if(typeof e10=="number")throw g([0,f,st],1);switch(e10[0]){case 0:if(e10[1]!==h10)throw g([0,f,su],1);var o10=0;break;case 1:var B10=e10[2],C2=e10[1];if(C2===h10)var D2=[0,B10];else{if(B10!==h10)throw g([0,f,sv],1);var D2=[0,C2]}var o10=D2;break;case 2:var u10=e10[3],v10=e10[2],w10=e10[1];if(w10===h10)var x10=[1,v10,u10];else if(v10===h10)var x10=[1,w10,u10];else{if(u10!==h10)throw g([0,f,sw],1);var x10=[1,w10,v10]}var o10=x10;break;case 3:var p10=e10[4],q10=e10[3],r10=e10[2],s10=e10[1];if(s10===h10)var t10=[2,r10,q10,p10];else if(r10===h10)var t10=[2,s10,q10,p10];else if(q10===h10)var t10=[2,s10,r10,p10];else{if(p10!==h10)throw g([0,f,sx],1);var t10=[2,s10,r10,q10]}var o10=t10;break;default:var n10=cv(d10,h10);if(j(e10[3],n10)[1+n10]!==h10)throw g([0,f,sy],1);var m10=e10[2]-1|0;if(e10[2]=m10,n10>>2|0))var U2=nu(e10[3],0,K2>>>1|0),L2=[4,e10[1],e10[2],U2];else var L2=e10;var J2=L2}var o10=J2}if(d10[2]=o10,typeof o10!="number")return k10;var y10=d10[1];d10[1]=1;var l10=d10[4];switch(l10[0]){case 0:h10=d10,d10=l10[1];break;case 1:var N2=l10[2];k10=bZ(k10,d10,l10[1]),h10=d10,d10=N2;break;case 2:var O2=l10[2];k10=bZ(k10,d10,l10[1]),h10=d10,d10=O2;break;case 3:var P2=l10[2];k10=bZ(k10,d10,l10[1]),h10=d10,d10=P2;break;case 4:var z10=l10[2],A10=bZ(k10,d10,l10[1]);if(!z10)return A10;var Q2=z10[1];l10[2]=0,k10=A10,h10=d10,d10=Q2;break;case 5:return k10;case 6:if(typeof y10=="number")return k10;var R2=y10[1];try{return i(l10[2],d10,R2),k10}catch(f10){var S2=M(f10);return[0,[0,S2,qR(0)],k10]}default:var T2=l10[1];k10=bZ(k10,d10,l10[2]),h10=d10,d10=T2}break;default:throw g([0,f,sz],1)}}function bb(a10,b10){for(var e10=a10,c10=b10;;)switch(c10[0]){case 0:return;case 1:var n10=typeof c10[2]=="number"?1:0,d10=c10[2];if(typeof d10=="number")var k10=[0,e10];else switch(d10[0]){case 0:var k10=[1,e10,d10[1]];break;case 1:var k10=[2,e10,d10[1],d10[2]];break;case 2:var k10=[3,e10,d10[1],d10[2],d10[3]];break;case 3:for(var o10=[0,d10[1],d10[2],d10[3],d10[4],e10,bW,bW,bW],l10=0;;){ii(c10,l10,j(o10,l10)[1+l10]);var w10=l10+1|0;if(l10===4)break;l10=w10}var k10=[4,5,5,o10];break;default:var i10=d10[2];if(i10>>1|0)}function is(a10,b10,c10){if(typeof a10!="number"){if(a10[0]!==0){if(a10[2]!==b10)throw g([0,f,s9],1);a10[2]=c10;return}if(a10[2]===b10){a10[2]=c10;return}if(a10[4]===b10){a10[4]=c10;return}}throw g([0,f,s8],1)}function f5(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=c10[4];if(typeof d10!="number"&&d10[0]!==1){var h10=c10[5],e10=d10[2];if(typeof e10=="number")var i10=0;else{if(e10[0]!==0)throw g([0,f,tb],1);e10[5]=c10;var i10=e10}return d10[2]=c10,c10[4]=i10,c10[5]=d10,d10[5]=h10,is(h10,c10,d10),fb(b10,c10),a10<50?cK(a10+1|0,b10,d10):r(cK,[0,b10,d10])}}throw g([0,f,ta],1)}function s_(a10,b10){return bM(f5(0,a10,b10))}function f4(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=c10[2];if(typeof d10!="number"&&d10[0]!==1){var h10=c10[5],e10=d10[4];if(typeof e10=="number")var i10=0;else{if(e10[0]!==0)throw g([0,f,td],1);e10[5]=c10;var i10=e10}return d10[4]=c10,c10[2]=i10,c10[5]=d10,d10[5]=h10,is(h10,c10,d10),fb(b10,c10),a10<50?cK(a10+1|0,b10,d10):r(cK,[0,b10,d10])}}throw g([0,f,tc],1)}function s$(a10,b10){return bM(f4(0,a10,b10))}function j4(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=c10[4];a:if(typeof d10!="number"&&d10[0]===0){var e10=b1(d10[2]);if(fa(b1(d10[4]),e10)){s$(b10,d10);break a}}return a10<50?f5(a10+1|0,b10,c10):r(f5,[0,b10,c10])}throw g([0,f,te],1)}function j3(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=c10[2];a:if(typeof d10!="number"&&d10[0]===0){var e10=b1(d10[4]);if(fa(b1(d10[2]),e10)){s_(b10,d10);break a}}return a10<50?f4(a10+1|0,b10,c10):r(f4,[0,b10,c10])}throw g([0,f,tf],1)}function cK(a10,b10,c10){if(typeof c10!="number"&&c10[0]===0){var d10=b1(c10[2]),e10=b1(c10[4]);return d10>>2|0)}function aE(a10,b10){if(typeof a10=="number")var c10=b10;else{if(typeof b10!="number"){var d10=dq(b10);return[1,(ix(dq(a10),d10)+1|0)<<2,a10,b10]}var c10=a10}return c10}function iy(a10){return typeof a10=="number"?0:a10[0]===0?[0,a10[2]]:[1,a10[2],a10[3]]}var fc=1,fd=2,tL=3;function iz(a10){return a10===-1?1:0}function fe(a10){return a10!==-1?1:0}function b2(a10){return(a10&3)===3?1:0}function iA(a10){return(a10&3)===1?1:0}function iB(a10){return(a10&3)===2?1:0}function iC(a10){return a10|3}function tM(a10){return a10>>>2|0}function iD(a10){return a10<<2|2}function cz(a10){return a10&mo(tL)}function iE(a10){return a10[2]}function iF(a10){return a10[3]}function iG(a10){return[0,0,0,0]}function dr(a10){a10[1]=a10[1]+1|0}function ds(a10){a10[2]=a10[2]+1|0}function dt(a10){a10[3]=a10[3]+1|0}function ff(a10,b10,c10){for(var d10=c10;;){if(typeof d10=="number")return;if(d10[0]===0){var e10=d10[1],i10=(e10&3)!==3?1:0,l10=i10&&(e10&3?1:0);if(l10){if(e10&b10)throw g([0,f,tO],1);dr(a10),dt(a10),d10[1]=e10|3}return}var h10=d10[1],j10=(h10&3)!==3?1:0,k10=j10&&(h10&3?1:0);if(!k10)return k10;if(h10&b10)throw g([0,f,tP],1);dr(a10),dt(a10),d10[1]=h10|3,ff(a10,b10,d10[2]),d10=d10[3]}}function du(a10,b10,c10,d10){if(typeof d10!="number"){if(d10[0]===0){var e10=d10[1];e10&c10||(dr(a10),e10&3?(d10[1]=-1,dt(a10),ds(a10)):d10[1]=e10|c10);var g10=e10!==-1?1:0,h10=g10&&((e10&3)===3?1:0);return h10&&(d10[1]=-1,ds(a10))}var f10=d10[1];f10&c10||(dr(a10),f10&3?(d10[1]=-1,dt(a10),ds(a10),ff(a10,c10,d10[2]),ff(a10,c10,d10[3])):(d10[1]=f10|c10,eE(d10,b10)));var i10=f10!==-1?1:0,j10=i10&&((f10&3)===3?1:0);return j10&&(d10[1]=-1,ds(a10))}}function fg(a10,b10,c10){var d10=hm(b10);if(typeof d10!="number"&&d10[0]===1){var e10=(d10[1]&3)===c10?1:0;return e10&&(du(a10,b10,c10,d10[2]),du(a10,b10,c10,d10[3]))}throw g([0,f,tQ],1)}function iH(a10,b10,c10){for(;;){if(eF(b10))return;fg(a10,b10,c10)}}function tR(a10,b10,c10,d10){for(;;){if(eF(c10))return iH(b10,d10,fd);if(eF(d10))return iH(a10,c10,fc);fg(a10,c10,fc),fg(b10,d10,fd)}}function fh(a10){var b10=a10[6];return a10[6]=b10+1|0,b10}function fi(a10){for(var b10=a10;;){if(typeof b10=="number")return;if(b10[0]===0){var c10=b10[1];if(typeof c10!="number"&&c10[0]===0){var e10=c10[1],i10=fe(e10),l10=i10&&b2(e10);l10&&(c10[1]=cz(e10));return}throw g([0,f,tW],1)}var d10=b10[1];if(typeof d10!="number"&&d10[0]===1){var h10=d10[1],m10=b10[4],n10=b10[3],j10=fe(h10),k10=j10&&b2(h10);if(!k10)return k10;d10[1]=cz(h10),fi(n10),b10=m10;continue}throw g([0,f,tX],1)}}function iI(a10,b10){for(var c10=b10;;){if(typeof c10=="number")return;if(c10[0]===0){var d10=c10[1];if(typeof d10!="number"&&d10[0]===0){var e10=d10[1],u10=c10[2];if(!iA(e10)){if(iz(e10)){var k10=fh(a10);j(a10[4],k10)[1+k10]=d10,j(a10[5],k10)[1+k10]=[0,c10,0],d10[1]=iD(k10);return}if(iB(e10)){var n10=tM(e10),v10=[0,c10,j(a10[5],n10)[1+n10]];j(a10[5],n10)[1+n10]=v10;return}var q10=b2(e10);if(q10)throw g([0,f,t0],1);return q10}var m10=a10[2];if(-1a10[3]))throw g([0,f,tZ],1);d10[1]=cz(e10);return}throw g([0,f,tY],1)}var h10=c10[1];if(typeof h10!="number"&&h10[0]===1){var r10=c10[4],s10=c10[3],i10=h10[1],w10=c10[2];if(iz(i10)){var l10=fh(a10);return j(a10[4],l10)[1+l10]=h10,j(a10[5],l10)[1+l10]=[0,c10,0],h10[1]=iD(l10),fi(s10),fi(r10)}if(!iA(i10)){if(iB(i10)){var o10=i10>>>2|0,x10=[0,c10,j(a10[5],o10)[1+o10]];j(a10[5],o10)[1+o10]=x10;return}var t10=b2(i10);if(t10)throw g([0,f,t3],1);return t10}if(-1a10[3])throw g([0,f,t2],1)}h10[1]=cz(i10),iI(a10,s10),c10=r10;continue}throw g([0,f,t1],1)}}function cA(a10,b10){if(typeof b10=="number")return 0;if(b10[0]!==0){var i10=b10[1];if(i10===-1){var l10=fh(a10);b10[1]=0,j(a10[4],l10)[1+l10]=b10;var p10=cA(a10,b10[2]);return[1,b10,0,p10,cA(a10,b10[3])]}if(!b2(i10)){b10[1]=cz(b10[1]);var r10=cA(a10,b10[2]);return[1,b10,0,r10,cA(a10,b10[3])]}var d10=i10>>>2|0,k10=j(a10[5],d10)[1+d10];if(!k10)throw g([0,f,t6],1);var m10=k10[2],q10=k10[1];return j(a10[5],d10)[1+d10]=m10,m10===0&&(b10[1]=0),q10}var e10=b10[1];if(fe(e10)&&b2(e10)){var c10=e10>>>2|0,h10=j(a10[5],c10)[1+c10];if(!h10)return[0,b10,0];var n10=h10[2],o10=h10[1];return j(a10[5],c10)[1+c10]=n10,o10}return b10[1]=0,[0,b10,0]}var fj=[0,0,[0],0,0];function tN(a10){return a10[1]}function tS(a10){return a10[1]}function tT(a10){return a10[2]}function tU(a10,b10){var c10=iG(0),d10=iG(0),e10=eC(0),f10=eC(0);return du(c10,e10,fc,a10),du(d10,f10,fd,b10),tR(c10,d10,e10,f10),[0,c10,d10]}function tV(a10){if(typeof a10!="number"){if(a10[0]===0){a10[1]=0;return}var b10=dq(a10[3]);a10[1]=(ix(dq(a10[2]),b10)+1|0)<<2}}function t4(a10){var e10=a10[6]-1|0,h10=0;if(e10>=0)for(var b10=h10;;){var c10=j(a10[4],b10)[1+b10];typeof c10!="number"&&(c10[0],c10[1]=iC(c10[1]));var d10=j(a10[5],b10)[1+b10];if(!d10)throw g([0,f,t5],1);if(d10[2]){var i10=ck(d10);j(a10[5],b10)[1+b10]=i10}var k10=b10+1|0;if(e10===b10)break;b10=k10}}function iJ(a10,b10,c10){if(typeof b10=="number"){if(typeof c10=="number")return[0,fj,0]}else if(b10[1]===c10)return[0,fj,b10];var t10=typeof b10=="number"?cy:b10[1],m10=tU(t10,c10),i10=tS(m10),n10=tT(m10),u10=iF(n10),v10=iF(i10)+u10|0,o10=tN(i10)-v10|0,w10=iE(n10),p10=iE(i10)+w10|0,x10=0,y10=ap(p10,0),z10=ap(p10,0),A10=a10?o10:-1,B10=a10?0:-1,C2=a10?ap(o10,0):[0],d10=[0,C2,B10,A10,z10,y10,x10];if(iI(d10,b10),d10[2]!==d10[3])throw g([0,f,t7],1);t4(d10);var q10=cA(d10,c10),r10=d10[6]-1|0;if(r10>=0)for(var h10=r10;;){tV(j(d10[4],h10)[1+h10]);var F2=h10-1|0;if(h10===0)break;h10=F2}if(!a10)return[0,fj,q10];var k10=[0,0],l10=[0,0],s10=d10[6]-1|0,D2=0;if(s10>=0)for(var e10=D2;;){a8(function(a11){if(typeof a11!="number")if(a11[0]===0){var b11=a11[2];if(b11)return k10[1]=[0,b11[1],k10[1]],0}else{var c11=a11[2];if(c11)return l10[1]=[0,c11[1],l10[1]],0}return 0},j(d10[5],e10)[1+e10]);var E2=e10+1|0;if(s10===e10)break;e10=E2}return[0,[0,d10[2],d10[1],k10[1],l10[1]],q10]}function t8(d10,b10){if(typeof b10=="number")return 0;function c10(a10){a:if(typeof a10!="number"){b:{if(a10[0]===0){var b11=a10[1];if(typeof b11!="number"&&b11[0]===0){var e10=a10[2];if(e10){var j10=e10[1];break b}var k10=h(d10[1],b11[2]);return a10[2]=[0,k10],k10}break a}var l10=a10[2];if(!l10){var n10=c10(a10[3]),o10=c10(a10[4]),m10=i(d10[2],n10,o10);return a10[2]=[0,m10],m10}var j10=l10[1]}return j10}throw g([0,f,t9],1)}return[0,c10(b10)]}function dv(a10,b10){return[0,[0,a10,b10],0]}function dw(a10){return t8(a10[1],a10[2])}function t_(a10,b10){var c10=a10[1];return[0,c10,iJ(0,a10[2],b10)[2]]}function fk(a10,b10){var d10=a10[1],c10=iJ(1,a10[2],b10);return[0,c10[1],[0,d10,c10[2]]]}function dx(a10,b10,c10,d10){var e10=[0,d10];if(w===a10)var h10=c10[1],g10=0;else if(ks<=a10)var h10=c10[2].length-1,g10=c10[1];else var h10=c10[2].length-1,g10=0;var k10=h10-1|0;if(k10>=g10)for(var f10=g10;;){var l10=j(c10[2],f10)[1+f10];l10&&(e10[1]=i(b10,l10[1],e10[1]));var m10=f10+1|0;if(k10===f10)break;f10=m10}ks>a10&&a8(function(a11){return e10[1]=i(b10,a11,e10[1]),0},c10[3]),w!==a10&&a8(function(a11){return e10[1]=i(b10,a11,e10[1]),0},c10[4])}function fl(a10,b10,c10){if(typeof c10=="number")throw g([0,f,t$],1);if(c10[0]===0)return h(a10,c10[2]);var d10=fl(a10,b10,c10[3]);return i(b10,fl(a10,b10,c10[2]),d10)}function br(a10,b10,c10){var d10=b10[2],e10=b10[1],f10=dk(c10);if(f10){var g10=f10[1];return R(typeof g10=="number"?e10:fl(a10,d10,g10))}var h10=[0,dv(a10,d10)];return k(c10,function(a11){var b11=t_(h10[1],a11);h10[1]=b11;var c11=dw(b11);return c11?c11[1]:e10})}var aT=[0,cy,aE];function ua(a10,b10){return dm(b10,aT,a10)}function dy(a10){return ua(a10,J)}function iK(a10){function e10(a11,b10){for(var c10=a11,d10=b10;;){if(typeof c10=="number")return d10;if(c10[0]===0)return[0,c10[2],d10];var f10=e10(c10[3],d10);c10=c10[2],d10=f10}}return e10(a10,0)}var iL=[0,R(0),function(a10,b10){return bY(a10,b10,aE)}];function fm(c10,b10){return br(function(a10){return J(h(c10,a10))},aT,b10)}function ub(a10,b10){return ih(br(b10,iL,a10))}function bs(a10){return ub(a10,function(a11){return k(a11,J)})}var bt=e;function uc(a10){return a10[kU]}function iM(a10,b10){var c10=a10?a10[1]:bt;return BL(b10).join(c10)}function fn(a10){return uc(a10)===0?1:0}function dz(a10,b10){return lS(a10,b10)}p.Number;var fo=null,ud=void 0;function cB(a10){return a10===fo?1:0}function ue(a10){return a10===ud?1:0}function b3(a10){var b10=cB(a10);return b10||ue(a10)}function iN(a10){return 1-b3(a10)}function dA(a10,b10){return b3(b10)?0:[0,h(a10,b10)]}var l=p;function fp(a10,b10){var c10=a10[b10];return b3(c10)?0:[0,c10]}function fq(a10){return new l[lh](a10)}function iO(a10){return a10[kU]}function iP(c10,b10){return hj(iO(b10),function(a10){return h(c10,b10[a10])})}function iQ(a10,b10){var d10=b10.length-1,e10=fq(d10),f10=d10-1|0,g10=0;if(f10>=0)for(var c10=g10;;){e10[c10]=h(a10,j(b10,c10)[1+c10]);var i10=c10+1|0;if(f10===c10)break;c10=i10}return e10}function iR(c10,b10){return mZ(iO(b10),function(a10){return h(c10,b10[a10])})}function fr(f10,b10){return function(a10,b11,c10){for(var e10=a10,d10=c10;;){if(!d10)return b11;var g10=d10[2];b11[e10]=h(f10,d10[1]),e10=e10+1|0,d10=g10}}(0,fq(0),b10)}function ui(a10,b10){var c10=new l.Error(b10);return a10&&(c10[bB]=a10[1]),c10}var uk=Symbol.iterator;function um(a10){return a10.next()}function un(a10){var b10=dA(function(a11){return a11|0},a10.done);return b10?b10[1]:0}function uo(a10){return a10[dV]}function iS(i10,g10,c10,d10,e10){return function(a10,b10){for(var d11=b10;;){var e11=um(a10);if(un(e11))return d11;var f10=uo(e11),j10=h(g10,f10[1]);d11=y(c10,h(i10,f10[0]),j10,d11)}}(d10,e10)}l.Promise;function uh(a10){return aw(a10)}function bu(a10,b10,c10){return eg(a10,uh(b10),c10)}function ay(a10){return aw(a10)}function v(a10){return H(a10)}function b4(a10,b10){return a10 instanceof b10?1:0}var uf=!0;function ug(a10,b10){a10[b10]}function uj(a10,b10){return h(function(a11){throw a11},ui(a10,b10))}function ul(a10){return a10[uk]()}l.Event;function dB(a10){return a10[f7]}function iT(a10,b10,c10,d10){var e10=a10?a10[1]:{},f10=bJ(1,c10);return d10.addEventListener(b10,f10,e10),function(a11){return d10.removeEventListener(b10,f10,e10),0}}function iU(a10){return h(a10,0)}var fs="change",cC="click";l.ArrayBuffer,l.DataView;function up(a10){return a10.preventDefault(),0}var uq="DOMContentLoaded",ur=kz,us="scroll",ut="wheel";l.Blob,l.File;var iV=l.JSON;l.encodeURI,l.decodeURI,l.encodeURIComponent,l.decodeURIComponent,l.URL,l.URLSearchParams;function aU(a10,b10){return[0,a10,b10]}var cD=[0,bt,bt];function ft(a10){return[0,a10,bt]}function iW(a10){return a10}var cE=ly,fu=ki,iX=bB,iY=k6,fv="type",fw=dV,iZ=ft(dT),ux="for";function aV(a10){return aU(cE,a10)}function i0(a10){return aU(ux,a10)}var uA=ft("required");function dC(a10){return aU(iY,a10)}function i1(a10){return aU(fv,a10)}var uB=ft("selected"),bv=l.document;function uu(a10){return iV.stringify(a10)}function uv(a10){try{var c10=iV.parse(a10)}catch(f10){var b10=M(f10);if(b10[1]===e2)return[1,b10[2]];throw g(b10,0)}return[0,c10]}function uw(a10,b10){return a10?b10:cD}var uy="placeholder";function uz(a10){return aU(fu,a10)}function uC(a10){return aU(fw,a10)}function uD(a10){return a10.ownerDocument}b3(bv)||bv[ke];function uE(a10,b10){return a10.appendChild(b10),0}function uF(a10,b10,c10,d10){for(var g10=b10,f10=c10,e10=d10;;){if(!e10){g10!==0&&a10.setAttribute(k6,iM([0,";"],ck(g10))),f10!==0&&a10.setAttribute(ly,iM([0,aI],ck(f10)));return}var h10=e10[2],k10=e10[1],i10=k10[2],j10=k10[1];if(fn(j10))e10=h10;else if(dz(j10,iY))g10=[0,i10,g10],e10=h10;else if(dz(j10,cE)){var l10=fn(i10)?f10:[0,i10,f10];f10=l10,e10=h10}else a10.setAttribute(j10,i10),e10=h10}}function i2(a10,b10,c10,d10){var f10=a10?a10[1]:bv,g10=b10?b10[1]:0,e10=f10.createElement(c10);return uF(e10,0,0,g10),a8(function(a11){return uE(e10,a11)},d10),e10}function aW(a10,b10){var c10=a10?a10[1]:bv;return c10.createTextNode(v(b10))}function i3(a10,b10,c10){return fn(a10)?0:b10?(c10.setAttribute(a10,b10[1]),0):(c10.removeAttribute(a10),0)}function i4(a10,b10,c10){return b10?(c10[j7].add(a10),0):(c10[j7].remove(a10),0)}var i5="div";function uP(a10,b10,c10,d10){return i2(b10,c10,a10,d10)}function i6(a10,b10,c10){return uP(i5,a10,b10,c10)}function i7(a10){return a10[ke]}function dD(a10,b10,c10){return eg(a10,b10,c10),0}var dE=l[kV];function dF(a10){return BG(function(a11,b10,c10){for(var e10=b10,d10=c10;;){if(!d10)return a11;var f10=d10[2];a11[e10]=d10[1],e10=e10+1|0,d10=f10}}(fq(0),0,a10))}function aF(a10){return dD(dE,uS,dF(a10))}function b5(a10){return dD(dE,uX,dF(a10))}l[kV],l.navigator;var u0=l.performance,dG=l[lw];ug(l,u1);function uG(a10,b10){eg(a10,kR,c7(b10))}function uH(a10,b10,c10){var e10=a10?a10[1]:l[lw],d10=e10.getComputedStyle(c10)[b10];return b3(d10)?bt:d10}function uI(a10,b10){var c10=a10?a10[1]:lt,d10=lt<=c10?1:0;return b10.scrollIntoView(!!d10),0}var uJ="button",uK="form",uL=kz,uM="label",uN="option",uO="select";function uQ(a10){var b10=a10.body;return iN(b10)?b10:uj(0,"Document body is null. Try to defer your script execution.")}function uR(a10){return dA(function(a11){return a11},a10.activeElement)}function uT(a10){return dD(dE,uU,dF(a10))}function uV(a10){return dD(dE,uW,dF(a10))}function uY(a10){return a10}function uZ(a10){return a10.now()}function u2(a10,b10){return l.setTimeout(bJ(1,b10),a10)}function u3(a10){l.clearTimeout(a10)}function u4(a10){l.requestAnimationFrame(bJ(1,a10))}l.ClipboardItem,l.FormData,l.Headers,l.Request,l.Response,l.fetch,l.MediaStream,l.MediaRecorder,l.MessageChannel,l.BroadcastChannel,l.Notification,l.WebSocket;function u5(a10){return a10.localStorage}function u6(a10,b10){function c10(a11){return a11}return function(a11){return dA(c10,a11)}(a10.getItem(b10))}function u7(a10,b10,c10){try{a10.setItem(b10,c10);return}catch(f10){var d10=M(f10);if(d10[1]===e2)return;throw g(d10,0)}}function az(a10,b10,c10){return[0,a10,b10,c10]}function i8(a10){var b10=a10[1];return b10===82||83<=b10?ha(dk(a10[2])):1}function dH(a10){return c3(dk(a10))}function u8(a10){return et(c4(function(a11){var b10=a11[1];return b10===82?[0,dH(a11[2]),0]:83<=b10?iK(dH(a11[2])):[0,a11[2],0]},a10))}function i9(a10){if(!a10)return u9;var b10=m6(i8,a10),c10=b10[2];return[0,u8(b10[1]),c10]}var i_=kR,fx="before";function va(a10){return[0,a10]}function vb(a10,b10){return[1,fo,a10,b10]}var vc="remove",vd="contains";function i$(a10){var b10=uR(uD(a10));return b10?bu(a10,vd,[0,b10[1]])|0:0}function ja(e10,b10){var c10=[0,dv(va,vb)];return k(b10,function(a10){var b11=fk(c10[1],a10),d10=b11[2],g10=b11[1];c10[1]=d10,dx(w,function(a11,b12){return a11[0]===0?a11[1][dU]=uf:0},g10,0);var h10=i$(e10),i10=dw(d10);if(i10){var f10=function(d11,b12){if(b12[0]!==0){if(!cB(b12[1]))return b12[1];var l10=f10(d11,b12[3]),k10=f10(l10,b12[2]);return b12[1]=k10,k10}var c11=b12[1];if(delete c11[dU],c11.parentNode!==e10)cB(d11)?bu(e10,i_,[0,c11]):bu(d11,fx,[0,c11]);else{var a11=c11.nextSibling!==d11?1:0;if(a11){if(h10)var g11=i$(c11),i11=g11&&function(a12){for(;;){var b13=c11.nextSibling;if(b13===d11)return 1;if(cB(b13))return 0;bu(c11,fx,[0,b13])}}(0);else var i11=h10;var j10=1-i11}else var j10=a11;j10&&(cB(d11)?bu(e10,i_,[0,c11]):bu(d11,fx,[0,c11]))}return c11};f10(fo,i10[1])}return dx(w,function(a11,b12){if(a11[0]!==0)return 0;var c11=a11[1],d11=iN(c11[dU]),e11=d11&&(delete c11[dU],bu(c11,vc,[0]),0);return e11},g10,0),e10})}var dI=R(0),fy=[0,bt,bt];function u_(a10){if(!a10)return u$;var b10=a10[1],c10=b10[1];if(c10===82){if(!a10[2])return[0,0,[0,k(b10[2],J)]]}else if(83<=c10){if(!a10[2])return[0,0,[0,b10[2]]]}else if(!a10[2])return[0,[0,b10[2],0],0];return m2(i8,a10)?[0,et(c4(function(a11){var b11=a11[1];return b11===82?[0,dH(a11[2]),0]:83<=b11?iK(dH(a11[2])):[0,a11[2],0]},a10)),0]:[0,0,[0,dm(function(a11){var b11=a11[1];return b11===82?k(a11[2],J):83<=b11?a11[2]:R(J(a11[2]))},iL,a10)]]}function jb(c10,b10){function d10(a10){var b11=a10[2],d11=a10[1];return dz(d11,cE)?i4(b11,1,c10):i3(d11,[0,b11],c10)}function e10(a10){var b11=a10[1],d11=a10[2];return dz(b11,cE)?i4(d11,0,c10):i3(b11,0,c10)}function h10(a10){var b11=[0,fy];return function(a11){b11[1]!==fy&&e10(b11[1]);var c11=a11;return d10(c11),b11[1]=c11,0}}return dm(function(a10){var b11=a10[1];if(b11===82){var i10=a10[2];return k(i10,h10(0))}if(83>b11)throw g([0,f,ve],1);var j10=a10[2],c11=[0,dv(function(a11){var b12=a11;return d10(b12),b12},function(a11,b12){return fy})];return k(j10,function(a11){var b12=fk(c11[1],a11),d11=b12[2],f10=b12[1];return c11[1]=d11,dx(w,function(a12,b13){return e10(a12)},f10,0),dw(d11),0})},[0,dI,function(a10,b11){return dI}],b10)}function fz(a10,b10){return iT(b10[1],b10[2],b10[3],a10)}function vf(c10,b10){return dm(function(a10){var b11=a10[1];if(b11===82){var d10=[0,0];return k(a10[2],function(a11){var b12=d10[1];return b12&&iU(b12[1]),d10[1]=[0,fz(c10,a11)],0})}if(83>b11)throw g([0,f,vg],1);var h10=a10[2],e10=[0,dv(function(a11){return fz(c10,a11)},function(a11,b12){return a11})];return k(h10,function(a11){var b12=fk(e10[1],a11),c11=b12[2],d11=b12[1];return e10[1]=c11,dx(w,function(a12,b13){return iU(a12)},d11,0),dw(c11),0})},[0,dI,function(a10,b11){return dI}],b10)}function jc(a10,b10,c10,d10,e10,f10){var q10=b10?b10[1]:0,r10=c10?c10[1]:0,s10=d10?d10[1]:function(a11){},m10=i9(q10),l10=m10[2],t10=m10[1],n10=i9(r10),o10=n10[2],u10=n10[1],p10=u_(f10),i10=p10[2],g10=i2(a10,[0,t10],e10,p10[1]);if(h(s10,g10),l10)if(i10)var v10=ja(g10,i10[1]),j10=bY(jb(g10,l10),v10,function(a11,b11){return b11});else var j10=k(jb(g10,l10),function(a11){return g10});else var j10=i10?ja(g10,i10[1]):R(g10);a8(function(a11){return fz(g10,a11),0},u10);var w10=o10?bY(vf(g10,o10),j10,function(a11,b11){return b11}):j10;return w10}function b6(a10,b10,c10,d10,e10,f10){return jc(b10,c10,d10,e10,a10,f10)}function vh(a10,b10,c10,d10,e10,f10){return jc(b10,c10,d10,e10,a10,0)}function fA(a10,b10,c10,d10,e10){return b6(uJ,a10,b10,c10,d10,e10)}function K(a10,b10,c10,d10,e10){return b6(i5,a10,b10,c10,d10,e10)}function fB(a10,b10,c10,d10,e10){return vh(uL,a10,b10,c10,d10,e10)}function jd(a10,b10,c10,d10,e10){return b6(uM,a10,b10,c10,d10,e10)}function vi(a10,b10,c10,d10,e10){return b6(uK,a10,b10,c10,d10,e10)}function vj(a10,b10,c10,d10,e10){return b6(uN,a10,b10,c10,d10,e10)}function vk(a10,b10,c10,d10,e10){return b6(uO,a10,b10,c10,d10,e10)}function dJ(a10,b10){return b10=c10)return vB;if(b10===kY)return vA;if(b10==="cyan")return vz;if(b10===lm)return vy;if(b10==="magenta")return vx;if(b10===lq)return vw;if(b10==="reset")return vv;if(b10==="white")return vu;if(b10==="yellow")return vt}else{if(b10==="Black")return vK;if(b10==="Blue")return vJ;if(b10==="Cyan")return vI;if(b10==="Green")return vH;if(b10==="Magenta")return vG;if(b10==="Red")return vF;if(b10==="White")return vE;if(b10==="Yellow")return vD;if(b10==="black")return vC}throw g(fD,1)}function jg(a10,b10){return a9(b10,a10),vM}function jh(a10){try{nM(a10),nN(a10)}catch(f10){var b10=M(f10);if(b10!==eB)throw g(b10,0)}return vN}var ji=[q,vO,ag(0)],vL=0;function vP(a10,b10,c10){if(c10[1]===ji)return jg(a10,c10[2]);if(c10[1]!==cs)return h(b10,c10);var e10=c10[2];try{var f10=jg(a10,jf(e10));return f10}catch(f11){var d10=M(f11);if(d10===fD)return h(b10,c10);throw g(d10,0)}}function vQ(a10,b10,c10){if(c10[1]===ji)return jh(a10);if(c10[1]!==cs)return h(b10,c10);var e10=c10[2];try{jf(e10)}catch(f10){var d10=M(f10);if(d10===fD)return h(b10,c10);throw g(d10,0)}return jh(a10)}function vR(a10){var c10=bO(0);ry(a10,1);var b10=rz(a10,0),d10=b10[2],e10=b10[1];return rA(a10,[0,function(a11){return vP(c10,e10,a11)},function(a11){return vQ(c10,d10,a11)},b10[3],b10[4]])}function vS(a10,b10){var d10=bo(64),c10=df(d10),e10=a10&&vL;return e10&&vR(c10),r1(function(a11){return a$(c10,0),co(d10)},c10,b10)}function vT(a10){return vS(1,a10)}function vU(a10,b10){return m8(a10,b10)}function vV(a10){try{var c10=[0,l4(a10)];return c10}catch(f10){var b10=M(f10);if(b10[1]===cc)return 0;throw g(b10,0)}}function vW(a10){return a10|0}function fE(a10,b10){return b10?[0,h(a10,b10[1])]:0}function vX(a10,b10,c10){return c10?h(b10,c10[1]):a10}function vY(a10,b10){if(b10)return h(a10,b10[1])}function vZ(a10,b10){return b10?b10[1]:a10}function v0(a10,b10){return a10?a10[1]:b10}function v1(a10){return a10?[0,a10[1],0]:0}function v2(a10,b10){return b10[0]===0?h(a10,b10[1]):[1,b10[1]]}function v3(a10,b10){return v2(b10,a10)}function v4(a10){var b10=nE(a10);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b10[38],,,,,,,,,,,b10[10]]}function v5(a10){var b10=v4(a10);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b10[40],,,,,,,,,,,,,,,,,,,,b10[51]]}function v6(e10,b10){var d10=n(e10);if(dJ(d10,n(b10)))return 0;var f10=n(b10)-d10|0;return function(a10){for(var c10=a10;;){if(vl(c10,d10))return 1;if(_(b10,f10+c10|0)!==_(e10,c10))return 0;c10=c10+1|0}}(0)}function fF(a10,b10){return v6(a10,b10)?[0,ex(b10,0,n(b10)-n(a10)|0)]:0}var jj=[q,v8,ag(0)];function jk(a10){return[0,[0,a10]]}function bw(a10,b10,c10,d10){return[1,a10,b10,c10,d10]}function v_(a10){return a10[0]===0&&typeof a10[1]=="number"?1:0}function jl(a10,b10){if(b10[0]===0){var c10=b10[1];if(typeof c10=="number")return jk(a10);switch(c10[0]){case 0:return[0,[1,a10,c10[1]]];case 1:return[0,[2,a10,c10[1],c10[2]]];default:return bw(4,[1,a10,c10[1]],v9,[1,c10[2],c10[3]])}}var d10=b10[2],f10=b10[1];if(typeof d10!="number")switch(d10[0]){case 0:break;case 1:return bw(f10+1|0,[2,a10,d10[1],d10[2]],b10[3],b10[4]);default:var e10=b10[3],i10=d10[3],j10=d10[2],k10=d10[1],g10=aN(e10);a:if(aZ===g10)var h10=e10[1];else{if(bg!==g10&&bE!==g10){var h10=e10;break a}var h10=er(e10)}return bw(f10+1|0,[1,a10,k10],[bg,function(a11){return jl([0,j10,i10],h10)}],b10[4])}return bw(f10+1|0,[1,a10,d10[1]],b10[3],b10[4])}function jm(a10){if(a10[0]===0){var b10=a10[1];if(typeof b10=="number")throw g(jj,1);switch(b10[0]){case 0:return[0,v7,b10[1]];case 1:var n10=b10[2];return[0,jk(b10[1]),n10];default:return[0,[0,[1,b10[1],b10[2]]],b10[3]]}}var d10=a10[3],e10=a10[2],h10=a10[1],i10=aN(d10);a:if(aZ===i10)var f10=d10[1];else{if(bg!==i10&&bE!==i10){var f10=d10;break a}var f10=er(d10)}var j10=a10[4];if(typeof j10!="number"&&j10[0]!==0){var c10=a10[4];if(typeof c10!="number"&&c10[0]===2){var q10=c10[3];return[0,bw(h10-1|0,e10,d10,[1,c10[1],c10[2]]),q10]}var p10=c10[2];return[0,bw(h10-1|0,e10,d10,[0,c10[1]]),p10]}var k10=j10[1];if(v_(f10))return[0,[0,e10],k10];var l10=jm(f10),m10=l10[2],o10=[1,m10[1],m10[2]];return[0,bw(h10-1|0,e10,mI(l10[1]),o10),k10]}function wa(a10){if(typeof a10=="number")return 0;switch(a10[0]){case 0:return 1;case 1:return 2;default:return 3}}function v$(a10){try{var c10=[0,jm(a10)];return c10}catch(f10){var b10=M(f10);if(b10===jj)return 0;throw g(b10,0)}}function wb(a10){return a10[0]===0?wa(a10[1]):a10[1]}function wc(a10){return a10.height}function wd(a10){return a10}function wg(a10){switch(a10){case 0:return wh;case 1:return wi;default:return wj}}function we(a10){return a10.contentRect}function wf(a10){a10[f7]}function wk(a10,b10,c10){var d10=b10?[0,c10,{box:v(wg(b10[1]))}]:[0,c10];return eg(a10,"observe",d10),0}function wl(c10){return new l.ResizeObserver(function(a10,b10){return i(c10,iR(function(a11){return a11},a10),b10)})}var wm=kc,wn="pattern",jn=v5([0,ey]);function wo(a10,b10){return h(a10,b10),b10}function wp(a10){var b10=fF(wq,a10);if(b10){var c10=b10[1],d10=vV(c10);if(d10)return[0,[0,d10[1]]];var g10=function(a11){return[0,a11]};return function(a11){return fE(g10,a11)}(fC(c10))}var e10=fF(wr,a10);if(e10){var h10=function(a11){return[1,a11]};return function(a11){return fE(h10,a11)}(fC(e10[1]))}var f10=fF(ws,a10);if(!f10)return 0;function i10(a11){return[1,a11]}return function(a11){return fE(i10,a11)}(fC(f10[1]))}function jo(a10){switch(a10[0]){case 0:var b10=a10[1];return h(A(wt),b10);case 1:var c10=a10[1];return h(A(wu),c10);default:var d10=a10[1];return h(A(wv),d10)}}function jp(a10){var c10=a10?a10[1]:i7(bv);function b10(a11){var b11=wp(aw(uH(0,"font-size",a11)));if(!b11)return 16;var c11=b11[1];return c11[0]===0?c11[1]:a7(ww)}return function(a11){switch(a11[0]){case 0:return a11[1];case 1:var d10=a11[1];return d10*b10(i7(bv));default:var e10=a11[1];return e10*b10(c10)}}}function wx(e10,b10,c10,d10){function f10(a10,b11){return y(e10,b11[1],b11[2],a10)}function g10(a10,b11){return bY(d10,a10,b11)}return function(a10){return g10(a10,f10)}(bY(b10,c10,function(a10,b11){return[0,a10,b11]}))}var wA=[q,wz,ag(0)],wC=[q,wB,ag(0)];function fG(a10){return[0,0]}function fH(a10,b10){if(a10[1])throw g(wC,1);return a10[1]=[0,b10],0}function fI(a10){var b10=a10[1];if(b10)return b10[1];throw g(wA,1)}function wy(a10,b10,c10){return wx(function(a11,b11,c11){return[0,a11,b11,c11]},a10,b10,c10)}function wD(a10){return uu(a10)}function wE(a10){var b10=uv(a10);return b10[0]===0?[0,b10[1]]:(uT([0,b10[1],0]),wF)}var jq=u5(dG);function jr(c10,b10){return function(a10){return u7(jq,c10,a10)}(wD(b10))}function wG(a10){var b10=u6(jq,a10);function c10(a11){return wE(a11)}var d10=b10?[0,b10[1]]:wH;return v3(d10,c10)}function wI(a10,b10){var c10=wG(a10);if(c10[0]===0)return c10[1];var d10=c10[1];return typeof d10=="number"||uV([0,d10[2],0]),h(b10,0)}function wJ(d10,b10){jr(d10,b10);var a10=ae(b10),c10=e6(0,a10);return e7(c10,function(a11){return jr(d10,b0(c10)),0}),b0(c10),a10}function wK(a10,b10){var c10=H(a10);return wJ(c10,wI(c10,b10))}function js(a10,b10){return wK(a10,function(a11){return b10})}var wM=jn[49],wL=jn[29];function wN(a10){return c4(function(a11){return[0,80,aV(H(a11))]},wM(a10))}var wO=0;function bc(d10,b10,c10){var a10=b10[1],e10=a10===82?[0,82,k(b10[2],function(a11){return function(a12){return aU(d10,a12)}(H(a11))})]:83<=a10?a7(wR):[0,80,function(a11){return aU(d10,a11)}(H(b10[2]))];return[0,e10,c10]}function fJ(d10,b10,c10){return b10?[0,[0,80,function(a10){return aU(d10,a10)}(H(b10[1]))],c10]:c10}function jt(a10,b10){var c10=b10[1];return c10===82?[0,82,k(b10[2],a10)]:83<=c10?[0,83,fm(a10,b10[2])]:[0,80,h(a10,b10[2])]}function wT(a10){return a10[0]===0?aV(H(a10[1])):a10[1]}function fK(a10,b10){return[0,jt(wT,a10),b10]}function al(a10){return fK(a10,0)}function cF(a10,b10){return fK(a10,b10)}function wP(a10,b10){var d10=wN(b10[1]),e10=b10[2],c10=function(a11){return bN(e10,a11)}(d10);return a10?[0,[0,80,uz(H(a10[1]))],c10]:c10}function wQ(a10){return[0,wL(a10),wO]}function wS(a10,b10,c10){return b10?[0,[0,80,a10],c10]:c10}function wU(a10){return fK(jt(function(a11){return[0,a11]},a10),0)}function wV(a10,b10){return b10[0]===0?(a10.scroll(0,b10[1]),0):uI(0,b10[1])}function wW(a10,b10,c10,d10,e10){var g10=a10?a10[1]:0,h10=b10?b10[1]:0,f10=ae(1),i10=cF(wX,cF([0,82,k(f10,function(a11){return a11?[1,aV("locked")]:[1,cD]})],g10)),j10=wU(wY),l10=[0,[0,80,az(0,cC,function(a11){return ab(f10,1)})],0],m10=K(0,[0,j10],[0,l10],0,[0,[0,82,fA(0,0,0,0,[0,[0,80,aW(0,wZ)],0])],0]),n10=az(0,ut,function(a11){var b11=bq(f10);return b11&&ab(f10,0)});return K(0,[0,i10],[0,[0,[0,80,n10],h10]],c10,[0,[0,82,k(wy(e10,f10,d10),function(a11){var b11=a11[1],c11=a11[3];return a11[2]&&vY(function(a12){return wV(b11,a12)},c11),b11})],[0,[0,82,m10],0]])}function dK(a10,b10){return typeof b10=="number"?0:b10[0]===0?[0,h(a10,b10[1])]:[1,b10[1]]}function w0(e10,b10,c10){var d10=ae(c10);return[0,az(0,b10,function(a10){return ab(d10,h(e10,dB(a10)[dV]))}),d10]}function ju(a10,b10,c10,d10,e10,f10,g10,h10,i10,j10){var l10=d10?d10[1]:0,m10=f10?f10[1]:0,n10=function(a11){return fJ(wn,h10,a11)}(function(a11){return wS(uA,m10,a11)}([0,[0,80,i1(H(i10))],l10])),o10=v0(b10,function(a11){return[0,a11]}),k10=w0(a10,g10,j10),p10=k10[2],q10=k10[1];return[0,fB(c10,[0,n10],[0,[0,[0,80,q10],v1(e10)]],0,0),p10,o10]}function dL(a10,b10,c10,d10,e10,f10,g10,h10){var i10=c10?c10[1]:0,j10=function(a11){return fJ(fw,h10,a11)}(function(a11){return fJ(uy,g10,a11)}(i10));return ju(ay,a10,b10,[0,j10],d10,e10,ur,f10,w2,vZ(w1,h10))}function dM(a10,b10,c10,d10){var e10=b10?b10[1]:0;return ju(function(a11){return 0},0,a10,[0,bc(fw,d10,e10)],c10,0,fs,0,w3,0)}function aG(a10,b10){return k(a10,function(a11){return[0,a11,b10]})}function dN(a10,b10,c10,d10,e10){var i10=[0,[0,cy,function(a11){return a11}],function(a11,b11){var c11=b11[2],d11=a11[2];return[0,aE(a11[1],b11[1]),function(a12){return h(c11,h(d11,a12))}]}];function j10(a11){var b11=a11[1],c11=a11[2];function d11(a12){var c12=bq(b11[2]);return h(b11[3],c12)}return[0,J(b11[1]),function(a12){var b12=d11(0);return h(h(c11,a12),b12)}]}var f10=function(a11){return br(j10,i10,a11)}(bs(d10[2])),g10=[0,82,k(f10,function(a11){var b11=a11[2];return az(0,wm,function(a12){return h(e10,h(b11,d10[1])),up(a12)})})],l10=k(f10,function(a11){return a11[1]}),m10=vX([0,g10,0],function(a11){return mU(g10,a11)},c10);return vi(a10,b10,[0,m10],0,[0,[0,83,bs(l10)],0])}function jv(a10,b10){return a10?h(A(w4),b10):b10}function w5(a10,b10,c10,d10,e10,f10){var l10=a10?a10[1]:1,m10=b10?b10[1]:0,n10=c10?c10[1]:0,j10=d10?d10[1]:function(a11){},i10=jv(1,e10[1]),o10=jv(0,e10[1]),g10=l10?js(i10,e10[2]):ae(e10[2]);h(j10,bq(g10));var p10=e10[3];jd(0,[0,[0,[0,80,i0(H(i10))],0]],0,0,p10);var q10=[0,80,o10],r10=function(a11){return bc(fv,w6,a11)}(function(a11){return bc(iX,q10,a11)}(bc(fu,[0,80,i10],m10))),s10=[0,[0,80,az(0,fs,function(a11){var b11=ay(dB(a11)[dV]);return h(j10,b11),ab(g10,b11)})],n10];return[0,vk(0,[0,r10],[0,s10],0,[0,[0,83,bs(fm(function(a11){var b11=a11[1],c11=a11[2],d11=al([0,80,[1,uC(H(b11))]]),e11=cF([0,82,k(g10,function(a12){return[1,uw(vp(a12,b11),uB)]})],d11);return vj(0,[0,e11],0,0,[0,[0,80,aW(0,c11)],0])},f10))],0]),,g10]}function w7(a10,b10,c10,d10,e10,f10,g10){var m10=b10?b10[1]:0,n10=c10?c10[1]:function(a11){},j10=h(vT(w8),d10);function l10(a11){return a11?[0,e10]:0}a:{if(a10&&a10[1]){var o10=js(j10,l10(g10)),i10=o10;break a}var i10=ae(l10(g10))}var p10=jd(0,[0,[0,[0,80,i0(H(j10))],0]],0,0,f10),q10=[0,80,d10],r10=function(a11){return bc(fv,w9,a11)}(function(a11){return bc(iX,q10,a11)}(bc(fu,[0,80,j10],0))),s10=[0,[0,82,k(i10,function(a11){return a11?iZ:cD})],r10];return[0,K(0,0,0,0,[0,[0,82,fB(0,[0,s10],[0,[0,[0,80,az(0,fs,function(a11){var b11=l10(dB(a11)[dT]|0);return h(n10,b11),ab(i10,b11)})],m10]],0,0)],[0,[0,82,p10],0]]),i10]}function w_(a10){var d10=eA(a10);return[0,,function(a11){return wb(a11[1])},function(a11){},,function(a11,b10,c10){var e10=d10[2].call(null,b10,c10,a11[2]);return[0,jl(b10,a11[1]),e10]},function(a11){var c10=v$(a11[1]);if(!c10)return[0,a11,0];var e10=c10[1],b10=e10[2],f10=e10[1],g10=[0,[0,b10,d10[17].call(null,b10,a11[2])]];return[0,[0,f10,d10[6].call(null,b10,a11[2])],g10]},function(a11,b10){return d10[18].call(null,b10,a11[2])}]}function w$(a10){var b10=w_(a10);return[0,function(a11){b10[3].call(null,0),b10[3].call(null,0)}]}function xb(a10){return br(function(a11){return J(K(0,0,0,0,a11[3]))},aT,a10)}function xc(a10){return e8(br(function(a11){return a11[2]},[0,xg,function(a11,b10){return i(A(xf),a11,b10)}],a10),function(a11){return i(A(xe),xd,a11)})}jp(0)(xk);function xa(a10,b10,c10){return[0,a10,b10,c10]}function xh(a10){return xc(a10[1][1])}function xi(a10){var b10=jo(a10[2]),c10=[0,[0,80,aV(k0)],0],d10=[0,[0,80,aV("lwdui-lazy-table-header")],c10],e10=[0,[0,80,dC(H(h(A(xj),b10)))],d10];return K(0,[0,e10],0,0,[0,[0,83,bs(xb(a10[1][1]))],0])}var xl=w$([0,vU]),dO=Cb(0);function xm(e10,b10,c10,d10){var s10=d10[3],t10=d10[2],l10=fG(0),m10=fG(0),n10=jo(e10[2]),v10=h(A(xo),n10),w10=cx(function(a11,b11){return J([0,e$(a11),a11,s10])},aT,t10);hL(0,2048),function(a11){return xl[1].call(null,50)}(0);var f10=ae(0),a10=R(function(a11){return a11}),g10=e6(0,sa(a10,f10));e7(g10,function(a11){var b11=b0(g10);return b11[2]?h(b11[1],0):0}),b0(g10);function u10(a11){return i(A(xn),n10,a11)}function j10(a11){var b11=[0,aV("row_spacer"),0];return i6(0,[0,[0,dC(H(u10(a11))),b11]],0)}var x10=k(br(function(a11){var b11=a11[1],c11=a11[3],d11=a11[2],e11=bc(cE,xp,0),f11=[0,80,dC(H(v10))];return b11?[0,0,J(K(0,[0,[0,f11,e11]],0,0,[0,[0,83,bs(i(c11,d11,b11[1]))],0])),0]:[0,1,cy,0]},[0,[0,0,cy,0],function(a11,b11){var f11=b11[3],g11=b11[2],c11=b11[1],d11=a11[3],e11=a11[2],h10=a11[1],k10=iy(e11),i10=iy(g11);if(typeof k10=="number")return typeof i10=="number"?[0,((h10+d11|0)+c11|0)+f11|0,e11,0]:[0,(h10+d11|0)+c11|0,g11,f11];if(typeof i10=="number")return[0,h10,e11,(d11+c11|0)+f11|0];var l11=dJ(d11+c11|0,0)?function(a12){return aE(e11,a12)}(aE(J(R(j10(d11+c11|0))),g11)):aE(e11,g11);return[0,h10,l11,f11]}],w10),function(a11){var b11=a11[3],c11=a11[2],d11=a11[1],e11=dJ(d11,0)?aE(J(R(j10(d11))),c11):c11;return dJ(b11,0)?aE(e11,J(R(j10(b11)))):e11}),y10=xi(e10),z10=wl(function(a11,b11){var d11=mV(a11);wf(d11);var c11=wc(we(d11)),e11=bq(f10);return e11?vm(e11[1],c11)?ab(f10,[0,c11]):0:ab(f10,[0,c11])}),B10=al(xq),o10=K(0,[0,B10],0,[0,function(a11){return fH(l10,a11)}],[0,[0,83,bs(x10)],0]),p10=al(xr),q10=[0,[0,82,k(a10,function(c11){return az(0,us,function(a11){var d11=[0,0],b11=[0,-1];function e11(e12){var a12=800,f11=uZ(u0);vn(b11[1],0)&&u3(b11[1]),b11[1]=u2(a12,function(a13){return h(c11,e12)});var g11=vo(f11-d11[1],a12);return g11&&(d11[1]=f11,h(c11,e12))}return fI(m10),function(a12){return e11(a12)}(0),0})})],0];function r10(a11){return fH(m10,a11)}var C2=c10?wW([0,p10],[0,q10],[0,r10],k(c10[1],function(a11){var b11=fI(l10),c11=e10[2];return[0,[0,cZ(a11,vW(jp([0,b11])(c11)))]]}),o10):K(0,[0,p10],[0,q10],[0,r10],[0,[0,82,o10],0]);function D2(a11){return wk(z10,0,a11)}function E2(a11){return wo(D2,a11)}var F2=function(a11){return k(a11,E2)}(C2),G2=wP(0,wQ(xs));return K(0,[0,[0,[0,82,k(xh(e10),function(a11){return dC(H(a11))})],G2]],0,0,[0,[0,82,y10],[0,[0,82,F2],0]])}var fL=eA([0,ey]),fM=dO.Text,fN=dO[lh],fO=dO.Map,b7=id2(xx,xw),bd=id2(xz,xy);function xt(a10,b10){return[0,a10,b10]}function jw(a10){return b4(a10,fN)?[0,a0,a10]:b4(a10,fO)?[0,w,a10]:b4(a10,fM)?[0,bD,a10]:[0,U,a10]}function xA(a10){var b10=fp(a10,xB);if(b10)return[0,b10[1]];var c10=fp(a10,xC);if(c10)return[1,iP(jw,c10[1])];var d10=fp(a10,xD);if(d10)return[2,d10[1]];throw g([0,f,xE],1)}ig(xF,b7,[0,function(a10){return new fN},function(a10,b10,c10){return a10.insert(b10,iQ(function(a11){var b11=a11[1];return bD<=b11?(a0<=b11,a11[2]):(w<=b11,a11[2])},c10)),0},function(a10,b10,c10){return a10.delete(b10,c10),0},function(a10,b10){return a10.push(iQ(function(a11){var b11=a11[1];return bD<=b11?(a0<=b11,a11[2]):(w<=b11,a11[2])},b10)),0},function(a10,d10){return a10.forEach(function(a11,b10,c10){return y(d10,b10,jw(a11),c10)}),0},function(a10,b10){function c10(a11){return h(b10,xt(xA,a11))}return a10.observe(c10),c10}]);function fP(a10){return b4(a10,fN)?[0,a0,a10]:b4(a10,fO)?[0,w,a10]:b4(a10,fM)?[0,bD,a10]:[0,U,a10]}function jx(a10,b10){return function(a11){return dA(fP,a11)}(a10.get(v(b10)))}function xG(a10){return a10}function xH(a10){return a10[f7]}function xI(a10){var b10=ay(a10.action);if(b10!=="add")if(b10!==la){if(b10!=="update")throw g([0,cb,h(A(xJ),b10)],1);var c10=1}else var c10=2;else var c10=0;var d10=a10.oldValue,e10=b3(d10)?0:[0,fP(d10)];return[0,c10,0,e10]}function jy(a10){return ul(a10.entries())}ig(xK,bd,[0,function(a10){return new fO},[0,function(d10){var a10=d10[kh].keys.entries();return iS(ay,xI,function(a11,b10,c10){var e10=jx(xH(d10),a11);return fL[2].call(null,a11,[0,b10[1],e10,b10[3]],c10)},a10,fL[1])}],jx,function(a10,b10,c10){var d10=c10[1],e10=bD<=d10?(a0<=d10,c10[2]):(w<=d10,c10[2]);return a10.set(v(b10),e10),0},function(a10,b10){return a10.delete(v(b10)),0},jy,function(a10,d10,c10){return iS(ay,fP,function(a11,b10,c11){return y(d10,a11,b10,c11)},jy(a10),c10)},function(a10,b10){function c10(a11){return h(b10,a11)}return a10.observe(c10),c10}]);var xL=dO.Doc;function jz(a10,b10){return a10.getArray(v(b10))}function bx(a10,b10){return a10.transact(bJ(1,b10)),0}function fQ(a10){return a10}var am=bd[4],aX=bd[3],cG=bd[1],dP=b7[5],fR=b7[4],jA=b7[3],jB=b7[1];function xu(a10){var b10=a10[1];return[0,function(a11){return iP(b10,a11)}(a10[2][kh].delta)]}function xv(a10,b10){var c10=a10?[0,v(a10[1])]:[0];return l6(fM,c10)}function xM(a10){return new xL}var xN=bd[8],xO=bd[7],xP=bd[5],xQ=bd[2][1],xR=b7[6];function xS(a10){return a10}var xT=B7(0).Awareness;function xV(a10,b10,c10){a10.setLocalStateField(v(b10),c10)}function jC(a10){return a10}function xU(a10){return new xT(a10)}function xW(a10,b10,c10,d10){if(c10)var f10=[0,xX,v(c10[1])],e10=[0,[0,xY,v(b10)],f10];else var e10=[0,[0,x0,v(b10)]];return xV(a10,xZ,gU(e10))}var x1=B8(0);function x2(a10,b10){var c10=b10;new x1(v(a10),c10)}var x3=B$(0);function fS(a10,b10,c10){switch(b10){case 0:a10.on(v(x_),bJ(1,function(a11){return h(c10,[0,a11.connected|0])}));return;case 1:a10.on(v(x$),bJ(1,function(a11){return h(c10,[0,a11[lo]|0])}));return;default:a10.on(v(ye),bJ(1,function(b11){function a11(a12){return function(a13){return iR(ay,a13)}(b11[a12])}var d10=a11(ya),e10=a11(yb),f10=a11(yc);return h(c10,[0,a11(yd),f10,e10,d10])}));return}}function x4(a10,b10,c10,d10){var f10=cj(function(a11){return[0,x5,fr(v,a11)]},b10),e10=[0,[0,x8,{config:{iceServers:fr(function(a11){return a11},c4(function(a11){return{urls:v(h(A(x7),a11))}},x6))}}]];aF([0,e10,0]);function g10(a11){return a11}var i10=gU(c7(function(a11){return hc(g10,a11)}([0,f10,[0,e10,[0,cj(function(a11){return[0,x9,a11]},c10),0]]]))),j10=d10;return new x3(v(a10),j10,i10)}var jD=B9(0),yf=B_(0);function yh(a10){switch(a10){case 0:var b10=yi;break;case 1:var b10=yj;break;case 2:var b10=yk;break;case 3:var b10=yl;break;default:var b10=ym}return v(b10)}function yg(a10,b10){jD.register(v(a10),b10)}function yn(a10,b10,c10,d10){var e10=a10?a10[1]:0,f10=e10?yo:yr,g10=cj(function(a11){return[0,yp,!!a11]},b10),h10=gU(c7(hc(function(a11){return a11},[0,g10,[0,cj(function(a11){return[0,yq,fr(yh,a11[1])]},c10),0]])));return{theme:v(f10),modules:h10}}function ys(a10,b10){return new jD(a10,b10)}function yt(a10){return a10}var yu=Ca(0).QuillBinding;function yv(a10,b10,c10){var d10=mK(cj(jC,a10)),e10=[0,c10,d10];function f10(a11,b11){l6(a11,b11)}return function(a11){return f10(yu,a11)}(c7([0,b10,e10]))}function yw(a10,b10,c10){return y(eN(s,yx),b10,c10,a10)}function jE(a10,b10,c10){var d10=0<=c10?1:0;if(d10)var e10=0<=b10?1:0,f10=e10&&((b10+c10|0)<=a10?1:0);else var f10=d10;var g10=1-f10;return g10&&yw(a10,b10,c10)}var yy=[0];function yz(a10,b10,c10,d10){var e10=ap(a10,b10);return cm(c10,0,e10,0,d10),e10}function jF(a10,b10){return b10<=a10?a10:b10}function jG(a10){return eN(s,a10)}function yA(a10,b10){var c10=a10[1];return i(jG(yB),b10,c10)}function yC(a10,b10){return i(jG(yD),a10,b10.length-1)}function cH(a10,b10){var c10=1-(a10<=b10.length-1?1:0);return c10&&yC(a10,b10)}function jH(a10){return[0,0,0,yy]}function cI(a10){return a10[1]}function yE(a10,b10){return a10[3][1+b10]}function jI(a10){var b10=a10[1],c10=a10[3];if(cH(b10,c10),0>>4|0));var f11=b11+1|0;function i11(a11,b12,c12){at(a11,b12,c12)}return function(a11){return i11(d11,f11,a11)}(h10(g10,c11&15))}for(;!(4<=d10[1]);){var n10=D(b10,d10[1]);f10(e10,c10[1],n10),c10[1]=c10[1]+2|0,d10[1]++}for(c10[1]++;!(6<=d10[1]);){var m10=D(b10,d10[1]);f10(e10,c10[1],m10),c10[1]=c10[1]+2|0,d10[1]++}for(c10[1]++;!(8<=d10[1]);){var l10=D(b10,d10[1]);f10(e10,c10[1],l10),c10[1]=c10[1]+2|0,d10[1]++}for(c10[1]++;!(10<=d10[1]);){var k10=D(b10,d10[1]);f10(e10,c10[1],k10),c10[1]=c10[1]+2|0,d10[1]++}for(c10[1]++;;){if(16<=d10[1])return $(e10);var j10=D(b10,d10[1]);f10(e10,c10[1],j10),c10[1]=c10[1]+2|0,d10[1]++}}var yR=hG(0),an=xM(0),fU=xU(an);yg(yT,yf),xW(fU,yU,0,0);var dQ=x4(yW,yV,[0,fU],an);x2(yX,an),dG.yjsdoc=an,dG.yjsprovider=dQ;var fV=ae(0),jL=ae(0),jM=ae(0);fS(dQ,0,function(a10){var b10=a10[1];return b5([0,yY,[0,!!b10,0]]),ab(jL,b10)}),fS(dQ,1,function(a10){var b10=a10[1];return b5([0,yZ,[0,!!b10,0]]),ab(jM,b10)});var dR=[0,0];fS(dQ,2,function(a10){b5([0,y0,[0,a10,0]]);function c10(b11){return m3(function(a11){return ez(b11,a11)},a10[3])}function d10(b11){var c11=[0,0];return dR[1]=hb(function(a11){return ez(b11,a11)?(c11[1]=[0,b11],1):0},dR[1]),c11[1]}var b10=eu(function(a11,b11){return d10(b11)?a11:(c10(b11)&&(dR[1]=[0,b11,dR[1]]),a11+1|0)},0,a10[1]),e10=es(a10[2]);return function(a11){return ab(fV,a11)}((bq(fV)+b10|0)-e10|0)});var y4=jM,y6=cF(y5,al([0,82,bY(jL,y4,function(a10,b10){var c10=a10?b10?y1:y2:y3;return[0,c10]})])),y8=K(0,[0,y6],0,0,[0,[0,80,aW(0,y7)],0]),y9=[0,[0,82,y8],[0,[0,82,k(fV,function(a10){return aW(0,ms(a10))})],0]];function yS(a10){return yO(yR,0)}function za(a10,b10){var c10=a10?a10[1]:64,d10=ip(0);return[0,d10,hL(0,c10)]}function jN(a10,b10,c10){var e10=hM(a10[2],b10);if(e10)var d10=e10[1];else{var g10=e_(0,a10[1]);hN(a10[2],b10,g10);var d10=g10}var f10=e$(d10);return f10?ab(f10[1][2],[0,c10]):s2(d10,[0,b10,ae([0,c10])])}function fW(a10,b10){var c10=hM(a10[2],b10);if(c10)var d10=c10[1];else{var f10=a10[1],e10=e_([0,[0,b10,ae(0)]],f10);hN(a10[2],b10,e10);var d10=e10}return c3(e$(d10))[2]}function fX(a10,b10){return k(fW(a10,b10),function(a11){if(!a11)return 0;var b11=a11[1];if(typeof b11!="number"&&U===b11[1])return[0,ay(b11[2])];throw g([0,f,zb],1)})}function zc(a10){var b10=ip(0);return[0,b10,jH(0)]}function zd(a10){try{var c10=[0,jK(a10[2],0)];return c10}catch(f10){var b10=M(f10);if(b10[1]===cb)return 0;throw g(b10,0)}}function jO(a10,b10){var c10=e_(a10,b10[1]);return yH(b10[2],c10)}function jP(a10,b10,c10,d10){var e10=[0,b10,[0,c10,[0,cI(d10),0]]];b5([0,ze,[0,cI(a10),e10]]);var f10=cI(d10),g10=jK(a10,0);return fT(d10,hj(c10,function(a11){return g10})),yL(a10,b10,d10,f10,c10)}function zf(i10,b10,c10){var e10=[0,0],j10=i10[2],d10=jH(0);hk(function(a11){switch(a11[0]){case 0:var m10=a11[1];return jP(j10,e10[1],m10,d10),e10[1]=e10[1]+m10|0,0;case 1:var c11=a11[1];if(cI(d10)!==0){var o10=[0,jI(d10)];return fT(d10,hl(function(a12){var d11=h(b10,a12),c12=sY([0,d11],o10[1]);return o10[1]=c12,c12},c11))}var n10=zd(i10);if(!n10)return hk(function(a12){var c12=h(b10,a12);return jO([0,c12],[0,i10[1],d10])},c11);var s10=n10[1];return fT(d10,hl(function(a12){return sW([0,h(b10,a12)],s10)},c11));default:var k11=a11[1],t10=e10[1]===0?tE(i10[1]):iw(jI(d10)),p10=[0,t10],u10=1;if(k11>=1)for(var l10=u10;;){var q10=p10[1];if(!q10)throw g([0,f,zg],1);var r10=q10[1];p10[1]=iw(r10),s5(r10);var v10=l10+1|0;if(k11===l10)break;l10=v10}return e10[1]=e10[1]+k11|0,0}},c10);var k10=e10[1],a10=cI(j10)-k10|0;return 0 .ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked] > .ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:none;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor > *{cursor:text}.ql-editor p,.ql-editor ol,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{margin:0;padding:0}@supports (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li > .ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked] > .ql-ui,.ql-editor li[data-list=unchecked] > .ql-ui{color:#777}.ql-editor li[data-list=bullet] > .ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked] > .ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked] > .ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered] > .ql-ui:before{content:counter(list-0, decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1 > .ql-ui:before{content:counter(list-1, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2 > .ql-ui:before{content:counter(list-2, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3 > .ql-ui:before{content:counter(list-3, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4 > .ql-ui:before{content:counter(list-4, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5 > .ql-ui:before{content:counter(list-5, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6 > .ql-ui:before{content:counter(list-6, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7 > .ql-ui:before{content:counter(list-7, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8 > .ql-ui:before{content:counter(list-8, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9 > .ql-ui:before{content:counter(list-9, decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl > .ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:none}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,0.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}\n\n/*# sourceMappingURL=quill.core.css.map*/", "/*!\n * Quill Editor v2.0.2\n * https://quilljs.com\n * Copyright (c) 2017-2024, Slab\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */\n.ql-container{box-sizing:border-box;font-family:Helvetica,Arial,sans-serif;font-size:13px;height:100%;margin:0;position:relative}.ql-container.ql-disabled .ql-tooltip{visibility:hidden}.ql-container:not(.ql-disabled) li[data-list=checked] > .ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked] > .ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:none;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor > *{cursor:text}.ql-editor p,.ql-editor ol,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{margin:0;padding:0}@supports (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li > .ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked] > .ql-ui,.ql-editor li[data-list=unchecked] > .ql-ui{color:#777}.ql-editor li[data-list=bullet] > .ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked] > .ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked] > .ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered] > .ql-ui:before{content:counter(list-0, decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1 > .ql-ui:before{content:counter(list-1, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2 > .ql-ui:before{content:counter(list-2, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3 > .ql-ui:before{content:counter(list-3, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4 > .ql-ui:before{content:counter(list-4, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5 > .ql-ui:before{content:counter(list-5, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6 > .ql-ui:before{content:counter(list-6, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7 > .ql-ui:before{content:counter(list-7, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8 > .ql-ui:before{content:counter(list-8, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9 > .ql-ui:before{content:counter(list-9, decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl > .ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:none}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,0.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}.ql-bubble.ql-toolbar:after,.ql-bubble .ql-toolbar:after{clear:both;content:'';display:table}.ql-bubble.ql-toolbar button,.ql-bubble .ql-toolbar button{background:none;border:none;cursor:pointer;display:inline-block;float:left;height:24px;padding:3px 5px;width:28px}.ql-bubble.ql-toolbar button svg,.ql-bubble .ql-toolbar button svg{float:left;height:100%}.ql-bubble.ql-toolbar button:active:hover,.ql-bubble .ql-toolbar button:active:hover{outline:none}.ql-bubble.ql-toolbar input.ql-image[type=file],.ql-bubble .ql-toolbar input.ql-image[type=file]{display:none}.ql-bubble.ql-toolbar button:hover,.ql-bubble .ql-toolbar button:hover,.ql-bubble.ql-toolbar button:focus,.ql-bubble .ql-toolbar button:focus,.ql-bubble.ql-toolbar button.ql-active,.ql-bubble .ql-toolbar button.ql-active,.ql-bubble.ql-toolbar .ql-picker-label:hover,.ql-bubble .ql-toolbar .ql-picker-label:hover,.ql-bubble.ql-toolbar .ql-picker-label.ql-active,.ql-bubble .ql-toolbar .ql-picker-label.ql-active,.ql-bubble.ql-toolbar .ql-picker-item:hover,.ql-bubble .ql-toolbar .ql-picker-item:hover,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected{color:#fff}.ql-bubble.ql-toolbar button:hover .ql-fill,.ql-bubble .ql-toolbar button:hover .ql-fill,.ql-bubble.ql-toolbar button:focus .ql-fill,.ql-bubble .ql-toolbar button:focus .ql-fill,.ql-bubble.ql-toolbar button.ql-active .ql-fill,.ql-bubble .ql-toolbar button.ql-active .ql-fill,.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-fill,.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-fill,.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-fill,.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-fill,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-bubble.ql-toolbar button:hover .ql-stroke.ql-fill,.ql-bubble .ql-toolbar button:hover .ql-stroke.ql-fill,.ql-bubble.ql-toolbar button:focus .ql-stroke.ql-fill,.ql-bubble .ql-toolbar button:focus .ql-stroke.ql-fill,.ql-bubble.ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-bubble .ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill{fill:#fff}.ql-bubble.ql-toolbar button:hover .ql-stroke,.ql-bubble .ql-toolbar button:hover .ql-stroke,.ql-bubble.ql-toolbar button:focus .ql-stroke,.ql-bubble .ql-toolbar button:focus .ql-stroke,.ql-bubble.ql-toolbar button.ql-active .ql-stroke,.ql-bubble .ql-toolbar button.ql-active .ql-stroke,.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-bubble.ql-toolbar button:hover .ql-stroke-miter,.ql-bubble .ql-toolbar button:hover .ql-stroke-miter,.ql-bubble.ql-toolbar button:focus .ql-stroke-miter,.ql-bubble .ql-toolbar button:focus .ql-stroke-miter,.ql-bubble.ql-toolbar button.ql-active .ql-stroke-miter,.ql-bubble .ql-toolbar button.ql-active .ql-stroke-miter,.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter{stroke:#fff}@media (pointer:coarse){.ql-bubble.ql-toolbar button:hover:not(.ql-active),.ql-bubble .ql-toolbar button:hover:not(.ql-active){color:#ccc}.ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,.ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill{fill:#ccc}.ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,.ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter{stroke:#ccc}}.ql-bubble{box-sizing:border-box}.ql-bubble *{box-sizing:border-box}.ql-bubble .ql-hidden{display:none}.ql-bubble .ql-out-bottom,.ql-bubble .ql-out-top{visibility:hidden}.ql-bubble .ql-tooltip{position:absolute;transform:translateY(10px)}.ql-bubble .ql-tooltip a{cursor:pointer;text-decoration:none}.ql-bubble .ql-tooltip.ql-flip{transform:translateY(-10px)}.ql-bubble .ql-formats{display:inline-block;vertical-align:middle}.ql-bubble .ql-formats:after{clear:both;content:'';display:table}.ql-bubble .ql-stroke{fill:none;stroke:#ccc;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.ql-bubble .ql-stroke-miter{fill:none;stroke:#ccc;stroke-miterlimit:10;stroke-width:2}.ql-bubble .ql-fill,.ql-bubble .ql-stroke.ql-fill{fill:#ccc}.ql-bubble .ql-empty{fill:none}.ql-bubble .ql-even{fill-rule:evenodd}.ql-bubble .ql-thin,.ql-bubble .ql-stroke.ql-thin{stroke-width:1}.ql-bubble .ql-transparent{opacity:.4}.ql-bubble .ql-direction svg:last-child{display:none}.ql-bubble .ql-direction.ql-active svg:last-child{display:inline}.ql-bubble .ql-direction.ql-active svg:first-child{display:none}.ql-bubble .ql-editor h1{font-size:2em}.ql-bubble .ql-editor h2{font-size:1.5em}.ql-bubble .ql-editor h3{font-size:1.17em}.ql-bubble .ql-editor h4{font-size:1em}.ql-bubble .ql-editor h5{font-size:.83em}.ql-bubble .ql-editor h6{font-size:.67em}.ql-bubble .ql-editor a{text-decoration:underline}.ql-bubble .ql-editor blockquote{border-left:4px solid #ccc;margin-bottom:5px;margin-top:5px;padding-left:16px}.ql-bubble .ql-editor code,.ql-bubble .ql-editor .ql-code-block-container{background-color:#f0f0f0;border-radius:3px}.ql-bubble .ql-editor .ql-code-block-container{margin-bottom:5px;margin-top:5px;padding:5px 10px}.ql-bubble .ql-editor code{font-size:85%;padding:2px 4px}.ql-bubble .ql-editor .ql-code-block-container{background-color:#23241f;color:#f8f8f2;overflow:visible}.ql-bubble .ql-editor img{max-width:100%}.ql-bubble .ql-picker{color:#ccc;display:inline-block;float:left;font-size:14px;font-weight:500;height:24px;position:relative;vertical-align:middle}.ql-bubble .ql-picker-label{cursor:pointer;display:inline-block;height:100%;padding-left:8px;padding-right:2px;position:relative;width:100%}.ql-bubble .ql-picker-label::before{display:inline-block;line-height:22px}.ql-bubble .ql-picker-options{background-color:#444;display:none;min-width:100%;padding:4px 8px;position:absolute;white-space:nowrap}.ql-bubble .ql-picker-options .ql-picker-item{cursor:pointer;display:block;padding-bottom:5px;padding-top:5px}.ql-bubble .ql-picker.ql-expanded .ql-picker-label{color:#777;z-index:2}.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-fill{fill:#777}.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-stroke{stroke:#777}.ql-bubble .ql-picker.ql-expanded .ql-picker-options{display:block;margin-top:-1px;top:100%;z-index:1}.ql-bubble .ql-color-picker,.ql-bubble .ql-icon-picker{width:28px}.ql-bubble .ql-color-picker .ql-picker-label,.ql-bubble .ql-icon-picker .ql-picker-label{padding:2px 4px}.ql-bubble .ql-color-picker .ql-picker-label svg,.ql-bubble .ql-icon-picker .ql-picker-label svg{right:4px}.ql-bubble .ql-icon-picker .ql-picker-options{padding:4px 0}.ql-bubble .ql-icon-picker .ql-picker-item{height:24px;width:24px;padding:2px 4px}.ql-bubble .ql-color-picker .ql-picker-options{padding:3px 5px;width:152px}.ql-bubble .ql-color-picker .ql-picker-item{border:1px solid transparent;float:left;height:16px;margin:2px;padding:0;width:16px}.ql-bubble .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg{position:absolute;margin-top:-9px;right:0;top:50%;width:18px}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before{content:attr(data-label)}.ql-bubble .ql-picker.ql-header{width:98px}.ql-bubble .ql-picker.ql-header .ql-picker-label::before,.ql-bubble .ql-picker.ql-header .ql-picker-item::before{content:'Normal'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"1\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{content:'Heading 1'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"2\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{content:'Heading 2'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"3\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{content:'Heading 3'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"4\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{content:'Heading 4'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"5\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{content:'Heading 5'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"6\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{content:'Heading 6'}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{font-size:2em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{font-size:1.5em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{font-size:1.17em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{font-size:1em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{font-size:.83em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{font-size:.67em}.ql-bubble .ql-picker.ql-font{width:108px}.ql-bubble .ql-picker.ql-font .ql-picker-label::before,.ql-bubble .ql-picker.ql-font .ql-picker-item::before{content:'Sans Serif'}.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=serif]::before,.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{content:'Serif'}.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before,.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{content:'Monospace'}.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{font-family:Georgia,Times New Roman,serif}.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{font-family:Monaco,Courier New,monospace}.ql-bubble .ql-picker.ql-size{width:98px}.ql-bubble .ql-picker.ql-size .ql-picker-label::before,.ql-bubble .ql-picker.ql-size .ql-picker-item::before{content:'Normal'}.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=small]::before,.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before{content:'Small'}.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=large]::before,.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before{content:'Large'}.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=huge]::before,.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{content:'Huge'}.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before{font-size:10px}.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before{font-size:18px}.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{font-size:32px}.ql-bubble .ql-color-picker.ql-background .ql-picker-item{background-color:#fff}.ql-bubble .ql-color-picker.ql-color .ql-picker-item{background-color:#000}.ql-code-block-container{position:relative}.ql-code-block-container .ql-ui{right:5px;top:5px}.ql-bubble .ql-toolbar .ql-formats{margin:8px 12px 8px 0}.ql-bubble .ql-toolbar .ql-formats:first-child{margin-left:12px}.ql-bubble .ql-color-picker svg{margin:1px}.ql-bubble .ql-color-picker .ql-picker-item.ql-selected,.ql-bubble .ql-color-picker .ql-picker-item:hover{border-color:#fff}.ql-bubble .ql-tooltip{background-color:#444;border-radius:25px;color:#fff}.ql-bubble .ql-tooltip-arrow{border-left:6px solid transparent;border-right:6px solid transparent;content:\" \";display:block;left:50%;margin-left:-6px;position:absolute}.ql-bubble .ql-tooltip:not(.ql-flip) .ql-tooltip-arrow{border-bottom:6px solid #444;top:-6px}.ql-bubble .ql-tooltip.ql-flip .ql-tooltip-arrow{border-top:6px solid #444;bottom:-6px}.ql-bubble .ql-tooltip.ql-editing .ql-tooltip-editor{display:block}.ql-bubble .ql-tooltip.ql-editing .ql-formats{visibility:hidden}.ql-bubble .ql-tooltip-editor{display:none}.ql-bubble .ql-tooltip-editor input[type=text]{background:transparent;border:none;color:#fff;font-size:13px;height:100%;outline:none;padding:10px 20px;position:absolute;width:100%}.ql-bubble .ql-tooltip-editor a{top:10px;position:absolute;right:20px}.ql-bubble .ql-tooltip-editor a:before{color:#ccc;content:\"\\00D7\";font-size:16px;font-weight:bold}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close){position:relative;white-space:nowrap}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close)::before{background-color:#444;border-radius:15px;top:-5px;font-size:12px;color:#fff;content:attr(href);font-weight:normal;overflow:hidden;padding:5px 15px;text-decoration:none;z-index:1}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close)::after{border-top:6px solid #444;border-left:6px solid transparent;border-right:6px solid transparent;top:0;content:\" \";height:0;width:0}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close)::before,.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close)::after{left:0;margin-left:50%;position:absolute;transform:translate(-50%,-100%);transition:visibility 0s ease 200ms;visibility:hidden}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close):hover::before,.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close):hover::after{visibility:visible}\n\n/*# sourceMappingURL=quill.bubble.css.map*/", "/*!\n * Quill Editor v2.0.2\n * https://quilljs.com\n * Copyright (c) 2017-2024, Slab\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */\n.ql-container{box-sizing:border-box;font-family:Helvetica,Arial,sans-serif;font-size:13px;height:100%;margin:0;position:relative}.ql-container.ql-disabled .ql-tooltip{visibility:hidden}.ql-container:not(.ql-disabled) li[data-list=checked] > .ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked] > .ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:none;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor > *{cursor:text}.ql-editor p,.ql-editor ol,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{margin:0;padding:0}@supports (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li > .ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked] > .ql-ui,.ql-editor li[data-list=unchecked] > .ql-ui{color:#777}.ql-editor li[data-list=bullet] > .ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked] > .ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked] > .ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered] > .ql-ui:before{content:counter(list-0, decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1 > .ql-ui:before{content:counter(list-1, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2 > .ql-ui:before{content:counter(list-2, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3 > .ql-ui:before{content:counter(list-3, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4 > .ql-ui:before{content:counter(list-4, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5 > .ql-ui:before{content:counter(list-5, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6 > .ql-ui:before{content:counter(list-6, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7 > .ql-ui:before{content:counter(list-7, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8 > .ql-ui:before{content:counter(list-8, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9 > .ql-ui:before{content:counter(list-9, decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl > .ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:none}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,0.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}.ql-snow.ql-toolbar:after,.ql-snow .ql-toolbar:after{clear:both;content:'';display:table}.ql-snow.ql-toolbar button,.ql-snow .ql-toolbar button{background:none;border:none;cursor:pointer;display:inline-block;float:left;height:24px;padding:3px 5px;width:28px}.ql-snow.ql-toolbar button svg,.ql-snow .ql-toolbar button svg{float:left;height:100%}.ql-snow.ql-toolbar button:active:hover,.ql-snow .ql-toolbar button:active:hover{outline:none}.ql-snow.ql-toolbar input.ql-image[type=file],.ql-snow .ql-toolbar input.ql-image[type=file]{display:none}.ql-snow.ql-toolbar button:hover,.ql-snow .ql-toolbar button:hover,.ql-snow.ql-toolbar button:focus,.ql-snow .ql-toolbar button:focus,.ql-snow.ql-toolbar button.ql-active,.ql-snow .ql-toolbar button.ql-active,.ql-snow.ql-toolbar .ql-picker-label:hover,.ql-snow .ql-toolbar .ql-picker-label:hover,.ql-snow.ql-toolbar .ql-picker-label.ql-active,.ql-snow .ql-toolbar .ql-picker-label.ql-active,.ql-snow.ql-toolbar .ql-picker-item:hover,.ql-snow .ql-toolbar .ql-picker-item:hover,.ql-snow.ql-toolbar .ql-picker-item.ql-selected,.ql-snow .ql-toolbar .ql-picker-item.ql-selected{color:#06c}.ql-snow.ql-toolbar button:hover .ql-fill,.ql-snow .ql-toolbar button:hover .ql-fill,.ql-snow.ql-toolbar button:focus .ql-fill,.ql-snow .ql-toolbar button:focus .ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill{fill:#06c}.ql-snow.ql-toolbar button:hover .ql-stroke,.ql-snow .ql-toolbar button:hover .ql-stroke,.ql-snow.ql-toolbar button:focus .ql-stroke,.ql-snow .ql-toolbar button:focus .ql-stroke,.ql-snow.ql-toolbar button.ql-active .ql-stroke,.ql-snow .ql-toolbar button.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow.ql-toolbar button:hover .ql-stroke-miter,.ql-snow .ql-toolbar button:hover .ql-stroke-miter,.ql-snow.ql-toolbar button:focus .ql-stroke-miter,.ql-snow .ql-toolbar button:focus .ql-stroke-miter,.ql-snow.ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter{stroke:#06c}@media (pointer:coarse){.ql-snow.ql-toolbar button:hover:not(.ql-active),.ql-snow .ql-toolbar button:hover:not(.ql-active){color:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill{fill:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter{stroke:#444}}.ql-snow{box-sizing:border-box}.ql-snow *{box-sizing:border-box}.ql-snow .ql-hidden{display:none}.ql-snow .ql-out-bottom,.ql-snow .ql-out-top{visibility:hidden}.ql-snow .ql-tooltip{position:absolute;transform:translateY(10px)}.ql-snow .ql-tooltip a{cursor:pointer;text-decoration:none}.ql-snow .ql-tooltip.ql-flip{transform:translateY(-10px)}.ql-snow .ql-formats{display:inline-block;vertical-align:middle}.ql-snow .ql-formats:after{clear:both;content:'';display:table}.ql-snow .ql-stroke{fill:none;stroke:#444;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.ql-snow .ql-stroke-miter{fill:none;stroke:#444;stroke-miterlimit:10;stroke-width:2}.ql-snow .ql-fill,.ql-snow .ql-stroke.ql-fill{fill:#444}.ql-snow .ql-empty{fill:none}.ql-snow .ql-even{fill-rule:evenodd}.ql-snow .ql-thin,.ql-snow .ql-stroke.ql-thin{stroke-width:1}.ql-snow .ql-transparent{opacity:.4}.ql-snow .ql-direction svg:last-child{display:none}.ql-snow .ql-direction.ql-active svg:last-child{display:inline}.ql-snow .ql-direction.ql-active svg:first-child{display:none}.ql-snow .ql-editor h1{font-size:2em}.ql-snow .ql-editor h2{font-size:1.5em}.ql-snow .ql-editor h3{font-size:1.17em}.ql-snow .ql-editor h4{font-size:1em}.ql-snow .ql-editor h5{font-size:.83em}.ql-snow .ql-editor h6{font-size:.67em}.ql-snow .ql-editor a{text-decoration:underline}.ql-snow .ql-editor blockquote{border-left:4px solid #ccc;margin-bottom:5px;margin-top:5px;padding-left:16px}.ql-snow .ql-editor code,.ql-snow .ql-editor .ql-code-block-container{background-color:#f0f0f0;border-radius:3px}.ql-snow .ql-editor .ql-code-block-container{margin-bottom:5px;margin-top:5px;padding:5px 10px}.ql-snow .ql-editor code{font-size:85%;padding:2px 4px}.ql-snow .ql-editor .ql-code-block-container{background-color:#23241f;color:#f8f8f2;overflow:visible}.ql-snow .ql-editor img{max-width:100%}.ql-snow .ql-picker{color:#444;display:inline-block;float:left;font-size:14px;font-weight:500;height:24px;position:relative;vertical-align:middle}.ql-snow .ql-picker-label{cursor:pointer;display:inline-block;height:100%;padding-left:8px;padding-right:2px;position:relative;width:100%}.ql-snow .ql-picker-label::before{display:inline-block;line-height:22px}.ql-snow .ql-picker-options{background-color:#fff;display:none;min-width:100%;padding:4px 8px;position:absolute;white-space:nowrap}.ql-snow .ql-picker-options .ql-picker-item{cursor:pointer;display:block;padding-bottom:5px;padding-top:5px}.ql-snow .ql-picker.ql-expanded .ql-picker-label{color:#ccc;z-index:2}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill{fill:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke{stroke:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-options{display:block;margin-top:-1px;top:100%;z-index:1}.ql-snow .ql-color-picker,.ql-snow .ql-icon-picker{width:28px}.ql-snow .ql-color-picker .ql-picker-label,.ql-snow .ql-icon-picker .ql-picker-label{padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-label svg,.ql-snow .ql-icon-picker .ql-picker-label svg{right:4px}.ql-snow .ql-icon-picker .ql-picker-options{padding:4px 0}.ql-snow .ql-icon-picker .ql-picker-item{height:24px;width:24px;padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-options{padding:3px 5px;width:152px}.ql-snow .ql-color-picker .ql-picker-item{border:1px solid transparent;float:left;height:16px;margin:2px;padding:0;width:16px}.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg{position:absolute;margin-top:-9px;right:0;top:50%;width:18px}.ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before{content:attr(data-label)}.ql-snow .ql-picker.ql-header{width:98px}.ql-snow .ql-picker.ql-header .ql-picker-label::before,.ql-snow .ql-picker.ql-header .ql-picker-item::before{content:'Normal'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"1\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{content:'Heading 1'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"2\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{content:'Heading 2'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"3\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{content:'Heading 3'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"4\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{content:'Heading 4'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"5\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{content:'Heading 5'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"6\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{content:'Heading 6'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{font-size:2em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{font-size:1.5em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{font-size:1.17em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{font-size:1em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{font-size:.83em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{font-size:.67em}.ql-snow .ql-picker.ql-font{width:108px}.ql-snow .ql-picker.ql-font .ql-picker-label::before,.ql-snow .ql-picker.ql-font .ql-picker-item::before{content:'Sans Serif'}.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=serif]::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{content:'Serif'}.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{content:'Monospace'}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{font-family:Georgia,Times New Roman,serif}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{font-family:Monaco,Courier New,monospace}.ql-snow .ql-picker.ql-size{width:98px}.ql-snow .ql-picker.ql-size .ql-picker-label::before,.ql-snow .ql-picker.ql-size .ql-picker-item::before{content:'Normal'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{content:'Small'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{content:'Large'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{content:'Huge'}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{font-size:10px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{font-size:18px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{font-size:32px}.ql-snow .ql-color-picker.ql-background .ql-picker-item{background-color:#fff}.ql-snow .ql-color-picker.ql-color .ql-picker-item{background-color:#000}.ql-code-block-container{position:relative}.ql-code-block-container .ql-ui{right:5px;top:5px}.ql-toolbar.ql-snow{border:1px solid #ccc;box-sizing:border-box;font-family:'Helvetica Neue','Helvetica','Arial',sans-serif;padding:8px}.ql-toolbar.ql-snow .ql-formats{margin-right:15px}.ql-toolbar.ql-snow .ql-picker-label{border:1px solid transparent}.ql-toolbar.ql-snow .ql-picker-options{border:1px solid transparent;box-shadow:rgba(0,0,0,0.2) 0 2px 8px}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label{border-color:#ccc}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options{border-color:#ccc}.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover{border-color:#000}.ql-toolbar.ql-snow + .ql-container.ql-snow{border-top:0}.ql-snow .ql-tooltip{background-color:#fff;border:1px solid #ccc;box-shadow:0 0 5px #ddd;color:#444;padding:5px 12px;white-space:nowrap}.ql-snow .ql-tooltip::before{content:\"Visit URL:\";line-height:26px;margin-right:8px}.ql-snow .ql-tooltip input[type=text]{display:none;border:1px solid #ccc;font-size:13px;height:26px;margin:0;padding:3px 5px;width:170px}.ql-snow .ql-tooltip a.ql-preview{display:inline-block;max-width:200px;overflow-x:hidden;text-overflow:ellipsis;vertical-align:top}.ql-snow .ql-tooltip a.ql-action::after{border-right:1px solid #ccc;content:'Edit';margin-left:16px;padding-right:8px}.ql-snow .ql-tooltip a.ql-remove::before{content:'Remove';margin-left:8px}.ql-snow .ql-tooltip a{line-height:26px}.ql-snow .ql-tooltip.ql-editing a.ql-preview,.ql-snow .ql-tooltip.ql-editing a.ql-remove{display:none}.ql-snow .ql-tooltip.ql-editing input[type=text]{display:inline-block}.ql-snow .ql-tooltip.ql-editing a.ql-action::after{border-right:0;content:'Save';padding-right:0}.ql-snow .ql-tooltip[data-mode=link]::before{content:\"Enter link:\"}.ql-snow .ql-tooltip[data-mode=formula]::before{content:\"Enter formula:\"}.ql-snow .ql-tooltip[data-mode=video]::before{content:\"Enter video:\"}.ql-snow a{color:#06c}.ql-container.ql-snow{border:1px solid #ccc}\n\n/*# sourceMappingURL=quill.snow.css.map*/", "/**\n * Common Math expressions.\n *\n * @module math\n */\n\nexport const floor = Math.floor\nexport const ceil = Math.ceil\nexport const abs = Math.abs\nexport const imul = Math.imul\nexport const round = Math.round\nexport const log10 = Math.log10\nexport const log2 = Math.log2\nexport const log = Math.log\nexport const sqrt = Math.sqrt\n\n/**\n * @function\n * @param {number} a\n * @param {number} b\n * @return {number} The sum of a and b\n */\nexport const add = (a, b) => a + b\n\n/**\n * @function\n * @param {number} a\n * @param {number} b\n * @return {number} The smaller element of a and b\n */\nexport const min = (a, b) => a < b ? a : b\n\n/**\n * @function\n * @param {number} a\n * @param {number} b\n * @return {number} The bigger element of a and b\n */\nexport const max = (a, b) => a > b ? a : b\n\nexport const isNaN = Number.isNaN\n\nexport const pow = Math.pow\n/**\n * Base 10 exponential function. Returns the value of 10 raised to the power of pow.\n *\n * @param {number} exp\n * @return {number}\n */\nexport const exp10 = exp => Math.pow(10, exp)\n\nexport const sign = Math.sign\n\n/**\n * @param {number} n\n * @return {boolean} Wether n is negative. This function also differentiates between -0 and +0\n */\nexport const isNegativeZero = n => n !== 0 ? n < 0 : 1 / n < 0\n", "/**\n * Utility helpers for working with numbers.\n *\n * @module number\n */\n\nimport * as math from './math.js'\nimport * as binary from './binary.js'\n\nexport const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER\nexport const MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER\n\nexport const LOWEST_INT32 = 1 << 31\nexport const HIGHEST_INT32 = binary.BITS31\nexport const HIGHEST_UINT32 = binary.BITS32\n\n/* c8 ignore next */\nexport const isInteger = Number.isInteger || (num => typeof num === 'number' && isFinite(num) && math.floor(num) === num)\nexport const isNaN = Number.isNaN\nexport const parseInt = Number.parseInt\n\n/**\n * Count the number of \"1\" bits in an unsigned 32bit number.\n *\n * Super fun bitcount algorithm by Brian Kernighan.\n *\n * @param {number} n\n */\nexport const countBits = n => {\n n &= binary.BITS32\n let count = 0\n while (n) {\n n &= (n - 1)\n count++\n }\n return count\n}\n", "/**\n * Utility module to work with sets.\n *\n * @module set\n */\n\nexport const create = () => new Set()\n\n/**\n * @template T\n * @param {Set} set\n * @return {Array}\n */\nexport const toArray = set => Array.from(set)\n\n/**\n * @template T\n * @param {Set} set\n * @return {T}\n */\nexport const first = set =>\n set.values().next().value ?? undefined\n\n/**\n * @template T\n * @param {Iterable} entries\n * @return {Set}\n */\nexport const from = entries => new Set(entries)\n", "/**\n * Utility module to work with Arrays.\n *\n * @module array\n */\n\nimport * as set from './set.js'\n\n/**\n * Return the last element of an array. The element must exist\n *\n * @template L\n * @param {ArrayLike} arr\n * @return {L}\n */\nexport const last = arr => arr[arr.length - 1]\n\n/**\n * @template C\n * @return {Array}\n */\nexport const create = () => /** @type {Array} */ ([])\n\n/**\n * @template D\n * @param {Array} a\n * @return {Array}\n */\nexport const copy = a => /** @type {Array} */ (a.slice())\n\n/**\n * Append elements from src to dest\n *\n * @template M\n * @param {Array} dest\n * @param {Array} src\n */\nexport const appendTo = (dest, src) => {\n for (let i = 0; i < src.length; i++) {\n dest.push(src[i])\n }\n}\n\n/**\n * Transforms something array-like to an actual Array.\n *\n * @function\n * @template T\n * @param {ArrayLike|Iterable} arraylike\n * @return {T}\n */\nexport const from = Array.from\n\n/**\n * True iff condition holds on every element in the Array.\n *\n * @function\n * @template ITEM\n * @template {ArrayLike} ARR\n *\n * @param {ARR} arr\n * @param {function(ITEM, number, ARR):boolean} f\n * @return {boolean}\n */\nexport const every = (arr, f) => {\n for (let i = 0; i < arr.length; i++) {\n if (!f(arr[i], i, arr)) {\n return false\n }\n }\n return true\n}\n\n/**\n * True iff condition holds on some element in the Array.\n *\n * @function\n * @template S\n * @template {ArrayLike} ARR\n * @param {ARR} arr\n * @param {function(S, number, ARR):boolean} f\n * @return {boolean}\n */\nexport const some = (arr, f) => {\n for (let i = 0; i < arr.length; i++) {\n if (f(arr[i], i, arr)) {\n return true\n }\n }\n return false\n}\n\n/**\n * @template ELEM\n *\n * @param {ArrayLike} a\n * @param {ArrayLike} b\n * @return {boolean}\n */\nexport const equalFlat = (a, b) => a.length === b.length && every(a, (item, index) => item === b[index])\n\n/**\n * @template ELEM\n * @param {Array>} arr\n * @return {Array}\n */\nexport const flatten = arr => fold(arr, /** @type {Array} */ ([]), (acc, val) => acc.concat(val))\n\n/**\n * @template T\n * @param {number} len\n * @param {function(number, Array):T} f\n * @return {Array}\n */\nexport const unfold = (len, f) => {\n const array = new Array(len)\n for (let i = 0; i < len; i++) {\n array[i] = f(i, array)\n }\n return array\n}\n\n/**\n * @template T\n * @template RESULT\n * @param {Array} arr\n * @param {RESULT} seed\n * @param {function(RESULT, T, number):RESULT} folder\n */\nexport const fold = (arr, seed, folder) => arr.reduce(folder, seed)\n\nexport const isArray = Array.isArray\n\n/**\n * @template T\n * @param {Array} arr\n * @return {Array}\n */\nexport const unique = arr => from(set.from(arr))\n\n/**\n * @template T\n * @template M\n * @param {ArrayLike} arr\n * @param {function(T):M} mapper\n * @return {Array}\n */\nexport const uniqueBy = (arr, mapper) => {\n /**\n * @type {Set}\n */\n const happened = set.create()\n /**\n * @type {Array}\n */\n const result = []\n for (let i = 0; i < arr.length; i++) {\n const el = arr[i]\n const mapped = mapper(el)\n if (!happened.has(mapped)) {\n happened.add(mapped)\n result.push(el)\n }\n }\n return result\n}\n\n/**\n * @template {ArrayLike} ARR\n * @template {function(ARR extends ArrayLike ? T : never, number, ARR):any} MAPPER\n * @param {ARR} arr\n * @param {MAPPER} mapper\n * @return {Array}\n */\nexport const map = (arr, mapper) => {\n /**\n * @type {Array}\n */\n const res = Array(arr.length)\n for (let i = 0; i < arr.length; i++) {\n res[i] = mapper(/** @type {any} */ (arr[i]), i, /** @type {any} */ (arr))\n }\n return /** @type {any} */ (res)\n}\n", "import * as array from './array.js'\n\n/**\n * Utility module to work with strings.\n *\n * @module string\n */\n\nexport const fromCharCode = String.fromCharCode\nexport const fromCodePoint = String.fromCodePoint\n\n/**\n * The largest utf16 character.\n * Corresponds to Uint8Array([255, 255]) or charcodeof(2x2^8)\n */\nexport const MAX_UTF16_CHARACTER = fromCharCode(65535)\n\n/**\n * @param {string} s\n * @return {string}\n */\nconst toLowerCase = s => s.toLowerCase()\n\nconst trimLeftRegex = /^\\s*/g\n\n/**\n * @param {string} s\n * @return {string}\n */\nexport const trimLeft = s => s.replace(trimLeftRegex, '')\n\nconst fromCamelCaseRegex = /([A-Z])/g\n\n/**\n * @param {string} s\n * @param {string} separator\n * @return {string}\n */\nexport const fromCamelCase = (s, separator) => trimLeft(s.replace(fromCamelCaseRegex, match => `${separator}${toLowerCase(match)}`))\n\n/**\n * Compute the utf8ByteLength\n * @param {string} str\n * @return {number}\n */\nexport const utf8ByteLength = str => unescape(encodeURIComponent(str)).length\n\n/**\n * @param {string} str\n * @return {Uint8Array}\n */\nexport const _encodeUtf8Polyfill = str => {\n const encodedString = unescape(encodeURIComponent(str))\n const len = encodedString.length\n const buf = new Uint8Array(len)\n for (let i = 0; i < len; i++) {\n buf[i] = /** @type {number} */ (encodedString.codePointAt(i))\n }\n return buf\n}\n\n/* c8 ignore next */\nexport const utf8TextEncoder = /** @type {TextEncoder} */ (typeof TextEncoder !== 'undefined' ? new TextEncoder() : null)\n\n/**\n * @param {string} str\n * @return {Uint8Array}\n */\nexport const _encodeUtf8Native = str => utf8TextEncoder.encode(str)\n\n/**\n * @param {string} str\n * @return {Uint8Array}\n */\n/* c8 ignore next */\nexport const encodeUtf8 = utf8TextEncoder ? _encodeUtf8Native : _encodeUtf8Polyfill\n\n/**\n * @param {Uint8Array} buf\n * @return {string}\n */\nexport const _decodeUtf8Polyfill = buf => {\n let remainingLen = buf.length\n let encodedString = ''\n let bufPos = 0\n while (remainingLen > 0) {\n const nextLen = remainingLen < 10000 ? remainingLen : 10000\n const bytes = buf.subarray(bufPos, bufPos + nextLen)\n bufPos += nextLen\n // Starting with ES5.1 we can supply a generic array-like object as arguments\n encodedString += String.fromCodePoint.apply(null, /** @type {any} */ (bytes))\n remainingLen -= nextLen\n }\n return decodeURIComponent(escape(encodedString))\n}\n\n/* c8 ignore next */\nexport let utf8TextDecoder = typeof TextDecoder === 'undefined' ? null : new TextDecoder('utf-8', { fatal: true, ignoreBOM: true })\n\n/* c8 ignore start */\nif (utf8TextDecoder && utf8TextDecoder.decode(new Uint8Array()).length === 1) {\n // Safari doesn't handle BOM correctly.\n // This fixes a bug in Safari 13.0.5 where it produces a BOM the first time it is called.\n // utf8TextDecoder.decode(new Uint8Array()).length === 1 on the first call and\n // utf8TextDecoder.decode(new Uint8Array()).length === 1 on the second call\n // Another issue is that from then on no BOM chars are recognized anymore\n /* c8 ignore next */\n utf8TextDecoder = null\n}\n/* c8 ignore stop */\n\n/**\n * @param {Uint8Array} buf\n * @return {string}\n */\nexport const _decodeUtf8Native = buf => /** @type {TextDecoder} */ (utf8TextDecoder).decode(buf)\n\n/**\n * @param {Uint8Array} buf\n * @return {string}\n */\n/* c8 ignore next */\nexport const decodeUtf8 = utf8TextDecoder ? _decodeUtf8Native : _decodeUtf8Polyfill\n\n/**\n * @param {string} str The initial string\n * @param {number} index Starting position\n * @param {number} remove Number of characters to remove\n * @param {string} insert New content to insert\n */\nexport const splice = (str, index, remove, insert = '') => str.slice(0, index) + insert + str.slice(index + remove)\n\n/**\n * @param {string} source\n * @param {number} n\n */\nexport const repeat = (source, n) => array.unfold(n, () => source).join('')\n", "/**\n * Efficient schema-less binary encoding with support for variable length encoding.\n *\n * Use [lib0/encoding] with [lib0/decoding]. Every encoding function has a corresponding decoding function.\n *\n * Encodes numbers in little-endian order (least to most significant byte order)\n * and is compatible with Golang's binary encoding (https://golang.org/pkg/encoding/binary/)\n * which is also used in Protocol Buffers.\n *\n * ```js\n * // encoding step\n * const encoder = encoding.createEncoder()\n * encoding.writeVarUint(encoder, 256)\n * encoding.writeVarString(encoder, 'Hello world!')\n * const buf = encoding.toUint8Array(encoder)\n * ```\n *\n * ```js\n * // decoding step\n * const decoder = decoding.createDecoder(buf)\n * decoding.readVarUint(decoder) // => 256\n * decoding.readVarString(decoder) // => 'Hello world!'\n * decoding.hasContent(decoder) // => false - all data is read\n * ```\n *\n * @module encoding\n */\n\nimport * as math from './math.js'\nimport * as number from './number.js'\nimport * as binary from './binary.js'\nimport * as string from './string.js'\nimport * as array from './array.js'\n\n/**\n * A BinaryEncoder handles the encoding to an Uint8Array.\n */\nexport class Encoder {\n constructor () {\n this.cpos = 0\n this.cbuf = new Uint8Array(100)\n /**\n * @type {Array}\n */\n this.bufs = []\n }\n}\n\n/**\n * @function\n * @return {Encoder}\n */\nexport const createEncoder = () => new Encoder()\n\n/**\n * @param {function(Encoder):void} f\n */\nexport const encode = (f) => {\n const encoder = createEncoder()\n f(encoder)\n return toUint8Array(encoder)\n}\n\n/**\n * The current length of the encoded data.\n *\n * @function\n * @param {Encoder} encoder\n * @return {number}\n */\nexport const length = encoder => {\n let len = encoder.cpos\n for (let i = 0; i < encoder.bufs.length; i++) {\n len += encoder.bufs[i].length\n }\n return len\n}\n\n/**\n * Check whether encoder is empty.\n *\n * @function\n * @param {Encoder} encoder\n * @return {boolean}\n */\nexport const hasContent = encoder => encoder.cpos > 0 || encoder.bufs.length > 0\n\n/**\n * Transform to Uint8Array.\n *\n * @function\n * @param {Encoder} encoder\n * @return {Uint8Array} The created ArrayBuffer.\n */\nexport const toUint8Array = encoder => {\n const uint8arr = new Uint8Array(length(encoder))\n let curPos = 0\n for (let i = 0; i < encoder.bufs.length; i++) {\n const d = encoder.bufs[i]\n uint8arr.set(d, curPos)\n curPos += d.length\n }\n uint8arr.set(new Uint8Array(encoder.cbuf.buffer, 0, encoder.cpos), curPos)\n return uint8arr\n}\n\n/**\n * Verify that it is possible to write `len` bytes wtihout checking. If\n * necessary, a new Buffer with the required length is attached.\n *\n * @param {Encoder} encoder\n * @param {number} len\n */\nexport const verifyLen = (encoder, len) => {\n const bufferLen = encoder.cbuf.length\n if (bufferLen - encoder.cpos < len) {\n encoder.bufs.push(new Uint8Array(encoder.cbuf.buffer, 0, encoder.cpos))\n encoder.cbuf = new Uint8Array(math.max(bufferLen, len) * 2)\n encoder.cpos = 0\n }\n}\n\n/**\n * Write one byte to the encoder.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The byte that is to be encoded.\n */\nexport const write = (encoder, num) => {\n const bufferLen = encoder.cbuf.length\n if (encoder.cpos === bufferLen) {\n encoder.bufs.push(encoder.cbuf)\n encoder.cbuf = new Uint8Array(bufferLen * 2)\n encoder.cpos = 0\n }\n encoder.cbuf[encoder.cpos++] = num\n}\n\n/**\n * Write one byte at a specific position.\n * Position must already be written (i.e. encoder.length > pos)\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} pos Position to which to write data\n * @param {number} num Unsigned 8-bit integer\n */\nexport const set = (encoder, pos, num) => {\n let buffer = null\n // iterate all buffers and adjust position\n for (let i = 0; i < encoder.bufs.length && buffer === null; i++) {\n const b = encoder.bufs[i]\n if (pos < b.length) {\n buffer = b // found buffer\n } else {\n pos -= b.length\n }\n }\n if (buffer === null) {\n // use current buffer\n buffer = encoder.cbuf\n }\n buffer[pos] = num\n}\n\n/**\n * Write one byte as an unsigned integer.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeUint8 = write\n\n/**\n * Write one byte as an unsigned Integer at a specific location.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} pos The location where the data will be written.\n * @param {number} num The number that is to be encoded.\n */\nexport const setUint8 = set\n\n/**\n * Write two bytes as an unsigned integer.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeUint16 = (encoder, num) => {\n write(encoder, num & binary.BITS8)\n write(encoder, (num >>> 8) & binary.BITS8)\n}\n/**\n * Write two bytes as an unsigned integer at a specific location.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} pos The location where the data will be written.\n * @param {number} num The number that is to be encoded.\n */\nexport const setUint16 = (encoder, pos, num) => {\n set(encoder, pos, num & binary.BITS8)\n set(encoder, pos + 1, (num >>> 8) & binary.BITS8)\n}\n\n/**\n * Write two bytes as an unsigned integer\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeUint32 = (encoder, num) => {\n for (let i = 0; i < 4; i++) {\n write(encoder, num & binary.BITS8)\n num >>>= 8\n }\n}\n\n/**\n * Write two bytes as an unsigned integer in big endian order.\n * (most significant byte first)\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeUint32BigEndian = (encoder, num) => {\n for (let i = 3; i >= 0; i--) {\n write(encoder, (num >>> (8 * i)) & binary.BITS8)\n }\n}\n\n/**\n * Write two bytes as an unsigned integer at a specific location.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} pos The location where the data will be written.\n * @param {number} num The number that is to be encoded.\n */\nexport const setUint32 = (encoder, pos, num) => {\n for (let i = 0; i < 4; i++) {\n set(encoder, pos + i, num & binary.BITS8)\n num >>>= 8\n }\n}\n\n/**\n * Write a variable length unsigned integer. Max encodable integer is 2^53.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeVarUint = (encoder, num) => {\n while (num > binary.BITS7) {\n write(encoder, binary.BIT8 | (binary.BITS7 & num))\n num = math.floor(num / 128) // shift >>> 7\n }\n write(encoder, binary.BITS7 & num)\n}\n\n/**\n * Write a variable length integer.\n *\n * We use the 7th bit instead for signaling that this is a negative number.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeVarInt = (encoder, num) => {\n const isNegative = math.isNegativeZero(num)\n if (isNegative) {\n num = -num\n }\n // |- whether to continue reading |- whether is negative |- number\n write(encoder, (num > binary.BITS6 ? binary.BIT8 : 0) | (isNegative ? binary.BIT7 : 0) | (binary.BITS6 & num))\n num = math.floor(num / 64) // shift >>> 6\n // We don't need to consider the case of num === 0 so we can use a different\n // pattern here than above.\n while (num > 0) {\n write(encoder, (num > binary.BITS7 ? binary.BIT8 : 0) | (binary.BITS7 & num))\n num = math.floor(num / 128) // shift >>> 7\n }\n}\n\n/**\n * A cache to store strings temporarily\n */\nconst _strBuffer = new Uint8Array(30000)\nconst _maxStrBSize = _strBuffer.length / 3\n\n/**\n * Write a variable length string.\n *\n * @function\n * @param {Encoder} encoder\n * @param {String} str The string that is to be encoded.\n */\nexport const _writeVarStringNative = (encoder, str) => {\n if (str.length < _maxStrBSize) {\n // We can encode the string into the existing buffer\n /* c8 ignore next */\n const written = string.utf8TextEncoder.encodeInto(str, _strBuffer).written || 0\n writeVarUint(encoder, written)\n for (let i = 0; i < written; i++) {\n write(encoder, _strBuffer[i])\n }\n } else {\n writeVarUint8Array(encoder, string.encodeUtf8(str))\n }\n}\n\n/**\n * Write a variable length string.\n *\n * @function\n * @param {Encoder} encoder\n * @param {String} str The string that is to be encoded.\n */\nexport const _writeVarStringPolyfill = (encoder, str) => {\n const encodedString = unescape(encodeURIComponent(str))\n const len = encodedString.length\n writeVarUint(encoder, len)\n for (let i = 0; i < len; i++) {\n write(encoder, /** @type {number} */ (encodedString.codePointAt(i)))\n }\n}\n\n/**\n * Write a variable length string.\n *\n * @function\n * @param {Encoder} encoder\n * @param {String} str The string that is to be encoded.\n */\n/* c8 ignore next */\nexport const writeVarString = (string.utf8TextEncoder && /** @type {any} */ (string.utf8TextEncoder).encodeInto) ? _writeVarStringNative : _writeVarStringPolyfill\n\n/**\n * Write a string terminated by a special byte sequence. This is not very performant and is\n * generally discouraged. However, the resulting byte arrays are lexiographically ordered which\n * makes this a nice feature for databases.\n *\n * The string will be encoded using utf8 and then terminated and escaped using writeTerminatingUint8Array.\n *\n * @function\n * @param {Encoder} encoder\n * @param {String} str The string that is to be encoded.\n */\nexport const writeTerminatedString = (encoder, str) =>\n writeTerminatedUint8Array(encoder, string.encodeUtf8(str))\n\n/**\n * Write a terminating Uint8Array. Note that this is not performant and is generally\n * discouraged. There are few situations when this is needed.\n *\n * We use 0x0 as a terminating character. 0x1 serves as an escape character for 0x0 and 0x1.\n *\n * Example: [0,1,2] is encoded to [1,0,1,1,2,0]. 0x0, and 0x1 needed to be escaped using 0x1. Then\n * the result is terminated using the 0x0 character.\n *\n * This is basically how many systems implement null terminated strings. However, we use an escape\n * character 0x1 to avoid issues and potenial attacks on our database (if this is used as a key\n * encoder for NoSql databases).\n *\n * @function\n * @param {Encoder} encoder\n * @param {Uint8Array} buf The string that is to be encoded.\n */\nexport const writeTerminatedUint8Array = (encoder, buf) => {\n for (let i = 0; i < buf.length; i++) {\n const b = buf[i]\n if (b === 0 || b === 1) {\n write(encoder, 1)\n }\n write(encoder, buf[i])\n }\n write(encoder, 0)\n}\n\n/**\n * Write the content of another Encoder.\n *\n * @TODO: can be improved!\n * - Note: Should consider that when appending a lot of small Encoders, we should rather clone than referencing the old structure.\n * Encoders start with a rather big initial buffer.\n *\n * @function\n * @param {Encoder} encoder The enUint8Arr\n * @param {Encoder} append The BinaryEncoder to be written.\n */\nexport const writeBinaryEncoder = (encoder, append) => writeUint8Array(encoder, toUint8Array(append))\n\n/**\n * Append fixed-length Uint8Array to the encoder.\n *\n * @function\n * @param {Encoder} encoder\n * @param {Uint8Array} uint8Array\n */\nexport const writeUint8Array = (encoder, uint8Array) => {\n const bufferLen = encoder.cbuf.length\n const cpos = encoder.cpos\n const leftCopyLen = math.min(bufferLen - cpos, uint8Array.length)\n const rightCopyLen = uint8Array.length - leftCopyLen\n encoder.cbuf.set(uint8Array.subarray(0, leftCopyLen), cpos)\n encoder.cpos += leftCopyLen\n if (rightCopyLen > 0) {\n // Still something to write, write right half..\n // Append new buffer\n encoder.bufs.push(encoder.cbuf)\n // must have at least size of remaining buffer\n encoder.cbuf = new Uint8Array(math.max(bufferLen * 2, rightCopyLen))\n // copy array\n encoder.cbuf.set(uint8Array.subarray(leftCopyLen))\n encoder.cpos = rightCopyLen\n }\n}\n\n/**\n * Append an Uint8Array to Encoder.\n *\n * @function\n * @param {Encoder} encoder\n * @param {Uint8Array} uint8Array\n */\nexport const writeVarUint8Array = (encoder, uint8Array) => {\n writeVarUint(encoder, uint8Array.byteLength)\n writeUint8Array(encoder, uint8Array)\n}\n\n/**\n * Create an DataView of the next `len` bytes. Use it to write data after\n * calling this function.\n *\n * ```js\n * // write float32 using DataView\n * const dv = writeOnDataView(encoder, 4)\n * dv.setFloat32(0, 1.1)\n * // read float32 using DataView\n * const dv = readFromDataView(encoder, 4)\n * dv.getFloat32(0) // => 1.100000023841858 (leaving it to the reader to find out why this is the correct result)\n * ```\n *\n * @param {Encoder} encoder\n * @param {number} len\n * @return {DataView}\n */\nexport const writeOnDataView = (encoder, len) => {\n verifyLen(encoder, len)\n const dview = new DataView(encoder.cbuf.buffer, encoder.cpos, len)\n encoder.cpos += len\n return dview\n}\n\n/**\n * @param {Encoder} encoder\n * @param {number} num\n */\nexport const writeFloat32 = (encoder, num) => writeOnDataView(encoder, 4).setFloat32(0, num, false)\n\n/**\n * @param {Encoder} encoder\n * @param {number} num\n */\nexport const writeFloat64 = (encoder, num) => writeOnDataView(encoder, 8).setFloat64(0, num, false)\n\n/**\n * @param {Encoder} encoder\n * @param {bigint} num\n */\nexport const writeBigInt64 = (encoder, num) => /** @type {any} */ (writeOnDataView(encoder, 8)).setBigInt64(0, num, false)\n\n/**\n * @param {Encoder} encoder\n * @param {bigint} num\n */\nexport const writeBigUint64 = (encoder, num) => /** @type {any} */ (writeOnDataView(encoder, 8)).setBigUint64(0, num, false)\n\nconst floatTestBed = new DataView(new ArrayBuffer(4))\n/**\n * Check if a number can be encoded as a 32 bit float.\n *\n * @param {number} num\n * @return {boolean}\n */\nconst isFloat32 = num => {\n floatTestBed.setFloat32(0, num)\n return floatTestBed.getFloat32(0) === num\n}\n\n/**\n * Encode data with efficient binary format.\n *\n * Differences to JSON:\n * \u2022 Transforms data to a binary format (not to a string)\n * \u2022 Encodes undefined, NaN, and ArrayBuffer (these can't be represented in JSON)\n * \u2022 Numbers are efficiently encoded either as a variable length integer, as a\n * 32 bit float, as a 64 bit float, or as a 64 bit bigint.\n *\n * Encoding table:\n *\n * | Data Type | Prefix | Encoding Method | Comment |\n * | ------------------- | -------- | ------------------ | ------- |\n * | undefined | 127 | | Functions, symbol, and everything that cannot be identified is encoded as undefined |\n * | null | 126 | | |\n * | integer | 125 | writeVarInt | Only encodes 32 bit signed integers |\n * | float32 | 124 | writeFloat32 | |\n * | float64 | 123 | writeFloat64 | |\n * | bigint | 122 | writeBigInt64 | |\n * | boolean (false) | 121 | | True and false are different data types so we save the following byte |\n * | boolean (true) | 120 | | - 0b01111000 so the last bit determines whether true or false |\n * | string | 119 | writeVarString | |\n * | object | 118 | custom | Writes {length} then {length} key-value pairs |\n * | array | 117 | custom | Writes {length} then {length} json values |\n * | Uint8Array | 116 | writeVarUint8Array | We use Uint8Array for any kind of binary data |\n *\n * Reasons for the decreasing prefix:\n * We need the first bit for extendability (later we may want to encode the\n * prefix with writeVarUint). The remaining 7 bits are divided as follows:\n * [0-30] the beginning of the data range is used for custom purposes\n * (defined by the function that uses this library)\n * [31-127] the end of the data range is used for data encoding by\n * lib0/encoding.js\n *\n * @param {Encoder} encoder\n * @param {undefined|null|number|bigint|boolean|string|Object|Array|Uint8Array} data\n */\nexport const writeAny = (encoder, data) => {\n switch (typeof data) {\n case 'string':\n // TYPE 119: STRING\n write(encoder, 119)\n writeVarString(encoder, data)\n break\n case 'number':\n if (number.isInteger(data) && math.abs(data) <= binary.BITS31) {\n // TYPE 125: INTEGER\n write(encoder, 125)\n writeVarInt(encoder, data)\n } else if (isFloat32(data)) {\n // TYPE 124: FLOAT32\n write(encoder, 124)\n writeFloat32(encoder, data)\n } else {\n // TYPE 123: FLOAT64\n write(encoder, 123)\n writeFloat64(encoder, data)\n }\n break\n case 'bigint':\n // TYPE 122: BigInt\n write(encoder, 122)\n writeBigInt64(encoder, data)\n break\n case 'object':\n if (data === null) {\n // TYPE 126: null\n write(encoder, 126)\n } else if (array.isArray(data)) {\n // TYPE 117: Array\n write(encoder, 117)\n writeVarUint(encoder, data.length)\n for (let i = 0; i < data.length; i++) {\n writeAny(encoder, data[i])\n }\n } else if (data instanceof Uint8Array) {\n // TYPE 116: ArrayBuffer\n write(encoder, 116)\n writeVarUint8Array(encoder, data)\n } else {\n // TYPE 118: Object\n write(encoder, 118)\n const keys = Object.keys(data)\n writeVarUint(encoder, keys.length)\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n writeVarString(encoder, key)\n writeAny(encoder, data[key])\n }\n }\n break\n case 'boolean':\n // TYPE 120/121: boolean (true/false)\n write(encoder, data ? 120 : 121)\n break\n default:\n // TYPE 127: undefined\n write(encoder, 127)\n }\n}\n\n/**\n * Now come a few stateful encoder that have their own classes.\n */\n\n/**\n * Basic Run Length Encoder - a basic compression implementation.\n *\n * Encodes [1,1,1,7] to [1,3,7,1] (3 times 1, 1 time 7). This encoder might do more harm than good if there are a lot of values that are not repeated.\n *\n * It was originally used for image compression. Cool .. article http://csbruce.com/cbm/transactor/pdfs/trans_v7_i06.pdf\n *\n * @note T must not be null!\n *\n * @template T\n */\nexport class RleEncoder extends Encoder {\n /**\n * @param {function(Encoder, T):void} writer\n */\n constructor (writer) {\n super()\n /**\n * The writer\n */\n this.w = writer\n /**\n * Current state\n * @type {T|null}\n */\n this.s = null\n this.count = 0\n }\n\n /**\n * @param {T} v\n */\n write (v) {\n if (this.s === v) {\n this.count++\n } else {\n if (this.count > 0) {\n // flush counter, unless this is the first value (count = 0)\n writeVarUint(this, this.count - 1) // since count is always > 0, we can decrement by one. non-standard encoding ftw\n }\n this.count = 1\n // write first value\n this.w(this, v)\n this.s = v\n }\n }\n}\n\n/**\n * Basic diff decoder using variable length encoding.\n *\n * Encodes the values [3, 1100, 1101, 1050, 0] to [3, 1097, 1, -51, -1050] using writeVarInt.\n */\nexport class IntDiffEncoder extends Encoder {\n /**\n * @param {number} start\n */\n constructor (start) {\n super()\n /**\n * Current state\n * @type {number}\n */\n this.s = start\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n writeVarInt(this, v - this.s)\n this.s = v\n }\n}\n\n/**\n * A combination of IntDiffEncoder and RleEncoder.\n *\n * Basically first writes the IntDiffEncoder and then counts duplicate diffs using RleEncoding.\n *\n * Encodes the values [1,1,1,2,3,4,5,6] as [1,1,0,2,1,5] (RLE([1,0,0,1,1,1,1,1]) \u21D2 RleIntDiff[1,1,0,2,1,5])\n */\nexport class RleIntDiffEncoder extends Encoder {\n /**\n * @param {number} start\n */\n constructor (start) {\n super()\n /**\n * Current state\n * @type {number}\n */\n this.s = start\n this.count = 0\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n if (this.s === v && this.count > 0) {\n this.count++\n } else {\n if (this.count > 0) {\n // flush counter, unless this is the first value (count = 0)\n writeVarUint(this, this.count - 1) // since count is always > 0, we can decrement by one. non-standard encoding ftw\n }\n this.count = 1\n // write first value\n writeVarInt(this, v - this.s)\n this.s = v\n }\n }\n}\n\n/**\n * @param {UintOptRleEncoder} encoder\n */\nconst flushUintOptRleEncoder = encoder => {\n if (encoder.count > 0) {\n // flush counter, unless this is the first value (count = 0)\n // case 1: just a single value. set sign to positive\n // case 2: write several values. set sign to negative to indicate that there is a length coming\n writeVarInt(encoder.encoder, encoder.count === 1 ? encoder.s : -encoder.s)\n if (encoder.count > 1) {\n writeVarUint(encoder.encoder, encoder.count - 2) // since count is always > 1, we can decrement by one. non-standard encoding ftw\n }\n }\n}\n\n/**\n * Optimized Rle encoder that does not suffer from the mentioned problem of the basic Rle encoder.\n *\n * Internally uses VarInt encoder to write unsigned integers. If the input occurs multiple times, we write\n * write it as a negative number. The UintOptRleDecoder then understands that it needs to read a count.\n *\n * Encodes [1,2,3,3,3] as [1,2,-3,3] (once 1, once 2, three times 3)\n */\nexport class UintOptRleEncoder {\n constructor () {\n this.encoder = new Encoder()\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n if (this.s === v) {\n this.count++\n } else {\n flushUintOptRleEncoder(this)\n this.count = 1\n this.s = v\n }\n }\n\n /**\n * Flush the encoded state and transform this to a Uint8Array.\n *\n * Note that this should only be called once.\n */\n toUint8Array () {\n flushUintOptRleEncoder(this)\n return toUint8Array(this.encoder)\n }\n}\n\n/**\n * Increasing Uint Optimized RLE Encoder\n *\n * The RLE encoder counts the number of same occurences of the same value.\n * The IncUintOptRle encoder counts if the value increases.\n * I.e. 7, 8, 9, 10 will be encoded as [-7, 4]. 1, 3, 5 will be encoded\n * as [1, 3, 5].\n */\nexport class IncUintOptRleEncoder {\n constructor () {\n this.encoder = new Encoder()\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n if (this.s + this.count === v) {\n this.count++\n } else {\n flushUintOptRleEncoder(this)\n this.count = 1\n this.s = v\n }\n }\n\n /**\n * Flush the encoded state and transform this to a Uint8Array.\n *\n * Note that this should only be called once.\n */\n toUint8Array () {\n flushUintOptRleEncoder(this)\n return toUint8Array(this.encoder)\n }\n}\n\n/**\n * @param {IntDiffOptRleEncoder} encoder\n */\nconst flushIntDiffOptRleEncoder = encoder => {\n if (encoder.count > 0) {\n // 31 bit making up the diff | wether to write the counter\n // const encodedDiff = encoder.diff << 1 | (encoder.count === 1 ? 0 : 1)\n const encodedDiff = encoder.diff * 2 + (encoder.count === 1 ? 0 : 1)\n // flush counter, unless this is the first value (count = 0)\n // case 1: just a single value. set first bit to positive\n // case 2: write several values. set first bit to negative to indicate that there is a length coming\n writeVarInt(encoder.encoder, encodedDiff)\n if (encoder.count > 1) {\n writeVarUint(encoder.encoder, encoder.count - 2) // since count is always > 1, we can decrement by one. non-standard encoding ftw\n }\n }\n}\n\n/**\n * A combination of the IntDiffEncoder and the UintOptRleEncoder.\n *\n * The count approach is similar to the UintDiffOptRleEncoder, but instead of using the negative bitflag, it encodes\n * in the LSB whether a count is to be read. Therefore this Encoder only supports 31 bit integers!\n *\n * Encodes [1, 2, 3, 2] as [3, 1, 6, -1] (more specifically [(1 << 1) | 1, (3 << 0) | 0, -1])\n *\n * Internally uses variable length encoding. Contrary to normal UintVar encoding, the first byte contains:\n * * 1 bit that denotes whether the next value is a count (LSB)\n * * 1 bit that denotes whether this value is negative (MSB - 1)\n * * 1 bit that denotes whether to continue reading the variable length integer (MSB)\n *\n * Therefore, only five bits remain to encode diff ranges.\n *\n * Use this Encoder only when appropriate. In most cases, this is probably a bad idea.\n */\nexport class IntDiffOptRleEncoder {\n constructor () {\n this.encoder = new Encoder()\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n this.diff = 0\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n if (this.diff === v - this.s) {\n this.s = v\n this.count++\n } else {\n flushIntDiffOptRleEncoder(this)\n this.count = 1\n this.diff = v - this.s\n this.s = v\n }\n }\n\n /**\n * Flush the encoded state and transform this to a Uint8Array.\n *\n * Note that this should only be called once.\n */\n toUint8Array () {\n flushIntDiffOptRleEncoder(this)\n return toUint8Array(this.encoder)\n }\n}\n\n/**\n * Optimized String Encoder.\n *\n * Encoding many small strings in a simple Encoder is not very efficient. The function call to decode a string takes some time and creates references that must be eventually deleted.\n * In practice, when decoding several million small strings, the GC will kick in more and more often to collect orphaned string objects (or maybe there is another reason?).\n *\n * This string encoder solves the above problem. All strings are concatenated and written as a single string using a single encoding call.\n *\n * The lengths are encoded using a UintOptRleEncoder.\n */\nexport class StringEncoder {\n constructor () {\n /**\n * @type {Array}\n */\n this.sarr = []\n this.s = ''\n this.lensE = new UintOptRleEncoder()\n }\n\n /**\n * @param {string} string\n */\n write (string) {\n this.s += string\n if (this.s.length > 19) {\n this.sarr.push(this.s)\n this.s = ''\n }\n this.lensE.write(string.length)\n }\n\n toUint8Array () {\n const encoder = new Encoder()\n this.sarr.push(this.s)\n this.s = ''\n writeVarString(encoder, this.sarr.join(''))\n writeUint8Array(encoder, this.lensE.toUint8Array())\n return toUint8Array(encoder)\n }\n}\n", "/**\n * Error helpers.\n *\n * @module error\n */\n\n/**\n * @param {string} s\n * @return {Error}\n */\n/* c8 ignore next */\nexport const create = s => new Error(s)\n\n/**\n * @throws {Error}\n * @return {never}\n */\n/* c8 ignore next 3 */\nexport const methodUnimplemented = () => {\n throw create('Method unimplemented')\n}\n\n/**\n * @throws {Error}\n * @return {never}\n */\n/* c8 ignore next 3 */\nexport const unexpectedCase = () => {\n throw create('Unexpected case')\n}\n", "/**\n * Efficient schema-less binary decoding with support for variable length encoding.\n *\n * Use [lib0/decoding] with [lib0/encoding]. Every encoding function has a corresponding decoding function.\n *\n * Encodes numbers in little-endian order (least to most significant byte order)\n * and is compatible with Golang's binary encoding (https://golang.org/pkg/encoding/binary/)\n * which is also used in Protocol Buffers.\n *\n * ```js\n * // encoding step\n * const encoder = encoding.createEncoder()\n * encoding.writeVarUint(encoder, 256)\n * encoding.writeVarString(encoder, 'Hello world!')\n * const buf = encoding.toUint8Array(encoder)\n * ```\n *\n * ```js\n * // decoding step\n * const decoder = decoding.createDecoder(buf)\n * decoding.readVarUint(decoder) // => 256\n * decoding.readVarString(decoder) // => 'Hello world!'\n * decoding.hasContent(decoder) // => false - all data is read\n * ```\n *\n * @module decoding\n */\n\nimport * as binary from './binary.js'\nimport * as math from './math.js'\nimport * as number from './number.js'\nimport * as string from './string.js'\nimport * as error from './error.js'\nimport * as encoding from './encoding.js'\n\nconst errorUnexpectedEndOfArray = error.create('Unexpected end of array')\nconst errorIntegerOutOfRange = error.create('Integer out of Range')\n\n/**\n * A Decoder handles the decoding of an Uint8Array.\n */\nexport class Decoder {\n /**\n * @param {Uint8Array} uint8Array Binary data to decode\n */\n constructor (uint8Array) {\n /**\n * Decoding target.\n *\n * @type {Uint8Array}\n */\n this.arr = uint8Array\n /**\n * Current decoding position.\n *\n * @type {number}\n */\n this.pos = 0\n }\n}\n\n/**\n * @function\n * @param {Uint8Array} uint8Array\n * @return {Decoder}\n */\nexport const createDecoder = uint8Array => new Decoder(uint8Array)\n\n/**\n * @function\n * @param {Decoder} decoder\n * @return {boolean}\n */\nexport const hasContent = decoder => decoder.pos !== decoder.arr.length\n\n/**\n * Clone a decoder instance.\n * Optionally set a new position parameter.\n *\n * @function\n * @param {Decoder} decoder The decoder instance\n * @param {number} [newPos] Defaults to current position\n * @return {Decoder} A clone of `decoder`\n */\nexport const clone = (decoder, newPos = decoder.pos) => {\n const _decoder = createDecoder(decoder.arr)\n _decoder.pos = newPos\n return _decoder\n}\n\n/**\n * Create an Uint8Array view of the next `len` bytes and advance the position by `len`.\n *\n * Important: The Uint8Array still points to the underlying ArrayBuffer. Make sure to discard the result as soon as possible to prevent any memory leaks.\n * Use `buffer.copyUint8Array` to copy the result into a new Uint8Array.\n *\n * @function\n * @param {Decoder} decoder The decoder instance\n * @param {number} len The length of bytes to read\n * @return {Uint8Array}\n */\nexport const readUint8Array = (decoder, len) => {\n const view = new Uint8Array(decoder.arr.buffer, decoder.pos + decoder.arr.byteOffset, len)\n decoder.pos += len\n return view\n}\n\n/**\n * Read variable length Uint8Array.\n *\n * Important: The Uint8Array still points to the underlying ArrayBuffer. Make sure to discard the result as soon as possible to prevent any memory leaks.\n * Use `buffer.copyUint8Array` to copy the result into a new Uint8Array.\n *\n * @function\n * @param {Decoder} decoder\n * @return {Uint8Array}\n */\nexport const readVarUint8Array = decoder => readUint8Array(decoder, readVarUint(decoder))\n\n/**\n * Read the rest of the content as an ArrayBuffer\n * @function\n * @param {Decoder} decoder\n * @return {Uint8Array}\n */\nexport const readTailAsUint8Array = decoder => readUint8Array(decoder, decoder.arr.length - decoder.pos)\n\n/**\n * Skip one byte, jump to the next position.\n * @function\n * @param {Decoder} decoder The decoder instance\n * @return {number} The next position\n */\nexport const skip8 = decoder => decoder.pos++\n\n/**\n * Read one byte as unsigned integer.\n * @function\n * @param {Decoder} decoder The decoder instance\n * @return {number} Unsigned 8-bit integer\n */\nexport const readUint8 = decoder => decoder.arr[decoder.pos++]\n\n/**\n * Read 2 bytes as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const readUint16 = decoder => {\n const uint =\n decoder.arr[decoder.pos] +\n (decoder.arr[decoder.pos + 1] << 8)\n decoder.pos += 2\n return uint\n}\n\n/**\n * Read 4 bytes as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const readUint32 = decoder => {\n const uint =\n (decoder.arr[decoder.pos] +\n (decoder.arr[decoder.pos + 1] << 8) +\n (decoder.arr[decoder.pos + 2] << 16) +\n (decoder.arr[decoder.pos + 3] << 24)) >>> 0\n decoder.pos += 4\n return uint\n}\n\n/**\n * Read 4 bytes as unsigned integer in big endian order.\n * (most significant byte first)\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const readUint32BigEndian = decoder => {\n const uint =\n (decoder.arr[decoder.pos + 3] +\n (decoder.arr[decoder.pos + 2] << 8) +\n (decoder.arr[decoder.pos + 1] << 16) +\n (decoder.arr[decoder.pos] << 24)) >>> 0\n decoder.pos += 4\n return uint\n}\n\n/**\n * Look ahead without incrementing the position\n * to the next byte and read it as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const peekUint8 = decoder => decoder.arr[decoder.pos]\n\n/**\n * Look ahead without incrementing the position\n * to the next byte and read it as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const peekUint16 = decoder =>\n decoder.arr[decoder.pos] +\n (decoder.arr[decoder.pos + 1] << 8)\n\n/**\n * Look ahead without incrementing the position\n * to the next byte and read it as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const peekUint32 = decoder => (\n decoder.arr[decoder.pos] +\n (decoder.arr[decoder.pos + 1] << 8) +\n (decoder.arr[decoder.pos + 2] << 16) +\n (decoder.arr[decoder.pos + 3] << 24)\n) >>> 0\n\n/**\n * Read unsigned integer (32bit) with variable length.\n * 1/8th of the storage is used as encoding overhead.\n * * numbers < 2^7 is stored in one bytlength\n * * numbers < 2^14 is stored in two bylength\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.length\n */\nexport const readVarUint = decoder => {\n let num = 0\n let mult = 1\n const len = decoder.arr.length\n while (decoder.pos < len) {\n const r = decoder.arr[decoder.pos++]\n // num = num | ((r & binary.BITS7) << len)\n num = num + (r & binary.BITS7) * mult // shift $r << (7*#iterations) and add it to num\n mult *= 128 // next iteration, shift 7 \"more\" to the left\n if (r < binary.BIT8) {\n return num\n }\n /* c8 ignore start */\n if (num > number.MAX_SAFE_INTEGER) {\n throw errorIntegerOutOfRange\n }\n /* c8 ignore stop */\n }\n throw errorUnexpectedEndOfArray\n}\n\n/**\n * Read signed integer (32bit) with variable length.\n * 1/8th of the storage is used as encoding overhead.\n * * numbers < 2^7 is stored in one bytlength\n * * numbers < 2^14 is stored in two bylength\n * @todo This should probably create the inverse ~num if number is negative - but this would be a breaking change.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.length\n */\nexport const readVarInt = decoder => {\n let r = decoder.arr[decoder.pos++]\n let num = r & binary.BITS6\n let mult = 64\n const sign = (r & binary.BIT7) > 0 ? -1 : 1\n if ((r & binary.BIT8) === 0) {\n // don't continue reading\n return sign * num\n }\n const len = decoder.arr.length\n while (decoder.pos < len) {\n r = decoder.arr[decoder.pos++]\n // num = num | ((r & binary.BITS7) << len)\n num = num + (r & binary.BITS7) * mult\n mult *= 128\n if (r < binary.BIT8) {\n return sign * num\n }\n /* c8 ignore start */\n if (num > number.MAX_SAFE_INTEGER) {\n throw errorIntegerOutOfRange\n }\n /* c8 ignore stop */\n }\n throw errorUnexpectedEndOfArray\n}\n\n/**\n * Look ahead and read varUint without incrementing position\n *\n * @function\n * @param {Decoder} decoder\n * @return {number}\n */\nexport const peekVarUint = decoder => {\n const pos = decoder.pos\n const s = readVarUint(decoder)\n decoder.pos = pos\n return s\n}\n\n/**\n * Look ahead and read varUint without incrementing position\n *\n * @function\n * @param {Decoder} decoder\n * @return {number}\n */\nexport const peekVarInt = decoder => {\n const pos = decoder.pos\n const s = readVarInt(decoder)\n decoder.pos = pos\n return s\n}\n\n/**\n * We don't test this function anymore as we use native decoding/encoding by default now.\n * Better not modify this anymore..\n *\n * Transforming utf8 to a string is pretty expensive. The code performs 10x better\n * when String.fromCodePoint is fed with all characters as arguments.\n * But most environments have a maximum number of arguments per functions.\n * For effiency reasons we apply a maximum of 10000 characters at once.\n *\n * @function\n * @param {Decoder} decoder\n * @return {String} The read String.\n */\n/* c8 ignore start */\nexport const _readVarStringPolyfill = decoder => {\n let remainingLen = readVarUint(decoder)\n if (remainingLen === 0) {\n return ''\n } else {\n let encodedString = String.fromCodePoint(readUint8(decoder)) // remember to decrease remainingLen\n if (--remainingLen < 100) { // do not create a Uint8Array for small strings\n while (remainingLen--) {\n encodedString += String.fromCodePoint(readUint8(decoder))\n }\n } else {\n while (remainingLen > 0) {\n const nextLen = remainingLen < 10000 ? remainingLen : 10000\n // this is dangerous, we create a fresh array view from the existing buffer\n const bytes = decoder.arr.subarray(decoder.pos, decoder.pos + nextLen)\n decoder.pos += nextLen\n // Starting with ES5.1 we can supply a generic array-like object as arguments\n encodedString += String.fromCodePoint.apply(null, /** @type {any} */ (bytes))\n remainingLen -= nextLen\n }\n }\n return decodeURIComponent(escape(encodedString))\n }\n}\n/* c8 ignore stop */\n\n/**\n * @function\n * @param {Decoder} decoder\n * @return {String} The read String\n */\nexport const _readVarStringNative = decoder =>\n /** @type any */ (string.utf8TextDecoder).decode(readVarUint8Array(decoder))\n\n/**\n * Read string of variable length\n * * varUint is used to store the length of the string\n *\n * @function\n * @param {Decoder} decoder\n * @return {String} The read String\n *\n */\n/* c8 ignore next */\nexport const readVarString = string.utf8TextDecoder ? _readVarStringNative : _readVarStringPolyfill\n\n/**\n * @param {Decoder} decoder\n * @return {Uint8Array}\n */\nexport const readTerminatedUint8Array = decoder => {\n const encoder = encoding.createEncoder()\n let b\n while (true) {\n b = readUint8(decoder)\n if (b === 0) {\n return encoding.toUint8Array(encoder)\n }\n if (b === 1) {\n b = readUint8(decoder)\n }\n encoding.write(encoder, b)\n }\n}\n\n/**\n * @param {Decoder} decoder\n * @return {string}\n */\nexport const readTerminatedString = decoder => string.decodeUtf8(readTerminatedUint8Array(decoder))\n\n/**\n * Look ahead and read varString without incrementing position\n *\n * @function\n * @param {Decoder} decoder\n * @return {string}\n */\nexport const peekVarString = decoder => {\n const pos = decoder.pos\n const s = readVarString(decoder)\n decoder.pos = pos\n return s\n}\n\n/**\n * @param {Decoder} decoder\n * @param {number} len\n * @return {DataView}\n */\nexport const readFromDataView = (decoder, len) => {\n const dv = new DataView(decoder.arr.buffer, decoder.arr.byteOffset + decoder.pos, len)\n decoder.pos += len\n return dv\n}\n\n/**\n * @param {Decoder} decoder\n */\nexport const readFloat32 = decoder => readFromDataView(decoder, 4).getFloat32(0, false)\n\n/**\n * @param {Decoder} decoder\n */\nexport const readFloat64 = decoder => readFromDataView(decoder, 8).getFloat64(0, false)\n\n/**\n * @param {Decoder} decoder\n */\nexport const readBigInt64 = decoder => /** @type {any} */ (readFromDataView(decoder, 8)).getBigInt64(0, false)\n\n/**\n * @param {Decoder} decoder\n */\nexport const readBigUint64 = decoder => /** @type {any} */ (readFromDataView(decoder, 8)).getBigUint64(0, false)\n\n/**\n * @type {Array}\n */\nconst readAnyLookupTable = [\n decoder => undefined, // CASE 127: undefined\n decoder => null, // CASE 126: null\n readVarInt, // CASE 125: integer\n readFloat32, // CASE 124: float32\n readFloat64, // CASE 123: float64\n readBigInt64, // CASE 122: bigint\n decoder => false, // CASE 121: boolean (false)\n decoder => true, // CASE 120: boolean (true)\n readVarString, // CASE 119: string\n decoder => { // CASE 118: object\n const len = readVarUint(decoder)\n /**\n * @type {Object}\n */\n const obj = {}\n for (let i = 0; i < len; i++) {\n const key = readVarString(decoder)\n obj[key] = readAny(decoder)\n }\n return obj\n },\n decoder => { // CASE 117: array\n const len = readVarUint(decoder)\n const arr = []\n for (let i = 0; i < len; i++) {\n arr.push(readAny(decoder))\n }\n return arr\n },\n readVarUint8Array // CASE 116: Uint8Array\n]\n\n/**\n * @param {Decoder} decoder\n */\nexport const readAny = decoder => readAnyLookupTable[127 - readUint8(decoder)](decoder)\n\n/**\n * T must not be null.\n *\n * @template T\n */\nexport class RleDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n * @param {function(Decoder):T} reader\n */\n constructor (uint8Array, reader) {\n super(uint8Array)\n /**\n * The reader\n */\n this.reader = reader\n /**\n * Current state\n * @type {T|null}\n */\n this.s = null\n this.count = 0\n }\n\n read () {\n if (this.count === 0) {\n this.s = this.reader(this)\n if (hasContent(this)) {\n this.count = readVarUint(this) + 1 // see encoder implementation for the reason why this is incremented\n } else {\n this.count = -1 // read the current value forever\n }\n }\n this.count--\n return /** @type {T} */ (this.s)\n }\n}\n\nexport class IntDiffDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n * @param {number} start\n */\n constructor (uint8Array, start) {\n super(uint8Array)\n /**\n * Current state\n * @type {number}\n */\n this.s = start\n }\n\n /**\n * @return {number}\n */\n read () {\n this.s += readVarInt(this)\n return this.s\n }\n}\n\nexport class RleIntDiffDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n * @param {number} start\n */\n constructor (uint8Array, start) {\n super(uint8Array)\n /**\n * Current state\n * @type {number}\n */\n this.s = start\n this.count = 0\n }\n\n /**\n * @return {number}\n */\n read () {\n if (this.count === 0) {\n this.s += readVarInt(this)\n if (hasContent(this)) {\n this.count = readVarUint(this) + 1 // see encoder implementation for the reason why this is incremented\n } else {\n this.count = -1 // read the current value forever\n }\n }\n this.count--\n return /** @type {number} */ (this.s)\n }\n}\n\nexport class UintOptRleDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n */\n constructor (uint8Array) {\n super(uint8Array)\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n }\n\n read () {\n if (this.count === 0) {\n this.s = readVarInt(this)\n // if the sign is negative, we read the count too, otherwise count is 1\n const isNegative = math.isNegativeZero(this.s)\n this.count = 1\n if (isNegative) {\n this.s = -this.s\n this.count = readVarUint(this) + 2\n }\n }\n this.count--\n return /** @type {number} */ (this.s)\n }\n}\n\nexport class IncUintOptRleDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n */\n constructor (uint8Array) {\n super(uint8Array)\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n }\n\n read () {\n if (this.count === 0) {\n this.s = readVarInt(this)\n // if the sign is negative, we read the count too, otherwise count is 1\n const isNegative = math.isNegativeZero(this.s)\n this.count = 1\n if (isNegative) {\n this.s = -this.s\n this.count = readVarUint(this) + 2\n }\n }\n this.count--\n return /** @type {number} */ (this.s++)\n }\n}\n\nexport class IntDiffOptRleDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n */\n constructor (uint8Array) {\n super(uint8Array)\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n this.diff = 0\n }\n\n /**\n * @return {number}\n */\n read () {\n if (this.count === 0) {\n const diff = readVarInt(this)\n // if the first bit is set, we read more data\n const hasCount = diff & 1\n this.diff = math.floor(diff / 2) // shift >> 1\n this.count = 1\n if (hasCount) {\n this.count = readVarUint(this) + 2\n }\n }\n this.s += this.diff\n this.count--\n return this.s\n }\n}\n\nexport class StringDecoder {\n /**\n * @param {Uint8Array} uint8Array\n */\n constructor (uint8Array) {\n this.decoder = new UintOptRleDecoder(uint8Array)\n this.str = readVarString(this.decoder)\n /**\n * @type {number}\n */\n this.spos = 0\n }\n\n /**\n * @return {string}\n */\n read () {\n const end = this.spos + this.decoder.read()\n const res = this.str.slice(this.spos, end)\n this.spos = end\n return res\n }\n}\n", "/**\n * Utility module to work with time.\n *\n * @module time\n */\n\nimport * as metric from './metric.js'\nimport * as math from './math.js'\n\n/**\n * Return current time.\n *\n * @return {Date}\n */\nexport const getDate = () => new Date()\n\n/**\n * Return current unix time.\n *\n * @return {number}\n */\nexport const getUnixTime = Date.now\n\n/**\n * Transform time (in ms) to a human readable format. E.g. 1100 => 1.1s. 60s => 1min. .001 => 10\u03BCs.\n *\n * @param {number} d duration in milliseconds\n * @return {string} humanized approximation of time\n */\nexport const humanizeDuration = d => {\n if (d < 60000) {\n const p = metric.prefix(d, -1)\n return math.round(p.n * 100) / 100 + p.prefix + 's'\n }\n d = math.floor(d / 1000)\n const seconds = d % 60\n const minutes = math.floor(d / 60) % 60\n const hours = math.floor(d / 3600) % 24\n const days = math.floor(d / 86400)\n if (days > 0) {\n return days + 'd' + ((hours > 0 || minutes > 30) ? ' ' + (minutes > 30 ? hours + 1 : hours) + 'h' : '')\n }\n if (hours > 0) {\n /* c8 ignore next */\n return hours + 'h' + ((minutes > 0 || seconds > 30) ? ' ' + (seconds > 30 ? minutes + 1 : minutes) + 'min' : '')\n }\n return minutes + 'min' + (seconds > 0 ? ' ' + seconds + 's' : '')\n}\n", "/**\n * Utility module to work with key-value stores.\n *\n * @module map\n */\n\n/**\n * Creates a new Map instance.\n *\n * @function\n * @return {Map}\n *\n * @function\n */\nexport const create = () => new Map()\n\n/**\n * Copy a Map object into a fresh Map object.\n *\n * @function\n * @template K,V\n * @param {Map} m\n * @return {Map}\n */\nexport const copy = m => {\n const r = create()\n m.forEach((v, k) => { r.set(k, v) })\n return r\n}\n\n/**\n * Get map property. Create T if property is undefined and set T on map.\n *\n * ```js\n * const listeners = map.setIfUndefined(events, 'eventName', set.create)\n * listeners.add(listener)\n * ```\n *\n * @function\n * @template {Map} MAP\n * @template {MAP extends Map ? function():V : unknown} CF\n * @param {MAP} map\n * @param {MAP extends Map ? K : unknown} key\n * @param {CF} createT\n * @return {ReturnType}\n */\nexport const setIfUndefined = (map, key, createT) => {\n let set = map.get(key)\n if (set === undefined) {\n map.set(key, set = createT())\n }\n return set\n}\n\n/**\n * Creates an Array and populates it with the content of all key-value pairs using the `f(value, key)` function.\n *\n * @function\n * @template K\n * @template V\n * @template R\n * @param {Map} m\n * @param {function(V,K):R} f\n * @return {Array}\n */\nexport const map = (m, f) => {\n const res = []\n for (const [key, value] of m) {\n res.push(f(value, key))\n }\n return res\n}\n\n/**\n * Tests whether any key-value pairs pass the test implemented by `f(value, key)`.\n *\n * @todo should rename to some - similarly to Array.some\n *\n * @function\n * @template K\n * @template V\n * @param {Map} m\n * @param {function(V,K):boolean} f\n * @return {boolean}\n */\nexport const any = (m, f) => {\n for (const [key, value] of m) {\n if (f(value, key)) {\n return true\n }\n }\n return false\n}\n\n/**\n * Tests whether all key-value pairs pass the test implemented by `f(value, key)`.\n *\n * @function\n * @template K\n * @template V\n * @param {Map} m\n * @param {function(V,K):boolean} f\n * @return {boolean}\n */\nexport const all = (m, f) => {\n for (const [key, value] of m) {\n if (!f(value, key)) {\n return false\n }\n }\n return true\n}\n", "/**\n * Observable class prototype.\n *\n * @module observable\n */\n\nimport * as map from './map.js'\nimport * as set from './set.js'\nimport * as array from './array.js'\n\n/**\n * Handles named events.\n * @experimental\n *\n * This is basically a (better typed) duplicate of Observable, which will replace Observable in the\n * next release.\n *\n * @template {{[key in keyof EVENTS]: function(...any):void}} EVENTS\n */\nexport class ObservableV2 {\n constructor () {\n /**\n * Some desc.\n * @type {Map>}\n */\n this._observers = map.create()\n }\n\n /**\n * @template {keyof EVENTS & string} NAME\n * @param {NAME} name\n * @param {EVENTS[NAME]} f\n */\n on (name, f) {\n map.setIfUndefined(this._observers, /** @type {string} */ (name), set.create).add(f)\n return f\n }\n\n /**\n * @template {keyof EVENTS & string} NAME\n * @param {NAME} name\n * @param {EVENTS[NAME]} f\n */\n once (name, f) {\n /**\n * @param {...any} args\n */\n const _f = (...args) => {\n this.off(name, /** @type {any} */ (_f))\n f(...args)\n }\n this.on(name, /** @type {any} */ (_f))\n }\n\n /**\n * @template {keyof EVENTS & string} NAME\n * @param {NAME} name\n * @param {EVENTS[NAME]} f\n */\n off (name, f) {\n const observers = this._observers.get(name)\n if (observers !== undefined) {\n observers.delete(f)\n if (observers.size === 0) {\n this._observers.delete(name)\n }\n }\n }\n\n /**\n * Emit a named event. All registered event listeners that listen to the\n * specified name will receive the event.\n *\n * @todo This should catch exceptions\n *\n * @template {keyof EVENTS & string} NAME\n * @param {NAME} name The event name.\n * @param {Parameters} args The arguments that are applied to the event listener.\n */\n emit (name, args) {\n // copy all listeners to an array first to make sure that no event is emitted to listeners that are subscribed while the event handler is called.\n return array.from((this._observers.get(name) || map.create()).values()).forEach(f => f(...args))\n }\n\n destroy () {\n this._observers = map.create()\n }\n}\n\n/* c8 ignore start */\n/**\n * Handles named events.\n *\n * @deprecated\n * @template N\n */\nexport class Observable {\n constructor () {\n /**\n * Some desc.\n * @type {Map}\n */\n this._observers = map.create()\n }\n\n /**\n * @param {N} name\n * @param {function} f\n */\n on (name, f) {\n map.setIfUndefined(this._observers, name, set.create).add(f)\n }\n\n /**\n * @param {N} name\n * @param {function} f\n */\n once (name, f) {\n /**\n * @param {...any} args\n */\n const _f = (...args) => {\n this.off(name, _f)\n f(...args)\n }\n this.on(name, _f)\n }\n\n /**\n * @param {N} name\n * @param {function} f\n */\n off (name, f) {\n const observers = this._observers.get(name)\n if (observers !== undefined) {\n observers.delete(f)\n if (observers.size === 0) {\n this._observers.delete(name)\n }\n }\n }\n\n /**\n * Emit a named event. All registered event listeners that listen to the\n * specified name will receive the event.\n *\n * @todo This should catch exceptions\n *\n * @param {N} name The event name.\n * @param {Array} args The arguments that are applied to the event listener.\n */\n emit (name, args) {\n // copy all listeners to an array first to make sure that no event is emitted to listeners that are subscribed while the event handler is called.\n return array.from((this._observers.get(name) || map.create()).values()).forEach(f => f(...args))\n }\n\n destroy () {\n this._observers = map.create()\n }\n}\n/* c8 ignore end */\n", "/**\n * Utility functions for working with EcmaScript objects.\n *\n * @module object\n */\n\n/**\n * @return {Object} obj\n */\nexport const create = () => Object.create(null)\n\n/**\n * Object.assign\n */\nexport const assign = Object.assign\n\n/**\n * @param {Object} obj\n */\nexport const keys = Object.keys\n\n/**\n * @template V\n * @param {{[k:string]:V}} obj\n * @param {function(V,string):any} f\n */\nexport const forEach = (obj, f) => {\n for (const key in obj) {\n f(obj[key], key)\n }\n}\n\n/**\n * @todo implement mapToArray & map\n *\n * @template R\n * @param {Object} obj\n * @param {function(any,string):R} f\n * @return {Array}\n */\nexport const map = (obj, f) => {\n const results = []\n for (const key in obj) {\n results.push(f(obj[key], key))\n }\n return results\n}\n\n/**\n * @deprecated use object.size instead\n * @param {Object} obj\n * @return {number}\n */\nexport const length = obj => keys(obj).length\n\n/**\n * @param {Object} obj\n * @return {number}\n */\nexport const size = obj => keys(obj).length\n\n/**\n * @param {Object} obj\n * @param {function(any,string):boolean} f\n * @return {boolean}\n */\nexport const some = (obj, f) => {\n for (const key in obj) {\n if (f(obj[key], key)) {\n return true\n }\n }\n return false\n}\n\n/**\n * @param {Object|undefined} obj\n */\nexport const isEmpty = obj => {\n // eslint-disable-next-line\n for (const _k in obj) {\n return false\n }\n return true\n}\n\n/**\n * @param {Object} obj\n * @param {function(any,string):boolean} f\n * @return {boolean}\n */\nexport const every = (obj, f) => {\n for (const key in obj) {\n if (!f(obj[key], key)) {\n return false\n }\n }\n return true\n}\n\n/**\n * Calls `Object.prototype.hasOwnProperty`.\n *\n * @param {any} obj\n * @param {string|symbol} key\n * @return {boolean}\n */\nexport const hasProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key)\n\n/**\n * @param {Object} a\n * @param {Object} b\n * @return {boolean}\n */\nexport const equalFlat = (a, b) => a === b || (size(a) === size(b) && every(a, (val, key) => (val !== undefined || hasProperty(b, key)) && b[key] === val))\n\n/**\n * Make an object immutable. This hurts performance and is usually not needed if you perform good\n * coding practices.\n */\nexport const freeze = Object.freeze\n\n/**\n * Make an object and all its children immutable.\n * This *really* hurts performance and is usually not needed if you perform good coding practices.\n *\n * @template {any} T\n * @param {T} o\n * @return {Readonly}\n */\nexport const deepFreeze = (o) => {\n for (const key in o) {\n const c = o[key]\n if (typeof c === 'object' || typeof c === 'function') {\n deepFreeze(o[key])\n }\n }\n return freeze(o)\n}\n", "/**\n * Common functions and function call helpers.\n *\n * @module function\n */\n\nimport * as array from './array.js'\nimport * as object from './object.js'\n\n/**\n * Calls all functions in `fs` with args. Only throws after all functions were called.\n *\n * @param {Array} fs\n * @param {Array} args\n */\nexport const callAll = (fs, args, i = 0) => {\n try {\n for (; i < fs.length; i++) {\n fs[i](...args)\n }\n } finally {\n if (i < fs.length) {\n callAll(fs, args, i + 1)\n }\n }\n}\n\nexport const nop = () => {}\n\n/**\n * @template T\n * @param {function():T} f\n * @return {T}\n */\nexport const apply = f => f()\n\n/**\n * @template A\n *\n * @param {A} a\n * @return {A}\n */\nexport const id = a => a\n\n/**\n * @template T\n *\n * @param {T} a\n * @param {T} b\n * @return {boolean}\n */\nexport const equalityStrict = (a, b) => a === b\n\n/**\n * @template T\n *\n * @param {Array|object} a\n * @param {Array|object} b\n * @return {boolean}\n */\nexport const equalityFlat = (a, b) => a === b || (a != null && b != null && a.constructor === b.constructor && ((array.isArray(a) && array.equalFlat(a, /** @type {Array} */ (b))) || (typeof a === 'object' && object.equalFlat(a, b))))\n\n/* c8 ignore start */\n\n/**\n * @param {any} a\n * @param {any} b\n * @return {boolean}\n */\nexport const equalityDeep = (a, b) => {\n if (a == null || b == null) {\n return equalityStrict(a, b)\n }\n if (a.constructor !== b.constructor) {\n return false\n }\n if (a === b) {\n return true\n }\n switch (a.constructor) {\n case ArrayBuffer:\n a = new Uint8Array(a)\n b = new Uint8Array(b)\n // eslint-disable-next-line no-fallthrough\n case Uint8Array: {\n if (a.byteLength !== b.byteLength) {\n return false\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false\n }\n }\n break\n }\n case Set: {\n if (a.size !== b.size) {\n return false\n }\n for (const value of a) {\n if (!b.has(value)) {\n return false\n }\n }\n break\n }\n case Map: {\n if (a.size !== b.size) {\n return false\n }\n for (const key of a.keys()) {\n if (!b.has(key) || !equalityDeep(a.get(key), b.get(key))) {\n return false\n }\n }\n break\n }\n case Object:\n if (object.length(a) !== object.length(b)) {\n return false\n }\n for (const key in a) {\n if (!object.hasProperty(a, key) || !equalityDeep(a[key], b[key])) {\n return false\n }\n }\n break\n case Array:\n if (a.length !== b.length) {\n return false\n }\n for (let i = 0; i < a.length; i++) {\n if (!equalityDeep(a[i], b[i])) {\n return false\n }\n }\n break\n default:\n return false\n }\n return true\n}\n\n/**\n * @template V\n * @template {V} OPTS\n *\n * @param {V} value\n * @param {Array} options\n */\n// @ts-ignore\nexport const isOneOf = (value, options) => options.includes(value)\n/* c8 ignore stop */\n\nexport const isArray = array.isArray\n\n/**\n * @param {any} s\n * @return {s is String}\n */\nexport const isString = (s) => s && s.constructor === String\n\n/**\n * @param {any} n\n * @return {n is Number}\n */\nexport const isNumber = n => n != null && n.constructor === Number\n\n/**\n * @template {abstract new (...args: any) => any} TYPE\n * @param {any} n\n * @param {TYPE} T\n * @return {n is InstanceType}\n */\nexport const is = (n, T) => n && n.constructor === T\n\n/**\n * @template {abstract new (...args: any) => any} TYPE\n * @param {TYPE} T\n */\nexport const isTemplate = (T) =>\n /**\n * @param {any} n\n * @return {n is InstanceType}\n **/\n n => n && n.constructor === T\n", "/* eslint-env browser */\n\nexport const subtle = crypto.subtle\nexport const getRandomValues = crypto.getRandomValues.bind(crypto)\n", "/**\n * Isomorphic module for true random numbers / buffers / uuids.\n *\n * Attention: falls back to Math.random if the browser does not support crypto.\n *\n * @module random\n */\n\nimport * as math from './math.js'\nimport * as binary from './binary.js'\nimport { getRandomValues } from 'lib0/webcrypto'\n\nexport const rand = Math.random\n\nexport const uint32 = () => getRandomValues(new Uint32Array(1))[0]\n\nexport const uint53 = () => {\n const arr = getRandomValues(new Uint32Array(8))\n return (arr[0] & binary.BITS21) * (binary.BITS32 + 1) + (arr[1] >>> 0)\n}\n\n/**\n * @template T\n * @param {Array} arr\n * @return {T}\n */\nexport const oneOf = arr => arr[math.floor(rand() * arr.length)]\n\n// @ts-ignore\nconst uuidv4Template = [1e7] + -1e3 + -4e3 + -8e3 + -1e11\n\n/**\n * @return {string}\n */\nexport const uuidv4 = () => uuidv4Template.replace(/[018]/g, /** @param {number} c */ c =>\n (c ^ uint32() & 15 >> c / 4).toString(16)\n)\n", "/**\n * Utility helpers to work with promises.\n *\n * @module promise\n */\n\nimport * as time from './time.js'\n\n/**\n * @template T\n * @callback PromiseResolve\n * @param {T|PromiseLike} [result]\n */\n\n/**\n * @template T\n * @param {function(PromiseResolve,function(Error):void):any} f\n * @return {Promise}\n */\nexport const create = f => /** @type {Promise} */ (new Promise(f))\n\n/**\n * @param {function(function():void,function(Error):void):void} f\n * @return {Promise}\n */\nexport const createEmpty = f => new Promise(f)\n\n/**\n * `Promise.all` wait for all promises in the array to resolve and return the result\n * @template {unknown[] | []} PS\n *\n * @param {PS} ps\n * @return {Promise<{ -readonly [P in keyof PS]: Awaited }>}\n */\nexport const all = Promise.all.bind(Promise)\n\n/**\n * @param {Error} [reason]\n * @return {Promise}\n */\nexport const reject = reason => Promise.reject(reason)\n\n/**\n * @template T\n * @param {T|void} res\n * @return {Promise}\n */\nexport const resolve = res => Promise.resolve(res)\n\n/**\n * @template T\n * @param {T} res\n * @return {Promise}\n */\nexport const resolveWith = res => Promise.resolve(res)\n\n/**\n * @todo Next version, reorder parameters: check, [timeout, [intervalResolution]]\n * @deprecated use untilAsync instead\n *\n * @param {number} timeout\n * @param {function():boolean} check\n * @param {number} [intervalResolution]\n * @return {Promise}\n */\nexport const until = (timeout, check, intervalResolution = 10) => create((resolve, reject) => {\n const startTime = time.getUnixTime()\n const hasTimeout = timeout > 0\n const untilInterval = () => {\n if (check()) {\n clearInterval(intervalHandle)\n resolve()\n } else if (hasTimeout) {\n /* c8 ignore else */\n if (time.getUnixTime() - startTime > timeout) {\n clearInterval(intervalHandle)\n reject(new Error('Timeout'))\n }\n }\n }\n const intervalHandle = setInterval(untilInterval, intervalResolution)\n})\n\n/**\n * @param {()=>Promise|boolean} check\n * @param {number} timeout\n * @param {number} intervalResolution\n * @return {Promise}\n */\nexport const untilAsync = async (check, timeout = 0, intervalResolution = 10) => {\n const startTime = time.getUnixTime()\n const noTimeout = timeout <= 0\n // eslint-disable-next-line no-unmodified-loop-condition\n while (noTimeout || time.getUnixTime() - startTime <= timeout) {\n if (await check()) return\n await wait(intervalResolution)\n }\n throw new Error('Timeout')\n}\n\n/**\n * @param {number} timeout\n * @return {Promise}\n */\nexport const wait = timeout => create((resolve, _reject) => setTimeout(resolve, timeout))\n\n/**\n * Checks if an object is a promise using ducktyping.\n *\n * Promises are often polyfilled, so it makes sense to add some additional guarantees if the user of this\n * library has some insane environment where global Promise objects are overwritten.\n *\n * @param {any} p\n * @return {boolean}\n */\nexport const isPromise = p => p instanceof Promise || (p && p.then && p.catch && p.finally)\n", "/**\n * Often used conditions.\n *\n * @module conditions\n */\n\n/**\n * @template T\n * @param {T|null|undefined} v\n * @return {T|null}\n */\n/* c8 ignore next */\nexport const undefinedToNull = v => v === undefined ? null : v\n", "/* eslint-env browser */\n\n/**\n * Isomorphic variable storage.\n *\n * Uses LocalStorage in the browser and falls back to in-memory storage.\n *\n * @module storage\n */\n\n/* c8 ignore start */\nclass VarStoragePolyfill {\n constructor () {\n this.map = new Map()\n }\n\n /**\n * @param {string} key\n * @param {any} newValue\n */\n setItem (key, newValue) {\n this.map.set(key, newValue)\n }\n\n /**\n * @param {string} key\n */\n getItem (key) {\n return this.map.get(key)\n }\n}\n/* c8 ignore stop */\n\n/**\n * @type {any}\n */\nlet _localStorage = new VarStoragePolyfill()\nlet usePolyfill = true\n\n/* c8 ignore start */\ntry {\n // if the same-origin rule is violated, accessing localStorage might thrown an error\n if (typeof localStorage !== 'undefined' && localStorage) {\n _localStorage = localStorage\n usePolyfill = false\n }\n} catch (e) { }\n/* c8 ignore stop */\n\n/**\n * This is basically localStorage in browser, or a polyfill in nodejs\n */\n/* c8 ignore next */\nexport const varStorage = _localStorage\n\n/**\n * A polyfill for `addEventListener('storage', event => {..})` that does nothing if the polyfill is being used.\n *\n * @param {function({ key: string, newValue: string, oldValue: string }): void} eventHandler\n * @function\n */\n/* c8 ignore next */\nexport const onChange = eventHandler => usePolyfill || addEventListener('storage', /** @type {any} */ (eventHandler))\n\n/**\n * A polyfill for `removeEventListener('storage', event => {..})` that does nothing if the polyfill is being used.\n *\n * @param {function({ key: string, newValue: string, oldValue: string }): void} eventHandler\n * @function\n */\n/* c8 ignore next */\nexport const offChange = eventHandler => usePolyfill || removeEventListener('storage', /** @type {any} */ (eventHandler))\n", "/**\n * Isomorphic module to work access the environment (query params, env variables).\n *\n * @module environment\n */\n\nimport * as map from './map.js'\nimport * as string from './string.js'\nimport * as conditions from './conditions.js'\nimport * as storage from './storage.js'\nimport * as f from './function.js'\n\n/* c8 ignore next 2 */\n// @ts-ignore\nexport const isNode = typeof process !== 'undefined' && process.release && /node|io\\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'\n\n/* c8 ignore next */\nexport const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && !isNode\n/* c8 ignore next 3 */\nexport const isMac = typeof navigator !== 'undefined'\n ? /Mac/.test(navigator.platform)\n : false\n\n/**\n * @type {Map}\n */\nlet params\nconst args = []\n\n/* c8 ignore start */\nconst computeParams = () => {\n if (params === undefined) {\n if (isNode) {\n params = map.create()\n const pargs = process.argv\n let currParamName = null\n for (let i = 0; i < pargs.length; i++) {\n const parg = pargs[i]\n if (parg[0] === '-') {\n if (currParamName !== null) {\n params.set(currParamName, '')\n }\n currParamName = parg\n } else {\n if (currParamName !== null) {\n params.set(currParamName, parg)\n currParamName = null\n } else {\n args.push(parg)\n }\n }\n }\n if (currParamName !== null) {\n params.set(currParamName, '')\n }\n // in ReactNative for example this would not be true (unless connected to the Remote Debugger)\n } else if (typeof location === 'object') {\n params = map.create(); // eslint-disable-next-line no-undef\n (location.search || '?').slice(1).split('&').forEach((kv) => {\n if (kv.length !== 0) {\n const [key, value] = kv.split('=')\n params.set(`--${string.fromCamelCase(key, '-')}`, value)\n params.set(`-${string.fromCamelCase(key, '-')}`, value)\n }\n })\n } else {\n params = map.create()\n }\n }\n return params\n}\n/* c8 ignore stop */\n\n/**\n * @param {string} name\n * @return {boolean}\n */\n/* c8 ignore next */\nexport const hasParam = (name) => computeParams().has(name)\n\n/**\n * @param {string} name\n * @param {string} defaultVal\n * @return {string}\n */\n/* c8 ignore next 2 */\nexport const getParam = (name, defaultVal) =>\n computeParams().get(name) || defaultVal\n\n/**\n * @param {string} name\n * @return {string|null}\n */\n/* c8 ignore next 4 */\nexport const getVariable = (name) =>\n isNode\n ? conditions.undefinedToNull(process.env[name.toUpperCase().replaceAll('-', '_')])\n : conditions.undefinedToNull(storage.varStorage.getItem(name))\n\n/**\n * @param {string} name\n * @return {string|null}\n */\n/* c8 ignore next 2 */\nexport const getConf = (name) =>\n computeParams().get('--' + name) || getVariable(name)\n\n/**\n * @param {string} name\n * @return {string}\n */\n/* c8 ignore next 5 */\nexport const ensureConf = (name) => {\n const c = getConf(name)\n if (c == null) throw new Error(`Expected configuration \"${name.toUpperCase().replaceAll('-', '_')}\"`)\n return c\n}\n\n/**\n * @param {string} name\n * @return {boolean}\n */\n/* c8 ignore next 2 */\nexport const hasConf = (name) =>\n hasParam('--' + name) || getVariable(name) !== null\n\n/* c8 ignore next */\nexport const production = hasConf('production')\n\n/* c8 ignore next 2 */\nconst forceColor = isNode &&\n f.isOneOf(process.env.FORCE_COLOR, ['true', '1', '2'])\n\n/* c8 ignore start */\n/**\n * Color is enabled by default if the terminal supports it.\n *\n * Explicitly enable color using `--color` parameter\n * Disable color using `--no-color` parameter or using `NO_COLOR=1` environment variable.\n * `FORCE_COLOR=1` enables color and takes precedence over all.\n */\nexport const supportsColor = forceColor || (\n !hasParam('--no-colors') && // @todo deprecate --no-colors\n !hasConf('no-color') &&\n (!isNode || process.stdout.isTTY) && (\n !isNode ||\n hasParam('--color') ||\n getVariable('COLORTERM') !== null ||\n (getVariable('TERM') || '').includes('color')\n )\n)\n/* c8 ignore stop */\n", "/**\n * Utility functions to work with buffers (Uint8Array).\n *\n * @module buffer\n */\n\nimport * as string from './string.js'\nimport * as env from './environment.js'\nimport * as array from './array.js'\nimport * as math from './math.js'\nimport * as encoding from './encoding.js'\nimport * as decoding from './decoding.js'\n\n/**\n * @param {number} len\n */\nexport const createUint8ArrayFromLen = len => new Uint8Array(len)\n\n/**\n * Create Uint8Array with initial content from buffer\n *\n * @param {ArrayBuffer} buffer\n * @param {number} byteOffset\n * @param {number} length\n */\nexport const createUint8ArrayViewFromArrayBuffer = (buffer, byteOffset, length) => new Uint8Array(buffer, byteOffset, length)\n\n/**\n * Create Uint8Array with initial content from buffer\n *\n * @param {ArrayBuffer} buffer\n */\nexport const createUint8ArrayFromArrayBuffer = buffer => new Uint8Array(buffer)\n\n/* c8 ignore start */\n/**\n * @param {Uint8Array} bytes\n * @return {string}\n */\nconst toBase64Browser = bytes => {\n let s = ''\n for (let i = 0; i < bytes.byteLength; i++) {\n s += string.fromCharCode(bytes[i])\n }\n // eslint-disable-next-line no-undef\n return btoa(s)\n}\n/* c8 ignore stop */\n\n/**\n * @param {Uint8Array} bytes\n * @return {string}\n */\nconst toBase64Node = bytes => Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength).toString('base64')\n\n/* c8 ignore start */\n/**\n * @param {string} s\n * @return {Uint8Array}\n */\nconst fromBase64Browser = s => {\n // eslint-disable-next-line no-undef\n const a = atob(s)\n const bytes = createUint8ArrayFromLen(a.length)\n for (let i = 0; i < a.length; i++) {\n bytes[i] = a.charCodeAt(i)\n }\n return bytes\n}\n/* c8 ignore stop */\n\n/**\n * @param {string} s\n */\nconst fromBase64Node = s => {\n const buf = Buffer.from(s, 'base64')\n return createUint8ArrayViewFromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength)\n}\n\n/* c8 ignore next */\nexport const toBase64 = env.isBrowser ? toBase64Browser : toBase64Node\n\n/* c8 ignore next */\nexport const fromBase64 = env.isBrowser ? fromBase64Browser : fromBase64Node\n\n/**\n * Implements base64url - see https://datatracker.ietf.org/doc/html/rfc4648#section-5\n * @param {Uint8Array} buf\n */\nexport const toBase64UrlEncoded = buf => toBase64(buf).replaceAll('+', '-').replaceAll('/', '_').replaceAll('=', '')\n\n/**\n * @param {string} base64\n */\nexport const fromBase64UrlEncoded = base64 => fromBase64(base64.replaceAll('-', '+').replaceAll('_', '/'))\n\n/**\n * Base64 is always a more efficient choice. This exists for utility purposes only.\n *\n * @param {Uint8Array} buf\n */\nexport const toHexString = buf => array.map(buf, b => b.toString(16).padStart(2, '0')).join('')\n\n/**\n * Note: This function expects that the hex doesn't start with 0x..\n *\n * @param {string} hex\n */\nexport const fromHexString = hex => {\n const hlen = hex.length\n const buf = new Uint8Array(math.ceil(hlen / 2))\n for (let i = 0; i < hlen; i += 2) {\n buf[buf.length - i / 2 - 1] = Number.parseInt(hex.slice(hlen - i - 2, hlen - i), 16)\n }\n return buf\n}\n\n/**\n * Copy the content of an Uint8Array view to a new ArrayBuffer.\n *\n * @param {Uint8Array} uint8Array\n * @return {Uint8Array}\n */\nexport const copyUint8Array = uint8Array => {\n const newBuf = createUint8ArrayFromLen(uint8Array.byteLength)\n newBuf.set(uint8Array)\n return newBuf\n}\n\n/**\n * Encode anything as a UInt8Array. It's a pun on typescripts's `any` type.\n * See encoding.writeAny for more information.\n *\n * @param {any} data\n * @return {Uint8Array}\n */\nexport const encodeAny = data =>\n encoding.encode(encoder => encoding.writeAny(encoder, data))\n\n/**\n * Decode an any-encoded value.\n *\n * @param {Uint8Array} buf\n * @return {any}\n */\nexport const decodeAny = buf => decoding.readAny(decoding.createDecoder(buf))\n\n/**\n * Shift Byte Array {N} bits to the left. Does not expand byte array.\n *\n * @param {Uint8Array} bs\n * @param {number} N should be in the range of [0-7]\n */\nexport const shiftNBitsLeft = (bs, N) => {\n if (N === 0) return bs\n bs = new Uint8Array(bs)\n bs[0] <<= N\n for (let i = 1; i < bs.length; i++) {\n bs[i - 1] |= bs[i] >>> (8 - N)\n bs[i] <<= N\n }\n return bs\n}\n", "/**\n * Working with value pairs.\n *\n * @module pair\n */\n\n/**\n * @template L,R\n */\nexport class Pair {\n /**\n * @param {L} left\n * @param {R} right\n */\n constructor (left, right) {\n this.left = left\n this.right = right\n }\n}\n\n/**\n * @template L,R\n * @param {L} left\n * @param {R} right\n * @return {Pair}\n */\nexport const create = (left, right) => new Pair(left, right)\n\n/**\n * @template L,R\n * @param {R} right\n * @param {L} left\n * @return {Pair}\n */\nexport const createReversed = (right, left) => new Pair(left, right)\n\n/**\n * @template L,R\n * @param {Array>} arr\n * @param {function(L, R):any} f\n */\nexport const forEach = (arr, f) => arr.forEach(p => f(p.left, p.right))\n\n/**\n * @template L,R,X\n * @param {Array>} arr\n * @param {function(L, R):X} f\n * @return {Array}\n */\nexport const map = (arr, f) => arr.map(p => f(p.left, p.right))\n", "/* eslint-env browser */\n\n/**\n * Utility module to work with the DOM.\n *\n * @module dom\n */\n\nimport * as pair from './pair.js'\nimport * as map from './map.js'\n\n/* c8 ignore start */\n/**\n * @type {Document}\n */\nexport const doc = /** @type {Document} */ (typeof document !== 'undefined' ? document : {})\n\n/**\n * @param {string} name\n * @return {HTMLElement}\n */\nexport const createElement = name => doc.createElement(name)\n\n/**\n * @return {DocumentFragment}\n */\nexport const createDocumentFragment = () => doc.createDocumentFragment()\n\n/**\n * @param {string} text\n * @return {Text}\n */\nexport const createTextNode = text => doc.createTextNode(text)\n\nexport const domParser = /** @type {DOMParser} */ (typeof DOMParser !== 'undefined' ? new DOMParser() : null)\n\n/**\n * @param {HTMLElement} el\n * @param {string} name\n * @param {Object} opts\n */\nexport const emitCustomEvent = (el, name, opts) => el.dispatchEvent(new CustomEvent(name, opts))\n\n/**\n * @param {Element} el\n * @param {Array>} attrs Array of key-value pairs\n * @return {Element}\n */\nexport const setAttributes = (el, attrs) => {\n pair.forEach(attrs, (key, value) => {\n if (value === false) {\n el.removeAttribute(key)\n } else if (value === true) {\n el.setAttribute(key, '')\n } else {\n // @ts-ignore\n el.setAttribute(key, value)\n }\n })\n return el\n}\n\n/**\n * @param {Element} el\n * @param {Map} attrs Array of key-value pairs\n * @return {Element}\n */\nexport const setAttributesMap = (el, attrs) => {\n attrs.forEach((value, key) => { el.setAttribute(key, value) })\n return el\n}\n\n/**\n * @param {Array|HTMLCollection} children\n * @return {DocumentFragment}\n */\nexport const fragment = children => {\n const fragment = createDocumentFragment()\n for (let i = 0; i < children.length; i++) {\n appendChild(fragment, children[i])\n }\n return fragment\n}\n\n/**\n * @param {Element} parent\n * @param {Array} nodes\n * @return {Element}\n */\nexport const append = (parent, nodes) => {\n appendChild(parent, fragment(nodes))\n return parent\n}\n\n/**\n * @param {HTMLElement} el\n */\nexport const remove = el => el.remove()\n\n/**\n * @param {EventTarget} el\n * @param {string} name\n * @param {EventListener} f\n */\nexport const addEventListener = (el, name, f) => el.addEventListener(name, f)\n\n/**\n * @param {EventTarget} el\n * @param {string} name\n * @param {EventListener} f\n */\nexport const removeEventListener = (el, name, f) => el.removeEventListener(name, f)\n\n/**\n * @param {Node} node\n * @param {Array>} listeners\n * @return {Node}\n */\nexport const addEventListeners = (node, listeners) => {\n pair.forEach(listeners, (name, f) => addEventListener(node, name, f))\n return node\n}\n\n/**\n * @param {Node} node\n * @param {Array>} listeners\n * @return {Node}\n */\nexport const removeEventListeners = (node, listeners) => {\n pair.forEach(listeners, (name, f) => removeEventListener(node, name, f))\n return node\n}\n\n/**\n * @param {string} name\n * @param {Array|pair.Pair>} attrs Array of key-value pairs\n * @param {Array} children\n * @return {Element}\n */\nexport const element = (name, attrs = [], children = []) =>\n append(setAttributes(createElement(name), attrs), children)\n\n/**\n * @param {number} width\n * @param {number} height\n */\nexport const canvas = (width, height) => {\n const c = /** @type {HTMLCanvasElement} */ (createElement('canvas'))\n c.height = height\n c.width = width\n return c\n}\n\n/**\n * @param {string} t\n * @return {Text}\n */\nexport const text = createTextNode\n\n/**\n * @param {pair.Pair} pair\n */\nexport const pairToStyleString = pair => `${pair.left}:${pair.right};`\n\n/**\n * @param {Array>} pairs\n * @return {string}\n */\nexport const pairsToStyleString = pairs => pairs.map(pairToStyleString).join('')\n\n/**\n * @param {Map} m\n * @return {string}\n */\nexport const mapToStyleString = m => map.map(m, (value, key) => `${key}:${value};`).join('')\n\n/**\n * @todo should always query on a dom element\n *\n * @param {HTMLElement|ShadowRoot} el\n * @param {string} query\n * @return {HTMLElement | null}\n */\nexport const querySelector = (el, query) => el.querySelector(query)\n\n/**\n * @param {HTMLElement|ShadowRoot} el\n * @param {string} query\n * @return {NodeListOf}\n */\nexport const querySelectorAll = (el, query) => el.querySelectorAll(query)\n\n/**\n * @param {string} id\n * @return {HTMLElement}\n */\nexport const getElementById = id => /** @type {HTMLElement} */ (doc.getElementById(id))\n\n/**\n * @param {string} html\n * @return {HTMLElement}\n */\nconst _parse = html => domParser.parseFromString(`${html}`, 'text/html').body\n\n/**\n * @param {string} html\n * @return {DocumentFragment}\n */\nexport const parseFragment = html => fragment(/** @type {any} */ (_parse(html).childNodes))\n\n/**\n * @param {string} html\n * @return {HTMLElement}\n */\nexport const parseElement = html => /** @type HTMLElement */ (_parse(html).firstElementChild)\n\n/**\n * @param {HTMLElement} oldEl\n * @param {HTMLElement|DocumentFragment} newEl\n */\nexport const replaceWith = (oldEl, newEl) => oldEl.replaceWith(newEl)\n\n/**\n * @param {HTMLElement} parent\n * @param {HTMLElement} el\n * @param {Node|null} ref\n * @return {HTMLElement}\n */\nexport const insertBefore = (parent, el, ref) => parent.insertBefore(el, ref)\n\n/**\n * @param {Node} parent\n * @param {Node} child\n * @return {Node}\n */\nexport const appendChild = (parent, child) => parent.appendChild(child)\n\nexport const ELEMENT_NODE = doc.ELEMENT_NODE\nexport const TEXT_NODE = doc.TEXT_NODE\nexport const CDATA_SECTION_NODE = doc.CDATA_SECTION_NODE\nexport const COMMENT_NODE = doc.COMMENT_NODE\nexport const DOCUMENT_NODE = doc.DOCUMENT_NODE\nexport const DOCUMENT_TYPE_NODE = doc.DOCUMENT_TYPE_NODE\nexport const DOCUMENT_FRAGMENT_NODE = doc.DOCUMENT_FRAGMENT_NODE\n\n/**\n * @param {any} node\n * @param {number} type\n */\nexport const checkNodeType = (node, type) => node.nodeType === type\n\n/**\n * @param {Node} parent\n * @param {HTMLElement} child\n */\nexport const isParentOf = (parent, child) => {\n let p = child.parentNode\n while (p && p !== parent) {\n p = p.parentNode\n }\n return p === parent\n}\n/* c8 ignore stop */\n", "/**\n * JSON utility functions.\n *\n * @module json\n */\n\n/**\n * Transform JavaScript object to JSON.\n *\n * @param {any} object\n * @return {string}\n */\nexport const stringify = JSON.stringify\n\n/**\n * Parse JSON object.\n *\n * @param {string} json\n * @return {any}\n */\nexport const parse = JSON.parse\n", "/**\n * Utility module to work with EcmaScript Symbols.\n *\n * @module symbol\n */\n\n/**\n * Return fresh symbol.\n *\n * @return {Symbol}\n */\nexport const create = Symbol\n\n/**\n * @param {any} s\n * @return {boolean}\n */\nexport const isSymbol = s => typeof s === 'symbol'\n", "import * as symbol from './symbol.js'\nimport * as time from './time.js'\nimport * as env from './environment.js'\nimport * as func from './function.js'\nimport * as json from './json.js'\n\nexport const BOLD = symbol.create()\nexport const UNBOLD = symbol.create()\nexport const BLUE = symbol.create()\nexport const GREY = symbol.create()\nexport const GREEN = symbol.create()\nexport const RED = symbol.create()\nexport const PURPLE = symbol.create()\nexport const ORANGE = symbol.create()\nexport const UNCOLOR = symbol.create()\n\n/* c8 ignore start */\n/**\n * @param {Array} args\n * @return {Array}\n */\nexport const computeNoColorLoggingArgs = args => {\n if (args.length === 1 && args[0]?.constructor === Function) {\n args = /** @type {Array} */ (/** @type {[function]} */ (args)[0]())\n }\n const strBuilder = []\n const logArgs = []\n // try with formatting until we find something unsupported\n let i = 0\n for (; i < args.length; i++) {\n const arg = args[i]\n if (arg === undefined) {\n break\n } else if (arg.constructor === String || arg.constructor === Number) {\n strBuilder.push(arg)\n } else if (arg.constructor === Object) {\n break\n }\n }\n if (i > 0) {\n // create logArgs with what we have so far\n logArgs.push(strBuilder.join(''))\n }\n // append the rest\n for (; i < args.length; i++) {\n const arg = args[i]\n if (!(arg instanceof Symbol)) {\n logArgs.push(arg)\n }\n }\n return logArgs\n}\n/* c8 ignore stop */\n\nconst loggingColors = [GREEN, PURPLE, ORANGE, BLUE]\nlet nextColor = 0\nlet lastLoggingTime = time.getUnixTime()\n\n/* c8 ignore start */\n/**\n * @param {function(...any):void} _print\n * @param {string} moduleName\n * @return {function(...any):void}\n */\nexport const createModuleLogger = (_print, moduleName) => {\n const color = loggingColors[nextColor]\n const debugRegexVar = env.getVariable('log')\n const doLogging = debugRegexVar !== null &&\n (debugRegexVar === '*' || debugRegexVar === 'true' ||\n new RegExp(debugRegexVar, 'gi').test(moduleName))\n nextColor = (nextColor + 1) % loggingColors.length\n moduleName += ': '\n return !doLogging\n ? func.nop\n : (...args) => {\n if (args.length === 1 && args[0]?.constructor === Function) {\n args = args[0]()\n }\n const timeNow = time.getUnixTime()\n const timeDiff = timeNow - lastLoggingTime\n lastLoggingTime = timeNow\n _print(\n color,\n moduleName,\n UNCOLOR,\n ...args.map((arg) => {\n if (arg != null && arg.constructor === Uint8Array) {\n arg = Array.from(arg)\n }\n const t = typeof arg\n switch (t) {\n case 'string':\n case 'symbol':\n return arg\n default: {\n return json.stringify(arg)\n }\n }\n }),\n color,\n ' +' + timeDiff + 'ms'\n )\n }\n}\n/* c8 ignore stop */\n", "/**\n * Isomorphic logging module with support for colors!\n *\n * @module logging\n */\n\nimport * as env from './environment.js'\nimport * as set from './set.js'\nimport * as pair from './pair.js'\nimport * as dom from './dom.js'\nimport * as json from './json.js'\nimport * as map from './map.js'\nimport * as eventloop from './eventloop.js'\nimport * as math from './math.js'\nimport * as common from './logging.common.js'\n\nexport { BOLD, UNBOLD, BLUE, GREY, GREEN, RED, PURPLE, ORANGE, UNCOLOR } from './logging.common.js'\n\n/**\n * @type {Object>}\n */\nconst _browserStyleMap = {\n [common.BOLD]: pair.create('font-weight', 'bold'),\n [common.UNBOLD]: pair.create('font-weight', 'normal'),\n [common.BLUE]: pair.create('color', 'blue'),\n [common.GREEN]: pair.create('color', 'green'),\n [common.GREY]: pair.create('color', 'grey'),\n [common.RED]: pair.create('color', 'red'),\n [common.PURPLE]: pair.create('color', 'purple'),\n [common.ORANGE]: pair.create('color', 'orange'), // not well supported in chrome when debugging node with inspector - TODO: deprecate\n [common.UNCOLOR]: pair.create('color', 'black')\n}\n\n/**\n * @param {Array} args\n * @return {Array}\n */\n/* c8 ignore start */\nconst computeBrowserLoggingArgs = (args) => {\n if (args.length === 1 && args[0]?.constructor === Function) {\n args = /** @type {Array} */ (/** @type {[function]} */ (args)[0]())\n }\n const strBuilder = []\n const styles = []\n const currentStyle = map.create()\n /**\n * @type {Array}\n */\n let logArgs = []\n // try with formatting until we find something unsupported\n let i = 0\n for (; i < args.length; i++) {\n const arg = args[i]\n // @ts-ignore\n const style = _browserStyleMap[arg]\n if (style !== undefined) {\n currentStyle.set(style.left, style.right)\n } else {\n if (arg === undefined) {\n break\n }\n if (arg.constructor === String || arg.constructor === Number) {\n const style = dom.mapToStyleString(currentStyle)\n if (i > 0 || style.length > 0) {\n strBuilder.push('%c' + arg)\n styles.push(style)\n } else {\n strBuilder.push(arg)\n }\n } else {\n break\n }\n }\n }\n if (i > 0) {\n // create logArgs with what we have so far\n logArgs = styles\n logArgs.unshift(strBuilder.join(''))\n }\n // append the rest\n for (; i < args.length; i++) {\n const arg = args[i]\n if (!(arg instanceof Symbol)) {\n logArgs.push(arg)\n }\n }\n return logArgs\n}\n/* c8 ignore stop */\n\n/* c8 ignore start */\nconst computeLoggingArgs = env.supportsColor\n ? computeBrowserLoggingArgs\n : common.computeNoColorLoggingArgs\n/* c8 ignore stop */\n\n/**\n * @param {Array} args\n */\nexport const print = (...args) => {\n console.log(...computeLoggingArgs(args))\n /* c8 ignore next */\n vconsoles.forEach((vc) => vc.print(args))\n}\n\n/* c8 ignore start */\n/**\n * @param {Array} args\n */\nexport const warn = (...args) => {\n console.warn(...computeLoggingArgs(args))\n args.unshift(common.ORANGE)\n vconsoles.forEach((vc) => vc.print(args))\n}\n/* c8 ignore stop */\n\n/**\n * @param {Error} err\n */\n/* c8 ignore start */\nexport const printError = (err) => {\n console.error(err)\n vconsoles.forEach((vc) => vc.printError(err))\n}\n/* c8 ignore stop */\n\n/**\n * @param {string} url image location\n * @param {number} height height of the image in pixel\n */\n/* c8 ignore start */\nexport const printImg = (url, height) => {\n if (env.isBrowser) {\n console.log(\n '%c ',\n `font-size: ${height}px; background-size: contain; background-repeat: no-repeat; background-image: url(${url})`\n )\n // console.log('%c ', `font-size: ${height}x; background: url(${url}) no-repeat;`)\n }\n vconsoles.forEach((vc) => vc.printImg(url, height))\n}\n/* c8 ignore stop */\n\n/**\n * @param {string} base64\n * @param {number} height\n */\n/* c8 ignore next 2 */\nexport const printImgBase64 = (base64, height) =>\n printImg(`data:image/gif;base64,${base64}`, height)\n\n/**\n * @param {Array} args\n */\nexport const group = (...args) => {\n console.group(...computeLoggingArgs(args))\n /* c8 ignore next */\n vconsoles.forEach((vc) => vc.group(args))\n}\n\n/**\n * @param {Array} args\n */\nexport const groupCollapsed = (...args) => {\n console.groupCollapsed(...computeLoggingArgs(args))\n /* c8 ignore next */\n vconsoles.forEach((vc) => vc.groupCollapsed(args))\n}\n\nexport const groupEnd = () => {\n console.groupEnd()\n /* c8 ignore next */\n vconsoles.forEach((vc) => vc.groupEnd())\n}\n\n/**\n * @param {function():Node} createNode\n */\n/* c8 ignore next 2 */\nexport const printDom = (createNode) =>\n vconsoles.forEach((vc) => vc.printDom(createNode()))\n\n/**\n * @param {HTMLCanvasElement} canvas\n * @param {number} height\n */\n/* c8 ignore next 2 */\nexport const printCanvas = (canvas, height) =>\n printImg(canvas.toDataURL(), height)\n\nexport const vconsoles = set.create()\n\n/**\n * @param {Array} args\n * @return {Array}\n */\n/* c8 ignore start */\nconst _computeLineSpans = (args) => {\n const spans = []\n const currentStyle = new Map()\n // try with formatting until we find something unsupported\n let i = 0\n for (; i < args.length; i++) {\n let arg = args[i]\n // @ts-ignore\n const style = _browserStyleMap[arg]\n if (style !== undefined) {\n currentStyle.set(style.left, style.right)\n } else {\n if (arg === undefined) {\n arg = 'undefined '\n }\n if (arg.constructor === String || arg.constructor === Number) {\n // @ts-ignore\n const span = dom.element('span', [\n pair.create('style', dom.mapToStyleString(currentStyle))\n ], [dom.text(arg.toString())])\n if (span.innerHTML === '') {\n span.innerHTML = ' '\n }\n spans.push(span)\n } else {\n break\n }\n }\n }\n // append the rest\n for (; i < args.length; i++) {\n let content = args[i]\n if (!(content instanceof Symbol)) {\n if (content.constructor !== String && content.constructor !== Number) {\n content = ' ' + json.stringify(content) + ' '\n }\n spans.push(\n dom.element('span', [], [dom.text(/** @type {string} */ (content))])\n )\n }\n }\n return spans\n}\n/* c8 ignore stop */\n\nconst lineStyle =\n 'font-family:monospace;border-bottom:1px solid #e2e2e2;padding:2px;'\n\n/* c8 ignore start */\nexport class VConsole {\n /**\n * @param {Element} dom\n */\n constructor (dom) {\n this.dom = dom\n /**\n * @type {Element}\n */\n this.ccontainer = this.dom\n this.depth = 0\n vconsoles.add(this)\n }\n\n /**\n * @param {Array} args\n * @param {boolean} collapsed\n */\n group (args, collapsed = false) {\n eventloop.enqueue(() => {\n const triangleDown = dom.element('span', [\n pair.create('hidden', collapsed),\n pair.create('style', 'color:grey;font-size:120%;')\n ], [dom.text('\u25BC')])\n const triangleRight = dom.element('span', [\n pair.create('hidden', !collapsed),\n pair.create('style', 'color:grey;font-size:125%;')\n ], [dom.text('\u25B6')])\n const content = dom.element(\n 'div',\n [pair.create(\n 'style',\n `${lineStyle};padding-left:${this.depth * 10}px`\n )],\n [triangleDown, triangleRight, dom.text(' ')].concat(\n _computeLineSpans(args)\n )\n )\n const nextContainer = dom.element('div', [\n pair.create('hidden', collapsed)\n ])\n const nextLine = dom.element('div', [], [content, nextContainer])\n dom.append(this.ccontainer, [nextLine])\n this.ccontainer = nextContainer\n this.depth++\n // when header is clicked, collapse/uncollapse container\n dom.addEventListener(content, 'click', (_event) => {\n nextContainer.toggleAttribute('hidden')\n triangleDown.toggleAttribute('hidden')\n triangleRight.toggleAttribute('hidden')\n })\n })\n }\n\n /**\n * @param {Array} args\n */\n groupCollapsed (args) {\n this.group(args, true)\n }\n\n groupEnd () {\n eventloop.enqueue(() => {\n if (this.depth > 0) {\n this.depth--\n // @ts-ignore\n this.ccontainer = this.ccontainer.parentElement.parentElement\n }\n })\n }\n\n /**\n * @param {Array} args\n */\n print (args) {\n eventloop.enqueue(() => {\n dom.append(this.ccontainer, [\n dom.element('div', [\n pair.create(\n 'style',\n `${lineStyle};padding-left:${this.depth * 10}px`\n )\n ], _computeLineSpans(args))\n ])\n })\n }\n\n /**\n * @param {Error} err\n */\n printError (err) {\n this.print([common.RED, common.BOLD, err.toString()])\n }\n\n /**\n * @param {string} url\n * @param {number} height\n */\n printImg (url, height) {\n eventloop.enqueue(() => {\n dom.append(this.ccontainer, [\n dom.element('img', [\n pair.create('src', url),\n pair.create('height', `${math.round(height * 1.5)}px`)\n ])\n ])\n })\n }\n\n /**\n * @param {Node} node\n */\n printDom (node) {\n eventloop.enqueue(() => {\n dom.append(this.ccontainer, [node])\n })\n }\n\n destroy () {\n eventloop.enqueue(() => {\n vconsoles.delete(this)\n })\n }\n}\n/* c8 ignore stop */\n\n/**\n * @param {Element} dom\n */\n/* c8 ignore next */\nexport const createVConsole = (dom) => new VConsole(dom)\n\n/**\n * @param {string} moduleName\n * @return {function(...any):void}\n */\nexport const createModuleLogger = (moduleName) => common.createModuleLogger(print, moduleName)\n", "/**\n * Utility module to create and manipulate Iterators.\n *\n * @module iterator\n */\n\n/**\n * @template T,R\n * @param {Iterator} iterator\n * @param {function(T):R} f\n * @return {IterableIterator}\n */\nexport const mapIterator = (iterator, f) => ({\n [Symbol.iterator] () {\n return this\n },\n // @ts-ignore\n next () {\n const r = iterator.next()\n return { value: r.done ? undefined : f(r.value), done: r.done }\n }\n})\n\n/**\n * @template T\n * @param {function():IteratorResult} next\n * @return {IterableIterator}\n */\nexport const createIterator = next => ({\n /**\n * @return {IterableIterator}\n */\n [Symbol.iterator] () {\n return this\n },\n // @ts-ignore\n next\n})\n\n/**\n * @template T\n * @param {Iterator} iterator\n * @param {function(T):boolean} filter\n */\nexport const iteratorFilter = (iterator, filter) => createIterator(() => {\n let res\n do {\n res = iterator.next()\n } while (!res.done && !filter(res.value))\n return res\n})\n\n/**\n * @template T,M\n * @param {Iterator} iterator\n * @param {function(T):M} fmap\n */\nexport const iteratorMap = (iterator, fmap) => createIterator(() => {\n const { done, value } = iterator.next()\n return { done, value: done ? undefined : fmap(value) }\n})\n", "import { ObservableV2 } from 'lib0/observable'\n\nimport {\n Doc // eslint-disable-line\n} from '../internals.js'\n\n/**\n * This is an abstract interface that all Connectors should implement to keep them interchangeable.\n *\n * @note This interface is experimental and it is not advised to actually inherit this class.\n * It just serves as typing information.\n *\n * @extends {ObservableV2}\n */\nexport class AbstractConnector extends ObservableV2 {\n /**\n * @param {Doc} ydoc\n * @param {any} awareness\n */\n constructor (ydoc, awareness) {\n super()\n this.doc = ydoc\n this.awareness = awareness\n }\n}\n", "import {\n findIndexSS,\n getState,\n splitItem,\n iterateStructs,\n UpdateEncoderV2,\n DSDecoderV1, DSEncoderV1, DSDecoderV2, DSEncoderV2, Item, GC, StructStore, Transaction, ID // eslint-disable-line\n} from '../internals.js'\n\nimport * as array from 'lib0/array'\nimport * as math from 'lib0/math'\nimport * as map from 'lib0/map'\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\n\nexport class DeleteItem {\n /**\n * @param {number} clock\n * @param {number} len\n */\n constructor (clock, len) {\n /**\n * @type {number}\n */\n this.clock = clock\n /**\n * @type {number}\n */\n this.len = len\n }\n}\n\n/**\n * We no longer maintain a DeleteStore. DeleteSet is a temporary object that is created when needed.\n * - When created in a transaction, it must only be accessed after sorting, and merging\n * - This DeleteSet is send to other clients\n * - We do not create a DeleteSet when we send a sync message. The DeleteSet message is created directly from StructStore\n * - We read a DeleteSet as part of a sync/update message. In this case the DeleteSet is already sorted and merged.\n */\nexport class DeleteSet {\n constructor () {\n /**\n * @type {Map>}\n */\n this.clients = new Map()\n }\n}\n\n/**\n * Iterate over all structs that the DeleteSet gc's.\n *\n * @param {Transaction} transaction\n * @param {DeleteSet} ds\n * @param {function(GC|Item):void} f\n *\n * @function\n */\nexport const iterateDeletedStructs = (transaction, ds, f) =>\n ds.clients.forEach((deletes, clientid) => {\n const structs = /** @type {Array} */ (transaction.doc.store.clients.get(clientid))\n for (let i = 0; i < deletes.length; i++) {\n const del = deletes[i]\n iterateStructs(transaction, structs, del.clock, del.len, f)\n }\n })\n\n/**\n * @param {Array} dis\n * @param {number} clock\n * @return {number|null}\n *\n * @private\n * @function\n */\nexport const findIndexDS = (dis, clock) => {\n let left = 0\n let right = dis.length - 1\n while (left <= right) {\n const midindex = math.floor((left + right) / 2)\n const mid = dis[midindex]\n const midclock = mid.clock\n if (midclock <= clock) {\n if (clock < midclock + mid.len) {\n return midindex\n }\n left = midindex + 1\n } else {\n right = midindex - 1\n }\n }\n return null\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {ID} id\n * @return {boolean}\n *\n * @private\n * @function\n */\nexport const isDeleted = (ds, id) => {\n const dis = ds.clients.get(id.client)\n return dis !== undefined && findIndexDS(dis, id.clock) !== null\n}\n\n/**\n * @param {DeleteSet} ds\n *\n * @private\n * @function\n */\nexport const sortAndMergeDeleteSet = ds => {\n ds.clients.forEach(dels => {\n dels.sort((a, b) => a.clock - b.clock)\n // merge items without filtering or splicing the array\n // i is the current pointer\n // j refers to the current insert position for the pointed item\n // try to merge dels[i] into dels[j-1] or set dels[j]=dels[i]\n let i, j\n for (i = 1, j = 1; i < dels.length; i++) {\n const left = dels[j - 1]\n const right = dels[i]\n if (left.clock + left.len >= right.clock) {\n left.len = math.max(left.len, right.clock + right.len - left.clock)\n } else {\n if (j < i) {\n dels[j] = right\n }\n j++\n }\n }\n dels.length = j\n })\n}\n\n/**\n * @param {Array} dss\n * @return {DeleteSet} A fresh DeleteSet\n */\nexport const mergeDeleteSets = dss => {\n const merged = new DeleteSet()\n for (let dssI = 0; dssI < dss.length; dssI++) {\n dss[dssI].clients.forEach((delsLeft, client) => {\n if (!merged.clients.has(client)) {\n // Write all missing keys from current ds and all following.\n // If merged already contains `client` current ds has already been added.\n /**\n * @type {Array}\n */\n const dels = delsLeft.slice()\n for (let i = dssI + 1; i < dss.length; i++) {\n array.appendTo(dels, dss[i].clients.get(client) || [])\n }\n merged.clients.set(client, dels)\n }\n })\n }\n sortAndMergeDeleteSet(merged)\n return merged\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {number} client\n * @param {number} clock\n * @param {number} length\n *\n * @private\n * @function\n */\nexport const addToDeleteSet = (ds, client, clock, length) => {\n map.setIfUndefined(ds.clients, client, () => /** @type {Array} */ ([])).push(new DeleteItem(clock, length))\n}\n\nexport const createDeleteSet = () => new DeleteSet()\n\n/**\n * @param {StructStore} ss\n * @return {DeleteSet} Merged and sorted DeleteSet\n *\n * @private\n * @function\n */\nexport const createDeleteSetFromStructStore = ss => {\n const ds = createDeleteSet()\n ss.clients.forEach((structs, client) => {\n /**\n * @type {Array}\n */\n const dsitems = []\n for (let i = 0; i < structs.length; i++) {\n const struct = structs[i]\n if (struct.deleted) {\n const clock = struct.id.clock\n let len = struct.length\n if (i + 1 < structs.length) {\n for (let next = structs[i + 1]; i + 1 < structs.length && next.deleted; next = structs[++i + 1]) {\n len += next.length\n }\n }\n dsitems.push(new DeleteItem(clock, len))\n }\n }\n if (dsitems.length > 0) {\n ds.clients.set(client, dsitems)\n }\n })\n return ds\n}\n\n/**\n * @param {DSEncoderV1 | DSEncoderV2} encoder\n * @param {DeleteSet} ds\n *\n * @private\n * @function\n */\nexport const writeDeleteSet = (encoder, ds) => {\n encoding.writeVarUint(encoder.restEncoder, ds.clients.size)\n\n // Ensure that the delete set is written in a deterministic order\n array.from(ds.clients.entries())\n .sort((a, b) => b[0] - a[0])\n .forEach(([client, dsitems]) => {\n encoder.resetDsCurVal()\n encoding.writeVarUint(encoder.restEncoder, client)\n const len = dsitems.length\n encoding.writeVarUint(encoder.restEncoder, len)\n for (let i = 0; i < len; i++) {\n const item = dsitems[i]\n encoder.writeDsClock(item.clock)\n encoder.writeDsLen(item.len)\n }\n })\n}\n\n/**\n * @param {DSDecoderV1 | DSDecoderV2} decoder\n * @return {DeleteSet}\n *\n * @private\n * @function\n */\nexport const readDeleteSet = decoder => {\n const ds = new DeleteSet()\n const numClients = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numClients; i++) {\n decoder.resetDsCurVal()\n const client = decoding.readVarUint(decoder.restDecoder)\n const numberOfDeletes = decoding.readVarUint(decoder.restDecoder)\n if (numberOfDeletes > 0) {\n const dsField = map.setIfUndefined(ds.clients, client, () => /** @type {Array} */ ([]))\n for (let i = 0; i < numberOfDeletes; i++) {\n dsField.push(new DeleteItem(decoder.readDsClock(), decoder.readDsLen()))\n }\n }\n }\n return ds\n}\n\n/**\n * @todo YDecoder also contains references to String and other Decoders. Would make sense to exchange YDecoder.toUint8Array for YDecoder.DsToUint8Array()..\n */\n\n/**\n * @param {DSDecoderV1 | DSDecoderV2} decoder\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @return {Uint8Array|null} Returns a v2 update containing all deletes that couldn't be applied yet; or null if all deletes were applied successfully.\n *\n * @private\n * @function\n */\nexport const readAndApplyDeleteSet = (decoder, transaction, store) => {\n const unappliedDS = new DeleteSet()\n const numClients = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numClients; i++) {\n decoder.resetDsCurVal()\n const client = decoding.readVarUint(decoder.restDecoder)\n const numberOfDeletes = decoding.readVarUint(decoder.restDecoder)\n const structs = store.clients.get(client) || []\n const state = getState(store, client)\n for (let i = 0; i < numberOfDeletes; i++) {\n const clock = decoder.readDsClock()\n const clockEnd = clock + decoder.readDsLen()\n if (clock < state) {\n if (state < clockEnd) {\n addToDeleteSet(unappliedDS, client, state, clockEnd - state)\n }\n let index = findIndexSS(structs, clock)\n /**\n * We can ignore the case of GC and Delete structs, because we are going to skip them\n * @type {Item}\n */\n // @ts-ignore\n let struct = structs[index]\n // split the first item if necessary\n if (!struct.deleted && struct.id.clock < clock) {\n structs.splice(index + 1, 0, splitItem(transaction, struct, clock - struct.id.clock))\n index++ // increase we now want to use the next struct\n }\n while (index < structs.length) {\n // @ts-ignore\n struct = structs[index++]\n if (struct.id.clock < clockEnd) {\n if (!struct.deleted) {\n if (clockEnd < struct.id.clock + struct.length) {\n structs.splice(index, 0, splitItem(transaction, struct, clockEnd - struct.id.clock))\n }\n struct.delete(transaction)\n }\n } else {\n break\n }\n }\n } else {\n addToDeleteSet(unappliedDS, client, clock, clockEnd - clock)\n }\n }\n }\n if (unappliedDS.clients.size > 0) {\n const ds = new UpdateEncoderV2()\n encoding.writeVarUint(ds.restEncoder, 0) // encode 0 structs\n writeDeleteSet(ds, unappliedDS)\n return ds.toUint8Array()\n }\n return null\n}\n\n/**\n * @param {DeleteSet} ds1\n * @param {DeleteSet} ds2\n */\nexport const equalDeleteSets = (ds1, ds2) => {\n if (ds1.clients.size !== ds2.clients.size) return false\n for (const [client, deleteItems1] of ds1.clients.entries()) {\n const deleteItems2 = /** @type {Array} */ (ds2.clients.get(client))\n if (deleteItems2 === undefined || deleteItems1.length !== deleteItems2.length) return false\n for (let i = 0; i < deleteItems1.length; i++) {\n const di1 = deleteItems1[i]\n const di2 = deleteItems2[i]\n if (di1.clock !== di2.clock || di1.len !== di2.len) {\n return false\n }\n }\n }\n return true\n}\n", "/**\n * @module Y\n */\n\nimport {\n StructStore,\n AbstractType,\n YArray,\n YText,\n YMap,\n YXmlElement,\n YXmlFragment,\n transact,\n ContentDoc, Item, Transaction, YEvent // eslint-disable-line\n} from '../internals.js'\n\nimport { ObservableV2 } from 'lib0/observable'\nimport * as random from 'lib0/random'\nimport * as map from 'lib0/map'\nimport * as array from 'lib0/array'\nimport * as promise from 'lib0/promise'\n\nexport const generateNewClientId = random.uint32\n\n/**\n * @typedef {Object} DocOpts\n * @property {boolean} [DocOpts.gc=true] Disable garbage collection (default: gc=true)\n * @property {function(Item):boolean} [DocOpts.gcFilter] Will be called before an Item is garbage collected. Return false to keep the Item.\n * @property {string} [DocOpts.guid] Define a globally unique identifier for this document\n * @property {string | null} [DocOpts.collectionid] Associate this document with a collection. This only plays a role if your provider has a concept of collection.\n * @property {any} [DocOpts.meta] Any kind of meta information you want to associate with this document. If this is a subdocument, remote peers will store the meta information as well.\n * @property {boolean} [DocOpts.autoLoad] If a subdocument, automatically load document. If this is a subdocument, remote peers will load the document as well automatically.\n * @property {boolean} [DocOpts.shouldLoad] Whether the document should be synced by the provider now. This is toggled to true when you call ydoc.load()\n */\n\n/**\n * @typedef {Object} DocEvents\n * @property {function(Doc):void} DocEvents.destroy\n * @property {function(Doc):void} DocEvents.load\n * @property {function(boolean, Doc):void} DocEvents.sync\n * @property {function(Uint8Array, any, Doc, Transaction):void} DocEvents.update\n * @property {function(Uint8Array, any, Doc, Transaction):void} DocEvents.updateV2\n * @property {function(Doc):void} DocEvents.beforeAllTransactions\n * @property {function(Transaction, Doc):void} DocEvents.beforeTransaction\n * @property {function(Transaction, Doc):void} DocEvents.beforeObserverCalls\n * @property {function(Transaction, Doc):void} DocEvents.afterTransaction\n * @property {function(Transaction, Doc):void} DocEvents.afterTransactionCleanup\n * @property {function(Doc, Array):void} DocEvents.afterAllTransactions\n * @property {function({ loaded: Set, added: Set, removed: Set }, Doc, Transaction):void} DocEvents.subdocs\n */\n\n/**\n * A Yjs instance handles the state of shared data.\n * @extends ObservableV2\n */\nexport class Doc extends ObservableV2 {\n /**\n * @param {DocOpts} opts configuration\n */\n constructor ({ guid = random.uuidv4(), collectionid = null, gc = true, gcFilter = () => true, meta = null, autoLoad = false, shouldLoad = true } = {}) {\n super()\n this.gc = gc\n this.gcFilter = gcFilter\n this.clientID = generateNewClientId()\n this.guid = guid\n this.collectionid = collectionid\n /**\n * @type {Map>>}\n */\n this.share = new Map()\n this.store = new StructStore()\n /**\n * @type {Transaction | null}\n */\n this._transaction = null\n /**\n * @type {Array}\n */\n this._transactionCleanups = []\n /**\n * @type {Set}\n */\n this.subdocs = new Set()\n /**\n * If this document is a subdocument - a document integrated into another document - then _item is defined.\n * @type {Item?}\n */\n this._item = null\n this.shouldLoad = shouldLoad\n this.autoLoad = autoLoad\n this.meta = meta\n /**\n * This is set to true when the persistence provider loaded the document from the database or when the `sync` event fires.\n * Note that not all providers implement this feature. Provider authors are encouraged to fire the `load` event when the doc content is loaded from the database.\n *\n * @type {boolean}\n */\n this.isLoaded = false\n /**\n * This is set to true when the connection provider has successfully synced with a backend.\n * Note that when using peer-to-peer providers this event may not provide very useful.\n * Also note that not all providers implement this feature. Provider authors are encouraged to fire\n * the `sync` event when the doc has been synced (with `true` as a parameter) or if connection is\n * lost (with false as a parameter).\n */\n this.isSynced = false\n this.isDestroyed = false\n /**\n * Promise that resolves once the document has been loaded from a presistence provider.\n */\n this.whenLoaded = promise.create(resolve => {\n this.on('load', () => {\n this.isLoaded = true\n resolve(this)\n })\n })\n const provideSyncedPromise = () => promise.create(resolve => {\n /**\n * @param {boolean} isSynced\n */\n const eventHandler = (isSynced) => {\n if (isSynced === undefined || isSynced === true) {\n this.off('sync', eventHandler)\n resolve()\n }\n }\n this.on('sync', eventHandler)\n })\n this.on('sync', isSynced => {\n if (isSynced === false && this.isSynced) {\n this.whenSynced = provideSyncedPromise()\n }\n this.isSynced = isSynced === undefined || isSynced === true\n if (this.isSynced && !this.isLoaded) {\n this.emit('load', [this])\n }\n })\n /**\n * Promise that resolves once the document has been synced with a backend.\n * This promise is recreated when the connection is lost.\n * Note the documentation about the `isSynced` property.\n */\n this.whenSynced = provideSyncedPromise()\n }\n\n /**\n * Notify the parent document that you request to load data into this subdocument (if it is a subdocument).\n *\n * `load()` might be used in the future to request any provider to load the most current data.\n *\n * It is safe to call `load()` multiple times.\n */\n load () {\n const item = this._item\n if (item !== null && !this.shouldLoad) {\n transact(/** @type {any} */ (item.parent).doc, transaction => {\n transaction.subdocsLoaded.add(this)\n }, null, true)\n }\n this.shouldLoad = true\n }\n\n getSubdocs () {\n return this.subdocs\n }\n\n getSubdocGuids () {\n return new Set(array.from(this.subdocs).map(doc => doc.guid))\n }\n\n /**\n * Changes that happen inside of a transaction are bundled. This means that\n * the observer fires _after_ the transaction is finished and that all changes\n * that happened inside of the transaction are sent as one message to the\n * other peers.\n *\n * @template T\n * @param {function(Transaction):T} f The function that should be executed as a transaction\n * @param {any} [origin] Origin of who started the transaction. Will be stored on transaction.origin\n * @return T\n *\n * @public\n */\n transact (f, origin = null) {\n return transact(this, f, origin)\n }\n\n /**\n * Define a shared data type.\n *\n * Multiple calls of `ydoc.get(name, TypeConstructor)` yield the same result\n * and do not overwrite each other. I.e.\n * `ydoc.get(name, Y.Array) === ydoc.get(name, Y.Array)`\n *\n * After this method is called, the type is also available on `ydoc.share.get(name)`.\n *\n * *Best Practices:*\n * Define all types right after the Y.Doc instance is created and store them in a separate object.\n * Also use the typed methods `getText(name)`, `getArray(name)`, ..\n *\n * @template {typeof AbstractType} Type\n * @example\n * const ydoc = new Y.Doc(..)\n * const appState = {\n * document: ydoc.getText('document')\n * comments: ydoc.getArray('comments')\n * }\n *\n * @param {string} name\n * @param {Type} TypeConstructor The constructor of the type definition. E.g. Y.Text, Y.Array, Y.Map, ...\n * @return {InstanceType} The created type. Constructed with TypeConstructor\n *\n * @public\n */\n get (name, TypeConstructor = /** @type {any} */ (AbstractType)) {\n const type = map.setIfUndefined(this.share, name, () => {\n // @ts-ignore\n const t = new TypeConstructor()\n t._integrate(this, null)\n return t\n })\n const Constr = type.constructor\n if (TypeConstructor !== AbstractType && Constr !== TypeConstructor) {\n if (Constr === AbstractType) {\n // @ts-ignore\n const t = new TypeConstructor()\n t._map = type._map\n type._map.forEach(/** @param {Item?} n */ n => {\n for (; n !== null; n = n.left) {\n // @ts-ignore\n n.parent = t\n }\n })\n t._start = type._start\n for (let n = t._start; n !== null; n = n.right) {\n n.parent = t\n }\n t._length = type._length\n this.share.set(name, t)\n t._integrate(this, null)\n return /** @type {InstanceType} */ (t)\n } else {\n throw new Error(`Type with the name ${name} has already been defined with a different constructor`)\n }\n }\n return /** @type {InstanceType} */ (type)\n }\n\n /**\n * @template T\n * @param {string} [name]\n * @return {YArray}\n *\n * @public\n */\n getArray (name = '') {\n return /** @type {YArray} */ (this.get(name, YArray))\n }\n\n /**\n * @param {string} [name]\n * @return {YText}\n *\n * @public\n */\n getText (name = '') {\n return this.get(name, YText)\n }\n\n /**\n * @template T\n * @param {string} [name]\n * @return {YMap}\n *\n * @public\n */\n getMap (name = '') {\n return /** @type {YMap} */ (this.get(name, YMap))\n }\n\n /**\n * @param {string} [name]\n * @return {YXmlElement}\n *\n * @public\n */\n getXmlElement (name = '') {\n return /** @type {YXmlElement<{[key:string]:string}>} */ (this.get(name, YXmlElement))\n }\n\n /**\n * @param {string} [name]\n * @return {YXmlFragment}\n *\n * @public\n */\n getXmlFragment (name = '') {\n return this.get(name, YXmlFragment)\n }\n\n /**\n * Converts the entire document into a js object, recursively traversing each yjs type\n * Doesn't log types that have not been defined (using ydoc.getType(..)).\n *\n * @deprecated Do not use this method and rather call toJSON directly on the shared types.\n *\n * @return {Object}\n */\n toJSON () {\n /**\n * @type {Object}\n */\n const doc = {}\n\n this.share.forEach((value, key) => {\n doc[key] = value.toJSON()\n })\n\n return doc\n }\n\n /**\n * Emit `destroy` event and unregister all event handlers.\n */\n destroy () {\n this.isDestroyed = true\n array.from(this.subdocs).forEach(subdoc => subdoc.destroy())\n const item = this._item\n if (item !== null) {\n this._item = null\n const content = /** @type {ContentDoc} */ (item.content)\n content.doc = new Doc({ guid: this.guid, ...content.opts, shouldLoad: false })\n content.doc._item = item\n transact(/** @type {any} */ (item).parent.doc, transaction => {\n const doc = content.doc\n if (!item.deleted) {\n transaction.subdocsAdded.add(doc)\n }\n transaction.subdocsRemoved.add(this)\n }, null, true)\n }\n // @ts-ignore\n this.emit('destroyed', [true]) // DEPRECATED!\n this.emit('destroy', [this])\n super.destroy()\n }\n}\n", "import * as buffer from 'lib0/buffer'\nimport * as decoding from 'lib0/decoding'\nimport {\n ID, createID\n} from '../internals.js'\n\nexport class DSDecoderV1 {\n /**\n * @param {decoding.Decoder} decoder\n */\n constructor (decoder) {\n this.restDecoder = decoder\n }\n\n resetDsCurVal () {\n // nop\n }\n\n /**\n * @return {number}\n */\n readDsClock () {\n return decoding.readVarUint(this.restDecoder)\n }\n\n /**\n * @return {number}\n */\n readDsLen () {\n return decoding.readVarUint(this.restDecoder)\n }\n}\n\nexport class UpdateDecoderV1 extends DSDecoderV1 {\n /**\n * @return {ID}\n */\n readLeftID () {\n return createID(decoding.readVarUint(this.restDecoder), decoding.readVarUint(this.restDecoder))\n }\n\n /**\n * @return {ID}\n */\n readRightID () {\n return createID(decoding.readVarUint(this.restDecoder), decoding.readVarUint(this.restDecoder))\n }\n\n /**\n * Read the next client id.\n * Use this in favor of readID whenever possible to reduce the number of objects created.\n */\n readClient () {\n return decoding.readVarUint(this.restDecoder)\n }\n\n /**\n * @return {number} info An unsigned 8-bit integer\n */\n readInfo () {\n return decoding.readUint8(this.restDecoder)\n }\n\n /**\n * @return {string}\n */\n readString () {\n return decoding.readVarString(this.restDecoder)\n }\n\n /**\n * @return {boolean} isKey\n */\n readParentInfo () {\n return decoding.readVarUint(this.restDecoder) === 1\n }\n\n /**\n * @return {number} info An unsigned 8-bit integer\n */\n readTypeRef () {\n return decoding.readVarUint(this.restDecoder)\n }\n\n /**\n * Write len of a struct - well suited for Opt RLE encoder.\n *\n * @return {number} len\n */\n readLen () {\n return decoding.readVarUint(this.restDecoder)\n }\n\n /**\n * @return {any}\n */\n readAny () {\n return decoding.readAny(this.restDecoder)\n }\n\n /**\n * @return {Uint8Array}\n */\n readBuf () {\n return buffer.copyUint8Array(decoding.readVarUint8Array(this.restDecoder))\n }\n\n /**\n * Legacy implementation uses JSON parse. We use any-decoding in v2.\n *\n * @return {any}\n */\n readJSON () {\n return JSON.parse(decoding.readVarString(this.restDecoder))\n }\n\n /**\n * @return {string}\n */\n readKey () {\n return decoding.readVarString(this.restDecoder)\n }\n}\n\nexport class DSDecoderV2 {\n /**\n * @param {decoding.Decoder} decoder\n */\n constructor (decoder) {\n /**\n * @private\n */\n this.dsCurrVal = 0\n this.restDecoder = decoder\n }\n\n resetDsCurVal () {\n this.dsCurrVal = 0\n }\n\n /**\n * @return {number}\n */\n readDsClock () {\n this.dsCurrVal += decoding.readVarUint(this.restDecoder)\n return this.dsCurrVal\n }\n\n /**\n * @return {number}\n */\n readDsLen () {\n const diff = decoding.readVarUint(this.restDecoder) + 1\n this.dsCurrVal += diff\n return diff\n }\n}\n\nexport class UpdateDecoderV2 extends DSDecoderV2 {\n /**\n * @param {decoding.Decoder} decoder\n */\n constructor (decoder) {\n super(decoder)\n /**\n * List of cached keys. If the keys[id] does not exist, we read a new key\n * from stringEncoder and push it to keys.\n *\n * @type {Array}\n */\n this.keys = []\n decoding.readVarUint(decoder) // read feature flag - currently unused\n this.keyClockDecoder = new decoding.IntDiffOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.clientDecoder = new decoding.UintOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.leftClockDecoder = new decoding.IntDiffOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.rightClockDecoder = new decoding.IntDiffOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.infoDecoder = new decoding.RleDecoder(decoding.readVarUint8Array(decoder), decoding.readUint8)\n this.stringDecoder = new decoding.StringDecoder(decoding.readVarUint8Array(decoder))\n this.parentInfoDecoder = new decoding.RleDecoder(decoding.readVarUint8Array(decoder), decoding.readUint8)\n this.typeRefDecoder = new decoding.UintOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.lenDecoder = new decoding.UintOptRleDecoder(decoding.readVarUint8Array(decoder))\n }\n\n /**\n * @return {ID}\n */\n readLeftID () {\n return new ID(this.clientDecoder.read(), this.leftClockDecoder.read())\n }\n\n /**\n * @return {ID}\n */\n readRightID () {\n return new ID(this.clientDecoder.read(), this.rightClockDecoder.read())\n }\n\n /**\n * Read the next client id.\n * Use this in favor of readID whenever possible to reduce the number of objects created.\n */\n readClient () {\n return this.clientDecoder.read()\n }\n\n /**\n * @return {number} info An unsigned 8-bit integer\n */\n readInfo () {\n return /** @type {number} */ (this.infoDecoder.read())\n }\n\n /**\n * @return {string}\n */\n readString () {\n return this.stringDecoder.read()\n }\n\n /**\n * @return {boolean}\n */\n readParentInfo () {\n return this.parentInfoDecoder.read() === 1\n }\n\n /**\n * @return {number} An unsigned 8-bit integer\n */\n readTypeRef () {\n return this.typeRefDecoder.read()\n }\n\n /**\n * Write len of a struct - well suited for Opt RLE encoder.\n *\n * @return {number}\n */\n readLen () {\n return this.lenDecoder.read()\n }\n\n /**\n * @return {any}\n */\n readAny () {\n return decoding.readAny(this.restDecoder)\n }\n\n /**\n * @return {Uint8Array}\n */\n readBuf () {\n return decoding.readVarUint8Array(this.restDecoder)\n }\n\n /**\n * This is mainly here for legacy purposes.\n *\n * Initial we incoded objects using JSON. Now we use the much faster lib0/any-encoder. This method mainly exists for legacy purposes for the v1 encoder.\n *\n * @return {any}\n */\n readJSON () {\n return decoding.readAny(this.restDecoder)\n }\n\n /**\n * @return {string}\n */\n readKey () {\n const keyClock = this.keyClockDecoder.read()\n if (keyClock < this.keys.length) {\n return this.keys[keyClock]\n } else {\n const key = this.stringDecoder.read()\n this.keys.push(key)\n return key\n }\n }\n}\n", "import * as error from 'lib0/error'\nimport * as encoding from 'lib0/encoding'\n\nimport {\n ID // eslint-disable-line\n} from '../internals.js'\n\nexport class DSEncoderV1 {\n constructor () {\n this.restEncoder = encoding.createEncoder()\n }\n\n toUint8Array () {\n return encoding.toUint8Array(this.restEncoder)\n }\n\n resetDsCurVal () {\n // nop\n }\n\n /**\n * @param {number} clock\n */\n writeDsClock (clock) {\n encoding.writeVarUint(this.restEncoder, clock)\n }\n\n /**\n * @param {number} len\n */\n writeDsLen (len) {\n encoding.writeVarUint(this.restEncoder, len)\n }\n}\n\nexport class UpdateEncoderV1 extends DSEncoderV1 {\n /**\n * @param {ID} id\n */\n writeLeftID (id) {\n encoding.writeVarUint(this.restEncoder, id.client)\n encoding.writeVarUint(this.restEncoder, id.clock)\n }\n\n /**\n * @param {ID} id\n */\n writeRightID (id) {\n encoding.writeVarUint(this.restEncoder, id.client)\n encoding.writeVarUint(this.restEncoder, id.clock)\n }\n\n /**\n * Use writeClient and writeClock instead of writeID if possible.\n * @param {number} client\n */\n writeClient (client) {\n encoding.writeVarUint(this.restEncoder, client)\n }\n\n /**\n * @param {number} info An unsigned 8-bit integer\n */\n writeInfo (info) {\n encoding.writeUint8(this.restEncoder, info)\n }\n\n /**\n * @param {string} s\n */\n writeString (s) {\n encoding.writeVarString(this.restEncoder, s)\n }\n\n /**\n * @param {boolean} isYKey\n */\n writeParentInfo (isYKey) {\n encoding.writeVarUint(this.restEncoder, isYKey ? 1 : 0)\n }\n\n /**\n * @param {number} info An unsigned 8-bit integer\n */\n writeTypeRef (info) {\n encoding.writeVarUint(this.restEncoder, info)\n }\n\n /**\n * Write len of a struct - well suited for Opt RLE encoder.\n *\n * @param {number} len\n */\n writeLen (len) {\n encoding.writeVarUint(this.restEncoder, len)\n }\n\n /**\n * @param {any} any\n */\n writeAny (any) {\n encoding.writeAny(this.restEncoder, any)\n }\n\n /**\n * @param {Uint8Array} buf\n */\n writeBuf (buf) {\n encoding.writeVarUint8Array(this.restEncoder, buf)\n }\n\n /**\n * @param {any} embed\n */\n writeJSON (embed) {\n encoding.writeVarString(this.restEncoder, JSON.stringify(embed))\n }\n\n /**\n * @param {string} key\n */\n writeKey (key) {\n encoding.writeVarString(this.restEncoder, key)\n }\n}\n\nexport class DSEncoderV2 {\n constructor () {\n this.restEncoder = encoding.createEncoder() // encodes all the rest / non-optimized\n this.dsCurrVal = 0\n }\n\n toUint8Array () {\n return encoding.toUint8Array(this.restEncoder)\n }\n\n resetDsCurVal () {\n this.dsCurrVal = 0\n }\n\n /**\n * @param {number} clock\n */\n writeDsClock (clock) {\n const diff = clock - this.dsCurrVal\n this.dsCurrVal = clock\n encoding.writeVarUint(this.restEncoder, diff)\n }\n\n /**\n * @param {number} len\n */\n writeDsLen (len) {\n if (len === 0) {\n error.unexpectedCase()\n }\n encoding.writeVarUint(this.restEncoder, len - 1)\n this.dsCurrVal += len\n }\n}\n\nexport class UpdateEncoderV2 extends DSEncoderV2 {\n constructor () {\n super()\n /**\n * @type {Map}\n */\n this.keyMap = new Map()\n /**\n * Refers to the next uniqe key-identifier to me used.\n * See writeKey method for more information.\n *\n * @type {number}\n */\n this.keyClock = 0\n this.keyClockEncoder = new encoding.IntDiffOptRleEncoder()\n this.clientEncoder = new encoding.UintOptRleEncoder()\n this.leftClockEncoder = new encoding.IntDiffOptRleEncoder()\n this.rightClockEncoder = new encoding.IntDiffOptRleEncoder()\n this.infoEncoder = new encoding.RleEncoder(encoding.writeUint8)\n this.stringEncoder = new encoding.StringEncoder()\n this.parentInfoEncoder = new encoding.RleEncoder(encoding.writeUint8)\n this.typeRefEncoder = new encoding.UintOptRleEncoder()\n this.lenEncoder = new encoding.UintOptRleEncoder()\n }\n\n toUint8Array () {\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, 0) // this is a feature flag that we might use in the future\n encoding.writeVarUint8Array(encoder, this.keyClockEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, this.clientEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, this.leftClockEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, this.rightClockEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, encoding.toUint8Array(this.infoEncoder))\n encoding.writeVarUint8Array(encoder, this.stringEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, encoding.toUint8Array(this.parentInfoEncoder))\n encoding.writeVarUint8Array(encoder, this.typeRefEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, this.lenEncoder.toUint8Array())\n // @note The rest encoder is appended! (note the missing var)\n encoding.writeUint8Array(encoder, encoding.toUint8Array(this.restEncoder))\n return encoding.toUint8Array(encoder)\n }\n\n /**\n * @param {ID} id\n */\n writeLeftID (id) {\n this.clientEncoder.write(id.client)\n this.leftClockEncoder.write(id.clock)\n }\n\n /**\n * @param {ID} id\n */\n writeRightID (id) {\n this.clientEncoder.write(id.client)\n this.rightClockEncoder.write(id.clock)\n }\n\n /**\n * @param {number} client\n */\n writeClient (client) {\n this.clientEncoder.write(client)\n }\n\n /**\n * @param {number} info An unsigned 8-bit integer\n */\n writeInfo (info) {\n this.infoEncoder.write(info)\n }\n\n /**\n * @param {string} s\n */\n writeString (s) {\n this.stringEncoder.write(s)\n }\n\n /**\n * @param {boolean} isYKey\n */\n writeParentInfo (isYKey) {\n this.parentInfoEncoder.write(isYKey ? 1 : 0)\n }\n\n /**\n * @param {number} info An unsigned 8-bit integer\n */\n writeTypeRef (info) {\n this.typeRefEncoder.write(info)\n }\n\n /**\n * Write len of a struct - well suited for Opt RLE encoder.\n *\n * @param {number} len\n */\n writeLen (len) {\n this.lenEncoder.write(len)\n }\n\n /**\n * @param {any} any\n */\n writeAny (any) {\n encoding.writeAny(this.restEncoder, any)\n }\n\n /**\n * @param {Uint8Array} buf\n */\n writeBuf (buf) {\n encoding.writeVarUint8Array(this.restEncoder, buf)\n }\n\n /**\n * This is mainly here for legacy purposes.\n *\n * Initial we incoded objects using JSON. Now we use the much faster lib0/any-encoder. This method mainly exists for legacy purposes for the v1 encoder.\n *\n * @param {any} embed\n */\n writeJSON (embed) {\n encoding.writeAny(this.restEncoder, embed)\n }\n\n /**\n * Property keys are often reused. For example, in y-prosemirror the key `bold` might\n * occur very often. For a 3d application, the key `position` might occur very often.\n *\n * We cache these keys in a Map and refer to them via a unique number.\n *\n * @param {string} key\n */\n writeKey (key) {\n const clock = this.keyMap.get(key)\n if (clock === undefined) {\n /**\n * @todo uncomment to introduce this feature finally\n *\n * Background. The ContentFormat object was always encoded using writeKey, but the decoder used to use readString.\n * Furthermore, I forgot to set the keyclock. So everything was working fine.\n *\n * However, this feature here is basically useless as it is not being used (it actually only consumes extra memory).\n *\n * I don't know yet how to reintroduce this feature..\n *\n * Older clients won't be able to read updates when we reintroduce this feature. So this should probably be done using a flag.\n *\n */\n // this.keyMap.set(key, this.keyClock)\n this.keyClockEncoder.write(this.keyClock++)\n this.stringEncoder.write(key)\n } else {\n this.keyClockEncoder.write(clock)\n }\n }\n}\n", "/**\n * @module encoding\n */\n/*\n * We use the first five bits in the info flag for determining the type of the struct.\n *\n * 0: GC\n * 1: Item with Deleted content\n * 2: Item with JSON content\n * 3: Item with Binary content\n * 4: Item with String content\n * 5: Item with Embed content (for richtext content)\n * 6: Item with Format content (a formatting marker for richtext content)\n * 7: Item with Type\n */\n\nimport {\n findIndexSS,\n getState,\n createID,\n getStateVector,\n readAndApplyDeleteSet,\n writeDeleteSet,\n createDeleteSetFromStructStore,\n transact,\n readItemContent,\n UpdateDecoderV1,\n UpdateDecoderV2,\n UpdateEncoderV1,\n UpdateEncoderV2,\n DSEncoderV2,\n DSDecoderV1,\n DSEncoderV1,\n mergeUpdates,\n mergeUpdatesV2,\n Skip,\n diffUpdateV2,\n convertUpdateFormatV2ToV1,\n DSDecoderV2, Doc, Transaction, GC, Item, StructStore // eslint-disable-line\n} from '../internals.js'\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as binary from 'lib0/binary'\nimport * as map from 'lib0/map'\nimport * as math from 'lib0/math'\nimport * as array from 'lib0/array'\n\n/**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {Array} structs All structs by `client`\n * @param {number} client\n * @param {number} clock write structs starting with `ID(client,clock)`\n *\n * @function\n */\nconst writeStructs = (encoder, structs, client, clock) => {\n // write first id\n clock = math.max(clock, structs[0].id.clock) // make sure the first id exists\n const startNewStructs = findIndexSS(structs, clock)\n // write # encoded structs\n encoding.writeVarUint(encoder.restEncoder, structs.length - startNewStructs)\n encoder.writeClient(client)\n encoding.writeVarUint(encoder.restEncoder, clock)\n const firstStruct = structs[startNewStructs]\n // write first struct with an offset\n firstStruct.write(encoder, clock - firstStruct.id.clock)\n for (let i = startNewStructs + 1; i < structs.length; i++) {\n structs[i].write(encoder, 0)\n }\n}\n\n/**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {StructStore} store\n * @param {Map} _sm\n *\n * @private\n * @function\n */\nexport const writeClientsStructs = (encoder, store, _sm) => {\n // we filter all valid _sm entries into sm\n const sm = new Map()\n _sm.forEach((clock, client) => {\n // only write if new structs are available\n if (getState(store, client) > clock) {\n sm.set(client, clock)\n }\n })\n getStateVector(store).forEach((_clock, client) => {\n if (!_sm.has(client)) {\n sm.set(client, 0)\n }\n })\n // write # states that were updated\n encoding.writeVarUint(encoder.restEncoder, sm.size)\n // Write items with higher client ids first\n // This heavily improves the conflict algorithm.\n array.from(sm.entries()).sort((a, b) => b[0] - a[0]).forEach(([client, clock]) => {\n writeStructs(encoder, /** @type {Array} */ (store.clients.get(client)), client, clock)\n })\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder The decoder object to read data from.\n * @param {Doc} doc\n * @return {Map }>}\n *\n * @private\n * @function\n */\nexport const readClientsStructRefs = (decoder, doc) => {\n /**\n * @type {Map }>}\n */\n const clientRefs = map.create()\n const numOfStateUpdates = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numOfStateUpdates; i++) {\n const numberOfStructs = decoding.readVarUint(decoder.restDecoder)\n /**\n * @type {Array}\n */\n const refs = new Array(numberOfStructs)\n const client = decoder.readClient()\n let clock = decoding.readVarUint(decoder.restDecoder)\n // const start = performance.now()\n clientRefs.set(client, { i: 0, refs })\n for (let i = 0; i < numberOfStructs; i++) {\n const info = decoder.readInfo()\n switch (binary.BITS5 & info) {\n case 0: { // GC\n const len = decoder.readLen()\n refs[i] = new GC(createID(client, clock), len)\n clock += len\n break\n }\n case 10: { // Skip Struct (nothing to apply)\n // @todo we could reduce the amount of checks by adding Skip struct to clientRefs so we know that something is missing.\n const len = decoding.readVarUint(decoder.restDecoder)\n refs[i] = new Skip(createID(client, clock), len)\n clock += len\n break\n }\n default: { // Item with content\n /**\n * The optimized implementation doesn't use any variables because inlining variables is faster.\n * Below a non-optimized version is shown that implements the basic algorithm with\n * a few comments\n */\n const cantCopyParentInfo = (info & (binary.BIT7 | binary.BIT8)) === 0\n // If parent = null and neither left nor right are defined, then we know that `parent` is child of `y`\n // and we read the next string as parentYKey.\n // It indicates how we store/retrieve parent from `y.share`\n // @type {string|null}\n const struct = new Item(\n createID(client, clock),\n null, // left\n (info & binary.BIT8) === binary.BIT8 ? decoder.readLeftID() : null, // origin\n null, // right\n (info & binary.BIT7) === binary.BIT7 ? decoder.readRightID() : null, // right origin\n cantCopyParentInfo ? (decoder.readParentInfo() ? doc.get(decoder.readString()) : decoder.readLeftID()) : null, // parent\n cantCopyParentInfo && (info & binary.BIT6) === binary.BIT6 ? decoder.readString() : null, // parentSub\n readItemContent(decoder, info) // item content\n )\n /* A non-optimized implementation of the above algorithm:\n\n // The item that was originally to the left of this item.\n const origin = (info & binary.BIT8) === binary.BIT8 ? decoder.readLeftID() : null\n // The item that was originally to the right of this item.\n const rightOrigin = (info & binary.BIT7) === binary.BIT7 ? decoder.readRightID() : null\n const cantCopyParentInfo = (info & (binary.BIT7 | binary.BIT8)) === 0\n const hasParentYKey = cantCopyParentInfo ? decoder.readParentInfo() : false\n // If parent = null and neither left nor right are defined, then we know that `parent` is child of `y`\n // and we read the next string as parentYKey.\n // It indicates how we store/retrieve parent from `y.share`\n // @type {string|null}\n const parentYKey = cantCopyParentInfo && hasParentYKey ? decoder.readString() : null\n\n const struct = new Item(\n createID(client, clock),\n null, // left\n origin, // origin\n null, // right\n rightOrigin, // right origin\n cantCopyParentInfo && !hasParentYKey ? decoder.readLeftID() : (parentYKey !== null ? doc.get(parentYKey) : null), // parent\n cantCopyParentInfo && (info & binary.BIT6) === binary.BIT6 ? decoder.readString() : null, // parentSub\n readItemContent(decoder, info) // item content\n )\n */\n refs[i] = struct\n clock += struct.length\n }\n }\n }\n // console.log('time to read: ', performance.now() - start) // @todo remove\n }\n return clientRefs\n}\n\n/**\n * Resume computing structs generated by struct readers.\n *\n * While there is something to do, we integrate structs in this order\n * 1. top element on stack, if stack is not empty\n * 2. next element from current struct reader (if empty, use next struct reader)\n *\n * If struct causally depends on another struct (ref.missing), we put next reader of\n * `ref.id.client` on top of stack.\n *\n * At some point we find a struct that has no causal dependencies,\n * then we start emptying the stack.\n *\n * It is not possible to have circles: i.e. struct1 (from client1) depends on struct2 (from client2)\n * depends on struct3 (from client1). Therefore the max stack size is eqaul to `structReaders.length`.\n *\n * This method is implemented in a way so that we can resume computation if this update\n * causally depends on another update.\n *\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @param {Map} clientsStructRefs\n * @return { null | { update: Uint8Array, missing: Map } }\n *\n * @private\n * @function\n */\nconst integrateStructs = (transaction, store, clientsStructRefs) => {\n /**\n * @type {Array}\n */\n const stack = []\n // sort them so that we take the higher id first, in case of conflicts the lower id will probably not conflict with the id from the higher user.\n let clientsStructRefsIds = array.from(clientsStructRefs.keys()).sort((a, b) => a - b)\n if (clientsStructRefsIds.length === 0) {\n return null\n }\n const getNextStructTarget = () => {\n if (clientsStructRefsIds.length === 0) {\n return null\n }\n let nextStructsTarget = /** @type {{i:number,refs:Array}} */ (clientsStructRefs.get(clientsStructRefsIds[clientsStructRefsIds.length - 1]))\n while (nextStructsTarget.refs.length === nextStructsTarget.i) {\n clientsStructRefsIds.pop()\n if (clientsStructRefsIds.length > 0) {\n nextStructsTarget = /** @type {{i:number,refs:Array}} */ (clientsStructRefs.get(clientsStructRefsIds[clientsStructRefsIds.length - 1]))\n } else {\n return null\n }\n }\n return nextStructsTarget\n }\n let curStructsTarget = getNextStructTarget()\n if (curStructsTarget === null) {\n return null\n }\n\n /**\n * @type {StructStore}\n */\n const restStructs = new StructStore()\n const missingSV = new Map()\n /**\n * @param {number} client\n * @param {number} clock\n */\n const updateMissingSv = (client, clock) => {\n const mclock = missingSV.get(client)\n if (mclock == null || mclock > clock) {\n missingSV.set(client, clock)\n }\n }\n /**\n * @type {GC|Item}\n */\n let stackHead = /** @type {any} */ (curStructsTarget).refs[/** @type {any} */ (curStructsTarget).i++]\n // caching the state because it is used very often\n const state = new Map()\n\n const addStackToRestSS = () => {\n for (const item of stack) {\n const client = item.id.client\n const unapplicableItems = clientsStructRefs.get(client)\n if (unapplicableItems) {\n // decrement because we weren't able to apply previous operation\n unapplicableItems.i--\n restStructs.clients.set(client, unapplicableItems.refs.slice(unapplicableItems.i))\n clientsStructRefs.delete(client)\n unapplicableItems.i = 0\n unapplicableItems.refs = []\n } else {\n // item was the last item on clientsStructRefs and the field was already cleared. Add item to restStructs and continue\n restStructs.clients.set(client, [item])\n }\n // remove client from clientsStructRefsIds to prevent users from applying the same update again\n clientsStructRefsIds = clientsStructRefsIds.filter(c => c !== client)\n }\n stack.length = 0\n }\n\n // iterate over all struct readers until we are done\n while (true) {\n if (stackHead.constructor !== Skip) {\n const localClock = map.setIfUndefined(state, stackHead.id.client, () => getState(store, stackHead.id.client))\n const offset = localClock - stackHead.id.clock\n if (offset < 0) {\n // update from the same client is missing\n stack.push(stackHead)\n updateMissingSv(stackHead.id.client, stackHead.id.clock - 1)\n // hid a dead wall, add all items from stack to restSS\n addStackToRestSS()\n } else {\n const missing = stackHead.getMissing(transaction, store)\n if (missing !== null) {\n stack.push(stackHead)\n // get the struct reader that has the missing struct\n /**\n * @type {{ refs: Array, i: number }}\n */\n const structRefs = clientsStructRefs.get(/** @type {number} */ (missing)) || { refs: [], i: 0 }\n if (structRefs.refs.length === structRefs.i) {\n // This update message causally depends on another update message that doesn't exist yet\n updateMissingSv(/** @type {number} */ (missing), getState(store, missing))\n addStackToRestSS()\n } else {\n stackHead = structRefs.refs[structRefs.i++]\n continue\n }\n } else if (offset === 0 || offset < stackHead.length) {\n // all fine, apply the stackhead\n stackHead.integrate(transaction, offset)\n state.set(stackHead.id.client, stackHead.id.clock + stackHead.length)\n }\n }\n }\n // iterate to next stackHead\n if (stack.length > 0) {\n stackHead = /** @type {GC|Item} */ (stack.pop())\n } else if (curStructsTarget !== null && curStructsTarget.i < curStructsTarget.refs.length) {\n stackHead = /** @type {GC|Item} */ (curStructsTarget.refs[curStructsTarget.i++])\n } else {\n curStructsTarget = getNextStructTarget()\n if (curStructsTarget === null) {\n // we are done!\n break\n } else {\n stackHead = /** @type {GC|Item} */ (curStructsTarget.refs[curStructsTarget.i++])\n }\n }\n }\n if (restStructs.clients.size > 0) {\n const encoder = new UpdateEncoderV2()\n writeClientsStructs(encoder, restStructs, new Map())\n // write empty deleteset\n // writeDeleteSet(encoder, new DeleteSet())\n encoding.writeVarUint(encoder.restEncoder, 0) // => no need for an extra function call, just write 0 deletes\n return { missing: missingSV, update: encoder.toUint8Array() }\n }\n return null\n}\n\n/**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {Transaction} transaction\n *\n * @private\n * @function\n */\nexport const writeStructsFromTransaction = (encoder, transaction) => writeClientsStructs(encoder, transaction.doc.store, transaction.beforeState)\n\n/**\n * Read and apply a document update.\n *\n * This function has the same effect as `applyUpdate` but accepts a decoder.\n *\n * @param {decoding.Decoder} decoder\n * @param {Doc} ydoc\n * @param {any} [transactionOrigin] This will be stored on `transaction.origin` and `.on('update', (update, origin))`\n * @param {UpdateDecoderV1 | UpdateDecoderV2} [structDecoder]\n *\n * @function\n */\nexport const readUpdateV2 = (decoder, ydoc, transactionOrigin, structDecoder = new UpdateDecoderV2(decoder)) =>\n transact(ydoc, transaction => {\n // force that transaction.local is set to non-local\n transaction.local = false\n let retry = false\n const doc = transaction.doc\n const store = doc.store\n // let start = performance.now()\n const ss = readClientsStructRefs(structDecoder, doc)\n // console.log('time to read structs: ', performance.now() - start) // @todo remove\n // start = performance.now()\n // console.log('time to merge: ', performance.now() - start) // @todo remove\n // start = performance.now()\n const restStructs = integrateStructs(transaction, store, ss)\n const pending = store.pendingStructs\n if (pending) {\n // check if we can apply something\n for (const [client, clock] of pending.missing) {\n if (clock < getState(store, client)) {\n retry = true\n break\n }\n }\n if (restStructs) {\n // merge restStructs into store.pending\n for (const [client, clock] of restStructs.missing) {\n const mclock = pending.missing.get(client)\n if (mclock == null || mclock > clock) {\n pending.missing.set(client, clock)\n }\n }\n pending.update = mergeUpdatesV2([pending.update, restStructs.update])\n }\n } else {\n store.pendingStructs = restStructs\n }\n // console.log('time to integrate: ', performance.now() - start) // @todo remove\n // start = performance.now()\n const dsRest = readAndApplyDeleteSet(structDecoder, transaction, store)\n if (store.pendingDs) {\n // @todo we could make a lower-bound state-vector check as we do above\n const pendingDSUpdate = new UpdateDecoderV2(decoding.createDecoder(store.pendingDs))\n decoding.readVarUint(pendingDSUpdate.restDecoder) // read 0 structs, because we only encode deletes in pendingdsupdate\n const dsRest2 = readAndApplyDeleteSet(pendingDSUpdate, transaction, store)\n if (dsRest && dsRest2) {\n // case 1: ds1 != null && ds2 != null\n store.pendingDs = mergeUpdatesV2([dsRest, dsRest2])\n } else {\n // case 2: ds1 != null\n // case 3: ds2 != null\n // case 4: ds1 == null && ds2 == null\n store.pendingDs = dsRest || dsRest2\n }\n } else {\n // Either dsRest == null && pendingDs == null OR dsRest != null\n store.pendingDs = dsRest\n }\n // console.log('time to cleanup: ', performance.now() - start) // @todo remove\n // start = performance.now()\n\n // console.log('time to resume delete readers: ', performance.now() - start) // @todo remove\n // start = performance.now()\n if (retry) {\n const update = /** @type {{update: Uint8Array}} */ (store.pendingStructs).update\n store.pendingStructs = null\n applyUpdateV2(transaction.doc, update)\n }\n }, transactionOrigin, false)\n\n/**\n * Read and apply a document update.\n *\n * This function has the same effect as `applyUpdate` but accepts a decoder.\n *\n * @param {decoding.Decoder} decoder\n * @param {Doc} ydoc\n * @param {any} [transactionOrigin] This will be stored on `transaction.origin` and `.on('update', (update, origin))`\n *\n * @function\n */\nexport const readUpdate = (decoder, ydoc, transactionOrigin) => readUpdateV2(decoder, ydoc, transactionOrigin, new UpdateDecoderV1(decoder))\n\n/**\n * Apply a document update created by, for example, `y.on('update', update => ..)` or `update = encodeStateAsUpdate()`.\n *\n * This function has the same effect as `readUpdate` but accepts an Uint8Array instead of a Decoder.\n *\n * @param {Doc} ydoc\n * @param {Uint8Array} update\n * @param {any} [transactionOrigin] This will be stored on `transaction.origin` and `.on('update', (update, origin))`\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} [YDecoder]\n *\n * @function\n */\nexport const applyUpdateV2 = (ydoc, update, transactionOrigin, YDecoder = UpdateDecoderV2) => {\n const decoder = decoding.createDecoder(update)\n readUpdateV2(decoder, ydoc, transactionOrigin, new YDecoder(decoder))\n}\n\n/**\n * Apply a document update created by, for example, `y.on('update', update => ..)` or `update = encodeStateAsUpdate()`.\n *\n * This function has the same effect as `readUpdate` but accepts an Uint8Array instead of a Decoder.\n *\n * @param {Doc} ydoc\n * @param {Uint8Array} update\n * @param {any} [transactionOrigin] This will be stored on `transaction.origin` and `.on('update', (update, origin))`\n *\n * @function\n */\nexport const applyUpdate = (ydoc, update, transactionOrigin) => applyUpdateV2(ydoc, update, transactionOrigin, UpdateDecoderV1)\n\n/**\n * Write all the document as a single update message. If you specify the state of the remote client (`targetStateVector`) it will\n * only write the operations that are missing.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {Doc} doc\n * @param {Map} [targetStateVector] The state of the target that receives the update. Leave empty to write all known structs\n *\n * @function\n */\nexport const writeStateAsUpdate = (encoder, doc, targetStateVector = new Map()) => {\n writeClientsStructs(encoder, doc.store, targetStateVector)\n writeDeleteSet(encoder, createDeleteSetFromStructStore(doc.store))\n}\n\n/**\n * Write all the document as a single update message that can be applied on the remote document. If you specify the state of the remote client (`targetState`) it will\n * only write the operations that are missing.\n *\n * Use `writeStateAsUpdate` instead if you are working with lib0/encoding.js#Encoder\n *\n * @param {Doc} doc\n * @param {Uint8Array} [encodedTargetStateVector] The state of the target that receives the update. Leave empty to write all known structs\n * @param {UpdateEncoderV1 | UpdateEncoderV2} [encoder]\n * @return {Uint8Array}\n *\n * @function\n */\nexport const encodeStateAsUpdateV2 = (doc, encodedTargetStateVector = new Uint8Array([0]), encoder = new UpdateEncoderV2()) => {\n const targetStateVector = decodeStateVector(encodedTargetStateVector)\n writeStateAsUpdate(encoder, doc, targetStateVector)\n const updates = [encoder.toUint8Array()]\n // also add the pending updates (if there are any)\n if (doc.store.pendingDs) {\n updates.push(doc.store.pendingDs)\n }\n if (doc.store.pendingStructs) {\n updates.push(diffUpdateV2(doc.store.pendingStructs.update, encodedTargetStateVector))\n }\n if (updates.length > 1) {\n if (encoder.constructor === UpdateEncoderV1) {\n return mergeUpdates(updates.map((update, i) => i === 0 ? update : convertUpdateFormatV2ToV1(update)))\n } else if (encoder.constructor === UpdateEncoderV2) {\n return mergeUpdatesV2(updates)\n }\n }\n return updates[0]\n}\n\n/**\n * Write all the document as a single update message that can be applied on the remote document. If you specify the state of the remote client (`targetState`) it will\n * only write the operations that are missing.\n *\n * Use `writeStateAsUpdate` instead if you are working with lib0/encoding.js#Encoder\n *\n * @param {Doc} doc\n * @param {Uint8Array} [encodedTargetStateVector] The state of the target that receives the update. Leave empty to write all known structs\n * @return {Uint8Array}\n *\n * @function\n */\nexport const encodeStateAsUpdate = (doc, encodedTargetStateVector) => encodeStateAsUpdateV2(doc, encodedTargetStateVector, new UpdateEncoderV1())\n\n/**\n * Read state vector from Decoder and return as Map\n *\n * @param {DSDecoderV1 | DSDecoderV2} decoder\n * @return {Map} Maps `client` to the number next expected `clock` from that client.\n *\n * @function\n */\nexport const readStateVector = decoder => {\n const ss = new Map()\n const ssLength = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < ssLength; i++) {\n const client = decoding.readVarUint(decoder.restDecoder)\n const clock = decoding.readVarUint(decoder.restDecoder)\n ss.set(client, clock)\n }\n return ss\n}\n\n/**\n * Read decodedState and return State as Map.\n *\n * @param {Uint8Array} decodedState\n * @return {Map} Maps `client` to the number next expected `clock` from that client.\n *\n * @function\n */\n// export const decodeStateVectorV2 = decodedState => readStateVector(new DSDecoderV2(decoding.createDecoder(decodedState)))\n\n/**\n * Read decodedState and return State as Map.\n *\n * @param {Uint8Array} decodedState\n * @return {Map} Maps `client` to the number next expected `clock` from that client.\n *\n * @function\n */\nexport const decodeStateVector = decodedState => readStateVector(new DSDecoderV1(decoding.createDecoder(decodedState)))\n\n/**\n * @param {DSEncoderV1 | DSEncoderV2} encoder\n * @param {Map} sv\n * @function\n */\nexport const writeStateVector = (encoder, sv) => {\n encoding.writeVarUint(encoder.restEncoder, sv.size)\n array.from(sv.entries()).sort((a, b) => b[0] - a[0]).forEach(([client, clock]) => {\n encoding.writeVarUint(encoder.restEncoder, client) // @todo use a special client decoder that is based on mapping\n encoding.writeVarUint(encoder.restEncoder, clock)\n })\n return encoder\n}\n\n/**\n * @param {DSEncoderV1 | DSEncoderV2} encoder\n * @param {Doc} doc\n *\n * @function\n */\nexport const writeDocumentStateVector = (encoder, doc) => writeStateVector(encoder, getStateVector(doc.store))\n\n/**\n * Encode State as Uint8Array.\n *\n * @param {Doc|Map} doc\n * @param {DSEncoderV1 | DSEncoderV2} [encoder]\n * @return {Uint8Array}\n *\n * @function\n */\nexport const encodeStateVectorV2 = (doc, encoder = new DSEncoderV2()) => {\n if (doc instanceof Map) {\n writeStateVector(encoder, doc)\n } else {\n writeDocumentStateVector(encoder, doc)\n }\n return encoder.toUint8Array()\n}\n\n/**\n * Encode State as Uint8Array.\n *\n * @param {Doc|Map} doc\n * @return {Uint8Array}\n *\n * @function\n */\nexport const encodeStateVector = doc => encodeStateVectorV2(doc, new DSEncoderV1())\n", "import * as f from 'lib0/function'\n\n/**\n * General event handler implementation.\n *\n * @template ARG0, ARG1\n *\n * @private\n */\nexport class EventHandler {\n constructor () {\n /**\n * @type {Array}\n */\n this.l = []\n }\n}\n\n/**\n * @template ARG0,ARG1\n * @returns {EventHandler}\n *\n * @private\n * @function\n */\nexport const createEventHandler = () => new EventHandler()\n\n/**\n * Adds an event listener that is called when\n * {@link EventHandler#callEventListeners} is called.\n *\n * @template ARG0,ARG1\n * @param {EventHandler} eventHandler\n * @param {function(ARG0,ARG1):void} f The event handler.\n *\n * @private\n * @function\n */\nexport const addEventHandlerListener = (eventHandler, f) =>\n eventHandler.l.push(f)\n\n/**\n * Removes an event listener.\n *\n * @template ARG0,ARG1\n * @param {EventHandler} eventHandler\n * @param {function(ARG0,ARG1):void} f The event handler that was added with\n * {@link EventHandler#addEventListener}\n *\n * @private\n * @function\n */\nexport const removeEventHandlerListener = (eventHandler, f) => {\n const l = eventHandler.l\n const len = l.length\n eventHandler.l = l.filter(g => f !== g)\n if (len === eventHandler.l.length) {\n console.error('[yjs] Tried to remove event handler that doesn\\'t exist.')\n }\n}\n\n/**\n * Removes all event listeners.\n * @template ARG0,ARG1\n * @param {EventHandler} eventHandler\n *\n * @private\n * @function\n */\nexport const removeAllEventHandlerListeners = eventHandler => {\n eventHandler.l.length = 0\n}\n\n/**\n * Call all event listeners that were added via\n * {@link EventHandler#addEventListener}.\n *\n * @template ARG0,ARG1\n * @param {EventHandler} eventHandler\n * @param {ARG0} arg0\n * @param {ARG1} arg1\n *\n * @private\n * @function\n */\nexport const callEventHandlerListeners = (eventHandler, arg0, arg1) =>\n f.callAll(eventHandler.l, [arg0, arg1])\n", "import { AbstractType } from '../internals.js' // eslint-disable-line\n\nimport * as decoding from 'lib0/decoding'\nimport * as encoding from 'lib0/encoding'\nimport * as error from 'lib0/error'\n\nexport class ID {\n /**\n * @param {number} client client id\n * @param {number} clock unique per client id, continuous number\n */\n constructor (client, clock) {\n /**\n * Client id\n * @type {number}\n */\n this.client = client\n /**\n * unique per client id, continuous number\n * @type {number}\n */\n this.clock = clock\n }\n}\n\n/**\n * @param {ID | null} a\n * @param {ID | null} b\n * @return {boolean}\n *\n * @function\n */\nexport const compareIDs = (a, b) => a === b || (a !== null && b !== null && a.client === b.client && a.clock === b.clock)\n\n/**\n * @param {number} client\n * @param {number} clock\n *\n * @private\n * @function\n */\nexport const createID = (client, clock) => new ID(client, clock)\n\n/**\n * @param {encoding.Encoder} encoder\n * @param {ID} id\n *\n * @private\n * @function\n */\nexport const writeID = (encoder, id) => {\n encoding.writeVarUint(encoder, id.client)\n encoding.writeVarUint(encoder, id.clock)\n}\n\n/**\n * Read ID.\n * * If first varUint read is 0xFFFFFF a RootID is returned.\n * * Otherwise an ID is returned\n *\n * @param {decoding.Decoder} decoder\n * @return {ID}\n *\n * @private\n * @function\n */\nexport const readID = decoder =>\n createID(decoding.readVarUint(decoder), decoding.readVarUint(decoder))\n\n/**\n * The top types are mapped from y.share.get(keyname) => type.\n * `type` does not store any information about the `keyname`.\n * This function finds the correct `keyname` for `type` and throws otherwise.\n *\n * @param {AbstractType} type\n * @return {string}\n *\n * @private\n * @function\n */\nexport const findRootTypeKey = type => {\n // @ts-ignore _y must be defined, otherwise unexpected case\n for (const [key, value] of type.doc.share.entries()) {\n if (value === type) {\n return key\n }\n }\n throw error.unexpectedCase()\n}\n", "import { AbstractType, Item } from '../internals.js' // eslint-disable-line\n\n/**\n * Check if `parent` is a parent of `child`.\n *\n * @param {AbstractType} parent\n * @param {Item|null} child\n * @return {Boolean} Whether `parent` is a parent of `child`.\n *\n * @private\n * @function\n */\nexport const isParentOf = (parent, child) => {\n while (child !== null) {\n if (child.parent === parent) {\n return true\n }\n child = /** @type {AbstractType} */ (child.parent)._item\n }\n return false\n}\n", "import {\n AbstractType // eslint-disable-line\n} from '../internals.js'\n\n/**\n * Convenient helper to log type information.\n *\n * Do not use in productive systems as the output can be immense!\n *\n * @param {AbstractType} type\n */\nexport const logType = type => {\n const res = []\n let n = type._start\n while (n) {\n res.push(n)\n n = n.right\n }\n console.log('Children: ', res)\n console.log('Children content: ', res.filter(m => !m.deleted).map(m => m.content))\n}\n", "import {\n YArray,\n YMap,\n readDeleteSet,\n writeDeleteSet,\n createDeleteSet,\n DSEncoderV1, DSDecoderV1, ID, DeleteSet, YArrayEvent, Transaction, Doc // eslint-disable-line\n} from '../internals.js'\n\nimport * as decoding from 'lib0/decoding'\n\nimport { mergeDeleteSets, isDeleted } from './DeleteSet.js'\n\nexport class PermanentUserData {\n /**\n * @param {Doc} doc\n * @param {YMap} [storeType]\n */\n constructor (doc, storeType = doc.getMap('users')) {\n /**\n * @type {Map}\n */\n const dss = new Map()\n this.yusers = storeType\n this.doc = doc\n /**\n * Maps from clientid to userDescription\n *\n * @type {Map}\n */\n this.clients = new Map()\n this.dss = dss\n /**\n * @param {YMap} user\n * @param {string} userDescription\n */\n const initUser = (user, userDescription) => {\n /**\n * @type {YArray}\n */\n const ds = user.get('ds')\n const ids = user.get('ids')\n const addClientId = /** @param {number} clientid */ clientid => this.clients.set(clientid, userDescription)\n ds.observe(/** @param {YArrayEvent} event */ event => {\n event.changes.added.forEach(item => {\n item.content.getContent().forEach(encodedDs => {\n if (encodedDs instanceof Uint8Array) {\n this.dss.set(userDescription, mergeDeleteSets([this.dss.get(userDescription) || createDeleteSet(), readDeleteSet(new DSDecoderV1(decoding.createDecoder(encodedDs)))]))\n }\n })\n })\n })\n this.dss.set(userDescription, mergeDeleteSets(ds.map(encodedDs => readDeleteSet(new DSDecoderV1(decoding.createDecoder(encodedDs))))))\n ids.observe(/** @param {YArrayEvent} event */ event =>\n event.changes.added.forEach(item => item.content.getContent().forEach(addClientId))\n )\n ids.forEach(addClientId)\n }\n // observe users\n storeType.observe(event => {\n event.keysChanged.forEach(userDescription =>\n initUser(storeType.get(userDescription), userDescription)\n )\n })\n // add intial data\n storeType.forEach(initUser)\n }\n\n /**\n * @param {Doc} doc\n * @param {number} clientid\n * @param {string} userDescription\n * @param {Object} conf\n * @param {function(Transaction, DeleteSet):boolean} [conf.filter]\n */\n setUserMapping (doc, clientid, userDescription, { filter = () => true } = {}) {\n const users = this.yusers\n let user = users.get(userDescription)\n if (!user) {\n user = new YMap()\n user.set('ids', new YArray())\n user.set('ds', new YArray())\n users.set(userDescription, user)\n }\n user.get('ids').push([clientid])\n users.observe(_event => {\n setTimeout(() => {\n const userOverwrite = users.get(userDescription)\n if (userOverwrite !== user) {\n // user was overwritten, port all data over to the next user object\n // @todo Experiment with Y.Sets here\n user = userOverwrite\n // @todo iterate over old type\n this.clients.forEach((_userDescription, clientid) => {\n if (userDescription === _userDescription) {\n user.get('ids').push([clientid])\n }\n })\n const encoder = new DSEncoderV1()\n const ds = this.dss.get(userDescription)\n if (ds) {\n writeDeleteSet(encoder, ds)\n user.get('ds').push([encoder.toUint8Array()])\n }\n }\n }, 0)\n })\n doc.on('afterTransaction', /** @param {Transaction} transaction */ transaction => {\n setTimeout(() => {\n const yds = user.get('ds')\n const ds = transaction.deleteSet\n if (transaction.local && ds.clients.size > 0 && filter(transaction, ds)) {\n const encoder = new DSEncoderV1()\n writeDeleteSet(encoder, ds)\n yds.push([encoder.toUint8Array()])\n }\n })\n })\n }\n\n /**\n * @param {number} clientid\n * @return {any}\n */\n getUserByClientId (clientid) {\n return this.clients.get(clientid) || null\n }\n\n /**\n * @param {ID} id\n * @return {string | null}\n */\n getUserByDeletedId (id) {\n for (const [userDescription, ds] of this.dss.entries()) {\n if (isDeleted(ds, id)) {\n return userDescription\n }\n }\n return null\n }\n}\n", "import {\n writeID,\n readID,\n compareIDs,\n getState,\n findRootTypeKey,\n Item,\n createID,\n ContentType,\n followRedone,\n getItem,\n ID, Doc, AbstractType // eslint-disable-line\n} from '../internals.js'\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as error from 'lib0/error'\n\n/**\n * A relative position is based on the Yjs model and is not affected by document changes.\n * E.g. If you place a relative position before a certain character, it will always point to this character.\n * If you place a relative position at the end of a type, it will always point to the end of the type.\n *\n * A numeric position is often unsuited for user selections, because it does not change when content is inserted\n * before or after.\n *\n * ```Insert(0, 'x')('a|bc') = 'xa|bc'``` Where | is the relative position.\n *\n * One of the properties must be defined.\n *\n * @example\n * // Current cursor position is at position 10\n * const relativePosition = createRelativePositionFromIndex(yText, 10)\n * // modify yText\n * yText.insert(0, 'abc')\n * yText.delete(3, 10)\n * // Compute the cursor position\n * const absolutePosition = createAbsolutePositionFromRelativePosition(y, relativePosition)\n * absolutePosition.type === yText // => true\n * console.log('cursor location is ' + absolutePosition.index) // => cursor location is 3\n *\n */\nexport class RelativePosition {\n /**\n * @param {ID|null} type\n * @param {string|null} tname\n * @param {ID|null} item\n * @param {number} assoc\n */\n constructor (type, tname, item, assoc = 0) {\n /**\n * @type {ID|null}\n */\n this.type = type\n /**\n * @type {string|null}\n */\n this.tname = tname\n /**\n * @type {ID | null}\n */\n this.item = item\n /**\n * A relative position is associated to a specific character. By default\n * assoc >= 0, the relative position is associated to the character\n * after the meant position.\n * I.e. position 1 in 'ab' is associated to character 'b'.\n *\n * If assoc < 0, then the relative position is associated to the caharacter\n * before the meant position.\n *\n * @type {number}\n */\n this.assoc = assoc\n }\n}\n\n/**\n * @param {RelativePosition} rpos\n * @return {any}\n */\nexport const relativePositionToJSON = rpos => {\n const json = {}\n if (rpos.type) {\n json.type = rpos.type\n }\n if (rpos.tname) {\n json.tname = rpos.tname\n }\n if (rpos.item) {\n json.item = rpos.item\n }\n if (rpos.assoc != null) {\n json.assoc = rpos.assoc\n }\n return json\n}\n\n/**\n * @param {any} json\n * @return {RelativePosition}\n *\n * @function\n */\nexport const createRelativePositionFromJSON = json => new RelativePosition(json.type == null ? null : createID(json.type.client, json.type.clock), json.tname ?? null, json.item == null ? null : createID(json.item.client, json.item.clock), json.assoc == null ? 0 : json.assoc)\n\nexport class AbsolutePosition {\n /**\n * @param {AbstractType} type\n * @param {number} index\n * @param {number} [assoc]\n */\n constructor (type, index, assoc = 0) {\n /**\n * @type {AbstractType}\n */\n this.type = type\n /**\n * @type {number}\n */\n this.index = index\n this.assoc = assoc\n }\n}\n\n/**\n * @param {AbstractType} type\n * @param {number} index\n * @param {number} [assoc]\n *\n * @function\n */\nexport const createAbsolutePosition = (type, index, assoc = 0) => new AbsolutePosition(type, index, assoc)\n\n/**\n * @param {AbstractType} type\n * @param {ID|null} item\n * @param {number} [assoc]\n *\n * @function\n */\nexport const createRelativePosition = (type, item, assoc) => {\n let typeid = null\n let tname = null\n if (type._item === null) {\n tname = findRootTypeKey(type)\n } else {\n typeid = createID(type._item.id.client, type._item.id.clock)\n }\n return new RelativePosition(typeid, tname, item, assoc)\n}\n\n/**\n * Create a relativePosition based on a absolute position.\n *\n * @param {AbstractType} type The base type (e.g. YText or YArray).\n * @param {number} index The absolute position.\n * @param {number} [assoc]\n * @return {RelativePosition}\n *\n * @function\n */\nexport const createRelativePositionFromTypeIndex = (type, index, assoc = 0) => {\n let t = type._start\n if (assoc < 0) {\n // associated to the left character or the beginning of a type, increment index if possible.\n if (index === 0) {\n return createRelativePosition(type, null, assoc)\n }\n index--\n }\n while (t !== null) {\n if (!t.deleted && t.countable) {\n if (t.length > index) {\n // case 1: found position somewhere in the linked list\n return createRelativePosition(type, createID(t.id.client, t.id.clock + index), assoc)\n }\n index -= t.length\n }\n if (t.right === null && assoc < 0) {\n // left-associated position, return last available id\n return createRelativePosition(type, t.lastId, assoc)\n }\n t = t.right\n }\n return createRelativePosition(type, null, assoc)\n}\n\n/**\n * @param {encoding.Encoder} encoder\n * @param {RelativePosition} rpos\n *\n * @function\n */\nexport const writeRelativePosition = (encoder, rpos) => {\n const { type, tname, item, assoc } = rpos\n if (item !== null) {\n encoding.writeVarUint(encoder, 0)\n writeID(encoder, item)\n } else if (tname !== null) {\n // case 2: found position at the end of the list and type is stored in y.share\n encoding.writeUint8(encoder, 1)\n encoding.writeVarString(encoder, tname)\n } else if (type !== null) {\n // case 3: found position at the end of the list and type is attached to an item\n encoding.writeUint8(encoder, 2)\n writeID(encoder, type)\n } else {\n throw error.unexpectedCase()\n }\n encoding.writeVarInt(encoder, assoc)\n return encoder\n}\n\n/**\n * @param {RelativePosition} rpos\n * @return {Uint8Array}\n */\nexport const encodeRelativePosition = rpos => {\n const encoder = encoding.createEncoder()\n writeRelativePosition(encoder, rpos)\n return encoding.toUint8Array(encoder)\n}\n\n/**\n * @param {decoding.Decoder} decoder\n * @return {RelativePosition}\n *\n * @function\n */\nexport const readRelativePosition = decoder => {\n let type = null\n let tname = null\n let itemID = null\n switch (decoding.readVarUint(decoder)) {\n case 0:\n // case 1: found position somewhere in the linked list\n itemID = readID(decoder)\n break\n case 1:\n // case 2: found position at the end of the list and type is stored in y.share\n tname = decoding.readVarString(decoder)\n break\n case 2: {\n // case 3: found position at the end of the list and type is attached to an item\n type = readID(decoder)\n }\n }\n const assoc = decoding.hasContent(decoder) ? decoding.readVarInt(decoder) : 0\n return new RelativePosition(type, tname, itemID, assoc)\n}\n\n/**\n * @param {Uint8Array} uint8Array\n * @return {RelativePosition}\n */\nexport const decodeRelativePosition = uint8Array => readRelativePosition(decoding.createDecoder(uint8Array))\n\n/**\n * Transform a relative position to an absolute position.\n *\n * If you want to share the relative position with other users, you should set\n * `followUndoneDeletions` to false to get consistent results across all clients.\n *\n * When calculating the absolute position, we try to follow the \"undone deletions\". This yields\n * better results for the user who performed undo. However, only the user who performed the undo\n * will get the better results, the other users don't know which operations recreated a deleted\n * range of content. There is more information in this ticket: https://github.com/yjs/yjs/issues/638\n *\n * @param {RelativePosition} rpos\n * @param {Doc} doc\n * @param {boolean} followUndoneDeletions - whether to follow undone deletions - see https://github.com/yjs/yjs/issues/638\n * @return {AbsolutePosition|null}\n *\n * @function\n */\nexport const createAbsolutePositionFromRelativePosition = (rpos, doc, followUndoneDeletions = true) => {\n const store = doc.store\n const rightID = rpos.item\n const typeID = rpos.type\n const tname = rpos.tname\n const assoc = rpos.assoc\n let type = null\n let index = 0\n if (rightID !== null) {\n if (getState(store, rightID.client) <= rightID.clock) {\n return null\n }\n const res = followUndoneDeletions ? followRedone(store, rightID) : { item: getItem(store, rightID), diff: 0 }\n const right = res.item\n if (!(right instanceof Item)) {\n return null\n }\n type = /** @type {AbstractType} */ (right.parent)\n if (type._item === null || !type._item.deleted) {\n index = (right.deleted || !right.countable) ? 0 : (res.diff + (assoc >= 0 ? 0 : 1)) // adjust position based on left association if necessary\n let n = right.left\n while (n !== null) {\n if (!n.deleted && n.countable) {\n index += n.length\n }\n n = n.left\n }\n }\n } else {\n if (tname !== null) {\n type = doc.get(tname)\n } else if (typeID !== null) {\n if (getState(store, typeID.client) <= typeID.clock) {\n // type does not exist yet\n return null\n }\n const { item } = followUndoneDeletions ? followRedone(store, typeID) : { item: getItem(store, typeID) }\n if (item instanceof Item && item.content instanceof ContentType) {\n type = item.content.type\n } else {\n // struct is garbage collected\n return null\n }\n } else {\n throw error.unexpectedCase()\n }\n if (assoc >= 0) {\n index = type._length\n } else {\n index = 0\n }\n }\n return createAbsolutePosition(type, index, rpos.assoc)\n}\n\n/**\n * @param {RelativePosition|null} a\n * @param {RelativePosition|null} b\n * @return {boolean}\n *\n * @function\n */\nexport const compareRelativePositions = (a, b) => a === b || (\n a !== null && b !== null && a.tname === b.tname && compareIDs(a.item, b.item) && compareIDs(a.type, b.type) && a.assoc === b.assoc\n)\n", "import {\n isDeleted,\n createDeleteSetFromStructStore,\n getStateVector,\n getItemCleanStart,\n iterateDeletedStructs,\n writeDeleteSet,\n writeStateVector,\n readDeleteSet,\n readStateVector,\n createDeleteSet,\n createID,\n getState,\n findIndexSS,\n UpdateEncoderV2,\n applyUpdateV2,\n LazyStructReader,\n equalDeleteSets,\n UpdateDecoderV1, UpdateDecoderV2, DSEncoderV1, DSEncoderV2, DSDecoderV1, DSDecoderV2, Transaction, Doc, DeleteSet, Item, // eslint-disable-line\n mergeDeleteSets\n} from '../internals.js'\n\nimport * as map from 'lib0/map'\nimport * as set from 'lib0/set'\nimport * as decoding from 'lib0/decoding'\nimport * as encoding from 'lib0/encoding'\n\nexport class Snapshot {\n /**\n * @param {DeleteSet} ds\n * @param {Map} sv state map\n */\n constructor (ds, sv) {\n /**\n * @type {DeleteSet}\n */\n this.ds = ds\n /**\n * State Map\n * @type {Map}\n */\n this.sv = sv\n }\n}\n\n/**\n * @param {Snapshot} snap1\n * @param {Snapshot} snap2\n * @return {boolean}\n */\nexport const equalSnapshots = (snap1, snap2) => {\n const ds1 = snap1.ds.clients\n const ds2 = snap2.ds.clients\n const sv1 = snap1.sv\n const sv2 = snap2.sv\n if (sv1.size !== sv2.size || ds1.size !== ds2.size) {\n return false\n }\n for (const [key, value] of sv1.entries()) {\n if (sv2.get(key) !== value) {\n return false\n }\n }\n for (const [client, dsitems1] of ds1.entries()) {\n const dsitems2 = ds2.get(client) || []\n if (dsitems1.length !== dsitems2.length) {\n return false\n }\n for (let i = 0; i < dsitems1.length; i++) {\n const dsitem1 = dsitems1[i]\n const dsitem2 = dsitems2[i]\n if (dsitem1.clock !== dsitem2.clock || dsitem1.len !== dsitem2.len) {\n return false\n }\n }\n }\n return true\n}\n\n/**\n * @param {Snapshot} snapshot\n * @param {DSEncoderV1 | DSEncoderV2} [encoder]\n * @return {Uint8Array}\n */\nexport const encodeSnapshotV2 = (snapshot, encoder = new DSEncoderV2()) => {\n writeDeleteSet(encoder, snapshot.ds)\n writeStateVector(encoder, snapshot.sv)\n return encoder.toUint8Array()\n}\n\n/**\n * @param {Snapshot} snapshot\n * @return {Uint8Array}\n */\nexport const encodeSnapshot = snapshot => encodeSnapshotV2(snapshot, new DSEncoderV1())\n\n/**\n * @param {Uint8Array} buf\n * @param {DSDecoderV1 | DSDecoderV2} [decoder]\n * @return {Snapshot}\n */\nexport const decodeSnapshotV2 = (buf, decoder = new DSDecoderV2(decoding.createDecoder(buf))) => {\n return new Snapshot(readDeleteSet(decoder), readStateVector(decoder))\n}\n\n/**\n * @param {Uint8Array} buf\n * @return {Snapshot}\n */\nexport const decodeSnapshot = buf => decodeSnapshotV2(buf, new DSDecoderV1(decoding.createDecoder(buf)))\n\n/**\n * @param {DeleteSet} ds\n * @param {Map} sm\n * @return {Snapshot}\n */\nexport const createSnapshot = (ds, sm) => new Snapshot(ds, sm)\n\nexport const emptySnapshot = createSnapshot(createDeleteSet(), new Map())\n\n/**\n * @param {Doc} doc\n * @return {Snapshot}\n */\nexport const snapshot = doc => createSnapshot(createDeleteSetFromStructStore(doc.store), getStateVector(doc.store))\n\n/**\n * @param {Item} item\n * @param {Snapshot|undefined} snapshot\n *\n * @protected\n * @function\n */\nexport const isVisible = (item, snapshot) => snapshot === undefined\n ? !item.deleted\n : snapshot.sv.has(item.id.client) && (snapshot.sv.get(item.id.client) || 0) > item.id.clock && !isDeleted(snapshot.ds, item.id)\n\n/**\n * @param {Transaction} transaction\n * @param {Snapshot} snapshot\n */\nexport const splitSnapshotAffectedStructs = (transaction, snapshot) => {\n const meta = map.setIfUndefined(transaction.meta, splitSnapshotAffectedStructs, set.create)\n const store = transaction.doc.store\n // check if we already split for this snapshot\n if (!meta.has(snapshot)) {\n snapshot.sv.forEach((clock, client) => {\n if (clock < getState(store, client)) {\n getItemCleanStart(transaction, createID(client, clock))\n }\n })\n iterateDeletedStructs(transaction, snapshot.ds, _item => {})\n meta.add(snapshot)\n }\n}\n\n/**\n * @example\n * const ydoc = new Y.Doc({ gc: false })\n * ydoc.getText().insert(0, 'world!')\n * const snapshot = Y.snapshot(ydoc)\n * ydoc.getText().insert(0, 'hello ')\n * const restored = Y.createDocFromSnapshot(ydoc, snapshot)\n * assert(restored.getText().toString() === 'world!')\n *\n * @param {Doc} originDoc\n * @param {Snapshot} snapshot\n * @param {Doc} [newDoc] Optionally, you may define the Yjs document that receives the data from originDoc\n * @return {Doc}\n */\nexport const createDocFromSnapshot = (originDoc, snapshot, newDoc = new Doc()) => {\n if (originDoc.gc) {\n // we should not try to restore a GC-ed document, because some of the restored items might have their content deleted\n throw new Error('Garbage-collection must be disabled in `originDoc`!')\n }\n const { sv, ds } = snapshot\n\n const encoder = new UpdateEncoderV2()\n originDoc.transact(transaction => {\n let size = 0\n sv.forEach(clock => {\n if (clock > 0) {\n size++\n }\n })\n encoding.writeVarUint(encoder.restEncoder, size)\n // splitting the structs before writing them to the encoder\n for (const [client, clock] of sv) {\n if (clock === 0) {\n continue\n }\n if (clock < getState(originDoc.store, client)) {\n getItemCleanStart(transaction, createID(client, clock))\n }\n const structs = originDoc.store.clients.get(client) || []\n const lastStructIndex = findIndexSS(structs, clock - 1)\n // write # encoded structs\n encoding.writeVarUint(encoder.restEncoder, lastStructIndex + 1)\n encoder.writeClient(client)\n // first clock written is 0\n encoding.writeVarUint(encoder.restEncoder, 0)\n for (let i = 0; i <= lastStructIndex; i++) {\n structs[i].write(encoder, 0)\n }\n }\n writeDeleteSet(encoder, ds)\n })\n\n applyUpdateV2(newDoc, encoder.toUint8Array(), 'snapshot')\n return newDoc\n}\n\n/**\n * @param {Snapshot} snapshot\n * @param {Uint8Array} update\n * @param {typeof UpdateDecoderV2 | typeof UpdateDecoderV1} [YDecoder]\n */\nexport const snapshotContainsUpdateV2 = (snapshot, update, YDecoder = UpdateDecoderV2) => {\n const structs = []\n const updateDecoder = new YDecoder(decoding.createDecoder(update))\n const lazyDecoder = new LazyStructReader(updateDecoder, false)\n for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) {\n structs.push(curr)\n if ((snapshot.sv.get(curr.id.client) || 0) < curr.id.clock + curr.length) {\n return false\n }\n }\n const mergedDS = mergeDeleteSets([snapshot.ds, readDeleteSet(updateDecoder)])\n return equalDeleteSets(snapshot.ds, mergedDS)\n}\n\n/**\n * @param {Snapshot} snapshot\n * @param {Uint8Array} update\n */\nexport const snapshotContainsUpdate = (snapshot, update) => snapshotContainsUpdateV2(snapshot, update, UpdateDecoderV1)\n", "import {\n GC,\n splitItem,\n Transaction, ID, Item, DSDecoderV2 // eslint-disable-line\n} from '../internals.js'\n\nimport * as math from 'lib0/math'\nimport * as error from 'lib0/error'\n\nexport class StructStore {\n constructor () {\n /**\n * @type {Map>}\n */\n this.clients = new Map()\n /**\n * @type {null | { missing: Map, update: Uint8Array }}\n */\n this.pendingStructs = null\n /**\n * @type {null | Uint8Array}\n */\n this.pendingDs = null\n }\n}\n\n/**\n * Return the states as a Map.\n * Note that clock refers to the next expected clock id.\n *\n * @param {StructStore} store\n * @return {Map}\n *\n * @public\n * @function\n */\nexport const getStateVector = store => {\n const sm = new Map()\n store.clients.forEach((structs, client) => {\n const struct = structs[structs.length - 1]\n sm.set(client, struct.id.clock + struct.length)\n })\n return sm\n}\n\n/**\n * @param {StructStore} store\n * @param {number} client\n * @return {number}\n *\n * @public\n * @function\n */\nexport const getState = (store, client) => {\n const structs = store.clients.get(client)\n if (structs === undefined) {\n return 0\n }\n const lastStruct = structs[structs.length - 1]\n return lastStruct.id.clock + lastStruct.length\n}\n\n/**\n * @param {StructStore} store\n *\n * @private\n * @function\n */\nexport const integretyCheck = store => {\n store.clients.forEach(structs => {\n for (let i = 1; i < structs.length; i++) {\n const l = structs[i - 1]\n const r = structs[i]\n if (l.id.clock + l.length !== r.id.clock) {\n throw new Error('StructStore failed integrety check')\n }\n }\n })\n}\n\n/**\n * @param {StructStore} store\n * @param {GC|Item} struct\n *\n * @private\n * @function\n */\nexport const addStruct = (store, struct) => {\n let structs = store.clients.get(struct.id.client)\n if (structs === undefined) {\n structs = []\n store.clients.set(struct.id.client, structs)\n } else {\n const lastStruct = structs[structs.length - 1]\n if (lastStruct.id.clock + lastStruct.length !== struct.id.clock) {\n throw error.unexpectedCase()\n }\n }\n structs.push(struct)\n}\n\n/**\n * Perform a binary search on a sorted array\n * @param {Array} structs\n * @param {number} clock\n * @return {number}\n *\n * @private\n * @function\n */\nexport const findIndexSS = (structs, clock) => {\n let left = 0\n let right = structs.length - 1\n let mid = structs[right]\n let midclock = mid.id.clock\n if (midclock === clock) {\n return right\n }\n // @todo does it even make sense to pivot the search?\n // If a good split misses, it might actually increase the time to find the correct item.\n // Currently, the only advantage is that search with pivoting might find the item on the first try.\n let midindex = math.floor((clock / (midclock + mid.length - 1)) * right) // pivoting the search\n while (left <= right) {\n mid = structs[midindex]\n midclock = mid.id.clock\n if (midclock <= clock) {\n if (clock < midclock + mid.length) {\n return midindex\n }\n left = midindex + 1\n } else {\n right = midindex - 1\n }\n midindex = math.floor((left + right) / 2)\n }\n // Always check state before looking for a struct in StructStore\n // Therefore the case of not finding a struct is unexpected\n throw error.unexpectedCase()\n}\n\n/**\n * Expects that id is actually in store. This function throws or is an infinite loop otherwise.\n *\n * @param {StructStore} store\n * @param {ID} id\n * @return {GC|Item}\n *\n * @private\n * @function\n */\nexport const find = (store, id) => {\n /**\n * @type {Array}\n */\n // @ts-ignore\n const structs = store.clients.get(id.client)\n return structs[findIndexSS(structs, id.clock)]\n}\n\n/**\n * Expects that id is actually in store. This function throws or is an infinite loop otherwise.\n * @private\n * @function\n */\nexport const getItem = /** @type {function(StructStore,ID):Item} */ (find)\n\n/**\n * @param {Transaction} transaction\n * @param {Array} structs\n * @param {number} clock\n */\nexport const findIndexCleanStart = (transaction, structs, clock) => {\n const index = findIndexSS(structs, clock)\n const struct = structs[index]\n if (struct.id.clock < clock && struct instanceof Item) {\n structs.splice(index + 1, 0, splitItem(transaction, struct, clock - struct.id.clock))\n return index + 1\n }\n return index\n}\n\n/**\n * Expects that id is actually in store. This function throws or is an infinite loop otherwise.\n *\n * @param {Transaction} transaction\n * @param {ID} id\n * @return {Item}\n *\n * @private\n * @function\n */\nexport const getItemCleanStart = (transaction, id) => {\n const structs = /** @type {Array} */ (transaction.doc.store.clients.get(id.client))\n return structs[findIndexCleanStart(transaction, structs, id.clock)]\n}\n\n/**\n * Expects that id is actually in store. This function throws or is an infinite loop otherwise.\n *\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @param {ID} id\n * @return {Item}\n *\n * @private\n * @function\n */\nexport const getItemCleanEnd = (transaction, store, id) => {\n /**\n * @type {Array}\n */\n // @ts-ignore\n const structs = store.clients.get(id.client)\n const index = findIndexSS(structs, id.clock)\n const struct = structs[index]\n if (id.clock !== struct.id.clock + struct.length - 1 && struct.constructor !== GC) {\n structs.splice(index + 1, 0, splitItem(transaction, struct, id.clock - struct.id.clock + 1))\n }\n return struct\n}\n\n/**\n * Replace `item` with `newitem` in store\n * @param {StructStore} store\n * @param {GC|Item} struct\n * @param {GC|Item} newStruct\n *\n * @private\n * @function\n */\nexport const replaceStruct = (store, struct, newStruct) => {\n const structs = /** @type {Array} */ (store.clients.get(struct.id.client))\n structs[findIndexSS(structs, struct.id.clock)] = newStruct\n}\n\n/**\n * Iterate over a range of structs\n *\n * @param {Transaction} transaction\n * @param {Array} structs\n * @param {number} clockStart Inclusive start\n * @param {number} len\n * @param {function(GC|Item):void} f\n *\n * @function\n */\nexport const iterateStructs = (transaction, structs, clockStart, len, f) => {\n if (len === 0) {\n return\n }\n const clockEnd = clockStart + len\n let index = findIndexCleanStart(transaction, structs, clockStart)\n let struct\n do {\n struct = structs[index++]\n if (clockEnd < struct.id.clock + struct.length) {\n findIndexCleanStart(transaction, structs, clockEnd)\n }\n f(struct)\n } while (index < structs.length && structs[index].id.clock < clockEnd)\n}\n", "import {\n getState,\n writeStructsFromTransaction,\n writeDeleteSet,\n DeleteSet,\n sortAndMergeDeleteSet,\n getStateVector,\n findIndexSS,\n callEventHandlerListeners,\n Item,\n generateNewClientId,\n createID,\n cleanupYTextAfterTransaction,\n UpdateEncoderV1, UpdateEncoderV2, GC, StructStore, AbstractType, AbstractStruct, YEvent, Doc // eslint-disable-line\n} from '../internals.js'\n\nimport * as map from 'lib0/map'\nimport * as math from 'lib0/math'\nimport * as set from 'lib0/set'\nimport * as logging from 'lib0/logging'\nimport { callAll } from 'lib0/function'\n\n/**\n * A transaction is created for every change on the Yjs model. It is possible\n * to bundle changes on the Yjs model in a single transaction to\n * minimize the number on messages sent and the number of observer calls.\n * If possible the user of this library should bundle as many changes as\n * possible. Here is an example to illustrate the advantages of bundling:\n *\n * @example\n * const ydoc = new Y.Doc()\n * const map = ydoc.getMap('map')\n * // Log content when change is triggered\n * map.observe(() => {\n * console.log('change triggered')\n * })\n * // Each change on the map type triggers a log message:\n * map.set('a', 0) // => \"change triggered\"\n * map.set('b', 0) // => \"change triggered\"\n * // When put in a transaction, it will trigger the log after the transaction:\n * ydoc.transact(() => {\n * map.set('a', 1)\n * map.set('b', 1)\n * }) // => \"change triggered\"\n *\n * @public\n */\nexport class Transaction {\n /**\n * @param {Doc} doc\n * @param {any} origin\n * @param {boolean} local\n */\n constructor (doc, origin, local) {\n /**\n * The Yjs instance.\n * @type {Doc}\n */\n this.doc = doc\n /**\n * Describes the set of deleted items by ids\n * @type {DeleteSet}\n */\n this.deleteSet = new DeleteSet()\n /**\n * Holds the state before the transaction started.\n * @type {Map}\n */\n this.beforeState = getStateVector(doc.store)\n /**\n * Holds the state after the transaction.\n * @type {Map}\n */\n this.afterState = new Map()\n /**\n * All types that were directly modified (property added or child\n * inserted/deleted). New types are not included in this Set.\n * Maps from type to parentSubs (`item.parentSub = null` for YArray)\n * @type {Map>,Set>}\n */\n this.changed = new Map()\n /**\n * Stores the events for the types that observe also child elements.\n * It is mainly used by `observeDeep`.\n * @type {Map>,Array>>}\n */\n this.changedParentTypes = new Map()\n /**\n * @type {Array}\n */\n this._mergeStructs = []\n /**\n * @type {any}\n */\n this.origin = origin\n /**\n * Stores meta information on the transaction\n * @type {Map}\n */\n this.meta = new Map()\n /**\n * Whether this change originates from this doc.\n * @type {boolean}\n */\n this.local = local\n /**\n * @type {Set}\n */\n this.subdocsAdded = new Set()\n /**\n * @type {Set}\n */\n this.subdocsRemoved = new Set()\n /**\n * @type {Set}\n */\n this.subdocsLoaded = new Set()\n /**\n * @type {boolean}\n */\n this._needFormattingCleanup = false\n }\n}\n\n/**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {Transaction} transaction\n * @return {boolean} Whether data was written.\n */\nexport const writeUpdateMessageFromTransaction = (encoder, transaction) => {\n if (transaction.deleteSet.clients.size === 0 && !map.any(transaction.afterState, (clock, client) => transaction.beforeState.get(client) !== clock)) {\n return false\n }\n sortAndMergeDeleteSet(transaction.deleteSet)\n writeStructsFromTransaction(encoder, transaction)\n writeDeleteSet(encoder, transaction.deleteSet)\n return true\n}\n\n/**\n * @param {Transaction} transaction\n *\n * @private\n * @function\n */\nexport const nextID = transaction => {\n const y = transaction.doc\n return createID(y.clientID, getState(y.store, y.clientID))\n}\n\n/**\n * If `type.parent` was added in current transaction, `type` technically\n * did not change, it was just added and we should not fire events for `type`.\n *\n * @param {Transaction} transaction\n * @param {AbstractType>} type\n * @param {string|null} parentSub\n */\nexport const addChangedTypeToTransaction = (transaction, type, parentSub) => {\n const item = type._item\n if (item === null || (item.id.clock < (transaction.beforeState.get(item.id.client) || 0) && !item.deleted)) {\n map.setIfUndefined(transaction.changed, type, set.create).add(parentSub)\n }\n}\n\n/**\n * @param {Array} structs\n * @param {number} pos\n * @return {number} # of merged structs\n */\nconst tryToMergeWithLefts = (structs, pos) => {\n let right = structs[pos]\n let left = structs[pos - 1]\n let i = pos\n for (; i > 0; right = left, left = structs[--i - 1]) {\n if (left.deleted === right.deleted && left.constructor === right.constructor) {\n if (left.mergeWith(right)) {\n if (right instanceof Item && right.parentSub !== null && /** @type {AbstractType} */ (right.parent)._map.get(right.parentSub) === right) {\n /** @type {AbstractType} */ (right.parent)._map.set(right.parentSub, /** @type {Item} */ (left))\n }\n continue\n }\n }\n break\n }\n const merged = pos - i\n if (merged) {\n // remove all merged structs from the array\n structs.splice(pos + 1 - merged, merged)\n }\n return merged\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {StructStore} store\n * @param {function(Item):boolean} gcFilter\n */\nconst tryGcDeleteSet = (ds, store, gcFilter) => {\n for (const [client, deleteItems] of ds.clients.entries()) {\n const structs = /** @type {Array} */ (store.clients.get(client))\n for (let di = deleteItems.length - 1; di >= 0; di--) {\n const deleteItem = deleteItems[di]\n const endDeleteItemClock = deleteItem.clock + deleteItem.len\n for (\n let si = findIndexSS(structs, deleteItem.clock), struct = structs[si];\n si < structs.length && struct.id.clock < endDeleteItemClock;\n struct = structs[++si]\n ) {\n const struct = structs[si]\n if (deleteItem.clock + deleteItem.len <= struct.id.clock) {\n break\n }\n if (struct instanceof Item && struct.deleted && !struct.keep && gcFilter(struct)) {\n struct.gc(store, false)\n }\n }\n }\n }\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {StructStore} store\n */\nconst tryMergeDeleteSet = (ds, store) => {\n // try to merge deleted / gc'd items\n // merge from right to left for better efficiency and so we don't miss any merge targets\n ds.clients.forEach((deleteItems, client) => {\n const structs = /** @type {Array} */ (store.clients.get(client))\n for (let di = deleteItems.length - 1; di >= 0; di--) {\n const deleteItem = deleteItems[di]\n // start with merging the item next to the last deleted item\n const mostRightIndexToCheck = math.min(structs.length - 1, 1 + findIndexSS(structs, deleteItem.clock + deleteItem.len - 1))\n for (\n let si = mostRightIndexToCheck, struct = structs[si];\n si > 0 && struct.id.clock >= deleteItem.clock;\n struct = structs[si]\n ) {\n si -= 1 + tryToMergeWithLefts(structs, si)\n }\n }\n })\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {StructStore} store\n * @param {function(Item):boolean} gcFilter\n */\nexport const tryGc = (ds, store, gcFilter) => {\n tryGcDeleteSet(ds, store, gcFilter)\n tryMergeDeleteSet(ds, store)\n}\n\n/**\n * @param {Array} transactionCleanups\n * @param {number} i\n */\nconst cleanupTransactions = (transactionCleanups, i) => {\n if (i < transactionCleanups.length) {\n const transaction = transactionCleanups[i]\n const doc = transaction.doc\n const store = doc.store\n const ds = transaction.deleteSet\n const mergeStructs = transaction._mergeStructs\n try {\n sortAndMergeDeleteSet(ds)\n transaction.afterState = getStateVector(transaction.doc.store)\n doc.emit('beforeObserverCalls', [transaction, doc])\n /**\n * An array of event callbacks.\n *\n * Each callback is called even if the other ones throw errors.\n *\n * @type {Array}\n */\n const fs = []\n // observe events on changed types\n transaction.changed.forEach((subs, itemtype) =>\n fs.push(() => {\n if (itemtype._item === null || !itemtype._item.deleted) {\n itemtype._callObserver(transaction, subs)\n }\n })\n )\n fs.push(() => {\n // deep observe events\n transaction.changedParentTypes.forEach((events, type) => {\n // We need to think about the possibility that the user transforms the\n // Y.Doc in the event.\n if (type._dEH.l.length > 0 && (type._item === null || !type._item.deleted)) {\n events = events\n .filter(event =>\n event.target._item === null || !event.target._item.deleted\n )\n events\n .forEach(event => {\n event.currentTarget = type\n // path is relative to the current target\n event._path = null\n })\n // sort events by path length so that top-level events are fired first.\n events\n .sort((event1, event2) => event1.path.length - event2.path.length)\n // We don't need to check for events.length\n // because we know it has at least one element\n callEventHandlerListeners(type._dEH, events, transaction)\n }\n })\n })\n fs.push(() => doc.emit('afterTransaction', [transaction, doc]))\n callAll(fs, [])\n if (transaction._needFormattingCleanup) {\n cleanupYTextAfterTransaction(transaction)\n }\n } finally {\n // Replace deleted items with ItemDeleted / GC.\n // This is where content is actually remove from the Yjs Doc.\n if (doc.gc) {\n tryGcDeleteSet(ds, store, doc.gcFilter)\n }\n tryMergeDeleteSet(ds, store)\n\n // on all affected store.clients props, try to merge\n transaction.afterState.forEach((clock, client) => {\n const beforeClock = transaction.beforeState.get(client) || 0\n if (beforeClock !== clock) {\n const structs = /** @type {Array} */ (store.clients.get(client))\n // we iterate from right to left so we can safely remove entries\n const firstChangePos = math.max(findIndexSS(structs, beforeClock), 1)\n for (let i = structs.length - 1; i >= firstChangePos;) {\n i -= 1 + tryToMergeWithLefts(structs, i)\n }\n }\n })\n // try to merge mergeStructs\n // @todo: it makes more sense to transform mergeStructs to a DS, sort it, and merge from right to left\n // but at the moment DS does not handle duplicates\n for (let i = mergeStructs.length - 1; i >= 0; i--) {\n const { client, clock } = mergeStructs[i].id\n const structs = /** @type {Array} */ (store.clients.get(client))\n const replacedStructPos = findIndexSS(structs, clock)\n if (replacedStructPos + 1 < structs.length) {\n if (tryToMergeWithLefts(structs, replacedStructPos + 1) > 1) {\n continue // no need to perform next check, both are already merged\n }\n }\n if (replacedStructPos > 0) {\n tryToMergeWithLefts(structs, replacedStructPos)\n }\n }\n if (!transaction.local && transaction.afterState.get(doc.clientID) !== transaction.beforeState.get(doc.clientID)) {\n logging.print(logging.ORANGE, logging.BOLD, '[yjs] ', logging.UNBOLD, logging.RED, 'Changed the client-id because another client seems to be using it.')\n doc.clientID = generateNewClientId()\n }\n // @todo Merge all the transactions into one and provide send the data as a single update message\n doc.emit('afterTransactionCleanup', [transaction, doc])\n if (doc._observers.has('update')) {\n const encoder = new UpdateEncoderV1()\n const hasContent = writeUpdateMessageFromTransaction(encoder, transaction)\n if (hasContent) {\n doc.emit('update', [encoder.toUint8Array(), transaction.origin, doc, transaction])\n }\n }\n if (doc._observers.has('updateV2')) {\n const encoder = new UpdateEncoderV2()\n const hasContent = writeUpdateMessageFromTransaction(encoder, transaction)\n if (hasContent) {\n doc.emit('updateV2', [encoder.toUint8Array(), transaction.origin, doc, transaction])\n }\n }\n const { subdocsAdded, subdocsLoaded, subdocsRemoved } = transaction\n if (subdocsAdded.size > 0 || subdocsRemoved.size > 0 || subdocsLoaded.size > 0) {\n subdocsAdded.forEach(subdoc => {\n subdoc.clientID = doc.clientID\n if (subdoc.collectionid == null) {\n subdoc.collectionid = doc.collectionid\n }\n doc.subdocs.add(subdoc)\n })\n subdocsRemoved.forEach(subdoc => doc.subdocs.delete(subdoc))\n doc.emit('subdocs', [{ loaded: subdocsLoaded, added: subdocsAdded, removed: subdocsRemoved }, doc, transaction])\n subdocsRemoved.forEach(subdoc => subdoc.destroy())\n }\n\n if (transactionCleanups.length <= i + 1) {\n doc._transactionCleanups = []\n doc.emit('afterAllTransactions', [doc, transactionCleanups])\n } else {\n cleanupTransactions(transactionCleanups, i + 1)\n }\n }\n }\n}\n\n/**\n * Implements the functionality of `y.transact(()=>{..})`\n *\n * @template T\n * @param {Doc} doc\n * @param {function(Transaction):T} f\n * @param {any} [origin=true]\n * @return {T}\n *\n * @function\n */\nexport const transact = (doc, f, origin = null, local = true) => {\n const transactionCleanups = doc._transactionCleanups\n let initialCall = false\n /**\n * @type {any}\n */\n let result = null\n if (doc._transaction === null) {\n initialCall = true\n doc._transaction = new Transaction(doc, origin, local)\n transactionCleanups.push(doc._transaction)\n if (transactionCleanups.length === 1) {\n doc.emit('beforeAllTransactions', [doc])\n }\n doc.emit('beforeTransaction', [doc._transaction, doc])\n }\n try {\n result = f(doc._transaction)\n } finally {\n if (initialCall) {\n const finishCleanup = doc._transaction === transactionCleanups[0]\n doc._transaction = null\n if (finishCleanup) {\n // The first transaction ended, now process observer calls.\n // Observer call may create new transactions for which we need to call the observers and do cleanup.\n // We don't want to nest these calls, so we execute these calls one after\n // another.\n // Also we need to ensure that all cleanups are called, even if the\n // observes throw errors.\n // This file is full of hacky try {} finally {} blocks to ensure that an\n // event can throw errors and also that the cleanup is called.\n cleanupTransactions(transactionCleanups, 0)\n }\n }\n }\n return result\n}\n", "import {\n mergeDeleteSets,\n iterateDeletedStructs,\n keepItem,\n transact,\n createID,\n redoItem,\n isParentOf,\n followRedone,\n getItemCleanStart,\n isDeleted,\n addToDeleteSet,\n YEvent, Transaction, Doc, Item, GC, DeleteSet, AbstractType // eslint-disable-line\n} from '../internals.js'\n\nimport * as time from 'lib0/time'\nimport * as array from 'lib0/array'\nimport * as logging from 'lib0/logging'\nimport { ObservableV2 } from 'lib0/observable'\n\nexport class StackItem {\n /**\n * @param {DeleteSet} deletions\n * @param {DeleteSet} insertions\n */\n constructor (deletions, insertions) {\n this.insertions = insertions\n this.deletions = deletions\n /**\n * Use this to save and restore metadata like selection range\n */\n this.meta = new Map()\n }\n}\n/**\n * @param {Transaction} tr\n * @param {UndoManager} um\n * @param {StackItem} stackItem\n */\nconst clearUndoManagerStackItem = (tr, um, stackItem) => {\n iterateDeletedStructs(tr, stackItem.deletions, item => {\n if (item instanceof Item && um.scope.some(type => isParentOf(type, item))) {\n keepItem(item, false)\n }\n })\n}\n\n/**\n * @param {UndoManager} undoManager\n * @param {Array} stack\n * @param {'undo'|'redo'} eventType\n * @return {StackItem?}\n */\nconst popStackItem = (undoManager, stack, eventType) => {\n /**\n * Keep a reference to the transaction so we can fire the event with the changedParentTypes\n * @type {any}\n */\n let _tr = null\n const doc = undoManager.doc\n const scope = undoManager.scope\n transact(doc, transaction => {\n while (stack.length > 0 && undoManager.currStackItem === null) {\n const store = doc.store\n const stackItem = /** @type {StackItem} */ (stack.pop())\n /**\n * @type {Set}\n */\n const itemsToRedo = new Set()\n /**\n * @type {Array}\n */\n const itemsToDelete = []\n let performedChange = false\n iterateDeletedStructs(transaction, stackItem.insertions, struct => {\n if (struct instanceof Item) {\n if (struct.redone !== null) {\n let { item, diff } = followRedone(store, struct.id)\n if (diff > 0) {\n item = getItemCleanStart(transaction, createID(item.id.client, item.id.clock + diff))\n }\n struct = item\n }\n if (!struct.deleted && scope.some(type => isParentOf(type, /** @type {Item} */ (struct)))) {\n itemsToDelete.push(struct)\n }\n }\n })\n iterateDeletedStructs(transaction, stackItem.deletions, struct => {\n if (\n struct instanceof Item &&\n scope.some(type => isParentOf(type, struct)) &&\n // Never redo structs in stackItem.insertions because they were created and deleted in the same capture interval.\n !isDeleted(stackItem.insertions, struct.id)\n ) {\n itemsToRedo.add(struct)\n }\n })\n itemsToRedo.forEach(struct => {\n performedChange = redoItem(transaction, struct, itemsToRedo, stackItem.insertions, undoManager.ignoreRemoteMapChanges, undoManager) !== null || performedChange\n })\n // We want to delete in reverse order so that children are deleted before\n // parents, so we have more information available when items are filtered.\n for (let i = itemsToDelete.length - 1; i >= 0; i--) {\n const item = itemsToDelete[i]\n if (undoManager.deleteFilter(item)) {\n item.delete(transaction)\n performedChange = true\n }\n }\n undoManager.currStackItem = performedChange ? stackItem : null\n }\n transaction.changed.forEach((subProps, type) => {\n // destroy search marker if necessary\n if (subProps.has(null) && type._searchMarker) {\n type._searchMarker.length = 0\n }\n })\n _tr = transaction\n }, undoManager)\n const res = undoManager.currStackItem\n if (res != null) {\n const changedParentTypes = _tr.changedParentTypes\n undoManager.emit('stack-item-popped', [{ stackItem: res, type: eventType, changedParentTypes, origin: undoManager }, undoManager])\n undoManager.currStackItem = null\n }\n return res\n}\n\n/**\n * @typedef {Object} UndoManagerOptions\n * @property {number} [UndoManagerOptions.captureTimeout=500]\n * @property {function(Transaction):boolean} [UndoManagerOptions.captureTransaction] Do not capture changes of a Transaction if result false.\n * @property {function(Item):boolean} [UndoManagerOptions.deleteFilter=()=>true] Sometimes\n * it is necessary to filter what an Undo/Redo operation can delete. If this\n * filter returns false, the type/item won't be deleted even it is in the\n * undo/redo scope.\n * @property {Set} [UndoManagerOptions.trackedOrigins=new Set([null])]\n * @property {boolean} [ignoreRemoteMapChanges] Experimental. By default, the UndoManager will never overwrite remote changes. Enable this property to enable overwriting remote changes on key-value changes (Y.Map, properties on Y.Xml, etc..).\n * @property {Doc} [doc] The document that this UndoManager operates on. Only needed if typeScope is empty.\n */\n\n/**\n * @typedef {Object} StackItemEvent\n * @property {StackItem} StackItemEvent.stackItem\n * @property {any} StackItemEvent.origin\n * @property {'undo'|'redo'} StackItemEvent.type\n * @property {Map>,Array>>} StackItemEvent.changedParentTypes\n */\n\n/**\n * Fires 'stack-item-added' event when a stack item was added to either the undo- or\n * the redo-stack. You may store additional stack information via the\n * metadata property on `event.stackItem.meta` (it is a `Map` of metadata properties).\n * Fires 'stack-item-popped' event when a stack item was popped from either the\n * undo- or the redo-stack. You may restore the saved stack information from `event.stackItem.meta`.\n *\n * @extends {ObservableV2<{'stack-item-added':function(StackItemEvent, UndoManager):void, 'stack-item-popped': function(StackItemEvent, UndoManager):void, 'stack-cleared': function({ undoStackCleared: boolean, redoStackCleared: boolean }):void, 'stack-item-updated': function(StackItemEvent, UndoManager):void }>}\n */\nexport class UndoManager extends ObservableV2 {\n /**\n * @param {AbstractType|Array>} typeScope Accepts either a single type, or an array of types\n * @param {UndoManagerOptions} options\n */\n constructor (typeScope, {\n captureTimeout = 500,\n captureTransaction = _tr => true,\n deleteFilter = () => true,\n trackedOrigins = new Set([null]),\n ignoreRemoteMapChanges = false,\n doc = /** @type {Doc} */ (array.isArray(typeScope) ? typeScope[0].doc : typeScope.doc)\n } = {}) {\n super()\n /**\n * @type {Array>}\n */\n this.scope = []\n this.doc = doc\n this.addToScope(typeScope)\n this.deleteFilter = deleteFilter\n trackedOrigins.add(this)\n this.trackedOrigins = trackedOrigins\n this.captureTransaction = captureTransaction\n /**\n * @type {Array}\n */\n this.undoStack = []\n /**\n * @type {Array}\n */\n this.redoStack = []\n /**\n * Whether the client is currently undoing (calling UndoManager.undo)\n *\n * @type {boolean}\n */\n this.undoing = false\n this.redoing = false\n /**\n * The currently popped stack item if UndoManager.undoing or UndoManager.redoing\n *\n * @type {StackItem|null}\n */\n this.currStackItem = null\n this.lastChange = 0\n this.ignoreRemoteMapChanges = ignoreRemoteMapChanges\n this.captureTimeout = captureTimeout\n /**\n * @param {Transaction} transaction\n */\n this.afterTransactionHandler = transaction => {\n // Only track certain transactions\n if (\n !this.captureTransaction(transaction) ||\n !this.scope.some(type => transaction.changedParentTypes.has(type)) ||\n (!this.trackedOrigins.has(transaction.origin) && (!transaction.origin || !this.trackedOrigins.has(transaction.origin.constructor)))\n ) {\n return\n }\n const undoing = this.undoing\n const redoing = this.redoing\n const stack = undoing ? this.redoStack : this.undoStack\n if (undoing) {\n this.stopCapturing() // next undo should not be appended to last stack item\n } else if (!redoing) {\n // neither undoing nor redoing: delete redoStack\n this.clear(false, true)\n }\n const insertions = new DeleteSet()\n transaction.afterState.forEach((endClock, client) => {\n const startClock = transaction.beforeState.get(client) || 0\n const len = endClock - startClock\n if (len > 0) {\n addToDeleteSet(insertions, client, startClock, len)\n }\n })\n const now = time.getUnixTime()\n let didAdd = false\n if (this.lastChange > 0 && now - this.lastChange < this.captureTimeout && stack.length > 0 && !undoing && !redoing) {\n // append change to last stack op\n const lastOp = stack[stack.length - 1]\n lastOp.deletions = mergeDeleteSets([lastOp.deletions, transaction.deleteSet])\n lastOp.insertions = mergeDeleteSets([lastOp.insertions, insertions])\n } else {\n // create a new stack op\n stack.push(new StackItem(transaction.deleteSet, insertions))\n didAdd = true\n }\n if (!undoing && !redoing) {\n this.lastChange = now\n }\n // make sure that deleted structs are not gc'd\n iterateDeletedStructs(transaction, transaction.deleteSet, /** @param {Item|GC} item */ item => {\n if (item instanceof Item && this.scope.some(type => isParentOf(type, item))) {\n keepItem(item, true)\n }\n })\n /**\n * @type {[StackItemEvent, UndoManager]}\n */\n const changeEvent = [{ stackItem: stack[stack.length - 1], origin: transaction.origin, type: undoing ? 'redo' : 'undo', changedParentTypes: transaction.changedParentTypes }, this]\n if (didAdd) {\n this.emit('stack-item-added', changeEvent)\n } else {\n this.emit('stack-item-updated', changeEvent)\n }\n }\n this.doc.on('afterTransaction', this.afterTransactionHandler)\n this.doc.on('destroy', () => {\n this.destroy()\n })\n }\n\n /**\n * @param {Array> | AbstractType} ytypes\n */\n addToScope (ytypes) {\n ytypes = array.isArray(ytypes) ? ytypes : [ytypes]\n ytypes.forEach(ytype => {\n if (this.scope.every(yt => yt !== ytype)) {\n if (ytype.doc !== this.doc) logging.warn('[yjs#509] Not same Y.Doc') // use MultiDocUndoManager instead. also see https://github.com/yjs/yjs/issues/509\n this.scope.push(ytype)\n }\n })\n }\n\n /**\n * @param {any} origin\n */\n addTrackedOrigin (origin) {\n this.trackedOrigins.add(origin)\n }\n\n /**\n * @param {any} origin\n */\n removeTrackedOrigin (origin) {\n this.trackedOrigins.delete(origin)\n }\n\n clear (clearUndoStack = true, clearRedoStack = true) {\n if ((clearUndoStack && this.canUndo()) || (clearRedoStack && this.canRedo())) {\n this.doc.transact(tr => {\n if (clearUndoStack) {\n this.undoStack.forEach(item => clearUndoManagerStackItem(tr, this, item))\n this.undoStack = []\n }\n if (clearRedoStack) {\n this.redoStack.forEach(item => clearUndoManagerStackItem(tr, this, item))\n this.redoStack = []\n }\n this.emit('stack-cleared', [{ undoStackCleared: clearUndoStack, redoStackCleared: clearRedoStack }])\n })\n }\n }\n\n /**\n * UndoManager merges Undo-StackItem if they are created within time-gap\n * smaller than `options.captureTimeout`. Call `um.stopCapturing()` so that the next\n * StackItem won't be merged.\n *\n *\n * @example\n * // without stopCapturing\n * ytext.insert(0, 'a')\n * ytext.insert(1, 'b')\n * um.undo()\n * ytext.toString() // => '' (note that 'ab' was removed)\n * // with stopCapturing\n * ytext.insert(0, 'a')\n * um.stopCapturing()\n * ytext.insert(0, 'b')\n * um.undo()\n * ytext.toString() // => 'a' (note that only 'b' was removed)\n *\n */\n stopCapturing () {\n this.lastChange = 0\n }\n\n /**\n * Undo last changes on type.\n *\n * @return {StackItem?} Returns StackItem if a change was applied\n */\n undo () {\n this.undoing = true\n let res\n try {\n res = popStackItem(this, this.undoStack, 'undo')\n } finally {\n this.undoing = false\n }\n return res\n }\n\n /**\n * Redo last undo operation.\n *\n * @return {StackItem?} Returns StackItem if a change was applied\n */\n redo () {\n this.redoing = true\n let res\n try {\n res = popStackItem(this, this.redoStack, 'redo')\n } finally {\n this.redoing = false\n }\n return res\n }\n\n /**\n * Are undo steps available?\n *\n * @return {boolean} `true` if undo is possible\n */\n canUndo () {\n return this.undoStack.length > 0\n }\n\n /**\n * Are redo steps available?\n *\n * @return {boolean} `true` if redo is possible\n */\n canRedo () {\n return this.redoStack.length > 0\n }\n\n destroy () {\n this.trackedOrigins.delete(this)\n this.doc.off('afterTransaction', this.afterTransactionHandler)\n super.destroy()\n }\n}\n", "import * as binary from 'lib0/binary'\nimport * as decoding from 'lib0/decoding'\nimport * as encoding from 'lib0/encoding'\nimport * as error from 'lib0/error'\nimport * as f from 'lib0/function'\nimport * as logging from 'lib0/logging'\nimport * as map from 'lib0/map'\nimport * as math from 'lib0/math'\nimport * as string from 'lib0/string'\n\nimport {\n ContentAny,\n ContentBinary,\n ContentDeleted,\n ContentDoc,\n ContentEmbed,\n ContentFormat,\n ContentJSON,\n ContentString,\n ContentType,\n createID,\n decodeStateVector,\n DSEncoderV1,\n DSEncoderV2,\n GC,\n Item,\n mergeDeleteSets,\n readDeleteSet,\n readItemContent,\n Skip,\n UpdateDecoderV1,\n UpdateDecoderV2,\n UpdateEncoderV1,\n UpdateEncoderV2,\n writeDeleteSet,\n YXmlElement,\n YXmlHook\n} from '../internals.js'\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n */\nfunction * lazyStructReaderGenerator (decoder) {\n const numOfStateUpdates = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numOfStateUpdates; i++) {\n const numberOfStructs = decoding.readVarUint(decoder.restDecoder)\n const client = decoder.readClient()\n let clock = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numberOfStructs; i++) {\n const info = decoder.readInfo()\n // @todo use switch instead of ifs\n if (info === 10) {\n const len = decoding.readVarUint(decoder.restDecoder)\n yield new Skip(createID(client, clock), len)\n clock += len\n } else if ((binary.BITS5 & info) !== 0) {\n const cantCopyParentInfo = (info & (binary.BIT7 | binary.BIT8)) === 0\n // If parent = null and neither left nor right are defined, then we know that `parent` is child of `y`\n // and we read the next string as parentYKey.\n // It indicates how we store/retrieve parent from `y.share`\n // @type {string|null}\n const struct = new Item(\n createID(client, clock),\n null, // left\n (info & binary.BIT8) === binary.BIT8 ? decoder.readLeftID() : null, // origin\n null, // right\n (info & binary.BIT7) === binary.BIT7 ? decoder.readRightID() : null, // right origin\n // @ts-ignore Force writing a string here.\n cantCopyParentInfo ? (decoder.readParentInfo() ? decoder.readString() : decoder.readLeftID()) : null, // parent\n cantCopyParentInfo && (info & binary.BIT6) === binary.BIT6 ? decoder.readString() : null, // parentSub\n readItemContent(decoder, info) // item content\n )\n yield struct\n clock += struct.length\n } else {\n const len = decoder.readLen()\n yield new GC(createID(client, clock), len)\n clock += len\n }\n }\n }\n}\n\nexport class LazyStructReader {\n /**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @param {boolean} filterSkips\n */\n constructor (decoder, filterSkips) {\n this.gen = lazyStructReaderGenerator(decoder)\n /**\n * @type {null | Item | Skip | GC}\n */\n this.curr = null\n this.done = false\n this.filterSkips = filterSkips\n this.next()\n }\n\n /**\n * @return {Item | GC | Skip |null}\n */\n next () {\n // ignore \"Skip\" structs\n do {\n this.curr = this.gen.next().value || null\n } while (this.filterSkips && this.curr !== null && this.curr.constructor === Skip)\n return this.curr\n }\n}\n\n/**\n * @param {Uint8Array} update\n *\n */\nexport const logUpdate = update => logUpdateV2(update, UpdateDecoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {typeof UpdateDecoderV2 | typeof UpdateDecoderV1} [YDecoder]\n *\n */\nexport const logUpdateV2 = (update, YDecoder = UpdateDecoderV2) => {\n const structs = []\n const updateDecoder = new YDecoder(decoding.createDecoder(update))\n const lazyDecoder = new LazyStructReader(updateDecoder, false)\n for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) {\n structs.push(curr)\n }\n logging.print('Structs: ', structs)\n const ds = readDeleteSet(updateDecoder)\n logging.print('DeleteSet: ', ds)\n}\n\n/**\n * @param {Uint8Array} update\n *\n */\nexport const decodeUpdate = (update) => decodeUpdateV2(update, UpdateDecoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {typeof UpdateDecoderV2 | typeof UpdateDecoderV1} [YDecoder]\n *\n */\nexport const decodeUpdateV2 = (update, YDecoder = UpdateDecoderV2) => {\n const structs = []\n const updateDecoder = new YDecoder(decoding.createDecoder(update))\n const lazyDecoder = new LazyStructReader(updateDecoder, false)\n for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) {\n structs.push(curr)\n }\n return {\n structs,\n ds: readDeleteSet(updateDecoder)\n }\n}\n\nexport class LazyStructWriter {\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n constructor (encoder) {\n this.currClient = 0\n this.startClock = 0\n this.written = 0\n this.encoder = encoder\n /**\n * We want to write operations lazily, but also we need to know beforehand how many operations we want to write for each client.\n *\n * This kind of meta-information (#clients, #structs-per-client-written) is written to the restEncoder.\n *\n * We fragment the restEncoder and store a slice of it per-client until we know how many clients there are.\n * When we flush (toUint8Array) we write the restEncoder using the fragments and the meta-information.\n *\n * @type {Array<{ written: number, restEncoder: Uint8Array }>}\n */\n this.clientStructs = []\n }\n}\n\n/**\n * @param {Array} updates\n * @return {Uint8Array}\n */\nexport const mergeUpdates = updates => mergeUpdatesV2(updates, UpdateDecoderV1, UpdateEncoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {typeof DSEncoderV1 | typeof DSEncoderV2} YEncoder\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} YDecoder\n * @return {Uint8Array}\n */\nexport const encodeStateVectorFromUpdateV2 = (update, YEncoder = DSEncoderV2, YDecoder = UpdateDecoderV2) => {\n const encoder = new YEncoder()\n const updateDecoder = new LazyStructReader(new YDecoder(decoding.createDecoder(update)), false)\n let curr = updateDecoder.curr\n if (curr !== null) {\n let size = 0\n let currClient = curr.id.client\n let stopCounting = curr.id.clock !== 0 // must start at 0\n let currClock = stopCounting ? 0 : curr.id.clock + curr.length\n for (; curr !== null; curr = updateDecoder.next()) {\n if (currClient !== curr.id.client) {\n if (currClock !== 0) {\n size++\n // We found a new client\n // write what we have to the encoder\n encoding.writeVarUint(encoder.restEncoder, currClient)\n encoding.writeVarUint(encoder.restEncoder, currClock)\n }\n currClient = curr.id.client\n currClock = 0\n stopCounting = curr.id.clock !== 0\n }\n // we ignore skips\n if (curr.constructor === Skip) {\n stopCounting = true\n }\n if (!stopCounting) {\n currClock = curr.id.clock + curr.length\n }\n }\n // write what we have\n if (currClock !== 0) {\n size++\n encoding.writeVarUint(encoder.restEncoder, currClient)\n encoding.writeVarUint(encoder.restEncoder, currClock)\n }\n // prepend the size of the state vector\n const enc = encoding.createEncoder()\n encoding.writeVarUint(enc, size)\n encoding.writeBinaryEncoder(enc, encoder.restEncoder)\n encoder.restEncoder = enc\n return encoder.toUint8Array()\n } else {\n encoding.writeVarUint(encoder.restEncoder, 0)\n return encoder.toUint8Array()\n }\n}\n\n/**\n * @param {Uint8Array} update\n * @return {Uint8Array}\n */\nexport const encodeStateVectorFromUpdate = update => encodeStateVectorFromUpdateV2(update, DSEncoderV1, UpdateDecoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} YDecoder\n * @return {{ from: Map, to: Map }}\n */\nexport const parseUpdateMetaV2 = (update, YDecoder = UpdateDecoderV2) => {\n /**\n * @type {Map}\n */\n const from = new Map()\n /**\n * @type {Map}\n */\n const to = new Map()\n const updateDecoder = new LazyStructReader(new YDecoder(decoding.createDecoder(update)), false)\n let curr = updateDecoder.curr\n if (curr !== null) {\n let currClient = curr.id.client\n let currClock = curr.id.clock\n // write the beginning to `from`\n from.set(currClient, currClock)\n for (; curr !== null; curr = updateDecoder.next()) {\n if (currClient !== curr.id.client) {\n // We found a new client\n // write the end to `to`\n to.set(currClient, currClock)\n // write the beginning to `from`\n from.set(curr.id.client, curr.id.clock)\n // update currClient\n currClient = curr.id.client\n }\n currClock = curr.id.clock + curr.length\n }\n // write the end to `to`\n to.set(currClient, currClock)\n }\n return { from, to }\n}\n\n/**\n * @param {Uint8Array} update\n * @return {{ from: Map, to: Map }}\n */\nexport const parseUpdateMeta = update => parseUpdateMetaV2(update, UpdateDecoderV1)\n\n/**\n * This method is intended to slice any kind of struct and retrieve the right part.\n * It does not handle side-effects, so it should only be used by the lazy-encoder.\n *\n * @param {Item | GC | Skip} left\n * @param {number} diff\n * @return {Item | GC}\n */\nconst sliceStruct = (left, diff) => {\n if (left.constructor === GC) {\n const { client, clock } = left.id\n return new GC(createID(client, clock + diff), left.length - diff)\n } else if (left.constructor === Skip) {\n const { client, clock } = left.id\n return new Skip(createID(client, clock + diff), left.length - diff)\n } else {\n const leftItem = /** @type {Item} */ (left)\n const { client, clock } = leftItem.id\n return new Item(\n createID(client, clock + diff),\n null,\n createID(client, clock + diff - 1),\n null,\n leftItem.rightOrigin,\n leftItem.parent,\n leftItem.parentSub,\n leftItem.content.splice(diff)\n )\n }\n}\n\n/**\n *\n * This function works similarly to `readUpdateV2`.\n *\n * @param {Array} updates\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} [YDecoder]\n * @param {typeof UpdateEncoderV1 | typeof UpdateEncoderV2} [YEncoder]\n * @return {Uint8Array}\n */\nexport const mergeUpdatesV2 = (updates, YDecoder = UpdateDecoderV2, YEncoder = UpdateEncoderV2) => {\n if (updates.length === 1) {\n return updates[0]\n }\n const updateDecoders = updates.map(update => new YDecoder(decoding.createDecoder(update)))\n let lazyStructDecoders = updateDecoders.map(decoder => new LazyStructReader(decoder, true))\n\n /**\n * @todo we don't need offset because we always slice before\n * @type {null | { struct: Item | GC | Skip, offset: number }}\n */\n let currWrite = null\n\n const updateEncoder = new YEncoder()\n // write structs lazily\n const lazyStructEncoder = new LazyStructWriter(updateEncoder)\n\n // Note: We need to ensure that all lazyStructDecoders are fully consumed\n // Note: Should merge document updates whenever possible - even from different updates\n // Note: Should handle that some operations cannot be applied yet ()\n\n while (true) {\n // Write higher clients first ⇒ sort by clientID & clock and remove decoders without content\n lazyStructDecoders = lazyStructDecoders.filter(dec => dec.curr !== null)\n lazyStructDecoders.sort(\n /** @type {function(any,any):number} */ (dec1, dec2) => {\n if (dec1.curr.id.client === dec2.curr.id.client) {\n const clockDiff = dec1.curr.id.clock - dec2.curr.id.clock\n if (clockDiff === 0) {\n // @todo remove references to skip since the structDecoders must filter Skips.\n return dec1.curr.constructor === dec2.curr.constructor\n ? 0\n : dec1.curr.constructor === Skip ? 1 : -1 // we are filtering skips anyway.\n } else {\n return clockDiff\n }\n } else {\n return dec2.curr.id.client - dec1.curr.id.client\n }\n }\n )\n if (lazyStructDecoders.length === 0) {\n break\n }\n const currDecoder = lazyStructDecoders[0]\n // write from currDecoder until the next operation is from another client or if filler-struct\n // then we need to reorder the decoders and find the next operation to write\n const firstClient = /** @type {Item | GC} */ (currDecoder.curr).id.client\n\n if (currWrite !== null) {\n let curr = /** @type {Item | GC | null} */ (currDecoder.curr)\n let iterated = false\n\n // iterate until we find something that we haven't written already\n // remember: first the high client-ids are written\n while (curr !== null && curr.id.clock + curr.length <= currWrite.struct.id.clock + currWrite.struct.length && curr.id.client >= currWrite.struct.id.client) {\n curr = currDecoder.next()\n iterated = true\n }\n if (\n curr === null || // current decoder is empty\n curr.id.client !== firstClient || // check whether there is another decoder that has has updates from `firstClient`\n (iterated && curr.id.clock > currWrite.struct.id.clock + currWrite.struct.length) // the above while loop was used and we are potentially missing updates\n ) {\n continue\n }\n\n if (firstClient !== currWrite.struct.id.client) {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n currWrite = { struct: curr, offset: 0 }\n currDecoder.next()\n } else {\n if (currWrite.struct.id.clock + currWrite.struct.length < curr.id.clock) {\n // @todo write currStruct & set currStruct = Skip(clock = currStruct.id.clock + currStruct.length, length = curr.id.clock - self.clock)\n if (currWrite.struct.constructor === Skip) {\n // extend existing skip\n currWrite.struct.length = curr.id.clock + curr.length - currWrite.struct.id.clock\n } else {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n const diff = curr.id.clock - currWrite.struct.id.clock - currWrite.struct.length\n /**\n * @type {Skip}\n */\n const struct = new Skip(createID(firstClient, currWrite.struct.id.clock + currWrite.struct.length), diff)\n currWrite = { struct, offset: 0 }\n }\n } else { // if (currWrite.struct.id.clock + currWrite.struct.length >= curr.id.clock) {\n const diff = currWrite.struct.id.clock + currWrite.struct.length - curr.id.clock\n if (diff > 0) {\n if (currWrite.struct.constructor === Skip) {\n // prefer to slice Skip because the other struct might contain more information\n currWrite.struct.length -= diff\n } else {\n curr = sliceStruct(curr, diff)\n }\n }\n if (!currWrite.struct.mergeWith(/** @type {any} */ (curr))) {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n currWrite = { struct: curr, offset: 0 }\n currDecoder.next()\n }\n }\n }\n } else {\n currWrite = { struct: /** @type {Item | GC} */ (currDecoder.curr), offset: 0 }\n currDecoder.next()\n }\n for (\n let next = currDecoder.curr;\n next !== null && next.id.client === firstClient && next.id.clock === currWrite.struct.id.clock + currWrite.struct.length && next.constructor !== Skip;\n next = currDecoder.next()\n ) {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n currWrite = { struct: next, offset: 0 }\n }\n }\n if (currWrite !== null) {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n currWrite = null\n }\n finishLazyStructWriting(lazyStructEncoder)\n\n const dss = updateDecoders.map(decoder => readDeleteSet(decoder))\n const ds = mergeDeleteSets(dss)\n writeDeleteSet(updateEncoder, ds)\n return updateEncoder.toUint8Array()\n}\n\n/**\n * @param {Uint8Array} update\n * @param {Uint8Array} sv\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} [YDecoder]\n * @param {typeof UpdateEncoderV1 | typeof UpdateEncoderV2} [YEncoder]\n */\nexport const diffUpdateV2 = (update, sv, YDecoder = UpdateDecoderV2, YEncoder = UpdateEncoderV2) => {\n const state = decodeStateVector(sv)\n const encoder = new YEncoder()\n const lazyStructWriter = new LazyStructWriter(encoder)\n const decoder = new YDecoder(decoding.createDecoder(update))\n const reader = new LazyStructReader(decoder, false)\n while (reader.curr) {\n const curr = reader.curr\n const currClient = curr.id.client\n const svClock = state.get(currClient) || 0\n if (reader.curr.constructor === Skip) {\n // the first written struct shouldn't be a skip\n reader.next()\n continue\n }\n if (curr.id.clock + curr.length > svClock) {\n writeStructToLazyStructWriter(lazyStructWriter, curr, math.max(svClock - curr.id.clock, 0))\n reader.next()\n while (reader.curr && reader.curr.id.client === currClient) {\n writeStructToLazyStructWriter(lazyStructWriter, reader.curr, 0)\n reader.next()\n }\n } else {\n // read until something new comes up\n while (reader.curr && reader.curr.id.client === currClient && reader.curr.id.clock + reader.curr.length <= svClock) {\n reader.next()\n }\n }\n }\n finishLazyStructWriting(lazyStructWriter)\n // write ds\n const ds = readDeleteSet(decoder)\n writeDeleteSet(encoder, ds)\n return encoder.toUint8Array()\n}\n\n/**\n * @param {Uint8Array} update\n * @param {Uint8Array} sv\n */\nexport const diffUpdate = (update, sv) => diffUpdateV2(update, sv, UpdateDecoderV1, UpdateEncoderV1)\n\n/**\n * @param {LazyStructWriter} lazyWriter\n */\nconst flushLazyStructWriter = lazyWriter => {\n if (lazyWriter.written > 0) {\n lazyWriter.clientStructs.push({ written: lazyWriter.written, restEncoder: encoding.toUint8Array(lazyWriter.encoder.restEncoder) })\n lazyWriter.encoder.restEncoder = encoding.createEncoder()\n lazyWriter.written = 0\n }\n}\n\n/**\n * @param {LazyStructWriter} lazyWriter\n * @param {Item | GC} struct\n * @param {number} offset\n */\nconst writeStructToLazyStructWriter = (lazyWriter, struct, offset) => {\n // flush curr if we start another client\n if (lazyWriter.written > 0 && lazyWriter.currClient !== struct.id.client) {\n flushLazyStructWriter(lazyWriter)\n }\n if (lazyWriter.written === 0) {\n lazyWriter.currClient = struct.id.client\n // write next client\n lazyWriter.encoder.writeClient(struct.id.client)\n // write startClock\n encoding.writeVarUint(lazyWriter.encoder.restEncoder, struct.id.clock + offset)\n }\n struct.write(lazyWriter.encoder, offset)\n lazyWriter.written++\n}\n/**\n * Call this function when we collected all parts and want to\n * put all the parts together. After calling this method,\n * you can continue using the UpdateEncoder.\n *\n * @param {LazyStructWriter} lazyWriter\n */\nconst finishLazyStructWriting = (lazyWriter) => {\n flushLazyStructWriter(lazyWriter)\n\n // this is a fresh encoder because we called flushCurr\n const restEncoder = lazyWriter.encoder.restEncoder\n\n /**\n * Now we put all the fragments together.\n * This works similarly to `writeClientsStructs`\n */\n\n // write # states that were updated - i.e. the clients\n encoding.writeVarUint(restEncoder, lazyWriter.clientStructs.length)\n\n for (let i = 0; i < lazyWriter.clientStructs.length; i++) {\n const partStructs = lazyWriter.clientStructs[i]\n /**\n * Works similarly to `writeStructs`\n */\n // write # encoded structs\n encoding.writeVarUint(restEncoder, partStructs.written)\n // write the rest of the fragment\n encoding.writeUint8Array(restEncoder, partStructs.restEncoder)\n }\n}\n\n/**\n * @param {Uint8Array} update\n * @param {function(Item|GC|Skip):Item|GC|Skip} blockTransformer\n * @param {typeof UpdateDecoderV2 | typeof UpdateDecoderV1} YDecoder\n * @param {typeof UpdateEncoderV2 | typeof UpdateEncoderV1 } YEncoder\n */\nexport const convertUpdateFormat = (update, blockTransformer, YDecoder, YEncoder) => {\n const updateDecoder = new YDecoder(decoding.createDecoder(update))\n const lazyDecoder = new LazyStructReader(updateDecoder, false)\n const updateEncoder = new YEncoder()\n const lazyWriter = new LazyStructWriter(updateEncoder)\n for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) {\n writeStructToLazyStructWriter(lazyWriter, blockTransformer(curr), 0)\n }\n finishLazyStructWriting(lazyWriter)\n const ds = readDeleteSet(updateDecoder)\n writeDeleteSet(updateEncoder, ds)\n return updateEncoder.toUint8Array()\n}\n\n/**\n * @typedef {Object} ObfuscatorOptions\n * @property {boolean} [ObfuscatorOptions.formatting=true]\n * @property {boolean} [ObfuscatorOptions.subdocs=true]\n * @property {boolean} [ObfuscatorOptions.yxml=true] Whether to obfuscate nodeName / hookName\n */\n\n/**\n * @param {ObfuscatorOptions} obfuscator\n */\nconst createObfuscator = ({ formatting = true, subdocs = true, yxml = true } = {}) => {\n let i = 0\n const mapKeyCache = map.create()\n const nodeNameCache = map.create()\n const formattingKeyCache = map.create()\n const formattingValueCache = map.create()\n formattingValueCache.set(null, null) // end of a formatting range should always be the end of a formatting range\n /**\n * @param {Item|GC|Skip} block\n * @return {Item|GC|Skip}\n */\n return block => {\n switch (block.constructor) {\n case GC:\n case Skip:\n return block\n case Item: {\n const item = /** @type {Item} */ (block)\n const content = item.content\n switch (content.constructor) {\n case ContentDeleted:\n break\n case ContentType: {\n if (yxml) {\n const type = /** @type {ContentType} */ (content).type\n if (type instanceof YXmlElement) {\n type.nodeName = map.setIfUndefined(nodeNameCache, type.nodeName, () => 'node-' + i)\n }\n if (type instanceof YXmlHook) {\n type.hookName = map.setIfUndefined(nodeNameCache, type.hookName, () => 'hook-' + i)\n }\n }\n break\n }\n case ContentAny: {\n const c = /** @type {ContentAny} */ (content)\n c.arr = c.arr.map(() => i)\n break\n }\n case ContentBinary: {\n const c = /** @type {ContentBinary} */ (content)\n c.content = new Uint8Array([i])\n break\n }\n case ContentDoc: {\n const c = /** @type {ContentDoc} */ (content)\n if (subdocs) {\n c.opts = {}\n c.doc.guid = i + ''\n }\n break\n }\n case ContentEmbed: {\n const c = /** @type {ContentEmbed} */ (content)\n c.embed = {}\n break\n }\n case ContentFormat: {\n const c = /** @type {ContentFormat} */ (content)\n if (formatting) {\n c.key = map.setIfUndefined(formattingKeyCache, c.key, () => i + '')\n c.value = map.setIfUndefined(formattingValueCache, c.value, () => ({ i }))\n }\n break\n }\n case ContentJSON: {\n const c = /** @type {ContentJSON} */ (content)\n c.arr = c.arr.map(() => i)\n break\n }\n case ContentString: {\n const c = /** @type {ContentString} */ (content)\n c.str = string.repeat((i % 10) + '', c.str.length)\n break\n }\n default:\n // unknown content type\n error.unexpectedCase()\n }\n if (item.parentSub) {\n item.parentSub = map.setIfUndefined(mapKeyCache, item.parentSub, () => i + '')\n }\n i++\n return block\n }\n default:\n // unknown block-type\n error.unexpectedCase()\n }\n }\n}\n\n/**\n * This function obfuscates the content of a Yjs update. This is useful to share\n * buggy Yjs documents while significantly limiting the possibility that a\n * developer can on the user. Note that it might still be possible to deduce\n * some information by analyzing the \"structure\" of the document or by analyzing\n * the typing behavior using the CRDT-related metadata that is still kept fully\n * intact.\n *\n * @param {Uint8Array} update\n * @param {ObfuscatorOptions} [opts]\n */\nexport const obfuscateUpdate = (update, opts) => convertUpdateFormat(update, createObfuscator(opts), UpdateDecoderV1, UpdateEncoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {ObfuscatorOptions} [opts]\n */\nexport const obfuscateUpdateV2 = (update, opts) => convertUpdateFormat(update, createObfuscator(opts), UpdateDecoderV2, UpdateEncoderV2)\n\n/**\n * @param {Uint8Array} update\n */\nexport const convertUpdateFormatV1ToV2 = update => convertUpdateFormat(update, f.id, UpdateDecoderV1, UpdateEncoderV2)\n\n/**\n * @param {Uint8Array} update\n */\nexport const convertUpdateFormatV2ToV1 = update => convertUpdateFormat(update, f.id, UpdateDecoderV2, UpdateEncoderV1)\n", "import {\n isDeleted,\n Item, AbstractType, Transaction, AbstractStruct // eslint-disable-line\n} from '../internals.js'\n\nimport * as set from 'lib0/set'\nimport * as array from 'lib0/array'\nimport * as error from 'lib0/error'\n\nconst errorComputeChanges = 'You must not compute changes after the event-handler fired.'\n\n/**\n * @template {AbstractType} T\n * YEvent describes the changes on a YType.\n */\nexport class YEvent {\n /**\n * @param {T} target The changed type.\n * @param {Transaction} transaction\n */\n constructor (target, transaction) {\n /**\n * The type on which this event was created on.\n * @type {T}\n */\n this.target = target\n /**\n * The current target on which the observe callback is called.\n * @type {AbstractType}\n */\n this.currentTarget = target\n /**\n * The transaction that triggered this event.\n * @type {Transaction}\n */\n this.transaction = transaction\n /**\n * @type {Object|null}\n */\n this._changes = null\n /**\n * @type {null | Map}\n */\n this._keys = null\n /**\n * @type {null | Array<{ insert?: string | Array | object | AbstractType, retain?: number, delete?: number, attributes?: Object }>}\n */\n this._delta = null\n /**\n * @type {Array|null}\n */\n this._path = null\n }\n\n /**\n * Computes the path from `y` to the changed type.\n *\n * @todo v14 should standardize on path: Array<{parent, index}> because that is easier to work with.\n *\n * The following property holds:\n * @example\n * let type = y\n * event.path.forEach(dir => {\n * type = type.get(dir)\n * })\n * type === event.target // => true\n */\n get path () {\n return this._path || (this._path = getPathTo(this.currentTarget, this.target))\n }\n\n /**\n * Check if a struct is deleted by this event.\n *\n * In contrast to change.deleted, this method also returns true if the struct was added and then deleted.\n *\n * @param {AbstractStruct} struct\n * @return {boolean}\n */\n deletes (struct) {\n return isDeleted(this.transaction.deleteSet, struct.id)\n }\n\n /**\n * @type {Map}\n */\n get keys () {\n if (this._keys === null) {\n if (this.transaction.doc._transactionCleanups.length === 0) {\n throw error.create(errorComputeChanges)\n }\n const keys = new Map()\n const target = this.target\n const changed = /** @type Set */ (this.transaction.changed.get(target))\n changed.forEach(key => {\n if (key !== null) {\n const item = /** @type {Item} */ (target._map.get(key))\n /**\n * @type {'delete' | 'add' | 'update'}\n */\n let action\n let oldValue\n if (this.adds(item)) {\n let prev = item.left\n while (prev !== null && this.adds(prev)) {\n prev = prev.left\n }\n if (this.deletes(item)) {\n if (prev !== null && this.deletes(prev)) {\n action = 'delete'\n oldValue = array.last(prev.content.getContent())\n } else {\n return\n }\n } else {\n if (prev !== null && this.deletes(prev)) {\n action = 'update'\n oldValue = array.last(prev.content.getContent())\n } else {\n action = 'add'\n oldValue = undefined\n }\n }\n } else {\n if (this.deletes(item)) {\n action = 'delete'\n oldValue = array.last(/** @type {Item} */ item.content.getContent())\n } else {\n return // nop\n }\n }\n keys.set(key, { action, oldValue })\n }\n })\n this._keys = keys\n }\n return this._keys\n }\n\n /**\n * This is a computed property. Note that this can only be safely computed during the\n * event call. Computing this property after other changes happened might result in\n * unexpected behavior (incorrect computation of deltas). A safe way to collect changes\n * is to store the `changes` or the `delta` object. Avoid storing the `transaction` object.\n *\n * @type {Array<{insert?: string | Array | object | AbstractType, retain?: number, delete?: number, attributes?: Object}>}\n */\n get delta () {\n return this.changes.delta\n }\n\n /**\n * Check if a struct is added by this event.\n *\n * In contrast to change.deleted, this method also returns true if the struct was added and then deleted.\n *\n * @param {AbstractStruct} struct\n * @return {boolean}\n */\n adds (struct) {\n return struct.id.clock >= (this.transaction.beforeState.get(struct.id.client) || 0)\n }\n\n /**\n * This is a computed property. Note that this can only be safely computed during the\n * event call. Computing this property after other changes happened might result in\n * unexpected behavior (incorrect computation of deltas). A safe way to collect changes\n * is to store the `changes` or the `delta` object. Avoid storing the `transaction` object.\n *\n * @type {{added:Set,deleted:Set,keys:Map,delta:Array<{insert?:Array|string, delete?:number, retain?:number}>}}\n */\n get changes () {\n let changes = this._changes\n if (changes === null) {\n if (this.transaction.doc._transactionCleanups.length === 0) {\n throw error.create(errorComputeChanges)\n }\n const target = this.target\n const added = set.create()\n const deleted = set.create()\n /**\n * @type {Array<{insert:Array}|{delete:number}|{retain:number}>}\n */\n const delta = []\n changes = {\n added,\n deleted,\n delta,\n keys: this.keys\n }\n const changed = /** @type Set */ (this.transaction.changed.get(target))\n if (changed.has(null)) {\n /**\n * @type {any}\n */\n let lastOp = null\n const packOp = () => {\n if (lastOp) {\n delta.push(lastOp)\n }\n }\n for (let item = target._start; item !== null; item = item.right) {\n if (item.deleted) {\n if (this.deletes(item) && !this.adds(item)) {\n if (lastOp === null || lastOp.delete === undefined) {\n packOp()\n lastOp = { delete: 0 }\n }\n lastOp.delete += item.length\n deleted.add(item)\n } // else nop\n } else {\n if (this.adds(item)) {\n if (lastOp === null || lastOp.insert === undefined) {\n packOp()\n lastOp = { insert: [] }\n }\n lastOp.insert = lastOp.insert.concat(item.content.getContent())\n added.add(item)\n } else {\n if (lastOp === null || lastOp.retain === undefined) {\n packOp()\n lastOp = { retain: 0 }\n }\n lastOp.retain += item.length\n }\n }\n }\n if (lastOp !== null && lastOp.retain === undefined) {\n packOp()\n }\n }\n this._changes = changes\n }\n return /** @type {any} */ (changes)\n }\n}\n\n/**\n * Compute the path from this type to the specified target.\n *\n * @example\n * // `child` should be accessible via `type.get(path[0]).get(path[1])..`\n * const path = type.getPathTo(child)\n * // assuming `type instanceof YArray`\n * console.log(path) // might look like => [2, 'key1']\n * child === type.get(path[0]).get(path[1])\n *\n * @param {AbstractType} parent\n * @param {AbstractType} child target\n * @return {Array} Path to the target\n *\n * @private\n * @function\n */\nconst getPathTo = (parent, child) => {\n const path = []\n while (child._item !== null && child !== parent) {\n if (child._item.parentSub !== null) {\n // parent is map-ish\n path.unshift(child._item.parentSub)\n } else {\n // parent is array-ish\n let i = 0\n let c = /** @type {AbstractType} */ (child._item.parent)._start\n while (c !== child._item && c !== null) {\n if (!c.deleted && c.countable) {\n i += c.length\n }\n c = c.right\n }\n path.unshift(i)\n }\n child = /** @type {AbstractType} */ (child._item.parent)\n }\n return path\n}\n", "import {\n removeEventHandlerListener,\n callEventHandlerListeners,\n addEventHandlerListener,\n createEventHandler,\n getState,\n isVisible,\n ContentType,\n createID,\n ContentAny,\n ContentBinary,\n getItemCleanStart,\n ContentDoc, YText, YArray, UpdateEncoderV1, UpdateEncoderV2, Doc, Snapshot, Transaction, EventHandler, YEvent, Item, // eslint-disable-line\n} from '../internals.js'\n\nimport * as map from 'lib0/map'\nimport * as iterator from 'lib0/iterator'\nimport * as error from 'lib0/error'\nimport * as math from 'lib0/math'\nimport * as log from 'lib0/logging'\n\n/**\n * https://docs.yjs.dev/getting-started/working-with-shared-types#caveats\n */\nexport const warnPrematureAccess = () => { log.warn('Invalid access: Add Yjs type to a document before reading data.') }\n\nconst maxSearchMarker = 80\n\n/**\n * A unique timestamp that identifies each marker.\n *\n * Time is relative,.. this is more like an ever-increasing clock.\n *\n * @type {number}\n */\nlet globalSearchMarkerTimestamp = 0\n\nexport class ArraySearchMarker {\n /**\n * @param {Item} p\n * @param {number} index\n */\n constructor (p, index) {\n p.marker = true\n this.p = p\n this.index = index\n this.timestamp = globalSearchMarkerTimestamp++\n }\n}\n\n/**\n * @param {ArraySearchMarker} marker\n */\nconst refreshMarkerTimestamp = marker => { marker.timestamp = globalSearchMarkerTimestamp++ }\n\n/**\n * This is rather complex so this function is the only thing that should overwrite a marker\n *\n * @param {ArraySearchMarker} marker\n * @param {Item} p\n * @param {number} index\n */\nconst overwriteMarker = (marker, p, index) => {\n marker.p.marker = false\n marker.p = p\n p.marker = true\n marker.index = index\n marker.timestamp = globalSearchMarkerTimestamp++\n}\n\n/**\n * @param {Array} searchMarker\n * @param {Item} p\n * @param {number} index\n */\nconst markPosition = (searchMarker, p, index) => {\n if (searchMarker.length >= maxSearchMarker) {\n // override oldest marker (we don't want to create more objects)\n const marker = searchMarker.reduce((a, b) => a.timestamp < b.timestamp ? a : b)\n overwriteMarker(marker, p, index)\n return marker\n } else {\n // create new marker\n const pm = new ArraySearchMarker(p, index)\n searchMarker.push(pm)\n return pm\n }\n}\n\n/**\n * Search marker help us to find positions in the associative array faster.\n *\n * They speed up the process of finding a position without much bookkeeping.\n *\n * A maximum of `maxSearchMarker` objects are created.\n *\n * This function always returns a refreshed marker (updated timestamp)\n *\n * @param {AbstractType} yarray\n * @param {number} index\n */\nexport const findMarker = (yarray, index) => {\n if (yarray._start === null || index === 0 || yarray._searchMarker === null) {\n return null\n }\n const marker = yarray._searchMarker.length === 0 ? null : yarray._searchMarker.reduce((a, b) => math.abs(index - a.index) < math.abs(index - b.index) ? a : b)\n let p = yarray._start\n let pindex = 0\n if (marker !== null) {\n p = marker.p\n pindex = marker.index\n refreshMarkerTimestamp(marker) // we used it, we might need to use it again\n }\n // iterate to right if possible\n while (p.right !== null && pindex < index) {\n if (!p.deleted && p.countable) {\n if (index < pindex + p.length) {\n break\n }\n pindex += p.length\n }\n p = p.right\n }\n // iterate to left if necessary (might be that pindex > index)\n while (p.left !== null && pindex > index) {\n p = p.left\n if (!p.deleted && p.countable) {\n pindex -= p.length\n }\n }\n // we want to make sure that p can't be merged with left, because that would screw up everything\n // in that cas just return what we have (it is most likely the best marker anyway)\n // iterate to left until p can't be merged with left\n while (p.left !== null && p.left.id.client === p.id.client && p.left.id.clock + p.left.length === p.id.clock) {\n p = p.left\n if (!p.deleted && p.countable) {\n pindex -= p.length\n }\n }\n\n // @todo remove!\n // assure position\n // {\n // let start = yarray._start\n // let pos = 0\n // while (start !== p) {\n // if (!start.deleted && start.countable) {\n // pos += start.length\n // }\n // start = /** @type {Item} */ (start.right)\n // }\n // if (pos !== pindex) {\n // debugger\n // throw new Error('Gotcha position fail!')\n // }\n // }\n // if (marker) {\n // if (window.lengthes == null) {\n // window.lengthes = []\n // window.getLengthes = () => window.lengthes.sort((a, b) => a - b)\n // }\n // window.lengthes.push(marker.index - pindex)\n // console.log('distance', marker.index - pindex, 'len', p && p.parent.length)\n // }\n if (marker !== null && math.abs(marker.index - pindex) < /** @type {YText|YArray} */ (p.parent).length / maxSearchMarker) {\n // adjust existing marker\n overwriteMarker(marker, p, pindex)\n return marker\n } else {\n // create new marker\n return markPosition(yarray._searchMarker, p, pindex)\n }\n}\n\n/**\n * Update markers when a change happened.\n *\n * This should be called before doing a deletion!\n *\n * @param {Array} searchMarker\n * @param {number} index\n * @param {number} len If insertion, len is positive. If deletion, len is negative.\n */\nexport const updateMarkerChanges = (searchMarker, index, len) => {\n for (let i = searchMarker.length - 1; i >= 0; i--) {\n const m = searchMarker[i]\n if (len > 0) {\n /**\n * @type {Item|null}\n */\n let p = m.p\n p.marker = false\n // Ideally we just want to do a simple position comparison, but this will only work if\n // search markers don't point to deleted items for formats.\n // Iterate marker to prev undeleted countable position so we know what to do when updating a position\n while (p && (p.deleted || !p.countable)) {\n p = p.left\n if (p && !p.deleted && p.countable) {\n // adjust position. the loop should break now\n m.index -= p.length\n }\n }\n if (p === null || p.marker === true) {\n // remove search marker if updated position is null or if position is already marked\n searchMarker.splice(i, 1)\n continue\n }\n m.p = p\n p.marker = true\n }\n if (index < m.index || (len > 0 && index === m.index)) { // a simple index <= m.index check would actually suffice\n m.index = math.max(index, m.index + len)\n }\n }\n}\n\n/**\n * Accumulate all (list) children of a type and return them as an Array.\n *\n * @param {AbstractType} t\n * @return {Array}\n */\nexport const getTypeChildren = t => {\n t.doc ?? warnPrematureAccess()\n let s = t._start\n const arr = []\n while (s) {\n arr.push(s)\n s = s.right\n }\n return arr\n}\n\n/**\n * Call event listeners with an event. This will also add an event to all\n * parents (for `.observeDeep` handlers).\n *\n * @template EventType\n * @param {AbstractType} type\n * @param {Transaction} transaction\n * @param {EventType} event\n */\nexport const callTypeObservers = (type, transaction, event) => {\n const changedType = type\n const changedParentTypes = transaction.changedParentTypes\n while (true) {\n // @ts-ignore\n map.setIfUndefined(changedParentTypes, type, () => []).push(event)\n if (type._item === null) {\n break\n }\n type = /** @type {AbstractType} */ (type._item.parent)\n }\n callEventHandlerListeners(changedType._eH, event, transaction)\n}\n\n/**\n * @template EventType\n * Abstract Yjs Type class\n */\nexport class AbstractType {\n constructor () {\n /**\n * @type {Item|null}\n */\n this._item = null\n /**\n * @type {Map}\n */\n this._map = new Map()\n /**\n * @type {Item|null}\n */\n this._start = null\n /**\n * @type {Doc|null}\n */\n this.doc = null\n this._length = 0\n /**\n * Event handlers\n * @type {EventHandler}\n */\n this._eH = createEventHandler()\n /**\n * Deep event handlers\n * @type {EventHandler>,Transaction>}\n */\n this._dEH = createEventHandler()\n /**\n * @type {null | Array}\n */\n this._searchMarker = null\n }\n\n /**\n * @return {AbstractType|null}\n */\n get parent () {\n return this._item ? /** @type {AbstractType} */ (this._item.parent) : null\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item|null} item\n */\n _integrate (y, item) {\n this.doc = y\n this._item = item\n }\n\n /**\n * @return {AbstractType}\n */\n _copy () {\n throw error.methodUnimplemented()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {AbstractType}\n */\n clone () {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} _encoder\n */\n _write (_encoder) { }\n\n /**\n * The first non-deleted item\n */\n get _first () {\n let n = this._start\n while (n !== null && n.deleted) {\n n = n.right\n }\n return n\n }\n\n /**\n * Creates YEvent and calls all type observers.\n * Must be implemented by each type.\n *\n * @param {Transaction} transaction\n * @param {Set} _parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, _parentSubs) {\n if (!transaction.local && this._searchMarker) {\n this._searchMarker.length = 0\n }\n }\n\n /**\n * Observe all events that are created on this type.\n *\n * @param {function(EventType, Transaction):void} f Observer function\n */\n observe (f) {\n addEventHandlerListener(this._eH, f)\n }\n\n /**\n * Observe all events that are created by this type and its children.\n *\n * @param {function(Array>,Transaction):void} f Observer function\n */\n observeDeep (f) {\n addEventHandlerListener(this._dEH, f)\n }\n\n /**\n * Unregister an observer function.\n *\n * @param {function(EventType,Transaction):void} f Observer function\n */\n unobserve (f) {\n removeEventHandlerListener(this._eH, f)\n }\n\n /**\n * Unregister an observer function.\n *\n * @param {function(Array>,Transaction):void} f Observer function\n */\n unobserveDeep (f) {\n removeEventHandlerListener(this._dEH, f)\n }\n\n /**\n * @abstract\n * @return {any}\n */\n toJSON () {}\n}\n\n/**\n * @param {AbstractType} type\n * @param {number} start\n * @param {number} end\n * @return {Array}\n *\n * @private\n * @function\n */\nexport const typeListSlice = (type, start, end) => {\n type.doc ?? warnPrematureAccess()\n if (start < 0) {\n start = type._length + start\n }\n if (end < 0) {\n end = type._length + end\n }\n let len = end - start\n const cs = []\n let n = type._start\n while (n !== null && len > 0) {\n if (n.countable && !n.deleted) {\n const c = n.content.getContent()\n if (c.length <= start) {\n start -= c.length\n } else {\n for (let i = start; i < c.length && len > 0; i++) {\n cs.push(c[i])\n len--\n }\n start = 0\n }\n }\n n = n.right\n }\n return cs\n}\n\n/**\n * @param {AbstractType} type\n * @return {Array}\n *\n * @private\n * @function\n */\nexport const typeListToArray = type => {\n type.doc ?? warnPrematureAccess()\n const cs = []\n let n = type._start\n while (n !== null) {\n if (n.countable && !n.deleted) {\n const c = n.content.getContent()\n for (let i = 0; i < c.length; i++) {\n cs.push(c[i])\n }\n }\n n = n.right\n }\n return cs\n}\n\n/**\n * @param {AbstractType} type\n * @param {Snapshot} snapshot\n * @return {Array}\n *\n * @private\n * @function\n */\nexport const typeListToArraySnapshot = (type, snapshot) => {\n const cs = []\n let n = type._start\n while (n !== null) {\n if (n.countable && isVisible(n, snapshot)) {\n const c = n.content.getContent()\n for (let i = 0; i < c.length; i++) {\n cs.push(c[i])\n }\n }\n n = n.right\n }\n return cs\n}\n\n/**\n * Executes a provided function on once on every element of this YArray.\n *\n * @param {AbstractType} type\n * @param {function(any,number,any):void} f A function to execute on every element of this YArray.\n *\n * @private\n * @function\n */\nexport const typeListForEach = (type, f) => {\n let index = 0\n let n = type._start\n type.doc ?? warnPrematureAccess()\n while (n !== null) {\n if (n.countable && !n.deleted) {\n const c = n.content.getContent()\n for (let i = 0; i < c.length; i++) {\n f(c[i], index++, type)\n }\n }\n n = n.right\n }\n}\n\n/**\n * @template C,R\n * @param {AbstractType} type\n * @param {function(C,number,AbstractType):R} f\n * @return {Array}\n *\n * @private\n * @function\n */\nexport const typeListMap = (type, f) => {\n /**\n * @type {Array}\n */\n const result = []\n typeListForEach(type, (c, i) => {\n result.push(f(c, i, type))\n })\n return result\n}\n\n/**\n * @param {AbstractType} type\n * @return {IterableIterator}\n *\n * @private\n * @function\n */\nexport const typeListCreateIterator = type => {\n let n = type._start\n /**\n * @type {Array|null}\n */\n let currentContent = null\n let currentContentIndex = 0\n return {\n [Symbol.iterator] () {\n return this\n },\n next: () => {\n // find some content\n if (currentContent === null) {\n while (n !== null && n.deleted) {\n n = n.right\n }\n // check if we reached the end, no need to check currentContent, because it does not exist\n if (n === null) {\n return {\n done: true,\n value: undefined\n }\n }\n // we found n, so we can set currentContent\n currentContent = n.content.getContent()\n currentContentIndex = 0\n n = n.right // we used the content of n, now iterate to next\n }\n const value = currentContent[currentContentIndex++]\n // check if we need to empty currentContent\n if (currentContent.length <= currentContentIndex) {\n currentContent = null\n }\n return {\n done: false,\n value\n }\n }\n }\n}\n\n/**\n * Executes a provided function on once on every element of this YArray.\n * Operates on a snapshotted state of the document.\n *\n * @param {AbstractType} type\n * @param {function(any,number,AbstractType):void} f A function to execute on every element of this YArray.\n * @param {Snapshot} snapshot\n *\n * @private\n * @function\n */\nexport const typeListForEachSnapshot = (type, f, snapshot) => {\n let index = 0\n let n = type._start\n while (n !== null) {\n if (n.countable && isVisible(n, snapshot)) {\n const c = n.content.getContent()\n for (let i = 0; i < c.length; i++) {\n f(c[i], index++, type)\n }\n }\n n = n.right\n }\n}\n\n/**\n * @param {AbstractType} type\n * @param {number} index\n * @return {any}\n *\n * @private\n * @function\n */\nexport const typeListGet = (type, index) => {\n type.doc ?? warnPrematureAccess()\n const marker = findMarker(type, index)\n let n = type._start\n if (marker !== null) {\n n = marker.p\n index -= marker.index\n }\n for (; n !== null; n = n.right) {\n if (!n.deleted && n.countable) {\n if (index < n.length) {\n return n.content.getContent()[index]\n }\n index -= n.length\n }\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {Item?} referenceItem\n * @param {Array|Array|boolean|number|null|string|Uint8Array>} content\n *\n * @private\n * @function\n */\nexport const typeListInsertGenericsAfter = (transaction, parent, referenceItem, content) => {\n let left = referenceItem\n const doc = transaction.doc\n const ownClientId = doc.clientID\n const store = doc.store\n const right = referenceItem === null ? parent._start : referenceItem.right\n /**\n * @type {Array|number|null>}\n */\n let jsonContent = []\n const packJsonContent = () => {\n if (jsonContent.length > 0) {\n left = new Item(createID(ownClientId, getState(store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentAny(jsonContent))\n left.integrate(transaction, 0)\n jsonContent = []\n }\n }\n content.forEach(c => {\n if (c === null) {\n jsonContent.push(c)\n } else {\n switch (c.constructor) {\n case Number:\n case Object:\n case Boolean:\n case Array:\n case String:\n jsonContent.push(c)\n break\n default:\n packJsonContent()\n switch (c.constructor) {\n case Uint8Array:\n case ArrayBuffer:\n left = new Item(createID(ownClientId, getState(store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentBinary(new Uint8Array(/** @type {Uint8Array} */ (c))))\n left.integrate(transaction, 0)\n break\n case Doc:\n left = new Item(createID(ownClientId, getState(store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentDoc(/** @type {Doc} */ (c)))\n left.integrate(transaction, 0)\n break\n default:\n if (c instanceof AbstractType) {\n left = new Item(createID(ownClientId, getState(store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentType(c))\n left.integrate(transaction, 0)\n } else {\n throw new Error('Unexpected content type in insert operation')\n }\n }\n }\n }\n })\n packJsonContent()\n}\n\nconst lengthExceeded = () => error.create('Length exceeded!')\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {number} index\n * @param {Array|Array|number|null|string|Uint8Array>} content\n *\n * @private\n * @function\n */\nexport const typeListInsertGenerics = (transaction, parent, index, content) => {\n if (index > parent._length) {\n throw lengthExceeded()\n }\n if (index === 0) {\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, index, content.length)\n }\n return typeListInsertGenericsAfter(transaction, parent, null, content)\n }\n const startIndex = index\n const marker = findMarker(parent, index)\n let n = parent._start\n if (marker !== null) {\n n = marker.p\n index -= marker.index\n // we need to iterate one to the left so that the algorithm works\n if (index === 0) {\n // @todo refactor this as it actually doesn't consider formats\n n = n.prev // important! get the left undeleted item so that we can actually decrease index\n index += (n && n.countable && !n.deleted) ? n.length : 0\n }\n }\n for (; n !== null; n = n.right) {\n if (!n.deleted && n.countable) {\n if (index <= n.length) {\n if (index < n.length) {\n // insert in-between\n getItemCleanStart(transaction, createID(n.id.client, n.id.clock + index))\n }\n break\n }\n index -= n.length\n }\n }\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, startIndex, content.length)\n }\n return typeListInsertGenericsAfter(transaction, parent, n, content)\n}\n\n/**\n * Pushing content is special as we generally want to push after the last item. So we don't have to update\n * the serach marker.\n *\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {Array|Array|number|null|string|Uint8Array>} content\n *\n * @private\n * @function\n */\nexport const typeListPushGenerics = (transaction, parent, content) => {\n // Use the marker with the highest index and iterate to the right.\n const marker = (parent._searchMarker || []).reduce((maxMarker, currMarker) => currMarker.index > maxMarker.index ? currMarker : maxMarker, { index: 0, p: parent._start })\n let n = marker.p\n if (n) {\n while (n.right) {\n n = n.right\n }\n }\n return typeListInsertGenericsAfter(transaction, parent, n, content)\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {number} index\n * @param {number} length\n *\n * @private\n * @function\n */\nexport const typeListDelete = (transaction, parent, index, length) => {\n if (length === 0) { return }\n const startIndex = index\n const startLength = length\n const marker = findMarker(parent, index)\n let n = parent._start\n if (marker !== null) {\n n = marker.p\n index -= marker.index\n }\n // compute the first item to be deleted\n for (; n !== null && index > 0; n = n.right) {\n if (!n.deleted && n.countable) {\n if (index < n.length) {\n getItemCleanStart(transaction, createID(n.id.client, n.id.clock + index))\n }\n index -= n.length\n }\n }\n // delete all items until done\n while (length > 0 && n !== null) {\n if (!n.deleted) {\n if (length < n.length) {\n getItemCleanStart(transaction, createID(n.id.client, n.id.clock + length))\n }\n n.delete(transaction)\n length -= n.length\n }\n n = n.right\n }\n if (length > 0) {\n throw lengthExceeded()\n }\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, startIndex, -startLength + length /* in case we remove the above exception */)\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {string} key\n *\n * @private\n * @function\n */\nexport const typeMapDelete = (transaction, parent, key) => {\n const c = parent._map.get(key)\n if (c !== undefined) {\n c.delete(transaction)\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {string} key\n * @param {Object|number|null|Array|string|Uint8Array|AbstractType} value\n *\n * @private\n * @function\n */\nexport const typeMapSet = (transaction, parent, key, value) => {\n const left = parent._map.get(key) || null\n const doc = transaction.doc\n const ownClientId = doc.clientID\n let content\n if (value == null) {\n content = new ContentAny([value])\n } else {\n switch (value.constructor) {\n case Number:\n case Object:\n case Boolean:\n case Array:\n case String:\n content = new ContentAny([value])\n break\n case Uint8Array:\n content = new ContentBinary(/** @type {Uint8Array} */ (value))\n break\n case Doc:\n content = new ContentDoc(/** @type {Doc} */ (value))\n break\n default:\n if (value instanceof AbstractType) {\n content = new ContentType(value)\n } else {\n throw new Error('Unexpected content type')\n }\n }\n }\n new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, null, null, parent, key, content).integrate(transaction, 0)\n}\n\n/**\n * @param {AbstractType} parent\n * @param {string} key\n * @return {Object|number|null|Array|string|Uint8Array|AbstractType|undefined}\n *\n * @private\n * @function\n */\nexport const typeMapGet = (parent, key) => {\n parent.doc ?? warnPrematureAccess()\n const val = parent._map.get(key)\n return val !== undefined && !val.deleted ? val.content.getContent()[val.length - 1] : undefined\n}\n\n/**\n * @param {AbstractType} parent\n * @return {Object|number|null|Array|string|Uint8Array|AbstractType|undefined>}\n *\n * @private\n * @function\n */\nexport const typeMapGetAll = (parent) => {\n /**\n * @type {Object}\n */\n const res = {}\n parent.doc ?? warnPrematureAccess()\n parent._map.forEach((value, key) => {\n if (!value.deleted) {\n res[key] = value.content.getContent()[value.length - 1]\n }\n })\n return res\n}\n\n/**\n * @param {AbstractType} parent\n * @param {string} key\n * @return {boolean}\n *\n * @private\n * @function\n */\nexport const typeMapHas = (parent, key) => {\n parent.doc ?? warnPrematureAccess()\n const val = parent._map.get(key)\n return val !== undefined && !val.deleted\n}\n\n/**\n * @param {AbstractType} parent\n * @param {string} key\n * @param {Snapshot} snapshot\n * @return {Object|number|null|Array|string|Uint8Array|AbstractType|undefined}\n *\n * @private\n * @function\n */\nexport const typeMapGetSnapshot = (parent, key, snapshot) => {\n let v = parent._map.get(key) || null\n while (v !== null && (!snapshot.sv.has(v.id.client) || v.id.clock >= (snapshot.sv.get(v.id.client) || 0))) {\n v = v.left\n }\n return v !== null && isVisible(v, snapshot) ? v.content.getContent()[v.length - 1] : undefined\n}\n\n/**\n * @param {AbstractType} parent\n * @param {Snapshot} snapshot\n * @return {Object|number|null|Array|string|Uint8Array|AbstractType|undefined>}\n *\n * @private\n * @function\n */\nexport const typeMapGetAllSnapshot = (parent, snapshot) => {\n /**\n * @type {Object}\n */\n const res = {}\n parent._map.forEach((value, key) => {\n /**\n * @type {Item|null}\n */\n let v = value\n while (v !== null && (!snapshot.sv.has(v.id.client) || v.id.clock >= (snapshot.sv.get(v.id.client) || 0))) {\n v = v.left\n }\n if (v !== null && isVisible(v, snapshot)) {\n res[key] = v.content.getContent()[v.length - 1]\n }\n })\n return res\n}\n\n/**\n * @param {AbstractType & { _map: Map }} type\n * @return {IterableIterator>}\n *\n * @private\n * @function\n */\nexport const createMapIterator = type => {\n type.doc ?? warnPrematureAccess()\n return iterator.iteratorFilter(type._map.entries(), /** @param {any} entry */ entry => !entry[1].deleted)\n}\n", "/**\n * @module YArray\n */\n\nimport {\n YEvent,\n AbstractType,\n typeListGet,\n typeListToArray,\n typeListForEach,\n typeListCreateIterator,\n typeListInsertGenerics,\n typeListPushGenerics,\n typeListDelete,\n typeListMap,\n YArrayRefID,\n callTypeObservers,\n transact,\n warnPrematureAccess,\n ArraySearchMarker, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, Transaction, Item // eslint-disable-line\n} from '../internals.js'\nimport { typeListSlice } from './AbstractType.js'\n\n/**\n * Event that describes the changes on a YArray\n * @template T\n * @extends YEvent>\n */\nexport class YArrayEvent extends YEvent {}\n\n/**\n * A shared Array implementation.\n * @template T\n * @extends AbstractType>\n * @implements {Iterable}\n */\nexport class YArray extends AbstractType {\n constructor () {\n super()\n /**\n * @type {Array?}\n * @private\n */\n this._prelimContent = []\n /**\n * @type {Array}\n */\n this._searchMarker = []\n }\n\n /**\n * Construct a new YArray containing the specified items.\n * @template {Object|Array|number|null|string|Uint8Array} T\n * @param {Array} items\n * @return {YArray}\n */\n static from (items) {\n /**\n * @type {YArray}\n */\n const a = new YArray()\n a.push(items)\n return a\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n this.insert(0, /** @type {Array} */ (this._prelimContent))\n this._prelimContent = null\n }\n\n /**\n * @return {YArray}\n */\n _copy () {\n return new YArray()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YArray}\n */\n clone () {\n /**\n * @type {YArray}\n */\n const arr = new YArray()\n arr.insert(0, this.toArray().map(el =>\n el instanceof AbstractType ? /** @type {typeof el} */ (el.clone()) : el\n ))\n return arr\n }\n\n get length () {\n this.doc ?? warnPrematureAccess()\n return this._length\n }\n\n /**\n * Creates YArrayEvent and calls observers.\n *\n * @param {Transaction} transaction\n * @param {Set} parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, parentSubs) {\n super._callObserver(transaction, parentSubs)\n callTypeObservers(this, transaction, new YArrayEvent(this, transaction))\n }\n\n /**\n * Inserts new content at an index.\n *\n * Important: This function expects an array of content. Not just a content\n * object. The reason for this \"weirdness\" is that inserting several elements\n * is very efficient when it is done as a single operation.\n *\n * @example\n * // Insert character 'a' at position 0\n * yarray.insert(0, ['a'])\n * // Insert numbers 1, 2 at position 1\n * yarray.insert(1, [1, 2])\n *\n * @param {number} index The index to insert content at.\n * @param {Array} content The array of content\n */\n insert (index, content) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListInsertGenerics(transaction, this, index, /** @type {any} */ (content))\n })\n } else {\n /** @type {Array} */ (this._prelimContent).splice(index, 0, ...content)\n }\n }\n\n /**\n * Appends content to this YArray.\n *\n * @param {Array} content Array of content to append.\n *\n * @todo Use the following implementation in all types.\n */\n push (content) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListPushGenerics(transaction, this, /** @type {any} */ (content))\n })\n } else {\n /** @type {Array} */ (this._prelimContent).push(...content)\n }\n }\n\n /**\n * Prepends content to this YArray.\n *\n * @param {Array} content Array of content to prepend.\n */\n unshift (content) {\n this.insert(0, content)\n }\n\n /**\n * Deletes elements starting from an index.\n *\n * @param {number} index Index at which to start deleting elements\n * @param {number} length The number of elements to remove. Defaults to 1.\n */\n delete (index, length = 1) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListDelete(transaction, this, index, length)\n })\n } else {\n /** @type {Array} */ (this._prelimContent).splice(index, length)\n }\n }\n\n /**\n * Returns the i-th element from a YArray.\n *\n * @param {number} index The index of the element to return from the YArray\n * @return {T}\n */\n get (index) {\n return typeListGet(this, index)\n }\n\n /**\n * Transforms this YArray to a JavaScript Array.\n *\n * @return {Array}\n */\n toArray () {\n return typeListToArray(this)\n }\n\n /**\n * Returns a portion of this YArray into a JavaScript Array selected\n * from start to end (end not included).\n *\n * @param {number} [start]\n * @param {number} [end]\n * @return {Array}\n */\n slice (start = 0, end = this.length) {\n return typeListSlice(this, start, end)\n }\n\n /**\n * Transforms this Shared Type to a JSON object.\n *\n * @return {Array}\n */\n toJSON () {\n return this.map(c => c instanceof AbstractType ? c.toJSON() : c)\n }\n\n /**\n * Returns an Array with the result of calling a provided function on every\n * element of this YArray.\n *\n * @template M\n * @param {function(T,number,YArray):M} f Function that produces an element of the new Array\n * @return {Array} A new array with each element being the result of the\n * callback function\n */\n map (f) {\n return typeListMap(this, /** @type {any} */ (f))\n }\n\n /**\n * Executes a provided function once on every element of this YArray.\n *\n * @param {function(T,number,YArray):void} f A function to execute on every element of this YArray.\n */\n forEach (f) {\n typeListForEach(this, f)\n }\n\n /**\n * @return {IterableIterator}\n */\n [Symbol.iterator] () {\n return typeListCreateIterator(this)\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n _write (encoder) {\n encoder.writeTypeRef(YArrayRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} _decoder\n *\n * @private\n * @function\n */\nexport const readYArray = _decoder => new YArray()\n", "/**\n * @module YMap\n */\n\nimport {\n YEvent,\n AbstractType,\n typeMapDelete,\n typeMapSet,\n typeMapGet,\n typeMapHas,\n createMapIterator,\n YMapRefID,\n callTypeObservers,\n transact,\n warnPrematureAccess,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, Transaction, Item // eslint-disable-line\n} from '../internals.js'\n\nimport * as iterator from 'lib0/iterator'\n\n/**\n * @template T\n * @extends YEvent>\n * Event that describes the changes on a YMap.\n */\nexport class YMapEvent extends YEvent {\n /**\n * @param {YMap} ymap The YArray that changed.\n * @param {Transaction} transaction\n * @param {Set} subs The keys that changed.\n */\n constructor (ymap, transaction, subs) {\n super(ymap, transaction)\n this.keysChanged = subs\n }\n}\n\n/**\n * @template MapType\n * A shared Map implementation.\n *\n * @extends AbstractType>\n * @implements {Iterable<[string, MapType]>}\n */\nexport class YMap extends AbstractType {\n /**\n *\n * @param {Iterable=} entries - an optional iterable to initialize the YMap\n */\n constructor (entries) {\n super()\n /**\n * @type {Map?}\n * @private\n */\n this._prelimContent = null\n\n if (entries === undefined) {\n this._prelimContent = new Map()\n } else {\n this._prelimContent = new Map(entries)\n }\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n ;/** @type {Map} */ (this._prelimContent).forEach((value, key) => {\n this.set(key, value)\n })\n this._prelimContent = null\n }\n\n /**\n * @return {YMap}\n */\n _copy () {\n return new YMap()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YMap}\n */\n clone () {\n /**\n * @type {YMap}\n */\n const map = new YMap()\n this.forEach((value, key) => {\n map.set(key, value instanceof AbstractType ? /** @type {typeof value} */ (value.clone()) : value)\n })\n return map\n }\n\n /**\n * Creates YMapEvent and calls observers.\n *\n * @param {Transaction} transaction\n * @param {Set} parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, parentSubs) {\n callTypeObservers(this, transaction, new YMapEvent(this, transaction, parentSubs))\n }\n\n /**\n * Transforms this Shared Type to a JSON object.\n *\n * @return {Object}\n */\n toJSON () {\n this.doc ?? warnPrematureAccess()\n /**\n * @type {Object}\n */\n const map = {}\n this._map.forEach((item, key) => {\n if (!item.deleted) {\n const v = item.content.getContent()[item.length - 1]\n map[key] = v instanceof AbstractType ? v.toJSON() : v\n }\n })\n return map\n }\n\n /**\n * Returns the size of the YMap (count of key/value pairs)\n *\n * @return {number}\n */\n get size () {\n return [...createMapIterator(this)].length\n }\n\n /**\n * Returns the keys for each element in the YMap Type.\n *\n * @return {IterableIterator}\n */\n keys () {\n return iterator.iteratorMap(createMapIterator(this), /** @param {any} v */ v => v[0])\n }\n\n /**\n * Returns the values for each element in the YMap Type.\n *\n * @return {IterableIterator}\n */\n values () {\n return iterator.iteratorMap(createMapIterator(this), /** @param {any} v */ v => v[1].content.getContent()[v[1].length - 1])\n }\n\n /**\n * Returns an Iterator of [key, value] pairs\n *\n * @return {IterableIterator<[string, MapType]>}\n */\n entries () {\n return iterator.iteratorMap(createMapIterator(this), /** @param {any} v */ v => /** @type {any} */ ([v[0], v[1].content.getContent()[v[1].length - 1]]))\n }\n\n /**\n * Executes a provided function on once on every key-value pair.\n *\n * @param {function(MapType,string,YMap):void} f A function to execute on every element of this YArray.\n */\n forEach (f) {\n this.doc ?? warnPrematureAccess()\n this._map.forEach((item, key) => {\n if (!item.deleted) {\n f(item.content.getContent()[item.length - 1], key, this)\n }\n })\n }\n\n /**\n * Returns an Iterator of [key, value] pairs\n *\n * @return {IterableIterator<[string, MapType]>}\n */\n [Symbol.iterator] () {\n return this.entries()\n }\n\n /**\n * Remove a specified element from this YMap.\n *\n * @param {string} key The key of the element to remove.\n */\n delete (key) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapDelete(transaction, this, key)\n })\n } else {\n /** @type {Map} */ (this._prelimContent).delete(key)\n }\n }\n\n /**\n * Adds or updates an element with a specified key and value.\n * @template {MapType} VAL\n *\n * @param {string} key The key of the element to add to this YMap\n * @param {VAL} value The value of the element to add\n * @return {VAL}\n */\n set (key, value) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapSet(transaction, this, key, /** @type {any} */ (value))\n })\n } else {\n /** @type {Map} */ (this._prelimContent).set(key, value)\n }\n return value\n }\n\n /**\n * Returns a specified element from this YMap.\n *\n * @param {string} key\n * @return {MapType|undefined}\n */\n get (key) {\n return /** @type {any} */ (typeMapGet(this, key))\n }\n\n /**\n * Returns a boolean indicating whether the specified key exists or not.\n *\n * @param {string} key The key to test.\n * @return {boolean}\n */\n has (key) {\n return typeMapHas(this, key)\n }\n\n /**\n * Removes all elements from this YMap.\n */\n clear () {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n this.forEach(function (_value, key, map) {\n typeMapDelete(transaction, map, key)\n })\n })\n } else {\n /** @type {Map} */ (this._prelimContent).clear()\n }\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n _write (encoder) {\n encoder.writeTypeRef(YMapRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} _decoder\n *\n * @private\n * @function\n */\nexport const readYMap = _decoder => new YMap()\n", "/**\n * @module YText\n */\n\nimport {\n YEvent,\n AbstractType,\n getItemCleanStart,\n getState,\n isVisible,\n createID,\n YTextRefID,\n callTypeObservers,\n transact,\n ContentEmbed,\n GC,\n ContentFormat,\n ContentString,\n splitSnapshotAffectedStructs,\n iterateDeletedStructs,\n iterateStructs,\n findMarker,\n typeMapDelete,\n typeMapSet,\n typeMapGet,\n typeMapGetAll,\n updateMarkerChanges,\n ContentType,\n warnPrematureAccess,\n ArraySearchMarker, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, ID, Doc, Item, Snapshot, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as object from 'lib0/object'\nimport * as map from 'lib0/map'\nimport * as error from 'lib0/error'\n\n/**\n * @param {any} a\n * @param {any} b\n * @return {boolean}\n */\nconst equalAttrs = (a, b) => a === b || (typeof a === 'object' && typeof b === 'object' && a && b && object.equalFlat(a, b))\n\nexport class ItemTextListPosition {\n /**\n * @param {Item|null} left\n * @param {Item|null} right\n * @param {number} index\n * @param {Map} currentAttributes\n */\n constructor (left, right, index, currentAttributes) {\n this.left = left\n this.right = right\n this.index = index\n this.currentAttributes = currentAttributes\n }\n\n /**\n * Only call this if you know that this.right is defined\n */\n forward () {\n if (this.right === null) {\n error.unexpectedCase()\n }\n switch (this.right.content.constructor) {\n case ContentFormat:\n if (!this.right.deleted) {\n updateCurrentAttributes(this.currentAttributes, /** @type {ContentFormat} */ (this.right.content))\n }\n break\n default:\n if (!this.right.deleted) {\n this.index += this.right.length\n }\n break\n }\n this.left = this.right\n this.right = this.right.right\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {ItemTextListPosition} pos\n * @param {number} count steps to move forward\n * @return {ItemTextListPosition}\n *\n * @private\n * @function\n */\nconst findNextPosition = (transaction, pos, count) => {\n while (pos.right !== null && count > 0) {\n switch (pos.right.content.constructor) {\n case ContentFormat:\n if (!pos.right.deleted) {\n updateCurrentAttributes(pos.currentAttributes, /** @type {ContentFormat} */ (pos.right.content))\n }\n break\n default:\n if (!pos.right.deleted) {\n if (count < pos.right.length) {\n // split right\n getItemCleanStart(transaction, createID(pos.right.id.client, pos.right.id.clock + count))\n }\n pos.index += pos.right.length\n count -= pos.right.length\n }\n break\n }\n pos.left = pos.right\n pos.right = pos.right.right\n // pos.forward() - we don't forward because that would halve the performance because we already do the checks above\n }\n return pos\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {number} index\n * @param {boolean} useSearchMarker\n * @return {ItemTextListPosition}\n *\n * @private\n * @function\n */\nconst findPosition = (transaction, parent, index, useSearchMarker) => {\n const currentAttributes = new Map()\n const marker = useSearchMarker ? findMarker(parent, index) : null\n if (marker) {\n const pos = new ItemTextListPosition(marker.p.left, marker.p, marker.index, currentAttributes)\n return findNextPosition(transaction, pos, index - marker.index)\n } else {\n const pos = new ItemTextListPosition(null, parent._start, 0, currentAttributes)\n return findNextPosition(transaction, pos, index)\n }\n}\n\n/**\n * Negate applied formats\n *\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {ItemTextListPosition} currPos\n * @param {Map} negatedAttributes\n *\n * @private\n * @function\n */\nconst insertNegatedAttributes = (transaction, parent, currPos, negatedAttributes) => {\n // check if we really need to remove attributes\n while (\n currPos.right !== null && (\n currPos.right.deleted === true || (\n currPos.right.content.constructor === ContentFormat &&\n equalAttrs(negatedAttributes.get(/** @type {ContentFormat} */ (currPos.right.content).key), /** @type {ContentFormat} */ (currPos.right.content).value)\n )\n )\n ) {\n if (!currPos.right.deleted) {\n negatedAttributes.delete(/** @type {ContentFormat} */ (currPos.right.content).key)\n }\n currPos.forward()\n }\n const doc = transaction.doc\n const ownClientId = doc.clientID\n negatedAttributes.forEach((val, key) => {\n const left = currPos.left\n const right = currPos.right\n const nextFormat = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentFormat(key, val))\n nextFormat.integrate(transaction, 0)\n currPos.right = nextFormat\n currPos.forward()\n })\n}\n\n/**\n * @param {Map} currentAttributes\n * @param {ContentFormat} format\n *\n * @private\n * @function\n */\nconst updateCurrentAttributes = (currentAttributes, format) => {\n const { key, value } = format\n if (value === null) {\n currentAttributes.delete(key)\n } else {\n currentAttributes.set(key, value)\n }\n}\n\n/**\n * @param {ItemTextListPosition} currPos\n * @param {Object} attributes\n *\n * @private\n * @function\n */\nconst minimizeAttributeChanges = (currPos, attributes) => {\n // go right while attributes[right.key] === right.value (or right is deleted)\n while (true) {\n if (currPos.right === null) {\n break\n } else if (currPos.right.deleted || (currPos.right.content.constructor === ContentFormat && equalAttrs(attributes[(/** @type {ContentFormat} */ (currPos.right.content)).key] ?? null, /** @type {ContentFormat} */ (currPos.right.content).value))) {\n //\n } else {\n break\n }\n currPos.forward()\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {ItemTextListPosition} currPos\n * @param {Object} attributes\n * @return {Map}\n *\n * @private\n * @function\n **/\nconst insertAttributes = (transaction, parent, currPos, attributes) => {\n const doc = transaction.doc\n const ownClientId = doc.clientID\n const negatedAttributes = new Map()\n // insert format-start items\n for (const key in attributes) {\n const val = attributes[key]\n const currentVal = currPos.currentAttributes.get(key) ?? null\n if (!equalAttrs(currentVal, val)) {\n // save negated attribute (set null if currentVal undefined)\n negatedAttributes.set(key, currentVal)\n const { left, right } = currPos\n currPos.right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentFormat(key, val))\n currPos.right.integrate(transaction, 0)\n currPos.forward()\n }\n }\n return negatedAttributes\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {ItemTextListPosition} currPos\n * @param {string|object|AbstractType} text\n * @param {Object} attributes\n *\n * @private\n * @function\n **/\nconst insertText = (transaction, parent, currPos, text, attributes) => {\n currPos.currentAttributes.forEach((_val, key) => {\n if (attributes[key] === undefined) {\n attributes[key] = null\n }\n })\n const doc = transaction.doc\n const ownClientId = doc.clientID\n minimizeAttributeChanges(currPos, attributes)\n const negatedAttributes = insertAttributes(transaction, parent, currPos, attributes)\n // insert content\n const content = text.constructor === String ? new ContentString(/** @type {string} */ (text)) : (text instanceof AbstractType ? new ContentType(text) : new ContentEmbed(text))\n let { left, right, index } = currPos\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, currPos.index, content.getLength())\n }\n right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, content)\n right.integrate(transaction, 0)\n currPos.right = right\n currPos.index = index\n currPos.forward()\n insertNegatedAttributes(transaction, parent, currPos, negatedAttributes)\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {ItemTextListPosition} currPos\n * @param {number} length\n * @param {Object} attributes\n *\n * @private\n * @function\n */\nconst formatText = (transaction, parent, currPos, length, attributes) => {\n const doc = transaction.doc\n const ownClientId = doc.clientID\n minimizeAttributeChanges(currPos, attributes)\n const negatedAttributes = insertAttributes(transaction, parent, currPos, attributes)\n // iterate until first non-format or null is found\n // delete all formats with attributes[format.key] != null\n // also check the attributes after the first non-format as we do not want to insert redundant negated attributes there\n // eslint-disable-next-line no-labels\n iterationLoop: while (\n currPos.right !== null &&\n (length > 0 ||\n (\n negatedAttributes.size > 0 &&\n (currPos.right.deleted || currPos.right.content.constructor === ContentFormat)\n )\n )\n ) {\n if (!currPos.right.deleted) {\n switch (currPos.right.content.constructor) {\n case ContentFormat: {\n const { key, value } = /** @type {ContentFormat} */ (currPos.right.content)\n const attr = attributes[key]\n if (attr !== undefined) {\n if (equalAttrs(attr, value)) {\n negatedAttributes.delete(key)\n } else {\n if (length === 0) {\n // no need to further extend negatedAttributes\n // eslint-disable-next-line no-labels\n break iterationLoop\n }\n negatedAttributes.set(key, value)\n }\n currPos.right.delete(transaction)\n } else {\n currPos.currentAttributes.set(key, value)\n }\n break\n }\n default:\n if (length < currPos.right.length) {\n getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length))\n }\n length -= currPos.right.length\n break\n }\n }\n currPos.forward()\n }\n // Quill just assumes that the editor starts with a newline and that it always\n // ends with a newline. We only insert that newline when a new newline is\n // inserted - i.e when length is bigger than type.length\n if (length > 0) {\n let newlines = ''\n for (; length > 0; length--) {\n newlines += '\\n'\n }\n currPos.right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), currPos.left, currPos.left && currPos.left.lastId, currPos.right, currPos.right && currPos.right.id, parent, null, new ContentString(newlines))\n currPos.right.integrate(transaction, 0)\n currPos.forward()\n }\n insertNegatedAttributes(transaction, parent, currPos, negatedAttributes)\n}\n\n/**\n * Call this function after string content has been deleted in order to\n * clean up formatting Items.\n *\n * @param {Transaction} transaction\n * @param {Item} start\n * @param {Item|null} curr exclusive end, automatically iterates to the next Content Item\n * @param {Map} startAttributes\n * @param {Map} currAttributes\n * @return {number} The amount of formatting Items deleted.\n *\n * @function\n */\nconst cleanupFormattingGap = (transaction, start, curr, startAttributes, currAttributes) => {\n /**\n * @type {Item|null}\n */\n let end = start\n /**\n * @type {Map}\n */\n const endFormats = map.create()\n while (end && (!end.countable || end.deleted)) {\n if (!end.deleted && end.content.constructor === ContentFormat) {\n const cf = /** @type {ContentFormat} */ (end.content)\n endFormats.set(cf.key, cf)\n }\n end = end.right\n }\n let cleanups = 0\n let reachedCurr = false\n while (start !== end) {\n if (curr === start) {\n reachedCurr = true\n }\n if (!start.deleted) {\n const content = start.content\n switch (content.constructor) {\n case ContentFormat: {\n const { key, value } = /** @type {ContentFormat} */ (content)\n const startAttrValue = startAttributes.get(key) ?? null\n if (endFormats.get(key) !== content || startAttrValue === value) {\n // Either this format is overwritten or it is not necessary because the attribute already existed.\n start.delete(transaction)\n cleanups++\n if (!reachedCurr && (currAttributes.get(key) ?? null) === value && startAttrValue !== value) {\n if (startAttrValue === null) {\n currAttributes.delete(key)\n } else {\n currAttributes.set(key, startAttrValue)\n }\n }\n }\n if (!reachedCurr && !start.deleted) {\n updateCurrentAttributes(currAttributes, /** @type {ContentFormat} */ (content))\n }\n break\n }\n }\n }\n start = /** @type {Item} */ (start.right)\n }\n return cleanups\n}\n\n/**\n * @param {Transaction} transaction\n * @param {Item | null} item\n */\nconst cleanupContextlessFormattingGap = (transaction, item) => {\n // iterate until item.right is null or content\n while (item && item.right && (item.right.deleted || !item.right.countable)) {\n item = item.right\n }\n const attrs = new Set()\n // iterate back until a content item is found\n while (item && (item.deleted || !item.countable)) {\n if (!item.deleted && item.content.constructor === ContentFormat) {\n const key = /** @type {ContentFormat} */ (item.content).key\n if (attrs.has(key)) {\n item.delete(transaction)\n } else {\n attrs.add(key)\n }\n }\n item = item.left\n }\n}\n\n/**\n * This function is experimental and subject to change / be removed.\n *\n * Ideally, we don't need this function at all. Formatting attributes should be cleaned up\n * automatically after each change. This function iterates twice over the complete YText type\n * and removes unnecessary formatting attributes. This is also helpful for testing.\n *\n * This function won't be exported anymore as soon as there is confidence that the YText type works as intended.\n *\n * @param {YText} type\n * @return {number} How many formatting attributes have been cleaned up.\n */\nexport const cleanupYTextFormatting = type => {\n let res = 0\n transact(/** @type {Doc} */ (type.doc), transaction => {\n let start = /** @type {Item} */ (type._start)\n let end = type._start\n let startAttributes = map.create()\n const currentAttributes = map.copy(startAttributes)\n while (end) {\n if (end.deleted === false) {\n switch (end.content.constructor) {\n case ContentFormat:\n updateCurrentAttributes(currentAttributes, /** @type {ContentFormat} */ (end.content))\n break\n default:\n res += cleanupFormattingGap(transaction, start, end, startAttributes, currentAttributes)\n startAttributes = map.copy(currentAttributes)\n start = end\n break\n }\n }\n end = end.right\n }\n })\n return res\n}\n\n/**\n * This will be called by the transction once the event handlers are called to potentially cleanup\n * formatting attributes.\n *\n * @param {Transaction} transaction\n */\nexport const cleanupYTextAfterTransaction = transaction => {\n /**\n * @type {Set}\n */\n const needFullCleanup = new Set()\n // check if another formatting item was inserted\n const doc = transaction.doc\n for (const [client, afterClock] of transaction.afterState.entries()) {\n const clock = transaction.beforeState.get(client) || 0\n if (afterClock === clock) {\n continue\n }\n iterateStructs(transaction, /** @type {Array} */ (doc.store.clients.get(client)), clock, afterClock, item => {\n if (\n !item.deleted && /** @type {Item} */ (item).content.constructor === ContentFormat && item.constructor !== GC\n ) {\n needFullCleanup.add(/** @type {any} */ (item).parent)\n }\n })\n }\n // cleanup in a new transaction\n transact(doc, (t) => {\n iterateDeletedStructs(transaction, transaction.deleteSet, item => {\n if (item instanceof GC || !(/** @type {YText} */ (item.parent)._hasFormatting) || needFullCleanup.has(/** @type {YText} */ (item.parent))) {\n return\n }\n const parent = /** @type {YText} */ (item.parent)\n if (item.content.constructor === ContentFormat) {\n needFullCleanup.add(parent)\n } else {\n // If no formatting attribute was inserted or deleted, we can make due with contextless\n // formatting cleanups.\n // Contextless: it is not necessary to compute currentAttributes for the affected position.\n cleanupContextlessFormattingGap(t, item)\n }\n })\n // If a formatting item was inserted, we simply clean the whole type.\n // We need to compute currentAttributes for the current position anyway.\n for (const yText of needFullCleanup) {\n cleanupYTextFormatting(yText)\n }\n })\n}\n\n/**\n * @param {Transaction} transaction\n * @param {ItemTextListPosition} currPos\n * @param {number} length\n * @return {ItemTextListPosition}\n *\n * @private\n * @function\n */\nconst deleteText = (transaction, currPos, length) => {\n const startLength = length\n const startAttrs = map.copy(currPos.currentAttributes)\n const start = currPos.right\n while (length > 0 && currPos.right !== null) {\n if (currPos.right.deleted === false) {\n switch (currPos.right.content.constructor) {\n case ContentType:\n case ContentEmbed:\n case ContentString:\n if (length < currPos.right.length) {\n getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length))\n }\n length -= currPos.right.length\n currPos.right.delete(transaction)\n break\n }\n }\n currPos.forward()\n }\n if (start) {\n cleanupFormattingGap(transaction, start, currPos.right, startAttrs, currPos.currentAttributes)\n }\n const parent = /** @type {AbstractType} */ (/** @type {Item} */ (currPos.left || currPos.right).parent)\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, currPos.index, -startLength + length)\n }\n return currPos\n}\n\n/**\n * The Quill Delta format represents changes on a text document with\n * formatting information. For mor information visit {@link https://quilljs.com/docs/delta/|Quill Delta}\n *\n * @example\n * {\n * ops: [\n * { insert: 'Gandalf', attributes: { bold: true } },\n * { insert: ' the ' },\n * { insert: 'Grey', attributes: { color: '#cccccc' } }\n * ]\n * }\n *\n */\n\n/**\n * Attributes that can be assigned to a selection of text.\n *\n * @example\n * {\n * bold: true,\n * font-size: '40px'\n * }\n *\n * @typedef {Object} TextAttributes\n */\n\n/**\n * @extends YEvent\n * Event that describes the changes on a YText type.\n */\nexport class YTextEvent extends YEvent {\n /**\n * @param {YText} ytext\n * @param {Transaction} transaction\n * @param {Set} subs The keys that changed\n */\n constructor (ytext, transaction, subs) {\n super(ytext, transaction)\n /**\n * Whether the children changed.\n * @type {Boolean}\n * @private\n */\n this.childListChanged = false\n /**\n * Set of all changed attributes.\n * @type {Set}\n */\n this.keysChanged = new Set()\n subs.forEach((sub) => {\n if (sub === null) {\n this.childListChanged = true\n } else {\n this.keysChanged.add(sub)\n }\n })\n }\n\n /**\n * @type {{added:Set,deleted:Set,keys:Map,delta:Array<{insert?:Array|string, delete?:number, retain?:number}>}}\n */\n get changes () {\n if (this._changes === null) {\n /**\n * @type {{added:Set,deleted:Set,keys:Map,delta:Array<{insert?:Array|string|AbstractType|object, delete?:number, retain?:number}>}}\n */\n const changes = {\n keys: this.keys,\n delta: this.delta,\n added: new Set(),\n deleted: new Set()\n }\n this._changes = changes\n }\n return /** @type {any} */ (this._changes)\n }\n\n /**\n * Compute the changes in the delta format.\n * A {@link https://quilljs.com/docs/delta/|Quill Delta}) that represents the changes on the document.\n *\n * @type {Array<{insert?:string|object|AbstractType, delete?:number, retain?:number, attributes?: Object}>}\n *\n * @public\n */\n get delta () {\n if (this._delta === null) {\n const y = /** @type {Doc} */ (this.target.doc)\n /**\n * @type {Array<{insert?:string|object|AbstractType, delete?:number, retain?:number, attributes?: Object}>}\n */\n const delta = []\n transact(y, transaction => {\n const currentAttributes = new Map() // saves all current attributes for insert\n const oldAttributes = new Map()\n let item = this.target._start\n /**\n * @type {string?}\n */\n let action = null\n /**\n * @type {Object}\n */\n const attributes = {} // counts added or removed new attributes for retain\n /**\n * @type {string|object}\n */\n let insert = ''\n let retain = 0\n let deleteLen = 0\n const addOp = () => {\n if (action !== null) {\n /**\n * @type {any}\n */\n let op = null\n switch (action) {\n case 'delete':\n if (deleteLen > 0) {\n op = { delete: deleteLen }\n }\n deleteLen = 0\n break\n case 'insert':\n if (typeof insert === 'object' || insert.length > 0) {\n op = { insert }\n if (currentAttributes.size > 0) {\n op.attributes = {}\n currentAttributes.forEach((value, key) => {\n if (value !== null) {\n op.attributes[key] = value\n }\n })\n }\n }\n insert = ''\n break\n case 'retain':\n if (retain > 0) {\n op = { retain }\n if (!object.isEmpty(attributes)) {\n op.attributes = object.assign({}, attributes)\n }\n }\n retain = 0\n break\n }\n if (op) delta.push(op)\n action = null\n }\n }\n while (item !== null) {\n switch (item.content.constructor) {\n case ContentType:\n case ContentEmbed:\n if (this.adds(item)) {\n if (!this.deletes(item)) {\n addOp()\n action = 'insert'\n insert = item.content.getContent()[0]\n addOp()\n }\n } else if (this.deletes(item)) {\n if (action !== 'delete') {\n addOp()\n action = 'delete'\n }\n deleteLen += 1\n } else if (!item.deleted) {\n if (action !== 'retain') {\n addOp()\n action = 'retain'\n }\n retain += 1\n }\n break\n case ContentString:\n if (this.adds(item)) {\n if (!this.deletes(item)) {\n if (action !== 'insert') {\n addOp()\n action = 'insert'\n }\n insert += /** @type {ContentString} */ (item.content).str\n }\n } else if (this.deletes(item)) {\n if (action !== 'delete') {\n addOp()\n action = 'delete'\n }\n deleteLen += item.length\n } else if (!item.deleted) {\n if (action !== 'retain') {\n addOp()\n action = 'retain'\n }\n retain += item.length\n }\n break\n case ContentFormat: {\n const { key, value } = /** @type {ContentFormat} */ (item.content)\n if (this.adds(item)) {\n if (!this.deletes(item)) {\n const curVal = currentAttributes.get(key) ?? null\n if (!equalAttrs(curVal, value)) {\n if (action === 'retain') {\n addOp()\n }\n if (equalAttrs(value, (oldAttributes.get(key) ?? null))) {\n delete attributes[key]\n } else {\n attributes[key] = value\n }\n } else if (value !== null) {\n item.delete(transaction)\n }\n }\n } else if (this.deletes(item)) {\n oldAttributes.set(key, value)\n const curVal = currentAttributes.get(key) ?? null\n if (!equalAttrs(curVal, value)) {\n if (action === 'retain') {\n addOp()\n }\n attributes[key] = curVal\n }\n } else if (!item.deleted) {\n oldAttributes.set(key, value)\n const attr = attributes[key]\n if (attr !== undefined) {\n if (!equalAttrs(attr, value)) {\n if (action === 'retain') {\n addOp()\n }\n if (value === null) {\n delete attributes[key]\n } else {\n attributes[key] = value\n }\n } else if (attr !== null) { // this will be cleaned up automatically by the contextless cleanup function\n item.delete(transaction)\n }\n }\n }\n if (!item.deleted) {\n if (action === 'insert') {\n addOp()\n }\n updateCurrentAttributes(currentAttributes, /** @type {ContentFormat} */ (item.content))\n }\n break\n }\n }\n item = item.right\n }\n addOp()\n while (delta.length > 0) {\n const lastOp = delta[delta.length - 1]\n if (lastOp.retain !== undefined && lastOp.attributes === undefined) {\n // retain delta's if they don't assign attributes\n delta.pop()\n } else {\n break\n }\n }\n })\n this._delta = delta\n }\n return /** @type {any} */ (this._delta)\n }\n}\n\n/**\n * Type that represents text with formatting information.\n *\n * This type replaces y-richtext as this implementation is able to handle\n * block formats (format information on a paragraph), embeds (complex elements\n * like pictures and videos), and text formats (**bold**, *italic*).\n *\n * @extends AbstractType\n */\nexport class YText extends AbstractType {\n /**\n * @param {String} [string] The initial value of the YText.\n */\n constructor (string) {\n super()\n /**\n * Array of pending operations on this type\n * @type {Array?}\n */\n this._pending = string !== undefined ? [() => this.insert(0, string)] : []\n /**\n * @type {Array|null}\n */\n this._searchMarker = []\n /**\n * Whether this YText contains formatting attributes.\n * This flag is updated when a formatting item is integrated (see ContentFormat.integrate)\n */\n this._hasFormatting = false\n }\n\n /**\n * Number of characters of this text type.\n *\n * @type {number}\n */\n get length () {\n this.doc ?? warnPrematureAccess()\n return this._length\n }\n\n /**\n * @param {Doc} y\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n try {\n /** @type {Array} */ (this._pending).forEach(f => f())\n } catch (e) {\n console.error(e)\n }\n this._pending = null\n }\n\n _copy () {\n return new YText()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YText}\n */\n clone () {\n const text = new YText()\n text.applyDelta(this.toDelta())\n return text\n }\n\n /**\n * Creates YTextEvent and calls observers.\n *\n * @param {Transaction} transaction\n * @param {Set} parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, parentSubs) {\n super._callObserver(transaction, parentSubs)\n const event = new YTextEvent(this, transaction, parentSubs)\n callTypeObservers(this, transaction, event)\n // If a remote change happened, we try to cleanup potential formatting duplicates.\n if (!transaction.local && this._hasFormatting) {\n transaction._needFormattingCleanup = true\n }\n }\n\n /**\n * Returns the unformatted string representation of this YText type.\n *\n * @public\n */\n toString () {\n this.doc ?? warnPrematureAccess()\n let str = ''\n /**\n * @type {Item|null}\n */\n let n = this._start\n while (n !== null) {\n if (!n.deleted && n.countable && n.content.constructor === ContentString) {\n str += /** @type {ContentString} */ (n.content).str\n }\n n = n.right\n }\n return str\n }\n\n /**\n * Returns the unformatted string representation of this YText type.\n *\n * @return {string}\n * @public\n */\n toJSON () {\n return this.toString()\n }\n\n /**\n * Apply a {@link Delta} on this shared YText type.\n *\n * @param {any} delta The changes to apply on this element.\n * @param {object} opts\n * @param {boolean} [opts.sanitize] Sanitize input delta. Removes ending newlines if set to true.\n *\n *\n * @public\n */\n applyDelta (delta, { sanitize = true } = {}) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n const currPos = new ItemTextListPosition(null, this._start, 0, new Map())\n for (let i = 0; i < delta.length; i++) {\n const op = delta[i]\n if (op.insert !== undefined) {\n // Quill assumes that the content starts with an empty paragraph.\n // Yjs/Y.Text assumes that it starts empty. We always hide that\n // there is a newline at the end of the content.\n // If we omit this step, clients will see a different number of\n // paragraphs, but nothing bad will happen.\n const ins = (!sanitize && typeof op.insert === 'string' && i === delta.length - 1 && currPos.right === null && op.insert.slice(-1) === '\\n') ? op.insert.slice(0, -1) : op.insert\n if (typeof ins !== 'string' || ins.length > 0) {\n insertText(transaction, this, currPos, ins, op.attributes || {})\n }\n } else if (op.retain !== undefined) {\n formatText(transaction, this, currPos, op.retain, op.attributes || {})\n } else if (op.delete !== undefined) {\n deleteText(transaction, currPos, op.delete)\n }\n }\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.applyDelta(delta))\n }\n }\n\n /**\n * Returns the Delta representation of this YText type.\n *\n * @param {Snapshot} [snapshot]\n * @param {Snapshot} [prevSnapshot]\n * @param {function('removed' | 'added', ID):any} [computeYChange]\n * @return {any} The Delta representation of this type.\n *\n * @public\n */\n toDelta (snapshot, prevSnapshot, computeYChange) {\n this.doc ?? warnPrematureAccess()\n /**\n * @type{Array}\n */\n const ops = []\n const currentAttributes = new Map()\n const doc = /** @type {Doc} */ (this.doc)\n let str = ''\n let n = this._start\n function packStr () {\n if (str.length > 0) {\n // pack str with attributes to ops\n /**\n * @type {Object}\n */\n const attributes = {}\n let addAttributes = false\n currentAttributes.forEach((value, key) => {\n addAttributes = true\n attributes[key] = value\n })\n /**\n * @type {Object}\n */\n const op = { insert: str }\n if (addAttributes) {\n op.attributes = attributes\n }\n ops.push(op)\n str = ''\n }\n }\n const computeDelta = () => {\n while (n !== null) {\n if (isVisible(n, snapshot) || (prevSnapshot !== undefined && isVisible(n, prevSnapshot))) {\n switch (n.content.constructor) {\n case ContentString: {\n const cur = currentAttributes.get('ychange')\n if (snapshot !== undefined && !isVisible(n, snapshot)) {\n if (cur === undefined || cur.user !== n.id.client || cur.type !== 'removed') {\n packStr()\n currentAttributes.set('ychange', computeYChange ? computeYChange('removed', n.id) : { type: 'removed' })\n }\n } else if (prevSnapshot !== undefined && !isVisible(n, prevSnapshot)) {\n if (cur === undefined || cur.user !== n.id.client || cur.type !== 'added') {\n packStr()\n currentAttributes.set('ychange', computeYChange ? computeYChange('added', n.id) : { type: 'added' })\n }\n } else if (cur !== undefined) {\n packStr()\n currentAttributes.delete('ychange')\n }\n str += /** @type {ContentString} */ (n.content).str\n break\n }\n case ContentType:\n case ContentEmbed: {\n packStr()\n /**\n * @type {Object}\n */\n const op = {\n insert: n.content.getContent()[0]\n }\n if (currentAttributes.size > 0) {\n const attrs = /** @type {Object} */ ({})\n op.attributes = attrs\n currentAttributes.forEach((value, key) => {\n attrs[key] = value\n })\n }\n ops.push(op)\n break\n }\n case ContentFormat:\n if (isVisible(n, snapshot)) {\n packStr()\n updateCurrentAttributes(currentAttributes, /** @type {ContentFormat} */ (n.content))\n }\n break\n }\n }\n n = n.right\n }\n packStr()\n }\n if (snapshot || prevSnapshot) {\n // snapshots are merged again after the transaction, so we need to keep the\n // transaction alive until we are done\n transact(doc, transaction => {\n if (snapshot) {\n splitSnapshotAffectedStructs(transaction, snapshot)\n }\n if (prevSnapshot) {\n splitSnapshotAffectedStructs(transaction, prevSnapshot)\n }\n computeDelta()\n }, 'cleanup')\n } else {\n computeDelta()\n }\n return ops\n }\n\n /**\n * Insert text at a given index.\n *\n * @param {number} index The index at which to start inserting.\n * @param {String} text The text to insert at the specified position.\n * @param {TextAttributes} [attributes] Optionally define some formatting\n * information to apply on the inserted\n * Text.\n * @public\n */\n insert (index, text, attributes) {\n if (text.length <= 0) {\n return\n }\n const y = this.doc\n if (y !== null) {\n transact(y, transaction => {\n const pos = findPosition(transaction, this, index, !attributes)\n if (!attributes) {\n attributes = {}\n // @ts-ignore\n pos.currentAttributes.forEach((v, k) => { attributes[k] = v })\n }\n insertText(transaction, this, pos, text, attributes)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.insert(index, text, attributes))\n }\n }\n\n /**\n * Inserts an embed at a index.\n *\n * @param {number} index The index to insert the embed at.\n * @param {Object | AbstractType} embed The Object that represents the embed.\n * @param {TextAttributes} [attributes] Attribute information to apply on the\n * embed\n *\n * @public\n */\n insertEmbed (index, embed, attributes) {\n const y = this.doc\n if (y !== null) {\n transact(y, transaction => {\n const pos = findPosition(transaction, this, index, !attributes)\n insertText(transaction, this, pos, embed, attributes || {})\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.insertEmbed(index, embed, attributes || {}))\n }\n }\n\n /**\n * Deletes text starting from an index.\n *\n * @param {number} index Index at which to start deleting.\n * @param {number} length The number of characters to remove. Defaults to 1.\n *\n * @public\n */\n delete (index, length) {\n if (length === 0) {\n return\n }\n const y = this.doc\n if (y !== null) {\n transact(y, transaction => {\n deleteText(transaction, findPosition(transaction, this, index, true), length)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.delete(index, length))\n }\n }\n\n /**\n * Assigns properties to a range of text.\n *\n * @param {number} index The position where to start formatting.\n * @param {number} length The amount of characters to assign properties to.\n * @param {TextAttributes} attributes Attribute information to apply on the\n * text.\n *\n * @public\n */\n format (index, length, attributes) {\n if (length === 0) {\n return\n }\n const y = this.doc\n if (y !== null) {\n transact(y, transaction => {\n const pos = findPosition(transaction, this, index, false)\n if (pos.right === null) {\n return\n }\n formatText(transaction, this, pos, length, attributes)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.format(index, length, attributes))\n }\n }\n\n /**\n * Removes an attribute.\n *\n * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks.\n *\n * @param {String} attributeName The attribute name that is to be removed.\n *\n * @public\n */\n removeAttribute (attributeName) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapDelete(transaction, this, attributeName)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.removeAttribute(attributeName))\n }\n }\n\n /**\n * Sets or updates an attribute.\n *\n * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks.\n *\n * @param {String} attributeName The attribute name that is to be set.\n * @param {any} attributeValue The attribute value that is to be set.\n *\n * @public\n */\n setAttribute (attributeName, attributeValue) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapSet(transaction, this, attributeName, attributeValue)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.setAttribute(attributeName, attributeValue))\n }\n }\n\n /**\n * Returns an attribute value that belongs to the attribute name.\n *\n * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks.\n *\n * @param {String} attributeName The attribute name that identifies the\n * queried value.\n * @return {any} The queried attribute value.\n *\n * @public\n */\n getAttribute (attributeName) {\n return /** @type {any} */ (typeMapGet(this, attributeName))\n }\n\n /**\n * Returns all attribute name/value pairs in a JSON Object.\n *\n * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks.\n *\n * @return {Object} A JSON Object that describes the attributes.\n *\n * @public\n */\n getAttributes () {\n return typeMapGetAll(this)\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n _write (encoder) {\n encoder.writeTypeRef(YTextRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} _decoder\n * @return {YText}\n *\n * @private\n * @function\n */\nexport const readYText = _decoder => new YText()\n", "/**\n * @module YXml\n */\n\nimport {\n YXmlEvent,\n YXmlElement,\n AbstractType,\n typeListMap,\n typeListForEach,\n typeListInsertGenerics,\n typeListInsertGenericsAfter,\n typeListDelete,\n typeListToArray,\n YXmlFragmentRefID,\n callTypeObservers,\n transact,\n typeListGet,\n typeListSlice,\n warnPrematureAccess,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, ContentType, Transaction, Item, YXmlText, YXmlHook // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\nimport * as array from 'lib0/array'\n\n/**\n * Define the elements to which a set of CSS queries apply.\n * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors|CSS_Selectors}\n *\n * @example\n * query = '.classSelector'\n * query = 'nodeSelector'\n * query = '#idSelector'\n *\n * @typedef {string} CSS_Selector\n */\n\n/**\n * Dom filter function.\n *\n * @callback domFilter\n * @param {string} nodeName The nodeName of the element\n * @param {Map} attributes The map of attributes.\n * @return {boolean} Whether to include the Dom node in the YXmlElement.\n */\n\n/**\n * Represents a subset of the nodes of a YXmlElement / YXmlFragment and a\n * position within them.\n *\n * Can be created with {@link YXmlFragment#createTreeWalker}\n *\n * @public\n * @implements {Iterable}\n */\nexport class YXmlTreeWalker {\n /**\n * @param {YXmlFragment | YXmlElement} root\n * @param {function(AbstractType):boolean} [f]\n */\n constructor (root, f = () => true) {\n this._filter = f\n this._root = root\n /**\n * @type {Item}\n */\n this._currentNode = /** @type {Item} */ (root._start)\n this._firstCall = true\n root.doc ?? warnPrematureAccess()\n }\n\n [Symbol.iterator] () {\n return this\n }\n\n /**\n * Get the next node.\n *\n * @return {IteratorResult} The next node.\n *\n * @public\n */\n next () {\n /**\n * @type {Item|null}\n */\n let n = this._currentNode\n let type = n && n.content && /** @type {any} */ (n.content).type\n if (n !== null && (!this._firstCall || n.deleted || !this._filter(type))) { // if first call, we check if we can use the first item\n do {\n type = /** @type {any} */ (n.content).type\n if (!n.deleted && (type.constructor === YXmlElement || type.constructor === YXmlFragment) && type._start !== null) {\n // walk down in the tree\n n = type._start\n } else {\n // walk right or up in the tree\n while (n !== null) {\n if (n.right !== null) {\n n = n.right\n break\n } else if (n.parent === this._root) {\n n = null\n } else {\n n = /** @type {AbstractType} */ (n.parent)._item\n }\n }\n }\n } while (n !== null && (n.deleted || !this._filter(/** @type {ContentType} */ (n.content).type)))\n }\n this._firstCall = false\n if (n === null) {\n // @ts-ignore\n return { value: undefined, done: true }\n }\n this._currentNode = n\n return { value: /** @type {any} */ (n.content).type, done: false }\n }\n}\n\n/**\n * Represents a list of {@link YXmlElement}.and {@link YXmlText} types.\n * A YxmlFragment is similar to a {@link YXmlElement}, but it does not have a\n * nodeName and it does not have attributes. Though it can be bound to a DOM\n * element - in this case the attributes and the nodeName are not shared.\n *\n * @public\n * @extends AbstractType\n */\nexport class YXmlFragment extends AbstractType {\n constructor () {\n super()\n /**\n * @type {Array|null}\n */\n this._prelimContent = []\n }\n\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get firstChild () {\n const first = this._first\n return first ? first.content.getContent()[0] : null\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n this.insert(0, /** @type {Array} */ (this._prelimContent))\n this._prelimContent = null\n }\n\n _copy () {\n return new YXmlFragment()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YXmlFragment}\n */\n clone () {\n const el = new YXmlFragment()\n // @ts-ignore\n el.insert(0, this.toArray().map(item => item instanceof AbstractType ? item.clone() : item))\n return el\n }\n\n get length () {\n this.doc ?? warnPrematureAccess()\n return this._prelimContent === null ? this._length : this._prelimContent.length\n }\n\n /**\n * Create a subtree of childNodes.\n *\n * @example\n * const walker = elem.createTreeWalker(dom => dom.nodeName === 'div')\n * for (let node in walker) {\n * // `node` is a div node\n * nop(node)\n * }\n *\n * @param {function(AbstractType):boolean} filter Function that is called on each child element and\n * returns a Boolean indicating whether the child\n * is to be included in the subtree.\n * @return {YXmlTreeWalker} A subtree and a position within it.\n *\n * @public\n */\n createTreeWalker (filter) {\n return new YXmlTreeWalker(this, filter)\n }\n\n /**\n * Returns the first YXmlElement that matches the query.\n * Similar to DOM's {@link querySelector}.\n *\n * Query support:\n * - tagname\n * TODO:\n * - id\n * - attribute\n *\n * @param {CSS_Selector} query The query on the children.\n * @return {YXmlElement|YXmlText|YXmlHook|null} The first element that matches the query or null.\n *\n * @public\n */\n querySelector (query) {\n query = query.toUpperCase()\n // @ts-ignore\n const iterator = new YXmlTreeWalker(this, element => element.nodeName && element.nodeName.toUpperCase() === query)\n const next = iterator.next()\n if (next.done) {\n return null\n } else {\n return next.value\n }\n }\n\n /**\n * Returns all YXmlElements that match the query.\n * Similar to Dom's {@link querySelectorAll}.\n *\n * @todo Does not yet support all queries. Currently only query by tagName.\n *\n * @param {CSS_Selector} query The query on the children\n * @return {Array} The elements that match this query.\n *\n * @public\n */\n querySelectorAll (query) {\n query = query.toUpperCase()\n // @ts-ignore\n return array.from(new YXmlTreeWalker(this, element => element.nodeName && element.nodeName.toUpperCase() === query))\n }\n\n /**\n * Creates YXmlEvent and calls observers.\n *\n * @param {Transaction} transaction\n * @param {Set} parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, parentSubs) {\n callTypeObservers(this, transaction, new YXmlEvent(this, parentSubs, transaction))\n }\n\n /**\n * Get the string representation of all the children of this YXmlFragment.\n *\n * @return {string} The string representation of all children.\n */\n toString () {\n return typeListMap(this, xml => xml.toString()).join('')\n }\n\n /**\n * @return {string}\n */\n toJSON () {\n return this.toString()\n }\n\n /**\n * Creates a Dom Element that mirrors this YXmlElement.\n *\n * @param {Document} [_document=document] The document object (you must define\n * this when calling this method in\n * nodejs)\n * @param {Object} [hooks={}] Optional property to customize how hooks\n * are presented in the DOM\n * @param {any} [binding] You should not set this property. This is\n * used if DomBinding wants to create a\n * association to the created DOM type.\n * @return {Node} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}\n *\n * @public\n */\n toDOM (_document = document, hooks = {}, binding) {\n const fragment = _document.createDocumentFragment()\n if (binding !== undefined) {\n binding._createAssociation(fragment, this)\n }\n typeListForEach(this, xmlType => {\n fragment.insertBefore(xmlType.toDOM(_document, hooks, binding), null)\n })\n return fragment\n }\n\n /**\n * Inserts new content at an index.\n *\n * @example\n * // Insert character 'a' at position 0\n * xml.insert(0, [new Y.XmlText('text')])\n *\n * @param {number} index The index to insert content at\n * @param {Array} content The array of content\n */\n insert (index, content) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListInsertGenerics(transaction, this, index, content)\n })\n } else {\n // @ts-ignore _prelimContent is defined because this is not yet integrated\n this._prelimContent.splice(index, 0, ...content)\n }\n }\n\n /**\n * Inserts new content at an index.\n *\n * @example\n * // Insert character 'a' at position 0\n * xml.insert(0, [new Y.XmlText('text')])\n *\n * @param {null|Item|YXmlElement|YXmlText} ref The index to insert content at\n * @param {Array} content The array of content\n */\n insertAfter (ref, content) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n const refItem = (ref && ref instanceof AbstractType) ? ref._item : ref\n typeListInsertGenericsAfter(transaction, this, refItem, content)\n })\n } else {\n const pc = /** @type {Array} */ (this._prelimContent)\n const index = ref === null ? 0 : pc.findIndex(el => el === ref) + 1\n if (index === 0 && ref !== null) {\n throw error.create('Reference item not found')\n }\n pc.splice(index, 0, ...content)\n }\n }\n\n /**\n * Deletes elements starting from an index.\n *\n * @param {number} index Index at which to start deleting elements\n * @param {number} [length=1] The number of elements to remove. Defaults to 1.\n */\n delete (index, length = 1) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListDelete(transaction, this, index, length)\n })\n } else {\n // @ts-ignore _prelimContent is defined because this is not yet integrated\n this._prelimContent.splice(index, length)\n }\n }\n\n /**\n * Transforms this YArray to a JavaScript Array.\n *\n * @return {Array}\n */\n toArray () {\n return typeListToArray(this)\n }\n\n /**\n * Appends content to this YArray.\n *\n * @param {Array} content Array of content to append.\n */\n push (content) {\n this.insert(this.length, content)\n }\n\n /**\n * Prepends content to this YArray.\n *\n * @param {Array} content Array of content to prepend.\n */\n unshift (content) {\n this.insert(0, content)\n }\n\n /**\n * Returns the i-th element from a YArray.\n *\n * @param {number} index The index of the element to return from the YArray\n * @return {YXmlElement|YXmlText}\n */\n get (index) {\n return typeListGet(this, index)\n }\n\n /**\n * Returns a portion of this YXmlFragment into a JavaScript Array selected\n * from start to end (end not included).\n *\n * @param {number} [start]\n * @param {number} [end]\n * @return {Array}\n */\n slice (start = 0, end = this.length) {\n return typeListSlice(this, start, end)\n }\n\n /**\n * Executes a provided function on once on every child element.\n *\n * @param {function(YXmlElement|YXmlText,number, typeof self):void} f A function to execute on every element of this YArray.\n */\n forEach (f) {\n typeListForEach(this, f)\n }\n\n /**\n * Transform the properties of this type to binary and write it to an\n * BinaryEncoder.\n *\n * This is called when this Item is sent to a remote peer.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n */\n _write (encoder) {\n encoder.writeTypeRef(YXmlFragmentRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} _decoder\n * @return {YXmlFragment}\n *\n * @private\n * @function\n */\nexport const readYXmlFragment = _decoder => new YXmlFragment()\n", "import * as object from 'lib0/object'\n\nimport {\n YXmlFragment,\n transact,\n typeMapDelete,\n typeMapHas,\n typeMapSet,\n typeMapGet,\n typeMapGetAll,\n typeMapGetAllSnapshot,\n typeListForEach,\n YXmlElementRefID,\n Snapshot, YXmlText, ContentType, AbstractType, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, Item // eslint-disable-line\n} from '../internals.js'\n\n/**\n * @typedef {Object|number|null|Array|string|Uint8Array|AbstractType} ValueTypes\n */\n\n/**\n * An YXmlElement imitates the behavior of a\n * https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element\n *\n * * An YXmlElement has attributes (key value pairs)\n * * An YXmlElement has childElements that must inherit from YXmlElement\n *\n * @template {{ [key: string]: ValueTypes }} [KV={ [key: string]: string }]\n */\nexport class YXmlElement extends YXmlFragment {\n constructor (nodeName = 'UNDEFINED') {\n super()\n this.nodeName = nodeName\n /**\n * @type {Map|null}\n */\n this._prelimAttrs = new Map()\n }\n\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get nextSibling () {\n const n = this._item ? this._item.next : null\n return n ? /** @type {YXmlElement|YXmlText} */ (/** @type {ContentType} */ (n.content).type) : null\n }\n\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get prevSibling () {\n const n = this._item ? this._item.prev : null\n return n ? /** @type {YXmlElement|YXmlText} */ (/** @type {ContentType} */ (n.content).type) : null\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n ;(/** @type {Map} */ (this._prelimAttrs)).forEach((value, key) => {\n this.setAttribute(key, value)\n })\n this._prelimAttrs = null\n }\n\n /**\n * Creates an Item with the same effect as this Item (without position effect)\n *\n * @return {YXmlElement}\n */\n _copy () {\n return new YXmlElement(this.nodeName)\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YXmlElement}\n */\n clone () {\n /**\n * @type {YXmlElement}\n */\n const el = new YXmlElement(this.nodeName)\n const attrs = this.getAttributes()\n object.forEach(attrs, (value, key) => {\n if (typeof value === 'string') {\n el.setAttribute(key, value)\n }\n })\n // @ts-ignore\n el.insert(0, this.toArray().map(item => item instanceof AbstractType ? item.clone() : item))\n return el\n }\n\n /**\n * Returns the XML serialization of this YXmlElement.\n * The attributes are ordered by attribute-name, so you can easily use this\n * method to compare YXmlElements\n *\n * @return {string} The string representation of this type.\n *\n * @public\n */\n toString () {\n const attrs = this.getAttributes()\n const stringBuilder = []\n const keys = []\n for (const key in attrs) {\n keys.push(key)\n }\n keys.sort()\n const keysLen = keys.length\n for (let i = 0; i < keysLen; i++) {\n const key = keys[i]\n stringBuilder.push(key + '=\"' + attrs[key] + '\"')\n }\n const nodeName = this.nodeName.toLocaleLowerCase()\n const attrsString = stringBuilder.length > 0 ? ' ' + stringBuilder.join(' ') : ''\n return `<${nodeName}${attrsString}>${super.toString()}`\n }\n\n /**\n * Removes an attribute from this YXmlElement.\n *\n * @param {string} attributeName The attribute name that is to be removed.\n *\n * @public\n */\n removeAttribute (attributeName) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapDelete(transaction, this, attributeName)\n })\n } else {\n /** @type {Map} */ (this._prelimAttrs).delete(attributeName)\n }\n }\n\n /**\n * Sets or updates an attribute.\n *\n * @template {keyof KV & string} KEY\n *\n * @param {KEY} attributeName The attribute name that is to be set.\n * @param {KV[KEY]} attributeValue The attribute value that is to be set.\n *\n * @public\n */\n setAttribute (attributeName, attributeValue) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapSet(transaction, this, attributeName, attributeValue)\n })\n } else {\n /** @type {Map} */ (this._prelimAttrs).set(attributeName, attributeValue)\n }\n }\n\n /**\n * Returns an attribute value that belongs to the attribute name.\n *\n * @template {keyof KV & string} KEY\n *\n * @param {KEY} attributeName The attribute name that identifies the\n * queried value.\n * @return {KV[KEY]|undefined} The queried attribute value.\n *\n * @public\n */\n getAttribute (attributeName) {\n return /** @type {any} */ (typeMapGet(this, attributeName))\n }\n\n /**\n * Returns whether an attribute exists\n *\n * @param {string} attributeName The attribute name to check for existence.\n * @return {boolean} whether the attribute exists.\n *\n * @public\n */\n hasAttribute (attributeName) {\n return /** @type {any} */ (typeMapHas(this, attributeName))\n }\n\n /**\n * Returns all attribute name/value pairs in a JSON Object.\n *\n * @param {Snapshot} [snapshot]\n * @return {{ [Key in Extract]?: KV[Key]}} A JSON Object that describes the attributes.\n *\n * @public\n */\n getAttributes (snapshot) {\n return /** @type {any} */ (snapshot ? typeMapGetAllSnapshot(this, snapshot) : typeMapGetAll(this))\n }\n\n /**\n * Creates a Dom Element that mirrors this YXmlElement.\n *\n * @param {Document} [_document=document] The document object (you must define\n * this when calling this method in\n * nodejs)\n * @param {Object} [hooks={}] Optional property to customize how hooks\n * are presented in the DOM\n * @param {any} [binding] You should not set this property. This is\n * used if DomBinding wants to create a\n * association to the created DOM type.\n * @return {Node} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}\n *\n * @public\n */\n toDOM (_document = document, hooks = {}, binding) {\n const dom = _document.createElement(this.nodeName)\n const attrs = this.getAttributes()\n for (const key in attrs) {\n const value = attrs[key]\n if (typeof value === 'string') {\n dom.setAttribute(key, value)\n }\n }\n typeListForEach(this, yxml => {\n dom.appendChild(yxml.toDOM(_document, hooks, binding))\n })\n if (binding !== undefined) {\n binding._createAssociation(dom, this)\n }\n return dom\n }\n\n /**\n * Transform the properties of this type to binary and write it to an\n * BinaryEncoder.\n *\n * This is called when this Item is sent to a remote peer.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n */\n _write (encoder) {\n encoder.writeTypeRef(YXmlElementRefID)\n encoder.writeKey(this.nodeName)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {YXmlElement}\n *\n * @function\n */\nexport const readYXmlElement = decoder => new YXmlElement(decoder.readKey())\n", "import {\n YEvent,\n YXmlText, YXmlElement, YXmlFragment, Transaction // eslint-disable-line\n} from '../internals.js'\n\n/**\n * @extends YEvent\n * An Event that describes changes on a YXml Element or Yxml Fragment\n */\nexport class YXmlEvent extends YEvent {\n /**\n * @param {YXmlElement|YXmlText|YXmlFragment} target The target on which the event is created.\n * @param {Set} subs The set of changed attributes. `null` is included if the\n * child list changed.\n * @param {Transaction} transaction The transaction instance with wich the\n * change was created.\n */\n constructor (target, subs, transaction) {\n super(target, transaction)\n /**\n * Whether the children changed.\n * @type {Boolean}\n * @private\n */\n this.childListChanged = false\n /**\n * Set of all changed attributes.\n * @type {Set}\n */\n this.attributesChanged = new Set()\n subs.forEach((sub) => {\n if (sub === null) {\n this.childListChanged = true\n } else {\n this.attributesChanged.add(sub)\n }\n })\n }\n}\n", "import {\n YMap,\n YXmlHookRefID,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2 // eslint-disable-line\n} from '../internals.js'\n\n/**\n * You can manage binding to a custom type with YXmlHook.\n *\n * @extends {YMap}\n */\nexport class YXmlHook extends YMap {\n /**\n * @param {string} hookName nodeName of the Dom Node.\n */\n constructor (hookName) {\n super()\n /**\n * @type {string}\n */\n this.hookName = hookName\n }\n\n /**\n * Creates an Item with the same effect as this Item (without position effect)\n */\n _copy () {\n return new YXmlHook(this.hookName)\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YXmlHook}\n */\n clone () {\n const el = new YXmlHook(this.hookName)\n this.forEach((value, key) => {\n el.set(key, value)\n })\n return el\n }\n\n /**\n * Creates a Dom Element that mirrors this YXmlElement.\n *\n * @param {Document} [_document=document] The document object (you must define\n * this when calling this method in\n * nodejs)\n * @param {Object.} [hooks] Optional property to customize how hooks\n * are presented in the DOM\n * @param {any} [binding] You should not set this property. This is\n * used if DomBinding wants to create a\n * association to the created DOM type\n * @return {Element} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}\n *\n * @public\n */\n toDOM (_document = document, hooks = {}, binding) {\n const hook = hooks[this.hookName]\n let dom\n if (hook !== undefined) {\n dom = hook.createDom(this)\n } else {\n dom = document.createElement(this.hookName)\n }\n dom.setAttribute('data-yjs-hook', this.hookName)\n if (binding !== undefined) {\n binding._createAssociation(dom, this)\n }\n return dom\n }\n\n /**\n * Transform the properties of this type to binary and write it to an\n * BinaryEncoder.\n *\n * This is called when this Item is sent to a remote peer.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n */\n _write (encoder) {\n encoder.writeTypeRef(YXmlHookRefID)\n encoder.writeKey(this.hookName)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {YXmlHook}\n *\n * @private\n * @function\n */\nexport const readYXmlHook = decoder =>\n new YXmlHook(decoder.readKey())\n", "import {\n YText,\n YXmlTextRefID,\n ContentType, YXmlElement, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, // eslint-disable-line\n} from '../internals.js'\n\n/**\n * Represents text in a Dom Element. In the future this type will also handle\n * simple formatting information like bold and italic.\n */\nexport class YXmlText extends YText {\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get nextSibling () {\n const n = this._item ? this._item.next : null\n return n ? /** @type {YXmlElement|YXmlText} */ (/** @type {ContentType} */ (n.content).type) : null\n }\n\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get prevSibling () {\n const n = this._item ? this._item.prev : null\n return n ? /** @type {YXmlElement|YXmlText} */ (/** @type {ContentType} */ (n.content).type) : null\n }\n\n _copy () {\n return new YXmlText()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YXmlText}\n */\n clone () {\n const text = new YXmlText()\n text.applyDelta(this.toDelta())\n return text\n }\n\n /**\n * Creates a Dom Element that mirrors this YXmlText.\n *\n * @param {Document} [_document=document] The document object (you must define\n * this when calling this method in\n * nodejs)\n * @param {Object} [hooks] Optional property to customize how hooks\n * are presented in the DOM\n * @param {any} [binding] You should not set this property. This is\n * used if DomBinding wants to create a\n * association to the created DOM type.\n * @return {Text} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}\n *\n * @public\n */\n toDOM (_document = document, hooks, binding) {\n const dom = _document.createTextNode(this.toString())\n if (binding !== undefined) {\n binding._createAssociation(dom, this)\n }\n return dom\n }\n\n toString () {\n // @ts-ignore\n return this.toDelta().map(delta => {\n const nestedNodes = []\n for (const nodeName in delta.attributes) {\n const attrs = []\n for (const key in delta.attributes[nodeName]) {\n attrs.push({ key, value: delta.attributes[nodeName][key] })\n }\n // sort attributes to get a unique order\n attrs.sort((a, b) => a.key < b.key ? -1 : 1)\n nestedNodes.push({ nodeName, attrs })\n }\n // sort node order to get a unique order\n nestedNodes.sort((a, b) => a.nodeName < b.nodeName ? -1 : 1)\n // now convert to dom string\n let str = ''\n for (let i = 0; i < nestedNodes.length; i++) {\n const node = nestedNodes[i]\n str += `<${node.nodeName}`\n for (let j = 0; j < node.attrs.length; j++) {\n const attr = node.attrs[j]\n str += ` ${attr.key}=\"${attr.value}\"`\n }\n str += '>'\n }\n str += delta.insert\n for (let i = nestedNodes.length - 1; i >= 0; i--) {\n str += ``\n }\n return str\n }).join('')\n }\n\n /**\n * @return {string}\n */\n toJSON () {\n return this.toString()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n _write (encoder) {\n encoder.writeTypeRef(YXmlTextRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {YXmlText}\n *\n * @private\n * @function\n */\nexport const readYXmlText = decoder => new YXmlText()\n", "import {\n UpdateEncoderV1, UpdateEncoderV2, ID, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\nexport class AbstractStruct {\n /**\n * @param {ID} id\n * @param {number} length\n */\n constructor (id, length) {\n this.id = id\n this.length = length\n }\n\n /**\n * @type {boolean}\n */\n get deleted () {\n throw error.methodUnimplemented()\n }\n\n /**\n * Merge this struct with the item to the right.\n * This method is already assuming that `this.id.clock + this.length === this.id.clock`.\n * Also this method does *not* remove right from StructStore!\n * @param {AbstractStruct} right\n * @return {boolean} wether this merged with right\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n * @param {number} offset\n * @param {number} encodingRef\n */\n write (encoder, offset, encodingRef) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {Transaction} transaction\n * @param {number} offset\n */\n integrate (transaction, offset) {\n throw error.methodUnimplemented()\n }\n}\n", "import {\n AbstractStruct,\n addStruct,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Transaction, ID // eslint-disable-line\n} from '../internals.js'\n\nexport const structGCRefNumber = 0\n\n/**\n * @private\n */\nexport class GC extends AbstractStruct {\n get deleted () {\n return true\n }\n\n delete () {}\n\n /**\n * @param {GC} right\n * @return {boolean}\n */\n mergeWith (right) {\n if (this.constructor !== right.constructor) {\n return false\n }\n this.length += right.length\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {number} offset\n */\n integrate (transaction, offset) {\n if (offset > 0) {\n this.id.clock += offset\n this.length -= offset\n }\n addStruct(transaction.doc.store, this)\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeInfo(structGCRefNumber)\n encoder.writeLen(this.length - offset)\n }\n\n /**\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @return {null | number}\n */\n getMissing (transaction, store) {\n return null\n }\n}\n", "import {\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Item, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\nexport class ContentBinary {\n /**\n * @param {Uint8Array} content\n */\n constructor (content) {\n this.content = content\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return [this.content]\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentBinary}\n */\n copy () {\n return new ContentBinary(this.content)\n }\n\n /**\n * @param {number} offset\n * @return {ContentBinary}\n */\n splice (offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentBinary} right\n * @return {boolean}\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeBuf(this.content)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 3\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2 } decoder\n * @return {ContentBinary}\n */\nexport const readContentBinary = decoder => new ContentBinary(decoder.readBuf())\n", "import {\n addToDeleteSet,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Item, Transaction // eslint-disable-line\n} from '../internals.js'\n\nexport class ContentDeleted {\n /**\n * @param {number} len\n */\n constructor (len) {\n this.len = len\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return this.len\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return []\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return false\n }\n\n /**\n * @return {ContentDeleted}\n */\n copy () {\n return new ContentDeleted(this.len)\n }\n\n /**\n * @param {number} offset\n * @return {ContentDeleted}\n */\n splice (offset) {\n const right = new ContentDeleted(this.len - offset)\n this.len = offset\n return right\n }\n\n /**\n * @param {ContentDeleted} right\n * @return {boolean}\n */\n mergeWith (right) {\n this.len += right.len\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {\n addToDeleteSet(transaction.deleteSet, item.id.client, item.id.clock, this.len)\n item.markDeleted()\n }\n\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeLen(this.len - offset)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 1\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2 } decoder\n * @return {ContentDeleted}\n */\nexport const readContentDeleted = decoder => new ContentDeleted(decoder.readLen())\n", "import {\n Doc, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Transaction, Item // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\n/**\n * @param {string} guid\n * @param {Object} opts\n */\nconst createDocFromOpts = (guid, opts) => new Doc({ guid, ...opts, shouldLoad: opts.shouldLoad || opts.autoLoad || false })\n\n/**\n * @private\n */\nexport class ContentDoc {\n /**\n * @param {Doc} doc\n */\n constructor (doc) {\n if (doc._item) {\n console.error('This document was already integrated as a sub-document. You should create a second instance instead with the same guid.')\n }\n /**\n * @type {Doc}\n */\n this.doc = doc\n /**\n * @type {any}\n */\n const opts = {}\n this.opts = opts\n if (!doc.gc) {\n opts.gc = false\n }\n if (doc.autoLoad) {\n opts.autoLoad = true\n }\n if (doc.meta !== null) {\n opts.meta = doc.meta\n }\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return [this.doc]\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentDoc}\n */\n copy () {\n return new ContentDoc(createDocFromOpts(this.doc.guid, this.opts))\n }\n\n /**\n * @param {number} offset\n * @return {ContentDoc}\n */\n splice (offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentDoc} right\n * @return {boolean}\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {\n // this needs to be reflected in doc.destroy as well\n this.doc._item = item\n transaction.subdocsAdded.add(this.doc)\n if (this.doc.shouldLoad) {\n transaction.subdocsLoaded.add(this.doc)\n }\n }\n\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {\n if (transaction.subdocsAdded.has(this.doc)) {\n transaction.subdocsAdded.delete(this.doc)\n } else {\n transaction.subdocsRemoved.add(this.doc)\n }\n }\n\n /**\n * @param {StructStore} store\n */\n gc (store) { }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeString(this.doc.guid)\n encoder.writeAny(this.opts)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 9\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentDoc}\n */\nexport const readContentDoc = decoder => new ContentDoc(createDocFromOpts(decoder.readString(), decoder.readAny()))\n", "import {\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Item, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\n/**\n * @private\n */\nexport class ContentEmbed {\n /**\n * @param {Object} embed\n */\n constructor (embed) {\n this.embed = embed\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return [this.embed]\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentEmbed}\n */\n copy () {\n return new ContentEmbed(this.embed)\n }\n\n /**\n * @param {number} offset\n * @return {ContentEmbed}\n */\n splice (offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentEmbed} right\n * @return {boolean}\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeJSON(this.embed)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 5\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentEmbed}\n */\nexport const readContentEmbed = decoder => new ContentEmbed(decoder.readJSON())\n", "import {\n YText, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Item, StructStore, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\n/**\n * @private\n */\nexport class ContentFormat {\n /**\n * @param {string} key\n * @param {Object} value\n */\n constructor (key, value) {\n this.key = key\n this.value = value\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return []\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return false\n }\n\n /**\n * @return {ContentFormat}\n */\n copy () {\n return new ContentFormat(this.key, this.value)\n }\n\n /**\n * @param {number} _offset\n * @return {ContentFormat}\n */\n splice (_offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentFormat} _right\n * @return {boolean}\n */\n mergeWith (_right) {\n return false\n }\n\n /**\n * @param {Transaction} _transaction\n * @param {Item} item\n */\n integrate (_transaction, item) {\n // @todo searchmarker are currently unsupported for rich text documents\n const p = /** @type {YText} */ (item.parent)\n p._searchMarker = null\n p._hasFormatting = true\n }\n\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeKey(this.key)\n encoder.writeJSON(this.value)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 6\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentFormat}\n */\nexport const readContentFormat = decoder => new ContentFormat(decoder.readKey(), decoder.readJSON())\n", "import {\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Transaction, Item, StructStore // eslint-disable-line\n} from '../internals.js'\n\n/**\n * @private\n */\nexport class ContentJSON {\n /**\n * @param {Array} arr\n */\n constructor (arr) {\n /**\n * @type {Array}\n */\n this.arr = arr\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return this.arr.length\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return this.arr\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentJSON}\n */\n copy () {\n return new ContentJSON(this.arr)\n }\n\n /**\n * @param {number} offset\n * @return {ContentJSON}\n */\n splice (offset) {\n const right = new ContentJSON(this.arr.slice(offset))\n this.arr = this.arr.slice(0, offset)\n return right\n }\n\n /**\n * @param {ContentJSON} right\n * @return {boolean}\n */\n mergeWith (right) {\n this.arr = this.arr.concat(right.arr)\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n const len = this.arr.length\n encoder.writeLen(len - offset)\n for (let i = offset; i < len; i++) {\n const c = this.arr[i]\n encoder.writeString(c === undefined ? 'undefined' : JSON.stringify(c))\n }\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 2\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentJSON}\n */\nexport const readContentJSON = decoder => {\n const len = decoder.readLen()\n const cs = []\n for (let i = 0; i < len; i++) {\n const c = decoder.readString()\n if (c === 'undefined') {\n cs.push(undefined)\n } else {\n cs.push(JSON.parse(c))\n }\n }\n return new ContentJSON(cs)\n}\n", "import {\n UpdateEncoderV1, UpdateEncoderV2, UpdateDecoderV1, UpdateDecoderV2, Transaction, Item, StructStore // eslint-disable-line\n} from '../internals.js'\n\nimport * as env from 'lib0/environment'\nimport * as object from 'lib0/object'\n\nconst isDevMode = env.getVariable('node_env') === 'development'\n\nexport class ContentAny {\n /**\n * @param {Array} arr\n */\n constructor (arr) {\n /**\n * @type {Array}\n */\n this.arr = arr\n isDevMode && object.deepFreeze(arr)\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return this.arr.length\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return this.arr\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentAny}\n */\n copy () {\n return new ContentAny(this.arr)\n }\n\n /**\n * @param {number} offset\n * @return {ContentAny}\n */\n splice (offset) {\n const right = new ContentAny(this.arr.slice(offset))\n this.arr = this.arr.slice(0, offset)\n return right\n }\n\n /**\n * @param {ContentAny} right\n * @return {boolean}\n */\n mergeWith (right) {\n this.arr = this.arr.concat(right.arr)\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n const len = this.arr.length\n encoder.writeLen(len - offset)\n for (let i = offset; i < len; i++) {\n const c = this.arr[i]\n encoder.writeAny(c)\n }\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 8\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentAny}\n */\nexport const readContentAny = decoder => {\n const len = decoder.readLen()\n const cs = []\n for (let i = 0; i < len; i++) {\n cs.push(decoder.readAny())\n }\n return new ContentAny(cs)\n}\n", "import {\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Transaction, Item, StructStore // eslint-disable-line\n} from '../internals.js'\n\n/**\n * @private\n */\nexport class ContentString {\n /**\n * @param {string} str\n */\n constructor (str) {\n /**\n * @type {string}\n */\n this.str = str\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return this.str.length\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return this.str.split('')\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentString}\n */\n copy () {\n return new ContentString(this.str)\n }\n\n /**\n * @param {number} offset\n * @return {ContentString}\n */\n splice (offset) {\n const right = new ContentString(this.str.slice(offset))\n this.str = this.str.slice(0, offset)\n\n // Prevent encoding invalid documents because of splitting of surrogate pairs: https://github.com/yjs/yjs/issues/248\n const firstCharCode = this.str.charCodeAt(offset - 1)\n if (firstCharCode >= 0xD800 && firstCharCode <= 0xDBFF) {\n // Last character of the left split is the start of a surrogate utf16/ucs2 pair.\n // We don't support splitting of surrogate pairs because this may lead to invalid documents.\n // Replace the invalid character with a unicode replacement character (� / U+FFFD)\n this.str = this.str.slice(0, offset - 1) + '�'\n // replace right as well\n right.str = '�' + right.str.slice(1)\n }\n return right\n }\n\n /**\n * @param {ContentString} right\n * @return {boolean}\n */\n mergeWith (right) {\n this.str += right.str\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeString(offset === 0 ? this.str : this.str.slice(offset))\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 4\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentString}\n */\nexport const readContentString = decoder => new ContentString(decoder.readString())\n", "import {\n readYArray,\n readYMap,\n readYText,\n readYXmlElement,\n readYXmlFragment,\n readYXmlHook,\n readYXmlText,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Transaction, Item, YEvent, AbstractType // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\n/**\n * @type {Array>}\n * @private\n */\nexport const typeRefs = [\n readYArray,\n readYMap,\n readYText,\n readYXmlElement,\n readYXmlFragment,\n readYXmlHook,\n readYXmlText\n]\n\nexport const YArrayRefID = 0\nexport const YMapRefID = 1\nexport const YTextRefID = 2\nexport const YXmlElementRefID = 3\nexport const YXmlFragmentRefID = 4\nexport const YXmlHookRefID = 5\nexport const YXmlTextRefID = 6\n\n/**\n * @private\n */\nexport class ContentType {\n /**\n * @param {AbstractType} type\n */\n constructor (type) {\n /**\n * @type {AbstractType}\n */\n this.type = type\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return [this.type]\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentType}\n */\n copy () {\n return new ContentType(this.type._copy())\n }\n\n /**\n * @param {number} offset\n * @return {ContentType}\n */\n splice (offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentType} right\n * @return {boolean}\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {\n this.type._integrate(transaction.doc, item)\n }\n\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {\n let item = this.type._start\n while (item !== null) {\n if (!item.deleted) {\n item.delete(transaction)\n } else if (item.id.clock < (transaction.beforeState.get(item.id.client) || 0)) {\n // This will be gc'd later and we want to merge it if possible\n // We try to merge all deleted items after each transaction,\n // but we have no knowledge about that this needs to be merged\n // since it is not in transaction.ds. Hence we add it to transaction._mergeStructs\n transaction._mergeStructs.push(item)\n }\n item = item.right\n }\n this.type._map.forEach(item => {\n if (!item.deleted) {\n item.delete(transaction)\n } else if (item.id.clock < (transaction.beforeState.get(item.id.client) || 0)) {\n // same as above\n transaction._mergeStructs.push(item)\n }\n })\n transaction.changed.delete(this.type)\n }\n\n /**\n * @param {StructStore} store\n */\n gc (store) {\n let item = this.type._start\n while (item !== null) {\n item.gc(store, true)\n item = item.right\n }\n this.type._start = null\n this.type._map.forEach(/** @param {Item | null} item */ (item) => {\n while (item !== null) {\n item.gc(store, true)\n item = item.left\n }\n })\n this.type._map = new Map()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n this.type._write(encoder)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 7\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentType}\n */\nexport const readContentType = decoder => new ContentType(typeRefs[decoder.readTypeRef()](decoder))\n", "import {\n GC,\n getState,\n AbstractStruct,\n replaceStruct,\n addStruct,\n addToDeleteSet,\n findRootTypeKey,\n compareIDs,\n getItem,\n getItemCleanEnd,\n getItemCleanStart,\n readContentDeleted,\n readContentBinary,\n readContentJSON,\n readContentAny,\n readContentString,\n readContentEmbed,\n readContentDoc,\n createID,\n readContentFormat,\n readContentType,\n addChangedTypeToTransaction,\n isDeleted,\n StackItem, DeleteSet, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, ContentType, ContentDeleted, StructStore, ID, AbstractType, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\nimport * as binary from 'lib0/binary'\nimport * as array from 'lib0/array'\n\n/**\n * @todo This should return several items\n *\n * @param {StructStore} store\n * @param {ID} id\n * @return {{item:Item, diff:number}}\n */\nexport const followRedone = (store, id) => {\n /**\n * @type {ID|null}\n */\n let nextID = id\n let diff = 0\n let item\n do {\n if (diff > 0) {\n nextID = createID(nextID.client, nextID.clock + diff)\n }\n item = getItem(store, nextID)\n diff = nextID.clock - item.id.clock\n nextID = item.redone\n } while (nextID !== null && item instanceof Item)\n return {\n item, diff\n }\n}\n\n/**\n * Make sure that neither item nor any of its parents is ever deleted.\n *\n * This property does not persist when storing it into a database or when\n * sending it to other peers\n *\n * @param {Item|null} item\n * @param {boolean} keep\n */\nexport const keepItem = (item, keep) => {\n while (item !== null && item.keep !== keep) {\n item.keep = keep\n item = /** @type {AbstractType} */ (item.parent)._item\n }\n}\n\n/**\n * Split leftItem into two items\n * @param {Transaction} transaction\n * @param {Item} leftItem\n * @param {number} diff\n * @return {Item}\n *\n * @function\n * @private\n */\nexport const splitItem = (transaction, leftItem, diff) => {\n // create rightItem\n const { client, clock } = leftItem.id\n const rightItem = new Item(\n createID(client, clock + diff),\n leftItem,\n createID(client, clock + diff - 1),\n leftItem.right,\n leftItem.rightOrigin,\n leftItem.parent,\n leftItem.parentSub,\n leftItem.content.splice(diff)\n )\n if (leftItem.deleted) {\n rightItem.markDeleted()\n }\n if (leftItem.keep) {\n rightItem.keep = true\n }\n if (leftItem.redone !== null) {\n rightItem.redone = createID(leftItem.redone.client, leftItem.redone.clock + diff)\n }\n // update left (do not set leftItem.rightOrigin as it will lead to problems when syncing)\n leftItem.right = rightItem\n // update right\n if (rightItem.right !== null) {\n rightItem.right.left = rightItem\n }\n // right is more specific.\n transaction._mergeStructs.push(rightItem)\n // update parent._map\n if (rightItem.parentSub !== null && rightItem.right === null) {\n /** @type {AbstractType} */ (rightItem.parent)._map.set(rightItem.parentSub, rightItem)\n }\n leftItem.length = diff\n return rightItem\n}\n\n/**\n * @param {Array} stack\n * @param {ID} id\n */\nconst isDeletedByUndoStack = (stack, id) => array.some(stack, /** @param {StackItem} s */ s => isDeleted(s.deletions, id))\n\n/**\n * Redoes the effect of this operation.\n *\n * @param {Transaction} transaction The Yjs instance.\n * @param {Item} item\n * @param {Set} redoitems\n * @param {DeleteSet} itemsToDelete\n * @param {boolean} ignoreRemoteMapChanges\n * @param {import('../utils/UndoManager.js').UndoManager} um\n *\n * @return {Item|null}\n *\n * @private\n */\nexport const redoItem = (transaction, item, redoitems, itemsToDelete, ignoreRemoteMapChanges, um) => {\n const doc = transaction.doc\n const store = doc.store\n const ownClientID = doc.clientID\n const redone = item.redone\n if (redone !== null) {\n return getItemCleanStart(transaction, redone)\n }\n let parentItem = /** @type {AbstractType} */ (item.parent)._item\n /**\n * @type {Item|null}\n */\n let left = null\n /**\n * @type {Item|null}\n */\n let right\n // make sure that parent is redone\n if (parentItem !== null && parentItem.deleted === true) {\n // try to undo parent if it will be undone anyway\n if (parentItem.redone === null && (!redoitems.has(parentItem) || redoItem(transaction, parentItem, redoitems, itemsToDelete, ignoreRemoteMapChanges, um) === null)) {\n return null\n }\n while (parentItem.redone !== null) {\n parentItem = getItemCleanStart(transaction, parentItem.redone)\n }\n }\n const parentType = parentItem === null ? /** @type {AbstractType} */ (item.parent) : /** @type {ContentType} */ (parentItem.content).type\n\n if (item.parentSub === null) {\n // Is an array item. Insert at the old position\n left = item.left\n right = item\n // find next cloned_redo items\n while (left !== null) {\n /**\n * @type {Item|null}\n */\n let leftTrace = left\n // trace redone until parent matches\n while (leftTrace !== null && /** @type {AbstractType} */ (leftTrace.parent)._item !== parentItem) {\n leftTrace = leftTrace.redone === null ? null : getItemCleanStart(transaction, leftTrace.redone)\n }\n if (leftTrace !== null && /** @type {AbstractType} */ (leftTrace.parent)._item === parentItem) {\n left = leftTrace\n break\n }\n left = left.left\n }\n while (right !== null) {\n /**\n * @type {Item|null}\n */\n let rightTrace = right\n // trace redone until parent matches\n while (rightTrace !== null && /** @type {AbstractType} */ (rightTrace.parent)._item !== parentItem) {\n rightTrace = rightTrace.redone === null ? null : getItemCleanStart(transaction, rightTrace.redone)\n }\n if (rightTrace !== null && /** @type {AbstractType} */ (rightTrace.parent)._item === parentItem) {\n right = rightTrace\n break\n }\n right = right.right\n }\n } else {\n right = null\n if (item.right && !ignoreRemoteMapChanges) {\n left = item\n // Iterate right while right is in itemsToDelete\n // If it is intended to delete right while item is redone, we can expect that item should replace right.\n while (left !== null && left.right !== null && (left.right.redone || isDeleted(itemsToDelete, left.right.id) || isDeletedByUndoStack(um.undoStack, left.right.id) || isDeletedByUndoStack(um.redoStack, left.right.id))) {\n left = left.right\n // follow redone\n while (left.redone) left = getItemCleanStart(transaction, left.redone)\n }\n if (left && left.right !== null) {\n // It is not possible to redo this item because it conflicts with a\n // change from another client\n return null\n }\n } else {\n left = parentType._map.get(item.parentSub) || null\n }\n }\n const nextClock = getState(store, ownClientID)\n const nextId = createID(ownClientID, nextClock)\n const redoneItem = new Item(\n nextId,\n left, left && left.lastId,\n right, right && right.id,\n parentType,\n item.parentSub,\n item.content.copy()\n )\n item.redone = nextId\n keepItem(redoneItem, true)\n redoneItem.integrate(transaction, 0)\n return redoneItem\n}\n\n/**\n * Abstract class that represents any content.\n */\nexport class Item extends AbstractStruct {\n /**\n * @param {ID} id\n * @param {Item | null} left\n * @param {ID | null} origin\n * @param {Item | null} right\n * @param {ID | null} rightOrigin\n * @param {AbstractType|ID|null} parent Is a type if integrated, is null if it is possible to copy parent from left or right, is ID before integration to search for it.\n * @param {string | null} parentSub\n * @param {AbstractContent} content\n */\n constructor (id, left, origin, right, rightOrigin, parent, parentSub, content) {\n super(id, content.getLength())\n /**\n * The item that was originally to the left of this item.\n * @type {ID | null}\n */\n this.origin = origin\n /**\n * The item that is currently to the left of this item.\n * @type {Item | null}\n */\n this.left = left\n /**\n * The item that is currently to the right of this item.\n * @type {Item | null}\n */\n this.right = right\n /**\n * The item that was originally to the right of this item.\n * @type {ID | null}\n */\n this.rightOrigin = rightOrigin\n /**\n * @type {AbstractType|ID|null}\n */\n this.parent = parent\n /**\n * If the parent refers to this item with some kind of key (e.g. YMap, the\n * key is specified here. The key is then used to refer to the list in which\n * to insert this item. If `parentSub = null` type._start is the list in\n * which to insert to. Otherwise it is `parent._map`.\n * @type {String | null}\n */\n this.parentSub = parentSub\n /**\n * If this type's effect is redone this type refers to the type that undid\n * this operation.\n * @type {ID | null}\n */\n this.redone = null\n /**\n * @type {AbstractContent}\n */\n this.content = content\n /**\n * bit1: keep\n * bit2: countable\n * bit3: deleted\n * bit4: mark - mark node as fast-search-marker\n * @type {number} byte\n */\n this.info = this.content.isCountable() ? binary.BIT2 : 0\n }\n\n /**\n * This is used to mark the item as an indexed fast-search marker\n *\n * @type {boolean}\n */\n set marker (isMarked) {\n if (((this.info & binary.BIT4) > 0) !== isMarked) {\n this.info ^= binary.BIT4\n }\n }\n\n get marker () {\n return (this.info & binary.BIT4) > 0\n }\n\n /**\n * If true, do not garbage collect this Item.\n */\n get keep () {\n return (this.info & binary.BIT1) > 0\n }\n\n set keep (doKeep) {\n if (this.keep !== doKeep) {\n this.info ^= binary.BIT1\n }\n }\n\n get countable () {\n return (this.info & binary.BIT2) > 0\n }\n\n /**\n * Whether this item was deleted or not.\n * @type {Boolean}\n */\n get deleted () {\n return (this.info & binary.BIT3) > 0\n }\n\n set deleted (doDelete) {\n if (this.deleted !== doDelete) {\n this.info ^= binary.BIT3\n }\n }\n\n markDeleted () {\n this.info |= binary.BIT3\n }\n\n /**\n * Return the creator clientID of the missing op or define missing items and return null.\n *\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @return {null | number}\n */\n getMissing (transaction, store) {\n if (this.origin && this.origin.client !== this.id.client && this.origin.clock >= getState(store, this.origin.client)) {\n return this.origin.client\n }\n if (this.rightOrigin && this.rightOrigin.client !== this.id.client && this.rightOrigin.clock >= getState(store, this.rightOrigin.client)) {\n return this.rightOrigin.client\n }\n if (this.parent && this.parent.constructor === ID && this.id.client !== this.parent.client && this.parent.clock >= getState(store, this.parent.client)) {\n return this.parent.client\n }\n\n // We have all missing ids, now find the items\n\n if (this.origin) {\n this.left = getItemCleanEnd(transaction, store, this.origin)\n this.origin = this.left.lastId\n }\n if (this.rightOrigin) {\n this.right = getItemCleanStart(transaction, this.rightOrigin)\n this.rightOrigin = this.right.id\n }\n if ((this.left && this.left.constructor === GC) || (this.right && this.right.constructor === GC)) {\n this.parent = null\n } else if (!this.parent) {\n // only set parent if this shouldn't be garbage collected\n if (this.left && this.left.constructor === Item) {\n this.parent = this.left.parent\n this.parentSub = this.left.parentSub\n }\n if (this.right && this.right.constructor === Item) {\n this.parent = this.right.parent\n this.parentSub = this.right.parentSub\n }\n } else if (this.parent.constructor === ID) {\n const parentItem = getItem(store, this.parent)\n if (parentItem.constructor === GC) {\n this.parent = null\n } else {\n this.parent = /** @type {ContentType} */ (parentItem.content).type\n }\n }\n return null\n }\n\n /**\n * @param {Transaction} transaction\n * @param {number} offset\n */\n integrate (transaction, offset) {\n if (offset > 0) {\n this.id.clock += offset\n this.left = getItemCleanEnd(transaction, transaction.doc.store, createID(this.id.client, this.id.clock - 1))\n this.origin = this.left.lastId\n this.content = this.content.splice(offset)\n this.length -= offset\n }\n\n if (this.parent) {\n if ((!this.left && (!this.right || this.right.left !== null)) || (this.left && this.left.right !== this.right)) {\n /**\n * @type {Item|null}\n */\n let left = this.left\n\n /**\n * @type {Item|null}\n */\n let o\n // set o to the first conflicting item\n if (left !== null) {\n o = left.right\n } else if (this.parentSub !== null) {\n o = /** @type {AbstractType} */ (this.parent)._map.get(this.parentSub) || null\n while (o !== null && o.left !== null) {\n o = o.left\n }\n } else {\n o = /** @type {AbstractType} */ (this.parent)._start\n }\n // TODO: use something like DeleteSet here (a tree implementation would be best)\n // @todo use global set definitions\n /**\n * @type {Set}\n */\n const conflictingItems = new Set()\n /**\n * @type {Set}\n */\n const itemsBeforeOrigin = new Set()\n // Let c in conflictingItems, b in itemsBeforeOrigin\n // ***{origin}bbbb{this}{c,b}{c,b}{o}***\n // Note that conflictingItems is a subset of itemsBeforeOrigin\n while (o !== null && o !== this.right) {\n itemsBeforeOrigin.add(o)\n conflictingItems.add(o)\n if (compareIDs(this.origin, o.origin)) {\n // case 1\n if (o.id.client < this.id.client) {\n left = o\n conflictingItems.clear()\n } else if (compareIDs(this.rightOrigin, o.rightOrigin)) {\n // this and o are conflicting and point to the same integration points. The id decides which item comes first.\n // Since this is to the left of o, we can break here\n break\n } // else, o might be integrated before an item that this conflicts with. If so, we will find it in the next iterations\n } else if (o.origin !== null && itemsBeforeOrigin.has(getItem(transaction.doc.store, o.origin))) { // use getItem instead of getItemCleanEnd because we don't want / need to split items.\n // case 2\n if (!conflictingItems.has(getItem(transaction.doc.store, o.origin))) {\n left = o\n conflictingItems.clear()\n }\n } else {\n break\n }\n o = o.right\n }\n this.left = left\n }\n // reconnect left/right + update parent map/start if necessary\n if (this.left !== null) {\n const right = this.left.right\n this.right = right\n this.left.right = this\n } else {\n let r\n if (this.parentSub !== null) {\n r = /** @type {AbstractType} */ (this.parent)._map.get(this.parentSub) || null\n while (r !== null && r.left !== null) {\n r = r.left\n }\n } else {\n r = /** @type {AbstractType} */ (this.parent)._start\n ;/** @type {AbstractType} */ (this.parent)._start = this\n }\n this.right = r\n }\n if (this.right !== null) {\n this.right.left = this\n } else if (this.parentSub !== null) {\n // set as current parent value if right === null and this is parentSub\n /** @type {AbstractType} */ (this.parent)._map.set(this.parentSub, this)\n if (this.left !== null) {\n // this is the current attribute value of parent. delete right\n this.left.delete(transaction)\n }\n }\n // adjust length of parent\n if (this.parentSub === null && this.countable && !this.deleted) {\n /** @type {AbstractType} */ (this.parent)._length += this.length\n }\n addStruct(transaction.doc.store, this)\n this.content.integrate(transaction, this)\n // add parent to transaction.changed\n addChangedTypeToTransaction(transaction, /** @type {AbstractType} */ (this.parent), this.parentSub)\n if ((/** @type {AbstractType} */ (this.parent)._item !== null && /** @type {AbstractType} */ (this.parent)._item.deleted) || (this.parentSub !== null && this.right !== null)) {\n // delete if parent is deleted or if this is not the current attribute value of parent\n this.delete(transaction)\n }\n } else {\n // parent is not defined. Integrate GC struct instead\n new GC(this.id, this.length).integrate(transaction, 0)\n }\n }\n\n /**\n * Returns the next non-deleted item\n */\n get next () {\n let n = this.right\n while (n !== null && n.deleted) {\n n = n.right\n }\n return n\n }\n\n /**\n * Returns the previous non-deleted item\n */\n get prev () {\n let n = this.left\n while (n !== null && n.deleted) {\n n = n.left\n }\n return n\n }\n\n /**\n * Computes the last content address of this Item.\n */\n get lastId () {\n // allocating ids is pretty costly because of the amount of ids created, so we try to reuse whenever possible\n return this.length === 1 ? this.id : createID(this.id.client, this.id.clock + this.length - 1)\n }\n\n /**\n * Try to merge two items\n *\n * @param {Item} right\n * @return {boolean}\n */\n mergeWith (right) {\n if (\n this.constructor === right.constructor &&\n compareIDs(right.origin, this.lastId) &&\n this.right === right &&\n compareIDs(this.rightOrigin, right.rightOrigin) &&\n this.id.client === right.id.client &&\n this.id.clock + this.length === right.id.clock &&\n this.deleted === right.deleted &&\n this.redone === null &&\n right.redone === null &&\n this.content.constructor === right.content.constructor &&\n this.content.mergeWith(right.content)\n ) {\n const searchMarker = /** @type {AbstractType} */ (this.parent)._searchMarker\n if (searchMarker) {\n searchMarker.forEach(marker => {\n if (marker.p === right) {\n // right is going to be \"forgotten\" so we need to update the marker\n marker.p = this\n // adjust marker index\n if (!this.deleted && this.countable) {\n marker.index -= this.length\n }\n }\n })\n }\n if (right.keep) {\n this.keep = true\n }\n this.right = right.right\n if (this.right !== null) {\n this.right.left = this\n }\n this.length += right.length\n return true\n }\n return false\n }\n\n /**\n * Mark this Item as deleted.\n *\n * @param {Transaction} transaction\n */\n delete (transaction) {\n if (!this.deleted) {\n const parent = /** @type {AbstractType} */ (this.parent)\n // adjust the length of parent\n if (this.countable && this.parentSub === null) {\n parent._length -= this.length\n }\n this.markDeleted()\n addToDeleteSet(transaction.deleteSet, this.id.client, this.id.clock, this.length)\n addChangedTypeToTransaction(transaction, parent, this.parentSub)\n this.content.delete(transaction)\n }\n }\n\n /**\n * @param {StructStore} store\n * @param {boolean} parentGCd\n */\n gc (store, parentGCd) {\n if (!this.deleted) {\n throw error.unexpectedCase()\n }\n this.content.gc(store)\n if (parentGCd) {\n replaceStruct(store, this, new GC(this.id, this.length))\n } else {\n this.content = new ContentDeleted(this.length)\n }\n }\n\n /**\n * Transform the properties of this type to binary and write it to an\n * BinaryEncoder.\n *\n * This is called when this Item is sent to a remote peer.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n * @param {number} offset\n */\n write (encoder, offset) {\n const origin = offset > 0 ? createID(this.id.client, this.id.clock + offset - 1) : this.origin\n const rightOrigin = this.rightOrigin\n const parentSub = this.parentSub\n const info = (this.content.getRef() & binary.BITS5) |\n (origin === null ? 0 : binary.BIT8) | // origin is defined\n (rightOrigin === null ? 0 : binary.BIT7) | // right origin is defined\n (parentSub === null ? 0 : binary.BIT6) // parentSub is non-null\n encoder.writeInfo(info)\n if (origin !== null) {\n encoder.writeLeftID(origin)\n }\n if (rightOrigin !== null) {\n encoder.writeRightID(rightOrigin)\n }\n if (origin === null && rightOrigin === null) {\n const parent = /** @type {AbstractType} */ (this.parent)\n if (parent._item !== undefined) {\n const parentItem = parent._item\n if (parentItem === null) {\n // parent type on y._map\n // find the correct key\n const ykey = findRootTypeKey(parent)\n encoder.writeParentInfo(true) // write parentYKey\n encoder.writeString(ykey)\n } else {\n encoder.writeParentInfo(false) // write parent id\n encoder.writeLeftID(parentItem.id)\n }\n } else if (parent.constructor === String) { // this edge case was added by differential updates\n encoder.writeParentInfo(true) // write parentYKey\n encoder.writeString(parent)\n } else if (parent.constructor === ID) {\n encoder.writeParentInfo(false) // write parent id\n encoder.writeLeftID(parent)\n } else {\n error.unexpectedCase()\n }\n if (parentSub !== null) {\n encoder.writeString(parentSub)\n }\n }\n this.content.write(encoder, offset)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @param {number} info\n */\nexport const readItemContent = (decoder, info) => contentRefs[info & binary.BITS5](decoder)\n\n/**\n * A lookup map for reading Item content.\n *\n * @type {Array}\n */\nexport const contentRefs = [\n () => { error.unexpectedCase() }, // GC is not ItemContent\n readContentDeleted, // 1\n readContentJSON, // 2\n readContentBinary, // 3\n readContentString, // 4\n readContentEmbed, // 5\n readContentFormat, // 6\n readContentType, // 7\n readContentAny, // 8\n readContentDoc, // 9\n () => { error.unexpectedCase() } // 10 - Skip is not ItemContent\n]\n\n/**\n * Do not implement this class!\n */\nexport class AbstractContent {\n /**\n * @return {number}\n */\n getLength () {\n throw error.methodUnimplemented()\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n throw error.methodUnimplemented()\n }\n\n /**\n * Should return false if this Item is some kind of meta information\n * (e.g. format information).\n *\n * * Whether this Item should be addressable via `yarray.get(i)`\n * * Whether this Item should be counted when computing yarray.length\n *\n * @return {boolean}\n */\n isCountable () {\n throw error.methodUnimplemented()\n }\n\n /**\n * @return {AbstractContent}\n */\n copy () {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {number} _offset\n * @return {AbstractContent}\n */\n splice (_offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {AbstractContent} _right\n * @return {boolean}\n */\n mergeWith (_right) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {Transaction} _transaction\n * @param {Item} _item\n */\n integrate (_transaction, _item) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {Transaction} _transaction\n */\n delete (_transaction) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {StructStore} _store\n */\n gc (_store) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} _encoder\n * @param {number} _offset\n */\n write (_encoder, _offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @return {number}\n */\n getRef () {\n throw error.methodUnimplemented()\n }\n}\n", "import {\n AbstractStruct,\n UpdateEncoderV1, UpdateEncoderV2, StructStore, Transaction, ID // eslint-disable-line\n} from '../internals.js'\nimport * as error from 'lib0/error'\nimport * as encoding from 'lib0/encoding'\n\nexport const structSkipRefNumber = 10\n\n/**\n * @private\n */\nexport class Skip extends AbstractStruct {\n get deleted () {\n return true\n }\n\n delete () {}\n\n /**\n * @param {Skip} right\n * @return {boolean}\n */\n mergeWith (right) {\n if (this.constructor !== right.constructor) {\n return false\n }\n this.length += right.length\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {number} offset\n */\n integrate (transaction, offset) {\n // skip structs cannot be integrated\n error.unexpectedCase()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeInfo(structSkipRefNumber)\n // write as VarUint because Skips can't make use of predictable length-encoding\n encoding.writeVarUint(encoder.restEncoder, this.length - offset)\n }\n\n /**\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @return {null | number}\n */\n getMissing (transaction, store) {\n return null\n }\n}\n", "/** eslint-env browser */\n\nexport {\n Doc,\n Transaction,\n YArray as Array,\n YMap as Map,\n YText as Text,\n YXmlText as XmlText,\n YXmlHook as XmlHook,\n YXmlElement as XmlElement,\n YXmlFragment as XmlFragment,\n YXmlEvent,\n YMapEvent,\n YArrayEvent,\n YTextEvent,\n YEvent,\n Item,\n AbstractStruct,\n GC,\n Skip,\n ContentBinary,\n ContentDeleted,\n ContentDoc,\n ContentEmbed,\n ContentFormat,\n ContentJSON,\n ContentAny,\n ContentString,\n ContentType,\n AbstractType,\n getTypeChildren,\n createRelativePositionFromTypeIndex,\n createRelativePositionFromJSON,\n createAbsolutePositionFromRelativePosition,\n compareRelativePositions,\n AbsolutePosition,\n RelativePosition,\n ID,\n createID,\n compareIDs,\n getState,\n Snapshot,\n createSnapshot,\n createDeleteSet,\n createDeleteSetFromStructStore,\n cleanupYTextFormatting,\n snapshot,\n emptySnapshot,\n findRootTypeKey,\n findIndexSS,\n getItem,\n typeListToArraySnapshot,\n typeMapGetSnapshot,\n typeMapGetAllSnapshot,\n createDocFromSnapshot,\n iterateDeletedStructs,\n applyUpdate,\n applyUpdateV2,\n readUpdate,\n readUpdateV2,\n encodeStateAsUpdate,\n encodeStateAsUpdateV2,\n encodeStateVector,\n UndoManager,\n decodeSnapshot,\n encodeSnapshot,\n decodeSnapshotV2,\n encodeSnapshotV2,\n decodeStateVector,\n logUpdate,\n logUpdateV2,\n decodeUpdate,\n decodeUpdateV2,\n relativePositionToJSON,\n isDeleted,\n isParentOf,\n equalSnapshots,\n PermanentUserData, // @TODO experimental\n tryGc,\n transact,\n AbstractConnector,\n logType,\n mergeUpdates,\n mergeUpdatesV2,\n parseUpdateMeta,\n parseUpdateMetaV2,\n encodeStateVectorFromUpdate,\n encodeStateVectorFromUpdateV2,\n encodeRelativePosition,\n decodeRelativePosition,\n diffUpdate,\n diffUpdateV2,\n convertUpdateFormatV1ToV2,\n convertUpdateFormatV2ToV1,\n obfuscateUpdate,\n obfuscateUpdateV2,\n UpdateEncoderV1,\n UpdateEncoderV2,\n UpdateDecoderV1,\n UpdateDecoderV2,\n equalDeleteSets,\n mergeDeleteSets,\n snapshotContainsUpdate\n} from './internals.js'\n\nconst glo = /** @type {any} */ (typeof globalThis !== 'undefined'\n ? globalThis\n : typeof window !== 'undefined'\n ? window\n // @ts-ignore\n : typeof global !== 'undefined' ? global : {})\n\nconst importIdentifier = '__ $YJS$ __'\n\nif (glo[importIdentifier] === true) {\n /**\n * Dear reader of this message. Please take this seriously.\n *\n * If you see this message, make sure that you only import one version of Yjs. In many cases,\n * your package manager installs two versions of Yjs that are used by different packages within your project.\n * Another reason for this message is that some parts of your project use the commonjs version of Yjs\n * and others use the EcmaScript version of Yjs.\n *\n * This often leads to issues that are hard to debug. We often need to perform constructor checks,\n * e.g. `struct instanceof GC`. If you imported different versions of Yjs, it is impossible for us to\n * do the constructor checks anymore - which might break the CRDT algorithm.\n *\n * https://github.com/yjs/yjs/issues/438\n */\n console.error('Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438')\n}\nglo[importIdentifier] = true\n", "/**\n * @module awareness-protocol\n */\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as time from 'lib0/time'\nimport * as math from 'lib0/math'\nimport { Observable } from 'lib0/observable'\nimport * as f from 'lib0/function'\nimport * as Y from 'yjs' // eslint-disable-line\n\nexport const outdatedTimeout = 30000\n\n/**\n * @typedef {Object} MetaClientState\n * @property {number} MetaClientState.clock\n * @property {number} MetaClientState.lastUpdated unix timestamp\n */\n\n/**\n * The Awareness class implements a simple shared state protocol that can be used for non-persistent data like awareness information\n * (cursor, username, status, ..). Each client can update its own local state and listen to state changes of\n * remote clients. Every client may set a state of a remote peer to `null` to mark the client as offline.\n *\n * Each client is identified by a unique client id (something we borrow from `doc.clientID`). A client can override\n * its own state by propagating a message with an increasing timestamp (`clock`). If such a message is received, it is\n * applied if the known state of that client is older than the new state (`clock < newClock`). If a client thinks that\n * a remote client is offline, it may propagate a message with\n * `{ clock: currentClientClock, state: null, client: remoteClient }`. If such a\n * message is received, and the known clock of that client equals the received clock, it will override the state with `null`.\n *\n * Before a client disconnects, it should propagate a `null` state with an updated clock.\n *\n * Awareness states must be updated every 30 seconds. Otherwise the Awareness instance will delete the client state.\n *\n * @extends {Observable}\n */\nexport class Awareness extends Observable {\n /**\n * @param {Y.Doc} doc\n */\n constructor (doc) {\n super()\n this.doc = doc\n /**\n * @type {number}\n */\n this.clientID = doc.clientID\n /**\n * Maps from client id to client state\n * @type {Map>}\n */\n this.states = new Map()\n /**\n * @type {Map}\n */\n this.meta = new Map()\n this._checkInterval = /** @type {any} */ (setInterval(() => {\n const now = time.getUnixTime()\n if (this.getLocalState() !== null && (outdatedTimeout / 2 <= now - /** @type {{lastUpdated:number}} */ (this.meta.get(this.clientID)).lastUpdated)) {\n // renew local clock\n this.setLocalState(this.getLocalState())\n }\n /**\n * @type {Array}\n */\n const remove = []\n this.meta.forEach((meta, clientid) => {\n if (clientid !== this.clientID && outdatedTimeout <= now - meta.lastUpdated && this.states.has(clientid)) {\n remove.push(clientid)\n }\n })\n if (remove.length > 0) {\n removeAwarenessStates(this, remove, 'timeout')\n }\n }, math.floor(outdatedTimeout / 10)))\n doc.on('destroy', () => {\n this.destroy()\n })\n this.setLocalState({})\n }\n\n destroy () {\n this.emit('destroy', [this])\n this.setLocalState(null)\n super.destroy()\n clearInterval(this._checkInterval)\n }\n\n /**\n * @return {Object|null}\n */\n getLocalState () {\n return this.states.get(this.clientID) || null\n }\n\n /**\n * @param {Object|null} state\n */\n setLocalState (state) {\n const clientID = this.clientID\n const currLocalMeta = this.meta.get(clientID)\n const clock = currLocalMeta === undefined ? 0 : currLocalMeta.clock + 1\n const prevState = this.states.get(clientID)\n if (state === null) {\n this.states.delete(clientID)\n } else {\n this.states.set(clientID, state)\n }\n this.meta.set(clientID, {\n clock,\n lastUpdated: time.getUnixTime()\n })\n const added = []\n const updated = []\n const filteredUpdated = []\n const removed = []\n if (state === null) {\n removed.push(clientID)\n } else if (prevState == null) {\n if (state != null) {\n added.push(clientID)\n }\n } else {\n updated.push(clientID)\n if (!f.equalityDeep(prevState, state)) {\n filteredUpdated.push(clientID)\n }\n }\n if (added.length > 0 || filteredUpdated.length > 0 || removed.length > 0) {\n this.emit('change', [{ added, updated: filteredUpdated, removed }, 'local'])\n }\n this.emit('update', [{ added, updated, removed }, 'local'])\n }\n\n /**\n * @param {string} field\n * @param {any} value\n */\n setLocalStateField (field, value) {\n const state = this.getLocalState()\n if (state !== null) {\n this.setLocalState({\n ...state,\n [field]: value\n })\n }\n }\n\n /**\n * @return {Map>}\n */\n getStates () {\n return this.states\n }\n}\n\n/**\n * Mark (remote) clients as inactive and remove them from the list of active peers.\n * This change will be propagated to remote clients.\n *\n * @param {Awareness} awareness\n * @param {Array} clients\n * @param {any} origin\n */\nexport const removeAwarenessStates = (awareness, clients, origin) => {\n const removed = []\n for (let i = 0; i < clients.length; i++) {\n const clientID = clients[i]\n if (awareness.states.has(clientID)) {\n awareness.states.delete(clientID)\n if (clientID === awareness.clientID) {\n const curMeta = /** @type {MetaClientState} */ (awareness.meta.get(clientID))\n awareness.meta.set(clientID, {\n clock: curMeta.clock + 1,\n lastUpdated: time.getUnixTime()\n })\n }\n removed.push(clientID)\n }\n }\n if (removed.length > 0) {\n awareness.emit('change', [{ added: [], updated: [], removed }, origin])\n awareness.emit('update', [{ added: [], updated: [], removed }, origin])\n }\n}\n\n/**\n * @param {Awareness} awareness\n * @param {Array} clients\n * @return {Uint8Array}\n */\nexport const encodeAwarenessUpdate = (awareness, clients, states = awareness.states) => {\n const len = clients.length\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, len)\n for (let i = 0; i < len; i++) {\n const clientID = clients[i]\n const state = states.get(clientID) || null\n const clock = /** @type {MetaClientState} */ (awareness.meta.get(clientID)).clock\n encoding.writeVarUint(encoder, clientID)\n encoding.writeVarUint(encoder, clock)\n encoding.writeVarString(encoder, JSON.stringify(state))\n }\n return encoding.toUint8Array(encoder)\n}\n\n/**\n * Modify the content of an awareness update before re-encoding it to an awareness update.\n *\n * This might be useful when you have a central server that wants to ensure that clients\n * cant hijack somebody elses identity.\n *\n * @param {Uint8Array} update\n * @param {function(any):any} modify\n * @return {Uint8Array}\n */\nexport const modifyAwarenessUpdate = (update, modify) => {\n const decoder = decoding.createDecoder(update)\n const encoder = encoding.createEncoder()\n const len = decoding.readVarUint(decoder)\n encoding.writeVarUint(encoder, len)\n for (let i = 0; i < len; i++) {\n const clientID = decoding.readVarUint(decoder)\n const clock = decoding.readVarUint(decoder)\n const state = JSON.parse(decoding.readVarString(decoder))\n const modifiedState = modify(state)\n encoding.writeVarUint(encoder, clientID)\n encoding.writeVarUint(encoder, clock)\n encoding.writeVarString(encoder, JSON.stringify(modifiedState))\n }\n return encoding.toUint8Array(encoder)\n}\n\n/**\n * @param {Awareness} awareness\n * @param {Uint8Array} update\n * @param {any} origin This will be added to the emitted change event\n */\nexport const applyAwarenessUpdate = (awareness, update, origin) => {\n const decoder = decoding.createDecoder(update)\n const timestamp = time.getUnixTime()\n const added = []\n const updated = []\n const filteredUpdated = []\n const removed = []\n const len = decoding.readVarUint(decoder)\n for (let i = 0; i < len; i++) {\n const clientID = decoding.readVarUint(decoder)\n let clock = decoding.readVarUint(decoder)\n const state = JSON.parse(decoding.readVarString(decoder))\n const clientMeta = awareness.meta.get(clientID)\n const prevState = awareness.states.get(clientID)\n const currClock = clientMeta === undefined ? 0 : clientMeta.clock\n if (currClock < clock || (currClock === clock && state === null && awareness.states.has(clientID))) {\n if (state === null) {\n // never let a remote client remove this local state\n if (clientID === awareness.clientID && awareness.getLocalState() != null) {\n // remote client removed the local state. Do not remote state. Broadcast a message indicating\n // that this client still exists by increasing the clock\n clock++\n } else {\n awareness.states.delete(clientID)\n }\n } else {\n awareness.states.set(clientID, state)\n }\n awareness.meta.set(clientID, {\n clock,\n lastUpdated: timestamp\n })\n if (clientMeta === undefined && state !== null) {\n added.push(clientID)\n } else if (clientMeta !== undefined && state === null) {\n removed.push(clientID)\n } else if (state !== null) {\n if (!f.equalityDeep(state, prevState)) {\n filteredUpdated.push(clientID)\n }\n updated.push(clientID)\n }\n }\n }\n if (added.length > 0 || filteredUpdated.length > 0 || removed.length > 0) {\n awareness.emit('change', [{\n added, updated: filteredUpdated, removed\n }, origin])\n }\n if (added.length > 0 || updated.length > 0 || removed.length > 0) {\n awareness.emit('update', [{\n added, updated, removed\n }, origin])\n }\n}\n", "/* eslint-env browser */\n\n/**\n * Helpers to work with IndexedDB.\n *\n * @module indexeddb\n */\n\nimport * as promise from './promise.js'\nimport * as error from './error.js'\n\n/* c8 ignore start */\n\n/**\n * IDB Request to Promise transformer\n *\n * @param {IDBRequest} request\n * @return {Promise}\n */\nexport const rtop = request => promise.create((resolve, reject) => {\n // @ts-ignore\n request.onerror = event => reject(new Error(event.target.error))\n // @ts-ignore\n request.onsuccess = event => resolve(event.target.result)\n})\n\n/**\n * @param {string} name\n * @param {function(IDBDatabase):any} initDB Called when the database is first created\n * @return {Promise}\n */\nexport const openDB = (name, initDB) => promise.create((resolve, reject) => {\n const request = indexedDB.open(name)\n /**\n * @param {any} event\n */\n request.onupgradeneeded = event => initDB(event.target.result)\n /**\n * @param {any} event\n */\n request.onerror = event => reject(error.create(event.target.error))\n /**\n * @param {any} event\n */\n request.onsuccess = event => {\n /**\n * @type {IDBDatabase}\n */\n const db = event.target.result\n db.onversionchange = () => { db.close() }\n resolve(db)\n }\n})\n\n/**\n * @param {string} name\n */\nexport const deleteDB = name => rtop(indexedDB.deleteDatabase(name))\n\n/**\n * @param {IDBDatabase} db\n * @param {Array|Array>} definitions\n */\nexport const createStores = (db, definitions) => definitions.forEach(d =>\n // @ts-ignore\n db.createObjectStore.apply(db, d)\n)\n\n/**\n * @param {IDBDatabase} db\n * @param {Array} stores\n * @param {\"readwrite\"|\"readonly\"} [access]\n * @return {Array}\n */\nexport const transact = (db, stores, access = 'readwrite') => {\n const transaction = db.transaction(stores, access)\n return stores.map(store => getStore(transaction, store))\n}\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange} [range]\n * @return {Promise}\n */\nexport const count = (store, range) =>\n rtop(store.count(range))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date | Array } key\n * @return {Promise>}\n */\nexport const get = (store, key) =>\n rtop(store.get(key))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date | IDBKeyRange | Array } key\n */\nexport const del = (store, key) =>\n rtop(store.delete(key))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date | boolean} item\n * @param {String | number | ArrayBuffer | Date | Array} [key]\n */\nexport const put = (store, item, key) =>\n rtop(store.put(item, key))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date | boolean} item\n * @param {String | number | ArrayBuffer | Date | Array} key\n * @return {Promise}\n */\nexport const add = (store, item, key) =>\n rtop(store.add(item, key))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date} item\n * @return {Promise} Returns the generated key\n */\nexport const addAutoKey = (store, item) =>\n rtop(store.add(item))\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange} [range]\n * @param {number} [limit]\n * @return {Promise>}\n */\nexport const getAll = (store, range, limit) =>\n rtop(store.getAll(range, limit))\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange} [range]\n * @param {number} [limit]\n * @return {Promise>}\n */\nexport const getAllKeys = (store, range, limit) =>\n rtop(store.getAllKeys(range, limit))\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange|null} query\n * @param {'next'|'prev'|'nextunique'|'prevunique'} direction\n * @return {Promise}\n */\nexport const queryFirst = (store, query, direction) => {\n /**\n * @type {any}\n */\n let first = null\n return iterateKeys(store, query, key => {\n first = key\n return false\n }, direction).then(() => first)\n}\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange?} [range]\n * @return {Promise}\n */\nexport const getLastKey = (store, range = null) => queryFirst(store, range, 'prev')\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange?} [range]\n * @return {Promise}\n */\nexport const getFirstKey = (store, range = null) => queryFirst(store, range, 'next')\n\n/**\n * @typedef KeyValuePair\n * @type {Object}\n * @property {any} k key\n * @property {any} v Value\n */\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange} [range]\n * @param {number} [limit]\n * @return {Promise>}\n */\nexport const getAllKeysValues = (store, range, limit) =>\n // @ts-ignore\n promise.all([getAllKeys(store, range, limit), getAll(store, range, limit)]).then(([ks, vs]) => ks.map((k, i) => ({ k, v: vs[i] })))\n\n/**\n * @param {any} request\n * @param {function(IDBCursorWithValue):void|boolean|Promise} f\n * @return {Promise}\n */\nconst iterateOnRequest = (request, f) => promise.create((resolve, reject) => {\n request.onerror = reject\n /**\n * @param {any} event\n */\n request.onsuccess = async event => {\n const cursor = event.target.result\n if (cursor === null || (await f(cursor)) === false) {\n return resolve()\n }\n cursor.continue()\n }\n})\n\n/**\n * Iterate on keys and values\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange|null} keyrange\n * @param {function(any,any):void|boolean|Promise} f Callback that receives (value, key)\n * @param {'next'|'prev'|'nextunique'|'prevunique'} direction\n */\nexport const iterate = (store, keyrange, f, direction = 'next') =>\n iterateOnRequest(store.openCursor(keyrange, direction), cursor => f(cursor.value, cursor.key))\n\n/**\n * Iterate on the keys (no values)\n *\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange|null} keyrange\n * @param {function(any):void|boolean|Promise} f callback that receives the key\n * @param {'next'|'prev'|'nextunique'|'prevunique'} direction\n */\nexport const iterateKeys = (store, keyrange, f, direction = 'next') =>\n iterateOnRequest(store.openKeyCursor(keyrange, direction), cursor => f(cursor.key))\n\n/**\n * Open store from transaction\n * @param {IDBTransaction} t\n * @param {String} store\n * @returns {IDBObjectStore}\n */\nexport const getStore = (t, store) => t.objectStore(store)\n\n/**\n * @param {any} lower\n * @param {any} upper\n * @param {boolean} lowerOpen\n * @param {boolean} upperOpen\n */\nexport const createIDBKeyRangeBound = (lower, upper, lowerOpen, upperOpen) => IDBKeyRange.bound(lower, upper, lowerOpen, upperOpen)\n\n/**\n * @param {any} upper\n * @param {boolean} upperOpen\n */\nexport const createIDBKeyRangeUpperBound = (upper, upperOpen) => IDBKeyRange.upperBound(upper, upperOpen)\n\n/**\n * @param {any} lower\n * @param {boolean} lowerOpen\n */\nexport const createIDBKeyRangeLowerBound = (lower, lowerOpen) => IDBKeyRange.lowerBound(lower, lowerOpen)\n\n/* c8 ignore stop */\n", "import * as Y from 'yjs'\nimport * as idb from 'lib0/indexeddb'\nimport * as promise from 'lib0/promise'\nimport { Observable } from 'lib0/observable'\n\nconst customStoreName = 'custom'\nconst updatesStoreName = 'updates'\n\nexport const PREFERRED_TRIM_SIZE = 500\n\n/**\n * @param {IndexeddbPersistence} idbPersistence\n * @param {function(IDBObjectStore):void} [beforeApplyUpdatesCallback]\n * @param {function(IDBObjectStore):void} [afterApplyUpdatesCallback]\n */\nexport const fetchUpdates = (idbPersistence, beforeApplyUpdatesCallback = () => {}, afterApplyUpdatesCallback = () => {}) => {\n const [updatesStore] = idb.transact(/** @type {IDBDatabase} */ (idbPersistence.db), [updatesStoreName]) // , 'readonly')\n return idb.getAll(updatesStore, idb.createIDBKeyRangeLowerBound(idbPersistence._dbref, false)).then(updates => {\n if (!idbPersistence._destroyed) {\n beforeApplyUpdatesCallback(updatesStore)\n Y.transact(idbPersistence.doc, () => {\n updates.forEach(val => Y.applyUpdate(idbPersistence.doc, val))\n }, idbPersistence, false)\n afterApplyUpdatesCallback(updatesStore)\n }\n })\n .then(() => idb.getLastKey(updatesStore).then(lastKey => { idbPersistence._dbref = lastKey + 1 }))\n .then(() => idb.count(updatesStore).then(cnt => { idbPersistence._dbsize = cnt }))\n .then(() => updatesStore)\n}\n\n/**\n * @param {IndexeddbPersistence} idbPersistence\n * @param {boolean} forceStore\n */\nexport const storeState = (idbPersistence, forceStore = true) =>\n fetchUpdates(idbPersistence)\n .then(updatesStore => {\n if (forceStore || idbPersistence._dbsize >= PREFERRED_TRIM_SIZE) {\n idb.addAutoKey(updatesStore, Y.encodeStateAsUpdate(idbPersistence.doc))\n .then(() => idb.del(updatesStore, idb.createIDBKeyRangeUpperBound(idbPersistence._dbref, true)))\n .then(() => idb.count(updatesStore).then(cnt => { idbPersistence._dbsize = cnt }))\n }\n })\n\n/**\n * @param {string} name\n */\nexport const clearDocument = name => idb.deleteDB(name)\n\n/**\n * @extends Observable\n */\nexport class IndexeddbPersistence extends Observable {\n /**\n * @param {string} name\n * @param {Y.Doc} doc\n */\n constructor (name, doc) {\n super()\n this.doc = doc\n this.name = name\n this._dbref = 0\n this._dbsize = 0\n this._destroyed = false\n /**\n * @type {IDBDatabase|null}\n */\n this.db = null\n this.synced = false\n this._db = idb.openDB(name, db =>\n idb.createStores(db, [\n ['updates', { autoIncrement: true }],\n ['custom']\n ])\n )\n /**\n * @type {Promise}\n */\n this.whenSynced = promise.create(resolve => this.on('synced', () => resolve(this)))\n\n this._db.then(db => {\n this.db = db\n /**\n * @param {IDBObjectStore} updatesStore\n */\n const beforeApplyUpdatesCallback = (updatesStore) => idb.addAutoKey(updatesStore, Y.encodeStateAsUpdate(doc))\n const afterApplyUpdatesCallback = () => {\n if (this._destroyed) return this\n this.synced = true\n this.emit('synced', [this])\n }\n fetchUpdates(this, beforeApplyUpdatesCallback, afterApplyUpdatesCallback)\n })\n /**\n * Timeout in ms untill data is merged and persisted in idb.\n */\n this._storeTimeout = 1000\n /**\n * @type {any}\n */\n this._storeTimeoutId = null\n /**\n * @param {Uint8Array} update\n * @param {any} origin\n */\n this._storeUpdate = (update, origin) => {\n if (this.db && origin !== this) {\n const [updatesStore] = idb.transact(/** @type {IDBDatabase} */ (this.db), [updatesStoreName])\n idb.addAutoKey(updatesStore, update)\n if (++this._dbsize >= PREFERRED_TRIM_SIZE) {\n // debounce store call\n if (this._storeTimeoutId !== null) {\n clearTimeout(this._storeTimeoutId)\n }\n this._storeTimeoutId = setTimeout(() => {\n storeState(this, false)\n this._storeTimeoutId = null\n }, this._storeTimeout)\n }\n }\n }\n doc.on('update', this._storeUpdate)\n this.destroy = this.destroy.bind(this)\n doc.on('destroy', this.destroy)\n }\n\n destroy () {\n if (this._storeTimeoutId) {\n clearTimeout(this._storeTimeoutId)\n }\n this.doc.off('update', this._storeUpdate)\n this.doc.off('destroy', this.destroy)\n this._destroyed = true\n return this._db.then(db => {\n db.close()\n })\n }\n\n /**\n * Destroys this instance and removes all data from indexeddb.\n *\n * @return {Promise}\n */\n clearData () {\n return this.destroy().then(() => {\n idb.deleteDB(this.name)\n })\n }\n\n /**\n * @param {String | number | ArrayBuffer | Date} key\n * @return {Promise}\n */\n get (key) {\n return this._db.then(db => {\n const [custom] = idb.transact(db, [customStoreName], 'readonly')\n return idb.get(custom, key)\n })\n }\n\n /**\n * @param {String | number | ArrayBuffer | Date} key\n * @param {String | number | ArrayBuffer | Date} value\n * @return {Promise}\n */\n set (key, value) {\n return this._db.then(db => {\n const [custom] = idb.transact(db, [customStoreName])\n return idb.put(custom, value, key)\n })\n }\n\n /**\n * @param {String | number | ArrayBuffer | Date} key\n * @return {Promise}\n */\n del (key) {\n return this._db.then(db => {\n const [custom] = idb.transact(db, [customStoreName])\n return idb.del(custom, key)\n })\n }\n}\n", "/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n", "import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n", "import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n", "import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n", "import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n", "/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n", "/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n", "/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n", "/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nexport default identity;\n", "import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n", "import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n", "import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n", "/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n", "import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n", "/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n", "import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n", "import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n", "/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nexport default apply;\n", "/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n", "/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nexport default shortOut;\n", "/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nexport default constant;\n", "import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n", "import constant from './constant.js';\nimport defineProperty from './_defineProperty.js';\nimport identity from './identity.js';\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nexport default baseSetToString;\n", "import baseSetToString from './_baseSetToString.js';\nimport shortOut from './_shortOut.js';\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nexport default setToString;\n", "/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n", "import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n", "/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n", "import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n", "import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n", "import apply from './_apply.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nexport default overRest;\n", "import identity from './identity.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nexport default baseRest;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n", "import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n", "import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nexport default isIterateeCall;\n", "import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nexport default createAssigner;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n", "/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n", "import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n", "import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n", "/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n", "import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n", "import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n", "/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n", "import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n", "import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n", "import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n", "/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n", "import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n", "import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n", "import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n", "/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n", "import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n", "import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n", "import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n", "import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n", "/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n", "import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n", "/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n", "import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n", "import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n", "import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n", "/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n", "import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n", "import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n", "/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n", "import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n", "import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n", "import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n", "/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n", "/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n", "/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n", "import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n", "import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n", "import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n", "import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n", "import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n", "/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n", "/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n", "import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n", "import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n", "import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n", "import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n", "import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n", "import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n", "import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n", "import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n", "import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n", "import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n", "import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n", "/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n", "import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n", "import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n", "import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n", "import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n", "import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n", "import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n", "import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n", "import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n", "import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n", "import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n", "/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nexport default setCacheAdd;\n", "/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nexport default setCacheHas;\n", "import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nexport default SetCache;\n", "/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nexport default arraySome;\n", "/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nexport default cacheHas;\n", "import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nexport default equalArrays;\n", "/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nexport default mapToArray;\n", "/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nexport default setToArray;\n", "import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nexport default equalByTag;\n", "import getAllKeys from './_getAllKeys.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nexport default equalObjects;\n", "import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nexport default baseIsEqualDeep;\n", "import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nexport default baseIsEqual;\n", "/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n", "import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n", "import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignMergeValue;\n", "import isArrayLike from './isArrayLike.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nexport default isArrayLikeObject;\n", "/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nexport default safeGet;\n", "import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nexport default toPlainObject;\n", "import assignMergeValue from './_assignMergeValue.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\nimport copyArray from './_copyArray.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport isBuffer from './isBuffer.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isPlainObject from './isPlainObject.js';\nimport isTypedArray from './isTypedArray.js';\nimport safeGet from './_safeGet.js';\nimport toPlainObject from './toPlainObject.js';\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nexport default baseMergeDeep;\n", "import Stack from './_Stack.js';\nimport assignMergeValue from './_assignMergeValue.js';\nimport baseFor from './_baseFor.js';\nimport baseMergeDeep from './_baseMergeDeep.js';\nimport isObject from './isObject.js';\nimport keysIn from './keysIn.js';\nimport safeGet from './_safeGet.js';\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nexport default baseMerge;\n", "import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nexport default isEqual;\n", "import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nexport default merge;\n", "/**\n * @license\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"es\" -o ./`\n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\nexport { default as add } from './add.js';\nexport { default as after } from './after.js';\nexport { default as ary } from './ary.js';\nexport { default as assign } from './assign.js';\nexport { default as assignIn } from './assignIn.js';\nexport { default as assignInWith } from './assignInWith.js';\nexport { default as assignWith } from './assignWith.js';\nexport { default as at } from './at.js';\nexport { default as attempt } from './attempt.js';\nexport { default as before } from './before.js';\nexport { default as bind } from './bind.js';\nexport { default as bindAll } from './bindAll.js';\nexport { default as bindKey } from './bindKey.js';\nexport { default as camelCase } from './camelCase.js';\nexport { default as capitalize } from './capitalize.js';\nexport { default as castArray } from './castArray.js';\nexport { default as ceil } from './ceil.js';\nexport { default as chain } from './chain.js';\nexport { default as chunk } from './chunk.js';\nexport { default as clamp } from './clamp.js';\nexport { default as clone } from './clone.js';\nexport { default as cloneDeep } from './cloneDeep.js';\nexport { default as cloneDeepWith } from './cloneDeepWith.js';\nexport { default as cloneWith } from './cloneWith.js';\nexport { default as commit } from './commit.js';\nexport { default as compact } from './compact.js';\nexport { default as concat } from './concat.js';\nexport { default as cond } from './cond.js';\nexport { default as conforms } from './conforms.js';\nexport { default as conformsTo } from './conformsTo.js';\nexport { default as constant } from './constant.js';\nexport { default as countBy } from './countBy.js';\nexport { default as create } from './create.js';\nexport { default as curry } from './curry.js';\nexport { default as curryRight } from './curryRight.js';\nexport { default as debounce } from './debounce.js';\nexport { default as deburr } from './deburr.js';\nexport { default as defaultTo } from './defaultTo.js';\nexport { default as defaults } from './defaults.js';\nexport { default as defaultsDeep } from './defaultsDeep.js';\nexport { default as defer } from './defer.js';\nexport { default as delay } from './delay.js';\nexport { default as difference } from './difference.js';\nexport { default as differenceBy } from './differenceBy.js';\nexport { default as differenceWith } from './differenceWith.js';\nexport { default as divide } from './divide.js';\nexport { default as drop } from './drop.js';\nexport { default as dropRight } from './dropRight.js';\nexport { default as dropRightWhile } from './dropRightWhile.js';\nexport { default as dropWhile } from './dropWhile.js';\nexport { default as each } from './each.js';\nexport { default as eachRight } from './eachRight.js';\nexport { default as endsWith } from './endsWith.js';\nexport { default as entries } from './entries.js';\nexport { default as entriesIn } from './entriesIn.js';\nexport { default as eq } from './eq.js';\nexport { default as escape } from './escape.js';\nexport { default as escapeRegExp } from './escapeRegExp.js';\nexport { default as every } from './every.js';\nexport { default as extend } from './extend.js';\nexport { default as extendWith } from './extendWith.js';\nexport { default as fill } from './fill.js';\nexport { default as filter } from './filter.js';\nexport { default as find } from './find.js';\nexport { default as findIndex } from './findIndex.js';\nexport { default as findKey } from './findKey.js';\nexport { default as findLast } from './findLast.js';\nexport { default as findLastIndex } from './findLastIndex.js';\nexport { default as findLastKey } from './findLastKey.js';\nexport { default as first } from './first.js';\nexport { default as flatMap } from './flatMap.js';\nexport { default as flatMapDeep } from './flatMapDeep.js';\nexport { default as flatMapDepth } from './flatMapDepth.js';\nexport { default as flatten } from './flatten.js';\nexport { default as flattenDeep } from './flattenDeep.js';\nexport { default as flattenDepth } from './flattenDepth.js';\nexport { default as flip } from './flip.js';\nexport { default as floor } from './floor.js';\nexport { default as flow } from './flow.js';\nexport { default as flowRight } from './flowRight.js';\nexport { default as forEach } from './forEach.js';\nexport { default as forEachRight } from './forEachRight.js';\nexport { default as forIn } from './forIn.js';\nexport { default as forInRight } from './forInRight.js';\nexport { default as forOwn } from './forOwn.js';\nexport { default as forOwnRight } from './forOwnRight.js';\nexport { default as fromPairs } from './fromPairs.js';\nexport { default as functions } from './functions.js';\nexport { default as functionsIn } from './functionsIn.js';\nexport { default as get } from './get.js';\nexport { default as groupBy } from './groupBy.js';\nexport { default as gt } from './gt.js';\nexport { default as gte } from './gte.js';\nexport { default as has } from './has.js';\nexport { default as hasIn } from './hasIn.js';\nexport { default as head } from './head.js';\nexport { default as identity } from './identity.js';\nexport { default as inRange } from './inRange.js';\nexport { default as includes } from './includes.js';\nexport { default as indexOf } from './indexOf.js';\nexport { default as initial } from './initial.js';\nexport { default as intersection } from './intersection.js';\nexport { default as intersectionBy } from './intersectionBy.js';\nexport { default as intersectionWith } from './intersectionWith.js';\nexport { default as invert } from './invert.js';\nexport { default as invertBy } from './invertBy.js';\nexport { default as invoke } from './invoke.js';\nexport { default as invokeMap } from './invokeMap.js';\nexport { default as isArguments } from './isArguments.js';\nexport { default as isArray } from './isArray.js';\nexport { default as isArrayBuffer } from './isArrayBuffer.js';\nexport { default as isArrayLike } from './isArrayLike.js';\nexport { default as isArrayLikeObject } from './isArrayLikeObject.js';\nexport { default as isBoolean } from './isBoolean.js';\nexport { default as isBuffer } from './isBuffer.js';\nexport { default as isDate } from './isDate.js';\nexport { default as isElement } from './isElement.js';\nexport { default as isEmpty } from './isEmpty.js';\nexport { default as isEqual } from './isEqual.js';\nexport { default as isEqualWith } from './isEqualWith.js';\nexport { default as isError } from './isError.js';\nexport { default as isFinite } from './isFinite.js';\nexport { default as isFunction } from './isFunction.js';\nexport { default as isInteger } from './isInteger.js';\nexport { default as isLength } from './isLength.js';\nexport { default as isMap } from './isMap.js';\nexport { default as isMatch } from './isMatch.js';\nexport { default as isMatchWith } from './isMatchWith.js';\nexport { default as isNaN } from './isNaN.js';\nexport { default as isNative } from './isNative.js';\nexport { default as isNil } from './isNil.js';\nexport { default as isNull } from './isNull.js';\nexport { default as isNumber } from './isNumber.js';\nexport { default as isObject } from './isObject.js';\nexport { default as isObjectLike } from './isObjectLike.js';\nexport { default as isPlainObject } from './isPlainObject.js';\nexport { default as isRegExp } from './isRegExp.js';\nexport { default as isSafeInteger } from './isSafeInteger.js';\nexport { default as isSet } from './isSet.js';\nexport { default as isString } from './isString.js';\nexport { default as isSymbol } from './isSymbol.js';\nexport { default as isTypedArray } from './isTypedArray.js';\nexport { default as isUndefined } from './isUndefined.js';\nexport { default as isWeakMap } from './isWeakMap.js';\nexport { default as isWeakSet } from './isWeakSet.js';\nexport { default as iteratee } from './iteratee.js';\nexport { default as join } from './join.js';\nexport { default as kebabCase } from './kebabCase.js';\nexport { default as keyBy } from './keyBy.js';\nexport { default as keys } from './keys.js';\nexport { default as keysIn } from './keysIn.js';\nexport { default as last } from './last.js';\nexport { default as lastIndexOf } from './lastIndexOf.js';\nexport { default as lodash } from './wrapperLodash.js';\nexport { default as lowerCase } from './lowerCase.js';\nexport { default as lowerFirst } from './lowerFirst.js';\nexport { default as lt } from './lt.js';\nexport { default as lte } from './lte.js';\nexport { default as map } from './map.js';\nexport { default as mapKeys } from './mapKeys.js';\nexport { default as mapValues } from './mapValues.js';\nexport { default as matches } from './matches.js';\nexport { default as matchesProperty } from './matchesProperty.js';\nexport { default as max } from './max.js';\nexport { default as maxBy } from './maxBy.js';\nexport { default as mean } from './mean.js';\nexport { default as meanBy } from './meanBy.js';\nexport { default as memoize } from './memoize.js';\nexport { default as merge } from './merge.js';\nexport { default as mergeWith } from './mergeWith.js';\nexport { default as method } from './method.js';\nexport { default as methodOf } from './methodOf.js';\nexport { default as min } from './min.js';\nexport { default as minBy } from './minBy.js';\nexport { default as mixin } from './mixin.js';\nexport { default as multiply } from './multiply.js';\nexport { default as negate } from './negate.js';\nexport { default as next } from './next.js';\nexport { default as noop } from './noop.js';\nexport { default as now } from './now.js';\nexport { default as nth } from './nth.js';\nexport { default as nthArg } from './nthArg.js';\nexport { default as omit } from './omit.js';\nexport { default as omitBy } from './omitBy.js';\nexport { default as once } from './once.js';\nexport { default as orderBy } from './orderBy.js';\nexport { default as over } from './over.js';\nexport { default as overArgs } from './overArgs.js';\nexport { default as overEvery } from './overEvery.js';\nexport { default as overSome } from './overSome.js';\nexport { default as pad } from './pad.js';\nexport { default as padEnd } from './padEnd.js';\nexport { default as padStart } from './padStart.js';\nexport { default as parseInt } from './parseInt.js';\nexport { default as partial } from './partial.js';\nexport { default as partialRight } from './partialRight.js';\nexport { default as partition } from './partition.js';\nexport { default as pick } from './pick.js';\nexport { default as pickBy } from './pickBy.js';\nexport { default as plant } from './plant.js';\nexport { default as property } from './property.js';\nexport { default as propertyOf } from './propertyOf.js';\nexport { default as pull } from './pull.js';\nexport { default as pullAll } from './pullAll.js';\nexport { default as pullAllBy } from './pullAllBy.js';\nexport { default as pullAllWith } from './pullAllWith.js';\nexport { default as pullAt } from './pullAt.js';\nexport { default as random } from './random.js';\nexport { default as range } from './range.js';\nexport { default as rangeRight } from './rangeRight.js';\nexport { default as rearg } from './rearg.js';\nexport { default as reduce } from './reduce.js';\nexport { default as reduceRight } from './reduceRight.js';\nexport { default as reject } from './reject.js';\nexport { default as remove } from './remove.js';\nexport { default as repeat } from './repeat.js';\nexport { default as replace } from './replace.js';\nexport { default as rest } from './rest.js';\nexport { default as result } from './result.js';\nexport { default as reverse } from './reverse.js';\nexport { default as round } from './round.js';\nexport { default as sample } from './sample.js';\nexport { default as sampleSize } from './sampleSize.js';\nexport { default as set } from './set.js';\nexport { default as setWith } from './setWith.js';\nexport { default as shuffle } from './shuffle.js';\nexport { default as size } from './size.js';\nexport { default as slice } from './slice.js';\nexport { default as snakeCase } from './snakeCase.js';\nexport { default as some } from './some.js';\nexport { default as sortBy } from './sortBy.js';\nexport { default as sortedIndex } from './sortedIndex.js';\nexport { default as sortedIndexBy } from './sortedIndexBy.js';\nexport { default as sortedIndexOf } from './sortedIndexOf.js';\nexport { default as sortedLastIndex } from './sortedLastIndex.js';\nexport { default as sortedLastIndexBy } from './sortedLastIndexBy.js';\nexport { default as sortedLastIndexOf } from './sortedLastIndexOf.js';\nexport { default as sortedUniq } from './sortedUniq.js';\nexport { default as sortedUniqBy } from './sortedUniqBy.js';\nexport { default as split } from './split.js';\nexport { default as spread } from './spread.js';\nexport { default as startCase } from './startCase.js';\nexport { default as startsWith } from './startsWith.js';\nexport { default as stubArray } from './stubArray.js';\nexport { default as stubFalse } from './stubFalse.js';\nexport { default as stubObject } from './stubObject.js';\nexport { default as stubString } from './stubString.js';\nexport { default as stubTrue } from './stubTrue.js';\nexport { default as subtract } from './subtract.js';\nexport { default as sum } from './sum.js';\nexport { default as sumBy } from './sumBy.js';\nexport { default as tail } from './tail.js';\nexport { default as take } from './take.js';\nexport { default as takeRight } from './takeRight.js';\nexport { default as takeRightWhile } from './takeRightWhile.js';\nexport { default as takeWhile } from './takeWhile.js';\nexport { default as tap } from './tap.js';\nexport { default as template } from './template.js';\nexport { default as templateSettings } from './templateSettings.js';\nexport { default as throttle } from './throttle.js';\nexport { default as thru } from './thru.js';\nexport { default as times } from './times.js';\nexport { default as toArray } from './toArray.js';\nexport { default as toFinite } from './toFinite.js';\nexport { default as toInteger } from './toInteger.js';\nexport { default as toIterator } from './toIterator.js';\nexport { default as toJSON } from './toJSON.js';\nexport { default as toLength } from './toLength.js';\nexport { default as toLower } from './toLower.js';\nexport { default as toNumber } from './toNumber.js';\nexport { default as toPairs } from './toPairs.js';\nexport { default as toPairsIn } from './toPairsIn.js';\nexport { default as toPath } from './toPath.js';\nexport { default as toPlainObject } from './toPlainObject.js';\nexport { default as toSafeInteger } from './toSafeInteger.js';\nexport { default as toString } from './toString.js';\nexport { default as toUpper } from './toUpper.js';\nexport { default as transform } from './transform.js';\nexport { default as trim } from './trim.js';\nexport { default as trimEnd } from './trimEnd.js';\nexport { default as trimStart } from './trimStart.js';\nexport { default as truncate } from './truncate.js';\nexport { default as unary } from './unary.js';\nexport { default as unescape } from './unescape.js';\nexport { default as union } from './union.js';\nexport { default as unionBy } from './unionBy.js';\nexport { default as unionWith } from './unionWith.js';\nexport { default as uniq } from './uniq.js';\nexport { default as uniqBy } from './uniqBy.js';\nexport { default as uniqWith } from './uniqWith.js';\nexport { default as uniqueId } from './uniqueId.js';\nexport { default as unset } from './unset.js';\nexport { default as unzip } from './unzip.js';\nexport { default as unzipWith } from './unzipWith.js';\nexport { default as update } from './update.js';\nexport { default as updateWith } from './updateWith.js';\nexport { default as upperCase } from './upperCase.js';\nexport { default as upperFirst } from './upperFirst.js';\nexport { default as value } from './value.js';\nexport { default as valueOf } from './valueOf.js';\nexport { default as values } from './values.js';\nexport { default as valuesIn } from './valuesIn.js';\nexport { default as without } from './without.js';\nexport { default as words } from './words.js';\nexport { default as wrap } from './wrap.js';\nexport { default as wrapperAt } from './wrapperAt.js';\nexport { default as wrapperChain } from './wrapperChain.js';\nexport { default as wrapperCommit } from './commit.js';\nexport { default as wrapperLodash } from './wrapperLodash.js';\nexport { default as wrapperNext } from './next.js';\nexport { default as wrapperPlant } from './plant.js';\nexport { default as wrapperReverse } from './wrapperReverse.js';\nexport { default as wrapperToIterator } from './toIterator.js';\nexport { default as wrapperValue } from './wrapperValue.js';\nexport { default as xor } from './xor.js';\nexport { default as xorBy } from './xorBy.js';\nexport { default as xorWith } from './xorWith.js';\nexport { default as zip } from './zip.js';\nexport { default as zipObject } from './zipObject.js';\nexport { default as zipObjectDeep } from './zipObjectDeep.js';\nexport { default as zipWith } from './zipWith.js';\nexport { default } from './lodash.default.js';\n", "enum Scope {\n TYPE = (1 << 2) - 1, // 0011 Lower two bits\n LEVEL = ((1 << 2) - 1) << 2, // 1100 Higher two bits\n\n ATTRIBUTE = (1 << 0) | LEVEL, // 1101\n BLOT = (1 << 1) | LEVEL, // 1110\n INLINE = (1 << 2) | TYPE, // 0111\n BLOCK = (1 << 3) | TYPE, // 1011\n\n BLOCK_BLOT = BLOCK & BLOT, // 1010\n INLINE_BLOT = INLINE & BLOT, // 0110\n BLOCK_ATTRIBUTE = BLOCK & ATTRIBUTE, // 1001\n INLINE_ATTRIBUTE = INLINE & ATTRIBUTE, // 0101\n\n ANY = TYPE | LEVEL,\n}\n\nexport default Scope;\n", "import Scope from '../scope.js';\n\nexport interface AttributorOptions {\n scope?: Scope;\n whitelist?: string[];\n}\n\nexport default class Attributor {\n public static keys(node: HTMLElement): string[] {\n return Array.from(node.attributes).map((item: Attr) => item.name);\n }\n\n public scope: Scope;\n public whitelist: string[] | undefined;\n\n constructor(\n public readonly attrName: string,\n public readonly keyName: string,\n options: AttributorOptions = {},\n ) {\n const attributeBit = Scope.TYPE & Scope.ATTRIBUTE;\n this.scope =\n options.scope != null\n ? // Ignore type bits, force attribute bit\n (options.scope & Scope.LEVEL) | attributeBit\n : Scope.ATTRIBUTE;\n if (options.whitelist != null) {\n this.whitelist = options.whitelist;\n }\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n node.setAttribute(this.keyName, value);\n return true;\n }\n\n public canAdd(_node: HTMLElement, value: any): boolean {\n if (this.whitelist == null) {\n return true;\n }\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n } else {\n return this.whitelist.indexOf(value) > -1;\n }\n }\n\n public remove(node: HTMLElement): void {\n node.removeAttribute(this.keyName);\n }\n\n public value(node: HTMLElement): any {\n const value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n }\n}\n", "export default class ParchmentError extends Error {\n public message: string;\n public name: string;\n public stack!: string;\n\n constructor(message: string) {\n message = '[Parchment] ' + message;\n super(message);\n this.message = message;\n this.name = this.constructor.name;\n }\n}\n", "import Attributor from './attributor/attributor.js';\nimport {\n type Blot,\n type BlotConstructor,\n type Root,\n} from './blot/abstract/blot.js';\nimport ParchmentError from './error.js';\nimport Scope from './scope.js';\n\nexport type RegistryDefinition = Attributor | BlotConstructor;\n\nexport interface RegistryInterface {\n create(scroll: Root, input: Node | string | Scope, value?: any): Blot;\n query(query: string | Node | Scope, scope: Scope): RegistryDefinition | null;\n register(...definitions: any[]): any;\n}\n\nexport default class Registry implements RegistryInterface {\n public static blots = new WeakMap();\n\n public static find(node?: Node | null, bubble = false): Blot | null {\n if (node == null) {\n return null;\n }\n if (this.blots.has(node)) {\n return this.blots.get(node) || null;\n }\n if (bubble) {\n let parentNode: Node | null = null;\n try {\n parentNode = node.parentNode;\n } catch (err) {\n // Probably hit a permission denied error.\n // A known case is in Firefox, event targets can be anonymous DIVs\n // inside an input element.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=208427\n return null;\n }\n return this.find(parentNode, bubble);\n }\n return null;\n }\n\n private attributes: { [key: string]: Attributor } = {};\n private classes: { [key: string]: BlotConstructor } = {};\n private tags: { [key: string]: BlotConstructor } = {};\n private types: { [key: string]: RegistryDefinition } = {};\n\n public create(scroll: Root, input: Node | string | Scope, value?: any): Blot {\n const match = this.query(input);\n if (match == null) {\n throw new ParchmentError(`Unable to create ${input} blot`);\n }\n const blotClass = match as BlotConstructor;\n const node =\n // @ts-expect-error Fix me later\n input instanceof Node || input.nodeType === Node.TEXT_NODE\n ? input\n : blotClass.create(value);\n\n const blot = new blotClass(scroll, node as Node, value);\n Registry.blots.set(blot.domNode, blot);\n return blot;\n }\n\n public find(node: Node | null, bubble = false): Blot | null {\n return Registry.find(node, bubble);\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): RegistryDefinition | null {\n let match;\n if (typeof query === 'string') {\n match = this.types[query] || this.attributes[query];\n // @ts-expect-error Fix me later\n } else if (query instanceof Text || query.nodeType === Node.TEXT_NODE) {\n match = this.types.text;\n } else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = this.types.block;\n } else if (query & Scope.LEVEL & Scope.INLINE) {\n match = this.types.inline;\n }\n } else if (query instanceof Element) {\n const names = (query.getAttribute('class') || '').split(/\\s+/);\n names.some((name) => {\n match = this.classes[name];\n if (match) {\n return true;\n }\n return false;\n });\n match = match || this.tags[query.tagName];\n }\n if (match == null) {\n return null;\n }\n if (\n 'scope' in match &&\n scope & Scope.LEVEL & match.scope &&\n scope & Scope.TYPE & match.scope\n ) {\n return match;\n }\n return null;\n }\n\n public register(...definitions: RegistryDefinition[]): RegistryDefinition[] {\n return definitions.map((definition) => {\n const isBlot = 'blotName' in definition;\n const isAttr = 'attrName' in definition;\n if (!isBlot && !isAttr) {\n throw new ParchmentError('Invalid definition');\n } else if (isBlot && definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n const key = isBlot\n ? definition.blotName\n : isAttr\n ? definition.attrName\n : (undefined as never); // already handled by above checks\n this.types[key] = definition;\n\n if (isAttr) {\n if (typeof definition.keyName === 'string') {\n this.attributes[definition.keyName] = definition;\n }\n } else if (isBlot) {\n if (definition.className) {\n this.classes[definition.className] = definition;\n }\n if (definition.tagName) {\n if (Array.isArray(definition.tagName)) {\n definition.tagName = definition.tagName.map((tagName: string) => {\n return tagName.toUpperCase();\n });\n } else {\n definition.tagName = definition.tagName.toUpperCase();\n }\n const tagNames = Array.isArray(definition.tagName)\n ? definition.tagName\n : [definition.tagName];\n tagNames.forEach((tag: string) => {\n if (this.tags[tag] == null || definition.className == null) {\n this.tags[tag] = definition;\n }\n });\n }\n }\n return definition;\n });\n }\n}\n", "import Attributor from './attributor.js';\n\nfunction match(node: HTMLElement, prefix: string): string[] {\n const className = node.getAttribute('class') || '';\n return className\n .split(/\\s+/)\n .filter((name) => name.indexOf(`${prefix}-`) === 0);\n}\n\nclass ClassAttributor extends Attributor {\n public static keys(node: HTMLElement): string[] {\n return (node.getAttribute('class') || '')\n .split(/\\s+/)\n .map((name) => name.split('-').slice(0, -1).join('-'));\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n this.remove(node);\n node.classList.add(`${this.keyName}-${value}`);\n return true;\n }\n\n public remove(node: HTMLElement): void {\n const matches = match(node, this.keyName);\n matches.forEach((name) => {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n }\n\n public value(node: HTMLElement): any {\n const result = match(node, this.keyName)[0] || '';\n const value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default ClassAttributor;\n", "import Attributor from './attributor.js';\n\nfunction camelize(name: string): string {\n const parts = name.split('-');\n const rest = parts\n .slice(1)\n .map((part: string) => part[0].toUpperCase() + part.slice(1))\n .join('');\n return parts[0] + rest;\n}\n\nclass StyleAttributor extends Attributor {\n public static keys(node: HTMLElement): string[] {\n return (node.getAttribute('style') || '').split(';').map((value) => {\n const arr = value.split(':');\n return arr[0].trim();\n });\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n // @ts-expect-error Fix me later\n node.style[camelize(this.keyName)] = value;\n return true;\n }\n\n public remove(node: HTMLElement): void {\n // @ts-expect-error Fix me later\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n }\n\n public value(node: HTMLElement): any {\n // @ts-expect-error Fix me later\n const value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default StyleAttributor;\n", "import type { Formattable } from '../blot/abstract/blot.js';\nimport Registry from '../registry.js';\nimport Scope from '../scope.js';\nimport Attributor from './attributor.js';\nimport ClassAttributor from './class.js';\nimport StyleAttributor from './style.js';\n\nclass AttributorStore {\n private attributes: { [key: string]: Attributor } = {};\n private domNode: HTMLElement;\n\n constructor(domNode: HTMLElement) {\n this.domNode = domNode;\n this.build();\n }\n\n public attribute(attribute: Attributor, value: any): void {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n } else {\n delete this.attributes[attribute.attrName];\n }\n }\n } else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n }\n\n public build(): void {\n this.attributes = {};\n const blot = Registry.find(this.domNode);\n if (blot == null) {\n return;\n }\n const attributes = Attributor.keys(this.domNode);\n const classes = ClassAttributor.keys(this.domNode);\n const styles = StyleAttributor.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach((name) => {\n const attr = blot.scroll.query(name, Scope.ATTRIBUTE);\n if (attr instanceof Attributor) {\n this.attributes[attr.attrName] = attr;\n }\n });\n }\n\n public copy(target: Formattable): void {\n Object.keys(this.attributes).forEach((key) => {\n const value = this.attributes[key].value(this.domNode);\n target.format(key, value);\n });\n }\n\n public move(target: Formattable): void {\n this.copy(target);\n Object.keys(this.attributes).forEach((key) => {\n this.attributes[key].remove(this.domNode);\n });\n this.attributes = {};\n }\n\n public values(): { [key: string]: any } {\n return Object.keys(this.attributes).reduce(\n (attributes: { [key: string]: any }, name: string) => {\n attributes[name] = this.attributes[name].value(this.domNode);\n return attributes;\n },\n {},\n );\n }\n}\n\nexport default AttributorStore;\n", "import ParchmentError from '../../error.js';\nimport Registry from '../../registry.js';\nimport Scope from '../../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Parent,\n Root,\n} from './blot.js';\n\nclass ShadowBlot implements Blot {\n public static blotName = 'abstract';\n public static className: string;\n public static requiredContainer: BlotConstructor;\n public static scope: Scope;\n public static tagName: string | string[];\n\n public static create(rawValue?: unknown): Node {\n if (this.tagName == null) {\n throw new ParchmentError('Blot definition missing tagName');\n }\n let node: HTMLElement;\n let value: string | number | undefined;\n if (Array.isArray(this.tagName)) {\n if (typeof rawValue === 'string') {\n value = rawValue.toUpperCase();\n if (parseInt(value, 10).toString() === value) {\n value = parseInt(value, 10);\n }\n } else if (typeof rawValue === 'number') {\n value = rawValue;\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n } else if (value && this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n } else {\n node = document.createElement(this.tagName[0]);\n }\n } else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n }\n\n public prev: Blot | null;\n public next: Blot | null;\n // @ts-expect-error Fix me later\n public parent: Parent;\n\n // Hack for accessing inherited static methods\n get statics(): any {\n return this.constructor;\n }\n constructor(\n public scroll: Root,\n public domNode: Node,\n ) {\n Registry.blots.set(domNode, this);\n this.prev = null;\n this.next = null;\n }\n\n public attach(): void {\n // Nothing to do\n }\n\n public clone(): Blot {\n const domNode = this.domNode.cloneNode(false);\n return this.scroll.create(domNode);\n }\n\n public detach(): void {\n if (this.parent != null) {\n this.parent.removeChild(this);\n }\n Registry.blots.delete(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n const blot = this.isolate(index, length);\n blot.remove();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n const blot = this.isolate(index, length);\n if (this.scroll.query(name, Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n } else if (this.scroll.query(name, Scope.ATTRIBUTE) != null) {\n const parent = this.scroll.create(this.statics.scope) as Parent &\n Formattable;\n blot.wrap(parent);\n parent.format(name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n const ref = this.split(index);\n this.parent.insertBefore(blot, ref || undefined);\n }\n\n public isolate(index: number, length: number): Blot {\n const target = this.split(index);\n if (target == null) {\n throw new Error('Attempt to isolate at end');\n }\n target.split(length);\n return target;\n }\n\n public length(): number {\n return 1;\n }\n\n public offset(root: Blot = this.parent): number {\n if (this.parent == null || this === root) {\n return 0;\n }\n return this.parent.children.offset(this) + this.parent.offset(root);\n }\n\n public optimize(_context?: { [key: string]: any }): void {\n if (\n this.statics.requiredContainer &&\n !(this.parent instanceof this.statics.requiredContainer)\n ) {\n this.wrap(this.statics.requiredContainer.blotName);\n }\n }\n\n public remove(): void {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(replacement, this.next || undefined);\n this.remove();\n }\n return replacement;\n }\n\n public split(index: number, _force?: boolean): Blot | null {\n return index === 0 ? this : this.next;\n }\n\n public update(\n _mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n // Nothing to do by default\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper =\n typeof name === 'string'\n ? (this.scroll.create(name, value) as Parent)\n : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next || undefined);\n }\n if (typeof wrapper.appendChild !== 'function') {\n throw new ParchmentError(`Cannot wrap ${name}`);\n }\n wrapper.appendChild(this);\n return wrapper;\n }\n}\n\nexport default ShadowBlot;\n", "import Scope from '../../scope.js';\nimport type { Leaf } from './blot.js';\nimport ShadowBlot from './shadow.js';\n\nclass LeafBlot extends ShadowBlot implements Leaf {\n public static scope = Scope.INLINE_BLOT;\n\n /**\n * Returns the value represented by domNode if it is this Blot's type\n * No checking that domNode can represent this Blot type is required so\n * applications needing it should check externally before calling.\n */\n public static value(_domNode: Node): any {\n return true;\n }\n\n /**\n * Given location represented by node and offset from DOM Selection Range,\n * return index to that location.\n */\n public index(node: Node, offset: number): number {\n if (\n this.domNode === node ||\n this.domNode.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return Math.min(offset, 1);\n }\n return -1;\n }\n\n /**\n * Given index to location within blot, return node and offset representing\n * that location, consumable by DOM Selection Range\n */\n public position(index: number, _inclusive?: boolean): [Node, number] {\n const childNodes: Node[] = Array.from(this.parent.domNode.childNodes);\n let offset = childNodes.indexOf(this.domNode);\n if (index > 0) {\n offset += 1;\n }\n return [this.parent.domNode, offset];\n }\n\n /**\n * Return value represented by this blot\n * Should not change without interaction from API or\n * user change detectable by update()\n */\n public value(): any {\n return {\n [this.statics.blotName]: this.statics.value(this.domNode) || true,\n };\n }\n}\n\nexport default LeafBlot;\n", "import type LinkedNode from './linked-node.js';\n\nclass LinkedList {\n public head: T | null;\n public tail: T | null;\n public length: number;\n\n constructor() {\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n public append(...nodes: T[]): void {\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n const rest = nodes.slice(1);\n this.append(...rest);\n }\n }\n\n public at(index: number): T | null {\n const next = this.iterator();\n let cur = next();\n while (cur && index > 0) {\n index -= 1;\n cur = next();\n }\n return cur;\n }\n\n public contains(node: T): boolean {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n if (cur === node) {\n return true;\n }\n cur = next();\n }\n return false;\n }\n\n public indexOf(node: T): number {\n const next = this.iterator();\n let cur = next();\n let index = 0;\n while (cur) {\n if (cur === node) {\n return index;\n }\n index += 1;\n cur = next();\n }\n return -1;\n }\n\n public insertBefore(node: T | null, refNode: T | null): void {\n if (node == null) {\n return;\n }\n this.remove(node);\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n } else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n } else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n }\n\n public offset(target: T): number {\n let index = 0;\n let cur = this.head;\n while (cur != null) {\n if (cur === target) {\n return index;\n }\n index += cur.length();\n cur = cur.next as T;\n }\n return -1;\n }\n\n public remove(node: T): void {\n if (!this.contains(node)) {\n return;\n }\n if (node.prev != null) {\n node.prev.next = node.next;\n }\n if (node.next != null) {\n node.next.prev = node.prev;\n }\n if (node === this.head) {\n this.head = node.next as T;\n }\n if (node === this.tail) {\n this.tail = node.prev as T;\n }\n this.length -= 1;\n }\n\n public iterator(curNode: T | null = this.head): () => T | null {\n // TODO use yield when we can\n return (): T | null => {\n const ret = curNode;\n if (curNode != null) {\n curNode = curNode.next as T;\n }\n return ret;\n };\n }\n\n public find(index: number, inclusive = false): [T | null, number] {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n const length = cur.length();\n if (\n index < length ||\n (inclusive &&\n index === length &&\n (cur.next == null || cur.next.length() !== 0))\n ) {\n return [cur, index];\n }\n index -= length;\n cur = next();\n }\n return [null, 0];\n }\n\n public forEach(callback: (cur: T) => void): void {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n callback(cur);\n cur = next();\n }\n }\n\n public forEachAt(\n index: number,\n length: number,\n callback: (cur: T, offset: number, length: number) => void,\n ): void {\n if (length <= 0) {\n return;\n }\n const [startNode, offset] = this.find(index);\n let curIndex = index - offset;\n const next = this.iterator(startNode);\n let cur = next();\n while (cur && curIndex < index + length) {\n const curLength = cur.length();\n if (index > curIndex) {\n callback(\n cur,\n index - curIndex,\n Math.min(length, curIndex + curLength - index),\n );\n } else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n cur = next();\n }\n }\n\n public map(callback: (cur: T) => any): any[] {\n return this.reduce((memo: T[], cur: T) => {\n memo.push(callback(cur));\n return memo;\n }, []);\n }\n\n public reduce(callback: (memo: M, cur: T) => M, memo: M): M {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n memo = callback(memo, cur);\n cur = next();\n }\n return memo;\n }\n}\n\nexport default LinkedList;\n", "import LinkedList from '../../collection/linked-list.js';\nimport ParchmentError from '../../error.js';\nimport Scope from '../../scope.js';\nimport type { Blot, BlotConstructor, Parent, Root } from './blot.js';\nimport ShadowBlot from './shadow.js';\n\nfunction makeAttachedBlot(node: Node, scroll: Root): Blot {\n const found = scroll.find(node);\n if (found) return found;\n try {\n return scroll.create(node);\n } catch (e) {\n const blot = scroll.create(Scope.INLINE);\n Array.from(node.childNodes).forEach((child: Node) => {\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n return blot;\n }\n}\n\nclass ParentBlot extends ShadowBlot implements Parent {\n /**\n * Whitelist array of Blots that can be direct children.\n */\n public static allowedChildren?: BlotConstructor[];\n\n /**\n * Default child blot to be inserted if this blot becomes empty.\n */\n public static defaultChild?: BlotConstructor;\n public static uiClass = '';\n\n public children!: LinkedList;\n public domNode!: HTMLElement;\n public uiNode: HTMLElement | null = null;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.build();\n }\n\n public appendChild(other: Blot): void {\n this.insertBefore(other);\n }\n\n public attach(): void {\n super.attach();\n this.children.forEach((child) => {\n child.attach();\n });\n }\n\n public attachUI(node: HTMLElement): void {\n if (this.uiNode != null) {\n this.uiNode.remove();\n }\n this.uiNode = node;\n if (ParentBlot.uiClass) {\n this.uiNode.classList.add(ParentBlot.uiClass);\n }\n this.uiNode.setAttribute('contenteditable', 'false');\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n\n /**\n * Called during construction, should fill its own children LinkedList.\n */\n public build(): void {\n this.children = new LinkedList();\n // Need to be reversed for if DOM nodes already in order\n Array.from(this.domNode.childNodes)\n .filter((node: Node) => node !== this.uiNode)\n .reverse()\n .forEach((node: Node) => {\n try {\n const child = makeAttachedBlot(node, this.scroll);\n this.insertBefore(child, this.children.head || undefined);\n } catch (err) {\n if (err instanceof ParchmentError) {\n return;\n } else {\n throw err;\n }\n }\n });\n }\n\n public deleteAt(index: number, length: number): void {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.deleteAt(offset, childLength);\n });\n }\n\n public descendant(\n criteria: new (...args: any[]) => T,\n index: number,\n ): [T | null, number];\n public descendant(\n criteria: (blot: Blot) => boolean,\n index: number,\n ): [Blot | null, number];\n public descendant(criteria: any, index = 0): [Blot | null, number] {\n const [child, offset] = this.children.find(index);\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n return [child as any, offset];\n } else if (child instanceof ParentBlot) {\n return child.descendant(criteria, offset);\n } else {\n return [null, -1];\n }\n }\n\n public descendants(\n criteria: new (...args: any[]) => T,\n index?: number,\n length?: number,\n ): T[];\n public descendants(\n criteria: (blot: Blot) => boolean,\n index?: number,\n length?: number,\n ): Blot[];\n public descendants(\n criteria: any,\n index = 0,\n length: number = Number.MAX_VALUE,\n ): Blot[] {\n let descendants: Blot[] = [];\n let lengthLeft = length;\n this.children.forEachAt(\n index,\n length,\n (child: Blot, childIndex: number, childLength: number) => {\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n descendants.push(child);\n }\n if (child instanceof ParentBlot) {\n descendants = descendants.concat(\n child.descendants(criteria, childIndex, lengthLeft),\n );\n }\n lengthLeft -= childLength;\n },\n );\n return descendants;\n }\n\n public detach(): void {\n this.children.forEach((child) => {\n child.detach();\n });\n super.detach();\n }\n\n public enforceAllowedChildren(): void {\n let done = false;\n this.children.forEach((child: Blot) => {\n if (done) {\n return;\n }\n const allowed = this.statics.allowedChildren.some(\n (def: BlotConstructor) => child instanceof def,\n );\n if (allowed) {\n return;\n }\n if (child.statics.scope === Scope.BLOCK_BLOT) {\n if (child.next != null) {\n this.splitAfter(child);\n }\n if (child.prev != null) {\n this.splitAfter(child.prev);\n }\n child.parent.unwrap();\n done = true;\n } else if (child instanceof ParentBlot) {\n child.unwrap();\n } else {\n child.remove();\n }\n });\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.formatAt(offset, childLength, name, value);\n });\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const [child, offset] = this.children.find(index);\n if (child) {\n child.insertAt(offset, value, def);\n } else {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n this.appendChild(blot);\n }\n }\n\n public insertBefore(childBlot: Blot, refBlot?: Blot | null): void {\n if (childBlot.parent != null) {\n childBlot.parent.children.remove(childBlot);\n }\n let refDomNode: Node | null = null;\n this.children.insertBefore(childBlot, refBlot || null);\n childBlot.parent = this;\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (\n this.domNode.parentNode !== childBlot.domNode ||\n this.domNode.nextSibling !== refDomNode\n ) {\n this.domNode.insertBefore(childBlot.domNode, refDomNode);\n }\n childBlot.attach();\n }\n\n public length(): number {\n return this.children.reduce((memo, child) => {\n return memo + child.length();\n }, 0);\n }\n\n public moveChildren(targetParent: Parent, refNode?: Blot | null): void {\n this.children.forEach((child) => {\n targetParent.insertBefore(child, refNode);\n });\n }\n\n public optimize(context?: { [key: string]: any }): void {\n super.optimize(context);\n this.enforceAllowedChildren();\n if (this.uiNode != null && this.uiNode !== this.domNode.firstChild) {\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n const child = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(child);\n // TODO double check if necessary\n // child.optimize(context);\n } else {\n this.remove();\n }\n }\n }\n\n public path(index: number, inclusive = false): [Blot, number][] {\n const [child, offset] = this.children.find(index, inclusive);\n const position: [Blot, number][] = [[this, index]];\n if (child instanceof ParentBlot) {\n return position.concat(child.path(offset, inclusive));\n } else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n }\n\n public removeChild(child: Blot): void {\n this.children.remove(child);\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (replacement instanceof ParentBlot) {\n this.moveChildren(replacement);\n }\n return super.replaceWith(replacement);\n }\n\n public split(index: number, force = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.clone() as ParentBlot;\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n this.children.forEachAt(index, this.length(), (child, offset, _length) => {\n const split = child.split(offset, force);\n if (split != null) {\n after.appendChild(split);\n }\n });\n return after;\n }\n\n public splitAfter(child: Blot): Parent {\n const after = this.clone() as ParentBlot;\n while (child.next != null) {\n after.appendChild(child.next);\n }\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n return after;\n }\n\n public unwrap(): void {\n if (this.parent) {\n this.moveChildren(this.parent, this.next || undefined);\n }\n this.remove();\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n const addedNodes: Node[] = [];\n const removedNodes: Node[] = [];\n mutations.forEach((mutation) => {\n if (mutation.target === this.domNode && mutation.type === 'childList') {\n addedNodes.push(...mutation.addedNodes);\n removedNodes.push(...mutation.removedNodes);\n }\n });\n removedNodes.forEach((node: Node) => {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (\n node.parentNode != null &&\n // @ts-expect-error Fix me later\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return;\n }\n const blot = this.scroll.find(node);\n if (blot == null) {\n return;\n }\n if (\n blot.domNode.parentNode == null ||\n blot.domNode.parentNode === this.domNode\n ) {\n blot.detach();\n }\n });\n addedNodes\n .filter((node) => {\n return node.parentNode === this.domNode && node !== this.uiNode;\n })\n .sort((a, b) => {\n if (a === b) {\n return 0;\n }\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach((node) => {\n let refBlot: Blot | null = null;\n if (node.nextSibling != null) {\n refBlot = this.scroll.find(node.nextSibling);\n }\n const blot = makeAttachedBlot(node, this.scroll);\n if (blot.next !== refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(this);\n }\n this.insertBefore(blot, refBlot || undefined);\n }\n });\n this.enforceAllowedChildren();\n }\n}\n\nexport default ParentBlot;\n", "import Attributor from '../attributor/attributor.js';\nimport AttributorStore from '../attributor/store.js';\nimport Scope from '../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Parent,\n Root,\n} from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\nimport ParentBlot from './abstract/parent.js';\n\n// Shallow object comparison\nfunction isEqual(\n obj1: Record,\n obj2: Record,\n): boolean {\n if (Object.keys(obj1).length !== Object.keys(obj2).length) {\n return false;\n }\n for (const prop in obj1) {\n if (obj1[prop] !== obj2[prop]) {\n return false;\n }\n }\n return true;\n}\n\nclass InlineBlot extends ParentBlot implements Formattable {\n public static allowedChildren: BlotConstructor[] = [InlineBlot, LeafBlot];\n public static blotName = 'inline';\n public static scope = Scope.INLINE_BLOT;\n public static tagName: string | string[] = 'SPAN';\n\n static create(value?: unknown) {\n return super.create(value) as HTMLElement;\n }\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(InlineBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any): void {\n if (name === this.statics.blotName && !value) {\n this.children.forEach((child) => {\n if (!(child instanceof InlineBlot)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n this.attributes.copy(child as InlineBlot);\n });\n this.unwrap();\n } else {\n const format = this.scroll.query(name, Scope.INLINE);\n if (format == null) {\n return;\n }\n if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (\n this.formats()[name] != null ||\n this.scroll.query(name, Scope.ATTRIBUTE)\n ) {\n const blot = this.isolate(index, length) as InlineBlot;\n blot.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n const formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n const next = this.next;\n if (\n next instanceof InlineBlot &&\n next.prev === this &&\n isEqual(formats, next.formats())\n ) {\n next.moveChildren(this);\n next.remove();\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as InlineBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n (mutation) =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper = super.wrap(name, value);\n if (wrapper instanceof InlineBlot) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n }\n}\n\nexport default InlineBlot;\n", "import Attributor from '../attributor/attributor.js';\nimport AttributorStore from '../attributor/store.js';\nimport Scope from '../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Root,\n} from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\nimport ParentBlot from './abstract/parent.js';\nimport InlineBlot from './inline.js';\n\nclass BlockBlot extends ParentBlot implements Formattable {\n public static blotName = 'block';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName: string | string[] = 'P';\n public static allowedChildren: BlotConstructor[] = [\n InlineBlot,\n BlockBlot,\n LeafBlot,\n ];\n\n static create(value?: unknown) {\n return super.create(value) as HTMLElement;\n }\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(BlockBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any): void {\n const format = this.scroll.query(name, Scope.BLOCK);\n if (format == null) {\n return;\n } else if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (this.scroll.query(name, Scope.BLOCK) != null) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null || this.scroll.query(value, Scope.INLINE) != null) {\n // Insert text or inline\n super.insertAt(index, value, def);\n } else {\n const after = this.split(index);\n if (after != null) {\n const blot = this.scroll.create(value, def);\n after.parent.insertBefore(blot, after);\n } else {\n throw new Error('Attempt to insertAt after block boundaries');\n }\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as BlockBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n (mutation) =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n}\n\nexport default BlockBlot;\n", "import Scope from '../../scope.js';\nimport BlockBlot from '../block.js';\nimport ParentBlot from './parent.js';\n\nclass ContainerBlot extends ParentBlot {\n public static blotName = 'container';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName: string | string[];\n\n public prev!: BlockBlot | ContainerBlot | null;\n public next!: BlockBlot | ContainerBlot | null;\n\n public checkMerge(): boolean {\n return (\n this.next !== null && this.next.statics.blotName === this.statics.blotName\n );\n }\n\n public deleteAt(index: number, length: number): void {\n super.deleteAt(index, length);\n this.enforceAllowedChildren();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n super.formatAt(index, length, name, value);\n this.enforceAllowedChildren();\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n super.insertAt(index, value, def);\n this.enforceAllowedChildren();\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n if (this.children.length > 0 && this.next != null && this.checkMerge()) {\n this.next.moveChildren(this);\n this.next.remove();\n }\n }\n}\n\nexport default ContainerBlot;\n", "import type { Formattable, Root } from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\n\nclass EmbedBlot extends LeafBlot implements Formattable {\n public static formats(_domNode: HTMLElement, _scroll: Root): any {\n return undefined;\n }\n\n public format(name: string, value: any): void {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n super.formatAt(0, this.length(), name, value);\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n return this.statics.formats(this.domNode, this.scroll);\n }\n}\n\nexport default EmbedBlot;\n", "import Registry, { type RegistryDefinition } from '../registry.js';\nimport Scope from '../scope.js';\nimport type { Blot, BlotConstructor, Root } from './abstract/blot.js';\nimport ContainerBlot from './abstract/container.js';\nimport ParentBlot from './abstract/parent.js';\nimport BlockBlot from './block.js';\n\nconst OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\n\nconst MAX_OPTIMIZE_ITERATIONS = 100;\n\nclass ScrollBlot extends ParentBlot implements Root {\n public static blotName = 'scroll';\n public static defaultChild = BlockBlot;\n public static allowedChildren: BlotConstructor[] = [BlockBlot, ContainerBlot];\n public static scope = Scope.BLOCK_BLOT;\n public static tagName = 'DIV';\n\n public observer: MutationObserver;\n\n constructor(\n public registry: Registry,\n node: HTMLDivElement,\n ) {\n // @ts-expect-error scroll is the root with no parent\n super(null, node);\n this.scroll = this;\n this.build();\n this.observer = new MutationObserver((mutations: MutationRecord[]) => {\n this.update(mutations);\n });\n this.observer.observe(this.domNode, OBSERVER_CONFIG);\n this.attach();\n }\n\n public create(input: Node | string | Scope, value?: any): Blot {\n return this.registry.create(this, input, value);\n }\n\n public find(node: Node | null, bubble = false): Blot | null {\n const blot = this.registry.find(node, bubble);\n if (!blot) {\n return null;\n }\n if (blot.scroll === this) {\n return blot;\n }\n return bubble ? this.find(blot.scroll.domNode.parentNode, true) : null;\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): RegistryDefinition | null {\n return this.registry.query(query, scope);\n }\n\n public register(...definitions: RegistryDefinition[]) {\n return this.registry.register(...definitions);\n }\n\n public build(): void {\n if (this.scroll == null) {\n return;\n }\n super.build();\n }\n\n public detach(): void {\n super.detach();\n this.observer.disconnect();\n }\n\n public deleteAt(index: number, length: number): void {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach((child) => {\n child.remove();\n });\n } else {\n super.deleteAt(index, length);\n }\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.update();\n super.formatAt(index, length, name, value);\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n this.update();\n super.insertAt(index, value, def);\n }\n\n public optimize(context?: { [key: string]: any }): void;\n public optimize(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void;\n public optimize(mutations: any = [], context: any = {}): void {\n super.optimize(context);\n const mutationsMap = context.mutationsMap || new WeakMap();\n // We must modify mutations directly, cannot make copy and then modify\n let records = Array.from(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n const mark = (blot: Blot | null, markParent = true): void => {\n if (blot == null || blot === this) {\n return;\n }\n if (blot.domNode.parentNode == null) {\n return;\n }\n if (!mutationsMap.has(blot.domNode)) {\n mutationsMap.set(blot.domNode, []);\n }\n if (markParent) {\n mark(blot.parent);\n }\n };\n const optimize = (blot: Blot): void => {\n // Post-order traversal\n if (!mutationsMap.has(blot.domNode)) {\n return;\n }\n if (blot instanceof ParentBlot) {\n blot.children.forEach(optimize);\n }\n mutationsMap.delete(blot.domNode);\n blot.optimize(context);\n };\n let remaining = mutations;\n for (let i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach((mutation: MutationRecord) => {\n const blot = this.find(mutation.target, true);\n if (blot == null) {\n return;\n }\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(this.find(mutation.previousSibling, false));\n Array.from(mutation.addedNodes).forEach((node: Node) => {\n const child = this.find(node, false);\n mark(child, false);\n if (child instanceof ParentBlot) {\n child.children.forEach((grandChild: Blot) => {\n mark(grandChild, false);\n });\n }\n });\n } else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = Array.from(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n }\n }\n\n public update(\n mutations?: MutationRecord[],\n context: { [key: string]: any } = {},\n ): void {\n mutations = mutations || this.observer.takeRecords();\n const mutationsMap = new WeakMap();\n mutations\n .map((mutation: MutationRecord) => {\n const blot = this.find(mutation.target, true);\n if (blot == null) {\n return null;\n }\n if (mutationsMap.has(blot.domNode)) {\n mutationsMap.get(blot.domNode).push(mutation);\n return null;\n } else {\n mutationsMap.set(blot.domNode, [mutation]);\n return blot;\n }\n })\n .forEach((blot: Blot | null) => {\n if (blot != null && blot !== this && mutationsMap.has(blot.domNode)) {\n blot.update(mutationsMap.get(blot.domNode) || [], context);\n }\n });\n context.mutationsMap = mutationsMap;\n if (mutationsMap.has(this.domNode)) {\n super.update(mutationsMap.get(this.domNode), context);\n }\n this.optimize(mutations, context);\n }\n}\n\nexport default ScrollBlot;\n", "import Scope from '../scope.js';\nimport type { Blot, Leaf, Root } from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\n\nclass TextBlot extends LeafBlot implements Leaf {\n public static readonly blotName = 'text';\n public static scope = Scope.INLINE_BLOT;\n\n public static create(value: string): Text {\n return document.createTextNode(value);\n }\n\n public static value(domNode: Text): string {\n return domNode.data;\n }\n\n public domNode!: Text;\n protected text: string;\n\n constructor(scroll: Root, node: Node) {\n super(scroll, node);\n this.text = this.statics.value(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n this.domNode.data = this.text =\n this.text.slice(0, index) + this.text.slice(index + length);\n }\n\n public index(node: Node, offset: number): number {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n } else {\n super.insertAt(index, value, def);\n }\n }\n\n public length(): number {\n return this.text.length;\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n } else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), (this.next as TextBlot).value());\n this.next.remove();\n }\n }\n\n public position(index: number, _inclusive = false): [Node, number] {\n return [this.domNode, index];\n }\n\n public split(index: number, force = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.scroll.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next || undefined);\n this.text = this.statics.value(this.domNode);\n return after;\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n if (\n mutations.some((mutation) => {\n return (\n mutation.type === 'characterData' && mutation.target === this.domNode\n );\n })\n ) {\n this.text = this.statics.value(this.domNode);\n }\n }\n\n public value(): string {\n return this.text;\n }\n}\n\nexport default TextBlot;\n", "/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info\n * @param {boolean} [cleanup] Apply semantic cleanup before returning.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos, cleanup, _fix_unicode) {\n // Check for equality\n if (text1 === text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n if (cursor_pos != null) {\n var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);\n if (editdiff) {\n return editdiff;\n }\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs, _fix_unicode);\n if (cleanup) {\n diff_cleanupSemantic(diffs);\n }\n return diffs;\n}\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i !== -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [\n [DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)],\n ];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length === 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [\n [DIFF_DELETE, text1],\n [DIFF_INSERT, text2],\n ];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n}\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = delta % 2 !== 0;\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (\n x1 < text1_length &&\n y1 < text2_length &&\n text1.charAt(x1) === text2.charAt(y1)\n ) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (\n x2 < text1_length &&\n y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ===\n text2.charAt(text2_length - y2 - 1)\n ) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [\n [DIFF_DELETE, text1],\n [DIFF_INSERT, text2],\n ];\n}\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n}\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)\n ) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {\n pointermid--;\n }\n\n return pointermid;\n}\n\n/**\n * Determine if the suffix of one string is the prefix of another.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of the first\n * string and the start of the second string.\n * @private\n */\nfunction diff_commonOverlap_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n // Eliminate the null case.\n if (text1_length == 0 || text2_length == 0) {\n return 0;\n }\n // Truncate the longer string.\n if (text1_length > text2_length) {\n text1 = text1.substring(text1_length - text2_length);\n } else if (text1_length < text2_length) {\n text2 = text2.substring(0, text1_length);\n }\n var text_length = Math.min(text1_length, text2_length);\n // Quick check for the worst case.\n if (text1 == text2) {\n return text_length;\n }\n\n // Start by looking for a single character match\n // and increase length until no match is found.\n // Performance analysis: http://neil.fraser.name/news/2010/11/04/\n var best = 0;\n var length = 1;\n while (true) {\n var pattern = text1.substring(text_length - length);\n var found = text2.indexOf(pattern);\n if (found == -1) {\n return best;\n }\n length += found;\n if (\n found == 0 ||\n text1.substring(text_length - length) == text2.substring(0, length)\n ) {\n best = length;\n length++;\n }\n }\n}\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)\n ) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {\n pointermid--;\n }\n\n return pointermid;\n}\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = \"\";\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {\n var prefixLength = diff_commonPrefix(\n longtext.substring(i),\n shorttext.substring(j)\n );\n var suffixLength = diff_commonSuffix(\n longtext.substring(0, i),\n shorttext.substring(0, j)\n );\n if (best_common.length < suffixLength + prefixLength) {\n best_common =\n shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [\n best_longtext_a,\n best_longtext_b,\n best_shorttext_a,\n best_shorttext_b,\n best_common,\n ];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(\n longtext,\n shorttext,\n Math.ceil(longtext.length / 4)\n );\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(\n longtext,\n shorttext,\n Math.ceil(longtext.length / 2)\n );\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n}\n\n/**\n * Reduce the number of edits by eliminating semantically trivial equalities.\n * @param {!Array.} diffs Array of diff tuples.\n */\nfunction diff_cleanupSemantic(diffs) {\n var changes = false;\n var equalities = []; // Stack of indices where equalities are found.\n var equalitiesLength = 0; // Keeping our own length var is faster in JS.\n /** @type {?string} */\n var lastequality = null;\n // Always equal to diffs[equalities[equalitiesLength - 1]][1]\n var pointer = 0; // Index of current position.\n // Number of characters that changed prior to the equality.\n var length_insertions1 = 0;\n var length_deletions1 = 0;\n // Number of characters that changed after the equality.\n var length_insertions2 = 0;\n var length_deletions2 = 0;\n while (pointer < diffs.length) {\n if (diffs[pointer][0] == DIFF_EQUAL) {\n // Equality found.\n equalities[equalitiesLength++] = pointer;\n length_insertions1 = length_insertions2;\n length_deletions1 = length_deletions2;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastequality = diffs[pointer][1];\n } else {\n // An insertion or deletion.\n if (diffs[pointer][0] == DIFF_INSERT) {\n length_insertions2 += diffs[pointer][1].length;\n } else {\n length_deletions2 += diffs[pointer][1].length;\n }\n // Eliminate an equality that is smaller or equal to the edits on both\n // sides of it.\n if (\n lastequality &&\n lastequality.length <=\n Math.max(length_insertions1, length_deletions1) &&\n lastequality.length <= Math.max(length_insertions2, length_deletions2)\n ) {\n // Duplicate record.\n diffs.splice(equalities[equalitiesLength - 1], 0, [\n DIFF_DELETE,\n lastequality,\n ]);\n // Change second copy to insert.\n diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;\n // Throw away the equality we just deleted.\n equalitiesLength--;\n // Throw away the previous equality (it needs to be reevaluated).\n equalitiesLength--;\n pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;\n length_insertions1 = 0; // Reset the counters.\n length_deletions1 = 0;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastequality = null;\n changes = true;\n }\n }\n pointer++;\n }\n\n // Normalize the diff.\n if (changes) {\n diff_cleanupMerge(diffs);\n }\n diff_cleanupSemanticLossless(diffs);\n\n // Find any overlaps between deletions and insertions.\n // e.g: abcxxxxxxdef\n // -> abcxxxdef\n // e.g: xxxabcdefxxx\n // -> defxxxabc\n // Only extract an overlap if it is as big as the edit ahead or behind it.\n pointer = 1;\n while (pointer < diffs.length) {\n if (\n diffs[pointer - 1][0] == DIFF_DELETE &&\n diffs[pointer][0] == DIFF_INSERT\n ) {\n var deletion = diffs[pointer - 1][1];\n var insertion = diffs[pointer][1];\n var overlap_length1 = diff_commonOverlap_(deletion, insertion);\n var overlap_length2 = diff_commonOverlap_(insertion, deletion);\n if (overlap_length1 >= overlap_length2) {\n if (\n overlap_length1 >= deletion.length / 2 ||\n overlap_length1 >= insertion.length / 2\n ) {\n // Overlap found. Insert an equality and trim the surrounding edits.\n diffs.splice(pointer, 0, [\n DIFF_EQUAL,\n insertion.substring(0, overlap_length1),\n ]);\n diffs[pointer - 1][1] = deletion.substring(\n 0,\n deletion.length - overlap_length1\n );\n diffs[pointer + 1][1] = insertion.substring(overlap_length1);\n pointer++;\n }\n } else {\n if (\n overlap_length2 >= deletion.length / 2 ||\n overlap_length2 >= insertion.length / 2\n ) {\n // Reverse overlap found.\n // Insert an equality and swap and trim the surrounding edits.\n diffs.splice(pointer, 0, [\n DIFF_EQUAL,\n deletion.substring(0, overlap_length2),\n ]);\n diffs[pointer - 1][0] = DIFF_INSERT;\n diffs[pointer - 1][1] = insertion.substring(\n 0,\n insertion.length - overlap_length2\n );\n diffs[pointer + 1][0] = DIFF_DELETE;\n diffs[pointer + 1][1] = deletion.substring(overlap_length2);\n pointer++;\n }\n }\n pointer++;\n }\n pointer++;\n }\n}\n\nvar nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/;\nvar whitespaceRegex_ = /\\s/;\nvar linebreakRegex_ = /[\\r\\n]/;\nvar blanklineEndRegex_ = /\\n\\r?\\n$/;\nvar blanklineStartRegex_ = /^\\r?\\n\\r?\\n/;\n\n/**\n * Look for single edits surrounded on both sides by equalities\n * which can be shifted sideways to align the edit to a word boundary.\n * e.g: The cat came. -> The cat came.\n * @param {!Array.} diffs Array of diff tuples.\n */\nfunction diff_cleanupSemanticLossless(diffs) {\n /**\n * Given two strings, compute a score representing whether the internal\n * boundary falls on logical boundaries.\n * Scores range from 6 (best) to 0 (worst).\n * Closure, but does not reference any external variables.\n * @param {string} one First string.\n * @param {string} two Second string.\n * @return {number} The score.\n * @private\n */\n function diff_cleanupSemanticScore_(one, two) {\n if (!one || !two) {\n // Edges are the best.\n return 6;\n }\n\n // Each port of this function behaves slightly differently due to\n // subtle differences in each language's definition of things like\n // 'whitespace'. Since this function's purpose is largely cosmetic,\n // the choice has been made to use each language's native features\n // rather than force total conformity.\n var char1 = one.charAt(one.length - 1);\n var char2 = two.charAt(0);\n var nonAlphaNumeric1 = char1.match(nonAlphaNumericRegex_);\n var nonAlphaNumeric2 = char2.match(nonAlphaNumericRegex_);\n var whitespace1 = nonAlphaNumeric1 && char1.match(whitespaceRegex_);\n var whitespace2 = nonAlphaNumeric2 && char2.match(whitespaceRegex_);\n var lineBreak1 = whitespace1 && char1.match(linebreakRegex_);\n var lineBreak2 = whitespace2 && char2.match(linebreakRegex_);\n var blankLine1 = lineBreak1 && one.match(blanklineEndRegex_);\n var blankLine2 = lineBreak2 && two.match(blanklineStartRegex_);\n\n if (blankLine1 || blankLine2) {\n // Five points for blank lines.\n return 5;\n } else if (lineBreak1 || lineBreak2) {\n // Four points for line breaks.\n return 4;\n } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {\n // Three points for end of sentences.\n return 3;\n } else if (whitespace1 || whitespace2) {\n // Two points for whitespace.\n return 2;\n } else if (nonAlphaNumeric1 || nonAlphaNumeric2) {\n // One point for non-alphanumeric.\n return 1;\n }\n return 0;\n }\n\n var pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (\n diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL\n ) {\n // This is a single edit surrounded by equalities.\n var equality1 = diffs[pointer - 1][1];\n var edit = diffs[pointer][1];\n var equality2 = diffs[pointer + 1][1];\n\n // First, shift the edit as far left as possible.\n var commonOffset = diff_commonSuffix(equality1, edit);\n if (commonOffset) {\n var commonString = edit.substring(edit.length - commonOffset);\n equality1 = equality1.substring(0, equality1.length - commonOffset);\n edit = commonString + edit.substring(0, edit.length - commonOffset);\n equality2 = commonString + equality2;\n }\n\n // Second, step character by character right, looking for the best fit.\n var bestEquality1 = equality1;\n var bestEdit = edit;\n var bestEquality2 = equality2;\n var bestScore =\n diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n while (edit.charAt(0) === equality2.charAt(0)) {\n equality1 += edit.charAt(0);\n edit = edit.substring(1) + equality2.charAt(0);\n equality2 = equality2.substring(1);\n var score =\n diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n // The >= encourages trailing rather than leading whitespace on edits.\n if (score >= bestScore) {\n bestScore = score;\n bestEquality1 = equality1;\n bestEdit = edit;\n bestEquality2 = equality2;\n }\n }\n\n if (diffs[pointer - 1][1] != bestEquality1) {\n // We have an improvement, save it back to the diff.\n if (bestEquality1) {\n diffs[pointer - 1][1] = bestEquality1;\n } else {\n diffs.splice(pointer - 1, 1);\n pointer--;\n }\n diffs[pointer][1] = bestEdit;\n if (bestEquality2) {\n diffs[pointer + 1][1] = bestEquality2;\n } else {\n diffs.splice(pointer + 1, 1);\n pointer--;\n }\n }\n }\n pointer++;\n }\n}\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff\n */\nfunction diff_cleanupMerge(diffs, fix_unicode) {\n diffs.push([DIFF_EQUAL, \"\"]); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = \"\";\n var text_insert = \"\";\n var commonlength;\n while (pointer < diffs.length) {\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n diffs.splice(pointer, 1);\n continue;\n }\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n var previous_equality = pointer - count_insert - count_delete - 1;\n if (fix_unicode) {\n // prevent splitting of unicode surrogate pairs. when fix_unicode is true,\n // we assume that the old and new text in the diff are complete and correct\n // unicode-encoded JS strings, but the tuple boundaries may fall between\n // surrogate pairs. we fix this by shaving off stray surrogates from the end\n // of the previous equality and the beginning of this equality. this may create\n // empty equalities or a common prefix or suffix. for example, if AB and AC are\n // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and\n // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this\n // particular case, both equalities go away, we absorb any previous inequalities,\n // and we keep scanning for the next equality before rewriting the tuples.\n if (\n previous_equality >= 0 &&\n ends_with_pair_start(diffs[previous_equality][1])\n ) {\n var stray = diffs[previous_equality][1].slice(-1);\n diffs[previous_equality][1] = diffs[previous_equality][1].slice(\n 0,\n -1\n );\n text_delete = stray + text_delete;\n text_insert = stray + text_insert;\n if (!diffs[previous_equality][1]) {\n // emptied out previous equality, so delete it and include previous delete/insert\n diffs.splice(previous_equality, 1);\n pointer--;\n var k = previous_equality - 1;\n if (diffs[k] && diffs[k][0] === DIFF_INSERT) {\n count_insert++;\n text_insert = diffs[k][1] + text_insert;\n k--;\n }\n if (diffs[k] && diffs[k][0] === DIFF_DELETE) {\n count_delete++;\n text_delete = diffs[k][1] + text_delete;\n k--;\n }\n previous_equality = k;\n }\n }\n if (starts_with_pair_end(diffs[pointer][1])) {\n var stray = diffs[pointer][1].charAt(0);\n diffs[pointer][1] = diffs[pointer][1].slice(1);\n text_delete += stray;\n text_insert += stray;\n }\n }\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n // for empty equality not at end, wait for next equality\n diffs.splice(pointer, 1);\n break;\n }\n if (text_delete.length > 0 || text_insert.length > 0) {\n // note that diff_commonPrefix and diff_commonSuffix are unicode-aware\n if (text_delete.length > 0 && text_insert.length > 0) {\n // Factor out any common prefixes.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if (previous_equality >= 0) {\n diffs[previous_equality][1] += text_insert.substring(\n 0,\n commonlength\n );\n } else {\n diffs.splice(0, 0, [\n DIFF_EQUAL,\n text_insert.substring(0, commonlength),\n ]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixes.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] =\n text_insert.substring(text_insert.length - commonlength) +\n diffs[pointer][1];\n text_insert = text_insert.substring(\n 0,\n text_insert.length - commonlength\n );\n text_delete = text_delete.substring(\n 0,\n text_delete.length - commonlength\n );\n }\n }\n // Delete the offending records and add the merged ones.\n var n = count_insert + count_delete;\n if (text_delete.length === 0 && text_insert.length === 0) {\n diffs.splice(pointer - n, n);\n pointer = pointer - n;\n } else if (text_delete.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 1;\n } else if (text_insert.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);\n pointer = pointer - n + 1;\n } else {\n diffs.splice(\n pointer - n,\n n,\n [DIFF_DELETE, text_delete],\n [DIFF_INSERT, text_insert]\n );\n pointer = pointer - n + 2;\n }\n }\n if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = \"\";\n text_insert = \"\";\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === \"\") {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (\n diffs[pointer - 1][0] === DIFF_EQUAL &&\n diffs[pointer + 1][0] === DIFF_EQUAL\n ) {\n // This is a single edit surrounded by equalities.\n if (\n diffs[pointer][1].substring(\n diffs[pointer][1].length - diffs[pointer - 1][1].length\n ) === diffs[pointer - 1][1]\n ) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] =\n diffs[pointer - 1][1] +\n diffs[pointer][1].substring(\n 0,\n diffs[pointer][1].length - diffs[pointer - 1][1].length\n );\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (\n diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]\n ) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs, fix_unicode);\n }\n}\n\nfunction is_surrogate_pair_start(charCode) {\n return charCode >= 0xd800 && charCode <= 0xdbff;\n}\n\nfunction is_surrogate_pair_end(charCode) {\n return charCode >= 0xdc00 && charCode <= 0xdfff;\n}\n\nfunction starts_with_pair_end(str) {\n return is_surrogate_pair_end(str.charCodeAt(0));\n}\n\nfunction ends_with_pair_start(str) {\n return is_surrogate_pair_start(str.charCodeAt(str.length - 1));\n}\n\nfunction remove_empty_tuples(tuples) {\n var ret = [];\n for (var i = 0; i < tuples.length; i++) {\n if (tuples[i][1].length > 0) {\n ret.push(tuples[i]);\n }\n }\n return ret;\n}\n\nfunction make_edit_splice(before, oldMiddle, newMiddle, after) {\n if (ends_with_pair_start(before) || starts_with_pair_end(after)) {\n return null;\n }\n return remove_empty_tuples([\n [DIFF_EQUAL, before],\n [DIFF_DELETE, oldMiddle],\n [DIFF_INSERT, newMiddle],\n [DIFF_EQUAL, after],\n ]);\n}\n\nfunction find_cursor_edit_diff(oldText, newText, cursor_pos) {\n // note: this runs after equality check has ruled out exact equality\n var oldRange =\n typeof cursor_pos === \"number\"\n ? { index: cursor_pos, length: 0 }\n : cursor_pos.oldRange;\n var newRange = typeof cursor_pos === \"number\" ? null : cursor_pos.newRange;\n // take into account the old and new selection to generate the best diff\n // possible for a text edit. for example, a text change from \"xxx\" to \"xx\"\n // could be a delete or forwards-delete of any one of the x's, or the\n // result of selecting two of the x's and typing \"x\".\n var oldLength = oldText.length;\n var newLength = newText.length;\n if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {\n // see if we have an insert or delete before or after cursor\n var oldCursor = oldRange.index;\n var oldBefore = oldText.slice(0, oldCursor);\n var oldAfter = oldText.slice(oldCursor);\n var maybeNewCursor = newRange ? newRange.index : null;\n editBefore: {\n // is this an insert or delete right before oldCursor?\n var newCursor = oldCursor + newLength - oldLength;\n if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {\n break editBefore;\n }\n if (newCursor < 0 || newCursor > newLength) {\n break editBefore;\n }\n var newBefore = newText.slice(0, newCursor);\n var newAfter = newText.slice(newCursor);\n if (newAfter !== oldAfter) {\n break editBefore;\n }\n var prefixLength = Math.min(oldCursor, newCursor);\n var oldPrefix = oldBefore.slice(0, prefixLength);\n var newPrefix = newBefore.slice(0, prefixLength);\n if (oldPrefix !== newPrefix) {\n break editBefore;\n }\n var oldMiddle = oldBefore.slice(prefixLength);\n var newMiddle = newBefore.slice(prefixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);\n }\n editAfter: {\n // is this an insert or delete right after oldCursor?\n if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {\n break editAfter;\n }\n var cursor = oldCursor;\n var newBefore = newText.slice(0, cursor);\n var newAfter = newText.slice(cursor);\n if (newBefore !== oldBefore) {\n break editAfter;\n }\n var suffixLength = Math.min(oldLength - cursor, newLength - cursor);\n var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);\n var newSuffix = newAfter.slice(newAfter.length - suffixLength);\n if (oldSuffix !== newSuffix) {\n break editAfter;\n }\n var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);\n var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);\n return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);\n }\n }\n if (oldRange.length > 0 && newRange && newRange.length === 0) {\n replaceRange: {\n // see if diff could be a splice of the old selection range\n var oldPrefix = oldText.slice(0, oldRange.index);\n var oldSuffix = oldText.slice(oldRange.index + oldRange.length);\n var prefixLength = oldPrefix.length;\n var suffixLength = oldSuffix.length;\n if (newLength < prefixLength + suffixLength) {\n break replaceRange;\n }\n var newPrefix = newText.slice(0, prefixLength);\n var newSuffix = newText.slice(newLength - suffixLength);\n if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {\n break replaceRange;\n }\n var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);\n var newMiddle = newText.slice(prefixLength, newLength - suffixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);\n }\n }\n\n return null;\n}\n\nfunction diff(text1, text2, cursor_pos, cleanup) {\n // only pass fix_unicode=true at the top level, not when diff_main is\n // recursively invoked\n return diff_main(text1, text2, cursor_pos, cleanup, true);\n}\n\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n", "/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, true, true);\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = cloneDeep;\n", "/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n", "import cloneDeep = require('lodash.clonedeep');\nimport isEqual = require('lodash.isequal');\n\ninterface AttributeMap {\n [key: string]: unknown;\n}\n\nnamespace AttributeMap {\n export function compose(\n a: AttributeMap = {},\n b: AttributeMap = {},\n keepNull = false,\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n let attributes = cloneDeep(b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce((copy, key) => {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (const key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n\n export function diff(\n a: AttributeMap = {},\n b: AttributeMap = {},\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n const attributes = Object.keys(a)\n .concat(Object.keys(b))\n .reduce((attrs, key) => {\n if (!isEqual(a[key], b[key])) {\n attrs[key] = b[key] === undefined ? null : b[key];\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n\n export function invert(\n attr: AttributeMap = {},\n base: AttributeMap = {},\n ): AttributeMap {\n attr = attr || {};\n const baseInverted = Object.keys(base).reduce((memo, key) => {\n if (base[key] !== attr[key] && attr[key] !== undefined) {\n memo[key] = base[key];\n }\n return memo;\n }, {});\n return Object.keys(attr).reduce((memo, key) => {\n if (attr[key] !== base[key] && base[key] === undefined) {\n memo[key] = null;\n }\n return memo;\n }, baseInverted);\n }\n\n export function transform(\n a: AttributeMap | undefined,\n b: AttributeMap | undefined,\n priority = false,\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n return b;\n }\n if (typeof b !== 'object') {\n return undefined;\n }\n if (!priority) {\n return b; // b simply overwrites us without priority\n }\n const attributes = Object.keys(b).reduce((attrs, key) => {\n if (a[key] === undefined) {\n attrs[key] = b[key]; // null is a valid value\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n}\n\nexport default AttributeMap;\n", "import AttributeMap from './AttributeMap';\n\ninterface Op {\n // only one property out of {insert, delete, retain} will be present\n insert?: string | Record;\n delete?: number;\n retain?: number | Record;\n\n attributes?: AttributeMap;\n}\n\nnamespace Op {\n export function length(op: Op): number {\n if (typeof op.delete === 'number') {\n return op.delete;\n } else if (typeof op.retain === 'number') {\n return op.retain;\n } else if (typeof op.retain === 'object' && op.retain !== null) {\n return 1;\n } else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n}\n\nexport default Op;\n", "import Op from './Op';\n\nexport default class Iterator {\n ops: Op[];\n index: number;\n offset: number;\n\n constructor(ops: Op[]) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n }\n\n hasNext(): boolean {\n return this.peekLength() < Infinity;\n }\n\n next(length?: number): Op {\n if (!length) {\n length = Infinity;\n }\n const nextOp = this.ops[this.index];\n if (nextOp) {\n const offset = this.offset;\n const opLength = Op.length(nextOp);\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n } else {\n this.offset += length;\n }\n if (typeof nextOp.delete === 'number') {\n return { delete: length };\n } else {\n const retOp: Op = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n } else if (\n typeof nextOp.retain === 'object' &&\n nextOp.retain !== null\n ) {\n // offset should === 0, length should === 1\n retOp.retain = nextOp.retain;\n } else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n } else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n } else {\n return { retain: Infinity };\n }\n }\n\n peek(): Op {\n return this.ops[this.index];\n }\n\n peekLength(): number {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return Op.length(this.ops[this.index]) - this.offset;\n } else {\n return Infinity;\n }\n }\n\n peekType(): string {\n const op = this.ops[this.index];\n if (op) {\n if (typeof op.delete === 'number') {\n return 'delete';\n } else if (\n typeof op.retain === 'number' ||\n (typeof op.retain === 'object' && op.retain !== null)\n ) {\n return 'retain';\n } else {\n return 'insert';\n }\n }\n return 'retain';\n }\n\n rest(): Op[] {\n if (!this.hasNext()) {\n return [];\n } else if (this.offset === 0) {\n return this.ops.slice(this.index);\n } else {\n const offset = this.offset;\n const index = this.index;\n const next = this.next();\n const rest = this.ops.slice(this.index);\n this.offset = offset;\n this.index = index;\n return [next].concat(rest);\n }\n }\n}\n", "import * as diff from 'fast-diff';\nimport cloneDeep = require('lodash.clonedeep');\nimport isEqual = require('lodash.isequal');\nimport AttributeMap from './AttributeMap';\nimport Op from './Op';\nimport OpIterator from './OpIterator';\n\nconst NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\ninterface EmbedHandler {\n compose(a: T, b: T, keepNull: boolean): T;\n invert(a: T, b: T): T;\n transform(a: T, b: T, priority: boolean): T;\n}\n\nconst getEmbedTypeAndData = (\n a: Op['insert'] | Op['retain'],\n b: Op['insert'],\n): [string, unknown, unknown] => {\n if (typeof a !== 'object' || a === null) {\n throw new Error(`cannot retain a ${typeof a}`);\n }\n if (typeof b !== 'object' || b === null) {\n throw new Error(`cannot retain a ${typeof b}`);\n }\n const embedType = Object.keys(a)[0];\n if (!embedType || embedType !== Object.keys(b)[0]) {\n throw new Error(\n `embed types not matched: ${embedType} != ${Object.keys(b)[0]}`,\n );\n }\n return [embedType, a[embedType], b[embedType]];\n};\n\nclass Delta {\n static Op = Op;\n static OpIterator = OpIterator;\n static AttributeMap = AttributeMap;\n private static handlers: { [embedType: string]: EmbedHandler } = {};\n\n static registerEmbed(embedType: string, handler: EmbedHandler): void {\n this.handlers[embedType] = handler;\n }\n\n static unregisterEmbed(embedType: string): void {\n delete this.handlers[embedType];\n }\n\n private static getHandler(embedType: string): EmbedHandler {\n const handler = this.handlers[embedType];\n if (!handler) {\n throw new Error(`no handlers for embed type \"${embedType}\"`);\n }\n return handler;\n }\n\n ops: Op[];\n constructor(ops?: Op[] | { ops: Op[] }) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n } else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n } else {\n this.ops = [];\n }\n }\n\n insert(\n arg: string | Record,\n attributes?: AttributeMap | null,\n ): this {\n const newOp: Op = {};\n if (typeof arg === 'string' && arg.length === 0) {\n return this;\n }\n newOp.insert = arg;\n if (\n attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0\n ) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n }\n\n delete(length: number): this {\n if (length <= 0) {\n return this;\n }\n return this.push({ delete: length });\n }\n\n retain(\n length: number | Record,\n attributes?: AttributeMap | null,\n ): this {\n if (typeof length === 'number' && length <= 0) {\n return this;\n }\n const newOp: Op = { retain: length };\n if (\n attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0\n ) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n }\n\n push(newOp: Op): this {\n let index = this.ops.length;\n let lastOp = this.ops[index - 1];\n newOp = cloneDeep(newOp);\n if (typeof lastOp === 'object') {\n if (\n typeof newOp.delete === 'number' &&\n typeof lastOp.delete === 'number'\n ) {\n this.ops[index - 1] = { delete: lastOp.delete + newOp.delete };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp.delete === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (isEqual(newOp.attributes, lastOp.attributes)) {\n if (\n typeof newOp.insert === 'string' &&\n typeof lastOp.insert === 'string'\n ) {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n } else if (\n typeof newOp.retain === 'number' &&\n typeof lastOp.retain === 'number'\n ) {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n } else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n }\n\n chop(): this {\n const lastOp = this.ops[this.ops.length - 1];\n if (lastOp && typeof lastOp.retain === 'number' && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n }\n\n filter(predicate: (op: Op, index: number) => boolean): Op[] {\n return this.ops.filter(predicate);\n }\n\n forEach(predicate: (op: Op, index: number) => void): void {\n this.ops.forEach(predicate);\n }\n\n map(predicate: (op: Op, index: number) => T): T[] {\n return this.ops.map(predicate);\n }\n\n partition(predicate: (op: Op) => boolean): [Op[], Op[]] {\n const passed: Op[] = [];\n const failed: Op[] = [];\n this.forEach((op) => {\n const target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n }\n\n reduce(\n predicate: (accum: T, curr: Op, index: number) => T,\n initialValue: T,\n ): T {\n return this.ops.reduce(predicate, initialValue);\n }\n\n changeLength(): number {\n return this.reduce((length, elem) => {\n if (elem.insert) {\n return length + Op.length(elem);\n } else if (elem.delete) {\n return length - elem.delete;\n }\n return length;\n }, 0);\n }\n\n length(): number {\n return this.reduce((length, elem) => {\n return length + Op.length(elem);\n }, 0);\n }\n\n slice(start = 0, end = Infinity): Delta {\n const ops = [];\n const iter = new OpIterator(this.ops);\n let index = 0;\n while (index < end && iter.hasNext()) {\n let nextOp;\n if (index < start) {\n nextOp = iter.next(start - index);\n } else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += Op.length(nextOp);\n }\n return new Delta(ops);\n }\n\n compose(other: Delta): Delta {\n const thisIter = new OpIterator(this.ops);\n const otherIter = new OpIterator(other.ops);\n const ops = [];\n const firstOther = otherIter.peek();\n if (\n firstOther != null &&\n typeof firstOther.retain === 'number' &&\n firstOther.attributes == null\n ) {\n let firstLeft = firstOther.retain;\n while (\n thisIter.peekType() === 'insert' &&\n thisIter.peekLength() <= firstLeft\n ) {\n firstLeft -= thisIter.peekLength();\n ops.push(thisIter.next());\n }\n if (firstOther.retain - firstLeft > 0) {\n otherIter.next(firstOther.retain - firstLeft);\n }\n }\n const delta = new Delta(ops);\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n } else {\n const length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n const thisOp = thisIter.next(length);\n const otherOp = otherIter.next(length);\n if (otherOp.retain) {\n const newOp: Op = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain =\n typeof otherOp.retain === 'number' ? length : otherOp.retain;\n } else {\n if (typeof otherOp.retain === 'number') {\n if (thisOp.retain == null) {\n newOp.insert = thisOp.insert;\n } else {\n newOp.retain = thisOp.retain;\n }\n } else {\n const action = thisOp.retain == null ? 'insert' : 'retain';\n const [embedType, thisData, otherData] = getEmbedTypeAndData(\n thisOp[action],\n otherOp.retain,\n );\n const handler = Delta.getHandler(embedType);\n newOp[action] = {\n [embedType]: handler.compose(\n thisData,\n otherData,\n action === 'retain',\n ),\n };\n }\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n const attributes = AttributeMap.compose(\n thisOp.attributes,\n otherOp.attributes,\n typeof thisOp.retain === 'number',\n );\n if (attributes) {\n newOp.attributes = attributes;\n }\n delta.push(newOp);\n\n // Optimization if rest of other is just retain\n if (\n !otherIter.hasNext() &&\n isEqual(delta.ops[delta.ops.length - 1], newOp)\n ) {\n const rest = new Delta(thisIter.rest());\n return delta.concat(rest).chop();\n }\n\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n } else if (\n typeof otherOp.delete === 'number' &&\n (typeof thisOp.retain === 'number' ||\n (typeof thisOp.retain === 'object' && thisOp.retain !== null))\n ) {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n }\n\n concat(other: Delta): Delta {\n const delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n }\n\n diff(other: Delta, cursor?: number | diff.CursorInfo): Delta {\n if (this.ops === other.ops) {\n return new Delta();\n }\n const strings = [this, other].map((delta) => {\n return delta\n .map((op) => {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n const prep = delta === other ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n })\n .join('');\n });\n const retDelta = new Delta();\n const diffResult = diff(strings[0], strings[1], cursor, true);\n const thisIter = new OpIterator(this.ops);\n const otherIter = new OpIterator(other.ops);\n diffResult.forEach((component: diff.Diff) => {\n let length = component[1].length;\n while (length > 0) {\n let opLength = 0;\n switch (component[0]) {\n case diff.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n retDelta.push(otherIter.next(opLength));\n break;\n case diff.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n retDelta.delete(opLength);\n break;\n case diff.EQUAL:\n opLength = Math.min(\n thisIter.peekLength(),\n otherIter.peekLength(),\n length,\n );\n const thisOp = thisIter.next(opLength);\n const otherOp = otherIter.next(opLength);\n if (isEqual(thisOp.insert, otherOp.insert)) {\n retDelta.retain(\n opLength,\n AttributeMap.diff(thisOp.attributes, otherOp.attributes),\n );\n } else {\n retDelta.push(otherOp).delete(opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return retDelta.chop();\n }\n\n eachLine(\n predicate: (\n line: Delta,\n attributes: AttributeMap,\n index: number,\n ) => boolean | void,\n newline = '\\n',\n ): void {\n const iter = new OpIterator(this.ops);\n let line = new Delta();\n let i = 0;\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') {\n return;\n }\n const thisOp = iter.peek();\n const start = Op.length(thisOp) - iter.peekLength();\n const index =\n typeof thisOp.insert === 'string'\n ? thisOp.insert.indexOf(newline, start) - start\n : -1;\n if (index < 0) {\n line.push(iter.next());\n } else if (index > 0) {\n line.push(iter.next(index));\n } else {\n if (predicate(line, iter.next(1).attributes || {}, i) === false) {\n return;\n }\n i += 1;\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {}, i);\n }\n }\n\n invert(base: Delta): Delta {\n const inverted = new Delta();\n this.reduce((baseIndex, op) => {\n if (op.insert) {\n inverted.delete(Op.length(op));\n } else if (typeof op.retain === 'number' && op.attributes == null) {\n inverted.retain(op.retain);\n return baseIndex + op.retain;\n } else if (op.delete || typeof op.retain === 'number') {\n const length = (op.delete || op.retain) as number;\n const slice = base.slice(baseIndex, baseIndex + length);\n slice.forEach((baseOp) => {\n if (op.delete) {\n inverted.push(baseOp);\n } else if (op.retain && op.attributes) {\n inverted.retain(\n Op.length(baseOp),\n AttributeMap.invert(op.attributes, baseOp.attributes),\n );\n }\n });\n return baseIndex + length;\n } else if (typeof op.retain === 'object' && op.retain !== null) {\n const slice = base.slice(baseIndex, baseIndex + 1);\n const baseOp = new OpIterator(slice.ops).next();\n const [embedType, opData, baseOpData] = getEmbedTypeAndData(\n op.retain,\n baseOp.insert,\n );\n const handler = Delta.getHandler(embedType);\n inverted.retain(\n { [embedType]: handler.invert(opData, baseOpData) },\n AttributeMap.invert(op.attributes, baseOp.attributes),\n );\n return baseIndex + 1;\n }\n return baseIndex;\n }, 0);\n return inverted.chop();\n }\n\n transform(index: number, priority?: boolean): number;\n transform(other: Delta, priority?: boolean): Delta;\n transform(arg: number | Delta, priority = false): typeof arg {\n priority = !!priority;\n if (typeof arg === 'number') {\n return this.transformPosition(arg, priority);\n }\n const other: Delta = arg;\n const thisIter = new OpIterator(this.ops);\n const otherIter = new OpIterator(other.ops);\n const delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (\n thisIter.peekType() === 'insert' &&\n (priority || otherIter.peekType() !== 'insert')\n ) {\n delta.retain(Op.length(thisIter.next()));\n } else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else {\n const length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n const thisOp = thisIter.next(length);\n const otherOp = otherIter.next(length);\n if (thisOp.delete) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n } else if (otherOp.delete) {\n delta.push(otherOp);\n } else {\n const thisData = thisOp.retain;\n const otherData = otherOp.retain;\n let transformedData: Op['retain'] =\n typeof otherData === 'object' && otherData !== null\n ? otherData\n : length;\n if (\n typeof thisData === 'object' &&\n thisData !== null &&\n typeof otherData === 'object' &&\n otherData !== null\n ) {\n const embedType = Object.keys(thisData)[0];\n if (embedType === Object.keys(otherData)[0]) {\n const handler = Delta.getHandler(embedType);\n if (handler) {\n transformedData = {\n [embedType]: handler.transform(\n thisData[embedType],\n otherData[embedType],\n priority,\n ),\n };\n }\n }\n }\n\n // We retain either their retain or insert\n delta.retain(\n transformedData,\n AttributeMap.transform(\n thisOp.attributes,\n otherOp.attributes,\n priority,\n ),\n );\n }\n }\n }\n return delta.chop();\n }\n\n transformPosition(index: number, priority = false): number {\n priority = !!priority;\n const thisIter = new OpIterator(this.ops);\n let offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n const length = thisIter.peekLength();\n const nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length, index - offset);\n continue;\n } else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length;\n }\n offset += length;\n }\n return index;\n }\n}\n\nexport default Delta;\n\nexport { Op, OpIterator, AttributeMap };\n\nif (typeof module === 'object') {\n module.exports = Delta;\n module.exports.default = Delta;\n}\n", "import { EmbedBlot } from 'parchment';\n\nclass Break extends EmbedBlot {\n static value() {\n return undefined;\n }\n\n optimize() {\n if (this.prev || this.next) {\n this.remove();\n }\n }\n\n length() {\n return 0;\n }\n\n value() {\n return '';\n }\n}\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\nexport default Break;\n", "import { TextBlot } from 'parchment';\n\nclass Text extends TextBlot {}\n\nfunction escapeText(text: string) {\n return text.replace(/[&<>\"']/g, (s) => {\n // https://lodash.com/docs#escape\n const entityMap: Record = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n };\n return entityMap[s];\n });\n}\n\nexport { Text as default, escapeText };\n", "import { EmbedBlot, InlineBlot, Scope } from 'parchment';\nimport type { BlotConstructor } from 'parchment';\nimport Break from './break.js';\nimport Text from './text.js';\n\nclass Inline extends InlineBlot {\n static allowedChildren: BlotConstructor[] = [Inline, Break, EmbedBlot, Text];\n // Lower index means deeper in the DOM tree, since not found (-1) is for embeds\n static order = [\n 'cursor',\n 'inline', // Must be lower\n 'link', // Chrome wants to be lower\n 'underline',\n 'strike',\n 'italic',\n 'bold',\n 'script',\n 'code', // Must be higher\n ];\n\n static compare(self: string, other: string) {\n const selfIndex = Inline.order.indexOf(self);\n const otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n }\n if (self === other) {\n return 0;\n }\n if (self < other) {\n return -1;\n }\n return 1;\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n if (\n Inline.compare(this.statics.blotName, name) < 0 &&\n this.scroll.query(name, Scope.BLOT)\n ) {\n const blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n if (\n this.parent instanceof Inline &&\n Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0\n ) {\n const parent = this.parent.isolate(this.offset(), this.length());\n // @ts-expect-error TODO: make isolate generic\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n}\n\nexport default Inline;\n", "import {\n AttributorStore,\n BlockBlot,\n EmbedBlot,\n LeafBlot,\n Scope,\n} from 'parchment';\nimport type { Blot, Parent } from 'parchment';\nimport Delta from 'quill-delta';\nimport Break from './break.js';\nimport Inline from './inline.js';\nimport TextBlot from './text.js';\n\nconst NEWLINE_LENGTH = 1;\n\nclass Block extends BlockBlot {\n cache: { delta?: Delta | null; length?: number } = {};\n\n delta(): Delta {\n if (this.cache.delta == null) {\n this.cache.delta = blockDelta(this);\n }\n return this.cache.delta;\n }\n\n deleteAt(index: number, length: number) {\n super.deleteAt(index, length);\n this.cache = {};\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n if (length <= 0) return;\n if (this.scroll.query(name, Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n super.formatAt(\n index,\n Math.min(length, this.length() - index - 1),\n name,\n value,\n );\n }\n this.cache = {};\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n if (def != null) {\n super.insertAt(index, value, def);\n this.cache = {};\n return;\n }\n if (value.length === 0) return;\n const lines = value.split('\\n');\n const text = lines.shift() as string;\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n super.insertAt(Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n // TODO: Fix this next time the file is edited.\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let block: Blot | this = this;\n lines.reduce((lineIndex, line) => {\n // @ts-expect-error Fix me later\n block = block.split(lineIndex, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n\n insertBefore(blot: Blot, ref?: Blot | null) {\n const { head } = this.children;\n super.insertBefore(blot, ref);\n if (head instanceof Break) {\n head.remove();\n }\n this.cache = {};\n }\n\n length() {\n if (this.cache.length == null) {\n this.cache.length = super.length() + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n\n moveChildren(target: Parent, ref?: Blot | null) {\n super.moveChildren(target, ref);\n this.cache = {};\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n this.cache = {};\n }\n\n path(index: number) {\n return super.path(index, true);\n }\n\n removeChild(child: Blot) {\n super.removeChild(child);\n this.cache = {};\n }\n\n split(index: number, force: boolean | undefined = false): Blot | null {\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n const clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n }\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n const next = super.split(index, force);\n this.cache = {};\n return next;\n }\n}\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = Break;\nBlock.allowedChildren = [Break, Inline, EmbedBlot, TextBlot];\n\nclass BlockEmbed extends EmbedBlot {\n attributes: AttributorStore;\n domNode: HTMLElement;\n\n attach() {\n super.attach();\n this.attributes = new AttributorStore(this.domNode);\n }\n\n delta() {\n return new Delta().insert(this.value(), {\n ...this.formats(),\n ...this.attributes.values(),\n });\n }\n\n format(name: string, value: unknown) {\n const attribute = this.scroll.query(name, Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n // @ts-expect-error TODO: Scroll#query() should return Attributor when scope is attribute\n this.attributes.attribute(attribute, value);\n }\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n this.format(name, value);\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n if (def != null) {\n super.insertAt(index, value, def);\n return;\n }\n const lines = value.split('\\n');\n const text = lines.pop();\n const blocks = lines.map((line) => {\n const block = this.scroll.create(Block.blotName);\n block.insertAt(0, line);\n return block;\n });\n const ref = this.split(index);\n blocks.forEach((block) => {\n this.parent.insertBefore(block, ref);\n });\n if (text) {\n this.parent.insertBefore(this.scroll.create('text', text), ref);\n }\n }\n}\nBlockEmbed.scope = Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\nfunction blockDelta(blot: BlockBlot, filter = true) {\n return blot\n .descendants(LeafBlot)\n .reduce((delta, leaf) => {\n if (leaf.length() === 0) {\n return delta;\n }\n return delta.insert(leaf.value(), bubbleFormats(leaf, {}, filter));\n }, new Delta())\n .insert('\\n', bubbleFormats(blot));\n}\n\nfunction bubbleFormats(\n blot: Blot | null,\n formats: Record = {},\n filter = true,\n): Record {\n if (blot == null) return formats;\n if ('formats' in blot && typeof blot.formats === 'function') {\n formats = {\n ...formats,\n ...blot.formats(),\n };\n if (filter) {\n // exclude syntax highlighting from deltas and getFormat()\n delete formats['code-token'];\n }\n }\n if (\n blot.parent == null ||\n blot.parent.statics.blotName === 'scroll' ||\n blot.parent.statics.scope !== blot.statics.scope\n ) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats, filter);\n}\n\nexport { blockDelta, bubbleFormats, BlockEmbed, Block as default };\n", "import { EmbedBlot, Scope } from 'parchment';\nimport type { Parent, ScrollBlot } from 'parchment';\nimport type Selection from '../core/selection.js';\nimport TextBlot from './text.js';\nimport type { EmbedContextRange } from './embed.js';\n\nclass Cursor extends EmbedBlot {\n static blotName = 'cursor';\n static className = 'ql-cursor';\n static tagName = 'span';\n static CONTENTS = '\\uFEFF'; // Zero width no break space\n\n static value() {\n return undefined;\n }\n\n selection: Selection;\n textNode: Text;\n savedLength: number;\n\n constructor(scroll: ScrollBlot, domNode: HTMLElement, selection: Selection) {\n super(scroll, domNode);\n this.selection = selection;\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n this.savedLength = 0;\n }\n\n detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n\n format(name: string, value: unknown) {\n if (this.savedLength !== 0) {\n super.format(name, value);\n return;\n }\n // TODO: Fix this next time the file is edited.\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let target: Parent | this = this;\n let index = 0;\n while (target != null && target.statics.scope !== Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this.savedLength = Cursor.CONTENTS.length;\n // @ts-expect-error TODO: allow empty context in Parchment\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this.savedLength = 0;\n }\n }\n\n index(node: Node, offset: number) {\n if (node === this.textNode) return 0;\n return super.index(node, offset);\n }\n\n length() {\n return this.savedLength;\n }\n\n position(): [Text, number] {\n return [this.textNode, this.textNode.data.length];\n }\n\n remove() {\n super.remove();\n // @ts-expect-error Fix me later\n this.parent = null;\n }\n\n restore(): EmbedContextRange | null {\n if (this.selection.composing || this.parent == null) return null;\n const range = this.selection.getNativeRange();\n // Browser may push down styles/nodes inside the cursor blot.\n // https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#push-down-values\n while (\n this.domNode.lastChild != null &&\n this.domNode.lastChild !== this.textNode\n ) {\n // @ts-expect-error Fix me later\n this.domNode.parentNode.insertBefore(\n this.domNode.lastChild,\n this.domNode,\n );\n }\n\n const prevTextBlot = this.prev instanceof TextBlot ? this.prev : null;\n const prevTextLength = prevTextBlot ? prevTextBlot.length() : 0;\n const nextTextBlot = this.next instanceof TextBlot ? this.next : null;\n // @ts-expect-error TODO: make TextBlot.text public\n const nextText = nextTextBlot ? nextTextBlot.text : '';\n const { textNode } = this;\n // take text from inside this blot and reset it\n const newText = textNode.data.split(Cursor.CONTENTS).join('');\n textNode.data = Cursor.CONTENTS;\n\n // proactively merge TextBlots around cursor so that optimization\n // doesn't lose the cursor. the reason we are here in cursor.restore\n // could be that the user clicked in prevTextBlot or nextTextBlot, or\n // the user typed something.\n let mergedTextBlot;\n if (prevTextBlot) {\n mergedTextBlot = prevTextBlot;\n if (newText || nextTextBlot) {\n prevTextBlot.insertAt(prevTextBlot.length(), newText + nextText);\n if (nextTextBlot) {\n nextTextBlot.remove();\n }\n }\n } else if (nextTextBlot) {\n mergedTextBlot = nextTextBlot;\n nextTextBlot.insertAt(0, newText);\n } else {\n const newTextNode = document.createTextNode(newText);\n mergedTextBlot = this.scroll.create(newTextNode);\n this.parent.insertBefore(mergedTextBlot, this);\n }\n\n this.remove();\n if (range) {\n // calculate selection to restore\n const remapOffset = (node: Node, offset: number) => {\n if (prevTextBlot && node === prevTextBlot.domNode) {\n return offset;\n }\n if (node === textNode) {\n return prevTextLength + offset - 1;\n }\n if (nextTextBlot && node === nextTextBlot.domNode) {\n return prevTextLength + newText.length + offset;\n }\n return null;\n };\n\n const start = remapOffset(range.start.node, range.start.offset);\n const end = remapOffset(range.end.node, range.end.offset);\n if (start !== null && end !== null) {\n return {\n startNode: mergedTextBlot.domNode,\n startOffset: start,\n endNode: mergedTextBlot.domNode,\n endOffset: end,\n };\n }\n }\n return null;\n }\n\n update(mutations: MutationRecord[], context: Record) {\n if (\n mutations.some((mutation) => {\n return (\n mutation.type === 'characterData' && mutation.target === this.textNode\n );\n })\n ) {\n const range = this.restore();\n if (range) context.range = range;\n }\n }\n\n // Avoid .ql-cursor being a descendant of ``.\n // The reason is Safari pushes down `` on text insertion.\n // That will cause DOM nodes not sync with the model.\n //\n // For example ({I} is the caret), given the markup:\n // \\uFEFF{I}\n // When typing a char \"x\", `` will be pushed down inside the `` first:\n // \\uFEFF{I}\n // And then \"x\" will be inserted after ``:\n // \\uFEFFd{I}\n optimize(context?: unknown) {\n // @ts-expect-error Fix me later\n super.optimize(context);\n\n let { parent } = this;\n while (parent) {\n if (parent.domNode.tagName === 'A') {\n this.savedLength = Cursor.CONTENTS.length;\n // @ts-expect-error TODO: make isolate generic\n parent.isolate(this.offset(parent), this.length()).unwrap();\n this.savedLength = 0;\n break;\n }\n parent = parent.parent;\n }\n }\n\n value() {\n return '';\n }\n}\n\nexport default Cursor;\n", "'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n", "import EventEmitter from './index.js'\n\nexport { EventEmitter }\nexport default EventEmitter\n", "import type Quill from '../core.js';\n\nexport default new WeakMap();\n", "const levels = ['error', 'warn', 'log', 'info'] as const;\nexport type DebugLevel = (typeof levels)[number];\nlet level: DebugLevel | false = 'warn';\n\nfunction debug(method: DebugLevel, ...args: unknown[]) {\n if (level) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n console[method](...args); // eslint-disable-line no-console\n }\n }\n}\n\nfunction namespace(\n ns: string,\n): Record void> {\n return levels.reduce(\n (logger, method) => {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n },\n {} as Record void>,\n );\n}\n\nnamespace.level = (newLevel: DebugLevel | false) => {\n level = newLevel;\n};\ndebug.level = namespace.level;\n\nexport default namespace;\n", "import { EventEmitter } from 'eventemitter3';\nimport instances from './instances.js';\nimport logger from './logger.js';\n\nconst debug = logger('quill:events');\nconst EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];\n\nEVENTS.forEach((eventName) => {\n document.addEventListener(eventName, (...args) => {\n Array.from(document.querySelectorAll('.ql-container')).forEach((node) => {\n const quill = instances.get(node);\n if (quill && quill.emitter) {\n quill.emitter.handleDOM(...args);\n }\n });\n });\n});\n\nclass Emitter extends EventEmitter {\n static events = {\n EDITOR_CHANGE: 'editor-change',\n SCROLL_BEFORE_UPDATE: 'scroll-before-update',\n SCROLL_BLOT_MOUNT: 'scroll-blot-mount',\n SCROLL_BLOT_UNMOUNT: 'scroll-blot-unmount',\n SCROLL_OPTIMIZE: 'scroll-optimize',\n SCROLL_UPDATE: 'scroll-update',\n SCROLL_EMBED_UPDATE: 'scroll-embed-update',\n SELECTION_CHANGE: 'selection-change',\n TEXT_CHANGE: 'text-change',\n COMPOSITION_BEFORE_START: 'composition-before-start',\n COMPOSITION_START: 'composition-start',\n COMPOSITION_BEFORE_END: 'composition-before-end',\n COMPOSITION_END: 'composition-end',\n } as const;\n\n static sources = {\n API: 'api',\n SILENT: 'silent',\n USER: 'user',\n } as const;\n\n protected domListeners: Record;\n\n constructor() {\n super();\n this.domListeners = {};\n this.on('error', debug.error);\n }\n\n emit(...args: unknown[]): boolean {\n debug.log.call(debug, ...args);\n // @ts-expect-error\n return super.emit(...args);\n }\n\n handleDOM(event: Event, ...args: unknown[]) {\n (this.domListeners[event.type] || []).forEach(({ node, handler }) => {\n if (event.target === node || node.contains(event.target as Node)) {\n handler(event, ...args);\n }\n });\n }\n\n listenDOM(eventName: string, node: Node, handler: EventListener) {\n if (!this.domListeners[eventName]) {\n this.domListeners[eventName] = [];\n }\n this.domListeners[eventName].push({ node, handler });\n }\n}\n\nexport type EmitterSource =\n (typeof Emitter.sources)[keyof typeof Emitter.sources];\n\nexport default Emitter;\n", "import { LeafBlot, Scope } from 'parchment';\nimport { cloneDeep, isEqual } from 'lodash-es';\nimport Emitter from './emitter.js';\nimport type { EmitterSource } from './emitter.js';\nimport logger from './logger.js';\nimport type Cursor from '../blots/cursor.js';\nimport type Scroll from '../blots/scroll.js';\n\nconst debug = logger('quill:selection');\n\ntype NativeRange = AbstractRange;\n\ninterface NormalizedRange {\n start: {\n node: NativeRange['startContainer'];\n offset: NativeRange['startOffset'];\n };\n end: { node: NativeRange['endContainer']; offset: NativeRange['endOffset'] };\n native: NativeRange;\n}\n\nexport interface Bounds {\n bottom: number;\n height: number;\n left: number;\n right: number;\n top: number;\n width: number;\n}\n\nexport class Range {\n constructor(\n public index: number,\n public length = 0,\n ) {}\n}\n\nclass Selection {\n scroll: Scroll;\n emitter: Emitter;\n composing: boolean;\n mouseDown: boolean;\n\n root: HTMLElement;\n cursor: Cursor;\n savedRange: Range;\n lastRange: Range | null;\n lastNative: NormalizedRange | null;\n\n constructor(scroll: Scroll, emitter: Emitter) {\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.mouseDown = false;\n this.root = this.scroll.domNode;\n // @ts-expect-error\n this.cursor = this.scroll.create('cursor', this);\n // savedRange is last non-null range\n this.savedRange = new Range(0, 0);\n this.lastRange = this.savedRange;\n this.lastNative = null;\n this.handleComposition();\n this.handleDragging();\n this.emitter.listenDOM('selectionchange', document, () => {\n if (!this.mouseDown && !this.composing) {\n setTimeout(this.update.bind(this, Emitter.sources.USER), 1);\n }\n });\n this.emitter.on(Emitter.events.SCROLL_BEFORE_UPDATE, () => {\n if (!this.hasFocus()) return;\n const native = this.getNativeRange();\n if (native == null) return;\n if (native.start.node === this.cursor.textNode) return; // cursor.restore() will handle\n this.emitter.once(\n Emitter.events.SCROLL_UPDATE,\n (source, mutations: MutationRecord[]) => {\n try {\n if (\n this.root.contains(native.start.node) &&\n this.root.contains(native.end.node)\n ) {\n this.setNativeRange(\n native.start.node,\n native.start.offset,\n native.end.node,\n native.end.offset,\n );\n }\n const triggeredByTyping = mutations.some(\n (mutation) =>\n mutation.type === 'characterData' ||\n mutation.type === 'childList' ||\n (mutation.type === 'attributes' &&\n mutation.target === this.root),\n );\n this.update(triggeredByTyping ? Emitter.sources.SILENT : source);\n } catch (ignored) {\n // ignore\n }\n },\n );\n });\n this.emitter.on(Emitter.events.SCROLL_OPTIMIZE, (mutations, context) => {\n if (context.range) {\n const { startNode, startOffset, endNode, endOffset } = context.range;\n this.setNativeRange(startNode, startOffset, endNode, endOffset);\n this.update(Emitter.sources.SILENT);\n }\n });\n this.update(Emitter.sources.SILENT);\n }\n\n handleComposition() {\n this.emitter.on(Emitter.events.COMPOSITION_BEFORE_START, () => {\n this.composing = true;\n });\n this.emitter.on(Emitter.events.COMPOSITION_END, () => {\n this.composing = false;\n if (this.cursor.parent) {\n const range = this.cursor.restore();\n if (!range) return;\n setTimeout(() => {\n this.setNativeRange(\n range.startNode,\n range.startOffset,\n range.endNode,\n range.endOffset,\n );\n }, 1);\n }\n });\n }\n\n handleDragging() {\n this.emitter.listenDOM('mousedown', document.body, () => {\n this.mouseDown = true;\n });\n this.emitter.listenDOM('mouseup', document.body, () => {\n this.mouseDown = false;\n this.update(Emitter.sources.USER);\n });\n }\n\n focus() {\n if (this.hasFocus()) return;\n this.root.focus({ preventScroll: true });\n this.setRange(this.savedRange);\n }\n\n format(format: string, value: unknown) {\n this.scroll.update();\n const nativeRange = this.getNativeRange();\n if (\n nativeRange == null ||\n !nativeRange.native.collapsed ||\n this.scroll.query(format, Scope.BLOCK)\n )\n return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n const blot = this.scroll.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof LeafBlot) {\n const after = blot.split(nativeRange.start.offset);\n blot.parent.insertBefore(this.cursor, after);\n } else {\n // @ts-expect-error TODO: nativeRange.start.node doesn't seem to match function signature\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n\n getBounds(index: number, length = 0) {\n const scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n let node: Node;\n let [leaf, offset] = this.scroll.leaf(index);\n if (leaf == null) return null;\n if (length > 0 && offset === leaf.length()) {\n const [next] = this.scroll.leaf(index + 1);\n if (next) {\n const [line] = this.scroll.line(index);\n const [nextLine] = this.scroll.line(index + 1);\n if (line === nextLine) {\n leaf = next;\n offset = 0;\n }\n }\n }\n [node, offset] = leaf.position(offset, true);\n const range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n [leaf, offset] = this.scroll.leaf(index + length);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n range.setEnd(node, offset);\n return range.getBoundingClientRect();\n }\n let side: 'left' | 'right' = 'left';\n let rect: DOMRect;\n if (node instanceof Text) {\n // Return null if the text node is empty because it is\n // not able to get a useful client rect:\n // https://github.com/w3c/csswg-drafts/issues/2514.\n // Empty text nodes are most likely caused by TextBlot#optimize()\n // not getting called when editor content changes.\n if (!node.data.length) {\n return null;\n }\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n if (!(leaf.domNode instanceof Element)) return null;\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n return {\n bottom: rect.top + rect.height,\n height: rect.height,\n left: rect[side],\n right: rect[side],\n top: rect.top,\n width: 0,\n };\n }\n\n getNativeRange(): NormalizedRange | null {\n const selection = document.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n const nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n const range = this.normalizeNative(nativeRange);\n debug.info('getNativeRange', range);\n return range;\n }\n\n getRange(): [Range, NormalizedRange] | [null, null] {\n const root = this.scroll.domNode;\n if ('isConnected' in root && !root.isConnected) {\n // document.getSelection() forces layout on Blink, so we trend to\n // not calling it.\n return [null, null];\n }\n const normalized = this.getNativeRange();\n if (normalized == null) return [null, null];\n const range = this.normalizedToRange(normalized);\n return [range, normalized];\n }\n\n hasFocus(): boolean {\n return (\n document.activeElement === this.root ||\n (document.activeElement != null &&\n contains(this.root, document.activeElement))\n );\n }\n\n normalizedToRange(range: NormalizedRange) {\n const positions: [Node, number][] = [\n [range.start.node, range.start.offset],\n ];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n const indexes = positions.map((position) => {\n const [node, offset] = position;\n const blot = this.scroll.find(node, true);\n // @ts-expect-error Fix me later\n const index = blot.offset(this.scroll);\n if (offset === 0) {\n return index;\n }\n if (blot instanceof LeafBlot) {\n return index + blot.index(node, offset);\n }\n // @ts-expect-error Fix me later\n return index + blot.length();\n });\n const end = Math.min(Math.max(...indexes), this.scroll.length() - 1);\n const start = Math.min(end, ...indexes);\n return new Range(start, end - start);\n }\n\n normalizeNative(nativeRange: NativeRange) {\n if (\n !contains(this.root, nativeRange.startContainer) ||\n (!nativeRange.collapsed && !contains(this.root, nativeRange.endContainer))\n ) {\n return null;\n }\n const range = {\n start: {\n node: nativeRange.startContainer,\n offset: nativeRange.startOffset,\n },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange,\n };\n [range.start, range.end].forEach((position) => {\n let { node, offset } = position;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n // @ts-expect-error Fix me later\n node = node.lastChild;\n if (node instanceof Text) {\n offset = node.data.length;\n } else if (node.childNodes.length > 0) {\n // Container case\n offset = node.childNodes.length;\n } else {\n // Embed case\n offset = node.childNodes.length + 1;\n }\n } else {\n break;\n }\n }\n position.node = node;\n position.offset = offset;\n });\n return range;\n }\n\n rangeToNative(range: Range): [Node | null, number, Node | null, number] {\n const scrollLength = this.scroll.length();\n\n const getPosition = (\n index: number,\n inclusive: boolean,\n ): [Node | null, number] => {\n index = Math.min(scrollLength - 1, index);\n const [leaf, leafOffset] = this.scroll.leaf(index);\n return leaf ? leaf.position(leafOffset, inclusive) : [null, -1];\n };\n return [\n ...getPosition(range.index, false),\n ...getPosition(range.index + range.length, true),\n ];\n }\n\n setNativeRange(\n startNode: Node | null,\n startOffset?: number,\n endNode = startNode,\n endOffset = startOffset,\n force = false,\n ) {\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (\n startNode != null &&\n (this.root.parentNode == null ||\n startNode.parentNode == null ||\n // @ts-expect-error Fix me later\n endNode.parentNode == null)\n ) {\n return;\n }\n const selection = document.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus({ preventScroll: true });\n const { native } = this.getNativeRange() || {};\n if (\n native == null ||\n force ||\n startNode !== native.startContainer ||\n startOffset !== native.startOffset ||\n endNode !== native.endContainer ||\n endOffset !== native.endOffset\n ) {\n if (startNode instanceof Element && startNode.tagName === 'BR') {\n // @ts-expect-error Fix me later\n startOffset = Array.from(startNode.parentNode.childNodes).indexOf(\n startNode,\n );\n startNode = startNode.parentNode;\n }\n if (endNode instanceof Element && endNode.tagName === 'BR') {\n // @ts-expect-error Fix me later\n endOffset = Array.from(endNode.parentNode.childNodes).indexOf(\n endNode,\n );\n endNode = endNode.parentNode;\n }\n const range = document.createRange();\n // @ts-expect-error Fix me later\n range.setStart(startNode, startOffset);\n // @ts-expect-error Fix me later\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n }\n }\n\n setRange(range: Range | null, force: boolean, source?: EmitterSource): void;\n setRange(range: Range | null, source?: EmitterSource): void;\n setRange(\n range: Range | null,\n force: boolean | EmitterSource = false,\n source: EmitterSource = Emitter.sources.API,\n ): void {\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n const args = this.rangeToNative(range);\n this.setNativeRange(...args, force);\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n\n update(source: EmitterSource = Emitter.sources.USER) {\n const oldRange = this.lastRange;\n const [lastRange, nativeRange] = this.getRange();\n this.lastRange = lastRange;\n this.lastNative = nativeRange;\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!isEqual(oldRange, this.lastRange)) {\n if (\n !this.composing &&\n nativeRange != null &&\n nativeRange.native.collapsed &&\n nativeRange.start.node !== this.cursor.textNode\n ) {\n const range = this.cursor.restore();\n if (range) {\n this.setNativeRange(\n range.startNode,\n range.startOffset,\n range.endNode,\n range.endOffset,\n );\n }\n }\n const args = [\n Emitter.events.SELECTION_CHANGE,\n cloneDeep(this.lastRange),\n cloneDeep(oldRange),\n source,\n ];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n }\n}\n\nfunction contains(parent: Node, descendant: Node) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode; // eslint-disable-line @typescript-eslint/no-unused-expressions\n } catch (e) {\n return false;\n }\n return parent.contains(descendant);\n}\n\nexport default Selection;\n", "import { cloneDeep, isEqual, merge } from 'lodash-es';\nimport { LeafBlot, EmbedBlot, Scope, ParentBlot } from 'parchment';\nimport type { Blot } from 'parchment';\nimport Delta, { AttributeMap, Op } from 'quill-delta';\nimport Block, { BlockEmbed, bubbleFormats } from '../blots/block.js';\nimport Break from '../blots/break.js';\nimport CursorBlot from '../blots/cursor.js';\nimport type Scroll from '../blots/scroll.js';\nimport TextBlot, { escapeText } from '../blots/text.js';\nimport { Range } from './selection.js';\n\nconst ASCII = /^[ -~]*$/;\n\ntype SelectionInfo = {\n newRange: Range;\n oldRange: Range;\n};\n\nclass Editor {\n scroll: Scroll;\n delta: Delta;\n\n constructor(scroll: Scroll) {\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n applyDelta(delta: Delta): Delta {\n this.scroll.update();\n let scrollLength = this.scroll.length();\n this.scroll.batchStart();\n const normalizedDelta = normalizeDelta(delta);\n const deleteDelta = new Delta();\n const normalizedOps = splitOpLines(normalizedDelta.ops.slice());\n normalizedOps.reduce((index, op) => {\n const length = Op.length(op);\n let attributes = op.attributes || {};\n let isImplicitNewlinePrepended = false;\n let isImplicitNewlineAppended = false;\n if (op.insert != null) {\n deleteDelta.retain(length);\n if (typeof op.insert === 'string') {\n const text = op.insert;\n isImplicitNewlineAppended =\n !text.endsWith('\\n') &&\n (scrollLength <= index ||\n !!this.scroll.descendant(BlockEmbed, index)[0]);\n this.scroll.insertAt(index, text);\n const [line, offset] = this.scroll.line(index);\n let formats = merge({}, bubbleFormats(line));\n if (line instanceof Block) {\n const [leaf] = line.descendant(LeafBlot, offset);\n if (leaf) {\n formats = merge(formats, bubbleFormats(leaf));\n }\n }\n attributes = AttributeMap.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n const key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n const isInlineEmbed = this.scroll.query(key, Scope.INLINE) != null;\n if (isInlineEmbed) {\n if (\n scrollLength <= index ||\n !!this.scroll.descendant(BlockEmbed, index)[0]\n ) {\n isImplicitNewlineAppended = true;\n }\n } else if (index > 0) {\n const [leaf, offset] = this.scroll.descendant(LeafBlot, index - 1);\n if (leaf instanceof TextBlot) {\n const text = leaf.value();\n if (text[offset] !== '\\n') {\n isImplicitNewlinePrepended = true;\n }\n } else if (\n leaf instanceof EmbedBlot &&\n leaf.statics.scope === Scope.INLINE_BLOT\n ) {\n isImplicitNewlinePrepended = true;\n }\n }\n this.scroll.insertAt(index, key, op.insert[key]);\n\n if (isInlineEmbed) {\n const [leaf] = this.scroll.descendant(LeafBlot, index);\n if (leaf) {\n const formats = merge({}, bubbleFormats(leaf));\n attributes = AttributeMap.diff(formats, attributes) || {};\n }\n }\n }\n scrollLength += length;\n } else {\n deleteDelta.push(op);\n\n if (op.retain !== null && typeof op.retain === 'object') {\n const key = Object.keys(op.retain)[0];\n if (key == null) return index;\n this.scroll.updateEmbedAt(index, key, op.retain[key]);\n }\n }\n Object.keys(attributes).forEach((name) => {\n this.scroll.formatAt(index, length, name, attributes[name]);\n });\n const prependedLength = isImplicitNewlinePrepended ? 1 : 0;\n const addedLength = isImplicitNewlineAppended ? 1 : 0;\n scrollLength += prependedLength + addedLength;\n deleteDelta.retain(prependedLength);\n deleteDelta.delete(addedLength);\n return index + length + prependedLength + addedLength;\n }, 0);\n deleteDelta.reduce((index, op) => {\n if (typeof op.delete === 'number') {\n this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + Op.length(op);\n }, 0);\n this.scroll.batchEnd();\n this.scroll.optimize();\n return this.update(normalizedDelta);\n }\n\n deleteText(index: number, length: number): Delta {\n this.scroll.deleteAt(index, length);\n return this.update(new Delta().retain(index).delete(length));\n }\n\n formatLine(\n index: number,\n length: number,\n formats: Record = {},\n ): Delta {\n this.scroll.update();\n Object.keys(formats).forEach((format) => {\n this.scroll.lines(index, Math.max(length, 1)).forEach((line) => {\n line.format(format, formats[format]);\n });\n });\n this.scroll.optimize();\n const delta = new Delta().retain(index).retain(length, cloneDeep(formats));\n return this.update(delta);\n }\n\n formatText(\n index: number,\n length: number,\n formats: Record = {},\n ): Delta {\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, length, format, formats[format]);\n });\n const delta = new Delta().retain(index).retain(length, cloneDeep(formats));\n return this.update(delta);\n }\n\n getContents(index: number, length: number): Delta {\n return this.delta.slice(index, index + length);\n }\n\n getDelta(): Delta {\n return this.scroll.lines().reduce((delta, line) => {\n return delta.concat(line.delta());\n }, new Delta());\n }\n\n getFormat(index: number, length = 0): Record {\n let lines: (Block | BlockEmbed)[] = [];\n let leaves: LeafBlot[] = [];\n if (length === 0) {\n this.scroll.path(index).forEach((path) => {\n const [blot] = path;\n if (blot instanceof Block) {\n lines.push(blot);\n } else if (blot instanceof LeafBlot) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(LeafBlot, index, length);\n }\n const [lineFormats, leafFormats] = [lines, leaves].map((blots) => {\n const blot = blots.shift();\n if (blot == null) return {};\n let formats = bubbleFormats(blot);\n while (Object.keys(formats).length > 0) {\n const blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats(bubbleFormats(blot), formats);\n }\n return formats;\n });\n return { ...lineFormats, ...leafFormats };\n }\n\n getHTML(index: number, length: number): string {\n const [line, lineOffset] = this.scroll.line(index);\n if (line) {\n const lineLength = line.length();\n const isWithinLine = line.length() >= lineOffset + length;\n if (isWithinLine && !(lineOffset === 0 && length === lineLength)) {\n return convertHTML(line, lineOffset, length, true);\n }\n return convertHTML(this.scroll, index, length, true);\n }\n return '';\n }\n\n getText(index: number, length: number): string {\n return this.getContents(index, length)\n .filter((op) => typeof op.insert === 'string')\n .map((op) => op.insert)\n .join('');\n }\n\n insertContents(index: number, contents: Delta): Delta {\n const normalizedDelta = normalizeDelta(contents);\n const change = new Delta().retain(index).concat(normalizedDelta);\n this.scroll.insertContents(index, normalizedDelta);\n return this.update(change);\n }\n\n insertEmbed(index: number, embed: string, value: unknown): Delta {\n this.scroll.insertAt(index, embed, value);\n return this.update(new Delta().retain(index).insert({ [embed]: value }));\n }\n\n insertText(\n index: number,\n text: string,\n formats: Record = {},\n ): Delta {\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(\n new Delta().retain(index).insert(text, cloneDeep(formats)),\n );\n }\n\n isBlank(): boolean {\n if (this.scroll.children.length === 0) return true;\n if (this.scroll.children.length > 1) return false;\n const blot = this.scroll.children.head;\n if (blot?.statics.blotName !== Block.blotName) return false;\n const block = blot as Block;\n if (block.children.length > 1) return false;\n return block.children.head instanceof Break;\n }\n\n removeFormat(index: number, length: number): Delta {\n const text = this.getText(index, length);\n const [line, offset] = this.scroll.line(index + length);\n let suffixLength = 0;\n let suffix = new Delta();\n if (line != null) {\n suffixLength = line.length() - offset;\n suffix = line\n .delta()\n .slice(offset, offset + suffixLength - 1)\n .insert('\\n');\n }\n const contents = this.getContents(index, length + suffixLength);\n const diff = contents.diff(new Delta().insert(text).concat(suffix));\n const delta = new Delta().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n\n update(\n change: Delta | null,\n mutations: MutationRecord[] = [],\n selectionInfo: SelectionInfo | undefined = undefined,\n ): Delta {\n const oldDelta = this.delta;\n if (\n mutations.length === 1 &&\n mutations[0].type === 'characterData' &&\n // @ts-expect-error Fix me later\n mutations[0].target.data.match(ASCII) &&\n this.scroll.find(mutations[0].target)\n ) {\n // Optimization for character changes\n const textBlot = this.scroll.find(mutations[0].target) as Blot;\n const formats = bubbleFormats(textBlot);\n const index = textBlot.offset(this.scroll);\n // @ts-expect-error Fix me later\n const oldValue = mutations[0].oldValue.replace(CursorBlot.CONTENTS, '');\n const oldText = new Delta().insert(oldValue);\n // @ts-expect-error\n const newText = new Delta().insert(textBlot.value());\n const relativeSelectionInfo = selectionInfo && {\n oldRange: shiftRange(selectionInfo.oldRange, -index),\n newRange: shiftRange(selectionInfo.newRange, -index),\n };\n const diffDelta = new Delta()\n .retain(index)\n .concat(oldText.diff(newText, relativeSelectionInfo));\n change = diffDelta.reduce((delta, op) => {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n }\n return delta.push(op);\n }, new Delta());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !isEqual(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, selectionInfo);\n }\n }\n return change;\n }\n}\n\ninterface ListItem {\n child: Blot;\n offset: number;\n length: number;\n indent: number;\n type: string;\n}\nfunction convertListHTML(\n items: ListItem[],\n lastIndent: number,\n types: string[],\n): string {\n if (items.length === 0) {\n const [endTag] = getListType(types.pop());\n if (lastIndent <= 0) {\n return ``;\n }\n return `${convertListHTML([], lastIndent - 1, types)}`;\n }\n const [{ child, offset, length, indent, type }, ...rest] = items;\n const [tag, attribute] = getListType(type);\n if (indent > lastIndent) {\n types.push(type);\n if (indent === lastIndent + 1) {\n return `<${tag}>${convertHTML(\n child,\n offset,\n length,\n )}${convertListHTML(rest, indent, types)}`;\n }\n return `<${tag}>
  • ${convertListHTML(items, lastIndent + 1, types)}`;\n }\n const previousType = types[types.length - 1];\n if (indent === lastIndent && type === previousType) {\n return `
  • ${convertHTML(\n child,\n offset,\n length,\n )}${convertListHTML(rest, indent, types)}`;\n }\n const [endTag] = getListType(types.pop());\n return `${convertListHTML(items, lastIndent - 1, types)}`;\n}\n\nfunction convertHTML(\n blot: Blot,\n index: number,\n length: number,\n isRoot = false,\n): string {\n if ('html' in blot && typeof blot.html === 'function') {\n return blot.html(index, length);\n }\n if (blot instanceof TextBlot) {\n return escapeText(blot.value().slice(index, index + length));\n }\n if (blot instanceof ParentBlot) {\n // TODO fix API\n if (blot.statics.blotName === 'list-container') {\n const items: any[] = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n const formats =\n 'formats' in child && typeof child.formats === 'function'\n ? child.formats()\n : {};\n items.push({\n child,\n offset,\n length: childLength,\n indent: formats.indent || 0,\n type: formats.list,\n });\n });\n return convertListHTML(items, -1, []);\n }\n const parts: string[] = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n parts.push(convertHTML(child, offset, childLength));\n });\n if (isRoot || blot.statics.blotName === 'list') {\n return parts.join('');\n }\n const { outerHTML, innerHTML } = blot.domNode as Element;\n const [start, end] = outerHTML.split(`>${innerHTML}<`);\n // TODO cleanup\n if (start === '${parts.join('')}<${end}`;\n }\n return `${start}>${parts.join('')}<${end}`;\n }\n return blot.domNode instanceof Element ? blot.domNode.outerHTML : '';\n}\n\nfunction combineFormats(\n formats: Record,\n combined: Record,\n): Record {\n return Object.keys(combined).reduce(\n (merged, name) => {\n if (formats[name] == null) return merged;\n const combinedValue = combined[name];\n if (combinedValue === formats[name]) {\n merged[name] = combinedValue;\n } else if (Array.isArray(combinedValue)) {\n if (combinedValue.indexOf(formats[name]) < 0) {\n merged[name] = combinedValue.concat([formats[name]]);\n } else {\n // If style already exists, don't add to an array, but don't lose other styles\n merged[name] = combinedValue;\n }\n } else {\n merged[name] = [combinedValue, formats[name]];\n }\n return merged;\n },\n {} as Record,\n );\n}\n\nfunction getListType(type: string | undefined) {\n const tag = type === 'ordered' ? 'ol' : 'ul';\n switch (type) {\n case 'checked':\n return [tag, ' data-list=\"checked\"'];\n case 'unchecked':\n return [tag, ' data-list=\"unchecked\"'];\n default:\n return [tag, ''];\n }\n}\n\nfunction normalizeDelta(delta: Delta) {\n return delta.reduce((normalizedDelta, op) => {\n if (typeof op.insert === 'string') {\n const text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return normalizedDelta.insert(text, op.attributes);\n }\n return normalizedDelta.push(op);\n }, new Delta());\n}\n\nfunction shiftRange({ index, length }: Range, amount: number) {\n return new Range(index + amount, length);\n}\n\nfunction splitOpLines(ops: Op[]) {\n const split: Op[] = [];\n ops.forEach((op) => {\n if (typeof op.insert === 'string') {\n const lines = op.insert.split('\\n');\n lines.forEach((line, index) => {\n if (index) split.push({ insert: '\\n', attributes: op.attributes });\n if (line) split.push({ insert: line, attributes: op.attributes });\n });\n } else {\n split.push(op);\n }\n });\n\n return split;\n}\n\nexport default Editor;\n", "import type Quill from './quill.js';\n\nabstract class Module {\n static DEFAULTS = {};\n\n constructor(\n public quill: Quill,\n protected options: Partial = {},\n ) {}\n}\n\nexport default Module;\n", "import type { ScrollBlot } from 'parchment';\nimport { EmbedBlot } from 'parchment';\nimport TextBlot from './text.js';\n\nconst GUARD_TEXT = '\\uFEFF';\n\nexport interface EmbedContextRange {\n startNode: Node | Text;\n startOffset: number;\n endNode?: Node | Text;\n endOffset?: number;\n}\n\nclass Embed extends EmbedBlot {\n contentNode: HTMLSpanElement;\n leftGuard: Text;\n rightGuard: Text;\n\n constructor(scroll: ScrollBlot, node: Node) {\n super(scroll, node);\n this.contentNode = document.createElement('span');\n this.contentNode.setAttribute('contenteditable', 'false');\n Array.from(this.domNode.childNodes).forEach((childNode) => {\n this.contentNode.appendChild(childNode);\n });\n this.leftGuard = document.createTextNode(GUARD_TEXT);\n this.rightGuard = document.createTextNode(GUARD_TEXT);\n this.domNode.appendChild(this.leftGuard);\n this.domNode.appendChild(this.contentNode);\n this.domNode.appendChild(this.rightGuard);\n }\n\n index(node: Node, offset: number) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return super.index(node, offset);\n }\n\n restore(node: Text): EmbedContextRange | null {\n let range: EmbedContextRange | null = null;\n let textNode: Text;\n const text = node.data.split(GUARD_TEXT).join('');\n if (node === this.leftGuard) {\n if (this.prev instanceof TextBlot) {\n const prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length,\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(this.scroll.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length,\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof TextBlot) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length,\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(this.scroll.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length,\n };\n }\n }\n node.data = GUARD_TEXT;\n return range;\n }\n\n update(mutations: MutationRecord[], context: Record) {\n mutations.forEach((mutation) => {\n if (\n mutation.type === 'characterData' &&\n (mutation.target === this.leftGuard ||\n mutation.target === this.rightGuard)\n ) {\n const range = this.restore(mutation.target as Text);\n if (range) context.range = range;\n }\n });\n }\n}\n\nexport default Embed;\n", "import Embed from '../blots/embed.js';\nimport type Scroll from '../blots/scroll.js';\nimport Emitter from './emitter.js';\n\nclass Composition {\n isComposing = false;\n\n constructor(\n private scroll: Scroll,\n private emitter: Emitter,\n ) {\n this.setupListeners();\n }\n\n private setupListeners() {\n this.scroll.domNode.addEventListener('compositionstart', (event) => {\n if (!this.isComposing) {\n this.handleCompositionStart(event);\n }\n });\n\n this.scroll.domNode.addEventListener('compositionend', (event) => {\n if (this.isComposing) {\n // Webkit makes DOM changes after compositionend, so we use microtask to\n // ensure the order.\n // https://bugs.webkit.org/show_bug.cgi?id=31902\n queueMicrotask(() => {\n this.handleCompositionEnd(event);\n });\n }\n });\n }\n\n private handleCompositionStart(event: CompositionEvent) {\n const blot =\n event.target instanceof Node\n ? this.scroll.find(event.target, true)\n : null;\n\n if (blot && !(blot instanceof Embed)) {\n this.emitter.emit(Emitter.events.COMPOSITION_BEFORE_START, event);\n this.scroll.batchStart();\n this.emitter.emit(Emitter.events.COMPOSITION_START, event);\n this.isComposing = true;\n }\n }\n\n private handleCompositionEnd(event: CompositionEvent) {\n this.emitter.emit(Emitter.events.COMPOSITION_BEFORE_END, event);\n this.scroll.batchEnd();\n this.emitter.emit(Emitter.events.COMPOSITION_END, event);\n this.isComposing = false;\n }\n}\n\nexport default Composition;\n", "import type Quill from '../core.js';\nimport type Clipboard from '../modules/clipboard.js';\nimport type History from '../modules/history.js';\nimport type Keyboard from '../modules/keyboard.js';\nimport type { ToolbarProps } from '../modules/toolbar.js';\nimport type Uploader from '../modules/uploader.js';\n\nexport interface ThemeOptions {\n modules: Record & {\n toolbar?: null | ToolbarProps;\n };\n}\n\nclass Theme {\n static DEFAULTS: ThemeOptions = {\n modules: {},\n };\n\n static themes = {\n default: Theme,\n };\n\n modules: ThemeOptions['modules'] = {};\n\n constructor(\n protected quill: Quill,\n protected options: ThemeOptions,\n ) {}\n\n init() {\n Object.keys(this.options.modules).forEach((name) => {\n if (this.modules[name] == null) {\n this.addModule(name);\n }\n });\n }\n\n addModule(name: 'clipboard'): Clipboard;\n addModule(name: 'keyboard'): Keyboard;\n addModule(name: 'uploader'): Uploader;\n addModule(name: 'history'): History;\n addModule(name: string): unknown;\n addModule(name: string) {\n // @ts-expect-error\n const ModuleClass = this.quill.constructor.import(`modules/${name}`);\n this.modules[name] = new ModuleClass(\n this.quill,\n this.options.modules[name] || {},\n );\n return this.modules[name];\n }\n}\n\nexport interface ThemeConstructor {\n new (quill: Quill, options: unknown): Theme;\n DEFAULTS: ThemeOptions;\n}\n\nexport default Theme;\n", "export type Rect = {\n top: number;\n right: number;\n bottom: number;\n left: number;\n};\n\nconst getParentElement = (element: Node): Element | null =>\n element.parentElement || (element.getRootNode() as ShadowRoot).host || null;\n\nconst getElementRect = (element: Element): Rect => {\n const rect = element.getBoundingClientRect();\n const scaleX =\n ('offsetWidth' in element &&\n Math.abs(rect.width) / (element as HTMLElement).offsetWidth) ||\n 1;\n const scaleY =\n ('offsetHeight' in element &&\n Math.abs(rect.height) / (element as HTMLElement).offsetHeight) ||\n 1;\n return {\n top: rect.top,\n right: rect.left + element.clientWidth * scaleX,\n bottom: rect.top + element.clientHeight * scaleY,\n left: rect.left,\n };\n};\n\nconst paddingValueToInt = (value: string) => {\n const number = parseInt(value, 10);\n return Number.isNaN(number) ? 0 : number;\n};\n\n// Follow the steps described in https://www.w3.org/TR/cssom-view-1/#element-scrolling-members,\n// assuming that the scroll option is set to 'nearest'.\nconst getScrollDistance = (\n targetStart: number,\n targetEnd: number,\n scrollStart: number,\n scrollEnd: number,\n scrollPaddingStart: number,\n scrollPaddingEnd: number,\n) => {\n if (targetStart < scrollStart && targetEnd > scrollEnd) {\n return 0;\n }\n\n if (targetStart < scrollStart) {\n return -(scrollStart - targetStart + scrollPaddingStart);\n }\n\n if (targetEnd > scrollEnd) {\n return targetEnd - targetStart > scrollEnd - scrollStart\n ? targetStart + scrollPaddingStart - scrollStart\n : targetEnd - scrollEnd + scrollPaddingEnd;\n }\n return 0;\n};\n\nconst scrollRectIntoView = (root: HTMLElement, targetRect: Rect) => {\n const document = root.ownerDocument;\n\n let rect = targetRect;\n\n let current: Element | null = root;\n while (current) {\n const isDocumentBody: boolean = current === document.body;\n const bounding = isDocumentBody\n ? {\n top: 0,\n right:\n window.visualViewport?.width ??\n document.documentElement.clientWidth,\n bottom:\n window.visualViewport?.height ??\n document.documentElement.clientHeight,\n left: 0,\n }\n : getElementRect(current);\n\n const style = getComputedStyle(current);\n const scrollDistanceX = getScrollDistance(\n rect.left,\n rect.right,\n bounding.left,\n bounding.right,\n paddingValueToInt(style.scrollPaddingLeft),\n paddingValueToInt(style.scrollPaddingRight),\n );\n const scrollDistanceY = getScrollDistance(\n rect.top,\n rect.bottom,\n bounding.top,\n bounding.bottom,\n paddingValueToInt(style.scrollPaddingTop),\n paddingValueToInt(style.scrollPaddingBottom),\n );\n if (scrollDistanceX || scrollDistanceY) {\n if (isDocumentBody) {\n document.defaultView?.scrollBy(scrollDistanceX, scrollDistanceY);\n } else {\n const { scrollLeft, scrollTop } = current;\n if (scrollDistanceY) {\n current.scrollTop += scrollDistanceY;\n }\n if (scrollDistanceX) {\n current.scrollLeft += scrollDistanceX;\n }\n const scrolledLeft = current.scrollLeft - scrollLeft;\n const scrolledTop = current.scrollTop - scrollTop;\n rect = {\n left: rect.left - scrolledLeft,\n top: rect.top - scrolledTop,\n right: rect.right - scrolledLeft,\n bottom: rect.bottom - scrolledTop,\n };\n }\n }\n\n current =\n isDocumentBody || style.position === 'fixed'\n ? null\n : getParentElement(current);\n }\n};\n\nexport default scrollRectIntoView;\n", "import { Registry } from 'parchment';\n\nconst MAX_REGISTER_ITERATIONS = 100;\nconst CORE_FORMATS = ['block', 'break', 'cursor', 'inline', 'scroll', 'text'];\n\nconst createRegistryWithFormats = (\n formats: string[],\n sourceRegistry: Registry,\n debug: { error: (errorMessage: string) => void },\n) => {\n const registry = new Registry();\n CORE_FORMATS.forEach((name) => {\n const coreBlot = sourceRegistry.query(name);\n if (coreBlot) registry.register(coreBlot);\n });\n\n formats.forEach((name) => {\n let format = sourceRegistry.query(name);\n if (!format) {\n debug.error(\n `Cannot register \"${name}\" specified in \"formats\" config. Are you sure it was registered?`,\n );\n }\n let iterations = 0;\n while (format) {\n registry.register(format);\n format = 'blotName' in format ? format.requiredContainer ?? null : null;\n\n iterations += 1;\n if (iterations > MAX_REGISTER_ITERATIONS) {\n debug.error(\n `Cycle detected in registering blot requiredContainer: \"${name}\"`,\n );\n break;\n }\n }\n });\n\n return registry;\n};\n\nexport default createRegistryWithFormats;\n", "import { merge } from 'lodash-es';\nimport * as Parchment from 'parchment';\nimport type { Op } from 'quill-delta';\nimport Delta from 'quill-delta';\nimport type { BlockEmbed } from '../blots/block.js';\nimport type Block from '../blots/block.js';\nimport type Scroll from '../blots/scroll.js';\nimport type Clipboard from '../modules/clipboard.js';\nimport type History from '../modules/history.js';\nimport type Keyboard from '../modules/keyboard.js';\nimport type Uploader from '../modules/uploader.js';\nimport Editor from './editor.js';\nimport Emitter from './emitter.js';\nimport type { EmitterSource } from './emitter.js';\nimport instances from './instances.js';\nimport logger from './logger.js';\nimport type { DebugLevel } from './logger.js';\nimport Module from './module.js';\nimport Selection, { Range } from './selection.js';\nimport type { Bounds } from './selection.js';\nimport Composition from './composition.js';\nimport Theme from './theme.js';\nimport type { ThemeConstructor } from './theme.js';\nimport scrollRectIntoView from './utils/scrollRectIntoView.js';\nimport type { Rect } from './utils/scrollRectIntoView.js';\nimport createRegistryWithFormats from './utils/createRegistryWithFormats.js';\n\nconst debug = logger('quill');\n\nconst globalRegistry = new Parchment.Registry();\nParchment.ParentBlot.uiClass = 'ql-ui';\n\n/**\n * Options for initializing a Quill instance\n */\nexport interface QuillOptions {\n theme?: string;\n debug?: DebugLevel | boolean;\n registry?: Parchment.Registry;\n /**\n * Whether to disable the editing\n * @default false\n */\n readOnly?: boolean;\n\n /**\n * Placeholder text to display when the editor is empty\n * @default \"\"\n */\n placeholder?: string;\n bounds?: HTMLElement | string | null;\n modules?: Record;\n\n /**\n * A list of formats that are recognized and can exist within the editor contents.\n * `null` means all formats are allowed.\n * @default null\n */\n formats?: string[] | null;\n}\n\n/**\n * Similar to QuillOptions, but with all properties expanded to their default values,\n * and all selectors resolved to HTMLElements.\n */\nexport interface ExpandedQuillOptions\n extends Omit {\n theme: ThemeConstructor;\n registry: Parchment.Registry;\n container: HTMLElement;\n modules: Record;\n bounds?: HTMLElement | null;\n readOnly: boolean;\n}\n\nclass Quill {\n static DEFAULTS = {\n bounds: null,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true,\n uploader: true,\n },\n placeholder: '',\n readOnly: false,\n registry: globalRegistry,\n theme: 'default',\n } satisfies Partial;\n static events = Emitter.events;\n static sources = Emitter.sources;\n static version = typeof QUILL_VERSION === 'undefined' ? 'dev' : QUILL_VERSION;\n\n static imports: Record = {\n delta: Delta,\n parchment: Parchment,\n 'core/module': Module,\n 'core/theme': Theme,\n };\n\n static debug(limit: DebugLevel | boolean) {\n if (limit === true) {\n limit = 'log';\n }\n logger.level(limit);\n }\n\n static find(node: Node, bubble = false) {\n return instances.get(node) || globalRegistry.find(node, bubble);\n }\n\n static import(name: 'core/module'): typeof Module;\n static import(name: `themes/${string}`): typeof Theme;\n static import(name: 'parchment'): typeof Parchment;\n static import(name: 'delta'): typeof Delta;\n static import(name: string): unknown;\n static import(name: string) {\n if (this.imports[name] == null) {\n debug.error(`Cannot import ${name}. Are you sure it was registered?`);\n }\n return this.imports[name];\n }\n\n static register(\n targets: Record<\n string,\n | Parchment.RegistryDefinition\n | Record // any objects\n | Theme\n | Module\n | Function // ES5 constructors\n >,\n overwrite?: boolean,\n ): void;\n static register(\n target: Parchment.RegistryDefinition,\n overwrite?: boolean,\n ): void;\n static register(path: string, target: any, overwrite?: boolean): void;\n static register(...args: any[]): void {\n if (typeof args[0] !== 'string') {\n const target = args[0];\n const overwrite = !!args[1];\n\n const name = 'attrName' in target ? target.attrName : target.blotName;\n if (typeof name === 'string') {\n // Shortcut for formats:\n // register(Blot | Attributor, overwrite)\n this.register(`formats/${name}`, target, overwrite);\n } else {\n Object.keys(target).forEach((key) => {\n this.register(key, target[key], overwrite);\n });\n }\n } else {\n const path = args[0];\n const target = args[1];\n const overwrite = !!args[2];\n\n if (this.imports[path] != null && !overwrite) {\n debug.warn(`Overwriting ${path} with`, target);\n }\n this.imports[path] = target;\n if (\n (path.startsWith('blots/') || path.startsWith('formats/')) &&\n target &&\n typeof target !== 'boolean' &&\n target.blotName !== 'abstract'\n ) {\n globalRegistry.register(target);\n }\n if (typeof target.register === 'function') {\n target.register(globalRegistry);\n }\n }\n }\n\n container: HTMLElement;\n root: HTMLDivElement;\n scroll: Scroll;\n emitter: Emitter;\n protected allowReadOnlyEdits: boolean;\n editor: Editor;\n composition: Composition;\n selection: Selection;\n\n theme: Theme;\n keyboard: Keyboard;\n clipboard: Clipboard;\n history: History;\n uploader: Uploader;\n\n options: ExpandedQuillOptions;\n\n constructor(container: HTMLElement | string, options: QuillOptions = {}) {\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n debug.error('Invalid Quill container', container);\n return;\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n const html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n instances.set(this.container, this);\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.emitter = new Emitter();\n const scrollBlotName = Parchment.ScrollBlot.blotName;\n const ScrollBlot = this.options.registry.query(scrollBlotName);\n if (!ScrollBlot || !('blotName' in ScrollBlot)) {\n throw new Error(\n `Cannot initialize Quill without \"${scrollBlotName}\" blot`,\n );\n }\n this.scroll = new ScrollBlot(this.options.registry, this.root, {\n emitter: this.emitter,\n }) as Scroll;\n this.editor = new Editor(this.scroll);\n this.selection = new Selection(this.scroll, this.emitter);\n this.composition = new Composition(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options); // eslint-disable-line new-cap\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.uploader = this.theme.addModule('uploader');\n this.theme.addModule('input');\n this.theme.addModule('uiNode');\n this.theme.init();\n this.emitter.on(Emitter.events.EDITOR_CHANGE, (type) => {\n if (type === Emitter.events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(Emitter.events.SCROLL_UPDATE, (source, mutations) => {\n const oldRange = this.selection.lastRange;\n const [newRange] = this.selection.getRange();\n const selectionInfo =\n oldRange && newRange ? { oldRange, newRange } : undefined;\n modify.call(\n this,\n () => this.editor.update(null, mutations, selectionInfo),\n source,\n );\n });\n this.emitter.on(Emitter.events.SCROLL_EMBED_UPDATE, (blot, delta) => {\n const oldRange = this.selection.lastRange;\n const [newRange] = this.selection.getRange();\n const selectionInfo =\n oldRange && newRange ? { oldRange, newRange } : undefined;\n modify.call(\n this,\n () => {\n const change = new Delta()\n .retain(blot.offset(this))\n .retain({ [blot.statics.blotName]: delta });\n return this.editor.update(change, [], selectionInfo);\n },\n Quill.sources.USER,\n );\n });\n if (html) {\n const contents = this.clipboard.convert({\n html: `${html}


    `,\n text: '\\n',\n });\n this.setContents(contents);\n }\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n this.allowReadOnlyEdits = false;\n }\n\n addContainer(container: string, refNode?: Node | null): HTMLDivElement;\n addContainer(container: HTMLElement, refNode?: Node | null): HTMLElement;\n addContainer(\n container: string | HTMLElement,\n refNode: Node | null = null,\n ): HTMLDivElement | HTMLElement {\n if (typeof container === 'string') {\n const className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(range: Range, source?: EmitterSource): Delta;\n deleteText(index: number, length: number, source?: EmitterSource): Delta;\n deleteText(\n index: number | Range,\n length?: number | EmitterSource,\n source?: EmitterSource,\n ): Delta {\n // @ts-expect-error\n [index, length, , source] = overload(index, length, source);\n return modify.call(\n this,\n () => {\n return this.editor.deleteText(index, length);\n },\n source,\n index,\n -1 * length,\n );\n }\n\n disable() {\n this.enable(false);\n }\n\n editReadOnly(modifier: () => T): T {\n this.allowReadOnlyEdits = true;\n const value = modifier();\n this.allowReadOnlyEdits = false;\n return value;\n }\n\n enable(enabled = true) {\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus(options: { preventScroll?: boolean } = {}) {\n this.selection.focus();\n if (!options.preventScroll) {\n this.scrollSelectionIntoView();\n }\n }\n\n format(\n name: string,\n value: unknown,\n source: EmitterSource = Emitter.sources.API,\n ): Delta {\n return modify.call(\n this,\n () => {\n const range = this.getSelection(true);\n let change = new Delta();\n if (range == null) return change;\n if (this.scroll.query(name, Parchment.Scope.BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, {\n [name]: value,\n });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, {\n [name]: value,\n });\n }\n this.setSelection(range, Emitter.sources.SILENT);\n return change;\n },\n source,\n );\n }\n\n formatLine(\n index: number,\n length: number,\n formats: Record,\n source?: EmitterSource,\n ): Delta;\n formatLine(\n index: number,\n length: number,\n name: string,\n value?: unknown,\n source?: EmitterSource,\n ): Delta;\n formatLine(\n index: number,\n length: number,\n name: string | Record,\n value?: unknown | EmitterSource,\n source?: EmitterSource,\n ): Delta {\n let formats: Record;\n // eslint-disable-next-line prefer-const\n [index, length, formats, source] = overload(\n index,\n length,\n // @ts-expect-error\n name,\n value,\n source,\n );\n return modify.call(\n this,\n () => {\n return this.editor.formatLine(index, length, formats);\n },\n source,\n index,\n 0,\n );\n }\n\n formatText(\n range: Range,\n name: string,\n value: unknown,\n source?: EmitterSource,\n ): Delta;\n formatText(\n index: number,\n length: number,\n name: string,\n value: unknown,\n source?: EmitterSource,\n ): Delta;\n formatText(\n index: number,\n length: number,\n formats: Record,\n source?: EmitterSource,\n ): Delta;\n formatText(\n index: number | Range,\n length: number | string,\n name: string | unknown,\n value?: unknown | EmitterSource,\n source?: EmitterSource,\n ): Delta {\n let formats: Record;\n // eslint-disable-next-line prefer-const\n [index, length, formats, source] = overload(\n // @ts-expect-error\n index,\n length,\n name,\n value,\n source,\n );\n return modify.call(\n this,\n () => {\n return this.editor.formatText(index, length, formats);\n },\n source,\n index,\n 0,\n );\n }\n\n getBounds(index: number | Range, length = 0): Bounds | null {\n let bounds: Bounds | null = null;\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n if (!bounds) return null;\n const containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width,\n };\n }\n\n getContents(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getContents(index, length);\n }\n\n getFormat(index?: number, length?: number): { [format: string]: unknown };\n getFormat(range?: Range): {\n [format: string]: unknown;\n };\n getFormat(\n index: Range | number = this.getSelection(true),\n length = 0,\n ): { [format: string]: unknown } {\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n }\n return this.editor.getFormat(index.index, index.length);\n }\n\n getIndex(blot: Parchment.Blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index: number) {\n return this.scroll.leaf(index);\n }\n\n getLine(index: number) {\n return this.scroll.line(index);\n }\n\n getLines(range: Range): (Block | BlockEmbed)[];\n getLines(index?: number, length?: number): (Block | BlockEmbed)[];\n getLines(\n index: Range | number = 0,\n length = Number.MAX_VALUE,\n ): (Block | BlockEmbed)[] {\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n }\n return this.scroll.lines(index, length);\n }\n\n getModule(name: string) {\n return this.theme.modules[name];\n }\n\n getSelection(focus: true): Range;\n getSelection(focus?: boolean): Range | null;\n getSelection(focus = false): Range | null {\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n\n getSemanticHTML(range: Range): string;\n getSemanticHTML(index?: number, length?: number): string;\n getSemanticHTML(index: Range | number = 0, length?: number) {\n if (typeof index === 'number') {\n length = length ?? this.getLength() - index;\n }\n // @ts-expect-error\n [index, length] = overload(index, length);\n return this.editor.getHTML(index, length);\n }\n\n getText(range?: Range): string;\n getText(index?: number, length?: number): string;\n getText(index: Range | number = 0, length?: number): string {\n if (typeof index === 'number') {\n length = length ?? this.getLength() - index;\n }\n // @ts-expect-error\n [index, length] = overload(index, length);\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(\n index: number,\n embed: string,\n value: unknown,\n source: EmitterSource = Quill.sources.API,\n ): Delta {\n return modify.call(\n this,\n () => {\n return this.editor.insertEmbed(index, embed, value);\n },\n source,\n index,\n );\n }\n\n insertText(index: number, text: string, source?: EmitterSource): Delta;\n insertText(\n index: number,\n text: string,\n formats: Record,\n source?: EmitterSource,\n ): Delta;\n insertText(\n index: number,\n text: string,\n name: string,\n value: unknown,\n source?: EmitterSource,\n ): Delta;\n insertText(\n index: number,\n text: string,\n name?: string | Record | EmitterSource,\n value?: unknown,\n source?: EmitterSource,\n ): Delta {\n let formats: Record;\n // eslint-disable-next-line prefer-const\n // @ts-expect-error\n [index, , formats, source] = overload(index, 0, name, value, source);\n return modify.call(\n this,\n () => {\n return this.editor.insertText(index, text, formats);\n },\n source,\n index,\n text.length,\n );\n }\n\n isEnabled() {\n return this.scroll.isEnabled();\n }\n\n off(...args: Parameters<(typeof Emitter)['prototype']['off']>) {\n return this.emitter.off(...args);\n }\n\n on(\n event: (typeof Emitter)['events']['TEXT_CHANGE'],\n handler: (delta: Delta, oldContent: Delta, source: EmitterSource) => void,\n ): Emitter;\n on(\n event: (typeof Emitter)['events']['SELECTION_CHANGE'],\n handler: (range: Range, oldRange: Range, source: EmitterSource) => void,\n ): Emitter;\n on(\n event: (typeof Emitter)['events']['EDITOR_CHANGE'],\n handler: (\n ...args:\n | [\n (typeof Emitter)['events']['TEXT_CHANGE'],\n Delta,\n Delta,\n EmitterSource,\n ]\n | [\n (typeof Emitter)['events']['SELECTION_CHANGE'],\n Range,\n Range,\n EmitterSource,\n ]\n ) => void,\n ): Emitter;\n on(event: string, ...args: unknown[]): Emitter;\n on(...args: Parameters<(typeof Emitter)['prototype']['on']>): Emitter {\n return this.emitter.on(...args);\n }\n\n once(...args: Parameters<(typeof Emitter)['prototype']['once']>) {\n return this.emitter.once(...args);\n }\n\n removeFormat(index: number, length: number, source?: EmitterSource): Delta {\n [index, length, , source] = overload(index, length, source);\n return modify.call(\n this,\n () => {\n return this.editor.removeFormat(index, length);\n },\n source,\n index,\n );\n }\n\n scrollRectIntoView(rect: Rect) {\n scrollRectIntoView(this.root, rect);\n }\n\n /**\n * @deprecated Use Quill#scrollSelectionIntoView() instead.\n */\n scrollIntoView() {\n console.warn(\n 'Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead.',\n );\n this.scrollSelectionIntoView();\n }\n\n /**\n * Scroll the current selection into the visible area.\n * If the selection is already visible, no scrolling will occur.\n */\n scrollSelectionIntoView() {\n const range = this.selection.lastRange;\n const bounds = range && this.selection.getBounds(range.index, range.length);\n if (bounds) {\n this.scrollRectIntoView(bounds);\n }\n }\n\n setContents(\n delta: Delta | Op[],\n source: EmitterSource = Emitter.sources.API,\n ): Delta {\n return modify.call(\n this,\n () => {\n delta = new Delta(delta);\n const length = this.getLength();\n // Quill will set empty editor to \\n\n const delete1 = this.editor.deleteText(0, length);\n const applied = this.editor.insertContents(0, delta);\n // Remove extra \\n from empty editor initialization\n const delete2 = this.editor.deleteText(this.getLength() - 1, 1);\n return delete1.compose(applied).compose(delete2);\n },\n source,\n );\n }\n setSelection(range: Range | null, source?: EmitterSource): void;\n setSelection(index: number, source?: EmitterSource): void;\n setSelection(index: number, length?: number, source?: EmitterSource): void;\n setSelection(index: number, source?: EmitterSource): void;\n setSelection(\n index: Range | null | number,\n length?: EmitterSource | number,\n source?: EmitterSource,\n ): void {\n if (index == null) {\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/22609\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n // @ts-expect-error\n [index, length, , source] = overload(index, length, source);\n this.selection.setRange(new Range(Math.max(0, index), length), source);\n if (source !== Emitter.sources.SILENT) {\n this.scrollSelectionIntoView();\n }\n }\n }\n\n setText(text: string, source: EmitterSource = Emitter.sources.API) {\n const delta = new Delta().insert(text);\n return this.setContents(delta, source);\n }\n\n update(source: EmitterSource = Emitter.sources.USER) {\n const change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n // TODO this is usually undefined\n return change;\n }\n\n updateContents(\n delta: Delta | Op[],\n source: EmitterSource = Emitter.sources.API,\n ): Delta {\n return modify.call(\n this,\n () => {\n delta = new Delta(delta);\n return this.editor.applyDelta(delta);\n },\n source,\n true,\n );\n }\n}\n\nfunction resolveSelector(selector: string | HTMLElement | null | undefined) {\n return typeof selector === 'string'\n ? document.querySelector(selector)\n : selector;\n}\n\nfunction expandModuleConfig(config: Record | undefined) {\n return Object.entries(config ?? {}).reduce(\n (expanded, [key, value]) => ({\n ...expanded,\n [key]: value === true ? {} : value,\n }),\n {} as Record,\n );\n}\n\nfunction omitUndefinedValuesFromOptions(obj: QuillOptions) {\n return Object.fromEntries(\n Object.entries(obj).filter((entry) => entry[1] !== undefined),\n );\n}\n\nfunction expandConfig(\n containerOrSelector: HTMLElement | string,\n options: QuillOptions,\n): ExpandedQuillOptions {\n const container = resolveSelector(containerOrSelector);\n if (!container) {\n throw new Error('Invalid Quill container');\n }\n\n const shouldUseDefaultTheme =\n !options.theme || options.theme === Quill.DEFAULTS.theme;\n const theme = shouldUseDefaultTheme\n ? Theme\n : Quill.import(`themes/${options.theme}`);\n if (!theme) {\n throw new Error(`Invalid theme ${options.theme}. Did you register it?`);\n }\n\n const { modules: quillModuleDefaults, ...quillDefaults } = Quill.DEFAULTS;\n const { modules: themeModuleDefaults, ...themeDefaults } = theme.DEFAULTS;\n\n let userModuleOptions = expandModuleConfig(options.modules);\n // Special case toolbar shorthand\n if (\n userModuleOptions != null &&\n userModuleOptions.toolbar &&\n userModuleOptions.toolbar.constructor !== Object\n ) {\n userModuleOptions = {\n ...userModuleOptions,\n toolbar: { container: userModuleOptions.toolbar },\n };\n }\n\n const modules: ExpandedQuillOptions['modules'] = merge(\n {},\n expandModuleConfig(quillModuleDefaults),\n expandModuleConfig(themeModuleDefaults),\n userModuleOptions,\n );\n\n const config = {\n ...quillDefaults,\n ...omitUndefinedValuesFromOptions(themeDefaults),\n ...omitUndefinedValuesFromOptions(options),\n };\n\n let registry = options.registry;\n if (registry) {\n if (options.formats) {\n debug.warn('Ignoring \"formats\" option because \"registry\" is specified');\n }\n } else {\n registry = options.formats\n ? createRegistryWithFormats(options.formats, config.registry, debug)\n : config.registry;\n }\n\n return {\n ...config,\n registry,\n container,\n theme,\n modules: Object.entries(modules).reduce(\n (modulesWithDefaults, [name, value]) => {\n if (!value) return modulesWithDefaults;\n\n const moduleClass = Quill.import(`modules/${name}`);\n if (moduleClass == null) {\n debug.error(\n `Cannot load ${name} module. Are you sure you registered it?`,\n );\n return modulesWithDefaults;\n }\n return {\n ...modulesWithDefaults,\n // @ts-expect-error\n [name]: merge({}, moduleClass.DEFAULTS || {}, value),\n };\n },\n {},\n ),\n bounds: resolveSelector(config.bounds),\n };\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(\n modifier: () => Delta,\n source: EmitterSource,\n index: number | boolean,\n shift: number | null,\n) {\n if (\n !this.isEnabled() &&\n source === Emitter.sources.USER &&\n !this.allowReadOnlyEdits\n ) {\n return new Delta();\n }\n let range = index == null ? null : this.getSelection();\n const oldDelta = this.editor.delta;\n const change = modifier();\n if (range != null) {\n if (index === true) {\n index = range.index; // eslint-disable-line prefer-destructuring\n }\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n // @ts-expect-error index should always be number\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, Emitter.sources.SILENT);\n }\n if (change.length() > 0) {\n const args = [Emitter.events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n return change;\n}\n\ntype NormalizedIndexLength = [\n number,\n number,\n Record,\n EmitterSource,\n];\nfunction overload(index: number, source?: EmitterSource): NormalizedIndexLength;\nfunction overload(\n index: number,\n length: number,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n index: number,\n length: number,\n format: string,\n value: unknown,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n index: number,\n length: number,\n format: Record,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(range: Range, source?: EmitterSource): NormalizedIndexLength;\nfunction overload(\n range: Range,\n format: string,\n value: unknown,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n range: Range,\n format: Record,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n index: Range | number,\n length?: number | string | Record | EmitterSource,\n name?: string | unknown | Record | EmitterSource,\n value?: unknown | EmitterSource,\n source?: EmitterSource,\n): NormalizedIndexLength {\n let formats: Record = {};\n // @ts-expect-error\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n // @ts-expect-error\n source = value;\n value = name;\n name = length;\n // @ts-expect-error\n length = index.length; // eslint-disable-line prefer-destructuring\n // @ts-expect-error\n index = index.index; // eslint-disable-line prefer-destructuring\n } else {\n // @ts-expect-error\n length = index.length; // eslint-disable-line prefer-destructuring\n // @ts-expect-error\n index = index.index; // eslint-disable-line prefer-destructuring\n }\n } else if (typeof length !== 'number') {\n // @ts-expect-error\n source = value;\n value = name;\n name = length;\n length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if (typeof name === 'object') {\n // @ts-expect-error Fix me later\n formats = name;\n // @ts-expect-error\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n // @ts-expect-error\n source = name;\n }\n }\n // Handle optional source\n source = source || Emitter.sources.API;\n // @ts-expect-error\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range: Range, change: Delta, source?: EmitterSource): Range;\nfunction shiftRange(\n range: Range,\n index: number,\n length?: number,\n source?: EmitterSource,\n): Range;\nfunction shiftRange(\n range: Range,\n index: number | Delta,\n lengthOrSource?: number | EmitterSource,\n source?: EmitterSource,\n) {\n const length = typeof lengthOrSource === 'number' ? lengthOrSource : 0;\n if (range == null) return null;\n let start;\n let end;\n // @ts-expect-error -- TODO: add a better type guard around `index`\n if (index && typeof index.transformPosition === 'function') {\n [start, end] = [range.index, range.index + range.length].map((pos) =>\n // @ts-expect-error -- TODO: add a better type guard around `index`\n index.transformPosition(pos, source !== Emitter.sources.USER),\n );\n } else {\n [start, end] = [range.index, range.index + range.length].map((pos) => {\n // @ts-expect-error -- TODO: add a better type guard around `index`\n if (pos < index || (pos === index && source === Emitter.sources.USER))\n return pos;\n if (length >= 0) {\n return pos + length;\n }\n // @ts-expect-error -- TODO: add a better type guard around `index`\n return Math.max(index, pos + length);\n });\n }\n return new Range(start, end - start);\n}\n\nexport type { Bounds, DebugLevel, EmitterSource };\nexport { Parchment, Range };\n\nexport { globalRegistry, expandConfig, overload, Quill as default };\n", "import { ContainerBlot } from 'parchment';\n\nclass Container extends ContainerBlot {}\n\nexport default Container;\n", "import { ContainerBlot, LeafBlot, Scope, ScrollBlot } from 'parchment';\nimport type { Blot, Parent, EmbedBlot, ParentBlot, Registry } from 'parchment';\nimport Delta, { AttributeMap, Op } from 'quill-delta';\nimport Emitter from '../core/emitter.js';\nimport type { EmitterSource } from '../core/emitter.js';\nimport Block, { BlockEmbed, bubbleFormats } from './block.js';\nimport Break from './break.js';\nimport Container from './container.js';\n\ntype RenderBlock =\n | {\n type: 'blockEmbed';\n attributes: AttributeMap;\n key: string;\n value: unknown;\n }\n | { type: 'block'; attributes: AttributeMap; delta: Delta };\n\nfunction isLine(blot: unknown): blot is Block | BlockEmbed {\n return blot instanceof Block || blot instanceof BlockEmbed;\n}\n\ninterface UpdatableEmbed {\n updateContent(change: unknown): void;\n}\n\nfunction isUpdatable(blot: Blot): blot is Blot & UpdatableEmbed {\n return typeof (blot as unknown as any).updateContent === 'function';\n}\n\nclass Scroll extends ScrollBlot {\n static blotName = 'scroll';\n static className = 'ql-editor';\n static tagName = 'DIV';\n static defaultChild = Block;\n static allowedChildren = [Block, BlockEmbed, Container];\n\n emitter: Emitter;\n batch: false | MutationRecord[];\n\n constructor(\n registry: Registry,\n domNode: HTMLDivElement,\n { emitter }: { emitter: Emitter },\n ) {\n super(registry, domNode);\n this.emitter = emitter;\n this.batch = false;\n this.optimize();\n this.enable();\n this.domNode.addEventListener('dragstart', (e) => this.handleDragStart(e));\n }\n\n batchStart() {\n if (!Array.isArray(this.batch)) {\n this.batch = [];\n }\n }\n\n batchEnd() {\n if (!this.batch) return;\n const mutations = this.batch;\n this.batch = false;\n this.update(mutations);\n }\n\n emitMount(blot: Blot) {\n this.emitter.emit(Emitter.events.SCROLL_BLOT_MOUNT, blot);\n }\n\n emitUnmount(blot: Blot) {\n this.emitter.emit(Emitter.events.SCROLL_BLOT_UNMOUNT, blot);\n }\n\n emitEmbedUpdate(blot: Blot, change: unknown) {\n this.emitter.emit(Emitter.events.SCROLL_EMBED_UPDATE, blot, change);\n }\n\n deleteAt(index: number, length: number) {\n const [first, offset] = this.line(index);\n const [last] = this.line(index + length);\n super.deleteAt(index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof BlockEmbed || last instanceof BlockEmbed) {\n this.optimize();\n return;\n }\n const ref =\n last.children.head instanceof Break ? null : last.children.head;\n // @ts-expect-error\n first.moveChildren(last, ref);\n // @ts-expect-error\n first.remove();\n }\n this.optimize();\n }\n\n enable(enabled = true) {\n this.domNode.setAttribute('contenteditable', enabled ? 'true' : 'false');\n }\n\n formatAt(index: number, length: number, format: string, value: unknown) {\n super.formatAt(index, length, format, value);\n this.optimize();\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n if (index >= this.length()) {\n if (def == null || this.scroll.query(value, Scope.BLOCK) == null) {\n const blot = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n blot.insertAt(0, value.slice(0, -1), def);\n } else {\n blot.insertAt(0, value, def);\n }\n } else {\n const embed = this.scroll.create(value, def);\n this.appendChild(embed);\n }\n } else {\n super.insertAt(index, value, def);\n }\n this.optimize();\n }\n\n insertBefore(blot: Blot, ref?: Blot | null) {\n if (blot.statics.scope === Scope.INLINE_BLOT) {\n const wrapper = this.scroll.create(\n this.statics.defaultChild.blotName,\n ) as Parent;\n wrapper.appendChild(blot);\n super.insertBefore(wrapper, ref);\n } else {\n super.insertBefore(blot, ref);\n }\n }\n\n insertContents(index: number, delta: Delta) {\n const renderBlocks = this.deltaToRenderBlocks(\n delta.concat(new Delta().insert('\\n')),\n );\n const last = renderBlocks.pop();\n if (last == null) return;\n\n this.batchStart();\n\n const first = renderBlocks.shift();\n if (first) {\n const shouldInsertNewlineChar =\n first.type === 'block' &&\n (first.delta.length() === 0 ||\n (!this.descendant(BlockEmbed, index)[0] && index < this.length()));\n const delta =\n first.type === 'block'\n ? first.delta\n : new Delta().insert({ [first.key]: first.value });\n insertInlineContents(this, index, delta);\n const newlineCharLength = first.type === 'block' ? 1 : 0;\n const lineEndIndex = index + delta.length() + newlineCharLength;\n if (shouldInsertNewlineChar) {\n this.insertAt(lineEndIndex - 1, '\\n');\n }\n\n const formats = bubbleFormats(this.line(index)[0]);\n const attributes = AttributeMap.diff(formats, first.attributes) || {};\n Object.keys(attributes).forEach((name) => {\n this.formatAt(lineEndIndex - 1, 1, name, attributes[name]);\n });\n\n index = lineEndIndex;\n }\n\n let [refBlot, refBlotOffset] = this.children.find(index);\n if (renderBlocks.length) {\n if (refBlot) {\n refBlot = refBlot.split(refBlotOffset);\n refBlotOffset = 0;\n }\n\n renderBlocks.forEach((renderBlock) => {\n if (renderBlock.type === 'block') {\n const block = this.createBlock(\n renderBlock.attributes,\n refBlot || undefined,\n );\n insertInlineContents(block, 0, renderBlock.delta);\n } else {\n const blockEmbed = this.create(\n renderBlock.key,\n renderBlock.value,\n ) as EmbedBlot;\n this.insertBefore(blockEmbed, refBlot || undefined);\n Object.keys(renderBlock.attributes).forEach((name) => {\n blockEmbed.format(name, renderBlock.attributes[name]);\n });\n }\n });\n }\n\n if (last.type === 'block' && last.delta.length()) {\n const offset = refBlot\n ? refBlot.offset(refBlot.scroll) + refBlotOffset\n : this.length();\n insertInlineContents(this, offset, last.delta);\n }\n\n this.batchEnd();\n this.optimize();\n }\n\n isEnabled() {\n return this.domNode.getAttribute('contenteditable') === 'true';\n }\n\n leaf(index: number): [LeafBlot | null, number] {\n const last = this.path(index).pop();\n if (!last) {\n return [null, -1];\n }\n\n const [blot, offset] = last;\n return blot instanceof LeafBlot ? [blot, offset] : [null, -1];\n }\n\n line(index: number): [Block | BlockEmbed | null, number] {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n // @ts-expect-error TODO: make descendant() generic\n return this.descendant(isLine, index);\n }\n\n lines(index = 0, length = Number.MAX_VALUE): (Block | BlockEmbed)[] {\n const getLines = (\n blot: ParentBlot,\n blotIndex: number,\n blotLength: number,\n ) => {\n let lines: (Block | BlockEmbed)[] = [];\n let lengthLeft = blotLength;\n blot.children.forEachAt(\n blotIndex,\n blotLength,\n (child, childIndex, childLength) => {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof ContainerBlot) {\n lines = lines.concat(getLines(child, childIndex, lengthLeft));\n }\n lengthLeft -= childLength;\n },\n );\n return lines;\n };\n return getLines(this, index, length);\n }\n\n optimize(context?: { [key: string]: any }): void;\n optimize(\n mutations?: MutationRecord[],\n context?: { [key: string]: any },\n ): void;\n optimize(mutations = [], context = {}) {\n if (this.batch) return;\n super.optimize(mutations, context);\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n\n path(index: number) {\n return super.path(index).slice(1); // Exclude self\n }\n\n remove() {\n // Never remove self\n }\n\n update(source?: EmitterSource): void;\n update(mutations?: MutationRecord[]): void;\n update(mutations?: MutationRecord[] | EmitterSource): void {\n if (this.batch) {\n if (Array.isArray(mutations)) {\n this.batch = this.batch.concat(mutations);\n }\n return;\n }\n let source: EmitterSource = Emitter.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n mutations = mutations.filter(({ target }) => {\n const blot = this.find(target, true);\n return blot && !isUpdatable(blot);\n });\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n super.update(mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_UPDATE, source, mutations);\n }\n }\n\n updateEmbedAt(index: number, key: string, change: unknown) {\n // Currently it only supports top-level embeds (BlockEmbed).\n // We can update `ParentBlot` in parchment to support inline embeds.\n const [blot] = this.descendant((b: Blot) => b instanceof BlockEmbed, index);\n if (blot && blot.statics.blotName === key && isUpdatable(blot)) {\n blot.updateContent(change);\n }\n }\n\n protected handleDragStart(event: DragEvent) {\n event.preventDefault();\n }\n\n private deltaToRenderBlocks(delta: Delta) {\n const renderBlocks: RenderBlock[] = [];\n\n let currentBlockDelta = new Delta();\n delta.forEach((op) => {\n const insert = op?.insert;\n if (!insert) return;\n if (typeof insert === 'string') {\n const splitted = insert.split('\\n');\n splitted.slice(0, -1).forEach((text) => {\n currentBlockDelta.insert(text, op.attributes);\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: op.attributes ?? {},\n });\n currentBlockDelta = new Delta();\n });\n const last = splitted[splitted.length - 1];\n if (last) {\n currentBlockDelta.insert(last, op.attributes);\n }\n } else {\n const key = Object.keys(insert)[0];\n if (!key) return;\n if (this.query(key, Scope.INLINE)) {\n currentBlockDelta.push(op);\n } else {\n if (currentBlockDelta.length()) {\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: {},\n });\n }\n currentBlockDelta = new Delta();\n renderBlocks.push({\n type: 'blockEmbed',\n key,\n value: insert[key],\n attributes: op.attributes ?? {},\n });\n }\n }\n });\n\n if (currentBlockDelta.length()) {\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: {},\n });\n }\n\n return renderBlocks;\n }\n\n private createBlock(attributes: AttributeMap, refBlot?: Blot) {\n let blotName: string | undefined;\n const formats: AttributeMap = {};\n\n Object.entries(attributes).forEach(([key, value]) => {\n const isBlockBlot = this.query(key, Scope.BLOCK & Scope.BLOT) != null;\n if (isBlockBlot) {\n blotName = key;\n } else {\n formats[key] = value;\n }\n });\n\n const block = this.create(\n blotName || this.statics.defaultChild.blotName,\n blotName ? attributes[blotName] : undefined,\n ) as ParentBlot;\n\n this.insertBefore(block, refBlot || undefined);\n\n const length = block.length();\n Object.entries(formats).forEach(([key, value]) => {\n block.formatAt(0, length, key, value);\n });\n\n return block;\n }\n}\n\nfunction insertInlineContents(\n parent: ParentBlot,\n index: number,\n inlineContents: Delta,\n) {\n inlineContents.reduce((index, op) => {\n const length = Op.length(op);\n let attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n const text = op.insert;\n parent.insertAt(index, text);\n const [leaf] = parent.descendant(LeafBlot, index);\n const formats = bubbleFormats(leaf);\n attributes = AttributeMap.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n const key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n parent.insertAt(index, key, op.insert[key]);\n const isInlineEmbed = parent.scroll.query(key, Scope.INLINE) != null;\n if (isInlineEmbed) {\n const [leaf] = parent.descendant(LeafBlot, index);\n const formats = bubbleFormats(leaf);\n attributes = AttributeMap.diff(formats, attributes) || {};\n }\n }\n }\n Object.keys(attributes).forEach((key) => {\n parent.formatAt(index, length, key, attributes[key]);\n });\n return index + length;\n }, index);\n}\n\nexport default Scroll;\n", "import { Attributor, ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.BLOCK,\n whitelist: ['right', 'center', 'justify'],\n};\n\nconst AlignAttribute = new Attributor('align', 'align', config);\nconst AlignClass = new ClassAttributor('align', 'ql-align', config);\nconst AlignStyle = new StyleAttributor('align', 'text-align', config);\n\nexport { AlignAttribute, AlignClass, AlignStyle };\n", "import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nclass ColorAttributor extends StyleAttributor {\n value(domNode: HTMLElement) {\n let value = super.value(domNode) as string;\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n const hex = value\n .split(',')\n .map((component) => `00${parseInt(component, 10).toString(16)}`.slice(-2))\n .join('');\n return `#${hex}`;\n }\n}\n\nconst ColorClass = new ClassAttributor('color', 'ql-color', {\n scope: Scope.INLINE,\n});\nconst ColorStyle = new ColorAttributor('color', 'color', {\n scope: Scope.INLINE,\n});\n\nexport { ColorAttributor, ColorClass, ColorStyle };\n", "import { ClassAttributor, Scope } from 'parchment';\nimport { ColorAttributor } from './color.js';\n\nconst BackgroundClass = new ClassAttributor('background', 'ql-bg', {\n scope: Scope.INLINE,\n});\nconst BackgroundStyle = new ColorAttributor('background', 'background-color', {\n scope: Scope.INLINE,\n});\n\nexport { BackgroundClass, BackgroundStyle };\n", "import Block from '../blots/block.js';\nimport Break from '../blots/break.js';\nimport Cursor from '../blots/cursor.js';\nimport Inline from '../blots/inline.js';\nimport TextBlot, { escapeText } from '../blots/text.js';\nimport Container from '../blots/container.js';\nimport Quill from '../core/quill.js';\n\nclass CodeBlockContainer extends Container {\n static create(value: string) {\n const domNode = super.create(value) as Element;\n domNode.setAttribute('spellcheck', 'false');\n return domNode;\n }\n\n code(index: number, length: number) {\n return (\n this.children\n // @ts-expect-error\n .map((child) => (child.length() <= 1 ? '' : child.domNode.innerText))\n .join('\\n')\n .slice(index, index + length)\n );\n }\n\n html(index: number, length: number) {\n // `\\n`s are needed in order to support empty lines at the beginning and the end.\n // https://html.spec.whatwg.org/multipage/syntax.html#element-restrictions\n return `
    \\n${escapeText(this.code(index, length))}\\n
    `;\n }\n}\n\nclass CodeBlock extends Block {\n static TAB = ' ';\n\n static register() {\n Quill.register(CodeBlockContainer);\n }\n}\n\nclass Code extends Inline {}\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\nCodeBlock.blotName = 'code-block';\nCodeBlock.className = 'ql-code-block';\nCodeBlock.tagName = 'DIV';\nCodeBlockContainer.blotName = 'code-block-container';\nCodeBlockContainer.className = 'ql-code-block-container';\nCodeBlockContainer.tagName = 'DIV';\n\nCodeBlockContainer.allowedChildren = [CodeBlock];\n\nCodeBlock.allowedChildren = [TextBlot, Break, Cursor];\nCodeBlock.requiredContainer = CodeBlockContainer;\n\nexport { Code, CodeBlockContainer, CodeBlock as default };\n", "import { Attributor, ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.BLOCK,\n whitelist: ['rtl'],\n};\n\nconst DirectionAttribute = new Attributor('direction', 'dir', config);\nconst DirectionClass = new ClassAttributor('direction', 'ql-direction', config);\nconst DirectionStyle = new StyleAttributor('direction', 'direction', config);\n\nexport { DirectionAttribute, DirectionClass, DirectionStyle };\n", "import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.INLINE,\n whitelist: ['serif', 'monospace'],\n};\n\nconst FontClass = new ClassAttributor('font', 'ql-font', config);\n\nclass FontStyleAttributor extends StyleAttributor {\n value(node: HTMLElement) {\n return super.value(node).replace(/[\"']/g, '');\n }\n}\n\nconst FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexport { FontStyle, FontClass };\n", "import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst SizeClass = new ClassAttributor('size', 'ql-size', {\n scope: Scope.INLINE,\n whitelist: ['small', 'large', 'huge'],\n});\nconst SizeStyle = new StyleAttributor('size', 'font-size', {\n scope: Scope.INLINE,\n whitelist: ['10px', '18px', '32px'],\n});\n\nexport { SizeClass, SizeStyle };\n", "import { cloneDeep, isEqual } from 'lodash-es';\nimport Delta, { AttributeMap } from 'quill-delta';\nimport { EmbedBlot, Scope, TextBlot } from 'parchment';\nimport type { Blot, BlockBlot } from 'parchment';\nimport Quill from '../core/quill.js';\nimport logger from '../core/logger.js';\nimport Module from '../core/module.js';\nimport type { BlockEmbed } from '../blots/block.js';\nimport type { Range } from '../core/selection.js';\n\nconst debug = logger('quill:keyboard');\n\nconst SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\nexport interface Context {\n collapsed: boolean;\n empty: boolean;\n offset: number;\n prefix: string;\n suffix: string;\n format: Record;\n event: KeyboardEvent;\n line: BlockEmbed | BlockBlot;\n}\n\ninterface BindingObject\n extends Partial> {\n key: number | string | string[];\n shortKey?: boolean | null;\n shiftKey?: boolean | null;\n altKey?: boolean | null;\n metaKey?: boolean | null;\n ctrlKey?: boolean | null;\n prefix?: RegExp;\n suffix?: RegExp;\n format?: Record | string[];\n handler?: (\n this: { quill: Quill },\n range: Range,\n curContext: Context,\n // eslint-disable-next-line no-use-before-define\n binding: NormalizedBinding,\n ) => boolean | void;\n}\n\ntype Binding = BindingObject | string | number;\n\ninterface NormalizedBinding extends Omit {\n key: string | number;\n}\n\ninterface KeyboardOptions {\n bindings: Record;\n}\n\ninterface KeyboardOptions {\n bindings: Record;\n}\n\nclass Keyboard extends Module {\n static DEFAULTS: KeyboardOptions;\n\n static match(evt: KeyboardEvent, binding: BindingObject) {\n if (\n (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'] as const).some((key) => {\n return !!binding[key] !== evt[key] && binding[key] !== null;\n })\n ) {\n return false;\n }\n return binding.key === evt.key || binding.key === evt.which;\n }\n\n bindings: Record;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n this.bindings = {};\n // @ts-expect-error Fix me later\n Object.keys(this.options.bindings).forEach((name) => {\n // @ts-expect-error Fix me later\n if (this.options.bindings[name]) {\n // @ts-expect-error Fix me later\n this.addBinding(this.options.bindings[name]);\n }\n });\n this.addBinding({ key: 'Enter', shiftKey: null }, this.handleEnter);\n this.addBinding(\n { key: 'Enter', metaKey: null, ctrlKey: null, altKey: null },\n () => {},\n );\n if (/Firefox/i.test(navigator.userAgent)) {\n // Need to handle delete and backspace for Firefox in the general case #1171\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: true },\n this.handleBackspace,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: true },\n this.handleDelete,\n );\n } else {\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: true, prefix: /^.?$/ },\n this.handleBackspace,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: true, suffix: /^.?$/ },\n this.handleDelete,\n );\n }\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: false },\n this.handleDeleteRange,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: false },\n this.handleDeleteRange,\n );\n this.addBinding(\n {\n key: 'Backspace',\n altKey: null,\n ctrlKey: null,\n metaKey: null,\n shiftKey: null,\n },\n { collapsed: true, offset: 0 },\n this.handleBackspace,\n );\n this.listen();\n }\n\n addBinding(\n keyBinding: Binding,\n context:\n | Required\n | Partial> = {},\n handler:\n | Required\n | Partial> = {},\n ) {\n const binding = normalize(keyBinding);\n if (binding == null) {\n debug.warn('Attempted to add invalid keyboard binding', binding);\n return;\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler };\n }\n const keys = Array.isArray(binding.key) ? binding.key : [binding.key];\n keys.forEach((key) => {\n const singleBinding = {\n ...binding,\n key,\n ...context,\n ...handler,\n };\n this.bindings[singleBinding.key] = this.bindings[singleBinding.key] || [];\n this.bindings[singleBinding.key].push(singleBinding);\n });\n }\n\n listen() {\n this.quill.root.addEventListener('keydown', (evt) => {\n if (evt.defaultPrevented || evt.isComposing) return;\n\n // evt.isComposing is false when pressing Enter/Backspace when composing in Safari\n // https://bugs.webkit.org/show_bug.cgi?id=165004\n const isComposing =\n evt.keyCode === 229 && (evt.key === 'Enter' || evt.key === 'Backspace');\n if (isComposing) return;\n\n const bindings = (this.bindings[evt.key] || []).concat(\n this.bindings[evt.which] || [],\n );\n const matches = bindings.filter((binding) =>\n Keyboard.match(evt, binding),\n );\n if (matches.length === 0) return;\n // @ts-expect-error\n const blot = Quill.find(evt.target, true);\n if (blot && blot.scroll !== this.quill.scroll) return;\n const range = this.quill.getSelection();\n if (range == null || !this.quill.hasFocus()) return;\n const [line, offset] = this.quill.getLine(range.index);\n const [leafStart, offsetStart] = this.quill.getLeaf(range.index);\n const [leafEnd, offsetEnd] =\n range.length === 0\n ? [leafStart, offsetStart]\n : this.quill.getLeaf(range.index + range.length);\n const prefixText =\n leafStart instanceof TextBlot\n ? leafStart.value().slice(0, offsetStart)\n : '';\n const suffixText =\n leafEnd instanceof TextBlot ? leafEnd.value().slice(offsetEnd) : '';\n const curContext = {\n collapsed: range.length === 0,\n // @ts-expect-error Fix me later\n empty: range.length === 0 && line.length() <= 1,\n format: this.quill.getFormat(range),\n line,\n offset,\n prefix: prefixText,\n suffix: suffixText,\n event: evt,\n };\n const prevented = matches.some((binding) => {\n if (\n binding.collapsed != null &&\n binding.collapsed !== curContext.collapsed\n ) {\n return false;\n }\n if (binding.empty != null && binding.empty !== curContext.empty) {\n return false;\n }\n if (binding.offset != null && binding.offset !== curContext.offset) {\n return false;\n }\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every((name) => curContext.format[name] == null)) {\n return false;\n }\n } else if (typeof binding.format === 'object') {\n // all formats must match\n if (\n !Object.keys(binding.format).every((name) => {\n // @ts-expect-error Fix me later\n if (binding.format[name] === true)\n return curContext.format[name] != null;\n // @ts-expect-error Fix me later\n if (binding.format[name] === false)\n return curContext.format[name] == null;\n // @ts-expect-error Fix me later\n return isEqual(binding.format[name], curContext.format[name]);\n })\n ) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) {\n return false;\n }\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) {\n return false;\n }\n // @ts-expect-error Fix me later\n return binding.handler.call(this, range, curContext, binding) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n\n handleBackspace(range: Range, context: Context) {\n // Check for astral symbols\n const length = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/.test(context.prefix)\n ? 2\n : 1;\n if (range.index === 0 || this.quill.getLength() <= 1) return;\n let formats = {};\n const [line] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index - length).delete(length);\n if (context.offset === 0) {\n // Always deleting newline here, length always 1\n const [prev] = this.quill.getLine(range.index - 1);\n if (prev) {\n const isPrevLineEmpty =\n prev.statics.blotName === 'block' && prev.length() <= 1;\n if (!isPrevLineEmpty) {\n // @ts-expect-error Fix me later\n const curFormats = line.formats();\n const prevFormats = this.quill.getFormat(range.index - 1, 1);\n formats = AttributeMap.diff(curFormats, prevFormats) || {};\n if (Object.keys(formats).length > 0) {\n // line.length() - 1 targets \\n in line, another -1 for newline being deleted\n const formatDelta = new Delta()\n // @ts-expect-error Fix me later\n .retain(range.index + line.length() - 2)\n .retain(1, formats);\n delta = delta.compose(formatDelta);\n }\n }\n }\n }\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.focus();\n }\n\n handleDelete(range: Range, context: Context) {\n // Check for astral symbols\n const length = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(context.suffix)\n ? 2\n : 1;\n if (range.index >= this.quill.getLength() - length) return;\n let formats = {};\n const [line] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index).delete(length);\n // @ts-expect-error Fix me later\n if (context.offset >= line.length() - 1) {\n const [next] = this.quill.getLine(range.index + 1);\n if (next) {\n // @ts-expect-error Fix me later\n const curFormats = line.formats();\n const nextFormats = this.quill.getFormat(range.index, 1);\n formats = AttributeMap.diff(curFormats, nextFormats) || {};\n if (Object.keys(formats).length > 0) {\n delta = delta.retain(next.length() - 1).retain(1, formats);\n }\n }\n }\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.focus();\n }\n\n handleDeleteRange(range: Range) {\n deleteRange({ range, quill: this.quill });\n this.quill.focus();\n }\n\n handleEnter(range: Range, context: Context) {\n const lineFormats = Object.keys(context.format).reduce(\n (formats: Record, format) => {\n if (\n this.quill.scroll.query(format, Scope.BLOCK) &&\n !Array.isArray(context.format[format])\n ) {\n formats[format] = context.format[format];\n }\n return formats;\n },\n {},\n );\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert('\\n', lineFormats);\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.focus();\n }\n}\n\nconst defaultOptions: KeyboardOptions = {\n bindings: {\n bold: makeFormatHandler('bold'),\n italic: makeFormatHandler('italic'),\n underline: makeFormatHandler('underline'),\n indent: {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: 'Tab',\n format: ['blockquote', 'indent', 'list'],\n handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', Quill.sources.USER);\n return false;\n },\n },\n outdent: {\n key: 'Tab',\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', Quill.sources.USER);\n return false;\n },\n },\n 'outdent backspace': {\n key: 'Backspace',\n collapsed: true,\n shiftKey: null,\n metaKey: null,\n ctrlKey: null,\n altKey: null,\n format: ['indent', 'list'],\n offset: 0,\n handler(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', Quill.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, Quill.sources.USER);\n }\n },\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: 'Tab',\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler(range) {\n this.quill.deleteText(range.index - 1, 1, Quill.sources.USER);\n },\n },\n tab: {\n key: 'Tab',\n handler(range, context) {\n if (context.format.table) return true;\n this.quill.history.cutoff();\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert('\\t');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n return false;\n },\n },\n 'blockquote empty enter': {\n key: 'Enter',\n collapsed: true,\n format: ['blockquote'],\n empty: true,\n handler() {\n this.quill.format('blockquote', false, Quill.sources.USER);\n },\n },\n 'list empty enter': {\n key: 'Enter',\n collapsed: true,\n format: ['list'],\n empty: true,\n handler(range, context) {\n const formats: Record = { list: false };\n if (context.format.indent) {\n formats.indent = false;\n }\n this.quill.formatLine(\n range.index,\n range.length,\n formats,\n Quill.sources.USER,\n );\n },\n },\n 'checklist enter': {\n key: 'Enter',\n collapsed: true,\n format: { list: 'checked' },\n handler(range) {\n const [line, offset] = this.quill.getLine(range.index);\n const formats = {\n // @ts-expect-error Fix me later\n ...line.formats(),\n list: 'checked',\n };\n const delta = new Delta()\n .retain(range.index)\n .insert('\\n', formats)\n // @ts-expect-error Fix me later\n .retain(line.length() - offset - 1)\n .retain(1, { list: 'unchecked' });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollSelectionIntoView();\n },\n },\n 'header enter': {\n key: 'Enter',\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler(range, context) {\n const [line, offset] = this.quill.getLine(range.index);\n const delta = new Delta()\n .retain(range.index)\n .insert('\\n', context.format)\n // @ts-expect-error Fix me later\n .retain(line.length() - offset - 1)\n .retain(1, { header: null });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollSelectionIntoView();\n },\n },\n 'table backspace': {\n key: 'Backspace',\n format: ['table'],\n collapsed: true,\n offset: 0,\n handler() {},\n },\n 'table delete': {\n key: 'Delete',\n format: ['table'],\n collapsed: true,\n suffix: /^$/,\n handler() {},\n },\n 'table enter': {\n key: 'Enter',\n shiftKey: null,\n format: ['table'],\n handler(range) {\n const module = this.quill.getModule('table');\n if (module) {\n // @ts-expect-error\n const [table, row, cell, offset] = module.getTable(range);\n const shift = tableSide(table, row, cell, offset);\n if (shift == null) return;\n let index = table.offset();\n if (shift < 0) {\n const delta = new Delta().retain(index).insert('\\n');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(\n range.index + 1,\n range.length,\n Quill.sources.SILENT,\n );\n } else if (shift > 0) {\n index += table.length();\n const delta = new Delta().retain(index).insert('\\n');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(index, Quill.sources.USER);\n }\n }\n },\n },\n 'table tab': {\n key: 'Tab',\n shiftKey: null,\n format: ['table'],\n handler(range, context) {\n const { event, line: cell } = context;\n const offset = cell.offset(this.quill.scroll);\n if (event.shiftKey) {\n this.quill.setSelection(offset - 1, Quill.sources.USER);\n } else {\n this.quill.setSelection(offset + cell.length(), Quill.sources.USER);\n }\n },\n },\n 'list autofill': {\n key: ' ',\n shiftKey: null,\n collapsed: true,\n format: {\n 'code-block': false,\n blockquote: false,\n table: false,\n },\n prefix: /^\\s*?(\\d+\\.|-|\\*|\\[ ?\\]|\\[x\\])$/,\n handler(range, context) {\n if (this.quill.scroll.query('list') == null) return true;\n const { length } = context.prefix;\n const [line, offset] = this.quill.getLine(range.index);\n if (offset > length) return true;\n let value;\n switch (context.prefix.trim()) {\n case '[]':\n case '[ ]':\n value = 'unchecked';\n break;\n case '[x]':\n value = 'checked';\n break;\n case '-':\n case '*':\n value = 'bullet';\n break;\n default:\n value = 'ordered';\n }\n this.quill.insertText(range.index, ' ', Quill.sources.USER);\n this.quill.history.cutoff();\n const delta = new Delta()\n .retain(range.index - offset)\n .delete(length + 1)\n // @ts-expect-error Fix me later\n .retain(line.length() - 2 - offset)\n .retain(1, { list: value });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index - length, Quill.sources.SILENT);\n return false;\n },\n },\n 'code exit': {\n key: 'Enter',\n collapsed: true,\n format: ['code-block'],\n prefix: /^$/,\n suffix: /^\\s*$/,\n handler(range) {\n const [line, offset] = this.quill.getLine(range.index);\n let numLines = 2;\n let cur = line;\n while (\n cur != null &&\n cur.length() <= 1 &&\n cur.formats()['code-block']\n ) {\n // @ts-expect-error\n cur = cur.prev;\n numLines -= 1;\n // Requisite prev lines are empty\n if (numLines <= 0) {\n const delta = new Delta()\n // @ts-expect-error Fix me later\n .retain(range.index + line.length() - offset - 2)\n .retain(1, { 'code-block': null })\n .delete(1);\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index - 1, Quill.sources.SILENT);\n return false;\n }\n }\n return true;\n },\n },\n 'embed left': makeEmbedArrowHandler('ArrowLeft', false),\n 'embed left shift': makeEmbedArrowHandler('ArrowLeft', true),\n 'embed right': makeEmbedArrowHandler('ArrowRight', false),\n 'embed right shift': makeEmbedArrowHandler('ArrowRight', true),\n 'table down': makeTableArrowHandler(false),\n 'table up': makeTableArrowHandler(true),\n },\n};\n\nKeyboard.DEFAULTS = defaultOptions;\n\nfunction makeCodeBlockHandler(indent: boolean): BindingObject {\n return {\n key: 'Tab',\n shiftKey: !indent,\n format: { 'code-block': true },\n handler(range, { event }) {\n const CodeBlock = this.quill.scroll.query('code-block');\n // @ts-expect-error\n const { TAB } = CodeBlock;\n if (range.length === 0 && !event.shiftKey) {\n this.quill.insertText(range.index, TAB, Quill.sources.USER);\n this.quill.setSelection(range.index + TAB.length, Quill.sources.SILENT);\n return;\n }\n\n const lines =\n range.length === 0\n ? this.quill.getLines(range.index, 1)\n : this.quill.getLines(range);\n let { index, length } = range;\n lines.forEach((line, i) => {\n if (indent) {\n line.insertAt(0, TAB);\n if (i === 0) {\n index += TAB.length;\n } else {\n length += TAB.length;\n }\n // @ts-expect-error Fix me later\n } else if (line.domNode.textContent.startsWith(TAB)) {\n line.deleteAt(0, TAB.length);\n if (i === 0) {\n index -= TAB.length;\n } else {\n length -= TAB.length;\n }\n }\n });\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(index, length, Quill.sources.SILENT);\n },\n };\n}\n\nfunction makeEmbedArrowHandler(\n key: string,\n shiftKey: boolean | null,\n): BindingObject {\n const where = key === 'ArrowLeft' ? 'prefix' : 'suffix';\n return {\n key,\n shiftKey,\n altKey: null,\n [where]: /^$/,\n handler(range) {\n let { index } = range;\n if (key === 'ArrowRight') {\n index += range.length + 1;\n }\n const [leaf] = this.quill.getLeaf(index);\n if (!(leaf instanceof EmbedBlot)) return true;\n if (key === 'ArrowLeft') {\n if (shiftKey) {\n this.quill.setSelection(\n range.index - 1,\n range.length + 1,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(range.index - 1, Quill.sources.USER);\n }\n } else if (shiftKey) {\n this.quill.setSelection(\n range.index,\n range.length + 1,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(\n range.index + range.length + 1,\n Quill.sources.USER,\n );\n }\n return false;\n },\n };\n}\n\nfunction makeFormatHandler(format: string): BindingObject {\n return {\n key: format[0],\n shortKey: true,\n handler(range, context) {\n this.quill.format(format, !context.format[format], Quill.sources.USER);\n },\n };\n}\n\nfunction makeTableArrowHandler(up: boolean): BindingObject {\n return {\n key: up ? 'ArrowUp' : 'ArrowDown',\n collapsed: true,\n format: ['table'],\n handler(range, context) {\n // TODO move to table module\n const key = up ? 'prev' : 'next';\n const cell = context.line;\n const targetRow = cell.parent[key];\n if (targetRow != null) {\n if (targetRow.statics.blotName === 'table-row') {\n // @ts-expect-error\n let targetCell = targetRow.children.head;\n let cur = cell;\n while (cur.prev != null) {\n // @ts-expect-error\n cur = cur.prev;\n targetCell = targetCell.next;\n }\n const index =\n targetCell.offset(this.quill.scroll) +\n Math.min(context.offset, targetCell.length() - 1);\n this.quill.setSelection(index, 0, Quill.sources.USER);\n }\n } else {\n // @ts-expect-error\n const targetLine = cell.table()[key];\n if (targetLine != null) {\n if (up) {\n this.quill.setSelection(\n targetLine.offset(this.quill.scroll) + targetLine.length() - 1,\n 0,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(\n targetLine.offset(this.quill.scroll),\n 0,\n Quill.sources.USER,\n );\n }\n }\n }\n return false;\n },\n };\n}\n\nfunction normalize(binding: Binding): BindingObject | null {\n if (typeof binding === 'string' || typeof binding === 'number') {\n binding = { key: binding };\n } else if (typeof binding === 'object') {\n binding = cloneDeep(binding);\n } else {\n return null;\n }\n if (binding.shortKey) {\n binding[SHORTKEY] = binding.shortKey;\n delete binding.shortKey;\n }\n return binding;\n}\n\n// TODO: Move into quill.ts or editor.ts\nfunction deleteRange({ quill, range }: { quill: Quill; range: Range }) {\n const lines = quill.getLines(range);\n let formats = {};\n if (lines.length > 1) {\n const firstFormats = lines[0].formats();\n const lastFormats = lines[lines.length - 1].formats();\n formats = AttributeMap.diff(lastFormats, firstFormats) || {};\n }\n quill.deleteText(range, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n quill.formatLine(range.index, 1, formats, Quill.sources.USER);\n }\n quill.setSelection(range.index, Quill.sources.SILENT);\n}\n\nfunction tableSide(_table: unknown, row: Blot, cell: Blot, offset: number) {\n if (row.prev == null && row.next == null) {\n if (cell.prev == null && cell.next == null) {\n return offset === 0 ? -1 : 1;\n }\n return cell.prev == null ? -1 : 1;\n }\n if (row.prev == null) {\n return -1;\n }\n if (row.next == null) {\n return 1;\n }\n return null;\n}\n\nexport { Keyboard as default, SHORTKEY, normalize, deleteRange };\n", "const normalWeightRegexp = /font-weight:\\s*normal/;\nconst blockTagNames = ['P', 'OL', 'UL'];\n\nconst isBlockElement = (element: Element | null) => {\n return element && blockTagNames.includes(element.tagName);\n};\n\nconst normalizeEmptyLines = (doc: Document) => {\n Array.from(doc.querySelectorAll('br'))\n .filter(\n (br) =>\n isBlockElement(br.previousElementSibling) &&\n isBlockElement(br.nextElementSibling),\n )\n .forEach((br) => {\n br.parentNode?.removeChild(br);\n });\n};\n\nconst normalizeFontWeight = (doc: Document) => {\n Array.from(doc.querySelectorAll('b[style*=\"font-weight\"]'))\n .filter((node) => node.getAttribute('style')?.match(normalWeightRegexp))\n .forEach((node) => {\n const fragment = doc.createDocumentFragment();\n fragment.append(...node.childNodes);\n node.parentNode?.replaceChild(fragment, node);\n });\n};\n\nexport default function normalize(doc: Document) {\n if (doc.querySelector('[id^=\"docs-internal-guid-\"]')) {\n normalizeFontWeight(doc);\n normalizeEmptyLines(doc);\n }\n}\n", "const ignoreRegexp = /\\bmso-list:[^;]*ignore/i;\nconst idRegexp = /\\bmso-list:[^;]*\\bl(\\d+)/i;\nconst indentRegexp = /\\bmso-list:[^;]*\\blevel(\\d+)/i;\n\nconst parseListItem = (element: Element, html: string) => {\n const style = element.getAttribute('style');\n const idMatch = style?.match(idRegexp);\n if (!idMatch) {\n return null;\n }\n const id = Number(idMatch[1]);\n\n const indentMatch = style?.match(indentRegexp);\n const indent = indentMatch ? Number(indentMatch[1]) : 1;\n\n const typeRegexp = new RegExp(\n `@list l${id}:level${indent}\\\\s*\\\\{[^\\\\}]*mso-level-number-format:\\\\s*([\\\\w-]+)`,\n 'i',\n );\n const typeMatch = html.match(typeRegexp);\n const type = typeMatch && typeMatch[1] === 'bullet' ? 'bullet' : 'ordered';\n\n return { id, indent, type, element };\n};\n\n// list items are represented as `p` tags with styles like `mso-list: l0 level1` where:\n// 1. \"0\" in \"l0\" means the list item id;\n// 2. \"1\" in \"level1\" means the indent level, starting from 1.\nconst normalizeListItem = (doc: Document) => {\n const msoList = Array.from(doc.querySelectorAll('[style*=mso-list]'));\n const ignored: Element[] = [];\n const others: Element[] = [];\n msoList.forEach((node) => {\n const shouldIgnore = (node.getAttribute('style') || '').match(ignoreRegexp);\n if (shouldIgnore) {\n ignored.push(node);\n } else {\n others.push(node);\n }\n });\n\n // Each list item contains a marker wrapped with \"mso-list: Ignore\".\n ignored.forEach((node) => node.parentNode?.removeChild(node));\n\n // The list stype is not defined inline with the tag, instead, it's in the\n // style tag so we need to pass the html as a string.\n const html = doc.documentElement.innerHTML;\n const listItems = others\n .map((element) => parseListItem(element, html))\n .filter((parsed) => parsed);\n\n while (listItems.length) {\n const childListItems = [];\n\n let current = listItems.shift();\n // Group continuous items into the same group (aka \"ul\")\n while (current) {\n childListItems.push(current);\n current =\n listItems.length &&\n listItems[0]?.element === current.element.nextElementSibling &&\n // Different id means the next item doesn't belong to this group.\n listItems[0].id === current.id\n ? listItems.shift()\n : null;\n }\n\n const ul = document.createElement('ul');\n childListItems.forEach((listItem) => {\n const li = document.createElement('li');\n li.setAttribute('data-list', listItem.type);\n if (listItem.indent > 1) {\n li.setAttribute('class', `ql-indent-${listItem.indent - 1}`);\n }\n li.innerHTML = listItem.element.innerHTML;\n ul.appendChild(li);\n });\n\n const element = childListItems[0]?.element;\n const { parentNode } = element ?? {};\n if (element) {\n parentNode?.replaceChild(ul, element);\n }\n childListItems.slice(1).forEach(({ element: e }) => {\n parentNode?.removeChild(e);\n });\n }\n};\n\nexport default function normalize(doc: Document) {\n if (\n doc.documentElement.getAttribute('xmlns:w') ===\n 'urn:schemas-microsoft-com:office:word'\n ) {\n normalizeListItem(doc);\n }\n}\n", "import googleDocs from './normalizers/googleDocs.js';\nimport msWord from './normalizers/msWord.js';\n\nconst NORMALIZERS = [msWord, googleDocs];\n\nconst normalizeExternalHTML = (doc: Document) => {\n if (doc.documentElement) {\n NORMALIZERS.forEach((normalize) => {\n normalize(doc);\n });\n }\n};\n\nexport default normalizeExternalHTML;\n", "import type { ScrollBlot } from 'parchment';\nimport {\n Attributor,\n BlockBlot,\n ClassAttributor,\n EmbedBlot,\n Scope,\n StyleAttributor,\n} from 'parchment';\nimport Delta from 'quill-delta';\nimport { BlockEmbed } from '../blots/block.js';\nimport type { EmitterSource } from '../core/emitter.js';\nimport logger from '../core/logger.js';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\nimport type { Range } from '../core/selection.js';\nimport { AlignAttribute, AlignStyle } from '../formats/align.js';\nimport { BackgroundStyle } from '../formats/background.js';\nimport CodeBlock from '../formats/code.js';\nimport { ColorStyle } from '../formats/color.js';\nimport { DirectionAttribute, DirectionStyle } from '../formats/direction.js';\nimport { FontStyle } from '../formats/font.js';\nimport { SizeStyle } from '../formats/size.js';\nimport { deleteRange } from './keyboard.js';\nimport normalizeExternalHTML from './normalizeExternalHTML/index.js';\n\nconst debug = logger('quill:clipboard');\n\ntype Selector = string | Node['TEXT_NODE'] | Node['ELEMENT_NODE'];\ntype Matcher = (node: Node, delta: Delta, scroll: ScrollBlot) => Delta;\n\nconst CLIPBOARD_CONFIG: [Selector, Matcher][] = [\n [Node.TEXT_NODE, matchText],\n [Node.TEXT_NODE, matchNewline],\n ['br', matchBreak],\n [Node.ELEMENT_NODE, matchNewline],\n [Node.ELEMENT_NODE, matchBlot],\n [Node.ELEMENT_NODE, matchAttributor],\n [Node.ELEMENT_NODE, matchStyles],\n ['li', matchIndent],\n ['ol, ul', matchList],\n ['pre', matchCodeBlock],\n ['tr', matchTable],\n ['b', createMatchAlias('bold')],\n ['i', createMatchAlias('italic')],\n ['strike', createMatchAlias('strike')],\n ['style', matchIgnore],\n];\n\nconst ATTRIBUTE_ATTRIBUTORS = [AlignAttribute, DirectionAttribute].reduce(\n (memo: Record, attr) => {\n memo[attr.keyName] = attr;\n return memo;\n },\n {},\n);\n\nconst STYLE_ATTRIBUTORS = [\n AlignStyle,\n BackgroundStyle,\n ColorStyle,\n DirectionStyle,\n FontStyle,\n SizeStyle,\n].reduce((memo: Record, attr) => {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\ninterface ClipboardOptions {\n matchers: [Selector, Matcher][];\n}\n\nclass Clipboard extends Module {\n static DEFAULTS: ClipboardOptions = {\n matchers: [],\n };\n\n matchers: [Selector, Matcher][];\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n this.quill.root.addEventListener('copy', (e) =>\n this.onCaptureCopy(e, false),\n );\n this.quill.root.addEventListener('cut', (e) => this.onCaptureCopy(e, true));\n this.quill.root.addEventListener('paste', this.onCapturePaste.bind(this));\n this.matchers = [];\n CLIPBOARD_CONFIG.concat(this.options.matchers ?? []).forEach(\n ([selector, matcher]) => {\n this.addMatcher(selector, matcher);\n },\n );\n }\n\n addMatcher(selector: Selector, matcher: Matcher) {\n this.matchers.push([selector, matcher]);\n }\n\n convert(\n { html, text }: { html?: string; text?: string },\n formats: Record = {},\n ) {\n if (formats[CodeBlock.blotName]) {\n return new Delta().insert(text || '', {\n [CodeBlock.blotName]: formats[CodeBlock.blotName],\n });\n }\n if (!html) {\n return new Delta().insert(text || '', formats);\n }\n const delta = this.convertHTML(html);\n // Remove trailing newline\n if (\n deltaEndsWith(delta, '\\n') &&\n (delta.ops[delta.ops.length - 1].attributes == null || formats.table)\n ) {\n return delta.compose(new Delta().retain(delta.length() - 1).delete(1));\n }\n return delta;\n }\n\n protected normalizeHTML(doc: Document) {\n normalizeExternalHTML(doc);\n }\n\n protected convertHTML(html: string) {\n const doc = new DOMParser().parseFromString(html, 'text/html');\n this.normalizeHTML(doc);\n const container = doc.body;\n const nodeMatches = new WeakMap();\n const [elementMatchers, textMatchers] = this.prepareMatching(\n container,\n nodeMatches,\n );\n return traverse(\n this.quill.scroll,\n container,\n elementMatchers,\n textMatchers,\n nodeMatches,\n );\n }\n\n dangerouslyPasteHTML(html: string, source?: EmitterSource): void;\n dangerouslyPasteHTML(\n index: number,\n html: string,\n source?: EmitterSource,\n ): void;\n dangerouslyPasteHTML(\n index: number | string,\n html?: string,\n source: EmitterSource = Quill.sources.API,\n ) {\n if (typeof index === 'string') {\n const delta = this.convert({ html: index, text: '' });\n // @ts-expect-error\n this.quill.setContents(delta, html);\n this.quill.setSelection(0, Quill.sources.SILENT);\n } else {\n const paste = this.convert({ html, text: '' });\n this.quill.updateContents(\n new Delta().retain(index).concat(paste),\n source,\n );\n this.quill.setSelection(index + paste.length(), Quill.sources.SILENT);\n }\n }\n\n onCaptureCopy(e: ClipboardEvent, isCut = false) {\n if (e.defaultPrevented) return;\n e.preventDefault();\n const [range] = this.quill.selection.getRange();\n if (range == null) return;\n const { html, text } = this.onCopy(range, isCut);\n e.clipboardData?.setData('text/plain', text);\n e.clipboardData?.setData('text/html', html);\n if (isCut) {\n deleteRange({ range, quill: this.quill });\n }\n }\n\n /*\n * https://www.iana.org/assignments/media-types/text/uri-list\n */\n private normalizeURIList(urlList: string) {\n return (\n urlList\n .split(/\\r?\\n/)\n // Ignore all comments\n .filter((url) => url[0] !== '#')\n .join('\\n')\n );\n }\n\n onCapturePaste(e: ClipboardEvent) {\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n e.preventDefault();\n const range = this.quill.getSelection(true);\n if (range == null) return;\n const html = e.clipboardData?.getData('text/html');\n let text = e.clipboardData?.getData('text/plain');\n if (!html && !text) {\n const urlList = e.clipboardData?.getData('text/uri-list');\n if (urlList) {\n text = this.normalizeURIList(urlList);\n }\n }\n const files = Array.from(e.clipboardData?.files || []);\n if (!html && files.length > 0) {\n this.quill.uploader.upload(range, files);\n return;\n }\n if (html && files.length > 0) {\n const doc = new DOMParser().parseFromString(html, 'text/html');\n if (\n doc.body.childElementCount === 1 &&\n doc.body.firstElementChild?.tagName === 'IMG'\n ) {\n this.quill.uploader.upload(range, files);\n return;\n }\n }\n this.onPaste(range, { html, text });\n }\n\n onCopy(range: Range, isCut: boolean): { html: string; text: string };\n onCopy(range: Range) {\n const text = this.quill.getText(range);\n const html = this.quill.getSemanticHTML(range);\n return { html, text };\n }\n\n onPaste(range: Range, { text, html }: { text?: string; html?: string }) {\n const formats = this.quill.getFormat(range.index);\n const pastedDelta = this.convert({ text, html }, formats);\n debug.log('onPaste', pastedDelta, { text, html });\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .concat(pastedDelta);\n this.quill.updateContents(delta, Quill.sources.USER);\n // range.length contributes to delta.length()\n this.quill.setSelection(\n delta.length() - range.length,\n Quill.sources.SILENT,\n );\n this.quill.scrollSelectionIntoView();\n }\n\n prepareMatching(container: Element, nodeMatches: WeakMap) {\n const elementMatchers: Matcher[] = [];\n const textMatchers: Matcher[] = [];\n this.matchers.forEach((pair) => {\n const [selector, matcher] = pair;\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n Array.from(container.querySelectorAll(selector)).forEach((node) => {\n if (nodeMatches.has(node)) {\n const matches = nodeMatches.get(node);\n matches?.push(matcher);\n } else {\n nodeMatches.set(node, [matcher]);\n }\n });\n break;\n }\n });\n return [elementMatchers, textMatchers];\n }\n}\n\nfunction applyFormat(\n delta: Delta,\n format: string,\n value: unknown,\n scroll: ScrollBlot,\n): Delta {\n if (!scroll.query(format)) {\n return delta;\n }\n\n return delta.reduce((newDelta, op) => {\n if (!op.insert) return newDelta;\n if (op.attributes && op.attributes[format]) {\n return newDelta.push(op);\n }\n const formats = value ? { [format]: value } : {};\n return newDelta.insert(op.insert, { ...formats, ...op.attributes });\n }, new Delta());\n}\n\nfunction deltaEndsWith(delta: Delta, text: string) {\n let endText = '';\n for (\n let i = delta.ops.length - 1;\n i >= 0 && endText.length < text.length;\n --i // eslint-disable-line no-plusplus\n ) {\n const op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1 * text.length) === text;\n}\n\nfunction isLine(node: Node, scroll: ScrollBlot) {\n if (!(node instanceof Element)) return false;\n const match = scroll.query(node);\n // @ts-expect-error\n if (match && match.prototype instanceof EmbedBlot) return false;\n\n return [\n 'address',\n 'article',\n 'blockquote',\n 'canvas',\n 'dd',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'iframe',\n 'li',\n 'main',\n 'nav',\n 'ol',\n 'output',\n 'p',\n 'pre',\n 'section',\n 'table',\n 'td',\n 'tr',\n 'ul',\n 'video',\n ].includes(node.tagName.toLowerCase());\n}\n\nfunction isBetweenInlineElements(node: HTMLElement, scroll: ScrollBlot) {\n return (\n node.previousElementSibling &&\n node.nextElementSibling &&\n !isLine(node.previousElementSibling, scroll) &&\n !isLine(node.nextElementSibling, scroll)\n );\n}\n\nconst preNodes = new WeakMap();\nfunction isPre(node: Node | null) {\n if (node == null) return false;\n if (!preNodes.has(node)) {\n // @ts-expect-error\n if (node.tagName === 'PRE') {\n preNodes.set(node, true);\n } else {\n preNodes.set(node, isPre(node.parentNode));\n }\n }\n return preNodes.get(node);\n}\n\nfunction traverse(\n scroll: ScrollBlot,\n node: ChildNode,\n elementMatchers: Matcher[],\n textMatchers: Matcher[],\n nodeMatches: WeakMap,\n): Delta {\n // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce((delta: Delta, matcher) => {\n return matcher(node, delta, scroll);\n }, new Delta());\n }\n if (node.nodeType === node.ELEMENT_NODE) {\n return Array.from(node.childNodes || []).reduce((delta, childNode) => {\n let childrenDelta = traverse(\n scroll,\n childNode,\n elementMatchers,\n textMatchers,\n nodeMatches,\n );\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce((reducedDelta, matcher) => {\n return matcher(childNode as HTMLElement, reducedDelta, scroll);\n }, childrenDelta);\n childrenDelta = (nodeMatches.get(childNode) || []).reduce(\n (reducedDelta, matcher) => {\n return matcher(childNode, reducedDelta, scroll);\n },\n childrenDelta,\n );\n }\n return delta.concat(childrenDelta);\n }, new Delta());\n }\n return new Delta();\n}\n\nfunction createMatchAlias(format: string) {\n return (_node: Element, delta: Delta, scroll: ScrollBlot) => {\n return applyFormat(delta, format, true, scroll);\n };\n}\n\nfunction matchAttributor(node: HTMLElement, delta: Delta, scroll: ScrollBlot) {\n const attributes = Attributor.keys(node);\n const classes = ClassAttributor.keys(node);\n const styles = StyleAttributor.keys(node);\n const formats: Record = {};\n attributes\n .concat(classes)\n .concat(styles)\n .forEach((name) => {\n let attr = scroll.query(name, Scope.ATTRIBUTE) as Attributor;\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n attr = STYLE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n });\n\n return Object.entries(formats).reduce(\n (newDelta, [name, value]) => applyFormat(newDelta, name, value, scroll),\n delta,\n );\n}\n\nfunction matchBlot(node: Node, delta: Delta, scroll: ScrollBlot) {\n const match = scroll.query(node);\n if (match == null) return delta;\n // @ts-expect-error\n if (match.prototype instanceof EmbedBlot) {\n const embed = {};\n // @ts-expect-error\n const value = match.value(node);\n if (value != null) {\n // @ts-expect-error\n embed[match.blotName] = value;\n // @ts-expect-error\n return new Delta().insert(embed, match.formats(node, scroll));\n }\n } else {\n // @ts-expect-error\n if (match.prototype instanceof BlockBlot && !deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n if (\n 'blotName' in match &&\n 'formats' in match &&\n typeof match.formats === 'function'\n ) {\n return applyFormat(\n delta,\n match.blotName,\n match.formats(node, scroll),\n scroll,\n );\n }\n }\n return delta;\n}\n\nfunction matchBreak(node: Node, delta: Delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchCodeBlock(node: Node, delta: Delta, scroll: ScrollBlot) {\n const match = scroll.query('code-block');\n const language =\n match && 'formats' in match && typeof match.formats === 'function'\n ? match.formats(node, scroll)\n : true;\n return applyFormat(delta, 'code-block', language, scroll);\n}\n\nfunction matchIgnore() {\n return new Delta();\n}\n\nfunction matchIndent(node: Node, delta: Delta, scroll: ScrollBlot) {\n const match = scroll.query(node);\n if (\n match == null ||\n // @ts-expect-error\n match.blotName !== 'list' ||\n !deltaEndsWith(delta, '\\n')\n ) {\n return delta;\n }\n let indent = -1;\n let parent = node.parentNode;\n while (parent != null) {\n // @ts-expect-error\n if (['OL', 'UL'].includes(parent.tagName)) {\n indent += 1;\n }\n parent = parent.parentNode;\n }\n if (indent <= 0) return delta;\n return delta.reduce((composed, op) => {\n if (!op.insert) return composed;\n if (op.attributes && typeof op.attributes.indent === 'number') {\n return composed.push(op);\n }\n return composed.insert(op.insert, { indent, ...(op.attributes || {}) });\n }, new Delta());\n}\n\nfunction matchList(node: Node, delta: Delta, scroll: ScrollBlot) {\n const element = node as Element;\n let list = element.tagName === 'OL' ? 'ordered' : 'bullet';\n\n const checkedAttr = element.getAttribute('data-checked');\n if (checkedAttr) {\n list = checkedAttr === 'true' ? 'checked' : 'unchecked';\n }\n\n return applyFormat(delta, 'list', list, scroll);\n}\n\nfunction matchNewline(node: Node, delta: Delta, scroll: ScrollBlot) {\n if (!deltaEndsWith(delta, '\\n')) {\n if (\n isLine(node, scroll) &&\n (node.childNodes.length > 0 || node instanceof HTMLParagraphElement)\n ) {\n return delta.insert('\\n');\n }\n if (delta.length() > 0 && node.nextSibling) {\n let nextSibling: Node | null = node.nextSibling;\n while (nextSibling != null) {\n if (isLine(nextSibling, scroll)) {\n return delta.insert('\\n');\n }\n const match = scroll.query(nextSibling);\n // @ts-expect-error\n if (match && match.prototype instanceof BlockEmbed) {\n return delta.insert('\\n');\n }\n nextSibling = nextSibling.firstChild;\n }\n }\n }\n return delta;\n}\n\nfunction matchStyles(node: HTMLElement, delta: Delta, scroll: ScrollBlot) {\n const formats: Record = {};\n const style: Partial = node.style || {};\n if (style.fontStyle === 'italic') {\n formats.italic = true;\n }\n if (style.textDecoration === 'underline') {\n formats.underline = true;\n }\n if (style.textDecoration === 'line-through') {\n formats.strike = true;\n }\n if (\n style.fontWeight?.startsWith('bold') ||\n // @ts-expect-error Fix me later\n parseInt(style.fontWeight, 10) >= 700\n ) {\n formats.bold = true;\n }\n delta = Object.entries(formats).reduce(\n (newDelta, [name, value]) => applyFormat(newDelta, name, value, scroll),\n delta,\n );\n // @ts-expect-error\n if (parseFloat(style.textIndent || 0) > 0) {\n // Could be 0.5in\n return new Delta().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchTable(\n node: HTMLTableRowElement,\n delta: Delta,\n scroll: ScrollBlot,\n) {\n const table =\n node.parentElement?.tagName === 'TABLE'\n ? node.parentElement\n : node.parentElement?.parentElement;\n if (table != null) {\n const rows = Array.from(table.querySelectorAll('tr'));\n const row = rows.indexOf(node) + 1;\n return applyFormat(delta, 'table', row, scroll);\n }\n return delta;\n}\n\nfunction matchText(node: HTMLElement, delta: Delta, scroll: ScrollBlot) {\n // @ts-expect-error\n let text = node.data;\n // Word represents empty line with  \n if (node.parentElement?.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (!isPre(node)) {\n if (\n text.trim().length === 0 &&\n text.includes('\\n') &&\n !isBetweenInlineElements(node, scroll)\n ) {\n return delta;\n }\n const replacer = (collapse: unknown, match: string) => {\n const replaced = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return replaced.length < 1 && collapse ? ' ' : replaced;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if (\n (node.previousSibling == null &&\n node.parentElement != null &&\n isLine(node.parentElement, scroll)) ||\n (node.previousSibling instanceof Element &&\n isLine(node.previousSibling, scroll))\n ) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if (\n (node.nextSibling == null &&\n node.parentElement != null &&\n isLine(node.parentElement, scroll)) ||\n (node.nextSibling instanceof Element && isLine(node.nextSibling, scroll))\n ) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\nexport {\n Clipboard as default,\n matchAttributor,\n matchBlot,\n matchNewline,\n matchText,\n traverse,\n};\n", "import { Scope } from 'parchment';\nimport type Delta from 'quill-delta';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\nimport type Scroll from '../blots/scroll.js';\nimport type { Range } from '../core/selection.js';\n\nexport interface HistoryOptions {\n userOnly: boolean;\n delay: number;\n maxStack: number;\n}\n\nexport interface StackItem {\n delta: Delta;\n range: Range | null;\n}\n\ninterface Stack {\n undo: StackItem[];\n redo: StackItem[];\n}\n\nclass History extends Module {\n static DEFAULTS: HistoryOptions = {\n delay: 1000,\n maxStack: 100,\n userOnly: false,\n };\n\n lastRecorded = 0;\n ignoreChange = false;\n stack: Stack = { undo: [], redo: [] };\n currentRange: Range | null = null;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n this.quill.on(\n Quill.events.EDITOR_CHANGE,\n (eventName, value, oldValue, source) => {\n if (eventName === Quill.events.SELECTION_CHANGE) {\n if (value && source !== Quill.sources.SILENT) {\n this.currentRange = value;\n }\n } else if (eventName === Quill.events.TEXT_CHANGE) {\n if (!this.ignoreChange) {\n if (!this.options.userOnly || source === Quill.sources.USER) {\n this.record(value, oldValue);\n } else {\n this.transform(value);\n }\n }\n\n this.currentRange = transformRange(this.currentRange, value);\n }\n },\n );\n\n this.quill.keyboard.addBinding(\n { key: 'z', shortKey: true },\n this.undo.bind(this),\n );\n this.quill.keyboard.addBinding(\n { key: ['z', 'Z'], shortKey: true, shiftKey: true },\n this.redo.bind(this),\n );\n if (/Win/i.test(navigator.platform)) {\n this.quill.keyboard.addBinding(\n { key: 'y', shortKey: true },\n this.redo.bind(this),\n );\n }\n\n this.quill.root.addEventListener('beforeinput', (event) => {\n if (event.inputType === 'historyUndo') {\n this.undo();\n event.preventDefault();\n } else if (event.inputType === 'historyRedo') {\n this.redo();\n event.preventDefault();\n }\n });\n }\n\n change(source: 'undo' | 'redo', dest: 'redo' | 'undo') {\n if (this.stack[source].length === 0) return;\n const item = this.stack[source].pop();\n if (!item) return;\n const base = this.quill.getContents();\n const inverseDelta = item.delta.invert(base);\n this.stack[dest].push({\n delta: inverseDelta,\n range: transformRange(item.range, inverseDelta),\n });\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(item.delta, Quill.sources.USER);\n this.ignoreChange = false;\n\n this.restoreSelection(item);\n }\n\n clear() {\n this.stack = { undo: [], redo: [] };\n }\n\n cutoff() {\n this.lastRecorded = 0;\n }\n\n record(changeDelta: Delta, oldDelta: Delta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n let undoDelta = changeDelta.invert(oldDelta);\n let undoRange = this.currentRange;\n const timestamp = Date.now();\n if (\n // @ts-expect-error Fix me later\n this.lastRecorded + this.options.delay > timestamp &&\n this.stack.undo.length > 0\n ) {\n const item = this.stack.undo.pop();\n if (item) {\n undoDelta = undoDelta.compose(item.delta);\n undoRange = item.range;\n }\n } else {\n this.lastRecorded = timestamp;\n }\n if (undoDelta.length() === 0) return;\n this.stack.undo.push({ delta: undoDelta, range: undoRange });\n // @ts-expect-error Fix me later\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n\n redo() {\n this.change('redo', 'undo');\n }\n\n transform(delta: Delta) {\n transformStack(this.stack.undo, delta);\n transformStack(this.stack.redo, delta);\n }\n\n undo() {\n this.change('undo', 'redo');\n }\n\n protected restoreSelection(stackItem: StackItem) {\n if (stackItem.range) {\n this.quill.setSelection(stackItem.range, Quill.sources.USER);\n } else {\n const index = getLastChangeIndex(this.quill.scroll, stackItem.delta);\n this.quill.setSelection(index, Quill.sources.USER);\n }\n }\n}\n\nfunction transformStack(stack: StackItem[], delta: Delta) {\n let remoteDelta = delta;\n for (let i = stack.length - 1; i >= 0; i -= 1) {\n const oldItem = stack[i];\n stack[i] = {\n delta: remoteDelta.transform(oldItem.delta, true),\n range: oldItem.range && transformRange(oldItem.range, remoteDelta),\n };\n remoteDelta = oldItem.delta.transform(remoteDelta);\n if (stack[i].delta.length() === 0) {\n stack.splice(i, 1);\n }\n }\n}\n\nfunction endsWithNewlineChange(scroll: Scroll, delta: Delta) {\n const lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some((attr) => {\n return scroll.query(attr, Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(scroll: Scroll, delta: Delta) {\n const deleteLength = delta.reduce((length, op) => {\n return length + (op.delete || 0);\n }, 0);\n let changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(scroll, delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\nfunction transformRange(range: Range | null, delta: Delta) {\n if (!range) return range;\n const start = delta.transformPosition(range.index);\n const end = delta.transformPosition(range.index + range.length);\n return { index: start, length: end - start };\n}\n\nexport { History as default, getLastChangeIndex };\n", "import Delta from 'quill-delta';\nimport type Quill from '../core/quill.js';\nimport Emitter from '../core/emitter.js';\nimport Module from '../core/module.js';\nimport type { Range } from '../core/selection.js';\n\ninterface UploaderOptions {\n mimetypes: string[];\n handler: (this: { quill: Quill }, range: Range, files: File[]) => void;\n}\n\nclass Uploader extends Module {\n static DEFAULTS: UploaderOptions;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n quill.root.addEventListener('drop', (e) => {\n e.preventDefault();\n let native: ReturnType | null = null;\n if (document.caretRangeFromPoint) {\n native = document.caretRangeFromPoint(e.clientX, e.clientY);\n // @ts-expect-error\n } else if (document.caretPositionFromPoint) {\n // @ts-expect-error\n const position = document.caretPositionFromPoint(e.clientX, e.clientY);\n native = document.createRange();\n native.setStart(position.offsetNode, position.offset);\n native.setEnd(position.offsetNode, position.offset);\n }\n\n const normalized = native && quill.selection.normalizeNative(native);\n if (normalized) {\n const range = quill.selection.normalizedToRange(normalized);\n if (e.dataTransfer?.files) {\n this.upload(range, e.dataTransfer.files);\n }\n }\n });\n }\n\n upload(range: Range, files: FileList | File[]) {\n const uploads: File[] = [];\n Array.from(files).forEach((file) => {\n if (file && this.options.mimetypes?.includes(file.type)) {\n uploads.push(file);\n }\n });\n if (uploads.length > 0) {\n // @ts-expect-error Fix me later\n this.options.handler.call(this, range, uploads);\n }\n }\n}\n\nUploader.DEFAULTS = {\n mimetypes: ['image/png', 'image/jpeg'],\n handler(range: Range, files: File[]) {\n if (!this.quill.scroll.query('image')) {\n return;\n }\n const promises = files.map>((file) => {\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.onload = () => {\n resolve(reader.result as string);\n };\n reader.readAsDataURL(file);\n });\n });\n Promise.all(promises).then((images) => {\n const update = images.reduce((delta: Delta, image) => {\n return delta.insert({ image });\n }, new Delta().retain(range.index).delete(range.length)) as Delta;\n this.quill.updateContents(update, Emitter.sources.USER);\n this.quill.setSelection(\n range.index + images.length,\n Emitter.sources.SILENT,\n );\n });\n },\n};\n\nexport default Uploader;\n", "import Delta from 'quill-delta';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\nimport type { Range } from '../core/selection.js';\nimport { deleteRange } from './keyboard.js';\n\nconst INSERT_TYPES = ['insertText', 'insertReplacementText'];\n\nclass Input extends Module {\n constructor(quill: Quill, options: Record) {\n super(quill, options);\n\n quill.root.addEventListener('beforeinput', (event) => {\n this.handleBeforeInput(event);\n });\n\n // Gboard with English input on Android triggers `compositionstart` sometimes even\n // users are not going to type anything.\n if (!/Android/i.test(navigator.userAgent)) {\n quill.on(Quill.events.COMPOSITION_BEFORE_START, () => {\n this.handleCompositionStart();\n });\n }\n }\n\n private deleteRange(range: Range) {\n deleteRange({ range, quill: this.quill });\n }\n\n private replaceText(range: Range, text = '') {\n if (range.length === 0) return false;\n\n if (text) {\n // Follow the native behavior that inherits the formats of the first character\n const formats = this.quill.getFormat(range.index, 1);\n this.deleteRange(range);\n this.quill.updateContents(\n new Delta().retain(range.index).insert(text, formats),\n Quill.sources.USER,\n );\n } else {\n this.deleteRange(range);\n }\n\n this.quill.setSelection(range.index + text.length, 0, Quill.sources.SILENT);\n return true;\n }\n\n private handleBeforeInput(event: InputEvent) {\n if (\n this.quill.composition.isComposing ||\n event.defaultPrevented ||\n !INSERT_TYPES.includes(event.inputType)\n ) {\n return;\n }\n\n const staticRange = event.getTargetRanges\n ? event.getTargetRanges()[0]\n : null;\n if (!staticRange || staticRange.collapsed === true) {\n return;\n }\n\n const text = getPlainTextFromInputEvent(event);\n if (text == null) {\n return;\n }\n const normalized = this.quill.selection.normalizeNative(staticRange);\n const range = normalized\n ? this.quill.selection.normalizedToRange(normalized)\n : null;\n if (range && this.replaceText(range, text)) {\n event.preventDefault();\n }\n }\n\n private handleCompositionStart() {\n const range = this.quill.getSelection();\n if (range) {\n this.replaceText(range);\n }\n }\n}\n\nfunction getPlainTextFromInputEvent(event: InputEvent) {\n // When `inputType` is \"insertText\":\n // - `event.data` should be string (Safari uses `event.dataTransfer`).\n // - `event.dataTransfer` should be null.\n // When `inputType` is \"insertReplacementText\":\n // - `event.data` should be null.\n // - `event.dataTransfer` should contain \"text/plain\" data.\n\n if (typeof event.data === 'string') {\n return event.data;\n }\n if (event.dataTransfer?.types.includes('text/plain')) {\n return event.dataTransfer.getData('text/plain');\n }\n return null;\n}\n\nexport default Input;\n", "import { ParentBlot } from 'parchment';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\n\nconst isMac = /Mac/i.test(navigator.platform);\n\n// Export for testing\nexport const TTL_FOR_VALID_SELECTION_CHANGE = 100;\n\n// A loose check to determine if the shortcut can move the caret before a UI node:\n// [CARET]
    [CONTENT]
    \nconst canMoveCaretBeforeUINode = (event: KeyboardEvent) => {\n if (\n event.key === 'ArrowLeft' ||\n event.key === 'ArrowRight' || // RTL scripts or moving from the end of the previous line\n event.key === 'ArrowUp' ||\n event.key === 'ArrowDown' ||\n event.key === 'Home'\n ) {\n return true;\n }\n\n if (isMac && event.key === 'a' && event.ctrlKey === true) {\n return true;\n }\n\n return false;\n};\n\nclass UINode extends Module {\n isListening = false;\n selectionChangeDeadline = 0;\n\n constructor(quill: Quill, options: Record) {\n super(quill, options);\n\n this.handleArrowKeys();\n this.handleNavigationShortcuts();\n }\n\n private handleArrowKeys() {\n this.quill.keyboard.addBinding({\n key: ['ArrowLeft', 'ArrowRight'],\n offset: 0,\n shiftKey: null,\n handler(range, { line, event }) {\n if (!(line instanceof ParentBlot) || !line.uiNode) {\n return true;\n }\n\n const isRTL = getComputedStyle(line.domNode)['direction'] === 'rtl';\n if (\n (isRTL && event.key !== 'ArrowRight') ||\n (!isRTL && event.key !== 'ArrowLeft')\n ) {\n return true;\n }\n\n this.quill.setSelection(\n range.index - 1,\n range.length + (event.shiftKey ? 1 : 0),\n Quill.sources.USER,\n );\n return false;\n },\n });\n }\n\n private handleNavigationShortcuts() {\n this.quill.root.addEventListener('keydown', (event) => {\n if (!event.defaultPrevented && canMoveCaretBeforeUINode(event)) {\n this.ensureListeningToSelectionChange();\n }\n });\n }\n\n /**\n * We only listen to the `selectionchange` event when\n * there is an intention of moving the caret to the beginning using shortcuts.\n * This is primarily implemented to prevent infinite loops, as we are changing\n * the selection within the handler of a `selectionchange` event.\n */\n private ensureListeningToSelectionChange() {\n this.selectionChangeDeadline = Date.now() + TTL_FOR_VALID_SELECTION_CHANGE;\n\n if (this.isListening) return;\n this.isListening = true;\n\n const listener = () => {\n this.isListening = false;\n\n if (Date.now() <= this.selectionChangeDeadline) {\n this.handleSelectionChange();\n }\n };\n\n document.addEventListener('selectionchange', listener, {\n once: true,\n });\n }\n\n private handleSelectionChange() {\n const selection = document.getSelection();\n if (!selection) return;\n const range = selection.getRangeAt(0);\n if (range.collapsed !== true || range.startOffset !== 0) return;\n\n const line = this.quill.scroll.find(range.startContainer);\n if (!(line instanceof ParentBlot) || !line.uiNode) return;\n\n const newRange = document.createRange();\n newRange.setStartAfter(line.uiNode);\n newRange.setEndAfter(line.uiNode);\n selection.removeAllRanges();\n selection.addRange(newRange);\n }\n}\n\nexport default UINode;\n", "import Quill, { Parchment, Range } from './core/quill.js';\nimport type {\n Bounds,\n DebugLevel,\n EmitterSource,\n ExpandedQuillOptions,\n QuillOptions,\n} from './core/quill.js';\n\nimport Block, { BlockEmbed } from './blots/block.js';\nimport Break from './blots/break.js';\nimport Container from './blots/container.js';\nimport Cursor from './blots/cursor.js';\nimport Embed from './blots/embed.js';\nimport Inline from './blots/inline.js';\nimport Scroll from './blots/scroll.js';\nimport TextBlot from './blots/text.js';\n\nimport Clipboard from './modules/clipboard.js';\nimport History from './modules/history.js';\nimport Keyboard from './modules/keyboard.js';\nimport Uploader from './modules/uploader.js';\nimport Delta, { Op, OpIterator, AttributeMap } from 'quill-delta';\nimport Input from './modules/input.js';\nimport UINode from './modules/uiNode.js';\n\nexport { default as Module } from './core/module.js';\nexport { Delta, Op, OpIterator, AttributeMap, Parchment, Range };\nexport type {\n Bounds,\n DebugLevel,\n EmitterSource,\n ExpandedQuillOptions,\n QuillOptions,\n};\n\nQuill.register({\n 'blots/block': Block,\n 'blots/block/embed': BlockEmbed,\n 'blots/break': Break,\n 'blots/container': Container,\n 'blots/cursor': Cursor,\n 'blots/embed': Embed,\n 'blots/inline': Inline,\n 'blots/scroll': Scroll,\n 'blots/text': TextBlot,\n\n 'modules/clipboard': Clipboard,\n 'modules/history': History,\n 'modules/keyboard': Keyboard,\n 'modules/uploader': Uploader,\n 'modules/input': Input,\n 'modules/uiNode': UINode,\n});\n\nexport default Quill;\n", "import { ClassAttributor, Scope } from 'parchment';\n\nclass IndentAttributor extends ClassAttributor {\n add(node: HTMLElement, value: string | number) {\n let normalizedValue = 0;\n if (value === '+1' || value === '-1') {\n const indent = this.value(node) || 0;\n normalizedValue = value === '+1' ? indent + 1 : indent - 1;\n } else if (typeof value === 'number') {\n normalizedValue = value;\n }\n if (normalizedValue === 0) {\n this.remove(node);\n return true;\n }\n return super.add(node, normalizedValue.toString());\n }\n\n canAdd(node: HTMLElement, value: string) {\n return super.canAdd(node, value) || super.canAdd(node, parseInt(value, 10));\n }\n\n value(node: HTMLElement) {\n return parseInt(super.value(node), 10) || undefined; // Don't return NaN\n }\n}\n\nconst IndentClass = new IndentAttributor('indent', 'ql-indent', {\n scope: Scope.BLOCK,\n // @ts-expect-error\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8],\n});\n\nexport default IndentClass;\n", "import Block from '../blots/block.js';\n\nclass Blockquote extends Block {\n static blotName = 'blockquote';\n static tagName = 'blockquote';\n}\n\nexport default Blockquote;\n", "import Block from '../blots/block.js';\n\nclass Header extends Block {\n static blotName = 'header';\n static tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\n static formats(domNode: Element) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n}\n\nexport default Header;\n", "import Block from '../blots/block.js';\nimport Container from '../blots/container.js';\nimport type Scroll from '../blots/scroll.js';\nimport Quill from '../core/quill.js';\n\nclass ListContainer extends Container {}\nListContainer.blotName = 'list-container';\nListContainer.tagName = 'OL';\n\nclass ListItem extends Block {\n static create(value: string) {\n const node = super.create() as HTMLElement;\n node.setAttribute('data-list', value);\n return node;\n }\n\n static formats(domNode: HTMLElement) {\n return domNode.getAttribute('data-list') || undefined;\n }\n\n static register() {\n Quill.register(ListContainer);\n }\n\n constructor(scroll: Scroll, domNode: HTMLElement) {\n super(scroll, domNode);\n const ui = domNode.ownerDocument.createElement('span');\n const listEventHandler = (e: Event) => {\n if (!scroll.isEnabled()) return;\n const format = this.statics.formats(domNode, scroll);\n if (format === 'checked') {\n this.format('list', 'unchecked');\n e.preventDefault();\n } else if (format === 'unchecked') {\n this.format('list', 'checked');\n e.preventDefault();\n }\n };\n ui.addEventListener('mousedown', listEventHandler);\n ui.addEventListener('touchstart', listEventHandler);\n this.attachUI(ui);\n }\n\n format(name: string, value: string) {\n if (name === this.statics.blotName && value) {\n this.domNode.setAttribute('data-list', value);\n } else {\n super.format(name, value);\n }\n }\n}\nListItem.blotName = 'list';\nListItem.tagName = 'LI';\n\nListContainer.allowedChildren = [ListItem];\nListItem.requiredContainer = ListContainer;\n\nexport { ListContainer, ListItem as default };\n", "import Inline from '../blots/inline.js';\n\nclass Bold extends Inline {\n static blotName = 'bold';\n static tagName = ['STRONG', 'B'];\n\n static create() {\n return super.create();\n }\n\n static formats() {\n return true;\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n}\n\nexport default Bold;\n", "import Bold from './bold.js';\n\nclass Italic extends Bold {\n static blotName = 'italic';\n static tagName = ['EM', 'I'];\n}\n\nexport default Italic;\n", "import Inline from '../blots/inline.js';\n\nclass Link extends Inline {\n static blotName = 'link';\n static tagName = 'A';\n static SANITIZED_URL = 'about:blank';\n static PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel', 'sms'];\n\n static create(value: string) {\n const node = super.create(value) as HTMLElement;\n node.setAttribute('href', this.sanitize(value));\n node.setAttribute('rel', 'noopener noreferrer');\n node.setAttribute('target', '_blank');\n return node;\n }\n\n static formats(domNode: HTMLElement) {\n return domNode.getAttribute('href');\n }\n\n static sanitize(url: string) {\n return sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;\n }\n\n format(name: string, value: unknown) {\n if (name !== this.statics.blotName || !value) {\n super.format(name, value);\n } else {\n // @ts-expect-error\n this.domNode.setAttribute('href', this.constructor.sanitize(value));\n }\n }\n}\n\nfunction sanitize(url: string, protocols: string[]) {\n const anchor = document.createElement('a');\n anchor.href = url;\n const protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\nexport { Link as default, sanitize };\n", "import Inline from '../blots/inline.js';\n\nclass Script extends Inline {\n static blotName = 'script';\n static tagName = ['SUB', 'SUP'];\n\n static create(value: 'super' | 'sub' | (string & {})) {\n if (value === 'super') {\n return document.createElement('sup');\n }\n if (value === 'sub') {\n return document.createElement('sub');\n }\n return super.create(value);\n }\n\n static formats(domNode: HTMLElement) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n}\n\nexport default Script;\n", "import Bold from './bold.js';\n\nclass Strike extends Bold {\n static blotName = 'strike';\n static tagName = ['S', 'STRIKE'];\n}\n\nexport default Strike;\n", "import Inline from '../blots/inline.js';\n\nclass Underline extends Inline {\n static blotName = 'underline';\n static tagName = 'U';\n}\n\nexport default Underline;\n", "import Embed from '../blots/embed.js';\n\nclass Formula extends Embed {\n static blotName = 'formula';\n static className = 'ql-formula';\n static tagName = 'SPAN';\n\n static create(value: string) {\n // @ts-expect-error\n if (window.katex == null) {\n throw new Error('Formula module requires KaTeX.');\n }\n const node = super.create(value) as Element;\n if (typeof value === 'string') {\n // @ts-expect-error\n window.katex.render(value, node, {\n throwOnError: false,\n errorColor: '#f00',\n });\n node.setAttribute('data-value', value);\n }\n return node;\n }\n\n static value(domNode: Element) {\n return domNode.getAttribute('data-value');\n }\n\n html() {\n const { formula } = this.value();\n return `${formula}`;\n }\n}\n\nexport default Formula;\n", "import { EmbedBlot } from 'parchment';\nimport { sanitize } from './link.js';\n\nconst ATTRIBUTES = ['alt', 'height', 'width'];\n\nclass Image extends EmbedBlot {\n static blotName = 'image';\n static tagName = 'IMG';\n\n static create(value: string) {\n const node = super.create(value) as Element;\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n }\n return node;\n }\n\n static formats(domNode: Element) {\n return ATTRIBUTES.reduce(\n (formats: Record, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n },\n {},\n );\n }\n\n static match(url: string) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static sanitize(url: string) {\n return sanitize(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode: Element) {\n return domNode.getAttribute('src');\n }\n\n domNode: HTMLImageElement;\n\n format(name: string, value: string) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\n\nexport default Image;\n", "import { BlockEmbed } from '../blots/block.js';\nimport Link from './link.js';\n\nconst ATTRIBUTES = ['height', 'width'];\n\nclass Video extends BlockEmbed {\n static blotName = 'video';\n static className = 'ql-video';\n static tagName = 'IFRAME';\n\n static create(value: string) {\n const node = super.create(value) as Element;\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', 'true');\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n\n static formats(domNode: Element) {\n return ATTRIBUTES.reduce(\n (formats: Record, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n },\n {},\n );\n }\n\n static sanitize(url: string) {\n return Link.sanitize(url);\n }\n\n static value(domNode: Element) {\n return domNode.getAttribute('src');\n }\n\n domNode: HTMLVideoElement;\n\n format(name: string, value: string) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n\n html() {\n const { video } = this.value();\n return `${video}`;\n }\n}\n\nexport default Video;\n", "import Delta from 'quill-delta';\nimport { ClassAttributor, Scope } from 'parchment';\nimport type { Blot, ScrollBlot } from 'parchment';\nimport Inline from '../blots/inline.js';\nimport Quill from '../core/quill.js';\nimport Module from '../core/module.js';\nimport { blockDelta } from '../blots/block.js';\nimport BreakBlot from '../blots/break.js';\nimport CursorBlot from '../blots/cursor.js';\nimport TextBlot, { escapeText } from '../blots/text.js';\nimport CodeBlock, { CodeBlockContainer } from '../formats/code.js';\nimport { traverse } from './clipboard.js';\n\nconst TokenAttributor = new ClassAttributor('code-token', 'hljs', {\n scope: Scope.INLINE,\n});\nclass CodeToken extends Inline {\n static formats(node: Element, scroll: ScrollBlot) {\n while (node != null && node !== scroll.domNode) {\n if (node.classList && node.classList.contains(CodeBlock.className)) {\n // @ts-expect-error\n return super.formats(node, scroll);\n }\n // @ts-expect-error\n node = node.parentNode;\n }\n return undefined;\n }\n\n constructor(scroll: ScrollBlot, domNode: Node, value: unknown) {\n // @ts-expect-error\n super(scroll, domNode, value);\n TokenAttributor.add(this.domNode, value);\n }\n\n format(format: string, value: unknown) {\n if (format !== CodeToken.blotName) {\n super.format(format, value);\n } else if (value) {\n TokenAttributor.add(this.domNode, value);\n } else {\n TokenAttributor.remove(this.domNode);\n this.domNode.classList.remove(this.statics.className);\n }\n }\n\n optimize(...args: unknown[]) {\n // @ts-expect-error\n super.optimize(...args);\n if (!TokenAttributor.value(this.domNode)) {\n this.unwrap();\n }\n }\n}\nCodeToken.blotName = 'code-token';\nCodeToken.className = 'ql-token';\n\nclass SyntaxCodeBlock extends CodeBlock {\n static create(value: unknown) {\n const domNode = super.create(value);\n if (typeof value === 'string') {\n domNode.setAttribute('data-language', value);\n }\n return domNode;\n }\n\n static formats(domNode: Node) {\n // @ts-expect-error\n return domNode.getAttribute('data-language') || 'plain';\n }\n\n static register() {} // Syntax module will register\n\n format(name: string, value: unknown) {\n if (name === this.statics.blotName && value) {\n // @ts-expect-error\n this.domNode.setAttribute('data-language', value);\n } else {\n super.format(name, value);\n }\n }\n\n replaceWith(name: string | Blot, value?: any) {\n this.formatAt(0, this.length(), CodeToken.blotName, false);\n return super.replaceWith(name, value);\n }\n}\n\nclass SyntaxCodeBlockContainer extends CodeBlockContainer {\n forceNext?: boolean;\n cachedText?: string | null;\n\n attach() {\n super.attach();\n this.forceNext = false;\n // @ts-expect-error\n this.scroll.emitMount(this);\n }\n\n format(name: string, value: unknown) {\n if (name === SyntaxCodeBlock.blotName) {\n this.forceNext = true;\n this.children.forEach((child) => {\n // @ts-expect-error\n child.format(name, value);\n });\n }\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n if (name === SyntaxCodeBlock.blotName) {\n this.forceNext = true;\n }\n super.formatAt(index, length, name, value);\n }\n\n highlight(\n highlight: (text: string, language: string) => Delta,\n forced = false,\n ) {\n if (this.children.head == null) return;\n const nodes = Array.from(this.domNode.childNodes).filter(\n (node) => node !== this.uiNode,\n );\n const text = `${nodes.map((node) => node.textContent).join('\\n')}\\n`;\n const language = SyntaxCodeBlock.formats(this.children.head.domNode);\n if (forced || this.forceNext || this.cachedText !== text) {\n if (text.trim().length > 0 || this.cachedText == null) {\n const oldDelta = this.children.reduce((delta, child) => {\n // @ts-expect-error\n return delta.concat(blockDelta(child, false));\n }, new Delta());\n const delta = highlight(text, language);\n oldDelta.diff(delta).reduce((index, { retain, attributes }) => {\n // Should be all retains\n if (!retain) return index;\n if (attributes) {\n Object.keys(attributes).forEach((format) => {\n if (\n [SyntaxCodeBlock.blotName, CodeToken.blotName].includes(format)\n ) {\n // @ts-expect-error\n this.formatAt(index, retain, format, attributes[format]);\n }\n });\n }\n // @ts-expect-error\n return index + retain;\n }, 0);\n }\n this.cachedText = text;\n this.forceNext = false;\n }\n }\n\n html(index: number, length: number) {\n const [codeBlock] = this.children.find(index);\n const language = codeBlock\n ? SyntaxCodeBlock.formats(codeBlock.domNode)\n : 'plain';\n\n return `
    \\n${escapeText(\n      this.code(index, length),\n    )}\\n
    `;\n }\n\n optimize(context: Record) {\n super.optimize(context);\n if (\n this.parent != null &&\n this.children.head != null &&\n this.uiNode != null\n ) {\n const language = SyntaxCodeBlock.formats(this.children.head.domNode);\n // @ts-expect-error\n if (language !== this.uiNode.value) {\n // @ts-expect-error\n this.uiNode.value = language;\n }\n }\n }\n}\n\nSyntaxCodeBlockContainer.allowedChildren = [SyntaxCodeBlock];\nSyntaxCodeBlock.requiredContainer = SyntaxCodeBlockContainer;\nSyntaxCodeBlock.allowedChildren = [CodeToken, CursorBlot, TextBlot, BreakBlot];\n\ninterface SyntaxOptions {\n interval: number;\n languages: { key: string; label: string }[];\n hljs: any;\n}\n\nconst highlight = (lib: any, language: string, text: string) => {\n if (typeof lib.versionString === 'string') {\n const majorVersion = lib.versionString.split('.')[0];\n if (parseInt(majorVersion, 10) >= 11) {\n return lib.highlight(text, { language }).value;\n }\n }\n return lib.highlight(language, text).value;\n};\n\nclass Syntax extends Module {\n static DEFAULTS: SyntaxOptions & { hljs: any };\n\n static register() {\n Quill.register(CodeToken, true);\n Quill.register(SyntaxCodeBlock, true);\n Quill.register(SyntaxCodeBlockContainer, true);\n }\n\n languages: Record;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n if (this.options.hljs == null) {\n throw new Error(\n 'Syntax module requires highlight.js. Please include the library on the page before Quill.',\n );\n }\n // @ts-expect-error Fix me later\n this.languages = this.options.languages.reduce(\n (memo: Record, { key }) => {\n memo[key] = true;\n return memo;\n },\n {},\n );\n this.highlightBlot = this.highlightBlot.bind(this);\n this.initListener();\n this.initTimer();\n }\n\n initListener() {\n this.quill.on(Quill.events.SCROLL_BLOT_MOUNT, (blot: Blot) => {\n if (!(blot instanceof SyntaxCodeBlockContainer)) return;\n const select = this.quill.root.ownerDocument.createElement('select');\n // @ts-expect-error Fix me later\n this.options.languages.forEach(({ key, label }) => {\n const option = select.ownerDocument.createElement('option');\n option.textContent = label;\n option.setAttribute('value', key);\n select.appendChild(option);\n });\n select.addEventListener('change', () => {\n blot.format(SyntaxCodeBlock.blotName, select.value);\n this.quill.root.focus(); // Prevent scrolling\n this.highlight(blot, true);\n });\n if (blot.uiNode == null) {\n blot.attachUI(select);\n if (blot.children.head) {\n select.value = SyntaxCodeBlock.formats(blot.children.head.domNode);\n }\n }\n });\n }\n\n initTimer() {\n let timer: ReturnType | null = null;\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n if (timer) {\n clearTimeout(timer);\n }\n timer = setTimeout(() => {\n this.highlight();\n timer = null;\n }, this.options.interval);\n });\n }\n\n highlight(blot: SyntaxCodeBlockContainer | null = null, force = false) {\n if (this.quill.selection.composing) return;\n this.quill.update(Quill.sources.USER);\n const range = this.quill.getSelection();\n const blots =\n blot == null\n ? this.quill.scroll.descendants(SyntaxCodeBlockContainer)\n : [blot];\n blots.forEach((container) => {\n container.highlight(this.highlightBlot, force);\n });\n this.quill.update(Quill.sources.SILENT);\n if (range != null) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n }\n }\n\n highlightBlot(text: string, language = 'plain') {\n language = this.languages[language] ? language : 'plain';\n if (language === 'plain') {\n return escapeText(text)\n .split('\\n')\n .reduce((delta, line, i) => {\n if (i !== 0) {\n delta.insert('\\n', { [CodeBlock.blotName]: language });\n }\n return delta.insert(line);\n }, new Delta());\n }\n const container = this.quill.root.ownerDocument.createElement('div');\n container.classList.add(CodeBlock.className);\n container.innerHTML = highlight(this.options.hljs, language, text);\n return traverse(\n this.quill.scroll,\n container,\n [\n (node, delta) => {\n // @ts-expect-error\n const value = TokenAttributor.value(node);\n if (value) {\n return delta.compose(\n new Delta().retain(delta.length(), {\n [CodeToken.blotName]: value,\n }),\n );\n }\n return delta;\n },\n ],\n [\n (node, delta) => {\n // @ts-expect-error\n return node.data.split('\\n').reduce((memo, nodeText, i) => {\n if (i !== 0) memo.insert('\\n', { [CodeBlock.blotName]: language });\n return memo.insert(nodeText);\n }, delta);\n },\n ],\n new WeakMap(),\n );\n }\n}\nSyntax.DEFAULTS = {\n hljs: (() => {\n return window.hljs;\n })(),\n interval: 1000,\n languages: [\n { key: 'plain', label: 'Plain' },\n { key: 'bash', label: 'Bash' },\n { key: 'cpp', label: 'C++' },\n { key: 'cs', label: 'C#' },\n { key: 'css', label: 'CSS' },\n { key: 'diff', label: 'Diff' },\n { key: 'xml', label: 'HTML/XML' },\n { key: 'java', label: 'Java' },\n { key: 'javascript', label: 'JavaScript' },\n { key: 'markdown', label: 'Markdown' },\n { key: 'php', label: 'PHP' },\n { key: 'python', label: 'Python' },\n { key: 'ruby', label: 'Ruby' },\n { key: 'sql', label: 'SQL' },\n ],\n};\n\nexport { SyntaxCodeBlock as CodeBlock, CodeToken, Syntax as default };\n", "import type { LinkedList } from 'parchment';\nimport Block from '../blots/block.js';\nimport Container from '../blots/container.js';\n\nclass TableCell extends Block {\n static blotName = 'table';\n static tagName = 'TD';\n\n static create(value: string) {\n const node = super.create() as HTMLElement;\n if (value) {\n node.setAttribute('data-row', value);\n } else {\n node.setAttribute('data-row', tableId());\n }\n return node;\n }\n\n static formats(domNode: HTMLElement) {\n if (domNode.hasAttribute('data-row')) {\n return domNode.getAttribute('data-row');\n }\n return undefined;\n }\n\n next: this | null;\n\n cellOffset() {\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n return -1;\n }\n\n format(name: string, value: string) {\n if (name === TableCell.blotName && value) {\n this.domNode.setAttribute('data-row', value);\n } else {\n super.format(name, value);\n }\n }\n\n row(): TableRow {\n return this.parent as TableRow;\n }\n\n rowOffset() {\n if (this.row()) {\n return this.row().rowOffset();\n }\n return -1;\n }\n\n table() {\n return this.row() && this.row().table();\n }\n}\n\nclass TableRow extends Container {\n static blotName = 'table-row';\n static tagName = 'TR';\n\n children: LinkedList;\n next: this | null;\n\n checkMerge() {\n // @ts-expect-error\n if (super.checkMerge() && this.next.children.head != null) {\n // @ts-expect-error\n const thisHead = this.children.head.formats();\n // @ts-expect-error\n const thisTail = this.children.tail.formats();\n // @ts-expect-error\n const nextHead = this.next.children.head.formats();\n // @ts-expect-error\n const nextTail = this.next.children.tail.formats();\n return (\n thisHead.table === thisTail.table &&\n thisHead.table === nextHead.table &&\n thisHead.table === nextTail.table\n );\n }\n return false;\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n this.children.forEach((child) => {\n if (child.next == null) return;\n const childFormats = child.formats();\n const nextFormats = child.next.formats();\n if (childFormats.table !== nextFormats.table) {\n const next = this.splitAfter(child);\n if (next) {\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n next.optimize();\n }\n // We might be able to merge with prev now\n if (this.prev) {\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n this.prev.optimize();\n }\n }\n });\n }\n\n rowOffset() {\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n return -1;\n }\n\n table() {\n return this.parent && this.parent.parent;\n }\n}\n\nclass TableBody extends Container {\n static blotName = 'table-body';\n static tagName = 'TBODY';\n\n children: LinkedList;\n}\n\nclass TableContainer extends Container {\n static blotName = 'table-container';\n static tagName = 'TABLE';\n\n children: LinkedList;\n\n balanceCells() {\n const rows = this.descendants(TableRow);\n const maxColumns = rows.reduce((max, row) => {\n return Math.max(row.children.length, max);\n }, 0);\n rows.forEach((row) => {\n new Array(maxColumns - row.children.length).fill(0).forEach(() => {\n let value;\n if (row.children.head != null) {\n value = TableCell.formats(row.children.head.domNode);\n }\n const blot = this.scroll.create(TableCell.blotName, value);\n row.appendChild(blot);\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n blot.optimize(); // Add break blot\n });\n });\n }\n\n cells(column: number) {\n return this.rows().map((row) => row.children.at(column));\n }\n\n deleteColumn(index: number) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody) as TableBody[];\n if (body == null || body.children.head == null) return;\n body.children.forEach((row) => {\n const cell = row.children.at(index);\n if (cell != null) {\n cell.remove();\n }\n });\n }\n\n insertColumn(index: number) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody) as TableBody[];\n if (body == null || body.children.head == null) return;\n body.children.forEach((row) => {\n const ref = row.children.at(index);\n // @ts-expect-error\n const value = TableCell.formats(row.children.head.domNode);\n const cell = this.scroll.create(TableCell.blotName, value);\n row.insertBefore(cell, ref);\n });\n }\n\n insertRow(index: number) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody) as TableBody[];\n if (body == null || body.children.head == null) return;\n const id = tableId();\n const row = this.scroll.create(TableRow.blotName) as TableRow;\n body.children.head.children.forEach(() => {\n const cell = this.scroll.create(TableCell.blotName, id);\n row.appendChild(cell);\n });\n const ref = body.children.at(index);\n body.insertBefore(row, ref);\n }\n\n rows() {\n const body = this.children.head;\n if (body == null) return [];\n return body.children.map((row) => row);\n }\n}\n\nTableContainer.allowedChildren = [TableBody];\nTableBody.requiredContainer = TableContainer;\n\nTableBody.allowedChildren = [TableRow];\nTableRow.requiredContainer = TableBody;\n\nTableRow.allowedChildren = [TableCell];\nTableCell.requiredContainer = TableRow;\n\nfunction tableId() {\n const id = Math.random().toString(36).slice(2, 6);\n return `row-${id}`;\n}\n\nexport { TableCell, TableRow, TableBody, TableContainer, tableId };\n", "import Delta from 'quill-delta';\nimport Quill from '../core/quill.js';\nimport Module from '../core/module.js';\nimport {\n TableCell,\n TableRow,\n TableBody,\n TableContainer,\n tableId,\n} from '../formats/table.js';\n\nclass Table extends Module {\n static register() {\n Quill.register(TableCell);\n Quill.register(TableRow);\n Quill.register(TableBody);\n Quill.register(TableContainer);\n }\n\n constructor(...args: ConstructorParameters) {\n super(...args);\n this.listenBalanceCells();\n }\n\n balanceTables() {\n this.quill.scroll.descendants(TableContainer).forEach((table) => {\n table.balanceCells();\n });\n }\n\n deleteColumn() {\n const [table, , cell] = this.getTable();\n if (cell == null) return;\n // @ts-expect-error\n table.deleteColumn(cell.cellOffset());\n this.quill.update(Quill.sources.USER);\n }\n\n deleteRow() {\n const [, row] = this.getTable();\n if (row == null) return;\n row.remove();\n this.quill.update(Quill.sources.USER);\n }\n\n deleteTable() {\n const [table] = this.getTable();\n if (table == null) return;\n // @ts-expect-error\n const offset = table.offset();\n // @ts-expect-error\n table.remove();\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(offset, Quill.sources.SILENT);\n }\n\n getTable(\n range = this.quill.getSelection(),\n ): [null, null, null, -1] | [Table, TableRow, TableCell, number] {\n if (range == null) return [null, null, null, -1];\n const [cell, offset] = this.quill.getLine(range.index);\n if (cell == null || cell.statics.blotName !== TableCell.blotName) {\n return [null, null, null, -1];\n }\n const row = cell.parent;\n const table = row.parent.parent;\n // @ts-expect-error\n return [table, row, cell, offset];\n }\n\n insertColumn(offset: number) {\n const range = this.quill.getSelection();\n if (!range) return;\n const [table, row, cell] = this.getTable(range);\n if (cell == null) return;\n const column = cell.cellOffset();\n table.insertColumn(column + offset);\n this.quill.update(Quill.sources.USER);\n let shift = row.rowOffset();\n if (offset === 0) {\n shift += 1;\n }\n this.quill.setSelection(\n range.index + shift,\n range.length,\n Quill.sources.SILENT,\n );\n }\n\n insertColumnLeft() {\n this.insertColumn(0);\n }\n\n insertColumnRight() {\n this.insertColumn(1);\n }\n\n insertRow(offset: number) {\n const range = this.quill.getSelection();\n if (!range) return;\n const [table, row, cell] = this.getTable(range);\n if (cell == null) return;\n const index = row.rowOffset();\n table.insertRow(index + offset);\n this.quill.update(Quill.sources.USER);\n if (offset > 0) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n } else {\n this.quill.setSelection(\n range.index + row.children.length,\n range.length,\n Quill.sources.SILENT,\n );\n }\n }\n\n insertRowAbove() {\n this.insertRow(0);\n }\n\n insertRowBelow() {\n this.insertRow(1);\n }\n\n insertTable(rows: number, columns: number) {\n const range = this.quill.getSelection();\n if (range == null) return;\n const delta = new Array(rows).fill(0).reduce((memo) => {\n const text = new Array(columns).fill('\\n').join('');\n return memo.insert(text, { table: tableId() });\n }, new Delta().retain(range.index));\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index, Quill.sources.SILENT);\n this.balanceTables();\n }\n\n listenBalanceCells() {\n this.quill.on(\n Quill.events.SCROLL_OPTIMIZE,\n (mutations: MutationRecord[]) => {\n mutations.some((mutation) => {\n if (\n ['TD', 'TR', 'TBODY', 'TABLE'].includes(\n (mutation.target as HTMLElement).tagName,\n )\n ) {\n this.quill.once(Quill.events.TEXT_CHANGE, (delta, old, source) => {\n if (source !== Quill.sources.USER) return;\n this.balanceTables();\n });\n return true;\n }\n return false;\n });\n },\n );\n }\n}\n\nexport default Table;\n", "import Delta from 'quill-delta';\nimport { EmbedBlot, Scope } from 'parchment';\nimport Quill from '../core/quill.js';\nimport logger from '../core/logger.js';\nimport Module from '../core/module.js';\nimport type { Range } from '../core/selection.js';\n\nconst debug = logger('quill:toolbar');\n\ntype Handler = (this: Toolbar, value: any) => void;\n\nexport type ToolbarConfig = Array<\n string[] | Array>\n>;\nexport interface ToolbarProps {\n container?: HTMLElement | ToolbarConfig | null;\n handlers?: Record;\n option?: number;\n module?: boolean;\n theme?: boolean;\n}\n\nclass Toolbar extends Module {\n static DEFAULTS: ToolbarProps;\n\n container?: HTMLElement | null;\n controls: [string, HTMLElement][];\n handlers: Record;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n if (Array.isArray(this.options.container)) {\n const container = document.createElement('div');\n container.setAttribute('role', 'toolbar');\n addControls(container, this.options.container);\n quill.container?.parentNode?.insertBefore(container, quill.container);\n this.container = container;\n } else if (typeof this.options.container === 'string') {\n this.container = document.querySelector(this.options.container);\n } else {\n this.container = this.options.container;\n }\n if (!(this.container instanceof HTMLElement)) {\n debug.error('Container required for toolbar', this.options);\n return;\n }\n this.container.classList.add('ql-toolbar');\n this.controls = [];\n this.handlers = {};\n if (this.options.handlers) {\n Object.keys(this.options.handlers).forEach((format) => {\n const handler = this.options.handlers?.[format];\n if (handler) {\n this.addHandler(format, handler);\n }\n });\n }\n Array.from(this.container.querySelectorAll('button, select')).forEach(\n (input) => {\n // @ts-expect-error\n this.attach(input);\n },\n );\n this.quill.on(Quill.events.EDITOR_CHANGE, () => {\n const [range] = this.quill.selection.getRange(); // quill.getSelection triggers update\n this.update(range);\n });\n }\n\n addHandler(format: string, handler: Handler) {\n this.handlers[format] = handler;\n }\n\n attach(input: HTMLElement) {\n let format = Array.from(input.classList).find((className) => {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (\n this.handlers[format] == null &&\n this.quill.scroll.query(format) == null\n ) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n const eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, (e) => {\n let value;\n if (input.tagName === 'SELECT') {\n // @ts-expect-error\n if (input.selectedIndex < 0) return;\n // @ts-expect-error\n const selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n // @ts-expect-error\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n this.quill.focus();\n const [range] = this.quill.selection.getRange();\n if (this.handlers[format] != null) {\n this.handlers[format].call(this, value);\n } else if (\n // @ts-expect-error\n this.quill.scroll.query(format).prototype instanceof EmbedBlot\n ) {\n value = prompt(`Enter ${format}`); // eslint-disable-line no-alert\n if (!value) return;\n this.quill.updateContents(\n new Delta()\n // @ts-expect-error Fix me later\n .retain(range.index)\n // @ts-expect-error Fix me later\n .delete(range.length)\n .insert({ [format]: value }),\n Quill.sources.USER,\n );\n } else {\n this.quill.format(format, value, Quill.sources.USER);\n }\n this.update(range);\n });\n this.controls.push([format, input]);\n }\n\n update(range: Range | null) {\n const formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach((pair) => {\n const [format, input] = pair;\n if (input.tagName === 'SELECT') {\n let option: HTMLOptionElement | null = null;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n let value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\"/g, '\\\\\"');\n }\n option = input.querySelector(`option[value=\"${value}\"]`);\n }\n if (option == null) {\n // @ts-expect-error TODO fix me later\n input.value = ''; // TODO make configurable?\n // @ts-expect-error TODO fix me later\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else if (range == null) {\n input.classList.remove('ql-active');\n input.setAttribute('aria-pressed', 'false');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n const value = formats[format] as boolean | number | string | object;\n const isActive =\n value === input.getAttribute('value') ||\n (value != null && value.toString() === input.getAttribute('value')) ||\n (value == null && !input.getAttribute('value'));\n input.classList.toggle('ql-active', isActive);\n input.setAttribute('aria-pressed', isActive.toString());\n } else {\n const isActive = formats[format] != null;\n input.classList.toggle('ql-active', isActive);\n input.setAttribute('aria-pressed', isActive.toString());\n }\n });\n }\n}\nToolbar.DEFAULTS = {};\n\nfunction addButton(container: HTMLElement, format: string, value?: string) {\n const input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add(`ql-${format}`);\n input.setAttribute('aria-pressed', 'false');\n if (value != null) {\n input.value = value;\n input.setAttribute('aria-label', `${format}: ${value}`);\n } else {\n input.setAttribute('aria-label', format);\n }\n container.appendChild(input);\n}\n\nfunction addControls(\n container: HTMLElement,\n groups:\n | (string | Record)[][]\n | (string | Record)[],\n) {\n if (!Array.isArray(groups[0])) {\n // @ts-expect-error\n groups = [groups];\n }\n groups.forEach((controls: any) => {\n const group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach((control: any) => {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n const format = Object.keys(control)[0];\n const value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(\n container: HTMLElement,\n format: string,\n values: Array,\n) {\n const input = document.createElement('select');\n input.classList.add(`ql-${format}`);\n values.forEach((value) => {\n const option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', String(value));\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean() {\n const range = this.quill.getSelection();\n if (range == null) return;\n if (range.length === 0) {\n const formats = this.quill.getFormat();\n Object.keys(formats).forEach((name) => {\n // Clean functionality in existing apps only clean inline formats\n if (this.quill.scroll.query(name, Scope.INLINE) != null) {\n this.quill.format(name, false, Quill.sources.USER);\n }\n });\n } else {\n this.quill.removeFormat(range.index, range.length, Quill.sources.USER);\n }\n },\n direction(value) {\n const { align } = this.quill.getFormat();\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', Quill.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, Quill.sources.USER);\n }\n this.quill.format('direction', value, Quill.sources.USER);\n },\n indent(value) {\n const range = this.quill.getSelection();\n // @ts-expect-error\n const formats = this.quill.getFormat(range);\n // @ts-expect-error\n const indent = parseInt(formats.indent || 0, 10);\n if (value === '+1' || value === '-1') {\n let modifier = value === '+1' ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, Quill.sources.USER);\n }\n },\n link(value) {\n if (value === true) {\n value = prompt('Enter link URL:'); // eslint-disable-line no-alert\n }\n this.quill.format('link', value, Quill.sources.USER);\n },\n list(value) {\n const range = this.quill.getSelection();\n // @ts-expect-error\n const formats = this.quill.getFormat(range);\n if (value === 'check') {\n if (formats.list === 'checked' || formats.list === 'unchecked') {\n this.quill.format('list', false, Quill.sources.USER);\n } else {\n this.quill.format('list', 'unchecked', Quill.sources.USER);\n }\n } else {\n this.quill.format('list', value, Quill.sources.USER);\n }\n },\n },\n};\n\nexport { Toolbar as default, addControls };\n", "import alignLeftIcon from '../assets/icons/align-left.svg';\nimport alignCenterIcon from '../assets/icons/align-center.svg';\nimport alignRightIcon from '../assets/icons/align-right.svg';\nimport alignJustifyIcon from '../assets/icons/align-justify.svg';\nimport backgroundIcon from '../assets/icons/background.svg';\nimport blockquoteIcon from '../assets/icons/blockquote.svg';\nimport boldIcon from '../assets/icons/bold.svg';\nimport cleanIcon from '../assets/icons/clean.svg';\nimport codeIcon from '../assets/icons/code.svg';\nimport colorIcon from '../assets/icons/color.svg';\nimport directionLeftToRightIcon from '../assets/icons/direction-ltr.svg';\nimport directionRightToLeftIcon from '../assets/icons/direction-rtl.svg';\nimport formulaIcon from '../assets/icons/formula.svg';\nimport headerIcon from '../assets/icons/header.svg';\nimport header2Icon from '../assets/icons/header-2.svg';\nimport header3Icon from '../assets/icons/header-3.svg';\nimport header4Icon from '../assets/icons/header-4.svg';\nimport header5Icon from '../assets/icons/header-5.svg';\nimport header6Icon from '../assets/icons/header-6.svg';\nimport italicIcon from '../assets/icons/italic.svg';\nimport imageIcon from '../assets/icons/image.svg';\nimport indentIcon from '../assets/icons/indent.svg';\nimport outdentIcon from '../assets/icons/outdent.svg';\nimport linkIcon from '../assets/icons/link.svg';\nimport listBulletIcon from '../assets/icons/list-bullet.svg';\nimport listCheckIcon from '../assets/icons/list-check.svg';\nimport listOrderedIcon from '../assets/icons/list-ordered.svg';\nimport subscriptIcon from '../assets/icons/subscript.svg';\nimport superscriptIcon from '../assets/icons/superscript.svg';\nimport strikeIcon from '../assets/icons/strike.svg';\nimport tableIcon from '../assets/icons/table.svg';\nimport underlineIcon from '../assets/icons/underline.svg';\nimport videoIcon from '../assets/icons/video.svg';\n\nexport default {\n align: {\n '': alignLeftIcon,\n center: alignCenterIcon,\n right: alignRightIcon,\n justify: alignJustifyIcon,\n },\n background: backgroundIcon,\n blockquote: blockquoteIcon,\n bold: boldIcon,\n clean: cleanIcon,\n code: codeIcon,\n 'code-block': codeIcon,\n color: colorIcon,\n direction: {\n '': directionLeftToRightIcon,\n rtl: directionRightToLeftIcon,\n },\n formula: formulaIcon,\n header: {\n '1': headerIcon,\n '2': header2Icon,\n '3': header3Icon,\n '4': header4Icon,\n '5': header5Icon,\n '6': header6Icon,\n },\n italic: italicIcon,\n image: imageIcon,\n indent: {\n '+1': indentIcon,\n '-1': outdentIcon,\n },\n link: linkIcon,\n list: {\n bullet: listBulletIcon,\n check: listCheckIcon,\n ordered: listOrderedIcon,\n },\n script: {\n sub: subscriptIcon,\n super: superscriptIcon,\n },\n strike: strikeIcon,\n table: tableIcon,\n underline: underlineIcon,\n video: videoIcon,\n};\n", "import DropdownIcon from '../assets/icons/dropdown.svg';\n\nlet optionsCounter = 0;\n\nfunction toggleAriaAttribute(element: HTMLElement, attribute: string) {\n element.setAttribute(\n attribute,\n `${!(element.getAttribute(attribute) === 'true')}`,\n );\n}\n\nclass Picker {\n select: HTMLSelectElement;\n container: HTMLElement;\n label: HTMLElement;\n\n constructor(select: HTMLSelectElement) {\n this.select = select;\n this.container = document.createElement('span');\n this.buildPicker();\n this.select.style.display = 'none';\n // @ts-expect-error Fix me later\n this.select.parentNode.insertBefore(this.container, this.select);\n\n this.label.addEventListener('mousedown', () => {\n this.togglePicker();\n });\n this.label.addEventListener('keydown', (event) => {\n switch (event.key) {\n case 'Enter':\n this.togglePicker();\n break;\n case 'Escape':\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n this.select.addEventListener('change', this.update.bind(this));\n }\n\n togglePicker() {\n this.container.classList.toggle('ql-expanded');\n // Toggle aria-expanded and aria-hidden to make the picker accessible\n toggleAriaAttribute(this.label, 'aria-expanded');\n // @ts-expect-error\n toggleAriaAttribute(this.options, 'aria-hidden');\n }\n\n buildItem(option: HTMLOptionElement) {\n const item = document.createElement('span');\n // @ts-expect-error\n item.tabIndex = '0';\n item.setAttribute('role', 'button');\n item.classList.add('ql-picker-item');\n const value = option.getAttribute('value');\n if (value) {\n item.setAttribute('data-value', value);\n }\n if (option.textContent) {\n item.setAttribute('data-label', option.textContent);\n }\n item.addEventListener('click', () => {\n this.selectItem(item, true);\n });\n item.addEventListener('keydown', (event) => {\n switch (event.key) {\n case 'Enter':\n this.selectItem(item, true);\n event.preventDefault();\n break;\n case 'Escape':\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n\n return item;\n }\n\n buildLabel() {\n const label = document.createElement('span');\n label.classList.add('ql-picker-label');\n label.innerHTML = DropdownIcon;\n // @ts-expect-error\n label.tabIndex = '0';\n label.setAttribute('role', 'button');\n label.setAttribute('aria-expanded', 'false');\n this.container.appendChild(label);\n return label;\n }\n\n buildOptions() {\n const options = document.createElement('span');\n options.classList.add('ql-picker-options');\n\n // Don't want screen readers to read this until options are visible\n options.setAttribute('aria-hidden', 'true');\n // @ts-expect-error\n options.tabIndex = '-1';\n\n // Need a unique id for aria-controls\n options.id = `ql-picker-options-${optionsCounter}`;\n optionsCounter += 1;\n this.label.setAttribute('aria-controls', options.id);\n\n // @ts-expect-error\n this.options = options;\n\n Array.from(this.select.options).forEach((option) => {\n const item = this.buildItem(option);\n options.appendChild(item);\n if (option.selected === true) {\n this.selectItem(item);\n }\n });\n this.container.appendChild(options);\n }\n\n buildPicker() {\n Array.from(this.select.attributes).forEach((item) => {\n this.container.setAttribute(item.name, item.value);\n });\n this.container.classList.add('ql-picker');\n this.label = this.buildLabel();\n this.buildOptions();\n }\n\n escape() {\n // Close menu and return focus to trigger label\n this.close();\n // Need setTimeout for accessibility to ensure that the browser executes\n // focus on the next process thread and after any DOM content changes\n setTimeout(() => this.label.focus(), 1);\n }\n\n close() {\n this.container.classList.remove('ql-expanded');\n this.label.setAttribute('aria-expanded', 'false');\n // @ts-expect-error\n this.options.setAttribute('aria-hidden', 'true');\n }\n\n selectItem(item: HTMLElement | null, trigger = false) {\n const selected = this.container.querySelector('.ql-selected');\n if (item === selected) return;\n if (selected != null) {\n selected.classList.remove('ql-selected');\n }\n if (item == null) return;\n item.classList.add('ql-selected');\n // @ts-expect-error Fix me later\n this.select.selectedIndex = Array.from(item.parentNode.children).indexOf(\n item,\n );\n if (item.hasAttribute('data-value')) {\n // @ts-expect-error Fix me later\n this.label.setAttribute('data-value', item.getAttribute('data-value'));\n } else {\n this.label.removeAttribute('data-value');\n }\n if (item.hasAttribute('data-label')) {\n // @ts-expect-error Fix me later\n this.label.setAttribute('data-label', item.getAttribute('data-label'));\n } else {\n this.label.removeAttribute('data-label');\n }\n if (trigger) {\n this.select.dispatchEvent(new Event('change'));\n this.close();\n }\n }\n\n update() {\n let option;\n if (this.select.selectedIndex > -1) {\n const item =\n // @ts-expect-error Fix me later\n this.container.querySelector('.ql-picker-options').children[\n this.select.selectedIndex\n ];\n option = this.select.options[this.select.selectedIndex];\n // @ts-expect-error\n this.selectItem(item);\n } else {\n this.selectItem(null);\n }\n const isActive =\n option != null &&\n option !== this.select.querySelector('option[selected]');\n this.label.classList.toggle('ql-active', isActive);\n }\n}\n\nexport default Picker;\n", "import Picker from './picker.js';\n\nclass ColorPicker extends Picker {\n constructor(select: HTMLSelectElement, label: string) {\n super(select);\n this.label.innerHTML = label;\n this.container.classList.add('ql-color-picker');\n Array.from(this.container.querySelectorAll('.ql-picker-item'))\n .slice(0, 7)\n .forEach((item) => {\n item.classList.add('ql-primary');\n });\n }\n\n buildItem(option: HTMLOptionElement) {\n const item = super.buildItem(option);\n item.style.backgroundColor = option.getAttribute('value') || '';\n return item;\n }\n\n selectItem(item: HTMLElement | null, trigger?: boolean) {\n super.selectItem(item, trigger);\n const colorLabel = this.label.querySelector('.ql-color-label');\n const value = item ? item.getAttribute('data-value') || '' : '';\n if (colorLabel) {\n if (colorLabel.tagName === 'line') {\n colorLabel.style.stroke = value;\n } else {\n colorLabel.style.fill = value;\n }\n }\n }\n}\n\nexport default ColorPicker;\n", "import Picker from './picker.js';\n\nclass IconPicker extends Picker {\n defaultItem: HTMLElement | null;\n\n constructor(select: HTMLSelectElement, icons: Record) {\n super(select);\n this.container.classList.add('ql-icon-picker');\n Array.from(this.container.querySelectorAll('.ql-picker-item')).forEach(\n (item) => {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n },\n );\n this.defaultItem = this.container.querySelector('.ql-selected');\n this.selectItem(this.defaultItem);\n }\n\n selectItem(target: HTMLElement | null, trigger?: boolean) {\n super.selectItem(target, trigger);\n const item = target || this.defaultItem;\n if (item != null) {\n if (this.label.innerHTML === item.innerHTML) return;\n this.label.innerHTML = item.innerHTML;\n }\n }\n}\n\nexport default IconPicker;\n", "import type Quill from '../core.js';\nimport type { Bounds } from '../core/selection.js';\n\nconst isScrollable = (el: Element) => {\n const { overflowY } = getComputedStyle(el, null);\n return overflowY !== 'visible' && overflowY !== 'clip';\n};\n\nclass Tooltip {\n quill: Quill;\n boundsContainer: HTMLElement;\n root: HTMLDivElement;\n\n constructor(quill: Quill, boundsContainer?: HTMLElement) {\n this.quill = quill;\n this.boundsContainer = boundsContainer || document.body;\n this.root = quill.addContainer('ql-tooltip');\n // @ts-expect-error\n this.root.innerHTML = this.constructor.TEMPLATE;\n if (isScrollable(this.quill.root)) {\n this.quill.root.addEventListener('scroll', () => {\n this.root.style.marginTop = `${-1 * this.quill.root.scrollTop}px`;\n });\n }\n this.hide();\n }\n\n hide() {\n this.root.classList.add('ql-hidden');\n }\n\n position(reference: Bounds) {\n const left =\n reference.left + reference.width / 2 - this.root.offsetWidth / 2;\n // root.scrollTop should be 0 if scrollContainer !== root\n const top = reference.bottom + this.quill.root.scrollTop;\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.classList.remove('ql-flip');\n const containerBounds = this.boundsContainer.getBoundingClientRect();\n const rootBounds = this.root.getBoundingClientRect();\n let shift = 0;\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right;\n this.root.style.left = `${left + shift}px`;\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left;\n this.root.style.left = `${left + shift}px`;\n }\n if (rootBounds.bottom > containerBounds.bottom) {\n const height = rootBounds.bottom - rootBounds.top;\n const verticalShift = reference.bottom - reference.top + height;\n this.root.style.top = `${top - verticalShift}px`;\n this.root.classList.add('ql-flip');\n }\n return shift;\n }\n\n show() {\n this.root.classList.remove('ql-editing');\n this.root.classList.remove('ql-hidden');\n }\n}\n\nexport default Tooltip;\n", "import { merge } from 'lodash-es';\nimport type Quill from '../core/quill.js';\nimport Emitter from '../core/emitter.js';\nimport Theme from '../core/theme.js';\nimport type { ThemeOptions } from '../core/theme.js';\nimport ColorPicker from '../ui/color-picker.js';\nimport IconPicker from '../ui/icon-picker.js';\nimport Picker from '../ui/picker.js';\nimport Tooltip from '../ui/tooltip.js';\nimport type { Range } from '../core/selection.js';\nimport type Clipboard from '../modules/clipboard.js';\nimport type History from '../modules/history.js';\nimport type Keyboard from '../modules/keyboard.js';\nimport type Uploader from '../modules/uploader.js';\nimport type Selection from '../core/selection.js';\n\nconst ALIGNS = [false, 'center', 'right', 'justify'];\n\nconst COLORS = [\n '#000000',\n '#e60000',\n '#ff9900',\n '#ffff00',\n '#008a00',\n '#0066cc',\n '#9933ff',\n '#ffffff',\n '#facccc',\n '#ffebcc',\n '#ffffcc',\n '#cce8cc',\n '#cce0f5',\n '#ebd6ff',\n '#bbbbbb',\n '#f06666',\n '#ffc266',\n '#ffff66',\n '#66b966',\n '#66a3e0',\n '#c285ff',\n '#888888',\n '#a10000',\n '#b26b00',\n '#b2b200',\n '#006100',\n '#0047b2',\n '#6b24b2',\n '#444444',\n '#5c0000',\n '#663d00',\n '#666600',\n '#003700',\n '#002966',\n '#3d1466',\n];\n\nconst FONTS = [false, 'serif', 'monospace'];\n\nconst HEADERS = ['1', '2', '3', false];\n\nconst SIZES = ['small', false, 'large', 'huge'];\n\nclass BaseTheme extends Theme {\n pickers: Picker[];\n tooltip?: Tooltip;\n\n constructor(quill: Quill, options: ThemeOptions) {\n super(quill, options);\n const listener = (e: MouseEvent) => {\n if (!document.body.contains(quill.root)) {\n document.body.removeEventListener('click', listener);\n return;\n }\n if (\n this.tooltip != null &&\n // @ts-expect-error\n !this.tooltip.root.contains(e.target) &&\n // @ts-expect-error\n document.activeElement !== this.tooltip.textbox &&\n !this.quill.hasFocus()\n ) {\n this.tooltip.hide();\n }\n if (this.pickers != null) {\n this.pickers.forEach((picker) => {\n // @ts-expect-error\n if (!picker.container.contains(e.target)) {\n picker.close();\n }\n });\n }\n };\n quill.emitter.listenDOM('click', document.body, listener);\n }\n\n addModule(name: 'clipboard'): Clipboard;\n addModule(name: 'keyboard'): Keyboard;\n addModule(name: 'uploader'): Uploader;\n addModule(name: 'history'): History;\n addModule(name: 'selection'): Selection;\n addModule(name: string): unknown;\n addModule(name: string) {\n const module = super.addModule(name);\n if (name === 'toolbar') {\n // @ts-expect-error\n this.extendToolbar(module);\n }\n return module;\n }\n\n buildButtons(\n buttons: NodeListOf,\n icons: Record | string>,\n ) {\n Array.from(buttons).forEach((button) => {\n const className = button.getAttribute('class') || '';\n className.split(/\\s+/).forEach((name) => {\n if (!name.startsWith('ql-')) return;\n name = name.slice('ql-'.length);\n if (icons[name] == null) return;\n if (name === 'direction') {\n // @ts-expect-error\n button.innerHTML = icons[name][''] + icons[name].rtl;\n } else if (typeof icons[name] === 'string') {\n // @ts-expect-error\n button.innerHTML = icons[name];\n } else {\n // @ts-expect-error\n const value = button.value || '';\n // @ts-expect-error\n if (value != null && icons[name][value]) {\n // @ts-expect-error\n button.innerHTML = icons[name][value];\n }\n }\n });\n });\n }\n\n buildPickers(\n selects: NodeListOf,\n icons: Record>,\n ) {\n this.pickers = Array.from(selects).map((select) => {\n if (select.classList.contains('ql-align')) {\n if (select.querySelector('option') == null) {\n fillSelect(select, ALIGNS);\n }\n if (typeof icons.align === 'object') {\n return new IconPicker(select, icons.align);\n }\n }\n if (\n select.classList.contains('ql-background') ||\n select.classList.contains('ql-color')\n ) {\n const format = select.classList.contains('ql-background')\n ? 'background'\n : 'color';\n if (select.querySelector('option') == null) {\n fillSelect(\n select,\n COLORS,\n format === 'background' ? '#ffffff' : '#000000',\n );\n }\n return new ColorPicker(select, icons[format] as string);\n }\n if (select.querySelector('option') == null) {\n if (select.classList.contains('ql-font')) {\n fillSelect(select, FONTS);\n } else if (select.classList.contains('ql-header')) {\n fillSelect(select, HEADERS);\n } else if (select.classList.contains('ql-size')) {\n fillSelect(select, SIZES);\n }\n }\n return new Picker(select);\n });\n const update = () => {\n this.pickers.forEach((picker) => {\n picker.update();\n });\n };\n this.quill.on(Emitter.events.EDITOR_CHANGE, update);\n }\n}\nBaseTheme.DEFAULTS = merge({}, Theme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n formula() {\n this.quill.theme.tooltip.edit('formula');\n },\n image() {\n let fileInput = this.container.querySelector(\n 'input.ql-image[type=file]',\n );\n if (fileInput == null) {\n fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute(\n 'accept',\n this.quill.uploader.options.mimetypes.join(', '),\n );\n fileInput.classList.add('ql-image');\n fileInput.addEventListener('change', () => {\n const range = this.quill.getSelection(true);\n this.quill.uploader.upload(range, fileInput.files);\n fileInput.value = '';\n });\n this.container.appendChild(fileInput);\n }\n fileInput.click();\n },\n video() {\n this.quill.theme.tooltip.edit('video');\n },\n },\n },\n },\n});\n\nclass BaseTooltip extends Tooltip {\n textbox: HTMLInputElement | null;\n linkRange?: Range;\n\n constructor(quill: Quill, boundsContainer?: HTMLElement) {\n super(quill, boundsContainer);\n this.textbox = this.root.querySelector('input[type=\"text\"]');\n this.listen();\n }\n\n listen() {\n // @ts-expect-error Fix me later\n this.textbox.addEventListener('keydown', (event) => {\n if (event.key === 'Enter') {\n this.save();\n event.preventDefault();\n } else if (event.key === 'Escape') {\n this.cancel();\n event.preventDefault();\n }\n });\n }\n\n cancel() {\n this.hide();\n this.restoreFocus();\n }\n\n edit(mode = 'link', preview: string | null = null) {\n this.root.classList.remove('ql-hidden');\n this.root.classList.add('ql-editing');\n if (this.textbox == null) return;\n\n if (preview != null) {\n this.textbox.value = preview;\n } else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = '';\n }\n const bounds = this.quill.getBounds(this.quill.selection.savedRange);\n if (bounds != null) {\n this.position(bounds);\n }\n this.textbox.select();\n this.textbox.setAttribute(\n 'placeholder',\n this.textbox.getAttribute(`data-${mode}`) || '',\n );\n this.root.setAttribute('data-mode', mode);\n }\n\n restoreFocus() {\n this.quill.focus({ preventScroll: true });\n }\n\n save() {\n // @ts-expect-error Fix me later\n let { value } = this.textbox;\n switch (this.root.getAttribute('data-mode')) {\n case 'link': {\n const { scrollTop } = this.quill.root;\n if (this.linkRange) {\n this.quill.formatText(\n this.linkRange,\n 'link',\n value,\n Emitter.sources.USER,\n );\n delete this.linkRange;\n } else {\n this.restoreFocus();\n this.quill.format('link', value, Emitter.sources.USER);\n }\n this.quill.root.scrollTop = scrollTop;\n break;\n }\n case 'video': {\n value = extractVideoUrl(value);\n } // eslint-disable-next-line no-fallthrough\n case 'formula': {\n if (!value) break;\n const range = this.quill.getSelection(true);\n if (range != null) {\n const index = range.index + range.length;\n this.quill.insertEmbed(\n index,\n // @ts-expect-error Fix me later\n this.root.getAttribute('data-mode'),\n value,\n Emitter.sources.USER,\n );\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', Emitter.sources.USER);\n }\n this.quill.setSelection(index + 2, Emitter.sources.USER);\n }\n break;\n }\n default:\n }\n // @ts-expect-error Fix me later\n this.textbox.value = '';\n this.hide();\n }\n}\n\nfunction extractVideoUrl(url: string) {\n let match =\n url.match(\n /^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/,\n ) ||\n url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n if (match) {\n return `${match[1] || 'https'}://www.youtube.com/embed/${\n match[2]\n }?showinfo=0`;\n }\n // eslint-disable-next-line no-cond-assign\n if ((match = url.match(/^(?:(https?):\\/\\/)?(?:www\\.)?vimeo\\.com\\/(\\d+)/))) {\n return `${match[1] || 'https'}://player.vimeo.com/video/${match[2]}/`;\n }\n return url;\n}\n\nfunction fillSelect(\n select: HTMLSelectElement,\n values: Array,\n defaultValue: unknown = false,\n) {\n values.forEach((value) => {\n const option = document.createElement('option');\n if (value === defaultValue) {\n option.setAttribute('selected', 'selected');\n } else {\n option.setAttribute('value', String(value));\n }\n select.appendChild(option);\n });\n}\n\nexport { BaseTooltip, BaseTheme as default };\n", "import { merge } from 'lodash-es';\nimport Emitter from '../core/emitter.js';\nimport BaseTheme, { BaseTooltip } from './base.js';\nimport { Range } from '../core/selection.js';\nimport type { Bounds } from '../core/selection.js';\nimport icons from '../ui/icons.js';\nimport Quill from '../core/quill.js';\nimport type { ThemeOptions } from '../core/theme.js';\nimport type Toolbar from '../modules/toolbar.js';\nimport type { ToolbarConfig } from '../modules/toolbar.js';\n\nconst TOOLBAR_CONFIG: ToolbarConfig = [\n ['bold', 'italic', 'link'],\n [{ header: 1 }, { header: 2 }, 'blockquote'],\n];\n\nclass BubbleTooltip extends BaseTooltip {\n static TEMPLATE = [\n '',\n '
    ',\n '',\n '',\n '
    ',\n ].join('');\n\n constructor(quill: Quill, bounds?: HTMLElement) {\n super(quill, bounds);\n this.quill.on(\n Emitter.events.EDITOR_CHANGE,\n (type, range, oldRange, source) => {\n if (type !== Emitter.events.SELECTION_CHANGE) return;\n if (\n range != null &&\n range.length > 0 &&\n source === Emitter.sources.USER\n ) {\n this.show();\n // Lock our width so we will expand beyond our offsetParent boundaries\n this.root.style.left = '0px';\n this.root.style.width = '';\n this.root.style.width = `${this.root.offsetWidth}px`;\n const lines = this.quill.getLines(range.index, range.length);\n if (lines.length === 1) {\n const bounds = this.quill.getBounds(range);\n if (bounds != null) {\n this.position(bounds);\n }\n } else {\n const lastLine = lines[lines.length - 1];\n const index = this.quill.getIndex(lastLine);\n const length = Math.min(\n lastLine.length() - 1,\n range.index + range.length - index,\n );\n const indexBounds = this.quill.getBounds(new Range(index, length));\n if (indexBounds != null) {\n this.position(indexBounds);\n }\n }\n } else if (\n document.activeElement !== this.textbox &&\n this.quill.hasFocus()\n ) {\n this.hide();\n }\n },\n );\n }\n\n listen() {\n super.listen();\n // @ts-expect-error Fix me later\n this.root.querySelector('.ql-close').addEventListener('click', () => {\n this.root.classList.remove('ql-editing');\n });\n this.quill.on(Emitter.events.SCROLL_OPTIMIZE, () => {\n // Let selection be restored by toolbar handlers before repositioning\n setTimeout(() => {\n if (this.root.classList.contains('ql-hidden')) return;\n const range = this.quill.getSelection();\n if (range != null) {\n const bounds = this.quill.getBounds(range);\n if (bounds != null) {\n this.position(bounds);\n }\n }\n }, 1);\n });\n }\n\n cancel() {\n this.show();\n }\n\n position(reference: Bounds) {\n const shift = super.position(reference);\n const arrow = this.root.querySelector('.ql-tooltip-arrow');\n // @ts-expect-error\n arrow.style.marginLeft = '';\n if (shift !== 0) {\n // @ts-expect-error\n arrow.style.marginLeft = `${-1 * shift - arrow.offsetWidth / 2}px`;\n }\n return shift;\n }\n}\n\nclass BubbleTheme extends BaseTheme {\n tooltip: BubbleTooltip;\n\n constructor(quill: Quill, options: ThemeOptions) {\n if (\n options.modules.toolbar != null &&\n options.modules.toolbar.container == null\n ) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-bubble');\n }\n\n extendToolbar(toolbar: Toolbar) {\n // @ts-expect-error\n this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n if (toolbar.container != null) {\n this.tooltip.root.appendChild(toolbar.container);\n this.buildButtons(toolbar.container.querySelectorAll('button'), icons);\n this.buildPickers(toolbar.container.querySelectorAll('select'), icons);\n }\n }\n}\nBubbleTheme.DEFAULTS = merge({}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link(value: string) {\n if (!value) {\n this.quill.format('link', false, Quill.sources.USER);\n } else {\n // @ts-expect-error\n this.quill.theme.tooltip.edit();\n }\n },\n },\n },\n },\n} satisfies ThemeOptions);\n\nexport { BubbleTooltip, BubbleTheme as default };\n", "import { merge } from 'lodash-es';\nimport Emitter from '../core/emitter.js';\nimport BaseTheme, { BaseTooltip } from './base.js';\nimport LinkBlot from '../formats/link.js';\nimport { Range } from '../core/selection.js';\nimport icons from '../ui/icons.js';\nimport Quill from '../core/quill.js';\nimport type { Context } from '../modules/keyboard.js';\nimport type Toolbar from '../modules/toolbar.js';\nimport type { ToolbarConfig } from '../modules/toolbar.js';\nimport type { ThemeOptions } from '../core/theme.js';\n\nconst TOOLBAR_CONFIG: ToolbarConfig = [\n [{ header: ['1', '2', '3', false] }],\n ['bold', 'italic', 'underline', 'link'],\n [{ list: 'ordered' }, { list: 'bullet' }],\n ['clean'],\n];\n\nclass SnowTooltip extends BaseTooltip {\n static TEMPLATE = [\n '',\n '',\n '',\n '',\n ].join('');\n\n preview = this.root.querySelector('a.ql-preview');\n\n listen() {\n super.listen();\n // @ts-expect-error Fix me later\n this.root\n .querySelector('a.ql-action')\n .addEventListener('click', (event) => {\n if (this.root.classList.contains('ql-editing')) {\n this.save();\n } else {\n // @ts-expect-error Fix me later\n this.edit('link', this.preview.textContent);\n }\n event.preventDefault();\n });\n // @ts-expect-error Fix me later\n this.root\n .querySelector('a.ql-remove')\n .addEventListener('click', (event) => {\n if (this.linkRange != null) {\n const range = this.linkRange;\n this.restoreFocus();\n this.quill.formatText(range, 'link', false, Emitter.sources.USER);\n delete this.linkRange;\n }\n event.preventDefault();\n this.hide();\n });\n this.quill.on(\n Emitter.events.SELECTION_CHANGE,\n (range, oldRange, source) => {\n if (range == null) return;\n if (range.length === 0 && source === Emitter.sources.USER) {\n const [link, offset] = this.quill.scroll.descendant(\n LinkBlot,\n range.index,\n );\n if (link != null) {\n this.linkRange = new Range(range.index - offset, link.length());\n const preview = LinkBlot.formats(link.domNode);\n // @ts-expect-error Fix me later\n this.preview.textContent = preview;\n // @ts-expect-error Fix me later\n this.preview.setAttribute('href', preview);\n this.show();\n const bounds = this.quill.getBounds(this.linkRange);\n if (bounds != null) {\n this.position(bounds);\n }\n return;\n }\n } else {\n delete this.linkRange;\n }\n this.hide();\n },\n );\n }\n\n show() {\n super.show();\n this.root.removeAttribute('data-mode');\n }\n}\n\nclass SnowTheme extends BaseTheme {\n constructor(quill: Quill, options: ThemeOptions) {\n if (\n options.modules.toolbar != null &&\n options.modules.toolbar.container == null\n ) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-snow');\n }\n\n extendToolbar(toolbar: Toolbar) {\n if (toolbar.container != null) {\n toolbar.container.classList.add('ql-snow');\n this.buildButtons(toolbar.container.querySelectorAll('button'), icons);\n this.buildPickers(toolbar.container.querySelectorAll('select'), icons);\n // @ts-expect-error\n this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n if (toolbar.container.querySelector('.ql-link')) {\n this.quill.keyboard.addBinding(\n { key: 'k', shortKey: true },\n (_range: Range, context: Context) => {\n toolbar.handlers.link.call(toolbar, !context.format.link);\n },\n );\n }\n }\n }\n}\nSnowTheme.DEFAULTS = merge({}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link(value: string) {\n if (value) {\n const range = this.quill.getSelection();\n if (range == null || range.length === 0) return;\n let preview = this.quill.getText(range);\n if (\n /^\\S+@\\S+\\.\\S+$/.test(preview) &&\n preview.indexOf('mailto:') !== 0\n ) {\n preview = `mailto:${preview}`;\n }\n // @ts-expect-error\n const { tooltip } = this.quill.theme;\n tooltip.edit('link', preview);\n } else {\n this.quill.format('link', false, Quill.sources.USER);\n }\n },\n },\n },\n },\n} satisfies ThemeOptions);\n\nexport default SnowTheme;\n", "import Quill, { Parchment, Range } from './core.js';\nimport type {\n Bounds,\n DebugLevel,\n EmitterSource,\n ExpandedQuillOptions,\n QuillOptions,\n} from './core.js';\n\nimport { AlignClass, AlignStyle } from './formats/align.js';\nimport {\n DirectionAttribute,\n DirectionClass,\n DirectionStyle,\n} from './formats/direction.js';\nimport Indent from './formats/indent.js';\n\nimport Blockquote from './formats/blockquote.js';\nimport Header from './formats/header.js';\nimport List from './formats/list.js';\n\nimport { BackgroundClass, BackgroundStyle } from './formats/background.js';\nimport { ColorClass, ColorStyle } from './formats/color.js';\nimport { FontClass, FontStyle } from './formats/font.js';\nimport { SizeClass, SizeStyle } from './formats/size.js';\n\nimport Bold from './formats/bold.js';\nimport Italic from './formats/italic.js';\nimport Link from './formats/link.js';\nimport Script from './formats/script.js';\nimport Strike from './formats/strike.js';\nimport Underline from './formats/underline.js';\n\nimport Formula from './formats/formula.js';\nimport Image from './formats/image.js';\nimport Video from './formats/video.js';\n\nimport CodeBlock, { Code as InlineCode } from './formats/code.js';\n\nimport Syntax from './modules/syntax.js';\nimport Table from './modules/table.js';\nimport Toolbar from './modules/toolbar.js';\n\nimport Icons from './ui/icons.js';\nimport Picker from './ui/picker.js';\nimport ColorPicker from './ui/color-picker.js';\nimport IconPicker from './ui/icon-picker.js';\nimport Tooltip from './ui/tooltip.js';\n\nimport BubbleTheme from './themes/bubble.js';\nimport SnowTheme from './themes/snow.js';\n\nQuill.register(\n {\n 'attributors/attribute/direction': DirectionAttribute,\n\n 'attributors/class/align': AlignClass,\n 'attributors/class/background': BackgroundClass,\n 'attributors/class/color': ColorClass,\n 'attributors/class/direction': DirectionClass,\n 'attributors/class/font': FontClass,\n 'attributors/class/size': SizeClass,\n\n 'attributors/style/align': AlignStyle,\n 'attributors/style/background': BackgroundStyle,\n 'attributors/style/color': ColorStyle,\n 'attributors/style/direction': DirectionStyle,\n 'attributors/style/font': FontStyle,\n 'attributors/style/size': SizeStyle,\n },\n true,\n);\n\nQuill.register(\n {\n 'formats/align': AlignClass,\n 'formats/direction': DirectionClass,\n 'formats/indent': Indent,\n\n 'formats/background': BackgroundStyle,\n 'formats/color': ColorStyle,\n 'formats/font': FontClass,\n 'formats/size': SizeClass,\n\n 'formats/blockquote': Blockquote,\n 'formats/code-block': CodeBlock,\n 'formats/header': Header,\n 'formats/list': List,\n\n 'formats/bold': Bold,\n 'formats/code': InlineCode,\n 'formats/italic': Italic,\n 'formats/link': Link,\n 'formats/script': Script,\n 'formats/strike': Strike,\n 'formats/underline': Underline,\n\n 'formats/formula': Formula,\n 'formats/image': Image,\n 'formats/video': Video,\n\n 'modules/syntax': Syntax,\n 'modules/table': Table,\n 'modules/toolbar': Toolbar,\n\n 'themes/bubble': BubbleTheme,\n 'themes/snow': SnowTheme,\n\n 'ui/icons': Icons,\n 'ui/picker': Picker,\n 'ui/icon-picker': IconPicker,\n 'ui/color-picker': ColorPicker,\n 'ui/tooltip': Tooltip,\n },\n true,\n);\n\nexport { Module } from './core.js';\nexport type {\n Bounds,\n DebugLevel,\n EmitterSource,\n ExpandedQuillOptions,\n QuillOptions,\n};\nexport { Parchment, Range };\n\nexport default Quill;\n", "/*! For license information please see quill-cursors.js.LICENSE.txt */\n!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.QuillCursors=e():t.QuillCursors=e()}(self,(()=>(()=>{var t={582:(t,e,r)=>{\"use strict\";r.d(e,{Z:()=>s});var n=r(81),i=r.n(n),o=r(645),a=r.n(o)()(i());a.push([t.id,\".ql-container{position:relative;overflow:hidden}@media(pointer: coarse){.ql-cursor-caret-container{z-index:-1}}.ql-cursor.hidden{display:none}.ql-cursor .ql-cursor-caret-container,.ql-cursor .ql-cursor-flag{position:absolute}.ql-cursor .ql-cursor-flag{z-index:1;transform:translate3d(-1px, -100%, 0);opacity:0;visibility:hidden;color:#fff;padding-bottom:2px;border-radius:0 3px 3px 0}.ql-cursor .ql-cursor-flag.flag-flipped{border-radius:3px 0 0 3px;transform:translate3d(calc(-100% + 1px ), -100%, 0)}@media screen{.ql-cursor .ql-cursor-flag{transition:opacity 0ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 0ms,visibility 0ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 0ms}}.ql-cursor .ql-cursor-flag .ql-cursor-name{margin-left:5px;margin-right:5px;display:inline-block;margin-top:-2px;white-space:nowrap}.ql-cursor .ql-cursor-flag.no-delay[style]{transition-delay:unset !important}.ql-cursor .ql-cursor-caret-container{cursor:text;margin-left:-9px;padding:0 9px}.ql-cursor .ql-cursor-caret-container.hover+.ql-cursor-flag{opacity:1;visibility:visible;transition:none}.ql-cursor .ql-cursor-caret-container.no-pointer{pointer-events:none}.ql-cursor .ql-cursor-caret-container .ql-cursor-caret{position:absolute;top:0;bottom:0;width:2px;margin-left:-1px;background-color:attr(data-color)}.ql-cursor .ql-cursor-selection-block{position:absolute;pointer-events:none}\",\"\"]);const s=a},645:t=>{\"use strict\";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=\"\",n=void 0!==e[5];return e[4]&&(r+=\"@supports (\".concat(e[4],\") {\")),e[2]&&(r+=\"@media \".concat(e[2],\" {\")),n&&(r+=\"@layer\".concat(e[5].length>0?\" \".concat(e[5]):\"\",\" {\")),r+=t(e),n&&(r+=\"}\"),e[2]&&(r+=\"}\"),e[4]&&(r+=\"}\"),r})).join(\"\")},e.i=function(t,r,n,i,o){\"string\"==typeof t&&(t=[[null,t,void 0]]);var a={};if(n)for(var s=0;s0?\" \".concat(l[5]):\"\",\" {\").concat(l[1],\"}\")),l[5]=o),r&&(l[2]?(l[1]=\"@media \".concat(l[2],\" {\").concat(l[1],\"}\"),l[2]=r):l[2]=r),i&&(l[4]?(l[1]=\"@supports (\".concat(l[4],\") {\").concat(l[1],\"}\"),l[4]=i):l[4]=\"\".concat(i)),e.push(l))}},e}},81:t=>{\"use strict\";t.exports=function(t){return t[1]}},529:t=>{var e=-1;function r(t,s,u,c){if(t===s)return t?[[0,t]]:[];if(null!=u){var l=function(t,e,r){var n=\"number\"==typeof r?{index:r,length:0}:r.oldRange,i=\"number\"==typeof r?null:r.newRange,o=t.length,a=e.length;if(0===n.length&&(null===i||0===i.length)){var s=n.index,u=t.slice(0,s),c=t.slice(s),l=i?i.index:null,h=s+a-o;if((null===l||l===h)&&!(h<0||h>a)){var d=e.slice(0,h);if((_=e.slice(h))===c){var p=Math.min(s,h);if((b=u.slice(0,p))===(m=d.slice(0,p)))return f(b,u.slice(p),d.slice(p),c)}}if(null===l||l===s){var g=s,_=(d=e.slice(0,g),e.slice(g));if(d===u){var v=Math.min(o-g,a-g);if((y=c.slice(c.length-v))===(A=_.slice(_.length-v)))return f(u,c.slice(0,c.length-v),_.slice(0,_.length-v),y)}}}if(n.length>0&&i&&0===i.length){var b=t.slice(0,n.index),y=t.slice(n.index+n.length);if(!(a<(p=b.length)+(v=y.length))){var m=e.slice(0,p),A=e.slice(a-v);if(b===m&&y===A)return f(b,t.slice(p,o-v),e.slice(p,a-v),y)}}return null}(t,s,u);if(l)return l}var h=i(t,s),d=t.substring(0,h);h=o(t=t.substring(h),s=s.substring(h));var p=t.substring(t.length-h),g=function(t,a){var s;if(!t)return[[1,a]];if(!a)return[[e,t]];var u=t.length>a.length?t:a,c=t.length>a.length?a:t,l=u.indexOf(c);if(-1!==l)return s=[[1,u.substring(0,l)],[0,c],[1,u.substring(l+c.length)]],t.length>a.length&&(s[0][0]=s[2][0]=e),s;if(1===c.length)return[[e,t],[1,a]];var f=function(t,e){var r=t.length>e.length?t:e,n=t.length>e.length?e:t;if(r.length<4||2*n.length=t.length?[n,a,s,u,f]:null}var s,u,c,l,f,h=a(r,n,Math.ceil(r.length/4)),d=a(r,n,Math.ceil(r.length/2));return h||d?(s=d?h&&h[4].length>d[4].length?h:d:h,t.length>e.length?(u=s[0],c=s[1],l=s[2],f=s[3]):(l=s[0],f=s[1],u=s[2],c=s[3]),[u,c,l,f,s[4]]):null}(t,a);if(f){var h=f[0],d=f[1],p=f[2],g=f[3],_=f[4],v=r(h,p),b=r(d,g);return v.concat([[0,_]],b)}return function(t,r){for(var i=t.length,o=r.length,a=Math.ceil((i+o)/2),s=a,u=2*a,c=new Array(u),l=new Array(u),f=0;fi)g+=2;else if(A>o)p+=2;else if(d&&(w=s+h-y)>=0&&w=(C=i-l[w]))return n(t,r,S,A)}for(var x=-b+_;x<=b-v;x+=2){for(var C,w=s+x,E=(C=x===-b||x!==b&&l[w-1]i)v+=2;else if(E>o)_+=2;else if(!d){var S;if((m=s+h-x)>=0&&m=(C=i-C))return n(t,r,S,A)}}}return[[e,t],[1,r]]}(t,a)}(t=t.substring(0,t.length-h),s=s.substring(0,s.length-h));return d&&g.unshift([0,d]),p&&g.push([0,p]),a(g,c),g}function n(t,e,n,i){var o=t.substring(0,n),a=e.substring(0,i),s=t.substring(n),u=e.substring(i),c=r(o,a),l=r(s,u);return c.concat(l)}function i(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var r=0,n=Math.min(t.length,e.length),i=n,o=0;r=0&&l(t[p][1])){var g=t[p][1].slice(-1);if(t[p][1]=t[p][1].slice(0,-1),h=g+h,d=g+d,!t[p][1]){t.splice(p,1),s--;var _=p-1;t[_]&&1===t[_][0]&&(f++,d=t[_][1]+d,_--),t[_]&&t[_][0]===e&&(u++,h=t[_][1]+h,_--),p=_}}c(t[s][1])&&(g=t[s][1].charAt(0),t[s][1]=t[s][1].slice(1),h+=g,d+=g)}if(s0||d.length>0){h.length>0&&d.length>0&&(0!==(n=i(d,h))&&(p>=0?t[p][1]+=d.substring(0,n):(t.splice(0,0,[0,d.substring(0,n)]),s++),d=d.substring(n),h=h.substring(n)),0!==(n=o(d,h))&&(t[s][1]=d.substring(d.length-n)+t[s][1],d=d.substring(0,d.length-n),h=h.substring(0,h.length-n)));var v=f+u;0===h.length&&0===d.length?(t.splice(s-v,v),s-=v):0===h.length?(t.splice(s-v,v,[1,d]),s=s-v+1):0===d.length?(t.splice(s-v,v,[e,h]),s=s-v+1):(t.splice(s-v,v,[e,h],[1,d]),s=s-v+2)}0!==s&&0===t[s-1][0]?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,f=0,u=0,h=\"\",d=\"\"}\"\"===t[t.length-1][1]&&t.pop();var b=!1;for(s=1;s=55296&&t<=56319}function u(t){return t>=56320&&t<=57343}function c(t){return u(t.charCodeAt(0))}function l(t){return s(t.charCodeAt(t.length-1))}function f(t,r,n,i){return l(t)||c(i)?null:function(t){for(var e=[],r=0;r0&&e.push(t[r]);return e}([[0,t],[e,r],[1,n],[0,i]])}function h(t,e,n){return r(t,e,n,!0)}h.INSERT=1,h.DELETE=e,h.EQUAL=0,t.exports=h},465:(t,e,r)=>{t=r.nmd(t);var n=\"__lodash_hash_undefined__\",i=9007199254740991,o=\"[object Arguments]\",a=\"[object Boolean]\",s=\"[object Date]\",u=\"[object Function]\",c=\"[object GeneratorFunction]\",l=\"[object Map]\",f=\"[object Number]\",h=\"[object Object]\",d=\"[object Promise]\",p=\"[object RegExp]\",g=\"[object Set]\",_=\"[object String]\",v=\"[object Symbol]\",b=\"[object WeakMap]\",y=\"[object ArrayBuffer]\",m=\"[object DataView]\",A=\"[object Float32Array]\",x=\"[object Float64Array]\",C=\"[object Int8Array]\",w=\"[object Int16Array]\",E=\"[object Int32Array]\",S=\"[object Uint8Array]\",M=\"[object Uint8ClampedArray]\",O=\"[object Uint16Array]\",j=\"[object Uint32Array]\",L=/\\w*$/,k=/^\\[object .+?Constructor\\]$/,T=/^(?:0|[1-9]\\d*)$/,R={};R[o]=R[\"[object Array]\"]=R[y]=R[m]=R[a]=R[s]=R[A]=R[x]=R[C]=R[w]=R[E]=R[l]=R[f]=R[h]=R[p]=R[g]=R[_]=R[v]=R[S]=R[M]=R[O]=R[j]=!0,R[\"[object Error]\"]=R[u]=R[b]=!1;var N=\"object\"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,q=\"object\"==typeof self&&self&&self.Object===Object&&self,D=N||q||Function(\"return this\")(),F=e&&!e.nodeType&&e,I=F&&t&&!t.nodeType&&t,P=I&&I.exports===F;function B(t,e){return t.set(e[0],e[1]),t}function z(t,e){return t.add(e),t}function H(t,e,r,n){var i=-1,o=t?t.length:0;for(n&&o&&(r=t[++i]);++i-1},Mt.prototype.set=function(t,e){var r=this.__data__,n=kt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Ot.prototype.clear=function(){this.__data__={hash:new St,map:new(pt||Mt),string:new St}},Ot.prototype.delete=function(t){return qt(this,t).delete(t)},Ot.prototype.get=function(t){return qt(this,t).get(t)},Ot.prototype.has=function(t){return qt(this,t).has(t)},Ot.prototype.set=function(t,e){return qt(this,t).set(t,e),this},jt.prototype.clear=function(){this.__data__=new Mt},jt.prototype.delete=function(t){return this.__data__.delete(t)},jt.prototype.get=function(t){return this.__data__.get(t)},jt.prototype.has=function(t){return this.__data__.has(t)},jt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Mt){var n=r.__data__;if(!pt||n.length<199)return n.push([t,e]),this;r=this.__data__=new Ot(n)}return r.set(t,e),this};var Ft=lt?$(lt,Object):function(){return[]},It=function(t){return et.call(t)};function Pt(t,e){return!!(e=null==e?i:e)&&(\"number\"==typeof t||T.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=i}(t.length)&&!Vt(t)}var $t=ft||function(){return!1};function Vt(t){var e=Wt(t)?et.call(t):\"\";return e==u||e==c}function Wt(t){var e=typeof t;return!!t&&(\"object\"==e||\"function\"==e)}function Xt(t){return Gt(t)?function(t,e){var r=Ut(t)||function(t){return function(t){return function(t){return!!t&&\"object\"==typeof t}(t)&&Gt(t)}(t)&&tt.call(t,\"callee\")&&(!ut.call(t,\"callee\")||et.call(t)==o)}(t)?function(t,e){for(var r=-1,n=Array(t);++r{t=r.nmd(t);var n=\"__lodash_hash_undefined__\",i=9007199254740991,o=\"[object Arguments]\",a=\"[object Array]\",s=\"[object Boolean]\",u=\"[object Date]\",c=\"[object Error]\",l=\"[object Function]\",f=\"[object Map]\",h=\"[object Number]\",d=\"[object Object]\",p=\"[object Promise]\",g=\"[object RegExp]\",_=\"[object Set]\",v=\"[object String]\",b=\"[object WeakMap]\",y=\"[object ArrayBuffer]\",m=\"[object DataView]\",A=/^\\[object .+?Constructor\\]$/,x=/^(?:0|[1-9]\\d*)$/,C={};C[\"[object Float32Array]\"]=C[\"[object Float64Array]\"]=C[\"[object Int8Array]\"]=C[\"[object Int16Array]\"]=C[\"[object Int32Array]\"]=C[\"[object Uint8Array]\"]=C[\"[object Uint8ClampedArray]\"]=C[\"[object Uint16Array]\"]=C[\"[object Uint32Array]\"]=!0,C[o]=C[a]=C[y]=C[s]=C[m]=C[u]=C[c]=C[l]=C[f]=C[h]=C[d]=C[g]=C[_]=C[v]=C[b]=!1;var w=\"object\"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,E=\"object\"==typeof self&&self&&self.Object===Object&&self,S=w||E||Function(\"return this\")(),M=e&&!e.nodeType&&e,O=M&&t&&!t.nodeType&&t,j=O&&O.exports===M,L=j&&w.process,k=function(){try{return L&&L.binding&&L.binding(\"util\")}catch(t){}}(),T=k&&k.isTypedArray;function R(t,e){for(var r=-1,n=null==t?0:t.length;++rs))return!1;var c=o.get(t);if(c&&o.get(e))return c==e;var l=-1,f=!0,h=2&r?new yt:void 0;for(o.set(t,e),o.set(e,t);++l-1},vt.prototype.set=function(t,e){var r=this.__data__,n=At(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},bt.prototype.clear=function(){this.size=0,this.__data__={hash:new _t,map:new(it||vt),string:new _t}},bt.prototype.delete=function(t){var e=Mt(this,t).delete(t);return this.size-=e?1:0,e},bt.prototype.get=function(t){return Mt(this,t).get(t)},bt.prototype.has=function(t){return Mt(this,t).has(t)},bt.prototype.set=function(t,e){var r=Mt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},yt.prototype.add=yt.prototype.push=function(t){return this.__data__.set(t,n),this},yt.prototype.has=function(t){return this.__data__.has(t)},mt.prototype.clear=function(){this.__data__=new vt,this.size=0},mt.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},mt.prototype.get=function(t){return this.__data__.get(t)},mt.prototype.has=function(t){return this.__data__.has(t)},mt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof vt){var n=r.__data__;if(!it||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new bt(n)}return r.set(t,e),this.size=r.size,this};var jt=tt?function(t){return null==t?[]:(t=Object(t),function(e,r){for(var n=-1,i=null==e?0:e.length,o=0,a=[];++n-1&&t%1==0&&t-1&&t%1==0&&t<=i}function Pt(t){var e=typeof t;return null!=t&&(\"object\"==e||\"function\"==e)}function Bt(t){return null!=t&&\"object\"==typeof t}var zt=T?function(t){return function(e){return t(e)}}(T):function(t){return Bt(t)&&It(t.length)&&!!C[xt(t)]};function Ht(t){return null!=(e=t)&&It(e.length)&&!Ft(e)?function(t,e){var r=qt(t),n=!r&&Nt(t),i=!r&&!n&&Dt(t),o=!r&&!n&&!i&&zt(t),a=r||n||i||o,s=a?function(t,e){for(var r=-1,n=Array(t);++r0?n:void 0},t.diff=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),\"object\"!=typeof t&&(t={}),\"object\"!=typeof e&&(e={});var r=Object.keys(t).concat(Object.keys(e)).reduce((function(r,n){return a.default(t[n],e[n])||(r[n]=void 0===e[n]?null:e[n]),r}),{});return Object.keys(r).length>0?r:void 0},t.invert=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),t=t||{};var r=Object.keys(e).reduce((function(r,n){return e[n]!==t[n]&&void 0!==t[n]&&(r[n]=e[n]),r}),{});return Object.keys(t).reduce((function(r,n){return t[n]!==e[n]&&void 0===e[n]&&(r[n]=null),r}),r)},t.transform=function(t,e,r){if(void 0===r&&(r=!1),\"object\"!=typeof t)return e;if(\"object\"==typeof e){if(!r)return e;var n=Object.keys(e).reduce((function(r,n){return void 0===t[n]&&(r[n]=e[n]),r}),{});return Object.keys(n).length>0?n:void 0}}}(i||(i={})),e.default=i},895:function(t,e,r){\"use strict\";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=n(r(529)),o=n(r(465)),a=n(r(307)),s=n(r(210)),u=n(r(430)),c=String.fromCharCode(0),l=function(){function t(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]}return t.prototype.insert=function(t,e){var r={};return\"string\"==typeof t&&0===t.length?this:(r.insert=t,null!=e&&\"object\"==typeof e&&Object.keys(e).length>0&&(r.attributes=e),this.push(r))},t.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},t.prototype.retain=function(t,e){if(t<=0)return this;var r={retain:t};return null!=e&&\"object\"==typeof e&&Object.keys(e).length>0&&(r.attributes=e),this.push(r)},t.prototype.push=function(t){var e=this.ops.length,r=this.ops[e-1];if(t=o.default(t),\"object\"==typeof r){if(\"number\"==typeof t.delete&&\"number\"==typeof r.delete)return this.ops[e-1]={delete:r.delete+t.delete},this;if(\"number\"==typeof r.delete&&null!=t.insert&&(e-=1,\"object\"!=typeof(r=this.ops[e-1])))return this.ops.unshift(t),this;if(a.default(t.attributes,r.attributes)){if(\"string\"==typeof t.insert&&\"string\"==typeof r.insert)return this.ops[e-1]={insert:r.insert+t.insert},\"object\"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if(\"number\"==typeof t.retain&&\"number\"==typeof r.retain)return this.ops[e-1]={retain:r.retain+t.retain},\"object\"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},t.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},t.prototype.filter=function(t){return this.ops.filter(t)},t.prototype.forEach=function(t){this.ops.forEach(t)},t.prototype.map=function(t){return this.ops.map(t)},t.prototype.partition=function(t){var e=[],r=[];return this.forEach((function(n){(t(n)?e:r).push(n)})),[e,r]},t.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},t.prototype.changeLength=function(){return this.reduce((function(t,e){return e.insert?t+u.default.length(e):e.delete?t-e.delete:t}),0)},t.prototype.length=function(){return this.reduce((function(t,e){return t+u.default.length(e)}),0)},t.prototype.slice=function(e,r){void 0===e&&(e=0),void 0===r&&(r=1/0);for(var n=[],i=u.default.iterator(this.ops),o=0;o0&&n.next(o.retain-c)}for(var l=new t(i);r.hasNext()||n.hasNext();)if(\"insert\"===n.peekType())l.push(n.next());else if(\"delete\"===r.peekType())l.push(r.next());else{var f=Math.min(r.peekLength(),n.peekLength()),h=r.next(f),d=n.next(f);if(\"number\"==typeof d.retain){var p={};\"number\"==typeof h.retain?p.retain=f:p.insert=h.insert;var g=s.default.compose(h.attributes,d.attributes,\"number\"==typeof h.retain);if(g&&(p.attributes=g),l.push(p),!n.hasNext()&&a.default(l.ops[l.ops.length-1],p)){var _=new t(r.rest());return l.concat(_).chop()}}else\"number\"==typeof d.delete&&\"number\"==typeof h.retain&&l.push(d)}return l.chop()},t.prototype.concat=function(e){var r=new t(this.ops.slice());return e.ops.length>0&&(r.push(e.ops[0]),r.ops=r.ops.concat(e.ops.slice(1))),r},t.prototype.diff=function(e,r){if(this.ops===e.ops)return new t;var n=[this,e].map((function(t){return t.map((function(r){if(null!=r.insert)return\"string\"==typeof r.insert?r.insert:c;throw new Error(\"diff() called \"+(t===e?\"on\":\"with\")+\" non-document\")})).join(\"\")})),o=new t,l=i.default(n[0],n[1],r),f=u.default.iterator(this.ops),h=u.default.iterator(e.ops);return l.forEach((function(t){for(var e=t[1].length;e>0;){var r=0;switch(t[0]){case i.default.INSERT:r=Math.min(h.peekLength(),e),o.push(h.next(r));break;case i.default.DELETE:r=Math.min(e,f.peekLength()),f.next(r),o.delete(r);break;case i.default.EQUAL:r=Math.min(f.peekLength(),h.peekLength(),e);var n=f.next(r),u=h.next(r);a.default(n.insert,u.insert)?o.retain(r,s.default.diff(n.attributes,u.attributes)):o.push(u).delete(r)}e-=r}})),o.chop()},t.prototype.eachLine=function(e,r){void 0===r&&(r=\"\\n\");for(var n=u.default.iterator(this.ops),i=new t,o=0;n.hasNext();){if(\"insert\"!==n.peekType())return;var a=n.peek(),s=u.default.length(a)-n.peekLength(),c=\"string\"==typeof a.insert?a.insert.indexOf(r,s)-s:-1;if(c<0)i.push(n.next());else if(c>0)i.push(n.next(c));else{if(!1===e(i,n.next(1).attributes||{},o))return;o+=1,i=new t}}i.length()>0&&e(i,{},o)},t.prototype.invert=function(e){var r=new t;return this.reduce((function(t,n){if(n.insert)r.delete(u.default.length(n));else{if(n.retain&&null==n.attributes)return r.retain(n.retain),t+n.retain;if(n.delete||n.retain&&n.attributes){var i=n.delete||n.retain;return e.slice(t,t+i).forEach((function(t){n.delete?r.push(t):n.retain&&n.attributes&&r.retain(u.default.length(t),s.default.invert(n.attributes,t.attributes))})),t+i}}return t}),0),r.chop()},t.prototype.transform=function(e,r){if(void 0===r&&(r=!1),r=!!r,\"number\"==typeof e)return this.transformPosition(e,r);for(var n=e,i=u.default.iterator(this.ops),o=u.default.iterator(n.ops),a=new t;i.hasNext()||o.hasNext();)if(\"insert\"!==i.peekType()||!r&&\"insert\"===o.peekType())if(\"insert\"===o.peekType())a.push(o.next());else{var c=Math.min(i.peekLength(),o.peekLength()),l=i.next(c),f=o.next(c);if(l.delete)continue;f.delete?a.push(f):a.retain(c,s.default.transform(l.attributes,f.attributes,r))}else a.retain(u.default.length(i.next()));return a.chop()},t.prototype.transformPosition=function(t,e){void 0===e&&(e=!1),e=!!e;for(var r=u.default.iterator(this.ops),n=0;r.hasNext()&&n<=t;){var i=r.peekLength(),o=r.peekType();r.next(),\"delete\"!==o?(\"insert\"===o&&(n=n-r?(t=n-r,this.index+=1,this.offset=0):this.offset+=t,\"number\"==typeof e.delete)return{delete:t};var o={};return e.attributes&&(o.attributes=e.attributes),\"number\"==typeof e.retain?o.retain=t:\"string\"==typeof e.insert?o.insert=e.insert.substr(r,t):o.insert=e.insert,o}return{retain:1/0}},t.prototype.peek=function(){return this.ops[this.index]},t.prototype.peekLength=function(){return this.ops[this.index]?i.default.length(this.ops[this.index])-this.offset:1/0},t.prototype.peekType=function(){return this.ops[this.index]?\"number\"==typeof this.ops[this.index].delete?\"delete\":\"number\"==typeof this.ops[this.index].retain?\"retain\":\"insert\":\"retain\"},t.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var t=this.offset,e=this.index,r=this.next(),n=this.ops.slice(this.index);return this.offset=t,this.index=e,[r].concat(n)}return[]},t}();e.default=o},430:function(t,e,r){\"use strict\";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0});var i,o=n(r(977));!function(t){t.iterator=function(t){return new o.default(t)},t.length=function(t){return\"number\"==typeof t.delete?t.delete:\"number\"==typeof t.retain?t.retain:\"string\"==typeof t.insert?t.insert.length:1}}(i||(i={})),e.default=i},165:function(t,e,r){var n,i;void 0===(i=\"function\"==typeof(n=function(){var t,e={};function r(t,e,r){var n=t.getClientRects();if(2===n.length){var i=t.getBoundingClientRect();return n[e][r]=e.length)return Array.prototype.push.apply(t,e);for(;n1,t.getClientRects||(s.setEnd(o,1),t.getClientRects=t.getBoundingClientRect=2===s.getClientRects().length),!t.getBoundingClientRect){s.setEnd(s.startContainer,s.startOffset);var u=s.getBoundingClientRect();t.getBoundingClientRect=0===u.top&&0===u.left}if(document.body.removeChild(e),!t.getBoundingClientRect){var c=document.createElement(\"p\");c.style.width=\"0px\",c.style.fontSize=\"20px\",c.style.whiteSpace=\"normal\",c.style.wordBreak=\"normal\";var l=document.createTextNode(\"m mm\");c.appendChild(l),document.body.appendChild(c),s.setStart(l,1),s.setEnd(l,2),r(s,1,\"left\")?t.getBoundingClientRect=!0:(s.setStart(l,1),s.setEnd(l,3),r(s,0,\"top\")&&(t.getBoundingClientRect=!0)),document.body.removeChild(c)}var f=window.ActiveXObject&&new Function(\"/*@cc_on return @_jscript_version; @*/\")();t.ieZoom=!!f&&f<=10}return t},e.getClientRects=function(t){var e=this.isBroken();if(e.ieZoom)return n(t.getClientRects());if(!e.getClientRects)return t.getClientRects();var r=[],o=[],a=t.endContainer,s=t.endOffset,u=document.createRange();function c(t){for(var e=0;t=t.previousSibling;)e++;return e}for(;a!==t.commonAncestorContainer;)u.setStart(a,0),u.setEnd(a,s),i(o,u.getClientRects()),s=c(a),a=a.parentNode;return(u=t.cloneRange()).setEnd(a,s),i(r,u.getClientRects()),i(r,o),r},e.getBoundingClientRect=function(t){var e=this.getClientRects(t);if(0===e.length)return null;var r,i=t.getBoundingClientRect(),o=this.isBroken();if(o.ieZoom)return n(i);if(!o.getBoundingClientRect)return i;if(0===i.width&&0===i.height)return e[0];for(var a=0,s=e.length;a{\"use strict\";r.r(e),r.d(e,{default:()=>C});var n=function(){if(\"undefined\"!=typeof Map)return Map;function t(t,e){var r=-1;return t.some((function(t,n){return t[0]===e&&(r=n,!0)})),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,\"size\",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var r=t(this.__entries__,e),n=this.__entries__[r];return n&&n[1]},e.prototype.set=function(e,r){var n=t(this.__entries__,e);~n?this.__entries__[n][1]=r:this.__entries__.push([e,r])},e.prototype.delete=function(e){var r=this.__entries__,n=t(r,e);~n&&r.splice(n,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var r=0,n=this.__entries__;r0},t.prototype.connect_=function(){i&&!this.connected_&&(document.addEventListener(\"transitionend\",this.onTransitionEnd_),window.addEventListener(\"resize\",this.refresh),u?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener(\"DOMSubtreeModified\",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){i&&this.connected_&&(document.removeEventListener(\"transitionend\",this.onTransitionEnd_),window.removeEventListener(\"resize\",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener(\"DOMSubtreeModified\",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,r=void 0===e?\"\":e;s.some((function(t){return!!~r.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),l=function(t,e){for(var r=0,n=Object.keys(e);r0},t}(),A=\"undefined\"!=typeof WeakMap?new WeakMap:new n,x=function t(e){if(!(this instanceof t))throw new TypeError(\"Cannot call a class as a function.\");if(!arguments.length)throw new TypeError(\"1 argument required, but only 0 present.\");var r=c.getInstance(),n=new m(e,r,this);A.set(this,n)};[\"observe\",\"unobserve\",\"disconnect\"].forEach((function(t){x.prototype[t]=function(){var e;return(e=A.get(this))[t].apply(e,arguments)}}));const C=void 0!==o.ResizeObserver?o.ResizeObserver:x},413:(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{default:()=>v});var n=r(379),i=r.n(n),o=r(795),a=r.n(o),s=r(569),u=r.n(s),c=r(565),l=r.n(c),f=r(216),h=r.n(f),d=r(589),p=r.n(d),g=r(582),_={};_.styleTagTransform=p(),_.setAttributes=l(),_.insert=u().bind(null,\"head\"),_.domAPI=a(),_.insertStyleElement=h(),i()(g.Z,_);const v=g.Z&&g.Z.locals?g.Z.locals:void 0},379:t=>{\"use strict\";var e=[];function r(t){for(var r=-1,n=0;n{\"use strict\";var e={};t.exports=function(t,r){var n=function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}(t);if(!n)throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");n.appendChild(r)}},216:t=>{\"use strict\";t.exports=function(t){var e=document.createElement(\"style\");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,r)=>{\"use strict\";t.exports=function(t){var e=r.nc;e&&t.setAttribute(\"nonce\",e)}},795:t=>{\"use strict\";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(r){!function(t,e,r){var n=\"\";r.supports&&(n+=\"@supports (\".concat(r.supports,\") {\")),r.media&&(n+=\"@media \".concat(r.media,\" {\"));var i=void 0!==r.layer;i&&(n+=\"@layer\".concat(r.layer.length>0?\" \".concat(r.layer):\"\",\" {\")),n+=r.css,i&&(n+=\"}\"),r.media&&(n+=\"}\"),r.supports&&(n+=\"}\");var o=r.sourceMap;o&&\"undefined\"!=typeof btoa&&(n+=\"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o)))),\" */\")),e.styleTagTransform(n,t,e.options)}(e,t,r)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{\"use strict\";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},607:function(t,e,r){\"use strict\";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0}),e.Cursor=e.default=void 0;var i=n(r(678));e.default=i.default;var o=n(r(353));e.Cursor=o.default,r(413)},353:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=r(207),i=function(){function t(t,e,r){this.id=t,this.name=e,this.color=r,this.toggleNearCursor=this.toggleNearCursor.bind(this),this._toggleOpenedCursor=this._toggleOpenedCursor.bind(this),this._setHoverState=this._setHoverState.bind(this)}return t.prototype.build=function(e){var r=document.createElement(t.CONTAINER_ELEMENT_TAG);r.classList.add(t.CURSOR_CLASS),r.id=\"ql-cursor-\".concat(this.id),r.innerHTML=e.template;var n=r.getElementsByClassName(t.SELECTION_CLASS)[0],i=r.getElementsByClassName(t.CARET_CONTAINER_CLASS)[0],o=i.getElementsByClassName(t.CARET_CLASS)[0],a=r.getElementsByClassName(t.FLAG_CLASS)[0];return a.style.backgroundColor=this.color,o.style.backgroundColor=this.color,r.getElementsByClassName(t.NAME_CLASS)[0].textContent=this.name,this._hideDelay=\"\".concat(e.hideDelayMs,\"ms\"),this._hideSpeedMs=e.hideSpeedMs,this._positionFlag=e.positionFlag,a.style.transitionDelay=this._hideDelay,a.style.transitionDuration=\"\".concat(this._hideSpeedMs,\"ms\"),this._el=r,this._selectionEl=n,this._caretEl=i,this._flagEl=a,i.addEventListener(\"mouseover\",this._setHoverState,{passive:!0}),this._el},t.prototype.show=function(){this._el.classList.remove(t.HIDDEN_CLASS)},t.prototype.hide=function(){this._el.classList.add(t.HIDDEN_CLASS)},t.prototype.remove=function(){this._el.parentNode.removeChild(this._el)},t.prototype.toggleNearCursor=function(e,r){var n=this._getCoordinates(),i=n.left,o=n.right,a=n.top,s=n.bottom,u=e>=i&&e<=o&&r>=a&&r<=s;return this._caretEl.classList.toggle(t.CONTAINER_HOVER_CLASS,u),u},t.prototype.toggleFlag=function(e){var r=this;this._caretEl.classList.toggle(t.CONTAINER_HOVER_CLASS,e)||(this._flagEl.classList.add(t.NO_DELAY_CLASS),setTimeout((function(){return r._flagEl.classList.remove(t.NO_DELAY_CLASS)}),this._hideSpeedMs))},t.prototype.updateCaret=function(t,e){this._caretEl.style.top=\"\".concat(t.top,\"px\"),this._caretEl.style.left=\"\".concat(t.left,\"px\"),this._caretEl.style.height=\"\".concat(t.height,\"px\"),this._positionFlag?this._positionFlag(this._flagEl,t,e):this._updateCaretFlag(t,e)},t.prototype.updateSelection=function(t,e){var r=this;this._clearSelection(),t=t||[],t=Array.from(t),t=this._sanitize(t),(t=this._sortByDomPosition(t)).forEach((function(t){return r._addSelection(t,e)}))},t.prototype._setHoverState=function(){document.addEventListener(\"mousemove\",this._toggleOpenedCursor,{passive:!0})},t.prototype._toggleOpenedCursor=function(e){var r=this.toggleNearCursor(e.clientX,e.clientY);this._caretEl.classList.toggle(t.CONTAINER_NO_POINTER_CLASS,r),r||document.removeEventListener(\"mousemove\",this._toggleOpenedCursor)},t.prototype._getCoordinates=function(){return this._caretEl.getBoundingClientRect()},t.prototype._updateCaretFlag=function(e,r){this._flagEl.style.width=\"\";var n=this._flagEl.getBoundingClientRect();this._flagEl.classList.remove(t.FLAG_FLIPPED_CLASS),e.left>r.width-n.width&&this._flagEl.classList.add(t.FLAG_FLIPPED_CLASS),this._flagEl.style.left=\"\".concat(e.left,\"px\"),this._flagEl.style.top=\"\".concat(e.top,\"px\"),this._flagEl.style.width=\"\".concat(Math.ceil(n.width),\"px\")},t.prototype._clearSelection=function(){this._selectionEl.innerHTML=\"\"},t.prototype._addSelection=function(t,e){var r=this._selectionBlock(t,e);this._selectionEl.appendChild(r)},t.prototype._selectionBlock=function(e,r){var i=document.createElement(t.SELECTION_ELEMENT_TAG);return i.classList.add(t.SELECTION_BLOCK_CLASS),i.style.top=\"\".concat(e.top-r.top,\"px\"),i.style.left=\"\".concat(e.left-r.left,\"px\"),i.style.width=\"\".concat(e.width,\"px\"),i.style.height=\"\".concat(e.height,\"px\"),i.style.backgroundColor=n(this.color).setAlpha(.3).toString(),i},t.prototype._sortByDomPosition=function(t){return t.sort((function(t,e){return t.top===e.top?t.left-e.left:t.top-e.top}))},t.prototype._sanitize=function(t){var e=this,r=new Set;return t.filter((function(t){if(!t.width||!t.height)return!1;var n=e._serialize(t);return!r.has(n)&&(r.add(n),!0)}))},t.prototype._serialize=function(t){return[\"top:\".concat(t.top),\"right:\".concat(t.right),\"bottom:\".concat(t.bottom),\"left:\".concat(t.left)].join(\";\")},t.CONTAINER_ELEMENT_TAG=\"SPAN\",t.SELECTION_ELEMENT_TAG=\"SPAN\",t.CURSOR_CLASS=\"ql-cursor\",t.SELECTION_CLASS=\"ql-cursor-selections\",t.SELECTION_BLOCK_CLASS=\"ql-cursor-selection-block\",t.CARET_CLASS=\"ql-cursor-caret\",t.CARET_CONTAINER_CLASS=\"ql-cursor-caret-container\",t.CONTAINER_HOVER_CLASS=\"hover\",t.CONTAINER_NO_POINTER_CLASS=\"no-pointer\",t.FLAG_CLASS=\"ql-cursor-flag\",t.FLAG_FLIPPED_CLASS=\"flag-flipped\",t.NAME_CLASS=\"ql-cursor-name\",t.HIDDEN_CLASS=\"hidden\",t.NO_DELAY_CLASS=\"no-delay\",t}();e.default=i},678:function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!(\"get\"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)\"default\"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0});var s=a(r(353)),u=o(r(165)),c=a(r(338)),l=a(r(33)),f=r(895),h=function(){function t(t,e){void 0===e&&(e={}),this._cursors={},this._isObserving=!1,this._handleCursorTouch=this._handleCursorTouch.bind(this),this.quill=t,this.options=this._setDefaults(e),this._container=this.quill.addContainer(this.options.containerClass),this._boundsContainer=this.options.boundsContainer||this.quill.container,this._currentSelection=this.quill.getSelection(),this._registerSelectionChangeListeners(),this._registerTextChangeListener(),this._registerDomListeners()}return t.prototype.createCursor=function(t,e,r){var n=this._cursors[t];if(!n){n=new s.default(t,e,r),this._cursors[t]=n;var i=n.build(this.options);this._container.appendChild(i)}return n},t.prototype.moveCursor=function(t,e){var r=this._cursors[t];r&&(r.range=e,this._updateCursor(r))},t.prototype.removeCursor=function(t){var e=this._cursors[t];e&&(e.remove(),delete this._cursors[t])},t.prototype.update=function(){var t=this;this.cursors().forEach((function(e){return t._updateCursor(e)}))},t.prototype.clearCursors=function(){var t=this;this.cursors().forEach((function(e){return t.removeCursor(e.id)}))},t.prototype.toggleFlag=function(t,e){var r=this._cursors[t];r&&r.toggleFlag(e)},t.prototype.cursors=function(){var t=this;return Object.keys(this._cursors).map((function(e){return t._cursors[e]}))},t.prototype._registerSelectionChangeListeners=function(){var t=this;this.quill.on(this.quill.constructor.events.SELECTION_CHANGE,(function(e){t._currentSelection=e}))},t.prototype._registerTextChangeListener=function(){var t=this;this.quill.on(this.quill.constructor.events.TEXT_CHANGE,(function(e){return t._handleTextChange(e)}))},t.prototype._registerDomListeners=function(){var t=this,e=this.quill.container.getElementsByClassName(\"ql-editor\")[0];e.addEventListener(\"scroll\",(function(){return t.update()}),{passive:!0}),e.addEventListener(\"touchstart\",this._handleCursorTouch,{passive:!0})},t.prototype._handleCursorTouch=function(t){var e=this;this.cursors().forEach((function(r){r.toggleNearCursor(t.pageX,t.pageY),setTimeout((function(){return r.toggleFlag(!1)}),e.options.hideDelayMs)}))},t.prototype._registerResizeObserver=function(){var t=this;if(!this._isObserving){var e=this.quill.container.getElementsByClassName(\"ql-editor\")[0],r=new l.default((function(e){if(!e[0].target.isConnected)return r.disconnect(),void(t._isObserving=!1);t.update()}));r.observe(e),this._isObserving=!0}},t.prototype._updateCursor=function(t){if(this._registerResizeObserver(),!t.range)return t.hide();var e=this._indexWithinQuillBounds(t.range.index),r=this._indexWithinQuillBounds(t.range.index+t.range.length),n=this.quill.getLeaf(e),i=this.quill.getLeaf(r);if(!this._leafIsValid(n)||!this._leafIsValid(i))return t.hide();t.show();var o=this._boundsContainer.getBoundingClientRect(),a=this.quill.getBounds(r);t.updateCaret(a,o);var s=this._lineRanges(t,n,i).reduce((function(t,e){return t.concat(Array.from(u.getClientRects(e)))}),[]);t.updateSelection(s,o)},t.prototype._indexWithinQuillBounds=function(t){var e=this.quill.getLength(),r=e?e-1:0;return t=Math.max(t,0),Math.min(t,r)},t.prototype._leafIsValid=function(t){return t&&t[0]&&t[0].domNode&&t[1]>=0},t.prototype._handleTextChange=function(t){var e=this;window.setTimeout((function(){e.options.transformOnTextChange&&e._transformCursors(t),e.options.selectionChangeSource&&(e._emitSelection(),e.update())}))},t.prototype._emitSelection=function(){this.quill.emitter.emit(this.quill.constructor.events.SELECTION_CHANGE,this.quill.getSelection(),this._currentSelection,this.options.selectionChangeSource)},t.prototype._setDefaults=function(e){return(e=Object.assign({},e)).template||(e.template=t.DEFAULTS.template),e.containerClass||(e.containerClass=t.DEFAULTS.containerClass),null!==e.selectionChangeSource&&(e.selectionChangeSource||(e.selectionChangeSource=t.DEFAULTS.selectionChangeSource)),e.hideDelayMs=Number.isInteger(e.hideDelayMs)?e.hideDelayMs:t.DEFAULTS.hideDelayMs,e.hideSpeedMs=Number.isInteger(e.hideSpeedMs)?e.hideSpeedMs:t.DEFAULTS.hideSpeedMs,e.transformOnTextChange=!!e.transformOnTextChange,e},t.prototype._lineRanges=function(t,e,r){var n=this.quill.getLines(t.range);return n.reduce((function(t,i,o){if(!i.children){var a=document.createRange();return a.selectNode(i.domNode),t.concat(a)}var s=0===o?e:i.path(0).pop(),u=s[0],c=s[1],l=o===n.length-1?r:i.path(i.length()-1).pop(),f=l[0],h=l[1],d=document.createRange();return u.domNode.nodeType===Node.TEXT_NODE?d.setStart(u.domNode,c):d.setStartBefore(u.domNode),f.domNode.nodeType===Node.TEXT_NODE?d.setEnd(f.domNode,h):d.setEndAfter(f.domNode),t.concat(d)}),[])},t.prototype._transformCursors=function(t){var e=this;t=new f(t),this.cursors().filter((function(t){return t.range})).forEach((function(r){r.range.index=t.transformPosition(r.range.index),e._updateCursor(r)}))},t.DEFAULTS={template:c.default,containerClass:\"ql-cursors\",selectionChangeSource:\"api\",hideDelayMs:3e3,hideSpeedMs:400},t}();e.default=h},338:function(t,e,r){\"use strict\";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0});var i=n(r(353)),o='\\n \\n \\n \\n \\n
    \\n \\n
    \\n');e.default=o},207:function(t){t.exports=function(){\"use strict\";const t=/^\\s+/,e=/\\s+$/;function r(n,i){if(i=i||{},(n=n||\"\")instanceof r)return n;if(!(this instanceof r))return new r(n,i);var o=function(r){var n={r:0,g:0,b:0},i=1,o=null,a=null,s=null,u=!1,c=!1;return\"string\"==typeof r&&(r=function(r){r=r.replace(t,\"\").replace(e,\"\").toLowerCase();var n,i=!1;if(y[r])r=y[r],i=!0;else if(\"transparent\"==r)return{r:0,g:0,b:0,a:0,format:\"name\"};return(n=T.rgb.exec(r))?{r:n[1],g:n[2],b:n[3]}:(n=T.rgba.exec(r))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=T.hsl.exec(r))?{h:n[1],s:n[2],l:n[3]}:(n=T.hsla.exec(r))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=T.hsv.exec(r))?{h:n[1],s:n[2],v:n[3]}:(n=T.hsva.exec(r))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=T.hex8.exec(r))?{r:w(n[1]),g:w(n[2]),b:w(n[3]),a:O(n[4]),format:i?\"name\":\"hex8\"}:(n=T.hex6.exec(r))?{r:w(n[1]),g:w(n[2]),b:w(n[3]),format:i?\"name\":\"hex\"}:(n=T.hex4.exec(r))?{r:w(n[1]+\"\"+n[1]),g:w(n[2]+\"\"+n[2]),b:w(n[3]+\"\"+n[3]),a:O(n[4]+\"\"+n[4]),format:i?\"name\":\"hex8\"}:!!(n=T.hex3.exec(r))&&{r:w(n[1]+\"\"+n[1]),g:w(n[2]+\"\"+n[2]),b:w(n[3]+\"\"+n[3]),format:i?\"name\":\"hex\"}}(r)),\"object\"==typeof r&&(R(r.r)&&R(r.g)&&R(r.b)?(l=r.r,f=r.g,h=r.b,n={r:255*x(l,255),g:255*x(f,255),b:255*x(h,255)},u=!0,c=\"%\"===String(r.r).substr(-1)?\"prgb\":\"rgb\"):R(r.h)&&R(r.s)&&R(r.v)?(o=S(r.s),a=S(r.v),n=function(t,e,r){t=6*x(t,360),e=x(e,100),r=x(r,100);var n=Math.floor(t),i=t-n,o=r*(1-e),a=r*(1-i*e),s=r*(1-(1-i)*e),u=n%6;return{r:255*[r,a,o,o,s,r][u],g:255*[s,r,r,a,o,o][u],b:255*[o,o,s,r,r,a][u]}}(r.h,o,a),u=!0,c=\"hsv\"):R(r.h)&&R(r.s)&&R(r.l)&&(o=S(r.s),s=S(r.l),n=function(t,e,r){var n,i,o;function a(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=x(t,360),e=x(e,100),r=x(r,100),0===e)n=i=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,u=2*r-s;n=a(u,s,t+1/3),i=a(u,s,t),o=a(u,s,t-1/3)}return{r:255*n,g:255*i,b:255*o}}(r.h,o,s),u=!0,c=\"hsl\"),r.hasOwnProperty(\"a\")&&(i=r.a)),i=A(i),{ok:u,format:r.format||c,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:i};var l,f,h}(n);this._originalInput=n,this._r=o.r,this._g=o.g,this._b=o.b,this._a=o.a,this._roundA=Math.round(100*this._a)/100,this._format=i.format||o.format,this._gradientType=i.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=o.ok}function n(t,e,r){t=x(t,255),e=x(e,255),r=x(r,255);var n,i,o=Math.max(t,e,r),a=Math.min(t,e,r),s=(o+a)/2;if(o==a)n=i=0;else{var u=o-a;switch(i=s>.5?u/(2-o-a):u/(o+a),o){case t:n=(e-r)/u+(e>1)+720)%360;--e;)i.h=(i.h+o)%360,a.push(r(i));return a}function b(t,e){e=e||6;for(var n=r(t).toHsv(),i=n.h,o=n.s,a=n.v,s=[],u=1/e;e--;)s.push(r({h:i,s:o,v:a})),a=(a+u)%1;return s}r.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n=this.toRgb();return t=n.r/255,e=n.g/255,r=n.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=A(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=i(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.v);return 1==this._a?\"hsv(\"+e+\", \"+r+\"%, \"+n+\"%)\":\"hsva(\"+e+\", \"+r+\"%, \"+n+\"%, \"+this._roundA+\")\"},toHsl:function(){var t=n(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=n(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),i=Math.round(100*t.l);return 1==this._a?\"hsl(\"+e+\", \"+r+\"%, \"+i+\"%)\":\"hsla(\"+e+\", \"+r+\"%, \"+i+\"%, \"+this._roundA+\")\"},toHex:function(t){return o(this._r,this._g,this._b,t)},toHexString:function(t){return\"#\"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[E(Math.round(t).toString(16)),E(Math.round(e).toString(16)),E(Math.round(r).toString(16)),E(M(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join(\"\")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return\"#\"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?\"rgb(\"+Math.round(this._r)+\", \"+Math.round(this._g)+\", \"+Math.round(this._b)+\")\":\"rgba(\"+Math.round(this._r)+\", \"+Math.round(this._g)+\", \"+Math.round(this._b)+\", \"+this._roundA+\")\"},toPercentageRgb:function(){return{r:Math.round(100*x(this._r,255))+\"%\",g:Math.round(100*x(this._g,255))+\"%\",b:Math.round(100*x(this._b,255))+\"%\",a:this._a}},toPercentageRgbString:function(){return 1==this._a?\"rgb(\"+Math.round(100*x(this._r,255))+\"%, \"+Math.round(100*x(this._g,255))+\"%, \"+Math.round(100*x(this._b,255))+\"%)\":\"rgba(\"+Math.round(100*x(this._r,255))+\"%, \"+Math.round(100*x(this._g,255))+\"%, \"+Math.round(100*x(this._b,255))+\"%, \"+this._roundA+\")\"},toName:function(){return 0===this._a?\"transparent\":!(this._a<1)&&(m[o(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e=\"#\"+a(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?\"GradientType = 1, \":\"\";if(t){var o=r(t);n=\"#\"+a(o._r,o._g,o._b,o._a)}return\"progid:DXImageTransform.Microsoft.gradient(\"+i+\"startColorstr=\"+e+\",endColorstr=\"+n+\")\"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||\"hex\"!==t&&\"hex6\"!==t&&\"hex3\"!==t&&\"hex4\"!==t&&\"hex8\"!==t&&\"name\"!==t?(\"rgb\"===t&&(r=this.toRgbString()),\"prgb\"===t&&(r=this.toPercentageRgbString()),\"hex\"!==t&&\"hex6\"!==t||(r=this.toHexString()),\"hex3\"===t&&(r=this.toHexString(!0)),\"hex4\"===t&&(r=this.toHex8String(!0)),\"hex8\"===t&&(r=this.toHex8String()),\"name\"===t&&(r=this.toName()),\"hsl\"===t&&(r=this.toHslString()),\"hsv\"===t&&(r=this.toHsvString()),r||this.toHexString()):\"name\"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return r(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(l,arguments)},brighten:function(){return this._applyModification(f,arguments)},darken:function(){return this._applyModification(h,arguments)},desaturate:function(){return this._applyModification(s,arguments)},saturate:function(){return this._applyModification(u,arguments)},greyscale:function(){return this._applyModification(c,arguments)},spin:function(){return this._applyModification(d,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(v,arguments)},complement:function(){return this._applyCombination(p,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(g,[3])},tetrad:function(){return this._applyCombination(g,[4])}},r.fromRatio=function(t,e){if(\"object\"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=\"a\"===i?t[i]:S(t[i]));t=n}return r(t,e)},r.equals=function(t,e){return!(!t||!e)&&r(t).toRgbString()==r(e).toRgbString()},r.random=function(){return r.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},r.mix=function(t,e,n){n=0===n?0:n||50;var i=r(t).toRgb(),o=r(e).toRgb(),a=n/100;return r({r:(o.r-i.r)*a+i.r,g:(o.g-i.g)*a+i.g,b:(o.b-i.b)*a+i.b,a:(o.a-i.a)*a+i.a})},r.readability=function(t,e){var n=r(t),i=r(e);return(Math.max(n.getLuminance(),i.getLuminance())+.05)/(Math.min(n.getLuminance(),i.getLuminance())+.05)},r.isReadable=function(t,e,n){var i,o,a,s,u,c=r.readability(t,e);switch(o=!1,(a=n,\"AA\"!==(s=((a=a||{level:\"AA\",size:\"small\"}).level||\"AA\").toUpperCase())&&\"AAA\"!==s&&(s=\"AA\"),\"small\"!==(u=(a.size||\"small\").toLowerCase())&&\"large\"!==u&&(u=\"small\"),i={level:s,size:u}).level+i.size){case\"AAsmall\":case\"AAAlarge\":o=c>=4.5;break;case\"AAlarge\":o=c>=3;break;case\"AAAsmall\":o=c>=7}return o},r.mostReadable=function(t,e,n){var i,o,a,s,u=null,c=0;o=(n=n||{}).includeFallbackColors,a=n.level,s=n.size;for(var l=0;lc&&(c=i,u=r(e[l]));return r.isReadable(t,u,{level:a,size:s})||!o?u:(n.includeFallbackColors=!1,r.mostReadable(t,[\"#fff\",\"#000\"],n))};var y=r.names={aliceblue:\"f0f8ff\",antiquewhite:\"faebd7\",aqua:\"0ff\",aquamarine:\"7fffd4\",azure:\"f0ffff\",beige:\"f5f5dc\",bisque:\"ffe4c4\",black:\"000\",blanchedalmond:\"ffebcd\",blue:\"00f\",blueviolet:\"8a2be2\",brown:\"a52a2a\",burlywood:\"deb887\",burntsienna:\"ea7e5d\",cadetblue:\"5f9ea0\",chartreuse:\"7fff00\",chocolate:\"d2691e\",coral:\"ff7f50\",cornflowerblue:\"6495ed\",cornsilk:\"fff8dc\",crimson:\"dc143c\",cyan:\"0ff\",darkblue:\"00008b\",darkcyan:\"008b8b\",darkgoldenrod:\"b8860b\",darkgray:\"a9a9a9\",darkgreen:\"006400\",darkgrey:\"a9a9a9\",darkkhaki:\"bdb76b\",darkmagenta:\"8b008b\",darkolivegreen:\"556b2f\",darkorange:\"ff8c00\",darkorchid:\"9932cc\",darkred:\"8b0000\",darksalmon:\"e9967a\",darkseagreen:\"8fbc8f\",darkslateblue:\"483d8b\",darkslategray:\"2f4f4f\",darkslategrey:\"2f4f4f\",darkturquoise:\"00ced1\",darkviolet:\"9400d3\",deeppink:\"ff1493\",deepskyblue:\"00bfff\",dimgray:\"696969\",dimgrey:\"696969\",dodgerblue:\"1e90ff\",firebrick:\"b22222\",floralwhite:\"fffaf0\",forestgreen:\"228b22\",fuchsia:\"f0f\",gainsboro:\"dcdcdc\",ghostwhite:\"f8f8ff\",gold:\"ffd700\",goldenrod:\"daa520\",gray:\"808080\",green:\"008000\",greenyellow:\"adff2f\",grey:\"808080\",honeydew:\"f0fff0\",hotpink:\"ff69b4\",indianred:\"cd5c5c\",indigo:\"4b0082\",ivory:\"fffff0\",khaki:\"f0e68c\",lavender:\"e6e6fa\",lavenderblush:\"fff0f5\",lawngreen:\"7cfc00\",lemonchiffon:\"fffacd\",lightblue:\"add8e6\",lightcoral:\"f08080\",lightcyan:\"e0ffff\",lightgoldenrodyellow:\"fafad2\",lightgray:\"d3d3d3\",lightgreen:\"90ee90\",lightgrey:\"d3d3d3\",lightpink:\"ffb6c1\",lightsalmon:\"ffa07a\",lightseagreen:\"20b2aa\",lightskyblue:\"87cefa\",lightslategray:\"789\",lightslategrey:\"789\",lightsteelblue:\"b0c4de\",lightyellow:\"ffffe0\",lime:\"0f0\",limegreen:\"32cd32\",linen:\"faf0e6\",magenta:\"f0f\",maroon:\"800000\",mediumaquamarine:\"66cdaa\",mediumblue:\"0000cd\",mediumorchid:\"ba55d3\",mediumpurple:\"9370db\",mediumseagreen:\"3cb371\",mediumslateblue:\"7b68ee\",mediumspringgreen:\"00fa9a\",mediumturquoise:\"48d1cc\",mediumvioletred:\"c71585\",midnightblue:\"191970\",mintcream:\"f5fffa\",mistyrose:\"ffe4e1\",moccasin:\"ffe4b5\",navajowhite:\"ffdead\",navy:\"000080\",oldlace:\"fdf5e6\",olive:\"808000\",olivedrab:\"6b8e23\",orange:\"ffa500\",orangered:\"ff4500\",orchid:\"da70d6\",palegoldenrod:\"eee8aa\",palegreen:\"98fb98\",paleturquoise:\"afeeee\",palevioletred:\"db7093\",papayawhip:\"ffefd5\",peachpuff:\"ffdab9\",peru:\"cd853f\",pink:\"ffc0cb\",plum:\"dda0dd\",powderblue:\"b0e0e6\",purple:\"800080\",rebeccapurple:\"663399\",red:\"f00\",rosybrown:\"bc8f8f\",royalblue:\"4169e1\",saddlebrown:\"8b4513\",salmon:\"fa8072\",sandybrown:\"f4a460\",seagreen:\"2e8b57\",seashell:\"fff5ee\",sienna:\"a0522d\",silver:\"c0c0c0\",skyblue:\"87ceeb\",slateblue:\"6a5acd\",slategray:\"708090\",slategrey:\"708090\",snow:\"fffafa\",springgreen:\"00ff7f\",steelblue:\"4682b4\",tan:\"d2b48c\",teal:\"008080\",thistle:\"d8bfd8\",tomato:\"ff6347\",turquoise:\"40e0d0\",violet:\"ee82ee\",wheat:\"f5deb3\",white:\"fff\",whitesmoke:\"f5f5f5\",yellow:\"ff0\",yellowgreen:\"9acd32\"},m=r.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(y);function A(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function x(t,e){(function(t){return\"string\"==typeof t&&-1!=t.indexOf(\".\")&&1===parseFloat(t)})(t)&&(t=\"100%\");var r=function(t){return\"string\"==typeof t&&-1!=t.indexOf(\"%\")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function C(t){return Math.min(1,Math.max(0,t))}function w(t){return parseInt(t,16)}function E(t){return 1==t.length?\"0\"+t:\"\"+t}function S(t){return t<=1&&(t=100*t+\"%\"),t}function M(t){return Math.round(255*parseFloat(t)).toString(16)}function O(t){return w(t)/255}var j,L,k,T=(L=\"[\\\\s|\\\\(]+(\"+(j=\"(?:[-\\\\+]?\\\\d*\\\\.\\\\d+%?)|(?:[-\\\\+]?\\\\d+%?)\")+\")[,|\\\\s]+(\"+j+\")[,|\\\\s]+(\"+j+\")\\\\s*\\\\)?\",k=\"[\\\\s|\\\\(]+(\"+j+\")[,|\\\\s]+(\"+j+\")[,|\\\\s]+(\"+j+\")[,|\\\\s]+(\"+j+\")\\\\s*\\\\)?\",{CSS_UNIT:new RegExp(j),rgb:new RegExp(\"rgb\"+L),rgba:new RegExp(\"rgba\"+k),hsl:new RegExp(\"hsl\"+L),hsla:new RegExp(\"hsla\"+k),hsv:new RegExp(\"hsv\"+L),hsva:new RegExp(\"hsva\"+k),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function R(t){return!!T.CSS_UNIT.exec(t)}return r}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(t){if(\"object\"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),r.nc=void 0;var n=r(607);return n.default})()));", "/* eslint-env browser */\n\n/**\n * Tiny websocket connection handler.\n *\n * Implements exponential backoff reconnects, ping/pong, and a nice event system using [lib0/observable].\n *\n * @module websocket\n */\n\nimport { Observable } from './observable.js'\nimport * as time from './time.js'\nimport * as math from './math.js'\n\nconst reconnectTimeoutBase = 1200\nconst maxReconnectTimeout = 2500\n// @todo - this should depend on awareness.outdatedTime\nconst messageReconnectTimeout = 30000\n\n/**\n * @param {WebsocketClient} wsclient\n */\nconst setupWS = (wsclient) => {\n if (wsclient.shouldConnect && wsclient.ws === null) {\n const websocket = new WebSocket(wsclient.url)\n const binaryType = wsclient.binaryType\n /**\n * @type {any}\n */\n let pingTimeout = null\n if (binaryType) {\n websocket.binaryType = binaryType\n }\n wsclient.ws = websocket\n wsclient.connecting = true\n wsclient.connected = false\n websocket.onmessage = event => {\n wsclient.lastMessageReceived = time.getUnixTime()\n const data = event.data\n const message = typeof data === 'string' ? JSON.parse(data) : data\n if (message && message.type === 'pong') {\n clearTimeout(pingTimeout)\n pingTimeout = setTimeout(sendPing, messageReconnectTimeout / 2)\n }\n wsclient.emit('message', [message, wsclient])\n }\n /**\n * @param {any} error\n */\n const onclose = error => {\n if (wsclient.ws !== null) {\n wsclient.ws = null\n wsclient.connecting = false\n if (wsclient.connected) {\n wsclient.connected = false\n wsclient.emit('disconnect', [{ type: 'disconnect', error }, wsclient])\n } else {\n wsclient.unsuccessfulReconnects++\n }\n // Start with no reconnect timeout and increase timeout by\n // log10(wsUnsuccessfulReconnects).\n // The idea is to increase reconnect timeout slowly and have no reconnect\n // timeout at the beginning (log(1) = 0)\n setTimeout(setupWS, math.min(math.log10(wsclient.unsuccessfulReconnects + 1) * reconnectTimeoutBase, maxReconnectTimeout), wsclient)\n }\n clearTimeout(pingTimeout)\n }\n const sendPing = () => {\n if (wsclient.ws === websocket) {\n wsclient.send({\n type: 'ping'\n })\n }\n }\n websocket.onclose = () => onclose(null)\n websocket.onerror = error => onclose(error)\n websocket.onopen = () => {\n wsclient.lastMessageReceived = time.getUnixTime()\n wsclient.connecting = false\n wsclient.connected = true\n wsclient.unsuccessfulReconnects = 0\n wsclient.emit('connect', [{ type: 'connect' }, wsclient])\n // set ping\n pingTimeout = setTimeout(sendPing, messageReconnectTimeout / 2)\n }\n }\n}\n\n/**\n * @deprecated\n * @extends Observable\n */\nexport class WebsocketClient extends Observable {\n /**\n * @param {string} url\n * @param {object} opts\n * @param {'arraybuffer' | 'blob' | null} [opts.binaryType] Set `ws.binaryType`\n */\n constructor (url, { binaryType } = {}) {\n super()\n this.url = url\n /**\n * @type {WebSocket?}\n */\n this.ws = null\n this.binaryType = binaryType || null\n this.connected = false\n this.connecting = false\n this.unsuccessfulReconnects = 0\n this.lastMessageReceived = 0\n /**\n * Whether to connect to other peers or not\n * @type {boolean}\n */\n this.shouldConnect = true\n this._checkInterval = setInterval(() => {\n if (this.connected && messageReconnectTimeout < time.getUnixTime() - this.lastMessageReceived) {\n // no message received in a long time - not even your own awareness\n // updates (which are updated every 15 seconds)\n /** @type {WebSocket} */ (this.ws).close()\n }\n }, messageReconnectTimeout / 2)\n setupWS(this)\n }\n\n /**\n * @param {any} message\n */\n send (message) {\n if (this.ws) {\n this.ws.send(JSON.stringify(message))\n }\n }\n\n destroy () {\n clearInterval(this._checkInterval)\n this.disconnect()\n super.destroy()\n }\n\n disconnect () {\n this.shouldConnect = false\n if (this.ws !== null) {\n this.ws.close()\n }\n }\n\n connect () {\n this.shouldConnect = true\n if (!this.connected && this.ws === null) {\n setupWS(this)\n }\n }\n}\n", "/* eslint-env browser */\n\n/**\n * Helpers for cross-tab communication using broadcastchannel with LocalStorage fallback.\n *\n * ```js\n * // In browser window A:\n * broadcastchannel.subscribe('my events', data => console.log(data))\n * broadcastchannel.publish('my events', 'Hello world!') // => A: 'Hello world!' fires synchronously in same tab\n *\n * // In browser window B:\n * broadcastchannel.publish('my events', 'hello from tab B') // => A: 'hello from tab B'\n * ```\n *\n * @module broadcastchannel\n */\n\n// @todo before next major: use Uint8Array instead as buffer object\n\nimport * as map from './map.js'\nimport * as set from './set.js'\nimport * as buffer from './buffer.js'\nimport * as storage from './storage.js'\n\n/**\n * @typedef {Object} Channel\n * @property {Set} Channel.subs\n * @property {any} Channel.bc\n */\n\n/**\n * @type {Map}\n */\nconst channels = new Map()\n\n/* c8 ignore start */\nclass LocalStoragePolyfill {\n /**\n * @param {string} room\n */\n constructor (room) {\n this.room = room\n /**\n * @type {null|function({data:ArrayBuffer}):void}\n */\n this.onmessage = null\n /**\n * @param {any} e\n */\n this._onChange = e => e.key === room && this.onmessage !== null && this.onmessage({ data: buffer.fromBase64(e.newValue || '') })\n storage.onChange(this._onChange)\n }\n\n /**\n * @param {ArrayBuffer} buf\n */\n postMessage (buf) {\n storage.varStorage.setItem(this.room, buffer.toBase64(buffer.createUint8ArrayFromArrayBuffer(buf)))\n }\n\n close () {\n storage.offChange(this._onChange)\n }\n}\n/* c8 ignore stop */\n\n// Use BroadcastChannel or Polyfill\n/* c8 ignore next */\nconst BC = typeof BroadcastChannel === 'undefined' ? LocalStoragePolyfill : BroadcastChannel\n\n/**\n * @param {string} room\n * @return {Channel}\n */\nconst getChannel = room =>\n map.setIfUndefined(channels, room, () => {\n const subs = set.create()\n const bc = new BC(room)\n /**\n * @param {{data:ArrayBuffer}} e\n */\n /* c8 ignore next */\n bc.onmessage = e => subs.forEach(sub => sub(e.data, 'broadcastchannel'))\n return {\n bc, subs\n }\n })\n\n/**\n * Subscribe to global `publish` events.\n *\n * @function\n * @param {string} room\n * @param {function(any, any):any} f\n */\nexport const subscribe = (room, f) => {\n getChannel(room).subs.add(f)\n return f\n}\n\n/**\n * Unsubscribe from `publish` global events.\n *\n * @function\n * @param {string} room\n * @param {function(any, any):any} f\n */\nexport const unsubscribe = (room, f) => {\n const channel = getChannel(room)\n const unsubscribed = channel.subs.delete(f)\n if (unsubscribed && channel.subs.size === 0) {\n channel.bc.close()\n channels.delete(room)\n }\n return unsubscribed\n}\n\n/**\n * Publish data to all subscribers (including subscribers on this tab)\n *\n * @function\n * @param {string} room\n * @param {any} data\n * @param {any} [origin]\n */\nexport const publish = (room, data, origin = null) => {\n const c = getChannel(room)\n c.bc.postMessage(data)\n c.subs.forEach(sub => sub(data, origin))\n}\n", "/**\n * Mutual exclude for JavaScript.\n *\n * @module mutex\n */\n\n/**\n * @callback mutex\n * @param {function():void} cb Only executed when this mutex is not in the current stack\n * @param {function():void} [elseCb] Executed when this mutex is in the current stack\n */\n\n/**\n * Creates a mutual exclude function with the following property:\n *\n * ```js\n * const mutex = createMutex()\n * mutex(() => {\n * // This function is immediately executed\n * mutex(() => {\n * // This function is not executed, as the mutex is already active.\n * })\n * })\n * ```\n *\n * @return {mutex} A mutual exclude function\n * @public\n */\nexport const createMutex = () => {\n let token = true\n return (f, g) => {\n if (token) {\n token = false\n try {\n f()\n } finally {\n token = true\n }\n } else if (g !== undefined) {\n g()\n }\n }\n}\n", "(function(e){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=e();else if(\"function\"==typeof define&&define.amd)define([],e);else{var t;t=\"undefined\"==typeof window?\"undefined\"==typeof global?\"undefined\"==typeof self?this:self:global:window,t.SimplePeer=e()}})(function(){var t=Math.floor,n=Math.abs,r=Math.pow;return function(){function d(s,e,n){function t(o,i){if(!e[o]){if(!s[o]){var l=\"function\"==typeof require&&require;if(!i&&l)return l(o,!0);if(r)return r(o,!0);var c=new Error(\"Cannot find module '\"+o+\"'\");throw c.code=\"MODULE_NOT_FOUND\",c}var a=e[o]={exports:{}};s[o][0].call(a.exports,function(e){var r=s[o][1][e];return t(r||e)},a,a.exports,d,s,e,n)}return e[o].exports}for(var r=\"function\"==typeof require&&require,a=0;a>16,l[c++]=255&t>>8,l[c++]=255&t;return 2===s&&(t=u[e.charCodeAt(n)]<<2|u[e.charCodeAt(n+1)]>>4,l[c++]=255&t),1===s&&(t=u[e.charCodeAt(n)]<<10|u[e.charCodeAt(n+1)]<<4|u[e.charCodeAt(n+2)]>>2,l[c++]=255&t>>8,l[c++]=255&t),l}function d(e){return c[63&e>>18]+c[63&e>>12]+c[63&e>>6]+c[63&e]}function s(e,t,n){for(var r,a=[],o=t;ol?l:d+o));return 1===r?(t=e[n-1],a.push(c[t>>2]+c[63&t<<4]+\"==\")):2===r&&(t=(e[n-2]<<8)+e[n-1],a.push(c[t>>10]+c[63&t>>4]+c[63&t<<2]+\"=\")),a.join(\"\")}n.byteLength=function(e){var t=r(e),n=t[0],a=t[1];return 3*(n+a)/4-a},n.toByteArray=o,n.fromByteArray=l;for(var c=[],u=[],p=\"undefined\"==typeof Uint8Array?Array:Uint8Array,f=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",g=0,_=f.length;g<_;++g)c[g]=f[g],u[f.charCodeAt(g)]=g;u[45]=62,u[95]=63},{}],2:[function(){},{}],3:[function(e,t,n){(function(){(function(){/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */'use strict';var t=String.fromCharCode,o=Math.min;function d(e){if(2147483647e)throw new RangeError(\"The value \\\"\"+e+\"\\\" is invalid for option \\\"size\\\"\")}function u(e,t,n){return c(e),0>=e?d(e):void 0===t?d(e):\"string\"==typeof n?d(e).fill(t,n):d(e).fill(t)}function p(e){return c(e),d(0>e?0:0|m(e))}function f(e,t){if((\"string\"!=typeof t||\"\"===t)&&(t=\"utf8\"),!s.isEncoding(t))throw new TypeError(\"Unknown encoding: \"+t);var n=0|b(e,t),r=d(n),a=r.write(e,t);return a!==n&&(r=r.slice(0,a)),r}function g(e){for(var t=0>e.length?0:0|m(e.length),n=d(t),r=0;rt||e.byteLength=2147483647)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+2147483647 .toString(16)+\" bytes\");return 0|e}function b(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if(\"string\"!=typeof e)throw new TypeError(\"The \\\"string\\\" argument must be one of type string, Buffer, or ArrayBuffer. Received type \"+typeof e);var n=e.length,r=2>>1;case\"base64\":return z(e).length;default:if(a)return r?-1:H(e).length;t=(\"\"+t).toLowerCase(),a=!0;}}function y(e,t,n){var r=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return\"\";if((void 0===n||n>this.length)&&(n=this.length),0>=n)return\"\";if(n>>>=0,t>>>=0,n<=t)return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return P(this,t,n);case\"utf8\":case\"utf-8\":return x(this,t,n);case\"ascii\":return D(this,t,n);case\"latin1\":case\"binary\":return I(this,t,n);case\"base64\":return A(this,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return M(this,t,n);default:if(r)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),r=!0;}}function C(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function R(e,t,n,r,a){if(0===e.length)return-1;if(\"string\"==typeof n?(r=n,n=0):2147483647n&&(n=-2147483648),n=+n,X(n)&&(n=a?0:e.length-1),0>n&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(0>n)if(a)n=0;else return-1;if(\"string\"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:E(e,t,n,r,a);if(\"number\"==typeof t)return t&=255,\"function\"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,a);throw new TypeError(\"val must be string, number or Buffer\")}function E(e,t,n,r,a){function o(e,t){return 1===d?e[t]:e.readUInt16BE(t*d)}var d=1,s=e.length,l=t.length;if(void 0!==r&&(r=(r+\"\").toLowerCase(),\"ucs2\"===r||\"ucs-2\"===r||\"utf16le\"===r||\"utf-16le\"===r)){if(2>e.length||2>t.length)return-1;d=2,s/=2,l/=2,n/=2}var c;if(a){var u=-1;for(c=n;cs&&(n=s-l),c=n;0<=c;c--){for(var p=!0,f=0;fa&&(r=a)):r=a;var o=t.length;r>o/2&&(r=o/2);for(var d,s=0;sd&&(s=d):2===l?(c=e[a+1],128==(192&c)&&(f=(31&d)<<6|63&c,127f||57343f&&(s=f))):void 0}null===s?(s=65533,l=1):65535>>10),s=56320|1023&s),r.push(s),a+=l}return N(r)}function N(e){var n=e.length;if(n<=4096)return t.apply(String,e);for(var r=\"\",a=0;at)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var a=\"\",o=t;oe)throw new RangeError(\"offset is not uint\");if(e+t>n)throw new RangeError(\"Trying to access beyond buffer length\")}function F(e,t,n,r,a,o){if(!s.isBuffer(e))throw new TypeError(\"\\\"buffer\\\" argument must be a Buffer instance\");if(t>a||te.length)throw new RangeError(\"Index out of range\")}function B(e,t,n,r){if(n+r>e.length)throw new RangeError(\"Index out of range\");if(0>n)throw new RangeError(\"Index out of range\")}function U(e,t,n,r,a){return t=+t,n>>>=0,a||B(e,t,n,4,34028234663852886e22,-34028234663852886e22),J.write(e,t,n,r,23,4),n+4}function j(e,t,n,r,a){return t=+t,n>>>=0,a||B(e,t,n,8,17976931348623157e292,-17976931348623157e292),J.write(e,t,n,r,52,8),n+8}function q(e){if(e=e.split(\"=\")[0],e=e.trim().replace(Q,\"\"),2>e.length)return\"\";for(;0!=e.length%4;)e+=\"=\";return e}function W(e){return 16>e?\"0\"+e.toString(16):e.toString(16)}function H(e,t){t=t||1/0;for(var n,r=e.length,a=null,o=[],d=0;dn){if(!a){if(56319n){-1<(t-=3)&&o.push(239,191,189),a=n;continue}n=(a-55296<<10|n-56320)+65536}else a&&-1<(t-=3)&&o.push(239,191,189);if(a=null,128>n){if(0>(t-=1))break;o.push(n)}else if(2048>n){if(0>(t-=2))break;o.push(192|n>>6,128|63&n)}else if(65536>n){if(0>(t-=3))break;o.push(224|n>>12,128|63&n>>6,128|63&n)}else if(1114112>n){if(0>(t-=4))break;o.push(240|n>>18,128|63&n>>12,128|63&n>>6,128|63&n)}else throw new Error(\"Invalid code point\")}return o}function Y(e){for(var t=[],n=0;n(t-=2));++d)n=e.charCodeAt(d),r=n>>8,a=n%256,o.push(a),o.push(r);return o}function z(e){return $.toByteArray(q(e))}function G(e,t,n,r){for(var a=0;a=t.length||a>=e.length);++a)t[a+n]=e[a];return a}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!==e}var $=e(\"base64-js\"),J=e(\"ieee754\");n.Buffer=s,n.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},n.INSPECT_MAX_BYTES=50;n.kMaxLength=2147483647,s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(s.prototype,\"parent\",{enumerable:!0,get:function(){return s.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(s.prototype,\"offset\",{enumerable:!0,get:function(){return s.isBuffer(this)?this.byteOffset:void 0}}),\"undefined\"!=typeof Symbol&&null!=Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),s.poolSize=8192,s.from=function(e,t,n){return l(e,t,n)},s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,s.alloc=function(e,t,n){return u(e,t,n)},s.allocUnsafe=function(e){return p(e)},s.allocUnsafeSlow=function(e){return p(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(K(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError(\"The \\\"buf1\\\", \\\"buf2\\\" arguments must be one of type Buffer or Uint8Array\");if(e===t)return 0;for(var n=e.length,r=t.length,d=0,l=o(n,r);dt&&(e+=\" ... \"),\"\"},s.prototype.compare=function(e,t,n,r,a){if(K(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError(\"The \\\"target\\\" argument must be one of type Buffer or Uint8Array. Received type \"+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),0>t||n>e.length||0>r||a>this.length)throw new RangeError(\"out of range index\");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,a>>>=0,this===e)return 0;for(var d=a-r,l=n-t,c=o(d,l),u=this.slice(r,a),p=e.slice(t,n),f=0;f>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r=\"utf8\")):(r=n,n=void 0);else throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");var a=this.length-t;if((void 0===n||n>a)&&(n=a),0n||0>t)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");r||(r=\"utf8\");for(var o=!1;;)switch(r){case\"hex\":return w(this,e,t,n);case\"utf8\":case\"utf-8\":return S(this,e,t,n);case\"ascii\":return T(this,e,t,n);case\"latin1\":case\"binary\":return v(this,e,t,n);case\"base64\":return k(this,e,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return L(this,e,t,n);default:if(o)throw new TypeError(\"Unknown encoding: \"+r);r=(\"\"+r).toLowerCase(),o=!0;}},s.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};s.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),t>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e],a=1,o=0;++o>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e+--t],a=1;0>>=0,t||O(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var a=this[e],o=1,d=0;++d=o&&(a-=r(2,8*t)),a},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var a=t,o=1,d=this[e+--a];0=o&&(d-=r(2,8*t)),d},s.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),J.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),J.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),J.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),J.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,a){if(e=+e,t>>>=0,n>>>=0,!a){var o=r(2,8*n)-1;F(this,e,t,n,o,0)}var d=1,s=0;for(this[t]=255&e;++s>>=0,n>>>=0,!a){var o=r(2,8*n)-1;F(this,e,t,n,o,0)}var d=n-1,s=1;for(this[t+d]=255&e;0<=--d&&(s*=256);)this[t+d]=255&e/s;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeIntLE=function(e,t,n,a){if(e=+e,t>>>=0,!a){var o=r(2,8*n-1);F(this,e,t,n,o-1,-o)}var d=0,s=1,l=0;for(this[t]=255&e;++de&&0===l&&0!==this[t+d-1]&&(l=1),this[t+d]=255&(e/s>>0)-l;return t+n},s.prototype.writeIntBE=function(e,t,n,a){if(e=+e,t>>>=0,!a){var o=r(2,8*n-1);F(this,e,t,n,o-1,-o)}var d=n-1,s=1,l=0;for(this[t+d]=255&e;0<=--d&&(s*=256);)0>e&&0===l&&0!==this[t+d+1]&&(l=1),this[t+d]=255&(e/s>>0)-l;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,1,127,-128),0>e&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return j(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return j(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw new TypeError(\"argument should be a Buffer\");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),0t)throw new RangeError(\"targetStart out of bounds\");if(0>n||n>=this.length)throw new RangeError(\"Index out of range\");if(0>r)throw new RangeError(\"sourceEnd out of bounds\");r>this.length&&(r=this.length),e.length-ta||\"latin1\"===r)&&(e=a)}}else\"number\"==typeof e&&(e&=255);if(0>t||this.length>>=0,n=n===void 0?this.length:n>>>0,e||(e=0);var o;if(\"number\"==typeof e)for(o=t;o{\"%%\"===e||(r++,\"%c\"===e&&(a=r))}),e.splice(a,0,n)},n.save=function(e){try{e?n.storage.setItem(\"debug\",e):n.storage.removeItem(\"debug\")}catch(e){}},n.load=r,n.useColors=function(){return!!(\"undefined\"!=typeof window&&window.process&&(\"renderer\"===window.process.type||window.process.__nwjs))||!(\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/))&&(\"undefined\"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||\"undefined\"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)&&31<=parseInt(RegExp.$1,10)||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\"))}})(),n.colors=[\"#0000CC\",\"#0000FF\",\"#0033CC\",\"#0033FF\",\"#0066CC\",\"#0066FF\",\"#0099CC\",\"#0099FF\",\"#00CC00\",\"#00CC33\",\"#00CC66\",\"#00CC99\",\"#00CCCC\",\"#00CCFF\",\"#3300CC\",\"#3300FF\",\"#3333CC\",\"#3333FF\",\"#3366CC\",\"#3366FF\",\"#3399CC\",\"#3399FF\",\"#33CC00\",\"#33CC33\",\"#33CC66\",\"#33CC99\",\"#33CCCC\",\"#33CCFF\",\"#6600CC\",\"#6600FF\",\"#6633CC\",\"#6633FF\",\"#66CC00\",\"#66CC33\",\"#9900CC\",\"#9900FF\",\"#9933CC\",\"#9933FF\",\"#99CC00\",\"#99CC33\",\"#CC0000\",\"#CC0033\",\"#CC0066\",\"#CC0099\",\"#CC00CC\",\"#CC00FF\",\"#CC3300\",\"#CC3333\",\"#CC3366\",\"#CC3399\",\"#CC33CC\",\"#CC33FF\",\"#CC6600\",\"#CC6633\",\"#CC9900\",\"#CC9933\",\"#CCCC00\",\"#CCCC33\",\"#FF0000\",\"#FF0033\",\"#FF0066\",\"#FF0099\",\"#FF00CC\",\"#FF00FF\",\"#FF3300\",\"#FF3333\",\"#FF3366\",\"#FF3399\",\"#FF33CC\",\"#FF33FF\",\"#FF6600\",\"#FF6633\",\"#FF9900\",\"#FF9933\",\"#FFCC00\",\"#FFCC33\"],n.log=console.debug||console.log||(()=>{}),t.exports=e(\"./common\")(n);const{formatters:o}=t.exports;o.j=function(e){try{return JSON.stringify(e)}catch(e){return\"[UnexpectedJSONParseError]: \"+e.message}}}).call(this)}).call(this,e(\"_process\"))},{\"./common\":5,_process:12}],5:[function(e,t){t.exports=function(t){function r(e){function t(...e){if(!t.enabled)return;const a=t,o=+new Date,i=o-(n||o);a.diff=i,a.prev=n,a.curr=o,n=o,e[0]=r.coerce(e[0]),\"string\"!=typeof e[0]&&e.unshift(\"%O\");let d=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,n)=>{if(\"%%\"===t)return\"%\";d++;const o=r.formatters[n];if(\"function\"==typeof o){const n=e[d];t=o.call(a,n),e.splice(d,1),d--}return t}),r.formatArgs.call(a,e);const s=a.log||r.log;s.apply(a,e)}let n,o=null;return t.namespace=e,t.useColors=r.useColors(),t.color=r.selectColor(e),t.extend=a,t.destroy=r.destroy,Object.defineProperty(t,\"enabled\",{enumerable:!0,configurable:!1,get:()=>null===o?r.enabled(e):o,set:e=>{o=e}}),\"function\"==typeof r.init&&r.init(t),t}function a(e,t){const n=r(this.namespace+(\"undefined\"==typeof t?\":\":t)+e);return n.log=this.log,n}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\\.\\*\\?$/,\"*\")}return r.debug=r,r.default=r,r.coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){const e=[...r.names.map(o),...r.skips.map(o).map(e=>\"-\"+e)].join(\",\");return r.enable(\"\"),e},r.enable=function(e){r.save(e),r.names=[],r.skips=[];let t;const n=(\"string\"==typeof e?e:\"\").split(/[\\s,]+/),a=n.length;for(t=0;t{r[e]=t[e]}),r.names=[],r.skips=[],r.formatters={},r.selectColor=function(e){let t=0;for(let n=0;nd&&!l.warned){l.warned=!0;var c=new Error(\"Possible EventEmitter memory leak detected. \"+l.length+\" \"+(t+\" listeners added. Use emitter.setMaxListeners() to increase limit\"));c.name=\"MaxListenersExceededWarning\",c.emitter=e,c.type=t,c.count=l.length,n(c)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function s(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=d.bind(r);return a.listener=n,r.wrapFn=a,a}function l(e,t,n){var r=e._events;if(r===void 0)return[];var a=r[t];return void 0===a?[]:\"function\"==typeof a?n?[a.listener||a]:[a]:n?f(a):u(a,a.length)}function c(e){var t=this._events;if(t!==void 0){var n=t[e];if(\"function\"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function u(e,t){for(var n=Array(t),r=0;re||y(e))throw new RangeError(\"The value of \\\"defaultMaxListeners\\\" is out of range. It must be a non-negative number. Received \"+e+\".\");C=e}}),r.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(e){if(\"number\"!=typeof e||0>e||y(e))throw new RangeError(\"The value of \\\"n\\\" is out of range. It must be a non-negative number. Received \"+e+\".\");return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return o(this)},r.prototype.emit=function(e){for(var t=[],n=1;no)return this;0===o?n.shift():p(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit(\"removeListener\",e,s||t)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(e){var t,n,r;if(n=this._events,void 0===n)return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var a,o=Object.keys(n);for(r=0;r */o.read=function(t,n,a,o,l){var c,u,p=8*l-o-1,f=(1<>1,_=-7,h=a?l-1:0,b=a?-1:1,d=t[n+h];for(h+=b,c=d&(1<<-_)-1,d>>=-_,_+=p;0<_;c=256*c+t[n+h],h+=b,_-=8);for(u=c&(1<<-_)-1,c>>=-_,_+=o;0<_;u=256*u+t[n+h],h+=b,_-=8);if(0===c)c=1-g;else{if(c===f)return u?NaN:(d?-1:1)*(1/0);u+=r(2,o),c-=g}return(d?-1:1)*u*r(2,c-o)},o.write=function(a,o,l,u,p,f){var h,b,y,g=Math.LN2,_=Math.log,C=8*f-p-1,R=(1<>1,w=23===p?r(2,-24)-r(2,-77):0,S=u?0:f-1,T=u?1:-1,d=0>o||0===o&&0>1/o?1:0;for(o=n(o),isNaN(o)||o===1/0?(b=isNaN(o)?1:0,h=R):(h=t(_(o)/g),1>o*(y=r(2,-h))&&(h--,y*=2),o+=1<=h+E?w/y:w*r(2,1-E),2<=o*y&&(h++,y/=2),h+E>=R?(b=0,h=R):1<=h+E?(b=(o*y-1)*r(2,p),h+=E):(b=o*r(2,E-1)*r(2,p),h=0));8<=p;a[l+S]=255&b,S+=T,b/=256,p-=8);for(h=h<=1.5*a?\"s\":\"\")}var l=24*(60*60000);t.exports=function(e,t){t=t||{};var n=typeof e;if(\"string\"==n&&0 */let n;t.exports=\"function\"==typeof queueMicrotask?queueMicrotask.bind(\"undefined\"==typeof window?e:window):e=>(n||(n=Promise.resolve())).then(e).catch(e=>setTimeout(()=>{throw e},0))}).call(this)}).call(this,\"undefined\"==typeof global?\"undefined\"==typeof self?\"undefined\"==typeof window?{}:window:self:global)},{}],14:[function(e,t){(function(n,r){(function(){'use strict';var a=e(\"safe-buffer\").Buffer,o=r.crypto||r.msCrypto;t.exports=o&&o.getRandomValues?function(e,t){if(e>4294967295)throw new RangeError(\"requested too many random bytes\");var r=a.allocUnsafe(e);if(0n?0:+n,t.length)===t}function i(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function d(e,t,n){return\"number\"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}var s={};r(\"ERR_INVALID_OPT_VALUE\",function(e,t){return\"The value \\\"\"+t+\"\\\" is invalid for option \\\"\"+e+\"\\\"\"},TypeError),r(\"ERR_INVALID_ARG_TYPE\",function(e,t,n){var r;\"string\"==typeof t&&o(t,\"not \")?(r=\"must not be\",t=t.replace(/^not /,\"\")):r=\"must be\";var s;if(i(e,\" argument\"))s=\"The \".concat(e,\" \").concat(r,\" \").concat(a(t,\"type\"));else{var l=d(e,\".\")?\"property\":\"argument\";s=\"The \\\"\".concat(e,\"\\\" \").concat(l,\" \").concat(r,\" \").concat(a(t,\"type\"))}return s+=\". Received type \".concat(typeof n),s},TypeError),r(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\"),r(\"ERR_METHOD_NOT_IMPLEMENTED\",function(e){return\"The \"+e+\" method is not implemented\"}),r(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\"),r(\"ERR_STREAM_DESTROYED\",function(e){return\"Cannot call \"+e+\" after a stream was destroyed\"}),r(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\"),r(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\"),r(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\"),r(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),r(\"ERR_UNKNOWN_ENCODING\",function(e){return\"Unknown encoding: \"+e},TypeError),r(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\"),t.exports.codes=s},{}],16:[function(e,t){(function(n){(function(){'use strict';function r(e){return this instanceof r?void(d.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once(\"end\",a)))):new r(e)}function a(){this._writableState.ended||n.nextTick(o,this)}function o(e){e.end()}var i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=r;var d=e(\"./_stream_readable\"),s=e(\"./_stream_writable\");e(\"inherits\")(r,d);for(var l,c=i(s.prototype),u=0;u>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function f(e,t){return 0>=e||0===t.length&&t.ended?0:t.objectMode?1:e===e?(e>t.highWaterMark&&(t.highWaterMark=p(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)):t.flowing&&t.length?t.buffer.head.data.length:t.length}function g(e,t){if(x(\"onEofChunk\"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?_(e):(t.needReadable=!1,!t.emittedReadable&&(t.emittedReadable=!0,h(e)))}}function _(e){var t=e._readableState;x(\"emitReadable\",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(x(\"emitReadable\",t.flowing),t.emittedReadable=!0,n.nextTick(h,e))}function h(e){var t=e._readableState;x(\"emitReadable_\",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit(\"readable\"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,S(e)}function m(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(b,e,t))}function b(e,t){for(;!t.reading&&!t.ended&&(t.length=t.length?(n=t.decoder?t.buffer.join(\"\"):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function v(e){var t=e._readableState;x(\"endReadable\",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(k,t,e))}function k(e,t){if(x(\"endReadableNT\",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit(\"end\"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function L(e,t){for(var n=0,r=e.length;n=t.highWaterMark)||t.ended))return x(\"read: emitReadable\",t.length,t.ended),0===t.length&&t.ended?v(this):_(this),null;if(e=f(e,t),0===e&&t.ended)return 0===t.length&&v(this),null;var a=t.needReadable;x(\"need readable\",a),(0===t.length||t.length-e>>0),n=this.head,r=0;n;)s(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:\"consume\",value:function(e,t){var n;return eo.length?o.length:e;if(a+=i===o.length?o:o.slice(0,e),e-=i,0===e){i===o.length?(++r,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=o.slice(i));break}++r}return this.length-=r,a}},{key:\"_getBuffer\",value:function(e){var t=u.allocUnsafe(e),r=this.head,a=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),e-=i,0===e){i===o.length?(++a,this.head=r.next?r.next:this.tail=null):(this.head=r,r.data=o.slice(i));break}++a}return this.length-=a,t}},{key:g,value:function(e,t){return f(this,r({},t,{depth:0,customInspect:!1}))}}]),e}()},{buffer:3,util:2}],23:[function(e,t){(function(e){(function(){'use strict';function n(e,t){a(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit(\"close\")}function a(e,t){e.emit(\"error\",t)}t.exports={destroy:function(t,o){var i=this,d=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return d||s?(o?o(t):t&&(this._writableState?!this._writableState.errorEmitted&&(this._writableState.errorEmitted=!0,e.nextTick(a,this,t)):e.nextTick(a,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!o&&t?i._writableState?i._writableState.errorEmitted?e.nextTick(r,i):(i._writableState.errorEmitted=!0,e.nextTick(n,i,t)):e.nextTick(n,i,t):o?(e.nextTick(r,i),o(t)):e.nextTick(r,i)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit(\"error\",t)}}}).call(this)}).call(this,e(\"_process\"))},{_process:12}],24:[function(e,t){'use strict';function n(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=Array(n),a=0;at.length)throw new u(\"streams\");var a,l=t.map(function(e,n){var d=nd){var s=i?o:\"highWaterMark\";throw new a(s,d)}return t(d)}return e.objectMode?16:16384}}},{\"../../../errors\":15}],28:[function(e,t){t.exports=e(\"events\").EventEmitter},{events:7}],29:[function(e,t,n){n=t.exports=e(\"./lib/_stream_readable.js\"),n.Stream=n,n.Readable=n,n.Writable=e(\"./lib/_stream_writable.js\"),n.Duplex=e(\"./lib/_stream_duplex.js\"),n.Transform=e(\"./lib/_stream_transform.js\"),n.PassThrough=e(\"./lib/_stream_passthrough.js\"),n.finished=e(\"./lib/internal/streams/end-of-stream.js\"),n.pipeline=e(\"./lib/internal/streams/pipeline.js\")},{\"./lib/_stream_duplex.js\":16,\"./lib/_stream_passthrough.js\":17,\"./lib/_stream_readable.js\":18,\"./lib/_stream_transform.js\":19,\"./lib/_stream_writable.js\":20,\"./lib/internal/streams/end-of-stream.js\":24,\"./lib/internal/streams/pipeline.js\":26}],30:[function(e,t,n){function r(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}/*! safe-buffer. MIT License. Feross Aboukhadijeh */var o=e(\"buffer\"),i=o.Buffer;i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=o:(r(o,n),n.Buffer=a),a.prototype=Object.create(i.prototype),r(i,a),a.from=function(e,t,n){if(\"number\"==typeof e)throw new TypeError(\"Argument must not be a number\");return i(e,t,n)},a.alloc=function(e,t,n){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");var r=i(e);return void 0===t?r.fill(0):\"string\"==typeof n?r.fill(t,n):r.fill(t),r},a.allocUnsafe=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return i(e)},a.allocUnsafeSlow=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return o.SlowBuffer(e)}},{buffer:3}],31:[function(e,t,n){'use strict';function r(e){if(!e)return\"utf8\";for(var t;;)switch(e){case\"utf8\":case\"utf-8\":return\"utf8\";case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return\"utf16le\";case\"latin1\":case\"binary\":return\"latin1\";case\"base64\":case\"ascii\":case\"hex\":return e;default:if(t)return;e=(\"\"+e).toLowerCase(),t=!0;}}function a(e){var t=r(e);if(\"string\"!=typeof t&&(m.isEncoding===b||!b(e)))throw new Error(\"Unknown encoding: \"+e);return t||e}function o(e){this.encoding=a(e);var t;switch(this.encoding){case\"utf16le\":this.text=u,this.end=p,t=4;break;case\"utf8\":this.fillLast=c,t=4;break;case\"base64\":this.text=f,this.end=g,t=3;break;default:return this.write=_,void(this.end=h);}this.lastNeed=0,this.lastTotal=0,this.lastChar=m.allocUnsafe(t)}function d(e){if(127>=e)return 0;return 6==e>>5?2:14==e>>4?3:30==e>>3?4:2==e>>6?-1:-2}function s(e,t,n){var r=t.length-1;if(r=r)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(\"utf16le\",t,e.length-1)}function p(e){var t=e&&e.length?this.write(e):\"\";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(\"utf16le\",0,n)}return t}function f(e,t){var r=(e.length-t)%3;return 0==r?e.toString(\"base64\",t):(this.lastNeed=3-r,this.lastTotal=3,1==r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(\"base64\",t,e.length-r))}function g(e){var t=e&&e.length?this.write(e):\"\";return this.lastNeed?t+this.lastChar.toString(\"base64\",0,3-this.lastNeed):t}function _(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):\"\"}var m=e(\"safe-buffer\").Buffer,b=m.isEncoding||function(e){switch(e=\"\"+e,e&&e.toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":case\"raw\":return!0;default:return!1;}};n.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return\"\";var t,n;if(this.lastNeed){if(t=this.fillLast(e),void 0===t)return\"\";n=this.lastNeed,this.lastNeed=0}else n=0;return n */const a=e(\"debug\")(\"simple-peer\"),o=e(\"get-browser-rtc\"),i=e(\"randombytes\"),d=e(\"readable-stream\"),s=e(\"queue-microtask\"),l=e(\"err-code\"),{Buffer:c}=e(\"buffer\"),u=65536;class p extends d.Duplex{constructor(e){if(e=Object.assign({allowHalfOpen:!1},e),super(e),this._id=i(4).toString(\"hex\").slice(0,7),this._debug(\"new peer %o\",e),this.channelName=e.initiator?e.channelName||i(20).toString(\"hex\"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||p.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},p.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.iceCompleteTimeout||5000,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&\"object\"==typeof e.wrtc?e.wrtc:o(),!this._wrtc)if(\"undefined\"==typeof window)throw l(new Error(\"No WebRTC support: Specify `opts.wrtc` option in this environment\"),\"ERR_WEBRTC_SUPPORT\");else throw l(new Error(\"No WebRTC support: Not a supported browser\"),\"ERR_WEBRTC_SUPPORT\");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e){return void this.destroy(l(e,\"ERR_PC_CONSTRUCTOR\"))}this._isReactNativeWebrtc=\"number\"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e=>{this._onIceCandidate(e)},\"object\"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch(e=>{this.destroy(l(e,\"ERR_PC_PEER_IDENTITY\"))}),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach(e=>{this.addStream(e)}),this._pc.ontrack=e=>{this._onTrack(e)},this._debug(\"initial negotiation\"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once(\"finish\",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&\"open\"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot signal after peer is destroyed\"),\"ERR_DESTROYED\");if(\"string\"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug(\"signal()\"),e.renegotiate&&this.initiator&&(this._debug(\"got request to renegotiate\"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug(\"got request for transceiver\"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then(()=>{this.destroyed||(this._pendingCandidates.forEach(e=>{this._addIceCandidate(e)}),this._pendingCandidates=[],\"offer\"===this._pc.remoteDescription.type&&this._createAnswer())}).catch(e=>{this.destroy(l(e,\"ERR_SET_REMOTE_DESCRIPTION\"))}),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(l(new Error(\"signal() called with invalid signal data\"),\"ERR_SIGNALING\"))}}_addIceCandidate(e){const t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch(e=>{!t.address||t.address.endsWith(\".local\")?r(\"Ignoring unsupported ICE candidate.\"):this.destroy(l(e,\"ERR_ADD_ICE_CANDIDATE\"))})}send(e){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot send after peer is destroyed\"),\"ERR_DESTROYED\");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot addTransceiver after peer is destroyed\"),\"ERR_DESTROYED\");if(this._debug(\"addTransceiver()\"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(l(e,\"ERR_ADD_TRANSCEIVER\"))}else this.emit(\"signal\",{type:\"transceiverRequest\",transceiverRequest:{kind:e,init:t}})}}addStream(e){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot addStream after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"addStream()\"),e.getTracks().forEach(t=>{this.addTrack(t,e)})}}addTrack(e,t){if(this.destroying)return;if(this.destroyed)throw l(new Error(\"cannot addTrack after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"addTrack()\");const n=this._senderMap.get(e)||new Map;let r=n.get(t);if(!r)r=this._pc.addTrack(e,t),n.set(t,r),this._senderMap.set(e,n),this._needsNegotiation();else if(r.removed)throw l(new Error(\"Track has been removed. You should enable/disable tracks that you want to re-add.\"),\"ERR_SENDER_REMOVED\");else throw l(new Error(\"Track has already been added to that stream.\"),\"ERR_SENDER_ALREADY_ADDED\")}replaceTrack(e,t,n){if(this.destroying)return;if(this.destroyed)throw l(new Error(\"cannot replaceTrack after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"replaceTrack()\");const r=this._senderMap.get(e),a=r?r.get(n):null;if(!a)throw l(new Error(\"Cannot replace track that was never added.\"),\"ERR_TRACK_NOT_ADDED\");t&&this._senderMap.set(t,r),null==a.replaceTrack?this.destroy(l(new Error(\"replaceTrack is not supported in this browser\"),\"ERR_UNSUPPORTED_REPLACETRACK\")):a.replaceTrack(t)}removeTrack(e,t){if(this.destroying)return;if(this.destroyed)throw l(new Error(\"cannot removeTrack after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"removeSender()\");const n=this._senderMap.get(e),r=n?n.get(t):null;if(!r)throw l(new Error(\"Cannot remove track that was never added.\"),\"ERR_TRACK_NOT_ADDED\");try{r.removed=!0,this._pc.removeTrack(r)}catch(e){\"NS_ERROR_UNEXPECTED\"===e.name?this._sendersAwaitingStable.push(r):this.destroy(l(e,\"ERR_REMOVE_TRACK\"))}this._needsNegotiation()}removeStream(e){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot removeStream after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"removeSenders()\"),e.getTracks().forEach(t=>{this.removeTrack(t,e)})}}_needsNegotiation(){this._debug(\"_needsNegotiation\"),this._batchedNegotiation||(this._batchedNegotiation=!0,s(()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug(\"starting batched negotiation\"),this.negotiate()):this._debug(\"non-initiator initial negotiation request discarded\"),this._firstNegotiation=!1}))}negotiate(){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot negotiate after peer is destroyed\"),\"ERR_DESTROYED\");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug(\"already negotiating, queueing\")):(this._debug(\"start negotiation\"),setTimeout(()=>{this._createOffer()},0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug(\"already negotiating, queueing\")):(this._debug(\"requesting negotiation from initiator\"),this.emit(\"signal\",{type:\"renegotiate\",renegotiate:!0})),this._isNegotiating=!0}}destroy(e){this._destroy(e,()=>{})}_destroy(e,t){this.destroyed||this.destroying||(this.destroying=!0,this._debug(\"destroying (error: %s)\",e&&(e.message||e)),s(()=>{if(this.destroyed=!0,this.destroying=!1,this._debug(\"destroy (error: %s)\",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener(\"finish\",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch(e){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(e){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,e&&this.emit(\"error\",e),this.emit(\"close\"),t()}))}_setupData(e){if(!e.channel)return this.destroy(l(new Error(\"Data channel event is missing `channel` property\"),\"ERR_DATA_CHANNEL\"));this._channel=e.channel,this._channel.binaryType=\"arraybuffer\",\"number\"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=u),this.channelName=this._channel.label,this._channel.onmessage=e=>{this._onChannelMessage(e)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=e=>{const t=e.error instanceof Error?e.error:new Error(`Datachannel error: ${e.message} ${e.filename}:${e.lineno}:${e.colno}`);this.destroy(l(t,\"ERR_DATA_CHANNEL\"))};let t=!1;this._closingInterval=setInterval(()=>{this._channel&&\"closing\"===this._channel.readyState?(t&&this._onChannelClose(),t=!0):t=!1},5000)}_read(){}_write(e,t,n){if(this.destroyed)return n(l(new Error(\"cannot write after peer is destroyed\"),\"ERR_DATA_CHANNEL\"));if(this._connected){try{this.send(e)}catch(e){return this.destroy(l(e,\"ERR_DATA_CHANNEL\"))}this._channel.bufferedAmount>u?(this._debug(\"start backpressure: bufferedAmount %d\",this._channel.bufferedAmount),this._cb=n):n(null)}else this._debug(\"write before connect\"),this._chunk=e,this._cb=n}_onFinish(){if(!this.destroyed){const e=()=>{setTimeout(()=>this.destroy(),1e3)};this._connected?e():this.once(\"connect\",e)}}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug(\"started iceComplete timeout\"),this._iceCompleteTimer=setTimeout(()=>{this._iceComplete||(this._iceComplete=!0,this._debug(\"iceComplete timeout completed\"),this.emit(\"iceTimeout\"),this.emit(\"_iceComplete\"))},this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then(e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=n(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(!this.destroyed){const t=this._pc.localDescription||e;this._debug(\"signal\"),this.emit(\"signal\",{type:t.type,sdp:t.sdp})}};this._pc.setLocalDescription(e).then(()=>{this._debug(\"createOffer success\"),this.destroyed||(this.trickle||this._iceComplete?t():this.once(\"_iceComplete\",t))}).catch(e=>{this.destroy(l(e,\"ERR_SET_LOCAL_DESCRIPTION\"))})}).catch(e=>{this.destroy(l(e,\"ERR_CREATE_OFFER\"))})}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach(e=>{e.mid||!e.sender.track||e.requested||(e.requested=!0,this.addTransceiver(e.sender.track.kind))})}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then(e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=n(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(!this.destroyed){const t=this._pc.localDescription||e;this._debug(\"signal\"),this.emit(\"signal\",{type:t.type,sdp:t.sdp}),this.initiator||this._requestMissingTransceivers()}};this._pc.setLocalDescription(e).then(()=>{this.destroyed||(this.trickle||this._iceComplete?t():this.once(\"_iceComplete\",t))}).catch(e=>{this.destroy(l(e,\"ERR_SET_LOCAL_DESCRIPTION\"))})}).catch(e=>{this.destroy(l(e,\"ERR_CREATE_ANSWER\"))})}_onConnectionStateChange(){this.destroyed||\"failed\"===this._pc.connectionState&&this.destroy(l(new Error(\"Connection failed.\"),\"ERR_CONNECTION_FAILURE\"))}_onIceStateChange(){if(this.destroyed)return;const e=this._pc.iceConnectionState,t=this._pc.iceGatheringState;this._debug(\"iceStateChange (connection: %s) (gathering: %s)\",e,t),this.emit(\"iceStateChange\",e,t),(\"connected\"===e||\"completed\"===e)&&(this._pcReady=!0,this._maybeReady()),\"failed\"===e&&this.destroy(l(new Error(\"Ice connection failed.\"),\"ERR_ICE_CONNECTION_FAILURE\")),\"closed\"===e&&this.destroy(l(new Error(\"Ice connection closed.\"),\"ERR_ICE_CONNECTION_CLOSED\"))}getStats(e){const t=e=>(\"[object Array]\"===Object.prototype.toString.call(e.values)&&e.values.forEach(t=>{Object.assign(e,t)}),e);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then(n=>{const r=[];n.forEach(e=>{r.push(t(e))}),e(null,r)},t=>e(t)):0{if(this.destroyed)return;const r=[];n.result().forEach(e=>{const n={};e.names().forEach(t=>{n[t]=e.stat(t)}),n.id=e.id,n.type=e.type,n.timestamp=e.timestamp,r.push(t(n))}),e(null,r)},t=>e(t)):e(null,[])}_maybeReady(){if(this._debug(\"maybeReady pc %s channel %s\",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const e=()=>{this.destroyed||this.getStats((t,n)=>{if(this.destroyed)return;t&&(n=[]);const r={},a={},o={};let i=!1;n.forEach(e=>{(\"remotecandidate\"===e.type||\"remote-candidate\"===e.type)&&(r[e.id]=e),(\"localcandidate\"===e.type||\"local-candidate\"===e.type)&&(a[e.id]=e),(\"candidatepair\"===e.type||\"candidate-pair\"===e.type)&&(o[e.id]=e)});const d=e=>{i=!0;let t=a[e.localCandidateId];t&&(t.ip||t.address)?(this.localAddress=t.ip||t.address,this.localPort=+t.port):t&&t.ipAddress?(this.localAddress=t.ipAddress,this.localPort=+t.portNumber):\"string\"==typeof e.googLocalAddress&&(t=e.googLocalAddress.split(\":\"),this.localAddress=t[0],this.localPort=+t[1]),this.localAddress&&(this.localFamily=this.localAddress.includes(\":\")?\"IPv6\":\"IPv4\");let n=r[e.remoteCandidateId];n&&(n.ip||n.address)?(this.remoteAddress=n.ip||n.address,this.remotePort=+n.port):n&&n.ipAddress?(this.remoteAddress=n.ipAddress,this.remotePort=+n.portNumber):\"string\"==typeof e.googRemoteAddress&&(n=e.googRemoteAddress.split(\":\"),this.remoteAddress=n[0],this.remotePort=+n[1]),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(\":\")?\"IPv6\":\"IPv4\"),this._debug(\"connect local: %s:%s remote: %s:%s\",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(n.forEach(e=>{\"transport\"===e.type&&e.selectedCandidatePairId&&d(o[e.selectedCandidatePairId]),(\"googCandidatePair\"===e.type&&\"true\"===e.googActiveConnection||(\"candidatepair\"===e.type||\"candidate-pair\"===e.type)&&e.selected)&&d(e)}),!i&&(!Object.keys(o).length||Object.keys(a).length))return void setTimeout(e,100);if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(e){return this.destroy(l(e,\"ERR_DATA_CHANNEL\"))}this._chunk=null,this._debug(\"sent chunk from \\\"write before connect\\\"\");const e=this._cb;this._cb=null,e(null)}\"number\"!=typeof this._channel.bufferedAmountLowThreshold&&(this._interval=setInterval(()=>this._onInterval(),150),this._interval.unref&&this._interval.unref()),this._debug(\"connect\"),this.emit(\"connect\")})};e()}_onInterval(){this._cb&&this._channel&&!(this._channel.bufferedAmount>u)&&this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||(\"stable\"===this._pc.signalingState&&(this._isNegotiating=!1,this._debug(\"flushing sender queue\",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach(e=>{this._pc.removeTrack(e),this._queuedNegotiation=!0}),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug(\"flushing negotiation queue\"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug(\"negotiated\"),this.emit(\"negotiated\"))),this._debug(\"signalingStateChange %s\",this._pc.signalingState),this.emit(\"signalingStateChange\",this._pc.signalingState))}_onIceCandidate(e){this.destroyed||(e.candidate&&this.trickle?this.emit(\"signal\",{type:\"candidate\",candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):!e.candidate&&!this._iceComplete&&(this._iceComplete=!0,this.emit(\"_iceComplete\")),e.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=c.from(t)),this.push(t)}_onChannelBufferedAmountLow(){if(!this.destroyed&&this._cb){this._debug(\"ending backpressure: bufferedAmount %d\",this._channel.bufferedAmount);const e=this._cb;this._cb=null,e(null)}}_onChannelOpen(){this._connected||this.destroyed||(this._debug(\"on channel open\"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug(\"on channel close\"),this.destroy())}_onTrack(e){this.destroyed||e.streams.forEach(t=>{this._debug(\"on track\"),this.emit(\"track\",e.track,t),this._remoteTracks.push({track:e.track,stream:t}),this._remoteStreams.some(e=>e.id===t.id)||(this._remoteStreams.push(t),s(()=>{this._debug(\"on stream\"),this.emit(\"stream\",t)}))})}_debug(){const e=[].slice.call(arguments);e[0]=\"[\"+this._id+\"] \"+e[0],a.apply(null,e)}}p.WEBRTC_SUPPORT=!!o(),p.config={iceServers:[{urls:[\"stun:stun.l.google.com:19302\",\"stun:global.stun.twilio.com:3478\"]}],sdpSemantics:\"unified-plan\"},p.channelConfig={},t.exports=p},{buffer:3,debug:4,\"err-code\":6,\"get-browser-rtc\":8,\"queue-microtask\":13,randombytes:14,\"readable-stream\":29}]},{},[])(\"/\")});", "/**\n * @module sync-protocol\n */\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as Y from 'yjs'\n\n/**\n * @typedef {Map} StateMap\n */\n\n/**\n * Core Yjs defines two message types:\n * \u2022 YjsSyncStep1: Includes the State Set of the sending client. When received, the client should reply with YjsSyncStep2.\n * \u2022 YjsSyncStep2: Includes all missing structs and the complete delete set. When received, the client is assured that it\n * received all information from the remote client.\n *\n * In a peer-to-peer network, you may want to introduce a SyncDone message type. Both parties should initiate the connection\n * with SyncStep1. When a client received SyncStep2, it should reply with SyncDone. When the local client received both\n * SyncStep2 and SyncDone, it is assured that it is synced to the remote client.\n *\n * In a client-server model, you want to handle this differently: The client should initiate the connection with SyncStep1.\n * When the server receives SyncStep1, it should reply with SyncStep2 immediately followed by SyncStep1. The client replies\n * with SyncStep2 when it receives SyncStep1. Optionally the server may send a SyncDone after it received SyncStep2, so the\n * client knows that the sync is finished. There are two reasons for this more elaborated sync model: 1. This protocol can\n * easily be implemented on top of http and websockets. 2. The server should only reply to requests, and not initiate them.\n * Therefore it is necessary that the client initiates the sync.\n *\n * Construction of a message:\n * [messageType : varUint, message definition..]\n *\n * Note: A message does not include information about the room name. This must to be handled by the upper layer protocol!\n *\n * stringify[messageType] stringifies a message definition (messageType is already read from the bufffer)\n */\n\nexport const messageYjsSyncStep1 = 0\nexport const messageYjsSyncStep2 = 1\nexport const messageYjsUpdate = 2\n\n/**\n * Create a sync step 1 message based on the state of the current shared document.\n *\n * @param {encoding.Encoder} encoder\n * @param {Y.Doc} doc\n */\nexport const writeSyncStep1 = (encoder, doc) => {\n encoding.writeVarUint(encoder, messageYjsSyncStep1)\n const sv = Y.encodeStateVector(doc)\n encoding.writeVarUint8Array(encoder, sv)\n}\n\n/**\n * @param {encoding.Encoder} encoder\n * @param {Y.Doc} doc\n * @param {Uint8Array} [encodedStateVector]\n */\nexport const writeSyncStep2 = (encoder, doc, encodedStateVector) => {\n encoding.writeVarUint(encoder, messageYjsSyncStep2)\n encoding.writeVarUint8Array(encoder, Y.encodeStateAsUpdate(doc, encodedStateVector))\n}\n\n/**\n * Read SyncStep1 message and reply with SyncStep2.\n *\n * @param {decoding.Decoder} decoder The reply to the received message\n * @param {encoding.Encoder} encoder The received message\n * @param {Y.Doc} doc\n */\nexport const readSyncStep1 = (decoder, encoder, doc) =>\n writeSyncStep2(encoder, doc, decoding.readVarUint8Array(decoder))\n\n/**\n * Read and apply Structs and then DeleteStore to a y instance.\n *\n * @param {decoding.Decoder} decoder\n * @param {Y.Doc} doc\n * @param {any} transactionOrigin\n */\nexport const readSyncStep2 = (decoder, doc, transactionOrigin) => {\n try {\n Y.applyUpdate(doc, decoding.readVarUint8Array(decoder), transactionOrigin)\n } catch (error) {\n // This catches errors that are thrown by event handlers\n console.error('Caught error while handling a Yjs update', error)\n }\n}\n\n/**\n * @param {encoding.Encoder} encoder\n * @param {Uint8Array} update\n */\nexport const writeUpdate = (encoder, update) => {\n encoding.writeVarUint(encoder, messageYjsUpdate)\n encoding.writeVarUint8Array(encoder, update)\n}\n\n/**\n * Read and apply Structs and then DeleteStore to a y instance.\n *\n * @param {decoding.Decoder} decoder\n * @param {Y.Doc} doc\n * @param {any} transactionOrigin\n */\nexport const readUpdate = readSyncStep2\n\n/**\n * @param {decoding.Decoder} decoder A message received from another client\n * @param {encoding.Encoder} encoder The reply message. Does not need to be sent if empty.\n * @param {Y.Doc} doc\n * @param {any} transactionOrigin\n */\nexport const readSyncMessage = (decoder, encoder, doc, transactionOrigin) => {\n const messageType = decoding.readVarUint(decoder)\n switch (messageType) {\n case messageYjsSyncStep1:\n readSyncStep1(decoder, encoder, doc)\n break\n case messageYjsSyncStep2:\n readSyncStep2(decoder, doc, transactionOrigin)\n break\n case messageYjsUpdate:\n readUpdate(decoder, doc, transactionOrigin)\n break\n default:\n throw new Error('Unknown message type')\n }\n return messageType\n}\n", "/* eslint-env browser */\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as promise from 'lib0/promise'\nimport * as error from 'lib0/error'\nimport * as string from 'lib0/string'\n\n/**\n * @param {string} secret\n * @param {string} roomName\n * @return {PromiseLike}\n */\nexport const deriveKey = (secret, roomName) => {\n const secretBuffer = string.encodeUtf8(secret).buffer\n const salt = string.encodeUtf8(roomName).buffer\n return crypto.subtle.importKey(\n 'raw',\n secretBuffer,\n 'PBKDF2',\n false,\n ['deriveKey']\n ).then(keyMaterial =>\n crypto.subtle.deriveKey(\n {\n name: 'PBKDF2',\n salt,\n iterations: 100000,\n hash: 'SHA-256'\n },\n keyMaterial,\n {\n name: 'AES-GCM',\n length: 256\n },\n true,\n ['encrypt', 'decrypt']\n )\n )\n}\n\n/**\n * @param {Uint8Array} data data to be encrypted\n * @param {CryptoKey?} key\n * @return {PromiseLike} encrypted, base64 encoded message\n */\nexport const encrypt = (data, key) => {\n if (!key) {\n return /** @type {PromiseLike} */ (promise.resolve(data))\n }\n const iv = crypto.getRandomValues(new Uint8Array(12))\n return crypto.subtle.encrypt(\n {\n name: 'AES-GCM',\n iv\n },\n key,\n data\n ).then(cipher => {\n const encryptedDataEncoder = encoding.createEncoder()\n encoding.writeVarString(encryptedDataEncoder, 'AES-GCM')\n encoding.writeVarUint8Array(encryptedDataEncoder, iv)\n encoding.writeVarUint8Array(encryptedDataEncoder, new Uint8Array(cipher))\n return encoding.toUint8Array(encryptedDataEncoder)\n })\n}\n\n/**\n * @param {Object} data data to be encrypted\n * @param {CryptoKey?} key\n * @return {PromiseLike} encrypted data, if key is provided\n */\nexport const encryptJson = (data, key) => {\n const dataEncoder = encoding.createEncoder()\n encoding.writeAny(dataEncoder, data)\n return encrypt(encoding.toUint8Array(dataEncoder), key)\n}\n\n/**\n * @param {Uint8Array} data\n * @param {CryptoKey?} key\n * @return {PromiseLike} decrypted buffer\n */\nexport const decrypt = (data, key) => {\n if (!key) {\n return /** @type {PromiseLike} */ (promise.resolve(data))\n }\n const dataDecoder = decoding.createDecoder(data)\n const algorithm = decoding.readVarString(dataDecoder)\n if (algorithm !== 'AES-GCM') {\n promise.reject(error.create('Unknown encryption algorithm'))\n }\n const iv = decoding.readVarUint8Array(dataDecoder)\n const cipher = decoding.readVarUint8Array(dataDecoder)\n return crypto.subtle.decrypt(\n {\n name: 'AES-GCM',\n iv\n },\n key,\n cipher\n ).then(data => new Uint8Array(data))\n}\n\n/**\n * @param {Uint8Array} data\n * @param {CryptoKey?} key\n * @return {PromiseLike} decrypted object\n */\nexport const decryptJson = (data, key) =>\n decrypt(data, key).then(decryptedValue =>\n decoding.readAny(decoding.createDecoder(new Uint8Array(decryptedValue)))\n )\n", "import * as ws from 'lib0/websocket'\nimport * as map from 'lib0/map'\nimport * as error from 'lib0/error'\nimport * as random from 'lib0/random'\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport { ObservableV2 } from 'lib0/observable'\nimport * as logging from 'lib0/logging'\nimport * as promise from 'lib0/promise'\nimport * as bc from 'lib0/broadcastchannel'\nimport * as buffer from 'lib0/buffer'\nimport * as math from 'lib0/math'\nimport { createMutex } from 'lib0/mutex'\n\nimport * as Y from 'yjs' // eslint-disable-line\nimport Peer from 'simple-peer/simplepeer.min.js'\n\nimport * as syncProtocol from 'y-protocols/sync'\nimport * as awarenessProtocol from 'y-protocols/awareness'\n\nimport * as cryptoutils from './crypto.js'\n\nconst log = logging.createModuleLogger('y-webrtc')\n\nconst messageSync = 0\nconst messageQueryAwareness = 3\nconst messageAwareness = 1\nconst messageBcPeerId = 4\n\n/**\n * @type {Map}\n */\nconst signalingConns = new Map()\n\n/**\n * @type {Map}\n */\nconst rooms = new Map()\n\n/**\n * @param {Room} room\n */\nconst checkIsSynced = room => {\n let synced = true\n room.webrtcConns.forEach(peer => {\n if (!peer.synced) {\n synced = false\n }\n })\n if ((!synced && room.synced) || (synced && !room.synced)) {\n room.synced = synced\n room.provider.emit('synced', [{ synced }])\n log('synced ', logging.BOLD, room.name, logging.UNBOLD, ' with all peers')\n }\n}\n\n/**\n * @param {Room} room\n * @param {Uint8Array} buf\n * @param {function} syncedCallback\n * @return {encoding.Encoder?}\n */\nconst readMessage = (room, buf, syncedCallback) => {\n const decoder = decoding.createDecoder(buf)\n const encoder = encoding.createEncoder()\n const messageType = decoding.readVarUint(decoder)\n if (room === undefined) {\n return null\n }\n const awareness = room.awareness\n const doc = room.doc\n let sendReply = false\n switch (messageType) {\n case messageSync: {\n encoding.writeVarUint(encoder, messageSync)\n const syncMessageType = syncProtocol.readSyncMessage(decoder, encoder, doc, room)\n if (syncMessageType === syncProtocol.messageYjsSyncStep2 && !room.synced) {\n syncedCallback()\n }\n if (syncMessageType === syncProtocol.messageYjsSyncStep1) {\n sendReply = true\n }\n break\n }\n case messageQueryAwareness:\n encoding.writeVarUint(encoder, messageAwareness)\n encoding.writeVarUint8Array(encoder, awarenessProtocol.encodeAwarenessUpdate(awareness, Array.from(awareness.getStates().keys())))\n sendReply = true\n break\n case messageAwareness:\n awarenessProtocol.applyAwarenessUpdate(awareness, decoding.readVarUint8Array(decoder), room)\n break\n case messageBcPeerId: {\n const add = decoding.readUint8(decoder) === 1\n const peerName = decoding.readVarString(decoder)\n if (peerName !== room.peerId && ((room.bcConns.has(peerName) && !add) || (!room.bcConns.has(peerName) && add))) {\n const removed = []\n const added = []\n if (add) {\n room.bcConns.add(peerName)\n added.push(peerName)\n } else {\n room.bcConns.delete(peerName)\n removed.push(peerName)\n }\n room.provider.emit('peers', [{\n added,\n removed,\n webrtcPeers: Array.from(room.webrtcConns.keys()),\n bcPeers: Array.from(room.bcConns)\n }])\n broadcastBcPeerId(room)\n }\n break\n }\n default:\n console.error('Unable to compute message')\n return encoder\n }\n if (!sendReply) {\n // nothing has been written, no answer created\n return null\n }\n return encoder\n}\n\n/**\n * @param {WebrtcConn} peerConn\n * @param {Uint8Array} buf\n * @return {encoding.Encoder?}\n */\nconst readPeerMessage = (peerConn, buf) => {\n const room = peerConn.room\n log('received message from ', logging.BOLD, peerConn.remotePeerId, logging.GREY, ' (', room.name, ')', logging.UNBOLD, logging.UNCOLOR)\n return readMessage(room, buf, () => {\n peerConn.synced = true\n log('synced ', logging.BOLD, room.name, logging.UNBOLD, ' with ', logging.BOLD, peerConn.remotePeerId)\n checkIsSynced(room)\n })\n}\n\n/**\n * @param {WebrtcConn} webrtcConn\n * @param {encoding.Encoder} encoder\n */\nconst sendWebrtcConn = (webrtcConn, encoder) => {\n log('send message to ', logging.BOLD, webrtcConn.remotePeerId, logging.UNBOLD, logging.GREY, ' (', webrtcConn.room.name, ')', logging.UNCOLOR)\n try {\n webrtcConn.peer.send(encoding.toUint8Array(encoder))\n } catch (e) {}\n}\n\n/**\n * @param {Room} room\n * @param {Uint8Array} m\n */\nconst broadcastWebrtcConn = (room, m) => {\n log('broadcast message in ', logging.BOLD, room.name, logging.UNBOLD)\n room.webrtcConns.forEach(conn => {\n try {\n conn.peer.send(m)\n } catch (e) {}\n })\n}\n\nexport class WebrtcConn {\n /**\n * @param {SignalingConn} signalingConn\n * @param {boolean} initiator\n * @param {string} remotePeerId\n * @param {Room} room\n */\n constructor (signalingConn, initiator, remotePeerId, room) {\n log('establishing connection to ', logging.BOLD, remotePeerId)\n this.room = room\n this.remotePeerId = remotePeerId\n this.glareToken = undefined\n this.closed = false\n this.connected = false\n this.synced = false\n /**\n * @type {any}\n */\n this.peer = new Peer({ initiator, ...room.provider.peerOpts })\n this.peer.on('signal', signal => {\n if (this.glareToken === undefined) {\n // add some randomness to the timestamp of the offer\n this.glareToken = Date.now() + Math.random()\n }\n publishSignalingMessage(signalingConn, room, { to: remotePeerId, from: room.peerId, type: 'signal', token: this.glareToken, signal })\n })\n this.peer.on('connect', () => {\n log('connected to ', logging.BOLD, remotePeerId)\n this.connected = true\n // send sync step 1\n const provider = room.provider\n const doc = provider.doc\n const awareness = room.awareness\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, messageSync)\n syncProtocol.writeSyncStep1(encoder, doc)\n sendWebrtcConn(this, encoder)\n const awarenessStates = awareness.getStates()\n if (awarenessStates.size > 0) {\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, messageAwareness)\n encoding.writeVarUint8Array(encoder, awarenessProtocol.encodeAwarenessUpdate(awareness, Array.from(awarenessStates.keys())))\n sendWebrtcConn(this, encoder)\n }\n })\n this.peer.on('close', () => {\n this.connected = false\n this.closed = true\n if (room.webrtcConns.has(this.remotePeerId)) {\n room.webrtcConns.delete(this.remotePeerId)\n room.provider.emit('peers', [{\n removed: [this.remotePeerId],\n added: [],\n webrtcPeers: Array.from(room.webrtcConns.keys()),\n bcPeers: Array.from(room.bcConns)\n }])\n }\n checkIsSynced(room)\n this.peer.destroy()\n log('closed connection to ', logging.BOLD, remotePeerId)\n announceSignalingInfo(room)\n })\n this.peer.on('error', err => {\n log('Error in connection to ', logging.BOLD, remotePeerId, ': ', err)\n announceSignalingInfo(room)\n })\n this.peer.on('data', data => {\n const answer = readPeerMessage(this, data)\n if (answer !== null) {\n sendWebrtcConn(this, answer)\n }\n })\n }\n\n destroy () {\n this.peer.destroy()\n }\n}\n\n/**\n * @param {Room} room\n * @param {Uint8Array} m\n */\nconst broadcastBcMessage = (room, m) => cryptoutils.encrypt(m, room.key).then(data =>\n room.mux(() =>\n bc.publish(room.name, data)\n )\n)\n\n/**\n * @param {Room} room\n * @param {Uint8Array} m\n */\nconst broadcastRoomMessage = (room, m) => {\n if (room.bcconnected) {\n broadcastBcMessage(room, m)\n }\n broadcastWebrtcConn(room, m)\n}\n\n/**\n * @param {Room} room\n */\nconst announceSignalingInfo = room => {\n signalingConns.forEach(conn => {\n // only subscribe if connection is established, otherwise the conn automatically subscribes to all rooms\n if (conn.connected) {\n conn.send({ type: 'subscribe', topics: [room.name] })\n if (room.webrtcConns.size < room.provider.maxConns) {\n publishSignalingMessage(conn, room, { type: 'announce', from: room.peerId })\n }\n }\n })\n}\n\n/**\n * @param {Room} room\n */\nconst broadcastBcPeerId = room => {\n if (room.provider.filterBcConns) {\n // broadcast peerId via broadcastchannel\n const encoderPeerIdBc = encoding.createEncoder()\n encoding.writeVarUint(encoderPeerIdBc, messageBcPeerId)\n encoding.writeUint8(encoderPeerIdBc, 1)\n encoding.writeVarString(encoderPeerIdBc, room.peerId)\n broadcastBcMessage(room, encoding.toUint8Array(encoderPeerIdBc))\n }\n}\n\nexport class Room {\n /**\n * @param {Y.Doc} doc\n * @param {WebrtcProvider} provider\n * @param {string} name\n * @param {CryptoKey|null} key\n */\n constructor (doc, provider, name, key) {\n /**\n * Do not assume that peerId is unique. This is only meant for sending signaling messages.\n *\n * @type {string}\n */\n this.peerId = random.uuidv4()\n this.doc = doc\n /**\n * @type {awarenessProtocol.Awareness}\n */\n this.awareness = provider.awareness\n this.provider = provider\n this.synced = false\n this.name = name\n // @todo make key secret by scoping\n this.key = key\n /**\n * @type {Map}\n */\n this.webrtcConns = new Map()\n /**\n * @type {Set}\n */\n this.bcConns = new Set()\n this.mux = createMutex()\n this.bcconnected = false\n /**\n * @param {ArrayBuffer} data\n */\n this._bcSubscriber = data =>\n cryptoutils.decrypt(new Uint8Array(data), key).then(m =>\n this.mux(() => {\n const reply = readMessage(this, m, () => {})\n if (reply) {\n broadcastBcMessage(this, encoding.toUint8Array(reply))\n }\n })\n )\n /**\n * Listens to Yjs updates and sends them to remote peers\n *\n * @param {Uint8Array} update\n * @param {any} _origin\n */\n this._docUpdateHandler = (update, _origin) => {\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, messageSync)\n syncProtocol.writeUpdate(encoder, update)\n broadcastRoomMessage(this, encoding.toUint8Array(encoder))\n }\n /**\n * Listens to Awareness updates and sends them to remote peers\n *\n * @param {any} changed\n * @param {any} _origin\n */\n this._awarenessUpdateHandler = ({ added, updated, removed }, _origin) => {\n const changedClients = added.concat(updated).concat(removed)\n const encoderAwareness = encoding.createEncoder()\n encoding.writeVarUint(encoderAwareness, messageAwareness)\n encoding.writeVarUint8Array(encoderAwareness, awarenessProtocol.encodeAwarenessUpdate(this.awareness, changedClients))\n broadcastRoomMessage(this, encoding.toUint8Array(encoderAwareness))\n }\n\n this._beforeUnloadHandler = () => {\n awarenessProtocol.removeAwarenessStates(this.awareness, [doc.clientID], 'window unload')\n rooms.forEach(room => {\n room.disconnect()\n })\n }\n\n if (typeof window !== 'undefined') {\n window.addEventListener('beforeunload', this._beforeUnloadHandler)\n } else if (typeof process !== 'undefined') {\n process.on('exit', this._beforeUnloadHandler)\n }\n }\n\n connect () {\n this.doc.on('update', this._docUpdateHandler)\n this.awareness.on('update', this._awarenessUpdateHandler)\n // signal through all available signaling connections\n announceSignalingInfo(this)\n const roomName = this.name\n bc.subscribe(roomName, this._bcSubscriber)\n this.bcconnected = true\n // broadcast peerId via broadcastchannel\n broadcastBcPeerId(this)\n // write sync step 1\n const encoderSync = encoding.createEncoder()\n encoding.writeVarUint(encoderSync, messageSync)\n syncProtocol.writeSyncStep1(encoderSync, this.doc)\n broadcastBcMessage(this, encoding.toUint8Array(encoderSync))\n // broadcast local state\n const encoderState = encoding.createEncoder()\n encoding.writeVarUint(encoderState, messageSync)\n syncProtocol.writeSyncStep2(encoderState, this.doc)\n broadcastBcMessage(this, encoding.toUint8Array(encoderState))\n // write queryAwareness\n const encoderAwarenessQuery = encoding.createEncoder()\n encoding.writeVarUint(encoderAwarenessQuery, messageQueryAwareness)\n broadcastBcMessage(this, encoding.toUint8Array(encoderAwarenessQuery))\n // broadcast local awareness state\n const encoderAwarenessState = encoding.createEncoder()\n encoding.writeVarUint(encoderAwarenessState, messageAwareness)\n encoding.writeVarUint8Array(encoderAwarenessState, awarenessProtocol.encodeAwarenessUpdate(this.awareness, [this.doc.clientID]))\n broadcastBcMessage(this, encoding.toUint8Array(encoderAwarenessState))\n }\n\n disconnect () {\n // signal through all available signaling connections\n signalingConns.forEach(conn => {\n if (conn.connected) {\n conn.send({ type: 'unsubscribe', topics: [this.name] })\n }\n })\n awarenessProtocol.removeAwarenessStates(this.awareness, [this.doc.clientID], 'disconnect')\n // broadcast peerId removal via broadcastchannel\n const encoderPeerIdBc = encoding.createEncoder()\n encoding.writeVarUint(encoderPeerIdBc, messageBcPeerId)\n encoding.writeUint8(encoderPeerIdBc, 0) // remove peerId from other bc peers\n encoding.writeVarString(encoderPeerIdBc, this.peerId)\n broadcastBcMessage(this, encoding.toUint8Array(encoderPeerIdBc))\n\n bc.unsubscribe(this.name, this._bcSubscriber)\n this.bcconnected = false\n this.doc.off('update', this._docUpdateHandler)\n this.awareness.off('update', this._awarenessUpdateHandler)\n this.webrtcConns.forEach(conn => conn.destroy())\n }\n\n destroy () {\n this.disconnect()\n if (typeof window !== 'undefined') {\n window.removeEventListener('beforeunload', this._beforeUnloadHandler)\n } else if (typeof process !== 'undefined') {\n process.off('exit', this._beforeUnloadHandler)\n }\n }\n}\n\n/**\n * @param {Y.Doc} doc\n * @param {WebrtcProvider} provider\n * @param {string} name\n * @param {CryptoKey|null} key\n * @return {Room}\n */\nconst openRoom = (doc, provider, name, key) => {\n // there must only be one room\n if (rooms.has(name)) {\n throw error.create(`A Yjs Doc connected to room \"${name}\" already exists!`)\n }\n const room = new Room(doc, provider, name, key)\n rooms.set(name, /** @type {Room} */ (room))\n return room\n}\n\n/**\n * @param {SignalingConn} conn\n * @param {Room} room\n * @param {any} data\n */\nconst publishSignalingMessage = (conn, room, data) => {\n if (room.key) {\n cryptoutils.encryptJson(data, room.key).then(data => {\n conn.send({ type: 'publish', topic: room.name, data: buffer.toBase64(data) })\n })\n } else {\n conn.send({ type: 'publish', topic: room.name, data })\n }\n}\n\nexport class SignalingConn extends ws.WebsocketClient {\n constructor (url) {\n super(url)\n /**\n * @type {Set}\n */\n this.providers = new Set()\n this.on('connect', () => {\n log(`connected (${url})`)\n const topics = Array.from(rooms.keys())\n this.send({ type: 'subscribe', topics })\n rooms.forEach(room =>\n publishSignalingMessage(this, room, { type: 'announce', from: room.peerId })\n )\n })\n this.on('message', m => {\n switch (m.type) {\n case 'publish': {\n const roomName = m.topic\n const room = rooms.get(roomName)\n if (room == null || typeof roomName !== 'string') {\n return\n }\n const execMessage = data => {\n const webrtcConns = room.webrtcConns\n const peerId = room.peerId\n if (data == null || data.from === peerId || (data.to !== undefined && data.to !== peerId) || room.bcConns.has(data.from)) {\n // ignore messages that are not addressed to this conn, or from clients that are connected via broadcastchannel\n return\n }\n const emitPeerChange = webrtcConns.has(data.from)\n ? () => {}\n : () =>\n room.provider.emit('peers', [{\n removed: [],\n added: [data.from],\n webrtcPeers: Array.from(room.webrtcConns.keys()),\n bcPeers: Array.from(room.bcConns)\n }])\n switch (data.type) {\n case 'announce':\n if (webrtcConns.size < room.provider.maxConns) {\n map.setIfUndefined(webrtcConns, data.from, () => new WebrtcConn(this, true, data.from, room))\n emitPeerChange()\n }\n break\n case 'signal':\n if (data.signal.type === 'offer') {\n const existingConn = webrtcConns.get(data.from)\n if (existingConn) {\n const remoteToken = data.token\n const localToken = existingConn.glareToken\n if (localToken && localToken > remoteToken) {\n log('offer rejected: ', data.from)\n return\n }\n // if we don't reject the offer, we will be accepting it and answering it\n existingConn.glareToken = undefined\n }\n }\n if (data.signal.type === 'answer') {\n log('offer answered by: ', data.from)\n const existingConn = webrtcConns.get(data.from)\n existingConn.glareToken = undefined\n }\n if (data.to === peerId) {\n map.setIfUndefined(webrtcConns, data.from, () => new WebrtcConn(this, false, data.from, room)).peer.signal(data.signal)\n emitPeerChange()\n }\n break\n }\n }\n if (room.key) {\n if (typeof m.data === 'string') {\n cryptoutils.decryptJson(buffer.fromBase64(m.data), room.key).then(execMessage)\n }\n } else {\n execMessage(m.data)\n }\n }\n }\n })\n this.on('disconnect', () => log(`disconnect (${url})`))\n }\n}\n\n/**\n * @typedef {Object} ProviderOptions\n * @property {Array} [signaling]\n * @property {string} [password]\n * @property {awarenessProtocol.Awareness} [awareness]\n * @property {number} [maxConns]\n * @property {boolean} [filterBcConns]\n * @property {any} [peerOpts]\n */\n\n/**\n * @param {WebrtcProvider} provider\n */\nconst emitStatus = provider => {\n provider.emit('status', [{\n connected: provider.connected\n }])\n}\n\n/**\n * @typedef {Object} WebrtcProviderEvents\n * @property {function({connected:boolean}):void} WebrtcProviderEvent.status\n * @property {function({synced:boolean}):void} WebrtcProviderEvent.synced\n * @property {function({added:Array,removed:Array,webrtcPeers:Array,bcPeers:Array}):void} WebrtcProviderEvent.peers\n */\n\n/**\n * @extends ObservableV2\n */\nexport class WebrtcProvider extends ObservableV2 {\n /**\n * @param {string} roomName\n * @param {Y.Doc} doc\n * @param {ProviderOptions?} opts\n */\n constructor (\n roomName,\n doc,\n {\n signaling = ['wss://y-webrtc-eu.fly.dev'],\n password = null,\n awareness = new awarenessProtocol.Awareness(doc),\n maxConns = 20 + math.floor(random.rand() * 15), // the random factor reduces the chance that n clients form a cluster\n filterBcConns = true,\n peerOpts = {} // simple-peer options. See https://github.com/feross/simple-peer#peer--new-peeropts\n } = {}\n ) {\n super()\n this.roomName = roomName\n this.doc = doc\n this.filterBcConns = filterBcConns\n /**\n * @type {awarenessProtocol.Awareness}\n */\n this.awareness = awareness\n this.shouldConnect = false\n this.signalingUrls = signaling\n this.signalingConns = []\n this.maxConns = maxConns\n this.peerOpts = peerOpts\n /**\n * @type {PromiseLike}\n */\n this.key = password ? cryptoutils.deriveKey(password, roomName) : /** @type {PromiseLike} */ (promise.resolve(null))\n /**\n * @type {Room|null}\n */\n this.room = null\n this.key.then(key => {\n this.room = openRoom(doc, this, roomName, key)\n if (this.shouldConnect) {\n this.room.connect()\n } else {\n this.room.disconnect()\n }\n emitStatus(this)\n })\n this.connect()\n this.destroy = this.destroy.bind(this)\n doc.on('destroy', this.destroy)\n }\n\n /**\n * Indicates whether the provider is looking for other peers.\n *\n * Other peers can be found via signaling servers or via broadcastchannel (cross browser-tab\n * communication). You never know when you are connected to all peers. You also don't know if\n * there are other peers. connected doesn't mean that you are connected to any physical peers\n * working on the same resource as you. It does not change unless you call provider.disconnect()\n *\n * `this.on('status', (event) => { console.log(event.connected) })`\n *\n * @type {boolean}\n */\n get connected () {\n return this.room !== null && this.shouldConnect\n }\n\n connect () {\n this.shouldConnect = true\n this.signalingUrls.forEach(url => {\n const signalingConn = map.setIfUndefined(signalingConns, url, () => new SignalingConn(url))\n this.signalingConns.push(signalingConn)\n signalingConn.providers.add(this)\n })\n if (this.room) {\n this.room.connect()\n emitStatus(this)\n }\n }\n\n disconnect () {\n this.shouldConnect = false\n this.signalingConns.forEach(conn => {\n conn.providers.delete(this)\n if (conn.providers.size === 0) {\n conn.destroy()\n signalingConns.delete(conn.url)\n }\n })\n if (this.room) {\n this.room.disconnect()\n emitStatus(this)\n }\n }\n\n destroy () {\n this.doc.off('destroy', this.destroy)\n // need to wait for key before deleting room\n this.key.then(() => {\n /** @type {Room} */ (this.room).destroy()\n rooms.delete(this.roomName)\n })\n super.destroy()\n }\n}\n", "/**\n * @module bindings/quill\n */\n\nimport * as Y from 'yjs' // eslint-disable-line\n\n/**\n * @typedef {import('y-protocols/awareness').Awareness} Awareness\n\n/**\n * Removes the pending '\\n's if it has no attributes.\n */\nexport const normQuillDelta = delta => {\n if (delta.length > 0) {\n const d = delta[delta.length - 1]\n const insert = d.insert\n if (d.attributes === undefined && insert !== undefined && insert.slice(-1) === '\\n') {\n delta = delta.slice()\n let ins = insert.slice(0, -1)\n while (ins.slice(-1) === '\\n') {\n ins = ins.slice(0, -1)\n }\n delta[delta.length - 1] = { insert: ins }\n if (ins.length === 0) {\n delta.pop()\n }\n return delta\n }\n }\n return delta\n}\n\n/**\n * @param {any} quillCursors\n */\nconst updateCursor = (quillCursors, aw, clientId, doc, type) => {\n try {\n if (aw && aw.cursor && clientId !== doc.clientID) {\n const user = aw.user || {}\n const color = user.color || '#ffa500'\n const name = user.name || `User: ${clientId}`\n quillCursors.createCursor(clientId.toString(), name, color)\n const anchor = Y.createAbsolutePositionFromRelativePosition(Y.createRelativePositionFromJSON(aw.cursor.anchor), doc)\n const head = Y.createAbsolutePositionFromRelativePosition(Y.createRelativePositionFromJSON(aw.cursor.head), doc)\n if (anchor && head && anchor.type === type) {\n quillCursors.moveCursor(clientId.toString(), { index: anchor.index, length: head.index - anchor.index })\n }\n } else {\n quillCursors.removeCursor(clientId.toString())\n }\n } catch (err) {\n console.error(err)\n }\n}\n\nexport class QuillBinding {\n /**\n * @param {Y.Text} type\n * @param {any} quill\n * @param {Awareness} [awareness]\n */\n constructor (type, quill, awareness) {\n const doc = /** @type {Y.Doc} */ (type.doc)\n this.type = type\n this.doc = doc\n this.quill = quill\n const quillCursors = quill.getModule('cursors') || null\n this.quillCursors = quillCursors\n // This object contains all attributes used in the quill instance\n this._negatedUsedFormats = {}\n this.awareness = awareness\n this._awarenessChange = ({ added, removed, updated }) => {\n const states = /** @type {Awareness} */ (awareness).getStates()\n added.forEach(id => {\n updateCursor(quillCursors, states.get(id), id, doc, type)\n })\n updated.forEach(id => {\n updateCursor(quillCursors, states.get(id), id, doc, type)\n })\n removed.forEach(id => {\n quillCursors.removeCursor(id.toString())\n })\n }\n /**\n * @param {Y.YTextEvent} event\n */\n this._typeObserver = event => {\n if (event.transaction.origin !== this) {\n const eventDelta = event.delta\n // We always explicitly set attributes, otherwise concurrent edits may\n // result in quill assuming that a text insertion shall inherit existing\n // attributes.\n const delta = []\n for (let i = 0; i < eventDelta.length; i++) {\n const d = eventDelta[i]\n if (d.insert !== undefined) {\n delta.push(Object.assign({}, d, { attributes: Object.assign({}, this._negatedUsedFormats, d.attributes || {}) }))\n } else {\n delta.push(d)\n }\n }\n quill.updateContents(delta, this)\n }\n }\n type.observe(this._typeObserver)\n this._quillObserver = (eventType, delta, state, origin) => {\n if (delta && delta.ops) {\n // update content\n const ops = delta.ops\n ops.forEach(op => {\n if (op.attributes !== undefined) {\n for (const key in op.attributes) {\n if (this._negatedUsedFormats[key] === undefined) {\n this._negatedUsedFormats[key] = false\n }\n }\n }\n })\n if (origin !== this) {\n doc.transact(() => {\n type.applyDelta(ops)\n }, this)\n }\n }\n // always check selection\n if (awareness && quillCursors) {\n const sel = quill.getSelection()\n const aw = /** @type {any} */ (awareness.getLocalState())\n if (sel === null) {\n if (awareness.getLocalState() !== null) {\n awareness.setLocalStateField('cursor', /** @type {any} */ (null))\n }\n } else {\n const anchor = Y.createRelativePositionFromTypeIndex(type, sel.index)\n const head = Y.createRelativePositionFromTypeIndex(type, sel.index + sel.length)\n if (!aw || !aw.cursor || !Y.compareRelativePositions(anchor, aw.cursor.anchor) || !Y.compareRelativePositions(head, aw.cursor.head)) {\n awareness.setLocalStateField('cursor', {\n anchor,\n head\n })\n }\n }\n // update all remote cursor locations\n awareness.getStates().forEach((aw, clientId) => {\n updateCursor(quillCursors, aw, clientId, doc, type)\n })\n }\n }\n quill.on('editor-change', this._quillObserver)\n // This indirectly initializes _negatedUsedFormats.\n // Make sure that this call this after the _quillObserver is set.\n quill.setContents(type.toDelta(), this)\n // init remote cursors\n if (quillCursors !== null && awareness) {\n awareness.getStates().forEach((aw, clientId) => {\n updateCursor(quillCursors, aw, clientId, doc, type)\n })\n awareness.on('change', this._awarenessChange)\n }\n }\n\n destroy () {\n this.type.unobserve(this._typeObserver)\n this.quill.off('editor-change', this._quillObserver)\n if (this.awareness) {\n this.awareness.off('change', this._awarenessChange)\n }\n }\n}\n", "// Generated by js_of_ocaml\n//# buildInfo:effects=false, kind=exe, use-js-string=true, version=5.8.2+5.8.2\n(function(a){typeof\nglobalThis!==\"object\"&&(this?b():(a.defineProperty(a.prototype,\"_T_\",{configurable:true,get:b}),_T_));function\nb(){var\nb=this||self;b.globalThis=b;delete\na.prototype._T_}}(Object));(function(a){require(\"quill/dist/quill.core.css\");require(\"quill/dist/quill.bubble.css\");require(\"quill/dist/quill.snow.css\")}(globalThis));(function(p){\"use strict\";var\nw=3850876,aF=\" \",ae=\"0\",gb=\"compare: functional value\",kn=\"synced\",ga=\"mkdir\",cx=1000,jS=\"delete\",X=\"vendor/lwd/lib/lwd/lwd_seq.pp.ml\",kI=\"@[\",kH=\"window\",k6=\"console\",dS=\"int_of_string\",fT=\"fs\",km=\"%u\",kG=\"/static/\",jR=\"%i\",k5=\"%ni\",aX=0xff,f$=749039939,kF=\"Assert_failure\",aH=737455525,kl=\"camlinternalMod.ml\",jQ=\"0x\",kk=0x7ff0,k4=218,jP=0xdfff,kj=\"End_of_file\",kE=\"OCAMLRUNPARAM\",jO=\": closedir failed\",kD=253,k3=\"Out_of_memory\",kC=553,jN=\"Not_found\",gg=\"Failure\",dR=\"Unix.Unix_error\",jM=\"style\",ki=\"^\",bY=\"text\",k2=\"length\",kh=\"green\",f5=\"ENOTDIR\",kB=\"Lwd_seq.rank: node is marked\",bx=936573133,jL=\"%Li\",jJ=\"flex\",jK=\"Invalid_argument\",dK=254,bX=\"+\",dM=\"Set.bal\",k1=\", characters \",aV=0xffffff,kg=858694086,kA=120,kz=1027,cw=1024,dQ=\"Map.bal\",bb=246,kf=\"Pervasives.do_at_exit\",ky=389604418,ke=65536,jI=\"submit\",c=\"vendor/brr_lwd_ui/examples/yjs/main.ml\",f4=0xf,T=16620,jH=\", \",dJ=512,f3=-588596599,kZ=\"Match_failure\",k0=\"closedir\",jF=\"%li\",jG=1026,kY=-32,jE=157,jD=\"b\",fS=\"nan\",e=\"\",fR=\"rmdir\",f_=\"Fatal error: exception \",kd=\"infinity\",L=\"camlinternalFormat.ml\",kc=\"fd \",kW=\"append\",kX=\": \",jC=174,q=248,kb=\"em\",ka=\"data\",kV=0xe0,kx=24029,j$=0xf0,j_=\"Sys_error\",ap=0x80,f2=\"vendor/brr_lwd_ui/bindings/yjs/doc.ml\",kw=\"ENOTEMPTY\",kU=\"EEXIST\",f9=1255,jB=\"checkbox\",j9=1073741823,dI=\"value\",fQ=\" : flags Open_text and Open_binary are not compatible\",kT=\"px\",f1=\"e\",fP=\": Not a directory\",f0=\"ENOENT\",kv=\"Stack_overflow\",fZ=-605101559,S=15681,j8=\"Array\",kS=\"Undefined_recursive_module\",j7=544,kR=2147483647,aG=0x8000,cv=\"string\",dL=\"table\",j6=0x800,ku=-48,jz=\"error\",jA=\" : is a directory\",j4=\"@{\",j5=\"Division_by_zero\",jy=\"classList\",ba=\".\",j3=\"(Program not linked with -g, cannot print stack backtrace)\\n\",bu=\"name\",bc=0x3f,kt=\"red\",a$=737456202,fY=\" : file already exists\",bw=128,dP=\": No such file or directory\",j1=\"vendor/lwd/lib/brr-lwd/elwd.ml\",j2=255,dH=\"lwd-to-remove\",cy=256,dG=\"checked\",cu=-976970511,fX=100,j0=\"id\",fO=\"index out of bounds\",ks=-937474657,aI=\"/\",fN=504440814,dF=252,kQ=\"height: \",jx=\"lwdui-virtual-table-row\",fM=\"%d\",kP=383,jv=\"bold\",jw=\": file descriptor already closed\",bt=\"-\",fL=\"EBADF\",jZ=\"changes\",aW=951901561,jY=102,fW=-97,kO=\"Printexc.handle_uncaught_exception\",ju=12520,gf=\" : flags Open_rdonly and Open_wronly are not compatible\",a=\"vendor/lwd/lib/lwd/lwd_table.ml\",f8=756711075,kN=499,kr=\"Fatal error: exception %s\\n\",fV=4100401,kM=\"class\",jt=\"\\xe2\\x9d\\x8c\",aE=250,jX=199,dO=\"bool\",gd=82908052,ge=\"kind\",bv=611392745,fU=\"cell\",kL=\">\",jW=\"([^/]+)\",kq=\"input\",f7=\"jsError\",js=103,dE='\"',aJ=0xffff,gc=127,f6=737308346,jr=0xdc00,jV=\"documentElement\",kK=\"Sys_blocked_io\",b=\"vendor/lwd/lib/lwd/lwd.ml\",kp=\"not implemented\",jq=\"buffer.ml\",jU=\"Form submitted:\",kJ=\"_\",fK=\"target\",jT=-101336657,ko=\"rem\",dN=\"_bigarr02\";function\nzY(a,b,c,d,e){if(d<=b)for(var\nf=1;f<=e;f++)c[d+f]=a[b+f];else\nfor(var\nf=e;f>=1;f--)c[d+f]=a[b+f];return 0}function\nzZ(a,b,c){var\nd=new\nArray(c+1);d[0]=0;for(var\ne=1,f=b+1;e<=c;e++,f++)d[e]=a[f];return d}function\ncI(a,b,c){var\nd=String.fromCharCode;if(b==0&&c<=4096&&c==a.length)return d.apply(null,a);var\nf=e;for(;0=c.l||c.t==2&&e>=c.c.length)){c.c=a.t==4?cI(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else if(c.t==2&&d==c.c.length){c.c+=a.t==4?cI(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else{if(c.t!=4)dW(c);var\ng=a.c,h=c.c;if(a.t==4)if(d<=b)for(var\nf=0;f=0;f--)h[d+f]=g[b+f];else{var\ni=Math.min(e,g.length-b);for(var\nf=0;f>=1;if(a==0)return d;b+=b;c++;if(c==9)b.slice(0,1)}}function\ncD(a){if(a.t==2)a.c+=b2(a.l-a.c.length,\"\\0\");else\na.c=cI(a.c,0,a.c.length);a.t=0}function\ngD(a){if(a.length<24){for(var\nb=0;bgc)return false;return true}else\nreturn!/[^\\x00-\\x7f]/.test(a)}function\nlC(a){for(var\nk=e,d=e,h,g,i,b,c=0,j=a.length;cdJ){d.substr(0,1);k+=d;d=e;k+=a.slice(c,f)}else\nd+=a.slice(c,f);if(f==j)break;c=f}b=1;if(++c=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c0x10ffff)b=3}}}}}if(b<4){c-=b;d+=\"\\ufffd\"}else if(b>aJ)d+=String.fromCharCode(0xd7c0+(b>>10),jr+(b&0x3FF));else\nd+=String.fromCharCode(b);if(d.length>cw){d.substr(0,1);k+=d;d=e}}return k+d}function\naY(a,b,c){this.t=a;this.c=b;this.l=c}aY.prototype.toString=function(){switch(this.t){case\n9:return this.c;default:cD(this);case\n0:if(gD(this.c)){this.t=9;return this.c}this.t=8;case\n8:return this.c}};aY.prototype.toUtf16=function(){var\na=this.toString();if(this.t==9)return a;return lC(a)};aY.prototype.slice=function(){var\na=this.t==4?this.c.slice():this.c;return new\naY(this.t,a,this.l)};function\nlc(a){return new\naY(0,a,a.length)}function\naK(a){return a}function\nbe(a){return lc(aK(a))}function\ncB(a,b,c,d,e){aZ(be(a),b,c,d,e);return 0}function\nlE(a){var\nb=p.process;if(b&&b.env&&b.env[a]!=undefined)return b.env[a];if(p.jsoo_static_env&&p.jsoo_static_env[a])return p.jsoo_static_env[a]}var\ngA=0;(function(){var\nc=lE(kE);if(c!==undefined){var\nb=c.split(\",\");for(var\na=0;a=a.c.length)return 0;case\n0:return a.c.charCodeAt(b);case\n4:return a.c[b]}}function\nz4(a,b){if(b>>>0>=a.l)gi();return b0(a,b)}function\nB(a,b,c){c&=aX;if(a.t!=4){if(b==a.c.length){a.c+=String.fromCharCode(c);if(b+1==a.l)a.t=0;return 0}dW(a)}a.c[b]=c;return 0}function\na0(a,b,c){if(b>>>0>=a.l)gi();return B(a,b,c)}function\nbz(a){return a.toArray()}function\nz5(a,b,c){if(b>>>0>=a.l-7)gi();var\ne=bz(c);for(var\nd=0;d<8;d++)B(a,b+7-d,e[d]);return 0}function\nbf(d,c){var\nf=d.l>=0?d.l:d.l=d.length,e=c.length,b=f-e;if(b==0)return d.apply(null,c);else if(b<0){var\na=d.apply(null,c.slice(0,f));if(typeof\na!==\"function\")return a;return bf(a,c.slice(f))}else{switch(b){case\n1:{var\na=function(a){var\nf=new\nArray(e+1);for(var\nb=0;b>>0>=a.length-1)cA();return a}function\nz6(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function\nlo(a){return 0}var\nA7=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function\nA6(a){if(A7)return Math.floor(Math.log2(a));var\nb=0;if(a==0)return-Infinity;if(a>=1)while(a>=2){a/=2;b++}else\nwhile(a<1){a*=2;b--}return b}function\ngp(a){var\nb=new\nFloat32Array(1);b[0]=a;var\nc=new\nInt32Array(b.buffer);return c[0]|0}var\nlj=Math.pow(2,-24);function\nlw(a){throw a}function\ngz(){lw(U.Division_by_zero)}function\nd(a,b,c){this.lo=a&aV;this.mi=b&aV;this.hi=c&aJ}d.prototype.caml_custom=\"_j\";d.prototype.copy=function(){return new\nd(this.lo,this.mi,this.hi)};d.prototype.ucompare=function(a){if(this.hi>a.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.lo>24),c=-this.hi+(b>>24);return new\nd(a,b,c)};d.prototype.add=function(a){var\nb=this.lo+a.lo,c=this.mi+a.mi+(b>>24),e=this.hi+a.hi+(c>>24);return new\nd(b,c,e)};d.prototype.sub=function(a){var\nb=this.lo-a.lo,c=this.mi-a.mi+(b>>24),e=this.hi-a.hi+(c>>24);return new\nd(b,c,e)};d.prototype.mul=function(a){var\nb=this.lo*a.lo,c=(b*lj|0)+this.mi*a.lo+this.lo*a.mi,e=(c*lj|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new\nd(b,c,e)};d.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};d.prototype.isNeg=function(){return this.hi<<16<0};d.prototype.and=function(a){return new\nd(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};d.prototype.or=function(a){return new\nd(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};d.prototype.xor=function(a){return new\nd(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};d.prototype.shift_left=function(a){a=a&63;if(a==0)return this;if(a<24)return new\nd(this.lo<>24-a,this.hi<>24-a);if(a<48)return new\nd(0,this.lo<>48-a);return new\nd(0,0,this.lo<>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a);if(a<48)return new\nd(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0);return new\nd(this.hi>>a-48,0,0)};d.prototype.shift_right=function(a){a=a&63;if(a==0)return this;var\nc=this.hi<<16>>16;if(a<24)return new\nd(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var\nb=this.hi<<16>>31;if(a<48)return new\nd(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&aJ);return new\nd(this.hi<<16>>a-32,b,b)};d.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&aV;this.lo=this.lo<<1&aV};d.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&aV;this.mi=(this.mi>>>1|this.hi<<23)&aV;this.hi=this.hi>>>1};d.prototype.udivmod=function(a){var\ne=0,c=this.copy(),b=a.copy(),f=new\nd(0,0,0);while(c.ucompare(b)>0){e++;b.lsl1()}while(e>=0){e--;f.lsl1();if(c.ucompare(b)>=0){f.lo++;c=c.sub(b)}b.lsr1()}return{quotient:f,modulus:c}};d.prototype.div=function(a){var\nb=this;if(a.isZero())gz();var\nd=b.hi^a.hi;if(b.hi&aG)b=b.neg();if(a.hi&aG)a=a.neg();var\nc=b.udivmod(a).quotient;if(d&aG)c=c.neg();return c};d.prototype.mod=function(a){var\nb=this;if(a.isZero())gz();var\nd=b.hi;if(b.hi&aG)b=b.neg();if(a.hi&aG)a=a.neg();var\nc=b.udivmod(a).modulus;if(d&aG)c=c.neg();return c};d.prototype.toInt=function(){return this.lo|this.mi<<24};d.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};d.prototype.toArray=function(){return[this.hi>>8,this.hi&aX,this.mi>>16,this.mi>>8&aX,this.mi&aX,this.lo>>16,this.lo>>8&aX,this.lo&aX]};d.prototype.lo32=function(){return this.lo|(this.mi&aX)<<24};d.prototype.hi32=function(){return this.mi>>>8&aJ|this.hi<<16};function\ndZ(a,b,c){return new\nd(a,b,c)}function\ndY(a){if(!isFinite(a)){if(isNaN(a))return dZ(1,0,kk);return a>0?dZ(0,0,kk):dZ(0,0,0xfff0)}var\nf=a==0&&1/a==-Infinity?aG:a>=0?0:aG;if(f)a=-a;var\nb=A6(a)+1023;if(b<=0){b=0;a/=Math.pow(2,-jG)}else{a/=Math.pow(2,b-kz);if(a<16){a*=2;b-=1}if(b==0)a/=2}var\nd=Math.pow(2,24),c=a|0;a=(a-c)*d;var\ne=a|0;a=(a-e)*d;var\ng=a|0;c=c&f4|f|b<<4;return dZ(g,e,c)}function\nlb(a,b,c){a.write(32,b.dims.length);a.write(32,b.kind|b.layout<<8);if(b.caml_custom==dN)for(var\nd=0;d>4;if(d==2047)return(f|g|c&f4)==0?c&aG?-Infinity:Infinity:NaN;var\ne=Math.pow(2,-24),b=(f*e+g)*e+(c&f4);if(d>0){b+=16;b*=Math.pow(2,d-kz)}else\nb*=Math.pow(2,-jG);if(c&aG)b=-b;return b}function\ngh(a){var\nd=a.length,c=1;for(var\nb=0;b>>24&aX|(b&aJ)<<8,b>>>16&aJ)}function\ngs(a){return a.hi32()}function\ngt(a){return a.lo32()}var\nz1=dN;function\nbd(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}bd.prototype.caml_custom=z1;bd.prototype.offset=function(a){var\nc=0;if(typeof\na===\"number\")a=[a];if(!(a\ninstanceof\nArray))G(\"bigarray.js: invalid offset\");if(this.dims.length!=a.length)G(\"Bigarray.get/set: bad number of dimensions\");if(this.layout==0)for(var\nb=0;b=this.dims[b])cA();c=c*this.dims[b]+a[b]}else\nfor(var\nb=this.dims.length-1;b>=0;b--){if(a[b]<1||a[b]>this.dims[b])cA();c=c*this.dims[b]+(a[b]-1)}return c};bd.prototype.get=function(a){switch(this.kind){case\n7:var\nd=this.data[a*2+0],b=this.data[a*2+1];return An(d,b);case\n10:case\n11:var\ne=this.data[a*2+0],c=this.data[a*2+1];return[dK,e,c];default:return this.data[a]}};bd.prototype.set=function(a,b){switch(this.kind){case\n7:this.data[a*2+0]=gt(b);this.data[a*2+1]=gs(b);break;case\n10:case\n11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};bd.prototype.fill=function(a){switch(this.kind){case\n7:var\nc=gt(a),e=gs(a);if(c==e)this.data.fill(c);else\nfor(var\nb=0;be)return 1;if(d!=e){if(!b)return NaN;if(d==d)return 1;if(e==e)return-1}}break;case\n7:for(var\nc=0;ca.data[c+1])return 1;if(this.data[c]>>>0>>0)return-1;if(this.data[c]>>>0>a.data[c]>>>0)return 1}break;case\n2:case\n3:case\n4:case\n5:case\n6:case\n8:case\n9:case\n12:for(var\nc=0;ca.data[c])return 1}break}return 0};function\nbZ(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}bZ.prototype=new\nbd();bZ.prototype.offset=function(a){if(typeof\na!==\"number\")if(a\ninstanceof\nArray&&a.length==1)a=a[0];else\nG(\"Ml_Bigarray_c_1_1.offset\");if(a<0||a>=this.dims[0])cA();return a};bZ.prototype.get=function(a){return this.data[a]};bZ.prototype.set=function(a,b){this.data[a]=b;return 0};bZ.prototype.fill=function(a){this.data.fill(a);return 0};function\nk9(a,b,c,d){var\ne=k$(a);if(gh(c)*e!=d.length)G(\"length doesn't match dims\");if(b==0&&c.length==1&&e==1)return new\nbZ(a,b,c,d);return new\nbd(a,b,c,d)}function\nal(a){if(!U.Failure)U.Failure=[q,am(gg),-3];gy(U.Failure,a)}function\nk_(a,b,c){var\nk=a.read32s();if(k<0||k>16)al(\"input_value: wrong number of bigarray dimensions\");var\nr=a.read32s(),l=r&aX,q=r>>8&1,j=[];if(c==dN)for(var\nd=0;d>>32-15;b=cG(b,0x1b873593);a^=b;a=a<<13|a>>>32-13;return(a+(a<<2)|0)+(0xe6546b64|0)|0}function\nAh(a,b){a=V(a,gt(b));a=V(a,gs(b));return a}function\ngn(a,b){return Ah(a,dY(b))}function\nla(a){var\nc=gh(a.dims),d=0;switch(a.kind){case\n2:case\n3:case\n12:if(c>cy)c=cy;var\ne=0,b=0;for(b=0;b+4<=a.data.length;b+=4){e=a.data[b+0]|a.data[b+1]<<8|a.data[b+2]<<16|a.data[b+3]<<24;d=V(d,e)}e=0;switch(c&3){case\n3:e=a.data[b+2]<<16;case\n2:e|=a.data[b+1]<<8;case\n1:e|=a.data[b+0];d=V(d,e)}break;case\n4:case\n5:if(c>bw)c=bw;var\ne=0,b=0;for(b=0;b+2<=a.data.length;b+=2){e=a.data[b+0]|a.data[b+1]<<16;d=V(d,e)}if((c&1)!=0)d=V(d,a.data[b]);break;case\n6:if(c>64)c=64;for(var\nb=0;b64)c=64;for(var\nb=0;b32)c=32;c*=2;for(var\nb=0;b64)c=64;for(var\nb=0;b32)c=32;for(var\nb=0;b0?f(b,a,d):f(a,b,d);if(d&&e!=e)return c;if(+e!=+e)return+e;if((e|0)!=0)return e|0}return c}function\nd2(a){return typeof\na===\"string\"&&!/[^\\x00-\\xff]/.test(a)}function\nd1(a){return a\ninstanceof\naY}function\nle(a){if(typeof\na===\"number\")return cx;else if(d1(a))return dF;else if(d2(a))return 1252;else if(a\ninstanceof\nArray&&a[0]===a[0]>>>0&&a[0]<=j2){var\nb=a[0]|0;return b==dK?0:b}else if(a\ninstanceof\nString)return ju;else if(typeof\na==\"string\")return ju;else if(a\ninstanceof\nNumber)return cx;else if(a&&a.caml_custom)return f9;else if(a&&a.compare)return 1256;else if(typeof\na==\"function\")return 1247;else if(typeof\na==\"symbol\")return 1251;return 1001}function\nlm(a,b){if(ab?1:0}function\nz3(a,b){a.t&6&&cD(a);b.t&6&&cD(b);return a.cb.c?1:0}function\ndV(a,b,c){var\nf=[];for(;;){if(!(c&&a===b)){var\ne=le(a);if(e==aE){a=a[1];continue}var\ng=le(b);if(g==aE){b=b[1];continue}if(e!==g){if(e==cx){if(g==f9)return ld(a,b,-1,c);return-1}if(g==cx){if(e==f9)return ld(b,a,1,c);return 1}return eb)return 1;if(a!=b){if(!c)return NaN;if(a==a)return 1;if(b==b)return-1}break;case\n1001:if(ab)return 1;if(a!=b){if(!c)return NaN;if(a==a)return 1;if(b==b)return-1}break;case\n1251:if(a!==b){if(!c)return NaN;return 1}break;case\n1252:var\na=aK(a),b=aK(b);if(a!==b){if(ab)return 1}break;case\n12520:var\na=a.toString(),b=b.toString();if(a!==b){if(ab)return 1}break;case\n246:case\n254:default:if(lo(e)){G(\"compare: continuation value\");break}if(a.length!=b.length)return a.length1)f.push(a,b,1);break}}if(f.length==0)return 0;var\nh=f.pop();b=f.pop();a=f.pop();if(h+10)if(b==0&&(c>=a.l||a.t==2&&c>=a.c.length))if(d==0){a.c=e;a.t=2}else{a.c=b2(c,String.fromCharCode(d));a.t=c==a.l?0:2}else{if(a.t!=4)dW(a);for(c+=b;b0&&b===b)return b;a=a.replace(/_/g,e);b=+a;if(a.length>0&&b===b||/^[+-]?nan$/i.test(a))return b;var\nc=/^ *([+-]?)0x([0-9a-f]+)\\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(a);if(c){var\nd=c[3].replace(/0+$/,e),g=parseInt(c[1]+c[2]+d,16),f=(c[5]|0)-4*d.length;b=g*Math.pow(2,f);return b}if(/^\\+?inf(inity)?$/i.test(a))return Infinity;if(/^-inf(inity)?$/i.test(a))return-Infinity;al(\"float_of_string\")}function\ngx(a){a=aK(a);var\ne=a.length;if(e>31)G(\"format_int: format too long\");var\nb={justify:bX,signstyle:bt,filler:aF,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:\"f\"};for(var\nd=0;d=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case\".\":b.prec=0;d++;while(c=a.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;case\"d\":case\"i\":b.signedconv=true;case\"u\":b.base=10;break;case\"x\":b.base=16;break;case\"X\":b.base=16;b.uppercase=true;break;case\"o\":b.base=8;break;case\"e\":case\"f\":case\"g\":b.signedconv=true;b.conv=c;break;case\"E\":case\"F\":case\"G\":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function\ngl(a,b){if(a.uppercase)b=b.toUpperCase();var\nf=b.length;if(a.signedconv&&(a.sign<0||a.signstyle!=bt))f++;if(a.alternate){if(a.base==8)f+=1;if(a.base==16)f+=2}var\nc=e;if(a.justify==bX&&a.filler==aF)for(var\nd=f;d20){c-=20;a/=Math.pow(10,c);a+=new\nArray(c+1).join(ae);if(b>0)a=a+ba+new\nArray(b+1).join(ae);return a}else\nreturn a.toFixed(b)}}var\nc,f=gx(a),e=f.prec<0?6:f.prec;if(b<0||b==0&&1/b==-Infinity){f.sign=-1;b=-b}if(isNaN(b)){c=fS;f.filler=aF}else if(!isFinite(b)){c=\"inf\";f.filler=aF}else\nswitch(f.conv){case\"e\":var\nc=b.toExponential(e),d=c.length;if(c.charAt(d-3)==f1)c=c.slice(0,d-1)+ae+c.slice(d-1);break;case\"f\":c=j(b,e);break;case\"g\":e=e?e:1;c=b.toExponential(e-1);var\ni=c.indexOf(f1),h=+c.slice(i+1);if(h<-4||b>=1e21||b.toFixed(0).length>e){var\nd=i-1;while(c.charAt(d)==ae)d--;if(c.charAt(d)==ba)d--;c=c.slice(0,d+1)+c.slice(i);d=c.length;if(c.charAt(d-3)==f1)c=c.slice(0,d-1)+ae+c.slice(d-1);break}else{var\ng=e;if(h<0){g-=h+1;c=b.toFixed(g)}else\nwhile(c=b.toFixed(g),c.length>e+1)g--;if(g){var\nd=c.length-1;while(c.charAt(d)==ae)d--;if(c.charAt(d)==ba)d--;c=c.slice(0,d+1)}}break}return gl(f,c)}function\ndX(a,b){if(aK(a)==fM)return am(e+b);var\nc=gx(a);if(b<0)if(c.signedconv){c.sign=-1;b=-b}else\nb>>>=0;var\nd=b.toString(c.base);if(c.prec>=0){c.filler=aF;var\nf=c.prec-d.length;if(f>0)d=b2(f,ae)+d}return gl(c,d)}var\nAO=0;function\naf(){return AO++}function\nH(a){if(gD(a))return a;return lC(a)}function\ncJ(){return typeof\np.process!==\"undefined\"&&typeof\np.process.versions!==\"undefined\"&&typeof\np.process.versions.node!==\"undefined\"}function\nA8(){function\na(a){if(a.charAt(0)===aI)return[e,a.substring(1)];return}function\nb(a){var\nh=/^([a-zA-Z]:|[\\\\/]{2}[^\\\\/]+[\\\\/]+[^\\\\/]+)?([\\\\/])?([\\s\\S]*?)$/,b=h.exec(a),c=b[1]||e,f=Boolean(c&&c.charAt(1)!==\":\");if(Boolean(b[2]||f)){var\nd=b[1]||e,g=b[2]||e;return[d,a.substring(d.length+g.length)]}return}return cJ()&&p.process&&p.process.platform?p.process.platform===\"win32\"?b:a:a}var\ngE=A8();function\nlA(a){return a.slice(-1)!==aI?a+aI:a}if(cJ()&&p.process&&p.process.cwd)var\ncE=p.process.cwd().replace(/\\\\/g,aI);else\nvar\ncE=\"/static\";cE=lA(cE);function\nAB(a){a=H(a);if(!gE(a))a=cE+a;var\ne=gE(a),d=e[1].split(aI),b=[];for(var\nc=0;c1)b.pop();break;case\".\":break;case\"\":break;default:b.push(d[c]);break}b.unshift(e[0]);b.orig=a;return b}function\nAY(a){for(var\ng=e,c=g,b,i,d=0,h=a.length;ddJ){c.substr(0,1);g+=c;c=e;g+=a.slice(d,f)}else\nc+=a.slice(d,f);if(f==h)break;d=f}if(b>6);c+=String.fromCharCode(ap|b&bc)}else if(b<0xd800||b>=jP)c+=String.fromCharCode(kV|b>>12,ap|b>>6&bc,ap|b&bc);else if(b>=0xdbff||d+1==h||(i=a.charCodeAt(d+1))jP)c+=\"\\xef\\xbf\\xbd\";else{d++;b=(b<<10)+i-0x35fdc00;c+=String.fromCharCode(j$|b>>18,ap|b>>12&bc,ap|b>>6&bc,ap|b&bc)}if(c.length>cw){c.substr(0,1);g+=c;c=e}}return g+c}function\nat(a){return gD(a)?am(a):am(AY(a))}var\nA9=[\"E2BIG\",\"EACCES\",\"EAGAIN\",fL,\"EBUSY\",\"ECHILD\",\"EDEADLK\",\"EDOM\",kU,\"EFAULT\",\"EFBIG\",\"EINTR\",\"EINVAL\",\"EIO\",\"EISDIR\",\"EMFILE\",\"EMLINK\",\"ENAMETOOLONG\",\"ENFILE\",\"ENODEV\",f0,\"ENOEXEC\",\"ENOLCK\",\"ENOMEM\",\"ENOSPC\",\"ENOSYS\",f5,kw,\"ENOTTY\",\"ENXIO\",\"EPERM\",\"EPIPE\",\"ERANGE\",\"EROFS\",\"ESPIPE\",\"ESRCH\",\"EXDEV\",\"EWOULDBLOCK\",\"EINPROGRESS\",\"EALREADY\",\"ENOTSOCK\",\"EDESTADDRREQ\",\"EMSGSIZE\",\"EPROTOTYPE\",\"ENOPROTOOPT\",\"EPROTONOSUPPORT\",\"ESOCKTNOSUPPORT\",\"EOPNOTSUPP\",\"EPFNOSUPPORT\",\"EAFNOSUPPORT\",\"EADDRINUSE\",\"EADDRNOTAVAIL\",\"ENETDOWN\",\"ENETUNREACH\",\"ENETRESET\",\"ECONNABORTED\",\"ECONNRESET\",\"ENOBUFS\",\"EISCONN\",\"ENOTCONN\",\"ESHUTDOWN\",\"ETOOMANYREFS\",\"ETIMEDOUT\",\"ECONNREFUSED\",\"EHOSTDOWN\",\"EHOSTUNREACH\",\"ELOOP\",\"EOVERFLOW\"];function\na2(a,b,c,d){var\nf=A9.indexOf(a);if(f<0){if(d==null)d=-9999;f=[0,d]}var\ng=[f,at(b||e),at(c||e)];return g}var\nlu={};function\nbh(a){return lu[a]}function\na1(a,b){throw g([0,a].concat(b))}function\ngj(a){if(!(a\ninstanceof\nUint8Array))a=new\nUint8Array(a);return new\naY(4,a,a.length)}function\nm(a){gy(U.Sys_error,a)}function\nlx(a){m(a+dP)}function\ngC(a){if(a.t!=4)dW(a);return a.c}function\nar(a){return a.l}function\nk7(){}function\nY(a){this.data=a}Y.prototype=new\nk7();Y.prototype.constructor=Y;Y.prototype.truncate=function(a){var\nb=this.data;this.data=F(a|0);aZ(b,0,this.data,0,a)};Y.prototype.length=function(){return ar(this.data)};Y.prototype.write=function(a,b,c,d){var\ne=this.length();if(a+d>=e){var\nf=F(a+d),g=this.data;this.data=f;aZ(g,0,this.data,0,e)}aZ(gj(b),c,this.data,a,d);return 0};Y.prototype.read=function(a,b,c,d){var\ne=this.length();if(a+d>=e)d=e-a;if(d){var\nf=F(d|0);aZ(this.data,a,f,0,d);b.set(gC(f),c)}return d};function\nby(a,b,c){this.file=b;this.name=a;this.flags=c}by.prototype.err_closed=function(){m(this.name+jw)};by.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()};by.prototype.write=function(a,b,c,d){if(this.file)return this.file.write(a,b,c,d);this.err_closed()};by.prototype.read=function(a,b,c,d){if(this.file)return this.file.read(a,b,c,d);this.err_closed()};by.prototype.close=function(){this.file=undefined};function\nO(a,b){this.content={};this.root=a;this.lookupFun=b}O.prototype.nm=function(a){return this.root+a};O.prototype.create_dir_if_needed=function(a){var\nd=a.split(aI),c=e;for(var\nb=0;b>>16;a=cG(a,0x85ebca6b|0);a^=a>>>13;a=cG(a,0xc2b2ae35|0);a^=a>>>16;return a}function\nAd(a,b,c,d){var\nj,k,l,h,g,f,e,i,m;h=b;if(h<0||h>cy)h=cy;g=a;f=c;j=[d];k=0;l=1;while(k0){e=j[k++];if(e&&e.caml_custom){if(cF[e.caml_custom]&&cF[e.caml_custom].hash){var\nn=cF[e.caml_custom].hash(e);f=V(f,n);g--}}else if(e\ninstanceof\nArray&&e[0]===(e[0]|0))switch(e[0]){case\n248:f=V(f,e[2]);g--;break;case\n250:j[--k]=e[1];break;default:if(lo(e[0]))break;var\no=e.length-1<<10|e[0];f=V(f,o);for(i=1,m=e.length;i=h)break;j[l++]=e[i]}break}else if(d1(e)){f=Ae(f,e);g--}else if(d2(e)){f=Ai(f,e);g--}else if(typeof\ne===\"string\"){f=go(f,e);g--}else if(e===(e|0)){f=V(f,e+e+1);g--}else if(typeof\ne===\"number\"){f=gn(f,e);g--}}f=Ag(f);return f&0x3FFFFFFF}function\nAj(a,b,c){if(!isFinite(a)){if(isNaN(a))return at(fS);return at(a>0?kd:\"-infinity\")}var\nk=a==0&&1/a==-Infinity?1:a>=0?0:1;if(k)a=-a;var\nf=0;if(a==0);else if(a<1)while(a<1&&f>-1022){a*=2;f--}else\nwhile(a>=2){a/=2;f++}var\nl=f<0?e:bX,g=e;if(k)g=bt;else\nswitch(c){case\n43:g=bX;break;case\n32:g=aF;break;default:break}if(b>=0&&b<13){var\ni=Math.pow(2,b*4);a=Math.round(a*i)/i}var\nd=a.toString(16);if(b>=0){var\nj=d.indexOf(ba);if(j<0)d+=ba+b2(b,ae);else{var\nh=j+1+b;if(d.length>24&aV,a>>31&aJ)}function\nAu(a){return a.toInt()}function\nAq(a){return+a.isNeg()}function\nAt(a){return a.neg()}function\nAo(a,b){var\nc=gx(a);if(c.signedconv&&Aq(b)){c.sign=-1;b=At(b)}var\nd=e,i=d0(c.base),h=\"0123456789abcdef\";do{var\ng=b.udivmod(i);b=g.quotient;d=h.charAt(Au(g.modulus))+d}while(!Ar(b));if(c.prec>=0){c.filler=aF;var\nf=c.prec-d.length;if(f>0)d=b2(f,ae)+d}return gl(c,d)}function\nlk(a,b){return a.or(b)}function\nll(a,b){return a.shift_left(b)}function\ngu(a,b){return a.shift_right_unsigned(b)}function\nAP(a){var\nb=0,e=n(a),c=10,d=1;if(e>0)switch($(a,b)){case\n45:b++;d=-1;break;case\n43:b++;d=1;break}if(b+1=48&&a<=57)return a-48;if(a>=65&&a<=90)return a-55;if(a>=97&&a<=122)return a-87;return-1}function\nln(a){var\nh=AP(a),d=h[0],i=h[1],e=h[2],g=n(a),j=-1>>>0,f=d=e)al(dS);var\nb=c;for(d++;d=e)break;b=e*b+c;if(b>j)al(dS)}if(d!=g)al(dS);b=i*b;if(e==10&&(b|0)!=b)al(dS);return b|0}function\nlp(a){return a.slice(1)}function\nd3(a,b,c){return a[H(b)].apply(a,lp(c))}function\nlq(a,b){switch(b.length){case\n1:return new\na;case\n2:return new\na(b[1]);case\n3:return new\na(b[1],b[2]);case\n4:return new\na(b[1],b[2],b[3]);case\n5:return new\na(b[1],b[2],b[3],b[4]);case\n6:return new\na(b[1],b[2],b[3],b[4],b[5]);case\n7:return new\na(b[1],b[2],b[3],b[4],b[5],b[6]);case\n8:return new\na(b[1],b[2],b[3],b[4],b[5],b[6],b[7])}function\nc(){return a.apply(this,lp(b))}c.prototype=a.prototype;return new\nc}function\ngv(a){var\nc={};for(var\nb=1;b>>32-e,c)}function\ng(a,b,c,d,e,f,g){return l(b&c|~b&d,a,b,e,f,g)}function\nh(a,b,c,d,e,f,g){return l(b&d|c&~d,a,b,e,f,g)}function\ni(a,b,c,d,e,f,g){return l(b^c^d,a,b,e,f,g)}function\nj(a,b,c,d,e,f,g){return l(c^(b|~d),a,b,e,f,g)}return function(a,b){var\nc=a[0],d=a[1],e=a[2],f=a[3];c=g(c,d,e,f,b[0],7,0xD76AA478);f=g(f,c,d,e,b[1],12,0xE8C7B756);e=g(e,f,c,d,b[2],17,0x242070DB);d=g(d,e,f,c,b[3],22,0xC1BDCEEE);c=g(c,d,e,f,b[4],7,0xF57C0FAF);f=g(f,c,d,e,b[5],12,0x4787C62A);e=g(e,f,c,d,b[6],17,0xA8304613);d=g(d,e,f,c,b[7],22,0xFD469501);c=g(c,d,e,f,b[8],7,0x698098D8);f=g(f,c,d,e,b[9],12,0x8B44F7AF);e=g(e,f,c,d,b[10],17,0xFFFF5BB1);d=g(d,e,f,c,b[11],22,0x895CD7BE);c=g(c,d,e,f,b[12],7,0x6B901122);f=g(f,c,d,e,b[13],12,0xFD987193);e=g(e,f,c,d,b[14],17,0xA679438E);d=g(d,e,f,c,b[15],22,0x49B40821);c=h(c,d,e,f,b[1],5,0xF61E2562);f=h(f,c,d,e,b[6],9,0xC040B340);e=h(e,f,c,d,b[11],14,0x265E5A51);d=h(d,e,f,c,b[0],20,0xE9B6C7AA);c=h(c,d,e,f,b[5],5,0xD62F105D);f=h(f,c,d,e,b[10],9,0x02441453);e=h(e,f,c,d,b[15],14,0xD8A1E681);d=h(d,e,f,c,b[4],20,0xE7D3FBC8);c=h(c,d,e,f,b[9],5,0x21E1CDE6);f=h(f,c,d,e,b[14],9,0xC33707D6);e=h(e,f,c,d,b[3],14,0xF4D50D87);d=h(d,e,f,c,b[8],20,0x455A14ED);c=h(c,d,e,f,b[13],5,0xA9E3E905);f=h(f,c,d,e,b[2],9,0xFCEFA3F8);e=h(e,f,c,d,b[7],14,0x676F02D9);d=h(d,e,f,c,b[12],20,0x8D2A4C8A);c=i(c,d,e,f,b[5],4,0xFFFA3942);f=i(f,c,d,e,b[8],11,0x8771F681);e=i(e,f,c,d,b[11],16,0x6D9D6122);d=i(d,e,f,c,b[14],23,0xFDE5380C);c=i(c,d,e,f,b[1],4,0xA4BEEA44);f=i(f,c,d,e,b[4],11,0x4BDECFA9);e=i(e,f,c,d,b[7],16,0xF6BB4B60);d=i(d,e,f,c,b[10],23,0xBEBFBC70);c=i(c,d,e,f,b[13],4,0x289B7EC6);f=i(f,c,d,e,b[0],11,0xEAA127FA);e=i(e,f,c,d,b[3],16,0xD4EF3085);d=i(d,e,f,c,b[6],23,0x04881D05);c=i(c,d,e,f,b[9],4,0xD9D4D039);f=i(f,c,d,e,b[12],11,0xE6DB99E5);e=i(e,f,c,d,b[15],16,0x1FA27CF8);d=i(d,e,f,c,b[2],23,0xC4AC5665);c=j(c,d,e,f,b[0],6,0xF4292244);f=j(f,c,d,e,b[7],10,0x432AFF97);e=j(e,f,c,d,b[14],15,0xAB9423A7);d=j(d,e,f,c,b[5],21,0xFC93A039);c=j(c,d,e,f,b[12],6,0x655B59C3);f=j(f,c,d,e,b[3],10,0x8F0CCC92);e=j(e,f,c,d,b[10],15,0xFFEFF47D);d=j(d,e,f,c,b[1],21,0x85845DD1);c=j(c,d,e,f,b[8],6,0x6FA87E4F);f=j(f,c,d,e,b[15],10,0xFE2CE6E0);e=j(e,f,c,d,b[6],15,0xA3014314);d=j(d,e,f,c,b[13],21,0x4E0811A1);c=j(c,d,e,f,b[4],6,0xF7537E82);f=j(f,c,d,e,b[11],10,0xBD3AF235);e=j(e,f,c,d,b[2],15,0x2AD7D2BB);d=j(d,e,f,c,b[9],21,0xEB86D391);a[0]=k(c,a[0]);a[1]=k(d,a[1]);a[2]=k(e,a[2]);a[3]=k(f,a[3])}}();function\nzX(a,b,c){var\ne=a.len&bc,d=0;a.len+=c;if(e){var\nf=64-e;if(c=64){a.b8.set(b.subarray(d,d+64),0);dT(a.w,a.b32);c-=64;d+=64}if(c)a.b8.set(b.subarray(d,d+c),0)}function\nzV(a){var\nc=a.len&bc;a.b8[c]=ap;c++;if(c>56){for(var\nb=c;b<64;b++)a.b8[b]=0;dT(a.w,a.b32);for(var\nb=0;b<56;b++)a.b8[b]=0}else\nfor(var\nb=c;b<56;b++)a.b8[b]=0;a.b32[14]=a.len<<3;a.b32[15]=a.len>>29&0x1FFFFFFF;dT(a.w,a.b32);var\ne=new\nUint8Array(16);for(var\nd=0;d<4;d++)for(var\nb=0;b<4;b++)e[d*4+b]=a.w[d]>>8*b&0xFF;return e}function\nAU(a){return am(cI(a,0,a.length))}function\nAC(a,b,c){var\nd=zW(),e=gC(a);zX(d,e.subarray(b,b+c),c);return AU(zV(d))}function\nAD(a,b,c){return AC(be(a),b,c)}function\nAF(){return 0}var\nbg=new\nArray();function\nlr(a){return bg[a]}function\nbB(a){var\nb=lr(a);if(!b.opened)m(\"Cannot flush a closed channel\");if(!b.buffer||b.buffer_curr==0)return 0;if(b.output)b.output(cI(b.buffer,0,b.buffer_curr));else\nb.file.write(b.offset,b.buffer,0,b.buffer_curr);b.offset+=b.buffer_curr;b.buffer_curr=0;return 0}function\nAW(a,b){if(b.name)try{var\nd=require(fT),c=d.openSync(b.name,\"rs\");return new\nax(c,b)}catch(f){}return new\nax(a,b)}var\nd6=new\nArray(3);function\ncz(a,b){Y.call(this,F(0));this.log=function(a){return 0};if(a==1&&typeof\nconsole.log==\"function\")this.log=console.log;else if(a==2&&typeof\nconsole.error==\"function\")this.log=console.error;else if(typeof\nconsole.log==\"function\")this.log=console.log;this.flags=b}cz.prototype.length=function(){return 0};cz.prototype.write=function(a,b,c,d){if(this.log){if(d>0&&c>=0&&c+d<=b.length&&b[c+d-1]==10)d--;var\ne=F(d);aZ(gj(b),c,e,0,d);this.log(e.toUtf16());return 0}m(this.fd+jw)};cz.prototype.read=function(a,b,c,d){m(this.fd+\": file descriptor is write only\")};cz.prototype.close=function(){this.log=undefined};function\nd7(a,b){if(b==undefined)b=d6.length;d6[b]=a;return b|0}function\nA$(a,b,c){var\nd={};while(b){switch(b[1]){case\n0:d.rdonly=1;break;case\n1:d.wronly=1;break;case\n2:d.append=1;break;case\n3:d.create=1;break;case\n4:d.truncate=1;break;case\n5:d.excl=1;break;case\n6:d.binary=1;break;case\n7:d.text=1;break;case\n8:d.nonblock=1;break}b=b[2]}if(d.rdonly&&d.wronly)m(aK(a)+gf);if(d.text&&d.binary)m(aK(a)+fQ);var\ne=lF(a),f=e.device.open(e.rest,d);return d7(f,undefined)}(function(){function\na(a,b){return cJ()?AW(a,b):new\ncz(a,b)}d7(a(0,{rdonly:1,altname:\"/dev/stdin\",isCharacterDevice:true}),0);d7(a(1,{buffered:2,wronly:1,isCharacterDevice:true}),1);d7(a(2,{buffered:2,wronly:1,isCharacterDevice:true}),2)}());function\nAG(a){var\nb=d6[a];if(b.flags.wronly)m(kc+a+\" is writeonly\");var\nd=null,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:false,buffer_curr:0,buffer_max:0,buffer:new\nUint8Array(ke),refill:d};bg[c.fd]=c;return c.fd}function\nls(a){var\nb=d6[a];if(b.flags.rdonly)m(kc+a+\" is readonly\");var\nd=b.flags.buffered!==undefined?b.flags.buffered:1,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:true,buffer_curr:0,buffer:new\nUint8Array(ke),buffered:d};bg[c.fd]=c;return c.fd}function\nAH(){var\nb=0;for(var\na=0;ae.buffer.length){var\ng=new\nUint8Array(e.buffer_curr+b.length);g.set(e.buffer);e.buffer=g}switch(e.buffered){case\n0:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;bB(a);break;case\n1:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)bB(a);break;case\n2:var\nf=b.lastIndexOf(10);if(f<0){e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)bB(a)}else{e.buffer.set(b.subarray(0,f+1),e.buffer_curr);e.buffer_curr+=f+1;bB(a);e.buffer.set(b.subarray(f+1),e.buffer_curr);e.buffer_curr+=b.length-f-1}break}return 0}function\nAI(a,b,c,d){var\nb=gC(b);return AJ(a,b,c,d)}function\ngw(a,b,c,d){return AI(a,be(b),c,d)}function\nlt(a,b){var\nc=am(String.fromCharCode(b));gw(a,c,0,1);return 0}function\nAK(a,b){if(b==0)gz();return a%b}function\ncH(a,b){return+(dV(a,b,false)!=0)}function\nAM(a,b){var\nd=new\nArray(b+1);d[0]=a;for(var\nc=1;c<=b;c++)d[c]=0;return d}function\nAN(a,b){a[0]=aE;a[1]=b;return 0}function\nay(a){if(a\ninstanceof\nArray&&a[0]==a[0]>>>0)return a[0];else if(d1(a))return dF;else if(d2(a))return dF;else if(a\ninstanceof\nFunction||typeof\na==\"function\")return 247;else if(a&&a.caml_custom)return j2;else\nreturn cx}function\nz2(a){var\nc={};if(a)for(var\nb=1;b=0)a=e;else\nal(\"caml_register_global: cannot locate \"+d)}}U[a+1]=b;if(c)U[c]=b}function\ngB(a,b){lu[aK(a)]=b;return 0}function\nAT(){G(fO)}function\nz(a,b){if(b>>>0>=n(a))AT();return $(a,b)}function\nd5(a){a.t&6&&cD(a);return am(a.c)}function\nAV(){return 0x7FFFFFFF/4|0}function\nAQ(){lw(U.Not_found)}function\nlz(a){var\nb=lE(H(a));if(b===undefined)AQ();return at(b)}function\nAX(){if(p.crypto)if(p.crypto.getRandomValues){var\na=p.crypto.getRandomValues(new\nInt32Array(4));return[0,a[0],a[1],a[2],a[3]]}else if(p.crypto.randomBytes){var\na=new\nInt32Array(p.crypto.randomBytes(16).buffer);return[0,a[0],a[1],a[2],a[3]]}var\nb=new\nDate().getTime(),c=b^0xffffffff*Math.random();return[0,c]}function\nbC(a){var\nb=1;while(a&&a.joo_tramp){a=a.joo_tramp.apply(null,a.joo_args);b++}return a}function\nr(a,b){return{joo_tramp:a,joo_args:b}}function\nlB(a,b){if(b.fun){a.fun=b.fun;return 0}if(typeof\nb===\"function\"){a.fun=b;return 0}var\nc=b.length;while(c--)a[c]=b[c];return 0}function\nM(a){{if(a\ninstanceof\nArray)return a;var\nb;if(p.RangeError&&a\ninstanceof\np.RangeError&&a.message&&a.message.match(/maximum call stack/i))b=U.Stack_overflow;else if(p.InternalError&&a\ninstanceof\np.InternalError&&a.message&&a.message.match(/too much recursion/i))b=U.Stack_overflow;else if(a\ninstanceof\np.Error&&bh(f7))b=[0,bh(f7),a];else\nb=[0,U.Failure,at(String(a))];if(a\ninstanceof\np.Error)b.js_error=a;return b}}function\nAZ(){return require(\"y-protocols/awareness.js\")}function\nA0(){return require(\"y-indexeddb\").IndexeddbPersistence}function\nA1(){return require(\"quill\").default}function\nA2(){return require(\"quill-cursors\")}function\nA3(){return require(\"y-webrtc\").WebrtcProvider}function\nA4(){return require(\"y-quill\")}function\nA5(){return require(\"yjs\")}function\nAw(a){switch(a[2]){case-8:case-11:case-12:return 1;default:return 0}}function\nAa(a){var\nb=e;if(a[0]==0){b+=a[1][1];if(a.length==3&&a[2][0]==0&&Aw(a[1]))var\nf=a[2],g=1;else\nvar\ng=2,f=a;b+=\"(\";for(var\nd=g;dg)b+=jH;var\nc=f[d];if(typeof\nc==\"number\")b+=c.toString();else if(c\ninstanceof\naY)b+=dE+c.toString()+dE;else if(typeof\nc==\"string\")b+=dE+c.toString()+dE;else\nb+=kJ}b+=\")\"}else if(a[0]==q)b+=a[1];return b}function\nlg(a){if(a\ninstanceof\nArray&&(a[0]==0||a[0]==q)){var\nc=bh(kO);if(c)dU(c,[a,false]);else{var\nd=Aa(a),b=bh(kf);if(b)dU(b,[0]);console.error(f_+d);if(a.js_error)throw a.js_error}}else\nthrow a}function\nAS(){var\nc=p.process;if(c&&c.on)c.on(\"uncaughtException\",function(a,b){lg(a);c.exit(2)});else if(p.addEventListener)p.addEventListener(jz,function(a){if(a.error)lg(a.error)})}AS();function\nh(a,b){return(a.l>=0?a.l:a.l=a.length)==1?a(b):bf(a,[b])}function\ni(a,b,c){return(a.l>=0?a.l:a.l=a.length)==2?a(b,c):bf(a,[b,c])}function\ny(a,b,c,d){return(a.l>=0?a.l:a.l=a.length)==3?a(b,c,d):bf(a,[b,c,d])}function\nfJ(a,b,c,d,e,f){return(a.l>=0?a.l:a.l=a.length)==5?a(b,c,d,e,f):bf(a,[b,c,d,e,f])}function\nzU(a,b,c,d,e,f,g,h){return(a.l>=0?a.l:a.l=a.length)==7?a(b,c,d,e,f,g,h):bf(a,[b,c,d,e,f,g,h])}var\nA_=undefined;Ab();var\nd_=[q,k3,-1],gH=[q,j_,-2],b4=[q,gg,-3],cL=[q,jK,-4],az=[q,jN,-7],gF=[q,kZ,-8],gG=[q,kv,-9],f=[q,kF,-11],b5=[q,kS,-12],zT=[4,0,0,0,[12,45,[4,0,0,0,0]]],ex=[0,[11,'File \"',[2,0,[11,'\", line ',[4,0,0,0,[11,k1,[4,0,0,0,[12,45,[4,0,0,0,[11,kX,[2,0,0]]]]]]]]]],'File \"%s\", line %d, characters %d-%d: %s'],jb=ge,bs=\"content\",jh=\"columns\",ji=\"rows\",fD=j0,fE=ge,jj=bu,jk=\"page_content\";as(11,b5,kS);as(10,f,kF);as(9,[q,kK,-10],kK);as(8,gG,kv);as(7,gF,kZ);as(6,az,jN);as(5,[q,j5,-6],j5);as(4,[q,kj,-5],kj);as(3,cL,jK);as(2,b4,gg);as(1,gH,j_);as(0,d_,k3);var\nlQ=\"output_substring\",lM=ba,lI=\"true\",lJ=\"false\",lU=\"CamlinternalLazy.Undefined\",lY=\"option is None\",l1=\"\\\\\\\\\",l2=\"\\\\'\",l3=\"\\\\b\",l4=\"\\\\t\",l5=\"\\\\n\",l6=\"\\\\r\",mc=\"List.init\",l$=\"hd\",mn=\"String.blit / Bytes.blit_string\",mm=\"Bytes.blit\",ml=\"String.sub / Bytes.sub\",mw=\"String.contains_from / Bytes.contains_from\",mC=\"Array.blit\",mB=\"Array.sub\",mz=\"Array.init\",mJ=[0,\"set.ml\",570,18],mF=dM,mG=dM,mH=dM,mI=dM,mQ=\"Map.remove_min_elt\",mM=dQ,mN=dQ,mO=dQ,mP=dQ,mR=\"Stdlib.Stack.Empty\",mV=\"Stdlib.Queue.Empty\",m7=\"Buffer.add_substring/add_subbytes\",m4=\"Buffer.add: cannot grow buffer\",m3=[0,jq,93,2],m2=[0,jq,94,2],m0=\"Buffer.sub\",ng=\"%c\",nh=\"%s\",ni=jR,nj=jF,nk=k5,nl=jL,nm=\"%f\",nn=\"%B\",no=\"%{\",np=\"%}\",nq=\"%(\",nr=\"%)\",ns=\"%a\",nt=\"%t\",nu=\"%?\",nv=\"%r\",nw=\"%_r\",nx=[0,L,850,23],nI=[0,L,814,21],nA=[0,L,815,21],nJ=[0,L,818,21],nB=[0,L,819,21],nK=[0,L,822,19],nC=[0,L,823,19],nL=[0,L,826,22],nD=[0,L,827,22],nM=[0,L,831,30],nE=[0,L,832,30],nG=[0,L,836,26],ny=[0,L,837,26],nH=[0,L,846,28],nz=[0,L,847,28],nF=[0,L,851,23],oY=[0,L,1558,4],oZ=\"Printf: bad conversion %[\",o0=[0,L,1626,39],o1=[0,L,1649,31],o2=[0,L,1650,31],o3=\"Printf: bad conversion %_\",o4=j4,o5=kI,o6=j4,o7=kI,o$=[0,[11,\"invalid box description \",[3,0,0]],\"invalid box description %S\"],o_=[0,0,4],oT=fS,oR=\"neg_infinity\",oS=kd,oQ=ba,oL=[0,js],oz=\"%+nd\",oA=\"% nd\",oC=\"%+ni\",oD=\"% ni\",oE=\"%nx\",oF=\"%#nx\",oG=\"%nX\",oH=\"%#nX\",oI=\"%no\",oJ=\"%#no\",oy=\"%nd\",oB=k5,oK=\"%nu\",ol=\"%+ld\",om=\"% ld\",oo=\"%+li\",op=\"% li\",oq=\"%lx\",or=\"%#lx\",os=\"%lX\",ot=\"%#lX\",ou=\"%lo\",ov=\"%#lo\",ok=\"%ld\",on=jF,ow=\"%lu\",n9=\"%+Ld\",n_=\"% Ld\",oa=\"%+Li\",ob=\"% Li\",oc=\"%Lx\",od=\"%#Lx\",oe=\"%LX\",of=\"%#LX\",og=\"%Lo\",oh=\"%#Lo\",n8=\"%Ld\",n$=jL,oi=\"%Lu\",nV=\"%+d\",nW=\"% d\",nY=\"%+i\",nZ=\"% i\",n0=\"%x\",n1=\"%#x\",n2=\"%X\",n3=\"%#X\",n4=\"%o\",n5=\"%#o\",nU=fM,nX=jR,n6=km,m_=\"@]\",m$=\"@}\",na=\"@?\",nb=\"@\\n\",nc=\"@.\",nd=\"@@\",ne=\"@%\",nf=\"@\",nN=\"CamlinternalFormat.Type_mismatch\",pe=e,pf=[0,[11,jH,[2,0,[2,0,0]]],\", %s%s\"],pN=[0,[11,f_,[2,0,[12,10,0]]],kr],pO=[0,[11,\"Fatal error in uncaught exception handler: exception \",[2,0,[12,10,0]]],\"Fatal error in uncaught exception handler: exception %s\\n\"],pM=\"Fatal error: out of memory in uncaught exception handler\",pJ=[0,[11,f_,[2,0,[12,10,0]]],kr],pD=[0,[2,0,[12,10,0]],\"%s\\n\"],pE=[0,[11,j3,0],j3],pu=\"Raised at\",pv=\"Re-raised at\",pw=\"Raised by primitive operation at\",px=\"Called from\",py=\" (inlined)\",pA=e,pz=[0,[2,0,[12,32,[2,0,[11,' in file \"',[2,0,[12,34,[2,0,[11,\", line \",[4,0,0,0,[11,k1,zT]]]]]]]]]],'%s %s in file \"%s\"%s, line %d, characters %d-%d'],pB=[0,[2,0,[11,\" unknown location\",0]],\"%s unknown location\"],pn=\"Out of memory\",po=\"Stack overflow\",pp=\"Pattern matching failed\",pq=\"Assertion failed\",pr=\"Undefined recursive module\",ph=[0,[12,40,[2,0,[2,0,[12,41,0]]]],\"(%s%s)\"],pi=e,pj=e,pk=[0,[12,40,[2,0,[12,41,0]]],\"(%s)\"],pd=[0,[4,0,0,0,0],fM],pb=[0,[3,0,0],\"%S\"],pc=kJ,pG=[0,e,\"(Cannot print locations:\\n bytecode executable program file not found)\",\"(Cannot print locations:\\n bytecode executable program file appears to be corrupt)\",\"(Cannot print locations:\\n bytecode executable program file has wrong magic number)\",\"(Cannot print locations:\\n bytecode executable program file cannot be opened;\\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)\"],pS=\"Fun.Finally_raised: \",pQ=\"Stdlib.Fun.Finally_raised\",pW=\"x\",p4=\"Hashtbl: unsupported hash table format\",pZ=e,qN=[3,0,3],qO=ba,qH=kL,qI=\"<\\/\",qJ=e,qD=kL,qE=\"<\",qF=e,qB=\"\\n\",qw=e,qx=e,qy=e,qz=e,qi=[0,e],qd=e,qe=e,qf=e,qg=e,p$=[0,e,0,e],p7=\"Stdlib.Format.String_tag\",q0=[0,kl,72,5],q1=[0,kl,81,2],q2=\"CamlinternalMod.update_mod: not a module\",qY=\"CamlinternalMod.init_mod: not a module\",q3=\"Jsoo_runtime.Error.Exn\",q4=f7,q8=[0,b,jE,10],q_=[0,b,179,10],ra=[0,b,191,10],rd=[0,b,k4,17],rm=[0,b,367,16],rn=[0,b,368,18],ro=[0,b,372,15],rp=[0,b,377,15],rq=[0,b,kP,15],rr=[0,b,386,10],rs=[0,b,362,16],rt=[0,b,517,12],ru=[0,b,459,14],rF=[0,b,686,27],rE=[0,b,651,27],ry=[0,b,560,16],rv=[0,b,550,23],rw=[0,b,j7,14],rl=[0,b,334,9],rh=[0,b,309,9],rg=[0,b,305,9],rf=[0,[11,\"Lwd: unsafe mutation (variable invalidated during evaluation) at\\n\",[15,0]],\"Lwd: unsafe mutation (variable invalidated during evaluation) at\\n%a\"],rc=[0,b,jX,14],q$=[0,b,186,14],q9=[0,b,169,14],q7=[0,b,152,14],rz=\"Lwd.Release_failure\",rN=[0,a,64,12],rX=[0,a,bw,21],r6=[0,a,205,18],r5=[0,a,k4,9],r8=[0,a,224,18],r7=[0,a,237,9],r9=[0,a,240,21],r_=[0,a,aE,21],r$=[0,a,260,21],sb=[0,a,296,14],sA=[0,a,kC,18],sB=[0,a,557,12],sC=[0,a,546,14],sz=[0,a,538,21],sx=[0,a,531,14],sv=[0,a,523,14],st=[0,a,492,29],ss=[0,a,kN,29],sr=[0,a,462,21],sm=[0,a,420,10],sn=[0,a,423,15],so=[0,a,435,10],sp=[0,a,457,2],sh=[0,a,371,24],si=[0,a,391,16],sj=[0,a,394,2],se=[0,a,315,18],sd=[0,a,317,9],r2=[0,a,193,4],r1=[0,a,jX,21],rZ=[0,a,jC,4],r0=[0,a,177,14],rU=[0,a,113,14],rS=[0,a,jY,14],rQ=[0,a,93,14],rO=[0,a,82,21],rM=[0,a,39,4],rL=[0,a,45,21],rJ=[0,a,32,14],s5=[0,X,571,12],sQ=[0,X,321,37],sR=[0,X,322,37],sT=[0,X,346,10],sU=[0,X,357,42],sS=[0,X,337,37],sW=[0,X,375,10],sX=[0,X,kP,42],sV=[0,X,338,37],s0=[0,X,425,16],s3=[0,X,513,50],s1=[0,X,480,6],sZ=[0,X,395,14],sI=[0,X,jC,57],sJ=[0,X,182,57],sK=[0,X,238,11],sD=kB,sE=kB,tR=\"debug\",tQ=\"warn\",tO=jz,tM=\"log\",tV=\"isSecureContext\",ua=[0,j1,233,16],t_=[0,j1,201,16],t5=[0,0,0],t3=[0,0,0],uH=e,uG=e,uw=[0,[0,S,ks],0],ux=[0,[0,S,gd],[0,aH,0]],uy=[0,[0,S,f3],[0,aH,0]],uz=[0,[0,S,fV],[0,aH,0]],uA=[0,[0,S,fZ],[0,aH,0]],uB=[0,[0,S,f8],[0,aH,0]],uC=[0,[0,S,f$],[0,aH,0]],uD=[0,[0,S,f6],[0,aH,0]],uE=[0,[0,S,ks],[0,aH,0]],un=[0,[0,S,gd],0],uo=[0,[0,S,f3],0],up=[0,jT,0],uq=[0,[0,S,fV],0],ur=[0,[0,S,fZ],0],us=[0,[0,S,f8],0],ut=[0,[0,S,f$],0],uu=[0,aH,0],uv=[0,[0,S,f6],0],ul=[0,[11,\"\\x1b[\",[4,0,0,0,[12,109,0]]],\"\\x1b[%dm\"],um=\"CCFormat.ANSI_codes.No_such_style\",uI=\"CCFormat.Style\",u3=[0,0],u4=\"CCFQueue.Empty\",u5=[0,0],vd=\"content-box\",ve=\"border-box\",vf=\"device-pixel-content-box\",vs=kp,vp=[0,[8,[0,0,0],0,0,[11,kT,0]],\"%fpx\"],vq=[0,[8,[0,0,0],0,0,[11,ko,0]],\"%frem\"],vr=[0,[8,[0,0,0],0,0,[11,kb,0]],\"%fem\"],vm=kT,vn=ko,vo=kb,vv=\"Common.Utils.Forward_ref.Not_set\",vx=\"Common.Utils.Forward_ref.Already_set\",vB=[1,[0,3854881,\"Failed to unmarshal data\"]],vD=[1,-358247754],vN=\"TODO not implemented\",vT=[0,80,[0,\"lwdui-controlled-scroll-wrapper\"]],vU=[0,80,\"lwdui-controlled-scroll-controls\"],vV=\"Show playing\",vZ=jI,vX=e,vY=bY,v2=[0,80,bY],v0=[0,[2,0,[11,\"--id\",0]],\"%s--id\"],v4=[0,[2,0,[11,\"-id\",0]],\"%s-id\"],v5=[0,80,jB],wf=[0,[11,kQ,[2,0,0]],\"height: %s\"],wb=[0,[2,0,[12,32,[2,0,0]]],\"%s %s\"],v$=\"grid-template-columns\",wa=[0,[2,0,[11,kX,[2,0,[12,59,0]]]],\"%s: %s;\"],wc=e,wg=[1,4.],wl=[0,80,jx],wj=[0,[11,\"height: calc(\",[2,0,[11,\" * \",[4,3,0,0,[11,\");\",0]]]]],\"height: calc(%s * %i);\"],wk=[0,[11,kQ,[2,0,[11,\" !important;\",0]]],\"height: %s !important;\"],wm=[0,80,[0,\"lwdui-lazy-table-content\"]],wn=[0,80,[0,\"lwdui-lazy-table-content-wrapper\"]],wo=[0,\"lwdui-lazy-table\",0],wF=[0,[3,0,[11,\" is not a valid action\",0]],\"%S is not a valid action\"],wx=\"retain\",wy=\"insert\",wz=jS,wA=[0,f2,72,22],ws=[0,[0,0,0,0,0,0,0]],wt=[0,f2,49,6],wu=[0,[0,0,[0,[0,0]],0,0,0,0,0,0]],wv=[0,f2,jE,6],wB=[0,[0,0,0,0,0,0,0]],wG=[0,[0,0,[0,[0,0]],0,0,0,0,0,0]],wT=\"color\",wU=bu,wW=bu,wV=\"user\",w8=\"bcPeers\",w9=\"webrtcPeers\",w_=\"removed\",w$=\"added\",w6=\"status\",w7=kn,xa=\"peers\",w5=\"awareness\",w3=[0,[11,\"stun:\",[2,0,0]],\"stun:%s\"],w1=\"signaling\",w2=[0,\"stun.l.google.com:19302\",[0,\"stun2.l.google.com:19302\",[0,\"stun3.l.google.com:19302\",[0,\"stun4.l.google.com:19302\",0]]]],w4=\"peerOpts\",xm=\"toolbar\",xl=\"cursors\",xk=\"bubble\",xn=\"snow\",xe=jv,xf=\"italic\",xg=\"underline\",xh=\"strike\",xi=\"link\",xz=[0,[11,\"vector length is \",[4,0,0,0,[11,\", but data array has length \",[4,0,0,0,[11,\" (racy access?)\",0]]]]],\"vector length is %d, but data array has length %d (racy access?)\"],xx=[0,[11,\"index \",[4,0,0,0,[11,\" is out of range [0, \",[4,0,0,0,[12,41,0]]]]],\"index %d is out of range [0, %d)\"],xt=[0,[11,\"invalid segment (ofs = \",[4,0,0,0,[11,\", len = \",[4,0,0,0,[11,\") in a sequence of length \",[4,0,0,0,0]]]]]],\"invalid segment (ofs = %d, len = %d) in a sequence of length %d\"],xM=\"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\",zK=\"tbl\",zL=[0,\"Create new table:\",0],zG=kp,zH=[0,80,[0,dL]],zI=[0,80,[0,jJ]],zB=\"Found\",zC=jt,zD=\"1fr\",zE=\"a\",zA=[2,5.],zy=[0,c,848,19],zx=[0,80,\"Add row\"],zq=[0,1],zp=\"Add map with id \",zr=[0,1],zu=e,zv=e,zs=[0,a$,1],zt=[0,a$,0],zw=[0,c,829,18],zm=[0,c,777,25],zl=e,zn=[0,c,769,23],zj=jU,zk=\"Form valid:\",zc=[0,0,0],zd=[0,80,\"Add column\"],ze=[0,[0,cv,\"String\"],[0,[0,dO,\"Checkbox\"],[0,[0,bY,\"Richtext\"],0]]],zf=[0,ge,cv,0],zg=[0,0],zh=[0,\"demo\"],zi=[0,1],y$=\"DELETE ROW\",za=jt,y_=[0,c,689,17],y5=[0,80,[0,fU]],y6=[0,[0,0,[0,1,[0,2,0]]]],y7=[0,1],y8=[0,0],y2=dG,y3=[0,80,[0,fU]],yX=jU,yY=\" -> \",yW=[0,0],yU=[0,0],yV=[0,80,\"Update\"],yQ=e,yR=e,yS=[0,80,[0,\"cell-edit-btn\"]],yT=\"\\xe2\\x9c\\x8f\\xef\\xb8\\x8f\",yZ=[0,80,[0,\"cell-edit-overlay\"]],y0=[0,80,[0,fU]],yB=\"GET\",yA=[0,c,479,17],yz=[0,c,494,11],yE=[0,c,509,19],yD=[0,c,519,13],yC=[0,c,kN,13],yF=[0,c,526,11],yL=[0,c,j7,19],yK=[0,c,539,19],yG=[0,c,532,13],yI=[0,c,548,15],yJ=[0,c,552,15],yH=[0,c,kC,11],yN=e,yO=[0,c,565,17],yM=[0,c,568,11],yu=bu,yv=ka,yo=\"New column kind:\",ym=[0,c,354,13],yi=dO,yj=bY,yk=dL,yl=cv,ye=\"Old value:\",yf=\"Action: delete\",yg=\"Key:\",yh=[0,c,279,15],yd=\"On_change\",yc=[0,c,204,22],ya=\"[blit v(%i) %i %i v'(%i)]\",x9=[0,c,147,18],xX=kh,xY=\"orange\",xZ=kt,xW=\"Received peers\",xV=\"Received synced\",xU=\"Received connected\",xP=\"modules/cursors\",xQ=\"Narines\",xR=[0,[0,\"wss://p2p.u31.fr\",0]],xS=\"testroom5267564\",xT=\"zedoc\",x1=[0,80,[0,\"p2p_status_icon\"]],x3=\"\\xe2\\x99\\xbc\",x6=[0,80,[0,\"p2p_status\"]],yr=bu,ys=ka,zM=[0,80,\"Add table\"],zP=[0,80,[0,jJ]];function\nA(a){if(typeof\na===\"number\")return 0;switch(a[0]){case\n0:return[0,A(a[1])];case\n1:return[1,A(a[1])];case\n2:return[2,A(a[1])];case\n3:return[3,A(a[1])];case\n4:return[4,A(a[1])];case\n5:return[5,A(a[1])];case\n6:return[6,A(a[1])];case\n7:return[7,A(a[1])];case\n8:var\nc=a[1];return[8,c,A(a[2])];case\n9:var\nb=a[1];return[9,b,b,A(a[3])];case\n10:return[10,A(a[1])];case\n11:return[11,A(a[1])];case\n12:return[12,A(a[1])];case\n13:return[13,A(a[1])];default:return[14,A(a[1])]}}function\nW(a,b){if(typeof\na===\"number\")return b;switch(a[0]){case\n0:return[0,W(a[1],b)];case\n1:return[1,W(a[1],b)];case\n2:return[2,W(a[1],b)];case\n3:return[3,W(a[1],b)];case\n4:return[4,W(a[1],b)];case\n5:return[5,W(a[1],b)];case\n6:return[6,W(a[1],b)];case\n7:return[7,W(a[1],b)];case\n8:var\nc=a[1];return[8,c,W(a[2],b)];case\n9:var\nd=a[2],e=a[1];return[9,e,d,W(a[3],b)];case\n10:return[10,W(a[1],b)];case\n11:return[11,W(a[1],b)];case\n12:return[12,W(a[1],b)];case\n13:return[13,W(a[1],b)];default:return[14,W(a[1],b)]}}function\nx(a,b){if(typeof\na===\"number\")return b;switch(a[0]){case\n0:return[0,x(a[1],b)];case\n1:return[1,x(a[1],b)];case\n2:var\nc=a[1];return[2,c,x(a[2],b)];case\n3:var\nd=a[1];return[3,d,x(a[2],b)];case\n4:var\ne=a[3],f=a[2],g=a[1];return[4,g,f,e,x(a[4],b)];case\n5:var\nh=a[3],i=a[2],j=a[1];return[5,j,i,h,x(a[4],b)];case\n6:var\nk=a[3],l=a[2],m=a[1];return[6,m,l,k,x(a[4],b)];case\n7:var\nn=a[3],o=a[2],p=a[1];return[7,p,o,n,x(a[4],b)];case\n8:var\nq=a[3],r=a[2],s=a[1];return[8,s,r,q,x(a[4],b)];case\n9:var\nt=a[1];return[9,t,x(a[2],b)];case\n10:return[10,x(a[1],b)];case\n11:var\nu=a[1];return[11,u,x(a[2],b)];case\n12:var\nv=a[1];return[12,v,x(a[2],b)];case\n13:var\nw=a[2],y=a[1];return[13,y,w,x(a[3],b)];case\n14:var\nz=a[2],A=a[1];return[14,A,z,x(a[3],b)];case\n15:return[15,x(a[1],b)];case\n16:return[16,x(a[1],b)];case\n17:var\nB=a[1];return[17,B,x(a[2],b)];case\n18:var\nC=a[1];return[18,C,x(a[2],b)];case\n19:return[19,x(a[1],b)];case\n20:var\nD=a[2],E=a[1];return[20,E,D,x(a[3],b)];case\n21:var\nF=a[1];return[21,F,x(a[2],b)];case\n22:return[22,x(a[1],b)];case\n23:var\nG=a[1];return[23,G,x(a[2],b)];default:var\nH=a[2],I=a[1];return[24,I,H,x(a[3],b)]}}function\nd8(a){return[0,a]}function\ncK(a){return a[1]}function\nd9(a,b,c){return a[1]===b?(a[1]=c,1):0}function\na3(a){throw g([0,b4,a],1)}function\nt(a){throw g([0,cL,a],1)}function\ncM(a){return 0<=a?a:-a|0}var\ngI=kR;function\naA(a,b){return a+b}function\nlL(b){var\ne=n(b);return function(a){var\nc=a;for(;;){if(e<=c)return aA(b,lM);var\nd=z(b,c);a:{if(48<=d){if(58>d)break a}else if(45===d)break a;return b}c=c+1|0}}(0)}function\ngJ(a,b){if(!a)return b;var\nc=a[1];return[0,c,gJ(a[2],b)]}AG(0);var\nlO=ls(1),au=ls(2);function\nb6(a,b){gw(a,b,0,n(b));return}function\ngK(a){b6(au,a);lt(au,10);return bB(au)}var\nd$=d8(function(a){return function(a){var\nb=a;for(;;){if(!b)return 0;var\nd=b[2],e=b[1];try{bB(e)}catch(f){var\nc=M(f);if(c[1]!==gH)throw g(c,0)}b=d}}(AH(0))});function\nea(a){return h(cK(d$),0)}gB(kf,ea);function\nlG(a){return a^-1}function\nlH(a){return a?lI:lJ}function\nlK(a){return e+a}function\nlN(a){return lL(gm(\"%.12g\",a))}function\nlP(a,b,c,d){if(0<=c&&0<=d&&(n(b)-d|0)>=c)return gw(a,b,c,d);return t(lQ)}function\nlR(c){for(;;){var\nd=d8(1),a=cK(d$);let\ne=d,f=a;var\nb=1-d9(d$,a,function(a){if(d9(e,1,0))h(c,0);return h(f,0)});if(!b)return b}}function\ncN(a){return bB(a)}function\nlS(a,b){lt(a,b);return}var\neb=AV(0),b7=(4*eb|0)-1|0;function\nlT(a){return 1-(typeof\na===\"number\"?1:0)}var\nlV=[q,lU,af(0)];function\nlW(a){throw g(lV,1)}function\ncO(a){var\nd=a[1];a[1]=lW;try{var\nc=h(d,0);AN(a,c);return c}catch(f){var\nb=M(f);a[1]=function(a){throw g(b,0)};throw g(b,0)}}function\nlX(a){var\nb=ay(a);if(b!==aE&&b!==bb&&b!==kD)return a;return Ay(a)}function\ncP(a){return a?a[1]:t(lY)}function\nb8(a,b){return b?[0,h(a,b[1])]:0}function\ngL(a){return a?1:0}function\nlZ(a){return a?[0,a[1],0]:0}function\nl0(a){a:{if(40<=a){if(92===a)return l1;if(gc>a)break a}else{if(32<=a){if(39<=a)return l2;break a}if(14>a)switch(a){case\n8:return l3;case\n9:return l4;case\n10:return l5;case\n13:return l6}}var\nb=F(4);B(b,0,92);B(b,1,48+(a/fX|0)|0);B(b,2,48+((a/10|0)%10|0)|0);B(b,3,48+(a%10|0)|0);return d5(b)}var\nc=F(1);B(c,0,a);return d5(c)}function\nl7(a){return 25>>0?a:a+kY|0}function\nl8(a,b){var\nd=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function\nec(a){return l8(0,a)}function\nbD(a,b){var\nc=a,d=b;for(;;){if(!c)return d;var\ne=[0,c[1],d];c=c[2];d=e}}function\na4(a){return bD(a,0)}function\ngM(a,b,c){if(b<=a)return 0;var\nd=h(c,a);return[0,d,gM(a+1|0,b,c)]}function\nl9(a,b){return[0,a,b]}function\nl_(a){return a?a[1]:a3(l$)}function\nma(a,b,c,d){var\nf=a,e=b;for(;;){if(c<=e)return f;f=[0,h(d,e),f];e=e+1|0}}function\ned(a){if(!a)return 0;var\nb=a[1];return gJ(b,ed(a[2]))}function\ncQ(a,b){if(!b)return 0;var\nc=b[2],d=h(a,b[1]);return[0,d,cQ(a,c)]}function\na5(a,b){var\nc=b;for(;;){if(!c)return 0;var\nd=c[2];h(a,c[1]);c=d}}function\nee(a,b,c){var\ne=b,d=c;for(;;){if(!d)return e;var\nf=d[2];e=i(a,e,d[1]);d=f}}function\ngN(g){function\nb(a,b){var\nd=a,c=b;for(;;){if(!c)return a4(d);var\ne=c[2],f=c[1];if(h(g,f)){d=[0,f,d];c=e}else\nc=e}}var\nc=0;return function(a){return b(c,a)}}function\ngO(g){function\nb(a,b){var\nd=a,c=b;for(;;){if(!c)return a4(d);var\ne=c[2],f=h(g,c[1]);if(f){d=[0,f[1],d];c=e}else\nc=e}}var\nc=0;return function(a){return b(c,a)}}function\nmb(a,b){return 0<=a?50>1,s=p(r,b),D=s[1],t=p(a-r|0,s[2]),E=t[2];return[0,B(D,t[1],0),E]}function\np(a,b){if(2===a){if(b){var\nj=b[2];if(j){var\nk=j[1],g=b[1],B=j[2],q=i(d,g,k),C=0===q?[0,g,0]:0>1,s=h(r,b),D=s[1],t=h(a-r|0,s[2]),E=t[2];return[0,A(D,t[1],0),E]}var\na=ec(b);return 2<=a?h(a,b)[1]:b}function\ngP(a,b){return b<=a?a:b}function\ngQ(a){return e+a}function\nmh(a,b){return lm(a,b)}function\nmi(a,b){return a<=b?a:b}function\nbi(a,b){var\nc=F(a);z_(c,0,a,b);return c}var\nmj=F(0);function\ngR(a){var\nb=ar(a),c=F(b);aZ(a,0,c,0,b);return c}function\nef(a,b,c){if(0<=b&&0<=c&&(ar(a)-c|0)>=b){var\nd=F(c);aZ(a,b,d,0,c);return d}return t(ml)}function\neg(a,b,c){return d5(ef(a,b,c))}function\ngS(a,b,c,d,e){if(0<=e&&0<=b&&(ar(a)-e|0)>=b&&0<=d&&(ar(c)-e|0)>=d){aZ(a,b,c,d,e);return}return t(mm)}function\naL(a,b,c,d,e){if(0<=e&&0<=b&&(n(a)-e|0)>=b&&0<=d&&(ar(c)-e|0)>=d){cB(a,b,c,d,e);return}return t(mn)}function\ngT(a){var\nb=a-9|0;a:{if(4>>0){if(23!==b)break a}else if(2===b)break a;return 1}return 0}function\nmq(a,b){var\nd=ar(b);if(0===d)return b;var\ne=F(d),f=d-1|0,g=0;if(f>=0){var\nc=g;for(;;){B(e,c,h(a,b0(b,c)));var\ni=c+1|0;if(f===c)break;c=i}}return e}function\ngU(a,b,c){z5(a,b,Al(c));return}function\ngV(a,b,c){a0(a,b,c);return}function\ngW(a,b){return z4(a,b)}function\ncR(a){return be(a)}function\naa(a){return d5(a)}function\nmk(a){return gR(be(a))}function\nmo(a){var\nd=ar(a),b=[0,0];for(;;){if(b[1]>=d)break;if(!gT(b0(a,b[1])))break;b[1]++}var\nc=[0,d-1|0];for(;;){if(b[1]<=c[1]&&gT(b0(a,c[1]))){c[1]--;continue}return b[1]<=c[1]?ef(a,b[1],(c[1]-b[1]|0)+1|0):mj}}function\nmp(a){var\nb=[0,0],j=ar(a)-1|0,l=0;if(j>=0){var\ng=l;for(;;){var\ne=b0(a,g);a:{b:{c:{if(32<=e){var\nh=e-34|0;if(58>>0){if(93<=h)break c}else if(56>>0)break b;var\ni=1;break a}if(11<=e){if(13===e)break b}else if(8<=e)break b}var\ni=4;break a}var\ni=2}b[1]=b[1]+i|0;var\no=g+1|0;if(j===g)break;g=o}}if(b[1]===ar(a))return gR(a);var\nc=F(b[1]);b[1]=0;var\nk=ar(a)-1|0,m=0;if(k>=0){var\nf=m;for(;;){var\nd=b0(a,f);a:{b:{c:{if(35<=d){if(92!==d){if(gc<=d)break c;break b}}else{if(32>d){if(14<=d)break c;switch(d){case\n8:B(c,b[1],92);b[1]++;B(c,b[1],98);break a;case\n9:B(c,b[1],92);b[1]++;B(c,b[1],116);break a;case\n10:B(c,b[1],92);b[1]++;B(c,b[1],110);break a;case\n13:B(c,b[1],92);b[1]++;B(c,b[1],114);break a;default:break c}}if(34>d)break b}B(c,b[1],92);b[1]++;B(c,b[1],d);break a}B(c,b[1],92);b[1]++;B(c,b[1],48+(d/fX|0)|0);b[1]++;B(c,b[1],48+((d/10|0)%10|0)|0);b[1]++;B(c,b[1],48+(d%10|0)|0);break a}B(c,b[1],d)}b[1]++;var\nn=f+1|0;if(k===f)break;f=n}}return c}function\nmr(a){return mq(l7,a)}function\ncS(a,b){return aa(bi(a,b))}function\neh(a,b,c){return aa(ef(cR(a),b,c))}function\ngX(a){var\nb=a-9|0;a:{if(4>>0){if(23!==b)break a}else if(2===b)break a;return 1}return 0}function\nmu(a,b,c,d){var\ne=c;for(;;){if(b<=e)throw g(az,1);if($(a,e)===d)return e;e=e+1|0}}function\nmv(a,b,c){var\nd=n(a);if(0<=b&&d>=b)try{mu(a,d,b,c);var\nf=1;return f}catch(f){var\ne=M(f);if(e===az)return 0;throw g(e,0)}return t(mw)}function\nei(a,b){return ly(a,b)}function\nej(a,b){return a==b?1:0}function\nms(a){if(a==e)return a;if(!gX($(a,0))&&!gX($(a,n(a)-1|0)))return a;return aa(mo(cR(a)))}function\nmt(a){return function(a,b,c){var\nd=c;for(;;){if(b<=d)return a;var\ne=$(a,d)+kY|0;a:{if(59>>0){if(33>>0)break a}else if(2===e)break a;d=d+1|0;continue}return aa(mp(cR(a)))}}(a,n(a),0)}function\nmx(a,b){return mv(a,0,b)}function\nmy(a){return aa(mr(cR(a)))}function\ngY(a,b){if(0===a)return[0];if(0>a)return t(mz);var\nd=aq(a,h(b,0)),e=a-1|0,f=1;if(e>=1){var\nc=f;for(;;){d[1+c]=h(b,c);var\ng=c+1|0;if(e===c)break;c=g}}return d}function\ncT(a,b,c,d,e){if(0<=e&&0<=b&&(a.length-1-e|0)>=b&&0<=d&&(c.length-1-e|0)>=d)return zY(a,b,c,d,e);return t(mC)}function\ngZ(a,b){var\nd=b.length-2|0,e=0;if(d>=0){var\nc=e;for(;;){h(a,b[1+c]);var\nf=c+1|0;if(d===c)break;c=f}}return 0}function\ng0(a,b){var\nd=b.length-1;if(0===d)return[0];var\ne=aq(d,h(a,b[1])),f=d-1|0,g=1;if(f>=1){var\nc=g;for(;;){e[1+c]=h(a,b[1+c]);var\ni=c+1|0;if(f===c)break;c=i}}return e}function\nmD(a,b){var\nd=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function\ncU(a){if(!a)return[0];var\nb=a[2],c=a[1],e=aq(mD(0,a),c);return function(a,b){var\nd=a,c=b;for(;;){if(!c)return e;var\nf=c[2];e[1+d]=c[1];d=d+1|0;c=f}}(1,b)}function\nmA(a,b,c){if(0<=b&&0<=c&&(a.length-1-c|0)>=b)return zZ(a,b,c);return t(mB)}function\nmE(k){function\nj(a){return a?a[4]:0}function\nd(a,b,c){var\nd=a?a[4]:0,e=c?c[4]:0,f=e<=d?d+1|0:e+1|0;return[0,a,b,c,f]}function\nl(a,b,c){var\ng=a?a[4]:0,h=c?c[4]:0;if((h+2|0)=h){var\nw=h<=g?g+1|0:h+1|0;return[0,a,b,c,w]}if(!c)return t(mI);var\nk=c[3],m=c[2],f=c[1],r=j(f);if(r<=j(k))return d(d(a,b,f),m,k);if(!f)return t(mH);var\ns=f[2],u=f[1],v=d(f[3],m,k);return d(d(a,b,u),s,v)}function\nc(a,b){if(!b)return[0,0,a,0,1];var\nd=b[3],e=b[2],f=b[1],g=i(k[1],a,e);if(0===g)return b;if(0<=g){var\nh=c(a,d);return d===h?b:l(f,e,h)}var\nj=c(a,f);return f===j?b:l(j,e,d)}function\nb(a){return[0,0,a,0,1]}var\nm=0;function\ne(a,b){var\nc=b;for(;;){if(!c)return;var\nd=c[3],f=c[2];e(a,c[1]);h(a,f);c=d}}function\nn(a,b){var\nd=a,c=b;for(;;){if(!c)return d;var\ne=c[2],f=c[1];d=[0,e,n(d,c[3])];c=f}}function\no(a,b,c){var\nd=c;for(;;){if(!d)return;var\ne=d[3],f=d[1];d=h(b,d[2])?e:f}}function\np(a){function\nc(a,b){if(3>=a>>>0)switch(a){case\n0:return[0,0,b];case\n1:if(b)return[0,[0,0,b[1],0,1],b[2]];break;case\n2:if(b){var\nh=b[2];if(h)return[0,[0,[0,0,b[1],0,1],h[1],0,2],h[2]]}break;default:if(b){var\ni=b[2];if(i){var\nj=i[2];if(j)return[0,[0,[0,0,b[1],0,1],i[1],[0,0,j[1],0,1],2],j[2]]}}}var\nk=a/2|0,l=c(k,b),e=l[2],n=l[1];if(!e)throw g([0,f,mJ],1);var\no=e[1],m=c((a-k|0)-1|0,e[2]),p=m[2];return[0,d(n,o,m[1]),p]}return c(ec(a),a)[1]}return[0,,,,c,,,,,,,,,,,,,m,,,,,,,,,,,,,,e,,,,,,,,function(a){return n(0,a)},,,,,,,,,,,function(a,b){var\nc=b;for(;;){if(!c)return;var\nd=c[2],e=c[3],f=c[1];if(h(a,d))return o(d,a,e);c=f}},,,,,,,function(a){if(!a)return m;var\nf=a[2],d=a[1];if(!f)return b(d);var\ng=f[2],e=f[1];if(!g)return c(e,b(d));var\nh=g[2],i=g[1];if(!h)return c(i,c(e,b(d)));var\nj=h[2],l=h[1];if(!j)return c(l,c(i,c(e,b(d))));if(j[2])return p(mg(k[1],a));var\nn=j[1];return c(n,c(l,c(i,c(e,b(d)))))}]}function\nmK(a){var\nb=mE(a);return[0,b[17],,,b[4],,,,,,,,,,b[31],,,,,,,,,b[39],,,,,,,,,,,,,b[50],b[57]]}function\nmL(f){function\nh(a){return a?a[5]:0}function\ne(a,b,c,d){var\ne=h(a),f=h(d),g=f<=e?e+1|0:f+1|0;return[0,a,b,c,d,g]}function\nd(a,b,c,d){var\ni=a?a[5]:0,j=d?d[5]:0;if((j+2|0)=j){var\nB=j<=i?i+1|0:j+1|0;return[0,a,b,c,d,B]}if(!d)return t(mP);var\nl=d[4],o=d[3],p=d[2],g=d[1],w=h(g);if(w<=h(l))return e(e(a,b,c,g),p,o,l);if(!g)return t(mO);var\nx=g[3],y=g[2],z=g[1],A=e(g[4],p,o,l);return e(e(a,b,c,z),y,x,A)}function\nj(a,b,c){if(!c)return[0,0,a,b,0,1];var\ne=c[4],h=c[3],k=c[2],g=c[1],o=c[5],l=i(f[1],a,k);if(0===l)return h===b?c:[0,g,a,b,e,o];if(0<=l){var\nm=j(a,b,e);return e===m?c:d(g,k,h,m)}var\nn=j(a,b,g);return g===n?c:d(n,k,h,e)}function\nn(a){var\nb=a;for(;;){if(!b)throw g(az,1);var\nc=b[1];if(!c)return[0,b[2],b[3]];b=c}}function\nc(a){if(!a)return t(mQ);var\nb=a[1];if(!b)return a[4];var\ne=a[4],f=a[3],g=a[2];return d(c(b),g,f,e)}function\no(a,b){if(!a)return b;if(!b)return a;var\ne=n(b),f=e[2],g=e[1];return d(a,g,f,c(b))}function\nk(a,b){if(!b)return 0;var\nc=b[4],h=b[3],g=b[2],e=b[1],j=i(f[1],a,g);if(0===j)return o(e,c);if(0<=j){var\nl=k(a,c);return c===l?b:d(e,g,h,l)}var\nm=k(a,e);return e===m?b:d(m,g,h,c)}function\nl(a,b){var\nc=b;for(;;){if(!c)return 0;var\nd=c[4],e=c[3],f=c[2];l(a,c[1]);i(a,f,e);c=d}}function\nm(a,b,c){var\nd=b,e=c;for(;;){if(!d)return e;var\nf=d[4],g=d[3],h=d[2],i=y(a,h,g,m(a,d[1],e));d=f;e=i}}return[0,,,,,0,,j,function(a,b){var\nc=b;for(;;){if(!c)throw g(az,1);var\ne=c[4],h=c[3],j=c[1],d=i(f[1],a,c[2]);if(0===d)return h;var\nk=0<=d?e:j;c=k}},,,,,,,,,function(a,b){var\nc=b;for(;;){if(!c)return 0;var\ne=c[4],g=c[3],h=c[1],d=i(f[1],a,c[2]);if(0===d)return[0,g];var\nj=0<=d?e:h;c=j}},,,,,,,k,,l,,,m]}function\nek(a){var\nb=mL(a);return[0,b[5],,,b[7],,,b[24],,,,,b[26],b[29],,,,,,,,,,,,,,,b[8],b[17]]}var\nel=[q,mR,af(0)];function\nbE(a){return[0,0,0]}function\nb9(a){a[1]=0;a[2]=0;return}function\na6(a,b){b[1]=[0,a,b[1]];b[2]=b[2]+1|0;return 0}function\nbF(a){var\nb=a[1];if(!b)return 0;var\nc=b[1];a[1]=b[2];a[2]=a[2]-1|0;return[0,c]}function\nbG(a){var\nb=a[1];return b?[0,b[1]]:0}function\nmS(a){var\nb=a[1];if(!b)throw g(el,1);a[1]=b[2];a[2]=a[2]-1|0;return}function\nmT(a){if(a[1])return;throw g(el,1)}function\nmU(a,b){return a5(a,b[1])}var\nmW=[q,mV,af(0)];function\nem(a){return[0,0,0,0]}function\nen(a){a[1]=0;a[2]=0;a[3]=0;return}function\neo(a,b){var\nc=[0,a,0],d=b[3];return d?(b[1]=b[1]+1|0,d[2]=c,b[3]=c,0):(b[1]=1,b[2]=c,b[3]=c,0)}function\ng1(a){var\nb=a[2];if(!b)throw g(mW,1);var\nc=b[1];if(b[2]){var\nd=b[2];a[1]=a[1]-1|0;a[2]=d;return c}en(a);return c}function\nep(a){return 0===a[1]?1:0}function\nmX(a){var\nb=a[2];return b?[0,b[1]]:0}function\nmY(a){var\nb=a[2];if(!b)return 0;var\nc=b[1];if(b[2]){var\nd=b[2];a[1]=a[1]-1|0;a[2]=d;return[0,c]}en(a);return[0,c]}function\nb_(a){var\nb=1<=a?a:1,c=b7=(d+b|0))break;c[1]=2*c[1]|0}if(b7a[3])throw g([0,f,m3],1);if((d+b|0)<=a[3])return;throw g([0,f,m2],1)}function\nb$(a,b){var\nc=n(b),d=a[2]+c|0;if(a[3]=b)return eg(a[1],b,c);return t(m0)}function\nm1(a){return a[2]}function\nm5(a,b){var\nc=a[2];if(a[3]<=c)eq(a,1);B(a[1],c,b);a[2]=c+1|0;return}function\nm6(a,b,c,d){var\ne=c<0?1:0;if(e)var\nf=e;else\nvar\nh=d<0?1:0,f=h||((n(b)-d|0)e){if(32!==e){if(43>e)break a;switch(e-43|0){case\n5:c:if(c<(d+2|0)&&1=(d+1|0))break a;var\nf=bi(d+1|0,48);a0(f,0,e);aL(b,1,f,(d-c|0)+2|0,c-1|0);return aa(f)}if(71<=e){if(5>>0)break a}else if(65>e)break a}if(ca)return b;var\nh=[0,0],i=n(b)-1|0,o=0;if(i>=0){var\nd=o;for(;;){if(9>=$(b,d)+ku>>>0)h[1]++;var\nr=d+1|0;if(i===d)break;d=r}}var\nj=h[1],k=F(n(b)+((j-1|0)/3|0)|0),l=[0,0];function\ne(a){a0(k,l[1],a);l[1]++;return}var\nf=[0,((j-1|0)%3|0)+1|0],m=n(b)-1|0,p=0;if(m>=0){var\nc=p;for(;;){var\ng=$(b,c);if(9>>0)e(g);else{if(0===f[1]){e(95);f[1]=3}f[1]--;e(g)}var\nq=c+1|0;if(m===c)break;c=q}}return aa(k)}function\noM(a,b){return cX(a,dX(nT(a),b))}function\noN(a,b){return cX(a,dX(oj(a),b))}function\noO(a,b){return cX(a,dX(ox(a),b))}function\noP(a,b){return cX(a,Ao(n7(a),b))}function\naM(d,b,c){function\na(a){switch(d[1]){case\n0:var\ne=45;break;case\n1:var\ne=43;break;default:var\ne=32}return Aj(c,b,e)}function\ne(a){var\nb=z6(c);return 3===b?c<0.?oR:oS:4<=b?oT:a}function\nf(b){var\ne=n(b);return function(a){var\nc=a;for(;;){if(c===e)return 0;var\nd=z(b,c)-46|0;a:{if(23>>0){if(55===d)break a}else if(21>>0)break a;c=c+1|0;continue}return 1}}(0)?b:aA(b,oQ)}switch(d[2]){case\n5:return e(f(gm(g6(d,b),c)));case\n6:return a(0);case\n7:return my(a(0));case\n8:return e(a(0));default:return gm(g6(d,b),c)}}function\noU(a){var\nb=l0(a),c=n(b),d=bi(c+2|0,39);cB(b,0,d,1,c);return aa(d)}function\noV(a){var\nb=g2(16);es(b,a);return g4(b)}function\ncs(a,b,c,d){var\nk=b,j=c,e=d;for(;;){if(typeof\ne===\"number\")return h(k,j);switch(e[0]){case\n0:var\nt=e[1];return function(a){return o(k,[5,j,a],t)};case\n1:var\nu=e[1];return function(a){return o(k,[4,j,oU(a)],u)};case\n2:return et(k,j,e[2],e[1],function(a){return a});case\n3:return et(k,j,e[2],e[1],nS);case\n4:return cY(k,j,e[4],e[2],e[3],oM,e[1]);case\n5:return cY(k,j,e[4],e[2],e[3],oN,e[1]);case\n6:return cY(k,j,e[4],e[2],e[3],oO,e[1]);case\n7:return cY(k,j,e[4],e[2],e[3],oP,e[1]);case\n8:return oW(k,j,e[4],e[2],e[3],e[1]);case\n9:return et(k,j,e[2],e[1],lH);case\n10:j=[7,j];e=e[1];break;case\n11:j=[2,j,e[1]];e=e[2];break;case\n12:j=[3,j,e[1]];e=e[2];break;case\n13:var\nv=e[3],w=oV(e[2]);return function(a){return o(k,[4,j,w],v)};case\n14:var\ny=e[3],z=e[2];return function(a){return o(k,j,x(nR(a[1],z),y))};case\n15:var\nA=e[1];return function(c,b){return o(k,[6,j,function(a){return i(c,a,b)}],A)};case\n16:var\nB=e[1];return function(a){return o(k,[6,j,a],B)};case\n17:j=[0,j,e[1]];e=e[2];break;case\n18:var\nl=e[1];if(0===l[0]){let\nb=j,c=k,d=e[2];k=function(a){return o(c,[1,b,[0,a]],d)};j=0;e=l[1][1]}else{let\nb=j,c=k,d=e[2];k=function(a){return o(c,[1,b,[1,a]],d)};j=0;e=l[1][1]}break;case\n19:throw g([0,f,oY],1);case\n20:var\nC=e[3],D=[8,j,oZ];return function(a){return o(k,D,C)};case\n21:var\nE=e[2];return function(a){return o(k,[4,j,dX(km,a)],E)};case\n22:var\nF=e[1];return function(a){return o(k,[5,j,a],F)};case\n23:var\nm=e[2],n=e[1];return a<50?jm(a+1|0,k,j,n,m):r(jm,[0,k,j,n,m]);default:var\np=e[3],q=e[1],s=h(e[2],0);return a<50?fF(a+1|0,k,j,p,q,s):r(fF,[0,k,j,p,q,s])}}}function\no(a,b,c){return bC(cs(0,a,b,c))}function\njm(a,b,c,d,e){if(typeof\nd===\"number\")switch(d){case\n0:return a<50?s(a+1|0,b,c,e):r(s,[0,b,c,e]);case\n1:return a<50?s(a+1|0,b,c,e):r(s,[0,b,c,e]);case\n2:throw g([0,f,o0],1);default:return a<50?s(a+1|0,b,c,e):r(s,[0,b,c,e])}switch(d[0]){case\n0:return a<50?s(a+1|0,b,c,e):r(s,[0,b,c,e]);case\n1:return a<50?s(a+1|0,b,c,e):r(s,[0,b,c,e]);case\n2:return a<50?s(a+1|0,b,c,e):r(s,[0,b,c,e]);case\n3:return a<50?s(a+1|0,b,c,e):r(s,[0,b,c,e]);case\n4:return a<50?s(a+1|0,b,c,e):r(s,[0,b,c,e]);case\n5:return a<50?s(a+1|0,b,c,e):r(s,[0,b,c,e]);case\n6:return a<50?s(a+1|0,b,c,e):r(s,[0,b,c,e]);case\n7:return a<50?s(a+1|0,b,c,e):r(s,[0,b,c,e]);case\n8:return a<50?s(a+1|0,b,c,e):r(s,[0,b,c,e]);case\n9:var\nh=d[2];return a<50?fG(a+1|0,b,c,h,e):r(fG,[0,b,c,h,e]);case\n10:return a<50?s(a+1|0,b,c,e):r(s,[0,b,c,e]);default:return a<50?s(a+1|0,b,c,e):r(s,[0,b,c,e])}}function\nfG(a,h,c,d,e){if(typeof\nd===\"number\")return a<50?s(a+1|0,h,c,e):r(s,[0,h,c,e]);switch(d[0]){case\n0:var\nb=d[1];return function(a){return ag(h,c,b,e)};case\n1:var\ni=d[1];return function(a){return ag(h,c,i,e)};case\n2:var\nj=d[1];return function(a){return ag(h,c,j,e)};case\n3:var\nk=d[1];return function(a){return ag(h,c,k,e)};case\n4:var\nl=d[1];return function(a){return ag(h,c,l,e)};case\n5:var\nm=d[1];return function(a){return ag(h,c,m,e)};case\n6:var\nn=d[1];return function(a){return ag(h,c,n,e)};case\n7:var\no=d[1];return function(a){return ag(h,c,o,e)};case\n8:var\np=d[2];return function(a){return ag(h,c,p,e)};case\n9:var\nq=d[3],t=d[2],u=I(D(d[1]),t);return function(a){return ag(h,c,W(u,q),e)};case\n10:var\nv=d[1];return function(a,b){return ag(h,c,v,e)};case\n11:var\nw=d[1];return function(a){return ag(h,c,w,e)};case\n12:var\nx=d[1];return function(a){return ag(h,c,x,e)};case\n13:throw g([0,f,o1],1);default:throw g([0,f,o2],1)}}function\nag(a,b,c,d){return bC(fG(0,a,b,c,d))}function\ns(a,b,c,d){var\ne=[8,c,o3];return a<50?cs(a+1|0,b,e,d):r(cs,[0,b,e,d])}function\net(g,f,c,d,e){if(typeof\nd===\"number\")return function(a){return o(g,[4,f,h(e,a)],c)};if(0===d[0]){var\nb=d[2],i=d[1];return function(a){return o(g,[4,f,ac(i,b,h(e,a))],c)}}var\nj=d[1];return function(a,b){return o(g,[4,f,ac(j,a,h(e,b))],c)}}function\ncY(k,j,h,d,e,f,g){if(typeof\nd===\"number\"){if(typeof\ne===\"number\")return e?function(a,b){return o(k,[4,j,bI(a,i(f,g,b))],h)}:function(a){return o(k,[4,j,i(f,g,a)],h)};var\nb=e[1];return function(a){return o(k,[4,j,bI(b,i(f,g,a))],h)}}if(0===d[0]){var\nc=d[2],l=d[1];if(typeof\ne===\"number\")return e?function(a,b){return o(k,[4,j,ac(l,c,bI(a,i(f,g,b)))],h)}:function(a){return o(k,[4,j,ac(l,c,i(f,g,a))],h)};var\nn=e[1];return function(a){return o(k,[4,j,ac(l,c,bI(n,i(f,g,a)))],h)}}var\nm=d[1];if(typeof\ne===\"number\")return e?function(a,b,c){return o(k,[4,j,ac(m,a,bI(b,i(f,g,c)))],h)}:function(a,b){return o(k,[4,j,ac(m,a,i(f,g,b))],h)};var\np=e[1];return function(a,b){return o(k,[4,j,ac(m,a,bI(p,i(f,g,b)))],h)}}function\noW(i,h,g,d,e,f){if(typeof\nd===\"number\"){if(typeof\ne===\"number\")return e?function(a,b){return o(i,[4,h,aM(f,a,b)],g)}:function(a){return o(i,[4,h,aM(f,er(f),a)],g)};var\nb=e[1];return function(a){return o(i,[4,h,aM(f,b,a)],g)}}if(0===d[0]){var\nc=d[2],j=d[1];if(typeof\ne===\"number\")return e?function(a,b){return o(i,[4,h,ac(j,c,aM(f,a,b))],g)}:function(a){return o(i,[4,h,ac(j,c,aM(f,er(f),a))],g)};var\nl=e[1];return function(a){return o(i,[4,h,ac(j,c,aM(f,l,a))],g)}}var\nk=d[1];if(typeof\ne===\"number\")return e?function(a,b,c){return o(i,[4,h,ac(k,a,aM(f,b,c))],g)}:function(a,b){return o(i,[4,h,ac(k,a,aM(f,er(f),b))],g)};var\nm=e[1];return function(a,b){return o(i,[4,h,ac(k,a,aM(f,m,b))],g)}}function\nfF(a,b,c,d,e,f){if(e){var\ni=e[1];return function(a){return oX(b,c,d,i,h(f,a))}}var\ng=[4,c,f];return a<50?cs(a+1|0,b,g,d):r(cs,[0,b,g,d])}function\noX(a,b,c,d,e){return bC(fF(0,a,b,c,d,e))}function\naN(a,b){var\nc=b;for(;;){if(typeof\nc===\"number\")return;switch(c[0]){case\n0:var\nf=c[1],g=g5(c[2]);aN(a,f);return b6(a,g);case\n1:var\nd=c[2],e=c[1];if(0===d[0]){var\ni=d[1];aN(a,e);b6(a,o4);c=i}else{var\nj=d[1];aN(a,e);b6(a,o5);c=j}break;case\n6:var\nm=c[2];aN(a,c[1]);return h(m,a);case\n7:aN(a,c[1]);return cN(a);case\n8:var\nn=c[2];aN(a,c[1]);return t(n);case\n2:case\n4:var\nk=c[2];aN(a,c[1]);return b6(a,k);default:var\nl=c[2];aN(a,c[1]);return lS(a,l)}}}function\naO(a,b){var\nc=b;for(;;){if(typeof\nc===\"number\")return;switch(c[0]){case\n0:var\nf=c[1],g=g5(c[2]);aO(a,f);return b$(a,g);case\n1:var\nd=c[2],e=c[1];if(0===d[0]){var\ni=d[1];aO(a,e);b$(a,o6);c=i}else{var\nj=d[1];aO(a,e);b$(a,o7);c=j}break;case\n6:var\nm=c[2];aO(a,c[1]);return b$(a,h(m,0));case\n7:c=c[1];break;case\n8:var\nn=c[2];aO(a,c[1]);return t(n);case\n2:case\n4:var\nk=c[2];aO(a,c[1]);return b$(a,k);default:var\nl=c[2];aO(a,c[1]);return m5(a,l)}}}function\no8(a){var\nc=a[1],b=b_(cy);return o(function(a){aO(b,a);return a3(cV(b))},0,c)}function\no9(c){if(c==e)return o_;var\nf=n(c);function\nj(a){return h(o8(o$),c)}function\nk(a){var\nb=a;for(;;){if(b===f)return b;var\nd=z(c,b);if(9!==d&&32!==d)return b;b=b+1|0}}var\ni=k(0),o=function(a,b){var\nd=b;for(;;){if(d===f)return d;if(25>>0)return d;d=d+1|0}}(i,i),a=eh(c,i,o-i|0),d=k(o),l=function(a,b){var\nd=b;for(;;){if(d===f)return d;var\ne=z(c,d);a:{if(48<=e){if(58>e)break a}else if(45===e)break a;return d}d=d+1|0}}(d,d);if(d===l)var\nm=0;else\ntry{var\nr=ln(eh(c,d,l-d|0)),m=r}catch(f){var\np=M(f);if(p[1]!==b4)throw g(p,0);var\nq=j(0),m=q}if(k(l)!==f)j(0);a:{if(a!==e&&a!==jD){if(a===\"h\"){var\nb=0;break a}if(a===\"hov\"){var\nb=3;break a}if(a===\"hv\"){var\nb=2;break a}if(a!==\"v\"){var\nb=j(0);break a}var\nb=1;break a}var\nb=4}return[0,m,b]}function\npa(d,b,c){return o(function(a){aN(b,a);return h(d,b)},0,c[1])}function\ncZ(a,b){return pa(function(a){return 0},a,b)}function\neu(a){return cZ(au,a)}function\nev(c,b){return o(function(a){var\nb=b_(64);aO(b,a);return h(c,cV(b))},0,b[1])}function\nC(a){return ev(function(a){return a},a)}var\new=d8(0);function\ney(a,b){var\nc=a[1+b];return lT(c)?ay(c)===dF?h(C(pb),c):ay(c)===kD?lN(c):pc:h(C(pd),c)}function\ng7(a,b){if(a.length-1<=b)return pe;var\nc=g7(a,b+1|0),d=ey(a,b);return i(C(pf),d,c)}function\npg(a){var\nb=a.length-1;if(2>=b>>>0)switch(b){case\n0:return pi;case\n1:return pj;default:var\ne=ey(a,1);return h(C(pk),e)}var\nc=g7(a,2),d=ey(a,1);return i(C(ph),d,c)}function\npl(d){return function(a){var\nb=a;for(;;){if(!b)return 0;var\ne=b[2],f=b[1];a:{try{var\nc=h(f,d)}catch(f){break a}if(c)return[0,c[1]]}b=e}}(cK(ew))}function\npm(a){if(a===d_)return pn;if(a===gG)return po;if(a[1]===gF){var\nb=a[2],e=b[3],i=b[2],j=b[1];return fJ(C(ex),j,i,e,e+5|0,pp)}if(a[1]===f){var\nc=a[2],g=c[3],k=c[2],l=c[1];return fJ(C(ex),l,k,g,g+6|0,pq)}if(a[1]===b5){var\nd=a[2],h=d[3],m=d[2],n=d[1];return fJ(C(ex),n,m,h,h+6|0,pr)}if(0!==ay(a))return a[1];var\no=a[1][1];return aA(o,pg(a))}function\nc0(a){var\nb=pl(a);return b?b[1]:pm(a)}function\nps(a){var\nb=[0,z7(a)];return b}function\npt(c,b){function\na(a){return a?0===c?pu:pv:0===c?pw:px}if(0===b[0]){var\nd=b[5],e=b[4],f=b[3],g=b[6]?py:pA,i=b[2],j=b[7],k=a(b[1]);return[0,zU(C(pz),k,j,i,g,f,e,d)]}if(b[1])return 0;var\nl=a(0);return[0,h(C(pB),l)]}function\npC(a,b){if(!b)return cZ(a,pE);var\nd=b[1],e=d.length-2|0,g=0;if(e>=0){var\nc=g;for(;;){var\nf=pt(c,j(d,c)[1+c]);if(f){var\ni=f[1];h(cZ(a,pD),i)}var\nk=c+1|0;if(e===c)break;c=k}}return 0}function\nc1(a,b){return pC(a,ps(b))}var\npH=pG.slice();function\npI(a,b){var\ne=c0(a);h(eu(pJ),e);c1(au,b);var\nc=AF(0);if(c<0){var\nd=cM(c);gK(j(pH,d)[1+d])}return cN(au)}var\npK=[0];function\ng8(a){var\nb=lh(0);return b}function\npL(a,b){try{var\nd=b?pK:g8(0);try{ea(0)}catch(f){}try{var\nf=pI(a,d),e=f}catch(f){var\ni=M(f),j=g8(0),k=c0(a);h(eu(pN),k);c1(au,d);var\nl=c0(i);h(eu(pO),l);c1(au,j);var\ne=cN(au)}return e}catch(f){var\nc=M(f);if(c===d_)return gK(pM);throw g(c,0)}}gB(kO,function(a,b){try{var\nc=pL(a,b);return c}catch(f){return 0}});function\npF(a){for(;;){var\nb=cK(ew),c=1-d9(ew,b,[0,a,b]);if(!c)return c}}function\npP(a){return lh(a)}var\npR=[q,pQ,af(0)];pF(function(a){return a[1]===pR?[0,aA(pS,c0(a[2]))]:0});function\npT(a){return AD(a,0,n(a))}function\npU(a){return[0,aq(55,0),0]}function\npV(a,b){function\nl(a,b){return pT(aA(a,gQ(b)))}function\nm(a){var\nb=z(a,3)<<24,c=z(a,2)<<16,d=z(a,1)<<8;return((z(a,0)+d|0)+c|0)+b|0}var\ng=0===b.length-1?[0,0]:b,h=g.length-1,c=0;for(;;){j(a[1],c)[1+c]=c;var\ns=c+1|0;if(54===c)break;c=s}var\nf=[0,pW],i=54+gP(55,h)|0,n=0;if(i>=0){var\nd=n;for(;;){var\ne=d%55|0,k=AK(d,h),o=j(g,k)[1+k];f[1]=l(f[1],o);var\np=m(f[1]),q=(j(a[1],e)[1+e]^p)&j9;j(a[1],e)[1+e]=q;var\nr=d+1|0;if(i===d)break;d=r}}a[2]=0;return}function\npX(a){var\nb=pU(0);pV(b,a);return b}function\ng9(a){return pX(AX(0))}function\nc2(a){a[2]=(a[2]+1|0)%55|0;var\nb=a[2],c=j(a[1],b)[1+b],d=(a[2]+24|0)%55|0,e=(j(a[1],d)[1+d]+(c^(c>>>25|0)&31)|0)&j9,f=a[2];j(a[1],f)[1+f]=e;return e}function\ng_(a){var\nb=gu(d0(c2(a)),9),c=gu(d0(c2(a)),9);return lk(b,lk(ll(c,21),ll(gu(d0(c2(a)),8),42)))}function\npY(a){var\nb=a.length-1<4?1:0,c=b||(a[4]<0?1:0);return c}try{var\nzS=lz(kE),hc=zS}catch(f){var\ng$=M(f);if(g$!==az)throw g(g$,0);try{var\nzR=lz(\"CAMLRUNPARAM\"),hb=zR}catch(f){var\nha=M(f);if(ha!==az)throw g(ha,0);var\nhb=pZ}var\nhc=hb}var\nc3=[bb,function(a){return g9(0)}],p0=mx(hc,82);function\np1(a,b){var\nc=a;for(;;){if(b<=c)return c;if(eb<(c*2|0))return c;c=c*2|0}}function\nhd(a,b){var\nf=a?a[1]:p0,c=p1(16,b);if(f)var\nd=ay(c3),g=aE===d?c3[1]:bb===d?cO(c3):c3,e=c2(g);else\nvar\ne=0;return[0,0,aq(c,0),e,c]}function\np2(m,b,c,d){var\ng=d.length-1,f=aq(g,0),i=c.length-2|0;function\nn(a){var\nc=a;for(;;){if(!c)return;var\ni=c[1],l=c[2],n=c[3],g=b?c:[0,i,l,0],e=h(m,i),k=j(f,e)[1+e];if(k)k[3]=g;else\nj(d,e)[1+e]=g;j(f,e)[1+e]=g;c=n}}var\no=0;if(i>=0){var\ne=o;for(;;){n(j(c,e)[1+e]);var\nr=e+1|0;if(i===e)break;e=r}}if(b){var\nk=g-1|0,p=0;if(k>=0){var\na=p;for(;;){var\nl=j(f,a)[1+a];if(l)l[3]=0;var\nq=a+1|0;if(k===a)break;a=q}}}return}function\np3(a,b){var\nc=b[2],d=(c.length-1)*2|0,e=d>>0)return;return hk(a,d)}function\nqb(a){var\nb=mY(a[28]);if(!b)return;var\nc=b[1],d=c[1];a[12]=a[12]-c[3]|0;var\ne=an(d);a[9]=a[9]+e|0;return}function\nqc(a,b,c){if(typeof\nc===\"number\")switch(c){case\n0:var\nj=bG(a[3]);if(!j)return;var\nk=j[1][1],l=function(a,b){if(!b)return[0,a,0];var\nc=b[1],d=b[2];return Az(a,c)?[0,a,b]:[0,c,l(a,d)]};k[1]=l(a[6]-a[9]|0,k[1]);return;case\n1:bF(a[2]);return;case\n2:bF(a[3]);return;case\n3:var\nm=bG(a[2]);return m?hk(a,m[1][2]):c5(a);case\n4:var\no=a[10]!==(a[6]-a[9]|0)?1:0;return o?qb(a):o;default:var\np=bF(a[5]);if(p)return eA(a,h(a[25],p[1]));return}switch(c[0]){case\n0:return hj(a,b,c[1]);case\n1:var\nd=c[2],f=c[1],q=d[1],z=d[2],r=bG(a[2]);if(!r)return;var\ns=r[1],e=s[2];switch(s[1]){case\n0:return bJ(a,f);case\n1:return bj(a,d,e);case\n2:return bj(a,d,e);case\n3:return a[9]<(b+n(q)|0)?bj(a,d,e):bJ(a,f);case\n4:return a[11]?bJ(a,f):a[9]<(b+n(q)|0)?bj(a,d,e):((a[6]-e|0)+z|0)=a[14]){a[13]=hi;hl(a);if(b)c5(a);return qp(a)}hq(a,0)}}function\neD(a,b,c){var\nd=a[14]=c)return y(a[17],hu,0,c);y(a[17],hu,0,80);c=c-80|0}}function\nqC(a){return a[1]===cb?aA(qE,aA(a[2],qD)):qF}function\nqG(a){return a[1]===cb?aA(qI,aA(a[2],qH)):qJ}function\nqK(a){return 0}function\nqL(a){return 0}function\nqM(a,b,c,d,e){var\ng=em(0),h=[0,hg,qN,0];eo(h,g);var\nf=bE(0);eB(f);a6([0,1,h],f);var\ni=78,j=bE(0),k=bE(0),l=bE(0);return[0,f,bE(0),l,k,j,i,10,68,i,0,1,1,1,1,gI,qO,a,b,c,d,e,0,0,qC,qG,qK,qL,g]}function\nhw(a,b){var\nc=qM(a,b,function(a){return 0},function(a){return 0},function(a){return 0});c[19]=function(a){return qA(c,a)};c[20]=function(a){return hv(c,a)};c[21]=function(a){return hv(c,a)};return c}function\nhx(d){return hw(function(a,b,c){return lP(d,a,b,c)},function(a){return cN(d)})}function\neE(d){return hw(function(a,b,c){return m6(d,a,b,c)},function(a){return 0})}var\nqP=dJ,qQ=function(a){return b_(qP)}(0),qR=hx(lO),qS=hx(au);eE(qQ);function\nqk(a,b){if(a[22]){a6(b,a[4]);h(a[26],b)}var\nc=a[23];return c?cc(a,[0,c4,[5,b],0]):c}function\nqr(a,b){return ht(a,n(b),b)}function\nqs(a,b){hs(a,1);return h(a[18],0)}function\nqt(a,b){var\nc=a[14]=0){var\nc=g;for(;;){qX(e,c,a,j(b,c)[1+c]);var\nh=c+1|0;if(f===c)break;c=h}}return e}function\nhA(a,b){if(typeof\nb!==\"number\"&&0===b[0])return hz(a,b[1]);return a3(qY)}function\nqZ(a,b,c,d){if(typeof\nc!==\"number\"){if(0===c[0])return hB(c[1],a[1+b],d);return}if(2!==c){a[1+b]=d;return}if(0===ay(d)&&4===d.length-1){var\ne=0,h=a[1+b];for(;;){h[1+e]=d[1+e];var\ni=e+1|0;if(3===e)return;e=i}}throw g([0,f,q0],1)}function\nhB(a,b,c){if(0===ay(c)&&a.length-1<=c.length-1){var\ne=a.length-2|0,h=0;if(e>=0){var\nd=h;for(;;){var\ni=c[1+d];qZ(b,d,j(a,d)[1+d],i);var\nk=d+1|0;if(e===d)break;d=k}}return}throw g([0,f,q1],1)}function\nhC(a,b,c){if(typeof\na!==\"number\"&&0===a[0])return hB(a[1],b,c);return a3(q2)}var\neF=[q,q3,af(0)];qV(q4,[0,eF,[0]]);(function(a){throw a});function\neG(a){return[0,a]}function\nR(a){return[0,a]}function\nc7(a){return 0===a[0]?[0,a[1]]:0}var\nbL=[0,function(a){return a}(0)];function\nbM(a){return[1,0,0,0,a]}function\nk(a,b){return 0===a[0]?[0,h(b,a[1])]:bM([0,a,b])}function\nbN(a,b,c){if(0===a[0]){var\nd=a[1];if(0===b[0])return[0,i(c,d,b[1])]}return bM([1,a,b,c])}function\nhD(a){return 0===a[0]?a[1]:bM([4,a,0])}function\nhE(a,b,c){switch(c[0]){case\n0:throw g([0,f,q7],1);case\n1:c[3]=[0,b,a,c[3]];return;default:c[2]=[0,b,a,c[2]];return}}function\neH(a,b){if(!b)throw g([0,f,q8],1);if(b[2]===a)return[0,b[1],b[3]];var\nc=eH(a,b[3]),d=c[1];b[3]=c[2];return[0,d,b]}function\nce(a,b){switch(b[0]){case\n0:throw g([0,f,q9],1);case\n1:var\nc=eH(a,b[3]),e=c[1];b[3]=c[2];return e;default:var\nd=eH(a,b[2]),h=d[1];b[2]=d[2];return h}}function\nhF(a,b,c,d){var\ne=d;for(;;){if(!e)throw g([0,f,q_],1);if(e[1]===b&&e[2]===a){e[1]=c;return}e=e[3]}}function\neI(a,b,c,d){switch(d[0]){case\n0:throw g([0,f,q$],1);case\n1:return hF(a,b,c,d[3]);default:return hF(a,b,c,d[2])}}function\nhG(a,b){var\nc=b;for(;;){if(!c)throw g([0,f,ra],1);if(c[2]===a)return c[1];c=c[3]}}function\nrb(a,b){switch(b[0]){case\n0:throw g([0,f,rc],1);case\n1:return hG(a,b[3]);default:return hG(a,b[2])}}function\naU(a,b,c,d){switch(d[0]){case\n0:throw g([0,f,rd],1);case\n1:var\nj=d[1];if(typeof\nj===\"number\"&&!j){if(!c)return;if(b[1])return;b[1]=1;return}var\nk=d[4];if(7===k[0]){var\nn=k[2];if(1===n[0]){var\no=n[1];if(typeof\no===\"number\"){if(!o&&c){if(b[1])return;b[1]=1;return}}else if(c)return}}var\nl=d[1];a:{if(typeof\nl===\"number\"&&l){var\ne=1;break a}var\ne=c}d[1]=0;var\nm=d[2];return a<50?jn(a+1|0,b,e,m):r(jn,[0,b,e,m]);default:var\ni=d[1];d[1]=0;if(typeof\ni===\"number\"){if(!i)return;b[1]=2;return}var\np=i[1];if(c)b[1]=2;return h(d[3],p)}}function\na7(a,b,c){return bC(aU(0,a,b,c))}function\njn(a,b,c,d){if(typeof\nd===\"number\")return;switch(d[0]){case\n0:var\nf=d[1];return a<50?aU(a+1|0,b,c,f):r(aU,[0,b,c,f]);case\n1:var\ng=d[2];a7(b,c,d[1]);return a<50?aU(a+1|0,b,c,g):r(aU,[0,b,c,g]);case\n2:var\nh=d[3],l=d[2];a7(b,c,d[1]);a7(b,c,l);return a<50?aU(a+1|0,b,c,h):r(aU,[0,b,c,h]);case\n3:var\ni=d[4],m=d[3],n=d[2];a7(b,c,d[1]);a7(b,c,n);a7(b,c,m);return a<50?aU(a+1|0,b,c,i):r(aU,[0,b,c,i]);default:var\no=d[1];d[1]=0;var\nk=o-1|0,p=0;if(k>=0){var\ne=p;for(;;){a7(b,c,j(d[3],e)[1+e]);var\nq=e+1|0;if(k===e)break;e=q}}return}}function\nre(a){return i(cZ(au,rf),c1,Ac(20))}function\nc8(a,b){var\nc=[0,0];a7(c,a,b);var\nd=2<=c[1]?1:0;return d?re(0):d}function\nad(a){return bM([5,a])}function\nao(a){return a}function\n_(a,b){if(1===a[0]){var\nc=a[4];if(5===c[0]){c[1]=b;return c8(0,a)}}throw g([0,f,rg],1)}function\nbk(a){if(1===a[0]){var\nb=a[4];if(5===b[0])return b[1]}throw g([0,f,rh],1)}function\nbO(a,b,c){var\nk=a,h=b,d=c;for(;;)switch(d[0]){case\n0:return k;case\n1:var\ne=d[2];if(typeof\ne===\"number\")throw g([0,f,rm],1);switch(e[0]){case\n0:if(e[1]!==h)throw g([0,f,rn],1);var\no=0;break;case\n1:var\nB=e[2],C=e[1];if(C===h)var\nD=[0,B];else{if(B!==h)throw g([0,f,ro],1);var\nD=[0,C]}var\no=D;break;case\n2:var\nu=e[3],v=e[2],w=e[1];if(w===h)var\nx=[1,v,u];else if(v===h)var\nx=[1,w,u];else{if(u!==h)throw g([0,f,rp],1);var\nx=[1,w,v]}var\no=x;break;case\n3:var\np=e[4],q=e[3],r=e[2],s=e[1];if(s===h)var\nt=[2,r,q,p];else if(r===h)var\nt=[2,s,q,p];else if(q===h)var\nt=[2,s,r,p];else{if(p!==h)throw g([0,f,rq],1);var\nt=[2,s,r,q]}var\no=t;break;default:var\nn=ce(d,h);if(j(e[3],n)[1+n]!==h)throw g([0,f,rr],1);var\nm=e[2]-1|0;e[2]=m;if(n>>2|0))var\nU=mA(e[3],0,K>>>1|0),L=[4,e[1],e[2],U];else\nvar\nL=e;var\nJ=L}var\no=J}d[2]=o;if(typeof\no!==\"number\")return k;var\ny=d[1];d[1]=1;var\nl=d[4];switch(l[0]){case\n0:h=d;d=l[1];break;case\n1:var\nN=l[2];k=bO(k,d,l[1]);h=d;d=N;break;case\n2:var\nO=l[2];k=bO(k,d,l[1]);h=d;d=O;break;case\n3:var\nP=l[2];k=bO(k,d,l[1]);h=d;d=P;break;case\n4:var\nz=l[2],A=bO(k,d,l[1]);if(!z)return A;var\nQ=z[1];l[2]=0;k=A;h=d;d=Q;break;case\n5:return k;case\n6:if(typeof\ny===\"number\")return k;var\nR=y[1];try{i(l[2],d,R);return k}catch(f){var\nS=M(f);return[0,[0,S,pP(0)],k]}default:var\nT=l[1];k=bO(k,d,l[2]);h=d;d=T}break;default:throw g([0,f,rs],1)}}function\na8(a,b){var\ne=a,c=b;for(;;)switch(c[0]){case\n0:return;case\n1:var\nn=typeof\nc[2]===\"number\"?1:0,d=c[2];if(typeof\nd===\"number\")var\nk=[0,e];else\nswitch(d[0]){case\n0:var\nk=[1,e,d[1]];break;case\n1:var\nk=[2,e,d[1],d[2]];break;case\n2:var\nk=[3,e,d[1],d[2],d[3]];break;case\n3:var\no=[0,d[1],d[2],d[3],d[4],e,bL,bL,bL],l=0;for(;;){hE(c,l,j(o,l)[1+l]);var\nw=l+1|0;if(4===l)break;l=w}var\nk=[4,5,5,o];break;default:var\ni=d[2];if(i>>1|0)}function\nhN(a,b,c){if(typeof\na!==\"number\"){if(0!==a[0]){if(a[2]!==b)throw g([0,f,r2],1);a[2]=c;return}if(a[2]===b){a[2]=c;return}if(a[4]===b){a[4]=c;return}}throw g([0,f,r1],1)}function\nfI(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=c[4];if(typeof\nd!==\"number\"&&1!==d[0]){var\nh=c[5],e=d[2];if(typeof\ne===\"number\")var\ni=0;else{if(0!==e[0])throw g([0,f,r6],1);e[5]=c;var\ni=e}d[2]=c;c[4]=i;c[5]=d;d[5]=h;hN(h,c,d);eQ(b,c);return a<50?ct(a+1|0,b,d):r(ct,[0,b,d])}}throw g([0,f,r5],1)}function\nr3(a,b){return bC(fI(0,a,b))}function\nfH(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=c[2];if(typeof\nd!==\"number\"&&1!==d[0]){var\nh=c[5],e=d[4];if(typeof\ne===\"number\")var\ni=0;else{if(0!==e[0])throw g([0,f,r8],1);e[5]=c;var\ni=e}d[4]=c;c[2]=i;c[5]=d;d[5]=h;hN(h,c,d);eQ(b,c);return a<50?ct(a+1|0,b,d):r(ct,[0,b,d])}}throw g([0,f,r7],1)}function\nr4(a,b){return bC(fH(0,a,b))}function\njp(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=c[4];a:if(typeof\nd!==\"number\"&&0===d[0]){var\ne=bQ(d[2]);if(eP(bQ(d[4]),e)){r4(b,d);break a}}return a<50?fI(a+1|0,b,c):r(fI,[0,b,c])}throw g([0,f,r9],1)}function\njo(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=c[2];a:if(typeof\nd!==\"number\"&&0===d[0]){var\ne=bQ(d[4]);if(eP(bQ(d[2]),e)){r3(b,d);break a}}return a<50?fH(a+1|0,b,c):r(fH,[0,b,c])}throw g([0,f,r_],1)}function\nct(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=bQ(c[2]),e=bQ(c[4]);return d>>2|0}function\naB(a,b){if(typeof\na===\"number\")var\nc=b;else{if(typeof\nb!==\"number\"){var\nd=da(b);return[1,(hS(da(a),d)+1|0)<<2,a,b]}var\nc=a}return c}function\nhT(a){return typeof\na===\"number\"?0:0===a[0]?[0,a[2]]:[1,a[2],a[3]]}var\neR=1,eS=2,sF=3;function\nhU(a){return-1===a?1:0}function\neT(a){return-1!==a?1:0}function\nbR(a){return(a&3)===3?1:0}function\nhV(a){return(a&3)===1?1:0}function\nhW(a){return(a&3)===2?1:0}function\nhX(a){return a|3}function\nsG(a){return a>>>2|0}function\nhY(a){return a<<2|2}function\nci(a){return a&lG(sF)}function\nhZ(a){return a[2]}function\nh0(a){return a[3]}function\nh1(a){return[0,0,0,0]}function\ndb(a){a[1]=a[1]+1|0;return}function\ndc(a){a[2]=a[2]+1|0;return}function\ndd(a){a[3]=a[3]+1|0;return}function\neU(a,b,c){var\nd=c;for(;;){if(typeof\nd===\"number\")return;if(0===d[0]){var\ne=d[1],i=(e&3)!==3?1:0,l=i?0!==(e&3)?1:0:i;if(l){if(0!==(e&b))throw g([0,f,sI],1);db(a);dd(a);d[1]=e|3}return}var\nh=d[1],j=(h&3)!==3?1:0,k=j?0!==(h&3)?1:0:j;if(!k)return k;if(0!==(h&b))throw g([0,f,sJ],1);db(a);dd(a);d[1]=h|3;eU(a,b,d[2]);d=d[3]}}function\nde(a,b,c,d){if(typeof\nd===\"number\")return;if(0===d[0]){var\ne=d[1];if(0===(e&c)){db(a);if(0===(e&3))d[1]=e|c;else{d[1]=-1;dd(a);dc(a)}}var\ng=-1!==e?1:0,h=g?(e&3)===3?1:0:g;return h?(d[1]=-1,dc(a)):h}var\nf=d[1];if(0===(f&c)){db(a);if(0===(f&3)){d[1]=f|c;eo(d,b)}else{d[1]=-1;dd(a);dc(a);eU(a,c,d[2]);eU(a,c,d[3])}}var\ni=-1!==f?1:0,j=i?(f&3)===3?1:0:i;return j?(d[1]=-1,dc(a)):j}function\neV(a,b,c){var\nd=g1(b);if(typeof\nd!==\"number\"&&1===d[0]){var\ne=(d[1]&3)===c?1:0;return e?(de(a,b,c,d[2]),de(a,b,c,d[3])):e}throw g([0,f,sK],1)}function\nh2(a,b,c){for(;;){if(ep(b))return;eV(a,b,c)}}function\nsL(a,b,c,d){for(;;){if(ep(c))return h2(b,d,eS);if(ep(d))return h2(a,c,eR);eV(a,c,eR);eV(b,d,eS)}}function\neW(a){var\nb=a[6];a[6]=b+1|0;return b}function\neX(a){var\nb=a;for(;;){if(typeof\nb===\"number\")return;if(0===b[0]){var\nc=b[1];if(typeof\nc!==\"number\"&&0===c[0]){var\ne=c[1],i=eT(e),l=i?bR(e):i;if(l)c[1]=ci(e);return}throw g([0,f,sQ],1)}var\nd=b[1];if(typeof\nd!==\"number\"&&1===d[0]){var\nh=d[1],m=b[4],n=b[3],j=eT(h),k=j?bR(h):j;if(!k)return k;d[1]=ci(h);eX(n);b=m;continue}throw g([0,f,sR],1)}}function\nh3(a,b){var\nc=b;for(;;){if(typeof\nc===\"number\")return;if(0===c[0]){var\nd=c[1];if(typeof\nd!==\"number\"&&0===d[0]){var\ne=d[1],u=c[2];if(!hV(e)){if(hU(e)){var\nk=eW(a);j(a[4],k)[1+k]=d;j(a[5],k)[1+k]=[0,c,0];d[1]=hY(k);return}if(hW(e)){var\nn=sG(e),v=[0,c,j(a[5],n)[1+n]];j(a[5],n)[1+n]=v;return}var\nq=bR(e);if(q)throw g([0,f,sU],1);return q}var\nm=a[2];if(-1a[3])throw g([0,f,sT],1)}d[1]=ci(e);return}throw g([0,f,sS],1)}var\nh=c[1];if(typeof\nh!==\"number\"&&1===h[0]){var\nr=c[4],s=c[3],i=h[1],w=c[2];if(hU(i)){var\nl=eW(a);j(a[4],l)[1+l]=h;j(a[5],l)[1+l]=[0,c,0];h[1]=hY(l);eX(s);return eX(r)}if(!hV(i)){if(hW(i)){var\no=i>>>2|0,x=[0,c,j(a[5],o)[1+o]];j(a[5],o)[1+o]=x;return}var\nt=bR(i);if(t)throw g([0,f,sX],1);return t}if(-1a[3])throw g([0,f,sW],1)}h[1]=ci(i);h3(a,s);c=r;continue}throw g([0,f,sV],1)}}function\ncj(a,b){if(typeof\nb===\"number\")return 0;if(0!==b[0]){var\ni=b[1];if(-1===i){var\nl=eW(a);b[1]=0;j(a[4],l)[1+l]=b;var\np=cj(a,b[2]);return[1,b,0,p,cj(a,b[3])]}if(!bR(i)){b[1]=ci(b[1]);var\nr=cj(a,b[2]);return[1,b,0,r,cj(a,b[3])]}var\nd=i>>>2|0,k=j(a[5],d)[1+d];if(!k)throw g([0,f,s0],1);var\nm=k[2],q=k[1];j(a[5],d)[1+d]=m;if(0===m)b[1]=0;return q}var\ne=b[1];if(eT(e)&&bR(e)){var\nc=e>>>2|0,h=j(a[5],c)[1+c];if(!h)return[0,b,0];var\nn=h[2],o=h[1];j(a[5],c)[1+c]=n;return o}b[1]=0;return[0,b,0]}var\neY=[0,0,[0],0,0];function\nsH(a){return a[1]}function\nsM(a){return a[1]}function\nsN(a){return a[2]}function\nsO(a,b){var\nc=h1(0),d=h1(0),e=em(0),f=em(0);de(c,e,eR,a);de(d,f,eS,b);sL(c,d,e,f);return[0,c,d]}function\nsP(a){if(typeof\na===\"number\")return;if(0===a[0]){a[1]=0;return}var\nb=da(a[3]);a[1]=(hS(da(a[2]),b)+1|0)<<2;return}function\nsY(a){var\ne=a[6]-1|0,h=0;if(e>=0){var\nb=h;for(;;){var\nc=j(a[4],b)[1+b];if(typeof\nc!==\"number\")if(0===c[0])c[1]=hX(c[1]);else\nc[1]=hX(c[1]);var\nd=j(a[5],b)[1+b];if(!d)throw g([0,f,sZ],1);if(d[2]){var\ni=a4(d);j(a[5],b)[1+b]=i}var\nk=b+1|0;if(e===b)break;b=k}}return}function\nh4(a,b,c){if(typeof\nb===\"number\"){if(typeof\nc===\"number\")return[0,eY,0]}else if(b[1]===c)return[0,eY,b];var\nt=typeof\nb===\"number\"?ch:b[1],m=sO(t,c),i=sM(m),n=sN(m),u=h0(n),v=h0(i)+u|0,o=sH(i)-v|0,w=hZ(n),p=hZ(i)+w|0,x=0,y=aq(p,0),z=aq(p,0),A=a?o:-1,B=a?0:-1,C=a?aq(o,0):[0],d=[0,C,B,A,z,y,x];h3(d,b);if(d[2]!==d[3])throw g([0,f,s1],1);sY(d);var\nq=cj(d,c),r=d[6]-1|0;if(r>=0){var\nh=r;for(;;){sP(j(d[4],h)[1+h]);var\nF=h-1|0;if(0===h)break;h=F}}if(!a)return[0,eY,q];var\nk=[0,0],l=[0,0],s=d[6]-1|0,D=0;if(s>=0){var\ne=D;for(;;){a5(function(a){if(typeof\na!==\"number\")if(0===a[0]){var\nb=a[2];if(b){k[1]=[0,b[1],k[1]];return 0}}else{var\nc=a[2];if(c){l[1]=[0,c[1],l[1]];return 0}}return 0},j(d[5],e)[1+e]);var\nE=e+1|0;if(s===e)break;e=E}}return[0,[0,d[2],d[1],k[1],l[1]],q]}function\ns2(d,b){if(typeof\nb===\"number\")return 0;function\nc(a){a:if(typeof\na!==\"number\"){b:{if(0===a[0]){var\nb=a[1];if(typeof\nb!==\"number\"&&0===b[0]){var\ne=a[2];if(e){var\nj=e[1];break b}var\nk=h(d[1],b[2]);a[2]=[0,k];return k}break a}var\nl=a[2];if(!l){var\nn=c(a[3]),o=c(a[4]),m=i(d[2],n,o);a[2]=[0,m];return m}var\nj=l[1]}return j}throw g([0,f,s3],1)}return[0,c(b)]}function\ndf(a,b){return[0,[0,a,b],0]}function\ndg(a){return s2(a[1],a[2])}function\ns4(a,b){var\nc=a[1];return[0,c,h4(0,a[2],b)[2]]}function\neZ(a,b){var\nd=a[1],c=h4(1,a[2],b);return[0,c[1],[0,d,c[2]]]}function\ndh(a,b,c,d){var\ne=[0,d];if(w===a)var\nh=c[1],g=0;else if(kg<=a)var\nh=c[2].length-1,g=c[1];else\nvar\nh=c[2].length-1,g=0;var\nk=h-1|0;if(k>=g){var\nf=g;for(;;){var\nl=j(c[2],f)[1+f];if(l)e[1]=i(b,l[1],e[1]);var\nm=f+1|0;if(k===f)break;f=m}}if(kg>a)a5(function(a){e[1]=i(b,a,e[1]);return 0},c[3]);if(w!==a)a5(function(a){e[1]=i(b,a,e[1]);return 0},c[4]);return}function\ne0(a,b,c){if(typeof\nc===\"number\")throw g([0,f,s5],1);if(0===c[0])return h(a,c[2]);var\nd=e0(a,b,c[3]);return i(b,e0(a,b,c[2]),d)}function\nbl(a,b,c){var\nd=b[2],e=b[1],f=c7(c);if(f){var\ng=f[1];return typeof\ng===\"number\"?R(e):R(e0(a,d,g))}var\nh=[0,df(a,d)];return k(c,function(a){var\nb=s4(h[1],a);h[1]=b;var\nc=dg(b);return c?c[1]:e})}var\naP=[0,ch,aB];function\ns6(a,b){return c9(b,aP,a)}function\ndi(a){return s6(a,J)}function\nh5(a){function\ne(a,b){var\nc=a,d=b;for(;;){if(typeof\nc===\"number\")return d;if(0===c[0])return[0,c[2],d];var\nf=e(c[3],d);c=c[2];d=f}}return e(a,0)}var\nh6=[0,R(0),function(a,b){return bN(a,b,aB)}];function\ne1(c,b){return bl(function(a){return J(h(c,a))},aP,b)}function\ns7(a,b){return hD(bl(b,h6,a))}function\nbm(a){return s7(a,function(a){return k(a,J)})}var\nbn=e;function\ns8(a){return a[k2]}function\nh7(a,b){var\nc=a?a[1]:bn;return AA(b).join(c)}function\ne2(a){return 0===s8(a)?1:0}function\ndj(a,b){return lf(a,b)}p[\"Number\"];var\ne3=null,s9=undefined;function\nck(a){return a===e3?1:0}function\ns_(a){return a===s9?1:0}function\nbS(a){var\nb=ck(a);return b?b:s_(a)}function\nh8(a){return 1-bS(a)}function\ndk(a,b){return bS(b)?0:[0,h(a,b)]}var\nl=p;function\ne4(a,b){var\nc=a[b];return bS(c)?0:[0,c]}function\ne5(a){return new\nl[j8](a)}function\nh9(a){return a[k2]}function\nh_(c,b){return gY(h9(b),function(a){return h(c,b[a])})}function\nh$(a,b){var\nd=b.length-1,e=e5(d),f=d-1|0,g=0;if(f>=0){var\nc=g;for(;;){e[c]=h(a,j(b,c)[1+c]);var\ni=c+1|0;if(f===c)break;c=i}}return e}function\nia(c,b){return mb(h9(b),function(a){return h(c,b[a])})}function\ne6(f,b){return function(a,b,c){var\ne=a,d=c;for(;;){if(!d)return b;var\ng=d[2];b[e]=h(f,d[1]);e=e+1|0;d=g}}(0,e5(0),b)}function\ntc(a,b){var\nc=new\nl[\"Error\"](b);return a?(c[bu]=a[1],c):c}var\nte=Symbol.iterator;function\ntg(a){return a.next()}function\nth(a){var\nb=dk(function(a){return a|0},a[\"done\"]);return b?b[1]:0}function\nti(a){return a[dI]}function\nib(i,g,c,d,e){return function(a,b){var\nd=b;for(;;){var\ne=tg(a);if(th(e))return d;var\nf=ti(e),j=h(g,f[1]);d=y(c,h(i,f[0]),j,d)}}(d,e)}l[\"Promise\"];function\ntb(a){return at(a)}function\nbo(a,b,c){return d3(a,tb(b),c)}function\nav(a){return at(a)}function\nv(a){return H(a)}function\nbT(a,b){return a\ninstanceof\nb?1:0}var\ns$=true;function\nta(a,b){a[b];return}function\ntd(a,b){return h(function(a){throw a},tc(a,b))}function\ntf(a){return a[te]()}l[\"Event\"];function\ndl(a){return a[fK]}function\nic(a,b,c,d){var\ne=a?a[1]:{},f=bA(1,c);d.addEventListener(b,f,e);return function(a){d.removeEventListener(b,f,e);return 0}}function\nid(a){return h(a,0)}var\ne7=\"change\",cl=\"click\";l[\"ArrayBuffer\"];l[\"DataView\"];function\ntj(a){a.preventDefault();return 0}var\ntk=\"DOMContentLoaded\",tl=kq,tm=\"scroll\",tn=\"wheel\";l[\"Blob\"];l[\"File\"];var\nie=l[\"JSON\"];l[\"encodeURI\"];l[\"decodeURI\"];l[\"encodeURIComponent\"];l[\"decodeURIComponent\"];l[\"URL\"];l[\"URLSearchParams\"];function\naQ(a,b){return[0,a,b]}var\ncm=[0,bn,bn];function\ne8(a){return[0,a,bn]}function\nig(a){return a}var\ncn=kM,e9=j0,ih=bu,ii=jM,e_=\"type\",e$=dI,ij=e8(dG),tr=\"for\";function\naR(a){return aQ(cn,a)}function\nik(a){return aQ(tr,a)}var\ntu=e8(\"required\");function\ndm(a){return aQ(ii,a)}function\nil(a){return aQ(e_,a)}var\ntv=e8(\"selected\"),bp=l[\"document\"];function\nto(a){return ie.stringify(a)}function\ntp(a){try{var\nc=ie.parse(a)}catch(f){var\nb=M(f);if(b[1]===eF)return[1,b[2]];throw g(b,0)}return[0,c]}function\ntq(a,b){return a?b:cm}var\nts=\"placeholder\";function\ntt(a){return aQ(e9,a)}function\ntw(a){return aQ(e$,a)}function\ntx(a){return a[\"ownerDocument\"]}if(!bS(bp))bp[jV];function\nty(a,b){a.appendChild(b);return 0}function\ntz(a,b,c,d){var\ng=b,f=c,e=d;for(;;){if(!e){if(0!==g)a.setAttribute(jM,h7([0,\";\"],a4(g)));if(0!==f)a.setAttribute(kM,h7([0,aF],a4(f)));return}var\nh=e[2],k=e[1],i=k[2],j=k[1];if(e2(j))e=h;else if(dj(j,ii)){g=[0,i,g];e=h}else if(dj(j,cn)){var\nl=e2(i)?f:[0,i,f];f=l;e=h}else{a.setAttribute(j,i);e=h}}}function\nim(a,b,c,d){var\nf=a?a[1]:bp,g=b?b[1]:0,e=f.createElement(c);tz(e,0,0,g);a5(function(a){return ty(e,a)},d);return e}function\naS(a,b){var\nc=a?a[1]:bp;return c.createTextNode(v(b))}function\nio(a,b,c){return e2(a)?0:b?(c.setAttribute(a,b[1]),0):(c.removeAttribute(a),0)}function\nip(a,b,c){return b?(c[jy].add(a),0):(c[jy].remove(a),0)}var\niq=\"div\";function\ntJ(a,b,c,d){return im(b,c,a,d)}function\nir(a,b,c){return tJ(iq,a,b,c)}function\nis(a){return a[jV]}function\ndn(a,b,c){d3(a,b,c);return 0}var\ndp=l[k6];function\ndq(a){return Ax(function(a,b,c){var\ne=b,d=c;for(;;){if(!d)return a;var\nf=d[2];a[e]=d[1];e=e+1|0;d=f}}(e5(0),0,a))}function\naC(a){return dn(dp,tM,dq(a))}function\nbU(a){return dn(dp,tR,dq(a))}l[k6];l[\"navigator\"];var\ntU=l[\"performance\"],dr=l[kH];ta(l,tV);function\ntA(a,b){d3(a,kW,cU(b));return}function\ntB(a,b,c){var\ne=a?a[1]:l[kH],d=e.getComputedStyle(c)[b];return bS(d)?bn:d}function\ntC(a,b){var\nc=a?a[1]:ky,d=ky<=c?1:0;b.scrollIntoView(!!d);return 0}var\ntD=\"button\",tE=\"form\",tF=kq,tG=\"label\",tH=\"option\",tI=\"select\";function\ntK(a){var\nb=a[\"body\"];return h8(b)?b:td(0,\"Document body is null. Try to defer your script execution.\")}function\ntL(a){return dk(function(a){return a},a[\"activeElement\"])}function\ntN(a){return dn(dp,tO,dq(a))}function\ntP(a){return dn(dp,tQ,dq(a))}function\ntS(a){return a}function\ntT(a){return a.now()}function\ntW(a,b){return l.setTimeout(bA(1,b),a)}function\ntX(a){l.clearTimeout(a);return}function\ntY(a){l.requestAnimationFrame(bA(1,a));return}l[\"ClipboardItem\"];l[\"FormData\"];l[\"Headers\"];l[\"Request\"];l[\"Response\"];l[\"fetch\"];l[\"MediaStream\"];l[\"MediaRecorder\"];l[\"MessageChannel\"];l[\"BroadcastChannel\"];l[\"Notification\"];l[\"WebSocket\"];function\ntZ(a){return a[\"localStorage\"]}function\nt0(a,b){function\nc(a){return a}return function(a){return dk(c,a)}(a.getItem(b))}function\nt1(a,b,c){try{a.setItem(b,c);return}catch(f){var\nd=M(f);if(d[1]===eF)return;throw g(d,0)}}function\naw(a,b,c){return[0,a,b,c]}function\nit(a){var\nb=a[1];return 82===b?gL(c7(a[2])):83<=b?gL(c7(a[2])):1}function\nds(a){return cP(c7(a))}function\nt2(a){return ed(cQ(function(a){var\nb=a[1];return 82===b?[0,ds(a[2]),0]:83<=b?h5(ds(a[2])):[0,a[2],0]},a))}function\niu(a){if(!a)return t3;var\nb=mf(it,a),c=b[2];return[0,t2(b[1]),c]}var\niv=kW,fa=\"before\";function\nt6(a){return[0,a]}function\nt7(a,b){return[1,e3,a,b]}var\nt8=\"remove\",t9=\"contains\";function\niw(a){var\nb=tL(tx(a));return b?bo(a,t9,[0,b[1]])|0:0}function\nix(e,b){var\nc=[0,df(t6,t7)];return k(b,function(a){var\nb=eZ(c[1],a),d=b[2],g=b[1];c[1]=d;dh(w,function(a,b){return 0===a[0]?a[1][dH]=s$:0},g,0);var\nh=iw(e),i=dg(d);if(i){var\nf=function(d,b){if(0!==b[0]){if(!ck(b[1]))return b[1];var\nl=f(d,b[3]),k=f(l,b[2]);b[1]=k;return k}var\nc=b[1];delete\nc[dH];if(c.parentNode!==e)if(ck(d))bo(e,iv,[0,c]);else\nbo(d,fa,[0,c]);else{var\na=c.nextSibling!==d?1:0;if(a){if(h)var\ng=iw(c),i=g?function(a){for(;;){var\nb=c.nextSibling;if(b===d)return 1;if(ck(b))return 0;bo(c,fa,[0,b])}}(0):g;else\nvar\ni=h;var\nj=1-i}else\nvar\nj=a;if(j)if(ck(d))bo(e,iv,[0,c]);else\nbo(d,fa,[0,c])}return c};f(e3,i[1])}dh(w,function(a,b){if(0!==a[0])return 0;var\nc=a[1],d=h8(c[dH]),e=d?(delete\nc[dH],bo(c,t8,[0]),0):d;return e},g,0);return e})}var\ndt=R(0),fb=[0,bn,bn];function\nt4(a){if(!a)return t5;var\nb=a[1],c=b[1];if(82===c){if(!a[2])return[0,0,[0,k(b[2],J)]]}else\nif(83<=c){if(!a[2])return[0,0,[0,b[2]]]}else if(!a[2])return[0,[0,b[2],0],0];return md(it,a)?[0,ed(cQ(function(a){var\nb=a[1];return 82===b?[0,ds(a[2]),0]:83<=b?h5(ds(a[2])):[0,a[2],0]},a)),0]:[0,0,[0,c9(function(a){var\nb=a[1];return 82===b?k(a[2],J):83<=b?a[2]:R(J(a[2]))},h6,a)]]}function\niy(c,b){function\nd(a){var\nb=a[2],d=a[1];return dj(d,cn)?ip(b,1,c):io(d,[0,b],c)}function\ne(a){var\nb=a[1],d=a[2];return dj(b,cn)?ip(d,0,c):io(b,0,c)}function\nh(a){var\nb=[0,fb];return function(a){if(b[1]!==fb)e(b[1]);var\nc=ig(a);d(c);b[1]=c;return 0}}return c9(function(a){var\nb=a[1];if(82===b){var\ni=a[2];return k(i,h(0))}if(83>b)throw g([0,f,t_],1);var\nj=a[2],c=[0,df(function(a){var\nb=ig(a);d(b);return b},function(a,b){return fb})];return k(j,function(a){var\nb=eZ(c[1],a),d=b[2],f=b[1];c[1]=d;dh(w,function(a,b){return e(a)},f,0);dg(d);return 0})},[0,dt,function(a,b){return dt}],b)}function\nfc(a,b){return ic(b[1],b[2],b[3],a)}function\nt$(c,b){return c9(function(a){var\nb=a[1];if(82===b){var\nd=[0,0];return k(a[2],function(a){var\nb=d[1];if(b)id(b[1]);d[1]=[0,fc(c,a)];return 0})}if(83>b)throw g([0,f,ua],1);var\nh=a[2],e=[0,df(function(a){return fc(c,a)},function(a,b){return a})];return k(h,function(a){var\nb=eZ(e[1],a),c=b[2],d=b[1];e[1]=c;dh(w,function(a,b){return id(a)},d,0);dg(c);return 0})},[0,dt,function(a,b){return dt}],b)}function\niz(a,b,c,d,e,f){var\nq=b?b[1]:0,r=c?c[1]:0,s=d?d[1]:function(a){return},m=iu(q),l=m[2],t=m[1],n=iu(r),o=n[2],u=n[1],p=t4(f),i=p[2],g=im(a,[0,t],e,p[1]);h(s,g);if(l)if(i)var\nv=ix(g,i[1]),j=bN(iy(g,l),v,function(a,b){return b});else\nvar\nj=k(iy(g,l),function(a){return g});else\nvar\nj=i?ix(g,i[1]):R(g);a5(function(a){fc(g,a);return 0},u);var\nw=o?bN(t$(g,o),j,function(a,b){return b}):j;return w}function\nbV(a,b,c,d,e,f){return iz(b,c,d,e,a,f)}function\nub(a,b,c,d,e,f){return iz(b,c,d,e,a,0)}function\nfd(a,b,c,d,e){return bV(tD,a,b,c,d,e)}function\nK(a,b,c,d,e){return bV(iq,a,b,c,d,e)}function\nfe(a,b,c,d,e){return ub(tF,a,b,c,d,e)}function\niA(a,b,c,d,e){return bV(tG,a,b,c,d,e)}function\nuc(a,b,c,d,e){return bV(tE,a,b,c,d,e)}function\nud(a,b,c,d,e){return bV(tH,a,b,c,d,e)}function\nue(a,b,c,d,e){return bV(tI,a,b,c,d,e)}function\ndu(a,b){return b=c)return uv;if(b===jv)return uu;if(b===\"cyan\")return ut;if(b===kh)return us;if(b===\"magenta\")return ur;if(b===kt)return uq;if(b===\"reset\")return up;if(b===\"white\")return uo;if(b===\"yellow\")return un}else{if(b===\"Black\")return uE;if(b===\"Blue\")return uD;if(b===\"Cyan\")return uC;if(b===\"Green\")return uB;if(b===\"Magenta\")return uA;if(b===\"Red\")return uz;if(b===\"White\")return uy;if(b===\"Yellow\")return ux;if(b===\"black\")return uw}throw g(fg,1)}function\niD(a,b){a6(b,a);return uG}function\niE(a){try{mS(a);mT(a)}catch(f){var\nb=M(f);if(b!==el)throw g(b,0)}return uH}var\niF=[q,uI,af(0)],uF=0;function\nuJ(a,b,c){if(c[1]===iF)return iD(a,c[2]);if(c[1]!==cb)return h(b,c);var\ne=c[2];try{var\nf=iD(a,iC(e));return f}catch(f){var\nd=M(f);if(d===fg)return h(b,c);throw g(d,0)}}function\nuK(a,b,c){if(c[1]===iF)return iE(a);if(c[1]!==cb)return h(b,c);var\ne=c[2];try{iC(e)}catch(f){var\nd=M(f);if(d===fg)return h(b,c);throw g(d,0)}return iE(a)}function\nuL(a){var\nc=bE(0);qm(a,1);var\nb=qn(a,0),d=b[2],e=b[1];return qo(a,[0,function(a){return uJ(c,e,a)},function(a){return uK(c,d,a)},b[3],b[4]])}function\nuM(a,b){var\nd=b_(64),c=eE(d),e=a?uF:a;if(e)uL(c);return qU(function(a){bK(c,0);return cV(d)},c,b)}function\nuN(a){return uM(1,a)}function\nuO(a,b){return mh(a,b)}function\nuP(a){try{var\nc=[0,ln(a)];return c}catch(f){var\nb=M(f);if(b[1]===b4)return 0;throw g(b,0)}}function\nuQ(a){return a|0}function\nuS(a,b,c,d){var\ng=a,f=b,e=d;for(;;){if(!e){g[1+f]=0;return}var\nj=e[2],i=[0,h(c,e[1]),kx];g[1+f]=i;g=i;f=1;e=j}}function\nuR(a,b){if(!b)return 0;var\nd=b[2],c=[0,h(a,b[1]),kx];uS(c,1,a,d);return c}function\nfh(a,b){return b?[0,h(a,b[1])]:0}function\nuT(a,b,c){return c?h(b,c[1]):a}function\nuU(a,b){if(b)return h(a,b[1]);return}function\nuV(a,b){return b?b[1]:a}function\nuW(a,b){return a?a[1]:b}function\nuX(a){return a?[0,a[1],0]:0}function\nuY(a,b){return 0===b[0]?h(a,b[1]):[1,b[1]]}function\nuZ(a,b){return uY(b,a)}function\nu0(a){var\nb=mK(a);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[37],,,,,,,,,,,b[23]]}function\nu1(a){var\nb=u0(a);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[40],,,,,,,,,,,,,,,,,,,,b[51]]}function\nu2(e,b){var\nd=n(e);if(du(d,n(b)))return 0;var\nf=n(b)-d|0;return function(a){var\nc=a;for(;;){if(uf(c,d))return 1;if($(b,f+c|0)!==$(e,c))return 0;c=c+1|0}}(0)}function\nfi(a,b){return u2(a,b)?[0,eh(b,0,n(b)-n(a)|0)]:0}var\niG=[q,u4,af(0)];function\niH(a){return[0,[0,a]]}function\nbq(a,b,c,d){return[1,a,b,c,d]}function\nu6(a){if(0===a[0]&&typeof\na[1]===\"number\")return 1;return 0}function\niI(a,b){if(0===b[0]){var\nc=b[1];if(typeof\nc===\"number\")return iH(a);switch(c[0]){case\n0:return[0,[1,a,c[1]]];case\n1:return[0,[2,a,c[1],c[2]]];default:return bq(4,[1,a,c[1]],u5,[1,c[2],c[3]])}}var\nd=b[2],f=b[1];if(typeof\nd!==\"number\")switch(d[0]){case\n0:break;case\n1:return bq(f+1|0,[2,a,d[1],d[2]],b[3],b[4]);default:var\ne=b[3],h=d[3],i=d[2],j=d[1],g=ay(e),k=aE===g?e[1]:bb===g?cO(e):e;return bq(f+1|0,[1,a,j],[bb,function(a){return iI([0,i,h],k)}],b[4])}return bq(f+1|0,[1,a,d[1]],b[3],b[4])}function\niJ(a){if(0===a[0]){var\nb=a[1];if(typeof\nb===\"number\")throw g(iG,1);switch(b[0]){case\n0:return[0,u3,b[1]];case\n1:var\nn=b[2];return[0,iH(b[1]),n];default:return[0,[0,[1,b[1],b[2]]],b[3]]}}var\nd=a[3],e=a[2],f=a[1],i=ay(d),j=aE===i?d[1]:bb===i?cO(d):d,h=a[4];if(typeof\nh!==\"number\"&&0!==h[0]){var\nc=a[4];if(typeof\nc!==\"number\"&&2===c[0]){var\nq=c[3];return[0,bq(f-1|0,e,d,[1,c[1],c[2]]),q]}var\np=c[2];return[0,bq(f-1|0,e,d,[0,c[1]]),p]}var\nk=h[1];if(u6(j))return[0,[0,e],k];var\nl=iJ(j),m=l[2],o=[1,m[1],m[2]];return[0,bq(f-1|0,e,lX(l[1]),o),k]}function\nu8(a){if(typeof\na===\"number\")return 0;switch(a[0]){case\n0:return 1;case\n1:return 2;default:return 3}}function\nu7(a){try{var\nc=[0,iJ(a)];return c}catch(f){var\nb=M(f);if(b===iG)return 0;throw g(b,0)}}function\nu9(a){return 0===a[0]?u8(a[1]):a[1]}function\nu_(a){return a[\"height\"]}function\nu$(a){return a}function\nvc(a){switch(a){case\n0:return vd;case\n1:return ve;default:return vf}}function\nva(a){return u$(a[\"contentRect\"])}function\nvb(a){a[fK];return}function\nvg(a,b,c){var\nd=b?[0,c,{box:v(vc(b[1]))}]:[0,c];d3(a,\"observe\",d);return 0}function\nvh(c){return new\nl[\"ResizeObserver\"](function(a,b){return i(c,ia(function(a){return a},a),b)})}var\nvi=jI,vj=\"pattern\",iK=u1([0,ei]);function\nvk(a,b){h(a,b);return b}function\nvl(a){var\nb=fi(vm,a);if(b){var\nc=b[1],d=uP(c);if(d)return[0,[0,d[1]]];var\ng=function(a){return[0,a]};return function(a){return fh(g,a)}(ff(c))}var\ne=fi(vn,a);if(e){var\nh=function(a){return[1,a]};return function(a){return fh(h,a)}(ff(e[1]))}var\nf=fi(vo,a);if(!f)return 0;function\ni(a){return[1,a]}return function(a){return fh(i,a)}(ff(f[1]))}function\niL(a){switch(a[0]){case\n0:var\nb=a[1];return h(C(vp),b);case\n1:var\nc=a[1];return h(C(vq),c);default:var\nd=a[1];return h(C(vr),d)}}function\niM(a){var\nc=a?a[1]:is(bp);function\nb(a){var\nb=vl(at(tB(0,\"font-size\",a)));if(!b)return 16.;var\nc=b[1];return 0===c[0]?c[1]:a3(vs)}return function(a){switch(a[0]){case\n0:return a[1];case\n1:var\nd=a[1];return d*b(is(bp));default:var\ne=a[1];return e*b(c)}}}function\nvt(e,b,c,d){function\nf(a,b){return bN(d,a,b)}function\ng(a,b){return y(e,b[1],b[2],a)}return function(a){return f(a,g)}(bN(b,c,function(a,b){return[0,a,b]}))}var\nvw=[q,vv,af(0)],vy=[q,vx,af(0)];function\nfj(a){return[0,0]}function\nfk(a,b){if(a[1])throw g(vy,1);a[1]=[0,b];return 0}function\nfl(a){var\nb=a[1];if(b)return b[1];throw g(vw,1)}function\nvu(a,b,c){return vt(function(a,b,c){return[0,a,b,c]},a,b,c)}function\nvz(a){return to(a)}function\nvA(a){var\nb=tp(a);return 0===b[0]?[0,b[1]]:(tN([0,b[1],0]),vB)}var\niN=tZ(dr);function\niO(c,b){return function(a){return t1(iN,c,a)}(vz(b))}function\nvC(a){var\nb=t0(iN,a);function\nc(a){return vA(a)}var\nd=b?[0,b[1]]:vD;return uZ(d,c)}function\nvE(a,b){var\nc=vC(a);if(0===c[0])return c[1];var\nd=c[1];return typeof\nd===\"number\"?h(b,0):(tP([0,d[2],0]),h(b,0))}function\nvF(d,b){iO(d,b);var\na=ad(b),c=eJ(0,ao(a));eK(c,function(a){iO(d,bP(c));return 0});bP(c);return a}function\nvG(a,b){var\nc=H(a);return vF(c,vE(c,b))}function\niP(a,b){return vG(a,function(a){return b})}var\nvI=iK[49],vH=iK[29];function\nvJ(a){return uR(function(a){return[0,80,aR(H(a))]},vI(a))}var\nvK=0;function\na9(d,b,c){var\na=b[1],e=82===a?[0,82,k(b[2],function(a){return function(a){return aQ(d,a)}(H(a))})]:83<=a?a3(vN):[0,80,function(a){return aQ(d,a)}(H(b[2]))];return[0,e,c]}function\nfm(d,b,c){return b?[0,[0,80,function(a){return aQ(d,a)}(H(b[1]))],c]:c}function\niQ(a,b){var\nc=b[1];return 82===c?[0,82,k(b[2],a)]:83<=c?[0,83,e1(a,b[2])]:[0,80,h(a,b[2])]}function\nvP(a){return 0===a[0]?aR(H(a[1])):a[1]}function\nfn(a,b){return[0,iQ(vP,a),b]}function\nai(a){return fn(a,0)}function\nco(a,b){return fn(a,b)}function\nvL(a,b){var\nd=vJ(b[1]),e=b[2],c=function(a){return bD(e,a)}(d);return a?[0,[0,80,tt(H(a[1]))],c]:c}function\nvM(a){return[0,vH(a),vK]}function\nvO(a,b,c){return b?[0,[0,80,a],c]:c}function\nvQ(a){return fn(iQ(function(a){return[0,a]},a),0)}function\nvR(a,b){return 0===b[0]?(a.scroll(0,b[1]),0):tC(0,b[1])}function\nvS(a,b,c,d,e){var\ng=a?a[1]:0,h=b?b[1]:0,f=ad(1),i=co(vT,co([0,82,k(ao(f),function(a){return a?[1,aR(\"locked\")]:[1,cm]})],g)),j=vQ(vU),l=[0,[0,80,aw(0,cl,function(a){return _(f,1)})],0],m=K(0,[0,j],[0,l],0,[0,[0,82,fd(0,0,0,0,[0,[0,80,aS(0,vV)],0])],0]),n=aw(0,tn,function(a){var\nb=bk(f);return b?_(f,0):b});return K(0,[0,i],[0,[0,[0,80,n],h]],c,[0,[0,82,k(vu(e,ao(f),d),function(a){var\nb=a[1],c=a[3];if(a[2])uU(function(a){return vR(b,a)},c);return b})],[0,[0,82,m],0]])}function\ndv(a,b){return typeof\nb===\"number\"?0:0===b[0]?[0,h(a,b[1])]:[1,b[1]]}function\nvW(e,b,c){var\nd=ad(c);return[0,aw(0,b,function(a){return _(d,h(e,dl(a)[dI]))}),d]}function\niR(a,b,c,d,e,f,g,h,i,j){var\nl=d?d[1]:0,m=f?f[1]:0,n=function(a){return fm(vj,h,a)}(function(a){return vO(tu,m,a)}([0,[0,80,il(H(i))],l])),o=uW(b,function(a){return[0,a]}),k=vW(a,g,j),p=k[2],q=k[1];return[0,fe(c,[0,n],[0,[0,[0,80,q],uX(e)]],0,0),p,o]}function\ndw(a,b,c,d,e,f,g,h){var\ni=c?c[1]:0,j=function(a){return fm(e$,h,a)}(function(a){return fm(ts,g,a)}(i));return iR(av,a,b,[0,j],d,e,tl,f,vY,uV(vX,h))}function\ndx(a,b,c,d){var\ne=b?b[1]:0;return iR(function(a){return 0},0,a,[0,a9(e$,d,e)],c,0,e7,0,vZ,0)}function\naD(a,b){return k(a,function(a){return[0,a,b]})}function\ndy(a,b,c,d){return function(g){var\ni=[0,[0,ch,function(a){return a}],function(a,b){var\nc=b[2],d=a[2];return[0,aB(a[1],b[1]),function(a){return h(c,h(d,a))}]}];function\nj(a){var\nb=a[1],c=a[2];function\nd(a){var\nc=bk(b[2]);return h(b[3],c)}return[0,J(b[1]),function(a){var\nb=d(0);return h(h(c,a),b)}]}var\ne=function(a){return bl(j,i,a)}(bm(d[2])),f=[0,82,k(e,function(a){var\nb=a[2];return aw(0,vi,function(a){h(g,h(b,d[1]));return tj(a)})})],l=k(e,function(a){return a[1]}),m=uT([0,f,0],function(a){return l9(f,a)},c);return uc(a,b,[0,m],0,[0,[0,83,bm(l)],0])}}function\niS(a,b){return a?h(C(v0),b):b}function\nv1(a,b,c,d,e){var\ng=a?a[1]:1,i=b?b[1]:0,j=c?c[1]:0,f=d?d[1]:function(a){return};return function(a){var\nc=iS(1,e[1]),d=iS(0,e[1]),b=g?iP(c,e[2]):ad(e[2]);h(f,bk(b));var\nl=e[3];iA(0,[0,[0,[0,80,ik(H(c))],0]],0,0,l);var\nm=[0,80,d],n=function(a){return a9(e_,v2,a)}(function(a){return a9(ih,m,a)}(a9(e9,[0,80,c],i))),o=[0,[0,80,aw(0,e7,function(a){var\nc=av(dl(a)[dI]);h(f,c);return _(b,c)})],j];return[0,ue(0,[0,n],[0,o],0,[0,[0,83,bm(e1(function(a){var\nc=a[1],d=a[2],e=ai([0,80,[1,tw(H(c))]]),f=co([0,82,k(ao(b),function(a){return[1,tq(uj(a,c),tv)]})],e);return ud(0,[0,f],0,0,[0,[0,80,aS(0,d)],0])},a))],0]),,b]}}function\nv3(a,b,c,d,e,f,g){var\nm=b?b[1]:0,n=c?c[1]:function(a){return},j=h(uN(v4),d);function\nl(a){return a?[0,e]:0}a:{if(a&&a[1]){var\no=iP(j,l(g)),i=o;break a}var\ni=ad(l(g))}var\np=iA(0,[0,[0,[0,80,ik(H(j))],0]],0,0,f),q=[0,80,d],r=function(a){return a9(e_,v5,a)}(function(a){return a9(ih,q,a)}(a9(e9,[0,80,j],0))),s=[0,[0,82,k(ao(i),function(a){return a?ij:cm})],r];return[0,K(0,0,0,0,[0,[0,82,fe(0,[0,s],[0,[0,[0,80,aw(0,e7,function(a){var\nb=l(dl(a)[dG]|0);h(n,b);return _(i,b)})],m]],0,0)],[0,[0,82,p],0]]),i]}function\nv6(a){var\nd=ek(a);return[0,,function(a){return u9(a[1])},function(a){return},,function(a,b,c){var\ne=d[4].call(null,b,c,a[2]);return[0,iI(b,a[1]),e]},function(a){var\nc=u7(a[1]);if(!c)return[0,a,0];var\ne=c[1],b=e[2],f=e[1],g=[0,[0,b,d[28].call(null,b,a[2])]];return[0,[0,f,d[7].call(null,b,a[2])],g]},function(a,b){return d[29].call(null,b,a[2])}]}function\nv7(a){var\nb=v6(a);return[0,function(a){b[3].call(null,0);b[3].call(null,0);return}]}function\nv9(a){return bl(function(a){return J(K(0,0,0,0,a[3]))},aP,a)}function\nv_(a){return eL(bl(function(a){return a[2]},[0,wc,function(a,b){return i(C(wb),a,b)}],a),function(a){return i(C(wa),v$,a)})}iM(0)(wg);function\nv8(a,b,c){return[0,a,b,c]}function\nwd(a){return v_(a[1][1])}function\nwe(a){var\nb=iL(a[2]),c=[0,[0,80,aR(jx)],0],d=[0,[0,80,aR(\"lwdui-lazy-table-header\")],c],e=[0,[0,80,dm(H(h(C(wf),b)))],d];return K(0,[0,e],0,0,[0,[0,83,bm(v9(a[1][1]))],0])}var\nwh=v7([0,uO]),dz=A5(0);function\nwi(d,b,c){return function(a){var\nr=a[3],s=a[2],f=fj(0),g=fj(0),l=iL(d[2]),u=h(C(wk),l),v=cg(function(a,b){return J([0,eO(a),a,r])},aP,s);hd(0,2048);(function(a){return wh[1].call(null,50)}(0));var\ne=ad(0),m=R(function(a){return a}),b=eJ(0,q5(m,ao(e)));eK(b,function(a){var\nc=bP(b);return c[2]?h(c[1],0):0});bP(b);function\nt(a){return i(C(wj),l,a)}function\nj(a){var\nb=[0,aR(\"row_spacer\"),0];return ir(0,[0,[0,dm(H(t(a))),b]],0)}var\nw=k(bl(function(a){var\nb=a[1],c=a[3],d=a[2],e=a9(cn,wl,0),f=[0,80,dm(H(u))];return b?[0,0,J(K(0,[0,[0,f,e]],0,0,[0,[0,83,bm(i(c,d,b[1]))],0])),0]:[0,1,ch,0]},[0,[0,0,ch,0],function(a,b){var\nf=b[3],g=b[2],c=b[1],d=a[3],e=a[2],h=a[1],k=hT(e),i=hT(g);if(typeof\nk===\"number\")return typeof\ni===\"number\"?[0,((h+d|0)+c|0)+f|0,e,0]:[0,(h+d|0)+c|0,g,f];if(typeof\ni===\"number\")return[0,h,e,(d+c|0)+f|0];var\nl=du(d+c|0,0)?function(a){return aB(e,a)}(aB(J(R(j(d+c|0))),g)):aB(e,g);return[0,h,l,f]}],v),function(a){var\nb=a[3],c=a[2],d=a[1],e=du(d,0)?aB(J(R(j(d))),c):c;return du(b,0)?aB(e,J(R(j(b)))):e}),x=we(d),y=vh(function(a,b){var\nd=l_(a);vb(d);var\nc=u_(va(d)),f=bk(e);return f?ug(f[1],c)?_(e,[0,c]):0:_(e,[0,c])}),z=ai(wm),n=K(0,[0,z],0,[0,function(a){return fk(f,a)}],[0,[0,83,bm(w)],0]),o=ai(wn),p=[0,[0,82,k(m,function(c){return aw(0,tm,function(a){var\nd=[0,0.],b=[0,-1];function\ne(e){var\na=800,f=tT(tU);if(uh(b[1],0))tX(b[1]);b[1]=tW(a,function(a){return h(c,e)});var\ng=ui(f-d[1],a);return g?(d[1]=f,h(c,e)):g}fl(g);(function(a){return e(a)}(0));return 0})})],0];function\nq(a){return fk(g,a)}var\nA=c?vS([0,o],[0,p],[0,q],k(c[1],function(a){var\nb=fl(f),c=d[2];return[0,[0,cG(a,uQ(iM([0,b])(c)))]]}),n):K(0,[0,o],[0,p],[0,q],[0,[0,82,n],0]);function\nB(a){return vg(y,0,a)}function\nD(a){return vk(B,a)}var\nE=function(a){return k(a,D)}(A),F=vL(0,vM(wo));return K(0,[0,[0,[0,82,k(wd(d),function(a){return dm(H(a))})],F]],0,0,[0,[0,82,x],[0,[0,82,E],0]])}}var\nfo=ek([0,ei]),fp=dz[\"Text\"],fq=dz[j8],fr=dz[\"Map\"],bW=hA(wt,ws),a_=hA(wv,wu);function\nwp(a,b){return[0,a,b]}function\niT(a){return bT(a,fq)?[0,aW,a]:bT(a,fr)?[0,w,a]:bT(a,fp)?[0,bx,a]:[0,T,a]}function\nww(a){var\nb=e4(a,wx);if(b)return[0,b[1]];var\nc=e4(a,wy);if(c)return[1,h_(iT,c[1])];var\nd=e4(a,wz);if(d)return[2,d[1]];throw g([0,f,wA],1)}hC(wB,bW,[0,function(a){return new\nfq},function(a,b,c){a.insert(b,h$(function(a){var\nb=a[1];return bx<=b?aW<=b?a[2]:a[2]:w<=b?a[2]:a[2]},c));return 0},function(a,b,c){a.delete(b,c);return 0},function(a,b){a.push(h$(function(a){var\nb=a[1];return bx<=b?aW<=b?a[2]:a[2]:w<=b?a[2]:a[2]},b));return 0},function(a,d){a.forEach(function(a,b,c){return y(d,b,iT(a),c)});return 0},function(a,b){function\nc(a){return h(b,wp(ww,a))}a.observe(c);return c}]);function\nfs(a){return bT(a,fq)?[0,aW,a]:bT(a,fr)?[0,w,a]:bT(a,fp)?[0,bx,a]:[0,T,a]}function\niU(a,b){return function(a){return dk(fs,a)}(a.get(v(b)))}function\nwC(a){return a}function\nwD(a){return wC(a[fK])}function\nwE(a){var\nb=av(a[\"action\"]);if(b!==\"add\")if(b!==jS){if(b!==\"update\")throw g([0,cL,h(C(wF),b)],1);var\nc=1}else\nvar\nc=2;else\nvar\nc=0;var\nd=a[\"oldValue\"],e=bS(d)?0:[0,fs(d)];return[0,c,0,e]}function\niV(a){return tf(a.entries())}hC(wG,a_,[0,function(a){return new\nfr},[0,function(d){var\na=d[jZ][\"keys\"].entries();return ib(av,wE,function(a,b,c){var\ne=iU(wD(d),a);return fo[4].call(null,a,[0,b[1],e,b[3]],c)},a,fo[1])}],iU,function(a,b,c){var\nd=c[1],e=bx<=d?aW<=d?c[2]:c[2]:w<=d?c[2]:c[2];a.set(v(b),e);return 0},function(a,b){a.delete(v(b));return 0},iV,function(a,d,c){return ib(av,fs,function(a,b,c){return y(d,a,b,c)},iV(a),c)},function(a,b){function\nc(a){return h(b,a)}a.observe(c);return c}]);var\nwH=dz[\"Doc\"];function\niW(a,b){return a.getArray(v(b))}function\nbr(a,b){a.transact(bA(1,b));return 0}function\nft(a){return a}var\naj=a_[4],aT=a_[3],cp=a_[1],dA=bW[5],fu=bW[4],iX=bW[3],iY=bW[1];function\nwq(a){var\nb=a[1];return[0,function(a){return h_(b,a)}(a[2][jZ][\"delta\"])]}function\nwr(a,b){var\nc=a?[0,v(a[1])]:[0];return lq(fp,c)}function\nwI(a){return new\nwH}var\nwJ=a_[8],wK=a_[7],wL=a_[5],wM=a_[2][1],wN=bW[6];function\nwO(a){return a}var\nwP=AZ(0)[\"Awareness\"];function\nwR(a,b,c){a.setLocalStateField(v(b),c);return}function\niZ(a){return a}function\nwQ(a){return new\nwP(ft(a))}function\nwS(a,b,c,d){if(c)var\nf=[0,wT,v(c[1])],e=[0,[0,wU,v(b)],f];else\nvar\ne=[0,[0,wW,v(b)]];return wR(a,wV,gv(e))}var\nwX=A0(0);function\nwY(a,b){var\nc=ft(b);new\nwX(v(a),c);return}var\nwZ=A3(0);function\nfv(a,b,c){switch(b){case\n0:a.on(v(w6),bA(1,function(a){return h(c,[0,a[\"connected\"]|0])}));return;case\n1:a.on(v(w7),bA(1,function(a){return h(c,[0,a[kn]|0])}));return;default:a.on(v(xa),bA(1,function(b){function\na(a){return function(a){return ia(av,a)}(b[a])}var\nd=a(w8),e=a(w9),f=a(w_);return h(c,[0,a(w$),f,e,d])}));return}}function\nw0(a,b,c,d){var\nf=b8(function(a){return[0,w1,e6(v,a)]},b),e=[0,[0,w4,{config:{iceServers:e6(function(a){return a},cQ(function(a){return{urls:v(h(C(w3),a))}},w2))}}]];aC([0,e,0]);var\ng=[0,f,[0,e,[0,b8(function(a){return[0,w5,iZ(a)]},c),0]]],i=gv(cU(gO(function(a){return a})(g))),j=ft(d);return new\nwZ(v(a),j,i)}var\ni0=A1(0),xb=A2(0);function\nxd(a){switch(a){case\n0:var\nb=xe;break;case\n1:var\nb=xf;break;case\n2:var\nb=xg;break;case\n3:var\nb=xh;break;default:var\nb=xi}return v(b)}function\nxc(a,b){i0.register(v(a),b);return}function\nxj(a,b,c,d){var\ne=a?a[1]:0,f=e?xk:xn,g=b8(function(a){return[0,xl,!!a]},b),h=[0,g,[0,b8(function(a){return[0,xm,e6(xd,a[1])]},c),0]],i=gv(cU(gO(function(a){return a})(h)));return{theme:v(f),modules:i}}function\nxo(a,b){return new\ni0(a,b)}function\nxp(a){return a}var\nxq=A4(0)[\"QuillBinding\"];function\nxr(a,b,c){var\nd=lZ(b8(iZ,a)),e=[0,xp(c),d];function\nf(a,b){lq(a,b);return}return function(a){return f(xq,a)}(cU([0,wO(b),e]))}function\nxs(a,b,c){return y(ev(t,xt),b,c,a)}function\ni1(a,b,c){var\nd=0<=c?1:0;if(d)var\ne=0<=b?1:0,f=e?(b+c|0)<=a?1:0:e;else\nvar\nf=d;var\ng=1-f;return g?xs(a,b,c):g}var\nxu=[0];function\nxv(a,b,c,d){var\ne=aq(a,b);cT(c,0,e,0,d);return e}function\ni2(a,b){return b<=a?a:b}function\ni3(a){return ev(t,a)}function\nxw(a,b){var\nc=a[1];return i(i3(xx),b,c)}function\nxy(a,b){return i(i3(xz),a,b.length-1)}function\ncq(a,b){var\nc=1-(a<=b.length-1?1:0);return c?xy(a,b):c}function\ni4(a){return[0,0,0,xu]}function\ncr(a){return a[1]}function\nxA(a,b){return a[3][1+b]}function\ni5(a){var\nb=a[1],c=a[3];cq(b,c);if(0>>4|0)));var\nf=b+1|0;function\ni(a,b,c){a0(a,b,c);return}return function(a){return i(d,f,a)}(h(g,c&15))}for(;;){if(4<=d[1])break;var\nn=z(b,d[1]);f(e,c[1],n);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(6<=d[1])break;var\nm=z(b,d[1]);f(e,c[1],m);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(8<=d[1])break;var\nl=z(b,d[1]);f(e,c[1],l);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(10<=d[1])break;var\nk=z(b,d[1]);f(e,c[1],k);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(16<=d[1])return aa(e);var\nj=z(b,d[1]);f(e,c[1],j);c[1]=c[1]+2|0;d[1]++}}var\nxN=g9(0),ak=wI(0),fx=wQ(ak);xc(xP,xb);wS(fx,xQ,0,0);var\ndB=w0(xS,xR,[0,fx],ak);wY(xT,ak);dr[\"yjsdoc\"]=ak;dr[\"yjsprovider\"]=dB;var\nfy=ad(0),i8=ad(0),i9=ad(0);fv(dB,0,function(a){var\nb=a[1];bU([0,xU,[0,!!b,0]]);return _(i8,b)});fv(dB,1,function(a){var\nb=a[1];bU([0,xV,[0,!!b,0]]);return _(i9,b)});var\ndC=[0,0];fv(dB,2,function(a){bU([0,xW,[0,a,0]]);function\nc(b){return me(function(a){return ej(b,a)},a[3])}function\nd(b){var\nc=[0,0],a=dC[1];dC[1]=gN(function(a){return ej(b,a)?(c[1]=[0,b],1):0})(a);return c[1]}var\nb=ee(function(a,b){if(d(b))return a;if(c(b))dC[1]=[0,b,dC[1]];return a+1|0},0,a[1]),e=ec(a[2]);return function(a){return _(fy,a)}((bk(fy)+b|0)-e|0)});var\nx0=ao(i9),x2=co(x1,ai([0,82,bN(ao(i8),x0,function(a,b){var\nc=a?b?xX:xY:xZ;return[0,c]})])),x4=K(0,[0,x2],0,0,[0,[0,80,aS(0,x3)],0]),x5=[0,[0,82,x4],[0,[0,82,k(ao(fy),function(a){return aS(0,lK(a))})],0]];function\nxO(a){return xK(xN,0)}function\nx8(a,b){var\nc=a?a[1]:64,d=hK(0);return[0,d,hd(0,c)]}function\ni_(a,b,c){var\ne=he(a[2],b);if(e)var\nd=e[1];else{var\ng=eN(0,a[1]);hf(a[2],b,g);var\nd=g}var\nf=eO(d);return f?_(f[1][2],[0,c]):rV(d,[0,b,ad([0,c])])}function\nfz(a,b){var\nc=he(a[2],b);if(c)var\nd=c[1];else{var\nf=a[1],e=eN([0,[0,b,ad(0)]],f);hf(a[2],b,e);var\nd=e}return ao(cP(eO(d))[2])}function\nfA(a,b){return k(fz(a,b),function(a){if(!a)return 0;var\nb=a[1];if(typeof\nb!==\"number\"&&T===b[1])return[0,av(b[2])];throw g([0,f,x9],1)})}function\nx_(a){var\nb=hK(0);return[0,b,i4(0)]}function\nx$(a){try{var\nc=[0,i7(a[2],0)];return c}catch(f){var\nb=M(f);if(b[1]===cL)return 0;throw g(b,0)}}function\ni$(a,b){var\nc=eN(a,b[1]);return xD(b[2],c)}function\nja(a,b,c,d){var\ne=[0,b,[0,c,[0,cr(d),0]]];bU([0,ya,[0,cr(a),e]]);var\nf=cr(d),g=i7(a,0);fw(d,gY(c,function(a){return g}));return xH(a,b,d,f,c)}function\nyb(i,b,c){var\ne=[0,0],j=i[2],d=i4(0);gZ(function(a){switch(a[0]){case\n0:var\nm=a[1];ja(j,e[1],m,d);e[1]=e[1]+m|0;return 0;case\n1:var\nc=a[1];if(0!==cr(d)){var\no=[0,i5(d)];return fw(d,g0(function(a){var\nd=h(b,a),c=rR([0,d],o[1]);o[1]=c;return c},c))}var\nn=x$(i);if(!n)return gZ(function(a){var\nc=h(b,a);return i$([0,c],[0,i[1],d])},c);var\ns=n[1];return fw(d,g0(function(a){return rP([0,h(b,a)],s)},c));default:var\nk=a[1],t=0===e[1]?sy(i[1]):hR(i5(d)),p=[0,t],u=1;if(k>=1){var\nl=u;for(;;){var\nq=p[1];if(!q)throw g([0,f,yc],1);var\nr=q[1];p[1]=hR(r);rY(r);var\nv=l+1|0;if(k===l)break;l=v}}e[1]=e[1]+k|0;return 0}},c);var\nk=e[1],a=cr(j)-k|0;if(0 .ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked] > .ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:none;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor > *{cursor:text}.ql-editor p,.ql-editor ol,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{margin:0;padding:0}@supports (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li > .ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked] > .ql-ui,.ql-editor li[data-list=unchecked] > .ql-ui{color:#777}.ql-editor li[data-list=bullet] > .ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked] > .ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked] > .ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered] > .ql-ui:before{content:counter(list-0, decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1 > .ql-ui:before{content:counter(list-1, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2 > .ql-ui:before{content:counter(list-2, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3 > .ql-ui:before{content:counter(list-3, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4 > .ql-ui:before{content:counter(list-4, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5 > .ql-ui:before{content:counter(list-5, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6 > .ql-ui:before{content:counter(list-6, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7 > .ql-ui:before{content:counter(list-7, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8 > .ql-ui:before{content:counter(list-8, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9 > .ql-ui:before{content:counter(list-9, decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl > .ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:none}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,0.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}\n\n/*# sourceMappingURL=quill.core.css.map*/", "/*!\n * Quill Editor v2.0.2\n * https://quilljs.com\n * Copyright (c) 2017-2024, Slab\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */\n.ql-container{box-sizing:border-box;font-family:Helvetica,Arial,sans-serif;font-size:13px;height:100%;margin:0;position:relative}.ql-container.ql-disabled .ql-tooltip{visibility:hidden}.ql-container:not(.ql-disabled) li[data-list=checked] > .ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked] > .ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:none;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor > *{cursor:text}.ql-editor p,.ql-editor ol,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{margin:0;padding:0}@supports (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li > .ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked] > .ql-ui,.ql-editor li[data-list=unchecked] > .ql-ui{color:#777}.ql-editor li[data-list=bullet] > .ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked] > .ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked] > .ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered] > .ql-ui:before{content:counter(list-0, decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1 > .ql-ui:before{content:counter(list-1, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2 > .ql-ui:before{content:counter(list-2, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3 > .ql-ui:before{content:counter(list-3, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4 > .ql-ui:before{content:counter(list-4, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5 > .ql-ui:before{content:counter(list-5, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6 > .ql-ui:before{content:counter(list-6, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7 > .ql-ui:before{content:counter(list-7, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8 > .ql-ui:before{content:counter(list-8, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9 > .ql-ui:before{content:counter(list-9, decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl > .ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:none}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,0.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}.ql-bubble.ql-toolbar:after,.ql-bubble .ql-toolbar:after{clear:both;content:'';display:table}.ql-bubble.ql-toolbar button,.ql-bubble .ql-toolbar button{background:none;border:none;cursor:pointer;display:inline-block;float:left;height:24px;padding:3px 5px;width:28px}.ql-bubble.ql-toolbar button svg,.ql-bubble .ql-toolbar button svg{float:left;height:100%}.ql-bubble.ql-toolbar button:active:hover,.ql-bubble .ql-toolbar button:active:hover{outline:none}.ql-bubble.ql-toolbar input.ql-image[type=file],.ql-bubble .ql-toolbar input.ql-image[type=file]{display:none}.ql-bubble.ql-toolbar button:hover,.ql-bubble .ql-toolbar button:hover,.ql-bubble.ql-toolbar button:focus,.ql-bubble .ql-toolbar button:focus,.ql-bubble.ql-toolbar button.ql-active,.ql-bubble .ql-toolbar button.ql-active,.ql-bubble.ql-toolbar .ql-picker-label:hover,.ql-bubble .ql-toolbar .ql-picker-label:hover,.ql-bubble.ql-toolbar .ql-picker-label.ql-active,.ql-bubble .ql-toolbar .ql-picker-label.ql-active,.ql-bubble.ql-toolbar .ql-picker-item:hover,.ql-bubble .ql-toolbar .ql-picker-item:hover,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected{color:#fff}.ql-bubble.ql-toolbar button:hover .ql-fill,.ql-bubble .ql-toolbar button:hover .ql-fill,.ql-bubble.ql-toolbar button:focus .ql-fill,.ql-bubble .ql-toolbar button:focus .ql-fill,.ql-bubble.ql-toolbar button.ql-active .ql-fill,.ql-bubble .ql-toolbar button.ql-active .ql-fill,.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-fill,.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-fill,.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-fill,.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-fill,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-bubble.ql-toolbar button:hover .ql-stroke.ql-fill,.ql-bubble .ql-toolbar button:hover .ql-stroke.ql-fill,.ql-bubble.ql-toolbar button:focus .ql-stroke.ql-fill,.ql-bubble .ql-toolbar button:focus .ql-stroke.ql-fill,.ql-bubble.ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-bubble .ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill{fill:#fff}.ql-bubble.ql-toolbar button:hover .ql-stroke,.ql-bubble .ql-toolbar button:hover .ql-stroke,.ql-bubble.ql-toolbar button:focus .ql-stroke,.ql-bubble .ql-toolbar button:focus .ql-stroke,.ql-bubble.ql-toolbar button.ql-active .ql-stroke,.ql-bubble .ql-toolbar button.ql-active .ql-stroke,.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-bubble.ql-toolbar button:hover .ql-stroke-miter,.ql-bubble .ql-toolbar button:hover .ql-stroke-miter,.ql-bubble.ql-toolbar button:focus .ql-stroke-miter,.ql-bubble .ql-toolbar button:focus .ql-stroke-miter,.ql-bubble.ql-toolbar button.ql-active .ql-stroke-miter,.ql-bubble .ql-toolbar button.ql-active .ql-stroke-miter,.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter{stroke:#fff}@media (pointer:coarse){.ql-bubble.ql-toolbar button:hover:not(.ql-active),.ql-bubble .ql-toolbar button:hover:not(.ql-active){color:#ccc}.ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,.ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill{fill:#ccc}.ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,.ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter{stroke:#ccc}}.ql-bubble{box-sizing:border-box}.ql-bubble *{box-sizing:border-box}.ql-bubble .ql-hidden{display:none}.ql-bubble .ql-out-bottom,.ql-bubble .ql-out-top{visibility:hidden}.ql-bubble .ql-tooltip{position:absolute;transform:translateY(10px)}.ql-bubble .ql-tooltip a{cursor:pointer;text-decoration:none}.ql-bubble .ql-tooltip.ql-flip{transform:translateY(-10px)}.ql-bubble .ql-formats{display:inline-block;vertical-align:middle}.ql-bubble .ql-formats:after{clear:both;content:'';display:table}.ql-bubble .ql-stroke{fill:none;stroke:#ccc;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.ql-bubble .ql-stroke-miter{fill:none;stroke:#ccc;stroke-miterlimit:10;stroke-width:2}.ql-bubble .ql-fill,.ql-bubble .ql-stroke.ql-fill{fill:#ccc}.ql-bubble .ql-empty{fill:none}.ql-bubble .ql-even{fill-rule:evenodd}.ql-bubble .ql-thin,.ql-bubble .ql-stroke.ql-thin{stroke-width:1}.ql-bubble .ql-transparent{opacity:.4}.ql-bubble .ql-direction svg:last-child{display:none}.ql-bubble .ql-direction.ql-active svg:last-child{display:inline}.ql-bubble .ql-direction.ql-active svg:first-child{display:none}.ql-bubble .ql-editor h1{font-size:2em}.ql-bubble .ql-editor h2{font-size:1.5em}.ql-bubble .ql-editor h3{font-size:1.17em}.ql-bubble .ql-editor h4{font-size:1em}.ql-bubble .ql-editor h5{font-size:.83em}.ql-bubble .ql-editor h6{font-size:.67em}.ql-bubble .ql-editor a{text-decoration:underline}.ql-bubble .ql-editor blockquote{border-left:4px solid #ccc;margin-bottom:5px;margin-top:5px;padding-left:16px}.ql-bubble .ql-editor code,.ql-bubble .ql-editor .ql-code-block-container{background-color:#f0f0f0;border-radius:3px}.ql-bubble .ql-editor .ql-code-block-container{margin-bottom:5px;margin-top:5px;padding:5px 10px}.ql-bubble .ql-editor code{font-size:85%;padding:2px 4px}.ql-bubble .ql-editor .ql-code-block-container{background-color:#23241f;color:#f8f8f2;overflow:visible}.ql-bubble .ql-editor img{max-width:100%}.ql-bubble .ql-picker{color:#ccc;display:inline-block;float:left;font-size:14px;font-weight:500;height:24px;position:relative;vertical-align:middle}.ql-bubble .ql-picker-label{cursor:pointer;display:inline-block;height:100%;padding-left:8px;padding-right:2px;position:relative;width:100%}.ql-bubble .ql-picker-label::before{display:inline-block;line-height:22px}.ql-bubble .ql-picker-options{background-color:#444;display:none;min-width:100%;padding:4px 8px;position:absolute;white-space:nowrap}.ql-bubble .ql-picker-options .ql-picker-item{cursor:pointer;display:block;padding-bottom:5px;padding-top:5px}.ql-bubble .ql-picker.ql-expanded .ql-picker-label{color:#777;z-index:2}.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-fill{fill:#777}.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-stroke{stroke:#777}.ql-bubble .ql-picker.ql-expanded .ql-picker-options{display:block;margin-top:-1px;top:100%;z-index:1}.ql-bubble .ql-color-picker,.ql-bubble .ql-icon-picker{width:28px}.ql-bubble .ql-color-picker .ql-picker-label,.ql-bubble .ql-icon-picker .ql-picker-label{padding:2px 4px}.ql-bubble .ql-color-picker .ql-picker-label svg,.ql-bubble .ql-icon-picker .ql-picker-label svg{right:4px}.ql-bubble .ql-icon-picker .ql-picker-options{padding:4px 0}.ql-bubble .ql-icon-picker .ql-picker-item{height:24px;width:24px;padding:2px 4px}.ql-bubble .ql-color-picker .ql-picker-options{padding:3px 5px;width:152px}.ql-bubble .ql-color-picker .ql-picker-item{border:1px solid transparent;float:left;height:16px;margin:2px;padding:0;width:16px}.ql-bubble .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg{position:absolute;margin-top:-9px;right:0;top:50%;width:18px}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,.ql-bubble .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before{content:attr(data-label)}.ql-bubble .ql-picker.ql-header{width:98px}.ql-bubble .ql-picker.ql-header .ql-picker-label::before,.ql-bubble .ql-picker.ql-header .ql-picker-item::before{content:'Normal'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"1\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{content:'Heading 1'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"2\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{content:'Heading 2'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"3\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{content:'Heading 3'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"4\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{content:'Heading 4'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"5\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{content:'Heading 5'}.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value=\"6\"]::before,.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{content:'Heading 6'}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{font-size:2em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{font-size:1.5em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{font-size:1.17em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{font-size:1em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{font-size:.83em}.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{font-size:.67em}.ql-bubble .ql-picker.ql-font{width:108px}.ql-bubble .ql-picker.ql-font .ql-picker-label::before,.ql-bubble .ql-picker.ql-font .ql-picker-item::before{content:'Sans Serif'}.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=serif]::before,.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{content:'Serif'}.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before,.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{content:'Monospace'}.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{font-family:Georgia,Times New Roman,serif}.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{font-family:Monaco,Courier New,monospace}.ql-bubble .ql-picker.ql-size{width:98px}.ql-bubble .ql-picker.ql-size .ql-picker-label::before,.ql-bubble .ql-picker.ql-size .ql-picker-item::before{content:'Normal'}.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=small]::before,.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before{content:'Small'}.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=large]::before,.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before{content:'Large'}.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=huge]::before,.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{content:'Huge'}.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before{font-size:10px}.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before{font-size:18px}.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{font-size:32px}.ql-bubble .ql-color-picker.ql-background .ql-picker-item{background-color:#fff}.ql-bubble .ql-color-picker.ql-color .ql-picker-item{background-color:#000}.ql-code-block-container{position:relative}.ql-code-block-container .ql-ui{right:5px;top:5px}.ql-bubble .ql-toolbar .ql-formats{margin:8px 12px 8px 0}.ql-bubble .ql-toolbar .ql-formats:first-child{margin-left:12px}.ql-bubble .ql-color-picker svg{margin:1px}.ql-bubble .ql-color-picker .ql-picker-item.ql-selected,.ql-bubble .ql-color-picker .ql-picker-item:hover{border-color:#fff}.ql-bubble .ql-tooltip{background-color:#444;border-radius:25px;color:#fff}.ql-bubble .ql-tooltip-arrow{border-left:6px solid transparent;border-right:6px solid transparent;content:\" \";display:block;left:50%;margin-left:-6px;position:absolute}.ql-bubble .ql-tooltip:not(.ql-flip) .ql-tooltip-arrow{border-bottom:6px solid #444;top:-6px}.ql-bubble .ql-tooltip.ql-flip .ql-tooltip-arrow{border-top:6px solid #444;bottom:-6px}.ql-bubble .ql-tooltip.ql-editing .ql-tooltip-editor{display:block}.ql-bubble .ql-tooltip.ql-editing .ql-formats{visibility:hidden}.ql-bubble .ql-tooltip-editor{display:none}.ql-bubble .ql-tooltip-editor input[type=text]{background:transparent;border:none;color:#fff;font-size:13px;height:100%;outline:none;padding:10px 20px;position:absolute;width:100%}.ql-bubble .ql-tooltip-editor a{top:10px;position:absolute;right:20px}.ql-bubble .ql-tooltip-editor a:before{color:#ccc;content:\"\\00D7\";font-size:16px;font-weight:bold}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close){position:relative;white-space:nowrap}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close)::before{background-color:#444;border-radius:15px;top:-5px;font-size:12px;color:#fff;content:attr(href);font-weight:normal;overflow:hidden;padding:5px 15px;text-decoration:none;z-index:1}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close)::after{border-top:6px solid #444;border-left:6px solid transparent;border-right:6px solid transparent;top:0;content:\" \";height:0;width:0}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close)::before,.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close)::after{left:0;margin-left:50%;position:absolute;transform:translate(-50%,-100%);transition:visibility 0s ease 200ms;visibility:hidden}.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close):hover::before,.ql-container.ql-bubble:not(.ql-disabled) a:not(.ql-close):hover::after{visibility:visible}\n\n/*# sourceMappingURL=quill.bubble.css.map*/", "/*!\n * Quill Editor v2.0.2\n * https://quilljs.com\n * Copyright (c) 2017-2024, Slab\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */\n.ql-container{box-sizing:border-box;font-family:Helvetica,Arial,sans-serif;font-size:13px;height:100%;margin:0;position:relative}.ql-container.ql-disabled .ql-tooltip{visibility:hidden}.ql-container:not(.ql-disabled) li[data-list=checked] > .ql-ui,.ql-container:not(.ql-disabled) li[data-list=unchecked] > .ql-ui{cursor:pointer}.ql-clipboard{left:-100000px;height:1px;overflow-y:hidden;position:absolute;top:50%}.ql-clipboard p{margin:0;padding:0}.ql-editor{box-sizing:border-box;counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;line-height:1.42;height:100%;outline:none;overflow-y:auto;padding:12px 15px;tab-size:4;-moz-tab-size:4;text-align:left;white-space:pre-wrap;word-wrap:break-word}.ql-editor > *{cursor:text}.ql-editor p,.ql-editor ol,.ql-editor pre,.ql-editor blockquote,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{margin:0;padding:0}@supports (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-set:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor p,.ql-editor h1,.ql-editor h2,.ql-editor h3,.ql-editor h4,.ql-editor h5,.ql-editor h6{counter-reset:list-0 list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor table{border-collapse:collapse}.ql-editor td{border:1px solid #000;padding:2px 5px}.ql-editor ol{padding-left:1.5em}.ql-editor li{list-style-type:none;padding-left:1.5em;position:relative}.ql-editor li > .ql-ui:before{display:inline-block;margin-left:-1.5em;margin-right:.3em;text-align:right;white-space:nowrap;width:1.2em}.ql-editor li[data-list=checked] > .ql-ui,.ql-editor li[data-list=unchecked] > .ql-ui{color:#777}.ql-editor li[data-list=bullet] > .ql-ui:before{content:'\\2022'}.ql-editor li[data-list=checked] > .ql-ui:before{content:'\\2611'}.ql-editor li[data-list=unchecked] > .ql-ui:before{content:'\\2610'}@supports (counter-set:none){.ql-editor li[data-list]{counter-set:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list]{counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered]{counter-increment:list-0}.ql-editor li[data-list=ordered] > .ql-ui:before{content:counter(list-0, decimal) '. '}.ql-editor li[data-list=ordered].ql-indent-1{counter-increment:list-1}.ql-editor li[data-list=ordered].ql-indent-1 > .ql-ui:before{content:counter(list-1, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-set:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-1{counter-reset:list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-2{counter-increment:list-2}.ql-editor li[data-list=ordered].ql-indent-2 > .ql-ui:before{content:counter(list-2, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-set:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-2{counter-reset:list-3 list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-3{counter-increment:list-3}.ql-editor li[data-list=ordered].ql-indent-3 > .ql-ui:before{content:counter(list-3, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-set:list-4 list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-3{counter-reset:list-4 list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-4{counter-increment:list-4}.ql-editor li[data-list=ordered].ql-indent-4 > .ql-ui:before{content:counter(list-4, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-set:list-5 list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-4{counter-reset:list-5 list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-5{counter-increment:list-5}.ql-editor li[data-list=ordered].ql-indent-5 > .ql-ui:before{content:counter(list-5, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-set:list-6 list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-5{counter-reset:list-6 list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-6{counter-increment:list-6}.ql-editor li[data-list=ordered].ql-indent-6 > .ql-ui:before{content:counter(list-6, decimal) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-set:list-7 list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-6{counter-reset:list-7 list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-7{counter-increment:list-7}.ql-editor li[data-list=ordered].ql-indent-7 > .ql-ui:before{content:counter(list-7, lower-alpha) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-set:list-8 list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-7{counter-reset:list-8 list-9}}.ql-editor li[data-list=ordered].ql-indent-8{counter-increment:list-8}.ql-editor li[data-list=ordered].ql-indent-8 > .ql-ui:before{content:counter(list-8, lower-roman) '. '}@supports (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-set:list-9}}@supports not (counter-set:none){.ql-editor li[data-list].ql-indent-8{counter-reset:list-9}}.ql-editor li[data-list=ordered].ql-indent-9{counter-increment:list-9}.ql-editor li[data-list=ordered].ql-indent-9 > .ql-ui:before{content:counter(list-9, decimal) '. '}.ql-editor .ql-indent-1:not(.ql-direction-rtl){padding-left:3em}.ql-editor li.ql-indent-1:not(.ql-direction-rtl){padding-left:4.5em}.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:3em}.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right{padding-right:4.5em}.ql-editor .ql-indent-2:not(.ql-direction-rtl){padding-left:6em}.ql-editor li.ql-indent-2:not(.ql-direction-rtl){padding-left:7.5em}.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:6em}.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right{padding-right:7.5em}.ql-editor .ql-indent-3:not(.ql-direction-rtl){padding-left:9em}.ql-editor li.ql-indent-3:not(.ql-direction-rtl){padding-left:10.5em}.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:9em}.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right{padding-right:10.5em}.ql-editor .ql-indent-4:not(.ql-direction-rtl){padding-left:12em}.ql-editor li.ql-indent-4:not(.ql-direction-rtl){padding-left:13.5em}.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:12em}.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right{padding-right:13.5em}.ql-editor .ql-indent-5:not(.ql-direction-rtl){padding-left:15em}.ql-editor li.ql-indent-5:not(.ql-direction-rtl){padding-left:16.5em}.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:15em}.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right{padding-right:16.5em}.ql-editor .ql-indent-6:not(.ql-direction-rtl){padding-left:18em}.ql-editor li.ql-indent-6:not(.ql-direction-rtl){padding-left:19.5em}.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:18em}.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right{padding-right:19.5em}.ql-editor .ql-indent-7:not(.ql-direction-rtl){padding-left:21em}.ql-editor li.ql-indent-7:not(.ql-direction-rtl){padding-left:22.5em}.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:21em}.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right{padding-right:22.5em}.ql-editor .ql-indent-8:not(.ql-direction-rtl){padding-left:24em}.ql-editor li.ql-indent-8:not(.ql-direction-rtl){padding-left:25.5em}.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:24em}.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right{padding-right:25.5em}.ql-editor .ql-indent-9:not(.ql-direction-rtl){padding-left:27em}.ql-editor li.ql-indent-9:not(.ql-direction-rtl){padding-left:28.5em}.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:27em}.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right{padding-right:28.5em}.ql-editor li.ql-direction-rtl{padding-right:1.5em}.ql-editor li.ql-direction-rtl > .ql-ui:before{margin-left:.3em;margin-right:-1.5em;text-align:left}.ql-editor table{table-layout:fixed;width:100%}.ql-editor table td{outline:none}.ql-editor .ql-code-block-container{font-family:monospace}.ql-editor .ql-video{display:block;max-width:100%}.ql-editor .ql-video.ql-align-center{margin:0 auto}.ql-editor .ql-video.ql-align-right{margin:0 0 0 auto}.ql-editor .ql-bg-black{background-color:#000}.ql-editor .ql-bg-red{background-color:#e60000}.ql-editor .ql-bg-orange{background-color:#f90}.ql-editor .ql-bg-yellow{background-color:#ff0}.ql-editor .ql-bg-green{background-color:#008a00}.ql-editor .ql-bg-blue{background-color:#06c}.ql-editor .ql-bg-purple{background-color:#93f}.ql-editor .ql-color-white{color:#fff}.ql-editor .ql-color-red{color:#e60000}.ql-editor .ql-color-orange{color:#f90}.ql-editor .ql-color-yellow{color:#ff0}.ql-editor .ql-color-green{color:#008a00}.ql-editor .ql-color-blue{color:#06c}.ql-editor .ql-color-purple{color:#93f}.ql-editor .ql-font-serif{font-family:Georgia,Times New Roman,serif}.ql-editor .ql-font-monospace{font-family:Monaco,Courier New,monospace}.ql-editor .ql-size-small{font-size:.75em}.ql-editor .ql-size-large{font-size:1.5em}.ql-editor .ql-size-huge{font-size:2.5em}.ql-editor .ql-direction-rtl{direction:rtl;text-align:inherit}.ql-editor .ql-align-center{text-align:center}.ql-editor .ql-align-justify{text-align:justify}.ql-editor .ql-align-right{text-align:right}.ql-editor .ql-ui{position:absolute}.ql-editor.ql-blank::before{color:rgba(0,0,0,0.6);content:attr(data-placeholder);font-style:italic;left:15px;pointer-events:none;position:absolute;right:15px}.ql-snow.ql-toolbar:after,.ql-snow .ql-toolbar:after{clear:both;content:'';display:table}.ql-snow.ql-toolbar button,.ql-snow .ql-toolbar button{background:none;border:none;cursor:pointer;display:inline-block;float:left;height:24px;padding:3px 5px;width:28px}.ql-snow.ql-toolbar button svg,.ql-snow .ql-toolbar button svg{float:left;height:100%}.ql-snow.ql-toolbar button:active:hover,.ql-snow .ql-toolbar button:active:hover{outline:none}.ql-snow.ql-toolbar input.ql-image[type=file],.ql-snow .ql-toolbar input.ql-image[type=file]{display:none}.ql-snow.ql-toolbar button:hover,.ql-snow .ql-toolbar button:hover,.ql-snow.ql-toolbar button:focus,.ql-snow .ql-toolbar button:focus,.ql-snow.ql-toolbar button.ql-active,.ql-snow .ql-toolbar button.ql-active,.ql-snow.ql-toolbar .ql-picker-label:hover,.ql-snow .ql-toolbar .ql-picker-label:hover,.ql-snow.ql-toolbar .ql-picker-label.ql-active,.ql-snow .ql-toolbar .ql-picker-label.ql-active,.ql-snow.ql-toolbar .ql-picker-item:hover,.ql-snow .ql-toolbar .ql-picker-item:hover,.ql-snow.ql-toolbar .ql-picker-item.ql-selected,.ql-snow .ql-toolbar .ql-picker-item.ql-selected{color:#06c}.ql-snow.ql-toolbar button:hover .ql-fill,.ql-snow .ql-toolbar button:hover .ql-fill,.ql-snow.ql-toolbar button:focus .ql-fill,.ql-snow .ql-toolbar button:focus .ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill,.ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill,.ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill{fill:#06c}.ql-snow.ql-toolbar button:hover .ql-stroke,.ql-snow .ql-toolbar button:hover .ql-stroke,.ql-snow.ql-toolbar button:focus .ql-stroke,.ql-snow .ql-toolbar button:focus .ql-stroke,.ql-snow.ql-toolbar button.ql-active .ql-stroke,.ql-snow .ql-toolbar button.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke,.ql-snow.ql-toolbar button:hover .ql-stroke-miter,.ql-snow .ql-toolbar button:hover .ql-stroke-miter,.ql-snow.ql-toolbar button:focus .ql-stroke-miter,.ql-snow .ql-toolbar button:focus .ql-stroke-miter,.ql-snow.ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar button.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter,.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter,.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter{stroke:#06c}@media (pointer:coarse){.ql-snow.ql-toolbar button:hover:not(.ql-active),.ql-snow .ql-toolbar button:hover:not(.ql-active){color:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill{fill:#444}.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke,.ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter,.ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter{stroke:#444}}.ql-snow{box-sizing:border-box}.ql-snow *{box-sizing:border-box}.ql-snow .ql-hidden{display:none}.ql-snow .ql-out-bottom,.ql-snow .ql-out-top{visibility:hidden}.ql-snow .ql-tooltip{position:absolute;transform:translateY(10px)}.ql-snow .ql-tooltip a{cursor:pointer;text-decoration:none}.ql-snow .ql-tooltip.ql-flip{transform:translateY(-10px)}.ql-snow .ql-formats{display:inline-block;vertical-align:middle}.ql-snow .ql-formats:after{clear:both;content:'';display:table}.ql-snow .ql-stroke{fill:none;stroke:#444;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}.ql-snow .ql-stroke-miter{fill:none;stroke:#444;stroke-miterlimit:10;stroke-width:2}.ql-snow .ql-fill,.ql-snow .ql-stroke.ql-fill{fill:#444}.ql-snow .ql-empty{fill:none}.ql-snow .ql-even{fill-rule:evenodd}.ql-snow .ql-thin,.ql-snow .ql-stroke.ql-thin{stroke-width:1}.ql-snow .ql-transparent{opacity:.4}.ql-snow .ql-direction svg:last-child{display:none}.ql-snow .ql-direction.ql-active svg:last-child{display:inline}.ql-snow .ql-direction.ql-active svg:first-child{display:none}.ql-snow .ql-editor h1{font-size:2em}.ql-snow .ql-editor h2{font-size:1.5em}.ql-snow .ql-editor h3{font-size:1.17em}.ql-snow .ql-editor h4{font-size:1em}.ql-snow .ql-editor h5{font-size:.83em}.ql-snow .ql-editor h6{font-size:.67em}.ql-snow .ql-editor a{text-decoration:underline}.ql-snow .ql-editor blockquote{border-left:4px solid #ccc;margin-bottom:5px;margin-top:5px;padding-left:16px}.ql-snow .ql-editor code,.ql-snow .ql-editor .ql-code-block-container{background-color:#f0f0f0;border-radius:3px}.ql-snow .ql-editor .ql-code-block-container{margin-bottom:5px;margin-top:5px;padding:5px 10px}.ql-snow .ql-editor code{font-size:85%;padding:2px 4px}.ql-snow .ql-editor .ql-code-block-container{background-color:#23241f;color:#f8f8f2;overflow:visible}.ql-snow .ql-editor img{max-width:100%}.ql-snow .ql-picker{color:#444;display:inline-block;float:left;font-size:14px;font-weight:500;height:24px;position:relative;vertical-align:middle}.ql-snow .ql-picker-label{cursor:pointer;display:inline-block;height:100%;padding-left:8px;padding-right:2px;position:relative;width:100%}.ql-snow .ql-picker-label::before{display:inline-block;line-height:22px}.ql-snow .ql-picker-options{background-color:#fff;display:none;min-width:100%;padding:4px 8px;position:absolute;white-space:nowrap}.ql-snow .ql-picker-options .ql-picker-item{cursor:pointer;display:block;padding-bottom:5px;padding-top:5px}.ql-snow .ql-picker.ql-expanded .ql-picker-label{color:#ccc;z-index:2}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill{fill:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke{stroke:#ccc}.ql-snow .ql-picker.ql-expanded .ql-picker-options{display:block;margin-top:-1px;top:100%;z-index:1}.ql-snow .ql-color-picker,.ql-snow .ql-icon-picker{width:28px}.ql-snow .ql-color-picker .ql-picker-label,.ql-snow .ql-icon-picker .ql-picker-label{padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-label svg,.ql-snow .ql-icon-picker .ql-picker-label svg{right:4px}.ql-snow .ql-icon-picker .ql-picker-options{padding:4px 0}.ql-snow .ql-icon-picker .ql-picker-item{height:24px;width:24px;padding:2px 4px}.ql-snow .ql-color-picker .ql-picker-options{padding:3px 5px;width:152px}.ql-snow .ql-color-picker .ql-picker-item{border:1px solid transparent;float:left;height:16px;margin:2px;padding:0;width:16px}.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg{position:absolute;margin-top:-9px;right:0;top:50%;width:18px}.ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before{content:attr(data-label)}.ql-snow .ql-picker.ql-header{width:98px}.ql-snow .ql-picker.ql-header .ql-picker-label::before,.ql-snow .ql-picker.ql-header .ql-picker-item::before{content:'Normal'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"1\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{content:'Heading 1'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"2\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{content:'Heading 2'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"3\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{content:'Heading 3'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"4\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{content:'Heading 4'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"5\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{content:'Heading 5'}.ql-snow .ql-picker.ql-header .ql-picker-label[data-value=\"6\"]::before,.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{content:'Heading 6'}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"1\"]::before{font-size:2em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"2\"]::before{font-size:1.5em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"3\"]::before{font-size:1.17em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"4\"]::before{font-size:1em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"5\"]::before{font-size:.83em}.ql-snow .ql-picker.ql-header .ql-picker-item[data-value=\"6\"]::before{font-size:.67em}.ql-snow .ql-picker.ql-font{width:108px}.ql-snow .ql-picker.ql-font .ql-picker-label::before,.ql-snow .ql-picker.ql-font .ql-picker-item::before{content:'Sans Serif'}.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=serif]::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{content:'Serif'}.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before,.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{content:'Monospace'}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before{font-family:Georgia,Times New Roman,serif}.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before{font-family:Monaco,Courier New,monospace}.ql-snow .ql-picker.ql-size{width:98px}.ql-snow .ql-picker.ql-size .ql-picker-label::before,.ql-snow .ql-picker.ql-size .ql-picker-item::before{content:'Normal'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{content:'Small'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{content:'Large'}.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before,.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{content:'Huge'}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before{font-size:10px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before{font-size:18px}.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before{font-size:32px}.ql-snow .ql-color-picker.ql-background .ql-picker-item{background-color:#fff}.ql-snow .ql-color-picker.ql-color .ql-picker-item{background-color:#000}.ql-code-block-container{position:relative}.ql-code-block-container .ql-ui{right:5px;top:5px}.ql-toolbar.ql-snow{border:1px solid #ccc;box-sizing:border-box;font-family:'Helvetica Neue','Helvetica','Arial',sans-serif;padding:8px}.ql-toolbar.ql-snow .ql-formats{margin-right:15px}.ql-toolbar.ql-snow .ql-picker-label{border:1px solid transparent}.ql-toolbar.ql-snow .ql-picker-options{border:1px solid transparent;box-shadow:rgba(0,0,0,0.2) 0 2px 8px}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label{border-color:#ccc}.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options{border-color:#ccc}.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected,.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover{border-color:#000}.ql-toolbar.ql-snow + .ql-container.ql-snow{border-top:0}.ql-snow .ql-tooltip{background-color:#fff;border:1px solid #ccc;box-shadow:0 0 5px #ddd;color:#444;padding:5px 12px;white-space:nowrap}.ql-snow .ql-tooltip::before{content:\"Visit URL:\";line-height:26px;margin-right:8px}.ql-snow .ql-tooltip input[type=text]{display:none;border:1px solid #ccc;font-size:13px;height:26px;margin:0;padding:3px 5px;width:170px}.ql-snow .ql-tooltip a.ql-preview{display:inline-block;max-width:200px;overflow-x:hidden;text-overflow:ellipsis;vertical-align:top}.ql-snow .ql-tooltip a.ql-action::after{border-right:1px solid #ccc;content:'Edit';margin-left:16px;padding-right:8px}.ql-snow .ql-tooltip a.ql-remove::before{content:'Remove';margin-left:8px}.ql-snow .ql-tooltip a{line-height:26px}.ql-snow .ql-tooltip.ql-editing a.ql-preview,.ql-snow .ql-tooltip.ql-editing a.ql-remove{display:none}.ql-snow .ql-tooltip.ql-editing input[type=text]{display:inline-block}.ql-snow .ql-tooltip.ql-editing a.ql-action::after{border-right:0;content:'Save';padding-right:0}.ql-snow .ql-tooltip[data-mode=link]::before{content:\"Enter link:\"}.ql-snow .ql-tooltip[data-mode=formula]::before{content:\"Enter formula:\"}.ql-snow .ql-tooltip[data-mode=video]::before{content:\"Enter video:\"}.ql-snow a{color:#06c}.ql-container.ql-snow{border:1px solid #ccc}\n\n/*# sourceMappingURL=quill.snow.css.map*/", "/**\n * Common Math expressions.\n *\n * @module math\n */\n\nexport const floor = Math.floor\nexport const ceil = Math.ceil\nexport const abs = Math.abs\nexport const imul = Math.imul\nexport const round = Math.round\nexport const log10 = Math.log10\nexport const log2 = Math.log2\nexport const log = Math.log\nexport const sqrt = Math.sqrt\n\n/**\n * @function\n * @param {number} a\n * @param {number} b\n * @return {number} The sum of a and b\n */\nexport const add = (a, b) => a + b\n\n/**\n * @function\n * @param {number} a\n * @param {number} b\n * @return {number} The smaller element of a and b\n */\nexport const min = (a, b) => a < b ? a : b\n\n/**\n * @function\n * @param {number} a\n * @param {number} b\n * @return {number} The bigger element of a and b\n */\nexport const max = (a, b) => a > b ? a : b\n\nexport const isNaN = Number.isNaN\n\nexport const pow = Math.pow\n/**\n * Base 10 exponential function. Returns the value of 10 raised to the power of pow.\n *\n * @param {number} exp\n * @return {number}\n */\nexport const exp10 = exp => Math.pow(10, exp)\n\nexport const sign = Math.sign\n\n/**\n * @param {number} n\n * @return {boolean} Wether n is negative. This function also differentiates between -0 and +0\n */\nexport const isNegativeZero = n => n !== 0 ? n < 0 : 1 / n < 0\n", "/**\n * Utility helpers for working with numbers.\n *\n * @module number\n */\n\nimport * as math from './math.js'\nimport * as binary from './binary.js'\n\nexport const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER\nexport const MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER\n\nexport const LOWEST_INT32 = 1 << 31\nexport const HIGHEST_INT32 = binary.BITS31\nexport const HIGHEST_UINT32 = binary.BITS32\n\n/* c8 ignore next */\nexport const isInteger = Number.isInteger || (num => typeof num === 'number' && isFinite(num) && math.floor(num) === num)\nexport const isNaN = Number.isNaN\nexport const parseInt = Number.parseInt\n\n/**\n * Count the number of \"1\" bits in an unsigned 32bit number.\n *\n * Super fun bitcount algorithm by Brian Kernighan.\n *\n * @param {number} n\n */\nexport const countBits = n => {\n n &= binary.BITS32\n let count = 0\n while (n) {\n n &= (n - 1)\n count++\n }\n return count\n}\n", "/**\n * Utility module to work with sets.\n *\n * @module set\n */\n\nexport const create = () => new Set()\n\n/**\n * @template T\n * @param {Set} set\n * @return {Array}\n */\nexport const toArray = set => Array.from(set)\n\n/**\n * @template T\n * @param {Set} set\n * @return {T}\n */\nexport const first = set =>\n set.values().next().value ?? undefined\n\n/**\n * @template T\n * @param {Iterable} entries\n * @return {Set}\n */\nexport const from = entries => new Set(entries)\n", "/**\n * Utility module to work with Arrays.\n *\n * @module array\n */\n\nimport * as set from './set.js'\n\n/**\n * Return the last element of an array. The element must exist\n *\n * @template L\n * @param {ArrayLike} arr\n * @return {L}\n */\nexport const last = arr => arr[arr.length - 1]\n\n/**\n * @template C\n * @return {Array}\n */\nexport const create = () => /** @type {Array} */ ([])\n\n/**\n * @template D\n * @param {Array} a\n * @return {Array}\n */\nexport const copy = a => /** @type {Array} */ (a.slice())\n\n/**\n * Append elements from src to dest\n *\n * @template M\n * @param {Array} dest\n * @param {Array} src\n */\nexport const appendTo = (dest, src) => {\n for (let i = 0; i < src.length; i++) {\n dest.push(src[i])\n }\n}\n\n/**\n * Transforms something array-like to an actual Array.\n *\n * @function\n * @template T\n * @param {ArrayLike|Iterable} arraylike\n * @return {T}\n */\nexport const from = Array.from\n\n/**\n * True iff condition holds on every element in the Array.\n *\n * @function\n * @template ITEM\n * @template {ArrayLike} ARR\n *\n * @param {ARR} arr\n * @param {function(ITEM, number, ARR):boolean} f\n * @return {boolean}\n */\nexport const every = (arr, f) => {\n for (let i = 0; i < arr.length; i++) {\n if (!f(arr[i], i, arr)) {\n return false\n }\n }\n return true\n}\n\n/**\n * True iff condition holds on some element in the Array.\n *\n * @function\n * @template S\n * @template {ArrayLike} ARR\n * @param {ARR} arr\n * @param {function(S, number, ARR):boolean} f\n * @return {boolean}\n */\nexport const some = (arr, f) => {\n for (let i = 0; i < arr.length; i++) {\n if (f(arr[i], i, arr)) {\n return true\n }\n }\n return false\n}\n\n/**\n * @template ELEM\n *\n * @param {ArrayLike} a\n * @param {ArrayLike} b\n * @return {boolean}\n */\nexport const equalFlat = (a, b) => a.length === b.length && every(a, (item, index) => item === b[index])\n\n/**\n * @template ELEM\n * @param {Array>} arr\n * @return {Array}\n */\nexport const flatten = arr => fold(arr, /** @type {Array} */ ([]), (acc, val) => acc.concat(val))\n\n/**\n * @template T\n * @param {number} len\n * @param {function(number, Array):T} f\n * @return {Array}\n */\nexport const unfold = (len, f) => {\n const array = new Array(len)\n for (let i = 0; i < len; i++) {\n array[i] = f(i, array)\n }\n return array\n}\n\n/**\n * @template T\n * @template RESULT\n * @param {Array} arr\n * @param {RESULT} seed\n * @param {function(RESULT, T, number):RESULT} folder\n */\nexport const fold = (arr, seed, folder) => arr.reduce(folder, seed)\n\nexport const isArray = Array.isArray\n\n/**\n * @template T\n * @param {Array} arr\n * @return {Array}\n */\nexport const unique = arr => from(set.from(arr))\n\n/**\n * @template T\n * @template M\n * @param {ArrayLike} arr\n * @param {function(T):M} mapper\n * @return {Array}\n */\nexport const uniqueBy = (arr, mapper) => {\n /**\n * @type {Set}\n */\n const happened = set.create()\n /**\n * @type {Array}\n */\n const result = []\n for (let i = 0; i < arr.length; i++) {\n const el = arr[i]\n const mapped = mapper(el)\n if (!happened.has(mapped)) {\n happened.add(mapped)\n result.push(el)\n }\n }\n return result\n}\n\n/**\n * @template {ArrayLike} ARR\n * @template {function(ARR extends ArrayLike ? T : never, number, ARR):any} MAPPER\n * @param {ARR} arr\n * @param {MAPPER} mapper\n * @return {Array}\n */\nexport const map = (arr, mapper) => {\n /**\n * @type {Array}\n */\n const res = Array(arr.length)\n for (let i = 0; i < arr.length; i++) {\n res[i] = mapper(/** @type {any} */ (arr[i]), i, /** @type {any} */ (arr))\n }\n return /** @type {any} */ (res)\n}\n", "import * as array from './array.js'\n\n/**\n * Utility module to work with strings.\n *\n * @module string\n */\n\nexport const fromCharCode = String.fromCharCode\nexport const fromCodePoint = String.fromCodePoint\n\n/**\n * The largest utf16 character.\n * Corresponds to Uint8Array([255, 255]) or charcodeof(2x2^8)\n */\nexport const MAX_UTF16_CHARACTER = fromCharCode(65535)\n\n/**\n * @param {string} s\n * @return {string}\n */\nconst toLowerCase = s => s.toLowerCase()\n\nconst trimLeftRegex = /^\\s*/g\n\n/**\n * @param {string} s\n * @return {string}\n */\nexport const trimLeft = s => s.replace(trimLeftRegex, '')\n\nconst fromCamelCaseRegex = /([A-Z])/g\n\n/**\n * @param {string} s\n * @param {string} separator\n * @return {string}\n */\nexport const fromCamelCase = (s, separator) => trimLeft(s.replace(fromCamelCaseRegex, match => `${separator}${toLowerCase(match)}`))\n\n/**\n * Compute the utf8ByteLength\n * @param {string} str\n * @return {number}\n */\nexport const utf8ByteLength = str => unescape(encodeURIComponent(str)).length\n\n/**\n * @param {string} str\n * @return {Uint8Array}\n */\nexport const _encodeUtf8Polyfill = str => {\n const encodedString = unescape(encodeURIComponent(str))\n const len = encodedString.length\n const buf = new Uint8Array(len)\n for (let i = 0; i < len; i++) {\n buf[i] = /** @type {number} */ (encodedString.codePointAt(i))\n }\n return buf\n}\n\n/* c8 ignore next */\nexport const utf8TextEncoder = /** @type {TextEncoder} */ (typeof TextEncoder !== 'undefined' ? new TextEncoder() : null)\n\n/**\n * @param {string} str\n * @return {Uint8Array}\n */\nexport const _encodeUtf8Native = str => utf8TextEncoder.encode(str)\n\n/**\n * @param {string} str\n * @return {Uint8Array}\n */\n/* c8 ignore next */\nexport const encodeUtf8 = utf8TextEncoder ? _encodeUtf8Native : _encodeUtf8Polyfill\n\n/**\n * @param {Uint8Array} buf\n * @return {string}\n */\nexport const _decodeUtf8Polyfill = buf => {\n let remainingLen = buf.length\n let encodedString = ''\n let bufPos = 0\n while (remainingLen > 0) {\n const nextLen = remainingLen < 10000 ? remainingLen : 10000\n const bytes = buf.subarray(bufPos, bufPos + nextLen)\n bufPos += nextLen\n // Starting with ES5.1 we can supply a generic array-like object as arguments\n encodedString += String.fromCodePoint.apply(null, /** @type {any} */ (bytes))\n remainingLen -= nextLen\n }\n return decodeURIComponent(escape(encodedString))\n}\n\n/* c8 ignore next */\nexport let utf8TextDecoder = typeof TextDecoder === 'undefined' ? null : new TextDecoder('utf-8', { fatal: true, ignoreBOM: true })\n\n/* c8 ignore start */\nif (utf8TextDecoder && utf8TextDecoder.decode(new Uint8Array()).length === 1) {\n // Safari doesn't handle BOM correctly.\n // This fixes a bug in Safari 13.0.5 where it produces a BOM the first time it is called.\n // utf8TextDecoder.decode(new Uint8Array()).length === 1 on the first call and\n // utf8TextDecoder.decode(new Uint8Array()).length === 1 on the second call\n // Another issue is that from then on no BOM chars are recognized anymore\n /* c8 ignore next */\n utf8TextDecoder = null\n}\n/* c8 ignore stop */\n\n/**\n * @param {Uint8Array} buf\n * @return {string}\n */\nexport const _decodeUtf8Native = buf => /** @type {TextDecoder} */ (utf8TextDecoder).decode(buf)\n\n/**\n * @param {Uint8Array} buf\n * @return {string}\n */\n/* c8 ignore next */\nexport const decodeUtf8 = utf8TextDecoder ? _decodeUtf8Native : _decodeUtf8Polyfill\n\n/**\n * @param {string} str The initial string\n * @param {number} index Starting position\n * @param {number} remove Number of characters to remove\n * @param {string} insert New content to insert\n */\nexport const splice = (str, index, remove, insert = '') => str.slice(0, index) + insert + str.slice(index + remove)\n\n/**\n * @param {string} source\n * @param {number} n\n */\nexport const repeat = (source, n) => array.unfold(n, () => source).join('')\n", "/**\n * Efficient schema-less binary encoding with support for variable length encoding.\n *\n * Use [lib0/encoding] with [lib0/decoding]. Every encoding function has a corresponding decoding function.\n *\n * Encodes numbers in little-endian order (least to most significant byte order)\n * and is compatible with Golang's binary encoding (https://golang.org/pkg/encoding/binary/)\n * which is also used in Protocol Buffers.\n *\n * ```js\n * // encoding step\n * const encoder = encoding.createEncoder()\n * encoding.writeVarUint(encoder, 256)\n * encoding.writeVarString(encoder, 'Hello world!')\n * const buf = encoding.toUint8Array(encoder)\n * ```\n *\n * ```js\n * // decoding step\n * const decoder = decoding.createDecoder(buf)\n * decoding.readVarUint(decoder) // => 256\n * decoding.readVarString(decoder) // => 'Hello world!'\n * decoding.hasContent(decoder) // => false - all data is read\n * ```\n *\n * @module encoding\n */\n\nimport * as math from './math.js'\nimport * as number from './number.js'\nimport * as binary from './binary.js'\nimport * as string from './string.js'\nimport * as array from './array.js'\n\n/**\n * A BinaryEncoder handles the encoding to an Uint8Array.\n */\nexport class Encoder {\n constructor () {\n this.cpos = 0\n this.cbuf = new Uint8Array(100)\n /**\n * @type {Array}\n */\n this.bufs = []\n }\n}\n\n/**\n * @function\n * @return {Encoder}\n */\nexport const createEncoder = () => new Encoder()\n\n/**\n * @param {function(Encoder):void} f\n */\nexport const encode = (f) => {\n const encoder = createEncoder()\n f(encoder)\n return toUint8Array(encoder)\n}\n\n/**\n * The current length of the encoded data.\n *\n * @function\n * @param {Encoder} encoder\n * @return {number}\n */\nexport const length = encoder => {\n let len = encoder.cpos\n for (let i = 0; i < encoder.bufs.length; i++) {\n len += encoder.bufs[i].length\n }\n return len\n}\n\n/**\n * Check whether encoder is empty.\n *\n * @function\n * @param {Encoder} encoder\n * @return {boolean}\n */\nexport const hasContent = encoder => encoder.cpos > 0 || encoder.bufs.length > 0\n\n/**\n * Transform to Uint8Array.\n *\n * @function\n * @param {Encoder} encoder\n * @return {Uint8Array} The created ArrayBuffer.\n */\nexport const toUint8Array = encoder => {\n const uint8arr = new Uint8Array(length(encoder))\n let curPos = 0\n for (let i = 0; i < encoder.bufs.length; i++) {\n const d = encoder.bufs[i]\n uint8arr.set(d, curPos)\n curPos += d.length\n }\n uint8arr.set(new Uint8Array(encoder.cbuf.buffer, 0, encoder.cpos), curPos)\n return uint8arr\n}\n\n/**\n * Verify that it is possible to write `len` bytes wtihout checking. If\n * necessary, a new Buffer with the required length is attached.\n *\n * @param {Encoder} encoder\n * @param {number} len\n */\nexport const verifyLen = (encoder, len) => {\n const bufferLen = encoder.cbuf.length\n if (bufferLen - encoder.cpos < len) {\n encoder.bufs.push(new Uint8Array(encoder.cbuf.buffer, 0, encoder.cpos))\n encoder.cbuf = new Uint8Array(math.max(bufferLen, len) * 2)\n encoder.cpos = 0\n }\n}\n\n/**\n * Write one byte to the encoder.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The byte that is to be encoded.\n */\nexport const write = (encoder, num) => {\n const bufferLen = encoder.cbuf.length\n if (encoder.cpos === bufferLen) {\n encoder.bufs.push(encoder.cbuf)\n encoder.cbuf = new Uint8Array(bufferLen * 2)\n encoder.cpos = 0\n }\n encoder.cbuf[encoder.cpos++] = num\n}\n\n/**\n * Write one byte at a specific position.\n * Position must already be written (i.e. encoder.length > pos)\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} pos Position to which to write data\n * @param {number} num Unsigned 8-bit integer\n */\nexport const set = (encoder, pos, num) => {\n let buffer = null\n // iterate all buffers and adjust position\n for (let i = 0; i < encoder.bufs.length && buffer === null; i++) {\n const b = encoder.bufs[i]\n if (pos < b.length) {\n buffer = b // found buffer\n } else {\n pos -= b.length\n }\n }\n if (buffer === null) {\n // use current buffer\n buffer = encoder.cbuf\n }\n buffer[pos] = num\n}\n\n/**\n * Write one byte as an unsigned integer.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeUint8 = write\n\n/**\n * Write one byte as an unsigned Integer at a specific location.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} pos The location where the data will be written.\n * @param {number} num The number that is to be encoded.\n */\nexport const setUint8 = set\n\n/**\n * Write two bytes as an unsigned integer.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeUint16 = (encoder, num) => {\n write(encoder, num & binary.BITS8)\n write(encoder, (num >>> 8) & binary.BITS8)\n}\n/**\n * Write two bytes as an unsigned integer at a specific location.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} pos The location where the data will be written.\n * @param {number} num The number that is to be encoded.\n */\nexport const setUint16 = (encoder, pos, num) => {\n set(encoder, pos, num & binary.BITS8)\n set(encoder, pos + 1, (num >>> 8) & binary.BITS8)\n}\n\n/**\n * Write two bytes as an unsigned integer\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeUint32 = (encoder, num) => {\n for (let i = 0; i < 4; i++) {\n write(encoder, num & binary.BITS8)\n num >>>= 8\n }\n}\n\n/**\n * Write two bytes as an unsigned integer in big endian order.\n * (most significant byte first)\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeUint32BigEndian = (encoder, num) => {\n for (let i = 3; i >= 0; i--) {\n write(encoder, (num >>> (8 * i)) & binary.BITS8)\n }\n}\n\n/**\n * Write two bytes as an unsigned integer at a specific location.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} pos The location where the data will be written.\n * @param {number} num The number that is to be encoded.\n */\nexport const setUint32 = (encoder, pos, num) => {\n for (let i = 0; i < 4; i++) {\n set(encoder, pos + i, num & binary.BITS8)\n num >>>= 8\n }\n}\n\n/**\n * Write a variable length unsigned integer. Max encodable integer is 2^53.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeVarUint = (encoder, num) => {\n while (num > binary.BITS7) {\n write(encoder, binary.BIT8 | (binary.BITS7 & num))\n num = math.floor(num / 128) // shift >>> 7\n }\n write(encoder, binary.BITS7 & num)\n}\n\n/**\n * Write a variable length integer.\n *\n * We use the 7th bit instead for signaling that this is a negative number.\n *\n * @function\n * @param {Encoder} encoder\n * @param {number} num The number that is to be encoded.\n */\nexport const writeVarInt = (encoder, num) => {\n const isNegative = math.isNegativeZero(num)\n if (isNegative) {\n num = -num\n }\n // |- whether to continue reading |- whether is negative |- number\n write(encoder, (num > binary.BITS6 ? binary.BIT8 : 0) | (isNegative ? binary.BIT7 : 0) | (binary.BITS6 & num))\n num = math.floor(num / 64) // shift >>> 6\n // We don't need to consider the case of num === 0 so we can use a different\n // pattern here than above.\n while (num > 0) {\n write(encoder, (num > binary.BITS7 ? binary.BIT8 : 0) | (binary.BITS7 & num))\n num = math.floor(num / 128) // shift >>> 7\n }\n}\n\n/**\n * A cache to store strings temporarily\n */\nconst _strBuffer = new Uint8Array(30000)\nconst _maxStrBSize = _strBuffer.length / 3\n\n/**\n * Write a variable length string.\n *\n * @function\n * @param {Encoder} encoder\n * @param {String} str The string that is to be encoded.\n */\nexport const _writeVarStringNative = (encoder, str) => {\n if (str.length < _maxStrBSize) {\n // We can encode the string into the existing buffer\n /* c8 ignore next */\n const written = string.utf8TextEncoder.encodeInto(str, _strBuffer).written || 0\n writeVarUint(encoder, written)\n for (let i = 0; i < written; i++) {\n write(encoder, _strBuffer[i])\n }\n } else {\n writeVarUint8Array(encoder, string.encodeUtf8(str))\n }\n}\n\n/**\n * Write a variable length string.\n *\n * @function\n * @param {Encoder} encoder\n * @param {String} str The string that is to be encoded.\n */\nexport const _writeVarStringPolyfill = (encoder, str) => {\n const encodedString = unescape(encodeURIComponent(str))\n const len = encodedString.length\n writeVarUint(encoder, len)\n for (let i = 0; i < len; i++) {\n write(encoder, /** @type {number} */ (encodedString.codePointAt(i)))\n }\n}\n\n/**\n * Write a variable length string.\n *\n * @function\n * @param {Encoder} encoder\n * @param {String} str The string that is to be encoded.\n */\n/* c8 ignore next */\nexport const writeVarString = (string.utf8TextEncoder && /** @type {any} */ (string.utf8TextEncoder).encodeInto) ? _writeVarStringNative : _writeVarStringPolyfill\n\n/**\n * Write a string terminated by a special byte sequence. This is not very performant and is\n * generally discouraged. However, the resulting byte arrays are lexiographically ordered which\n * makes this a nice feature for databases.\n *\n * The string will be encoded using utf8 and then terminated and escaped using writeTerminatingUint8Array.\n *\n * @function\n * @param {Encoder} encoder\n * @param {String} str The string that is to be encoded.\n */\nexport const writeTerminatedString = (encoder, str) =>\n writeTerminatedUint8Array(encoder, string.encodeUtf8(str))\n\n/**\n * Write a terminating Uint8Array. Note that this is not performant and is generally\n * discouraged. There are few situations when this is needed.\n *\n * We use 0x0 as a terminating character. 0x1 serves as an escape character for 0x0 and 0x1.\n *\n * Example: [0,1,2] is encoded to [1,0,1,1,2,0]. 0x0, and 0x1 needed to be escaped using 0x1. Then\n * the result is terminated using the 0x0 character.\n *\n * This is basically how many systems implement null terminated strings. However, we use an escape\n * character 0x1 to avoid issues and potenial attacks on our database (if this is used as a key\n * encoder for NoSql databases).\n *\n * @function\n * @param {Encoder} encoder\n * @param {Uint8Array} buf The string that is to be encoded.\n */\nexport const writeTerminatedUint8Array = (encoder, buf) => {\n for (let i = 0; i < buf.length; i++) {\n const b = buf[i]\n if (b === 0 || b === 1) {\n write(encoder, 1)\n }\n write(encoder, buf[i])\n }\n write(encoder, 0)\n}\n\n/**\n * Write the content of another Encoder.\n *\n * @TODO: can be improved!\n * - Note: Should consider that when appending a lot of small Encoders, we should rather clone than referencing the old structure.\n * Encoders start with a rather big initial buffer.\n *\n * @function\n * @param {Encoder} encoder The enUint8Arr\n * @param {Encoder} append The BinaryEncoder to be written.\n */\nexport const writeBinaryEncoder = (encoder, append) => writeUint8Array(encoder, toUint8Array(append))\n\n/**\n * Append fixed-length Uint8Array to the encoder.\n *\n * @function\n * @param {Encoder} encoder\n * @param {Uint8Array} uint8Array\n */\nexport const writeUint8Array = (encoder, uint8Array) => {\n const bufferLen = encoder.cbuf.length\n const cpos = encoder.cpos\n const leftCopyLen = math.min(bufferLen - cpos, uint8Array.length)\n const rightCopyLen = uint8Array.length - leftCopyLen\n encoder.cbuf.set(uint8Array.subarray(0, leftCopyLen), cpos)\n encoder.cpos += leftCopyLen\n if (rightCopyLen > 0) {\n // Still something to write, write right half..\n // Append new buffer\n encoder.bufs.push(encoder.cbuf)\n // must have at least size of remaining buffer\n encoder.cbuf = new Uint8Array(math.max(bufferLen * 2, rightCopyLen))\n // copy array\n encoder.cbuf.set(uint8Array.subarray(leftCopyLen))\n encoder.cpos = rightCopyLen\n }\n}\n\n/**\n * Append an Uint8Array to Encoder.\n *\n * @function\n * @param {Encoder} encoder\n * @param {Uint8Array} uint8Array\n */\nexport const writeVarUint8Array = (encoder, uint8Array) => {\n writeVarUint(encoder, uint8Array.byteLength)\n writeUint8Array(encoder, uint8Array)\n}\n\n/**\n * Create an DataView of the next `len` bytes. Use it to write data after\n * calling this function.\n *\n * ```js\n * // write float32 using DataView\n * const dv = writeOnDataView(encoder, 4)\n * dv.setFloat32(0, 1.1)\n * // read float32 using DataView\n * const dv = readFromDataView(encoder, 4)\n * dv.getFloat32(0) // => 1.100000023841858 (leaving it to the reader to find out why this is the correct result)\n * ```\n *\n * @param {Encoder} encoder\n * @param {number} len\n * @return {DataView}\n */\nexport const writeOnDataView = (encoder, len) => {\n verifyLen(encoder, len)\n const dview = new DataView(encoder.cbuf.buffer, encoder.cpos, len)\n encoder.cpos += len\n return dview\n}\n\n/**\n * @param {Encoder} encoder\n * @param {number} num\n */\nexport const writeFloat32 = (encoder, num) => writeOnDataView(encoder, 4).setFloat32(0, num, false)\n\n/**\n * @param {Encoder} encoder\n * @param {number} num\n */\nexport const writeFloat64 = (encoder, num) => writeOnDataView(encoder, 8).setFloat64(0, num, false)\n\n/**\n * @param {Encoder} encoder\n * @param {bigint} num\n */\nexport const writeBigInt64 = (encoder, num) => /** @type {any} */ (writeOnDataView(encoder, 8)).setBigInt64(0, num, false)\n\n/**\n * @param {Encoder} encoder\n * @param {bigint} num\n */\nexport const writeBigUint64 = (encoder, num) => /** @type {any} */ (writeOnDataView(encoder, 8)).setBigUint64(0, num, false)\n\nconst floatTestBed = new DataView(new ArrayBuffer(4))\n/**\n * Check if a number can be encoded as a 32 bit float.\n *\n * @param {number} num\n * @return {boolean}\n */\nconst isFloat32 = num => {\n floatTestBed.setFloat32(0, num)\n return floatTestBed.getFloat32(0) === num\n}\n\n/**\n * Encode data with efficient binary format.\n *\n * Differences to JSON:\n * \u2022 Transforms data to a binary format (not to a string)\n * \u2022 Encodes undefined, NaN, and ArrayBuffer (these can't be represented in JSON)\n * \u2022 Numbers are efficiently encoded either as a variable length integer, as a\n * 32 bit float, as a 64 bit float, or as a 64 bit bigint.\n *\n * Encoding table:\n *\n * | Data Type | Prefix | Encoding Method | Comment |\n * | ------------------- | -------- | ------------------ | ------- |\n * | undefined | 127 | | Functions, symbol, and everything that cannot be identified is encoded as undefined |\n * | null | 126 | | |\n * | integer | 125 | writeVarInt | Only encodes 32 bit signed integers |\n * | float32 | 124 | writeFloat32 | |\n * | float64 | 123 | writeFloat64 | |\n * | bigint | 122 | writeBigInt64 | |\n * | boolean (false) | 121 | | True and false are different data types so we save the following byte |\n * | boolean (true) | 120 | | - 0b01111000 so the last bit determines whether true or false |\n * | string | 119 | writeVarString | |\n * | object | 118 | custom | Writes {length} then {length} key-value pairs |\n * | array | 117 | custom | Writes {length} then {length} json values |\n * | Uint8Array | 116 | writeVarUint8Array | We use Uint8Array for any kind of binary data |\n *\n * Reasons for the decreasing prefix:\n * We need the first bit for extendability (later we may want to encode the\n * prefix with writeVarUint). The remaining 7 bits are divided as follows:\n * [0-30] the beginning of the data range is used for custom purposes\n * (defined by the function that uses this library)\n * [31-127] the end of the data range is used for data encoding by\n * lib0/encoding.js\n *\n * @param {Encoder} encoder\n * @param {undefined|null|number|bigint|boolean|string|Object|Array|Uint8Array} data\n */\nexport const writeAny = (encoder, data) => {\n switch (typeof data) {\n case 'string':\n // TYPE 119: STRING\n write(encoder, 119)\n writeVarString(encoder, data)\n break\n case 'number':\n if (number.isInteger(data) && math.abs(data) <= binary.BITS31) {\n // TYPE 125: INTEGER\n write(encoder, 125)\n writeVarInt(encoder, data)\n } else if (isFloat32(data)) {\n // TYPE 124: FLOAT32\n write(encoder, 124)\n writeFloat32(encoder, data)\n } else {\n // TYPE 123: FLOAT64\n write(encoder, 123)\n writeFloat64(encoder, data)\n }\n break\n case 'bigint':\n // TYPE 122: BigInt\n write(encoder, 122)\n writeBigInt64(encoder, data)\n break\n case 'object':\n if (data === null) {\n // TYPE 126: null\n write(encoder, 126)\n } else if (array.isArray(data)) {\n // TYPE 117: Array\n write(encoder, 117)\n writeVarUint(encoder, data.length)\n for (let i = 0; i < data.length; i++) {\n writeAny(encoder, data[i])\n }\n } else if (data instanceof Uint8Array) {\n // TYPE 116: ArrayBuffer\n write(encoder, 116)\n writeVarUint8Array(encoder, data)\n } else {\n // TYPE 118: Object\n write(encoder, 118)\n const keys = Object.keys(data)\n writeVarUint(encoder, keys.length)\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n writeVarString(encoder, key)\n writeAny(encoder, data[key])\n }\n }\n break\n case 'boolean':\n // TYPE 120/121: boolean (true/false)\n write(encoder, data ? 120 : 121)\n break\n default:\n // TYPE 127: undefined\n write(encoder, 127)\n }\n}\n\n/**\n * Now come a few stateful encoder that have their own classes.\n */\n\n/**\n * Basic Run Length Encoder - a basic compression implementation.\n *\n * Encodes [1,1,1,7] to [1,3,7,1] (3 times 1, 1 time 7). This encoder might do more harm than good if there are a lot of values that are not repeated.\n *\n * It was originally used for image compression. Cool .. article http://csbruce.com/cbm/transactor/pdfs/trans_v7_i06.pdf\n *\n * @note T must not be null!\n *\n * @template T\n */\nexport class RleEncoder extends Encoder {\n /**\n * @param {function(Encoder, T):void} writer\n */\n constructor (writer) {\n super()\n /**\n * The writer\n */\n this.w = writer\n /**\n * Current state\n * @type {T|null}\n */\n this.s = null\n this.count = 0\n }\n\n /**\n * @param {T} v\n */\n write (v) {\n if (this.s === v) {\n this.count++\n } else {\n if (this.count > 0) {\n // flush counter, unless this is the first value (count = 0)\n writeVarUint(this, this.count - 1) // since count is always > 0, we can decrement by one. non-standard encoding ftw\n }\n this.count = 1\n // write first value\n this.w(this, v)\n this.s = v\n }\n }\n}\n\n/**\n * Basic diff decoder using variable length encoding.\n *\n * Encodes the values [3, 1100, 1101, 1050, 0] to [3, 1097, 1, -51, -1050] using writeVarInt.\n */\nexport class IntDiffEncoder extends Encoder {\n /**\n * @param {number} start\n */\n constructor (start) {\n super()\n /**\n * Current state\n * @type {number}\n */\n this.s = start\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n writeVarInt(this, v - this.s)\n this.s = v\n }\n}\n\n/**\n * A combination of IntDiffEncoder and RleEncoder.\n *\n * Basically first writes the IntDiffEncoder and then counts duplicate diffs using RleEncoding.\n *\n * Encodes the values [1,1,1,2,3,4,5,6] as [1,1,0,2,1,5] (RLE([1,0,0,1,1,1,1,1]) \u21D2 RleIntDiff[1,1,0,2,1,5])\n */\nexport class RleIntDiffEncoder extends Encoder {\n /**\n * @param {number} start\n */\n constructor (start) {\n super()\n /**\n * Current state\n * @type {number}\n */\n this.s = start\n this.count = 0\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n if (this.s === v && this.count > 0) {\n this.count++\n } else {\n if (this.count > 0) {\n // flush counter, unless this is the first value (count = 0)\n writeVarUint(this, this.count - 1) // since count is always > 0, we can decrement by one. non-standard encoding ftw\n }\n this.count = 1\n // write first value\n writeVarInt(this, v - this.s)\n this.s = v\n }\n }\n}\n\n/**\n * @param {UintOptRleEncoder} encoder\n */\nconst flushUintOptRleEncoder = encoder => {\n if (encoder.count > 0) {\n // flush counter, unless this is the first value (count = 0)\n // case 1: just a single value. set sign to positive\n // case 2: write several values. set sign to negative to indicate that there is a length coming\n writeVarInt(encoder.encoder, encoder.count === 1 ? encoder.s : -encoder.s)\n if (encoder.count > 1) {\n writeVarUint(encoder.encoder, encoder.count - 2) // since count is always > 1, we can decrement by one. non-standard encoding ftw\n }\n }\n}\n\n/**\n * Optimized Rle encoder that does not suffer from the mentioned problem of the basic Rle encoder.\n *\n * Internally uses VarInt encoder to write unsigned integers. If the input occurs multiple times, we write\n * write it as a negative number. The UintOptRleDecoder then understands that it needs to read a count.\n *\n * Encodes [1,2,3,3,3] as [1,2,-3,3] (once 1, once 2, three times 3)\n */\nexport class UintOptRleEncoder {\n constructor () {\n this.encoder = new Encoder()\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n if (this.s === v) {\n this.count++\n } else {\n flushUintOptRleEncoder(this)\n this.count = 1\n this.s = v\n }\n }\n\n /**\n * Flush the encoded state and transform this to a Uint8Array.\n *\n * Note that this should only be called once.\n */\n toUint8Array () {\n flushUintOptRleEncoder(this)\n return toUint8Array(this.encoder)\n }\n}\n\n/**\n * Increasing Uint Optimized RLE Encoder\n *\n * The RLE encoder counts the number of same occurences of the same value.\n * The IncUintOptRle encoder counts if the value increases.\n * I.e. 7, 8, 9, 10 will be encoded as [-7, 4]. 1, 3, 5 will be encoded\n * as [1, 3, 5].\n */\nexport class IncUintOptRleEncoder {\n constructor () {\n this.encoder = new Encoder()\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n if (this.s + this.count === v) {\n this.count++\n } else {\n flushUintOptRleEncoder(this)\n this.count = 1\n this.s = v\n }\n }\n\n /**\n * Flush the encoded state and transform this to a Uint8Array.\n *\n * Note that this should only be called once.\n */\n toUint8Array () {\n flushUintOptRleEncoder(this)\n return toUint8Array(this.encoder)\n }\n}\n\n/**\n * @param {IntDiffOptRleEncoder} encoder\n */\nconst flushIntDiffOptRleEncoder = encoder => {\n if (encoder.count > 0) {\n // 31 bit making up the diff | wether to write the counter\n // const encodedDiff = encoder.diff << 1 | (encoder.count === 1 ? 0 : 1)\n const encodedDiff = encoder.diff * 2 + (encoder.count === 1 ? 0 : 1)\n // flush counter, unless this is the first value (count = 0)\n // case 1: just a single value. set first bit to positive\n // case 2: write several values. set first bit to negative to indicate that there is a length coming\n writeVarInt(encoder.encoder, encodedDiff)\n if (encoder.count > 1) {\n writeVarUint(encoder.encoder, encoder.count - 2) // since count is always > 1, we can decrement by one. non-standard encoding ftw\n }\n }\n}\n\n/**\n * A combination of the IntDiffEncoder and the UintOptRleEncoder.\n *\n * The count approach is similar to the UintDiffOptRleEncoder, but instead of using the negative bitflag, it encodes\n * in the LSB whether a count is to be read. Therefore this Encoder only supports 31 bit integers!\n *\n * Encodes [1, 2, 3, 2] as [3, 1, 6, -1] (more specifically [(1 << 1) | 1, (3 << 0) | 0, -1])\n *\n * Internally uses variable length encoding. Contrary to normal UintVar encoding, the first byte contains:\n * * 1 bit that denotes whether the next value is a count (LSB)\n * * 1 bit that denotes whether this value is negative (MSB - 1)\n * * 1 bit that denotes whether to continue reading the variable length integer (MSB)\n *\n * Therefore, only five bits remain to encode diff ranges.\n *\n * Use this Encoder only when appropriate. In most cases, this is probably a bad idea.\n */\nexport class IntDiffOptRleEncoder {\n constructor () {\n this.encoder = new Encoder()\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n this.diff = 0\n }\n\n /**\n * @param {number} v\n */\n write (v) {\n if (this.diff === v - this.s) {\n this.s = v\n this.count++\n } else {\n flushIntDiffOptRleEncoder(this)\n this.count = 1\n this.diff = v - this.s\n this.s = v\n }\n }\n\n /**\n * Flush the encoded state and transform this to a Uint8Array.\n *\n * Note that this should only be called once.\n */\n toUint8Array () {\n flushIntDiffOptRleEncoder(this)\n return toUint8Array(this.encoder)\n }\n}\n\n/**\n * Optimized String Encoder.\n *\n * Encoding many small strings in a simple Encoder is not very efficient. The function call to decode a string takes some time and creates references that must be eventually deleted.\n * In practice, when decoding several million small strings, the GC will kick in more and more often to collect orphaned string objects (or maybe there is another reason?).\n *\n * This string encoder solves the above problem. All strings are concatenated and written as a single string using a single encoding call.\n *\n * The lengths are encoded using a UintOptRleEncoder.\n */\nexport class StringEncoder {\n constructor () {\n /**\n * @type {Array}\n */\n this.sarr = []\n this.s = ''\n this.lensE = new UintOptRleEncoder()\n }\n\n /**\n * @param {string} string\n */\n write (string) {\n this.s += string\n if (this.s.length > 19) {\n this.sarr.push(this.s)\n this.s = ''\n }\n this.lensE.write(string.length)\n }\n\n toUint8Array () {\n const encoder = new Encoder()\n this.sarr.push(this.s)\n this.s = ''\n writeVarString(encoder, this.sarr.join(''))\n writeUint8Array(encoder, this.lensE.toUint8Array())\n return toUint8Array(encoder)\n }\n}\n", "/**\n * Error helpers.\n *\n * @module error\n */\n\n/**\n * @param {string} s\n * @return {Error}\n */\n/* c8 ignore next */\nexport const create = s => new Error(s)\n\n/**\n * @throws {Error}\n * @return {never}\n */\n/* c8 ignore next 3 */\nexport const methodUnimplemented = () => {\n throw create('Method unimplemented')\n}\n\n/**\n * @throws {Error}\n * @return {never}\n */\n/* c8 ignore next 3 */\nexport const unexpectedCase = () => {\n throw create('Unexpected case')\n}\n", "/**\n * Efficient schema-less binary decoding with support for variable length encoding.\n *\n * Use [lib0/decoding] with [lib0/encoding]. Every encoding function has a corresponding decoding function.\n *\n * Encodes numbers in little-endian order (least to most significant byte order)\n * and is compatible with Golang's binary encoding (https://golang.org/pkg/encoding/binary/)\n * which is also used in Protocol Buffers.\n *\n * ```js\n * // encoding step\n * const encoder = encoding.createEncoder()\n * encoding.writeVarUint(encoder, 256)\n * encoding.writeVarString(encoder, 'Hello world!')\n * const buf = encoding.toUint8Array(encoder)\n * ```\n *\n * ```js\n * // decoding step\n * const decoder = decoding.createDecoder(buf)\n * decoding.readVarUint(decoder) // => 256\n * decoding.readVarString(decoder) // => 'Hello world!'\n * decoding.hasContent(decoder) // => false - all data is read\n * ```\n *\n * @module decoding\n */\n\nimport * as binary from './binary.js'\nimport * as math from './math.js'\nimport * as number from './number.js'\nimport * as string from './string.js'\nimport * as error from './error.js'\nimport * as encoding from './encoding.js'\n\nconst errorUnexpectedEndOfArray = error.create('Unexpected end of array')\nconst errorIntegerOutOfRange = error.create('Integer out of Range')\n\n/**\n * A Decoder handles the decoding of an Uint8Array.\n */\nexport class Decoder {\n /**\n * @param {Uint8Array} uint8Array Binary data to decode\n */\n constructor (uint8Array) {\n /**\n * Decoding target.\n *\n * @type {Uint8Array}\n */\n this.arr = uint8Array\n /**\n * Current decoding position.\n *\n * @type {number}\n */\n this.pos = 0\n }\n}\n\n/**\n * @function\n * @param {Uint8Array} uint8Array\n * @return {Decoder}\n */\nexport const createDecoder = uint8Array => new Decoder(uint8Array)\n\n/**\n * @function\n * @param {Decoder} decoder\n * @return {boolean}\n */\nexport const hasContent = decoder => decoder.pos !== decoder.arr.length\n\n/**\n * Clone a decoder instance.\n * Optionally set a new position parameter.\n *\n * @function\n * @param {Decoder} decoder The decoder instance\n * @param {number} [newPos] Defaults to current position\n * @return {Decoder} A clone of `decoder`\n */\nexport const clone = (decoder, newPos = decoder.pos) => {\n const _decoder = createDecoder(decoder.arr)\n _decoder.pos = newPos\n return _decoder\n}\n\n/**\n * Create an Uint8Array view of the next `len` bytes and advance the position by `len`.\n *\n * Important: The Uint8Array still points to the underlying ArrayBuffer. Make sure to discard the result as soon as possible to prevent any memory leaks.\n * Use `buffer.copyUint8Array` to copy the result into a new Uint8Array.\n *\n * @function\n * @param {Decoder} decoder The decoder instance\n * @param {number} len The length of bytes to read\n * @return {Uint8Array}\n */\nexport const readUint8Array = (decoder, len) => {\n const view = new Uint8Array(decoder.arr.buffer, decoder.pos + decoder.arr.byteOffset, len)\n decoder.pos += len\n return view\n}\n\n/**\n * Read variable length Uint8Array.\n *\n * Important: The Uint8Array still points to the underlying ArrayBuffer. Make sure to discard the result as soon as possible to prevent any memory leaks.\n * Use `buffer.copyUint8Array` to copy the result into a new Uint8Array.\n *\n * @function\n * @param {Decoder} decoder\n * @return {Uint8Array}\n */\nexport const readVarUint8Array = decoder => readUint8Array(decoder, readVarUint(decoder))\n\n/**\n * Read the rest of the content as an ArrayBuffer\n * @function\n * @param {Decoder} decoder\n * @return {Uint8Array}\n */\nexport const readTailAsUint8Array = decoder => readUint8Array(decoder, decoder.arr.length - decoder.pos)\n\n/**\n * Skip one byte, jump to the next position.\n * @function\n * @param {Decoder} decoder The decoder instance\n * @return {number} The next position\n */\nexport const skip8 = decoder => decoder.pos++\n\n/**\n * Read one byte as unsigned integer.\n * @function\n * @param {Decoder} decoder The decoder instance\n * @return {number} Unsigned 8-bit integer\n */\nexport const readUint8 = decoder => decoder.arr[decoder.pos++]\n\n/**\n * Read 2 bytes as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const readUint16 = decoder => {\n const uint =\n decoder.arr[decoder.pos] +\n (decoder.arr[decoder.pos + 1] << 8)\n decoder.pos += 2\n return uint\n}\n\n/**\n * Read 4 bytes as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const readUint32 = decoder => {\n const uint =\n (decoder.arr[decoder.pos] +\n (decoder.arr[decoder.pos + 1] << 8) +\n (decoder.arr[decoder.pos + 2] << 16) +\n (decoder.arr[decoder.pos + 3] << 24)) >>> 0\n decoder.pos += 4\n return uint\n}\n\n/**\n * Read 4 bytes as unsigned integer in big endian order.\n * (most significant byte first)\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const readUint32BigEndian = decoder => {\n const uint =\n (decoder.arr[decoder.pos + 3] +\n (decoder.arr[decoder.pos + 2] << 8) +\n (decoder.arr[decoder.pos + 1] << 16) +\n (decoder.arr[decoder.pos] << 24)) >>> 0\n decoder.pos += 4\n return uint\n}\n\n/**\n * Look ahead without incrementing the position\n * to the next byte and read it as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const peekUint8 = decoder => decoder.arr[decoder.pos]\n\n/**\n * Look ahead without incrementing the position\n * to the next byte and read it as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const peekUint16 = decoder =>\n decoder.arr[decoder.pos] +\n (decoder.arr[decoder.pos + 1] << 8)\n\n/**\n * Look ahead without incrementing the position\n * to the next byte and read it as unsigned integer.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.\n */\nexport const peekUint32 = decoder => (\n decoder.arr[decoder.pos] +\n (decoder.arr[decoder.pos + 1] << 8) +\n (decoder.arr[decoder.pos + 2] << 16) +\n (decoder.arr[decoder.pos + 3] << 24)\n) >>> 0\n\n/**\n * Read unsigned integer (32bit) with variable length.\n * 1/8th of the storage is used as encoding overhead.\n * * numbers < 2^7 is stored in one bytlength\n * * numbers < 2^14 is stored in two bylength\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.length\n */\nexport const readVarUint = decoder => {\n let num = 0\n let mult = 1\n const len = decoder.arr.length\n while (decoder.pos < len) {\n const r = decoder.arr[decoder.pos++]\n // num = num | ((r & binary.BITS7) << len)\n num = num + (r & binary.BITS7) * mult // shift $r << (7*#iterations) and add it to num\n mult *= 128 // next iteration, shift 7 \"more\" to the left\n if (r < binary.BIT8) {\n return num\n }\n /* c8 ignore start */\n if (num > number.MAX_SAFE_INTEGER) {\n throw errorIntegerOutOfRange\n }\n /* c8 ignore stop */\n }\n throw errorUnexpectedEndOfArray\n}\n\n/**\n * Read signed integer (32bit) with variable length.\n * 1/8th of the storage is used as encoding overhead.\n * * numbers < 2^7 is stored in one bytlength\n * * numbers < 2^14 is stored in two bylength\n * @todo This should probably create the inverse ~num if number is negative - but this would be a breaking change.\n *\n * @function\n * @param {Decoder} decoder\n * @return {number} An unsigned integer.length\n */\nexport const readVarInt = decoder => {\n let r = decoder.arr[decoder.pos++]\n let num = r & binary.BITS6\n let mult = 64\n const sign = (r & binary.BIT7) > 0 ? -1 : 1\n if ((r & binary.BIT8) === 0) {\n // don't continue reading\n return sign * num\n }\n const len = decoder.arr.length\n while (decoder.pos < len) {\n r = decoder.arr[decoder.pos++]\n // num = num | ((r & binary.BITS7) << len)\n num = num + (r & binary.BITS7) * mult\n mult *= 128\n if (r < binary.BIT8) {\n return sign * num\n }\n /* c8 ignore start */\n if (num > number.MAX_SAFE_INTEGER) {\n throw errorIntegerOutOfRange\n }\n /* c8 ignore stop */\n }\n throw errorUnexpectedEndOfArray\n}\n\n/**\n * Look ahead and read varUint without incrementing position\n *\n * @function\n * @param {Decoder} decoder\n * @return {number}\n */\nexport const peekVarUint = decoder => {\n const pos = decoder.pos\n const s = readVarUint(decoder)\n decoder.pos = pos\n return s\n}\n\n/**\n * Look ahead and read varUint without incrementing position\n *\n * @function\n * @param {Decoder} decoder\n * @return {number}\n */\nexport const peekVarInt = decoder => {\n const pos = decoder.pos\n const s = readVarInt(decoder)\n decoder.pos = pos\n return s\n}\n\n/**\n * We don't test this function anymore as we use native decoding/encoding by default now.\n * Better not modify this anymore..\n *\n * Transforming utf8 to a string is pretty expensive. The code performs 10x better\n * when String.fromCodePoint is fed with all characters as arguments.\n * But most environments have a maximum number of arguments per functions.\n * For effiency reasons we apply a maximum of 10000 characters at once.\n *\n * @function\n * @param {Decoder} decoder\n * @return {String} The read String.\n */\n/* c8 ignore start */\nexport const _readVarStringPolyfill = decoder => {\n let remainingLen = readVarUint(decoder)\n if (remainingLen === 0) {\n return ''\n } else {\n let encodedString = String.fromCodePoint(readUint8(decoder)) // remember to decrease remainingLen\n if (--remainingLen < 100) { // do not create a Uint8Array for small strings\n while (remainingLen--) {\n encodedString += String.fromCodePoint(readUint8(decoder))\n }\n } else {\n while (remainingLen > 0) {\n const nextLen = remainingLen < 10000 ? remainingLen : 10000\n // this is dangerous, we create a fresh array view from the existing buffer\n const bytes = decoder.arr.subarray(decoder.pos, decoder.pos + nextLen)\n decoder.pos += nextLen\n // Starting with ES5.1 we can supply a generic array-like object as arguments\n encodedString += String.fromCodePoint.apply(null, /** @type {any} */ (bytes))\n remainingLen -= nextLen\n }\n }\n return decodeURIComponent(escape(encodedString))\n }\n}\n/* c8 ignore stop */\n\n/**\n * @function\n * @param {Decoder} decoder\n * @return {String} The read String\n */\nexport const _readVarStringNative = decoder =>\n /** @type any */ (string.utf8TextDecoder).decode(readVarUint8Array(decoder))\n\n/**\n * Read string of variable length\n * * varUint is used to store the length of the string\n *\n * @function\n * @param {Decoder} decoder\n * @return {String} The read String\n *\n */\n/* c8 ignore next */\nexport const readVarString = string.utf8TextDecoder ? _readVarStringNative : _readVarStringPolyfill\n\n/**\n * @param {Decoder} decoder\n * @return {Uint8Array}\n */\nexport const readTerminatedUint8Array = decoder => {\n const encoder = encoding.createEncoder()\n let b\n while (true) {\n b = readUint8(decoder)\n if (b === 0) {\n return encoding.toUint8Array(encoder)\n }\n if (b === 1) {\n b = readUint8(decoder)\n }\n encoding.write(encoder, b)\n }\n}\n\n/**\n * @param {Decoder} decoder\n * @return {string}\n */\nexport const readTerminatedString = decoder => string.decodeUtf8(readTerminatedUint8Array(decoder))\n\n/**\n * Look ahead and read varString without incrementing position\n *\n * @function\n * @param {Decoder} decoder\n * @return {string}\n */\nexport const peekVarString = decoder => {\n const pos = decoder.pos\n const s = readVarString(decoder)\n decoder.pos = pos\n return s\n}\n\n/**\n * @param {Decoder} decoder\n * @param {number} len\n * @return {DataView}\n */\nexport const readFromDataView = (decoder, len) => {\n const dv = new DataView(decoder.arr.buffer, decoder.arr.byteOffset + decoder.pos, len)\n decoder.pos += len\n return dv\n}\n\n/**\n * @param {Decoder} decoder\n */\nexport const readFloat32 = decoder => readFromDataView(decoder, 4).getFloat32(0, false)\n\n/**\n * @param {Decoder} decoder\n */\nexport const readFloat64 = decoder => readFromDataView(decoder, 8).getFloat64(0, false)\n\n/**\n * @param {Decoder} decoder\n */\nexport const readBigInt64 = decoder => /** @type {any} */ (readFromDataView(decoder, 8)).getBigInt64(0, false)\n\n/**\n * @param {Decoder} decoder\n */\nexport const readBigUint64 = decoder => /** @type {any} */ (readFromDataView(decoder, 8)).getBigUint64(0, false)\n\n/**\n * @type {Array}\n */\nconst readAnyLookupTable = [\n decoder => undefined, // CASE 127: undefined\n decoder => null, // CASE 126: null\n readVarInt, // CASE 125: integer\n readFloat32, // CASE 124: float32\n readFloat64, // CASE 123: float64\n readBigInt64, // CASE 122: bigint\n decoder => false, // CASE 121: boolean (false)\n decoder => true, // CASE 120: boolean (true)\n readVarString, // CASE 119: string\n decoder => { // CASE 118: object\n const len = readVarUint(decoder)\n /**\n * @type {Object}\n */\n const obj = {}\n for (let i = 0; i < len; i++) {\n const key = readVarString(decoder)\n obj[key] = readAny(decoder)\n }\n return obj\n },\n decoder => { // CASE 117: array\n const len = readVarUint(decoder)\n const arr = []\n for (let i = 0; i < len; i++) {\n arr.push(readAny(decoder))\n }\n return arr\n },\n readVarUint8Array // CASE 116: Uint8Array\n]\n\n/**\n * @param {Decoder} decoder\n */\nexport const readAny = decoder => readAnyLookupTable[127 - readUint8(decoder)](decoder)\n\n/**\n * T must not be null.\n *\n * @template T\n */\nexport class RleDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n * @param {function(Decoder):T} reader\n */\n constructor (uint8Array, reader) {\n super(uint8Array)\n /**\n * The reader\n */\n this.reader = reader\n /**\n * Current state\n * @type {T|null}\n */\n this.s = null\n this.count = 0\n }\n\n read () {\n if (this.count === 0) {\n this.s = this.reader(this)\n if (hasContent(this)) {\n this.count = readVarUint(this) + 1 // see encoder implementation for the reason why this is incremented\n } else {\n this.count = -1 // read the current value forever\n }\n }\n this.count--\n return /** @type {T} */ (this.s)\n }\n}\n\nexport class IntDiffDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n * @param {number} start\n */\n constructor (uint8Array, start) {\n super(uint8Array)\n /**\n * Current state\n * @type {number}\n */\n this.s = start\n }\n\n /**\n * @return {number}\n */\n read () {\n this.s += readVarInt(this)\n return this.s\n }\n}\n\nexport class RleIntDiffDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n * @param {number} start\n */\n constructor (uint8Array, start) {\n super(uint8Array)\n /**\n * Current state\n * @type {number}\n */\n this.s = start\n this.count = 0\n }\n\n /**\n * @return {number}\n */\n read () {\n if (this.count === 0) {\n this.s += readVarInt(this)\n if (hasContent(this)) {\n this.count = readVarUint(this) + 1 // see encoder implementation for the reason why this is incremented\n } else {\n this.count = -1 // read the current value forever\n }\n }\n this.count--\n return /** @type {number} */ (this.s)\n }\n}\n\nexport class UintOptRleDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n */\n constructor (uint8Array) {\n super(uint8Array)\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n }\n\n read () {\n if (this.count === 0) {\n this.s = readVarInt(this)\n // if the sign is negative, we read the count too, otherwise count is 1\n const isNegative = math.isNegativeZero(this.s)\n this.count = 1\n if (isNegative) {\n this.s = -this.s\n this.count = readVarUint(this) + 2\n }\n }\n this.count--\n return /** @type {number} */ (this.s)\n }\n}\n\nexport class IncUintOptRleDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n */\n constructor (uint8Array) {\n super(uint8Array)\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n }\n\n read () {\n if (this.count === 0) {\n this.s = readVarInt(this)\n // if the sign is negative, we read the count too, otherwise count is 1\n const isNegative = math.isNegativeZero(this.s)\n this.count = 1\n if (isNegative) {\n this.s = -this.s\n this.count = readVarUint(this) + 2\n }\n }\n this.count--\n return /** @type {number} */ (this.s++)\n }\n}\n\nexport class IntDiffOptRleDecoder extends Decoder {\n /**\n * @param {Uint8Array} uint8Array\n */\n constructor (uint8Array) {\n super(uint8Array)\n /**\n * @type {number}\n */\n this.s = 0\n this.count = 0\n this.diff = 0\n }\n\n /**\n * @return {number}\n */\n read () {\n if (this.count === 0) {\n const diff = readVarInt(this)\n // if the first bit is set, we read more data\n const hasCount = diff & 1\n this.diff = math.floor(diff / 2) // shift >> 1\n this.count = 1\n if (hasCount) {\n this.count = readVarUint(this) + 2\n }\n }\n this.s += this.diff\n this.count--\n return this.s\n }\n}\n\nexport class StringDecoder {\n /**\n * @param {Uint8Array} uint8Array\n */\n constructor (uint8Array) {\n this.decoder = new UintOptRleDecoder(uint8Array)\n this.str = readVarString(this.decoder)\n /**\n * @type {number}\n */\n this.spos = 0\n }\n\n /**\n * @return {string}\n */\n read () {\n const end = this.spos + this.decoder.read()\n const res = this.str.slice(this.spos, end)\n this.spos = end\n return res\n }\n}\n", "/**\n * Utility module to work with time.\n *\n * @module time\n */\n\nimport * as metric from './metric.js'\nimport * as math from './math.js'\n\n/**\n * Return current time.\n *\n * @return {Date}\n */\nexport const getDate = () => new Date()\n\n/**\n * Return current unix time.\n *\n * @return {number}\n */\nexport const getUnixTime = Date.now\n\n/**\n * Transform time (in ms) to a human readable format. E.g. 1100 => 1.1s. 60s => 1min. .001 => 10\u03BCs.\n *\n * @param {number} d duration in milliseconds\n * @return {string} humanized approximation of time\n */\nexport const humanizeDuration = d => {\n if (d < 60000) {\n const p = metric.prefix(d, -1)\n return math.round(p.n * 100) / 100 + p.prefix + 's'\n }\n d = math.floor(d / 1000)\n const seconds = d % 60\n const minutes = math.floor(d / 60) % 60\n const hours = math.floor(d / 3600) % 24\n const days = math.floor(d / 86400)\n if (days > 0) {\n return days + 'd' + ((hours > 0 || minutes > 30) ? ' ' + (minutes > 30 ? hours + 1 : hours) + 'h' : '')\n }\n if (hours > 0) {\n /* c8 ignore next */\n return hours + 'h' + ((minutes > 0 || seconds > 30) ? ' ' + (seconds > 30 ? minutes + 1 : minutes) + 'min' : '')\n }\n return minutes + 'min' + (seconds > 0 ? ' ' + seconds + 's' : '')\n}\n", "/**\n * Utility module to work with key-value stores.\n *\n * @module map\n */\n\n/**\n * Creates a new Map instance.\n *\n * @function\n * @return {Map}\n *\n * @function\n */\nexport const create = () => new Map()\n\n/**\n * Copy a Map object into a fresh Map object.\n *\n * @function\n * @template K,V\n * @param {Map} m\n * @return {Map}\n */\nexport const copy = m => {\n const r = create()\n m.forEach((v, k) => { r.set(k, v) })\n return r\n}\n\n/**\n * Get map property. Create T if property is undefined and set T on map.\n *\n * ```js\n * const listeners = map.setIfUndefined(events, 'eventName', set.create)\n * listeners.add(listener)\n * ```\n *\n * @function\n * @template {Map} MAP\n * @template {MAP extends Map ? function():V : unknown} CF\n * @param {MAP} map\n * @param {MAP extends Map ? K : unknown} key\n * @param {CF} createT\n * @return {ReturnType}\n */\nexport const setIfUndefined = (map, key, createT) => {\n let set = map.get(key)\n if (set === undefined) {\n map.set(key, set = createT())\n }\n return set\n}\n\n/**\n * Creates an Array and populates it with the content of all key-value pairs using the `f(value, key)` function.\n *\n * @function\n * @template K\n * @template V\n * @template R\n * @param {Map} m\n * @param {function(V,K):R} f\n * @return {Array}\n */\nexport const map = (m, f) => {\n const res = []\n for (const [key, value] of m) {\n res.push(f(value, key))\n }\n return res\n}\n\n/**\n * Tests whether any key-value pairs pass the test implemented by `f(value, key)`.\n *\n * @todo should rename to some - similarly to Array.some\n *\n * @function\n * @template K\n * @template V\n * @param {Map} m\n * @param {function(V,K):boolean} f\n * @return {boolean}\n */\nexport const any = (m, f) => {\n for (const [key, value] of m) {\n if (f(value, key)) {\n return true\n }\n }\n return false\n}\n\n/**\n * Tests whether all key-value pairs pass the test implemented by `f(value, key)`.\n *\n * @function\n * @template K\n * @template V\n * @param {Map} m\n * @param {function(V,K):boolean} f\n * @return {boolean}\n */\nexport const all = (m, f) => {\n for (const [key, value] of m) {\n if (!f(value, key)) {\n return false\n }\n }\n return true\n}\n", "/**\n * Observable class prototype.\n *\n * @module observable\n */\n\nimport * as map from './map.js'\nimport * as set from './set.js'\nimport * as array from './array.js'\n\n/**\n * Handles named events.\n * @experimental\n *\n * This is basically a (better typed) duplicate of Observable, which will replace Observable in the\n * next release.\n *\n * @template {{[key in keyof EVENTS]: function(...any):void}} EVENTS\n */\nexport class ObservableV2 {\n constructor () {\n /**\n * Some desc.\n * @type {Map>}\n */\n this._observers = map.create()\n }\n\n /**\n * @template {keyof EVENTS & string} NAME\n * @param {NAME} name\n * @param {EVENTS[NAME]} f\n */\n on (name, f) {\n map.setIfUndefined(this._observers, /** @type {string} */ (name), set.create).add(f)\n return f\n }\n\n /**\n * @template {keyof EVENTS & string} NAME\n * @param {NAME} name\n * @param {EVENTS[NAME]} f\n */\n once (name, f) {\n /**\n * @param {...any} args\n */\n const _f = (...args) => {\n this.off(name, /** @type {any} */ (_f))\n f(...args)\n }\n this.on(name, /** @type {any} */ (_f))\n }\n\n /**\n * @template {keyof EVENTS & string} NAME\n * @param {NAME} name\n * @param {EVENTS[NAME]} f\n */\n off (name, f) {\n const observers = this._observers.get(name)\n if (observers !== undefined) {\n observers.delete(f)\n if (observers.size === 0) {\n this._observers.delete(name)\n }\n }\n }\n\n /**\n * Emit a named event. All registered event listeners that listen to the\n * specified name will receive the event.\n *\n * @todo This should catch exceptions\n *\n * @template {keyof EVENTS & string} NAME\n * @param {NAME} name The event name.\n * @param {Parameters} args The arguments that are applied to the event listener.\n */\n emit (name, args) {\n // copy all listeners to an array first to make sure that no event is emitted to listeners that are subscribed while the event handler is called.\n return array.from((this._observers.get(name) || map.create()).values()).forEach(f => f(...args))\n }\n\n destroy () {\n this._observers = map.create()\n }\n}\n\n/* c8 ignore start */\n/**\n * Handles named events.\n *\n * @deprecated\n * @template N\n */\nexport class Observable {\n constructor () {\n /**\n * Some desc.\n * @type {Map}\n */\n this._observers = map.create()\n }\n\n /**\n * @param {N} name\n * @param {function} f\n */\n on (name, f) {\n map.setIfUndefined(this._observers, name, set.create).add(f)\n }\n\n /**\n * @param {N} name\n * @param {function} f\n */\n once (name, f) {\n /**\n * @param {...any} args\n */\n const _f = (...args) => {\n this.off(name, _f)\n f(...args)\n }\n this.on(name, _f)\n }\n\n /**\n * @param {N} name\n * @param {function} f\n */\n off (name, f) {\n const observers = this._observers.get(name)\n if (observers !== undefined) {\n observers.delete(f)\n if (observers.size === 0) {\n this._observers.delete(name)\n }\n }\n }\n\n /**\n * Emit a named event. All registered event listeners that listen to the\n * specified name will receive the event.\n *\n * @todo This should catch exceptions\n *\n * @param {N} name The event name.\n * @param {Array} args The arguments that are applied to the event listener.\n */\n emit (name, args) {\n // copy all listeners to an array first to make sure that no event is emitted to listeners that are subscribed while the event handler is called.\n return array.from((this._observers.get(name) || map.create()).values()).forEach(f => f(...args))\n }\n\n destroy () {\n this._observers = map.create()\n }\n}\n/* c8 ignore end */\n", "/**\n * Utility functions for working with EcmaScript objects.\n *\n * @module object\n */\n\n/**\n * @return {Object} obj\n */\nexport const create = () => Object.create(null)\n\n/**\n * Object.assign\n */\nexport const assign = Object.assign\n\n/**\n * @param {Object} obj\n */\nexport const keys = Object.keys\n\n/**\n * @template V\n * @param {{[k:string]:V}} obj\n * @param {function(V,string):any} f\n */\nexport const forEach = (obj, f) => {\n for (const key in obj) {\n f(obj[key], key)\n }\n}\n\n/**\n * @todo implement mapToArray & map\n *\n * @template R\n * @param {Object} obj\n * @param {function(any,string):R} f\n * @return {Array}\n */\nexport const map = (obj, f) => {\n const results = []\n for (const key in obj) {\n results.push(f(obj[key], key))\n }\n return results\n}\n\n/**\n * @deprecated use object.size instead\n * @param {Object} obj\n * @return {number}\n */\nexport const length = obj => keys(obj).length\n\n/**\n * @param {Object} obj\n * @return {number}\n */\nexport const size = obj => keys(obj).length\n\n/**\n * @param {Object} obj\n * @param {function(any,string):boolean} f\n * @return {boolean}\n */\nexport const some = (obj, f) => {\n for (const key in obj) {\n if (f(obj[key], key)) {\n return true\n }\n }\n return false\n}\n\n/**\n * @param {Object|undefined} obj\n */\nexport const isEmpty = obj => {\n // eslint-disable-next-line\n for (const _k in obj) {\n return false\n }\n return true\n}\n\n/**\n * @param {Object} obj\n * @param {function(any,string):boolean} f\n * @return {boolean}\n */\nexport const every = (obj, f) => {\n for (const key in obj) {\n if (!f(obj[key], key)) {\n return false\n }\n }\n return true\n}\n\n/**\n * Calls `Object.prototype.hasOwnProperty`.\n *\n * @param {any} obj\n * @param {string|symbol} key\n * @return {boolean}\n */\nexport const hasProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key)\n\n/**\n * @param {Object} a\n * @param {Object} b\n * @return {boolean}\n */\nexport const equalFlat = (a, b) => a === b || (size(a) === size(b) && every(a, (val, key) => (val !== undefined || hasProperty(b, key)) && b[key] === val))\n\n/**\n * Make an object immutable. This hurts performance and is usually not needed if you perform good\n * coding practices.\n */\nexport const freeze = Object.freeze\n\n/**\n * Make an object and all its children immutable.\n * This *really* hurts performance and is usually not needed if you perform good coding practices.\n *\n * @template {any} T\n * @param {T} o\n * @return {Readonly}\n */\nexport const deepFreeze = (o) => {\n for (const key in o) {\n const c = o[key]\n if (typeof c === 'object' || typeof c === 'function') {\n deepFreeze(o[key])\n }\n }\n return freeze(o)\n}\n", "/**\n * Common functions and function call helpers.\n *\n * @module function\n */\n\nimport * as array from './array.js'\nimport * as object from './object.js'\n\n/**\n * Calls all functions in `fs` with args. Only throws after all functions were called.\n *\n * @param {Array} fs\n * @param {Array} args\n */\nexport const callAll = (fs, args, i = 0) => {\n try {\n for (; i < fs.length; i++) {\n fs[i](...args)\n }\n } finally {\n if (i < fs.length) {\n callAll(fs, args, i + 1)\n }\n }\n}\n\nexport const nop = () => {}\n\n/**\n * @template T\n * @param {function():T} f\n * @return {T}\n */\nexport const apply = f => f()\n\n/**\n * @template A\n *\n * @param {A} a\n * @return {A}\n */\nexport const id = a => a\n\n/**\n * @template T\n *\n * @param {T} a\n * @param {T} b\n * @return {boolean}\n */\nexport const equalityStrict = (a, b) => a === b\n\n/**\n * @template T\n *\n * @param {Array|object} a\n * @param {Array|object} b\n * @return {boolean}\n */\nexport const equalityFlat = (a, b) => a === b || (a != null && b != null && a.constructor === b.constructor && ((array.isArray(a) && array.equalFlat(a, /** @type {Array} */ (b))) || (typeof a === 'object' && object.equalFlat(a, b))))\n\n/* c8 ignore start */\n\n/**\n * @param {any} a\n * @param {any} b\n * @return {boolean}\n */\nexport const equalityDeep = (a, b) => {\n if (a == null || b == null) {\n return equalityStrict(a, b)\n }\n if (a.constructor !== b.constructor) {\n return false\n }\n if (a === b) {\n return true\n }\n switch (a.constructor) {\n case ArrayBuffer:\n a = new Uint8Array(a)\n b = new Uint8Array(b)\n // eslint-disable-next-line no-fallthrough\n case Uint8Array: {\n if (a.byteLength !== b.byteLength) {\n return false\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false\n }\n }\n break\n }\n case Set: {\n if (a.size !== b.size) {\n return false\n }\n for (const value of a) {\n if (!b.has(value)) {\n return false\n }\n }\n break\n }\n case Map: {\n if (a.size !== b.size) {\n return false\n }\n for (const key of a.keys()) {\n if (!b.has(key) || !equalityDeep(a.get(key), b.get(key))) {\n return false\n }\n }\n break\n }\n case Object:\n if (object.length(a) !== object.length(b)) {\n return false\n }\n for (const key in a) {\n if (!object.hasProperty(a, key) || !equalityDeep(a[key], b[key])) {\n return false\n }\n }\n break\n case Array:\n if (a.length !== b.length) {\n return false\n }\n for (let i = 0; i < a.length; i++) {\n if (!equalityDeep(a[i], b[i])) {\n return false\n }\n }\n break\n default:\n return false\n }\n return true\n}\n\n/**\n * @template V\n * @template {V} OPTS\n *\n * @param {V} value\n * @param {Array} options\n */\n// @ts-ignore\nexport const isOneOf = (value, options) => options.includes(value)\n/* c8 ignore stop */\n\nexport const isArray = array.isArray\n\n/**\n * @param {any} s\n * @return {s is String}\n */\nexport const isString = (s) => s && s.constructor === String\n\n/**\n * @param {any} n\n * @return {n is Number}\n */\nexport const isNumber = n => n != null && n.constructor === Number\n\n/**\n * @template {abstract new (...args: any) => any} TYPE\n * @param {any} n\n * @param {TYPE} T\n * @return {n is InstanceType}\n */\nexport const is = (n, T) => n && n.constructor === T\n\n/**\n * @template {abstract new (...args: any) => any} TYPE\n * @param {TYPE} T\n */\nexport const isTemplate = (T) =>\n /**\n * @param {any} n\n * @return {n is InstanceType}\n **/\n n => n && n.constructor === T\n", "/* eslint-env browser */\n\nexport const subtle = crypto.subtle\nexport const getRandomValues = crypto.getRandomValues.bind(crypto)\n", "/**\n * Isomorphic module for true random numbers / buffers / uuids.\n *\n * Attention: falls back to Math.random if the browser does not support crypto.\n *\n * @module random\n */\n\nimport * as math from './math.js'\nimport * as binary from './binary.js'\nimport { getRandomValues } from 'lib0/webcrypto'\n\nexport const rand = Math.random\n\nexport const uint32 = () => getRandomValues(new Uint32Array(1))[0]\n\nexport const uint53 = () => {\n const arr = getRandomValues(new Uint32Array(8))\n return (arr[0] & binary.BITS21) * (binary.BITS32 + 1) + (arr[1] >>> 0)\n}\n\n/**\n * @template T\n * @param {Array} arr\n * @return {T}\n */\nexport const oneOf = arr => arr[math.floor(rand() * arr.length)]\n\n// @ts-ignore\nconst uuidv4Template = [1e7] + -1e3 + -4e3 + -8e3 + -1e11\n\n/**\n * @return {string}\n */\nexport const uuidv4 = () => uuidv4Template.replace(/[018]/g, /** @param {number} c */ c =>\n (c ^ uint32() & 15 >> c / 4).toString(16)\n)\n", "/**\n * Utility helpers to work with promises.\n *\n * @module promise\n */\n\nimport * as time from './time.js'\n\n/**\n * @template T\n * @callback PromiseResolve\n * @param {T|PromiseLike} [result]\n */\n\n/**\n * @template T\n * @param {function(PromiseResolve,function(Error):void):any} f\n * @return {Promise}\n */\nexport const create = f => /** @type {Promise} */ (new Promise(f))\n\n/**\n * @param {function(function():void,function(Error):void):void} f\n * @return {Promise}\n */\nexport const createEmpty = f => new Promise(f)\n\n/**\n * `Promise.all` wait for all promises in the array to resolve and return the result\n * @template {unknown[] | []} PS\n *\n * @param {PS} ps\n * @return {Promise<{ -readonly [P in keyof PS]: Awaited }>}\n */\nexport const all = Promise.all.bind(Promise)\n\n/**\n * @param {Error} [reason]\n * @return {Promise}\n */\nexport const reject = reason => Promise.reject(reason)\n\n/**\n * @template T\n * @param {T|void} res\n * @return {Promise}\n */\nexport const resolve = res => Promise.resolve(res)\n\n/**\n * @template T\n * @param {T} res\n * @return {Promise}\n */\nexport const resolveWith = res => Promise.resolve(res)\n\n/**\n * @todo Next version, reorder parameters: check, [timeout, [intervalResolution]]\n * @deprecated use untilAsync instead\n *\n * @param {number} timeout\n * @param {function():boolean} check\n * @param {number} [intervalResolution]\n * @return {Promise}\n */\nexport const until = (timeout, check, intervalResolution = 10) => create((resolve, reject) => {\n const startTime = time.getUnixTime()\n const hasTimeout = timeout > 0\n const untilInterval = () => {\n if (check()) {\n clearInterval(intervalHandle)\n resolve()\n } else if (hasTimeout) {\n /* c8 ignore else */\n if (time.getUnixTime() - startTime > timeout) {\n clearInterval(intervalHandle)\n reject(new Error('Timeout'))\n }\n }\n }\n const intervalHandle = setInterval(untilInterval, intervalResolution)\n})\n\n/**\n * @param {()=>Promise|boolean} check\n * @param {number} timeout\n * @param {number} intervalResolution\n * @return {Promise}\n */\nexport const untilAsync = async (check, timeout = 0, intervalResolution = 10) => {\n const startTime = time.getUnixTime()\n const noTimeout = timeout <= 0\n // eslint-disable-next-line no-unmodified-loop-condition\n while (noTimeout || time.getUnixTime() - startTime <= timeout) {\n if (await check()) return\n await wait(intervalResolution)\n }\n throw new Error('Timeout')\n}\n\n/**\n * @param {number} timeout\n * @return {Promise}\n */\nexport const wait = timeout => create((resolve, _reject) => setTimeout(resolve, timeout))\n\n/**\n * Checks if an object is a promise using ducktyping.\n *\n * Promises are often polyfilled, so it makes sense to add some additional guarantees if the user of this\n * library has some insane environment where global Promise objects are overwritten.\n *\n * @param {any} p\n * @return {boolean}\n */\nexport const isPromise = p => p instanceof Promise || (p && p.then && p.catch && p.finally)\n", "/**\n * Often used conditions.\n *\n * @module conditions\n */\n\n/**\n * @template T\n * @param {T|null|undefined} v\n * @return {T|null}\n */\n/* c8 ignore next */\nexport const undefinedToNull = v => v === undefined ? null : v\n", "/* eslint-env browser */\n\n/**\n * Isomorphic variable storage.\n *\n * Uses LocalStorage in the browser and falls back to in-memory storage.\n *\n * @module storage\n */\n\n/* c8 ignore start */\nclass VarStoragePolyfill {\n constructor () {\n this.map = new Map()\n }\n\n /**\n * @param {string} key\n * @param {any} newValue\n */\n setItem (key, newValue) {\n this.map.set(key, newValue)\n }\n\n /**\n * @param {string} key\n */\n getItem (key) {\n return this.map.get(key)\n }\n}\n/* c8 ignore stop */\n\n/**\n * @type {any}\n */\nlet _localStorage = new VarStoragePolyfill()\nlet usePolyfill = true\n\n/* c8 ignore start */\ntry {\n // if the same-origin rule is violated, accessing localStorage might thrown an error\n if (typeof localStorage !== 'undefined' && localStorage) {\n _localStorage = localStorage\n usePolyfill = false\n }\n} catch (e) { }\n/* c8 ignore stop */\n\n/**\n * This is basically localStorage in browser, or a polyfill in nodejs\n */\n/* c8 ignore next */\nexport const varStorage = _localStorage\n\n/**\n * A polyfill for `addEventListener('storage', event => {..})` that does nothing if the polyfill is being used.\n *\n * @param {function({ key: string, newValue: string, oldValue: string }): void} eventHandler\n * @function\n */\n/* c8 ignore next */\nexport const onChange = eventHandler => usePolyfill || addEventListener('storage', /** @type {any} */ (eventHandler))\n\n/**\n * A polyfill for `removeEventListener('storage', event => {..})` that does nothing if the polyfill is being used.\n *\n * @param {function({ key: string, newValue: string, oldValue: string }): void} eventHandler\n * @function\n */\n/* c8 ignore next */\nexport const offChange = eventHandler => usePolyfill || removeEventListener('storage', /** @type {any} */ (eventHandler))\n", "/**\n * Isomorphic module to work access the environment (query params, env variables).\n *\n * @module environment\n */\n\nimport * as map from './map.js'\nimport * as string from './string.js'\nimport * as conditions from './conditions.js'\nimport * as storage from './storage.js'\nimport * as f from './function.js'\n\n/* c8 ignore next 2 */\n// @ts-ignore\nexport const isNode = typeof process !== 'undefined' && process.release && /node|io\\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'\n\n/* c8 ignore next */\nexport const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && !isNode\n/* c8 ignore next 3 */\nexport const isMac = typeof navigator !== 'undefined'\n ? /Mac/.test(navigator.platform)\n : false\n\n/**\n * @type {Map}\n */\nlet params\nconst args = []\n\n/* c8 ignore start */\nconst computeParams = () => {\n if (params === undefined) {\n if (isNode) {\n params = map.create()\n const pargs = process.argv\n let currParamName = null\n for (let i = 0; i < pargs.length; i++) {\n const parg = pargs[i]\n if (parg[0] === '-') {\n if (currParamName !== null) {\n params.set(currParamName, '')\n }\n currParamName = parg\n } else {\n if (currParamName !== null) {\n params.set(currParamName, parg)\n currParamName = null\n } else {\n args.push(parg)\n }\n }\n }\n if (currParamName !== null) {\n params.set(currParamName, '')\n }\n // in ReactNative for example this would not be true (unless connected to the Remote Debugger)\n } else if (typeof location === 'object') {\n params = map.create(); // eslint-disable-next-line no-undef\n (location.search || '?').slice(1).split('&').forEach((kv) => {\n if (kv.length !== 0) {\n const [key, value] = kv.split('=')\n params.set(`--${string.fromCamelCase(key, '-')}`, value)\n params.set(`-${string.fromCamelCase(key, '-')}`, value)\n }\n })\n } else {\n params = map.create()\n }\n }\n return params\n}\n/* c8 ignore stop */\n\n/**\n * @param {string} name\n * @return {boolean}\n */\n/* c8 ignore next */\nexport const hasParam = (name) => computeParams().has(name)\n\n/**\n * @param {string} name\n * @param {string} defaultVal\n * @return {string}\n */\n/* c8 ignore next 2 */\nexport const getParam = (name, defaultVal) =>\n computeParams().get(name) || defaultVal\n\n/**\n * @param {string} name\n * @return {string|null}\n */\n/* c8 ignore next 4 */\nexport const getVariable = (name) =>\n isNode\n ? conditions.undefinedToNull(process.env[name.toUpperCase().replaceAll('-', '_')])\n : conditions.undefinedToNull(storage.varStorage.getItem(name))\n\n/**\n * @param {string} name\n * @return {string|null}\n */\n/* c8 ignore next 2 */\nexport const getConf = (name) =>\n computeParams().get('--' + name) || getVariable(name)\n\n/**\n * @param {string} name\n * @return {string}\n */\n/* c8 ignore next 5 */\nexport const ensureConf = (name) => {\n const c = getConf(name)\n if (c == null) throw new Error(`Expected configuration \"${name.toUpperCase().replaceAll('-', '_')}\"`)\n return c\n}\n\n/**\n * @param {string} name\n * @return {boolean}\n */\n/* c8 ignore next 2 */\nexport const hasConf = (name) =>\n hasParam('--' + name) || getVariable(name) !== null\n\n/* c8 ignore next */\nexport const production = hasConf('production')\n\n/* c8 ignore next 2 */\nconst forceColor = isNode &&\n f.isOneOf(process.env.FORCE_COLOR, ['true', '1', '2'])\n\n/* c8 ignore start */\n/**\n * Color is enabled by default if the terminal supports it.\n *\n * Explicitly enable color using `--color` parameter\n * Disable color using `--no-color` parameter or using `NO_COLOR=1` environment variable.\n * `FORCE_COLOR=1` enables color and takes precedence over all.\n */\nexport const supportsColor = forceColor || (\n !hasParam('--no-colors') && // @todo deprecate --no-colors\n !hasConf('no-color') &&\n (!isNode || process.stdout.isTTY) && (\n !isNode ||\n hasParam('--color') ||\n getVariable('COLORTERM') !== null ||\n (getVariable('TERM') || '').includes('color')\n )\n)\n/* c8 ignore stop */\n", "/**\n * Utility functions to work with buffers (Uint8Array).\n *\n * @module buffer\n */\n\nimport * as string from './string.js'\nimport * as env from './environment.js'\nimport * as array from './array.js'\nimport * as math from './math.js'\nimport * as encoding from './encoding.js'\nimport * as decoding from './decoding.js'\n\n/**\n * @param {number} len\n */\nexport const createUint8ArrayFromLen = len => new Uint8Array(len)\n\n/**\n * Create Uint8Array with initial content from buffer\n *\n * @param {ArrayBuffer} buffer\n * @param {number} byteOffset\n * @param {number} length\n */\nexport const createUint8ArrayViewFromArrayBuffer = (buffer, byteOffset, length) => new Uint8Array(buffer, byteOffset, length)\n\n/**\n * Create Uint8Array with initial content from buffer\n *\n * @param {ArrayBuffer} buffer\n */\nexport const createUint8ArrayFromArrayBuffer = buffer => new Uint8Array(buffer)\n\n/* c8 ignore start */\n/**\n * @param {Uint8Array} bytes\n * @return {string}\n */\nconst toBase64Browser = bytes => {\n let s = ''\n for (let i = 0; i < bytes.byteLength; i++) {\n s += string.fromCharCode(bytes[i])\n }\n // eslint-disable-next-line no-undef\n return btoa(s)\n}\n/* c8 ignore stop */\n\n/**\n * @param {Uint8Array} bytes\n * @return {string}\n */\nconst toBase64Node = bytes => Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength).toString('base64')\n\n/* c8 ignore start */\n/**\n * @param {string} s\n * @return {Uint8Array}\n */\nconst fromBase64Browser = s => {\n // eslint-disable-next-line no-undef\n const a = atob(s)\n const bytes = createUint8ArrayFromLen(a.length)\n for (let i = 0; i < a.length; i++) {\n bytes[i] = a.charCodeAt(i)\n }\n return bytes\n}\n/* c8 ignore stop */\n\n/**\n * @param {string} s\n */\nconst fromBase64Node = s => {\n const buf = Buffer.from(s, 'base64')\n return createUint8ArrayViewFromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength)\n}\n\n/* c8 ignore next */\nexport const toBase64 = env.isBrowser ? toBase64Browser : toBase64Node\n\n/* c8 ignore next */\nexport const fromBase64 = env.isBrowser ? fromBase64Browser : fromBase64Node\n\n/**\n * Implements base64url - see https://datatracker.ietf.org/doc/html/rfc4648#section-5\n * @param {Uint8Array} buf\n */\nexport const toBase64UrlEncoded = buf => toBase64(buf).replaceAll('+', '-').replaceAll('/', '_').replaceAll('=', '')\n\n/**\n * @param {string} base64\n */\nexport const fromBase64UrlEncoded = base64 => fromBase64(base64.replaceAll('-', '+').replaceAll('_', '/'))\n\n/**\n * Base64 is always a more efficient choice. This exists for utility purposes only.\n *\n * @param {Uint8Array} buf\n */\nexport const toHexString = buf => array.map(buf, b => b.toString(16).padStart(2, '0')).join('')\n\n/**\n * Note: This function expects that the hex doesn't start with 0x..\n *\n * @param {string} hex\n */\nexport const fromHexString = hex => {\n const hlen = hex.length\n const buf = new Uint8Array(math.ceil(hlen / 2))\n for (let i = 0; i < hlen; i += 2) {\n buf[buf.length - i / 2 - 1] = Number.parseInt(hex.slice(hlen - i - 2, hlen - i), 16)\n }\n return buf\n}\n\n/**\n * Copy the content of an Uint8Array view to a new ArrayBuffer.\n *\n * @param {Uint8Array} uint8Array\n * @return {Uint8Array}\n */\nexport const copyUint8Array = uint8Array => {\n const newBuf = createUint8ArrayFromLen(uint8Array.byteLength)\n newBuf.set(uint8Array)\n return newBuf\n}\n\n/**\n * Encode anything as a UInt8Array. It's a pun on typescripts's `any` type.\n * See encoding.writeAny for more information.\n *\n * @param {any} data\n * @return {Uint8Array}\n */\nexport const encodeAny = data =>\n encoding.encode(encoder => encoding.writeAny(encoder, data))\n\n/**\n * Decode an any-encoded value.\n *\n * @param {Uint8Array} buf\n * @return {any}\n */\nexport const decodeAny = buf => decoding.readAny(decoding.createDecoder(buf))\n\n/**\n * Shift Byte Array {N} bits to the left. Does not expand byte array.\n *\n * @param {Uint8Array} bs\n * @param {number} N should be in the range of [0-7]\n */\nexport const shiftNBitsLeft = (bs, N) => {\n if (N === 0) return bs\n bs = new Uint8Array(bs)\n bs[0] <<= N\n for (let i = 1; i < bs.length; i++) {\n bs[i - 1] |= bs[i] >>> (8 - N)\n bs[i] <<= N\n }\n return bs\n}\n", "/**\n * Working with value pairs.\n *\n * @module pair\n */\n\n/**\n * @template L,R\n */\nexport class Pair {\n /**\n * @param {L} left\n * @param {R} right\n */\n constructor (left, right) {\n this.left = left\n this.right = right\n }\n}\n\n/**\n * @template L,R\n * @param {L} left\n * @param {R} right\n * @return {Pair}\n */\nexport const create = (left, right) => new Pair(left, right)\n\n/**\n * @template L,R\n * @param {R} right\n * @param {L} left\n * @return {Pair}\n */\nexport const createReversed = (right, left) => new Pair(left, right)\n\n/**\n * @template L,R\n * @param {Array>} arr\n * @param {function(L, R):any} f\n */\nexport const forEach = (arr, f) => arr.forEach(p => f(p.left, p.right))\n\n/**\n * @template L,R,X\n * @param {Array>} arr\n * @param {function(L, R):X} f\n * @return {Array}\n */\nexport const map = (arr, f) => arr.map(p => f(p.left, p.right))\n", "/* eslint-env browser */\n\n/**\n * Utility module to work with the DOM.\n *\n * @module dom\n */\n\nimport * as pair from './pair.js'\nimport * as map from './map.js'\n\n/* c8 ignore start */\n/**\n * @type {Document}\n */\nexport const doc = /** @type {Document} */ (typeof document !== 'undefined' ? document : {})\n\n/**\n * @param {string} name\n * @return {HTMLElement}\n */\nexport const createElement = name => doc.createElement(name)\n\n/**\n * @return {DocumentFragment}\n */\nexport const createDocumentFragment = () => doc.createDocumentFragment()\n\n/**\n * @param {string} text\n * @return {Text}\n */\nexport const createTextNode = text => doc.createTextNode(text)\n\nexport const domParser = /** @type {DOMParser} */ (typeof DOMParser !== 'undefined' ? new DOMParser() : null)\n\n/**\n * @param {HTMLElement} el\n * @param {string} name\n * @param {Object} opts\n */\nexport const emitCustomEvent = (el, name, opts) => el.dispatchEvent(new CustomEvent(name, opts))\n\n/**\n * @param {Element} el\n * @param {Array>} attrs Array of key-value pairs\n * @return {Element}\n */\nexport const setAttributes = (el, attrs) => {\n pair.forEach(attrs, (key, value) => {\n if (value === false) {\n el.removeAttribute(key)\n } else if (value === true) {\n el.setAttribute(key, '')\n } else {\n // @ts-ignore\n el.setAttribute(key, value)\n }\n })\n return el\n}\n\n/**\n * @param {Element} el\n * @param {Map} attrs Array of key-value pairs\n * @return {Element}\n */\nexport const setAttributesMap = (el, attrs) => {\n attrs.forEach((value, key) => { el.setAttribute(key, value) })\n return el\n}\n\n/**\n * @param {Array|HTMLCollection} children\n * @return {DocumentFragment}\n */\nexport const fragment = children => {\n const fragment = createDocumentFragment()\n for (let i = 0; i < children.length; i++) {\n appendChild(fragment, children[i])\n }\n return fragment\n}\n\n/**\n * @param {Element} parent\n * @param {Array} nodes\n * @return {Element}\n */\nexport const append = (parent, nodes) => {\n appendChild(parent, fragment(nodes))\n return parent\n}\n\n/**\n * @param {HTMLElement} el\n */\nexport const remove = el => el.remove()\n\n/**\n * @param {EventTarget} el\n * @param {string} name\n * @param {EventListener} f\n */\nexport const addEventListener = (el, name, f) => el.addEventListener(name, f)\n\n/**\n * @param {EventTarget} el\n * @param {string} name\n * @param {EventListener} f\n */\nexport const removeEventListener = (el, name, f) => el.removeEventListener(name, f)\n\n/**\n * @param {Node} node\n * @param {Array>} listeners\n * @return {Node}\n */\nexport const addEventListeners = (node, listeners) => {\n pair.forEach(listeners, (name, f) => addEventListener(node, name, f))\n return node\n}\n\n/**\n * @param {Node} node\n * @param {Array>} listeners\n * @return {Node}\n */\nexport const removeEventListeners = (node, listeners) => {\n pair.forEach(listeners, (name, f) => removeEventListener(node, name, f))\n return node\n}\n\n/**\n * @param {string} name\n * @param {Array|pair.Pair>} attrs Array of key-value pairs\n * @param {Array} children\n * @return {Element}\n */\nexport const element = (name, attrs = [], children = []) =>\n append(setAttributes(createElement(name), attrs), children)\n\n/**\n * @param {number} width\n * @param {number} height\n */\nexport const canvas = (width, height) => {\n const c = /** @type {HTMLCanvasElement} */ (createElement('canvas'))\n c.height = height\n c.width = width\n return c\n}\n\n/**\n * @param {string} t\n * @return {Text}\n */\nexport const text = createTextNode\n\n/**\n * @param {pair.Pair} pair\n */\nexport const pairToStyleString = pair => `${pair.left}:${pair.right};`\n\n/**\n * @param {Array>} pairs\n * @return {string}\n */\nexport const pairsToStyleString = pairs => pairs.map(pairToStyleString).join('')\n\n/**\n * @param {Map} m\n * @return {string}\n */\nexport const mapToStyleString = m => map.map(m, (value, key) => `${key}:${value};`).join('')\n\n/**\n * @todo should always query on a dom element\n *\n * @param {HTMLElement|ShadowRoot} el\n * @param {string} query\n * @return {HTMLElement | null}\n */\nexport const querySelector = (el, query) => el.querySelector(query)\n\n/**\n * @param {HTMLElement|ShadowRoot} el\n * @param {string} query\n * @return {NodeListOf}\n */\nexport const querySelectorAll = (el, query) => el.querySelectorAll(query)\n\n/**\n * @param {string} id\n * @return {HTMLElement}\n */\nexport const getElementById = id => /** @type {HTMLElement} */ (doc.getElementById(id))\n\n/**\n * @param {string} html\n * @return {HTMLElement}\n */\nconst _parse = html => domParser.parseFromString(`${html}`, 'text/html').body\n\n/**\n * @param {string} html\n * @return {DocumentFragment}\n */\nexport const parseFragment = html => fragment(/** @type {any} */ (_parse(html).childNodes))\n\n/**\n * @param {string} html\n * @return {HTMLElement}\n */\nexport const parseElement = html => /** @type HTMLElement */ (_parse(html).firstElementChild)\n\n/**\n * @param {HTMLElement} oldEl\n * @param {HTMLElement|DocumentFragment} newEl\n */\nexport const replaceWith = (oldEl, newEl) => oldEl.replaceWith(newEl)\n\n/**\n * @param {HTMLElement} parent\n * @param {HTMLElement} el\n * @param {Node|null} ref\n * @return {HTMLElement}\n */\nexport const insertBefore = (parent, el, ref) => parent.insertBefore(el, ref)\n\n/**\n * @param {Node} parent\n * @param {Node} child\n * @return {Node}\n */\nexport const appendChild = (parent, child) => parent.appendChild(child)\n\nexport const ELEMENT_NODE = doc.ELEMENT_NODE\nexport const TEXT_NODE = doc.TEXT_NODE\nexport const CDATA_SECTION_NODE = doc.CDATA_SECTION_NODE\nexport const COMMENT_NODE = doc.COMMENT_NODE\nexport const DOCUMENT_NODE = doc.DOCUMENT_NODE\nexport const DOCUMENT_TYPE_NODE = doc.DOCUMENT_TYPE_NODE\nexport const DOCUMENT_FRAGMENT_NODE = doc.DOCUMENT_FRAGMENT_NODE\n\n/**\n * @param {any} node\n * @param {number} type\n */\nexport const checkNodeType = (node, type) => node.nodeType === type\n\n/**\n * @param {Node} parent\n * @param {HTMLElement} child\n */\nexport const isParentOf = (parent, child) => {\n let p = child.parentNode\n while (p && p !== parent) {\n p = p.parentNode\n }\n return p === parent\n}\n/* c8 ignore stop */\n", "/**\n * JSON utility functions.\n *\n * @module json\n */\n\n/**\n * Transform JavaScript object to JSON.\n *\n * @param {any} object\n * @return {string}\n */\nexport const stringify = JSON.stringify\n\n/**\n * Parse JSON object.\n *\n * @param {string} json\n * @return {any}\n */\nexport const parse = JSON.parse\n", "/**\n * Utility module to work with EcmaScript Symbols.\n *\n * @module symbol\n */\n\n/**\n * Return fresh symbol.\n *\n * @return {Symbol}\n */\nexport const create = Symbol\n\n/**\n * @param {any} s\n * @return {boolean}\n */\nexport const isSymbol = s => typeof s === 'symbol'\n", "import * as symbol from './symbol.js'\nimport * as time from './time.js'\nimport * as env from './environment.js'\nimport * as func from './function.js'\nimport * as json from './json.js'\n\nexport const BOLD = symbol.create()\nexport const UNBOLD = symbol.create()\nexport const BLUE = symbol.create()\nexport const GREY = symbol.create()\nexport const GREEN = symbol.create()\nexport const RED = symbol.create()\nexport const PURPLE = symbol.create()\nexport const ORANGE = symbol.create()\nexport const UNCOLOR = symbol.create()\n\n/* c8 ignore start */\n/**\n * @param {Array} args\n * @return {Array}\n */\nexport const computeNoColorLoggingArgs = args => {\n if (args.length === 1 && args[0]?.constructor === Function) {\n args = /** @type {Array} */ (/** @type {[function]} */ (args)[0]())\n }\n const strBuilder = []\n const logArgs = []\n // try with formatting until we find something unsupported\n let i = 0\n for (; i < args.length; i++) {\n const arg = args[i]\n if (arg === undefined) {\n break\n } else if (arg.constructor === String || arg.constructor === Number) {\n strBuilder.push(arg)\n } else if (arg.constructor === Object) {\n break\n }\n }\n if (i > 0) {\n // create logArgs with what we have so far\n logArgs.push(strBuilder.join(''))\n }\n // append the rest\n for (; i < args.length; i++) {\n const arg = args[i]\n if (!(arg instanceof Symbol)) {\n logArgs.push(arg)\n }\n }\n return logArgs\n}\n/* c8 ignore stop */\n\nconst loggingColors = [GREEN, PURPLE, ORANGE, BLUE]\nlet nextColor = 0\nlet lastLoggingTime = time.getUnixTime()\n\n/* c8 ignore start */\n/**\n * @param {function(...any):void} _print\n * @param {string} moduleName\n * @return {function(...any):void}\n */\nexport const createModuleLogger = (_print, moduleName) => {\n const color = loggingColors[nextColor]\n const debugRegexVar = env.getVariable('log')\n const doLogging = debugRegexVar !== null &&\n (debugRegexVar === '*' || debugRegexVar === 'true' ||\n new RegExp(debugRegexVar, 'gi').test(moduleName))\n nextColor = (nextColor + 1) % loggingColors.length\n moduleName += ': '\n return !doLogging\n ? func.nop\n : (...args) => {\n if (args.length === 1 && args[0]?.constructor === Function) {\n args = args[0]()\n }\n const timeNow = time.getUnixTime()\n const timeDiff = timeNow - lastLoggingTime\n lastLoggingTime = timeNow\n _print(\n color,\n moduleName,\n UNCOLOR,\n ...args.map((arg) => {\n if (arg != null && arg.constructor === Uint8Array) {\n arg = Array.from(arg)\n }\n const t = typeof arg\n switch (t) {\n case 'string':\n case 'symbol':\n return arg\n default: {\n return json.stringify(arg)\n }\n }\n }),\n color,\n ' +' + timeDiff + 'ms'\n )\n }\n}\n/* c8 ignore stop */\n", "/**\n * Isomorphic logging module with support for colors!\n *\n * @module logging\n */\n\nimport * as env from './environment.js'\nimport * as set from './set.js'\nimport * as pair from './pair.js'\nimport * as dom from './dom.js'\nimport * as json from './json.js'\nimport * as map from './map.js'\nimport * as eventloop from './eventloop.js'\nimport * as math from './math.js'\nimport * as common from './logging.common.js'\n\nexport { BOLD, UNBOLD, BLUE, GREY, GREEN, RED, PURPLE, ORANGE, UNCOLOR } from './logging.common.js'\n\n/**\n * @type {Object>}\n */\nconst _browserStyleMap = {\n [common.BOLD]: pair.create('font-weight', 'bold'),\n [common.UNBOLD]: pair.create('font-weight', 'normal'),\n [common.BLUE]: pair.create('color', 'blue'),\n [common.GREEN]: pair.create('color', 'green'),\n [common.GREY]: pair.create('color', 'grey'),\n [common.RED]: pair.create('color', 'red'),\n [common.PURPLE]: pair.create('color', 'purple'),\n [common.ORANGE]: pair.create('color', 'orange'), // not well supported in chrome when debugging node with inspector - TODO: deprecate\n [common.UNCOLOR]: pair.create('color', 'black')\n}\n\n/**\n * @param {Array} args\n * @return {Array}\n */\n/* c8 ignore start */\nconst computeBrowserLoggingArgs = (args) => {\n if (args.length === 1 && args[0]?.constructor === Function) {\n args = /** @type {Array} */ (/** @type {[function]} */ (args)[0]())\n }\n const strBuilder = []\n const styles = []\n const currentStyle = map.create()\n /**\n * @type {Array}\n */\n let logArgs = []\n // try with formatting until we find something unsupported\n let i = 0\n for (; i < args.length; i++) {\n const arg = args[i]\n // @ts-ignore\n const style = _browserStyleMap[arg]\n if (style !== undefined) {\n currentStyle.set(style.left, style.right)\n } else {\n if (arg === undefined) {\n break\n }\n if (arg.constructor === String || arg.constructor === Number) {\n const style = dom.mapToStyleString(currentStyle)\n if (i > 0 || style.length > 0) {\n strBuilder.push('%c' + arg)\n styles.push(style)\n } else {\n strBuilder.push(arg)\n }\n } else {\n break\n }\n }\n }\n if (i > 0) {\n // create logArgs with what we have so far\n logArgs = styles\n logArgs.unshift(strBuilder.join(''))\n }\n // append the rest\n for (; i < args.length; i++) {\n const arg = args[i]\n if (!(arg instanceof Symbol)) {\n logArgs.push(arg)\n }\n }\n return logArgs\n}\n/* c8 ignore stop */\n\n/* c8 ignore start */\nconst computeLoggingArgs = env.supportsColor\n ? computeBrowserLoggingArgs\n : common.computeNoColorLoggingArgs\n/* c8 ignore stop */\n\n/**\n * @param {Array} args\n */\nexport const print = (...args) => {\n console.log(...computeLoggingArgs(args))\n /* c8 ignore next */\n vconsoles.forEach((vc) => vc.print(args))\n}\n\n/* c8 ignore start */\n/**\n * @param {Array} args\n */\nexport const warn = (...args) => {\n console.warn(...computeLoggingArgs(args))\n args.unshift(common.ORANGE)\n vconsoles.forEach((vc) => vc.print(args))\n}\n/* c8 ignore stop */\n\n/**\n * @param {Error} err\n */\n/* c8 ignore start */\nexport const printError = (err) => {\n console.error(err)\n vconsoles.forEach((vc) => vc.printError(err))\n}\n/* c8 ignore stop */\n\n/**\n * @param {string} url image location\n * @param {number} height height of the image in pixel\n */\n/* c8 ignore start */\nexport const printImg = (url, height) => {\n if (env.isBrowser) {\n console.log(\n '%c ',\n `font-size: ${height}px; background-size: contain; background-repeat: no-repeat; background-image: url(${url})`\n )\n // console.log('%c ', `font-size: ${height}x; background: url(${url}) no-repeat;`)\n }\n vconsoles.forEach((vc) => vc.printImg(url, height))\n}\n/* c8 ignore stop */\n\n/**\n * @param {string} base64\n * @param {number} height\n */\n/* c8 ignore next 2 */\nexport const printImgBase64 = (base64, height) =>\n printImg(`data:image/gif;base64,${base64}`, height)\n\n/**\n * @param {Array} args\n */\nexport const group = (...args) => {\n console.group(...computeLoggingArgs(args))\n /* c8 ignore next */\n vconsoles.forEach((vc) => vc.group(args))\n}\n\n/**\n * @param {Array} args\n */\nexport const groupCollapsed = (...args) => {\n console.groupCollapsed(...computeLoggingArgs(args))\n /* c8 ignore next */\n vconsoles.forEach((vc) => vc.groupCollapsed(args))\n}\n\nexport const groupEnd = () => {\n console.groupEnd()\n /* c8 ignore next */\n vconsoles.forEach((vc) => vc.groupEnd())\n}\n\n/**\n * @param {function():Node} createNode\n */\n/* c8 ignore next 2 */\nexport const printDom = (createNode) =>\n vconsoles.forEach((vc) => vc.printDom(createNode()))\n\n/**\n * @param {HTMLCanvasElement} canvas\n * @param {number} height\n */\n/* c8 ignore next 2 */\nexport const printCanvas = (canvas, height) =>\n printImg(canvas.toDataURL(), height)\n\nexport const vconsoles = set.create()\n\n/**\n * @param {Array} args\n * @return {Array}\n */\n/* c8 ignore start */\nconst _computeLineSpans = (args) => {\n const spans = []\n const currentStyle = new Map()\n // try with formatting until we find something unsupported\n let i = 0\n for (; i < args.length; i++) {\n let arg = args[i]\n // @ts-ignore\n const style = _browserStyleMap[arg]\n if (style !== undefined) {\n currentStyle.set(style.left, style.right)\n } else {\n if (arg === undefined) {\n arg = 'undefined '\n }\n if (arg.constructor === String || arg.constructor === Number) {\n // @ts-ignore\n const span = dom.element('span', [\n pair.create('style', dom.mapToStyleString(currentStyle))\n ], [dom.text(arg.toString())])\n if (span.innerHTML === '') {\n span.innerHTML = ' '\n }\n spans.push(span)\n } else {\n break\n }\n }\n }\n // append the rest\n for (; i < args.length; i++) {\n let content = args[i]\n if (!(content instanceof Symbol)) {\n if (content.constructor !== String && content.constructor !== Number) {\n content = ' ' + json.stringify(content) + ' '\n }\n spans.push(\n dom.element('span', [], [dom.text(/** @type {string} */ (content))])\n )\n }\n }\n return spans\n}\n/* c8 ignore stop */\n\nconst lineStyle =\n 'font-family:monospace;border-bottom:1px solid #e2e2e2;padding:2px;'\n\n/* c8 ignore start */\nexport class VConsole {\n /**\n * @param {Element} dom\n */\n constructor (dom) {\n this.dom = dom\n /**\n * @type {Element}\n */\n this.ccontainer = this.dom\n this.depth = 0\n vconsoles.add(this)\n }\n\n /**\n * @param {Array} args\n * @param {boolean} collapsed\n */\n group (args, collapsed = false) {\n eventloop.enqueue(() => {\n const triangleDown = dom.element('span', [\n pair.create('hidden', collapsed),\n pair.create('style', 'color:grey;font-size:120%;')\n ], [dom.text('\u25BC')])\n const triangleRight = dom.element('span', [\n pair.create('hidden', !collapsed),\n pair.create('style', 'color:grey;font-size:125%;')\n ], [dom.text('\u25B6')])\n const content = dom.element(\n 'div',\n [pair.create(\n 'style',\n `${lineStyle};padding-left:${this.depth * 10}px`\n )],\n [triangleDown, triangleRight, dom.text(' ')].concat(\n _computeLineSpans(args)\n )\n )\n const nextContainer = dom.element('div', [\n pair.create('hidden', collapsed)\n ])\n const nextLine = dom.element('div', [], [content, nextContainer])\n dom.append(this.ccontainer, [nextLine])\n this.ccontainer = nextContainer\n this.depth++\n // when header is clicked, collapse/uncollapse container\n dom.addEventListener(content, 'click', (_event) => {\n nextContainer.toggleAttribute('hidden')\n triangleDown.toggleAttribute('hidden')\n triangleRight.toggleAttribute('hidden')\n })\n })\n }\n\n /**\n * @param {Array} args\n */\n groupCollapsed (args) {\n this.group(args, true)\n }\n\n groupEnd () {\n eventloop.enqueue(() => {\n if (this.depth > 0) {\n this.depth--\n // @ts-ignore\n this.ccontainer = this.ccontainer.parentElement.parentElement\n }\n })\n }\n\n /**\n * @param {Array} args\n */\n print (args) {\n eventloop.enqueue(() => {\n dom.append(this.ccontainer, [\n dom.element('div', [\n pair.create(\n 'style',\n `${lineStyle};padding-left:${this.depth * 10}px`\n )\n ], _computeLineSpans(args))\n ])\n })\n }\n\n /**\n * @param {Error} err\n */\n printError (err) {\n this.print([common.RED, common.BOLD, err.toString()])\n }\n\n /**\n * @param {string} url\n * @param {number} height\n */\n printImg (url, height) {\n eventloop.enqueue(() => {\n dom.append(this.ccontainer, [\n dom.element('img', [\n pair.create('src', url),\n pair.create('height', `${math.round(height * 1.5)}px`)\n ])\n ])\n })\n }\n\n /**\n * @param {Node} node\n */\n printDom (node) {\n eventloop.enqueue(() => {\n dom.append(this.ccontainer, [node])\n })\n }\n\n destroy () {\n eventloop.enqueue(() => {\n vconsoles.delete(this)\n })\n }\n}\n/* c8 ignore stop */\n\n/**\n * @param {Element} dom\n */\n/* c8 ignore next */\nexport const createVConsole = (dom) => new VConsole(dom)\n\n/**\n * @param {string} moduleName\n * @return {function(...any):void}\n */\nexport const createModuleLogger = (moduleName) => common.createModuleLogger(print, moduleName)\n", "/**\n * Utility module to create and manipulate Iterators.\n *\n * @module iterator\n */\n\n/**\n * @template T,R\n * @param {Iterator} iterator\n * @param {function(T):R} f\n * @return {IterableIterator}\n */\nexport const mapIterator = (iterator, f) => ({\n [Symbol.iterator] () {\n return this\n },\n // @ts-ignore\n next () {\n const r = iterator.next()\n return { value: r.done ? undefined : f(r.value), done: r.done }\n }\n})\n\n/**\n * @template T\n * @param {function():IteratorResult} next\n * @return {IterableIterator}\n */\nexport const createIterator = next => ({\n /**\n * @return {IterableIterator}\n */\n [Symbol.iterator] () {\n return this\n },\n // @ts-ignore\n next\n})\n\n/**\n * @template T\n * @param {Iterator} iterator\n * @param {function(T):boolean} filter\n */\nexport const iteratorFilter = (iterator, filter) => createIterator(() => {\n let res\n do {\n res = iterator.next()\n } while (!res.done && !filter(res.value))\n return res\n})\n\n/**\n * @template T,M\n * @param {Iterator} iterator\n * @param {function(T):M} fmap\n */\nexport const iteratorMap = (iterator, fmap) => createIterator(() => {\n const { done, value } = iterator.next()\n return { done, value: done ? undefined : fmap(value) }\n})\n", "import { ObservableV2 } from 'lib0/observable'\n\nimport {\n Doc // eslint-disable-line\n} from '../internals.js'\n\n/**\n * This is an abstract interface that all Connectors should implement to keep them interchangeable.\n *\n * @note This interface is experimental and it is not advised to actually inherit this class.\n * It just serves as typing information.\n *\n * @extends {ObservableV2}\n */\nexport class AbstractConnector extends ObservableV2 {\n /**\n * @param {Doc} ydoc\n * @param {any} awareness\n */\n constructor (ydoc, awareness) {\n super()\n this.doc = ydoc\n this.awareness = awareness\n }\n}\n", "import {\n findIndexSS,\n getState,\n splitItem,\n iterateStructs,\n UpdateEncoderV2,\n DSDecoderV1, DSEncoderV1, DSDecoderV2, DSEncoderV2, Item, GC, StructStore, Transaction, ID // eslint-disable-line\n} from '../internals.js'\n\nimport * as array from 'lib0/array'\nimport * as math from 'lib0/math'\nimport * as map from 'lib0/map'\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\n\nexport class DeleteItem {\n /**\n * @param {number} clock\n * @param {number} len\n */\n constructor (clock, len) {\n /**\n * @type {number}\n */\n this.clock = clock\n /**\n * @type {number}\n */\n this.len = len\n }\n}\n\n/**\n * We no longer maintain a DeleteStore. DeleteSet is a temporary object that is created when needed.\n * - When created in a transaction, it must only be accessed after sorting, and merging\n * - This DeleteSet is send to other clients\n * - We do not create a DeleteSet when we send a sync message. The DeleteSet message is created directly from StructStore\n * - We read a DeleteSet as part of a sync/update message. In this case the DeleteSet is already sorted and merged.\n */\nexport class DeleteSet {\n constructor () {\n /**\n * @type {Map>}\n */\n this.clients = new Map()\n }\n}\n\n/**\n * Iterate over all structs that the DeleteSet gc's.\n *\n * @param {Transaction} transaction\n * @param {DeleteSet} ds\n * @param {function(GC|Item):void} f\n *\n * @function\n */\nexport const iterateDeletedStructs = (transaction, ds, f) =>\n ds.clients.forEach((deletes, clientid) => {\n const structs = /** @type {Array} */ (transaction.doc.store.clients.get(clientid))\n for (let i = 0; i < deletes.length; i++) {\n const del = deletes[i]\n iterateStructs(transaction, structs, del.clock, del.len, f)\n }\n })\n\n/**\n * @param {Array} dis\n * @param {number} clock\n * @return {number|null}\n *\n * @private\n * @function\n */\nexport const findIndexDS = (dis, clock) => {\n let left = 0\n let right = dis.length - 1\n while (left <= right) {\n const midindex = math.floor((left + right) / 2)\n const mid = dis[midindex]\n const midclock = mid.clock\n if (midclock <= clock) {\n if (clock < midclock + mid.len) {\n return midindex\n }\n left = midindex + 1\n } else {\n right = midindex - 1\n }\n }\n return null\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {ID} id\n * @return {boolean}\n *\n * @private\n * @function\n */\nexport const isDeleted = (ds, id) => {\n const dis = ds.clients.get(id.client)\n return dis !== undefined && findIndexDS(dis, id.clock) !== null\n}\n\n/**\n * @param {DeleteSet} ds\n *\n * @private\n * @function\n */\nexport const sortAndMergeDeleteSet = ds => {\n ds.clients.forEach(dels => {\n dels.sort((a, b) => a.clock - b.clock)\n // merge items without filtering or splicing the array\n // i is the current pointer\n // j refers to the current insert position for the pointed item\n // try to merge dels[i] into dels[j-1] or set dels[j]=dels[i]\n let i, j\n for (i = 1, j = 1; i < dels.length; i++) {\n const left = dels[j - 1]\n const right = dels[i]\n if (left.clock + left.len >= right.clock) {\n left.len = math.max(left.len, right.clock + right.len - left.clock)\n } else {\n if (j < i) {\n dels[j] = right\n }\n j++\n }\n }\n dels.length = j\n })\n}\n\n/**\n * @param {Array} dss\n * @return {DeleteSet} A fresh DeleteSet\n */\nexport const mergeDeleteSets = dss => {\n const merged = new DeleteSet()\n for (let dssI = 0; dssI < dss.length; dssI++) {\n dss[dssI].clients.forEach((delsLeft, client) => {\n if (!merged.clients.has(client)) {\n // Write all missing keys from current ds and all following.\n // If merged already contains `client` current ds has already been added.\n /**\n * @type {Array}\n */\n const dels = delsLeft.slice()\n for (let i = dssI + 1; i < dss.length; i++) {\n array.appendTo(dels, dss[i].clients.get(client) || [])\n }\n merged.clients.set(client, dels)\n }\n })\n }\n sortAndMergeDeleteSet(merged)\n return merged\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {number} client\n * @param {number} clock\n * @param {number} length\n *\n * @private\n * @function\n */\nexport const addToDeleteSet = (ds, client, clock, length) => {\n map.setIfUndefined(ds.clients, client, () => /** @type {Array} */ ([])).push(new DeleteItem(clock, length))\n}\n\nexport const createDeleteSet = () => new DeleteSet()\n\n/**\n * @param {StructStore} ss\n * @return {DeleteSet} Merged and sorted DeleteSet\n *\n * @private\n * @function\n */\nexport const createDeleteSetFromStructStore = ss => {\n const ds = createDeleteSet()\n ss.clients.forEach((structs, client) => {\n /**\n * @type {Array}\n */\n const dsitems = []\n for (let i = 0; i < structs.length; i++) {\n const struct = structs[i]\n if (struct.deleted) {\n const clock = struct.id.clock\n let len = struct.length\n if (i + 1 < structs.length) {\n for (let next = structs[i + 1]; i + 1 < structs.length && next.deleted; next = structs[++i + 1]) {\n len += next.length\n }\n }\n dsitems.push(new DeleteItem(clock, len))\n }\n }\n if (dsitems.length > 0) {\n ds.clients.set(client, dsitems)\n }\n })\n return ds\n}\n\n/**\n * @param {DSEncoderV1 | DSEncoderV2} encoder\n * @param {DeleteSet} ds\n *\n * @private\n * @function\n */\nexport const writeDeleteSet = (encoder, ds) => {\n encoding.writeVarUint(encoder.restEncoder, ds.clients.size)\n\n // Ensure that the delete set is written in a deterministic order\n array.from(ds.clients.entries())\n .sort((a, b) => b[0] - a[0])\n .forEach(([client, dsitems]) => {\n encoder.resetDsCurVal()\n encoding.writeVarUint(encoder.restEncoder, client)\n const len = dsitems.length\n encoding.writeVarUint(encoder.restEncoder, len)\n for (let i = 0; i < len; i++) {\n const item = dsitems[i]\n encoder.writeDsClock(item.clock)\n encoder.writeDsLen(item.len)\n }\n })\n}\n\n/**\n * @param {DSDecoderV1 | DSDecoderV2} decoder\n * @return {DeleteSet}\n *\n * @private\n * @function\n */\nexport const readDeleteSet = decoder => {\n const ds = new DeleteSet()\n const numClients = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numClients; i++) {\n decoder.resetDsCurVal()\n const client = decoding.readVarUint(decoder.restDecoder)\n const numberOfDeletes = decoding.readVarUint(decoder.restDecoder)\n if (numberOfDeletes > 0) {\n const dsField = map.setIfUndefined(ds.clients, client, () => /** @type {Array} */ ([]))\n for (let i = 0; i < numberOfDeletes; i++) {\n dsField.push(new DeleteItem(decoder.readDsClock(), decoder.readDsLen()))\n }\n }\n }\n return ds\n}\n\n/**\n * @todo YDecoder also contains references to String and other Decoders. Would make sense to exchange YDecoder.toUint8Array for YDecoder.DsToUint8Array()..\n */\n\n/**\n * @param {DSDecoderV1 | DSDecoderV2} decoder\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @return {Uint8Array|null} Returns a v2 update containing all deletes that couldn't be applied yet; or null if all deletes were applied successfully.\n *\n * @private\n * @function\n */\nexport const readAndApplyDeleteSet = (decoder, transaction, store) => {\n const unappliedDS = new DeleteSet()\n const numClients = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numClients; i++) {\n decoder.resetDsCurVal()\n const client = decoding.readVarUint(decoder.restDecoder)\n const numberOfDeletes = decoding.readVarUint(decoder.restDecoder)\n const structs = store.clients.get(client) || []\n const state = getState(store, client)\n for (let i = 0; i < numberOfDeletes; i++) {\n const clock = decoder.readDsClock()\n const clockEnd = clock + decoder.readDsLen()\n if (clock < state) {\n if (state < clockEnd) {\n addToDeleteSet(unappliedDS, client, state, clockEnd - state)\n }\n let index = findIndexSS(structs, clock)\n /**\n * We can ignore the case of GC and Delete structs, because we are going to skip them\n * @type {Item}\n */\n // @ts-ignore\n let struct = structs[index]\n // split the first item if necessary\n if (!struct.deleted && struct.id.clock < clock) {\n structs.splice(index + 1, 0, splitItem(transaction, struct, clock - struct.id.clock))\n index++ // increase we now want to use the next struct\n }\n while (index < structs.length) {\n // @ts-ignore\n struct = structs[index++]\n if (struct.id.clock < clockEnd) {\n if (!struct.deleted) {\n if (clockEnd < struct.id.clock + struct.length) {\n structs.splice(index, 0, splitItem(transaction, struct, clockEnd - struct.id.clock))\n }\n struct.delete(transaction)\n }\n } else {\n break\n }\n }\n } else {\n addToDeleteSet(unappliedDS, client, clock, clockEnd - clock)\n }\n }\n }\n if (unappliedDS.clients.size > 0) {\n const ds = new UpdateEncoderV2()\n encoding.writeVarUint(ds.restEncoder, 0) // encode 0 structs\n writeDeleteSet(ds, unappliedDS)\n return ds.toUint8Array()\n }\n return null\n}\n\n/**\n * @param {DeleteSet} ds1\n * @param {DeleteSet} ds2\n */\nexport const equalDeleteSets = (ds1, ds2) => {\n if (ds1.clients.size !== ds2.clients.size) return false\n for (const [client, deleteItems1] of ds1.clients.entries()) {\n const deleteItems2 = /** @type {Array} */ (ds2.clients.get(client))\n if (deleteItems2 === undefined || deleteItems1.length !== deleteItems2.length) return false\n for (let i = 0; i < deleteItems1.length; i++) {\n const di1 = deleteItems1[i]\n const di2 = deleteItems2[i]\n if (di1.clock !== di2.clock || di1.len !== di2.len) {\n return false\n }\n }\n }\n return true\n}\n", "/**\n * @module Y\n */\n\nimport {\n StructStore,\n AbstractType,\n YArray,\n YText,\n YMap,\n YXmlElement,\n YXmlFragment,\n transact,\n ContentDoc, Item, Transaction, YEvent // eslint-disable-line\n} from '../internals.js'\n\nimport { ObservableV2 } from 'lib0/observable'\nimport * as random from 'lib0/random'\nimport * as map from 'lib0/map'\nimport * as array from 'lib0/array'\nimport * as promise from 'lib0/promise'\n\nexport const generateNewClientId = random.uint32\n\n/**\n * @typedef {Object} DocOpts\n * @property {boolean} [DocOpts.gc=true] Disable garbage collection (default: gc=true)\n * @property {function(Item):boolean} [DocOpts.gcFilter] Will be called before an Item is garbage collected. Return false to keep the Item.\n * @property {string} [DocOpts.guid] Define a globally unique identifier for this document\n * @property {string | null} [DocOpts.collectionid] Associate this document with a collection. This only plays a role if your provider has a concept of collection.\n * @property {any} [DocOpts.meta] Any kind of meta information you want to associate with this document. If this is a subdocument, remote peers will store the meta information as well.\n * @property {boolean} [DocOpts.autoLoad] If a subdocument, automatically load document. If this is a subdocument, remote peers will load the document as well automatically.\n * @property {boolean} [DocOpts.shouldLoad] Whether the document should be synced by the provider now. This is toggled to true when you call ydoc.load()\n */\n\n/**\n * @typedef {Object} DocEvents\n * @property {function(Doc):void} DocEvents.destroy\n * @property {function(Doc):void} DocEvents.load\n * @property {function(boolean, Doc):void} DocEvents.sync\n * @property {function(Uint8Array, any, Doc, Transaction):void} DocEvents.update\n * @property {function(Uint8Array, any, Doc, Transaction):void} DocEvents.updateV2\n * @property {function(Doc):void} DocEvents.beforeAllTransactions\n * @property {function(Transaction, Doc):void} DocEvents.beforeTransaction\n * @property {function(Transaction, Doc):void} DocEvents.beforeObserverCalls\n * @property {function(Transaction, Doc):void} DocEvents.afterTransaction\n * @property {function(Transaction, Doc):void} DocEvents.afterTransactionCleanup\n * @property {function(Doc, Array):void} DocEvents.afterAllTransactions\n * @property {function({ loaded: Set, added: Set, removed: Set }, Doc, Transaction):void} DocEvents.subdocs\n */\n\n/**\n * A Yjs instance handles the state of shared data.\n * @extends ObservableV2\n */\nexport class Doc extends ObservableV2 {\n /**\n * @param {DocOpts} opts configuration\n */\n constructor ({ guid = random.uuidv4(), collectionid = null, gc = true, gcFilter = () => true, meta = null, autoLoad = false, shouldLoad = true } = {}) {\n super()\n this.gc = gc\n this.gcFilter = gcFilter\n this.clientID = generateNewClientId()\n this.guid = guid\n this.collectionid = collectionid\n /**\n * @type {Map>>}\n */\n this.share = new Map()\n this.store = new StructStore()\n /**\n * @type {Transaction | null}\n */\n this._transaction = null\n /**\n * @type {Array}\n */\n this._transactionCleanups = []\n /**\n * @type {Set}\n */\n this.subdocs = new Set()\n /**\n * If this document is a subdocument - a document integrated into another document - then _item is defined.\n * @type {Item?}\n */\n this._item = null\n this.shouldLoad = shouldLoad\n this.autoLoad = autoLoad\n this.meta = meta\n /**\n * This is set to true when the persistence provider loaded the document from the database or when the `sync` event fires.\n * Note that not all providers implement this feature. Provider authors are encouraged to fire the `load` event when the doc content is loaded from the database.\n *\n * @type {boolean}\n */\n this.isLoaded = false\n /**\n * This is set to true when the connection provider has successfully synced with a backend.\n * Note that when using peer-to-peer providers this event may not provide very useful.\n * Also note that not all providers implement this feature. Provider authors are encouraged to fire\n * the `sync` event when the doc has been synced (with `true` as a parameter) or if connection is\n * lost (with false as a parameter).\n */\n this.isSynced = false\n this.isDestroyed = false\n /**\n * Promise that resolves once the document has been loaded from a presistence provider.\n */\n this.whenLoaded = promise.create(resolve => {\n this.on('load', () => {\n this.isLoaded = true\n resolve(this)\n })\n })\n const provideSyncedPromise = () => promise.create(resolve => {\n /**\n * @param {boolean} isSynced\n */\n const eventHandler = (isSynced) => {\n if (isSynced === undefined || isSynced === true) {\n this.off('sync', eventHandler)\n resolve()\n }\n }\n this.on('sync', eventHandler)\n })\n this.on('sync', isSynced => {\n if (isSynced === false && this.isSynced) {\n this.whenSynced = provideSyncedPromise()\n }\n this.isSynced = isSynced === undefined || isSynced === true\n if (this.isSynced && !this.isLoaded) {\n this.emit('load', [this])\n }\n })\n /**\n * Promise that resolves once the document has been synced with a backend.\n * This promise is recreated when the connection is lost.\n * Note the documentation about the `isSynced` property.\n */\n this.whenSynced = provideSyncedPromise()\n }\n\n /**\n * Notify the parent document that you request to load data into this subdocument (if it is a subdocument).\n *\n * `load()` might be used in the future to request any provider to load the most current data.\n *\n * It is safe to call `load()` multiple times.\n */\n load () {\n const item = this._item\n if (item !== null && !this.shouldLoad) {\n transact(/** @type {any} */ (item.parent).doc, transaction => {\n transaction.subdocsLoaded.add(this)\n }, null, true)\n }\n this.shouldLoad = true\n }\n\n getSubdocs () {\n return this.subdocs\n }\n\n getSubdocGuids () {\n return new Set(array.from(this.subdocs).map(doc => doc.guid))\n }\n\n /**\n * Changes that happen inside of a transaction are bundled. This means that\n * the observer fires _after_ the transaction is finished and that all changes\n * that happened inside of the transaction are sent as one message to the\n * other peers.\n *\n * @template T\n * @param {function(Transaction):T} f The function that should be executed as a transaction\n * @param {any} [origin] Origin of who started the transaction. Will be stored on transaction.origin\n * @return T\n *\n * @public\n */\n transact (f, origin = null) {\n return transact(this, f, origin)\n }\n\n /**\n * Define a shared data type.\n *\n * Multiple calls of `ydoc.get(name, TypeConstructor)` yield the same result\n * and do not overwrite each other. I.e.\n * `ydoc.get(name, Y.Array) === ydoc.get(name, Y.Array)`\n *\n * After this method is called, the type is also available on `ydoc.share.get(name)`.\n *\n * *Best Practices:*\n * Define all types right after the Y.Doc instance is created and store them in a separate object.\n * Also use the typed methods `getText(name)`, `getArray(name)`, ..\n *\n * @template {typeof AbstractType} Type\n * @example\n * const ydoc = new Y.Doc(..)\n * const appState = {\n * document: ydoc.getText('document')\n * comments: ydoc.getArray('comments')\n * }\n *\n * @param {string} name\n * @param {Type} TypeConstructor The constructor of the type definition. E.g. Y.Text, Y.Array, Y.Map, ...\n * @return {InstanceType} The created type. Constructed with TypeConstructor\n *\n * @public\n */\n get (name, TypeConstructor = /** @type {any} */ (AbstractType)) {\n const type = map.setIfUndefined(this.share, name, () => {\n // @ts-ignore\n const t = new TypeConstructor()\n t._integrate(this, null)\n return t\n })\n const Constr = type.constructor\n if (TypeConstructor !== AbstractType && Constr !== TypeConstructor) {\n if (Constr === AbstractType) {\n // @ts-ignore\n const t = new TypeConstructor()\n t._map = type._map\n type._map.forEach(/** @param {Item?} n */ n => {\n for (; n !== null; n = n.left) {\n // @ts-ignore\n n.parent = t\n }\n })\n t._start = type._start\n for (let n = t._start; n !== null; n = n.right) {\n n.parent = t\n }\n t._length = type._length\n this.share.set(name, t)\n t._integrate(this, null)\n return /** @type {InstanceType} */ (t)\n } else {\n throw new Error(`Type with the name ${name} has already been defined with a different constructor`)\n }\n }\n return /** @type {InstanceType} */ (type)\n }\n\n /**\n * @template T\n * @param {string} [name]\n * @return {YArray}\n *\n * @public\n */\n getArray (name = '') {\n return /** @type {YArray} */ (this.get(name, YArray))\n }\n\n /**\n * @param {string} [name]\n * @return {YText}\n *\n * @public\n */\n getText (name = '') {\n return this.get(name, YText)\n }\n\n /**\n * @template T\n * @param {string} [name]\n * @return {YMap}\n *\n * @public\n */\n getMap (name = '') {\n return /** @type {YMap} */ (this.get(name, YMap))\n }\n\n /**\n * @param {string} [name]\n * @return {YXmlElement}\n *\n * @public\n */\n getXmlElement (name = '') {\n return /** @type {YXmlElement<{[key:string]:string}>} */ (this.get(name, YXmlElement))\n }\n\n /**\n * @param {string} [name]\n * @return {YXmlFragment}\n *\n * @public\n */\n getXmlFragment (name = '') {\n return this.get(name, YXmlFragment)\n }\n\n /**\n * Converts the entire document into a js object, recursively traversing each yjs type\n * Doesn't log types that have not been defined (using ydoc.getType(..)).\n *\n * @deprecated Do not use this method and rather call toJSON directly on the shared types.\n *\n * @return {Object}\n */\n toJSON () {\n /**\n * @type {Object}\n */\n const doc = {}\n\n this.share.forEach((value, key) => {\n doc[key] = value.toJSON()\n })\n\n return doc\n }\n\n /**\n * Emit `destroy` event and unregister all event handlers.\n */\n destroy () {\n this.isDestroyed = true\n array.from(this.subdocs).forEach(subdoc => subdoc.destroy())\n const item = this._item\n if (item !== null) {\n this._item = null\n const content = /** @type {ContentDoc} */ (item.content)\n content.doc = new Doc({ guid: this.guid, ...content.opts, shouldLoad: false })\n content.doc._item = item\n transact(/** @type {any} */ (item).parent.doc, transaction => {\n const doc = content.doc\n if (!item.deleted) {\n transaction.subdocsAdded.add(doc)\n }\n transaction.subdocsRemoved.add(this)\n }, null, true)\n }\n // @ts-ignore\n this.emit('destroyed', [true]) // DEPRECATED!\n this.emit('destroy', [this])\n super.destroy()\n }\n}\n", "import * as buffer from 'lib0/buffer'\nimport * as decoding from 'lib0/decoding'\nimport {\n ID, createID\n} from '../internals.js'\n\nexport class DSDecoderV1 {\n /**\n * @param {decoding.Decoder} decoder\n */\n constructor (decoder) {\n this.restDecoder = decoder\n }\n\n resetDsCurVal () {\n // nop\n }\n\n /**\n * @return {number}\n */\n readDsClock () {\n return decoding.readVarUint(this.restDecoder)\n }\n\n /**\n * @return {number}\n */\n readDsLen () {\n return decoding.readVarUint(this.restDecoder)\n }\n}\n\nexport class UpdateDecoderV1 extends DSDecoderV1 {\n /**\n * @return {ID}\n */\n readLeftID () {\n return createID(decoding.readVarUint(this.restDecoder), decoding.readVarUint(this.restDecoder))\n }\n\n /**\n * @return {ID}\n */\n readRightID () {\n return createID(decoding.readVarUint(this.restDecoder), decoding.readVarUint(this.restDecoder))\n }\n\n /**\n * Read the next client id.\n * Use this in favor of readID whenever possible to reduce the number of objects created.\n */\n readClient () {\n return decoding.readVarUint(this.restDecoder)\n }\n\n /**\n * @return {number} info An unsigned 8-bit integer\n */\n readInfo () {\n return decoding.readUint8(this.restDecoder)\n }\n\n /**\n * @return {string}\n */\n readString () {\n return decoding.readVarString(this.restDecoder)\n }\n\n /**\n * @return {boolean} isKey\n */\n readParentInfo () {\n return decoding.readVarUint(this.restDecoder) === 1\n }\n\n /**\n * @return {number} info An unsigned 8-bit integer\n */\n readTypeRef () {\n return decoding.readVarUint(this.restDecoder)\n }\n\n /**\n * Write len of a struct - well suited for Opt RLE encoder.\n *\n * @return {number} len\n */\n readLen () {\n return decoding.readVarUint(this.restDecoder)\n }\n\n /**\n * @return {any}\n */\n readAny () {\n return decoding.readAny(this.restDecoder)\n }\n\n /**\n * @return {Uint8Array}\n */\n readBuf () {\n return buffer.copyUint8Array(decoding.readVarUint8Array(this.restDecoder))\n }\n\n /**\n * Legacy implementation uses JSON parse. We use any-decoding in v2.\n *\n * @return {any}\n */\n readJSON () {\n return JSON.parse(decoding.readVarString(this.restDecoder))\n }\n\n /**\n * @return {string}\n */\n readKey () {\n return decoding.readVarString(this.restDecoder)\n }\n}\n\nexport class DSDecoderV2 {\n /**\n * @param {decoding.Decoder} decoder\n */\n constructor (decoder) {\n /**\n * @private\n */\n this.dsCurrVal = 0\n this.restDecoder = decoder\n }\n\n resetDsCurVal () {\n this.dsCurrVal = 0\n }\n\n /**\n * @return {number}\n */\n readDsClock () {\n this.dsCurrVal += decoding.readVarUint(this.restDecoder)\n return this.dsCurrVal\n }\n\n /**\n * @return {number}\n */\n readDsLen () {\n const diff = decoding.readVarUint(this.restDecoder) + 1\n this.dsCurrVal += diff\n return diff\n }\n}\n\nexport class UpdateDecoderV2 extends DSDecoderV2 {\n /**\n * @param {decoding.Decoder} decoder\n */\n constructor (decoder) {\n super(decoder)\n /**\n * List of cached keys. If the keys[id] does not exist, we read a new key\n * from stringEncoder and push it to keys.\n *\n * @type {Array}\n */\n this.keys = []\n decoding.readVarUint(decoder) // read feature flag - currently unused\n this.keyClockDecoder = new decoding.IntDiffOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.clientDecoder = new decoding.UintOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.leftClockDecoder = new decoding.IntDiffOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.rightClockDecoder = new decoding.IntDiffOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.infoDecoder = new decoding.RleDecoder(decoding.readVarUint8Array(decoder), decoding.readUint8)\n this.stringDecoder = new decoding.StringDecoder(decoding.readVarUint8Array(decoder))\n this.parentInfoDecoder = new decoding.RleDecoder(decoding.readVarUint8Array(decoder), decoding.readUint8)\n this.typeRefDecoder = new decoding.UintOptRleDecoder(decoding.readVarUint8Array(decoder))\n this.lenDecoder = new decoding.UintOptRleDecoder(decoding.readVarUint8Array(decoder))\n }\n\n /**\n * @return {ID}\n */\n readLeftID () {\n return new ID(this.clientDecoder.read(), this.leftClockDecoder.read())\n }\n\n /**\n * @return {ID}\n */\n readRightID () {\n return new ID(this.clientDecoder.read(), this.rightClockDecoder.read())\n }\n\n /**\n * Read the next client id.\n * Use this in favor of readID whenever possible to reduce the number of objects created.\n */\n readClient () {\n return this.clientDecoder.read()\n }\n\n /**\n * @return {number} info An unsigned 8-bit integer\n */\n readInfo () {\n return /** @type {number} */ (this.infoDecoder.read())\n }\n\n /**\n * @return {string}\n */\n readString () {\n return this.stringDecoder.read()\n }\n\n /**\n * @return {boolean}\n */\n readParentInfo () {\n return this.parentInfoDecoder.read() === 1\n }\n\n /**\n * @return {number} An unsigned 8-bit integer\n */\n readTypeRef () {\n return this.typeRefDecoder.read()\n }\n\n /**\n * Write len of a struct - well suited for Opt RLE encoder.\n *\n * @return {number}\n */\n readLen () {\n return this.lenDecoder.read()\n }\n\n /**\n * @return {any}\n */\n readAny () {\n return decoding.readAny(this.restDecoder)\n }\n\n /**\n * @return {Uint8Array}\n */\n readBuf () {\n return decoding.readVarUint8Array(this.restDecoder)\n }\n\n /**\n * This is mainly here for legacy purposes.\n *\n * Initial we incoded objects using JSON. Now we use the much faster lib0/any-encoder. This method mainly exists for legacy purposes for the v1 encoder.\n *\n * @return {any}\n */\n readJSON () {\n return decoding.readAny(this.restDecoder)\n }\n\n /**\n * @return {string}\n */\n readKey () {\n const keyClock = this.keyClockDecoder.read()\n if (keyClock < this.keys.length) {\n return this.keys[keyClock]\n } else {\n const key = this.stringDecoder.read()\n this.keys.push(key)\n return key\n }\n }\n}\n", "import * as error from 'lib0/error'\nimport * as encoding from 'lib0/encoding'\n\nimport {\n ID // eslint-disable-line\n} from '../internals.js'\n\nexport class DSEncoderV1 {\n constructor () {\n this.restEncoder = encoding.createEncoder()\n }\n\n toUint8Array () {\n return encoding.toUint8Array(this.restEncoder)\n }\n\n resetDsCurVal () {\n // nop\n }\n\n /**\n * @param {number} clock\n */\n writeDsClock (clock) {\n encoding.writeVarUint(this.restEncoder, clock)\n }\n\n /**\n * @param {number} len\n */\n writeDsLen (len) {\n encoding.writeVarUint(this.restEncoder, len)\n }\n}\n\nexport class UpdateEncoderV1 extends DSEncoderV1 {\n /**\n * @param {ID} id\n */\n writeLeftID (id) {\n encoding.writeVarUint(this.restEncoder, id.client)\n encoding.writeVarUint(this.restEncoder, id.clock)\n }\n\n /**\n * @param {ID} id\n */\n writeRightID (id) {\n encoding.writeVarUint(this.restEncoder, id.client)\n encoding.writeVarUint(this.restEncoder, id.clock)\n }\n\n /**\n * Use writeClient and writeClock instead of writeID if possible.\n * @param {number} client\n */\n writeClient (client) {\n encoding.writeVarUint(this.restEncoder, client)\n }\n\n /**\n * @param {number} info An unsigned 8-bit integer\n */\n writeInfo (info) {\n encoding.writeUint8(this.restEncoder, info)\n }\n\n /**\n * @param {string} s\n */\n writeString (s) {\n encoding.writeVarString(this.restEncoder, s)\n }\n\n /**\n * @param {boolean} isYKey\n */\n writeParentInfo (isYKey) {\n encoding.writeVarUint(this.restEncoder, isYKey ? 1 : 0)\n }\n\n /**\n * @param {number} info An unsigned 8-bit integer\n */\n writeTypeRef (info) {\n encoding.writeVarUint(this.restEncoder, info)\n }\n\n /**\n * Write len of a struct - well suited for Opt RLE encoder.\n *\n * @param {number} len\n */\n writeLen (len) {\n encoding.writeVarUint(this.restEncoder, len)\n }\n\n /**\n * @param {any} any\n */\n writeAny (any) {\n encoding.writeAny(this.restEncoder, any)\n }\n\n /**\n * @param {Uint8Array} buf\n */\n writeBuf (buf) {\n encoding.writeVarUint8Array(this.restEncoder, buf)\n }\n\n /**\n * @param {any} embed\n */\n writeJSON (embed) {\n encoding.writeVarString(this.restEncoder, JSON.stringify(embed))\n }\n\n /**\n * @param {string} key\n */\n writeKey (key) {\n encoding.writeVarString(this.restEncoder, key)\n }\n}\n\nexport class DSEncoderV2 {\n constructor () {\n this.restEncoder = encoding.createEncoder() // encodes all the rest / non-optimized\n this.dsCurrVal = 0\n }\n\n toUint8Array () {\n return encoding.toUint8Array(this.restEncoder)\n }\n\n resetDsCurVal () {\n this.dsCurrVal = 0\n }\n\n /**\n * @param {number} clock\n */\n writeDsClock (clock) {\n const diff = clock - this.dsCurrVal\n this.dsCurrVal = clock\n encoding.writeVarUint(this.restEncoder, diff)\n }\n\n /**\n * @param {number} len\n */\n writeDsLen (len) {\n if (len === 0) {\n error.unexpectedCase()\n }\n encoding.writeVarUint(this.restEncoder, len - 1)\n this.dsCurrVal += len\n }\n}\n\nexport class UpdateEncoderV2 extends DSEncoderV2 {\n constructor () {\n super()\n /**\n * @type {Map}\n */\n this.keyMap = new Map()\n /**\n * Refers to the next uniqe key-identifier to me used.\n * See writeKey method for more information.\n *\n * @type {number}\n */\n this.keyClock = 0\n this.keyClockEncoder = new encoding.IntDiffOptRleEncoder()\n this.clientEncoder = new encoding.UintOptRleEncoder()\n this.leftClockEncoder = new encoding.IntDiffOptRleEncoder()\n this.rightClockEncoder = new encoding.IntDiffOptRleEncoder()\n this.infoEncoder = new encoding.RleEncoder(encoding.writeUint8)\n this.stringEncoder = new encoding.StringEncoder()\n this.parentInfoEncoder = new encoding.RleEncoder(encoding.writeUint8)\n this.typeRefEncoder = new encoding.UintOptRleEncoder()\n this.lenEncoder = new encoding.UintOptRleEncoder()\n }\n\n toUint8Array () {\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, 0) // this is a feature flag that we might use in the future\n encoding.writeVarUint8Array(encoder, this.keyClockEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, this.clientEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, this.leftClockEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, this.rightClockEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, encoding.toUint8Array(this.infoEncoder))\n encoding.writeVarUint8Array(encoder, this.stringEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, encoding.toUint8Array(this.parentInfoEncoder))\n encoding.writeVarUint8Array(encoder, this.typeRefEncoder.toUint8Array())\n encoding.writeVarUint8Array(encoder, this.lenEncoder.toUint8Array())\n // @note The rest encoder is appended! (note the missing var)\n encoding.writeUint8Array(encoder, encoding.toUint8Array(this.restEncoder))\n return encoding.toUint8Array(encoder)\n }\n\n /**\n * @param {ID} id\n */\n writeLeftID (id) {\n this.clientEncoder.write(id.client)\n this.leftClockEncoder.write(id.clock)\n }\n\n /**\n * @param {ID} id\n */\n writeRightID (id) {\n this.clientEncoder.write(id.client)\n this.rightClockEncoder.write(id.clock)\n }\n\n /**\n * @param {number} client\n */\n writeClient (client) {\n this.clientEncoder.write(client)\n }\n\n /**\n * @param {number} info An unsigned 8-bit integer\n */\n writeInfo (info) {\n this.infoEncoder.write(info)\n }\n\n /**\n * @param {string} s\n */\n writeString (s) {\n this.stringEncoder.write(s)\n }\n\n /**\n * @param {boolean} isYKey\n */\n writeParentInfo (isYKey) {\n this.parentInfoEncoder.write(isYKey ? 1 : 0)\n }\n\n /**\n * @param {number} info An unsigned 8-bit integer\n */\n writeTypeRef (info) {\n this.typeRefEncoder.write(info)\n }\n\n /**\n * Write len of a struct - well suited for Opt RLE encoder.\n *\n * @param {number} len\n */\n writeLen (len) {\n this.lenEncoder.write(len)\n }\n\n /**\n * @param {any} any\n */\n writeAny (any) {\n encoding.writeAny(this.restEncoder, any)\n }\n\n /**\n * @param {Uint8Array} buf\n */\n writeBuf (buf) {\n encoding.writeVarUint8Array(this.restEncoder, buf)\n }\n\n /**\n * This is mainly here for legacy purposes.\n *\n * Initial we incoded objects using JSON. Now we use the much faster lib0/any-encoder. This method mainly exists for legacy purposes for the v1 encoder.\n *\n * @param {any} embed\n */\n writeJSON (embed) {\n encoding.writeAny(this.restEncoder, embed)\n }\n\n /**\n * Property keys are often reused. For example, in y-prosemirror the key `bold` might\n * occur very often. For a 3d application, the key `position` might occur very often.\n *\n * We cache these keys in a Map and refer to them via a unique number.\n *\n * @param {string} key\n */\n writeKey (key) {\n const clock = this.keyMap.get(key)\n if (clock === undefined) {\n /**\n * @todo uncomment to introduce this feature finally\n *\n * Background. The ContentFormat object was always encoded using writeKey, but the decoder used to use readString.\n * Furthermore, I forgot to set the keyclock. So everything was working fine.\n *\n * However, this feature here is basically useless as it is not being used (it actually only consumes extra memory).\n *\n * I don't know yet how to reintroduce this feature..\n *\n * Older clients won't be able to read updates when we reintroduce this feature. So this should probably be done using a flag.\n *\n */\n // this.keyMap.set(key, this.keyClock)\n this.keyClockEncoder.write(this.keyClock++)\n this.stringEncoder.write(key)\n } else {\n this.keyClockEncoder.write(clock)\n }\n }\n}\n", "/**\n * @module encoding\n */\n/*\n * We use the first five bits in the info flag for determining the type of the struct.\n *\n * 0: GC\n * 1: Item with Deleted content\n * 2: Item with JSON content\n * 3: Item with Binary content\n * 4: Item with String content\n * 5: Item with Embed content (for richtext content)\n * 6: Item with Format content (a formatting marker for richtext content)\n * 7: Item with Type\n */\n\nimport {\n findIndexSS,\n getState,\n createID,\n getStateVector,\n readAndApplyDeleteSet,\n writeDeleteSet,\n createDeleteSetFromStructStore,\n transact,\n readItemContent,\n UpdateDecoderV1,\n UpdateDecoderV2,\n UpdateEncoderV1,\n UpdateEncoderV2,\n DSEncoderV2,\n DSDecoderV1,\n DSEncoderV1,\n mergeUpdates,\n mergeUpdatesV2,\n Skip,\n diffUpdateV2,\n convertUpdateFormatV2ToV1,\n DSDecoderV2, Doc, Transaction, GC, Item, StructStore // eslint-disable-line\n} from '../internals.js'\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as binary from 'lib0/binary'\nimport * as map from 'lib0/map'\nimport * as math from 'lib0/math'\nimport * as array from 'lib0/array'\n\n/**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {Array} structs All structs by `client`\n * @param {number} client\n * @param {number} clock write structs starting with `ID(client,clock)`\n *\n * @function\n */\nconst writeStructs = (encoder, structs, client, clock) => {\n // write first id\n clock = math.max(clock, structs[0].id.clock) // make sure the first id exists\n const startNewStructs = findIndexSS(structs, clock)\n // write # encoded structs\n encoding.writeVarUint(encoder.restEncoder, structs.length - startNewStructs)\n encoder.writeClient(client)\n encoding.writeVarUint(encoder.restEncoder, clock)\n const firstStruct = structs[startNewStructs]\n // write first struct with an offset\n firstStruct.write(encoder, clock - firstStruct.id.clock)\n for (let i = startNewStructs + 1; i < structs.length; i++) {\n structs[i].write(encoder, 0)\n }\n}\n\n/**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {StructStore} store\n * @param {Map} _sm\n *\n * @private\n * @function\n */\nexport const writeClientsStructs = (encoder, store, _sm) => {\n // we filter all valid _sm entries into sm\n const sm = new Map()\n _sm.forEach((clock, client) => {\n // only write if new structs are available\n if (getState(store, client) > clock) {\n sm.set(client, clock)\n }\n })\n getStateVector(store).forEach((_clock, client) => {\n if (!_sm.has(client)) {\n sm.set(client, 0)\n }\n })\n // write # states that were updated\n encoding.writeVarUint(encoder.restEncoder, sm.size)\n // Write items with higher client ids first\n // This heavily improves the conflict algorithm.\n array.from(sm.entries()).sort((a, b) => b[0] - a[0]).forEach(([client, clock]) => {\n writeStructs(encoder, /** @type {Array} */ (store.clients.get(client)), client, clock)\n })\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder The decoder object to read data from.\n * @param {Doc} doc\n * @return {Map }>}\n *\n * @private\n * @function\n */\nexport const readClientsStructRefs = (decoder, doc) => {\n /**\n * @type {Map }>}\n */\n const clientRefs = map.create()\n const numOfStateUpdates = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numOfStateUpdates; i++) {\n const numberOfStructs = decoding.readVarUint(decoder.restDecoder)\n /**\n * @type {Array}\n */\n const refs = new Array(numberOfStructs)\n const client = decoder.readClient()\n let clock = decoding.readVarUint(decoder.restDecoder)\n // const start = performance.now()\n clientRefs.set(client, { i: 0, refs })\n for (let i = 0; i < numberOfStructs; i++) {\n const info = decoder.readInfo()\n switch (binary.BITS5 & info) {\n case 0: { // GC\n const len = decoder.readLen()\n refs[i] = new GC(createID(client, clock), len)\n clock += len\n break\n }\n case 10: { // Skip Struct (nothing to apply)\n // @todo we could reduce the amount of checks by adding Skip struct to clientRefs so we know that something is missing.\n const len = decoding.readVarUint(decoder.restDecoder)\n refs[i] = new Skip(createID(client, clock), len)\n clock += len\n break\n }\n default: { // Item with content\n /**\n * The optimized implementation doesn't use any variables because inlining variables is faster.\n * Below a non-optimized version is shown that implements the basic algorithm with\n * a few comments\n */\n const cantCopyParentInfo = (info & (binary.BIT7 | binary.BIT8)) === 0\n // If parent = null and neither left nor right are defined, then we know that `parent` is child of `y`\n // and we read the next string as parentYKey.\n // It indicates how we store/retrieve parent from `y.share`\n // @type {string|null}\n const struct = new Item(\n createID(client, clock),\n null, // left\n (info & binary.BIT8) === binary.BIT8 ? decoder.readLeftID() : null, // origin\n null, // right\n (info & binary.BIT7) === binary.BIT7 ? decoder.readRightID() : null, // right origin\n cantCopyParentInfo ? (decoder.readParentInfo() ? doc.get(decoder.readString()) : decoder.readLeftID()) : null, // parent\n cantCopyParentInfo && (info & binary.BIT6) === binary.BIT6 ? decoder.readString() : null, // parentSub\n readItemContent(decoder, info) // item content\n )\n /* A non-optimized implementation of the above algorithm:\n\n // The item that was originally to the left of this item.\n const origin = (info & binary.BIT8) === binary.BIT8 ? decoder.readLeftID() : null\n // The item that was originally to the right of this item.\n const rightOrigin = (info & binary.BIT7) === binary.BIT7 ? decoder.readRightID() : null\n const cantCopyParentInfo = (info & (binary.BIT7 | binary.BIT8)) === 0\n const hasParentYKey = cantCopyParentInfo ? decoder.readParentInfo() : false\n // If parent = null and neither left nor right are defined, then we know that `parent` is child of `y`\n // and we read the next string as parentYKey.\n // It indicates how we store/retrieve parent from `y.share`\n // @type {string|null}\n const parentYKey = cantCopyParentInfo && hasParentYKey ? decoder.readString() : null\n\n const struct = new Item(\n createID(client, clock),\n null, // left\n origin, // origin\n null, // right\n rightOrigin, // right origin\n cantCopyParentInfo && !hasParentYKey ? decoder.readLeftID() : (parentYKey !== null ? doc.get(parentYKey) : null), // parent\n cantCopyParentInfo && (info & binary.BIT6) === binary.BIT6 ? decoder.readString() : null, // parentSub\n readItemContent(decoder, info) // item content\n )\n */\n refs[i] = struct\n clock += struct.length\n }\n }\n }\n // console.log('time to read: ', performance.now() - start) // @todo remove\n }\n return clientRefs\n}\n\n/**\n * Resume computing structs generated by struct readers.\n *\n * While there is something to do, we integrate structs in this order\n * 1. top element on stack, if stack is not empty\n * 2. next element from current struct reader (if empty, use next struct reader)\n *\n * If struct causally depends on another struct (ref.missing), we put next reader of\n * `ref.id.client` on top of stack.\n *\n * At some point we find a struct that has no causal dependencies,\n * then we start emptying the stack.\n *\n * It is not possible to have circles: i.e. struct1 (from client1) depends on struct2 (from client2)\n * depends on struct3 (from client1). Therefore the max stack size is eqaul to `structReaders.length`.\n *\n * This method is implemented in a way so that we can resume computation if this update\n * causally depends on another update.\n *\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @param {Map} clientsStructRefs\n * @return { null | { update: Uint8Array, missing: Map } }\n *\n * @private\n * @function\n */\nconst integrateStructs = (transaction, store, clientsStructRefs) => {\n /**\n * @type {Array}\n */\n const stack = []\n // sort them so that we take the higher id first, in case of conflicts the lower id will probably not conflict with the id from the higher user.\n let clientsStructRefsIds = array.from(clientsStructRefs.keys()).sort((a, b) => a - b)\n if (clientsStructRefsIds.length === 0) {\n return null\n }\n const getNextStructTarget = () => {\n if (clientsStructRefsIds.length === 0) {\n return null\n }\n let nextStructsTarget = /** @type {{i:number,refs:Array}} */ (clientsStructRefs.get(clientsStructRefsIds[clientsStructRefsIds.length - 1]))\n while (nextStructsTarget.refs.length === nextStructsTarget.i) {\n clientsStructRefsIds.pop()\n if (clientsStructRefsIds.length > 0) {\n nextStructsTarget = /** @type {{i:number,refs:Array}} */ (clientsStructRefs.get(clientsStructRefsIds[clientsStructRefsIds.length - 1]))\n } else {\n return null\n }\n }\n return nextStructsTarget\n }\n let curStructsTarget = getNextStructTarget()\n if (curStructsTarget === null) {\n return null\n }\n\n /**\n * @type {StructStore}\n */\n const restStructs = new StructStore()\n const missingSV = new Map()\n /**\n * @param {number} client\n * @param {number} clock\n */\n const updateMissingSv = (client, clock) => {\n const mclock = missingSV.get(client)\n if (mclock == null || mclock > clock) {\n missingSV.set(client, clock)\n }\n }\n /**\n * @type {GC|Item}\n */\n let stackHead = /** @type {any} */ (curStructsTarget).refs[/** @type {any} */ (curStructsTarget).i++]\n // caching the state because it is used very often\n const state = new Map()\n\n const addStackToRestSS = () => {\n for (const item of stack) {\n const client = item.id.client\n const unapplicableItems = clientsStructRefs.get(client)\n if (unapplicableItems) {\n // decrement because we weren't able to apply previous operation\n unapplicableItems.i--\n restStructs.clients.set(client, unapplicableItems.refs.slice(unapplicableItems.i))\n clientsStructRefs.delete(client)\n unapplicableItems.i = 0\n unapplicableItems.refs = []\n } else {\n // item was the last item on clientsStructRefs and the field was already cleared. Add item to restStructs and continue\n restStructs.clients.set(client, [item])\n }\n // remove client from clientsStructRefsIds to prevent users from applying the same update again\n clientsStructRefsIds = clientsStructRefsIds.filter(c => c !== client)\n }\n stack.length = 0\n }\n\n // iterate over all struct readers until we are done\n while (true) {\n if (stackHead.constructor !== Skip) {\n const localClock = map.setIfUndefined(state, stackHead.id.client, () => getState(store, stackHead.id.client))\n const offset = localClock - stackHead.id.clock\n if (offset < 0) {\n // update from the same client is missing\n stack.push(stackHead)\n updateMissingSv(stackHead.id.client, stackHead.id.clock - 1)\n // hid a dead wall, add all items from stack to restSS\n addStackToRestSS()\n } else {\n const missing = stackHead.getMissing(transaction, store)\n if (missing !== null) {\n stack.push(stackHead)\n // get the struct reader that has the missing struct\n /**\n * @type {{ refs: Array, i: number }}\n */\n const structRefs = clientsStructRefs.get(/** @type {number} */ (missing)) || { refs: [], i: 0 }\n if (structRefs.refs.length === structRefs.i) {\n // This update message causally depends on another update message that doesn't exist yet\n updateMissingSv(/** @type {number} */ (missing), getState(store, missing))\n addStackToRestSS()\n } else {\n stackHead = structRefs.refs[structRefs.i++]\n continue\n }\n } else if (offset === 0 || offset < stackHead.length) {\n // all fine, apply the stackhead\n stackHead.integrate(transaction, offset)\n state.set(stackHead.id.client, stackHead.id.clock + stackHead.length)\n }\n }\n }\n // iterate to next stackHead\n if (stack.length > 0) {\n stackHead = /** @type {GC|Item} */ (stack.pop())\n } else if (curStructsTarget !== null && curStructsTarget.i < curStructsTarget.refs.length) {\n stackHead = /** @type {GC|Item} */ (curStructsTarget.refs[curStructsTarget.i++])\n } else {\n curStructsTarget = getNextStructTarget()\n if (curStructsTarget === null) {\n // we are done!\n break\n } else {\n stackHead = /** @type {GC|Item} */ (curStructsTarget.refs[curStructsTarget.i++])\n }\n }\n }\n if (restStructs.clients.size > 0) {\n const encoder = new UpdateEncoderV2()\n writeClientsStructs(encoder, restStructs, new Map())\n // write empty deleteset\n // writeDeleteSet(encoder, new DeleteSet())\n encoding.writeVarUint(encoder.restEncoder, 0) // => no need for an extra function call, just write 0 deletes\n return { missing: missingSV, update: encoder.toUint8Array() }\n }\n return null\n}\n\n/**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {Transaction} transaction\n *\n * @private\n * @function\n */\nexport const writeStructsFromTransaction = (encoder, transaction) => writeClientsStructs(encoder, transaction.doc.store, transaction.beforeState)\n\n/**\n * Read and apply a document update.\n *\n * This function has the same effect as `applyUpdate` but accepts a decoder.\n *\n * @param {decoding.Decoder} decoder\n * @param {Doc} ydoc\n * @param {any} [transactionOrigin] This will be stored on `transaction.origin` and `.on('update', (update, origin))`\n * @param {UpdateDecoderV1 | UpdateDecoderV2} [structDecoder]\n *\n * @function\n */\nexport const readUpdateV2 = (decoder, ydoc, transactionOrigin, structDecoder = new UpdateDecoderV2(decoder)) =>\n transact(ydoc, transaction => {\n // force that transaction.local is set to non-local\n transaction.local = false\n let retry = false\n const doc = transaction.doc\n const store = doc.store\n // let start = performance.now()\n const ss = readClientsStructRefs(structDecoder, doc)\n // console.log('time to read structs: ', performance.now() - start) // @todo remove\n // start = performance.now()\n // console.log('time to merge: ', performance.now() - start) // @todo remove\n // start = performance.now()\n const restStructs = integrateStructs(transaction, store, ss)\n const pending = store.pendingStructs\n if (pending) {\n // check if we can apply something\n for (const [client, clock] of pending.missing) {\n if (clock < getState(store, client)) {\n retry = true\n break\n }\n }\n if (restStructs) {\n // merge restStructs into store.pending\n for (const [client, clock] of restStructs.missing) {\n const mclock = pending.missing.get(client)\n if (mclock == null || mclock > clock) {\n pending.missing.set(client, clock)\n }\n }\n pending.update = mergeUpdatesV2([pending.update, restStructs.update])\n }\n } else {\n store.pendingStructs = restStructs\n }\n // console.log('time to integrate: ', performance.now() - start) // @todo remove\n // start = performance.now()\n const dsRest = readAndApplyDeleteSet(structDecoder, transaction, store)\n if (store.pendingDs) {\n // @todo we could make a lower-bound state-vector check as we do above\n const pendingDSUpdate = new UpdateDecoderV2(decoding.createDecoder(store.pendingDs))\n decoding.readVarUint(pendingDSUpdate.restDecoder) // read 0 structs, because we only encode deletes in pendingdsupdate\n const dsRest2 = readAndApplyDeleteSet(pendingDSUpdate, transaction, store)\n if (dsRest && dsRest2) {\n // case 1: ds1 != null && ds2 != null\n store.pendingDs = mergeUpdatesV2([dsRest, dsRest2])\n } else {\n // case 2: ds1 != null\n // case 3: ds2 != null\n // case 4: ds1 == null && ds2 == null\n store.pendingDs = dsRest || dsRest2\n }\n } else {\n // Either dsRest == null && pendingDs == null OR dsRest != null\n store.pendingDs = dsRest\n }\n // console.log('time to cleanup: ', performance.now() - start) // @todo remove\n // start = performance.now()\n\n // console.log('time to resume delete readers: ', performance.now() - start) // @todo remove\n // start = performance.now()\n if (retry) {\n const update = /** @type {{update: Uint8Array}} */ (store.pendingStructs).update\n store.pendingStructs = null\n applyUpdateV2(transaction.doc, update)\n }\n }, transactionOrigin, false)\n\n/**\n * Read and apply a document update.\n *\n * This function has the same effect as `applyUpdate` but accepts a decoder.\n *\n * @param {decoding.Decoder} decoder\n * @param {Doc} ydoc\n * @param {any} [transactionOrigin] This will be stored on `transaction.origin` and `.on('update', (update, origin))`\n *\n * @function\n */\nexport const readUpdate = (decoder, ydoc, transactionOrigin) => readUpdateV2(decoder, ydoc, transactionOrigin, new UpdateDecoderV1(decoder))\n\n/**\n * Apply a document update created by, for example, `y.on('update', update => ..)` or `update = encodeStateAsUpdate()`.\n *\n * This function has the same effect as `readUpdate` but accepts an Uint8Array instead of a Decoder.\n *\n * @param {Doc} ydoc\n * @param {Uint8Array} update\n * @param {any} [transactionOrigin] This will be stored on `transaction.origin` and `.on('update', (update, origin))`\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} [YDecoder]\n *\n * @function\n */\nexport const applyUpdateV2 = (ydoc, update, transactionOrigin, YDecoder = UpdateDecoderV2) => {\n const decoder = decoding.createDecoder(update)\n readUpdateV2(decoder, ydoc, transactionOrigin, new YDecoder(decoder))\n}\n\n/**\n * Apply a document update created by, for example, `y.on('update', update => ..)` or `update = encodeStateAsUpdate()`.\n *\n * This function has the same effect as `readUpdate` but accepts an Uint8Array instead of a Decoder.\n *\n * @param {Doc} ydoc\n * @param {Uint8Array} update\n * @param {any} [transactionOrigin] This will be stored on `transaction.origin` and `.on('update', (update, origin))`\n *\n * @function\n */\nexport const applyUpdate = (ydoc, update, transactionOrigin) => applyUpdateV2(ydoc, update, transactionOrigin, UpdateDecoderV1)\n\n/**\n * Write all the document as a single update message. If you specify the state of the remote client (`targetStateVector`) it will\n * only write the operations that are missing.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {Doc} doc\n * @param {Map} [targetStateVector] The state of the target that receives the update. Leave empty to write all known structs\n *\n * @function\n */\nexport const writeStateAsUpdate = (encoder, doc, targetStateVector = new Map()) => {\n writeClientsStructs(encoder, doc.store, targetStateVector)\n writeDeleteSet(encoder, createDeleteSetFromStructStore(doc.store))\n}\n\n/**\n * Write all the document as a single update message that can be applied on the remote document. If you specify the state of the remote client (`targetState`) it will\n * only write the operations that are missing.\n *\n * Use `writeStateAsUpdate` instead if you are working with lib0/encoding.js#Encoder\n *\n * @param {Doc} doc\n * @param {Uint8Array} [encodedTargetStateVector] The state of the target that receives the update. Leave empty to write all known structs\n * @param {UpdateEncoderV1 | UpdateEncoderV2} [encoder]\n * @return {Uint8Array}\n *\n * @function\n */\nexport const encodeStateAsUpdateV2 = (doc, encodedTargetStateVector = new Uint8Array([0]), encoder = new UpdateEncoderV2()) => {\n const targetStateVector = decodeStateVector(encodedTargetStateVector)\n writeStateAsUpdate(encoder, doc, targetStateVector)\n const updates = [encoder.toUint8Array()]\n // also add the pending updates (if there are any)\n if (doc.store.pendingDs) {\n updates.push(doc.store.pendingDs)\n }\n if (doc.store.pendingStructs) {\n updates.push(diffUpdateV2(doc.store.pendingStructs.update, encodedTargetStateVector))\n }\n if (updates.length > 1) {\n if (encoder.constructor === UpdateEncoderV1) {\n return mergeUpdates(updates.map((update, i) => i === 0 ? update : convertUpdateFormatV2ToV1(update)))\n } else if (encoder.constructor === UpdateEncoderV2) {\n return mergeUpdatesV2(updates)\n }\n }\n return updates[0]\n}\n\n/**\n * Write all the document as a single update message that can be applied on the remote document. If you specify the state of the remote client (`targetState`) it will\n * only write the operations that are missing.\n *\n * Use `writeStateAsUpdate` instead if you are working with lib0/encoding.js#Encoder\n *\n * @param {Doc} doc\n * @param {Uint8Array} [encodedTargetStateVector] The state of the target that receives the update. Leave empty to write all known structs\n * @return {Uint8Array}\n *\n * @function\n */\nexport const encodeStateAsUpdate = (doc, encodedTargetStateVector) => encodeStateAsUpdateV2(doc, encodedTargetStateVector, new UpdateEncoderV1())\n\n/**\n * Read state vector from Decoder and return as Map\n *\n * @param {DSDecoderV1 | DSDecoderV2} decoder\n * @return {Map} Maps `client` to the number next expected `clock` from that client.\n *\n * @function\n */\nexport const readStateVector = decoder => {\n const ss = new Map()\n const ssLength = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < ssLength; i++) {\n const client = decoding.readVarUint(decoder.restDecoder)\n const clock = decoding.readVarUint(decoder.restDecoder)\n ss.set(client, clock)\n }\n return ss\n}\n\n/**\n * Read decodedState and return State as Map.\n *\n * @param {Uint8Array} decodedState\n * @return {Map} Maps `client` to the number next expected `clock` from that client.\n *\n * @function\n */\n// export const decodeStateVectorV2 = decodedState => readStateVector(new DSDecoderV2(decoding.createDecoder(decodedState)))\n\n/**\n * Read decodedState and return State as Map.\n *\n * @param {Uint8Array} decodedState\n * @return {Map} Maps `client` to the number next expected `clock` from that client.\n *\n * @function\n */\nexport const decodeStateVector = decodedState => readStateVector(new DSDecoderV1(decoding.createDecoder(decodedState)))\n\n/**\n * @param {DSEncoderV1 | DSEncoderV2} encoder\n * @param {Map} sv\n * @function\n */\nexport const writeStateVector = (encoder, sv) => {\n encoding.writeVarUint(encoder.restEncoder, sv.size)\n array.from(sv.entries()).sort((a, b) => b[0] - a[0]).forEach(([client, clock]) => {\n encoding.writeVarUint(encoder.restEncoder, client) // @todo use a special client decoder that is based on mapping\n encoding.writeVarUint(encoder.restEncoder, clock)\n })\n return encoder\n}\n\n/**\n * @param {DSEncoderV1 | DSEncoderV2} encoder\n * @param {Doc} doc\n *\n * @function\n */\nexport const writeDocumentStateVector = (encoder, doc) => writeStateVector(encoder, getStateVector(doc.store))\n\n/**\n * Encode State as Uint8Array.\n *\n * @param {Doc|Map} doc\n * @param {DSEncoderV1 | DSEncoderV2} [encoder]\n * @return {Uint8Array}\n *\n * @function\n */\nexport const encodeStateVectorV2 = (doc, encoder = new DSEncoderV2()) => {\n if (doc instanceof Map) {\n writeStateVector(encoder, doc)\n } else {\n writeDocumentStateVector(encoder, doc)\n }\n return encoder.toUint8Array()\n}\n\n/**\n * Encode State as Uint8Array.\n *\n * @param {Doc|Map} doc\n * @return {Uint8Array}\n *\n * @function\n */\nexport const encodeStateVector = doc => encodeStateVectorV2(doc, new DSEncoderV1())\n", "import * as f from 'lib0/function'\n\n/**\n * General event handler implementation.\n *\n * @template ARG0, ARG1\n *\n * @private\n */\nexport class EventHandler {\n constructor () {\n /**\n * @type {Array}\n */\n this.l = []\n }\n}\n\n/**\n * @template ARG0,ARG1\n * @returns {EventHandler}\n *\n * @private\n * @function\n */\nexport const createEventHandler = () => new EventHandler()\n\n/**\n * Adds an event listener that is called when\n * {@link EventHandler#callEventListeners} is called.\n *\n * @template ARG0,ARG1\n * @param {EventHandler} eventHandler\n * @param {function(ARG0,ARG1):void} f The event handler.\n *\n * @private\n * @function\n */\nexport const addEventHandlerListener = (eventHandler, f) =>\n eventHandler.l.push(f)\n\n/**\n * Removes an event listener.\n *\n * @template ARG0,ARG1\n * @param {EventHandler} eventHandler\n * @param {function(ARG0,ARG1):void} f The event handler that was added with\n * {@link EventHandler#addEventListener}\n *\n * @private\n * @function\n */\nexport const removeEventHandlerListener = (eventHandler, f) => {\n const l = eventHandler.l\n const len = l.length\n eventHandler.l = l.filter(g => f !== g)\n if (len === eventHandler.l.length) {\n console.error('[yjs] Tried to remove event handler that doesn\\'t exist.')\n }\n}\n\n/**\n * Removes all event listeners.\n * @template ARG0,ARG1\n * @param {EventHandler} eventHandler\n *\n * @private\n * @function\n */\nexport const removeAllEventHandlerListeners = eventHandler => {\n eventHandler.l.length = 0\n}\n\n/**\n * Call all event listeners that were added via\n * {@link EventHandler#addEventListener}.\n *\n * @template ARG0,ARG1\n * @param {EventHandler} eventHandler\n * @param {ARG0} arg0\n * @param {ARG1} arg1\n *\n * @private\n * @function\n */\nexport const callEventHandlerListeners = (eventHandler, arg0, arg1) =>\n f.callAll(eventHandler.l, [arg0, arg1])\n", "import { AbstractType } from '../internals.js' // eslint-disable-line\n\nimport * as decoding from 'lib0/decoding'\nimport * as encoding from 'lib0/encoding'\nimport * as error from 'lib0/error'\n\nexport class ID {\n /**\n * @param {number} client client id\n * @param {number} clock unique per client id, continuous number\n */\n constructor (client, clock) {\n /**\n * Client id\n * @type {number}\n */\n this.client = client\n /**\n * unique per client id, continuous number\n * @type {number}\n */\n this.clock = clock\n }\n}\n\n/**\n * @param {ID | null} a\n * @param {ID | null} b\n * @return {boolean}\n *\n * @function\n */\nexport const compareIDs = (a, b) => a === b || (a !== null && b !== null && a.client === b.client && a.clock === b.clock)\n\n/**\n * @param {number} client\n * @param {number} clock\n *\n * @private\n * @function\n */\nexport const createID = (client, clock) => new ID(client, clock)\n\n/**\n * @param {encoding.Encoder} encoder\n * @param {ID} id\n *\n * @private\n * @function\n */\nexport const writeID = (encoder, id) => {\n encoding.writeVarUint(encoder, id.client)\n encoding.writeVarUint(encoder, id.clock)\n}\n\n/**\n * Read ID.\n * * If first varUint read is 0xFFFFFF a RootID is returned.\n * * Otherwise an ID is returned\n *\n * @param {decoding.Decoder} decoder\n * @return {ID}\n *\n * @private\n * @function\n */\nexport const readID = decoder =>\n createID(decoding.readVarUint(decoder), decoding.readVarUint(decoder))\n\n/**\n * The top types are mapped from y.share.get(keyname) => type.\n * `type` does not store any information about the `keyname`.\n * This function finds the correct `keyname` for `type` and throws otherwise.\n *\n * @param {AbstractType} type\n * @return {string}\n *\n * @private\n * @function\n */\nexport const findRootTypeKey = type => {\n // @ts-ignore _y must be defined, otherwise unexpected case\n for (const [key, value] of type.doc.share.entries()) {\n if (value === type) {\n return key\n }\n }\n throw error.unexpectedCase()\n}\n", "import { AbstractType, Item } from '../internals.js' // eslint-disable-line\n\n/**\n * Check if `parent` is a parent of `child`.\n *\n * @param {AbstractType} parent\n * @param {Item|null} child\n * @return {Boolean} Whether `parent` is a parent of `child`.\n *\n * @private\n * @function\n */\nexport const isParentOf = (parent, child) => {\n while (child !== null) {\n if (child.parent === parent) {\n return true\n }\n child = /** @type {AbstractType} */ (child.parent)._item\n }\n return false\n}\n", "import {\n AbstractType // eslint-disable-line\n} from '../internals.js'\n\n/**\n * Convenient helper to log type information.\n *\n * Do not use in productive systems as the output can be immense!\n *\n * @param {AbstractType} type\n */\nexport const logType = type => {\n const res = []\n let n = type._start\n while (n) {\n res.push(n)\n n = n.right\n }\n console.log('Children: ', res)\n console.log('Children content: ', res.filter(m => !m.deleted).map(m => m.content))\n}\n", "import {\n YArray,\n YMap,\n readDeleteSet,\n writeDeleteSet,\n createDeleteSet,\n DSEncoderV1, DSDecoderV1, ID, DeleteSet, YArrayEvent, Transaction, Doc // eslint-disable-line\n} from '../internals.js'\n\nimport * as decoding from 'lib0/decoding'\n\nimport { mergeDeleteSets, isDeleted } from './DeleteSet.js'\n\nexport class PermanentUserData {\n /**\n * @param {Doc} doc\n * @param {YMap} [storeType]\n */\n constructor (doc, storeType = doc.getMap('users')) {\n /**\n * @type {Map}\n */\n const dss = new Map()\n this.yusers = storeType\n this.doc = doc\n /**\n * Maps from clientid to userDescription\n *\n * @type {Map}\n */\n this.clients = new Map()\n this.dss = dss\n /**\n * @param {YMap} user\n * @param {string} userDescription\n */\n const initUser = (user, userDescription) => {\n /**\n * @type {YArray}\n */\n const ds = user.get('ds')\n const ids = user.get('ids')\n const addClientId = /** @param {number} clientid */ clientid => this.clients.set(clientid, userDescription)\n ds.observe(/** @param {YArrayEvent} event */ event => {\n event.changes.added.forEach(item => {\n item.content.getContent().forEach(encodedDs => {\n if (encodedDs instanceof Uint8Array) {\n this.dss.set(userDescription, mergeDeleteSets([this.dss.get(userDescription) || createDeleteSet(), readDeleteSet(new DSDecoderV1(decoding.createDecoder(encodedDs)))]))\n }\n })\n })\n })\n this.dss.set(userDescription, mergeDeleteSets(ds.map(encodedDs => readDeleteSet(new DSDecoderV1(decoding.createDecoder(encodedDs))))))\n ids.observe(/** @param {YArrayEvent} event */ event =>\n event.changes.added.forEach(item => item.content.getContent().forEach(addClientId))\n )\n ids.forEach(addClientId)\n }\n // observe users\n storeType.observe(event => {\n event.keysChanged.forEach(userDescription =>\n initUser(storeType.get(userDescription), userDescription)\n )\n })\n // add intial data\n storeType.forEach(initUser)\n }\n\n /**\n * @param {Doc} doc\n * @param {number} clientid\n * @param {string} userDescription\n * @param {Object} conf\n * @param {function(Transaction, DeleteSet):boolean} [conf.filter]\n */\n setUserMapping (doc, clientid, userDescription, { filter = () => true } = {}) {\n const users = this.yusers\n let user = users.get(userDescription)\n if (!user) {\n user = new YMap()\n user.set('ids', new YArray())\n user.set('ds', new YArray())\n users.set(userDescription, user)\n }\n user.get('ids').push([clientid])\n users.observe(_event => {\n setTimeout(() => {\n const userOverwrite = users.get(userDescription)\n if (userOverwrite !== user) {\n // user was overwritten, port all data over to the next user object\n // @todo Experiment with Y.Sets here\n user = userOverwrite\n // @todo iterate over old type\n this.clients.forEach((_userDescription, clientid) => {\n if (userDescription === _userDescription) {\n user.get('ids').push([clientid])\n }\n })\n const encoder = new DSEncoderV1()\n const ds = this.dss.get(userDescription)\n if (ds) {\n writeDeleteSet(encoder, ds)\n user.get('ds').push([encoder.toUint8Array()])\n }\n }\n }, 0)\n })\n doc.on('afterTransaction', /** @param {Transaction} transaction */ transaction => {\n setTimeout(() => {\n const yds = user.get('ds')\n const ds = transaction.deleteSet\n if (transaction.local && ds.clients.size > 0 && filter(transaction, ds)) {\n const encoder = new DSEncoderV1()\n writeDeleteSet(encoder, ds)\n yds.push([encoder.toUint8Array()])\n }\n })\n })\n }\n\n /**\n * @param {number} clientid\n * @return {any}\n */\n getUserByClientId (clientid) {\n return this.clients.get(clientid) || null\n }\n\n /**\n * @param {ID} id\n * @return {string | null}\n */\n getUserByDeletedId (id) {\n for (const [userDescription, ds] of this.dss.entries()) {\n if (isDeleted(ds, id)) {\n return userDescription\n }\n }\n return null\n }\n}\n", "import {\n writeID,\n readID,\n compareIDs,\n getState,\n findRootTypeKey,\n Item,\n createID,\n ContentType,\n followRedone,\n getItem,\n ID, Doc, AbstractType // eslint-disable-line\n} from '../internals.js'\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as error from 'lib0/error'\n\n/**\n * A relative position is based on the Yjs model and is not affected by document changes.\n * E.g. If you place a relative position before a certain character, it will always point to this character.\n * If you place a relative position at the end of a type, it will always point to the end of the type.\n *\n * A numeric position is often unsuited for user selections, because it does not change when content is inserted\n * before or after.\n *\n * ```Insert(0, 'x')('a|bc') = 'xa|bc'``` Where | is the relative position.\n *\n * One of the properties must be defined.\n *\n * @example\n * // Current cursor position is at position 10\n * const relativePosition = createRelativePositionFromIndex(yText, 10)\n * // modify yText\n * yText.insert(0, 'abc')\n * yText.delete(3, 10)\n * // Compute the cursor position\n * const absolutePosition = createAbsolutePositionFromRelativePosition(y, relativePosition)\n * absolutePosition.type === yText // => true\n * console.log('cursor location is ' + absolutePosition.index) // => cursor location is 3\n *\n */\nexport class RelativePosition {\n /**\n * @param {ID|null} type\n * @param {string|null} tname\n * @param {ID|null} item\n * @param {number} assoc\n */\n constructor (type, tname, item, assoc = 0) {\n /**\n * @type {ID|null}\n */\n this.type = type\n /**\n * @type {string|null}\n */\n this.tname = tname\n /**\n * @type {ID | null}\n */\n this.item = item\n /**\n * A relative position is associated to a specific character. By default\n * assoc >= 0, the relative position is associated to the character\n * after the meant position.\n * I.e. position 1 in 'ab' is associated to character 'b'.\n *\n * If assoc < 0, then the relative position is associated to the caharacter\n * before the meant position.\n *\n * @type {number}\n */\n this.assoc = assoc\n }\n}\n\n/**\n * @param {RelativePosition} rpos\n * @return {any}\n */\nexport const relativePositionToJSON = rpos => {\n const json = {}\n if (rpos.type) {\n json.type = rpos.type\n }\n if (rpos.tname) {\n json.tname = rpos.tname\n }\n if (rpos.item) {\n json.item = rpos.item\n }\n if (rpos.assoc != null) {\n json.assoc = rpos.assoc\n }\n return json\n}\n\n/**\n * @param {any} json\n * @return {RelativePosition}\n *\n * @function\n */\nexport const createRelativePositionFromJSON = json => new RelativePosition(json.type == null ? null : createID(json.type.client, json.type.clock), json.tname ?? null, json.item == null ? null : createID(json.item.client, json.item.clock), json.assoc == null ? 0 : json.assoc)\n\nexport class AbsolutePosition {\n /**\n * @param {AbstractType} type\n * @param {number} index\n * @param {number} [assoc]\n */\n constructor (type, index, assoc = 0) {\n /**\n * @type {AbstractType}\n */\n this.type = type\n /**\n * @type {number}\n */\n this.index = index\n this.assoc = assoc\n }\n}\n\n/**\n * @param {AbstractType} type\n * @param {number} index\n * @param {number} [assoc]\n *\n * @function\n */\nexport const createAbsolutePosition = (type, index, assoc = 0) => new AbsolutePosition(type, index, assoc)\n\n/**\n * @param {AbstractType} type\n * @param {ID|null} item\n * @param {number} [assoc]\n *\n * @function\n */\nexport const createRelativePosition = (type, item, assoc) => {\n let typeid = null\n let tname = null\n if (type._item === null) {\n tname = findRootTypeKey(type)\n } else {\n typeid = createID(type._item.id.client, type._item.id.clock)\n }\n return new RelativePosition(typeid, tname, item, assoc)\n}\n\n/**\n * Create a relativePosition based on a absolute position.\n *\n * @param {AbstractType} type The base type (e.g. YText or YArray).\n * @param {number} index The absolute position.\n * @param {number} [assoc]\n * @return {RelativePosition}\n *\n * @function\n */\nexport const createRelativePositionFromTypeIndex = (type, index, assoc = 0) => {\n let t = type._start\n if (assoc < 0) {\n // associated to the left character or the beginning of a type, increment index if possible.\n if (index === 0) {\n return createRelativePosition(type, null, assoc)\n }\n index--\n }\n while (t !== null) {\n if (!t.deleted && t.countable) {\n if (t.length > index) {\n // case 1: found position somewhere in the linked list\n return createRelativePosition(type, createID(t.id.client, t.id.clock + index), assoc)\n }\n index -= t.length\n }\n if (t.right === null && assoc < 0) {\n // left-associated position, return last available id\n return createRelativePosition(type, t.lastId, assoc)\n }\n t = t.right\n }\n return createRelativePosition(type, null, assoc)\n}\n\n/**\n * @param {encoding.Encoder} encoder\n * @param {RelativePosition} rpos\n *\n * @function\n */\nexport const writeRelativePosition = (encoder, rpos) => {\n const { type, tname, item, assoc } = rpos\n if (item !== null) {\n encoding.writeVarUint(encoder, 0)\n writeID(encoder, item)\n } else if (tname !== null) {\n // case 2: found position at the end of the list and type is stored in y.share\n encoding.writeUint8(encoder, 1)\n encoding.writeVarString(encoder, tname)\n } else if (type !== null) {\n // case 3: found position at the end of the list and type is attached to an item\n encoding.writeUint8(encoder, 2)\n writeID(encoder, type)\n } else {\n throw error.unexpectedCase()\n }\n encoding.writeVarInt(encoder, assoc)\n return encoder\n}\n\n/**\n * @param {RelativePosition} rpos\n * @return {Uint8Array}\n */\nexport const encodeRelativePosition = rpos => {\n const encoder = encoding.createEncoder()\n writeRelativePosition(encoder, rpos)\n return encoding.toUint8Array(encoder)\n}\n\n/**\n * @param {decoding.Decoder} decoder\n * @return {RelativePosition}\n *\n * @function\n */\nexport const readRelativePosition = decoder => {\n let type = null\n let tname = null\n let itemID = null\n switch (decoding.readVarUint(decoder)) {\n case 0:\n // case 1: found position somewhere in the linked list\n itemID = readID(decoder)\n break\n case 1:\n // case 2: found position at the end of the list and type is stored in y.share\n tname = decoding.readVarString(decoder)\n break\n case 2: {\n // case 3: found position at the end of the list and type is attached to an item\n type = readID(decoder)\n }\n }\n const assoc = decoding.hasContent(decoder) ? decoding.readVarInt(decoder) : 0\n return new RelativePosition(type, tname, itemID, assoc)\n}\n\n/**\n * @param {Uint8Array} uint8Array\n * @return {RelativePosition}\n */\nexport const decodeRelativePosition = uint8Array => readRelativePosition(decoding.createDecoder(uint8Array))\n\n/**\n * Transform a relative position to an absolute position.\n *\n * If you want to share the relative position with other users, you should set\n * `followUndoneDeletions` to false to get consistent results across all clients.\n *\n * When calculating the absolute position, we try to follow the \"undone deletions\". This yields\n * better results for the user who performed undo. However, only the user who performed the undo\n * will get the better results, the other users don't know which operations recreated a deleted\n * range of content. There is more information in this ticket: https://github.com/yjs/yjs/issues/638\n *\n * @param {RelativePosition} rpos\n * @param {Doc} doc\n * @param {boolean} followUndoneDeletions - whether to follow undone deletions - see https://github.com/yjs/yjs/issues/638\n * @return {AbsolutePosition|null}\n *\n * @function\n */\nexport const createAbsolutePositionFromRelativePosition = (rpos, doc, followUndoneDeletions = true) => {\n const store = doc.store\n const rightID = rpos.item\n const typeID = rpos.type\n const tname = rpos.tname\n const assoc = rpos.assoc\n let type = null\n let index = 0\n if (rightID !== null) {\n if (getState(store, rightID.client) <= rightID.clock) {\n return null\n }\n const res = followUndoneDeletions ? followRedone(store, rightID) : { item: getItem(store, rightID), diff: 0 }\n const right = res.item\n if (!(right instanceof Item)) {\n return null\n }\n type = /** @type {AbstractType} */ (right.parent)\n if (type._item === null || !type._item.deleted) {\n index = (right.deleted || !right.countable) ? 0 : (res.diff + (assoc >= 0 ? 0 : 1)) // adjust position based on left association if necessary\n let n = right.left\n while (n !== null) {\n if (!n.deleted && n.countable) {\n index += n.length\n }\n n = n.left\n }\n }\n } else {\n if (tname !== null) {\n type = doc.get(tname)\n } else if (typeID !== null) {\n if (getState(store, typeID.client) <= typeID.clock) {\n // type does not exist yet\n return null\n }\n const { item } = followUndoneDeletions ? followRedone(store, typeID) : { item: getItem(store, typeID) }\n if (item instanceof Item && item.content instanceof ContentType) {\n type = item.content.type\n } else {\n // struct is garbage collected\n return null\n }\n } else {\n throw error.unexpectedCase()\n }\n if (assoc >= 0) {\n index = type._length\n } else {\n index = 0\n }\n }\n return createAbsolutePosition(type, index, rpos.assoc)\n}\n\n/**\n * @param {RelativePosition|null} a\n * @param {RelativePosition|null} b\n * @return {boolean}\n *\n * @function\n */\nexport const compareRelativePositions = (a, b) => a === b || (\n a !== null && b !== null && a.tname === b.tname && compareIDs(a.item, b.item) && compareIDs(a.type, b.type) && a.assoc === b.assoc\n)\n", "import {\n isDeleted,\n createDeleteSetFromStructStore,\n getStateVector,\n getItemCleanStart,\n iterateDeletedStructs,\n writeDeleteSet,\n writeStateVector,\n readDeleteSet,\n readStateVector,\n createDeleteSet,\n createID,\n getState,\n findIndexSS,\n UpdateEncoderV2,\n applyUpdateV2,\n LazyStructReader,\n equalDeleteSets,\n UpdateDecoderV1, UpdateDecoderV2, DSEncoderV1, DSEncoderV2, DSDecoderV1, DSDecoderV2, Transaction, Doc, DeleteSet, Item, // eslint-disable-line\n mergeDeleteSets\n} from '../internals.js'\n\nimport * as map from 'lib0/map'\nimport * as set from 'lib0/set'\nimport * as decoding from 'lib0/decoding'\nimport * as encoding from 'lib0/encoding'\n\nexport class Snapshot {\n /**\n * @param {DeleteSet} ds\n * @param {Map} sv state map\n */\n constructor (ds, sv) {\n /**\n * @type {DeleteSet}\n */\n this.ds = ds\n /**\n * State Map\n * @type {Map}\n */\n this.sv = sv\n }\n}\n\n/**\n * @param {Snapshot} snap1\n * @param {Snapshot} snap2\n * @return {boolean}\n */\nexport const equalSnapshots = (snap1, snap2) => {\n const ds1 = snap1.ds.clients\n const ds2 = snap2.ds.clients\n const sv1 = snap1.sv\n const sv2 = snap2.sv\n if (sv1.size !== sv2.size || ds1.size !== ds2.size) {\n return false\n }\n for (const [key, value] of sv1.entries()) {\n if (sv2.get(key) !== value) {\n return false\n }\n }\n for (const [client, dsitems1] of ds1.entries()) {\n const dsitems2 = ds2.get(client) || []\n if (dsitems1.length !== dsitems2.length) {\n return false\n }\n for (let i = 0; i < dsitems1.length; i++) {\n const dsitem1 = dsitems1[i]\n const dsitem2 = dsitems2[i]\n if (dsitem1.clock !== dsitem2.clock || dsitem1.len !== dsitem2.len) {\n return false\n }\n }\n }\n return true\n}\n\n/**\n * @param {Snapshot} snapshot\n * @param {DSEncoderV1 | DSEncoderV2} [encoder]\n * @return {Uint8Array}\n */\nexport const encodeSnapshotV2 = (snapshot, encoder = new DSEncoderV2()) => {\n writeDeleteSet(encoder, snapshot.ds)\n writeStateVector(encoder, snapshot.sv)\n return encoder.toUint8Array()\n}\n\n/**\n * @param {Snapshot} snapshot\n * @return {Uint8Array}\n */\nexport const encodeSnapshot = snapshot => encodeSnapshotV2(snapshot, new DSEncoderV1())\n\n/**\n * @param {Uint8Array} buf\n * @param {DSDecoderV1 | DSDecoderV2} [decoder]\n * @return {Snapshot}\n */\nexport const decodeSnapshotV2 = (buf, decoder = new DSDecoderV2(decoding.createDecoder(buf))) => {\n return new Snapshot(readDeleteSet(decoder), readStateVector(decoder))\n}\n\n/**\n * @param {Uint8Array} buf\n * @return {Snapshot}\n */\nexport const decodeSnapshot = buf => decodeSnapshotV2(buf, new DSDecoderV1(decoding.createDecoder(buf)))\n\n/**\n * @param {DeleteSet} ds\n * @param {Map} sm\n * @return {Snapshot}\n */\nexport const createSnapshot = (ds, sm) => new Snapshot(ds, sm)\n\nexport const emptySnapshot = createSnapshot(createDeleteSet(), new Map())\n\n/**\n * @param {Doc} doc\n * @return {Snapshot}\n */\nexport const snapshot = doc => createSnapshot(createDeleteSetFromStructStore(doc.store), getStateVector(doc.store))\n\n/**\n * @param {Item} item\n * @param {Snapshot|undefined} snapshot\n *\n * @protected\n * @function\n */\nexport const isVisible = (item, snapshot) => snapshot === undefined\n ? !item.deleted\n : snapshot.sv.has(item.id.client) && (snapshot.sv.get(item.id.client) || 0) > item.id.clock && !isDeleted(snapshot.ds, item.id)\n\n/**\n * @param {Transaction} transaction\n * @param {Snapshot} snapshot\n */\nexport const splitSnapshotAffectedStructs = (transaction, snapshot) => {\n const meta = map.setIfUndefined(transaction.meta, splitSnapshotAffectedStructs, set.create)\n const store = transaction.doc.store\n // check if we already split for this snapshot\n if (!meta.has(snapshot)) {\n snapshot.sv.forEach((clock, client) => {\n if (clock < getState(store, client)) {\n getItemCleanStart(transaction, createID(client, clock))\n }\n })\n iterateDeletedStructs(transaction, snapshot.ds, _item => {})\n meta.add(snapshot)\n }\n}\n\n/**\n * @example\n * const ydoc = new Y.Doc({ gc: false })\n * ydoc.getText().insert(0, 'world!')\n * const snapshot = Y.snapshot(ydoc)\n * ydoc.getText().insert(0, 'hello ')\n * const restored = Y.createDocFromSnapshot(ydoc, snapshot)\n * assert(restored.getText().toString() === 'world!')\n *\n * @param {Doc} originDoc\n * @param {Snapshot} snapshot\n * @param {Doc} [newDoc] Optionally, you may define the Yjs document that receives the data from originDoc\n * @return {Doc}\n */\nexport const createDocFromSnapshot = (originDoc, snapshot, newDoc = new Doc()) => {\n if (originDoc.gc) {\n // we should not try to restore a GC-ed document, because some of the restored items might have their content deleted\n throw new Error('Garbage-collection must be disabled in `originDoc`!')\n }\n const { sv, ds } = snapshot\n\n const encoder = new UpdateEncoderV2()\n originDoc.transact(transaction => {\n let size = 0\n sv.forEach(clock => {\n if (clock > 0) {\n size++\n }\n })\n encoding.writeVarUint(encoder.restEncoder, size)\n // splitting the structs before writing them to the encoder\n for (const [client, clock] of sv) {\n if (clock === 0) {\n continue\n }\n if (clock < getState(originDoc.store, client)) {\n getItemCleanStart(transaction, createID(client, clock))\n }\n const structs = originDoc.store.clients.get(client) || []\n const lastStructIndex = findIndexSS(structs, clock - 1)\n // write # encoded structs\n encoding.writeVarUint(encoder.restEncoder, lastStructIndex + 1)\n encoder.writeClient(client)\n // first clock written is 0\n encoding.writeVarUint(encoder.restEncoder, 0)\n for (let i = 0; i <= lastStructIndex; i++) {\n structs[i].write(encoder, 0)\n }\n }\n writeDeleteSet(encoder, ds)\n })\n\n applyUpdateV2(newDoc, encoder.toUint8Array(), 'snapshot')\n return newDoc\n}\n\n/**\n * @param {Snapshot} snapshot\n * @param {Uint8Array} update\n * @param {typeof UpdateDecoderV2 | typeof UpdateDecoderV1} [YDecoder]\n */\nexport const snapshotContainsUpdateV2 = (snapshot, update, YDecoder = UpdateDecoderV2) => {\n const structs = []\n const updateDecoder = new YDecoder(decoding.createDecoder(update))\n const lazyDecoder = new LazyStructReader(updateDecoder, false)\n for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) {\n structs.push(curr)\n if ((snapshot.sv.get(curr.id.client) || 0) < curr.id.clock + curr.length) {\n return false\n }\n }\n const mergedDS = mergeDeleteSets([snapshot.ds, readDeleteSet(updateDecoder)])\n return equalDeleteSets(snapshot.ds, mergedDS)\n}\n\n/**\n * @param {Snapshot} snapshot\n * @param {Uint8Array} update\n */\nexport const snapshotContainsUpdate = (snapshot, update) => snapshotContainsUpdateV2(snapshot, update, UpdateDecoderV1)\n", "import {\n GC,\n splitItem,\n Transaction, ID, Item, DSDecoderV2 // eslint-disable-line\n} from '../internals.js'\n\nimport * as math from 'lib0/math'\nimport * as error from 'lib0/error'\n\nexport class StructStore {\n constructor () {\n /**\n * @type {Map>}\n */\n this.clients = new Map()\n /**\n * @type {null | { missing: Map, update: Uint8Array }}\n */\n this.pendingStructs = null\n /**\n * @type {null | Uint8Array}\n */\n this.pendingDs = null\n }\n}\n\n/**\n * Return the states as a Map.\n * Note that clock refers to the next expected clock id.\n *\n * @param {StructStore} store\n * @return {Map}\n *\n * @public\n * @function\n */\nexport const getStateVector = store => {\n const sm = new Map()\n store.clients.forEach((structs, client) => {\n const struct = structs[structs.length - 1]\n sm.set(client, struct.id.clock + struct.length)\n })\n return sm\n}\n\n/**\n * @param {StructStore} store\n * @param {number} client\n * @return {number}\n *\n * @public\n * @function\n */\nexport const getState = (store, client) => {\n const structs = store.clients.get(client)\n if (structs === undefined) {\n return 0\n }\n const lastStruct = structs[structs.length - 1]\n return lastStruct.id.clock + lastStruct.length\n}\n\n/**\n * @param {StructStore} store\n *\n * @private\n * @function\n */\nexport const integretyCheck = store => {\n store.clients.forEach(structs => {\n for (let i = 1; i < structs.length; i++) {\n const l = structs[i - 1]\n const r = structs[i]\n if (l.id.clock + l.length !== r.id.clock) {\n throw new Error('StructStore failed integrety check')\n }\n }\n })\n}\n\n/**\n * @param {StructStore} store\n * @param {GC|Item} struct\n *\n * @private\n * @function\n */\nexport const addStruct = (store, struct) => {\n let structs = store.clients.get(struct.id.client)\n if (structs === undefined) {\n structs = []\n store.clients.set(struct.id.client, structs)\n } else {\n const lastStruct = structs[structs.length - 1]\n if (lastStruct.id.clock + lastStruct.length !== struct.id.clock) {\n throw error.unexpectedCase()\n }\n }\n structs.push(struct)\n}\n\n/**\n * Perform a binary search on a sorted array\n * @param {Array} structs\n * @param {number} clock\n * @return {number}\n *\n * @private\n * @function\n */\nexport const findIndexSS = (structs, clock) => {\n let left = 0\n let right = structs.length - 1\n let mid = structs[right]\n let midclock = mid.id.clock\n if (midclock === clock) {\n return right\n }\n // @todo does it even make sense to pivot the search?\n // If a good split misses, it might actually increase the time to find the correct item.\n // Currently, the only advantage is that search with pivoting might find the item on the first try.\n let midindex = math.floor((clock / (midclock + mid.length - 1)) * right) // pivoting the search\n while (left <= right) {\n mid = structs[midindex]\n midclock = mid.id.clock\n if (midclock <= clock) {\n if (clock < midclock + mid.length) {\n return midindex\n }\n left = midindex + 1\n } else {\n right = midindex - 1\n }\n midindex = math.floor((left + right) / 2)\n }\n // Always check state before looking for a struct in StructStore\n // Therefore the case of not finding a struct is unexpected\n throw error.unexpectedCase()\n}\n\n/**\n * Expects that id is actually in store. This function throws or is an infinite loop otherwise.\n *\n * @param {StructStore} store\n * @param {ID} id\n * @return {GC|Item}\n *\n * @private\n * @function\n */\nexport const find = (store, id) => {\n /**\n * @type {Array}\n */\n // @ts-ignore\n const structs = store.clients.get(id.client)\n return structs[findIndexSS(structs, id.clock)]\n}\n\n/**\n * Expects that id is actually in store. This function throws or is an infinite loop otherwise.\n * @private\n * @function\n */\nexport const getItem = /** @type {function(StructStore,ID):Item} */ (find)\n\n/**\n * @param {Transaction} transaction\n * @param {Array} structs\n * @param {number} clock\n */\nexport const findIndexCleanStart = (transaction, structs, clock) => {\n const index = findIndexSS(structs, clock)\n const struct = structs[index]\n if (struct.id.clock < clock && struct instanceof Item) {\n structs.splice(index + 1, 0, splitItem(transaction, struct, clock - struct.id.clock))\n return index + 1\n }\n return index\n}\n\n/**\n * Expects that id is actually in store. This function throws or is an infinite loop otherwise.\n *\n * @param {Transaction} transaction\n * @param {ID} id\n * @return {Item}\n *\n * @private\n * @function\n */\nexport const getItemCleanStart = (transaction, id) => {\n const structs = /** @type {Array} */ (transaction.doc.store.clients.get(id.client))\n return structs[findIndexCleanStart(transaction, structs, id.clock)]\n}\n\n/**\n * Expects that id is actually in store. This function throws or is an infinite loop otherwise.\n *\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @param {ID} id\n * @return {Item}\n *\n * @private\n * @function\n */\nexport const getItemCleanEnd = (transaction, store, id) => {\n /**\n * @type {Array}\n */\n // @ts-ignore\n const structs = store.clients.get(id.client)\n const index = findIndexSS(structs, id.clock)\n const struct = structs[index]\n if (id.clock !== struct.id.clock + struct.length - 1 && struct.constructor !== GC) {\n structs.splice(index + 1, 0, splitItem(transaction, struct, id.clock - struct.id.clock + 1))\n }\n return struct\n}\n\n/**\n * Replace `item` with `newitem` in store\n * @param {StructStore} store\n * @param {GC|Item} struct\n * @param {GC|Item} newStruct\n *\n * @private\n * @function\n */\nexport const replaceStruct = (store, struct, newStruct) => {\n const structs = /** @type {Array} */ (store.clients.get(struct.id.client))\n structs[findIndexSS(structs, struct.id.clock)] = newStruct\n}\n\n/**\n * Iterate over a range of structs\n *\n * @param {Transaction} transaction\n * @param {Array} structs\n * @param {number} clockStart Inclusive start\n * @param {number} len\n * @param {function(GC|Item):void} f\n *\n * @function\n */\nexport const iterateStructs = (transaction, structs, clockStart, len, f) => {\n if (len === 0) {\n return\n }\n const clockEnd = clockStart + len\n let index = findIndexCleanStart(transaction, structs, clockStart)\n let struct\n do {\n struct = structs[index++]\n if (clockEnd < struct.id.clock + struct.length) {\n findIndexCleanStart(transaction, structs, clockEnd)\n }\n f(struct)\n } while (index < structs.length && structs[index].id.clock < clockEnd)\n}\n", "import {\n getState,\n writeStructsFromTransaction,\n writeDeleteSet,\n DeleteSet,\n sortAndMergeDeleteSet,\n getStateVector,\n findIndexSS,\n callEventHandlerListeners,\n Item,\n generateNewClientId,\n createID,\n cleanupYTextAfterTransaction,\n UpdateEncoderV1, UpdateEncoderV2, GC, StructStore, AbstractType, AbstractStruct, YEvent, Doc // eslint-disable-line\n} from '../internals.js'\n\nimport * as map from 'lib0/map'\nimport * as math from 'lib0/math'\nimport * as set from 'lib0/set'\nimport * as logging from 'lib0/logging'\nimport { callAll } from 'lib0/function'\n\n/**\n * A transaction is created for every change on the Yjs model. It is possible\n * to bundle changes on the Yjs model in a single transaction to\n * minimize the number on messages sent and the number of observer calls.\n * If possible the user of this library should bundle as many changes as\n * possible. Here is an example to illustrate the advantages of bundling:\n *\n * @example\n * const ydoc = new Y.Doc()\n * const map = ydoc.getMap('map')\n * // Log content when change is triggered\n * map.observe(() => {\n * console.log('change triggered')\n * })\n * // Each change on the map type triggers a log message:\n * map.set('a', 0) // => \"change triggered\"\n * map.set('b', 0) // => \"change triggered\"\n * // When put in a transaction, it will trigger the log after the transaction:\n * ydoc.transact(() => {\n * map.set('a', 1)\n * map.set('b', 1)\n * }) // => \"change triggered\"\n *\n * @public\n */\nexport class Transaction {\n /**\n * @param {Doc} doc\n * @param {any} origin\n * @param {boolean} local\n */\n constructor (doc, origin, local) {\n /**\n * The Yjs instance.\n * @type {Doc}\n */\n this.doc = doc\n /**\n * Describes the set of deleted items by ids\n * @type {DeleteSet}\n */\n this.deleteSet = new DeleteSet()\n /**\n * Holds the state before the transaction started.\n * @type {Map}\n */\n this.beforeState = getStateVector(doc.store)\n /**\n * Holds the state after the transaction.\n * @type {Map}\n */\n this.afterState = new Map()\n /**\n * All types that were directly modified (property added or child\n * inserted/deleted). New types are not included in this Set.\n * Maps from type to parentSubs (`item.parentSub = null` for YArray)\n * @type {Map>,Set>}\n */\n this.changed = new Map()\n /**\n * Stores the events for the types that observe also child elements.\n * It is mainly used by `observeDeep`.\n * @type {Map>,Array>>}\n */\n this.changedParentTypes = new Map()\n /**\n * @type {Array}\n */\n this._mergeStructs = []\n /**\n * @type {any}\n */\n this.origin = origin\n /**\n * Stores meta information on the transaction\n * @type {Map}\n */\n this.meta = new Map()\n /**\n * Whether this change originates from this doc.\n * @type {boolean}\n */\n this.local = local\n /**\n * @type {Set}\n */\n this.subdocsAdded = new Set()\n /**\n * @type {Set}\n */\n this.subdocsRemoved = new Set()\n /**\n * @type {Set}\n */\n this.subdocsLoaded = new Set()\n /**\n * @type {boolean}\n */\n this._needFormattingCleanup = false\n }\n}\n\n/**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {Transaction} transaction\n * @return {boolean} Whether data was written.\n */\nexport const writeUpdateMessageFromTransaction = (encoder, transaction) => {\n if (transaction.deleteSet.clients.size === 0 && !map.any(transaction.afterState, (clock, client) => transaction.beforeState.get(client) !== clock)) {\n return false\n }\n sortAndMergeDeleteSet(transaction.deleteSet)\n writeStructsFromTransaction(encoder, transaction)\n writeDeleteSet(encoder, transaction.deleteSet)\n return true\n}\n\n/**\n * @param {Transaction} transaction\n *\n * @private\n * @function\n */\nexport const nextID = transaction => {\n const y = transaction.doc\n return createID(y.clientID, getState(y.store, y.clientID))\n}\n\n/**\n * If `type.parent` was added in current transaction, `type` technically\n * did not change, it was just added and we should not fire events for `type`.\n *\n * @param {Transaction} transaction\n * @param {AbstractType>} type\n * @param {string|null} parentSub\n */\nexport const addChangedTypeToTransaction = (transaction, type, parentSub) => {\n const item = type._item\n if (item === null || (item.id.clock < (transaction.beforeState.get(item.id.client) || 0) && !item.deleted)) {\n map.setIfUndefined(transaction.changed, type, set.create).add(parentSub)\n }\n}\n\n/**\n * @param {Array} structs\n * @param {number} pos\n * @return {number} # of merged structs\n */\nconst tryToMergeWithLefts = (structs, pos) => {\n let right = structs[pos]\n let left = structs[pos - 1]\n let i = pos\n for (; i > 0; right = left, left = structs[--i - 1]) {\n if (left.deleted === right.deleted && left.constructor === right.constructor) {\n if (left.mergeWith(right)) {\n if (right instanceof Item && right.parentSub !== null && /** @type {AbstractType} */ (right.parent)._map.get(right.parentSub) === right) {\n /** @type {AbstractType} */ (right.parent)._map.set(right.parentSub, /** @type {Item} */ (left))\n }\n continue\n }\n }\n break\n }\n const merged = pos - i\n if (merged) {\n // remove all merged structs from the array\n structs.splice(pos + 1 - merged, merged)\n }\n return merged\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {StructStore} store\n * @param {function(Item):boolean} gcFilter\n */\nconst tryGcDeleteSet = (ds, store, gcFilter) => {\n for (const [client, deleteItems] of ds.clients.entries()) {\n const structs = /** @type {Array} */ (store.clients.get(client))\n for (let di = deleteItems.length - 1; di >= 0; di--) {\n const deleteItem = deleteItems[di]\n const endDeleteItemClock = deleteItem.clock + deleteItem.len\n for (\n let si = findIndexSS(structs, deleteItem.clock), struct = structs[si];\n si < structs.length && struct.id.clock < endDeleteItemClock;\n struct = structs[++si]\n ) {\n const struct = structs[si]\n if (deleteItem.clock + deleteItem.len <= struct.id.clock) {\n break\n }\n if (struct instanceof Item && struct.deleted && !struct.keep && gcFilter(struct)) {\n struct.gc(store, false)\n }\n }\n }\n }\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {StructStore} store\n */\nconst tryMergeDeleteSet = (ds, store) => {\n // try to merge deleted / gc'd items\n // merge from right to left for better efficiency and so we don't miss any merge targets\n ds.clients.forEach((deleteItems, client) => {\n const structs = /** @type {Array} */ (store.clients.get(client))\n for (let di = deleteItems.length - 1; di >= 0; di--) {\n const deleteItem = deleteItems[di]\n // start with merging the item next to the last deleted item\n const mostRightIndexToCheck = math.min(structs.length - 1, 1 + findIndexSS(structs, deleteItem.clock + deleteItem.len - 1))\n for (\n let si = mostRightIndexToCheck, struct = structs[si];\n si > 0 && struct.id.clock >= deleteItem.clock;\n struct = structs[si]\n ) {\n si -= 1 + tryToMergeWithLefts(structs, si)\n }\n }\n })\n}\n\n/**\n * @param {DeleteSet} ds\n * @param {StructStore} store\n * @param {function(Item):boolean} gcFilter\n */\nexport const tryGc = (ds, store, gcFilter) => {\n tryGcDeleteSet(ds, store, gcFilter)\n tryMergeDeleteSet(ds, store)\n}\n\n/**\n * @param {Array} transactionCleanups\n * @param {number} i\n */\nconst cleanupTransactions = (transactionCleanups, i) => {\n if (i < transactionCleanups.length) {\n const transaction = transactionCleanups[i]\n const doc = transaction.doc\n const store = doc.store\n const ds = transaction.deleteSet\n const mergeStructs = transaction._mergeStructs\n try {\n sortAndMergeDeleteSet(ds)\n transaction.afterState = getStateVector(transaction.doc.store)\n doc.emit('beforeObserverCalls', [transaction, doc])\n /**\n * An array of event callbacks.\n *\n * Each callback is called even if the other ones throw errors.\n *\n * @type {Array}\n */\n const fs = []\n // observe events on changed types\n transaction.changed.forEach((subs, itemtype) =>\n fs.push(() => {\n if (itemtype._item === null || !itemtype._item.deleted) {\n itemtype._callObserver(transaction, subs)\n }\n })\n )\n fs.push(() => {\n // deep observe events\n transaction.changedParentTypes.forEach((events, type) => {\n // We need to think about the possibility that the user transforms the\n // Y.Doc in the event.\n if (type._dEH.l.length > 0 && (type._item === null || !type._item.deleted)) {\n events = events\n .filter(event =>\n event.target._item === null || !event.target._item.deleted\n )\n events\n .forEach(event => {\n event.currentTarget = type\n // path is relative to the current target\n event._path = null\n })\n // sort events by path length so that top-level events are fired first.\n events\n .sort((event1, event2) => event1.path.length - event2.path.length)\n // We don't need to check for events.length\n // because we know it has at least one element\n callEventHandlerListeners(type._dEH, events, transaction)\n }\n })\n })\n fs.push(() => doc.emit('afterTransaction', [transaction, doc]))\n callAll(fs, [])\n if (transaction._needFormattingCleanup) {\n cleanupYTextAfterTransaction(transaction)\n }\n } finally {\n // Replace deleted items with ItemDeleted / GC.\n // This is where content is actually remove from the Yjs Doc.\n if (doc.gc) {\n tryGcDeleteSet(ds, store, doc.gcFilter)\n }\n tryMergeDeleteSet(ds, store)\n\n // on all affected store.clients props, try to merge\n transaction.afterState.forEach((clock, client) => {\n const beforeClock = transaction.beforeState.get(client) || 0\n if (beforeClock !== clock) {\n const structs = /** @type {Array} */ (store.clients.get(client))\n // we iterate from right to left so we can safely remove entries\n const firstChangePos = math.max(findIndexSS(structs, beforeClock), 1)\n for (let i = structs.length - 1; i >= firstChangePos;) {\n i -= 1 + tryToMergeWithLefts(structs, i)\n }\n }\n })\n // try to merge mergeStructs\n // @todo: it makes more sense to transform mergeStructs to a DS, sort it, and merge from right to left\n // but at the moment DS does not handle duplicates\n for (let i = mergeStructs.length - 1; i >= 0; i--) {\n const { client, clock } = mergeStructs[i].id\n const structs = /** @type {Array} */ (store.clients.get(client))\n const replacedStructPos = findIndexSS(structs, clock)\n if (replacedStructPos + 1 < structs.length) {\n if (tryToMergeWithLefts(structs, replacedStructPos + 1) > 1) {\n continue // no need to perform next check, both are already merged\n }\n }\n if (replacedStructPos > 0) {\n tryToMergeWithLefts(structs, replacedStructPos)\n }\n }\n if (!transaction.local && transaction.afterState.get(doc.clientID) !== transaction.beforeState.get(doc.clientID)) {\n logging.print(logging.ORANGE, logging.BOLD, '[yjs] ', logging.UNBOLD, logging.RED, 'Changed the client-id because another client seems to be using it.')\n doc.clientID = generateNewClientId()\n }\n // @todo Merge all the transactions into one and provide send the data as a single update message\n doc.emit('afterTransactionCleanup', [transaction, doc])\n if (doc._observers.has('update')) {\n const encoder = new UpdateEncoderV1()\n const hasContent = writeUpdateMessageFromTransaction(encoder, transaction)\n if (hasContent) {\n doc.emit('update', [encoder.toUint8Array(), transaction.origin, doc, transaction])\n }\n }\n if (doc._observers.has('updateV2')) {\n const encoder = new UpdateEncoderV2()\n const hasContent = writeUpdateMessageFromTransaction(encoder, transaction)\n if (hasContent) {\n doc.emit('updateV2', [encoder.toUint8Array(), transaction.origin, doc, transaction])\n }\n }\n const { subdocsAdded, subdocsLoaded, subdocsRemoved } = transaction\n if (subdocsAdded.size > 0 || subdocsRemoved.size > 0 || subdocsLoaded.size > 0) {\n subdocsAdded.forEach(subdoc => {\n subdoc.clientID = doc.clientID\n if (subdoc.collectionid == null) {\n subdoc.collectionid = doc.collectionid\n }\n doc.subdocs.add(subdoc)\n })\n subdocsRemoved.forEach(subdoc => doc.subdocs.delete(subdoc))\n doc.emit('subdocs', [{ loaded: subdocsLoaded, added: subdocsAdded, removed: subdocsRemoved }, doc, transaction])\n subdocsRemoved.forEach(subdoc => subdoc.destroy())\n }\n\n if (transactionCleanups.length <= i + 1) {\n doc._transactionCleanups = []\n doc.emit('afterAllTransactions', [doc, transactionCleanups])\n } else {\n cleanupTransactions(transactionCleanups, i + 1)\n }\n }\n }\n}\n\n/**\n * Implements the functionality of `y.transact(()=>{..})`\n *\n * @template T\n * @param {Doc} doc\n * @param {function(Transaction):T} f\n * @param {any} [origin=true]\n * @return {T}\n *\n * @function\n */\nexport const transact = (doc, f, origin = null, local = true) => {\n const transactionCleanups = doc._transactionCleanups\n let initialCall = false\n /**\n * @type {any}\n */\n let result = null\n if (doc._transaction === null) {\n initialCall = true\n doc._transaction = new Transaction(doc, origin, local)\n transactionCleanups.push(doc._transaction)\n if (transactionCleanups.length === 1) {\n doc.emit('beforeAllTransactions', [doc])\n }\n doc.emit('beforeTransaction', [doc._transaction, doc])\n }\n try {\n result = f(doc._transaction)\n } finally {\n if (initialCall) {\n const finishCleanup = doc._transaction === transactionCleanups[0]\n doc._transaction = null\n if (finishCleanup) {\n // The first transaction ended, now process observer calls.\n // Observer call may create new transactions for which we need to call the observers and do cleanup.\n // We don't want to nest these calls, so we execute these calls one after\n // another.\n // Also we need to ensure that all cleanups are called, even if the\n // observes throw errors.\n // This file is full of hacky try {} finally {} blocks to ensure that an\n // event can throw errors and also that the cleanup is called.\n cleanupTransactions(transactionCleanups, 0)\n }\n }\n }\n return result\n}\n", "import {\n mergeDeleteSets,\n iterateDeletedStructs,\n keepItem,\n transact,\n createID,\n redoItem,\n isParentOf,\n followRedone,\n getItemCleanStart,\n isDeleted,\n addToDeleteSet,\n YEvent, Transaction, Doc, Item, GC, DeleteSet, AbstractType // eslint-disable-line\n} from '../internals.js'\n\nimport * as time from 'lib0/time'\nimport * as array from 'lib0/array'\nimport * as logging from 'lib0/logging'\nimport { ObservableV2 } from 'lib0/observable'\n\nexport class StackItem {\n /**\n * @param {DeleteSet} deletions\n * @param {DeleteSet} insertions\n */\n constructor (deletions, insertions) {\n this.insertions = insertions\n this.deletions = deletions\n /**\n * Use this to save and restore metadata like selection range\n */\n this.meta = new Map()\n }\n}\n/**\n * @param {Transaction} tr\n * @param {UndoManager} um\n * @param {StackItem} stackItem\n */\nconst clearUndoManagerStackItem = (tr, um, stackItem) => {\n iterateDeletedStructs(tr, stackItem.deletions, item => {\n if (item instanceof Item && um.scope.some(type => isParentOf(type, item))) {\n keepItem(item, false)\n }\n })\n}\n\n/**\n * @param {UndoManager} undoManager\n * @param {Array} stack\n * @param {'undo'|'redo'} eventType\n * @return {StackItem?}\n */\nconst popStackItem = (undoManager, stack, eventType) => {\n /**\n * Keep a reference to the transaction so we can fire the event with the changedParentTypes\n * @type {any}\n */\n let _tr = null\n const doc = undoManager.doc\n const scope = undoManager.scope\n transact(doc, transaction => {\n while (stack.length > 0 && undoManager.currStackItem === null) {\n const store = doc.store\n const stackItem = /** @type {StackItem} */ (stack.pop())\n /**\n * @type {Set}\n */\n const itemsToRedo = new Set()\n /**\n * @type {Array}\n */\n const itemsToDelete = []\n let performedChange = false\n iterateDeletedStructs(transaction, stackItem.insertions, struct => {\n if (struct instanceof Item) {\n if (struct.redone !== null) {\n let { item, diff } = followRedone(store, struct.id)\n if (diff > 0) {\n item = getItemCleanStart(transaction, createID(item.id.client, item.id.clock + diff))\n }\n struct = item\n }\n if (!struct.deleted && scope.some(type => isParentOf(type, /** @type {Item} */ (struct)))) {\n itemsToDelete.push(struct)\n }\n }\n })\n iterateDeletedStructs(transaction, stackItem.deletions, struct => {\n if (\n struct instanceof Item &&\n scope.some(type => isParentOf(type, struct)) &&\n // Never redo structs in stackItem.insertions because they were created and deleted in the same capture interval.\n !isDeleted(stackItem.insertions, struct.id)\n ) {\n itemsToRedo.add(struct)\n }\n })\n itemsToRedo.forEach(struct => {\n performedChange = redoItem(transaction, struct, itemsToRedo, stackItem.insertions, undoManager.ignoreRemoteMapChanges, undoManager) !== null || performedChange\n })\n // We want to delete in reverse order so that children are deleted before\n // parents, so we have more information available when items are filtered.\n for (let i = itemsToDelete.length - 1; i >= 0; i--) {\n const item = itemsToDelete[i]\n if (undoManager.deleteFilter(item)) {\n item.delete(transaction)\n performedChange = true\n }\n }\n undoManager.currStackItem = performedChange ? stackItem : null\n }\n transaction.changed.forEach((subProps, type) => {\n // destroy search marker if necessary\n if (subProps.has(null) && type._searchMarker) {\n type._searchMarker.length = 0\n }\n })\n _tr = transaction\n }, undoManager)\n const res = undoManager.currStackItem\n if (res != null) {\n const changedParentTypes = _tr.changedParentTypes\n undoManager.emit('stack-item-popped', [{ stackItem: res, type: eventType, changedParentTypes, origin: undoManager }, undoManager])\n undoManager.currStackItem = null\n }\n return res\n}\n\n/**\n * @typedef {Object} UndoManagerOptions\n * @property {number} [UndoManagerOptions.captureTimeout=500]\n * @property {function(Transaction):boolean} [UndoManagerOptions.captureTransaction] Do not capture changes of a Transaction if result false.\n * @property {function(Item):boolean} [UndoManagerOptions.deleteFilter=()=>true] Sometimes\n * it is necessary to filter what an Undo/Redo operation can delete. If this\n * filter returns false, the type/item won't be deleted even it is in the\n * undo/redo scope.\n * @property {Set} [UndoManagerOptions.trackedOrigins=new Set([null])]\n * @property {boolean} [ignoreRemoteMapChanges] Experimental. By default, the UndoManager will never overwrite remote changes. Enable this property to enable overwriting remote changes on key-value changes (Y.Map, properties on Y.Xml, etc..).\n * @property {Doc} [doc] The document that this UndoManager operates on. Only needed if typeScope is empty.\n */\n\n/**\n * @typedef {Object} StackItemEvent\n * @property {StackItem} StackItemEvent.stackItem\n * @property {any} StackItemEvent.origin\n * @property {'undo'|'redo'} StackItemEvent.type\n * @property {Map>,Array>>} StackItemEvent.changedParentTypes\n */\n\n/**\n * Fires 'stack-item-added' event when a stack item was added to either the undo- or\n * the redo-stack. You may store additional stack information via the\n * metadata property on `event.stackItem.meta` (it is a `Map` of metadata properties).\n * Fires 'stack-item-popped' event when a stack item was popped from either the\n * undo- or the redo-stack. You may restore the saved stack information from `event.stackItem.meta`.\n *\n * @extends {ObservableV2<{'stack-item-added':function(StackItemEvent, UndoManager):void, 'stack-item-popped': function(StackItemEvent, UndoManager):void, 'stack-cleared': function({ undoStackCleared: boolean, redoStackCleared: boolean }):void, 'stack-item-updated': function(StackItemEvent, UndoManager):void }>}\n */\nexport class UndoManager extends ObservableV2 {\n /**\n * @param {AbstractType|Array>} typeScope Accepts either a single type, or an array of types\n * @param {UndoManagerOptions} options\n */\n constructor (typeScope, {\n captureTimeout = 500,\n captureTransaction = _tr => true,\n deleteFilter = () => true,\n trackedOrigins = new Set([null]),\n ignoreRemoteMapChanges = false,\n doc = /** @type {Doc} */ (array.isArray(typeScope) ? typeScope[0].doc : typeScope.doc)\n } = {}) {\n super()\n /**\n * @type {Array>}\n */\n this.scope = []\n this.doc = doc\n this.addToScope(typeScope)\n this.deleteFilter = deleteFilter\n trackedOrigins.add(this)\n this.trackedOrigins = trackedOrigins\n this.captureTransaction = captureTransaction\n /**\n * @type {Array}\n */\n this.undoStack = []\n /**\n * @type {Array}\n */\n this.redoStack = []\n /**\n * Whether the client is currently undoing (calling UndoManager.undo)\n *\n * @type {boolean}\n */\n this.undoing = false\n this.redoing = false\n /**\n * The currently popped stack item if UndoManager.undoing or UndoManager.redoing\n *\n * @type {StackItem|null}\n */\n this.currStackItem = null\n this.lastChange = 0\n this.ignoreRemoteMapChanges = ignoreRemoteMapChanges\n this.captureTimeout = captureTimeout\n /**\n * @param {Transaction} transaction\n */\n this.afterTransactionHandler = transaction => {\n // Only track certain transactions\n if (\n !this.captureTransaction(transaction) ||\n !this.scope.some(type => transaction.changedParentTypes.has(type)) ||\n (!this.trackedOrigins.has(transaction.origin) && (!transaction.origin || !this.trackedOrigins.has(transaction.origin.constructor)))\n ) {\n return\n }\n const undoing = this.undoing\n const redoing = this.redoing\n const stack = undoing ? this.redoStack : this.undoStack\n if (undoing) {\n this.stopCapturing() // next undo should not be appended to last stack item\n } else if (!redoing) {\n // neither undoing nor redoing: delete redoStack\n this.clear(false, true)\n }\n const insertions = new DeleteSet()\n transaction.afterState.forEach((endClock, client) => {\n const startClock = transaction.beforeState.get(client) || 0\n const len = endClock - startClock\n if (len > 0) {\n addToDeleteSet(insertions, client, startClock, len)\n }\n })\n const now = time.getUnixTime()\n let didAdd = false\n if (this.lastChange > 0 && now - this.lastChange < this.captureTimeout && stack.length > 0 && !undoing && !redoing) {\n // append change to last stack op\n const lastOp = stack[stack.length - 1]\n lastOp.deletions = mergeDeleteSets([lastOp.deletions, transaction.deleteSet])\n lastOp.insertions = mergeDeleteSets([lastOp.insertions, insertions])\n } else {\n // create a new stack op\n stack.push(new StackItem(transaction.deleteSet, insertions))\n didAdd = true\n }\n if (!undoing && !redoing) {\n this.lastChange = now\n }\n // make sure that deleted structs are not gc'd\n iterateDeletedStructs(transaction, transaction.deleteSet, /** @param {Item|GC} item */ item => {\n if (item instanceof Item && this.scope.some(type => isParentOf(type, item))) {\n keepItem(item, true)\n }\n })\n /**\n * @type {[StackItemEvent, UndoManager]}\n */\n const changeEvent = [{ stackItem: stack[stack.length - 1], origin: transaction.origin, type: undoing ? 'redo' : 'undo', changedParentTypes: transaction.changedParentTypes }, this]\n if (didAdd) {\n this.emit('stack-item-added', changeEvent)\n } else {\n this.emit('stack-item-updated', changeEvent)\n }\n }\n this.doc.on('afterTransaction', this.afterTransactionHandler)\n this.doc.on('destroy', () => {\n this.destroy()\n })\n }\n\n /**\n * @param {Array> | AbstractType} ytypes\n */\n addToScope (ytypes) {\n ytypes = array.isArray(ytypes) ? ytypes : [ytypes]\n ytypes.forEach(ytype => {\n if (this.scope.every(yt => yt !== ytype)) {\n if (ytype.doc !== this.doc) logging.warn('[yjs#509] Not same Y.Doc') // use MultiDocUndoManager instead. also see https://github.com/yjs/yjs/issues/509\n this.scope.push(ytype)\n }\n })\n }\n\n /**\n * @param {any} origin\n */\n addTrackedOrigin (origin) {\n this.trackedOrigins.add(origin)\n }\n\n /**\n * @param {any} origin\n */\n removeTrackedOrigin (origin) {\n this.trackedOrigins.delete(origin)\n }\n\n clear (clearUndoStack = true, clearRedoStack = true) {\n if ((clearUndoStack && this.canUndo()) || (clearRedoStack && this.canRedo())) {\n this.doc.transact(tr => {\n if (clearUndoStack) {\n this.undoStack.forEach(item => clearUndoManagerStackItem(tr, this, item))\n this.undoStack = []\n }\n if (clearRedoStack) {\n this.redoStack.forEach(item => clearUndoManagerStackItem(tr, this, item))\n this.redoStack = []\n }\n this.emit('stack-cleared', [{ undoStackCleared: clearUndoStack, redoStackCleared: clearRedoStack }])\n })\n }\n }\n\n /**\n * UndoManager merges Undo-StackItem if they are created within time-gap\n * smaller than `options.captureTimeout`. Call `um.stopCapturing()` so that the next\n * StackItem won't be merged.\n *\n *\n * @example\n * // without stopCapturing\n * ytext.insert(0, 'a')\n * ytext.insert(1, 'b')\n * um.undo()\n * ytext.toString() // => '' (note that 'ab' was removed)\n * // with stopCapturing\n * ytext.insert(0, 'a')\n * um.stopCapturing()\n * ytext.insert(0, 'b')\n * um.undo()\n * ytext.toString() // => 'a' (note that only 'b' was removed)\n *\n */\n stopCapturing () {\n this.lastChange = 0\n }\n\n /**\n * Undo last changes on type.\n *\n * @return {StackItem?} Returns StackItem if a change was applied\n */\n undo () {\n this.undoing = true\n let res\n try {\n res = popStackItem(this, this.undoStack, 'undo')\n } finally {\n this.undoing = false\n }\n return res\n }\n\n /**\n * Redo last undo operation.\n *\n * @return {StackItem?} Returns StackItem if a change was applied\n */\n redo () {\n this.redoing = true\n let res\n try {\n res = popStackItem(this, this.redoStack, 'redo')\n } finally {\n this.redoing = false\n }\n return res\n }\n\n /**\n * Are undo steps available?\n *\n * @return {boolean} `true` if undo is possible\n */\n canUndo () {\n return this.undoStack.length > 0\n }\n\n /**\n * Are redo steps available?\n *\n * @return {boolean} `true` if redo is possible\n */\n canRedo () {\n return this.redoStack.length > 0\n }\n\n destroy () {\n this.trackedOrigins.delete(this)\n this.doc.off('afterTransaction', this.afterTransactionHandler)\n super.destroy()\n }\n}\n", "import * as binary from 'lib0/binary'\nimport * as decoding from 'lib0/decoding'\nimport * as encoding from 'lib0/encoding'\nimport * as error from 'lib0/error'\nimport * as f from 'lib0/function'\nimport * as logging from 'lib0/logging'\nimport * as map from 'lib0/map'\nimport * as math from 'lib0/math'\nimport * as string from 'lib0/string'\n\nimport {\n ContentAny,\n ContentBinary,\n ContentDeleted,\n ContentDoc,\n ContentEmbed,\n ContentFormat,\n ContentJSON,\n ContentString,\n ContentType,\n createID,\n decodeStateVector,\n DSEncoderV1,\n DSEncoderV2,\n GC,\n Item,\n mergeDeleteSets,\n readDeleteSet,\n readItemContent,\n Skip,\n UpdateDecoderV1,\n UpdateDecoderV2,\n UpdateEncoderV1,\n UpdateEncoderV2,\n writeDeleteSet,\n YXmlElement,\n YXmlHook\n} from '../internals.js'\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n */\nfunction * lazyStructReaderGenerator (decoder) {\n const numOfStateUpdates = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numOfStateUpdates; i++) {\n const numberOfStructs = decoding.readVarUint(decoder.restDecoder)\n const client = decoder.readClient()\n let clock = decoding.readVarUint(decoder.restDecoder)\n for (let i = 0; i < numberOfStructs; i++) {\n const info = decoder.readInfo()\n // @todo use switch instead of ifs\n if (info === 10) {\n const len = decoding.readVarUint(decoder.restDecoder)\n yield new Skip(createID(client, clock), len)\n clock += len\n } else if ((binary.BITS5 & info) !== 0) {\n const cantCopyParentInfo = (info & (binary.BIT7 | binary.BIT8)) === 0\n // If parent = null and neither left nor right are defined, then we know that `parent` is child of `y`\n // and we read the next string as parentYKey.\n // It indicates how we store/retrieve parent from `y.share`\n // @type {string|null}\n const struct = new Item(\n createID(client, clock),\n null, // left\n (info & binary.BIT8) === binary.BIT8 ? decoder.readLeftID() : null, // origin\n null, // right\n (info & binary.BIT7) === binary.BIT7 ? decoder.readRightID() : null, // right origin\n // @ts-ignore Force writing a string here.\n cantCopyParentInfo ? (decoder.readParentInfo() ? decoder.readString() : decoder.readLeftID()) : null, // parent\n cantCopyParentInfo && (info & binary.BIT6) === binary.BIT6 ? decoder.readString() : null, // parentSub\n readItemContent(decoder, info) // item content\n )\n yield struct\n clock += struct.length\n } else {\n const len = decoder.readLen()\n yield new GC(createID(client, clock), len)\n clock += len\n }\n }\n }\n}\n\nexport class LazyStructReader {\n /**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @param {boolean} filterSkips\n */\n constructor (decoder, filterSkips) {\n this.gen = lazyStructReaderGenerator(decoder)\n /**\n * @type {null | Item | Skip | GC}\n */\n this.curr = null\n this.done = false\n this.filterSkips = filterSkips\n this.next()\n }\n\n /**\n * @return {Item | GC | Skip |null}\n */\n next () {\n // ignore \"Skip\" structs\n do {\n this.curr = this.gen.next().value || null\n } while (this.filterSkips && this.curr !== null && this.curr.constructor === Skip)\n return this.curr\n }\n}\n\n/**\n * @param {Uint8Array} update\n *\n */\nexport const logUpdate = update => logUpdateV2(update, UpdateDecoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {typeof UpdateDecoderV2 | typeof UpdateDecoderV1} [YDecoder]\n *\n */\nexport const logUpdateV2 = (update, YDecoder = UpdateDecoderV2) => {\n const structs = []\n const updateDecoder = new YDecoder(decoding.createDecoder(update))\n const lazyDecoder = new LazyStructReader(updateDecoder, false)\n for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) {\n structs.push(curr)\n }\n logging.print('Structs: ', structs)\n const ds = readDeleteSet(updateDecoder)\n logging.print('DeleteSet: ', ds)\n}\n\n/**\n * @param {Uint8Array} update\n *\n */\nexport const decodeUpdate = (update) => decodeUpdateV2(update, UpdateDecoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {typeof UpdateDecoderV2 | typeof UpdateDecoderV1} [YDecoder]\n *\n */\nexport const decodeUpdateV2 = (update, YDecoder = UpdateDecoderV2) => {\n const structs = []\n const updateDecoder = new YDecoder(decoding.createDecoder(update))\n const lazyDecoder = new LazyStructReader(updateDecoder, false)\n for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) {\n structs.push(curr)\n }\n return {\n structs,\n ds: readDeleteSet(updateDecoder)\n }\n}\n\nexport class LazyStructWriter {\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n constructor (encoder) {\n this.currClient = 0\n this.startClock = 0\n this.written = 0\n this.encoder = encoder\n /**\n * We want to write operations lazily, but also we need to know beforehand how many operations we want to write for each client.\n *\n * This kind of meta-information (#clients, #structs-per-client-written) is written to the restEncoder.\n *\n * We fragment the restEncoder and store a slice of it per-client until we know how many clients there are.\n * When we flush (toUint8Array) we write the restEncoder using the fragments and the meta-information.\n *\n * @type {Array<{ written: number, restEncoder: Uint8Array }>}\n */\n this.clientStructs = []\n }\n}\n\n/**\n * @param {Array} updates\n * @return {Uint8Array}\n */\nexport const mergeUpdates = updates => mergeUpdatesV2(updates, UpdateDecoderV1, UpdateEncoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {typeof DSEncoderV1 | typeof DSEncoderV2} YEncoder\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} YDecoder\n * @return {Uint8Array}\n */\nexport const encodeStateVectorFromUpdateV2 = (update, YEncoder = DSEncoderV2, YDecoder = UpdateDecoderV2) => {\n const encoder = new YEncoder()\n const updateDecoder = new LazyStructReader(new YDecoder(decoding.createDecoder(update)), false)\n let curr = updateDecoder.curr\n if (curr !== null) {\n let size = 0\n let currClient = curr.id.client\n let stopCounting = curr.id.clock !== 0 // must start at 0\n let currClock = stopCounting ? 0 : curr.id.clock + curr.length\n for (; curr !== null; curr = updateDecoder.next()) {\n if (currClient !== curr.id.client) {\n if (currClock !== 0) {\n size++\n // We found a new client\n // write what we have to the encoder\n encoding.writeVarUint(encoder.restEncoder, currClient)\n encoding.writeVarUint(encoder.restEncoder, currClock)\n }\n currClient = curr.id.client\n currClock = 0\n stopCounting = curr.id.clock !== 0\n }\n // we ignore skips\n if (curr.constructor === Skip) {\n stopCounting = true\n }\n if (!stopCounting) {\n currClock = curr.id.clock + curr.length\n }\n }\n // write what we have\n if (currClock !== 0) {\n size++\n encoding.writeVarUint(encoder.restEncoder, currClient)\n encoding.writeVarUint(encoder.restEncoder, currClock)\n }\n // prepend the size of the state vector\n const enc = encoding.createEncoder()\n encoding.writeVarUint(enc, size)\n encoding.writeBinaryEncoder(enc, encoder.restEncoder)\n encoder.restEncoder = enc\n return encoder.toUint8Array()\n } else {\n encoding.writeVarUint(encoder.restEncoder, 0)\n return encoder.toUint8Array()\n }\n}\n\n/**\n * @param {Uint8Array} update\n * @return {Uint8Array}\n */\nexport const encodeStateVectorFromUpdate = update => encodeStateVectorFromUpdateV2(update, DSEncoderV1, UpdateDecoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} YDecoder\n * @return {{ from: Map, to: Map }}\n */\nexport const parseUpdateMetaV2 = (update, YDecoder = UpdateDecoderV2) => {\n /**\n * @type {Map}\n */\n const from = new Map()\n /**\n * @type {Map}\n */\n const to = new Map()\n const updateDecoder = new LazyStructReader(new YDecoder(decoding.createDecoder(update)), false)\n let curr = updateDecoder.curr\n if (curr !== null) {\n let currClient = curr.id.client\n let currClock = curr.id.clock\n // write the beginning to `from`\n from.set(currClient, currClock)\n for (; curr !== null; curr = updateDecoder.next()) {\n if (currClient !== curr.id.client) {\n // We found a new client\n // write the end to `to`\n to.set(currClient, currClock)\n // write the beginning to `from`\n from.set(curr.id.client, curr.id.clock)\n // update currClient\n currClient = curr.id.client\n }\n currClock = curr.id.clock + curr.length\n }\n // write the end to `to`\n to.set(currClient, currClock)\n }\n return { from, to }\n}\n\n/**\n * @param {Uint8Array} update\n * @return {{ from: Map, to: Map }}\n */\nexport const parseUpdateMeta = update => parseUpdateMetaV2(update, UpdateDecoderV1)\n\n/**\n * This method is intended to slice any kind of struct and retrieve the right part.\n * It does not handle side-effects, so it should only be used by the lazy-encoder.\n *\n * @param {Item | GC | Skip} left\n * @param {number} diff\n * @return {Item | GC}\n */\nconst sliceStruct = (left, diff) => {\n if (left.constructor === GC) {\n const { client, clock } = left.id\n return new GC(createID(client, clock + diff), left.length - diff)\n } else if (left.constructor === Skip) {\n const { client, clock } = left.id\n return new Skip(createID(client, clock + diff), left.length - diff)\n } else {\n const leftItem = /** @type {Item} */ (left)\n const { client, clock } = leftItem.id\n return new Item(\n createID(client, clock + diff),\n null,\n createID(client, clock + diff - 1),\n null,\n leftItem.rightOrigin,\n leftItem.parent,\n leftItem.parentSub,\n leftItem.content.splice(diff)\n )\n }\n}\n\n/**\n *\n * This function works similarly to `readUpdateV2`.\n *\n * @param {Array} updates\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} [YDecoder]\n * @param {typeof UpdateEncoderV1 | typeof UpdateEncoderV2} [YEncoder]\n * @return {Uint8Array}\n */\nexport const mergeUpdatesV2 = (updates, YDecoder = UpdateDecoderV2, YEncoder = UpdateEncoderV2) => {\n if (updates.length === 1) {\n return updates[0]\n }\n const updateDecoders = updates.map(update => new YDecoder(decoding.createDecoder(update)))\n let lazyStructDecoders = updateDecoders.map(decoder => new LazyStructReader(decoder, true))\n\n /**\n * @todo we don't need offset because we always slice before\n * @type {null | { struct: Item | GC | Skip, offset: number }}\n */\n let currWrite = null\n\n const updateEncoder = new YEncoder()\n // write structs lazily\n const lazyStructEncoder = new LazyStructWriter(updateEncoder)\n\n // Note: We need to ensure that all lazyStructDecoders are fully consumed\n // Note: Should merge document updates whenever possible - even from different updates\n // Note: Should handle that some operations cannot be applied yet ()\n\n while (true) {\n // Write higher clients first ⇒ sort by clientID & clock and remove decoders without content\n lazyStructDecoders = lazyStructDecoders.filter(dec => dec.curr !== null)\n lazyStructDecoders.sort(\n /** @type {function(any,any):number} */ (dec1, dec2) => {\n if (dec1.curr.id.client === dec2.curr.id.client) {\n const clockDiff = dec1.curr.id.clock - dec2.curr.id.clock\n if (clockDiff === 0) {\n // @todo remove references to skip since the structDecoders must filter Skips.\n return dec1.curr.constructor === dec2.curr.constructor\n ? 0\n : dec1.curr.constructor === Skip ? 1 : -1 // we are filtering skips anyway.\n } else {\n return clockDiff\n }\n } else {\n return dec2.curr.id.client - dec1.curr.id.client\n }\n }\n )\n if (lazyStructDecoders.length === 0) {\n break\n }\n const currDecoder = lazyStructDecoders[0]\n // write from currDecoder until the next operation is from another client or if filler-struct\n // then we need to reorder the decoders and find the next operation to write\n const firstClient = /** @type {Item | GC} */ (currDecoder.curr).id.client\n\n if (currWrite !== null) {\n let curr = /** @type {Item | GC | null} */ (currDecoder.curr)\n let iterated = false\n\n // iterate until we find something that we haven't written already\n // remember: first the high client-ids are written\n while (curr !== null && curr.id.clock + curr.length <= currWrite.struct.id.clock + currWrite.struct.length && curr.id.client >= currWrite.struct.id.client) {\n curr = currDecoder.next()\n iterated = true\n }\n if (\n curr === null || // current decoder is empty\n curr.id.client !== firstClient || // check whether there is another decoder that has has updates from `firstClient`\n (iterated && curr.id.clock > currWrite.struct.id.clock + currWrite.struct.length) // the above while loop was used and we are potentially missing updates\n ) {\n continue\n }\n\n if (firstClient !== currWrite.struct.id.client) {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n currWrite = { struct: curr, offset: 0 }\n currDecoder.next()\n } else {\n if (currWrite.struct.id.clock + currWrite.struct.length < curr.id.clock) {\n // @todo write currStruct & set currStruct = Skip(clock = currStruct.id.clock + currStruct.length, length = curr.id.clock - self.clock)\n if (currWrite.struct.constructor === Skip) {\n // extend existing skip\n currWrite.struct.length = curr.id.clock + curr.length - currWrite.struct.id.clock\n } else {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n const diff = curr.id.clock - currWrite.struct.id.clock - currWrite.struct.length\n /**\n * @type {Skip}\n */\n const struct = new Skip(createID(firstClient, currWrite.struct.id.clock + currWrite.struct.length), diff)\n currWrite = { struct, offset: 0 }\n }\n } else { // if (currWrite.struct.id.clock + currWrite.struct.length >= curr.id.clock) {\n const diff = currWrite.struct.id.clock + currWrite.struct.length - curr.id.clock\n if (diff > 0) {\n if (currWrite.struct.constructor === Skip) {\n // prefer to slice Skip because the other struct might contain more information\n currWrite.struct.length -= diff\n } else {\n curr = sliceStruct(curr, diff)\n }\n }\n if (!currWrite.struct.mergeWith(/** @type {any} */ (curr))) {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n currWrite = { struct: curr, offset: 0 }\n currDecoder.next()\n }\n }\n }\n } else {\n currWrite = { struct: /** @type {Item | GC} */ (currDecoder.curr), offset: 0 }\n currDecoder.next()\n }\n for (\n let next = currDecoder.curr;\n next !== null && next.id.client === firstClient && next.id.clock === currWrite.struct.id.clock + currWrite.struct.length && next.constructor !== Skip;\n next = currDecoder.next()\n ) {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n currWrite = { struct: next, offset: 0 }\n }\n }\n if (currWrite !== null) {\n writeStructToLazyStructWriter(lazyStructEncoder, currWrite.struct, currWrite.offset)\n currWrite = null\n }\n finishLazyStructWriting(lazyStructEncoder)\n\n const dss = updateDecoders.map(decoder => readDeleteSet(decoder))\n const ds = mergeDeleteSets(dss)\n writeDeleteSet(updateEncoder, ds)\n return updateEncoder.toUint8Array()\n}\n\n/**\n * @param {Uint8Array} update\n * @param {Uint8Array} sv\n * @param {typeof UpdateDecoderV1 | typeof UpdateDecoderV2} [YDecoder]\n * @param {typeof UpdateEncoderV1 | typeof UpdateEncoderV2} [YEncoder]\n */\nexport const diffUpdateV2 = (update, sv, YDecoder = UpdateDecoderV2, YEncoder = UpdateEncoderV2) => {\n const state = decodeStateVector(sv)\n const encoder = new YEncoder()\n const lazyStructWriter = new LazyStructWriter(encoder)\n const decoder = new YDecoder(decoding.createDecoder(update))\n const reader = new LazyStructReader(decoder, false)\n while (reader.curr) {\n const curr = reader.curr\n const currClient = curr.id.client\n const svClock = state.get(currClient) || 0\n if (reader.curr.constructor === Skip) {\n // the first written struct shouldn't be a skip\n reader.next()\n continue\n }\n if (curr.id.clock + curr.length > svClock) {\n writeStructToLazyStructWriter(lazyStructWriter, curr, math.max(svClock - curr.id.clock, 0))\n reader.next()\n while (reader.curr && reader.curr.id.client === currClient) {\n writeStructToLazyStructWriter(lazyStructWriter, reader.curr, 0)\n reader.next()\n }\n } else {\n // read until something new comes up\n while (reader.curr && reader.curr.id.client === currClient && reader.curr.id.clock + reader.curr.length <= svClock) {\n reader.next()\n }\n }\n }\n finishLazyStructWriting(lazyStructWriter)\n // write ds\n const ds = readDeleteSet(decoder)\n writeDeleteSet(encoder, ds)\n return encoder.toUint8Array()\n}\n\n/**\n * @param {Uint8Array} update\n * @param {Uint8Array} sv\n */\nexport const diffUpdate = (update, sv) => diffUpdateV2(update, sv, UpdateDecoderV1, UpdateEncoderV1)\n\n/**\n * @param {LazyStructWriter} lazyWriter\n */\nconst flushLazyStructWriter = lazyWriter => {\n if (lazyWriter.written > 0) {\n lazyWriter.clientStructs.push({ written: lazyWriter.written, restEncoder: encoding.toUint8Array(lazyWriter.encoder.restEncoder) })\n lazyWriter.encoder.restEncoder = encoding.createEncoder()\n lazyWriter.written = 0\n }\n}\n\n/**\n * @param {LazyStructWriter} lazyWriter\n * @param {Item | GC} struct\n * @param {number} offset\n */\nconst writeStructToLazyStructWriter = (lazyWriter, struct, offset) => {\n // flush curr if we start another client\n if (lazyWriter.written > 0 && lazyWriter.currClient !== struct.id.client) {\n flushLazyStructWriter(lazyWriter)\n }\n if (lazyWriter.written === 0) {\n lazyWriter.currClient = struct.id.client\n // write next client\n lazyWriter.encoder.writeClient(struct.id.client)\n // write startClock\n encoding.writeVarUint(lazyWriter.encoder.restEncoder, struct.id.clock + offset)\n }\n struct.write(lazyWriter.encoder, offset)\n lazyWriter.written++\n}\n/**\n * Call this function when we collected all parts and want to\n * put all the parts together. After calling this method,\n * you can continue using the UpdateEncoder.\n *\n * @param {LazyStructWriter} lazyWriter\n */\nconst finishLazyStructWriting = (lazyWriter) => {\n flushLazyStructWriter(lazyWriter)\n\n // this is a fresh encoder because we called flushCurr\n const restEncoder = lazyWriter.encoder.restEncoder\n\n /**\n * Now we put all the fragments together.\n * This works similarly to `writeClientsStructs`\n */\n\n // write # states that were updated - i.e. the clients\n encoding.writeVarUint(restEncoder, lazyWriter.clientStructs.length)\n\n for (let i = 0; i < lazyWriter.clientStructs.length; i++) {\n const partStructs = lazyWriter.clientStructs[i]\n /**\n * Works similarly to `writeStructs`\n */\n // write # encoded structs\n encoding.writeVarUint(restEncoder, partStructs.written)\n // write the rest of the fragment\n encoding.writeUint8Array(restEncoder, partStructs.restEncoder)\n }\n}\n\n/**\n * @param {Uint8Array} update\n * @param {function(Item|GC|Skip):Item|GC|Skip} blockTransformer\n * @param {typeof UpdateDecoderV2 | typeof UpdateDecoderV1} YDecoder\n * @param {typeof UpdateEncoderV2 | typeof UpdateEncoderV1 } YEncoder\n */\nexport const convertUpdateFormat = (update, blockTransformer, YDecoder, YEncoder) => {\n const updateDecoder = new YDecoder(decoding.createDecoder(update))\n const lazyDecoder = new LazyStructReader(updateDecoder, false)\n const updateEncoder = new YEncoder()\n const lazyWriter = new LazyStructWriter(updateEncoder)\n for (let curr = lazyDecoder.curr; curr !== null; curr = lazyDecoder.next()) {\n writeStructToLazyStructWriter(lazyWriter, blockTransformer(curr), 0)\n }\n finishLazyStructWriting(lazyWriter)\n const ds = readDeleteSet(updateDecoder)\n writeDeleteSet(updateEncoder, ds)\n return updateEncoder.toUint8Array()\n}\n\n/**\n * @typedef {Object} ObfuscatorOptions\n * @property {boolean} [ObfuscatorOptions.formatting=true]\n * @property {boolean} [ObfuscatorOptions.subdocs=true]\n * @property {boolean} [ObfuscatorOptions.yxml=true] Whether to obfuscate nodeName / hookName\n */\n\n/**\n * @param {ObfuscatorOptions} obfuscator\n */\nconst createObfuscator = ({ formatting = true, subdocs = true, yxml = true } = {}) => {\n let i = 0\n const mapKeyCache = map.create()\n const nodeNameCache = map.create()\n const formattingKeyCache = map.create()\n const formattingValueCache = map.create()\n formattingValueCache.set(null, null) // end of a formatting range should always be the end of a formatting range\n /**\n * @param {Item|GC|Skip} block\n * @return {Item|GC|Skip}\n */\n return block => {\n switch (block.constructor) {\n case GC:\n case Skip:\n return block\n case Item: {\n const item = /** @type {Item} */ (block)\n const content = item.content\n switch (content.constructor) {\n case ContentDeleted:\n break\n case ContentType: {\n if (yxml) {\n const type = /** @type {ContentType} */ (content).type\n if (type instanceof YXmlElement) {\n type.nodeName = map.setIfUndefined(nodeNameCache, type.nodeName, () => 'node-' + i)\n }\n if (type instanceof YXmlHook) {\n type.hookName = map.setIfUndefined(nodeNameCache, type.hookName, () => 'hook-' + i)\n }\n }\n break\n }\n case ContentAny: {\n const c = /** @type {ContentAny} */ (content)\n c.arr = c.arr.map(() => i)\n break\n }\n case ContentBinary: {\n const c = /** @type {ContentBinary} */ (content)\n c.content = new Uint8Array([i])\n break\n }\n case ContentDoc: {\n const c = /** @type {ContentDoc} */ (content)\n if (subdocs) {\n c.opts = {}\n c.doc.guid = i + ''\n }\n break\n }\n case ContentEmbed: {\n const c = /** @type {ContentEmbed} */ (content)\n c.embed = {}\n break\n }\n case ContentFormat: {\n const c = /** @type {ContentFormat} */ (content)\n if (formatting) {\n c.key = map.setIfUndefined(formattingKeyCache, c.key, () => i + '')\n c.value = map.setIfUndefined(formattingValueCache, c.value, () => ({ i }))\n }\n break\n }\n case ContentJSON: {\n const c = /** @type {ContentJSON} */ (content)\n c.arr = c.arr.map(() => i)\n break\n }\n case ContentString: {\n const c = /** @type {ContentString} */ (content)\n c.str = string.repeat((i % 10) + '', c.str.length)\n break\n }\n default:\n // unknown content type\n error.unexpectedCase()\n }\n if (item.parentSub) {\n item.parentSub = map.setIfUndefined(mapKeyCache, item.parentSub, () => i + '')\n }\n i++\n return block\n }\n default:\n // unknown block-type\n error.unexpectedCase()\n }\n }\n}\n\n/**\n * This function obfuscates the content of a Yjs update. This is useful to share\n * buggy Yjs documents while significantly limiting the possibility that a\n * developer can on the user. Note that it might still be possible to deduce\n * some information by analyzing the \"structure\" of the document or by analyzing\n * the typing behavior using the CRDT-related metadata that is still kept fully\n * intact.\n *\n * @param {Uint8Array} update\n * @param {ObfuscatorOptions} [opts]\n */\nexport const obfuscateUpdate = (update, opts) => convertUpdateFormat(update, createObfuscator(opts), UpdateDecoderV1, UpdateEncoderV1)\n\n/**\n * @param {Uint8Array} update\n * @param {ObfuscatorOptions} [opts]\n */\nexport const obfuscateUpdateV2 = (update, opts) => convertUpdateFormat(update, createObfuscator(opts), UpdateDecoderV2, UpdateEncoderV2)\n\n/**\n * @param {Uint8Array} update\n */\nexport const convertUpdateFormatV1ToV2 = update => convertUpdateFormat(update, f.id, UpdateDecoderV1, UpdateEncoderV2)\n\n/**\n * @param {Uint8Array} update\n */\nexport const convertUpdateFormatV2ToV1 = update => convertUpdateFormat(update, f.id, UpdateDecoderV2, UpdateEncoderV1)\n", "import {\n isDeleted,\n Item, AbstractType, Transaction, AbstractStruct // eslint-disable-line\n} from '../internals.js'\n\nimport * as set from 'lib0/set'\nimport * as array from 'lib0/array'\nimport * as error from 'lib0/error'\n\nconst errorComputeChanges = 'You must not compute changes after the event-handler fired.'\n\n/**\n * @template {AbstractType} T\n * YEvent describes the changes on a YType.\n */\nexport class YEvent {\n /**\n * @param {T} target The changed type.\n * @param {Transaction} transaction\n */\n constructor (target, transaction) {\n /**\n * The type on which this event was created on.\n * @type {T}\n */\n this.target = target\n /**\n * The current target on which the observe callback is called.\n * @type {AbstractType}\n */\n this.currentTarget = target\n /**\n * The transaction that triggered this event.\n * @type {Transaction}\n */\n this.transaction = transaction\n /**\n * @type {Object|null}\n */\n this._changes = null\n /**\n * @type {null | Map}\n */\n this._keys = null\n /**\n * @type {null | Array<{ insert?: string | Array | object | AbstractType, retain?: number, delete?: number, attributes?: Object }>}\n */\n this._delta = null\n /**\n * @type {Array|null}\n */\n this._path = null\n }\n\n /**\n * Computes the path from `y` to the changed type.\n *\n * @todo v14 should standardize on path: Array<{parent, index}> because that is easier to work with.\n *\n * The following property holds:\n * @example\n * let type = y\n * event.path.forEach(dir => {\n * type = type.get(dir)\n * })\n * type === event.target // => true\n */\n get path () {\n return this._path || (this._path = getPathTo(this.currentTarget, this.target))\n }\n\n /**\n * Check if a struct is deleted by this event.\n *\n * In contrast to change.deleted, this method also returns true if the struct was added and then deleted.\n *\n * @param {AbstractStruct} struct\n * @return {boolean}\n */\n deletes (struct) {\n return isDeleted(this.transaction.deleteSet, struct.id)\n }\n\n /**\n * @type {Map}\n */\n get keys () {\n if (this._keys === null) {\n if (this.transaction.doc._transactionCleanups.length === 0) {\n throw error.create(errorComputeChanges)\n }\n const keys = new Map()\n const target = this.target\n const changed = /** @type Set */ (this.transaction.changed.get(target))\n changed.forEach(key => {\n if (key !== null) {\n const item = /** @type {Item} */ (target._map.get(key))\n /**\n * @type {'delete' | 'add' | 'update'}\n */\n let action\n let oldValue\n if (this.adds(item)) {\n let prev = item.left\n while (prev !== null && this.adds(prev)) {\n prev = prev.left\n }\n if (this.deletes(item)) {\n if (prev !== null && this.deletes(prev)) {\n action = 'delete'\n oldValue = array.last(prev.content.getContent())\n } else {\n return\n }\n } else {\n if (prev !== null && this.deletes(prev)) {\n action = 'update'\n oldValue = array.last(prev.content.getContent())\n } else {\n action = 'add'\n oldValue = undefined\n }\n }\n } else {\n if (this.deletes(item)) {\n action = 'delete'\n oldValue = array.last(/** @type {Item} */ item.content.getContent())\n } else {\n return // nop\n }\n }\n keys.set(key, { action, oldValue })\n }\n })\n this._keys = keys\n }\n return this._keys\n }\n\n /**\n * This is a computed property. Note that this can only be safely computed during the\n * event call. Computing this property after other changes happened might result in\n * unexpected behavior (incorrect computation of deltas). A safe way to collect changes\n * is to store the `changes` or the `delta` object. Avoid storing the `transaction` object.\n *\n * @type {Array<{insert?: string | Array | object | AbstractType, retain?: number, delete?: number, attributes?: Object}>}\n */\n get delta () {\n return this.changes.delta\n }\n\n /**\n * Check if a struct is added by this event.\n *\n * In contrast to change.deleted, this method also returns true if the struct was added and then deleted.\n *\n * @param {AbstractStruct} struct\n * @return {boolean}\n */\n adds (struct) {\n return struct.id.clock >= (this.transaction.beforeState.get(struct.id.client) || 0)\n }\n\n /**\n * This is a computed property. Note that this can only be safely computed during the\n * event call. Computing this property after other changes happened might result in\n * unexpected behavior (incorrect computation of deltas). A safe way to collect changes\n * is to store the `changes` or the `delta` object. Avoid storing the `transaction` object.\n *\n * @type {{added:Set,deleted:Set,keys:Map,delta:Array<{insert?:Array|string, delete?:number, retain?:number}>}}\n */\n get changes () {\n let changes = this._changes\n if (changes === null) {\n if (this.transaction.doc._transactionCleanups.length === 0) {\n throw error.create(errorComputeChanges)\n }\n const target = this.target\n const added = set.create()\n const deleted = set.create()\n /**\n * @type {Array<{insert:Array}|{delete:number}|{retain:number}>}\n */\n const delta = []\n changes = {\n added,\n deleted,\n delta,\n keys: this.keys\n }\n const changed = /** @type Set */ (this.transaction.changed.get(target))\n if (changed.has(null)) {\n /**\n * @type {any}\n */\n let lastOp = null\n const packOp = () => {\n if (lastOp) {\n delta.push(lastOp)\n }\n }\n for (let item = target._start; item !== null; item = item.right) {\n if (item.deleted) {\n if (this.deletes(item) && !this.adds(item)) {\n if (lastOp === null || lastOp.delete === undefined) {\n packOp()\n lastOp = { delete: 0 }\n }\n lastOp.delete += item.length\n deleted.add(item)\n } // else nop\n } else {\n if (this.adds(item)) {\n if (lastOp === null || lastOp.insert === undefined) {\n packOp()\n lastOp = { insert: [] }\n }\n lastOp.insert = lastOp.insert.concat(item.content.getContent())\n added.add(item)\n } else {\n if (lastOp === null || lastOp.retain === undefined) {\n packOp()\n lastOp = { retain: 0 }\n }\n lastOp.retain += item.length\n }\n }\n }\n if (lastOp !== null && lastOp.retain === undefined) {\n packOp()\n }\n }\n this._changes = changes\n }\n return /** @type {any} */ (changes)\n }\n}\n\n/**\n * Compute the path from this type to the specified target.\n *\n * @example\n * // `child` should be accessible via `type.get(path[0]).get(path[1])..`\n * const path = type.getPathTo(child)\n * // assuming `type instanceof YArray`\n * console.log(path) // might look like => [2, 'key1']\n * child === type.get(path[0]).get(path[1])\n *\n * @param {AbstractType} parent\n * @param {AbstractType} child target\n * @return {Array} Path to the target\n *\n * @private\n * @function\n */\nconst getPathTo = (parent, child) => {\n const path = []\n while (child._item !== null && child !== parent) {\n if (child._item.parentSub !== null) {\n // parent is map-ish\n path.unshift(child._item.parentSub)\n } else {\n // parent is array-ish\n let i = 0\n let c = /** @type {AbstractType} */ (child._item.parent)._start\n while (c !== child._item && c !== null) {\n if (!c.deleted && c.countable) {\n i += c.length\n }\n c = c.right\n }\n path.unshift(i)\n }\n child = /** @type {AbstractType} */ (child._item.parent)\n }\n return path\n}\n", "import {\n removeEventHandlerListener,\n callEventHandlerListeners,\n addEventHandlerListener,\n createEventHandler,\n getState,\n isVisible,\n ContentType,\n createID,\n ContentAny,\n ContentBinary,\n getItemCleanStart,\n ContentDoc, YText, YArray, UpdateEncoderV1, UpdateEncoderV2, Doc, Snapshot, Transaction, EventHandler, YEvent, Item, // eslint-disable-line\n} from '../internals.js'\n\nimport * as map from 'lib0/map'\nimport * as iterator from 'lib0/iterator'\nimport * as error from 'lib0/error'\nimport * as math from 'lib0/math'\nimport * as log from 'lib0/logging'\n\n/**\n * https://docs.yjs.dev/getting-started/working-with-shared-types#caveats\n */\nexport const warnPrematureAccess = () => { log.warn('Invalid access: Add Yjs type to a document before reading data.') }\n\nconst maxSearchMarker = 80\n\n/**\n * A unique timestamp that identifies each marker.\n *\n * Time is relative,.. this is more like an ever-increasing clock.\n *\n * @type {number}\n */\nlet globalSearchMarkerTimestamp = 0\n\nexport class ArraySearchMarker {\n /**\n * @param {Item} p\n * @param {number} index\n */\n constructor (p, index) {\n p.marker = true\n this.p = p\n this.index = index\n this.timestamp = globalSearchMarkerTimestamp++\n }\n}\n\n/**\n * @param {ArraySearchMarker} marker\n */\nconst refreshMarkerTimestamp = marker => { marker.timestamp = globalSearchMarkerTimestamp++ }\n\n/**\n * This is rather complex so this function is the only thing that should overwrite a marker\n *\n * @param {ArraySearchMarker} marker\n * @param {Item} p\n * @param {number} index\n */\nconst overwriteMarker = (marker, p, index) => {\n marker.p.marker = false\n marker.p = p\n p.marker = true\n marker.index = index\n marker.timestamp = globalSearchMarkerTimestamp++\n}\n\n/**\n * @param {Array} searchMarker\n * @param {Item} p\n * @param {number} index\n */\nconst markPosition = (searchMarker, p, index) => {\n if (searchMarker.length >= maxSearchMarker) {\n // override oldest marker (we don't want to create more objects)\n const marker = searchMarker.reduce((a, b) => a.timestamp < b.timestamp ? a : b)\n overwriteMarker(marker, p, index)\n return marker\n } else {\n // create new marker\n const pm = new ArraySearchMarker(p, index)\n searchMarker.push(pm)\n return pm\n }\n}\n\n/**\n * Search marker help us to find positions in the associative array faster.\n *\n * They speed up the process of finding a position without much bookkeeping.\n *\n * A maximum of `maxSearchMarker` objects are created.\n *\n * This function always returns a refreshed marker (updated timestamp)\n *\n * @param {AbstractType} yarray\n * @param {number} index\n */\nexport const findMarker = (yarray, index) => {\n if (yarray._start === null || index === 0 || yarray._searchMarker === null) {\n return null\n }\n const marker = yarray._searchMarker.length === 0 ? null : yarray._searchMarker.reduce((a, b) => math.abs(index - a.index) < math.abs(index - b.index) ? a : b)\n let p = yarray._start\n let pindex = 0\n if (marker !== null) {\n p = marker.p\n pindex = marker.index\n refreshMarkerTimestamp(marker) // we used it, we might need to use it again\n }\n // iterate to right if possible\n while (p.right !== null && pindex < index) {\n if (!p.deleted && p.countable) {\n if (index < pindex + p.length) {\n break\n }\n pindex += p.length\n }\n p = p.right\n }\n // iterate to left if necessary (might be that pindex > index)\n while (p.left !== null && pindex > index) {\n p = p.left\n if (!p.deleted && p.countable) {\n pindex -= p.length\n }\n }\n // we want to make sure that p can't be merged with left, because that would screw up everything\n // in that cas just return what we have (it is most likely the best marker anyway)\n // iterate to left until p can't be merged with left\n while (p.left !== null && p.left.id.client === p.id.client && p.left.id.clock + p.left.length === p.id.clock) {\n p = p.left\n if (!p.deleted && p.countable) {\n pindex -= p.length\n }\n }\n\n // @todo remove!\n // assure position\n // {\n // let start = yarray._start\n // let pos = 0\n // while (start !== p) {\n // if (!start.deleted && start.countable) {\n // pos += start.length\n // }\n // start = /** @type {Item} */ (start.right)\n // }\n // if (pos !== pindex) {\n // debugger\n // throw new Error('Gotcha position fail!')\n // }\n // }\n // if (marker) {\n // if (window.lengthes == null) {\n // window.lengthes = []\n // window.getLengthes = () => window.lengthes.sort((a, b) => a - b)\n // }\n // window.lengthes.push(marker.index - pindex)\n // console.log('distance', marker.index - pindex, 'len', p && p.parent.length)\n // }\n if (marker !== null && math.abs(marker.index - pindex) < /** @type {YText|YArray} */ (p.parent).length / maxSearchMarker) {\n // adjust existing marker\n overwriteMarker(marker, p, pindex)\n return marker\n } else {\n // create new marker\n return markPosition(yarray._searchMarker, p, pindex)\n }\n}\n\n/**\n * Update markers when a change happened.\n *\n * This should be called before doing a deletion!\n *\n * @param {Array} searchMarker\n * @param {number} index\n * @param {number} len If insertion, len is positive. If deletion, len is negative.\n */\nexport const updateMarkerChanges = (searchMarker, index, len) => {\n for (let i = searchMarker.length - 1; i >= 0; i--) {\n const m = searchMarker[i]\n if (len > 0) {\n /**\n * @type {Item|null}\n */\n let p = m.p\n p.marker = false\n // Ideally we just want to do a simple position comparison, but this will only work if\n // search markers don't point to deleted items for formats.\n // Iterate marker to prev undeleted countable position so we know what to do when updating a position\n while (p && (p.deleted || !p.countable)) {\n p = p.left\n if (p && !p.deleted && p.countable) {\n // adjust position. the loop should break now\n m.index -= p.length\n }\n }\n if (p === null || p.marker === true) {\n // remove search marker if updated position is null or if position is already marked\n searchMarker.splice(i, 1)\n continue\n }\n m.p = p\n p.marker = true\n }\n if (index < m.index || (len > 0 && index === m.index)) { // a simple index <= m.index check would actually suffice\n m.index = math.max(index, m.index + len)\n }\n }\n}\n\n/**\n * Accumulate all (list) children of a type and return them as an Array.\n *\n * @param {AbstractType} t\n * @return {Array}\n */\nexport const getTypeChildren = t => {\n t.doc ?? warnPrematureAccess()\n let s = t._start\n const arr = []\n while (s) {\n arr.push(s)\n s = s.right\n }\n return arr\n}\n\n/**\n * Call event listeners with an event. This will also add an event to all\n * parents (for `.observeDeep` handlers).\n *\n * @template EventType\n * @param {AbstractType} type\n * @param {Transaction} transaction\n * @param {EventType} event\n */\nexport const callTypeObservers = (type, transaction, event) => {\n const changedType = type\n const changedParentTypes = transaction.changedParentTypes\n while (true) {\n // @ts-ignore\n map.setIfUndefined(changedParentTypes, type, () => []).push(event)\n if (type._item === null) {\n break\n }\n type = /** @type {AbstractType} */ (type._item.parent)\n }\n callEventHandlerListeners(changedType._eH, event, transaction)\n}\n\n/**\n * @template EventType\n * Abstract Yjs Type class\n */\nexport class AbstractType {\n constructor () {\n /**\n * @type {Item|null}\n */\n this._item = null\n /**\n * @type {Map}\n */\n this._map = new Map()\n /**\n * @type {Item|null}\n */\n this._start = null\n /**\n * @type {Doc|null}\n */\n this.doc = null\n this._length = 0\n /**\n * Event handlers\n * @type {EventHandler}\n */\n this._eH = createEventHandler()\n /**\n * Deep event handlers\n * @type {EventHandler>,Transaction>}\n */\n this._dEH = createEventHandler()\n /**\n * @type {null | Array}\n */\n this._searchMarker = null\n }\n\n /**\n * @return {AbstractType|null}\n */\n get parent () {\n return this._item ? /** @type {AbstractType} */ (this._item.parent) : null\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item|null} item\n */\n _integrate (y, item) {\n this.doc = y\n this._item = item\n }\n\n /**\n * @return {AbstractType}\n */\n _copy () {\n throw error.methodUnimplemented()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {AbstractType}\n */\n clone () {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} _encoder\n */\n _write (_encoder) { }\n\n /**\n * The first non-deleted item\n */\n get _first () {\n let n = this._start\n while (n !== null && n.deleted) {\n n = n.right\n }\n return n\n }\n\n /**\n * Creates YEvent and calls all type observers.\n * Must be implemented by each type.\n *\n * @param {Transaction} transaction\n * @param {Set} _parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, _parentSubs) {\n if (!transaction.local && this._searchMarker) {\n this._searchMarker.length = 0\n }\n }\n\n /**\n * Observe all events that are created on this type.\n *\n * @param {function(EventType, Transaction):void} f Observer function\n */\n observe (f) {\n addEventHandlerListener(this._eH, f)\n }\n\n /**\n * Observe all events that are created by this type and its children.\n *\n * @param {function(Array>,Transaction):void} f Observer function\n */\n observeDeep (f) {\n addEventHandlerListener(this._dEH, f)\n }\n\n /**\n * Unregister an observer function.\n *\n * @param {function(EventType,Transaction):void} f Observer function\n */\n unobserve (f) {\n removeEventHandlerListener(this._eH, f)\n }\n\n /**\n * Unregister an observer function.\n *\n * @param {function(Array>,Transaction):void} f Observer function\n */\n unobserveDeep (f) {\n removeEventHandlerListener(this._dEH, f)\n }\n\n /**\n * @abstract\n * @return {any}\n */\n toJSON () {}\n}\n\n/**\n * @param {AbstractType} type\n * @param {number} start\n * @param {number} end\n * @return {Array}\n *\n * @private\n * @function\n */\nexport const typeListSlice = (type, start, end) => {\n type.doc ?? warnPrematureAccess()\n if (start < 0) {\n start = type._length + start\n }\n if (end < 0) {\n end = type._length + end\n }\n let len = end - start\n const cs = []\n let n = type._start\n while (n !== null && len > 0) {\n if (n.countable && !n.deleted) {\n const c = n.content.getContent()\n if (c.length <= start) {\n start -= c.length\n } else {\n for (let i = start; i < c.length && len > 0; i++) {\n cs.push(c[i])\n len--\n }\n start = 0\n }\n }\n n = n.right\n }\n return cs\n}\n\n/**\n * @param {AbstractType} type\n * @return {Array}\n *\n * @private\n * @function\n */\nexport const typeListToArray = type => {\n type.doc ?? warnPrematureAccess()\n const cs = []\n let n = type._start\n while (n !== null) {\n if (n.countable && !n.deleted) {\n const c = n.content.getContent()\n for (let i = 0; i < c.length; i++) {\n cs.push(c[i])\n }\n }\n n = n.right\n }\n return cs\n}\n\n/**\n * @param {AbstractType} type\n * @param {Snapshot} snapshot\n * @return {Array}\n *\n * @private\n * @function\n */\nexport const typeListToArraySnapshot = (type, snapshot) => {\n const cs = []\n let n = type._start\n while (n !== null) {\n if (n.countable && isVisible(n, snapshot)) {\n const c = n.content.getContent()\n for (let i = 0; i < c.length; i++) {\n cs.push(c[i])\n }\n }\n n = n.right\n }\n return cs\n}\n\n/**\n * Executes a provided function on once on every element of this YArray.\n *\n * @param {AbstractType} type\n * @param {function(any,number,any):void} f A function to execute on every element of this YArray.\n *\n * @private\n * @function\n */\nexport const typeListForEach = (type, f) => {\n let index = 0\n let n = type._start\n type.doc ?? warnPrematureAccess()\n while (n !== null) {\n if (n.countable && !n.deleted) {\n const c = n.content.getContent()\n for (let i = 0; i < c.length; i++) {\n f(c[i], index++, type)\n }\n }\n n = n.right\n }\n}\n\n/**\n * @template C,R\n * @param {AbstractType} type\n * @param {function(C,number,AbstractType):R} f\n * @return {Array}\n *\n * @private\n * @function\n */\nexport const typeListMap = (type, f) => {\n /**\n * @type {Array}\n */\n const result = []\n typeListForEach(type, (c, i) => {\n result.push(f(c, i, type))\n })\n return result\n}\n\n/**\n * @param {AbstractType} type\n * @return {IterableIterator}\n *\n * @private\n * @function\n */\nexport const typeListCreateIterator = type => {\n let n = type._start\n /**\n * @type {Array|null}\n */\n let currentContent = null\n let currentContentIndex = 0\n return {\n [Symbol.iterator] () {\n return this\n },\n next: () => {\n // find some content\n if (currentContent === null) {\n while (n !== null && n.deleted) {\n n = n.right\n }\n // check if we reached the end, no need to check currentContent, because it does not exist\n if (n === null) {\n return {\n done: true,\n value: undefined\n }\n }\n // we found n, so we can set currentContent\n currentContent = n.content.getContent()\n currentContentIndex = 0\n n = n.right // we used the content of n, now iterate to next\n }\n const value = currentContent[currentContentIndex++]\n // check if we need to empty currentContent\n if (currentContent.length <= currentContentIndex) {\n currentContent = null\n }\n return {\n done: false,\n value\n }\n }\n }\n}\n\n/**\n * Executes a provided function on once on every element of this YArray.\n * Operates on a snapshotted state of the document.\n *\n * @param {AbstractType} type\n * @param {function(any,number,AbstractType):void} f A function to execute on every element of this YArray.\n * @param {Snapshot} snapshot\n *\n * @private\n * @function\n */\nexport const typeListForEachSnapshot = (type, f, snapshot) => {\n let index = 0\n let n = type._start\n while (n !== null) {\n if (n.countable && isVisible(n, snapshot)) {\n const c = n.content.getContent()\n for (let i = 0; i < c.length; i++) {\n f(c[i], index++, type)\n }\n }\n n = n.right\n }\n}\n\n/**\n * @param {AbstractType} type\n * @param {number} index\n * @return {any}\n *\n * @private\n * @function\n */\nexport const typeListGet = (type, index) => {\n type.doc ?? warnPrematureAccess()\n const marker = findMarker(type, index)\n let n = type._start\n if (marker !== null) {\n n = marker.p\n index -= marker.index\n }\n for (; n !== null; n = n.right) {\n if (!n.deleted && n.countable) {\n if (index < n.length) {\n return n.content.getContent()[index]\n }\n index -= n.length\n }\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {Item?} referenceItem\n * @param {Array|Array|boolean|number|null|string|Uint8Array>} content\n *\n * @private\n * @function\n */\nexport const typeListInsertGenericsAfter = (transaction, parent, referenceItem, content) => {\n let left = referenceItem\n const doc = transaction.doc\n const ownClientId = doc.clientID\n const store = doc.store\n const right = referenceItem === null ? parent._start : referenceItem.right\n /**\n * @type {Array|number|null>}\n */\n let jsonContent = []\n const packJsonContent = () => {\n if (jsonContent.length > 0) {\n left = new Item(createID(ownClientId, getState(store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentAny(jsonContent))\n left.integrate(transaction, 0)\n jsonContent = []\n }\n }\n content.forEach(c => {\n if (c === null) {\n jsonContent.push(c)\n } else {\n switch (c.constructor) {\n case Number:\n case Object:\n case Boolean:\n case Array:\n case String:\n jsonContent.push(c)\n break\n default:\n packJsonContent()\n switch (c.constructor) {\n case Uint8Array:\n case ArrayBuffer:\n left = new Item(createID(ownClientId, getState(store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentBinary(new Uint8Array(/** @type {Uint8Array} */ (c))))\n left.integrate(transaction, 0)\n break\n case Doc:\n left = new Item(createID(ownClientId, getState(store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentDoc(/** @type {Doc} */ (c)))\n left.integrate(transaction, 0)\n break\n default:\n if (c instanceof AbstractType) {\n left = new Item(createID(ownClientId, getState(store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentType(c))\n left.integrate(transaction, 0)\n } else {\n throw new Error('Unexpected content type in insert operation')\n }\n }\n }\n }\n })\n packJsonContent()\n}\n\nconst lengthExceeded = () => error.create('Length exceeded!')\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {number} index\n * @param {Array|Array|number|null|string|Uint8Array>} content\n *\n * @private\n * @function\n */\nexport const typeListInsertGenerics = (transaction, parent, index, content) => {\n if (index > parent._length) {\n throw lengthExceeded()\n }\n if (index === 0) {\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, index, content.length)\n }\n return typeListInsertGenericsAfter(transaction, parent, null, content)\n }\n const startIndex = index\n const marker = findMarker(parent, index)\n let n = parent._start\n if (marker !== null) {\n n = marker.p\n index -= marker.index\n // we need to iterate one to the left so that the algorithm works\n if (index === 0) {\n // @todo refactor this as it actually doesn't consider formats\n n = n.prev // important! get the left undeleted item so that we can actually decrease index\n index += (n && n.countable && !n.deleted) ? n.length : 0\n }\n }\n for (; n !== null; n = n.right) {\n if (!n.deleted && n.countable) {\n if (index <= n.length) {\n if (index < n.length) {\n // insert in-between\n getItemCleanStart(transaction, createID(n.id.client, n.id.clock + index))\n }\n break\n }\n index -= n.length\n }\n }\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, startIndex, content.length)\n }\n return typeListInsertGenericsAfter(transaction, parent, n, content)\n}\n\n/**\n * Pushing content is special as we generally want to push after the last item. So we don't have to update\n * the serach marker.\n *\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {Array|Array|number|null|string|Uint8Array>} content\n *\n * @private\n * @function\n */\nexport const typeListPushGenerics = (transaction, parent, content) => {\n // Use the marker with the highest index and iterate to the right.\n const marker = (parent._searchMarker || []).reduce((maxMarker, currMarker) => currMarker.index > maxMarker.index ? currMarker : maxMarker, { index: 0, p: parent._start })\n let n = marker.p\n if (n) {\n while (n.right) {\n n = n.right\n }\n }\n return typeListInsertGenericsAfter(transaction, parent, n, content)\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {number} index\n * @param {number} length\n *\n * @private\n * @function\n */\nexport const typeListDelete = (transaction, parent, index, length) => {\n if (length === 0) { return }\n const startIndex = index\n const startLength = length\n const marker = findMarker(parent, index)\n let n = parent._start\n if (marker !== null) {\n n = marker.p\n index -= marker.index\n }\n // compute the first item to be deleted\n for (; n !== null && index > 0; n = n.right) {\n if (!n.deleted && n.countable) {\n if (index < n.length) {\n getItemCleanStart(transaction, createID(n.id.client, n.id.clock + index))\n }\n index -= n.length\n }\n }\n // delete all items until done\n while (length > 0 && n !== null) {\n if (!n.deleted) {\n if (length < n.length) {\n getItemCleanStart(transaction, createID(n.id.client, n.id.clock + length))\n }\n n.delete(transaction)\n length -= n.length\n }\n n = n.right\n }\n if (length > 0) {\n throw lengthExceeded()\n }\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, startIndex, -startLength + length /* in case we remove the above exception */)\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {string} key\n *\n * @private\n * @function\n */\nexport const typeMapDelete = (transaction, parent, key) => {\n const c = parent._map.get(key)\n if (c !== undefined) {\n c.delete(transaction)\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {string} key\n * @param {Object|number|null|Array|string|Uint8Array|AbstractType} value\n *\n * @private\n * @function\n */\nexport const typeMapSet = (transaction, parent, key, value) => {\n const left = parent._map.get(key) || null\n const doc = transaction.doc\n const ownClientId = doc.clientID\n let content\n if (value == null) {\n content = new ContentAny([value])\n } else {\n switch (value.constructor) {\n case Number:\n case Object:\n case Boolean:\n case Array:\n case String:\n content = new ContentAny([value])\n break\n case Uint8Array:\n content = new ContentBinary(/** @type {Uint8Array} */ (value))\n break\n case Doc:\n content = new ContentDoc(/** @type {Doc} */ (value))\n break\n default:\n if (value instanceof AbstractType) {\n content = new ContentType(value)\n } else {\n throw new Error('Unexpected content type')\n }\n }\n }\n new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, null, null, parent, key, content).integrate(transaction, 0)\n}\n\n/**\n * @param {AbstractType} parent\n * @param {string} key\n * @return {Object|number|null|Array|string|Uint8Array|AbstractType|undefined}\n *\n * @private\n * @function\n */\nexport const typeMapGet = (parent, key) => {\n parent.doc ?? warnPrematureAccess()\n const val = parent._map.get(key)\n return val !== undefined && !val.deleted ? val.content.getContent()[val.length - 1] : undefined\n}\n\n/**\n * @param {AbstractType} parent\n * @return {Object|number|null|Array|string|Uint8Array|AbstractType|undefined>}\n *\n * @private\n * @function\n */\nexport const typeMapGetAll = (parent) => {\n /**\n * @type {Object}\n */\n const res = {}\n parent.doc ?? warnPrematureAccess()\n parent._map.forEach((value, key) => {\n if (!value.deleted) {\n res[key] = value.content.getContent()[value.length - 1]\n }\n })\n return res\n}\n\n/**\n * @param {AbstractType} parent\n * @param {string} key\n * @return {boolean}\n *\n * @private\n * @function\n */\nexport const typeMapHas = (parent, key) => {\n parent.doc ?? warnPrematureAccess()\n const val = parent._map.get(key)\n return val !== undefined && !val.deleted\n}\n\n/**\n * @param {AbstractType} parent\n * @param {string} key\n * @param {Snapshot} snapshot\n * @return {Object|number|null|Array|string|Uint8Array|AbstractType|undefined}\n *\n * @private\n * @function\n */\nexport const typeMapGetSnapshot = (parent, key, snapshot) => {\n let v = parent._map.get(key) || null\n while (v !== null && (!snapshot.sv.has(v.id.client) || v.id.clock >= (snapshot.sv.get(v.id.client) || 0))) {\n v = v.left\n }\n return v !== null && isVisible(v, snapshot) ? v.content.getContent()[v.length - 1] : undefined\n}\n\n/**\n * @param {AbstractType} parent\n * @param {Snapshot} snapshot\n * @return {Object|number|null|Array|string|Uint8Array|AbstractType|undefined>}\n *\n * @private\n * @function\n */\nexport const typeMapGetAllSnapshot = (parent, snapshot) => {\n /**\n * @type {Object}\n */\n const res = {}\n parent._map.forEach((value, key) => {\n /**\n * @type {Item|null}\n */\n let v = value\n while (v !== null && (!snapshot.sv.has(v.id.client) || v.id.clock >= (snapshot.sv.get(v.id.client) || 0))) {\n v = v.left\n }\n if (v !== null && isVisible(v, snapshot)) {\n res[key] = v.content.getContent()[v.length - 1]\n }\n })\n return res\n}\n\n/**\n * @param {AbstractType & { _map: Map }} type\n * @return {IterableIterator>}\n *\n * @private\n * @function\n */\nexport const createMapIterator = type => {\n type.doc ?? warnPrematureAccess()\n return iterator.iteratorFilter(type._map.entries(), /** @param {any} entry */ entry => !entry[1].deleted)\n}\n", "/**\n * @module YArray\n */\n\nimport {\n YEvent,\n AbstractType,\n typeListGet,\n typeListToArray,\n typeListForEach,\n typeListCreateIterator,\n typeListInsertGenerics,\n typeListPushGenerics,\n typeListDelete,\n typeListMap,\n YArrayRefID,\n callTypeObservers,\n transact,\n warnPrematureAccess,\n ArraySearchMarker, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, Transaction, Item // eslint-disable-line\n} from '../internals.js'\nimport { typeListSlice } from './AbstractType.js'\n\n/**\n * Event that describes the changes on a YArray\n * @template T\n * @extends YEvent>\n */\nexport class YArrayEvent extends YEvent {}\n\n/**\n * A shared Array implementation.\n * @template T\n * @extends AbstractType>\n * @implements {Iterable}\n */\nexport class YArray extends AbstractType {\n constructor () {\n super()\n /**\n * @type {Array?}\n * @private\n */\n this._prelimContent = []\n /**\n * @type {Array}\n */\n this._searchMarker = []\n }\n\n /**\n * Construct a new YArray containing the specified items.\n * @template {Object|Array|number|null|string|Uint8Array} T\n * @param {Array} items\n * @return {YArray}\n */\n static from (items) {\n /**\n * @type {YArray}\n */\n const a = new YArray()\n a.push(items)\n return a\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n this.insert(0, /** @type {Array} */ (this._prelimContent))\n this._prelimContent = null\n }\n\n /**\n * @return {YArray}\n */\n _copy () {\n return new YArray()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YArray}\n */\n clone () {\n /**\n * @type {YArray}\n */\n const arr = new YArray()\n arr.insert(0, this.toArray().map(el =>\n el instanceof AbstractType ? /** @type {typeof el} */ (el.clone()) : el\n ))\n return arr\n }\n\n get length () {\n this.doc ?? warnPrematureAccess()\n return this._length\n }\n\n /**\n * Creates YArrayEvent and calls observers.\n *\n * @param {Transaction} transaction\n * @param {Set} parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, parentSubs) {\n super._callObserver(transaction, parentSubs)\n callTypeObservers(this, transaction, new YArrayEvent(this, transaction))\n }\n\n /**\n * Inserts new content at an index.\n *\n * Important: This function expects an array of content. Not just a content\n * object. The reason for this \"weirdness\" is that inserting several elements\n * is very efficient when it is done as a single operation.\n *\n * @example\n * // Insert character 'a' at position 0\n * yarray.insert(0, ['a'])\n * // Insert numbers 1, 2 at position 1\n * yarray.insert(1, [1, 2])\n *\n * @param {number} index The index to insert content at.\n * @param {Array} content The array of content\n */\n insert (index, content) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListInsertGenerics(transaction, this, index, /** @type {any} */ (content))\n })\n } else {\n /** @type {Array} */ (this._prelimContent).splice(index, 0, ...content)\n }\n }\n\n /**\n * Appends content to this YArray.\n *\n * @param {Array} content Array of content to append.\n *\n * @todo Use the following implementation in all types.\n */\n push (content) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListPushGenerics(transaction, this, /** @type {any} */ (content))\n })\n } else {\n /** @type {Array} */ (this._prelimContent).push(...content)\n }\n }\n\n /**\n * Prepends content to this YArray.\n *\n * @param {Array} content Array of content to prepend.\n */\n unshift (content) {\n this.insert(0, content)\n }\n\n /**\n * Deletes elements starting from an index.\n *\n * @param {number} index Index at which to start deleting elements\n * @param {number} length The number of elements to remove. Defaults to 1.\n */\n delete (index, length = 1) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListDelete(transaction, this, index, length)\n })\n } else {\n /** @type {Array} */ (this._prelimContent).splice(index, length)\n }\n }\n\n /**\n * Returns the i-th element from a YArray.\n *\n * @param {number} index The index of the element to return from the YArray\n * @return {T}\n */\n get (index) {\n return typeListGet(this, index)\n }\n\n /**\n * Transforms this YArray to a JavaScript Array.\n *\n * @return {Array}\n */\n toArray () {\n return typeListToArray(this)\n }\n\n /**\n * Returns a portion of this YArray into a JavaScript Array selected\n * from start to end (end not included).\n *\n * @param {number} [start]\n * @param {number} [end]\n * @return {Array}\n */\n slice (start = 0, end = this.length) {\n return typeListSlice(this, start, end)\n }\n\n /**\n * Transforms this Shared Type to a JSON object.\n *\n * @return {Array}\n */\n toJSON () {\n return this.map(c => c instanceof AbstractType ? c.toJSON() : c)\n }\n\n /**\n * Returns an Array with the result of calling a provided function on every\n * element of this YArray.\n *\n * @template M\n * @param {function(T,number,YArray):M} f Function that produces an element of the new Array\n * @return {Array} A new array with each element being the result of the\n * callback function\n */\n map (f) {\n return typeListMap(this, /** @type {any} */ (f))\n }\n\n /**\n * Executes a provided function once on every element of this YArray.\n *\n * @param {function(T,number,YArray):void} f A function to execute on every element of this YArray.\n */\n forEach (f) {\n typeListForEach(this, f)\n }\n\n /**\n * @return {IterableIterator}\n */\n [Symbol.iterator] () {\n return typeListCreateIterator(this)\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n _write (encoder) {\n encoder.writeTypeRef(YArrayRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} _decoder\n *\n * @private\n * @function\n */\nexport const readYArray = _decoder => new YArray()\n", "/**\n * @module YMap\n */\n\nimport {\n YEvent,\n AbstractType,\n typeMapDelete,\n typeMapSet,\n typeMapGet,\n typeMapHas,\n createMapIterator,\n YMapRefID,\n callTypeObservers,\n transact,\n warnPrematureAccess,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, Transaction, Item // eslint-disable-line\n} from '../internals.js'\n\nimport * as iterator from 'lib0/iterator'\n\n/**\n * @template T\n * @extends YEvent>\n * Event that describes the changes on a YMap.\n */\nexport class YMapEvent extends YEvent {\n /**\n * @param {YMap} ymap The YArray that changed.\n * @param {Transaction} transaction\n * @param {Set} subs The keys that changed.\n */\n constructor (ymap, transaction, subs) {\n super(ymap, transaction)\n this.keysChanged = subs\n }\n}\n\n/**\n * @template MapType\n * A shared Map implementation.\n *\n * @extends AbstractType>\n * @implements {Iterable<[string, MapType]>}\n */\nexport class YMap extends AbstractType {\n /**\n *\n * @param {Iterable=} entries - an optional iterable to initialize the YMap\n */\n constructor (entries) {\n super()\n /**\n * @type {Map?}\n * @private\n */\n this._prelimContent = null\n\n if (entries === undefined) {\n this._prelimContent = new Map()\n } else {\n this._prelimContent = new Map(entries)\n }\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n ;/** @type {Map} */ (this._prelimContent).forEach((value, key) => {\n this.set(key, value)\n })\n this._prelimContent = null\n }\n\n /**\n * @return {YMap}\n */\n _copy () {\n return new YMap()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YMap}\n */\n clone () {\n /**\n * @type {YMap}\n */\n const map = new YMap()\n this.forEach((value, key) => {\n map.set(key, value instanceof AbstractType ? /** @type {typeof value} */ (value.clone()) : value)\n })\n return map\n }\n\n /**\n * Creates YMapEvent and calls observers.\n *\n * @param {Transaction} transaction\n * @param {Set} parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, parentSubs) {\n callTypeObservers(this, transaction, new YMapEvent(this, transaction, parentSubs))\n }\n\n /**\n * Transforms this Shared Type to a JSON object.\n *\n * @return {Object}\n */\n toJSON () {\n this.doc ?? warnPrematureAccess()\n /**\n * @type {Object}\n */\n const map = {}\n this._map.forEach((item, key) => {\n if (!item.deleted) {\n const v = item.content.getContent()[item.length - 1]\n map[key] = v instanceof AbstractType ? v.toJSON() : v\n }\n })\n return map\n }\n\n /**\n * Returns the size of the YMap (count of key/value pairs)\n *\n * @return {number}\n */\n get size () {\n return [...createMapIterator(this)].length\n }\n\n /**\n * Returns the keys for each element in the YMap Type.\n *\n * @return {IterableIterator}\n */\n keys () {\n return iterator.iteratorMap(createMapIterator(this), /** @param {any} v */ v => v[0])\n }\n\n /**\n * Returns the values for each element in the YMap Type.\n *\n * @return {IterableIterator}\n */\n values () {\n return iterator.iteratorMap(createMapIterator(this), /** @param {any} v */ v => v[1].content.getContent()[v[1].length - 1])\n }\n\n /**\n * Returns an Iterator of [key, value] pairs\n *\n * @return {IterableIterator<[string, MapType]>}\n */\n entries () {\n return iterator.iteratorMap(createMapIterator(this), /** @param {any} v */ v => /** @type {any} */ ([v[0], v[1].content.getContent()[v[1].length - 1]]))\n }\n\n /**\n * Executes a provided function on once on every key-value pair.\n *\n * @param {function(MapType,string,YMap):void} f A function to execute on every element of this YArray.\n */\n forEach (f) {\n this.doc ?? warnPrematureAccess()\n this._map.forEach((item, key) => {\n if (!item.deleted) {\n f(item.content.getContent()[item.length - 1], key, this)\n }\n })\n }\n\n /**\n * Returns an Iterator of [key, value] pairs\n *\n * @return {IterableIterator<[string, MapType]>}\n */\n [Symbol.iterator] () {\n return this.entries()\n }\n\n /**\n * Remove a specified element from this YMap.\n *\n * @param {string} key The key of the element to remove.\n */\n delete (key) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapDelete(transaction, this, key)\n })\n } else {\n /** @type {Map} */ (this._prelimContent).delete(key)\n }\n }\n\n /**\n * Adds or updates an element with a specified key and value.\n * @template {MapType} VAL\n *\n * @param {string} key The key of the element to add to this YMap\n * @param {VAL} value The value of the element to add\n * @return {VAL}\n */\n set (key, value) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapSet(transaction, this, key, /** @type {any} */ (value))\n })\n } else {\n /** @type {Map} */ (this._prelimContent).set(key, value)\n }\n return value\n }\n\n /**\n * Returns a specified element from this YMap.\n *\n * @param {string} key\n * @return {MapType|undefined}\n */\n get (key) {\n return /** @type {any} */ (typeMapGet(this, key))\n }\n\n /**\n * Returns a boolean indicating whether the specified key exists or not.\n *\n * @param {string} key The key to test.\n * @return {boolean}\n */\n has (key) {\n return typeMapHas(this, key)\n }\n\n /**\n * Removes all elements from this YMap.\n */\n clear () {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n this.forEach(function (_value, key, map) {\n typeMapDelete(transaction, map, key)\n })\n })\n } else {\n /** @type {Map} */ (this._prelimContent).clear()\n }\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n _write (encoder) {\n encoder.writeTypeRef(YMapRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} _decoder\n *\n * @private\n * @function\n */\nexport const readYMap = _decoder => new YMap()\n", "/**\n * @module YText\n */\n\nimport {\n YEvent,\n AbstractType,\n getItemCleanStart,\n getState,\n isVisible,\n createID,\n YTextRefID,\n callTypeObservers,\n transact,\n ContentEmbed,\n GC,\n ContentFormat,\n ContentString,\n splitSnapshotAffectedStructs,\n iterateDeletedStructs,\n iterateStructs,\n findMarker,\n typeMapDelete,\n typeMapSet,\n typeMapGet,\n typeMapGetAll,\n updateMarkerChanges,\n ContentType,\n warnPrematureAccess,\n ArraySearchMarker, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, ID, Doc, Item, Snapshot, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as object from 'lib0/object'\nimport * as map from 'lib0/map'\nimport * as error from 'lib0/error'\n\n/**\n * @param {any} a\n * @param {any} b\n * @return {boolean}\n */\nconst equalAttrs = (a, b) => a === b || (typeof a === 'object' && typeof b === 'object' && a && b && object.equalFlat(a, b))\n\nexport class ItemTextListPosition {\n /**\n * @param {Item|null} left\n * @param {Item|null} right\n * @param {number} index\n * @param {Map} currentAttributes\n */\n constructor (left, right, index, currentAttributes) {\n this.left = left\n this.right = right\n this.index = index\n this.currentAttributes = currentAttributes\n }\n\n /**\n * Only call this if you know that this.right is defined\n */\n forward () {\n if (this.right === null) {\n error.unexpectedCase()\n }\n switch (this.right.content.constructor) {\n case ContentFormat:\n if (!this.right.deleted) {\n updateCurrentAttributes(this.currentAttributes, /** @type {ContentFormat} */ (this.right.content))\n }\n break\n default:\n if (!this.right.deleted) {\n this.index += this.right.length\n }\n break\n }\n this.left = this.right\n this.right = this.right.right\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {ItemTextListPosition} pos\n * @param {number} count steps to move forward\n * @return {ItemTextListPosition}\n *\n * @private\n * @function\n */\nconst findNextPosition = (transaction, pos, count) => {\n while (pos.right !== null && count > 0) {\n switch (pos.right.content.constructor) {\n case ContentFormat:\n if (!pos.right.deleted) {\n updateCurrentAttributes(pos.currentAttributes, /** @type {ContentFormat} */ (pos.right.content))\n }\n break\n default:\n if (!pos.right.deleted) {\n if (count < pos.right.length) {\n // split right\n getItemCleanStart(transaction, createID(pos.right.id.client, pos.right.id.clock + count))\n }\n pos.index += pos.right.length\n count -= pos.right.length\n }\n break\n }\n pos.left = pos.right\n pos.right = pos.right.right\n // pos.forward() - we don't forward because that would halve the performance because we already do the checks above\n }\n return pos\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {number} index\n * @param {boolean} useSearchMarker\n * @return {ItemTextListPosition}\n *\n * @private\n * @function\n */\nconst findPosition = (transaction, parent, index, useSearchMarker) => {\n const currentAttributes = new Map()\n const marker = useSearchMarker ? findMarker(parent, index) : null\n if (marker) {\n const pos = new ItemTextListPosition(marker.p.left, marker.p, marker.index, currentAttributes)\n return findNextPosition(transaction, pos, index - marker.index)\n } else {\n const pos = new ItemTextListPosition(null, parent._start, 0, currentAttributes)\n return findNextPosition(transaction, pos, index)\n }\n}\n\n/**\n * Negate applied formats\n *\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {ItemTextListPosition} currPos\n * @param {Map} negatedAttributes\n *\n * @private\n * @function\n */\nconst insertNegatedAttributes = (transaction, parent, currPos, negatedAttributes) => {\n // check if we really need to remove attributes\n while (\n currPos.right !== null && (\n currPos.right.deleted === true || (\n currPos.right.content.constructor === ContentFormat &&\n equalAttrs(negatedAttributes.get(/** @type {ContentFormat} */ (currPos.right.content).key), /** @type {ContentFormat} */ (currPos.right.content).value)\n )\n )\n ) {\n if (!currPos.right.deleted) {\n negatedAttributes.delete(/** @type {ContentFormat} */ (currPos.right.content).key)\n }\n currPos.forward()\n }\n const doc = transaction.doc\n const ownClientId = doc.clientID\n negatedAttributes.forEach((val, key) => {\n const left = currPos.left\n const right = currPos.right\n const nextFormat = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentFormat(key, val))\n nextFormat.integrate(transaction, 0)\n currPos.right = nextFormat\n currPos.forward()\n })\n}\n\n/**\n * @param {Map} currentAttributes\n * @param {ContentFormat} format\n *\n * @private\n * @function\n */\nconst updateCurrentAttributes = (currentAttributes, format) => {\n const { key, value } = format\n if (value === null) {\n currentAttributes.delete(key)\n } else {\n currentAttributes.set(key, value)\n }\n}\n\n/**\n * @param {ItemTextListPosition} currPos\n * @param {Object} attributes\n *\n * @private\n * @function\n */\nconst minimizeAttributeChanges = (currPos, attributes) => {\n // go right while attributes[right.key] === right.value (or right is deleted)\n while (true) {\n if (currPos.right === null) {\n break\n } else if (currPos.right.deleted || (currPos.right.content.constructor === ContentFormat && equalAttrs(attributes[(/** @type {ContentFormat} */ (currPos.right.content)).key] ?? null, /** @type {ContentFormat} */ (currPos.right.content).value))) {\n //\n } else {\n break\n }\n currPos.forward()\n }\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {ItemTextListPosition} currPos\n * @param {Object} attributes\n * @return {Map}\n *\n * @private\n * @function\n **/\nconst insertAttributes = (transaction, parent, currPos, attributes) => {\n const doc = transaction.doc\n const ownClientId = doc.clientID\n const negatedAttributes = new Map()\n // insert format-start items\n for (const key in attributes) {\n const val = attributes[key]\n const currentVal = currPos.currentAttributes.get(key) ?? null\n if (!equalAttrs(currentVal, val)) {\n // save negated attribute (set null if currentVal undefined)\n negatedAttributes.set(key, currentVal)\n const { left, right } = currPos\n currPos.right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentFormat(key, val))\n currPos.right.integrate(transaction, 0)\n currPos.forward()\n }\n }\n return negatedAttributes\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {ItemTextListPosition} currPos\n * @param {string|object|AbstractType} text\n * @param {Object} attributes\n *\n * @private\n * @function\n **/\nconst insertText = (transaction, parent, currPos, text, attributes) => {\n currPos.currentAttributes.forEach((_val, key) => {\n if (attributes[key] === undefined) {\n attributes[key] = null\n }\n })\n const doc = transaction.doc\n const ownClientId = doc.clientID\n minimizeAttributeChanges(currPos, attributes)\n const negatedAttributes = insertAttributes(transaction, parent, currPos, attributes)\n // insert content\n const content = text.constructor === String ? new ContentString(/** @type {string} */ (text)) : (text instanceof AbstractType ? new ContentType(text) : new ContentEmbed(text))\n let { left, right, index } = currPos\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, currPos.index, content.getLength())\n }\n right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, content)\n right.integrate(transaction, 0)\n currPos.right = right\n currPos.index = index\n currPos.forward()\n insertNegatedAttributes(transaction, parent, currPos, negatedAttributes)\n}\n\n/**\n * @param {Transaction} transaction\n * @param {AbstractType} parent\n * @param {ItemTextListPosition} currPos\n * @param {number} length\n * @param {Object} attributes\n *\n * @private\n * @function\n */\nconst formatText = (transaction, parent, currPos, length, attributes) => {\n const doc = transaction.doc\n const ownClientId = doc.clientID\n minimizeAttributeChanges(currPos, attributes)\n const negatedAttributes = insertAttributes(transaction, parent, currPos, attributes)\n // iterate until first non-format or null is found\n // delete all formats with attributes[format.key] != null\n // also check the attributes after the first non-format as we do not want to insert redundant negated attributes there\n // eslint-disable-next-line no-labels\n iterationLoop: while (\n currPos.right !== null &&\n (length > 0 ||\n (\n negatedAttributes.size > 0 &&\n (currPos.right.deleted || currPos.right.content.constructor === ContentFormat)\n )\n )\n ) {\n if (!currPos.right.deleted) {\n switch (currPos.right.content.constructor) {\n case ContentFormat: {\n const { key, value } = /** @type {ContentFormat} */ (currPos.right.content)\n const attr = attributes[key]\n if (attr !== undefined) {\n if (equalAttrs(attr, value)) {\n negatedAttributes.delete(key)\n } else {\n if (length === 0) {\n // no need to further extend negatedAttributes\n // eslint-disable-next-line no-labels\n break iterationLoop\n }\n negatedAttributes.set(key, value)\n }\n currPos.right.delete(transaction)\n } else {\n currPos.currentAttributes.set(key, value)\n }\n break\n }\n default:\n if (length < currPos.right.length) {\n getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length))\n }\n length -= currPos.right.length\n break\n }\n }\n currPos.forward()\n }\n // Quill just assumes that the editor starts with a newline and that it always\n // ends with a newline. We only insert that newline when a new newline is\n // inserted - i.e when length is bigger than type.length\n if (length > 0) {\n let newlines = ''\n for (; length > 0; length--) {\n newlines += '\\n'\n }\n currPos.right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), currPos.left, currPos.left && currPos.left.lastId, currPos.right, currPos.right && currPos.right.id, parent, null, new ContentString(newlines))\n currPos.right.integrate(transaction, 0)\n currPos.forward()\n }\n insertNegatedAttributes(transaction, parent, currPos, negatedAttributes)\n}\n\n/**\n * Call this function after string content has been deleted in order to\n * clean up formatting Items.\n *\n * @param {Transaction} transaction\n * @param {Item} start\n * @param {Item|null} curr exclusive end, automatically iterates to the next Content Item\n * @param {Map} startAttributes\n * @param {Map} currAttributes\n * @return {number} The amount of formatting Items deleted.\n *\n * @function\n */\nconst cleanupFormattingGap = (transaction, start, curr, startAttributes, currAttributes) => {\n /**\n * @type {Item|null}\n */\n let end = start\n /**\n * @type {Map}\n */\n const endFormats = map.create()\n while (end && (!end.countable || end.deleted)) {\n if (!end.deleted && end.content.constructor === ContentFormat) {\n const cf = /** @type {ContentFormat} */ (end.content)\n endFormats.set(cf.key, cf)\n }\n end = end.right\n }\n let cleanups = 0\n let reachedCurr = false\n while (start !== end) {\n if (curr === start) {\n reachedCurr = true\n }\n if (!start.deleted) {\n const content = start.content\n switch (content.constructor) {\n case ContentFormat: {\n const { key, value } = /** @type {ContentFormat} */ (content)\n const startAttrValue = startAttributes.get(key) ?? null\n if (endFormats.get(key) !== content || startAttrValue === value) {\n // Either this format is overwritten or it is not necessary because the attribute already existed.\n start.delete(transaction)\n cleanups++\n if (!reachedCurr && (currAttributes.get(key) ?? null) === value && startAttrValue !== value) {\n if (startAttrValue === null) {\n currAttributes.delete(key)\n } else {\n currAttributes.set(key, startAttrValue)\n }\n }\n }\n if (!reachedCurr && !start.deleted) {\n updateCurrentAttributes(currAttributes, /** @type {ContentFormat} */ (content))\n }\n break\n }\n }\n }\n start = /** @type {Item} */ (start.right)\n }\n return cleanups\n}\n\n/**\n * @param {Transaction} transaction\n * @param {Item | null} item\n */\nconst cleanupContextlessFormattingGap = (transaction, item) => {\n // iterate until item.right is null or content\n while (item && item.right && (item.right.deleted || !item.right.countable)) {\n item = item.right\n }\n const attrs = new Set()\n // iterate back until a content item is found\n while (item && (item.deleted || !item.countable)) {\n if (!item.deleted && item.content.constructor === ContentFormat) {\n const key = /** @type {ContentFormat} */ (item.content).key\n if (attrs.has(key)) {\n item.delete(transaction)\n } else {\n attrs.add(key)\n }\n }\n item = item.left\n }\n}\n\n/**\n * This function is experimental and subject to change / be removed.\n *\n * Ideally, we don't need this function at all. Formatting attributes should be cleaned up\n * automatically after each change. This function iterates twice over the complete YText type\n * and removes unnecessary formatting attributes. This is also helpful for testing.\n *\n * This function won't be exported anymore as soon as there is confidence that the YText type works as intended.\n *\n * @param {YText} type\n * @return {number} How many formatting attributes have been cleaned up.\n */\nexport const cleanupYTextFormatting = type => {\n let res = 0\n transact(/** @type {Doc} */ (type.doc), transaction => {\n let start = /** @type {Item} */ (type._start)\n let end = type._start\n let startAttributes = map.create()\n const currentAttributes = map.copy(startAttributes)\n while (end) {\n if (end.deleted === false) {\n switch (end.content.constructor) {\n case ContentFormat:\n updateCurrentAttributes(currentAttributes, /** @type {ContentFormat} */ (end.content))\n break\n default:\n res += cleanupFormattingGap(transaction, start, end, startAttributes, currentAttributes)\n startAttributes = map.copy(currentAttributes)\n start = end\n break\n }\n }\n end = end.right\n }\n })\n return res\n}\n\n/**\n * This will be called by the transction once the event handlers are called to potentially cleanup\n * formatting attributes.\n *\n * @param {Transaction} transaction\n */\nexport const cleanupYTextAfterTransaction = transaction => {\n /**\n * @type {Set}\n */\n const needFullCleanup = new Set()\n // check if another formatting item was inserted\n const doc = transaction.doc\n for (const [client, afterClock] of transaction.afterState.entries()) {\n const clock = transaction.beforeState.get(client) || 0\n if (afterClock === clock) {\n continue\n }\n iterateStructs(transaction, /** @type {Array} */ (doc.store.clients.get(client)), clock, afterClock, item => {\n if (\n !item.deleted && /** @type {Item} */ (item).content.constructor === ContentFormat && item.constructor !== GC\n ) {\n needFullCleanup.add(/** @type {any} */ (item).parent)\n }\n })\n }\n // cleanup in a new transaction\n transact(doc, (t) => {\n iterateDeletedStructs(transaction, transaction.deleteSet, item => {\n if (item instanceof GC || !(/** @type {YText} */ (item.parent)._hasFormatting) || needFullCleanup.has(/** @type {YText} */ (item.parent))) {\n return\n }\n const parent = /** @type {YText} */ (item.parent)\n if (item.content.constructor === ContentFormat) {\n needFullCleanup.add(parent)\n } else {\n // If no formatting attribute was inserted or deleted, we can make due with contextless\n // formatting cleanups.\n // Contextless: it is not necessary to compute currentAttributes for the affected position.\n cleanupContextlessFormattingGap(t, item)\n }\n })\n // If a formatting item was inserted, we simply clean the whole type.\n // We need to compute currentAttributes for the current position anyway.\n for (const yText of needFullCleanup) {\n cleanupYTextFormatting(yText)\n }\n })\n}\n\n/**\n * @param {Transaction} transaction\n * @param {ItemTextListPosition} currPos\n * @param {number} length\n * @return {ItemTextListPosition}\n *\n * @private\n * @function\n */\nconst deleteText = (transaction, currPos, length) => {\n const startLength = length\n const startAttrs = map.copy(currPos.currentAttributes)\n const start = currPos.right\n while (length > 0 && currPos.right !== null) {\n if (currPos.right.deleted === false) {\n switch (currPos.right.content.constructor) {\n case ContentType:\n case ContentEmbed:\n case ContentString:\n if (length < currPos.right.length) {\n getItemCleanStart(transaction, createID(currPos.right.id.client, currPos.right.id.clock + length))\n }\n length -= currPos.right.length\n currPos.right.delete(transaction)\n break\n }\n }\n currPos.forward()\n }\n if (start) {\n cleanupFormattingGap(transaction, start, currPos.right, startAttrs, currPos.currentAttributes)\n }\n const parent = /** @type {AbstractType} */ (/** @type {Item} */ (currPos.left || currPos.right).parent)\n if (parent._searchMarker) {\n updateMarkerChanges(parent._searchMarker, currPos.index, -startLength + length)\n }\n return currPos\n}\n\n/**\n * The Quill Delta format represents changes on a text document with\n * formatting information. For mor information visit {@link https://quilljs.com/docs/delta/|Quill Delta}\n *\n * @example\n * {\n * ops: [\n * { insert: 'Gandalf', attributes: { bold: true } },\n * { insert: ' the ' },\n * { insert: 'Grey', attributes: { color: '#cccccc' } }\n * ]\n * }\n *\n */\n\n/**\n * Attributes that can be assigned to a selection of text.\n *\n * @example\n * {\n * bold: true,\n * font-size: '40px'\n * }\n *\n * @typedef {Object} TextAttributes\n */\n\n/**\n * @extends YEvent\n * Event that describes the changes on a YText type.\n */\nexport class YTextEvent extends YEvent {\n /**\n * @param {YText} ytext\n * @param {Transaction} transaction\n * @param {Set} subs The keys that changed\n */\n constructor (ytext, transaction, subs) {\n super(ytext, transaction)\n /**\n * Whether the children changed.\n * @type {Boolean}\n * @private\n */\n this.childListChanged = false\n /**\n * Set of all changed attributes.\n * @type {Set}\n */\n this.keysChanged = new Set()\n subs.forEach((sub) => {\n if (sub === null) {\n this.childListChanged = true\n } else {\n this.keysChanged.add(sub)\n }\n })\n }\n\n /**\n * @type {{added:Set,deleted:Set,keys:Map,delta:Array<{insert?:Array|string, delete?:number, retain?:number}>}}\n */\n get changes () {\n if (this._changes === null) {\n /**\n * @type {{added:Set,deleted:Set,keys:Map,delta:Array<{insert?:Array|string|AbstractType|object, delete?:number, retain?:number}>}}\n */\n const changes = {\n keys: this.keys,\n delta: this.delta,\n added: new Set(),\n deleted: new Set()\n }\n this._changes = changes\n }\n return /** @type {any} */ (this._changes)\n }\n\n /**\n * Compute the changes in the delta format.\n * A {@link https://quilljs.com/docs/delta/|Quill Delta}) that represents the changes on the document.\n *\n * @type {Array<{insert?:string|object|AbstractType, delete?:number, retain?:number, attributes?: Object}>}\n *\n * @public\n */\n get delta () {\n if (this._delta === null) {\n const y = /** @type {Doc} */ (this.target.doc)\n /**\n * @type {Array<{insert?:string|object|AbstractType, delete?:number, retain?:number, attributes?: Object}>}\n */\n const delta = []\n transact(y, transaction => {\n const currentAttributes = new Map() // saves all current attributes for insert\n const oldAttributes = new Map()\n let item = this.target._start\n /**\n * @type {string?}\n */\n let action = null\n /**\n * @type {Object}\n */\n const attributes = {} // counts added or removed new attributes for retain\n /**\n * @type {string|object}\n */\n let insert = ''\n let retain = 0\n let deleteLen = 0\n const addOp = () => {\n if (action !== null) {\n /**\n * @type {any}\n */\n let op = null\n switch (action) {\n case 'delete':\n if (deleteLen > 0) {\n op = { delete: deleteLen }\n }\n deleteLen = 0\n break\n case 'insert':\n if (typeof insert === 'object' || insert.length > 0) {\n op = { insert }\n if (currentAttributes.size > 0) {\n op.attributes = {}\n currentAttributes.forEach((value, key) => {\n if (value !== null) {\n op.attributes[key] = value\n }\n })\n }\n }\n insert = ''\n break\n case 'retain':\n if (retain > 0) {\n op = { retain }\n if (!object.isEmpty(attributes)) {\n op.attributes = object.assign({}, attributes)\n }\n }\n retain = 0\n break\n }\n if (op) delta.push(op)\n action = null\n }\n }\n while (item !== null) {\n switch (item.content.constructor) {\n case ContentType:\n case ContentEmbed:\n if (this.adds(item)) {\n if (!this.deletes(item)) {\n addOp()\n action = 'insert'\n insert = item.content.getContent()[0]\n addOp()\n }\n } else if (this.deletes(item)) {\n if (action !== 'delete') {\n addOp()\n action = 'delete'\n }\n deleteLen += 1\n } else if (!item.deleted) {\n if (action !== 'retain') {\n addOp()\n action = 'retain'\n }\n retain += 1\n }\n break\n case ContentString:\n if (this.adds(item)) {\n if (!this.deletes(item)) {\n if (action !== 'insert') {\n addOp()\n action = 'insert'\n }\n insert += /** @type {ContentString} */ (item.content).str\n }\n } else if (this.deletes(item)) {\n if (action !== 'delete') {\n addOp()\n action = 'delete'\n }\n deleteLen += item.length\n } else if (!item.deleted) {\n if (action !== 'retain') {\n addOp()\n action = 'retain'\n }\n retain += item.length\n }\n break\n case ContentFormat: {\n const { key, value } = /** @type {ContentFormat} */ (item.content)\n if (this.adds(item)) {\n if (!this.deletes(item)) {\n const curVal = currentAttributes.get(key) ?? null\n if (!equalAttrs(curVal, value)) {\n if (action === 'retain') {\n addOp()\n }\n if (equalAttrs(value, (oldAttributes.get(key) ?? null))) {\n delete attributes[key]\n } else {\n attributes[key] = value\n }\n } else if (value !== null) {\n item.delete(transaction)\n }\n }\n } else if (this.deletes(item)) {\n oldAttributes.set(key, value)\n const curVal = currentAttributes.get(key) ?? null\n if (!equalAttrs(curVal, value)) {\n if (action === 'retain') {\n addOp()\n }\n attributes[key] = curVal\n }\n } else if (!item.deleted) {\n oldAttributes.set(key, value)\n const attr = attributes[key]\n if (attr !== undefined) {\n if (!equalAttrs(attr, value)) {\n if (action === 'retain') {\n addOp()\n }\n if (value === null) {\n delete attributes[key]\n } else {\n attributes[key] = value\n }\n } else if (attr !== null) { // this will be cleaned up automatically by the contextless cleanup function\n item.delete(transaction)\n }\n }\n }\n if (!item.deleted) {\n if (action === 'insert') {\n addOp()\n }\n updateCurrentAttributes(currentAttributes, /** @type {ContentFormat} */ (item.content))\n }\n break\n }\n }\n item = item.right\n }\n addOp()\n while (delta.length > 0) {\n const lastOp = delta[delta.length - 1]\n if (lastOp.retain !== undefined && lastOp.attributes === undefined) {\n // retain delta's if they don't assign attributes\n delta.pop()\n } else {\n break\n }\n }\n })\n this._delta = delta\n }\n return /** @type {any} */ (this._delta)\n }\n}\n\n/**\n * Type that represents text with formatting information.\n *\n * This type replaces y-richtext as this implementation is able to handle\n * block formats (format information on a paragraph), embeds (complex elements\n * like pictures and videos), and text formats (**bold**, *italic*).\n *\n * @extends AbstractType\n */\nexport class YText extends AbstractType {\n /**\n * @param {String} [string] The initial value of the YText.\n */\n constructor (string) {\n super()\n /**\n * Array of pending operations on this type\n * @type {Array?}\n */\n this._pending = string !== undefined ? [() => this.insert(0, string)] : []\n /**\n * @type {Array|null}\n */\n this._searchMarker = []\n /**\n * Whether this YText contains formatting attributes.\n * This flag is updated when a formatting item is integrated (see ContentFormat.integrate)\n */\n this._hasFormatting = false\n }\n\n /**\n * Number of characters of this text type.\n *\n * @type {number}\n */\n get length () {\n this.doc ?? warnPrematureAccess()\n return this._length\n }\n\n /**\n * @param {Doc} y\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n try {\n /** @type {Array} */ (this._pending).forEach(f => f())\n } catch (e) {\n console.error(e)\n }\n this._pending = null\n }\n\n _copy () {\n return new YText()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YText}\n */\n clone () {\n const text = new YText()\n text.applyDelta(this.toDelta())\n return text\n }\n\n /**\n * Creates YTextEvent and calls observers.\n *\n * @param {Transaction} transaction\n * @param {Set} parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, parentSubs) {\n super._callObserver(transaction, parentSubs)\n const event = new YTextEvent(this, transaction, parentSubs)\n callTypeObservers(this, transaction, event)\n // If a remote change happened, we try to cleanup potential formatting duplicates.\n if (!transaction.local && this._hasFormatting) {\n transaction._needFormattingCleanup = true\n }\n }\n\n /**\n * Returns the unformatted string representation of this YText type.\n *\n * @public\n */\n toString () {\n this.doc ?? warnPrematureAccess()\n let str = ''\n /**\n * @type {Item|null}\n */\n let n = this._start\n while (n !== null) {\n if (!n.deleted && n.countable && n.content.constructor === ContentString) {\n str += /** @type {ContentString} */ (n.content).str\n }\n n = n.right\n }\n return str\n }\n\n /**\n * Returns the unformatted string representation of this YText type.\n *\n * @return {string}\n * @public\n */\n toJSON () {\n return this.toString()\n }\n\n /**\n * Apply a {@link Delta} on this shared YText type.\n *\n * @param {any} delta The changes to apply on this element.\n * @param {object} opts\n * @param {boolean} [opts.sanitize] Sanitize input delta. Removes ending newlines if set to true.\n *\n *\n * @public\n */\n applyDelta (delta, { sanitize = true } = {}) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n const currPos = new ItemTextListPosition(null, this._start, 0, new Map())\n for (let i = 0; i < delta.length; i++) {\n const op = delta[i]\n if (op.insert !== undefined) {\n // Quill assumes that the content starts with an empty paragraph.\n // Yjs/Y.Text assumes that it starts empty. We always hide that\n // there is a newline at the end of the content.\n // If we omit this step, clients will see a different number of\n // paragraphs, but nothing bad will happen.\n const ins = (!sanitize && typeof op.insert === 'string' && i === delta.length - 1 && currPos.right === null && op.insert.slice(-1) === '\\n') ? op.insert.slice(0, -1) : op.insert\n if (typeof ins !== 'string' || ins.length > 0) {\n insertText(transaction, this, currPos, ins, op.attributes || {})\n }\n } else if (op.retain !== undefined) {\n formatText(transaction, this, currPos, op.retain, op.attributes || {})\n } else if (op.delete !== undefined) {\n deleteText(transaction, currPos, op.delete)\n }\n }\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.applyDelta(delta))\n }\n }\n\n /**\n * Returns the Delta representation of this YText type.\n *\n * @param {Snapshot} [snapshot]\n * @param {Snapshot} [prevSnapshot]\n * @param {function('removed' | 'added', ID):any} [computeYChange]\n * @return {any} The Delta representation of this type.\n *\n * @public\n */\n toDelta (snapshot, prevSnapshot, computeYChange) {\n this.doc ?? warnPrematureAccess()\n /**\n * @type{Array}\n */\n const ops = []\n const currentAttributes = new Map()\n const doc = /** @type {Doc} */ (this.doc)\n let str = ''\n let n = this._start\n function packStr () {\n if (str.length > 0) {\n // pack str with attributes to ops\n /**\n * @type {Object}\n */\n const attributes = {}\n let addAttributes = false\n currentAttributes.forEach((value, key) => {\n addAttributes = true\n attributes[key] = value\n })\n /**\n * @type {Object}\n */\n const op = { insert: str }\n if (addAttributes) {\n op.attributes = attributes\n }\n ops.push(op)\n str = ''\n }\n }\n const computeDelta = () => {\n while (n !== null) {\n if (isVisible(n, snapshot) || (prevSnapshot !== undefined && isVisible(n, prevSnapshot))) {\n switch (n.content.constructor) {\n case ContentString: {\n const cur = currentAttributes.get('ychange')\n if (snapshot !== undefined && !isVisible(n, snapshot)) {\n if (cur === undefined || cur.user !== n.id.client || cur.type !== 'removed') {\n packStr()\n currentAttributes.set('ychange', computeYChange ? computeYChange('removed', n.id) : { type: 'removed' })\n }\n } else if (prevSnapshot !== undefined && !isVisible(n, prevSnapshot)) {\n if (cur === undefined || cur.user !== n.id.client || cur.type !== 'added') {\n packStr()\n currentAttributes.set('ychange', computeYChange ? computeYChange('added', n.id) : { type: 'added' })\n }\n } else if (cur !== undefined) {\n packStr()\n currentAttributes.delete('ychange')\n }\n str += /** @type {ContentString} */ (n.content).str\n break\n }\n case ContentType:\n case ContentEmbed: {\n packStr()\n /**\n * @type {Object}\n */\n const op = {\n insert: n.content.getContent()[0]\n }\n if (currentAttributes.size > 0) {\n const attrs = /** @type {Object} */ ({})\n op.attributes = attrs\n currentAttributes.forEach((value, key) => {\n attrs[key] = value\n })\n }\n ops.push(op)\n break\n }\n case ContentFormat:\n if (isVisible(n, snapshot)) {\n packStr()\n updateCurrentAttributes(currentAttributes, /** @type {ContentFormat} */ (n.content))\n }\n break\n }\n }\n n = n.right\n }\n packStr()\n }\n if (snapshot || prevSnapshot) {\n // snapshots are merged again after the transaction, so we need to keep the\n // transaction alive until we are done\n transact(doc, transaction => {\n if (snapshot) {\n splitSnapshotAffectedStructs(transaction, snapshot)\n }\n if (prevSnapshot) {\n splitSnapshotAffectedStructs(transaction, prevSnapshot)\n }\n computeDelta()\n }, 'cleanup')\n } else {\n computeDelta()\n }\n return ops\n }\n\n /**\n * Insert text at a given index.\n *\n * @param {number} index The index at which to start inserting.\n * @param {String} text The text to insert at the specified position.\n * @param {TextAttributes} [attributes] Optionally define some formatting\n * information to apply on the inserted\n * Text.\n * @public\n */\n insert (index, text, attributes) {\n if (text.length <= 0) {\n return\n }\n const y = this.doc\n if (y !== null) {\n transact(y, transaction => {\n const pos = findPosition(transaction, this, index, !attributes)\n if (!attributes) {\n attributes = {}\n // @ts-ignore\n pos.currentAttributes.forEach((v, k) => { attributes[k] = v })\n }\n insertText(transaction, this, pos, text, attributes)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.insert(index, text, attributes))\n }\n }\n\n /**\n * Inserts an embed at a index.\n *\n * @param {number} index The index to insert the embed at.\n * @param {Object | AbstractType} embed The Object that represents the embed.\n * @param {TextAttributes} [attributes] Attribute information to apply on the\n * embed\n *\n * @public\n */\n insertEmbed (index, embed, attributes) {\n const y = this.doc\n if (y !== null) {\n transact(y, transaction => {\n const pos = findPosition(transaction, this, index, !attributes)\n insertText(transaction, this, pos, embed, attributes || {})\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.insertEmbed(index, embed, attributes || {}))\n }\n }\n\n /**\n * Deletes text starting from an index.\n *\n * @param {number} index Index at which to start deleting.\n * @param {number} length The number of characters to remove. Defaults to 1.\n *\n * @public\n */\n delete (index, length) {\n if (length === 0) {\n return\n }\n const y = this.doc\n if (y !== null) {\n transact(y, transaction => {\n deleteText(transaction, findPosition(transaction, this, index, true), length)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.delete(index, length))\n }\n }\n\n /**\n * Assigns properties to a range of text.\n *\n * @param {number} index The position where to start formatting.\n * @param {number} length The amount of characters to assign properties to.\n * @param {TextAttributes} attributes Attribute information to apply on the\n * text.\n *\n * @public\n */\n format (index, length, attributes) {\n if (length === 0) {\n return\n }\n const y = this.doc\n if (y !== null) {\n transact(y, transaction => {\n const pos = findPosition(transaction, this, index, false)\n if (pos.right === null) {\n return\n }\n formatText(transaction, this, pos, length, attributes)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.format(index, length, attributes))\n }\n }\n\n /**\n * Removes an attribute.\n *\n * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks.\n *\n * @param {String} attributeName The attribute name that is to be removed.\n *\n * @public\n */\n removeAttribute (attributeName) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapDelete(transaction, this, attributeName)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.removeAttribute(attributeName))\n }\n }\n\n /**\n * Sets or updates an attribute.\n *\n * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks.\n *\n * @param {String} attributeName The attribute name that is to be set.\n * @param {any} attributeValue The attribute value that is to be set.\n *\n * @public\n */\n setAttribute (attributeName, attributeValue) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapSet(transaction, this, attributeName, attributeValue)\n })\n } else {\n /** @type {Array} */ (this._pending).push(() => this.setAttribute(attributeName, attributeValue))\n }\n }\n\n /**\n * Returns an attribute value that belongs to the attribute name.\n *\n * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks.\n *\n * @param {String} attributeName The attribute name that identifies the\n * queried value.\n * @return {any} The queried attribute value.\n *\n * @public\n */\n getAttribute (attributeName) {\n return /** @type {any} */ (typeMapGet(this, attributeName))\n }\n\n /**\n * Returns all attribute name/value pairs in a JSON Object.\n *\n * @note Xml-Text nodes don't have attributes. You can use this feature to assign properties to complete text-blocks.\n *\n * @return {Object} A JSON Object that describes the attributes.\n *\n * @public\n */\n getAttributes () {\n return typeMapGetAll(this)\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n _write (encoder) {\n encoder.writeTypeRef(YTextRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} _decoder\n * @return {YText}\n *\n * @private\n * @function\n */\nexport const readYText = _decoder => new YText()\n", "/**\n * @module YXml\n */\n\nimport {\n YXmlEvent,\n YXmlElement,\n AbstractType,\n typeListMap,\n typeListForEach,\n typeListInsertGenerics,\n typeListInsertGenericsAfter,\n typeListDelete,\n typeListToArray,\n YXmlFragmentRefID,\n callTypeObservers,\n transact,\n typeListGet,\n typeListSlice,\n warnPrematureAccess,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, ContentType, Transaction, Item, YXmlText, YXmlHook // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\nimport * as array from 'lib0/array'\n\n/**\n * Define the elements to which a set of CSS queries apply.\n * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors|CSS_Selectors}\n *\n * @example\n * query = '.classSelector'\n * query = 'nodeSelector'\n * query = '#idSelector'\n *\n * @typedef {string} CSS_Selector\n */\n\n/**\n * Dom filter function.\n *\n * @callback domFilter\n * @param {string} nodeName The nodeName of the element\n * @param {Map} attributes The map of attributes.\n * @return {boolean} Whether to include the Dom node in the YXmlElement.\n */\n\n/**\n * Represents a subset of the nodes of a YXmlElement / YXmlFragment and a\n * position within them.\n *\n * Can be created with {@link YXmlFragment#createTreeWalker}\n *\n * @public\n * @implements {Iterable}\n */\nexport class YXmlTreeWalker {\n /**\n * @param {YXmlFragment | YXmlElement} root\n * @param {function(AbstractType):boolean} [f]\n */\n constructor (root, f = () => true) {\n this._filter = f\n this._root = root\n /**\n * @type {Item}\n */\n this._currentNode = /** @type {Item} */ (root._start)\n this._firstCall = true\n root.doc ?? warnPrematureAccess()\n }\n\n [Symbol.iterator] () {\n return this\n }\n\n /**\n * Get the next node.\n *\n * @return {IteratorResult} The next node.\n *\n * @public\n */\n next () {\n /**\n * @type {Item|null}\n */\n let n = this._currentNode\n let type = n && n.content && /** @type {any} */ (n.content).type\n if (n !== null && (!this._firstCall || n.deleted || !this._filter(type))) { // if first call, we check if we can use the first item\n do {\n type = /** @type {any} */ (n.content).type\n if (!n.deleted && (type.constructor === YXmlElement || type.constructor === YXmlFragment) && type._start !== null) {\n // walk down in the tree\n n = type._start\n } else {\n // walk right or up in the tree\n while (n !== null) {\n if (n.right !== null) {\n n = n.right\n break\n } else if (n.parent === this._root) {\n n = null\n } else {\n n = /** @type {AbstractType} */ (n.parent)._item\n }\n }\n }\n } while (n !== null && (n.deleted || !this._filter(/** @type {ContentType} */ (n.content).type)))\n }\n this._firstCall = false\n if (n === null) {\n // @ts-ignore\n return { value: undefined, done: true }\n }\n this._currentNode = n\n return { value: /** @type {any} */ (n.content).type, done: false }\n }\n}\n\n/**\n * Represents a list of {@link YXmlElement}.and {@link YXmlText} types.\n * A YxmlFragment is similar to a {@link YXmlElement}, but it does not have a\n * nodeName and it does not have attributes. Though it can be bound to a DOM\n * element - in this case the attributes and the nodeName are not shared.\n *\n * @public\n * @extends AbstractType\n */\nexport class YXmlFragment extends AbstractType {\n constructor () {\n super()\n /**\n * @type {Array|null}\n */\n this._prelimContent = []\n }\n\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get firstChild () {\n const first = this._first\n return first ? first.content.getContent()[0] : null\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n this.insert(0, /** @type {Array} */ (this._prelimContent))\n this._prelimContent = null\n }\n\n _copy () {\n return new YXmlFragment()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YXmlFragment}\n */\n clone () {\n const el = new YXmlFragment()\n // @ts-ignore\n el.insert(0, this.toArray().map(item => item instanceof AbstractType ? item.clone() : item))\n return el\n }\n\n get length () {\n this.doc ?? warnPrematureAccess()\n return this._prelimContent === null ? this._length : this._prelimContent.length\n }\n\n /**\n * Create a subtree of childNodes.\n *\n * @example\n * const walker = elem.createTreeWalker(dom => dom.nodeName === 'div')\n * for (let node in walker) {\n * // `node` is a div node\n * nop(node)\n * }\n *\n * @param {function(AbstractType):boolean} filter Function that is called on each child element and\n * returns a Boolean indicating whether the child\n * is to be included in the subtree.\n * @return {YXmlTreeWalker} A subtree and a position within it.\n *\n * @public\n */\n createTreeWalker (filter) {\n return new YXmlTreeWalker(this, filter)\n }\n\n /**\n * Returns the first YXmlElement that matches the query.\n * Similar to DOM's {@link querySelector}.\n *\n * Query support:\n * - tagname\n * TODO:\n * - id\n * - attribute\n *\n * @param {CSS_Selector} query The query on the children.\n * @return {YXmlElement|YXmlText|YXmlHook|null} The first element that matches the query or null.\n *\n * @public\n */\n querySelector (query) {\n query = query.toUpperCase()\n // @ts-ignore\n const iterator = new YXmlTreeWalker(this, element => element.nodeName && element.nodeName.toUpperCase() === query)\n const next = iterator.next()\n if (next.done) {\n return null\n } else {\n return next.value\n }\n }\n\n /**\n * Returns all YXmlElements that match the query.\n * Similar to Dom's {@link querySelectorAll}.\n *\n * @todo Does not yet support all queries. Currently only query by tagName.\n *\n * @param {CSS_Selector} query The query on the children\n * @return {Array} The elements that match this query.\n *\n * @public\n */\n querySelectorAll (query) {\n query = query.toUpperCase()\n // @ts-ignore\n return array.from(new YXmlTreeWalker(this, element => element.nodeName && element.nodeName.toUpperCase() === query))\n }\n\n /**\n * Creates YXmlEvent and calls observers.\n *\n * @param {Transaction} transaction\n * @param {Set} parentSubs Keys changed on this type. `null` if list was modified.\n */\n _callObserver (transaction, parentSubs) {\n callTypeObservers(this, transaction, new YXmlEvent(this, parentSubs, transaction))\n }\n\n /**\n * Get the string representation of all the children of this YXmlFragment.\n *\n * @return {string} The string representation of all children.\n */\n toString () {\n return typeListMap(this, xml => xml.toString()).join('')\n }\n\n /**\n * @return {string}\n */\n toJSON () {\n return this.toString()\n }\n\n /**\n * Creates a Dom Element that mirrors this YXmlElement.\n *\n * @param {Document} [_document=document] The document object (you must define\n * this when calling this method in\n * nodejs)\n * @param {Object} [hooks={}] Optional property to customize how hooks\n * are presented in the DOM\n * @param {any} [binding] You should not set this property. This is\n * used if DomBinding wants to create a\n * association to the created DOM type.\n * @return {Node} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}\n *\n * @public\n */\n toDOM (_document = document, hooks = {}, binding) {\n const fragment = _document.createDocumentFragment()\n if (binding !== undefined) {\n binding._createAssociation(fragment, this)\n }\n typeListForEach(this, xmlType => {\n fragment.insertBefore(xmlType.toDOM(_document, hooks, binding), null)\n })\n return fragment\n }\n\n /**\n * Inserts new content at an index.\n *\n * @example\n * // Insert character 'a' at position 0\n * xml.insert(0, [new Y.XmlText('text')])\n *\n * @param {number} index The index to insert content at\n * @param {Array} content The array of content\n */\n insert (index, content) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListInsertGenerics(transaction, this, index, content)\n })\n } else {\n // @ts-ignore _prelimContent is defined because this is not yet integrated\n this._prelimContent.splice(index, 0, ...content)\n }\n }\n\n /**\n * Inserts new content at an index.\n *\n * @example\n * // Insert character 'a' at position 0\n * xml.insert(0, [new Y.XmlText('text')])\n *\n * @param {null|Item|YXmlElement|YXmlText} ref The index to insert content at\n * @param {Array} content The array of content\n */\n insertAfter (ref, content) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n const refItem = (ref && ref instanceof AbstractType) ? ref._item : ref\n typeListInsertGenericsAfter(transaction, this, refItem, content)\n })\n } else {\n const pc = /** @type {Array} */ (this._prelimContent)\n const index = ref === null ? 0 : pc.findIndex(el => el === ref) + 1\n if (index === 0 && ref !== null) {\n throw error.create('Reference item not found')\n }\n pc.splice(index, 0, ...content)\n }\n }\n\n /**\n * Deletes elements starting from an index.\n *\n * @param {number} index Index at which to start deleting elements\n * @param {number} [length=1] The number of elements to remove. Defaults to 1.\n */\n delete (index, length = 1) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeListDelete(transaction, this, index, length)\n })\n } else {\n // @ts-ignore _prelimContent is defined because this is not yet integrated\n this._prelimContent.splice(index, length)\n }\n }\n\n /**\n * Transforms this YArray to a JavaScript Array.\n *\n * @return {Array}\n */\n toArray () {\n return typeListToArray(this)\n }\n\n /**\n * Appends content to this YArray.\n *\n * @param {Array} content Array of content to append.\n */\n push (content) {\n this.insert(this.length, content)\n }\n\n /**\n * Prepends content to this YArray.\n *\n * @param {Array} content Array of content to prepend.\n */\n unshift (content) {\n this.insert(0, content)\n }\n\n /**\n * Returns the i-th element from a YArray.\n *\n * @param {number} index The index of the element to return from the YArray\n * @return {YXmlElement|YXmlText}\n */\n get (index) {\n return typeListGet(this, index)\n }\n\n /**\n * Returns a portion of this YXmlFragment into a JavaScript Array selected\n * from start to end (end not included).\n *\n * @param {number} [start]\n * @param {number} [end]\n * @return {Array}\n */\n slice (start = 0, end = this.length) {\n return typeListSlice(this, start, end)\n }\n\n /**\n * Executes a provided function on once on every child element.\n *\n * @param {function(YXmlElement|YXmlText,number, typeof self):void} f A function to execute on every element of this YArray.\n */\n forEach (f) {\n typeListForEach(this, f)\n }\n\n /**\n * Transform the properties of this type to binary and write it to an\n * BinaryEncoder.\n *\n * This is called when this Item is sent to a remote peer.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n */\n _write (encoder) {\n encoder.writeTypeRef(YXmlFragmentRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} _decoder\n * @return {YXmlFragment}\n *\n * @private\n * @function\n */\nexport const readYXmlFragment = _decoder => new YXmlFragment()\n", "import * as object from 'lib0/object'\n\nimport {\n YXmlFragment,\n transact,\n typeMapDelete,\n typeMapHas,\n typeMapSet,\n typeMapGet,\n typeMapGetAll,\n typeMapGetAllSnapshot,\n typeListForEach,\n YXmlElementRefID,\n Snapshot, YXmlText, ContentType, AbstractType, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Doc, Item // eslint-disable-line\n} from '../internals.js'\n\n/**\n * @typedef {Object|number|null|Array|string|Uint8Array|AbstractType} ValueTypes\n */\n\n/**\n * An YXmlElement imitates the behavior of a\n * https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element\n *\n * * An YXmlElement has attributes (key value pairs)\n * * An YXmlElement has childElements that must inherit from YXmlElement\n *\n * @template {{ [key: string]: ValueTypes }} [KV={ [key: string]: string }]\n */\nexport class YXmlElement extends YXmlFragment {\n constructor (nodeName = 'UNDEFINED') {\n super()\n this.nodeName = nodeName\n /**\n * @type {Map|null}\n */\n this._prelimAttrs = new Map()\n }\n\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get nextSibling () {\n const n = this._item ? this._item.next : null\n return n ? /** @type {YXmlElement|YXmlText} */ (/** @type {ContentType} */ (n.content).type) : null\n }\n\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get prevSibling () {\n const n = this._item ? this._item.prev : null\n return n ? /** @type {YXmlElement|YXmlText} */ (/** @type {ContentType} */ (n.content).type) : null\n }\n\n /**\n * Integrate this type into the Yjs instance.\n *\n * * Save this struct in the os\n * * This type is sent to other client\n * * Observer functions are fired\n *\n * @param {Doc} y The Yjs instance\n * @param {Item} item\n */\n _integrate (y, item) {\n super._integrate(y, item)\n ;(/** @type {Map} */ (this._prelimAttrs)).forEach((value, key) => {\n this.setAttribute(key, value)\n })\n this._prelimAttrs = null\n }\n\n /**\n * Creates an Item with the same effect as this Item (without position effect)\n *\n * @return {YXmlElement}\n */\n _copy () {\n return new YXmlElement(this.nodeName)\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YXmlElement}\n */\n clone () {\n /**\n * @type {YXmlElement}\n */\n const el = new YXmlElement(this.nodeName)\n const attrs = this.getAttributes()\n object.forEach(attrs, (value, key) => {\n if (typeof value === 'string') {\n el.setAttribute(key, value)\n }\n })\n // @ts-ignore\n el.insert(0, this.toArray().map(item => item instanceof AbstractType ? item.clone() : item))\n return el\n }\n\n /**\n * Returns the XML serialization of this YXmlElement.\n * The attributes are ordered by attribute-name, so you can easily use this\n * method to compare YXmlElements\n *\n * @return {string} The string representation of this type.\n *\n * @public\n */\n toString () {\n const attrs = this.getAttributes()\n const stringBuilder = []\n const keys = []\n for (const key in attrs) {\n keys.push(key)\n }\n keys.sort()\n const keysLen = keys.length\n for (let i = 0; i < keysLen; i++) {\n const key = keys[i]\n stringBuilder.push(key + '=\"' + attrs[key] + '\"')\n }\n const nodeName = this.nodeName.toLocaleLowerCase()\n const attrsString = stringBuilder.length > 0 ? ' ' + stringBuilder.join(' ') : ''\n return `<${nodeName}${attrsString}>${super.toString()}`\n }\n\n /**\n * Removes an attribute from this YXmlElement.\n *\n * @param {string} attributeName The attribute name that is to be removed.\n *\n * @public\n */\n removeAttribute (attributeName) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapDelete(transaction, this, attributeName)\n })\n } else {\n /** @type {Map} */ (this._prelimAttrs).delete(attributeName)\n }\n }\n\n /**\n * Sets or updates an attribute.\n *\n * @template {keyof KV & string} KEY\n *\n * @param {KEY} attributeName The attribute name that is to be set.\n * @param {KV[KEY]} attributeValue The attribute value that is to be set.\n *\n * @public\n */\n setAttribute (attributeName, attributeValue) {\n if (this.doc !== null) {\n transact(this.doc, transaction => {\n typeMapSet(transaction, this, attributeName, attributeValue)\n })\n } else {\n /** @type {Map} */ (this._prelimAttrs).set(attributeName, attributeValue)\n }\n }\n\n /**\n * Returns an attribute value that belongs to the attribute name.\n *\n * @template {keyof KV & string} KEY\n *\n * @param {KEY} attributeName The attribute name that identifies the\n * queried value.\n * @return {KV[KEY]|undefined} The queried attribute value.\n *\n * @public\n */\n getAttribute (attributeName) {\n return /** @type {any} */ (typeMapGet(this, attributeName))\n }\n\n /**\n * Returns whether an attribute exists\n *\n * @param {string} attributeName The attribute name to check for existence.\n * @return {boolean} whether the attribute exists.\n *\n * @public\n */\n hasAttribute (attributeName) {\n return /** @type {any} */ (typeMapHas(this, attributeName))\n }\n\n /**\n * Returns all attribute name/value pairs in a JSON Object.\n *\n * @param {Snapshot} [snapshot]\n * @return {{ [Key in Extract]?: KV[Key]}} A JSON Object that describes the attributes.\n *\n * @public\n */\n getAttributes (snapshot) {\n return /** @type {any} */ (snapshot ? typeMapGetAllSnapshot(this, snapshot) : typeMapGetAll(this))\n }\n\n /**\n * Creates a Dom Element that mirrors this YXmlElement.\n *\n * @param {Document} [_document=document] The document object (you must define\n * this when calling this method in\n * nodejs)\n * @param {Object} [hooks={}] Optional property to customize how hooks\n * are presented in the DOM\n * @param {any} [binding] You should not set this property. This is\n * used if DomBinding wants to create a\n * association to the created DOM type.\n * @return {Node} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}\n *\n * @public\n */\n toDOM (_document = document, hooks = {}, binding) {\n const dom = _document.createElement(this.nodeName)\n const attrs = this.getAttributes()\n for (const key in attrs) {\n const value = attrs[key]\n if (typeof value === 'string') {\n dom.setAttribute(key, value)\n }\n }\n typeListForEach(this, yxml => {\n dom.appendChild(yxml.toDOM(_document, hooks, binding))\n })\n if (binding !== undefined) {\n binding._createAssociation(dom, this)\n }\n return dom\n }\n\n /**\n * Transform the properties of this type to binary and write it to an\n * BinaryEncoder.\n *\n * This is called when this Item is sent to a remote peer.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n */\n _write (encoder) {\n encoder.writeTypeRef(YXmlElementRefID)\n encoder.writeKey(this.nodeName)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {YXmlElement}\n *\n * @function\n */\nexport const readYXmlElement = decoder => new YXmlElement(decoder.readKey())\n", "import {\n YEvent,\n YXmlText, YXmlElement, YXmlFragment, Transaction // eslint-disable-line\n} from '../internals.js'\n\n/**\n * @extends YEvent\n * An Event that describes changes on a YXml Element or Yxml Fragment\n */\nexport class YXmlEvent extends YEvent {\n /**\n * @param {YXmlElement|YXmlText|YXmlFragment} target The target on which the event is created.\n * @param {Set} subs The set of changed attributes. `null` is included if the\n * child list changed.\n * @param {Transaction} transaction The transaction instance with wich the\n * change was created.\n */\n constructor (target, subs, transaction) {\n super(target, transaction)\n /**\n * Whether the children changed.\n * @type {Boolean}\n * @private\n */\n this.childListChanged = false\n /**\n * Set of all changed attributes.\n * @type {Set}\n */\n this.attributesChanged = new Set()\n subs.forEach((sub) => {\n if (sub === null) {\n this.childListChanged = true\n } else {\n this.attributesChanged.add(sub)\n }\n })\n }\n}\n", "import {\n YMap,\n YXmlHookRefID,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2 // eslint-disable-line\n} from '../internals.js'\n\n/**\n * You can manage binding to a custom type with YXmlHook.\n *\n * @extends {YMap}\n */\nexport class YXmlHook extends YMap {\n /**\n * @param {string} hookName nodeName of the Dom Node.\n */\n constructor (hookName) {\n super()\n /**\n * @type {string}\n */\n this.hookName = hookName\n }\n\n /**\n * Creates an Item with the same effect as this Item (without position effect)\n */\n _copy () {\n return new YXmlHook(this.hookName)\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YXmlHook}\n */\n clone () {\n const el = new YXmlHook(this.hookName)\n this.forEach((value, key) => {\n el.set(key, value)\n })\n return el\n }\n\n /**\n * Creates a Dom Element that mirrors this YXmlElement.\n *\n * @param {Document} [_document=document] The document object (you must define\n * this when calling this method in\n * nodejs)\n * @param {Object.} [hooks] Optional property to customize how hooks\n * are presented in the DOM\n * @param {any} [binding] You should not set this property. This is\n * used if DomBinding wants to create a\n * association to the created DOM type\n * @return {Element} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}\n *\n * @public\n */\n toDOM (_document = document, hooks = {}, binding) {\n const hook = hooks[this.hookName]\n let dom\n if (hook !== undefined) {\n dom = hook.createDom(this)\n } else {\n dom = document.createElement(this.hookName)\n }\n dom.setAttribute('data-yjs-hook', this.hookName)\n if (binding !== undefined) {\n binding._createAssociation(dom, this)\n }\n return dom\n }\n\n /**\n * Transform the properties of this type to binary and write it to an\n * BinaryEncoder.\n *\n * This is called when this Item is sent to a remote peer.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n */\n _write (encoder) {\n encoder.writeTypeRef(YXmlHookRefID)\n encoder.writeKey(this.hookName)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {YXmlHook}\n *\n * @private\n * @function\n */\nexport const readYXmlHook = decoder =>\n new YXmlHook(decoder.readKey())\n", "import {\n YText,\n YXmlTextRefID,\n ContentType, YXmlElement, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, // eslint-disable-line\n} from '../internals.js'\n\n/**\n * Represents text in a Dom Element. In the future this type will also handle\n * simple formatting information like bold and italic.\n */\nexport class YXmlText extends YText {\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get nextSibling () {\n const n = this._item ? this._item.next : null\n return n ? /** @type {YXmlElement|YXmlText} */ (/** @type {ContentType} */ (n.content).type) : null\n }\n\n /**\n * @type {YXmlElement|YXmlText|null}\n */\n get prevSibling () {\n const n = this._item ? this._item.prev : null\n return n ? /** @type {YXmlElement|YXmlText} */ (/** @type {ContentType} */ (n.content).type) : null\n }\n\n _copy () {\n return new YXmlText()\n }\n\n /**\n * Makes a copy of this data type that can be included somewhere else.\n *\n * Note that the content is only readable _after_ it has been included somewhere in the Ydoc.\n *\n * @return {YXmlText}\n */\n clone () {\n const text = new YXmlText()\n text.applyDelta(this.toDelta())\n return text\n }\n\n /**\n * Creates a Dom Element that mirrors this YXmlText.\n *\n * @param {Document} [_document=document] The document object (you must define\n * this when calling this method in\n * nodejs)\n * @param {Object} [hooks] Optional property to customize how hooks\n * are presented in the DOM\n * @param {any} [binding] You should not set this property. This is\n * used if DomBinding wants to create a\n * association to the created DOM type.\n * @return {Text} The {@link https://developer.mozilla.org/en-US/docs/Web/API/Element|Dom Element}\n *\n * @public\n */\n toDOM (_document = document, hooks, binding) {\n const dom = _document.createTextNode(this.toString())\n if (binding !== undefined) {\n binding._createAssociation(dom, this)\n }\n return dom\n }\n\n toString () {\n // @ts-ignore\n return this.toDelta().map(delta => {\n const nestedNodes = []\n for (const nodeName in delta.attributes) {\n const attrs = []\n for (const key in delta.attributes[nodeName]) {\n attrs.push({ key, value: delta.attributes[nodeName][key] })\n }\n // sort attributes to get a unique order\n attrs.sort((a, b) => a.key < b.key ? -1 : 1)\n nestedNodes.push({ nodeName, attrs })\n }\n // sort node order to get a unique order\n nestedNodes.sort((a, b) => a.nodeName < b.nodeName ? -1 : 1)\n // now convert to dom string\n let str = ''\n for (let i = 0; i < nestedNodes.length; i++) {\n const node = nestedNodes[i]\n str += `<${node.nodeName}`\n for (let j = 0; j < node.attrs.length; j++) {\n const attr = node.attrs[j]\n str += ` ${attr.key}=\"${attr.value}\"`\n }\n str += '>'\n }\n str += delta.insert\n for (let i = nestedNodes.length - 1; i >= 0; i--) {\n str += ``\n }\n return str\n }).join('')\n }\n\n /**\n * @return {string}\n */\n toJSON () {\n return this.toString()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n */\n _write (encoder) {\n encoder.writeTypeRef(YXmlTextRefID)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {YXmlText}\n *\n * @private\n * @function\n */\nexport const readYXmlText = decoder => new YXmlText()\n", "import {\n UpdateEncoderV1, UpdateEncoderV2, ID, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\nexport class AbstractStruct {\n /**\n * @param {ID} id\n * @param {number} length\n */\n constructor (id, length) {\n this.id = id\n this.length = length\n }\n\n /**\n * @type {boolean}\n */\n get deleted () {\n throw error.methodUnimplemented()\n }\n\n /**\n * Merge this struct with the item to the right.\n * This method is already assuming that `this.id.clock + this.length === this.id.clock`.\n * Also this method does *not* remove right from StructStore!\n * @param {AbstractStruct} right\n * @return {boolean} wether this merged with right\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n * @param {number} offset\n * @param {number} encodingRef\n */\n write (encoder, offset, encodingRef) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {Transaction} transaction\n * @param {number} offset\n */\n integrate (transaction, offset) {\n throw error.methodUnimplemented()\n }\n}\n", "import {\n AbstractStruct,\n addStruct,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Transaction, ID // eslint-disable-line\n} from '../internals.js'\n\nexport const structGCRefNumber = 0\n\n/**\n * @private\n */\nexport class GC extends AbstractStruct {\n get deleted () {\n return true\n }\n\n delete () {}\n\n /**\n * @param {GC} right\n * @return {boolean}\n */\n mergeWith (right) {\n if (this.constructor !== right.constructor) {\n return false\n }\n this.length += right.length\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {number} offset\n */\n integrate (transaction, offset) {\n if (offset > 0) {\n this.id.clock += offset\n this.length -= offset\n }\n addStruct(transaction.doc.store, this)\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeInfo(structGCRefNumber)\n encoder.writeLen(this.length - offset)\n }\n\n /**\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @return {null | number}\n */\n getMissing (transaction, store) {\n return null\n }\n}\n", "import {\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Item, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\nexport class ContentBinary {\n /**\n * @param {Uint8Array} content\n */\n constructor (content) {\n this.content = content\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return [this.content]\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentBinary}\n */\n copy () {\n return new ContentBinary(this.content)\n }\n\n /**\n * @param {number} offset\n * @return {ContentBinary}\n */\n splice (offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentBinary} right\n * @return {boolean}\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeBuf(this.content)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 3\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2 } decoder\n * @return {ContentBinary}\n */\nexport const readContentBinary = decoder => new ContentBinary(decoder.readBuf())\n", "import {\n addToDeleteSet,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Item, Transaction // eslint-disable-line\n} from '../internals.js'\n\nexport class ContentDeleted {\n /**\n * @param {number} len\n */\n constructor (len) {\n this.len = len\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return this.len\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return []\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return false\n }\n\n /**\n * @return {ContentDeleted}\n */\n copy () {\n return new ContentDeleted(this.len)\n }\n\n /**\n * @param {number} offset\n * @return {ContentDeleted}\n */\n splice (offset) {\n const right = new ContentDeleted(this.len - offset)\n this.len = offset\n return right\n }\n\n /**\n * @param {ContentDeleted} right\n * @return {boolean}\n */\n mergeWith (right) {\n this.len += right.len\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {\n addToDeleteSet(transaction.deleteSet, item.id.client, item.id.clock, this.len)\n item.markDeleted()\n }\n\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeLen(this.len - offset)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 1\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2 } decoder\n * @return {ContentDeleted}\n */\nexport const readContentDeleted = decoder => new ContentDeleted(decoder.readLen())\n", "import {\n Doc, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Transaction, Item // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\n/**\n * @param {string} guid\n * @param {Object} opts\n */\nconst createDocFromOpts = (guid, opts) => new Doc({ guid, ...opts, shouldLoad: opts.shouldLoad || opts.autoLoad || false })\n\n/**\n * @private\n */\nexport class ContentDoc {\n /**\n * @param {Doc} doc\n */\n constructor (doc) {\n if (doc._item) {\n console.error('This document was already integrated as a sub-document. You should create a second instance instead with the same guid.')\n }\n /**\n * @type {Doc}\n */\n this.doc = doc\n /**\n * @type {any}\n */\n const opts = {}\n this.opts = opts\n if (!doc.gc) {\n opts.gc = false\n }\n if (doc.autoLoad) {\n opts.autoLoad = true\n }\n if (doc.meta !== null) {\n opts.meta = doc.meta\n }\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return [this.doc]\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentDoc}\n */\n copy () {\n return new ContentDoc(createDocFromOpts(this.doc.guid, this.opts))\n }\n\n /**\n * @param {number} offset\n * @return {ContentDoc}\n */\n splice (offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentDoc} right\n * @return {boolean}\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {\n // this needs to be reflected in doc.destroy as well\n this.doc._item = item\n transaction.subdocsAdded.add(this.doc)\n if (this.doc.shouldLoad) {\n transaction.subdocsLoaded.add(this.doc)\n }\n }\n\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {\n if (transaction.subdocsAdded.has(this.doc)) {\n transaction.subdocsAdded.delete(this.doc)\n } else {\n transaction.subdocsRemoved.add(this.doc)\n }\n }\n\n /**\n * @param {StructStore} store\n */\n gc (store) { }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeString(this.doc.guid)\n encoder.writeAny(this.opts)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 9\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentDoc}\n */\nexport const readContentDoc = decoder => new ContentDoc(createDocFromOpts(decoder.readString(), decoder.readAny()))\n", "import {\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Item, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\n/**\n * @private\n */\nexport class ContentEmbed {\n /**\n * @param {Object} embed\n */\n constructor (embed) {\n this.embed = embed\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return [this.embed]\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentEmbed}\n */\n copy () {\n return new ContentEmbed(this.embed)\n }\n\n /**\n * @param {number} offset\n * @return {ContentEmbed}\n */\n splice (offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentEmbed} right\n * @return {boolean}\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeJSON(this.embed)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 5\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentEmbed}\n */\nexport const readContentEmbed = decoder => new ContentEmbed(decoder.readJSON())\n", "import {\n YText, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Item, StructStore, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\n/**\n * @private\n */\nexport class ContentFormat {\n /**\n * @param {string} key\n * @param {Object} value\n */\n constructor (key, value) {\n this.key = key\n this.value = value\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return []\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return false\n }\n\n /**\n * @return {ContentFormat}\n */\n copy () {\n return new ContentFormat(this.key, this.value)\n }\n\n /**\n * @param {number} _offset\n * @return {ContentFormat}\n */\n splice (_offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentFormat} _right\n * @return {boolean}\n */\n mergeWith (_right) {\n return false\n }\n\n /**\n * @param {Transaction} _transaction\n * @param {Item} item\n */\n integrate (_transaction, item) {\n // @todo searchmarker are currently unsupported for rich text documents\n const p = /** @type {YText} */ (item.parent)\n p._searchMarker = null\n p._hasFormatting = true\n }\n\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeKey(this.key)\n encoder.writeJSON(this.value)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 6\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentFormat}\n */\nexport const readContentFormat = decoder => new ContentFormat(decoder.readKey(), decoder.readJSON())\n", "import {\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Transaction, Item, StructStore // eslint-disable-line\n} from '../internals.js'\n\n/**\n * @private\n */\nexport class ContentJSON {\n /**\n * @param {Array} arr\n */\n constructor (arr) {\n /**\n * @type {Array}\n */\n this.arr = arr\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return this.arr.length\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return this.arr\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentJSON}\n */\n copy () {\n return new ContentJSON(this.arr)\n }\n\n /**\n * @param {number} offset\n * @return {ContentJSON}\n */\n splice (offset) {\n const right = new ContentJSON(this.arr.slice(offset))\n this.arr = this.arr.slice(0, offset)\n return right\n }\n\n /**\n * @param {ContentJSON} right\n * @return {boolean}\n */\n mergeWith (right) {\n this.arr = this.arr.concat(right.arr)\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n const len = this.arr.length\n encoder.writeLen(len - offset)\n for (let i = offset; i < len; i++) {\n const c = this.arr[i]\n encoder.writeString(c === undefined ? 'undefined' : JSON.stringify(c))\n }\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 2\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentJSON}\n */\nexport const readContentJSON = decoder => {\n const len = decoder.readLen()\n const cs = []\n for (let i = 0; i < len; i++) {\n const c = decoder.readString()\n if (c === 'undefined') {\n cs.push(undefined)\n } else {\n cs.push(JSON.parse(c))\n }\n }\n return new ContentJSON(cs)\n}\n", "import {\n UpdateEncoderV1, UpdateEncoderV2, UpdateDecoderV1, UpdateDecoderV2, Transaction, Item, StructStore // eslint-disable-line\n} from '../internals.js'\n\nimport * as env from 'lib0/environment'\nimport * as object from 'lib0/object'\n\nconst isDevMode = env.getVariable('node_env') === 'development'\n\nexport class ContentAny {\n /**\n * @param {Array} arr\n */\n constructor (arr) {\n /**\n * @type {Array}\n */\n this.arr = arr\n isDevMode && object.deepFreeze(arr)\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return this.arr.length\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return this.arr\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentAny}\n */\n copy () {\n return new ContentAny(this.arr)\n }\n\n /**\n * @param {number} offset\n * @return {ContentAny}\n */\n splice (offset) {\n const right = new ContentAny(this.arr.slice(offset))\n this.arr = this.arr.slice(0, offset)\n return right\n }\n\n /**\n * @param {ContentAny} right\n * @return {boolean}\n */\n mergeWith (right) {\n this.arr = this.arr.concat(right.arr)\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n const len = this.arr.length\n encoder.writeLen(len - offset)\n for (let i = offset; i < len; i++) {\n const c = this.arr[i]\n encoder.writeAny(c)\n }\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 8\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentAny}\n */\nexport const readContentAny = decoder => {\n const len = decoder.readLen()\n const cs = []\n for (let i = 0; i < len; i++) {\n cs.push(decoder.readAny())\n }\n return new ContentAny(cs)\n}\n", "import {\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, Transaction, Item, StructStore // eslint-disable-line\n} from '../internals.js'\n\n/**\n * @private\n */\nexport class ContentString {\n /**\n * @param {string} str\n */\n constructor (str) {\n /**\n * @type {string}\n */\n this.str = str\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return this.str.length\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return this.str.split('')\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentString}\n */\n copy () {\n return new ContentString(this.str)\n }\n\n /**\n * @param {number} offset\n * @return {ContentString}\n */\n splice (offset) {\n const right = new ContentString(this.str.slice(offset))\n this.str = this.str.slice(0, offset)\n\n // Prevent encoding invalid documents because of splitting of surrogate pairs: https://github.com/yjs/yjs/issues/248\n const firstCharCode = this.str.charCodeAt(offset - 1)\n if (firstCharCode >= 0xD800 && firstCharCode <= 0xDBFF) {\n // Last character of the left split is the start of a surrogate utf16/ucs2 pair.\n // We don't support splitting of surrogate pairs because this may lead to invalid documents.\n // Replace the invalid character with a unicode replacement character (� / U+FFFD)\n this.str = this.str.slice(0, offset - 1) + '�'\n // replace right as well\n right.str = '�' + right.str.slice(1)\n }\n return right\n }\n\n /**\n * @param {ContentString} right\n * @return {boolean}\n */\n mergeWith (right) {\n this.str += right.str\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {}\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {}\n /**\n * @param {StructStore} store\n */\n gc (store) {}\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeString(offset === 0 ? this.str : this.str.slice(offset))\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 4\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentString}\n */\nexport const readContentString = decoder => new ContentString(decoder.readString())\n", "import {\n readYArray,\n readYMap,\n readYText,\n readYXmlElement,\n readYXmlFragment,\n readYXmlHook,\n readYXmlText,\n UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, StructStore, Transaction, Item, YEvent, AbstractType // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\n\n/**\n * @type {Array>}\n * @private\n */\nexport const typeRefs = [\n readYArray,\n readYMap,\n readYText,\n readYXmlElement,\n readYXmlFragment,\n readYXmlHook,\n readYXmlText\n]\n\nexport const YArrayRefID = 0\nexport const YMapRefID = 1\nexport const YTextRefID = 2\nexport const YXmlElementRefID = 3\nexport const YXmlFragmentRefID = 4\nexport const YXmlHookRefID = 5\nexport const YXmlTextRefID = 6\n\n/**\n * @private\n */\nexport class ContentType {\n /**\n * @param {AbstractType} type\n */\n constructor (type) {\n /**\n * @type {AbstractType}\n */\n this.type = type\n }\n\n /**\n * @return {number}\n */\n getLength () {\n return 1\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n return [this.type]\n }\n\n /**\n * @return {boolean}\n */\n isCountable () {\n return true\n }\n\n /**\n * @return {ContentType}\n */\n copy () {\n return new ContentType(this.type._copy())\n }\n\n /**\n * @param {number} offset\n * @return {ContentType}\n */\n splice (offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {ContentType} right\n * @return {boolean}\n */\n mergeWith (right) {\n return false\n }\n\n /**\n * @param {Transaction} transaction\n * @param {Item} item\n */\n integrate (transaction, item) {\n this.type._integrate(transaction.doc, item)\n }\n\n /**\n * @param {Transaction} transaction\n */\n delete (transaction) {\n let item = this.type._start\n while (item !== null) {\n if (!item.deleted) {\n item.delete(transaction)\n } else if (item.id.clock < (transaction.beforeState.get(item.id.client) || 0)) {\n // This will be gc'd later and we want to merge it if possible\n // We try to merge all deleted items after each transaction,\n // but we have no knowledge about that this needs to be merged\n // since it is not in transaction.ds. Hence we add it to transaction._mergeStructs\n transaction._mergeStructs.push(item)\n }\n item = item.right\n }\n this.type._map.forEach(item => {\n if (!item.deleted) {\n item.delete(transaction)\n } else if (item.id.clock < (transaction.beforeState.get(item.id.client) || 0)) {\n // same as above\n transaction._mergeStructs.push(item)\n }\n })\n transaction.changed.delete(this.type)\n }\n\n /**\n * @param {StructStore} store\n */\n gc (store) {\n let item = this.type._start\n while (item !== null) {\n item.gc(store, true)\n item = item.right\n }\n this.type._start = null\n this.type._map.forEach(/** @param {Item | null} item */ (item) => {\n while (item !== null) {\n item.gc(store, true)\n item = item.left\n }\n })\n this.type._map = new Map()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n this.type._write(encoder)\n }\n\n /**\n * @return {number}\n */\n getRef () {\n return 7\n }\n}\n\n/**\n * @private\n *\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @return {ContentType}\n */\nexport const readContentType = decoder => new ContentType(typeRefs[decoder.readTypeRef()](decoder))\n", "import {\n GC,\n getState,\n AbstractStruct,\n replaceStruct,\n addStruct,\n addToDeleteSet,\n findRootTypeKey,\n compareIDs,\n getItem,\n getItemCleanEnd,\n getItemCleanStart,\n readContentDeleted,\n readContentBinary,\n readContentJSON,\n readContentAny,\n readContentString,\n readContentEmbed,\n readContentDoc,\n createID,\n readContentFormat,\n readContentType,\n addChangedTypeToTransaction,\n isDeleted,\n StackItem, DeleteSet, UpdateDecoderV1, UpdateDecoderV2, UpdateEncoderV1, UpdateEncoderV2, ContentType, ContentDeleted, StructStore, ID, AbstractType, Transaction // eslint-disable-line\n} from '../internals.js'\n\nimport * as error from 'lib0/error'\nimport * as binary from 'lib0/binary'\nimport * as array from 'lib0/array'\n\n/**\n * @todo This should return several items\n *\n * @param {StructStore} store\n * @param {ID} id\n * @return {{item:Item, diff:number}}\n */\nexport const followRedone = (store, id) => {\n /**\n * @type {ID|null}\n */\n let nextID = id\n let diff = 0\n let item\n do {\n if (diff > 0) {\n nextID = createID(nextID.client, nextID.clock + diff)\n }\n item = getItem(store, nextID)\n diff = nextID.clock - item.id.clock\n nextID = item.redone\n } while (nextID !== null && item instanceof Item)\n return {\n item, diff\n }\n}\n\n/**\n * Make sure that neither item nor any of its parents is ever deleted.\n *\n * This property does not persist when storing it into a database or when\n * sending it to other peers\n *\n * @param {Item|null} item\n * @param {boolean} keep\n */\nexport const keepItem = (item, keep) => {\n while (item !== null && item.keep !== keep) {\n item.keep = keep\n item = /** @type {AbstractType} */ (item.parent)._item\n }\n}\n\n/**\n * Split leftItem into two items\n * @param {Transaction} transaction\n * @param {Item} leftItem\n * @param {number} diff\n * @return {Item}\n *\n * @function\n * @private\n */\nexport const splitItem = (transaction, leftItem, diff) => {\n // create rightItem\n const { client, clock } = leftItem.id\n const rightItem = new Item(\n createID(client, clock + diff),\n leftItem,\n createID(client, clock + diff - 1),\n leftItem.right,\n leftItem.rightOrigin,\n leftItem.parent,\n leftItem.parentSub,\n leftItem.content.splice(diff)\n )\n if (leftItem.deleted) {\n rightItem.markDeleted()\n }\n if (leftItem.keep) {\n rightItem.keep = true\n }\n if (leftItem.redone !== null) {\n rightItem.redone = createID(leftItem.redone.client, leftItem.redone.clock + diff)\n }\n // update left (do not set leftItem.rightOrigin as it will lead to problems when syncing)\n leftItem.right = rightItem\n // update right\n if (rightItem.right !== null) {\n rightItem.right.left = rightItem\n }\n // right is more specific.\n transaction._mergeStructs.push(rightItem)\n // update parent._map\n if (rightItem.parentSub !== null && rightItem.right === null) {\n /** @type {AbstractType} */ (rightItem.parent)._map.set(rightItem.parentSub, rightItem)\n }\n leftItem.length = diff\n return rightItem\n}\n\n/**\n * @param {Array} stack\n * @param {ID} id\n */\nconst isDeletedByUndoStack = (stack, id) => array.some(stack, /** @param {StackItem} s */ s => isDeleted(s.deletions, id))\n\n/**\n * Redoes the effect of this operation.\n *\n * @param {Transaction} transaction The Yjs instance.\n * @param {Item} item\n * @param {Set} redoitems\n * @param {DeleteSet} itemsToDelete\n * @param {boolean} ignoreRemoteMapChanges\n * @param {import('../utils/UndoManager.js').UndoManager} um\n *\n * @return {Item|null}\n *\n * @private\n */\nexport const redoItem = (transaction, item, redoitems, itemsToDelete, ignoreRemoteMapChanges, um) => {\n const doc = transaction.doc\n const store = doc.store\n const ownClientID = doc.clientID\n const redone = item.redone\n if (redone !== null) {\n return getItemCleanStart(transaction, redone)\n }\n let parentItem = /** @type {AbstractType} */ (item.parent)._item\n /**\n * @type {Item|null}\n */\n let left = null\n /**\n * @type {Item|null}\n */\n let right\n // make sure that parent is redone\n if (parentItem !== null && parentItem.deleted === true) {\n // try to undo parent if it will be undone anyway\n if (parentItem.redone === null && (!redoitems.has(parentItem) || redoItem(transaction, parentItem, redoitems, itemsToDelete, ignoreRemoteMapChanges, um) === null)) {\n return null\n }\n while (parentItem.redone !== null) {\n parentItem = getItemCleanStart(transaction, parentItem.redone)\n }\n }\n const parentType = parentItem === null ? /** @type {AbstractType} */ (item.parent) : /** @type {ContentType} */ (parentItem.content).type\n\n if (item.parentSub === null) {\n // Is an array item. Insert at the old position\n left = item.left\n right = item\n // find next cloned_redo items\n while (left !== null) {\n /**\n * @type {Item|null}\n */\n let leftTrace = left\n // trace redone until parent matches\n while (leftTrace !== null && /** @type {AbstractType} */ (leftTrace.parent)._item !== parentItem) {\n leftTrace = leftTrace.redone === null ? null : getItemCleanStart(transaction, leftTrace.redone)\n }\n if (leftTrace !== null && /** @type {AbstractType} */ (leftTrace.parent)._item === parentItem) {\n left = leftTrace\n break\n }\n left = left.left\n }\n while (right !== null) {\n /**\n * @type {Item|null}\n */\n let rightTrace = right\n // trace redone until parent matches\n while (rightTrace !== null && /** @type {AbstractType} */ (rightTrace.parent)._item !== parentItem) {\n rightTrace = rightTrace.redone === null ? null : getItemCleanStart(transaction, rightTrace.redone)\n }\n if (rightTrace !== null && /** @type {AbstractType} */ (rightTrace.parent)._item === parentItem) {\n right = rightTrace\n break\n }\n right = right.right\n }\n } else {\n right = null\n if (item.right && !ignoreRemoteMapChanges) {\n left = item\n // Iterate right while right is in itemsToDelete\n // If it is intended to delete right while item is redone, we can expect that item should replace right.\n while (left !== null && left.right !== null && (left.right.redone || isDeleted(itemsToDelete, left.right.id) || isDeletedByUndoStack(um.undoStack, left.right.id) || isDeletedByUndoStack(um.redoStack, left.right.id))) {\n left = left.right\n // follow redone\n while (left.redone) left = getItemCleanStart(transaction, left.redone)\n }\n if (left && left.right !== null) {\n // It is not possible to redo this item because it conflicts with a\n // change from another client\n return null\n }\n } else {\n left = parentType._map.get(item.parentSub) || null\n }\n }\n const nextClock = getState(store, ownClientID)\n const nextId = createID(ownClientID, nextClock)\n const redoneItem = new Item(\n nextId,\n left, left && left.lastId,\n right, right && right.id,\n parentType,\n item.parentSub,\n item.content.copy()\n )\n item.redone = nextId\n keepItem(redoneItem, true)\n redoneItem.integrate(transaction, 0)\n return redoneItem\n}\n\n/**\n * Abstract class that represents any content.\n */\nexport class Item extends AbstractStruct {\n /**\n * @param {ID} id\n * @param {Item | null} left\n * @param {ID | null} origin\n * @param {Item | null} right\n * @param {ID | null} rightOrigin\n * @param {AbstractType|ID|null} parent Is a type if integrated, is null if it is possible to copy parent from left or right, is ID before integration to search for it.\n * @param {string | null} parentSub\n * @param {AbstractContent} content\n */\n constructor (id, left, origin, right, rightOrigin, parent, parentSub, content) {\n super(id, content.getLength())\n /**\n * The item that was originally to the left of this item.\n * @type {ID | null}\n */\n this.origin = origin\n /**\n * The item that is currently to the left of this item.\n * @type {Item | null}\n */\n this.left = left\n /**\n * The item that is currently to the right of this item.\n * @type {Item | null}\n */\n this.right = right\n /**\n * The item that was originally to the right of this item.\n * @type {ID | null}\n */\n this.rightOrigin = rightOrigin\n /**\n * @type {AbstractType|ID|null}\n */\n this.parent = parent\n /**\n * If the parent refers to this item with some kind of key (e.g. YMap, the\n * key is specified here. The key is then used to refer to the list in which\n * to insert this item. If `parentSub = null` type._start is the list in\n * which to insert to. Otherwise it is `parent._map`.\n * @type {String | null}\n */\n this.parentSub = parentSub\n /**\n * If this type's effect is redone this type refers to the type that undid\n * this operation.\n * @type {ID | null}\n */\n this.redone = null\n /**\n * @type {AbstractContent}\n */\n this.content = content\n /**\n * bit1: keep\n * bit2: countable\n * bit3: deleted\n * bit4: mark - mark node as fast-search-marker\n * @type {number} byte\n */\n this.info = this.content.isCountable() ? binary.BIT2 : 0\n }\n\n /**\n * This is used to mark the item as an indexed fast-search marker\n *\n * @type {boolean}\n */\n set marker (isMarked) {\n if (((this.info & binary.BIT4) > 0) !== isMarked) {\n this.info ^= binary.BIT4\n }\n }\n\n get marker () {\n return (this.info & binary.BIT4) > 0\n }\n\n /**\n * If true, do not garbage collect this Item.\n */\n get keep () {\n return (this.info & binary.BIT1) > 0\n }\n\n set keep (doKeep) {\n if (this.keep !== doKeep) {\n this.info ^= binary.BIT1\n }\n }\n\n get countable () {\n return (this.info & binary.BIT2) > 0\n }\n\n /**\n * Whether this item was deleted or not.\n * @type {Boolean}\n */\n get deleted () {\n return (this.info & binary.BIT3) > 0\n }\n\n set deleted (doDelete) {\n if (this.deleted !== doDelete) {\n this.info ^= binary.BIT3\n }\n }\n\n markDeleted () {\n this.info |= binary.BIT3\n }\n\n /**\n * Return the creator clientID of the missing op or define missing items and return null.\n *\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @return {null | number}\n */\n getMissing (transaction, store) {\n if (this.origin && this.origin.client !== this.id.client && this.origin.clock >= getState(store, this.origin.client)) {\n return this.origin.client\n }\n if (this.rightOrigin && this.rightOrigin.client !== this.id.client && this.rightOrigin.clock >= getState(store, this.rightOrigin.client)) {\n return this.rightOrigin.client\n }\n if (this.parent && this.parent.constructor === ID && this.id.client !== this.parent.client && this.parent.clock >= getState(store, this.parent.client)) {\n return this.parent.client\n }\n\n // We have all missing ids, now find the items\n\n if (this.origin) {\n this.left = getItemCleanEnd(transaction, store, this.origin)\n this.origin = this.left.lastId\n }\n if (this.rightOrigin) {\n this.right = getItemCleanStart(transaction, this.rightOrigin)\n this.rightOrigin = this.right.id\n }\n if ((this.left && this.left.constructor === GC) || (this.right && this.right.constructor === GC)) {\n this.parent = null\n } else if (!this.parent) {\n // only set parent if this shouldn't be garbage collected\n if (this.left && this.left.constructor === Item) {\n this.parent = this.left.parent\n this.parentSub = this.left.parentSub\n }\n if (this.right && this.right.constructor === Item) {\n this.parent = this.right.parent\n this.parentSub = this.right.parentSub\n }\n } else if (this.parent.constructor === ID) {\n const parentItem = getItem(store, this.parent)\n if (parentItem.constructor === GC) {\n this.parent = null\n } else {\n this.parent = /** @type {ContentType} */ (parentItem.content).type\n }\n }\n return null\n }\n\n /**\n * @param {Transaction} transaction\n * @param {number} offset\n */\n integrate (transaction, offset) {\n if (offset > 0) {\n this.id.clock += offset\n this.left = getItemCleanEnd(transaction, transaction.doc.store, createID(this.id.client, this.id.clock - 1))\n this.origin = this.left.lastId\n this.content = this.content.splice(offset)\n this.length -= offset\n }\n\n if (this.parent) {\n if ((!this.left && (!this.right || this.right.left !== null)) || (this.left && this.left.right !== this.right)) {\n /**\n * @type {Item|null}\n */\n let left = this.left\n\n /**\n * @type {Item|null}\n */\n let o\n // set o to the first conflicting item\n if (left !== null) {\n o = left.right\n } else if (this.parentSub !== null) {\n o = /** @type {AbstractType} */ (this.parent)._map.get(this.parentSub) || null\n while (o !== null && o.left !== null) {\n o = o.left\n }\n } else {\n o = /** @type {AbstractType} */ (this.parent)._start\n }\n // TODO: use something like DeleteSet here (a tree implementation would be best)\n // @todo use global set definitions\n /**\n * @type {Set}\n */\n const conflictingItems = new Set()\n /**\n * @type {Set}\n */\n const itemsBeforeOrigin = new Set()\n // Let c in conflictingItems, b in itemsBeforeOrigin\n // ***{origin}bbbb{this}{c,b}{c,b}{o}***\n // Note that conflictingItems is a subset of itemsBeforeOrigin\n while (o !== null && o !== this.right) {\n itemsBeforeOrigin.add(o)\n conflictingItems.add(o)\n if (compareIDs(this.origin, o.origin)) {\n // case 1\n if (o.id.client < this.id.client) {\n left = o\n conflictingItems.clear()\n } else if (compareIDs(this.rightOrigin, o.rightOrigin)) {\n // this and o are conflicting and point to the same integration points. The id decides which item comes first.\n // Since this is to the left of o, we can break here\n break\n } // else, o might be integrated before an item that this conflicts with. If so, we will find it in the next iterations\n } else if (o.origin !== null && itemsBeforeOrigin.has(getItem(transaction.doc.store, o.origin))) { // use getItem instead of getItemCleanEnd because we don't want / need to split items.\n // case 2\n if (!conflictingItems.has(getItem(transaction.doc.store, o.origin))) {\n left = o\n conflictingItems.clear()\n }\n } else {\n break\n }\n o = o.right\n }\n this.left = left\n }\n // reconnect left/right + update parent map/start if necessary\n if (this.left !== null) {\n const right = this.left.right\n this.right = right\n this.left.right = this\n } else {\n let r\n if (this.parentSub !== null) {\n r = /** @type {AbstractType} */ (this.parent)._map.get(this.parentSub) || null\n while (r !== null && r.left !== null) {\n r = r.left\n }\n } else {\n r = /** @type {AbstractType} */ (this.parent)._start\n ;/** @type {AbstractType} */ (this.parent)._start = this\n }\n this.right = r\n }\n if (this.right !== null) {\n this.right.left = this\n } else if (this.parentSub !== null) {\n // set as current parent value if right === null and this is parentSub\n /** @type {AbstractType} */ (this.parent)._map.set(this.parentSub, this)\n if (this.left !== null) {\n // this is the current attribute value of parent. delete right\n this.left.delete(transaction)\n }\n }\n // adjust length of parent\n if (this.parentSub === null && this.countable && !this.deleted) {\n /** @type {AbstractType} */ (this.parent)._length += this.length\n }\n addStruct(transaction.doc.store, this)\n this.content.integrate(transaction, this)\n // add parent to transaction.changed\n addChangedTypeToTransaction(transaction, /** @type {AbstractType} */ (this.parent), this.parentSub)\n if ((/** @type {AbstractType} */ (this.parent)._item !== null && /** @type {AbstractType} */ (this.parent)._item.deleted) || (this.parentSub !== null && this.right !== null)) {\n // delete if parent is deleted or if this is not the current attribute value of parent\n this.delete(transaction)\n }\n } else {\n // parent is not defined. Integrate GC struct instead\n new GC(this.id, this.length).integrate(transaction, 0)\n }\n }\n\n /**\n * Returns the next non-deleted item\n */\n get next () {\n let n = this.right\n while (n !== null && n.deleted) {\n n = n.right\n }\n return n\n }\n\n /**\n * Returns the previous non-deleted item\n */\n get prev () {\n let n = this.left\n while (n !== null && n.deleted) {\n n = n.left\n }\n return n\n }\n\n /**\n * Computes the last content address of this Item.\n */\n get lastId () {\n // allocating ids is pretty costly because of the amount of ids created, so we try to reuse whenever possible\n return this.length === 1 ? this.id : createID(this.id.client, this.id.clock + this.length - 1)\n }\n\n /**\n * Try to merge two items\n *\n * @param {Item} right\n * @return {boolean}\n */\n mergeWith (right) {\n if (\n this.constructor === right.constructor &&\n compareIDs(right.origin, this.lastId) &&\n this.right === right &&\n compareIDs(this.rightOrigin, right.rightOrigin) &&\n this.id.client === right.id.client &&\n this.id.clock + this.length === right.id.clock &&\n this.deleted === right.deleted &&\n this.redone === null &&\n right.redone === null &&\n this.content.constructor === right.content.constructor &&\n this.content.mergeWith(right.content)\n ) {\n const searchMarker = /** @type {AbstractType} */ (this.parent)._searchMarker\n if (searchMarker) {\n searchMarker.forEach(marker => {\n if (marker.p === right) {\n // right is going to be \"forgotten\" so we need to update the marker\n marker.p = this\n // adjust marker index\n if (!this.deleted && this.countable) {\n marker.index -= this.length\n }\n }\n })\n }\n if (right.keep) {\n this.keep = true\n }\n this.right = right.right\n if (this.right !== null) {\n this.right.left = this\n }\n this.length += right.length\n return true\n }\n return false\n }\n\n /**\n * Mark this Item as deleted.\n *\n * @param {Transaction} transaction\n */\n delete (transaction) {\n if (!this.deleted) {\n const parent = /** @type {AbstractType} */ (this.parent)\n // adjust the length of parent\n if (this.countable && this.parentSub === null) {\n parent._length -= this.length\n }\n this.markDeleted()\n addToDeleteSet(transaction.deleteSet, this.id.client, this.id.clock, this.length)\n addChangedTypeToTransaction(transaction, parent, this.parentSub)\n this.content.delete(transaction)\n }\n }\n\n /**\n * @param {StructStore} store\n * @param {boolean} parentGCd\n */\n gc (store, parentGCd) {\n if (!this.deleted) {\n throw error.unexpectedCase()\n }\n this.content.gc(store)\n if (parentGCd) {\n replaceStruct(store, this, new GC(this.id, this.length))\n } else {\n this.content = new ContentDeleted(this.length)\n }\n }\n\n /**\n * Transform the properties of this type to binary and write it to an\n * BinaryEncoder.\n *\n * This is called when this Item is sent to a remote peer.\n *\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.\n * @param {number} offset\n */\n write (encoder, offset) {\n const origin = offset > 0 ? createID(this.id.client, this.id.clock + offset - 1) : this.origin\n const rightOrigin = this.rightOrigin\n const parentSub = this.parentSub\n const info = (this.content.getRef() & binary.BITS5) |\n (origin === null ? 0 : binary.BIT8) | // origin is defined\n (rightOrigin === null ? 0 : binary.BIT7) | // right origin is defined\n (parentSub === null ? 0 : binary.BIT6) // parentSub is non-null\n encoder.writeInfo(info)\n if (origin !== null) {\n encoder.writeLeftID(origin)\n }\n if (rightOrigin !== null) {\n encoder.writeRightID(rightOrigin)\n }\n if (origin === null && rightOrigin === null) {\n const parent = /** @type {AbstractType} */ (this.parent)\n if (parent._item !== undefined) {\n const parentItem = parent._item\n if (parentItem === null) {\n // parent type on y._map\n // find the correct key\n const ykey = findRootTypeKey(parent)\n encoder.writeParentInfo(true) // write parentYKey\n encoder.writeString(ykey)\n } else {\n encoder.writeParentInfo(false) // write parent id\n encoder.writeLeftID(parentItem.id)\n }\n } else if (parent.constructor === String) { // this edge case was added by differential updates\n encoder.writeParentInfo(true) // write parentYKey\n encoder.writeString(parent)\n } else if (parent.constructor === ID) {\n encoder.writeParentInfo(false) // write parent id\n encoder.writeLeftID(parent)\n } else {\n error.unexpectedCase()\n }\n if (parentSub !== null) {\n encoder.writeString(parentSub)\n }\n }\n this.content.write(encoder, offset)\n }\n}\n\n/**\n * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder\n * @param {number} info\n */\nexport const readItemContent = (decoder, info) => contentRefs[info & binary.BITS5](decoder)\n\n/**\n * A lookup map for reading Item content.\n *\n * @type {Array}\n */\nexport const contentRefs = [\n () => { error.unexpectedCase() }, // GC is not ItemContent\n readContentDeleted, // 1\n readContentJSON, // 2\n readContentBinary, // 3\n readContentString, // 4\n readContentEmbed, // 5\n readContentFormat, // 6\n readContentType, // 7\n readContentAny, // 8\n readContentDoc, // 9\n () => { error.unexpectedCase() } // 10 - Skip is not ItemContent\n]\n\n/**\n * Do not implement this class!\n */\nexport class AbstractContent {\n /**\n * @return {number}\n */\n getLength () {\n throw error.methodUnimplemented()\n }\n\n /**\n * @return {Array}\n */\n getContent () {\n throw error.methodUnimplemented()\n }\n\n /**\n * Should return false if this Item is some kind of meta information\n * (e.g. format information).\n *\n * * Whether this Item should be addressable via `yarray.get(i)`\n * * Whether this Item should be counted when computing yarray.length\n *\n * @return {boolean}\n */\n isCountable () {\n throw error.methodUnimplemented()\n }\n\n /**\n * @return {AbstractContent}\n */\n copy () {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {number} _offset\n * @return {AbstractContent}\n */\n splice (_offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {AbstractContent} _right\n * @return {boolean}\n */\n mergeWith (_right) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {Transaction} _transaction\n * @param {Item} _item\n */\n integrate (_transaction, _item) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {Transaction} _transaction\n */\n delete (_transaction) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {StructStore} _store\n */\n gc (_store) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} _encoder\n * @param {number} _offset\n */\n write (_encoder, _offset) {\n throw error.methodUnimplemented()\n }\n\n /**\n * @return {number}\n */\n getRef () {\n throw error.methodUnimplemented()\n }\n}\n", "import {\n AbstractStruct,\n UpdateEncoderV1, UpdateEncoderV2, StructStore, Transaction, ID // eslint-disable-line\n} from '../internals.js'\nimport * as error from 'lib0/error'\nimport * as encoding from 'lib0/encoding'\n\nexport const structSkipRefNumber = 10\n\n/**\n * @private\n */\nexport class Skip extends AbstractStruct {\n get deleted () {\n return true\n }\n\n delete () {}\n\n /**\n * @param {Skip} right\n * @return {boolean}\n */\n mergeWith (right) {\n if (this.constructor !== right.constructor) {\n return false\n }\n this.length += right.length\n return true\n }\n\n /**\n * @param {Transaction} transaction\n * @param {number} offset\n */\n integrate (transaction, offset) {\n // skip structs cannot be integrated\n error.unexpectedCase()\n }\n\n /**\n * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder\n * @param {number} offset\n */\n write (encoder, offset) {\n encoder.writeInfo(structSkipRefNumber)\n // write as VarUint because Skips can't make use of predictable length-encoding\n encoding.writeVarUint(encoder.restEncoder, this.length - offset)\n }\n\n /**\n * @param {Transaction} transaction\n * @param {StructStore} store\n * @return {null | number}\n */\n getMissing (transaction, store) {\n return null\n }\n}\n", "/** eslint-env browser */\n\nexport {\n Doc,\n Transaction,\n YArray as Array,\n YMap as Map,\n YText as Text,\n YXmlText as XmlText,\n YXmlHook as XmlHook,\n YXmlElement as XmlElement,\n YXmlFragment as XmlFragment,\n YXmlEvent,\n YMapEvent,\n YArrayEvent,\n YTextEvent,\n YEvent,\n Item,\n AbstractStruct,\n GC,\n Skip,\n ContentBinary,\n ContentDeleted,\n ContentDoc,\n ContentEmbed,\n ContentFormat,\n ContentJSON,\n ContentAny,\n ContentString,\n ContentType,\n AbstractType,\n getTypeChildren,\n createRelativePositionFromTypeIndex,\n createRelativePositionFromJSON,\n createAbsolutePositionFromRelativePosition,\n compareRelativePositions,\n AbsolutePosition,\n RelativePosition,\n ID,\n createID,\n compareIDs,\n getState,\n Snapshot,\n createSnapshot,\n createDeleteSet,\n createDeleteSetFromStructStore,\n cleanupYTextFormatting,\n snapshot,\n emptySnapshot,\n findRootTypeKey,\n findIndexSS,\n getItem,\n typeListToArraySnapshot,\n typeMapGetSnapshot,\n typeMapGetAllSnapshot,\n createDocFromSnapshot,\n iterateDeletedStructs,\n applyUpdate,\n applyUpdateV2,\n readUpdate,\n readUpdateV2,\n encodeStateAsUpdate,\n encodeStateAsUpdateV2,\n encodeStateVector,\n UndoManager,\n decodeSnapshot,\n encodeSnapshot,\n decodeSnapshotV2,\n encodeSnapshotV2,\n decodeStateVector,\n logUpdate,\n logUpdateV2,\n decodeUpdate,\n decodeUpdateV2,\n relativePositionToJSON,\n isDeleted,\n isParentOf,\n equalSnapshots,\n PermanentUserData, // @TODO experimental\n tryGc,\n transact,\n AbstractConnector,\n logType,\n mergeUpdates,\n mergeUpdatesV2,\n parseUpdateMeta,\n parseUpdateMetaV2,\n encodeStateVectorFromUpdate,\n encodeStateVectorFromUpdateV2,\n encodeRelativePosition,\n decodeRelativePosition,\n diffUpdate,\n diffUpdateV2,\n convertUpdateFormatV1ToV2,\n convertUpdateFormatV2ToV1,\n obfuscateUpdate,\n obfuscateUpdateV2,\n UpdateEncoderV1,\n UpdateEncoderV2,\n UpdateDecoderV1,\n UpdateDecoderV2,\n equalDeleteSets,\n mergeDeleteSets,\n snapshotContainsUpdate\n} from './internals.js'\n\nconst glo = /** @type {any} */ (typeof globalThis !== 'undefined'\n ? globalThis\n : typeof window !== 'undefined'\n ? window\n // @ts-ignore\n : typeof global !== 'undefined' ? global : {})\n\nconst importIdentifier = '__ $YJS$ __'\n\nif (glo[importIdentifier] === true) {\n /**\n * Dear reader of this message. Please take this seriously.\n *\n * If you see this message, make sure that you only import one version of Yjs. In many cases,\n * your package manager installs two versions of Yjs that are used by different packages within your project.\n * Another reason for this message is that some parts of your project use the commonjs version of Yjs\n * and others use the EcmaScript version of Yjs.\n *\n * This often leads to issues that are hard to debug. We often need to perform constructor checks,\n * e.g. `struct instanceof GC`. If you imported different versions of Yjs, it is impossible for us to\n * do the constructor checks anymore - which might break the CRDT algorithm.\n *\n * https://github.com/yjs/yjs/issues/438\n */\n console.error('Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438')\n}\nglo[importIdentifier] = true\n", "/**\n * @module awareness-protocol\n */\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as time from 'lib0/time'\nimport * as math from 'lib0/math'\nimport { Observable } from 'lib0/observable'\nimport * as f from 'lib0/function'\nimport * as Y from 'yjs' // eslint-disable-line\n\nexport const outdatedTimeout = 30000\n\n/**\n * @typedef {Object} MetaClientState\n * @property {number} MetaClientState.clock\n * @property {number} MetaClientState.lastUpdated unix timestamp\n */\n\n/**\n * The Awareness class implements a simple shared state protocol that can be used for non-persistent data like awareness information\n * (cursor, username, status, ..). Each client can update its own local state and listen to state changes of\n * remote clients. Every client may set a state of a remote peer to `null` to mark the client as offline.\n *\n * Each client is identified by a unique client id (something we borrow from `doc.clientID`). A client can override\n * its own state by propagating a message with an increasing timestamp (`clock`). If such a message is received, it is\n * applied if the known state of that client is older than the new state (`clock < newClock`). If a client thinks that\n * a remote client is offline, it may propagate a message with\n * `{ clock: currentClientClock, state: null, client: remoteClient }`. If such a\n * message is received, and the known clock of that client equals the received clock, it will override the state with `null`.\n *\n * Before a client disconnects, it should propagate a `null` state with an updated clock.\n *\n * Awareness states must be updated every 30 seconds. Otherwise the Awareness instance will delete the client state.\n *\n * @extends {Observable}\n */\nexport class Awareness extends Observable {\n /**\n * @param {Y.Doc} doc\n */\n constructor (doc) {\n super()\n this.doc = doc\n /**\n * @type {number}\n */\n this.clientID = doc.clientID\n /**\n * Maps from client id to client state\n * @type {Map>}\n */\n this.states = new Map()\n /**\n * @type {Map}\n */\n this.meta = new Map()\n this._checkInterval = /** @type {any} */ (setInterval(() => {\n const now = time.getUnixTime()\n if (this.getLocalState() !== null && (outdatedTimeout / 2 <= now - /** @type {{lastUpdated:number}} */ (this.meta.get(this.clientID)).lastUpdated)) {\n // renew local clock\n this.setLocalState(this.getLocalState())\n }\n /**\n * @type {Array}\n */\n const remove = []\n this.meta.forEach((meta, clientid) => {\n if (clientid !== this.clientID && outdatedTimeout <= now - meta.lastUpdated && this.states.has(clientid)) {\n remove.push(clientid)\n }\n })\n if (remove.length > 0) {\n removeAwarenessStates(this, remove, 'timeout')\n }\n }, math.floor(outdatedTimeout / 10)))\n doc.on('destroy', () => {\n this.destroy()\n })\n this.setLocalState({})\n }\n\n destroy () {\n this.emit('destroy', [this])\n this.setLocalState(null)\n super.destroy()\n clearInterval(this._checkInterval)\n }\n\n /**\n * @return {Object|null}\n */\n getLocalState () {\n return this.states.get(this.clientID) || null\n }\n\n /**\n * @param {Object|null} state\n */\n setLocalState (state) {\n const clientID = this.clientID\n const currLocalMeta = this.meta.get(clientID)\n const clock = currLocalMeta === undefined ? 0 : currLocalMeta.clock + 1\n const prevState = this.states.get(clientID)\n if (state === null) {\n this.states.delete(clientID)\n } else {\n this.states.set(clientID, state)\n }\n this.meta.set(clientID, {\n clock,\n lastUpdated: time.getUnixTime()\n })\n const added = []\n const updated = []\n const filteredUpdated = []\n const removed = []\n if (state === null) {\n removed.push(clientID)\n } else if (prevState == null) {\n if (state != null) {\n added.push(clientID)\n }\n } else {\n updated.push(clientID)\n if (!f.equalityDeep(prevState, state)) {\n filteredUpdated.push(clientID)\n }\n }\n if (added.length > 0 || filteredUpdated.length > 0 || removed.length > 0) {\n this.emit('change', [{ added, updated: filteredUpdated, removed }, 'local'])\n }\n this.emit('update', [{ added, updated, removed }, 'local'])\n }\n\n /**\n * @param {string} field\n * @param {any} value\n */\n setLocalStateField (field, value) {\n const state = this.getLocalState()\n if (state !== null) {\n this.setLocalState({\n ...state,\n [field]: value\n })\n }\n }\n\n /**\n * @return {Map>}\n */\n getStates () {\n return this.states\n }\n}\n\n/**\n * Mark (remote) clients as inactive and remove them from the list of active peers.\n * This change will be propagated to remote clients.\n *\n * @param {Awareness} awareness\n * @param {Array} clients\n * @param {any} origin\n */\nexport const removeAwarenessStates = (awareness, clients, origin) => {\n const removed = []\n for (let i = 0; i < clients.length; i++) {\n const clientID = clients[i]\n if (awareness.states.has(clientID)) {\n awareness.states.delete(clientID)\n if (clientID === awareness.clientID) {\n const curMeta = /** @type {MetaClientState} */ (awareness.meta.get(clientID))\n awareness.meta.set(clientID, {\n clock: curMeta.clock + 1,\n lastUpdated: time.getUnixTime()\n })\n }\n removed.push(clientID)\n }\n }\n if (removed.length > 0) {\n awareness.emit('change', [{ added: [], updated: [], removed }, origin])\n awareness.emit('update', [{ added: [], updated: [], removed }, origin])\n }\n}\n\n/**\n * @param {Awareness} awareness\n * @param {Array} clients\n * @return {Uint8Array}\n */\nexport const encodeAwarenessUpdate = (awareness, clients, states = awareness.states) => {\n const len = clients.length\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, len)\n for (let i = 0; i < len; i++) {\n const clientID = clients[i]\n const state = states.get(clientID) || null\n const clock = /** @type {MetaClientState} */ (awareness.meta.get(clientID)).clock\n encoding.writeVarUint(encoder, clientID)\n encoding.writeVarUint(encoder, clock)\n encoding.writeVarString(encoder, JSON.stringify(state))\n }\n return encoding.toUint8Array(encoder)\n}\n\n/**\n * Modify the content of an awareness update before re-encoding it to an awareness update.\n *\n * This might be useful when you have a central server that wants to ensure that clients\n * cant hijack somebody elses identity.\n *\n * @param {Uint8Array} update\n * @param {function(any):any} modify\n * @return {Uint8Array}\n */\nexport const modifyAwarenessUpdate = (update, modify) => {\n const decoder = decoding.createDecoder(update)\n const encoder = encoding.createEncoder()\n const len = decoding.readVarUint(decoder)\n encoding.writeVarUint(encoder, len)\n for (let i = 0; i < len; i++) {\n const clientID = decoding.readVarUint(decoder)\n const clock = decoding.readVarUint(decoder)\n const state = JSON.parse(decoding.readVarString(decoder))\n const modifiedState = modify(state)\n encoding.writeVarUint(encoder, clientID)\n encoding.writeVarUint(encoder, clock)\n encoding.writeVarString(encoder, JSON.stringify(modifiedState))\n }\n return encoding.toUint8Array(encoder)\n}\n\n/**\n * @param {Awareness} awareness\n * @param {Uint8Array} update\n * @param {any} origin This will be added to the emitted change event\n */\nexport const applyAwarenessUpdate = (awareness, update, origin) => {\n const decoder = decoding.createDecoder(update)\n const timestamp = time.getUnixTime()\n const added = []\n const updated = []\n const filteredUpdated = []\n const removed = []\n const len = decoding.readVarUint(decoder)\n for (let i = 0; i < len; i++) {\n const clientID = decoding.readVarUint(decoder)\n let clock = decoding.readVarUint(decoder)\n const state = JSON.parse(decoding.readVarString(decoder))\n const clientMeta = awareness.meta.get(clientID)\n const prevState = awareness.states.get(clientID)\n const currClock = clientMeta === undefined ? 0 : clientMeta.clock\n if (currClock < clock || (currClock === clock && state === null && awareness.states.has(clientID))) {\n if (state === null) {\n // never let a remote client remove this local state\n if (clientID === awareness.clientID && awareness.getLocalState() != null) {\n // remote client removed the local state. Do not remote state. Broadcast a message indicating\n // that this client still exists by increasing the clock\n clock++\n } else {\n awareness.states.delete(clientID)\n }\n } else {\n awareness.states.set(clientID, state)\n }\n awareness.meta.set(clientID, {\n clock,\n lastUpdated: timestamp\n })\n if (clientMeta === undefined && state !== null) {\n added.push(clientID)\n } else if (clientMeta !== undefined && state === null) {\n removed.push(clientID)\n } else if (state !== null) {\n if (!f.equalityDeep(state, prevState)) {\n filteredUpdated.push(clientID)\n }\n updated.push(clientID)\n }\n }\n }\n if (added.length > 0 || filteredUpdated.length > 0 || removed.length > 0) {\n awareness.emit('change', [{\n added, updated: filteredUpdated, removed\n }, origin])\n }\n if (added.length > 0 || updated.length > 0 || removed.length > 0) {\n awareness.emit('update', [{\n added, updated, removed\n }, origin])\n }\n}\n", "/* eslint-env browser */\n\n/**\n * Helpers to work with IndexedDB.\n *\n * @module indexeddb\n */\n\nimport * as promise from './promise.js'\nimport * as error from './error.js'\n\n/* c8 ignore start */\n\n/**\n * IDB Request to Promise transformer\n *\n * @param {IDBRequest} request\n * @return {Promise}\n */\nexport const rtop = request => promise.create((resolve, reject) => {\n // @ts-ignore\n request.onerror = event => reject(new Error(event.target.error))\n // @ts-ignore\n request.onsuccess = event => resolve(event.target.result)\n})\n\n/**\n * @param {string} name\n * @param {function(IDBDatabase):any} initDB Called when the database is first created\n * @return {Promise}\n */\nexport const openDB = (name, initDB) => promise.create((resolve, reject) => {\n const request = indexedDB.open(name)\n /**\n * @param {any} event\n */\n request.onupgradeneeded = event => initDB(event.target.result)\n /**\n * @param {any} event\n */\n request.onerror = event => reject(error.create(event.target.error))\n /**\n * @param {any} event\n */\n request.onsuccess = event => {\n /**\n * @type {IDBDatabase}\n */\n const db = event.target.result\n db.onversionchange = () => { db.close() }\n resolve(db)\n }\n})\n\n/**\n * @param {string} name\n */\nexport const deleteDB = name => rtop(indexedDB.deleteDatabase(name))\n\n/**\n * @param {IDBDatabase} db\n * @param {Array|Array>} definitions\n */\nexport const createStores = (db, definitions) => definitions.forEach(d =>\n // @ts-ignore\n db.createObjectStore.apply(db, d)\n)\n\n/**\n * @param {IDBDatabase} db\n * @param {Array} stores\n * @param {\"readwrite\"|\"readonly\"} [access]\n * @return {Array}\n */\nexport const transact = (db, stores, access = 'readwrite') => {\n const transaction = db.transaction(stores, access)\n return stores.map(store => getStore(transaction, store))\n}\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange} [range]\n * @return {Promise}\n */\nexport const count = (store, range) =>\n rtop(store.count(range))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date | Array } key\n * @return {Promise>}\n */\nexport const get = (store, key) =>\n rtop(store.get(key))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date | IDBKeyRange | Array } key\n */\nexport const del = (store, key) =>\n rtop(store.delete(key))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date | boolean} item\n * @param {String | number | ArrayBuffer | Date | Array} [key]\n */\nexport const put = (store, item, key) =>\n rtop(store.put(item, key))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date | boolean} item\n * @param {String | number | ArrayBuffer | Date | Array} key\n * @return {Promise}\n */\nexport const add = (store, item, key) =>\n rtop(store.add(item, key))\n\n/**\n * @param {IDBObjectStore} store\n * @param {String | number | ArrayBuffer | Date} item\n * @return {Promise} Returns the generated key\n */\nexport const addAutoKey = (store, item) =>\n rtop(store.add(item))\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange} [range]\n * @param {number} [limit]\n * @return {Promise>}\n */\nexport const getAll = (store, range, limit) =>\n rtop(store.getAll(range, limit))\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange} [range]\n * @param {number} [limit]\n * @return {Promise>}\n */\nexport const getAllKeys = (store, range, limit) =>\n rtop(store.getAllKeys(range, limit))\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange|null} query\n * @param {'next'|'prev'|'nextunique'|'prevunique'} direction\n * @return {Promise}\n */\nexport const queryFirst = (store, query, direction) => {\n /**\n * @type {any}\n */\n let first = null\n return iterateKeys(store, query, key => {\n first = key\n return false\n }, direction).then(() => first)\n}\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange?} [range]\n * @return {Promise}\n */\nexport const getLastKey = (store, range = null) => queryFirst(store, range, 'prev')\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange?} [range]\n * @return {Promise}\n */\nexport const getFirstKey = (store, range = null) => queryFirst(store, range, 'next')\n\n/**\n * @typedef KeyValuePair\n * @type {Object}\n * @property {any} k key\n * @property {any} v Value\n */\n\n/**\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange} [range]\n * @param {number} [limit]\n * @return {Promise>}\n */\nexport const getAllKeysValues = (store, range, limit) =>\n // @ts-ignore\n promise.all([getAllKeys(store, range, limit), getAll(store, range, limit)]).then(([ks, vs]) => ks.map((k, i) => ({ k, v: vs[i] })))\n\n/**\n * @param {any} request\n * @param {function(IDBCursorWithValue):void|boolean|Promise} f\n * @return {Promise}\n */\nconst iterateOnRequest = (request, f) => promise.create((resolve, reject) => {\n request.onerror = reject\n /**\n * @param {any} event\n */\n request.onsuccess = async event => {\n const cursor = event.target.result\n if (cursor === null || (await f(cursor)) === false) {\n return resolve()\n }\n cursor.continue()\n }\n})\n\n/**\n * Iterate on keys and values\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange|null} keyrange\n * @param {function(any,any):void|boolean|Promise} f Callback that receives (value, key)\n * @param {'next'|'prev'|'nextunique'|'prevunique'} direction\n */\nexport const iterate = (store, keyrange, f, direction = 'next') =>\n iterateOnRequest(store.openCursor(keyrange, direction), cursor => f(cursor.value, cursor.key))\n\n/**\n * Iterate on the keys (no values)\n *\n * @param {IDBObjectStore} store\n * @param {IDBKeyRange|null} keyrange\n * @param {function(any):void|boolean|Promise} f callback that receives the key\n * @param {'next'|'prev'|'nextunique'|'prevunique'} direction\n */\nexport const iterateKeys = (store, keyrange, f, direction = 'next') =>\n iterateOnRequest(store.openKeyCursor(keyrange, direction), cursor => f(cursor.key))\n\n/**\n * Open store from transaction\n * @param {IDBTransaction} t\n * @param {String} store\n * @returns {IDBObjectStore}\n */\nexport const getStore = (t, store) => t.objectStore(store)\n\n/**\n * @param {any} lower\n * @param {any} upper\n * @param {boolean} lowerOpen\n * @param {boolean} upperOpen\n */\nexport const createIDBKeyRangeBound = (lower, upper, lowerOpen, upperOpen) => IDBKeyRange.bound(lower, upper, lowerOpen, upperOpen)\n\n/**\n * @param {any} upper\n * @param {boolean} upperOpen\n */\nexport const createIDBKeyRangeUpperBound = (upper, upperOpen) => IDBKeyRange.upperBound(upper, upperOpen)\n\n/**\n * @param {any} lower\n * @param {boolean} lowerOpen\n */\nexport const createIDBKeyRangeLowerBound = (lower, lowerOpen) => IDBKeyRange.lowerBound(lower, lowerOpen)\n\n/* c8 ignore stop */\n", "import * as Y from 'yjs'\nimport * as idb from 'lib0/indexeddb'\nimport * as promise from 'lib0/promise'\nimport { Observable } from 'lib0/observable'\n\nconst customStoreName = 'custom'\nconst updatesStoreName = 'updates'\n\nexport const PREFERRED_TRIM_SIZE = 500\n\n/**\n * @param {IndexeddbPersistence} idbPersistence\n * @param {function(IDBObjectStore):void} [beforeApplyUpdatesCallback]\n * @param {function(IDBObjectStore):void} [afterApplyUpdatesCallback]\n */\nexport const fetchUpdates = (idbPersistence, beforeApplyUpdatesCallback = () => {}, afterApplyUpdatesCallback = () => {}) => {\n const [updatesStore] = idb.transact(/** @type {IDBDatabase} */ (idbPersistence.db), [updatesStoreName]) // , 'readonly')\n return idb.getAll(updatesStore, idb.createIDBKeyRangeLowerBound(idbPersistence._dbref, false)).then(updates => {\n if (!idbPersistence._destroyed) {\n beforeApplyUpdatesCallback(updatesStore)\n Y.transact(idbPersistence.doc, () => {\n updates.forEach(val => Y.applyUpdate(idbPersistence.doc, val))\n }, idbPersistence, false)\n afterApplyUpdatesCallback(updatesStore)\n }\n })\n .then(() => idb.getLastKey(updatesStore).then(lastKey => { idbPersistence._dbref = lastKey + 1 }))\n .then(() => idb.count(updatesStore).then(cnt => { idbPersistence._dbsize = cnt }))\n .then(() => updatesStore)\n}\n\n/**\n * @param {IndexeddbPersistence} idbPersistence\n * @param {boolean} forceStore\n */\nexport const storeState = (idbPersistence, forceStore = true) =>\n fetchUpdates(idbPersistence)\n .then(updatesStore => {\n if (forceStore || idbPersistence._dbsize >= PREFERRED_TRIM_SIZE) {\n idb.addAutoKey(updatesStore, Y.encodeStateAsUpdate(idbPersistence.doc))\n .then(() => idb.del(updatesStore, idb.createIDBKeyRangeUpperBound(idbPersistence._dbref, true)))\n .then(() => idb.count(updatesStore).then(cnt => { idbPersistence._dbsize = cnt }))\n }\n })\n\n/**\n * @param {string} name\n */\nexport const clearDocument = name => idb.deleteDB(name)\n\n/**\n * @extends Observable\n */\nexport class IndexeddbPersistence extends Observable {\n /**\n * @param {string} name\n * @param {Y.Doc} doc\n */\n constructor (name, doc) {\n super()\n this.doc = doc\n this.name = name\n this._dbref = 0\n this._dbsize = 0\n this._destroyed = false\n /**\n * @type {IDBDatabase|null}\n */\n this.db = null\n this.synced = false\n this._db = idb.openDB(name, db =>\n idb.createStores(db, [\n ['updates', { autoIncrement: true }],\n ['custom']\n ])\n )\n /**\n * @type {Promise}\n */\n this.whenSynced = promise.create(resolve => this.on('synced', () => resolve(this)))\n\n this._db.then(db => {\n this.db = db\n /**\n * @param {IDBObjectStore} updatesStore\n */\n const beforeApplyUpdatesCallback = (updatesStore) => idb.addAutoKey(updatesStore, Y.encodeStateAsUpdate(doc))\n const afterApplyUpdatesCallback = () => {\n if (this._destroyed) return this\n this.synced = true\n this.emit('synced', [this])\n }\n fetchUpdates(this, beforeApplyUpdatesCallback, afterApplyUpdatesCallback)\n })\n /**\n * Timeout in ms untill data is merged and persisted in idb.\n */\n this._storeTimeout = 1000\n /**\n * @type {any}\n */\n this._storeTimeoutId = null\n /**\n * @param {Uint8Array} update\n * @param {any} origin\n */\n this._storeUpdate = (update, origin) => {\n if (this.db && origin !== this) {\n const [updatesStore] = idb.transact(/** @type {IDBDatabase} */ (this.db), [updatesStoreName])\n idb.addAutoKey(updatesStore, update)\n if (++this._dbsize >= PREFERRED_TRIM_SIZE) {\n // debounce store call\n if (this._storeTimeoutId !== null) {\n clearTimeout(this._storeTimeoutId)\n }\n this._storeTimeoutId = setTimeout(() => {\n storeState(this, false)\n this._storeTimeoutId = null\n }, this._storeTimeout)\n }\n }\n }\n doc.on('update', this._storeUpdate)\n this.destroy = this.destroy.bind(this)\n doc.on('destroy', this.destroy)\n }\n\n destroy () {\n if (this._storeTimeoutId) {\n clearTimeout(this._storeTimeoutId)\n }\n this.doc.off('update', this._storeUpdate)\n this.doc.off('destroy', this.destroy)\n this._destroyed = true\n return this._db.then(db => {\n db.close()\n })\n }\n\n /**\n * Destroys this instance and removes all data from indexeddb.\n *\n * @return {Promise}\n */\n clearData () {\n return this.destroy().then(() => {\n idb.deleteDB(this.name)\n })\n }\n\n /**\n * @param {String | number | ArrayBuffer | Date} key\n * @return {Promise}\n */\n get (key) {\n return this._db.then(db => {\n const [custom] = idb.transact(db, [customStoreName], 'readonly')\n return idb.get(custom, key)\n })\n }\n\n /**\n * @param {String | number | ArrayBuffer | Date} key\n * @param {String | number | ArrayBuffer | Date} value\n * @return {Promise}\n */\n set (key, value) {\n return this._db.then(db => {\n const [custom] = idb.transact(db, [customStoreName])\n return idb.put(custom, value, key)\n })\n }\n\n /**\n * @param {String | number | ArrayBuffer | Date} key\n * @return {Promise}\n */\n del (key) {\n return this._db.then(db => {\n const [custom] = idb.transact(db, [customStoreName])\n return idb.del(custom, key)\n })\n }\n}\n", "/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n", "import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n", "import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n", "import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n", "import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n", "/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n", "/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n", "/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n", "/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nexport default identity;\n", "import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n", "import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n", "import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n", "/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n", "import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n", "/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n", "import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n", "import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n", "/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nexport default apply;\n", "/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n", "/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nexport default shortOut;\n", "/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nexport default constant;\n", "import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n", "import constant from './constant.js';\nimport defineProperty from './_defineProperty.js';\nimport identity from './identity.js';\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nexport default baseSetToString;\n", "import baseSetToString from './_baseSetToString.js';\nimport shortOut from './_shortOut.js';\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nexport default setToString;\n", "/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n", "import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n", "/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n", "import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n", "import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n", "import apply from './_apply.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nexport default overRest;\n", "import identity from './identity.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nexport default baseRest;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n", "import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n", "import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nexport default isIterateeCall;\n", "import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nexport default createAssigner;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n", "/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n", "import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n", "import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n", "/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n", "import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n", "import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n", "/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n", "import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n", "import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n", "import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n", "/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n", "import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n", "import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n", "import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n", "/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n", "import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n", "import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n", "import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n", "import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n", "/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n", "import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n", "import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n", "/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n", "import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n", "import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n", "import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n", "import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n", "/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n", "import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n", "import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n", "import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n", "/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n", "import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n", "import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n", "import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n", "/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n", "/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n", "/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n", "import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n", "import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n", "import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n", "import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n", "import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n", "/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n", "/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n", "import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n", "import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n", "import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n", "import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n", "import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n", "import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n", "import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n", "import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n", "import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n", "import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n", "import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n", "import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n", "/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n", "import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n", "import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n", "import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n", "import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n", "import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n", "import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n", "import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n", "import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n", "import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n", "import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n", "/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nexport default setCacheAdd;\n", "/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nexport default setCacheHas;\n", "import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nexport default SetCache;\n", "/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nexport default arraySome;\n", "/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nexport default cacheHas;\n", "import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nexport default equalArrays;\n", "/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nexport default mapToArray;\n", "/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nexport default setToArray;\n", "import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nexport default equalByTag;\n", "import getAllKeys from './_getAllKeys.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nexport default equalObjects;\n", "import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nexport default baseIsEqualDeep;\n", "import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nexport default baseIsEqual;\n", "/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n", "import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n", "import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignMergeValue;\n", "import isArrayLike from './isArrayLike.js';\nimport isObjectLike from './isObjectLike.js';\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nexport default isArrayLikeObject;\n", "/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nexport default safeGet;\n", "import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nexport default toPlainObject;\n", "import assignMergeValue from './_assignMergeValue.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\nimport copyArray from './_copyArray.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport isBuffer from './isBuffer.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isPlainObject from './isPlainObject.js';\nimport isTypedArray from './isTypedArray.js';\nimport safeGet from './_safeGet.js';\nimport toPlainObject from './toPlainObject.js';\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nexport default baseMergeDeep;\n", "import Stack from './_Stack.js';\nimport assignMergeValue from './_assignMergeValue.js';\nimport baseFor from './_baseFor.js';\nimport baseMergeDeep from './_baseMergeDeep.js';\nimport isObject from './isObject.js';\nimport keysIn from './keysIn.js';\nimport safeGet from './_safeGet.js';\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nexport default baseMerge;\n", "import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nexport default isEqual;\n", "import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nexport default merge;\n", "/**\n * @license\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"es\" -o ./`\n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\nexport { default as add } from './add.js';\nexport { default as after } from './after.js';\nexport { default as ary } from './ary.js';\nexport { default as assign } from './assign.js';\nexport { default as assignIn } from './assignIn.js';\nexport { default as assignInWith } from './assignInWith.js';\nexport { default as assignWith } from './assignWith.js';\nexport { default as at } from './at.js';\nexport { default as attempt } from './attempt.js';\nexport { default as before } from './before.js';\nexport { default as bind } from './bind.js';\nexport { default as bindAll } from './bindAll.js';\nexport { default as bindKey } from './bindKey.js';\nexport { default as camelCase } from './camelCase.js';\nexport { default as capitalize } from './capitalize.js';\nexport { default as castArray } from './castArray.js';\nexport { default as ceil } from './ceil.js';\nexport { default as chain } from './chain.js';\nexport { default as chunk } from './chunk.js';\nexport { default as clamp } from './clamp.js';\nexport { default as clone } from './clone.js';\nexport { default as cloneDeep } from './cloneDeep.js';\nexport { default as cloneDeepWith } from './cloneDeepWith.js';\nexport { default as cloneWith } from './cloneWith.js';\nexport { default as commit } from './commit.js';\nexport { default as compact } from './compact.js';\nexport { default as concat } from './concat.js';\nexport { default as cond } from './cond.js';\nexport { default as conforms } from './conforms.js';\nexport { default as conformsTo } from './conformsTo.js';\nexport { default as constant } from './constant.js';\nexport { default as countBy } from './countBy.js';\nexport { default as create } from './create.js';\nexport { default as curry } from './curry.js';\nexport { default as curryRight } from './curryRight.js';\nexport { default as debounce } from './debounce.js';\nexport { default as deburr } from './deburr.js';\nexport { default as defaultTo } from './defaultTo.js';\nexport { default as defaults } from './defaults.js';\nexport { default as defaultsDeep } from './defaultsDeep.js';\nexport { default as defer } from './defer.js';\nexport { default as delay } from './delay.js';\nexport { default as difference } from './difference.js';\nexport { default as differenceBy } from './differenceBy.js';\nexport { default as differenceWith } from './differenceWith.js';\nexport { default as divide } from './divide.js';\nexport { default as drop } from './drop.js';\nexport { default as dropRight } from './dropRight.js';\nexport { default as dropRightWhile } from './dropRightWhile.js';\nexport { default as dropWhile } from './dropWhile.js';\nexport { default as each } from './each.js';\nexport { default as eachRight } from './eachRight.js';\nexport { default as endsWith } from './endsWith.js';\nexport { default as entries } from './entries.js';\nexport { default as entriesIn } from './entriesIn.js';\nexport { default as eq } from './eq.js';\nexport { default as escape } from './escape.js';\nexport { default as escapeRegExp } from './escapeRegExp.js';\nexport { default as every } from './every.js';\nexport { default as extend } from './extend.js';\nexport { default as extendWith } from './extendWith.js';\nexport { default as fill } from './fill.js';\nexport { default as filter } from './filter.js';\nexport { default as find } from './find.js';\nexport { default as findIndex } from './findIndex.js';\nexport { default as findKey } from './findKey.js';\nexport { default as findLast } from './findLast.js';\nexport { default as findLastIndex } from './findLastIndex.js';\nexport { default as findLastKey } from './findLastKey.js';\nexport { default as first } from './first.js';\nexport { default as flatMap } from './flatMap.js';\nexport { default as flatMapDeep } from './flatMapDeep.js';\nexport { default as flatMapDepth } from './flatMapDepth.js';\nexport { default as flatten } from './flatten.js';\nexport { default as flattenDeep } from './flattenDeep.js';\nexport { default as flattenDepth } from './flattenDepth.js';\nexport { default as flip } from './flip.js';\nexport { default as floor } from './floor.js';\nexport { default as flow } from './flow.js';\nexport { default as flowRight } from './flowRight.js';\nexport { default as forEach } from './forEach.js';\nexport { default as forEachRight } from './forEachRight.js';\nexport { default as forIn } from './forIn.js';\nexport { default as forInRight } from './forInRight.js';\nexport { default as forOwn } from './forOwn.js';\nexport { default as forOwnRight } from './forOwnRight.js';\nexport { default as fromPairs } from './fromPairs.js';\nexport { default as functions } from './functions.js';\nexport { default as functionsIn } from './functionsIn.js';\nexport { default as get } from './get.js';\nexport { default as groupBy } from './groupBy.js';\nexport { default as gt } from './gt.js';\nexport { default as gte } from './gte.js';\nexport { default as has } from './has.js';\nexport { default as hasIn } from './hasIn.js';\nexport { default as head } from './head.js';\nexport { default as identity } from './identity.js';\nexport { default as inRange } from './inRange.js';\nexport { default as includes } from './includes.js';\nexport { default as indexOf } from './indexOf.js';\nexport { default as initial } from './initial.js';\nexport { default as intersection } from './intersection.js';\nexport { default as intersectionBy } from './intersectionBy.js';\nexport { default as intersectionWith } from './intersectionWith.js';\nexport { default as invert } from './invert.js';\nexport { default as invertBy } from './invertBy.js';\nexport { default as invoke } from './invoke.js';\nexport { default as invokeMap } from './invokeMap.js';\nexport { default as isArguments } from './isArguments.js';\nexport { default as isArray } from './isArray.js';\nexport { default as isArrayBuffer } from './isArrayBuffer.js';\nexport { default as isArrayLike } from './isArrayLike.js';\nexport { default as isArrayLikeObject } from './isArrayLikeObject.js';\nexport { default as isBoolean } from './isBoolean.js';\nexport { default as isBuffer } from './isBuffer.js';\nexport { default as isDate } from './isDate.js';\nexport { default as isElement } from './isElement.js';\nexport { default as isEmpty } from './isEmpty.js';\nexport { default as isEqual } from './isEqual.js';\nexport { default as isEqualWith } from './isEqualWith.js';\nexport { default as isError } from './isError.js';\nexport { default as isFinite } from './isFinite.js';\nexport { default as isFunction } from './isFunction.js';\nexport { default as isInteger } from './isInteger.js';\nexport { default as isLength } from './isLength.js';\nexport { default as isMap } from './isMap.js';\nexport { default as isMatch } from './isMatch.js';\nexport { default as isMatchWith } from './isMatchWith.js';\nexport { default as isNaN } from './isNaN.js';\nexport { default as isNative } from './isNative.js';\nexport { default as isNil } from './isNil.js';\nexport { default as isNull } from './isNull.js';\nexport { default as isNumber } from './isNumber.js';\nexport { default as isObject } from './isObject.js';\nexport { default as isObjectLike } from './isObjectLike.js';\nexport { default as isPlainObject } from './isPlainObject.js';\nexport { default as isRegExp } from './isRegExp.js';\nexport { default as isSafeInteger } from './isSafeInteger.js';\nexport { default as isSet } from './isSet.js';\nexport { default as isString } from './isString.js';\nexport { default as isSymbol } from './isSymbol.js';\nexport { default as isTypedArray } from './isTypedArray.js';\nexport { default as isUndefined } from './isUndefined.js';\nexport { default as isWeakMap } from './isWeakMap.js';\nexport { default as isWeakSet } from './isWeakSet.js';\nexport { default as iteratee } from './iteratee.js';\nexport { default as join } from './join.js';\nexport { default as kebabCase } from './kebabCase.js';\nexport { default as keyBy } from './keyBy.js';\nexport { default as keys } from './keys.js';\nexport { default as keysIn } from './keysIn.js';\nexport { default as last } from './last.js';\nexport { default as lastIndexOf } from './lastIndexOf.js';\nexport { default as lodash } from './wrapperLodash.js';\nexport { default as lowerCase } from './lowerCase.js';\nexport { default as lowerFirst } from './lowerFirst.js';\nexport { default as lt } from './lt.js';\nexport { default as lte } from './lte.js';\nexport { default as map } from './map.js';\nexport { default as mapKeys } from './mapKeys.js';\nexport { default as mapValues } from './mapValues.js';\nexport { default as matches } from './matches.js';\nexport { default as matchesProperty } from './matchesProperty.js';\nexport { default as max } from './max.js';\nexport { default as maxBy } from './maxBy.js';\nexport { default as mean } from './mean.js';\nexport { default as meanBy } from './meanBy.js';\nexport { default as memoize } from './memoize.js';\nexport { default as merge } from './merge.js';\nexport { default as mergeWith } from './mergeWith.js';\nexport { default as method } from './method.js';\nexport { default as methodOf } from './methodOf.js';\nexport { default as min } from './min.js';\nexport { default as minBy } from './minBy.js';\nexport { default as mixin } from './mixin.js';\nexport { default as multiply } from './multiply.js';\nexport { default as negate } from './negate.js';\nexport { default as next } from './next.js';\nexport { default as noop } from './noop.js';\nexport { default as now } from './now.js';\nexport { default as nth } from './nth.js';\nexport { default as nthArg } from './nthArg.js';\nexport { default as omit } from './omit.js';\nexport { default as omitBy } from './omitBy.js';\nexport { default as once } from './once.js';\nexport { default as orderBy } from './orderBy.js';\nexport { default as over } from './over.js';\nexport { default as overArgs } from './overArgs.js';\nexport { default as overEvery } from './overEvery.js';\nexport { default as overSome } from './overSome.js';\nexport { default as pad } from './pad.js';\nexport { default as padEnd } from './padEnd.js';\nexport { default as padStart } from './padStart.js';\nexport { default as parseInt } from './parseInt.js';\nexport { default as partial } from './partial.js';\nexport { default as partialRight } from './partialRight.js';\nexport { default as partition } from './partition.js';\nexport { default as pick } from './pick.js';\nexport { default as pickBy } from './pickBy.js';\nexport { default as plant } from './plant.js';\nexport { default as property } from './property.js';\nexport { default as propertyOf } from './propertyOf.js';\nexport { default as pull } from './pull.js';\nexport { default as pullAll } from './pullAll.js';\nexport { default as pullAllBy } from './pullAllBy.js';\nexport { default as pullAllWith } from './pullAllWith.js';\nexport { default as pullAt } from './pullAt.js';\nexport { default as random } from './random.js';\nexport { default as range } from './range.js';\nexport { default as rangeRight } from './rangeRight.js';\nexport { default as rearg } from './rearg.js';\nexport { default as reduce } from './reduce.js';\nexport { default as reduceRight } from './reduceRight.js';\nexport { default as reject } from './reject.js';\nexport { default as remove } from './remove.js';\nexport { default as repeat } from './repeat.js';\nexport { default as replace } from './replace.js';\nexport { default as rest } from './rest.js';\nexport { default as result } from './result.js';\nexport { default as reverse } from './reverse.js';\nexport { default as round } from './round.js';\nexport { default as sample } from './sample.js';\nexport { default as sampleSize } from './sampleSize.js';\nexport { default as set } from './set.js';\nexport { default as setWith } from './setWith.js';\nexport { default as shuffle } from './shuffle.js';\nexport { default as size } from './size.js';\nexport { default as slice } from './slice.js';\nexport { default as snakeCase } from './snakeCase.js';\nexport { default as some } from './some.js';\nexport { default as sortBy } from './sortBy.js';\nexport { default as sortedIndex } from './sortedIndex.js';\nexport { default as sortedIndexBy } from './sortedIndexBy.js';\nexport { default as sortedIndexOf } from './sortedIndexOf.js';\nexport { default as sortedLastIndex } from './sortedLastIndex.js';\nexport { default as sortedLastIndexBy } from './sortedLastIndexBy.js';\nexport { default as sortedLastIndexOf } from './sortedLastIndexOf.js';\nexport { default as sortedUniq } from './sortedUniq.js';\nexport { default as sortedUniqBy } from './sortedUniqBy.js';\nexport { default as split } from './split.js';\nexport { default as spread } from './spread.js';\nexport { default as startCase } from './startCase.js';\nexport { default as startsWith } from './startsWith.js';\nexport { default as stubArray } from './stubArray.js';\nexport { default as stubFalse } from './stubFalse.js';\nexport { default as stubObject } from './stubObject.js';\nexport { default as stubString } from './stubString.js';\nexport { default as stubTrue } from './stubTrue.js';\nexport { default as subtract } from './subtract.js';\nexport { default as sum } from './sum.js';\nexport { default as sumBy } from './sumBy.js';\nexport { default as tail } from './tail.js';\nexport { default as take } from './take.js';\nexport { default as takeRight } from './takeRight.js';\nexport { default as takeRightWhile } from './takeRightWhile.js';\nexport { default as takeWhile } from './takeWhile.js';\nexport { default as tap } from './tap.js';\nexport { default as template } from './template.js';\nexport { default as templateSettings } from './templateSettings.js';\nexport { default as throttle } from './throttle.js';\nexport { default as thru } from './thru.js';\nexport { default as times } from './times.js';\nexport { default as toArray } from './toArray.js';\nexport { default as toFinite } from './toFinite.js';\nexport { default as toInteger } from './toInteger.js';\nexport { default as toIterator } from './toIterator.js';\nexport { default as toJSON } from './toJSON.js';\nexport { default as toLength } from './toLength.js';\nexport { default as toLower } from './toLower.js';\nexport { default as toNumber } from './toNumber.js';\nexport { default as toPairs } from './toPairs.js';\nexport { default as toPairsIn } from './toPairsIn.js';\nexport { default as toPath } from './toPath.js';\nexport { default as toPlainObject } from './toPlainObject.js';\nexport { default as toSafeInteger } from './toSafeInteger.js';\nexport { default as toString } from './toString.js';\nexport { default as toUpper } from './toUpper.js';\nexport { default as transform } from './transform.js';\nexport { default as trim } from './trim.js';\nexport { default as trimEnd } from './trimEnd.js';\nexport { default as trimStart } from './trimStart.js';\nexport { default as truncate } from './truncate.js';\nexport { default as unary } from './unary.js';\nexport { default as unescape } from './unescape.js';\nexport { default as union } from './union.js';\nexport { default as unionBy } from './unionBy.js';\nexport { default as unionWith } from './unionWith.js';\nexport { default as uniq } from './uniq.js';\nexport { default as uniqBy } from './uniqBy.js';\nexport { default as uniqWith } from './uniqWith.js';\nexport { default as uniqueId } from './uniqueId.js';\nexport { default as unset } from './unset.js';\nexport { default as unzip } from './unzip.js';\nexport { default as unzipWith } from './unzipWith.js';\nexport { default as update } from './update.js';\nexport { default as updateWith } from './updateWith.js';\nexport { default as upperCase } from './upperCase.js';\nexport { default as upperFirst } from './upperFirst.js';\nexport { default as value } from './value.js';\nexport { default as valueOf } from './valueOf.js';\nexport { default as values } from './values.js';\nexport { default as valuesIn } from './valuesIn.js';\nexport { default as without } from './without.js';\nexport { default as words } from './words.js';\nexport { default as wrap } from './wrap.js';\nexport { default as wrapperAt } from './wrapperAt.js';\nexport { default as wrapperChain } from './wrapperChain.js';\nexport { default as wrapperCommit } from './commit.js';\nexport { default as wrapperLodash } from './wrapperLodash.js';\nexport { default as wrapperNext } from './next.js';\nexport { default as wrapperPlant } from './plant.js';\nexport { default as wrapperReverse } from './wrapperReverse.js';\nexport { default as wrapperToIterator } from './toIterator.js';\nexport { default as wrapperValue } from './wrapperValue.js';\nexport { default as xor } from './xor.js';\nexport { default as xorBy } from './xorBy.js';\nexport { default as xorWith } from './xorWith.js';\nexport { default as zip } from './zip.js';\nexport { default as zipObject } from './zipObject.js';\nexport { default as zipObjectDeep } from './zipObjectDeep.js';\nexport { default as zipWith } from './zipWith.js';\nexport { default } from './lodash.default.js';\n", "enum Scope {\n TYPE = (1 << 2) - 1, // 0011 Lower two bits\n LEVEL = ((1 << 2) - 1) << 2, // 1100 Higher two bits\n\n ATTRIBUTE = (1 << 0) | LEVEL, // 1101\n BLOT = (1 << 1) | LEVEL, // 1110\n INLINE = (1 << 2) | TYPE, // 0111\n BLOCK = (1 << 3) | TYPE, // 1011\n\n BLOCK_BLOT = BLOCK & BLOT, // 1010\n INLINE_BLOT = INLINE & BLOT, // 0110\n BLOCK_ATTRIBUTE = BLOCK & ATTRIBUTE, // 1001\n INLINE_ATTRIBUTE = INLINE & ATTRIBUTE, // 0101\n\n ANY = TYPE | LEVEL,\n}\n\nexport default Scope;\n", "import Scope from '../scope.js';\n\nexport interface AttributorOptions {\n scope?: Scope;\n whitelist?: string[];\n}\n\nexport default class Attributor {\n public static keys(node: HTMLElement): string[] {\n return Array.from(node.attributes).map((item: Attr) => item.name);\n }\n\n public scope: Scope;\n public whitelist: string[] | undefined;\n\n constructor(\n public readonly attrName: string,\n public readonly keyName: string,\n options: AttributorOptions = {},\n ) {\n const attributeBit = Scope.TYPE & Scope.ATTRIBUTE;\n this.scope =\n options.scope != null\n ? // Ignore type bits, force attribute bit\n (options.scope & Scope.LEVEL) | attributeBit\n : Scope.ATTRIBUTE;\n if (options.whitelist != null) {\n this.whitelist = options.whitelist;\n }\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n node.setAttribute(this.keyName, value);\n return true;\n }\n\n public canAdd(_node: HTMLElement, value: any): boolean {\n if (this.whitelist == null) {\n return true;\n }\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n } else {\n return this.whitelist.indexOf(value) > -1;\n }\n }\n\n public remove(node: HTMLElement): void {\n node.removeAttribute(this.keyName);\n }\n\n public value(node: HTMLElement): any {\n const value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n }\n}\n", "export default class ParchmentError extends Error {\n public message: string;\n public name: string;\n public stack!: string;\n\n constructor(message: string) {\n message = '[Parchment] ' + message;\n super(message);\n this.message = message;\n this.name = this.constructor.name;\n }\n}\n", "import Attributor from './attributor/attributor.js';\nimport {\n type Blot,\n type BlotConstructor,\n type Root,\n} from './blot/abstract/blot.js';\nimport ParchmentError from './error.js';\nimport Scope from './scope.js';\n\nexport type RegistryDefinition = Attributor | BlotConstructor;\n\nexport interface RegistryInterface {\n create(scroll: Root, input: Node | string | Scope, value?: any): Blot;\n query(query: string | Node | Scope, scope: Scope): RegistryDefinition | null;\n register(...definitions: any[]): any;\n}\n\nexport default class Registry implements RegistryInterface {\n public static blots = new WeakMap();\n\n public static find(node?: Node | null, bubble = false): Blot | null {\n if (node == null) {\n return null;\n }\n if (this.blots.has(node)) {\n return this.blots.get(node) || null;\n }\n if (bubble) {\n let parentNode: Node | null = null;\n try {\n parentNode = node.parentNode;\n } catch (err) {\n // Probably hit a permission denied error.\n // A known case is in Firefox, event targets can be anonymous DIVs\n // inside an input element.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=208427\n return null;\n }\n return this.find(parentNode, bubble);\n }\n return null;\n }\n\n private attributes: { [key: string]: Attributor } = {};\n private classes: { [key: string]: BlotConstructor } = {};\n private tags: { [key: string]: BlotConstructor } = {};\n private types: { [key: string]: RegistryDefinition } = {};\n\n public create(scroll: Root, input: Node | string | Scope, value?: any): Blot {\n const match = this.query(input);\n if (match == null) {\n throw new ParchmentError(`Unable to create ${input} blot`);\n }\n const blotClass = match as BlotConstructor;\n const node =\n // @ts-expect-error Fix me later\n input instanceof Node || input.nodeType === Node.TEXT_NODE\n ? input\n : blotClass.create(value);\n\n const blot = new blotClass(scroll, node as Node, value);\n Registry.blots.set(blot.domNode, blot);\n return blot;\n }\n\n public find(node: Node | null, bubble = false): Blot | null {\n return Registry.find(node, bubble);\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): RegistryDefinition | null {\n let match;\n if (typeof query === 'string') {\n match = this.types[query] || this.attributes[query];\n // @ts-expect-error Fix me later\n } else if (query instanceof Text || query.nodeType === Node.TEXT_NODE) {\n match = this.types.text;\n } else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = this.types.block;\n } else if (query & Scope.LEVEL & Scope.INLINE) {\n match = this.types.inline;\n }\n } else if (query instanceof Element) {\n const names = (query.getAttribute('class') || '').split(/\\s+/);\n names.some((name) => {\n match = this.classes[name];\n if (match) {\n return true;\n }\n return false;\n });\n match = match || this.tags[query.tagName];\n }\n if (match == null) {\n return null;\n }\n if (\n 'scope' in match &&\n scope & Scope.LEVEL & match.scope &&\n scope & Scope.TYPE & match.scope\n ) {\n return match;\n }\n return null;\n }\n\n public register(...definitions: RegistryDefinition[]): RegistryDefinition[] {\n return definitions.map((definition) => {\n const isBlot = 'blotName' in definition;\n const isAttr = 'attrName' in definition;\n if (!isBlot && !isAttr) {\n throw new ParchmentError('Invalid definition');\n } else if (isBlot && definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n const key = isBlot\n ? definition.blotName\n : isAttr\n ? definition.attrName\n : (undefined as never); // already handled by above checks\n this.types[key] = definition;\n\n if (isAttr) {\n if (typeof definition.keyName === 'string') {\n this.attributes[definition.keyName] = definition;\n }\n } else if (isBlot) {\n if (definition.className) {\n this.classes[definition.className] = definition;\n }\n if (definition.tagName) {\n if (Array.isArray(definition.tagName)) {\n definition.tagName = definition.tagName.map((tagName: string) => {\n return tagName.toUpperCase();\n });\n } else {\n definition.tagName = definition.tagName.toUpperCase();\n }\n const tagNames = Array.isArray(definition.tagName)\n ? definition.tagName\n : [definition.tagName];\n tagNames.forEach((tag: string) => {\n if (this.tags[tag] == null || definition.className == null) {\n this.tags[tag] = definition;\n }\n });\n }\n }\n return definition;\n });\n }\n}\n", "import Attributor from './attributor.js';\n\nfunction match(node: HTMLElement, prefix: string): string[] {\n const className = node.getAttribute('class') || '';\n return className\n .split(/\\s+/)\n .filter((name) => name.indexOf(`${prefix}-`) === 0);\n}\n\nclass ClassAttributor extends Attributor {\n public static keys(node: HTMLElement): string[] {\n return (node.getAttribute('class') || '')\n .split(/\\s+/)\n .map((name) => name.split('-').slice(0, -1).join('-'));\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n this.remove(node);\n node.classList.add(`${this.keyName}-${value}`);\n return true;\n }\n\n public remove(node: HTMLElement): void {\n const matches = match(node, this.keyName);\n matches.forEach((name) => {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n }\n\n public value(node: HTMLElement): any {\n const result = match(node, this.keyName)[0] || '';\n const value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default ClassAttributor;\n", "import Attributor from './attributor.js';\n\nfunction camelize(name: string): string {\n const parts = name.split('-');\n const rest = parts\n .slice(1)\n .map((part: string) => part[0].toUpperCase() + part.slice(1))\n .join('');\n return parts[0] + rest;\n}\n\nclass StyleAttributor extends Attributor {\n public static keys(node: HTMLElement): string[] {\n return (node.getAttribute('style') || '').split(';').map((value) => {\n const arr = value.split(':');\n return arr[0].trim();\n });\n }\n\n public add(node: HTMLElement, value: any): boolean {\n if (!this.canAdd(node, value)) {\n return false;\n }\n // @ts-expect-error Fix me later\n node.style[camelize(this.keyName)] = value;\n return true;\n }\n\n public remove(node: HTMLElement): void {\n // @ts-expect-error Fix me later\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n }\n\n public value(node: HTMLElement): any {\n // @ts-expect-error Fix me later\n const value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n }\n}\n\nexport default StyleAttributor;\n", "import type { Formattable } from '../blot/abstract/blot.js';\nimport Registry from '../registry.js';\nimport Scope from '../scope.js';\nimport Attributor from './attributor.js';\nimport ClassAttributor from './class.js';\nimport StyleAttributor from './style.js';\n\nclass AttributorStore {\n private attributes: { [key: string]: Attributor } = {};\n private domNode: HTMLElement;\n\n constructor(domNode: HTMLElement) {\n this.domNode = domNode;\n this.build();\n }\n\n public attribute(attribute: Attributor, value: any): void {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n } else {\n delete this.attributes[attribute.attrName];\n }\n }\n } else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n }\n\n public build(): void {\n this.attributes = {};\n const blot = Registry.find(this.domNode);\n if (blot == null) {\n return;\n }\n const attributes = Attributor.keys(this.domNode);\n const classes = ClassAttributor.keys(this.domNode);\n const styles = StyleAttributor.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach((name) => {\n const attr = blot.scroll.query(name, Scope.ATTRIBUTE);\n if (attr instanceof Attributor) {\n this.attributes[attr.attrName] = attr;\n }\n });\n }\n\n public copy(target: Formattable): void {\n Object.keys(this.attributes).forEach((key) => {\n const value = this.attributes[key].value(this.domNode);\n target.format(key, value);\n });\n }\n\n public move(target: Formattable): void {\n this.copy(target);\n Object.keys(this.attributes).forEach((key) => {\n this.attributes[key].remove(this.domNode);\n });\n this.attributes = {};\n }\n\n public values(): { [key: string]: any } {\n return Object.keys(this.attributes).reduce(\n (attributes: { [key: string]: any }, name: string) => {\n attributes[name] = this.attributes[name].value(this.domNode);\n return attributes;\n },\n {},\n );\n }\n}\n\nexport default AttributorStore;\n", "import ParchmentError from '../../error.js';\nimport Registry from '../../registry.js';\nimport Scope from '../../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Parent,\n Root,\n} from './blot.js';\n\nclass ShadowBlot implements Blot {\n public static blotName = 'abstract';\n public static className: string;\n public static requiredContainer: BlotConstructor;\n public static scope: Scope;\n public static tagName: string | string[];\n\n public static create(rawValue?: unknown): Node {\n if (this.tagName == null) {\n throw new ParchmentError('Blot definition missing tagName');\n }\n let node: HTMLElement;\n let value: string | number | undefined;\n if (Array.isArray(this.tagName)) {\n if (typeof rawValue === 'string') {\n value = rawValue.toUpperCase();\n if (parseInt(value, 10).toString() === value) {\n value = parseInt(value, 10);\n }\n } else if (typeof rawValue === 'number') {\n value = rawValue;\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n } else if (value && this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n } else {\n node = document.createElement(this.tagName[0]);\n }\n } else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n }\n\n public prev: Blot | null;\n public next: Blot | null;\n // @ts-expect-error Fix me later\n public parent: Parent;\n\n // Hack for accessing inherited static methods\n get statics(): any {\n return this.constructor;\n }\n constructor(\n public scroll: Root,\n public domNode: Node,\n ) {\n Registry.blots.set(domNode, this);\n this.prev = null;\n this.next = null;\n }\n\n public attach(): void {\n // Nothing to do\n }\n\n public clone(): Blot {\n const domNode = this.domNode.cloneNode(false);\n return this.scroll.create(domNode);\n }\n\n public detach(): void {\n if (this.parent != null) {\n this.parent.removeChild(this);\n }\n Registry.blots.delete(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n const blot = this.isolate(index, length);\n blot.remove();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n const blot = this.isolate(index, length);\n if (this.scroll.query(name, Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n } else if (this.scroll.query(name, Scope.ATTRIBUTE) != null) {\n const parent = this.scroll.create(this.statics.scope) as Parent &\n Formattable;\n blot.wrap(parent);\n parent.format(name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n const ref = this.split(index);\n this.parent.insertBefore(blot, ref || undefined);\n }\n\n public isolate(index: number, length: number): Blot {\n const target = this.split(index);\n if (target == null) {\n throw new Error('Attempt to isolate at end');\n }\n target.split(length);\n return target;\n }\n\n public length(): number {\n return 1;\n }\n\n public offset(root: Blot = this.parent): number {\n if (this.parent == null || this === root) {\n return 0;\n }\n return this.parent.children.offset(this) + this.parent.offset(root);\n }\n\n public optimize(_context?: { [key: string]: any }): void {\n if (\n this.statics.requiredContainer &&\n !(this.parent instanceof this.statics.requiredContainer)\n ) {\n this.wrap(this.statics.requiredContainer.blotName);\n }\n }\n\n public remove(): void {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(replacement, this.next || undefined);\n this.remove();\n }\n return replacement;\n }\n\n public split(index: number, _force?: boolean): Blot | null {\n return index === 0 ? this : this.next;\n }\n\n public update(\n _mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n // Nothing to do by default\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper =\n typeof name === 'string'\n ? (this.scroll.create(name, value) as Parent)\n : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next || undefined);\n }\n if (typeof wrapper.appendChild !== 'function') {\n throw new ParchmentError(`Cannot wrap ${name}`);\n }\n wrapper.appendChild(this);\n return wrapper;\n }\n}\n\nexport default ShadowBlot;\n", "import Scope from '../../scope.js';\nimport type { Leaf } from './blot.js';\nimport ShadowBlot from './shadow.js';\n\nclass LeafBlot extends ShadowBlot implements Leaf {\n public static scope = Scope.INLINE_BLOT;\n\n /**\n * Returns the value represented by domNode if it is this Blot's type\n * No checking that domNode can represent this Blot type is required so\n * applications needing it should check externally before calling.\n */\n public static value(_domNode: Node): any {\n return true;\n }\n\n /**\n * Given location represented by node and offset from DOM Selection Range,\n * return index to that location.\n */\n public index(node: Node, offset: number): number {\n if (\n this.domNode === node ||\n this.domNode.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return Math.min(offset, 1);\n }\n return -1;\n }\n\n /**\n * Given index to location within blot, return node and offset representing\n * that location, consumable by DOM Selection Range\n */\n public position(index: number, _inclusive?: boolean): [Node, number] {\n const childNodes: Node[] = Array.from(this.parent.domNode.childNodes);\n let offset = childNodes.indexOf(this.domNode);\n if (index > 0) {\n offset += 1;\n }\n return [this.parent.domNode, offset];\n }\n\n /**\n * Return value represented by this blot\n * Should not change without interaction from API or\n * user change detectable by update()\n */\n public value(): any {\n return {\n [this.statics.blotName]: this.statics.value(this.domNode) || true,\n };\n }\n}\n\nexport default LeafBlot;\n", "import type LinkedNode from './linked-node.js';\n\nclass LinkedList {\n public head: T | null;\n public tail: T | null;\n public length: number;\n\n constructor() {\n this.head = null;\n this.tail = null;\n this.length = 0;\n }\n\n public append(...nodes: T[]): void {\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n const rest = nodes.slice(1);\n this.append(...rest);\n }\n }\n\n public at(index: number): T | null {\n const next = this.iterator();\n let cur = next();\n while (cur && index > 0) {\n index -= 1;\n cur = next();\n }\n return cur;\n }\n\n public contains(node: T): boolean {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n if (cur === node) {\n return true;\n }\n cur = next();\n }\n return false;\n }\n\n public indexOf(node: T): number {\n const next = this.iterator();\n let cur = next();\n let index = 0;\n while (cur) {\n if (cur === node) {\n return index;\n }\n index += 1;\n cur = next();\n }\n return -1;\n }\n\n public insertBefore(node: T | null, refNode: T | null): void {\n if (node == null) {\n return;\n }\n this.remove(node);\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n } else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n } else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n }\n\n public offset(target: T): number {\n let index = 0;\n let cur = this.head;\n while (cur != null) {\n if (cur === target) {\n return index;\n }\n index += cur.length();\n cur = cur.next as T;\n }\n return -1;\n }\n\n public remove(node: T): void {\n if (!this.contains(node)) {\n return;\n }\n if (node.prev != null) {\n node.prev.next = node.next;\n }\n if (node.next != null) {\n node.next.prev = node.prev;\n }\n if (node === this.head) {\n this.head = node.next as T;\n }\n if (node === this.tail) {\n this.tail = node.prev as T;\n }\n this.length -= 1;\n }\n\n public iterator(curNode: T | null = this.head): () => T | null {\n // TODO use yield when we can\n return (): T | null => {\n const ret = curNode;\n if (curNode != null) {\n curNode = curNode.next as T;\n }\n return ret;\n };\n }\n\n public find(index: number, inclusive = false): [T | null, number] {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n const length = cur.length();\n if (\n index < length ||\n (inclusive &&\n index === length &&\n (cur.next == null || cur.next.length() !== 0))\n ) {\n return [cur, index];\n }\n index -= length;\n cur = next();\n }\n return [null, 0];\n }\n\n public forEach(callback: (cur: T) => void): void {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n callback(cur);\n cur = next();\n }\n }\n\n public forEachAt(\n index: number,\n length: number,\n callback: (cur: T, offset: number, length: number) => void,\n ): void {\n if (length <= 0) {\n return;\n }\n const [startNode, offset] = this.find(index);\n let curIndex = index - offset;\n const next = this.iterator(startNode);\n let cur = next();\n while (cur && curIndex < index + length) {\n const curLength = cur.length();\n if (index > curIndex) {\n callback(\n cur,\n index - curIndex,\n Math.min(length, curIndex + curLength - index),\n );\n } else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n cur = next();\n }\n }\n\n public map(callback: (cur: T) => any): any[] {\n return this.reduce((memo: T[], cur: T) => {\n memo.push(callback(cur));\n return memo;\n }, []);\n }\n\n public reduce(callback: (memo: M, cur: T) => M, memo: M): M {\n const next = this.iterator();\n let cur = next();\n while (cur) {\n memo = callback(memo, cur);\n cur = next();\n }\n return memo;\n }\n}\n\nexport default LinkedList;\n", "import LinkedList from '../../collection/linked-list.js';\nimport ParchmentError from '../../error.js';\nimport Scope from '../../scope.js';\nimport type { Blot, BlotConstructor, Parent, Root } from './blot.js';\nimport ShadowBlot from './shadow.js';\n\nfunction makeAttachedBlot(node: Node, scroll: Root): Blot {\n const found = scroll.find(node);\n if (found) return found;\n try {\n return scroll.create(node);\n } catch (e) {\n const blot = scroll.create(Scope.INLINE);\n Array.from(node.childNodes).forEach((child: Node) => {\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n return blot;\n }\n}\n\nclass ParentBlot extends ShadowBlot implements Parent {\n /**\n * Whitelist array of Blots that can be direct children.\n */\n public static allowedChildren?: BlotConstructor[];\n\n /**\n * Default child blot to be inserted if this blot becomes empty.\n */\n public static defaultChild?: BlotConstructor;\n public static uiClass = '';\n\n public children!: LinkedList;\n public domNode!: HTMLElement;\n public uiNode: HTMLElement | null = null;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.build();\n }\n\n public appendChild(other: Blot): void {\n this.insertBefore(other);\n }\n\n public attach(): void {\n super.attach();\n this.children.forEach((child) => {\n child.attach();\n });\n }\n\n public attachUI(node: HTMLElement): void {\n if (this.uiNode != null) {\n this.uiNode.remove();\n }\n this.uiNode = node;\n if (ParentBlot.uiClass) {\n this.uiNode.classList.add(ParentBlot.uiClass);\n }\n this.uiNode.setAttribute('contenteditable', 'false');\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n\n /**\n * Called during construction, should fill its own children LinkedList.\n */\n public build(): void {\n this.children = new LinkedList();\n // Need to be reversed for if DOM nodes already in order\n Array.from(this.domNode.childNodes)\n .filter((node: Node) => node !== this.uiNode)\n .reverse()\n .forEach((node: Node) => {\n try {\n const child = makeAttachedBlot(node, this.scroll);\n this.insertBefore(child, this.children.head || undefined);\n } catch (err) {\n if (err instanceof ParchmentError) {\n return;\n } else {\n throw err;\n }\n }\n });\n }\n\n public deleteAt(index: number, length: number): void {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.deleteAt(offset, childLength);\n });\n }\n\n public descendant(\n criteria: new (...args: any[]) => T,\n index: number,\n ): [T | null, number];\n public descendant(\n criteria: (blot: Blot) => boolean,\n index: number,\n ): [Blot | null, number];\n public descendant(criteria: any, index = 0): [Blot | null, number] {\n const [child, offset] = this.children.find(index);\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n return [child as any, offset];\n } else if (child instanceof ParentBlot) {\n return child.descendant(criteria, offset);\n } else {\n return [null, -1];\n }\n }\n\n public descendants(\n criteria: new (...args: any[]) => T,\n index?: number,\n length?: number,\n ): T[];\n public descendants(\n criteria: (blot: Blot) => boolean,\n index?: number,\n length?: number,\n ): Blot[];\n public descendants(\n criteria: any,\n index = 0,\n length: number = Number.MAX_VALUE,\n ): Blot[] {\n let descendants: Blot[] = [];\n let lengthLeft = length;\n this.children.forEachAt(\n index,\n length,\n (child: Blot, childIndex: number, childLength: number) => {\n if (\n (criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)\n ) {\n descendants.push(child);\n }\n if (child instanceof ParentBlot) {\n descendants = descendants.concat(\n child.descendants(criteria, childIndex, lengthLeft),\n );\n }\n lengthLeft -= childLength;\n },\n );\n return descendants;\n }\n\n public detach(): void {\n this.children.forEach((child) => {\n child.detach();\n });\n super.detach();\n }\n\n public enforceAllowedChildren(): void {\n let done = false;\n this.children.forEach((child: Blot) => {\n if (done) {\n return;\n }\n const allowed = this.statics.allowedChildren.some(\n (def: BlotConstructor) => child instanceof def,\n );\n if (allowed) {\n return;\n }\n if (child.statics.scope === Scope.BLOCK_BLOT) {\n if (child.next != null) {\n this.splitAfter(child);\n }\n if (child.prev != null) {\n this.splitAfter(child.prev);\n }\n child.parent.unwrap();\n done = true;\n } else if (child instanceof ParentBlot) {\n child.unwrap();\n } else {\n child.remove();\n }\n });\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.children.forEachAt(index, length, (child, offset, childLength) => {\n child.formatAt(offset, childLength, name, value);\n });\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n const [child, offset] = this.children.find(index);\n if (child) {\n child.insertAt(offset, value, def);\n } else {\n const blot =\n def == null\n ? this.scroll.create('text', value)\n : this.scroll.create(value, def);\n this.appendChild(blot);\n }\n }\n\n public insertBefore(childBlot: Blot, refBlot?: Blot | null): void {\n if (childBlot.parent != null) {\n childBlot.parent.children.remove(childBlot);\n }\n let refDomNode: Node | null = null;\n this.children.insertBefore(childBlot, refBlot || null);\n childBlot.parent = this;\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (\n this.domNode.parentNode !== childBlot.domNode ||\n this.domNode.nextSibling !== refDomNode\n ) {\n this.domNode.insertBefore(childBlot.domNode, refDomNode);\n }\n childBlot.attach();\n }\n\n public length(): number {\n return this.children.reduce((memo, child) => {\n return memo + child.length();\n }, 0);\n }\n\n public moveChildren(targetParent: Parent, refNode?: Blot | null): void {\n this.children.forEach((child) => {\n targetParent.insertBefore(child, refNode);\n });\n }\n\n public optimize(context?: { [key: string]: any }): void {\n super.optimize(context);\n this.enforceAllowedChildren();\n if (this.uiNode != null && this.uiNode !== this.domNode.firstChild) {\n this.domNode.insertBefore(this.uiNode, this.domNode.firstChild);\n }\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n const child = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(child);\n // TODO double check if necessary\n // child.optimize(context);\n } else {\n this.remove();\n }\n }\n }\n\n public path(index: number, inclusive = false): [Blot, number][] {\n const [child, offset] = this.children.find(index, inclusive);\n const position: [Blot, number][] = [[this, index]];\n if (child instanceof ParentBlot) {\n return position.concat(child.path(offset, inclusive));\n } else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n }\n\n public removeChild(child: Blot): void {\n this.children.remove(child);\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement =\n typeof name === 'string' ? this.scroll.create(name, value) : name;\n if (replacement instanceof ParentBlot) {\n this.moveChildren(replacement);\n }\n return super.replaceWith(replacement);\n }\n\n public split(index: number, force = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.clone() as ParentBlot;\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n this.children.forEachAt(index, this.length(), (child, offset, _length) => {\n const split = child.split(offset, force);\n if (split != null) {\n after.appendChild(split);\n }\n });\n return after;\n }\n\n public splitAfter(child: Blot): Parent {\n const after = this.clone() as ParentBlot;\n while (child.next != null) {\n after.appendChild(child.next);\n }\n if (this.parent) {\n this.parent.insertBefore(after, this.next || undefined);\n }\n return after;\n }\n\n public unwrap(): void {\n if (this.parent) {\n this.moveChildren(this.parent, this.next || undefined);\n }\n this.remove();\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n const addedNodes: Node[] = [];\n const removedNodes: Node[] = [];\n mutations.forEach((mutation) => {\n if (mutation.target === this.domNode && mutation.type === 'childList') {\n addedNodes.push(...mutation.addedNodes);\n removedNodes.push(...mutation.removedNodes);\n }\n });\n removedNodes.forEach((node: Node) => {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (\n node.parentNode != null &&\n // @ts-expect-error Fix me later\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) &\n Node.DOCUMENT_POSITION_CONTAINED_BY\n ) {\n return;\n }\n const blot = this.scroll.find(node);\n if (blot == null) {\n return;\n }\n if (\n blot.domNode.parentNode == null ||\n blot.domNode.parentNode === this.domNode\n ) {\n blot.detach();\n }\n });\n addedNodes\n .filter((node) => {\n return node.parentNode === this.domNode && node !== this.uiNode;\n })\n .sort((a, b) => {\n if (a === b) {\n return 0;\n }\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach((node) => {\n let refBlot: Blot | null = null;\n if (node.nextSibling != null) {\n refBlot = this.scroll.find(node.nextSibling);\n }\n const blot = makeAttachedBlot(node, this.scroll);\n if (blot.next !== refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(this);\n }\n this.insertBefore(blot, refBlot || undefined);\n }\n });\n this.enforceAllowedChildren();\n }\n}\n\nexport default ParentBlot;\n", "import Attributor from '../attributor/attributor.js';\nimport AttributorStore from '../attributor/store.js';\nimport Scope from '../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Parent,\n Root,\n} from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\nimport ParentBlot from './abstract/parent.js';\n\n// Shallow object comparison\nfunction isEqual(\n obj1: Record,\n obj2: Record,\n): boolean {\n if (Object.keys(obj1).length !== Object.keys(obj2).length) {\n return false;\n }\n for (const prop in obj1) {\n if (obj1[prop] !== obj2[prop]) {\n return false;\n }\n }\n return true;\n}\n\nclass InlineBlot extends ParentBlot implements Formattable {\n public static allowedChildren: BlotConstructor[] = [InlineBlot, LeafBlot];\n public static blotName = 'inline';\n public static scope = Scope.INLINE_BLOT;\n public static tagName: string | string[] = 'SPAN';\n\n static create(value?: unknown) {\n return super.create(value) as HTMLElement;\n }\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(InlineBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any): void {\n if (name === this.statics.blotName && !value) {\n this.children.forEach((child) => {\n if (!(child instanceof InlineBlot)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n this.attributes.copy(child as InlineBlot);\n });\n this.unwrap();\n } else {\n const format = this.scroll.query(name, Scope.INLINE);\n if (format == null) {\n return;\n }\n if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (\n this.formats()[name] != null ||\n this.scroll.query(name, Scope.ATTRIBUTE)\n ) {\n const blot = this.isolate(index, length) as InlineBlot;\n blot.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n const formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n const next = this.next;\n if (\n next instanceof InlineBlot &&\n next.prev === this &&\n isEqual(formats, next.formats())\n ) {\n next.moveChildren(this);\n next.remove();\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as InlineBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n (mutation) =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n\n public wrap(name: string | Parent, value?: any): Parent {\n const wrapper = super.wrap(name, value);\n if (wrapper instanceof InlineBlot) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n }\n}\n\nexport default InlineBlot;\n", "import Attributor from '../attributor/attributor.js';\nimport AttributorStore from '../attributor/store.js';\nimport Scope from '../scope.js';\nimport type {\n Blot,\n BlotConstructor,\n Formattable,\n Root,\n} from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\nimport ParentBlot from './abstract/parent.js';\nimport InlineBlot from './inline.js';\n\nclass BlockBlot extends ParentBlot implements Formattable {\n public static blotName = 'block';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName: string | string[] = 'P';\n public static allowedChildren: BlotConstructor[] = [\n InlineBlot,\n BlockBlot,\n LeafBlot,\n ];\n\n static create(value?: unknown) {\n return super.create(value) as HTMLElement;\n }\n\n public static formats(domNode: HTMLElement, scroll: Root): any {\n const match = scroll.query(BlockBlot.blotName);\n if (\n match != null &&\n domNode.tagName === (match as BlotConstructor).tagName\n ) {\n return undefined;\n } else if (typeof this.tagName === 'string') {\n return true;\n } else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n }\n\n protected attributes: AttributorStore;\n\n constructor(scroll: Root, domNode: Node) {\n super(scroll, domNode);\n this.attributes = new AttributorStore(this.domNode);\n }\n\n public format(name: string, value: any): void {\n const format = this.scroll.query(name, Scope.BLOCK);\n if (format == null) {\n return;\n } else if (format instanceof Attributor) {\n this.attributes.attribute(format, value);\n } else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n } else if (\n value &&\n (name !== this.statics.blotName || this.formats()[name] !== value)\n ) {\n this.replaceWith(name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n const formats = this.attributes.values();\n const format = this.statics.formats(this.domNode, this.scroll);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (this.scroll.query(name, Scope.BLOCK) != null) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null || this.scroll.query(value, Scope.INLINE) != null) {\n // Insert text or inline\n super.insertAt(index, value, def);\n } else {\n const after = this.split(index);\n if (after != null) {\n const blot = this.scroll.create(value, def);\n after.parent.insertBefore(blot, after);\n } else {\n throw new Error('Attempt to insertAt after block boundaries');\n }\n }\n }\n\n public replaceWith(name: string | Blot, value?: any): Blot {\n const replacement = super.replaceWith(name, value) as BlockBlot;\n this.attributes.copy(replacement);\n return replacement;\n }\n\n public update(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void {\n super.update(mutations, context);\n const attributeChanged = mutations.some(\n (mutation) =>\n mutation.target === this.domNode && mutation.type === 'attributes',\n );\n if (attributeChanged) {\n this.attributes.build();\n }\n }\n}\n\nexport default BlockBlot;\n", "import Scope from '../../scope.js';\nimport BlockBlot from '../block.js';\nimport ParentBlot from './parent.js';\n\nclass ContainerBlot extends ParentBlot {\n public static blotName = 'container';\n public static scope = Scope.BLOCK_BLOT;\n public static tagName: string | string[];\n\n public prev!: BlockBlot | ContainerBlot | null;\n public next!: BlockBlot | ContainerBlot | null;\n\n public checkMerge(): boolean {\n return (\n this.next !== null && this.next.statics.blotName === this.statics.blotName\n );\n }\n\n public deleteAt(index: number, length: number): void {\n super.deleteAt(index, length);\n this.enforceAllowedChildren();\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n super.formatAt(index, length, name, value);\n this.enforceAllowedChildren();\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n super.insertAt(index, value, def);\n this.enforceAllowedChildren();\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n if (this.children.length > 0 && this.next != null && this.checkMerge()) {\n this.next.moveChildren(this);\n this.next.remove();\n }\n }\n}\n\nexport default ContainerBlot;\n", "import type { Formattable, Root } from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\n\nclass EmbedBlot extends LeafBlot implements Formattable {\n public static formats(_domNode: HTMLElement, _scroll: Root): any {\n return undefined;\n }\n\n public format(name: string, value: any): void {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n super.formatAt(0, this.length(), name, value);\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n public formats(): { [index: string]: any } {\n return this.statics.formats(this.domNode, this.scroll);\n }\n}\n\nexport default EmbedBlot;\n", "import Registry, { type RegistryDefinition } from '../registry.js';\nimport Scope from '../scope.js';\nimport type { Blot, BlotConstructor, Root } from './abstract/blot.js';\nimport ContainerBlot from './abstract/container.js';\nimport ParentBlot from './abstract/parent.js';\nimport BlockBlot from './block.js';\n\nconst OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\n\nconst MAX_OPTIMIZE_ITERATIONS = 100;\n\nclass ScrollBlot extends ParentBlot implements Root {\n public static blotName = 'scroll';\n public static defaultChild = BlockBlot;\n public static allowedChildren: BlotConstructor[] = [BlockBlot, ContainerBlot];\n public static scope = Scope.BLOCK_BLOT;\n public static tagName = 'DIV';\n\n public observer: MutationObserver;\n\n constructor(\n public registry: Registry,\n node: HTMLDivElement,\n ) {\n // @ts-expect-error scroll is the root with no parent\n super(null, node);\n this.scroll = this;\n this.build();\n this.observer = new MutationObserver((mutations: MutationRecord[]) => {\n this.update(mutations);\n });\n this.observer.observe(this.domNode, OBSERVER_CONFIG);\n this.attach();\n }\n\n public create(input: Node | string | Scope, value?: any): Blot {\n return this.registry.create(this, input, value);\n }\n\n public find(node: Node | null, bubble = false): Blot | null {\n const blot = this.registry.find(node, bubble);\n if (!blot) {\n return null;\n }\n if (blot.scroll === this) {\n return blot;\n }\n return bubble ? this.find(blot.scroll.domNode.parentNode, true) : null;\n }\n\n public query(\n query: string | Node | Scope,\n scope: Scope = Scope.ANY,\n ): RegistryDefinition | null {\n return this.registry.query(query, scope);\n }\n\n public register(...definitions: RegistryDefinition[]) {\n return this.registry.register(...definitions);\n }\n\n public build(): void {\n if (this.scroll == null) {\n return;\n }\n super.build();\n }\n\n public detach(): void {\n super.detach();\n this.observer.disconnect();\n }\n\n public deleteAt(index: number, length: number): void {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach((child) => {\n child.remove();\n });\n } else {\n super.deleteAt(index, length);\n }\n }\n\n public formatAt(\n index: number,\n length: number,\n name: string,\n value: any,\n ): void {\n this.update();\n super.formatAt(index, length, name, value);\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n this.update();\n super.insertAt(index, value, def);\n }\n\n public optimize(context?: { [key: string]: any }): void;\n public optimize(\n mutations: MutationRecord[],\n context: { [key: string]: any },\n ): void;\n public optimize(mutations: any = [], context: any = {}): void {\n super.optimize(context);\n const mutationsMap = context.mutationsMap || new WeakMap();\n // We must modify mutations directly, cannot make copy and then modify\n let records = Array.from(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n const mark = (blot: Blot | null, markParent = true): void => {\n if (blot == null || blot === this) {\n return;\n }\n if (blot.domNode.parentNode == null) {\n return;\n }\n if (!mutationsMap.has(blot.domNode)) {\n mutationsMap.set(blot.domNode, []);\n }\n if (markParent) {\n mark(blot.parent);\n }\n };\n const optimize = (blot: Blot): void => {\n // Post-order traversal\n if (!mutationsMap.has(blot.domNode)) {\n return;\n }\n if (blot instanceof ParentBlot) {\n blot.children.forEach(optimize);\n }\n mutationsMap.delete(blot.domNode);\n blot.optimize(context);\n };\n let remaining = mutations;\n for (let i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach((mutation: MutationRecord) => {\n const blot = this.find(mutation.target, true);\n if (blot == null) {\n return;\n }\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(this.find(mutation.previousSibling, false));\n Array.from(mutation.addedNodes).forEach((node: Node) => {\n const child = this.find(node, false);\n mark(child, false);\n if (child instanceof ParentBlot) {\n child.children.forEach((grandChild: Blot) => {\n mark(grandChild, false);\n });\n }\n });\n } else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = Array.from(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0) {\n mutations.push(records.pop());\n }\n }\n }\n\n public update(\n mutations?: MutationRecord[],\n context: { [key: string]: any } = {},\n ): void {\n mutations = mutations || this.observer.takeRecords();\n const mutationsMap = new WeakMap();\n mutations\n .map((mutation: MutationRecord) => {\n const blot = this.find(mutation.target, true);\n if (blot == null) {\n return null;\n }\n if (mutationsMap.has(blot.domNode)) {\n mutationsMap.get(blot.domNode).push(mutation);\n return null;\n } else {\n mutationsMap.set(blot.domNode, [mutation]);\n return blot;\n }\n })\n .forEach((blot: Blot | null) => {\n if (blot != null && blot !== this && mutationsMap.has(blot.domNode)) {\n blot.update(mutationsMap.get(blot.domNode) || [], context);\n }\n });\n context.mutationsMap = mutationsMap;\n if (mutationsMap.has(this.domNode)) {\n super.update(mutationsMap.get(this.domNode), context);\n }\n this.optimize(mutations, context);\n }\n}\n\nexport default ScrollBlot;\n", "import Scope from '../scope.js';\nimport type { Blot, Leaf, Root } from './abstract/blot.js';\nimport LeafBlot from './abstract/leaf.js';\n\nclass TextBlot extends LeafBlot implements Leaf {\n public static readonly blotName = 'text';\n public static scope = Scope.INLINE_BLOT;\n\n public static create(value: string): Text {\n return document.createTextNode(value);\n }\n\n public static value(domNode: Text): string {\n return domNode.data;\n }\n\n public domNode!: Text;\n protected text: string;\n\n constructor(scroll: Root, node: Node) {\n super(scroll, node);\n this.text = this.statics.value(this.domNode);\n }\n\n public deleteAt(index: number, length: number): void {\n this.domNode.data = this.text =\n this.text.slice(0, index) + this.text.slice(index + length);\n }\n\n public index(node: Node, offset: number): number {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n }\n\n public insertAt(index: number, value: string, def?: any): void {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n } else {\n super.insertAt(index, value, def);\n }\n }\n\n public length(): number {\n return this.text.length;\n }\n\n public optimize(context: { [key: string]: any }): void {\n super.optimize(context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n } else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), (this.next as TextBlot).value());\n this.next.remove();\n }\n }\n\n public position(index: number, _inclusive = false): [Node, number] {\n return [this.domNode, index];\n }\n\n public split(index: number, force = false): Blot | null {\n if (!force) {\n if (index === 0) {\n return this;\n }\n if (index === this.length()) {\n return this.next;\n }\n }\n const after = this.scroll.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next || undefined);\n this.text = this.statics.value(this.domNode);\n return after;\n }\n\n public update(\n mutations: MutationRecord[],\n _context: { [key: string]: any },\n ): void {\n if (\n mutations.some((mutation) => {\n return (\n mutation.type === 'characterData' && mutation.target === this.domNode\n );\n })\n ) {\n this.text = this.statics.value(this.domNode);\n }\n }\n\n public value(): string {\n return this.text;\n }\n}\n\nexport default TextBlot;\n", "/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int|Object} [cursor_pos] Edit position in text1 or object with more info\n * @param {boolean} [cleanup] Apply semantic cleanup before returning.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos, cleanup, _fix_unicode) {\n // Check for equality\n if (text1 === text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n if (cursor_pos != null) {\n var editdiff = find_cursor_edit_diff(text1, text2, cursor_pos);\n if (editdiff) {\n return editdiff;\n }\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs, _fix_unicode);\n if (cleanup) {\n diff_cleanupSemantic(diffs);\n }\n return diffs;\n}\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i !== -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [\n [DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)],\n ];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length === 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [\n [DIFF_DELETE, text1],\n [DIFF_INSERT, text2],\n ];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n}\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = delta % 2 !== 0;\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 === -d || (k1 !== d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (\n x1 < text1_length &&\n y1 < text2_length &&\n text1.charAt(x1) === text2.charAt(y1)\n ) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] !== -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 === -d || (k2 !== d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (\n x2 < text1_length &&\n y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ===\n text2.charAt(text2_length - y2 - 1)\n ) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] !== -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [\n [DIFF_DELETE, text1],\n [DIFF_INSERT, text2],\n ];\n}\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n}\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)\n ) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_start(text1.charCodeAt(pointermid - 1))) {\n pointermid--;\n }\n\n return pointermid;\n}\n\n/**\n * Determine if the suffix of one string is the prefix of another.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of the first\n * string and the start of the second string.\n * @private\n */\nfunction diff_commonOverlap_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n // Eliminate the null case.\n if (text1_length == 0 || text2_length == 0) {\n return 0;\n }\n // Truncate the longer string.\n if (text1_length > text2_length) {\n text1 = text1.substring(text1_length - text2_length);\n } else if (text1_length < text2_length) {\n text2 = text2.substring(0, text1_length);\n }\n var text_length = Math.min(text1_length, text2_length);\n // Quick check for the worst case.\n if (text1 == text2) {\n return text_length;\n }\n\n // Start by looking for a single character match\n // and increase length until no match is found.\n // Performance analysis: http://neil.fraser.name/news/2010/11/04/\n var best = 0;\n var length = 1;\n while (true) {\n var pattern = text1.substring(text_length - length);\n var found = text2.indexOf(pattern);\n if (found == -1) {\n return best;\n }\n length += found;\n if (\n found == 0 ||\n text1.substring(text_length - length) == text2.substring(0, length)\n ) {\n best = length;\n length++;\n }\n }\n}\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.slice(-1) !== text2.slice(-1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (\n text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)\n ) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n\n if (is_surrogate_pair_end(text1.charCodeAt(text1.length - pointermid))) {\n pointermid--;\n }\n\n return pointermid;\n}\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = \"\";\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) !== -1) {\n var prefixLength = diff_commonPrefix(\n longtext.substring(i),\n shorttext.substring(j)\n );\n var suffixLength = diff_commonSuffix(\n longtext.substring(0, i),\n shorttext.substring(0, j)\n );\n if (best_common.length < suffixLength + prefixLength) {\n best_common =\n shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [\n best_longtext_a,\n best_longtext_b,\n best_shorttext_a,\n best_shorttext_b,\n best_common,\n ];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(\n longtext,\n shorttext,\n Math.ceil(longtext.length / 4)\n );\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(\n longtext,\n shorttext,\n Math.ceil(longtext.length / 2)\n );\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n}\n\n/**\n * Reduce the number of edits by eliminating semantically trivial equalities.\n * @param {!Array.} diffs Array of diff tuples.\n */\nfunction diff_cleanupSemantic(diffs) {\n var changes = false;\n var equalities = []; // Stack of indices where equalities are found.\n var equalitiesLength = 0; // Keeping our own length var is faster in JS.\n /** @type {?string} */\n var lastequality = null;\n // Always equal to diffs[equalities[equalitiesLength - 1]][1]\n var pointer = 0; // Index of current position.\n // Number of characters that changed prior to the equality.\n var length_insertions1 = 0;\n var length_deletions1 = 0;\n // Number of characters that changed after the equality.\n var length_insertions2 = 0;\n var length_deletions2 = 0;\n while (pointer < diffs.length) {\n if (diffs[pointer][0] == DIFF_EQUAL) {\n // Equality found.\n equalities[equalitiesLength++] = pointer;\n length_insertions1 = length_insertions2;\n length_deletions1 = length_deletions2;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastequality = diffs[pointer][1];\n } else {\n // An insertion or deletion.\n if (diffs[pointer][0] == DIFF_INSERT) {\n length_insertions2 += diffs[pointer][1].length;\n } else {\n length_deletions2 += diffs[pointer][1].length;\n }\n // Eliminate an equality that is smaller or equal to the edits on both\n // sides of it.\n if (\n lastequality &&\n lastequality.length <=\n Math.max(length_insertions1, length_deletions1) &&\n lastequality.length <= Math.max(length_insertions2, length_deletions2)\n ) {\n // Duplicate record.\n diffs.splice(equalities[equalitiesLength - 1], 0, [\n DIFF_DELETE,\n lastequality,\n ]);\n // Change second copy to insert.\n diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;\n // Throw away the equality we just deleted.\n equalitiesLength--;\n // Throw away the previous equality (it needs to be reevaluated).\n equalitiesLength--;\n pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;\n length_insertions1 = 0; // Reset the counters.\n length_deletions1 = 0;\n length_insertions2 = 0;\n length_deletions2 = 0;\n lastequality = null;\n changes = true;\n }\n }\n pointer++;\n }\n\n // Normalize the diff.\n if (changes) {\n diff_cleanupMerge(diffs);\n }\n diff_cleanupSemanticLossless(diffs);\n\n // Find any overlaps between deletions and insertions.\n // e.g: abcxxxxxxdef\n // -> abcxxxdef\n // e.g: xxxabcdefxxx\n // -> defxxxabc\n // Only extract an overlap if it is as big as the edit ahead or behind it.\n pointer = 1;\n while (pointer < diffs.length) {\n if (\n diffs[pointer - 1][0] == DIFF_DELETE &&\n diffs[pointer][0] == DIFF_INSERT\n ) {\n var deletion = diffs[pointer - 1][1];\n var insertion = diffs[pointer][1];\n var overlap_length1 = diff_commonOverlap_(deletion, insertion);\n var overlap_length2 = diff_commonOverlap_(insertion, deletion);\n if (overlap_length1 >= overlap_length2) {\n if (\n overlap_length1 >= deletion.length / 2 ||\n overlap_length1 >= insertion.length / 2\n ) {\n // Overlap found. Insert an equality and trim the surrounding edits.\n diffs.splice(pointer, 0, [\n DIFF_EQUAL,\n insertion.substring(0, overlap_length1),\n ]);\n diffs[pointer - 1][1] = deletion.substring(\n 0,\n deletion.length - overlap_length1\n );\n diffs[pointer + 1][1] = insertion.substring(overlap_length1);\n pointer++;\n }\n } else {\n if (\n overlap_length2 >= deletion.length / 2 ||\n overlap_length2 >= insertion.length / 2\n ) {\n // Reverse overlap found.\n // Insert an equality and swap and trim the surrounding edits.\n diffs.splice(pointer, 0, [\n DIFF_EQUAL,\n deletion.substring(0, overlap_length2),\n ]);\n diffs[pointer - 1][0] = DIFF_INSERT;\n diffs[pointer - 1][1] = insertion.substring(\n 0,\n insertion.length - overlap_length2\n );\n diffs[pointer + 1][0] = DIFF_DELETE;\n diffs[pointer + 1][1] = deletion.substring(overlap_length2);\n pointer++;\n }\n }\n pointer++;\n }\n pointer++;\n }\n}\n\nvar nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/;\nvar whitespaceRegex_ = /\\s/;\nvar linebreakRegex_ = /[\\r\\n]/;\nvar blanklineEndRegex_ = /\\n\\r?\\n$/;\nvar blanklineStartRegex_ = /^\\r?\\n\\r?\\n/;\n\n/**\n * Look for single edits surrounded on both sides by equalities\n * which can be shifted sideways to align the edit to a word boundary.\n * e.g: The cat came. -> The cat came.\n * @param {!Array.} diffs Array of diff tuples.\n */\nfunction diff_cleanupSemanticLossless(diffs) {\n /**\n * Given two strings, compute a score representing whether the internal\n * boundary falls on logical boundaries.\n * Scores range from 6 (best) to 0 (worst).\n * Closure, but does not reference any external variables.\n * @param {string} one First string.\n * @param {string} two Second string.\n * @return {number} The score.\n * @private\n */\n function diff_cleanupSemanticScore_(one, two) {\n if (!one || !two) {\n // Edges are the best.\n return 6;\n }\n\n // Each port of this function behaves slightly differently due to\n // subtle differences in each language's definition of things like\n // 'whitespace'. Since this function's purpose is largely cosmetic,\n // the choice has been made to use each language's native features\n // rather than force total conformity.\n var char1 = one.charAt(one.length - 1);\n var char2 = two.charAt(0);\n var nonAlphaNumeric1 = char1.match(nonAlphaNumericRegex_);\n var nonAlphaNumeric2 = char2.match(nonAlphaNumericRegex_);\n var whitespace1 = nonAlphaNumeric1 && char1.match(whitespaceRegex_);\n var whitespace2 = nonAlphaNumeric2 && char2.match(whitespaceRegex_);\n var lineBreak1 = whitespace1 && char1.match(linebreakRegex_);\n var lineBreak2 = whitespace2 && char2.match(linebreakRegex_);\n var blankLine1 = lineBreak1 && one.match(blanklineEndRegex_);\n var blankLine2 = lineBreak2 && two.match(blanklineStartRegex_);\n\n if (blankLine1 || blankLine2) {\n // Five points for blank lines.\n return 5;\n } else if (lineBreak1 || lineBreak2) {\n // Four points for line breaks.\n return 4;\n } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {\n // Three points for end of sentences.\n return 3;\n } else if (whitespace1 || whitespace2) {\n // Two points for whitespace.\n return 2;\n } else if (nonAlphaNumeric1 || nonAlphaNumeric2) {\n // One point for non-alphanumeric.\n return 1;\n }\n return 0;\n }\n\n var pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (\n diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL\n ) {\n // This is a single edit surrounded by equalities.\n var equality1 = diffs[pointer - 1][1];\n var edit = diffs[pointer][1];\n var equality2 = diffs[pointer + 1][1];\n\n // First, shift the edit as far left as possible.\n var commonOffset = diff_commonSuffix(equality1, edit);\n if (commonOffset) {\n var commonString = edit.substring(edit.length - commonOffset);\n equality1 = equality1.substring(0, equality1.length - commonOffset);\n edit = commonString + edit.substring(0, edit.length - commonOffset);\n equality2 = commonString + equality2;\n }\n\n // Second, step character by character right, looking for the best fit.\n var bestEquality1 = equality1;\n var bestEdit = edit;\n var bestEquality2 = equality2;\n var bestScore =\n diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n while (edit.charAt(0) === equality2.charAt(0)) {\n equality1 += edit.charAt(0);\n edit = edit.substring(1) + equality2.charAt(0);\n equality2 = equality2.substring(1);\n var score =\n diff_cleanupSemanticScore_(equality1, edit) +\n diff_cleanupSemanticScore_(edit, equality2);\n // The >= encourages trailing rather than leading whitespace on edits.\n if (score >= bestScore) {\n bestScore = score;\n bestEquality1 = equality1;\n bestEdit = edit;\n bestEquality2 = equality2;\n }\n }\n\n if (diffs[pointer - 1][1] != bestEquality1) {\n // We have an improvement, save it back to the diff.\n if (bestEquality1) {\n diffs[pointer - 1][1] = bestEquality1;\n } else {\n diffs.splice(pointer - 1, 1);\n pointer--;\n }\n diffs[pointer][1] = bestEdit;\n if (bestEquality2) {\n diffs[pointer + 1][1] = bestEquality2;\n } else {\n diffs.splice(pointer + 1, 1);\n pointer--;\n }\n }\n }\n pointer++;\n }\n}\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n * @param {boolean} fix_unicode Whether to normalize to a unicode-correct diff\n */\nfunction diff_cleanupMerge(diffs, fix_unicode) {\n diffs.push([DIFF_EQUAL, \"\"]); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = \"\";\n var text_insert = \"\";\n var commonlength;\n while (pointer < diffs.length) {\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n diffs.splice(pointer, 1);\n continue;\n }\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n var previous_equality = pointer - count_insert - count_delete - 1;\n if (fix_unicode) {\n // prevent splitting of unicode surrogate pairs. when fix_unicode is true,\n // we assume that the old and new text in the diff are complete and correct\n // unicode-encoded JS strings, but the tuple boundaries may fall between\n // surrogate pairs. we fix this by shaving off stray surrogates from the end\n // of the previous equality and the beginning of this equality. this may create\n // empty equalities or a common prefix or suffix. for example, if AB and AC are\n // emojis, `[[0, 'A'], [-1, 'BA'], [0, 'C']]` would turn into deleting 'ABAC' and\n // inserting 'AC', and then the common suffix 'AC' will be eliminated. in this\n // particular case, both equalities go away, we absorb any previous inequalities,\n // and we keep scanning for the next equality before rewriting the tuples.\n if (\n previous_equality >= 0 &&\n ends_with_pair_start(diffs[previous_equality][1])\n ) {\n var stray = diffs[previous_equality][1].slice(-1);\n diffs[previous_equality][1] = diffs[previous_equality][1].slice(\n 0,\n -1\n );\n text_delete = stray + text_delete;\n text_insert = stray + text_insert;\n if (!diffs[previous_equality][1]) {\n // emptied out previous equality, so delete it and include previous delete/insert\n diffs.splice(previous_equality, 1);\n pointer--;\n var k = previous_equality - 1;\n if (diffs[k] && diffs[k][0] === DIFF_INSERT) {\n count_insert++;\n text_insert = diffs[k][1] + text_insert;\n k--;\n }\n if (diffs[k] && diffs[k][0] === DIFF_DELETE) {\n count_delete++;\n text_delete = diffs[k][1] + text_delete;\n k--;\n }\n previous_equality = k;\n }\n }\n if (starts_with_pair_end(diffs[pointer][1])) {\n var stray = diffs[pointer][1].charAt(0);\n diffs[pointer][1] = diffs[pointer][1].slice(1);\n text_delete += stray;\n text_insert += stray;\n }\n }\n if (pointer < diffs.length - 1 && !diffs[pointer][1]) {\n // for empty equality not at end, wait for next equality\n diffs.splice(pointer, 1);\n break;\n }\n if (text_delete.length > 0 || text_insert.length > 0) {\n // note that diff_commonPrefix and diff_commonSuffix are unicode-aware\n if (text_delete.length > 0 && text_insert.length > 0) {\n // Factor out any common prefixes.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if (previous_equality >= 0) {\n diffs[previous_equality][1] += text_insert.substring(\n 0,\n commonlength\n );\n } else {\n diffs.splice(0, 0, [\n DIFF_EQUAL,\n text_insert.substring(0, commonlength),\n ]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixes.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] =\n text_insert.substring(text_insert.length - commonlength) +\n diffs[pointer][1];\n text_insert = text_insert.substring(\n 0,\n text_insert.length - commonlength\n );\n text_delete = text_delete.substring(\n 0,\n text_delete.length - commonlength\n );\n }\n }\n // Delete the offending records and add the merged ones.\n var n = count_insert + count_delete;\n if (text_delete.length === 0 && text_insert.length === 0) {\n diffs.splice(pointer - n, n);\n pointer = pointer - n;\n } else if (text_delete.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_INSERT, text_insert]);\n pointer = pointer - n + 1;\n } else if (text_insert.length === 0) {\n diffs.splice(pointer - n, n, [DIFF_DELETE, text_delete]);\n pointer = pointer - n + 1;\n } else {\n diffs.splice(\n pointer - n,\n n,\n [DIFF_DELETE, text_delete],\n [DIFF_INSERT, text_insert]\n );\n pointer = pointer - n + 2;\n }\n }\n if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = \"\";\n text_insert = \"\";\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === \"\") {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (\n diffs[pointer - 1][0] === DIFF_EQUAL &&\n diffs[pointer + 1][0] === DIFF_EQUAL\n ) {\n // This is a single edit surrounded by equalities.\n if (\n diffs[pointer][1].substring(\n diffs[pointer][1].length - diffs[pointer - 1][1].length\n ) === diffs[pointer - 1][1]\n ) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] =\n diffs[pointer - 1][1] +\n diffs[pointer][1].substring(\n 0,\n diffs[pointer][1].length - diffs[pointer - 1][1].length\n );\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (\n diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]\n ) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs, fix_unicode);\n }\n}\n\nfunction is_surrogate_pair_start(charCode) {\n return charCode >= 0xd800 && charCode <= 0xdbff;\n}\n\nfunction is_surrogate_pair_end(charCode) {\n return charCode >= 0xdc00 && charCode <= 0xdfff;\n}\n\nfunction starts_with_pair_end(str) {\n return is_surrogate_pair_end(str.charCodeAt(0));\n}\n\nfunction ends_with_pair_start(str) {\n return is_surrogate_pair_start(str.charCodeAt(str.length - 1));\n}\n\nfunction remove_empty_tuples(tuples) {\n var ret = [];\n for (var i = 0; i < tuples.length; i++) {\n if (tuples[i][1].length > 0) {\n ret.push(tuples[i]);\n }\n }\n return ret;\n}\n\nfunction make_edit_splice(before, oldMiddle, newMiddle, after) {\n if (ends_with_pair_start(before) || starts_with_pair_end(after)) {\n return null;\n }\n return remove_empty_tuples([\n [DIFF_EQUAL, before],\n [DIFF_DELETE, oldMiddle],\n [DIFF_INSERT, newMiddle],\n [DIFF_EQUAL, after],\n ]);\n}\n\nfunction find_cursor_edit_diff(oldText, newText, cursor_pos) {\n // note: this runs after equality check has ruled out exact equality\n var oldRange =\n typeof cursor_pos === \"number\"\n ? { index: cursor_pos, length: 0 }\n : cursor_pos.oldRange;\n var newRange = typeof cursor_pos === \"number\" ? null : cursor_pos.newRange;\n // take into account the old and new selection to generate the best diff\n // possible for a text edit. for example, a text change from \"xxx\" to \"xx\"\n // could be a delete or forwards-delete of any one of the x's, or the\n // result of selecting two of the x's and typing \"x\".\n var oldLength = oldText.length;\n var newLength = newText.length;\n if (oldRange.length === 0 && (newRange === null || newRange.length === 0)) {\n // see if we have an insert or delete before or after cursor\n var oldCursor = oldRange.index;\n var oldBefore = oldText.slice(0, oldCursor);\n var oldAfter = oldText.slice(oldCursor);\n var maybeNewCursor = newRange ? newRange.index : null;\n editBefore: {\n // is this an insert or delete right before oldCursor?\n var newCursor = oldCursor + newLength - oldLength;\n if (maybeNewCursor !== null && maybeNewCursor !== newCursor) {\n break editBefore;\n }\n if (newCursor < 0 || newCursor > newLength) {\n break editBefore;\n }\n var newBefore = newText.slice(0, newCursor);\n var newAfter = newText.slice(newCursor);\n if (newAfter !== oldAfter) {\n break editBefore;\n }\n var prefixLength = Math.min(oldCursor, newCursor);\n var oldPrefix = oldBefore.slice(0, prefixLength);\n var newPrefix = newBefore.slice(0, prefixLength);\n if (oldPrefix !== newPrefix) {\n break editBefore;\n }\n var oldMiddle = oldBefore.slice(prefixLength);\n var newMiddle = newBefore.slice(prefixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldAfter);\n }\n editAfter: {\n // is this an insert or delete right after oldCursor?\n if (maybeNewCursor !== null && maybeNewCursor !== oldCursor) {\n break editAfter;\n }\n var cursor = oldCursor;\n var newBefore = newText.slice(0, cursor);\n var newAfter = newText.slice(cursor);\n if (newBefore !== oldBefore) {\n break editAfter;\n }\n var suffixLength = Math.min(oldLength - cursor, newLength - cursor);\n var oldSuffix = oldAfter.slice(oldAfter.length - suffixLength);\n var newSuffix = newAfter.slice(newAfter.length - suffixLength);\n if (oldSuffix !== newSuffix) {\n break editAfter;\n }\n var oldMiddle = oldAfter.slice(0, oldAfter.length - suffixLength);\n var newMiddle = newAfter.slice(0, newAfter.length - suffixLength);\n return make_edit_splice(oldBefore, oldMiddle, newMiddle, oldSuffix);\n }\n }\n if (oldRange.length > 0 && newRange && newRange.length === 0) {\n replaceRange: {\n // see if diff could be a splice of the old selection range\n var oldPrefix = oldText.slice(0, oldRange.index);\n var oldSuffix = oldText.slice(oldRange.index + oldRange.length);\n var prefixLength = oldPrefix.length;\n var suffixLength = oldSuffix.length;\n if (newLength < prefixLength + suffixLength) {\n break replaceRange;\n }\n var newPrefix = newText.slice(0, prefixLength);\n var newSuffix = newText.slice(newLength - suffixLength);\n if (oldPrefix !== newPrefix || oldSuffix !== newSuffix) {\n break replaceRange;\n }\n var oldMiddle = oldText.slice(prefixLength, oldLength - suffixLength);\n var newMiddle = newText.slice(prefixLength, newLength - suffixLength);\n return make_edit_splice(oldPrefix, oldMiddle, newMiddle, oldSuffix);\n }\n }\n\n return null;\n}\n\nfunction diff(text1, text2, cursor_pos, cleanup) {\n // only pass fix_unicode=true at the top level, not when diff_main is\n // recursively invoked\n return diff_main(text1, text2, cursor_pos, cleanup, true);\n}\n\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n", "/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, true, true);\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = cloneDeep;\n", "/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = isEqual;\n", "import cloneDeep = require('lodash.clonedeep');\nimport isEqual = require('lodash.isequal');\n\ninterface AttributeMap {\n [key: string]: unknown;\n}\n\nnamespace AttributeMap {\n export function compose(\n a: AttributeMap = {},\n b: AttributeMap = {},\n keepNull = false,\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n let attributes = cloneDeep(b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce((copy, key) => {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (const key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n\n export function diff(\n a: AttributeMap = {},\n b: AttributeMap = {},\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n a = {};\n }\n if (typeof b !== 'object') {\n b = {};\n }\n const attributes = Object.keys(a)\n .concat(Object.keys(b))\n .reduce((attrs, key) => {\n if (!isEqual(a[key], b[key])) {\n attrs[key] = b[key] === undefined ? null : b[key];\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n\n export function invert(\n attr: AttributeMap = {},\n base: AttributeMap = {},\n ): AttributeMap {\n attr = attr || {};\n const baseInverted = Object.keys(base).reduce((memo, key) => {\n if (base[key] !== attr[key] && attr[key] !== undefined) {\n memo[key] = base[key];\n }\n return memo;\n }, {});\n return Object.keys(attr).reduce((memo, key) => {\n if (attr[key] !== base[key] && base[key] === undefined) {\n memo[key] = null;\n }\n return memo;\n }, baseInverted);\n }\n\n export function transform(\n a: AttributeMap | undefined,\n b: AttributeMap | undefined,\n priority = false,\n ): AttributeMap | undefined {\n if (typeof a !== 'object') {\n return b;\n }\n if (typeof b !== 'object') {\n return undefined;\n }\n if (!priority) {\n return b; // b simply overwrites us without priority\n }\n const attributes = Object.keys(b).reduce((attrs, key) => {\n if (a[key] === undefined) {\n attrs[key] = b[key]; // null is a valid value\n }\n return attrs;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n}\n\nexport default AttributeMap;\n", "import AttributeMap from './AttributeMap';\n\ninterface Op {\n // only one property out of {insert, delete, retain} will be present\n insert?: string | Record;\n delete?: number;\n retain?: number | Record;\n\n attributes?: AttributeMap;\n}\n\nnamespace Op {\n export function length(op: Op): number {\n if (typeof op.delete === 'number') {\n return op.delete;\n } else if (typeof op.retain === 'number') {\n return op.retain;\n } else if (typeof op.retain === 'object' && op.retain !== null) {\n return 1;\n } else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n}\n\nexport default Op;\n", "import Op from './Op';\n\nexport default class Iterator {\n ops: Op[];\n index: number;\n offset: number;\n\n constructor(ops: Op[]) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n }\n\n hasNext(): boolean {\n return this.peekLength() < Infinity;\n }\n\n next(length?: number): Op {\n if (!length) {\n length = Infinity;\n }\n const nextOp = this.ops[this.index];\n if (nextOp) {\n const offset = this.offset;\n const opLength = Op.length(nextOp);\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n } else {\n this.offset += length;\n }\n if (typeof nextOp.delete === 'number') {\n return { delete: length };\n } else {\n const retOp: Op = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n } else if (\n typeof nextOp.retain === 'object' &&\n nextOp.retain !== null\n ) {\n // offset should === 0, length should === 1\n retOp.retain = nextOp.retain;\n } else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n } else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n } else {\n return { retain: Infinity };\n }\n }\n\n peek(): Op {\n return this.ops[this.index];\n }\n\n peekLength(): number {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return Op.length(this.ops[this.index]) - this.offset;\n } else {\n return Infinity;\n }\n }\n\n peekType(): string {\n const op = this.ops[this.index];\n if (op) {\n if (typeof op.delete === 'number') {\n return 'delete';\n } else if (\n typeof op.retain === 'number' ||\n (typeof op.retain === 'object' && op.retain !== null)\n ) {\n return 'retain';\n } else {\n return 'insert';\n }\n }\n return 'retain';\n }\n\n rest(): Op[] {\n if (!this.hasNext()) {\n return [];\n } else if (this.offset === 0) {\n return this.ops.slice(this.index);\n } else {\n const offset = this.offset;\n const index = this.index;\n const next = this.next();\n const rest = this.ops.slice(this.index);\n this.offset = offset;\n this.index = index;\n return [next].concat(rest);\n }\n }\n}\n", "import * as diff from 'fast-diff';\nimport cloneDeep = require('lodash.clonedeep');\nimport isEqual = require('lodash.isequal');\nimport AttributeMap from './AttributeMap';\nimport Op from './Op';\nimport OpIterator from './OpIterator';\n\nconst NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\ninterface EmbedHandler {\n compose(a: T, b: T, keepNull: boolean): T;\n invert(a: T, b: T): T;\n transform(a: T, b: T, priority: boolean): T;\n}\n\nconst getEmbedTypeAndData = (\n a: Op['insert'] | Op['retain'],\n b: Op['insert'],\n): [string, unknown, unknown] => {\n if (typeof a !== 'object' || a === null) {\n throw new Error(`cannot retain a ${typeof a}`);\n }\n if (typeof b !== 'object' || b === null) {\n throw new Error(`cannot retain a ${typeof b}`);\n }\n const embedType = Object.keys(a)[0];\n if (!embedType || embedType !== Object.keys(b)[0]) {\n throw new Error(\n `embed types not matched: ${embedType} != ${Object.keys(b)[0]}`,\n );\n }\n return [embedType, a[embedType], b[embedType]];\n};\n\nclass Delta {\n static Op = Op;\n static OpIterator = OpIterator;\n static AttributeMap = AttributeMap;\n private static handlers: { [embedType: string]: EmbedHandler } = {};\n\n static registerEmbed(embedType: string, handler: EmbedHandler): void {\n this.handlers[embedType] = handler;\n }\n\n static unregisterEmbed(embedType: string): void {\n delete this.handlers[embedType];\n }\n\n private static getHandler(embedType: string): EmbedHandler {\n const handler = this.handlers[embedType];\n if (!handler) {\n throw new Error(`no handlers for embed type \"${embedType}\"`);\n }\n return handler;\n }\n\n ops: Op[];\n constructor(ops?: Op[] | { ops: Op[] }) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n } else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n } else {\n this.ops = [];\n }\n }\n\n insert(\n arg: string | Record,\n attributes?: AttributeMap | null,\n ): this {\n const newOp: Op = {};\n if (typeof arg === 'string' && arg.length === 0) {\n return this;\n }\n newOp.insert = arg;\n if (\n attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0\n ) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n }\n\n delete(length: number): this {\n if (length <= 0) {\n return this;\n }\n return this.push({ delete: length });\n }\n\n retain(\n length: number | Record,\n attributes?: AttributeMap | null,\n ): this {\n if (typeof length === 'number' && length <= 0) {\n return this;\n }\n const newOp: Op = { retain: length };\n if (\n attributes != null &&\n typeof attributes === 'object' &&\n Object.keys(attributes).length > 0\n ) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n }\n\n push(newOp: Op): this {\n let index = this.ops.length;\n let lastOp = this.ops[index - 1];\n newOp = cloneDeep(newOp);\n if (typeof lastOp === 'object') {\n if (\n typeof newOp.delete === 'number' &&\n typeof lastOp.delete === 'number'\n ) {\n this.ops[index - 1] = { delete: lastOp.delete + newOp.delete };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp.delete === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (isEqual(newOp.attributes, lastOp.attributes)) {\n if (\n typeof newOp.insert === 'string' &&\n typeof lastOp.insert === 'string'\n ) {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n } else if (\n typeof newOp.retain === 'number' &&\n typeof lastOp.retain === 'number'\n ) {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') {\n this.ops[index - 1].attributes = newOp.attributes;\n }\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n } else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n }\n\n chop(): this {\n const lastOp = this.ops[this.ops.length - 1];\n if (lastOp && typeof lastOp.retain === 'number' && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n }\n\n filter(predicate: (op: Op, index: number) => boolean): Op[] {\n return this.ops.filter(predicate);\n }\n\n forEach(predicate: (op: Op, index: number) => void): void {\n this.ops.forEach(predicate);\n }\n\n map(predicate: (op: Op, index: number) => T): T[] {\n return this.ops.map(predicate);\n }\n\n partition(predicate: (op: Op) => boolean): [Op[], Op[]] {\n const passed: Op[] = [];\n const failed: Op[] = [];\n this.forEach((op) => {\n const target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n }\n\n reduce(\n predicate: (accum: T, curr: Op, index: number) => T,\n initialValue: T,\n ): T {\n return this.ops.reduce(predicate, initialValue);\n }\n\n changeLength(): number {\n return this.reduce((length, elem) => {\n if (elem.insert) {\n return length + Op.length(elem);\n } else if (elem.delete) {\n return length - elem.delete;\n }\n return length;\n }, 0);\n }\n\n length(): number {\n return this.reduce((length, elem) => {\n return length + Op.length(elem);\n }, 0);\n }\n\n slice(start = 0, end = Infinity): Delta {\n const ops = [];\n const iter = new OpIterator(this.ops);\n let index = 0;\n while (index < end && iter.hasNext()) {\n let nextOp;\n if (index < start) {\n nextOp = iter.next(start - index);\n } else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += Op.length(nextOp);\n }\n return new Delta(ops);\n }\n\n compose(other: Delta): Delta {\n const thisIter = new OpIterator(this.ops);\n const otherIter = new OpIterator(other.ops);\n const ops = [];\n const firstOther = otherIter.peek();\n if (\n firstOther != null &&\n typeof firstOther.retain === 'number' &&\n firstOther.attributes == null\n ) {\n let firstLeft = firstOther.retain;\n while (\n thisIter.peekType() === 'insert' &&\n thisIter.peekLength() <= firstLeft\n ) {\n firstLeft -= thisIter.peekLength();\n ops.push(thisIter.next());\n }\n if (firstOther.retain - firstLeft > 0) {\n otherIter.next(firstOther.retain - firstLeft);\n }\n }\n const delta = new Delta(ops);\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n } else {\n const length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n const thisOp = thisIter.next(length);\n const otherOp = otherIter.next(length);\n if (otherOp.retain) {\n const newOp: Op = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain =\n typeof otherOp.retain === 'number' ? length : otherOp.retain;\n } else {\n if (typeof otherOp.retain === 'number') {\n if (thisOp.retain == null) {\n newOp.insert = thisOp.insert;\n } else {\n newOp.retain = thisOp.retain;\n }\n } else {\n const action = thisOp.retain == null ? 'insert' : 'retain';\n const [embedType, thisData, otherData] = getEmbedTypeAndData(\n thisOp[action],\n otherOp.retain,\n );\n const handler = Delta.getHandler(embedType);\n newOp[action] = {\n [embedType]: handler.compose(\n thisData,\n otherData,\n action === 'retain',\n ),\n };\n }\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n const attributes = AttributeMap.compose(\n thisOp.attributes,\n otherOp.attributes,\n typeof thisOp.retain === 'number',\n );\n if (attributes) {\n newOp.attributes = attributes;\n }\n delta.push(newOp);\n\n // Optimization if rest of other is just retain\n if (\n !otherIter.hasNext() &&\n isEqual(delta.ops[delta.ops.length - 1], newOp)\n ) {\n const rest = new Delta(thisIter.rest());\n return delta.concat(rest).chop();\n }\n\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n } else if (\n typeof otherOp.delete === 'number' &&\n (typeof thisOp.retain === 'number' ||\n (typeof thisOp.retain === 'object' && thisOp.retain !== null))\n ) {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n }\n\n concat(other: Delta): Delta {\n const delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n }\n\n diff(other: Delta, cursor?: number | diff.CursorInfo): Delta {\n if (this.ops === other.ops) {\n return new Delta();\n }\n const strings = [this, other].map((delta) => {\n return delta\n .map((op) => {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n const prep = delta === other ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n })\n .join('');\n });\n const retDelta = new Delta();\n const diffResult = diff(strings[0], strings[1], cursor, true);\n const thisIter = new OpIterator(this.ops);\n const otherIter = new OpIterator(other.ops);\n diffResult.forEach((component: diff.Diff) => {\n let length = component[1].length;\n while (length > 0) {\n let opLength = 0;\n switch (component[0]) {\n case diff.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n retDelta.push(otherIter.next(opLength));\n break;\n case diff.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n retDelta.delete(opLength);\n break;\n case diff.EQUAL:\n opLength = Math.min(\n thisIter.peekLength(),\n otherIter.peekLength(),\n length,\n );\n const thisOp = thisIter.next(opLength);\n const otherOp = otherIter.next(opLength);\n if (isEqual(thisOp.insert, otherOp.insert)) {\n retDelta.retain(\n opLength,\n AttributeMap.diff(thisOp.attributes, otherOp.attributes),\n );\n } else {\n retDelta.push(otherOp).delete(opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return retDelta.chop();\n }\n\n eachLine(\n predicate: (\n line: Delta,\n attributes: AttributeMap,\n index: number,\n ) => boolean | void,\n newline = '\\n',\n ): void {\n const iter = new OpIterator(this.ops);\n let line = new Delta();\n let i = 0;\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') {\n return;\n }\n const thisOp = iter.peek();\n const start = Op.length(thisOp) - iter.peekLength();\n const index =\n typeof thisOp.insert === 'string'\n ? thisOp.insert.indexOf(newline, start) - start\n : -1;\n if (index < 0) {\n line.push(iter.next());\n } else if (index > 0) {\n line.push(iter.next(index));\n } else {\n if (predicate(line, iter.next(1).attributes || {}, i) === false) {\n return;\n }\n i += 1;\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {}, i);\n }\n }\n\n invert(base: Delta): Delta {\n const inverted = new Delta();\n this.reduce((baseIndex, op) => {\n if (op.insert) {\n inverted.delete(Op.length(op));\n } else if (typeof op.retain === 'number' && op.attributes == null) {\n inverted.retain(op.retain);\n return baseIndex + op.retain;\n } else if (op.delete || typeof op.retain === 'number') {\n const length = (op.delete || op.retain) as number;\n const slice = base.slice(baseIndex, baseIndex + length);\n slice.forEach((baseOp) => {\n if (op.delete) {\n inverted.push(baseOp);\n } else if (op.retain && op.attributes) {\n inverted.retain(\n Op.length(baseOp),\n AttributeMap.invert(op.attributes, baseOp.attributes),\n );\n }\n });\n return baseIndex + length;\n } else if (typeof op.retain === 'object' && op.retain !== null) {\n const slice = base.slice(baseIndex, baseIndex + 1);\n const baseOp = new OpIterator(slice.ops).next();\n const [embedType, opData, baseOpData] = getEmbedTypeAndData(\n op.retain,\n baseOp.insert,\n );\n const handler = Delta.getHandler(embedType);\n inverted.retain(\n { [embedType]: handler.invert(opData, baseOpData) },\n AttributeMap.invert(op.attributes, baseOp.attributes),\n );\n return baseIndex + 1;\n }\n return baseIndex;\n }, 0);\n return inverted.chop();\n }\n\n transform(index: number, priority?: boolean): number;\n transform(other: Delta, priority?: boolean): Delta;\n transform(arg: number | Delta, priority = false): typeof arg {\n priority = !!priority;\n if (typeof arg === 'number') {\n return this.transformPosition(arg, priority);\n }\n const other: Delta = arg;\n const thisIter = new OpIterator(this.ops);\n const otherIter = new OpIterator(other.ops);\n const delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (\n thisIter.peekType() === 'insert' &&\n (priority || otherIter.peekType() !== 'insert')\n ) {\n delta.retain(Op.length(thisIter.next()));\n } else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else {\n const length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n const thisOp = thisIter.next(length);\n const otherOp = otherIter.next(length);\n if (thisOp.delete) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n } else if (otherOp.delete) {\n delta.push(otherOp);\n } else {\n const thisData = thisOp.retain;\n const otherData = otherOp.retain;\n let transformedData: Op['retain'] =\n typeof otherData === 'object' && otherData !== null\n ? otherData\n : length;\n if (\n typeof thisData === 'object' &&\n thisData !== null &&\n typeof otherData === 'object' &&\n otherData !== null\n ) {\n const embedType = Object.keys(thisData)[0];\n if (embedType === Object.keys(otherData)[0]) {\n const handler = Delta.getHandler(embedType);\n if (handler) {\n transformedData = {\n [embedType]: handler.transform(\n thisData[embedType],\n otherData[embedType],\n priority,\n ),\n };\n }\n }\n }\n\n // We retain either their retain or insert\n delta.retain(\n transformedData,\n AttributeMap.transform(\n thisOp.attributes,\n otherOp.attributes,\n priority,\n ),\n );\n }\n }\n }\n return delta.chop();\n }\n\n transformPosition(index: number, priority = false): number {\n priority = !!priority;\n const thisIter = new OpIterator(this.ops);\n let offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n const length = thisIter.peekLength();\n const nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length, index - offset);\n continue;\n } else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length;\n }\n offset += length;\n }\n return index;\n }\n}\n\nexport default Delta;\n\nexport { Op, OpIterator, AttributeMap };\n\nif (typeof module === 'object') {\n module.exports = Delta;\n module.exports.default = Delta;\n}\n", "import { EmbedBlot } from 'parchment';\n\nclass Break extends EmbedBlot {\n static value() {\n return undefined;\n }\n\n optimize() {\n if (this.prev || this.next) {\n this.remove();\n }\n }\n\n length() {\n return 0;\n }\n\n value() {\n return '';\n }\n}\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\nexport default Break;\n", "import { TextBlot } from 'parchment';\n\nclass Text extends TextBlot {}\n\nfunction escapeText(text: string) {\n return text.replace(/[&<>\"']/g, (s) => {\n // https://lodash.com/docs#escape\n const entityMap: Record = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n };\n return entityMap[s];\n });\n}\n\nexport { Text as default, escapeText };\n", "import { EmbedBlot, InlineBlot, Scope } from 'parchment';\nimport type { BlotConstructor } from 'parchment';\nimport Break from './break.js';\nimport Text from './text.js';\n\nclass Inline extends InlineBlot {\n static allowedChildren: BlotConstructor[] = [Inline, Break, EmbedBlot, Text];\n // Lower index means deeper in the DOM tree, since not found (-1) is for embeds\n static order = [\n 'cursor',\n 'inline', // Must be lower\n 'link', // Chrome wants to be lower\n 'underline',\n 'strike',\n 'italic',\n 'bold',\n 'script',\n 'code', // Must be higher\n ];\n\n static compare(self: string, other: string) {\n const selfIndex = Inline.order.indexOf(self);\n const otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n }\n if (self === other) {\n return 0;\n }\n if (self < other) {\n return -1;\n }\n return 1;\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n if (\n Inline.compare(this.statics.blotName, name) < 0 &&\n this.scroll.query(name, Scope.BLOT)\n ) {\n const blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n if (\n this.parent instanceof Inline &&\n Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0\n ) {\n const parent = this.parent.isolate(this.offset(), this.length());\n // @ts-expect-error TODO: make isolate generic\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n}\n\nexport default Inline;\n", "import {\n AttributorStore,\n BlockBlot,\n EmbedBlot,\n LeafBlot,\n Scope,\n} from 'parchment';\nimport type { Blot, Parent } from 'parchment';\nimport Delta from 'quill-delta';\nimport Break from './break.js';\nimport Inline from './inline.js';\nimport TextBlot from './text.js';\n\nconst NEWLINE_LENGTH = 1;\n\nclass Block extends BlockBlot {\n cache: { delta?: Delta | null; length?: number } = {};\n\n delta(): Delta {\n if (this.cache.delta == null) {\n this.cache.delta = blockDelta(this);\n }\n return this.cache.delta;\n }\n\n deleteAt(index: number, length: number) {\n super.deleteAt(index, length);\n this.cache = {};\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n if (length <= 0) return;\n if (this.scroll.query(name, Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n super.formatAt(\n index,\n Math.min(length, this.length() - index - 1),\n name,\n value,\n );\n }\n this.cache = {};\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n if (def != null) {\n super.insertAt(index, value, def);\n this.cache = {};\n return;\n }\n if (value.length === 0) return;\n const lines = value.split('\\n');\n const text = lines.shift() as string;\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n super.insertAt(Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n // TODO: Fix this next time the file is edited.\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let block: Blot | this = this;\n lines.reduce((lineIndex, line) => {\n // @ts-expect-error Fix me later\n block = block.split(lineIndex, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n\n insertBefore(blot: Blot, ref?: Blot | null) {\n const { head } = this.children;\n super.insertBefore(blot, ref);\n if (head instanceof Break) {\n head.remove();\n }\n this.cache = {};\n }\n\n length() {\n if (this.cache.length == null) {\n this.cache.length = super.length() + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n\n moveChildren(target: Parent, ref?: Blot | null) {\n super.moveChildren(target, ref);\n this.cache = {};\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n this.cache = {};\n }\n\n path(index: number) {\n return super.path(index, true);\n }\n\n removeChild(child: Blot) {\n super.removeChild(child);\n this.cache = {};\n }\n\n split(index: number, force: boolean | undefined = false): Blot | null {\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n const clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n }\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n const next = super.split(index, force);\n this.cache = {};\n return next;\n }\n}\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = Break;\nBlock.allowedChildren = [Break, Inline, EmbedBlot, TextBlot];\n\nclass BlockEmbed extends EmbedBlot {\n attributes: AttributorStore;\n domNode: HTMLElement;\n\n attach() {\n super.attach();\n this.attributes = new AttributorStore(this.domNode);\n }\n\n delta() {\n return new Delta().insert(this.value(), {\n ...this.formats(),\n ...this.attributes.values(),\n });\n }\n\n format(name: string, value: unknown) {\n const attribute = this.scroll.query(name, Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n // @ts-expect-error TODO: Scroll#query() should return Attributor when scope is attribute\n this.attributes.attribute(attribute, value);\n }\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n this.format(name, value);\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n if (def != null) {\n super.insertAt(index, value, def);\n return;\n }\n const lines = value.split('\\n');\n const text = lines.pop();\n const blocks = lines.map((line) => {\n const block = this.scroll.create(Block.blotName);\n block.insertAt(0, line);\n return block;\n });\n const ref = this.split(index);\n blocks.forEach((block) => {\n this.parent.insertBefore(block, ref);\n });\n if (text) {\n this.parent.insertBefore(this.scroll.create('text', text), ref);\n }\n }\n}\nBlockEmbed.scope = Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\nfunction blockDelta(blot: BlockBlot, filter = true) {\n return blot\n .descendants(LeafBlot)\n .reduce((delta, leaf) => {\n if (leaf.length() === 0) {\n return delta;\n }\n return delta.insert(leaf.value(), bubbleFormats(leaf, {}, filter));\n }, new Delta())\n .insert('\\n', bubbleFormats(blot));\n}\n\nfunction bubbleFormats(\n blot: Blot | null,\n formats: Record = {},\n filter = true,\n): Record {\n if (blot == null) return formats;\n if ('formats' in blot && typeof blot.formats === 'function') {\n formats = {\n ...formats,\n ...blot.formats(),\n };\n if (filter) {\n // exclude syntax highlighting from deltas and getFormat()\n delete formats['code-token'];\n }\n }\n if (\n blot.parent == null ||\n blot.parent.statics.blotName === 'scroll' ||\n blot.parent.statics.scope !== blot.statics.scope\n ) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats, filter);\n}\n\nexport { blockDelta, bubbleFormats, BlockEmbed, Block as default };\n", "import { EmbedBlot, Scope } from 'parchment';\nimport type { Parent, ScrollBlot } from 'parchment';\nimport type Selection from '../core/selection.js';\nimport TextBlot from './text.js';\nimport type { EmbedContextRange } from './embed.js';\n\nclass Cursor extends EmbedBlot {\n static blotName = 'cursor';\n static className = 'ql-cursor';\n static tagName = 'span';\n static CONTENTS = '\\uFEFF'; // Zero width no break space\n\n static value() {\n return undefined;\n }\n\n selection: Selection;\n textNode: Text;\n savedLength: number;\n\n constructor(scroll: ScrollBlot, domNode: HTMLElement, selection: Selection) {\n super(scroll, domNode);\n this.selection = selection;\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n this.savedLength = 0;\n }\n\n detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n\n format(name: string, value: unknown) {\n if (this.savedLength !== 0) {\n super.format(name, value);\n return;\n }\n // TODO: Fix this next time the file is edited.\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n let target: Parent | this = this;\n let index = 0;\n while (target != null && target.statics.scope !== Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this.savedLength = Cursor.CONTENTS.length;\n // @ts-expect-error TODO: allow empty context in Parchment\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this.savedLength = 0;\n }\n }\n\n index(node: Node, offset: number) {\n if (node === this.textNode) return 0;\n return super.index(node, offset);\n }\n\n length() {\n return this.savedLength;\n }\n\n position(): [Text, number] {\n return [this.textNode, this.textNode.data.length];\n }\n\n remove() {\n super.remove();\n // @ts-expect-error Fix me later\n this.parent = null;\n }\n\n restore(): EmbedContextRange | null {\n if (this.selection.composing || this.parent == null) return null;\n const range = this.selection.getNativeRange();\n // Browser may push down styles/nodes inside the cursor blot.\n // https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#push-down-values\n while (\n this.domNode.lastChild != null &&\n this.domNode.lastChild !== this.textNode\n ) {\n // @ts-expect-error Fix me later\n this.domNode.parentNode.insertBefore(\n this.domNode.lastChild,\n this.domNode,\n );\n }\n\n const prevTextBlot = this.prev instanceof TextBlot ? this.prev : null;\n const prevTextLength = prevTextBlot ? prevTextBlot.length() : 0;\n const nextTextBlot = this.next instanceof TextBlot ? this.next : null;\n // @ts-expect-error TODO: make TextBlot.text public\n const nextText = nextTextBlot ? nextTextBlot.text : '';\n const { textNode } = this;\n // take text from inside this blot and reset it\n const newText = textNode.data.split(Cursor.CONTENTS).join('');\n textNode.data = Cursor.CONTENTS;\n\n // proactively merge TextBlots around cursor so that optimization\n // doesn't lose the cursor. the reason we are here in cursor.restore\n // could be that the user clicked in prevTextBlot or nextTextBlot, or\n // the user typed something.\n let mergedTextBlot;\n if (prevTextBlot) {\n mergedTextBlot = prevTextBlot;\n if (newText || nextTextBlot) {\n prevTextBlot.insertAt(prevTextBlot.length(), newText + nextText);\n if (nextTextBlot) {\n nextTextBlot.remove();\n }\n }\n } else if (nextTextBlot) {\n mergedTextBlot = nextTextBlot;\n nextTextBlot.insertAt(0, newText);\n } else {\n const newTextNode = document.createTextNode(newText);\n mergedTextBlot = this.scroll.create(newTextNode);\n this.parent.insertBefore(mergedTextBlot, this);\n }\n\n this.remove();\n if (range) {\n // calculate selection to restore\n const remapOffset = (node: Node, offset: number) => {\n if (prevTextBlot && node === prevTextBlot.domNode) {\n return offset;\n }\n if (node === textNode) {\n return prevTextLength + offset - 1;\n }\n if (nextTextBlot && node === nextTextBlot.domNode) {\n return prevTextLength + newText.length + offset;\n }\n return null;\n };\n\n const start = remapOffset(range.start.node, range.start.offset);\n const end = remapOffset(range.end.node, range.end.offset);\n if (start !== null && end !== null) {\n return {\n startNode: mergedTextBlot.domNode,\n startOffset: start,\n endNode: mergedTextBlot.domNode,\n endOffset: end,\n };\n }\n }\n return null;\n }\n\n update(mutations: MutationRecord[], context: Record) {\n if (\n mutations.some((mutation) => {\n return (\n mutation.type === 'characterData' && mutation.target === this.textNode\n );\n })\n ) {\n const range = this.restore();\n if (range) context.range = range;\n }\n }\n\n // Avoid .ql-cursor being a descendant of ``.\n // The reason is Safari pushes down `` on text insertion.\n // That will cause DOM nodes not sync with the model.\n //\n // For example ({I} is the caret), given the markup:\n // \\uFEFF{I}\n // When typing a char \"x\", `` will be pushed down inside the `` first:\n // \\uFEFF{I}\n // And then \"x\" will be inserted after ``:\n // \\uFEFFd{I}\n optimize(context?: unknown) {\n // @ts-expect-error Fix me later\n super.optimize(context);\n\n let { parent } = this;\n while (parent) {\n if (parent.domNode.tagName === 'A') {\n this.savedLength = Cursor.CONTENTS.length;\n // @ts-expect-error TODO: make isolate generic\n parent.isolate(this.offset(parent), this.length()).unwrap();\n this.savedLength = 0;\n break;\n }\n parent = parent.parent;\n }\n }\n\n value() {\n return '';\n }\n}\n\nexport default Cursor;\n", "'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n", "import EventEmitter from './index.js'\n\nexport { EventEmitter }\nexport default EventEmitter\n", "import type Quill from '../core.js';\n\nexport default new WeakMap();\n", "const levels = ['error', 'warn', 'log', 'info'] as const;\nexport type DebugLevel = (typeof levels)[number];\nlet level: DebugLevel | false = 'warn';\n\nfunction debug(method: DebugLevel, ...args: unknown[]) {\n if (level) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n console[method](...args); // eslint-disable-line no-console\n }\n }\n}\n\nfunction namespace(\n ns: string,\n): Record void> {\n return levels.reduce(\n (logger, method) => {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n },\n {} as Record void>,\n );\n}\n\nnamespace.level = (newLevel: DebugLevel | false) => {\n level = newLevel;\n};\ndebug.level = namespace.level;\n\nexport default namespace;\n", "import { EventEmitter } from 'eventemitter3';\nimport instances from './instances.js';\nimport logger from './logger.js';\n\nconst debug = logger('quill:events');\nconst EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];\n\nEVENTS.forEach((eventName) => {\n document.addEventListener(eventName, (...args) => {\n Array.from(document.querySelectorAll('.ql-container')).forEach((node) => {\n const quill = instances.get(node);\n if (quill && quill.emitter) {\n quill.emitter.handleDOM(...args);\n }\n });\n });\n});\n\nclass Emitter extends EventEmitter {\n static events = {\n EDITOR_CHANGE: 'editor-change',\n SCROLL_BEFORE_UPDATE: 'scroll-before-update',\n SCROLL_BLOT_MOUNT: 'scroll-blot-mount',\n SCROLL_BLOT_UNMOUNT: 'scroll-blot-unmount',\n SCROLL_OPTIMIZE: 'scroll-optimize',\n SCROLL_UPDATE: 'scroll-update',\n SCROLL_EMBED_UPDATE: 'scroll-embed-update',\n SELECTION_CHANGE: 'selection-change',\n TEXT_CHANGE: 'text-change',\n COMPOSITION_BEFORE_START: 'composition-before-start',\n COMPOSITION_START: 'composition-start',\n COMPOSITION_BEFORE_END: 'composition-before-end',\n COMPOSITION_END: 'composition-end',\n } as const;\n\n static sources = {\n API: 'api',\n SILENT: 'silent',\n USER: 'user',\n } as const;\n\n protected domListeners: Record;\n\n constructor() {\n super();\n this.domListeners = {};\n this.on('error', debug.error);\n }\n\n emit(...args: unknown[]): boolean {\n debug.log.call(debug, ...args);\n // @ts-expect-error\n return super.emit(...args);\n }\n\n handleDOM(event: Event, ...args: unknown[]) {\n (this.domListeners[event.type] || []).forEach(({ node, handler }) => {\n if (event.target === node || node.contains(event.target as Node)) {\n handler(event, ...args);\n }\n });\n }\n\n listenDOM(eventName: string, node: Node, handler: EventListener) {\n if (!this.domListeners[eventName]) {\n this.domListeners[eventName] = [];\n }\n this.domListeners[eventName].push({ node, handler });\n }\n}\n\nexport type EmitterSource =\n (typeof Emitter.sources)[keyof typeof Emitter.sources];\n\nexport default Emitter;\n", "import { LeafBlot, Scope } from 'parchment';\nimport { cloneDeep, isEqual } from 'lodash-es';\nimport Emitter from './emitter.js';\nimport type { EmitterSource } from './emitter.js';\nimport logger from './logger.js';\nimport type Cursor from '../blots/cursor.js';\nimport type Scroll from '../blots/scroll.js';\n\nconst debug = logger('quill:selection');\n\ntype NativeRange = AbstractRange;\n\ninterface NormalizedRange {\n start: {\n node: NativeRange['startContainer'];\n offset: NativeRange['startOffset'];\n };\n end: { node: NativeRange['endContainer']; offset: NativeRange['endOffset'] };\n native: NativeRange;\n}\n\nexport interface Bounds {\n bottom: number;\n height: number;\n left: number;\n right: number;\n top: number;\n width: number;\n}\n\nexport class Range {\n constructor(\n public index: number,\n public length = 0,\n ) {}\n}\n\nclass Selection {\n scroll: Scroll;\n emitter: Emitter;\n composing: boolean;\n mouseDown: boolean;\n\n root: HTMLElement;\n cursor: Cursor;\n savedRange: Range;\n lastRange: Range | null;\n lastNative: NormalizedRange | null;\n\n constructor(scroll: Scroll, emitter: Emitter) {\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.mouseDown = false;\n this.root = this.scroll.domNode;\n // @ts-expect-error\n this.cursor = this.scroll.create('cursor', this);\n // savedRange is last non-null range\n this.savedRange = new Range(0, 0);\n this.lastRange = this.savedRange;\n this.lastNative = null;\n this.handleComposition();\n this.handleDragging();\n this.emitter.listenDOM('selectionchange', document, () => {\n if (!this.mouseDown && !this.composing) {\n setTimeout(this.update.bind(this, Emitter.sources.USER), 1);\n }\n });\n this.emitter.on(Emitter.events.SCROLL_BEFORE_UPDATE, () => {\n if (!this.hasFocus()) return;\n const native = this.getNativeRange();\n if (native == null) return;\n if (native.start.node === this.cursor.textNode) return; // cursor.restore() will handle\n this.emitter.once(\n Emitter.events.SCROLL_UPDATE,\n (source, mutations: MutationRecord[]) => {\n try {\n if (\n this.root.contains(native.start.node) &&\n this.root.contains(native.end.node)\n ) {\n this.setNativeRange(\n native.start.node,\n native.start.offset,\n native.end.node,\n native.end.offset,\n );\n }\n const triggeredByTyping = mutations.some(\n (mutation) =>\n mutation.type === 'characterData' ||\n mutation.type === 'childList' ||\n (mutation.type === 'attributes' &&\n mutation.target === this.root),\n );\n this.update(triggeredByTyping ? Emitter.sources.SILENT : source);\n } catch (ignored) {\n // ignore\n }\n },\n );\n });\n this.emitter.on(Emitter.events.SCROLL_OPTIMIZE, (mutations, context) => {\n if (context.range) {\n const { startNode, startOffset, endNode, endOffset } = context.range;\n this.setNativeRange(startNode, startOffset, endNode, endOffset);\n this.update(Emitter.sources.SILENT);\n }\n });\n this.update(Emitter.sources.SILENT);\n }\n\n handleComposition() {\n this.emitter.on(Emitter.events.COMPOSITION_BEFORE_START, () => {\n this.composing = true;\n });\n this.emitter.on(Emitter.events.COMPOSITION_END, () => {\n this.composing = false;\n if (this.cursor.parent) {\n const range = this.cursor.restore();\n if (!range) return;\n setTimeout(() => {\n this.setNativeRange(\n range.startNode,\n range.startOffset,\n range.endNode,\n range.endOffset,\n );\n }, 1);\n }\n });\n }\n\n handleDragging() {\n this.emitter.listenDOM('mousedown', document.body, () => {\n this.mouseDown = true;\n });\n this.emitter.listenDOM('mouseup', document.body, () => {\n this.mouseDown = false;\n this.update(Emitter.sources.USER);\n });\n }\n\n focus() {\n if (this.hasFocus()) return;\n this.root.focus({ preventScroll: true });\n this.setRange(this.savedRange);\n }\n\n format(format: string, value: unknown) {\n this.scroll.update();\n const nativeRange = this.getNativeRange();\n if (\n nativeRange == null ||\n !nativeRange.native.collapsed ||\n this.scroll.query(format, Scope.BLOCK)\n )\n return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n const blot = this.scroll.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof LeafBlot) {\n const after = blot.split(nativeRange.start.offset);\n blot.parent.insertBefore(this.cursor, after);\n } else {\n // @ts-expect-error TODO: nativeRange.start.node doesn't seem to match function signature\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n\n getBounds(index: number, length = 0) {\n const scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n let node: Node;\n let [leaf, offset] = this.scroll.leaf(index);\n if (leaf == null) return null;\n if (length > 0 && offset === leaf.length()) {\n const [next] = this.scroll.leaf(index + 1);\n if (next) {\n const [line] = this.scroll.line(index);\n const [nextLine] = this.scroll.line(index + 1);\n if (line === nextLine) {\n leaf = next;\n offset = 0;\n }\n }\n }\n [node, offset] = leaf.position(offset, true);\n const range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n [leaf, offset] = this.scroll.leaf(index + length);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n range.setEnd(node, offset);\n return range.getBoundingClientRect();\n }\n let side: 'left' | 'right' = 'left';\n let rect: DOMRect;\n if (node instanceof Text) {\n // Return null if the text node is empty because it is\n // not able to get a useful client rect:\n // https://github.com/w3c/csswg-drafts/issues/2514.\n // Empty text nodes are most likely caused by TextBlot#optimize()\n // not getting called when editor content changes.\n if (!node.data.length) {\n return null;\n }\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n if (!(leaf.domNode instanceof Element)) return null;\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n return {\n bottom: rect.top + rect.height,\n height: rect.height,\n left: rect[side],\n right: rect[side],\n top: rect.top,\n width: 0,\n };\n }\n\n getNativeRange(): NormalizedRange | null {\n const selection = document.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n const nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n const range = this.normalizeNative(nativeRange);\n debug.info('getNativeRange', range);\n return range;\n }\n\n getRange(): [Range, NormalizedRange] | [null, null] {\n const root = this.scroll.domNode;\n if ('isConnected' in root && !root.isConnected) {\n // document.getSelection() forces layout on Blink, so we trend to\n // not calling it.\n return [null, null];\n }\n const normalized = this.getNativeRange();\n if (normalized == null) return [null, null];\n const range = this.normalizedToRange(normalized);\n return [range, normalized];\n }\n\n hasFocus(): boolean {\n return (\n document.activeElement === this.root ||\n (document.activeElement != null &&\n contains(this.root, document.activeElement))\n );\n }\n\n normalizedToRange(range: NormalizedRange) {\n const positions: [Node, number][] = [\n [range.start.node, range.start.offset],\n ];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n const indexes = positions.map((position) => {\n const [node, offset] = position;\n const blot = this.scroll.find(node, true);\n // @ts-expect-error Fix me later\n const index = blot.offset(this.scroll);\n if (offset === 0) {\n return index;\n }\n if (blot instanceof LeafBlot) {\n return index + blot.index(node, offset);\n }\n // @ts-expect-error Fix me later\n return index + blot.length();\n });\n const end = Math.min(Math.max(...indexes), this.scroll.length() - 1);\n const start = Math.min(end, ...indexes);\n return new Range(start, end - start);\n }\n\n normalizeNative(nativeRange: NativeRange) {\n if (\n !contains(this.root, nativeRange.startContainer) ||\n (!nativeRange.collapsed && !contains(this.root, nativeRange.endContainer))\n ) {\n return null;\n }\n const range = {\n start: {\n node: nativeRange.startContainer,\n offset: nativeRange.startOffset,\n },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange,\n };\n [range.start, range.end].forEach((position) => {\n let { node, offset } = position;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n // @ts-expect-error Fix me later\n node = node.lastChild;\n if (node instanceof Text) {\n offset = node.data.length;\n } else if (node.childNodes.length > 0) {\n // Container case\n offset = node.childNodes.length;\n } else {\n // Embed case\n offset = node.childNodes.length + 1;\n }\n } else {\n break;\n }\n }\n position.node = node;\n position.offset = offset;\n });\n return range;\n }\n\n rangeToNative(range: Range): [Node | null, number, Node | null, number] {\n const scrollLength = this.scroll.length();\n\n const getPosition = (\n index: number,\n inclusive: boolean,\n ): [Node | null, number] => {\n index = Math.min(scrollLength - 1, index);\n const [leaf, leafOffset] = this.scroll.leaf(index);\n return leaf ? leaf.position(leafOffset, inclusive) : [null, -1];\n };\n return [\n ...getPosition(range.index, false),\n ...getPosition(range.index + range.length, true),\n ];\n }\n\n setNativeRange(\n startNode: Node | null,\n startOffset?: number,\n endNode = startNode,\n endOffset = startOffset,\n force = false,\n ) {\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (\n startNode != null &&\n (this.root.parentNode == null ||\n startNode.parentNode == null ||\n // @ts-expect-error Fix me later\n endNode.parentNode == null)\n ) {\n return;\n }\n const selection = document.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus({ preventScroll: true });\n const { native } = this.getNativeRange() || {};\n if (\n native == null ||\n force ||\n startNode !== native.startContainer ||\n startOffset !== native.startOffset ||\n endNode !== native.endContainer ||\n endOffset !== native.endOffset\n ) {\n if (startNode instanceof Element && startNode.tagName === 'BR') {\n // @ts-expect-error Fix me later\n startOffset = Array.from(startNode.parentNode.childNodes).indexOf(\n startNode,\n );\n startNode = startNode.parentNode;\n }\n if (endNode instanceof Element && endNode.tagName === 'BR') {\n // @ts-expect-error Fix me later\n endOffset = Array.from(endNode.parentNode.childNodes).indexOf(\n endNode,\n );\n endNode = endNode.parentNode;\n }\n const range = document.createRange();\n // @ts-expect-error Fix me later\n range.setStart(startNode, startOffset);\n // @ts-expect-error Fix me later\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n }\n }\n\n setRange(range: Range | null, force: boolean, source?: EmitterSource): void;\n setRange(range: Range | null, source?: EmitterSource): void;\n setRange(\n range: Range | null,\n force: boolean | EmitterSource = false,\n source: EmitterSource = Emitter.sources.API,\n ): void {\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n const args = this.rangeToNative(range);\n this.setNativeRange(...args, force);\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n\n update(source: EmitterSource = Emitter.sources.USER) {\n const oldRange = this.lastRange;\n const [lastRange, nativeRange] = this.getRange();\n this.lastRange = lastRange;\n this.lastNative = nativeRange;\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!isEqual(oldRange, this.lastRange)) {\n if (\n !this.composing &&\n nativeRange != null &&\n nativeRange.native.collapsed &&\n nativeRange.start.node !== this.cursor.textNode\n ) {\n const range = this.cursor.restore();\n if (range) {\n this.setNativeRange(\n range.startNode,\n range.startOffset,\n range.endNode,\n range.endOffset,\n );\n }\n }\n const args = [\n Emitter.events.SELECTION_CHANGE,\n cloneDeep(this.lastRange),\n cloneDeep(oldRange),\n source,\n ];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n }\n}\n\nfunction contains(parent: Node, descendant: Node) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode; // eslint-disable-line @typescript-eslint/no-unused-expressions\n } catch (e) {\n return false;\n }\n return parent.contains(descendant);\n}\n\nexport default Selection;\n", "import { cloneDeep, isEqual, merge } from 'lodash-es';\nimport { LeafBlot, EmbedBlot, Scope, ParentBlot } from 'parchment';\nimport type { Blot } from 'parchment';\nimport Delta, { AttributeMap, Op } from 'quill-delta';\nimport Block, { BlockEmbed, bubbleFormats } from '../blots/block.js';\nimport Break from '../blots/break.js';\nimport CursorBlot from '../blots/cursor.js';\nimport type Scroll from '../blots/scroll.js';\nimport TextBlot, { escapeText } from '../blots/text.js';\nimport { Range } from './selection.js';\n\nconst ASCII = /^[ -~]*$/;\n\ntype SelectionInfo = {\n newRange: Range;\n oldRange: Range;\n};\n\nclass Editor {\n scroll: Scroll;\n delta: Delta;\n\n constructor(scroll: Scroll) {\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n applyDelta(delta: Delta): Delta {\n this.scroll.update();\n let scrollLength = this.scroll.length();\n this.scroll.batchStart();\n const normalizedDelta = normalizeDelta(delta);\n const deleteDelta = new Delta();\n const normalizedOps = splitOpLines(normalizedDelta.ops.slice());\n normalizedOps.reduce((index, op) => {\n const length = Op.length(op);\n let attributes = op.attributes || {};\n let isImplicitNewlinePrepended = false;\n let isImplicitNewlineAppended = false;\n if (op.insert != null) {\n deleteDelta.retain(length);\n if (typeof op.insert === 'string') {\n const text = op.insert;\n isImplicitNewlineAppended =\n !text.endsWith('\\n') &&\n (scrollLength <= index ||\n !!this.scroll.descendant(BlockEmbed, index)[0]);\n this.scroll.insertAt(index, text);\n const [line, offset] = this.scroll.line(index);\n let formats = merge({}, bubbleFormats(line));\n if (line instanceof Block) {\n const [leaf] = line.descendant(LeafBlot, offset);\n if (leaf) {\n formats = merge(formats, bubbleFormats(leaf));\n }\n }\n attributes = AttributeMap.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n const key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n const isInlineEmbed = this.scroll.query(key, Scope.INLINE) != null;\n if (isInlineEmbed) {\n if (\n scrollLength <= index ||\n !!this.scroll.descendant(BlockEmbed, index)[0]\n ) {\n isImplicitNewlineAppended = true;\n }\n } else if (index > 0) {\n const [leaf, offset] = this.scroll.descendant(LeafBlot, index - 1);\n if (leaf instanceof TextBlot) {\n const text = leaf.value();\n if (text[offset] !== '\\n') {\n isImplicitNewlinePrepended = true;\n }\n } else if (\n leaf instanceof EmbedBlot &&\n leaf.statics.scope === Scope.INLINE_BLOT\n ) {\n isImplicitNewlinePrepended = true;\n }\n }\n this.scroll.insertAt(index, key, op.insert[key]);\n\n if (isInlineEmbed) {\n const [leaf] = this.scroll.descendant(LeafBlot, index);\n if (leaf) {\n const formats = merge({}, bubbleFormats(leaf));\n attributes = AttributeMap.diff(formats, attributes) || {};\n }\n }\n }\n scrollLength += length;\n } else {\n deleteDelta.push(op);\n\n if (op.retain !== null && typeof op.retain === 'object') {\n const key = Object.keys(op.retain)[0];\n if (key == null) return index;\n this.scroll.updateEmbedAt(index, key, op.retain[key]);\n }\n }\n Object.keys(attributes).forEach((name) => {\n this.scroll.formatAt(index, length, name, attributes[name]);\n });\n const prependedLength = isImplicitNewlinePrepended ? 1 : 0;\n const addedLength = isImplicitNewlineAppended ? 1 : 0;\n scrollLength += prependedLength + addedLength;\n deleteDelta.retain(prependedLength);\n deleteDelta.delete(addedLength);\n return index + length + prependedLength + addedLength;\n }, 0);\n deleteDelta.reduce((index, op) => {\n if (typeof op.delete === 'number') {\n this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + Op.length(op);\n }, 0);\n this.scroll.batchEnd();\n this.scroll.optimize();\n return this.update(normalizedDelta);\n }\n\n deleteText(index: number, length: number): Delta {\n this.scroll.deleteAt(index, length);\n return this.update(new Delta().retain(index).delete(length));\n }\n\n formatLine(\n index: number,\n length: number,\n formats: Record = {},\n ): Delta {\n this.scroll.update();\n Object.keys(formats).forEach((format) => {\n this.scroll.lines(index, Math.max(length, 1)).forEach((line) => {\n line.format(format, formats[format]);\n });\n });\n this.scroll.optimize();\n const delta = new Delta().retain(index).retain(length, cloneDeep(formats));\n return this.update(delta);\n }\n\n formatText(\n index: number,\n length: number,\n formats: Record = {},\n ): Delta {\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, length, format, formats[format]);\n });\n const delta = new Delta().retain(index).retain(length, cloneDeep(formats));\n return this.update(delta);\n }\n\n getContents(index: number, length: number): Delta {\n return this.delta.slice(index, index + length);\n }\n\n getDelta(): Delta {\n return this.scroll.lines().reduce((delta, line) => {\n return delta.concat(line.delta());\n }, new Delta());\n }\n\n getFormat(index: number, length = 0): Record {\n let lines: (Block | BlockEmbed)[] = [];\n let leaves: LeafBlot[] = [];\n if (length === 0) {\n this.scroll.path(index).forEach((path) => {\n const [blot] = path;\n if (blot instanceof Block) {\n lines.push(blot);\n } else if (blot instanceof LeafBlot) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(LeafBlot, index, length);\n }\n const [lineFormats, leafFormats] = [lines, leaves].map((blots) => {\n const blot = blots.shift();\n if (blot == null) return {};\n let formats = bubbleFormats(blot);\n while (Object.keys(formats).length > 0) {\n const blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats(bubbleFormats(blot), formats);\n }\n return formats;\n });\n return { ...lineFormats, ...leafFormats };\n }\n\n getHTML(index: number, length: number): string {\n const [line, lineOffset] = this.scroll.line(index);\n if (line) {\n const lineLength = line.length();\n const isWithinLine = line.length() >= lineOffset + length;\n if (isWithinLine && !(lineOffset === 0 && length === lineLength)) {\n return convertHTML(line, lineOffset, length, true);\n }\n return convertHTML(this.scroll, index, length, true);\n }\n return '';\n }\n\n getText(index: number, length: number): string {\n return this.getContents(index, length)\n .filter((op) => typeof op.insert === 'string')\n .map((op) => op.insert)\n .join('');\n }\n\n insertContents(index: number, contents: Delta): Delta {\n const normalizedDelta = normalizeDelta(contents);\n const change = new Delta().retain(index).concat(normalizedDelta);\n this.scroll.insertContents(index, normalizedDelta);\n return this.update(change);\n }\n\n insertEmbed(index: number, embed: string, value: unknown): Delta {\n this.scroll.insertAt(index, embed, value);\n return this.update(new Delta().retain(index).insert({ [embed]: value }));\n }\n\n insertText(\n index: number,\n text: string,\n formats: Record = {},\n ): Delta {\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(\n new Delta().retain(index).insert(text, cloneDeep(formats)),\n );\n }\n\n isBlank(): boolean {\n if (this.scroll.children.length === 0) return true;\n if (this.scroll.children.length > 1) return false;\n const blot = this.scroll.children.head;\n if (blot?.statics.blotName !== Block.blotName) return false;\n const block = blot as Block;\n if (block.children.length > 1) return false;\n return block.children.head instanceof Break;\n }\n\n removeFormat(index: number, length: number): Delta {\n const text = this.getText(index, length);\n const [line, offset] = this.scroll.line(index + length);\n let suffixLength = 0;\n let suffix = new Delta();\n if (line != null) {\n suffixLength = line.length() - offset;\n suffix = line\n .delta()\n .slice(offset, offset + suffixLength - 1)\n .insert('\\n');\n }\n const contents = this.getContents(index, length + suffixLength);\n const diff = contents.diff(new Delta().insert(text).concat(suffix));\n const delta = new Delta().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n\n update(\n change: Delta | null,\n mutations: MutationRecord[] = [],\n selectionInfo: SelectionInfo | undefined = undefined,\n ): Delta {\n const oldDelta = this.delta;\n if (\n mutations.length === 1 &&\n mutations[0].type === 'characterData' &&\n // @ts-expect-error Fix me later\n mutations[0].target.data.match(ASCII) &&\n this.scroll.find(mutations[0].target)\n ) {\n // Optimization for character changes\n const textBlot = this.scroll.find(mutations[0].target) as Blot;\n const formats = bubbleFormats(textBlot);\n const index = textBlot.offset(this.scroll);\n // @ts-expect-error Fix me later\n const oldValue = mutations[0].oldValue.replace(CursorBlot.CONTENTS, '');\n const oldText = new Delta().insert(oldValue);\n // @ts-expect-error\n const newText = new Delta().insert(textBlot.value());\n const relativeSelectionInfo = selectionInfo && {\n oldRange: shiftRange(selectionInfo.oldRange, -index),\n newRange: shiftRange(selectionInfo.newRange, -index),\n };\n const diffDelta = new Delta()\n .retain(index)\n .concat(oldText.diff(newText, relativeSelectionInfo));\n change = diffDelta.reduce((delta, op) => {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n }\n return delta.push(op);\n }, new Delta());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !isEqual(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, selectionInfo);\n }\n }\n return change;\n }\n}\n\ninterface ListItem {\n child: Blot;\n offset: number;\n length: number;\n indent: number;\n type: string;\n}\nfunction convertListHTML(\n items: ListItem[],\n lastIndent: number,\n types: string[],\n): string {\n if (items.length === 0) {\n const [endTag] = getListType(types.pop());\n if (lastIndent <= 0) {\n return ``;\n }\n return `${convertListHTML([], lastIndent - 1, types)}`;\n }\n const [{ child, offset, length, indent, type }, ...rest] = items;\n const [tag, attribute] = getListType(type);\n if (indent > lastIndent) {\n types.push(type);\n if (indent === lastIndent + 1) {\n return `<${tag}>${convertHTML(\n child,\n offset,\n length,\n )}${convertListHTML(rest, indent, types)}`;\n }\n return `<${tag}>
  • ${convertListHTML(items, lastIndent + 1, types)}`;\n }\n const previousType = types[types.length - 1];\n if (indent === lastIndent && type === previousType) {\n return `
  • ${convertHTML(\n child,\n offset,\n length,\n )}${convertListHTML(rest, indent, types)}`;\n }\n const [endTag] = getListType(types.pop());\n return `${convertListHTML(items, lastIndent - 1, types)}`;\n}\n\nfunction convertHTML(\n blot: Blot,\n index: number,\n length: number,\n isRoot = false,\n): string {\n if ('html' in blot && typeof blot.html === 'function') {\n return blot.html(index, length);\n }\n if (blot instanceof TextBlot) {\n return escapeText(blot.value().slice(index, index + length));\n }\n if (blot instanceof ParentBlot) {\n // TODO fix API\n if (blot.statics.blotName === 'list-container') {\n const items: any[] = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n const formats =\n 'formats' in child && typeof child.formats === 'function'\n ? child.formats()\n : {};\n items.push({\n child,\n offset,\n length: childLength,\n indent: formats.indent || 0,\n type: formats.list,\n });\n });\n return convertListHTML(items, -1, []);\n }\n const parts: string[] = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n parts.push(convertHTML(child, offset, childLength));\n });\n if (isRoot || blot.statics.blotName === 'list') {\n return parts.join('');\n }\n const { outerHTML, innerHTML } = blot.domNode as Element;\n const [start, end] = outerHTML.split(`>${innerHTML}<`);\n // TODO cleanup\n if (start === '${parts.join('')}<${end}`;\n }\n return `${start}>${parts.join('')}<${end}`;\n }\n return blot.domNode instanceof Element ? blot.domNode.outerHTML : '';\n}\n\nfunction combineFormats(\n formats: Record,\n combined: Record,\n): Record {\n return Object.keys(combined).reduce(\n (merged, name) => {\n if (formats[name] == null) return merged;\n const combinedValue = combined[name];\n if (combinedValue === formats[name]) {\n merged[name] = combinedValue;\n } else if (Array.isArray(combinedValue)) {\n if (combinedValue.indexOf(formats[name]) < 0) {\n merged[name] = combinedValue.concat([formats[name]]);\n } else {\n // If style already exists, don't add to an array, but don't lose other styles\n merged[name] = combinedValue;\n }\n } else {\n merged[name] = [combinedValue, formats[name]];\n }\n return merged;\n },\n {} as Record,\n );\n}\n\nfunction getListType(type: string | undefined) {\n const tag = type === 'ordered' ? 'ol' : 'ul';\n switch (type) {\n case 'checked':\n return [tag, ' data-list=\"checked\"'];\n case 'unchecked':\n return [tag, ' data-list=\"unchecked\"'];\n default:\n return [tag, ''];\n }\n}\n\nfunction normalizeDelta(delta: Delta) {\n return delta.reduce((normalizedDelta, op) => {\n if (typeof op.insert === 'string') {\n const text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return normalizedDelta.insert(text, op.attributes);\n }\n return normalizedDelta.push(op);\n }, new Delta());\n}\n\nfunction shiftRange({ index, length }: Range, amount: number) {\n return new Range(index + amount, length);\n}\n\nfunction splitOpLines(ops: Op[]) {\n const split: Op[] = [];\n ops.forEach((op) => {\n if (typeof op.insert === 'string') {\n const lines = op.insert.split('\\n');\n lines.forEach((line, index) => {\n if (index) split.push({ insert: '\\n', attributes: op.attributes });\n if (line) split.push({ insert: line, attributes: op.attributes });\n });\n } else {\n split.push(op);\n }\n });\n\n return split;\n}\n\nexport default Editor;\n", "import type Quill from './quill.js';\n\nabstract class Module {\n static DEFAULTS = {};\n\n constructor(\n public quill: Quill,\n protected options: Partial = {},\n ) {}\n}\n\nexport default Module;\n", "import type { ScrollBlot } from 'parchment';\nimport { EmbedBlot } from 'parchment';\nimport TextBlot from './text.js';\n\nconst GUARD_TEXT = '\\uFEFF';\n\nexport interface EmbedContextRange {\n startNode: Node | Text;\n startOffset: number;\n endNode?: Node | Text;\n endOffset?: number;\n}\n\nclass Embed extends EmbedBlot {\n contentNode: HTMLSpanElement;\n leftGuard: Text;\n rightGuard: Text;\n\n constructor(scroll: ScrollBlot, node: Node) {\n super(scroll, node);\n this.contentNode = document.createElement('span');\n this.contentNode.setAttribute('contenteditable', 'false');\n Array.from(this.domNode.childNodes).forEach((childNode) => {\n this.contentNode.appendChild(childNode);\n });\n this.leftGuard = document.createTextNode(GUARD_TEXT);\n this.rightGuard = document.createTextNode(GUARD_TEXT);\n this.domNode.appendChild(this.leftGuard);\n this.domNode.appendChild(this.contentNode);\n this.domNode.appendChild(this.rightGuard);\n }\n\n index(node: Node, offset: number) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return super.index(node, offset);\n }\n\n restore(node: Text): EmbedContextRange | null {\n let range: EmbedContextRange | null = null;\n let textNode: Text;\n const text = node.data.split(GUARD_TEXT).join('');\n if (node === this.leftGuard) {\n if (this.prev instanceof TextBlot) {\n const prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length,\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(this.scroll.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length,\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof TextBlot) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length,\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(this.scroll.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length,\n };\n }\n }\n node.data = GUARD_TEXT;\n return range;\n }\n\n update(mutations: MutationRecord[], context: Record) {\n mutations.forEach((mutation) => {\n if (\n mutation.type === 'characterData' &&\n (mutation.target === this.leftGuard ||\n mutation.target === this.rightGuard)\n ) {\n const range = this.restore(mutation.target as Text);\n if (range) context.range = range;\n }\n });\n }\n}\n\nexport default Embed;\n", "import Embed from '../blots/embed.js';\nimport type Scroll from '../blots/scroll.js';\nimport Emitter from './emitter.js';\n\nclass Composition {\n isComposing = false;\n\n constructor(\n private scroll: Scroll,\n private emitter: Emitter,\n ) {\n this.setupListeners();\n }\n\n private setupListeners() {\n this.scroll.domNode.addEventListener('compositionstart', (event) => {\n if (!this.isComposing) {\n this.handleCompositionStart(event);\n }\n });\n\n this.scroll.domNode.addEventListener('compositionend', (event) => {\n if (this.isComposing) {\n // Webkit makes DOM changes after compositionend, so we use microtask to\n // ensure the order.\n // https://bugs.webkit.org/show_bug.cgi?id=31902\n queueMicrotask(() => {\n this.handleCompositionEnd(event);\n });\n }\n });\n }\n\n private handleCompositionStart(event: CompositionEvent) {\n const blot =\n event.target instanceof Node\n ? this.scroll.find(event.target, true)\n : null;\n\n if (blot && !(blot instanceof Embed)) {\n this.emitter.emit(Emitter.events.COMPOSITION_BEFORE_START, event);\n this.scroll.batchStart();\n this.emitter.emit(Emitter.events.COMPOSITION_START, event);\n this.isComposing = true;\n }\n }\n\n private handleCompositionEnd(event: CompositionEvent) {\n this.emitter.emit(Emitter.events.COMPOSITION_BEFORE_END, event);\n this.scroll.batchEnd();\n this.emitter.emit(Emitter.events.COMPOSITION_END, event);\n this.isComposing = false;\n }\n}\n\nexport default Composition;\n", "import type Quill from '../core.js';\nimport type Clipboard from '../modules/clipboard.js';\nimport type History from '../modules/history.js';\nimport type Keyboard from '../modules/keyboard.js';\nimport type { ToolbarProps } from '../modules/toolbar.js';\nimport type Uploader from '../modules/uploader.js';\n\nexport interface ThemeOptions {\n modules: Record & {\n toolbar?: null | ToolbarProps;\n };\n}\n\nclass Theme {\n static DEFAULTS: ThemeOptions = {\n modules: {},\n };\n\n static themes = {\n default: Theme,\n };\n\n modules: ThemeOptions['modules'] = {};\n\n constructor(\n protected quill: Quill,\n protected options: ThemeOptions,\n ) {}\n\n init() {\n Object.keys(this.options.modules).forEach((name) => {\n if (this.modules[name] == null) {\n this.addModule(name);\n }\n });\n }\n\n addModule(name: 'clipboard'): Clipboard;\n addModule(name: 'keyboard'): Keyboard;\n addModule(name: 'uploader'): Uploader;\n addModule(name: 'history'): History;\n addModule(name: string): unknown;\n addModule(name: string) {\n // @ts-expect-error\n const ModuleClass = this.quill.constructor.import(`modules/${name}`);\n this.modules[name] = new ModuleClass(\n this.quill,\n this.options.modules[name] || {},\n );\n return this.modules[name];\n }\n}\n\nexport interface ThemeConstructor {\n new (quill: Quill, options: unknown): Theme;\n DEFAULTS: ThemeOptions;\n}\n\nexport default Theme;\n", "export type Rect = {\n top: number;\n right: number;\n bottom: number;\n left: number;\n};\n\nconst getParentElement = (element: Node): Element | null =>\n element.parentElement || (element.getRootNode() as ShadowRoot).host || null;\n\nconst getElementRect = (element: Element): Rect => {\n const rect = element.getBoundingClientRect();\n const scaleX =\n ('offsetWidth' in element &&\n Math.abs(rect.width) / (element as HTMLElement).offsetWidth) ||\n 1;\n const scaleY =\n ('offsetHeight' in element &&\n Math.abs(rect.height) / (element as HTMLElement).offsetHeight) ||\n 1;\n return {\n top: rect.top,\n right: rect.left + element.clientWidth * scaleX,\n bottom: rect.top + element.clientHeight * scaleY,\n left: rect.left,\n };\n};\n\nconst paddingValueToInt = (value: string) => {\n const number = parseInt(value, 10);\n return Number.isNaN(number) ? 0 : number;\n};\n\n// Follow the steps described in https://www.w3.org/TR/cssom-view-1/#element-scrolling-members,\n// assuming that the scroll option is set to 'nearest'.\nconst getScrollDistance = (\n targetStart: number,\n targetEnd: number,\n scrollStart: number,\n scrollEnd: number,\n scrollPaddingStart: number,\n scrollPaddingEnd: number,\n) => {\n if (targetStart < scrollStart && targetEnd > scrollEnd) {\n return 0;\n }\n\n if (targetStart < scrollStart) {\n return -(scrollStart - targetStart + scrollPaddingStart);\n }\n\n if (targetEnd > scrollEnd) {\n return targetEnd - targetStart > scrollEnd - scrollStart\n ? targetStart + scrollPaddingStart - scrollStart\n : targetEnd - scrollEnd + scrollPaddingEnd;\n }\n return 0;\n};\n\nconst scrollRectIntoView = (root: HTMLElement, targetRect: Rect) => {\n const document = root.ownerDocument;\n\n let rect = targetRect;\n\n let current: Element | null = root;\n while (current) {\n const isDocumentBody: boolean = current === document.body;\n const bounding = isDocumentBody\n ? {\n top: 0,\n right:\n window.visualViewport?.width ??\n document.documentElement.clientWidth,\n bottom:\n window.visualViewport?.height ??\n document.documentElement.clientHeight,\n left: 0,\n }\n : getElementRect(current);\n\n const style = getComputedStyle(current);\n const scrollDistanceX = getScrollDistance(\n rect.left,\n rect.right,\n bounding.left,\n bounding.right,\n paddingValueToInt(style.scrollPaddingLeft),\n paddingValueToInt(style.scrollPaddingRight),\n );\n const scrollDistanceY = getScrollDistance(\n rect.top,\n rect.bottom,\n bounding.top,\n bounding.bottom,\n paddingValueToInt(style.scrollPaddingTop),\n paddingValueToInt(style.scrollPaddingBottom),\n );\n if (scrollDistanceX || scrollDistanceY) {\n if (isDocumentBody) {\n document.defaultView?.scrollBy(scrollDistanceX, scrollDistanceY);\n } else {\n const { scrollLeft, scrollTop } = current;\n if (scrollDistanceY) {\n current.scrollTop += scrollDistanceY;\n }\n if (scrollDistanceX) {\n current.scrollLeft += scrollDistanceX;\n }\n const scrolledLeft = current.scrollLeft - scrollLeft;\n const scrolledTop = current.scrollTop - scrollTop;\n rect = {\n left: rect.left - scrolledLeft,\n top: rect.top - scrolledTop,\n right: rect.right - scrolledLeft,\n bottom: rect.bottom - scrolledTop,\n };\n }\n }\n\n current =\n isDocumentBody || style.position === 'fixed'\n ? null\n : getParentElement(current);\n }\n};\n\nexport default scrollRectIntoView;\n", "import { Registry } from 'parchment';\n\nconst MAX_REGISTER_ITERATIONS = 100;\nconst CORE_FORMATS = ['block', 'break', 'cursor', 'inline', 'scroll', 'text'];\n\nconst createRegistryWithFormats = (\n formats: string[],\n sourceRegistry: Registry,\n debug: { error: (errorMessage: string) => void },\n) => {\n const registry = new Registry();\n CORE_FORMATS.forEach((name) => {\n const coreBlot = sourceRegistry.query(name);\n if (coreBlot) registry.register(coreBlot);\n });\n\n formats.forEach((name) => {\n let format = sourceRegistry.query(name);\n if (!format) {\n debug.error(\n `Cannot register \"${name}\" specified in \"formats\" config. Are you sure it was registered?`,\n );\n }\n let iterations = 0;\n while (format) {\n registry.register(format);\n format = 'blotName' in format ? format.requiredContainer ?? null : null;\n\n iterations += 1;\n if (iterations > MAX_REGISTER_ITERATIONS) {\n debug.error(\n `Cycle detected in registering blot requiredContainer: \"${name}\"`,\n );\n break;\n }\n }\n });\n\n return registry;\n};\n\nexport default createRegistryWithFormats;\n", "import { merge } from 'lodash-es';\nimport * as Parchment from 'parchment';\nimport type { Op } from 'quill-delta';\nimport Delta from 'quill-delta';\nimport type { BlockEmbed } from '../blots/block.js';\nimport type Block from '../blots/block.js';\nimport type Scroll from '../blots/scroll.js';\nimport type Clipboard from '../modules/clipboard.js';\nimport type History from '../modules/history.js';\nimport type Keyboard from '../modules/keyboard.js';\nimport type Uploader from '../modules/uploader.js';\nimport Editor from './editor.js';\nimport Emitter from './emitter.js';\nimport type { EmitterSource } from './emitter.js';\nimport instances from './instances.js';\nimport logger from './logger.js';\nimport type { DebugLevel } from './logger.js';\nimport Module from './module.js';\nimport Selection, { Range } from './selection.js';\nimport type { Bounds } from './selection.js';\nimport Composition from './composition.js';\nimport Theme from './theme.js';\nimport type { ThemeConstructor } from './theme.js';\nimport scrollRectIntoView from './utils/scrollRectIntoView.js';\nimport type { Rect } from './utils/scrollRectIntoView.js';\nimport createRegistryWithFormats from './utils/createRegistryWithFormats.js';\n\nconst debug = logger('quill');\n\nconst globalRegistry = new Parchment.Registry();\nParchment.ParentBlot.uiClass = 'ql-ui';\n\n/**\n * Options for initializing a Quill instance\n */\nexport interface QuillOptions {\n theme?: string;\n debug?: DebugLevel | boolean;\n registry?: Parchment.Registry;\n /**\n * Whether to disable the editing\n * @default false\n */\n readOnly?: boolean;\n\n /**\n * Placeholder text to display when the editor is empty\n * @default \"\"\n */\n placeholder?: string;\n bounds?: HTMLElement | string | null;\n modules?: Record;\n\n /**\n * A list of formats that are recognized and can exist within the editor contents.\n * `null` means all formats are allowed.\n * @default null\n */\n formats?: string[] | null;\n}\n\n/**\n * Similar to QuillOptions, but with all properties expanded to their default values,\n * and all selectors resolved to HTMLElements.\n */\nexport interface ExpandedQuillOptions\n extends Omit {\n theme: ThemeConstructor;\n registry: Parchment.Registry;\n container: HTMLElement;\n modules: Record;\n bounds?: HTMLElement | null;\n readOnly: boolean;\n}\n\nclass Quill {\n static DEFAULTS = {\n bounds: null,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true,\n uploader: true,\n },\n placeholder: '',\n readOnly: false,\n registry: globalRegistry,\n theme: 'default',\n } satisfies Partial;\n static events = Emitter.events;\n static sources = Emitter.sources;\n static version = typeof QUILL_VERSION === 'undefined' ? 'dev' : QUILL_VERSION;\n\n static imports: Record = {\n delta: Delta,\n parchment: Parchment,\n 'core/module': Module,\n 'core/theme': Theme,\n };\n\n static debug(limit: DebugLevel | boolean) {\n if (limit === true) {\n limit = 'log';\n }\n logger.level(limit);\n }\n\n static find(node: Node, bubble = false) {\n return instances.get(node) || globalRegistry.find(node, bubble);\n }\n\n static import(name: 'core/module'): typeof Module;\n static import(name: `themes/${string}`): typeof Theme;\n static import(name: 'parchment'): typeof Parchment;\n static import(name: 'delta'): typeof Delta;\n static import(name: string): unknown;\n static import(name: string) {\n if (this.imports[name] == null) {\n debug.error(`Cannot import ${name}. Are you sure it was registered?`);\n }\n return this.imports[name];\n }\n\n static register(\n targets: Record<\n string,\n | Parchment.RegistryDefinition\n | Record // any objects\n | Theme\n | Module\n | Function // ES5 constructors\n >,\n overwrite?: boolean,\n ): void;\n static register(\n target: Parchment.RegistryDefinition,\n overwrite?: boolean,\n ): void;\n static register(path: string, target: any, overwrite?: boolean): void;\n static register(...args: any[]): void {\n if (typeof args[0] !== 'string') {\n const target = args[0];\n const overwrite = !!args[1];\n\n const name = 'attrName' in target ? target.attrName : target.blotName;\n if (typeof name === 'string') {\n // Shortcut for formats:\n // register(Blot | Attributor, overwrite)\n this.register(`formats/${name}`, target, overwrite);\n } else {\n Object.keys(target).forEach((key) => {\n this.register(key, target[key], overwrite);\n });\n }\n } else {\n const path = args[0];\n const target = args[1];\n const overwrite = !!args[2];\n\n if (this.imports[path] != null && !overwrite) {\n debug.warn(`Overwriting ${path} with`, target);\n }\n this.imports[path] = target;\n if (\n (path.startsWith('blots/') || path.startsWith('formats/')) &&\n target &&\n typeof target !== 'boolean' &&\n target.blotName !== 'abstract'\n ) {\n globalRegistry.register(target);\n }\n if (typeof target.register === 'function') {\n target.register(globalRegistry);\n }\n }\n }\n\n container: HTMLElement;\n root: HTMLDivElement;\n scroll: Scroll;\n emitter: Emitter;\n protected allowReadOnlyEdits: boolean;\n editor: Editor;\n composition: Composition;\n selection: Selection;\n\n theme: Theme;\n keyboard: Keyboard;\n clipboard: Clipboard;\n history: History;\n uploader: Uploader;\n\n options: ExpandedQuillOptions;\n\n constructor(container: HTMLElement | string, options: QuillOptions = {}) {\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n debug.error('Invalid Quill container', container);\n return;\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n const html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n instances.set(this.container, this);\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.emitter = new Emitter();\n const scrollBlotName = Parchment.ScrollBlot.blotName;\n const ScrollBlot = this.options.registry.query(scrollBlotName);\n if (!ScrollBlot || !('blotName' in ScrollBlot)) {\n throw new Error(\n `Cannot initialize Quill without \"${scrollBlotName}\" blot`,\n );\n }\n this.scroll = new ScrollBlot(this.options.registry, this.root, {\n emitter: this.emitter,\n }) as Scroll;\n this.editor = new Editor(this.scroll);\n this.selection = new Selection(this.scroll, this.emitter);\n this.composition = new Composition(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options); // eslint-disable-line new-cap\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.uploader = this.theme.addModule('uploader');\n this.theme.addModule('input');\n this.theme.addModule('uiNode');\n this.theme.init();\n this.emitter.on(Emitter.events.EDITOR_CHANGE, (type) => {\n if (type === Emitter.events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(Emitter.events.SCROLL_UPDATE, (source, mutations) => {\n const oldRange = this.selection.lastRange;\n const [newRange] = this.selection.getRange();\n const selectionInfo =\n oldRange && newRange ? { oldRange, newRange } : undefined;\n modify.call(\n this,\n () => this.editor.update(null, mutations, selectionInfo),\n source,\n );\n });\n this.emitter.on(Emitter.events.SCROLL_EMBED_UPDATE, (blot, delta) => {\n const oldRange = this.selection.lastRange;\n const [newRange] = this.selection.getRange();\n const selectionInfo =\n oldRange && newRange ? { oldRange, newRange } : undefined;\n modify.call(\n this,\n () => {\n const change = new Delta()\n .retain(blot.offset(this))\n .retain({ [blot.statics.blotName]: delta });\n return this.editor.update(change, [], selectionInfo);\n },\n Quill.sources.USER,\n );\n });\n if (html) {\n const contents = this.clipboard.convert({\n html: `${html}


    `,\n text: '\\n',\n });\n this.setContents(contents);\n }\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n this.allowReadOnlyEdits = false;\n }\n\n addContainer(container: string, refNode?: Node | null): HTMLDivElement;\n addContainer(container: HTMLElement, refNode?: Node | null): HTMLElement;\n addContainer(\n container: string | HTMLElement,\n refNode: Node | null = null,\n ): HTMLDivElement | HTMLElement {\n if (typeof container === 'string') {\n const className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(range: Range, source?: EmitterSource): Delta;\n deleteText(index: number, length: number, source?: EmitterSource): Delta;\n deleteText(\n index: number | Range,\n length?: number | EmitterSource,\n source?: EmitterSource,\n ): Delta {\n // @ts-expect-error\n [index, length, , source] = overload(index, length, source);\n return modify.call(\n this,\n () => {\n return this.editor.deleteText(index, length);\n },\n source,\n index,\n -1 * length,\n );\n }\n\n disable() {\n this.enable(false);\n }\n\n editReadOnly(modifier: () => T): T {\n this.allowReadOnlyEdits = true;\n const value = modifier();\n this.allowReadOnlyEdits = false;\n return value;\n }\n\n enable(enabled = true) {\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus(options: { preventScroll?: boolean } = {}) {\n this.selection.focus();\n if (!options.preventScroll) {\n this.scrollSelectionIntoView();\n }\n }\n\n format(\n name: string,\n value: unknown,\n source: EmitterSource = Emitter.sources.API,\n ): Delta {\n return modify.call(\n this,\n () => {\n const range = this.getSelection(true);\n let change = new Delta();\n if (range == null) return change;\n if (this.scroll.query(name, Parchment.Scope.BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, {\n [name]: value,\n });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, {\n [name]: value,\n });\n }\n this.setSelection(range, Emitter.sources.SILENT);\n return change;\n },\n source,\n );\n }\n\n formatLine(\n index: number,\n length: number,\n formats: Record,\n source?: EmitterSource,\n ): Delta;\n formatLine(\n index: number,\n length: number,\n name: string,\n value?: unknown,\n source?: EmitterSource,\n ): Delta;\n formatLine(\n index: number,\n length: number,\n name: string | Record,\n value?: unknown | EmitterSource,\n source?: EmitterSource,\n ): Delta {\n let formats: Record;\n // eslint-disable-next-line prefer-const\n [index, length, formats, source] = overload(\n index,\n length,\n // @ts-expect-error\n name,\n value,\n source,\n );\n return modify.call(\n this,\n () => {\n return this.editor.formatLine(index, length, formats);\n },\n source,\n index,\n 0,\n );\n }\n\n formatText(\n range: Range,\n name: string,\n value: unknown,\n source?: EmitterSource,\n ): Delta;\n formatText(\n index: number,\n length: number,\n name: string,\n value: unknown,\n source?: EmitterSource,\n ): Delta;\n formatText(\n index: number,\n length: number,\n formats: Record,\n source?: EmitterSource,\n ): Delta;\n formatText(\n index: number | Range,\n length: number | string,\n name: string | unknown,\n value?: unknown | EmitterSource,\n source?: EmitterSource,\n ): Delta {\n let formats: Record;\n // eslint-disable-next-line prefer-const\n [index, length, formats, source] = overload(\n // @ts-expect-error\n index,\n length,\n name,\n value,\n source,\n );\n return modify.call(\n this,\n () => {\n return this.editor.formatText(index, length, formats);\n },\n source,\n index,\n 0,\n );\n }\n\n getBounds(index: number | Range, length = 0): Bounds | null {\n let bounds: Bounds | null = null;\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n if (!bounds) return null;\n const containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width,\n };\n }\n\n getContents(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getContents(index, length);\n }\n\n getFormat(index?: number, length?: number): { [format: string]: unknown };\n getFormat(range?: Range): {\n [format: string]: unknown;\n };\n getFormat(\n index: Range | number = this.getSelection(true),\n length = 0,\n ): { [format: string]: unknown } {\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n }\n return this.editor.getFormat(index.index, index.length);\n }\n\n getIndex(blot: Parchment.Blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index: number) {\n return this.scroll.leaf(index);\n }\n\n getLine(index: number) {\n return this.scroll.line(index);\n }\n\n getLines(range: Range): (Block | BlockEmbed)[];\n getLines(index?: number, length?: number): (Block | BlockEmbed)[];\n getLines(\n index: Range | number = 0,\n length = Number.MAX_VALUE,\n ): (Block | BlockEmbed)[] {\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n }\n return this.scroll.lines(index, length);\n }\n\n getModule(name: string) {\n return this.theme.modules[name];\n }\n\n getSelection(focus: true): Range;\n getSelection(focus?: boolean): Range | null;\n getSelection(focus = false): Range | null {\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n\n getSemanticHTML(range: Range): string;\n getSemanticHTML(index?: number, length?: number): string;\n getSemanticHTML(index: Range | number = 0, length?: number) {\n if (typeof index === 'number') {\n length = length ?? this.getLength() - index;\n }\n // @ts-expect-error\n [index, length] = overload(index, length);\n return this.editor.getHTML(index, length);\n }\n\n getText(range?: Range): string;\n getText(index?: number, length?: number): string;\n getText(index: Range | number = 0, length?: number): string {\n if (typeof index === 'number') {\n length = length ?? this.getLength() - index;\n }\n // @ts-expect-error\n [index, length] = overload(index, length);\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(\n index: number,\n embed: string,\n value: unknown,\n source: EmitterSource = Quill.sources.API,\n ): Delta {\n return modify.call(\n this,\n () => {\n return this.editor.insertEmbed(index, embed, value);\n },\n source,\n index,\n );\n }\n\n insertText(index: number, text: string, source?: EmitterSource): Delta;\n insertText(\n index: number,\n text: string,\n formats: Record,\n source?: EmitterSource,\n ): Delta;\n insertText(\n index: number,\n text: string,\n name: string,\n value: unknown,\n source?: EmitterSource,\n ): Delta;\n insertText(\n index: number,\n text: string,\n name?: string | Record | EmitterSource,\n value?: unknown,\n source?: EmitterSource,\n ): Delta {\n let formats: Record;\n // eslint-disable-next-line prefer-const\n // @ts-expect-error\n [index, , formats, source] = overload(index, 0, name, value, source);\n return modify.call(\n this,\n () => {\n return this.editor.insertText(index, text, formats);\n },\n source,\n index,\n text.length,\n );\n }\n\n isEnabled() {\n return this.scroll.isEnabled();\n }\n\n off(...args: Parameters<(typeof Emitter)['prototype']['off']>) {\n return this.emitter.off(...args);\n }\n\n on(\n event: (typeof Emitter)['events']['TEXT_CHANGE'],\n handler: (delta: Delta, oldContent: Delta, source: EmitterSource) => void,\n ): Emitter;\n on(\n event: (typeof Emitter)['events']['SELECTION_CHANGE'],\n handler: (range: Range, oldRange: Range, source: EmitterSource) => void,\n ): Emitter;\n on(\n event: (typeof Emitter)['events']['EDITOR_CHANGE'],\n handler: (\n ...args:\n | [\n (typeof Emitter)['events']['TEXT_CHANGE'],\n Delta,\n Delta,\n EmitterSource,\n ]\n | [\n (typeof Emitter)['events']['SELECTION_CHANGE'],\n Range,\n Range,\n EmitterSource,\n ]\n ) => void,\n ): Emitter;\n on(event: string, ...args: unknown[]): Emitter;\n on(...args: Parameters<(typeof Emitter)['prototype']['on']>): Emitter {\n return this.emitter.on(...args);\n }\n\n once(...args: Parameters<(typeof Emitter)['prototype']['once']>) {\n return this.emitter.once(...args);\n }\n\n removeFormat(index: number, length: number, source?: EmitterSource): Delta {\n [index, length, , source] = overload(index, length, source);\n return modify.call(\n this,\n () => {\n return this.editor.removeFormat(index, length);\n },\n source,\n index,\n );\n }\n\n scrollRectIntoView(rect: Rect) {\n scrollRectIntoView(this.root, rect);\n }\n\n /**\n * @deprecated Use Quill#scrollSelectionIntoView() instead.\n */\n scrollIntoView() {\n console.warn(\n 'Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead.',\n );\n this.scrollSelectionIntoView();\n }\n\n /**\n * Scroll the current selection into the visible area.\n * If the selection is already visible, no scrolling will occur.\n */\n scrollSelectionIntoView() {\n const range = this.selection.lastRange;\n const bounds = range && this.selection.getBounds(range.index, range.length);\n if (bounds) {\n this.scrollRectIntoView(bounds);\n }\n }\n\n setContents(\n delta: Delta | Op[],\n source: EmitterSource = Emitter.sources.API,\n ): Delta {\n return modify.call(\n this,\n () => {\n delta = new Delta(delta);\n const length = this.getLength();\n // Quill will set empty editor to \\n\n const delete1 = this.editor.deleteText(0, length);\n const applied = this.editor.insertContents(0, delta);\n // Remove extra \\n from empty editor initialization\n const delete2 = this.editor.deleteText(this.getLength() - 1, 1);\n return delete1.compose(applied).compose(delete2);\n },\n source,\n );\n }\n setSelection(range: Range | null, source?: EmitterSource): void;\n setSelection(index: number, source?: EmitterSource): void;\n setSelection(index: number, length?: number, source?: EmitterSource): void;\n setSelection(index: number, source?: EmitterSource): void;\n setSelection(\n index: Range | null | number,\n length?: EmitterSource | number,\n source?: EmitterSource,\n ): void {\n if (index == null) {\n // @ts-expect-error https://github.com/microsoft/TypeScript/issues/22609\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n // @ts-expect-error\n [index, length, , source] = overload(index, length, source);\n this.selection.setRange(new Range(Math.max(0, index), length), source);\n if (source !== Emitter.sources.SILENT) {\n this.scrollSelectionIntoView();\n }\n }\n }\n\n setText(text: string, source: EmitterSource = Emitter.sources.API) {\n const delta = new Delta().insert(text);\n return this.setContents(delta, source);\n }\n\n update(source: EmitterSource = Emitter.sources.USER) {\n const change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n // TODO this is usually undefined\n return change;\n }\n\n updateContents(\n delta: Delta | Op[],\n source: EmitterSource = Emitter.sources.API,\n ): Delta {\n return modify.call(\n this,\n () => {\n delta = new Delta(delta);\n return this.editor.applyDelta(delta);\n },\n source,\n true,\n );\n }\n}\n\nfunction resolveSelector(selector: string | HTMLElement | null | undefined) {\n return typeof selector === 'string'\n ? document.querySelector(selector)\n : selector;\n}\n\nfunction expandModuleConfig(config: Record | undefined) {\n return Object.entries(config ?? {}).reduce(\n (expanded, [key, value]) => ({\n ...expanded,\n [key]: value === true ? {} : value,\n }),\n {} as Record,\n );\n}\n\nfunction omitUndefinedValuesFromOptions(obj: QuillOptions) {\n return Object.fromEntries(\n Object.entries(obj).filter((entry) => entry[1] !== undefined),\n );\n}\n\nfunction expandConfig(\n containerOrSelector: HTMLElement | string,\n options: QuillOptions,\n): ExpandedQuillOptions {\n const container = resolveSelector(containerOrSelector);\n if (!container) {\n throw new Error('Invalid Quill container');\n }\n\n const shouldUseDefaultTheme =\n !options.theme || options.theme === Quill.DEFAULTS.theme;\n const theme = shouldUseDefaultTheme\n ? Theme\n : Quill.import(`themes/${options.theme}`);\n if (!theme) {\n throw new Error(`Invalid theme ${options.theme}. Did you register it?`);\n }\n\n const { modules: quillModuleDefaults, ...quillDefaults } = Quill.DEFAULTS;\n const { modules: themeModuleDefaults, ...themeDefaults } = theme.DEFAULTS;\n\n let userModuleOptions = expandModuleConfig(options.modules);\n // Special case toolbar shorthand\n if (\n userModuleOptions != null &&\n userModuleOptions.toolbar &&\n userModuleOptions.toolbar.constructor !== Object\n ) {\n userModuleOptions = {\n ...userModuleOptions,\n toolbar: { container: userModuleOptions.toolbar },\n };\n }\n\n const modules: ExpandedQuillOptions['modules'] = merge(\n {},\n expandModuleConfig(quillModuleDefaults),\n expandModuleConfig(themeModuleDefaults),\n userModuleOptions,\n );\n\n const config = {\n ...quillDefaults,\n ...omitUndefinedValuesFromOptions(themeDefaults),\n ...omitUndefinedValuesFromOptions(options),\n };\n\n let registry = options.registry;\n if (registry) {\n if (options.formats) {\n debug.warn('Ignoring \"formats\" option because \"registry\" is specified');\n }\n } else {\n registry = options.formats\n ? createRegistryWithFormats(options.formats, config.registry, debug)\n : config.registry;\n }\n\n return {\n ...config,\n registry,\n container,\n theme,\n modules: Object.entries(modules).reduce(\n (modulesWithDefaults, [name, value]) => {\n if (!value) return modulesWithDefaults;\n\n const moduleClass = Quill.import(`modules/${name}`);\n if (moduleClass == null) {\n debug.error(\n `Cannot load ${name} module. Are you sure you registered it?`,\n );\n return modulesWithDefaults;\n }\n return {\n ...modulesWithDefaults,\n // @ts-expect-error\n [name]: merge({}, moduleClass.DEFAULTS || {}, value),\n };\n },\n {},\n ),\n bounds: resolveSelector(config.bounds),\n };\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(\n modifier: () => Delta,\n source: EmitterSource,\n index: number | boolean,\n shift: number | null,\n) {\n if (\n !this.isEnabled() &&\n source === Emitter.sources.USER &&\n !this.allowReadOnlyEdits\n ) {\n return new Delta();\n }\n let range = index == null ? null : this.getSelection();\n const oldDelta = this.editor.delta;\n const change = modifier();\n if (range != null) {\n if (index === true) {\n index = range.index; // eslint-disable-line prefer-destructuring\n }\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n // @ts-expect-error index should always be number\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, Emitter.sources.SILENT);\n }\n if (change.length() > 0) {\n const args = [Emitter.events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n return change;\n}\n\ntype NormalizedIndexLength = [\n number,\n number,\n Record,\n EmitterSource,\n];\nfunction overload(index: number, source?: EmitterSource): NormalizedIndexLength;\nfunction overload(\n index: number,\n length: number,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n index: number,\n length: number,\n format: string,\n value: unknown,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n index: number,\n length: number,\n format: Record,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(range: Range, source?: EmitterSource): NormalizedIndexLength;\nfunction overload(\n range: Range,\n format: string,\n value: unknown,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n range: Range,\n format: Record,\n source?: EmitterSource,\n): NormalizedIndexLength;\nfunction overload(\n index: Range | number,\n length?: number | string | Record | EmitterSource,\n name?: string | unknown | Record | EmitterSource,\n value?: unknown | EmitterSource,\n source?: EmitterSource,\n): NormalizedIndexLength {\n let formats: Record = {};\n // @ts-expect-error\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n // @ts-expect-error\n source = value;\n value = name;\n name = length;\n // @ts-expect-error\n length = index.length; // eslint-disable-line prefer-destructuring\n // @ts-expect-error\n index = index.index; // eslint-disable-line prefer-destructuring\n } else {\n // @ts-expect-error\n length = index.length; // eslint-disable-line prefer-destructuring\n // @ts-expect-error\n index = index.index; // eslint-disable-line prefer-destructuring\n }\n } else if (typeof length !== 'number') {\n // @ts-expect-error\n source = value;\n value = name;\n name = length;\n length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if (typeof name === 'object') {\n // @ts-expect-error Fix me later\n formats = name;\n // @ts-expect-error\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n // @ts-expect-error\n source = name;\n }\n }\n // Handle optional source\n source = source || Emitter.sources.API;\n // @ts-expect-error\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range: Range, change: Delta, source?: EmitterSource): Range;\nfunction shiftRange(\n range: Range,\n index: number,\n length?: number,\n source?: EmitterSource,\n): Range;\nfunction shiftRange(\n range: Range,\n index: number | Delta,\n lengthOrSource?: number | EmitterSource,\n source?: EmitterSource,\n) {\n const length = typeof lengthOrSource === 'number' ? lengthOrSource : 0;\n if (range == null) return null;\n let start;\n let end;\n // @ts-expect-error -- TODO: add a better type guard around `index`\n if (index && typeof index.transformPosition === 'function') {\n [start, end] = [range.index, range.index + range.length].map((pos) =>\n // @ts-expect-error -- TODO: add a better type guard around `index`\n index.transformPosition(pos, source !== Emitter.sources.USER),\n );\n } else {\n [start, end] = [range.index, range.index + range.length].map((pos) => {\n // @ts-expect-error -- TODO: add a better type guard around `index`\n if (pos < index || (pos === index && source === Emitter.sources.USER))\n return pos;\n if (length >= 0) {\n return pos + length;\n }\n // @ts-expect-error -- TODO: add a better type guard around `index`\n return Math.max(index, pos + length);\n });\n }\n return new Range(start, end - start);\n}\n\nexport type { Bounds, DebugLevel, EmitterSource };\nexport { Parchment, Range };\n\nexport { globalRegistry, expandConfig, overload, Quill as default };\n", "import { ContainerBlot } from 'parchment';\n\nclass Container extends ContainerBlot {}\n\nexport default Container;\n", "import { ContainerBlot, LeafBlot, Scope, ScrollBlot } from 'parchment';\nimport type { Blot, Parent, EmbedBlot, ParentBlot, Registry } from 'parchment';\nimport Delta, { AttributeMap, Op } from 'quill-delta';\nimport Emitter from '../core/emitter.js';\nimport type { EmitterSource } from '../core/emitter.js';\nimport Block, { BlockEmbed, bubbleFormats } from './block.js';\nimport Break from './break.js';\nimport Container from './container.js';\n\ntype RenderBlock =\n | {\n type: 'blockEmbed';\n attributes: AttributeMap;\n key: string;\n value: unknown;\n }\n | { type: 'block'; attributes: AttributeMap; delta: Delta };\n\nfunction isLine(blot: unknown): blot is Block | BlockEmbed {\n return blot instanceof Block || blot instanceof BlockEmbed;\n}\n\ninterface UpdatableEmbed {\n updateContent(change: unknown): void;\n}\n\nfunction isUpdatable(blot: Blot): blot is Blot & UpdatableEmbed {\n return typeof (blot as unknown as any).updateContent === 'function';\n}\n\nclass Scroll extends ScrollBlot {\n static blotName = 'scroll';\n static className = 'ql-editor';\n static tagName = 'DIV';\n static defaultChild = Block;\n static allowedChildren = [Block, BlockEmbed, Container];\n\n emitter: Emitter;\n batch: false | MutationRecord[];\n\n constructor(\n registry: Registry,\n domNode: HTMLDivElement,\n { emitter }: { emitter: Emitter },\n ) {\n super(registry, domNode);\n this.emitter = emitter;\n this.batch = false;\n this.optimize();\n this.enable();\n this.domNode.addEventListener('dragstart', (e) => this.handleDragStart(e));\n }\n\n batchStart() {\n if (!Array.isArray(this.batch)) {\n this.batch = [];\n }\n }\n\n batchEnd() {\n if (!this.batch) return;\n const mutations = this.batch;\n this.batch = false;\n this.update(mutations);\n }\n\n emitMount(blot: Blot) {\n this.emitter.emit(Emitter.events.SCROLL_BLOT_MOUNT, blot);\n }\n\n emitUnmount(blot: Blot) {\n this.emitter.emit(Emitter.events.SCROLL_BLOT_UNMOUNT, blot);\n }\n\n emitEmbedUpdate(blot: Blot, change: unknown) {\n this.emitter.emit(Emitter.events.SCROLL_EMBED_UPDATE, blot, change);\n }\n\n deleteAt(index: number, length: number) {\n const [first, offset] = this.line(index);\n const [last] = this.line(index + length);\n super.deleteAt(index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof BlockEmbed || last instanceof BlockEmbed) {\n this.optimize();\n return;\n }\n const ref =\n last.children.head instanceof Break ? null : last.children.head;\n // @ts-expect-error\n first.moveChildren(last, ref);\n // @ts-expect-error\n first.remove();\n }\n this.optimize();\n }\n\n enable(enabled = true) {\n this.domNode.setAttribute('contenteditable', enabled ? 'true' : 'false');\n }\n\n formatAt(index: number, length: number, format: string, value: unknown) {\n super.formatAt(index, length, format, value);\n this.optimize();\n }\n\n insertAt(index: number, value: string, def?: unknown) {\n if (index >= this.length()) {\n if (def == null || this.scroll.query(value, Scope.BLOCK) == null) {\n const blot = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n blot.insertAt(0, value.slice(0, -1), def);\n } else {\n blot.insertAt(0, value, def);\n }\n } else {\n const embed = this.scroll.create(value, def);\n this.appendChild(embed);\n }\n } else {\n super.insertAt(index, value, def);\n }\n this.optimize();\n }\n\n insertBefore(blot: Blot, ref?: Blot | null) {\n if (blot.statics.scope === Scope.INLINE_BLOT) {\n const wrapper = this.scroll.create(\n this.statics.defaultChild.blotName,\n ) as Parent;\n wrapper.appendChild(blot);\n super.insertBefore(wrapper, ref);\n } else {\n super.insertBefore(blot, ref);\n }\n }\n\n insertContents(index: number, delta: Delta) {\n const renderBlocks = this.deltaToRenderBlocks(\n delta.concat(new Delta().insert('\\n')),\n );\n const last = renderBlocks.pop();\n if (last == null) return;\n\n this.batchStart();\n\n const first = renderBlocks.shift();\n if (first) {\n const shouldInsertNewlineChar =\n first.type === 'block' &&\n (first.delta.length() === 0 ||\n (!this.descendant(BlockEmbed, index)[0] && index < this.length()));\n const delta =\n first.type === 'block'\n ? first.delta\n : new Delta().insert({ [first.key]: first.value });\n insertInlineContents(this, index, delta);\n const newlineCharLength = first.type === 'block' ? 1 : 0;\n const lineEndIndex = index + delta.length() + newlineCharLength;\n if (shouldInsertNewlineChar) {\n this.insertAt(lineEndIndex - 1, '\\n');\n }\n\n const formats = bubbleFormats(this.line(index)[0]);\n const attributes = AttributeMap.diff(formats, first.attributes) || {};\n Object.keys(attributes).forEach((name) => {\n this.formatAt(lineEndIndex - 1, 1, name, attributes[name]);\n });\n\n index = lineEndIndex;\n }\n\n let [refBlot, refBlotOffset] = this.children.find(index);\n if (renderBlocks.length) {\n if (refBlot) {\n refBlot = refBlot.split(refBlotOffset);\n refBlotOffset = 0;\n }\n\n renderBlocks.forEach((renderBlock) => {\n if (renderBlock.type === 'block') {\n const block = this.createBlock(\n renderBlock.attributes,\n refBlot || undefined,\n );\n insertInlineContents(block, 0, renderBlock.delta);\n } else {\n const blockEmbed = this.create(\n renderBlock.key,\n renderBlock.value,\n ) as EmbedBlot;\n this.insertBefore(blockEmbed, refBlot || undefined);\n Object.keys(renderBlock.attributes).forEach((name) => {\n blockEmbed.format(name, renderBlock.attributes[name]);\n });\n }\n });\n }\n\n if (last.type === 'block' && last.delta.length()) {\n const offset = refBlot\n ? refBlot.offset(refBlot.scroll) + refBlotOffset\n : this.length();\n insertInlineContents(this, offset, last.delta);\n }\n\n this.batchEnd();\n this.optimize();\n }\n\n isEnabled() {\n return this.domNode.getAttribute('contenteditable') === 'true';\n }\n\n leaf(index: number): [LeafBlot | null, number] {\n const last = this.path(index).pop();\n if (!last) {\n return [null, -1];\n }\n\n const [blot, offset] = last;\n return blot instanceof LeafBlot ? [blot, offset] : [null, -1];\n }\n\n line(index: number): [Block | BlockEmbed | null, number] {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n // @ts-expect-error TODO: make descendant() generic\n return this.descendant(isLine, index);\n }\n\n lines(index = 0, length = Number.MAX_VALUE): (Block | BlockEmbed)[] {\n const getLines = (\n blot: ParentBlot,\n blotIndex: number,\n blotLength: number,\n ) => {\n let lines: (Block | BlockEmbed)[] = [];\n let lengthLeft = blotLength;\n blot.children.forEachAt(\n blotIndex,\n blotLength,\n (child, childIndex, childLength) => {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof ContainerBlot) {\n lines = lines.concat(getLines(child, childIndex, lengthLeft));\n }\n lengthLeft -= childLength;\n },\n );\n return lines;\n };\n return getLines(this, index, length);\n }\n\n optimize(context?: { [key: string]: any }): void;\n optimize(\n mutations?: MutationRecord[],\n context?: { [key: string]: any },\n ): void;\n optimize(mutations = [], context = {}) {\n if (this.batch) return;\n super.optimize(mutations, context);\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n\n path(index: number) {\n return super.path(index).slice(1); // Exclude self\n }\n\n remove() {\n // Never remove self\n }\n\n update(source?: EmitterSource): void;\n update(mutations?: MutationRecord[]): void;\n update(mutations?: MutationRecord[] | EmitterSource): void {\n if (this.batch) {\n if (Array.isArray(mutations)) {\n this.batch = this.batch.concat(mutations);\n }\n return;\n }\n let source: EmitterSource = Emitter.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n mutations = mutations.filter(({ target }) => {\n const blot = this.find(target, true);\n return blot && !isUpdatable(blot);\n });\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n super.update(mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_UPDATE, source, mutations);\n }\n }\n\n updateEmbedAt(index: number, key: string, change: unknown) {\n // Currently it only supports top-level embeds (BlockEmbed).\n // We can update `ParentBlot` in parchment to support inline embeds.\n const [blot] = this.descendant((b: Blot) => b instanceof BlockEmbed, index);\n if (blot && blot.statics.blotName === key && isUpdatable(blot)) {\n blot.updateContent(change);\n }\n }\n\n protected handleDragStart(event: DragEvent) {\n event.preventDefault();\n }\n\n private deltaToRenderBlocks(delta: Delta) {\n const renderBlocks: RenderBlock[] = [];\n\n let currentBlockDelta = new Delta();\n delta.forEach((op) => {\n const insert = op?.insert;\n if (!insert) return;\n if (typeof insert === 'string') {\n const splitted = insert.split('\\n');\n splitted.slice(0, -1).forEach((text) => {\n currentBlockDelta.insert(text, op.attributes);\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: op.attributes ?? {},\n });\n currentBlockDelta = new Delta();\n });\n const last = splitted[splitted.length - 1];\n if (last) {\n currentBlockDelta.insert(last, op.attributes);\n }\n } else {\n const key = Object.keys(insert)[0];\n if (!key) return;\n if (this.query(key, Scope.INLINE)) {\n currentBlockDelta.push(op);\n } else {\n if (currentBlockDelta.length()) {\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: {},\n });\n }\n currentBlockDelta = new Delta();\n renderBlocks.push({\n type: 'blockEmbed',\n key,\n value: insert[key],\n attributes: op.attributes ?? {},\n });\n }\n }\n });\n\n if (currentBlockDelta.length()) {\n renderBlocks.push({\n type: 'block',\n delta: currentBlockDelta,\n attributes: {},\n });\n }\n\n return renderBlocks;\n }\n\n private createBlock(attributes: AttributeMap, refBlot?: Blot) {\n let blotName: string | undefined;\n const formats: AttributeMap = {};\n\n Object.entries(attributes).forEach(([key, value]) => {\n const isBlockBlot = this.query(key, Scope.BLOCK & Scope.BLOT) != null;\n if (isBlockBlot) {\n blotName = key;\n } else {\n formats[key] = value;\n }\n });\n\n const block = this.create(\n blotName || this.statics.defaultChild.blotName,\n blotName ? attributes[blotName] : undefined,\n ) as ParentBlot;\n\n this.insertBefore(block, refBlot || undefined);\n\n const length = block.length();\n Object.entries(formats).forEach(([key, value]) => {\n block.formatAt(0, length, key, value);\n });\n\n return block;\n }\n}\n\nfunction insertInlineContents(\n parent: ParentBlot,\n index: number,\n inlineContents: Delta,\n) {\n inlineContents.reduce((index, op) => {\n const length = Op.length(op);\n let attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n const text = op.insert;\n parent.insertAt(index, text);\n const [leaf] = parent.descendant(LeafBlot, index);\n const formats = bubbleFormats(leaf);\n attributes = AttributeMap.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n const key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n parent.insertAt(index, key, op.insert[key]);\n const isInlineEmbed = parent.scroll.query(key, Scope.INLINE) != null;\n if (isInlineEmbed) {\n const [leaf] = parent.descendant(LeafBlot, index);\n const formats = bubbleFormats(leaf);\n attributes = AttributeMap.diff(formats, attributes) || {};\n }\n }\n }\n Object.keys(attributes).forEach((key) => {\n parent.formatAt(index, length, key, attributes[key]);\n });\n return index + length;\n }, index);\n}\n\nexport default Scroll;\n", "import { Attributor, ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.BLOCK,\n whitelist: ['right', 'center', 'justify'],\n};\n\nconst AlignAttribute = new Attributor('align', 'align', config);\nconst AlignClass = new ClassAttributor('align', 'ql-align', config);\nconst AlignStyle = new StyleAttributor('align', 'text-align', config);\n\nexport { AlignAttribute, AlignClass, AlignStyle };\n", "import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nclass ColorAttributor extends StyleAttributor {\n value(domNode: HTMLElement) {\n let value = super.value(domNode) as string;\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n const hex = value\n .split(',')\n .map((component) => `00${parseInt(component, 10).toString(16)}`.slice(-2))\n .join('');\n return `#${hex}`;\n }\n}\n\nconst ColorClass = new ClassAttributor('color', 'ql-color', {\n scope: Scope.INLINE,\n});\nconst ColorStyle = new ColorAttributor('color', 'color', {\n scope: Scope.INLINE,\n});\n\nexport { ColorAttributor, ColorClass, ColorStyle };\n", "import { ClassAttributor, Scope } from 'parchment';\nimport { ColorAttributor } from './color.js';\n\nconst BackgroundClass = new ClassAttributor('background', 'ql-bg', {\n scope: Scope.INLINE,\n});\nconst BackgroundStyle = new ColorAttributor('background', 'background-color', {\n scope: Scope.INLINE,\n});\n\nexport { BackgroundClass, BackgroundStyle };\n", "import Block from '../blots/block.js';\nimport Break from '../blots/break.js';\nimport Cursor from '../blots/cursor.js';\nimport Inline from '../blots/inline.js';\nimport TextBlot, { escapeText } from '../blots/text.js';\nimport Container from '../blots/container.js';\nimport Quill from '../core/quill.js';\n\nclass CodeBlockContainer extends Container {\n static create(value: string) {\n const domNode = super.create(value) as Element;\n domNode.setAttribute('spellcheck', 'false');\n return domNode;\n }\n\n code(index: number, length: number) {\n return (\n this.children\n // @ts-expect-error\n .map((child) => (child.length() <= 1 ? '' : child.domNode.innerText))\n .join('\\n')\n .slice(index, index + length)\n );\n }\n\n html(index: number, length: number) {\n // `\\n`s are needed in order to support empty lines at the beginning and the end.\n // https://html.spec.whatwg.org/multipage/syntax.html#element-restrictions\n return `
    \\n${escapeText(this.code(index, length))}\\n
    `;\n }\n}\n\nclass CodeBlock extends Block {\n static TAB = ' ';\n\n static register() {\n Quill.register(CodeBlockContainer);\n }\n}\n\nclass Code extends Inline {}\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\nCodeBlock.blotName = 'code-block';\nCodeBlock.className = 'ql-code-block';\nCodeBlock.tagName = 'DIV';\nCodeBlockContainer.blotName = 'code-block-container';\nCodeBlockContainer.className = 'ql-code-block-container';\nCodeBlockContainer.tagName = 'DIV';\n\nCodeBlockContainer.allowedChildren = [CodeBlock];\n\nCodeBlock.allowedChildren = [TextBlot, Break, Cursor];\nCodeBlock.requiredContainer = CodeBlockContainer;\n\nexport { Code, CodeBlockContainer, CodeBlock as default };\n", "import { Attributor, ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.BLOCK,\n whitelist: ['rtl'],\n};\n\nconst DirectionAttribute = new Attributor('direction', 'dir', config);\nconst DirectionClass = new ClassAttributor('direction', 'ql-direction', config);\nconst DirectionStyle = new StyleAttributor('direction', 'direction', config);\n\nexport { DirectionAttribute, DirectionClass, DirectionStyle };\n", "import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst config = {\n scope: Scope.INLINE,\n whitelist: ['serif', 'monospace'],\n};\n\nconst FontClass = new ClassAttributor('font', 'ql-font', config);\n\nclass FontStyleAttributor extends StyleAttributor {\n value(node: HTMLElement) {\n return super.value(node).replace(/[\"']/g, '');\n }\n}\n\nconst FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexport { FontStyle, FontClass };\n", "import { ClassAttributor, Scope, StyleAttributor } from 'parchment';\n\nconst SizeClass = new ClassAttributor('size', 'ql-size', {\n scope: Scope.INLINE,\n whitelist: ['small', 'large', 'huge'],\n});\nconst SizeStyle = new StyleAttributor('size', 'font-size', {\n scope: Scope.INLINE,\n whitelist: ['10px', '18px', '32px'],\n});\n\nexport { SizeClass, SizeStyle };\n", "import { cloneDeep, isEqual } from 'lodash-es';\nimport Delta, { AttributeMap } from 'quill-delta';\nimport { EmbedBlot, Scope, TextBlot } from 'parchment';\nimport type { Blot, BlockBlot } from 'parchment';\nimport Quill from '../core/quill.js';\nimport logger from '../core/logger.js';\nimport Module from '../core/module.js';\nimport type { BlockEmbed } from '../blots/block.js';\nimport type { Range } from '../core/selection.js';\n\nconst debug = logger('quill:keyboard');\n\nconst SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\nexport interface Context {\n collapsed: boolean;\n empty: boolean;\n offset: number;\n prefix: string;\n suffix: string;\n format: Record;\n event: KeyboardEvent;\n line: BlockEmbed | BlockBlot;\n}\n\ninterface BindingObject\n extends Partial> {\n key: number | string | string[];\n shortKey?: boolean | null;\n shiftKey?: boolean | null;\n altKey?: boolean | null;\n metaKey?: boolean | null;\n ctrlKey?: boolean | null;\n prefix?: RegExp;\n suffix?: RegExp;\n format?: Record | string[];\n handler?: (\n this: { quill: Quill },\n range: Range,\n curContext: Context,\n // eslint-disable-next-line no-use-before-define\n binding: NormalizedBinding,\n ) => boolean | void;\n}\n\ntype Binding = BindingObject | string | number;\n\ninterface NormalizedBinding extends Omit {\n key: string | number;\n}\n\ninterface KeyboardOptions {\n bindings: Record;\n}\n\ninterface KeyboardOptions {\n bindings: Record;\n}\n\nclass Keyboard extends Module {\n static DEFAULTS: KeyboardOptions;\n\n static match(evt: KeyboardEvent, binding: BindingObject) {\n if (\n (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'] as const).some((key) => {\n return !!binding[key] !== evt[key] && binding[key] !== null;\n })\n ) {\n return false;\n }\n return binding.key === evt.key || binding.key === evt.which;\n }\n\n bindings: Record;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n this.bindings = {};\n // @ts-expect-error Fix me later\n Object.keys(this.options.bindings).forEach((name) => {\n // @ts-expect-error Fix me later\n if (this.options.bindings[name]) {\n // @ts-expect-error Fix me later\n this.addBinding(this.options.bindings[name]);\n }\n });\n this.addBinding({ key: 'Enter', shiftKey: null }, this.handleEnter);\n this.addBinding(\n { key: 'Enter', metaKey: null, ctrlKey: null, altKey: null },\n () => {},\n );\n if (/Firefox/i.test(navigator.userAgent)) {\n // Need to handle delete and backspace for Firefox in the general case #1171\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: true },\n this.handleBackspace,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: true },\n this.handleDelete,\n );\n } else {\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: true, prefix: /^.?$/ },\n this.handleBackspace,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: true, suffix: /^.?$/ },\n this.handleDelete,\n );\n }\n this.addBinding(\n { key: 'Backspace' },\n { collapsed: false },\n this.handleDeleteRange,\n );\n this.addBinding(\n { key: 'Delete' },\n { collapsed: false },\n this.handleDeleteRange,\n );\n this.addBinding(\n {\n key: 'Backspace',\n altKey: null,\n ctrlKey: null,\n metaKey: null,\n shiftKey: null,\n },\n { collapsed: true, offset: 0 },\n this.handleBackspace,\n );\n this.listen();\n }\n\n addBinding(\n keyBinding: Binding,\n context:\n | Required\n | Partial> = {},\n handler:\n | Required\n | Partial> = {},\n ) {\n const binding = normalize(keyBinding);\n if (binding == null) {\n debug.warn('Attempted to add invalid keyboard binding', binding);\n return;\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler };\n }\n const keys = Array.isArray(binding.key) ? binding.key : [binding.key];\n keys.forEach((key) => {\n const singleBinding = {\n ...binding,\n key,\n ...context,\n ...handler,\n };\n this.bindings[singleBinding.key] = this.bindings[singleBinding.key] || [];\n this.bindings[singleBinding.key].push(singleBinding);\n });\n }\n\n listen() {\n this.quill.root.addEventListener('keydown', (evt) => {\n if (evt.defaultPrevented || evt.isComposing) return;\n\n // evt.isComposing is false when pressing Enter/Backspace when composing in Safari\n // https://bugs.webkit.org/show_bug.cgi?id=165004\n const isComposing =\n evt.keyCode === 229 && (evt.key === 'Enter' || evt.key === 'Backspace');\n if (isComposing) return;\n\n const bindings = (this.bindings[evt.key] || []).concat(\n this.bindings[evt.which] || [],\n );\n const matches = bindings.filter((binding) =>\n Keyboard.match(evt, binding),\n );\n if (matches.length === 0) return;\n // @ts-expect-error\n const blot = Quill.find(evt.target, true);\n if (blot && blot.scroll !== this.quill.scroll) return;\n const range = this.quill.getSelection();\n if (range == null || !this.quill.hasFocus()) return;\n const [line, offset] = this.quill.getLine(range.index);\n const [leafStart, offsetStart] = this.quill.getLeaf(range.index);\n const [leafEnd, offsetEnd] =\n range.length === 0\n ? [leafStart, offsetStart]\n : this.quill.getLeaf(range.index + range.length);\n const prefixText =\n leafStart instanceof TextBlot\n ? leafStart.value().slice(0, offsetStart)\n : '';\n const suffixText =\n leafEnd instanceof TextBlot ? leafEnd.value().slice(offsetEnd) : '';\n const curContext = {\n collapsed: range.length === 0,\n // @ts-expect-error Fix me later\n empty: range.length === 0 && line.length() <= 1,\n format: this.quill.getFormat(range),\n line,\n offset,\n prefix: prefixText,\n suffix: suffixText,\n event: evt,\n };\n const prevented = matches.some((binding) => {\n if (\n binding.collapsed != null &&\n binding.collapsed !== curContext.collapsed\n ) {\n return false;\n }\n if (binding.empty != null && binding.empty !== curContext.empty) {\n return false;\n }\n if (binding.offset != null && binding.offset !== curContext.offset) {\n return false;\n }\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every((name) => curContext.format[name] == null)) {\n return false;\n }\n } else if (typeof binding.format === 'object') {\n // all formats must match\n if (\n !Object.keys(binding.format).every((name) => {\n // @ts-expect-error Fix me later\n if (binding.format[name] === true)\n return curContext.format[name] != null;\n // @ts-expect-error Fix me later\n if (binding.format[name] === false)\n return curContext.format[name] == null;\n // @ts-expect-error Fix me later\n return isEqual(binding.format[name], curContext.format[name]);\n })\n ) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) {\n return false;\n }\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) {\n return false;\n }\n // @ts-expect-error Fix me later\n return binding.handler.call(this, range, curContext, binding) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n\n handleBackspace(range: Range, context: Context) {\n // Check for astral symbols\n const length = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/.test(context.prefix)\n ? 2\n : 1;\n if (range.index === 0 || this.quill.getLength() <= 1) return;\n let formats = {};\n const [line] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index - length).delete(length);\n if (context.offset === 0) {\n // Always deleting newline here, length always 1\n const [prev] = this.quill.getLine(range.index - 1);\n if (prev) {\n const isPrevLineEmpty =\n prev.statics.blotName === 'block' && prev.length() <= 1;\n if (!isPrevLineEmpty) {\n // @ts-expect-error Fix me later\n const curFormats = line.formats();\n const prevFormats = this.quill.getFormat(range.index - 1, 1);\n formats = AttributeMap.diff(curFormats, prevFormats) || {};\n if (Object.keys(formats).length > 0) {\n // line.length() - 1 targets \\n in line, another -1 for newline being deleted\n const formatDelta = new Delta()\n // @ts-expect-error Fix me later\n .retain(range.index + line.length() - 2)\n .retain(1, formats);\n delta = delta.compose(formatDelta);\n }\n }\n }\n }\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.focus();\n }\n\n handleDelete(range: Range, context: Context) {\n // Check for astral symbols\n const length = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(context.suffix)\n ? 2\n : 1;\n if (range.index >= this.quill.getLength() - length) return;\n let formats = {};\n const [line] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index).delete(length);\n // @ts-expect-error Fix me later\n if (context.offset >= line.length() - 1) {\n const [next] = this.quill.getLine(range.index + 1);\n if (next) {\n // @ts-expect-error Fix me later\n const curFormats = line.formats();\n const nextFormats = this.quill.getFormat(range.index, 1);\n formats = AttributeMap.diff(curFormats, nextFormats) || {};\n if (Object.keys(formats).length > 0) {\n delta = delta.retain(next.length() - 1).retain(1, formats);\n }\n }\n }\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.focus();\n }\n\n handleDeleteRange(range: Range) {\n deleteRange({ range, quill: this.quill });\n this.quill.focus();\n }\n\n handleEnter(range: Range, context: Context) {\n const lineFormats = Object.keys(context.format).reduce(\n (formats: Record, format) => {\n if (\n this.quill.scroll.query(format, Scope.BLOCK) &&\n !Array.isArray(context.format[format])\n ) {\n formats[format] = context.format[format];\n }\n return formats;\n },\n {},\n );\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert('\\n', lineFormats);\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.focus();\n }\n}\n\nconst defaultOptions: KeyboardOptions = {\n bindings: {\n bold: makeFormatHandler('bold'),\n italic: makeFormatHandler('italic'),\n underline: makeFormatHandler('underline'),\n indent: {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: 'Tab',\n format: ['blockquote', 'indent', 'list'],\n handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', Quill.sources.USER);\n return false;\n },\n },\n outdent: {\n key: 'Tab',\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', Quill.sources.USER);\n return false;\n },\n },\n 'outdent backspace': {\n key: 'Backspace',\n collapsed: true,\n shiftKey: null,\n metaKey: null,\n ctrlKey: null,\n altKey: null,\n format: ['indent', 'list'],\n offset: 0,\n handler(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', Quill.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, Quill.sources.USER);\n }\n },\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: 'Tab',\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler(range) {\n this.quill.deleteText(range.index - 1, 1, Quill.sources.USER);\n },\n },\n tab: {\n key: 'Tab',\n handler(range, context) {\n if (context.format.table) return true;\n this.quill.history.cutoff();\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert('\\t');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n return false;\n },\n },\n 'blockquote empty enter': {\n key: 'Enter',\n collapsed: true,\n format: ['blockquote'],\n empty: true,\n handler() {\n this.quill.format('blockquote', false, Quill.sources.USER);\n },\n },\n 'list empty enter': {\n key: 'Enter',\n collapsed: true,\n format: ['list'],\n empty: true,\n handler(range, context) {\n const formats: Record = { list: false };\n if (context.format.indent) {\n formats.indent = false;\n }\n this.quill.formatLine(\n range.index,\n range.length,\n formats,\n Quill.sources.USER,\n );\n },\n },\n 'checklist enter': {\n key: 'Enter',\n collapsed: true,\n format: { list: 'checked' },\n handler(range) {\n const [line, offset] = this.quill.getLine(range.index);\n const formats = {\n // @ts-expect-error Fix me later\n ...line.formats(),\n list: 'checked',\n };\n const delta = new Delta()\n .retain(range.index)\n .insert('\\n', formats)\n // @ts-expect-error Fix me later\n .retain(line.length() - offset - 1)\n .retain(1, { list: 'unchecked' });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollSelectionIntoView();\n },\n },\n 'header enter': {\n key: 'Enter',\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler(range, context) {\n const [line, offset] = this.quill.getLine(range.index);\n const delta = new Delta()\n .retain(range.index)\n .insert('\\n', context.format)\n // @ts-expect-error Fix me later\n .retain(line.length() - offset - 1)\n .retain(1, { header: null });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollSelectionIntoView();\n },\n },\n 'table backspace': {\n key: 'Backspace',\n format: ['table'],\n collapsed: true,\n offset: 0,\n handler() {},\n },\n 'table delete': {\n key: 'Delete',\n format: ['table'],\n collapsed: true,\n suffix: /^$/,\n handler() {},\n },\n 'table enter': {\n key: 'Enter',\n shiftKey: null,\n format: ['table'],\n handler(range) {\n const module = this.quill.getModule('table');\n if (module) {\n // @ts-expect-error\n const [table, row, cell, offset] = module.getTable(range);\n const shift = tableSide(table, row, cell, offset);\n if (shift == null) return;\n let index = table.offset();\n if (shift < 0) {\n const delta = new Delta().retain(index).insert('\\n');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(\n range.index + 1,\n range.length,\n Quill.sources.SILENT,\n );\n } else if (shift > 0) {\n index += table.length();\n const delta = new Delta().retain(index).insert('\\n');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(index, Quill.sources.USER);\n }\n }\n },\n },\n 'table tab': {\n key: 'Tab',\n shiftKey: null,\n format: ['table'],\n handler(range, context) {\n const { event, line: cell } = context;\n const offset = cell.offset(this.quill.scroll);\n if (event.shiftKey) {\n this.quill.setSelection(offset - 1, Quill.sources.USER);\n } else {\n this.quill.setSelection(offset + cell.length(), Quill.sources.USER);\n }\n },\n },\n 'list autofill': {\n key: ' ',\n shiftKey: null,\n collapsed: true,\n format: {\n 'code-block': false,\n blockquote: false,\n table: false,\n },\n prefix: /^\\s*?(\\d+\\.|-|\\*|\\[ ?\\]|\\[x\\])$/,\n handler(range, context) {\n if (this.quill.scroll.query('list') == null) return true;\n const { length } = context.prefix;\n const [line, offset] = this.quill.getLine(range.index);\n if (offset > length) return true;\n let value;\n switch (context.prefix.trim()) {\n case '[]':\n case '[ ]':\n value = 'unchecked';\n break;\n case '[x]':\n value = 'checked';\n break;\n case '-':\n case '*':\n value = 'bullet';\n break;\n default:\n value = 'ordered';\n }\n this.quill.insertText(range.index, ' ', Quill.sources.USER);\n this.quill.history.cutoff();\n const delta = new Delta()\n .retain(range.index - offset)\n .delete(length + 1)\n // @ts-expect-error Fix me later\n .retain(line.length() - 2 - offset)\n .retain(1, { list: value });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index - length, Quill.sources.SILENT);\n return false;\n },\n },\n 'code exit': {\n key: 'Enter',\n collapsed: true,\n format: ['code-block'],\n prefix: /^$/,\n suffix: /^\\s*$/,\n handler(range) {\n const [line, offset] = this.quill.getLine(range.index);\n let numLines = 2;\n let cur = line;\n while (\n cur != null &&\n cur.length() <= 1 &&\n cur.formats()['code-block']\n ) {\n // @ts-expect-error\n cur = cur.prev;\n numLines -= 1;\n // Requisite prev lines are empty\n if (numLines <= 0) {\n const delta = new Delta()\n // @ts-expect-error Fix me later\n .retain(range.index + line.length() - offset - 2)\n .retain(1, { 'code-block': null })\n .delete(1);\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index - 1, Quill.sources.SILENT);\n return false;\n }\n }\n return true;\n },\n },\n 'embed left': makeEmbedArrowHandler('ArrowLeft', false),\n 'embed left shift': makeEmbedArrowHandler('ArrowLeft', true),\n 'embed right': makeEmbedArrowHandler('ArrowRight', false),\n 'embed right shift': makeEmbedArrowHandler('ArrowRight', true),\n 'table down': makeTableArrowHandler(false),\n 'table up': makeTableArrowHandler(true),\n },\n};\n\nKeyboard.DEFAULTS = defaultOptions;\n\nfunction makeCodeBlockHandler(indent: boolean): BindingObject {\n return {\n key: 'Tab',\n shiftKey: !indent,\n format: { 'code-block': true },\n handler(range, { event }) {\n const CodeBlock = this.quill.scroll.query('code-block');\n // @ts-expect-error\n const { TAB } = CodeBlock;\n if (range.length === 0 && !event.shiftKey) {\n this.quill.insertText(range.index, TAB, Quill.sources.USER);\n this.quill.setSelection(range.index + TAB.length, Quill.sources.SILENT);\n return;\n }\n\n const lines =\n range.length === 0\n ? this.quill.getLines(range.index, 1)\n : this.quill.getLines(range);\n let { index, length } = range;\n lines.forEach((line, i) => {\n if (indent) {\n line.insertAt(0, TAB);\n if (i === 0) {\n index += TAB.length;\n } else {\n length += TAB.length;\n }\n // @ts-expect-error Fix me later\n } else if (line.domNode.textContent.startsWith(TAB)) {\n line.deleteAt(0, TAB.length);\n if (i === 0) {\n index -= TAB.length;\n } else {\n length -= TAB.length;\n }\n }\n });\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(index, length, Quill.sources.SILENT);\n },\n };\n}\n\nfunction makeEmbedArrowHandler(\n key: string,\n shiftKey: boolean | null,\n): BindingObject {\n const where = key === 'ArrowLeft' ? 'prefix' : 'suffix';\n return {\n key,\n shiftKey,\n altKey: null,\n [where]: /^$/,\n handler(range) {\n let { index } = range;\n if (key === 'ArrowRight') {\n index += range.length + 1;\n }\n const [leaf] = this.quill.getLeaf(index);\n if (!(leaf instanceof EmbedBlot)) return true;\n if (key === 'ArrowLeft') {\n if (shiftKey) {\n this.quill.setSelection(\n range.index - 1,\n range.length + 1,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(range.index - 1, Quill.sources.USER);\n }\n } else if (shiftKey) {\n this.quill.setSelection(\n range.index,\n range.length + 1,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(\n range.index + range.length + 1,\n Quill.sources.USER,\n );\n }\n return false;\n },\n };\n}\n\nfunction makeFormatHandler(format: string): BindingObject {\n return {\n key: format[0],\n shortKey: true,\n handler(range, context) {\n this.quill.format(format, !context.format[format], Quill.sources.USER);\n },\n };\n}\n\nfunction makeTableArrowHandler(up: boolean): BindingObject {\n return {\n key: up ? 'ArrowUp' : 'ArrowDown',\n collapsed: true,\n format: ['table'],\n handler(range, context) {\n // TODO move to table module\n const key = up ? 'prev' : 'next';\n const cell = context.line;\n const targetRow = cell.parent[key];\n if (targetRow != null) {\n if (targetRow.statics.blotName === 'table-row') {\n // @ts-expect-error\n let targetCell = targetRow.children.head;\n let cur = cell;\n while (cur.prev != null) {\n // @ts-expect-error\n cur = cur.prev;\n targetCell = targetCell.next;\n }\n const index =\n targetCell.offset(this.quill.scroll) +\n Math.min(context.offset, targetCell.length() - 1);\n this.quill.setSelection(index, 0, Quill.sources.USER);\n }\n } else {\n // @ts-expect-error\n const targetLine = cell.table()[key];\n if (targetLine != null) {\n if (up) {\n this.quill.setSelection(\n targetLine.offset(this.quill.scroll) + targetLine.length() - 1,\n 0,\n Quill.sources.USER,\n );\n } else {\n this.quill.setSelection(\n targetLine.offset(this.quill.scroll),\n 0,\n Quill.sources.USER,\n );\n }\n }\n }\n return false;\n },\n };\n}\n\nfunction normalize(binding: Binding): BindingObject | null {\n if (typeof binding === 'string' || typeof binding === 'number') {\n binding = { key: binding };\n } else if (typeof binding === 'object') {\n binding = cloneDeep(binding);\n } else {\n return null;\n }\n if (binding.shortKey) {\n binding[SHORTKEY] = binding.shortKey;\n delete binding.shortKey;\n }\n return binding;\n}\n\n// TODO: Move into quill.ts or editor.ts\nfunction deleteRange({ quill, range }: { quill: Quill; range: Range }) {\n const lines = quill.getLines(range);\n let formats = {};\n if (lines.length > 1) {\n const firstFormats = lines[0].formats();\n const lastFormats = lines[lines.length - 1].formats();\n formats = AttributeMap.diff(lastFormats, firstFormats) || {};\n }\n quill.deleteText(range, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n quill.formatLine(range.index, 1, formats, Quill.sources.USER);\n }\n quill.setSelection(range.index, Quill.sources.SILENT);\n}\n\nfunction tableSide(_table: unknown, row: Blot, cell: Blot, offset: number) {\n if (row.prev == null && row.next == null) {\n if (cell.prev == null && cell.next == null) {\n return offset === 0 ? -1 : 1;\n }\n return cell.prev == null ? -1 : 1;\n }\n if (row.prev == null) {\n return -1;\n }\n if (row.next == null) {\n return 1;\n }\n return null;\n}\n\nexport { Keyboard as default, SHORTKEY, normalize, deleteRange };\n", "const normalWeightRegexp = /font-weight:\\s*normal/;\nconst blockTagNames = ['P', 'OL', 'UL'];\n\nconst isBlockElement = (element: Element | null) => {\n return element && blockTagNames.includes(element.tagName);\n};\n\nconst normalizeEmptyLines = (doc: Document) => {\n Array.from(doc.querySelectorAll('br'))\n .filter(\n (br) =>\n isBlockElement(br.previousElementSibling) &&\n isBlockElement(br.nextElementSibling),\n )\n .forEach((br) => {\n br.parentNode?.removeChild(br);\n });\n};\n\nconst normalizeFontWeight = (doc: Document) => {\n Array.from(doc.querySelectorAll('b[style*=\"font-weight\"]'))\n .filter((node) => node.getAttribute('style')?.match(normalWeightRegexp))\n .forEach((node) => {\n const fragment = doc.createDocumentFragment();\n fragment.append(...node.childNodes);\n node.parentNode?.replaceChild(fragment, node);\n });\n};\n\nexport default function normalize(doc: Document) {\n if (doc.querySelector('[id^=\"docs-internal-guid-\"]')) {\n normalizeFontWeight(doc);\n normalizeEmptyLines(doc);\n }\n}\n", "const ignoreRegexp = /\\bmso-list:[^;]*ignore/i;\nconst idRegexp = /\\bmso-list:[^;]*\\bl(\\d+)/i;\nconst indentRegexp = /\\bmso-list:[^;]*\\blevel(\\d+)/i;\n\nconst parseListItem = (element: Element, html: string) => {\n const style = element.getAttribute('style');\n const idMatch = style?.match(idRegexp);\n if (!idMatch) {\n return null;\n }\n const id = Number(idMatch[1]);\n\n const indentMatch = style?.match(indentRegexp);\n const indent = indentMatch ? Number(indentMatch[1]) : 1;\n\n const typeRegexp = new RegExp(\n `@list l${id}:level${indent}\\\\s*\\\\{[^\\\\}]*mso-level-number-format:\\\\s*([\\\\w-]+)`,\n 'i',\n );\n const typeMatch = html.match(typeRegexp);\n const type = typeMatch && typeMatch[1] === 'bullet' ? 'bullet' : 'ordered';\n\n return { id, indent, type, element };\n};\n\n// list items are represented as `p` tags with styles like `mso-list: l0 level1` where:\n// 1. \"0\" in \"l0\" means the list item id;\n// 2. \"1\" in \"level1\" means the indent level, starting from 1.\nconst normalizeListItem = (doc: Document) => {\n const msoList = Array.from(doc.querySelectorAll('[style*=mso-list]'));\n const ignored: Element[] = [];\n const others: Element[] = [];\n msoList.forEach((node) => {\n const shouldIgnore = (node.getAttribute('style') || '').match(ignoreRegexp);\n if (shouldIgnore) {\n ignored.push(node);\n } else {\n others.push(node);\n }\n });\n\n // Each list item contains a marker wrapped with \"mso-list: Ignore\".\n ignored.forEach((node) => node.parentNode?.removeChild(node));\n\n // The list stype is not defined inline with the tag, instead, it's in the\n // style tag so we need to pass the html as a string.\n const html = doc.documentElement.innerHTML;\n const listItems = others\n .map((element) => parseListItem(element, html))\n .filter((parsed) => parsed);\n\n while (listItems.length) {\n const childListItems = [];\n\n let current = listItems.shift();\n // Group continuous items into the same group (aka \"ul\")\n while (current) {\n childListItems.push(current);\n current =\n listItems.length &&\n listItems[0]?.element === current.element.nextElementSibling &&\n // Different id means the next item doesn't belong to this group.\n listItems[0].id === current.id\n ? listItems.shift()\n : null;\n }\n\n const ul = document.createElement('ul');\n childListItems.forEach((listItem) => {\n const li = document.createElement('li');\n li.setAttribute('data-list', listItem.type);\n if (listItem.indent > 1) {\n li.setAttribute('class', `ql-indent-${listItem.indent - 1}`);\n }\n li.innerHTML = listItem.element.innerHTML;\n ul.appendChild(li);\n });\n\n const element = childListItems[0]?.element;\n const { parentNode } = element ?? {};\n if (element) {\n parentNode?.replaceChild(ul, element);\n }\n childListItems.slice(1).forEach(({ element: e }) => {\n parentNode?.removeChild(e);\n });\n }\n};\n\nexport default function normalize(doc: Document) {\n if (\n doc.documentElement.getAttribute('xmlns:w') ===\n 'urn:schemas-microsoft-com:office:word'\n ) {\n normalizeListItem(doc);\n }\n}\n", "import googleDocs from './normalizers/googleDocs.js';\nimport msWord from './normalizers/msWord.js';\n\nconst NORMALIZERS = [msWord, googleDocs];\n\nconst normalizeExternalHTML = (doc: Document) => {\n if (doc.documentElement) {\n NORMALIZERS.forEach((normalize) => {\n normalize(doc);\n });\n }\n};\n\nexport default normalizeExternalHTML;\n", "import type { ScrollBlot } from 'parchment';\nimport {\n Attributor,\n BlockBlot,\n ClassAttributor,\n EmbedBlot,\n Scope,\n StyleAttributor,\n} from 'parchment';\nimport Delta from 'quill-delta';\nimport { BlockEmbed } from '../blots/block.js';\nimport type { EmitterSource } from '../core/emitter.js';\nimport logger from '../core/logger.js';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\nimport type { Range } from '../core/selection.js';\nimport { AlignAttribute, AlignStyle } from '../formats/align.js';\nimport { BackgroundStyle } from '../formats/background.js';\nimport CodeBlock from '../formats/code.js';\nimport { ColorStyle } from '../formats/color.js';\nimport { DirectionAttribute, DirectionStyle } from '../formats/direction.js';\nimport { FontStyle } from '../formats/font.js';\nimport { SizeStyle } from '../formats/size.js';\nimport { deleteRange } from './keyboard.js';\nimport normalizeExternalHTML from './normalizeExternalHTML/index.js';\n\nconst debug = logger('quill:clipboard');\n\ntype Selector = string | Node['TEXT_NODE'] | Node['ELEMENT_NODE'];\ntype Matcher = (node: Node, delta: Delta, scroll: ScrollBlot) => Delta;\n\nconst CLIPBOARD_CONFIG: [Selector, Matcher][] = [\n [Node.TEXT_NODE, matchText],\n [Node.TEXT_NODE, matchNewline],\n ['br', matchBreak],\n [Node.ELEMENT_NODE, matchNewline],\n [Node.ELEMENT_NODE, matchBlot],\n [Node.ELEMENT_NODE, matchAttributor],\n [Node.ELEMENT_NODE, matchStyles],\n ['li', matchIndent],\n ['ol, ul', matchList],\n ['pre', matchCodeBlock],\n ['tr', matchTable],\n ['b', createMatchAlias('bold')],\n ['i', createMatchAlias('italic')],\n ['strike', createMatchAlias('strike')],\n ['style', matchIgnore],\n];\n\nconst ATTRIBUTE_ATTRIBUTORS = [AlignAttribute, DirectionAttribute].reduce(\n (memo: Record, attr) => {\n memo[attr.keyName] = attr;\n return memo;\n },\n {},\n);\n\nconst STYLE_ATTRIBUTORS = [\n AlignStyle,\n BackgroundStyle,\n ColorStyle,\n DirectionStyle,\n FontStyle,\n SizeStyle,\n].reduce((memo: Record, attr) => {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\ninterface ClipboardOptions {\n matchers: [Selector, Matcher][];\n}\n\nclass Clipboard extends Module {\n static DEFAULTS: ClipboardOptions = {\n matchers: [],\n };\n\n matchers: [Selector, Matcher][];\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n this.quill.root.addEventListener('copy', (e) =>\n this.onCaptureCopy(e, false),\n );\n this.quill.root.addEventListener('cut', (e) => this.onCaptureCopy(e, true));\n this.quill.root.addEventListener('paste', this.onCapturePaste.bind(this));\n this.matchers = [];\n CLIPBOARD_CONFIG.concat(this.options.matchers ?? []).forEach(\n ([selector, matcher]) => {\n this.addMatcher(selector, matcher);\n },\n );\n }\n\n addMatcher(selector: Selector, matcher: Matcher) {\n this.matchers.push([selector, matcher]);\n }\n\n convert(\n { html, text }: { html?: string; text?: string },\n formats: Record = {},\n ) {\n if (formats[CodeBlock.blotName]) {\n return new Delta().insert(text || '', {\n [CodeBlock.blotName]: formats[CodeBlock.blotName],\n });\n }\n if (!html) {\n return new Delta().insert(text || '', formats);\n }\n const delta = this.convertHTML(html);\n // Remove trailing newline\n if (\n deltaEndsWith(delta, '\\n') &&\n (delta.ops[delta.ops.length - 1].attributes == null || formats.table)\n ) {\n return delta.compose(new Delta().retain(delta.length() - 1).delete(1));\n }\n return delta;\n }\n\n protected normalizeHTML(doc: Document) {\n normalizeExternalHTML(doc);\n }\n\n protected convertHTML(html: string) {\n const doc = new DOMParser().parseFromString(html, 'text/html');\n this.normalizeHTML(doc);\n const container = doc.body;\n const nodeMatches = new WeakMap();\n const [elementMatchers, textMatchers] = this.prepareMatching(\n container,\n nodeMatches,\n );\n return traverse(\n this.quill.scroll,\n container,\n elementMatchers,\n textMatchers,\n nodeMatches,\n );\n }\n\n dangerouslyPasteHTML(html: string, source?: EmitterSource): void;\n dangerouslyPasteHTML(\n index: number,\n html: string,\n source?: EmitterSource,\n ): void;\n dangerouslyPasteHTML(\n index: number | string,\n html?: string,\n source: EmitterSource = Quill.sources.API,\n ) {\n if (typeof index === 'string') {\n const delta = this.convert({ html: index, text: '' });\n // @ts-expect-error\n this.quill.setContents(delta, html);\n this.quill.setSelection(0, Quill.sources.SILENT);\n } else {\n const paste = this.convert({ html, text: '' });\n this.quill.updateContents(\n new Delta().retain(index).concat(paste),\n source,\n );\n this.quill.setSelection(index + paste.length(), Quill.sources.SILENT);\n }\n }\n\n onCaptureCopy(e: ClipboardEvent, isCut = false) {\n if (e.defaultPrevented) return;\n e.preventDefault();\n const [range] = this.quill.selection.getRange();\n if (range == null) return;\n const { html, text } = this.onCopy(range, isCut);\n e.clipboardData?.setData('text/plain', text);\n e.clipboardData?.setData('text/html', html);\n if (isCut) {\n deleteRange({ range, quill: this.quill });\n }\n }\n\n /*\n * https://www.iana.org/assignments/media-types/text/uri-list\n */\n private normalizeURIList(urlList: string) {\n return (\n urlList\n .split(/\\r?\\n/)\n // Ignore all comments\n .filter((url) => url[0] !== '#')\n .join('\\n')\n );\n }\n\n onCapturePaste(e: ClipboardEvent) {\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n e.preventDefault();\n const range = this.quill.getSelection(true);\n if (range == null) return;\n const html = e.clipboardData?.getData('text/html');\n let text = e.clipboardData?.getData('text/plain');\n if (!html && !text) {\n const urlList = e.clipboardData?.getData('text/uri-list');\n if (urlList) {\n text = this.normalizeURIList(urlList);\n }\n }\n const files = Array.from(e.clipboardData?.files || []);\n if (!html && files.length > 0) {\n this.quill.uploader.upload(range, files);\n return;\n }\n if (html && files.length > 0) {\n const doc = new DOMParser().parseFromString(html, 'text/html');\n if (\n doc.body.childElementCount === 1 &&\n doc.body.firstElementChild?.tagName === 'IMG'\n ) {\n this.quill.uploader.upload(range, files);\n return;\n }\n }\n this.onPaste(range, { html, text });\n }\n\n onCopy(range: Range, isCut: boolean): { html: string; text: string };\n onCopy(range: Range) {\n const text = this.quill.getText(range);\n const html = this.quill.getSemanticHTML(range);\n return { html, text };\n }\n\n onPaste(range: Range, { text, html }: { text?: string; html?: string }) {\n const formats = this.quill.getFormat(range.index);\n const pastedDelta = this.convert({ text, html }, formats);\n debug.log('onPaste', pastedDelta, { text, html });\n const delta = new Delta()\n .retain(range.index)\n .delete(range.length)\n .concat(pastedDelta);\n this.quill.updateContents(delta, Quill.sources.USER);\n // range.length contributes to delta.length()\n this.quill.setSelection(\n delta.length() - range.length,\n Quill.sources.SILENT,\n );\n this.quill.scrollSelectionIntoView();\n }\n\n prepareMatching(container: Element, nodeMatches: WeakMap) {\n const elementMatchers: Matcher[] = [];\n const textMatchers: Matcher[] = [];\n this.matchers.forEach((pair) => {\n const [selector, matcher] = pair;\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n Array.from(container.querySelectorAll(selector)).forEach((node) => {\n if (nodeMatches.has(node)) {\n const matches = nodeMatches.get(node);\n matches?.push(matcher);\n } else {\n nodeMatches.set(node, [matcher]);\n }\n });\n break;\n }\n });\n return [elementMatchers, textMatchers];\n }\n}\n\nfunction applyFormat(\n delta: Delta,\n format: string,\n value: unknown,\n scroll: ScrollBlot,\n): Delta {\n if (!scroll.query(format)) {\n return delta;\n }\n\n return delta.reduce((newDelta, op) => {\n if (!op.insert) return newDelta;\n if (op.attributes && op.attributes[format]) {\n return newDelta.push(op);\n }\n const formats = value ? { [format]: value } : {};\n return newDelta.insert(op.insert, { ...formats, ...op.attributes });\n }, new Delta());\n}\n\nfunction deltaEndsWith(delta: Delta, text: string) {\n let endText = '';\n for (\n let i = delta.ops.length - 1;\n i >= 0 && endText.length < text.length;\n --i // eslint-disable-line no-plusplus\n ) {\n const op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1 * text.length) === text;\n}\n\nfunction isLine(node: Node, scroll: ScrollBlot) {\n if (!(node instanceof Element)) return false;\n const match = scroll.query(node);\n // @ts-expect-error\n if (match && match.prototype instanceof EmbedBlot) return false;\n\n return [\n 'address',\n 'article',\n 'blockquote',\n 'canvas',\n 'dd',\n 'div',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'iframe',\n 'li',\n 'main',\n 'nav',\n 'ol',\n 'output',\n 'p',\n 'pre',\n 'section',\n 'table',\n 'td',\n 'tr',\n 'ul',\n 'video',\n ].includes(node.tagName.toLowerCase());\n}\n\nfunction isBetweenInlineElements(node: HTMLElement, scroll: ScrollBlot) {\n return (\n node.previousElementSibling &&\n node.nextElementSibling &&\n !isLine(node.previousElementSibling, scroll) &&\n !isLine(node.nextElementSibling, scroll)\n );\n}\n\nconst preNodes = new WeakMap();\nfunction isPre(node: Node | null) {\n if (node == null) return false;\n if (!preNodes.has(node)) {\n // @ts-expect-error\n if (node.tagName === 'PRE') {\n preNodes.set(node, true);\n } else {\n preNodes.set(node, isPre(node.parentNode));\n }\n }\n return preNodes.get(node);\n}\n\nfunction traverse(\n scroll: ScrollBlot,\n node: ChildNode,\n elementMatchers: Matcher[],\n textMatchers: Matcher[],\n nodeMatches: WeakMap,\n): Delta {\n // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce((delta: Delta, matcher) => {\n return matcher(node, delta, scroll);\n }, new Delta());\n }\n if (node.nodeType === node.ELEMENT_NODE) {\n return Array.from(node.childNodes || []).reduce((delta, childNode) => {\n let childrenDelta = traverse(\n scroll,\n childNode,\n elementMatchers,\n textMatchers,\n nodeMatches,\n );\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce((reducedDelta, matcher) => {\n return matcher(childNode as HTMLElement, reducedDelta, scroll);\n }, childrenDelta);\n childrenDelta = (nodeMatches.get(childNode) || []).reduce(\n (reducedDelta, matcher) => {\n return matcher(childNode, reducedDelta, scroll);\n },\n childrenDelta,\n );\n }\n return delta.concat(childrenDelta);\n }, new Delta());\n }\n return new Delta();\n}\n\nfunction createMatchAlias(format: string) {\n return (_node: Element, delta: Delta, scroll: ScrollBlot) => {\n return applyFormat(delta, format, true, scroll);\n };\n}\n\nfunction matchAttributor(node: HTMLElement, delta: Delta, scroll: ScrollBlot) {\n const attributes = Attributor.keys(node);\n const classes = ClassAttributor.keys(node);\n const styles = StyleAttributor.keys(node);\n const formats: Record = {};\n attributes\n .concat(classes)\n .concat(styles)\n .forEach((name) => {\n let attr = scroll.query(name, Scope.ATTRIBUTE) as Attributor;\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n attr = STYLE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n });\n\n return Object.entries(formats).reduce(\n (newDelta, [name, value]) => applyFormat(newDelta, name, value, scroll),\n delta,\n );\n}\n\nfunction matchBlot(node: Node, delta: Delta, scroll: ScrollBlot) {\n const match = scroll.query(node);\n if (match == null) return delta;\n // @ts-expect-error\n if (match.prototype instanceof EmbedBlot) {\n const embed = {};\n // @ts-expect-error\n const value = match.value(node);\n if (value != null) {\n // @ts-expect-error\n embed[match.blotName] = value;\n // @ts-expect-error\n return new Delta().insert(embed, match.formats(node, scroll));\n }\n } else {\n // @ts-expect-error\n if (match.prototype instanceof BlockBlot && !deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n if (\n 'blotName' in match &&\n 'formats' in match &&\n typeof match.formats === 'function'\n ) {\n return applyFormat(\n delta,\n match.blotName,\n match.formats(node, scroll),\n scroll,\n );\n }\n }\n return delta;\n}\n\nfunction matchBreak(node: Node, delta: Delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchCodeBlock(node: Node, delta: Delta, scroll: ScrollBlot) {\n const match = scroll.query('code-block');\n const language =\n match && 'formats' in match && typeof match.formats === 'function'\n ? match.formats(node, scroll)\n : true;\n return applyFormat(delta, 'code-block', language, scroll);\n}\n\nfunction matchIgnore() {\n return new Delta();\n}\n\nfunction matchIndent(node: Node, delta: Delta, scroll: ScrollBlot) {\n const match = scroll.query(node);\n if (\n match == null ||\n // @ts-expect-error\n match.blotName !== 'list' ||\n !deltaEndsWith(delta, '\\n')\n ) {\n return delta;\n }\n let indent = -1;\n let parent = node.parentNode;\n while (parent != null) {\n // @ts-expect-error\n if (['OL', 'UL'].includes(parent.tagName)) {\n indent += 1;\n }\n parent = parent.parentNode;\n }\n if (indent <= 0) return delta;\n return delta.reduce((composed, op) => {\n if (!op.insert) return composed;\n if (op.attributes && typeof op.attributes.indent === 'number') {\n return composed.push(op);\n }\n return composed.insert(op.insert, { indent, ...(op.attributes || {}) });\n }, new Delta());\n}\n\nfunction matchList(node: Node, delta: Delta, scroll: ScrollBlot) {\n const element = node as Element;\n let list = element.tagName === 'OL' ? 'ordered' : 'bullet';\n\n const checkedAttr = element.getAttribute('data-checked');\n if (checkedAttr) {\n list = checkedAttr === 'true' ? 'checked' : 'unchecked';\n }\n\n return applyFormat(delta, 'list', list, scroll);\n}\n\nfunction matchNewline(node: Node, delta: Delta, scroll: ScrollBlot) {\n if (!deltaEndsWith(delta, '\\n')) {\n if (\n isLine(node, scroll) &&\n (node.childNodes.length > 0 || node instanceof HTMLParagraphElement)\n ) {\n return delta.insert('\\n');\n }\n if (delta.length() > 0 && node.nextSibling) {\n let nextSibling: Node | null = node.nextSibling;\n while (nextSibling != null) {\n if (isLine(nextSibling, scroll)) {\n return delta.insert('\\n');\n }\n const match = scroll.query(nextSibling);\n // @ts-expect-error\n if (match && match.prototype instanceof BlockEmbed) {\n return delta.insert('\\n');\n }\n nextSibling = nextSibling.firstChild;\n }\n }\n }\n return delta;\n}\n\nfunction matchStyles(node: HTMLElement, delta: Delta, scroll: ScrollBlot) {\n const formats: Record = {};\n const style: Partial = node.style || {};\n if (style.fontStyle === 'italic') {\n formats.italic = true;\n }\n if (style.textDecoration === 'underline') {\n formats.underline = true;\n }\n if (style.textDecoration === 'line-through') {\n formats.strike = true;\n }\n if (\n style.fontWeight?.startsWith('bold') ||\n // @ts-expect-error Fix me later\n parseInt(style.fontWeight, 10) >= 700\n ) {\n formats.bold = true;\n }\n delta = Object.entries(formats).reduce(\n (newDelta, [name, value]) => applyFormat(newDelta, name, value, scroll),\n delta,\n );\n // @ts-expect-error\n if (parseFloat(style.textIndent || 0) > 0) {\n // Could be 0.5in\n return new Delta().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchTable(\n node: HTMLTableRowElement,\n delta: Delta,\n scroll: ScrollBlot,\n) {\n const table =\n node.parentElement?.tagName === 'TABLE'\n ? node.parentElement\n : node.parentElement?.parentElement;\n if (table != null) {\n const rows = Array.from(table.querySelectorAll('tr'));\n const row = rows.indexOf(node) + 1;\n return applyFormat(delta, 'table', row, scroll);\n }\n return delta;\n}\n\nfunction matchText(node: HTMLElement, delta: Delta, scroll: ScrollBlot) {\n // @ts-expect-error\n let text = node.data;\n // Word represents empty line with  \n if (node.parentElement?.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (!isPre(node)) {\n if (\n text.trim().length === 0 &&\n text.includes('\\n') &&\n !isBetweenInlineElements(node, scroll)\n ) {\n return delta;\n }\n const replacer = (collapse: unknown, match: string) => {\n const replaced = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return replaced.length < 1 && collapse ? ' ' : replaced;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if (\n (node.previousSibling == null &&\n node.parentElement != null &&\n isLine(node.parentElement, scroll)) ||\n (node.previousSibling instanceof Element &&\n isLine(node.previousSibling, scroll))\n ) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if (\n (node.nextSibling == null &&\n node.parentElement != null &&\n isLine(node.parentElement, scroll)) ||\n (node.nextSibling instanceof Element && isLine(node.nextSibling, scroll))\n ) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\nexport {\n Clipboard as default,\n matchAttributor,\n matchBlot,\n matchNewline,\n matchText,\n traverse,\n};\n", "import { Scope } from 'parchment';\nimport type Delta from 'quill-delta';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\nimport type Scroll from '../blots/scroll.js';\nimport type { Range } from '../core/selection.js';\n\nexport interface HistoryOptions {\n userOnly: boolean;\n delay: number;\n maxStack: number;\n}\n\nexport interface StackItem {\n delta: Delta;\n range: Range | null;\n}\n\ninterface Stack {\n undo: StackItem[];\n redo: StackItem[];\n}\n\nclass History extends Module {\n static DEFAULTS: HistoryOptions = {\n delay: 1000,\n maxStack: 100,\n userOnly: false,\n };\n\n lastRecorded = 0;\n ignoreChange = false;\n stack: Stack = { undo: [], redo: [] };\n currentRange: Range | null = null;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n this.quill.on(\n Quill.events.EDITOR_CHANGE,\n (eventName, value, oldValue, source) => {\n if (eventName === Quill.events.SELECTION_CHANGE) {\n if (value && source !== Quill.sources.SILENT) {\n this.currentRange = value;\n }\n } else if (eventName === Quill.events.TEXT_CHANGE) {\n if (!this.ignoreChange) {\n if (!this.options.userOnly || source === Quill.sources.USER) {\n this.record(value, oldValue);\n } else {\n this.transform(value);\n }\n }\n\n this.currentRange = transformRange(this.currentRange, value);\n }\n },\n );\n\n this.quill.keyboard.addBinding(\n { key: 'z', shortKey: true },\n this.undo.bind(this),\n );\n this.quill.keyboard.addBinding(\n { key: ['z', 'Z'], shortKey: true, shiftKey: true },\n this.redo.bind(this),\n );\n if (/Win/i.test(navigator.platform)) {\n this.quill.keyboard.addBinding(\n { key: 'y', shortKey: true },\n this.redo.bind(this),\n );\n }\n\n this.quill.root.addEventListener('beforeinput', (event) => {\n if (event.inputType === 'historyUndo') {\n this.undo();\n event.preventDefault();\n } else if (event.inputType === 'historyRedo') {\n this.redo();\n event.preventDefault();\n }\n });\n }\n\n change(source: 'undo' | 'redo', dest: 'redo' | 'undo') {\n if (this.stack[source].length === 0) return;\n const item = this.stack[source].pop();\n if (!item) return;\n const base = this.quill.getContents();\n const inverseDelta = item.delta.invert(base);\n this.stack[dest].push({\n delta: inverseDelta,\n range: transformRange(item.range, inverseDelta),\n });\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(item.delta, Quill.sources.USER);\n this.ignoreChange = false;\n\n this.restoreSelection(item);\n }\n\n clear() {\n this.stack = { undo: [], redo: [] };\n }\n\n cutoff() {\n this.lastRecorded = 0;\n }\n\n record(changeDelta: Delta, oldDelta: Delta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n let undoDelta = changeDelta.invert(oldDelta);\n let undoRange = this.currentRange;\n const timestamp = Date.now();\n if (\n // @ts-expect-error Fix me later\n this.lastRecorded + this.options.delay > timestamp &&\n this.stack.undo.length > 0\n ) {\n const item = this.stack.undo.pop();\n if (item) {\n undoDelta = undoDelta.compose(item.delta);\n undoRange = item.range;\n }\n } else {\n this.lastRecorded = timestamp;\n }\n if (undoDelta.length() === 0) return;\n this.stack.undo.push({ delta: undoDelta, range: undoRange });\n // @ts-expect-error Fix me later\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n\n redo() {\n this.change('redo', 'undo');\n }\n\n transform(delta: Delta) {\n transformStack(this.stack.undo, delta);\n transformStack(this.stack.redo, delta);\n }\n\n undo() {\n this.change('undo', 'redo');\n }\n\n protected restoreSelection(stackItem: StackItem) {\n if (stackItem.range) {\n this.quill.setSelection(stackItem.range, Quill.sources.USER);\n } else {\n const index = getLastChangeIndex(this.quill.scroll, stackItem.delta);\n this.quill.setSelection(index, Quill.sources.USER);\n }\n }\n}\n\nfunction transformStack(stack: StackItem[], delta: Delta) {\n let remoteDelta = delta;\n for (let i = stack.length - 1; i >= 0; i -= 1) {\n const oldItem = stack[i];\n stack[i] = {\n delta: remoteDelta.transform(oldItem.delta, true),\n range: oldItem.range && transformRange(oldItem.range, remoteDelta),\n };\n remoteDelta = oldItem.delta.transform(remoteDelta);\n if (stack[i].delta.length() === 0) {\n stack.splice(i, 1);\n }\n }\n}\n\nfunction endsWithNewlineChange(scroll: Scroll, delta: Delta) {\n const lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some((attr) => {\n return scroll.query(attr, Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(scroll: Scroll, delta: Delta) {\n const deleteLength = delta.reduce((length, op) => {\n return length + (op.delete || 0);\n }, 0);\n let changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(scroll, delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\nfunction transformRange(range: Range | null, delta: Delta) {\n if (!range) return range;\n const start = delta.transformPosition(range.index);\n const end = delta.transformPosition(range.index + range.length);\n return { index: start, length: end - start };\n}\n\nexport { History as default, getLastChangeIndex };\n", "import Delta from 'quill-delta';\nimport type Quill from '../core/quill.js';\nimport Emitter from '../core/emitter.js';\nimport Module from '../core/module.js';\nimport type { Range } from '../core/selection.js';\n\ninterface UploaderOptions {\n mimetypes: string[];\n handler: (this: { quill: Quill }, range: Range, files: File[]) => void;\n}\n\nclass Uploader extends Module {\n static DEFAULTS: UploaderOptions;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n quill.root.addEventListener('drop', (e) => {\n e.preventDefault();\n let native: ReturnType | null = null;\n if (document.caretRangeFromPoint) {\n native = document.caretRangeFromPoint(e.clientX, e.clientY);\n // @ts-expect-error\n } else if (document.caretPositionFromPoint) {\n // @ts-expect-error\n const position = document.caretPositionFromPoint(e.clientX, e.clientY);\n native = document.createRange();\n native.setStart(position.offsetNode, position.offset);\n native.setEnd(position.offsetNode, position.offset);\n }\n\n const normalized = native && quill.selection.normalizeNative(native);\n if (normalized) {\n const range = quill.selection.normalizedToRange(normalized);\n if (e.dataTransfer?.files) {\n this.upload(range, e.dataTransfer.files);\n }\n }\n });\n }\n\n upload(range: Range, files: FileList | File[]) {\n const uploads: File[] = [];\n Array.from(files).forEach((file) => {\n if (file && this.options.mimetypes?.includes(file.type)) {\n uploads.push(file);\n }\n });\n if (uploads.length > 0) {\n // @ts-expect-error Fix me later\n this.options.handler.call(this, range, uploads);\n }\n }\n}\n\nUploader.DEFAULTS = {\n mimetypes: ['image/png', 'image/jpeg'],\n handler(range: Range, files: File[]) {\n if (!this.quill.scroll.query('image')) {\n return;\n }\n const promises = files.map>((file) => {\n return new Promise((resolve) => {\n const reader = new FileReader();\n reader.onload = () => {\n resolve(reader.result as string);\n };\n reader.readAsDataURL(file);\n });\n });\n Promise.all(promises).then((images) => {\n const update = images.reduce((delta: Delta, image) => {\n return delta.insert({ image });\n }, new Delta().retain(range.index).delete(range.length)) as Delta;\n this.quill.updateContents(update, Emitter.sources.USER);\n this.quill.setSelection(\n range.index + images.length,\n Emitter.sources.SILENT,\n );\n });\n },\n};\n\nexport default Uploader;\n", "import Delta from 'quill-delta';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\nimport type { Range } from '../core/selection.js';\nimport { deleteRange } from './keyboard.js';\n\nconst INSERT_TYPES = ['insertText', 'insertReplacementText'];\n\nclass Input extends Module {\n constructor(quill: Quill, options: Record) {\n super(quill, options);\n\n quill.root.addEventListener('beforeinput', (event) => {\n this.handleBeforeInput(event);\n });\n\n // Gboard with English input on Android triggers `compositionstart` sometimes even\n // users are not going to type anything.\n if (!/Android/i.test(navigator.userAgent)) {\n quill.on(Quill.events.COMPOSITION_BEFORE_START, () => {\n this.handleCompositionStart();\n });\n }\n }\n\n private deleteRange(range: Range) {\n deleteRange({ range, quill: this.quill });\n }\n\n private replaceText(range: Range, text = '') {\n if (range.length === 0) return false;\n\n if (text) {\n // Follow the native behavior that inherits the formats of the first character\n const formats = this.quill.getFormat(range.index, 1);\n this.deleteRange(range);\n this.quill.updateContents(\n new Delta().retain(range.index).insert(text, formats),\n Quill.sources.USER,\n );\n } else {\n this.deleteRange(range);\n }\n\n this.quill.setSelection(range.index + text.length, 0, Quill.sources.SILENT);\n return true;\n }\n\n private handleBeforeInput(event: InputEvent) {\n if (\n this.quill.composition.isComposing ||\n event.defaultPrevented ||\n !INSERT_TYPES.includes(event.inputType)\n ) {\n return;\n }\n\n const staticRange = event.getTargetRanges\n ? event.getTargetRanges()[0]\n : null;\n if (!staticRange || staticRange.collapsed === true) {\n return;\n }\n\n const text = getPlainTextFromInputEvent(event);\n if (text == null) {\n return;\n }\n const normalized = this.quill.selection.normalizeNative(staticRange);\n const range = normalized\n ? this.quill.selection.normalizedToRange(normalized)\n : null;\n if (range && this.replaceText(range, text)) {\n event.preventDefault();\n }\n }\n\n private handleCompositionStart() {\n const range = this.quill.getSelection();\n if (range) {\n this.replaceText(range);\n }\n }\n}\n\nfunction getPlainTextFromInputEvent(event: InputEvent) {\n // When `inputType` is \"insertText\":\n // - `event.data` should be string (Safari uses `event.dataTransfer`).\n // - `event.dataTransfer` should be null.\n // When `inputType` is \"insertReplacementText\":\n // - `event.data` should be null.\n // - `event.dataTransfer` should contain \"text/plain\" data.\n\n if (typeof event.data === 'string') {\n return event.data;\n }\n if (event.dataTransfer?.types.includes('text/plain')) {\n return event.dataTransfer.getData('text/plain');\n }\n return null;\n}\n\nexport default Input;\n", "import { ParentBlot } from 'parchment';\nimport Module from '../core/module.js';\nimport Quill from '../core/quill.js';\n\nconst isMac = /Mac/i.test(navigator.platform);\n\n// Export for testing\nexport const TTL_FOR_VALID_SELECTION_CHANGE = 100;\n\n// A loose check to determine if the shortcut can move the caret before a UI node:\n// [CARET]
    [CONTENT]
    \nconst canMoveCaretBeforeUINode = (event: KeyboardEvent) => {\n if (\n event.key === 'ArrowLeft' ||\n event.key === 'ArrowRight' || // RTL scripts or moving from the end of the previous line\n event.key === 'ArrowUp' ||\n event.key === 'ArrowDown' ||\n event.key === 'Home'\n ) {\n return true;\n }\n\n if (isMac && event.key === 'a' && event.ctrlKey === true) {\n return true;\n }\n\n return false;\n};\n\nclass UINode extends Module {\n isListening = false;\n selectionChangeDeadline = 0;\n\n constructor(quill: Quill, options: Record) {\n super(quill, options);\n\n this.handleArrowKeys();\n this.handleNavigationShortcuts();\n }\n\n private handleArrowKeys() {\n this.quill.keyboard.addBinding({\n key: ['ArrowLeft', 'ArrowRight'],\n offset: 0,\n shiftKey: null,\n handler(range, { line, event }) {\n if (!(line instanceof ParentBlot) || !line.uiNode) {\n return true;\n }\n\n const isRTL = getComputedStyle(line.domNode)['direction'] === 'rtl';\n if (\n (isRTL && event.key !== 'ArrowRight') ||\n (!isRTL && event.key !== 'ArrowLeft')\n ) {\n return true;\n }\n\n this.quill.setSelection(\n range.index - 1,\n range.length + (event.shiftKey ? 1 : 0),\n Quill.sources.USER,\n );\n return false;\n },\n });\n }\n\n private handleNavigationShortcuts() {\n this.quill.root.addEventListener('keydown', (event) => {\n if (!event.defaultPrevented && canMoveCaretBeforeUINode(event)) {\n this.ensureListeningToSelectionChange();\n }\n });\n }\n\n /**\n * We only listen to the `selectionchange` event when\n * there is an intention of moving the caret to the beginning using shortcuts.\n * This is primarily implemented to prevent infinite loops, as we are changing\n * the selection within the handler of a `selectionchange` event.\n */\n private ensureListeningToSelectionChange() {\n this.selectionChangeDeadline = Date.now() + TTL_FOR_VALID_SELECTION_CHANGE;\n\n if (this.isListening) return;\n this.isListening = true;\n\n const listener = () => {\n this.isListening = false;\n\n if (Date.now() <= this.selectionChangeDeadline) {\n this.handleSelectionChange();\n }\n };\n\n document.addEventListener('selectionchange', listener, {\n once: true,\n });\n }\n\n private handleSelectionChange() {\n const selection = document.getSelection();\n if (!selection) return;\n const range = selection.getRangeAt(0);\n if (range.collapsed !== true || range.startOffset !== 0) return;\n\n const line = this.quill.scroll.find(range.startContainer);\n if (!(line instanceof ParentBlot) || !line.uiNode) return;\n\n const newRange = document.createRange();\n newRange.setStartAfter(line.uiNode);\n newRange.setEndAfter(line.uiNode);\n selection.removeAllRanges();\n selection.addRange(newRange);\n }\n}\n\nexport default UINode;\n", "import Quill, { Parchment, Range } from './core/quill.js';\nimport type {\n Bounds,\n DebugLevel,\n EmitterSource,\n ExpandedQuillOptions,\n QuillOptions,\n} from './core/quill.js';\n\nimport Block, { BlockEmbed } from './blots/block.js';\nimport Break from './blots/break.js';\nimport Container from './blots/container.js';\nimport Cursor from './blots/cursor.js';\nimport Embed from './blots/embed.js';\nimport Inline from './blots/inline.js';\nimport Scroll from './blots/scroll.js';\nimport TextBlot from './blots/text.js';\n\nimport Clipboard from './modules/clipboard.js';\nimport History from './modules/history.js';\nimport Keyboard from './modules/keyboard.js';\nimport Uploader from './modules/uploader.js';\nimport Delta, { Op, OpIterator, AttributeMap } from 'quill-delta';\nimport Input from './modules/input.js';\nimport UINode from './modules/uiNode.js';\n\nexport { default as Module } from './core/module.js';\nexport { Delta, Op, OpIterator, AttributeMap, Parchment, Range };\nexport type {\n Bounds,\n DebugLevel,\n EmitterSource,\n ExpandedQuillOptions,\n QuillOptions,\n};\n\nQuill.register({\n 'blots/block': Block,\n 'blots/block/embed': BlockEmbed,\n 'blots/break': Break,\n 'blots/container': Container,\n 'blots/cursor': Cursor,\n 'blots/embed': Embed,\n 'blots/inline': Inline,\n 'blots/scroll': Scroll,\n 'blots/text': TextBlot,\n\n 'modules/clipboard': Clipboard,\n 'modules/history': History,\n 'modules/keyboard': Keyboard,\n 'modules/uploader': Uploader,\n 'modules/input': Input,\n 'modules/uiNode': UINode,\n});\n\nexport default Quill;\n", "import { ClassAttributor, Scope } from 'parchment';\n\nclass IndentAttributor extends ClassAttributor {\n add(node: HTMLElement, value: string | number) {\n let normalizedValue = 0;\n if (value === '+1' || value === '-1') {\n const indent = this.value(node) || 0;\n normalizedValue = value === '+1' ? indent + 1 : indent - 1;\n } else if (typeof value === 'number') {\n normalizedValue = value;\n }\n if (normalizedValue === 0) {\n this.remove(node);\n return true;\n }\n return super.add(node, normalizedValue.toString());\n }\n\n canAdd(node: HTMLElement, value: string) {\n return super.canAdd(node, value) || super.canAdd(node, parseInt(value, 10));\n }\n\n value(node: HTMLElement) {\n return parseInt(super.value(node), 10) || undefined; // Don't return NaN\n }\n}\n\nconst IndentClass = new IndentAttributor('indent', 'ql-indent', {\n scope: Scope.BLOCK,\n // @ts-expect-error\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8],\n});\n\nexport default IndentClass;\n", "import Block from '../blots/block.js';\n\nclass Blockquote extends Block {\n static blotName = 'blockquote';\n static tagName = 'blockquote';\n}\n\nexport default Blockquote;\n", "import Block from '../blots/block.js';\n\nclass Header extends Block {\n static blotName = 'header';\n static tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\n static formats(domNode: Element) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n}\n\nexport default Header;\n", "import Block from '../blots/block.js';\nimport Container from '../blots/container.js';\nimport type Scroll from '../blots/scroll.js';\nimport Quill from '../core/quill.js';\n\nclass ListContainer extends Container {}\nListContainer.blotName = 'list-container';\nListContainer.tagName = 'OL';\n\nclass ListItem extends Block {\n static create(value: string) {\n const node = super.create() as HTMLElement;\n node.setAttribute('data-list', value);\n return node;\n }\n\n static formats(domNode: HTMLElement) {\n return domNode.getAttribute('data-list') || undefined;\n }\n\n static register() {\n Quill.register(ListContainer);\n }\n\n constructor(scroll: Scroll, domNode: HTMLElement) {\n super(scroll, domNode);\n const ui = domNode.ownerDocument.createElement('span');\n const listEventHandler = (e: Event) => {\n if (!scroll.isEnabled()) return;\n const format = this.statics.formats(domNode, scroll);\n if (format === 'checked') {\n this.format('list', 'unchecked');\n e.preventDefault();\n } else if (format === 'unchecked') {\n this.format('list', 'checked');\n e.preventDefault();\n }\n };\n ui.addEventListener('mousedown', listEventHandler);\n ui.addEventListener('touchstart', listEventHandler);\n this.attachUI(ui);\n }\n\n format(name: string, value: string) {\n if (name === this.statics.blotName && value) {\n this.domNode.setAttribute('data-list', value);\n } else {\n super.format(name, value);\n }\n }\n}\nListItem.blotName = 'list';\nListItem.tagName = 'LI';\n\nListContainer.allowedChildren = [ListItem];\nListItem.requiredContainer = ListContainer;\n\nexport { ListContainer, ListItem as default };\n", "import Inline from '../blots/inline.js';\n\nclass Bold extends Inline {\n static blotName = 'bold';\n static tagName = ['STRONG', 'B'];\n\n static create() {\n return super.create();\n }\n\n static formats() {\n return true;\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n}\n\nexport default Bold;\n", "import Bold from './bold.js';\n\nclass Italic extends Bold {\n static blotName = 'italic';\n static tagName = ['EM', 'I'];\n}\n\nexport default Italic;\n", "import Inline from '../blots/inline.js';\n\nclass Link extends Inline {\n static blotName = 'link';\n static tagName = 'A';\n static SANITIZED_URL = 'about:blank';\n static PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel', 'sms'];\n\n static create(value: string) {\n const node = super.create(value) as HTMLElement;\n node.setAttribute('href', this.sanitize(value));\n node.setAttribute('rel', 'noopener noreferrer');\n node.setAttribute('target', '_blank');\n return node;\n }\n\n static formats(domNode: HTMLElement) {\n return domNode.getAttribute('href');\n }\n\n static sanitize(url: string) {\n return sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;\n }\n\n format(name: string, value: unknown) {\n if (name !== this.statics.blotName || !value) {\n super.format(name, value);\n } else {\n // @ts-expect-error\n this.domNode.setAttribute('href', this.constructor.sanitize(value));\n }\n }\n}\n\nfunction sanitize(url: string, protocols: string[]) {\n const anchor = document.createElement('a');\n anchor.href = url;\n const protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\nexport { Link as default, sanitize };\n", "import Inline from '../blots/inline.js';\n\nclass Script extends Inline {\n static blotName = 'script';\n static tagName = ['SUB', 'SUP'];\n\n static create(value: 'super' | 'sub' | (string & {})) {\n if (value === 'super') {\n return document.createElement('sup');\n }\n if (value === 'sub') {\n return document.createElement('sub');\n }\n return super.create(value);\n }\n\n static formats(domNode: HTMLElement) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n}\n\nexport default Script;\n", "import Bold from './bold.js';\n\nclass Strike extends Bold {\n static blotName = 'strike';\n static tagName = ['S', 'STRIKE'];\n}\n\nexport default Strike;\n", "import Inline from '../blots/inline.js';\n\nclass Underline extends Inline {\n static blotName = 'underline';\n static tagName = 'U';\n}\n\nexport default Underline;\n", "import Embed from '../blots/embed.js';\n\nclass Formula extends Embed {\n static blotName = 'formula';\n static className = 'ql-formula';\n static tagName = 'SPAN';\n\n static create(value: string) {\n // @ts-expect-error\n if (window.katex == null) {\n throw new Error('Formula module requires KaTeX.');\n }\n const node = super.create(value) as Element;\n if (typeof value === 'string') {\n // @ts-expect-error\n window.katex.render(value, node, {\n throwOnError: false,\n errorColor: '#f00',\n });\n node.setAttribute('data-value', value);\n }\n return node;\n }\n\n static value(domNode: Element) {\n return domNode.getAttribute('data-value');\n }\n\n html() {\n const { formula } = this.value();\n return `${formula}`;\n }\n}\n\nexport default Formula;\n", "import { EmbedBlot } from 'parchment';\nimport { sanitize } from './link.js';\n\nconst ATTRIBUTES = ['alt', 'height', 'width'];\n\nclass Image extends EmbedBlot {\n static blotName = 'image';\n static tagName = 'IMG';\n\n static create(value: string) {\n const node = super.create(value) as Element;\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n }\n return node;\n }\n\n static formats(domNode: Element) {\n return ATTRIBUTES.reduce(\n (formats: Record, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n },\n {},\n );\n }\n\n static match(url: string) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static sanitize(url: string) {\n return sanitize(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode: Element) {\n return domNode.getAttribute('src');\n }\n\n domNode: HTMLImageElement;\n\n format(name: string, value: string) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\n\nexport default Image;\n", "import { BlockEmbed } from '../blots/block.js';\nimport Link from './link.js';\n\nconst ATTRIBUTES = ['height', 'width'];\n\nclass Video extends BlockEmbed {\n static blotName = 'video';\n static className = 'ql-video';\n static tagName = 'IFRAME';\n\n static create(value: string) {\n const node = super.create(value) as Element;\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', 'true');\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n\n static formats(domNode: Element) {\n return ATTRIBUTES.reduce(\n (formats: Record, attribute) => {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n },\n {},\n );\n }\n\n static sanitize(url: string) {\n return Link.sanitize(url);\n }\n\n static value(domNode: Element) {\n return domNode.getAttribute('src');\n }\n\n domNode: HTMLVideoElement;\n\n format(name: string, value: string) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n\n html() {\n const { video } = this.value();\n return `${video}`;\n }\n}\n\nexport default Video;\n", "import Delta from 'quill-delta';\nimport { ClassAttributor, Scope } from 'parchment';\nimport type { Blot, ScrollBlot } from 'parchment';\nimport Inline from '../blots/inline.js';\nimport Quill from '../core/quill.js';\nimport Module from '../core/module.js';\nimport { blockDelta } from '../blots/block.js';\nimport BreakBlot from '../blots/break.js';\nimport CursorBlot from '../blots/cursor.js';\nimport TextBlot, { escapeText } from '../blots/text.js';\nimport CodeBlock, { CodeBlockContainer } from '../formats/code.js';\nimport { traverse } from './clipboard.js';\n\nconst TokenAttributor = new ClassAttributor('code-token', 'hljs', {\n scope: Scope.INLINE,\n});\nclass CodeToken extends Inline {\n static formats(node: Element, scroll: ScrollBlot) {\n while (node != null && node !== scroll.domNode) {\n if (node.classList && node.classList.contains(CodeBlock.className)) {\n // @ts-expect-error\n return super.formats(node, scroll);\n }\n // @ts-expect-error\n node = node.parentNode;\n }\n return undefined;\n }\n\n constructor(scroll: ScrollBlot, domNode: Node, value: unknown) {\n // @ts-expect-error\n super(scroll, domNode, value);\n TokenAttributor.add(this.domNode, value);\n }\n\n format(format: string, value: unknown) {\n if (format !== CodeToken.blotName) {\n super.format(format, value);\n } else if (value) {\n TokenAttributor.add(this.domNode, value);\n } else {\n TokenAttributor.remove(this.domNode);\n this.domNode.classList.remove(this.statics.className);\n }\n }\n\n optimize(...args: unknown[]) {\n // @ts-expect-error\n super.optimize(...args);\n if (!TokenAttributor.value(this.domNode)) {\n this.unwrap();\n }\n }\n}\nCodeToken.blotName = 'code-token';\nCodeToken.className = 'ql-token';\n\nclass SyntaxCodeBlock extends CodeBlock {\n static create(value: unknown) {\n const domNode = super.create(value);\n if (typeof value === 'string') {\n domNode.setAttribute('data-language', value);\n }\n return domNode;\n }\n\n static formats(domNode: Node) {\n // @ts-expect-error\n return domNode.getAttribute('data-language') || 'plain';\n }\n\n static register() {} // Syntax module will register\n\n format(name: string, value: unknown) {\n if (name === this.statics.blotName && value) {\n // @ts-expect-error\n this.domNode.setAttribute('data-language', value);\n } else {\n super.format(name, value);\n }\n }\n\n replaceWith(name: string | Blot, value?: any) {\n this.formatAt(0, this.length(), CodeToken.blotName, false);\n return super.replaceWith(name, value);\n }\n}\n\nclass SyntaxCodeBlockContainer extends CodeBlockContainer {\n forceNext?: boolean;\n cachedText?: string | null;\n\n attach() {\n super.attach();\n this.forceNext = false;\n // @ts-expect-error\n this.scroll.emitMount(this);\n }\n\n format(name: string, value: unknown) {\n if (name === SyntaxCodeBlock.blotName) {\n this.forceNext = true;\n this.children.forEach((child) => {\n // @ts-expect-error\n child.format(name, value);\n });\n }\n }\n\n formatAt(index: number, length: number, name: string, value: unknown) {\n if (name === SyntaxCodeBlock.blotName) {\n this.forceNext = true;\n }\n super.formatAt(index, length, name, value);\n }\n\n highlight(\n highlight: (text: string, language: string) => Delta,\n forced = false,\n ) {\n if (this.children.head == null) return;\n const nodes = Array.from(this.domNode.childNodes).filter(\n (node) => node !== this.uiNode,\n );\n const text = `${nodes.map((node) => node.textContent).join('\\n')}\\n`;\n const language = SyntaxCodeBlock.formats(this.children.head.domNode);\n if (forced || this.forceNext || this.cachedText !== text) {\n if (text.trim().length > 0 || this.cachedText == null) {\n const oldDelta = this.children.reduce((delta, child) => {\n // @ts-expect-error\n return delta.concat(blockDelta(child, false));\n }, new Delta());\n const delta = highlight(text, language);\n oldDelta.diff(delta).reduce((index, { retain, attributes }) => {\n // Should be all retains\n if (!retain) return index;\n if (attributes) {\n Object.keys(attributes).forEach((format) => {\n if (\n [SyntaxCodeBlock.blotName, CodeToken.blotName].includes(format)\n ) {\n // @ts-expect-error\n this.formatAt(index, retain, format, attributes[format]);\n }\n });\n }\n // @ts-expect-error\n return index + retain;\n }, 0);\n }\n this.cachedText = text;\n this.forceNext = false;\n }\n }\n\n html(index: number, length: number) {\n const [codeBlock] = this.children.find(index);\n const language = codeBlock\n ? SyntaxCodeBlock.formats(codeBlock.domNode)\n : 'plain';\n\n return `
    \\n${escapeText(\n      this.code(index, length),\n    )}\\n
    `;\n }\n\n optimize(context: Record) {\n super.optimize(context);\n if (\n this.parent != null &&\n this.children.head != null &&\n this.uiNode != null\n ) {\n const language = SyntaxCodeBlock.formats(this.children.head.domNode);\n // @ts-expect-error\n if (language !== this.uiNode.value) {\n // @ts-expect-error\n this.uiNode.value = language;\n }\n }\n }\n}\n\nSyntaxCodeBlockContainer.allowedChildren = [SyntaxCodeBlock];\nSyntaxCodeBlock.requiredContainer = SyntaxCodeBlockContainer;\nSyntaxCodeBlock.allowedChildren = [CodeToken, CursorBlot, TextBlot, BreakBlot];\n\ninterface SyntaxOptions {\n interval: number;\n languages: { key: string; label: string }[];\n hljs: any;\n}\n\nconst highlight = (lib: any, language: string, text: string) => {\n if (typeof lib.versionString === 'string') {\n const majorVersion = lib.versionString.split('.')[0];\n if (parseInt(majorVersion, 10) >= 11) {\n return lib.highlight(text, { language }).value;\n }\n }\n return lib.highlight(language, text).value;\n};\n\nclass Syntax extends Module {\n static DEFAULTS: SyntaxOptions & { hljs: any };\n\n static register() {\n Quill.register(CodeToken, true);\n Quill.register(SyntaxCodeBlock, true);\n Quill.register(SyntaxCodeBlockContainer, true);\n }\n\n languages: Record;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n if (this.options.hljs == null) {\n throw new Error(\n 'Syntax module requires highlight.js. Please include the library on the page before Quill.',\n );\n }\n // @ts-expect-error Fix me later\n this.languages = this.options.languages.reduce(\n (memo: Record, { key }) => {\n memo[key] = true;\n return memo;\n },\n {},\n );\n this.highlightBlot = this.highlightBlot.bind(this);\n this.initListener();\n this.initTimer();\n }\n\n initListener() {\n this.quill.on(Quill.events.SCROLL_BLOT_MOUNT, (blot: Blot) => {\n if (!(blot instanceof SyntaxCodeBlockContainer)) return;\n const select = this.quill.root.ownerDocument.createElement('select');\n // @ts-expect-error Fix me later\n this.options.languages.forEach(({ key, label }) => {\n const option = select.ownerDocument.createElement('option');\n option.textContent = label;\n option.setAttribute('value', key);\n select.appendChild(option);\n });\n select.addEventListener('change', () => {\n blot.format(SyntaxCodeBlock.blotName, select.value);\n this.quill.root.focus(); // Prevent scrolling\n this.highlight(blot, true);\n });\n if (blot.uiNode == null) {\n blot.attachUI(select);\n if (blot.children.head) {\n select.value = SyntaxCodeBlock.formats(blot.children.head.domNode);\n }\n }\n });\n }\n\n initTimer() {\n let timer: ReturnType | null = null;\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n if (timer) {\n clearTimeout(timer);\n }\n timer = setTimeout(() => {\n this.highlight();\n timer = null;\n }, this.options.interval);\n });\n }\n\n highlight(blot: SyntaxCodeBlockContainer | null = null, force = false) {\n if (this.quill.selection.composing) return;\n this.quill.update(Quill.sources.USER);\n const range = this.quill.getSelection();\n const blots =\n blot == null\n ? this.quill.scroll.descendants(SyntaxCodeBlockContainer)\n : [blot];\n blots.forEach((container) => {\n container.highlight(this.highlightBlot, force);\n });\n this.quill.update(Quill.sources.SILENT);\n if (range != null) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n }\n }\n\n highlightBlot(text: string, language = 'plain') {\n language = this.languages[language] ? language : 'plain';\n if (language === 'plain') {\n return escapeText(text)\n .split('\\n')\n .reduce((delta, line, i) => {\n if (i !== 0) {\n delta.insert('\\n', { [CodeBlock.blotName]: language });\n }\n return delta.insert(line);\n }, new Delta());\n }\n const container = this.quill.root.ownerDocument.createElement('div');\n container.classList.add(CodeBlock.className);\n container.innerHTML = highlight(this.options.hljs, language, text);\n return traverse(\n this.quill.scroll,\n container,\n [\n (node, delta) => {\n // @ts-expect-error\n const value = TokenAttributor.value(node);\n if (value) {\n return delta.compose(\n new Delta().retain(delta.length(), {\n [CodeToken.blotName]: value,\n }),\n );\n }\n return delta;\n },\n ],\n [\n (node, delta) => {\n // @ts-expect-error\n return node.data.split('\\n').reduce((memo, nodeText, i) => {\n if (i !== 0) memo.insert('\\n', { [CodeBlock.blotName]: language });\n return memo.insert(nodeText);\n }, delta);\n },\n ],\n new WeakMap(),\n );\n }\n}\nSyntax.DEFAULTS = {\n hljs: (() => {\n return window.hljs;\n })(),\n interval: 1000,\n languages: [\n { key: 'plain', label: 'Plain' },\n { key: 'bash', label: 'Bash' },\n { key: 'cpp', label: 'C++' },\n { key: 'cs', label: 'C#' },\n { key: 'css', label: 'CSS' },\n { key: 'diff', label: 'Diff' },\n { key: 'xml', label: 'HTML/XML' },\n { key: 'java', label: 'Java' },\n { key: 'javascript', label: 'JavaScript' },\n { key: 'markdown', label: 'Markdown' },\n { key: 'php', label: 'PHP' },\n { key: 'python', label: 'Python' },\n { key: 'ruby', label: 'Ruby' },\n { key: 'sql', label: 'SQL' },\n ],\n};\n\nexport { SyntaxCodeBlock as CodeBlock, CodeToken, Syntax as default };\n", "import type { LinkedList } from 'parchment';\nimport Block from '../blots/block.js';\nimport Container from '../blots/container.js';\n\nclass TableCell extends Block {\n static blotName = 'table';\n static tagName = 'TD';\n\n static create(value: string) {\n const node = super.create() as HTMLElement;\n if (value) {\n node.setAttribute('data-row', value);\n } else {\n node.setAttribute('data-row', tableId());\n }\n return node;\n }\n\n static formats(domNode: HTMLElement) {\n if (domNode.hasAttribute('data-row')) {\n return domNode.getAttribute('data-row');\n }\n return undefined;\n }\n\n next: this | null;\n\n cellOffset() {\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n return -1;\n }\n\n format(name: string, value: string) {\n if (name === TableCell.blotName && value) {\n this.domNode.setAttribute('data-row', value);\n } else {\n super.format(name, value);\n }\n }\n\n row(): TableRow {\n return this.parent as TableRow;\n }\n\n rowOffset() {\n if (this.row()) {\n return this.row().rowOffset();\n }\n return -1;\n }\n\n table() {\n return this.row() && this.row().table();\n }\n}\n\nclass TableRow extends Container {\n static blotName = 'table-row';\n static tagName = 'TR';\n\n children: LinkedList;\n next: this | null;\n\n checkMerge() {\n // @ts-expect-error\n if (super.checkMerge() && this.next.children.head != null) {\n // @ts-expect-error\n const thisHead = this.children.head.formats();\n // @ts-expect-error\n const thisTail = this.children.tail.formats();\n // @ts-expect-error\n const nextHead = this.next.children.head.formats();\n // @ts-expect-error\n const nextTail = this.next.children.tail.formats();\n return (\n thisHead.table === thisTail.table &&\n thisHead.table === nextHead.table &&\n thisHead.table === nextTail.table\n );\n }\n return false;\n }\n\n optimize(context: { [key: string]: any }) {\n super.optimize(context);\n this.children.forEach((child) => {\n if (child.next == null) return;\n const childFormats = child.formats();\n const nextFormats = child.next.formats();\n if (childFormats.table !== nextFormats.table) {\n const next = this.splitAfter(child);\n if (next) {\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n next.optimize();\n }\n // We might be able to merge with prev now\n if (this.prev) {\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n this.prev.optimize();\n }\n }\n });\n }\n\n rowOffset() {\n if (this.parent) {\n return this.parent.children.indexOf(this);\n }\n return -1;\n }\n\n table() {\n return this.parent && this.parent.parent;\n }\n}\n\nclass TableBody extends Container {\n static blotName = 'table-body';\n static tagName = 'TBODY';\n\n children: LinkedList;\n}\n\nclass TableContainer extends Container {\n static blotName = 'table-container';\n static tagName = 'TABLE';\n\n children: LinkedList;\n\n balanceCells() {\n const rows = this.descendants(TableRow);\n const maxColumns = rows.reduce((max, row) => {\n return Math.max(row.children.length, max);\n }, 0);\n rows.forEach((row) => {\n new Array(maxColumns - row.children.length).fill(0).forEach(() => {\n let value;\n if (row.children.head != null) {\n value = TableCell.formats(row.children.head.domNode);\n }\n const blot = this.scroll.create(TableCell.blotName, value);\n row.appendChild(blot);\n // @ts-expect-error TODO: parameters of optimize() should be a optional\n blot.optimize(); // Add break blot\n });\n });\n }\n\n cells(column: number) {\n return this.rows().map((row) => row.children.at(column));\n }\n\n deleteColumn(index: number) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody) as TableBody[];\n if (body == null || body.children.head == null) return;\n body.children.forEach((row) => {\n const cell = row.children.at(index);\n if (cell != null) {\n cell.remove();\n }\n });\n }\n\n insertColumn(index: number) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody) as TableBody[];\n if (body == null || body.children.head == null) return;\n body.children.forEach((row) => {\n const ref = row.children.at(index);\n // @ts-expect-error\n const value = TableCell.formats(row.children.head.domNode);\n const cell = this.scroll.create(TableCell.blotName, value);\n row.insertBefore(cell, ref);\n });\n }\n\n insertRow(index: number) {\n // @ts-expect-error\n const [body] = this.descendant(TableBody) as TableBody[];\n if (body == null || body.children.head == null) return;\n const id = tableId();\n const row = this.scroll.create(TableRow.blotName) as TableRow;\n body.children.head.children.forEach(() => {\n const cell = this.scroll.create(TableCell.blotName, id);\n row.appendChild(cell);\n });\n const ref = body.children.at(index);\n body.insertBefore(row, ref);\n }\n\n rows() {\n const body = this.children.head;\n if (body == null) return [];\n return body.children.map((row) => row);\n }\n}\n\nTableContainer.allowedChildren = [TableBody];\nTableBody.requiredContainer = TableContainer;\n\nTableBody.allowedChildren = [TableRow];\nTableRow.requiredContainer = TableBody;\n\nTableRow.allowedChildren = [TableCell];\nTableCell.requiredContainer = TableRow;\n\nfunction tableId() {\n const id = Math.random().toString(36).slice(2, 6);\n return `row-${id}`;\n}\n\nexport { TableCell, TableRow, TableBody, TableContainer, tableId };\n", "import Delta from 'quill-delta';\nimport Quill from '../core/quill.js';\nimport Module from '../core/module.js';\nimport {\n TableCell,\n TableRow,\n TableBody,\n TableContainer,\n tableId,\n} from '../formats/table.js';\n\nclass Table extends Module {\n static register() {\n Quill.register(TableCell);\n Quill.register(TableRow);\n Quill.register(TableBody);\n Quill.register(TableContainer);\n }\n\n constructor(...args: ConstructorParameters) {\n super(...args);\n this.listenBalanceCells();\n }\n\n balanceTables() {\n this.quill.scroll.descendants(TableContainer).forEach((table) => {\n table.balanceCells();\n });\n }\n\n deleteColumn() {\n const [table, , cell] = this.getTable();\n if (cell == null) return;\n // @ts-expect-error\n table.deleteColumn(cell.cellOffset());\n this.quill.update(Quill.sources.USER);\n }\n\n deleteRow() {\n const [, row] = this.getTable();\n if (row == null) return;\n row.remove();\n this.quill.update(Quill.sources.USER);\n }\n\n deleteTable() {\n const [table] = this.getTable();\n if (table == null) return;\n // @ts-expect-error\n const offset = table.offset();\n // @ts-expect-error\n table.remove();\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(offset, Quill.sources.SILENT);\n }\n\n getTable(\n range = this.quill.getSelection(),\n ): [null, null, null, -1] | [Table, TableRow, TableCell, number] {\n if (range == null) return [null, null, null, -1];\n const [cell, offset] = this.quill.getLine(range.index);\n if (cell == null || cell.statics.blotName !== TableCell.blotName) {\n return [null, null, null, -1];\n }\n const row = cell.parent;\n const table = row.parent.parent;\n // @ts-expect-error\n return [table, row, cell, offset];\n }\n\n insertColumn(offset: number) {\n const range = this.quill.getSelection();\n if (!range) return;\n const [table, row, cell] = this.getTable(range);\n if (cell == null) return;\n const column = cell.cellOffset();\n table.insertColumn(column + offset);\n this.quill.update(Quill.sources.USER);\n let shift = row.rowOffset();\n if (offset === 0) {\n shift += 1;\n }\n this.quill.setSelection(\n range.index + shift,\n range.length,\n Quill.sources.SILENT,\n );\n }\n\n insertColumnLeft() {\n this.insertColumn(0);\n }\n\n insertColumnRight() {\n this.insertColumn(1);\n }\n\n insertRow(offset: number) {\n const range = this.quill.getSelection();\n if (!range) return;\n const [table, row, cell] = this.getTable(range);\n if (cell == null) return;\n const index = row.rowOffset();\n table.insertRow(index + offset);\n this.quill.update(Quill.sources.USER);\n if (offset > 0) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n } else {\n this.quill.setSelection(\n range.index + row.children.length,\n range.length,\n Quill.sources.SILENT,\n );\n }\n }\n\n insertRowAbove() {\n this.insertRow(0);\n }\n\n insertRowBelow() {\n this.insertRow(1);\n }\n\n insertTable(rows: number, columns: number) {\n const range = this.quill.getSelection();\n if (range == null) return;\n const delta = new Array(rows).fill(0).reduce((memo) => {\n const text = new Array(columns).fill('\\n').join('');\n return memo.insert(text, { table: tableId() });\n }, new Delta().retain(range.index));\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index, Quill.sources.SILENT);\n this.balanceTables();\n }\n\n listenBalanceCells() {\n this.quill.on(\n Quill.events.SCROLL_OPTIMIZE,\n (mutations: MutationRecord[]) => {\n mutations.some((mutation) => {\n if (\n ['TD', 'TR', 'TBODY', 'TABLE'].includes(\n (mutation.target as HTMLElement).tagName,\n )\n ) {\n this.quill.once(Quill.events.TEXT_CHANGE, (delta, old, source) => {\n if (source !== Quill.sources.USER) return;\n this.balanceTables();\n });\n return true;\n }\n return false;\n });\n },\n );\n }\n}\n\nexport default Table;\n", "import Delta from 'quill-delta';\nimport { EmbedBlot, Scope } from 'parchment';\nimport Quill from '../core/quill.js';\nimport logger from '../core/logger.js';\nimport Module from '../core/module.js';\nimport type { Range } from '../core/selection.js';\n\nconst debug = logger('quill:toolbar');\n\ntype Handler = (this: Toolbar, value: any) => void;\n\nexport type ToolbarConfig = Array<\n string[] | Array>\n>;\nexport interface ToolbarProps {\n container?: HTMLElement | ToolbarConfig | null;\n handlers?: Record;\n option?: number;\n module?: boolean;\n theme?: boolean;\n}\n\nclass Toolbar extends Module {\n static DEFAULTS: ToolbarProps;\n\n container?: HTMLElement | null;\n controls: [string, HTMLElement][];\n handlers: Record;\n\n constructor(quill: Quill, options: Partial) {\n super(quill, options);\n if (Array.isArray(this.options.container)) {\n const container = document.createElement('div');\n container.setAttribute('role', 'toolbar');\n addControls(container, this.options.container);\n quill.container?.parentNode?.insertBefore(container, quill.container);\n this.container = container;\n } else if (typeof this.options.container === 'string') {\n this.container = document.querySelector(this.options.container);\n } else {\n this.container = this.options.container;\n }\n if (!(this.container instanceof HTMLElement)) {\n debug.error('Container required for toolbar', this.options);\n return;\n }\n this.container.classList.add('ql-toolbar');\n this.controls = [];\n this.handlers = {};\n if (this.options.handlers) {\n Object.keys(this.options.handlers).forEach((format) => {\n const handler = this.options.handlers?.[format];\n if (handler) {\n this.addHandler(format, handler);\n }\n });\n }\n Array.from(this.container.querySelectorAll('button, select')).forEach(\n (input) => {\n // @ts-expect-error\n this.attach(input);\n },\n );\n this.quill.on(Quill.events.EDITOR_CHANGE, () => {\n const [range] = this.quill.selection.getRange(); // quill.getSelection triggers update\n this.update(range);\n });\n }\n\n addHandler(format: string, handler: Handler) {\n this.handlers[format] = handler;\n }\n\n attach(input: HTMLElement) {\n let format = Array.from(input.classList).find((className) => {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (\n this.handlers[format] == null &&\n this.quill.scroll.query(format) == null\n ) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n const eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, (e) => {\n let value;\n if (input.tagName === 'SELECT') {\n // @ts-expect-error\n if (input.selectedIndex < 0) return;\n // @ts-expect-error\n const selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n // @ts-expect-error\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n this.quill.focus();\n const [range] = this.quill.selection.getRange();\n if (this.handlers[format] != null) {\n this.handlers[format].call(this, value);\n } else if (\n // @ts-expect-error\n this.quill.scroll.query(format).prototype instanceof EmbedBlot\n ) {\n value = prompt(`Enter ${format}`); // eslint-disable-line no-alert\n if (!value) return;\n this.quill.updateContents(\n new Delta()\n // @ts-expect-error Fix me later\n .retain(range.index)\n // @ts-expect-error Fix me later\n .delete(range.length)\n .insert({ [format]: value }),\n Quill.sources.USER,\n );\n } else {\n this.quill.format(format, value, Quill.sources.USER);\n }\n this.update(range);\n });\n this.controls.push([format, input]);\n }\n\n update(range: Range | null) {\n const formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach((pair) => {\n const [format, input] = pair;\n if (input.tagName === 'SELECT') {\n let option: HTMLOptionElement | null = null;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n let value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\"/g, '\\\\\"');\n }\n option = input.querySelector(`option[value=\"${value}\"]`);\n }\n if (option == null) {\n // @ts-expect-error TODO fix me later\n input.value = ''; // TODO make configurable?\n // @ts-expect-error TODO fix me later\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else if (range == null) {\n input.classList.remove('ql-active');\n input.setAttribute('aria-pressed', 'false');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n const value = formats[format] as boolean | number | string | object;\n const isActive =\n value === input.getAttribute('value') ||\n (value != null && value.toString() === input.getAttribute('value')) ||\n (value == null && !input.getAttribute('value'));\n input.classList.toggle('ql-active', isActive);\n input.setAttribute('aria-pressed', isActive.toString());\n } else {\n const isActive = formats[format] != null;\n input.classList.toggle('ql-active', isActive);\n input.setAttribute('aria-pressed', isActive.toString());\n }\n });\n }\n}\nToolbar.DEFAULTS = {};\n\nfunction addButton(container: HTMLElement, format: string, value?: string) {\n const input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add(`ql-${format}`);\n input.setAttribute('aria-pressed', 'false');\n if (value != null) {\n input.value = value;\n input.setAttribute('aria-label', `${format}: ${value}`);\n } else {\n input.setAttribute('aria-label', format);\n }\n container.appendChild(input);\n}\n\nfunction addControls(\n container: HTMLElement,\n groups:\n | (string | Record)[][]\n | (string | Record)[],\n) {\n if (!Array.isArray(groups[0])) {\n // @ts-expect-error\n groups = [groups];\n }\n groups.forEach((controls: any) => {\n const group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach((control: any) => {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n const format = Object.keys(control)[0];\n const value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(\n container: HTMLElement,\n format: string,\n values: Array,\n) {\n const input = document.createElement('select');\n input.classList.add(`ql-${format}`);\n values.forEach((value) => {\n const option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', String(value));\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean() {\n const range = this.quill.getSelection();\n if (range == null) return;\n if (range.length === 0) {\n const formats = this.quill.getFormat();\n Object.keys(formats).forEach((name) => {\n // Clean functionality in existing apps only clean inline formats\n if (this.quill.scroll.query(name, Scope.INLINE) != null) {\n this.quill.format(name, false, Quill.sources.USER);\n }\n });\n } else {\n this.quill.removeFormat(range.index, range.length, Quill.sources.USER);\n }\n },\n direction(value) {\n const { align } = this.quill.getFormat();\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', Quill.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, Quill.sources.USER);\n }\n this.quill.format('direction', value, Quill.sources.USER);\n },\n indent(value) {\n const range = this.quill.getSelection();\n // @ts-expect-error\n const formats = this.quill.getFormat(range);\n // @ts-expect-error\n const indent = parseInt(formats.indent || 0, 10);\n if (value === '+1' || value === '-1') {\n let modifier = value === '+1' ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, Quill.sources.USER);\n }\n },\n link(value) {\n if (value === true) {\n value = prompt('Enter link URL:'); // eslint-disable-line no-alert\n }\n this.quill.format('link', value, Quill.sources.USER);\n },\n list(value) {\n const range = this.quill.getSelection();\n // @ts-expect-error\n const formats = this.quill.getFormat(range);\n if (value === 'check') {\n if (formats.list === 'checked' || formats.list === 'unchecked') {\n this.quill.format('list', false, Quill.sources.USER);\n } else {\n this.quill.format('list', 'unchecked', Quill.sources.USER);\n }\n } else {\n this.quill.format('list', value, Quill.sources.USER);\n }\n },\n },\n};\n\nexport { Toolbar as default, addControls };\n", "import alignLeftIcon from '../assets/icons/align-left.svg';\nimport alignCenterIcon from '../assets/icons/align-center.svg';\nimport alignRightIcon from '../assets/icons/align-right.svg';\nimport alignJustifyIcon from '../assets/icons/align-justify.svg';\nimport backgroundIcon from '../assets/icons/background.svg';\nimport blockquoteIcon from '../assets/icons/blockquote.svg';\nimport boldIcon from '../assets/icons/bold.svg';\nimport cleanIcon from '../assets/icons/clean.svg';\nimport codeIcon from '../assets/icons/code.svg';\nimport colorIcon from '../assets/icons/color.svg';\nimport directionLeftToRightIcon from '../assets/icons/direction-ltr.svg';\nimport directionRightToLeftIcon from '../assets/icons/direction-rtl.svg';\nimport formulaIcon from '../assets/icons/formula.svg';\nimport headerIcon from '../assets/icons/header.svg';\nimport header2Icon from '../assets/icons/header-2.svg';\nimport header3Icon from '../assets/icons/header-3.svg';\nimport header4Icon from '../assets/icons/header-4.svg';\nimport header5Icon from '../assets/icons/header-5.svg';\nimport header6Icon from '../assets/icons/header-6.svg';\nimport italicIcon from '../assets/icons/italic.svg';\nimport imageIcon from '../assets/icons/image.svg';\nimport indentIcon from '../assets/icons/indent.svg';\nimport outdentIcon from '../assets/icons/outdent.svg';\nimport linkIcon from '../assets/icons/link.svg';\nimport listBulletIcon from '../assets/icons/list-bullet.svg';\nimport listCheckIcon from '../assets/icons/list-check.svg';\nimport listOrderedIcon from '../assets/icons/list-ordered.svg';\nimport subscriptIcon from '../assets/icons/subscript.svg';\nimport superscriptIcon from '../assets/icons/superscript.svg';\nimport strikeIcon from '../assets/icons/strike.svg';\nimport tableIcon from '../assets/icons/table.svg';\nimport underlineIcon from '../assets/icons/underline.svg';\nimport videoIcon from '../assets/icons/video.svg';\n\nexport default {\n align: {\n '': alignLeftIcon,\n center: alignCenterIcon,\n right: alignRightIcon,\n justify: alignJustifyIcon,\n },\n background: backgroundIcon,\n blockquote: blockquoteIcon,\n bold: boldIcon,\n clean: cleanIcon,\n code: codeIcon,\n 'code-block': codeIcon,\n color: colorIcon,\n direction: {\n '': directionLeftToRightIcon,\n rtl: directionRightToLeftIcon,\n },\n formula: formulaIcon,\n header: {\n '1': headerIcon,\n '2': header2Icon,\n '3': header3Icon,\n '4': header4Icon,\n '5': header5Icon,\n '6': header6Icon,\n },\n italic: italicIcon,\n image: imageIcon,\n indent: {\n '+1': indentIcon,\n '-1': outdentIcon,\n },\n link: linkIcon,\n list: {\n bullet: listBulletIcon,\n check: listCheckIcon,\n ordered: listOrderedIcon,\n },\n script: {\n sub: subscriptIcon,\n super: superscriptIcon,\n },\n strike: strikeIcon,\n table: tableIcon,\n underline: underlineIcon,\n video: videoIcon,\n};\n", "import DropdownIcon from '../assets/icons/dropdown.svg';\n\nlet optionsCounter = 0;\n\nfunction toggleAriaAttribute(element: HTMLElement, attribute: string) {\n element.setAttribute(\n attribute,\n `${!(element.getAttribute(attribute) === 'true')}`,\n );\n}\n\nclass Picker {\n select: HTMLSelectElement;\n container: HTMLElement;\n label: HTMLElement;\n\n constructor(select: HTMLSelectElement) {\n this.select = select;\n this.container = document.createElement('span');\n this.buildPicker();\n this.select.style.display = 'none';\n // @ts-expect-error Fix me later\n this.select.parentNode.insertBefore(this.container, this.select);\n\n this.label.addEventListener('mousedown', () => {\n this.togglePicker();\n });\n this.label.addEventListener('keydown', (event) => {\n switch (event.key) {\n case 'Enter':\n this.togglePicker();\n break;\n case 'Escape':\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n this.select.addEventListener('change', this.update.bind(this));\n }\n\n togglePicker() {\n this.container.classList.toggle('ql-expanded');\n // Toggle aria-expanded and aria-hidden to make the picker accessible\n toggleAriaAttribute(this.label, 'aria-expanded');\n // @ts-expect-error\n toggleAriaAttribute(this.options, 'aria-hidden');\n }\n\n buildItem(option: HTMLOptionElement) {\n const item = document.createElement('span');\n // @ts-expect-error\n item.tabIndex = '0';\n item.setAttribute('role', 'button');\n item.classList.add('ql-picker-item');\n const value = option.getAttribute('value');\n if (value) {\n item.setAttribute('data-value', value);\n }\n if (option.textContent) {\n item.setAttribute('data-label', option.textContent);\n }\n item.addEventListener('click', () => {\n this.selectItem(item, true);\n });\n item.addEventListener('keydown', (event) => {\n switch (event.key) {\n case 'Enter':\n this.selectItem(item, true);\n event.preventDefault();\n break;\n case 'Escape':\n this.escape();\n event.preventDefault();\n break;\n default:\n }\n });\n\n return item;\n }\n\n buildLabel() {\n const label = document.createElement('span');\n label.classList.add('ql-picker-label');\n label.innerHTML = DropdownIcon;\n // @ts-expect-error\n label.tabIndex = '0';\n label.setAttribute('role', 'button');\n label.setAttribute('aria-expanded', 'false');\n this.container.appendChild(label);\n return label;\n }\n\n buildOptions() {\n const options = document.createElement('span');\n options.classList.add('ql-picker-options');\n\n // Don't want screen readers to read this until options are visible\n options.setAttribute('aria-hidden', 'true');\n // @ts-expect-error\n options.tabIndex = '-1';\n\n // Need a unique id for aria-controls\n options.id = `ql-picker-options-${optionsCounter}`;\n optionsCounter += 1;\n this.label.setAttribute('aria-controls', options.id);\n\n // @ts-expect-error\n this.options = options;\n\n Array.from(this.select.options).forEach((option) => {\n const item = this.buildItem(option);\n options.appendChild(item);\n if (option.selected === true) {\n this.selectItem(item);\n }\n });\n this.container.appendChild(options);\n }\n\n buildPicker() {\n Array.from(this.select.attributes).forEach((item) => {\n this.container.setAttribute(item.name, item.value);\n });\n this.container.classList.add('ql-picker');\n this.label = this.buildLabel();\n this.buildOptions();\n }\n\n escape() {\n // Close menu and return focus to trigger label\n this.close();\n // Need setTimeout for accessibility to ensure that the browser executes\n // focus on the next process thread and after any DOM content changes\n setTimeout(() => this.label.focus(), 1);\n }\n\n close() {\n this.container.classList.remove('ql-expanded');\n this.label.setAttribute('aria-expanded', 'false');\n // @ts-expect-error\n this.options.setAttribute('aria-hidden', 'true');\n }\n\n selectItem(item: HTMLElement | null, trigger = false) {\n const selected = this.container.querySelector('.ql-selected');\n if (item === selected) return;\n if (selected != null) {\n selected.classList.remove('ql-selected');\n }\n if (item == null) return;\n item.classList.add('ql-selected');\n // @ts-expect-error Fix me later\n this.select.selectedIndex = Array.from(item.parentNode.children).indexOf(\n item,\n );\n if (item.hasAttribute('data-value')) {\n // @ts-expect-error Fix me later\n this.label.setAttribute('data-value', item.getAttribute('data-value'));\n } else {\n this.label.removeAttribute('data-value');\n }\n if (item.hasAttribute('data-label')) {\n // @ts-expect-error Fix me later\n this.label.setAttribute('data-label', item.getAttribute('data-label'));\n } else {\n this.label.removeAttribute('data-label');\n }\n if (trigger) {\n this.select.dispatchEvent(new Event('change'));\n this.close();\n }\n }\n\n update() {\n let option;\n if (this.select.selectedIndex > -1) {\n const item =\n // @ts-expect-error Fix me later\n this.container.querySelector('.ql-picker-options').children[\n this.select.selectedIndex\n ];\n option = this.select.options[this.select.selectedIndex];\n // @ts-expect-error\n this.selectItem(item);\n } else {\n this.selectItem(null);\n }\n const isActive =\n option != null &&\n option !== this.select.querySelector('option[selected]');\n this.label.classList.toggle('ql-active', isActive);\n }\n}\n\nexport default Picker;\n", "import Picker from './picker.js';\n\nclass ColorPicker extends Picker {\n constructor(select: HTMLSelectElement, label: string) {\n super(select);\n this.label.innerHTML = label;\n this.container.classList.add('ql-color-picker');\n Array.from(this.container.querySelectorAll('.ql-picker-item'))\n .slice(0, 7)\n .forEach((item) => {\n item.classList.add('ql-primary');\n });\n }\n\n buildItem(option: HTMLOptionElement) {\n const item = super.buildItem(option);\n item.style.backgroundColor = option.getAttribute('value') || '';\n return item;\n }\n\n selectItem(item: HTMLElement | null, trigger?: boolean) {\n super.selectItem(item, trigger);\n const colorLabel = this.label.querySelector('.ql-color-label');\n const value = item ? item.getAttribute('data-value') || '' : '';\n if (colorLabel) {\n if (colorLabel.tagName === 'line') {\n colorLabel.style.stroke = value;\n } else {\n colorLabel.style.fill = value;\n }\n }\n }\n}\n\nexport default ColorPicker;\n", "import Picker from './picker.js';\n\nclass IconPicker extends Picker {\n defaultItem: HTMLElement | null;\n\n constructor(select: HTMLSelectElement, icons: Record) {\n super(select);\n this.container.classList.add('ql-icon-picker');\n Array.from(this.container.querySelectorAll('.ql-picker-item')).forEach(\n (item) => {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n },\n );\n this.defaultItem = this.container.querySelector('.ql-selected');\n this.selectItem(this.defaultItem);\n }\n\n selectItem(target: HTMLElement | null, trigger?: boolean) {\n super.selectItem(target, trigger);\n const item = target || this.defaultItem;\n if (item != null) {\n if (this.label.innerHTML === item.innerHTML) return;\n this.label.innerHTML = item.innerHTML;\n }\n }\n}\n\nexport default IconPicker;\n", "import type Quill from '../core.js';\nimport type { Bounds } from '../core/selection.js';\n\nconst isScrollable = (el: Element) => {\n const { overflowY } = getComputedStyle(el, null);\n return overflowY !== 'visible' && overflowY !== 'clip';\n};\n\nclass Tooltip {\n quill: Quill;\n boundsContainer: HTMLElement;\n root: HTMLDivElement;\n\n constructor(quill: Quill, boundsContainer?: HTMLElement) {\n this.quill = quill;\n this.boundsContainer = boundsContainer || document.body;\n this.root = quill.addContainer('ql-tooltip');\n // @ts-expect-error\n this.root.innerHTML = this.constructor.TEMPLATE;\n if (isScrollable(this.quill.root)) {\n this.quill.root.addEventListener('scroll', () => {\n this.root.style.marginTop = `${-1 * this.quill.root.scrollTop}px`;\n });\n }\n this.hide();\n }\n\n hide() {\n this.root.classList.add('ql-hidden');\n }\n\n position(reference: Bounds) {\n const left =\n reference.left + reference.width / 2 - this.root.offsetWidth / 2;\n // root.scrollTop should be 0 if scrollContainer !== root\n const top = reference.bottom + this.quill.root.scrollTop;\n this.root.style.left = `${left}px`;\n this.root.style.top = `${top}px`;\n this.root.classList.remove('ql-flip');\n const containerBounds = this.boundsContainer.getBoundingClientRect();\n const rootBounds = this.root.getBoundingClientRect();\n let shift = 0;\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right;\n this.root.style.left = `${left + shift}px`;\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left;\n this.root.style.left = `${left + shift}px`;\n }\n if (rootBounds.bottom > containerBounds.bottom) {\n const height = rootBounds.bottom - rootBounds.top;\n const verticalShift = reference.bottom - reference.top + height;\n this.root.style.top = `${top - verticalShift}px`;\n this.root.classList.add('ql-flip');\n }\n return shift;\n }\n\n show() {\n this.root.classList.remove('ql-editing');\n this.root.classList.remove('ql-hidden');\n }\n}\n\nexport default Tooltip;\n", "import { merge } from 'lodash-es';\nimport type Quill from '../core/quill.js';\nimport Emitter from '../core/emitter.js';\nimport Theme from '../core/theme.js';\nimport type { ThemeOptions } from '../core/theme.js';\nimport ColorPicker from '../ui/color-picker.js';\nimport IconPicker from '../ui/icon-picker.js';\nimport Picker from '../ui/picker.js';\nimport Tooltip from '../ui/tooltip.js';\nimport type { Range } from '../core/selection.js';\nimport type Clipboard from '../modules/clipboard.js';\nimport type History from '../modules/history.js';\nimport type Keyboard from '../modules/keyboard.js';\nimport type Uploader from '../modules/uploader.js';\nimport type Selection from '../core/selection.js';\n\nconst ALIGNS = [false, 'center', 'right', 'justify'];\n\nconst COLORS = [\n '#000000',\n '#e60000',\n '#ff9900',\n '#ffff00',\n '#008a00',\n '#0066cc',\n '#9933ff',\n '#ffffff',\n '#facccc',\n '#ffebcc',\n '#ffffcc',\n '#cce8cc',\n '#cce0f5',\n '#ebd6ff',\n '#bbbbbb',\n '#f06666',\n '#ffc266',\n '#ffff66',\n '#66b966',\n '#66a3e0',\n '#c285ff',\n '#888888',\n '#a10000',\n '#b26b00',\n '#b2b200',\n '#006100',\n '#0047b2',\n '#6b24b2',\n '#444444',\n '#5c0000',\n '#663d00',\n '#666600',\n '#003700',\n '#002966',\n '#3d1466',\n];\n\nconst FONTS = [false, 'serif', 'monospace'];\n\nconst HEADERS = ['1', '2', '3', false];\n\nconst SIZES = ['small', false, 'large', 'huge'];\n\nclass BaseTheme extends Theme {\n pickers: Picker[];\n tooltip?: Tooltip;\n\n constructor(quill: Quill, options: ThemeOptions) {\n super(quill, options);\n const listener = (e: MouseEvent) => {\n if (!document.body.contains(quill.root)) {\n document.body.removeEventListener('click', listener);\n return;\n }\n if (\n this.tooltip != null &&\n // @ts-expect-error\n !this.tooltip.root.contains(e.target) &&\n // @ts-expect-error\n document.activeElement !== this.tooltip.textbox &&\n !this.quill.hasFocus()\n ) {\n this.tooltip.hide();\n }\n if (this.pickers != null) {\n this.pickers.forEach((picker) => {\n // @ts-expect-error\n if (!picker.container.contains(e.target)) {\n picker.close();\n }\n });\n }\n };\n quill.emitter.listenDOM('click', document.body, listener);\n }\n\n addModule(name: 'clipboard'): Clipboard;\n addModule(name: 'keyboard'): Keyboard;\n addModule(name: 'uploader'): Uploader;\n addModule(name: 'history'): History;\n addModule(name: 'selection'): Selection;\n addModule(name: string): unknown;\n addModule(name: string) {\n const module = super.addModule(name);\n if (name === 'toolbar') {\n // @ts-expect-error\n this.extendToolbar(module);\n }\n return module;\n }\n\n buildButtons(\n buttons: NodeListOf,\n icons: Record | string>,\n ) {\n Array.from(buttons).forEach((button) => {\n const className = button.getAttribute('class') || '';\n className.split(/\\s+/).forEach((name) => {\n if (!name.startsWith('ql-')) return;\n name = name.slice('ql-'.length);\n if (icons[name] == null) return;\n if (name === 'direction') {\n // @ts-expect-error\n button.innerHTML = icons[name][''] + icons[name].rtl;\n } else if (typeof icons[name] === 'string') {\n // @ts-expect-error\n button.innerHTML = icons[name];\n } else {\n // @ts-expect-error\n const value = button.value || '';\n // @ts-expect-error\n if (value != null && icons[name][value]) {\n // @ts-expect-error\n button.innerHTML = icons[name][value];\n }\n }\n });\n });\n }\n\n buildPickers(\n selects: NodeListOf,\n icons: Record>,\n ) {\n this.pickers = Array.from(selects).map((select) => {\n if (select.classList.contains('ql-align')) {\n if (select.querySelector('option') == null) {\n fillSelect(select, ALIGNS);\n }\n if (typeof icons.align === 'object') {\n return new IconPicker(select, icons.align);\n }\n }\n if (\n select.classList.contains('ql-background') ||\n select.classList.contains('ql-color')\n ) {\n const format = select.classList.contains('ql-background')\n ? 'background'\n : 'color';\n if (select.querySelector('option') == null) {\n fillSelect(\n select,\n COLORS,\n format === 'background' ? '#ffffff' : '#000000',\n );\n }\n return new ColorPicker(select, icons[format] as string);\n }\n if (select.querySelector('option') == null) {\n if (select.classList.contains('ql-font')) {\n fillSelect(select, FONTS);\n } else if (select.classList.contains('ql-header')) {\n fillSelect(select, HEADERS);\n } else if (select.classList.contains('ql-size')) {\n fillSelect(select, SIZES);\n }\n }\n return new Picker(select);\n });\n const update = () => {\n this.pickers.forEach((picker) => {\n picker.update();\n });\n };\n this.quill.on(Emitter.events.EDITOR_CHANGE, update);\n }\n}\nBaseTheme.DEFAULTS = merge({}, Theme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n formula() {\n this.quill.theme.tooltip.edit('formula');\n },\n image() {\n let fileInput = this.container.querySelector(\n 'input.ql-image[type=file]',\n );\n if (fileInput == null) {\n fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute(\n 'accept',\n this.quill.uploader.options.mimetypes.join(', '),\n );\n fileInput.classList.add('ql-image');\n fileInput.addEventListener('change', () => {\n const range = this.quill.getSelection(true);\n this.quill.uploader.upload(range, fileInput.files);\n fileInput.value = '';\n });\n this.container.appendChild(fileInput);\n }\n fileInput.click();\n },\n video() {\n this.quill.theme.tooltip.edit('video');\n },\n },\n },\n },\n});\n\nclass BaseTooltip extends Tooltip {\n textbox: HTMLInputElement | null;\n linkRange?: Range;\n\n constructor(quill: Quill, boundsContainer?: HTMLElement) {\n super(quill, boundsContainer);\n this.textbox = this.root.querySelector('input[type=\"text\"]');\n this.listen();\n }\n\n listen() {\n // @ts-expect-error Fix me later\n this.textbox.addEventListener('keydown', (event) => {\n if (event.key === 'Enter') {\n this.save();\n event.preventDefault();\n } else if (event.key === 'Escape') {\n this.cancel();\n event.preventDefault();\n }\n });\n }\n\n cancel() {\n this.hide();\n this.restoreFocus();\n }\n\n edit(mode = 'link', preview: string | null = null) {\n this.root.classList.remove('ql-hidden');\n this.root.classList.add('ql-editing');\n if (this.textbox == null) return;\n\n if (preview != null) {\n this.textbox.value = preview;\n } else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = '';\n }\n const bounds = this.quill.getBounds(this.quill.selection.savedRange);\n if (bounds != null) {\n this.position(bounds);\n }\n this.textbox.select();\n this.textbox.setAttribute(\n 'placeholder',\n this.textbox.getAttribute(`data-${mode}`) || '',\n );\n this.root.setAttribute('data-mode', mode);\n }\n\n restoreFocus() {\n this.quill.focus({ preventScroll: true });\n }\n\n save() {\n // @ts-expect-error Fix me later\n let { value } = this.textbox;\n switch (this.root.getAttribute('data-mode')) {\n case 'link': {\n const { scrollTop } = this.quill.root;\n if (this.linkRange) {\n this.quill.formatText(\n this.linkRange,\n 'link',\n value,\n Emitter.sources.USER,\n );\n delete this.linkRange;\n } else {\n this.restoreFocus();\n this.quill.format('link', value, Emitter.sources.USER);\n }\n this.quill.root.scrollTop = scrollTop;\n break;\n }\n case 'video': {\n value = extractVideoUrl(value);\n } // eslint-disable-next-line no-fallthrough\n case 'formula': {\n if (!value) break;\n const range = this.quill.getSelection(true);\n if (range != null) {\n const index = range.index + range.length;\n this.quill.insertEmbed(\n index,\n // @ts-expect-error Fix me later\n this.root.getAttribute('data-mode'),\n value,\n Emitter.sources.USER,\n );\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', Emitter.sources.USER);\n }\n this.quill.setSelection(index + 2, Emitter.sources.USER);\n }\n break;\n }\n default:\n }\n // @ts-expect-error Fix me later\n this.textbox.value = '';\n this.hide();\n }\n}\n\nfunction extractVideoUrl(url: string) {\n let match =\n url.match(\n /^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/,\n ) ||\n url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n if (match) {\n return `${match[1] || 'https'}://www.youtube.com/embed/${\n match[2]\n }?showinfo=0`;\n }\n // eslint-disable-next-line no-cond-assign\n if ((match = url.match(/^(?:(https?):\\/\\/)?(?:www\\.)?vimeo\\.com\\/(\\d+)/))) {\n return `${match[1] || 'https'}://player.vimeo.com/video/${match[2]}/`;\n }\n return url;\n}\n\nfunction fillSelect(\n select: HTMLSelectElement,\n values: Array,\n defaultValue: unknown = false,\n) {\n values.forEach((value) => {\n const option = document.createElement('option');\n if (value === defaultValue) {\n option.setAttribute('selected', 'selected');\n } else {\n option.setAttribute('value', String(value));\n }\n select.appendChild(option);\n });\n}\n\nexport { BaseTooltip, BaseTheme as default };\n", "import { merge } from 'lodash-es';\nimport Emitter from '../core/emitter.js';\nimport BaseTheme, { BaseTooltip } from './base.js';\nimport { Range } from '../core/selection.js';\nimport type { Bounds } from '../core/selection.js';\nimport icons from '../ui/icons.js';\nimport Quill from '../core/quill.js';\nimport type { ThemeOptions } from '../core/theme.js';\nimport type Toolbar from '../modules/toolbar.js';\nimport type { ToolbarConfig } from '../modules/toolbar.js';\n\nconst TOOLBAR_CONFIG: ToolbarConfig = [\n ['bold', 'italic', 'link'],\n [{ header: 1 }, { header: 2 }, 'blockquote'],\n];\n\nclass BubbleTooltip extends BaseTooltip {\n static TEMPLATE = [\n '',\n '
    ',\n '',\n '',\n '
    ',\n ].join('');\n\n constructor(quill: Quill, bounds?: HTMLElement) {\n super(quill, bounds);\n this.quill.on(\n Emitter.events.EDITOR_CHANGE,\n (type, range, oldRange, source) => {\n if (type !== Emitter.events.SELECTION_CHANGE) return;\n if (\n range != null &&\n range.length > 0 &&\n source === Emitter.sources.USER\n ) {\n this.show();\n // Lock our width so we will expand beyond our offsetParent boundaries\n this.root.style.left = '0px';\n this.root.style.width = '';\n this.root.style.width = `${this.root.offsetWidth}px`;\n const lines = this.quill.getLines(range.index, range.length);\n if (lines.length === 1) {\n const bounds = this.quill.getBounds(range);\n if (bounds != null) {\n this.position(bounds);\n }\n } else {\n const lastLine = lines[lines.length - 1];\n const index = this.quill.getIndex(lastLine);\n const length = Math.min(\n lastLine.length() - 1,\n range.index + range.length - index,\n );\n const indexBounds = this.quill.getBounds(new Range(index, length));\n if (indexBounds != null) {\n this.position(indexBounds);\n }\n }\n } else if (\n document.activeElement !== this.textbox &&\n this.quill.hasFocus()\n ) {\n this.hide();\n }\n },\n );\n }\n\n listen() {\n super.listen();\n // @ts-expect-error Fix me later\n this.root.querySelector('.ql-close').addEventListener('click', () => {\n this.root.classList.remove('ql-editing');\n });\n this.quill.on(Emitter.events.SCROLL_OPTIMIZE, () => {\n // Let selection be restored by toolbar handlers before repositioning\n setTimeout(() => {\n if (this.root.classList.contains('ql-hidden')) return;\n const range = this.quill.getSelection();\n if (range != null) {\n const bounds = this.quill.getBounds(range);\n if (bounds != null) {\n this.position(bounds);\n }\n }\n }, 1);\n });\n }\n\n cancel() {\n this.show();\n }\n\n position(reference: Bounds) {\n const shift = super.position(reference);\n const arrow = this.root.querySelector('.ql-tooltip-arrow');\n // @ts-expect-error\n arrow.style.marginLeft = '';\n if (shift !== 0) {\n // @ts-expect-error\n arrow.style.marginLeft = `${-1 * shift - arrow.offsetWidth / 2}px`;\n }\n return shift;\n }\n}\n\nclass BubbleTheme extends BaseTheme {\n tooltip: BubbleTooltip;\n\n constructor(quill: Quill, options: ThemeOptions) {\n if (\n options.modules.toolbar != null &&\n options.modules.toolbar.container == null\n ) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-bubble');\n }\n\n extendToolbar(toolbar: Toolbar) {\n // @ts-expect-error\n this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n if (toolbar.container != null) {\n this.tooltip.root.appendChild(toolbar.container);\n this.buildButtons(toolbar.container.querySelectorAll('button'), icons);\n this.buildPickers(toolbar.container.querySelectorAll('select'), icons);\n }\n }\n}\nBubbleTheme.DEFAULTS = merge({}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link(value: string) {\n if (!value) {\n this.quill.format('link', false, Quill.sources.USER);\n } else {\n // @ts-expect-error\n this.quill.theme.tooltip.edit();\n }\n },\n },\n },\n },\n} satisfies ThemeOptions);\n\nexport { BubbleTooltip, BubbleTheme as default };\n", "import { merge } from 'lodash-es';\nimport Emitter from '../core/emitter.js';\nimport BaseTheme, { BaseTooltip } from './base.js';\nimport LinkBlot from '../formats/link.js';\nimport { Range } from '../core/selection.js';\nimport icons from '../ui/icons.js';\nimport Quill from '../core/quill.js';\nimport type { Context } from '../modules/keyboard.js';\nimport type Toolbar from '../modules/toolbar.js';\nimport type { ToolbarConfig } from '../modules/toolbar.js';\nimport type { ThemeOptions } from '../core/theme.js';\n\nconst TOOLBAR_CONFIG: ToolbarConfig = [\n [{ header: ['1', '2', '3', false] }],\n ['bold', 'italic', 'underline', 'link'],\n [{ list: 'ordered' }, { list: 'bullet' }],\n ['clean'],\n];\n\nclass SnowTooltip extends BaseTooltip {\n static TEMPLATE = [\n '',\n '',\n '',\n '',\n ].join('');\n\n preview = this.root.querySelector('a.ql-preview');\n\n listen() {\n super.listen();\n // @ts-expect-error Fix me later\n this.root\n .querySelector('a.ql-action')\n .addEventListener('click', (event) => {\n if (this.root.classList.contains('ql-editing')) {\n this.save();\n } else {\n // @ts-expect-error Fix me later\n this.edit('link', this.preview.textContent);\n }\n event.preventDefault();\n });\n // @ts-expect-error Fix me later\n this.root\n .querySelector('a.ql-remove')\n .addEventListener('click', (event) => {\n if (this.linkRange != null) {\n const range = this.linkRange;\n this.restoreFocus();\n this.quill.formatText(range, 'link', false, Emitter.sources.USER);\n delete this.linkRange;\n }\n event.preventDefault();\n this.hide();\n });\n this.quill.on(\n Emitter.events.SELECTION_CHANGE,\n (range, oldRange, source) => {\n if (range == null) return;\n if (range.length === 0 && source === Emitter.sources.USER) {\n const [link, offset] = this.quill.scroll.descendant(\n LinkBlot,\n range.index,\n );\n if (link != null) {\n this.linkRange = new Range(range.index - offset, link.length());\n const preview = LinkBlot.formats(link.domNode);\n // @ts-expect-error Fix me later\n this.preview.textContent = preview;\n // @ts-expect-error Fix me later\n this.preview.setAttribute('href', preview);\n this.show();\n const bounds = this.quill.getBounds(this.linkRange);\n if (bounds != null) {\n this.position(bounds);\n }\n return;\n }\n } else {\n delete this.linkRange;\n }\n this.hide();\n },\n );\n }\n\n show() {\n super.show();\n this.root.removeAttribute('data-mode');\n }\n}\n\nclass SnowTheme extends BaseTheme {\n constructor(quill: Quill, options: ThemeOptions) {\n if (\n options.modules.toolbar != null &&\n options.modules.toolbar.container == null\n ) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-snow');\n }\n\n extendToolbar(toolbar: Toolbar) {\n if (toolbar.container != null) {\n toolbar.container.classList.add('ql-snow');\n this.buildButtons(toolbar.container.querySelectorAll('button'), icons);\n this.buildPickers(toolbar.container.querySelectorAll('select'), icons);\n // @ts-expect-error\n this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n if (toolbar.container.querySelector('.ql-link')) {\n this.quill.keyboard.addBinding(\n { key: 'k', shortKey: true },\n (_range: Range, context: Context) => {\n toolbar.handlers.link.call(toolbar, !context.format.link);\n },\n );\n }\n }\n }\n}\nSnowTheme.DEFAULTS = merge({}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link(value: string) {\n if (value) {\n const range = this.quill.getSelection();\n if (range == null || range.length === 0) return;\n let preview = this.quill.getText(range);\n if (\n /^\\S+@\\S+\\.\\S+$/.test(preview) &&\n preview.indexOf('mailto:') !== 0\n ) {\n preview = `mailto:${preview}`;\n }\n // @ts-expect-error\n const { tooltip } = this.quill.theme;\n tooltip.edit('link', preview);\n } else {\n this.quill.format('link', false, Quill.sources.USER);\n }\n },\n },\n },\n },\n} satisfies ThemeOptions);\n\nexport default SnowTheme;\n", "import Quill, { Parchment, Range } from './core.js';\nimport type {\n Bounds,\n DebugLevel,\n EmitterSource,\n ExpandedQuillOptions,\n QuillOptions,\n} from './core.js';\n\nimport { AlignClass, AlignStyle } from './formats/align.js';\nimport {\n DirectionAttribute,\n DirectionClass,\n DirectionStyle,\n} from './formats/direction.js';\nimport Indent from './formats/indent.js';\n\nimport Blockquote from './formats/blockquote.js';\nimport Header from './formats/header.js';\nimport List from './formats/list.js';\n\nimport { BackgroundClass, BackgroundStyle } from './formats/background.js';\nimport { ColorClass, ColorStyle } from './formats/color.js';\nimport { FontClass, FontStyle } from './formats/font.js';\nimport { SizeClass, SizeStyle } from './formats/size.js';\n\nimport Bold from './formats/bold.js';\nimport Italic from './formats/italic.js';\nimport Link from './formats/link.js';\nimport Script from './formats/script.js';\nimport Strike from './formats/strike.js';\nimport Underline from './formats/underline.js';\n\nimport Formula from './formats/formula.js';\nimport Image from './formats/image.js';\nimport Video from './formats/video.js';\n\nimport CodeBlock, { Code as InlineCode } from './formats/code.js';\n\nimport Syntax from './modules/syntax.js';\nimport Table from './modules/table.js';\nimport Toolbar from './modules/toolbar.js';\n\nimport Icons from './ui/icons.js';\nimport Picker from './ui/picker.js';\nimport ColorPicker from './ui/color-picker.js';\nimport IconPicker from './ui/icon-picker.js';\nimport Tooltip from './ui/tooltip.js';\n\nimport BubbleTheme from './themes/bubble.js';\nimport SnowTheme from './themes/snow.js';\n\nQuill.register(\n {\n 'attributors/attribute/direction': DirectionAttribute,\n\n 'attributors/class/align': AlignClass,\n 'attributors/class/background': BackgroundClass,\n 'attributors/class/color': ColorClass,\n 'attributors/class/direction': DirectionClass,\n 'attributors/class/font': FontClass,\n 'attributors/class/size': SizeClass,\n\n 'attributors/style/align': AlignStyle,\n 'attributors/style/background': BackgroundStyle,\n 'attributors/style/color': ColorStyle,\n 'attributors/style/direction': DirectionStyle,\n 'attributors/style/font': FontStyle,\n 'attributors/style/size': SizeStyle,\n },\n true,\n);\n\nQuill.register(\n {\n 'formats/align': AlignClass,\n 'formats/direction': DirectionClass,\n 'formats/indent': Indent,\n\n 'formats/background': BackgroundStyle,\n 'formats/color': ColorStyle,\n 'formats/font': FontClass,\n 'formats/size': SizeClass,\n\n 'formats/blockquote': Blockquote,\n 'formats/code-block': CodeBlock,\n 'formats/header': Header,\n 'formats/list': List,\n\n 'formats/bold': Bold,\n 'formats/code': InlineCode,\n 'formats/italic': Italic,\n 'formats/link': Link,\n 'formats/script': Script,\n 'formats/strike': Strike,\n 'formats/underline': Underline,\n\n 'formats/formula': Formula,\n 'formats/image': Image,\n 'formats/video': Video,\n\n 'modules/syntax': Syntax,\n 'modules/table': Table,\n 'modules/toolbar': Toolbar,\n\n 'themes/bubble': BubbleTheme,\n 'themes/snow': SnowTheme,\n\n 'ui/icons': Icons,\n 'ui/picker': Picker,\n 'ui/icon-picker': IconPicker,\n 'ui/color-picker': ColorPicker,\n 'ui/tooltip': Tooltip,\n },\n true,\n);\n\nexport { Module } from './core.js';\nexport type {\n Bounds,\n DebugLevel,\n EmitterSource,\n ExpandedQuillOptions,\n QuillOptions,\n};\nexport { Parchment, Range };\n\nexport default Quill;\n", "/*! For license information please see quill-cursors.js.LICENSE.txt */\n!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define([],e):\"object\"==typeof exports?exports.QuillCursors=e():t.QuillCursors=e()}(self,(()=>(()=>{var t={582:(t,e,r)=>{\"use strict\";r.d(e,{Z:()=>s});var n=r(81),i=r.n(n),o=r(645),a=r.n(o)()(i());a.push([t.id,\".ql-container{position:relative;overflow:hidden}@media(pointer: coarse){.ql-cursor-caret-container{z-index:-1}}.ql-cursor.hidden{display:none}.ql-cursor .ql-cursor-caret-container,.ql-cursor .ql-cursor-flag{position:absolute}.ql-cursor .ql-cursor-flag{z-index:1;transform:translate3d(-1px, -100%, 0);opacity:0;visibility:hidden;color:#fff;padding-bottom:2px;border-radius:0 3px 3px 0}.ql-cursor .ql-cursor-flag.flag-flipped{border-radius:3px 0 0 3px;transform:translate3d(calc(-100% + 1px ), -100%, 0)}@media screen{.ql-cursor .ql-cursor-flag{transition:opacity 0ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 0ms,visibility 0ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 0ms}}.ql-cursor .ql-cursor-flag .ql-cursor-name{margin-left:5px;margin-right:5px;display:inline-block;margin-top:-2px;white-space:nowrap}.ql-cursor .ql-cursor-flag.no-delay[style]{transition-delay:unset !important}.ql-cursor .ql-cursor-caret-container{cursor:text;margin-left:-9px;padding:0 9px}.ql-cursor .ql-cursor-caret-container.hover+.ql-cursor-flag{opacity:1;visibility:visible;transition:none}.ql-cursor .ql-cursor-caret-container.no-pointer{pointer-events:none}.ql-cursor .ql-cursor-caret-container .ql-cursor-caret{position:absolute;top:0;bottom:0;width:2px;margin-left:-1px;background-color:attr(data-color)}.ql-cursor .ql-cursor-selection-block{position:absolute;pointer-events:none}\",\"\"]);const s=a},645:t=>{\"use strict\";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var r=\"\",n=void 0!==e[5];return e[4]&&(r+=\"@supports (\".concat(e[4],\") {\")),e[2]&&(r+=\"@media \".concat(e[2],\" {\")),n&&(r+=\"@layer\".concat(e[5].length>0?\" \".concat(e[5]):\"\",\" {\")),r+=t(e),n&&(r+=\"}\"),e[2]&&(r+=\"}\"),e[4]&&(r+=\"}\"),r})).join(\"\")},e.i=function(t,r,n,i,o){\"string\"==typeof t&&(t=[[null,t,void 0]]);var a={};if(n)for(var s=0;s0?\" \".concat(l[5]):\"\",\" {\").concat(l[1],\"}\")),l[5]=o),r&&(l[2]?(l[1]=\"@media \".concat(l[2],\" {\").concat(l[1],\"}\"),l[2]=r):l[2]=r),i&&(l[4]?(l[1]=\"@supports (\".concat(l[4],\") {\").concat(l[1],\"}\"),l[4]=i):l[4]=\"\".concat(i)),e.push(l))}},e}},81:t=>{\"use strict\";t.exports=function(t){return t[1]}},529:t=>{var e=-1;function r(t,s,u,c){if(t===s)return t?[[0,t]]:[];if(null!=u){var l=function(t,e,r){var n=\"number\"==typeof r?{index:r,length:0}:r.oldRange,i=\"number\"==typeof r?null:r.newRange,o=t.length,a=e.length;if(0===n.length&&(null===i||0===i.length)){var s=n.index,u=t.slice(0,s),c=t.slice(s),l=i?i.index:null,h=s+a-o;if((null===l||l===h)&&!(h<0||h>a)){var d=e.slice(0,h);if((_=e.slice(h))===c){var p=Math.min(s,h);if((b=u.slice(0,p))===(m=d.slice(0,p)))return f(b,u.slice(p),d.slice(p),c)}}if(null===l||l===s){var g=s,_=(d=e.slice(0,g),e.slice(g));if(d===u){var v=Math.min(o-g,a-g);if((y=c.slice(c.length-v))===(A=_.slice(_.length-v)))return f(u,c.slice(0,c.length-v),_.slice(0,_.length-v),y)}}}if(n.length>0&&i&&0===i.length){var b=t.slice(0,n.index),y=t.slice(n.index+n.length);if(!(a<(p=b.length)+(v=y.length))){var m=e.slice(0,p),A=e.slice(a-v);if(b===m&&y===A)return f(b,t.slice(p,o-v),e.slice(p,a-v),y)}}return null}(t,s,u);if(l)return l}var h=i(t,s),d=t.substring(0,h);h=o(t=t.substring(h),s=s.substring(h));var p=t.substring(t.length-h),g=function(t,a){var s;if(!t)return[[1,a]];if(!a)return[[e,t]];var u=t.length>a.length?t:a,c=t.length>a.length?a:t,l=u.indexOf(c);if(-1!==l)return s=[[1,u.substring(0,l)],[0,c],[1,u.substring(l+c.length)]],t.length>a.length&&(s[0][0]=s[2][0]=e),s;if(1===c.length)return[[e,t],[1,a]];var f=function(t,e){var r=t.length>e.length?t:e,n=t.length>e.length?e:t;if(r.length<4||2*n.length=t.length?[n,a,s,u,f]:null}var s,u,c,l,f,h=a(r,n,Math.ceil(r.length/4)),d=a(r,n,Math.ceil(r.length/2));return h||d?(s=d?h&&h[4].length>d[4].length?h:d:h,t.length>e.length?(u=s[0],c=s[1],l=s[2],f=s[3]):(l=s[0],f=s[1],u=s[2],c=s[3]),[u,c,l,f,s[4]]):null}(t,a);if(f){var h=f[0],d=f[1],p=f[2],g=f[3],_=f[4],v=r(h,p),b=r(d,g);return v.concat([[0,_]],b)}return function(t,r){for(var i=t.length,o=r.length,a=Math.ceil((i+o)/2),s=a,u=2*a,c=new Array(u),l=new Array(u),f=0;fi)g+=2;else if(A>o)p+=2;else if(d&&(w=s+h-y)>=0&&w=(C=i-l[w]))return n(t,r,S,A)}for(var x=-b+_;x<=b-v;x+=2){for(var C,w=s+x,E=(C=x===-b||x!==b&&l[w-1]i)v+=2;else if(E>o)_+=2;else if(!d){var S;if((m=s+h-x)>=0&&m=(C=i-C))return n(t,r,S,A)}}}return[[e,t],[1,r]]}(t,a)}(t=t.substring(0,t.length-h),s=s.substring(0,s.length-h));return d&&g.unshift([0,d]),p&&g.push([0,p]),a(g,c),g}function n(t,e,n,i){var o=t.substring(0,n),a=e.substring(0,i),s=t.substring(n),u=e.substring(i),c=r(o,a),l=r(s,u);return c.concat(l)}function i(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var r=0,n=Math.min(t.length,e.length),i=n,o=0;r=0&&l(t[p][1])){var g=t[p][1].slice(-1);if(t[p][1]=t[p][1].slice(0,-1),h=g+h,d=g+d,!t[p][1]){t.splice(p,1),s--;var _=p-1;t[_]&&1===t[_][0]&&(f++,d=t[_][1]+d,_--),t[_]&&t[_][0]===e&&(u++,h=t[_][1]+h,_--),p=_}}c(t[s][1])&&(g=t[s][1].charAt(0),t[s][1]=t[s][1].slice(1),h+=g,d+=g)}if(s0||d.length>0){h.length>0&&d.length>0&&(0!==(n=i(d,h))&&(p>=0?t[p][1]+=d.substring(0,n):(t.splice(0,0,[0,d.substring(0,n)]),s++),d=d.substring(n),h=h.substring(n)),0!==(n=o(d,h))&&(t[s][1]=d.substring(d.length-n)+t[s][1],d=d.substring(0,d.length-n),h=h.substring(0,h.length-n)));var v=f+u;0===h.length&&0===d.length?(t.splice(s-v,v),s-=v):0===h.length?(t.splice(s-v,v,[1,d]),s=s-v+1):0===d.length?(t.splice(s-v,v,[e,h]),s=s-v+1):(t.splice(s-v,v,[e,h],[1,d]),s=s-v+2)}0!==s&&0===t[s-1][0]?(t[s-1][1]+=t[s][1],t.splice(s,1)):s++,f=0,u=0,h=\"\",d=\"\"}\"\"===t[t.length-1][1]&&t.pop();var b=!1;for(s=1;s=55296&&t<=56319}function u(t){return t>=56320&&t<=57343}function c(t){return u(t.charCodeAt(0))}function l(t){return s(t.charCodeAt(t.length-1))}function f(t,r,n,i){return l(t)||c(i)?null:function(t){for(var e=[],r=0;r0&&e.push(t[r]);return e}([[0,t],[e,r],[1,n],[0,i]])}function h(t,e,n){return r(t,e,n,!0)}h.INSERT=1,h.DELETE=e,h.EQUAL=0,t.exports=h},465:(t,e,r)=>{t=r.nmd(t);var n=\"__lodash_hash_undefined__\",i=9007199254740991,o=\"[object Arguments]\",a=\"[object Boolean]\",s=\"[object Date]\",u=\"[object Function]\",c=\"[object GeneratorFunction]\",l=\"[object Map]\",f=\"[object Number]\",h=\"[object Object]\",d=\"[object Promise]\",p=\"[object RegExp]\",g=\"[object Set]\",_=\"[object String]\",v=\"[object Symbol]\",b=\"[object WeakMap]\",y=\"[object ArrayBuffer]\",m=\"[object DataView]\",A=\"[object Float32Array]\",x=\"[object Float64Array]\",C=\"[object Int8Array]\",w=\"[object Int16Array]\",E=\"[object Int32Array]\",S=\"[object Uint8Array]\",M=\"[object Uint8ClampedArray]\",O=\"[object Uint16Array]\",j=\"[object Uint32Array]\",L=/\\w*$/,k=/^\\[object .+?Constructor\\]$/,T=/^(?:0|[1-9]\\d*)$/,R={};R[o]=R[\"[object Array]\"]=R[y]=R[m]=R[a]=R[s]=R[A]=R[x]=R[C]=R[w]=R[E]=R[l]=R[f]=R[h]=R[p]=R[g]=R[_]=R[v]=R[S]=R[M]=R[O]=R[j]=!0,R[\"[object Error]\"]=R[u]=R[b]=!1;var N=\"object\"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,q=\"object\"==typeof self&&self&&self.Object===Object&&self,D=N||q||Function(\"return this\")(),F=e&&!e.nodeType&&e,I=F&&t&&!t.nodeType&&t,P=I&&I.exports===F;function B(t,e){return t.set(e[0],e[1]),t}function z(t,e){return t.add(e),t}function H(t,e,r,n){var i=-1,o=t?t.length:0;for(n&&o&&(r=t[++i]);++i-1},Mt.prototype.set=function(t,e){var r=this.__data__,n=kt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Ot.prototype.clear=function(){this.__data__={hash:new St,map:new(pt||Mt),string:new St}},Ot.prototype.delete=function(t){return qt(this,t).delete(t)},Ot.prototype.get=function(t){return qt(this,t).get(t)},Ot.prototype.has=function(t){return qt(this,t).has(t)},Ot.prototype.set=function(t,e){return qt(this,t).set(t,e),this},jt.prototype.clear=function(){this.__data__=new Mt},jt.prototype.delete=function(t){return this.__data__.delete(t)},jt.prototype.get=function(t){return this.__data__.get(t)},jt.prototype.has=function(t){return this.__data__.has(t)},jt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Mt){var n=r.__data__;if(!pt||n.length<199)return n.push([t,e]),this;r=this.__data__=new Ot(n)}return r.set(t,e),this};var Ft=lt?$(lt,Object):function(){return[]},It=function(t){return et.call(t)};function Pt(t,e){return!!(e=null==e?i:e)&&(\"number\"==typeof t||T.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=i}(t.length)&&!Vt(t)}var $t=ft||function(){return!1};function Vt(t){var e=Wt(t)?et.call(t):\"\";return e==u||e==c}function Wt(t){var e=typeof t;return!!t&&(\"object\"==e||\"function\"==e)}function Xt(t){return Gt(t)?function(t,e){var r=Ut(t)||function(t){return function(t){return function(t){return!!t&&\"object\"==typeof t}(t)&&Gt(t)}(t)&&tt.call(t,\"callee\")&&(!ut.call(t,\"callee\")||et.call(t)==o)}(t)?function(t,e){for(var r=-1,n=Array(t);++r{t=r.nmd(t);var n=\"__lodash_hash_undefined__\",i=9007199254740991,o=\"[object Arguments]\",a=\"[object Array]\",s=\"[object Boolean]\",u=\"[object Date]\",c=\"[object Error]\",l=\"[object Function]\",f=\"[object Map]\",h=\"[object Number]\",d=\"[object Object]\",p=\"[object Promise]\",g=\"[object RegExp]\",_=\"[object Set]\",v=\"[object String]\",b=\"[object WeakMap]\",y=\"[object ArrayBuffer]\",m=\"[object DataView]\",A=/^\\[object .+?Constructor\\]$/,x=/^(?:0|[1-9]\\d*)$/,C={};C[\"[object Float32Array]\"]=C[\"[object Float64Array]\"]=C[\"[object Int8Array]\"]=C[\"[object Int16Array]\"]=C[\"[object Int32Array]\"]=C[\"[object Uint8Array]\"]=C[\"[object Uint8ClampedArray]\"]=C[\"[object Uint16Array]\"]=C[\"[object Uint32Array]\"]=!0,C[o]=C[a]=C[y]=C[s]=C[m]=C[u]=C[c]=C[l]=C[f]=C[h]=C[d]=C[g]=C[_]=C[v]=C[b]=!1;var w=\"object\"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,E=\"object\"==typeof self&&self&&self.Object===Object&&self,S=w||E||Function(\"return this\")(),M=e&&!e.nodeType&&e,O=M&&t&&!t.nodeType&&t,j=O&&O.exports===M,L=j&&w.process,k=function(){try{return L&&L.binding&&L.binding(\"util\")}catch(t){}}(),T=k&&k.isTypedArray;function R(t,e){for(var r=-1,n=null==t?0:t.length;++rs))return!1;var c=o.get(t);if(c&&o.get(e))return c==e;var l=-1,f=!0,h=2&r?new yt:void 0;for(o.set(t,e),o.set(e,t);++l-1},vt.prototype.set=function(t,e){var r=this.__data__,n=At(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},bt.prototype.clear=function(){this.size=0,this.__data__={hash:new _t,map:new(it||vt),string:new _t}},bt.prototype.delete=function(t){var e=Mt(this,t).delete(t);return this.size-=e?1:0,e},bt.prototype.get=function(t){return Mt(this,t).get(t)},bt.prototype.has=function(t){return Mt(this,t).has(t)},bt.prototype.set=function(t,e){var r=Mt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},yt.prototype.add=yt.prototype.push=function(t){return this.__data__.set(t,n),this},yt.prototype.has=function(t){return this.__data__.has(t)},mt.prototype.clear=function(){this.__data__=new vt,this.size=0},mt.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},mt.prototype.get=function(t){return this.__data__.get(t)},mt.prototype.has=function(t){return this.__data__.has(t)},mt.prototype.set=function(t,e){var r=this.__data__;if(r instanceof vt){var n=r.__data__;if(!it||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new bt(n)}return r.set(t,e),this.size=r.size,this};var jt=tt?function(t){return null==t?[]:(t=Object(t),function(e,r){for(var n=-1,i=null==e?0:e.length,o=0,a=[];++n-1&&t%1==0&&t-1&&t%1==0&&t<=i}function Pt(t){var e=typeof t;return null!=t&&(\"object\"==e||\"function\"==e)}function Bt(t){return null!=t&&\"object\"==typeof t}var zt=T?function(t){return function(e){return t(e)}}(T):function(t){return Bt(t)&&It(t.length)&&!!C[xt(t)]};function Ht(t){return null!=(e=t)&&It(e.length)&&!Ft(e)?function(t,e){var r=qt(t),n=!r&&Nt(t),i=!r&&!n&&Dt(t),o=!r&&!n&&!i&&zt(t),a=r||n||i||o,s=a?function(t,e){for(var r=-1,n=Array(t);++r0?n:void 0},t.diff=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),\"object\"!=typeof t&&(t={}),\"object\"!=typeof e&&(e={});var r=Object.keys(t).concat(Object.keys(e)).reduce((function(r,n){return a.default(t[n],e[n])||(r[n]=void 0===e[n]?null:e[n]),r}),{});return Object.keys(r).length>0?r:void 0},t.invert=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),t=t||{};var r=Object.keys(e).reduce((function(r,n){return e[n]!==t[n]&&void 0!==t[n]&&(r[n]=e[n]),r}),{});return Object.keys(t).reduce((function(r,n){return t[n]!==e[n]&&void 0===e[n]&&(r[n]=null),r}),r)},t.transform=function(t,e,r){if(void 0===r&&(r=!1),\"object\"!=typeof t)return e;if(\"object\"==typeof e){if(!r)return e;var n=Object.keys(e).reduce((function(r,n){return void 0===t[n]&&(r[n]=e[n]),r}),{});return Object.keys(n).length>0?n:void 0}}}(i||(i={})),e.default=i},895:function(t,e,r){\"use strict\";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=n(r(529)),o=n(r(465)),a=n(r(307)),s=n(r(210)),u=n(r(430)),c=String.fromCharCode(0),l=function(){function t(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]}return t.prototype.insert=function(t,e){var r={};return\"string\"==typeof t&&0===t.length?this:(r.insert=t,null!=e&&\"object\"==typeof e&&Object.keys(e).length>0&&(r.attributes=e),this.push(r))},t.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},t.prototype.retain=function(t,e){if(t<=0)return this;var r={retain:t};return null!=e&&\"object\"==typeof e&&Object.keys(e).length>0&&(r.attributes=e),this.push(r)},t.prototype.push=function(t){var e=this.ops.length,r=this.ops[e-1];if(t=o.default(t),\"object\"==typeof r){if(\"number\"==typeof t.delete&&\"number\"==typeof r.delete)return this.ops[e-1]={delete:r.delete+t.delete},this;if(\"number\"==typeof r.delete&&null!=t.insert&&(e-=1,\"object\"!=typeof(r=this.ops[e-1])))return this.ops.unshift(t),this;if(a.default(t.attributes,r.attributes)){if(\"string\"==typeof t.insert&&\"string\"==typeof r.insert)return this.ops[e-1]={insert:r.insert+t.insert},\"object\"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if(\"number\"==typeof t.retain&&\"number\"==typeof r.retain)return this.ops[e-1]={retain:r.retain+t.retain},\"object\"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},t.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},t.prototype.filter=function(t){return this.ops.filter(t)},t.prototype.forEach=function(t){this.ops.forEach(t)},t.prototype.map=function(t){return this.ops.map(t)},t.prototype.partition=function(t){var e=[],r=[];return this.forEach((function(n){(t(n)?e:r).push(n)})),[e,r]},t.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},t.prototype.changeLength=function(){return this.reduce((function(t,e){return e.insert?t+u.default.length(e):e.delete?t-e.delete:t}),0)},t.prototype.length=function(){return this.reduce((function(t,e){return t+u.default.length(e)}),0)},t.prototype.slice=function(e,r){void 0===e&&(e=0),void 0===r&&(r=1/0);for(var n=[],i=u.default.iterator(this.ops),o=0;o0&&n.next(o.retain-c)}for(var l=new t(i);r.hasNext()||n.hasNext();)if(\"insert\"===n.peekType())l.push(n.next());else if(\"delete\"===r.peekType())l.push(r.next());else{var f=Math.min(r.peekLength(),n.peekLength()),h=r.next(f),d=n.next(f);if(\"number\"==typeof d.retain){var p={};\"number\"==typeof h.retain?p.retain=f:p.insert=h.insert;var g=s.default.compose(h.attributes,d.attributes,\"number\"==typeof h.retain);if(g&&(p.attributes=g),l.push(p),!n.hasNext()&&a.default(l.ops[l.ops.length-1],p)){var _=new t(r.rest());return l.concat(_).chop()}}else\"number\"==typeof d.delete&&\"number\"==typeof h.retain&&l.push(d)}return l.chop()},t.prototype.concat=function(e){var r=new t(this.ops.slice());return e.ops.length>0&&(r.push(e.ops[0]),r.ops=r.ops.concat(e.ops.slice(1))),r},t.prototype.diff=function(e,r){if(this.ops===e.ops)return new t;var n=[this,e].map((function(t){return t.map((function(r){if(null!=r.insert)return\"string\"==typeof r.insert?r.insert:c;throw new Error(\"diff() called \"+(t===e?\"on\":\"with\")+\" non-document\")})).join(\"\")})),o=new t,l=i.default(n[0],n[1],r),f=u.default.iterator(this.ops),h=u.default.iterator(e.ops);return l.forEach((function(t){for(var e=t[1].length;e>0;){var r=0;switch(t[0]){case i.default.INSERT:r=Math.min(h.peekLength(),e),o.push(h.next(r));break;case i.default.DELETE:r=Math.min(e,f.peekLength()),f.next(r),o.delete(r);break;case i.default.EQUAL:r=Math.min(f.peekLength(),h.peekLength(),e);var n=f.next(r),u=h.next(r);a.default(n.insert,u.insert)?o.retain(r,s.default.diff(n.attributes,u.attributes)):o.push(u).delete(r)}e-=r}})),o.chop()},t.prototype.eachLine=function(e,r){void 0===r&&(r=\"\\n\");for(var n=u.default.iterator(this.ops),i=new t,o=0;n.hasNext();){if(\"insert\"!==n.peekType())return;var a=n.peek(),s=u.default.length(a)-n.peekLength(),c=\"string\"==typeof a.insert?a.insert.indexOf(r,s)-s:-1;if(c<0)i.push(n.next());else if(c>0)i.push(n.next(c));else{if(!1===e(i,n.next(1).attributes||{},o))return;o+=1,i=new t}}i.length()>0&&e(i,{},o)},t.prototype.invert=function(e){var r=new t;return this.reduce((function(t,n){if(n.insert)r.delete(u.default.length(n));else{if(n.retain&&null==n.attributes)return r.retain(n.retain),t+n.retain;if(n.delete||n.retain&&n.attributes){var i=n.delete||n.retain;return e.slice(t,t+i).forEach((function(t){n.delete?r.push(t):n.retain&&n.attributes&&r.retain(u.default.length(t),s.default.invert(n.attributes,t.attributes))})),t+i}}return t}),0),r.chop()},t.prototype.transform=function(e,r){if(void 0===r&&(r=!1),r=!!r,\"number\"==typeof e)return this.transformPosition(e,r);for(var n=e,i=u.default.iterator(this.ops),o=u.default.iterator(n.ops),a=new t;i.hasNext()||o.hasNext();)if(\"insert\"!==i.peekType()||!r&&\"insert\"===o.peekType())if(\"insert\"===o.peekType())a.push(o.next());else{var c=Math.min(i.peekLength(),o.peekLength()),l=i.next(c),f=o.next(c);if(l.delete)continue;f.delete?a.push(f):a.retain(c,s.default.transform(l.attributes,f.attributes,r))}else a.retain(u.default.length(i.next()));return a.chop()},t.prototype.transformPosition=function(t,e){void 0===e&&(e=!1),e=!!e;for(var r=u.default.iterator(this.ops),n=0;r.hasNext()&&n<=t;){var i=r.peekLength(),o=r.peekType();r.next(),\"delete\"!==o?(\"insert\"===o&&(n=n-r?(t=n-r,this.index+=1,this.offset=0):this.offset+=t,\"number\"==typeof e.delete)return{delete:t};var o={};return e.attributes&&(o.attributes=e.attributes),\"number\"==typeof e.retain?o.retain=t:\"string\"==typeof e.insert?o.insert=e.insert.substr(r,t):o.insert=e.insert,o}return{retain:1/0}},t.prototype.peek=function(){return this.ops[this.index]},t.prototype.peekLength=function(){return this.ops[this.index]?i.default.length(this.ops[this.index])-this.offset:1/0},t.prototype.peekType=function(){return this.ops[this.index]?\"number\"==typeof this.ops[this.index].delete?\"delete\":\"number\"==typeof this.ops[this.index].retain?\"retain\":\"insert\":\"retain\"},t.prototype.rest=function(){if(this.hasNext()){if(0===this.offset)return this.ops.slice(this.index);var t=this.offset,e=this.index,r=this.next(),n=this.ops.slice(this.index);return this.offset=t,this.index=e,[r].concat(n)}return[]},t}();e.default=o},430:function(t,e,r){\"use strict\";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0});var i,o=n(r(977));!function(t){t.iterator=function(t){return new o.default(t)},t.length=function(t){return\"number\"==typeof t.delete?t.delete:\"number\"==typeof t.retain?t.retain:\"string\"==typeof t.insert?t.insert.length:1}}(i||(i={})),e.default=i},165:function(t,e,r){var n,i;void 0===(i=\"function\"==typeof(n=function(){var t,e={};function r(t,e,r){var n=t.getClientRects();if(2===n.length){var i=t.getBoundingClientRect();return n[e][r]=e.length)return Array.prototype.push.apply(t,e);for(;n1,t.getClientRects||(s.setEnd(o,1),t.getClientRects=t.getBoundingClientRect=2===s.getClientRects().length),!t.getBoundingClientRect){s.setEnd(s.startContainer,s.startOffset);var u=s.getBoundingClientRect();t.getBoundingClientRect=0===u.top&&0===u.left}if(document.body.removeChild(e),!t.getBoundingClientRect){var c=document.createElement(\"p\");c.style.width=\"0px\",c.style.fontSize=\"20px\",c.style.whiteSpace=\"normal\",c.style.wordBreak=\"normal\";var l=document.createTextNode(\"m mm\");c.appendChild(l),document.body.appendChild(c),s.setStart(l,1),s.setEnd(l,2),r(s,1,\"left\")?t.getBoundingClientRect=!0:(s.setStart(l,1),s.setEnd(l,3),r(s,0,\"top\")&&(t.getBoundingClientRect=!0)),document.body.removeChild(c)}var f=window.ActiveXObject&&new Function(\"/*@cc_on return @_jscript_version; @*/\")();t.ieZoom=!!f&&f<=10}return t},e.getClientRects=function(t){var e=this.isBroken();if(e.ieZoom)return n(t.getClientRects());if(!e.getClientRects)return t.getClientRects();var r=[],o=[],a=t.endContainer,s=t.endOffset,u=document.createRange();function c(t){for(var e=0;t=t.previousSibling;)e++;return e}for(;a!==t.commonAncestorContainer;)u.setStart(a,0),u.setEnd(a,s),i(o,u.getClientRects()),s=c(a),a=a.parentNode;return(u=t.cloneRange()).setEnd(a,s),i(r,u.getClientRects()),i(r,o),r},e.getBoundingClientRect=function(t){var e=this.getClientRects(t);if(0===e.length)return null;var r,i=t.getBoundingClientRect(),o=this.isBroken();if(o.ieZoom)return n(i);if(!o.getBoundingClientRect)return i;if(0===i.width&&0===i.height)return e[0];for(var a=0,s=e.length;a{\"use strict\";r.r(e),r.d(e,{default:()=>C});var n=function(){if(\"undefined\"!=typeof Map)return Map;function t(t,e){var r=-1;return t.some((function(t,n){return t[0]===e&&(r=n,!0)})),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,\"size\",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var r=t(this.__entries__,e),n=this.__entries__[r];return n&&n[1]},e.prototype.set=function(e,r){var n=t(this.__entries__,e);~n?this.__entries__[n][1]=r:this.__entries__.push([e,r])},e.prototype.delete=function(e){var r=this.__entries__,n=t(r,e);~n&&r.splice(n,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var r=0,n=this.__entries__;r0},t.prototype.connect_=function(){i&&!this.connected_&&(document.addEventListener(\"transitionend\",this.onTransitionEnd_),window.addEventListener(\"resize\",this.refresh),u?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener(\"DOMSubtreeModified\",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){i&&this.connected_&&(document.removeEventListener(\"transitionend\",this.onTransitionEnd_),window.removeEventListener(\"resize\",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener(\"DOMSubtreeModified\",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,r=void 0===e?\"\":e;s.some((function(t){return!!~r.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),l=function(t,e){for(var r=0,n=Object.keys(e);r0},t}(),A=\"undefined\"!=typeof WeakMap?new WeakMap:new n,x=function t(e){if(!(this instanceof t))throw new TypeError(\"Cannot call a class as a function.\");if(!arguments.length)throw new TypeError(\"1 argument required, but only 0 present.\");var r=c.getInstance(),n=new m(e,r,this);A.set(this,n)};[\"observe\",\"unobserve\",\"disconnect\"].forEach((function(t){x.prototype[t]=function(){var e;return(e=A.get(this))[t].apply(e,arguments)}}));const C=void 0!==o.ResizeObserver?o.ResizeObserver:x},413:(t,e,r)=>{\"use strict\";r.r(e),r.d(e,{default:()=>v});var n=r(379),i=r.n(n),o=r(795),a=r.n(o),s=r(569),u=r.n(s),c=r(565),l=r.n(c),f=r(216),h=r.n(f),d=r(589),p=r.n(d),g=r(582),_={};_.styleTagTransform=p(),_.setAttributes=l(),_.insert=u().bind(null,\"head\"),_.domAPI=a(),_.insertStyleElement=h(),i()(g.Z,_);const v=g.Z&&g.Z.locals?g.Z.locals:void 0},379:t=>{\"use strict\";var e=[];function r(t){for(var r=-1,n=0;n{\"use strict\";var e={};t.exports=function(t,r){var n=function(t){if(void 0===e[t]){var r=document.querySelector(t);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[t]=r}return e[t]}(t);if(!n)throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");n.appendChild(r)}},216:t=>{\"use strict\";t.exports=function(t){var e=document.createElement(\"style\");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},565:(t,e,r)=>{\"use strict\";t.exports=function(t){var e=r.nc;e&&t.setAttribute(\"nonce\",e)}},795:t=>{\"use strict\";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(r){!function(t,e,r){var n=\"\";r.supports&&(n+=\"@supports (\".concat(r.supports,\") {\")),r.media&&(n+=\"@media \".concat(r.media,\" {\"));var i=void 0!==r.layer;i&&(n+=\"@layer\".concat(r.layer.length>0?\" \".concat(r.layer):\"\",\" {\")),n+=r.css,i&&(n+=\"}\"),r.media&&(n+=\"}\"),r.supports&&(n+=\"}\");var o=r.sourceMap;o&&\"undefined\"!=typeof btoa&&(n+=\"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o)))),\" */\")),e.styleTagTransform(n,t,e.options)}(e,t,r)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},589:t=>{\"use strict\";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},607:function(t,e,r){\"use strict\";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0}),e.Cursor=e.default=void 0;var i=n(r(678));e.default=i.default;var o=n(r(353));e.Cursor=o.default,r(413)},353:(t,e,r)=>{\"use strict\";Object.defineProperty(e,\"__esModule\",{value:!0});var n=r(207),i=function(){function t(t,e,r){this.id=t,this.name=e,this.color=r,this.toggleNearCursor=this.toggleNearCursor.bind(this),this._toggleOpenedCursor=this._toggleOpenedCursor.bind(this),this._setHoverState=this._setHoverState.bind(this)}return t.prototype.build=function(e){var r=document.createElement(t.CONTAINER_ELEMENT_TAG);r.classList.add(t.CURSOR_CLASS),r.id=\"ql-cursor-\".concat(this.id),r.innerHTML=e.template;var n=r.getElementsByClassName(t.SELECTION_CLASS)[0],i=r.getElementsByClassName(t.CARET_CONTAINER_CLASS)[0],o=i.getElementsByClassName(t.CARET_CLASS)[0],a=r.getElementsByClassName(t.FLAG_CLASS)[0];return a.style.backgroundColor=this.color,o.style.backgroundColor=this.color,r.getElementsByClassName(t.NAME_CLASS)[0].textContent=this.name,this._hideDelay=\"\".concat(e.hideDelayMs,\"ms\"),this._hideSpeedMs=e.hideSpeedMs,this._positionFlag=e.positionFlag,a.style.transitionDelay=this._hideDelay,a.style.transitionDuration=\"\".concat(this._hideSpeedMs,\"ms\"),this._el=r,this._selectionEl=n,this._caretEl=i,this._flagEl=a,i.addEventListener(\"mouseover\",this._setHoverState,{passive:!0}),this._el},t.prototype.show=function(){this._el.classList.remove(t.HIDDEN_CLASS)},t.prototype.hide=function(){this._el.classList.add(t.HIDDEN_CLASS)},t.prototype.remove=function(){this._el.parentNode.removeChild(this._el)},t.prototype.toggleNearCursor=function(e,r){var n=this._getCoordinates(),i=n.left,o=n.right,a=n.top,s=n.bottom,u=e>=i&&e<=o&&r>=a&&r<=s;return this._caretEl.classList.toggle(t.CONTAINER_HOVER_CLASS,u),u},t.prototype.toggleFlag=function(e){var r=this;this._caretEl.classList.toggle(t.CONTAINER_HOVER_CLASS,e)||(this._flagEl.classList.add(t.NO_DELAY_CLASS),setTimeout((function(){return r._flagEl.classList.remove(t.NO_DELAY_CLASS)}),this._hideSpeedMs))},t.prototype.updateCaret=function(t,e){this._caretEl.style.top=\"\".concat(t.top,\"px\"),this._caretEl.style.left=\"\".concat(t.left,\"px\"),this._caretEl.style.height=\"\".concat(t.height,\"px\"),this._positionFlag?this._positionFlag(this._flagEl,t,e):this._updateCaretFlag(t,e)},t.prototype.updateSelection=function(t,e){var r=this;this._clearSelection(),t=t||[],t=Array.from(t),t=this._sanitize(t),(t=this._sortByDomPosition(t)).forEach((function(t){return r._addSelection(t,e)}))},t.prototype._setHoverState=function(){document.addEventListener(\"mousemove\",this._toggleOpenedCursor,{passive:!0})},t.prototype._toggleOpenedCursor=function(e){var r=this.toggleNearCursor(e.clientX,e.clientY);this._caretEl.classList.toggle(t.CONTAINER_NO_POINTER_CLASS,r),r||document.removeEventListener(\"mousemove\",this._toggleOpenedCursor)},t.prototype._getCoordinates=function(){return this._caretEl.getBoundingClientRect()},t.prototype._updateCaretFlag=function(e,r){this._flagEl.style.width=\"\";var n=this._flagEl.getBoundingClientRect();this._flagEl.classList.remove(t.FLAG_FLIPPED_CLASS),e.left>r.width-n.width&&this._flagEl.classList.add(t.FLAG_FLIPPED_CLASS),this._flagEl.style.left=\"\".concat(e.left,\"px\"),this._flagEl.style.top=\"\".concat(e.top,\"px\"),this._flagEl.style.width=\"\".concat(Math.ceil(n.width),\"px\")},t.prototype._clearSelection=function(){this._selectionEl.innerHTML=\"\"},t.prototype._addSelection=function(t,e){var r=this._selectionBlock(t,e);this._selectionEl.appendChild(r)},t.prototype._selectionBlock=function(e,r){var i=document.createElement(t.SELECTION_ELEMENT_TAG);return i.classList.add(t.SELECTION_BLOCK_CLASS),i.style.top=\"\".concat(e.top-r.top,\"px\"),i.style.left=\"\".concat(e.left-r.left,\"px\"),i.style.width=\"\".concat(e.width,\"px\"),i.style.height=\"\".concat(e.height,\"px\"),i.style.backgroundColor=n(this.color).setAlpha(.3).toString(),i},t.prototype._sortByDomPosition=function(t){return t.sort((function(t,e){return t.top===e.top?t.left-e.left:t.top-e.top}))},t.prototype._sanitize=function(t){var e=this,r=new Set;return t.filter((function(t){if(!t.width||!t.height)return!1;var n=e._serialize(t);return!r.has(n)&&(r.add(n),!0)}))},t.prototype._serialize=function(t){return[\"top:\".concat(t.top),\"right:\".concat(t.right),\"bottom:\".concat(t.bottom),\"left:\".concat(t.left)].join(\";\")},t.CONTAINER_ELEMENT_TAG=\"SPAN\",t.SELECTION_ELEMENT_TAG=\"SPAN\",t.CURSOR_CLASS=\"ql-cursor\",t.SELECTION_CLASS=\"ql-cursor-selections\",t.SELECTION_BLOCK_CLASS=\"ql-cursor-selection-block\",t.CARET_CLASS=\"ql-cursor-caret\",t.CARET_CONTAINER_CLASS=\"ql-cursor-caret-container\",t.CONTAINER_HOVER_CLASS=\"hover\",t.CONTAINER_NO_POINTER_CLASS=\"no-pointer\",t.FLAG_CLASS=\"ql-cursor-flag\",t.FLAG_FLIPPED_CLASS=\"flag-flipped\",t.NAME_CLASS=\"ql-cursor-name\",t.HIDDEN_CLASS=\"hidden\",t.NO_DELAY_CLASS=\"no-delay\",t}();e.default=i},678:function(t,e,r){\"use strict\";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!(\"get\"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,\"default\",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)\"default\"!==r&&Object.prototype.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0});var s=a(r(353)),u=o(r(165)),c=a(r(338)),l=a(r(33)),f=r(895),h=function(){function t(t,e){void 0===e&&(e={}),this._cursors={},this._isObserving=!1,this._handleCursorTouch=this._handleCursorTouch.bind(this),this.quill=t,this.options=this._setDefaults(e),this._container=this.quill.addContainer(this.options.containerClass),this._boundsContainer=this.options.boundsContainer||this.quill.container,this._currentSelection=this.quill.getSelection(),this._registerSelectionChangeListeners(),this._registerTextChangeListener(),this._registerDomListeners()}return t.prototype.createCursor=function(t,e,r){var n=this._cursors[t];if(!n){n=new s.default(t,e,r),this._cursors[t]=n;var i=n.build(this.options);this._container.appendChild(i)}return n},t.prototype.moveCursor=function(t,e){var r=this._cursors[t];r&&(r.range=e,this._updateCursor(r))},t.prototype.removeCursor=function(t){var e=this._cursors[t];e&&(e.remove(),delete this._cursors[t])},t.prototype.update=function(){var t=this;this.cursors().forEach((function(e){return t._updateCursor(e)}))},t.prototype.clearCursors=function(){var t=this;this.cursors().forEach((function(e){return t.removeCursor(e.id)}))},t.prototype.toggleFlag=function(t,e){var r=this._cursors[t];r&&r.toggleFlag(e)},t.prototype.cursors=function(){var t=this;return Object.keys(this._cursors).map((function(e){return t._cursors[e]}))},t.prototype._registerSelectionChangeListeners=function(){var t=this;this.quill.on(this.quill.constructor.events.SELECTION_CHANGE,(function(e){t._currentSelection=e}))},t.prototype._registerTextChangeListener=function(){var t=this;this.quill.on(this.quill.constructor.events.TEXT_CHANGE,(function(e){return t._handleTextChange(e)}))},t.prototype._registerDomListeners=function(){var t=this,e=this.quill.container.getElementsByClassName(\"ql-editor\")[0];e.addEventListener(\"scroll\",(function(){return t.update()}),{passive:!0}),e.addEventListener(\"touchstart\",this._handleCursorTouch,{passive:!0})},t.prototype._handleCursorTouch=function(t){var e=this;this.cursors().forEach((function(r){r.toggleNearCursor(t.pageX,t.pageY),setTimeout((function(){return r.toggleFlag(!1)}),e.options.hideDelayMs)}))},t.prototype._registerResizeObserver=function(){var t=this;if(!this._isObserving){var e=this.quill.container.getElementsByClassName(\"ql-editor\")[0],r=new l.default((function(e){if(!e[0].target.isConnected)return r.disconnect(),void(t._isObserving=!1);t.update()}));r.observe(e),this._isObserving=!0}},t.prototype._updateCursor=function(t){if(this._registerResizeObserver(),!t.range)return t.hide();var e=this._indexWithinQuillBounds(t.range.index),r=this._indexWithinQuillBounds(t.range.index+t.range.length),n=this.quill.getLeaf(e),i=this.quill.getLeaf(r);if(!this._leafIsValid(n)||!this._leafIsValid(i))return t.hide();t.show();var o=this._boundsContainer.getBoundingClientRect(),a=this.quill.getBounds(r);t.updateCaret(a,o);var s=this._lineRanges(t,n,i).reduce((function(t,e){return t.concat(Array.from(u.getClientRects(e)))}),[]);t.updateSelection(s,o)},t.prototype._indexWithinQuillBounds=function(t){var e=this.quill.getLength(),r=e?e-1:0;return t=Math.max(t,0),Math.min(t,r)},t.prototype._leafIsValid=function(t){return t&&t[0]&&t[0].domNode&&t[1]>=0},t.prototype._handleTextChange=function(t){var e=this;window.setTimeout((function(){e.options.transformOnTextChange&&e._transformCursors(t),e.options.selectionChangeSource&&(e._emitSelection(),e.update())}))},t.prototype._emitSelection=function(){this.quill.emitter.emit(this.quill.constructor.events.SELECTION_CHANGE,this.quill.getSelection(),this._currentSelection,this.options.selectionChangeSource)},t.prototype._setDefaults=function(e){return(e=Object.assign({},e)).template||(e.template=t.DEFAULTS.template),e.containerClass||(e.containerClass=t.DEFAULTS.containerClass),null!==e.selectionChangeSource&&(e.selectionChangeSource||(e.selectionChangeSource=t.DEFAULTS.selectionChangeSource)),e.hideDelayMs=Number.isInteger(e.hideDelayMs)?e.hideDelayMs:t.DEFAULTS.hideDelayMs,e.hideSpeedMs=Number.isInteger(e.hideSpeedMs)?e.hideSpeedMs:t.DEFAULTS.hideSpeedMs,e.transformOnTextChange=!!e.transformOnTextChange,e},t.prototype._lineRanges=function(t,e,r){var n=this.quill.getLines(t.range);return n.reduce((function(t,i,o){if(!i.children){var a=document.createRange();return a.selectNode(i.domNode),t.concat(a)}var s=0===o?e:i.path(0).pop(),u=s[0],c=s[1],l=o===n.length-1?r:i.path(i.length()-1).pop(),f=l[0],h=l[1],d=document.createRange();return u.domNode.nodeType===Node.TEXT_NODE?d.setStart(u.domNode,c):d.setStartBefore(u.domNode),f.domNode.nodeType===Node.TEXT_NODE?d.setEnd(f.domNode,h):d.setEndAfter(f.domNode),t.concat(d)}),[])},t.prototype._transformCursors=function(t){var e=this;t=new f(t),this.cursors().filter((function(t){return t.range})).forEach((function(r){r.range.index=t.transformPosition(r.range.index),e._updateCursor(r)}))},t.DEFAULTS={template:c.default,containerClass:\"ql-cursors\",selectionChangeSource:\"api\",hideDelayMs:3e3,hideSpeedMs:400},t}();e.default=h},338:function(t,e,r){\"use strict\";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,\"__esModule\",{value:!0});var i=n(r(353)),o='\\n \\n \\n \\n \\n
    \\n \\n
    \\n');e.default=o},207:function(t){t.exports=function(){\"use strict\";const t=/^\\s+/,e=/\\s+$/;function r(n,i){if(i=i||{},(n=n||\"\")instanceof r)return n;if(!(this instanceof r))return new r(n,i);var o=function(r){var n={r:0,g:0,b:0},i=1,o=null,a=null,s=null,u=!1,c=!1;return\"string\"==typeof r&&(r=function(r){r=r.replace(t,\"\").replace(e,\"\").toLowerCase();var n,i=!1;if(y[r])r=y[r],i=!0;else if(\"transparent\"==r)return{r:0,g:0,b:0,a:0,format:\"name\"};return(n=T.rgb.exec(r))?{r:n[1],g:n[2],b:n[3]}:(n=T.rgba.exec(r))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=T.hsl.exec(r))?{h:n[1],s:n[2],l:n[3]}:(n=T.hsla.exec(r))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=T.hsv.exec(r))?{h:n[1],s:n[2],v:n[3]}:(n=T.hsva.exec(r))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=T.hex8.exec(r))?{r:w(n[1]),g:w(n[2]),b:w(n[3]),a:O(n[4]),format:i?\"name\":\"hex8\"}:(n=T.hex6.exec(r))?{r:w(n[1]),g:w(n[2]),b:w(n[3]),format:i?\"name\":\"hex\"}:(n=T.hex4.exec(r))?{r:w(n[1]+\"\"+n[1]),g:w(n[2]+\"\"+n[2]),b:w(n[3]+\"\"+n[3]),a:O(n[4]+\"\"+n[4]),format:i?\"name\":\"hex8\"}:!!(n=T.hex3.exec(r))&&{r:w(n[1]+\"\"+n[1]),g:w(n[2]+\"\"+n[2]),b:w(n[3]+\"\"+n[3]),format:i?\"name\":\"hex\"}}(r)),\"object\"==typeof r&&(R(r.r)&&R(r.g)&&R(r.b)?(l=r.r,f=r.g,h=r.b,n={r:255*x(l,255),g:255*x(f,255),b:255*x(h,255)},u=!0,c=\"%\"===String(r.r).substr(-1)?\"prgb\":\"rgb\"):R(r.h)&&R(r.s)&&R(r.v)?(o=S(r.s),a=S(r.v),n=function(t,e,r){t=6*x(t,360),e=x(e,100),r=x(r,100);var n=Math.floor(t),i=t-n,o=r*(1-e),a=r*(1-i*e),s=r*(1-(1-i)*e),u=n%6;return{r:255*[r,a,o,o,s,r][u],g:255*[s,r,r,a,o,o][u],b:255*[o,o,s,r,r,a][u]}}(r.h,o,a),u=!0,c=\"hsv\"):R(r.h)&&R(r.s)&&R(r.l)&&(o=S(r.s),s=S(r.l),n=function(t,e,r){var n,i,o;function a(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=x(t,360),e=x(e,100),r=x(r,100),0===e)n=i=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,u=2*r-s;n=a(u,s,t+1/3),i=a(u,s,t),o=a(u,s,t-1/3)}return{r:255*n,g:255*i,b:255*o}}(r.h,o,s),u=!0,c=\"hsl\"),r.hasOwnProperty(\"a\")&&(i=r.a)),i=A(i),{ok:u,format:r.format||c,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:i};var l,f,h}(n);this._originalInput=n,this._r=o.r,this._g=o.g,this._b=o.b,this._a=o.a,this._roundA=Math.round(100*this._a)/100,this._format=i.format||o.format,this._gradientType=i.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=o.ok}function n(t,e,r){t=x(t,255),e=x(e,255),r=x(r,255);var n,i,o=Math.max(t,e,r),a=Math.min(t,e,r),s=(o+a)/2;if(o==a)n=i=0;else{var u=o-a;switch(i=s>.5?u/(2-o-a):u/(o+a),o){case t:n=(e-r)/u+(e>1)+720)%360;--e;)i.h=(i.h+o)%360,a.push(r(i));return a}function b(t,e){e=e||6;for(var n=r(t).toHsv(),i=n.h,o=n.s,a=n.v,s=[],u=1/e;e--;)s.push(r({h:i,s:o,v:a})),a=(a+u)%1;return s}r.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n=this.toRgb();return t=n.r/255,e=n.g/255,r=n.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=A(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=i(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.v);return 1==this._a?\"hsv(\"+e+\", \"+r+\"%, \"+n+\"%)\":\"hsva(\"+e+\", \"+r+\"%, \"+n+\"%, \"+this._roundA+\")\"},toHsl:function(){var t=n(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=n(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),i=Math.round(100*t.l);return 1==this._a?\"hsl(\"+e+\", \"+r+\"%, \"+i+\"%)\":\"hsla(\"+e+\", \"+r+\"%, \"+i+\"%, \"+this._roundA+\")\"},toHex:function(t){return o(this._r,this._g,this._b,t)},toHexString:function(t){return\"#\"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[E(Math.round(t).toString(16)),E(Math.round(e).toString(16)),E(Math.round(r).toString(16)),E(M(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join(\"\")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return\"#\"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?\"rgb(\"+Math.round(this._r)+\", \"+Math.round(this._g)+\", \"+Math.round(this._b)+\")\":\"rgba(\"+Math.round(this._r)+\", \"+Math.round(this._g)+\", \"+Math.round(this._b)+\", \"+this._roundA+\")\"},toPercentageRgb:function(){return{r:Math.round(100*x(this._r,255))+\"%\",g:Math.round(100*x(this._g,255))+\"%\",b:Math.round(100*x(this._b,255))+\"%\",a:this._a}},toPercentageRgbString:function(){return 1==this._a?\"rgb(\"+Math.round(100*x(this._r,255))+\"%, \"+Math.round(100*x(this._g,255))+\"%, \"+Math.round(100*x(this._b,255))+\"%)\":\"rgba(\"+Math.round(100*x(this._r,255))+\"%, \"+Math.round(100*x(this._g,255))+\"%, \"+Math.round(100*x(this._b,255))+\"%, \"+this._roundA+\")\"},toName:function(){return 0===this._a?\"transparent\":!(this._a<1)&&(m[o(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e=\"#\"+a(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?\"GradientType = 1, \":\"\";if(t){var o=r(t);n=\"#\"+a(o._r,o._g,o._b,o._a)}return\"progid:DXImageTransform.Microsoft.gradient(\"+i+\"startColorstr=\"+e+\",endColorstr=\"+n+\")\"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||\"hex\"!==t&&\"hex6\"!==t&&\"hex3\"!==t&&\"hex4\"!==t&&\"hex8\"!==t&&\"name\"!==t?(\"rgb\"===t&&(r=this.toRgbString()),\"prgb\"===t&&(r=this.toPercentageRgbString()),\"hex\"!==t&&\"hex6\"!==t||(r=this.toHexString()),\"hex3\"===t&&(r=this.toHexString(!0)),\"hex4\"===t&&(r=this.toHex8String(!0)),\"hex8\"===t&&(r=this.toHex8String()),\"name\"===t&&(r=this.toName()),\"hsl\"===t&&(r=this.toHslString()),\"hsv\"===t&&(r=this.toHsvString()),r||this.toHexString()):\"name\"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return r(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(l,arguments)},brighten:function(){return this._applyModification(f,arguments)},darken:function(){return this._applyModification(h,arguments)},desaturate:function(){return this._applyModification(s,arguments)},saturate:function(){return this._applyModification(u,arguments)},greyscale:function(){return this._applyModification(c,arguments)},spin:function(){return this._applyModification(d,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(v,arguments)},complement:function(){return this._applyCombination(p,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(g,[3])},tetrad:function(){return this._applyCombination(g,[4])}},r.fromRatio=function(t,e){if(\"object\"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=\"a\"===i?t[i]:S(t[i]));t=n}return r(t,e)},r.equals=function(t,e){return!(!t||!e)&&r(t).toRgbString()==r(e).toRgbString()},r.random=function(){return r.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},r.mix=function(t,e,n){n=0===n?0:n||50;var i=r(t).toRgb(),o=r(e).toRgb(),a=n/100;return r({r:(o.r-i.r)*a+i.r,g:(o.g-i.g)*a+i.g,b:(o.b-i.b)*a+i.b,a:(o.a-i.a)*a+i.a})},r.readability=function(t,e){var n=r(t),i=r(e);return(Math.max(n.getLuminance(),i.getLuminance())+.05)/(Math.min(n.getLuminance(),i.getLuminance())+.05)},r.isReadable=function(t,e,n){var i,o,a,s,u,c=r.readability(t,e);switch(o=!1,(a=n,\"AA\"!==(s=((a=a||{level:\"AA\",size:\"small\"}).level||\"AA\").toUpperCase())&&\"AAA\"!==s&&(s=\"AA\"),\"small\"!==(u=(a.size||\"small\").toLowerCase())&&\"large\"!==u&&(u=\"small\"),i={level:s,size:u}).level+i.size){case\"AAsmall\":case\"AAAlarge\":o=c>=4.5;break;case\"AAlarge\":o=c>=3;break;case\"AAAsmall\":o=c>=7}return o},r.mostReadable=function(t,e,n){var i,o,a,s,u=null,c=0;o=(n=n||{}).includeFallbackColors,a=n.level,s=n.size;for(var l=0;lc&&(c=i,u=r(e[l]));return r.isReadable(t,u,{level:a,size:s})||!o?u:(n.includeFallbackColors=!1,r.mostReadable(t,[\"#fff\",\"#000\"],n))};var y=r.names={aliceblue:\"f0f8ff\",antiquewhite:\"faebd7\",aqua:\"0ff\",aquamarine:\"7fffd4\",azure:\"f0ffff\",beige:\"f5f5dc\",bisque:\"ffe4c4\",black:\"000\",blanchedalmond:\"ffebcd\",blue:\"00f\",blueviolet:\"8a2be2\",brown:\"a52a2a\",burlywood:\"deb887\",burntsienna:\"ea7e5d\",cadetblue:\"5f9ea0\",chartreuse:\"7fff00\",chocolate:\"d2691e\",coral:\"ff7f50\",cornflowerblue:\"6495ed\",cornsilk:\"fff8dc\",crimson:\"dc143c\",cyan:\"0ff\",darkblue:\"00008b\",darkcyan:\"008b8b\",darkgoldenrod:\"b8860b\",darkgray:\"a9a9a9\",darkgreen:\"006400\",darkgrey:\"a9a9a9\",darkkhaki:\"bdb76b\",darkmagenta:\"8b008b\",darkolivegreen:\"556b2f\",darkorange:\"ff8c00\",darkorchid:\"9932cc\",darkred:\"8b0000\",darksalmon:\"e9967a\",darkseagreen:\"8fbc8f\",darkslateblue:\"483d8b\",darkslategray:\"2f4f4f\",darkslategrey:\"2f4f4f\",darkturquoise:\"00ced1\",darkviolet:\"9400d3\",deeppink:\"ff1493\",deepskyblue:\"00bfff\",dimgray:\"696969\",dimgrey:\"696969\",dodgerblue:\"1e90ff\",firebrick:\"b22222\",floralwhite:\"fffaf0\",forestgreen:\"228b22\",fuchsia:\"f0f\",gainsboro:\"dcdcdc\",ghostwhite:\"f8f8ff\",gold:\"ffd700\",goldenrod:\"daa520\",gray:\"808080\",green:\"008000\",greenyellow:\"adff2f\",grey:\"808080\",honeydew:\"f0fff0\",hotpink:\"ff69b4\",indianred:\"cd5c5c\",indigo:\"4b0082\",ivory:\"fffff0\",khaki:\"f0e68c\",lavender:\"e6e6fa\",lavenderblush:\"fff0f5\",lawngreen:\"7cfc00\",lemonchiffon:\"fffacd\",lightblue:\"add8e6\",lightcoral:\"f08080\",lightcyan:\"e0ffff\",lightgoldenrodyellow:\"fafad2\",lightgray:\"d3d3d3\",lightgreen:\"90ee90\",lightgrey:\"d3d3d3\",lightpink:\"ffb6c1\",lightsalmon:\"ffa07a\",lightseagreen:\"20b2aa\",lightskyblue:\"87cefa\",lightslategray:\"789\",lightslategrey:\"789\",lightsteelblue:\"b0c4de\",lightyellow:\"ffffe0\",lime:\"0f0\",limegreen:\"32cd32\",linen:\"faf0e6\",magenta:\"f0f\",maroon:\"800000\",mediumaquamarine:\"66cdaa\",mediumblue:\"0000cd\",mediumorchid:\"ba55d3\",mediumpurple:\"9370db\",mediumseagreen:\"3cb371\",mediumslateblue:\"7b68ee\",mediumspringgreen:\"00fa9a\",mediumturquoise:\"48d1cc\",mediumvioletred:\"c71585\",midnightblue:\"191970\",mintcream:\"f5fffa\",mistyrose:\"ffe4e1\",moccasin:\"ffe4b5\",navajowhite:\"ffdead\",navy:\"000080\",oldlace:\"fdf5e6\",olive:\"808000\",olivedrab:\"6b8e23\",orange:\"ffa500\",orangered:\"ff4500\",orchid:\"da70d6\",palegoldenrod:\"eee8aa\",palegreen:\"98fb98\",paleturquoise:\"afeeee\",palevioletred:\"db7093\",papayawhip:\"ffefd5\",peachpuff:\"ffdab9\",peru:\"cd853f\",pink:\"ffc0cb\",plum:\"dda0dd\",powderblue:\"b0e0e6\",purple:\"800080\",rebeccapurple:\"663399\",red:\"f00\",rosybrown:\"bc8f8f\",royalblue:\"4169e1\",saddlebrown:\"8b4513\",salmon:\"fa8072\",sandybrown:\"f4a460\",seagreen:\"2e8b57\",seashell:\"fff5ee\",sienna:\"a0522d\",silver:\"c0c0c0\",skyblue:\"87ceeb\",slateblue:\"6a5acd\",slategray:\"708090\",slategrey:\"708090\",snow:\"fffafa\",springgreen:\"00ff7f\",steelblue:\"4682b4\",tan:\"d2b48c\",teal:\"008080\",thistle:\"d8bfd8\",tomato:\"ff6347\",turquoise:\"40e0d0\",violet:\"ee82ee\",wheat:\"f5deb3\",white:\"fff\",whitesmoke:\"f5f5f5\",yellow:\"ff0\",yellowgreen:\"9acd32\"},m=r.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(y);function A(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function x(t,e){(function(t){return\"string\"==typeof t&&-1!=t.indexOf(\".\")&&1===parseFloat(t)})(t)&&(t=\"100%\");var r=function(t){return\"string\"==typeof t&&-1!=t.indexOf(\"%\")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function C(t){return Math.min(1,Math.max(0,t))}function w(t){return parseInt(t,16)}function E(t){return 1==t.length?\"0\"+t:\"\"+t}function S(t){return t<=1&&(t=100*t+\"%\"),t}function M(t){return Math.round(255*parseFloat(t)).toString(16)}function O(t){return w(t)/255}var j,L,k,T=(L=\"[\\\\s|\\\\(]+(\"+(j=\"(?:[-\\\\+]?\\\\d*\\\\.\\\\d+%?)|(?:[-\\\\+]?\\\\d+%?)\")+\")[,|\\\\s]+(\"+j+\")[,|\\\\s]+(\"+j+\")\\\\s*\\\\)?\",k=\"[\\\\s|\\\\(]+(\"+j+\")[,|\\\\s]+(\"+j+\")[,|\\\\s]+(\"+j+\")[,|\\\\s]+(\"+j+\")\\\\s*\\\\)?\",{CSS_UNIT:new RegExp(j),rgb:new RegExp(\"rgb\"+L),rgba:new RegExp(\"rgba\"+k),hsl:new RegExp(\"hsl\"+L),hsla:new RegExp(\"hsla\"+k),hsv:new RegExp(\"hsv\"+L),hsva:new RegExp(\"hsva\"+k),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function R(t){return!!T.CSS_UNIT.exec(t)}return r}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={id:n,loaded:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if(\"object\"==typeof globalThis)return globalThis;try{return this||new Function(\"return this\")()}catch(t){if(\"object\"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),r.nc=void 0;var n=r(607);return n.default})()));", "/* eslint-env browser */\n\n/**\n * Tiny websocket connection handler.\n *\n * Implements exponential backoff reconnects, ping/pong, and a nice event system using [lib0/observable].\n *\n * @module websocket\n */\n\nimport { Observable } from './observable.js'\nimport * as time from './time.js'\nimport * as math from './math.js'\n\nconst reconnectTimeoutBase = 1200\nconst maxReconnectTimeout = 2500\n// @todo - this should depend on awareness.outdatedTime\nconst messageReconnectTimeout = 30000\n\n/**\n * @param {WebsocketClient} wsclient\n */\nconst setupWS = (wsclient) => {\n if (wsclient.shouldConnect && wsclient.ws === null) {\n const websocket = new WebSocket(wsclient.url)\n const binaryType = wsclient.binaryType\n /**\n * @type {any}\n */\n let pingTimeout = null\n if (binaryType) {\n websocket.binaryType = binaryType\n }\n wsclient.ws = websocket\n wsclient.connecting = true\n wsclient.connected = false\n websocket.onmessage = event => {\n wsclient.lastMessageReceived = time.getUnixTime()\n const data = event.data\n const message = typeof data === 'string' ? JSON.parse(data) : data\n if (message && message.type === 'pong') {\n clearTimeout(pingTimeout)\n pingTimeout = setTimeout(sendPing, messageReconnectTimeout / 2)\n }\n wsclient.emit('message', [message, wsclient])\n }\n /**\n * @param {any} error\n */\n const onclose = error => {\n if (wsclient.ws !== null) {\n wsclient.ws = null\n wsclient.connecting = false\n if (wsclient.connected) {\n wsclient.connected = false\n wsclient.emit('disconnect', [{ type: 'disconnect', error }, wsclient])\n } else {\n wsclient.unsuccessfulReconnects++\n }\n // Start with no reconnect timeout and increase timeout by\n // log10(wsUnsuccessfulReconnects).\n // The idea is to increase reconnect timeout slowly and have no reconnect\n // timeout at the beginning (log(1) = 0)\n setTimeout(setupWS, math.min(math.log10(wsclient.unsuccessfulReconnects + 1) * reconnectTimeoutBase, maxReconnectTimeout), wsclient)\n }\n clearTimeout(pingTimeout)\n }\n const sendPing = () => {\n if (wsclient.ws === websocket) {\n wsclient.send({\n type: 'ping'\n })\n }\n }\n websocket.onclose = () => onclose(null)\n websocket.onerror = error => onclose(error)\n websocket.onopen = () => {\n wsclient.lastMessageReceived = time.getUnixTime()\n wsclient.connecting = false\n wsclient.connected = true\n wsclient.unsuccessfulReconnects = 0\n wsclient.emit('connect', [{ type: 'connect' }, wsclient])\n // set ping\n pingTimeout = setTimeout(sendPing, messageReconnectTimeout / 2)\n }\n }\n}\n\n/**\n * @deprecated\n * @extends Observable\n */\nexport class WebsocketClient extends Observable {\n /**\n * @param {string} url\n * @param {object} opts\n * @param {'arraybuffer' | 'blob' | null} [opts.binaryType] Set `ws.binaryType`\n */\n constructor (url, { binaryType } = {}) {\n super()\n this.url = url\n /**\n * @type {WebSocket?}\n */\n this.ws = null\n this.binaryType = binaryType || null\n this.connected = false\n this.connecting = false\n this.unsuccessfulReconnects = 0\n this.lastMessageReceived = 0\n /**\n * Whether to connect to other peers or not\n * @type {boolean}\n */\n this.shouldConnect = true\n this._checkInterval = setInterval(() => {\n if (this.connected && messageReconnectTimeout < time.getUnixTime() - this.lastMessageReceived) {\n // no message received in a long time - not even your own awareness\n // updates (which are updated every 15 seconds)\n /** @type {WebSocket} */ (this.ws).close()\n }\n }, messageReconnectTimeout / 2)\n setupWS(this)\n }\n\n /**\n * @param {any} message\n */\n send (message) {\n if (this.ws) {\n this.ws.send(JSON.stringify(message))\n }\n }\n\n destroy () {\n clearInterval(this._checkInterval)\n this.disconnect()\n super.destroy()\n }\n\n disconnect () {\n this.shouldConnect = false\n if (this.ws !== null) {\n this.ws.close()\n }\n }\n\n connect () {\n this.shouldConnect = true\n if (!this.connected && this.ws === null) {\n setupWS(this)\n }\n }\n}\n", "/* eslint-env browser */\n\n/**\n * Helpers for cross-tab communication using broadcastchannel with LocalStorage fallback.\n *\n * ```js\n * // In browser window A:\n * broadcastchannel.subscribe('my events', data => console.log(data))\n * broadcastchannel.publish('my events', 'Hello world!') // => A: 'Hello world!' fires synchronously in same tab\n *\n * // In browser window B:\n * broadcastchannel.publish('my events', 'hello from tab B') // => A: 'hello from tab B'\n * ```\n *\n * @module broadcastchannel\n */\n\n// @todo before next major: use Uint8Array instead as buffer object\n\nimport * as map from './map.js'\nimport * as set from './set.js'\nimport * as buffer from './buffer.js'\nimport * as storage from './storage.js'\n\n/**\n * @typedef {Object} Channel\n * @property {Set} Channel.subs\n * @property {any} Channel.bc\n */\n\n/**\n * @type {Map}\n */\nconst channels = new Map()\n\n/* c8 ignore start */\nclass LocalStoragePolyfill {\n /**\n * @param {string} room\n */\n constructor (room) {\n this.room = room\n /**\n * @type {null|function({data:ArrayBuffer}):void}\n */\n this.onmessage = null\n /**\n * @param {any} e\n */\n this._onChange = e => e.key === room && this.onmessage !== null && this.onmessage({ data: buffer.fromBase64(e.newValue || '') })\n storage.onChange(this._onChange)\n }\n\n /**\n * @param {ArrayBuffer} buf\n */\n postMessage (buf) {\n storage.varStorage.setItem(this.room, buffer.toBase64(buffer.createUint8ArrayFromArrayBuffer(buf)))\n }\n\n close () {\n storage.offChange(this._onChange)\n }\n}\n/* c8 ignore stop */\n\n// Use BroadcastChannel or Polyfill\n/* c8 ignore next */\nconst BC = typeof BroadcastChannel === 'undefined' ? LocalStoragePolyfill : BroadcastChannel\n\n/**\n * @param {string} room\n * @return {Channel}\n */\nconst getChannel = room =>\n map.setIfUndefined(channels, room, () => {\n const subs = set.create()\n const bc = new BC(room)\n /**\n * @param {{data:ArrayBuffer}} e\n */\n /* c8 ignore next */\n bc.onmessage = e => subs.forEach(sub => sub(e.data, 'broadcastchannel'))\n return {\n bc, subs\n }\n })\n\n/**\n * Subscribe to global `publish` events.\n *\n * @function\n * @param {string} room\n * @param {function(any, any):any} f\n */\nexport const subscribe = (room, f) => {\n getChannel(room).subs.add(f)\n return f\n}\n\n/**\n * Unsubscribe from `publish` global events.\n *\n * @function\n * @param {string} room\n * @param {function(any, any):any} f\n */\nexport const unsubscribe = (room, f) => {\n const channel = getChannel(room)\n const unsubscribed = channel.subs.delete(f)\n if (unsubscribed && channel.subs.size === 0) {\n channel.bc.close()\n channels.delete(room)\n }\n return unsubscribed\n}\n\n/**\n * Publish data to all subscribers (including subscribers on this tab)\n *\n * @function\n * @param {string} room\n * @param {any} data\n * @param {any} [origin]\n */\nexport const publish = (room, data, origin = null) => {\n const c = getChannel(room)\n c.bc.postMessage(data)\n c.subs.forEach(sub => sub(data, origin))\n}\n", "/**\n * Mutual exclude for JavaScript.\n *\n * @module mutex\n */\n\n/**\n * @callback mutex\n * @param {function():void} cb Only executed when this mutex is not in the current stack\n * @param {function():void} [elseCb] Executed when this mutex is in the current stack\n */\n\n/**\n * Creates a mutual exclude function with the following property:\n *\n * ```js\n * const mutex = createMutex()\n * mutex(() => {\n * // This function is immediately executed\n * mutex(() => {\n * // This function is not executed, as the mutex is already active.\n * })\n * })\n * ```\n *\n * @return {mutex} A mutual exclude function\n * @public\n */\nexport const createMutex = () => {\n let token = true\n return (f, g) => {\n if (token) {\n token = false\n try {\n f()\n } finally {\n token = true\n }\n } else if (g !== undefined) {\n g()\n }\n }\n}\n", "(function(e){if(\"object\"==typeof exports&&\"undefined\"!=typeof module)module.exports=e();else if(\"function\"==typeof define&&define.amd)define([],e);else{var t;t=\"undefined\"==typeof window?\"undefined\"==typeof global?\"undefined\"==typeof self?this:self:global:window,t.SimplePeer=e()}})(function(){var t=Math.floor,n=Math.abs,r=Math.pow;return function(){function d(s,e,n){function t(o,i){if(!e[o]){if(!s[o]){var l=\"function\"==typeof require&&require;if(!i&&l)return l(o,!0);if(r)return r(o,!0);var c=new Error(\"Cannot find module '\"+o+\"'\");throw c.code=\"MODULE_NOT_FOUND\",c}var a=e[o]={exports:{}};s[o][0].call(a.exports,function(e){var r=s[o][1][e];return t(r||e)},a,a.exports,d,s,e,n)}return e[o].exports}for(var r=\"function\"==typeof require&&require,a=0;a>16,l[c++]=255&t>>8,l[c++]=255&t;return 2===s&&(t=u[e.charCodeAt(n)]<<2|u[e.charCodeAt(n+1)]>>4,l[c++]=255&t),1===s&&(t=u[e.charCodeAt(n)]<<10|u[e.charCodeAt(n+1)]<<4|u[e.charCodeAt(n+2)]>>2,l[c++]=255&t>>8,l[c++]=255&t),l}function d(e){return c[63&e>>18]+c[63&e>>12]+c[63&e>>6]+c[63&e]}function s(e,t,n){for(var r,a=[],o=t;ol?l:d+o));return 1===r?(t=e[n-1],a.push(c[t>>2]+c[63&t<<4]+\"==\")):2===r&&(t=(e[n-2]<<8)+e[n-1],a.push(c[t>>10]+c[63&t>>4]+c[63&t<<2]+\"=\")),a.join(\"\")}n.byteLength=function(e){var t=r(e),n=t[0],a=t[1];return 3*(n+a)/4-a},n.toByteArray=o,n.fromByteArray=l;for(var c=[],u=[],p=\"undefined\"==typeof Uint8Array?Array:Uint8Array,f=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\",g=0,_=f.length;g<_;++g)c[g]=f[g],u[f.charCodeAt(g)]=g;u[45]=62,u[95]=63},{}],2:[function(){},{}],3:[function(e,t,n){(function(){(function(){/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */'use strict';var t=String.fromCharCode,o=Math.min;function d(e){if(2147483647e)throw new RangeError(\"The value \\\"\"+e+\"\\\" is invalid for option \\\"size\\\"\")}function u(e,t,n){return c(e),0>=e?d(e):void 0===t?d(e):\"string\"==typeof n?d(e).fill(t,n):d(e).fill(t)}function p(e){return c(e),d(0>e?0:0|m(e))}function f(e,t){if((\"string\"!=typeof t||\"\"===t)&&(t=\"utf8\"),!s.isEncoding(t))throw new TypeError(\"Unknown encoding: \"+t);var n=0|b(e,t),r=d(n),a=r.write(e,t);return a!==n&&(r=r.slice(0,a)),r}function g(e){for(var t=0>e.length?0:0|m(e.length),n=d(t),r=0;rt||e.byteLength=2147483647)throw new RangeError(\"Attempt to allocate Buffer larger than maximum size: 0x\"+2147483647 .toString(16)+\" bytes\");return 0|e}function b(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if(\"string\"!=typeof e)throw new TypeError(\"The \\\"string\\\" argument must be one of type string, Buffer, or ArrayBuffer. Received type \"+typeof e);var n=e.length,r=2>>1;case\"base64\":return z(e).length;default:if(a)return r?-1:H(e).length;t=(\"\"+t).toLowerCase(),a=!0;}}function y(e,t,n){var r=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return\"\";if((void 0===n||n>this.length)&&(n=this.length),0>=n)return\"\";if(n>>>=0,t>>>=0,n<=t)return\"\";for(e||(e=\"utf8\");;)switch(e){case\"hex\":return P(this,t,n);case\"utf8\":case\"utf-8\":return x(this,t,n);case\"ascii\":return D(this,t,n);case\"latin1\":case\"binary\":return I(this,t,n);case\"base64\":return A(this,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return M(this,t,n);default:if(r)throw new TypeError(\"Unknown encoding: \"+e);e=(e+\"\").toLowerCase(),r=!0;}}function C(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function R(e,t,n,r,a){if(0===e.length)return-1;if(\"string\"==typeof n?(r=n,n=0):2147483647n&&(n=-2147483648),n=+n,X(n)&&(n=a?0:e.length-1),0>n&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(0>n)if(a)n=0;else return-1;if(\"string\"==typeof t&&(t=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:E(e,t,n,r,a);if(\"number\"==typeof t)return t&=255,\"function\"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,a);throw new TypeError(\"val must be string, number or Buffer\")}function E(e,t,n,r,a){function o(e,t){return 1===d?e[t]:e.readUInt16BE(t*d)}var d=1,s=e.length,l=t.length;if(void 0!==r&&(r=(r+\"\").toLowerCase(),\"ucs2\"===r||\"ucs-2\"===r||\"utf16le\"===r||\"utf-16le\"===r)){if(2>e.length||2>t.length)return-1;d=2,s/=2,l/=2,n/=2}var c;if(a){var u=-1;for(c=n;cs&&(n=s-l),c=n;0<=c;c--){for(var p=!0,f=0;fa&&(r=a)):r=a;var o=t.length;r>o/2&&(r=o/2);for(var d,s=0;sd&&(s=d):2===l?(c=e[a+1],128==(192&c)&&(f=(31&d)<<6|63&c,127f||57343f&&(s=f))):void 0}null===s?(s=65533,l=1):65535>>10),s=56320|1023&s),r.push(s),a+=l}return N(r)}function N(e){var n=e.length;if(n<=4096)return t.apply(String,e);for(var r=\"\",a=0;at)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var a=\"\",o=t;oe)throw new RangeError(\"offset is not uint\");if(e+t>n)throw new RangeError(\"Trying to access beyond buffer length\")}function F(e,t,n,r,a,o){if(!s.isBuffer(e))throw new TypeError(\"\\\"buffer\\\" argument must be a Buffer instance\");if(t>a||te.length)throw new RangeError(\"Index out of range\")}function B(e,t,n,r){if(n+r>e.length)throw new RangeError(\"Index out of range\");if(0>n)throw new RangeError(\"Index out of range\")}function U(e,t,n,r,a){return t=+t,n>>>=0,a||B(e,t,n,4,34028234663852886e22,-34028234663852886e22),J.write(e,t,n,r,23,4),n+4}function j(e,t,n,r,a){return t=+t,n>>>=0,a||B(e,t,n,8,17976931348623157e292,-17976931348623157e292),J.write(e,t,n,r,52,8),n+8}function q(e){if(e=e.split(\"=\")[0],e=e.trim().replace(Q,\"\"),2>e.length)return\"\";for(;0!=e.length%4;)e+=\"=\";return e}function W(e){return 16>e?\"0\"+e.toString(16):e.toString(16)}function H(e,t){t=t||1/0;for(var n,r=e.length,a=null,o=[],d=0;dn){if(!a){if(56319n){-1<(t-=3)&&o.push(239,191,189),a=n;continue}n=(a-55296<<10|n-56320)+65536}else a&&-1<(t-=3)&&o.push(239,191,189);if(a=null,128>n){if(0>(t-=1))break;o.push(n)}else if(2048>n){if(0>(t-=2))break;o.push(192|n>>6,128|63&n)}else if(65536>n){if(0>(t-=3))break;o.push(224|n>>12,128|63&n>>6,128|63&n)}else if(1114112>n){if(0>(t-=4))break;o.push(240|n>>18,128|63&n>>12,128|63&n>>6,128|63&n)}else throw new Error(\"Invalid code point\")}return o}function Y(e){for(var t=[],n=0;n(t-=2));++d)n=e.charCodeAt(d),r=n>>8,a=n%256,o.push(a),o.push(r);return o}function z(e){return $.toByteArray(q(e))}function G(e,t,n,r){for(var a=0;a=t.length||a>=e.length);++a)t[a+n]=e[a];return a}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!==e}var $=e(\"base64-js\"),J=e(\"ieee754\");n.Buffer=s,n.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},n.INSPECT_MAX_BYTES=50;n.kMaxLength=2147483647,s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||\"undefined\"==typeof console||\"function\"!=typeof console.error||console.error(\"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.\"),Object.defineProperty(s.prototype,\"parent\",{enumerable:!0,get:function(){return s.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(s.prototype,\"offset\",{enumerable:!0,get:function(){return s.isBuffer(this)?this.byteOffset:void 0}}),\"undefined\"!=typeof Symbol&&null!=Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),s.poolSize=8192,s.from=function(e,t,n){return l(e,t,n)},s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,s.alloc=function(e,t,n){return u(e,t,n)},s.allocUnsafe=function(e){return p(e)},s.allocUnsafeSlow=function(e){return p(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(K(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError(\"The \\\"buf1\\\", \\\"buf2\\\" arguments must be one of type Buffer or Uint8Array\");if(e===t)return 0;for(var n=e.length,r=t.length,d=0,l=o(n,r);dt&&(e+=\" ... \"),\"\"},s.prototype.compare=function(e,t,n,r,a){if(K(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError(\"The \\\"target\\\" argument must be one of type Buffer or Uint8Array. Received type \"+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),0>t||n>e.length||0>r||a>this.length)throw new RangeError(\"out of range index\");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,a>>>=0,this===e)return 0;for(var d=a-r,l=n-t,c=o(d,l),u=this.slice(r,a),p=e.slice(t,n),f=0;f>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r=\"utf8\")):(r=n,n=void 0);else throw new Error(\"Buffer.write(string, encoding, offset[, length]) is no longer supported\");var a=this.length-t;if((void 0===n||n>a)&&(n=a),0n||0>t)||t>this.length)throw new RangeError(\"Attempt to write outside buffer bounds\");r||(r=\"utf8\");for(var o=!1;;)switch(r){case\"hex\":return w(this,e,t,n);case\"utf8\":case\"utf-8\":return S(this,e,t,n);case\"ascii\":return T(this,e,t,n);case\"latin1\":case\"binary\":return v(this,e,t,n);case\"base64\":return k(this,e,t,n);case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return L(this,e,t,n);default:if(o)throw new TypeError(\"Unknown encoding: \"+r);r=(\"\"+r).toLowerCase(),o=!0;}},s.prototype.toJSON=function(){return{type:\"Buffer\",data:Array.prototype.slice.call(this._arr||this,0)}};s.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),t>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e],a=1,o=0;++o>>=0,t>>>=0,n||O(e,t,this.length);for(var r=this[e+--t],a=1;0>>=0,t||O(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var a=this[e],o=1,d=0;++d=o&&(a-=r(2,8*t)),a},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);for(var a=t,o=1,d=this[e+--a];0=o&&(d-=r(2,8*t)),d},s.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),J.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),J.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),J.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),J.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,a){if(e=+e,t>>>=0,n>>>=0,!a){var o=r(2,8*n)-1;F(this,e,t,n,o,0)}var d=1,s=0;for(this[t]=255&e;++s>>=0,n>>>=0,!a){var o=r(2,8*n)-1;F(this,e,t,n,o,0)}var d=n-1,s=1;for(this[t+d]=255&e;0<=--d&&(s*=256);)this[t+d]=255&e/s;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeIntLE=function(e,t,n,a){if(e=+e,t>>>=0,!a){var o=r(2,8*n-1);F(this,e,t,n,o-1,-o)}var d=0,s=1,l=0;for(this[t]=255&e;++de&&0===l&&0!==this[t+d-1]&&(l=1),this[t+d]=255&(e/s>>0)-l;return t+n},s.prototype.writeIntBE=function(e,t,n,a){if(e=+e,t>>>=0,!a){var o=r(2,8*n-1);F(this,e,t,n,o-1,-o)}var d=n-1,s=1,l=0;for(this[t+d]=255&e;0<=--d&&(s*=256);)0>e&&0===l&&0!==this[t+d+1]&&(l=1),this[t+d]=255&(e/s>>0)-l;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,1,127,-128),0>e&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeFloatLE=function(e,t,n){return U(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return U(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return j(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return j(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw new TypeError(\"argument should be a Buffer\");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),0t)throw new RangeError(\"targetStart out of bounds\");if(0>n||n>=this.length)throw new RangeError(\"Index out of range\");if(0>r)throw new RangeError(\"sourceEnd out of bounds\");r>this.length&&(r=this.length),e.length-ta||\"latin1\"===r)&&(e=a)}}else\"number\"==typeof e&&(e&=255);if(0>t||this.length>>=0,n=n===void 0?this.length:n>>>0,e||(e=0);var o;if(\"number\"==typeof e)for(o=t;o{\"%%\"===e||(r++,\"%c\"===e&&(a=r))}),e.splice(a,0,n)},n.save=function(e){try{e?n.storage.setItem(\"debug\",e):n.storage.removeItem(\"debug\")}catch(e){}},n.load=r,n.useColors=function(){return!!(\"undefined\"!=typeof window&&window.process&&(\"renderer\"===window.process.type||window.process.__nwjs))||!(\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/))&&(\"undefined\"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||\"undefined\"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/)&&31<=parseInt(RegExp.$1,10)||\"undefined\"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/))},n.storage=function(){try{return localStorage}catch(e){}}(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn(\"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.\"))}})(),n.colors=[\"#0000CC\",\"#0000FF\",\"#0033CC\",\"#0033FF\",\"#0066CC\",\"#0066FF\",\"#0099CC\",\"#0099FF\",\"#00CC00\",\"#00CC33\",\"#00CC66\",\"#00CC99\",\"#00CCCC\",\"#00CCFF\",\"#3300CC\",\"#3300FF\",\"#3333CC\",\"#3333FF\",\"#3366CC\",\"#3366FF\",\"#3399CC\",\"#3399FF\",\"#33CC00\",\"#33CC33\",\"#33CC66\",\"#33CC99\",\"#33CCCC\",\"#33CCFF\",\"#6600CC\",\"#6600FF\",\"#6633CC\",\"#6633FF\",\"#66CC00\",\"#66CC33\",\"#9900CC\",\"#9900FF\",\"#9933CC\",\"#9933FF\",\"#99CC00\",\"#99CC33\",\"#CC0000\",\"#CC0033\",\"#CC0066\",\"#CC0099\",\"#CC00CC\",\"#CC00FF\",\"#CC3300\",\"#CC3333\",\"#CC3366\",\"#CC3399\",\"#CC33CC\",\"#CC33FF\",\"#CC6600\",\"#CC6633\",\"#CC9900\",\"#CC9933\",\"#CCCC00\",\"#CCCC33\",\"#FF0000\",\"#FF0033\",\"#FF0066\",\"#FF0099\",\"#FF00CC\",\"#FF00FF\",\"#FF3300\",\"#FF3333\",\"#FF3366\",\"#FF3399\",\"#FF33CC\",\"#FF33FF\",\"#FF6600\",\"#FF6633\",\"#FF9900\",\"#FF9933\",\"#FFCC00\",\"#FFCC33\"],n.log=console.debug||console.log||(()=>{}),t.exports=e(\"./common\")(n);const{formatters:o}=t.exports;o.j=function(e){try{return JSON.stringify(e)}catch(e){return\"[UnexpectedJSONParseError]: \"+e.message}}}).call(this)}).call(this,e(\"_process\"))},{\"./common\":5,_process:12}],5:[function(e,t){t.exports=function(t){function r(e){function t(...e){if(!t.enabled)return;const a=t,o=+new Date,i=o-(n||o);a.diff=i,a.prev=n,a.curr=o,n=o,e[0]=r.coerce(e[0]),\"string\"!=typeof e[0]&&e.unshift(\"%O\");let d=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,n)=>{if(\"%%\"===t)return\"%\";d++;const o=r.formatters[n];if(\"function\"==typeof o){const n=e[d];t=o.call(a,n),e.splice(d,1),d--}return t}),r.formatArgs.call(a,e);const s=a.log||r.log;s.apply(a,e)}let n,o=null;return t.namespace=e,t.useColors=r.useColors(),t.color=r.selectColor(e),t.extend=a,t.destroy=r.destroy,Object.defineProperty(t,\"enabled\",{enumerable:!0,configurable:!1,get:()=>null===o?r.enabled(e):o,set:e=>{o=e}}),\"function\"==typeof r.init&&r.init(t),t}function a(e,t){const n=r(this.namespace+(\"undefined\"==typeof t?\":\":t)+e);return n.log=this.log,n}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\\.\\*\\?$/,\"*\")}return r.debug=r,r.default=r,r.coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){const e=[...r.names.map(o),...r.skips.map(o).map(e=>\"-\"+e)].join(\",\");return r.enable(\"\"),e},r.enable=function(e){r.save(e),r.names=[],r.skips=[];let t;const n=(\"string\"==typeof e?e:\"\").split(/[\\s,]+/),a=n.length;for(t=0;t{r[e]=t[e]}),r.names=[],r.skips=[],r.formatters={},r.selectColor=function(e){let t=0;for(let n=0;nd&&!l.warned){l.warned=!0;var c=new Error(\"Possible EventEmitter memory leak detected. \"+l.length+\" \"+(t+\" listeners added. Use emitter.setMaxListeners() to increase limit\"));c.name=\"MaxListenersExceededWarning\",c.emitter=e,c.type=t,c.count=l.length,n(c)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function s(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=d.bind(r);return a.listener=n,r.wrapFn=a,a}function l(e,t,n){var r=e._events;if(r===void 0)return[];var a=r[t];return void 0===a?[]:\"function\"==typeof a?n?[a.listener||a]:[a]:n?f(a):u(a,a.length)}function c(e){var t=this._events;if(t!==void 0){var n=t[e];if(\"function\"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function u(e,t){for(var n=Array(t),r=0;re||y(e))throw new RangeError(\"The value of \\\"defaultMaxListeners\\\" is out of range. It must be a non-negative number. Received \"+e+\".\");C=e}}),r.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(e){if(\"number\"!=typeof e||0>e||y(e))throw new RangeError(\"The value of \\\"n\\\" is out of range. It must be a non-negative number. Received \"+e+\".\");return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return o(this)},r.prototype.emit=function(e){for(var t=[],n=1;no)return this;0===o?n.shift():p(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit(\"removeListener\",e,s||t)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(e){var t,n,r;if(n=this._events,void 0===n)return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var a,o=Object.keys(n);for(r=0;r */o.read=function(t,n,a,o,l){var c,u,p=8*l-o-1,f=(1<>1,_=-7,h=a?l-1:0,b=a?-1:1,d=t[n+h];for(h+=b,c=d&(1<<-_)-1,d>>=-_,_+=p;0<_;c=256*c+t[n+h],h+=b,_-=8);for(u=c&(1<<-_)-1,c>>=-_,_+=o;0<_;u=256*u+t[n+h],h+=b,_-=8);if(0===c)c=1-g;else{if(c===f)return u?NaN:(d?-1:1)*(1/0);u+=r(2,o),c-=g}return(d?-1:1)*u*r(2,c-o)},o.write=function(a,o,l,u,p,f){var h,b,y,g=Math.LN2,_=Math.log,C=8*f-p-1,R=(1<>1,w=23===p?r(2,-24)-r(2,-77):0,S=u?0:f-1,T=u?1:-1,d=0>o||0===o&&0>1/o?1:0;for(o=n(o),isNaN(o)||o===1/0?(b=isNaN(o)?1:0,h=R):(h=t(_(o)/g),1>o*(y=r(2,-h))&&(h--,y*=2),o+=1<=h+E?w/y:w*r(2,1-E),2<=o*y&&(h++,y/=2),h+E>=R?(b=0,h=R):1<=h+E?(b=(o*y-1)*r(2,p),h+=E):(b=o*r(2,E-1)*r(2,p),h=0));8<=p;a[l+S]=255&b,S+=T,b/=256,p-=8);for(h=h<=1.5*a?\"s\":\"\")}var l=24*(60*60000);t.exports=function(e,t){t=t||{};var n=typeof e;if(\"string\"==n&&0 */let n;t.exports=\"function\"==typeof queueMicrotask?queueMicrotask.bind(\"undefined\"==typeof window?e:window):e=>(n||(n=Promise.resolve())).then(e).catch(e=>setTimeout(()=>{throw e},0))}).call(this)}).call(this,\"undefined\"==typeof global?\"undefined\"==typeof self?\"undefined\"==typeof window?{}:window:self:global)},{}],14:[function(e,t){(function(n,r){(function(){'use strict';var a=e(\"safe-buffer\").Buffer,o=r.crypto||r.msCrypto;t.exports=o&&o.getRandomValues?function(e,t){if(e>4294967295)throw new RangeError(\"requested too many random bytes\");var r=a.allocUnsafe(e);if(0n?0:+n,t.length)===t}function i(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}function d(e,t,n){return\"number\"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}var s={};r(\"ERR_INVALID_OPT_VALUE\",function(e,t){return\"The value \\\"\"+t+\"\\\" is invalid for option \\\"\"+e+\"\\\"\"},TypeError),r(\"ERR_INVALID_ARG_TYPE\",function(e,t,n){var r;\"string\"==typeof t&&o(t,\"not \")?(r=\"must not be\",t=t.replace(/^not /,\"\")):r=\"must be\";var s;if(i(e,\" argument\"))s=\"The \".concat(e,\" \").concat(r,\" \").concat(a(t,\"type\"));else{var l=d(e,\".\")?\"property\":\"argument\";s=\"The \\\"\".concat(e,\"\\\" \").concat(l,\" \").concat(r,\" \").concat(a(t,\"type\"))}return s+=\". Received type \".concat(typeof n),s},TypeError),r(\"ERR_STREAM_PUSH_AFTER_EOF\",\"stream.push() after EOF\"),r(\"ERR_METHOD_NOT_IMPLEMENTED\",function(e){return\"The \"+e+\" method is not implemented\"}),r(\"ERR_STREAM_PREMATURE_CLOSE\",\"Premature close\"),r(\"ERR_STREAM_DESTROYED\",function(e){return\"Cannot call \"+e+\" after a stream was destroyed\"}),r(\"ERR_MULTIPLE_CALLBACK\",\"Callback called multiple times\"),r(\"ERR_STREAM_CANNOT_PIPE\",\"Cannot pipe, not readable\"),r(\"ERR_STREAM_WRITE_AFTER_END\",\"write after end\"),r(\"ERR_STREAM_NULL_VALUES\",\"May not write null values to stream\",TypeError),r(\"ERR_UNKNOWN_ENCODING\",function(e){return\"Unknown encoding: \"+e},TypeError),r(\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\",\"stream.unshift() after end event\"),t.exports.codes=s},{}],16:[function(e,t){(function(n){(function(){'use strict';function r(e){return this instanceof r?void(d.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once(\"end\",a)))):new r(e)}function a(){this._writableState.ended||n.nextTick(o,this)}function o(e){e.end()}var i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=r;var d=e(\"./_stream_readable\"),s=e(\"./_stream_writable\");e(\"inherits\")(r,d);for(var l,c=i(s.prototype),u=0;u>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function f(e,t){return 0>=e||0===t.length&&t.ended?0:t.objectMode?1:e===e?(e>t.highWaterMark&&(t.highWaterMark=p(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)):t.flowing&&t.length?t.buffer.head.data.length:t.length}function g(e,t){if(x(\"onEofChunk\"),!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.sync?_(e):(t.needReadable=!1,!t.emittedReadable&&(t.emittedReadable=!0,h(e)))}}function _(e){var t=e._readableState;x(\"emitReadable\",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(x(\"emitReadable\",t.flowing),t.emittedReadable=!0,n.nextTick(h,e))}function h(e){var t=e._readableState;x(\"emitReadable_\",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit(\"readable\"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,S(e)}function m(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(b,e,t))}function b(e,t){for(;!t.reading&&!t.ended&&(t.length=t.length?(n=t.decoder?t.buffer.join(\"\"):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function v(e){var t=e._readableState;x(\"endReadable\",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(k,t,e))}function k(e,t){if(x(\"endReadableNT\",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit(\"end\"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function L(e,t){for(var n=0,r=e.length;n=t.highWaterMark)||t.ended))return x(\"read: emitReadable\",t.length,t.ended),0===t.length&&t.ended?v(this):_(this),null;if(e=f(e,t),0===e&&t.ended)return 0===t.length&&v(this),null;var a=t.needReadable;x(\"need readable\",a),(0===t.length||t.length-e>>0),n=this.head,r=0;n;)s(n.data,t,r),r+=n.data.length,n=n.next;return t}},{key:\"consume\",value:function(e,t){var n;return eo.length?o.length:e;if(a+=i===o.length?o:o.slice(0,e),e-=i,0===e){i===o.length?(++r,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=o.slice(i));break}++r}return this.length-=r,a}},{key:\"_getBuffer\",value:function(e){var t=u.allocUnsafe(e),r=this.head,a=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,i=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,i),e-=i,0===e){i===o.length?(++a,this.head=r.next?r.next:this.tail=null):(this.head=r,r.data=o.slice(i));break}++a}return this.length-=a,t}},{key:g,value:function(e,t){return f(this,r({},t,{depth:0,customInspect:!1}))}}]),e}()},{buffer:3,util:2}],23:[function(e,t){(function(e){(function(){'use strict';function n(e,t){a(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit(\"close\")}function a(e,t){e.emit(\"error\",t)}t.exports={destroy:function(t,o){var i=this,d=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return d||s?(o?o(t):t&&(this._writableState?!this._writableState.errorEmitted&&(this._writableState.errorEmitted=!0,e.nextTick(a,this,t)):e.nextTick(a,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!o&&t?i._writableState?i._writableState.errorEmitted?e.nextTick(r,i):(i._writableState.errorEmitted=!0,e.nextTick(n,i,t)):e.nextTick(n,i,t):o?(e.nextTick(r,i),o(t)):e.nextTick(r,i)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var n=e._readableState,r=e._writableState;n&&n.autoDestroy||r&&r.autoDestroy?e.destroy(t):e.emit(\"error\",t)}}}).call(this)}).call(this,e(\"_process\"))},{_process:12}],24:[function(e,t){'use strict';function n(e){var t=!1;return function(){if(!t){t=!0;for(var n=arguments.length,r=Array(n),a=0;at.length)throw new u(\"streams\");var a,l=t.map(function(e,n){var d=nd){var s=i?o:\"highWaterMark\";throw new a(s,d)}return t(d)}return e.objectMode?16:16384}}},{\"../../../errors\":15}],28:[function(e,t){t.exports=e(\"events\").EventEmitter},{events:7}],29:[function(e,t,n){n=t.exports=e(\"./lib/_stream_readable.js\"),n.Stream=n,n.Readable=n,n.Writable=e(\"./lib/_stream_writable.js\"),n.Duplex=e(\"./lib/_stream_duplex.js\"),n.Transform=e(\"./lib/_stream_transform.js\"),n.PassThrough=e(\"./lib/_stream_passthrough.js\"),n.finished=e(\"./lib/internal/streams/end-of-stream.js\"),n.pipeline=e(\"./lib/internal/streams/pipeline.js\")},{\"./lib/_stream_duplex.js\":16,\"./lib/_stream_passthrough.js\":17,\"./lib/_stream_readable.js\":18,\"./lib/_stream_transform.js\":19,\"./lib/_stream_writable.js\":20,\"./lib/internal/streams/end-of-stream.js\":24,\"./lib/internal/streams/pipeline.js\":26}],30:[function(e,t,n){function r(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}/*! safe-buffer. MIT License. Feross Aboukhadijeh */var o=e(\"buffer\"),i=o.Buffer;i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=o:(r(o,n),n.Buffer=a),a.prototype=Object.create(i.prototype),r(i,a),a.from=function(e,t,n){if(\"number\"==typeof e)throw new TypeError(\"Argument must not be a number\");return i(e,t,n)},a.alloc=function(e,t,n){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");var r=i(e);return void 0===t?r.fill(0):\"string\"==typeof n?r.fill(t,n):r.fill(t),r},a.allocUnsafe=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return i(e)},a.allocUnsafeSlow=function(e){if(\"number\"!=typeof e)throw new TypeError(\"Argument must be a number\");return o.SlowBuffer(e)}},{buffer:3}],31:[function(e,t,n){'use strict';function r(e){if(!e)return\"utf8\";for(var t;;)switch(e){case\"utf8\":case\"utf-8\":return\"utf8\";case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":return\"utf16le\";case\"latin1\":case\"binary\":return\"latin1\";case\"base64\":case\"ascii\":case\"hex\":return e;default:if(t)return;e=(\"\"+e).toLowerCase(),t=!0;}}function a(e){var t=r(e);if(\"string\"!=typeof t&&(m.isEncoding===b||!b(e)))throw new Error(\"Unknown encoding: \"+e);return t||e}function o(e){this.encoding=a(e);var t;switch(this.encoding){case\"utf16le\":this.text=u,this.end=p,t=4;break;case\"utf8\":this.fillLast=c,t=4;break;case\"base64\":this.text=f,this.end=g,t=3;break;default:return this.write=_,void(this.end=h);}this.lastNeed=0,this.lastTotal=0,this.lastChar=m.allocUnsafe(t)}function d(e){if(127>=e)return 0;return 6==e>>5?2:14==e>>4?3:30==e>>3?4:2==e>>6?-1:-2}function s(e,t,n){var r=t.length-1;if(r=r)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(\"utf16le\",t,e.length-1)}function p(e){var t=e&&e.length?this.write(e):\"\";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(\"utf16le\",0,n)}return t}function f(e,t){var r=(e.length-t)%3;return 0==r?e.toString(\"base64\",t):(this.lastNeed=3-r,this.lastTotal=3,1==r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(\"base64\",t,e.length-r))}function g(e){var t=e&&e.length?this.write(e):\"\";return this.lastNeed?t+this.lastChar.toString(\"base64\",0,3-this.lastNeed):t}function _(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):\"\"}var m=e(\"safe-buffer\").Buffer,b=m.isEncoding||function(e){switch(e=\"\"+e,e&&e.toLowerCase()){case\"hex\":case\"utf8\":case\"utf-8\":case\"ascii\":case\"binary\":case\"base64\":case\"ucs2\":case\"ucs-2\":case\"utf16le\":case\"utf-16le\":case\"raw\":return!0;default:return!1;}};n.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return\"\";var t,n;if(this.lastNeed){if(t=this.fillLast(e),void 0===t)return\"\";n=this.lastNeed,this.lastNeed=0}else n=0;return n */const a=e(\"debug\")(\"simple-peer\"),o=e(\"get-browser-rtc\"),i=e(\"randombytes\"),d=e(\"readable-stream\"),s=e(\"queue-microtask\"),l=e(\"err-code\"),{Buffer:c}=e(\"buffer\"),u=65536;class p extends d.Duplex{constructor(e){if(e=Object.assign({allowHalfOpen:!1},e),super(e),this._id=i(4).toString(\"hex\").slice(0,7),this._debug(\"new peer %o\",e),this.channelName=e.initiator?e.channelName||i(20).toString(\"hex\"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||p.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},p.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.iceCompleteTimeout||5000,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&\"object\"==typeof e.wrtc?e.wrtc:o(),!this._wrtc)if(\"undefined\"==typeof window)throw l(new Error(\"No WebRTC support: Specify `opts.wrtc` option in this environment\"),\"ERR_WEBRTC_SUPPORT\");else throw l(new Error(\"No WebRTC support: Not a supported browser\"),\"ERR_WEBRTC_SUPPORT\");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e){return void this.destroy(l(e,\"ERR_PC_CONSTRUCTOR\"))}this._isReactNativeWebrtc=\"number\"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e=>{this._onIceCandidate(e)},\"object\"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch(e=>{this.destroy(l(e,\"ERR_PC_PEER_IDENTITY\"))}),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach(e=>{this.addStream(e)}),this._pc.ontrack=e=>{this._onTrack(e)},this._debug(\"initial negotiation\"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once(\"finish\",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&\"open\"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot signal after peer is destroyed\"),\"ERR_DESTROYED\");if(\"string\"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug(\"signal()\"),e.renegotiate&&this.initiator&&(this._debug(\"got request to renegotiate\"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug(\"got request for transceiver\"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then(()=>{this.destroyed||(this._pendingCandidates.forEach(e=>{this._addIceCandidate(e)}),this._pendingCandidates=[],\"offer\"===this._pc.remoteDescription.type&&this._createAnswer())}).catch(e=>{this.destroy(l(e,\"ERR_SET_REMOTE_DESCRIPTION\"))}),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(l(new Error(\"signal() called with invalid signal data\"),\"ERR_SIGNALING\"))}}_addIceCandidate(e){const t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch(e=>{!t.address||t.address.endsWith(\".local\")?r(\"Ignoring unsupported ICE candidate.\"):this.destroy(l(e,\"ERR_ADD_ICE_CANDIDATE\"))})}send(e){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot send after peer is destroyed\"),\"ERR_DESTROYED\");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot addTransceiver after peer is destroyed\"),\"ERR_DESTROYED\");if(this._debug(\"addTransceiver()\"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(l(e,\"ERR_ADD_TRANSCEIVER\"))}else this.emit(\"signal\",{type:\"transceiverRequest\",transceiverRequest:{kind:e,init:t}})}}addStream(e){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot addStream after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"addStream()\"),e.getTracks().forEach(t=>{this.addTrack(t,e)})}}addTrack(e,t){if(this.destroying)return;if(this.destroyed)throw l(new Error(\"cannot addTrack after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"addTrack()\");const n=this._senderMap.get(e)||new Map;let r=n.get(t);if(!r)r=this._pc.addTrack(e,t),n.set(t,r),this._senderMap.set(e,n),this._needsNegotiation();else if(r.removed)throw l(new Error(\"Track has been removed. You should enable/disable tracks that you want to re-add.\"),\"ERR_SENDER_REMOVED\");else throw l(new Error(\"Track has already been added to that stream.\"),\"ERR_SENDER_ALREADY_ADDED\")}replaceTrack(e,t,n){if(this.destroying)return;if(this.destroyed)throw l(new Error(\"cannot replaceTrack after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"replaceTrack()\");const r=this._senderMap.get(e),a=r?r.get(n):null;if(!a)throw l(new Error(\"Cannot replace track that was never added.\"),\"ERR_TRACK_NOT_ADDED\");t&&this._senderMap.set(t,r),null==a.replaceTrack?this.destroy(l(new Error(\"replaceTrack is not supported in this browser\"),\"ERR_UNSUPPORTED_REPLACETRACK\")):a.replaceTrack(t)}removeTrack(e,t){if(this.destroying)return;if(this.destroyed)throw l(new Error(\"cannot removeTrack after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"removeSender()\");const n=this._senderMap.get(e),r=n?n.get(t):null;if(!r)throw l(new Error(\"Cannot remove track that was never added.\"),\"ERR_TRACK_NOT_ADDED\");try{r.removed=!0,this._pc.removeTrack(r)}catch(e){\"NS_ERROR_UNEXPECTED\"===e.name?this._sendersAwaitingStable.push(r):this.destroy(l(e,\"ERR_REMOVE_TRACK\"))}this._needsNegotiation()}removeStream(e){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot removeStream after peer is destroyed\"),\"ERR_DESTROYED\");this._debug(\"removeSenders()\"),e.getTracks().forEach(t=>{this.removeTrack(t,e)})}}_needsNegotiation(){this._debug(\"_needsNegotiation\"),this._batchedNegotiation||(this._batchedNegotiation=!0,s(()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug(\"starting batched negotiation\"),this.negotiate()):this._debug(\"non-initiator initial negotiation request discarded\"),this._firstNegotiation=!1}))}negotiate(){if(!this.destroying){if(this.destroyed)throw l(new Error(\"cannot negotiate after peer is destroyed\"),\"ERR_DESTROYED\");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug(\"already negotiating, queueing\")):(this._debug(\"start negotiation\"),setTimeout(()=>{this._createOffer()},0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug(\"already negotiating, queueing\")):(this._debug(\"requesting negotiation from initiator\"),this.emit(\"signal\",{type:\"renegotiate\",renegotiate:!0})),this._isNegotiating=!0}}destroy(e){this._destroy(e,()=>{})}_destroy(e,t){this.destroyed||this.destroying||(this.destroying=!0,this._debug(\"destroying (error: %s)\",e&&(e.message||e)),s(()=>{if(this.destroyed=!0,this.destroying=!1,this._debug(\"destroy (error: %s)\",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener(\"finish\",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch(e){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(e){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,e&&this.emit(\"error\",e),this.emit(\"close\"),t()}))}_setupData(e){if(!e.channel)return this.destroy(l(new Error(\"Data channel event is missing `channel` property\"),\"ERR_DATA_CHANNEL\"));this._channel=e.channel,this._channel.binaryType=\"arraybuffer\",\"number\"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=u),this.channelName=this._channel.label,this._channel.onmessage=e=>{this._onChannelMessage(e)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=e=>{const t=e.error instanceof Error?e.error:new Error(`Datachannel error: ${e.message} ${e.filename}:${e.lineno}:${e.colno}`);this.destroy(l(t,\"ERR_DATA_CHANNEL\"))};let t=!1;this._closingInterval=setInterval(()=>{this._channel&&\"closing\"===this._channel.readyState?(t&&this._onChannelClose(),t=!0):t=!1},5000)}_read(){}_write(e,t,n){if(this.destroyed)return n(l(new Error(\"cannot write after peer is destroyed\"),\"ERR_DATA_CHANNEL\"));if(this._connected){try{this.send(e)}catch(e){return this.destroy(l(e,\"ERR_DATA_CHANNEL\"))}this._channel.bufferedAmount>u?(this._debug(\"start backpressure: bufferedAmount %d\",this._channel.bufferedAmount),this._cb=n):n(null)}else this._debug(\"write before connect\"),this._chunk=e,this._cb=n}_onFinish(){if(!this.destroyed){const e=()=>{setTimeout(()=>this.destroy(),1e3)};this._connected?e():this.once(\"connect\",e)}}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug(\"started iceComplete timeout\"),this._iceCompleteTimer=setTimeout(()=>{this._iceComplete||(this._iceComplete=!0,this._debug(\"iceComplete timeout completed\"),this.emit(\"iceTimeout\"),this.emit(\"_iceComplete\"))},this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then(e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=n(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(!this.destroyed){const t=this._pc.localDescription||e;this._debug(\"signal\"),this.emit(\"signal\",{type:t.type,sdp:t.sdp})}};this._pc.setLocalDescription(e).then(()=>{this._debug(\"createOffer success\"),this.destroyed||(this.trickle||this._iceComplete?t():this.once(\"_iceComplete\",t))}).catch(e=>{this.destroy(l(e,\"ERR_SET_LOCAL_DESCRIPTION\"))})}).catch(e=>{this.destroy(l(e,\"ERR_CREATE_OFFER\"))})}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach(e=>{e.mid||!e.sender.track||e.requested||(e.requested=!0,this.addTransceiver(e.sender.track.kind))})}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then(e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=n(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(!this.destroyed){const t=this._pc.localDescription||e;this._debug(\"signal\"),this.emit(\"signal\",{type:t.type,sdp:t.sdp}),this.initiator||this._requestMissingTransceivers()}};this._pc.setLocalDescription(e).then(()=>{this.destroyed||(this.trickle||this._iceComplete?t():this.once(\"_iceComplete\",t))}).catch(e=>{this.destroy(l(e,\"ERR_SET_LOCAL_DESCRIPTION\"))})}).catch(e=>{this.destroy(l(e,\"ERR_CREATE_ANSWER\"))})}_onConnectionStateChange(){this.destroyed||\"failed\"===this._pc.connectionState&&this.destroy(l(new Error(\"Connection failed.\"),\"ERR_CONNECTION_FAILURE\"))}_onIceStateChange(){if(this.destroyed)return;const e=this._pc.iceConnectionState,t=this._pc.iceGatheringState;this._debug(\"iceStateChange (connection: %s) (gathering: %s)\",e,t),this.emit(\"iceStateChange\",e,t),(\"connected\"===e||\"completed\"===e)&&(this._pcReady=!0,this._maybeReady()),\"failed\"===e&&this.destroy(l(new Error(\"Ice connection failed.\"),\"ERR_ICE_CONNECTION_FAILURE\")),\"closed\"===e&&this.destroy(l(new Error(\"Ice connection closed.\"),\"ERR_ICE_CONNECTION_CLOSED\"))}getStats(e){const t=e=>(\"[object Array]\"===Object.prototype.toString.call(e.values)&&e.values.forEach(t=>{Object.assign(e,t)}),e);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then(n=>{const r=[];n.forEach(e=>{r.push(t(e))}),e(null,r)},t=>e(t)):0{if(this.destroyed)return;const r=[];n.result().forEach(e=>{const n={};e.names().forEach(t=>{n[t]=e.stat(t)}),n.id=e.id,n.type=e.type,n.timestamp=e.timestamp,r.push(t(n))}),e(null,r)},t=>e(t)):e(null,[])}_maybeReady(){if(this._debug(\"maybeReady pc %s channel %s\",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const e=()=>{this.destroyed||this.getStats((t,n)=>{if(this.destroyed)return;t&&(n=[]);const r={},a={},o={};let i=!1;n.forEach(e=>{(\"remotecandidate\"===e.type||\"remote-candidate\"===e.type)&&(r[e.id]=e),(\"localcandidate\"===e.type||\"local-candidate\"===e.type)&&(a[e.id]=e),(\"candidatepair\"===e.type||\"candidate-pair\"===e.type)&&(o[e.id]=e)});const d=e=>{i=!0;let t=a[e.localCandidateId];t&&(t.ip||t.address)?(this.localAddress=t.ip||t.address,this.localPort=+t.port):t&&t.ipAddress?(this.localAddress=t.ipAddress,this.localPort=+t.portNumber):\"string\"==typeof e.googLocalAddress&&(t=e.googLocalAddress.split(\":\"),this.localAddress=t[0],this.localPort=+t[1]),this.localAddress&&(this.localFamily=this.localAddress.includes(\":\")?\"IPv6\":\"IPv4\");let n=r[e.remoteCandidateId];n&&(n.ip||n.address)?(this.remoteAddress=n.ip||n.address,this.remotePort=+n.port):n&&n.ipAddress?(this.remoteAddress=n.ipAddress,this.remotePort=+n.portNumber):\"string\"==typeof e.googRemoteAddress&&(n=e.googRemoteAddress.split(\":\"),this.remoteAddress=n[0],this.remotePort=+n[1]),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(\":\")?\"IPv6\":\"IPv4\"),this._debug(\"connect local: %s:%s remote: %s:%s\",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(n.forEach(e=>{\"transport\"===e.type&&e.selectedCandidatePairId&&d(o[e.selectedCandidatePairId]),(\"googCandidatePair\"===e.type&&\"true\"===e.googActiveConnection||(\"candidatepair\"===e.type||\"candidate-pair\"===e.type)&&e.selected)&&d(e)}),!i&&(!Object.keys(o).length||Object.keys(a).length))return void setTimeout(e,100);if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(e){return this.destroy(l(e,\"ERR_DATA_CHANNEL\"))}this._chunk=null,this._debug(\"sent chunk from \\\"write before connect\\\"\");const e=this._cb;this._cb=null,e(null)}\"number\"!=typeof this._channel.bufferedAmountLowThreshold&&(this._interval=setInterval(()=>this._onInterval(),150),this._interval.unref&&this._interval.unref()),this._debug(\"connect\"),this.emit(\"connect\")})};e()}_onInterval(){this._cb&&this._channel&&!(this._channel.bufferedAmount>u)&&this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||(\"stable\"===this._pc.signalingState&&(this._isNegotiating=!1,this._debug(\"flushing sender queue\",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach(e=>{this._pc.removeTrack(e),this._queuedNegotiation=!0}),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug(\"flushing negotiation queue\"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug(\"negotiated\"),this.emit(\"negotiated\"))),this._debug(\"signalingStateChange %s\",this._pc.signalingState),this.emit(\"signalingStateChange\",this._pc.signalingState))}_onIceCandidate(e){this.destroyed||(e.candidate&&this.trickle?this.emit(\"signal\",{type:\"candidate\",candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):!e.candidate&&!this._iceComplete&&(this._iceComplete=!0,this.emit(\"_iceComplete\")),e.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=c.from(t)),this.push(t)}_onChannelBufferedAmountLow(){if(!this.destroyed&&this._cb){this._debug(\"ending backpressure: bufferedAmount %d\",this._channel.bufferedAmount);const e=this._cb;this._cb=null,e(null)}}_onChannelOpen(){this._connected||this.destroyed||(this._debug(\"on channel open\"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug(\"on channel close\"),this.destroy())}_onTrack(e){this.destroyed||e.streams.forEach(t=>{this._debug(\"on track\"),this.emit(\"track\",e.track,t),this._remoteTracks.push({track:e.track,stream:t}),this._remoteStreams.some(e=>e.id===t.id)||(this._remoteStreams.push(t),s(()=>{this._debug(\"on stream\"),this.emit(\"stream\",t)}))})}_debug(){const e=[].slice.call(arguments);e[0]=\"[\"+this._id+\"] \"+e[0],a.apply(null,e)}}p.WEBRTC_SUPPORT=!!o(),p.config={iceServers:[{urls:[\"stun:stun.l.google.com:19302\",\"stun:global.stun.twilio.com:3478\"]}],sdpSemantics:\"unified-plan\"},p.channelConfig={},t.exports=p},{buffer:3,debug:4,\"err-code\":6,\"get-browser-rtc\":8,\"queue-microtask\":13,randombytes:14,\"readable-stream\":29}]},{},[])(\"/\")});", "/**\n * @module sync-protocol\n */\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as Y from 'yjs'\n\n/**\n * @typedef {Map} StateMap\n */\n\n/**\n * Core Yjs defines two message types:\n * \u2022 YjsSyncStep1: Includes the State Set of the sending client. When received, the client should reply with YjsSyncStep2.\n * \u2022 YjsSyncStep2: Includes all missing structs and the complete delete set. When received, the client is assured that it\n * received all information from the remote client.\n *\n * In a peer-to-peer network, you may want to introduce a SyncDone message type. Both parties should initiate the connection\n * with SyncStep1. When a client received SyncStep2, it should reply with SyncDone. When the local client received both\n * SyncStep2 and SyncDone, it is assured that it is synced to the remote client.\n *\n * In a client-server model, you want to handle this differently: The client should initiate the connection with SyncStep1.\n * When the server receives SyncStep1, it should reply with SyncStep2 immediately followed by SyncStep1. The client replies\n * with SyncStep2 when it receives SyncStep1. Optionally the server may send a SyncDone after it received SyncStep2, so the\n * client knows that the sync is finished. There are two reasons for this more elaborated sync model: 1. This protocol can\n * easily be implemented on top of http and websockets. 2. The server should only reply to requests, and not initiate them.\n * Therefore it is necessary that the client initiates the sync.\n *\n * Construction of a message:\n * [messageType : varUint, message definition..]\n *\n * Note: A message does not include information about the room name. This must to be handled by the upper layer protocol!\n *\n * stringify[messageType] stringifies a message definition (messageType is already read from the bufffer)\n */\n\nexport const messageYjsSyncStep1 = 0\nexport const messageYjsSyncStep2 = 1\nexport const messageYjsUpdate = 2\n\n/**\n * Create a sync step 1 message based on the state of the current shared document.\n *\n * @param {encoding.Encoder} encoder\n * @param {Y.Doc} doc\n */\nexport const writeSyncStep1 = (encoder, doc) => {\n encoding.writeVarUint(encoder, messageYjsSyncStep1)\n const sv = Y.encodeStateVector(doc)\n encoding.writeVarUint8Array(encoder, sv)\n}\n\n/**\n * @param {encoding.Encoder} encoder\n * @param {Y.Doc} doc\n * @param {Uint8Array} [encodedStateVector]\n */\nexport const writeSyncStep2 = (encoder, doc, encodedStateVector) => {\n encoding.writeVarUint(encoder, messageYjsSyncStep2)\n encoding.writeVarUint8Array(encoder, Y.encodeStateAsUpdate(doc, encodedStateVector))\n}\n\n/**\n * Read SyncStep1 message and reply with SyncStep2.\n *\n * @param {decoding.Decoder} decoder The reply to the received message\n * @param {encoding.Encoder} encoder The received message\n * @param {Y.Doc} doc\n */\nexport const readSyncStep1 = (decoder, encoder, doc) =>\n writeSyncStep2(encoder, doc, decoding.readVarUint8Array(decoder))\n\n/**\n * Read and apply Structs and then DeleteStore to a y instance.\n *\n * @param {decoding.Decoder} decoder\n * @param {Y.Doc} doc\n * @param {any} transactionOrigin\n */\nexport const readSyncStep2 = (decoder, doc, transactionOrigin) => {\n try {\n Y.applyUpdate(doc, decoding.readVarUint8Array(decoder), transactionOrigin)\n } catch (error) {\n // This catches errors that are thrown by event handlers\n console.error('Caught error while handling a Yjs update', error)\n }\n}\n\n/**\n * @param {encoding.Encoder} encoder\n * @param {Uint8Array} update\n */\nexport const writeUpdate = (encoder, update) => {\n encoding.writeVarUint(encoder, messageYjsUpdate)\n encoding.writeVarUint8Array(encoder, update)\n}\n\n/**\n * Read and apply Structs and then DeleteStore to a y instance.\n *\n * @param {decoding.Decoder} decoder\n * @param {Y.Doc} doc\n * @param {any} transactionOrigin\n */\nexport const readUpdate = readSyncStep2\n\n/**\n * @param {decoding.Decoder} decoder A message received from another client\n * @param {encoding.Encoder} encoder The reply message. Does not need to be sent if empty.\n * @param {Y.Doc} doc\n * @param {any} transactionOrigin\n */\nexport const readSyncMessage = (decoder, encoder, doc, transactionOrigin) => {\n const messageType = decoding.readVarUint(decoder)\n switch (messageType) {\n case messageYjsSyncStep1:\n readSyncStep1(decoder, encoder, doc)\n break\n case messageYjsSyncStep2:\n readSyncStep2(decoder, doc, transactionOrigin)\n break\n case messageYjsUpdate:\n readUpdate(decoder, doc, transactionOrigin)\n break\n default:\n throw new Error('Unknown message type')\n }\n return messageType\n}\n", "/* eslint-env browser */\n\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport * as promise from 'lib0/promise'\nimport * as error from 'lib0/error'\nimport * as string from 'lib0/string'\n\n/**\n * @param {string} secret\n * @param {string} roomName\n * @return {PromiseLike}\n */\nexport const deriveKey = (secret, roomName) => {\n const secretBuffer = string.encodeUtf8(secret).buffer\n const salt = string.encodeUtf8(roomName).buffer\n return crypto.subtle.importKey(\n 'raw',\n secretBuffer,\n 'PBKDF2',\n false,\n ['deriveKey']\n ).then(keyMaterial =>\n crypto.subtle.deriveKey(\n {\n name: 'PBKDF2',\n salt,\n iterations: 100000,\n hash: 'SHA-256'\n },\n keyMaterial,\n {\n name: 'AES-GCM',\n length: 256\n },\n true,\n ['encrypt', 'decrypt']\n )\n )\n}\n\n/**\n * @param {Uint8Array} data data to be encrypted\n * @param {CryptoKey?} key\n * @return {PromiseLike} encrypted, base64 encoded message\n */\nexport const encrypt = (data, key) => {\n if (!key) {\n return /** @type {PromiseLike} */ (promise.resolve(data))\n }\n const iv = crypto.getRandomValues(new Uint8Array(12))\n return crypto.subtle.encrypt(\n {\n name: 'AES-GCM',\n iv\n },\n key,\n data\n ).then(cipher => {\n const encryptedDataEncoder = encoding.createEncoder()\n encoding.writeVarString(encryptedDataEncoder, 'AES-GCM')\n encoding.writeVarUint8Array(encryptedDataEncoder, iv)\n encoding.writeVarUint8Array(encryptedDataEncoder, new Uint8Array(cipher))\n return encoding.toUint8Array(encryptedDataEncoder)\n })\n}\n\n/**\n * @param {Object} data data to be encrypted\n * @param {CryptoKey?} key\n * @return {PromiseLike} encrypted data, if key is provided\n */\nexport const encryptJson = (data, key) => {\n const dataEncoder = encoding.createEncoder()\n encoding.writeAny(dataEncoder, data)\n return encrypt(encoding.toUint8Array(dataEncoder), key)\n}\n\n/**\n * @param {Uint8Array} data\n * @param {CryptoKey?} key\n * @return {PromiseLike} decrypted buffer\n */\nexport const decrypt = (data, key) => {\n if (!key) {\n return /** @type {PromiseLike} */ (promise.resolve(data))\n }\n const dataDecoder = decoding.createDecoder(data)\n const algorithm = decoding.readVarString(dataDecoder)\n if (algorithm !== 'AES-GCM') {\n promise.reject(error.create('Unknown encryption algorithm'))\n }\n const iv = decoding.readVarUint8Array(dataDecoder)\n const cipher = decoding.readVarUint8Array(dataDecoder)\n return crypto.subtle.decrypt(\n {\n name: 'AES-GCM',\n iv\n },\n key,\n cipher\n ).then(data => new Uint8Array(data))\n}\n\n/**\n * @param {Uint8Array} data\n * @param {CryptoKey?} key\n * @return {PromiseLike} decrypted object\n */\nexport const decryptJson = (data, key) =>\n decrypt(data, key).then(decryptedValue =>\n decoding.readAny(decoding.createDecoder(new Uint8Array(decryptedValue)))\n )\n", "import * as ws from 'lib0/websocket'\nimport * as map from 'lib0/map'\nimport * as error from 'lib0/error'\nimport * as random from 'lib0/random'\nimport * as encoding from 'lib0/encoding'\nimport * as decoding from 'lib0/decoding'\nimport { ObservableV2 } from 'lib0/observable'\nimport * as logging from 'lib0/logging'\nimport * as promise from 'lib0/promise'\nimport * as bc from 'lib0/broadcastchannel'\nimport * as buffer from 'lib0/buffer'\nimport * as math from 'lib0/math'\nimport { createMutex } from 'lib0/mutex'\n\nimport * as Y from 'yjs' // eslint-disable-line\nimport Peer from 'simple-peer/simplepeer.min.js'\n\nimport * as syncProtocol from 'y-protocols/sync'\nimport * as awarenessProtocol from 'y-protocols/awareness'\n\nimport * as cryptoutils from './crypto.js'\n\nconst log = logging.createModuleLogger('y-webrtc')\n\nconst messageSync = 0\nconst messageQueryAwareness = 3\nconst messageAwareness = 1\nconst messageBcPeerId = 4\n\n/**\n * @type {Map}\n */\nconst signalingConns = new Map()\n\n/**\n * @type {Map}\n */\nconst rooms = new Map()\n\n/**\n * @param {Room} room\n */\nconst checkIsSynced = room => {\n let synced = true\n room.webrtcConns.forEach(peer => {\n if (!peer.synced) {\n synced = false\n }\n })\n if ((!synced && room.synced) || (synced && !room.synced)) {\n room.synced = synced\n room.provider.emit('synced', [{ synced }])\n log('synced ', logging.BOLD, room.name, logging.UNBOLD, ' with all peers')\n }\n}\n\n/**\n * @param {Room} room\n * @param {Uint8Array} buf\n * @param {function} syncedCallback\n * @return {encoding.Encoder?}\n */\nconst readMessage = (room, buf, syncedCallback) => {\n const decoder = decoding.createDecoder(buf)\n const encoder = encoding.createEncoder()\n const messageType = decoding.readVarUint(decoder)\n if (room === undefined) {\n return null\n }\n const awareness = room.awareness\n const doc = room.doc\n let sendReply = false\n switch (messageType) {\n case messageSync: {\n encoding.writeVarUint(encoder, messageSync)\n const syncMessageType = syncProtocol.readSyncMessage(decoder, encoder, doc, room)\n if (syncMessageType === syncProtocol.messageYjsSyncStep2 && !room.synced) {\n syncedCallback()\n }\n if (syncMessageType === syncProtocol.messageYjsSyncStep1) {\n sendReply = true\n }\n break\n }\n case messageQueryAwareness:\n encoding.writeVarUint(encoder, messageAwareness)\n encoding.writeVarUint8Array(encoder, awarenessProtocol.encodeAwarenessUpdate(awareness, Array.from(awareness.getStates().keys())))\n sendReply = true\n break\n case messageAwareness:\n awarenessProtocol.applyAwarenessUpdate(awareness, decoding.readVarUint8Array(decoder), room)\n break\n case messageBcPeerId: {\n const add = decoding.readUint8(decoder) === 1\n const peerName = decoding.readVarString(decoder)\n if (peerName !== room.peerId && ((room.bcConns.has(peerName) && !add) || (!room.bcConns.has(peerName) && add))) {\n const removed = []\n const added = []\n if (add) {\n room.bcConns.add(peerName)\n added.push(peerName)\n } else {\n room.bcConns.delete(peerName)\n removed.push(peerName)\n }\n room.provider.emit('peers', [{\n added,\n removed,\n webrtcPeers: Array.from(room.webrtcConns.keys()),\n bcPeers: Array.from(room.bcConns)\n }])\n broadcastBcPeerId(room)\n }\n break\n }\n default:\n console.error('Unable to compute message')\n return encoder\n }\n if (!sendReply) {\n // nothing has been written, no answer created\n return null\n }\n return encoder\n}\n\n/**\n * @param {WebrtcConn} peerConn\n * @param {Uint8Array} buf\n * @return {encoding.Encoder?}\n */\nconst readPeerMessage = (peerConn, buf) => {\n const room = peerConn.room\n log('received message from ', logging.BOLD, peerConn.remotePeerId, logging.GREY, ' (', room.name, ')', logging.UNBOLD, logging.UNCOLOR)\n return readMessage(room, buf, () => {\n peerConn.synced = true\n log('synced ', logging.BOLD, room.name, logging.UNBOLD, ' with ', logging.BOLD, peerConn.remotePeerId)\n checkIsSynced(room)\n })\n}\n\n/**\n * @param {WebrtcConn} webrtcConn\n * @param {encoding.Encoder} encoder\n */\nconst sendWebrtcConn = (webrtcConn, encoder) => {\n log('send message to ', logging.BOLD, webrtcConn.remotePeerId, logging.UNBOLD, logging.GREY, ' (', webrtcConn.room.name, ')', logging.UNCOLOR)\n try {\n webrtcConn.peer.send(encoding.toUint8Array(encoder))\n } catch (e) {}\n}\n\n/**\n * @param {Room} room\n * @param {Uint8Array} m\n */\nconst broadcastWebrtcConn = (room, m) => {\n log('broadcast message in ', logging.BOLD, room.name, logging.UNBOLD)\n room.webrtcConns.forEach(conn => {\n try {\n conn.peer.send(m)\n } catch (e) {}\n })\n}\n\nexport class WebrtcConn {\n /**\n * @param {SignalingConn} signalingConn\n * @param {boolean} initiator\n * @param {string} remotePeerId\n * @param {Room} room\n */\n constructor (signalingConn, initiator, remotePeerId, room) {\n log('establishing connection to ', logging.BOLD, remotePeerId)\n this.room = room\n this.remotePeerId = remotePeerId\n this.glareToken = undefined\n this.closed = false\n this.connected = false\n this.synced = false\n /**\n * @type {any}\n */\n this.peer = new Peer({ initiator, ...room.provider.peerOpts })\n this.peer.on('signal', signal => {\n if (this.glareToken === undefined) {\n // add some randomness to the timestamp of the offer\n this.glareToken = Date.now() + Math.random()\n }\n publishSignalingMessage(signalingConn, room, { to: remotePeerId, from: room.peerId, type: 'signal', token: this.glareToken, signal })\n })\n this.peer.on('connect', () => {\n log('connected to ', logging.BOLD, remotePeerId)\n this.connected = true\n // send sync step 1\n const provider = room.provider\n const doc = provider.doc\n const awareness = room.awareness\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, messageSync)\n syncProtocol.writeSyncStep1(encoder, doc)\n sendWebrtcConn(this, encoder)\n const awarenessStates = awareness.getStates()\n if (awarenessStates.size > 0) {\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, messageAwareness)\n encoding.writeVarUint8Array(encoder, awarenessProtocol.encodeAwarenessUpdate(awareness, Array.from(awarenessStates.keys())))\n sendWebrtcConn(this, encoder)\n }\n })\n this.peer.on('close', () => {\n this.connected = false\n this.closed = true\n if (room.webrtcConns.has(this.remotePeerId)) {\n room.webrtcConns.delete(this.remotePeerId)\n room.provider.emit('peers', [{\n removed: [this.remotePeerId],\n added: [],\n webrtcPeers: Array.from(room.webrtcConns.keys()),\n bcPeers: Array.from(room.bcConns)\n }])\n }\n checkIsSynced(room)\n this.peer.destroy()\n log('closed connection to ', logging.BOLD, remotePeerId)\n announceSignalingInfo(room)\n })\n this.peer.on('error', err => {\n log('Error in connection to ', logging.BOLD, remotePeerId, ': ', err)\n announceSignalingInfo(room)\n })\n this.peer.on('data', data => {\n const answer = readPeerMessage(this, data)\n if (answer !== null) {\n sendWebrtcConn(this, answer)\n }\n })\n }\n\n destroy () {\n this.peer.destroy()\n }\n}\n\n/**\n * @param {Room} room\n * @param {Uint8Array} m\n */\nconst broadcastBcMessage = (room, m) => cryptoutils.encrypt(m, room.key).then(data =>\n room.mux(() =>\n bc.publish(room.name, data)\n )\n)\n\n/**\n * @param {Room} room\n * @param {Uint8Array} m\n */\nconst broadcastRoomMessage = (room, m) => {\n if (room.bcconnected) {\n broadcastBcMessage(room, m)\n }\n broadcastWebrtcConn(room, m)\n}\n\n/**\n * @param {Room} room\n */\nconst announceSignalingInfo = room => {\n signalingConns.forEach(conn => {\n // only subscribe if connection is established, otherwise the conn automatically subscribes to all rooms\n if (conn.connected) {\n conn.send({ type: 'subscribe', topics: [room.name] })\n if (room.webrtcConns.size < room.provider.maxConns) {\n publishSignalingMessage(conn, room, { type: 'announce', from: room.peerId })\n }\n }\n })\n}\n\n/**\n * @param {Room} room\n */\nconst broadcastBcPeerId = room => {\n if (room.provider.filterBcConns) {\n // broadcast peerId via broadcastchannel\n const encoderPeerIdBc = encoding.createEncoder()\n encoding.writeVarUint(encoderPeerIdBc, messageBcPeerId)\n encoding.writeUint8(encoderPeerIdBc, 1)\n encoding.writeVarString(encoderPeerIdBc, room.peerId)\n broadcastBcMessage(room, encoding.toUint8Array(encoderPeerIdBc))\n }\n}\n\nexport class Room {\n /**\n * @param {Y.Doc} doc\n * @param {WebrtcProvider} provider\n * @param {string} name\n * @param {CryptoKey|null} key\n */\n constructor (doc, provider, name, key) {\n /**\n * Do not assume that peerId is unique. This is only meant for sending signaling messages.\n *\n * @type {string}\n */\n this.peerId = random.uuidv4()\n this.doc = doc\n /**\n * @type {awarenessProtocol.Awareness}\n */\n this.awareness = provider.awareness\n this.provider = provider\n this.synced = false\n this.name = name\n // @todo make key secret by scoping\n this.key = key\n /**\n * @type {Map}\n */\n this.webrtcConns = new Map()\n /**\n * @type {Set}\n */\n this.bcConns = new Set()\n this.mux = createMutex()\n this.bcconnected = false\n /**\n * @param {ArrayBuffer} data\n */\n this._bcSubscriber = data =>\n cryptoutils.decrypt(new Uint8Array(data), key).then(m =>\n this.mux(() => {\n const reply = readMessage(this, m, () => {})\n if (reply) {\n broadcastBcMessage(this, encoding.toUint8Array(reply))\n }\n })\n )\n /**\n * Listens to Yjs updates and sends them to remote peers\n *\n * @param {Uint8Array} update\n * @param {any} _origin\n */\n this._docUpdateHandler = (update, _origin) => {\n const encoder = encoding.createEncoder()\n encoding.writeVarUint(encoder, messageSync)\n syncProtocol.writeUpdate(encoder, update)\n broadcastRoomMessage(this, encoding.toUint8Array(encoder))\n }\n /**\n * Listens to Awareness updates and sends them to remote peers\n *\n * @param {any} changed\n * @param {any} _origin\n */\n this._awarenessUpdateHandler = ({ added, updated, removed }, _origin) => {\n const changedClients = added.concat(updated).concat(removed)\n const encoderAwareness = encoding.createEncoder()\n encoding.writeVarUint(encoderAwareness, messageAwareness)\n encoding.writeVarUint8Array(encoderAwareness, awarenessProtocol.encodeAwarenessUpdate(this.awareness, changedClients))\n broadcastRoomMessage(this, encoding.toUint8Array(encoderAwareness))\n }\n\n this._beforeUnloadHandler = () => {\n awarenessProtocol.removeAwarenessStates(this.awareness, [doc.clientID], 'window unload')\n rooms.forEach(room => {\n room.disconnect()\n })\n }\n\n if (typeof window !== 'undefined') {\n window.addEventListener('beforeunload', this._beforeUnloadHandler)\n } else if (typeof process !== 'undefined') {\n process.on('exit', this._beforeUnloadHandler)\n }\n }\n\n connect () {\n this.doc.on('update', this._docUpdateHandler)\n this.awareness.on('update', this._awarenessUpdateHandler)\n // signal through all available signaling connections\n announceSignalingInfo(this)\n const roomName = this.name\n bc.subscribe(roomName, this._bcSubscriber)\n this.bcconnected = true\n // broadcast peerId via broadcastchannel\n broadcastBcPeerId(this)\n // write sync step 1\n const encoderSync = encoding.createEncoder()\n encoding.writeVarUint(encoderSync, messageSync)\n syncProtocol.writeSyncStep1(encoderSync, this.doc)\n broadcastBcMessage(this, encoding.toUint8Array(encoderSync))\n // broadcast local state\n const encoderState = encoding.createEncoder()\n encoding.writeVarUint(encoderState, messageSync)\n syncProtocol.writeSyncStep2(encoderState, this.doc)\n broadcastBcMessage(this, encoding.toUint8Array(encoderState))\n // write queryAwareness\n const encoderAwarenessQuery = encoding.createEncoder()\n encoding.writeVarUint(encoderAwarenessQuery, messageQueryAwareness)\n broadcastBcMessage(this, encoding.toUint8Array(encoderAwarenessQuery))\n // broadcast local awareness state\n const encoderAwarenessState = encoding.createEncoder()\n encoding.writeVarUint(encoderAwarenessState, messageAwareness)\n encoding.writeVarUint8Array(encoderAwarenessState, awarenessProtocol.encodeAwarenessUpdate(this.awareness, [this.doc.clientID]))\n broadcastBcMessage(this, encoding.toUint8Array(encoderAwarenessState))\n }\n\n disconnect () {\n // signal through all available signaling connections\n signalingConns.forEach(conn => {\n if (conn.connected) {\n conn.send({ type: 'unsubscribe', topics: [this.name] })\n }\n })\n awarenessProtocol.removeAwarenessStates(this.awareness, [this.doc.clientID], 'disconnect')\n // broadcast peerId removal via broadcastchannel\n const encoderPeerIdBc = encoding.createEncoder()\n encoding.writeVarUint(encoderPeerIdBc, messageBcPeerId)\n encoding.writeUint8(encoderPeerIdBc, 0) // remove peerId from other bc peers\n encoding.writeVarString(encoderPeerIdBc, this.peerId)\n broadcastBcMessage(this, encoding.toUint8Array(encoderPeerIdBc))\n\n bc.unsubscribe(this.name, this._bcSubscriber)\n this.bcconnected = false\n this.doc.off('update', this._docUpdateHandler)\n this.awareness.off('update', this._awarenessUpdateHandler)\n this.webrtcConns.forEach(conn => conn.destroy())\n }\n\n destroy () {\n this.disconnect()\n if (typeof window !== 'undefined') {\n window.removeEventListener('beforeunload', this._beforeUnloadHandler)\n } else if (typeof process !== 'undefined') {\n process.off('exit', this._beforeUnloadHandler)\n }\n }\n}\n\n/**\n * @param {Y.Doc} doc\n * @param {WebrtcProvider} provider\n * @param {string} name\n * @param {CryptoKey|null} key\n * @return {Room}\n */\nconst openRoom = (doc, provider, name, key) => {\n // there must only be one room\n if (rooms.has(name)) {\n throw error.create(`A Yjs Doc connected to room \"${name}\" already exists!`)\n }\n const room = new Room(doc, provider, name, key)\n rooms.set(name, /** @type {Room} */ (room))\n return room\n}\n\n/**\n * @param {SignalingConn} conn\n * @param {Room} room\n * @param {any} data\n */\nconst publishSignalingMessage = (conn, room, data) => {\n if (room.key) {\n cryptoutils.encryptJson(data, room.key).then(data => {\n conn.send({ type: 'publish', topic: room.name, data: buffer.toBase64(data) })\n })\n } else {\n conn.send({ type: 'publish', topic: room.name, data })\n }\n}\n\nexport class SignalingConn extends ws.WebsocketClient {\n constructor (url) {\n super(url)\n /**\n * @type {Set}\n */\n this.providers = new Set()\n this.on('connect', () => {\n log(`connected (${url})`)\n const topics = Array.from(rooms.keys())\n this.send({ type: 'subscribe', topics })\n rooms.forEach(room =>\n publishSignalingMessage(this, room, { type: 'announce', from: room.peerId })\n )\n })\n this.on('message', m => {\n switch (m.type) {\n case 'publish': {\n const roomName = m.topic\n const room = rooms.get(roomName)\n if (room == null || typeof roomName !== 'string') {\n return\n }\n const execMessage = data => {\n const webrtcConns = room.webrtcConns\n const peerId = room.peerId\n if (data == null || data.from === peerId || (data.to !== undefined && data.to !== peerId) || room.bcConns.has(data.from)) {\n // ignore messages that are not addressed to this conn, or from clients that are connected via broadcastchannel\n return\n }\n const emitPeerChange = webrtcConns.has(data.from)\n ? () => {}\n : () =>\n room.provider.emit('peers', [{\n removed: [],\n added: [data.from],\n webrtcPeers: Array.from(room.webrtcConns.keys()),\n bcPeers: Array.from(room.bcConns)\n }])\n switch (data.type) {\n case 'announce':\n if (webrtcConns.size < room.provider.maxConns) {\n map.setIfUndefined(webrtcConns, data.from, () => new WebrtcConn(this, true, data.from, room))\n emitPeerChange()\n }\n break\n case 'signal':\n if (data.signal.type === 'offer') {\n const existingConn = webrtcConns.get(data.from)\n if (existingConn) {\n const remoteToken = data.token\n const localToken = existingConn.glareToken\n if (localToken && localToken > remoteToken) {\n log('offer rejected: ', data.from)\n return\n }\n // if we don't reject the offer, we will be accepting it and answering it\n existingConn.glareToken = undefined\n }\n }\n if (data.signal.type === 'answer') {\n log('offer answered by: ', data.from)\n const existingConn = webrtcConns.get(data.from)\n existingConn.glareToken = undefined\n }\n if (data.to === peerId) {\n map.setIfUndefined(webrtcConns, data.from, () => new WebrtcConn(this, false, data.from, room)).peer.signal(data.signal)\n emitPeerChange()\n }\n break\n }\n }\n if (room.key) {\n if (typeof m.data === 'string') {\n cryptoutils.decryptJson(buffer.fromBase64(m.data), room.key).then(execMessage)\n }\n } else {\n execMessage(m.data)\n }\n }\n }\n })\n this.on('disconnect', () => log(`disconnect (${url})`))\n }\n}\n\n/**\n * @typedef {Object} ProviderOptions\n * @property {Array} [signaling]\n * @property {string} [password]\n * @property {awarenessProtocol.Awareness} [awareness]\n * @property {number} [maxConns]\n * @property {boolean} [filterBcConns]\n * @property {any} [peerOpts]\n */\n\n/**\n * @param {WebrtcProvider} provider\n */\nconst emitStatus = provider => {\n provider.emit('status', [{\n connected: provider.connected\n }])\n}\n\n/**\n * @typedef {Object} WebrtcProviderEvents\n * @property {function({connected:boolean}):void} WebrtcProviderEvent.status\n * @property {function({synced:boolean}):void} WebrtcProviderEvent.synced\n * @property {function({added:Array,removed:Array,webrtcPeers:Array,bcPeers:Array}):void} WebrtcProviderEvent.peers\n */\n\n/**\n * @extends ObservableV2\n */\nexport class WebrtcProvider extends ObservableV2 {\n /**\n * @param {string} roomName\n * @param {Y.Doc} doc\n * @param {ProviderOptions?} opts\n */\n constructor (\n roomName,\n doc,\n {\n signaling = ['wss://y-webrtc-eu.fly.dev'],\n password = null,\n awareness = new awarenessProtocol.Awareness(doc),\n maxConns = 20 + math.floor(random.rand() * 15), // the random factor reduces the chance that n clients form a cluster\n filterBcConns = true,\n peerOpts = {} // simple-peer options. See https://github.com/feross/simple-peer#peer--new-peeropts\n } = {}\n ) {\n super()\n this.roomName = roomName\n this.doc = doc\n this.filterBcConns = filterBcConns\n /**\n * @type {awarenessProtocol.Awareness}\n */\n this.awareness = awareness\n this.shouldConnect = false\n this.signalingUrls = signaling\n this.signalingConns = []\n this.maxConns = maxConns\n this.peerOpts = peerOpts\n /**\n * @type {PromiseLike}\n */\n this.key = password ? cryptoutils.deriveKey(password, roomName) : /** @type {PromiseLike} */ (promise.resolve(null))\n /**\n * @type {Room|null}\n */\n this.room = null\n this.key.then(key => {\n this.room = openRoom(doc, this, roomName, key)\n if (this.shouldConnect) {\n this.room.connect()\n } else {\n this.room.disconnect()\n }\n emitStatus(this)\n })\n this.connect()\n this.destroy = this.destroy.bind(this)\n doc.on('destroy', this.destroy)\n }\n\n /**\n * Indicates whether the provider is looking for other peers.\n *\n * Other peers can be found via signaling servers or via broadcastchannel (cross browser-tab\n * communication). You never know when you are connected to all peers. You also don't know if\n * there are other peers. connected doesn't mean that you are connected to any physical peers\n * working on the same resource as you. It does not change unless you call provider.disconnect()\n *\n * `this.on('status', (event) => { console.log(event.connected) })`\n *\n * @type {boolean}\n */\n get connected () {\n return this.room !== null && this.shouldConnect\n }\n\n connect () {\n this.shouldConnect = true\n this.signalingUrls.forEach(url => {\n const signalingConn = map.setIfUndefined(signalingConns, url, () => new SignalingConn(url))\n this.signalingConns.push(signalingConn)\n signalingConn.providers.add(this)\n })\n if (this.room) {\n this.room.connect()\n emitStatus(this)\n }\n }\n\n disconnect () {\n this.shouldConnect = false\n this.signalingConns.forEach(conn => {\n conn.providers.delete(this)\n if (conn.providers.size === 0) {\n conn.destroy()\n signalingConns.delete(conn.url)\n }\n })\n if (this.room) {\n this.room.disconnect()\n emitStatus(this)\n }\n }\n\n destroy () {\n this.doc.off('destroy', this.destroy)\n // need to wait for key before deleting room\n this.key.then(() => {\n /** @type {Room} */ (this.room).destroy()\n rooms.delete(this.roomName)\n })\n super.destroy()\n }\n}\n", "/**\n * @module bindings/quill\n */\n\nimport * as Y from 'yjs' // eslint-disable-line\n\n/**\n * @typedef {import('y-protocols/awareness').Awareness} Awareness\n\n/**\n * Removes the pending '\\n's if it has no attributes.\n */\nexport const normQuillDelta = delta => {\n if (delta.length > 0) {\n const d = delta[delta.length - 1]\n const insert = d.insert\n if (d.attributes === undefined && insert !== undefined && insert.slice(-1) === '\\n') {\n delta = delta.slice()\n let ins = insert.slice(0, -1)\n while (ins.slice(-1) === '\\n') {\n ins = ins.slice(0, -1)\n }\n delta[delta.length - 1] = { insert: ins }\n if (ins.length === 0) {\n delta.pop()\n }\n return delta\n }\n }\n return delta\n}\n\n/**\n * @param {any} quillCursors\n */\nconst updateCursor = (quillCursors, aw, clientId, doc, type) => {\n try {\n if (aw && aw.cursor && clientId !== doc.clientID) {\n const user = aw.user || {}\n const color = user.color || '#ffa500'\n const name = user.name || `User: ${clientId}`\n quillCursors.createCursor(clientId.toString(), name, color)\n const anchor = Y.createAbsolutePositionFromRelativePosition(Y.createRelativePositionFromJSON(aw.cursor.anchor), doc)\n const head = Y.createAbsolutePositionFromRelativePosition(Y.createRelativePositionFromJSON(aw.cursor.head), doc)\n if (anchor && head && anchor.type === type) {\n quillCursors.moveCursor(clientId.toString(), { index: anchor.index, length: head.index - anchor.index })\n }\n } else {\n quillCursors.removeCursor(clientId.toString())\n }\n } catch (err) {\n console.error(err)\n }\n}\n\nexport class QuillBinding {\n /**\n * @param {Y.Text} type\n * @param {any} quill\n * @param {Awareness} [awareness]\n */\n constructor (type, quill, awareness) {\n const doc = /** @type {Y.Doc} */ (type.doc)\n this.type = type\n this.doc = doc\n this.quill = quill\n const quillCursors = quill.getModule('cursors') || null\n this.quillCursors = quillCursors\n // This object contains all attributes used in the quill instance\n this._negatedUsedFormats = {}\n this.awareness = awareness\n this._awarenessChange = ({ added, removed, updated }) => {\n const states = /** @type {Awareness} */ (awareness).getStates()\n added.forEach(id => {\n updateCursor(quillCursors, states.get(id), id, doc, type)\n })\n updated.forEach(id => {\n updateCursor(quillCursors, states.get(id), id, doc, type)\n })\n removed.forEach(id => {\n quillCursors.removeCursor(id.toString())\n })\n }\n /**\n * @param {Y.YTextEvent} event\n */\n this._typeObserver = event => {\n if (event.transaction.origin !== this) {\n const eventDelta = event.delta\n // We always explicitly set attributes, otherwise concurrent edits may\n // result in quill assuming that a text insertion shall inherit existing\n // attributes.\n const delta = []\n for (let i = 0; i < eventDelta.length; i++) {\n const d = eventDelta[i]\n if (d.insert !== undefined) {\n delta.push(Object.assign({}, d, { attributes: Object.assign({}, this._negatedUsedFormats, d.attributes || {}) }))\n } else {\n delta.push(d)\n }\n }\n quill.updateContents(delta, this)\n }\n }\n type.observe(this._typeObserver)\n this._quillObserver = (eventType, delta, state, origin) => {\n if (delta && delta.ops) {\n // update content\n const ops = delta.ops\n ops.forEach(op => {\n if (op.attributes !== undefined) {\n for (const key in op.attributes) {\n if (this._negatedUsedFormats[key] === undefined) {\n this._negatedUsedFormats[key] = false\n }\n }\n }\n })\n if (origin !== this) {\n doc.transact(() => {\n type.applyDelta(ops)\n }, this)\n }\n }\n // always check selection\n if (awareness && quillCursors) {\n const sel = quill.getSelection()\n const aw = /** @type {any} */ (awareness.getLocalState())\n if (sel === null) {\n if (awareness.getLocalState() !== null) {\n awareness.setLocalStateField('cursor', /** @type {any} */ (null))\n }\n } else {\n const anchor = Y.createRelativePositionFromTypeIndex(type, sel.index)\n const head = Y.createRelativePositionFromTypeIndex(type, sel.index + sel.length)\n if (!aw || !aw.cursor || !Y.compareRelativePositions(anchor, aw.cursor.anchor) || !Y.compareRelativePositions(head, aw.cursor.head)) {\n awareness.setLocalStateField('cursor', {\n anchor,\n head\n })\n }\n }\n // update all remote cursor locations\n awareness.getStates().forEach((aw, clientId) => {\n updateCursor(quillCursors, aw, clientId, doc, type)\n })\n }\n }\n quill.on('editor-change', this._quillObserver)\n // This indirectly initializes _negatedUsedFormats.\n // Make sure that this call this after the _quillObserver is set.\n quill.setContents(type.toDelta(), this)\n // init remote cursors\n if (quillCursors !== null && awareness) {\n awareness.getStates().forEach((aw, clientId) => {\n updateCursor(quillCursors, aw, clientId, doc, type)\n })\n awareness.on('change', this._awarenessChange)\n }\n }\n\n destroy () {\n this.type.unobserve(this._typeObserver)\n this.quill.off('editor-change', this._quillObserver)\n if (this.awareness) {\n this.awareness.off('change', this._awarenessChange)\n }\n }\n}\n", "// Generated by js_of_ocaml\n//# buildInfo:effects=false, kind=exe, use-js-string=true, version=5.8.2+5.8.2\n(function(a){typeof\nglobalThis!==\"object\"&&(this?b():(a.defineProperty(a.prototype,\"_T_\",{configurable:true,get:b}),_T_));function\nb(){var\nb=this||self;b.globalThis=b;delete\na.prototype._T_}}(Object));(function(a){require(\"quill/dist/quill.core.css\");require(\"quill/dist/quill.bubble.css\");require(\"quill/dist/quill.snow.css\")}(globalThis));(function(p){\"use strict\";var\nw=3850876,af=\"0\",aI=\" \",gA=\"compare: functional value\",gi=\"mkdir\",lo=\"synced\",cP=1000,la=\"delete\",Y=\"vendor/lwd/lib/lwd/lwd_seq.pp.ml\",kI=\"@[\",kV=\"console\",lw=\"window\",a2=\"int_of_string\",gb=\"fs\",kw=\"%u\",lv=\"/static/\",k$=\"%i\",lF=\"%ni\",a1=0xff,gh=749039939,kH=\"Assert_failure\",kv=\"camlinternalMod.ml\",aJ=737455525,k_=\"0x\",ku=0x7ff0,lE=218,k9=0xdfff,kt=\"End_of_file\",lu=\"OCAMLRUNPARAM\",kG=253,k8=\": closedir failed\",lD=\"Out_of_memory\",kF=553,k7=\"Not_found\",gD=\"Failure\",d6=\"Unix.Unix_error\",k6=\"style\",bE=244,ln=\"^\",b8=\"text\",kU=\"length\",lm=\"green\",gw=\"ENOTDIR\",kE=\"Lwd_seq.rank: node is marked\",bD=936573133,k5=\"%Li\",kd=\"Invalid_argument\",k4=\"flex\",d4=254,b9=\"+\",dY=\"Set.bal\",lC=\", characters \",aH=0xffffff,ks=858694086,kD=120,kC=1027,cL=1024,d1=\"Map.bal\",bg=246,ll=\"Pervasives.do_at_exit\",lt=389604418,kr=65536,kc=\"submit\",c=\"vendor/brr_lwd_ui/examples/yjs/main.ml\",U=16620,gv=0xf,dW=512,ge=-588596599,k3=\", \",kT=\"closedir\",lB=\"Match_failure\",ka=\"%li\",kb=1026,j$=157,j_=\"b\",ga=\"nan\",e=\"\",f$=\"rmdir\",gg=\"Fatal error: exception \",kq=\"infinity\",L=\"camlinternalFormat.ml\",lj=571,lk=\"fd \",kR=\"append\",kS=\": \",j9=174,q=248,kp=\"em\",ko=\"data\",kQ=0xe0,aL=24029,li=0xf0,kn=\"Sys_error\",as=0x80,gu=\"vendor/brr_lwd_ui/bindings/yjs/doc.ml\",ls=\"ENOTEMPTY\",lA=\"EEXIST\",gz=1255,k2=\"checkbox\",dV=\"value\",kP=\"px\",gn=\" : flags Open_text and Open_binary are not compatible\",gt=\"e\",kB=\"Stack_overflow\",gm=\": Not a directory\",gs=\"ENOENT\",gd=-605101559,T=15681,kO=\"Undefined_recursive_module\",lh=\"Array\",kN=2147483647,lg=544,aA=0x8000,dX=\"table\",cO=\"string\",km=0x800,lr=-48,j8=\" : is a directory\",kl=\"@{\",k1=\"error\",lf=\"Division_by_zero\",j7=\"classList\",bf=\".\",kk=\"(Program not linked with -g, cannot print stack backtrace)\\n\",bh=0x3f,bB=\"name\",lq=\"red\",be=737456202,gc=\" : file already exists\",bz=128,d5=\": No such file or directory\",kj=\"vendor/lwd/lib/brr-lwd/elwd.ml\",le=255,dU=\"lwd-to-remove\",cM=256,dT=\"checked\",ki=\"id\",cN=-976970511,gr=100,f_=\"index out of bounds\",lp=-937474657,aK=\"/\",kM=\"height: \",gl=504440814,d3=252,f9=\"%d\",k0=\"lwdui-virtual-table-row\",kY=\"bold\",kZ=\": file descriptor already closed\",bA=\"-\",f8=\"EBADF\",kh=\"changes\",a0=951901561,kg=102,gq=-97,lz=\"Printexc.handle_uncaught_exception\",kX=12520,gC=\" : flags Open_rdonly and Open_wronly are not compatible\",a=\"vendor/lwd/lib/lwd/lwd_table.ml\",kL=499,gy=756711075,kA=\"Fatal error: exception %s\\n\",gp=4100401,ly=\"class\",j6=\"\\xe2\\x9d\\x8c\",aZ=250,kf=199,d0=\"bool\",gk=82908052,gB=\"kind\",bC=611392745,go=\"cell\",kK=\">\",ld=\"([^/]+)\",kz=\"input\",gf=\"jsError\",j5=103,gj=127,d2='\"',aB=0xffff,gx=737308346,ke=\"documentElement\",kJ=\"Sys_blocked_io\",kW=0xdc00,b=\"vendor/lwd/lib/lwd/lwd.ml\",ky=\"not implemented\",lc=\"Form submitted:\",lx=\"_\",f7=\"target\",kx=\"rem\",dZ=\"_bigarr02\",lb=-101336657;function\nA2(a,b,c,d,e){if(d<=b)for(var\nf=1;f<=e;f++)c[d+f]=a[b+f];else\nfor(var\nf=e;f>=1;f--)c[d+f]=a[b+f];return 0}function\nA3(a,b,c){var\nd=new\nArray(c+1);d[0]=0;for(var\ne=1,f=b+1;e<=c;e++,f++)d[e]=a[f];return d}function\ngE(a,b,c){if(a[1]===b){a[1]=c;return 1}return 0}function\nA4(a,b){var\nc=a[1];a[1]+=b;return c}function\ngF(a){return a[1]}function\nmm(a){var\nb=p.process;if(b&&b.env&&b.env[a]!=undefined)return b.env[a];if(p.jsoo_static_env&&p.jsoo_static_env[a])return p.jsoo_static_env[a]}var\ngZ=0;(function(){var\nc=mm(lu);if(c!==undefined){var\nb=c.split(\",\");for(var\na=0;aa.hi)return 1;if(this.hia.mi)return 1;if(this.mia.lo)return 1;if(this.loc)return 1;if(ba.mi)return 1;if(this.mia.lo)return 1;if(this.lo>24),c=-this.hi+(b>>24);return new\nd(a,b,c)};d.prototype.add=function(a){var\nb=this.lo+a.lo,c=this.mi+a.mi+(b>>24),e=this.hi+a.hi+(c>>24);return new\nd(b,c,e)};d.prototype.sub=function(a){var\nb=this.lo-a.lo,c=this.mi-a.mi+(b>>24),e=this.hi-a.hi+(c>>24);return new\nd(b,c,e)};d.prototype.mul=function(a){var\nb=this.lo*a.lo,c=(b*l0|0)+this.mi*a.lo+this.lo*a.mi,e=(c*l0|0)+this.hi*a.lo+this.mi*a.mi+this.lo*a.hi;return new\nd(b,c,e)};d.prototype.isZero=function(){return(this.lo|this.mi|this.hi)==0};d.prototype.isNeg=function(){return this.hi<<16<0};d.prototype.and=function(a){return new\nd(this.lo&a.lo,this.mi&a.mi,this.hi&a.hi)};d.prototype.or=function(a){return new\nd(this.lo|a.lo,this.mi|a.mi,this.hi|a.hi)};d.prototype.xor=function(a){return new\nd(this.lo^a.lo,this.mi^a.mi,this.hi^a.hi)};d.prototype.shift_left=function(a){a=a&63;if(a==0)return this;if(a<24)return new\nd(this.lo<>24-a,this.hi<>24-a);if(a<48)return new\nd(0,this.lo<>48-a);return new\nd(0,0,this.lo<>a|this.mi<<24-a,this.mi>>a|this.hi<<24-a,this.hi>>a);if(a<48)return new\nd(this.mi>>a-24|this.hi<<48-a,this.hi>>a-24,0);return new\nd(this.hi>>a-48,0,0)};d.prototype.shift_right=function(a){a=a&63;if(a==0)return this;var\nc=this.hi<<16>>16;if(a<24)return new\nd(this.lo>>a|this.mi<<24-a,this.mi>>a|c<<24-a,this.hi<<16>>a>>>16);var\nb=this.hi<<16>>31;if(a<48)return new\nd(this.mi>>a-24|this.hi<<48-a,this.hi<<16>>a-24>>16,b&aB);return new\nd(this.hi<<16>>a-32,b,b)};d.prototype.lsl1=function(){this.hi=this.hi<<1|this.mi>>23;this.mi=(this.mi<<1|this.lo>>23)&aH;this.lo=this.lo<<1&aH};d.prototype.lsr1=function(){this.lo=(this.lo>>>1|this.mi<<23)&aH;this.mi=(this.mi>>>1|this.hi<<23)&aH;this.hi=this.hi>>>1};d.prototype.udivmod=function(a){var\ne=0,c=this.copy(),b=a.copy(),f=new\nd(0,0,0);while(c.ucompare(b)>0){e++;b.lsl1()}while(e>=0){e--;f.lsl1();if(c.ucompare(b)>=0){f.lo++;c=c.sub(b)}b.lsr1()}return{quotient:f,modulus:c}};d.prototype.div=function(a){var\nb=this;if(a.isZero())mf();var\nd=b.hi^a.hi;if(b.hi&aA)b=b.neg();if(a.hi&aA)a=a.neg();var\nc=b.udivmod(a).quotient;if(d&aA)c=c.neg();return c};d.prototype.mod=function(a){var\nb=this;if(a.isZero())mf();var\nd=b.hi;if(b.hi&aA)b=b.neg();if(a.hi&aA)a=a.neg();var\nc=b.udivmod(a).modulus;if(d&aA)c=c.neg();return c};d.prototype.toInt=function(){return this.lo|this.mi<<24};d.prototype.toFloat=function(){return(this.hi<<16)*Math.pow(2,32)+this.mi*Math.pow(2,24)+this.lo};d.prototype.toArray=function(){return[this.hi>>8,this.hi&a1,this.mi>>16,this.mi>>8&a1,this.mi&a1,this.lo>>16,this.lo>>8&a1,this.lo&a1]};d.prototype.lo32=function(){return this.lo|(this.mi&a1)<<24};d.prototype.hi32=function(){return this.mi>>>8&aB|this.hi<<16};function\nBv(a,b){return new\nd(a&aH,a>>>24&a1|(b&aB)<<8,b>>>16&aB)}function\ngQ(a){return a.hi32()}function\ngR(a){return a.lo32()}function\ncR(){G(f_)}var\nA6=dZ;function\nbi(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}bi.prototype.caml_custom=A6;bi.prototype.offset=function(a){var\nc=0;if(typeof\na===\"number\")a=[a];if(!(a\ninstanceof\nArray))G(\"bigarray.js: invalid offset\");if(this.dims.length!=a.length)G(\"Bigarray.get/set: bad number of dimensions\");if(this.layout==0)for(var\nb=0;b=this.dims[b])cR();c=c*this.dims[b]+a[b]}else\nfor(var\nb=this.dims.length-1;b>=0;b--){if(a[b]<1||a[b]>this.dims[b])cR();c=c*this.dims[b]+(a[b]-1)}return c};bi.prototype.get=function(a){switch(this.kind){case\n7:var\nd=this.data[a*2+0],b=this.data[a*2+1];return Bv(d,b);case\n10:case\n11:var\ne=this.data[a*2+0],c=this.data[a*2+1];return[d4,e,c];default:return this.data[a]}};bi.prototype.set=function(a,b){switch(this.kind){case\n7:this.data[a*2+0]=gR(b);this.data[a*2+1]=gQ(b);break;case\n10:case\n11:this.data[a*2+0]=b[1];this.data[a*2+1]=b[2];break;default:this.data[a]=b;break}return 0};bi.prototype.fill=function(a){switch(this.kind){case\n7:var\nc=gR(a),e=gQ(a);if(c==e)this.data.fill(c);else\nfor(var\nb=0;be)return 1;if(d!=e){if(!b)return NaN;if(d==d)return 1;if(e==e)return-1}}break;case\n7:for(var\nc=0;ca.data[c+1])return 1;if(this.data[c]>>>0>>0)return-1;if(this.data[c]>>>0>a.data[c]>>>0)return 1}break;case\n2:case\n3:case\n4:case\n5:case\n6:case\n8:case\n9:case\n12:for(var\nc=0;ca.data[c])return 1}break}return 0};function\nb_(a,b,c,d){this.kind=a;this.layout=b;this.dims=c;this.data=d}b_.prototype=new\nbi();b_.prototype.offset=function(a){if(typeof\na!==\"number\")if(a\ninstanceof\nArray&&a.length==1)a=a[0];else\nG(\"Ml_Bigarray_c_1_1.offset\");if(a<0||a>=this.dims[0])cR();return a};b_.prototype.get=function(a){return this.data[a]};b_.prototype.set=function(a,b){this.data[a]=b;return 0};b_.prototype.fill=function(a){this.data.fill(a);return 0};function\ngG(a,b,c,d){var\ne=lK(a);if(d8(c)*e!=d.length)G(\"length doesn't match dims\");if(b==0&&c.length==1&&e==1)return new\nb_(a,b,c,d);return new\nbi(a,b,c,d)}function\ngT(a){return a.slice(1)}function\nA5(a,b,c){var\nd=gT(c),e=lI(a,d8(d));return gG(a,b,d,e)}function\ncS(a,b,c){a.set(a.offset(b),c);return 0}function\nc0(a,b,c){var\nd=String.fromCharCode;if(b==0&&c<=4096&&c==a.length)return d.apply(null,a);var\nf=e;for(;0=c.l||c.t==2&&e>=c.c.length)){c.c=a.t==4?c0(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else if(c.t==2&&d==c.c.length){c.c+=a.t==4?c0(a.c,b,e):b==0&&a.c.length==e?a.c:a.c.substr(b,e);c.t=c.c.length==c.l?0:2}else{if(c.t!=4)ea(c);var\ng=a.c,h=c.c;if(a.t==4)if(d<=b)for(var\nf=0;f=0;f--)h[d+f]=g[b+f];else{var\ni=Math.min(e,g.length-b);for(var\nf=0;f>=1;if(a==0)return d;b+=b;c++;if(c==9)b.slice(0,1)}}function\ncV(a){if(a.t==2)a.c+=b$(a.l-a.c.length,\"\\0\");else\na.c=c0(a.c,0,a.c.length);a.t=0}function\ng2(a){if(a.length<24){for(var\nb=0;bgj)return false;return true}else\nreturn!/[^\\x00-\\x7f]/.test(a)}function\nmk(a){for(var\nk=e,d=e,h,g,i,b,c=0,j=a.length;cdW){d.substr(0,1);k+=d;d=e;k+=a.slice(c,f)}else\nd+=a.slice(c,f);if(f==j)break;c=f}b=1;if(++c=0xd7ff&&b<0xe000)b=2}else{b=3;if(++c0x10ffff)b=3}}}}}if(b<4){c-=b;d+=\"\\ufffd\"}else if(b>aB)d+=String.fromCharCode(0xd7c0+(b>>10),kW+(b&0x3FF));else\nd+=String.fromCharCode(b);if(d.length>cL){d.substr(0,1);k+=d;d=e}}return k+d}function\na3(a,b,c){this.t=a;this.c=b;this.l=c}a3.prototype.toString=function(){switch(this.t){case\n9:return this.c;default:cV(this);case\n0:if(g2(this.c)){this.t=9;return this.c}this.t=8;case\n8:return this.c}};a3.prototype.toUtf16=function(){var\na=this.toString();if(this.t==9)return a;return mk(a)};a3.prototype.slice=function(){var\na=this.t==4?this.c.slice():this.c;return new\na3(this.t,a,this.l)};function\nlN(a){return new\na3(0,a,a.length)}function\naM(a){return a}function\nbj(a){return lN(aM(a))}function\ncT(a,b,c,d,e){a4(bj(a),b,c,d,e);return 0}function\nd9(){G(f_)}function\nbG(a,b){switch(a.t&6){default:if(b>=a.c.length)return 0;case\n0:return a.c.charCodeAt(b);case\n4:return a.c[b]}}function\nA_(a,b){if(b>>>0>=a.l)d9();return bG(a,b)}function\nbH(a){return new\nd(a[7]<<0|a[6]<<8|a[5]<<16,a[4]<<0|a[3]<<8|a[2]<<16,a[1]<<0|a[0]<<8)}function\nA$(a,b){if(b>>>0>=a.l-7)d9();var\nd=new\nArray(8);for(var\nc=0;c<8;c++)d[7-c]=bG(a,b+c);return bH(d)}function\nB(a,b,c){c&=a1;if(a.t!=4){if(b==a.c.length){a.c+=String.fromCharCode(c);if(b+1==a.l)a.t=0;return 0}ea(a)}a.c[b]=c;return 0}function\nat(a,b,c){if(b>>>0>=a.l)d9();return B(a,b,c)}function\nbI(a){return a.toArray()}function\nlO(a,b,c){if(b>>>0>=a.l-7)d9();var\ne=bI(c);for(var\nd=0;d<8;d++)B(a,b+7-d,e[d]);return 0}function\nbk(d,c){var\nf=d.l>=0?d.l:d.l=d.length,e=c.length,b=f-e;if(b==0)return d.apply(null,c);else if(b<0){var\na=d.apply(null,c.slice(0,f));if(typeof\na!==\"function\")return a;return bk(a,c.slice(f))}else{switch(b){case\n1:{var\na=function(a){var\nf=new\nArray(e+1);for(var\nb=0;b>>0>=a.length-1)cR();return a}function\nBa(a){if(isFinite(a)){if(Math.abs(a)>=2.2250738585072014e-308)return 0;if(a!=0)return 1;return 2}return isNaN(a)?4:3}function\nl5(a){return a==245?1:0}var\nCd=Math.log2&&Math.log2(1.1235582092889474E+307)==1020;function\nCc(a){if(Cd)return Math.floor(Math.log2(a));var\nb=0;if(a==0)return-Infinity;if(a>=1)while(a>=2){a/=2;b++}else\nwhile(a<1){a*=2;b--}return b}function\ngN(a){var\nb=new\nFloat32Array(1);b[0]=a;var\nc=new\nInt32Array(b.buffer);return c[0]|0}function\nao(a,b,c){return new\nd(a,b,c)}function\ned(a){if(!isFinite(a)){if(isNaN(a))return ao(1,0,ku);return a>0?ao(0,0,ku):ao(0,0,0xfff0)}var\nf=a==0&&1/a==-Infinity?aA:a>=0?0:aA;if(f)a=-a;var\nb=Cc(a)+1023;if(b<=0){b=0;a/=Math.pow(2,-kb)}else{a/=Math.pow(2,b-kC);if(a<16){a*=2;b-=1}if(b==0)a/=2}var\nd=Math.pow(2,24),c=a|0;a=(a-c)*d;var\ne=a|0;a=(a-e)*d;var\ng=a|0;c=c&gv|f|b<<4;return ao(g,e,c)}function\nlM(a,b,c){a.write(32,b.dims.length);a.write(32,b.kind|b.layout<<8);if(b.caml_custom==dZ)for(var\nd=0;d>4;if(d==2047)return(f|g|c&gv)==0?c&aA?-Infinity:Infinity:NaN;var\ne=Math.pow(2,-24),b=(f*e+g)*e+(c&gv);if(d>0){b+=16;b*=Math.pow(2,d-kC)}else\nb*=Math.pow(2,-kb);if(c&aA)b=-b;return b}function\nS(a){if(!V.Failure)V.Failure=[q,ah(gD),-3];gY(V.Failure,a)}function\nlJ(a,b,c){var\nk=a.read32s();if(k<0||k>16)S(\"input_value: wrong number of bigarray dimensions\");var\nr=a.read32s(),l=r&a1,q=r>>8&1,j=[];if(c==dZ)for(var\nd=0;d>>32-15;b=cZ(b,0x1b873593);a^=b;a=a<<13|a>>>32-13;return(a+(a<<2)|0)+(0xe6546b64|0)|0}function\nBp(a,b){a=W(a,gR(b));a=W(a,gQ(b));return a}function\ngL(a,b){return Bp(a,ed(b))}function\nlL(a){var\nc=d8(a.dims),d=0;switch(a.kind){case\n2:case\n3:case\n12:if(c>cM)c=cM;var\ne=0,b=0;for(b=0;b+4<=a.data.length;b+=4){e=a.data[b+0]|a.data[b+1]<<8|a.data[b+2]<<16|a.data[b+3]<<24;d=W(d,e)}e=0;switch(c&3){case\n3:e=a.data[b+2]<<16;case\n2:e|=a.data[b+1]<<8;case\n1:e|=a.data[b+0];d=W(d,e)}break;case\n4:case\n5:if(c>bz)c=bz;var\ne=0,b=0;for(b=0;b+2<=a.data.length;b+=2){e=a.data[b+0]|a.data[b+1]<<16;d=W(d,e)}if((c&1)!=0)d=W(d,a.data[b]);break;case\n6:if(c>64)c=64;for(var\nb=0;b64)c=64;for(var\nb=0;b32)c=32;c*=2;for(var\nb=0;b64)c=64;for(var\nb=0;b32)c=32;for(var\nb=0;b0?f(b,a,d):f(a,b,d);if(d&&e!=e)return c;if(+e!=+e)return+e;if((e|0)!=0)return e|0}return c}function\nef(a){return typeof\na===\"string\"&&!/[^\\x00-\\xff]/.test(a)}function\nee(a){return a\ninstanceof\na3}function\nlQ(a){if(typeof\na===\"number\")return cP;else if(ee(a))return d3;else if(ef(a))return 1252;else if(a\ninstanceof\nArray&&a[0]===a[0]>>>0&&a[0]<=le){var\nb=a[0]|0;return b==d4?0:b}else if(a\ninstanceof\nString)return kX;else if(typeof\na==\"string\")return kX;else if(a\ninstanceof\nNumber)return cP;else if(a&&a.caml_custom)return gz;else if(a&&a.compare)return 1256;else if(typeof\na==\"function\")return 1247;else if(typeof\na==\"symbol\")return 1251;return 1001}function\nl3(a,b){if(ab?1:0}function\nA9(a,b){a.t&6&&cV(a);b.t&6&&cV(b);return a.cb.c?1:0}function\nd$(a,b,c){var\nf=[];for(;;){if(!(c&&a===b)){var\ne=lQ(a);if(e==aZ){a=a[1];continue}var\ng=lQ(b);if(g==aZ){b=b[1];continue}if(e!==g){if(e==cP){if(g==gz)return lP(a,b,-1,c);return-1}if(g==cP){if(e==gz)return lP(b,a,1,c);return 1}return eb)return 1;if(a!=b){if(!c)return NaN;if(a==a)return 1;if(b==b)return-1}break;case\n1001:if(ab)return 1;if(a!=b){if(!c)return NaN;if(a==a)return 1;if(b==b)return-1}break;case\n1251:if(a!==b){if(!c)return NaN;return 1}break;case\n1252:var\na=aM(a),b=aM(b);if(a!==b){if(ab)return 1}break;case\n12520:var\na=a.toString(),b=b.toString();if(a!==b){if(ab)return 1}break;case\n246:case\n254:default:if(l5(e)){G(\"compare: continuation value\");break}if(a.length!=b.length)return a.length1)f.push(a,b,1);break}}if(f.length==0)return 0;var\nh=f.pop();b=f.pop();a=f.pop();if(h+10)if(b==0&&(c>=a.l||a.t==2&&c>=a.c.length))if(d==0){a.c=e;a.t=2}else{a.c=b$(c,String.fromCharCode(d));a.t=c==a.l?0:2}else{if(a.t!=4)ea(a);for(c+=b;b0&&b===b)return b;a=a.replace(/_/g,e);b=+a;if(a.length>0&&b===b||/^[+-]?nan$/i.test(a))return b;var\nc=/^ *([+-]?)0x([0-9a-f]+)\\.?([0-9a-f]*)(p([+-]?[0-9]+))?/i.exec(a);if(c){var\nd=c[3].replace(/0+$/,e),g=parseInt(c[1]+c[2]+d,16),f=(c[5]|0)-4*d.length;b=g*Math.pow(2,f);return b}if(/^\\+?inf(inity)?$/i.test(a))return Infinity;if(/^-inf(inity)?$/i.test(a))return-Infinity;S(\"float_of_string\")}function\ngX(a){a=aM(a);var\ne=a.length;if(e>31)G(\"format_int: format too long\");var\nb={justify:b9,signstyle:bA,filler:aI,alternate:false,base:0,signedconv:false,width:0,uppercase:false,sign:1,prec:-1,conv:\"f\"};for(var\nd=0;d=0&&c<=9){b.width=b.width*10+c;d++}d--;break;case\".\":b.prec=0;d++;while(c=a.charCodeAt(d)-48,c>=0&&c<=9){b.prec=b.prec*10+c;d++}d--;case\"d\":case\"i\":b.signedconv=true;case\"u\":b.base=10;break;case\"x\":b.base=16;break;case\"X\":b.base=16;b.uppercase=true;break;case\"o\":b.base=8;break;case\"e\":case\"f\":case\"g\":b.signedconv=true;b.conv=c;break;case\"E\":case\"F\":case\"G\":b.signedconv=true;b.uppercase=true;b.conv=c.toLowerCase();break}}return b}function\ngJ(a,b){if(a.uppercase)b=b.toUpperCase();var\nf=b.length;if(a.signedconv&&(a.sign<0||a.signstyle!=bA))f++;if(a.alternate){if(a.base==8)f+=1;if(a.base==16)f+=2}var\nc=e;if(a.justify==b9&&a.filler==aI)for(var\nd=f;d20){c-=20;a/=Math.pow(10,c);a+=new\nArray(c+1).join(af);if(b>0)a=a+bf+new\nArray(b+1).join(af);return a}else\nreturn a.toFixed(b)}}var\nc,f=gX(a),e=f.prec<0?6:f.prec;if(b<0||b==0&&1/b==-Infinity){f.sign=-1;b=-b}if(isNaN(b)){c=ga;f.filler=aI}else if(!isFinite(b)){c=\"inf\";f.filler=aI}else\nswitch(f.conv){case\"e\":var\nc=b.toExponential(e),d=c.length;if(c.charAt(d-3)==gt)c=c.slice(0,d-1)+af+c.slice(d-1);break;case\"f\":c=j(b,e);break;case\"g\":e=e?e:1;c=b.toExponential(e-1);var\ni=c.indexOf(gt),h=+c.slice(i+1);if(h<-4||b>=1e21||b.toFixed(0).length>e){var\nd=i-1;while(c.charAt(d)==af)d--;if(c.charAt(d)==bf)d--;c=c.slice(0,d+1)+c.slice(i);d=c.length;if(c.charAt(d-3)==gt)c=c.slice(0,d-1)+af+c.slice(d-1);break}else{var\ng=e;if(h<0){g-=h+1;c=b.toFixed(g)}else\nwhile(c=b.toFixed(g),c.length>e+1)g--;if(g){var\nd=c.length-1;while(c.charAt(d)==af)d--;if(c.charAt(d)==bf)d--;c=c.slice(0,d+1)}}break}return gJ(f,c)}function\nec(a,b){if(aM(a)==f9)return ah(e+b);var\nc=gX(a);if(b<0)if(c.signedconv){c.sign=-1;b=-b}else\nb>>>=0;var\nd=b.toString(c.base);if(c.prec>=0){c.filler=aI;var\nf=c.prec-d.length;if(f>0)d=b$(f,af)+d}return gJ(c,d)}var\nBX=0;function\nag(){return BX++}function\nH(a){if(g2(a))return a;return mk(a)}function\nc1(){return typeof\np.process!==\"undefined\"&&typeof\np.process.versions!==\"undefined\"&&typeof\np.process.versions.node!==\"undefined\"}function\nCe(){function\na(a){if(a.charAt(0)===aK)return[e,a.substring(1)];return}function\nb(a){var\nh=/^([a-zA-Z]:|[\\\\/]{2}[^\\\\/]+[\\\\/]+[^\\\\/]+)?([\\\\/])?([\\s\\S]*?)$/,b=h.exec(a),c=b[1]||e,f=Boolean(c&&c.charAt(1)!==\":\");if(Boolean(b[2]||f)){var\nd=b[1]||e,g=b[2]||e;return[d,a.substring(d.length+g.length)]}return}return c1()&&p.process&&p.process.platform?p.process.platform===\"win32\"?b:a:a}var\ng3=Ce();function\nmi(a){return a.slice(-1)!==aK?a+aK:a}if(c1()&&p.process&&p.process.cwd)var\ncW=p.process.cwd().replace(/\\\\/g,aK);else\nvar\ncW=\"/static\";cW=mi(cW);function\nBM(a){a=H(a);if(!g3(a))a=cW+a;var\ne=g3(a),d=e[1].split(aK),b=[];for(var\nc=0;c1)b.pop();break;case\".\":break;case\"\":break;default:b.push(d[c]);break}b.unshift(e[0]);b.orig=a;return b}function\nB6(a){for(var\ng=e,c=g,b,i,d=0,h=a.length;ddW){c.substr(0,1);g+=c;c=e;g+=a.slice(d,f)}else\nc+=a.slice(d,f);if(f==h)break;d=f}if(b>6);c+=String.fromCharCode(as|b&bh)}else if(b<0xd800||b>=k9)c+=String.fromCharCode(kQ|b>>12,as|b>>6&bh,as|b&bh);else if(b>=0xdbff||d+1==h||(i=a.charCodeAt(d+1))k9)c+=\"\\xef\\xbf\\xbd\";else{d++;b=(b<<10)+i-0x35fdc00;c+=String.fromCharCode(li|b>>18,as|b>>12&bh,as|b>>6&bh,as|b&bh)}if(c.length>cL){c.substr(0,1);g+=c;c=e}}return g+c}function\naw(a){return g2(a)?ah(a):ah(B6(a))}var\nCf=[\"E2BIG\",\"EACCES\",\"EAGAIN\",f8,\"EBUSY\",\"ECHILD\",\"EDEADLK\",\"EDOM\",lA,\"EFAULT\",\"EFBIG\",\"EINTR\",\"EINVAL\",\"EIO\",\"EISDIR\",\"EMFILE\",\"EMLINK\",\"ENAMETOOLONG\",\"ENFILE\",\"ENODEV\",gs,\"ENOEXEC\",\"ENOLCK\",\"ENOMEM\",\"ENOSPC\",\"ENOSYS\",gw,ls,\"ENOTTY\",\"ENXIO\",\"EPERM\",\"EPIPE\",\"ERANGE\",\"EROFS\",\"ESPIPE\",\"ESRCH\",\"EXDEV\",\"EWOULDBLOCK\",\"EINPROGRESS\",\"EALREADY\",\"ENOTSOCK\",\"EDESTADDRREQ\",\"EMSGSIZE\",\"EPROTOTYPE\",\"ENOPROTOOPT\",\"EPROTONOSUPPORT\",\"ESOCKTNOSUPPORT\",\"EOPNOTSUPP\",\"EPFNOSUPPORT\",\"EAFNOSUPPORT\",\"EADDRINUSE\",\"EADDRNOTAVAIL\",\"ENETDOWN\",\"ENETUNREACH\",\"ENETRESET\",\"ECONNABORTED\",\"ECONNRESET\",\"ENOBUFS\",\"EISCONN\",\"ENOTCONN\",\"ESHUTDOWN\",\"ETOOMANYREFS\",\"ETIMEDOUT\",\"ECONNREFUSED\",\"EHOSTDOWN\",\"EHOSTUNREACH\",\"ELOOP\",\"EOVERFLOW\"];function\na6(a,b,c,d){var\nf=Cf.indexOf(a);if(f<0){if(d==null)d=-9999;f=[0,d]}var\ng=[f,aw(b||e),aw(c||e)];return g}var\nma={};function\nbm(a){return ma[a]}function\na5(a,b){throw g([0,a].concat(b))}function\ngH(a){if(!(a\ninstanceof\nUint8Array))a=new\nUint8Array(a);return new\na3(4,a,a.length)}function\nm(a){gY(V.Sys_error,a)}function\nme(a){m(a+d5)}function\ng1(a){if(a.t!=4)ea(a);return a.c}function\nau(a){return a.l}function\nlG(){}function\nZ(a){this.data=a}Z.prototype=new\nlG();Z.prototype.constructor=Z;Z.prototype.truncate=function(a){var\nb=this.data;this.data=C(a|0);a4(b,0,this.data,0,a)};Z.prototype.length=function(){return au(this.data)};Z.prototype.write=function(a,b,c,d){var\ne=this.length();if(a+d>=e){var\nf=C(a+d),g=this.data;this.data=f;a4(g,0,this.data,0,e)}a4(gH(b),c,this.data,a,d);return 0};Z.prototype.read=function(a,b,c,d){var\ne=this.length();if(a+d>=e)d=e-a;if(d){var\nf=C(d|0);a4(this.data,a,f,0,d);b.set(g1(f),c)}return d};function\nbF(a,b,c){this.file=b;this.name=a;this.flags=c}bF.prototype.err_closed=function(){m(this.name+kZ)};bF.prototype.length=function(){if(this.file)return this.file.length();this.err_closed()};bF.prototype.write=function(a,b,c,d){if(this.file)return this.file.write(a,b,c,d);this.err_closed()};bF.prototype.read=function(a,b,c,d){if(this.file)return this.file.read(a,b,c,d);this.err_closed()};bF.prototype.close=function(){this.file=undefined};function\nO(a,b){this.content={};this.root=a;this.lookupFun=b}O.prototype.nm=function(a){return this.root+a};O.prototype.create_dir_if_needed=function(a){var\nd=a.split(aK),c=e;for(var\nb=0;b>>16;a=cZ(a,0x85ebca6b|0);a^=a>>>13;a=cZ(a,0xc2b2ae35|0);a^=a>>>16;return a}function\nBl(a,b,c,d){var\nj,k,l,h,g,f,e,i,m;h=b;if(h<0||h>cM)h=cM;g=a;f=c;j=[d];k=0;l=1;while(k0){e=j[k++];if(e&&e.caml_custom){if(cX[e.caml_custom]&&cX[e.caml_custom].hash){var\nn=cX[e.caml_custom].hash(e);f=W(f,n);g--}}else if(e\ninstanceof\nArray&&e[0]===(e[0]|0))switch(e[0]){case\n248:f=W(f,e[2]);g--;break;case\n250:j[--k]=e[1];break;default:if(l5(e[0]))break;var\no=e.length-1<<10|e[0];f=W(f,o);for(i=1,m=e.length;i=h)break;j[l++]=e[i]}break}else if(ee(e)){f=Bm(f,e);g--}else if(ef(e)){f=Bq(f,e);g--}else if(typeof\ne===\"string\"){f=gM(f,e);g--}else if(e===(e|0)){f=W(f,e+e+1);g--}else if(typeof\ne===\"number\"){f=gL(f,e);g--}}f=Bo(f);return f&0x3FFFFFFF}function\nBr(a,b,c){if(!isFinite(a)){if(isNaN(a))return aw(ga);return aw(a>0?kq:\"-infinity\")}var\nk=a==0&&1/a==-Infinity?1:a>=0?0:1;if(k)a=-a;var\nf=0;if(a==0);else if(a<1)while(a<1&&f>-1022){a*=2;f--}else\nwhile(a>=2){a/=2;f++}var\nl=f<0?e:b9,g=e;if(k)g=bA;else\nswitch(c){case\n43:g=b9;break;case\n32:g=aI;break;default:break}if(b>=0&&b<13){var\ni=Math.pow(2,b*4);a=Math.round(a*i)/i}var\nd=a.toString(16);if(b>=0){var\nj=d.indexOf(bf);if(j<0)d+=bf+b$(b,af);else{var\nh=j+1+b;if(d.length>24&aH,a>>31&aB)}function\nl2(a){return a.toInt()}function\nBy(a){return+a.isNeg()}function\nlY(a){return a.neg()}function\nBw(a,b){var\nc=gX(a);if(c.signedconv&&By(b)){c.sign=-1;b=lY(b)}var\nd=e,i=cY(c.base),h=\"0123456789abcdef\";do{var\ng=b.udivmod(i);b=g.quotient;d=h.charAt(l2(g.modulus))+d}while(!Bz(b));if(c.prec>=0){c.filler=aI;var\nf=c.prec-d.length;if(f>0)d=b$(f,af)+d}return gJ(c,d)}function\nl1(a,b){return a.or(b)}function\nmc(a){var\nb=0,e=n(a),c=10,d=1;if(e>0)switch(_(a,b)){case\n45:b++;d=-1;break;case\n43:b++;d=1;break}if(b+1=48&&a<=57)return a-48;if(a>=65&&a<=90)return a-55;if(a>=97&&a<=122)return a-87;return-1}function\nl4(a){var\nh=mc(a),d=h[0],i=h[1],e=h[2],g=n(a),j=-1>>>0,f=d=e)S(a2);var\nb=c;for(d++;d=e)break;b=e*b+c;if(b>j)S(a2)}if(d!=g)S(a2);b=i*b;if(e==10&&(b|0)!=b)S(a2);return b|0}function\neg(a,b,c){return a[H(b)].apply(a,gT(c))}function\nl6(a,b){switch(b.length){case\n1:return new\na;case\n2:return new\na(b[1]);case\n3:return new\na(b[1],b[2]);case\n4:return new\na(b[1],b[2],b[3]);case\n5:return new\na(b[1],b[2],b[3],b[4]);case\n6:return new\na(b[1],b[2],b[3],b[4],b[5]);case\n7:return new\na(b[1],b[2],b[3],b[4],b[5],b[6]);case\n8:return new\na(b[1],b[2],b[3],b[4],b[5],b[6],b[7])}function\nc(){return a.apply(this,gT(b))}c.prototype=a.prototype;return new\nc}function\ngU(a){var\nc={};for(var\nb=1;b>>0&&gW(a,bg,bE)?0:1}function\nl7(a){gW(a,bE,aZ);return 0}function\nBK(a,b){return+(d$(a,b,false)<0)}function\nBL(a){var\nb=[];for(;a!==0;a=a[2])b.push(a[1]);return b}function\nmb(a){return ah(a)}function\nlW(a,b){return a.add(b)}function\nlX(a,b){return a.mul(b)}function\ngS(a,b){return a.ucompare(b)<0}function\nlZ(a){var\nh=mc(a),g=h[0],j=h[1],e=h[2],i=cY(e),k=new\nd(aH,0xfffffff,aB).udivmod(i).quotient,f=_(a,g),b=eh(f);if(b<0||b>=e)S(a2);var\nc=cY(b);for(;;){g++;f=_(a,g);if(f==95)continue;b=eh(f);if(b<0||b>=e)break;if(gS(k,c))S(a2);b=cY(b);c=lW(lX(i,c),b);if(gS(c,b))S(a2)}if(g!=n(a))S(a2);if(e==10&&gS(new\nd(0,0,aA),c))S(a2);if(j<0)c=lY(c);return c}function\nA7(a,b){return a.get(a.offset(b))}function\nBE(a,b){return a.xor(b)}function\nBC(a,b){return a.shift_right_unsigned(b)}function\nBB(a,b){return a.shift_left(b)}function\nl8(a){function\no(a,b){return BB(a,b)}function\nh(a,b){return BC(a,b)}function\ns(a,b){return l1(a,b)}function\nf(a,b){return BE(a,b)}function\nk(a,b){return lW(a,b)}function\ni(a,b){return lX(a,b)}function\nm(a,b){return s(o(a,b),h(a,64-b))}function\ng(a,b){return A7(a,b)}function\nj(a,b,c){return cS(a,b,c)}var\nq=lZ(mb(\"0xd1342543de82ef95\")),l=lZ(mb(\"0xdaba0b6eb09322e3\")),b,d,c,e=a,r=g(e,0),n=g(e,1),p=g(e,2),t=g(e,3);b=k(n,p);b=i(f(b,h(b,32)),l);b=i(f(b,h(b,32)),l);b=f(b,h(b,32));j(e,1,k(i(n,q),r));var\nd=p,c=t;c=f(c,d);d=m(d,24);d=f(f(d,c),o(c,16));c=m(c,37);j(e,2,d);j(e,3,c);return b}function\nap(a,b){if(a<0)cR();var\na=a+1|0,c=new\nArray(a);c[0]=0;for(var\nd=1;d>>32-e,c)}function\ng(a,b,c,d,e,f,g){return l(b&c|~b&d,a,b,e,f,g)}function\nh(a,b,c,d,e,f,g){return l(b&d|c&~d,a,b,e,f,g)}function\ni(a,b,c,d,e,f,g){return l(b^c^d,a,b,e,f,g)}function\nj(a,b,c,d,e,f,g){return l(c^(b|~d),a,b,e,f,g)}return function(a,b){var\nc=a[0],d=a[1],e=a[2],f=a[3];c=g(c,d,e,f,b[0],7,0xD76AA478);f=g(f,c,d,e,b[1],12,0xE8C7B756);e=g(e,f,c,d,b[2],17,0x242070DB);d=g(d,e,f,c,b[3],22,0xC1BDCEEE);c=g(c,d,e,f,b[4],7,0xF57C0FAF);f=g(f,c,d,e,b[5],12,0x4787C62A);e=g(e,f,c,d,b[6],17,0xA8304613);d=g(d,e,f,c,b[7],22,0xFD469501);c=g(c,d,e,f,b[8],7,0x698098D8);f=g(f,c,d,e,b[9],12,0x8B44F7AF);e=g(e,f,c,d,b[10],17,0xFFFF5BB1);d=g(d,e,f,c,b[11],22,0x895CD7BE);c=g(c,d,e,f,b[12],7,0x6B901122);f=g(f,c,d,e,b[13],12,0xFD987193);e=g(e,f,c,d,b[14],17,0xA679438E);d=g(d,e,f,c,b[15],22,0x49B40821);c=h(c,d,e,f,b[1],5,0xF61E2562);f=h(f,c,d,e,b[6],9,0xC040B340);e=h(e,f,c,d,b[11],14,0x265E5A51);d=h(d,e,f,c,b[0],20,0xE9B6C7AA);c=h(c,d,e,f,b[5],5,0xD62F105D);f=h(f,c,d,e,b[10],9,0x02441453);e=h(e,f,c,d,b[15],14,0xD8A1E681);d=h(d,e,f,c,b[4],20,0xE7D3FBC8);c=h(c,d,e,f,b[9],5,0x21E1CDE6);f=h(f,c,d,e,b[14],9,0xC33707D6);e=h(e,f,c,d,b[3],14,0xF4D50D87);d=h(d,e,f,c,b[8],20,0x455A14ED);c=h(c,d,e,f,b[13],5,0xA9E3E905);f=h(f,c,d,e,b[2],9,0xFCEFA3F8);e=h(e,f,c,d,b[7],14,0x676F02D9);d=h(d,e,f,c,b[12],20,0x8D2A4C8A);c=i(c,d,e,f,b[5],4,0xFFFA3942);f=i(f,c,d,e,b[8],11,0x8771F681);e=i(e,f,c,d,b[11],16,0x6D9D6122);d=i(d,e,f,c,b[14],23,0xFDE5380C);c=i(c,d,e,f,b[1],4,0xA4BEEA44);f=i(f,c,d,e,b[4],11,0x4BDECFA9);e=i(e,f,c,d,b[7],16,0xF6BB4B60);d=i(d,e,f,c,b[10],23,0xBEBFBC70);c=i(c,d,e,f,b[13],4,0x289B7EC6);f=i(f,c,d,e,b[0],11,0xEAA127FA);e=i(e,f,c,d,b[3],16,0xD4EF3085);d=i(d,e,f,c,b[6],23,0x04881D05);c=i(c,d,e,f,b[9],4,0xD9D4D039);f=i(f,c,d,e,b[12],11,0xE6DB99E5);e=i(e,f,c,d,b[15],16,0x1FA27CF8);d=i(d,e,f,c,b[2],23,0xC4AC5665);c=j(c,d,e,f,b[0],6,0xF4292244);f=j(f,c,d,e,b[7],10,0x432AFF97);e=j(e,f,c,d,b[14],15,0xAB9423A7);d=j(d,e,f,c,b[5],21,0xFC93A039);c=j(c,d,e,f,b[12],6,0x655B59C3);f=j(f,c,d,e,b[3],10,0x8F0CCC92);e=j(e,f,c,d,b[10],15,0xFFEFF47D);d=j(d,e,f,c,b[1],21,0x85845DD1);c=j(c,d,e,f,b[8],6,0x6FA87E4F);f=j(f,c,d,e,b[15],10,0xFE2CE6E0);e=j(e,f,c,d,b[6],15,0xA3014314);d=j(d,e,f,c,b[13],21,0x4E0811A1);c=j(c,d,e,f,b[4],6,0xF7537E82);f=j(f,c,d,e,b[11],10,0xBD3AF235);e=j(e,f,c,d,b[2],15,0x2AD7D2BB);d=j(d,e,f,c,b[9],21,0xEB86D391);a[0]=k(c,a[0]);a[1]=k(d,a[1]);a[2]=k(e,a[2]);a[3]=k(f,a[3])}}();function\nA1(a,b,c){var\ne=a.len&bh,d=0;a.len+=c;if(e){var\nf=64-e;if(c=64){a.b8.set(b.subarray(d,d+64),0);d7(a.w,a.b32);c-=64;d+=64}if(c)a.b8.set(b.subarray(d,d+c),0)}function\nAZ(a){var\nc=a.len&bh;a.b8[c]=as;c++;if(c>56){for(var\nb=c;b<64;b++)a.b8[b]=0;d7(a.w,a.b32);for(var\nb=0;b<56;b++)a.b8[b]=0}else\nfor(var\nb=c;b<56;b++)a.b8[b]=0;a.b32[14]=a.len<<3;a.b32[15]=a.len>>29&0x1FFFFFFF;d7(a.w,a.b32);var\ne=new\nUint8Array(16);for(var\nd=0;d<4;d++)for(var\nb=0;b<4;b++)e[d*4+b]=a.w[d]>>8*b&0xFF;return e}function\nB2(a){return ah(c0(a,0,a.length))}function\nBN(a,b,c){var\nd=A0(),e=g1(a);A1(d,e.subarray(b,b+c),c);return B2(AZ(d))}function\nBO(a,b,c){return BN(bj(a),b,c)}function\nBQ(){return 0}var\nbl=new\nArray();function\nl9(a){return bl[a]}function\nbK(a){var\nb=l9(a);if(!b.opened)m(\"Cannot flush a closed channel\");if(!b.buffer||b.buffer_curr==0)return 0;if(b.output)b.output(c0(b.buffer,0,b.buffer_curr));else\nb.file.write(b.offset,b.buffer,0,b.buffer_curr);b.offset+=b.buffer_curr;b.buffer_curr=0;return 0}function\nB4(a,b){if(b.name)try{var\nd=require(gb),c=d.openSync(b.name,\"rs\");return new\naC(c,b)}catch(f){}return new\naC(a,b)}var\nek=new\nArray(3);function\ncQ(a,b){Z.call(this,C(0));this.log=function(a){return 0};if(a==1&&typeof\nconsole.log==\"function\")this.log=console.log;else if(a==2&&typeof\nconsole.error==\"function\")this.log=console.error;else if(typeof\nconsole.log==\"function\")this.log=console.log;this.flags=b}cQ.prototype.length=function(){return 0};cQ.prototype.write=function(a,b,c,d){if(this.log){if(d>0&&c>=0&&c+d<=b.length&&b[c+d-1]==10)d--;var\ne=C(d);a4(gH(b),c,e,0,d);this.log(e.toUtf16());return 0}m(this.fd+kZ)};cQ.prototype.read=function(a,b,c,d){m(this.fd+\": file descriptor is write only\")};cQ.prototype.close=function(){this.log=undefined};function\nel(a,b){if(b==undefined)b=ek.length;ek[b]=a;return b|0}function\nCh(a,b,c){var\nd={};while(b){switch(b[1]){case\n0:d.rdonly=1;break;case\n1:d.wronly=1;break;case\n2:d.append=1;break;case\n3:d.create=1;break;case\n4:d.truncate=1;break;case\n5:d.excl=1;break;case\n6:d.binary=1;break;case\n7:d.text=1;break;case\n8:d.nonblock=1;break}b=b[2]}if(d.rdonly&&d.wronly)m(aM(a)+gC);if(d.text&&d.binary)m(aM(a)+gn);var\ne=mn(a),f=e.device.open(e.rest,d);return el(f,undefined)}(function(){function\na(a,b){return c1()?B4(a,b):new\ncQ(a,b)}el(a(0,{rdonly:1,altname:\"/dev/stdin\",isCharacterDevice:true}),0);el(a(1,{buffered:2,wronly:1,isCharacterDevice:true}),1);el(a(2,{buffered:2,wronly:1,isCharacterDevice:true}),2)}());function\nBR(a){var\nb=ek[a];if(b.flags.wronly)m(lk+a+\" is writeonly\");var\nd=null,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:false,buffer_curr:0,buffer_max:0,buffer:new\nUint8Array(kr),refill:d};bl[c.fd]=c;return c.fd}function\nl_(a){var\nb=ek[a];if(b.flags.rdonly)m(lk+a+\" is readonly\");var\nd=b.flags.buffered!==undefined?b.flags.buffered:1,c={file:b,offset:b.flags.append?b.length():0,fd:a,opened:true,out:true,buffer_curr:0,buffer:new\nUint8Array(kr),buffered:d};bl[c.fd]=c;return c.fd}function\nBS(){var\nb=0;for(var\na=0;ae.buffer.length){var\ng=new\nUint8Array(e.buffer_curr+b.length);g.set(e.buffer);e.buffer=g}switch(e.buffered){case\n0:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;bK(a);break;case\n1:e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)bK(a);break;case\n2:var\nf=b.lastIndexOf(10);if(f<0){e.buffer.set(b,e.buffer_curr);e.buffer_curr+=b.length;if(e.buffer_curr>=e.buffer.length)bK(a)}else{e.buffer.set(b.subarray(0,f+1),e.buffer_curr);e.buffer_curr+=f+1;bK(a);e.buffer.set(b.subarray(f+1),e.buffer_curr);e.buffer_curr+=b.length-f-1}break}return 0}function\nBT(a,b,c,d){var\nb=g1(b);return BU(a,b,c,d)}function\ngV(a,b,c,d){return BT(a,bj(b),c,d)}function\nl$(a,b){var\nc=ah(String.fromCharCode(b));gV(a,c,0,1);return 0}function\nbL(a,b){return+(d$(a,b,false)!=0)}function\nBW(a,b){var\nd=new\nArray(b+1);d[0]=a;for(var\nc=1;c<=b;c++)d[c]=0;return d}function\naN(a){if(a\ninstanceof\nArray&&a[0]==a[0]>>>0)return a[0];else if(ee(a))return d3;else if(ef(a))return d3;else if(a\ninstanceof\nFunction||typeof\na==\"function\")return 247;else if(a&&a.caml_custom)return le;else\nreturn cP}function\nA8(a){var\nc={};if(a)for(var\nb=1;b=0)a=e;else\nS(\"caml_register_global: cannot locate \"+d)}}V[a+1]=b;if(c)V[c]=b}function\ng0(a,b){ma[aM(a)]=b;return 0}function\nB1(){G(f_)}function\nD(a,b){if(b>>>0>=n(a))B1();return _(a,b)}function\nej(a){a.t&6&&cV(a);return ah(a.c)}function\nB3(){return 0x7FFFFFFF/4|0}function\nBY(){md(V.Not_found)}function\nmh(a){var\nb=mm(H(a));if(b===undefined)BY();return aw(b)}function\nB5(){if(p.crypto)if(p.crypto.getRandomValues){var\na=p.crypto.getRandomValues(new\nInt32Array(4));return[0,a[0],a[1],a[2],a[3]]}else if(p.crypto.randomBytes){var\na=new\nInt32Array(p.crypto.randomBytes(16).buffer);return[0,a[0],a[1],a[2],a[3]]}var\nb=new\nDate().getTime(),c=b^0xffffffff*Math.random();return[0,c]}function\nbM(a){var\nb=1;while(a&&a.joo_tramp){a=a.joo_tramp.apply(null,a.joo_args);b++}return a}function\nr(a,b){return{joo_tramp:a,joo_args:b}}function\nmj(a,b){if(b.fun){a.fun=b.fun;return 0}if(typeof\nb===\"function\"){a.fun=b;return 0}var\nc=b.length;while(c--)a[c]=b[c];return 0}function\nM(a){{if(a\ninstanceof\nArray)return a;var\nb;if(p.RangeError&&a\ninstanceof\np.RangeError&&a.message&&a.message.match(/maximum call stack/i))b=V.Stack_overflow;else if(p.InternalError&&a\ninstanceof\np.InternalError&&a.message&&a.message.match(/too much recursion/i))b=V.Stack_overflow;else if(a\ninstanceof\np.Error&&bm(gf))b=[0,bm(gf),a];else\nb=[0,V.Failure,aw(String(a))];if(a\ninstanceof\np.Error)b.js_error=a;return b}}function\nB7(){return require(\"y-protocols/awareness.js\")}function\nB8(){return require(\"y-indexeddb\").IndexeddbPersistence}function\nB9(){return require(\"quill\").default}function\nB_(){return require(\"quill-cursors\")}function\nB$(){return require(\"y-webrtc\").WebrtcProvider}function\nCa(){return require(\"y-quill\")}function\nCb(){return require(\"yjs\")}function\nBF(a){switch(a[2]){case-8:case-11:case-12:return 1;default:return 0}}function\nBi(a){var\nb=e;if(a[0]==0){b+=a[1][1];if(a.length==3&&a[2][0]==0&&BF(a[1]))var\nf=a[2],g=1;else\nvar\ng=2,f=a;b+=\"(\";for(var\nd=g;dg)b+=k3;var\nc=f[d];if(typeof\nc==\"number\")b+=c.toString();else if(c\ninstanceof\na3)b+=d2+c.toString()+d2;else if(typeof\nc==\"string\")b+=d2+c.toString()+d2;else\nb+=lx}b+=\")\"}else if(a[0]==q)b+=a[1];return b}function\nlT(a){if(a\ninstanceof\nArray&&(a[0]==0||a[0]==q)){var\nc=bm(lz);if(c)d_(c,[a,false]);else{var\nd=Bi(a),b=bm(ll);if(b)d_(b,[0]);console.error(gg+d);if(a.js_error)throw a.js_error}}else\nthrow a}function\nB0(){var\nc=p.process;if(c&&c.on)c.on(\"uncaughtException\",function(a,b){lT(a);c.exit(2)});else if(p.addEventListener)p.addEventListener(k1,function(a){if(a.error)lT(a.error)})}B0();function\nh(a,b){return(a.l>=0?a.l:a.l=a.length)==1?a(b):bk(a,[b])}function\ni(a,b,c){return(a.l>=0?a.l:a.l=a.length)==2?a(b,c):bk(a,[b,c])}function\ny(a,b,c,d){return(a.l>=0?a.l:a.l=a.length)==3?a(b,c,d):bk(a,[b,c,d])}function\nf6(a,b,c,d,e,f){return(a.l>=0?a.l:a.l=a.length)==5?a(b,c,d,e,f):bk(a,[b,c,d,e,f])}function\nAY(a,b,c,d,e,f,g,h){return(a.l>=0?a.l:a.l=a.length)==7?a(b,c,d,e,f,g,h):bk(a,[b,c,d,e,f,g,h])}var\nCg=undefined;Bj();var\nem=[q,lD,-1],g6=[q,kn,-2],cc=[q,gD,-3],cb=[q,kd,-4],aD=[q,k7,-7],g4=[q,lB,-8],g5=[q,kB,-9],f=[q,kH,-11],cd=[q,kO,-12],AX=[4,0,0,0,[12,45,[4,0,0,0,0]]],eP=[0,[11,'File \"',[2,0,[11,'\", line ',[4,0,0,0,[11,lC,[4,0,0,0,[12,45,[4,0,0,0,[11,kS,[2,0,0]]]]]]]]]],'File \"%s\", line %d, characters %d-%d: %s'],jQ=gB,by=\"content\",jW=\"columns\",jX=\"rows\",f0=ki,f1=gB,jY=bB,jZ=\"page_content\";av(11,cd,kO);av(10,f,kH);av(9,[q,kJ,-10],kJ);av(8,g5,kB);av(7,g4,lB);av(6,aD,k7);av(5,[q,lf,-6],lf);av(4,[q,kt,-5],kt);av(3,cb,kd);av(2,cc,gD);av(1,g6,kn);av(0,em,lD);var\nmy=\"output_substring\",mu=bf,mq=\"true\",mr=\"false\",mD=\"CamlinternalLazy.Undefined\",mJ=\"option is None\",mM=\"\\\\\\\\\",mN=\"\\\\'\",mO=\"\\\\b\",mP=\"\\\\t\",mQ=\"\\\\n\",mR=\"\\\\r\",m0=\"List.init\",mW=\"hd\",nf=\"String.blit / Bytes.blit_string\",ne=\"Bytes.blit\",nd=\"String.sub / Bytes.sub\",nq=\"String.contains_from / Bytes.contains_from\",nw=\"Array.blit\",nv=\"Array.sub\",nt=\"Array.init\",nD=[0,\"set.ml\",lj,18],nz=dY,nA=dY,nB=dY,nC=dY,nK=\"Map.remove_min_elt\",nG=d1,nH=d1,nI=d1,nJ=d1,nL=\"Stdlib.Stack.Empty\",nP=\"Stdlib.Queue.Empty\",nY=\"Buffer.add_substring/add_subbytes\",nW=\"Buffer.add: cannot grow buffer\",nU=\"Buffer.sub\",n5=\"first domain already spawned\",n2=[0,\"domain.ml\",184,13],oe=\"%c\",of=\"%s\",og=k$,oh=ka,oi=lF,oj=k5,ok=\"%f\",ol=\"%B\",om=\"%{\",on=\"%}\",oo=\"%(\",op=\"%)\",oq=\"%a\",or=\"%t\",os=\"%?\",ot=\"%r\",ou=\"%_r\",ov=[0,L,850,23],oG=[0,L,814,21],oy=[0,L,815,21],oH=[0,L,818,21],oz=[0,L,819,21],oI=[0,L,822,19],oA=[0,L,823,19],oJ=[0,L,826,22],oB=[0,L,827,22],oK=[0,L,831,30],oC=[0,L,832,30],oE=[0,L,836,26],ow=[0,L,837,26],oF=[0,L,846,28],ox=[0,L,847,28],oD=[0,L,851,23],pW=[0,L,1558,4],pX=\"Printf: bad conversion %[\",pY=[0,L,1626,39],pZ=[0,L,1649,31],p0=[0,L,1650,31],p1=\"Printf: bad conversion %_\",p2=kl,p3=kI,p4=kl,p5=kI,p9=[0,[11,\"invalid box description \",[3,0,0]],\"invalid box description %S\"],p8=[0,0,4],pR=ga,pP=\"neg_infinity\",pQ=kq,pO=bf,pJ=[0,j5],px=\"%+nd\",py=\"% nd\",pA=\"%+ni\",pB=\"% ni\",pC=\"%nx\",pD=\"%#nx\",pE=\"%nX\",pF=\"%#nX\",pG=\"%no\",pH=\"%#no\",pw=\"%nd\",pz=lF,pI=\"%nu\",pj=\"%+ld\",pk=\"% ld\",pm=\"%+li\",pn=\"% li\",po=\"%lx\",pp=\"%#lx\",pq=\"%lX\",pr=\"%#lX\",ps=\"%lo\",pt=\"%#lo\",pi=\"%ld\",pl=ka,pu=\"%lu\",o7=\"%+Ld\",o8=\"% Ld\",o_=\"%+Li\",o$=\"% Li\",pa=\"%Lx\",pb=\"%#Lx\",pc=\"%LX\",pd=\"%#LX\",pe=\"%Lo\",pf=\"%#Lo\",o6=\"%Ld\",o9=k5,pg=\"%Lu\",oT=\"%+d\",oU=\"% d\",oW=\"%+i\",oX=\"% i\",oY=\"%x\",oZ=\"%#x\",o0=\"%X\",o1=\"%#X\",o2=\"%o\",o3=\"%#o\",oS=f9,oV=k$,o4=kw,n8=\"@]\",n9=\"@}\",n_=\"@?\",n$=\"@\\n\",oa=\"@.\",ob=\"@@\",oc=\"@%\",od=\"@\",oL=\"CamlinternalFormat.Type_mismatch\",qc=e,qd=[0,[11,k3,[2,0,[2,0,0]]],\", %s%s\"],qP=[0,[11,gg,[2,0,[12,10,0]]],kA],qQ=[0,[11,\"Fatal error in uncaught exception handler: exception \",[2,0,[12,10,0]]],\"Fatal error in uncaught exception handler: exception %s\\n\"],qO=\"Fatal error: out of memory in uncaught exception handler\",qL=[0,[11,gg,[2,0,[12,10,0]]],kA],qF=[0,[2,0,[12,10,0]],\"%s\\n\"],qG=[0,[11,kk,0],kk],qu=\"Raised at\",qv=\"Re-raised at\",qw=\"Raised by primitive operation at\",qx=\"Called from\",qy=[0,[12,32,[4,0,0,0,0]],\" %d\"],qC=[0,[11,\"s \",[4,0,0,0,[12,45,[4,0,0,0,0]]]],\"s %d-%d\"],qz=\" (inlined)\",qB=e,qA=[0,[2,0,[12,32,[2,0,[11,' in file \"',[2,0,[12,34,[2,0,[11,\", line\",[2,0,[11,lC,AX]]]]]]]]]],'%s %s in file \"%s\"%s, line%s, characters %d-%d'],qD=[0,[2,0,[11,\" unknown location\",0]],\"%s unknown location\"],qn=\"Out of memory\",qo=\"Stack overflow\",qp=\"Pattern matching failed\",qq=\"Assertion failed\",qr=\"Undefined recursive module\",qf=[0,[12,40,[2,0,[2,0,[12,41,0]]]],\"(%s%s)\"],qg=e,qh=e,qi=[0,[12,40,[2,0,[12,41,0]]],\"(%s)\"],qb=[0,[4,0,0,0,0],f9],p$=[0,[3,0,0],\"%S\"],qa=lx,qI=[0,e,\"(Cannot print locations:\\n bytecode executable program file not found)\",\"(Cannot print locations:\\n bytecode executable program file appears to be corrupt)\",\"(Cannot print locations:\\n bytecode executable program file has wrong magic number)\",\"(Cannot print locations:\\n bytecode executable program file cannot be opened;\\n -- too many open files. Try running with OCAMLRUNPARAM=b=2)\"],qU=\"Fun.Finally_raised: \",qS=\"Stdlib.Fun.Finally_raised\",qV=\"Digest.BLAKE2: wrong hash size\",q6=ao(14371852,15349651,22696),q7=ao(12230193,11438743,35013),q8=ao(1424933,15549263,2083),q9=ao(9492471,4696708,43520),qY=ao(1,0,0),qZ=ao(0,0,0),q2=ao(1,0,0),q0=ao(0,0,0),q1=ao(2,0,0),rf=\"Hashtbl: unsupported hash table format\",q$=e,rX=[3,0,3],rY=bf,rS=kK,rT=\"<\\/\",rU=e,rO=kK,rP=\"<\",rQ=e,rM=\"\\n\",rI=e,rJ=e,rK=e,rL=e,rv=[0,e],rq=e,rr=e,rs=e,rt=e,rm=[0,e,0,e],ri=\"Stdlib.Format.String_tag\",r7=[0,kv,72,5],r8=[0,kv,81,2],r9=\"CamlinternalMod.update_mod: not a module\",r5=\"CamlinternalMod.init_mod: not a module\",r_=\"Jsoo_runtime.Error.Exn\",r$=gf,sd=[0,b,j$,10],sf=[0,b,179,10],sh=[0,b,191,10],sk=[0,b,lE,17],st=[0,b,367,16],su=[0,b,368,18],sv=[0,b,372,15],sw=[0,b,377,15],sx=[0,b,383,15],sy=[0,b,386,10],sz=[0,b,362,16],sA=[0,b,517,12],sB=[0,b,459,14],sM=[0,b,686,27],sL=[0,b,651,27],sF=[0,b,560,16],sC=[0,b,550,23],sD=[0,b,lg,14],ss=[0,b,334,9],so=[0,b,309,9],sn=[0,b,305,9],sm=[0,[11,\"Lwd: unsafe mutation (variable invalidated during evaluation) at\\n\",[15,0]],\"Lwd: unsafe mutation (variable invalidated during evaluation) at\\n%a\"],sj=[0,b,kf,14],sg=[0,b,186,14],se=[0,b,169,14],sc=[0,b,152,14],sG=\"Lwd.Release_failure\",sU=[0,a,64,12],s4=[0,a,bz,21],tb=[0,a,205,18],ta=[0,a,lE,9],td=[0,a,224,18],tc=[0,a,237,9],te=[0,a,240,21],tf=[0,a,aZ,21],tg=[0,a,260,21],ti=[0,a,296,14],tG=[0,a,kF,18],tH=[0,a,557,12],tI=[0,a,546,14],tF=[0,a,538,21],tD=[0,a,531,14],tC=[0,a,523,14],tA=[0,a,492,29],tz=[0,a,kL,29],ty=[0,a,462,21],tt=[0,a,420,10],tu=[0,a,423,15],tv=[0,a,435,10],tw=[0,a,457,2],to=[0,a,371,24],tp=[0,a,391,16],tq=[0,a,394,2],tl=[0,a,315,18],tk=[0,a,317,9],s9=[0,a,193,4],s8=[0,a,kf,21],s6=[0,a,j9,4],s7=[0,a,177,14],s1=[0,a,113,14],sZ=[0,a,kg,14],sX=[0,a,93,14],sV=[0,a,82,21],sT=[0,a,39,4],sS=[0,a,45,21],sQ=[0,a,32,14],t$=[0,Y,lj,12],tW=[0,Y,321,37],tX=[0,Y,322,37],tZ=[0,Y,346,10],t0=[0,Y,358,8],tY=[0,Y,337,37],t2=[0,Y,375,10],t3=[0,Y,384,8],t1=[0,Y,338,37],t6=[0,Y,425,16],t9=[0,Y,513,50],t7=[0,Y,480,6],t5=[0,Y,395,14],tO=[0,Y,j9,57],tP=[0,Y,182,57],tQ=[0,Y,238,11],tJ=kE,tK=kE,uX=\"debug\",uW=\"warn\",uU=k1,uS=\"log\",u1=\"isSecureContext\",vg=[0,kj,233,16],ve=[0,kj,201,16],u$=[0,0,0],u9=[0,0,0],vN=e,vM=e,vC=[0,[0,T,lp],0],vD=[0,[0,T,gk],[0,aJ,0]],vE=[0,[0,T,ge],[0,aJ,0]],vF=[0,[0,T,gp],[0,aJ,0]],vG=[0,[0,T,gd],[0,aJ,0]],vH=[0,[0,T,gy],[0,aJ,0]],vI=[0,[0,T,gh],[0,aJ,0]],vJ=[0,[0,T,gx],[0,aJ,0]],vK=[0,[0,T,lp],[0,aJ,0]],vt=[0,[0,T,gk],0],vu=[0,[0,T,ge],0],vv=[0,lb,0],vw=[0,[0,T,gp],0],vx=[0,[0,T,gd],0],vy=[0,[0,T,gy],0],vz=[0,[0,T,gh],0],vA=[0,aJ,0],vB=[0,[0,T,gx],0],vr=[0,[11,\"\\x1b[\",[4,0,0,0,[12,109,0]]],\"\\x1b[%dm\"],vs=\"CCFormat.ANSI_codes.No_such_style\",vO=\"CCFormat.Style\",v7=[0,0],v8=\"CCFQueue.Empty\",v9=[0,0],wh=\"content-box\",wi=\"border-box\",wj=\"device-pixel-content-box\",ww=ky,wt=[0,[8,[0,0,0],0,0,[11,kP,0]],\"%fpx\"],wu=[0,[8,[0,0,0],0,0,[11,kx,0]],\"%frem\"],wv=[0,[8,[0,0,0],0,0,[11,kp,0]],\"%fem\"],wq=kP,wr=kx,ws=kp,wz=\"Common.Utils.Forward_ref.Not_set\",wB=\"Common.Utils.Forward_ref.Already_set\",wF=[1,[0,3854881,\"Failed to unmarshal data\"]],wH=[1,-358247754],wR=\"TODO not implemented\",wX=[0,80,[0,\"lwdui-controlled-scroll-wrapper\"]],wY=[0,80,\"lwdui-controlled-scroll-controls\"],wZ=\"Show playing\",w3=kc,w1=e,w2=b8,w6=[0,80,b8],w4=[0,[2,0,[11,\"--id\",0]],\"%s--id\"],w8=[0,[2,0,[11,\"-id\",0]],\"%s-id\"],w9=[0,80,k2],xj=[0,[11,kM,[2,0,0]],\"height: %s\"],xf=[0,[2,0,[12,32,[2,0,0]]],\"%s %s\"],xd=\"grid-template-columns\",xe=[0,[2,0,[11,kS,[2,0,[12,59,0]]]],\"%s: %s;\"],xg=e,xk=[1,4.],xp=[0,80,k0],xn=[0,[11,\"height: calc(\",[2,0,[11,\" * \",[4,3,0,0,[11,\");\",0]]]]],\"height: calc(%s * %i);\"],xo=[0,[11,kM,[2,0,[11,\" !important;\",0]]],\"height: %s !important;\"],xq=[0,80,[0,\"lwdui-lazy-table-content\"]],xr=[0,80,[0,\"lwdui-lazy-table-content-wrapper\"]],xs=[0,\"lwdui-lazy-table\",0],xJ=[0,[3,0,[11,\" is not a valid action\",0]],\"%S is not a valid action\"],xB=\"retain\",xC=\"insert\",xD=la,xE=[0,gu,72,22],xw=[0,[0,0,0,0,0,0,0]],xx=[0,gu,49,6],xy=[0,[0,0,[0,[0,0]],0,0,0,0,0,0]],xz=[0,gu,j$,6],xF=[0,[0,0,0,0,0,0,0]],xK=[0,[0,0,[0,[0,0]],0,0,0,0,0,0]],xX=\"color\",xY=bB,x0=bB,xZ=\"user\",ya=\"bcPeers\",yb=\"webrtcPeers\",yc=\"removed\",yd=\"added\",x_=\"status\",x$=lo,ye=\"peers\",x9=\"awareness\",x7=[0,[11,\"stun:\",[2,0,0]],\"stun:%s\"],x5=\"signaling\",x6=[0,\"stun.l.google.com:19302\",[0,\"stun2.l.google.com:19302\",[0,\"stun3.l.google.com:19302\",[0,\"stun4.l.google.com:19302\",0]]]],x8=\"peerOpts\",yq=\"toolbar\",yp=\"cursors\",yo=\"bubble\",yr=\"snow\",yi=kY,yj=\"italic\",yk=\"underline\",yl=\"strike\",ym=\"link\",yD=[0,[11,\"vector length is \",[4,0,0,0,[11,\", but data array has length \",[4,0,0,0,[11,\" (racy access?)\",0]]]]],\"vector length is %d, but data array has length %d (racy access?)\"],yB=[0,[11,\"index \",[4,0,0,0,[11,\" is out of range [0, \",[4,0,0,0,[12,41,0]]]]],\"index %d is out of range [0, %d)\"],yx=[0,[11,\"invalid segment (ofs = \",[4,0,0,0,[11,\", len = \",[4,0,0,0,[11,\") in a sequence of length \",[4,0,0,0,0]]]]]],\"invalid segment (ofs = %d, len = %d) in a sequence of length %d\"],yQ=\"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\",AO=\"tbl\",AP=[0,\"Create new table:\",0],AK=ky,AL=[0,80,[0,dX]],AM=[0,80,[0,k4]],AF=\"Found\",AG=j6,AH=\"1fr\",AI=\"a\",AE=[2,5.],AC=[0,c,848,19],AB=[0,80,\"Add row\"],Au=[0,1],At=\"Add map with id \",Av=[0,1],Ay=e,Az=e,Aw=[0,be,1],Ax=[0,be,0],AA=[0,c,829,18],Aq=[0,c,777,25],Ap=e,Ar=[0,c,769,23],An=lc,Ao=\"Form valid:\",Ag=[0,0,0],Ah=[0,80,\"Add column\"],Ai=[0,[0,cO,\"String\"],[0,[0,d0,\"Checkbox\"],[0,[0,b8,\"Richtext\"],0]]],Aj=[0,gB,cO,0],Ak=[0,0],Al=[0,\"demo\"],Am=[0,1],Ad=\"DELETE ROW\",Ae=j6,Ac=[0,c,689,17],z9=[0,80,[0,go]],z_=[0,[0,0,[0,1,[0,2,0]]]],z$=[0,1],Aa=[0,0],z6=dT,z7=[0,80,[0,go]],z1=lc,z2=\" -> \",z0=[0,0],zY=[0,0],zZ=[0,80,\"Update\"],zU=e,zV=e,zW=[0,80,[0,\"cell-edit-btn\"]],zX=\"\\xe2\\x9c\\x8f\\xef\\xb8\\x8f\",z3=[0,80,[0,\"cell-edit-overlay\"]],z4=[0,80,[0,go]],zF=\"GET\",zE=[0,c,479,17],zD=[0,c,494,11],zI=[0,c,509,19],zH=[0,c,519,13],zG=[0,c,kL,13],zJ=[0,c,526,11],zP=[0,c,lg,19],zO=[0,c,539,19],zK=[0,c,532,13],zM=[0,c,548,15],zN=[0,c,552,15],zL=[0,c,kF,11],zR=e,zS=[0,c,565,17],zQ=[0,c,568,11],zy=bB,zz=ko,zs=\"New column kind:\",zq=[0,c,354,13],zm=d0,zn=b8,zo=dX,zp=cO,zi=\"Old value:\",zj=\"Action: delete\",zk=\"Key:\",zl=[0,c,279,15],zh=\"On_change\",zg=[0,c,204,22],ze=\"[blit v(%i) %i %i v'(%i)]\",zb=[0,c,147,18],y1=lm,y2=\"orange\",y3=lq,y0=\"Received peers\",yZ=\"Received synced\",yY=\"Received connected\",yT=\"modules/cursors\",yU=\"Narines\",yV=[0,[0,\"wss://p2p.u31.fr\",0]],yW=\"testroom5267564\",yX=\"zedoc\",y5=[0,80,[0,\"p2p_status_icon\"]],y7=\"\\xe2\\x99\\xbc\",y_=[0,80,[0,\"p2p_status\"]],zv=bB,zw=ko,AQ=[0,80,\"Add table\"],AT=[0,80,[0,k4]];function\nz(a){if(typeof\na===\"number\")return 0;switch(a[0]){case\n0:return[0,z(a[1])];case\n1:return[1,z(a[1])];case\n2:return[2,z(a[1])];case\n3:return[3,z(a[1])];case\n4:return[4,z(a[1])];case\n5:return[5,z(a[1])];case\n6:return[6,z(a[1])];case\n7:return[7,z(a[1])];case\n8:var\nc=a[1];return[8,c,z(a[2])];case\n9:var\nb=a[1];return[9,b,b,z(a[3])];case\n10:return[10,z(a[1])];case\n11:return[11,z(a[1])];case\n12:return[12,z(a[1])];case\n13:return[13,z(a[1])];default:return[14,z(a[1])]}}function\nX(a,b){if(typeof\na===\"number\")return b;switch(a[0]){case\n0:return[0,X(a[1],b)];case\n1:return[1,X(a[1],b)];case\n2:return[2,X(a[1],b)];case\n3:return[3,X(a[1],b)];case\n4:return[4,X(a[1],b)];case\n5:return[5,X(a[1],b)];case\n6:return[6,X(a[1],b)];case\n7:return[7,X(a[1],b)];case\n8:var\nc=a[1];return[8,c,X(a[2],b)];case\n9:var\nd=a[2],e=a[1];return[9,e,d,X(a[3],b)];case\n10:return[10,X(a[1],b)];case\n11:return[11,X(a[1],b)];case\n12:return[12,X(a[1],b)];case\n13:return[13,X(a[1],b)];default:return[14,X(a[1],b)]}}function\nx(a,b){if(typeof\na===\"number\")return b;switch(a[0]){case\n0:return[0,x(a[1],b)];case\n1:return[1,x(a[1],b)];case\n2:var\nc=a[1];return[2,c,x(a[2],b)];case\n3:var\nd=a[1];return[3,d,x(a[2],b)];case\n4:var\ne=a[3],f=a[2],g=a[1];return[4,g,f,e,x(a[4],b)];case\n5:var\nh=a[3],i=a[2],j=a[1];return[5,j,i,h,x(a[4],b)];case\n6:var\nk=a[3],l=a[2],m=a[1];return[6,m,l,k,x(a[4],b)];case\n7:var\nn=a[3],o=a[2],p=a[1];return[7,p,o,n,x(a[4],b)];case\n8:var\nq=a[3],r=a[2],s=a[1];return[8,s,r,q,x(a[4],b)];case\n9:var\nt=a[1];return[9,t,x(a[2],b)];case\n10:return[10,x(a[1],b)];case\n11:var\nu=a[1];return[11,u,x(a[2],b)];case\n12:var\nv=a[1];return[12,v,x(a[2],b)];case\n13:var\nw=a[2],y=a[1];return[13,y,w,x(a[3],b)];case\n14:var\nz=a[2],A=a[1];return[14,A,z,x(a[3],b)];case\n15:return[15,x(a[1],b)];case\n16:return[16,x(a[1],b)];case\n17:var\nB=a[1];return[17,B,x(a[2],b)];case\n18:var\nC=a[1];return[18,C,x(a[2],b)];case\n19:return[19,x(a[1],b)];case\n20:var\nD=a[2],E=a[1];return[20,E,D,x(a[3],b)];case\n21:var\nF=a[1];return[21,F,x(a[2],b)];case\n22:return[22,x(a[1],b)];case\n23:var\nG=a[1];return[23,G,x(a[2],b)];default:var\nH=a[2],I=a[1];return[24,I,H,x(a[3],b)]}}function\na7(a){throw g([0,cc,a],1)}function\ns(a){throw g([0,cb,a],1)}function\nc2(a){return 0<=a?a:-a|0}var\ng7=kN;function\naO(a,b){return a+b}function\nmt(b){var\ne=n(b);return function(a){var\nc=a;for(;;){if(e<=c)return aO(b,mu);var\nd=D(b,c);a:{if(48<=d){if(58>d)break a}else if(45===d)break a;return b}c=c+1|0}}(0)}function\nmx(a,b,c,d){var\nf=a,e=b,g=c;for(;;){if(!g){f[1+e]=d;return}var\nh=g[2],i=g[1];if(!h){f[1+e]=[0,i,d];return}var\nj=h[2],k=h[1];if(!j){f[1+e]=[0,i,[0,k,d]];return}var\nl=[0,j[1],aL],m=j[2];f[1+e]=[0,i,[0,k,l]];f=l;e=1;g=m}}BR(0);var\nen=l_(1),ai=l_(2);function\nce(a,b){gV(a,b,0,n(b));return}function\ng8(a,b,c,d){if(0<=c&&0<=d&&(n(b)-d|0)>=c)return gV(a,b,c,d);return s(my)}function\ng9(a){ce(ai,a);l$(ai,10);return bK(ai)}var\neo=[0,function(a){return function(a){var\nb=a;for(;;){if(!b)return 0;var\nd=b[2],e=b[1];try{bK(e)}catch(f){var\nc=M(f);if(c[1]!==g6)throw g(c,0)}b=d}}(BS(0))}],g_=[0,function(a){return}];function\nep(a){h(g_[1],0);return h(gF(eo),0)}g0(ll,ep);function\ncf(a){return bK(a)}function\nmo(a){return a^-1}function\nmp(a){return a?mq:mr}function\nms(a){return e+a}function\nmv(a){return mt(gK(\"%.12g\",a))}function\nmw(a,b){if(!a)return b;var\nc=a[2],d=a[1];if(!c)return[0,d,b];var\ne=c[2],f=c[1];if(!e)return[0,d,[0,f,b]];var\ng=[0,e[1],aL];mx(g,1,e[2],b);return[0,d,[0,f,g]]}function\nmz(c){for(;;){var\na=gF(eo);let\nd=[0,1],e=a;var\nb=1-gE(eo,a,function(a){if(gE(d,1,0))h(c,0);return h(e,0)});if(!b)return b}}function\nmA(a,b){l$(a,b);return}var\neq=B3(0),cg=(4*eq|0)-1|0;function\nmB(a){return 1-(typeof\na===\"number\"?1:0)}function\ng$(a,b,c){return gE(a,b,c)}function\nch(a){return gF(a)}function\nci(a){return[0,a]}function\nmC(a,b){return A4(a,b)}var\nmE=[q,mD,ag(0)];function\nmF(a){var\nd=a[1];a[1]=0;try{var\nc=h(d,0);a[1]=c;l7(a);return c}catch(f){var\nb=M(f);a[1]=function(a){throw g(b,0)};BI(a);throw g(b,0)}}function\nmG(a){var\nc=a[1];a[1]=0;var\nb=h(c,0);a[1]=b;l7(a);return b}function\nmH(a,b){if(0===BJ(b))return a?mG(b):mF(b);throw g(mE,1)}function\ner(a){return mH(0,a)}function\nmI(a){var\nb=aN(a);if(b!==aZ&&b!==bg&&b!==bE&&b!==kG)return a;return BH(a)}function\nc3(a){return a?a[1]:s(mJ)}function\ncj(a,b){return b?[0,h(a,b[1])]:0}function\nha(a){return a?1:0}function\nmK(a){return a?[0,a[1],0]:0}function\nmL(a){a:{if(40<=a){if(92===a)return mM;if(gj>a)break a}else{if(32<=a){if(39<=a)return mN;break a}if(14>a)switch(a){case\n8:return mO;case\n9:return mP;case\n10:return mQ;case\n13:return mR}}var\nb=C(4);B(b,0,92);B(b,1,48+(a/gr|0)|0);B(b,2,48+((a/10|0)%10|0)|0);B(b,3,48+(a%10|0)|0);return ej(b)}var\nc=C(1);B(c,0,a);return ej(c)}function\nmS(a){return 25>>0?a:a-32|0}function\nmT(a,b){var\nd=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function\nes(a){return mT(0,a)}function\nbN(a,b){var\nc=a,d=b;for(;;){if(!c)return d;var\ne=[0,c[1],d];c=c[2];d=e}}function\nck(a){return bN(a,0)}function\nmX(a,b,c){if(b>1,s=p(r,b),D=s[1],t=p(a-r|0,s[2]),E=t[2];return[0,B(D,t[1],0),E]}function\np(a,b){if(2===a){if(b){var\nj=b[2];if(j){var\nk=j[1],g=b[1],B=j[2],q=i(d,g,k),C=0===q?[0,g,0]:0>1,s=h(r,b),D=s[1],t=h(a-r|0,s[2]),E=t[2];return[0,A(D,t[1],0),E]}var\na=es(b);return 2<=a?h(a,b)[1]:b}function\nm8(a,b){return l3(a,b)}function\nm9(a,b){return a<=b?a:b}function\nm_(a,b){return b<=a?a:b}function\nm$(a){return e+a}function\nbn(a,b){var\nc=C(a);Bg(c,0,a,b);return c}var\nna=C(0);function\nnb(a){var\nb=au(a),c=C(b);a4(a,0,c,0,b);return c}function\nev(a,b,c){if(0<=b&&0<=c&&(au(a)-c|0)>=b){var\nd=C(c);a4(a,b,d,0,c);return d}return s(nd)}function\new(a,b,c){return ej(ev(a,b,c))}function\nhd(a,b,c,d,e){if(0<=e&&0<=b&&(au(a)-e|0)>=b&&0<=d&&(au(c)-e|0)>=d){a4(a,b,c,d,e);return}return s(ne)}function\nax(a,b,c,d,e){if(0<=e&&0<=b&&(n(a)-e|0)>=b&&0<=d&&(au(c)-e|0)>=d){cT(a,b,c,d,e);return}return s(nf)}function\nhe(a){var\nb=a-9|0;a:{if(4>>0){if(23!==b)break a}else if(2===b)break a;return 1}return 0}function\nni(a,b){var\nd=au(b);if(0===d)return b;var\ne=C(d),f=d-1|0,g=0;if(f>=0){var\nc=g;for(;;){B(e,c,h(a,bG(b,c)));var\ni=c+1|0;if(f===c)break;c=i}}return e}function\nhf(a,b,c){lO(a,b,Bt(c));return}function\nhg(a,b,c){at(a,b,c);return}function\nhh(a,b){return A_(a,b)}function\ncl(a){return bj(a)}function\n$(a){return ej(a)}function\nnc(a){return nb(bj(a))}function\nng(a){var\nd=au(a),b=[0,0];for(;;){if(b[1]>=d)break;if(!he(bG(a,b[1])))break;b[1]++}var\nc=[0,d-1|0];for(;;){if(b[1]<=c[1]&&he(bG(a,c[1]))){c[1]--;continue}return b[1]<=c[1]?ev(a,b[1],(c[1]-b[1]|0)+1|0):na}}function\nnh(a){var\nb=[0,0],j=au(a)-1|0,l=0;if(j>=0){var\ng=l;for(;;){var\ne=bG(a,g);a:{b:{c:{if(32<=e){var\nh=e-34|0;if(58>>0){if(93<=h)break c}else if(56>>0)break b;var\ni=1;break a}if(11<=e){if(13===e)break b}else if(8<=e)break b}var\ni=4;break a}var\ni=2}b[1]=b[1]+i|0;var\no=g+1|0;if(j===g)break;g=o}}if(b[1]===au(a))return a;var\nc=C(b[1]);b[1]=0;var\nk=au(a)-1|0,m=0;if(k>=0){var\nf=m;for(;;){var\nd=bG(a,f);a:{b:{c:{if(35<=d){if(92!==d){if(gj<=d)break c;break b}}else{if(32>d){if(14<=d)break c;switch(d){case\n8:B(c,b[1],92);b[1]++;B(c,b[1],98);break a;case\n9:B(c,b[1],92);b[1]++;B(c,b[1],116);break a;case\n10:B(c,b[1],92);b[1]++;B(c,b[1],110);break a;case\n13:B(c,b[1],92);b[1]++;B(c,b[1],114);break a;default:break c}}if(34>d)break b}B(c,b[1],92);b[1]++;B(c,b[1],d);break a}B(c,b[1],92);b[1]++;B(c,b[1],48+(d/gr|0)|0);b[1]++;B(c,b[1],48+((d/10|0)%10|0)|0);b[1]++;B(c,b[1],48+(d%10|0)|0);break a}B(c,b[1],d)}b[1]++;var\nn=f+1|0;if(k===f)break;f=n}}return c}function\nnj(a){return ni(mS,a)}function\nnk(a,b){return A$(a,b)}function\nnl(a,b,c){lO(a,b,c);return}function\nc5(a,b){return $(bn(a,b))}function\nex(a,b,c){return $(ev(cl(a),b,c))}function\nhi(a){var\nb=a-9|0;a:{if(4>>0){if(23!==b)break a}else if(2===b)break a;return 1}return 0}function\nno(a,b,c,d){var\ne=c;for(;;){if(b<=e)throw g(aD,1);if(_(a,e)===d)return e;e=e+1|0}}function\nnp(a,b,c){var\nd=n(a);if(0<=b&&d>=b)try{no(a,d,b,c);var\nf=1;return f}catch(f){var\ne=M(f);if(e===aD)return 0;throw g(e,0)}return s(nq)}function\ney(a,b){return mg(a,b)}function\nc6(a,b){return nk(cl(a),b)}function\nez(a,b){return a==b?1:0}function\nnm(a){if(a==e)return a;if(!hi(_(a,0))&&!hi(_(a,n(a)-1|0)))return a;return $(ng(cl(a)))}function\nnn(a){return $(nh(cl(a)))}function\nnr(a,b){return np(a,0,b)}function\nns(a){return $(nj(cl(a)))}function\nhj(a,b){if(0===a)return[0];if(0>a)return s(nt);var\nd=ap(a,h(b,0)),e=a-1|0,f=1;if(e>=1){var\nc=f;for(;;){d[1+c]=h(b,c);var\ng=c+1|0;if(e===c)break;c=g}}return d}function\ncm(a,b,c,d,e){if(0<=e&&0<=b&&(a.length-1-e|0)>=b&&0<=d&&(c.length-1-e|0)>=d)return A2(a,b,c,d,e);return s(nw)}function\nhk(a,b){var\nd=b.length-2|0,e=0;if(d>=0){var\nc=e;for(;;){h(a,b[1+c]);var\nf=c+1|0;if(d===c)break;c=f}}return 0}function\nhl(a,b){var\nd=b.length-1;if(0===d)return[0];var\ne=ap(d,h(a,b[1])),f=d-1|0,g=1;if(f>=1){var\nc=g;for(;;){e[1+c]=h(a,b[1+c]);var\ni=c+1|0;if(f===c)break;c=i}}return e}function\nnx(a,b){var\nd=a,c=b;for(;;){if(!c)return d;d=d+1|0;c=c[2]}}function\nc7(a){if(!a)return[0];var\nb=a[2],c=a[1],e=ap(nx(0,a),c);return function(a,b){var\nd=a,c=b;for(;;){if(!c)return e;var\nf=c[2];e[1+d]=c[1];d=d+1|0;c=f}}(1,b)}function\nnu(a,b,c){if(0<=b&&0<=c&&(a.length-1-c|0)>=b)return A3(a,b,c);return s(nv)}function\nny(k){function\nj(a){return a?a[4]:0}function\nd(a,b,c){var\nd=a?a[4]:0,e=c?c[4]:0,f=e<=d?d+1|0:e+1|0;return[0,a,b,c,f]}function\nl(a,b,c){var\ng=a?a[4]:0,h=c?c[4]:0;if((h+2|0)=h){var\nw=h<=g?g+1|0:h+1|0;return[0,a,b,c,w]}if(!c)return s(nC);var\nk=c[3],m=c[2],f=c[1],r=j(f);if(r<=j(k))return d(d(a,b,f),m,k);if(!f)return s(nB);var\nt=f[2],u=f[1],v=d(f[3],m,k);return d(d(a,b,u),t,v)}function\nc(a,b){if(!b)return[0,0,a,0,1];var\nd=b[3],e=b[2],f=b[1],g=i(k[1],a,e);if(0===g)return b;if(0<=g){var\nh=c(a,d);return d===h?b:l(f,e,h)}var\nj=c(a,f);return f===j?b:l(j,e,d)}function\nb(a){return[0,0,a,0,1]}var\nm=0;function\ne(a,b){var\nc=b;for(;;){if(!c)return;var\nd=c[3],f=c[2];e(a,c[1]);h(a,f);c=d}}function\nn(a,b){var\nd=a,c=b;for(;;){if(!c)return d;var\ne=c[2],f=c[1];d=[0,e,n(d,c[3])];c=f}}function\no(a,b,c){var\nd=c;for(;;){if(!d)return;var\ne=d[3],f=d[1];d=h(b,d[2])?e:f}}function\np(a){function\nc(a,b){if(3>=a>>>0)switch(a){case\n0:return[0,0,b];case\n1:if(b)return[0,[0,0,b[1],0,1],b[2]];break;case\n2:if(b){var\nh=b[2];if(h)return[0,[0,[0,0,b[1],0,1],h[1],0,2],h[2]]}break;default:if(b){var\ni=b[2];if(i){var\nj=i[2];if(j)return[0,[0,[0,0,b[1],0,1],i[1],[0,0,j[1],0,1],2],j[2]]}}}var\nk=a/2|0,l=c(k,b),e=l[2],n=l[1];if(!e)throw g([0,f,nD],1);var\no=e[1],m=c((a-k|0)-1|0,e[2]),p=m[2];return[0,d(n,o,m[1]),p]}return c(es(a),a)[1]}return[0,,,,c,,,,,,,,,,,,,m,,,,,,,,,,,,,,e,,,,,,,,function(a){return n(0,a)},,,,,,,,,,,function(a,b){var\nc=b;for(;;){if(!c)return;var\nd=c[2],e=c[3],f=c[1];if(h(a,d))return o(d,a,e);c=f}},,,,,,,,function(a){if(!a)return m;var\nf=a[2],d=a[1];if(!f)return b(d);var\ng=f[2],e=f[1];if(!g)return c(e,b(d));var\nh=g[2],i=g[1];if(!h)return c(i,c(e,b(d)));var\nj=h[2],l=h[1];if(!j)return c(l,c(i,c(e,b(d))));if(j[2])return p(m7(k[1],a));var\nn=j[1];return c(n,c(l,c(i,c(e,b(d)))))}]}function\nnE(a){var\nb=ny(a);return[0,b[17],b[4],,,,,,,,b[39],,,,,,,,,,,,b[50],b[31],,,,,,,,,,,,,,,b[58]]}function\nnF(f){function\nh(a){return a?a[5]:0}function\ne(a,b,c,d){var\ne=h(a),f=h(d),g=f<=e?e+1|0:f+1|0;return[0,a,b,c,d,g]}function\nd(a,b,c,d){var\ni=a?a[5]:0,j=d?d[5]:0;if((j+2|0)=j){var\nB=j<=i?i+1|0:j+1|0;return[0,a,b,c,d,B]}if(!d)return s(nJ);var\nl=d[4],o=d[3],p=d[2],g=d[1],w=h(g);if(w<=h(l))return e(e(a,b,c,g),p,o,l);if(!g)return s(nI);var\nx=g[3],y=g[2],z=g[1],A=e(g[4],p,o,l);return e(e(a,b,c,z),y,x,A)}function\nj(a,b,c){if(!c)return[0,0,a,b,0,1];var\ne=c[4],h=c[3],k=c[2],g=c[1],o=c[5],l=i(f[1],a,k);if(0===l)return h===b?c:[0,g,a,b,e,o];if(0<=l){var\nm=j(a,b,e);return e===m?c:d(g,k,h,m)}var\nn=j(a,b,g);return g===n?c:d(n,k,h,e)}function\nn(a){var\nb=a;for(;;){if(!b)throw g(aD,1);var\nc=b[1];if(!c)return[0,b[2],b[3]];b=c}}function\nc(a){if(!a)return s(nK);var\nb=a[1];if(!b)return a[4];var\ne=a[4],f=a[3],g=a[2];return d(c(b),g,f,e)}function\no(a,b){if(!a)return b;if(!b)return a;var\ne=n(b),f=e[2],g=e[1];return d(a,g,f,c(b))}function\nk(a,b){if(!b)return 0;var\nc=b[4],h=b[3],g=b[2],e=b[1],j=i(f[1],a,g);if(0===j)return o(e,c);if(0<=j){var\nl=k(a,c);return c===l?b:d(e,g,h,l)}var\nm=k(a,e);return e===m?b:d(m,g,h,c)}function\nl(a,b){var\nc=b;for(;;){if(!c)return 0;var\nd=c[4],e=c[3],f=c[2];l(a,c[1]);i(a,f,e);c=d}}function\nm(a,b,c){var\nd=b,e=c;for(;;){if(!d)return e;var\nf=d[4],g=d[3],h=d[2],i=y(a,h,g,m(a,d[1],e));d=f;e=i}}return[0,,,,,0,,j,function(a,b){var\nc=b;for(;;){if(!c)throw g(aD,1);var\ne=c[4],h=c[3],j=c[1],d=i(f[1],a,c[2]);if(0===d)return h;var\nk=0<=d?e:j;c=k}},,,,,,,,,function(a,b){var\nc=b;for(;;){if(!c)return 0;var\ne=c[4],g=c[3],h=c[1],d=i(f[1],a,c[2]);if(0===d)return[0,g];var\nj=0<=d?e:h;c=j}},,,,,,,k,,,l,,,m]}function\neA(a){var\nb=nF(a);return[0,b[5],b[7],,,,b[24],,,,,,,,,,,b[8],b[17],,,,,b[27],b[30]]}var\neB=[q,nL,ag(0)];function\nbO(a){return[0,0,0]}function\ncn(a){a[1]=0;a[2]=0;return}function\na9(a,b){b[1]=[0,a,b[1]];b[2]=b[2]+1|0;return 0}function\nbP(a){var\nb=a[1];if(!b)return 0;var\nc=b[1];a[1]=b[2];a[2]=a[2]-1|0;return[0,c]}function\nbQ(a){var\nb=a[1];return b?[0,b[1]]:0}function\nnM(a){var\nb=a[1];if(!b)throw g(eB,1);a[1]=b[2];a[2]=a[2]-1|0;return}function\nnN(a){if(a[1])return;throw g(eB,1)}function\nnO(a,b){return a8(a,b[1])}var\nnQ=[q,nP,ag(0)];function\neC(a){return[0,0,0,0]}function\neD(a){a[1]=0;a[2]=0;a[3]=0;return}function\neE(a,b){var\nc=[0,a,0],d=b[3];return d?(b[1]=b[1]+1|0,d[2]=c,b[3]=c,0):(b[1]=1,b[2]=c,b[3]=c,0)}function\nhm(a){var\nb=a[2];if(!b)throw g(nQ,1);var\nc=b[1];if(b[2]){var\nd=b[2];a[1]=a[1]-1|0;a[2]=d;return c}eD(a);return c}function\neF(a){return 0===a[1]?1:0}function\nnR(a){var\nb=a[2];return b?[0,b[1]]:0}function\nnS(a){var\nb=a[2];if(!b)return 0;var\nc=b[1];if(b[2]){var\nd=b[2];a[1]=a[1]-1|0;a[2]=d;return[0,c]}eD(a);return[0,c]}function\nbo(a){var\nb=1<=a?a:1,c=cg=(d+b|0))break;c[1]=2*c[1]|0}if(cg=b)return ew(a[1][1],b,c);return s(nU)}function\nnV(a){a[2]=0;return 0}function\nnX(a,b){var\nc=a[2],d=a[1],e=d[1];if(d[2]<=c){eG(a,1);at(a[1][1],a[2],b)}else\nB(e,c,b);a[2]=c+1|0;return}var\neH=[0,0];function\nhp(a){return a}function\nhq(a){return a!==eH?1:0}function\nhr(a){return a}(function(a){Be(ap(8,eH));return}(0));var\nnZ=ci(0),hs=ci(0);function\nn0(a){for(;;){var\nb=ch(hs),c=1-g$(hs,b,[0,a,b]);if(!c)return c}}function\naP(a,b){var\nc=[0,mC(nZ,1),b];if(a)n0([0,c,a[1]]);return c}function\nht(d){for(;;){var\na=lR(0),b=a.length-1;if(de){if(32!==e){if(43>e)break a;switch(e-43|0){case\n5:c:if(c<(d+2|0)&&1=(d+1|0))break a;var\nf=bn(d+1|0,48);at(f,0,e);ax(b,1,f,(d-c|0)+2|0,c-1|0);return $(f)}if(71<=e){if(5>>0)break a}else if(65>e)break a}if(ca)return b;var\nh=[0,0],i=n(b)-1|0,o=0;if(i>=0){var\nd=o;for(;;){if(9>=_(b,d)+lr>>>0)h[1]++;var\nr=d+1|0;if(i===d)break;d=r}}var\nj=h[1],k=C(n(b)+((j-1|0)/3|0)|0),l=[0,0];function\ne(a){at(k,l[1],a);l[1]++;return}var\nf=[0,((j-1|0)%3|0)+1|0],m=n(b)-1|0,p=0;if(m>=0){var\nc=p;for(;;){var\ng=_(b,c);if(9>>0)e(g);else{if(0===f[1]){e(95);f[1]=3}f[1]--;e(g)}var\nq=c+1|0;if(m===c)break;c=q}}return $(k)}function\npK(a,b){return c9(a,ec(oR(a),b))}function\npL(a,b){return c9(a,ec(ph(a),b))}function\npM(a,b){return c9(a,ec(pv(a),b))}function\npN(a,b){return c9(a,Bw(o5(a),b))}function\naQ(d,b,c){function\na(a){switch(d[1]){case\n0:var\ne=45;break;case\n1:var\ne=43;break;default:var\ne=32}return Br(c,b,e)}function\ne(a){var\nb=Ba(c);return 3===b?c<0.?pP:pQ:4<=b?pR:a}function\nf(b){var\ne=n(b);return function(a){var\nc=a;for(;;){if(c===e)return 0;var\nd=D(b,c)-46|0;a:{if(23>>0){if(55===d)break a}else if(21>>0)break a;c=c+1|0;continue}return 1}}(0)?b:aO(b,pO)}switch(d[2]){case\n5:return e(f(gK(hz(d,b),c)));case\n6:return a(0);case\n7:return ns(a(0));case\n8:return e(a(0));default:return gK(hz(d,b),c)}}function\npS(a){var\nb=mL(a),c=n(b),d=bn(c+2|0,39);cT(b,0,d,1,c);return $(d)}function\npT(a){var\nb=hv(16);eK(b,a);return hx(b)}function\ncJ(a,b,c,d){var\nk=b,j=c,e=d;for(;;){if(typeof\ne===\"number\")return h(k,j);switch(e[0]){case\n0:var\nt=e[1];return function(a){return o(k,[5,j,a],t)};case\n1:var\nu=e[1];return function(a){return o(k,[4,j,pS(a)],u)};case\n2:return eL(k,j,e[2],e[1],function(a){return a});case\n3:return eL(k,j,e[2],e[1],oQ);case\n4:return c_(k,j,e[4],e[2],e[3],pK,e[1]);case\n5:return c_(k,j,e[4],e[2],e[3],pL,e[1]);case\n6:return c_(k,j,e[4],e[2],e[3],pM,e[1]);case\n7:return c_(k,j,e[4],e[2],e[3],pN,e[1]);case\n8:return pU(k,j,e[4],e[2],e[3],e[1]);case\n9:return eL(k,j,e[2],e[1],mp);case\n10:j=[7,j];e=e[1];break;case\n11:j=[2,j,e[1]];e=e[2];break;case\n12:j=[3,j,e[1]];e=e[2];break;case\n13:var\nv=e[3],w=pT(e[2]);return function(a){return o(k,[4,j,w],v)};case\n14:var\ny=e[3],z=e[2];return function(a){return o(k,j,x(oP(a[1],z),y))};case\n15:var\nA=e[1];return function(c,b){return o(k,[6,j,function(a){return i(c,a,b)}],A)};case\n16:var\nB=e[1];return function(a){return o(k,[6,j,a],B)};case\n17:j=[0,j,e[1]];e=e[2];break;case\n18:var\nl=e[1];if(0===l[0]){let\nb=j,c=k,d=e[2];k=function(a){return o(c,[1,b,[0,a]],d)};j=0;e=l[1][1]}else{let\nb=j,c=k,d=e[2];k=function(a){return o(c,[1,b,[1,a]],d)};j=0;e=l[1][1]}break;case\n19:throw g([0,f,pW],1);case\n20:var\nC=e[3],D=[8,j,pX];return function(a){return o(k,D,C)};case\n21:var\nE=e[2];return function(a){return o(k,[4,j,ec(kw,a)],E)};case\n22:var\nF=e[1];return function(a){return o(k,[5,j,a],F)};case\n23:var\nm=e[2],n=e[1];return a<50?j1(a+1|0,k,j,n,m):r(j1,[0,k,j,n,m]);default:var\np=e[3],q=e[1],s=h(e[2],0);return a<50?f2(a+1|0,k,j,p,q,s):r(f2,[0,k,j,p,q,s])}}}function\no(a,b,c){return bM(cJ(0,a,b,c))}function\nj1(a,b,c,d,e){if(typeof\nd===\"number\")switch(d){case\n0:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n1:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n2:throw g([0,f,pY],1);default:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e])}switch(d[0]){case\n0:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n1:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n2:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n3:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n4:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n5:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n6:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n7:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n8:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);case\n9:var\nh=d[2];return a<50?f3(a+1|0,b,c,h,e):r(f3,[0,b,c,h,e]);case\n10:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e]);default:return a<50?t(a+1|0,b,c,e):r(t,[0,b,c,e])}}function\nf3(a,h,c,d,e){if(typeof\nd===\"number\")return a<50?t(a+1|0,h,c,e):r(t,[0,h,c,e]);switch(d[0]){case\n0:var\nb=d[1];return function(a){return aj(h,c,b,e)};case\n1:var\ni=d[1];return function(a){return aj(h,c,i,e)};case\n2:var\nj=d[1];return function(a){return aj(h,c,j,e)};case\n3:var\nk=d[1];return function(a){return aj(h,c,k,e)};case\n4:var\nl=d[1];return function(a){return aj(h,c,l,e)};case\n5:var\nm=d[1];return function(a){return aj(h,c,m,e)};case\n6:var\nn=d[1];return function(a){return aj(h,c,n,e)};case\n7:var\no=d[1];return function(a){return aj(h,c,o,e)};case\n8:var\np=d[2];return function(a){return aj(h,c,p,e)};case\n9:var\nq=d[3],s=d[2],u=I(E(d[1]),s);return function(a){return aj(h,c,X(u,q),e)};case\n10:var\nv=d[1];return function(a,b){return aj(h,c,v,e)};case\n11:var\nw=d[1];return function(a){return aj(h,c,w,e)};case\n12:var\nx=d[1];return function(a){return aj(h,c,x,e)};case\n13:throw g([0,f,pZ],1);default:throw g([0,f,p0],1)}}function\naj(a,b,c,d){return bM(f3(0,a,b,c,d))}function\nt(a,b,c,d){var\ne=[8,c,p1];return a<50?cJ(a+1|0,b,e,d):r(cJ,[0,b,e,d])}function\neL(g,f,c,d,e){if(typeof\nd===\"number\")return function(a){return o(g,[4,f,h(e,a)],c)};if(0===d[0]){var\nb=d[2],i=d[1];return function(a){return o(g,[4,f,ad(i,b,h(e,a))],c)}}var\nj=d[1];return function(a,b){return o(g,[4,f,ad(j,a,h(e,b))],c)}}function\nc_(k,j,h,d,e,f,g){if(typeof\nd===\"number\"){if(typeof\ne===\"number\")return e?function(a,b){return o(k,[4,j,bS(a,i(f,g,b))],h)}:function(a){return o(k,[4,j,i(f,g,a)],h)};var\nb=e[1];return function(a){return o(k,[4,j,bS(b,i(f,g,a))],h)}}if(0===d[0]){var\nc=d[2],l=d[1];if(typeof\ne===\"number\")return e?function(a,b){return o(k,[4,j,ad(l,c,bS(a,i(f,g,b)))],h)}:function(a){return o(k,[4,j,ad(l,c,i(f,g,a))],h)};var\nn=e[1];return function(a){return o(k,[4,j,ad(l,c,bS(n,i(f,g,a)))],h)}}var\nm=d[1];if(typeof\ne===\"number\")return e?function(a,b,c){return o(k,[4,j,ad(m,a,bS(b,i(f,g,c)))],h)}:function(a,b){return o(k,[4,j,ad(m,a,i(f,g,b))],h)};var\np=e[1];return function(a,b){return o(k,[4,j,ad(m,a,bS(p,i(f,g,b)))],h)}}function\npU(i,h,g,d,e,f){if(typeof\nd===\"number\"){if(typeof\ne===\"number\")return e?function(a,b){return o(i,[4,h,aQ(f,a,b)],g)}:function(a){return o(i,[4,h,aQ(f,eJ(f),a)],g)};var\nb=e[1];return function(a){return o(i,[4,h,aQ(f,b,a)],g)}}if(0===d[0]){var\nc=d[2],j=d[1];if(typeof\ne===\"number\")return e?function(a,b){return o(i,[4,h,ad(j,c,aQ(f,a,b))],g)}:function(a){return o(i,[4,h,ad(j,c,aQ(f,eJ(f),a))],g)};var\nl=e[1];return function(a){return o(i,[4,h,ad(j,c,aQ(f,l,a))],g)}}var\nk=d[1];if(typeof\ne===\"number\")return e?function(a,b,c){return o(i,[4,h,ad(k,a,aQ(f,b,c))],g)}:function(a,b){return o(i,[4,h,ad(k,a,aQ(f,eJ(f),b))],g)};var\nm=e[1];return function(a,b){return o(i,[4,h,ad(k,a,aQ(f,m,b))],g)}}function\nf2(a,b,c,d,e,f){if(e){var\ni=e[1];return function(a){return pV(b,c,d,i,h(f,a))}}var\ng=[4,c,f];return a<50?cJ(a+1|0,b,g,d):r(cJ,[0,b,g,d])}function\npV(a,b,c,d,e){return bM(f2(0,a,b,c,d,e))}function\naR(a,b){var\nc=b;for(;;){if(typeof\nc===\"number\")return;switch(c[0]){case\n0:var\nf=c[1],g=hy(c[2]);aR(a,f);return ce(a,g);case\n1:var\nd=c[2],e=c[1];if(0===d[0]){var\ni=d[1];aR(a,e);ce(a,p2);c=i}else{var\nj=d[1];aR(a,e);ce(a,p3);c=j}break;case\n6:var\nm=c[2];aR(a,c[1]);return h(m,a);case\n7:aR(a,c[1]);return cf(a);case\n8:var\nn=c[2];aR(a,c[1]);return s(n);case\n2:case\n4:var\nk=c[2];aR(a,c[1]);return ce(a,k);default:var\nl=c[2];aR(a,c[1]);return mA(a,l)}}}function\naS(a,b){var\nc=b;for(;;){if(typeof\nc===\"number\")return;switch(c[0]){case\n0:var\nf=c[1],g=hy(c[2]);aS(a,f);return cp(a,g);case\n1:var\nd=c[2],e=c[1];if(0===d[0]){var\ni=d[1];aS(a,e);cp(a,p4);c=i}else{var\nj=d[1];aS(a,e);cp(a,p5);c=j}break;case\n6:var\nm=c[2];aS(a,c[1]);return cp(a,h(m,0));case\n7:c=c[1];break;case\n8:var\nn=c[2];aS(a,c[1]);return s(n);case\n2:case\n4:var\nk=c[2];aS(a,c[1]);return cp(a,k);default:var\nl=c[2];aS(a,c[1]);return nX(a,l)}}}function\np6(a){var\nc=a[1],b=bo(cM);return o(function(a){aS(b,a);return a7(co(b))},0,c)}function\np7(c){if(c==e)return p8;var\nf=n(c);function\nj(a){return h(p6(p9),c)}function\nk(a){var\nb=a;for(;;){if(b===f)return b;var\nd=D(c,b);if(9!==d&&32!==d)return b;b=b+1|0}}var\ni=k(0),o=function(a,b){var\nd=b;for(;;){if(d===f)return d;if(25>>0)return d;d=d+1|0}}(i,i),a=ex(c,i,o-i|0),d=k(o),l=function(a,b){var\nd=b;for(;;){if(d===f)return d;var\ne=D(c,d);a:{if(48<=e){if(58>e)break a}else if(45===e)break a;return d}d=d+1|0}}(d,d);if(d===l)var\nm=0;else\ntry{var\nr=l4(ex(c,d,l-d|0)),m=r}catch(f){var\np=M(f);if(p[1]!==cc)throw g(p,0);var\nq=j(0),m=q}if(k(l)!==f)j(0);a:{if(a!==e&&a!==j_){if(a===\"h\"){var\nb=0;break a}if(a===\"hov\"){var\nb=3;break a}if(a===\"hv\"){var\nb=2;break a}if(a!==\"v\"){var\nb=j(0);break a}var\nb=1;break a}var\nb=4}return[0,m,b]}function\np_(d,b,c){return o(function(a){aR(b,a);return h(d,b)},0,c[1])}function\nc$(a,b){return p_(function(a){return 0},a,b)}function\neM(a){return c$(ai,a)}function\neN(c,b){return o(function(a){var\nb=bo(64);aS(b,a);return h(c,co(b))},0,b[1])}function\nA(a){return eN(function(a){return a},a)}var\neO=ci(0);function\neQ(a,b){var\nc=a[1+b];return mB(c)?aN(c)===d3?h(A(p$),c):aN(c)===kG?mv(c):qa:h(A(qb),c)}function\nhA(a,b){if(a.length-1<=b)return qc;var\nc=hA(a,b+1|0),d=eQ(a,b);return i(A(qd),d,c)}function\nqe(a){var\nb=a.length-1;if(2>=b>>>0)switch(b){case\n0:return qg;case\n1:return qh;default:var\ne=eQ(a,1);return h(A(qi),e)}var\nc=hA(a,2),d=eQ(a,1);return i(A(qf),d,c)}function\nqj(d){return function(a){var\nb=a;for(;;){if(!b)return 0;var\ne=b[2],f=b[1];a:{try{var\nc=h(f,d)}catch(f){break a}if(c)return[0,c[1]]}b=e}}(ch(eO))}function\nqk(a){if(0!==aN(a))return[0,a[1],0];var\nb=a[1][1];return[0,b,[0,qe(a)]]}function\nql(a){var\nb=qk(a),c=b[2],d=b[1];return c?aO(d,c[1]):d}function\nqm(a){if(a===em)return qn;if(a===g5)return qo;if(a[1]===g4){var\nb=a[2],e=b[3],i=b[2],j=b[1];return f6(A(eP),j,i,e,e+5|0,qp)}if(a[1]===f){var\nc=a[2],g=c[3],k=c[2],l=c[1];return f6(A(eP),l,k,g,g+6|0,qq)}if(a[1]!==cd)return ql(a);var\nd=a[2],h=d[3],m=d[2],n=d[1];return f6(A(eP),n,m,h,h+6|0,qr)}function\nda(a){var\nb=qj(a);return b?b[1]:qm(a)}function\nqs(a){var\nb=[0,Bb(a)];return b}function\nqt(c,b){function\na(a){return a?0===c?qu:qv:0===c?qw:qx}if(0!==b[0]){if(b[1])return 0;var\np=a(0);return[0,h(A(qD),p)]}if(b[3]===b[6])var\ne=b[3],d=h(A(qy),e);else\nvar\nn=b[6],o=b[3],d=i(A(qC),o,n);var\nf=b[7],g=b[4],j=b[8]?qz:qB,k=b[2],l=b[9],m=a(b[1]);return[0,AY(A(qA),m,l,k,j,d,g,f)]}function\nqE(a,b){if(!b)return c$(a,qG);var\nd=b[1],e=d.length-2|0,g=0;if(e>=0){var\nc=g;for(;;){var\nf=qt(c,j(d,c)[1+c]);if(f){var\ni=f[1];h(c$(a,qF),i)}var\nk=c+1|0;if(e===c)break;c=k}}return 0}function\ndb(a,b){return qE(a,qs(b))}var\nqJ=qI.slice();function\nqK(a,b){var\ne=da(a);h(eM(qL),e);db(ai,b);var\nc=BQ(0);if(c<0){var\nd=c2(c);g9(j(qJ,d)[1+d])}return cf(ai)}var\nqM=[0];function\nhB(a){var\nb=lU(0);return b}function\nqN(a,b){try{var\nd=b?qM:hB(0);try{ep(0)}catch(f){}try{var\nf=qK(a,d),e=f}catch(f){var\ni=M(f),j=hB(0),k=da(a);h(eM(qP),k);db(ai,d);var\nl=da(i);h(eM(qQ),l);db(ai,j);var\ne=cf(ai)}return e}catch(f){var\nc=M(f);if(c===em)return g9(qO);throw g(c,0)}}g0(lz,function(a,b){try{var\nc=qN(a,b);return c}catch(f){return 0}});function\nqH(a){for(;;){var\nb=ch(eO),c=1-g$(eO,b,[0,a,b]);if(!c)return c}}function\nqR(a){return lU(a)}var\nqT=[q,qS,ag(0)];qH(function(a){return a[1]===qT?[0,aO(qU,da(a[2]))]:0});function\neR(a){var\nb=a[1]<1?1:0,c=b||(64=0){var\nc=i;for(;;){nl(d,c*8|0,cY(j(b,c)[1+c]));var\nn=c+1|0;if(f===c)break;c=n}}at(d,e*8|0,1);var\ng=hC(d);at(d,e*8|0,2);var\nh=hC(d),k=c6(h,8),l=c6(h,0),m=c6(g,8);return hE(a,c6(g,0),m,l,k)}function\nq4(a){var\nb=hD(0);q3(b,a);return b}function\nhG(a){return q4(B5(0))}function\nbT(a){return l8(a)}function\nq5(a){return l2(l8(a))&1073741823}aP([0,function(a){var\nb=bT(a),c=bT(a),d=bT(a);return hF(b,c,d,bT(a))}],function(a){return hF(q9,q8,q7,q6)});function\nq_(a){var\nb=a.length-1<4?1:0,c=b||(a[4]<0?1:0);return c}try{var\nAW=mh(lu),hK=AW}catch(f){var\nhH=M(f);if(hH!==aD)throw g(hH,0);try{var\nAV=mh(\"CAMLRUNPARAM\"),hJ=AV}catch(f){var\nhI=M(f);if(hI!==aD)throw g(hI,0);var\nhJ=q$}var\nhK=hJ}var\nra=ci(nr(hK,82)),rb=aP(0,hG);function\nrc(a,b){var\nc=a;for(;;){if(b<=c)return c;if(eq<(c*2|0))return c;c=c*2|0}}function\nhL(a,b){var\nd=a?a[1]:ch(ra),c=rc(16,b),e=d?q5(a_(rb)):0;return[0,0,ap(c,0),e,c]}function\nrd(m,b,c,d){var\ng=d.length-1,f=ap(g,0),i=c.length-2|0;function\nn(a){var\nc=a;for(;;){if(!c)return;var\ni=c[1],l=c[2],n=c[3],g=b?c:[0,i,l,0],e=h(m,i),k=j(f,e)[1+e];if(k)k[3]=g;else\nj(d,e)[1+e]=g;j(f,e)[1+e]=g;c=n}}var\no=0;if(i>=0){var\ne=o;for(;;){n(j(c,e)[1+e]);var\nr=e+1|0;if(i===e)break;e=r}}if(b){var\nk=g-1|0,p=0;if(k>=0){var\na=p;for(;;){var\nl=j(f,a)[1+a];if(l)l[3]=0;var\nq=a+1|0;if(k===a)break;a=q}}}return}function\nre(a,b){var\nc=b[2],d=(c.length-1)*2|0,e=d>>0)return;return hS(a,d)}function\nro(a){var\nb=nS(a[28]);if(!b)return;var\nc=b[1],d=c[1];a[12]=a[12]-c[3]|0;var\ne=aq(d);a[9]=a[9]+e|0;return}function\nrp(a,b,c){if(typeof\nc===\"number\")switch(c){case\n0:var\nj=bQ(a[3]);if(!j)return;var\nk=j[1][1],l=function(a,b){if(!b)return[0,a,0];var\nc=b[1],d=b[2];return BK(a,c)?[0,a,b]:[0,c,l(a,d)]};k[1]=l(a[6]-a[9]|0,k[1]);return;case\n1:bP(a[2]);return;case\n2:bP(a[3]);return;case\n3:var\nm=bQ(a[2]);return m?hS(a,m[1][2]):dd(a);case\n4:var\no=a[10]!==(a[6]-a[9]|0)?1:0;return o?ro(a):o;default:var\np=bP(a[5]);if(p)return eT(a,h(a[25],p[1]));return}switch(c[0]){case\n0:return hR(a,b,c[1]);case\n1:var\nd=c[2],f=c[1],q=d[1],z=d[2],r=bQ(a[2]);if(!r)return;var\ns=r[1],e=s[2];switch(s[1]){case\n0:return bU(a,f);case\n1:return bp(a,d,e);case\n2:return bp(a,d,e);case\n3:return a[9]<(b+n(q)|0)?bp(a,d,e):bU(a,f);case\n4:return a[11]?bU(a,f):a[9]<(b+n(q)|0)?bp(a,d,e):((a[6]-e|0)+z|0)=a[14]){a[13]=hQ;hT(a);if(b)dd(a);return rB(a)}hY(a,0)}}function\neW(a,b,c){var\nd=a[14]=c)return y(a[17],h4,0,c);y(a[17],h4,0,80);c=c-80|0}}function\nrN(a){return a[1]===cs?aO(rP,aO(a[2],rO)):rQ}function\nrR(a){return a[1]===cs?aO(rT,aO(a[2],rS)):rU}function\nrV(a){return 0}function\nrW(a){return 0}function\neY(a,b,c,d,e){var\ng=eC(0),h=[0,hO,rX,0];eE(h,g);var\nf=bO(0);eU(f);a9([0,1,h],f);var\ni=78,j=bO(0),k=bO(0),l=bO(0);return[0,f,bO(0),l,k,j,i,10,68,i,0,1,1,1,1,g7,rY,a,b,c,d,e,0,0,rN,rR,rV,rW,g]}function\nh5(a,b){var\nc=eY(a,b,function(a){return 0},function(a){return 0},function(a){return 0});c[19]=function(a){return eX(c,a)};c[20]=function(a){return bV(c,a)};c[21]=function(a){return bV(c,a)};return c}function\nh6(d){return h5(function(a,b,c){return g8(d,a,b,c)},function(a){return cf(d)})}function\ndf(d){return h5(function(a,b,c){return ho(d,a,b,c)},function(a){return 0})}var\neZ=dW;function\nh7(a){return bo(eZ)}var\nh8=h7(0),e0=h6(en),e1=h6(ai),rZ=df(h8),h9=aP(0,h7);cq(h9,h8);cq(aP(0,function(a){return df(a_(h9))}),rZ);function\ndg(a,b,c,d){return ho(a_(a),b,c,d)}function\ndh(a,b,c){var\nd=a_(b),e=hn(d);g8(a,co(d),0,e);cf(a);return nV(d)}var\ndi=aP(0,function(a){return bo(eZ)}),dj=aP(0,function(a){return bo(eZ)}),h_=aP(0,function(a){var\nb=eY(function(a,b,c){return dg(di,a,b,c)},function(a){return dh(en,di,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return eX(b,a)};b[20]=function(a){return bV(b,a)};b[21]=function(a){return bV(b,a)};hu(function(a){return a$(b,a)});return b});cq(h_,e0);var\nh$=aP(0,function(a){var\nb=eY(function(a,b,c){return dg(dj,a,b,c)},function(a){return dh(ai,dj,a)},function(a){return 0},function(a){return 0},function(a){return 0});b[19]=function(a){return eX(b,a)};b[20]=function(a){return bV(b,a)};b[21]=function(a){return bV(b,a)};hu(function(a){return a$(b,a)});return b});cq(h$,e1);function\nrx(a,b){if(a[22]){a9(b,a[4]);h(a[26],b)}var\nc=a[23];return c?ct(a,[0,dc,[5,b],0]):c}function\nrD(a,b){return h1(a,n(b),b)}function\nrE(a,b){h0(a,1);return h(a[18],0)}function\nrF(a,b){var\nc=a[14]=0){var\nc=g;for(;;){r4(e,c,a,j(b,c)[1+c]);var\nh=c+1|0;if(f===c)break;c=h}}return e}function\nid(a,b){if(typeof\nb!==\"number\"&&0===b[0])return ic(a,b[1]);return a7(r5)}function\nr6(a,b,c,d){if(typeof\nc!==\"number\"){if(0===c[0])return ie(c[1],a[1+b],d);return}if(2!==c){a[1+b]=d;return}if(0===aN(d)&&4===d.length-1){var\ne=0,h=a[1+b];for(;;){h[1+e]=d[1+e];var\ni=e+1|0;if(3===e)return;e=i}}throw g([0,f,r7],1)}function\nie(a,b,c){if(0===aN(c)&&a.length-1<=c.length-1){var\ne=a.length-2|0,h=0;if(e>=0){var\nd=h;for(;;){var\ni=c[1+d];r6(b,d,j(a,d)[1+d],i);var\nk=d+1|0;if(e===d)break;d=k}}return}throw g([0,f,r8],1)}function\nig(a,b,c){if(typeof\na!==\"number\"&&0===a[0])return ie(a[1],b,c);return a7(r9)}var\ne2=[q,r_,ag(0)];r2(r$,[0,e2,[0]]);(function(a){throw a});function\ne3(a){return[0,a]}function\nR(a){return[0,a]}function\ndk(a){return 0===a[0]?[0,a[1]]:0}var\nbW=[0,function(a){return a}(0)];function\nbX(a){return[1,0,0,0,a]}function\nk(a,b){return 0===a[0]?[0,h(b,a[1])]:bX([0,a,b])}function\nbY(a,b,c){if(0===a[0]){var\nd=a[1];if(0===b[0])return[0,i(c,d,b[1])]}return bX([1,a,b,c])}function\nih(a){return 0===a[0]?a[1]:bX([4,a,0])}function\nii(a,b,c){switch(c[0]){case\n0:throw g([0,f,sc],1);case\n1:c[3]=[0,b,a,c[3]];return;default:c[2]=[0,b,a,c[2]];return}}function\ne4(a,b){if(!b)throw g([0,f,sd],1);if(b[2]===a)return[0,b[1],b[3]];var\nc=e4(a,b[3]),d=c[1];b[3]=c[2];return[0,d,b]}function\ncv(a,b){switch(b[0]){case\n0:throw g([0,f,se],1);case\n1:var\nc=e4(a,b[3]),e=c[1];b[3]=c[2];return e;default:var\nd=e4(a,b[2]),h=d[1];b[2]=d[2];return h}}function\nij(a,b,c,d){var\ne=d;for(;;){if(!e)throw g([0,f,sf],1);if(e[1]===b&&e[2]===a){e[1]=c;return}e=e[3]}}function\ne5(a,b,c,d){switch(d[0]){case\n0:throw g([0,f,sg],1);case\n1:return ij(a,b,c,d[3]);default:return ij(a,b,c,d[2])}}function\nik(a,b){var\nc=b;for(;;){if(!c)throw g([0,f,sh],1);if(c[2]===a)return c[1];c=c[3]}}function\nsi(a,b){switch(b[0]){case\n0:throw g([0,f,sj],1);case\n1:return ik(a,b[3]);default:return ik(a,b[2])}}function\naY(a,b,c,d){switch(d[0]){case\n0:throw g([0,f,sk],1);case\n1:var\nj=d[1];if(typeof\nj===\"number\"&&!j){if(!c)return;if(b[1])return;b[1]=1;return}var\nk=d[4];if(7===k[0]){var\nn=k[2];if(1===n[0]){var\no=n[1];if(typeof\no===\"number\"){if(!o&&c){if(b[1])return;b[1]=1;return}}else if(c)return}}var\nl=d[1];a:{if(typeof\nl===\"number\"&&l){var\ne=1;break a}var\ne=c}d[1]=0;var\nm=d[2];return a<50?j2(a+1|0,b,e,m):r(j2,[0,b,e,m]);default:var\ni=d[1];d[1]=0;if(typeof\ni===\"number\"){if(!i)return;b[1]=2;return}var\np=i[1];if(c)b[1]=2;return h(d[3],p)}}function\nba(a,b,c){return bM(aY(0,a,b,c))}function\nj2(a,b,c,d){if(typeof\nd===\"number\")return;switch(d[0]){case\n0:var\nf=d[1];return a<50?aY(a+1|0,b,c,f):r(aY,[0,b,c,f]);case\n1:var\ng=d[2];ba(b,c,d[1]);return a<50?aY(a+1|0,b,c,g):r(aY,[0,b,c,g]);case\n2:var\nh=d[3],l=d[2];ba(b,c,d[1]);ba(b,c,l);return a<50?aY(a+1|0,b,c,h):r(aY,[0,b,c,h]);case\n3:var\ni=d[4],m=d[3],n=d[2];ba(b,c,d[1]);ba(b,c,n);ba(b,c,m);return a<50?aY(a+1|0,b,c,i):r(aY,[0,b,c,i]);default:var\no=d[1];d[1]=0;var\nk=o-1|0,p=0;if(k>=0){var\ne=p;for(;;){ba(b,c,j(d[3],e)[1+e]);var\nq=e+1|0;if(k===e)break;e=q}}return}}function\nsl(a){return i(c$(ai,sm),db,Bk(20))}function\ndl(a,b){var\nc=[0,0];ba(c,a,b);var\nd=2<=c[1]?1:0;return d?sl(0):d}function\nae(a){return bX([5,a])}function\nar(a){return a}function\nab(a,b){if(1===a[0]){var\nc=a[4];if(5===c[0]){c[1]=b;return dl(0,a)}}throw g([0,f,sn],1)}function\nbq(a){if(1===a[0]){var\nb=a[4];if(5===b[0])return b[1]}throw g([0,f,so],1)}function\nbZ(a,b,c){var\nk=a,h=b,d=c;for(;;)switch(d[0]){case\n0:return k;case\n1:var\ne=d[2];if(typeof\ne===\"number\")throw g([0,f,st],1);switch(e[0]){case\n0:if(e[1]!==h)throw g([0,f,su],1);var\no=0;break;case\n1:var\nB=e[2],C=e[1];if(C===h)var\nD=[0,B];else{if(B!==h)throw g([0,f,sv],1);var\nD=[0,C]}var\no=D;break;case\n2:var\nu=e[3],v=e[2],w=e[1];if(w===h)var\nx=[1,v,u];else if(v===h)var\nx=[1,w,u];else{if(u!==h)throw g([0,f,sw],1);var\nx=[1,w,v]}var\no=x;break;case\n3:var\np=e[4],q=e[3],r=e[2],s=e[1];if(s===h)var\nt=[2,r,q,p];else if(r===h)var\nt=[2,s,q,p];else if(q===h)var\nt=[2,s,r,p];else{if(p!==h)throw g([0,f,sx],1);var\nt=[2,s,r,q]}var\no=t;break;default:var\nn=cv(d,h);if(j(e[3],n)[1+n]!==h)throw g([0,f,sy],1);var\nm=e[2]-1|0;e[2]=m;if(n>>2|0))var\nU=nu(e[3],0,K>>>1|0),L=[4,e[1],e[2],U];else\nvar\nL=e;var\nJ=L}var\no=J}d[2]=o;if(typeof\no!==\"number\")return k;var\ny=d[1];d[1]=1;var\nl=d[4];switch(l[0]){case\n0:h=d;d=l[1];break;case\n1:var\nN=l[2];k=bZ(k,d,l[1]);h=d;d=N;break;case\n2:var\nO=l[2];k=bZ(k,d,l[1]);h=d;d=O;break;case\n3:var\nP=l[2];k=bZ(k,d,l[1]);h=d;d=P;break;case\n4:var\nz=l[2],A=bZ(k,d,l[1]);if(!z)return A;var\nQ=z[1];l[2]=0;k=A;h=d;d=Q;break;case\n5:return k;case\n6:if(typeof\ny===\"number\")return k;var\nR=y[1];try{i(l[2],d,R);return k}catch(f){var\nS=M(f);return[0,[0,S,qR(0)],k]}default:var\nT=l[1];k=bZ(k,d,l[2]);h=d;d=T}break;default:throw g([0,f,sz],1)}}function\nbb(a,b){var\ne=a,c=b;for(;;)switch(c[0]){case\n0:return;case\n1:var\nn=typeof\nc[2]===\"number\"?1:0,d=c[2];if(typeof\nd===\"number\")var\nk=[0,e];else\nswitch(d[0]){case\n0:var\nk=[1,e,d[1]];break;case\n1:var\nk=[2,e,d[1],d[2]];break;case\n2:var\nk=[3,e,d[1],d[2],d[3]];break;case\n3:var\no=[0,d[1],d[2],d[3],d[4],e,bW,bW,bW],l=0;for(;;){ii(c,l,j(o,l)[1+l]);var\nw=l+1|0;if(4===l)break;l=w}var\nk=[4,5,5,o];break;default:var\ni=d[2];if(i>>1|0)}function\nis(a,b,c){if(typeof\na!==\"number\"){if(0!==a[0]){if(a[2]!==b)throw g([0,f,s9],1);a[2]=c;return}if(a[2]===b){a[2]=c;return}if(a[4]===b){a[4]=c;return}}throw g([0,f,s8],1)}function\nf5(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=c[4];if(typeof\nd!==\"number\"&&1!==d[0]){var\nh=c[5],e=d[2];if(typeof\ne===\"number\")var\ni=0;else{if(0!==e[0])throw g([0,f,tb],1);e[5]=c;var\ni=e}d[2]=c;c[4]=i;c[5]=d;d[5]=h;is(h,c,d);fb(b,c);return a<50?cK(a+1|0,b,d):r(cK,[0,b,d])}}throw g([0,f,ta],1)}function\ns_(a,b){return bM(f5(0,a,b))}function\nf4(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=c[2];if(typeof\nd!==\"number\"&&1!==d[0]){var\nh=c[5],e=d[4];if(typeof\ne===\"number\")var\ni=0;else{if(0!==e[0])throw g([0,f,td],1);e[5]=c;var\ni=e}d[4]=c;c[2]=i;c[5]=d;d[5]=h;is(h,c,d);fb(b,c);return a<50?cK(a+1|0,b,d):r(cK,[0,b,d])}}throw g([0,f,tc],1)}function\ns$(a,b){return bM(f4(0,a,b))}function\nj4(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=c[4];a:if(typeof\nd!==\"number\"&&0===d[0]){var\ne=b1(d[2]);if(fa(b1(d[4]),e)){s$(b,d);break a}}return a<50?f5(a+1|0,b,c):r(f5,[0,b,c])}throw g([0,f,te],1)}function\nj3(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=c[2];a:if(typeof\nd!==\"number\"&&0===d[0]){var\ne=b1(d[4]);if(fa(b1(d[2]),e)){s_(b,d);break a}}return a<50?f4(a+1|0,b,c):r(f4,[0,b,c])}throw g([0,f,tf],1)}function\ncK(a,b,c){if(typeof\nc!==\"number\"&&0===c[0]){var\nd=b1(c[2]),e=b1(c[4]);return d>>2|0}function\naE(a,b){if(typeof\na===\"number\")var\nc=b;else{if(typeof\nb!==\"number\"){var\nd=dq(b);return[1,(ix(dq(a),d)+1|0)<<2,a,b]}var\nc=a}return c}function\niy(a){return typeof\na===\"number\"?0:0===a[0]?[0,a[2]]:[1,a[2],a[3]]}var\nfc=1,fd=2,tL=3;function\niz(a){return-1===a?1:0}function\nfe(a){return-1!==a?1:0}function\nb2(a){return(a&3)===3?1:0}function\niA(a){return(a&3)===1?1:0}function\niB(a){return(a&3)===2?1:0}function\niC(a){return a|3}function\ntM(a){return a>>>2|0}function\niD(a){return a<<2|2}function\ncz(a){return a&mo(tL)}function\niE(a){return a[2]}function\niF(a){return a[3]}function\niG(a){return[0,0,0,0]}function\ndr(a){a[1]=a[1]+1|0;return}function\nds(a){a[2]=a[2]+1|0;return}function\ndt(a){a[3]=a[3]+1|0;return}function\nff(a,b,c){var\nd=c;for(;;){if(typeof\nd===\"number\")return;if(0===d[0]){var\ne=d[1],i=(e&3)!==3?1:0,l=i?0!==(e&3)?1:0:i;if(l){if(0!==(e&b))throw g([0,f,tO],1);dr(a);dt(a);d[1]=e|3}return}var\nh=d[1],j=(h&3)!==3?1:0,k=j?0!==(h&3)?1:0:j;if(!k)return k;if(0!==(h&b))throw g([0,f,tP],1);dr(a);dt(a);d[1]=h|3;ff(a,b,d[2]);d=d[3]}}function\ndu(a,b,c,d){if(typeof\nd===\"number\")return;if(0===d[0]){var\ne=d[1];if(0===(e&c)){dr(a);if(0===(e&3))d[1]=e|c;else{d[1]=-1;dt(a);ds(a)}}var\ng=-1!==e?1:0,h=g?(e&3)===3?1:0:g;return h?(d[1]=-1,ds(a)):h}var\nf=d[1];if(0===(f&c)){dr(a);if(0===(f&3)){d[1]=f|c;eE(d,b)}else{d[1]=-1;dt(a);ds(a);ff(a,c,d[2]);ff(a,c,d[3])}}var\ni=-1!==f?1:0,j=i?(f&3)===3?1:0:i;return j?(d[1]=-1,ds(a)):j}function\nfg(a,b,c){var\nd=hm(b);if(typeof\nd!==\"number\"&&1===d[0]){var\ne=(d[1]&3)===c?1:0;return e?(du(a,b,c,d[2]),du(a,b,c,d[3])):e}throw g([0,f,tQ],1)}function\niH(a,b,c){for(;;){if(eF(b))return;fg(a,b,c)}}function\ntR(a,b,c,d){for(;;){if(eF(c))return iH(b,d,fd);if(eF(d))return iH(a,c,fc);fg(a,c,fc);fg(b,d,fd)}}function\nfh(a){var\nb=a[6];a[6]=b+1|0;return b}function\nfi(a){var\nb=a;for(;;){if(typeof\nb===\"number\")return;if(0===b[0]){var\nc=b[1];if(typeof\nc!==\"number\"&&0===c[0]){var\ne=c[1],i=fe(e),l=i?b2(e):i;if(l)c[1]=cz(e);return}throw g([0,f,tW],1)}var\nd=b[1];if(typeof\nd!==\"number\"&&1===d[0]){var\nh=d[1],m=b[4],n=b[3],j=fe(h),k=j?b2(h):j;if(!k)return k;d[1]=cz(h);fi(n);b=m;continue}throw g([0,f,tX],1)}}function\niI(a,b){var\nc=b;for(;;){if(typeof\nc===\"number\")return;if(0===c[0]){var\nd=c[1];if(typeof\nd!==\"number\"&&0===d[0]){var\ne=d[1],u=c[2];if(!iA(e)){if(iz(e)){var\nk=fh(a);j(a[4],k)[1+k]=d;j(a[5],k)[1+k]=[0,c,0];d[1]=iD(k);return}if(iB(e)){var\nn=tM(e),v=[0,c,j(a[5],n)[1+n]];j(a[5],n)[1+n]=v;return}var\nq=b2(e);if(q)throw g([0,f,t0],1);return q}var\nm=a[2];if(-1a[3])throw g([0,f,tZ],1)}d[1]=cz(e);return}throw g([0,f,tY],1)}var\nh=c[1];if(typeof\nh!==\"number\"&&1===h[0]){var\nr=c[4],s=c[3],i=h[1],w=c[2];if(iz(i)){var\nl=fh(a);j(a[4],l)[1+l]=h;j(a[5],l)[1+l]=[0,c,0];h[1]=iD(l);fi(s);return fi(r)}if(!iA(i)){if(iB(i)){var\no=i>>>2|0,x=[0,c,j(a[5],o)[1+o]];j(a[5],o)[1+o]=x;return}var\nt=b2(i);if(t)throw g([0,f,t3],1);return t}if(-1a[3])throw g([0,f,t2],1)}h[1]=cz(i);iI(a,s);c=r;continue}throw g([0,f,t1],1)}}function\ncA(a,b){if(typeof\nb===\"number\")return 0;if(0!==b[0]){var\ni=b[1];if(-1===i){var\nl=fh(a);b[1]=0;j(a[4],l)[1+l]=b;var\np=cA(a,b[2]);return[1,b,0,p,cA(a,b[3])]}if(!b2(i)){b[1]=cz(b[1]);var\nr=cA(a,b[2]);return[1,b,0,r,cA(a,b[3])]}var\nd=i>>>2|0,k=j(a[5],d)[1+d];if(!k)throw g([0,f,t6],1);var\nm=k[2],q=k[1];j(a[5],d)[1+d]=m;if(0===m)b[1]=0;return q}var\ne=b[1];if(fe(e)&&b2(e)){var\nc=e>>>2|0,h=j(a[5],c)[1+c];if(!h)return[0,b,0];var\nn=h[2],o=h[1];j(a[5],c)[1+c]=n;return o}b[1]=0;return[0,b,0]}var\nfj=[0,0,[0],0,0];function\ntN(a){return a[1]}function\ntS(a){return a[1]}function\ntT(a){return a[2]}function\ntU(a,b){var\nc=iG(0),d=iG(0),e=eC(0),f=eC(0);du(c,e,fc,a);du(d,f,fd,b);tR(c,d,e,f);return[0,c,d]}function\ntV(a){if(typeof\na===\"number\")return;if(0===a[0]){a[1]=0;return}var\nb=dq(a[3]);a[1]=(ix(dq(a[2]),b)+1|0)<<2;return}function\nt4(a){var\ne=a[6]-1|0,h=0;if(e>=0){var\nb=h;for(;;){var\nc=j(a[4],b)[1+b];if(typeof\nc!==\"number\")if(0===c[0])c[1]=iC(c[1]);else\nc[1]=iC(c[1]);var\nd=j(a[5],b)[1+b];if(!d)throw g([0,f,t5],1);if(d[2]){var\ni=ck(d);j(a[5],b)[1+b]=i}var\nk=b+1|0;if(e===b)break;b=k}}return}function\niJ(a,b,c){if(typeof\nb===\"number\"){if(typeof\nc===\"number\")return[0,fj,0]}else if(b[1]===c)return[0,fj,b];var\nt=typeof\nb===\"number\"?cy:b[1],m=tU(t,c),i=tS(m),n=tT(m),u=iF(n),v=iF(i)+u|0,o=tN(i)-v|0,w=iE(n),p=iE(i)+w|0,x=0,y=ap(p,0),z=ap(p,0),A=a?o:-1,B=a?0:-1,C=a?ap(o,0):[0],d=[0,C,B,A,z,y,x];iI(d,b);if(d[2]!==d[3])throw g([0,f,t7],1);t4(d);var\nq=cA(d,c),r=d[6]-1|0;if(r>=0){var\nh=r;for(;;){tV(j(d[4],h)[1+h]);var\nF=h-1|0;if(0===h)break;h=F}}if(!a)return[0,fj,q];var\nk=[0,0],l=[0,0],s=d[6]-1|0,D=0;if(s>=0){var\ne=D;for(;;){a8(function(a){if(typeof\na!==\"number\")if(0===a[0]){var\nb=a[2];if(b){k[1]=[0,b[1],k[1]];return 0}}else{var\nc=a[2];if(c){l[1]=[0,c[1],l[1]];return 0}}return 0},j(d[5],e)[1+e]);var\nE=e+1|0;if(s===e)break;e=E}}return[0,[0,d[2],d[1],k[1],l[1]],q]}function\nt8(d,b){if(typeof\nb===\"number\")return 0;function\nc(a){a:if(typeof\na!==\"number\"){b:{if(0===a[0]){var\nb=a[1];if(typeof\nb!==\"number\"&&0===b[0]){var\ne=a[2];if(e){var\nj=e[1];break b}var\nk=h(d[1],b[2]);a[2]=[0,k];return k}break a}var\nl=a[2];if(!l){var\nn=c(a[3]),o=c(a[4]),m=i(d[2],n,o);a[2]=[0,m];return m}var\nj=l[1]}return j}throw g([0,f,t9],1)}return[0,c(b)]}function\ndv(a,b){return[0,[0,a,b],0]}function\ndw(a){return t8(a[1],a[2])}function\nt_(a,b){var\nc=a[1];return[0,c,iJ(0,a[2],b)[2]]}function\nfk(a,b){var\nd=a[1],c=iJ(1,a[2],b);return[0,c[1],[0,d,c[2]]]}function\ndx(a,b,c,d){var\ne=[0,d];if(w===a)var\nh=c[1],g=0;else if(ks<=a)var\nh=c[2].length-1,g=c[1];else\nvar\nh=c[2].length-1,g=0;var\nk=h-1|0;if(k>=g){var\nf=g;for(;;){var\nl=j(c[2],f)[1+f];if(l)e[1]=i(b,l[1],e[1]);var\nm=f+1|0;if(k===f)break;f=m}}if(ks>a)a8(function(a){e[1]=i(b,a,e[1]);return 0},c[3]);if(w!==a)a8(function(a){e[1]=i(b,a,e[1]);return 0},c[4]);return}function\nfl(a,b,c){if(typeof\nc===\"number\")throw g([0,f,t$],1);if(0===c[0])return h(a,c[2]);var\nd=fl(a,b,c[3]);return i(b,fl(a,b,c[2]),d)}function\nbr(a,b,c){var\nd=b[2],e=b[1],f=dk(c);if(f){var\ng=f[1];return typeof\ng===\"number\"?R(e):R(fl(a,d,g))}var\nh=[0,dv(a,d)];return k(c,function(a){var\nb=t_(h[1],a);h[1]=b;var\nc=dw(b);return c?c[1]:e})}var\naT=[0,cy,aE];function\nua(a,b){return dm(b,aT,a)}function\ndy(a){return ua(a,J)}function\niK(a){function\ne(a,b){var\nc=a,d=b;for(;;){if(typeof\nc===\"number\")return d;if(0===c[0])return[0,c[2],d];var\nf=e(c[3],d);c=c[2];d=f}}return e(a,0)}var\niL=[0,R(0),function(a,b){return bY(a,b,aE)}];function\nfm(c,b){return br(function(a){return J(h(c,a))},aT,b)}function\nub(a,b){return ih(br(b,iL,a))}function\nbs(a){return ub(a,function(a){return k(a,J)})}var\nbt=e;function\nuc(a){return a[kU]}function\niM(a,b){var\nc=a?a[1]:bt;return BL(b).join(c)}function\nfn(a){return 0===uc(a)?1:0}function\ndz(a,b){return lS(a,b)}p[\"Number\"];var\nfo=null,ud=undefined;function\ncB(a){return a===fo?1:0}function\nue(a){return a===ud?1:0}function\nb3(a){var\nb=cB(a);return b?b:ue(a)}function\niN(a){return 1-b3(a)}function\ndA(a,b){return b3(b)?0:[0,h(a,b)]}var\nl=p;function\nfp(a,b){var\nc=a[b];return b3(c)?0:[0,c]}function\nfq(a){return new\nl[lh](a)}function\niO(a){return a[kU]}function\niP(c,b){return hj(iO(b),function(a){return h(c,b[a])})}function\niQ(a,b){var\nd=b.length-1,e=fq(d),f=d-1|0,g=0;if(f>=0){var\nc=g;for(;;){e[c]=h(a,j(b,c)[1+c]);var\ni=c+1|0;if(f===c)break;c=i}}return e}function\niR(c,b){return mZ(iO(b),function(a){return h(c,b[a])})}function\nfr(f,b){return function(a,b,c){var\ne=a,d=c;for(;;){if(!d)return b;var\ng=d[2];b[e]=h(f,d[1]);e=e+1|0;d=g}}(0,fq(0),b)}function\nui(a,b){var\nc=new\nl[\"Error\"](b);return a?(c[bB]=a[1],c):c}var\nuk=Symbol.iterator;function\num(a){return a.next()}function\nun(a){var\nb=dA(function(a){return a|0},a[\"done\"]);return b?b[1]:0}function\nuo(a){return a[dV]}function\niS(i,g,c,d,e){return function(a,b){var\nd=b;for(;;){var\ne=um(a);if(un(e))return d;var\nf=uo(e),j=h(g,f[1]);d=y(c,h(i,f[0]),j,d)}}(d,e)}l[\"Promise\"];function\nuh(a){return aw(a)}function\nbu(a,b,c){return eg(a,uh(b),c)}function\nay(a){return aw(a)}function\nv(a){return H(a)}function\nb4(a,b){return a\ninstanceof\nb?1:0}var\nuf=true;function\nug(a,b){a[b];return}function\nuj(a,b){return h(function(a){throw a},ui(a,b))}function\nul(a){return a[uk]()}l[\"Event\"];function\ndB(a){return a[f7]}function\niT(a,b,c,d){var\ne=a?a[1]:{},f=bJ(1,c);d.addEventListener(b,f,e);return function(a){d.removeEventListener(b,f,e);return 0}}function\niU(a){return h(a,0)}var\nfs=\"change\",cC=\"click\";l[\"ArrayBuffer\"];l[\"DataView\"];function\nup(a){a.preventDefault();return 0}var\nuq=\"DOMContentLoaded\",ur=kz,us=\"scroll\",ut=\"wheel\";l[\"Blob\"];l[\"File\"];var\niV=l[\"JSON\"];l[\"encodeURI\"];l[\"decodeURI\"];l[\"encodeURIComponent\"];l[\"decodeURIComponent\"];l[\"URL\"];l[\"URLSearchParams\"];function\naU(a,b){return[0,a,b]}var\ncD=[0,bt,bt];function\nft(a){return[0,a,bt]}function\niW(a){return a}var\ncE=ly,fu=ki,iX=bB,iY=k6,fv=\"type\",fw=dV,iZ=ft(dT),ux=\"for\";function\naV(a){return aU(cE,a)}function\ni0(a){return aU(ux,a)}var\nuA=ft(\"required\");function\ndC(a){return aU(iY,a)}function\ni1(a){return aU(fv,a)}var\nuB=ft(\"selected\"),bv=l[\"document\"];function\nuu(a){return iV.stringify(a)}function\nuv(a){try{var\nc=iV.parse(a)}catch(f){var\nb=M(f);if(b[1]===e2)return[1,b[2]];throw g(b,0)}return[0,c]}function\nuw(a,b){return a?b:cD}var\nuy=\"placeholder\";function\nuz(a){return aU(fu,a)}function\nuC(a){return aU(fw,a)}function\nuD(a){return a[\"ownerDocument\"]}if(!b3(bv))bv[ke];function\nuE(a,b){a.appendChild(b);return 0}function\nuF(a,b,c,d){var\ng=b,f=c,e=d;for(;;){if(!e){if(0!==g)a.setAttribute(k6,iM([0,\";\"],ck(g)));if(0!==f)a.setAttribute(ly,iM([0,aI],ck(f)));return}var\nh=e[2],k=e[1],i=k[2],j=k[1];if(fn(j))e=h;else if(dz(j,iY)){g=[0,i,g];e=h}else if(dz(j,cE)){var\nl=fn(i)?f:[0,i,f];f=l;e=h}else{a.setAttribute(j,i);e=h}}}function\ni2(a,b,c,d){var\nf=a?a[1]:bv,g=b?b[1]:0,e=f.createElement(c);uF(e,0,0,g);a8(function(a){return uE(e,a)},d);return e}function\naW(a,b){var\nc=a?a[1]:bv;return c.createTextNode(v(b))}function\ni3(a,b,c){return fn(a)?0:b?(c.setAttribute(a,b[1]),0):(c.removeAttribute(a),0)}function\ni4(a,b,c){return b?(c[j7].add(a),0):(c[j7].remove(a),0)}var\ni5=\"div\";function\nuP(a,b,c,d){return i2(b,c,a,d)}function\ni6(a,b,c){return uP(i5,a,b,c)}function\ni7(a){return a[ke]}function\ndD(a,b,c){eg(a,b,c);return 0}var\ndE=l[kV];function\ndF(a){return BG(function(a,b,c){var\ne=b,d=c;for(;;){if(!d)return a;var\nf=d[2];a[e]=d[1];e=e+1|0;d=f}}(fq(0),0,a))}function\naF(a){return dD(dE,uS,dF(a))}function\nb5(a){return dD(dE,uX,dF(a))}l[kV];l[\"navigator\"];var\nu0=l[\"performance\"],dG=l[lw];ug(l,u1);function\nuG(a,b){eg(a,kR,c7(b));return}function\nuH(a,b,c){var\ne=a?a[1]:l[lw],d=e.getComputedStyle(c)[b];return b3(d)?bt:d}function\nuI(a,b){var\nc=a?a[1]:lt,d=lt<=c?1:0;b.scrollIntoView(!!d);return 0}var\nuJ=\"button\",uK=\"form\",uL=kz,uM=\"label\",uN=\"option\",uO=\"select\";function\nuQ(a){var\nb=a[\"body\"];return iN(b)?b:uj(0,\"Document body is null. Try to defer your script execution.\")}function\nuR(a){return dA(function(a){return a},a[\"activeElement\"])}function\nuT(a){return dD(dE,uU,dF(a))}function\nuV(a){return dD(dE,uW,dF(a))}function\nuY(a){return a}function\nuZ(a){return a.now()}function\nu2(a,b){return l.setTimeout(bJ(1,b),a)}function\nu3(a){l.clearTimeout(a);return}function\nu4(a){l.requestAnimationFrame(bJ(1,a));return}l[\"ClipboardItem\"];l[\"FormData\"];l[\"Headers\"];l[\"Request\"];l[\"Response\"];l[\"fetch\"];l[\"MediaStream\"];l[\"MediaRecorder\"];l[\"MessageChannel\"];l[\"BroadcastChannel\"];l[\"Notification\"];l[\"WebSocket\"];function\nu5(a){return a[\"localStorage\"]}function\nu6(a,b){function\nc(a){return a}return function(a){return dA(c,a)}(a.getItem(b))}function\nu7(a,b,c){try{a.setItem(b,c);return}catch(f){var\nd=M(f);if(d[1]===e2)return;throw g(d,0)}}function\naz(a,b,c){return[0,a,b,c]}function\ni8(a){var\nb=a[1];return 82===b?ha(dk(a[2])):83<=b?ha(dk(a[2])):1}function\ndH(a){return c3(dk(a))}function\nu8(a){return et(c4(function(a){var\nb=a[1];return 82===b?[0,dH(a[2]),0]:83<=b?iK(dH(a[2])):[0,a[2],0]},a))}function\ni9(a){if(!a)return u9;var\nb=m6(i8,a),c=b[2];return[0,u8(b[1]),c]}var\ni_=kR,fx=\"before\";function\nva(a){return[0,a]}function\nvb(a,b){return[1,fo,a,b]}var\nvc=\"remove\",vd=\"contains\";function\ni$(a){var\nb=uR(uD(a));return b?bu(a,vd,[0,b[1]])|0:0}function\nja(e,b){var\nc=[0,dv(va,vb)];return k(b,function(a){var\nb=fk(c[1],a),d=b[2],g=b[1];c[1]=d;dx(w,function(a,b){return 0===a[0]?a[1][dU]=uf:0},g,0);var\nh=i$(e),i=dw(d);if(i){var\nf=function(d,b){if(0!==b[0]){if(!cB(b[1]))return b[1];var\nl=f(d,b[3]),k=f(l,b[2]);b[1]=k;return k}var\nc=b[1];delete\nc[dU];if(c.parentNode!==e)if(cB(d))bu(e,i_,[0,c]);else\nbu(d,fx,[0,c]);else{var\na=c.nextSibling!==d?1:0;if(a){if(h)var\ng=i$(c),i=g?function(a){for(;;){var\nb=c.nextSibling;if(b===d)return 1;if(cB(b))return 0;bu(c,fx,[0,b])}}(0):g;else\nvar\ni=h;var\nj=1-i}else\nvar\nj=a;if(j)if(cB(d))bu(e,i_,[0,c]);else\nbu(d,fx,[0,c])}return c};f(fo,i[1])}dx(w,function(a,b){if(0!==a[0])return 0;var\nc=a[1],d=iN(c[dU]),e=d?(delete\nc[dU],bu(c,vc,[0]),0):d;return e},g,0);return e})}var\ndI=R(0),fy=[0,bt,bt];function\nu_(a){if(!a)return u$;var\nb=a[1],c=b[1];if(82===c){if(!a[2])return[0,0,[0,k(b[2],J)]]}else\nif(83<=c){if(!a[2])return[0,0,[0,b[2]]]}else if(!a[2])return[0,[0,b[2],0],0];return m2(i8,a)?[0,et(c4(function(a){var\nb=a[1];return 82===b?[0,dH(a[2]),0]:83<=b?iK(dH(a[2])):[0,a[2],0]},a)),0]:[0,0,[0,dm(function(a){var\nb=a[1];return 82===b?k(a[2],J):83<=b?a[2]:R(J(a[2]))},iL,a)]]}function\njb(c,b){function\nd(a){var\nb=a[2],d=a[1];return dz(d,cE)?i4(b,1,c):i3(d,[0,b],c)}function\ne(a){var\nb=a[1],d=a[2];return dz(b,cE)?i4(d,0,c):i3(b,0,c)}function\nh(a){var\nb=[0,fy];return function(a){if(b[1]!==fy)e(b[1]);var\nc=iW(a);d(c);b[1]=c;return 0}}return dm(function(a){var\nb=a[1];if(82===b){var\ni=a[2];return k(i,h(0))}if(83>b)throw g([0,f,ve],1);var\nj=a[2],c=[0,dv(function(a){var\nb=iW(a);d(b);return b},function(a,b){return fy})];return k(j,function(a){var\nb=fk(c[1],a),d=b[2],f=b[1];c[1]=d;dx(w,function(a,b){return e(a)},f,0);dw(d);return 0})},[0,dI,function(a,b){return dI}],b)}function\nfz(a,b){return iT(b[1],b[2],b[3],a)}function\nvf(c,b){return dm(function(a){var\nb=a[1];if(82===b){var\nd=[0,0];return k(a[2],function(a){var\nb=d[1];if(b)iU(b[1]);d[1]=[0,fz(c,a)];return 0})}if(83>b)throw g([0,f,vg],1);var\nh=a[2],e=[0,dv(function(a){return fz(c,a)},function(a,b){return a})];return k(h,function(a){var\nb=fk(e[1],a),c=b[2],d=b[1];e[1]=c;dx(w,function(a,b){return iU(a)},d,0);dw(c);return 0})},[0,dI,function(a,b){return dI}],b)}function\njc(a,b,c,d,e,f){var\nq=b?b[1]:0,r=c?c[1]:0,s=d?d[1]:function(a){return},m=i9(q),l=m[2],t=m[1],n=i9(r),o=n[2],u=n[1],p=u_(f),i=p[2],g=i2(a,[0,t],e,p[1]);h(s,g);if(l)if(i)var\nv=ja(g,i[1]),j=bY(jb(g,l),v,function(a,b){return b});else\nvar\nj=k(jb(g,l),function(a){return g});else\nvar\nj=i?ja(g,i[1]):R(g);a8(function(a){fz(g,a);return 0},u);var\nw=o?bY(vf(g,o),j,function(a,b){return b}):j;return w}function\nb6(a,b,c,d,e,f){return jc(b,c,d,e,a,f)}function\nvh(a,b,c,d,e,f){return jc(b,c,d,e,a,0)}function\nfA(a,b,c,d,e){return b6(uJ,a,b,c,d,e)}function\nK(a,b,c,d,e){return b6(i5,a,b,c,d,e)}function\nfB(a,b,c,d,e){return vh(uL,a,b,c,d,e)}function\njd(a,b,c,d,e){return b6(uM,a,b,c,d,e)}function\nvi(a,b,c,d,e){return b6(uK,a,b,c,d,e)}function\nvj(a,b,c,d,e){return b6(uN,a,b,c,d,e)}function\nvk(a,b,c,d,e){return b6(uO,a,b,c,d,e)}function\ndJ(a,b){return b=c)return vB;if(b===kY)return vA;if(b===\"cyan\")return vz;if(b===lm)return vy;if(b===\"magenta\")return vx;if(b===lq)return vw;if(b===\"reset\")return vv;if(b===\"white\")return vu;if(b===\"yellow\")return vt}else{if(b===\"Black\")return vK;if(b===\"Blue\")return vJ;if(b===\"Cyan\")return vI;if(b===\"Green\")return vH;if(b===\"Magenta\")return vG;if(b===\"Red\")return vF;if(b===\"White\")return vE;if(b===\"Yellow\")return vD;if(b===\"black\")return vC}throw g(fD,1)}function\njg(a,b){a9(b,a);return vM}function\njh(a){try{nM(a);nN(a)}catch(f){var\nb=M(f);if(b!==eB)throw g(b,0)}return vN}var\nji=[q,vO,ag(0)],vL=0;function\nvP(a,b,c){if(c[1]===ji)return jg(a,c[2]);if(c[1]!==cs)return h(b,c);var\ne=c[2];try{var\nf=jg(a,jf(e));return f}catch(f){var\nd=M(f);if(d===fD)return h(b,c);throw g(d,0)}}function\nvQ(a,b,c){if(c[1]===ji)return jh(a);if(c[1]!==cs)return h(b,c);var\ne=c[2];try{jf(e)}catch(f){var\nd=M(f);if(d===fD)return h(b,c);throw g(d,0)}return jh(a)}function\nvR(a){var\nc=bO(0);ry(a,1);var\nb=rz(a,0),d=b[2],e=b[1];return rA(a,[0,function(a){return vP(c,e,a)},function(a){return vQ(c,d,a)},b[3],b[4]])}function\nvS(a,b){var\nd=bo(64),c=df(d),e=a?vL:a;if(e)vR(c);return r1(function(a){a$(c,0);return co(d)},c,b)}function\nvT(a){return vS(1,a)}function\nvU(a,b){return m8(a,b)}function\nvV(a){try{var\nc=[0,l4(a)];return c}catch(f){var\nb=M(f);if(b[1]===cc)return 0;throw g(b,0)}}function\nvW(a){return a|0}function\nfE(a,b){return b?[0,h(a,b[1])]:0}function\nvX(a,b,c){return c?h(b,c[1]):a}function\nvY(a,b){if(b)return h(a,b[1]);return}function\nvZ(a,b){return b?b[1]:a}function\nv0(a,b){return a?a[1]:b}function\nv1(a){return a?[0,a[1],0]:0}function\nv2(a,b){return 0===b[0]?h(a,b[1]):[1,b[1]]}function\nv3(a,b){return v2(b,a)}function\nv4(a){var\nb=nE(a);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[38],,,,,,,,,,,b[10]]}function\nv5(a){var\nb=v4(a);return[0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,b[40],,,,,,,,,,,,,,,,,,,,b[51]]}function\nv6(e,b){var\nd=n(e);if(dJ(d,n(b)))return 0;var\nf=n(b)-d|0;return function(a){var\nc=a;for(;;){if(vl(c,d))return 1;if(_(b,f+c|0)!==_(e,c))return 0;c=c+1|0}}(0)}function\nfF(a,b){return v6(a,b)?[0,ex(b,0,n(b)-n(a)|0)]:0}var\njj=[q,v8,ag(0)];function\njk(a){return[0,[0,a]]}function\nbw(a,b,c,d){return[1,a,b,c,d]}function\nv_(a){if(0===a[0]&&typeof\na[1]===\"number\")return 1;return 0}function\njl(a,b){if(0===b[0]){var\nc=b[1];if(typeof\nc===\"number\")return jk(a);switch(c[0]){case\n0:return[0,[1,a,c[1]]];case\n1:return[0,[2,a,c[1],c[2]]];default:return bw(4,[1,a,c[1]],v9,[1,c[2],c[3]])}}var\nd=b[2],f=b[1];if(typeof\nd!==\"number\")switch(d[0]){case\n0:break;case\n1:return bw(f+1|0,[2,a,d[1],d[2]],b[3],b[4]);default:var\ne=b[3],i=d[3],j=d[2],k=d[1],g=aN(e);a:if(aZ===g)var\nh=e[1];else{if(bg!==g&&bE!==g){var\nh=e;break a}var\nh=er(e)}return bw(f+1|0,[1,a,k],[bg,function(a){return jl([0,j,i],h)}],b[4])}return bw(f+1|0,[1,a,d[1]],b[3],b[4])}function\njm(a){if(0===a[0]){var\nb=a[1];if(typeof\nb===\"number\")throw g(jj,1);switch(b[0]){case\n0:return[0,v7,b[1]];case\n1:var\nn=b[2];return[0,jk(b[1]),n];default:return[0,[0,[1,b[1],b[2]]],b[3]]}}var\nd=a[3],e=a[2],h=a[1],i=aN(d);a:if(aZ===i)var\nf=d[1];else{if(bg!==i&&bE!==i){var\nf=d;break a}var\nf=er(d)}var\nj=a[4];if(typeof\nj!==\"number\"&&0!==j[0]){var\nc=a[4];if(typeof\nc!==\"number\"&&2===c[0]){var\nq=c[3];return[0,bw(h-1|0,e,d,[1,c[1],c[2]]),q]}var\np=c[2];return[0,bw(h-1|0,e,d,[0,c[1]]),p]}var\nk=j[1];if(v_(f))return[0,[0,e],k];var\nl=jm(f),m=l[2],o=[1,m[1],m[2]];return[0,bw(h-1|0,e,mI(l[1]),o),k]}function\nwa(a){if(typeof\na===\"number\")return 0;switch(a[0]){case\n0:return 1;case\n1:return 2;default:return 3}}function\nv$(a){try{var\nc=[0,jm(a)];return c}catch(f){var\nb=M(f);if(b===jj)return 0;throw g(b,0)}}function\nwb(a){return 0===a[0]?wa(a[1]):a[1]}function\nwc(a){return a[\"height\"]}function\nwd(a){return a}function\nwg(a){switch(a){case\n0:return wh;case\n1:return wi;default:return wj}}function\nwe(a){return wd(a[\"contentRect\"])}function\nwf(a){a[f7];return}function\nwk(a,b,c){var\nd=b?[0,c,{box:v(wg(b[1]))}]:[0,c];eg(a,\"observe\",d);return 0}function\nwl(c){return new\nl[\"ResizeObserver\"](function(a,b){return i(c,iR(function(a){return a},a),b)})}var\nwm=kc,wn=\"pattern\",jn=v5([0,ey]);function\nwo(a,b){h(a,b);return b}function\nwp(a){var\nb=fF(wq,a);if(b){var\nc=b[1],d=vV(c);if(d)return[0,[0,d[1]]];var\ng=function(a){return[0,a]};return function(a){return fE(g,a)}(fC(c))}var\ne=fF(wr,a);if(e){var\nh=function(a){return[1,a]};return function(a){return fE(h,a)}(fC(e[1]))}var\nf=fF(ws,a);if(!f)return 0;function\ni(a){return[1,a]}return function(a){return fE(i,a)}(fC(f[1]))}function\njo(a){switch(a[0]){case\n0:var\nb=a[1];return h(A(wt),b);case\n1:var\nc=a[1];return h(A(wu),c);default:var\nd=a[1];return h(A(wv),d)}}function\njp(a){var\nc=a?a[1]:i7(bv);function\nb(a){var\nb=wp(aw(uH(0,\"font-size\",a)));if(!b)return 16.;var\nc=b[1];return 0===c[0]?c[1]:a7(ww)}return function(a){switch(a[0]){case\n0:return a[1];case\n1:var\nd=a[1];return d*b(i7(bv));default:var\ne=a[1];return e*b(c)}}}function\nwx(e,b,c,d){function\nf(a,b){return y(e,b[1],b[2],a)}function\ng(a,b){return bY(d,a,b)}return function(a){return g(a,f)}(bY(b,c,function(a,b){return[0,a,b]}))}var\nwA=[q,wz,ag(0)],wC=[q,wB,ag(0)];function\nfG(a){return[0,0]}function\nfH(a,b){if(a[1])throw g(wC,1);a[1]=[0,b];return 0}function\nfI(a){var\nb=a[1];if(b)return b[1];throw g(wA,1)}function\nwy(a,b,c){return wx(function(a,b,c){return[0,a,b,c]},a,b,c)}function\nwD(a){return uu(a)}function\nwE(a){var\nb=uv(a);return 0===b[0]?[0,b[1]]:(uT([0,b[1],0]),wF)}var\njq=u5(dG);function\njr(c,b){return function(a){return u7(jq,c,a)}(wD(b))}function\nwG(a){var\nb=u6(jq,a);function\nc(a){return wE(a)}var\nd=b?[0,b[1]]:wH;return v3(d,c)}function\nwI(a,b){var\nc=wG(a);if(0===c[0])return c[1];var\nd=c[1];return typeof\nd===\"number\"?h(b,0):(uV([0,d[2],0]),h(b,0))}function\nwJ(d,b){jr(d,b);var\na=ae(b),c=e6(0,ar(a));e7(c,function(a){jr(d,b0(c));return 0});b0(c);return a}function\nwK(a,b){var\nc=H(a);return wJ(c,wI(c,b))}function\njs(a,b){return wK(a,function(a){return b})}var\nwM=jn[49],wL=jn[29];function\nwN(a){return c4(function(a){return[0,80,aV(H(a))]},wM(a))}var\nwO=0;function\nbc(d,b,c){var\na=b[1],e=82===a?[0,82,k(b[2],function(a){return function(a){return aU(d,a)}(H(a))})]:83<=a?a7(wR):[0,80,function(a){return aU(d,a)}(H(b[2]))];return[0,e,c]}function\nfJ(d,b,c){return b?[0,[0,80,function(a){return aU(d,a)}(H(b[1]))],c]:c}function\njt(a,b){var\nc=b[1];return 82===c?[0,82,k(b[2],a)]:83<=c?[0,83,fm(a,b[2])]:[0,80,h(a,b[2])]}function\nwT(a){return 0===a[0]?aV(H(a[1])):a[1]}function\nfK(a,b){return[0,jt(wT,a),b]}function\nal(a){return fK(a,0)}function\ncF(a,b){return fK(a,b)}function\nwP(a,b){var\nd=wN(b[1]),e=b[2],c=function(a){return bN(e,a)}(d);return a?[0,[0,80,uz(H(a[1]))],c]:c}function\nwQ(a){return[0,wL(a),wO]}function\nwS(a,b,c){return b?[0,[0,80,a],c]:c}function\nwU(a){return fK(jt(function(a){return[0,a]},a),0)}function\nwV(a,b){return 0===b[0]?(a.scroll(0,b[1]),0):uI(0,b[1])}function\nwW(a,b,c,d,e){var\ng=a?a[1]:0,h=b?b[1]:0,f=ae(1),i=cF(wX,cF([0,82,k(ar(f),function(a){return a?[1,aV(\"locked\")]:[1,cD]})],g)),j=wU(wY),l=[0,[0,80,az(0,cC,function(a){return ab(f,1)})],0],m=K(0,[0,j],[0,l],0,[0,[0,82,fA(0,0,0,0,[0,[0,80,aW(0,wZ)],0])],0]),n=az(0,ut,function(a){var\nb=bq(f);return b?ab(f,0):b});return K(0,[0,i],[0,[0,[0,80,n],h]],c,[0,[0,82,k(wy(e,ar(f),d),function(a){var\nb=a[1],c=a[3];if(a[2])vY(function(a){return wV(b,a)},c);return b})],[0,[0,82,m],0]])}function\ndK(a,b){return typeof\nb===\"number\"?0:0===b[0]?[0,h(a,b[1])]:[1,b[1]]}function\nw0(e,b,c){var\nd=ae(c);return[0,az(0,b,function(a){return ab(d,h(e,dB(a)[dV]))}),d]}function\nju(a,b,c,d,e,f,g,h,i,j){var\nl=d?d[1]:0,m=f?f[1]:0,n=function(a){return fJ(wn,h,a)}(function(a){return wS(uA,m,a)}([0,[0,80,i1(H(i))],l])),o=v0(b,function(a){return[0,a]}),k=w0(a,g,j),p=k[2],q=k[1];return[0,fB(c,[0,n],[0,[0,[0,80,q],v1(e)]],0,0),p,o]}function\ndL(a,b,c,d,e,f,g,h){var\ni=c?c[1]:0,j=function(a){return fJ(fw,h,a)}(function(a){return fJ(uy,g,a)}(i));return ju(ay,a,b,[0,j],d,e,ur,f,w2,vZ(w1,h))}function\ndM(a,b,c,d){var\ne=b?b[1]:0;return ju(function(a){return 0},0,a,[0,bc(fw,d,e)],c,0,fs,0,w3,0)}function\naG(a,b){return k(a,function(a){return[0,a,b]})}function\ndN(a,b,c,d,e){var\ni=[0,[0,cy,function(a){return a}],function(a,b){var\nc=b[2],d=a[2];return[0,aE(a[1],b[1]),function(a){return h(c,h(d,a))}]}];function\nj(a){var\nb=a[1],c=a[2];function\nd(a){var\nc=bq(b[2]);return h(b[3],c)}return[0,J(b[1]),function(a){var\nb=d(0);return h(h(c,a),b)}]}var\nf=function(a){return br(j,i,a)}(bs(d[2])),g=[0,82,k(f,function(a){var\nb=a[2];return az(0,wm,function(a){h(e,h(b,d[1]));return up(a)})})],l=k(f,function(a){return a[1]}),m=vX([0,g,0],function(a){return mU(g,a)},c);return vi(a,b,[0,m],0,[0,[0,83,bs(l)],0])}function\njv(a,b){return a?h(A(w4),b):b}function\nw5(a,b,c,d,e,f){var\nl=a?a[1]:1,m=b?b[1]:0,n=c?c[1]:0,j=d?d[1]:function(a){return},i=jv(1,e[1]),o=jv(0,e[1]),g=l?js(i,e[2]):ae(e[2]);h(j,bq(g));var\np=e[3];jd(0,[0,[0,[0,80,i0(H(i))],0]],0,0,p);var\nq=[0,80,o],r=function(a){return bc(fv,w6,a)}(function(a){return bc(iX,q,a)}(bc(fu,[0,80,i],m))),s=[0,[0,80,az(0,fs,function(a){var\nb=ay(dB(a)[dV]);h(j,b);return ab(g,b)})],n];return[0,vk(0,[0,r],[0,s],0,[0,[0,83,bs(fm(function(a){var\nb=a[1],c=a[2],d=al([0,80,[1,uC(H(b))]]),e=cF([0,82,k(ar(g),function(a){return[1,uw(vp(a,b),uB)]})],d);return vj(0,[0,e],0,0,[0,[0,80,aW(0,c)],0])},f))],0]),,g]}function\nw7(a,b,c,d,e,f,g){var\nm=b?b[1]:0,n=c?c[1]:function(a){return},j=h(vT(w8),d);function\nl(a){return a?[0,e]:0}a:{if(a&&a[1]){var\no=js(j,l(g)),i=o;break a}var\ni=ae(l(g))}var\np=jd(0,[0,[0,[0,80,i0(H(j))],0]],0,0,f),q=[0,80,d],r=function(a){return bc(fv,w9,a)}(function(a){return bc(iX,q,a)}(bc(fu,[0,80,j],0))),s=[0,[0,82,k(ar(i),function(a){return a?iZ:cD})],r];return[0,K(0,0,0,0,[0,[0,82,fB(0,[0,s],[0,[0,[0,80,az(0,fs,function(a){var\nb=l(dB(a)[dT]|0);h(n,b);return ab(i,b)})],m]],0,0)],[0,[0,82,p],0]]),i]}function\nw_(a){var\nd=eA(a);return[0,,function(a){return wb(a[1])},function(a){return},,function(a,b,c){var\ne=d[2].call(null,b,c,a[2]);return[0,jl(b,a[1]),e]},function(a){var\nc=v$(a[1]);if(!c)return[0,a,0];var\ne=c[1],b=e[2],f=e[1],g=[0,[0,b,d[17].call(null,b,a[2])]];return[0,[0,f,d[6].call(null,b,a[2])],g]},function(a,b){return d[18].call(null,b,a[2])}]}function\nw$(a){var\nb=w_(a);return[0,function(a){b[3].call(null,0);b[3].call(null,0);return}]}function\nxb(a){return br(function(a){return J(K(0,0,0,0,a[3]))},aT,a)}function\nxc(a){return e8(br(function(a){return a[2]},[0,xg,function(a,b){return i(A(xf),a,b)}],a),function(a){return i(A(xe),xd,a)})}jp(0)(xk);function\nxa(a,b,c){return[0,a,b,c]}function\nxh(a){return xc(a[1][1])}function\nxi(a){var\nb=jo(a[2]),c=[0,[0,80,aV(k0)],0],d=[0,[0,80,aV(\"lwdui-lazy-table-header\")],c],e=[0,[0,80,dC(H(h(A(xj),b)))],d];return K(0,[0,e],0,0,[0,[0,83,bs(xb(a[1][1]))],0])}var\nxl=w$([0,vU]),dO=Cb(0);function\nxm(e,b,c,d){var\ns=d[3],t=d[2],l=fG(0),m=fG(0),n=jo(e[2]),v=h(A(xo),n),w=cx(function(a,b){return J([0,e$(a),a,s])},aT,t);hL(0,2048);(function(a){return xl[1].call(null,50)}(0));var\nf=ae(0),a=R(function(a){return a}),g=e6(0,sa(a,ar(f)));e7(g,function(a){var\nb=b0(g);return b[2]?h(b[1],0):0});b0(g);function\nu(a){return i(A(xn),n,a)}function\nj(a){var\nb=[0,aV(\"row_spacer\"),0];return i6(0,[0,[0,dC(H(u(a))),b]],0)}var\nx=k(br(function(a){var\nb=a[1],c=a[3],d=a[2],e=bc(cE,xp,0),f=[0,80,dC(H(v))];return b?[0,0,J(K(0,[0,[0,f,e]],0,0,[0,[0,83,bs(i(c,d,b[1]))],0])),0]:[0,1,cy,0]},[0,[0,0,cy,0],function(a,b){var\nf=b[3],g=b[2],c=b[1],d=a[3],e=a[2],h=a[1],k=iy(e),i=iy(g);if(typeof\nk===\"number\")return typeof\ni===\"number\"?[0,((h+d|0)+c|0)+f|0,e,0]:[0,(h+d|0)+c|0,g,f];if(typeof\ni===\"number\")return[0,h,e,(d+c|0)+f|0];var\nl=dJ(d+c|0,0)?function(a){return aE(e,a)}(aE(J(R(j(d+c|0))),g)):aE(e,g);return[0,h,l,f]}],w),function(a){var\nb=a[3],c=a[2],d=a[1],e=dJ(d,0)?aE(J(R(j(d))),c):c;return dJ(b,0)?aE(e,J(R(j(b)))):e}),y=xi(e),z=wl(function(a,b){var\nd=mV(a);wf(d);var\nc=wc(we(d)),e=bq(f);return e?vm(e[1],c)?ab(f,[0,c]):0:ab(f,[0,c])}),B=al(xq),o=K(0,[0,B],0,[0,function(a){return fH(l,a)}],[0,[0,83,bs(x)],0]),p=al(xr),q=[0,[0,82,k(a,function(c){return az(0,us,function(a){var\nd=[0,0.],b=[0,-1];function\ne(e){var\na=800,f=uZ(u0);if(vn(b[1],0))u3(b[1]);b[1]=u2(a,function(a){return h(c,e)});var\ng=vo(f-d[1],a);return g?(d[1]=f,h(c,e)):g}fI(m);(function(a){return e(a)}(0));return 0})})],0];function\nr(a){return fH(m,a)}var\nC=c?wW([0,p],[0,q],[0,r],k(c[1],function(a){var\nb=fI(l),c=e[2];return[0,[0,cZ(a,vW(jp([0,b])(c)))]]}),o):K(0,[0,p],[0,q],[0,r],[0,[0,82,o],0]);function\nD(a){return wk(z,0,a)}function\nE(a){return wo(D,a)}var\nF=function(a){return k(a,E)}(C),G=wP(0,wQ(xs));return K(0,[0,[0,[0,82,k(xh(e),function(a){return dC(H(a))})],G]],0,0,[0,[0,82,y],[0,[0,82,F],0]])}var\nfL=eA([0,ey]),fM=dO[\"Text\"],fN=dO[lh],fO=dO[\"Map\"],b7=id(xx,xw),bd=id(xz,xy);function\nxt(a,b){return[0,a,b]}function\njw(a){return b4(a,fN)?[0,a0,a]:b4(a,fO)?[0,w,a]:b4(a,fM)?[0,bD,a]:[0,U,a]}function\nxA(a){var\nb=fp(a,xB);if(b)return[0,b[1]];var\nc=fp(a,xC);if(c)return[1,iP(jw,c[1])];var\nd=fp(a,xD);if(d)return[2,d[1]];throw g([0,f,xE],1)}ig(xF,b7,[0,function(a){return new\nfN},function(a,b,c){a.insert(b,iQ(function(a){var\nb=a[1];return bD<=b?a0<=b?a[2]:a[2]:w<=b?a[2]:a[2]},c));return 0},function(a,b,c){a.delete(b,c);return 0},function(a,b){a.push(iQ(function(a){var\nb=a[1];return bD<=b?a0<=b?a[2]:a[2]:w<=b?a[2]:a[2]},b));return 0},function(a,d){a.forEach(function(a,b,c){return y(d,b,jw(a),c)});return 0},function(a,b){function\nc(a){return h(b,xt(xA,a))}a.observe(c);return c}]);function\nfP(a){return b4(a,fN)?[0,a0,a]:b4(a,fO)?[0,w,a]:b4(a,fM)?[0,bD,a]:[0,U,a]}function\njx(a,b){return function(a){return dA(fP,a)}(a.get(v(b)))}function\nxG(a){return a}function\nxH(a){return xG(a[f7])}function\nxI(a){var\nb=ay(a[\"action\"]);if(b!==\"add\")if(b!==la){if(b!==\"update\")throw g([0,cb,h(A(xJ),b)],1);var\nc=1}else\nvar\nc=2;else\nvar\nc=0;var\nd=a[\"oldValue\"],e=b3(d)?0:[0,fP(d)];return[0,c,0,e]}function\njy(a){return ul(a.entries())}ig(xK,bd,[0,function(a){return new\nfO},[0,function(d){var\na=d[kh][\"keys\"].entries();return iS(ay,xI,function(a,b,c){var\ne=jx(xH(d),a);return fL[2].call(null,a,[0,b[1],e,b[3]],c)},a,fL[1])}],jx,function(a,b,c){var\nd=c[1],e=bD<=d?a0<=d?c[2]:c[2]:w<=d?c[2]:c[2];a.set(v(b),e);return 0},function(a,b){a.delete(v(b));return 0},jy,function(a,d,c){return iS(ay,fP,function(a,b,c){return y(d,a,b,c)},jy(a),c)},function(a,b){function\nc(a){return h(b,a)}a.observe(c);return c}]);var\nxL=dO[\"Doc\"];function\njz(a,b){return a.getArray(v(b))}function\nbx(a,b){a.transact(bJ(1,b));return 0}function\nfQ(a){return a}var\nam=bd[4],aX=bd[3],cG=bd[1],dP=b7[5],fR=b7[4],jA=b7[3],jB=b7[1];function\nxu(a){var\nb=a[1];return[0,function(a){return iP(b,a)}(a[2][kh][\"delta\"])]}function\nxv(a,b){var\nc=a?[0,v(a[1])]:[0];return l6(fM,c)}function\nxM(a){return new\nxL}var\nxN=bd[8],xO=bd[7],xP=bd[5],xQ=bd[2][1],xR=b7[6];function\nxS(a){return a}var\nxT=B7(0)[\"Awareness\"];function\nxV(a,b,c){a.setLocalStateField(v(b),c);return}function\njC(a){return a}function\nxU(a){return new\nxT(fQ(a))}function\nxW(a,b,c,d){if(c)var\nf=[0,xX,v(c[1])],e=[0,[0,xY,v(b)],f];else\nvar\ne=[0,[0,x0,v(b)]];return xV(a,xZ,gU(e))}var\nx1=B8(0);function\nx2(a,b){var\nc=fQ(b);new\nx1(v(a),c);return}var\nx3=B$(0);function\nfS(a,b,c){switch(b){case\n0:a.on(v(x_),bJ(1,function(a){return h(c,[0,a[\"connected\"]|0])}));return;case\n1:a.on(v(x$),bJ(1,function(a){return h(c,[0,a[lo]|0])}));return;default:a.on(v(ye),bJ(1,function(b){function\na(a){return function(a){return iR(ay,a)}(b[a])}var\nd=a(ya),e=a(yb),f=a(yc);return h(c,[0,a(yd),f,e,d])}));return}}function\nx4(a,b,c,d){var\nf=cj(function(a){return[0,x5,fr(v,a)]},b),e=[0,[0,x8,{config:{iceServers:fr(function(a){return a},c4(function(a){return{urls:v(h(A(x7),a))}},x6))}}]];aF([0,e,0]);function\ng(a){return a}var\ni=gU(c7(function(a){return hc(g,a)}([0,f,[0,e,[0,cj(function(a){return[0,x9,jC(a)]},c),0]]]))),j=fQ(d);return new\nx3(v(a),j,i)}var\njD=B9(0),yf=B_(0);function\nyh(a){switch(a){case\n0:var\nb=yi;break;case\n1:var\nb=yj;break;case\n2:var\nb=yk;break;case\n3:var\nb=yl;break;default:var\nb=ym}return v(b)}function\nyg(a,b){jD.register(v(a),b);return}function\nyn(a,b,c,d){var\ne=a?a[1]:0,f=e?yo:yr,g=cj(function(a){return[0,yp,!!a]},b),h=gU(c7(hc(function(a){return a},[0,g,[0,cj(function(a){return[0,yq,fr(yh,a[1])]},c),0]])));return{theme:v(f),modules:h}}function\nys(a,b){return new\njD(a,b)}function\nyt(a){return a}var\nyu=Ca(0)[\"QuillBinding\"];function\nyv(a,b,c){var\nd=mK(cj(jC,a)),e=[0,yt(c),d];function\nf(a,b){l6(a,b);return}return function(a){return f(yu,a)}(c7([0,xS(b),e]))}function\nyw(a,b,c){return y(eN(s,yx),b,c,a)}function\njE(a,b,c){var\nd=0<=c?1:0;if(d)var\ne=0<=b?1:0,f=e?(b+c|0)<=a?1:0:e;else\nvar\nf=d;var\ng=1-f;return g?yw(a,b,c):g}var\nyy=[0];function\nyz(a,b,c,d){var\ne=ap(a,b);cm(c,0,e,0,d);return e}function\njF(a,b){return b<=a?a:b}function\njG(a){return eN(s,a)}function\nyA(a,b){var\nc=a[1];return i(jG(yB),b,c)}function\nyC(a,b){return i(jG(yD),a,b.length-1)}function\ncH(a,b){var\nc=1-(a<=b.length-1?1:0);return c?yC(a,b):c}function\njH(a){return[0,0,0,yy]}function\ncI(a){return a[1]}function\nyE(a,b){return a[3][1+b]}function\njI(a){var\nb=a[1],c=a[3];cH(b,c);if(0>>4|0)));var\nf=b+1|0;function\ni(a,b,c){at(a,b,c);return}return function(a){return i(d,f,a)}(h(g,c&15))}for(;;){if(4<=d[1])break;var\nn=D(b,d[1]);f(e,c[1],n);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(6<=d[1])break;var\nm=D(b,d[1]);f(e,c[1],m);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(8<=d[1])break;var\nl=D(b,d[1]);f(e,c[1],l);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(10<=d[1])break;var\nk=D(b,d[1]);f(e,c[1],k);c[1]=c[1]+2|0;d[1]++}c[1]++;for(;;){if(16<=d[1])return $(e);var\nj=D(b,d[1]);f(e,c[1],j);c[1]=c[1]+2|0;d[1]++}}var\nyR=hG(0),an=xM(0),fU=xU(an);yg(yT,yf);xW(fU,yU,0,0);var\ndQ=x4(yW,yV,[0,fU],an);x2(yX,an);dG[\"yjsdoc\"]=an;dG[\"yjsprovider\"]=dQ;var\nfV=ae(0),jL=ae(0),jM=ae(0);fS(dQ,0,function(a){var\nb=a[1];b5([0,yY,[0,!!b,0]]);return ab(jL,b)});fS(dQ,1,function(a){var\nb=a[1];b5([0,yZ,[0,!!b,0]]);return ab(jM,b)});var\ndR=[0,0];fS(dQ,2,function(a){b5([0,y0,[0,a,0]]);function\nc(b){return m3(function(a){return ez(b,a)},a[3])}function\nd(b){var\nc=[0,0];dR[1]=hb(function(a){return ez(b,a)?(c[1]=[0,b],1):0},dR[1]);return c[1]}var\nb=eu(function(a,b){if(d(b))return a;if(c(b))dR[1]=[0,b,dR[1]];return a+1|0},0,a[1]),e=es(a[2]);return function(a){return ab(fV,a)}((bq(fV)+b|0)-e|0)});var\ny4=ar(jM),y6=cF(y5,al([0,82,bY(ar(jL),y4,function(a,b){var\nc=a?b?y1:y2:y3;return[0,c]})])),y8=K(0,[0,y6],0,0,[0,[0,80,aW(0,y7)],0]),y9=[0,[0,82,y8],[0,[0,82,k(ar(fV),function(a){return aW(0,ms(a))})],0]];function\nyS(a){return yO(yR,0)}function\nza(a,b){var\nc=a?a[1]:64,d=ip(0);return[0,d,hL(0,c)]}function\njN(a,b,c){var\ne=hM(a[2],b);if(e)var\nd=e[1];else{var\ng=e_(0,a[1]);hN(a[2],b,g);var\nd=g}var\nf=e$(d);return f?ab(f[1][2],[0,c]):s2(d,[0,b,ae([0,c])])}function\nfW(a,b){var\nc=hM(a[2],b);if(c)var\nd=c[1];else{var\nf=a[1],e=e_([0,[0,b,ae(0)]],f);hN(a[2],b,e);var\nd=e}return ar(c3(e$(d))[2])}function\nfX(a,b){return k(fW(a,b),function(a){if(!a)return 0;var\nb=a[1];if(typeof\nb!==\"number\"&&U===b[1])return[0,ay(b[2])];throw g([0,f,zb],1)})}function\nzc(a){var\nb=ip(0);return[0,b,jH(0)]}function\nzd(a){try{var\nc=[0,jK(a[2],0)];return c}catch(f){var\nb=M(f);if(b[1]===cb)return 0;throw g(b,0)}}function\njO(a,b){var\nc=e_(a,b[1]);return yH(b[2],c)}function\njP(a,b,c,d){var\ne=[0,b,[0,c,[0,cI(d),0]]];b5([0,ze,[0,cI(a),e]]);var\nf=cI(d),g=jK(a,0);fT(d,hj(c,function(a){return g}));return yL(a,b,d,f,c)}function\nzf(i,b,c){var\ne=[0,0],j=i[2],d=jH(0);hk(function(a){switch(a[0]){case\n0:var\nm=a[1];jP(j,e[1],m,d);e[1]=e[1]+m|0;return 0;case\n1:var\nc=a[1];if(0!==cI(d)){var\no=[0,jI(d)];return fT(d,hl(function(a){var\nd=h(b,a),c=sY([0,d],o[1]);o[1]=c;return c},c))}var\nn=zd(i);if(!n)return hk(function(a){var\nc=h(b,a);return jO([0,c],[0,i[1],d])},c);var\ns=n[1];return fT(d,hl(function(a){return sW([0,h(b,a)],s)},c));default:var\nk=a[1],t=0===e[1]?tE(i[1]):iw(jI(d)),p=[0,t],u=1;if(k>=1){var\nl=u;for(;;){var\nq=p[1];if(!q)throw g([0,f,zg],1);var\nr=q[1];p[1]=iw(r);s5(r);var\nv=l+1|0;if(k===l)break;l=v}}e[1]=e[1]+k|0;return 0}},c);var\nk=e[1],a=cI(j)-k|0;if(0