diff --git a/S2/AnaMech/MechVL1.typ b/S2/AnaMech/VL/MechVL1.typ similarity index 97% rename from S2/AnaMech/MechVL1.typ rename to S2/AnaMech/VL/MechVL1.typ index f0ea1b4..6d0ee3a 100644 --- a/S2/AnaMech/MechVL1.typ +++ b/S2/AnaMech/VL/MechVL1.typ @@ -54,9 +54,6 @@ Grundlage fuer die ersten Wochen Newton II. BWGL -// Arrow und dot in typstar -// TODO: make it work with subscripts - $ dot(arrow(p)) = dif / (dif t) arrow(p) = m dot.double(r) = sum_(i=0)^(n) arrow(F_i) (arrow(r) dot(arrow(r))) $ diff --git a/S2/AnaMech/AnaMech_Hahn_Penning_Zettel_1.typ b/S2/AnaMech/Zettel/AnaMech_Hahn_Penning_Zettel_1.typ similarity index 100% rename from S2/AnaMech/AnaMech_Hahn_Penning_Zettel_1.typ rename to S2/AnaMech/Zettel/AnaMech_Hahn_Penning_Zettel_1.typ diff --git a/S2/CWR/CwrVL1.typ b/S2/CWR/VL/CwrVL1.typ similarity index 100% rename from S2/CWR/CwrVL1.typ rename to S2/CWR/VL/CwrVL1.typ diff --git a/S2/CWR/VL/CwrVL2.typ b/S2/CWR/VL/CwrVL2.typ new file mode 100644 index 0000000..726328d --- /dev/null +++ b/S2/CWR/VL/CwrVL2.typ @@ -0,0 +1,161 @@ +// Diff template +#import "../preamble.typ": * + +#show: conf.with(num: 2) + += Differentialgleichungen + +ODEs + +Mechankik: $dot.double(x) + omega_0 ^2 x=0$ ist eine ODE der Ordnung 2 + +$m dot.double(x) = F(x, dot(x), t)$ Newtons'sche Mechanik + +zuruck fueren auf ein System von ODEs 1. Ordnung + +Hamilton'sche Mechanik: + +$ +(partial HH(q, p)) / (partial d) = p/m, HH(q, p) = (p^2 ) / (2m) + V(q)\ +dot(p)=-(partial HH) / (partial q) = - (partial V) / (partial q) +$ + +Anfangsbedingungen $q(t=0) = q_0 "und" p(t=0) = p_0 $.\ +Beispiele sind Ratengleichungen, radioaktiver Zerfall und Populationsdynamik. + +== Pearl-Unschulat Modell + +$n(t): "Anzahl der Individuen"$ + +$ + (dif n) / (dif t) = sqrt(n)n\ + sqrt(n)="const"\ + n(t) = n(0)exp(sqrt(t)) \ + sqrt(n)=r_0 (1-k_n ), k="const">0 +$ + +allgemeine Formulierung: $y^((n)) (t)=g (y, y', ..., y^((n+1)), t )$ + +$ + y_(n)=y^((n)) \ + y^((n+1))+y^((n)) = g(y,y_1 , ..., y_(n-1), t)\ + y'_(n-2) =y_(n-1) \ + y'=g_1 +$ + +$ + dot(arrow(y)) = arrow(g)(y_1, ..., y_(n-1) )\ + (dif y) / (dif t) = g(y, t) +$ + +Diskretisierung der Zeit $[0, T], t_0 = 0, t_1 =Delta t, t_n =n Delta t=T$ + +$ +y (t_i ) =y(t_(i-1)) +integral_(t_i )^(t_(i-1)) d t g (y (t), t) approx^("Euler-Cauchy") y (t_(i-1))+g (y (t_(i-1) , t_(i-1) )) Delta t + O(Delta t^2 )\ +$ + +mit globalem Fehler bei Integration ueber $[Q, T]$ + +$ + E ~ (T) / (Delta t) Delta t^2 ~ T Delta t ~ O(Delta t) +$ + +Beispiel Ratengleichung $r (n)=r- (1-k_n )$ + +$ + n (t_i ) = n (t_(i-1) )+r_0 (1-k_n / t_(i-1) )n (t_(i-1) Delta t)\ + n (t_i )=(1+Delta t r_0 )n (t_(i-1) ) (1- (Delta t r_0 k) / (1+ Delta t r_0 ) n (t_(i-1) )) +$ + +Variable $x (t_(i-1))=(Delta t r_0 k) / (1+Delta t r_0 ) n (t_(i-1) )$ + +$ + x (t_i )=4 mu x (t_(i-1) ) (1- x (t_(i-1) )), 4 mu=1+Delta t r_0 +$ + +Zuletzt: $Delta t$ klein + +$ + n (t)=1/k, x (t)=(Delta t r_0 ) / (1+ r_0 Delta t)=(4 mu-1) / (4 mu) +$ + +Pointcarre Abbildung mit Bifurkation. + +== Leapfrog Algorithmus + +// TODO: implement nl and Delta t in tyupstar as well as + + +$ + y'=g (y,t), y' (t_i ) (y (t_i )-y (t_(i-1) ) ) / (Delta t) + O (Delta t)\ + y' (t_i )=(y (t_(i+1)) -y (t_(i-1) )) / (Delta t) + O (Delta t) +$ + +#highlight[TODO: Implement this algorithmus as well as the global error] + +== Velocity-Verlet Algorithmus fuer klassische Mechanik + +$ + dot(arrow(t))=vec(dot(x) (t),dot(v) (t))=vec(v (t),a (x_(i) t))\ + v (t_(i+1) )=x (t_(i-1) )+2v (t_i )Delta t+O (Delta t^3 )\ + v (t_(i_1) )=v (t_(i-1) )+2a (x (t_i ),t_1 )Delta t+O(Delta t^3 ) +$ + +Umschreiben der zweiten Gleichung: + +Es wird von $t_(i-1) "nach" t_(i+1)$ gegangen. + +$ + v (t_i )=v (t_(i-1) )+a (x (t_(i_1) ), t_(i-1) )Delta t\ + x (i_(i+1) )= x (t_(i-1) )+2v (t_i ) Delta t \ + v (t_(i+1) )=v (t_i )+a (x (t_(i+1) ),t_(i+1))Delta t +$ + +Das ergibt + +$ + v (t_(i+2) )=v (t_(i+1) )+a (x (t_(i+1) )t_(i+1) )Delta t +$ + +$==>$ $v (t_(i+2) )=v (t_i )+2a (x (t_(i+1) ), t_(i+1) )Delta t$ + +$2 Delta t = delta t$ + +$ + v (t+(delta t) / (alpha) )=v (t)+a (x (t),t) (delta t) / (2) \ + x (t+delta t)=x (t)+v (t+(delta t) / (2))delta t\ + v (t+delta t)=v (t+(delta t) / (s))+a (x (t+delta t),t+delta t)(delta t) / (2) \ +$ + +== Forderungen an einen guten Integrator der klassischen Mechanik +- Energieerhaltung +- Zeitumkehrinvarianz + + der Bewegungsgleichungen sind zeitumkehrbar invariant. Jeder vernuenftige Algorithmus erfuellt dies zu der Ordnung $O(delta t^2 )$\ + $ + vec(x_0, v_0 )=vec(x (t),v (t))->^(T (Delta t)) vec(x (t+Delta t),v (t+Delta t))-> $ + + des Algorithmus $x_0 -x_1 =0, v_0 -v_1 = 0$ +- Phasenraumerhaltung symplektisch + +$t_(i-1) -> t_(i+1) $ + +Zeitumkehr +$ + arrow(x)' (t_(i+1) )=arrow(x) (t_(i+1) )\ + arrow(v)' (t_(i+1) )= - arrow(v) (t_(i+1) ) +$ + +$t_(i+1) -> t_(i+3) $ + +$ + v' (t_(i+2))= v' (t_(i+1) )+a (x' (t_(i+1) ),t_(i+1) ) Delta t =-v (t_(i+1)) +a (x (t_(i-1) ))Delta t \ + x' (t_(i+1) )= x' (t_(i+1) )+2v' (t_(i+1) )Delta t\ + = x (t_(i+1) )+2 [-v (t_(i+1) )+a (x (t_(i+1) ))Delta t]Delta t \ + = x (t_(i-1) )+2 Delta t [v (t_i )-v (t_(i+1) )+a (x (t_(i+1) ))Delta t]\ + = x (t_(i-1) ) +$ + + +=== Takeways +- Ableitung diskretisierung +- Taylorentwicklung der Ableitung +- Mit Euler-Cauchy kann am einfachsten nach vorne integriert werden + diff --git a/S2/CWR/pdfs/CwrVL2.pdf b/S2/CWR/pdfs/CwrVL2.pdf new file mode 100644 index 0000000..e268c5e Binary files /dev/null and b/S2/CWR/pdfs/CwrVL2.pdf differ diff --git a/S2/CWR/preamble.typ b/S2/CWR/preamble.typ new file mode 100644 index 0000000..7e7ee37 --- /dev/null +++ b/S2/CWR/preamble.typ @@ -0,0 +1,14 @@ +#import "../../default.typ": * + +#let conf(num: none, ueb: false, body) = { + // Global settings + show: default + + // Set the header + [CWR \ Vorlesung #(num)] + // Make tcahe outline + outline() + + // load the document + body +} diff --git a/S2/CWR/template.typ b/S2/CWR/template.typ index 6feab29..9fcabbf 100644 --- a/S2/CWR/template.typ +++ b/S2/CWR/template.typ @@ -1,3 +1,7 @@ +// Diff template +#import "./preamble.typ": * + +#show: conf.with(num: 1) = Uebersicht diff --git a/S2/DiffII/VL/DiIIVL1.typ b/S2/DiffII/VL/DiIIVL1.typ index d9504d2..06fa43b 100644 --- a/S2/DiffII/VL/DiIIVL1.typ +++ b/S2/DiffII/VL/DiIIVL1.typ @@ -46,8 +46,6 @@ Wir schreiben $underline(x)$ fuer einen Vektor $x$. Ich werde einfache Symbole v Wir definieren das *Standard-Skalarprodukt* als $angle.l dot, dot angle.r: CC^n times CC^n -> CC$. - -// TODO: add angles to typstar #lemma[ Cauchy-Schwarz Ungleichung @@ -57,7 +55,7 @@ Wir definieren das *Standard-Skalarprodukt* als $angle.l dot, dot angle.r: CC^n ] #proof[ - #highlight[TODO] + #highlight[TODO: Create proof for cauchy schwarz] ] #lemma[ @@ -65,7 +63,7 @@ Wir definieren das *Standard-Skalarprodukt* als $angle.l dot, dot angle.r: CC^n ] #proof[ - #highlight[TODO] + #highlight[TODO: Proof, dass die euklidische Metrik eine Metrik auf R^n ist] // Hier wird der Teil 3 ueber das Ausschreiben von abs(x+y)^2 gemacht // Dannach kann die Cauchy Schwarz ungleichung verwendet werden um eine Abschaetzung nach oben zu gewinnen // Mit der binomischen @@ -91,7 +89,7 @@ Sei $x_k, k in NN$ eine Folge im $RR^n$ ] #proof[ - #highlight[TODO] + #highlight[TODO: proof fuer das lemma, dass folgen komponentenweise konvergieren] Idee: verwende die Ungleichung $abs(x_k-a_l) <= abs(x_k-a) <= sum_(i=0)^(n) abs(x_k-a_l )$ ] @@ -119,7 +117,7 @@ Sei $x_k, k in NN$ eine Folge im $RR^n$ Dann ist diese Folge beschraenkt auf $RR^n$ eine beschraenkte folge mit konvergenter Teilfolge. - #highlight[TODO] + #highlight[TODO: Finish proof of Bolzano weierstrass fuer R^n] ] #theorem[ diff --git a/S2/DiffII/pdfs/DiIIVL1.pdf b/S2/DiffII/pdfs/DiIIVL1.pdf new file mode 100644 index 0000000..f14d583 Binary files /dev/null and b/S2/DiffII/pdfs/DiIIVL1.pdf differ diff --git a/S2/DiffII/preamble.typ b/S2/DiffII/preamble.typ new file mode 100644 index 0000000..b8b31e3 --- /dev/null +++ b/S2/DiffII/preamble.typ @@ -0,0 +1,14 @@ +#import "../../default.typ": * + +#let conf(num: none, ueb: false, body) = { + // Global settings + show: default + + // Set the header + [Diff II \ Vorlesung #(num)] + // Make tcahe outline + outline() + + // load the document + body +} diff --git a/S2/ExPhyII/ExIIVL1.typ b/S2/ExPhyII/VL/ExIIVL1.typ similarity index 98% rename from S2/ExPhyII/ExIIVL1.typ rename to S2/ExPhyII/VL/ExIIVL1.typ index 426f25e..4dbb5cf 100644 --- a/S2/ExPhyII/ExIIVL1.typ +++ b/S2/ExPhyII/VL/ExIIVL1.typ @@ -80,12 +80,13 @@ Geschicktlich fielen drei Phaenomene der Elektrodynamik auf, ohne dass Zusammenh + Licht + Elektrizitaet + Magnetismus + Diese wurden von verschiedenen Personen zu verschiedenen Zeiten entdeckt. - Erste Gesetzmaessigketen des Lichts (Licht nimmt immer den kuerzesten Weg): Heron v. Alexandrea (ca. 60 n.Chr.) - Elektrizitaet: Thales von Milet (600 n. Chr.), geriebener Bernstein (griechisch: "electron") zieht leichte Koerper an - Magnetismus: Petrus Peregrinu (1269) fuehrte erste Beobachtungen zu magnetischen Feldlinien durch - Gilbert (1544-1605) erkannte wichtigen Unterschied zu $arrow(E)$ & $arrow(B)$ Feldern: Magnete rufen Drehwirkung hervor, elektrische Kraft aeussert sich als Anziehungs-Kraft -Fuer weitere geschichtliche Entwicklung z.B. siehe Geschichte der Elektrizitaet, H. Bortias. +Fuer weitere geschichtliche Entwicklung z.B. siehe Geschichte der Elektrizitaet, H. Bortias = 1. Elektrostatik @@ -93,7 +94,8 @@ Fuer weitere geschichtliche Entwicklung z.B. siehe Geschichte der Elektrizitaet, === 1.1.1 Zusammenfassung historischer Beobachtungen -+ Es existieren zwei verschiedene Ladungen (+,-), diese koennen durch ihre kraftwirkung aufeinander und Ablenkung in elektischen Feldern unterschieden werden. ++ Es existieren zwei verschiedene Ladungen (+,-), diese koennen durch ihre kraftwirkung aufeinander und Ablenkung in elektischen Feldern unterschieden werden + Ladungen gleichen Vorzeichens stossen sich ab. Ladungen mit unterschiedlichen Vorzeichen ziehen sich an (*Unterschied* zur immer attraktiven Gravitation) + Ladungen sind an Teilchen gebunden, insbesondere Elektronen ($e^(-)$) und Protonen ($p^(+)$) dessen Ladung sich nicht mit der Geschwindigkeit aendert + Ladung der Elektronen und Protonen stellt die kleinste #underline[frei] beobachtete Ladungen dar (Ausnahmen stellen kurzlebige Teilchen dar) + diff --git a/S2/ExPhyII/VL/ExIIVL2.typ b/S2/ExPhyII/VL/ExIIVL2.typ new file mode 100644 index 0000000..5f3f2c5 --- /dev/null +++ b/S2/ExPhyII/VL/ExIIVL2.typ @@ -0,0 +1,98 @@ +#import "../preamble.typ": * + +#show: conf.with(num: 2) + += Organisatorisches + +Zeiten: 0810-0953 mit 5min Pause. + +=== 1.1.1 Weitere Beobachtungen (Ergaenzung zu VL1) + +5. Ladungen koennen weder erzeugt noch vernichtet werden. In abgeschlossenen Systemen bleibt die Gesamtladung konstant (Ladnung lann aber in einem System getrennt werden). ++ Es gibt Stoffe in denen elektrische Ladungen frei verschiebbar sind (Leiter z.B. Metalle, Ionen (z.B. Elektrolyt, Plasma), Halbleiter) und Stoffe in denen die Ladungen fest gebunden sind (z.B. Diamant) ++ Ein Ladungstransport stellt einen elektrischen Strom dar dieser ist mit Massetransport verbunden (Ladung ist immer Materie gebunden) + +Q: Werden herkoemmliche A Batterien schwerer oder leichter wenn man die Ladung veraendert? + +=== 1.1.2. Bespielhafte Experimente die die o.g. Beobachtungen demonstrieren + +- Reibungselektrizitaet + + *Durchfuehrung*: Katzenfell wird an einem PVC-Stab gerieben, wodurch die Ladungen vom Fell auf den Stab uebergehen. Anschliessend wird die Vorhandene Spannung mit einer neutral geladenen Metallkugel verdeutlicht. + + *Beobachtung*: Nach dem Reiben wird die Kugel von dem Stab angezogen. + + *Erklaerung*: Durch die Influenz werden die Ladungen in der Kugel getrennt. Die negativen Ladungen sammeln sich an der Gegenueberligenden Seite, wodurch die zugewandte Seite positive geladen ist. Falls sich die Objekte beruehren kommt es zu einem Ladungsaustauch und beide sind so negativ geladen und es kommt zum Abstossen. + Die positiven Ladungen sind nach dem Reiben im Katzenfell (Ladungserhaltung). + + Ladungen koennen durch Influenz getrennt werden, dann ueberfuehrt werden und schlussendlich so in verschiedene Objekte getrennt werden. + + A: Graphit wird zur Monolage mit Tesafilm, wodurch dann Stroeme gemessen werden koennen. + +- Influenzmaschine + + Zwei gleich grosse isolierte Scheiben drehen sich gegeneinander. Durch zufaellige Influenz gekoppelt mit Ladungsabnehmern werden Spannungen von bis zu 60 kV erzeugt. Die Funkenentladung an Luft braucht eine Spannung von $3"kV"slash"mm"$ + + Q: Ist die Influenz in der Infzluenzmaschine zufaellig? + + Q: Wie enstehen die Funken?\ + A: Wenn ein Elektrisches Feld zu stark wird dann Ionisiert die Luft und es ensteht ein Plasma, welches fuer den Ladungsausgleich sorgt. + +- Lichtenbergfiguren (Georg Friedrich Lichtenberg, Goettingen Dozent wegweisend fuer die moderne Physik aufgrund siners analytischen Denkens (1762 - 1798)) + + *Durchfuehrung*: Eine metallene Spitze wird ueber eine Plexigasscheibe gehalten die auf einer Metallplatte liegt und diese Metallplatte ist mit der Erde verbunden. + + *Beobachtung*: Die positive Lichtenbergfigur erstellt sich durch Staub auf der Platte und ist durch radiale Linien vom Mittelpunkt nach Aussen gegennzeichnet. Die negative Figur ist viel zentrierter und dichter am Mittelpunkt. + +PAUSE + +=== 1.1.3 Coulomb'sche Gesetz + +Fuer die Kraft die $q_1 $ auf Testladung $q_2 $ ausuebt wurde experimentell festgestellt +$ + arrow(F)_(12) = (1) / (4 pi epsilon_0) (q_1 q_2 ) / (r^(2)_(12) ) hat(e)_(12) , +$ +wobei $epsilon_0 = 8.854 dot 10^(-12) ("As") / ("Vm")$ die Dielektrizitaetskonstante ist. +$ + r_(12) = abs(arrow(r)_(2) - arrow(r)_(1) )\ + hat(e)_(12) = "Einheitsvektor in Richtung"arrow(r)_(1) -> arrow(r)_(2) \ + arrow(F)_(12): "Kraft von" q_1 "auf" q_2 +$ +$q_1 "und" q_2 $ werden mit Vorzeichen eingesetzt. +- Es gilt, dass sich gleiche Ladungen abstossen +- Actio gleich Reactio $->$ auf $q_1 $ wirkt $-arrow(F)_(12) = arrow(F)_(21) $ + +Messung erfolgt mit der Coulombschen Drehwaage: Messung $(1) / (r^2) $ Abhaengigkeit. +Diese Messung ist parrallel zu der Gravitationswaage bei der Gravitation +Die Messung kann auch funktionieren durch mehrere Messungen wenn die Ladungen gleich bleiben (dafuer ist eine geringe Luftfeuchtigkeit notwendig). + +Fuer die Coulombkraft gilt das Superpositiionsprinzip + +$ + arrow(F)_(i) = sum_(j) (q_i q_j ) / (4 pi epsilon_0 ) (arrow(r)_(i) - arrow(r)_(j) ) / (abs(arrow(r)_(i) - arrow(r)_(j) ^3 )) +$ + +es ueberlagern sich also die Kraefte von Quellladungen auf die Testladung. \ +$->$ Dieses Prinzip ist keine logische Notwendigkeit sondern ain experimenteller Befund. + += Einheiten + +Hier wird das SI-System verwendet.\ +Die Masseinheit der Ladung ist Coulomb $[Q] = 1 "Coulomb" = 1"C" = 1"As"$. + +Anderes System: *Causs'sche cgs System* + +$->$ setze $(1) / (4 pi epsilon_0 ) = 1 -> [F] = ([Q^2 ]) / ([r^2 ]) -> [Q] = 1"ESL" = ("gcm") / ("s") $ + +$->$ wird oft in theoretischer Physik verwendet. Elementarladung in cgs: $q_(e) = 4,803 dot 10^(10) ("cm"^(3/2) g^(1/2) ) / (s) $. + +=== 1.1.4. Vergleich Coulomb mit Gravitationskraft + +Coulomb: $arrow(F)_(C) = (1) / (4 pi epsilon_0 ) (q_1 q_2 ) / (r^2 ) hat(e)$ + +Gravitation: $arrow(F)_(G) = -G (m_1 m_2 ) / (r^2 ) hat(e)$ + +- beide in $(1) / (r^2 ) $ Abhaengigkeit +- Vergleiche Groessen: $(1) / (4 pi epsilon_0 ) =889 dot 10^(9) ("Nm"^2 ) / ("C"^2 ) >>> G = 6.67 dot 10^(-11) ("m"^3 ) / ("kg""s"^2 ) $ +- im Mikroskopischen dominiert die Coulombkraft (z.B. haelt der Atomkern und Elektronenzonen) + diff --git a/S2/ExPhyII/pdfs/ExIIVL2.pdf b/S2/ExPhyII/pdfs/ExIIVL2.pdf new file mode 100644 index 0000000..74fc5c8 Binary files /dev/null and b/S2/ExPhyII/pdfs/ExIIVL2.pdf differ diff --git a/S2/ExPhyII/pdfs/ExPhy2_Uebung_00.pdf b/S2/ExPhyII/pdfs/ExPhy2_Uebung_00.pdf new file mode 100644 index 0000000..a7195b4 Binary files /dev/null and b/S2/ExPhyII/pdfs/ExPhy2_Uebung_00.pdf differ diff --git a/S2/ExPhyII/pdfs/ExPhy2_Uebung_01.pdf b/S2/ExPhyII/pdfs/ExPhy2_Uebung_01.pdf new file mode 100644 index 0000000..566e565 Binary files /dev/null and b/S2/ExPhyII/pdfs/ExPhy2_Uebung_01.pdf differ diff --git a/S2/ExPhyII/template.typ b/S2/ExPhyII/template.typ index 1342ba8..f27b5c1 100644 --- a/S2/ExPhyII/template.typ +++ b/S2/ExPhyII/template.typ @@ -1,4 +1,4 @@ -#import "./preamble.typ": * +#import "../preamble.typ": * #show: conf.with(num: 1) diff --git a/S2/Neuro/NeuroVL1.typ b/S2/Neuro/NeuroVL1.typ deleted file mode 100644 index e69de29..0000000 diff --git a/S2/Neuro/VL/NeuroVL1.typ b/S2/Neuro/VL/NeuroVL1.typ index 1342ba8..fc13aa1 100644 --- a/S2/Neuro/VL/NeuroVL1.typ +++ b/S2/Neuro/VL/NeuroVL1.typ @@ -1,6 +1,13 @@ -#import "./preamble.typ": * - -#show: conf.with(num: 1) += Verpasster Stoff -= Uebersicht +Ich bin erst um 12:30 gekommen und habe deshalb viel Stoff verpasst. + += Modelle des menschlichen Gehirns + +Es gibt verschiedene Ebenen auf welchen das Gehirn modelliert werden kann: + +- Als Ganzes +- ... ? +- Synapsen +- Molekuele diff --git a/S2/Neuro/pdfs/NeuroVL1.pdf b/S2/Neuro/pdfs/NeuroVL1.pdf new file mode 100644 index 0000000..e3fb5bf Binary files /dev/null and b/S2/Neuro/pdfs/NeuroVL1.pdf differ diff --git a/book.typ b/book.typ new file mode 100644 index 0000000..b3c10a5 --- /dev/null +++ b/book.typ @@ -0,0 +1,27 @@ +#import "@preview/shiroa:0.2.2": * + +#show: book + +#book-meta( // put metadata of your book like book.toml of mdbook + + title: "shiroa", + + description: "shiroa Documentation", + + repository: "https://github.com/Myriad-Dreamin/shiroa", + + authors: ("Myriad-Dreamin", "7mile"), + + language: "en", + + summary: [ // this field works like summary.md of mdbook + + = Introduction + + - #chapter("S2/ExPhyII/VL/ExIIVL1.typ", section: "1.1")[Installation] + + - #chapter(none, section: "1.2.1")[Drafting chapter] + + ] + +) diff --git a/default.typ b/default.typ index b85ae35..1e5b1a8 100644 --- a/default.typ +++ b/default.typ @@ -4,8 +4,13 @@ #let default(body) = { // page setup - set page(margin: 2cm, numbering: "1") + //set page(margin: 2cm, numbering: "1") set text(lang: "de", hyphenate: false) + set align(left) + // For now no automatic numbering + // set heading(numbering: "1.1") + set par(justify: true) + // set par(justify: true) // equation setup diff --git a/public/S2/ExPhyII/VL/ExIIVL1.ayu.multi.sir.in b/public/S2/ExPhyII/VL/ExIIVL1.ayu.multi.sir.in new file mode 100644 index 0000000..353e1e5 Binary files /dev/null and b/public/S2/ExPhyII/VL/ExIIVL1.ayu.multi.sir.in differ diff --git a/public/S2/ExPhyII/VL/ExIIVL1.coal.multi.sir.in b/public/S2/ExPhyII/VL/ExIIVL1.coal.multi.sir.in new file mode 100644 index 0000000..ec706b2 Binary files /dev/null and b/public/S2/ExPhyII/VL/ExIIVL1.coal.multi.sir.in differ diff --git a/public/S2/ExPhyII/VL/ExIIVL1.html b/public/S2/ExPhyII/VL/ExIIVL1.html new file mode 100644 index 0000000..09421e1 --- /dev/null +++ b/public/S2/ExPhyII/VL/ExIIVL1.html @@ -0,0 +1,281 @@ + + + + + + + shiroa + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+
+ +
+ + +
+
+ + + +
+ + + + + + + + +
+ + + \ No newline at end of file diff --git a/public/S2/ExPhyII/VL/ExIIVL1.light.multi.sir.in b/public/S2/ExPhyII/VL/ExIIVL1.light.multi.sir.in new file mode 100644 index 0000000..c804285 Binary files /dev/null and b/public/S2/ExPhyII/VL/ExIIVL1.light.multi.sir.in differ diff --git a/public/S2/ExPhyII/VL/ExIIVL1.navy.multi.sir.in b/public/S2/ExPhyII/VL/ExIIVL1.navy.multi.sir.in new file mode 100644 index 0000000..31b0538 Binary files /dev/null and b/public/S2/ExPhyII/VL/ExIIVL1.navy.multi.sir.in differ diff --git a/public/S2/ExPhyII/VL/ExIIVL1.rust.multi.sir.in b/public/S2/ExPhyII/VL/ExIIVL1.rust.multi.sir.in new file mode 100644 index 0000000..7ea7105 Binary files /dev/null and b/public/S2/ExPhyII/VL/ExIIVL1.rust.multi.sir.in differ diff --git a/public/internal/elasticlunr.min.js b/public/internal/elasticlunr.min.js new file mode 100644 index 0000000..94b20dd --- /dev/null +++ b/public/internal/elasticlunr.min.js @@ -0,0 +1,10 @@ +/** + * elasticlunr - http://weixsong.github.io + * Lightweight full-text search engine in Javascript for browser search and offline search. - 0.9.5 + * + * Copyright (C) 2017 Oliver Nightingale + * Copyright (C) 2017 Wei Song + * MIT Licensed + * @license + */ +!function(){function e(e){if(null===e||"object"!=typeof e)return e;var t=e.constructor();for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.9.5",lunr=t,t.utils={},t.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),t.utils.toString=function(e){return void 0===e||null===e?"":e.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=e;if("function"!=typeof t)throw new TypeError("last argument must be a function");n.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},t.EventEmitter.prototype.removeListener=function(e,t){if(this.hasHandler(e)){var n=this.events[e].indexOf(t);-1!==n&&(this.events[e].splice(n,1),0==this.events[e].length&&delete this.events[e])}},t.EventEmitter.prototype.emit=function(e){if(this.hasHandler(e)){var t=Array.prototype.slice.call(arguments,1);this.events[e].forEach(function(e){e.apply(void 0,t)},this)}},t.EventEmitter.prototype.hasHandler=function(e){return e in this.events},t.tokenizer=function(e){if(!arguments.length||null===e||void 0===e)return[];if(Array.isArray(e)){var n=e.filter(function(e){return null===e||void 0===e?!1:!0});n=n.map(function(e){return t.utils.toString(e).toLowerCase()});var i=[];return n.forEach(function(e){var n=e.split(t.tokenizer.seperator);i=i.concat(n)},this),i}return e.toString().trim().toLowerCase().split(t.tokenizer.seperator)},t.tokenizer.defaultSeperator=/[\s\-]+/,t.tokenizer.seperator=t.tokenizer.defaultSeperator,t.tokenizer.setSeperator=function(e){null!==e&&void 0!==e&&"object"==typeof e&&(t.tokenizer.seperator=e)},t.tokenizer.resetSeperator=function(){t.tokenizer.seperator=t.tokenizer.defaultSeperator},t.tokenizer.getSeperator=function(){return t.tokenizer.seperator},t.Pipeline=function(){this._queue=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in t.Pipeline.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[n]=e},t.Pipeline.getRegisteredFunction=function(e){return e in t.Pipeline.registeredFunctions!=!0?null:t.Pipeline.registeredFunctions[e]},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.getRegisteredFunction(e);if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._queue.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i+1,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._queue.indexOf(e);if(-1===i)throw new Error("Cannot find existingFn");this._queue.splice(i,0,n)},t.Pipeline.prototype.remove=function(e){var t=this._queue.indexOf(e);-1!==t&&this._queue.splice(t,1)},t.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,i=this._queue.length,o=0;n>o;o++){for(var r=e[o],s=0;i>s&&(r=this._queue[s](r,o,e),void 0!==r&&null!==r);s++);void 0!==r&&null!==r&&t.push(r)}return t},t.Pipeline.prototype.reset=function(){this._queue=[]},t.Pipeline.prototype.get=function(){return this._queue},t.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.DocumentStore,this.index={},this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},t.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;n._fields=e.fields,n._ref=e.ref,n.documentStore=t.DocumentStore.load(e.documentStore),n.pipeline=t.Pipeline.load(e.pipeline),n.index={};for(var i in e.index)n.index[i]=t.InvertedIndex.load(e.index[i]);return n},t.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new t.InvertedIndex,this},t.Index.prototype.setRef=function(e){return this._ref=e,this},t.Index.prototype.saveDocument=function(e){return this.documentStore=new t.DocumentStore(e),this},t.Index.prototype.addDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.addDoc(i,e),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));this.documentStore.addFieldLength(i,n,o.length);var r={};o.forEach(function(e){e in r?r[e]+=1:r[e]=1},this);for(var s in r){var u=r[s];u=Math.sqrt(u),this.index[n].addToken(s,{ref:i,tf:u})}},this),n&&this.eventEmitter.emit("add",e,this)}},t.Index.prototype.removeDocByRef=function(e){if(e&&this.documentStore.isDocStored()!==!1&&this.documentStore.hasDoc(e)){var t=this.documentStore.getDoc(e);this.removeDoc(t,!1)}},t.Index.prototype.removeDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.hasDoc(i)&&(this.documentStore.removeDoc(i),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));o.forEach(function(e){this.index[n].removeToken(e,i)},this)},this),n&&this.eventEmitter.emit("remove",e,this))}},t.Index.prototype.updateDoc=function(e,t){var t=void 0===t?!0:t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},t.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];var i=this.index[t].getDocFreq(e),o=1+Math.log(this.documentStore.length/(i+1));return this._idfCache[n]=o,o},t.Index.prototype.getFields=function(){return this._fields.slice()},t.Index.prototype.search=function(e,n){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var i=null;null!=n&&(i=JSON.stringify(n));for(var o=new t.Configuration(i,this.getFields()).get(),r={},s=Object.keys(e),u=0;u0&&t.push(e);for(var i in n)"docs"!==i&&"df"!==i&&this.expandToken(e+i,t,n[i]);return t},t.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},t.Configuration=function(e,n){var e=e||"";if(void 0==n||null==n)throw new Error("fields should not be null");this.config={};var i;try{i=JSON.parse(e),this.buildUserConfig(i,n)}catch(o){t.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(n)}},t.Configuration.prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},t.Configuration.prototype.buildUserConfig=function(e,n){var i="OR",o=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(o=e.expand||o),"fields"in e)for(var r in e.fields)if(n.indexOf(r)>-1){var s=e.fields[r],u=o;void 0!=s.expand&&(u=s.expand),this.config[r]={boost:s.boost||0===s.boost?s.boost:1,bool:s.bool||i,expand:u}}else t.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,o,n)},t.Configuration.prototype.addAllFields2UserConfig=function(e,t,n){n.forEach(function(n){this.config[n]={boost:1,bool:e,expand:t}},this)},t.Configuration.prototype.get=function(){return this.config},t.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){var e,t;for(e=0;e1;){if(r===e)return o;e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o]}return r===e?o:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;)e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o];return r>e?o:e>r?o+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,i=0,o=this.length,r=e.length,s=this.elements,u=e.elements;;){if(n>o-1||i>r-1)break;s[n]!==u[i]?s[n]u[i]&&i++:(t.add(s[n]),n++,i++)}return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){var t,n,i;this.length>=e.length?(t=this,n=e):(t=e,n=this),i=t.clone();for(var o=0,r=n.toArray();o1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;t(this,e),this.ctx=n,this.iframes=r,this.exclude=i,this.iframesTimeout=o}return n(e,[{key:"getContexts",value:function(){var e=[];return(void 0!==this.ctx&&this.ctx?NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:"string"==typeof this.ctx?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx]:[]).forEach(function(t){var n=e.filter(function(e){return e.contains(t)}).length>0;-1!==e.indexOf(t)||n||e.push(t)}),e}},{key:"getIframeContents",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){},r=void 0;try{var i=e.contentWindow;if(r=i.document,!i||!r)throw new Error("iframe inaccessible")}catch(e){n()}r&&t(r)}},{key:"isIframeBlank",value:function(e){var t="about:blank",n=e.getAttribute("src").trim();return e.contentWindow.location.href===t&&n!==t&&n}},{key:"observeIframeLoad",value:function(e,t,n){var r=this,i=!1,o=null,a=function a(){if(!i){i=!0,clearTimeout(o);try{r.isIframeBlank(e)||(e.removeEventListener("load",a),r.getIframeContents(e,t,n))}catch(e){n()}}};e.addEventListener("load",a),o=setTimeout(a,this.iframesTimeout)}},{key:"onIframeReady",value:function(e,t,n){try{"complete"===e.contentWindow.document.readyState?this.isIframeBlank(e)?this.observeIframeLoad(e,t,n):this.getIframeContents(e,t,n):this.observeIframeLoad(e,t,n)}catch(e){n()}}},{key:"waitForIframes",value:function(e,t){var n=this,r=0;this.forEachIframe(e,function(){return!0},function(e){r++,n.waitForIframes(e.querySelector("html"),function(){--r||t()})},function(e){e||t()})}},{key:"forEachIframe",value:function(t,n,r){var i=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},a=t.querySelectorAll("iframe"),s=a.length,c=0;a=Array.prototype.slice.call(a);var u=function(){--s<=0&&o(c)};s||u(),a.forEach(function(t){e.matches(t,i.exclude)?u():i.onIframeReady(t,function(e){n(t)&&(c++,r(e)),u()},u)})}},{key:"createIterator",value:function(e,t,n){return document.createNodeIterator(e,t,n,!1)}},{key:"createInstanceOnIframe",value:function(t){return new e(t.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(e,t,n){if(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING){if(null===t)return!0;if(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)return!0}return!1}},{key:"getIteratorNode",value:function(e){var t=e.previousNode();return{prevNode:t,node:null===t?e.nextNode():e.nextNode()&&e.nextNode()}}},{key:"checkIframeFilter",value:function(e,t,n,r){var i=!1,o=!1;return r.forEach(function(e,t){e.val===n&&(i=t,o=e.handled)}),this.compareNodeIframe(e,t,n)?(!1!==i||o?!1===i||o||(r[i].handled=!0):r.push({val:n,handled:!0}),!0):(!1===i&&r.push({val:n,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(e,t,n,r){var i=this;e.forEach(function(e){e.handled||i.getIframeContents(e.val,function(e){i.createInstanceOnIframe(e).forEachNode(t,n,r)})})}},{key:"iterateThroughNodes",value:function(e,t,n,r,i){for(var o,a=this,s=this.createIterator(t,e,r),c=[],u=[],l=void 0,h=void 0;void 0,o=a.getIteratorNode(s),h=o.prevNode,l=o.node;)this.iframes&&this.forEachIframe(t,function(e){return a.checkIframeFilter(l,h,e,c)},function(t){a.createInstanceOnIframe(t).forEachNode(e,function(e){return u.push(e)},r)}),u.push(l);u.forEach(function(e){n(e)}),this.iframes&&this.handleOpenIframes(c,e,n,r),i()}},{key:"forEachNode",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},o=this.getContexts(),a=o.length;a||i(),o.forEach(function(o){var s=function(){r.iterateThroughNodes(e,o,t,n,function(){--a<=0&&i()})};r.iframes?r.waitForIframes(o,s):s()})}}],[{key:"matches",value:function(e,t){var n="string"==typeof t?[t]:t,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(r){var i=!1;return n.every(function(t){return!r.call(e,t)||(i=!0,!1)}),i}return!1}}]),e}(),o=function(){function e(n){t(this,e),this.opt=r({},{diacritics:!0,synonyms:{},accuracy:"partially",caseSensitive:!1,ignoreJoiners:!1,ignorePunctuation:[],wildcards:"disabled"},n)}return n(e,[{key:"create",value:function(e){return"disabled"!==this.opt.wildcards&&(e=this.setupWildcardsRegExp(e)),e=this.escapeStr(e),Object.keys(this.opt.synonyms).length&&(e=this.createSynonymsRegExp(e)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),this.opt.diacritics&&(e=this.createDiacriticsRegExp(e)),e=this.createMergedBlanksRegExp(e),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.createJoinersRegExp(e)),"disabled"!==this.opt.wildcards&&(e=this.createWildcardsRegExp(e)),e=this.createAccuracyRegExp(e),new RegExp(e,"gm"+(this.opt.caseSensitive?"":"i"))}},{key:"escapeStr",value:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}},{key:"createSynonymsRegExp",value:function(e){var t=this.opt.synonyms,n=this.opt.caseSensitive?"":"i",r=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(var i in t)if(t.hasOwnProperty(i)){var o=t[i],a="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(i):this.escapeStr(i),s="disabled"!==this.opt.wildcards?this.setupWildcardsRegExp(o):this.escapeStr(o);""!==a&&""!==s&&(e=e.replace(new RegExp("("+this.escapeStr(a)+"|"+this.escapeStr(s)+")","gm"+n),r+"("+this.processSynonyms(a)+"|"+this.processSynonyms(s)+")"+r))}return e}},{key:"processSynonyms",value:function(e){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),e}},{key:"setupWildcardsRegExp",value:function(e){return(e=e.replace(/(?:\\)*\?/g,function(e){return"\\"===e.charAt(0)?"?":""})).replace(/(?:\\)*\*/g,function(e){return"\\"===e.charAt(0)?"*":""})}},{key:"createWildcardsRegExp",value:function(e){var t="withSpaces"===this.opt.wildcards;return e.replace(/\u0001/g,t?"[\\S\\s]?":"\\S?").replace(/\u0002/g,t?"[\\S\\s]*?":"\\S*")}},{key:"setupIgnoreJoinersRegExp",value:function(e){return e.replace(/[^(|)\\]/g,function(e,t,n){var r=n.charAt(t+1);return/[(|)\\]/.test(r)||""===r?e:e+"\0"})}},{key:"createJoinersRegExp",value:function(e){var t=[],n=this.opt.ignorePunctuation;return Array.isArray(n)&&n.length&&t.push(this.escapeStr(n.join(""))),this.opt.ignoreJoiners&&t.push("\\u00ad\\u200b\\u200c\\u200d"),t.length?e.split(/\u0000+/).join("["+t.join("")+"]*"):e}},{key:"createDiacriticsRegExp",value:function(e){var t=this.opt.caseSensitive?"":"i",n=this.opt.caseSensitive?["aàáảãạăằắẳẵặâầấẩẫậäåāą","AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćč","CÇĆČ","dđď","DĐĎ","eèéẻẽẹêềếểễệëěēę","EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïī","IÌÍỈĨỊÎÏĪ","lł","LŁ","nñňń","NÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøō","OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rř","RŘ","sšśșş","SŠŚȘŞ","tťțţ","TŤȚŢ","uùúủũụưừứửữựûüůū","UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿ","YÝỲỶỸỴŸ","zžżź","ZŽŻŹ"]:["aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ","cçćčCÇĆČ","dđďDĐĎ","eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ","iìíỉĩịîïīIÌÍỈĨỊÎÏĪ","lłLŁ","nñňńNÑŇŃ","oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ","rřRŘ","sšśșşSŠŚȘŞ","tťțţTŤȚŢ","uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ","yýỳỷỹỵÿYÝỲỶỸỴŸ","zžżźZŽŻŹ"],r=[];return e.split("").forEach(function(i){n.every(function(n){if(-1!==n.indexOf(i)){if(r.indexOf(n)>-1)return!1;e=e.replace(new RegExp("["+n+"]","gm"+t),"["+n+"]"),r.push(n)}return!0})}),e}},{key:"createMergedBlanksRegExp",value:function(e){return e.replace(/[\s]+/gim,"[\\s]+")}},{key:"createAccuracyRegExp",value:function(e){var t=this,n=this.opt.accuracy,r="string"==typeof n?n:n.value,i="";switch(("string"==typeof n?[]:n.limiters).forEach(function(e){i+="|"+t.escapeStr(e)}),r){case"partially":default:return"()("+e+")";case"complementary":return"()([^"+(i="\\s"+(i||this.escapeStr("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿")))+"]*"+e+"[^"+i+"]*)";case"exactly":return"(^|\\s"+i+")("+e+")(?=$|\\s"+i+")"}}}]),e}(),a=function(){function a(e){t(this,a),this.ctx=e,this.ie=!1;var n=window.navigator.userAgent;(n.indexOf("MSIE")>-1||n.indexOf("Trident")>-1)&&(this.ie=!0)}return n(a,[{key:"log",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"debug",r=this.opt.log;this.opt.debug&&"object"===(void 0===r?"undefined":e(r))&&"function"==typeof r[n]&&r[n]("mark.js: "+t)}},{key:"getSeparatedKeywords",value:function(e){var t=this,n=[];return e.forEach(function(e){t.opt.separateWordSearch?e.split(" ").forEach(function(e){e.trim()&&-1===n.indexOf(e)&&n.push(e)}):e.trim()&&-1===n.indexOf(e)&&n.push(e)}),{keywords:n.sort(function(e,t){return t.length-e.length}),length:n.length}}},{key:"isNumeric",value:function(e){return Number(parseFloat(e))==e}},{key:"checkRanges",value:function(e){var t=this;if(!Array.isArray(e)||"[object Object]"!==Object.prototype.toString.call(e[0]))return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(e),[];var n=[],r=0;return e.sort(function(e,t){return e.start-t.start}).forEach(function(e){var i=t.callNoMatchOnInvalidRanges(e,r),o=i.start,a=i.end;i.valid&&(e.start=o,e.length=a-o,n.push(e),r=a)}),n}},{key:"callNoMatchOnInvalidRanges",value:function(e,t){var n=void 0,r=void 0,i=!1;return e&&void 0!==e.start?(r=(n=parseInt(e.start,10))+parseInt(e.length,10),this.isNumeric(e.start)&&this.isNumeric(e.length)&&r-t>0&&r-n>0?i=!0:(this.log("Ignoring invalid or overlapping range: "+JSON.stringify(e)),this.opt.noMatch(e))):(this.log("Ignoring invalid range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:n,end:r,valid:i}}},{key:"checkWhitespaceRanges",value:function(e,t,n){var r=void 0,i=!0,o=n.length,a=t-o,s=parseInt(e.start,10)-a;return(r=(s=s>o?o:s)+parseInt(e.length,10))>o&&(r=o,this.log("End range automatically set to the max value of "+o)),s<0||r-s<0||s>o||r>o?(i=!1,this.log("Invalid range: "+JSON.stringify(e)),this.opt.noMatch(e)):""===n.substring(s,r).replace(/\s+/g,"")&&(i=!1,this.log("Skipping whitespace only range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:s,end:r,valid:i}}},{key:"getTextNodes",value:function(e){var t=this,n="",r=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,function(e){r.push({start:n.length,end:(n+=e.textContent).length,node:e})},function(e){return t.matchesExclude(e.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},function(){e({value:n,nodes:r})})}},{key:"matchesExclude",value:function(e){return i.matches(e,this.opt.exclude.concat(["script","style","title","head","html"]))}},{key:"wrapRangeInTextNode",value:function(e,t,n){var r=this.opt.element?this.opt.element:"mark",i=e.splitText(t),o=i.splitText(n-t),a=document.createElement(r);return a.setAttribute("data-markjs","true"),this.opt.className&&a.setAttribute("class",this.opt.className),a.textContent=i.textContent,i.parentNode.replaceChild(a,i),o}},{key:"wrapRangeInMappedTextNode",value:function(e,t,n,r,i){var o=this;e.nodes.every(function(a,s){var c=e.nodes[s+1];if(void 0===c||c.start>t){if(!r(a.node))return!1;var u=t-a.start,l=(n>a.end?a.end:n)-a.start,h=e.value.substr(0,a.start),f=e.value.substr(l+a.start);if(a.node=o.wrapRangeInTextNode(a.node,u,l),e.value=h+f,e.nodes.forEach(function(t,n){n>=s&&(e.nodes[n].start>0&&n!==s&&(e.nodes[n].start-=l),e.nodes[n].end-=l)}),n-=l,i(a.node.previousSibling,a.start),!(n>a.end))return!1;t=a.end}return!0})}},{key:"wrapGroups",value:function(e,t,n,r){return r((e=this.wrapRangeInTextNode(e,t,t+n)).previousSibling),e}},{key:"separateGroups",value:function(e,t,n,r,i){for(var o=t.length,a=1;a-1&&r(t[a],e)&&(e=this.wrapGroups(e,s,t[a].length,i))}return e}},{key:"wrapMatches",value:function(e,t,n,r,i){var o=this,a=0===t?0:t+1;this.getTextNodes(function(t){t.nodes.forEach(function(t){t=t.node;for(var i=void 0;null!==(i=e.exec(t.textContent))&&""!==i[a];){if(o.opt.separateGroups)t=o.separateGroups(t,i,a,n,r);else{if(!n(i[a],t))continue;var s=i.index;if(0!==a)for(var c=1;c': '>', + '"': '"', + "'": ''' + }; + var repl = function(c) { return MAP[c]; }; + return function(s) { + return s.replace(/[&<>'"]/g, repl); + }; + })(); + + function formatSearchMetric(count, searchterm) { + if (count == 1) { + return count + " search result for '" + searchterm + "':"; + } else if (count == 0) { + return "No search results for '" + searchterm + "'."; + } else { + return count + " search results for '" + searchterm + "':"; + } + } + + function formatSearchResult(result, searchterms) { + var teaser = makeTeaser(escapeHTML(result.doc.body), searchterms); + teaser_count++; + + // The ?URL_MARK_PARAM= parameter belongs inbetween the page and the #heading-anchor + var url = doc_urls[result.ref].split("#"); + if (url.length == 1) { // no anchor found + url.push(""); + } + + // encodeURIComponent escapes all chars that could allow an XSS except + // for '. Due to that we also manually replace ' with its url-encoded + // representation (%27). + var searchterms = encodeURIComponent(searchterms.join(" ")).replace(/\'/g, "%27"); + + // todo: shiroa doesn't have highlight feature. + // path_to_root + url[0] + '?' + URL_MARK_PARAM + '=' + searchterms + '#' + url[1] + + var goalUrl = url[0]; + if (goalUrl.startsWith('/')) { + goalUrl = goalUrl.substring(1); + } + + // + '?' + URL_MARK_PARAM + '=' + searchterms + '#' + url[1] + + return '' + result.doc.breadcrumbs + '' + + '' + + teaser + ''; + } + + function makeTeaser(body, searchterms) { + // The strategy is as follows: + // First, assign a value to each word in the document: + // Words that correspond to search terms (stemmer aware): 40 + // Normal words: 2 + // First word in a sentence: 8 + // Then use a sliding window with a constant number of words and count the + // sum of the values of the words within the window. Then use the window that got the + // maximum sum. If there are multiple maximas, then get the last one. + // Enclose the terms in . + var stemmed_searchterms = searchterms.map(function(w) { + return elasticlunr.stemmer(w.toLowerCase()); + }); + var searchterm_weight = 40; + var weighted = []; // contains elements of ["word", weight, index_in_document] + // split in sentences, then words + var sentences = body.toLowerCase().split('. '); + var index = 0; + var value = 0; + var searchterm_found = false; + for (var sentenceindex in sentences) { + var words = sentences[sentenceindex].split(' '); + value = 8; + for (var wordindex in words) { + var word = words[wordindex]; + if (word.length > 0) { + for (var searchtermindex in stemmed_searchterms) { + if (elasticlunr.stemmer(word).startsWith(stemmed_searchterms[searchtermindex])) { + value = searchterm_weight; + searchterm_found = true; + } + }; + weighted.push([word, value, index]); + value = 2; + } + index += word.length; + index += 1; // ' ' or '.' if last word in sentence + }; + index += 1; // because we split at a two-char boundary '. ' + }; + + if (weighted.length == 0) { + return body; + } + + var window_weight = []; + var window_size = Math.min(weighted.length, results_options.teaser_word_count); + + var cur_sum = 0; + for (var wordindex = 0; wordindex < window_size; wordindex++) { + cur_sum += weighted[wordindex][1]; + }; + window_weight.push(cur_sum); + for (var wordindex = 0; wordindex < weighted.length - window_size; wordindex++) { + cur_sum -= weighted[wordindex][1]; + cur_sum += weighted[wordindex + window_size][1]; + window_weight.push(cur_sum); + }; + + if (searchterm_found) { + var max_sum = 0; + var max_sum_window_index = 0; + // backwards + for (var i = window_weight.length - 1; i >= 0; i--) { + if (window_weight[i] > max_sum) { + max_sum = window_weight[i]; + max_sum_window_index = i; + } + }; + } else { + max_sum_window_index = 0; + } + + // add around searchterms + var teaser_split = []; + var index = weighted[max_sum_window_index][2]; + for (var i = max_sum_window_index; i < max_sum_window_index+window_size; i++) { + var word = weighted[i]; + if (index < word[2]) { + // missing text from index to start of `word` + teaser_split.push(body.substring(index, word[2])); + index = word[2]; + } + if (word[1] == searchterm_weight) { + teaser_split.push("") + } + index = word[2] + word[0].length; + teaser_split.push(body.substring(word[2], index)); + if (word[1] == searchterm_weight) { + teaser_split.push("") + } + }; + + return teaser_split.join(''); + } + + function init(config) { + results_options = config.results_options; + search_options = config.search_options; + searchbar_outer = config.searchbar_outer; + doc_urls = config.doc_urls; + searchindex = elasticlunr.Index.load(config.index); + + // Set up events + searchicon.addEventListener('click', function(e) { searchIconClickHandler(); }, false); + searchbar.addEventListener('keyup', function(e) { searchbarKeyUpHandler(); }, false); + document.addEventListener('keydown', function(e) { globalKeyHandler(e); }, false); + // If the user uses the browser buttons, do the same as if a reload happened + window.onpopstate = function(e) { doSearchOrMarkFromUrl(); }; + // Suppress "submit" events so the page doesn't reload when the user presses Enter + document.addEventListener('submit', function(e) { e.preventDefault(); }, false); + + // If reloaded, do the search or mark again, depending on the current url parameters + doSearchOrMarkFromUrl(); + } + + function unfocusSearchbar() { + // hacky, but just focusing a div only works once + var tmp = document.createElement('input'); + tmp.setAttribute('style', 'position: absolute; opacity: 0;'); + searchicon.appendChild(tmp); + tmp.focus(); + tmp.remove(); + } + + // On reload or browser history backwards/forwards events, parse the url and do search or mark + function doSearchOrMarkFromUrl() { + // Check current URL for search request + var url = parseURL(window.location.href); + if (url.params.hasOwnProperty(URL_SEARCH_PARAM) + && url.params[URL_SEARCH_PARAM] != "") { + showSearch(true); + searchbar.value = decodeURIComponent( + (url.params[URL_SEARCH_PARAM]+'').replace(/\+/g, '%20')); + searchbarKeyUpHandler(); // -> doSearch() + } else { + showSearch(false); + } + + if (url.params.hasOwnProperty(URL_MARK_PARAM)) { + var words = decodeURIComponent(url.params[URL_MARK_PARAM]).split(' '); + marker.mark(words, { + exclude: mark_exclude + }); + + var markers = document.querySelectorAll("mark"); + function hide() { + for (var i = 0; i < markers.length; i++) { + markers[i].classList.add("fade-out"); + window.setTimeout(function(e) { marker.unmark(); }, 300); + } + } + for (var i = 0; i < markers.length; i++) { + markers[i].addEventListener('click', hide); + } + } + } + + // Eventhandler for keyevents on `document` + function globalKeyHandler(e) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || e.target.type === 'textarea' || e.target.type === 'text') { return; } + + if (e.keyCode === ESCAPE_KEYCODE) { + e.preventDefault(); + searchbar.classList.remove("active"); + setSearchUrlParameters("", + (searchbar.value.trim() !== "") ? "push" : "replace"); + if (hasFocus()) { + unfocusSearchbar(); + } + showSearch(false); + marker.unmark(); + } else if (!hasFocus() && e.keyCode === SEARCH_HOTKEY_KEYCODE) { + e.preventDefault(); + showSearch(true); + window.scrollTo(0, 0); + searchbar.select(); + } else if (hasFocus() && e.keyCode === DOWN_KEYCODE) { + e.preventDefault(); + unfocusSearchbar(); + searchresults.firstElementChild.classList.add("focus"); + } else if (!hasFocus() && (e.keyCode === DOWN_KEYCODE + || e.keyCode === UP_KEYCODE + || e.keyCode === SELECT_KEYCODE)) { + // not `:focus` because browser does annoying scrolling + var focused = searchresults.querySelector("li.focus"); + if (!focused) return; + e.preventDefault(); + if (e.keyCode === DOWN_KEYCODE) { + var next = focused.nextElementSibling; + if (next) { + focused.classList.remove("focus"); + next.classList.add("focus"); + } + } else if (e.keyCode === UP_KEYCODE) { + focused.classList.remove("focus"); + var prev = focused.previousElementSibling; + if (prev) { + prev.classList.add("focus"); + } else { + searchbar.select(); + } + } else { // SELECT_KEYCODE + window.location.assign(focused.querySelector('a')); + } + } + } + + function showSearch(yes) { + if (yes) { + search_wrap.classList.remove('hidden'); + searchicon.setAttribute('aria-expanded', 'true'); + } else { + search_wrap.classList.add('hidden'); + searchicon.setAttribute('aria-expanded', 'false'); + var results = searchresults.children; + for (var i = 0; i < results.length; i++) { + results[i].classList.remove("focus"); + } + } + } + + function showResults(yes) { + if (yes) { + searchresults_outer.classList.remove('hidden'); + } else { + searchresults_outer.classList.add('hidden'); + } + } + + // Eventhandler for search icon + function searchIconClickHandler() { + if (search_wrap.classList.contains('hidden')) { + showSearch(true); + window.scrollTo(0, 0); + searchbar.select(); + } else { + showSearch(false); + } + } + + // Eventhandler for keyevents while the searchbar is focused + function searchbarKeyUpHandler() { + var searchterm = searchbar.value.trim(); + if (searchterm != "") { + searchbar.classList.add("active"); + doSearch(searchterm); + } else { + searchbar.classList.remove("active"); + showResults(false); + removeChildren(searchresults); + } + + setSearchUrlParameters(searchterm, "push_if_new_search_else_replace"); + + // Remove marks + marker.unmark(); + } + + // Update current url with ?URL_SEARCH_PARAM= parameter, remove ?URL_MARK_PARAM and #heading-anchor . + // `action` can be one of "push", "replace", "push_if_new_search_else_replace" + // and replaces or pushes a new browser history item. + // "push_if_new_search_else_replace" pushes if there is no `?URL_SEARCH_PARAM=abc` yet. + function setSearchUrlParameters(searchterm, action) { + var url = parseURL(window.location.href); + var first_search = ! url.params.hasOwnProperty(URL_SEARCH_PARAM); + if (searchterm != "" || action == "push_if_new_search_else_replace") { + url.params[URL_SEARCH_PARAM] = searchterm; + delete url.params[URL_MARK_PARAM]; + url.hash = ""; + } else { + delete url.params[URL_MARK_PARAM]; + delete url.params[URL_SEARCH_PARAM]; + } + // A new search will also add a new history item, so the user can go back + // to the page prior to searching. A updated search term will only replace + // the url. + if (action == "push" || (action == "push_if_new_search_else_replace" && first_search) ) { + history.pushState({}, document.title, renderURL(url)); + } else if (action == "replace" || (action == "push_if_new_search_else_replace" && !first_search) ) { + history.replaceState({}, document.title, renderURL(url)); + } + } + + function doSearch(searchterm) { + + // Don't search the same twice + if (current_searchterm == searchterm) { return; } + else { current_searchterm = searchterm; } + + if (searchindex == null) { return; } + + // Do the actual search + var results = searchindex.search(searchterm, search_options); + var resultcount = Math.min(results.length, results_options.limit_results); + + // Display search metrics + searchresults_header.innerText = formatSearchMetric(resultcount, searchterm); + + // Clear and insert results + var searchterms = searchterm.split(' '); + removeChildren(searchresults); + for(var i = 0; i < resultcount ; i++){ + var resultElem = document.createElement('li'); + resultElem.innerHTML = formatSearchResult(results[i], searchterms); + searchresults.appendChild(resultElem); + } + + // Display results + showResults(true); + } + + fetch(path_to_root + 'searchindex.json') + .then(response => response.json()) + .then(json => init(json)) + .catch(error => { // Try to load searchindex.js if fetch failed + var script = document.createElement('script'); + script.src = path_to_root + 'searchindex.js'; + script.onload = () => init(window.search); + document.head.appendChild(script); + }); + + // Exported functions + search.hasFocus = hasFocus; +})(window.search); diff --git a/public/internal/shiroa.js b/public/internal/shiroa.js new file mode 100644 index 0000000..575cc92 --- /dev/null +++ b/public/internal/shiroa.js @@ -0,0 +1,4482 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); +var _a, _b; +const kObject = Symbol.for("reflexo-obj"); +var TypstDefaultParams; +(function(TypstDefaultParams2) { + TypstDefaultParams2[TypstDefaultParams2["PIXEL_PER_PT"] = 3] = "PIXEL_PER_PT"; +})(TypstDefaultParams || (TypstDefaultParams = {})); +class RenderView { + constructor(pageInfos, container, options) { + __publicField(this, "pageInfos"); + __publicField(this, "loadPageCount"); + __publicField(this, "imageScaleFactor"); + __publicField(this, "container"); + __publicField(this, "canvasList"); + __publicField(this, "textLayerList"); + __publicField(this, "commonList"); + __publicField(this, "textLayerParentList"); + __publicField(this, "semanticLayerList"); + this.pageInfos = pageInfos; + this.imageScaleFactor = options.pixelPerPt ?? TypstDefaultParams.PIXEL_PER_PT; + container.innerHTML = ""; + container.style.width = "100%"; + this.container = container; + this.canvasList = new Array(this.loadPageCount); + this.textLayerList = new Array(this.loadPageCount); + this.commonList = new Array(this.loadPageCount); + this.textLayerParentList = new Array(this.loadPageCount); + this.semanticLayerList = new Array(this.loadPageCount); + const createOver = (i, pageAst, commonDiv) => { + const width = Math.ceil(pageAst.width) * this.imageScaleFactor; + const height = Math.ceil(pageAst.height) * this.imageScaleFactor; + const canvas = this.canvasList[i] = document.createElement("canvas"); + const semanticLayer = this.semanticLayerList[i] = document.createElement("div"); + const textLayer = this.textLayerList[i] = document.createElement("div"); + const textLayerParent = this.textLayerParentList[i] = document.createElement("div"); + const ctx = canvas.getContext("2d"); + if (ctx) { + const canvasDiv = document.createElement("div"); + canvas.width = width; + canvas.height = height; + canvasDiv.appendChild(canvas); + commonDiv.appendChild(canvasDiv); + canvasDiv.style.position = "absolute"; + } + { + textLayerParent.appendChild(textLayer); + textLayerParent.className = "typst-html-semantics"; + const containerWidth = container.offsetWidth; + const originalScale = containerWidth / pageAst.width; + textLayerParent.style.width = `${containerWidth}px`; + textLayerParent.style.height = `${pageAst.height * originalScale}px`; + textLayerParent.style.setProperty("--data-text-width", `${originalScale}px`); + textLayerParent.style.setProperty("--data-text-height", `${originalScale}px`); + commonDiv.classList.add("typst-page"); + commonDiv.classList.add("canvas"); + commonDiv.style.width = `${containerWidth}px`; + commonDiv.style.height = `${height * originalScale}px`; + commonDiv.style.position = "relative"; + semanticLayer.appendChild(textLayerParent); + commonDiv.appendChild(semanticLayer); + } + }; + for (let i = 0; i < this.pageInfos.length; i++) { + const pageAst = this.pageInfos[i]; + let commonDiv = void 0; + commonDiv = this.commonList[i] = document.createElement("div"); + container.appendChild(commonDiv); + createOver(i, pageAst, commonDiv); + } + } + resetLayout() { + for (let i = 0; i < this.pageInfos.length; i++) { + const pageAst = this.pageInfos[i]; + const width = Math.ceil(pageAst.width) * this.imageScaleFactor; + const height = Math.ceil(pageAst.height) * this.imageScaleFactor; + const canvasDiv = this.canvasList[i].parentElement; + if (!canvasDiv) { + throw new Error(`canvasDiv is null for page ${i}, canvas list length ${this.canvasList.length}`); + } + const commonDiv = this.commonList[i]; + const textLayerParent = this.textLayerParentList[i]; + const containerWidth = this.container.offsetWidth; + const originalScale = containerWidth / width; + textLayerParent.style.width = `${containerWidth}px`; + textLayerParent.style.height = `${height * originalScale}px`; + commonDiv.style.width = `${containerWidth}px`; + commonDiv.style.height = `${height * originalScale}px`; + const currentScale = this.container.offsetWidth / width; + canvasDiv.style.transformOrigin = "0px 0px"; + canvasDiv.style.transform = `scale(${currentScale})`; + } + } +} +const once = (fn) => { + let called = false; + let res; + return () => { + if (called) { + return res; + } + called = true; + return res = fn(); + }; +}; +class LazyWasmModule { + constructor(initFn) { + __publicField(this, "wasmBin"); + __publicField(this, "initOnce"); + if (typeof initFn !== "function") { + throw new Error("initFn is not a function"); + } + this.initOnce = once(async () => { + await initFn(this.wasmBin); + }); + } + async init(module) { + this.wasmBin = module; + await this.initOnce(); + } +} +const instanceOfAny = (object, constructors) => constructors.some((c) => object instanceof c); +let idbProxyableTypes; +let cursorAdvanceMethods; +function getIdbProxyableTypes() { + return idbProxyableTypes || (idbProxyableTypes = [ + IDBDatabase, + IDBObjectStore, + IDBIndex, + IDBCursor, + IDBTransaction + ]); +} +function getCursorAdvanceMethods() { + return cursorAdvanceMethods || (cursorAdvanceMethods = [ + IDBCursor.prototype.advance, + IDBCursor.prototype.continue, + IDBCursor.prototype.continuePrimaryKey + ]); +} +const cursorRequestMap = /* @__PURE__ */ new WeakMap(); +const transactionDoneMap = /* @__PURE__ */ new WeakMap(); +const transactionStoreNamesMap = /* @__PURE__ */ new WeakMap(); +const transformCache = /* @__PURE__ */ new WeakMap(); +const reverseTransformCache = /* @__PURE__ */ new WeakMap(); +function promisifyRequest(request) { + const promise = new Promise((resolve, reject) => { + const unlisten = () => { + request.removeEventListener("success", success); + request.removeEventListener("error", error); + }; + const success = () => { + resolve(wrap(request.result)); + unlisten(); + }; + const error = () => { + reject(request.error); + unlisten(); + }; + request.addEventListener("success", success); + request.addEventListener("error", error); + }); + promise.then((value) => { + if (value instanceof IDBCursor) { + cursorRequestMap.set(value, request); + } + }).catch(() => { + }); + reverseTransformCache.set(promise, request); + return promise; +} +function cacheDonePromiseForTransaction(tx) { + if (transactionDoneMap.has(tx)) + return; + const done = new Promise((resolve, reject) => { + const unlisten = () => { + tx.removeEventListener("complete", complete); + tx.removeEventListener("error", error); + tx.removeEventListener("abort", error); + }; + const complete = () => { + resolve(); + unlisten(); + }; + const error = () => { + reject(tx.error || new DOMException("AbortError", "AbortError")); + unlisten(); + }; + tx.addEventListener("complete", complete); + tx.addEventListener("error", error); + tx.addEventListener("abort", error); + }); + transactionDoneMap.set(tx, done); +} +let idbProxyTraps = { + get(target, prop, receiver) { + if (target instanceof IDBTransaction) { + if (prop === "done") + return transactionDoneMap.get(target); + if (prop === "objectStoreNames") { + return target.objectStoreNames || transactionStoreNamesMap.get(target); + } + if (prop === "store") { + return receiver.objectStoreNames[1] ? void 0 : receiver.objectStore(receiver.objectStoreNames[0]); + } + } + return wrap(target[prop]); + }, + set(target, prop, value) { + target[prop] = value; + return true; + }, + has(target, prop) { + if (target instanceof IDBTransaction && (prop === "done" || prop === "store")) { + return true; + } + return prop in target; + } +}; +function replaceTraps(callback) { + idbProxyTraps = callback(idbProxyTraps); +} +function wrapFunction(func) { + if (func === IDBDatabase.prototype.transaction && !("objectStoreNames" in IDBTransaction.prototype)) { + return function(storeNames, ...args) { + const tx = func.call(unwrap(this), storeNames, ...args); + transactionStoreNamesMap.set(tx, storeNames.sort ? storeNames.sort() : [storeNames]); + return wrap(tx); + }; + } + if (getCursorAdvanceMethods().includes(func)) { + return function(...args) { + func.apply(unwrap(this), args); + return wrap(cursorRequestMap.get(this)); + }; + } + return function(...args) { + return wrap(func.apply(unwrap(this), args)); + }; +} +function transformCachableValue(value) { + if (typeof value === "function") + return wrapFunction(value); + if (value instanceof IDBTransaction) + cacheDonePromiseForTransaction(value); + if (instanceOfAny(value, getIdbProxyableTypes())) + return new Proxy(value, idbProxyTraps); + return value; +} +function wrap(value) { + if (value instanceof IDBRequest) + return promisifyRequest(value); + if (transformCache.has(value)) + return transformCache.get(value); + const newValue = transformCachableValue(value); + if (newValue !== value) { + transformCache.set(value, newValue); + reverseTransformCache.set(newValue, value); + } + return newValue; +} +const unwrap = (value) => reverseTransformCache.get(value); +const readMethods = ["get", "getKey", "getAll", "getAllKeys", "count"]; +const writeMethods = ["put", "add", "delete", "clear"]; +const cachedMethods = /* @__PURE__ */ new Map(); +function getMethod(target, prop) { + if (!(target instanceof IDBDatabase && !(prop in target) && typeof prop === "string")) { + return; + } + if (cachedMethods.get(prop)) + return cachedMethods.get(prop); + const targetFuncName = prop.replace(/FromIndex$/, ""); + const useIndex = prop !== targetFuncName; + const isWrite = writeMethods.includes(targetFuncName); + if ( + // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge. + !(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) || !(isWrite || readMethods.includes(targetFuncName)) + ) { + return; + } + const method = async function(storeName, ...args) { + const tx = this.transaction(storeName, isWrite ? "readwrite" : "readonly"); + let target2 = tx.store; + if (useIndex) + target2 = target2.index(args.shift()); + return (await Promise.all([ + target2[targetFuncName](...args), + isWrite && tx.done + ]))[0]; + }; + cachedMethods.set(prop, method); + return method; +} +replaceTraps((oldTraps) => ({ + ...oldTraps, + get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver), + has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop) +})); +class ComponentBuilder { + constructor() { + __publicField(this, "loadedFonts", /* @__PURE__ */ new Set()); + __publicField(this, "fetcher", fetch); + } + setFetcher(fetcher) { + this.fetcher = fetcher; + } + async loadFonts(builder, fonts) { + const escapeImport = new Function("m", "return import(m)"); + const fetcher = this.fetcher || (this.fetcher = await async function() { + const { fetchBuilder, FileSystemCache } = await escapeImport("node-fetch-cache"); + const cache = new FileSystemCache({ + /// By default, we don't have a complicated cache policy. + cacheDirectory: ".cache/typst/fonts" + }); + const cachedFetcher = fetchBuilder.withCache(cache); + return function(input, init) { + const timeout = setTimeout(() => { + console.warn("font fetching is stucking:", input); + }, 15e3); + return cachedFetcher(input, init).finally(() => { + clearTimeout(timeout); + }); + }; + }()); + const fontsToLoad = fonts.filter((font) => { + if (font instanceof Uint8Array) { + return true; + } + if (this.loadedFonts.has(font)) { + return false; + } + this.loadedFonts.add(font); + return true; + }); + const fontLists = await Promise.all(fontsToLoad.map(async (font) => { + if (font instanceof Uint8Array) { + await builder.add_raw_font(font); + return; + } + return new Uint8Array(await (await fetcher(font)).arrayBuffer()); + })); + for (const font of fontLists) { + if (!font) { + continue; + } + await builder.add_raw_font(font); + } + } + async build(options, builder, hooks) { + const buildCtx = { ref: this, builder, hooks }; + for (const fn of (options == null ? void 0 : options.beforeBuild) ?? []) { + await fn(void 0, buildCtx); + } + if (hooks.latelyBuild) { + hooks.latelyBuild(buildCtx); + } + const component = await builder.build(); + return component; + } +} +async function buildComponent(options, gModule, Builder, hooks) { + var _a2; + await gModule.init((_a2 = options == null ? void 0 : options.getModule) == null ? void 0 : _a2.call(options)); + return await new ComponentBuilder().build(options, new Builder(), hooks); +} +var PreviewMode; +(function(PreviewMode2) { + PreviewMode2[PreviewMode2["Doc"] = 0] = "Doc"; + PreviewMode2[PreviewMode2["Slide"] = 1] = "Slide"; +})(PreviewMode || (PreviewMode = {})); +class TypstDocumentContext { + constructor(opts) { + __publicField(this, "hookedElem"); + __publicField(this, "kModule"); + __publicField(this, "opts"); + __publicField(this, "modes", []); + /// Configuration fields + /// enable partial rendering + __publicField(this, "partialRendering", true); + /// underlying renderer + __publicField(this, "renderMode", "svg"); + __publicField(this, "r"); + /// preview mode + __publicField(this, "previewMode", PreviewMode.Doc); + /// whether this is a content preview + __publicField(this, "isContentPreview", false); + /// whether this content preview will mix outline titles + __publicField(this, "isMixinOutline", false); + /// background color + __publicField(this, "backgroundColor", "black"); + /// default page color (empty string means transparent) + __publicField(this, "pageColor", "white"); + /// pixel per pt + __publicField(this, "pixelPerPt", 3); + /// customized way to retrieving dom state + __publicField(this, "retrieveDOMState"); + /// State fields + /// whether svg is updating (in triggerSvgUpdate) + __publicField(this, "isRendering", false); + /// whether kModule is initialized + __publicField(this, "moduleInitialized", false); + /// patch queue for updating data. + __publicField(this, "patchQueue", []); + /// resources to dispose + __publicField(this, "disposeList", []); + /// canvas render ctoken + __publicField(this, "canvasRenderCToken"); + /// There are two scales in this class: The real scale is to adjust the size + /// of `hookedElem` to fit the svg. The virtual scale (scale ratio) is to let + /// user zoom in/out the svg. For example: + /// + the default value of virtual scale is 1, which means the svg is totally + /// fit in `hookedElem`. + /// + if user set virtual scale to 0.5, then the svg will be zoomed out to fit + /// in half width of `hookedElem`. "real" current scale of `hookedElem` + __publicField(this, "currentRealScale", 1); + /// "virtual" current scale of `hookedElem` + __publicField(this, "currentScaleRatio", 1); + /// timeout for delayed viewport change + __publicField(this, "vpTimeout"); + /// sampled by last render time. + __publicField(this, "sampledRenderTime", 0); + /// page to partial render + __publicField(this, "partialRenderPage", 0); + /// outline data + __publicField(this, "outline"); + /// cursor position in form of [page, x, y] + __publicField(this, "cursorPosition"); + // id: number = rnd++; + /// Cache fields + /// cached state of container, default to retrieve state from `this.hookedElem` + __publicField(this, "cachedDOMState", { + width: 0, + height: 0, + window: { + innerWidth: 0, + innerHeight: 0 + }, + boundingRect: { + left: 0, + top: 0, + right: 0 + } + }); + var _a2, _b2; + this.hookedElem = opts.hookedElem; + this.kModule = opts.kModule; + this.opts = opts || {}; + { + const { renderMode, previewMode, isContentPreview, retrieveDOMState } = opts || {}; + this.partialRendering = false; + this.renderMode = renderMode ?? this.renderMode; + this.previewMode = previewMode ?? this.previewMode; + this.isContentPreview = isContentPreview || false; + this.retrieveDOMState = retrieveDOMState ?? (() => { + return { + width: this.hookedElem.offsetWidth, + height: this.hookedElem.offsetHeight, + window: { + innerWidth: window.innerWidth, + innerHeight: window.innerHeight + }, + boundingRect: this.hookedElem.getBoundingClientRect() + }; + }); + this.backgroundColor = getComputedStyle(document.documentElement).getPropertyValue("--typst-preview-background-color"); + } + this.hookedElem.classList.add("hide-scrollbar-x"); + (_a2 = this.hookedElem.parentElement) == null ? void 0 : _a2.classList.add("hide-scrollbar-x"); + if (this.previewMode === PreviewMode.Slide) { + this.hookedElem.classList.add("hide-scrollbar-y"); + (_b2 = this.hookedElem.parentElement) == null ? void 0 : _b2.classList.add("hide-scrollbar-y"); + } + this.installCtrlWheelHandler(); + } + reset() { + this.kModule.reset(); + this.moduleInitialized = false; + } + dispose() { + const disposeList = this.disposeList; + this.disposeList = []; + disposeList.forEach((x) => x()); + } + static derive(ctx, mode) { + return ["rescale", "rerender", "postRender"].reduce((acc, x) => { + acc[x] = ctx[`${x}$${mode}`].bind(ctx); + console.assert(acc[x] !== void 0, `${x}$${mode} is undefined`); + return acc; + }, {}); + } + registerMode(mode) { + const facade = TypstDocumentContext.derive(this, mode); + this.modes.push([mode, facade]); + if (mode === this.renderMode) { + this.r = facade; + } + } + installCtrlWheelHandler() { + const factors = [ + 0.1, + 0.2, + 0.3, + 0.4, + 0.5, + 0.6, + 0.7, + 0.8, + 0.9, + 1, + 1.1, + 1.3, + 1.5, + 1.7, + 1.9, + 2.1, + 2.4, + 2.7, + 3, + 3.3, + 3.7, + 4.1, + 4.6, + 5.1, + 5.7, + 6.3, + 7, + 7.7, + 8.5, + 9.4, + 10 + ]; + const wheelEventHandler = (event) => { + var _a2, _b2, _c, _d; + if (event.ctrlKey) { + event.preventDefault(); + this.cachedDOMState = this.retrieveDOMState(); + if (window.onresize !== null) { + window.onresize = null; + } + const prevScaleRatio = this.currentScaleRatio; + if (event.deltaY < 0) { + if (this.currentScaleRatio >= factors.at(-1)) { + return; + } else { + this.currentScaleRatio = factors.filter((x) => x > this.currentScaleRatio).at(0); + } + } else if (event.deltaY > 0) { + if (this.currentScaleRatio <= factors.at(0)) { + return; + } else { + this.currentScaleRatio = factors.filter((x) => x < this.currentScaleRatio).at(-1); + } + } else { + return; + } + const scrollFactor = this.currentScaleRatio / prevScaleRatio; + const scrollX = event.pageX * (scrollFactor - 1); + const scrollY = event.pageY * (scrollFactor - 1); + if (Math.abs(this.currentScaleRatio - 1) < 1e-5) { + this.hookedElem.classList.add("hide-scrollbar-x"); + (_a2 = this.hookedElem.parentElement) == null ? void 0 : _a2.classList.add("hide-scrollbar-x"); + if (this.previewMode === PreviewMode.Slide) { + this.hookedElem.classList.add("hide-scrollbar-y"); + (_b2 = this.hookedElem.parentElement) == null ? void 0 : _b2.classList.add("hide-scrollbar-y"); + } + } else { + this.hookedElem.classList.remove("hide-scrollbar-x"); + (_c = this.hookedElem.parentElement) == null ? void 0 : _c.classList.remove("hide-scrollbar-x"); + if (this.previewMode === PreviewMode.Slide) { + this.hookedElem.classList.remove("hide-scrollbar-y"); + (_d = this.hookedElem.parentElement) == null ? void 0 : _d.classList.remove("hide-scrollbar-y"); + } + } + const svg = this.hookedElem.firstElementChild; + if (svg) { + const scaleRatio = this.getSvgScaleRatio(); + const dataHeight = Number.parseFloat(svg.getAttribute("data-height")); + const scaledHeight = Math.ceil(dataHeight * scaleRatio); + this.hookedElem.style.height = `${scaledHeight * 2}px`; + } + window.scrollBy(scrollX, scrollY); + this.addViewportChange(); + return false; + } + }; + if (this.renderMode !== "dom") { + const vscodeAPI = typeof acquireVsCodeApi !== "undefined"; + if (vscodeAPI) { + window.addEventListener("wheel", wheelEventHandler, { + passive: false + }); + this.disposeList.push(() => { + window.removeEventListener("wheel", wheelEventHandler); + }); + } else { + document.body.addEventListener("wheel", wheelEventHandler, { + passive: false + }); + this.disposeList.push(() => { + document.body.removeEventListener("wheel", wheelEventHandler); + }); + } + } + } + /// Get current scale from html to svg + // Note: one should retrieve dom state before rescale + getSvgScaleRatio() { + const svg = this.hookedElem.firstElementChild; + if (!svg) { + return 0; + } + const container = this.cachedDOMState; + const svgWidth = Number.parseFloat(svg.getAttribute("data-width") || svg.getAttribute("width") || "1"); + const svgHeight = Number.parseFloat(svg.getAttribute("data-height") || svg.getAttribute("height") || "1"); + this.currentRealScale = this.previewMode === PreviewMode.Slide ? Math.min(container.width / svgWidth, container.height / svgHeight) : container.width / svgWidth; + return this.currentRealScale * this.currentScaleRatio; + } + processQueue(svgUpdateEvent) { + const eventName = svgUpdateEvent[0]; + switch (eventName) { + case "new": + case "diff-v1": { + if (eventName === "new") { + this.reset(); + } + this.kModule.manipulateData({ + action: "merge", + data: svgUpdateEvent[1] + }); + this.moduleInitialized = true; + return true; + } + case "viewport-change": { + if (!this.moduleInitialized) { + console.log("viewport-change before initialization"); + return false; + } + return true; + } + default: + console.log("svgUpdateEvent", svgUpdateEvent); + return false; + } + } + triggerUpdate() { + if (this.isRendering) { + return; + } + this.isRendering = true; + const doUpdate = async () => { + this.cachedDOMState = this.retrieveDOMState(); + if (this.patchQueue.length === 0) { + this.isRendering = false; + this.postprocessChanges(); + return; + } + try { + let t0 = performance.now(); + const ctoken = this.canvasRenderCToken; + if (ctoken) { + await ctoken.cancel(); + await ctoken.wait(); + this.canvasRenderCToken = void 0; + console.log("cancel canvas rendering"); + } + let needRerender = false; + while (this.patchQueue.length > 0) { + needRerender = this.processQueue(this.patchQueue.shift()) || needRerender; + } + let t1 = performance.now(); + if (needRerender) { + this.r.rescale(); + await this.r.rerender(); + this.r.rescale(); + } + let t2 = performance.now(); + const d = (e, x, y) => `${e} ${(y - x).toFixed(2)} ms`; + this.sampledRenderTime = t2 - t0; + console.log([d("parse", t0, t1), d("rerender", t1, t2), d("total", t0, t2)].join(", ")); + requestAnimationFrame(doUpdate); + } catch (e) { + console.error(e); + this.isRendering = false; + this.postprocessChanges(); + } + }; + requestAnimationFrame(doUpdate); + } + postprocessChanges() { + this.r.postRender(); + if (this.previewMode === PreviewMode.Slide) { + document.querySelectorAll(".typst-page-number-indicator").forEach((x) => { + x.textContent = `${this.kModule.retrievePagesInfo().length}`; + }); + } + } + addChangement(change) { + if (change[0] === "new") { + this.patchQueue.splice(0, this.patchQueue.length); + } + const pushChange = () => { + this.vpTimeout = void 0; + this.patchQueue.push(change); + this.triggerUpdate(); + }; + if (this.vpTimeout !== void 0) { + clearTimeout(this.vpTimeout); + } + if (change[0] === "viewport-change" && this.isRendering) { + this.vpTimeout = setTimeout(pushChange, this.sampledRenderTime || 100); + } else { + pushChange(); + } + } + addViewportChange() { + this.addChangement(["viewport-change", ""]); + } +} +function provideDoc(Base) { + return class TypstDocument { + constructor(options) { + __publicField(this, "impl"); + __publicField(this, "kModule"); + if (options.isContentPreview) { + options.renderMode = "canvas"; + } + this.kModule = options.kModule; + this.impl = new Base(options); + if (!this.impl.r) { + throw new Error(`mode is not supported, ${options == null ? void 0 : options.renderMode}`); + } + if (options.isContentPreview) { + this.impl.partialRendering = true; + this.impl.pixelPerPt = 1; + this.impl.isMixinOutline = true; + } + } + dispose() { + this.impl.dispose(); + } + reset() { + this.impl.reset(); + } + addChangement(change) { + this.impl.addChangement(change); + } + addViewportChange() { + this.impl.addViewportChange(); + } + setPageColor(color) { + this.impl.pageColor = color; + this.addViewportChange(); + } + setPartialRendering(partialRendering) { + this.impl.partialRendering = partialRendering; + } + setCursor(page, x, y) { + this.impl.cursorPosition = [page, x, y]; + } + setPartialPageNumber(page) { + if (page <= 0 || page > this.kModule.retrievePagesInfo().length) { + return false; + } + this.impl.partialRenderPage = page - 1; + this.addViewportChange(); + return true; + } + getPartialPageNumber() { + return this.impl.partialRenderPage + 1; + } + setOutineData(outline) { + this.impl.outline = outline; + this.addViewportChange(); + } + }; +} +function composeDoc(Base, ...mixins) { + return mixins.reduce((acc, mixin) => mixin(acc), Base); +} +class TypstCancellationToken { + constructor() { + __publicField(this, "isCancellationRequested", false); + __publicField(this, "_onCancelled"); + __publicField(this, "_onCancelledResolveResolved"); + let resolveT = void 0; + let resolveX = void 0; + this._onCancelled = new Promise((resolve) => { + resolveT = resolve; + if (resolveX) { + resolveX(resolve); + } + }); + this._onCancelledResolveResolved = new Promise((resolve) => { + resolveX = resolve; + if (resolveT) { + resolve(resolveT); + } + }); + } + async cancel() { + await this._onCancelledResolveResolved; + this.isCancellationRequested = true; + } + isCancelRequested() { + return this.isCancellationRequested; + } + async consume() { + (await this._onCancelledResolveResolved)(); + } + wait() { + return this._onCancelled; + } +} +const animationFrame = () => new Promise((resolve) => requestAnimationFrame(resolve)); +var TrackMode; +(function(TrackMode2) { + TrackMode2[TrackMode2["Doc"] = 0] = "Doc"; + TrackMode2[TrackMode2["Pages"] = 1] = "Pages"; +})(TrackMode || (TrackMode = {})); +var RepaintStage; +(function(RepaintStage2) { + RepaintStage2[RepaintStage2["Layout"] = 0] = "Layout"; + RepaintStage2[RepaintStage2["Svg"] = 1] = "Svg"; + RepaintStage2[RepaintStage2["Semantics"] = 2] = "Semantics"; + RepaintStage2[RepaintStage2["PrepareCanvas"] = 3] = "PrepareCanvas"; + RepaintStage2[RepaintStage2["Canvas"] = 4] = "Canvas"; +})(RepaintStage || (RepaintStage = {})); +function provideDomDoc(Base) { + return class DomDocument extends Base { + constructor(...args) { + super(...args); + /// The template element for creating DOM by string. + __publicField(this, "tmpl", document.createElement("template")); + /// The stub element for replacing an invisible element. + __publicField(this, "stub", this.createElement("")); + /// Typescript side of lib. + __publicField(this, "plugin"); + /// Rust side of kernel. + __publicField(this, "docKernel"); + /// The element to track. + __publicField(this, "resourceHeader"); + /// Expected exact state of the current DOM. + /// Initially it is empty meaning no any page is rendered. + __publicField(this, "pages", []); + /// The virtual scale of the document. + __publicField(this, "domScale", 1); + /// Track mode. + __publicField(this, "track_mode", TrackMode.Doc); + /// Current executing task. + __publicField(this, "current_task"); + /// The currently maintained viewport. + __publicField(this, "viewport"); + this.registerMode("dom"); + this.disposeList.push(() => { + this.dispose(); + }); + this.plugin = this.opts.renderer; + if (this.opts.domScale !== void 0) { + if (this.opts.domScale <= 0) { + throw new Error("domScale must be positive"); + } + this.domScale = this.opts.domScale; + } + } + dispose() { + for (const page of this.pages) { + page.dispose(); + } + if (this.docKernel) { + this.docKernel.free(); + } + } + createElement(tmpl) { + this.tmpl.innerHTML = tmpl; + return this.tmpl.content.firstElementChild; + } + async mountDom(pixelPerPt) { + console.log("mountDom", pixelPerPt); + if (this.docKernel) { + throw new Error("already mounted"); + } + this.hookedElem.innerHTML = ``; + this.resourceHeader = this.hookedElem.querySelector(".typst-svg-resources"); + this.docKernel = await this.plugin.renderer.mount_dom(this.kModule[kObject], this.hookedElem); + this.docKernel.bind_functions({ + populateGlyphs: (data) => { + let svg = this.createElement(data); + console.log("populateGlyphs", svg); + let content = svg.firstElementChild; + this.resourceHeader.append(content); + } + }); + } + async cancelAnyway$dom() { + console.log("cancelAnyway$dom"); + if (this.current_task) { + const task = this.current_task; + this.current_task = void 0; + await task.cancel(); + } + } + retrieveDOMPages() { + return Array.from(this.hookedElem.querySelectorAll(".typst-dom-page")); + } + // doesn't need to postRender + postRender$dom() { + } + // doesn't need to rescale + rescale$dom() { + } + getDomViewport(cachedWindow, cachedBoundingRect) { + const left = cachedBoundingRect.left; + const top = -cachedBoundingRect.top; + const right = cachedBoundingRect.right; + const bottom = cachedWindow.innerHeight - cachedBoundingRect.top; + const rect = { + x: 0, + y: top / this.domScale, + width: Math.max(right - left, 0) / this.domScale, + height: Math.max(bottom - top, 0) / this.domScale + }; + if (rect.width <= 0 || rect.height <= 0) { + rect.x = rect.y = rect.width = rect.height = 0; + } + return rect; + } + // fast mode + async rerender$dom() { + const domState = this.retrieveDOMState(); + const { x, y, width, height } = this.getDomViewport(domState.window, domState.boundingRect); + let dirty = await this.docKernel.relayout(x, y, width, height); + if (!dirty) { + return; + } + const cancel = new TypstCancellationToken(); + this.doRender$dom(cancel); + this.current_task = cancel; + } + async doRender$dom(ctx) { + const condOrExit = (needFrame, cb) => { + if (needFrame && !ctx.isCancelRequested() && cb) { + return cb(); + } + }; + const pages = this.retrieveDOMPages().map((page) => { + const { innerWidth, innerHeight } = window; + const browserBBox = page.getBoundingClientRect(); + return { + inWindow: !(browserBBox.left > innerWidth || browserBBox.right < 0 || browserBBox.top > innerHeight || browserBBox.bottom < 0), + page + }; + }); + const renderPage = async (i) => { + await animationFrame(); + if (ctx.isCancelRequested()) { + console.log("cancel stage", RepaintStage.Layout, i); + return void 0; + } + const page = pages[i].page; + const browserBBox = page.getBoundingClientRect(); + const v = this.getDomViewport(window, browserBBox); + const needCalc = (stage) => this.docKernel.need_repaint(i, v.x, v.y, v.width, v.height, stage); + const repaint = (stage) => this.docKernel.repaint(i, v.x, v.y, v.width, v.height, stage); + const calc = (stage) => { + if (ctx.isCancelRequested()) { + return void 0; + } + return condOrExit(needCalc(stage), () => repaint(stage)); + }; + await calc(RepaintStage.Layout); + const wScale = (browserBBox.width ? Number.parseFloat(page.getAttribute("data-width")) / browserBBox.width : 1) * this.domScale; + const hScale = (browserBBox.height ? Number.parseFloat(page.getAttribute("data-height")) / browserBBox.height : 1) * this.domScale; + v.x *= wScale; + v.y *= hScale; + v.y -= 100; + v.width *= wScale; + v.height *= hScale; + v.height += 200; + await calc(RepaintStage.Svg); + await calc(RepaintStage.Semantics); + if (ctx.isCancelRequested()) { + console.log("cancel stage", RepaintStage.Semantics, i); + return void 0; + } + if (needCalc(RepaintStage.PrepareCanvas)) { + const calcCanvasAfterPreparing = async () => { + await repaint(RepaintStage.PrepareCanvas); + if (ctx.isCancelRequested()) { + return void 0; + } + return calc(RepaintStage.Canvas); + }; + calcCanvasAfterPreparing(); + } else { + await calc(RepaintStage.Canvas); + } + }; + const renderPages = async (inWindow) => { + for (let idx = 0; idx < pages.length; ++idx) { + if (ctx.isCancelRequested()) { + console.log("cancel page", RepaintStage.Layout, idx); + return; + } + if (pages[idx].inWindow === inWindow) { + await renderPage(idx); + } + } + }; + this.cancelAnyway$dom(); + await renderPages(true); + await renderPages(false); + if (ctx.isCancelRequested()) { + return; + } + console.log("finished", RepaintStage.Layout); + } + }; +} +class TypstDomDocument extends provideDoc(composeDoc(TypstDocumentContext, provideDomDoc)) { +} +let RenderSession$1 = (_a = kObject, class RenderSession { + /** + * @internal + */ + constructor(plugin, o) { + __publicField(this, "plugin"); + /** + * @internal + */ + __publicField(this, _a); + this.plugin = plugin; + this[kObject] = o; + } + /** + * @deprecated set in {@link RenderToCanvasOptions} instead + * + * Set the background color of the Typst document. + * @param {string} t - The background color in format of `^#?[0-9a-f]{6}$` + * + * Note: Default to `#ffffff`. + * + * Note: Only available in canvas rendering mode. + */ + set backgroundColor(t) { + if (t !== void 0) { + this[kObject].background_color = t; + } + } + /** + * Get the background color of the Typst document. + * + * Note: Default to `#ffffff`. + * + * Note: Only available in canvas rendering mode. + */ + get backgroundColor() { + return this[kObject].background_color; + } + /** + * Set the pixel per point scale up the canvas panel. + * + * Note: Default to `3`. + * + * Note: Only available in canvas rendering mode. + */ + set pixelPerPt(t) { + if (t !== void 0) { + this[kObject].pixel_per_pt = t; + } + } + /** + * @deprecated set in {@link RenderToCanvasOptions} instead + * + * Get the pixel per point scale up the canvas panel. + * + * Note: Default to `3`. + * + * Note: Only available in canvas rendering mode. + */ + get pixelPerPt() { + return this[kObject].pixel_per_pt; + } + /** + * Reset state + */ + reset() { + this.plugin.resetSession(this); + } + /** + * @deprecated + * use {@link docWidth} instead + */ + get doc_width() { + return this[kObject].doc_width; + } + get docWidth() { + return this[kObject].doc_width; + } + /** + * @deprecated + * use {@link docHeight} instead + */ + get doc_height() { + return this[kObject].doc_height; + } + get docHeight() { + return this[kObject].doc_height; + } + retrievePagesInfo() { + const pages_info = this[kObject].pages_info; + const pageInfos = []; + const pageCount = pages_info.page_count; + for (let i = 0; i < pageCount; i++) { + const pageAst = pages_info.page(i); + pageInfos.push({ + pageOffset: pageAst.page_off, + width: pageAst.width_pt, + height: pageAst.height_pt + }); + } + return pageInfos; + } + getSourceLoc(path) { + return this[kObject].source_span(path); + } + /** + * See {@link TypstRenderer#renderSvg} for more details. + */ + renderSvg(options) { + return this.plugin.renderSvg({ + renderSession: this, + ...options + }); + } + /** + * See {@link TypstRenderer#renderToSvg} for more details. + */ + renderToSvg(options) { + return this.plugin.renderToSvg({ + renderSession: this, + ...options + }); + } + /** + * See {@link TypstRenderer#renderCanvas} for more details. + */ + renderCanvas(options) { + return this.plugin.renderCanvas({ + renderSession: this, + ...options + }); + } + /** + * See {@link TypstRenderer#manipulateData} for more details. + */ + manipulateData(opts) { + this.plugin.manipulateData({ + renderSession: this, + ...opts + }); + } + /** + * See {@link TypstRenderer#renderSvgDiff} for more details. + */ + renderSvgDiff(opts) { + return this.plugin.renderSvgDiff({ + renderSession: this, + ...opts + }); + } + /** + * @deprecated + * use {@link getSourceLoc} instead + */ + get_source_loc(path) { + return this[kObject].source_span(path); + } + /** + * @deprecated + * use {@link renderSvgDiff} instead + */ + render_in_window(rect_lo_x, rect_lo_y, rect_hi_x, rect_hi_y) { + return this[kObject].render_in_window(rect_lo_x, rect_lo_y, rect_hi_x, rect_hi_y); + } + /** + * @deprecated + * use {@link manipulateData} instead + */ + merge_delta(data) { + this.plugin.manipulateData({ + renderSession: this, + action: "merge", + data + }); + } +}); +var ManageStatus; +(function(ManageStatus2) { + ManageStatus2[ManageStatus2["Delete"] = 0] = "Delete"; + ManageStatus2[ManageStatus2["New"] = 1] = "New"; + ManageStatus2[ManageStatus2["Update"] = 2] = "Update"; +})(ManageStatus || (ManageStatus = {})); +let TypstWorker$1 = (_b = kObject, class TypstWorker { + /** + * @internal + */ + constructor(plugin, o) { + __publicField(this, "plugin"); + /** + * @internal + */ + __publicField(this, _b); + /** + * @internal + */ + __publicField(this, "managedCanvasElemList", /* @__PURE__ */ new Map()); + /** + * @internal + */ + __publicField(this, "canvasCounter", Math.random()); + this.plugin = plugin; + this[kObject] = o; + } + /** + * See {@link TypstRenderer#manipulateData} for more details. + */ + manipulateData(action, data) { + return this[kObject].manipulate_data(action, data); + } + /** + * You must submit all canvas in pages to ensure synchronization with the background worker + * + * See {@link TypstRenderer#renderCanvas} for more details. + */ + renderCanvas(canvasElemList) { + const m = this.managedCanvasElemList; + for (const [_, elem] of m) { + elem[0] = ManageStatus.Delete; + } + for (const elem of canvasElemList) { + const canvas = elem.canvas; + let elemId = canvas.dataset.manageId; + let action = ManageStatus.Update; + if (!elemId) { + elemId = this.canvasCounter.toFixed(5); + this.canvasCounter += 1; + canvas.dataset.manageId = elemId; + action = ManageStatus.New; + } + let prev = m.get(elemId); + if (prev && prev[0] !== ManageStatus.Delete) { + throw new Error("cannot update a canvas for two times in batch"); + } + m.set(elemId, [action, { ...elem }]); + } + const entries = Array.from(m.entries()); + const actions = new Uint8Array(entries.length); + const elements = new Array(entries.length); + const options = entries.map(([key, [action, elem]], index) => { + if (!action) { + m.delete(key); + } + actions[index] = action; + elements[index] = elem.canvas; + return this.plugin.canvasOptionsToRust(elem); + }); + return this[kObject].render_canvas(actions, elements, options); + } + async retrievePagesInfo() { + const pages_info = await this[kObject].get_pages_info(); + console.log(pages_info); + const pageInfos = []; + const pageCount = pages_info.page_count; + for (let i = 0; i < pageCount; i++) { + const pageAst = pages_info.page(i); + pageInfos.push({ + pageOffset: pageAst.page_off, + width: pageAst.width_pt, + height: pageAst.height_pt + }); + } + return pageInfos; + } +}); +const gRendererModule = (module) => new LazyWasmModule(async (bin) => { + return await module.default(bin); +}); +function createTypstRenderer() { + return new TypstRendererDriver(); +} +let warnOnceCanvasSet = true; +class TypstRendererDriver { + constructor() { + __publicField(this, "renderer"); + __publicField(this, "rendererJs"); + } + async init(options) { + var _a2; + this.rendererJs = await (((_a2 = options == null ? void 0 : options.getWrapper) == null ? void 0 : _a2.call(options)) || Promise.resolve().then(() => wasmPackShim)); + const TypstRendererBuilder2 = this.rendererJs.TypstRendererBuilder; + this.renderer = await buildComponent(options, gRendererModule(this.rendererJs), TypstRendererBuilder2, {}); + } + loadGlyphPack(_pack) { + return Promise.resolve(); + } + createOptionsToRust(options) { + const rustOptions = new this.rendererJs.CreateSessionOptions(); + if (options.format !== void 0) { + rustOptions.format = options.format; + } + if (options.artifactContent !== void 0) { + rustOptions.artifact_content = options.artifactContent; + } + return rustOptions; + } + canvasOptionsToRust(options) { + const rustOptions = new this.rendererJs.RenderPageImageOptions(); + if (options.pageOffset === void 0) { + throw new Error("pageOffset is required in reflexo v0.5.0"); + } else { + rustOptions.page_off = options.pageOffset; + } + if (options.cacheKey !== void 0) { + rustOptions.cache_key = options.cacheKey; + } + if (options.backgroundColor !== void 0) { + rustOptions.background_color = options.backgroundColor; + } + if (options.pixelPerPt !== void 0) { + rustOptions.pixel_per_pt = options.pixelPerPt; + } + if (options.dataSelection !== void 0) { + let encoded = 0; + if (options.dataSelection.body) { + encoded |= 1 << 0; + } else if (options.canvas && warnOnceCanvasSet) { + warnOnceCanvasSet = false; + console.warn("dataSelection.body is not set but providing canvas for body"); + } + if (options.dataSelection.text || options.dataSelection.annotation) { + console.error("dataSelection.text and dataSelection.annotation are deprecated"); + } + if (options.dataSelection.semantics) { + encoded |= 1 << 3; + } + rustOptions.data_selection = encoded; + } + return rustOptions; + } + retrievePagesInfoFromSession(session) { + return session.retrievePagesInfo(); + } + /** + * Render a Typst document to canvas. + */ + renderCanvas(options) { + return this.withinOptionSession(options, async (sessionRef) => { + return this.renderer.render_page_to_canvas(sessionRef[kObject], options.canvas || void 0, this.canvasOptionsToRust(options)); + }); + } + // async renderPdf(artifactContent: string): Promise { + // return this.renderer.render_to_pdf(artifactContent); + // } + async inAnimationFrame(fn) { + return new Promise((resolve, reject) => { + requestAnimationFrame(() => { + try { + resolve(fn()); + } catch (e) { + reject(e); + } + }); + }); + } + async renderDisplayLayer(session, canvasList, options) { + const pages_info = session[kObject].pages_info; + const page_count = pages_info.page_count; + const doRender = async (i, page_off) => { + const canvas = canvasList[i]; + const ctx = canvas.getContext("2d"); + if (!ctx) { + throw new Error("canvas context is null"); + } + return await this.renderCanvas({ + ...options, + canvas: ctx, + renderSession: session, + pageOffset: page_off + }); + }; + const t = performance.now(); + const textContentList = await (async () => { + const results = []; + for (let i = 0; i < page_count; i++) { + results.push(await this.inAnimationFrame(() => doRender(i, i))); + } + return results; + })(); + const t2 = performance.now(); + console.log(`display layer used: render = ${(t2 - t).toFixed(1)}ms`); + return textContentList; + } + renderTextLayer(layerList, textSourceList) { + const t2 = performance.now(); + layerList.forEach((layer, i) => { + layer.innerHTML = textSourceList[i].htmlSemantics[0]; + }); + const t3 = performance.now(); + console.log(`text layer used: render = ${(t3 - t2).toFixed(1)}ms`); + } + async render(options) { + if ("format" in options) { + if (options.format !== "vector") { + const artifactFormats = ["serde_json", "js", "ir"]; + if (artifactFormats.includes(options.format)) { + throw new Error(`deprecated format ${options.format}, please use vector format`); + } + } + } + return this.renderToCanvas(options); + } + async renderDom(options) { + if ("format" in options) { + if (options.format !== "vector") { + const artifactFormats = ["serde_json", "js", "ir"]; + if (artifactFormats.includes(options.format)) { + throw new Error(`deprecated format ${options.format}, please use vector format`); + } + } + } + return this.withinOptionSession(options, async (sessionRef) => { + const t = new TypstDomDocument({ + ...options, + renderMode: "dom", + hookedElem: options.container, + kModule: sessionRef, + renderer: this + }); + await t.impl.mountDom(options.pixelPerPt); + return t; + }); + } + async renderToCanvas(options) { + let session; + let renderPageResults; + const mountContainer = options.container; + mountContainer.style.visibility = "hidden"; + const doRenderDisplayLayer = async (canvasList, resetLayout) => { + try { + renderPageResults = await this.renderDisplayLayer(session, canvasList, options); + resetLayout(); + } finally { + mountContainer.style.visibility = "visible"; + } + }; + return this.withinOptionSession(options, async (sessionRef) => { + session = sessionRef; + if (session[kObject].pages_info.page_count === 0) { + throw new Error(`No page found in session`); + } + if (options.pixelPerPt !== void 0 && options.pixelPerPt <= 0) { + throw new Error("Invalid typst.RenderOptions.pixelPerPt, should be a positive number " + options.pixelPerPt); + } + let backgroundColor = options.backgroundColor; + if (backgroundColor !== void 0) { + if (!/^#[0-9a-f]{6}$/.test(backgroundColor)) { + throw new Error("Invalid typst.backgroundColor color for matching ^#?[0-9a-f]{6}$ " + backgroundColor); + } + } + session.pixelPerPt = options.pixelPerPt ?? TypstDefaultParams.PIXEL_PER_PT; + session.backgroundColor = backgroundColor ?? "#ffffff"; + const t = performance.now(); + const pageView = new RenderView(this.retrievePagesInfoFromSession(session), mountContainer, options); + const t2 = performance.now(); + console.log(`layer used: retrieve = ${(t2 - t).toFixed(1)}ms`); + await doRenderDisplayLayer(pageView.canvasList, () => pageView.resetLayout()); + this.renderTextLayer(pageView.textLayerList, renderPageResults); + return; + }); + } + createModule(b) { + return Promise.resolve(new RenderSession$1(this, this.renderer.create_session(b && this.createOptionsToRust({ + format: "vector", + artifactContent: b + })))); + } + async createWorkerV0(worker) { + return new TypstWorker$1(this, await this.renderer.create_worker(worker)); + } + workerBridge() { + return this.renderer.create_worker_bridge(); + } + renderSvg(options, container) { + if (options instanceof RenderSession$1 || container) { + throw new Error("removed api, please use renderToSvg({ renderSession, container }) instead"); + } + return this.withinOptionSession(options, async (sessionRef) => { + let parts = void 0; + if (options.data_selection) { + parts = 0; + if (options.data_selection.body) { + parts |= 1 << 0; + } + if (options.data_selection.defs) { + parts |= 1 << 1; + } + if (options.data_selection.css) { + parts |= 1 << 2; + } + if (options.data_selection.js) { + parts |= 1 << 3; + } + } + return Promise.resolve(this.renderer.svg_data(sessionRef[kObject], parts)); + }); + } + renderSvgDiff(options) { + if (!options.window) { + return this.renderer.render_svg_diff(options.renderSession[kObject], 0, 0, 1e33, 1e33); + } + return this.renderer.render_svg_diff(options.renderSession[kObject], options.window.lo.x, options.window.lo.y, options.window.hi.x, options.window.hi.y); + } + renderToSvg(options) { + return this.withinOptionSession(options, async (sessionRef) => { + return Promise.resolve(this.renderer.render_svg(sessionRef[kObject], options.container)); + }); + } + getCustomV1(options) { + return Promise.resolve(this.renderer.get_customs(options.renderSession[kObject])); + } + resetSession(session) { + return this.renderer.reset(session[kObject]); + } + manipulateData(opts) { + return this.renderer.manipulate_data(opts.renderSession[kObject], opts.action ?? "reset", opts.data); + } + withinOptionSession(options, fn) { + function isRenderByContentOption(options2) { + return "artifactContent" in options2; + } + if ("renderSession" in options) { + return fn(options.renderSession); + } + if (isRenderByContentOption(options)) { + return this.runWithSession(options, fn); + } + throw new Error("Invalid render options, should be one of RenderByContentOptions|RenderBySessionOptions"); + } + async runWithSession(arg1, arg2) { + let options = arg1; + let fn = arg2; + if (!arg2) { + options = void 0; + fn = arg1; + } + const session = this.renderer.create_session( + /* moved */ + options && this.createOptionsToRust(options) + ); + try { + const res = await fn(new RenderSession$1(this, session)); + session.free(); + return res; + } catch (e) { + session.free(); + throw e; + } + } +} +window.TypstRenderModule = { + createTypstRenderer +}; +let initialRender = true; +let jumppedCrossLink = false; +function postProcessCrossLinks(appElem, reEnters) { + function processLink(a) { + if (origin) { + const onclick2 = a.getAttribute("onclick"); + if (onclick2 === null) { + let target = a.getAttribute("target"); + if (target === "_blank") { + a.removeAttribute("target"); + } + } else if (globalSemaLabels) { + if (onclick2.startsWith("handleTypstLocation")) { + const [u, x, y] = onclick2.split("(")[1].split(")")[0].split(",").slice(1).map((s) => Number.parseFloat(s.trim())); + for (const [label, _dom, pos] of globalSemaLabels) { + const [u1, x1, y1] = pos; + if (u === u1 && Math.abs(x - x1) < 0.01 && Math.abs(y - y1) < 0.01) { + a.id = `typst-label-${label}`; + a.setAttribute("href", `#label-${label}`); + a.setAttribute("xlink:href", `#label-${label}`); + break; + } + } + } + } + } + const decodeTypstUrlc = (s) => s.split("-").map((s2) => { + const n = Number.parseInt(s2); + if (Number.isNaN(n)) { + return s2; + } else { + return String.fromCharCode(n); + } + }).join(""); + const href = a.getAttribute("href") || a.getAttribute("xlink:href"); + if (href == null && a.tagName !== "A") { + const sub = a.getElementsByTagName("a"); + if (sub.length > 0) { + for (const s of sub) { + processLink(s); + } + } + return; + } + if (!href) { + return; + } + if (href.startsWith("cross-link")) { + const url = new URL(href); + const pathLabelUnicodes = url.searchParams.get("path-label"); + const labelUnicodes = url.searchParams.get("label"); + const plb = decodeTypstUrlc(pathLabelUnicodes).replace(".typ", ".html").replace(/^\//g, ""); + let absolutePath = window.typstPathToRoot ? window.typstPathToRoot.replace(/\/$/g, "") : ""; + absolutePath = new URL(`${absolutePath}/${plb}`, window.location.href).href; + if (labelUnicodes) { + absolutePath += "#label-" + encodeURIComponent(decodeTypstUrlc(labelUnicodes)); + } + a.setAttribute("href", absolutePath); + a.setAttribute("xlink:href", absolutePath); + } + const onclick = a.getAttribute("onclick"); + if (onclick && onclick.includes("document.querySelector")) { + a.setAttribute( + "onclick", + onclick.replace("return false", "window.updateHovers([sel]); return false") + ); + } + } + const links = appElem.querySelectorAll(".typst-content-link"); + if (links.length === 0) { + console.log("no links found, probe after a while"); + setTimeout(() => postProcessCrossLinks(appElem, reEnters * 1.5), reEnters); + return; + } + links.forEach(processLink); + if (window.location.hash && !jumppedCrossLink) { + const hash = window.location.hash; + const firstSep = hash.indexOf("-"); + if (firstSep != -1 && hash.slice(0, firstSep) === "#label") { + const labelTarget = hash.slice(firstSep + 1); + { + let sel = document.querySelector( + `[data-typst-label=${JSON.stringify(decodeURIComponent(labelTarget))}]` + ); + if (sel) { + window.scroll({ + top: sel.getBoundingClientRect().top + window.scrollY - window.innerHeight * 0.382 + }); + updateHovers([sel]); + initialRender = false; + jumppedCrossLink = true; + return; + } + } + for (const [label, dom, pos] of globalSemaLabels) { + if (label === labelTarget) { + const [_, x, y] = pos; + window.handleTypstLocation(dom, 1, x, y, { + behavior: initialRender ? "smooth" : "instant" + }); + initialRender = false; + jumppedCrossLink = true; + break; + } + } + } + } +} +let prevHovers = void 0; +function updateHovers(elems) { + if (prevHovers) { + for (const h of prevHovers) { + h.classList.remove("focus"); + } + } + if (elems) { + for (const h of elems) { + h.classList.add("focus"); + } + } + prevHovers = elems; +} +window.updateHovers = updateHovers; +let globalSemaLabels = []; +function findLinkInSvg(r, xy) { + const bbox = r.getBoundingClientRect(); + if (xy[0] < bbox.left - 1 || xy[0] > bbox.right + 1 || xy[1] < bbox.top - 1 || xy[1] > bbox.bottom + 1) { + return; + } + if (r.classList.contains("pseudo-link")) { + return r; + } + for (let i = 0; i < r.children.length; i++) { + const a = findLinkInSvg(r.children[i], xy); + if (a) { + return a; + } + } + return void 0; +} +const findAncestor = (el, cls) => { + while (el && !el.classList.contains(cls)) el = el.parentElement; + return el; +}; +window.typstBookRenderHtmlPage = function(relPath, appContainer) { + const getTheme = () => window.getTypstTheme(); + let currTheme = getTheme(); + async function reloadArtifact(theme) { + const preloadContent = appContainer == null ? void 0 : appContainer.querySelector(".typst-preload-content"); + if (!preloadContent) { + console.error("no preload content found"); + return; + } + preloadContent.innerHTML = ""; + preloadContent.removeAttribute("data-applied-width"); + const artifactData = await fetch(`${relPath}.${theme}.html`).then((response) => response.text()); + const themePreloadContent = document.createElement("div"); + themePreloadContent.className = "typst-preload-content"; + themePreloadContent.innerHTML = artifactData; + preloadContent.replaceWith(themePreloadContent); + themePreloadContent.style.display = "block"; + postProcessCrossLinks(themePreloadContent, 100); + } + reloadArtifact(currTheme).then(() => { + let base = Promise.resolve(); + window.typstChangeTheme = () => { + const nextTheme = getTheme(); + if (nextTheme === currTheme) { + return base; + } + currTheme = nextTheme; + return reloadArtifact(currTheme); + }; + window.typstChangeTheme(); + }); +}; +window.typstBookRenderPage = function(plugin, relPath, appContainer) { + const getTheme = () => window.getTypstTheme(); + let currTheme = getTheme(); + let session = void 0; + let dom = void 0; + let disposeSession = () => { + }; + const appElem = document.createElement("div"); + if (appElem && appContainer) { + appElem.className = "typst-app"; + appContainer.appendChild(appElem); + } + const dec = new TextDecoder(); + window.typstBindSvgDom = async (_elem, _dom) => { + }; + let runningSemantics = {}; + const typstBindCustomSemantics = async (root, svg, semantics) => { + const index = root == null ? void 0 : root.getAttribute("data-index"); + const key = `${index}`; + const width = root == null ? void 0 : root.getAttribute("data-width"); + const keyResolving = `${width}`; + if (runningSemantics[key] === keyResolving) { + return; + } + runningSemantics[key] = keyResolving; + console.log("bind custom semantics", key, keyResolving, svg == null ? void 0 : svg.viewBox); + const customs = await plugin.getCustomV1({ + renderSession: session + }); + const semaLabel = customs.find((k) => k[0] === "sema-label"); + if (semaLabel) { + const labelBin = semaLabel[1]; + const labels = JSON.parse(dec.decode(labelBin)); + globalSemaLabels = labels.map(([label, pos]) => { + const [_, u, x, y] = pos.split(/[pxy]/).map(Number.parseFloat); + return [encodeURIComponent(label), svg, [u, x, y]]; + }); + } + postProcessCrossLinks(semantics, 100); + }; + let semanticHandlers = []; + window.typstBindCustomSemantics = (root, svg, semantics) => setTimeout(() => { + const semanticHandler = () => { + typstBindCustomSemantics(root, svg, semantics); + }; + semanticHandler(); + semanticHandlers.push(semanticHandler); + }, 0); + const baseHandleTypstLocation = window.handleTypstLocation; + window.handleTypstLocation = (elem, page, x, y, options) => { + const docRoot = findAncestor(elem, "typst-app"); + if (!docRoot) { + console.warn("no typst-app found", elem); + return; + } + console.log(docRoot); + options = options || {}; + options.isDom = true; + for (const h of docRoot.children) { + if (h.classList.contains("typst-dom-page")) { + const idx = Number.parseInt(h.getAttribute("data-index")); + if (idx + 1 === page) { + const svg = h.querySelector(".typst-svg-page"); + if (svg) { + baseHandleTypstLocation(svg, page, x, y, options); + } + return; + } + } + } + }; + window.assignSemaHash = (u, x, y) => { + var _a2; + for (const [label, dom2, pos] of globalSemaLabels) { + const [u1, x1, y1] = pos; + if (u === u1 && Math.abs(x - x1) < 0.01 && Math.abs(y - y1) < 0.01) { + location.hash = `label-${label}`; + (_a2 = window.typstCheckAndRerender) == null ? void 0 : _a2.call(window, false, new Error("assignSemaHash")).then(() => { + const width = dom2.viewBox.baseVal.width; + const height = dom2.viewBox.baseVal.height; + const bbox = dom2.getBoundingClientRect(); + const domX1 = bbox.left + x1 / width * bbox.width; + const domY1 = bbox.top + y1 / height * bbox.height; + const lnk = findLinkInSvg(dom2, [domX1, domY1]); + if (!lnk) { + return; + } + const relatedElems = window.typstGetRelatedElements(lnk); + updateHovers(relatedElems); + return; + }); + return; + } + } + updateHovers([]); + location.hash = `loc-${u}x${x.toFixed(2)}x${y.toFixed(2)}`; + }; + async function reloadArtifact(theme) { + if (dom) { + dom.dispose(); + dom = void 0; + } + if (session) { + disposeSession(); + session = void 0; + } + appElem.innerHTML = ""; + appElem.removeAttribute("data-applied-width"); + const artifactData = await fetch(`${relPath}.${theme}.multi.sir.in`).then((response) => response.arrayBuffer()).then((buffer) => new Uint8Array(buffer)); + const t1 = performance.now(); + return new Promise((resolve) => { + return plugin.runWithSession((sessionRef) => { + return new Promise(async (doDisposeSession) => { + disposeSession = doDisposeSession; + session = sessionRef; + const t2 = performance.now(); + jumppedCrossLink = false; + semanticHandlers.splice(0, semanticHandlers.length); + runningSemantics = {}; + dom = await plugin.renderDom({ + renderSession: sessionRef, + container: appElem, + pixelPerPt: 4.5 + }); + const mod = dom.impl.modes.find(([k, _]) => k == "dom"); + const postRender = mod[1].postRender; + mod[1].postRender = function() { + console.log("hack run semantic handlers"); + postRender.apply(this); + for (const h of semanticHandlers) { + h(); + } + return; + }; + console.log( + `theme = ${theme}, load artifact took ${t2 - t1} milliseconds, parse artifact took ${t2 - t1} milliseconds` + ); + dom.addChangement(["new", artifactData]); + resolve(dom); + }); + }); + }); + } + reloadArtifact(currTheme).then((dom2) => { + let base = Promise.resolve(); + window.typstChangeTheme = () => { + const nextTheme = getTheme(); + if (nextTheme === currTheme) { + return base; + } + currTheme = nextTheme; + return reloadArtifact(currTheme); + }; + const viewportHandler = () => dom2.addViewportChange(); + window.addEventListener("resize", viewportHandler); + window.addEventListener("scroll", viewportHandler); + dom2.impl.disposeList.push(() => { + window.removeEventListener("resize", viewportHandler); + window.removeEventListener("scroll", viewportHandler); + }); + window.typstRerender = viewportHandler; + window.typstChangeTheme(); + }); +}; +let wasm; +const heap = new Array(128).fill(void 0); +heap.push(void 0, null, true, false); +function getObject(idx) { + return heap[idx]; +} +let heap_next = heap.length; +function addHeapObject(obj) { + if (heap_next === heap.length) heap.push(heap.length + 1); + const idx = heap_next; + heap_next = heap[idx]; + if (typeof heap_next !== "number") throw new Error("corrupt heap"); + heap[idx] = obj; + return idx; +} +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + wasm.__wbindgen_export_0(addHeapObject(e)); + } +} +function logError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + let error = function() { + try { + return e instanceof Error ? `${e.message} + +Stack: +${e.stack}` : e.toString(); + } catch (_) { + return ""; + } + }(); + console.error("wasm-bindgen: imported JS function that was not marked as `catch` threw an error:", error); + throw e; + } +} +function _assertNum(n) { + if (typeof n !== "number") throw new Error(`expected a number argument, found ${typeof n}`); +} +const cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => { + throw Error("TextDecoder not available"); +} }; +if (typeof TextDecoder !== "undefined") { + cachedTextDecoder.decode(); +} +let cachedUint8ArrayMemory0 = null; +function getUint8ArrayMemory0() { + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8ArrayMemory0; +} +function getStringFromWasm0(ptr, len) { + ptr = ptr >>> 0; + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); +} +let WASM_VECTOR_LEN = 0; +const cachedTextEncoder = typeof TextEncoder !== "undefined" ? new TextEncoder("utf-8") : { encode: () => { + throw Error("TextEncoder not available"); +} }; +const encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) { + return cachedTextEncoder.encodeInto(arg, view); +} : function(arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; +}; +function passStringToWasm0(arg, malloc, realloc) { + if (typeof arg !== "string") throw new Error(`expected a string argument, found ${typeof arg}`); + if (realloc === void 0) { + const buf = cachedTextEncoder.encode(arg); + const ptr2 = malloc(buf.length, 1) >>> 0; + getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr2; + } + let len = arg.length; + let ptr = malloc(len, 1) >>> 0; + const mem = getUint8ArrayMemory0(); + let offset = 0; + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 127) break; + mem[ptr + offset] = code; + } + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; + const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); + const ret = encodeString(arg, view); + if (ret.read !== arg.length) throw new Error("failed to pass whole string"); + offset += ret.written; + ptr = realloc(ptr, len, offset, 1) >>> 0; + } + WASM_VECTOR_LEN = offset; + return ptr; +} +let cachedDataViewMemory0 = null; +function getDataViewMemory0() { + if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) { + cachedDataViewMemory0 = new DataView(wasm.memory.buffer); + } + return cachedDataViewMemory0; +} +function isLikeNone(x) { + return x === void 0 || x === null; +} +function _assertBoolean(n) { + if (typeof n !== "boolean") { + throw new Error(`expected a boolean argument, found ${typeof n}`); + } +} +function dropObject(idx) { + if (idx < 132) return; + heap[idx] = heap_next; + heap_next = idx; +} +function takeObject(idx) { + const ret = getObject(idx); + dropObject(idx); + return ret; +} +const CLOSURE_DTORS = typeof FinalizationRegistry === "undefined" ? { register: () => { +}, unregister: () => { +} } : new FinalizationRegistry((state) => { + wasm.__wbindgen_export_4.get(state.dtor)(state.a, state.b); +}); +function makeClosure(arg0, arg1, dtor, f) { + const state = { a: arg0, b: arg1, cnt: 1, dtor }; + const real = (...args) => { + state.cnt++; + try { + return f(state.a, state.b, ...args); + } finally { + if (--state.cnt === 0) { + wasm.__wbindgen_export_4.get(state.dtor)(state.a, state.b); + state.a = 0; + CLOSURE_DTORS.unregister(state); + } + } + }; + real.original = state; + CLOSURE_DTORS.register(real, state, state); + return real; +} +function makeMutClosure(arg0, arg1, dtor, f) { + const state = { a: arg0, b: arg1, cnt: 1, dtor }; + const real = (...args) => { + state.cnt++; + const a = state.a; + state.a = 0; + try { + return f(a, state.b, ...args); + } finally { + if (--state.cnt === 0) { + wasm.__wbindgen_export_4.get(state.dtor)(a, state.b); + CLOSURE_DTORS.unregister(state); + } else { + state.a = a; + } + } + }; + real.original = state; + CLOSURE_DTORS.register(real, state, state); + return real; +} +function debugString(val) { + const type = typeof val; + if (type == "number" || type == "boolean" || val == null) { + return `${val}`; + } + if (type == "string") { + return `"${val}"`; + } + if (type == "symbol") { + const description = val.description; + if (description == null) { + return "Symbol"; + } else { + return `Symbol(${description})`; + } + } + if (type == "function") { + const name = val.name; + if (typeof name == "string" && name.length > 0) { + return `Function(${name})`; + } else { + return "Function"; + } + } + if (Array.isArray(val)) { + const length = val.length; + let debug = "["; + if (length > 0) { + debug += debugString(val[0]); + } + for (let i = 1; i < length; i++) { + debug += ", " + debugString(val[i]); + } + debug += "]"; + return debug; + } + const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); + let className; + if (builtInMatches && builtInMatches.length > 1) { + className = builtInMatches[1]; + } else { + return toString.call(val); + } + if (className == "Object") { + try { + return "Object(" + JSON.stringify(val) + ")"; + } catch (_) { + return "Object"; + } + } + if (val instanceof Error) { + return `${val.name}: ${val.message} +${val.stack}`; + } + return className; +} +function passArray8ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 1, 1) >>> 0; + getUint8ArrayMemory0().set(arg, ptr / 1); + WASM_VECTOR_LEN = arg.length; + return ptr; +} +function passArrayJsValueToWasm0(array, malloc) { + const ptr = malloc(array.length * 4, 4) >>> 0; + const mem = getDataViewMemory0(); + for (let i = 0; i < array.length; i++) { + mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true); + } + WASM_VECTOR_LEN = array.length; + return ptr; +} +function _assertClass(instance, klass) { + if (!(instance instanceof klass)) { + throw new Error(`expected instance of ${klass.name}`); + } +} +function renderer_build_info() { + const ret = wasm.renderer_build_info(); + return takeObject(ret); +} +let cachedUint32ArrayMemory0 = null; +function getUint32ArrayMemory0() { + if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) { + cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer); + } + return cachedUint32ArrayMemory0; +} +function passArray32ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 4, 4) >>> 0; + getUint32ArrayMemory0().set(arg, ptr / 4); + WASM_VECTOR_LEN = arg.length; + return ptr; +} +function __wbg_adapter_26(arg0, arg1) { + _assertNum(arg0); + _assertNum(arg1); + wasm.__wbindgen_export_5(arg0, arg1); +} +function __wbg_adapter_29(arg0, arg1, arg2) { + _assertNum(arg0); + _assertNum(arg1); + wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2)); +} +function __wbg_adapter_32(arg0, arg1, arg2) { + _assertNum(arg0); + _assertNum(arg1); + wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2)); +} +function __wbg_adapter_66(arg0, arg1, arg2, arg3) { + _assertNum(arg0); + _assertNum(arg1); + wasm.__wbindgen_export_8(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); +} +const __wbindgen_enum_CanvasWindingRule = ["nonzero", "evenodd"]; +const CreateSessionOptionsFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => { +}, unregister: () => { +} } : new FinalizationRegistry((ptr) => wasm.__wbg_createsessionoptions_free(ptr >>> 0, 1)); +class CreateSessionOptions { + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + CreateSessionOptionsFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_createsessionoptions_free(ptr, 0); + } + constructor() { + const ret = wasm.createsessionoptions_new(); + this.__wbg_ptr = ret >>> 0; + CreateSessionOptionsFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * @param {string} format + */ + set format(format) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ptr0 = passStringToWasm0(format, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len0 = WASM_VECTOR_LEN; + wasm.createsessionoptions_set_format(this.__wbg_ptr, ptr0, len0); + } + /** + * @param {Uint8Array} artifact_content + */ + set artifact_content(artifact_content) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ptr0 = passArray8ToWasm0(artifact_content, wasm.__wbindgen_export_1); + const len0 = WASM_VECTOR_LEN; + wasm.createsessionoptions_set_artifact_content(this.__wbg_ptr, ptr0, len0); + } +} +const IncrDomDocClientFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => { +}, unregister: () => { +} } : new FinalizationRegistry((ptr) => wasm.__wbg_incrdomdocclient_free(ptr >>> 0, 1)); +class IncrDomDocClient { + constructor() { + throw new Error("cannot invoke `new` directly"); + } + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(IncrDomDocClient.prototype); + obj.__wbg_ptr = ptr; + IncrDomDocClientFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + IncrDomDocClientFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_incrdomdocclient_free(ptr, 0); + } + /** + * @param {any} functions + */ + bind_functions(functions) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + wasm.incrdomdocclient_bind_functions(this.__wbg_ptr, addHeapObject(functions)); + } + /** + * Relayout the document in the given window. + * @param {number} x + * @param {number} y + * @param {number} w + * @param {number} h + * @returns {Promise} + */ + relayout(x, y, w, h) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.incrdomdocclient_relayout(this.__wbg_ptr, x, y, w, h); + return takeObject(ret); + } + /** + * @param {number} page_num + * @param {number} x + * @param {number} y + * @param {number} w + * @param {number} h + * @param {number} stage + * @returns {boolean} + */ + need_repaint(page_num, x, y, w, h, stage) { + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + _assertNum(page_num); + _assertNum(stage); + wasm.incrdomdocclient_need_repaint(retptr, this.__wbg_ptr, page_num, x, y, w, h, stage); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); + } + return r0 !== 0; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {number} page_num + * @param {number} x + * @param {number} y + * @param {number} w + * @param {number} h + * @param {number} stage + * @returns {any} + */ + repaint(page_num, x, y, w, h, stage) { + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + _assertNum(page_num); + _assertNum(stage); + wasm.incrdomdocclient_repaint(retptr, this.__wbg_ptr, page_num, x, y, w, h, stage); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); + } + return takeObject(r0); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } +} +const PageInfoFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => { +}, unregister: () => { +} } : new FinalizationRegistry((ptr) => wasm.__wbg_pageinfo_free(ptr >>> 0, 1)); +class PageInfo { + constructor() { + throw new Error("cannot invoke `new` directly"); + } + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(PageInfo.prototype); + obj.__wbg_ptr = ptr; + PageInfoFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + PageInfoFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_pageinfo_free(ptr, 0); + } + /** + * @returns {number} + */ + get page_off() { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.pageinfo_page_off(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @returns {number} + */ + get width_pt() { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.pageinfo_width_pt(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + get height_pt() { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.pageinfo_height_pt(this.__wbg_ptr); + return ret; + } +} +const PagesInfoFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => { +}, unregister: () => { +} } : new FinalizationRegistry((ptr) => wasm.__wbg_pagesinfo_free(ptr >>> 0, 1)); +class PagesInfo { + constructor() { + throw new Error("cannot invoke `new` directly"); + } + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(PagesInfo.prototype); + obj.__wbg_ptr = ptr; + PagesInfoFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + PagesInfoFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_pagesinfo_free(ptr, 0); + } + /** + * @returns {number} + */ + get page_count() { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.pagesinfo_page_count(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @param {number} num + * @returns {PageInfo | undefined} + */ + page_by_number(num) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + _assertNum(num); + const ret = wasm.pagesinfo_page_by_number(this.__wbg_ptr, num); + return ret === 0 ? void 0 : PageInfo.__wrap(ret); + } + /** + * @param {number} i + * @returns {PageInfo} + */ + page(i) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + _assertNum(i); + const ret = wasm.pagesinfo_page(this.__wbg_ptr, i); + return PageInfo.__wrap(ret); + } + /** + * @returns {number} + */ + width() { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.pagesinfo_width(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + height() { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.pagesinfo_height(this.__wbg_ptr); + return ret; + } +} +const RenderPageImageOptionsFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => { +}, unregister: () => { +} } : new FinalizationRegistry((ptr) => wasm.__wbg_renderpageimageoptions_free(ptr >>> 0, 1)); +class RenderPageImageOptions { + static __unwrap(jsValue) { + if (!(jsValue instanceof RenderPageImageOptions)) { + return 0; + } + return jsValue.__destroy_into_raw(); + } + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RenderPageImageOptionsFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_renderpageimageoptions_free(ptr, 0); + } + constructor() { + const ret = wasm.renderpageimageoptions_new(); + this.__wbg_ptr = ret >>> 0; + RenderPageImageOptionsFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * @returns {number | undefined} + */ + get pixel_per_pt() { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.renderpageimageoptions_pixel_per_pt(this.__wbg_ptr); + return ret === 4294967297 ? void 0 : ret; + } + /** + * @param {number | null} [pixel_per_pt] + */ + set pixel_per_pt(pixel_per_pt) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + if (!isLikeNone(pixel_per_pt)) { + _assertNum(pixel_per_pt); + } + wasm.renderpageimageoptions_set_pixel_per_pt(this.__wbg_ptr, isLikeNone(pixel_per_pt) ? 4294967297 : Math.fround(pixel_per_pt)); + } + /** + * @returns {string | undefined} + */ + get background_color() { + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + wasm.renderpageimageoptions_background_color(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getStringFromWasm0(r0, r1).slice(); + wasm.__wbindgen_export_3(r0, r1 * 1, 1); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {string | null} [background_color] + */ + set background_color(background_color) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + var ptr0 = isLikeNone(background_color) ? 0 : passStringToWasm0(background_color, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + var len0 = WASM_VECTOR_LEN; + wasm.renderpageimageoptions_set_background_color(this.__wbg_ptr, ptr0, len0); + } + /** + * @returns {number} + */ + get page_off() { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.renderpageimageoptions_page_off(this.__wbg_ptr); + return ret >>> 0; + } + /** + * @param {number} page_off + */ + set page_off(page_off) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + _assertNum(page_off); + wasm.renderpageimageoptions_set_page_off(this.__wbg_ptr, page_off); + } + /** + * @returns {string | undefined} + */ + get cache_key() { + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + wasm.renderpageimageoptions_cache_key(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getStringFromWasm0(r0, r1).slice(); + wasm.__wbindgen_export_3(r0, r1 * 1, 1); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {string | null} [cache_key] + */ + set cache_key(cache_key) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + var ptr0 = isLikeNone(cache_key) ? 0 : passStringToWasm0(cache_key, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + var len0 = WASM_VECTOR_LEN; + wasm.renderpageimageoptions_set_cache_key(this.__wbg_ptr, ptr0, len0); + } + /** + * @returns {number | undefined} + */ + get data_selection() { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.renderpageimageoptions_data_selection(this.__wbg_ptr); + return ret === 4294967297 ? void 0 : ret; + } + /** + * @param {number | null} [data_selection] + */ + set data_selection(data_selection) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + if (!isLikeNone(data_selection)) { + _assertNum(data_selection); + } + wasm.renderpageimageoptions_set_data_selection(this.__wbg_ptr, isLikeNone(data_selection) ? 4294967297 : data_selection >>> 0); + } +} +const RenderSessionFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => { +}, unregister: () => { +} } : new FinalizationRegistry((ptr) => wasm.__wbg_rendersession_free(ptr >>> 0, 1)); +class RenderSession2 { + constructor() { + throw new Error("cannot invoke `new` directly"); + } + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(RenderSession2.prototype); + obj.__wbg_ptr = ptr; + RenderSessionFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RenderSessionFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rendersession_free(ptr, 0); + } + /** + * @param {number} rect_lo_x + * @param {number} rect_lo_y + * @param {number} rect_hi_x + * @param {number} rect_hi_y + * @returns {string} + */ + render_in_window(rect_lo_x, rect_lo_y, rect_hi_x, rect_hi_y) { + let deferred1_0; + let deferred1_1; + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + wasm.rendersession_render_in_window(retptr, this.__wbg_ptr, rect_lo_x, rect_lo_y, rect_hi_x, rect_hi_y); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + deferred1_0 = r0; + deferred1_1 = r1; + return getStringFromWasm0(r0, r1); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); + } + } + /** + * @returns {number | undefined} + */ + get pixel_per_pt() { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.renderpageimageoptions_pixel_per_pt(this.__wbg_ptr); + return ret === 4294967297 ? void 0 : ret; + } + /** + * @param {number | null} [pixel_per_pt] + */ + set pixel_per_pt(pixel_per_pt) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + if (!isLikeNone(pixel_per_pt)) { + _assertNum(pixel_per_pt); + } + wasm.renderpageimageoptions_set_pixel_per_pt(this.__wbg_ptr, isLikeNone(pixel_per_pt) ? 4294967297 : Math.fround(pixel_per_pt)); + } + /** + * @returns {string | undefined} + */ + get background_color() { + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + wasm.rendersession_background_color(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getStringFromWasm0(r0, r1).slice(); + wasm.__wbindgen_export_3(r0, r1 * 1, 1); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {string | null} [background_color] + */ + set background_color(background_color) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + var ptr0 = isLikeNone(background_color) ? 0 : passStringToWasm0(background_color, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + var len0 = WASM_VECTOR_LEN; + wasm.rendersession_set_background_color(this.__wbg_ptr, ptr0, len0); + } + /** + * @returns {PagesInfo} + */ + get pages_info() { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.rendersession_pages_info(this.__wbg_ptr); + return PagesInfo.__wrap(ret); + } + /** + * @returns {number} + */ + get doc_width() { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.rendersession_doc_width(this.__wbg_ptr); + return ret; + } + /** + * @returns {number} + */ + get doc_height() { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.rendersession_doc_height(this.__wbg_ptr); + return ret; + } + /** + * @param {Uint32Array} path + * @returns {string | undefined} + */ + source_span(path) { + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + const ptr0 = passArray32ToWasm0(path, wasm.__wbindgen_export_1); + const len0 = WASM_VECTOR_LEN; + wasm.rendersession_source_span(retptr, this.__wbg_ptr, ptr0, len0); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true); + if (r3) { + throw takeObject(r2); + } + let v2; + if (r0 !== 0) { + v2 = getStringFromWasm0(r0, r1).slice(); + wasm.__wbindgen_export_3(r0, r1 * 1, 1); + } + return v2; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } +} +const RenderSessionOptionsFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => { +}, unregister: () => { +} } : new FinalizationRegistry((ptr) => wasm.__wbg_rendersessionoptions_free(ptr >>> 0, 1)); +class RenderSessionOptions { + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + RenderSessionOptionsFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_rendersessionoptions_free(ptr, 0); + } + constructor() { + const ret = wasm.rendersessionoptions_new(); + this.__wbg_ptr = ret >>> 0; + RenderSessionOptionsFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * @returns {number | undefined} + */ + get pixel_per_pt() { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.renderpageimageoptions_pixel_per_pt(this.__wbg_ptr); + return ret === 4294967297 ? void 0 : ret; + } + /** + * @param {number | null} [pixel_per_pt] + */ + set pixel_per_pt(pixel_per_pt) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + if (!isLikeNone(pixel_per_pt)) { + _assertNum(pixel_per_pt); + } + wasm.renderpageimageoptions_set_pixel_per_pt(this.__wbg_ptr, isLikeNone(pixel_per_pt) ? 4294967297 : Math.fround(pixel_per_pt)); + } + /** + * @returns {string | undefined} + */ + get background_color() { + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + wasm.rendersessionoptions_background_color(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getStringFromWasm0(r0, r1).slice(); + wasm.__wbindgen_export_3(r0, r1 * 1, 1); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {string | null} [background_color] + */ + set background_color(background_color) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + var ptr0 = isLikeNone(background_color) ? 0 : passStringToWasm0(background_color, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + var len0 = WASM_VECTOR_LEN; + wasm.rendersessionoptions_set_background_color(this.__wbg_ptr, ptr0, len0); + } + /** + * @returns {string | undefined} + */ + get format() { + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + wasm.rendersessionoptions_format(retptr, this.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + let v1; + if (r0 !== 0) { + v1 = getStringFromWasm0(r0, r1).slice(); + wasm.__wbindgen_export_3(r0, r1 * 1, 1); + } + return v1; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {string | null} [format] + */ + set format(format) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + var ptr0 = isLikeNone(format) ? 0 : passStringToWasm0(format, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + var len0 = WASM_VECTOR_LEN; + wasm.rendersessionoptions_set_format(this.__wbg_ptr, ptr0, len0); + } +} +const TypstRendererFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => { +}, unregister: () => { +} } : new FinalizationRegistry((ptr) => wasm.__wbg_typstrenderer_free(ptr >>> 0, 1)); +class TypstRenderer { + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(TypstRenderer.prototype); + obj.__wbg_ptr = ptr; + TypstRendererFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + TypstRendererFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_typstrenderer_free(ptr, 0); + } + /** + * @param {any} _w + * @returns {Promise} + */ + create_worker(_w) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.typstrenderer_create_worker(this.__wbg_ptr, addHeapObject(_w)); + return takeObject(ret); + } + /** + * @returns {WorkerBridge} + */ + create_worker_bridge() { + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const ptr = this.__destroy_into_raw(); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(ptr); + wasm.typstrenderer_create_worker_bridge(retptr, ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); + } + return WorkerBridge.__wrap(r0); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {RenderSession} ses + * @param {HTMLElement} elem + * @returns {Promise} + */ + mount_dom(ses, elem) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + _assertClass(ses, RenderSession2); + if (ses.__wbg_ptr === 0) { + throw new Error("Attempt to use a moved value"); + } + const ret = wasm.typstrenderer_mount_dom(this.__wbg_ptr, ses.__wbg_ptr, addHeapObject(elem)); + return takeObject(ret); + } + constructor() { + const ret = wasm.typstrenderer_new(); + this.__wbg_ptr = ret >>> 0; + TypstRendererFinalization.register(this, this.__wbg_ptr, this); + return this; + } + /** + * @param {CreateSessionOptions | null} [options] + * @returns {RenderSession} + */ + create_session(options) { + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + let ptr0 = 0; + if (!isLikeNone(options)) { + _assertClass(options, CreateSessionOptions); + if (options.__wbg_ptr === 0) { + throw new Error("Attempt to use a moved value"); + } + ptr0 = options.__destroy_into_raw(); + } + wasm.typstrenderer_create_session(retptr, this.__wbg_ptr, ptr0); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); + } + return RenderSession2.__wrap(r0); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {RenderSession} session + */ + reset(session) { + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + _assertClass(session, RenderSession2); + if (session.__wbg_ptr === 0) { + throw new Error("Attempt to use a moved value"); + } + wasm.typstrenderer_reset(retptr, this.__wbg_ptr, session.__wbg_ptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + if (r1) { + throw takeObject(r0); + } + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {RenderSession} session + * @param {string} action + * @param {Uint8Array} data + */ + manipulate_data(session, action, data) { + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + _assertClass(session, RenderSession2); + if (session.__wbg_ptr === 0) { + throw new Error("Attempt to use a moved value"); + } + const ptr0 = passStringToWasm0(action, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_export_1); + const len1 = WASM_VECTOR_LEN; + wasm.typstrenderer_manipulate_data(retptr, this.__wbg_ptr, session.__wbg_ptr, ptr0, len0, ptr1, len1); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + if (r1) { + throw takeObject(r0); + } + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {Uint8Array} artifact_content + * @param {string} decoder + * @returns {RenderSession} + */ + session_from_artifact(artifact_content, decoder) { + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + const ptr0 = passArray8ToWasm0(artifact_content, wasm.__wbindgen_export_1); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passStringToWasm0(decoder, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len1 = WASM_VECTOR_LEN; + wasm.typstrenderer_session_from_artifact(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); + } + return RenderSession2.__wrap(r0); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {any} _v + */ + load_glyph_pack(_v) { + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + wasm.typstrenderer_load_glyph_pack(retptr, this.__wbg_ptr, addHeapObject(_v)); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + if (r1) { + throw takeObject(r0); + } + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {RenderSession} session + * @param {number} rect_lo_x + * @param {number} rect_lo_y + * @param {number} rect_hi_x + * @param {number} rect_hi_y + * @returns {string} + */ + render_svg_diff(session, rect_lo_x, rect_lo_y, rect_hi_x, rect_hi_y) { + let deferred1_0; + let deferred1_1; + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + _assertClass(session, RenderSession2); + if (session.__wbg_ptr === 0) { + throw new Error("Attempt to use a moved value"); + } + wasm.typstrenderer_render_svg_diff(retptr, this.__wbg_ptr, session.__wbg_ptr, rect_lo_x, rect_lo_y, rect_hi_x, rect_hi_y); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + deferred1_0 = r0; + deferred1_1 = r1; + return getStringFromWasm0(r0, r1); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1); + } + } + /** + * @param {RenderSession} session + * @param {number | null} [parts] + * @returns {string} + */ + svg_data(session, parts) { + let deferred2_0; + let deferred2_1; + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + _assertClass(session, RenderSession2); + if (session.__wbg_ptr === 0) { + throw new Error("Attempt to use a moved value"); + } + if (!isLikeNone(parts)) { + _assertNum(parts); + } + wasm.typstrenderer_svg_data(retptr, this.__wbg_ptr, session.__wbg_ptr, isLikeNone(parts) ? 4294967297 : parts >>> 0); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true); + var ptr1 = r0; + var len1 = r1; + if (r3) { + ptr1 = 0; + len1 = 0; + throw takeObject(r2); + } + deferred2_0 = ptr1; + deferred2_1 = len1; + return getStringFromWasm0(ptr1, len1); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + wasm.__wbindgen_export_3(deferred2_0, deferred2_1, 1); + } + } + /** + * @param {RenderSession} session + * @returns {Array | undefined} + */ + get_customs(session) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + _assertClass(session, RenderSession2); + if (session.__wbg_ptr === 0) { + throw new Error("Attempt to use a moved value"); + } + const ret = wasm.typstrenderer_get_customs(this.__wbg_ptr, session.__wbg_ptr); + return takeObject(ret); + } + /** + * @param {RenderSession} session + * @param {HTMLElement} root + * @returns {boolean} + */ + render_svg(session, root) { + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + _assertClass(session, RenderSession2); + if (session.__wbg_ptr === 0) { + throw new Error("Attempt to use a moved value"); + } + wasm.typstrenderer_render_svg(retptr, this.__wbg_ptr, session.__wbg_ptr, addHeapObject(root)); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); + } + return r0 !== 0; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @param {RenderSession} ses + * @param {any} canvas + * @param {RenderPageImageOptions | null} [options] + * @returns {Promise} + */ + render_page_to_canvas(ses, canvas, options) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + _assertClass(ses, RenderSession2); + if (ses.__wbg_ptr === 0) { + throw new Error("Attempt to use a moved value"); + } + let ptr0 = 0; + if (!isLikeNone(options)) { + _assertClass(options, RenderPageImageOptions); + if (options.__wbg_ptr === 0) { + throw new Error("Attempt to use a moved value"); + } + ptr0 = options.__destroy_into_raw(); + } + const ret = wasm.typstrenderer_render_page_to_canvas(this.__wbg_ptr, ses.__wbg_ptr, addHeapObject(canvas), ptr0); + return takeObject(ret); + } +} +const TypstRendererBuilderFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => { +}, unregister: () => { +} } : new FinalizationRegistry((ptr) => wasm.__wbg_typstrendererbuilder_free(ptr >>> 0, 1)); +class TypstRendererBuilder { + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + TypstRendererBuilderFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_typstrendererbuilder_free(ptr, 0); + } + constructor() { + try { + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + wasm.typstrendererbuilder_new(retptr); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); + } + this.__wbg_ptr = r0 >>> 0; + TypstRendererBuilderFinalization.register(this, this.__wbg_ptr, this); + return this; + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {Promise} + */ + build() { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const ptr = this.__destroy_into_raw(); + _assertNum(ptr); + const ret = wasm.typstrendererbuilder_build(ptr); + return takeObject(ret); + } + /** + * @param {any} _pack + * @returns {Promise} + */ + add_glyph_pack(_pack) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.typstrendererbuilder_add_glyph_pack(this.__wbg_ptr, addHeapObject(_pack)); + return takeObject(ret); + } + /** + * @param {Uint8Array} _font_buffer + * @returns {Promise} + */ + add_raw_font(_font_buffer) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.typstrendererbuilder_add_raw_font(this.__wbg_ptr, addHeapObject(_font_buffer)); + return takeObject(ret); + } + /** + * @param {Array} _fonts + * @returns {Promise} + */ + add_web_fonts(_fonts) { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.typstrendererbuilder_add_web_fonts(this.__wbg_ptr, addHeapObject(_fonts)); + return takeObject(ret); + } +} +const TypstWorkerFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => { +}, unregister: () => { +} } : new FinalizationRegistry((ptr) => wasm.__wbg_typstworker_free(ptr >>> 0, 1)); +class TypstWorker2 { + constructor() { + throw new Error("cannot invoke `new` directly"); + } + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + TypstWorkerFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_typstworker_free(ptr, 0); + } + /** + * @param {string} _action + * @param {Uint8Array} _data + * @returns {Promise} + */ + manipulate_data(_action, _data) { + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + const ptr0 = passStringToWasm0(_action, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len0 = WASM_VECTOR_LEN; + wasm.typstworker_manipulate_data(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(_data)); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); + } + return takeObject(r0); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } + /** + * @returns {Promise} + */ + get_pages_info() { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + _assertNum(this.__wbg_ptr); + const ret = wasm.typstworker_get_pages_info(this.__wbg_ptr); + return takeObject(ret); + } + /** + * @param {Uint8Array} _actions + * @param {HTMLCanvasElement[]} _canvas_list + * @param {RenderPageImageOptions[]} _data + * @returns {Promise} + */ + render_canvas(_actions, _canvas_list, _data) { + try { + if (this.__wbg_ptr == 0) throw new Error("Attempt to use a moved value"); + const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); + _assertNum(this.__wbg_ptr); + const ptr0 = passArray8ToWasm0(_actions, wasm.__wbindgen_export_1); + const len0 = WASM_VECTOR_LEN; + const ptr1 = passArrayJsValueToWasm0(_canvas_list, wasm.__wbindgen_export_1); + const len1 = WASM_VECTOR_LEN; + const ptr2 = passArrayJsValueToWasm0(_data, wasm.__wbindgen_export_1); + const len2 = WASM_VECTOR_LEN; + wasm.typstworker_render_canvas(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2); + var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); + var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); + var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); + if (r2) { + throw takeObject(r1); + } + return takeObject(r0); + } finally { + wasm.__wbindgen_add_to_stack_pointer(16); + } + } +} +const WorkerBridgeFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => { +}, unregister: () => { +} } : new FinalizationRegistry((ptr) => wasm.__wbg_workerbridge_free(ptr >>> 0, 1)); +class WorkerBridge { + constructor() { + throw new Error("cannot invoke `new` directly"); + } + static __wrap(ptr) { + ptr = ptr >>> 0; + const obj = Object.create(WorkerBridge.prototype); + obj.__wbg_ptr = ptr; + WorkerBridgeFinalization.register(obj, obj.__wbg_ptr, obj); + return obj; + } + __destroy_into_raw() { + const ptr = this.__wbg_ptr; + this.__wbg_ptr = 0; + WorkerBridgeFinalization.unregister(this); + return ptr; + } + free() { + const ptr = this.__destroy_into_raw(); + wasm.__wbg_workerbridge_free(ptr, 0); + } +} +async function __wbg_load(module, imports) { + if (typeof Response === "function" && module instanceof Response) { + if (typeof WebAssembly.instantiateStreaming === "function") { + try { + return await WebAssembly.instantiateStreaming(module, imports); + } catch (e) { + if (module.headers.get("Content-Type") != "application/wasm") { + console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); + } else { + throw e; + } + } + } + const bytes = await module.arrayBuffer(); + return await WebAssembly.instantiate(bytes, imports); + } else { + const instance = await WebAssembly.instantiate(module, imports); + if (instance instanceof WebAssembly.Instance) { + return { instance, module }; + } else { + return instance; + } + } +} +function __wbg_get_imports() { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbg_appendChild_8204974b7328bf98 = function() { + return handleError(function(arg0, arg1) { + const ret = getObject(arg0).appendChild(getObject(arg1)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_buffer_609cc3eee51ed158 = function() { + return logError(function(arg0) { + const ret = getObject(arg0).buffer; + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_call_672a4d21634d4a24 = function() { + return handleError(function(arg0, arg1) { + const ret = getObject(arg0).call(getObject(arg1)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { + return handleError(function(arg0, arg1, arg2) { + const ret = getObject(arg0).call(getObject(arg1), getObject(arg2)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_call_833bed5770ea2041 = function() { + return handleError(function(arg0, arg1, arg2, arg3) { + const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_call_b8adc8b1d0a0d8eb = function() { + return handleError(function(arg0, arg1, arg2, arg3, arg4) { + const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3), getObject(arg4)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_clearRect_8e4ba7ea0e06711a = function() { + return logError(function(arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).clearRect(arg1, arg2, arg3, arg4); + }, arguments); + }; + imports.wbg.__wbg_clientWidth_ce67a04dc15fce39 = function() { + return logError(function(arg0) { + const ret = getObject(arg0).clientWidth; + _assertNum(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_clip_8e8cfb00a055cd03 = function() { + return logError(function(arg0, arg1) { + getObject(arg0).clip(getObject(arg1)); + }, arguments); + }; + imports.wbg.__wbg_clip_f584e320f8a2b022 = function() { + return logError(function(arg0, arg1) { + getObject(arg0).clip(getObject(arg1)); + }, arguments); + }; + imports.wbg.__wbg_cloneNode_e35b333b87d51340 = function() { + return handleError(function(arg0) { + const ret = getObject(arg0).cloneNode(); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_content_537e4105afcd9cee = function() { + return logError(function(arg0) { + const ret = getObject(arg0).content; + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_createElement_8c9931a732ee2fea = function() { + return handleError(function(arg0, arg1, arg2) { + const ret = getObject(arg0).createElement(getStringFromWasm0(arg1, arg2)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_createImageBitmap_705010fb21a22922 = function() { + return handleError(function(arg0, arg1) { + const ret = getObject(arg0).createImageBitmap(getObject(arg1)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_createImageBitmap_b814e27800576bdb = function() { + return handleError(function(arg0, arg1) { + const ret = getObject(arg0).createImageBitmap(getObject(arg1)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_createObjectURL_6e98d2f9c7bd9764 = function() { + return handleError(function(arg0, arg1) { + const ret = URL.createObjectURL(getObject(arg1)); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments); + }; + imports.wbg.__wbg_document_d249400bd7bd996d = function() { + return logError(function(arg0) { + const ret = getObject(arg0).document; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_drawImage_0915f348c5d54848 = function() { + return handleError(function(arg0, arg1, arg2, arg3) { + getObject(arg0).drawImage(getObject(arg1), arg2, arg3); + }, arguments); + }; + imports.wbg.__wbg_drawImage_16485aae76d89dbf = function() { + return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5) { + getObject(arg0).drawImage(getObject(arg1), arg2, arg3, arg4, arg5); + }, arguments); + }; + imports.wbg.__wbg_drawImage_468585e3ecfa189a = function() { + return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5) { + getObject(arg0).drawImage(getObject(arg1), arg2, arg3, arg4, arg5); + }, arguments); + }; + imports.wbg.__wbg_drawImage_472a4d5b6df3739a = function() { + return handleError(function(arg0, arg1, arg2, arg3) { + getObject(arg0).drawImage(getObject(arg1), arg2, arg3); + }, arguments); + }; + imports.wbg.__wbg_drawImage_473e6602e24e18aa = function() { + return handleError(function(arg0, arg1, arg2, arg3) { + getObject(arg0).drawImage(getObject(arg1), arg2, arg3); + }, arguments); + }; + imports.wbg.__wbg_drawImage_86fd8465c00c7bc6 = function() { + return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5) { + getObject(arg0).drawImage(getObject(arg1), arg2, arg3, arg4, arg5); + }, arguments); + }; + imports.wbg.__wbg_drawImage_ff273710b96c85cc = function() { + return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5) { + getObject(arg0).drawImage(getObject(arg1), arg2, arg3, arg4, arg5); + }, arguments); + }; + imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function() { + return logError(function(arg0, arg1) { + let deferred0_0; + let deferred0_1; + try { + deferred0_0 = arg0; + deferred0_1 = arg1; + console.error(getStringFromWasm0(arg0, arg1)); + } finally { + wasm.__wbindgen_export_3(deferred0_0, deferred0_1, 1); + } + }, arguments); + }; + imports.wbg.__wbg_fillRect_b1529535ac758d4c = function() { + return logError(function(arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).fillRect(arg1, arg2, arg3, arg4); + }, arguments); + }; + imports.wbg.__wbg_fillRect_c38d5d56492a2368 = function() { + return logError(function(arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).fillRect(arg1, arg2, arg3, arg4); + }, arguments); + }; + imports.wbg.__wbg_fill_51814702df845abd = function() { + return logError(function(arg0, arg1, arg2) { + getObject(arg0).fill(getObject(arg1), __wbindgen_enum_CanvasWindingRule[arg2]); + }, arguments); + }; + imports.wbg.__wbg_fill_5d26765e6d1d8f6b = function() { + return logError(function(arg0, arg1) { + getObject(arg0).fill(getObject(arg1)); + }, arguments); + }; + imports.wbg.__wbg_fill_64902335a40baa8d = function() { + return logError(function(arg0, arg1, arg2) { + getObject(arg0).fill(getObject(arg1), __wbindgen_enum_CanvasWindingRule[arg2]); + }, arguments); + }; + imports.wbg.__wbg_fill_cbb22e6ac4da5b1b = function() { + return logError(function(arg0, arg1) { + getObject(arg0).fill(getObject(arg1)); + }, arguments); + }; + imports.wbg.__wbg_firstElementChild_21331181ca115bcc = function() { + return logError(function(arg0) { + const ret = getObject(arg0).firstElementChild; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_firstElementChild_d75d385f5abd1414 = function() { + return logError(function(arg0) { + const ret = getObject(arg0).firstElementChild; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_getAttribute_ea5166be2deba45e = function() { + return logError(function(arg0, arg1, arg2, arg3) { + const ret = getObject(arg1).getAttribute(getStringFromWasm0(arg2, arg3)); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments); + }; + imports.wbg.__wbg_getContext_e9cf379449413580 = function() { + return handleError(function(arg0, arg1, arg2) { + const ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_getContext_f65a0debd1e8f8e8 = function() { + return handleError(function(arg0, arg1, arg2) { + const ret = getObject(arg0).getContext(getStringFromWasm0(arg1, arg2)); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { + return handleError(function(arg0, arg1) { + const ret = Reflect.get(getObject(arg0), getObject(arg1)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_globalCompositeOperation_154b0f30008caa5e = function() { + return handleError(function(arg0, arg1) { + const ret = getObject(arg1).globalCompositeOperation; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments); + }; + imports.wbg.__wbg_globalCompositeOperation_1f405e2ef7c5118b = function() { + return handleError(function(arg0, arg1) { + const ret = getObject(arg1).globalCompositeOperation; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments); + }; + imports.wbg.__wbg_height_d3f39e12f0f62121 = function() { + return logError(function(arg0) { + const ret = getObject(arg0).height; + _assertNum(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_incrdomdocclient_new = function() { + return logError(function(arg0) { + const ret = IncrDomDocClient.__wrap(arg0); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_instanceof_CanvasRenderingContext2d_df82a4d3437bf1cc = function() { + return logError(function(arg0) { + let result; + try { + result = getObject(arg0) instanceof CanvasRenderingContext2D; + } catch (_) { + result = false; + } + const ret = result; + _assertBoolean(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_instanceof_Element_0af65443936d5154 = function() { + return logError(function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Element; + } catch (_) { + result = false; + } + const ret = result; + _assertBoolean(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_instanceof_HtmlCanvasElement_2ea67072a7624ac5 = function() { + return logError(function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLCanvasElement; + } catch (_) { + result = false; + } + const ret = result; + _assertBoolean(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_instanceof_HtmlDivElement_dbc6eb62eb772174 = function() { + return logError(function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLDivElement; + } catch (_) { + result = false; + } + const ret = result; + _assertBoolean(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_instanceof_HtmlElement_51378c201250b16c = function() { + return logError(function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLElement; + } catch (_) { + result = false; + } + const ret = result; + _assertBoolean(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_instanceof_HtmlTemplateElement_7929a67c77198607 = function() { + return logError(function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLTemplateElement; + } catch (_) { + result = false; + } + const ret = result; + _assertBoolean(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_instanceof_ImageBitmap_d093d508663e313d = function() { + return logError(function(arg0) { + let result; + try { + result = getObject(arg0) instanceof ImageBitmap; + } catch (_) { + result = false; + } + const ret = result; + _assertBoolean(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_instanceof_OffscreenCanvasRenderingContext2d_a070fdde7ba760a3 = function() { + return logError(function(arg0) { + let result; + try { + result = getObject(arg0) instanceof OffscreenCanvasRenderingContext2D; + } catch (_) { + result = false; + } + const ret = result; + _assertBoolean(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_instanceof_OffscreenCanvas_d55760945f91bf51 = function() { + return logError(function(arg0) { + let result; + try { + result = getObject(arg0) instanceof OffscreenCanvas; + } catch (_) { + result = false; + } + const ret = result; + _assertBoolean(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_instanceof_Promise_935168b8f4b49db3 = function() { + return logError(function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Promise; + } catch (_) { + result = false; + } + const ret = result; + _assertBoolean(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_instanceof_SvgGraphicsElement_8b2cbd8116680c53 = function() { + return logError(function(arg0) { + let result; + try { + result = getObject(arg0) instanceof SVGGraphicsElement; + } catch (_) { + result = false; + } + const ret = result; + _assertBoolean(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_instanceof_SvgsvgElement_6a0d878e0d0f979c = function() { + return logError(function(arg0) { + let result; + try { + result = getObject(arg0) instanceof SVGSVGElement; + } catch (_) { + result = false; + } + const ret = result; + _assertBoolean(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_instanceof_Window_def73ea0955fc569 = function() { + return logError(function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Window; + } catch (_) { + result = false; + } + const ret = result; + _assertBoolean(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_instanceof_WorkerGlobalScope_dbdbdea7e3b56493 = function() { + return logError(function(arg0) { + let result; + try { + result = getObject(arg0) instanceof WorkerGlobalScope; + } catch (_) { + result = false; + } + const ret = result; + _assertBoolean(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_lastElementChild_1269b660ec3e6985 = function() { + return logError(function(arg0) { + const ret = getObject(arg0).lastElementChild; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_length_a446193dc22c12f8 = function() { + return logError(function(arg0) { + const ret = getObject(arg0).length; + _assertNum(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_log_1ae1e9f741096e91 = function() { + return logError(function(arg0, arg1) { + console.log(getObject(arg0), getObject(arg1)); + }, arguments); + }; + imports.wbg.__wbg_log_c222819a41e063d3 = function() { + return logError(function(arg0) { + console.log(getObject(arg0)); + }, arguments); + }; + imports.wbg.__wbg_measureText_f0f078704231c37f = function() { + return handleError(function(arg0, arg1, arg2) { + const ret = getObject(arg0).measureText(getStringFromWasm0(arg1, arg2)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_new_23a2665fac83c611 = function() { + return logError(function(arg0, arg1) { + try { + var state0 = { a: arg0, b: arg1 }; + var cb0 = (arg02, arg12) => { + const a = state0.a; + state0.a = 0; + try { + return __wbg_adapter_66(a, state0.b, arg02, arg12); + } finally { + state0.a = a; + } + }; + const ret = new Promise(cb0); + return addHeapObject(ret); + } finally { + state0.a = state0.b = 0; + } + }, arguments); + }; + imports.wbg.__wbg_new_2ef971087cb43792 = function() { + return handleError(function(arg0, arg1) { + const ret = new OffscreenCanvas(arg0 >>> 0, arg1 >>> 0); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_new_405e22f390576ce2 = function() { + return logError(function() { + const ret = new Object(); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_new_6377da097a44ce6e = function() { + return handleError(function() { + const ret = new Image(); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_new_78feb108b6472713 = function() { + return logError(function() { + const ret = new Array(); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_new_8a6f238a6ece86ea = function() { + return logError(function() { + const ret = new Error(); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_new_a12002a7f91c75be = function() { + return logError(function(arg0) { + const ret = new Uint8Array(getObject(arg0)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_new_c68d7209be747379 = function() { + return logError(function(arg0, arg1) { + const ret = new Error(getStringFromWasm0(arg0, arg1)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function() { + return logError(function(arg0, arg1) { + const ret = new Function(getStringFromWasm0(arg0, arg1)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function() { + return logError(function(arg0, arg1, arg2) { + const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function() { + return logError(function(arg0) { + const ret = new Uint8Array(arg0 >>> 0); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_newwithpathstring_e9586ab3affcd4fd = function() { + return handleError(function(arg0, arg1) { + const ret = new Path2D(getStringFromWasm0(arg0, arg1)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_newwithu8arraysequenceandoptions_068570c487f69127 = function() { + return handleError(function(arg0, arg1) { + const ret = new Blob(getObject(arg0), getObject(arg1)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_nextElementSibling_8472709bec4de113 = function() { + return logError(function(arg0) { + const ret = getObject(arg0).nextElementSibling; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_push_737cfc8c1432c2c6 = function() { + return logError(function(arg0, arg1) { + const ret = getObject(arg0).push(getObject(arg1)); + _assertNum(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_putImageData_4c5aa10f3b3e4924 = function() { + return handleError(function(arg0, arg1, arg2, arg3) { + getObject(arg0).putImageData(getObject(arg1), arg2, arg3); + }, arguments); + }; + imports.wbg.__wbg_putImageData_6d5d5ef6ee83898b = function() { + return handleError(function(arg0, arg1, arg2, arg3) { + getObject(arg0).putImageData(getObject(arg1), arg2, arg3); + }, arguments); + }; + imports.wbg.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function() { + return logError(function(arg0) { + queueMicrotask(getObject(arg0)); + }, arguments); + }; + imports.wbg.__wbg_queueMicrotask_d3219def82552485 = function() { + return logError(function(arg0) { + const ret = getObject(arg0).queueMicrotask; + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_removeProperty_0e85471f4dfc00ae = function() { + return handleError(function(arg0, arg1, arg2, arg3) { + const ret = getObject(arg1).removeProperty(getStringFromWasm0(arg2, arg3)); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments); + }; + imports.wbg.__wbg_remove_e2d2659f3128c045 = function() { + return logError(function(arg0) { + getObject(arg0).remove(); + }, arguments); + }; + imports.wbg.__wbg_renderpageimageoptions_unwrap = function() { + return logError(function(arg0) { + const ret = RenderPageImageOptions.__unwrap(takeObject(arg0)); + _assertNum(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_replaceWith_9ce9927e3141d0f6 = function() { + return handleError(function(arg0, arg1) { + getObject(arg0).replaceWith(getObject(arg1)); + }, arguments); + }; + imports.wbg.__wbg_resolve_4851785c9c5f573d = function() { + return logError(function(arg0) { + const ret = Promise.resolve(getObject(arg0)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_restore_1ef50af0835a4649 = function() { + return logError(function(arg0) { + getObject(arg0).restore(); + }, arguments); + }; + imports.wbg.__wbg_restore_cc5ae2746f7b5043 = function() { + return logError(function(arg0) { + getObject(arg0).restore(); + }, arguments); + }; + imports.wbg.__wbg_revokeObjectURL_27267efebeb457c7 = function() { + return handleError(function(arg0, arg1) { + URL.revokeObjectURL(getStringFromWasm0(arg0, arg1)); + }, arguments); + }; + imports.wbg.__wbg_save_5f563096e64939da = function() { + return logError(function(arg0) { + getObject(arg0).save(); + }, arguments); + }; + imports.wbg.__wbg_save_c675a7a4bbd44e4a = function() { + return logError(function(arg0) { + getObject(arg0).save(); + }, arguments); + }; + imports.wbg.__wbg_setAttribute_2704501201f15687 = function() { + return handleError(function(arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).setAttribute(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments); + }; + imports.wbg.__wbg_setLineDash_0e3f3e194352a774 = function() { + return handleError(function(arg0, arg1) { + getObject(arg0).setLineDash(getObject(arg1)); + }, arguments); + }; + imports.wbg.__wbg_setLineDash_325e094206df53e9 = function() { + return handleError(function(arg0, arg1) { + getObject(arg0).setLineDash(getObject(arg1)); + }, arguments); + }; + imports.wbg.__wbg_setProperty_f2cf326652b9a713 = function() { + return handleError(function(arg0, arg1, arg2, arg3, arg4) { + getObject(arg0).setProperty(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); + }, arguments); + }; + imports.wbg.__wbg_setTransform_8c4d954cafb34b75 = function() { + return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { + getObject(arg0).setTransform(arg1, arg2, arg3, arg4, arg5, arg6); + }, arguments); + }; + imports.wbg.__wbg_setTransform_da2f0baec3f09522 = function() { + return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { + getObject(arg0).setTransform(arg1, arg2, arg3, arg4, arg5, arg6); + }, arguments); + }; + imports.wbg.__wbg_set_37837023f3d740e8 = function() { + return logError(function(arg0, arg1, arg2) { + getObject(arg0)[arg1 >>> 0] = takeObject(arg2); + }, arguments); + }; + imports.wbg.__wbg_set_65595bdd868b3009 = function() { + return logError(function(arg0, arg1, arg2) { + getObject(arg0).set(getObject(arg1), arg2 >>> 0); + }, arguments); + }; + imports.wbg.__wbg_set_bb8cecf6a62b9f46 = function() { + return handleError(function(arg0, arg1, arg2) { + const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2)); + _assertBoolean(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbg_setfillStyle_2205fca942c641ba = function() { + return logError(function(arg0, arg1, arg2) { + getObject(arg0).fillStyle = getStringFromWasm0(arg1, arg2); + }, arguments); + }; + imports.wbg.__wbg_setfillStyle_cb059a69ce15cc28 = function() { + return logError(function(arg0, arg1, arg2) { + getObject(arg0).fillStyle = getStringFromWasm0(arg1, arg2); + }, arguments); + }; + imports.wbg.__wbg_setfont_4c3584ef2f5c9f7e = function() { + return logError(function(arg0, arg1, arg2) { + getObject(arg0).font = getStringFromWasm0(arg1, arg2); + }, arguments); + }; + imports.wbg.__wbg_setglobalCompositeOperation_9a7a92bac2fb7ffd = function() { + return handleError(function(arg0, arg1, arg2) { + getObject(arg0).globalCompositeOperation = getStringFromWasm0(arg1, arg2); + }, arguments); + }; + imports.wbg.__wbg_setglobalCompositeOperation_b000e874f8f4a9d3 = function() { + return handleError(function(arg0, arg1, arg2) { + getObject(arg0).globalCompositeOperation = getStringFromWasm0(arg1, arg2); + }, arguments); + }; + imports.wbg.__wbg_setheight_da683a33fa99843c = function() { + return logError(function(arg0, arg1) { + getObject(arg0).height = arg1 >>> 0; + }, arguments); + }; + imports.wbg.__wbg_setinnerHTML_31bde41f835786f7 = function() { + return logError(function(arg0, arg1, arg2) { + getObject(arg0).innerHTML = getStringFromWasm0(arg1, arg2); + }, arguments); + }; + imports.wbg.__wbg_setlineCap_3a3987ad3f03b31d = function() { + return logError(function(arg0, arg1, arg2) { + getObject(arg0).lineCap = getStringFromWasm0(arg1, arg2); + }, arguments); + }; + imports.wbg.__wbg_setlineCap_52b6d742c95a5630 = function() { + return logError(function(arg0, arg1, arg2) { + getObject(arg0).lineCap = getStringFromWasm0(arg1, arg2); + }, arguments); + }; + imports.wbg.__wbg_setlineDashOffset_030d80d07cd52ee4 = function() { + return logError(function(arg0, arg1) { + getObject(arg0).lineDashOffset = arg1; + }, arguments); + }; + imports.wbg.__wbg_setlineDashOffset_59f274962f6a0553 = function() { + return logError(function(arg0, arg1) { + getObject(arg0).lineDashOffset = arg1; + }, arguments); + }; + imports.wbg.__wbg_setlineJoin_79ca64e7e9efaff7 = function() { + return logError(function(arg0, arg1, arg2) { + getObject(arg0).lineJoin = getStringFromWasm0(arg1, arg2); + }, arguments); + }; + imports.wbg.__wbg_setlineJoin_7e005d90ef83d627 = function() { + return logError(function(arg0, arg1, arg2) { + getObject(arg0).lineJoin = getStringFromWasm0(arg1, arg2); + }, arguments); + }; + imports.wbg.__wbg_setlineWidth_3c8b7156949a9f4b = function() { + return logError(function(arg0, arg1) { + getObject(arg0).lineWidth = arg1; + }, arguments); + }; + imports.wbg.__wbg_setlineWidth_ec730c524f09baa9 = function() { + return logError(function(arg0, arg1) { + getObject(arg0).lineWidth = arg1; + }, arguments); + }; + imports.wbg.__wbg_setmiterLimit_26162c359bb28eb2 = function() { + return logError(function(arg0, arg1) { + getObject(arg0).miterLimit = arg1; + }, arguments); + }; + imports.wbg.__wbg_setmiterLimit_9ffca64ec692501d = function() { + return logError(function(arg0, arg1) { + getObject(arg0).miterLimit = arg1; + }, arguments); + }; + imports.wbg.__wbg_setonerror_e94ca1221abc457f = function() { + return logError(function(arg0, arg1) { + getObject(arg0).onerror = getObject(arg1); + }, arguments); + }; + imports.wbg.__wbg_setonload_264a0d330b7166fb = function() { + return logError(function(arg0, arg1) { + getObject(arg0).onload = getObject(arg1); + }, arguments); + }; + imports.wbg.__wbg_setsrc_c239193cc7ab0470 = function() { + return logError(function(arg0, arg1, arg2) { + getObject(arg0).src = getStringFromWasm0(arg1, arg2); + }, arguments); + }; + imports.wbg.__wbg_setstrokeStyle_070920f27992b9a6 = function() { + return logError(function(arg0, arg1, arg2) { + getObject(arg0).strokeStyle = getStringFromWasm0(arg1, arg2); + }, arguments); + }; + imports.wbg.__wbg_setstrokeStyle_415833f3f0eb5076 = function() { + return logError(function(arg0, arg1, arg2) { + getObject(arg0).strokeStyle = getStringFromWasm0(arg1, arg2); + }, arguments); + }; + imports.wbg.__wbg_settype_39ed370d3edd403c = function() { + return logError(function(arg0, arg1, arg2) { + getObject(arg0).type = getStringFromWasm0(arg1, arg2); + }, arguments); + }; + imports.wbg.__wbg_setwidth_c5fed9f5e7f0b406 = function() { + return logError(function(arg0, arg1) { + getObject(arg0).width = arg1 >>> 0; + }, arguments); + }; + imports.wbg.__wbg_stack_0ed75d68575b0f3c = function() { + return logError(function(arg0, arg1) { + const ret = getObject(arg1).stack; + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }, arguments); + }; + imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() { + return logError(function() { + const ret = typeof global === "undefined" ? null : global; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() { + return logError(function() { + const ret = typeof globalThis === "undefined" ? null : globalThis; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() { + return logError(function() { + const ret = typeof self === "undefined" ? null : self; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() { + return logError(function() { + const ret = typeof window === "undefined" ? null : window; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_stringify_f7ed6987935b4a24 = function() { + return handleError(function(arg0) { + const ret = JSON.stringify(getObject(arg0)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_stroke_1b0348380fb5a54b = function() { + return logError(function(arg0, arg1) { + getObject(arg0).stroke(getObject(arg1)); + }, arguments); + }; + imports.wbg.__wbg_stroke_e9b15e77122a9be9 = function() { + return logError(function(arg0, arg1) { + getObject(arg0).stroke(getObject(arg1)); + }, arguments); + }; + imports.wbg.__wbg_style_fb30c14e5815805c = function() { + return logError(function(arg0) { + const ret = getObject(arg0).style; + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_then_44b73946d2fb3e7d = function() { + return logError(function(arg0, arg1) { + const ret = getObject(arg0).then(getObject(arg1)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_then_48b406749878a531 = function() { + return logError(function(arg0, arg1, arg2) { + const ret = getObject(arg0).then(getObject(arg1), getObject(arg2)); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_transferToImageBitmap_4b1cc41c0f7e5de5 = function() { + return handleError(function(arg0) { + const ret = getObject(arg0).transferToImageBitmap(); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_typstrenderer_new = function() { + return logError(function(arg0) { + const ret = TypstRenderer.__wrap(arg0); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbg_warn_4ca3906c248c47c4 = function() { + return logError(function(arg0) { + console.warn(getObject(arg0)); + }, arguments); + }; + imports.wbg.__wbg_width_2fafd30484634e26 = function() { + return logError(function(arg0) { + const ret = getObject(arg0).width; + return ret; + }, arguments); + }; + imports.wbg.__wbg_width_4f334fc47ef03de1 = function() { + return logError(function(arg0) { + const ret = getObject(arg0).width; + _assertNum(ret); + return ret; + }, arguments); + }; + imports.wbg.__wbindgen_cb_drop = function(arg0) { + const obj = takeObject(arg0).original; + if (obj.cnt-- == 1) { + obj.a = 0; + return true; + } + const ret = false; + _assertBoolean(ret); + return ret; + }; + imports.wbg.__wbindgen_closure_wrapper1642 = function() { + return logError(function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 144, __wbg_adapter_26); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbindgen_closure_wrapper1643 = function() { + return logError(function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 144, __wbg_adapter_29); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbindgen_closure_wrapper2286 = function() { + return logError(function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 144, __wbg_adapter_32); + return addHeapObject(ret); + }, arguments); + }; + imports.wbg.__wbindgen_debug_string = function(arg0, arg1) { + const ret = debugString(getObject(arg1)); + const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + const len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbindgen_is_function = function(arg0) { + const ret = typeof getObject(arg0) === "function"; + _assertBoolean(ret); + return ret; + }; + imports.wbg.__wbindgen_is_undefined = function(arg0) { + const ret = getObject(arg0) === void 0; + _assertBoolean(ret); + return ret; + }; + imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) { + const ret = getObject(arg0) === getObject(arg1); + _assertBoolean(ret); + return ret; + }; + imports.wbg.__wbindgen_memory = function() { + const ret = wasm.memory; + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_number_new = function(arg0) { + const ret = arg0; + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_object_clone_ref = function(arg0) { + const ret = getObject(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_object_drop_ref = function(arg0) { + takeObject(arg0); + }; + imports.wbg.__wbindgen_string_get = function(arg0, arg1) { + const obj = getObject(arg1); + const ret = typeof obj === "string" ? obj : void 0; + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2); + var len1 = WASM_VECTOR_LEN; + getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); + getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); + }; + imports.wbg.__wbindgen_string_new = function(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_throw = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); + }; + return imports; +} +function __wbg_finalize_init(instance, module) { + wasm = instance.exports; + __wbg_init.__wbindgen_wasm_module = module; + cachedDataViewMemory0 = null; + cachedUint32ArrayMemory0 = null; + cachedUint8ArrayMemory0 = null; + return wasm; +} +function initSync(module) { + if (wasm !== void 0) return wasm; + if (typeof module !== "undefined") { + if (Object.getPrototypeOf(module) === Object.prototype) { + ({ module } = module); + } else { + console.warn("using deprecated parameters for `initSync()`; pass a single object instead"); + } + } + const imports = __wbg_get_imports(); + if (!(module instanceof WebAssembly.Module)) { + module = new WebAssembly.Module(module); + } + const instance = new WebAssembly.Instance(module, imports); + return __wbg_finalize_init(instance, module); +} +async function __wbg_init(module_or_path) { + if (wasm !== void 0) return wasm; + if (typeof module_or_path !== "undefined") { + if (Object.getPrototypeOf(module_or_path) === Object.prototype) { + ({ module_or_path } = module_or_path); + } else { + console.warn("using deprecated parameters for the initialization function; pass a single object instead"); + } + } + if (typeof module_or_path === "undefined") { + module_or_path = importWasmModule("typst_ts_renderer_bg.wasm", import.meta.url); + } + const imports = __wbg_get_imports(); + if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) { + module_or_path = fetch(module_or_path); + } + const { instance, module } = await __wbg_load(await module_or_path, imports); + return __wbg_finalize_init(instance, module); +} +let importWasmModule = async function(wasm_name, url) { + throw new Error("Cannot import wasm module without importer: " + wasm_name + " " + url); +}; +function setImportWasmModule(importer) { + importWasmModule = importer; +} +let nodeJsImportWasmModule = async function(wasm_name, url) { + const escapeImport = new Function("m", "return import(m)"); + const path = await escapeImport("path"); + const { readFileSync } = await escapeImport("fs"); + const wasmPath = new URL(path.join(path.dirname(url), wasm_name)); + return await readFileSync(wasmPath).buffer; +}; +const isNode = typeof process !== "undefined" && process.versions != null && process.versions.node != null; +if (isNode) { + setImportWasmModule(nodeJsImportWasmModule); +} +const wasmPackShim = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ + __proto__: null, + CreateSessionOptions, + IncrDomDocClient, + PageInfo, + PagesInfo, + RenderPageImageOptions, + RenderSession: RenderSession2, + RenderSessionOptions, + TypstRenderer, + TypstRendererBuilder, + TypstWorker: TypstWorker2, + WorkerBridge, + default: __wbg_init, + initSync, + renderer_build_info, + setImportWasmModule +}, Symbol.toStringTag, { value: "Module" })); diff --git a/public/internal/svg_utils.js b/public/internal/svg_utils.js new file mode 100644 index 0000000..3ec84e7 --- /dev/null +++ b/public/internal/svg_utils.js @@ -0,0 +1,3 @@ +"use strict";const O=function(){const t={};let e,s;return function(o,l,r){s=new Date().getTime(),r=r||"ignored event",e=t[r]?s-t[r]:s,e>l&&(t[r]=s,o())}}(),G=(t,e)=>{const s=[];for(let o=0;o!(t.righte.right||t.bottome.bottom),V=(t,e)=>{const s=t.getBoundingClientRect(),o=e.getBoundingClientRect();return X(s,o)&&Math.abs(s.left-o.left)+Math.abs(s.right-o.right)<.5*Math.max(s.width,o.width)&&Math.abs(s.bottom-o.bottom)+Math.abs(s.top-o.top)<.5*Math.max(s.height,o.height)},Y=window.typstGetRelatedElements=t=>{let e=t.relatedElements;return e==null&&(e=t.relatedElements=K(t)),e},k=(t,e)=>{for(;t&&!t.classList.contains(e);)t=t.parentElement;return t};function J(t){const e=k(t,"typst-text");return e&&G(e.children,s=>s.tagName==="use")}const K=function(t){const e=k(t,"typst-group");return e&&G(e.children,s=>V(s,t))};function Q(t){return t.map(e=>{const s=e.getAttribute("href"),o=document.getElementById(s.slice(1));return 1+Number.parseInt((o==null?void 0:o.getAttribute("data-liga-len"))||"0")})}function U(t){return t.map(e=>Number.parseInt(e.getAttribute("x")||"0"))}const I=t=>O(()=>{var e;return(e=Y(t))==null?void 0:e.forEach(s=>s.classList.add("hover"))},200,"mouse-move"),H=t=>{var e;return(e=Y(t))==null?void 0:e.forEach(s=>s.classList.remove("hover"))},Z=(t,e)=>()=>{var o,l;const s=((o=e.parentElement)==null?void 0:o.getAttribute("href"))||((l=e.parentElement)==null?void 0:l.getAttribute("xlink:href"));t.getAttribute("href")!==s&&t.setAttribute("href",s||"")};window.typstProcessSvg=function(t,e){for(var s=t.getElementsByClassName("pseudo-link"),o=0;oI(h.target)),l.addEventListener("mouseleave",h=>H(h.target))}if(((e==null?void 0:e.layoutText)??!0)&&setTimeout(()=>{const h=document.createElement("style");h.innerHTML=`.tsel { font-family: monospace; text-align-last: left !important; -moz-text-size-adjust: none; -webkit-text-size-adjust: none; text-size-adjust: none; overflow: hidden; } +.tsel span { position: relative !important; width: fit-content !important; }`,document.getElementsByTagName("head")[0].appendChild(h),window.layoutText(t)},0),t.addEventListener("click",h=>{let p=h.target;for(;p;){const y=p.getAttribute("data-span");if(y){console.log("source-span of this svg element",y);const a=document.body||document.firstElementChild,B=a.getBoundingClientRect(),c=window.innerWidth||0,L=h.clientX-B.left+.015*c,C=h.clientY-B.top+.015*c;D(a,L,C,"typst-debug-react-ripple","typst-debug-react-ripple-effect .4s linear");return}p=p.parentElement}}),window.location.hash){const p=window.location.hash.split("-");if(p.length===2&&p[0]==="#loc"){const y=p[1].split("x");if(y.length===3){const a=Number.parseInt(y[0]),B=Number.parseFloat(y[1]),c=Number.parseFloat(y[2]);window.handleTypstLocation(t,a,B,c)}}}};const W=` +`.codePointAt(0);window.layoutText=async function(t){var M;const e=Array.from(t.querySelectorAll(".tsel, .typst-content-hint, .pseudo-link")),s=performance.now(),o=document.createElementNS("http://www.w3.org/1999/xhtml","canvas").getContext("2d");o.font="128px monospace";const l=o.measureText("A").width,r=t.getBoundingClientRect(),h=r.left+window.scrollX,p=r.top+window.scrollY,y=(d,m,u)=>{var n=d.getScreenCTM();return n?{x:n.a*m+n.c*u+n.e-h,y:n.b*m+n.d*u+n.f-p}:{x:0,y:0}};let a;const B=t.parentElement;if(!B)a=void 0;else if((M=t.nextElementSibling)!=null&&M.classList.contains("typst-semantic-layer"))a=t.nextElementSibling;else{a=document.createElement("div");const d=document.createElement("div");d.style.position="relative",B.replaceChild(d,t),d.appendChild(t),d.appendChild(a),a.classList.add("typst-semantic-layer"),a.style.position="absolute",a.style.left="0",a.style.top="0",a.style.zIndex="1",a.style.float="left";const m=t.getAttribute("width");a.style.width=`${m}px`;const u=t.getAttribute("height");a.style.height=`${u}px`}let c={left:0,right:0,bottom:0,top:0},L=[];const C=(d,m="span")=>{const u=document.createElement(m),n=d.getBBox(),f=y(d,n.x,n.y),i=y(d,n.x+n.width,n.y+n.height),b=Math.min(f.x,i.x)+window.scrollX,v=Math.min(f.y,i.y)+window.scrollY,E=Math.abs(f.x-i.x),S=Math.abs(f.y-i.y),g=S/2,A={left:b-g,top:v-g,right:b+E+g,bottom:v+S+g};return X(c,A)?(c.left=Math.min(c.left,A.left),c.top=Math.min(c.top,A.top),c.right=Math.max(c.right,A.right),c.bottom=Math.max(c.bottom,A.bottom)):(L.push([u,c]),c=A),u.classList.add("tsel"),u.style.position="absolute",u.style.left=`${b}px`,u.style.top=`${v}px`,u.style.width=`${E}px`,u.style.height=`${S}px`,u},$=(d,m)=>{const u=e.slice(d,m);for(let n of u){const f=n.parentElement;if(a){if(n.classList.contains("typst-content-hint")){const i=C(n);i.style.fontSize="0.1px",i.style.width="0.1px",i.style.height="0.1px";const x=Number.parseInt(n.getAttribute("data-hint")||"0",16)||W;i.innerHTML=x===W?"
":`&#x${x.toString(16)};`,a.append(i);continue}else if(n.classList.contains("pseudo-link")){const i=C(n,"a");i.style.cursor="pointer",i.addEventListener("mousemove",()=>I(n)),i.addEventListener("mouseleave",()=>H(n)),i.onclick=()=>{n.dispatchEvent(new MouseEvent("click",{bubbles:!0}))},i.addEventListener("mouseenter",()=>{var b,w;const x=((b=n.parentElement)==null?void 0:b.getAttribute("href"))||((w=n.parentElement)==null?void 0:w.getAttribute("xlink:href"));i.getAttribute("href")!==x&&i.setAttribute("href",x||"")}),a.append(i);continue}}if(n.style.fontSize){const i=[],x=n.innerText,b=l*Number.parseFloat(n.style.fontSize)/128;{const w=J(n);if(!w)continue;const v=Q(w),E=U(w).map(R=>R/16);let S=!1,g=0,A=0,z,P=0;for(let R of x){if(g>=E.length){S=!0;break}let F=E[g];v[g]>1&&(F+=A*b),A++,A>=v[g]&&(g++,A=0);const N=document.createElement("span");N.textContent=R,N.classList.add("tsel-tok"),z&&(z.style.letterSpacing=`${F-P-b}px`),z=N,P=F,i.push(N)}if(S)continue}if(n.innerHTML="",a){const w=Number.parseFloat(n.style.fontSize||"0"),v=Math.abs(y(f,0,w).y-y(f,0,0).y);{const S=v/w;for(let g of i)g.style.letterSpacing=`${Number.parseFloat(g.style.letterSpacing||"0")*S}px`}const E=C(f);E.style.fontSize=`${v}px`,E.append(...i),a.append(E)}else n.append(...i)}}console.log(`layoutText ${e.length} elements used since ${performance.now()-s} ms`)},T=100;for(let d=0;d{setTimeout(()=>{$(m,m+T),u(void 0)})})}if(a&&c.right!=0&&L.push([null,c]),a){const d=performance.now();let m=0;for(let[u,n]of L){if(m{location.hash=`loc-${c}x${L.toFixed(2)}x${C.toFixed(2)}`});let p=t;const y=c=>{var E,S,g;const L=window.innerWidth*.01,C=window.innerHeight*.01,$=Number.parseFloat(p.getAttribute("data-width")||p.getAttribute("width")||"0")||0,T=Number.parseFloat(p.getAttribute("data-height")||p.getAttribute("height")||"0")||0,M=p.getBoundingClientRect(),d={left:M.left,top:M.top,width:M.width,height:M.height},m=7*L,u=38.2*C,n=(g=(S=(E=c.transform)==null?void 0:E.baseVal)==null?void 0:S.consolidate())==null?void 0:g.matrix;n&&(d.left+=n.e/$*d.width,d.top+=n.f/T*d.height);const f=document.body||document.firstElementChild,i=f.getBoundingClientRect(),x=d.left-i.left+s/$*d.width-m,b=d.top-i.top+o/T*d.height-u,w=x+m,v=b+u;window.scrollTo({behavior:r,left:x,top:b}),r!=="instant"&&D(f,w,v,"typst-jump-ripple","typst-jump-ripple-effect .4s linear"),h(e,s,o)};if(l!=null&&l.isDom){y(p);return}if(p=k(t,"typst-doc"),!p){console.warn("no typst-doc or typst-svg-page found",t);return}const a=p.children;let B=0;for(let c=0;c{t.removeChild(r)}}var j=document.currentScript;if(j){console.log("new svg util updated 37 ",performance.now());const t=k(j,"typst-doc");t&&window.typstProcessSvg(t)}function q(t,e,s){const o=t.getBoundingClientRect();if(!(e[0]o.right+1||e[1]o.bottom+1)){if(t.classList.contains("pseudo-link"))return t;for(let l=0;l{O(()=>{var l;if(((l=o.target)==null?void 0:l.tagName)==="A"){const r=o.target;if(r.cachedTarget)return;const h=q(e,[o.clientX,o.clientY],o.target);if(h){h.dispatchEvent(new MouseEvent("mousemove",{bubbles:!0}));const p=Z(h,r);r.addEventListener("mouseenter",()=>{h.dispatchEvent(new MouseEvent("mouseenter",{bubbles:!0})),p()}),r.addEventListener("mousemove",()=>{h.dispatchEvent(new MouseEvent("mousemove",{bubbles:!0})),I(h)}),r.addEventListener("mouseleave",()=>{h.dispatchEvent(new MouseEvent("mouseleave",{bubbles:!0})),H(h)})}}},100,"mouseenter")})}; diff --git a/public/internal/typst_ts_renderer_bg.wasm b/public/internal/typst_ts_renderer_bg.wasm new file mode 100644 index 0000000..e6fccb7 Binary files /dev/null and b/public/internal/typst_ts_renderer_bg.wasm differ diff --git a/public/searchindex.js b/public/searchindex.js new file mode 100644 index 0000000..2582a30 --- /dev/null +++ b/public/searchindex.js @@ -0,0 +1 @@ +Object.assign(window.search, {"doc_urls":["S2/ExPhyII/VL/ExIIVL1.html"],"index":{"documentStore":{"docInfo":{"0":{"body":15,"breadcrumbs":1,"title":1}},"docs":{"0":{"body":"ExPhy II\nVorlesung 1\n16.04.2025\nJonas Hahn\nInhaltsverzeichnisOrganisatorisches ......................................................................................... ⁠1Behandelte Themen ................................................................................... ⁠1Literatur ................................................................................................ ⁠10. Einleitung ............................................................................................... ⁠10.1 Vektrora","breadcrumbs":"Installation","id":"0","title":"Installation"}},"length":1,"save":true},"fields":["title","body","breadcrumbs"],"index":{"body":{"root":{"1":{"0":{".":{"1":{"df":1,"docs":{"0":{"tf":1.0}}},"df":0,"docs":{}},"df":1,"docs":{"0":{"tf":1.0}}},"6":{".":{"0":{"4":{".":{"2":{"0":{"2":{"5":{"df":1,"docs":{"0":{"tf":1.0}}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"b":{"df":0,"docs":{},"e":{"df":0,"docs":{},"h":{"a":{"df":0,"docs":{},"n":{"d":{"df":0,"docs":{},"e":{"df":0,"docs":{},"l":{"df":0,"docs":{},"t":{"df":1,"docs":{"0":{"tf":1.0}}}}}},"df":0,"docs":{}}},"df":0,"docs":{}}}},"df":1,"docs":{"0":{"tf":1.0}},"l":{"df":0,"docs":{},"i":{"df":0,"docs":{},"t":{"df":0,"docs":{},"e":{"df":0,"docs":{},"r":{"a":{"df":0,"docs":{},"t":{"df":0,"docs":{},"u":{"df":0,"docs":{},"r":{"df":1,"docs":{"0":{"tf":1.0}}}}}},"df":0,"docs":{}}}}}}},"df":0,"docs":{},"e":{"df":0,"docs":{},"i":{"df":0,"docs":{},"n":{"df":0,"docs":{},"l":{"df":0,"docs":{},"e":{"df":0,"docs":{},"i":{"df":0,"docs":{},"t":{"df":0,"docs":{},"u":{"df":0,"docs":{},"n":{"df":0,"docs":{},"g":{"df":1,"docs":{"0":{"tf":1.0}}}}}}}}}}},"x":{"df":0,"docs":{},"p":{"df":0,"docs":{},"h":{"df":0,"docs":{},"i":{"df":1,"docs":{"0":{"tf":1.0}}}}}}},"h":{"a":{"df":0,"docs":{},"h":{"df":0,"docs":{},"n":{"df":1,"docs":{"0":{"tf":1.0}}}}},"df":0,"docs":{}},"i":{"df":0,"docs":{},"i":{"df":1,"docs":{"0":{"tf":1.0}}},"n":{"df":0,"docs":{},"h":{"a":{"df":0,"docs":{},"l":{"df":0,"docs":{},"t":{"df":0,"docs":{},"s":{"df":0,"docs":{},"v":{"df":0,"docs":{},"e":{"df":0,"docs":{},"r":{"df":0,"docs":{},"z":{"df":0,"docs":{},"e":{"df":0,"docs":{},"i":{"c":{"df":0,"docs":{},"h":{"df":0,"docs":{},"n":{"df":0,"docs":{},"i":{"df":0,"docs":{},"s":{"df":0,"docs":{},"o":{"df":0,"docs":{},"r":{"df":0,"docs":{},"g":{"a":{"df":0,"docs":{},"n":{"df":0,"docs":{},"i":{"df":0,"docs":{},"s":{"a":{"df":0,"docs":{},"t":{"df":0,"docs":{},"o":{"df":0,"docs":{},"r":{"df":0,"docs":{},"i":{"df":0,"docs":{},"s":{"c":{"df":0,"docs":{},"h":{"df":1,"docs":{"0":{"tf":1.0}}}},"df":0,"docs":{}}}}}}},"df":0,"docs":{}}}}},"df":0,"docs":{}}}}}}}}},"df":0,"docs":{}}}}}}}}}}},"df":0,"docs":{}},"s":{"df":0,"docs":{},"t":{"a":{"df":0,"docs":{},"l":{"df":1,"docs":{"0":{"tf":1.0}}}},"df":0,"docs":{}}}}},"j":{"df":0,"docs":{},"o":{"df":0,"docs":{},"n":{"a":{"df":1,"docs":{"0":{"tf":1.0}}},"df":0,"docs":{}}}},"t":{"df":0,"docs":{},"h":{"df":0,"docs":{},"e":{"df":0,"docs":{},"m":{"df":0,"docs":{},"e":{"df":0,"docs":{},"n":{"df":1,"docs":{"0":{"tf":1.0}}}}}}}},"v":{"df":0,"docs":{},"e":{"df":0,"docs":{},"k":{"df":0,"docs":{},"t":{"df":0,"docs":{},"r":{"df":0,"docs":{},"o":{"df":0,"docs":{},"r":{"a":{"df":1,"docs":{"0":{"tf":1.0}}},"df":0,"docs":{}}}}}}},"o":{"df":0,"docs":{},"r":{"df":0,"docs":{},"l":{"df":0,"docs":{},"e":{"df":0,"docs":{},"s":{"df":0,"docs":{},"u":{"df":0,"docs":{},"n":{"df":0,"docs":{},"g":{"df":1,"docs":{"0":{"tf":1.0}}}}}}}}}}}}},"breadcrumbs":{"root":{"1":{"0":{".":{"1":{"df":1,"docs":{"0":{"tf":1.0}}},"df":0,"docs":{}},"df":1,"docs":{"0":{"tf":1.0}}},"6":{".":{"0":{"4":{".":{"2":{"0":{"2":{"5":{"df":1,"docs":{"0":{"tf":1.0}}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"b":{"df":0,"docs":{},"e":{"df":0,"docs":{},"h":{"a":{"df":0,"docs":{},"n":{"d":{"df":0,"docs":{},"e":{"df":0,"docs":{},"l":{"df":0,"docs":{},"t":{"df":1,"docs":{"0":{"tf":1.0}}}}}},"df":0,"docs":{}}},"df":0,"docs":{}}}},"df":1,"docs":{"0":{"tf":1.0}},"l":{"df":0,"docs":{},"i":{"df":0,"docs":{},"t":{"df":0,"docs":{},"e":{"df":0,"docs":{},"r":{"a":{"df":0,"docs":{},"t":{"df":0,"docs":{},"u":{"df":0,"docs":{},"r":{"df":1,"docs":{"0":{"tf":1.0}}}}}},"df":0,"docs":{}}}}}}},"df":0,"docs":{},"e":{"df":0,"docs":{},"i":{"df":0,"docs":{},"n":{"df":0,"docs":{},"l":{"df":0,"docs":{},"e":{"df":0,"docs":{},"i":{"df":0,"docs":{},"t":{"df":0,"docs":{},"u":{"df":0,"docs":{},"n":{"df":0,"docs":{},"g":{"df":1,"docs":{"0":{"tf":1.0}}}}}}}}}}},"x":{"df":0,"docs":{},"p":{"df":0,"docs":{},"h":{"df":0,"docs":{},"i":{"df":1,"docs":{"0":{"tf":1.0}}}}}}},"h":{"a":{"df":0,"docs":{},"h":{"df":0,"docs":{},"n":{"df":1,"docs":{"0":{"tf":1.0}}}}},"df":0,"docs":{}},"i":{"df":0,"docs":{},"i":{"df":1,"docs":{"0":{"tf":1.0}}},"n":{"df":0,"docs":{},"h":{"a":{"df":0,"docs":{},"l":{"df":0,"docs":{},"t":{"df":0,"docs":{},"s":{"df":0,"docs":{},"v":{"df":0,"docs":{},"e":{"df":0,"docs":{},"r":{"df":0,"docs":{},"z":{"df":0,"docs":{},"e":{"df":0,"docs":{},"i":{"c":{"df":0,"docs":{},"h":{"df":0,"docs":{},"n":{"df":0,"docs":{},"i":{"df":0,"docs":{},"s":{"df":0,"docs":{},"o":{"df":0,"docs":{},"r":{"df":0,"docs":{},"g":{"a":{"df":0,"docs":{},"n":{"df":0,"docs":{},"i":{"df":0,"docs":{},"s":{"a":{"df":0,"docs":{},"t":{"df":0,"docs":{},"o":{"df":0,"docs":{},"r":{"df":0,"docs":{},"i":{"df":0,"docs":{},"s":{"c":{"df":0,"docs":{},"h":{"df":1,"docs":{"0":{"tf":1.0}}}},"df":0,"docs":{}}}}}}},"df":0,"docs":{}}}}},"df":0,"docs":{}}}}}}}}},"df":0,"docs":{}}}}}}}}}}},"df":0,"docs":{}},"s":{"df":0,"docs":{},"t":{"a":{"df":0,"docs":{},"l":{"df":1,"docs":{"0":{"tf":1.4142135623730951}}}},"df":0,"docs":{}}}}},"j":{"df":0,"docs":{},"o":{"df":0,"docs":{},"n":{"a":{"df":1,"docs":{"0":{"tf":1.0}}},"df":0,"docs":{}}}},"t":{"df":0,"docs":{},"h":{"df":0,"docs":{},"e":{"df":0,"docs":{},"m":{"df":0,"docs":{},"e":{"df":0,"docs":{},"n":{"df":1,"docs":{"0":{"tf":1.0}}}}}}}},"v":{"df":0,"docs":{},"e":{"df":0,"docs":{},"k":{"df":0,"docs":{},"t":{"df":0,"docs":{},"r":{"df":0,"docs":{},"o":{"df":0,"docs":{},"r":{"a":{"df":1,"docs":{"0":{"tf":1.0}}},"df":0,"docs":{}}}}}}},"o":{"df":0,"docs":{},"r":{"df":0,"docs":{},"l":{"df":0,"docs":{},"e":{"df":0,"docs":{},"s":{"df":0,"docs":{},"u":{"df":0,"docs":{},"n":{"df":0,"docs":{},"g":{"df":1,"docs":{"0":{"tf":1.0}}}}}}}}}}}}},"title":{"root":{"df":0,"docs":{},"i":{"df":0,"docs":{},"n":{"df":0,"docs":{},"s":{"df":0,"docs":{},"t":{"a":{"df":0,"docs":{},"l":{"df":1,"docs":{"0":{"tf":1.0}}}},"df":0,"docs":{}}}}}}}},"lang":"English","pipeline":["trimmer","stopWordFilter","stemmer"],"ref":"id","version":"0.9.5"},"results_options":{"limit_results":30,"teaser_word_count":30},"search_options":{"bool":"OR","expand":true,"fields":{"body":{"boost":1},"breadcrumbs":{"boost":1},"title":{"boost":2}}}}); \ No newline at end of file diff --git a/public/searchindex.json b/public/searchindex.json new file mode 100644 index 0000000..fd1fe8b --- /dev/null +++ b/public/searchindex.json @@ -0,0 +1 @@ +{"doc_urls":["S2/ExPhyII/VL/ExIIVL1.html"],"index":{"documentStore":{"docInfo":{"0":{"body":15,"breadcrumbs":1,"title":1}},"docs":{"0":{"body":"ExPhy II\nVorlesung 1\n16.04.2025\nJonas Hahn\nInhaltsverzeichnisOrganisatorisches ......................................................................................... ⁠1Behandelte Themen ................................................................................... ⁠1Literatur ................................................................................................ ⁠10. Einleitung ............................................................................................... ⁠10.1 Vektrora","breadcrumbs":"Installation","id":"0","title":"Installation"}},"length":1,"save":true},"fields":["title","body","breadcrumbs"],"index":{"body":{"root":{"1":{"0":{".":{"1":{"df":1,"docs":{"0":{"tf":1.0}}},"df":0,"docs":{}},"df":1,"docs":{"0":{"tf":1.0}}},"6":{".":{"0":{"4":{".":{"2":{"0":{"2":{"5":{"df":1,"docs":{"0":{"tf":1.0}}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"b":{"df":0,"docs":{},"e":{"df":0,"docs":{},"h":{"a":{"df":0,"docs":{},"n":{"d":{"df":0,"docs":{},"e":{"df":0,"docs":{},"l":{"df":0,"docs":{},"t":{"df":1,"docs":{"0":{"tf":1.0}}}}}},"df":0,"docs":{}}},"df":0,"docs":{}}}},"df":1,"docs":{"0":{"tf":1.0}},"l":{"df":0,"docs":{},"i":{"df":0,"docs":{},"t":{"df":0,"docs":{},"e":{"df":0,"docs":{},"r":{"a":{"df":0,"docs":{},"t":{"df":0,"docs":{},"u":{"df":0,"docs":{},"r":{"df":1,"docs":{"0":{"tf":1.0}}}}}},"df":0,"docs":{}}}}}}},"df":0,"docs":{},"e":{"df":0,"docs":{},"i":{"df":0,"docs":{},"n":{"df":0,"docs":{},"l":{"df":0,"docs":{},"e":{"df":0,"docs":{},"i":{"df":0,"docs":{},"t":{"df":0,"docs":{},"u":{"df":0,"docs":{},"n":{"df":0,"docs":{},"g":{"df":1,"docs":{"0":{"tf":1.0}}}}}}}}}}},"x":{"df":0,"docs":{},"p":{"df":0,"docs":{},"h":{"df":0,"docs":{},"i":{"df":1,"docs":{"0":{"tf":1.0}}}}}}},"h":{"a":{"df":0,"docs":{},"h":{"df":0,"docs":{},"n":{"df":1,"docs":{"0":{"tf":1.0}}}}},"df":0,"docs":{}},"i":{"df":0,"docs":{},"i":{"df":1,"docs":{"0":{"tf":1.0}}},"n":{"df":0,"docs":{},"h":{"a":{"df":0,"docs":{},"l":{"df":0,"docs":{},"t":{"df":0,"docs":{},"s":{"df":0,"docs":{},"v":{"df":0,"docs":{},"e":{"df":0,"docs":{},"r":{"df":0,"docs":{},"z":{"df":0,"docs":{},"e":{"df":0,"docs":{},"i":{"c":{"df":0,"docs":{},"h":{"df":0,"docs":{},"n":{"df":0,"docs":{},"i":{"df":0,"docs":{},"s":{"df":0,"docs":{},"o":{"df":0,"docs":{},"r":{"df":0,"docs":{},"g":{"a":{"df":0,"docs":{},"n":{"df":0,"docs":{},"i":{"df":0,"docs":{},"s":{"a":{"df":0,"docs":{},"t":{"df":0,"docs":{},"o":{"df":0,"docs":{},"r":{"df":0,"docs":{},"i":{"df":0,"docs":{},"s":{"c":{"df":0,"docs":{},"h":{"df":1,"docs":{"0":{"tf":1.0}}}},"df":0,"docs":{}}}}}}},"df":0,"docs":{}}}}},"df":0,"docs":{}}}}}}}}},"df":0,"docs":{}}}}}}}}}}},"df":0,"docs":{}},"s":{"df":0,"docs":{},"t":{"a":{"df":0,"docs":{},"l":{"df":1,"docs":{"0":{"tf":1.0}}}},"df":0,"docs":{}}}}},"j":{"df":0,"docs":{},"o":{"df":0,"docs":{},"n":{"a":{"df":1,"docs":{"0":{"tf":1.0}}},"df":0,"docs":{}}}},"t":{"df":0,"docs":{},"h":{"df":0,"docs":{},"e":{"df":0,"docs":{},"m":{"df":0,"docs":{},"e":{"df":0,"docs":{},"n":{"df":1,"docs":{"0":{"tf":1.0}}}}}}}},"v":{"df":0,"docs":{},"e":{"df":0,"docs":{},"k":{"df":0,"docs":{},"t":{"df":0,"docs":{},"r":{"df":0,"docs":{},"o":{"df":0,"docs":{},"r":{"a":{"df":1,"docs":{"0":{"tf":1.0}}},"df":0,"docs":{}}}}}}},"o":{"df":0,"docs":{},"r":{"df":0,"docs":{},"l":{"df":0,"docs":{},"e":{"df":0,"docs":{},"s":{"df":0,"docs":{},"u":{"df":0,"docs":{},"n":{"df":0,"docs":{},"g":{"df":1,"docs":{"0":{"tf":1.0}}}}}}}}}}}}},"breadcrumbs":{"root":{"1":{"0":{".":{"1":{"df":1,"docs":{"0":{"tf":1.0}}},"df":0,"docs":{}},"df":1,"docs":{"0":{"tf":1.0}}},"6":{".":{"0":{"4":{".":{"2":{"0":{"2":{"5":{"df":1,"docs":{"0":{"tf":1.0}}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"df":0,"docs":{}},"b":{"df":0,"docs":{},"e":{"df":0,"docs":{},"h":{"a":{"df":0,"docs":{},"n":{"d":{"df":0,"docs":{},"e":{"df":0,"docs":{},"l":{"df":0,"docs":{},"t":{"df":1,"docs":{"0":{"tf":1.0}}}}}},"df":0,"docs":{}}},"df":0,"docs":{}}}},"df":1,"docs":{"0":{"tf":1.0}},"l":{"df":0,"docs":{},"i":{"df":0,"docs":{},"t":{"df":0,"docs":{},"e":{"df":0,"docs":{},"r":{"a":{"df":0,"docs":{},"t":{"df":0,"docs":{},"u":{"df":0,"docs":{},"r":{"df":1,"docs":{"0":{"tf":1.0}}}}}},"df":0,"docs":{}}}}}}},"df":0,"docs":{},"e":{"df":0,"docs":{},"i":{"df":0,"docs":{},"n":{"df":0,"docs":{},"l":{"df":0,"docs":{},"e":{"df":0,"docs":{},"i":{"df":0,"docs":{},"t":{"df":0,"docs":{},"u":{"df":0,"docs":{},"n":{"df":0,"docs":{},"g":{"df":1,"docs":{"0":{"tf":1.0}}}}}}}}}}},"x":{"df":0,"docs":{},"p":{"df":0,"docs":{},"h":{"df":0,"docs":{},"i":{"df":1,"docs":{"0":{"tf":1.0}}}}}}},"h":{"a":{"df":0,"docs":{},"h":{"df":0,"docs":{},"n":{"df":1,"docs":{"0":{"tf":1.0}}}}},"df":0,"docs":{}},"i":{"df":0,"docs":{},"i":{"df":1,"docs":{"0":{"tf":1.0}}},"n":{"df":0,"docs":{},"h":{"a":{"df":0,"docs":{},"l":{"df":0,"docs":{},"t":{"df":0,"docs":{},"s":{"df":0,"docs":{},"v":{"df":0,"docs":{},"e":{"df":0,"docs":{},"r":{"df":0,"docs":{},"z":{"df":0,"docs":{},"e":{"df":0,"docs":{},"i":{"c":{"df":0,"docs":{},"h":{"df":0,"docs":{},"n":{"df":0,"docs":{},"i":{"df":0,"docs":{},"s":{"df":0,"docs":{},"o":{"df":0,"docs":{},"r":{"df":0,"docs":{},"g":{"a":{"df":0,"docs":{},"n":{"df":0,"docs":{},"i":{"df":0,"docs":{},"s":{"a":{"df":0,"docs":{},"t":{"df":0,"docs":{},"o":{"df":0,"docs":{},"r":{"df":0,"docs":{},"i":{"df":0,"docs":{},"s":{"c":{"df":0,"docs":{},"h":{"df":1,"docs":{"0":{"tf":1.0}}}},"df":0,"docs":{}}}}}}},"df":0,"docs":{}}}}},"df":0,"docs":{}}}}}}}}},"df":0,"docs":{}}}}}}}}}}},"df":0,"docs":{}},"s":{"df":0,"docs":{},"t":{"a":{"df":0,"docs":{},"l":{"df":1,"docs":{"0":{"tf":1.4142135623730951}}}},"df":0,"docs":{}}}}},"j":{"df":0,"docs":{},"o":{"df":0,"docs":{},"n":{"a":{"df":1,"docs":{"0":{"tf":1.0}}},"df":0,"docs":{}}}},"t":{"df":0,"docs":{},"h":{"df":0,"docs":{},"e":{"df":0,"docs":{},"m":{"df":0,"docs":{},"e":{"df":0,"docs":{},"n":{"df":1,"docs":{"0":{"tf":1.0}}}}}}}},"v":{"df":0,"docs":{},"e":{"df":0,"docs":{},"k":{"df":0,"docs":{},"t":{"df":0,"docs":{},"r":{"df":0,"docs":{},"o":{"df":0,"docs":{},"r":{"a":{"df":1,"docs":{"0":{"tf":1.0}}},"df":0,"docs":{}}}}}}},"o":{"df":0,"docs":{},"r":{"df":0,"docs":{},"l":{"df":0,"docs":{},"e":{"df":0,"docs":{},"s":{"df":0,"docs":{},"u":{"df":0,"docs":{},"n":{"df":0,"docs":{},"g":{"df":1,"docs":{"0":{"tf":1.0}}}}}}}}}}}}},"title":{"root":{"df":0,"docs":{},"i":{"df":0,"docs":{},"n":{"df":0,"docs":{},"s":{"df":0,"docs":{},"t":{"a":{"df":0,"docs":{},"l":{"df":1,"docs":{"0":{"tf":1.0}}}},"df":0,"docs":{}}}}}}}},"lang":"English","pipeline":["trimmer","stopWordFilter","stemmer"],"ref":"id","version":"0.9.5"},"results_options":{"limit_results":30,"teaser_word_count":30},"search_options":{"bool":"OR","expand":true,"fields":{"body":{"boost":1},"breadcrumbs":{"boost":1},"title":{"boost":2}}}} \ No newline at end of file diff --git a/public/theme/FontAwesome/css/font-awesome.css b/public/theme/FontAwesome/css/font-awesome.css new file mode 100644 index 0000000..e6573a9 --- /dev/null +++ b/public/theme/FontAwesome/css/font-awesome.css @@ -0,0 +1,3049 @@ +/*! + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */ +@font-face { + font-family: 'FontAwesome'; + src: url('../fonts/fontawesome-webfont.eot?v=4.7.0'); + src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), + url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), + url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), + url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), + url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg'); + font-weight: normal; + font-style: normal; +} + +.fa { + display: inline-block; + font: normal normal normal 14px/1 FontAwesome; + font-size: inherit; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.fa-lg { + font-size: 1.33333333em; + line-height: 0.75em; + vertical-align: -15%; +} + +.fa-2x { + font-size: 2em; +} + +.fa-3x { + font-size: 3em; +} + +.fa-4x { + font-size: 4em; +} + +.fa-5x { + font-size: 5em; +} + +.fa-fw { + width: 1.28571429em; + text-align: center; +} + +.fa-ul { + padding-left: 0; + margin-left: 2.14285714em; + list-style-type: none; +} + +.fa-ul > li { + position: relative; +} + +.fa-li { + position: absolute; + left: -2.14285714em; + width: 2.14285714em; + top: 0.14285714em; + text-align: center; +} + +.fa-li.fa-lg { + left: -1.85714286em; +} + +.fa-border { + padding: 0.2em 0.25em 0.15em; + border: solid 0.08em #eee; + border-radius: 0.1em; +} + +.fa-pull-left { + float: left; +} + +.fa-pull-right { + float: right; +} + +.fa.fa-pull-left { + margin-right: 0.3em; +} + +.fa.fa-pull-right { + margin-left: 0.3em; +} + +.pull-right { + float: right; +} + +.pull-left { + float: left; +} + +.fa.pull-left { + margin-right: 0.3em; +} + +.fa.pull-right { + margin-left: 0.3em; +} + +.fa-spin { + -webkit-animation: fa-spin 2s infinite linear; + animation: fa-spin 2s infinite linear; +} + +.fa-pulse { + -webkit-animation: fa-spin 1s infinite steps(8); + animation: fa-spin 1s infinite steps(8); +} + +@-webkit-keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} + +@keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} + +.fa-rotate-90 { + -ms-filter: 'progid:DXImageTransform.Microsoft.BasicImage(rotation=1)'; + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); +} + +.fa-rotate-180 { + -ms-filter: 'progid:DXImageTransform.Microsoft.BasicImage(rotation=2)'; + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg); + transform: rotate(180deg); +} + +.fa-rotate-270 { + -ms-filter: 'progid:DXImageTransform.Microsoft.BasicImage(rotation=3)'; + -webkit-transform: rotate(270deg); + -ms-transform: rotate(270deg); + transform: rotate(270deg); +} + +.fa-flip-horizontal { + -ms-filter: 'progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)'; + -webkit-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + transform: scale(-1, 1); +} + +.fa-flip-vertical { + -ms-filter: 'progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)'; + -webkit-transform: scale(1, -1); + -ms-transform: scale(1, -1); + transform: scale(1, -1); +} + +:root .fa-rotate-90, +:root .fa-rotate-180, +:root .fa-rotate-270, +:root .fa-flip-horizontal, +:root .fa-flip-vertical { + filter: none; +} + +.fa-stack { + position: relative; + display: inline-block; + width: 2em; + height: 2em; + line-height: 2em; + vertical-align: middle; +} + +.fa-stack-1x, +.fa-stack-2x { + position: absolute; + left: 0; + width: 100%; + text-align: center; +} + +.fa-stack-1x { + line-height: inherit; +} + +.fa-stack-2x { + font-size: 2em; +} + +.fa-inverse { + color: #fff; +} + +.fa-glass:before { + content: '\f000'; +} + +.fa-music:before { + content: '\f001'; +} + +.fa-search:before { + content: '\f002'; +} + +.fa-envelope-o:before { + content: '\f003'; +} + +.fa-heart:before { + content: '\f004'; +} + +.fa-star:before { + content: '\f005'; +} + +.fa-star-o:before { + content: '\f006'; +} + +.fa-user:before { + content: '\f007'; +} + +.fa-film:before { + content: '\f008'; +} + +.fa-th-large:before { + content: '\f009'; +} + +.fa-th:before { + content: '\f00a'; +} + +.fa-th-list:before { + content: '\f00b'; +} + +.fa-check:before { + content: '\f00c'; +} + +.fa-remove:before, +.fa-close:before, +.fa-times:before { + content: '\f00d'; +} + +.fa-search-plus:before { + content: '\f00e'; +} + +.fa-search-minus:before { + content: '\f010'; +} + +.fa-power-off:before { + content: '\f011'; +} + +.fa-signal:before { + content: '\f012'; +} + +.fa-gear:before, +.fa-cog:before { + content: '\f013'; +} + +.fa-trash-o:before { + content: '\f014'; +} + +.fa-home:before { + content: '\f015'; +} + +.fa-file-o:before { + content: '\f016'; +} + +.fa-clock-o:before { + content: '\f017'; +} + +.fa-road:before { + content: '\f018'; +} + +.fa-download:before { + content: '\f019'; +} + +.fa-arrow-circle-o-down:before { + content: '\f01a'; +} + +.fa-arrow-circle-o-up:before { + content: '\f01b'; +} + +.fa-inbox:before { + content: '\f01c'; +} + +.fa-play-circle-o:before { + content: '\f01d'; +} + +.fa-rotate-right:before, +.fa-repeat:before { + content: '\f01e'; +} + +.fa-refresh:before { + content: '\f021'; +} + +.fa-list-alt:before { + content: '\f022'; +} + +.fa-lock:before { + content: '\f023'; +} + +.fa-flag:before { + content: '\f024'; +} + +.fa-headphones:before { + content: '\f025'; +} + +.fa-volume-off:before { + content: '\f026'; +} + +.fa-volume-down:before { + content: '\f027'; +} + +.fa-volume-up:before { + content: '\f028'; +} + +.fa-qrcode:before { + content: '\f029'; +} + +.fa-barcode:before { + content: '\f02a'; +} + +.fa-tag:before { + content: '\f02b'; +} + +.fa-tags:before { + content: '\f02c'; +} + +.fa-book:before { + content: '\f02d'; +} + +.fa-bookmark:before { + content: '\f02e'; +} + +.fa-print:before { + content: '\f02f'; +} + +.fa-camera:before { + content: '\f030'; +} + +.fa-font:before { + content: '\f031'; +} + +.fa-bold:before { + content: '\f032'; +} + +.fa-italic:before { + content: '\f033'; +} + +.fa-text-height:before { + content: '\f034'; +} + +.fa-text-width:before { + content: '\f035'; +} + +.fa-align-left:before { + content: '\f036'; +} + +.fa-align-center:before { + content: '\f037'; +} + +.fa-align-right:before { + content: '\f038'; +} + +.fa-align-justify:before { + content: '\f039'; +} + +.fa-list:before { + content: '\f03a'; +} + +.fa-dedent:before, +.fa-outdent:before { + content: '\f03b'; +} + +.fa-indent:before { + content: '\f03c'; +} + +.fa-video-camera:before { + content: '\f03d'; +} + +.fa-photo:before, +.fa-image:before, +.fa-picture-o:before { + content: '\f03e'; +} + +.fa-pencil:before { + content: '\f040'; +} + +.fa-map-marker:before { + content: '\f041'; +} + +.fa-adjust:before { + content: '\f042'; +} + +.fa-tint:before { + content: '\f043'; +} + +.fa-edit:before, +.fa-pencil-square-o:before { + content: '\f044'; +} + +.fa-share-square-o:before { + content: '\f045'; +} + +.fa-check-square-o:before { + content: '\f046'; +} + +.fa-arrows:before { + content: '\f047'; +} + +.fa-step-backward:before { + content: '\f048'; +} + +.fa-fast-backward:before { + content: '\f049'; +} + +.fa-backward:before { + content: '\f04a'; +} + +.fa-play:before { + content: '\f04b'; +} + +.fa-pause:before { + content: '\f04c'; +} + +.fa-stop:before { + content: '\f04d'; +} + +.fa-forward:before { + content: '\f04e'; +} + +.fa-fast-forward:before { + content: '\f050'; +} + +.fa-step-forward:before { + content: '\f051'; +} + +.fa-eject:before { + content: '\f052'; +} + +.fa-chevron-left:before { + content: '\f053'; +} + +.fa-chevron-right:before { + content: '\f054'; +} + +.fa-plus-circle:before { + content: '\f055'; +} + +.fa-minus-circle:before { + content: '\f056'; +} + +.fa-times-circle:before { + content: '\f057'; +} + +.fa-check-circle:before { + content: '\f058'; +} + +.fa-question-circle:before { + content: '\f059'; +} + +.fa-info-circle:before { + content: '\f05a'; +} + +.fa-crosshairs:before { + content: '\f05b'; +} + +.fa-times-circle-o:before { + content: '\f05c'; +} + +.fa-check-circle-o:before { + content: '\f05d'; +} + +.fa-ban:before { + content: '\f05e'; +} + +.fa-arrow-left:before { + content: '\f060'; +} + +.fa-arrow-right:before { + content: '\f061'; +} + +.fa-arrow-up:before { + content: '\f062'; +} + +.fa-arrow-down:before { + content: '\f063'; +} + +.fa-mail-forward:before, +.fa-share:before { + content: '\f064'; +} + +.fa-expand:before { + content: '\f065'; +} + +.fa-compress:before { + content: '\f066'; +} + +.fa-plus:before { + content: '\f067'; +} + +.fa-minus:before { + content: '\f068'; +} + +.fa-asterisk:before { + content: '\f069'; +} + +.fa-exclamation-circle:before { + content: '\f06a'; +} + +.fa-gift:before { + content: '\f06b'; +} + +.fa-leaf:before { + content: '\f06c'; +} + +.fa-fire:before { + content: '\f06d'; +} + +.fa-eye:before { + content: '\f06e'; +} + +.fa-eye-slash:before { + content: '\f070'; +} + +.fa-warning:before, +.fa-exclamation-triangle:before { + content: '\f071'; +} + +.fa-plane:before { + content: '\f072'; +} + +.fa-calendar:before { + content: '\f073'; +} + +.fa-random:before { + content: '\f074'; +} + +.fa-comment:before { + content: '\f075'; +} + +.fa-magnet:before { + content: '\f076'; +} + +.fa-chevron-up:before { + content: '\f077'; +} + +.fa-chevron-down:before { + content: '\f078'; +} + +.fa-retweet:before { + content: '\f079'; +} + +.fa-shopping-cart:before { + content: '\f07a'; +} + +.fa-folder:before { + content: '\f07b'; +} + +.fa-folder-open:before { + content: '\f07c'; +} + +.fa-arrows-v:before { + content: '\f07d'; +} + +.fa-arrows-h:before { + content: '\f07e'; +} + +.fa-bar-chart-o:before, +.fa-bar-chart:before { + content: '\f080'; +} + +.fa-twitter-square:before { + content: '\f081'; +} + +.fa-facebook-square:before { + content: '\f082'; +} + +.fa-camera-retro:before { + content: '\f083'; +} + +.fa-key:before { + content: '\f084'; +} + +.fa-gears:before, +.fa-cogs:before { + content: '\f085'; +} + +.fa-comments:before { + content: '\f086'; +} + +.fa-thumbs-o-up:before { + content: '\f087'; +} + +.fa-thumbs-o-down:before { + content: '\f088'; +} + +.fa-star-half:before { + content: '\f089'; +} + +.fa-heart-o:before { + content: '\f08a'; +} + +.fa-sign-out:before { + content: '\f08b'; +} + +.fa-linkedin-square:before { + content: '\f08c'; +} + +.fa-thumb-tack:before { + content: '\f08d'; +} + +.fa-external-link:before { + content: '\f08e'; +} + +.fa-sign-in:before { + content: '\f090'; +} + +.fa-trophy:before { + content: '\f091'; +} + +.fa-github-square:before { + content: '\f092'; +} + +.fa-upload:before { + content: '\f093'; +} + +.fa-lemon-o:before { + content: '\f094'; +} + +.fa-phone:before { + content: '\f095'; +} + +.fa-square-o:before { + content: '\f096'; +} + +.fa-bookmark-o:before { + content: '\f097'; +} + +.fa-phone-square:before { + content: '\f098'; +} + +.fa-twitter:before { + content: '\f099'; +} + +.fa-facebook-f:before, +.fa-facebook:before { + content: '\f09a'; +} + +.fa-github:before { + content: '\f09b'; +} + +.fa-unlock:before { + content: '\f09c'; +} + +.fa-credit-card:before { + content: '\f09d'; +} + +.fa-feed:before, +.fa-rss:before { + content: '\f09e'; +} + +.fa-hdd-o:before { + content: '\f0a0'; +} + +.fa-bullhorn:before { + content: '\f0a1'; +} + +.fa-bell:before { + content: '\f0f3'; +} + +.fa-certificate:before { + content: '\f0a3'; +} + +.fa-hand-o-right:before { + content: '\f0a4'; +} + +.fa-hand-o-left:before { + content: '\f0a5'; +} + +.fa-hand-o-up:before { + content: '\f0a6'; +} + +.fa-hand-o-down:before { + content: '\f0a7'; +} + +.fa-arrow-circle-left:before { + content: '\f0a8'; +} + +.fa-arrow-circle-right:before { + content: '\f0a9'; +} + +.fa-arrow-circle-up:before { + content: '\f0aa'; +} + +.fa-arrow-circle-down:before { + content: '\f0ab'; +} + +.fa-globe:before { + content: '\f0ac'; +} + +.fa-wrench:before { + content: '\f0ad'; +} + +.fa-tasks:before { + content: '\f0ae'; +} + +.fa-filter:before { + content: '\f0b0'; +} + +.fa-briefcase:before { + content: '\f0b1'; +} + +.fa-arrows-alt:before { + content: '\f0b2'; +} + +.fa-group:before, +.fa-users:before { + content: '\f0c0'; +} + +.fa-chain:before, +.fa-link:before { + content: '\f0c1'; +} + +.fa-cloud:before { + content: '\f0c2'; +} + +.fa-flask:before { + content: '\f0c3'; +} + +.fa-cut:before, +.fa-scissors:before { + content: '\f0c4'; +} + +.fa-copy:before, +.fa-files-o:before { + content: '\f0c5'; +} + +.fa-paperclip:before { + content: '\f0c6'; +} + +.fa-save:before, +.fa-floppy-o:before { + content: '\f0c7'; +} + +.fa-square:before { + content: '\f0c8'; +} + +.fa-navicon:before, +.fa-reorder:before, +.fa-bars:before { + content: '\f0c9'; +} + +.fa-list-ul:before { + content: '\f0ca'; +} + +.fa-list-ol:before { + content: '\f0cb'; +} + +.fa-strikethrough:before { + content: '\f0cc'; +} + +.fa-underline:before { + content: '\f0cd'; +} + +.fa-table:before { + content: '\f0ce'; +} + +.fa-magic:before { + content: '\f0d0'; +} + +.fa-truck:before { + content: '\f0d1'; +} + +.fa-pinterest:before { + content: '\f0d2'; +} + +.fa-pinterest-square:before { + content: '\f0d3'; +} + +.fa-google-plus-square:before { + content: '\f0d4'; +} + +.fa-google-plus:before { + content: '\f0d5'; +} + +.fa-money:before { + content: '\f0d6'; +} + +.fa-caret-down:before { + content: '\f0d7'; +} + +.fa-caret-up:before { + content: '\f0d8'; +} + +.fa-caret-left:before { + content: '\f0d9'; +} + +.fa-caret-right:before { + content: '\f0da'; +} + +.fa-columns:before { + content: '\f0db'; +} + +.fa-unsorted:before, +.fa-sort:before { + content: '\f0dc'; +} + +.fa-sort-down:before, +.fa-sort-desc:before { + content: '\f0dd'; +} + +.fa-sort-up:before, +.fa-sort-asc:before { + content: '\f0de'; +} + +.fa-envelope:before { + content: '\f0e0'; +} + +.fa-linkedin:before { + content: '\f0e1'; +} + +.fa-rotate-left:before, +.fa-undo:before { + content: '\f0e2'; +} + +.fa-legal:before, +.fa-gavel:before { + content: '\f0e3'; +} + +.fa-dashboard:before, +.fa-tachometer:before { + content: '\f0e4'; +} + +.fa-comment-o:before { + content: '\f0e5'; +} + +.fa-comments-o:before { + content: '\f0e6'; +} + +.fa-flash:before, +.fa-bolt:before { + content: '\f0e7'; +} + +.fa-sitemap:before { + content: '\f0e8'; +} + +.fa-umbrella:before { + content: '\f0e9'; +} + +.fa-paste:before, +.fa-clipboard:before { + content: '\f0ea'; +} + +.fa-lightbulb-o:before { + content: '\f0eb'; +} + +.fa-exchange:before { + content: '\f0ec'; +} + +.fa-cloud-download:before { + content: '\f0ed'; +} + +.fa-cloud-upload:before { + content: '\f0ee'; +} + +.fa-user-md:before { + content: '\f0f0'; +} + +.fa-stethoscope:before { + content: '\f0f1'; +} + +.fa-suitcase:before { + content: '\f0f2'; +} + +.fa-bell-o:before { + content: '\f0a2'; +} + +.fa-coffee:before { + content: '\f0f4'; +} + +.fa-cutlery:before { + content: '\f0f5'; +} + +.fa-file-text-o:before { + content: '\f0f6'; +} + +.fa-building-o:before { + content: '\f0f7'; +} + +.fa-hospital-o:before { + content: '\f0f8'; +} + +.fa-ambulance:before { + content: '\f0f9'; +} + +.fa-medkit:before { + content: '\f0fa'; +} + +.fa-fighter-jet:before { + content: '\f0fb'; +} + +.fa-beer:before { + content: '\f0fc'; +} + +.fa-h-square:before { + content: '\f0fd'; +} + +.fa-plus-square:before { + content: '\f0fe'; +} + +.fa-angle-double-left:before { + content: '\f100'; +} + +.fa-angle-double-right:before { + content: '\f101'; +} + +.fa-angle-double-up:before { + content: '\f102'; +} + +.fa-angle-double-down:before { + content: '\f103'; +} + +.fa-angle-left:before { + content: '\f104'; +} + +.fa-angle-right:before { + content: '\f105'; +} + +.fa-angle-up:before { + content: '\f106'; +} + +.fa-angle-down:before { + content: '\f107'; +} + +.fa-desktop:before { + content: '\f108'; +} + +.fa-laptop:before { + content: '\f109'; +} + +.fa-tablet:before { + content: '\f10a'; +} + +.fa-mobile-phone:before, +.fa-mobile:before { + content: '\f10b'; +} + +.fa-circle-o:before { + content: '\f10c'; +} + +.fa-quote-left:before { + content: '\f10d'; +} + +.fa-quote-right:before { + content: '\f10e'; +} + +.fa-spinner:before { + content: '\f110'; +} + +.fa-circle:before { + content: '\f111'; +} + +.fa-mail-reply:before, +.fa-reply:before { + content: '\f112'; +} + +.fa-github-alt:before { + content: '\f113'; +} + +.fa-folder-o:before { + content: '\f114'; +} + +.fa-folder-open-o:before { + content: '\f115'; +} + +.fa-smile-o:before { + content: '\f118'; +} + +.fa-frown-o:before { + content: '\f119'; +} + +.fa-meh-o:before { + content: '\f11a'; +} + +.fa-gamepad:before { + content: '\f11b'; +} + +.fa-keyboard-o:before { + content: '\f11c'; +} + +.fa-flag-o:before { + content: '\f11d'; +} + +.fa-flag-checkered:before { + content: '\f11e'; +} + +.fa-terminal:before { + content: '\f120'; +} + +.fa-code:before { + content: '\f121'; +} + +.fa-mail-reply-all:before, +.fa-reply-all:before { + content: '\f122'; +} + +.fa-star-half-empty:before, +.fa-star-half-full:before, +.fa-star-half-o:before { + content: '\f123'; +} + +.fa-location-arrow:before { + content: '\f124'; +} + +.fa-crop:before { + content: '\f125'; +} + +.fa-code-fork:before { + content: '\f126'; +} + +.fa-unlink:before, +.fa-chain-broken:before { + content: '\f127'; +} + +.fa-question:before { + content: '\f128'; +} + +.fa-info:before { + content: '\f129'; +} + +.fa-exclamation:before { + content: '\f12a'; +} + +.fa-superscript:before { + content: '\f12b'; +} + +.fa-subscript:before { + content: '\f12c'; +} + +.fa-eraser:before { + content: '\f12d'; +} + +.fa-puzzle-piece:before { + content: '\f12e'; +} + +.fa-microphone:before { + content: '\f130'; +} + +.fa-microphone-slash:before { + content: '\f131'; +} + +.fa-shield:before { + content: '\f132'; +} + +.fa-calendar-o:before { + content: '\f133'; +} + +.fa-fire-extinguisher:before { + content: '\f134'; +} + +.fa-rocket:before { + content: '\f135'; +} + +.fa-maxcdn:before { + content: '\f136'; +} + +.fa-chevron-circle-left:before { + content: '\f137'; +} + +.fa-chevron-circle-right:before { + content: '\f138'; +} + +.fa-chevron-circle-up:before { + content: '\f139'; +} + +.fa-chevron-circle-down:before { + content: '\f13a'; +} + +.fa-html5:before { + content: '\f13b'; +} + +.fa-css3:before { + content: '\f13c'; +} + +.fa-anchor:before { + content: '\f13d'; +} + +.fa-unlock-alt:before { + content: '\f13e'; +} + +.fa-bullseye:before { + content: '\f140'; +} + +.fa-ellipsis-h:before { + content: '\f141'; +} + +.fa-ellipsis-v:before { + content: '\f142'; +} + +.fa-rss-square:before { + content: '\f143'; +} + +.fa-play-circle:before { + content: '\f144'; +} + +.fa-ticket:before { + content: '\f145'; +} + +.fa-minus-square:before { + content: '\f146'; +} + +.fa-minus-square-o:before { + content: '\f147'; +} + +.fa-level-up:before { + content: '\f148'; +} + +.fa-level-down:before { + content: '\f149'; +} + +.fa-check-square:before { + content: '\f14a'; +} + +.fa-pencil-square:before { + content: '\f14b'; +} + +.fa-external-link-square:before { + content: '\f14c'; +} + +.fa-share-square:before { + content: '\f14d'; +} + +.fa-compass:before { + content: '\f14e'; +} + +.fa-toggle-down:before, +.fa-caret-square-o-down:before { + content: '\f150'; +} + +.fa-toggle-up:before, +.fa-caret-square-o-up:before { + content: '\f151'; +} + +.fa-toggle-right:before, +.fa-caret-square-o-right:before { + content: '\f152'; +} + +.fa-euro:before, +.fa-eur:before { + content: '\f153'; +} + +.fa-gbp:before { + content: '\f154'; +} + +.fa-dollar:before, +.fa-usd:before { + content: '\f155'; +} + +.fa-rupee:before, +.fa-inr:before { + content: '\f156'; +} + +.fa-cny:before, +.fa-rmb:before, +.fa-yen:before, +.fa-jpy:before { + content: '\f157'; +} + +.fa-ruble:before, +.fa-rouble:before, +.fa-rub:before { + content: '\f158'; +} + +.fa-won:before, +.fa-krw:before { + content: '\f159'; +} + +.fa-bitcoin:before, +.fa-btc:before { + content: '\f15a'; +} + +.fa-file:before { + content: '\f15b'; +} + +.fa-file-text:before { + content: '\f15c'; +} + +.fa-sort-alpha-asc:before { + content: '\f15d'; +} + +.fa-sort-alpha-desc:before { + content: '\f15e'; +} + +.fa-sort-amount-asc:before { + content: '\f160'; +} + +.fa-sort-amount-desc:before { + content: '\f161'; +} + +.fa-sort-numeric-asc:before { + content: '\f162'; +} + +.fa-sort-numeric-desc:before { + content: '\f163'; +} + +.fa-thumbs-up:before { + content: '\f164'; +} + +.fa-thumbs-down:before { + content: '\f165'; +} + +.fa-youtube-square:before { + content: '\f166'; +} + +.fa-youtube:before { + content: '\f167'; +} + +.fa-xing:before { + content: '\f168'; +} + +.fa-xing-square:before { + content: '\f169'; +} + +.fa-youtube-play:before { + content: '\f16a'; +} + +.fa-dropbox:before { + content: '\f16b'; +} + +.fa-stack-overflow:before { + content: '\f16c'; +} + +.fa-instagram:before { + content: '\f16d'; +} + +.fa-flickr:before { + content: '\f16e'; +} + +.fa-adn:before { + content: '\f170'; +} + +.fa-bitbucket:before { + content: '\f171'; +} + +.fa-bitbucket-square:before { + content: '\f172'; +} + +.fa-tumblr:before { + content: '\f173'; +} + +.fa-tumblr-square:before { + content: '\f174'; +} + +.fa-long-arrow-down:before { + content: '\f175'; +} + +.fa-long-arrow-up:before { + content: '\f176'; +} + +.fa-long-arrow-left:before { + content: '\f177'; +} + +.fa-long-arrow-right:before { + content: '\f178'; +} + +.fa-apple:before { + content: '\f179'; +} + +.fa-windows:before { + content: '\f17a'; +} + +.fa-android:before { + content: '\f17b'; +} + +.fa-linux:before { + content: '\f17c'; +} + +.fa-dribbble:before { + content: '\f17d'; +} + +.fa-skype:before { + content: '\f17e'; +} + +.fa-foursquare:before { + content: '\f180'; +} + +.fa-trello:before { + content: '\f181'; +} + +.fa-female:before { + content: '\f182'; +} + +.fa-male:before { + content: '\f183'; +} + +.fa-gittip:before, +.fa-gratipay:before { + content: '\f184'; +} + +.fa-sun-o:before { + content: '\f185'; +} + +.fa-moon-o:before { + content: '\f186'; +} + +.fa-archive:before { + content: '\f187'; +} + +.fa-bug:before { + content: '\f188'; +} + +.fa-vk:before { + content: '\f189'; +} + +.fa-weibo:before { + content: '\f18a'; +} + +.fa-renren:before { + content: '\f18b'; +} + +.fa-pagelines:before { + content: '\f18c'; +} + +.fa-stack-exchange:before { + content: '\f18d'; +} + +.fa-arrow-circle-o-right:before { + content: '\f18e'; +} + +.fa-arrow-circle-o-left:before { + content: '\f190'; +} + +.fa-toggle-left:before, +.fa-caret-square-o-left:before { + content: '\f191'; +} + +.fa-dot-circle-o:before { + content: '\f192'; +} + +.fa-wheelchair:before { + content: '\f193'; +} + +.fa-vimeo-square:before { + content: '\f194'; +} + +.fa-turkish-lira:before, +.fa-try:before { + content: '\f195'; +} + +.fa-plus-square-o:before { + content: '\f196'; +} + +.fa-space-shuttle:before { + content: '\f197'; +} + +.fa-slack:before { + content: '\f198'; +} + +.fa-envelope-square:before { + content: '\f199'; +} + +.fa-wordpress:before { + content: '\f19a'; +} + +.fa-openid:before { + content: '\f19b'; +} + +.fa-institution:before, +.fa-bank:before, +.fa-university:before { + content: '\f19c'; +} + +.fa-mortar-board:before, +.fa-graduation-cap:before { + content: '\f19d'; +} + +.fa-yahoo:before { + content: '\f19e'; +} + +.fa-google:before { + content: '\f1a0'; +} + +.fa-reddit:before { + content: '\f1a1'; +} + +.fa-reddit-square:before { + content: '\f1a2'; +} + +.fa-stumbleupon-circle:before { + content: '\f1a3'; +} + +.fa-stumbleupon:before { + content: '\f1a4'; +} + +.fa-delicious:before { + content: '\f1a5'; +} + +.fa-digg:before { + content: '\f1a6'; +} + +.fa-pied-piper-pp:before { + content: '\f1a7'; +} + +.fa-pied-piper-alt:before { + content: '\f1a8'; +} + +.fa-drupal:before { + content: '\f1a9'; +} + +.fa-joomla:before { + content: '\f1aa'; +} + +.fa-language:before { + content: '\f1ab'; +} + +.fa-fax:before { + content: '\f1ac'; +} + +.fa-building:before { + content: '\f1ad'; +} + +.fa-child:before { + content: '\f1ae'; +} + +.fa-paw:before { + content: '\f1b0'; +} + +.fa-spoon:before { + content: '\f1b1'; +} + +.fa-cube:before { + content: '\f1b2'; +} + +.fa-cubes:before { + content: '\f1b3'; +} + +.fa-behance:before { + content: '\f1b4'; +} + +.fa-behance-square:before { + content: '\f1b5'; +} + +.fa-steam:before { + content: '\f1b6'; +} + +.fa-steam-square:before { + content: '\f1b7'; +} + +.fa-recycle:before { + content: '\f1b8'; +} + +.fa-automobile:before, +.fa-car:before { + content: '\f1b9'; +} + +.fa-cab:before, +.fa-taxi:before { + content: '\f1ba'; +} + +.fa-tree:before { + content: '\f1bb'; +} + +.fa-spotify:before { + content: '\f1bc'; +} + +.fa-deviantart:before { + content: '\f1bd'; +} + +.fa-soundcloud:before { + content: '\f1be'; +} + +.fa-database:before { + content: '\f1c0'; +} + +.fa-file-pdf-o:before { + content: '\f1c1'; +} + +.fa-file-word-o:before { + content: '\f1c2'; +} + +.fa-file-excel-o:before { + content: '\f1c3'; +} + +.fa-file-powerpoint-o:before { + content: '\f1c4'; +} + +.fa-file-photo-o:before, +.fa-file-picture-o:before, +.fa-file-image-o:before { + content: '\f1c5'; +} + +.fa-file-zip-o:before, +.fa-file-archive-o:before { + content: '\f1c6'; +} + +.fa-file-sound-o:before, +.fa-file-audio-o:before { + content: '\f1c7'; +} + +.fa-file-movie-o:before, +.fa-file-video-o:before { + content: '\f1c8'; +} + +.fa-file-code-o:before { + content: '\f1c9'; +} + +.fa-vine:before { + content: '\f1ca'; +} + +.fa-codepen:before { + content: '\f1cb'; +} + +.fa-jsfiddle:before { + content: '\f1cc'; +} + +.fa-life-bouy:before, +.fa-life-buoy:before, +.fa-life-saver:before, +.fa-support:before, +.fa-life-ring:before { + content: '\f1cd'; +} + +.fa-circle-o-notch:before { + content: '\f1ce'; +} + +.fa-ra:before, +.fa-resistance:before, +.fa-rebel:before { + content: '\f1d0'; +} + +.fa-ge:before, +.fa-empire:before { + content: '\f1d1'; +} + +.fa-git-square:before { + content: '\f1d2'; +} + +.fa-git:before { + content: '\f1d3'; +} + +.fa-y-combinator-square:before, +.fa-yc-square:before, +.fa-hacker-news:before { + content: '\f1d4'; +} + +.fa-tencent-weibo:before { + content: '\f1d5'; +} + +.fa-qq:before { + content: '\f1d6'; +} + +.fa-wechat:before, +.fa-weixin:before { + content: '\f1d7'; +} + +.fa-send:before, +.fa-paper-plane:before { + content: '\f1d8'; +} + +.fa-send-o:before, +.fa-paper-plane-o:before { + content: '\f1d9'; +} + +.fa-history:before { + content: '\f1da'; +} + +.fa-circle-thin:before { + content: '\f1db'; +} + +.fa-header:before { + content: '\f1dc'; +} + +.fa-paragraph:before { + content: '\f1dd'; +} + +.fa-sliders:before { + content: '\f1de'; +} + +.fa-share-alt:before { + content: '\f1e0'; +} + +.fa-share-alt-square:before { + content: '\f1e1'; +} + +.fa-bomb:before { + content: '\f1e2'; +} + +.fa-soccer-ball-o:before, +.fa-futbol-o:before { + content: '\f1e3'; +} + +.fa-tty:before { + content: '\f1e4'; +} + +.fa-binoculars:before { + content: '\f1e5'; +} + +.fa-plug:before { + content: '\f1e6'; +} + +.fa-slideshare:before { + content: '\f1e7'; +} + +.fa-twitch:before { + content: '\f1e8'; +} + +.fa-yelp:before { + content: '\f1e9'; +} + +.fa-newspaper-o:before { + content: '\f1ea'; +} + +.fa-wifi:before { + content: '\f1eb'; +} + +.fa-calculator:before { + content: '\f1ec'; +} + +.fa-paypal:before { + content: '\f1ed'; +} + +.fa-google-wallet:before { + content: '\f1ee'; +} + +.fa-cc-visa:before { + content: '\f1f0'; +} + +.fa-cc-mastercard:before { + content: '\f1f1'; +} + +.fa-cc-discover:before { + content: '\f1f2'; +} + +.fa-cc-amex:before { + content: '\f1f3'; +} + +.fa-cc-paypal:before { + content: '\f1f4'; +} + +.fa-cc-stripe:before { + content: '\f1f5'; +} + +.fa-bell-slash:before { + content: '\f1f6'; +} + +.fa-bell-slash-o:before { + content: '\f1f7'; +} + +.fa-trash:before { + content: '\f1f8'; +} + +.fa-copyright:before { + content: '\f1f9'; +} + +.fa-at:before { + content: '\f1fa'; +} + +.fa-eyedropper:before { + content: '\f1fb'; +} + +.fa-paint-brush:before { + content: '\f1fc'; +} + +.fa-birthday-cake:before { + content: '\f1fd'; +} + +.fa-area-chart:before { + content: '\f1fe'; +} + +.fa-pie-chart:before { + content: '\f200'; +} + +.fa-line-chart:before { + content: '\f201'; +} + +.fa-lastfm:before { + content: '\f202'; +} + +.fa-lastfm-square:before { + content: '\f203'; +} + +.fa-toggle-off:before { + content: '\f204'; +} + +.fa-toggle-on:before { + content: '\f205'; +} + +.fa-bicycle:before { + content: '\f206'; +} + +.fa-bus:before { + content: '\f207'; +} + +.fa-ioxhost:before { + content: '\f208'; +} + +.fa-angellist:before { + content: '\f209'; +} + +.fa-cc:before { + content: '\f20a'; +} + +.fa-shekel:before, +.fa-sheqel:before, +.fa-ils:before { + content: '\f20b'; +} + +.fa-meanpath:before { + content: '\f20c'; +} + +.fa-buysellads:before { + content: '\f20d'; +} + +.fa-connectdevelop:before { + content: '\f20e'; +} + +.fa-dashcube:before { + content: '\f210'; +} + +.fa-forumbee:before { + content: '\f211'; +} + +.fa-leanpub:before { + content: '\f212'; +} + +.fa-sellsy:before { + content: '\f213'; +} + +.fa-shirtsinbulk:before { + content: '\f214'; +} + +.fa-simplybuilt:before { + content: '\f215'; +} + +.fa-skyatlas:before { + content: '\f216'; +} + +.fa-cart-plus:before { + content: '\f217'; +} + +.fa-cart-arrow-down:before { + content: '\f218'; +} + +.fa-diamond:before { + content: '\f219'; +} + +.fa-ship:before { + content: '\f21a'; +} + +.fa-user-secret:before { + content: '\f21b'; +} + +.fa-motorcycle:before { + content: '\f21c'; +} + +.fa-street-view:before { + content: '\f21d'; +} + +.fa-heartbeat:before { + content: '\f21e'; +} + +.fa-venus:before { + content: '\f221'; +} + +.fa-mars:before { + content: '\f222'; +} + +.fa-mercury:before { + content: '\f223'; +} + +.fa-intersex:before, +.fa-transgender:before { + content: '\f224'; +} + +.fa-transgender-alt:before { + content: '\f225'; +} + +.fa-venus-double:before { + content: '\f226'; +} + +.fa-mars-double:before { + content: '\f227'; +} + +.fa-venus-mars:before { + content: '\f228'; +} + +.fa-mars-stroke:before { + content: '\f229'; +} + +.fa-mars-stroke-v:before { + content: '\f22a'; +} + +.fa-mars-stroke-h:before { + content: '\f22b'; +} + +.fa-neuter:before { + content: '\f22c'; +} + +.fa-genderless:before { + content: '\f22d'; +} + +.fa-facebook-official:before { + content: '\f230'; +} + +.fa-pinterest-p:before { + content: '\f231'; +} + +.fa-whatsapp:before { + content: '\f232'; +} + +.fa-server:before { + content: '\f233'; +} + +.fa-user-plus:before { + content: '\f234'; +} + +.fa-user-times:before { + content: '\f235'; +} + +.fa-hotel:before, +.fa-bed:before { + content: '\f236'; +} + +.fa-viacoin:before { + content: '\f237'; +} + +.fa-train:before { + content: '\f238'; +} + +.fa-subway:before { + content: '\f239'; +} + +.fa-medium:before { + content: '\f23a'; +} + +.fa-yc:before, +.fa-y-combinator:before { + content: '\f23b'; +} + +.fa-optin-monster:before { + content: '\f23c'; +} + +.fa-opencart:before { + content: '\f23d'; +} + +.fa-expeditedssl:before { + content: '\f23e'; +} + +.fa-battery-4:before, +.fa-battery:before, +.fa-battery-full:before { + content: '\f240'; +} + +.fa-battery-3:before, +.fa-battery-three-quarters:before { + content: '\f241'; +} + +.fa-battery-2:before, +.fa-battery-half:before { + content: '\f242'; +} + +.fa-battery-1:before, +.fa-battery-quarter:before { + content: '\f243'; +} + +.fa-battery-0:before, +.fa-battery-empty:before { + content: '\f244'; +} + +.fa-mouse-pointer:before { + content: '\f245'; +} + +.fa-i-cursor:before { + content: '\f246'; +} + +.fa-object-group:before { + content: '\f247'; +} + +.fa-object-ungroup:before { + content: '\f248'; +} + +.fa-sticky-note:before { + content: '\f249'; +} + +.fa-sticky-note-o:before { + content: '\f24a'; +} + +.fa-cc-jcb:before { + content: '\f24b'; +} + +.fa-cc-diners-club:before { + content: '\f24c'; +} + +.fa-clone:before { + content: '\f24d'; +} + +.fa-balance-scale:before { + content: '\f24e'; +} + +.fa-hourglass-o:before { + content: '\f250'; +} + +.fa-hourglass-1:before, +.fa-hourglass-start:before { + content: '\f251'; +} + +.fa-hourglass-2:before, +.fa-hourglass-half:before { + content: '\f252'; +} + +.fa-hourglass-3:before, +.fa-hourglass-end:before { + content: '\f253'; +} + +.fa-hourglass:before { + content: '\f254'; +} + +.fa-hand-grab-o:before, +.fa-hand-rock-o:before { + content: '\f255'; +} + +.fa-hand-stop-o:before, +.fa-hand-paper-o:before { + content: '\f256'; +} + +.fa-hand-scissors-o:before { + content: '\f257'; +} + +.fa-hand-lizard-o:before { + content: '\f258'; +} + +.fa-hand-spock-o:before { + content: '\f259'; +} + +.fa-hand-pointer-o:before { + content: '\f25a'; +} + +.fa-hand-peace-o:before { + content: '\f25b'; +} + +.fa-trademark:before { + content: '\f25c'; +} + +.fa-registered:before { + content: '\f25d'; +} + +.fa-creative-commons:before { + content: '\f25e'; +} + +.fa-gg:before { + content: '\f260'; +} + +.fa-gg-circle:before { + content: '\f261'; +} + +.fa-tripadvisor:before { + content: '\f262'; +} + +.fa-odnoklassniki:before { + content: '\f263'; +} + +.fa-odnoklassniki-square:before { + content: '\f264'; +} + +.fa-get-pocket:before { + content: '\f265'; +} + +.fa-wikipedia-w:before { + content: '\f266'; +} + +.fa-safari:before { + content: '\f267'; +} + +.fa-chrome:before { + content: '\f268'; +} + +.fa-firefox:before { + content: '\f269'; +} + +.fa-opera:before { + content: '\f26a'; +} + +.fa-internet-explorer:before { + content: '\f26b'; +} + +.fa-tv:before, +.fa-television:before { + content: '\f26c'; +} + +.fa-contao:before { + content: '\f26d'; +} + +.fa-500px:before { + content: '\f26e'; +} + +.fa-amazon:before { + content: '\f270'; +} + +.fa-calendar-plus-o:before { + content: '\f271'; +} + +.fa-calendar-minus-o:before { + content: '\f272'; +} + +.fa-calendar-times-o:before { + content: '\f273'; +} + +.fa-calendar-check-o:before { + content: '\f274'; +} + +.fa-industry:before { + content: '\f275'; +} + +.fa-map-pin:before { + content: '\f276'; +} + +.fa-map-signs:before { + content: '\f277'; +} + +.fa-map-o:before { + content: '\f278'; +} + +.fa-map:before { + content: '\f279'; +} + +.fa-commenting:before { + content: '\f27a'; +} + +.fa-commenting-o:before { + content: '\f27b'; +} + +.fa-houzz:before { + content: '\f27c'; +} + +.fa-vimeo:before { + content: '\f27d'; +} + +.fa-black-tie:before { + content: '\f27e'; +} + +.fa-fonticons:before { + content: '\f280'; +} + +.fa-reddit-alien:before { + content: '\f281'; +} + +.fa-edge:before { + content: '\f282'; +} + +.fa-credit-card-alt:before { + content: '\f283'; +} + +.fa-codiepie:before { + content: '\f284'; +} + +.fa-modx:before { + content: '\f285'; +} + +.fa-fort-awesome:before { + content: '\f286'; +} + +.fa-usb:before { + content: '\f287'; +} + +.fa-product-hunt:before { + content: '\f288'; +} + +.fa-mixcloud:before { + content: '\f289'; +} + +.fa-scribd:before { + content: '\f28a'; +} + +.fa-pause-circle:before { + content: '\f28b'; +} + +.fa-pause-circle-o:before { + content: '\f28c'; +} + +.fa-stop-circle:before { + content: '\f28d'; +} + +.fa-stop-circle-o:before { + content: '\f28e'; +} + +.fa-shopping-bag:before { + content: '\f290'; +} + +.fa-shopping-basket:before { + content: '\f291'; +} + +.fa-hashtag:before { + content: '\f292'; +} + +.fa-bluetooth:before { + content: '\f293'; +} + +.fa-bluetooth-b:before { + content: '\f294'; +} + +.fa-percent:before { + content: '\f295'; +} + +.fa-gitlab:before { + content: '\f296'; +} + +.fa-wpbeginner:before { + content: '\f297'; +} + +.fa-wpforms:before { + content: '\f298'; +} + +.fa-envira:before { + content: '\f299'; +} + +.fa-universal-access:before { + content: '\f29a'; +} + +.fa-wheelchair-alt:before { + content: '\f29b'; +} + +.fa-question-circle-o:before { + content: '\f29c'; +} + +.fa-blind:before { + content: '\f29d'; +} + +.fa-audio-description:before { + content: '\f29e'; +} + +.fa-volume-control-phone:before { + content: '\f2a0'; +} + +.fa-braille:before { + content: '\f2a1'; +} + +.fa-assistive-listening-systems:before { + content: '\f2a2'; +} + +.fa-asl-interpreting:before, +.fa-american-sign-language-interpreting:before { + content: '\f2a3'; +} + +.fa-deafness:before, +.fa-hard-of-hearing:before, +.fa-deaf:before { + content: '\f2a4'; +} + +.fa-glide:before { + content: '\f2a5'; +} + +.fa-glide-g:before { + content: '\f2a6'; +} + +.fa-signing:before, +.fa-sign-language:before { + content: '\f2a7'; +} + +.fa-low-vision:before { + content: '\f2a8'; +} + +.fa-viadeo:before { + content: '\f2a9'; +} + +.fa-viadeo-square:before { + content: '\f2aa'; +} + +.fa-snapchat:before { + content: '\f2ab'; +} + +.fa-snapchat-ghost:before { + content: '\f2ac'; +} + +.fa-snapchat-square:before { + content: '\f2ad'; +} + +.fa-pied-piper:before { + content: '\f2ae'; +} + +.fa-first-order:before { + content: '\f2b0'; +} + +.fa-yoast:before { + content: '\f2b1'; +} + +.fa-themeisle:before { + content: '\f2b2'; +} + +.fa-google-plus-circle:before, +.fa-google-plus-official:before { + content: '\f2b3'; +} + +.fa-fa:before, +.fa-font-awesome:before { + content: '\f2b4'; +} + +.fa-handshake-o:before { + content: '\f2b5'; +} + +.fa-envelope-open:before { + content: '\f2b6'; +} + +.fa-envelope-open-o:before { + content: '\f2b7'; +} + +.fa-linode:before { + content: '\f2b8'; +} + +.fa-address-book:before { + content: '\f2b9'; +} + +.fa-address-book-o:before { + content: '\f2ba'; +} + +.fa-vcard:before, +.fa-address-card:before { + content: '\f2bb'; +} + +.fa-vcard-o:before, +.fa-address-card-o:before { + content: '\f2bc'; +} + +.fa-user-circle:before { + content: '\f2bd'; +} + +.fa-user-circle-o:before { + content: '\f2be'; +} + +.fa-user-o:before { + content: '\f2c0'; +} + +.fa-id-badge:before { + content: '\f2c1'; +} + +.fa-drivers-license:before, +.fa-id-card:before { + content: '\f2c2'; +} + +.fa-drivers-license-o:before, +.fa-id-card-o:before { + content: '\f2c3'; +} + +.fa-quora:before { + content: '\f2c4'; +} + +.fa-free-code-camp:before { + content: '\f2c5'; +} + +.fa-telegram:before { + content: '\f2c6'; +} + +.fa-thermometer-4:before, +.fa-thermometer:before, +.fa-thermometer-full:before { + content: '\f2c7'; +} + +.fa-thermometer-3:before, +.fa-thermometer-three-quarters:before { + content: '\f2c8'; +} + +.fa-thermometer-2:before, +.fa-thermometer-half:before { + content: '\f2c9'; +} + +.fa-thermometer-1:before, +.fa-thermometer-quarter:before { + content: '\f2ca'; +} + +.fa-thermometer-0:before, +.fa-thermometer-empty:before { + content: '\f2cb'; +} + +.fa-shower:before { + content: '\f2cc'; +} + +.fa-bathtub:before, +.fa-s15:before, +.fa-bath:before { + content: '\f2cd'; +} + +.fa-podcast:before { + content: '\f2ce'; +} + +.fa-window-maximize:before { + content: '\f2d0'; +} + +.fa-window-minimize:before { + content: '\f2d1'; +} + +.fa-window-restore:before { + content: '\f2d2'; +} + +.fa-times-rectangle:before, +.fa-window-close:before { + content: '\f2d3'; +} + +.fa-times-rectangle-o:before, +.fa-window-close-o:before { + content: '\f2d4'; +} + +.fa-bandcamp:before { + content: '\f2d5'; +} + +.fa-grav:before { + content: '\f2d6'; +} + +.fa-etsy:before { + content: '\f2d7'; +} + +.fa-imdb:before { + content: '\f2d8'; +} + +.fa-ravelry:before { + content: '\f2d9'; +} + +.fa-eercast:before { + content: '\f2da'; +} + +.fa-microchip:before { + content: '\f2db'; +} + +.fa-snowflake-o:before { + content: '\f2dc'; +} + +.fa-superpowers:before { + content: '\f2dd'; +} + +.fa-wpexplorer:before { + content: '\f2de'; +} + +.fa-meetup:before { + content: '\f2e0'; +} + +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} + +.sr-only-focusable:active, +.sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; +} diff --git a/public/theme/FontAwesome/fonts/FontAwesome.otf b/public/theme/FontAwesome/fonts/FontAwesome.otf new file mode 100644 index 0000000..401ec0f Binary files /dev/null and b/public/theme/FontAwesome/fonts/FontAwesome.otf differ diff --git a/public/theme/FontAwesome/fonts/fontawesome-webfont.eot b/public/theme/FontAwesome/fonts/fontawesome-webfont.eot new file mode 100644 index 0000000..e9f60ca Binary files /dev/null and b/public/theme/FontAwesome/fonts/fontawesome-webfont.eot differ diff --git a/public/theme/FontAwesome/fonts/fontawesome-webfont.svg b/public/theme/FontAwesome/fonts/fontawesome-webfont.svg new file mode 100644 index 0000000..855c845 --- /dev/null +++ b/public/theme/FontAwesome/fonts/fontawesome-webfont.svg @@ -0,0 +1,2671 @@ + + + + +Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 + By ,,, +Copyright Dave Gandy 2016. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/theme/FontAwesome/fonts/fontawesome-webfont.ttf b/public/theme/FontAwesome/fonts/fontawesome-webfont.ttf new file mode 100644 index 0000000..35acda2 Binary files /dev/null and b/public/theme/FontAwesome/fonts/fontawesome-webfont.ttf differ diff --git a/public/theme/FontAwesome/fonts/fontawesome-webfont.woff b/public/theme/FontAwesome/fonts/fontawesome-webfont.woff new file mode 100644 index 0000000..400014a Binary files /dev/null and b/public/theme/FontAwesome/fonts/fontawesome-webfont.woff differ diff --git a/public/theme/FontAwesome/fonts/fontawesome-webfont.woff2 b/public/theme/FontAwesome/fonts/fontawesome-webfont.woff2 new file mode 100644 index 0000000..4d13fc6 Binary files /dev/null and b/public/theme/FontAwesome/fonts/fontawesome-webfont.woff2 differ diff --git a/public/theme/css/chrome.css b/public/theme/css/chrome.css new file mode 100644 index 0000000..6eee18f --- /dev/null +++ b/public/theme/css/chrome.css @@ -0,0 +1,567 @@ +/* CSS for UI elements (a.k.a. chrome) */ + +@import 'variables.css'; + +html { + scrollbar-color: var(--scrollbar) var(--bg); + scrollbar-width: 25px; +} +#searchresults a, +.content a:link, +a:visited, +a > .hljs { + color: var(--links); +} + +/* + body-container is necessary because mobile browsers don't seem to like + overflow-x on the body tag when there is a tag. +*/ +#body-container { + /* + This is used when the sidebar pushes the body content off the side of + the screen on small screens. Without it, dragging on mobile Safari + will want to reposition the viewport in a weird way. + */ + overflow-x: clip; +} + +/* Menu Bar */ + +#menu-bar, +#menu-bar-hover-placeholder { + z-index: 101; + margin: auto calc(0px - var(--page-padding)); +} +#menu-bar { + position: relative; + display: flex; + flex-wrap: wrap; + background-color: var(--bg); + border-bottom-color: var(--bg); + border-bottom-width: 1px; + border-bottom-style: solid; +} +#menu-bar.sticky, +.js #menu-bar-hover-placeholder:hover + #menu-bar, +.js #menu-bar:hover, +.js.sidebar-visible #menu-bar { + position: -webkit-sticky; + position: sticky; + top: 0 !important; +} +#menu-bar-hover-placeholder { + position: sticky; + position: -webkit-sticky; + top: 0; + height: var(--menu-bar-height); +} +#menu-bar.bordered { + border-bottom-color: var(--table-border-color); +} +#menu-bar i, +#menu-bar .icon-button { + position: relative; + padding: 0 8px; + z-index: 10; + line-height: var(--menu-bar-height); + cursor: pointer; + transition: color 0.5s; +} +@media only screen and (max-width: 420px) { + #menu-bar i, + #menu-bar .icon-button { + padding: 0 5px; + } +} + +.icon-button { + border: none; + background: none; + padding: 0; + color: inherit; +} +.icon-button i { + margin: 0; +} + +.right-buttons { + margin: 0 15px; +} +.right-buttons a { + text-decoration: none; +} + +.left-buttons { + display: flex; + margin: 0 5px; +} +.no-js .left-buttons { + display: none; +} + +.menu-title { + display: inline-block; + font-weight: 200; + font-size: 2.4rem; + line-height: var(--menu-bar-height); + text-align: center; + margin: 0; + flex: 1; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.js .menu-title { + cursor: pointer; +} + +.menu-bar, +.menu-bar:visited, +.nav-chapters, +.nav-chapters:visited, +.mobile-nav-chapters, +.mobile-nav-chapters:visited, +.menu-bar .icon-button, +.menu-bar a i { + color: var(--icons); +} + +.menu-bar i:hover, +.menu-bar .icon-button:hover, +.nav-chapters:hover, +.mobile-nav-chapters i:hover { + color: var(--icons-hover); +} + +/* Nav Icons */ + +.nav-chapters { + font-size: 2.5em; + text-align: center; + text-decoration: none; + + position: fixed; + top: 0; + bottom: 0; + margin: 0; + max-width: 150px; + min-width: 90px; + + display: flex; + justify-content: center; + align-content: center; + flex-direction: column; + + transition: color 0.5s, background-color 0.5s; +} + +.nav-chapters:hover { + text-decoration: none; + background-color: var(--theme-hover); + transition: background-color 0.15s, color 0.15s; +} + +.nav-wrapper { + margin-top: 50px; + display: none; +} + +.mobile-nav-chapters { + font-size: 2.5em; + text-align: center; + text-decoration: none; + width: 90px; + border-radius: 5px; + background-color: var(--sidebar-bg); +} + +.previous { + float: left; +} + +.next { + float: right; + right: var(--page-padding); +} + +@media only screen and (max-width: 1080px) { + .nav-wide-wrapper { + display: none; + } + .nav-wrapper { + display: block; + } +} + +@media only screen and (max-width: 1380px) { + .sidebar-visible .nav-wide-wrapper { + display: none; + } + .sidebar-visible .nav-wrapper { + display: block; + } +} + +/* Inline code */ + +:not(pre) > .hljs { + display: inline; + padding: 0.1em 0.3em; + border-radius: 3px; +} + +:not(pre):not(a) > .hljs { + color: var(--inline-code-color); + overflow-x: initial; +} + +a:hover > .hljs { + text-decoration: underline; +} + +pre { + position: relative; +} +pre > .buttons { + position: absolute; + z-index: 100; + right: 0px; + top: 2px; + margin: 0px; + padding: 2px 0px; + + color: var(--sidebar-fg); + cursor: pointer; + visibility: hidden; + opacity: 0; + transition: visibility 0.1s linear, opacity 0.1s linear; +} +pre:hover > .buttons { + visibility: visible; + opacity: 1; +} +pre > .buttons :hover { + color: var(--sidebar-active); + border-color: var(--icons-hover); + background-color: var(--theme-hover); +} +pre > .buttons i { + margin-left: 8px; +} +pre > .buttons button { + cursor: inherit; + margin: 0px 5px; + padding: 3px 5px; + font-size: 14px; + + border-style: solid; + border-width: 1px; + border-radius: 4px; + border-color: var(--icons); + background-color: var(--theme-popup-bg); + transition: 100ms; + transition-property: color, border-color, background-color; + color: var(--icons); +} +@media (pointer: coarse) { + pre > .buttons button { + /* On mobile, make it easier to tap buttons. */ + padding: 0.3rem 1rem; + } +} +pre > code { + padding: 1rem; +} + +/* FIXME: ACE editors overlap their buttons because ACE does absolute + positioning within the code block which breaks padding. The only solution I + can think of is to move the padding to the outer pre tag (or insert a div + wrapper), but that would require fixing a whole bunch of CSS rules. +*/ +.hljs.ace_editor { + padding: 0rem 0rem; +} + +pre > .result { + margin-top: 10px; +} + +/* Search */ + +#searchresults a { + text-decoration: none; +} + +mark { + border-radius: 2px; + padding: 0 3px 1px 3px; + margin: 0 -3px -1px -3px; + background-color: var(--search-mark-bg); + transition: background-color 300ms linear; + cursor: pointer; +} + +mark.fade-out { + background-color: rgba(0, 0, 0, 0) !important; + cursor: auto; +} + +.searchbar-outer { + margin-left: auto; + margin-right: auto; + max-width: var(--content-max-width); +} + +#searchbar { + width: 100%; + margin: 5px auto 0px auto; + padding: 10px 16px; + transition: box-shadow 300ms ease-in-out; + border: 1px solid var(--searchbar-border-color); + border-radius: 3px; + background-color: var(--searchbar-bg); + color: var(--searchbar-fg); +} +#searchbar:focus, +#searchbar.active { + box-shadow: 0 0 3px var(--searchbar-shadow-color); +} + +.searchresults-header { + font-weight: bold; + font-size: 1em; + padding: 18px 0 0 5px; + color: var(--searchresults-header-fg); +} + +.searchresults-outer { + margin-left: auto; + margin-right: auto; + max-width: var(--content-max-width); + border-bottom: 1px dashed var(--searchresults-border-color); +} + +ul#searchresults { + list-style: none; + padding-left: 20px; +} +ul#searchresults li { + margin: 10px 0px; + padding: 2px; + border-radius: 2px; +} +ul#searchresults li.focus { + background-color: var(--searchresults-li-bg); +} +ul#searchresults span.teaser { + display: block; + clear: both; + margin: 5px 0 0 20px; + font-size: 0.8em; +} +ul#searchresults span.teaser em { + font-weight: bold; + font-style: normal; +} + +/* Sidebar */ + +.sidebar { + position: fixed; + left: 0; + top: 0; + bottom: 0; + width: var(--sidebar-width); + font-size: 0.875em; + box-sizing: border-box; + -webkit-overflow-scrolling: touch; + overscroll-behavior-y: contain; + background-color: var(--sidebar-bg); + color: var(--sidebar-fg); +} +.sidebar-resizing { + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; +} +.js:not(.sidebar-resizing) .sidebar { + transition: transform 0.3s; /* Animation: slide away */ +} +.sidebar code { + line-height: 2em; +} +.sidebar .sidebar-scrollbox { + overflow-y: auto; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + padding: 10px 10px; +} +.sidebar .sidebar-resize-handle { + position: absolute; + cursor: col-resize; + width: 0; + right: 0; + top: 0; + bottom: 0; +} +.js .sidebar .sidebar-resize-handle { + cursor: col-resize; + width: 5px; +} +.sidebar-hidden .sidebar { + transform: translateX(calc(0px - var(--sidebar-width))); +} +.sidebar::-webkit-scrollbar { + background: var(--sidebar-bg); + width: 25px; +} +.sidebar::-webkit-scrollbar-thumb { + background: var(--scrollbar); + width: 25px; +} + +.sidebar-visible .page-wrapper { + transform: translateX(var(--sidebar-width)); +} + +.page-wrapper { + min-height: 110vh; +} + +@media only screen and (min-width: 620px) { + .sidebar-visible .page-wrapper { + transform: none; + margin-left: var(--sidebar-width); + } +} + +.chapter { + list-style: none outside none; + padding-left: 0; + line-height: 2.2em; +} + +.chapter ol { + width: 100%; +} + +.chapter li { + display: flex; + color: var(--sidebar-non-existant); +} +.chapter li a { + display: block; + padding: 0; + text-decoration: none; + color: var(--sidebar-fg); +} + +.chapter li a:hover { + color: var(--sidebar-active); +} + +.chapter li a.active { + color: var(--sidebar-active); +} + +.chapter li > a.toggle { + cursor: pointer; + display: block; + margin-left: auto; + padding: 0 10px; + user-select: none; + opacity: 0.68; +} + +.chapter li > a.toggle div { + transition: transform 0.5s; +} + +/* collapse the section */ +.chapter li:not(.expanded) + li > ol { + display: none; +} + +.chapter li.chapter-item { + line-height: 1.5em; + margin-top: 0.6em; +} + +.chapter li.expanded > a.toggle div { + transform: rotate(90deg); +} + +.spacer { + width: 100%; + height: 3px; + margin: 5px 0px; +} +.chapter .spacer { + background-color: var(--sidebar-spacer); +} + +@media (-moz-touch-enabled: 1), (pointer: coarse) { + .chapter li a { + padding: 5px 0; + } + .spacer { + margin: 10px 0; + } +} + +.section { + list-style: none outside none; + padding-left: 20px; + line-height: 1.9em; +} + +/* Theme Menu Popup */ + +.theme-popup { + position: absolute; + left: 10px; + top: var(--menu-bar-height); + z-index: 1000; + border-radius: 4px; + font-size: 0.7em; + color: var(--fg); + background: var(--theme-popup-bg); + border: 1px solid var(--theme-popup-border); + margin: 0; + padding: 0; + list-style: none; + display: none; + /* Don't let the children's background extend past the rounded corners. */ + overflow: hidden; +} +.theme-popup .default { + color: var(--icons); +} +.theme-popup .theme { + width: 100%; + border: 0; + margin: 0; + padding: 2px 20px; + line-height: 25px; + white-space: nowrap; + text-align: left; + cursor: pointer; + color: inherit; + background: inherit; + font-size: inherit; +} +.theme-popup .theme:hover { + background-color: var(--theme-hover); +} + +.theme-selected::before { + display: inline-block; + content: '✓'; + margin-left: -14px; + width: 14px; +} diff --git a/public/theme/css/general.css b/public/theme/css/general.css new file mode 100644 index 0000000..7ca2f11 --- /dev/null +++ b/public/theme/css/general.css @@ -0,0 +1,395 @@ +/* Base styles and content styles */ + +@import 'variables.css'; + +:root { + /* Browser default font-size is 16px, this way 1 rem = 10px */ + font-size: 62.5%; + color-scheme: var(--color-scheme); +} + +html { + font-family: 'Open Sans', sans-serif; + color: var(--fg); + background-color: var(--bg); + text-size-adjust: none; + -webkit-text-size-adjust: none; +} + +body { + margin: 0; + font-size: 1.6rem; + overflow-x: auto; +} + +code { + font-family: var(--mono-font) !important; + font-size: var(--code-font-size); +} + +/* make long words/inline code not x overflow */ +main { + overflow-wrap: break-word; +} + +/* make wide tables scroll if they overflow */ +.table-wrapper { + overflow-x: auto; +} + +/* Don't change font size in headers. */ +h1 code, +h2 code, +h3 code, +h4 code, +h5 code, +h6 code { + font-size: unset; +} + +.left { + float: left; +} +.right { + float: right; +} +.boring { + opacity: 0.6; +} +.hide-boring .boring { + display: none; +} +.hidden { + display: none !important; +} + +h2, +h3 { + margin-top: 2.5em; +} +h4, +h5 { + margin-top: 2em; +} + +.header + .header h3, +.header + .header h4, +.header + .header h5 { + margin-top: 1em; +} + +h1:target::before, +h2:target::before, +h3:target::before, +h4:target::before, +h5:target::before, +h6:target::before { + display: inline-block; + content: '»'; + margin-left: -30px; + width: 30px; +} + +/* This is broken on Safari as of version 14, but is fixed + in Safari Technology Preview 117 which I think will be Safari 14.2. + https://bugs.webkit.org/show_bug.cgi?id=218076 +*/ +:target { + scroll-margin-top: calc(var(--menu-bar-height) + 0.5em); +} + +.page { + outline: 0; + padding: 0 var(--page-padding); + margin-top: calc( + 0px - var(--menu-bar-height) + ); /* Compensate for the #menu-bar-hover-placeholder */ +} +.page-wrapper { + box-sizing: border-box; +} +.js:not(.sidebar-resizing) .page-wrapper { + transition: + margin-left 0.3s ease, + transform 0.3s ease; /* Animation: slide away */ +} + +.content { + overflow-y: auto; + padding: 0 5px 50px 5px; +} +.content main { + margin-left: auto; + margin-right: auto; + max-width: var(--content-max-width); +} +.content p { + line-height: 1.45em; +} +.content ol { + line-height: 1.45em; +} +.content ul { + line-height: 1.45em; +} +.content a { + text-decoration: none; +} +.content a:hover { + text-decoration: underline; +} +.content img, +.content video { + max-width: 100%; +} +.content .header:link, +.content .header:visited { + color: var(--fg); +} +.content .header:link, +.content .header:visited:hover { + text-decoration: none; +} + +table { + margin: 0 auto; + border-collapse: collapse; +} +table td { + padding: 3px 20px; + border: 1px var(--table-border-color) solid; +} +table thead { + background: var(--table-header-bg); +} +table thead td { + font-weight: 700; + border: none; +} +table thead th { + padding: 3px 20px; +} +table thead tr { + border: 1px var(--table-header-bg) solid; +} +/* Alternate background colors for rows */ +table tbody tr:nth-child(2n) { + background: var(--table-alternate-bg); +} + +blockquote { + margin: 20px 0; + padding: 0 20px; + color: var(--fg); + background-color: var(--quote-bg); + border-top: 0.1em solid var(--quote-border); + border-bottom: 0.1em solid var(--quote-border); +} + +kbd { + background-color: var(--table-border-color); + border-radius: 4px; + border: solid 1px var(--theme-popup-border); + box-shadow: inset 0 -1px 0 var(--theme-hover); + display: inline-block; + font-size: var(--code-font-size); + font-family: var(--mono-font); + line-height: 10px; + padding: 4px 5px; + vertical-align: middle; +} + +:not(.footnote-definition) + .footnote-definition, +.footnote-definition + :not(.footnote-definition) { + margin-top: 2em; +} +.footnote-definition { + font-size: 0.9em; + margin: 0.5em 0; +} +.footnote-definition p { + display: inline; +} + +.tooltiptext { + position: absolute; + visibility: hidden; + color: #fff; + background-color: #333; + transform: translateX(-50%); /* Center by moving tooltip 50% of its width left */ + left: -8px; /* Half of the width of the icon */ + top: -35px; + font-size: 0.8em; + text-align: center; + border-radius: 6px; + padding: 5px 8px; + margin: 5px; + z-index: 1000; +} +.tooltipped .tooltiptext { + visibility: visible; +} + +.chapter li.part-title { + color: var(--sidebar-fg); + margin: 5px 0px; + font-weight: bold; +} + +.result-no-output { + font-style: italic; +} + +.typst-dom-page { + width: var(--data-page-width, 100%); + height: var(--data-page-height); + --data-text-width: 1px; + --data-text-height: 1px; + margin: auto; +} + +.typst-back-canvas { + position: absolute; + z-index: -1; + width: var(--data-page-width, 100%); + height: var(--data-page-height); + pointer-events: none; +} + +.typst-svg-page { + position: absolute; + z-index: 0; + width: var(--data-page-width, 100%); + height: var(--data-page-height); +} + +.typst-html-semantics { + position: absolute; + z-index: 2; + width: var(--data-page-width, 100%); + height: var(--data-page-height); + color: transparent; + font-family: monospace; + white-space: pre; +} + +.typst-html-semantics span { + color: transparent; + font-family: monospace; + transform-origin: left top; + position: absolute; + display: inline-block; + left: 0; + top: 0; +} + +.typst-content-hint { + position: absolute; + display: inline-block; + width: 1px; + height: 1px; + overflow: hidden; +} + +.typst-html-semantics a { + position: absolute; + display: inline-block; +} + +/* set transparent itself */ +.typst-content-group { + pointer-events: visible; +} + +.typst-html-semantics span::-moz-selection { + color: transparent; + background: #7db9dea0; +} + +.typst-html-semantics span::selection { + color: transparent; + background: #7db9dea0; +} + +.typst-html-semantics *::-moz-selection { + color: transparent; + background: transparent; +} + +.typst-html-semantics *::selection { + color: transparent; + background: transparent; +} + +.typst-content-fallback { + color: transparent; + background: transparent; +} + +.pseudo-link, +.typst-text { + pointer-events: none; +} +.typst-svg-page { + fill: none; +} +.outline_glyph path, +path.outline_glyph { + fill: var(--glyph_fill); + stroke: var(--glyph_stroke); +} + +.outline_glyph path, +path.outline_glyph { + transition: 0.2s fill stroke; +} + +.hover .typst-text { + --glyph_fill: #66bab7; + --glyph_stroke: #66bab7; +} + +.typst-jump-ripple, +.typst-debug-react-ripple { + width: 0; + height: 0; + background-color: transparent; + position: absolute; + border-radius: 50%; +} +.typst-jump-ripple { + border: 1px solid #66bab7; +} +.typst-debug-react-ripple { + border: 1px solid #cb1b45; +} +@keyframes typst-jump-ripple-effect { + to { + width: 10vw; + height: 10vw; + opacity: 0.01; + margin: -5vw; + } +} +@keyframes typst-debug-react-ripple-effect { + to { + width: 3vw; + height: 3vw; + opacity: 0.01; + margin: -1.5vw; + } +} + +.focus .typst-text { + --glyph_fill: var(--sidebar-active); +} + +a.focus { + /* todo: remove !important */ + color: var(--sidebar-active) !important; +} + +.focus .typst-text, a.focus { + transition: 0.1s; + transition-property: fill, stroke, color; +} \ No newline at end of file diff --git a/public/theme/css/print.css b/public/theme/css/print.css new file mode 100644 index 0000000..27d05e9 --- /dev/null +++ b/public/theme/css/print.css @@ -0,0 +1,46 @@ + +#sidebar, +#menu-bar, +.nav-chapters, +.mobile-nav-chapters { + display: none; +} + +#page-wrapper.page-wrapper { + transform: none; + margin-left: 0px; + overflow-y: initial; +} + +#content { + max-width: none; + margin: 0; + padding: 0; +} + +.page { + overflow-y: initial; +} + +pre > .buttons { + z-index: 2; +} + +a, a:visited, a:active, a:hover { + color: #4183c4; + text-decoration: none; +} + +h1, h2, h3, h4, h5, h6 { + page-break-inside: avoid; + page-break-after: avoid; +} + +pre, code { + page-break-inside: avoid; + white-space: pre-wrap; +} + +.fa { + display: none !important; +} diff --git a/public/theme/css/variables.css b/public/theme/css/variables.css new file mode 100644 index 0000000..d194b59 --- /dev/null +++ b/public/theme/css/variables.css @@ -0,0 +1,265 @@ +/* Globals */ + +:root { + --sidebar-width: min(300px, max(23.6vw, 200px)); + --page-padding: 15px; + --content-max-width: 750px; + --menu-bar-height: 50px; + --mono-font: 'Source Code Pro', Consolas, 'Ubuntu Mono', Menlo, 'DejaVu Sans Mono', monospace, + monospace; + --code-font-size: 0.875em; /* please adjust the ace font size accordingly in editor.js */ +} + +/* Themes */ + +.ayu { + --bg: hsl(210, 25%, 8%); + --fg: #c5c5c5; + + --sidebar-bg: #14191f; + --sidebar-fg: #c8c9db; + --sidebar-non-existant: #5c6773; + --sidebar-active: #ffb454; + --sidebar-spacer: #2d334f; + + --scrollbar: var(--sidebar-fg); + + --icons: #737480; + --icons-hover: #b7b9cc; + + --links: #0096cf; + + --inline-code-color: #ffb454; + + --theme-popup-bg: #14191f; + --theme-popup-border: #5c6773; + --theme-hover: #191f26; + + --quote-bg: hsl(226, 15%, 17%); + --quote-border: hsl(226, 15%, 22%); + + --table-border-color: hsl(210, 25%, 13%); + --table-header-bg: hsl(210, 25%, 28%); + --table-alternate-bg: hsl(210, 25%, 11%); + + --searchbar-border-color: #848484; + --searchbar-bg: #424242; + --searchbar-fg: #fff; + --searchbar-shadow-color: #d4c89f; + --searchresults-header-fg: #666; + --searchresults-border-color: #888; + --searchresults-li-bg: #252932; + --search-mark-bg: #e3b171; + + --color-scheme: dark; +} + +.coal { + --bg: hsl(200, 7%, 8%); + --fg: #98a3ad; + + --sidebar-bg: #292c2f; + --sidebar-fg: #a1adb8; + --sidebar-non-existant: #505254; + --sidebar-active: #3473ad; + --sidebar-spacer: #393939; + + --scrollbar: var(--sidebar-fg); + + --icons: #43484d; + --icons-hover: #b3c0cc; + + --links: #2b79a2; + + --inline-code-color: #c5c8c6; + + --theme-popup-bg: #141617; + --theme-popup-border: #43484d; + --theme-hover: #1f2124; + + --quote-bg: hsl(234, 21%, 18%); + --quote-border: hsl(234, 21%, 23%); + + --table-border-color: hsl(200, 7%, 13%); + --table-header-bg: hsl(200, 7%, 28%); + --table-alternate-bg: hsl(200, 7%, 11%); + + --searchbar-border-color: #aaa; + --searchbar-bg: #b7b7b7; + --searchbar-fg: #000; + --searchbar-shadow-color: #aaa; + --searchresults-header-fg: #666; + --searchresults-border-color: #98a3ad; + --searchresults-li-bg: #2b2b2f; + --search-mark-bg: #355c7d; + + --color-scheme: dark; +} + +.light { + --bg: hsl(0, 0%, 100%); + --fg: hsl(0, 0%, 0%); + + --sidebar-bg: #fafafa; + --sidebar-fg: hsl(0, 0%, 0%); + --sidebar-non-existant: #aaaaaa; + --sidebar-active: #1f1fff; + --sidebar-spacer: #f4f4f4; + + --scrollbar: #8f8f8f; + + --icons: #747474; + --icons-hover: #000000; + + --links: #20609f; + + --inline-code-color: #301900; + + --theme-popup-bg: #fafafa; + --theme-popup-border: #cccccc; + --theme-hover: #e6e6e6; + + --quote-bg: hsl(197, 37%, 96%); + --quote-border: hsl(197, 37%, 91%); + + --table-border-color: hsl(0, 0%, 95%); + --table-header-bg: hsl(0, 0%, 80%); + --table-alternate-bg: hsl(0, 0%, 97%); + + --searchbar-border-color: #aaa; + --searchbar-bg: #fafafa; + --searchbar-fg: #000; + --searchbar-shadow-color: #aaa; + --searchresults-header-fg: #666; + --searchresults-border-color: #888; + --searchresults-li-bg: #e4f2fe; + --search-mark-bg: #a2cff5; + + --color-scheme: light; +} + +.navy { + --bg: hsl(226, 23%, 11%); + --fg: #bcbdd0; + + --sidebar-bg: #282d3f; + --sidebar-fg: #c8c9db; + --sidebar-non-existant: #505274; + --sidebar-active: #2b79a2; + --sidebar-spacer: #2d334f; + + --scrollbar: var(--sidebar-fg); + + --icons: #737480; + --icons-hover: #b7b9cc; + + --links: #2b79a2; + + --inline-code-color: #c5c8c6; + + --theme-popup-bg: #161923; + --theme-popup-border: #737480; + --theme-hover: #282e40; + + --quote-bg: hsl(226, 15%, 17%); + --quote-border: hsl(226, 15%, 22%); + + --table-border-color: hsl(226, 23%, 16%); + --table-header-bg: hsl(226, 23%, 31%); + --table-alternate-bg: hsl(226, 23%, 14%); + + --searchbar-border-color: #aaa; + --searchbar-bg: #aeaec6; + --searchbar-fg: #000; + --searchbar-shadow-color: #aaa; + --searchresults-header-fg: #5f5f71; + --searchresults-border-color: #5c5c68; + --searchresults-li-bg: #242430; + --search-mark-bg: #a2cff5; + + --color-scheme: dark; +} + +.rust { + --bg: hsl(60, 9%, 87%); + --fg: #262625; + + --sidebar-bg: #3b2e2a; + --sidebar-fg: #c8c9db; + --sidebar-non-existant: #505254; + --sidebar-active: #e69f67; + --sidebar-spacer: #45373a; + + --scrollbar: var(--sidebar-fg); + + --icons: #737480; + --icons-hover: #262625; + + --links: #2b79a2; + + --inline-code-color: #6e6b5e; + + --theme-popup-bg: #e1e1db; + --theme-popup-border: #b38f6b; + --theme-hover: #99908a; + + --quote-bg: hsl(60, 5%, 75%); + --quote-border: hsl(60, 5%, 70%); + + --table-border-color: hsl(60, 9%, 82%); + --table-header-bg: #b3a497; + --table-alternate-bg: hsl(60, 9%, 84%); + + --searchbar-border-color: #aaa; + --searchbar-bg: #fafafa; + --searchbar-fg: #000; + --searchbar-shadow-color: #aaa; + --searchresults-header-fg: #666; + --searchresults-border-color: #888; + --searchresults-li-bg: #dec2a2; + --search-mark-bg: #e69f67; + + --color-scheme: light; +} + +@media (prefers-color-scheme: dark) { + .light.no-js { + --bg: hsl(200, 7%, 8%); + --fg: #98a3ad; + + --sidebar-bg: #292c2f; + --sidebar-fg: #a1adb8; + --sidebar-non-existant: #505254; + --sidebar-active: #3473ad; + --sidebar-spacer: #393939; + + --scrollbar: var(--sidebar-fg); + + --icons: #43484d; + --icons-hover: #b3c0cc; + + --links: #2b79a2; + + --inline-code-color: #c5c8c6; + + --theme-popup-bg: #141617; + --theme-popup-border: #43484d; + --theme-hover: #1f2124; + + --quote-bg: hsl(234, 21%, 18%); + --quote-border: hsl(234, 21%, 23%); + + --table-border-color: hsl(200, 7%, 13%); + --table-header-bg: hsl(200, 7%, 28%); + --table-alternate-bg: hsl(200, 7%, 11%); + + --searchbar-border-color: #aaa; + --searchbar-bg: #b7b7b7; + --searchbar-fg: #000; + --searchbar-shadow-color: #aaa; + --searchresults-header-fg: #666; + --searchresults-border-color: #98a3ad; + --searchresults-li-bg: #2b2b2f; + --search-mark-bg: #355c7d; + } +} diff --git a/public/theme/index.js b/public/theme/index.js new file mode 100644 index 0000000..3c46e06 --- /dev/null +++ b/public/theme/index.js @@ -0,0 +1,270 @@ +(function themes() { + var html = document.querySelector('html'); + var themeToggleButton = document.getElementById('theme-toggle'); + var themePopup = document.getElementById('theme-list'); + var themeColorMetaTag = document.querySelector('meta[name="theme-color"]'); + + function showThemes() { + themePopup.style.display = 'block'; + themeToggleButton.setAttribute('aria-expanded', true); + themePopup.querySelector('button#' + get_theme()).focus(); + } + + function updateThemeSelected() { + themePopup.querySelectorAll('.theme-selected').forEach(function (el) { + el.classList.remove('theme-selected'); + }); + themePopup.querySelector('button#' + get_theme()).classList.add('theme-selected'); + window.typstChangeTheme(); + } + + function hideThemes() { + themePopup.style.display = 'none'; + themeToggleButton.setAttribute('aria-expanded', false); + themeToggleButton.focus(); + } + + function get_theme() { + var theme; + try { + theme = localStorage.getItem('shiroa-theme'); + } catch (e) {} + if (theme === null || theme === undefined) { + return default_theme; + } else { + return theme; + } + } + + function set_theme(theme, store = true) { + setTimeout(function () { + themeColorMetaTag.content = getComputedStyle(document.documentElement).backgroundColor; + }, 1); + + var previousTheme = get_theme(); + + if (store) { + try { + localStorage.setItem('shiroa-theme', theme); + } catch (e) {} + } + + html.classList.remove(previousTheme); + html.classList.add(theme); + updateThemeSelected(); + } + + // Set theme + var theme = get_theme(); + set_theme(theme, false); + + themeToggleButton.addEventListener('click', function () { + if (themePopup.style.display === 'block') { + hideThemes(); + } else { + showThemes(); + } + }); + + themePopup.addEventListener('click', function (e) { + var theme; + if (e.target.className === 'theme') { + theme = e.target.id; + } else if (e.target.parentElement.className === 'theme') { + theme = e.target.parentElement.id; + } else { + return; + } + set_theme(theme); + }); + + themePopup.addEventListener('focusout', function (e) { + // e.relatedTarget is null in Safari and Firefox on macOS (see workaround below) + if ( + !!e.relatedTarget && + !themeToggleButton.contains(e.relatedTarget) && + !themePopup.contains(e.relatedTarget) + ) { + hideThemes(); + } + }); + + // Should not be needed, but it works around an issue on macOS & iOS: https://github.com/rust-lang/mdBook/issues/628 + document.addEventListener('click', function (e) { + if ( + themePopup.style.display === 'block' && + !themeToggleButton.contains(e.target) && + !themePopup.contains(e.target) + ) { + hideThemes(); + } + }); + + document.addEventListener('keydown', function (e) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return; + } + if (!themePopup.contains(e.target)) { + return; + } + + switch (e.key) { + case 'Escape': + e.preventDefault(); + hideThemes(); + break; + case 'ArrowUp': + e.preventDefault(); + var li = document.activeElement.parentElement; + if (li && li.previousElementSibling) { + li.previousElementSibling.querySelector('button').focus(); + } + break; + case 'ArrowDown': + e.preventDefault(); + var li = document.activeElement.parentElement; + if (li && li.nextElementSibling) { + li.nextElementSibling.querySelector('button').focus(); + } + break; + case 'Home': + e.preventDefault(); + themePopup.querySelector('li:first-child button').focus(); + break; + case 'End': + e.preventDefault(); + themePopup.querySelector('li:last-child button').focus(); + break; + } + }); +})(); + +(function sidebar() { + var html = document.querySelector('html'); + var sidebar = document.getElementById('sidebar'); + var sidebarLinks = document.querySelectorAll('#sidebar a'); + var sidebarToggleButton = document.getElementById('sidebar-toggle'); + var sidebarResizeHandle = document.getElementById('sidebar-resize-handle'); + var firstContact = null; + + sidebar.addEventListener('transitionend', () => { + window.typstRerender(true); + }); + + function showSidebar() { + html.classList.remove('sidebar-hidden'); + html.classList.add('sidebar-visible'); + Array.from(sidebarLinks).forEach(function (link) { + link.setAttribute('tabIndex', 0); + }); + sidebarToggleButton.setAttribute('aria-expanded', true); + sidebar.setAttribute('aria-hidden', false); + try { + localStorage.setItem('shiroa-sidebar', 'visible'); + } catch (e) {} + } + + var sidebarAnchorToggles = document.querySelectorAll('#sidebar a.toggle'); + + function toggleSection(ev) { + ev.currentTarget.parentElement.classList.toggle('expanded'); + } + + Array.from(sidebarAnchorToggles).forEach(function (el) { + el.addEventListener('click', toggleSection); + }); + + function hideSidebar() { + html.classList.remove('sidebar-visible'); + html.classList.add('sidebar-hidden'); + Array.from(sidebarLinks).forEach(function (link) { + link.setAttribute('tabIndex', -1); + }); + sidebarToggleButton.setAttribute('aria-expanded', false); + sidebar.setAttribute('aria-hidden', true); + try { + localStorage.setItem('shiroa-sidebar', 'hidden'); + } catch (e) {} + } + + // Toggle sidebar + sidebarToggleButton.addEventListener('click', function sidebarToggle() { + if (html.classList.contains('sidebar-hidden')) { + var current_width = parseInt( + document.documentElement.style.getPropertyValue('--sidebar-width'), + 10, + ); + if (current_width < 150) { + document.documentElement.style.setProperty('--sidebar-width', '150px'); + } + showSidebar(); + } else if (html.classList.contains('sidebar-visible')) { + hideSidebar(); + } else { + if (getComputedStyle(sidebar)['transform'] === 'none') { + hideSidebar(); + } else { + showSidebar(); + } + } + }); + + sidebarResizeHandle.addEventListener('mousedown', initResize, false); + + function initResize(e) { + window.addEventListener('mousemove', resize, false); + window.addEventListener('mouseup', stopResize, false); + html.classList.add('sidebar-resizing'); + } + function resize(e) { + window.typstRerender(true); + var pos = e.clientX - sidebar.offsetLeft; + if (pos < 20) { + hideSidebar(); + } else { + if (html.classList.contains('sidebar-hidden')) { + showSidebar(); + } + pos = Math.min(pos, window.innerWidth - 100); + document.documentElement.style.setProperty('--sidebar-width', pos + 'px'); + } + } + //on mouseup remove windows functions mousemove & mouseup + function stopResize(e) { + window.typstRerender(false); + html.classList.remove('sidebar-resizing'); + window.removeEventListener('mousemove', resize, false); + window.removeEventListener('mouseup', stopResize, false); + } + + document.addEventListener( + 'touchstart', + function (e) { + firstContact = { + x: e.touches[0].clientX, + time: Date.now(), + }; + }, + { passive: true }, + ); + + document.addEventListener( + 'touchmove', + function (e) { + if (!firstContact) return; + + var curX = e.touches[0].clientX; + var xDiff = curX - firstContact.x, + tDiff = Date.now() - firstContact.time; + + if (tDiff < 250 && Math.abs(xDiff) >= 150) { + if (xDiff >= 0 && firstContact.x < Math.min(document.body.clientWidth * 0.25, 300)) + showSidebar(); + else if (xDiff < 0 && curX < 300) hideSidebar(); + + firstContact = null; + } + }, + { passive: true }, + ); +})();