text
stringlengths 1
22.8M
|
|---|
```makefile
################################################################################
#
# getent
#
################################################################################
# source included in Buildroot
GETENT_SOURCE =
GETENT_VERSION = buildroot-$(BR2_VERSION)
GETENT_LICENSE = LGPLv2.1+
# For glibc toolchains, we use the getent program built/installed by
# the C library. For other toolchains, we use the wrapper script
# included in this package.
ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),y)
# Sourcery toolchains install it in sysroot/usr/lib/bin
# Buildroot toolchains install it in sysroot/usr/bin
GETENT_LOCATION = $(firstword $(wildcard \
$(STAGING_DIR)/usr/bin/getent \
$(STAGING_DIR)/usr/lib/bin/getent))
else
GETENT_LOCATION = package/getent/getent
endif
define GETENT_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0755 $(GETENT_LOCATION) $(TARGET_DIR)/usr/bin/getent
endef
$(eval $(generic-package))
```
|
Liane Lippert (born 13 January 1998) is a German cyclist, who currently rides for UCI Women's WorldTeam .
Career
Born in Friedrichshafen, Lippert started her career in local club RSV Seerose Friedrichshafen in 2008. In the following years she won the U15 mountain category at Germany's former greatest mountain time track Lightweight Uphill. Since 2013 Lippert was nominated in the German squad until she got her first professional contract. She won the European junior road championship in 2016.
Lippert joined in 2017 and achieved her first victory at UCI Women's World Tour level in the 2020 Cadel Evans Great Ocean Road Race.
Major results
2016
1st Road race, UEC European Junior Road Championships
6th Overall Trophée d'Or Féminin
2017
9th Overall Lotto Belgium Tour
2018
1st Road race, National Road Championships
1st Overall Lotto Belgium Tour
4th Overall Tour de Yorkshire
6th Overall Thüringen Tour
1st Young rider classification
2020
1st Cadel Evans Great Ocean Road Race
2nd Overall Tour Down Under
2nd Brabantse Pijl
2021
2nd Road race, UEC European Road Championships
4th Overall Thüringen Tour
5th Overall Challenge by La Vuelta
8th La Course by Le Tour de France
2022
1st Road race, National Road Championships
3rd Amstel Gold Race
3rd Brabantse Pijl
4th Overall Tour de Romandie
1st Young rider classification
4th Road race, UCI Road World Championships
7th La Flèche Wallonne
8th Liège–Bastogne–Liège
2023
1st Road race, National Road Championships
1st Stage 2 Tour de France
2nd La Flèche Wallonne
7th Road race, UEC European Road Championships
7th Strade Bianche
References
External links
1998 births
Living people
German female cyclists
People from Friedrichshafen
Sportspeople from Tübingen (region)
European Games competitors for Germany
Cyclists at the 2019 European Games
Olympic cyclists for Germany
Cyclists at the 2020 Summer Olympics
Cyclists from Baden-Württemberg
21st-century German women
21st-century German people
|
The Global Wind Energy Council (GWEC) was established in 2005 to provide a credible and representative forum for the entire wind energy sector at an international level. GWEC’s mission is to ensure that wind power is established as one of the world’s leading energy sources, providing substantial environmental and economic benefits.
A new report launched by the Global Wind Energy Council predicts that, despite temporary supply chain difficulties, international wind markets are set to continue their strong growth. In 2006, total installed wind power capacity increased by 25% globally, generating some €18 billion (US$23 billion) worth of new generating equipment and bringing global wind power capacity up to more than 74GW. While the European Union is still the leading market in wind energy with over 48GW of installed capacity, other continents such as North America and Asia are developing quickly.
See also
World Wind Energy Association (WWEA)
List of large wind farms
Wind power in Denmark
Wind power in Germany
Wind power in Iran
Wind power in the United States
Climate change
Global warming
American Wind Energy Association
List of notable renewable energy organizations
References
External links
Official website GWEC
Global Wind Power Generated Record Year in 2006
Global wind 2006 report
GWEC Says Wind Boom will Continue
Global Wind Energy
bb
International renewable energy organizations
Wind power
|
```kotlin
package splitties.views.recyclerview.compose
import androidx.compose.foundation.focusable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import splitties.experimental.InternalSplittiesApi
import splitties.views.dsl.recyclerview.SingleViewAdapter
import splitties.views.dsl.recyclerview.recyclerView
import splitties.views.recyclerview.compose.genericmotionevent.LocalGenericMotionEventDispatcher
import splitties.views.recyclerview.compose.hack.RunWithViewUntilCancelled
import splitties.views.recyclerview.compose.hack.rememberViewFactory
@Composable
fun ColumnWithRecyclerViewScroll(
modifier: Modifier = Modifier,
verticalArrangement: Arrangement.Vertical = Arrangement.Top,
horizontalAlignment: Alignment.Horizontal = Alignment.Start,
focusRequester: FocusRequester = remember { FocusRequester() },
requestFocus: Boolean = true,
columnContentPadding: PaddingValues = PaddingValues(0.dp),
contentPadding: PaddingValues = PaddingValues(0.dp),
content: @Composable() (ColumnScope.() -> Unit)
) {
val context = LocalContext.current
val composeView = remember { ComposeView(context) }
@OptIn(InternalSplittiesApi::class)
val adapter = remember {
SingleViewAdapter(composeView, vertical = true)
}
DisposableEffect(content as Any) {
composeView.setContent {
Column(
modifier = Modifier.padding(columnContentPadding),
verticalArrangement = verticalArrangement,
horizontalAlignment = horizontalAlignment,
content = content
)
}
onDispose {}
}
val paddingLeft: Int
val paddingTop: Int
val paddingRight: Int
val paddingBottom: Int
with(LocalDensity.current) {
val ld = LocalLayoutDirection.current
paddingLeft = contentPadding.calculateLeftPadding(ld).roundToPx()
paddingTop = contentPadding.calculateTopPadding().roundToPx()
paddingRight = contentPadding.calculateRightPadding(ld).roundToPx()
paddingBottom = contentPadding.calculateBottomPadding().roundToPx()
}
val genericMotionEventDispatcher = LocalGenericMotionEventDispatcher.current
val recyclerViewFactory = rememberViewFactory {
it.recyclerView { clipToPadding = false }
}
val isFocusedState = remember { mutableStateOf(false) }
recyclerViewFactory.RunWithViewUntilCancelled { view ->
genericMotionEventDispatcher?.putViewUntilCancelled(view, isFocusedState)
}
@OptIn(InternalSplittiesApi::class)
AndroidView(
factory = recyclerViewFactory,
modifier = modifier.onFocusChanged {
isFocusedState.value = it.hasFocus
}.focusRequester(focusRequester).focusable(),
update = {
it.setPadding(
paddingLeft,
paddingTop,
paddingRight,
paddingBottom
)
if (it.layoutManager != adapter.layoutManager) it.layoutManager = adapter.layoutManager
if (it.adapter != adapter) it.adapter = adapter
}
)
if (requestFocus) LaunchedEffect(Unit) { focusRequester.requestFocus() }
}
```
|
The Okal Rel Universe (also referred to as the ORU) is the setting for a 10-novel series written by Lynda Williams.
Description
The universe is a future where the cultural and biological evolution of the human race has divided it into two societies: "Gelacks" and "Reetions". Gelacks are dominated by the neo-feudal descendants of an ancient bioengineering project that modified humans to tolerate reality skimming. "Reality skimming" (also known as rel-skimming) is a physically and mentally strenuous method of faster than light space travel which underpins the economy and culture of the Okal Rel Universe. The Reetions are the descendants of unmodified humans whose social system depends upon transparency moderated by a form of artificial intelligence known as arbiters. Each race has advantages and handicaps, physical or cultural.
One of the dominant themes of the ORU is an exploration of how those two societies settle conflicts. In the first novel in the series The Courtesan Prince, Gelacks and Reetions are obliged to take official notice of each other for the first time in 200 years.
Okal Rel is the belief system of the bio-engineered sub-species of humans called Sevolites, comes in a variety of sects, and is based on the sacredness of habitat as the stage on which souls are reborn. Most varieties link the prospects of rebirth to honorable behavior in life, as judged by other souls awaiting rebirth, and the availability of descendants.
Published works
The Saga
The Courtesan Prince (2005)
Righteous Anger (2006)
Pretenders (2006)
Throne Price (2003)
Far Arena (2009)
Avim's Oath (2010)
Healer's Sword (2012)
Gathering Storm (2013)
Holy War (2013)
Okal Rel Legacy Series
Encyclopedic Guide to the ORU (2009)
Horth in Killing Reach (2008)
Kath: An Okal Rel Universe Legacy Novella (2009)
The Lorel Experiment: The story of Sevolite Origins (2009)
Mekan'stan: An Okal Rel Universe Legacy Novella (2009)
Opus 1: An Okal Rel Universe Legacy Anthology (2009)
Opus 2: An Okal Rel Universe Legacy Anthology (2009)
Opus 3: An Okal Rel Universe Legacy Anthology (2009)
References
External links
Edge Science Fiction and Fantasy Publishing
Okal Rel website
Fictional society
|
In the law of the United States, diversity jurisdiction is a form of subject-matter jurisdiction that gives United States federal courts the power to hear lawsuits that do not involve a federal question. For a federal court to have diversity jurisdiction over a lawsuit, two conditions must be met. First, there must be "diversity of citizenship" between the parties, meaning the plaintiffs must be citizens of different U.S. states than the defendants. Second, the lawsuit's "amount in controversy" must be more than $75,000. If a lawsuit does not meet these two conditions, federal courts will normally lack the jurisdiction to hear it unless it involves a federal question, and the lawsuit would need to be heard in state court instead.
The United States Constitution, in Article III, Section 2, grants Congress the power to permit federal courts to hear diversity cases through legislation authorizing such jurisdiction. The provision was included because the Framers of the Constitution were concerned that when a case is filed in one state, and it involves parties from that state and another state, the state court might be biased toward the party from that state. Congress first exercised that power and granted federal trial circuit courts diversity jurisdiction in the Judiciary Act of 1789. Diversity jurisdiction is currently codified at .
In 1969, the American Law Institute explained in a 587-page analysis of the subject that diversity is the "most controversial" type of federal jurisdiction, because it "lays bare fundamental issues regarding the nature and operation of our federal union."
Statute
Diversity of parties
Mostly, in order for diversity jurisdiction to apply, complete diversity is required, where none of the plaintiffs can be from the same state as any of the defendants. A corporation is treated as a citizen of the state in which it is incorporated and the state in which its principal place of business is located. A partnership or limited liability company is considered to have the citizenship of all of its constituent partners/members. Thus, an LLC or partnership with one member or partner sharing citizenship with an opposing party will destroy diversity of jurisdiction. Cities and towns (incorporated municipalities) are also treated as citizens of the states in which they are located, but states themselves are not considered citizens for the purpose of diversity. U.S. citizens are citizens of the state in which they are domiciled, which is the last state in which they resided and had an intent to remain.
A national bank chartered under the National Bank Act is treated as a citizen of the state in which it is "located". In 2006, the Supreme Court rejected an approach that would have interpreted the term "located" to mean that a national bank is a citizen of every state in which it maintains a branch. The Supreme Court concluded that "a national bank ... is a citizen of the State in which its main office, as set forth in its articles of association, is located". The Supreme Court, however, left open the possibility that a national bank may also be a citizen of the state in which it has its principal place of business, thus putting it on an equal footing with a state-formed corporation. This remains an open question, with some lower courts holding that a national bank is a citizen of only the state in which its main office is located, and others holding that a national bank is also a citizen of the state in which it has its principal place of business.
The diversity jurisdiction statute also allows federal courts to hear cases in which:
Citizens of a U.S. state are parties on one side of the case, with nonresident alien(s) as adverse parties;
Complete diversity exists as to the U.S. parties, and nonresident aliens are additional parties;
A foreign state (i.e., country) is the plaintiff, and the defendants are citizens of one or more U.S. states; or
Under the Class Action Fairness Act of 2005, a class action can usually be brought in a federal court when there is just minimal diversity, such that any plaintiff is a citizen of a different state from any defendant. Class actions that do not meet the requirement of the Class Action Fairness Act must have complete diversity between class representatives (those named in the lawsuit) and the defendants.
A U.S. citizen who is domiciled outside the U.S. is not considered to be a citizen of any U.S. state, and cannot be considered an alien. The presence of such a person as a party completely destroys diversity jurisdiction, except for a class action or mass action in which minimal diversity exists with respect to other parties in the case.
If the case requires the presence of a party who is from the same state as an opposing party, or a party who is a U.S. citizen domiciled outside the country, the case must be dismissed, the absent party being deemed "indispensable". The determination of whether a party is indispensable is made by the court following the guidelines set forth in Rule 19 of the Federal Rules of Civil Procedure.
Diversity is determined at the time that the action is filed
Diversity is determined at the time that federal court jurisdiction is invoked (at time of filing, if directly filed in U.S. district court, or at time of removal, if removed from state court), and on the basis of the state citizenships of the parties at that time. A change in domicile by a natural person before or after that date is irrelevant. However, in Caterpillar, Inc. v. Lewis (1996), the Supreme Court also held that federal jurisdiction predicated on diversity of citizenship can be sustained even if there did not exist complete diversity at the time of removal to federal court, so long as complete diversity exists at the time the district court enters judgment. The court in Caterpillar sustained diversity as an issue of "fairness" and economy, given a lower court's original mistake that allowed removal.
Corporate citizenship based on principal place of business
Before 1958, a corporation for the purpose of diversity jurisdiction was deemed to be a citizen only of the state in which it had been formally incorporated. This was originally not a problem when a corporation could be chartered only by the enacting of a private bill by the state legislature (either with the consent of the governor or over his veto). It became a problem when general incorporation laws were invented around 1896, state legislatures began a race to the bottom to attract out-of-state corporations, and corporations began to incorporate in one state (usually Delaware) but set up their headquarters in another state. During the 20th century, the traditional rule came to be seen as extremely unfair in that corporate defendants actually headquartered in a state but incorporated elsewhere could remove diversity cases against them from state courts to federal courts, while individual and unincorporated defendants physically based in that same state (e.g., partnerships) could not. Therefore, during the 1950s, various proposals were introduced to broaden the citizenship of corporations in order to reduce their access to federal courts.
In 1957, conservative Southern Democrats, as part of their larger agenda to protect racial segregation and states' rights by greatly reducing the power of the federal judiciary, introduced a bill to limit diversity jurisdiction to natural citizens. Liberals in Congress recognized this was actually a form of retaliation by conservative Southerners against the Warren Court, and prevailed in 1958 with the passage of a relatively narrow bill which deemed corporations to be citizens of both their states of incorporation and principal place of business. The two proposals, respectively, promised to reduce the federal civil caseload by 25% versus 2%.
However, Congress never defined what exactly is a "principal place of business". The question of what that phrase meant became hotly disputed during the late 20th century as many areas of the American economy came under the control of large national corporations. Although these corporations usually had a headquarters in one state, the majority of their employees, assets, and revenue were often physically located at retail sites in the states with the largest populations, and hence a circuit split developed in which some judges held that the latter states could also be treated as the corporation's principal place of business. The rationale was that those states were where the business was actually occurring or being transacted. This issue was finally resolved by a unanimous Supreme Court in Hertz Corp. v. Friend (2010), which held that a corporation's principal place of business is presumed to be the place of the corporation’s "nerve center" from where its officers conduct the corporation’s important business.
Amount in controversy
The United States Congress has placed an additional barrier to diversity jurisdiction: the amount in controversy requirement. This is a minimum amount of money which the parties must be contesting is owed to them. Since the enactment of the Federal Courts Improvement Act of 1996, 28 U.S.C. §1332(a) has provided that a claim for relief must exceed the sum or value of $75,000, exclusive of interest and costs and without considering counterclaims. In other words, the amount in controversy must be equal to or more than $75,000.01, and (in a case which has been removed from a state court to the federal court) a federal court must remand a case back to state court if the amount in controversy is exactly $75,000.00.
A single plaintiff may add different claims against the same defendant to meet the amount. Two plaintiffs, however, may not join their claims together to meet the amount, but if one plaintiff meets the amount standing alone, the second plaintiff can piggyback as long as the second plaintiff's claim arises out of the same facts as the main claim. More detailed information may be obtained from the article on federal supplemental jurisdiction.
The amount specified has been regularly increased over the past two centuries. Courts will use the legal certainty test to decide whether the dispute is over $75,000. Under this test, the court will accept the pled amount unless it is legally certain that the pleading party cannot recover more than $75,000. For example, if the dispute is solely over the breach of a contract by which the defendant had agreed to pay the plaintiff $10,000, a federal court will dismiss the case for lack of subject matter jurisdiction, or remand the case to state court if it arrived via removal.
In personal injury cases, plaintiffs will sometimes claim amounts "not to exceed $75,000" in their complaint to avoid removal of the case to federal court. If the amount is left unspecified in the ad damnum, as is required by the pleading rules of many states, the defendant may sometimes be able to remove the case to federal court unless the plaintiff's lawyer files a document expressly disclaiming damages in excess of the jurisdictional requirement. Because juries decide what personal injuries are worth, compensation for injuries may exceed $75,000 such that the "legal certainty" test will not bar federal court jurisdiction. Many plaintiffs' lawyers seek to avoid federal courts because of the perception that they are more hostile to plaintiffs than most state courts.
Domestic relations and probate exceptions
A longstanding judge-made rule holds that federal courts have no jurisdiction over divorce or other domestic relations cases, even if there is diversity of citizenship between the parties and the amount of money in controversy meets the jurisdictional limit. As the Supreme Court has stated, "[t]he whole subject of the domestic relations of husband and wife, parent and child, belongs to the laws of the states, and not to the laws of the United States." The court concluded "that the domestic relations exception ... divests the federal courts of power to issue divorce, alimony, and child custody decrees." In explaining this exception, the high court noted that domestic cases frequently required the issuing court to retain jurisdiction over recurring disputes in interpreting and enforcing those decrees. State courts have developed expertise in dealing with these matters, and the interest of judicial economy required keeping that litigation in the courts most experienced to handle it. However, federal courts are not limited in their ability to hear tort cases arising out of domestic situations by the doctrine.
A similar exception has been recognized for probate and decedent's estate litigation, which continues to hold for the primary cases; diversity jurisdiction does not exist to probate wills or administer decedent's estates directly. Diversity jurisdiction is allowed for some litigation that arises under trusts and other estate planning documents, however.
Removal and remand
If a case is originally filed in a state court, and the requirements for federal jurisdiction are met (diversity and amount in controversy, the case involves a federal question, or a supplemental jurisdiction exists), the defendant (and only the defendant) may remove the case to a federal court.
A case cannot be removed to a state court. To remove to a federal court, the defendant must file a notice of removal with both the state court where the case was filed and the federal court to which it will be transferred. The notice of removal must be filed within 30 days of the first removable document. For example, if there is no diversity of citizenship initially, but the non-diverse defendant is subsequently dismissed, the remaining diverse defendant(s) may remove to a federal court. However, no removal is available after one year of the filing of the complaint.
A party's citizenship at the time of the filing of the action is considered the citizenship of the party. If a defendant later moves to the same state as the plaintiff while the action is pending, the federal court will still have jurisdiction. However, if any defendant is a citizen of the state where the action is first filed, diversity does not exist. 28 U.S.C. §1441(b).
If a plaintiff or a co-defendant opposes removal, he may request a remand, asking the federal court to send the case back to the state court. A remand is rarely granted if the diversity and amount in controversy requirements are met. A remand may be granted, however, if a non-diverse party joins the action, or if the parties settle some claims among them, leaving the amount in controversy below the requisite amount.
Law applied
The United States Supreme Court determined in Erie Railroad Co. v. Tompkins (1938) that the law to be applied in a diversity case would be the law of whatever state in which the action was filed. This decision overturned precedents that had held that federal courts could create a general federal common law, instead of applying the law of the forum state. This decision was an interpretation of the word "laws" in 28 U.S.C. 1652, known as the Rules of Decision Act, to mean not just statutes enacted by the legislature but also the common law created by state courts.
Under the Rules of Decision Act, the laws of the several states, except where the constitution or treaties of the United States or Acts of Congress otherwise require or provide, shall be regarded as rules of decision in civil actions in the courts of the United States, in cases where they apply.
The Court interpreted "laws" to include the states' judicial decisions, or "common law". Thus, it is an overstatement to state that Erie represents the notion that there is no federal common law. Federal courts do adjudicate "common law" of federal statutes and regulations.
Because the RDA provides for exceptions and modifications by Congress, it is important to note the effect of the Rules Enabling Act (REA), 28 U.S.C. 2072. The REA delegates the legislative authority to the Supreme Court to ratify rules of practice and procedure and rules of evidence for federal courts. Thus, it is not Erie but the REA which created the distinction between substantive and procedural law.
Thus, while state substantive law is applied, the Federal Rules of Civil Procedure and the Federal Rules of Evidence still govern the "procedural" matters in a diversity action, as clarified in Gasperini v. Center for Humanities (1996). The REA, 28 U.S.C. 2072(b), provides that the Rules will not affect the substantive rights of the parties. Therefore, a federal court may still apply the "procedural" rules of the state of the initial filing, if the federal law would "abridge, enlarge, or modify" a substantive right provided for under the law of the state.
See also
Class Action Fairness Act of 2005
Federal question jurisdiction
Federalist No. 80
Saadeh v. Farouki (1997)
Strawbridge v. Curtiss (1806)
Supplemental jurisdiction
References
External links
28 U.S.C § 1332. Diversity of Citizenship
United States civil procedure
Jurisdiction
Article Three of the United States Constitution
American legal terminology
|
Maximum II is Japanese dance unit, MAX's second album. It was released on December 25, 1997, by record label, avex trax. The album is a departure from their debut effort completely void of the Eurobeat sound that made the group popular instead filled with slick R&B influenced pop numbers and ballads. The album peaked at #2 on the Oricon charts, but had their best opening sales number with over 700,000 units sold. First pressings of the album included a slipcase and six month calendar.
Track list
MAX (band) albums
1997 albums
Avex Group albums
|
```java
/*
*
* *
* * *
* * *
* * * path_to_url
* * *
* * * Unless required by applicable law or agreed to in writing, software
* * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* *
*
*/
package com.chillingvan.canvasgl.glcanvas;
import android.opengl.GLES20;
import android.util.Log;
import javax.microedition.khronos.opengles.GL11;
public class RawTexture extends BasicTexture {
private static final String TAG = "RawTexture";
private final boolean mOpaque;
private int target;
protected boolean needInvalidate;
public RawTexture(int width, int height, boolean opaque) {
this(width, height, opaque, GL11.GL_TEXTURE_2D);
}
public RawTexture(int width, int height, boolean opaque, int target) {
mOpaque = opaque;
setSize(width, height);
this.target = target;
}
@Override
public boolean isOpaque() {
return mOpaque;
}
public void prepare(GLCanvas canvas) {
GLId glId = canvas.getGLId();
mId = glId.generateTexture();
if (target == GLES20.GL_TEXTURE_2D) {
canvas.initializeTextureSize(this, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE);
}
canvas.setTextureParameters(this);
mState = STATE_LOADED;
setAssociatedCanvas(canvas);
}
@Override
protected boolean onBind(GLCanvas canvas) {
if (isLoaded()) return true;
Log.w(TAG, "lost the content due to context change");
return false;
}
@Override
public void yield() {
// we cannot free the secondBitmap because we have no backup.
}
@Override
public int getTarget() {
return target;
}
/**
* Call this when surfaceTexture calls updateTexImage
*/
public void setNeedInvalidate(boolean needInvalidate) {
this.needInvalidate = needInvalidate;
}
public boolean isNeedInvalidate() {
return needInvalidate;
}
}
```
|
```xml
/*
* one or more contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright ownership.
*/
import {setup} from './decisionNavigation.mocks';
import {test} from '../test-fixtures';
import {SETUP_WAITING_TIME} from './constants';
import {expect} from '@playwright/test';
import {config} from '../config';
let initialData: Awaited<ReturnType<typeof setup>>;
test.beforeAll(async ({request}) => {
test.setTimeout(SETUP_WAITING_TIME);
initialData = await setup();
await Promise.all([
...initialData.decisionKeys.map(
async (decisionKey) =>
await expect
.poll(
async () => {
const response = await request.get(
`${config.endpoint}/v1/decision-definitions/${decisionKey}`,
);
return response.status();
},
{timeout: SETUP_WAITING_TIME},
)
.toBe(200),
),
expect
.poll(
async () => {
const response = await request.get(
`${config.endpoint}/v1/process-instances/${initialData.processInstanceWithFailedDecision.processInstanceKey}`,
);
return response.status();
},
{timeout: SETUP_WAITING_TIME},
)
.toBe(200),
expect
.poll(
async () => {
const response = await request.post(
`${config.endpoint}/api/process-instances/${initialData.processInstanceWithFailedDecision.processInstanceKey}/flow-node-metadata`,
{
data: {
flowNodeId: 'Activity_1tjwahx',
},
},
);
const metaData = await response.json();
return metaData.incidentCount;
},
{timeout: SETUP_WAITING_TIME},
)
.toBe(1),
]);
});
test.beforeEach(async ({dashboardPage}) => {
dashboardPage.navigateToDashboard();
});
test.describe('Decision Navigation', () => {
test('Navigation between process and decision', async ({page}) => {
const processInstanceKey =
initialData.processInstanceWithFailedDecision.processInstanceKey;
await page
.getByRole('link', {
name: /processes/i,
})
.click();
await page
.getByRole('link', {
name: processInstanceKey,
})
.click();
await expect(page.getByTestId('diagram')).toBeInViewport();
await expect(
page.getByTestId('diagram').getByText(/define approver/i),
).toBeVisible();
await page.getByTestId('diagram').getByText('Define approver').click();
await expect(page.getByTestId('popover')).toBeVisible();
await page
.getByRole('link', {
name: /view root cause decision invoice classification/i,
})
.click();
await expect(page.getByTestId('decision-panel')).toBeVisible();
await expect(
page.getByTestId('decision-panel').getByText('Invoice Amount'),
).toBeVisible();
const calledDecisionInstanceId = await page
.getByTestId('instance-header')
.getByRole('cell')
.nth(6)
.innerText();
await page.getByRole('button', {name: /close drd panel/i}).click();
await page
.getByRole('link', {
name: `View process instance ${processInstanceKey}`,
})
.click();
await expect(page.getByTestId('instance-header')).toBeVisible();
await expect(
page
.getByTestId('instance-header')
.getByText(processInstanceKey, {exact: true}),
).toBeVisible();
await expect(page.getByTestId('diagram')).toBeInViewport();
await expect(
page.getByTestId('diagram').getByText(/define approver/i),
).toBeVisible();
await page
.getByRole('link', {
name: /decisions/i,
})
.click();
await page
.getByRole('link', {
name: `View decision instance ${calledDecisionInstanceId}`,
})
.click();
await expect(page.getByTestId('decision-panel')).toBeVisible();
await expect(
page.getByTestId('decision-panel').getByText('Invoice Amount'),
).toBeVisible();
});
});
```
|
```xml
<!--
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~
~ path_to_url
~
~ Unless required by applicable law or agreed to in writing, software
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-->
<dataset update-count="1">
<metadata data-nodes="encrypt_shadow_db.t_shadow">
<column name="order_id" type="long" />
<column name="user_id" type="int" />
<column name="order_name_cipher" type="varchar" />
<column name="type_char" type="char" />
<column name="type_boolean" type="boolean" />
<column name="type_smallint" type="smallint" />
<column name="type_enum" type="enum#season" />
<column name="type_decimal" type="decimal" />
<column name="type_date" type="Date" />
<column name="type_time" type="time" />
<column name="type_timestamp" type="timestamp" />
</metadata>
<row data-node="encrypt_shadow_db.t_shadow" values="1, 0, OuQCPda97jMdDtibdBO6Jg==, S, true, 5, summer, 10.00, 2017-08-08, 18:30:30, 2017-08-08 18:30:30.0" />
<row data-node="encrypt_shadow_db.t_shadow" values="2, 0, OuQCPda97jMdDtibdBO6Jg==, S, true, 5, summer, 10.00, 2017-08-08, 18:30:30, 2017-08-08 18:30:30.0" />
<row data-node="encrypt_shadow_db.t_shadow" values="3, 0, OuQCPda97jMdDtibdBO6Jg==, S, true, 5, summer, 10.00, 2017-08-08, 18:30:30, 2017-08-08 18:30:30.0" />
<row data-node="encrypt_shadow_db.t_shadow" values="4, 0, OuQCPda97jMdDtibdBO6Jg==, S, true, 5, summer, 10.00, 2017-08-08, 18:30:30, 2017-08-08 18:30:30.0" />
<row data-node="encrypt_shadow_db.t_shadow" values="5, 0, OuQCPda97jMdDtibdBO6Jg==, S, true, 5, summer, 10.00, 2017-08-08, 18:30:30, 2017-08-08 18:30:30.0" />
<row data-node="encrypt_shadow_db.t_shadow" values="6, 0, OuQCPda97jMdDtibdBO6Jg==, S, true, 50, summer, 100.00, 2021-01-01, 12:30:30, 2021-01-01 12:30:30.0" />
</dataset>
```
|
```javascript
'use strict';
module.exports.definition = {
set: function (v) {
this._setProperty('-webkit-margin-before-collapse', v);
},
get: function () {
return this.getPropertyValue('-webkit-margin-before-collapse');
},
enumerable: true,
configurable: true
};
```
|
```forth
*> \brief \b SDRVRF1
*
* =========== DOCUMENTATION ===========
*
* Online html documentation available at
* path_to_url
*
* Definition:
* ===========
*
* SUBROUTINE SDRVRF1( NOUT, NN, NVAL, THRESH, A, LDA, ARF, WORK )
*
* .. Scalar Arguments ..
* INTEGER LDA, NN, NOUT
* REAL THRESH
* ..
* .. Array Arguments ..
* INTEGER NVAL( NN )
* REAL A( LDA, * ), ARF( * ), WORK( * )
* ..
*
*
*> \par Purpose:
* =============
*>
*> \verbatim
*>
*> SDRVRF1 tests the LAPACK RFP routines:
*> SLANSF
*> \endverbatim
*
* Arguments:
* ==========
*
*> \param[in] NOUT
*> \verbatim
*> NOUT is INTEGER
*> The unit number for output.
*> \endverbatim
*>
*> \param[in] NN
*> \verbatim
*> NN is INTEGER
*> The number of values of N contained in the vector NVAL.
*> \endverbatim
*>
*> \param[in] NVAL
*> \verbatim
*> NVAL is INTEGER array, dimension (NN)
*> The values of the matrix dimension N.
*> \endverbatim
*>
*> \param[in] THRESH
*> \verbatim
*> THRESH is REAL
*> The threshold value for the test ratios. A result is
*> included in the output file if RESULT >= THRESH. To have
*> every test ratio printed, use THRESH = 0.
*> \endverbatim
*>
*> \param[out] A
*> \verbatim
*> A is REAL array, dimension (LDA,NMAX)
*> \endverbatim
*>
*> \param[in] LDA
*> \verbatim
*> LDA is INTEGER
*> The leading dimension of the array A. LDA >= max(1,NMAX).
*> \endverbatim
*>
*> \param[out] ARF
*> \verbatim
*> ARF is REAL array, dimension ((NMAX*(NMAX+1))/2).
*> \endverbatim
*>
*> \param[out] WORK
*> \verbatim
*> WORK is REAL array, dimension ( NMAX )
*> \endverbatim
*
* Authors:
* ========
*
*> \author Univ. of Tennessee
*> \author Univ. of California Berkeley
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup single_lin
*
* =====================================================================
SUBROUTINE SDRVRF1( NOUT, NN, NVAL, THRESH, A, LDA, ARF, WORK )
*
* -- LAPACK test routine --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
*
* .. Scalar Arguments ..
INTEGER LDA, NN, NOUT
REAL THRESH
* ..
* .. Array Arguments ..
INTEGER NVAL( NN )
REAL A( LDA, * ), ARF( * ), WORK( * )
* ..
*
* =====================================================================
* ..
* .. Parameters ..
REAL ONE
PARAMETER ( ONE = 1.0E+0 )
INTEGER NTESTS
PARAMETER ( NTESTS = 1 )
* ..
* .. Local Scalars ..
CHARACTER UPLO, CFORM, NORM
INTEGER I, IFORM, IIN, IIT, INFO, INORM, IUPLO, J, N,
+ NERRS, NFAIL, NRUN
REAL EPS, LARGE, NORMA, NORMARF, SMALL
* ..
* .. Local Arrays ..
CHARACTER UPLOS( 2 ), FORMS( 2 ), NORMS( 4 )
INTEGER ISEED( 4 ), ISEEDY( 4 )
REAL RESULT( NTESTS )
* ..
* .. External Functions ..
REAL SLAMCH, SLANSY, SLANSF, SLARND
EXTERNAL SLAMCH, SLANSY, SLANSF, SLARND
* ..
* .. External Subroutines ..
EXTERNAL STRTTF
* ..
* .. Scalars in Common ..
CHARACTER*32 SRNAMT
* ..
* .. Common blocks ..
COMMON / SRNAMC / SRNAMT
* ..
* .. Data statements ..
DATA ISEEDY / 1988, 1989, 1990, 1991 /
DATA UPLOS / 'U', 'L' /
DATA FORMS / 'N', 'T' /
DATA NORMS / 'M', '1', 'I', 'F' /
* ..
* .. Executable Statements ..
*
* Initialize constants and the random number seed.
*
NRUN = 0
NFAIL = 0
NERRS = 0
INFO = 0
DO 10 I = 1, 4
ISEED( I ) = ISEEDY( I )
10 CONTINUE
*
EPS = SLAMCH( 'Precision' )
SMALL = SLAMCH( 'Safe minimum' )
LARGE = ONE / SMALL
SMALL = SMALL * LDA * LDA
LARGE = LARGE / LDA / LDA
*
DO 130 IIN = 1, NN
*
N = NVAL( IIN )
*
DO 120 IIT = 1, 3
* Nothing to do for N=0
IF ( N .EQ. 0 ) EXIT
* Quick Return if possible
IF ( N .EQ. 0 ) EXIT
*
* IIT = 1 : random matrix
* IIT = 2 : random matrix scaled near underflow
* IIT = 3 : random matrix scaled near overflow
*
DO J = 1, N
DO I = 1, N
A( I, J) = SLARND( 2, ISEED )
END DO
END DO
*
IF ( IIT.EQ.2 ) THEN
DO J = 1, N
DO I = 1, N
A( I, J) = A( I, J ) * LARGE
END DO
END DO
END IF
*
IF ( IIT.EQ.3 ) THEN
DO J = 1, N
DO I = 1, N
A( I, J) = A( I, J) * SMALL
END DO
END DO
END IF
*
* Do first for UPLO = 'U', then for UPLO = 'L'
*
DO 110 IUPLO = 1, 2
*
UPLO = UPLOS( IUPLO )
*
* Do first for CFORM = 'N', then for CFORM = 'C'
*
DO 100 IFORM = 1, 2
*
CFORM = FORMS( IFORM )
*
SRNAMT = 'STRTTF'
CALL STRTTF( CFORM, UPLO, N, A, LDA, ARF, INFO )
*
* Check error code from STRTTF
*
IF( INFO.NE.0 ) THEN
IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 ) THEN
WRITE( NOUT, * )
WRITE( NOUT, FMT = 9999 )
END IF
WRITE( NOUT, FMT = 9998 ) SRNAMT, UPLO, CFORM, N
NERRS = NERRS + 1
GO TO 100
END IF
*
DO 90 INORM = 1, 4
*
* Check all four norms: 'M', '1', 'I', 'F'
*
NORM = NORMS( INORM )
NORMARF = SLANSF( NORM, CFORM, UPLO, N, ARF, WORK )
NORMA = SLANSY( NORM, UPLO, N, A, LDA, WORK )
*
RESULT(1) = ( NORMA - NORMARF ) / NORMA / EPS
NRUN = NRUN + 1
*
IF( RESULT(1).GE.THRESH ) THEN
IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 ) THEN
WRITE( NOUT, * )
WRITE( NOUT, FMT = 9999 )
END IF
WRITE( NOUT, FMT = 9997 ) 'SLANSF',
+ N, IIT, UPLO, CFORM, NORM, RESULT(1)
NFAIL = NFAIL + 1
END IF
90 CONTINUE
100 CONTINUE
110 CONTINUE
120 CONTINUE
130 CONTINUE
*
* Print a summary of the results.
*
IF ( NFAIL.EQ.0 ) THEN
WRITE( NOUT, FMT = 9996 ) 'SLANSF', NRUN
ELSE
WRITE( NOUT, FMT = 9995 ) 'SLANSF', NFAIL, NRUN
END IF
IF ( NERRS.NE.0 ) THEN
WRITE( NOUT, FMT = 9994 ) NERRS, 'SLANSF'
END IF
*
9999 FORMAT( 1X, ' *** Error(s) or Failure(s) while testing SLANSF
+ ***')
9998 FORMAT( 1X, ' Error in ',A6,' with UPLO=''',A1,''', FORM=''',
+ A1,''', N=',I5)
9997 FORMAT( 1X, ' Failure in ',A6,' N=',I5,' TYPE=',I5,' UPLO=''',
+ A1, ''', FORM =''',A1,''', NORM=''',A1,''', test=',G12.5)
9996 FORMAT( 1X, 'All tests for ',A6,' auxiliary routine passed the ',
+ 'threshold ( ',I5,' tests run)')
9995 FORMAT( 1X, A6, ' auxiliary routine: ',I5,' out of ',I5,
+ ' tests failed to pass the threshold')
9994 FORMAT( 26X, I5,' error message recorded (',A6,')')
*
RETURN
*
* End of SDRVRF1
*
END
```
|
```javascript
import Logger from './logger';
export default class EventEmitter{
constructor(vuex = {}){
Logger.info(vuex ? `Vuex adapter enabled` : `Vuex adapter disabled`);
Logger.info(vuex.mutationPrefix ? `Vuex socket mutations enabled` : `Vuex socket mutations disabled`);
Logger.info(vuex ? `Vuex socket actions enabled` : `Vuex socket actions disabled`);
this.store = vuex.store;
this.actionPrefix = vuex.actionPrefix ? vuex.actionPrefix : 'SOCKET_';
this.mutationPrefix = vuex.mutationPrefix;
this.listeners = new Map();
}
/**
* register new event listener with vuejs component instance
* @param event
* @param callback
* @param component
*/
addListener(event, callback, component){
if(typeof callback === 'function'){
if (!this.listeners.has(event)) this.listeners.set(event, []);
this.listeners.get(event).push({ callback, component });
Logger.info(`#${event} subscribe, component: ${component.$options.name}`);
} else {
throw new Error(`callback must be a function`);
}
}
/**
* remove a listenler
* @param event
* @param component
*/
removeListener(event, component){
if(this.listeners.has(event)){
const listeners = this.listeners.get(event).filter(listener => (
listener.component !== component
));
if (listeners.length > 0) {
this.listeners.set(event, listeners);
} else {
this.listeners.delete(event);
}
Logger.info(`#${event} unsubscribe, component: ${component.$options.name}`);
}
}
/**
* broadcast incoming event to components
* @param event
* @param args
*/
emit(event, args){
if(this.listeners.has(event)){
Logger.info(`Broadcasting: #${event}, Data:`, args);
this.listeners.get(event).forEach((listener) => {
listener.callback.call(listener.component, args);
});
}
if(event !== 'ping' && event !== 'pong') {
this.dispatchStore(event, args);
}
}
/**
* dispatching vuex actions
* @param event
* @param args
*/
dispatchStore(event, args){
if(this.store && this.store._actions){
let prefixed_event = this.actionPrefix + event;
for (let key in this.store._actions) {
let action = key.split('/').pop();
if(action === prefixed_event) {
Logger.info(`Dispatching Action: ${key}, Data:`, args);
this.store.dispatch(key, args);
}
}
if(this.mutationPrefix) {
let prefixed_event = this.mutationPrefix + event;
for (let key in this.store._mutations) {
let mutation = key.split('/').pop();
if(mutation === prefixed_event) {
Logger.info(`Commiting Mutation: ${key}, Data:`, args);
this.store.commit(key, args);
}
}
}
}
}
}
```
|
```c++
///|/
///|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
///|/
#include <numeric>
#include "Emboss.hpp"
#include <stdio.h>
#include <numeric>
#include <cstdlib>
#include <boost/nowide/convert.hpp>
#include <boost/log/trivial.hpp>
#include <ClipperUtils.hpp> // union_ex + for boldness(polygon extend(offset))
#include "IntersectionPoints.hpp"
#define STB_TRUETYPE_IMPLEMENTATION // force following include to generate implementation
#include "imgui/imstb_truetype.h" // stbtt_fontinfo
#include "Utils.hpp" // ScopeGuard
#include <Triangulation.hpp> // CGAL project
#include "libslic3r.h"
// to heal shape
#include "ExPolygonsIndex.hpp"
#include "libslic3r/AABBTreeLines.hpp" // search structure for found close points
#include "libslic3r/Line.hpp"
#include "libslic3r/BoundingBox.hpp"
// Experimentaly suggested ration of font ascent by multiple fonts
// to get approx center of normal text line
const double ASCENT_CENTER = 1/3.; // 0.5 is above small letter
// every glyph's shape point is divided by SHAPE_SCALE - increase precission of fixed point value
// stored in fonts (to be able represents curve by sequence of lines)
static constexpr double SHAPE_SCALE = 0.001; // SCALING_FACTOR promile is fine enough
static unsigned MAX_HEAL_ITERATION_OF_TEXT = 10;
using namespace Slic3r;
using namespace Emboss;
using fontinfo_opt = std::optional<stbtt_fontinfo>;
// NOTE: approach to heal shape by Clipper::Closing is not working
// functionality to remove all spikes from shape
// Potentionaly useable for eliminate spike in layer
//#define REMOVE_SPIKES
// function to remove useless islands and holes
// #define REMOVE_SMALL_ISLANDS
#ifdef REMOVE_SMALL_ISLANDS
namespace { void remove_small_islands(ExPolygons &shape, double minimal_area);}
#endif //REMOVE_SMALL_ISLANDS
//#define VISUALIZE_HEAL
#ifdef VISUALIZE_HEAL
namespace {
// for debug purpose only
// NOTE: check scale when store svg !!
#include "libslic3r/SVG.hpp" // for visualize_heal
Points get_unique_intersections(const Slic3r::IntersectionsLines &intersections); // fast forward declaration
static std::string visualize_heal_svg_filepath = "C:/data/temp/heal.svg";
void visualize_heal(const std::string &svg_filepath, const ExPolygons &expolygons)
{
Points pts = to_points(expolygons);
BoundingBox bb(pts);
// double svg_scale = SHAPE_SCALE / unscale<double>(1.);
// bb.scale(svg_scale);
SVG svg(svg_filepath, bb);
svg.draw(expolygons);
Points duplicits = collect_duplicates(pts);
int black_size = std::max(bb.size().x(), bb.size().y()) / 20;
svg.draw(duplicits, "black", black_size);
Slic3r::IntersectionsLines intersections_f = get_intersections(expolygons);
Points intersections = get_unique_intersections(intersections_f);
svg.draw(intersections, "red", black_size * 1.2);
}
} // namespace
#endif // VISUALIZE_HEAL
// do not expose out of this file stbtt_ data types
namespace{
using Polygon = Slic3r::Polygon;
bool is_valid(const FontFile &font, unsigned int index);
fontinfo_opt load_font_info(const unsigned char *data, unsigned int index = 0);
std::optional<Glyph> get_glyph(const stbtt_fontinfo &font_info, int unicode_letter, float flatness);
// take glyph from cache
const Glyph* get_glyph(int unicode, const FontFile &font, const FontProp &font_prop,
Glyphs &cache, fontinfo_opt &font_info_opt);
// scale and convert float to int coordinate
Point to_point(const stbtt__point &point);
// bad is contour smaller than 3 points
void remove_bad(Polygons &polygons);
void remove_bad(ExPolygons &expolygons);
// Try to remove self intersection by subtracting rect 2x2 px
ExPolygon create_bounding_rect(const ExPolygons &shape);
// Heal duplicates points and self intersections
bool heal_dupl_inter(ExPolygons &shape, unsigned max_iteration);
const Points pts_2x2({Point(0, 0), Point(1, 0), Point(1, 1), Point(0, 1)});
const Points pts_3x3({Point(-1, -1), Point(1, -1), Point(1, 1), Point(-1, 1)});
struct SpikeDesc
{
// cosinus of max spike angle
double cos_angle; // speed up to skip acos
// Half of Wanted bevel size
double half_bevel;
/// <summary>
/// Calculate spike description
/// </summary>
/// <param name="bevel_size">Size of spike width after cut of the tip, has to be grater than 2.5</param>
/// <param name="pixel_spike_length">When spike has same or more pixels with width less than 1 pixel</param>
SpikeDesc(double bevel_size, double pixel_spike_length = 6):
// create min angle given by spike_length
// Use it as minimal height of 1 pixel base spike
cos_angle(std::fabs(std::cos(
/*angle*/ 2. * std::atan2(pixel_spike_length, .5)
))),
// When remove spike this angle is set.
// Value must be grater than min_angle
half_bevel(bevel_size / 2)
{}
};
// return TRUE when remove point. It could create polygon with 2 points.
bool remove_when_spike(Polygon &polygon, size_t index, const SpikeDesc &spike_desc);
void remove_spikes_in_duplicates(ExPolygons &expolygons, const Points &duplicates);
#ifdef REMOVE_SPIKES
// Remove long sharp corners aka spikes
// by adding points to bevel tip of spikes - Not printable parts
// Try to not modify long sides of spike and add points on it's side
void remove_spikes(Polygon &polygon, const SpikeDesc &spike_desc);
void remove_spikes(Polygons &polygons, const SpikeDesc &spike_desc);
void remove_spikes(ExPolygons &expolygons, const SpikeDesc &spike_desc);
#endif
// spike ... very sharp corner - when not removed cause iteration of heal process
// index ... index of duplicit point in polygon
bool remove_when_spike(Slic3r::Polygon &polygon, size_t index, const SpikeDesc &spike_desc) {
std::optional<Point> add;
bool do_erase = false;
Points &pts = polygon.points;
{
size_t pts_size = pts.size();
if (pts_size < 3)
return false;
const Point &a = (index == 0) ? pts.back() : pts[index - 1];
const Point &b = pts[index];
const Point &c = (index == (pts_size - 1)) ? pts.front() : pts[index + 1];
// calc sides
Vec2d ba = (a - b).cast<double>();
Vec2d bc = (c - b).cast<double>();
double dot_product = ba.dot(bc);
// sqrt together after multiplication save one sqrt
double ba_size_sq = ba.squaredNorm();
double bc_size_sq = bc.squaredNorm();
double norm = sqrt(ba_size_sq * bc_size_sq);
double cos_angle = dot_product / norm;
// small angle are around 1 --> cos(0) = 1
if (cos_angle < spike_desc.cos_angle)
return false; // not a spike
// has to be in range <-1, 1>
// Due to preccission of floating point number could be sligtly out of range
if (cos_angle > 1.)
cos_angle = 1.;
// if (cos_angle < -1.)
// cos_angle = -1.;
// Current Spike angle
double angle = acos(cos_angle);
double wanted_size = spike_desc.half_bevel / cos(angle / 2.);
double wanted_size_sq = wanted_size * wanted_size;
bool is_ba_short = ba_size_sq < wanted_size_sq;
bool is_bc_short = bc_size_sq < wanted_size_sq;
auto a_side = [&b, &ba, &ba_size_sq, &wanted_size]() -> Point {
Vec2d ba_norm = ba / sqrt(ba_size_sq);
return b + (wanted_size * ba_norm).cast<coord_t>();
};
auto c_side = [&b, &bc, &bc_size_sq, &wanted_size]() -> Point {
Vec2d bc_norm = bc / sqrt(bc_size_sq);
return b + (wanted_size * bc_norm).cast<coord_t>();
};
if (is_ba_short && is_bc_short) {
// remove short spike
do_erase = true;
} else if (is_ba_short) {
// move point B on C-side
pts[index] = c_side();
} else if (is_bc_short) {
// move point B on A-side
pts[index] = a_side();
} else {
// move point B on C-side and add point on A-side(left - before)
pts[index] = c_side();
add = a_side();
if (*add == pts[index]) {
// should be very rare, when SpikeDesc has small base
// will be fixed by remove B point
add.reset();
do_erase = true;
}
}
}
if (do_erase) {
pts.erase(pts.begin() + index);
return true;
}
if (add.has_value())
pts.insert(pts.begin() + index, *add);
return false;
}
void remove_spikes_in_duplicates(ExPolygons &expolygons, const Points &duplicates) {
if (duplicates.empty())
return;
auto check = [](Slic3r::Polygon &polygon, const Point &d) -> bool {
double spike_bevel = 1 / SHAPE_SCALE;
double spike_length = 5.;
const static SpikeDesc sd(spike_bevel, spike_length);
Points& pts = polygon.points;
bool exist_remove = false;
for (size_t i = 0; i < pts.size(); i++) {
if (pts[i] != d)
continue;
exist_remove |= remove_when_spike(polygon, i, sd);
}
return exist_remove && pts.size() < 3;
};
bool exist_remove = false;
for (ExPolygon &expolygon : expolygons) {
BoundingBox bb(to_points(expolygon.contour));
for (const Point &d : duplicates) {
if (!bb.contains(d))
continue;
exist_remove |= check(expolygon.contour, d);
for (Polygon &hole : expolygon.holes)
exist_remove |= check(hole, d);
}
}
if (exist_remove)
remove_bad(expolygons);
}
bool is_valid(const FontFile &font, unsigned int index) {
if (font.data == nullptr) return false;
if (font.data->empty()) return false;
if (index >= font.infos.size()) return false;
return true;
}
fontinfo_opt load_font_info(
const unsigned char *data, unsigned int index)
{
int font_offset = stbtt_GetFontOffsetForIndex(data, index);
if (font_offset < 0) {
assert(false);
// "Font index(" << index << ") doesn't exist.";
return {};
}
stbtt_fontinfo font_info;
if (stbtt_InitFont(&font_info, data, font_offset) == 0) {
// Can't initialize font.
assert(false);
return {};
}
return font_info;
}
void remove_bad(Polygons &polygons) {
polygons.erase(
std::remove_if(polygons.begin(), polygons.end(),
[](const Polygon &p) { return p.size() < 3; }),
polygons.end());
}
void remove_bad(ExPolygons &expolygons) {
expolygons.erase(
std::remove_if(expolygons.begin(), expolygons.end(),
[](const ExPolygon &p) { return p.contour.size() < 3; }),
expolygons.end());
for (ExPolygon &expolygon : expolygons)
remove_bad(expolygon.holes);
}
} // end namespace
bool Emboss::divide_segments_for_close_point(ExPolygons &expolygons, double distance)
{
if (expolygons.empty()) return false;
if (distance < 0.) return false;
// ExPolygons can't contain same neigbours
remove_same_neighbor(expolygons);
// IMPROVE: use int(insted of double) lines and tree
const ExPolygonsIndices ids(expolygons);
const std::vector<Linef> lines = Slic3r::to_linesf(expolygons, ids.get_count());
AABBTreeIndirect::Tree<2, double> tree = AABBTreeLines::build_aabb_tree_over_indexed_lines(lines);
using Div = std::pair<Point, size_t>;
std::vector<Div> divs;
size_t point_index = 0;
auto check_points = [&divs, &point_index, &lines, &tree, &distance, &ids, &expolygons](const Points &pts) {
for (const Point &p : pts) {
Vec2d p_d = p.cast<double>();
std::vector<size_t> close_lines = AABBTreeLines::all_lines_in_radius(lines, tree, p_d, distance);
for (size_t index : close_lines) {
// skip point neighbour lines indices
if (index == point_index) continue;
if (&p != &pts.front()) {
if (index == point_index - 1) continue;
} else if (index == (pts.size()-1)) continue;
// do not doubled side point of segment
const ExPolygonsIndex id = ids.cvt(index);
const ExPolygon &expoly = expolygons[id.expolygons_index];
const Polygon &poly = id.is_contour() ? expoly.contour : expoly.holes[id.hole_index()];
const Points &poly_pts = poly.points;
const Point &line_a = poly_pts[id.point_index];
const Point &line_b = (!ids.is_last_point(id)) ? poly_pts[id.point_index + 1] : poly_pts.front();
assert(line_a == lines[index].a.cast<int>());
assert(line_b == lines[index].b.cast<int>());
if (p == line_a || p == line_b) continue;
divs.emplace_back(p, index);
}
++point_index;
}
};
for (const ExPolygon &expoly : expolygons) {
check_points(expoly.contour.points);
for (const Polygon &hole : expoly.holes)
check_points(hole.points);
}
// check if exist division
if (divs.empty()) return false;
// sort from biggest index to zero
// to be able add points and not interupt indices
std::sort(divs.begin(), divs.end(),
[](const Div &d1, const Div &d2) { return d1.second > d2.second; });
auto it = divs.begin();
// divide close line
while (it != divs.end()) {
// colect division of a line segmen
size_t index = it->second;
auto it2 = it+1;
while (it2 != divs.end() && it2->second == index) ++it2;
ExPolygonsIndex id = ids.cvt(index);
ExPolygon &expoly = expolygons[id.expolygons_index];
Polygon &poly = id.is_contour() ? expoly.contour : expoly.holes[id.hole_index()];
Points &pts = poly.points;
size_t count = it2 - it;
// add points into polygon to divide in place of near point
if (count == 1) {
pts.insert(pts.begin() + id.point_index + 1, it->first);
++it;
} else {
// collect points to add into polygon
Points points;
points.reserve(count);
for (; it < it2; ++it)
points.push_back(it->first);
// need sort by line direction
const Linef &line = lines[index];
Vec2d dir = line.b - line.a;
// select mayorit direction
int axis = (abs(dir.x()) > abs(dir.y())) ? 0 : 1;
using Fnc = std::function<bool(const Point &, const Point &)>;
Fnc fnc = (dir[axis] < 0) ? Fnc([axis](const Point &p1, const Point &p2) { return p1[axis] > p2[axis]; }) :
Fnc([axis](const Point &p1, const Point &p2) { return p1[axis] < p2[axis]; }) ;
std::sort(points.begin(), points.end(), fnc);
// use only unique points
points.erase(std::unique(points.begin(), points.end()), points.end());
// divide line by adding points into polygon
pts.insert(pts.begin() + id.point_index + 1,
points.begin(), points.end());
}
assert(it == it2);
}
return true;
}
HealedExPolygons Emboss::heal_polygons(const Polygons &shape, bool is_non_zero, unsigned int max_iteration)
{
const double clean_distance = 1.415; // little grater than sqrt(2)
ClipperLib::PolyFillType fill_type = is_non_zero ?
ClipperLib::pftNonZero : ClipperLib::pftEvenOdd;
// When edit this code check that font 'ALIENATE.TTF' and glyph 'i' still work
// fix of self intersections
// path_to_url
ClipperLib::Paths paths = ClipperLib::SimplifyPolygons(ClipperUtils::PolygonsProvider(shape), fill_type);
ClipperLib::CleanPolygons(paths, clean_distance);
Polygons polygons = to_polygons(paths);
polygons.erase(std::remove_if(polygons.begin(), polygons.end(),
[](const Polygon &p) { return p.size() < 3; }), polygons.end());
if (polygons.empty())
return {{}, false};
// Do not remove all duplicates but do it better way
// Overlap all duplicit points by rectangle 3x3
Points duplicits = collect_duplicates(to_points(polygons));
if (!duplicits.empty()) {
polygons.reserve(polygons.size() + duplicits.size());
for (const Point &p : duplicits) {
Polygon rect_3x3(pts_3x3);
rect_3x3.translate(p);
polygons.push_back(rect_3x3);
}
}
ExPolygons res = Slic3r::union_ex(polygons, fill_type);
bool is_healed = heal_expolygons(res, max_iteration);
return {res, is_healed};
}
bool Emboss::heal_expolygons(ExPolygons &shape, unsigned max_iteration)
{
return ::heal_dupl_inter(shape, max_iteration);
}
namespace {
Points get_unique_intersections(const Slic3r::IntersectionsLines &intersections)
{
Points result;
if (intersections.empty())
return result;
// convert intersections into Points
result.reserve(intersections.size());
std::transform(intersections.begin(), intersections.end(), std::back_inserter(result),
[](const Slic3r::IntersectionLines &i) { return Point(
std::floor(i.intersection.x()),
std::floor(i.intersection.y()));
});
// intersections should be unique poits
std::sort(result.begin(), result.end());
auto it = std::unique(result.begin(), result.end());
result.erase(it, result.end());
return result;
}
Polygons get_holes_with_points(const Polygons &holes, const Points &points)
{
Polygons result;
for (const Slic3r::Polygon &hole : holes)
for (const Point &p : points)
for (const Point &h : hole)
if (p == h) {
result.push_back(hole);
break;
}
return result;
}
/// <summary>
/// Fill holes which create duplicits or intersections
/// When healing hole creates trouble in shape again try to heal by an union instead of diff_ex
/// </summary>
/// <param name="holes">Holes which was substracted from shape previous</param>
/// <param name="duplicates">Current duplicates in shape</param>
/// <param name="intersections">Current intersections in shape</param>
/// <param name="shape">Partialy healed shape[could be modified]</param>
/// <returns>True when modify shape otherwise False</returns>
bool fill_trouble_holes(const Polygons &holes, const Points &duplicates, const Points &intersections, ExPolygons &shape)
{
if (holes.empty())
return false;
if (duplicates.empty() && intersections.empty())
return false;
Polygons fill = get_holes_with_points(holes, duplicates);
append(fill, get_holes_with_points(holes, intersections));
if (fill.empty())
return false;
shape = union_ex(shape, fill);
return true;
}
// extend functionality from Points.cpp --> collect_duplicates
// with address of duplicated points
struct Duplicate {
Point point;
std::vector<uint32_t> indices;
};
using Duplicates = std::vector<Duplicate>;
Duplicates collect_duplicit_indices(const ExPolygons &expoly)
{
Points pts = to_points(expoly);
// initialize original index locations
std::vector<uint32_t> idx(pts.size());
std::iota(idx.begin(), idx.end(), 0);
std::sort(idx.begin(), idx.end(),
[&pts](uint32_t i1, uint32_t i2) { return pts[i1] < pts[i2]; });
Duplicates result;
const Point *prev = &pts[idx.front()];
for (size_t i = 1; i < idx.size(); ++i) {
uint32_t index = idx[i];
const Point *act = &pts[index];
if (*prev == *act) {
// duplicit point
if (!result.empty() && result.back().point == *act) {
// more than 2 points with same coordinate
result.back().indices.push_back(index);
} else {
uint32_t prev_index = idx[i-1];
result.push_back({*act, {prev_index, index}});
}
continue;
}
prev = act;
}
return result;
}
Points get_points(const Duplicates& duplicate_indices)
{
Points result;
if (duplicate_indices.empty())
return result;
// convert intersections into Points
result.reserve(duplicate_indices.size());
std::transform(duplicate_indices.begin(), duplicate_indices.end(), std::back_inserter(result),
[](const Duplicate &d) { return d.point; });
return result;
}
bool heal_dupl_inter(ExPolygons &shape, unsigned max_iteration)
{
if (shape.empty()) return true;
remove_same_neighbor(shape);
// create loop permanent memory
Polygons holes;
while (--max_iteration) {
Duplicates duplicate_indices = collect_duplicit_indices(shape);
//Points duplicates = collect_duplicates(to_points(shape));
IntersectionsLines intersections = get_intersections(shape);
// Check whether shape is already healed
if (intersections.empty() && duplicate_indices.empty())
return true;
Points duplicate_points = get_points(duplicate_indices);
Points intersection_points = get_unique_intersections(intersections);
if (fill_trouble_holes(holes, duplicate_points, intersection_points, shape)) {
holes.clear();
continue;
}
holes.clear();
holes.reserve(intersections.size() + duplicate_points.size());
remove_spikes_in_duplicates(shape, duplicate_points);
// Fix self intersection in result by subtracting hole 2x2
for (const Point &p : intersection_points) {
Polygon hole(pts_2x2);
hole.translate(p);
holes.push_back(hole);
}
// Fix duplicit points by hole 3x3 around duplicit point
for (const Point &p : duplicate_points) {
Polygon hole(pts_3x3);
hole.translate(p);
holes.push_back(hole);
}
shape = Slic3r::diff_ex(shape, holes, ApplySafetyOffset::No);
// ApplySafetyOffset::Yes is incompatible with function fill_trouble_holes
}
// Create partialy healed output
Duplicates duplicates = collect_duplicit_indices(shape);
IntersectionsLines intersections = get_intersections(shape);
if (duplicates.empty() && intersections.empty()){
// healed in the last loop
return true;
}
#ifdef VISUALIZE_HEAL
visualize_heal(visualize_heal_svg_filepath, shape);
#endif // VISUALIZE_HEAL
assert(false); // Can not heal this shape
// investigate how to heal better way
ExPolygonsIndices ei(shape);
std::vector<bool> is_healed(shape.size(), {true});
for (const Duplicate &duplicate : duplicates){
for (uint32_t i : duplicate.indices)
is_healed[ei.cvt(i).expolygons_index] = false;
}
for (const IntersectionLines &intersection : intersections) {
is_healed[ei.cvt(intersection.line_index1).expolygons_index] = false;
is_healed[ei.cvt(intersection.line_index2).expolygons_index] = false;
}
for (size_t shape_index = 0; shape_index < shape.size(); shape_index++) {
if (!is_healed[shape_index]) {
// exchange non healed expoly with bb rect
ExPolygon &expoly = shape[shape_index];
expoly = create_bounding_rect({expoly});
}
}
// After insert bounding box unify and heal
shape = union_ex(shape);
heal_dupl_inter(shape, 1);
return false;
}
ExPolygon create_bounding_rect(const ExPolygons &shape) {
BoundingBox bb = get_extents(shape);
Point size = bb.size();
if (size.x() < 10)
bb.max.x() += 10;
if (size.y() < 10)
bb.max.y() += 10;
Polygon rect({// CCW
bb.min,
{bb.max.x(), bb.min.y()},
bb.max,
{bb.min.x(), bb.max.y()}});
Point offset = bb.size() * 0.1;
Polygon hole({// CW
bb.min + offset,
{bb.min.x() + offset.x(), bb.max.y() - offset.y()},
bb.max - offset,
{bb.max.x() - offset.x(), bb.min.y() + offset.y()}});
return ExPolygon(rect, hole);
}
#ifdef REMOVE_SMALL_ISLANDS
void remove_small_islands(ExPolygons &expolygons, double minimal_area) {
if (expolygons.empty())
return;
// remove small expolygons contours
auto expoly_it = std::remove_if(expolygons.begin(), expolygons.end(),
[&minimal_area](const ExPolygon &p) { return p.contour.area() < minimal_area; });
expolygons.erase(expoly_it, expolygons.end());
// remove small holes in expolygons
for (ExPolygon &expoly : expolygons) {
Polygons& holes = expoly.holes;
auto it = std::remove_if(holes.begin(), holes.end(),
[&minimal_area](const Polygon &p) { return -p.area() < minimal_area; });
holes.erase(it, holes.end());
}
}
#endif // REMOVE_SMALL_ISLANDS
std::optional<Glyph> get_glyph(const stbtt_fontinfo &font_info, int unicode_letter, float flatness)
{
int glyph_index = stbtt_FindGlyphIndex(&font_info, unicode_letter);
if (glyph_index == 0) {
//wchar_t wchar = static_cast<wchar_t>(unicode_letter);
//<< "Character unicode letter ("
//<< "decimal value = " << std::dec << unicode_letter << ", "
//<< "hexadecimal value = U+" << std::hex << unicode_letter << std::dec << ", "
//<< "wchar value = " << wchar
//<< ") is NOT defined inside of the font. \n";
return {};
}
Glyph glyph;
stbtt_GetGlyphHMetrics(&font_info, glyph_index, &glyph.advance_width, &glyph.left_side_bearing);
stbtt_vertex *vertices;
int num_verts = stbtt_GetGlyphShape(&font_info, glyph_index, &vertices);
if (num_verts <= 0) return glyph; // no shape
ScopeGuard sg1([&vertices]() { free(vertices); });
int *contour_lengths = NULL;
int num_countour_int = 0;
stbtt__point *points = stbtt_FlattenCurves(vertices, num_verts,
flatness, &contour_lengths, &num_countour_int, font_info.userdata);
if (!points) return glyph; // no valid flattening
ScopeGuard sg2([&contour_lengths, &points]() {
free(contour_lengths);
free(points);
});
size_t num_contour = static_cast<size_t>(num_countour_int);
Polygons glyph_polygons;
glyph_polygons.reserve(num_contour);
size_t pi = 0; // point index
for (size_t ci = 0; ci < num_contour; ++ci) {
int length = contour_lengths[ci];
// check minimal length for triangle
if (length < 4) {
// weird font
pi+=length;
continue;
}
// last point is first point
--length;
Points pts;
pts.reserve(length);
for (int i = 0; i < length; ++i)
pts.emplace_back(to_point(points[pi++]));
// last point is first point --> closed contour
assert(pts.front() == to_point(points[pi]));
++pi;
// change outer cw to ccw and inner ccw to cw order
std::reverse(pts.begin(), pts.end());
glyph_polygons.emplace_back(pts);
}
if (!glyph_polygons.empty()) {
unsigned max_iteration = 10;
// TrueTypeFonts use non zero winding number
// path_to_url
// path_to_url
bool is_non_zero = true;
glyph.shape = Emboss::heal_polygons(glyph_polygons, is_non_zero, max_iteration);
}
return glyph;
}
const Glyph* get_glyph(
int unicode,
const FontFile & font,
const FontProp & font_prop,
Glyphs & cache,
fontinfo_opt &font_info_opt)
{
// TODO: Use resolution by printer configuration, or add it into FontProp
const float RESOLUTION = 0.0125f; // [in mm]
auto glyph_item = cache.find(unicode);
if (glyph_item != cache.end()) return &glyph_item->second;
unsigned int font_index = font_prop.collection_number.value_or(0);
if (!is_valid(font, font_index)) return nullptr;
if (!font_info_opt.has_value()) {
font_info_opt = load_font_info(font.data->data(), font_index);
// can load font info?
if (!font_info_opt.has_value()) return nullptr;
}
float flatness = font.infos[font_index].unit_per_em / font_prop.size_in_mm * RESOLUTION;
// Fix for very small flatness because it create huge amount of points from curve
if (flatness < RESOLUTION) flatness = RESOLUTION;
std::optional<Glyph> glyph_opt = get_glyph(*font_info_opt, unicode, flatness);
// IMPROVE: multiple loadig glyph without data
// has definition inside of font?
if (!glyph_opt.has_value()) return nullptr;
Glyph &glyph = *glyph_opt;
if (font_prop.char_gap.has_value())
glyph.advance_width += *font_prop.char_gap;
// scale glyph size
glyph.advance_width = static_cast<int>(glyph.advance_width / SHAPE_SCALE);
glyph.left_side_bearing = static_cast<int>(glyph.left_side_bearing / SHAPE_SCALE);
if (!glyph.shape.empty()) {
if (font_prop.boldness.has_value()) {
float delta = static_cast<float>(*font_prop.boldness / SHAPE_SCALE / font_prop.size_in_mm);
glyph.shape = Slic3r::union_ex(offset_ex(glyph.shape, delta));
}
if (font_prop.skew.has_value()) {
double ratio = *font_prop.skew;
auto skew = [&ratio](Polygon &polygon) {
for (Slic3r::Point &p : polygon.points)
p.x() += static_cast<Point::coord_type>(std::round(p.y() * ratio));
};
for (ExPolygon &expolygon : glyph.shape) {
skew(expolygon.contour);
for (Polygon &hole : expolygon.holes) skew(hole);
}
}
}
auto [it, success] = cache.try_emplace(unicode, std::move(glyph));
assert(success);
return &it->second;
}
Point to_point(const stbtt__point &point) {
return Point(static_cast<int>(std::round(point.x / SHAPE_SCALE)),
static_cast<int>(std::round(point.y / SHAPE_SCALE)));
}
} // namespace
#ifdef _WIN32
#include <windows.h>
#include <wingdi.h>
#include <windef.h>
#include <WinUser.h>
namespace {
EmbossStyle create_style(const std::wstring& name, const std::wstring& path) {
return { boost::nowide::narrow(name.c_str()),
boost::nowide::narrow(path.c_str()),
EmbossStyle::Type::file_path, FontProp() };
}
} // namespace
// Get system font file path
std::optional<std::wstring> Emboss::get_font_path(const std::wstring &font_face_name)
{
// static const LPWSTR fontRegistryPath = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
static const LPCWSTR fontRegistryPath = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
HKEY hKey;
LONG result;
// Open Windows font registry key
result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, fontRegistryPath, 0, KEY_READ, &hKey);
if (result != ERROR_SUCCESS) return {};
DWORD maxValueNameSize, maxValueDataSize;
result = RegQueryInfoKey(hKey, 0, 0, 0, 0, 0, 0, 0, &maxValueNameSize, &maxValueDataSize, 0, 0);
if (result != ERROR_SUCCESS) return {};
DWORD valueIndex = 0;
LPWSTR valueName = new WCHAR[maxValueNameSize];
LPBYTE valueData = new BYTE[maxValueDataSize];
DWORD valueNameSize, valueDataSize, valueType;
std::wstring wsFontFile;
// Look for a matching font name
do {
wsFontFile.clear();
valueDataSize = maxValueDataSize;
valueNameSize = maxValueNameSize;
result = RegEnumValue(hKey, valueIndex, valueName, &valueNameSize, 0, &valueType, valueData, &valueDataSize);
valueIndex++;
if (result != ERROR_SUCCESS || valueType != REG_SZ) {
continue;
}
std::wstring wsValueName(valueName, valueNameSize);
// Found a match
if (_wcsnicmp(font_face_name.c_str(), wsValueName.c_str(), font_face_name.length()) == 0) {
wsFontFile.assign((LPWSTR)valueData, valueDataSize);
break;
}
}while (result != ERROR_NO_MORE_ITEMS);
delete[] valueName;
delete[] valueData;
RegCloseKey(hKey);
if (wsFontFile.empty()) return {};
// Build full font file path
WCHAR winDir[MAX_PATH];
GetWindowsDirectory(winDir, MAX_PATH);
std::wstringstream ss;
ss << winDir << "\\Fonts\\" << wsFontFile;
wsFontFile = ss.str();
return wsFontFile;
}
EmbossStyles Emboss::get_font_list()
{
//EmbossStyles list1 = get_font_list_by_enumeration();
//EmbossStyles list2 = get_font_list_by_register();
//EmbossStyles list3 = get_font_list_by_folder();
return get_font_list_by_register();
}
EmbossStyles Emboss::get_font_list_by_register() {
// static const LPWSTR fontRegistryPath = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
static const LPCWSTR fontRegistryPath = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts";
HKEY hKey;
LONG result;
// Open Windows font registry key
result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, fontRegistryPath, 0, KEY_READ, &hKey);
if (result != ERROR_SUCCESS) {
assert(false);
//std::wcerr << L"Can not Open register key (" << fontRegistryPath << ")"
// << L", function 'RegOpenKeyEx' return code: " << result << std::endl;
return {};
}
DWORD maxValueNameSize, maxValueDataSize;
result = RegQueryInfoKey(hKey, 0, 0, 0, 0, 0, 0, 0, &maxValueNameSize,
&maxValueDataSize, 0, 0);
if (result != ERROR_SUCCESS) {
assert(false);
// Can not earn query key, function 'RegQueryInfoKey' return code: result
return {};
}
// Build full font file path
WCHAR winDir[MAX_PATH];
GetWindowsDirectory(winDir, MAX_PATH);
std::wstring font_path = std::wstring(winDir) + L"\\Fonts\\";
EmbossStyles font_list;
DWORD valueIndex = 0;
// Look for a matching font name
LPWSTR font_name = new WCHAR[maxValueNameSize];
LPBYTE fileTTF_name = new BYTE[maxValueDataSize];
DWORD font_name_size, fileTTF_name_size, valueType;
do {
fileTTF_name_size = maxValueDataSize;
font_name_size = maxValueNameSize;
result = RegEnumValue(hKey, valueIndex, font_name, &font_name_size, 0,
&valueType, fileTTF_name, &fileTTF_name_size);
valueIndex++;
if (result != ERROR_SUCCESS || valueType != REG_SZ) continue;
std::wstring font_name_w(font_name, font_name_size);
std::wstring file_name_w((LPWSTR) fileTTF_name, fileTTF_name_size);
std::wstring path_w = font_path + file_name_w;
// filtrate .fon from lists
size_t pos = font_name_w.rfind(L" (TrueType)");
if (pos >= font_name_w.size()) continue;
// remove TrueType text from name
font_name_w = std::wstring(font_name_w, 0, pos);
font_list.emplace_back(create_style(font_name_w, path_w));
} while (result != ERROR_NO_MORE_ITEMS);
delete[] font_name;
delete[] fileTTF_name;
RegCloseKey(hKey);
return font_list;
}
// TODO: Fix global function
bool CALLBACK EnumFamCallBack(LPLOGFONT lplf,
LPNEWTEXTMETRIC lpntm,
DWORD FontType,
LPVOID aFontList)
{
std::vector<std::wstring> *fontList =
(std::vector<std::wstring> *) (aFontList);
if (FontType & TRUETYPE_FONTTYPE) {
std::wstring name = lplf->lfFaceName;
fontList->push_back(name);
}
return true;
// UNREFERENCED_PARAMETER(lplf);
UNREFERENCED_PARAMETER(lpntm);
}
EmbossStyles Emboss::get_font_list_by_enumeration() {
HDC hDC = GetDC(NULL);
std::vector<std::wstring> font_names;
EnumFontFamilies(hDC, (LPCTSTR) NULL, (FONTENUMPROC) EnumFamCallBack,
(LPARAM) &font_names);
EmbossStyles font_list;
for (const std::wstring &font_name : font_names) {
font_list.emplace_back(create_style(font_name, L""));
}
return font_list;
}
EmbossStyles Emboss::get_font_list_by_folder() {
EmbossStyles result;
WCHAR winDir[MAX_PATH];
UINT winDir_size = GetWindowsDirectory(winDir, MAX_PATH);
std::wstring search_dir = std::wstring(winDir, winDir_size) + L"\\Fonts\\";
WIN32_FIND_DATA fd;
HANDLE hFind;
// By path_to_url has also suffix .tte
std::vector<std::wstring> suffixes = {L"*.ttf", L"*.ttc", L"*.tte"};
for (const std::wstring &suffix : suffixes) {
hFind = ::FindFirstFile((search_dir + suffix).c_str(), &fd);
if (hFind == INVALID_HANDLE_VALUE) continue;
do {
// skip folder . and ..
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue;
std::wstring file_name(fd.cFileName);
// TODO: find font name instead of filename
result.emplace_back(create_style(file_name, search_dir + file_name));
} while (::FindNextFile(hFind, &fd));
::FindClose(hFind);
}
return result;
}
#else
EmbossStyles Emboss::get_font_list() {
// not implemented
return {};
}
std::optional<std::wstring> Emboss::get_font_path(const std::wstring &font_face_name){
// not implemented
return {};
}
#endif
std::unique_ptr<FontFile> Emboss::create_font_file(
std::unique_ptr<std::vector<unsigned char>> data)
{
int collection_size = stbtt_GetNumberOfFonts(data->data());
// at least one font must be inside collection
if (collection_size < 1) {
assert(false);
// There is no font collection inside font data
return nullptr;
}
unsigned int c_size = static_cast<unsigned int>(collection_size);
std::vector<FontFile::Info> infos;
infos.reserve(c_size);
for (unsigned int i = 0; i < c_size; ++i) {
auto font_info = load_font_info(data->data(), i);
if (!font_info.has_value()) return nullptr;
const stbtt_fontinfo *info = &(*font_info);
// load information about line gap
int ascent, descent, linegap;
stbtt_GetFontVMetrics(info, &ascent, &descent, &linegap);
float pixels = 1000.; // value is irelevant
float em_pixels = stbtt_ScaleForMappingEmToPixels(info, pixels);
int unit_per_em = static_cast<int>(std::round(pixels / em_pixels));
infos.emplace_back(FontFile::Info{ascent, descent, linegap, unit_per_em});
}
return std::make_unique<FontFile>(std::move(data), std::move(infos));
}
std::unique_ptr<FontFile> Emboss::create_font_file(const char *file_path)
{
FILE *file = std::fopen(file_path, "rb");
if (file == nullptr) {
assert(false);
BOOST_LOG_TRIVIAL(error) << "Couldn't open " << file_path << " for reading.";
return nullptr;
}
ScopeGuard sg([&file]() { std::fclose(file); });
// find size of file
if (fseek(file, 0L, SEEK_END) != 0) {
assert(false);
BOOST_LOG_TRIVIAL(error) << "Couldn't fseek file " << file_path << " for size measure.";
return nullptr;
}
size_t size = ftell(file);
if (size == 0) {
assert(false);
BOOST_LOG_TRIVIAL(error) << "Size of font file is zero. Can't read.";
return nullptr;
}
rewind(file);
auto buffer = std::make_unique<std::vector<unsigned char>>(size);
size_t count_loaded_bytes = fread((void *) &buffer->front(), 1, size, file);
if (count_loaded_bytes != size) {
assert(false);
BOOST_LOG_TRIVIAL(error) << "Different loaded(from file) data size.";
return nullptr;
}
return create_font_file(std::move(buffer));
}
#ifdef _WIN32
static bool load_hfont(void* hfont, DWORD &dwTable, DWORD &dwOffset, size_t& size, HDC hdc = nullptr){
bool del_hdc = false;
if (hdc == nullptr) {
del_hdc = true;
hdc = ::CreateCompatibleDC(NULL);
if (hdc == NULL) return false;
}
// To retrieve the data from the beginning of the file for TrueType
// Collection files specify 'ttcf' (0x66637474).
dwTable = 0x66637474;
dwOffset = 0;
::SelectObject(hdc, hfont);
size = ::GetFontData(hdc, dwTable, dwOffset, NULL, 0);
if (size == GDI_ERROR) {
// HFONT is NOT TTC(collection)
dwTable = 0;
size = ::GetFontData(hdc, dwTable, dwOffset, NULL, 0);
}
if (size == 0 || size == GDI_ERROR) {
if (del_hdc) ::DeleteDC(hdc);
return false;
}
return true;
}
void *Emboss::can_load(void *hfont)
{
DWORD dwTable=0, dwOffset=0;
size_t size = 0;
if (!load_hfont(hfont, dwTable, dwOffset, size)) return nullptr;
return hfont;
}
std::unique_ptr<FontFile> Emboss::create_font_file(void *hfont)
{
HDC hdc = ::CreateCompatibleDC(NULL);
if (hdc == NULL) {
assert(false);
BOOST_LOG_TRIVIAL(error) << "Can't create HDC by CreateCompatibleDC(NULL).";
return nullptr;
}
DWORD dwTable=0,dwOffset = 0;
size_t size;
if (!load_hfont(hfont, dwTable, dwOffset, size, hdc)) {
::DeleteDC(hdc);
return nullptr;
}
auto buffer = std::make_unique<std::vector<unsigned char>>(size);
size_t loaded_size = ::GetFontData(hdc, dwTable, dwOffset, buffer->data(), size);
::DeleteDC(hdc);
if (size != loaded_size) {
assert(false);
BOOST_LOG_TRIVIAL(error) << "Different loaded(from HFONT) data size.";
return nullptr;
}
return create_font_file(std::move(buffer));
}
#endif // _WIN32
std::optional<Glyph> Emboss::letter2glyph(const FontFile &font,
unsigned int font_index,
int letter,
float flatness)
{
if (!is_valid(font, font_index)) return {};
auto font_info_opt = load_font_info(font.data->data(), font_index);
if (!font_info_opt.has_value()) return {};
return get_glyph(*font_info_opt, letter, flatness);
}
const FontFile::Info &Emboss::get_font_info(const FontFile &font, const FontProp &prop)
{
unsigned int font_index = prop.collection_number.value_or(0);
assert(is_valid(font, font_index));
return font.infos[font_index];
}
int Emboss::get_line_height(const FontFile &font, const FontProp &prop) {
const FontFile::Info &info = get_font_info(font, prop);
int line_height = info.ascent - info.descent + info.linegap;
line_height += prop.line_gap.value_or(0);
return static_cast<int>(line_height / SHAPE_SCALE);
}
namespace {
ExPolygons letter2shapes(
wchar_t letter,
Point &cursor,
const FontFile &font,
Glyphs &cache,
const FontProp &font_prop,
fontinfo_opt &font_info_cache
) {
if (letter == '\n') {
cursor.x() = 0;
// 2d shape has opposit direction of y
cursor.y() -= get_line_height(font, font_prop);
return {};
}
if (letter == '\t') {
// '\t' = 4*space => same as imgui
const int count_spaces = 4;
const Glyph *space = get_glyph(int(' '), font, font_prop, cache, font_info_cache);
if (space == nullptr)
return {};
cursor.x() += count_spaces * space->advance_width;
return {};
}
if (letter == '\r')
return {};
int unicode = static_cast<int>(letter);
auto it = cache.find(unicode);
// Create glyph from font file and cache it
const Glyph *glyph_ptr = (it != cache.end()) ? &it->second : get_glyph(unicode, font, font_prop, cache, font_info_cache);
if (glyph_ptr == nullptr)
return {};
// move glyph to cursor position
ExPolygons expolygons = glyph_ptr->shape; // copy
for (ExPolygon &expolygon : expolygons)
expolygon.translate(cursor);
cursor.x() += glyph_ptr->advance_width;
return expolygons;
}
// Check cancel every X letters in text
// Lower number - too much checks(slows down)
// Higher number - slows down response on cancelation
const int CANCEL_CHECK = 10;
} // namespace
namespace {
HealedExPolygons union_with_delta(const ExPolygonsWithIds &shapes, float delta, unsigned max_heal_iteration)
{
// unify to one expolygons
ExPolygons expolygons;
for (const ExPolygonsWithId &shape : shapes) {
if (shape.expoly.empty())
continue;
expolygons_append(expolygons, offset_ex(shape.expoly, delta));
}
ExPolygons result = union_ex(expolygons);
result = offset_ex(result, -delta);
bool is_healed = heal_expolygons(result, max_heal_iteration);
return {result, is_healed};
}
} // namespace
ExPolygons Slic3r::union_with_delta(EmbossShape &shape, float delta, unsigned max_heal_iteration)
{
if (!shape.final_shape.expolygons.empty())
return shape.final_shape;
shape.final_shape = ::union_with_delta(shape.shapes_with_ids, delta, max_heal_iteration);
for (const ExPolygonsWithId &e : shape.shapes_with_ids)
if (!e.is_healed)
shape.final_shape.is_healed = false;
return shape.final_shape.expolygons;
}
void Slic3r::translate(ExPolygonsWithIds &expolygons_with_ids, const Point &p)
{
for (ExPolygonsWithId &expolygons_with_id : expolygons_with_ids)
translate(expolygons_with_id.expoly, p);
}
BoundingBox Slic3r::get_extents(const ExPolygonsWithIds &expolygons_with_ids)
{
BoundingBox bb;
for (const ExPolygonsWithId &expolygons_with_id : expolygons_with_ids)
bb.merge(get_extents(expolygons_with_id.expoly));
return bb;
}
void Slic3r::center(ExPolygonsWithIds &e)
{
BoundingBox bb = get_extents(e);
translate(e, -bb.center());
}
HealedExPolygons Emboss::text2shapes(FontFileWithCache &font_with_cache, const char *text, const FontProp &font_prop, const std::function<bool()>& was_canceled)
{
std::wstring text_w = boost::nowide::widen(text);
ExPolygonsWithIds vshapes = text2vshapes(font_with_cache, text_w, font_prop, was_canceled);
float delta = static_cast<float>(1. / SHAPE_SCALE);
return ::union_with_delta(vshapes, delta, MAX_HEAL_ITERATION_OF_TEXT);
}
namespace {
/// <summary>
/// Align shape against pivot
/// </summary>
/// <param name="shapes">Shapes to align
/// Prerequisities: shapes are aligned left top</param>
/// <param name="text">To detect end of lines - to be able horizontal center the line</param>
/// <param name="prop">Containe Horizontal and vertical alignment</param>
/// <param name="font">Needed for scale and font size</param>
void align_shape(ExPolygonsWithIds &shapes, const std::wstring &text, const FontProp &prop, const FontFile &font);
}
ExPolygonsWithIds Emboss::text2vshapes(FontFileWithCache &font_with_cache, const std::wstring& text, const FontProp &font_prop, const std::function<bool()>& was_canceled){
assert(font_with_cache.has_value());
if (!font_with_cache.has_value())
return {};
const FontFile &font = *font_with_cache.font_file;
unsigned int font_index = font_prop.collection_number.value_or(0);
if (!is_valid(font, font_index))
return {};
std::shared_ptr<Glyphs> cache = font_with_cache.cache; // copy pointer
unsigned counter = CANCEL_CHECK-1; // it is needed to validate using of cache
Point cursor(0, 0);
fontinfo_opt font_info_cache;
ExPolygonsWithIds result;
result.reserve(text.size());
for (wchar_t letter : text) {
if (++counter == CANCEL_CHECK) {
counter = 0;
if (was_canceled())
return {};
}
unsigned id = static_cast<unsigned>(letter);
result.push_back({id, letter2shapes(letter, cursor, font, *cache, font_prop, font_info_cache)});
}
align_shape(result, text, font_prop, font);
return result;
}
#include <boost/range/adaptor/reversed.hpp>
unsigned Emboss::get_count_lines(const std::wstring& ws)
{
if (ws.empty())
return 0;
unsigned count = 1;
for (wchar_t wc : ws)
if (wc == '\n')
++count;
return count;
// unsigned prev_count = 0;
// for (wchar_t wc : ws)
// if (wc == '\n')
// ++prev_count;
// else
// break;
//
// unsigned post_count = 0;
// for (wchar_t wc : boost::adaptors::reverse(ws))
// if (wc == '\n')
// ++post_count;
// else
// break;
//return count - prev_count - post_count;
}
unsigned Emboss::get_count_lines(const std::string &text)
{
std::wstring ws = boost::nowide::widen(text.c_str());
return get_count_lines(ws);
}
unsigned Emboss::get_count_lines(const ExPolygonsWithIds &shapes) {
if (shapes.empty())
return 0; // no glyphs
unsigned result = 1; // one line is minimum
for (const ExPolygonsWithId &shape_id : shapes)
if (shape_id.id == ENTER_UNICODE)
++result;
return result;
}
void Emboss::apply_transformation(const std::optional<float>& angle, const std::optional<float>& distance, Transform3d &transformation) {
if (angle.has_value()) {
double angle_z = *angle;
transformation *= Eigen::AngleAxisd(angle_z, Vec3d::UnitZ());
}
if (distance.has_value()) {
Vec3d translate = Vec3d::UnitZ() * (*distance);
transformation.translate(translate);
}
}
bool Emboss::is_italic(const FontFile &font, unsigned int font_index)
{
if (font_index >= font.infos.size()) return false;
fontinfo_opt font_info_opt = load_font_info(font.data->data(), font_index);
if (!font_info_opt.has_value()) return false;
stbtt_fontinfo *info = &(*font_info_opt);
// path_to_url
// path_to_url
// 2 ==> Style / Subfamily name
int name_id = 2;
int length;
const char* value = stbtt_GetFontNameString(info, &length,
STBTT_PLATFORM_ID_MICROSOFT,
STBTT_MS_EID_UNICODE_BMP,
STBTT_MS_LANG_ENGLISH,
name_id);
// value is big endian utf-16 i need extract only normal chars
std::string value_str;
value_str.reserve(length / 2);
for (int i = 1; i < length; i += 2)
value_str.push_back(value[i]);
// lower case
std::transform(value_str.begin(), value_str.end(), value_str.begin(),
[](unsigned char c) { return std::tolower(c); });
const std::vector<std::string> italics({"italic", "oblique"});
for (const std::string &it : italics) {
if (value_str.find(it) != std::string::npos) {
return true;
}
}
return false;
}
std::string Emboss::create_range_text(const std::string &text,
const FontFile &font,
unsigned int font_index,
bool *exist_unknown)
{
if (!is_valid(font, font_index)) return {};
std::wstring ws = boost::nowide::widen(text);
// need remove symbols not contained in font
std::sort(ws.begin(), ws.end());
auto font_info_opt = load_font_info(font.data->data(), 0);
if (!font_info_opt.has_value()) return {};
const stbtt_fontinfo *font_info = &(*font_info_opt);
if (exist_unknown != nullptr) *exist_unknown = false;
int prev_unicode = -1;
ws.erase(std::remove_if(ws.begin(), ws.end(),
[&prev_unicode, font_info, exist_unknown](wchar_t wc) -> bool {
int unicode = static_cast<int>(wc);
// skip white spaces
if (unicode == '\n' ||
unicode == '\r' ||
unicode == '\t') return true;
// is duplicit?
if (prev_unicode == unicode) return true;
prev_unicode = unicode;
// can find in font?
bool is_unknown = !stbtt_FindGlyphIndex(font_info, unicode);
if (is_unknown && exist_unknown != nullptr)
*exist_unknown = true;
return is_unknown;
}), ws.end());
return boost::nowide::narrow(ws);
}
double Emboss::get_text_shape_scale(const FontProp &fp, const FontFile &ff)
{
const FontFile::Info &info = get_font_info(ff, fp);
double scale = fp.size_in_mm / (double) info.unit_per_em;
// Shape is scaled for store point coordinate as integer
return scale * SHAPE_SCALE;
}
namespace {
void add_quad(uint32_t i1,
uint32_t i2,
indexed_triangle_set &result,
uint32_t count_point)
{
// bottom indices
uint32_t i1_ = i1 + count_point;
uint32_t i2_ = i2 + count_point;
result.indices.emplace_back(i2, i2_, i1);
result.indices.emplace_back(i1_, i1, i2_);
};
indexed_triangle_set polygons2model_unique(
const ExPolygons &shape2d,
const IProjection &projection,
const Points &points)
{
// CW order of triangle indices
std::vector<Vec3i> shape_triangles=Triangulation::triangulate(shape2d, points);
uint32_t count_point = points.size();
indexed_triangle_set result;
result.vertices.reserve(2 * count_point);
std::vector<Vec3f> &front_points = result.vertices; // alias
std::vector<Vec3f> back_points;
back_points.reserve(count_point);
for (const Point &p : points) {
auto p2 = projection.create_front_back(p);
front_points.push_back(p2.first.cast<float>());
back_points.push_back(p2.second.cast<float>());
}
// insert back points, front are already in
result.vertices.insert(result.vertices.end(),
std::make_move_iterator(back_points.begin()),
std::make_move_iterator(back_points.end()));
result.indices.reserve(shape_triangles.size() * 2 + points.size() * 2);
// top triangles - change to CCW
for (const Vec3i &t : shape_triangles)
result.indices.emplace_back(t.x(), t.z(), t.y());
// bottom triangles - use CW
for (const Vec3i &t : shape_triangles)
result.indices.emplace_back(t.x() + count_point,
t.y() + count_point,
t.z() + count_point);
// quads around - zig zag by triangles
size_t polygon_offset = 0;
auto add_quads = [&polygon_offset,&result, &count_point]
(const Polygon& polygon) {
uint32_t polygon_points = polygon.points.size();
// previous index
uint32_t prev = polygon_offset + polygon_points - 1;
for (uint32_t p = 0; p < polygon_points; ++p) {
uint32_t index = polygon_offset + p;
add_quad(prev, index, result, count_point);
prev = index;
}
polygon_offset += polygon_points;
};
for (const ExPolygon &expolygon : shape2d) {
add_quads(expolygon.contour);
for (const Polygon &hole : expolygon.holes) add_quads(hole);
}
return result;
}
indexed_triangle_set polygons2model_duplicit(
const ExPolygons &shape2d,
const IProjection &projection,
const Points &points,
const Points &duplicits)
{
// CW order of triangle indices
std::vector<uint32_t> changes = Triangulation::create_changes(points, duplicits);
std::vector<Vec3i> shape_triangles = Triangulation::triangulate(shape2d, points, changes);
uint32_t count_point = *std::max_element(changes.begin(), changes.end()) + 1;
indexed_triangle_set result;
result.vertices.reserve(2 * count_point);
std::vector<Vec3f> &front_points = result.vertices;
std::vector<Vec3f> back_points;
back_points.reserve(count_point);
uint32_t max_index = std::numeric_limits<uint32_t>::max();
for (uint32_t i = 0; i < changes.size(); ++i) {
uint32_t index = changes[i];
if (max_index != std::numeric_limits<uint32_t>::max() &&
index <= max_index) continue; // duplicit point
assert(index == max_index + 1);
assert(front_points.size() == index);
assert(back_points.size() == index);
max_index = index;
const Point &p = points[i];
auto p2 = projection.create_front_back(p);
front_points.push_back(p2.first.cast<float>());
back_points.push_back(p2.second.cast<float>());
}
assert(max_index+1 == count_point);
// insert back points, front are already in
result.vertices.insert(result.vertices.end(),
std::make_move_iterator(back_points.begin()),
std::make_move_iterator(back_points.end()));
result.indices.reserve(shape_triangles.size() * 2 + points.size() * 2);
// top triangles - change to CCW
for (const Vec3i &t : shape_triangles)
result.indices.emplace_back(t.x(), t.z(), t.y());
// bottom triangles - use CW
for (const Vec3i &t : shape_triangles)
result.indices.emplace_back(t.x() + count_point, t.y() + count_point,
t.z() + count_point);
// quads around - zig zag by triangles
size_t polygon_offset = 0;
auto add_quads = [&polygon_offset, &result, count_point, &changes]
(const Polygon &polygon) {
uint32_t polygon_points = polygon.points.size();
// previous index
uint32_t prev = changes[polygon_offset + polygon_points - 1];
for (uint32_t p = 0; p < polygon_points; ++p) {
uint32_t index = changes[polygon_offset + p];
if (prev == index) continue;
add_quad(prev, index, result, count_point);
prev = index;
}
polygon_offset += polygon_points;
};
for (const ExPolygon &expolygon : shape2d) {
add_quads(expolygon.contour);
for (const Polygon &hole : expolygon.holes) add_quads(hole);
}
return result;
}
} // namespace
indexed_triangle_set Emboss::polygons2model(const ExPolygons &shape2d,
const IProjection &projection)
{
Points points = to_points(shape2d);
Points duplicits = collect_duplicates(points);
return (duplicits.empty()) ?
polygons2model_unique(shape2d, projection, points) :
polygons2model_duplicit(shape2d, projection, points, duplicits);
}
std::pair<Vec3d, Vec3d> Emboss::ProjectZ::create_front_back(const Point &p) const
{
Vec3d front(p.x(), p.y(), 0.);
return std::make_pair(front, project(front));
}
Vec3d Emboss::ProjectZ::project(const Vec3d &point) const
{
Vec3d res = point; // copy
res.z() = m_depth;
return res;
}
std::optional<Vec2d> Emboss::ProjectZ::unproject(const Vec3d &p, double *depth) const {
return Vec2d(p.x(), p.y());
}
Vec3d Emboss::suggest_up(const Vec3d normal, double up_limit)
{
// Normal must be 1
assert(is_approx(normal.squaredNorm(), 1.));
// wanted up direction of result
Vec3d wanted_up_side =
(std::fabs(normal.z()) > up_limit)?
Vec3d::UnitY() : Vec3d::UnitZ();
// create perpendicular unit vector to surface triangle normal vector
// lay on surface of triangle and define up vector for text
Vec3d wanted_up_dir = normal.cross(wanted_up_side).cross(normal);
// normal3d is NOT perpendicular to normal_up_dir
wanted_up_dir.normalize();
return wanted_up_dir;
}
std::optional<float> Emboss::calc_up(const Transform3d &tr, double up_limit)
{
auto tr_linear = tr.linear();
// z base of transformation ( tr * UnitZ )
Vec3d normal = tr_linear.col(2);
// scaled matrix has base with different size
normal.normalize();
Vec3d suggested = suggest_up(normal, up_limit);
assert(is_approx(suggested.squaredNorm(), 1.));
Vec3d up = tr_linear.col(1); // tr * UnitY()
up.normalize();
Matrix3d m;
m.row(0) = up;
m.row(1) = suggested;
m.row(2) = normal;
double det = m.determinant();
double dot = suggested.dot(up);
double res = -atan2(det, dot);
if (is_approx(res, 0.))
return {};
return res;
}
Transform3d Emboss::create_transformation_onto_surface(const Vec3d &position,
const Vec3d &normal,
double up_limit)
{
// is normalized ?
assert(is_approx(normal.squaredNorm(), 1.));
// up and emboss direction for generated model
Vec3d up_dir = Vec3d::UnitY();
Vec3d emboss_dir = Vec3d::UnitZ();
// after cast from float it needs to be normalized again
Vec3d wanted_up_dir = suggest_up(normal, up_limit);
// perpendicular to emboss vector of text and normal
Vec3d axis_view;
double angle_view;
if (normal == -Vec3d::UnitZ()) {
// text_emboss_dir has opposit direction to wanted_emboss_dir
axis_view = Vec3d::UnitY();
angle_view = M_PI;
} else {
axis_view = emboss_dir.cross(normal);
angle_view = std::acos(emboss_dir.dot(normal)); // in rad
axis_view.normalize();
}
Eigen::AngleAxis view_rot(angle_view, axis_view);
Vec3d wanterd_up_rotated = view_rot.matrix().inverse() * wanted_up_dir;
wanterd_up_rotated.normalize();
double angle_up = std::acos(up_dir.dot(wanterd_up_rotated));
Vec3d text_view = up_dir.cross(wanterd_up_rotated);
Vec3d diff_view = emboss_dir - text_view;
if (std::fabs(diff_view.x()) > 1. ||
std::fabs(diff_view.y()) > 1. ||
std::fabs(diff_view.z()) > 1.) // oposit direction
angle_up *= -1.;
Eigen::AngleAxis up_rot(angle_up, emboss_dir);
Transform3d transform = Transform3d::Identity();
transform.translate(position);
transform.rotate(view_rot);
transform.rotate(up_rot);
return transform;
}
// OrthoProject
std::pair<Vec3d, Vec3d> Emboss::OrthoProject::create_front_back(const Point &p) const {
Vec3d front(p.x(), p.y(), 0.);
Vec3d front_tr = m_matrix * front;
return std::make_pair(front_tr, project(front_tr));
}
Vec3d Emboss::OrthoProject::project(const Vec3d &point) const
{
return point + m_direction;
}
std::optional<Vec2d> Emboss::OrthoProject::unproject(const Vec3d &p, double *depth) const
{
Vec3d pp = m_matrix_inv * p;
if (depth != nullptr) *depth = pp.z();
return Vec2d(pp.x(), pp.y());
}
// sample slice
namespace {
// using coor2 = int64_t;
using Coord2 = double;
using P2 = Eigen::Matrix<Coord2, 2, 1, Eigen::DontAlign>;
bool point_in_distance(const Coord2 &distance_sq, PolygonPoint &polygon_point, const size_t &i, const Slic3r::Polygon &polygon, bool is_first, bool is_reverse = false)
{
size_t s = polygon.size();
size_t ii = (i + polygon_point.index) % s;
// second point of line
const Point &p = polygon[ii];
Point p_d = p - polygon_point.point;
P2 p_d2 = p_d.cast<Coord2>();
Coord2 p_distance_sq = p_d2.squaredNorm();
if (p_distance_sq < distance_sq)
return false;
// found line
if (is_first) {
// on same line
// center also lay on line
// new point is distance moved from point by direction
polygon_point.point += p_d * sqrt(distance_sq / p_distance_sq);
return true;
}
// line cross circle
// start point of line
size_t ii2 = (is_reverse) ? (ii + 1) % s : (ii + s - 1) % s;
polygon_point.index = (is_reverse) ? ii : ii2;
const Point &p2 = polygon[ii2];
Point line_dir = p2 - p;
P2 line_dir2 = line_dir.cast<Coord2>();
Coord2 a = line_dir2.dot(line_dir2);
Coord2 b = 2 * p_d2.dot(line_dir2);
Coord2 c = p_d2.dot(p_d2) - distance_sq;
double discriminant = b * b - 4 * a * c;
if (discriminant < 0) {
assert(false);
// no intersection
polygon_point.point = p;
return true;
}
// ray didn't totally miss sphere,
// so there is a solution to
// the equation.
discriminant = sqrt(discriminant);
// either solution may be on or off the ray so need to test both
// t1 is always the smaller value, because BOTH discriminant and
// a are nonnegative.
double t1 = (-b - discriminant) / (2 * a);
double t2 = (-b + discriminant) / (2 * a);
double t = std::min(t1, t2);
if (t < 0. || t > 1.) {
// Bad intersection
assert(false);
polygon_point.point = p;
return true;
}
polygon_point.point = p + (t * line_dir2).cast<Point::coord_type>();
return true;
}
void point_in_distance(int32_t distance, PolygonPoint &p, const Slic3r::Polygon &polygon)
{
Coord2 distance_sq = static_cast<Coord2>(distance) * distance;
bool is_first = true;
for (size_t i = 1; i < polygon.size(); ++i) {
if (point_in_distance(distance_sq, p, i, polygon, is_first))
return;
is_first = false;
}
// There is not point on polygon with this distance
}
void point_in_reverse_distance(int32_t distance, PolygonPoint &p, const Slic3r::Polygon &polygon)
{
Coord2 distance_sq = static_cast<Coord2>(distance) * distance;
bool is_first = true;
bool is_reverse = true;
for (size_t i = polygon.size(); i > 0; --i) {
if (point_in_distance(distance_sq, p, i, polygon, is_first, is_reverse))
return;
is_first = false;
}
// There is not point on polygon with this distance
}
} // namespace
// calculate rotation, need copy of polygon point
double Emboss::calculate_angle(int32_t distance, PolygonPoint polygon_point, const Polygon &polygon)
{
PolygonPoint polygon_point2 = polygon_point; // copy
point_in_distance(distance, polygon_point, polygon);
point_in_reverse_distance(distance, polygon_point2, polygon);
Point surface_dir = polygon_point2.point - polygon_point.point;
Point norm(-surface_dir.y(), surface_dir.x());
Vec2d norm_d = norm.cast<double>();
//norm_d.normalize();
return std::atan2(norm_d.y(), norm_d.x());
}
std::vector<double> Emboss::calculate_angles(const BoundingBoxes &glyph_sizes, const PolygonPoints& polygon_points, const Polygon &polygon)
{
const int32_t default_distance = static_cast<int32_t>(std::round(scale_(5.)));
const int32_t min_distance = static_cast<int32_t>(std::round(scale_(.1)));
std::vector<double> result;
result.reserve(polygon_points.size());
assert(glyph_sizes.size() == polygon_points.size());
if (glyph_sizes.size() != polygon_points.size()) {
// only backup solution should not be used
for (const PolygonPoint &pp : polygon_points)
result.emplace_back(calculate_angle(default_distance, pp, polygon));
return result;
}
for (size_t i = 0; i < polygon_points.size(); i++) {
int32_t distance = glyph_sizes[i].size().x() / 2;
if (distance < min_distance) // too small could lead to false angle
distance = default_distance;
result.emplace_back(calculate_angle(distance, polygon_points[i], polygon));
}
return result;
}
PolygonPoints Emboss::sample_slice(const TextLine &slice, const BoundingBoxes &bbs, double scale)
{
// find BB in center of line
size_t first_right_index = 0;
for (const BoundingBox &bb : bbs)
if (!bb.defined) // white char do not have bb
continue;
else if (bb.min.x() < 0)
++first_right_index;
else
break;
PolygonPoints samples(bbs.size());
int32_t shapes_x_cursor = 0;
PolygonPoint cursor = slice.start; //copy
auto create_sample = [&] //polygon_cursor, &polygon_line_index, &line_bbs, &shapes_x_cursor, &shape_scale, &em_2_polygon, &line, &offsets]
(const BoundingBox &bb, bool is_reverse) {
if (!bb.defined)
return cursor;
Point letter_center = bb.center();
int32_t shape_distance = shapes_x_cursor - letter_center.x();
shapes_x_cursor = letter_center.x();
double distance_mm = shape_distance * scale;
int32_t distance_polygon = static_cast<int32_t>(std::round(scale_(distance_mm)));
if (is_reverse)
point_in_distance(distance_polygon, cursor, slice.polygon);
else
point_in_reverse_distance(distance_polygon, cursor, slice.polygon);
return cursor;
};
// calc transformation for letters on the Right side from center
bool is_reverse = true;
for (size_t index = first_right_index; index < bbs.size(); ++index)
samples[index] = create_sample(bbs[index], is_reverse);
// calc transformation for letters on the Left side from center
if (first_right_index < bbs.size()) {
shapes_x_cursor = bbs[first_right_index].center().x();
cursor = samples[first_right_index];
}else{
// only left side exists
shapes_x_cursor = 0;
cursor = slice.start; // copy
}
is_reverse = false;
for (size_t index_plus_one = first_right_index; index_plus_one > 0; --index_plus_one) {
size_t index = index_plus_one - 1;
samples[index] = create_sample(bbs[index], is_reverse);
}
return samples;
}
namespace {
float get_align_y_offset(FontProp::VerticalAlign align, unsigned count_lines, const FontFile &ff, const FontProp &fp)
{
assert(count_lines != 0);
int line_height = get_line_height(ff, fp);
int ascent = get_font_info(ff, fp).ascent / SHAPE_SCALE;
float line_center = static_cast<float>(std::round(ascent * ASCENT_CENTER));
// direction of Y in 2d is from top to bottom
// zero is on base line of first line
switch (align) {
case FontProp::VerticalAlign::bottom: return line_height * (count_lines - 1);
case FontProp::VerticalAlign::top: return -ascent;
case FontProp::VerticalAlign::center:
default:
return -line_center + line_height * (count_lines - 1) / 2.;
}
}
int32_t get_align_x_offset(FontProp::HorizontalAlign align, const BoundingBox &shape_bb, const BoundingBox &line_bb)
{
switch (align) {
case FontProp::HorizontalAlign::right: return -shape_bb.max.x() + (shape_bb.size().x() - line_bb.size().x());
case FontProp::HorizontalAlign::center: return -shape_bb.center().x() + (shape_bb.size().x() - line_bb.size().x()) / 2;
case FontProp::HorizontalAlign::left: // no change
default: break;
}
return 0;
}
void align_shape(ExPolygonsWithIds &shapes, const std::wstring &text, const FontProp &prop, const FontFile &font)
{
// Shapes have to match letters in text
assert(shapes.size() == text.length());
unsigned count_lines = get_count_lines(text);
int y_offset = get_align_y_offset(prop.align.second, count_lines, font, prop);
// Speed up for left aligned text
if (prop.align.first == FontProp::HorizontalAlign::left){
// already horizontaly aligned
for (ExPolygonsWithId& shape : shapes)
for (ExPolygon &s : shape.expoly)
s.translate(Point(0, y_offset));
return;
}
BoundingBox shape_bb;
for (const ExPolygonsWithId& shape: shapes)
shape_bb.merge(get_extents(shape.expoly));
auto get_line_bb = [&](size_t j) {
BoundingBox line_bb;
for (; j < text.length() && text[j] != '\n'; ++j)
line_bb.merge(get_extents(shapes[j].expoly));
return line_bb;
};
// Align x line by line
Point offset(
get_align_x_offset(prop.align.first, shape_bb, get_line_bb(0)),
y_offset);
for (size_t i = 0; i < shapes.size(); ++i) {
wchar_t letter = text[i];
if (letter == '\n'){
offset.x() = get_align_x_offset(prop.align.first, shape_bb, get_line_bb(i + 1));
continue;
}
ExPolygons &shape = shapes[i].expoly;
for (ExPolygon &s : shape)
s.translate(offset);
}
}
} // namespace
double Emboss::get_align_y_offset_in_mm(FontProp::VerticalAlign align, unsigned count_lines, const FontFile &ff, const FontProp &fp){
float offset_in_font_point = get_align_y_offset(align, count_lines, ff, fp);
double scale = get_text_shape_scale(fp, ff);
return scale * offset_in_font_point;
}
#ifdef REMOVE_SPIKES
#include <Geometry.hpp>
void remove_spikes(Polygon &polygon, const SpikeDesc &spike_desc)
{
enum class Type {
add, // Move with point B on A-side and add new point on C-side
move, // Only move with point B
erase // left only points A and C without move
};
struct SpikeHeal
{
Type type;
size_t index;
Point b;
Point add;
};
using SpikeHeals = std::vector<SpikeHeal>;
SpikeHeals heals;
size_t count = polygon.size();
if (count < 3)
return;
const Point *ptr_a = &polygon[count - 2];
const Point *ptr_b = &polygon[count - 1];
for (const Point &c : polygon) {
const Point &a = *ptr_a;
const Point &b = *ptr_b;
ScopeGuard sg([&ptr_a, &ptr_b, &c]() {
// prepare for next loop
ptr_a = ptr_b;
ptr_b = &c;
});
// calc sides
Point ba = a - b;
Point bc = c - b;
Vec2d ba_f = ba.cast<double>();
Vec2d bc_f = bc.cast<double>();
double dot_product = ba_f.dot(bc_f);
// sqrt together after multiplication save one sqrt
double ba_size_sq = ba_f.squaredNorm();
double bc_size_sq = bc_f.squaredNorm();
double norm = sqrt(ba_size_sq * bc_size_sq);
double cos_angle = dot_product / norm;
// small angle are around 1 --> cos(0) = 1
if (cos_angle < spike_desc.cos_angle)
continue;
SpikeHeal heal;
heal.index = &b - &polygon.points.front();
// has to be in range <-1, 1>
// Due to preccission of floating point number could be sligtly out of range
if (cos_angle > 1.)
cos_angle = 1.;
if (cos_angle < -1.)
cos_angle = -1.;
// Current Spike angle
double angle = acos(cos_angle);
double wanted_size = spike_desc.half_bevel / cos(angle / 2.);
double wanted_size_sq = wanted_size * wanted_size;
bool is_ba_short = ba_size_sq < wanted_size_sq;
bool is_bc_short = bc_size_sq < wanted_size_sq;
auto a_side = [&b, &ba_f, &ba_size_sq, &wanted_size]() {
Vec2d ba_norm = ba_f / sqrt(ba_size_sq);
return b + (wanted_size * ba_norm).cast<coord_t>();
};
auto c_side = [&b, &bc_f, &bc_size_sq, &wanted_size]() {
Vec2d bc_norm = bc_f / sqrt(bc_size_sq);
return b + (wanted_size * bc_norm).cast<coord_t>();
};
if (is_ba_short && is_bc_short) {
// remove short spike
heal.type = Type::erase;
} else if (is_ba_short){
// move point B on C-side
heal.type = Type::move;
heal.b = c_side();
} else if (is_bc_short) {
// move point B on A-side
heal.type = Type::move;
heal.b = a_side();
} else {
// move point B on A-side and add point on C-side
heal.type = Type::add;
heal.b = a_side();
heal.add = c_side();
}
heals.push_back(heal);
}
if (heals.empty())
return;
// sort index from high to low
if (heals.front().index == (count - 1))
std::rotate(heals.begin(), heals.begin()+1, heals.end());
std::reverse(heals.begin(), heals.end());
int extend = 0;
int curr_extend = 0;
for (const SpikeHeal &h : heals)
switch (h.type) {
case Type::add:
++curr_extend;
if (extend < curr_extend)
extend = curr_extend;
break;
case Type::erase:
--curr_extend;
}
Points &pts = polygon.points;
if (extend > 0)
pts.reserve(pts.size() + extend);
for (const SpikeHeal &h : heals) {
switch (h.type) {
case Type::add:
pts[h.index] = h.b;
pts.insert(pts.begin() + h.index+1, h.add);
break;
case Type::erase:
pts.erase(pts.begin() + h.index);
break;
case Type::move:
pts[h.index] = h.b;
break;
default: break;
}
}
}
void remove_spikes(Polygons &polygons, const SpikeDesc &spike_desc)
{
for (Polygon &polygon : polygons)
remove_spikes(polygon, spike_desc);
remove_bad(polygons);
}
void remove_spikes(ExPolygons &expolygons, const SpikeDesc &spike_desc)
{
for (ExPolygon &expolygon : expolygons) {
remove_spikes(expolygon.contour, spike_desc);
remove_spikes(expolygon.holes, spike_desc);
}
remove_bad(expolygons);
}
#endif // REMOVE_SPIKES
```
|
```python
""" IMPORTS """
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
from collections.abc import Generator
import dateparser
import urllib3
from requests.auth import HTTPBasicAuth
# Disable insecure warnings
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
''' CONSTANTS '''
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
# todo: add all necessary field types
COMMON_FIELD_TYPES = ['trafficlightprotocol']
DATE_FIELDS_LIST = ["creationdate", "firstseenbysource", "lastseenbysource", "gibdatecompromised"]
IP_COMMON_FIELD_TYPES = ['asn', 'geocountry', 'geolocation']
EVALUATION_FIELDS = ['evaluation.reliability', 'evaluation.credibility',
'evaluation.admiraltyCode', 'evaluation.severity']
EVALUATION_FIELD_TYPES = ['gibreliability', 'gibcredibility', 'gibadmiraltycode', 'gibseverity']
MALWARE_FIELDS = ['malware.name']
MALWARE_FIELD_TYPES = ['gibmalwarename']
THREAT_ACTOR_FIELDS = ['threatActor.name', 'threatActor.isAPT', 'threatActor.id']
THREAT_ACTOR_FIELD_TYPES = ['gibthreatactorname', 'gibthreatactorisapt', 'gibthreatactorid']
MAPPING: dict = {
"compromised/mule": {
"indicators":
[
{
"main_field": 'account', "main_field_type": 'GIB Compromised Mule',
"add_fields": [
'dateAdd', 'sourceType', *MALWARE_FIELDS,
*THREAT_ACTOR_FIELDS, *EVALUATION_FIELDS
],
"add_fields_types": [
'creationdate', 'source', *MALWARE_FIELD_TYPES,
*THREAT_ACTOR_FIELD_TYPES, *EVALUATION_FIELD_TYPES
]
},
{
"main_field": 'cnc.url', "main_field_type": 'URL',
"add_fields": [
*MALWARE_FIELDS, *THREAT_ACTOR_FIELDS, *EVALUATION_FIELDS
],
"add_fields_types": [
*MALWARE_FIELD_TYPES, *THREAT_ACTOR_FIELD_TYPES, *EVALUATION_FIELD_TYPES
]
},
{
"main_field": 'cnc.domain', "main_field_type": 'Domain',
"add_fields": [
*MALWARE_FIELDS, *THREAT_ACTOR_FIELDS, *EVALUATION_FIELDS
],
"add_fields_types": [
*MALWARE_FIELD_TYPES, *THREAT_ACTOR_FIELD_TYPES, *EVALUATION_FIELD_TYPES
]
},
{
"main_field": 'cnc.ipv4.ip', "main_field_type": 'IP',
"add_fields": [
'cnc.ipv4.asn', 'cnc.ipv4.countryName', 'cnc.ipv4.region',
*MALWARE_FIELDS, *THREAT_ACTOR_FIELDS, *EVALUATION_FIELDS
],
"add_fields_types": [
*IP_COMMON_FIELD_TYPES, *MALWARE_FIELD_TYPES, *THREAT_ACTOR_FIELD_TYPES, *EVALUATION_FIELD_TYPES
]
}
]
},
"compromised/imei": {
"indicators":
[
{
"main_field": 'cnc.url', "main_field_type": 'URL',
"add_fields": [
*MALWARE_FIELDS, *THREAT_ACTOR_FIELDS, *EVALUATION_FIELDS
],
"add_fields_types": [
*MALWARE_FIELD_TYPES, *THREAT_ACTOR_FIELD_TYPES, *EVALUATION_FIELD_TYPES
]
},
{
"main_field": 'cnc.domain', "main_field_type": 'Domain',
"add_fields": [
*MALWARE_FIELDS, *THREAT_ACTOR_FIELDS, *EVALUATION_FIELDS
],
"add_fields_types": [
*MALWARE_FIELD_TYPES, *THREAT_ACTOR_FIELD_TYPES, *EVALUATION_FIELD_TYPES
]
},
{
"main_field": 'cnc.ipv4.ip', "main_field_type": 'IP',
"add_fields": [
'cnc.ipv4.asn', 'cnc.ipv4.countryName', 'cnc.ipv4.region',
*MALWARE_FIELDS, *THREAT_ACTOR_FIELDS, *EVALUATION_FIELDS
],
"add_fields_types": [
*IP_COMMON_FIELD_TYPES, *MALWARE_FIELD_TYPES, *THREAT_ACTOR_FIELD_TYPES, *EVALUATION_FIELD_TYPES
]
},
{
"main_field": 'device.imei', "main_field_type": 'GIB Compromised IMEI',
"add_fields": [
'dateDetected', 'dateCompromised', 'device.model',
'client.ipv4.asn', 'client.ipv4.countryName', 'client.ipv4.region', 'client.ipv4.ip',
*MALWARE_FIELDS, *THREAT_ACTOR_FIELDS, *EVALUATION_FIELDS
],
"add_fields_types": [
'creationdate', 'gibdatecompromised', 'devicemodel', *IP_COMMON_FIELD_TYPES, 'ipaddress',
*MALWARE_FIELD_TYPES, *THREAT_ACTOR_FIELD_TYPES, *EVALUATION_FIELD_TYPES
]
}
]
},
"attacks/ddos": {
"indicators":
[
{
"main_field": 'cnc.url', "main_field_type": 'URL',
"add_fields": [
*MALWARE_FIELDS, *THREAT_ACTOR_FIELDS, *EVALUATION_FIELDS,
'dateBegin', 'dateEnd',
],
"add_fields_types": [
*MALWARE_FIELD_TYPES, *THREAT_ACTOR_FIELD_TYPES, *EVALUATION_FIELD_TYPES,
'firstseenbysource', 'lastseenbysource'
]
},
{
"main_field": 'cnc.domain', "main_field_type": 'Domain',
"add_fields": [
*MALWARE_FIELDS, *THREAT_ACTOR_FIELDS, *EVALUATION_FIELDS,
'dateBegin', 'dateEnd',
],
"add_fields_types": [
*MALWARE_FIELD_TYPES, *THREAT_ACTOR_FIELD_TYPES, *EVALUATION_FIELD_TYPES,
'firstseenbysource', 'lastseenbysource'
]
},
{
"main_field": 'cnc.ipv4.ip', "main_field_type": 'IP',
"add_fields": [
'cnc.ipv4.asn', 'cnc.ipv4.countryName', 'cnc.ipv4.region',
*MALWARE_FIELDS, *THREAT_ACTOR_FIELDS, *EVALUATION_FIELDS,
'dateBegin', 'dateEnd'
],
"add_fields_types": [
*IP_COMMON_FIELD_TYPES, *MALWARE_FIELD_TYPES, *THREAT_ACTOR_FIELD_TYPES,
*EVALUATION_FIELD_TYPES,
'firstseenbysource', 'lastseenbysource'
]
},
{
"main_field": 'target.ipv4.ip', "main_field_type": 'GIB Victim IP',
"add_fields": [
'target.ipv4.asn', 'target.ipv4.countryName', 'target.ipv4.region',
*MALWARE_FIELDS, *THREAT_ACTOR_FIELDS,
'dateBegin', 'dateEnd', *EVALUATION_FIELDS
],
"add_fields_types": [
*IP_COMMON_FIELD_TYPES, *MALWARE_FIELD_TYPES, *THREAT_ACTOR_FIELD_TYPES,
'firstseenbysource', 'lastseenbysource', *EVALUATION_FIELD_TYPES
]
}
]
},
"attacks/deface": {
"indicators":
[
{
"main_field": 'url', "main_field_type": 'URL',
"add_fields": [
*THREAT_ACTOR_FIELDS, *EVALUATION_FIELDS
],
"add_fields_types": [
*THREAT_ACTOR_FIELD_TYPES, *EVALUATION_FIELD_TYPES
]
},
{
"main_field": 'targetDomain', "main_field_type": 'Domain',
"add_fields": [
*THREAT_ACTOR_FIELDS, *EVALUATION_FIELDS
],
"add_fields_types": [
*THREAT_ACTOR_FIELD_TYPES, *EVALUATION_FIELD_TYPES
]
},
{
"main_field": 'targetIp.ip', "main_field_type": 'IP',
"add_fields": [
'targetIp.asn', 'targetIp.countryName', 'targetIp.region',
*THREAT_ACTOR_FIELDS, *EVALUATION_FIELDS
],
"add_fields_types": [
*IP_COMMON_FIELD_TYPES, *THREAT_ACTOR_FIELD_TYPES, *EVALUATION_FIELD_TYPES
]
}
]
},
"attacks/phishing": {
"indicators":
[
{
"main_field": 'url', "main_field_type": 'URL',
"add_fields": [
'type', *EVALUATION_FIELDS
],
"add_fields_types": [
'gibphishingtype', *EVALUATION_FIELD_TYPES
]
},
{
"main_field": 'phishingDomain.domain', "main_field_type": 'Domain',
"add_fields": [
'phishingDomain.dateRegistered', 'dateDetected', 'phishingDomain.registrar',
'phishingDomain.title', 'targetBrand', 'targetCategory', 'targetDomain',
'type', *EVALUATION_FIELDS
],
"add_fields_types": [
'creationdate', 'firstseenbysource', 'registrarname',
'gibphishingtitle', 'gibtargetbrand', 'gibtargetcategory', 'gibtargetdomain',
'gibphishingtype', *EVALUATION_FIELD_TYPES
]
},
{
"main_field": 'ipv4.ip', "main_field_type": 'IP',
"add_fields": [
'ipv4.asn', 'ipv4.countryName', 'ipv4.region', 'type', *EVALUATION_FIELDS
],
"add_fields_types": [
*IP_COMMON_FIELD_TYPES, 'gibphishingtype', *EVALUATION_FIELD_TYPES
]
}
]
},
"attacks/phishing_kit": {
"indicators":
[
{
"main_field": 'emails', "main_field_type": 'Email',
"add_fields": [
'dateFirstSeen', 'dateLastSeen', *EVALUATION_FIELDS
],
"add_fields_types": [
'firstseenbysource', 'lastseenbysource', *EVALUATION_FIELD_TYPES
]
}
]
},
"apt/threat": {
"indicators":
[
{
"main_field": 'indicators.params.ipv4', "main_field_type": 'IP',
"add_fields": [
*THREAT_ACTOR_FIELDS, 'indicators.dateFirstSeen', 'indicators.dateLastSeen', *EVALUATION_FIELDS
],
"add_fields_types": [
*THREAT_ACTOR_FIELD_TYPES, 'firstseenbysource', 'lastseenbysource', *EVALUATION_FIELD_TYPES
]
},
{
"main_field": 'indicators.params.domain', "main_field_type": 'Domain',
"add_fields": [
*THREAT_ACTOR_FIELDS, 'indicators.dateFirstSeen', 'indicators.dateLastSeen', *EVALUATION_FIELDS
],
"add_fields_types": [
*THREAT_ACTOR_FIELD_TYPES, 'firstseenbysource', 'lastseenbysource', *EVALUATION_FIELD_TYPES
]
},
{
"main_field": 'indicators.params.url', "main_field_type": 'URL',
"add_fields": [
*THREAT_ACTOR_FIELDS, 'indicators.dateFirstSeen', 'indicators.dateLastSeen', *EVALUATION_FIELDS
],
"add_fields_types": [
*THREAT_ACTOR_FIELD_TYPES, 'firstseenbysource', 'lastseenbysource', *EVALUATION_FIELD_TYPES
]
},
{
"main_field": 'indicators.params.hashes.md5', "main_field_type": 'File',
"add_fields": [
'indicators.params.name', 'indicators.params.hashes.md5', 'indicators.params.hashes.sha1',
'indicators.params.hashes.sha256', 'indicators.params.size',
*THREAT_ACTOR_FIELDS, 'indicators.dateFirstSeen', 'indicators.dateLastSeen', *EVALUATION_FIELDS
],
"add_fields_types": [
'gibfilename', 'md5', 'sha1', 'sha256', 'size',
*THREAT_ACTOR_FIELD_TYPES, 'firstseenbysource', 'lastseenbysource', *EVALUATION_FIELD_TYPES
]
}
]
},
"hi/threat": {
"indicators":
[
{
"main_field": 'indicators.params.ipv4', "main_field_type": 'IP',
"add_fields": [
*THREAT_ACTOR_FIELDS, 'indicators.dateFirstSeen', 'indicators.dateLastSeen', *EVALUATION_FIELDS
],
"add_fields_types": [
*THREAT_ACTOR_FIELD_TYPES, 'firstseenbysource', 'lastseenbysource', *EVALUATION_FIELD_TYPES
]
},
{
"main_field": 'indicators.params.domain', "main_field_type": 'Domain',
"add_fields": [
*THREAT_ACTOR_FIELDS, 'indicators.dateFirstSeen', 'indicators.dateLastSeen', *EVALUATION_FIELDS
],
"add_fields_types": [
*THREAT_ACTOR_FIELD_TYPES, 'firstseenbysource', 'lastseenbysource', *EVALUATION_FIELD_TYPES
]
},
{
"main_field": 'indicators.params.url', "main_field_type": 'URL',
"add_fields": [
*THREAT_ACTOR_FIELDS, 'indicators.dateFirstSeen', 'indicators.dateLastSeen', *EVALUATION_FIELDS
],
"add_fields_types": [
*THREAT_ACTOR_FIELD_TYPES, 'firstseenbysource', 'lastseenbysource', *EVALUATION_FIELD_TYPES
]
},
{
"main_field": 'indicators.params.hashes.md5', "main_field_type": 'File',
"add_fields": [
'indicators.params.name', 'indicators.params.hashes.md5', 'indicators.params.hashes.sha1',
'indicators.params.hashes.sha256', 'indicators.params.size',
*THREAT_ACTOR_FIELDS, 'indicators.dateFirstSeen', 'indicators.dateLastSeen', *EVALUATION_FIELDS
],
"add_fields_types": [
'gibfilename', 'md5', 'sha1', 'sha256', 'size',
*THREAT_ACTOR_FIELD_TYPES, 'firstseenbysource', 'lastseenbysource', *EVALUATION_FIELD_TYPES
]
}
]
},
"suspicious_ip/tor_node": {
'indicators':
[
{
"main_field": 'ipv4.ip', "main_field_type": 'IP',
"add_fields": [
'ipv4.asn', 'ipv4.countryName', 'ipv4.region',
'dateFirstSeen', 'dateLastSeen', *EVALUATION_FIELDS
],
"add_fields_types": [
*IP_COMMON_FIELD_TYPES, 'firstseenbysource', 'lastseenbysource', *EVALUATION_FIELD_TYPES
]
}
]
},
"suspicious_ip/open_proxy": {
'indicators':
[
{
"main_field": 'ipv4.ip', "main_field_type": 'IP',
"add_fields": [
'ipv4.asn', 'ipv4.countryName', 'ipv4.region', 'port', 'anonymous', 'source',
'dateFirstSeen', 'dateDetected', *EVALUATION_FIELDS
],
"add_fields_types": [
*IP_COMMON_FIELD_TYPES, 'gibproxyport', 'gibproxyanonymous', 'source',
'firstseenbysource', 'lastseenbysource', *EVALUATION_FIELD_TYPES
]
}
]
},
"suspicious_ip/socks_proxy": {
'indicators':
[
{
"main_field": 'ipv4.ip', "main_field_type": 'IP',
"add_fields": [
'ipv4.asn', 'ipv4.countryName', 'ipv4.region', 'dateFirstSeen',
'dateLastSeen', *EVALUATION_FIELDS
],
"add_fields_types": [
*IP_COMMON_FIELD_TYPES, 'firstseenbysource', 'lastseenbysource', *EVALUATION_FIELD_TYPES
]
}
]
},
"malware/cnc": {
'indicators':
[
{
'main_field': 'url', "main_field_type": 'URL',
"add_fields": [
*THREAT_ACTOR_FIELDS, 'dateDetected', 'dateLastSeen'
],
"add_fields_types": [
*THREAT_ACTOR_FIELD_TYPES, 'firstseenbysource', 'lastseenbysource'
]
},
{
'main_field': 'domain', "main_field_type": 'Domain',
"add_fields": [
*THREAT_ACTOR_FIELDS, 'dateDetected', 'dateLastSeen'
],
"add_fields_types": [
*THREAT_ACTOR_FIELD_TYPES, 'firstseenbysource', 'lastseenbysource'
]
},
{
"main_field": 'ipv4.ip', "main_field_type": 'IP',
"add_fields": [
'ipv4.asn', 'ipv4.countryName', 'ipv4.region',
*THREAT_ACTOR_FIELDS, 'dateDetected', 'dateLastSeen'
],
"add_fields_types": [
*IP_COMMON_FIELD_TYPES, *THREAT_ACTOR_FIELD_TYPES, 'firstseenbysource', 'lastseenbysource'
]
}
]
},
"osi/vulnerability": {
'indicators':
[
{
'main_field': 'id', "main_field_type": 'CVE',
"add_fields": [
'cvss.score', 'cvss.vector', 'softwareMixed',
'description', 'dateModified', 'datePublished', *EVALUATION_FIELDS
],
"add_fields_types": [
'cvss', 'gibcvssvector', 'gibsoftwaremixed',
'cvedescription', 'cvemodified', 'published', *EVALUATION_FIELD_TYPES
]
}
]
},
'ioc/common': {
'indicators':
[
{
'main_field': 'url', "main_field_type": 'URL',
"add_fields": [
'dateFirstSeen', 'dateLastSeen',
],
"add_fields_types": [
'firstseenbysource', 'lastseenbysource',
]
},
{
'main_field': 'domain', "main_field_type": 'Domain',
"add_fields": [
'dateFirstSeen', 'dateLastSeen',
],
"add_fields_types": [
'firstseenbysource', 'lastseenbysource',
]
}, {
'main_field': 'ip', "main_field_type": 'IP',
"add_fields": [
'dateFirstSeen', 'dateLastSeen',
],
"add_fields_types": [
'firstseenbysource', 'lastseenbysource',
]
}
]
}
}
class Client(BaseClient):
"""
Client will implement the service API, and should not contain any Demisto logic.
Should only do requests and return data.
"""
def create_update_generator(self, collection_name: str, date_from: str | None = None,
seq_update: int | str | None = None, limit: int = 200) -> Generator:
"""
Creates generator of lists with feeds class objects for an update session
(feeds are sorted in ascending order) `collection_name` with set parameters.
`seq_update` allows you to receive all relevant feeds. Such a request uses the seq_update parameter,
you will receive a portion of feeds that starts with the next `seq_update` parameter for the current collection.
For all feeds in the Group IB Intelligence continuous numbering is carried out.
For example, the `seq_update` equal to 1999998 can be in the `compromised/accounts` collection,
and a feed with seq_update equal to 1999999 can be in the `attacks/ddos` collection.
If item updates (for example, if new attacks were associated with existing APT by our specialists
or tor node has been detected as active again), the item gets a new parameter and it automatically rises
in the database and "becomes relevant" again.
:param collection_name: collection to update.
:param date_from: start date of update session.
:param seq_update: identification number from which to start the session.
:param limit: size of portion in iteration.
"""
while True:
session = requests.Session()
session.auth = HTTPBasicAuth(self._auth[0], self._auth[1])
session.headers["Accept"] = "*/*"
session.headers["User-Agent"] = f'SOAR/CortexSOAR/{self._auth[0]}/unknown'
params = {'df': date_from, 'limit': limit, 'seqUpdate': seq_update}
params = {key: value for key, value in params.items() if value}
portion = session.get(url=f'{self._base_url}{collection_name}/updated', params=params, timeout=60).json()
# product = f'SOAR/CortexSOAR/Username/unkown}'
# portion = self._http_request(method="GET", url_suffix=collection_name + '/updated',
# params=params, timeout=60.,
# retries=4, status_list_to_retry=[429, 500])
if portion.get("count") == 0:
break
seq_update = portion.get("seqUpdate")
date_from = None
yield portion.get('items')
def create_search_generator(self, collection_name: str, date_from: str = None,
limit: int = 200) -> Generator:
"""
Creates generator of lists with feeds for the search session
(feeds are sorted in descending order) for `collection_name` with set parameters.
:param collection_name: collection to search.
:param date_from: start date of search session.
:param limit: size of portion in iteration.
"""
result_id = None
while True:
session = requests.Session()
session.auth = HTTPBasicAuth(self._auth[0], self._auth[1])
session.headers["Accept"] = "*/*"
session.headers["User-Agent"] = f'SOAR/CortexSOAR/{self._auth[0]}/unknown'
params = {'df': date_from, 'limit': limit, 'resultId': result_id}
params = {key: value for key, value in params.items() if value}
portion = session.get(url=f'{self._base_url}{collection_name}', params=params, timeout=60).json()
# params = {'df': date_from, 'limit': limit, 'resultId': result_id}
# params = {key: value for key, value in params.items() if value}
# portion = self._http_request(method="GET", url_suffix=collection_name,
# params=params, timeout=60.,
# retries=4, status_list_to_retry=[429, 500])
if len(portion.get('items')) == 0:
break
result_id = portion.get("resultId")
date_from = None
yield portion.get('items')
def search_feed_by_id(self, collection_name: str, feed_id: str) -> dict:
"""
Searches for feed with `feed_id` in collection with `collection_name`.
:param collection_name: in what collection to search.
:param feed_id: id of feed to search.
"""
portion = self._http_request(method="GET", url_suffix=collection_name + '/' + feed_id, timeout=60.,
retries=4, status_list_to_retry=[429, 500])
return portion
def test_module(client: Client) -> str:
"""
Returning 'ok' indicates that the integration works like it is supposed to. Connection to the service is successful.
:param client: GIB_TI&A_Feed client
:return: 'ok' if test passed, anything else will fail the test.
"""
generator = client.create_update_generator(collection_name='compromised/mule', limit=10)
generator.__next__()
return 'ok'
""" Support functions """
def find_element_by_key(obj, key):
"""
Recursively finds element or elements in dict.
"""
path = key.split(".", 1)
if len(path) == 1:
if isinstance(obj, list):
return [i.get(path[0]) for i in obj]
elif isinstance(obj, dict):
return obj.get(path[0])
else:
return obj
else:
if isinstance(obj, list):
return [find_element_by_key(i.get(path[0]), path[1]) for i in obj]
elif isinstance(obj, dict):
return find_element_by_key(obj.get(path[0]), path[1])
else:
return obj
def unpack_iocs_from_list(ioc):
# type: (Union[list, str]) -> list
"""
Recursively unpacks all IOCs in one list.
"""
unpacked = []
if isinstance(ioc, list):
for i in ioc:
unpacked.extend(unpack_iocs_from_list(i))
else:
unpacked.append(ioc)
return list(unpacked)
def unpack_iocs(iocs, ioc_type, fields, fields_names, collection_name):
"""
Recursively ties together and transforms indicator data.
"""
unpacked = []
if isinstance(iocs, list):
for i, ioc in enumerate(iocs):
buf_fields = []
for field in fields:
if isinstance(field, list):
buf_fields.append(field[i])
else:
buf_fields.append(field)
unpacked.extend(unpack_iocs(ioc, ioc_type, buf_fields, fields_names, collection_name))
else:
if iocs in ['255.255.255.255', '0.0.0.0', '', None]:
return unpacked
# fields=unpack_iocs_from_list(fields)
fields_dict = {fields_names[i]: fields[i] for i in range(len(fields_names)) if fields[i] is not None}
# Transforming one certain field into a markdown table
if ioc_type == "CVE" and len(fields_dict["gibsoftwaremixed"]) != 0:
soft_mixed = fields_dict.get("gibsoftwaremixed", {})
buffer = ''
for chunk in soft_mixed:
software_name = ', '.join(chunk.get('softwareName'))
software_type = ', '.join(chunk.get('softwareType'))
software_version = ', '.join(chunk.get('softwareVersion'))
if len(software_name) != 0 or len(software_type) != 0 or len(software_version) != 0:
buffer += '| {} | {} | {} |\n'.format(software_name, software_type,
software_version.replace('||', ', '))
if len(buffer) != 0:
buffer = "| Software Name | Software Type | Software Version |\n" \
"| ------------- | ------------- | ---------------- |\n" + buffer
fields_dict["gibsoftwaremixed"] = buffer
else:
del fields_dict["gibsoftwaremixed"]
# Transforming into correct date format
for date_field in DATE_FIELDS_LIST:
if fields_dict.get(date_field):
previous_date = dateparser.parse(fields_dict.get(date_field, ""))
# previous_date = fields_dict.get(date_field, "")
if previous_date:
fields_dict[date_field] = previous_date.strftime('%Y-%m-%dT%H:%M:%SZ')
# fields_dict[date_field] = convert_to_timestamp(previous_date)
fields_dict.update({'gibcollection': collection_name})
raw_json = {'value': iocs, 'type': ioc_type, **fields_dict}
unpacked.append({'value': iocs, 'type': ioc_type, 'rawJSON': raw_json, 'fields': fields_dict})
return unpacked
def find_iocs_in_feed(feed: dict, collection_name: str, common_fields: dict) -> list:
"""
Finds IOCs in the feed and transform them to the appropriate format to ingest them into Demisto.
:param feed: feed from GIB TI&A.
:param collection_name: which collection this feed belongs to.
:param common_fields: fields defined by user.
"""
indicators = []
indicators_info = MAPPING.get(collection_name, {}).get('indicators', [])
for i in indicators_info:
main_field = find_element_by_key(feed, i['main_field'])
main_field_type = i['main_field_type']
add_fields = []
add_fields_list = i.get('add_fields', []) + ['id']
for j in add_fields_list:
add_fields.append(find_element_by_key(feed, j))
add_fields_types = i.get('add_fields_types', []) + ['gibid']
for field_type in COMMON_FIELD_TYPES:
if common_fields.get(field_type):
add_fields.append(common_fields.get(field_type))
add_fields_types.append(field_type)
if collection_name in ['apt/threat', 'hi/threat', 'malware/cnc']:
add_fields.append(', '.join(find_element_by_key(feed, "malwareList.name")))
add_fields_types = add_fields_types + ['gibmalwarename']
indicators.extend(unpack_iocs(main_field, main_field_type, add_fields,
add_fields_types, collection_name))
return indicators
def get_human_readable_feed(indicators: list, type_: str, collection_name: str) -> str:
headers = ['value', 'type']
for fields in MAPPING.get(collection_name, {}).get('indicators', {}):
if fields.get('main_field_type') == type_:
headers.extend(fields['add_fields_types'])
break
if collection_name in ['apt/threat', 'hi/threat', 'malware/cnc']:
headers.append('gibmalwarename')
return tableToMarkdown(f"{type_} indicators", indicators,
removeNull=True, headers=headers)
def format_result_for_manual(indicators: list) -> dict:
formatted_indicators: dict[str, Any] = {}
for indicator in indicators:
indicator = indicator.get('rawJSON')
type_ = indicator.get('type')
if type_ == 'CVE':
del indicator["gibsoftwaremixed"]
if formatted_indicators.get(type_) is None:
formatted_indicators[type_] = [indicator]
else:
formatted_indicators[type_].append(indicator)
return formatted_indicators
def handle_first_time_fetch(last_run, collection_name, first_fetch_time):
last_fetch = last_run.get('last_fetch', {}).get(collection_name)
# Handle first time fetch
date_from = None
seq_update = None
if not last_fetch:
date_from_for_mypy = dateparser.parse(first_fetch_time)
if date_from_for_mypy is None:
raise DemistoException('Inappropriate indicators_first_fetch format, '
'please use something like this: 2020-01-01 or January 1 2020 or 3 days')
date_from = date_from_for_mypy.strftime('%Y-%m-%d')
else:
seq_update = last_fetch
return date_from, seq_update
""" Commands """
def fetch_indicators_command(client: Client, last_run: dict, first_fetch_time: str,
indicator_collections: list, requests_count: int,
common_fields: dict) -> tuple[dict, list]:
"""
This function will execute each interval (default is 1 minute).
:param client: GIB_TI&A_Feed client.
:param last_run: the greatest sequpdate we fetched from last fetch.
:param first_fetch_time: if last_run is None then fetch all incidents since first_fetch_time.
:param indicator_collections: list of collections enabled by client.
:param requests_count: count of requests to API per collection.
:param common_fields: fields defined by user.
:return: next_run will be last_run in the next fetch-indicators; indicators will be created in Demisto.
"""
indicators = []
next_run: dict[str, dict[str, int | Any]] = {"last_fetch": {}}
tags = common_fields.pop("tags", [])
for collection_name in indicator_collections:
date_from, seq_update = handle_first_time_fetch(last_run=last_run, collection_name=collection_name,
first_fetch_time=first_fetch_time)
generator = client.create_update_generator(collection_name=collection_name,
date_from=date_from, seq_update=seq_update)
k = 0
for portion in generator:
for feed in portion:
seq_update = feed.get('seqUpdate')
indicators.extend(find_iocs_in_feed(feed, collection_name, common_fields))
k += 1
if k >= requests_count:
break
if tags:
for indicator in indicators:
indicator["fields"].update({"tags": tags})
indicator["rawJSON"].update({"tags": tags})
next_run['last_fetch'][collection_name] = seq_update
return next_run, indicators
def get_indicators_command(client: Client, args: dict[str, str]):
"""
Returns limited portion of indicators to War Room.
:param client: GIB_TI&A_Feed client.
:param args: arguments, provided by client.
"""
id_, collection_name = args.get('id'), args.get('collection', '')
indicators = []
raw_json = None
try:
limit = int(args.get('limit', '50'))
if limit > 50:
raise Exception('A limit should be lower than 50.')
except ValueError:
raise Exception('A limit should be a number, not a string.')
if collection_name not in MAPPING.keys():
raise Exception('Incorrect collection name. Please, choose one of the displayed options.')
if not id_:
generator = client.create_search_generator(collection_name=collection_name, limit=limit)
for portion in generator:
for feed in portion:
indicators.extend(find_iocs_in_feed(feed, collection_name, {}))
if len(indicators) >= limit:
indicators = indicators[:limit]
break
if len(indicators) >= limit:
break
else:
raw_json = client.search_feed_by_id(collection_name=collection_name, feed_id=id_)
indicators.extend(find_iocs_in_feed(raw_json, collection_name, {}))
if len(indicators) >= limit:
indicators = indicators[:limit]
formatted_indicators = format_result_for_manual(indicators)
results = []
for type_, indicator in formatted_indicators.items():
results.append(CommandResults(
readable_output=get_human_readable_feed(indicator, type_, collection_name),
raw_response=raw_json,
ignore_auto_extract=True
))
return results
def main(): # pragma: no cover
"""
PARSE AND VALIDATE INTEGRATION PARAMS
"""
params = demisto.params()
username = params.get('credentials').get('identifier')
password = params.get('credentials').get('password')
proxy = params.get('proxy', False)
verify_certificate = not params.get('insecure', False)
base_url = str(params.get("url"))
indicator_collections = params.get('indicator_collections', [])
indicators_first_fetch = params.get('indicators_first_fetch', '3 days').strip()
requests_count = int(params.get('requests_count', 2))
args = demisto.args()
command = demisto.command()
LOG(f'Command being called is {command}')
try:
client = Client(
base_url=base_url,
verify=verify_certificate,
auth=(username, password),
proxy=proxy,
headers={
"Accept": "*/*",
"User-Agent": f"SOAR/CortexSOAR/{username}/unknown"
})
commands = {'gibtia-get-indicators': get_indicators_command}
if command == 'test-module':
# This is the call made when pressing the integration Test button.
result = test_module(client)
demisto.results(result)
elif command == 'fetch-indicators':
# Set and define the fetch incidents command to run after activated via integration settings.
common_fields = {
'trafficlightprotocol': params.get("tlp_color"),
'tags': argToList(params.get("feedTags")),
}
next_run, indicators = fetch_indicators_command(client=client, last_run=get_integration_context(),
first_fetch_time=indicators_first_fetch,
indicator_collections=indicator_collections,
requests_count=requests_count,
common_fields=common_fields)
set_integration_context(next_run)
for b in batch(indicators, batch_size=2000):
demisto.createIndicators(b) # type: ignore
else:
return_results(commands[command](client, args))
# Log exceptions
except Exception as e:
return_error(f'Failed to execute {demisto.command()} command. Error: {str(e)}')
if __name__ in ('__main__', '__builtin__', 'builtins'):
main()
```
|
```php
<?php
declare(strict_types=1);
/**
* Crypt module.
*
* This file is part of MadelineProto.
* MadelineProto is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* If not, see <path_to_url
*
* @author Daniil Gentili <daniil@daniil.it>
* @copyright 2016-2023 Daniil Gentili <daniil@daniil.it>
* @license path_to_url AGPLv3
* @link path_to_url MadelineProto documentation
*/
namespace danog\MadelineProto\MTProtoTools\Crypt;
use danog\MadelineProto\Magic;
/**
* Continuous mode IGE implementation.
*
* @internal
*/
abstract class IGE
{
/**
* IV part 1.
*
*/
protected string $iv_part_1;
/**
* IV part 2.
*
*/
protected string $iv_part_2;
/**
* Instantiate appropriate handler.
*/
public static function getInstance(string $key, string $iv): IGE
{
if (Magic::$hasOpenssl) {
return new IGEOpenssl($key, $iv);
}
return new IGEPhpseclib($key, $iv);
}
abstract protected function __construct(string $key, string $iv);
abstract public function encrypt(string $plaintext): string;
abstract public function decrypt(string $ciphertext): string;
}
```
|
```smalltalk
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Input;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Xaml;
namespace Xamarin.Forms.Controls.GalleryPages.CollectionViewGalleries.HeaderFooterGalleries
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class HeaderFooterTemplate : ContentPage
{
public HeaderFooterTemplate()
{
InitializeComponent();
CollectionView.ItemTemplate = ExampleTemplates.PhotoTemplate();
BindingContext = new HeaderFooterDemoModel();
}
[Preserve(AllMembers = true)]
class HeaderFooterDemoModel : INotifyPropertyChanged
{
readonly DemoFilteredItemSource _demoFilteredItemSource = new DemoFilteredItemSource(3);
DateTime _currentTime;
public event PropertyChangedEventHandler PropertyChanged;
public HeaderFooterDemoModel()
{
CurrentTime = DateTime.Now;
}
void OnPropertyChanged([CallerMemberName] string property = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
}
public ObservableCollection<CollectionViewGalleryTestItem> Items => _demoFilteredItemSource.Items;
public ICommand TapCommand => new Command(() => { CurrentTime = DateTime.Now; });
public DateTime CurrentTime
{
get => _currentTime;
set
{
if (value == _currentTime)
{
return;
}
_currentTime = value;
OnPropertyChanged();
}
}
}
}
}
```
|
The healthcare system of New Zealand has undergone significant changes throughout the past several decades. From an essentially fully public system based on the Social Security Act 1938, reforms have introduced market and health insurance elements primarily since the 1980s, creating a mixed public-private system for delivering healthcare.
The Accident Compensation Corporation covers the costs of treatment for cases deemed 'accidents', including medical misadventure, for all people in New Zealand (legally or otherwise). The costs are recovered via levies on employers, employees, petrol and vehicle registration, and contributions from the general tax pool.
The relatively extensive and high-quality system of public hospitals treats citizens or permanent residents free of charge and is managed by district health boards. However, costly or difficult operations often require long waiting list delays unless the treatment is medically urgent. Because of this, a secondary market of health insurance organisations exists which fund operations and treatments for their members privately. Southern Cross Health Insurance, a non-profit organisation, is the largest of these at about 60% of the health insurance market and covering almost a quarter of all New Zealanders in 2007, even operating its own chain of hospitals.
Primary care (non-specialist doctors / family doctors) and medications on the list of the New Zealand government agency PHARMAC require co-payments, but are subsidised, especially for patients with community health services cards or high user health cards.
Emergency services are primarily provided by St John New Zealand charity (as well as Wellington Free Ambulance in the Wellington Region), supported with a mix of private (donated) and public (subsidy) funds.
New Zealand has one of the highest nurse turnover rates. Not all nurses leave the profession but rather continuously switch organisations. Not all the impact of nurses leaving is negative, but when it is it can cause reduced continuity of care, disruption of services, and a drop in overall productivity.
In 2012, New Zealand spent 8.7% of GDP on healthcare, or US$3,929 per capita. Of that, approximately 77% was government expenditure. In a 2010 study, New Zealand was shown to have the lowest level of medication use in 14 developed countries (i.e. used least medicines overall), and also spent the lowest amount on healthcare amongst the same list of countries, with US$2510 ($3460) per capita, compared to the United States at US$7290.
History of healthcare
Until well after European contact Māori used natural medicines and spiritual healing. Among the European settlers, professional medical care was expensive and most people diagnosed themselves or sought alternative treatment. In the mid 19th century New Zealand's first public hospitals were created by Governor George Grey and were available for those who could not afford a private doctor.
The Public Health Act 1872 introduced local authority health boards. These were funded primarily by the local ratepayers and subsidised by the national government. There was still a large reliance on private charity to make up any shortfall. From 1909 poorer districts were given disproportionately more funding from the national government. In 1938, the Social Security Act from the First Labour Government attempted to provide government funded healthcare to all. A free health system, with hospital and other health services universally available to all New Zealanders was the vision behind the Social Security Act 1938. This was never fully realised due to ongoing disputes between the medical profession and the Government. Health services evolved as a dual system of public and private health care subsidised through a series of arrangements known as the General Medical Service (GMS) benefits established in 1941. This remained largely unchanged until the late 1970s. From 1984 to 1993 the Labour then National governments introduced major changes designed to get area health boards (later Crown health enterprises) to imitate market forces. User charges were introduced for prescriptions in February 1985 but broader controversial policies introduced by the Fourth National Government between 1991 and 1993 effectively ended largely free provision of primary healthcare, such services being targeted on the basis of income while Community Service Cards (introduced on 1 February 1992) provided additional support. Public hospital charges of $50 for overnight stays were briefly implemented but was later abandoned as the 1993 election approached.
New Zealand has had numerous public health campaigns and initiatives. Children were given free milk between 1937 and 1967 but these were abolished due to budgetary constraints, fluoride is added most drinking water in the country and there have been many anti-drinking (from the 1870s) and anti-smoking campaigns (from the 1960s).
Restructuring of the healthcare system
On 21 April 2021, Health Minister Andrew Little announces radical plan to centralise healthcare, will abolish all 20 District Health Boards and create a single health organisation called Health New Zealand, in a sweeping plan to centralise New Zealand's fragmented healthcare system and end what has been characterised as a "postcode lottery" of care. Health New Zealand will be modelled after the United Kingdom's National Health Service. The Ministry of Health will also create a Māori Health Authority with spending power, and a new Public Health Authority to centralise public health work.
In October 2021, the Sixth Labour Government introduced the Pae Ora (Healthy Futures) Bill to replace the country's district health boards with the new Health NZ. The legislation also formally establishes the Māori Health Authority and a new public health agency. The Ministry of Health will also play a stewardship role within the reformed health system. The bill passed its third reading on 7 June 2022.
Structure
At present, the Ministry of Health is responsible for the oversight and funding of the twenty district health boards (DHBs). These are responsible for organising healthcare in the district and meeting the standards set by the Ministry of Health. Twenty-one DHBs came into being on 1 January 2001 with Southland and Otago DHBs merging into Southern DHB on 1 May 2010.
The boards for each district health board are elected in elections held every three years, with the exception of one of the eight board members, who is appointed by the Ministry of Health.
The DHBs oversee the forty-six primary health organisations established throughout the country. These were first set up in July 2002, with a mandate to focus on the health of communities. Originally there were 81 of these, but this has been reduced down to 46 in 2008. They are funded by DHBs, and are required to be entirely non-profit, democratic bodies that are responsive to their communities' needs. Almost all New Zealanders are enrolled in a PHO, as there are financial incentives for the patients to become enrolled.
The Northern Region DHBs also use shared services provided by the Northern DHB Support Agency and HealthAlliance. These services deliver region-wide health initiatives and shared IT services and logistics.
In Christchurch, the Canterbury District Health Board has been successful in redesigning services to reduce hospital use. Some of this transformation was precipitated by the 2010 and 2011 earthquakes when several healthcare buildings were damaged or destroyed, and also 2019 mosque massacre as the several healthcare also response to the terrorist attacks. It now has lower rates of acute medical admissions, low average lengths of stay, fewer readmissions in acute care, fewer cancelled planned admissions and more conditions treated out of hospital.
Public vs. private payment
Hospital and specialist care in New Zealand is totally covered by the government if the patient is referred by a general or family practitioner and this is funded from government expenditure (approx. 77%). Private payment by individuals also plays an important role in the overall system although the cost of these payments are comparatively minor. Those earning less than certain amounts, depending on the number of dependents in their household, can qualify for a Community Services Card (CSC). This reduces the cost of after-hours doctors' visits, and prescription fees, as well as the cost of visits to a person's regular doctor.
Injuries which occur as a result of "accidents", ranging from minor to major physical but including psychological trauma from sexual abuse are generally covered by the Accident Compensation Corporation (ACC). This may include coverage for doctors visits and lump-sum payments.
Waiting lists
In New Zealand's public health system it is typical for medical appointments, particularly surgeries to have a waiting list. District Health Boards are typical judged in the media and by government in part based on the length of these lists. In 2016, it was inferred that many people required surgery but were not put on the official list. Research projected that of all the people who had been told they needed surgery less than half were on the official list. However, the main concern noted by health industry observers was the overall increase in waiting time, about 304 days.
Telehealth
In 2018 the Northern Region district health boards, Northland, Waitemata, Auckland and Counties Manukau developed a telehealth system with a unified video, audio, content sharing and chat platform provided by Zoom Video Communications which is intended to lead to a more integrated health system in the Northern Region. This should enable real-time consultations between clinicians in hospital, primary care and the community, and between patients and their care providers.
Healthcare organisations
The list of well-known Healthcare organisations in New Zealand are:
– Geneva Healthcare
– Counties Manukau Homecare Trust
– Healthcare of New Zealand Holdings Ltd
– Healthvision
– Life Plus Ltd
– Healthcare NZ
– Royal District Nursing Service New Zealand
Abortion
Abortion is legal upon request in New Zealand. According to figures released by Statistics New Zealand, the number of abortions rose from 8.5 per 1,000 women aged 15‒44 years in 1980 to 14 per 1,000 women in 1990. By 2000, this figure had risen to 18.7 per 1,000 women aged 15‒44 years but has since declined to 13.5 per 1,000 women as of 2018.
Medications
The Pharmaceutical Management Agency of New Zealand (PHARMAC) was set up in 1993 to decide which medications the government will subsidise. In general, PHARMAC will select an effective and safe medication from a class of drugs, and negotiate with the drug manufacturer to obtain the best price. There are approximately 2,000 drugs listed on the national schedule that are either fully or partially subsidised.
In a sample of 13 developed countries New Zealand was thirteenth in its population weighted usage of medication in 14 classes in 2009 and also in 2013. The drugs studied were selected on the basis that the conditions treated had high incidence, prevalence and/or mortality, caused significant long-term morbidity and incurred high levels of expenditure and significant developments in prevention or treatment had been made in the last 10 years. The study noted considerable difficulties in cross border comparison of medication use.
Sildenafil was reclassified in New Zealand in 2014 so it could be bought over the counter from a pharmacist. It is thought that this reduced sales over the Internet and was safer as men could be referred for medical advice if appropriate.
Emergency service
Most emergency and non-urgent ambulance transportation is carried out by the charitable organisation St John New Zealand. In Wairarapa and the Wellington Region ambulance services are provided by the Wellington Free Ambulance organisation.
Performance
An investigation into the death of a patient in the emergency department at Middlemore Hospital on 15 June 2022 concluded that the department was unsafe for both patients and its staff. On that night it was at least 30% over-capacity - but this was “…not an isolated day.” Nor was it unusual. The report said "As emergency departments continue to struggle with ever-increasing presentation numbers, delays in admitting patients to wards and significant ED overcrowding, announcements in ED waiting rooms regarding delays in assessment/treatment occur at an increasing frequency throughout EDs in Aotearoa New Zealand." Margie Apa of Te Whatu Ora accepted the conclusions of the report.
See also
Euthanasia in New Zealand
Health in New Zealand
Homeopathy in New Zealand
List of hospitals in New Zealand
List of New Zealand doctors
Mental health in New Zealand
References
External links
New Zealand Ministry of Health
World Health Organization Statistical Information System (WHOSIS)
Pharmaceutical Management Agency of New Zealand (PHARMAC)
|
```hcl
terraform {
required_version = ">= 0.13"
required_providers {
libvirt = {
source = "dmacvicar/libvirt"
version = "0.6.12"
}
ignition = {
source = "community-terraform-providers/ignition"
}
}
}
# -[Provider]--------------------------------------------------------------
provider "libvirt" {
uri = "qemu:///system"
}
# -[Variables]-------------------------------------------------------------
variable "hosts" {
default = 1
}
variable "hostname_format" {
type = string
default = "coreos%02d"
}
variable "libvirt_provider" {
type = string
}
# -[Resources]-------------------------------------------------------------
resource "libvirt_volume" "coreos-disk" {
name = "${format(var.hostname_format, count.index + 1)}.qcow2"
count = var.hosts
base_volume_name = "coreos_production_qemu"
pool = "default"
format = "qcow2"
}
# Loading ignition configs in QEMU requires at least QEMU v2.6
resource "libvirt_ignition" "ignition" {
name = "${format(var.hostname_format, count.index + 1)}-ignition"
pool = "default"
count = var.hosts
content = element(data.ignition_config.startup.*.rendered, count.index)
}
# Create the virtual machines
resource "libvirt_domain" "coreos-machine" {
count = var.hosts
name = format(var.hostname_format, count.index + 1)
vcpu = "1"
memory = "2048"
## Use qemu-agent in conjunction with the container
#qemu_agent = true
coreos_ignition = element(libvirt_ignition.ignition.*.id, count.index)
disk {
volume_id = element(libvirt_volume.coreos-disk.*.id, count.index)
}
graphics {
## Bug in linux up to 4.14-rc2
## path_to_url
## No Spice/VNC available if more than one machine is generated at a time
## Comment the address line, uncomment the none line and the console block below
#listen_type = "none"
listen_type = "address"
}
## Makes the tty0 available via `virsh console`
#console {
# type = "pty"
# target_port = "0"
#}
network_interface {
network_name = "default"
# Requires qemu-agent container if network is not native to libvirt
wait_for_lease = true
}
## mounts filesystem local to the kvm host. used to patch in the
## qemu-guest-agent as docker container
#filesystem {
# source = "/srv/images/"
# target = "qemu_docker_images"
# readonly = true
#}
}
# -[Output]-------------------------------------------------------------
output "ipv4" {
value = libvirt_domain.coreos-machine.*.network_interface.0.addresses
}
```
|
ZoneAlarm is an internet security software company that provides consumer antivirus and firewall products. ZoneAlarm was developed by Zone Labs, whose CEOs were Kevin Nickel, Mouad Abid and Shahin and the Company was acquired in March 2004 by Check Point. ZoneAlarm's firewall security products include an inbound intrusion detection system, as well as the ability to control which programs can open outbound connections.
Technical description
In ZoneAlarm, program access is controlled by way of "zones", into which all network connections are divided. The "trusted zone" which generally includes the user's local area network can share resources such as files and printers. The "Internet zone" includes everything without the trusted zone. The user can grant permissions (trusted zone client, trusted zone server, Internet zone client, Internet zone server) to programs before they attempt to access the Internet (e.g. before the first use) or ZoneAlarm will ask the user to grant permissions on the first access attempt.
"True Vector Internet Monitor", also known as "TrueVector Security Engine", is a Windows service that is the core of ZoneAlarm. In the processes list its Image Name is "vsmon.exe". This monitors internet traffic and generates alerts for disallowed access. "Operating System Firewall" (OSFirewall) monitors programs and generates alerts when they perform suspicious behaviors. The OSFirewall is useful in preventing rootkits and other spyware. "SmartDefense Advisor" is the name ZoneAlarm give to a service available in all versions that helps the user with certain types of alert, using a database of trusted program signatures to provide the user with advice on allowing or denying Internet access in response to program requests.
The current free version of Zonealarm has an ad for the paid version that pops up every time you turn on your computer after a short delay.
Awards and certifications
Both the free and Pro editions of ZoneAlarm Firewall were designated as PCMags Editor's Choice in 2017.
Controversies
As of January 2006, ZoneAlarm was reportedly sending data to the company's servers in a covert fashion. A developer dismissed allegations that ZoneAlarm was spying on its clients, saying that it was an issue related to software updates and that it would be fixed.
In December 2007, a browser toolbar was shipped with ZoneAlarm as an opt-out, which was not well received. This was removed in later versions of the software.
On September 2, 2010, the free version of ZoneAlarm started showing a "Global Virus Alert" popup as a scareware tactic to get users to switch to their paid security suite. The popup was turned off by ZoneAlarm marketing team after an uproar from disgruntled users, many of whom uninstalled the software.
See also
Comparison of antivirus software
Comparison of firewalls
ZoneAlarm Z100G
Check Point GO
References
External links
Firewall software
Antivirus software
Windows-only shareware
Windows-only freeware
2000 software
Windows security software
Security software
Israeli brands
|
```c++
#include "wand_parts.h"
#include <vespa/vespalib/objects/visit.hpp>
namespace search::queryeval::wand {
void
VectorizedIteratorTerms::visit_members(vespalib::ObjectVisitor &visitor) const {
visit(visitor, "children", _terms);
}
VectorizedIteratorTerms::VectorizedIteratorTerms(VectorizedIteratorTerms &&) noexcept = default;
VectorizedIteratorTerms & VectorizedIteratorTerms::operator=(VectorizedIteratorTerms &&) noexcept = default;
VectorizedIteratorTerms::~VectorizedIteratorTerms() = default;
}
void visit(vespalib::ObjectVisitor &self, const std::string &name,
const search::queryeval::wand::Term &obj)
{
self.openStruct(name, "search::queryeval::wand::Term");
visit(self, "weight", obj.weight);
visit(self, "estHits", obj.estHits);
visit(self, "search", obj.search);
self.closeStruct();
}
```
|
Palpita laciniata is a moth in the family Crambidae. It was described by Inoue in 1997. It is found on Borneo.
References
Moths described in 1997
Palpita
Moths of Borneo
|
The Périgord noir (, literally Black Périgord), also known as Sarladais, is a traditional natural region of France, which corresponds roughly to the Southeast of the current Dordogne département, now forming the eastern part of the Nouvelle-Aquitaine région. It is centered around the town of Sarlat-la-Canéda.
Etymology
The name Périgord noir (black Périgord ) is derived from the dark colour of its evergreen oak forests (Quercus ilex) and also from the dark, fertile soil in the Sarladais, not, as is often asserted, from the black truffle. Historically, the Périgord noir was the oldest of the four subdivisions of the Périgord.
Geography
Geographically the Périgord noir takes up the Southeast of the Dordogne département.
It is surrounded by the following natural regions:
Périgord central and Brive basin in the North
Causse de Martel and Causse de Gramat in the East
Bouriane in the South
Haut-Agenais and Bergeracois in the West.
Further natural subdivisions within the Périgord noir are:
the woodlands of the Barade
the woodlands of the Bessède
Pays au Bois
Pays de Fénelon
Pays de Lémance
The term Périgord noir has to be clearly distinguished from the similar term Pays du Périgord noir used mainly in tourism. The term Pays du Périgord noir is much broader than Périgord noir, as it includes the Pays d'Hautefort further North, which is normally attributed to the Périgord central.
Administration
In administrative terms the Périgord noir is covered today mainly by the Arrondissement of Sarlat-la-Canéda.
The following cantons constitute the Périgord noir:
Canton of Sarlat-la-Canéda
Canton of Terrasson-Lavilledieu
Canton of Vallée Dordogne
Canton of Vallée de l'Homme
The Canton of Haut-Périgord Noir is only partially represented.
Hydrography
The Dordogne traverses the Périgord noir about centrally from East to West. The Vézère originates to the Northeast, traverses the northwestern part of the Périgord noir and joins the Dordogne near Limeuil as a right tributary. Both rivers meander, well known examples for the Dordogne are Cingle de Montfort and Cingle de Trémolat. The base level of both rivers is at an elevation between 70 and 40 meters, whereas the undulating surrounding sedimentary succession can reach elevations of 349 meters — but is situated on average closer to 200 meters. Both streams have therefore incised the sediments by about 150 meters.
Tributaries of the Dordogne are Borrèze, Énéa and Doux (from the right) as well as Marcillande (Germaine), Céou, Nauze and Bélingou (from the left). The Vézère is joined by the Laurence, Thonac, Moustier and Manaurie from the right, and by the Coly and Beune from the left.
Geology
Geologically, the Périgord noir area is situated entirely in a sequence of gently southwest-dipping sediments that form part of the Aquitaine Basin. The series comprises Jurassic, Cretaceous, Eocene and Oligocene. The river valleys are infilled by alluvial sediments of Quaternary age.
The Jurassic sediments belong to the inner platform facies and consist of limestones, dolomites and marls. The limestones feature micrites, sparites, oolites and also limestones rich in siliciclastics that were deposited near the shoreface. The marls were formed near the continent and are occasionally rather rich in lignite, once mined near Allas-les-Mines. The Jurassic rocks crop out along the northern edge of the Périgord noir near Terrasson-Lavilledieu, where they are separated from the Upper Cretaceous by the southeast-striking Cassagne Fault. They are also found within the Saint-Cyprien Anticline — a southeast-striking tectonic upwarp near Le Bugue and Saint-Cyprien. Beyond the eastern perimeter of the Périgord noir they constitute the Causse de Martel.
The Upper Cretaceous forms a slight discordance with the underlying Middle and Upper Jurassic sediments east of Sarlat. Due to the upwarp of the Saint-Cyprien Anticline the Upper Cretaceous sediments are folded into a very gentle syncline. They mainly consist of limestones and are often karstified. Stratigraphically they range from Cenomanian to Campanian and cover the biggest part of the Périgord noir. In places the Upper Cretaceous is overlain by continental molasse sediments of Eocene and Oligocene age, as can be seen for instance in the woodlands of the Forêt de la Bessède near Le Buisson-de-Cadouin. The molasse are stream and lake deposits.
The northern limit of the Périgord noir is marked by the south-southeast to southeast striking Condat Fault, which has raised a crystalline basement block of the Massif Central — the horst of Châtres — right through the Jurassic sediments.
History
The Périgord noir is well known for its abundance in prehistoric caves and abris like Lascaux, Rouffignac or Cro Magnon — all situated relatively close to Les Eyzies-de-Tayac-Sireuil. Famous are troglodytic cliff dwellings like Roque Saint-Christophe near the archeological site of Le Moustier. Archeological studies have been conducted in the Périgord noir since the 19th century and underline the importance of the Vézère valley for prehistory. Just in the vicinity of Les Eyzies 147 sites are clustered, with ages reaching 40.000 years and more. This is the reason, why the new Musée national de Préhistoire was established there. Several prehistoric sites in the Périgord noir have rendered their names for archeological cultures like Mousterian, Micoquian, Périgordian and Magdalenian.
Besides the medieval towns Sarlat and Domme many classified settlements are preserved. Examples are Belvès, Beynac, Castelnaud-la-Chapelle, Limeuil, La Roque-Gageac, Saint-Amand-de-Coly and Saint-Léon-sur-Vézère. The rich cultural heritage of the Périgord noir is also manifested in many castles, châteaus, churches and abbeys, like for instance Château de Beynac, Château de Castelnaud-la-Chapelle, Château des Milandes, the church Saint-Martin de Besse and Cadouin Abbey.
During the Hundred Years War (1337 till 1453) the Périgord noir witnessed many battles between the English and French kings and the region was devastated several times. A good example is the Château de Carlux which was under attack several times and finally got burnt down by the English in 1406. The population was diminished severely during the war and despite attempts in the 15th and 16th century to revitalize the economy again the region never fully recovered and kept suffering from the sequels of the war.
The French Wars of Religion (1562 till 1598) have also left their marks on the Périgord noir.
Gallery
See also
Périgord
Arrondissement of Sarlat-la-Canéda
Further reading
Former provinces of France
Geography of Dordogne
Natural regions of France
Guyenne
Périgord
|
Germantown Academy, informally known as GA and originally known as the Union School, is the oldest nonsectarian day school in the United States. The school was founded on December 6, 1759, by a group of prominent Germantown citizens in the Green Tree Tavern on the Germantown Road. Germantown Academy enrolls students from pre-kindergarten to 12th grade and is located in the Philadelphia suburb of Fort Washington, having moved from its original Germantown campus in 1965. The original campus (see Old Germantown Academy and Headmasters' Houses) is listed on the National Register of Historic Places. The school shares the oldest continuous high school football rivalry with the William Penn Charter School.
History
Early years
The Union School was founded on the evening of December 6, 1759, at the Green Tree Tavern on Germantown Avenue. The school was founded by prominent members of the Germantown community who wished to provide a country school for their children. As some of the founders and residents of Germantown were of German descent, it was decided that the school be opened with both English and German speaking departments. The founders chose David James Dove to head the English department and Hilarius Becker of Bernheim, Germany, to head the German school. In 1761, land was given to the school by trustee Charles Bensell, and a schoolhouse with its iconic belfry was constructed.
The school found itself in the crossroads of early American history. In 1777, the Battle of Germantown was fought on the front lawn of trustee Benjamin Chew at his home Cliveden less than a mile from campus. During the American Revolution, the school served as a hospital and camp for British soldiers. Legend says that the British officers played the first game of cricket in America on the Academy's front lawn. After the war, the school was visited by President George Washington. Washington sent his adopted step-grandson George Washington Parke Custis to the Academy during the 1793 yellow fever epidemic in Philadelphia. The school was visited by the Marquis de Lafayette on his 1825 visit to America and hosted Fernando, the adopted son of South American liberator Simón Bolívar. In 1830, Amos Bronson Alcott, father of Louisa May Alcott, was appointed headmaster and attempts were made to co-educate the school but were quickly abandoned.
The Kershaw years
After the Civil War, the school was in decline, with a small student body and outdated facilities. In 1877, Dr. William Kershaw was appointed headmaster. Under his leadership, the Academy gained prominence and expanded its activities with the introduction of the Inter-Academic League (1887), The Belfry Club, one of the oldest high school drama clubs in the country (1894), and The Academy Monthly (1885), one of the oldest student literary magazines still in existence. During his headmastership, GA graduated a future University of Pennsylvania president, a Supreme Court justice, and a primate of the Episcopal Church.
20th century
In 1915, Dr. Kershaw retired and Dr. Samuel E. Osbourn was appointed headmaster. Under Dr. Osbourn's leadership, the school increased in size, focused on scholarship and continued to produce some of Philadelphia's finest citizens. Under Osbourn, GA established the eighth oldest Cum Laude Society chapter in the nation and started an endowment.
After the World Wars, GA was led by headmaster Donald Miller who was instrumental in the move from Germantown to the current Fort Washington campus. By the 1960s, more and more lower income minority families moved into Germantown and GA families left Germantown for the nearby suburbs. In five years, "The Miracle of Fort Washington" (a term coined by Judge Jerome O'Neill, '28) occurred as the school moved from city to suburb. In this transition, GA coeducated, accepting girls in 1961 with the first co-ed class graduating in 1968.
Lower School
The Lower School consists of three main buildings: Leas Hall, McLean Hall (constructed in 1964), and the Abramson Lower School (constructed in 1999). Leas Hall comprises the Pre-Kindergarten and Kindergarten classrooms, while McLean Hall contains 1st, 2nd, 3rd, 4th, and 5th grade classrooms. The Abramson Lower School has two 3rd grade classrooms, science rooms, and music classrooms.
There are currently 347 students enrolled in the Lower School (as of the 2019-20 school year), and a student-to-teacher ratio of 14:1.
Middle school
The Middle School as a separate department was established in 1976. It was first led by Barbara Hitschler Serrill,'68 and then run by longtime Head of Middle School, Richard House. The first Alter Middle School was donated by Dennis and Gisela Alter and constructed in 1997. In 2011, the new Alter Middle School was constructed and opened as a part of the Building on Tradition campus campaign. There are many activities for students, such as the science fair, a play and musical, sports teams, many clubs, such as a Fandom Club, an art club, and a literary magazine. There are 275 students currently enrolled in the Middle school (as of the 2019-20 school year).
Upper School
Students are required at minimum, five credits per year and at least four years of English, three years of Math, Science, History, two years of Language, and one year of Art. There are 567 students enrolled in the Upper School (as of the 2019-20 school year). The student to teacher ratio is currently 8:1 in the Upper School.
The upper school runs on a house system. Each student is placed into one of seven houses. These houses include, Alcott Day, Washington, Galloway, Osbourn, Kershaw, Truesdell, and Roberts. Each house is named after an important figure with a Germantown Academy connection. A student will stay with their house for all four years of upper school life. Over the course of a year, each house will meet twice a week, and for special events, they will compete against each other. These special events include The Knowledge Bowl House Olympics and The Annual Spelling Bee. Each year a house cup is crowned to the house with the most house points which are picked up throughout the year in the challenges above and in many others.
Conduct in the upper school is governed by the Honor Code, a system where students agree to a set of rules, and where, in the case of an infraction, students are judged by an honor council consisting of teachers and peers.
Upper School publications
The Academy Monthly is one of the oldest student run literary magazines in the country, founded in 1884. Published biannually. Features student and faculty writing and artwork.
The Edition is the Upper School newspaper was founded in 1969. It includes editorials, school news and sports updates as well as commentary on contemporary culture.
Frequency: Frequency magazine provides insight into contemporary music scene through editorials, CD reviews, news about upcoming concerts and album release dates. Students and staff are encouraged to submit material.
maGAzine: maGAzine is the Upper School current events/political journal. It includes political commentary, articles and artwork by students and staff.
Voyager: The Upper School's Modern Language Journal features articles on world cultures and language. Includes observations, poetry, travel writing and artwork by students and staff.
Ye Primer: First published in 1895 as a record of the senior class, the yearbook has expanded to include the whole school, captures the life of the student body, faculty and staff with pictures, articles and senior pages.
House system
The house system was established in 2007 at the insistence of Headmaster Jim Connor and Upper School faculty member Ted Haynie. The seven-house system is modeled after the ancient English public school concept of joining students from different years in a common group. Each of the seven houses is named for an influential alumnus or friend of the academy. Each house consists of roughly 80 people and competes in various competitions throughout the year. The system also provides an academic and social support system for underclassmen as they have the chance to interact with upperclassmen and a variety of faculty. Each house is run by a House Head and two student prefects (one boy, one girl). Throughout the year, the houses compete in various competitions ranging from a Knowledge Bowl to a German Folk Song Singing Contest to Handball, etc. The highpoint of the house system calendar is the House Olympics which is held in early May where the different houses compete in athletic and academic competitions for a chance of the House Olympics Trophy (in parentheses is the faculty house head for the 2017–18 school year)
Washington is named for President George Washington, a patron of the old school and a parent as his step-son George Washington Parke Custis attended in the 1790s. The house colors are black and silver and Washington himself serves as the house mascot. (Steven Moll)
Alcott Day (previously known as just Alcott until June 3, 2016) is named for former headmaster Amos Bronson Alcott, and longtime teacher Virginia Belle Day. Alcott, the father of renowned author Louisa May Alcott, believed strongly in providing girls with an education comparable to that given to boys, despite the fact that most educators of his day sought to emphasize a ‘domestic arts’ curriculum for girls. He introduced coeducational integration for a brief period starting in 1831, before leaving the academy three years later. Virginia "Jinny" Day worked tirelessly to make the academy open to all, regardless of gender, in 1963. Alcott house colors are blue and green and its house mascot is the alligator. (Peggy Bradley)
Roberts is named for Supreme Court Justice Owen J. Roberts, a member of the class of 1890. Roberts House colors are blue and orange and their mascot is the walrus. (Allison Rader)
Truesdell is named for longtime GA teacher, Walter Truesdell. Truesdell was Phi Beta Kappa and taught Latin for thirty years. The house colors are blue and silver and the mascot is the timberwolf. (Rachel Lingten)
Kershaw is named for headmaster Dr. William Kershaw (1877–1915). Kershaw's colors are navy blue and light blue and the mascot is the kangaroo. (Matt Dence)
Galloway is named for early Academy trustee Joseph Galloway, a notable Philadelphia figure during the Revolution. Galloway's house colors are black and yellow and their mascot is the Griffin. (Michael Torrey)
Osbourn is named for longtime headmaster Dr. Samuel E. Osbourn (1915–1948). The house colors are green and white. (Susan Merrill)
Administration
Alma mater
The alma mater was written c. 1910 by J. Hefflestein Mason, a member of the class of 1900. Class songs originated as early as 1885 and appeared in each class's Ye Primer. Before the current alma mater, the school had a few lesser-known "alma maters" and a school yell which was sung after 1910. Before the 1970s, the alma mater was sung along with the school hymn Our God, Our Help in Ages Past. Mason went on to write more music and perform with the Philadelphia Opera Company.
Headmasters
David James Dove (1761–1763) Hilarius Becker (1761–1778)
Pelatiah Webster (1763–1766)
John Woods (1765–1769)
John Downey (1769–1774)
Thomas Dungan (1774–1777)
George Murray (1777–1778)
(School closed due to the Revolution, 1778–1784)
George Murray (1784–1786)
Thomas Dungan (1786–1805) Rev. Frederick Herman (1794–1795) (German master)
Nathaniel Major (1805–1806)
John Conrad (1806–1809)
William Woodman (1809–1810)
George I. Howell (1810–1811)
Enion Williams (1811–1814) Stephen H. Long (1811–1814)
Jedediah Strong (1814–1819)
Rev. John R. Goodman (1819–1820)
John M. Brewer (1820–1821)
Walter Rogers Johnson (1821–1825)
J.G. Cooper (1826–1827)
George R. Giddings (1828–1830)
Moses Soule (1830)
Theodore Russell Jenks (1830)
Amos Bronson Alcott (1831) William Russell (1831)
John F. Watson (1834)
John C. Whitehead (1834)
Rev. Dr. Christian F. Cruse (1835–1836)
Eugene Smith (1836)
Rev. Henry K. Green (1836–1839)
Alfred J. Perkins (1839–1843)
W.M. Collom (1843–1849)
S.C. Miller (1849–1853)
James Withington (1853–1863)
Cyrus V. Mays (1863–1872)
Rev. William Travis (1872–1877)
Dr. William Kershaw (1877–1915)
Dr. Samuel E. Osbourn (1915–1948)
John F. Godman (1948–1952)
Dr. Richard W. Day (1952–1956)
Donald Hope Miller (1956–1966)
Samuel Stroud (1966–1970)
Edward "Bud" Kast (1970–1986)
James Carey Ledyard (1986–1990)
James W. Connor (1990–2016)
Richard C. Schellhas (2016–present)
Notable alumni
Germantown Academy has notable alumni in the arts, sciences, government, sports, and business, including Bradley Cooper, Brian L. Roberts, Alvin Williams, Maddy Crippen, Fran Crippen, Teresa Crippen, Owen J. Roberts, and Nicole Ranile .
See also
The Belfry (Germantown Academy)
Old Germantown Academy and Headmasters' Houses
Inter-Academic League
Pennsylvania School for the Deaf
Further reading
Archivist Edwin N. Probert II. The GA Bell, its Belfry and Their History.
Archivist Edwin N. Probert II (Winter 1999–2000). Owen Josephus Roberts: A Short Retrospective on a Favorite Son. "The Patriot."
Head of School James Connor. The GA Flag. Excerpts from a speech delivered at the September 2003 Flag Raising Ceremony.
References
External links
Germantown Academy official website
Members of the Class of 1760
Satellite image from Google Maps
The GA Choice
Names
History
Educational institutions established in 1759
1759 establishments in Pennsylvania
Private high schools in Pennsylvania
Germantown Academy
Private middle schools in Pennsylvania
Private elementary schools in Pennsylvania
Schools in Montgomery County, Pennsylvania
|
```smalltalk
using System.Collections.Generic;
using System.Diagnostics.Contracts;
namespace Microsoft.Dafny;
/// <summary>
/// The parsing and resolution/type checking of expressions of the forms
/// 0. ident < Types >
/// 1. Expr . ident < Types >
/// 2. Expr ( Exprs )
/// 3. Expr [ Exprs ]
/// 4. Expr [ Expr .. Expr ]
/// is done as follows. These forms are parsed into the following AST classes:
/// 0. NameSegment
/// 1. ExprDotName
/// 2. ApplySuffix
/// 3. SeqSelectExpr or MultiSelectExpr
/// 4. SeqSelectExpr
///
/// The first three of these inherit from ConcreteSyntaxExpression. The resolver will resolve
/// these into:
/// 0. IdentifierExpr or MemberSelectExpr (with .Lhs set to ImplicitThisExpr or StaticReceiverExpr)
/// 1. IdentifierExpr or MemberSelectExpr
/// 2. FuncionCallExpr or ApplyExpr
///
/// The IdentifierExpr's that forms 0 and 1 can turn into sometimes denote the name of a module or
/// type. The .Type field of the corresponding resolved expressions are then the special Type subclasses
/// ResolutionType_Module and ResolutionType_Type, respectively. These will not be seen by the
/// verifier or compiler, since, in a well-formed program, the verifier and compiler will use the
/// .ResolvedExpr field of whatever form-1 expression contains these.
///
/// Notes:
/// * IdentifierExpr and FunctionCallExpr are resolved-only expressions (that is, they don't contain
/// all the syntactic components that were used to parse them).
/// * Rather than the current SeqSelectExpr/MultiSelectExpr split of forms 3 and 4, it would
/// seem more natural to refactor these into 3: IndexSuffixExpr and 4: RangeSuffixExpr.
/// </summary>
public abstract class SuffixExpr : ConcreteSyntaxExpression {
public readonly Expression Lhs;
protected SuffixExpr(Cloner cloner, SuffixExpr original) : base(cloner, original) {
Lhs = cloner.CloneExpr(original.Lhs);
}
public SuffixExpr(IToken tok, Expression lhs)
: base(tok) {
Contract.Requires(tok != null);
Contract.Requires(lhs != null);
Lhs = lhs;
}
public override IEnumerable<INode> Children => ResolvedExpression == null ? new[] { Lhs } : base.Children;
public override IEnumerable<INode> PreResolveChildren => PreResolveSubExpressions;
public override IEnumerable<Expression> SubExpressions {
get {
if (!WasResolved()) {
foreach (var sub in PreResolveSubExpressions) {
yield return sub;
}
} else if (Resolved != null) {
yield return Resolved;
}
}
}
public override IEnumerable<Expression> PreResolveSubExpressions {
get {
yield return Lhs;
}
}
}
```
|
```sqlpl
-- +migrate Up
CREATE TABLE asset_stats (
id BIGINT PRIMARY KEY REFERENCES history_assets ON DELETE CASCADE ON UPDATE RESTRICT,
amount BIGINT NOT NULL,
num_accounts INTEGER NOT NULL,
flags SMALLINT NOT NULL,
toml VARCHAR(64) NOT NULL
);
CREATE INDEX asset_by_code ON history_assets USING btree (asset_code);
-- +migrate Down
DROP TABLE asset_stats cascade;
```
|
```javascript
const React = require('react')
const {
Paper, IconButton, FontIcon, FlatButton, Popover, Menu, MenuItem, Checkbox, Toggle,
Table, TableBody, TableRow, TableRowColumn, TableHeader, TableHeaderColumn
} = require('material-ui')
const mailboxActions = require('../../../stores/mailbox/mailboxActions')
const shallowCompare = require('react-addons-shallow-compare')
const Mailbox = require('shared/Models/Mailbox/Mailbox')
const Colors = require('material-ui/styles/colors')
const settingStyles = require('../settingStyles')
const serviceStyles = {
actionCell: {
width: 48,
paddingLeft: 0,
paddingRight: 0,
textAlign: 'center'
},
titleCell: {
paddingLeft: 0,
paddingRight: 0
},
avatar: {
height: 22,
width: 22,
top: 2
},
disabled: {
textAlign: 'center',
fontSize: '85%',
color: Colors.grey300
}
}
module.exports = React.createClass({
/* **************************************************************************/
// Class
/* **************************************************************************/
displayName: 'AccountServiceSettings',
propTypes: {
mailbox: React.PropTypes.object.isRequired
},
/* **************************************************************************/
// Data lifecycle
/* **************************************************************************/
getInitialState () {
return {
addPopoverOpen: false,
addPopoverAnchor: null
}
},
/* **************************************************************************/
// Rendering
/* **************************************************************************/
shouldComponentUpdate (nextProps, nextState) {
return shallowCompare(this, nextProps, nextState)
},
/**
* Renders the service name
* @param mailboxType: the type of mailbox
* @param service: the service type
* @return the human name for the service
*/
getServiceName (mailboxType, service) {
if (mailboxType === Mailbox.TYPE_GMAIL || mailboxType === Mailbox.TYPE_GINBOX) {
switch (service) {
case Mailbox.SERVICES.STORAGE: return 'Google Drive'
case Mailbox.SERVICES.CONTACTS: return 'Google Contacts'
case Mailbox.SERVICES.NOTES: return 'Google Keep'
case Mailbox.SERVICES.CALENDAR: return 'Google Calendar'
case Mailbox.SERVICES.COMMUNICATION: return 'Google Hangouts'
}
}
return ''
},
/**
* @param mailboxType: the type of mailbox
* @param service: the service type
* @return the url of the service icon
*/
getServiceIconUrl (mailboxType, service) {
if (mailboxType === Mailbox.TYPE_GMAIL || mailboxType === Mailbox.TYPE_GINBOX) {
switch (service) {
case Mailbox.SERVICES.STORAGE: return '../../images/google_services/logo_drive_128px.png'
case Mailbox.SERVICES.CONTACTS: return '../../images/google_services/logo_contacts_128px.png'
case Mailbox.SERVICES.NOTES: return '../../images/google_services/logo_keep_128px.png'
case Mailbox.SERVICES.CALENDAR: return '../../images/google_services/logo_calendar_128px.png'
case Mailbox.SERVICES.COMMUNICATION: return '../../images/google_services/logo_hangouts_128px.png'
}
}
return ''
},
/**
* Renders the services
* @param mailbox: the mailbox
* @param services: the services list
* @param sleepableServices: the list of services that are able to sleep
* @return jsx
*/
renderServices (mailbox, services, sleepableServices) {
if (services.length) {
const sleepableServicesSet = new Set(sleepableServices)
return (
<Table selectable={false}>
<TableHeader displaySelectAll={false} adjustForCheckbox={false}>
<TableRow>
<TableHeaderColumn style={serviceStyles.actionCell} />
<TableHeaderColumn style={serviceStyles.titleCell}>Service</TableHeaderColumn>
<TableHeaderColumn
style={serviceStyles.actionCell}
tooltipStyle={{ marginLeft: -100 }}
tooltip='Allows services to sleep to reduce memory consumption'>
Sleep when not in use
</TableHeaderColumn>
<TableHeaderColumn style={serviceStyles.actionCell} />
<TableHeaderColumn style={serviceStyles.actionCell} />
<TableHeaderColumn style={serviceStyles.actionCell} />
</TableRow>
</TableHeader>
<TableBody displayRowCheckbox={false}>
{services.map((service, index, arr) => {
return (
<TableRow key={service}>
<TableRowColumn style={serviceStyles.actionCell}>
<img
style={serviceStyles.avatar}
src={this.getServiceIconUrl(mailbox.type, service)} />
</TableRowColumn>
<TableRowColumn style={serviceStyles.titleCell}>
{this.getServiceName(mailbox.type, service)}
</TableRowColumn>
<TableRowColumn style={serviceStyles.actionCell}>
<Checkbox
onCheck={(evt, checked) => mailboxActions.toggleServiceSleepable(mailbox.id, service, checked)}
checked={sleepableServicesSet.has(service)} />
</TableRowColumn>
<TableRowColumn style={serviceStyles.actionCell}>
<IconButton
onClick={() => mailboxActions.moveServiceUp(mailbox.id, service)}
disabled={index === 0}>
<FontIcon className='material-icons'>arrow_upwards</FontIcon>
</IconButton>
</TableRowColumn>
<TableRowColumn style={serviceStyles.actionCell}>
<IconButton
onClick={() => mailboxActions.moveServiceDown(mailbox.id, service)}
disabled={index === arr.length - 1}>
<FontIcon className='material-icons'>arrow_downwards</FontIcon>
</IconButton>
</TableRowColumn>
<TableRowColumn style={serviceStyles.actionCell}>
<IconButton onClick={() => mailboxActions.removeService(mailbox.id, service)}>
<FontIcon className='material-icons'>delete</FontIcon>
</IconButton>
</TableRowColumn>
</TableRow>
)
})}
</TableBody>
</Table>
)
} else {
return (
<Table selectable={false}>
<TableBody displayRowCheckbox={false}>
<TableRow>
<TableRowColumn style={serviceStyles.disabled}>
All Services Disabled
</TableRowColumn>
</TableRow>
</TableBody>
</Table>
)
}
},
/**
* Renders the add popover
* @param mailbox: the mailbox
* @param disabledServices: the list of disabled services
* @return jsx
*/
renderAddPopover (mailbox, disabledServices) {
if (disabledServices.length) {
const { addPopoverOpen, addPopoverAnchor } = this.state
return (
<div style={{ textAlign: 'right' }}>
<FlatButton
label='Add Service'
onClick={(evt) => this.setState({ addPopoverOpen: true, addPopoverAnchor: evt.currentTarget })} />
<Popover
open={addPopoverOpen}
anchorEl={addPopoverAnchor}
anchorOrigin={{horizontal: 'left', vertical: 'bottom'}}
targetOrigin={{horizontal: 'left', vertical: 'top'}}
onRequestClose={() => this.setState({ addPopoverOpen: false })}>
<Menu>
{disabledServices.map((service) => {
return (
<MenuItem
key={service}
onClick={() => {
this.setState({ addPopoverOpen: false })
mailboxActions.addService(mailbox.id, service)
}}
primaryText={this.getServiceName(mailbox.type, service)} />)
})}
</Menu>
</Popover>
</div>
)
} else {
return undefined
}
},
render () {
const { mailbox, ...passProps } = this.props
const enabledServicesSet = new Set(mailbox.enabledServies)
const disabledServices = mailbox.supportedServices
.filter((s) => s !== Mailbox.SERVICES.DEFAULT && !enabledServicesSet.has(s))
return (
<Paper zDepth={1} style={settingStyles.paper} {...passProps}>
<h1 style={settingStyles.subheading}>Services</h1>
{this.renderServices(mailbox, mailbox.enabledServies, mailbox.sleepableServices)}
{this.renderAddPopover(mailbox, disabledServices)}
<Toggle
toggled={mailbox.compactServicesUI}
label='Compact Services UI'
labelPosition='right'
onToggle={(evt, toggled) => mailboxActions.setCompactServicesUI(mailbox.id, toggled)} />
</Paper>
)
}
})
```
|
Orphulella pelidna, the spotted-winged grasshopper, is a species of slant-faced grasshopper in the family Acrididae. It is found in the Caribbean Sea, Central America, North America, and the Caribbean.
References
Further reading
External links
pelidna
Articles created by Qbugbot
Insects described in 1838
|
```xml
export type PredicateKeypath =
| 'title'
| 'title.length'
| 'text'
| 'text.length'
| 'noteType'
| 'authorizedForListed'
| 'editorIdentifier'
| 'userModifiedDate'
| 'serverUpdatedAt'
| 'created_at'
| 'conflict_of'
| 'protected'
| 'trashed'
| 'pinned'
| 'archived'
| 'locked'
| 'starred'
| 'hidePreview'
| 'spellcheck'
export const PredicateKeypathLabels: { [k in PredicateKeypath]: string } = {
title: 'Title',
'title.length': 'Title Length',
text: 'Text',
'text.length': 'Text Length',
noteType: 'Note Type',
authorizedForListed: 'Authorized For Listed',
editorIdentifier: 'Editor Identifier',
userModifiedDate: 'User Modified Date',
serverUpdatedAt: 'Server Updated At',
created_at: 'Created At',
conflict_of: 'Conflict Of',
protected: 'Protected',
trashed: 'Trashed',
pinned: 'Pinned',
archived: 'Archived',
locked: 'Locked',
starred: 'Starred',
hidePreview: 'Hide Preview',
spellcheck: 'Spellcheck',
} as const
export const PredicateKeypathTypes: {
[k in PredicateKeypath]: 'string' | 'noteType' | 'editorIdentifier' | 'number' | 'boolean' | 'date'
} = {
title: 'string',
'title.length': 'number',
text: 'string',
'text.length': 'number',
noteType: 'noteType',
authorizedForListed: 'boolean',
editorIdentifier: 'editorIdentifier',
userModifiedDate: 'date',
serverUpdatedAt: 'date',
created_at: 'date',
conflict_of: 'string',
protected: 'boolean',
trashed: 'boolean',
pinned: 'boolean',
archived: 'boolean',
locked: 'boolean',
starred: 'boolean',
hidePreview: 'boolean',
spellcheck: 'boolean',
} as const
```
|
Sam Ayers (born Samuel Bielich III) is an American actor.
Ayers was born in Youngstown, Ohio, the son of Samuel Bielich Jr., a director of construction and carpenter. He was raised in Merrimack, New Hampshire. He moved to New York City and began using his mother's name of Ayers as his professional name. He found recurring roles on several soap operas. Ayers moved to Los Angeles permanently in 1995. Sam married actress Robin Lynne Trapp in 1998; they welcomed daughter Alexis Ann into their family the following year.
Filmography
References
External links
American male soap opera actors
Living people
Male actors from Youngstown, Ohio
Year of birth missing (living people)
|
```go
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
package modulev1
import (
_ "cosmossdk.io/api/cosmos/app/v1alpha1"
fmt "fmt"
runtime "github.com/cosmos/cosmos-proto/runtime"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoiface "google.golang.org/protobuf/runtime/protoiface"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
io "io"
reflect "reflect"
sync "sync"
)
var (
md_Module protoreflect.MessageDescriptor
fd_Module_authority protoreflect.FieldDescriptor
)
func init() {
file_cosmos_counter_module_v1_module_proto_init()
md_Module = File_cosmos_counter_module_v1_module_proto.Messages().ByName("Module")
fd_Module_authority = md_Module.Fields().ByName("authority")
}
var _ protoreflect.Message = (*fastReflection_Module)(nil)
type fastReflection_Module Module
func (x *Module) ProtoReflect() protoreflect.Message {
return (*fastReflection_Module)(x)
}
func (x *Module) slowProtoReflect() protoreflect.Message {
mi := &file_cosmos_counter_module_v1_module_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_Module_messageType fastReflection_Module_messageType
var _ protoreflect.MessageType = fastReflection_Module_messageType{}
type fastReflection_Module_messageType struct{}
func (x fastReflection_Module_messageType) Zero() protoreflect.Message {
return (*fastReflection_Module)(nil)
}
func (x fastReflection_Module_messageType) New() protoreflect.Message {
return new(fastReflection_Module)
}
func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_Module
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor {
return md_Module
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_Module) Type() protoreflect.MessageType {
return _fastReflection_Module_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_Module) New() protoreflect.Message {
return new(fastReflection_Module)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage {
return (*Module)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if x.Authority != "" {
value := protoreflect.ValueOfString(x.Authority)
if !f(fd_Module_authority, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "cosmos.counter.module.v1.Module.authority":
return x.Authority != ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module"))
}
panic(fmt.Errorf("message cosmos.counter.module.v1.Module does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "cosmos.counter.module.v1.Module.authority":
x.Authority = ""
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module"))
}
panic(fmt.Errorf("message cosmos.counter.module.v1.Module does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "cosmos.counter.module.v1.Module.authority":
value := x.Authority
return protoreflect.ValueOfString(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module"))
}
panic(fmt.Errorf("message cosmos.counter.module.v1.Module does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "cosmos.counter.module.v1.Module.authority":
x.Authority = value.Interface().(string)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module"))
}
panic(fmt.Errorf("message cosmos.counter.module.v1.Module does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.counter.module.v1.Module.authority":
panic(fmt.Errorf("field authority of message cosmos.counter.module.v1.Module is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module"))
}
panic(fmt.Errorf("message cosmos.counter.module.v1.Module does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "cosmos.counter.module.v1.Module.authority":
return protoreflect.ValueOfString("")
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.counter.module.v1.Module"))
}
panic(fmt.Errorf("message cosmos.counter.module.v1.Module does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in cosmos.counter.module.v1.Module", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_Module) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*Module)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
l = len(x.Authority)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*Module)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if len(x.Authority) > 0 {
i -= len(x.Authority)
copy(dAtA[i:], x.Authority)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Authority)))
i--
dAtA[i] = 0xa
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*Module)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Authority = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.0
// protoc (unknown)
// source: cosmos/counter/module/v1/module.proto
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Module is the config object of the counter module.
type Module struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// authority defines the custom module authority. If not set, defaults to the governance module.
Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
}
func (x *Module) Reset() {
*x = Module{}
if protoimpl.UnsafeEnabled {
mi := &file_cosmos_counter_module_v1_module_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Module) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Module) ProtoMessage() {}
// Deprecated: Use Module.ProtoReflect.Descriptor instead.
func (*Module) Descriptor() ([]byte, []int) {
return file_cosmos_counter_module_v1_module_proto_rawDescGZIP(), []int{0}
}
func (x *Module) GetAuthority() string {
if x != nil {
return x.Authority
}
return ""
}
var File_cosmos_counter_module_v1_module_proto protoreflect.FileDescriptor
var file_cosmos_counter_module_v1_module_proto_rawDesc = []byte{
0x0a, 0x25, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72,
0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x18, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76,
0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31,
0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x22, 0x5f, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a,
0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x37, 0xba, 0xc0, 0x96,
0xda, 0x01, 0x31, 0x0a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64,
0x6b, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x75, 0x74, 0x69, 0x6c, 0x2f, 0x78, 0x2f, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x65, 0x72, 0x42, 0xe2, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73,
0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x6d, 0x6f, 0x64, 0x75,
0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f,
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e,
0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f,
0x75, 0x6e, 0x74, 0x65, 0x72, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b,
0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x43, 0x4d, 0xaa, 0x02,
0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2e,
0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d,
0x6f, 0x73, 0x5c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c,
0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x24, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x43, 0x6f,
0x75, 0x6e, 0x74, 0x65, 0x72, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c,
0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1b, 0x43, 0x6f,
0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3a, 0x3a, 0x4d,
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
file_cosmos_counter_module_v1_module_proto_rawDescOnce sync.Once
file_cosmos_counter_module_v1_module_proto_rawDescData = file_cosmos_counter_module_v1_module_proto_rawDesc
)
func file_cosmos_counter_module_v1_module_proto_rawDescGZIP() []byte {
file_cosmos_counter_module_v1_module_proto_rawDescOnce.Do(func() {
file_cosmos_counter_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_cosmos_counter_module_v1_module_proto_rawDescData)
})
return file_cosmos_counter_module_v1_module_proto_rawDescData
}
var file_cosmos_counter_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_cosmos_counter_module_v1_module_proto_goTypes = []interface{}{
(*Module)(nil), // 0: cosmos.counter.module.v1.Module
}
var file_cosmos_counter_module_v1_module_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_cosmos_counter_module_v1_module_proto_init() }
func file_cosmos_counter_module_v1_module_proto_init() {
if File_cosmos_counter_module_v1_module_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_cosmos_counter_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Module); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_cosmos_counter_module_v1_module_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_cosmos_counter_module_v1_module_proto_goTypes,
DependencyIndexes: file_cosmos_counter_module_v1_module_proto_depIdxs,
MessageInfos: file_cosmos_counter_module_v1_module_proto_msgTypes,
}.Build()
File_cosmos_counter_module_v1_module_proto = out.File
file_cosmos_counter_module_v1_module_proto_rawDesc = nil
file_cosmos_counter_module_v1_module_proto_goTypes = nil
file_cosmos_counter_module_v1_module_proto_depIdxs = nil
}
```
|
```java
/*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing,
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* specific language governing permissions and limitations
*/
package io.ballerina.projects;
import io.ballerina.projects.plugins.CompilerPlugin;
/**
* This class represents a Built-In compiler plugin.
*
* @since 2.0.0
*/
class BuiltInCompilerPluginInfo extends CompilerPluginInfo {
BuiltInCompilerPluginInfo(CompilerPlugin compilerPlugin) {
super(compilerPlugin, CompilerPluginKind.BUILT_IN);
}
}
```
|
Finkarby is a locality situated in Nykvarn Municipality, Stockholm County, Sweden with 214 inhabitants in 2010.
References
Populated places in Nykvarn Municipality
|
```php
<?php
namespace Valet;
use DateTime;
use DomainException;
use Illuminate\Support\Collection;
use PhpFpm;
class Site
{
public function __construct(public Brew $brew, public Configuration $config, public CommandLine $cli, public Filesystem $files) {}
/**
* Get the name of the site.
*/
private function getSiteLinkName(?string $name): string
{
if (! is_null($name)) {
return $name;
}
if (is_string($link = $this->getLinkNameByCurrentDir())) {
return $link;
}
throw new DomainException(basename(getcwd()).' is not linked.');
}
/**
* Get link name based on the current directory.
*/
private function getLinkNameByCurrentDir(): ?string
{
$count = count($links = $this->links()->where('path', getcwd()));
if ($count == 1) {
return $links->shift()['site'];
}
if ($count > 1) {
throw new DomainException("There are {$count} links related to the current directory, please specify the name: valet unlink <name>.");
}
return null;
}
/**
* Get the real hostname for the given path, checking links.
*/
public function host(string $path): ?string
{
foreach ($this->files->scandir($this->sitesPath()) as $link) {
if ($path === realpath($this->sitesPath($link))) {
return $link;
}
}
return basename($path);
}
/**
* Link the current working directory with the given name.
*/
public function link(string $target, string $link): string
{
$this->files->ensureDirExists(
$linkPath = $this->sitesPath(), user()
);
$this->config->prependPath($linkPath);
$this->files->symlinkAsUser($target, $linkPath.'/'.$link);
return $linkPath.'/'.$link;
}
/**
* Pretty print out all links in Valet.
*/
public function links(): Collection
{
$certsPath = $this->certificatesPath();
$this->files->ensureDirExists($certsPath, user());
$certs = $this->getCertificates($certsPath);
return $this->getSites($this->sitesPath(), $certs);
}
/**
* Pretty print out all parked links in Valet.
*/
public function parked(): Collection
{
$certs = $this->getCertificates();
$links = $this->getSites($this->sitesPath(), $certs);
$config = $this->config->read();
$parkedLinks = collect();
foreach (array_reverse($config['paths']) as $path) {
if ($path === $this->sitesPath()) {
continue;
}
// Only merge on the parked sites that don't interfere with the linked sites
$sites = $this->getSites($path, $certs)->filter(function ($site, $key) use ($links) {
return ! $links->has($key);
});
$parkedLinks = $parkedLinks->merge($sites);
}
return $parkedLinks;
}
/**
* Get all sites which are proxies (not Links, and contain proxy_pass directive).
*/
public function proxies(): Collection
{
$dir = $this->nginxPath();
$tld = $this->config->read()['tld'];
$links = $this->links();
$certs = $this->getCertificates();
if (! $this->files->exists($dir)) {
return collect();
}
$proxies = collect($this->files->scandir($dir))
->filter(function ($site, $key) use ($tld) {
// keep sites that match our TLD
return ends_with($site, '.'.$tld);
})->map(function ($site, $key) use ($tld) {
// remove the TLD suffix for consistency
return str_replace('.'.$tld, '', $site);
})->reject(function ($site, $key) use ($links) {
return $links->has($site);
})->mapWithKeys(function ($site) {
$host = $this->getProxyHostForSite($site) ?: '(other)';
return [$site => $host];
})->reject(function ($host, $site) {
// If proxy host is null, it may be just a normal SSL stub, or something else; either way we exclude it from the list
return $host === '(other)';
})->map(function ($host, $site) use ($certs, $tld) {
$secured = $certs->has($site);
$url = ($secured ? 'https' : 'http').'://'.$site.'.'.$tld;
return [
'site' => $site,
'secured' => $secured ? ' X' : '',
'url' => $url,
'path' => $host,
];
});
return $proxies;
}
/**
* Get the site URL from a directory if it's a valid Valet site.
*/
public function getSiteUrl(string $directory): string
{
$tld = $this->config->read()['tld'];
if ($directory == '.' || $directory == './') { // Allow user to use dot as current dir's site `--site=.`
$directory = $this->host(getcwd());
}
// Remove .tld from the end of sitename if it was provided
if (ends_with($directory, '.'.$tld)) {
$directory = substr($directory, 0, -(strlen('.'.$tld)));
}
if (! $this->parked()->merge($this->links())->where('site', $directory)->count() > 0) {
throw new DomainException("The [{$directory}] site could not be found in Valet's site list.");
}
return $directory.'.'.$tld;
}
/**
* Identify whether a site is for a proxy by reading the host name from its config file.
*/
public function getProxyHostForSite(string $site, ?string $configContents = null): ?string
{
$siteConf = $configContents ?: $this->getSiteConfigFileContents($site);
if (empty($siteConf)) {
return null;
}
$host = null;
if (preg_match('~proxy_pass\s+(?<host>https?://.*)\s*;~', $siteConf, $patterns)) {
$host = trim($patterns['host']);
}
return $host;
}
/**
* Get the contents of the configuration for the given site.
*/
public function getSiteConfigFileContents(string $site, ?string $suffix = null): ?string
{
$config = $this->config->read();
$suffix = $suffix ?: '.'.$config['tld'];
$file = str_replace($suffix, '', $site).$suffix;
return $this->files->exists($this->nginxPath($file)) ? $this->files->get($this->nginxPath($file)) : null;
}
/**
* Get all certificates from config folder.
*/
public function getCertificates(?string $path = null): Collection
{
$path = $path ?: $this->certificatesPath();
$this->files->ensureDirExists($path, user());
$config = $this->config->read();
return collect($this->files->scandir($path))->filter(function ($value, $key) {
return ends_with($value, '.crt');
})->map(function ($cert) use ($config) {
$certWithoutSuffix = substr($cert, 0, -4);
$trimToString = '.';
// If we have the cert ending in our tld strip that tld specifically
// if not then just strip the last segment for backwards compatibility.
if (ends_with($certWithoutSuffix, $config['tld'])) {
$trimToString .= $config['tld'];
}
return substr($certWithoutSuffix, 0, strrpos($certWithoutSuffix, $trimToString));
})->flip();
}
/**
* Get list of sites and return them formatted
* Will work for symlink and normal site paths.
*/
public function getSites(string $path, Collection $certs): Collection
{
$config = $this->config->read();
$this->files->ensureDirExists($path, user());
return collect($this->files->scandir($path))->mapWithKeys(function ($site) use ($path) {
$sitePath = $path.'/'.$site;
if ($this->files->isLink($sitePath)) {
$realPath = $this->files->readLink($sitePath);
} else {
$realPath = $this->files->realpath($sitePath);
}
return [$site => $realPath];
})->filter(function ($path) {
return $this->files->isDir($path);
})->map(function ($path, $site) use ($certs, $config) {
$secured = $certs->has($site);
$url = ($secured ? 'https' : 'http').'://'.$site.'.'.$config['tld'];
$phpVersion = $this->getPhpVersion($site.'.'.$config['tld']);
return [
'site' => $site,
'secured' => $secured ? ' X' : '',
'url' => $url,
'path' => $path,
'phpVersion' => $phpVersion,
];
});
}
/**
* Unlink the given symbolic link.
*/
public function unlink(?string $name = null): string
{
$name = $this->getSiteLinkName($name);
if ($this->files->exists($path = $this->sitesPath($name))) {
$this->files->unlink($path);
}
return $name;
}
/**
* Remove all broken symbolic links.
*/
public function pruneLinks(): void
{
if (! $this->files->isDir(VALET_HOME_PATH)) {
return;
}
$this->files->ensureDirExists($this->sitesPath(), user());
$this->files->removeBrokenLinksAt($this->sitesPath());
}
/**
* Get the PHP version for the given site.
*/
public function getPhpVersion(string $url): string
{
$defaultPhpVersion = $this->brew->linkedPhp();
$phpVersion = PhpFpm::normalizePhpVersion($this->customPhpVersion($url));
if (empty($phpVersion)) {
$phpVersion = PhpFpm::normalizePhpVersion($defaultPhpVersion);
}
return $phpVersion;
}
/**
* Resecure all currently secured sites with a fresh configuration.
*
* There are only two supported values: tld and loopback
* And those must be submitted in pairs else unexpected results may occur.
* eg: both $old and $new should contain the same indexes.
*/
public function resecureForNewConfiguration(array $old, array $new): void
{
if (! $this->files->exists($this->certificatesPath())) {
return;
}
$secured = $this->secured();
$defaultTld = $this->config->read()['tld'];
$oldTld = ! empty($old['tld']) ? $old['tld'] : $defaultTld;
$tld = ! empty($new['tld']) ? $new['tld'] : $defaultTld;
$defaultLoopback = $this->config->read()['loopback'];
$oldLoopback = ! empty($old['loopback']) ? $old['loopback'] : $defaultLoopback;
$loopback = ! empty($new['loopback']) ? $new['loopback'] : $defaultLoopback;
foreach ($secured as $url) {
$newUrl = str_replace('.'.$oldTld, '.'.$tld, $url);
$siteConf = $this->getSiteConfigFileContents($url, '.'.$oldTld);
if (! empty($siteConf) && strpos($siteConf, '# valet stub: secure.proxy.valet.conf') === 0) {
// proxy config
$this->unsecure($url);
$this->secure(
$newUrl,
$this->replaceOldLoopbackWithNew(
$this->replaceOldDomainWithNew($siteConf, $url, $newUrl),
$oldLoopback,
$loopback
)
);
} else {
// normal config
$this->unsecure($url);
$this->secure($newUrl);
}
}
}
/**
* Parse Nginx site config file contents to swap old domain to new.
*/
public function replaceOldDomainWithNew(string $siteConf, string $old, string $new): string
{
$lookups = [];
$lookups[] = '~server_name .*;~';
$lookups[] = '~error_log .*;~';
$lookups[] = '~ssl_certificate_key .*;~';
$lookups[] = '~ssl_certificate .*;~';
foreach ($lookups as $lookup) {
preg_match($lookup, $siteConf, $matches);
foreach ($matches as $match) {
$replaced = str_replace($old, $new, $match);
$siteConf = str_replace($match, $replaced, $siteConf);
}
}
return $siteConf;
}
/**
* Parse Nginx site config file contents to swap old loopback address to new.
*/
public function replaceOldLoopbackWithNew(string $siteConf, string $old, string $new): string
{
$shouldComment = $new === VALET_LOOPBACK;
$lookups = [];
$lookups[] = '~#?listen .*:80; # valet loopback~';
$lookups[] = '~#?listen .*:443 ssl http2; # valet loopback~';
$lookups[] = '~#?listen .*:60; # valet loopback~';
foreach ($lookups as $lookup) {
preg_match($lookup, $siteConf, $matches);
foreach ($matches as $match) {
$replaced = str_replace($old, $new, $match);
if ($shouldComment && strpos($replaced, '#') !== 0) {
$replaced = '#'.$replaced;
}
if (! $shouldComment) {
$replaced = ltrim($replaced, '#');
}
$siteConf = str_replace($match, $replaced, $siteConf);
}
}
return $siteConf;
}
/**
* Get all of the URLs that are currently secured.
*/
public function secured(): array
{
return collect($this->files->scandir($this->certificatesPath()))
->filter(function ($file) {
return ends_with($file, ['.key', '.csr', '.crt', '.conf']);
})->map(function ($file) {
return str_replace(['.key', '.csr', '.crt', '.conf'], '', $file);
})->unique()->values()->all();
}
/**
* Get all of the URLs with expiration dates that are currently secured.
*/
public function securedWithDates(): array
{
return collect($this->secured())->map(function ($site) {
$filePath = $this->certificatesPath().'/'.$site.'.crt';
$expiration = $this->cli->run("openssl x509 -enddate -noout -in $filePath");
$expiration = str_replace('notAfter=', '', $expiration);
return [
'site' => $site,
'exp' => new DateTime($expiration),
];
})->unique()->values()->all();
}
public function isSecured(string $site): bool
{
$tld = $this->config->read()['tld'];
return in_array($site.'.'.$tld, $this->secured());
}
/**
* Secure the given host with TLS.
*
* @param string|null $siteConf pregenerated Nginx config file contents
* @param int $certificateExpireInDays The number of days the self signed certificate is valid.
* Certificates SHOULD NOT have a validity period greater than 397 days.
* @param int $caExpireInYears The number of years the self signed certificate authority is valid.
*
* @see path_to_url
*/
public function secure(string $url, ?string $siteConf = null, int $certificateExpireInDays = 396, int $caExpireInYears = 20): void
{
// Extract in order to later preserve custom PHP version config when securing
$phpVersion = $this->customPhpVersion($url);
// Create the CA if it doesn't exist.
// If the user cancels the trust operation, the old certificate will not be removed.
$this->files->ensureDirExists($this->caPath(), user());
$caExpireInDate = (new \DateTime)->diff(new \DateTime("+{$caExpireInYears} years"));
$this->createCa($caExpireInDate->format('%a'));
$this->unsecure($url);
$this->files->ensureDirExists($this->certificatesPath(), user());
$this->files->ensureDirExists($this->nginxPath(), user());
$this->createCertificate($url, $certificateExpireInDays);
$siteConf = $this->buildSecureNginxServer($url, $siteConf);
// If the user had isolated the PHP version for this site, swap out .sock file
if ($phpVersion) {
$siteConf = $this->replaceSockFile($siteConf, $phpVersion);
}
$this->files->putAsUser($this->nginxPath($url), $siteConf);
}
/**
* Renews all domains with a trusted TLS certificate.
*/
public function renew($expireIn = 368): void
{
collect($this->securedWithDates())->each(function ($row) use ($expireIn) {
$url = $this->domain($row['site']);
$this->secure($url, null, $expireIn);
info('The ['.$url.'] site has been secured with a fresh TLS certificate.');
});
}
/**
* If CA and root certificates are nonexistent, create them and trust the root cert.
*
* @param int $caExpireInDays The number of days the self signed certificate authority is valid.
*/
public function createCa(int $caExpireInDays): void
{
$caPemPath = $this->caPath('LaravelValetCASelfSigned.pem');
$caKeyPath = $this->caPath('LaravelValetCASelfSigned.key');
if ($this->files->exists($caKeyPath) && $this->files->exists($caPemPath)) {
$isTrusted = $this->cli->run(sprintf(
'security verify-cert -c "%s"', $caPemPath
));
if (strpos($isTrusted, '...certificate verification successful.') === false) {
$this->trustCa($caPemPath);
}
return;
}
$oName = 'Laravel Valet CA Self Signed Organization';
$cName = 'Laravel Valet CA Self Signed CN';
if ($this->files->exists($caKeyPath)) {
$this->files->unlink($caKeyPath);
}
if ($this->files->exists($caPemPath)) {
$this->files->unlink($caPemPath);
}
$this->cli->run(sprintf(
'sudo security delete-certificate -c "%s" /Library/Keychains/System.keychain',
$cName
));
$this->cli->runAsUser(sprintf(
'openssl req -new -newkey rsa:2048 -days %s -nodes -x509 -subj "/C=/ST=/O=%s/localityName=/commonName=%s/organizationalUnitName=Developers/emailAddress=%s/" -keyout "%s" -out "%s"',
$caExpireInDays, $oName, $cName, 'rootcertificate@laravel.valet', $caKeyPath, $caPemPath
));
$this->trustCa($caPemPath);
}
/**
* If CA and root certificates exist, remove them.
*/
public function removeCa(): void
{
foreach (['pem', 'key', 'srl'] as $ending) {
$path = $this->caPath('LaravelValetCASelfSigned.'.$ending);
if ($this->files->exists($path)) {
$this->files->unlink($path);
}
}
$cName = 'Laravel Valet CA Self Signed CN';
$this->cli->run(sprintf(
'sudo security delete-certificate -c "%s" /Library/Keychains/System.keychain',
$cName
));
}
/**
* Create and trust a certificate for the given URL.
*
* @param int $caExpireInDays The number of days the self signed certificate is valid.
*/
public function createCertificate(string $url, int $caExpireInDays): void
{
$caPemPath = $this->caPath('LaravelValetCASelfSigned.pem');
$caKeyPath = $this->caPath('LaravelValetCASelfSigned.key');
$caSrlPath = $this->caPath('LaravelValetCASelfSigned.srl');
$keyPath = $this->certificatesPath($url, 'key');
$csrPath = $this->certificatesPath($url, 'csr');
$crtPath = $this->certificatesPath($url, 'crt');
$confPath = $this->certificatesPath($url, 'conf');
$this->buildCertificateConf($confPath, $url);
$this->createPrivateKey($keyPath);
$this->createSigningRequest($url, $keyPath, $csrPath, $confPath);
$caSrlParam = '-CAserial "'.$caSrlPath.'"';
if (! $this->files->exists($caSrlPath)) {
$caSrlParam .= ' -CAcreateserial';
}
$result = $this->cli->runAsUser(sprintf(
'openssl x509 -req -sha256 -days %s -CA "%s" -CAkey "%s" %s -in "%s" -out "%s" -extensions v3_req -extfile "%s"',
$caExpireInDays, $caPemPath, $caKeyPath, $caSrlParam, $csrPath, $crtPath, $confPath
));
// If cert could not be created using runAsUser(), use run().
if (strpos($result, 'Permission denied') !== false) {
$this->cli->run(sprintf(
'openssl x509 -req -sha256 -days %s -CA "%s" -CAkey "%s" %s -in "%s" -out "%s" -extensions v3_req -extfile "%s"',
$caExpireInDays, $caPemPath, $caKeyPath, $caSrlParam, $csrPath, $crtPath, $confPath
));
}
}
/**
* Create the private key for the TLS certificate.
*/
public function createPrivateKey(string $keyPath): void
{
$this->cli->runAsUser(sprintf('openssl genrsa -out "%s" 2048', $keyPath));
}
/**
* Create the signing request for the TLS certificate.
*/
public function createSigningRequest(string $url, string $keyPath, string $csrPath, string $confPath): void
{
$this->cli->runAsUser(sprintf(
'openssl req -new -key "%s" -out "%s" -subj "/C=/ST=/O=/localityName=/commonName=%s/organizationalUnitName=/emailAddress=%s%s/" -config "%s"',
$keyPath, $csrPath, $url, $url, '@laravel.valet', $confPath
));
}
/**
* Trust the given root certificate file in the macOS Keychain.
*/
public function trustCa(string $caPemPath): void
{
info('Trusting Laravel Valet Certificate Authority...');
$result = $this->cli->run(sprintf(
'sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain "%s"',
$caPemPath
));
if ($result) {
throw new DomainException('The Certificate Authority must be trusted. Please run the command again.');
}
}
/**
* Trust the given certificate file in the Mac Keychain.
*/
public function trustCertificate(string $crtPath): void
{
$this->cli->run(sprintf(
'sudo security add-trusted-cert -d -r trustAsRoot -k /Library/Keychains/System.keychain "%s"', $crtPath
));
}
/**
* Build the SSL config for the given URL.
*/
public function buildCertificateConf(string $path, string $url): void
{
$config = str_replace('VALET_DOMAIN', $url, $this->files->getStub('openssl.conf'));
$this->files->putAsUser($path, $config);
}
/**
* Build the TLS secured Nginx server for the given URL.
*/
public function buildSecureNginxServer(string $url, ?string $siteConf = null): string
{
if ($siteConf === null) {
$nginxVersion = str_replace('nginx version: nginx/', '', exec('nginx -v 2>&1'));
$configFile = version_compare($nginxVersion, '1.25.1', '>=') ? 'secure.valet.conf' : 'secure.valet-legacy.conf';
$siteConf = $this->replaceOldLoopbackWithNew(
$this->files->getStub($configFile),
'VALET_LOOPBACK',
$this->valetLoopback()
);
}
return str_replace(
['VALET_HOME_PATH', 'VALET_SERVER_PATH', 'VALET_STATIC_PREFIX', 'VALET_SITE', 'VALET_CERT', 'VALET_KEY'],
[
$this->valetHomePath(),
VALET_SERVER_PATH,
VALET_STATIC_PREFIX,
$url,
$this->certificatesPath($url, 'crt'),
$this->certificatesPath($url, 'key'),
],
$siteConf
);
}
/**
* Create new nginx config or modify existing nginx config to isolate this site
* to a custom version of PHP.
*/
public function isolate(string $valetSite, string $phpVersion): void
{
if ($this->files->exists($this->nginxPath($valetSite))) {
// Modify the existing config if it exists (likely because it's secured)
$siteConf = $this->files->get($this->nginxPath($valetSite));
$siteConf = $this->replaceSockFile($siteConf, $phpVersion);
} else {
$siteConf = str_replace(
['VALET_HOME_PATH', 'VALET_SERVER_PATH', 'VALET_STATIC_PREFIX', 'VALET_SITE', 'VALET_PHP_FPM_SOCKET', 'VALET_ISOLATED_PHP_VERSION'],
[VALET_HOME_PATH, VALET_SERVER_PATH, VALET_STATIC_PREFIX, $valetSite, PhpFpm::fpmSockName($phpVersion), $phpVersion],
$this->replaceLoopback($this->files->getStub('site.valet.conf'))
);
}
$this->files->putAsUser($this->nginxPath($valetSite), $siteConf);
}
/**
* Remove PHP Version isolation from a specific site.
*/
public function removeIsolation(string $valetSite): void
{
// If a site has an SSL certificate, we need to keep its custom config file, but we can
// just re-generate it without defining a custom `valet.sock` file
if ($this->files->exists($this->certificatesPath($valetSite, 'crt'))) {
$siteConf = $this->buildSecureNginxServer($valetSite);
$this->files->putAsUser($this->nginxPath($valetSite), $siteConf);
} else {
// When site doesn't have SSL, we can remove the custom nginx config file to remove isolation
$this->files->unlink($this->nginxPath($valetSite));
}
}
/**
* Unsecure the given URL so that it will use HTTP again.
*/
public function unsecure(string $url): void
{
// Extract in order to later preserve custom PHP version config when unsecuring. Example output: "74"
$phpVersion = $this->customPhpVersion($url);
if ($this->files->exists($this->certificatesPath($url, 'crt'))) {
$this->files->unlink($this->nginxPath($url));
$this->files->unlink($this->certificatesPath($url, 'conf'));
$this->files->unlink($this->certificatesPath($url, 'key'));
$this->files->unlink($this->certificatesPath($url, 'csr'));
$this->files->unlink($this->certificatesPath($url, 'crt'));
}
$this->cli->run(sprintf('sudo security delete-certificate -c "%s" /Library/Keychains/System.keychain', $url));
$this->cli->run(sprintf('sudo security delete-certificate -c "*.%s" /Library/Keychains/System.keychain', $url));
$this->cli->run(sprintf(
'sudo security find-certificate -e "%s%s" -a -Z | grep SHA-1 | sudo awk \'{system("security delete-certificate -Z \'$NF\' /Library/Keychains/System.keychain")}\'',
$url, '@laravel.valet'
));
// If the user had isolated the PHP version for this site, swap out .sock file
if ($phpVersion) {
$this->isolate($url, $phpVersion);
}
}
/**
* Un-secure all sites.
*/
public function unsecureAll(): void
{
$tld = $this->config->read()['tld'];
$secured = $this->parked()
->merge($this->links())
->sort()
->where('secured', ' X');
if ($secured->count() === 0) {
info('No sites to unsecure. You may list all servable sites or links by running <comment>valet parked</comment> or <comment>valet links</comment>.');
return;
}
info('Attempting to unsecure the following sites:');
table(['Site', 'SSL', 'URL', 'Path'], $secured->toArray());
foreach ($secured->pluck('site') as $url) {
$this->unsecure($url.'.'.$tld);
}
$remaining = $this->parked()
->merge($this->links())
->sort()
->where('secured', ' X');
if ($remaining->count() > 0) {
warning('We were not succesful in unsecuring the following sites:');
table(['Site', 'SSL', 'URL', 'Path'], $remaining->toArray());
}
info('unsecure --all was successful.');
}
/**
* Build the Nginx proxy config for the specified domain.
*
* @param string $url The domain name to serve
* @param string $host The URL to proxy to, eg: path_to_url
*/
public function proxyCreate(string $url, string $host, bool $secure = false): void
{
if (! preg_match('~^https?://.*$~', $host)) {
throw new \InvalidArgumentException(sprintf('"%s" is not a valid URL', $host));
}
$tld = $this->config->read()['tld'];
foreach (explode(',', $url) as $proxyUrl) {
if (! ends_with($proxyUrl, '.'.$tld)) {
$proxyUrl .= '.'.$tld;
}
$nginxVersion = str_replace('nginx version: nginx/', '', exec('nginx -v 2>&1'));
$configFile = version_compare($nginxVersion, '1.25.1', '>=') ? 'secure.proxy.valet.conf' : 'secure.proxy.valet-legacy.conf';
$siteConf = $this->replaceOldLoopbackWithNew(
$this->files->getStub($secure ? $configFile : 'proxy.valet.conf'),
'VALET_LOOPBACK',
$this->valetLoopback()
);
$siteConf = str_replace(
['VALET_HOME_PATH', 'VALET_SERVER_PATH', 'VALET_STATIC_PREFIX', 'VALET_SITE', 'VALET_PROXY_HOST'],
[$this->valetHomePath(), VALET_SERVER_PATH, VALET_STATIC_PREFIX, $proxyUrl, $host],
$siteConf
);
if ($secure) {
$this->secure($proxyUrl, $siteConf);
} else {
$this->put($proxyUrl, $siteConf);
}
$protocol = $secure ? 'https' : 'http';
info('Valet will now proxy ['.$protocol.'://'.$proxyUrl.'] traffic to ['.$host.'].');
}
}
/**
* Unsecure the given URL so that it will use HTTP again.
*/
public function proxyDelete(string $url): void
{
$tld = $this->config->read()['tld'];
foreach (explode(',', $url) as $proxyUrl) {
if (! ends_with($proxyUrl, '.'.$tld)) {
$proxyUrl .= '.'.$tld;
}
$this->unsecure($proxyUrl);
$this->files->unlink($this->nginxPath($proxyUrl));
info('Valet will no longer proxy [path_to_url
}
}
/**
* Create the given nginx host.
*/
public function put(string $url, string $siteConf): void
{
$this->unsecure($url);
$this->files->ensureDirExists($this->nginxPath(), user());
$this->files->putAsUser(
$this->nginxPath($url), $siteConf
);
}
/**
* Remove old loopback interface alias and add a new one if necessary.
*/
public function aliasLoopback(string $oldLoopback, string $loopback): void
{
if ($oldLoopback !== VALET_LOOPBACK) {
$this->removeLoopbackAlias($oldLoopback);
}
if ($loopback !== VALET_LOOPBACK) {
$this->addLoopbackAlias($loopback);
}
$this->updateLoopbackPlist($loopback);
}
/**
* Remove loopback interface alias.
*/
public function removeLoopbackAlias(string $loopback): void
{
$this->cli->run(sprintf(
'sudo ifconfig lo0 -alias %s', $loopback
));
info('['.$loopback.'] loopback interface alias removed.');
}
/**
* Add loopback interface alias.
*/
public function addLoopbackAlias(string $loopback): void
{
$this->cli->run(sprintf(
'sudo ifconfig lo0 alias %s', $loopback
));
info('['.$loopback.'] loopback interface alias added.');
}
/**
* Remove old LaunchDaemon and create a new one if necessary.
*/
public function updateLoopbackPlist(string $loopback): void
{
$this->removeLoopbackPlist();
if ($loopback !== VALET_LOOPBACK) {
$this->files->put(
$this->plistPath(),
str_replace(
'VALET_LOOPBACK',
$loopback,
$this->files->getStub('loopback.plist')
)
);
info('['.$this->plistPath().'] persistent loopback interface alias launch daemon added.');
}
}
/**
* Remove loopback interface alias launch daemon plist file.
*/
public function removeLoopbackPlist(): void
{
if ($this->files->exists($this->plistPath())) {
$this->files->unlink($this->plistPath());
info('['.$this->plistPath().'] persistent loopback interface alias launch daemon removed.');
}
}
/**
* Remove loopback interface alias and launch daemon plist file for uninstall purpose.
*/
public function uninstallLoopback(): void
{
if (($loopback = $this->valetLoopback()) !== VALET_LOOPBACK) {
$this->removeLoopbackAlias($loopback);
}
$this->removeLoopbackPlist();
}
/**
* Return Valet home path constant.
*/
public function valetHomePath(): string
{
return VALET_HOME_PATH;
}
/**
* Return Valet loopback configuration.
*/
public function valetLoopback(): string
{
return $this->config->read()['loopback'];
}
/**
* Get the path to loopback LaunchDaemon.
*/
public function plistPath(): string
{
return '/Library/LaunchDaemons/com.laravel.valet.loopback.plist';
}
/**
* Get the path to Nginx site configuration files.
*/
public function nginxPath(?string $additionalPath = null): string
{
return $this->valetHomePath().'/Nginx'.($additionalPath ? '/'.$additionalPath : '');
}
/**
* Get the path to the linked Valet sites.
*/
public function sitesPath(?string $link = null): string
{
return $this->valetHomePath().'/Sites'.($link ? '/'.$link : '');
}
/**
* Get the path to the Valet CA certificates.
*/
public function caPath(?string $caFile = null): string
{
return $this->valetHomePath().'/CA'.($caFile ? '/'.$caFile : '');
}
/**
* Get the path to the Valet TLS certificates.
*/
public function certificatesPath(?string $url = null, ?string $extension = null): string
{
$url = $url ? '/'.$url : '';
$extension = $extension ? '.'.$extension : '';
return $this->valetHomePath().'/Certificates'.$url.$extension;
}
/**
* Make the domain name based on parked domains or the internal TLD.
*/
public function domain(?string $domain): string
{
// if ($this->parked()->pluck('site')->contains($domain)) {
// return $domain;
// }
// if ($parked = $this->parked()->where('path', getcwd())->first()) {
// return $parked['site'];
// }
// Don't add .TLD if user already passed the string in with the TLD on the end
if ($domain && str_contains($domain, '.'.$this->config->read()['tld'])) {
return $domain;
}
// Return either the passed domain, or the current folder name, with .TLD appended
return ($domain ?: $this->host(getcwd())).'.'.$this->config->read()['tld'];
}
/**
* Replace Loopback configuration line in Valet site configuration file contents.
*/
public function replaceLoopback(string $siteConf): string
{
$loopback = $this->config->read()['loopback'];
if ($loopback === VALET_LOOPBACK) {
return $siteConf;
}
$str = '#listen VALET_LOOPBACK:80; # valet loopback';
return str_replace(
$str,
substr(str_replace('VALET_LOOPBACK', $loopback, $str), 1),
$siteConf
);
}
/**
* Extract PHP version of exising nginx conifg.
*/
public function customPhpVersion(string $url): ?string
{
if ($this->files->exists($this->nginxPath($url))) {
$siteConf = $this->files->get($this->nginxPath($url));
if (starts_with($siteConf, '# '.ISOLATED_PHP_VERSION)) {
$firstLine = explode(PHP_EOL, $siteConf)[0];
return preg_replace("/[^\d]*/", '', $firstLine); // Example output: "74" or "81"
}
}
return null;
}
/**
* Replace .sock file in an Nginx site configuration file contents.
*/
public function replaceSockFile(string $siteConf, string $phpVersion): string
{
$sockFile = PhpFpm::fpmSockName($phpVersion);
$siteConf = preg_replace('/valet[0-9]*.sock/', $sockFile, $siteConf);
$siteConf = preg_replace('/# '.ISOLATED_PHP_VERSION.'.*\n/', '', $siteConf); // Remove ISOLATED_PHP_VERSION line from config
return '# '.ISOLATED_PHP_VERSION.'='.$phpVersion.PHP_EOL.$siteConf;
}
/**
* Get configuration items defined in .valetrc for a site.
*/
public function valetRc(string $siteName, ?string $cwd = null): array
{
if ($cwd) {
$path = $cwd.'/.valetrc';
} elseif ($site = $this->parked()->merge($this->links())->where('site', $siteName)->first()) {
$path = data_get($site, 'path').'/.valetrc';
} else {
return [];
}
if ($this->files->exists($path)) {
return collect(explode(PHP_EOL, trim($this->files->get($path))))->filter(function ($line) {
return str_contains($line, '=');
})->mapWithKeys(function ($item, $index) {
[$key, $value] = explode('=', $item);
return [strtolower($key) => $value];
})->all();
}
return [];
}
/**
* Get PHP version from .valetrc or .valetphprc for a site.
*/
public function phpRcVersion(string $siteName, ?string $cwd = null): ?string
{
if ($cwd) {
$oldPath = $cwd.'/.valetphprc';
} elseif ($site = $this->parked()->merge($this->links())->where('site', $siteName)->first()) {
$oldPath = data_get($site, 'path').'/.valetphprc';
} else {
return null;
}
if ($this->files->exists($oldPath)) {
return PhpFpm::normalizePhpVersion(trim($this->files->get($oldPath)));
}
$valetRc = $this->valetRc($siteName, $cwd);
return PhpFpm::normalizePhpVersion(data_get($valetRc, 'php'));
}
}
```
|
```sqlpl
--
--
-- path_to_url
--
-- Unless required by applicable law or agreed to in writing, software
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ALTER TABLE IF EXISTS "SqlReplayCheckpoint" RENAME revision_id TO id;
```
|
```smalltalk
// ==========================================================================
// Squidex Headless CMS
// ==========================================================================
// ==========================================================================
using Microsoft.Extensions.Logging;
using NodaTime;
using Squidex.Caching;
using Squidex.Domain.Apps.Core;
using Squidex.Domain.Apps.Entities.Collaboration;
using Squidex.Infrastructure;
using Squidex.Infrastructure.States;
using Squidex.Infrastructure.Tasks;
using Squidex.Infrastructure.Translations;
namespace Squidex.Domain.Apps.Entities.Jobs;
public sealed class JobProcessor
{
private readonly DomainId ownerId;
private readonly IEnumerable<IJobRunner> runners;
private readonly ILocalCache localCache;
private readonly ICollaborationService collaboration;
private readonly IUrlGenerator urlGenerator;
private readonly ILogger<JobProcessor> log;
private readonly SimpleState<JobsState> state;
private readonly ReentrantScheduler scheduler = new ReentrantScheduler(1);
private JobRunContext? currentRun;
public IClock Clock { get; init; } = SystemClock.Instance;
public JobProcessor(DomainId ownerId,
IEnumerable<IJobRunner> runners,
ILocalCache localCache,
ICollaborationService collaboration,
IPersistenceFactory<JobsState> persistenceFactory,
IUrlGenerator urlGenerator,
ILogger<JobProcessor> log)
{
this.ownerId = ownerId;
this.runners = runners;
this.localCache = localCache;
this.collaboration = collaboration;
this.urlGenerator = urlGenerator;
this.log = log;
state = new SimpleState<JobsState>(persistenceFactory, GetType(), ownerId);
}
public async Task LoadAsync(
CancellationToken ct)
{
await state.LoadAsync(ct);
var pending = state.Value.Jobs.Where(x => x.Stopped == null);
if (pending.Any())
{
// This should actually never happen, so we log with warning.
log.LogWarning("Removed unfinished jobs for owner {ownerId} after start.", ownerId);
foreach (var job in pending.ToList())
{
var runner = runners.FirstOrDefault(x => x.Name == job.TaskName);
if (runner != null)
{
await runner.CleanupAsync(job);
}
state.Value.Jobs.Remove(job);
}
await state.WriteAsync(ct);
}
}
public Task DeleteAsync(DomainId jobId)
{
return scheduler.ScheduleAsync(async _ =>
{
log.LogInformation("Clearing jobs for owner {ownerId}.", ownerId);
var job = state.Value.Jobs.Find(x => x.Id == jobId);
if (job == null)
{
return;
}
var runner = runners.FirstOrDefault(x => x.Name == job.TaskName);
if (runner != null)
{
await runner.CleanupAsync(job);
}
await state.UpdateAsync(state => state.Jobs.RemoveAll(x => x.Id == jobId) > 0, ct: default);
}, default);
}
public Task ClearAsync()
{
return scheduler.ScheduleAsync(async _ =>
{
log.LogInformation("Clearing jobs for owner {ownerId}.", ownerId);
foreach (var job in state.Value.Jobs)
{
var runner = runners.FirstOrDefault(x => x.Name == job.TaskName);
if (runner != null)
{
await runner.CleanupAsync(job);
}
}
await state.ClearAsync(default);
}, default);
}
public Task CancelAsync(string? taskName)
{
// Ensure that only one thread is accessing the current state at a time.
return scheduler.Schedule(() =>
{
if (taskName == null || currentRun?.Job.TaskName == taskName)
{
currentRun?.Cancel();
}
});
}
public Task RunAsync(JobRequest request,
CancellationToken ct)
{
return scheduler.ScheduleAsync(async ct =>
{
if (currentRun != null)
{
throw new DomainException(T.Get("jobs.alreadyRunning"));
}
var runner = runners.FirstOrDefault(x => x.Name == request.TaskName) ??
throw new DomainException(T.Get("jobs.invalidTaskName"));
state.Value.EnsureCanStart(runner);
// Set the current run first to indicate that we are running a rule at the moment.
var context = currentRun = new JobRunContext(state, Clock, ct)
{
Actor = request.Actor,
Job = new Job
{
Id = DomainId.NewGuid(),
Arguments = request.Arguments,
Description = request.TaskName,
Started = default,
Status = JobStatus.Created,
TaskName = request.TaskName
},
OwnerId = ownerId
};
log.LogInformation("Starting new backup with backup id '{backupId}' for owner {ownerId}.", context.Job.Id, ownerId);
state.Value.Jobs.Insert(0, context.Job);
try
{
await ProcessAsync(context, runner, context.CancellationToken);
await NotifyAsync(request, T.Get("jobs.notifySuccess", new { job = context.Job.Description }));
}
catch
{
await NotifyAsync(request, T.Get("jobs.notifyFailed", new { job = context.Job.Description }));
throw;
}
finally
{
// Unset the run to indicate that we are done.
currentRun.Dispose();
currentRun = null;
}
}, ct);
}
private async Task NotifyAsync(JobRequest request, string text)
{
if (request.AppId == null || request.Actor.IsClient)
{
return;
}
var notificationText = text;
var notificationUrl = new Uri(urlGenerator.JobsUI(request.AppId));
await collaboration.NotifyAsync(request.Actor.Identifier, notificationText, request.Actor, notificationUrl, false, default);
}
private async Task ProcessAsync(JobRunContext context, IJobRunner runner,
CancellationToken ct)
{
try
{
await SetStatusAsync(context, JobStatus.Started);
using (localCache.StartContext())
{
await runner.RunAsync(context, ct);
}
await SetStatusAsync(context, JobStatus.Completed);
}
catch (OperationCanceledException)
{
await SetStatusAsync(context, JobStatus.Cancelled);
}
catch (Exception ex)
{
log.LogError(ex, "Failed to run job with ID {jobId}.", context.Job.Id);
await SetStatusAsync(context, JobStatus.Failed);
}
}
private Task SetStatusAsync(JobRunContext context, JobStatus status)
{
var now = Clock.GetCurrentInstant();
return state.UpdateAsync(_ =>
{
context.Job.Status = status;
if (status == JobStatus.Started)
{
context.Job.Started = now;
}
else if (status != JobStatus.Created)
{
context.Job.Stopped = now;
}
return true;
}, ct: default);
}
}
```
|
The 2023 Men's EuroHockey Championship IIIis the tenth edition of the Men's EuroHockey Championship III, the third level of the men's European field hockey championships organized by the European Hockey Federation. It is held from 23 to 29 July 2023 in Skierniewice, Poland.
Qualification
Four teams qualified based on their performance in the 2023 Men's EuroHockey Championship Qualifiers, with the fourth-placed teams qualifiying for the Championship III. The other teams qualified based on their FIH Men's World Ranking
Preliminary round
Pool A
Final standings
See also
2023 Men's EuroHockey Championship II
2023 Women's EuroHockey Championship III
References
EuroHockey Championship III
Men 3
International field hockey competitions hosted by Poland
EuroHockey Championship II
EuroHockey Championship II
Skierniewice
Sport in Łódź Voivodeship
|
```objective-c
/*
*
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing,
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* specific language governing permissions and limitations
*/
#import <XCTest/XCTest.h>
#import "HUBViewURIPredicate.h"
@interface HUBViewURIPredicateTests : XCTestCase
@end
@implementation HUBViewURIPredicateTests
- (void)testPredicateWithViewURI
{
NSURL * const viewURI = [NSURL URLWithString:@"spotify:hub:framework"];
HUBViewURIPredicate * const predicate = [HUBViewURIPredicate predicateWithViewURI:viewURI];
XCTAssertTrue([predicate evaluateViewURI:viewURI]);
NSString * const subviewURIString = [NSString stringWithFormat:@"%@:subview", viewURI.absoluteString];
NSURL * const subviewURI = [NSURL URLWithString:subviewURIString];
XCTAssertFalse([predicate evaluateViewURI:subviewURI]);
}
- (void)testPredicateWithRootViewURI
{
NSURL * const viewURI = [NSURL URLWithString:@"spotify:hub:framework"];
HUBViewURIPredicate * const predicate = [HUBViewURIPredicate predicateWithRootViewURI:viewURI];
XCTAssertTrue([predicate evaluateViewURI:viewURI]);
NSString * const subviewURIString = [NSString stringWithFormat:@"%@:subview", viewURI.absoluteString];
NSURL * const subviewURI = [NSURL URLWithString:subviewURIString];
XCTAssertTrue([predicate evaluateViewURI:subviewURI]);
}
- (void)testPredicateWithRootViewURIAndExcludedViewURI
{
NSURL * const rootViewURI = [NSURL URLWithString:@"spotify:hub:framework"];
NSString * const subviewURIStringA = [NSString stringWithFormat:@"%@:subviewA", rootViewURI.absoluteString];
NSURL * const subviewURIA = [NSURL URLWithString:subviewURIStringA];
NSString * const subviewURIStringB = [NSString stringWithFormat:@"%@:subviewB", rootViewURI.absoluteString];
NSURL * const subviewURIB = [NSURL URLWithString:subviewURIStringB];
NSSet * const excludedViewURIs = [NSSet setWithObject:subviewURIB];
HUBViewURIPredicate * const predicate = [HUBViewURIPredicate predicateWithRootViewURI:rootViewURI excludedViewURIs:excludedViewURIs];
XCTAssertTrue([predicate evaluateViewURI:rootViewURI]);
XCTAssertTrue([predicate evaluateViewURI:subviewURIA]);
XCTAssertFalse([predicate evaluateViewURI:subviewURIB]);
}
- (void)testPredicateWithPredicate
{
NSURL * const viewURI = [NSURL URLWithString:@"spotify:hub:framework"];
NSPredicate * const predicate = [NSPredicate predicateWithFormat:@"absoluteString == %@", viewURI.absoluteString];
HUBViewURIPredicate * const viewURIPredicate = [HUBViewURIPredicate predicateWithPredicate:predicate];
XCTAssertTrue([viewURIPredicate evaluateViewURI:viewURI]);
NSString * const subviewURIString = [NSString stringWithFormat:@"%@:subview", viewURI.absoluteString];
NSURL * const subviewURI = [NSURL URLWithString:subviewURIString];
XCTAssertFalse([viewURIPredicate evaluateViewURI:subviewURI]);
}
- (void)testPredicateWithBlock
{
NSURL * const viewURI = [NSURL URLWithString:@"spotify:hub:framework"];
HUBViewURIPredicate * const truePredicate = [HUBViewURIPredicate predicateWithBlock:^BOOL(NSURL *evaluatedViewURI) {
return YES;
}];
XCTAssertTrue([truePredicate evaluateViewURI:viewURI]);
HUBViewURIPredicate * const falsePredicate = [HUBViewURIPredicate predicateWithBlock:^BOOL(NSURL *evaluatedViewURI) {
return NO;
}];
XCTAssertFalse([falsePredicate evaluateViewURI:viewURI]);
}
@end
```
|
The Women's +68 kg competition at the 2022 European Karate Championships was held from 25 to 28 May 2022.
Results
Finals
Repechage
Top half
Section 1
Section 2
Bottom half
Section 3
Section 4
References
External links
Draw
Women's 69 kg
2022 European Karate Championships - Women's 69 kg
|
Çığırtma or çağırtma is a Turkish folk instrument of the wind type.
The çığırtma is made from the wing bone of an eagle. It is known to be used mostly by shepherds and is an almost forgotten instrument today. It has a total of seven melody holes with six on the top and one underneath. It is about 15–30 centimeters (5.9–11.8 inches) long.
See also
Kaval
References
Turkish musical instruments
Flutes
|
```smalltalk
using UnityEngine;
using System.Collections.Generic;
using LuaInterface;
public class AccessingLuaVariables : MonoBehaviour
{
private string script =
@"
print('Objs2Spawn is: '..Objs2Spawn)
var2read = 42
varTable = {1,2,3,4,5}
varTable.default = 1
varTable.map = {}
varTable.map.name = 'map'
meta = {name = 'meta'}
setmetatable(varTable, meta)
function TestFunc(strs)
print('get func by variable')
end
";
void Start ()
{
#if UNITY_5 || UNITY_2017
Application.logMessageReceived += ShowTips;
#else
Application.RegisterLogCallback(ShowTips);
#endif
new LuaResLoader();
LuaState lua = new LuaState();
lua.Start();
lua["Objs2Spawn"] = 5;
lua.DoString(script);
//LuaState
Debugger.Log("Read var from lua: {0}", lua["var2read"]);
Debugger.Log("Read table var from lua: {0}", lua["varTable.default"]); //LuaState table
LuaFunction func = lua["TestFunc"] as LuaFunction;
func.Call();
func.Dispose();
//cacheLuaTable
LuaTable table = lua.GetTable("varTable");
Debugger.Log("Read varTable from lua, default: {0} name: {1}", table["default"], table["map.name"]);
table["map.name"] = "new"; //table key
Debugger.Log("Modify varTable name: {0}", table["map.name"]);
table.AddTable("newmap");
LuaTable table1 = (LuaTable)table["newmap"];
table1["name"] = "table1";
Debugger.Log("varTable.newmap name: {0}", table1["name"]);
table1.Dispose();
table1 = table.GetMetaTable();
if (table1 != null)
{
Debugger.Log("varTable metatable name: {0}", table1["name"]);
}
object[] list = table.ToArray();
for (int i = 0; i < list.Length; i++)
{
Debugger.Log("varTable[{0}], is {1}", i, list[i]);
}
table.Dispose();
lua.CheckTop();
lua.Dispose();
}
private void OnApplicationQuit()
{
#if UNITY_5 || UNITY_2017
Application.logMessageReceived -= ShowTips;
#else
Application.RegisterLogCallback(null);
#endif
}
string tips = null;
void ShowTips(string msg, string stackTrace, LogType type)
{
tips += msg;
tips += "\r\n";
}
void OnGUI()
{
GUI.Label(new Rect(Screen.width / 2 - 300, Screen.height / 2 - 200, 600, 400), tips);
}
}
```
|
```javascript
import React from 'react';
import { felaSnapshot } from 'cf-style-provider';
import { CardControl } from '../../cf-component-card/src/index';
test('should render', () => {
const snapshot = felaSnapshot(<CardControl>CardControl</CardControl>);
expect(snapshot.component).toMatchSnapshot();
expect(snapshot.styles).toMatchSnapshot();
});
test('should render wide', () => {
const snapshot = felaSnapshot(<CardControl wide>CardControl</CardControl>);
expect(snapshot.component).toMatchSnapshot();
expect(snapshot.styles).toMatchSnapshot();
});
```
|
An arch bridge is a bridge with abutments at each end shaped as a curved arch. Arch bridges work by transferring the weight of the bridge and its loads partially into a horizontal thrust restrained by the abutments at either side. A viaduct (a long bridge) may be made from a series of arches, although other more economical structures are typically used today.
History
Possibly the oldest existing arch bridge is the Mycenaean Arkadiko Bridge in Greece from about 1300 BC. The stone corbel arch bridge is still used by the local populace. The well-preserved Hellenistic Eleutherna Bridge has a triangular corbel arch. The 4th century BC Rhodes Footbridge rests on an early voussoir arch.
Although true arches were already known by the Etruscans and ancient Greeks, the Romans were – as with the vault and the dome – the first to fully realize the potential of arches for bridge construction. A list of Roman bridges compiled by the engineer Colin O'Connor features 330 Roman stone bridges for traffic, 34 Roman timber bridges and 54 Roman aqueduct bridges, a substantial part still standing and even used to carry vehicles. A more complete survey by the Italian scholar Vittorio Galliazzo found 931 Roman bridges, mostly of stone, in as many as 26 countries (including former Yugoslavia).
Roman arch bridges were usually semicircular, although a number were segmental arch bridges (such as Alconétar Bridge), a bridge which has a curved arch that is less than a semicircle. The advantages of the segmental arch bridge were that it allowed great amounts of flood water to pass under it, which would prevent the bridge from being swept away during floods and the bridge itself could be more lightweight. Generally, Roman bridges featured wedge-shaped primary arch stones (voussoirs) of the same in size and shape. The Romans built both single spans and lengthy multiple arch aqueducts, such as the Pont du Gard and Segovia Aqueduct. Their bridges featured from an early time onwards flood openings in the piers, e.g. in the Pons Fabricius in Rome (62 BC), one of the world's oldest major bridges still standing.
Roman engineers were the first and until the industrial revolution the only ones to construct bridges with concrete, which they called Opus caementicium. The outside was usually covered with brick or ashlar, as in the Alcántara bridge.
The Romans also introduced segmental arch bridges into bridge construction. The Limyra Bridge in southwestern Turkey features 26 segmental arches with an average span-to-rise ratio of 5.3:1, giving the bridge an unusually flat profile unsurpassed for more than a millennium. Trajan's bridge over the Danube featured open-spandrel segmental arches made of wood (standing on concrete piers). This was to be the longest arch bridge for a thousand years both in terms of overall and individual span length, while the longest extant Roman bridge is the long Puente Romano at Mérida. The late Roman Karamagara Bridge in Cappadocia may represent the earliest surviving bridge featuring a pointed arch.
In medieval Europe, bridge builders improved on the Roman structures by using narrower piers, thinner arch barrels and higher span-to-rise ratios on bridges. Gothic pointed arches were also introduced, reducing lateral thrust, and spans increased as with the eccentric Puente del Diablo (1282).
The 14th century in particular saw bridge building reaching new heights. Span lengths of , previously unheard of in the history of masonry arch construction, were now reached in places as diverse as Spain (Puente de San Martín), Italy (Castelvecchio Bridge) and France (Devil's bridge and Pont Grand) and with arch types as different as semi-circular, pointed and segmental arches. The bridge at Trezzo sull'Adda, destroyed in the 15th century, even featured a span length of , not matched until 1796.
Constructions such as the acclaimed Florentine segmental arch bridge Ponte Vecchio (1345) combined sound engineering (span-to-rise ratio of over 5.3 to 1) with aesthetical appeal. The three elegant arches of the Renaissance Ponte Santa Trinita (1569) constitute the oldest elliptic arch bridge worldwide. Such low rising structures required massive abutments, which at the Venetian Rialto bridge and the Fleischbrücke in Nuremberg (span-to-rise ratio 6.4:1) were founded on thousands of wooden piles, partly rammed obliquely into the grounds to counteract more effectively the lateral thrust.
In China, the oldest existing arch bridge is the Zhaozhou Bridge of 605 AD, which combined a very low span-to-rise ratio of 5.2:1, with the use of spandrel arches (buttressed with iron brackets). The Zhaozhou Bridge, with a length of and span of , is the world's first wholly stone open-spandrel segmental arch bridge, allowing a greater passage for flood waters. Bridges with perforated spandrels can be found worldwide, such as in China (Zhaozhou Bridge, 7th century). Greece (Bridge of Arta, 17th century) and Wales (Cenarth Bridge, 18th century).
In more modern times, stone and brick arches continued to be built by many civil engineers, including Thomas Telford, Isambard Kingdom Brunel and John Rennie. A key pioneer was Jean-Rodolphe Perronet, who used much narrower piers, revised calculation methods and exceptionally low span-to-rise ratios. Different materials, such as cast iron, steel and concrete have been increasingly used in the construction of arch bridges.
Simple compression arch bridges
Advantages of simple materials
Stone, brick and other such materials are strong in compression and somewhat so in shear, but cannot resist much force in tension. As a result, masonry arch bridges are designed to be constantly under compression, so far as is possible. Each arch is constructed over a temporary falsework frame, known as a centring. In the first compression arch bridges, a keystone in the middle of the bridge bore the weight of the rest of the bridge. The more weight that was put onto the bridge, the stronger its structure became. Masonry arch bridges use a quantity of fill material (typically compacted rubble) above the arch in order to increase this dead-weight on the bridge and prevent tension from occurring in the arch ring as loads move across the bridge. Other materials that were used to build this type of bridge were brick and unreinforced concrete. When masonry (cut stone) is used the angles of the faces are cut to minimize shear forces. Where random masonry (uncut and unprepared stones) is used they are mortared together and the mortar is allowed to set before the falsework is removed.
Traditional masonry arches are generally durable, and somewhat resistant to settlement or undermining. However, relative to modern alternatives, such bridges are very heavy, requiring extensive foundations. They are also expensive to build wherever labor costs are high.
Construction sequence
Where the arches are founded in a watercourse bed (on piers or banks) the water is diverted so the gravel can first be excavated and replaced with a good footing (of strong material). From these, the foundation piers are erected/raised to the height of the intended base of the arches, a point known as the springing.
Falsework centering (in British English: arch frame) is fabricated, typically from timbers and boards. Since each arch of a multi-arch bridge will impose a thrust upon its neighbors, it is necessary either that all arches of the bridge be raised at the same time, or that very wide piers be used. The thrust from the end arches is taken into the earth by substantial (vertical) footings at the canyon walls, or by large inclined planes forming in a sense ramps to the bridge, which may also be formed of arches.
The several arches are (or single arch is) constructed over the centering. Once each basic arch barrel is constructed, the arches are (or arch is) stabilized with infill masonry above, which may be laid in horizontal running bond courses (layers). These may form two outer walls, known as the spandrels, which are then infilled with appropriate loose material and rubble.
The road is paved and parapet walls protectively confine traffic to the bridge.
Types of arch bridge
Corbel arch bridge
The corbel arch bridge is a masonry, or stone, bridge where each successively higher course (layer) cantilevers slightly more than the previous course. The steps of the masonry may be trimmed to make the arch have a rounded shape. The corbel arch does not produce thrust, or outward pressure at the bottom of the arch, and is not considered a true arch. It is more stable than a true arch because it does not have this thrust. The disadvantage is that this type of arch is not suitable for large spans.
Aqueducts and canal viaducts
In some locations it is necessary to span a wide gap at a relatively high elevation, such as when a canal or water supply must span a valley. Rather than building extremely large arches, or very tall supporting columns (difficult using stone), a series of arched structures are built one atop another, with wider structures at the base. Roman civil engineers developed the design and constructed highly refined structures using only simple materials, equipment, and mathematics. This type is still used in canal viaducts and roadways as it has a pleasing shape, particularly when spanning water, as the reflections of the arches form a visual impression of circles or ellipses.
Deck arch bridge
This type of bridge comprises an arch where the deck is completely above the arch. The area between the arch and the deck is known as the spandrel. If the spandrel is solid, usually the case in a masonry or stone arch bridge, the bridge is called a closed-spandrel deck arch bridge. If the deck is supported by a number of vertical columns rising from the arch, the bridge is known as an open-spandrel deck arch bridge. The Alexander Hamilton Bridge is an example of an open-spandrel arch bridge. Finally, if the arch supports the deck only at the top of the arch, the bridge is called a cathedral arch bridge.
Through arch bridge
This type of bridge has an arch whose base is at or below the deck, but whose top rises above it, so the deck passes through the arch. The central part of the deck is supported by the arch via suspension cables or tie bars, as with a tied-arch bridge. The ends of the bridge may be supported from below, as with a deck arch bridge. Any part supported from arch below may have spandrels that are closed or open.
The Sydney Harbour Bridge and the Bayonne Bridge are a through arch bridge which uses a truss type arch.
Tied-arch bridge
Also known as a bowstring arch, this type of arch bridge incorporates a tie between two opposite ends of the arch. The tie is usually the deck and is capable of withstanding the horizontal thrust forces which would normally be exerted on the abutments of an arch bridge.
The deck is suspended from the arch. The arch is in compression, in contrast to a suspension bridge where the catenary is in tension. A tied-arch bridge can also be a through arch bridge.
Hinged arch bridge
An arch bridge with hinges incorporated to allow movement between structural elements. A single-hinged bridge has a hinge at the crown of the arch, a two-hinged bridge has hinges at both springing points and a three-hinged bridge has hinged in all three locations.
Gallery
Use of modern materials
Most modern arch bridges are made from reinforced concrete. This type of bridge is suitable where a temporary centring may be erected to support the forms, reinforcing steel, and uncured concrete. When the concrete is sufficiently set the forms and falseworks are then removed. It is also possible to construct a reinforced concrete arch from precast concrete, where the arch is built in two halves which are then leaned against each other.
Many modern bridges, made of steel or reinforced concrete, often bear some of their load by tension within their structure. This reduces or eliminates the horizontal thrust against the abutments and allows their construction on weaker ground. Structurally and analytically they are not true arches but rather a beam with the shape of an arch. See truss arch bridge for more on this type.
A modern evolution of the arch bridge is the long-span through arch bridge. This has been made possible by the use of light materials that are strong in tension such as steel and prestressed concrete.
See also
Deck (bridge)
List of arch bridges by length
List of longest masonry arch bridge spans
Natural arch
Parabolic arch
Roman bridge
Skew arch
Through arch bridge
Tied arch bridge
Truss arch bridge
Footnotes
References
External links
NOVA Online – Super Bridge – Arch Bridges
Matsuo Bridge Co. – Arch Bridges
Historic Bridges of the Midwest
Historic Arch Railroad Bridges in Western Massachusetts
Bridges by structural type
|
Jonny Freeman is an English actor and comedian. He is best known for his role as Frank London in the children's CBBC TV series, M.I. High. He has also starred in Dalziel & Pascoe, Doctors, EastEnders and Love Soup, as well as several television adverts for Domino's Pizza, Ford and Trebor mints.
Life and career
Freeman trained at the East 15 Acting School. In addition to his work as an actor, Freeman appears with the London improvisational comedy group Shotgun Impro and is a resident MC at The Funny Side Comedy Clubs.
On 22 November 2022, it was announced that he had been cast as Dot Cotton's great-nephew Reiss Colwell in EastEnders. His first episode debuted on 12 December 2022.
Filmography
Dalziel and Pascoe episode "Dead Meat"
Doctors
Holby City
Love Soup
M.I. High
Silent Witness
The Wright Stuff
EastEnders
Awards and nominations
References
External links
Year of birth missing (living people)
Living people
English male television actors
English male soap opera actors
21st-century English male actors
21st-century English comedians
English male comedians
Male actors from London
Comedians from London
|
Blake Aaron Ross (born June 12, 1985) is an American software engineer who is best known for his work as the co-creator of the Mozilla Firefox internet browser with Dave Hyatt. In 2005, he was nominated for Wired magazine's top Rave Award, Renegade of the Year, opposite Larry Page, Sergey Brin and Jon Stewart. He was also a part of Rolling Stone magazine's 2005 hot list. From 2007, he worked for Facebook as Director of Product until resigning in early 2013.
Early life and education
Born in Miami, Florida, Ross was raised in Key Biscayne, Florida to a Jewish family. His mother, Abby, is a psychologist, and his father David is a lawyer. He has an older brother and sister. Ross created his first website via America Online at the age of 10. By middle school, an interest in SimCity led him to piece together a couple of rudimentary videogames. He attended high school in Miami at Gulliver Preparatory School, graduating in 2003 while simultaneously working for Mozilla, based in California.
Mozilla and Firefox
Ross is most well known for co-founding the Mozilla Firefox project with Dave Hyatt. Ross discovered Netscape very soon after it open-sourced and began contributing, his mother's frustrated user experience with Internet Explorer being the main driver. He worked as an intern at Netscape Communications Corporation at the age of 16. In 2003, he enrolled at Stanford University. While interning at Netscape, Ross became disenchanted with the browser he was working on and the direction given to it by America Online, which had recently purchased Netscape. Ross and Hyatt envisioned a smaller, easy-to-use browser that could have mass appeal, and Firefox was born from that idea. The open source project gained momentum and popularity, and in 2003 all of Mozilla's resources were devoted to the Firefox and Thunderbird projects. Released in November 2004, when Ross was 19, Firefox quickly grabbed market share (primarily from Microsoft's Internet Explorer), with 100 million downloads in less than a year.
Ross is the author of Firefox For Dummies (; published January 11, 2006).
Career
Ross founded a new startup with another ex-Netscape employee, Joe Hewitt (the creator of Firebug who was also largely responsible for Firefox's interface and code). Ross and Hewitt worked on creating Parakey, a new user interface designed to bridge the gap between the desktop and the web. Ross revealed several technical details about the program and his new company when featured on the cover of IEEE Spectrum in November 2006.
On July 20, 2007, the BBC reported that Facebook had purchased Parakey.
In early 2013, Ross left Facebook to pursue other interests.
In 2015, Ross wrote a spec screenplay for HBO's Silicon Valley.
Personal life
Ross has aphantasia, a rare condition preventing him from visualizing things in his mind. In a blog post, Ross wrote:I have never visualized anything in my entire life. I can’t "see" my father's face or a bouncing blue ball, my childhood bedroom or the run I went on ten minutes ago. I thought "counting sheep" was a metaphor. I’m 30 years old and I never knew a human could do any of this.
In 2015, he wrote a fan fiction original screenplay for the HBO television comedy series Silicon Valley, which gained attention.
References
External links
Profiles
The Firefox Explosion — Wired magazine article by Josh McHugh on Firefox development history (published February 2005)
Interviews
Firefox ignites demand for alternative browser — interview with Byron Acohido for USA Today (published November 9, 2004)
Interview with Firefox developer Blake Ross — interview with Michael Flaminio for Insanely Great Mac (published November 9, 2004)
Full speed ahead: Mozilla Firefox browser blazes through globe — interview with Michelle Keller for Stanford Daily Article (published November 16, 2004)
Firefox Architect Talks IE, Future Plans — interview with Nate Mook for BetaNews (published November 29, 2004)
The Young Turk of Firefox — interview with Keith Ward for Redmond Magazine (published December 2004)
Q&A With Blake Ross — interview with Computer Power User magazine (published January 2005)
Interview — Blake Ross — interview with Non-Tech City (published May 27, 2005)
Firefox Will Be Free Forever — interview with Xu Zhiqiang for OhmyNews (published August 7, 2005)
The Firefox Kid — David Kushner's article on Ross and Parakey in IEEE Spectrum (published November 2, 2006)
Livingston, Jessica, Founders at work: stories of startups' early days, 2007. Cf. Chapter 29, Blake Ross and Firefox.
1985 births
Living people
American bloggers
Web developers
American computer programmers
Facebook employees
Mozilla developers
Free software programmers
Open source people
Writers from Miami
20th-century American Jews
Gulliver Preparatory School alumni
21st-century American Jews
|
```go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package ioteventsdata provides the client and types for making API
// requests to AWS IoT Events Data.
//
// IoT Events monitors your equipment or device fleets for failures or changes
// in operation, and triggers actions when such events occur. You can use IoT
// Events Data API commands to send inputs to detectors, list detectors, and
// view or update a detector's status.
//
// For more information, see What is IoT Events? (path_to_url
// in the IoT Events Developer Guide.
//
// See path_to_url for more information on this service.
//
// See ioteventsdata package documentation for more information.
// path_to_url
//
// # Using the Client
//
// To contact AWS IoT Events Data with the SDK use the New function to create
// a new service client. With that client you can make API requests to the service.
// These clients are safe to use concurrently.
//
// See the SDK's documentation for more information on how to use the SDK.
// path_to_url
//
// See aws.Config documentation for more information on configuring SDK clients.
// path_to_url#Config
//
// See the AWS IoT Events Data client IoTEventsData for more
// information on creating client for this service.
// path_to_url#New
package ioteventsdata
```
|
```xml
export * from '@fluentui/utilities';
import { Async } from '@fluentui/utilities';
declare function setTimeout(cb: Function, delay: number): number;
// Known issue with jest's runAllTimers and debounce implementations resulting in
// "Ran 100000 timers, and there are still more! Assuming we've hit an infinite recursion and bailing out..."
// path_to_url
// Mock impl inspired from issue.
class MockAsync extends Async {
private _timeoutId: number | undefined;
public debounce(callback: Function, timeout: number) {
this._timeoutId = undefined;
const debounced = (...args: any[]) => {
if (this._timeoutId) {
clearTimeout(this._timeoutId);
this._timeoutId = undefined;
}
// Callback functions throughout repo aren't binding properly, so we have to access
// Async's private _parent member and invoke callbacks the same way Async.debounce does.
const invokeFunction = () => callback.apply((this as any)._parent, args);
this._timeoutId = setTimeout(invokeFunction, timeout);
};
const cancel = () => {
if (this._timeoutId) {
clearTimeout(this._timeoutId);
this._timeoutId = undefined;
}
};
(debounced as any).cancel = cancel;
return debounced as any;
}
public dispose() {
if (this._timeoutId) {
clearTimeout(this._timeoutId);
}
this._timeoutId = undefined;
super.dispose();
}
protected _logError(e: any) {
super._logError(e);
// Don't eat errors thrown from async callbacks
throw e;
}
}
export { MockAsync as Async };
```
|
First published in 1846, Mitchell's Press Directories listed newspaper titles with additional information about their geographical and topical coverage. The Directories have been described as 'an annual that blended commentary with factual detail'. Press directories such as Mitchell's provide important evidence for the history of mass media in the United Kingdom, in particular the history of British newspapers.
Charles Mitchell (1807–1859) acted as advertising agent for London and provincial newspapers. Mitchell & Co., founded in 1837, is described as 'one of the earliest advertising agencies'. His goal in publishing the Directories was 'to form a guide to advertisers in their selection of journals as mediums more particularly suitable for their announcements', and as a 'more dignified and permanent record' of British newspapers.
He published the first Directory in 1846, then 1847, 1851, 1854, and annually from 1856. After Mitchell's death in 1859, his step-son, Walter Wellsman, become editor and expanded the scope of the Directory.
From 1860, the Directories included both periodicals and newspapers. By 1861 Mitchell's Newspaper Press Directory was so comprehensive that the British Post Office regarded it as an authoritative list of London and provincial newspapers.
Content
As described in the first edition, for each newspaper published in 'Great Britain and Ireland and the British Isles', Mitchell aimed to list the 'leading features connected with the population, manufactures, trade, &c., of each newspaper district':
'Title, price, day and place of publication of each newspaper.
Its politics.
The date of its establishment.
The principal towns in what is considered its more especial local district.
The particular interest it advocates, whether agricultural, commercial, or manufacturing; whether it is more especially a political, religious, or literary journal; whether it is attached to the Church of England, or is the organ of any sect of Dissenters.
The names of the proprietors and publisher.
And whether the bookselling, stationery, or any business is carried on at the office'.
Sometimes this included a short summary of history of the paper, and comments on its 'style and contents'.
Originally their geographical coverage was the British Isles, but by 1891 his Directories were international in scope, listing titles from 'Algeria, Pondicherry, Senegal, the French provinces, and many other locales'. From 1885 to 1888 Mitchell's published a directory of 'Continental, American and Colonial Papers'.
Impact
In recent years, the Directories have become an important source of information for scholars studying the British press in the nineteenth and early twentieth centuries.
References
1846 establishments in the United Kingdom
Publications established in 1846
Magazines published in the United Kingdom
|
```c++
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/builtins/builtins-async-gen.h"
#include "src/builtins/builtins-utils-gen.h"
#include "src/builtins/builtins.h"
#include "src/code-stub-assembler.h"
#include "src/objects-inl.h"
namespace v8 {
namespace internal {
class AsyncFunctionBuiltinsAssembler : public AsyncBuiltinsAssembler {
public:
explicit AsyncFunctionBuiltinsAssembler(compiler::CodeAssemblerState* state)
: AsyncBuiltinsAssembler(state) {}
protected:
void AsyncFunctionAwait(Node* const context, Node* const generator,
Node* const awaited, Node* const outer_promise,
const bool is_predicted_as_caught);
void AsyncFunctionAwaitResumeClosure(
Node* const context, Node* const sent_value,
JSGeneratorObject::ResumeMode resume_mode);
};
namespace {
// Describe fields of Context associated with AsyncFunctionAwait resume
// closures.
// TODO(jgruber): Refactor to reuse code for upcoming async-generators.
class AwaitContext {
public:
enum Fields { kGeneratorSlot = Context::MIN_CONTEXT_SLOTS, kLength };
};
} // anonymous namespace
void AsyncFunctionBuiltinsAssembler::AsyncFunctionAwaitResumeClosure(
Node* context, Node* sent_value,
JSGeneratorObject::ResumeMode resume_mode) {
DCHECK(resume_mode == JSGeneratorObject::kNext ||
resume_mode == JSGeneratorObject::kThrow);
Node* const generator =
LoadContextElement(context, AwaitContext::kGeneratorSlot);
CSA_SLOW_ASSERT(this, HasInstanceType(generator, JS_GENERATOR_OBJECT_TYPE));
// Inline version of GeneratorPrototypeNext / GeneratorPrototypeReturn with
// unnecessary runtime checks removed.
// TODO(jgruber): Refactor to reuse code from builtins-generator.cc.
// Ensure that the generator is neither closed nor running.
CSA_SLOW_ASSERT(
this,
SmiGreaterThan(
LoadObjectField(generator, JSGeneratorObject::kContinuationOffset),
SmiConstant(JSGeneratorObject::kGeneratorClosed)));
// Remember the {resume_mode} for the {generator}.
StoreObjectFieldNoWriteBarrier(generator,
JSGeneratorObject::kResumeModeOffset,
SmiConstant(resume_mode));
// Resume the {receiver} using our trampoline.
Callable callable = CodeFactory::ResumeGenerator(isolate());
CallStub(callable, context, sent_value, generator);
// The resulting Promise is a throwaway, so it doesn't matter what it
// resolves to. What is important is that we don't end up keeping the
// whole chain of intermediate Promises alive by returning the return value
// of ResumeGenerator, as that would create a memory leak.
}
TF_BUILTIN(AsyncFunctionAwaitRejectClosure, AsyncFunctionBuiltinsAssembler) {
CSA_ASSERT_JS_ARGC_EQ(this, 1);
Node* const sentError = Parameter(Descriptor::kSentError);
Node* const context = Parameter(Descriptor::kContext);
AsyncFunctionAwaitResumeClosure(context, sentError,
JSGeneratorObject::kThrow);
Return(UndefinedConstant());
}
TF_BUILTIN(AsyncFunctionAwaitResolveClosure, AsyncFunctionBuiltinsAssembler) {
CSA_ASSERT_JS_ARGC_EQ(this, 1);
Node* const sentValue = Parameter(Descriptor::kSentValue);
Node* const context = Parameter(Descriptor::kContext);
AsyncFunctionAwaitResumeClosure(context, sentValue, JSGeneratorObject::kNext);
Return(UndefinedConstant());
}
// ES#abstract-ops-async-function-await
// AsyncFunctionAwait ( value )
// Shared logic for the core of await. The parser desugars
// await awaited
// into
// yield AsyncFunctionAwait{Caught,Uncaught}(.generator, awaited, .promise)
// The 'awaited' parameter is the value; the generator stands in
// for the asyncContext, and .promise is the larger promise under
// construction by the enclosing async function.
void AsyncFunctionBuiltinsAssembler::AsyncFunctionAwait(
Node* const context, Node* const generator, Node* const awaited,
Node* const outer_promise, const bool is_predicted_as_caught) {
CSA_SLOW_ASSERT(this, HasInstanceType(generator, JS_GENERATOR_OBJECT_TYPE));
CSA_SLOW_ASSERT(this, HasInstanceType(outer_promise, JS_PROMISE_TYPE));
ContextInitializer init_closure_context = [&](Node* context) {
StoreContextElementNoWriteBarrier(context, AwaitContext::kGeneratorSlot,
generator);
};
// TODO(jgruber): AsyncBuiltinsAssembler::Await currently does not reuse
// the awaited promise if it is already a promise. Reuse is non-spec compliant
// but part of our old behavior gives us a couple of percent
// performance boost.
// TODO(jgruber): Use a faster specialized version of
// InternalPerformPromiseThen.
Await(context, generator, awaited, outer_promise, AwaitContext::kLength,
init_closure_context, Context::ASYNC_FUNCTION_AWAIT_RESOLVE_SHARED_FUN,
Context::ASYNC_FUNCTION_AWAIT_REJECT_SHARED_FUN,
is_predicted_as_caught);
// Return outer promise to avoid adding an load of the outer promise before
// suspending in BytecodeGenerator.
Return(outer_promise);
}
// Called by the parser from the desugaring of 'await' when catch
// prediction indicates that there is a locally surrounding catch block.
TF_BUILTIN(AsyncFunctionAwaitCaught, AsyncFunctionBuiltinsAssembler) {
CSA_ASSERT_JS_ARGC_EQ(this, 3);
Node* const generator = Parameter(Descriptor::kGenerator);
Node* const awaited = Parameter(Descriptor::kAwaited);
Node* const outer_promise = Parameter(Descriptor::kOuterPromise);
Node* const context = Parameter(Descriptor::kContext);
static const bool kIsPredictedAsCaught = true;
AsyncFunctionAwait(context, generator, awaited, outer_promise,
kIsPredictedAsCaught);
}
// Called by the parser from the desugaring of 'await' when catch
// prediction indicates no locally surrounding catch block.
TF_BUILTIN(AsyncFunctionAwaitUncaught, AsyncFunctionBuiltinsAssembler) {
CSA_ASSERT_JS_ARGC_EQ(this, 3);
Node* const generator = Parameter(Descriptor::kGenerator);
Node* const awaited = Parameter(Descriptor::kAwaited);
Node* const outer_promise = Parameter(Descriptor::kOuterPromise);
Node* const context = Parameter(Descriptor::kContext);
static const bool kIsPredictedAsCaught = false;
AsyncFunctionAwait(context, generator, awaited, outer_promise,
kIsPredictedAsCaught);
}
TF_BUILTIN(AsyncFunctionPromiseCreate, AsyncFunctionBuiltinsAssembler) {
CSA_ASSERT_JS_ARGC_EQ(this, 0);
Node* const context = Parameter(Descriptor::kContext);
Node* const promise = AllocateAndInitJSPromise(context);
Label if_is_debug_active(this, Label::kDeferred);
GotoIf(IsDebugActive(), &if_is_debug_active);
// Early exit if debug is not active.
Return(promise);
BIND(&if_is_debug_active);
{
// Push the Promise under construction in an async function on
// the catch prediction stack to handle exceptions thrown before
// the first await.
// Assign ID and create a recurring task to save stack for future
// resumptions from await.
CallRuntime(Runtime::kDebugAsyncFunctionPromiseCreated, context, promise);
Return(promise);
}
}
TF_BUILTIN(AsyncFunctionPromiseRelease, AsyncFunctionBuiltinsAssembler) {
CSA_ASSERT_JS_ARGC_EQ(this, 1);
Node* const promise = Parameter(Descriptor::kPromise);
Node* const context = Parameter(Descriptor::kContext);
Label if_is_debug_active(this, Label::kDeferred);
GotoIf(IsDebugActive(), &if_is_debug_active);
// Early exit if debug is not active.
Return(UndefinedConstant());
BIND(&if_is_debug_active);
{
// Pop the Promise under construction in an async function on
// from catch prediction stack.
CallRuntime(Runtime::kDebugPopPromise, context);
Return(promise);
}
}
} // namespace internal
} // namespace v8
```
|
```html+erb
<%
# To make changes to the completions:
#
# - For changes to a command under `COMMANDS` or `DEVELOPER COMMANDS` sections):
# - Find the source file in `Library/Homebrew/[dev-]cmd/<command>.{rb,sh}`.
# - For `.rb` files, edit the `<command>_args` method.
# - For `.sh` files, edit the top comment, being sure to use the line prefix
# `#:` for the comments to be recognized as documentation. If in doubt,
# compare with already documented commands.
# - For other changes: Edit this file.
#
# When done, regenerate the completions by running `brew generate-man-completions`.
%>
#compdef brew
#autoload
# Brew ZSH completion function
# This file is automatically generated by running `brew generate-man-completions`.
# See Library/Homebrew/completions/zsh.erb for editing instructions.
# functions starting with __brew are helper functions that complete or list
# various types of items.
# functions starting with _brew_ are completions for brew commands
# this mechanism can be extended by external commands by defining a function
# named _brew_<external-name>. See _brew_cask for an example of this.
# a list of aliased internal commands
__brew_list_aliases() {
local -a aliases
aliases=(
<%= aliases.join("\n ") + "\n" %>
)
echo "${aliases}"
}
__brew_formulae_or_ruby_files() {
_alternative 'files:files:{_files -g "*.rb"}'
}
# completions remain in cache until any tap has new commits
__brew_completion_caching_policy() {
local -a tmp
# invalidate if cache file is missing or >=2 weeks old
tmp=( $1(mw-2N) )
(( $#tmp )) || return 0
# otherwise, invalidate if latest tap index file is missing or newer than cache file
tmp=( $(brew --repository)/Library/Taps/*/*/.git/index(om[1]N) )
[[ -z $tmp || $tmp -nt $1 ]]
}
__brew_formulae() {
[[ -prefix '-' ]] && return 0
local -a list
local comp_cachename=brew_formulae
if ! _retrieve_cache $comp_cachename; then
list=( $(brew formulae) )
_store_cache $comp_cachename list
fi
_describe -t formulae 'all formulae' list
}
__brew_installed_formulae() {
[[ -prefix '-' ]] && return 0
local -a formulae
formulae=($(brew list --formula))
_describe -t formulae 'installed formulae' formulae
}
__brew_outdated_formulae() {
[[ -prefix '-' ]] && return 0
local -a formulae
formulae=($(HOMEBREW_NO_AUTO_UPDATE=1 brew outdated --formula))
_describe -t formulae 'outdated formulae' formulae
}
__brew_casks() {
[[ -prefix '-' ]] && return 0
local -a list
local expl
local comp_cachename=brew_casks
if ! _retrieve_cache $comp_cachename; then
list=( $(brew casks) )
_store_cache $comp_cachename list
fi
_wanted list expl 'all casks' compadd -a list
}
__brew_installed_casks() {
[[ -prefix '-' ]] && return 0
local -a list
local expl
list=( $(brew list --cask 2>/dev/null) )
_wanted list expl 'installed casks' compadd -a list
}
__brew_outdated_casks() {
[[ -prefix '-' ]] && return 0
local -a casks
casks=($(HOMEBREW_NO_AUTO_UPDATE=1 brew outdated --cask 2>/dev/null))
_describe -t casks 'outdated casks' casks
}
__brew_installed_taps() {
[[ -prefix '-' ]] && return 0
local -a taps
taps=($(brew tap))
_describe -t installed-taps 'installed taps' taps
}
__brew_any_tap() {
[[ -prefix '-' ]] && return 0
_alternative \
'installed-taps:installed taps:__brew_installed_taps'
}
__brew_internal_commands() {
local -a commands
commands=(
<%= builtin_command_descriptions.join("\n ") + "\n" %>
)
_describe -t internal-commands 'internal commands' commands
}
__brew_external_commands() {
local -a list
local comp_cachename=brew_all_commands
if ! _retrieve_cache $comp_cachename; then
local cache_dir=$(brew --cache)
[[ -f $cache_dir/external_commands_list.txt ]] &&
list=( $(<$cache_dir/external_commands_list.txt) )
_store_cache $comp_cachename list
fi
_describe -t all-commands 'all commands' list
}
__brew_commands() {
_alternative \
'internal-commands:command:__brew_internal_commands' \
'external-commands:command:__brew_external_commands'
}
__brew_diagnostic_checks() {
local -a diagnostic_checks
diagnostic_checks=($(brew doctor --list-checks))
_describe -t diagnostic-checks 'diagnostic checks' diagnostic_checks
}
<%= completion_functions.join("\n") %>
# The main completion function
_brew() {
local curcontext="$curcontext" state state_descr line expl
local tmp ret=1
_arguments -C : \
'(-v)-v[verbose]' \
'1:command:->command' \
'*::options:->options' && return 0
case "$state" in
command)
# set default cache policy
zstyle -s ":completion:${curcontext%:*}:*" cache-policy tmp ||
zstyle ":completion:${curcontext%:*}:*" cache-policy __brew_completion_caching_policy
zstyle -s ":completion:${curcontext%:*}:*" use-cache tmp ||
zstyle ":completion:${curcontext%:*}:*" use-cache true
__brew_commands && return 0
;;
options)
local command_or_alias command
local -A aliases
# expand alias e.g. ls -> list
command_or_alias="${line[1]}"
aliases=($(__brew_list_aliases))
command="${aliases[$command_or_alias]:-$command_or_alias}"
# change context to e.g. brew-list
curcontext="${curcontext%:*}-${command}:${curcontext##*:}"
# set default cache policy (we repeat this dance because the context
# service differs from above)
zstyle -s ":completion:${curcontext%:*}:*" cache-policy tmp ||
zstyle ":completion:${curcontext%:*}:*" cache-policy __brew_completion_caching_policy
zstyle -s ":completion:${curcontext%:*}:*" use-cache tmp ||
zstyle ":completion:${curcontext%:*}:*" use-cache true
# call completion for named command e.g. _brew_list
local completion_func="_brew_${command//-/_}"
_call_function ret "${completion_func}" && return ret
_message "a completion function is not defined for command or alias: ${command_or_alias}"
return 1
;;
esac
}
_brew "$@"
```
|
Myriane is a French feminine given name. Notable people with the name include:
Myriane Houplain (born 1947), French politician
Myriane Samson (born 1988), Canadian figure skater
See also
Marianne
Myria
French feminine given names
Feminine given names
|
Andrea Britton is a British singer-songwriter and marketing consultant, and is also the Founder and Editor of Gozo in the House.
Biography
Britton has been releasing music since 2002. Britton's single "Am I on Your Mind?", recorded with Oxygen, made it to No. 30 on the UK Singles Chart in late 2002. In 2005, she had another hit single, "Winter", with DT8 Project, which made No. 35. Her other notable songs include the singles "Time Still Drifts Away" and "Inner Sense" with The Disco Brothers, "Wait for You" with Lost Witness, "Take My Hand" with Jurgen Vries (which peaked at #23) and "Counting Down The Days" with Sunfreakz in 2007 (peaked at No. 37 on the UK chart). She has appeared on numerous compilation albums worldwide.
She fronted the Lord Large Experiment with the keyboard player and composer Stephen Large. Their debut album, The Lord's First Eleven, was released on Acid Jazz. She also shared the stage with Dave Randall on his project Slovo. They toured with Lamb, Moloko and Damien Rice. Britton supported Kylie Minogue on her Fever Tour, and continues to appear live around the world, more recently supporting Kelly Rowland. Britton also writes for other artists.
References
British women singers
Trance singers
British women songwriters
Living people
Year of birth missing (living people)
|
Landulf II (c. 825 – 879) was Bishop and Count of Capua. He was the youngest of four sons of Landulf I, gastald of Capua. As a young man, he entered the church. When his father died, his eldest brother, Lando, succeeded him.
On the death of the bishop of Capua, Paulinus, Lando made Landulf bishop of the city. Lando died in 861 and his young son, Lando II was deposed only a few months later by Landulf's other elder brother, Pando. Pando too died soon thereafter (862 or 863) and a succession crisis broke out. Pando's son Pandenulf was shoved aside and Landulf, though bishop, took the Capuan throne in 863. However, the other branches of the family refused to recognize the usurpation and began seizing much of the county for themselves, leaving Landulf II only in control of the town of Capua proper. Isolated, Landulf II invited Saracen mercenaries to ravage the lands of his familiars, a move which much alarmed his neighbors (including the pope).
In 866, the deposed Pandenulf appealed to Emperor Louis II, then visiting Monte Cassino, to act against his uncle. The Emperor promptly besieged Capua and divested Landulf II, but instead of restoring Pandenulf, decided to pass the county of Capua over to the marquis Lambert I of Spoleto. This arrangement did not last long. In 871, Lambert was involved in a rebellion against Louis II orchestrated by Adelchis of Benevento. In the aftermath, Louis II deposed Lambert and restored Landulf II as count of Capua. As a condition, Landulf II swore off deploying Saracens in the county.
Upon the death of Louis (875), who had strictly enforced peace amongst the Christians of the Mezzogiorno, Landulf II allied himself with the Saracens, but in 877, Pope John VIII convinced him to ally himself to the papacy against the Muslims. He spent the next years defending the Amalfi Coast with his navy in return for tribute.
Landulf II died in 879, undisputed count of Capua, and a succession crisis broke out again between his nephews Lando II (son of Lando), Pandenulf (son of Pando) and Lando III (son of Landenulf of Teano).
In the chronicle of Erchempert, of whom he was a contemporary, Landulf II of Capua is the chief villain, portrayed as a dabbler in Satanism and black magic, Saracen ally and enemy of Christendom. Erchempert's portrayal of Landulf II was the inspiration for the character of evil duke and magician Klingsor in Wolfram von Eschenbach's medieval epic Parzival. Eschenbach's epic was later translated into the famous nineteenth-century opera Parsifal by Richard Wagner. As American film director George Lucas is frequently said to have looked to Parsifal for inspiration in his creation of the Star Wars saga, Landulf II of Capua, via this long chain of association, is the closest historical source for the villainous Darth Vader.
Sources
Erchempert. Historia Langabardorvm Beneventarnorvm at The Latin Library
Caravale, Mario (ed). Dizionario Biografico degli Italiani: LXIII Labroca – Laterza. Rome, 2004.
820s births
879 deaths
Bishops of Capua
Landulf 2
Lombard warriors
9th-century Italian bishops
9th-century Lombard people
9th-century counts in Europe
|
Winter House may refer to:
Places
United States
Amos G. Winter House, Kingfield, Maine, listed on the National Register of Historic Places (NRHP)
Plimpton-Winter House, Wrentham, Massachusetts, NRHP-listed
Winter House (Goodrich, North Dakota), NRHP-listed
William Winter Stone House, Mt. Olive, Ohio, NRHP-listed
Canada
Winterhouse Brook in Woody Point, Newfoundland and Labrador
Television
Winter House (2021 TV series), a 2021 American reality series
See also
Winters House (disambiguation)
|
```forth
*> \brief \b DGTT05
*
* =========== DOCUMENTATION ===========
*
* Online html documentation available at
* path_to_url
*
* Definition:
* ===========
*
* SUBROUTINE DGTT05( TRANS, N, NRHS, DL, D, DU, B, LDB, X, LDX,
* XACT, LDXACT, FERR, BERR, RESLTS )
*
* .. Scalar Arguments ..
* CHARACTER TRANS
* INTEGER LDB, LDX, LDXACT, N, NRHS
* ..
* .. Array Arguments ..
* DOUBLE PRECISION B( LDB, * ), BERR( * ), D( * ), DL( * ),
* $ DU( * ), FERR( * ), RESLTS( * ), X( LDX, * ),
* $ XACT( LDXACT, * )
* ..
*
*
*> \par Purpose:
* =============
*>
*> \verbatim
*>
*> DGTT05 tests the error bounds from iterative refinement for the
*> computed solution to a system of equations A*X = B, where A is a
*> general tridiagonal matrix of order n and op(A) = A or A**T,
*> depending on TRANS.
*>
*> RESLTS(1) = test of the error bound
*> = norm(X - XACT) / ( norm(X) * FERR )
*>
*> A large value is returned if this ratio is not less than one.
*>
*> RESLTS(2) = residual from the iterative refinement routine
*> = the maximum of BERR / ( NZ*EPS + (*) ), where
*> (*) = NZ*UNFL / (min_i (abs(op(A))*abs(X) +abs(b))_i )
*> and NZ = max. number of nonzeros in any row of A, plus 1
*> \endverbatim
*
* Arguments:
* ==========
*
*> \param[in] TRANS
*> \verbatim
*> TRANS is CHARACTER*1
*> Specifies the form of the system of equations.
*> = 'N': A * X = B (No transpose)
*> = 'T': A**T * X = B (Transpose)
*> = 'C': A**H * X = B (Conjugate transpose = Transpose)
*> \endverbatim
*>
*> \param[in] N
*> \verbatim
*> N is INTEGER
*> The number of rows of the matrices X and XACT. N >= 0.
*> \endverbatim
*>
*> \param[in] NRHS
*> \verbatim
*> NRHS is INTEGER
*> The number of columns of the matrices X and XACT. NRHS >= 0.
*> \endverbatim
*>
*> \param[in] DL
*> \verbatim
*> DL is DOUBLE PRECISION array, dimension (N-1)
*> The (n-1) sub-diagonal elements of A.
*> \endverbatim
*>
*> \param[in] D
*> \verbatim
*> D is DOUBLE PRECISION array, dimension (N)
*> The diagonal elements of A.
*> \endverbatim
*>
*> \param[in] DU
*> \verbatim
*> DU is DOUBLE PRECISION array, dimension (N-1)
*> The (n-1) super-diagonal elements of A.
*> \endverbatim
*>
*> \param[in] B
*> \verbatim
*> B is DOUBLE PRECISION array, dimension (LDB,NRHS)
*> The right hand side vectors for the system of linear
*> equations.
*> \endverbatim
*>
*> \param[in] LDB
*> \verbatim
*> LDB is INTEGER
*> The leading dimension of the array B. LDB >= max(1,N).
*> \endverbatim
*>
*> \param[in] X
*> \verbatim
*> X is DOUBLE PRECISION array, dimension (LDX,NRHS)
*> The computed solution vectors. Each vector is stored as a
*> column of the matrix X.
*> \endverbatim
*>
*> \param[in] LDX
*> \verbatim
*> LDX is INTEGER
*> The leading dimension of the array X. LDX >= max(1,N).
*> \endverbatim
*>
*> \param[in] XACT
*> \verbatim
*> XACT is DOUBLE PRECISION array, dimension (LDX,NRHS)
*> The exact solution vectors. Each vector is stored as a
*> column of the matrix XACT.
*> \endverbatim
*>
*> \param[in] LDXACT
*> \verbatim
*> LDXACT is INTEGER
*> The leading dimension of the array XACT. LDXACT >= max(1,N).
*> \endverbatim
*>
*> \param[in] FERR
*> \verbatim
*> FERR is DOUBLE PRECISION array, dimension (NRHS)
*> The estimated forward error bounds for each solution vector
*> X. If XTRUE is the true solution, FERR bounds the magnitude
*> of the largest entry in (X - XTRUE) divided by the magnitude
*> of the largest entry in X.
*> \endverbatim
*>
*> \param[in] BERR
*> \verbatim
*> BERR is DOUBLE PRECISION array, dimension (NRHS)
*> The componentwise relative backward error of each solution
*> vector (i.e., the smallest relative change in any entry of A
*> or B that makes X an exact solution).
*> \endverbatim
*>
*> \param[out] RESLTS
*> \verbatim
*> RESLTS is DOUBLE PRECISION array, dimension (2)
*> The maximum over the NRHS solution vectors of the ratios:
*> RESLTS(1) = norm(X - XACT) / ( norm(X) * FERR )
*> RESLTS(2) = BERR / ( NZ*EPS + (*) )
*> \endverbatim
*
* Authors:
* ========
*
*> \author Univ. of Tennessee
*> \author Univ. of California Berkeley
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \ingroup double_lin
*
* =====================================================================
SUBROUTINE DGTT05( TRANS, N, NRHS, DL, D, DU, B, LDB, X, LDX,
$ XACT, LDXACT, FERR, BERR, RESLTS )
*
* -- LAPACK test routine --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
*
* .. Scalar Arguments ..
CHARACTER TRANS
INTEGER LDB, LDX, LDXACT, N, NRHS
* ..
* .. Array Arguments ..
DOUBLE PRECISION B( LDB, * ), BERR( * ), D( * ), DL( * ),
$ DU( * ), FERR( * ), RESLTS( * ), X( LDX, * ),
$ XACT( LDXACT, * )
* ..
*
* =====================================================================
*
* .. Parameters ..
DOUBLE PRECISION ZERO, ONE
PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 )
* ..
* .. Local Scalars ..
LOGICAL NOTRAN
INTEGER I, IMAX, J, K, NZ
DOUBLE PRECISION AXBI, DIFF, EPS, ERRBND, OVFL, TMP, UNFL, XNORM
* ..
* .. External Functions ..
LOGICAL LSAME
INTEGER IDAMAX
DOUBLE PRECISION DLAMCH
EXTERNAL LSAME, IDAMAX, DLAMCH
* ..
* .. Intrinsic Functions ..
INTRINSIC ABS, MAX, MIN
* ..
* .. Executable Statements ..
*
* Quick exit if N = 0 or NRHS = 0.
*
IF( N.LE.0 .OR. NRHS.LE.0 ) THEN
RESLTS( 1 ) = ZERO
RESLTS( 2 ) = ZERO
RETURN
END IF
*
EPS = DLAMCH( 'Epsilon' )
UNFL = DLAMCH( 'Safe minimum' )
OVFL = ONE / UNFL
NOTRAN = LSAME( TRANS, 'N' )
NZ = 4
*
* Test 1: Compute the maximum of
* norm(X - XACT) / ( norm(X) * FERR )
* over all the vectors X and XACT using the infinity-norm.
*
ERRBND = ZERO
DO 30 J = 1, NRHS
IMAX = IDAMAX( N, X( 1, J ), 1 )
XNORM = MAX( ABS( X( IMAX, J ) ), UNFL )
DIFF = ZERO
DO 10 I = 1, N
DIFF = MAX( DIFF, ABS( X( I, J )-XACT( I, J ) ) )
10 CONTINUE
*
IF( XNORM.GT.ONE ) THEN
GO TO 20
ELSE IF( DIFF.LE.OVFL*XNORM ) THEN
GO TO 20
ELSE
ERRBND = ONE / EPS
GO TO 30
END IF
*
20 CONTINUE
IF( DIFF / XNORM.LE.FERR( J ) ) THEN
ERRBND = MAX( ERRBND, ( DIFF / XNORM ) / FERR( J ) )
ELSE
ERRBND = ONE / EPS
END IF
30 CONTINUE
RESLTS( 1 ) = ERRBND
*
* Test 2: Compute the maximum of BERR / ( NZ*EPS + (*) ), where
* (*) = NZ*UNFL / (min_i (abs(op(A))*abs(X) +abs(b))_i )
*
DO 60 K = 1, NRHS
IF( NOTRAN ) THEN
IF( N.EQ.1 ) THEN
AXBI = ABS( B( 1, K ) ) + ABS( D( 1 )*X( 1, K ) )
ELSE
AXBI = ABS( B( 1, K ) ) + ABS( D( 1 )*X( 1, K ) ) +
$ ABS( DU( 1 )*X( 2, K ) )
DO 40 I = 2, N - 1
TMP = ABS( B( I, K ) ) + ABS( DL( I-1 )*X( I-1, K ) )
$ + ABS( D( I )*X( I, K ) ) +
$ ABS( DU( I )*X( I+1, K ) )
AXBI = MIN( AXBI, TMP )
40 CONTINUE
TMP = ABS( B( N, K ) ) + ABS( DL( N-1 )*X( N-1, K ) ) +
$ ABS( D( N )*X( N, K ) )
AXBI = MIN( AXBI, TMP )
END IF
ELSE
IF( N.EQ.1 ) THEN
AXBI = ABS( B( 1, K ) ) + ABS( D( 1 )*X( 1, K ) )
ELSE
AXBI = ABS( B( 1, K ) ) + ABS( D( 1 )*X( 1, K ) ) +
$ ABS( DL( 1 )*X( 2, K ) )
DO 50 I = 2, N - 1
TMP = ABS( B( I, K ) ) + ABS( DU( I-1 )*X( I-1, K ) )
$ + ABS( D( I )*X( I, K ) ) +
$ ABS( DL( I )*X( I+1, K ) )
AXBI = MIN( AXBI, TMP )
50 CONTINUE
TMP = ABS( B( N, K ) ) + ABS( DU( N-1 )*X( N-1, K ) ) +
$ ABS( D( N )*X( N, K ) )
AXBI = MIN( AXBI, TMP )
END IF
END IF
TMP = BERR( K ) / ( NZ*EPS+NZ*UNFL / MAX( AXBI, NZ*UNFL ) )
IF( K.EQ.1 ) THEN
RESLTS( 2 ) = TMP
ELSE
RESLTS( 2 ) = MAX( RESLTS( 2 ), TMP )
END IF
60 CONTINUE
*
RETURN
*
* End of DGTT05
*
END
```
|
Valle del Rosario is a town and seat of the municipality of Rosario, in the northern Mexican state of Chihuahua. As of 2010, the town had a population of 263.
References
Populated places in Chihuahua (state)
|
```javascript
class Foo {
f(/* ... */) {}
f() /* ... */ {}
f = (/* ... */) => {};
static f(/* ... */) {};
static f = (/* ... */) => {};
static f = function(/* ... */) {};
static f = function f(/* ... */) {};
}
```
|
The place Potreros de Arerunguá or simply Arerunguá is located in the center and north of Uruguay on the homonymous stream, the Arroyo Arerunguá. It extends over territories that are currently part of the departments of Salto and Tacuarembó.
Its historical importance lies in having been a refuge for the Charrúas as a result of the gradual Spanish colonial expansion, then during the revolutionary independence period and finally in the first decades of independent Uruguay, until their almost total extermination in the Massacre of Salsipuedes in 1831.
According to the historian Carlos Maggi in his book El Caciquillo, this may have been one of the places where José Gervasio Artigas lived during his "years in the desert", the name usually given to the long period when Artigas was between 14 and 33 years of age. Maggi investigates the possibility that it was among the Charrúas that José Artigas had his first partner and his first son, later known as Manuel Artigas and nicknamed "El Caciquillo".
In February 1805 Artigas requested and obtained from Commander Francisco Javier de Viana, representative of the Viceroy, over of land in Arerunguá.
This, then, would be the place chosen by José Gervasio Artigas, Protector of the Free Peoples, as the center of operations and headquarters of the Ejército Oriental (Eastern Army) during the period of the Gesta Artiguista in the Río de la Plata.
These characteristics place Arerunguá as a region of enormous historical value, given that it was where substantial elements of the "orientality" that distinguishes the essence of the Uruguayan nation emerged and matured.
References
Colonial Uruguay
Geography of Salto Department
|
Hammam El Soltane (Arabic: حمام السلطان), literally "Sultan's bath", is one of the most famous Turkish baths in the medina of Sfax. Currently not functioning, it is at risk of being demolished.
Location
The hammam is in the eastern part of the medina in Sfax near Sidi Lakhmi mosque and Dar Jellouli Museum. It overlooks Driba Street.
History
The written sources do not retain an exact date for the construction of this hammam. Nevertheless, an epigraphic inscription at the entrance of the building commemorates the restoration of the monument by the master Mohamed El Kotti in 1649 during the Muradid Dynasty. Some historians suggest that the building was founded during the Aghlabid reign.
The same source mentions the existence of a secret underground passage between the hammam and Dar Essebii, the house of one of the former governors of the city of Sfax.
Etymology
The hammam got its name from the fact that two former governors of the city were murdered in it: Mansour al-Barghouati in the middle of the 11th century and Umar al-Hafsi at the end of the 14th century.
Description
The entrance opens on a small vestibule, which gives access to the cells of the hammam.
The main room is square, with each side 6.5 meters long. There is a central dome and barrel vaults on both sides. The dome is of tripartite composition, consisting of a rectangular base, an octagonal drum and a hemispherical cap. The vaults, oriented north–south, are over 14 meters long and 4 meters wide.
References
Medina of Sfax
|
Podlesie Dębowe is a village in the administrative district of Gmina Żabno, within Tarnów County, Lesser Poland Voivodeship, in southern Poland.
References
Villages in Tarnów County
|
Beyond Blue is an Australian mental health and wellbeing support organisation.
Beyond Blue may also refer to:
Beyond Blue (video game), a 2020 diving exploration game
Beyond Blue, a film directed by Zanane Rajsingh
|
```rust
//
//
// path_to_url
//
// Unless required by applicable law or agreed to in writing, software
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
use std::collections::HashMap;
use std::path::PathBuf;
use serde_json::{self, Value};
use crate::core_proxy::CoreProxy;
use crate::xi_core::plugin_rpc::{HostNotification, HostRequest, PluginBufferInfo, PluginUpdate};
use crate::xi_core::{ConfigTable, LanguageId, PluginPid, ViewId};
use xi_rpc::{Handler as RpcHandler, RemoteError, RpcCtx};
use xi_trace::{self, trace, trace_block, trace_block_payload};
use super::{Plugin, View};
/// Convenience for unwrapping a view, when handling RPC notifications.
macro_rules! bail {
($opt:expr, $method:expr, $pid:expr, $view:expr) => {
match $opt {
Some(t) => t,
None => {
warn!("{:?} missing {:?} for {:?}", $pid, $view, $method);
return;
}
}
};
}
/// Convenience for unwrapping a view when handling RPC requests.
/// Prints an error if the view is missing, and returns an appropriate error.
macro_rules! bail_err {
($opt:expr, $method:expr, $pid:expr, $view:expr) => {
match $opt {
Some(t) => t,
None => {
warn!("{:?} missing {:?} for {:?}", $pid, $view, $method);
return Err(RemoteError::custom(404, "missing view", None));
}
}
};
}
/// Handles raw RPCs from core, updating state and forwarding calls
/// to the plugin,
pub struct Dispatcher<'a, P: 'a + Plugin> {
//TODO: when we add multi-view, this should be an Arc+Mutex/Rc+RefCell
views: HashMap<ViewId, View<P::Cache>>,
pid: Option<PluginPid>,
plugin: &'a mut P,
}
impl<'a, P: 'a + Plugin> Dispatcher<'a, P> {
pub(crate) fn new(plugin: &'a mut P) -> Self {
Dispatcher { views: HashMap::new(), pid: None, plugin }
}
fn do_initialize(
&mut self,
ctx: &RpcCtx,
plugin_id: PluginPid,
buffers: Vec<PluginBufferInfo>,
) {
assert!(self.pid.is_none(), "initialize rpc received with existing pid");
info!("Initializing plugin {:?}", plugin_id);
self.pid = Some(plugin_id);
let core_proxy = CoreProxy::new(self.pid.unwrap(), ctx);
self.plugin.initialize(core_proxy);
self.do_new_buffer(ctx, buffers);
}
fn do_did_save(&mut self, view_id: ViewId, path: PathBuf) {
let v = bail!(self.views.get_mut(&view_id), "did_save", self.pid, view_id);
let prev_path = v.path.take();
v.path = Some(path);
self.plugin.did_save(v, prev_path.as_deref());
}
fn do_config_changed(&mut self, view_id: ViewId, changes: &ConfigTable) {
let v = bail!(self.views.get_mut(&view_id), "config_changed", self.pid, view_id);
self.plugin.config_changed(v, changes);
for (key, value) in changes.iter() {
v.config_table.insert(key.to_owned(), value.to_owned());
}
let conf = serde_json::from_value(Value::Object(v.config_table.clone()));
v.config = conf.unwrap();
}
fn do_language_changed(&mut self, view_id: ViewId, new_lang: LanguageId) {
let v = bail!(self.views.get_mut(&view_id), "language_changed", self.pid, view_id);
let old_lang = v.language_id.clone();
v.set_language(new_lang);
self.plugin.language_changed(v, old_lang);
}
fn do_custom_command(&mut self, view_id: ViewId, method: &str, params: Value) {
let v = bail!(self.views.get_mut(&view_id), method, self.pid, view_id);
self.plugin.custom_command(v, method, params);
}
fn do_new_buffer(&mut self, ctx: &RpcCtx, buffers: Vec<PluginBufferInfo>) {
let plugin_id = self.pid.unwrap();
buffers
.into_iter()
.map(|info| View::new(ctx.get_peer().clone(), plugin_id, info))
.for_each(|view| {
let mut view = view;
self.plugin.new_view(&mut view);
self.views.insert(view.view_id, view);
});
}
fn do_close(&mut self, view_id: ViewId) {
{
let v = bail!(self.views.get(&view_id), "close", self.pid, view_id);
self.plugin.did_close(v);
}
self.views.remove(&view_id);
}
fn do_shutdown(&mut self) {
info!("rust plugin lib does not shutdown");
//TODO: handle shutdown
}
fn do_get_hover(&mut self, view_id: ViewId, request_id: usize, position: usize) {
let v = bail!(self.views.get_mut(&view_id), "get_hover", self.pid, view_id);
self.plugin.get_hover(v, request_id, position)
}
fn do_tracing_config(&mut self, enabled: bool) {
if enabled {
xi_trace::enable_tracing();
info!("Enabling tracing in global plugin {:?}", self.pid);
trace("enable tracing", &["plugin"]);
} else {
xi_trace::disable_tracing();
info!("Disabling tracing in global plugin {:?}", self.pid);
trace("disable tracing", &["plugin"]);
}
}
fn do_update(&mut self, update: PluginUpdate) -> Result<Value, RemoteError> {
let _t = trace_block("Dispatcher::do_update", &["plugin"]);
let PluginUpdate {
view_id,
delta,
new_len,
new_line_count,
rev,
undo_group,
edit_type,
author,
} = update;
let v = bail_err!(self.views.get_mut(&view_id), "update", self.pid, view_id);
v.update(delta.as_ref(), new_len, new_line_count, rev, undo_group);
self.plugin.update(v, delta.as_ref(), edit_type, author);
Ok(Value::from(1))
}
fn do_collect_trace(&self) -> Result<Value, RemoteError> {
use xi_trace::chrome_trace_dump;
let samples = xi_trace::samples_cloned_unsorted();
chrome_trace_dump::to_value(&samples).map_err(|e| RemoteError::Custom {
code: 0,
message: format!("Could not serialize trace: {:?}", e),
data: None,
})
}
}
impl<'a, P: Plugin> RpcHandler for Dispatcher<'a, P> {
type Notification = HostNotification;
type Request = HostRequest;
fn handle_notification(&mut self, ctx: &RpcCtx, rpc: Self::Notification) {
use self::HostNotification::*;
let _t = trace_block("Dispatcher::handle_notif", &["plugin"]);
match rpc {
Initialize { plugin_id, buffer_info } => {
self.do_initialize(ctx, plugin_id, buffer_info)
}
DidSave { view_id, path } => self.do_did_save(view_id, path),
ConfigChanged { view_id, changes } => self.do_config_changed(view_id, &changes),
NewBuffer { buffer_info } => self.do_new_buffer(ctx, buffer_info),
DidClose { view_id } => self.do_close(view_id),
Shutdown(..) => self.do_shutdown(),
TracingConfig { enabled } => self.do_tracing_config(enabled),
GetHover { view_id, request_id, position } => {
self.do_get_hover(view_id, request_id, position)
}
LanguageChanged { view_id, new_lang } => self.do_language_changed(view_id, new_lang),
CustomCommand { view_id, method, params } => {
self.do_custom_command(view_id, &method, params)
}
Ping(..) => (),
}
}
fn handle_request(&mut self, _ctx: &RpcCtx, rpc: Self::Request) -> Result<Value, RemoteError> {
use self::HostRequest::*;
let _t = trace_block("Dispatcher::handle_request", &["plugin"]);
match rpc {
Update(params) => self.do_update(params),
CollectTrace(..) => self.do_collect_trace(),
}
}
fn idle(&mut self, _ctx: &RpcCtx, token: usize) {
let _t = trace_block_payload("Dispatcher::idle", &["plugin"], format!("token: {}", token));
let view_id: ViewId = token.into();
let v = bail!(self.views.get_mut(&view_id), "idle", self.pid, view_id);
self.plugin.idle(v);
}
}
```
|
```css
How to easily check browser compatibility of a feature
Determine the opacity of background-colors using the RGBA declaration
At-Rules (`@`)
Add `line-height` to `body`
Debug with the `*` selector
```
|
```javascript
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var index_1=require("../Calculator/index");var styles_1=require("./styles");function view(calculatorVDom){return calculatorVDom.map(function(calcVNode){return dom_1.div(".app",[dom_1.h1(".title."+styles_1.default.title,"Matrix Multiplication"),calcVNode,dom_1.h2(".footnote."+styles_1.default.footnote,[dom_1.a({attrs:{href:"path_to_url"}},"Built by @andrestaltz with Cycle.js")])])})}function App(sources){var calculatorSinks=index_1.default(sources);var vdom$=view(calculatorSinks.DOM);var reducer$=calculatorSinks.onion;var sinks={DOM:vdom$,onion:reducer$};return sinks}exports.default=App},{"../Calculator/index":3,"./styles":2,"@cycle/dom":49}],2:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var typestyle_1=require("typestyle");var styles_1=require("../styles");typestyle_1.cssRule("body",{margin:0,color:styles_1.pallete.black,fontFamily:'"Source Sans Pro", serif',fontWeight:400});var Styles;(function(Styles){Styles.title=typestyle_1.style({position:"absolute",top:0,left:0,right:0,fontFamily:'"Vesper Libre", serif',fontWeight:400,textAlign:"center",margin:0,paddingTop:"1.5rem",paddingBottom:"3rem",zIndex:10,backgroundImage:"linear-gradient(to bottom, "+"white 0, "+"rgba(255,255,255,0.9) 60%, "+"rgba(255,255,255,0) 100%)"});Styles.footnote=typestyle_1.style({position:"fixed",left:0,right:0,bottom:0,fontFamily:'"Source Sans Pro", serif',fontSize:"14px",textAlign:"center",zIndex:-10,$nest:{"& > *":{color:styles_1.pallete.gray}}})})(Styles||(Styles={}));exports.default=Styles},{"../styles":34,typestyle:97}],3:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var isolate_1=require("@cycle/isolate");var index_1=require("../Matrix/index");var measure_1=require("./measure");var timers_1=require("./timers");var index_2=require("./intent/index");var index_3=require("./model/index");var index_4=require("./view/index");function Calculator(sources){var aSinks=isolate_1.default(index_1.default,"matrixA")(sources);var bSinks=isolate_1.default(index_1.default,"matrixB")(sources);var cSinks=isolate_1.default(index_1.default,"matrixC")(sources);var state$=sources.onion.state$;var measurements$=measure_1.default(sources.DOM);var actions=__assign({},index_2.default(sources.DOM),{allowContinueAction$:timers_1.default(state$)});var reducer$=index_3.default(actions,measurements$);var allReducer$=xstream_1.default.merge(reducer$,aSinks.onion,bSinks.onion);var vdom$=index_4.default(state$,aSinks.DOM,bSinks.DOM,cSinks.DOM);var sinks={DOM:vdom$,onion:allReducer$};return sinks}exports.default=Calculator},{"../Matrix/index":24,"./intent/index":5,"./measure":7,"./model/index":9,"./timers":16,"./view/index":19,"@cycle/isolate":56,xstream:107}],4:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function controlPanelIntent(domSource){var startMultiplyAction$=domSource.select(".multiply").events("click").mapTo(null);var nextStepAction$=domSource.select(".next").events("click").mapTo(null);var endAction$=domSource.select(".end").events("click").mapTo(null);var resetAction$=domSource.select(".reset").events("click").mapTo(null);return{startMultiplyAction$:startMultiplyAction$,nextStepAction$:nextStepAction$,endAction$:endAction$,resetAction$:resetAction$}}exports.controlPanelIntent=controlPanelIntent},{}],5:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var controlPanel_1=require("./controlPanel");var resize_1=require("./resize");function intent(domSource){var resizeAction$=resize_1.resizeIntent(domSource);var controlPanelActions=controlPanel_1.controlPanelIntent(domSource);return __assign({resizeAction$:resizeAction$},controlPanelActions)}exports.default=intent},{"./controlPanel":4,"./resize":6}],6:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");function createResizeAction(target,direction,amount){return{target:target,resizeParam:{direction:direction,amount:amount}}}function resizeIntent(domSource){var decreaseRowA$=domSource.select(".decreaseRowA").events("click").mapTo(createResizeAction("A","row",-1));var increaseRowA$=domSource.select(".increaseRowA").events("click").mapTo(createResizeAction("A","row",+1));var decreaseColA$=xstream_1.default.merge(domSource.select(".decreaseColA").events("click"),domSource.select(".decreaseRowB").events("click")).mapTo(createResizeAction("A","column",-1));var increaseColA$=xstream_1.default.merge(domSource.select(".increaseColA").events("click"),domSource.select(".increaseRowB").events("click")).mapTo(createResizeAction("A","column",+1));var decreaseRowB$=xstream_1.default.merge(domSource.select(".decreaseColA").events("click"),domSource.select(".decreaseRowB").events("click")).mapTo(createResizeAction("B","row",-1));var increaseRowB$=xstream_1.default.merge(domSource.select(".increaseColA").events("click"),domSource.select(".increaseRowB").events("click")).mapTo(createResizeAction("B","row",+1));var decreaseColB$=domSource.select(".decreaseColB").events("click").mapTo(createResizeAction("B","column",-1));var increaseColB$=domSource.select(".increaseColB").events("click").mapTo(createResizeAction("B","column",+1));return xstream_1.default.merge(decreaseRowA$,increaseRowA$,decreaseColA$,increaseColA$,decreaseRowB$,increaseRowB$,decreaseColB$,increaseColB$)}exports.resizeIntent=resizeIntent},{xstream:107}],7:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dropRepeats_1=require("xstream/extra/dropRepeats");var delay_1=require("xstream/extra/delay");function isNotNull(x){return x!==null}function measure(domSource){return domSource.select(".calculator").elements().map(function(e){var actualElement=Array.isArray(e)?e[0]:e;if(!actualElement){return null}var matrixAElem=actualElement.querySelector(".matrixA *");var matrixBElem=actualElement.querySelector(".matrixB *");if(!matrixAElem||!matrixBElem){return null}var someRow=matrixAElem.querySelector(".row");if(!someRow){return null}var measurements={matrixAHeight:matrixAElem.clientHeight,matrixBWidth:matrixBElem.clientWidth,matrixBHeight:matrixBElem.clientHeight,rowHeight:someRow.clientHeight};return measurements}).filter(isNotNull).compose(dropRepeats_1.default(function(m1,m2){return m1.matrixAHeight===m2.matrixAHeight&&m1.matrixBHeight===m2.matrixBHeight&&m1.matrixBWidth===m2.matrixBWidth})).compose(delay_1.default(16))}exports.default=measure},{"xstream/extra/delay":103,"xstream/extra/dropRepeats":104}],8:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function calculateCellMatrixC(i,j,matrixA,matrixB){var m=matrixA.numberColumns;var acc=0;for(var k=0;k<m;k++){var a=matrixA.get(i,k);var b=matrixB.get(k,j);if(a==null){a=1}if(b==null){b=1}acc+=a*b}return acc}function calculateNextMatrixC(nextStep,matrixA,matrixB,matrixC){var newMatrixC=matrixC;matrixC.rows.forEach(function(row,i){row.forEach(function(cellC,j){if(i+j===nextStep-2){var val=calculateCellMatrixC(i,j,matrixA,matrixB);newMatrixC=newMatrixC.set(i,j,val)}})});return newMatrixC}exports.calculateNextMatrixC=calculateNextMatrixC},{}],9:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var MatrixValues_1=require("../../utils/MatrixValues");var measure_1=require("./reducers/measure");var resize_1=require("./reducers/resize");var controlPanel_1=require("./reducers/controlPanel");var timers_1=require("./reducers/timers");var defaultState={step:0,canInteract:true,fastForwardToEnd:false,measurements:{matrixAHeight:0,matrixBWidth:0,matrixBHeight:0,rowHeight:0},matrixA:{values:MatrixValues_1.default.from([[1,2,1],[0,1,0],[2,3,4]]),editable:true,id:"A"},matrixB:{values:MatrixValues_1.default.from([[2,5],[6,7],[1,8]]),editable:true,id:"B"},matrixC:void 0};var initReducer$=xstream_1.default.of(function initReducer(prevState){if(!prevState){return defaultState}else{return prevState}});function model(actions,measurements$){return xstream_1.default.merge(initReducer$,measure_1.updateMeasurementsReducer$(measurements$),resize_1.resizeReducer$(actions.resizeAction$),controlPanel_1.startMultiplyReducer$(actions.startMultiplyAction$),controlPanel_1.nextStepReducer$(actions.nextStepAction$),controlPanel_1.fastForwardToEndReducer$(actions.endAction$),controlPanel_1.resetReducer$(actions.resetAction$),timers_1.allowContinueReducer$(actions.allowContinueAction$))}exports.default=model},{"../../utils/MatrixValues":35,"./reducers/controlPanel":11,"./reducers/measure":12,"./reducers/resize":13,"./reducers/timers":14,xstream:107}],10:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function totalCombSteps(state){return state.matrixA.values.numberRows+state.matrixB.values.numberColumns-2}exports.totalCombSteps=totalCombSteps;function lastCombStep(state){return 2+totalCombSteps(state)}exports.lastCombStep=lastCombStep;function isInCombStep(state){return(state.step===1&&state.canInteract||state.step>1)&&state.step<=lastCombStep(state)}exports.isInCombStep=isInCombStep},{}],11:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var MatrixValues_1=require("../../../utils/MatrixValues");var calculate_1=require("../calculate");var queries_1=require("../queries");function startMultiplyReducer$(action$){return action$.map(function(){return function startMultiplyReducer(prevState){if(prevState.step===0){return __assign({},prevState,{step:1,canInteract:false,fastForwardToEnd:false,matrixA:__assign({},prevState.matrixA,{editable:false}),matrixB:__assign({},prevState.matrixB,{editable:false}),matrixC:{editable:false,values:MatrixValues_1.default.ofDimensions(prevState.matrixA.values.numberRows,prevState.matrixB.values.numberColumns).setAll(null),id:"C"}})}else{return prevState}}})}exports.startMultiplyReducer$=startMultiplyReducer$;function nextStepReducer$(action$){return action$.map(function(){return function nextStepReducer(prevState){if(prevState.step>=1&&prevState.canInteract&&prevState.matrixC){var nextStep=prevState.step+1;return __assign({},prevState,{step:nextStep,canInteract:false,matrixC:__assign({},prevState.matrixC,{values:calculate_1.calculateNextMatrixC(nextStep,prevState.matrixA.values,prevState.matrixB.values,prevState.matrixC.values)})})}else{return prevState}}})}exports.nextStepReducer$=nextStepReducer$;function fastForwardToEndReducer$(action$){return action$.map(function(){return function fastForwardToEndReducer(prevState){if(prevState.step>=1&&prevState.canInteract&&prevState.matrixC){var nextStep=prevState.step+1;return __assign({},prevState,{step:nextStep,canInteract:false,fastForwardToEnd:nextStep<=queries_1.lastCombStep(prevState),matrixC:__assign({},prevState.matrixC,{values:calculate_1.calculateNextMatrixC(nextStep,prevState.matrixA.values,prevState.matrixB.values,prevState.matrixC.values)})})}else{return prevState}}})}exports.fastForwardToEndReducer$=fastForwardToEndReducer$;function resetReducer$(action$){return action$.map(function(){return function resetReducer(prevState){return __assign({},prevState,{step:0,canInteract:true,fastForwardToEnd:false,matrixA:__assign({},prevState.matrixA,{editable:true}),matrixB:__assign({},prevState.matrixB,{editable:true}),matrixC:void 0})}})}exports.resetReducer$=resetReducer$},{"../../../utils/MatrixValues":35,"../calculate":8,"../queries":10}],12:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});function updateMeasurementsReducer$(measurements$){return measurements$.map(function(measurements){return function(prevState){return __assign({},prevState,{measurements:measurements})}})}exports.updateMeasurementsReducer$=updateMeasurementsReducer$},{}],13:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});function resizeReducer$(action$){return action$.map(function(action){return function resizeReducer(prevState){var targetMatrix="matrix"+action.target;var nextState={step:prevState.step,canInteract:prevState.canInteract,fastForwardToEnd:prevState.fastForwardToEnd,measurements:prevState.measurements,matrixA:prevState.matrixA,matrixB:prevState.matrixB,matrixC:prevState.matrixC};var prevValues=prevState[targetMatrix].values;if(action.resizeParam.direction==="row"){nextState[targetMatrix]=__assign({},prevState[targetMatrix],{values:prevValues.resize(prevValues.numberRows+action.resizeParam.amount,prevValues.numberColumns)})}else{nextState[targetMatrix]=__assign({},prevState[targetMatrix],{values:prevValues.resize(prevValues.numberRows,prevValues.numberColumns+action.resizeParam.amount)})}return nextState}})}exports.resizeReducer$=resizeReducer$},{}],14:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var queries_1=require("../queries");var calculate_1=require("../calculate");function allowContinueReducer$(action$){return action$.map(function(){return function allowContinueReducer(prevState){if(prevState.fastForwardToEnd&&prevState.matrixC){var nextStep=prevState.step+1;return __assign({},prevState,{step:nextStep,canInteract:false,fastForwardToEnd:nextStep<=queries_1.lastCombStep(prevState),matrixC:__assign({},prevState.matrixC,{values:calculate_1.calculateNextMatrixC(nextStep,prevState.matrixA.values,prevState.matrixB.values,prevState.matrixC.values)})})}else{return __assign({},prevState,{canInteract:true,fastForwardToEnd:false})}}})}exports.allowContinueReducer$=allowContinueReducer$},{"../calculate":8,"../queries":10}],15:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var typestyle_1=require("typestyle");var styles_1=require("../Matrix/styles");var styles_2=require("../styles");var Styles;(function(Styles){Styles.matrixBracketWidth=styles_1.default.matrixBracketWidth;Styles.step1Duration1=600;Styles.step1Duration2=900;Styles.nextCombDuration=500;Styles.nextCombCellTransitionDelay=Styles.nextCombDuration*.5;Styles.colorPallete=styles_2.pallete;Styles.cellScaleWhenIntersecting=.55;Styles.cellTranslateXWhenIntersecting=16;Styles.cellTranslateYWhenIntersecting=10;Styles.finalResultDuration=1100;Styles.finalFadeDuration=Styles.finalResultDuration*.8;Styles.calculator=typestyle_1.style({marginTop:"200px",marginBottom:"100px"});Styles.matrices=typestyle_1.style({display:"flex",alignItems:"center",justifyContent:"center"});Styles.matrixWrapperTable=typestyle_1.style({borderSpacing:0});Styles.matrixA=typestyle_1.style({position:"relative"});Styles.matrixB=typestyle_1.style({transition:"opacity "+Styles.finalFadeDuration+"ms"});Styles.matrixC=typestyle_1.style({position:"relative",transitionDuration:"700ms",transitionProperty:"opacity, margin-left",transitionDelay:"300ms"});Styles.matrixCHidden=typestyle_1.style({position:"relative",transitionDuration:"0ms",transitionProperty:"opacity, margin-left",transitionDelay:"0ms"});Styles.resultEqualsSign=typestyle_1.style({fontSize:"24px",color:styles_2.pallete.grayDark,transitionDuration:"700ms",transitionProperty:"opacity, width, margin",transitionDelay:"700ms, 300ms, 300ms"});Styles.animatedCell=typestyle_1.style({transitionProperty:"opacity, color, transform",transitionDuration:"400ms",transitionDelay:Styles.nextCombCellTransitionDelay+"ms"});Styles.operatorGrid=typestyle_1.style({position:"absolute",top:"3px",left:"3px"});Styles.operatorCell=typestyle_1.style({transform:"scale(0.6)",transition:"opacity 300ms ease "+Styles.nextCombCellTransitionDelay+"ms"});Styles.plusSign=typestyle_1.style({$nest:{"&::after":{content:'"+"',display:"block",position:"absolute",top:0,left:"40px",fontSize:"24px",width:"2em",height:"2em",fontFamily:"'Source Sans Pro', sans-serif",lineHeight:"49px",textAlign:"center",border:"none",textIndent:"0",padding:"0",color:styles_2.pallete.black}}});Styles.controlPanel=typestyle_1.style({display:"flex",alignItems:"center",justifyContent:"center",position:"relative",paddingTop:"86px",paddingBottom:"40px",backgroundImage:"linear-gradient(to bottom,\n rgba(255,255,255,0) 0,\n rgba(255,255,255,0.8) 92px,\n rgba(255,255,255,0.8) 126px,\n rgba(255,255,255,0) 100%)\n ",zIndex:2,$nest:{"& > * + *":{marginLeft:"8px"}}});var commonButton={color:styles_2.pallete.white,border:"none",fontSize:"24px",padding:"8px 16px",$nest:{"& > svg":{marginBottom:"-2px",marginRight:"8px"}}};var commonButtonEnabled={boxShadow:"0 1px 1px 0 "+styles_2.pallete.gray,cursor:"pointer"};var commonButtonDisabled=typestyle_1.style(commonButton,{backgroundColor:styles_2.pallete.gray});Styles.multiplyButton=typestyle_1.style(commonButton,commonButtonEnabled,{backgroundColor:styles_2.pallete.blue,$nest:{"&:hover":{backgroundColor:styles_2.pallete.blueWeak}}});Styles.multiplyButtonDisabled=commonButtonDisabled;Styles.nextButton=Styles.multiplyButton;Styles.nextButtonDisabled=commonButtonDisabled;Styles.endButton=typestyle_1.style(commonButton,commonButtonEnabled,{backgroundColor:styles_2.pallete.orange,$nest:{"&:hover":{backgroundColor:styles_2.pallete.orangeWeak}}});Styles.endButtonDisabled=commonButtonDisabled;Styles.resetButton=Styles.multiplyButton;Styles.multiplyOrEqualsSign=typestyle_1.style({margin:"1em",fontSize:"24px",color:styles_2.pallete.grayDark});Styles.rowsResizer=typestyle_1.style({display:"flex",flexDirection:"column",justifyContent:"center",margin:"0 10px",zIndex:3});Styles.colsResizerContainer=typestyle_1.style({position:"relative"});Styles.colsResizer=typestyle_1.style({position:"absolute",minWidth:"76px",left:"-20px",right:"-20px",display:"flex",flexDirection:"row",justifyContent:"center",margin:"10px 0",zIndex:3});Styles.resizerButton=typestyle_1.style({backgroundColor:"rgba(0, 0, 0, 0)",boxShadow:"0 1px 1px 0 "+styles_2.pallete.gray,color:styles_2.pallete.grayDark,border:"none",fontSize:"20px",textAlign:"center",width:"30px",height:"30px",lineHeight:"30px",margin:"4px",cursor:"pointer",$nest:{"&:hover":{backgroundColor:styles_2.pallete.grayLight}}})})(Styles||(Styles={}));exports.default=Styles},{"../Matrix/styles":27,"../styles":34,typestyle:97}],16:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var delay_1=require("xstream/extra/delay");var dropRepeats_1=require("xstream/extra/dropRepeats");var queries_1=require("./model/queries");var styles_1=require("./styles");function timers(state$){var stateChange$=state$.compose(dropRepeats_1.default(function(s1,s2){return s1.step===s2.step&&s1.canInteract===s2.canInteract}));var allowContinueFromStartMultiply$=stateChange$.filter(function(state){return state.step===1&&!state.canInteract}).compose(delay_1.default(styles_1.default.step1Duration1+styles_1.default.step1Duration2)).mapTo(null);var allowContinueFromNextComb$=stateChange$.filter(function(state){return queries_1.isInCombStep(state)&&!state.canInteract}).compose(delay_1.default(styles_1.default.nextCombDuration)).mapTo(null);var allowContinueFromEnd$=stateChange$.filter(function(state){return state.step===queries_1.lastCombStep(state)+1&&!state.canInteract}).compose(delay_1.default(styles_1.default.finalResultDuration)).mapTo(null);return xstream_1.default.merge(allowContinueFromStartMultiply$,allowContinueFromNextComb$,allowContinueFromEnd$)}exports.default=timers},{"./model/queries":10,"./styles":15,xstream:107,"xstream/extra/delay":103,"xstream/extra/dropRepeats":104}],17:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var styles_1=require("../styles");exports.multiplySign="";exports.zeroWidthSpace="";function renderRowsResizer(id){return dom_1.div(".rowsResizer."+styles_1.default.rowsResizer,[dom_1.div(".decreaseRow"+id+"."+styles_1.default.resizerButton,"-"),dom_1.div(".increaseRow"+id+"."+styles_1.default.resizerButton,"+")])}exports.renderRowsResizer=renderRowsResizer;function renderColsResizer(id){return dom_1.div(".colsResizer."+styles_1.default.colsResizer,[dom_1.div(".decreaseCol"+id+"."+styles_1.default.resizerButton,"-"),dom_1.div(".increaseCol"+id+"."+styles_1.default.resizerButton,"+")])}exports.renderColsResizer=renderColsResizer},{"../styles":15,"@cycle/dom":49}],18:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var queries_1=require("../model/queries");var styles_1=require("../styles");var play_1=require("../../icons/play");var next_1=require("../../icons/next");var end_1=require("../../icons/end");var reset_1=require("../../icons/reset");function getArrayOfButtons(state){var step=state.step;var buttons=[];if(step===0){buttons=[dom_1.div(".multiply."+styles_1.default.multiplyButton,[play_1.default,"Multiply"])]}else if(step===1&&!state.canInteract){buttons=[dom_1.div(".multiply."+styles_1.default.multiplyButtonDisabled,[play_1.default,"Multiply"])]}else if(step>=1&&step<=queries_1.lastCombStep(state)&&state.canInteract){buttons=[dom_1.div(".next."+styles_1.default.nextButton,[next_1.default,"Next"]),dom_1.div(".end."+styles_1.default.endButton,[end_1.default,"End"])]}else if(step>=1&&step<=queries_1.lastCombStep(state)+1&&!state.canInteract){buttons=[dom_1.div(".next."+styles_1.default.nextButtonDisabled,[next_1.default,"Next"]),dom_1.div(".end."+styles_1.default.endButtonDisabled,[end_1.default,"End"])]}else if(step===queries_1.lastCombStep(state)+1&&state.canInteract){buttons=[dom_1.div(".reset."+styles_1.default.resetButton,[reset_1.default,"Reset"])]}return buttons}function renderControlPanel(state){return dom_1.div(".controlPanel."+styles_1.default.controlPanel,getArrayOfButtons(state))}exports.renderControlPanel=renderControlPanel},{"../../icons/end":29,"../../icons/next":30,"../../icons/play":31,"../../icons/reset":32,"../model/queries":10,"../styles":15,"@cycle/dom":49}],19:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var dom_1=require("@cycle/dom");var queries_1=require("../model/queries");var styles_1=require("../styles");var matrixA_1=require("./matrixA");var matrixB_1=require("./matrixB");var matrixC_1=require("./matrixC");var controlPanel_1=require("./controlPanel");var common_1=require("./common");var tweens_1=require("./tweens");function renderSign(state){if(queries_1.isInCombStep(state)){return dom_1.span(".multiplySign."+styles_1.default.multiplyOrEqualsSign,"=")}else{return dom_1.span(".tempEqualsSign."+styles_1.default.multiplyOrEqualsSign,common_1.multiplySign)}}function maybeRenderEqualsSign(state){var style={};if(state.step===queries_1.lastCombStep(state)+1){style={margin:"1em",width:"12px",opacity:"1"}}else if(state.step===0){return null}else{style={margin:"0",width:"0",opacity:"0.01"}}return dom_1.span(".resultEqualsSign."+styles_1.default.resultEqualsSign,{style:style},"=")}function view(state$,vdomA$,vdomB$,vdomC$){var transform$=tweens_1.makeTransform$(state$);return xstream_1.default.combine(state$,transform$,vdomA$,vdomB$,vdomC$.startWith(null)).map(function(_a){var state=_a[0],transform=_a[1],matrixA=_a[2],matrixB=_a[3],matrixC=_a[4];return dom_1.div(".calculator."+styles_1.default.calculator,[dom_1.div(".matrices."+styles_1.default.matrices,[matrixA_1.renderMatrixA(matrixA,state),renderSign(state),matrixB_1.renderMatrixB(matrixB,state,transform),maybeRenderEqualsSign(state),matrixC_1.maybeRenderMatrixC(matrixC,state)]),controlPanel_1.renderControlPanel(state)])})}exports.default=view},{"../model/queries":10,"../styles":15,"./common":17,"./controlPanel":18,"./matrixA":20,"./matrixB":21,"./matrixC":22,"./tweens":23,"@cycle/dom":49,xstream:107}],20:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var queries_1=require("../model/queries");var styles_1=require("../../Matrix/styles");var styles_2=require("../styles");var common_1=require("./common");function renderOperatorGrid(state){if(state.step===0){return null}var lastIntersectRow=state.step-2;var firstIntersectRow=state.step-2-state.matrixB.values.numberColumns;var rows=state.matrixA.values.rows;return dom_1.div(".operatorGrid."+styles_2.default.operatorGrid,rows.map(function(row,i){var shouldShowMultiply=firstIntersectRow<i&&i<=lastIntersectRow;return dom_1.div("."+styles_1.default.row,row.map(function(cellVal,j){var shouldShowPlus=j<state.matrixA.values.numberColumns-1;return dom_1.div([dom_1.span(".operator",{class:(_a={},_a[styles_1.default.cell]=true,_a[styles_2.default.operatorCell]=true,_a[styles_2.default.plusSign]=shouldShowPlus,_a),style:{opacity:shouldShowMultiply?1:.01}},[common_1.multiplySign])]);var _a}))}))}function mutateCellStyles(state){var lastIntersectRow=state.step-2;var firstIntersectRow=state.step-2-state.matrixB.values.numberColumns;return function updateHook(prev,next){var all=next.elm.querySelectorAll(".cell");var _loop_1=function(i,N){var cellElem=all.item(i);var rowOfCell=parseInt(cellElem.dataset.row);if(queries_1.isInCombStep(state)){cellElem.classList.add(styles_2.default.animatedCell)}else if(state.step>queries_1.lastCombStep(state)){setTimeout(function(){return cellElem.classList.remove(styles_2.default.animatedCell)},styles_2.default.nextCombDuration)}if(firstIntersectRow<rowOfCell&&rowOfCell<=lastIntersectRow){cellElem.style.transform="\n scale("+styles_2.default.cellScaleWhenIntersecting+")\n translateX("+-styles_2.default.cellTranslateXWhenIntersecting+"px)\n translateY("+styles_2.default.cellTranslateYWhenIntersecting+"px)\n ";cellElem.style.color=styles_2.default.colorPallete.blue}else{cellElem.style.transform=null;cellElem.style.color=null}};for(var i=0,N=all.length;i<N;i++){_loop_1(i,N)}}}function renderMatrixA(matrixA,state){var showResizers=state.step===0;return dom_1.table(".matrixAWrapper."+styles_2.default.matrixWrapperTable,[dom_1.tr([dom_1.td(showResizers?[common_1.renderRowsResizer("A")]:[]),dom_1.td(".matrixA."+styles_2.default.matrixA,{hook:{update:mutateCellStyles(state)}},[matrixA,renderOperatorGrid(state)])]),dom_1.tr([dom_1.td(),dom_1.td(".colsResizerContainer."+styles_2.default.colsResizerContainer,showResizers?[common_1.renderColsResizer("A")]:[])])])}exports.renderMatrixA=renderMatrixA},{"../../Matrix/styles":27,"../model/queries":10,"../styles":15,"./common":17,"@cycle/dom":49}],21:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var queries_1=require("../model/queries");var styles_1=require("../styles");var common_1=require("./common");function getOpacity(state){if(state.step===queries_1.lastCombStep(state)+1&&!state.canInteract){return"0.01"}else if(state.step===queries_1.lastCombStep(state)+1&&state.canInteract){return"1"}else{return"1"}}function mutateCellStyles(state,transform){var lastIntersectCol=state.step-2;var firstIntersectCol=state.step-2-state.matrixA.values.numberRows;var rotateZTransform=transform.split(" ").filter(function(t){return t.match(/^rotateZ/)!==null}).pop().replace("-","+").trim();return function updateHook(prev,next){var all=next.elm.querySelectorAll(".cell");for(var i=0,N=all.length;i<N;i++){var cellElem=all.item(i);var colOfCell=parseInt(cellElem.dataset.col);if(rotateZTransform==="rotateZ(+90deg)"){cellElem.classList.add(styles_1.default.animatedCell)}else{cellElem.classList.remove(styles_1.default.animatedCell)}if(firstIntersectCol<colOfCell&&colOfCell<=lastIntersectCol){cellElem.style.transform="\n "+rotateZTransform+"\n scale("+styles_1.default.cellScaleWhenIntersecting+")\n translateX("+styles_1.default.cellTranslateXWhenIntersecting+"px)\n translateY("+-styles_1.default.cellTranslateYWhenIntersecting+"px)\n ";cellElem.style.color=styles_1.default.colorPallete.blue}else{cellElem.style.transform=rotateZTransform;cellElem.style.color=null}}}}function renderMatrixB(matrixB,state,transform){var showResizers=state.step===0;var opacity=getOpacity(state);return dom_1.table(".matrixBWrapper."+styles_1.default.matrixWrapperTable,[dom_1.tr([dom_1.td(".matrixB."+styles_1.default.matrixB,{style:{opacity:opacity,transform:transform,transformOrigin:"bottom left"},hook:{update:mutateCellStyles(state,transform)}},[matrixB]),dom_1.td(showResizers?[common_1.renderRowsResizer("B")]:[])]),dom_1.tr([dom_1.td(".colsResizerContainer."+styles_1.default.colsResizerContainer,showResizers?[common_1.renderColsResizer("B")]:[]),dom_1.td()])])}exports.renderMatrixB=renderMatrixB},{"../model/queries":10,"../styles":15,"./common":17,"@cycle/dom":49}],22:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var queries_1=require("../model/queries");var styles_1=require("../styles");function mutateCellStyles(state){return function updateHook(prev,next){var all=next.elm.querySelectorAll(".cell");for(var i=0,N=all.length;i<N;i++){var cellElem=all.item(i);var rowOfCell=parseInt(cellElem.dataset.row);var colOfCell=parseInt(cellElem.dataset.col);if(queries_1.isInCombStep(state)){cellElem.classList.add(styles_1.default.animatedCell)}else{cellElem.classList.remove(styles_1.default.animatedCell)}if(rowOfCell+colOfCell>state.step-2){cellElem.style.color=null;cellElem.style.opacity="0.01"}else if(rowOfCell+colOfCell===state.step-2){cellElem.style.color=styles_1.default.colorPallete.blue;cellElem.style.opacity="1"}else{cellElem.style.color=null;cellElem.style.opacity="1"}}}}function maybeRenderMatrixC(matrixC,state){var step=state.step;if(matrixC===null||step===0||step===1&&!state.canInteract){return dom_1.div(".matrixC",{class:(_a={},_a[styles_1.default.matrixCHidden]=true,_a),style:{opacity:"0.01",marginLeft:"0"}})}else{matrixC.data=matrixC.data||{};matrixC.data.style=matrixC.data.style||{};matrixC.data.style.position="absolute"
;var xDist=state.measurements.matrixBWidth+8;var yDist=state.measurements.matrixAHeight*.5;return dom_1.div(".matrixC",{class:(_b={},_b[styles_1.default.matrixC]=true,_b),style:{transform:"translateX(-"+xDist+"px) translateY(-"+yDist+"px)",opacity:"1",marginLeft:step===queries_1.lastCombStep(state)+1?xDist+"px":"0"},hook:{update:mutateCellStyles(state)}},[matrixC])}var _a,_b}exports.maybeRenderMatrixC=maybeRenderMatrixC},{"../model/queries":10,"../styles":15,"@cycle/dom":49}],23:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var concat_1=require("xstream/extra/concat");var delay_1=require("xstream/extra/delay");var tween_1=require("xstream/extra/tween");var dropRepeats_1=require("xstream/extra/dropRepeats");var queries_1=require("../model/queries");var styles_1=require("../styles");var xMove=59.5;var padding=8;function makeStartMultiplyTransform$(state$){return state$.filter(function(state){return state.step===1}).map(function(state){var ease=tween_1.default.power2.easeInOut;var yLift=padding+state.measurements.matrixAHeight*.5+state.measurements.matrixBHeight*.5;return concat_1.default(tween_1.default({from:0,to:yLift,duration:styles_1.default.step1Duration1,ease:ease}).map(function(y){return"\n translateX(0%)\n translateY("+-y+"px)\n rotateZ(0deg)\n "}),tween_1.default({from:0,to:1,duration:styles_1.default.step1Duration2,ease:ease}).map(function(t){return"\n translateX("+-t*xMove+"px)\n translateY("+-yLift+"px)\n rotateZ("+-Math.pow(t,2.3)*90+"deg)\n "}))}).flatten()}function makeNextStepTransform$(state$){return state$.filter(function(state){return state.step>1&&state.step<=queries_1.lastCombStep(state)}).map(function(state){var ease=tween_1.default.power2.easeInOut;var duration=styles_1.default.nextCombDuration;var yLift=padding+state.measurements.matrixAHeight*.5+state.measurements.matrixBHeight*.5;var yPrev=state.step===2?yLift:yLift-padding-styles_1.default.matrixBracketWidth*2-state.measurements.rowHeight*(state.step-2);var yNext=yLift-padding-styles_1.default.matrixBracketWidth*2-state.measurements.rowHeight*(state.step-1);return tween_1.default({from:yPrev,to:yNext,duration:duration,ease:ease}).map(function(y){return"\n translateX("+-xMove+"px)\n translateY("+-y+"px)\n rotateZ(-90deg)\n "})}).flatten()}function makeEndTransform$(state$){return state$.filter(function(state){return state.step===queries_1.lastCombStep(state)+1}).map(function(state){var ease=tween_1.default.power2.easeInOut;var duration=styles_1.default.finalFadeDuration;var timeToReset=styles_1.default.finalResultDuration-duration;var yLift=padding+state.measurements.matrixAHeight*.5+state.measurements.matrixBHeight*.5;var yLastComb=yLift-padding-styles_1.default.matrixBracketWidth*2-state.measurements.rowHeight*(state.step-2);var yOutside=yLastComb-state.measurements.rowHeight-padding*4;return concat_1.default(tween_1.default({from:yLastComb,to:yOutside,duration:duration,ease:ease}).map(function(y){return"\n translateX("+-xMove+"px)\n translateY("+-y+"px)\n rotateZ(-90deg)\n "}),xstream_1.default.of("translateX(0px) translateY(0px) rotateZ(0deg)").compose(delay_1.default(timeToReset*.9)))}).flatten()}function makeTransform$(state$){var stateOnStepChange$=state$.compose(dropRepeats_1.default(function(s1,s2){return s1.step===s2.step}));return xstream_1.default.merge(makeStartMultiplyTransform$(stateOnStepChange$),makeNextStepTransform$(stateOnStepChange$),makeEndTransform$(stateOnStepChange$)).startWith("translateX(0%) translateY(0px) rotateZ(0deg)")}exports.makeTransform$=makeTransform$},{"../model/queries":10,"../styles":15,xstream:107,"xstream/extra/concat":102,"xstream/extra/delay":103,"xstream/extra/dropRepeats":104,"xstream/extra/tween":106}],24:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var intent_1=require("./intent");var model_1=require("./model");var view_1=require("./view");function Matrix(sources){var action$=intent_1.default(sources.DOM);var reducer$=model_1.default(action$);var vdom$=view_1.default(sources.onion.state$);var sinks={DOM:vdom$,onion:reducer$};return sinks}exports.default=Matrix},{"./intent":25,"./model":26,"./view":28}],25:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function intent(domSource){return domSource.select(".cell").events("input").map(function(ev){var inputEl=ev.target;return{row:parseInt(inputEl.attributes["data-row"].value),col:parseInt(inputEl.attributes["data-col"].value),val:parseFloat(inputEl.value)}}).filter(function(action){return!isNaN(action.val)})}exports.default=intent},{}],26:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var MatrixValues_1=require("../utils/MatrixValues");var defaultState={values:MatrixValues_1.default.ofDimensions(1,1),editable:true,id:"matrix"+Math.round(Math.random()*1e3)};function model(action$){var initReducer$=xstream_1.default.of(function initReducer(prevState){if(!prevState){return defaultState}else{return prevState}});var inputReducer$=action$.map(function(action){return function inputReducer(prevState){return __assign({},prevState,{values:prevState.values.set(action.row,action.col,action.val)})}});return xstream_1.default.merge(initReducer$,inputReducer$)}exports.default=model},{"../utils/MatrixValues":35,xstream:107}],27:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var typestyle_1=require("typestyle");var styles_1=require("../styles");var Styles;(function(Styles){Styles.matrixBracketWidth=2;Styles.matrixBracketWidthPx=Styles.matrixBracketWidth+"px";Styles.matrixBracketIngress="9px";Styles.matrixBracketColor=styles_1.pallete.black;Styles.matrix=typestyle_1.style({position:"relative",padding:Styles.matrixBracketWidth});Styles.leftBracket=typestyle_1.style({position:"absolute",left:0,bottom:0,top:0,width:Styles.matrixBracketWidth,backgroundColor:Styles.matrixBracketColor,$nest:{"&::before":{content:"''",backgroundColor:Styles.matrixBracketColor,position:"absolute",top:0,left:0,height:Styles.matrixBracketWidth,width:Styles.matrixBracketIngress},"&::after":{content:"''",backgroundColor:Styles.matrixBracketColor,position:"absolute",bottom:0,left:0,height:Styles.matrixBracketWidth,width:Styles.matrixBracketIngress}}});Styles.rightBracket=typestyle_1.style({position:"absolute",right:0,bottom:0,top:0,width:Styles.matrixBracketWidth,backgroundColor:Styles.matrixBracketColor,$nest:{"&::before":{content:"''",backgroundColor:Styles.matrixBracketColor,position:"absolute",top:0,right:0,height:Styles.matrixBracketWidth,width:Styles.matrixBracketIngress},"&::after":{content:"''",backgroundColor:Styles.matrixBracketColor,position:"absolute",bottom:0,right:0,height:Styles.matrixBracketWidth,width:Styles.matrixBracketIngress}}});var insetBoxShadow={"box-shadow":"inset 0px 1px 2px 0px rgba(0,0,0,0.5)"};Styles.row=typestyle_1.style({padding:0,margin:0,display:"flex",flexDirection:"row",justifyContent:"space-between"});Styles.cell=typestyle_1.style({display:"block",width:"48px",height:"48px",fontFamily:"'Source Sans Pro', sans-serif",lineHeight:"49px",textAlign:"center",border:"none",textIndent:"0",padding:"0",color:styles_1.pallete.black,backgroundColor:"rgba(255,255,255,0)",$nest:{"input&":{$nest:{"&:hover":insetBoxShadow,"&:focus":insetBoxShadow}}}});Styles.cellFontSize2=24;Styles.cellFontSize3=20;Styles.cellFontSize4=17;Styles.cellFontSize5=15;Styles.cellFontSize6=13;Styles.cellFontSize7=11;Styles.cell2=typestyle_1.style({fontSize:Styles.cellFontSize2+"px"});Styles.cell3=typestyle_1.style({fontSize:Styles.cellFontSize3+"px"});Styles.cell4=typestyle_1.style({fontSize:Styles.cellFontSize4+"px"});Styles.cell5=typestyle_1.style({fontSize:Styles.cellFontSize5+"px"});Styles.cell6=typestyle_1.style({fontSize:Styles.cellFontSize6+"px"});Styles.cell7=typestyle_1.style({fontSize:Styles.cellFontSize7+"px"})})(Styles||(Styles={}));exports.default=Styles},{"../styles":34,typestyle:97}],28:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var styles_1=require("./styles");var zeroWidthSpace="";function renderLeftBracket(state){return dom_1.div(".leftBracket."+styles_1.default.leftBracket,{key:"leftBracket"+state.id})}function renderRightBracket(state){return dom_1.div(".rightBracket."+styles_1.default.rightBracket,{key:"rightBracket"+state.id})}function isNumberHuge(num){return Number(num).toFixed(0).length>5}function isDecimalIrrelevant(decimals){return Math.abs(decimals)<1e-7}function isDecimalOneDigit(decimals){return Number(decimals).toFixed(2)===Number(decimals).toFixed(1)+"0"}function isNumberLengthy(num){return Number(Math.abs(num)).toFixed(0).length>3&&Number(num).toFixed(2).length>7}function formatNumber(num){var decimalPart=num<0?num-Math.ceil(num):num-Math.floor(num);if(isNumberHuge(num))return Number(num).toPrecision(3);if(isDecimalIrrelevant(decimalPart))return Number(num).toFixed(0);if(isDecimalOneDigit(decimalPart))return Number(num).toFixed(1);if(isNumberLengthy(num))return Number(num).toFixed(0);return Number(num).toFixed(2)}function fontSizeFor(num){if(num===null)return styles_1.default.cellFontSize2;var str=formatNumber(num);var len=str.length;var hasDot=str.indexOf(".")>-1;var hasMinus=str.indexOf("-")>-1;if(/^\d\.\d\de\+\d$/.test(str))return styles_1.default.cellFontSize6;if(hasDot||hasMinus){if(len<=3)return styles_1.default.cellFontSize2;if(len===4)return styles_1.default.cellFontSize3;if(len===5)return styles_1.default.cellFontSize4;if(len===6)return styles_1.default.cellFontSize5;if(len===7)return styles_1.default.cellFontSize6;if(len>=8)return styles_1.default.cellFontSize7}else{if(len<=2)return styles_1.default.cellFontSize2;if(len===3)return styles_1.default.cellFontSize3;if(len===4)return styles_1.default.cellFontSize4;if(len===5)return styles_1.default.cellFontSize5;if(len===6)return styles_1.default.cellFontSize6;if(len>=7)return styles_1.default.cellFontSize7}}function fontSizeStyleFor(num){if(fontSizeFor(num)===styles_1.default.cellFontSize2)return styles_1.default.cell2;if(fontSizeFor(num)===styles_1.default.cellFontSize3)return styles_1.default.cell3;if(fontSizeFor(num)===styles_1.default.cellFontSize4)return styles_1.default.cell4;if(fontSizeFor(num)===styles_1.default.cellFontSize5)return styles_1.default.cell5;if(fontSizeFor(num)===styles_1.default.cellFontSize6)return styles_1.default.cell6;if(fontSizeFor(num)===styles_1.default.cellFontSize7)return styles_1.default.cell7;else return styles_1.default.cell2}function updateFontSizeHook(prev,next){var vnode=next?next:prev;if(isNaN(vnode.data.attrs.value))return;if(!vnode.elm)return;var cellValue=0+vnode.data.attrs.value;vnode.elm.style.fontSize=fontSizeFor(cellValue)+"px"}function renderCellAsInput(cellValue,i,j){return dom_1.input(".cell."+styles_1.default.cell,{key:"cell"+i+"-"+j,hook:{insert:updateFontSizeHook,update:updateFontSizeHook},attrs:{type:"text","data-row":i,"data-col":j,value:typeof cellValue==="number"?cellValue:void 0}})}function renderCellAsSpan(cellValue,i,j){return dom_1.span(".cell."+styles_1.default.cell+"."+fontSizeStyleFor(cellValue),{attrs:{"data-row":i,"data-col":j}},typeof cellValue==="number"?[formatNumber(cellValue)]:[zeroWidthSpace])}function renderAllCells(state){return state.values.rows.map(function(row,i){return dom_1.div(".row."+styles_1.default.row,{key:"row"+i},row.map(function(cellValue,j){return dom_1.div(".col",{key:"col"+j},[state.editable?renderCellAsInput(cellValue,i,j):renderCellAsSpan(cellValue,i,j)])}))})}function view(state$){return state$.map(function(state){return dom_1.div(".matrix."+styles_1.default.matrix,{key:state.id},[renderLeftBracket(state)].concat(renderAllCells(state),[renderRightBracket(state)]))})}exports.default=view},{"./styles":27,"@cycle/dom":49}],29:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var endIcon=dom_1.svg({attrs:{width:"20px",height:"20px",viewBox:"0 0 511.63 511.63",space:"preserve"}},[dom_1.svg.g([dom_1.svg.path({attrs:{d:"M506.203,41.968c-3.617-3.617-7.902-5.426-12.851-5.426H456.81c-4.948,0-9.232,1.809-12.847,5.426 c-3.62,3.619-5.427,7.902-5.427,12.851v193.572c-0.955-2.091-2.19-3.899-3.717-5.424L232.11,40.257 c-3.616-3.615-6.658-4.853-9.136-3.709c-2.474,1.141-3.711,4.187-3.711,9.135v202.708c-0.95-2.091-2.187-3.899-3.709-5.424 L12.847,40.257c-3.617-3.615-6.661-4.853-9.135-3.709C1.237,37.689,0,40.735,0,45.683v420.262c0,4.948,1.241,7.998,3.715,9.141 c2.474,1.14,5.518-0.099,9.135-3.72l202.707-202.708c1.52-1.708,2.76-3.519,3.709-5.421v202.708c0,4.948,1.237,7.994,3.711,9.134 s5.52-0.1,9.136-3.717l202.709-202.708c1.523-1.711,2.762-3.524,3.714-5.428v193.571c0,4.948,1.81,9.229,5.427,12.847 c3.614,3.617,7.898,5.425,12.847,5.425h36.546c4.944,0,9.232-1.808,12.85-5.425c3.614-3.617,5.425-7.898,5.425-12.847V54.819 C511.626,49.863,509.82,45.584,506.203,41.968z",fill:"#FFFFFF"}})])]);exports.default=endIcon},{"@cycle/dom":49}],30:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var nextIcon=dom_1.svg({attrs:{width:"20px",height:"20px",viewBox:"0 0 440.25 440.25",space:"preserve"}},[dom_1.svg.g([dom_1.svg.path({attrs:{d:"M434.823,207.279L232.111,4.571c-3.609-3.617-6.655-4.856-9.133-3.713c-2.475,1.143-3.712,4.189-3.712,9.137v202.708 c-0.949-2.091-2.187-3.901-3.711-5.424L12.847,4.571C9.229,0.954,6.186-0.285,3.711,0.858C1.237,2.001,0,5.047,0,9.995v420.262 c0,4.948,1.237,7.994,3.711,9.138c2.474,1.14,5.518-0.1,9.135-3.721l202.708-202.701c1.521-1.711,2.762-3.524,3.711-5.428v202.712 c0,4.948,1.237,7.991,3.712,9.131c2.478,1.143,5.523-0.093,9.133-3.714l202.712-202.708c3.61-3.617,5.428-7.901,5.428-12.847 C440.248,215.178,438.433,210.896,434.823,207.279z",fill:"#FFFFFF"}})])]);exports.default=nextIcon},{"@cycle/dom":49}],31:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var playIcon=dom_1.svg({attrs:{width:"20px",height:"20px",viewBox:"0 0 41.999 41.999",space:"preserve"}},[dom_1.svg.g([dom_1.svg.path({attrs:{d:"M36.068,20.176l-29-20C6.761-0.035,6.363-0.057,6.035,0.114C5.706,0.287,5.5,0.627,5.5,0.999v40 c0,0.372,0.206,0.713,0.535,0.886c0.146,0.076,0.306,0.114,0.465,0.114c0.199,0,0.397-0.06,0.568-0.177l29-20 c0.271-0.187,0.432-0.494,0.432-0.823S36.338,20.363,36.068,20.176z",fill:"#FFFFFF"}})])]);exports.default=playIcon},{"@cycle/dom":49}],32:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var dom_1=require("@cycle/dom");var resetIcon=dom_1.svg({attrs:{width:"20px",height:"20px",viewBox:"0 0 438.536 438.536",space:"preserve"}},[dom_1.svg.g([dom_1.svg.path({attrs:{d:"M421.125,134.191c-11.608-27.03-27.217-50.347-46.819-69.949C354.7,44.639,331.384,29.033,304.353,17.42 C277.325,5.807,248.969,0.005,219.275,0.005c-27.978,0-55.052,5.277-81.227,15.843C111.879,26.412,88.61,41.305,68.243,60.531 l-37.12-36.835c-5.711-5.901-12.275-7.232-19.701-3.999C3.807,22.937,0,28.554,0,36.547v127.907c0,4.948,1.809,9.231,5.426,12.847 c3.619,3.617,7.902,5.426,12.85,5.426h127.907c7.996,0,13.61-3.807,16.846-11.421c3.234-7.423,1.903-13.988-3.999-19.701 l-39.115-39.398c13.328-12.563,28.553-22.222,45.683-28.98c17.131-6.757,35.021-10.138,53.675-10.138 c19.793,0,38.687,3.858,56.674,11.563c17.99,7.71,33.544,18.131,46.679,31.265c13.134,13.131,23.555,28.69,31.265,46.679 c7.703,17.987,11.56,36.875,11.56,56.674c0,19.798-3.856,38.686-11.56,56.672c-7.71,17.987-18.131,33.544-31.265,46.679 c-13.135,13.134-28.695,23.558-46.679,31.265c-17.987,7.707-36.881,11.561-56.674,11.561c-22.651,0-44.064-4.949-64.241-14.843 c-20.174-9.894-37.209-23.883-51.104-41.973c-1.331-1.902-3.521-3.046-6.567-3.429c-2.856,0-5.236,0.855-7.139,2.566 l-39.114,39.402c-1.521,1.53-2.33,3.478-2.426,5.853c-0.094,2.385,0.527,4.524,1.858,6.427 c20.749,25.125,45.871,44.587,75.373,58.382c29.502,13.798,60.625,20.701,93.362,20.701c29.694,0,58.05-5.808,85.078-17.416 c27.031-11.607,50.34-27.22,69.949-46.821c19.605-19.609,35.211-42.921,46.822-69.949s17.411-55.392,17.411-85.08 C438.536,189.569,432.732,161.22,421.125,134.191z",fill:"#FFFFFF"}})])]);exports.default=resetIcon},{"@cycle/dom":49}],33:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var run_1=require("@cycle/run");var dom_1=require("@cycle/dom");var cycle_onionify_1=require("cycle-onionify");var index_1=require("./App/index");require("./styles");var typestyle_1=require("typestyle");var main=cycle_onionify_1.default(index_1.default);run_1.run(main,{DOM:dom_1.makeDOMDriver("#main-container")});typestyle_1.forceRenderStyles()},{"./App/index":1,"./styles":34,"@cycle/dom":49,"@cycle/run":59,"cycle-onionify":63,typestyle:97}],34:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var typestyle_1=require("typestyle");typestyle_1.cssRule("@font-face",{fontFamily:'"Source Sans Pro"',src:'url("./fonts/SourceSansPro-Regular.otf")',fontWeight:"normal"});typestyle_1.cssRule("@font-face",{fontFamily:'"Vesper Libre"',src:'url("./fonts/VesperLibre-Regular.ttf")',fontWeight:"normal"});exports.pallete={blue:"rgb(48, 141, 255)",blueWeak:"rgb(93, 166, 252)",orange:"rgb(255, 162, 48)",orangeWeak:"rgb(253, 180, 97)",white:"#FFFFFF",grayLight:"#EEEEEE",gray:"#C5C5C5",grayDark:"#686868",black:"#323232"}},{typestyle:97}],35:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var immutable_1=require("immutable");var MatrixValues=function(){function MatrixValues(){}MatrixValues.prototype.clone=function(){var mv=new MatrixValues;mv.numRows=this.numRows;mv.numCols=this.numCols;mv.values=this.values;return mv};MatrixValues.ofDimensions=function(rows,columns){var mv=new MatrixValues;mv.numRows=Math.max(globalThis.tc39ignoredme1,rows);mv.numCols=Math.max(globalThis.tc39ignoredme1,columns);mv.values=makeValues(rows,columns);return mv};MatrixValues.from=function(vals){var mv=new MatrixValues;mv.numRows=vals.length;mv.numCols=vals[0].length;mv.values=immutable_1.fromJS(vals);return mv};MatrixValues.prototype.resize=function(numRows,numColumns){var _a=this,oldNumRows=_a.numRows,oldNumCols=_a.numCols;var nR=Math.max(1,numRows);var nC=Math.max(1,numColumns);var mv=new MatrixValues;mv.numRows=nR;mv.numCols=nC;mv.values=this.values.setSize(nR).map(function(rows,rowIndex){if(rowIndex>=oldNumRows){return makeRow(nC)}else{return rows.setSize(nC).map(function(v,colIndex){return colIndex>=oldNumCols?1:v})}});return mv};MatrixValues.prototype.set=function(rowIndex,colIndex,value){var mv=this.clone();mv.values=mv.values.setIn([rowIndex,colIndex],value);return mv};MatrixValues.prototype.get=function(rowIndex,colIndex){return this.values.getIn([rowIndex,colIndex])};MatrixValues.prototype.setAll=function(value){var mv=new MatrixValues;mv.numRows=this.numRows;mv.numCols=this.numCols;mv.values=makeValues(mv.numRows,mv.numCols,value);return mv};MatrixValues.prototype.transpose=function(){var mv=new MatrixValues;var numRows=mv.numRows=this.numCols;var numCols=mv.numCols=this.numRows;mv.values=makeValues(numRows,numCols);for(var i=0;i<numRows;i++){for(var j=0;j<numCols;j++){mv.values=mv.values.setIn([i,j],this.get(j,i))}}return mv};Object.defineProperty(MatrixValues.prototype,"numberRows",{get:function(){return this.numRows},enumerable:true,configurable:true});Object.defineProperty(MatrixValues.prototype,"numberColumns",{get:function(){return this.numCols},enumerable:true,configurable:true});Object.defineProperty(MatrixValues.prototype,"rows",{get:function(){return this.values.toJS()},enumerable:true,configurable:true});return MatrixValues}();exports.default=MatrixValues;function makeValues(numRows,numColumns,val){if(val===void 0){val=1}var vals=new Array(numRows);for(var i=0;i<numRows;i++){vals[i]=makeRow(numColumns,val)}return immutable_1.List(vals)}function makeRow(numColumns,val){if(val===void 0){val=1}var row=new Array(numColumns);for(var i=0;i<numColumns;i++){row[i]=val}return immutable_1.List(row)}},{immutable:68}],36:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var adapt_1=require("@cycle/run/lib/adapt");var fromEvent_1=require("./fromEvent");var BodyDOMSource=function(){function BodyDOMSource(_name){this._name=_name}BodyDOMSource.prototype.select=function(selector){return this};BodyDOMSource.prototype.elements=function(){var out=adapt_1.adapt(xstream_1.default.of([document.body]));out._isCycleSource=this._name;return out};BodyDOMSource.prototype.element=function(){var out=adapt_1.adapt(xstream_1.default.of(document.body));out._isCycleSource=this._name;return out};BodyDOMSource.prototype.events=function(eventType,options){if(options===void 0){options={}}var stream;stream=fromEvent_1.fromEvent(document.body,eventType,options.useCapture,options.preventDefault);var out=adapt_1.adapt(stream);out._isCycleSource=this._name;return out};return BodyDOMSource}();exports.BodyDOMSource=BodyDOMSource},{"./fromEvent":47,"@cycle/run/lib/adapt":57,xstream:107}],37:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var adapt_1=require("@cycle/run/lib/adapt");var fromEvent_1=require("./fromEvent");var DocumentDOMSource=function(){function DocumentDOMSource(_name){this._name=_name}DocumentDOMSource.prototype.select=function(selector){return this};DocumentDOMSource.prototype.elements=function(){var out=adapt_1.adapt(xstream_1.default.of([document]));out._isCycleSource=this._name;return out};DocumentDOMSource.prototype.element=function(){var out=adapt_1.adapt(xstream_1.default.of(document));out._isCycleSource=this._name;return out};DocumentDOMSource.prototype.events=function(eventType,options){if(options===void 0){options={}}var stream;stream=fromEvent_1.fromEvent(document,eventType,options.useCapture,options.preventDefault);var out=adapt_1.adapt(stream);out._isCycleSource=this._name;return out};return DocumentDOMSource}();exports.DocumentDOMSource=DocumentDOMSource},{"./fromEvent":47,"@cycle/run/lib/adapt":57,xstream:107}],38:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var ScopeChecker_1=require("./ScopeChecker");var utils_1=require("./utils");function toElArray(input){return Array.prototype.slice.call(input)}var ElementFinder=function(){function ElementFinder(namespace,isolateModule){this.namespace=namespace;this.isolateModule=isolateModule}ElementFinder.prototype.call=function(){var namespace=this.namespace;var selector=utils_1.getSelectors(namespace);var scopeChecker=new ScopeChecker_1.ScopeChecker(namespace,this.isolateModule);var topNode=this.isolateModule.getElement(namespace.filter(function(n){return n.type!=="selector"}));if(topNode===undefined){return[]}if(selector===""){return[topNode]}return toElArray(topNode.querySelectorAll(selector)).filter(scopeChecker.isDirectlyInScope,scopeChecker).concat(topNode.matches(selector)?[topNode]:[])};return ElementFinder}();exports.ElementFinder=ElementFinder},{"./ScopeChecker":44,"./utils":55}],39:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var ScopeChecker_1=require("./ScopeChecker");var utils_1=require("./utils");var ElementFinder_1=require("./ElementFinder");var SymbolTree_1=require("./SymbolTree");var RemovalSet_1=require("./RemovalSet");var PriorityQueue_1=require("./PriorityQueue");var fromEvent_1=require("./fromEvent");exports.eventTypesThatDontBubble=["blur","canplay","canplaythrough","durationchange","emptied","ended","focus","load","loadeddata","loadedmetadata","mouseenter","mouseleave","pause","play","playing","ratechange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeupdate","unload","volumechange","waiting"];var EventDelegator=function(){function EventDelegator(rootElement$,isolateModule){var _this=this;this.rootElement$=rootElement$;this.isolateModule=isolateModule;this.virtualListeners=new SymbolTree_1.default(function(x){return x.scope});this.nonBubblingListenersToAdd=new RemovalSet_1.default;this.virtualNonBubblingListener=[];this.isolateModule.setEventDelegator(this);this.domListeners=new Map;this.domListenersToAdd=new Map;this.nonBubblingListeners=new Map;rootElement$.addListener({next:function(el){if(_this.origin!==el){_this.origin=el;_this.resetEventListeners();_this.domListenersToAdd.forEach(function(passive,type){return _this.setupDOMListener(type,passive)});_this.domListenersToAdd.clear()}_this.resetNonBubblingListeners();_this.nonBubblingListenersToAdd.forEach(function(arr){_this.setupNonBubblingListener(arr)})}})}EventDelegator.prototype.addEventListener=function(eventType,namespace,options,bubbles){var subject=xstream_1.default.never();var scopeChecker=new ScopeChecker_1.ScopeChecker(namespace,this.isolateModule);var dest=this.insertListener(subject,scopeChecker,eventType,options);var shouldBubble=bubbles===undefined?exports.eventTypesThatDontBubble.indexOf(eventType)===-1:bubbles;if(shouldBubble){if(!this.domListeners.has(eventType)){this.setupDOMListener(eventType,!!options.passive)}}else{var finder=new ElementFinder_1.ElementFinder(namespace,this.isolateModule);this.setupNonBubblingListener([eventType,finder,dest])}return subject};EventDelegator.prototype.removeElement=function(element,namespace){if(namespace!==undefined){this.virtualListeners.delete(namespace)}var toRemove=[];this.nonBubblingListeners.forEach(function(map,type){if(map.has(element)){toRemove.push([type,element])}});for(var i=0;i<toRemove.length;i++){var map=this.nonBubblingListeners.get(toRemove[i][0]);if(!map){continue}map.delete(toRemove[i][1]);if(map.size===0){this.nonBubblingListeners.delete(toRemove[i][0])}else{this.nonBubblingListeners.set(toRemove[i][0],map)}}};EventDelegator.prototype.insertListener=function(subject,scopeChecker,eventType,options){var relevantSets=[];var n=scopeChecker._namespace;var max=n.length;do{relevantSets.push(this.getVirtualListeners(eventType,n,true,max));max--}while(max>=0&&n[max].type!=="total");var destination=__assign({},options,{scopeChecker:scopeChecker,subject:subject,bubbles:!!options.bubbles,useCapture:!!options.useCapture,passive:!!options.passive});for(var i=0;i<relevantSets.length;i++){relevantSets[i].add(destination,n.length)}return destination};EventDelegator.prototype.getVirtualListeners=function(eventType,namespace,exact,max){if(exact===void 0){exact=false}var _max=max!==undefined?max:namespace.length;if(!exact){for(var i=_max-1;i>=0;i--){if(namespace[i].type==="total"){_max=i+1;break}_max=i}}var map=this.virtualListeners.getDefault(namespace,function(){return new Map},_max);if(!map.has(eventType)){map.set(eventType,new PriorityQueue_1.default)}return map.get(eventType)};EventDelegator.prototype.setupDOMListener=function(eventType,passive){var _this=this;if(this.origin){var sub=fromEvent_1.fromEvent(this.origin,eventType,false,false,passive).subscribe({next:function(event){return _this.onEvent(eventType,event,passive)},error:function(){},complete:function(){}});this.domListeners.set(eventType,{sub:sub,passive:passive})}else{this.domListenersToAdd.set(eventType,passive)}};EventDelegator.prototype.setupNonBubblingListener=function(input){var _this=this;var eventType=input[0],elementFinder=input[1],destination=input[2];if(!this.origin){this.nonBubblingListenersToAdd.add(input);return}var element=elementFinder.call()[0];if(element){this.nonBubblingListenersToAdd.delete(input);var sub=fromEvent_1.fromEvent(element,eventType,false,false,destination.passive).subscribe({next:function(ev){return _this.onEvent(eventType,ev,!!destination.passive,false)},error:function(){},complete:function(){}});if(!this.nonBubblingListeners.has(eventType)){this.nonBubblingListeners.set(eventType,new Map)}var map=this.nonBubblingListeners.get(eventType);if(!map){return}map.set(element,{sub:sub,destination:destination})}else{this.nonBubblingListenersToAdd.add(input)}};EventDelegator.prototype.resetEventListeners=function(){var iter=this.domListeners.entries();var curr=iter.next();while(!curr.done){var _a=curr.value,type=_a[0],_b=_a[1],sub=_b.sub,passive=_b.passive;sub.unsubscribe();this.setupDOMListener(type,passive);curr=iter.next()}};EventDelegator.prototype.resetNonBubblingListeners=function(){var _this=this;var newMap=new Map;var insert=utils_1.makeInsert(newMap);this.nonBubblingListeners.forEach(function(map,type){map.forEach(function(value,elm){if(!document.body.contains(elm)){var sub=value.sub,destination_1=value.destination;if(sub){sub.unsubscribe()}var elementFinder=new ElementFinder_1.ElementFinder(destination_1.scopeChecker.namespace,_this.isolateModule);var newElm=elementFinder.call()[0];var newSub=fromEvent_1.fromEvent(newElm,type,false,false,destination_1.passive).subscribe({next:function(event){return _this.onEvent(type,event,!!destination_1.passive,false)},error:function(){},complete:function(){}});insert(type,newElm,{sub:newSub,destination:destination_1})}else{insert(type,elm,value)}});_this.nonBubblingListeners=newMap})};EventDelegator.prototype.putNonBubblingListener=function(eventType,elm,useCapture,passive){var map=this.nonBubblingListeners.get(eventType);if(!map){return}var listener=map.get(elm);if(listener&&listener.destination.passive===passive&&listener.destination.useCapture===useCapture){this.virtualNonBubblingListener[0]=listener.destination}};EventDelegator.prototype.onEvent=function(eventType,event,passive,bubbles){if(bubbles===void 0){bubbles=true}var cycleEvent=this.patchEvent(event);var rootElement=this.isolateModule.getRootElement(event.target);if(bubbles){var namespace=this.isolateModule.getNamespace(event.target);if(!namespace){return}var listeners=this.getVirtualListeners(eventType,namespace);this.bubble(eventType,event.target,rootElement,cycleEvent,listeners,namespace,namespace.length-1,true,passive);this.bubble(eventType,event.target,rootElement,cycleEvent,listeners,namespace,namespace.length-1,false,passive)}else{this.putNonBubblingListener(eventType,event.target,true,passive);this.doBubbleStep(eventType,event.target,rootElement,cycleEvent,this.virtualNonBubblingListener,true,passive);this.putNonBubblingListener(eventType,event.target,false,passive);this.doBubbleStep(eventType,event.target,rootElement,cycleEvent,this.virtualNonBubblingListener,false,passive);event.stopPropagation()}};EventDelegator.prototype.bubble=function(eventType,elm,rootElement,event,listeners,namespace,index,useCapture,passive){if(!useCapture&&!event.propagationHasBeenStopped){this.doBubbleStep(eventType,elm,rootElement,event,listeners,useCapture,passive)}var newRoot=rootElement;var newIndex=index;if(elm===rootElement){if(index>=0&&namespace[index].type==="sibling"){newRoot=this.isolateModule.getElement(namespace,index);newIndex--}else{return}}if(elm.parentNode&&newRoot){this.bubble(eventType,elm.parentNode,newRoot,event,listeners,namespace,newIndex,useCapture,passive)}if(useCapture&&!event.propagationHasBeenStopped){this.doBubbleStep(eventType,elm,rootElement,event,listeners,useCapture,passive)}}
;EventDelegator.prototype.doBubbleStep=function(eventType,elm,rootElement,event,listeners,useCapture,passive){if(!rootElement){return}this.mutateEventCurrentTarget(event,elm);listeners.forEach(function(dest){if(dest.passive===passive&&dest.useCapture===useCapture){var sel=utils_1.getSelectors(dest.scopeChecker.namespace);if(!event.propagationHasBeenStopped&&dest.scopeChecker.isDirectlyInScope(elm)&&(sel!==""&&elm.matches(sel)||sel===""&&elm===rootElement)){fromEvent_1.preventDefaultConditional(event,dest.preventDefault);dest.subject.shamefullySendNext(event)}}})};EventDelegator.prototype.patchEvent=function(event){var pEvent=event;pEvent.propagationHasBeenStopped=false;var oldStopPropagation=pEvent.stopPropagation;pEvent.stopPropagation=function stopPropagation(){oldStopPropagation.call(this);this.propagationHasBeenStopped=true};return pEvent};EventDelegator.prototype.mutateEventCurrentTarget=function(event,currentTargetElement){try{Object.defineProperty(event,"currentTarget",{value:currentTargetElement,configurable:true})}catch(err){console.log("please use event.ownerTarget")}event.ownerTarget=currentTargetElement};return EventDelegator}();exports.EventDelegator=EventDelegator},{"./ElementFinder":38,"./PriorityQueue":42,"./RemovalSet":43,"./ScopeChecker":44,"./SymbolTree":45,"./fromEvent":47,"./utils":55,xstream:107}],40:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var utils_1=require("./utils");var SymbolTree_1=require("./SymbolTree");var IsolateModule=function(){function IsolateModule(){this.namespaceTree=new SymbolTree_1.default(function(x){return x.scope});this.namespaceByElement=new Map;this.vnodesBeingRemoved=[]}IsolateModule.prototype.setEventDelegator=function(del){this.eventDelegator=del};IsolateModule.prototype.insertElement=function(namespace,el){this.namespaceByElement.set(el,namespace);this.namespaceTree.set(namespace,el)};IsolateModule.prototype.removeElement=function(elm){this.namespaceByElement.delete(elm);var namespace=this.getNamespace(elm);if(namespace){this.namespaceTree.delete(namespace)}};IsolateModule.prototype.getElement=function(namespace,max){return this.namespaceTree.get(namespace,undefined,max)};IsolateModule.prototype.getRootElement=function(elm){if(this.namespaceByElement.has(elm)){return elm}var curr=elm;while(!this.namespaceByElement.has(curr)){curr=curr.parentNode;if(!curr){return undefined}else if(curr.tagName==="HTML"){throw new Error("No root element found, this should not happen at all")}}return curr};IsolateModule.prototype.getNamespace=function(elm){var rootElement=this.getRootElement(elm);if(!rootElement){return undefined}return this.namespaceByElement.get(rootElement)};IsolateModule.prototype.createModule=function(){var self=this;return{create:function(emptyVNode,vNode){var elm=vNode.elm,_a=vNode.data,data=_a===void 0?{}:_a;var namespace=data.isolate;if(Array.isArray(namespace)){self.insertElement(namespace,elm)}},update:function(oldVNode,vNode){var oldElm=oldVNode.elm,_a=oldVNode.data,oldData=_a===void 0?{}:_a;var elm=vNode.elm,_b=vNode.data,data=_b===void 0?{}:_b;var oldNamespace=oldData.isolate;var namespace=data.isolate;if(!utils_1.isEqualNamespace(oldNamespace,namespace)){if(Array.isArray(oldNamespace)){self.removeElement(oldElm)}}if(Array.isArray(namespace)){self.insertElement(namespace,elm)}},destroy:function(vNode){self.vnodesBeingRemoved.push(vNode)},remove:function(vNode,cb){self.vnodesBeingRemoved.push(vNode);cb()},post:function(){var vnodesBeingRemoved=self.vnodesBeingRemoved;for(var i=vnodesBeingRemoved.length-1;i>=0;i--){var vnode=vnodesBeingRemoved[i];var namespace=vnode.data!==undefined?vnode.data.isolation:undefined;if(namespace!==undefined){self.removeElement(namespace)}self.eventDelegator.removeElement(vnode.elm,namespace)}self.vnodesBeingRemoved=[]}}};return IsolateModule}();exports.IsolateModule=IsolateModule},{"./SymbolTree":45,"./utils":55}],41:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var adapt_1=require("@cycle/run/lib/adapt");var DocumentDOMSource_1=require("./DocumentDOMSource");var BodyDOMSource_1=require("./BodyDOMSource");var ElementFinder_1=require("./ElementFinder");var isolate_1=require("./isolate");var MainDOMSource=function(){function MainDOMSource(_rootElement$,_sanitation$,_namespace,_isolateModule,_eventDelegator,_name){if(_namespace===void 0){_namespace=[]}this._rootElement$=_rootElement$;this._sanitation$=_sanitation$;this._namespace=_namespace;this._isolateModule=_isolateModule;this._eventDelegator=_eventDelegator;this._name=_name;this.isolateSource=function(source,scope){return new MainDOMSource(source._rootElement$,source._sanitation$,source._namespace.concat(isolate_1.getScopeObj(scope)),source._isolateModule,source._eventDelegator,source._name)};this.isolateSink=isolate_1.makeIsolateSink(this._namespace)}MainDOMSource.prototype._elements=function(){if(this._namespace.length===0){return this._rootElement$.map(function(x){return[x]})}else{var elementFinder_1=new ElementFinder_1.ElementFinder(this._namespace,this._isolateModule);return this._rootElement$.map(function(){return elementFinder_1.call()})}};MainDOMSource.prototype.elements=function(){var out=adapt_1.adapt(this._elements().remember());out._isCycleSource=this._name;return out};MainDOMSource.prototype.element=function(){var out=adapt_1.adapt(this._elements().filter(function(arr){return arr.length>0}).map(function(arr){return arr[0]}).remember());out._isCycleSource=this._name;return out};Object.defineProperty(MainDOMSource.prototype,"namespace",{get:function(){return this._namespace},enumerable:true,configurable:true});MainDOMSource.prototype.select=function(selector){if(typeof selector!=="string"){throw new Error("DOM driver's select() expects the argument to be a "+"string as a CSS selector")}if(selector==="document"){return new DocumentDOMSource_1.DocumentDOMSource(this._name)}if(selector==="body"){return new BodyDOMSource_1.BodyDOMSource(this._name)}var namespace=selector===":root"?[]:this._namespace.concat({type:"selector",scope:selector.trim()});return new MainDOMSource(this._rootElement$,this._sanitation$,namespace,this._isolateModule,this._eventDelegator,this._name)};MainDOMSource.prototype.events=function(eventType,options,bubbles){if(options===void 0){options={}}if(typeof eventType!=="string"){throw new Error("DOM driver's events() expects argument to be a "+"string representing the event type to listen for.")}var event$=this._eventDelegator.addEventListener(eventType,this._namespace,options,bubbles);var out=adapt_1.adapt(event$);out._isCycleSource=this._name;return out};MainDOMSource.prototype.dispose=function(){this._sanitation$.shamefullySendNext(null)};return MainDOMSource}();exports.MainDOMSource=MainDOMSource},{"./BodyDOMSource":36,"./DocumentDOMSource":37,"./ElementFinder":38,"./isolate":50,"@cycle/run/lib/adapt":57}],42:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var PriorityQueue=function(){function PriorityQueue(){this.arr=[];this.prios=[]}PriorityQueue.prototype.add=function(t,prio){for(var i=0;i<this.arr.length;i++){if(this.prios[i]<prio){this.arr.splice(i,0,t);this.prios.splice(i,0,prio);return}}this.arr.push(t);this.prios.push(prio)};PriorityQueue.prototype.forEach=function(f){for(var i=0;i<this.arr.length;i++){f(this.arr[i],i,this.arr)}};PriorityQueue.prototype.delete=function(t){for(var i=0;i<this.arr.length;i++){if(this.arr[i]===t){this.arr.splice(i,1);this.prios.splice(i,1);return}}};return PriorityQueue}();exports.default=PriorityQueue},{}],43:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var RemovalSet=function(){function RemovalSet(){this.toDelete=[];this.toDeleteSize=0;this._set=new Set}RemovalSet.prototype.add=function(t){this._set.add(t)};RemovalSet.prototype.forEach=function(f){this._set.forEach(f);this.flush()};RemovalSet.prototype.delete=function(t){if(this.toDelete.length===this.toDeleteSize){this.toDelete.push(t)}else{this.toDelete[this.toDeleteSize]=t}this.toDeleteSize++};RemovalSet.prototype.flush=function(){for(var i=0;i<this.toDelete.length;i++){if(i<this.toDeleteSize){this._set.delete(this.toDelete[i])}this.toDelete[i]=undefined}this.toDeleteSize=0};return RemovalSet}();exports.default=RemovalSet},{}],44:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var utils_1=require("./utils");var ScopeChecker=function(){function ScopeChecker(namespace,isolateModule){this.namespace=namespace;this.isolateModule=isolateModule;this._namespace=namespace.filter(function(n){return n.type!=="selector"})}ScopeChecker.prototype.isDirectlyInScope=function(leaf){var namespace=this.isolateModule.getNamespace(leaf);if(!namespace){return false}if(this._namespace.length>namespace.length||!utils_1.isEqualNamespace(this._namespace,namespace.slice(0,this._namespace.length))){return false}for(var i=this._namespace.length;i<namespace.length;i++){if(namespace[i].type==="total"){return false}}return true};return ScopeChecker}();exports.ScopeChecker=ScopeChecker},{"./utils":55}],45:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var SymbolTree=function(){function SymbolTree(mapper){this.mapper=mapper;this.tree=[undefined,{}]}SymbolTree.prototype.set=function(path,element,max){var curr=this.tree;var _max=max!==undefined?max:path.length;for(var i=0;i<_max;i++){var n=this.mapper(path[i]);var child=curr[1][n];if(!child){child=[undefined,{}];curr[1][n]=child}curr=child}curr[0]=element};SymbolTree.prototype.getDefault=function(path,mkDefaultElement,max){return this.get(path,mkDefaultElement,max)};SymbolTree.prototype.get=function(path,mkDefaultElement,max){var curr=this.tree;var _max=max!==undefined?max:path.length;for(var i=0;i<_max;i++){var n=this.mapper(path[i]);var child=curr[1][n];if(!child){if(mkDefaultElement){child=[undefined,{}];curr[1][n]=child}else{return undefined}}curr=child}if(mkDefaultElement&&!curr[0]){curr[0]=mkDefaultElement()}return curr[0]};SymbolTree.prototype.delete=function(path){var curr=this.tree;for(var i=0;i<path.length-1;i++){var child=curr[1][this.mapper(path[i])];if(!child){return}curr=child}delete curr[1][this.mapper(path[path.length-1])]};return SymbolTree}();exports.default=SymbolTree},{}],46:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var vnode_1=require("snabbdom/vnode");var h_1=require("snabbdom/h");var snabbdom_selector_1=require("snabbdom-selector");var utils_1=require("./utils");var VNodeWrapper=function(){function VNodeWrapper(rootElement){this.rootElement=rootElement}VNodeWrapper.prototype.call=function(vnode){if(utils_1.isDocFrag(this.rootElement)){return this.wrapDocFrag(vnode===null?[]:[vnode])}if(vnode===null){return this.wrap([])}var _a=snabbdom_selector_1.selectorParser(vnode),selTagName=_a.tagName,selId=_a.id;var vNodeClassName=snabbdom_selector_1.classNameFromVNode(vnode);var vNodeData=vnode.data||{};var vNodeDataProps=vNodeData.props||{};var _b=vNodeDataProps.id,vNodeId=_b===void 0?selId:_b;var isVNodeAndRootElementIdentical=typeof vNodeId==="string"&&vNodeId.toUpperCase()===this.rootElement.id.toUpperCase()&&selTagName.toUpperCase()===this.rootElement.tagName.toUpperCase()&&vNodeClassName.toUpperCase()===this.rootElement.className.toUpperCase();if(isVNodeAndRootElementIdentical){return vnode}return this.wrap([vnode])};VNodeWrapper.prototype.wrapDocFrag=function(children){return vnode_1.vnode("",{isolate:[]},children,undefined,this.rootElement)};VNodeWrapper.prototype.wrap=function(children){var _a=this.rootElement,tagName=_a.tagName,id=_a.id,className=_a.className;var selId=id?"#"+id:"";var selClass=className?"."+className.split(" ").join("."):"";var vnode=h_1.h(""+tagName.toLowerCase()+selId+selClass,{},children);vnode.data=vnode.data||{};vnode.data.isolate=vnode.data.isolate||[];return vnode};return VNodeWrapper}();exports.VNodeWrapper=VNodeWrapper},{"./utils":55,"snabbdom-selector":74,"snabbdom/h":78,"snabbdom/vnode":89}],47:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");function fromEvent(element,eventName,useCapture,preventDefault,passive){if(useCapture===void 0){useCapture=false}if(preventDefault===void 0){preventDefault=false}if(passive===void 0){passive=false}return xstream_1.Stream.create({element:element,next:null,start:function start(listener){if(preventDefault){this.next=function next(event){preventDefaultConditional(event,preventDefault);listener.next(event)}}else{this.next=function next(event){listener.next(event)}}this.element.addEventListener(eventName,this.next,{capture:useCapture,passive:passive})},stop:function stop(){this.element.removeEventListener(eventName,this.next,useCapture)}})}exports.fromEvent=fromEvent;function matchObject(matcher,obj){var keys=Object.keys(matcher);var n=keys.length;for(var i=0;i<n;i++){var k=keys[i];if(typeof matcher[k]==="object"&&typeof obj[k]==="object"){if(!matchObject(matcher[k],obj[k])){return false}}else if(matcher[k]!==obj[k]){return false}}return true}function preventDefaultConditional(event,preventDefault){if(preventDefault){if(typeof preventDefault==="boolean"){event.preventDefault()}else if(typeof preventDefault==="function"){if(preventDefault(event)){event.preventDefault()}}else if(typeof preventDefault==="object"){if(matchObject(preventDefault,event)){event.preventDefault()}}else{throw new Error("preventDefault has to be either a boolean, predicate function or object")}}}exports.preventDefaultConditional=preventDefaultConditional},{xstream:107}],48:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var h_1=require("snabbdom/h");function isValidString(param){return typeof param==="string"&¶m.length>0}function isSelector(param){return isValidString(param)&&(param[0]==="."||param[0]==="#")}function createTagFunction(tagName){return function hyperscript(a,b,c){var hasA=typeof a!=="undefined";var hasB=typeof b!=="undefined";var hasC=typeof c!=="undefined";if(isSelector(a)){if(hasB&&hasC){return h_1.h(tagName+a,b,c)}else if(hasB){return h_1.h(tagName+a,b)}else{return h_1.h(tagName+a,{})}}else if(hasC){return h_1.h(tagName+a,b,c)}else if(hasB){return h_1.h(tagName,a,b)}else if(hasA){return h_1.h(tagName,a)}else{return h_1.h(tagName,{})}}}var SVG_TAG_NAMES=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","colorProfile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotlight","feTile","feTurbulence","filter","font","fontFace","fontFaceFormat","fontFaceName","fontFaceSrc","fontFaceUri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missingGlyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"];var svg=createTagFunction("svg");SVG_TAG_NAMES.forEach(function(tag){svg[tag]=createTagFunction(tag)});var TAG_NAMES=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dir","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","meta","nav","noscript","object","ol","optgroup","option","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","u","ul","video"];var exported={SVG_TAG_NAMES:SVG_TAG_NAMES,TAG_NAMES:TAG_NAMES,svg:svg,isSelector:isSelector,createTagFunction:createTagFunction};TAG_NAMES.forEach(function(n){exported[n]=createTagFunction(n)});exports.default=exported},{"snabbdom/h":78}],49:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var thunk_1=require("./thunk");exports.thunk=thunk_1.thunk;var MainDOMSource_1=require("./MainDOMSource");exports.MainDOMSource=MainDOMSource_1.MainDOMSource;var makeDOMDriver_1=require("./makeDOMDriver");exports.makeDOMDriver=makeDOMDriver_1.makeDOMDriver;var mockDOMSource_1=require("./mockDOMSource");exports.mockDOMSource=mockDOMSource_1.mockDOMSource;exports.MockedDOMSource=mockDOMSource_1.MockedDOMSource;var h_1=require("snabbdom/h");exports.h=h_1.h;var hyperscript_helpers_1=require("./hyperscript-helpers");exports.svg=hyperscript_helpers_1.default.svg;exports.a=hyperscript_helpers_1.default.a;exports.abbr=hyperscript_helpers_1.default.abbr;exports.address=hyperscript_helpers_1.default.address;exports.area=hyperscript_helpers_1.default.area;exports.article=hyperscript_helpers_1.default.article;exports.aside=hyperscript_helpers_1.default.aside;exports.audio=hyperscript_helpers_1.default.audio;exports.b=hyperscript_helpers_1.default.b;exports.base=hyperscript_helpers_1.default.base;exports.bdi=hyperscript_helpers_1.default.bdi;exports.bdo=hyperscript_helpers_1.default.bdo;exports.blockquote=hyperscript_helpers_1.default.blockquote;exports.body=hyperscript_helpers_1.default.body;exports.br=hyperscript_helpers_1.default.br;exports.button=hyperscript_helpers_1.default.button;exports.canvas=hyperscript_helpers_1.default.canvas;exports.caption=hyperscript_helpers_1.default.caption;exports.cite=hyperscript_helpers_1.default.cite;exports.code=hyperscript_helpers_1.default.code;exports.col=hyperscript_helpers_1.default.col;exports.colgroup=hyperscript_helpers_1.default.colgroup;exports.dd=hyperscript_helpers_1.default.dd;exports.del=hyperscript_helpers_1.default.del;exports.dfn=hyperscript_helpers_1.default.dfn;exports.dir=hyperscript_helpers_1.default.dir;exports.div=hyperscript_helpers_1.default.div;exports.dl=hyperscript_helpers_1.default.dl;exports.dt=hyperscript_helpers_1.default.dt;exports.em=hyperscript_helpers_1.default.em;exports.embed=hyperscript_helpers_1.default.embed;exports.fieldset=hyperscript_helpers_1.default.fieldset;exports.figcaption=hyperscript_helpers_1.default.figcaption;exports.figure=hyperscript_helpers_1.default.figure;exports.footer=hyperscript_helpers_1.default.footer;exports.form=hyperscript_helpers_1.default.form;exports.h1=hyperscript_helpers_1.default.h1;exports.h2=hyperscript_helpers_1.default.h2;exports.h3=hyperscript_helpers_1.default.h3;exports.h4=hyperscript_helpers_1.default.h4;exports.h5=hyperscript_helpers_1.default.h5;exports.h6=hyperscript_helpers_1.default.h6;exports.head=hyperscript_helpers_1.default.head;exports.header=hyperscript_helpers_1.default.header;exports.hgroup=hyperscript_helpers_1.default.hgroup;exports.hr=hyperscript_helpers_1.default.hr;exports.html=hyperscript_helpers_1.default.html;exports.i=hyperscript_helpers_1.default.i;exports.iframe=hyperscript_helpers_1.default.iframe;exports.img=hyperscript_helpers_1.default.img;exports.input=hyperscript_helpers_1.default.input;exports.ins=hyperscript_helpers_1.default.ins;exports.kbd=hyperscript_helpers_1.default.kbd;exports.keygen=hyperscript_helpers_1.default.keygen;exports.label=hyperscript_helpers_1.default.label;exports.legend=hyperscript_helpers_1.default.legend;exports.li=hyperscript_helpers_1.default.li;exports.link=hyperscript_helpers_1.default.link;exports.main=hyperscript_helpers_1.default.main;exports.map=hyperscript_helpers_1.default.map;exports.mark=hyperscript_helpers_1.default.mark;exports.menu=hyperscript_helpers_1.default.menu;exports.meta=hyperscript_helpers_1.default.meta;exports.nav=hyperscript_helpers_1.default.nav;exports.noscript=hyperscript_helpers_1.default.noscript;exports.object=hyperscript_helpers_1.default.object;exports.ol=hyperscript_helpers_1.default.ol;exports.optgroup=hyperscript_helpers_1.default.optgroup;exports.option=hyperscript_helpers_1.default.option;exports.p=hyperscript_helpers_1.default.p;exports.param=hyperscript_helpers_1.default.param;exports.pre=hyperscript_helpers_1.default.pre;exports.progress=hyperscript_helpers_1.default.progress;exports.q=hyperscript_helpers_1.default.q;exports.rp=hyperscript_helpers_1.default.rp;exports.rt=hyperscript_helpers_1.default.rt;exports.ruby=hyperscript_helpers_1.default.ruby;exports.s=hyperscript_helpers_1.default.s;exports.samp=hyperscript_helpers_1.default.samp;exports.script=hyperscript_helpers_1.default.script;exports.section=hyperscript_helpers_1.default.section;exports.select=hyperscript_helpers_1.default.select;exports.small=hyperscript_helpers_1.default.small;exports.source=hyperscript_helpers_1.default.source;exports.span=hyperscript_helpers_1.default.span;exports.strong=hyperscript_helpers_1.default.strong;exports.style=hyperscript_helpers_1.default.style;exports.sub=hyperscript_helpers_1.default.sub;exports.sup=hyperscript_helpers_1.default.sup;exports.table=hyperscript_helpers_1.default.table;exports.tbody=hyperscript_helpers_1.default.tbody;exports.td=hyperscript_helpers_1.default.td;exports.textarea=hyperscript_helpers_1.default.textarea;exports.tfoot=hyperscript_helpers_1.default.tfoot;exports.th=hyperscript_helpers_1.default.th;exports.thead=hyperscript_helpers_1.default.thead;exports.title=hyperscript_helpers_1.default.title;exports.tr=hyperscript_helpers_1.default.tr;exports.u=hyperscript_helpers_1.default.u;exports.ul=hyperscript_helpers_1.default.ul;exports.video=hyperscript_helpers_1.default.video},{"./MainDOMSource":41,"./hyperscript-helpers":48,"./makeDOMDriver":51,"./mockDOMSource":52,"./thunk":54,"snabbdom/h":78}],50:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var utils_1=require("./utils");function makeIsolateSink(namespace){return function(sink,scope){if(scope===":root"){return sink}return sink.map(function(node){if(!node){return node}var scopeObj=getScopeObj(scope);var newNode=__assign({},node,{data:__assign({},node.data,{isolate:!node.data||!Array.isArray(node.data.isolate)?namespace.concat([scopeObj]):node.data.isolate})});return __assign({},newNode,{key:newNode.key!==undefined?newNode.key:JSON.stringify(newNode.data.isolate)})})}}exports.makeIsolateSink=makeIsolateSink;function getScopeObj(scope){return{type:utils_1.isClassOrId(scope)?"sibling":"total",scope:scope}}exports.getScopeObj=getScopeObj},{"./utils":55}],51:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var snabbdom_1=require("snabbdom");var xstream_1=require("xstream");var concat_1=require("xstream/extra/concat");var sampleCombine_1=require("xstream/extra/sampleCombine");var MainDOMSource_1=require("./MainDOMSource");var tovnode_1=require("snabbdom/tovnode");var VNodeWrapper_1=require("./VNodeWrapper");var utils_1=require("./utils");var modules_1=require("./modules");var IsolateModule_1=require("./IsolateModule");var EventDelegator_1=require("./EventDelegator");function makeDOMDriverInputGuard(modules){if(!Array.isArray(modules)){throw new Error("Optional modules option must be an array for snabbdom modules")}}function domDriverInputGuard(view$){if(!view$||typeof view$.addListener!=="function"||typeof view$.fold!=="function"){throw new Error("The DOM driver function expects as input a Stream of "+"virtual DOM elements")}}function dropCompletion(input){return xstream_1.default.merge(input,xstream_1.default.never())}function unwrapElementFromVNode(vnode){return vnode.elm}function reportSnabbdomError(err){(console.error||console.log)(err)}function makeDOMReady$(){return xstream_1.default.create({start:function(lis){if(document.readyState==="loading"){document.addEventListener("readystatechange",function(){var state=document.readyState;if(state==="interactive"||state==="complete"){lis.next(null);lis.complete()}})}else{lis.next(null);lis.complete()}},stop:function(){}})}function addRootScope(vnode){vnode.data=vnode.data||{};vnode.data.isolate=[];return vnode}function makeDOMDriver(container,options){if(!options){options={}}utils_1.checkValidContainer(container);var modules=options.modules||modules_1.default;makeDOMDriverInputGuard(modules);var isolateModule=new IsolateModule_1.IsolateModule;var patch=snabbdom_1.init([isolateModule.createModule()].concat(modules));var domReady$=makeDOMReady$();var vnodeWrapper;var mutationObserver;var mutationConfirmed$=xstream_1.default.create({start:function(listener){mutationObserver=new MutationObserver(function(){return listener.next(null)})},stop:function(){mutationObserver.disconnect()}});function DOMDriver(vnode$,name){if(name===void 0){name="DOM"}domDriverInputGuard(vnode$);var sanitation$=xstream_1.default.create();var firstRoot$=domReady$.map(function(){var firstRoot=utils_1.getValidNode(container)||document.body;vnodeWrapper=new VNodeWrapper_1.VNodeWrapper(firstRoot);return firstRoot});var rememberedVNode$=vnode$.remember();rememberedVNode$.addListener({});mutationConfirmed$.addListener({});var elementAfterPatch$=firstRoot$.map(function(firstRoot){return xstream_1.default.merge(rememberedVNode$.endWhen(sanitation$),sanitation$).map(function(vnode){return vnodeWrapper.call(vnode)}).startWith(addRootScope(tovnode_1.toVNode(firstRoot))).fold(patch,tovnode_1.toVNode(firstRoot)).drop(1).map(unwrapElementFromVNode).startWith(firstRoot).map(function(el){mutationObserver.observe(el,{childList:true,attributes:true,characterData:true,subtree:true,attributeOldValue:true,characterDataOldValue:true});return el}).compose(dropCompletion)}).flatten();var rootElement$=concat_1.default(domReady$,mutationConfirmed$).endWhen(sanitation$).compose(sampleCombine_1.default(elementAfterPatch$)).map(function(arr){return arr[1]}).remember();rootElement$.addListener({error:reportSnabbdomError});var delegator=new EventDelegator_1.EventDelegator(rootElement$,isolateModule);return new MainDOMSource_1.MainDOMSource(rootElement$,sanitation$,[],isolateModule,delegator,name)}return DOMDriver}exports.makeDOMDriver=makeDOMDriver},{"./EventDelegator":39,"./IsolateModule":40,"./MainDOMSource":41,"./VNodeWrapper":46,"./modules":53,"./utils":55,snabbdom:86,"snabbdom/tovnode":88,xstream:107,"xstream/extra/concat":102,"xstream/extra/sampleCombine":105}],52:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var adapt_1=require("@cycle/run/lib/adapt");var SCOPE_PREFIX="___";var MockedDOMSource=function(){function MockedDOMSource(_mockConfig){this._mockConfig=_mockConfig;if(_mockConfig.elements){this._elements=_mockConfig.elements}else{this._elements=adapt_1.adapt(xstream_1.default.empty())}}MockedDOMSource.prototype.elements=function(){var out=this._elements;out._isCycleSource="MockedDOM";return out};MockedDOMSource.prototype.element=function(){var output$=this.elements().filter(function(arr){return arr.length>0}).map(function(arr){return arr[0]}).remember();var out=adapt_1.adapt(output$);out._isCycleSource="MockedDOM";return out};MockedDOMSource.prototype.events=function(eventType,options){var streamForEventType=this._mockConfig[eventType];var out=adapt_1.adapt(streamForEventType||xstream_1.default.empty());out._isCycleSource="MockedDOM";return out};MockedDOMSource.prototype.select=function(selector){var mockConfigForSelector=this._mockConfig[selector]||{};return new MockedDOMSource(mockConfigForSelector)};MockedDOMSource.prototype.isolateSource=function(source,scope){return source.select("."+SCOPE_PREFIX+scope)};MockedDOMSource.prototype.isolateSink=function(sink,scope){return adapt_1.adapt(xstream_1.default.fromObservable(sink).map(function(vnode){if(vnode.sel&&vnode.sel.indexOf(SCOPE_PREFIX+scope)!==-1){return vnode}else{vnode.sel+="."+SCOPE_PREFIX+scope;return vnode}}))};return MockedDOMSource}();exports.MockedDOMSource=MockedDOMSource;function mockDOMSource(mockConfig){return new MockedDOMSource(mockConfig)}exports.mockDOMSource=mockDOMSource},{"@cycle/run/lib/adapt":57,xstream:107}],53:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var class_1=require("snabbdom/modules/class");exports.ClassModule=class_1.default;var props_1=require("snabbdom/modules/props");exports.PropsModule=props_1.default;var attributes_1=require("snabbdom/modules/attributes");exports.AttrsModule=attributes_1.default;var style_1=require("snabbdom/modules/style");exports.StyleModule=style_1.default;var dataset_1=require("snabbdom/modules/dataset");exports.DatasetModule=dataset_1.default;var modules=[style_1.default,class_1.default,props_1.default,attributes_1.default,dataset_1.default];exports.default=modules},{"snabbdom/modules/attributes":81,"snabbdom/modules/class":82,"snabbdom/modules/dataset":83,"snabbdom/modules/props":84,"snabbdom/modules/style":85}],54:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var h_1=require("snabbdom/h");function copyToThunk(vnode,thunkVNode){thunkVNode.elm=vnode.elm;vnode.data.fn=thunkVNode.data.fn;vnode.data.args=thunkVNode.data.args;vnode.data.isolate=thunkVNode.data.isolate;thunkVNode.data=vnode.data;thunkVNode.children=vnode.children;thunkVNode.text=vnode.text;thunkVNode.elm=vnode.elm}function init(thunkVNode){var cur=thunkVNode.data;var vnode=cur.fn.apply(undefined,cur.args);copyToThunk(vnode,thunkVNode)}function prepatch(oldVnode,thunkVNode){var old=oldVnode.data,cur=thunkVNode.data;var i;var oldArgs=old.args,args=cur.args;if(old.fn!==cur.fn||oldArgs.length!==args.length){copyToThunk(cur.fn.apply(undefined,args),thunkVNode)}for(i=0;i<args.length;++i){if(oldArgs[i]!==args[i]){copyToThunk(cur.fn.apply(undefined,args),thunkVNode);return}}copyToThunk(oldVnode,thunkVNode)}function thunk(sel,key,fn,args){if(args===undefined){args=fn;fn=key;key=undefined}return h_1.h(sel,{key:key,hook:{init:init,prepatch:prepatch},fn:fn,args:args})}exports.thunk=thunk;exports.default=thunk},{"snabbdom/h":78}],55:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function isValidNode(obj){var ELEM_TYPE=1;var FRAG_TYPE=11;return typeof HTMLElement==="object"?obj instanceof HTMLElement||obj instanceof DocumentFragment:obj&&typeof obj==="object"&&obj!==null&&(obj.nodeType===ELEM_TYPE||obj.nodeType===FRAG_TYPE)&&typeof obj.nodeName==="string"}function isClassOrId(str){return str.length>1&&(str[0]==="."||str[0]==="#")}exports.isClassOrId=isClassOrId;function isDocFrag(el){return el.nodeType===11}exports.isDocFrag=isDocFrag;function checkValidContainer(container){if(typeof container!=="string"&&!isValidNode(container)){throw new Error("Given container is not a DOM element neither a selector string.")}}exports.checkValidContainer=checkValidContainer;function getValidNode(selectors){var domElement=typeof selectors==="string"?document.querySelector(selectors):selectors;if(typeof selectors==="string"&&domElement===null){throw new Error("Cannot render into unknown element `"+selectors+"`")}return domElement}exports.getValidNode=getValidNode;function getSelectors(namespace){var res="";for(var i=namespace.length-1;i>=0;i--){if(namespace[i].type!=="selector"){break}res=namespace[i].scope+" "+res}return res.trim()}exports.getSelectors=getSelectors
;function isEqualNamespace(a,b){if(!Array.isArray(a)||!Array.isArray(b)||a.length!==b.length){return false}for(var i=0;i<a.length;i++){if(a[i].type!==b[i].type||a[i].scope!==b[i].scope){return false}}return true}exports.isEqualNamespace=isEqualNamespace;function makeInsert(map){return function(type,elm,value){if(map.has(type)){var innerMap=map.get(type);innerMap.set(elm,value)}else{var innerMap=new Map;innerMap.set(elm,value);map.set(type,innerMap)}}}exports.makeInsert=makeInsert},{}],56:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var adapt_1=require("@cycle/run/lib/adapt");function checkIsolateArgs(dataflowComponent,scope){if(typeof dataflowComponent!=="function"){throw new Error("First argument given to isolate() must be a "+"'dataflowComponent' function")}if(scope===null){throw new Error("Second argument given to isolate() must not be null")}}function normalizeScopes(sources,scopes,randomScope){var perChannel={};Object.keys(sources).forEach(function(channel){if(typeof scopes==="string"){perChannel[channel]=scopes;return}var candidate=scopes[channel];if(typeof candidate!=="undefined"){perChannel[channel]=candidate;return}var wildcard=scopes["*"];if(typeof wildcard!=="undefined"){perChannel[channel]=wildcard;return}perChannel[channel]=randomScope});return perChannel}function isolateAllSources(outerSources,scopes){var innerSources={};for(var channel in outerSources){var outerSource=outerSources[channel];if(outerSources.hasOwnProperty(channel)&&outerSource&&scopes[channel]!==null&&typeof outerSource.isolateSource==="function"){innerSources[channel]=outerSource.isolateSource(outerSource,scopes[channel])}else if(outerSources.hasOwnProperty(channel)){innerSources[channel]=outerSources[channel]}}return innerSources}function isolateAllSinks(sources,innerSinks,scopes){var outerSinks={};for(var channel in innerSinks){var source=sources[channel];var innerSink=innerSinks[channel];if(innerSinks.hasOwnProperty(channel)&&source&&scopes[channel]!==null&&typeof source.isolateSink==="function"){outerSinks[channel]=adapt_1.adapt(source.isolateSink(xstream_1.default.fromObservable(innerSink),scopes[channel]))}else if(innerSinks.hasOwnProperty(channel)){outerSinks[channel]=innerSinks[channel]}}return outerSinks}var counter=0;function newScope(){return"cycle"+ ++counter}function isolate(component,scope){if(scope===void 0){scope=newScope()}checkIsolateArgs(component,scope);var randomScope=typeof scope==="object"?newScope():"";var scopes=typeof scope==="string"||typeof scope==="object"?scope:scope.toString();return function wrappedComponent(outerSources){var rest=[];for(var _i=1;_i<arguments.length;_i++){rest[_i-1]=arguments[_i]}var scopesPerChannel=normalizeScopes(outerSources,scopes,randomScope);var innerSources=isolateAllSources(outerSources,scopesPerChannel);var innerSinks=component.apply(void 0,[innerSources].concat(rest));var outerSinks=isolateAllSinks(outerSources,innerSinks,scopesPerChannel);return outerSinks}}isolate.reset=function(){return counter=0};exports.default=isolate;function toIsolated(scope){if(scope===void 0){scope=newScope()}return function(component){return isolate(component,scope)}}exports.toIsolated=toIsolated},{"@cycle/run/lib/adapt":57,xstream:107}],57:[function(require,module,exports){(function(global){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function getGlobal(){var globalObj;if(typeof window!=="undefined"){globalObj=window}else if(typeof global!=="undefined"){globalObj=global}else{globalObj=this}globalObj.Cyclejs=globalObj.Cyclejs||{};globalObj=globalObj.Cyclejs;globalObj.adaptStream=globalObj.adaptStream||function(x){return x};return globalObj}function setAdapt(f){getGlobal().adaptStream=f}exports.setAdapt=setAdapt;function adapt(stream){return getGlobal().adaptStream(stream)}exports.adapt=adapt}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],58:[function(require,module,exports){arguments[4][57][0].apply(exports,arguments)},{dup:57}],59:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var internals_1=require("./internals");function setup(main,drivers){if(typeof main!=="function"){throw new Error("First argument given to Cycle must be the 'main' "+"function.")}if(typeof drivers!=="object"||drivers===null){throw new Error("Second argument given to Cycle must be an object "+"with driver functions as properties.")}if(internals_1.isObjectEmpty(drivers)){throw new Error("Second argument given to Cycle must be an object "+"with at least one driver function declared as a property.")}var engine=setupReusable(drivers);var sinks=main(engine.sources);if(typeof window!=="undefined"){window.Cyclejs=window.Cyclejs||{};window.Cyclejs.sinks=sinks}function _run(){var disposeRun=engine.run(sinks);return function dispose(){disposeRun();engine.dispose()}}return{sinks:sinks,sources:engine.sources,run:_run}}exports.setup=setup;function setupReusable(drivers){if(typeof drivers!=="object"||drivers===null){throw new Error("Argument given to setupReusable must be an object "+"with driver functions as properties.")}if(internals_1.isObjectEmpty(drivers)){throw new Error("Argument given to setupReusable must be an object "+"with at least one driver function declared as a property.")}var sinkProxies=internals_1.makeSinkProxies(drivers);var rawSources=internals_1.callDrivers(drivers,sinkProxies);var sources=internals_1.adaptSources(rawSources);function _run(sinks){return internals_1.replicateMany(sinks,sinkProxies)}function disposeEngine(){internals_1.disposeSources(sources);internals_1.disposeSinkProxies(sinkProxies)}return{sources:sources,run:_run,dispose:disposeEngine}}exports.setupReusable=setupReusable;function run(main,drivers){var program=setup(main,drivers);if(typeof window!=="undefined"&&window["CyclejsDevTool_startGraphSerializer"]){window["CyclejsDevTool_startGraphSerializer"](program.sinks)}return program.run()}exports.run=run;exports.default=run},{"./internals":60}],60:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var quicktask_1=require("quicktask");var adapt_1=require("./adapt");var scheduleMicrotask=quicktask_1.default();function makeSinkProxies(drivers){var sinkProxies={};for(var name_1 in drivers){if(drivers.hasOwnProperty(name_1)){sinkProxies[name_1]=xstream_1.default.create()}}return sinkProxies}exports.makeSinkProxies=makeSinkProxies;function callDrivers(drivers,sinkProxies){var sources={};for(var name_2 in drivers){if(drivers.hasOwnProperty(name_2)){sources[name_2]=drivers[name_2](sinkProxies[name_2],name_2);if(sources[name_2]&&typeof sources[name_2]==="object"){sources[name_2]._isCycleSource=name_2}}}return sources}exports.callDrivers=callDrivers;function adaptSources(sources){for(var name_3 in sources){if(sources.hasOwnProperty(name_3)&&sources[name_3]&&typeof sources[name_3]["shamefullySendNext"]==="function"){sources[name_3]=adapt_1.adapt(sources[name_3])}}return sources}exports.adaptSources=adaptSources;function replicateMany(sinks,sinkProxies){var sinkNames=Object.keys(sinks).filter(function(name){return!!sinkProxies[name]});var buffers={};var replicators={};sinkNames.forEach(function(name){buffers[name]={_n:[],_e:[]};replicators[name]={next:function(x){return buffers[name]._n.push(x)},error:function(err){return buffers[name]._e.push(err)},complete:function(){}}});var subscriptions=sinkNames.map(function(name){return xstream_1.default.fromObservable(sinks[name]).subscribe(replicators[name])});sinkNames.forEach(function(name){var listener=sinkProxies[name];var next=function(x){scheduleMicrotask(function(){return listener._n(x)})};var error=function(err){scheduleMicrotask(function(){(console.error||console.log)(err);listener._e(err)})};buffers[name]._n.forEach(next);buffers[name]._e.forEach(error);replicators[name].next=next;replicators[name].error=error;replicators[name]._n=next;replicators[name]._e=error});buffers=null;return function disposeReplication(){subscriptions.forEach(function(s){return s.unsubscribe()})}}exports.replicateMany=replicateMany;function disposeSinkProxies(sinkProxies){Object.keys(sinkProxies).forEach(function(name){return sinkProxies[name]._c()})}exports.disposeSinkProxies=disposeSinkProxies;function disposeSources(sources){for(var k in sources){if(sources.hasOwnProperty(k)&&sources[k]&&sources[k].dispose){sources[k].dispose()}}}exports.disposeSources=disposeSources;function isObjectEmpty(obj){return Object.keys(obj).length===0}exports.isObjectEmpty=isObjectEmpty},{"./adapt":58,quicktask:70,xstream:107}],61:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var adapt_1=require("@cycle/run/lib/adapt");var isolate_1=require("@cycle/isolate");var pickMerge_1=require("./pickMerge");var pickCombine_1=require("./pickCombine");var Instances=function(){function Instances(instances$){this._instances$=instances$}Instances.prototype.pickMerge=function(selector){return adapt_1.adapt(this._instances$.compose(pickMerge_1.pickMerge(selector)))};Instances.prototype.pickCombine=function(selector){return adapt_1.adapt(this._instances$.compose(pickCombine_1.pickCombine(selector)))};return Instances}();exports.Instances=Instances;function defaultItemScope(key){return{"*":null}}function instanceLens(itemKey,key){return{get:function(arr){if(typeof arr==="undefined"){return void 0}else{for(var i=0,n=arr.length;i<n;++i){if(""+itemKey(arr[i],i)===key){return arr[i]}}return void 0}},set:function(arr,item){if(typeof arr==="undefined"){return[item]}else if(typeof item==="undefined"){return arr.filter(function(s,i){return""+itemKey(s,i)!==key})}else{return arr.map(function(s,i){if(""+itemKey(s,i)===key){return item}else{return s}})}}}}var identityLens={get:function(outer){return outer},set:function(outer,inner){return inner}};function makeCollection(opts){return function collectionComponent(sources){var name=opts.channel||"onion";var itemKey=opts.itemKey;var itemScope=opts.itemScope||defaultItemScope;var itemComp=opts.item;var state$=xstream_1.default.fromObservable(sources[name].state$);var instances$=state$.fold(function(acc,nextState){var dict=acc.dict;if(Array.isArray(nextState)){var nextInstArray=Array(nextState.length);var nextKeys_1=new Set;for(var i=0,n=nextState.length;i<n;++i){var key=""+(itemKey?itemKey(nextState[i],i):i);nextKeys_1.add(key);if(!dict.has(key)){var onionScope=itemKey?instanceLens(itemKey,key):""+i;var otherScopes=itemScope(key);var scopes=typeof otherScopes==="string"?(_a={"*":otherScopes},_a[name]=onionScope,_a):__assign({},otherScopes,(_b={},_b[name]=onionScope,_b));var sinks=isolate_1.default(itemComp,scopes)(sources);dict.set(key,sinks);nextInstArray[i]=sinks}else{nextInstArray[i]=dict.get(key)}nextInstArray[i]._key=key}dict.forEach(function(_,key){if(!nextKeys_1.has(key)){dict.delete(key)}});nextKeys_1.clear();return{dict:dict,arr:nextInstArray}}else{dict.clear();var key=""+(itemKey?itemKey(nextState,0):"this");var onionScope=identityLens;var otherScopes=itemScope(key);var scopes=typeof otherScopes==="string"?(_c={"*":otherScopes},_c[name]=onionScope,_c):__assign({},otherScopes,(_d={},_d[name]=onionScope,_d));var sinks=isolate_1.default(itemComp,scopes)(sources);dict.set(key,sinks);return{dict:dict,arr:[sinks]}}var _a,_b,_c,_d},{dict:new Map,arr:[]});return opts.collectSinks(new Instances(instances$))}}exports.makeCollection=makeCollection},{"./pickCombine":65,"./pickMerge":66,"@cycle/isolate":56,"@cycle/run/lib/adapt":57,xstream:107}],62:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var dropRepeats_1=require("xstream/extra/dropRepeats");var adapt_1=require("@cycle/run/lib/adapt");function updateArrayEntry(array,scope,newVal){if(newVal===array[scope]){return array}var index=parseInt(scope);if(typeof newVal==="undefined"){return array.filter(function(val,i){return i!==index})}return array.map(function(val,i){return i===index?newVal:val})}function makeGetter(scope){if(typeof scope==="string"||typeof scope==="number"){return function lensGet(state){if(typeof state==="undefined"){return void 0}else{return state[scope]}}}else{return scope.get}}function makeSetter(scope){if(typeof scope==="string"||typeof scope==="number"){return function lensSet(state,childState){if(Array.isArray(state)){return updateArrayEntry(state,scope,childState)}else if(typeof state==="undefined"){return _a={},_a[scope]=childState,_a}else{return __assign({},state,(_b={},_b[scope]=childState,_b))}var _a,_b}}else{return scope.set}}function isolateSource(source,scope){return source.select(scope)}exports.isolateSource=isolateSource;function isolateSink(innerReducer$,scope){var get=makeGetter(scope);var set=makeSetter(scope);return innerReducer$.map(function(innerReducer){return function outerReducer(outer){var prevInner=get(outer);var nextInner=innerReducer(prevInner);if(prevInner===nextInner){return outer}else{return set(outer,nextInner)}}})}exports.isolateSink=isolateSink;var StateSource=function(){function StateSource(stream,name){this.isolateSource=isolateSource;this.isolateSink=isolateSink;this._state$=stream.filter(function(s){return typeof s!=="undefined"}).compose(dropRepeats_1.default()).remember();this._name=name;this.state$=adapt_1.adapt(this._state$);this._state$._isCycleSource=name}StateSource.prototype.select=function(scope){var get=makeGetter(scope);return new StateSource(this._state$.map(get),this._name)};return StateSource}();exports.StateSource=StateSource},{"@cycle/run/lib/adapt":57,"xstream/extra/dropRepeats":104}],63:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var onionify_1=require("./onionify");var StateSource_1=require("./StateSource");exports.StateSource=StateSource_1.StateSource;exports.isolateSource=StateSource_1.isolateSource;exports.isolateSink=StateSource_1.isolateSink;var Collection_1=require("./Collection");exports.Instances=Collection_1.Instances;exports.makeCollection=Collection_1.makeCollection;var pickMerge_1=require("./pickMerge");exports.pickMerge=pickMerge_1.pickMerge;var pickCombine_1=require("./pickCombine");exports.pickCombine=pickCombine_1.pickCombine;exports.default=onionify_1.onionify},{"./Collection":61,"./StateSource":62,"./onionify":64,"./pickCombine":65,"./pickMerge":66}],64:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var concat_1=require("xstream/extra/concat");var StateSource_1=require("./StateSource");var quicktask_1=require("quicktask");var schedule=quicktask_1.default();function onionify(main,name){if(name===void 0){name="onion"}return function mainOnionified(sources){var reducerMimic$=xstream_1.default.create();var state$=reducerMimic$.fold(function(state,reducer){return reducer(state)},void 0).drop(1);sources[name]=new StateSource_1.StateSource(state$,name);var sinks=main(sources);if(sinks[name]){var stream$=concat_1.default(xstream_1.default.fromObservable(sinks[name]),xstream_1.default.never());stream$.subscribe({next:function(i){return schedule(function(){return reducerMimic$._n(i)})},error:function(err){return schedule(function(){return reducerMimic$._e(err)})},complete:function(){return schedule(function(){return reducerMimic$._c()})}})}return sinks}}exports.onionify=onionify},{"./StateSource":62,quicktask:70,xstream:107,"xstream/extra/concat":102}],65:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var PickCombineListener=function(){function PickCombineListener(key,out,p,ins){this.key=key;this.out=out;this.p=p;this.val=xstream_1.NO;this.ins=ins}PickCombineListener.prototype._n=function(t){var p=this.p,out=this.out;this.val=t;if(out===null){return}this.p.up()};PickCombineListener.prototype._e=function(err){var out=this.out;if(out===null){return}out._e(err)};PickCombineListener.prototype._c=function(){};return PickCombineListener}();var PickCombine=function(){function PickCombine(sel,ins){this.type="combine";this.ins=ins;this.sel=sel;this.out=null;this.ils=new Map;this.inst=null}PickCombine.prototype._start=function(out){this.out=out;this.ins._add(this)};PickCombine.prototype._stop=function(){this.ins._remove(this);var ils=this.ils;ils.forEach(function(il){il.ins._remove(il);il.ins=null;il.out=null;il.val=null});ils.clear();this.out=null;this.ils=new Map;this.inst=null};PickCombine.prototype.up=function(){var arr=this.inst.arr;var n=arr.length;var ils=this.ils;var outArr=Array(n);for(var i=0;i<n;++i){var sinks=arr[i];var key=sinks._key;if(!ils.has(key)){return}var val=ils.get(key).val;if(val===xstream_1.NO){return}outArr[i]=val}this.out._n(outArr)};PickCombine.prototype._n=function(inst){this.inst=inst;var arrSinks=inst.arr;var ils=this.ils;var out=this.out;var sel=this.sel;var dict=inst.dict;var n=arrSinks.length;var removed=false;ils.forEach(function(il,key){if(!dict.has(key)){il.ins._remove(il);il.ins=null;il.out=null;il.val=null;ils.delete(key);removed=true}});if(n===0){out._n([]);return}for(var i=0;i<n;++i){var sinks=arrSinks[i];var key=sinks._key;if(!sinks[sel]){throw new Error("pickCombine found an undefined child sink stream")}var sink=xstream_1.default.fromObservable(sinks[sel]);if(!ils.has(key)){ils.set(key,new PickCombineListener(key,out,this,sink));sink._add(ils.get(key))}}if(removed){this.up()}};PickCombine.prototype._e=function(e){var out=this.out;if(out===null){return}out._e(e)};PickCombine.prototype._c=function(){var out=this.out;if(out===null){return}out._c()};return PickCombine}();function pickCombine(selector){return function pickCombineOperator(inst$){return new xstream_1.Stream(new PickCombine(selector,inst$))}}exports.pickCombine=pickCombine},{xstream:107}],66:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xstream_1=require("xstream");var PickMergeListener=function(){function PickMergeListener(out,p,ins){this.ins=ins;this.out=out;this.p=p}PickMergeListener.prototype._n=function(t){var p=this.p,out=this.out;if(out===null){return}out._n(t)};PickMergeListener.prototype._e=function(err){var out=this.out;if(out===null){return}out._e(err)};PickMergeListener.prototype._c=function(){};return PickMergeListener}();var PickMerge=function(){function PickMerge(sel,ins){this.type="pickMerge";this.ins=ins;this.out=null;this.sel=sel;this.ils=new Map;this.inst=null}PickMerge.prototype._start=function(out){this.out=out;this.ins._add(this)};PickMerge.prototype._stop=function(){this.ins._remove(this);var ils=this.ils;ils.forEach(function(il,key){il.ins._remove(il);il.ins=null;il.out=null;ils.delete(key)});ils.clear();this.out=null;this.ils=new Map;this.inst=null};PickMerge.prototype._n=function(inst){this.inst=inst;var arrSinks=inst.arr;var ils=this.ils;var out=this.out;var sel=this.sel;var n=arrSinks.length;for(var i=0;i<n;++i){var sinks=arrSinks[i];var key=sinks._key;var sink=xstream_1.default.fromObservable(sinks[sel]||xstream_1.default.never());if(!ils.has(key)){ils.set(key,new PickMergeListener(out,this,sink));sink._add(ils.get(key))}}ils.forEach(function(il,key){if(!inst.dict.has(key)||!inst.dict.get(key)){il.ins._remove(il);il.ins=null;il.out=null;ils.delete(key)}})};PickMerge.prototype._e=function(err){var u=this.out;if(u===null)return;u._e(err)};PickMerge.prototype._c=function(){var u=this.out;if(u===null)return;u._c()};return PickMerge}();function pickMerge(selector){return function pickMergeOperator(inst$){return new xstream_1.Stream(new PickMerge(selector,inst$))}}exports.pickMerge=pickMerge},{xstream:107}],67:[function(require,module,exports){(function(process){"use strict";var __extends=this&&this.__extends||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p];function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)};var instanceId=0;var uniqueId=0;exports.IS_UNIQUE="__DO_NOT_DEDUPE_STYLE__";var CSS_NUMBER={"animation-iteration-count":true,"box-flex":true,"box-flex-group":true,"column-count":true,"counter-increment":true,"counter-reset":true,flex:true,"flex-grow":true,"flex-positive":true,"flex-shrink":true,"flex-negative":true,"font-weight":true,"line-clamp":true,"line-height":true,opacity:true,order:true,orphans:true,"tab-size":true,widows:true,"z-index":true,zoom:true,"fill-opacity":true,"stroke-dashoffset":true,"stroke-opacity":true,"stroke-width":true};for(var _i=0,_a=["-webkit-","-ms-","-moz-","-o-"];_i<_a.length;_i++){var prefix=_a[_i];for(var _b=0,_c=Object.keys(CSS_NUMBER);_b<_c.length;_b++){var property=_c[_b];CSS_NUMBER[prefix+property]=true}}function hyphenate(propertyName){return propertyName.replace(/([A-Z])/g,"-$1").replace(/^ms-/,"-ms-").toLowerCase()}function isAtRule(propertyName){return propertyName.charAt(0)==="@"}function isNestedStyle(value){return value!=null&&typeof value==="object"&&!Array.isArray(value)}function stringHash(str){var value=5381;var i=str.length;while(i){value=value*33^str.charCodeAt(--i)}return(value>>>0).toString(36)}exports.stringHash=stringHash;function styleToString(name,value){if(typeof value==="number"&&value!==0&&!CSS_NUMBER[name]){value=value+"px"}return name+":"+String(value).replace(/([\{\}\[\]])/g,"\\$1")}function sortTuples(value){return value.sort(function(a,b){return a[0]>b[0]?1:-1})}function parseUserStyles(styles,hasNestedStyles){var properties=[];var nestedStyles=[];var isUnique=false;for(var _i=0,_a=Object.keys(styles);_i<_a.length;_i++){var key=_a[_i];var value=styles[key];if(key===exports.IS_UNIQUE){isUnique=!!value}else if(isNestedStyle(value)){nestedStyles.push([key.trim(),value])}else{properties.push([hyphenate(key.trim()),value])}}return{properties:sortTuples(properties),nestedStyles:hasNestedStyles?nestedStyles:sortTuples(nestedStyles),isUnique:isUnique}}function stringifyProperties(properties){var result=[];var _loop_1=function(name_1,value){if(value!=null){if(Array.isArray(value)){result.push(value.filter(function(x){return x!=null}).map(function(x){return styleToString(name_1,x)}).join(";"))}else{result.push(styleToString(name_1,value))}}};for(var _i=0,properties_1=properties;_i<properties_1.length;_i++){var _a=properties_1[_i],name_1=_a[0],value=_a[1];_loop_1(name_1,value)}return result.join(";")}function interpolate(selector,parent){if(selector.indexOf("&")>-1){return selector.replace(/&/g,parent)}return parent+" "+selector}function collectHashedStyles(container,userStyles,isStyle,displayName){var styles=[];function stylize(cache,userStyles,selector){var _a=parseUserStyles(userStyles,isStyle),properties=_a.properties,nestedStyles=_a.nestedStyles,isUnique=_a.isUnique;var styleString=stringifyProperties(properties);var pid=styleString;if(styleString){var style=new Style(styleString,cache.hash,isUnique?"u"+(++uniqueId).toString(36):undefined);cache.add(style);styles.push([cache,selector,style])}for(var _i=0,nestedStyles_1=nestedStyles;_i<nestedStyles_1.length;_i++){var _b=nestedStyles_1[_i],name_2=_b[0],value=_b[1];pid+=name_2;if(isAtRule(name_2)){var rule=cache.add(new Rule(name_2,undefined,cache.hash));pid+=stylize(rule,value,selector)}else{pid+=stylize(cache,value,isStyle?interpolate(name_2,selector):name_2)}}return pid}var cache=new Cache(container.hash);var pid=stylize(cache,userStyles,"&");var hash="f"+cache.hash(pid);var id=displayName?displayName+"_"+hash:hash;for(var _i=0,styles_1=styles;_i<styles_1.length;_i++){var _a=styles_1[_i],cache_1=_a[0],selector=_a[1],style=_a[2];var key=isStyle?interpolate(selector,"."+id):selector;cache_1.get(style).add(new Selector(key,style.hash,undefined,pid))}container.merge(cache);return{pid:pid,id:id}}function registerUserStyles(container,styles,displayName){return collectHashedStyles(container,styles,true,displayName).id}function registerUserRule(container,selector,styles){var _a=parseUserStyles(styles,false),properties=_a.properties,nestedStyles=_a.nestedStyles,isUnique=_a.isUnique;if(properties.length&&nestedStyles.length){throw new TypeError("Registering a CSS rule can not use properties with nested styles")}var styleString=stringifyProperties(properties);var rule=new Rule(selector,styleString,container.hash,isUnique?"u"+(++uniqueId).toString(36):undefined);for(var _i=0,nestedStyles_2=nestedStyles;_i<nestedStyles_2.length;_i++){var _b=nestedStyles_2[_i],name_3=_b[0],value=_b[1];registerUserRule(rule,name_3,value)}container.add(rule)}function registerUserHashedRule(container,prefix,styles,displayName){var bucket=new Cache(container.hash);var _a=collectHashedStyles(bucket,styles,false,displayName),pid=_a.pid,id=_a.id;var atRule=new Rule(prefix+" "+id,undefined,container.hash,undefined,pid);atRule.merge(bucket);container.add(atRule);return id}function getStyles(container){return container.values().map(function(style){return style.getStyles()}).join("")}var Cache=function(){function Cache(hash){this.hash=hash;this.changeId=0;this._children={};this._keys=[];this._counts={}}Cache.prototype.values=function(){var _this=this;return this._keys.map(function(x){return _this._children[x]})};Cache.prototype.add=function(style){var count=this._counts[style.id]||0;var item=this._children[style.id]||style.clone();this._counts[style.id]=count+1;if(count===0){this._keys.push(item.id);this._children[item.id]=item;this.changeId++}else{if(item.getIdentifier()!==style.getIdentifier()){throw new TypeError("Hash collision: "+style.getStyles()+" === "+item.getStyles())}this._keys.splice(this._keys.indexOf(style.id),1);this._keys.push(style.id);if(item instanceof Cache&&style instanceof Cache){var prevChangeId=item.changeId;item.merge(style);if(item.changeId!==prevChangeId){this.changeId++}}}return item};Cache.prototype.remove=function(style){var count=this._counts[style.id];if(count>0){this._counts[style.id]=count-1;var item=this._children[style.id];if(count===1){delete this._counts[style.id];delete this._children[style.id];this._keys.splice(this._keys.indexOf(style.id),1);this.changeId++}else if(item instanceof Cache&&style instanceof Cache){var prevChangeId=item.changeId;item.unmerge(style);if(item.changeId!==prevChangeId){this.changeId++}}}};Cache.prototype.get=function(container){return this._children[container.id]};Cache.prototype.merge=function(cache){for(var _i=0,_a=cache.values();_i<_a.length;_i++){var value=_a[_i];this.add(value)}return this};Cache.prototype.unmerge=function(cache){for(var _i=0,_a=cache.values();_i<_a.length;_i++){var value=_a[_i];this.remove(value)}return this};Cache.prototype.clone=function(){return new Cache(this.hash).merge(this)};return Cache}();exports.Cache=Cache;var Selector=function(){function Selector(selector,hash,id,pid){if(id===void 0){id="s"+hash(selector)}if(pid===void 0){pid=""}this.selector=selector;this.hash=hash;this.id=id;this.pid=pid}Selector.prototype.getStyles=function(){return this.selector};Selector.prototype.getIdentifier=function(){return this.pid+"."+this.selector};Selector.prototype.clone=function(){return new Selector(this.selector,this.hash,this.id,this.pid)};return Selector}();exports.Selector=Selector;var Style=function(_super){__extends(Style,_super);function Style(style,hash,id){if(id===void 0){id="c"+hash(style)}var _this=_super.call(this,hash)||this;_this.style=style;_this.hash=hash;_this.id=id;return _this}Style.prototype.getStyles=function(){return this.values().map(function(x){return x.selector}).join(",")+"{"+this.style+"}"};Style.prototype.getIdentifier=function(){return this.style};Style.prototype.clone=function(){return new Style(this.style,this.hash,this.id).merge(this)};return Style}(Cache);exports.Style=Style;var Rule=function(_super){__extends(Rule,_super);function Rule(rule,style,hash,id,pid){if(style===void 0){style=""}if(id===void 0){id="a"+hash(rule+"."+style)}if(pid===void 0){pid=""}var _this=_super.call(this,hash)||this;_this.rule=rule;_this.style=style;_this.hash=hash;_this.id=id;_this.pid=pid;return _this}Rule.prototype.getStyles=function(){return this.rule+"{"+this.style+getStyles(this)+"}"};Rule.prototype.getIdentifier=function(){return this.pid+"."+this.rule+"."+this.style};Rule.prototype.clone=function(){return new Rule(this.rule,this.style,this.hash,this.id,this.pid).merge(this)};return Rule}(Cache);exports.Rule=Rule;var FreeStyle=function(_super){__extends(FreeStyle,_super);function FreeStyle(hash,debug,id){if(id===void 0){id="f"+(++instanceId).toString(36)}var _this=_super.call(this,hash)||this;_this.hash=hash;_this.debug=debug;_this.id=id;return _this}FreeStyle.prototype.registerStyle=function(styles,displayName){return registerUserStyles(this,styles,this.debug?displayName:undefined)};FreeStyle.prototype.registerKeyframes=function(keyframes,displayName){return registerUserHashedRule(this,"@keyframes",keyframes,this.debug?displayName:undefined)};FreeStyle.prototype.registerRule=function(rule,styles){return registerUserRule(this,rule,styles)};FreeStyle.prototype.getStyles=function(){return getStyles(this)};FreeStyle.prototype.getIdentifier=function(){return this.id};FreeStyle.prototype.clone=function(){return new FreeStyle(this.hash,this.debug,this.id).merge(this)};return FreeStyle}(Cache);exports.FreeStyle=FreeStyle;function create(hash,debug){if(hash===void 0){hash=stringHash}if(debug===void 0){debug=process.env.NODE_ENV!=="production"}return new FreeStyle(hash,debug)}exports.create=create}).call(this,require("_process"))},{_process:69}],68:[function(require,module,exports){(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory():typeof define==="function"&&define.amd?define(factory):global.Immutable=factory()})(this,function(){"use strict";var SLICE$0=Array.prototype.slice;function createClass(ctor,superClass){if(superClass){ctor.prototype=Object.create(superClass.prototype)}ctor.prototype.constructor=ctor}function Iterable(value){return isIterable(value)?value:Seq(value)}createClass(KeyedIterable,Iterable);function KeyedIterable(value){return isKeyed(value)?value:KeyedSeq(value)}createClass(IndexedIterable,Iterable);function IndexedIterable(value){return isIndexed(value)?value:IndexedSeq(value)}createClass(SetIterable,Iterable);function SetIterable(value){return isIterable(value)&&!isAssociative(value)?value:SetSeq(value)}function isIterable(maybeIterable){return!!(maybeIterable&&maybeIterable[IS_ITERABLE_SENTINEL])}function isKeyed(maybeKeyed){return!!(maybeKeyed&&maybeKeyed[IS_KEYED_SENTINEL])}function isIndexed(maybeIndexed){return!!(maybeIndexed&&maybeIndexed[IS_INDEXED_SENTINEL])}function isAssociative(maybeAssociative){return isKeyed(maybeAssociative)||isIndexed(maybeAssociative)}function isOrdered(maybeOrdered){return!!(maybeOrdered&&maybeOrdered[IS_ORDERED_SENTINEL])}Iterable.isIterable=isIterable;Iterable.isKeyed=isKeyed;Iterable.isIndexed=isIndexed;Iterable.isAssociative=isAssociative;Iterable.isOrdered=isOrdered;Iterable.Keyed=KeyedIterable;Iterable.Indexed=IndexedIterable;Iterable.Set=SetIterable;var IS_ITERABLE_SENTINEL="@@__IMMUTABLE_ITERABLE__@@";var IS_KEYED_SENTINEL="@@__IMMUTABLE_KEYED__@@";var IS_INDEXED_SENTINEL="@@__IMMUTABLE_INDEXED__@@";var IS_ORDERED_SENTINEL="@@__IMMUTABLE_ORDERED__@@";var DELETE="delete";var SHIFT=5;var SIZE=1<<SHIFT;var MASK=SIZE-1;var NOT_SET={};var CHANGE_LENGTH={value:false};var DID_ALTER={value:false};function MakeRef(ref){ref.value=false;return ref}function SetRef(ref){ref&&(ref.value=true)}function OwnerID(){}
function arrCopy(arr,offset){offset=offset||0;var len=Math.max(0,arr.length-offset);var newArr=new Array(len);for(var ii=0;ii<len;ii++){newArr[ii]=arr[ii+offset]}return newArr}function ensureSize(iter){if(iter.size===undefined){iter.size=iter.__iterate(returnTrue)}return iter.size}function wrapIndex(iter,index){if(typeof index!=="number"){var uint32Index=index>>>0;if(""+uint32Index!==index||uint32Index===4294967295){return NaN}index=uint32Index}return index<0?ensureSize(iter)+index:index}function returnTrue(){return true}function wholeSlice(begin,end,size){return(begin===0||size!==undefined&&begin<=-size)&&(end===undefined||size!==undefined&&end>=size)}function resolveBegin(begin,size){return resolveIndex(begin,size,0)}function resolveEnd(end,size){return resolveIndex(end,size,size)}function resolveIndex(index,size,defaultIndex){return index===undefined?defaultIndex:index<0?Math.max(0,size+index):size===undefined?index:Math.min(size,index)}var ITERATE_KEYS=0;var ITERATE_VALUES=1;var ITERATE_ENTRIES=2;var REAL_ITERATOR_SYMBOL=typeof Symbol==="function"&&Symbol.iterator;var FAUX_ITERATOR_SYMBOL="@@iterator";var ITERATOR_SYMBOL=REAL_ITERATOR_SYMBOL||FAUX_ITERATOR_SYMBOL;function Iterator(next){this.next=next}Iterator.prototype.toString=function(){return"[Iterator]"};Iterator.KEYS=ITERATE_KEYS;Iterator.VALUES=ITERATE_VALUES;Iterator.ENTRIES=ITERATE_ENTRIES;Iterator.prototype.inspect=Iterator.prototype.toSource=function(){return this.toString()};Iterator.prototype[ITERATOR_SYMBOL]=function(){return this};function iteratorValue(type,k,v,iteratorResult){var value=type===0?k:type===1?v:[k,v];iteratorResult?iteratorResult.value=value:iteratorResult={value:value,done:false};return iteratorResult}function iteratorDone(){return{value:undefined,done:true}}function hasIterator(maybeIterable){return!!getIteratorFn(maybeIterable)}function isIterator(maybeIterator){return maybeIterator&&typeof maybeIterator.next==="function"}function getIterator(iterable){var iteratorFn=getIteratorFn(iterable);return iteratorFn&&iteratorFn.call(iterable)}function getIteratorFn(iterable){var iteratorFn=iterable&&(REAL_ITERATOR_SYMBOL&&iterable[REAL_ITERATOR_SYMBOL]||iterable[FAUX_ITERATOR_SYMBOL]);if(typeof iteratorFn==="function"){return iteratorFn}}function isArrayLike(value){return value&&typeof value.length==="number"}createClass(Seq,Iterable);function Seq(value){return value===null||value===undefined?emptySequence():isIterable(value)?value.toSeq():seqFromValue(value)}Seq.of=function(){return Seq(arguments)};Seq.prototype.toSeq=function(){return this};Seq.prototype.toString=function(){return this.__toString("Seq {","}")};Seq.prototype.cacheResult=function(){if(!this._cache&&this.__iterateUncached){this._cache=this.entrySeq().toArray();this.size=this._cache.length}return this};Seq.prototype.__iterate=function(fn,reverse){return seqIterate(this,fn,reverse,true)};Seq.prototype.__iterator=function(type,reverse){return seqIterator(this,type,reverse,true)};createClass(KeyedSeq,Seq);function KeyedSeq(value){return value===null||value===undefined?emptySequence().toKeyedSeq():isIterable(value)?isKeyed(value)?value.toSeq():value.fromEntrySeq():keyedSeqFromValue(value)}KeyedSeq.prototype.toKeyedSeq=function(){return this};createClass(IndexedSeq,Seq);function IndexedSeq(value){return value===null||value===undefined?emptySequence():!isIterable(value)?indexedSeqFromValue(value):isKeyed(value)?value.entrySeq():value.toIndexedSeq()}IndexedSeq.of=function(){return IndexedSeq(arguments)};IndexedSeq.prototype.toIndexedSeq=function(){return this};IndexedSeq.prototype.toString=function(){return this.__toString("Seq [","]")};IndexedSeq.prototype.__iterate=function(fn,reverse){return seqIterate(this,fn,reverse,false)};IndexedSeq.prototype.__iterator=function(type,reverse){return seqIterator(this,type,reverse,false)};createClass(SetSeq,Seq);function SetSeq(value){return(value===null||value===undefined?emptySequence():!isIterable(value)?indexedSeqFromValue(value):isKeyed(value)?value.entrySeq():value).toSetSeq()}SetSeq.of=function(){return SetSeq(arguments)};SetSeq.prototype.toSetSeq=function(){return this};Seq.isSeq=isSeq;Seq.Keyed=KeyedSeq;Seq.Set=SetSeq;Seq.Indexed=IndexedSeq;var IS_SEQ_SENTINEL="@@__IMMUTABLE_SEQ__@@";Seq.prototype[IS_SEQ_SENTINEL]=true;createClass(ArraySeq,IndexedSeq);function ArraySeq(array){this._array=array;this.size=array.length}ArraySeq.prototype.get=function(index,notSetValue){return this.has(index)?this._array[wrapIndex(this,index)]:notSetValue};ArraySeq.prototype.__iterate=function(fn,reverse){var array=this._array;var maxIndex=array.length-1;for(var ii=0;ii<=maxIndex;ii++){if(fn(array[reverse?maxIndex-ii:ii],ii,this)===false){return ii+1}}return ii};ArraySeq.prototype.__iterator=function(type,reverse){var array=this._array;var maxIndex=array.length-1;var ii=0;return new Iterator(function(){return ii>maxIndex?iteratorDone():iteratorValue(type,ii,array[reverse?maxIndex-ii++:ii++])})};createClass(ObjectSeq,KeyedSeq);function ObjectSeq(object){var keys=Object.keys(object);this._object=object;this._keys=keys;this.size=keys.length}ObjectSeq.prototype.get=function(key,notSetValue){if(notSetValue!==undefined&&!this.has(key)){return notSetValue}return this._object[key]};ObjectSeq.prototype.has=function(key){return this._object.hasOwnProperty(key)};ObjectSeq.prototype.__iterate=function(fn,reverse){var object=this._object;var keys=this._keys;var maxIndex=keys.length-1;for(var ii=0;ii<=maxIndex;ii++){var key=keys[reverse?maxIndex-ii:ii];if(fn(object[key],key,this)===false){return ii+1}}return ii};ObjectSeq.prototype.__iterator=function(type,reverse){var object=this._object;var keys=this._keys;var maxIndex=keys.length-1;var ii=0;return new Iterator(function(){var key=keys[reverse?maxIndex-ii:ii];return ii++>maxIndex?iteratorDone():iteratorValue(type,key,object[key])})};ObjectSeq.prototype[IS_ORDERED_SENTINEL]=true;createClass(IterableSeq,IndexedSeq);function IterableSeq(iterable){this._iterable=iterable;this.size=iterable.length||iterable.size}IterableSeq.prototype.__iterateUncached=function(fn,reverse){if(reverse){return this.cacheResult().__iterate(fn,reverse)}var iterable=this._iterable;var iterator=getIterator(iterable);var iterations=0;if(isIterator(iterator)){var step;while(!(step=iterator.next()).done){if(fn(step.value,iterations++,this)===false){break}}}return iterations};IterableSeq.prototype.__iteratorUncached=function(type,reverse){if(reverse){return this.cacheResult().__iterator(type,reverse)}var iterable=this._iterable;var iterator=getIterator(iterable);if(!isIterator(iterator)){return new Iterator(iteratorDone)}var iterations=0;return new Iterator(function(){var step=iterator.next();return step.done?step:iteratorValue(type,iterations++,step.value)})};createClass(IteratorSeq,IndexedSeq);function IteratorSeq(iterator){this._iterator=iterator;this._iteratorCache=[]}IteratorSeq.prototype.__iterateUncached=function(fn,reverse){if(reverse){return this.cacheResult().__iterate(fn,reverse)}var iterator=this._iterator;var cache=this._iteratorCache;var iterations=0;while(iterations<cache.length){if(fn(cache[iterations],iterations++,this)===false){return iterations}}var step;while(!(step=iterator.next()).done){var val=step.value;cache[iterations]=val;if(fn(val,iterations++,this)===false){break}}return iterations};IteratorSeq.prototype.__iteratorUncached=function(type,reverse){if(reverse){return this.cacheResult().__iterator(type,reverse)}var iterator=this._iterator;var cache=this._iteratorCache;var iterations=0;return new Iterator(function(){if(iterations>=cache.length){var step=iterator.next();if(step.done){return step}cache[iterations]=step.value}return iteratorValue(type,iterations,cache[iterations++])})};function isSeq(maybeSeq){return!!(maybeSeq&&maybeSeq[IS_SEQ_SENTINEL])}var EMPTY_SEQ;function emptySequence(){return EMPTY_SEQ||(EMPTY_SEQ=new ArraySeq([]))}function keyedSeqFromValue(value){var seq=Array.isArray(value)?new ArraySeq(value).fromEntrySeq():isIterator(value)?new IteratorSeq(value).fromEntrySeq():hasIterator(value)?new IterableSeq(value).fromEntrySeq():typeof value==="object"?new ObjectSeq(value):undefined;if(!seq){throw new TypeError("Expected Array or iterable object of [k, v] entries, "+"or keyed object: "+value)}return seq}function indexedSeqFromValue(value){var seq=maybeIndexedSeqFromValue(value);if(!seq){throw new TypeError("Expected Array or iterable object of values: "+value)}return seq}function seqFromValue(value){var seq=maybeIndexedSeqFromValue(value)||typeof value==="object"&&new ObjectSeq(value);if(!seq){throw new TypeError("Expected Array or iterable object of values, or keyed object: "+value)}return seq}function maybeIndexedSeqFromValue(value){return isArrayLike(value)?new ArraySeq(value):isIterator(value)?new IteratorSeq(value):hasIterator(value)?new IterableSeq(value):undefined}function seqIterate(seq,fn,reverse,useKeys){var cache=seq._cache;if(cache){var maxIndex=cache.length-1;for(var ii=0;ii<=maxIndex;ii++){var entry=cache[reverse?maxIndex-ii:ii];if(fn(entry[1],useKeys?entry[0]:ii,seq)===false){return ii+1}}return ii}return seq.__iterateUncached(fn,reverse)}function seqIterator(seq,type,reverse,useKeys){var cache=seq._cache;if(cache){var maxIndex=cache.length-1;var ii=0;return new Iterator(function(){var entry=cache[reverse?maxIndex-ii:ii];return ii++>maxIndex?iteratorDone():iteratorValue(type,useKeys?entry[0]:ii-1,entry[1])})}return seq.__iteratorUncached(type,reverse)}function fromJS(json,converter){return converter?fromJSWith(converter,json,"",{"":json}):fromJSDefault(json)}function fromJSWith(converter,json,key,parentJSON){if(Array.isArray(json)){return converter.call(parentJSON,key,IndexedSeq(json).map(function(v,k){return fromJSWith(converter,v,k,json)}))}if(isPlainObj(json)){return converter.call(parentJSON,key,KeyedSeq(json).map(function(v,k){return fromJSWith(converter,v,k,json)}))}return json}function fromJSDefault(json){if(Array.isArray(json)){return IndexedSeq(json).map(fromJSDefault).toList()}if(isPlainObj(json)){return KeyedSeq(json).map(fromJSDefault).toMap()}return json}function isPlainObj(value){return value&&(value.constructor===Object||value.constructor===undefined)}function is(valueA,valueB){if(valueA===valueB||valueA!==valueA&&valueB!==valueB){return true}if(!valueA||!valueB){return false}if(typeof valueA.valueOf==="function"&&typeof valueB.valueOf==="function"){valueA=valueA.valueOf();valueB=valueB.valueOf();if(valueA===valueB||valueA!==valueA&&valueB!==valueB){return true}if(!valueA||!valueB){return false}}if(typeof valueA.equals==="function"&&typeof valueB.equals==="function"&&valueA.equals(valueB)){return true}return false}function deepEqual(a,b){if(a===b){return true}if(!isIterable(b)||a.size!==undefined&&b.size!==undefined&&a.size!==b.size||a.__hash!==undefined&&b.__hash!==undefined&&a.__hash!==b.__hash||isKeyed(a)!==isKeyed(b)||isIndexed(a)!==isIndexed(b)||isOrdered(a)!==isOrdered(b)){return false}if(a.size===0&&b.size===0){return true}var notAssociative=!isAssociative(a);if(isOrdered(a)){var entries=a.entries();return b.every(function(v,k){var entry=entries.next().value;return entry&&is(entry[1],v)&&(notAssociative||is(entry[0],k))})&&entries.next().done}var flipped=false;if(a.size===undefined){if(b.size===undefined){if(typeof a.cacheResult==="function"){a.cacheResult()}}else{flipped=true;var _=a;a=b;b=_}}var allEqual=true;var bSize=b.__iterate(function(v,k){if(notAssociative?!a.has(v):flipped?!is(v,a.get(k,NOT_SET)):!is(a.get(k,NOT_SET),v)){allEqual=false;return false}});return allEqual&&a.size===bSize}createClass(Repeat,IndexedSeq);function Repeat(value,times){if(!(this instanceof Repeat)){return new Repeat(value,times)}this._value=value;this.size=times===undefined?Infinity:Math.max(0,times);if(this.size===0){if(EMPTY_REPEAT){return EMPTY_REPEAT}EMPTY_REPEAT=this}}Repeat.prototype.toString=function(){if(this.size===0){return"Repeat []"}return"Repeat [ "+this._value+" "+this.size+" times ]"};Repeat.prototype.get=function(index,notSetValue){return this.has(index)?this._value:notSetValue};Repeat.prototype.includes=function(searchValue){return is(this._value,searchValue)};Repeat.prototype.slice=function(begin,end){var size=this.size;return wholeSlice(begin,end,size)?this:new Repeat(this._value,resolveEnd(end,size)-resolveBegin(begin,size))};Repeat.prototype.reverse=function(){return this};Repeat.prototype.indexOf=function(searchValue){if(is(this._value,searchValue)){return 0}return-1};Repeat.prototype.lastIndexOf=function(searchValue){if(is(this._value,searchValue)){return this.size}return-1};Repeat.prototype.__iterate=function(fn,reverse){for(var ii=0;ii<this.size;ii++){if(fn(this._value,ii,this)===false){return ii+1}}return ii};Repeat.prototype.__iterator=function(type,reverse){var this$0=this;var ii=0;return new Iterator(function(){return ii<this$0.size?iteratorValue(type,ii++,this$0._value):iteratorDone()})};Repeat.prototype.equals=function(other){return other instanceof Repeat?is(this._value,other._value):deepEqual(other)};var EMPTY_REPEAT;function invariant(condition,error){if(!condition)throw new Error(error)}createClass(Range,IndexedSeq);function Range(start,end,step){if(!(this instanceof Range)){return new Range(start,end,step)}invariant(step!==0,"Cannot step a Range by 0");start=start||0;if(end===undefined){end=Infinity}step=step===undefined?1:Math.abs(step);if(end<start){step=-step}this._start=start;this._end=end;this._step=step;this.size=Math.max(0,Math.ceil((end-start)/step-1)+1);if(this.size===0){if(EMPTY_RANGE){return EMPTY_RANGE}EMPTY_RANGE=this}}Range.prototype.toString=function(){if(this.size===0){return"Range []"}return"Range [ "+this._start+"..."+this._end+(this._step!==1?" by "+this._step:"")+" ]"};Range.prototype.get=function(index,notSetValue){return this.has(index)?this._start+wrapIndex(this,index)*this._step:notSetValue};Range.prototype.includes=function(searchValue){var possibleIndex=(searchValue-this._start)/this._step;return possibleIndex>=0&&possibleIndex<this.size&&possibleIndex===Math.floor(possibleIndex)};Range.prototype.slice=function(begin,end){if(wholeSlice(begin,end,this.size)){return this}begin=resolveBegin(begin,this.size);end=resolveEnd(end,this.size);if(end<=begin){return new Range(0,0)}return new Range(this.get(begin,this._end),this.get(end,this._end),this._step)};Range.prototype.indexOf=function(searchValue){var offsetValue=searchValue-this._start;if(offsetValue%this._step===0){var index=offsetValue/this._step;if(index>=0&&index<this.size){return index}}return-1};Range.prototype.lastIndexOf=function(searchValue){return this.indexOf(searchValue)};Range.prototype.__iterate=function(fn,reverse){var maxIndex=this.size-1;var step=this._step;var value=reverse?this._start+maxIndex*step:this._start;for(var ii=0;ii<=maxIndex;ii++){if(fn(value,ii,this)===false){return ii+1}value+=reverse?-step:step}return ii};Range.prototype.__iterator=function(type,reverse){var maxIndex=this.size-1;var step=this._step;var value=reverse?this._start+maxIndex*step:this._start;var ii=0;return new Iterator(function(){var v=value;value+=reverse?-step:step;return ii>maxIndex?iteratorDone():iteratorValue(type,ii++,v)})};Range.prototype.equals=function(other){return other instanceof Range?this._start===other._start&&this._end===other._end&&this._step===other._step:deepEqual(this,other)};var EMPTY_RANGE;createClass(Collection,Iterable);function Collection(){throw TypeError("Abstract")}createClass(KeyedCollection,Collection);function KeyedCollection(){}createClass(IndexedCollection,Collection);function IndexedCollection(){}createClass(SetCollection,Collection);function SetCollection(){}Collection.Keyed=KeyedCollection;Collection.Indexed=IndexedCollection;Collection.Set=SetCollection;var imul=typeof Math.imul==="function"&&Math.imul(4294967295,2)===-2?Math.imul:function imul(a,b){a=a|0;b=b|0;var c=a&65535;var d=b&65535;return c*d+((a>>>16)*d+c*(b>>>16)<<16>>>0)|0};function smi(i32){return i32>>>1&1073741824|i32&3221225471}function hash(o){if(o===false||o===null||o===undefined){return 0}if(typeof o.valueOf==="function"){o=o.valueOf();if(o===false||o===null||o===undefined){return 0}}if(o===true){return 1}var type=typeof o;if(type==="number"){if(o!==o||o===Infinity){return 0}var h=o|0;if(h!==o){h^=o*4294967295}while(o>4294967295){o/=4294967295;h^=o}return smi(h)}if(type==="string"){return o.length>STRING_HASH_CACHE_MIN_STRLEN?cachedHashString(o):hashString(o)}if(typeof o.hashCode==="function"){return o.hashCode()}if(type==="object"){return hashJSObj(o)}if(typeof o.toString==="function"){return hashString(o.toString())}throw new Error("Value type "+type+" cannot be hashed.")}function cachedHashString(string){var hash=stringHashCache[string];if(hash===undefined){hash=hashString(string);if(STRING_HASH_CACHE_SIZE===STRING_HASH_CACHE_MAX_SIZE){STRING_HASH_CACHE_SIZE=0;stringHashCache={}}STRING_HASH_CACHE_SIZE++;stringHashCache[string]=hash}return hash}function hashString(string){var hash=0;for(var ii=0;ii<string.length;ii++){hash=31*hash+string.charCodeAt(ii)|0}return smi(hash)}function hashJSObj(obj){var hash;if(usingWeakMap){hash=weakMap.get(obj);if(hash!==undefined){return hash}}hash=obj[UID_HASH_KEY];if(hash!==undefined){return hash}if(!canDefineProperty){hash=obj.propertyIsEnumerable&&obj.propertyIsEnumerable[UID_HASH_KEY];if(hash!==undefined){return hash}hash=getIENodeHash(obj);if(hash!==undefined){return hash}}hash=++objHashUID;if(objHashUID&1073741824){objHashUID=0}if(usingWeakMap){weakMap.set(obj,hash)}else if(isExtensible!==undefined&&isExtensible(obj)===false){throw new Error("Non-extensible objects are not allowed as keys.")}else if(canDefineProperty){Object.defineProperty(obj,UID_HASH_KEY,{enumerable:false,configurable:false,writable:false,value:hash})}else if(obj.propertyIsEnumerable!==undefined&&obj.propertyIsEnumerable===obj.constructor.prototype.propertyIsEnumerable){obj.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)};obj.propertyIsEnumerable[UID_HASH_KEY]=hash}else if(obj.nodeType!==undefined){obj[UID_HASH_KEY]=hash}else{throw new Error("Unable to set a non-enumerable property on object.")}return hash}var isExtensible=Object.isExtensible;var canDefineProperty=function(){try{Object.defineProperty({},"@",{});return true}catch(e){return false}}();function getIENodeHash(node){if(node&&node.nodeType>0){switch(node.nodeType){case 1:return node.uniqueID;case 9:return node.documentElement&&node.documentElement.uniqueID}}}var usingWeakMap=typeof WeakMap==="function";var weakMap;if(usingWeakMap){weakMap=new WeakMap}var objHashUID=0;var UID_HASH_KEY="__immutablehash__";if(typeof Symbol==="function"){UID_HASH_KEY=Symbol(UID_HASH_KEY)}var STRING_HASH_CACHE_MIN_STRLEN=16;var STRING_HASH_CACHE_MAX_SIZE=255;var STRING_HASH_CACHE_SIZE=0;var stringHashCache={};function assertNotInfinite(size){invariant(size!==Infinity,"Cannot perform this action with an infinite size.")}createClass(Map,KeyedCollection);function Map(value){return value===null||value===undefined?emptyMap():isMap(value)&&!isOrdered(value)?value:emptyMap().withMutations(function(map){var iter=KeyedIterable(value);assertNotInfinite(iter.size);iter.forEach(function(v,k){return map.set(k,v)})})}Map.of=function(){var keyValues=SLICE$0.call(arguments,0);return emptyMap().withMutations(function(map){for(var i=0;i<keyValues.length;i+=2){if(i+1>=keyValues.length){throw new Error("Missing value for key: "+keyValues[i])}map.set(keyValues[i],keyValues[i+1])}})};Map.prototype.toString=function(){return this.__toString("Map {","}")};Map.prototype.get=function(k,notSetValue){return this._root?this._root.get(0,undefined,k,notSetValue):notSetValue};Map.prototype.set=function(k,v){return updateMap(this,k,v)};Map.prototype.setIn=function(keyPath,v){return this.updateIn(keyPath,NOT_SET,function(){return v})};Map.prototype.remove=function(k){return updateMap(this,k,NOT_SET)};Map.prototype.deleteIn=function(keyPath){return this.updateIn(keyPath,function(){return NOT_SET})};Map.prototype.update=function(k,notSetValue,updater){return arguments.length===1?k(this):this.updateIn([k],notSetValue,updater)};Map.prototype.updateIn=function(keyPath,notSetValue,updater){if(!updater){updater=notSetValue;notSetValue=undefined}var updatedValue=updateInDeepMap(this,forceIterator(keyPath),notSetValue,updater);return updatedValue===NOT_SET?undefined:updatedValue};Map.prototype.clear=function(){if(this.size===0){return this}if(this.__ownerID){this.size=0;this._root=null;this.__hash=undefined;this.__altered=true;return this}return emptyMap()};Map.prototype.merge=function(){return mergeIntoMapWith(this,undefined,arguments)};Map.prototype.mergeWith=function(merger){var iters=SLICE$0.call(arguments,1);return mergeIntoMapWith(this,merger,iters)};Map.prototype.mergeIn=function(keyPath){var iters=SLICE$0.call(arguments,1);return this.updateIn(keyPath,emptyMap(),function(m){return typeof m.merge==="function"?m.merge.apply(m,iters):iters[iters.length-1]})};Map.prototype.mergeDeep=function(){return mergeIntoMapWith(this,deepMerger,arguments)};Map.prototype.mergeDeepWith=function(merger){var iters=SLICE$0.call(arguments,1);return mergeIntoMapWith(this,deepMergerWith(merger),iters)};Map.prototype.mergeDeepIn=function(keyPath){var iters=SLICE$0.call(arguments,1);return this.updateIn(keyPath,emptyMap(),function(m){return typeof m.mergeDeep==="function"?m.mergeDeep.apply(m,iters):iters[iters.length-1]})};Map.prototype.sort=function(comparator){return OrderedMap(sortFactory(this,comparator))};Map.prototype.sortBy=function(mapper,comparator){return OrderedMap(sortFactory(this,comparator,mapper))};Map.prototype.withMutations=function(fn){var mutable=this.asMutable();fn(mutable);return mutable.wasAltered()?mutable.__ensureOwner(this.__ownerID):this};Map.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new OwnerID)};Map.prototype.asImmutable=function(){return this.__ensureOwner()};Map.prototype.wasAltered=function(){return this.__altered};Map.prototype.__iterator=function(type,reverse){return new MapIterator(this,type,reverse)};Map.prototype.__iterate=function(fn,reverse){var this$0=this;var iterations=0;this._root&&this._root.iterate(function(entry){iterations++;return fn(entry[1],entry[0],this$0)},reverse);return iterations};Map.prototype.__ensureOwner=function(ownerID){if(ownerID===this.__ownerID){return this}if(!ownerID){this.__ownerID=ownerID;this.__altered=false;return this}return makeMap(this.size,this._root,ownerID,this.__hash)};function isMap(maybeMap){return!!(maybeMap&&maybeMap[IS_MAP_SENTINEL])}Map.isMap=isMap;var IS_MAP_SENTINEL="@@__IMMUTABLE_MAP__@@";var MapPrototype=Map.prototype;MapPrototype[IS_MAP_SENTINEL]=true;MapPrototype[DELETE]=MapPrototype.remove;MapPrototype.removeIn=MapPrototype.deleteIn;function ArrayMapNode(ownerID,entries){this.ownerID=ownerID;this.entries=entries}ArrayMapNode.prototype.get=function(shift,keyHash,key,notSetValue){var entries=this.entries;for(var ii=0,len=entries.length;ii<len;ii++){if(is(key,entries[ii][0])){return entries[ii][1]}}return notSetValue};ArrayMapNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){var removed=value===NOT_SET;var entries=this.entries;var idx=0;for(var len=entries.length;idx<len;idx++){if(is(key,entries[idx][0])){break}}var exists=idx<len;if(exists?entries[idx][1]===value:removed){return this}SetRef(didAlter);(removed||!exists)&&SetRef(didChangeSize);if(removed&&entries.length===1){return}if(!exists&&!removed&&entries.length>=MAX_ARRAY_MAP_SIZE){return createNodes(ownerID,entries,key,value)}var isEditable=ownerID&&ownerID===this.ownerID;var newEntries=isEditable?entries:arrCopy(entries);if(exists){if(removed){idx===len-1?newEntries.pop():newEntries[idx]=newEntries.pop()}else{newEntries[idx]=[key,value]}}else{newEntries.push([key,value])}if(isEditable){this.entries=newEntries;return this}return new ArrayMapNode(ownerID,newEntries)};function BitmapIndexedNode(ownerID,bitmap,nodes){this.ownerID=ownerID;this.bitmap=bitmap;this.nodes=nodes}BitmapIndexedNode.prototype.get=function(shift,keyHash,key,notSetValue){if(keyHash===undefined){keyHash=hash(key)}var bit=1<<((shift===0?keyHash:keyHash>>>shift)&MASK);var bitmap=this.bitmap;return(bitmap&bit)===0?notSetValue:this.nodes[popCount(bitmap&bit-1)].get(shift+SHIFT,keyHash,key,notSetValue)};BitmapIndexedNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){if(keyHash===undefined){keyHash=hash(key)}var keyHashFrag=(shift===0?keyHash:keyHash>>>shift)&MASK;var bit=1<<keyHashFrag;var bitmap=this.bitmap;var exists=(bitmap&bit)!==0;if(!exists&&value===NOT_SET){return this}var idx=popCount(bitmap&bit-1);var nodes=this.nodes;var node=exists?nodes[idx]:undefined;var newNode=updateNode(node,ownerID,shift+SHIFT,keyHash,key,value,didChangeSize,didAlter);if(newNode===node){return this}if(!exists&&newNode&&nodes.length>=MAX_BITMAP_INDEXED_SIZE){return expandNodes(ownerID,nodes,bitmap,keyHashFrag,newNode)}if(exists&&!newNode&&nodes.length===2&&isLeafNode(nodes[idx^1])){return nodes[idx^1]}if(exists&&newNode&&nodes.length===1&&isLeafNode(newNode)){return newNode}var isEditable=ownerID&&ownerID===this.ownerID;var newBitmap=exists?newNode?bitmap:bitmap^bit:bitmap|bit;var newNodes=exists?newNode?setIn(nodes,idx,newNode,isEditable):spliceOut(nodes,idx,isEditable):spliceIn(nodes,idx,newNode,isEditable);if(isEditable){this.bitmap=newBitmap;this.nodes=newNodes;return this}return new BitmapIndexedNode(ownerID,newBitmap,newNodes)};function HashArrayMapNode(ownerID,count,nodes){this.ownerID=ownerID;this.count=count;this.nodes=nodes}HashArrayMapNode.prototype.get=function(shift,keyHash,key,notSetValue){if(keyHash===undefined){keyHash=hash(key)}var idx=(shift===0?keyHash:keyHash>>>shift)&MASK;var node=this.nodes[idx];return node?node.get(shift+SHIFT,keyHash,key,notSetValue):notSetValue};HashArrayMapNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){if(keyHash===undefined){keyHash=hash(key)}var idx=(shift===0?keyHash:keyHash>>>shift)&MASK;var removed=value===NOT_SET;var nodes=this.nodes;var node=nodes[idx];if(removed&&!node){return this}var newNode=updateNode(node,ownerID,shift+SHIFT,keyHash,key,value,didChangeSize,didAlter);if(newNode===node){return this}var newCount=this.count;if(!node){newCount++}else if(!newNode){newCount--;if(newCount<MIN_HASH_ARRAY_MAP_SIZE){return packNodes(ownerID,nodes,newCount,idx)}}var isEditable=ownerID&&ownerID===this.ownerID;var newNodes=setIn(nodes,idx,newNode,isEditable);if(isEditable){this.count=newCount;this.nodes=newNodes;return this}return new HashArrayMapNode(ownerID,newCount,newNodes)};function HashCollisionNode(ownerID,keyHash,entries){this.ownerID=ownerID;this.keyHash=keyHash;this.entries=entries}HashCollisionNode.prototype.get=function(shift,keyHash,key,notSetValue){var entries=this.entries;for(var ii=0,len=entries.length;ii<len;ii++){if(is(key,entries[ii][0])){return entries[ii][1]}}return notSetValue};HashCollisionNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){if(keyHash===undefined){keyHash=hash(key)}var removed=value===NOT_SET;if(keyHash!==this.keyHash){if(removed){return this}SetRef(didAlter);SetRef(didChangeSize);return mergeIntoNode(this,ownerID,shift,keyHash,[key,value])}var entries=this.entries;var idx=0;for(var len=entries.length;idx<len;idx++){if(is(key,entries[idx][0])){break}}var exists=idx<len;if(exists?entries[idx][1]===value:removed){return this}SetRef(didAlter);(removed||!exists)&&SetRef(didChangeSize);if(removed&&len===2){return new ValueNode(ownerID,this.keyHash,entries[idx^1])}var isEditable=ownerID&&ownerID===this.ownerID;var newEntries=isEditable?entries:arrCopy(entries);if(exists){if(removed){idx===len-1?newEntries.pop():newEntries[idx]=newEntries.pop()}else{newEntries[idx]=[key,value]}}else{newEntries.push([key,value])}if(isEditable){this.entries=newEntries;return this}return new HashCollisionNode(ownerID,this.keyHash,newEntries)};function ValueNode(ownerID,keyHash,entry){this.ownerID=ownerID;this.keyHash=keyHash;this.entry=entry}ValueNode.prototype.get=function(shift,keyHash,key,notSetValue){return is(key,this.entry[0])?this.entry[1]:notSetValue};ValueNode.prototype.update=function(ownerID,shift,keyHash,key,value,didChangeSize,didAlter){var removed=value===NOT_SET;var keyMatch=is(key,this.entry[0]);if(keyMatch?value===this.entry[1]:removed){return this}SetRef(didAlter);if(removed){SetRef(didChangeSize);return}if(keyMatch){if(ownerID&&ownerID===this.ownerID){this.entry[1]=value;return this}return new ValueNode(ownerID,this.keyHash,[key,value])}SetRef(didChangeSize);return mergeIntoNode(this,ownerID,shift,hash(key),[key,value])};ArrayMapNode.prototype.iterate=HashCollisionNode.prototype.iterate=function(fn,reverse){var entries=this.entries;for(var ii=0,maxIndex=entries.length-1;ii<=maxIndex;ii++){if(fn(entries[reverse?maxIndex-ii:ii])===false){return false}}};BitmapIndexedNode.prototype.iterate=HashArrayMapNode.prototype.iterate=function(fn,reverse){var nodes=this.nodes;for(var ii=0,maxIndex=nodes.length-1;ii<=maxIndex;ii++){var node=nodes[reverse?maxIndex-ii:ii];if(node&&node.iterate(fn,reverse)===false){return false}}};ValueNode.prototype.iterate=function(fn,reverse){return fn(this.entry)};createClass(MapIterator,Iterator);function MapIterator(map,type,reverse){this._type=type;this._reverse=reverse;this._stack=map._root&&mapIteratorFrame(map._root)}MapIterator.prototype.next=function(){var type=this._type;var stack=this._stack;while(stack){var node=stack.node;var index=stack.index++;var maxIndex;if(node.entry){if(index===0){return mapIteratorValue(type,node.entry)}}else if(node.entries){maxIndex=node.entries.length-1;if(index<=maxIndex){return mapIteratorValue(type,node.entries[this._reverse?maxIndex-index:index])}}else{maxIndex=node.nodes.length-1;if(index<=maxIndex){var subNode=node.nodes[this._reverse?maxIndex-index:index];if(subNode){if(subNode.entry){return mapIteratorValue(type,subNode.entry)}stack=this._stack=mapIteratorFrame(subNode,stack)}continue}}stack=this._stack=this._stack.__prev}return iteratorDone()};function mapIteratorValue(type,entry){return iteratorValue(type,entry[0],entry[1])}function mapIteratorFrame(node,prev){return{node:node,index:0,__prev:prev}}function makeMap(size,root,ownerID,hash){var map=Object.create(MapPrototype);map.size=size;map._root=root;map.__ownerID=ownerID;map.__hash=hash;map.__altered=false;return map}var EMPTY_MAP;function emptyMap(){return EMPTY_MAP||(EMPTY_MAP=makeMap(0))}function updateMap(map,k,v){var newRoot;var newSize;if(!map._root){if(v===NOT_SET){return map}newSize=1;newRoot=new ArrayMapNode(map.__ownerID,[[k,v]])}else{var didChangeSize=MakeRef(CHANGE_LENGTH);var didAlter=MakeRef(DID_ALTER);newRoot=updateNode(map._root,map.__ownerID,0,undefined,k,v,didChangeSize,didAlter);if(!didAlter.value){return map}newSize=map.size+(didChangeSize.value?v===NOT_SET?-1:1:0)}if(map.__ownerID){map.size=newSize;map._root=newRoot;map.__hash=undefined;map.__altered=true;return map}return newRoot?makeMap(newSize,newRoot):emptyMap()}function updateNode(node,ownerID,shift,keyHash,key,value,didChangeSize,didAlter){if(!node){if(value===NOT_SET){return node}SetRef(didAlter);SetRef(didChangeSize);return new ValueNode(ownerID,keyHash,[key,value])}return node.update(ownerID,shift,keyHash,key,value,didChangeSize,didAlter)}function isLeafNode(node){return node.constructor===ValueNode||node.constructor===HashCollisionNode}function mergeIntoNode(node,ownerID,shift,keyHash,entry){if(node.keyHash===keyHash){return new HashCollisionNode(ownerID,keyHash,[node.entry,entry])}var idx1=(shift===0?node.keyHash:node.keyHash>>>shift)&MASK;var idx2=(shift===0?keyHash:keyHash>>>shift)&MASK;var newNode;var nodes=idx1===idx2?[mergeIntoNode(node,ownerID,shift+SHIFT,keyHash,entry)]:(newNode=new ValueNode(ownerID,keyHash,entry),idx1<idx2?[node,newNode]:[newNode,node]);return new BitmapIndexedNode(ownerID,1<<idx1|1<<idx2,nodes)}
function createNodes(ownerID,entries,key,value){if(!ownerID){ownerID=new OwnerID}var node=new ValueNode(ownerID,hash(key),[key,value]);for(var ii=0;ii<entries.length;ii++){var entry=entries[ii];node=node.update(ownerID,0,undefined,entry[0],entry[1])}return node}function packNodes(ownerID,nodes,count,excluding){var bitmap=0;var packedII=0;var packedNodes=new Array(count);for(var ii=0,bit=1,len=nodes.length;ii<len;ii++,bit<<=1){var node=nodes[ii];if(node!==undefined&&ii!==excluding){bitmap|=bit;packedNodes[packedII++]=node}}return new BitmapIndexedNode(ownerID,bitmap,packedNodes)}function expandNodes(ownerID,nodes,bitmap,including,node){var count=0;var expandedNodes=new Array(SIZE);for(var ii=0;bitmap!==0;ii++,bitmap>>>=1){expandedNodes[ii]=bitmap&1?nodes[count++]:undefined}expandedNodes[including]=node;return new HashArrayMapNode(ownerID,count+1,expandedNodes)}function mergeIntoMapWith(map,merger,iterables){var iters=[];for(var ii=0;ii<iterables.length;ii++){var value=iterables[ii];var iter=KeyedIterable(value);if(!isIterable(value)){iter=iter.map(function(v){return fromJS(v)})}iters.push(iter)}return mergeIntoCollectionWith(map,merger,iters)}function deepMerger(existing,value,key){return existing&&existing.mergeDeep&&isIterable(value)?existing.mergeDeep(value):is(existing,value)?existing:value}function deepMergerWith(merger){return function(existing,value,key){if(existing&&existing.mergeDeepWith&&isIterable(value)){return existing.mergeDeepWith(merger,value)}var nextValue=merger(existing,value,key);return is(existing,nextValue)?existing:nextValue}}function mergeIntoCollectionWith(collection,merger,iters){iters=iters.filter(function(x){return x.size!==0});if(iters.length===0){return collection}if(collection.size===0&&!collection.__ownerID&&iters.length===1){return collection.constructor(iters[0])}return collection.withMutations(function(collection){var mergeIntoMap=merger?function(value,key){collection.update(key,NOT_SET,function(existing){return existing===NOT_SET?value:merger(existing,value,key)})}:function(value,key){collection.set(key,value)};for(var ii=0;ii<iters.length;ii++){iters[ii].forEach(mergeIntoMap)}})}function updateInDeepMap(existing,keyPathIter,notSetValue,updater){var isNotSet=existing===NOT_SET;var step=keyPathIter.next();if(step.done){var existingValue=isNotSet?notSetValue:existing;var newValue=updater(existingValue);return newValue===existingValue?existing:newValue}invariant(isNotSet||existing&&existing.set,"invalid keyPath");var key=step.value;var nextExisting=isNotSet?NOT_SET:existing.get(key,NOT_SET);var nextUpdated=updateInDeepMap(nextExisting,keyPathIter,notSetValue,updater);return nextUpdated===nextExisting?existing:nextUpdated===NOT_SET?existing.remove(key):(isNotSet?emptyMap():existing).set(key,nextUpdated)}function popCount(x){x=x-(x>>1&1431655765);x=(x&858993459)+(x>>2&858993459);x=x+(x>>4)&252645135;x=x+(x>>8);x=x+(x>>16);return x&127}function setIn(array,idx,val,canEdit){var newArray=canEdit?array:arrCopy(array);newArray[idx]=val;return newArray}function spliceIn(array,idx,val,canEdit){var newLen=array.length+1;if(canEdit&&idx+1===newLen){array[idx]=val;return array}var newArray=new Array(newLen);var after=0;for(var ii=0;ii<newLen;ii++){if(ii===idx){newArray[ii]=val;after=-1}else{newArray[ii]=array[ii+after]}}return newArray}function spliceOut(array,idx,canEdit){var newLen=array.length-1;if(canEdit&&idx===newLen){array.pop();return array}var newArray=new Array(newLen);var after=0;for(var ii=0;ii<newLen;ii++){if(ii===idx){after=1}newArray[ii]=array[ii+after]}return newArray}var MAX_ARRAY_MAP_SIZE=SIZE/4;var MAX_BITMAP_INDEXED_SIZE=SIZE/2;var MIN_HASH_ARRAY_MAP_SIZE=SIZE/4;createClass(List,IndexedCollection);function List(value){var empty=emptyList();if(value===null||value===undefined){return empty}if(isList(value)){return value}var iter=IndexedIterable(value);var size=iter.size;if(size===0){return empty}assertNotInfinite(size);if(size>0&&size<SIZE){return makeList(0,size,SHIFT,null,new VNode(iter.toArray()))}return empty.withMutations(function(list){list.setSize(size);iter.forEach(function(v,i){return list.set(i,v)})})}List.of=function(){return this(arguments)};List.prototype.toString=function(){return this.__toString("List [","]")};List.prototype.get=function(index,notSetValue){index=wrapIndex(this,index);if(index>=0&&index<this.size){index+=this._origin;var node=listNodeFor(this,index);return node&&node.array[index&MASK]}return notSetValue};List.prototype.set=function(index,value){return updateList(this,index,value)};List.prototype.remove=function(index){return!this.has(index)?this:index===0?this.shift():index===this.size-1?this.pop():this.splice(index,1)};List.prototype.insert=function(index,value){return this.splice(index,0,value)};List.prototype.clear=function(){if(this.size===0){return this}if(this.__ownerID){this.size=this._origin=this._capacity=0;this._level=SHIFT;this._root=this._tail=null;this.__hash=undefined;this.__altered=true;return this}return emptyList()};List.prototype.push=function(){var values=arguments;var oldSize=this.size;return this.withMutations(function(list){setListBounds(list,0,oldSize+values.length);for(var ii=0;ii<values.length;ii++){list.set(oldSize+ii,values[ii])}})};List.prototype.pop=function(){return setListBounds(this,0,-1)};List.prototype.unshift=function(){var values=arguments;return this.withMutations(function(list){setListBounds(list,-values.length);for(var ii=0;ii<values.length;ii++){list.set(ii,values[ii])}})};List.prototype.shift=function(){return setListBounds(this,1)};List.prototype.merge=function(){return mergeIntoListWith(this,undefined,arguments)};List.prototype.mergeWith=function(merger){var iters=SLICE$0.call(arguments,1);return mergeIntoListWith(this,merger,iters)};List.prototype.mergeDeep=function(){return mergeIntoListWith(this,deepMerger,arguments)};List.prototype.mergeDeepWith=function(merger){var iters=SLICE$0.call(arguments,1);return mergeIntoListWith(this,deepMergerWith(merger),iters)};List.prototype.setSize=function(size){return setListBounds(this,0,size)};List.prototype.slice=function(begin,end){var size=this.size;if(wholeSlice(begin,end,size)){return this}return setListBounds(this,resolveBegin(begin,size),resolveEnd(end,size))};List.prototype.__iterator=function(type,reverse){var index=0;var values=iterateList(this,reverse);return new Iterator(function(){var value=values();return value===DONE?iteratorDone():iteratorValue(type,index++,value)})};List.prototype.__iterate=function(fn,reverse){var index=0;var values=iterateList(this,reverse);var value;while((value=values())!==DONE){if(fn(value,index++,this)===false){break}}return index};List.prototype.__ensureOwner=function(ownerID){if(ownerID===this.__ownerID){return this}if(!ownerID){this.__ownerID=ownerID;return this}return makeList(this._origin,this._capacity,this._level,this._root,this._tail,ownerID,this.__hash)};function isList(maybeList){return!!(maybeList&&maybeList[IS_LIST_SENTINEL])}List.isList=isList;var IS_LIST_SENTINEL="@@__IMMUTABLE_LIST__@@";var ListPrototype=List.prototype;ListPrototype[IS_LIST_SENTINEL]=true;ListPrototype[DELETE]=ListPrototype.remove;ListPrototype.setIn=MapPrototype.setIn;ListPrototype.deleteIn=ListPrototype.removeIn=MapPrototype.removeIn;ListPrototype.update=MapPrototype.update;ListPrototype.updateIn=MapPrototype.updateIn;ListPrototype.mergeIn=MapPrototype.mergeIn;ListPrototype.mergeDeepIn=MapPrototype.mergeDeepIn;ListPrototype.withMutations=MapPrototype.withMutations;ListPrototype.asMutable=MapPrototype.asMutable;ListPrototype.asImmutable=MapPrototype.asImmutable;ListPrototype.wasAltered=MapPrototype.wasAltered;function VNode(array,ownerID){this.array=array;this.ownerID=ownerID}VNode.prototype.removeBefore=function(ownerID,level,index){if(index===level?1<<level:0||this.array.length===0){return this}var originIndex=index>>>level&MASK;if(originIndex>=this.array.length){return new VNode([],ownerID)}var removingFirst=originIndex===0;var newChild;if(level>0){var oldChild=this.array[originIndex];newChild=oldChild&&oldChild.removeBefore(ownerID,level-SHIFT,index);if(newChild===oldChild&&removingFirst){return this}}if(removingFirst&&!newChild){return this}var editable=editableVNode(this,ownerID);if(!removingFirst){for(var ii=0;ii<originIndex;ii++){editable.array[ii]=undefined}}if(newChild){editable.array[originIndex]=newChild}return editable};VNode.prototype.removeAfter=function(ownerID,level,index){if(index===(level?1<<level:0)||this.array.length===0){return this}var sizeIndex=index-1>>>level&MASK;if(sizeIndex>=this.array.length){return this}var newChild;if(level>0){var oldChild=this.array[sizeIndex];newChild=oldChild&&oldChild.removeAfter(ownerID,level-SHIFT,index);if(newChild===oldChild&&sizeIndex===this.array.length-1){return this}}var editable=editableVNode(this,ownerID);editable.array.splice(sizeIndex+1);if(newChild){editable.array[sizeIndex]=newChild}return editable};var DONE={};function iterateList(list,reverse){var left=list._origin;var right=list._capacity;var tailPos=getTailOffset(right);var tail=list._tail;return iterateNodeOrLeaf(list._root,list._level,0);function iterateNodeOrLeaf(node,level,offset){return level===0?iterateLeaf(node,offset):iterateNode(node,level,offset)}function iterateLeaf(node,offset){var array=offset===tailPos?tail&&tail.array:node&&node.array;var from=offset>left?0:left-offset;var to=right-offset;if(to>SIZE){to=SIZE}return function(){if(from===to){return DONE}var idx=reverse?--to:from++;return array&&array[idx]}}function iterateNode(node,level,offset){var values;var array=node&&node.array;var from=offset>left?0:left-offset>>level;var to=(right-offset>>level)+1;if(to>SIZE){to=SIZE}return function(){do{if(values){var value=values();if(value!==DONE){return value}values=null}if(from===to){return DONE}var idx=reverse?--to:from++;values=iterateNodeOrLeaf(array&&array[idx],level-SHIFT,offset+(idx<<level))}while(true)}}}function makeList(origin,capacity,level,root,tail,ownerID,hash){var list=Object.create(ListPrototype);list.size=capacity-origin;list._origin=origin;list._capacity=capacity;list._level=level;list._root=root;list._tail=tail;list.__ownerID=ownerID;list.__hash=hash;list.__altered=false;return list}var EMPTY_LIST;function emptyList(){return EMPTY_LIST||(EMPTY_LIST=makeList(0,0,SHIFT))}function updateList(list,index,value){index=wrapIndex(list,index);if(index!==index){return list}if(index>=list.size||index<0){return list.withMutations(function(list){index<0?setListBounds(list,index).set(0,value):setListBounds(list,0,index+1).set(index,value)})}index+=list._origin;var newTail=list._tail;var newRoot=list._root;var didAlter=MakeRef(DID_ALTER);if(index>=getTailOffset(list._capacity)){newTail=updateVNode(newTail,list.__ownerID,0,index,value,didAlter)}else{newRoot=updateVNode(newRoot,list.__ownerID,list._level,index,value,didAlter)}if(!didAlter.value){return list}if(list.__ownerID){list._root=newRoot;list._tail=newTail;list.__hash=undefined;list.__altered=true;return list}return makeList(list._origin,list._capacity,list._level,newRoot,newTail)}function updateVNode(node,ownerID,level,index,value,didAlter){var idx=index>>>level&MASK;var nodeHas=node&&idx<node.array.length;if(!nodeHas&&value===undefined){return node}var newNode;if(level>0){var lowerNode=node&&node.array[idx];var newLowerNode=updateVNode(lowerNode,ownerID,level-SHIFT,index,value,didAlter);if(newLowerNode===lowerNode){return node}newNode=editableVNode(node,ownerID);newNode.array[idx]=newLowerNode;return newNode}if(nodeHas&&node.array[idx]===value){return node}SetRef(didAlter);newNode=editableVNode(node,ownerID);if(value===undefined&&idx===newNode.array.length-1){newNode.array.pop()}else{newNode.array[idx]=value}return newNode}function editableVNode(node,ownerID){if(ownerID&&node&&ownerID===node.ownerID){return node}return new VNode(node?node.array.slice():[],ownerID)}function listNodeFor(list,rawIndex){if(rawIndex>=getTailOffset(list._capacity)){return list._tail}if(rawIndex<1<<list._level+SHIFT){var node=list._root;var level=list._level;while(node&&level>0){node=node.array[rawIndex>>>level&MASK];level-=SHIFT}return node}}function setListBounds(list,begin,end){if(begin!==undefined){begin=begin|0}if(end!==undefined){end=end|0}var owner=list.__ownerID||new OwnerID;var oldOrigin=list._origin;var oldCapacity=list._capacity;var newOrigin=oldOrigin+begin;var newCapacity=end===undefined?oldCapacity:end<0?oldCapacity+end:oldOrigin+end;if(newOrigin===oldOrigin&&newCapacity===oldCapacity){return list}if(newOrigin>=newCapacity){return list.clear()}var newLevel=list._level;var newRoot=list._root;var offsetShift=0;while(newOrigin+offsetShift<0){newRoot=new VNode(newRoot&&newRoot.array.length?[undefined,newRoot]:[],owner);newLevel+=SHIFT;offsetShift+=1<<newLevel}if(offsetShift){newOrigin+=offsetShift;oldOrigin+=offsetShift;newCapacity+=offsetShift;oldCapacity+=offsetShift}var oldTailOffset=getTailOffset(oldCapacity);var newTailOffset=getTailOffset(newCapacity);while(newTailOffset>=1<<newLevel+SHIFT){newRoot=new VNode(newRoot&&newRoot.array.length?[newRoot]:[],owner);newLevel+=SHIFT}var oldTail=list._tail;var newTail=newTailOffset<oldTailOffset?listNodeFor(list,newCapacity-1):newTailOffset>oldTailOffset?new VNode([],owner):oldTail;if(oldTail&&newTailOffset>oldTailOffset&&newOrigin<oldCapacity&&oldTail.array.length){newRoot=editableVNode(newRoot,owner);var node=newRoot;for(var level=newLevel;level>SHIFT;level-=SHIFT){var idx=oldTailOffset>>>level&MASK;node=node.array[idx]=editableVNode(node.array[idx],owner)}node.array[oldTailOffset>>>SHIFT&MASK]=oldTail}if(newCapacity<oldCapacity){newTail=newTail&&newTail.removeAfter(owner,0,newCapacity)}if(newOrigin>=newTailOffset){newOrigin-=newTailOffset;newCapacity-=newTailOffset;newLevel=SHIFT;newRoot=null;newTail=newTail&&newTail.removeBefore(owner,0,newOrigin)}else if(newOrigin>oldOrigin||newTailOffset<oldTailOffset){offsetShift=0;while(newRoot){var beginIndex=newOrigin>>>newLevel&MASK;if(beginIndex!==newTailOffset>>>newLevel&MASK){break}if(beginIndex){offsetShift+=(1<<newLevel)*beginIndex}newLevel-=SHIFT;newRoot=newRoot.array[beginIndex]}if(newRoot&&newOrigin>oldOrigin){newRoot=newRoot.removeBefore(owner,newLevel,newOrigin-offsetShift)}if(newRoot&&newTailOffset<oldTailOffset){newRoot=newRoot.removeAfter(owner,newLevel,newTailOffset-offsetShift)}if(offsetShift){newOrigin-=offsetShift;newCapacity-=offsetShift}}if(list.__ownerID){list.size=newCapacity-newOrigin;list._origin=newOrigin;list._capacity=newCapacity;list._level=newLevel;list._root=newRoot;list._tail=newTail;list.__hash=undefined;list.__altered=true;return list}return makeList(newOrigin,newCapacity,newLevel,newRoot,newTail)}function mergeIntoListWith(list,merger,iterables){var iters=[];var maxSize=0;for(var ii=0;ii<iterables.length;ii++){var value=iterables[ii];var iter=IndexedIterable(value);if(iter.size>maxSize){maxSize=iter.size}if(!isIterable(value)){iter=iter.map(function(v){return fromJS(v)})}iters.push(iter)}if(maxSize>list.size){list=list.setSize(maxSize)}return mergeIntoCollectionWith(list,merger,iters)}function getTailOffset(size){return size<SIZE?0:size-1>>>SHIFT<<SHIFT}createClass(OrderedMap,Map);function OrderedMap(value){return value===null||value===undefined?emptyOrderedMap():isOrderedMap(value)?value:emptyOrderedMap().withMutations(function(map){var iter=KeyedIterable(value);assertNotInfinite(iter.size);iter.forEach(function(v,k){return map.set(k,v)})})}OrderedMap.of=function(){return this(arguments)};OrderedMap.prototype.toString=function(){return this.__toString("OrderedMap {","}")};OrderedMap.prototype.get=function(k,notSetValue){var index=this._map.get(k);return index!==undefined?this._list.get(index)[1]:notSetValue};OrderedMap.prototype.clear=function(){if(this.size===0){return this}if(this.__ownerID){this.size=0;this._map.clear();this._list.clear();return this}return emptyOrderedMap()};OrderedMap.prototype.set=function(k,v){return updateOrderedMap(this,k,v)};OrderedMap.prototype.remove=function(k){return updateOrderedMap(this,k,NOT_SET)};OrderedMap.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()};OrderedMap.prototype.__iterate=function(fn,reverse){var this$0=this;return this._list.__iterate(function(entry){return entry&&fn(entry[1],entry[0],this$0)},reverse)};OrderedMap.prototype.__iterator=function(type,reverse){return this._list.fromEntrySeq().__iterator(type,reverse)};OrderedMap.prototype.__ensureOwner=function(ownerID){if(ownerID===this.__ownerID){return this}var newMap=this._map.__ensureOwner(ownerID);var newList=this._list.__ensureOwner(ownerID);if(!ownerID){this.__ownerID=ownerID;this._map=newMap;this._list=newList;return this}return makeOrderedMap(newMap,newList,ownerID,this.__hash)};function isOrderedMap(maybeOrderedMap){return isMap(maybeOrderedMap)&&isOrdered(maybeOrderedMap)}OrderedMap.isOrderedMap=isOrderedMap;OrderedMap.prototype[IS_ORDERED_SENTINEL]=true;OrderedMap.prototype[DELETE]=OrderedMap.prototype.remove;function makeOrderedMap(map,list,ownerID,hash){var omap=Object.create(OrderedMap.prototype);omap.size=map?map.size:0;omap._map=map;omap._list=list;omap.__ownerID=ownerID;omap.__hash=hash;return omap}var EMPTY_ORDERED_MAP;function emptyOrderedMap(){return EMPTY_ORDERED_MAP||(EMPTY_ORDERED_MAP=makeOrderedMap(emptyMap(),emptyList()))}function updateOrderedMap(omap,k,v){var map=omap._map;var list=omap._list;var i=map.get(k);var has=i!==undefined;var newMap;var newList;if(v===NOT_SET){if(!has){return omap}if(list.size>=SIZE&&list.size>=map.size*2){newList=list.filter(function(entry,idx){return entry!==undefined&&i!==idx});newMap=newList.toKeyedSeq().map(function(entry){return entry[0]}).flip().toMap();if(omap.__ownerID){newMap.__ownerID=newList.__ownerID=omap.__ownerID}}else{newMap=map.remove(k);newList=i===list.size-1?list.pop():list.set(i,undefined)}}else{if(has){if(v===list.get(i)[1]){return omap}newMap=map;newList=list.set(i,[k,v])}else{newMap=map.set(k,list.size);newList=list.set(list.size,[k,v])}}if(omap.__ownerID){omap.size=newMap.size;omap._map=newMap;omap._list=newList;omap.__hash=undefined;return omap}return makeOrderedMap(newMap,newList)}createClass(ToKeyedSequence,KeyedSeq);function ToKeyedSequence(indexed,useKeys){this._iter=indexed;this._useKeys=useKeys;this.size=indexed.size}ToKeyedSequence.prototype.get=function(key,notSetValue){return this._iter.get(key,notSetValue)};ToKeyedSequence.prototype.has=function(key){return this._iter.has(key)};ToKeyedSequence.prototype.valueSeq=function(){return this._iter.valueSeq()};ToKeyedSequence.prototype.reverse=function(){var this$0=this;var reversedSequence=reverseFactory(this,true);if(!this._useKeys){reversedSequence.valueSeq=function(){return this$0._iter.toSeq().reverse()}}return reversedSequence};ToKeyedSequence.prototype.map=function(mapper,context){var this$0=this;var mappedSequence=mapFactory(this,mapper,context);if(!this._useKeys){mappedSequence.valueSeq=function(){return this$0._iter.toSeq().map(mapper,context)}}return mappedSequence};ToKeyedSequence.prototype.__iterate=function(fn,reverse){var this$0=this;var ii;return this._iter.__iterate(this._useKeys?function(v,k){return fn(v,k,this$0)}:(ii=reverse?resolveSize(this):0,function(v){return fn(v,reverse?--ii:ii++,this$0)}),reverse)};ToKeyedSequence.prototype.__iterator=function(type,reverse){if(this._useKeys){return this._iter.__iterator(type,reverse)}var iterator=this._iter.__iterator(ITERATE_VALUES,reverse);var ii=reverse?resolveSize(this):0;return new Iterator(function(){var step=iterator.next();return step.done?step:iteratorValue(type,reverse?--ii:ii++,step.value,step)})};ToKeyedSequence.prototype[IS_ORDERED_SENTINEL]=true;createClass(ToIndexedSequence,IndexedSeq);function ToIndexedSequence(iter){this._iter=iter;this.size=iter.size}ToIndexedSequence.prototype.includes=function(value){return this._iter.includes(value)};ToIndexedSequence.prototype.__iterate=function(fn,reverse){var this$0=this;var iterations=0;return this._iter.__iterate(function(v){return fn(v,iterations++,this$0)},reverse)};ToIndexedSequence.prototype.__iterator=function(type,reverse){var iterator=this._iter.__iterator(ITERATE_VALUES,reverse);var iterations=0;return new Iterator(function(){var step=iterator.next();return step.done?step:iteratorValue(type,iterations++,step.value,step)})};createClass(ToSetSequence,SetSeq);function ToSetSequence(iter){this._iter=iter;this.size=iter.size}ToSetSequence.prototype.has=function(key){return this._iter.includes(key)};ToSetSequence.prototype.__iterate=function(fn,reverse){var this$0=this;return this._iter.__iterate(function(v){return fn(v,v,this$0)},reverse)};ToSetSequence.prototype.__iterator=function(type,reverse){var iterator=this._iter.__iterator(ITERATE_VALUES,reverse);return new Iterator(function(){var step=iterator.next();return step.done?step:iteratorValue(type,step.value,step.value,step)})};createClass(FromEntriesSequence,KeyedSeq);function FromEntriesSequence(entries){this._iter=entries;this.size=entries.size}FromEntriesSequence.prototype.entrySeq=function(){return this._iter.toSeq()};FromEntriesSequence.prototype.__iterate=function(fn,reverse){var this$0=this;return this._iter.__iterate(function(entry){if(entry){validateEntry(entry);var indexedIterable=isIterable(entry);return fn(indexedIterable?entry.get(1):entry[1],indexedIterable?entry.get(0):entry[0],this$0)}},reverse)};FromEntriesSequence.prototype.__iterator=function(type,reverse){var iterator=this._iter.__iterator(ITERATE_VALUES,reverse);return new Iterator(function(){while(true){var step=iterator.next();if(step.done){return step}var entry=step.value;if(entry){validateEntry(entry);var indexedIterable=isIterable(entry);return iteratorValue(type,indexedIterable?entry.get(0):entry[0],indexedIterable?entry.get(1):entry[1],step)}}})};ToIndexedSequence.prototype.cacheResult=ToKeyedSequence.prototype.cacheResult=ToSetSequence.prototype.cacheResult=FromEntriesSequence.prototype.cacheResult=cacheResultThrough;function flipFactory(iterable){var flipSequence=makeSequence(iterable);flipSequence._iter=iterable;flipSequence.size=iterable.size;flipSequence.flip=function(){return iterable};flipSequence.reverse=function(){var reversedSequence=iterable.reverse.apply(this);reversedSequence.flip=function(){return iterable.reverse()};return reversedSequence};flipSequence.has=function(key){return iterable.includes(key)};flipSequence.includes=function(key){return iterable.has(key)};flipSequence.cacheResult=cacheResultThrough;flipSequence.__iterateUncached=function(fn,reverse){var this$0=this;return iterable.__iterate(function(v,k){return fn(k,v,this$0)!==false},reverse)};flipSequence.__iteratorUncached=function(type,reverse){if(type===ITERATE_ENTRIES){var iterator=iterable.__iterator(type,reverse);return new Iterator(function(){var step=iterator.next();if(!step.done){var k=step.value[0];step.value[0]=step.value[1];step.value[1]=k}return step})}return iterable.__iterator(type===ITERATE_VALUES?ITERATE_KEYS:ITERATE_VALUES,reverse)};return flipSequence}function mapFactory(iterable,mapper,context){var mappedSequence=makeSequence(iterable);mappedSequence.size=iterable.size;mappedSequence.has=function(key){return iterable.has(key)};mappedSequence.get=function(key,notSetValue){var v=iterable.get(key,NOT_SET);return v===NOT_SET?notSetValue:mapper.call(context,v,key,iterable)};mappedSequence.__iterateUncached=function(fn,reverse){var this$0=this;return iterable.__iterate(function(v,k,c){return fn(mapper.call(context,v,k,c),k,this$0)!==false},reverse)};mappedSequence.__iteratorUncached=function(type,reverse){var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse);return new Iterator(function(){var step=iterator.next();if(step.done){return step}var entry=step.value;var key=entry[0];return iteratorValue(type,key,mapper.call(context,entry[1],key,iterable),step)})};return mappedSequence}function reverseFactory(iterable,useKeys){var reversedSequence=makeSequence(iterable);reversedSequence._iter=iterable;reversedSequence.size=iterable.size;reversedSequence.reverse=function(){return iterable};if(iterable.flip){reversedSequence.flip=function(){var flipSequence=flipFactory(iterable);flipSequence.reverse=function(){return iterable.flip()};return flipSequence}}reversedSequence.get=function(key,notSetValue){return iterable.get(useKeys?key:-1-key,notSetValue)};reversedSequence.has=function(key){return iterable.has(useKeys?key:-1-key)};reversedSequence.includes=function(value){return iterable.includes(value)};reversedSequence.cacheResult=cacheResultThrough;reversedSequence.__iterate=function(fn,reverse){var this$0=this;return iterable.__iterate(function(v,k){return fn(v,k,this$0)},!reverse)};reversedSequence.__iterator=function(type,reverse){return iterable.__iterator(type,!reverse)};return reversedSequence}function filterFactory(iterable,predicate,context,useKeys){var filterSequence=makeSequence(iterable);if(useKeys){filterSequence.has=function(key){var v=iterable.get(key,NOT_SET);return v!==NOT_SET&&!!predicate.call(context,v,key,iterable)};filterSequence.get=function(key,notSetValue){var v=iterable.get(key,NOT_SET);return v!==NOT_SET&&predicate.call(context,v,key,iterable)?v:notSetValue}}filterSequence.__iterateUncached=function(fn,reverse){var this$0=this;var iterations=0;iterable.__iterate(function(v,k,c){if(predicate.call(context,v,k,c)){iterations++;return fn(v,useKeys?k:iterations-1,this$0)}},reverse);return iterations};filterSequence.__iteratorUncached=function(type,reverse){var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse);var iterations=0;return new Iterator(function(){while(true){var step=iterator.next();if(step.done){return step}var entry=step.value;var key=entry[0];var value=entry[1];if(predicate.call(context,value,key,iterable)){return iteratorValue(type,useKeys?key:iterations++,value,step)}}})};return filterSequence}function countByFactory(iterable,grouper,context){var groups=Map().asMutable();iterable.__iterate(function(v,k){groups.update(grouper.call(context,v,k,iterable),0,function(a){return a+1})});return groups.asImmutable()}function groupByFactory(iterable,grouper,context){var isKeyedIter=isKeyed(iterable);var groups=(isOrdered(iterable)?OrderedMap():Map()).asMutable();iterable.__iterate(function(v,k){groups.update(grouper.call(context,v,k,iterable),function(a){return a=a||[],a.push(isKeyedIter?[k,v]:v),a})});var coerce=iterableClass(iterable);return groups.map(function(arr){return reify(iterable,coerce(arr))})}function sliceFactory(iterable,begin,end,useKeys){var originalSize=iterable.size;if(begin!==undefined){begin=begin|0}if(end!==undefined){if(end===Infinity){end=originalSize}else{end=end|0}}if(wholeSlice(begin,end,originalSize)){return iterable}var resolvedBegin=resolveBegin(begin,originalSize);var resolvedEnd=resolveEnd(end,originalSize);if(resolvedBegin!==resolvedBegin||resolvedEnd!==resolvedEnd){return sliceFactory(iterable.toSeq().cacheResult(),begin,end,useKeys)}var resolvedSize=resolvedEnd-resolvedBegin;var sliceSize;if(resolvedSize===resolvedSize){sliceSize=resolvedSize<0?0:resolvedSize}var sliceSeq=makeSequence(iterable);sliceSeq.size=sliceSize===0?sliceSize:iterable.size&&sliceSize||undefined;if(!useKeys&&isSeq(iterable)&&sliceSize>=0){sliceSeq.get=function(index,notSetValue){index=wrapIndex(this,index);return index>=0&&index<sliceSize?iterable.get(index+resolvedBegin,notSetValue):notSetValue}}sliceSeq.__iterateUncached=function(fn,reverse){var this$0=this;if(sliceSize===0){return 0}if(reverse){return this.cacheResult().__iterate(fn,reverse)}var skipped=0;var isSkipping=true;var iterations=0;iterable.__iterate(function(v,k){if(!(isSkipping&&(isSkipping=skipped++<resolvedBegin))){iterations++;return fn(v,useKeys?k:iterations-1,this$0)!==false&&iterations!==sliceSize}});return iterations};sliceSeq.__iteratorUncached=function(type,reverse){if(sliceSize!==0&&reverse){return this.cacheResult().__iterator(type,reverse)}var iterator=sliceSize!==0&&iterable.__iterator(type,reverse);var skipped=0;var iterations=0;return new Iterator(function(){while(skipped++<resolvedBegin){iterator.next()}if(++iterations>sliceSize){return iteratorDone()}var step=iterator.next();if(useKeys||type===ITERATE_VALUES){return step}else if(type===ITERATE_KEYS){return iteratorValue(type,iterations-1,undefined,step)}else{return iteratorValue(type,iterations-1,step.value[1],step)}})};return sliceSeq}function takeWhileFactory(iterable,predicate,context){var takeSequence=makeSequence(iterable);takeSequence.__iterateUncached=function(fn,reverse){var this$0=this;if(reverse){return this.cacheResult().__iterate(fn,reverse)}var iterations=0;iterable.__iterate(function(v,k,c){return predicate.call(context,v,k,c)&&++iterations&&fn(v,k,this$0)});return iterations};takeSequence.__iteratorUncached=function(type,reverse){var this$0=this;if(reverse){return this.cacheResult().__iterator(type,reverse)}var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse);var iterating=true;return new Iterator(function(){if(!iterating){return iteratorDone()}var step=iterator.next();if(step.done){return step}var entry=step.value;var k=entry[0];var v=entry[1];if(!predicate.call(context,v,k,this$0)){iterating=false;return iteratorDone()}return type===ITERATE_ENTRIES?step:iteratorValue(type,k,v,step)})};return takeSequence}function skipWhileFactory(iterable,predicate,context,useKeys){var skipSequence=makeSequence(iterable);skipSequence.__iterateUncached=function(fn,reverse){var this$0=this;if(reverse){return this.cacheResult().__iterate(fn,reverse)}var isSkipping=true;var iterations=0;iterable.__iterate(function(v,k,c){if(!(isSkipping&&(isSkipping=predicate.call(context,v,k,c)))){iterations++;return fn(v,useKeys?k:iterations-1,this$0)}});return iterations};skipSequence.__iteratorUncached=function(type,reverse){var this$0=this;if(reverse){return this.cacheResult().__iterator(type,reverse)}var iterator=iterable.__iterator(ITERATE_ENTRIES,reverse);var skipping=true;var iterations=0;return new Iterator(function(){var step,k,v;do{step=iterator.next();if(step.done){if(useKeys||type===ITERATE_VALUES){return step}else if(type===ITERATE_KEYS){return iteratorValue(type,iterations++,undefined,step)}else{return iteratorValue(type,iterations++,step.value[1],step)}}var entry=step.value;k=entry[0];v=entry[1];skipping&&(skipping=predicate.call(context,v,k,this$0))}while(skipping);return type===ITERATE_ENTRIES?step:iteratorValue(type,k,v,step)})};return skipSequence}function concatFactory(iterable,values){var isKeyedIterable=isKeyed(iterable);var iters=[iterable].concat(values).map(function(v){if(!isIterable(v)){v=isKeyedIterable?keyedSeqFromValue(v):indexedSeqFromValue(Array.isArray(v)?v:[v])}else if(isKeyedIterable){v=KeyedIterable(v)}return v}).filter(function(v){return v.size!==0});if(iters.length===0){return iterable}if(iters.length===1){var singleton=iters[0];if(singleton===iterable||isKeyedIterable&&isKeyed(singleton)||isIndexed(iterable)&&isIndexed(singleton)){return singleton}}var concatSeq=new ArraySeq(iters);if(isKeyedIterable){concatSeq=concatSeq.toKeyedSeq()}else if(!isIndexed(iterable)){concatSeq=concatSeq.toSetSeq()}concatSeq=concatSeq.flatten(true);concatSeq.size=iters.reduce(function(sum,seq){if(sum!==undefined){var size=seq.size;if(size!==undefined){return sum+size}}},0);return concatSeq}function flattenFactory(iterable,depth,useKeys){var flatSequence=makeSequence(iterable);flatSequence.__iterateUncached=function(fn,reverse){var iterations=0;var stopped=false;function flatDeep(iter,currentDepth){var this$0=this;iter.__iterate(function(v,k){if((!depth||currentDepth<depth)&&isIterable(v)){flatDeep(v,currentDepth+1)}else if(fn(v,useKeys?k:iterations++,this$0)===false){stopped=true}return!stopped},reverse)}flatDeep(iterable,0);return iterations};flatSequence.__iteratorUncached=function(type,reverse){var iterator=iterable.__iterator(type,reverse);var stack=[];var iterations=0;return new Iterator(function(){while(iterator){var step=iterator.next();if(step.done!==false){iterator=stack.pop();continue}var v=step.value;if(type===ITERATE_ENTRIES){v=v[1]}
if((!depth||stack.length<depth)&&isIterable(v)){stack.push(iterator);iterator=v.__iterator(type,reverse)}else{return useKeys?step:iteratorValue(type,iterations++,v,step)}}return iteratorDone()})};return flatSequence}function flatMapFactory(iterable,mapper,context){var coerce=iterableClass(iterable);return iterable.toSeq().map(function(v,k){return coerce(mapper.call(context,v,k,iterable))}).flatten(true)}function interposeFactory(iterable,separator){var interposedSequence=makeSequence(iterable);interposedSequence.size=iterable.size&&iterable.size*2-1;interposedSequence.__iterateUncached=function(fn,reverse){var this$0=this;var iterations=0;iterable.__iterate(function(v,k){return(!iterations||fn(separator,iterations++,this$0)!==false)&&fn(v,iterations++,this$0)!==false},reverse);return iterations};interposedSequence.__iteratorUncached=function(type,reverse){var iterator=iterable.__iterator(ITERATE_VALUES,reverse);var iterations=0;var step;return new Iterator(function(){if(!step||iterations%2){step=iterator.next();if(step.done){return step}}return iterations%2?iteratorValue(type,iterations++,separator):iteratorValue(type,iterations++,step.value,step)})};return interposedSequence}function sortFactory(iterable,comparator,mapper){if(!comparator){comparator=defaultComparator}var isKeyedIterable=isKeyed(iterable);var index=0;var entries=iterable.toSeq().map(function(v,k){return[k,v,index++,mapper?mapper(v,k,iterable):v]}).toArray();entries.sort(function(a,b){return comparator(a[3],b[3])||a[2]-b[2]}).forEach(isKeyedIterable?function(v,i){entries[i].length=2}:function(v,i){entries[i]=v[1]});return isKeyedIterable?KeyedSeq(entries):isIndexed(iterable)?IndexedSeq(entries):SetSeq(entries)}function maxFactory(iterable,comparator,mapper){if(!comparator){comparator=defaultComparator}if(mapper){var entry=iterable.toSeq().map(function(v,k){return[v,mapper(v,k,iterable)]}).reduce(function(a,b){return maxCompare(comparator,a[1],b[1])?b:a});return entry&&entry[0]}else{return iterable.reduce(function(a,b){return maxCompare(comparator,a,b)?b:a})}}function maxCompare(comparator,a,b){var comp=comparator(b,a);return comp===0&&b!==a&&(b===undefined||b===null||b!==b)||comp>0}function zipWithFactory(keyIter,zipper,iters){var zipSequence=makeSequence(keyIter);zipSequence.size=new ArraySeq(iters).map(function(i){return i.size}).min();zipSequence.__iterate=function(fn,reverse){var iterator=this.__iterator(ITERATE_VALUES,reverse);var step;var iterations=0;while(!(step=iterator.next()).done){if(fn(step.value,iterations++,this)===false){break}}return iterations};zipSequence.__iteratorUncached=function(type,reverse){var iterators=iters.map(function(i){return i=Iterable(i),getIterator(reverse?i.reverse():i)});var iterations=0;var isDone=false;return new Iterator(function(){var steps;if(!isDone){steps=iterators.map(function(i){return i.next()});isDone=steps.some(function(s){return s.done})}if(isDone){return iteratorDone()}return iteratorValue(type,iterations++,zipper.apply(null,steps.map(function(s){return s.value})))})};return zipSequence}function reify(iter,seq){return isSeq(iter)?seq:iter.constructor(seq)}function validateEntry(entry){if(entry!==Object(entry)){throw new TypeError("Expected [K, V] tuple: "+entry)}}function resolveSize(iter){assertNotInfinite(iter.size);return ensureSize(iter)}function iterableClass(iterable){return isKeyed(iterable)?KeyedIterable:isIndexed(iterable)?IndexedIterable:SetIterable}function makeSequence(iterable){return Object.create((isKeyed(iterable)?KeyedSeq:isIndexed(iterable)?IndexedSeq:SetSeq).prototype)}function cacheResultThrough(){if(this._iter.cacheResult){this._iter.cacheResult();this.size=this._iter.size;return this}else{return Seq.prototype.cacheResult.call(this)}}function defaultComparator(a,b){return a>b?1:a<b?-1:0}function forceIterator(keyPath){var iter=getIterator(keyPath);if(!iter){if(!isArrayLike(keyPath)){throw new TypeError("Expected iterable or array-like: "+keyPath)}iter=getIterator(Iterable(keyPath))}return iter}createClass(Record,KeyedCollection);function Record(defaultValues,name){var hasInitialized;var RecordType=function Record(values){if(values instanceof RecordType){return values}if(!(this instanceof RecordType)){return new RecordType(values)}if(!hasInitialized){hasInitialized=true;var keys=Object.keys(defaultValues);setProps(RecordTypePrototype,keys);RecordTypePrototype.size=keys.length;RecordTypePrototype._name=name;RecordTypePrototype._keys=keys;RecordTypePrototype._defaultValues=defaultValues}this._map=Map(values)};var RecordTypePrototype=RecordType.prototype=Object.create(RecordPrototype);RecordTypePrototype.constructor=RecordType;return RecordType}Record.prototype.toString=function(){return this.__toString(recordName(this)+" {","}")};Record.prototype.has=function(k){return this._defaultValues.hasOwnProperty(k)};Record.prototype.get=function(k,notSetValue){if(!this.has(k)){return notSetValue}var defaultVal=this._defaultValues[k];return this._map?this._map.get(k,defaultVal):defaultVal};Record.prototype.clear=function(){if(this.__ownerID){this._map&&this._map.clear();return this}var RecordType=this.constructor;return RecordType._empty||(RecordType._empty=makeRecord(this,emptyMap()))};Record.prototype.set=function(k,v){if(!this.has(k)){throw new Error('Cannot set unknown key "'+k+'" on '+recordName(this))}if(this._map&&!this._map.has(k)){var defaultVal=this._defaultValues[k];if(v===defaultVal){return this}}var newMap=this._map&&this._map.set(k,v);if(this.__ownerID||newMap===this._map){return this}return makeRecord(this,newMap)};Record.prototype.remove=function(k){if(!this.has(k)){return this}var newMap=this._map&&this._map.remove(k);if(this.__ownerID||newMap===this._map){return this}return makeRecord(this,newMap)};Record.prototype.wasAltered=function(){return this._map.wasAltered()};Record.prototype.__iterator=function(type,reverse){var this$0=this;return KeyedIterable(this._defaultValues).map(function(_,k){return this$0.get(k)}).__iterator(type,reverse)};Record.prototype.__iterate=function(fn,reverse){var this$0=this;return KeyedIterable(this._defaultValues).map(function(_,k){return this$0.get(k)}).__iterate(fn,reverse)};Record.prototype.__ensureOwner=function(ownerID){if(ownerID===this.__ownerID){return this}var newMap=this._map&&this._map.__ensureOwner(ownerID);if(!ownerID){this.__ownerID=ownerID;this._map=newMap;return this}return makeRecord(this,newMap,ownerID)};var RecordPrototype=Record.prototype;RecordPrototype[DELETE]=RecordPrototype.remove;RecordPrototype.deleteIn=RecordPrototype.removeIn=MapPrototype.removeIn;RecordPrototype.merge=MapPrototype.merge;RecordPrototype.mergeWith=MapPrototype.mergeWith;RecordPrototype.mergeIn=MapPrototype.mergeIn;RecordPrototype.mergeDeep=MapPrototype.mergeDeep;RecordPrototype.mergeDeepWith=MapPrototype.mergeDeepWith;RecordPrototype.mergeDeepIn=MapPrototype.mergeDeepIn;RecordPrototype.setIn=MapPrototype.setIn;RecordPrototype.update=MapPrototype.update;RecordPrototype.updateIn=MapPrototype.updateIn;RecordPrototype.withMutations=MapPrototype.withMutations;RecordPrototype.asMutable=MapPrototype.asMutable;RecordPrototype.asImmutable=MapPrototype.asImmutable;function makeRecord(likeRecord,map,ownerID){var record=Object.create(Object.getPrototypeOf(likeRecord));record._map=map;record.__ownerID=ownerID;return record}function recordName(record){return record._name||record.constructor.name||"Record"}function setProps(prototype,names){try{names.forEach(setProp.bind(undefined,prototype))}catch(error){}}function setProp(prototype,name){Object.defineProperty(prototype,name,{get:function(){return this.get(name)},set:function(value){invariant(this.__ownerID,"Cannot set on an immutable record.");this.set(name,value)}})}createClass(Set,SetCollection);function Set(value){return value===null||value===undefined?emptySet():isSet(value)&&!isOrdered(value)?value:emptySet().withMutations(function(set){var iter=SetIterable(value);assertNotInfinite(iter.size);iter.forEach(function(v){return set.add(v)})})}Set.of=function(){return this(arguments)};Set.fromKeys=function(value){return this(KeyedIterable(value).keySeq())};Set.prototype.toString=function(){return this.__toString("Set {","}")};Set.prototype.has=function(value){return this._map.has(value)};Set.prototype.add=function(value){return updateSet(this,this._map.set(value,true))};Set.prototype.remove=function(value){return updateSet(this,this._map.remove(value))};Set.prototype.clear=function(){return updateSet(this,this._map.clear())};Set.prototype.union=function(){var iters=SLICE$0.call(arguments,0);iters=iters.filter(function(x){return x.size!==0});if(iters.length===0){return this}if(this.size===0&&!this.__ownerID&&iters.length===1){return this.constructor(iters[0])}return this.withMutations(function(set){for(var ii=0;ii<iters.length;ii++){SetIterable(iters[ii]).forEach(function(value){return set.add(value)})}})};Set.prototype.intersect=function(){var iters=SLICE$0.call(arguments,0);if(iters.length===0){return this}iters=iters.map(function(iter){return SetIterable(iter)});var originalSet=this;return this.withMutations(function(set){originalSet.forEach(function(value){if(!iters.every(function(iter){return iter.includes(value)})){set.remove(value)}})})};Set.prototype.subtract=function(){var iters=SLICE$0.call(arguments,0);if(iters.length===0){return this}iters=iters.map(function(iter){return SetIterable(iter)});var originalSet=this;return this.withMutations(function(set){originalSet.forEach(function(value){if(iters.some(function(iter){return iter.includes(value)})){set.remove(value)}})})};Set.prototype.merge=function(){return this.union.apply(this,arguments)};Set.prototype.mergeWith=function(merger){var iters=SLICE$0.call(arguments,1);return this.union.apply(this,iters)};Set.prototype.sort=function(comparator){return OrderedSet(sortFactory(this,comparator))};Set.prototype.sortBy=function(mapper,comparator){return OrderedSet(sortFactory(this,comparator,mapper))};Set.prototype.wasAltered=function(){return this._map.wasAltered()};Set.prototype.__iterate=function(fn,reverse){var this$0=this;return this._map.__iterate(function(_,k){return fn(k,k,this$0)},reverse)};Set.prototype.__iterator=function(type,reverse){return this._map.map(function(_,k){return k}).__iterator(type,reverse)};Set.prototype.__ensureOwner=function(ownerID){if(ownerID===this.__ownerID){return this}var newMap=this._map.__ensureOwner(ownerID);if(!ownerID){this.__ownerID=ownerID;this._map=newMap;return this}return this.__make(newMap,ownerID)};function isSet(maybeSet){return!!(maybeSet&&maybeSet[IS_SET_SENTINEL])}Set.isSet=isSet;var IS_SET_SENTINEL="@@__IMMUTABLE_SET__@@";var SetPrototype=Set.prototype;SetPrototype[IS_SET_SENTINEL]=true;SetPrototype[DELETE]=SetPrototype.remove;SetPrototype.mergeDeep=SetPrototype.merge;SetPrototype.mergeDeepWith=SetPrototype.mergeWith;SetPrototype.withMutations=MapPrototype.withMutations;SetPrototype.asMutable=MapPrototype.asMutable;SetPrototype.asImmutable=MapPrototype.asImmutable;SetPrototype.__empty=emptySet;SetPrototype.__make=makeSet;function updateSet(set,newMap){if(set.__ownerID){set.size=newMap.size;set._map=newMap;return set}return newMap===set._map?set:newMap.size===0?set.__empty():set.__make(newMap)}function makeSet(map,ownerID){var set=Object.create(SetPrototype);set.size=map?map.size:0;set._map=map;set.__ownerID=ownerID;return set}var EMPTY_SET;function emptySet(){return EMPTY_SET||(EMPTY_SET=makeSet(emptyMap()))}createClass(OrderedSet,Set);function OrderedSet(value){return value===null||value===undefined?emptyOrderedSet():isOrderedSet(value)?value:emptyOrderedSet().withMutations(function(set){var iter=SetIterable(value);assertNotInfinite(iter.size);iter.forEach(function(v){return set.add(v)})})}OrderedSet.of=function(){return this(arguments)};OrderedSet.fromKeys=function(value){return this(KeyedIterable(value).keySeq())};OrderedSet.prototype.toString=function(){return this.__toString("OrderedSet {","}")};function isOrderedSet(maybeOrderedSet){return isSet(maybeOrderedSet)&&isOrdered(maybeOrderedSet)}OrderedSet.isOrderedSet=isOrderedSet;var OrderedSetPrototype=OrderedSet.prototype;OrderedSetPrototype[IS_ORDERED_SENTINEL]=true;OrderedSetPrototype.__empty=emptyOrderedSet;OrderedSetPrototype.__make=makeOrderedSet;function makeOrderedSet(map,ownerID){var set=Object.create(OrderedSetPrototype);set.size=map?map.size:0;set._map=map;set.__ownerID=ownerID;return set}var EMPTY_ORDERED_SET;function emptyOrderedSet(){return EMPTY_ORDERED_SET||(EMPTY_ORDERED_SET=makeOrderedSet(emptyOrderedMap()))}createClass(Stack,IndexedCollection);function Stack(value){return value===null||value===undefined?emptyStack():isStack(value)?value:emptyStack().unshiftAll(value)}Stack.of=function(){return this(arguments)};Stack.prototype.toString=function(){return this.__toString("Stack [","]")};Stack.prototype.get=function(index,notSetValue){var head=this._head;index=wrapIndex(this,index);while(head&&index--){head=head.next}return head?head.value:notSetValue};Stack.prototype.peek=function(){return this._head&&this._head.value};Stack.prototype.push=function(){if(arguments.length===0){return this}var newSize=this.size+arguments.length;var head=this._head;for(var ii=arguments.length-1;ii>=0;ii--){head={value:arguments[ii],next:head}}if(this.__ownerID){this.size=newSize;this._head=head;this.__hash=undefined;this.__altered=true;return this}return makeStack(newSize,head)};Stack.prototype.pushAll=function(iter){iter=IndexedIterable(iter);if(iter.size===0){return this}assertNotInfinite(iter.size);var newSize=this.size;var head=this._head;iter.reverse().forEach(function(value){newSize++;head={value:value,next:head}});if(this.__ownerID){this.size=newSize;this._head=head;this.__hash=undefined;this.__altered=true;return this}return makeStack(newSize,head)};Stack.prototype.pop=function(){return this.slice(1)};Stack.prototype.unshift=function(){return this.push.apply(this,arguments)};Stack.prototype.unshiftAll=function(iter){return this.pushAll(iter)};Stack.prototype.shift=function(){return this.pop.apply(this,arguments)};Stack.prototype.clear=function(){if(this.size===0){return this}if(this.__ownerID){this.size=0;this._head=undefined;this.__hash=undefined;this.__altered=true;return this}return emptyStack()};Stack.prototype.slice=function(begin,end){if(wholeSlice(begin,end,this.size)){return this}var resolvedBegin=resolveBegin(begin,this.size);var resolvedEnd=resolveEnd(end,this.size);if(resolvedEnd!==this.size){return IndexedCollection.prototype.slice.call(this,begin,end)}var newSize=this.size-resolvedBegin;var head=this._head;while(resolvedBegin--){head=head.next}if(this.__ownerID){this.size=newSize;this._head=head;this.__hash=undefined;this.__altered=true;return this}return makeStack(newSize,head)};Stack.prototype.__ensureOwner=function(ownerID){if(ownerID===this.__ownerID){return this}if(!ownerID){this.__ownerID=ownerID;this.__altered=false;return this}return makeStack(this.size,this._head,ownerID,this.__hash)};Stack.prototype.__iterate=function(fn,reverse){if(reverse){return this.reverse().__iterate(fn)}var iterations=0;var node=this._head;while(node){if(fn(node.value,iterations++,this)===false){break}node=node.next}return iterations};Stack.prototype.__iterator=function(type,reverse){if(reverse){return this.reverse().__iterator(type)}var iterations=0;var node=this._head;return new Iterator(function(){if(node){var value=node.value;node=node.next;return iteratorValue(type,iterations++,value)}return iteratorDone()})};function isStack(maybeStack){return!!(maybeStack&&maybeStack[IS_STACK_SENTINEL])}Stack.isStack=isStack;var IS_STACK_SENTINEL="@@__IMMUTABLE_STACK__@@";var StackPrototype=Stack.prototype;StackPrototype[IS_STACK_SENTINEL]=true;StackPrototype.withMutations=MapPrototype.withMutations;StackPrototype.asMutable=MapPrototype.asMutable;StackPrototype.asImmutable=MapPrototype.asImmutable;StackPrototype.wasAltered=MapPrototype.wasAltered;function makeStack(size,head,ownerID,hash){var map=Object.create(StackPrototype);map.size=size;map._head=head;map.__ownerID=ownerID;map.__hash=hash;map.__altered=false;return map}var EMPTY_STACK;function emptyStack(){return EMPTY_STACK||(EMPTY_STACK=makeStack(0))}function mixin(ctor,methods){var keyCopier=function(key){ctor.prototype[key]=methods[key]};Object.keys(methods).forEach(keyCopier);Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(methods).forEach(keyCopier);return ctor}Iterable.Iterator=Iterator;mixin(Iterable,{toArray:function(){assertNotInfinite(this.size);var array=new Array(this.size||0);this.valueSeq().__iterate(function(v,i){array[i]=v});return array},toIndexedSeq:function(){return new ToIndexedSequence(this)},toJS:function(){return this.toSeq().map(function(value){return value&&typeof value.toJS==="function"?value.toJS():value}).__toJS()},toJSON:function(){return this.toSeq().map(function(value){return value&&typeof value.toJSON==="function"?value.toJSON():value}).__toJS()},toKeyedSeq:function(){return new ToKeyedSequence(this,true)},toMap:function(){return Map(this.toKeyedSeq())},toObject:function(){assertNotInfinite(this.size);var object={};this.__iterate(function(v,k){object[k]=v});return object},toOrderedMap:function(){return OrderedMap(this.toKeyedSeq())},toOrderedSet:function(){return OrderedSet(isKeyed(this)?this.valueSeq():this)},toSet:function(){return Set(isKeyed(this)?this.valueSeq():this)},toSetSeq:function(){return new ToSetSequence(this)},toSeq:function(){return isIndexed(this)?this.toIndexedSeq():isKeyed(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Stack(isKeyed(this)?this.valueSeq():this)},toList:function(){return List(isKeyed(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(head,tail){if(this.size===0){return head+tail}return head+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+tail},concat:function(){var values=SLICE$0.call(arguments,0);return reify(this,concatFactory(this,values))},includes:function(searchValue){return this.some(function(value){return is(value,searchValue)})},entries:function(){return this.__iterator(ITERATE_ENTRIES)},every:function(predicate,context){assertNotInfinite(this.size);var returnValue=true;this.__iterate(function(v,k,c){if(!predicate.call(context,v,k,c)){returnValue=false;return false}});return returnValue},filter:function(predicate,context){return reify(this,filterFactory(this,predicate,context,true))},find:function(predicate,context,notSetValue){var entry=this.findEntry(predicate,context);return entry?entry[1]:notSetValue},forEach:function(sideEffect,context){assertNotInfinite(this.size);return this.__iterate(context?sideEffect.bind(context):sideEffect)},join:function(separator){assertNotInfinite(this.size);separator=separator!==undefined?""+separator:",";var joined="";var isFirst=true;this.__iterate(function(v){isFirst?isFirst=false:joined+=separator;joined+=v!==null&&v!==undefined?v.toString():""});return joined},keys:function(){return this.__iterator(ITERATE_KEYS)},map:function(mapper,context){return reify(this,mapFactory(this,mapper,context))},reduce:function(reducer,initialReduction,context){assertNotInfinite(this.size);var reduction;var useFirst;if(arguments.length<2){useFirst=true}else{reduction=initialReduction}this.__iterate(function(v,k,c){if(useFirst){useFirst=false;reduction=v}else{reduction=reducer.call(context,reduction,v,k,c)}});return reduction},reduceRight:function(reducer,initialReduction,context){var reversed=this.toKeyedSeq().reverse();return reversed.reduce.apply(reversed,arguments)},reverse:function(){return reify(this,reverseFactory(this,true))},slice:function(begin,end){return reify(this,sliceFactory(this,begin,end,true))},some:function(predicate,context){return!this.every(not(predicate),context)},sort:function(comparator){return reify(this,sortFactory(this,comparator))},values:function(){return this.__iterator(ITERATE_VALUES)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return this.size!==undefined?this.size===0:!this.some(function(){return true})},count:function(predicate,context){return ensureSize(predicate?this.toSeq().filter(predicate,context):this)},countBy:function(grouper,context){return countByFactory(this,grouper,context)},equals:function(other){return deepEqual(this,other)},entrySeq:function(){var iterable=this;if(iterable._cache){return new ArraySeq(iterable._cache)}var entriesSequence=iterable.toSeq().map(entryMapper).toIndexedSeq();entriesSequence.fromEntrySeq=function(){return iterable.toSeq()};return entriesSequence},filterNot:function(predicate,context){return this.filter(not(predicate),context)},findEntry:function(predicate,context,notSetValue){var found=notSetValue;this.__iterate(function(v,k,c){if(predicate.call(context,v,k,c)){found=[k,v];return false}});return found},findKey:function(predicate,context){var entry=this.findEntry(predicate,context);return entry&&entry[0]},findLast:function(predicate,context,notSetValue){return this.toKeyedSeq().reverse().find(predicate,context,notSetValue)},findLastEntry:function(predicate,context,notSetValue){return this.toKeyedSeq().reverse().findEntry(predicate,context,notSetValue)},findLastKey:function(predicate,context){return this.toKeyedSeq().reverse().findKey(predicate,context)},first:function(){return this.find(returnTrue)},flatMap:function(mapper,context){return reify(this,flatMapFactory(this,mapper,context))},flatten:function(depth){return reify(this,flattenFactory(this,depth,true))},fromEntrySeq:function(){return new FromEntriesSequence(this)},get:function(searchKey,notSetValue){return this.find(function(_,key){return is(key,searchKey)},undefined,notSetValue)},getIn:function(searchKeyPath,notSetValue){var nested=this;var iter=forceIterator(searchKeyPath);var step;while(!(step=iter.next()).done){var key=step.value;nested=nested&&nested.get?nested.get(key,NOT_SET):NOT_SET;if(nested===NOT_SET){return notSetValue}}return nested},groupBy:function(grouper,context){return groupByFactory(this,grouper,context)},has:function(searchKey){return this.get(searchKey,NOT_SET)!==NOT_SET},hasIn:function(searchKeyPath){return this.getIn(searchKeyPath,NOT_SET)!==NOT_SET},isSubset:function(iter){iter=typeof iter.includes==="function"?iter:Iterable(iter);return this.every(function(value){return iter.includes(value)})},isSuperset:function(iter){iter=typeof iter.isSubset==="function"?iter:Iterable(iter);return iter.isSubset(this)},keyOf:function(searchValue){return this.findKey(function(value){return is(value,searchValue)})},keySeq:function(){return this.toSeq().map(keyMapper).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(searchValue){return this.toKeyedSeq().reverse().keyOf(searchValue)},max:function(comparator){return maxFactory(this,comparator)},maxBy:function(mapper,comparator){return maxFactory(this,comparator,mapper)},min:function(comparator){return maxFactory(this,comparator?neg(comparator):defaultNegComparator)},minBy:function(mapper,comparator){return maxFactory(this,comparator?neg(comparator):defaultNegComparator,mapper)},rest:function(){return this.slice(1)},skip:function(amount){return this.slice(Math.max(0,amount))},skipLast:function(amount){return reify(this,this.toSeq().reverse().skip(amount).reverse())},skipWhile:function(predicate,context){return reify(this,skipWhileFactory(this,predicate,context,true))},skipUntil:function(predicate,context){return this.skipWhile(not(predicate),context)},sortBy:function(mapper,comparator){return reify(this,sortFactory(this,comparator,mapper))},take:function(amount){return this.slice(0,Math.max(0,amount))},takeLast:function(amount){return reify(this,this.toSeq().reverse().take(amount).reverse())},takeWhile:function(predicate,context){return reify(this,takeWhileFactory(this,predicate,context))},takeUntil:function(predicate,context){return this.takeWhile(not(predicate),context)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=hashIterable(this))}});var IterablePrototype=Iterable.prototype;IterablePrototype[IS_ITERABLE_SENTINEL]=true;IterablePrototype[ITERATOR_SYMBOL]=IterablePrototype.values;IterablePrototype.__toJS=IterablePrototype.toArray;IterablePrototype.__toStringMapper=quoteString;IterablePrototype.inspect=IterablePrototype.toSource=function(){return this.toString()};IterablePrototype.chain=IterablePrototype.flatMap;IterablePrototype.contains=IterablePrototype.includes;mixin(KeyedIterable,{flip:function(){return reify(this,flipFactory(this))},mapEntries:function(mapper,context){var this$0=this;var iterations=0;return reify(this,this.toSeq().map(function(v,k){return mapper.call(context,[k,v],iterations++,this$0)}).fromEntrySeq())},mapKeys:function(mapper,context){var this$0=this;return reify(this,this.toSeq().flip().map(function(k,v){return mapper.call(context,k,v,this$0)}).flip())}});var KeyedIterablePrototype=KeyedIterable.prototype;KeyedIterablePrototype[IS_KEYED_SENTINEL]=true;KeyedIterablePrototype[ITERATOR_SYMBOL]=IterablePrototype.entries;KeyedIterablePrototype.__toJS=IterablePrototype.toObject;KeyedIterablePrototype.__toStringMapper=function(v,k){return JSON.stringify(k)+": "+quoteString(v)};mixin(IndexedIterable,{toKeyedSeq:function(){return new ToKeyedSequence(this,false)},filter:function(predicate,context){return reify(this,filterFactory(this,predicate,context,false))},findIndex:function(predicate,context){var entry=this.findEntry(predicate,context);return entry?entry[0]:-1},indexOf:function(searchValue){var key=this.keyOf(searchValue);return key===undefined?-1:key},lastIndexOf:function(searchValue){var key=this.lastKeyOf(searchValue);return key===undefined?-1:key},reverse:function(){return reify(this,reverseFactory(this,false))},slice:function(begin,end){return reify(this,sliceFactory(this,begin,end,false))},splice:function(index,removeNum){var numArgs=arguments.length;removeNum=Math.max(removeNum|0,0);if(numArgs===0||numArgs===2&&!removeNum){return this}index=resolveBegin(index,index<0?this.count():this.size);var spliced=this.slice(0,index);return reify(this,numArgs===1?spliced:spliced.concat(arrCopy(arguments,2),this.slice(index+removeNum)))},findLastIndex:function(predicate,context){var entry=this.findLastEntry(predicate,context);return entry?entry[0]:-1},first:function(){return this.get(0)},flatten:function(depth){return reify(this,flattenFactory(this,depth,false))},get:function(index,notSetValue){index=wrapIndex(this,index);return index<0||(this.size===Infinity||this.size!==undefined&&index>this.size)?notSetValue:this.find(function(_,key){return key===index},undefined,notSetValue)},has:function(index){index=wrapIndex(this,index);return index>=0&&(this.size!==undefined?this.size===Infinity||index<this.size:this.indexOf(index)!==-1)},interpose:function(separator){return reify(this,interposeFactory(this,separator))},interleave:function(){var iterables=[this].concat(arrCopy(arguments));var zipped=zipWithFactory(this.toSeq(),IndexedSeq.of,iterables);var interleaved=zipped.flatten(true);if(zipped.size){interleaved.size=zipped.size*iterables.length}return reify(this,interleaved)},keySeq:function(){return Range(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(predicate,context){return reify(this,skipWhileFactory(this,predicate,context,false))},zip:function(){var iterables=[this].concat(arrCopy(arguments));return reify(this,zipWithFactory(this,defaultZipper,iterables))},zipWith:function(zipper){var iterables=arrCopy(arguments);iterables[0]=this;return reify(this,zipWithFactory(this,zipper,iterables))}});IndexedIterable.prototype[IS_INDEXED_SENTINEL]=true;IndexedIterable.prototype[IS_ORDERED_SENTINEL]=true;mixin(SetIterable,{get:function(value,notSetValue){return this.has(value)?value:notSetValue},includes:function(value){return this.has(value)},keySeq:function(){return this.valueSeq()}});SetIterable.prototype.has=IterablePrototype.includes;SetIterable.prototype.contains=SetIterable.prototype.includes;mixin(KeyedSeq,KeyedIterable.prototype);mixin(IndexedSeq,IndexedIterable.prototype);mixin(SetSeq,SetIterable.prototype);mixin(KeyedCollection,KeyedIterable.prototype);mixin(IndexedCollection,IndexedIterable.prototype);mixin(SetCollection,SetIterable.prototype);function keyMapper(v,k){return k}function entryMapper(v,k){return[k,v]}function not(predicate){return function(){return!predicate.apply(this,arguments)}}function neg(predicate){return function(){return-predicate.apply(this,arguments)}}function quoteString(value){return typeof value==="string"?JSON.stringify(value):String(value)}function defaultZipper(){return arrCopy(arguments)}function defaultNegComparator(a,b){return a<b?1:a>b?-1:0}function hashIterable(iterable){if(iterable.size===Infinity){return 0}var ordered=isOrdered(iterable);var keyed=isKeyed(iterable);var h=ordered?1:0;var size=iterable.__iterate(keyed?ordered?function(v,k){h=31*h+hashMerge(hash(v),hash(k))|0}:function(v,k){h=h+hashMerge(hash(v),hash(k))|0}:ordered?function(v){h=31*h+hash(v)|0}:function(v){h=h+hash(v)|0});return murmurHashOfSize(size,h)}function murmurHashOfSize(size,h){h=imul(h,3432918353);h=imul(h<<15|h>>>-15,461845907);h=imul(h<<13|h>>>-13,5);h=(h+3864292196|0)^size;h=imul(h^h>>>16,2246822507);h=imul(h^h>>>13,3266489909);h=smi(h^h>>>16);return h}function hashMerge(a,b){return a^b+2654435769+(a<<6)+(a>>2)|0}var Immutable={Iterable:Iterable,Seq:Seq,Collection:Collection,Map:Map,OrderedMap:OrderedMap,List:List,Stack:Stack,Set:Set,OrderedSet:OrderedSet,Record:Record,Range:Range,Repeat:Repeat,is:is,fromJS:fromJS};return Immutable})},{}],69:[function(require,module,exports){var process=module.exports={};var cachedSetTimeout;var cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){cachedSetTimeout=setTimeout}else{cachedSetTimeout=defaultSetTimout}}catch(e){cachedSetTimeout=defaultSetTimout}try{if(typeof clearTimeout==="function"){cachedClearTimeout=clearTimeout}else{cachedClearTimeout=defaultClearTimeout}}catch(e){cachedClearTimeout=defaultClearTimeout}})();function runTimeout(fun){if(cachedSetTimeout===setTimeout){return setTimeout(fun,0)}if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout){cachedSetTimeout=setTimeout;return setTimeout(fun,0)}try{return cachedSetTimeout(fun,0)}catch(e){try{return cachedSetTimeout.call(null,fun,0)}catch(e){return cachedSetTimeout.call(this,fun,0)}}}function runClearTimeout(marker){if(cachedClearTimeout===clearTimeout){return clearTimeout(marker)}if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout){cachedClearTimeout=clearTimeout;return clearTimeout(marker)}try{return cachedClearTimeout(marker)}catch(e){try{return cachedClearTimeout.call(null,marker)}catch(e){return cachedClearTimeout.call(this,marker)}}}var queue=[];var draining=false;var currentQueue;var queueIndex=-1;function cleanUpNextTick(){if(!draining||!currentQueue){return}draining=false;if(currentQueue.length){queue=currentQueue.concat(queue)}else{queueIndex=-1}if(queue.length){drainQueue()}}function drainQueue(){if(draining){return}var timeout=runTimeout(cleanUpNextTick);draining=true;var len=queue.length;while(len){currentQueue=queue;queue=[];while(++queueIndex<len){if(currentQueue){currentQueue[queueIndex].run()}}queueIndex=-1;len=queue.length}currentQueue=null;draining=false;runClearTimeout(timeout)}process.nextTick=function(fun){var args=new Array(arguments.length-1);if(arguments.length>1){for(var i=1;i<arguments.length;i++){args[i-1]=arguments[i]}}queue.push(new Item(fun,args));if(queue.length===1&&!draining){runTimeout(drainQueue)}};function Item(fun,array){this.fun=fun;this.array=array}Item.prototype.run=function(){this.fun.apply(null,this.array)};process.title="browser";process.browser=true;process.env={};process.argv=[];process.version="";process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop
;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.prependListener=noop;process.prependOnceListener=noop;process.listeners=function(name){return[]};process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")};process.umask=function(){return 0}},{}],70:[function(require,module,exports){(function(process,setImmediate){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function microtask(){if(typeof MutationObserver!=="undefined"){var node_1=document.createTextNode("");var queue_1=[];var i_1=0;new MutationObserver(function(){while(queue_1.length){queue_1.shift()()}}).observe(node_1,{characterData:true});return function(fn){queue_1.push(fn);node_1.data=i_1=1-i_1}}else if(typeof setImmediate!=="undefined"){return setImmediate}else if(typeof process!=="undefined"){return process.nextTick}else{return setTimeout}}exports.default=microtask}).call(this,require("_process"),require("timers").setImmediate)},{_process:69,timers:92}],71:[function(require,module,exports){"use strict";var selectorParser_1=require("./selectorParser");function classNameFromVNode(vNode){var _a=selectorParser_1.selectorParser(vNode).className,cn=_a===void 0?"":_a;if(!vNode.data){return cn}var _b=vNode.data,dataClass=_b.class,props=_b.props;if(dataClass){var c=Object.keys(dataClass).filter(function(cl){return dataClass[cl]});cn+=" "+c.join(" ")}if(props&&props.className){cn+=" "+props.className}return cn&&cn.trim()}exports.classNameFromVNode=classNameFromVNode},{"./selectorParser":77}],72:[function(require,module,exports){"use strict";function curry2(select){return function selector(sel,vNode){switch(arguments.length){case 0:return select;case 1:return function(_vNode){return select(sel,_vNode)};default:return select(sel,vNode)}}}exports.curry2=curry2},{}],73:[function(require,module,exports){"use strict";var query_1=require("./query");var parent_symbol_1=require("./parent-symbol");function findMatches(cssSelector,vNode){traverseVNode(vNode,addParent);return query_1.querySelector(cssSelector,vNode)}exports.findMatches=findMatches;function traverseVNode(vNode,f){function recurse(currentNode,isParent,parentVNode){var length=currentNode.children&¤tNode.children.length||0;for(var i=0;i<length;++i){var children=currentNode.children;if(children&&children[i]&&typeof children[i]!=="string"){var child=children[i];recurse(child,false,currentNode)}}f(currentNode,isParent,isParent?void 0:parentVNode)}recurse(vNode,true)}function addParent(vNode,isParent,parent){if(isParent){return void 0}if(!vNode.data){vNode.data={}}if(!vNode.data[parent_symbol_1.default]){Object.defineProperty(vNode.data,parent_symbol_1.default,{value:parent})}}},{"./parent-symbol":75,"./query":76}],74:[function(require,module,exports){"use strict";var curry2_1=require("./curry2");var findMatches_1=require("./findMatches");exports.select=curry2_1.curry2(findMatches_1.findMatches);var selectorParser_1=require("./selectorParser");exports.selectorParser=selectorParser_1.selectorParser;var classNameFromVNode_1=require("./classNameFromVNode");exports.classNameFromVNode=classNameFromVNode_1.classNameFromVNode},{"./classNameFromVNode":71,"./curry2":72,"./findMatches":73,"./selectorParser":77}],75:[function(require,module,exports){(function(global){"use strict";var root;if(typeof self!=="undefined"){root=self}else if(typeof window!=="undefined"){root=window}else if(typeof global!=="undefined"){root=global}else{root=Function("return this")()}var Symbol=root.Symbol;var parentSymbol;if(typeof Symbol==="function"){parentSymbol=Symbol("parent")}else{parentSymbol="@@snabbdom-selector-parent"}Object.defineProperty(exports,"__esModule",{value:true});exports.default=parentSymbol}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],76:[function(require,module,exports){"use strict";var tree_selector_1=require("tree-selector");var selectorParser_1=require("./selectorParser");var classNameFromVNode_1=require("./classNameFromVNode");var parent_symbol_1=require("./parent-symbol");var options={tag:function(vNode){return selectorParser_1.selectorParser(vNode).tagName},className:function(vNode){return classNameFromVNode_1.classNameFromVNode(vNode)},id:function(vNode){return selectorParser_1.selectorParser(vNode).id||""},children:function(vNode){return vNode.children||[]},parent:function(vNode){return vNode.data[parent_symbol_1.default]||vNode},contents:function(vNode){return vNode.text||""},attr:function(vNode,attr){if(vNode.data){var _a=vNode.data,_b=_a.attrs,attrs=_b===void 0?{}:_b,_c=_a.props,props=_c===void 0?{}:_c;if(attrs[attr]){return attrs[attr]}if(props[attr]){return props[attr]}}}};var matches=tree_selector_1.createMatches(options);function customMatches(sel,vnode){var data=vnode.data;var selector=matches.bind(null,sel);if(data&&data.fn){var n=void 0;if(Array.isArray(data.args)){n=data.fn.apply(null,data.args)}else if(data.args){n=data.fn.call(null,data.args)}else{n=data.fn()}return selector(n)?n:false}return selector(vnode)}exports.querySelector=tree_selector_1.createQuerySelector(options,customMatches)},{"./classNameFromVNode":71,"./parent-symbol":75,"./selectorParser":77,"tree-selector":93}],77:[function(require,module,exports){"use strict";function selectorParser(node){if(!node.sel){return{tagName:"",id:"",className:""}}var sel=node.sel;var hashIdx=sel.indexOf("#");var dotIdx=sel.indexOf(".",hashIdx);var hash=hashIdx>0?hashIdx:sel.length;var dot=dotIdx>0?dotIdx:sel.length;var tagName=hashIdx!==-1||dotIdx!==-1?sel.slice(0,Math.min(hash,dot)):sel;var id=hash<dot?sel.slice(hash+1,dot):void 0;var className=dotIdx>0?sel.slice(dot+1).replace(/\./g," "):void 0;return{tagName:tagName,id:id,className:className}}exports.selectorParser=selectorParser},{}],78:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var vnode_1=require("./vnode");var is=require("./is");function addNS(data,children,sel){data.ns="path_to_url";if(sel!=="foreignObject"&&children!==undefined){for(var i=0;i<children.length;++i){var childData=children[i].data;if(childData!==undefined){addNS(childData,children[i].children,children[i].sel)}}}}function h(sel,b,c){var data={},children,text,i;if(c!==undefined){data=b;if(is.array(c)){children=c}else if(is.primitive(c)){text=c}else if(c&&c.sel){children=[c]}}else if(b!==undefined){if(is.array(b)){children=b}else if(is.primitive(b)){text=b}else if(b&&b.sel){children=[b]}else{data=b}}if(is.array(children)){for(i=0;i<children.length;++i){if(is.primitive(children[i]))children[i]=vnode_1.vnode(undefined,undefined,undefined,children[i],undefined)}}if(sel[0]==="s"&&sel[1]==="v"&&sel[2]==="g"&&(sel.length===3||sel[3]==="."||sel[3]==="#")){addNS(data,children,sel)}return vnode_1.vnode(sel,data,children,text,undefined)}exports.h=h;exports.default=h},{"./is":80,"./vnode":89}],79:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function createElement(tagName){return document.createElement(tagName)}function createElementNS(namespaceURI,qualifiedName){return document.createElementNS(namespaceURI,qualifiedName)}function createTextNode(text){return document.createTextNode(text)}function createComment(text){return document.createComment(text)}function insertBefore(parentNode,newNode,referenceNode){parentNode.insertBefore(newNode,referenceNode)}function removeChild(node,child){node.removeChild(child)}function appendChild(node,child){node.appendChild(child)}function parentNode(node){return node.parentNode}function nextSibling(node){return node.nextSibling}function tagName(elm){return elm.tagName}function setTextContent(node,text){node.textContent=text}function getTextContent(node){return node.textContent}function isElement(node){return node.nodeType===1}function isText(node){return node.nodeType===3}function isComment(node){return node.nodeType===8}exports.htmlDomApi={createElement:createElement,createElementNS:createElementNS,createTextNode:createTextNode,createComment:createComment,insertBefore:insertBefore,removeChild:removeChild,appendChild:appendChild,parentNode:parentNode,nextSibling:nextSibling,tagName:tagName,setTextContent:setTextContent,getTextContent:getTextContent,isElement:isElement,isText:isText,isComment:isComment};exports.default=exports.htmlDomApi},{}],80:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.array=Array.isArray;function primitive(s){return typeof s==="string"||typeof s==="number"}exports.primitive=primitive},{}],81:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var xlinkNS="path_to_url";var xmlNS="path_to_url";var colonChar=58;var xChar=120;function updateAttrs(oldVnode,vnode){var key,elm=vnode.elm,oldAttrs=oldVnode.data.attrs,attrs=vnode.data.attrs;if(!oldAttrs&&!attrs)return;if(oldAttrs===attrs)return;oldAttrs=oldAttrs||{};attrs=attrs||{};for(key in attrs){var cur=attrs[key];var old=oldAttrs[key];if(old!==cur){if(cur===true){elm.setAttribute(key,"")}else if(cur===false){elm.removeAttribute(key)}else{if(key.charCodeAt(0)!==xChar){elm.setAttribute(key,cur)}else if(key.charCodeAt(3)===colonChar){elm.setAttributeNS(xmlNS,key,cur)}else if(key.charCodeAt(5)===colonChar){elm.setAttributeNS(xlinkNS,key,cur)}else{elm.setAttribute(key,cur)}}}}for(key in oldAttrs){if(!(key in attrs)){elm.removeAttribute(key)}}}exports.attributesModule={create:updateAttrs,update:updateAttrs};exports.default=exports.attributesModule},{}],82:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function updateClass(oldVnode,vnode){var cur,name,elm=vnode.elm,oldClass=oldVnode.data.class,klass=vnode.data.class;if(!oldClass&&!klass)return;if(oldClass===klass)return;oldClass=oldClass||{};klass=klass||{};for(name in oldClass){if(!klass[name]){elm.classList.remove(name)}}for(name in klass){cur=klass[name];if(cur!==oldClass[name]){elm.classList[cur?"add":"remove"](name)}}}exports.classModule={create:updateClass,update:updateClass};exports.default=exports.classModule},{}],83:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var CAPS_REGEX=/[A-Z]/g;function updateDataset(oldVnode,vnode){var elm=vnode.elm,oldDataset=oldVnode.data.dataset,dataset=vnode.data.dataset,key;if(!oldDataset&&!dataset)return;if(oldDataset===dataset)return;oldDataset=oldDataset||{};dataset=dataset||{};var d=elm.dataset;for(key in oldDataset){if(!dataset[key]){if(d){if(key in d){delete d[key]}}else{elm.removeAttribute("data-"+key.replace(CAPS_REGEX,"-$&").toLowerCase())}}}for(key in dataset){if(oldDataset[key]!==dataset[key]){if(d){d[key]=dataset[key]}else{elm.setAttribute("data-"+key.replace(CAPS_REGEX,"-$&").toLowerCase(),dataset[key])}}}}exports.datasetModule={create:updateDataset,update:updateDataset};exports.default=exports.datasetModule},{}],84:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function updateProps(oldVnode,vnode){var key,cur,old,elm=vnode.elm,oldProps=oldVnode.data.props,props=vnode.data.props;if(!oldProps&&!props)return;if(oldProps===props)return;oldProps=oldProps||{};props=props||{};for(key in oldProps){if(!props[key]){delete elm[key]}}for(key in props){cur=props[key];old=oldProps[key];if(old!==cur&&(key!=="value"||elm[key]!==cur)){elm[key]=cur}}}exports.propsModule={create:updateProps,update:updateProps};exports.default=exports.propsModule},{}],85:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var raf=typeof window!=="undefined"&&window.requestAnimationFrame||setTimeout;var nextFrame=function(fn){raf(function(){raf(fn)})};function setNextFrame(obj,prop,val){nextFrame(function(){obj[prop]=val})}function updateStyle(oldVnode,vnode){var cur,name,elm=vnode.elm,oldStyle=oldVnode.data.style,style=vnode.data.style;if(!oldStyle&&!style)return;if(oldStyle===style)return;oldStyle=oldStyle||{};style=style||{};var oldHasDel="delayed"in oldStyle;for(name in oldStyle){if(!style[name]){if(name[0]==="-"&&name[1]==="-"){elm.style.removeProperty(name)}else{elm.style[name]=""}}}for(name in style){cur=style[name];if(name==="delayed"&&style.delayed){for(var name2 in style.delayed){cur=style.delayed[name2];if(!oldHasDel||cur!==oldStyle.delayed[name2]){setNextFrame(elm.style,name2,cur)}}}else if(name!=="remove"&&cur!==oldStyle[name]){if(name[0]==="-"&&name[1]==="-"){elm.style.setProperty(name,cur)}else{elm.style[name]=cur}}}}function applyDestroyStyle(vnode){var style,name,elm=vnode.elm,s=vnode.data.style;if(!s||!(style=s.destroy))return;for(name in style){elm.style[name]=style[name]}}function applyRemoveStyle(vnode,rm){var s=vnode.data.style;if(!s||!s.remove){rm();return}var name,elm=vnode.elm,i=0,compStyle,style=s.remove,amount=0,applied=[];for(name in style){applied.push(name);elm.style[name]=style[name]}compStyle=getComputedStyle(elm);var props=compStyle["transition-property"].split(", ");for(;i<props.length;++i){if(applied.indexOf(props[i])!==-1)amount++}elm.addEventListener("transitionend",function(ev){if(ev.target===elm)--amount;if(amount===0)rm()})}exports.styleModule={create:updateStyle,update:updateStyle,destroy:applyDestroyStyle,remove:applyRemoveStyle};exports.default=exports.styleModule},{}],86:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var vnode_1=require("./vnode");var is=require("./is");var htmldomapi_1=require("./htmldomapi");function isUndef(s){return s===undefined}function isDef(s){return s!==undefined}var emptyNode=vnode_1.default("",{},[],undefined,undefined);function sameVnode(vnode1,vnode2){return vnode1.key===vnode2.key&&vnode1.sel===vnode2.sel}function isVnode(vnode){return vnode.sel!==undefined}function createKeyToOldIdx(children,beginIdx,endIdx){var i,map={},key,ch;for(i=beginIdx;i<=endIdx;++i){ch=children[i];if(ch!=null){key=ch.key;if(key!==undefined)map[key]=i}}return map}var hooks=["create","update","remove","destroy","pre","post"];var h_1=require("./h");exports.h=h_1.h;var thunk_1=require("./thunk");exports.thunk=thunk_1.thunk;function init(modules,domApi){var i,j,cbs={};var api=domApi!==undefined?domApi:htmldomapi_1.default;for(i=0;i<hooks.length;++i){cbs[hooks[i]]=[];for(j=0;j<modules.length;++j){var hook=modules[j][hooks[i]];if(hook!==undefined){cbs[hooks[i]].push(hook)}}}function emptyNodeAt(elm){var id=elm.id?"#"+elm.id:"";var c=elm.className?"."+elm.className.split(" ").join("."):"";return vnode_1.default(api.tagName(elm).toLowerCase()+id+c,{},[],undefined,elm)}function createRmCb(childElm,listeners){return function rmCb(){if(--listeners===0){var parent_1=api.parentNode(childElm);api.removeChild(parent_1,childElm)}}}function createElm(vnode,insertedVnodeQueue){var i,data=vnode.data;if(data!==undefined){if(isDef(i=data.hook)&&isDef(i=i.init)){i(vnode);data=vnode.data}}var children=vnode.children,sel=vnode.sel;if(sel==="!"){if(isUndef(vnode.text)){vnode.text=""}vnode.elm=api.createComment(vnode.text)}else if(sel!==undefined){var hashIdx=sel.indexOf("#");var dotIdx=sel.indexOf(".",hashIdx);var hash=hashIdx>0?hashIdx:sel.length;var dot=dotIdx>0?dotIdx:sel.length;var tag=hashIdx!==-1||dotIdx!==-1?sel.slice(0,Math.min(hash,dot)):sel;var elm=vnode.elm=isDef(data)&&isDef(i=data.ns)?api.createElementNS(i,tag):api.createElement(tag);if(hash<dot)elm.setAttribute("id",sel.slice(hash+1,dot));if(dotIdx>0)elm.setAttribute("class",sel.slice(dot+1).replace(/\./g," "));for(i=0;i<cbs.create.length;++i)cbs.create[i](emptyNode,vnode);if(is.array(children)){for(i=0;i<children.length;++i){var ch=children[i];if(ch!=null){api.appendChild(elm,createElm(ch,insertedVnodeQueue))}}}else if(is.primitive(vnode.text)){api.appendChild(elm,api.createTextNode(vnode.text))}i=vnode.data.hook;if(isDef(i)){if(i.create)i.create(emptyNode,vnode);if(i.insert)insertedVnodeQueue.push(vnode)}}else{vnode.elm=api.createTextNode(vnode.text)}return vnode.elm}function addVnodes(parentElm,before,vnodes,startIdx,endIdx,insertedVnodeQueue){for(;startIdx<=endIdx;++startIdx){var ch=vnodes[startIdx];if(ch!=null){api.insertBefore(parentElm,createElm(ch,insertedVnodeQueue),before)}}}function invokeDestroyHook(vnode){var i,j,data=vnode.data;if(data!==undefined){if(isDef(i=data.hook)&&isDef(i=i.destroy))i(vnode);for(i=0;i<cbs.destroy.length;++i)cbs.destroy[i](vnode);if(vnode.children!==undefined){for(j=0;j<vnode.children.length;++j){i=vnode.children[j];if(i!=null&&typeof i!=="string"){invokeDestroyHook(i)}}}}}function removeVnodes(parentElm,vnodes,startIdx,endIdx){for(;startIdx<=endIdx;++startIdx){var i_1=void 0,listeners=void 0,rm=void 0,ch=vnodes[startIdx];if(ch!=null){if(isDef(ch.sel)){invokeDestroyHook(ch);listeners=cbs.remove.length+1;rm=createRmCb(ch.elm,listeners);for(i_1=0;i_1<cbs.remove.length;++i_1)cbs.remove[i_1](ch,rm);if(isDef(i_1=ch.data)&&isDef(i_1=i_1.hook)&&isDef(i_1=i_1.remove)){i_1(ch,rm)}else{rm()}}else{api.removeChild(parentElm,ch.elm)}}}}function updateChildren(parentElm,oldCh,newCh,insertedVnodeQueue){var oldStartIdx=0,newStartIdx=0;var oldEndIdx=oldCh.length-1;var oldStartVnode=oldCh[0];var oldEndVnode=oldCh[oldEndIdx];var newEndIdx=newCh.length-1;var newStartVnode=newCh[0];var newEndVnode=newCh[newEndIdx];var oldKeyToIdx;var idxInOld;var elmToMove;var before;while(oldStartIdx<=oldEndIdx&&newStartIdx<=newEndIdx){if(oldStartVnode==null){oldStartVnode=oldCh[++oldStartIdx]}else if(oldEndVnode==null){oldEndVnode=oldCh[--oldEndIdx]}else if(newStartVnode==null){newStartVnode=newCh[++newStartIdx]}else if(newEndVnode==null){newEndVnode=newCh[--newEndIdx]}else if(sameVnode(oldStartVnode,newStartVnode)){patchVnode(oldStartVnode,newStartVnode,insertedVnodeQueue);oldStartVnode=oldCh[++oldStartIdx];newStartVnode=newCh[++newStartIdx]}else if(sameVnode(oldEndVnode,newEndVnode)){patchVnode(oldEndVnode,newEndVnode,insertedVnodeQueue);oldEndVnode=oldCh[--oldEndIdx];newEndVnode=newCh[--newEndIdx]}else if(sameVnode(oldStartVnode,newEndVnode)){patchVnode(oldStartVnode,newEndVnode,insertedVnodeQueue);api.insertBefore(parentElm,oldStartVnode.elm,api.nextSibling(oldEndVnode.elm));oldStartVnode=oldCh[++oldStartIdx];newEndVnode=newCh[--newEndIdx]}else if(sameVnode(oldEndVnode,newStartVnode)){patchVnode(oldEndVnode,newStartVnode,insertedVnodeQueue);api.insertBefore(parentElm,oldEndVnode.elm,oldStartVnode.elm);oldEndVnode=oldCh[--oldEndIdx];newStartVnode=newCh[++newStartIdx]}else{if(oldKeyToIdx===undefined){oldKeyToIdx=createKeyToOldIdx(oldCh,oldStartIdx,oldEndIdx)}idxInOld=oldKeyToIdx[newStartVnode.key];if(isUndef(idxInOld)){api.insertBefore(parentElm,createElm(newStartVnode,insertedVnodeQueue),oldStartVnode.elm);newStartVnode=newCh[++newStartIdx]}else{elmToMove=oldCh[idxInOld];if(elmToMove.sel!==newStartVnode.sel){api.insertBefore(parentElm,createElm(newStartVnode,insertedVnodeQueue),oldStartVnode.elm)}else{patchVnode(elmToMove,newStartVnode,insertedVnodeQueue);oldCh[idxInOld]=undefined;api.insertBefore(parentElm,elmToMove.elm,oldStartVnode.elm)}newStartVnode=newCh[++newStartIdx]}}}if(oldStartIdx<=oldEndIdx||newStartIdx<=newEndIdx){if(oldStartIdx>oldEndIdx){before=newCh[newEndIdx+1]==null?null:newCh[newEndIdx+1].elm;addVnodes(parentElm,before,newCh,newStartIdx,newEndIdx,insertedVnodeQueue)}else{removeVnodes(parentElm,oldCh,oldStartIdx,oldEndIdx)}}}function patchVnode(oldVnode,vnode,insertedVnodeQueue){var i,hook;if(isDef(i=vnode.data)&&isDef(hook=i.hook)&&isDef(i=hook.prepatch)){i(oldVnode,vnode)}var elm=vnode.elm=oldVnode.elm;var oldCh=oldVnode.children;var ch=vnode.children;if(oldVnode===vnode)return;if(vnode.data!==undefined){for(i=0;i<cbs.update.length;++i)cbs.update[i](oldVnode,vnode);i=vnode.data.hook;if(isDef(i)&&isDef(i=i.update))i(oldVnode,vnode)}if(isUndef(vnode.text)){if(isDef(oldCh)&&isDef(ch)){if(oldCh!==ch)updateChildren(elm,oldCh,ch,insertedVnodeQueue)}else if(isDef(ch)){if(isDef(oldVnode.text))api.setTextContent(elm,"");addVnodes(elm,null,ch,0,ch.length-1,insertedVnodeQueue)}else if(isDef(oldCh)){removeVnodes(elm,oldCh,0,oldCh.length-1)}else if(isDef(oldVnode.text)){api.setTextContent(elm,"")}}else if(oldVnode.text!==vnode.text){api.setTextContent(elm,vnode.text)}if(isDef(hook)&&isDef(i=hook.postpatch)){i(oldVnode,vnode)}}return function patch(oldVnode,vnode){var i,elm,parent;var insertedVnodeQueue=[];for(i=0;i<cbs.pre.length;++i)cbs.pre[i]();if(!isVnode(oldVnode)){oldVnode=emptyNodeAt(oldVnode)}if(sameVnode(oldVnode,vnode)){patchVnode(oldVnode,vnode,insertedVnodeQueue)}else{elm=oldVnode.elm;parent=api.parentNode(elm);createElm(vnode,insertedVnodeQueue);if(parent!==null){api.insertBefore(parent,vnode.elm,api.nextSibling(elm));removeVnodes(parent,[oldVnode],0,0)}}for(i=0;i<insertedVnodeQueue.length;++i){insertedVnodeQueue[i].data.hook.insert(insertedVnodeQueue[i])}for(i=0;i<cbs.post.length;++i)cbs.post[i]();return vnode}}exports.init=init},{"./h":78,"./htmldomapi":79,"./is":80,"./thunk":87,"./vnode":89}],87:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var h_1=require("./h");function copyToThunk(vnode,thunk){thunk.elm=vnode.elm;vnode.data.fn=thunk.data.fn;vnode.data.args=thunk.data.args;thunk.data=vnode.data;thunk.children=vnode.children;thunk.text=vnode.text;thunk.elm=vnode.elm}function init(thunk){var cur=thunk.data;var vnode=cur.fn.apply(undefined,cur.args);copyToThunk(vnode,thunk)}function prepatch(oldVnode,thunk){var i,old=oldVnode.data,cur=thunk.data;var oldArgs=old.args,args=cur.args;if(old.fn!==cur.fn||oldArgs.length!==args.length){copyToThunk(cur.fn.apply(undefined,args),thunk);return}for(i=0;i<args.length;++i){if(oldArgs[i]!==args[i]){copyToThunk(cur.fn.apply(undefined,args),thunk);return}}copyToThunk(oldVnode,thunk)}exports.thunk=function thunk(sel,key,fn,args){if(args===undefined){args=fn;fn=key;key=undefined}return h_1.h(sel,{key:key,hook:{init:init,prepatch:prepatch},fn:fn,args:args})};exports.default=exports.thunk},{"./h":78}],88:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var vnode_1=require("./vnode");var htmldomapi_1=require("./htmldomapi");function toVNode(node,domApi){var api=domApi!==undefined?domApi:htmldomapi_1.default;var text;if(api.isElement(node)){var id=node.id?"#"+node.id:"";var cn=node.getAttribute("class");var c=cn?"."+cn.split(" ").join("."):"";var sel=api.tagName(node).toLowerCase()+id+c;var attrs={};var children=[];var name_1;var i=void 0,n=void 0;var elmAttrs=node.attributes;var elmChildren=node.childNodes;for(i=0,n=elmAttrs.length;i<n;i++){name_1=elmAttrs[i].nodeName;if(name_1!=="id"&&name_1!=="class"){attrs[name_1]=elmAttrs[i].nodeValue}}for(i=0,n=elmChildren.length;i<n;i++){children.push(toVNode(elmChildren[i]))}return vnode_1.default(sel,{attrs:attrs},children,undefined,node)}else if(api.isText(node)){text=api.getTextContent(node);return vnode_1.default(undefined,undefined,undefined,text,node)}else if(api.isComment(node)){text=api.getTextContent(node);return vnode_1.default("!",{},[],text,node)}else{return vnode_1.default("",{},[],undefined,node)}}exports.toVNode=toVNode;exports.default=toVNode},{"./htmldomapi":79,"./vnode":89}],89:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});function vnode(sel,data,children,text,elm){var key=data===undefined?undefined:data.key;return{sel:sel,data:data,children:children,text:text,elm:elm,key:key}}exports.vnode=vnode;exports.default=vnode},{}],90:[function(require,module,exports){(function(global){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _ponyfill=require("./ponyfill.js");var _ponyfill2=_interopRequireDefault(_ponyfill);function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var root;if(typeof self!=="undefined"){root=self}else if(typeof window!=="undefined"){root=window}else if(typeof global!=="undefined"){root=global}else if(typeof module!=="undefined"){root=module}else{root=Function("return this")()}var result=(0,_ponyfill2["default"])(root);exports["default"]=result}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{"./ponyfill.js":91}],91:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=symbolObservablePonyfill;function symbolObservablePonyfill(root){var result;var _Symbol=root.Symbol;if(typeof _Symbol==="function"){if(_Symbol.observable){result=_Symbol.observable}else{result=_Symbol("observable");_Symbol.observable=result}}else{result="@@observable"}return result}},{}],92:[function(require,module,exports){(function(setImmediate,clearImmediate){var nextTick=require("process/browser.js").nextTick;var apply=Function.prototype.apply;var slice=Array.prototype.slice;var immediateIds={};var nextImmediateId=0;exports.setTimeout=function(){return new Timeout(apply.call(setTimeout,window,arguments),clearTimeout)};exports.setInterval=function(){return new Timeout(apply.call(setInterval,window,arguments),clearInterval)};exports.clearTimeout=exports.clearInterval=function(timeout){timeout.close()};function Timeout(id,clearFn){this._id=id;this._clearFn=clearFn}Timeout.prototype.unref=Timeout.prototype.ref=function(){};Timeout.prototype.close=function(){this._clearFn.call(window,this._id)};exports.enroll=function(item,msecs){clearTimeout(item._idleTimeoutId);item._idleTimeout=msecs};exports.unenroll=function(item){clearTimeout(item._idleTimeoutId);item._idleTimeout=-1};exports._unrefActive=exports.active=function(item){clearTimeout(item._idleTimeoutId);var msecs=item._idleTimeout;if(msecs>=0){item._idleTimeoutId=setTimeout(function onTimeout(){if(item._onTimeout)item._onTimeout()},msecs)}};exports.setImmediate=typeof setImmediate==="function"?setImmediate:function(fn){var id=nextImmediateId++;var args=arguments.length<2?false:slice.call(arguments,1);immediateIds[id]=true;nextTick(function onNextTick(){if(immediateIds[id]){if(args){fn.apply(null,args)}else{fn.call(null)}exports.clearImmediate(id)}});return id};exports.clearImmediate=typeof clearImmediate==="function"?clearImmediate:function(id){delete immediateIds[id]}}).call(this,require("timers").setImmediate,require("timers").clearImmediate)},{"process/browser.js":69,timers:92}],93:[function(require,module,exports){"use strict";function __export(m){for(var p in m)if(!exports.hasOwnProperty(p))exports[p]=m[p]}Object.defineProperty(exports,"__esModule",{value:true});__export(require("./selectorParser"));var matches_1=require("./matches");exports.createMatches=matches_1.createMatches;var querySelector_1=require("./querySelector");exports.createQuerySelector=querySelector_1.createQuerySelector},{"./matches":94,"./querySelector":95,"./selectorParser":96}],94:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var selectorParser_1=require("./selectorParser");function createMatches(opts){return function matches(selector,node){var _a=typeof selector==="object"?selector:selectorParser_1.parseSelector(selector),tag=_a.tag,id=_a.id,classList=_a.classList,attributes=_a.attributes,nextSelector=_a.nextSelector,pseudos=_a.pseudos;if(nextSelector!==undefined){throw new Error("matches can only process selectors that target a single element")}if(tag&&tag.toLowerCase()!==opts.tag(node).toLowerCase()){return false}if(id&&id!==opts.id(node)){return false}var classes=opts.className(node).split(" ");for(var i=0;i<classList.length;i++){if(classes.indexOf(classList[i])===-1){return false}}for(var key in attributes){var attr=opts.attr(node,key);var t=attributes[key][0];var v=attributes[key][1];if(!attr){return false}if(t==="exact"&&attr!==v){return false}else if(t!=="exact"){if(typeof v!=="string"){throw new Error("All non-string values have to be an exact match")}if(t==="startsWith"&&!attr.startsWith(v)){return false}if(t==="endsWith"&&!attr.endsWith(v)){return false}if(t==="contains"&&attr.indexOf(v)===-1){return false}if(t==="whitespace"&&attr.split(" ").indexOf(v)===-1){return false}if(t==="dash"&&attr.split("-").indexOf(v)===-1){return false}}}for(var i=0;i<pseudos.length;i++){var _b=pseudos[i],t=_b[0],data=_b[1];if(t==="contains"&&data!==opts.contents(node)){return false}if(t==="empty"&&(opts.contents(node)||opts.children(node).length!==0)){return false}if(t==="root"&&opts.parent(node)!==undefined){return false}if(t.indexOf("child")!==-1){if(!opts.parent(node)){return false}var siblings=opts.children(opts.parent(node));if(t==="first-child"&&siblings.indexOf(node)!==0){return false}if(t==="last-child"&&siblings.indexOf(node)!==siblings.length-1){return false}if(t==="nth-child"){var regex=/([\+-]?)(\d*)(n?)(\+\d+)?/;var parseResult=regex.exec(data).slice(1);var index=siblings.indexOf(node);if(!parseResult[0]){parseResult[0]="+"}var factor=parseResult[1]?parseInt(parseResult[0]+parseResult[1]):undefined;var add=parseInt(parseResult[3]||"0");if(factor&&parseResult[2]==="n"&&index%factor!==add){return false}else if(!factor&&parseResult[2]&&(parseResult[0]==="+"&&index-add<0||parseResult[0]==="-"&&index-add>=0)){return false}else if(!parseResult[2]&&factor&&index!==factor-1){return false}}}}return true}}exports.createMatches=createMatches},{"./selectorParser":96}],95:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var selectorParser_1=require("./selectorParser");var matches_1=require("./matches");function createQuerySelector(options,matches){var _matches=matches||matches_1.createMatches(options);function findSubtree(selector,depth,node){var n=_matches(selector,node);var matched=n?typeof n==="object"?[n]:[node]:[];if(depth===0){return matched}var childMatched=options.children(node).filter(function(c){return typeof c!=="string"}).map(function(c){return findSubtree(selector,depth-1,c)}).reduce(function(acc,curr){return acc.concat(curr)},[]);return matched.concat(childMatched)}function findSibling(selector,next,node){if(options.parent(node)===undefined){return[]}var results=[];var siblings=options.children(options.parent(node));for(var i=siblings.indexOf(node)+1;i<siblings.length;i++){if(typeof siblings[i]==="string"){continue}var n=_matches(selector,siblings[i]);if(n){if(typeof n==="object"){results.push(n)}else{results.push(siblings[i])}}if(next){break}}return results}return function querySelector(selector,node){var sel=typeof selector==="object"?selector:selectorParser_1.parseSelector(selector);var results=[node];var currentSelector=sel;var currentCombinator="subtree";var tail=undefined;var _loop_1=function(){tail=currentSelector.nextSelector;currentSelector.nextSelector=undefined;if(currentCombinator==="subtree"||currentCombinator==="child"){var depth_1=currentCombinator==="subtree"?Infinity:1;results=results.map(function(n){return findSubtree(currentSelector,depth_1,n)}).reduce(function(acc,curr){return acc.concat(curr)},[])}else{var next_1=currentCombinator==="nextSibling";results=results.map(function(n){return findSibling(currentSelector,next_1,n)}).reduce(function(acc,curr){return acc.concat(curr)},[])}if(tail){currentSelector=tail[1];currentCombinator=tail[0]}};do{_loop_1()}while(tail!==undefined);return results}}exports.createQuerySelector=createQuerySelector},{"./matches":94,"./selectorParser":96}],96:[function(require,module,exports){"use strict";var __assign=this&&this.__assign||Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};Object.defineProperty(exports,"__esModule",{value:true});var IDENT="[\\w-]+";var SPACE="[ \t]*";var VALUE="[^\\]]+";var CLASS="(?:\\."+IDENT+")";var ID="(?:#"+IDENT+")"
;var OP="(?:=|\\$=|\\^=|\\*=|~=|\\|=)";var ATTR="(?:\\["+SPACE+IDENT+SPACE+"(?:"+OP+SPACE+VALUE+SPACE+")?\\])";var SUBTREE="(?:[ \t]+)";var CHILD="(?:"+SPACE+"(>)"+SPACE+")";var NEXT_SIBLING="(?:"+SPACE+"(\\+)"+SPACE+")";var SIBLING="(?:"+SPACE+"(~)"+SPACE+")";var COMBINATOR="(?:"+SUBTREE+"|"+CHILD+"|"+NEXT_SIBLING+"|"+SIBLING+")";var CONTAINS='contains\\("[^"]*"\\)';var FORMULA="(?:even|odd|\\d*(?:-?n(?:\\+\\d+)?)?)";var NTH_CHILD="nth-child\\("+FORMULA+"\\)";var PSEUDO=":(?:first-child|last-child|"+NTH_CHILD+"|empty|root|"+CONTAINS+")";var TAG="(:?"+IDENT+")?";var TOKENS=CLASS+"|"+ID+"|"+ATTR+"|"+PSEUDO+"|"+COMBINATOR;var combinatorRegex=new RegExp("^"+COMBINATOR+"$");function parseSelector(selector){var sel=selector.trim();var tagRegex=new RegExp(TAG,"y");var tag=tagRegex.exec(sel)[0];var regex=new RegExp(TOKENS,"y");regex.lastIndex=tagRegex.lastIndex;var matches=[];var nextSelector=undefined;var lastCombinator=undefined;var index=-1;while(regex.lastIndex<sel.length){var match=regex.exec(sel);if(!match&&lastCombinator===undefined){throw new Error("Parse error, invalid selector")}else if(match&&combinatorRegex.test(match[0])){var comb=combinatorRegex.exec(match[0])[0];lastCombinator=comb;index=regex.lastIndex}else{if(lastCombinator!==undefined){nextSelector=[getCombinator(lastCombinator),parseSelector(sel.substring(index))];break}matches.push(match[0])}}var classList=matches.filter(function(s){return s.startsWith(".")}).map(function(s){return s.substring(1)});var ids=matches.filter(function(s){return s.startsWith("#")}).map(function(s){return s.substring(1)});if(ids.length>1){throw new Error("Invalid selector, only one id is allowed")}var postprocessRegex=new RegExp("("+IDENT+")"+SPACE+"("+OP+")?"+SPACE+"("+VALUE+")?");var attrs=matches.filter(function(s){return s.startsWith("[")}).map(function(s){return postprocessRegex.exec(s).slice(1,4)}).map(function(_a){var attr=_a[0],op=_a[1],val=_a[2];return _b={},_b[attr]=[getOp(op),val?parseAttrValue(val):val],_b;var _b}).reduce(function(acc,curr){return __assign({},acc,curr)},{});var pseudos=matches.filter(function(s){return s.startsWith(":")}).map(function(s){return postProcessPseudos(s.substring(1))});return{id:ids[0]||"",tag:tag,classList:classList,attributes:attrs,nextSelector:nextSelector,pseudos:pseudos}}exports.parseSelector=parseSelector;function parseAttrValue(v){if(v.startsWith('"')){return v.slice(1,-1)}if(v==="true"){return true}if(v==="false"){return false}return parseFloat(v)}function postProcessPseudos(sel){if(sel==="first-child"||sel==="last-child"||sel==="root"||sel==="empty"){return[sel,undefined]}if(sel.startsWith("contains")){var text=sel.slice(10,-2);return["contains",text]}var content=sel.slice(10,-1);if(content==="even"){content="2n"}if(content==="odd"){content="2n+1"}return["nth-child",content]}function getOp(op){switch(op){case"=":return"exact";case"^=":return"startsWith";case"$=":return"endsWith";case"*=":return"contains";case"~=":return"whitespace";case"|=":return"dash";default:return"truthy"}}function getCombinator(comb){switch(comb.trim()){case">":return"child";case"+":return"nextSibling";case"~":return"sibling";default:return"subtree"}}},{}],97:[function(require,module,exports){"use strict";var typestyle_1=require("./internal/typestyle");var types=require("./types");exports.types=types;var utilities_1=require("./internal/utilities");exports.extend=utilities_1.extend;exports.classes=utilities_1.classes;exports.media=utilities_1.media;var ts=new typestyle_1.TypeStyle({autoGenerateTag:true});exports.setStylesTarget=ts.setStylesTarget;exports.cssRaw=ts.cssRaw;exports.cssRule=ts.cssRule;exports.forceRenderStyles=ts.forceRenderStyles;exports.fontFace=ts.fontFace;exports.getStyles=ts.getStyles;exports.keyframes=ts.keyframes;exports.reinit=ts.reinit;exports.style=ts.style;function createTypeStyle(target){var instance=new typestyle_1.TypeStyle({autoGenerateTag:false});if(target){instance.setStylesTarget(target)}return instance}exports.createTypeStyle=createTypeStyle},{"./internal/typestyle":99,"./internal/utilities":100,"./types":101}],98:[function(require,module,exports){"use strict";var FreeStyle=require("free-style");function ensureStringObj(object){var result={};var debugName="";for(var key in object){var val=object[key];if(key==="$unique"){result[FreeStyle.IS_UNIQUE]=val}else if(key==="$nest"){var nested=val;for(var selector in nested){var subproperties=nested[selector];result[selector]=ensureStringObj(subproperties).result}}else if(key==="$debugName"){debugName=val}else{result[key]=val}}return{result:result,debugName:debugName}}exports.ensureStringObj=ensureStringObj;function explodeKeyframes(frames){var result={$debugName:undefined,keyframes:{}};for(var offset in frames){var val=frames[offset];if(offset==="$debugName"){result.$debugName=val}else{result.keyframes[offset]=val}}return result}exports.explodeKeyframes=explodeKeyframes},{"free-style":67}],99:[function(require,module,exports){"use strict";var formatting_1=require("./formatting");var utilities_1=require("./utilities");var FreeStyle=require("free-style");var TypeStyle=function(){function TypeStyle(_a){var autoGenerateTag=_a.autoGenerateTag;var _this=this;this.cssRaw=function(mustBeValidCSS){if(!mustBeValidCSS){return}_this._raw+=mustBeValidCSS||"";_this._pendingRawChange=true;_this._styleUpdated()};this.cssRule=function(selector){var objects=[];for(var _i=1;_i<arguments.length;_i++){objects[_i-1]=arguments[_i]}var object=formatting_1.ensureStringObj(utilities_1.extend.apply(void 0,objects)).result;_this._freeStyle.registerRule(selector,object);_this._styleUpdated();return};this.forceRenderStyles=function(){var target=_this._getTag();if(!target){return}target.textContent=_this.getStyles()};this.fontFace=function(){var fontFace=[];for(var _i=0;_i<arguments.length;_i++){fontFace[_i]=arguments[_i]}var freeStyle=_this._freeStyle;for(var _a=0,fontFace_1=fontFace;_a<fontFace_1.length;_a++){var face=fontFace_1[_a];freeStyle.registerRule("@font-face",face)}_this._styleUpdated();return};this.getStyles=function(){return(_this._raw||"")+_this._freeStyle.getStyles()};this.keyframes=function(frames){var _a=formatting_1.explodeKeyframes(frames),keyframes=_a.keyframes,$debugName=_a.$debugName;var animationName=_this._freeStyle.registerKeyframes(keyframes,$debugName);_this._styleUpdated();return animationName};this.reinit=function(){var freeStyle=FreeStyle.create();_this._freeStyle=freeStyle;_this._lastFreeStyleChangeId=freeStyle.changeId;_this._raw="";_this._pendingRawChange=false;var target=_this._getTag();if(target){target.textContent=""}};this.setStylesTarget=function(tag){if(_this._tag){_this._tag.textContent=""}_this._tag=tag;_this.forceRenderStyles()};this.style=function(){var objects=[];for(var _i=0;_i<arguments.length;_i++){objects[_i]=arguments[_i]}var freeStyle=_this._freeStyle;var _a=formatting_1.ensureStringObj(utilities_1.extend.apply(void 0,objects)),result=_a.result,debugName=_a.debugName;var className=debugName?freeStyle.registerStyle(result,debugName):freeStyle.registerStyle(result);_this._styleUpdated();return className};var freeStyle=FreeStyle.create();this._autoGenerateTag=autoGenerateTag;this._freeStyle=freeStyle;this._lastFreeStyleChangeId=freeStyle.changeId;this._pending=0;this._pendingRawChange=false;this._raw="";this._tag=undefined}TypeStyle.prototype._afterAllSync=function(cb){var _this=this;this._pending++;var pending=this._pending;utilities_1.raf(function(){if(pending!==_this._pending){return}cb()})};TypeStyle.prototype._getTag=function(){if(this._tag){return this._tag}if(this._autoGenerateTag){var tag=typeof window==="undefined"?{textContent:""}:document.createElement("style");if(typeof document!=="undefined"){document.head.appendChild(tag)}this._tag=tag;return tag}return undefined};TypeStyle.prototype._styleUpdated=function(){var _this=this;var changeId=this._freeStyle.changeId;var lastChangeId=this._lastFreeStyleChangeId;if(!this._pendingRawChange&&changeId===lastChangeId){return}this._lastFreeStyleChangeId=changeId;this._pendingRawChange=false;this._afterAllSync(function(){return _this.forceRenderStyles()})};return TypeStyle}();exports.TypeStyle=TypeStyle},{"./formatting":98,"./utilities":100,"free-style":67}],100:[function(require,module,exports){"use strict";exports.raf=typeof requestAnimationFrame==="undefined"?setTimeout:requestAnimationFrame.bind(window);function classes(){var classes=[];for(var _i=0;_i<arguments.length;_i++){classes[_i]=arguments[_i]}return classes.filter(function(c){return!!c}).join(" ")}exports.classes=classes;function extend(){var objects=[];for(var _i=0;_i<arguments.length;_i++){objects[_i]=arguments[_i]}var result={};for(var _a=0,objects_1=objects;_a<objects_1.length;_a++){var object=objects_1[_a];if(object==null||object===false){continue}for(var key in object){var val=object[key];if(!val&&val!==0){continue}if(key==="$nest"&&val){result[key]=result["$nest"]?extend(result["$nest"],val):val}else if(key.indexOf("&")!==-1||key.indexOf("@media")===0){result[key]=result[key]?extend(result[key],val):val}else{result[key]=val}}}return result}exports.extend=extend;exports.media=function(mediaQuery){var objects=[];for(var _i=1;_i<arguments.length;_i++){objects[_i-1]=arguments[_i]}var mediaQuerySections=[];if(mediaQuery.type)mediaQuerySections.push(mediaQuery.type);if(mediaQuery.orientation)mediaQuerySections.push(mediaQuery.orientation);if(mediaQuery.minWidth)mediaQuerySections.push("(min-width: "+mediaQuery.minWidth+"px)");if(mediaQuery.maxWidth)mediaQuerySections.push("(max-width: "+mediaQuery.maxWidth+"px)");var stringMediaQuery="@media "+mediaQuerySections.join(" and ");var object={$nest:(_a={},_a[stringMediaQuery]=extend.apply(void 0,objects),_a)};return object;var _a}},{}],101:[function(require,module,exports){"use strict"},{}],102:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var index_1=require("../index");var ConcatProducer=function(){function ConcatProducer(streams){this.streams=streams;this.type="concat";this.out=null;this.i=0}ConcatProducer.prototype._start=function(out){this.out=out;this.streams[this.i]._add(this)};ConcatProducer.prototype._stop=function(){var streams=this.streams;if(this.i<streams.length){streams[this.i]._remove(this)}this.i=0;this.out=null};ConcatProducer.prototype._n=function(t){var u=this.out;if(!u)return;u._n(t)};ConcatProducer.prototype._e=function(err){var u=this.out;if(!u)return;u._e(err)};ConcatProducer.prototype._c=function(){var u=this.out;if(!u)return;var streams=this.streams;streams[this.i]._remove(this);if(++this.i<streams.length){streams[this.i]._add(this)}else{u._c()}};return ConcatProducer}();function concat(){var streams=[];for(var _i=0;_i<arguments.length;_i++){streams[_i]=arguments[_i]}return new index_1.Stream(new ConcatProducer(streams))}exports.default=concat},{"../index":107}],103:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var index_1=require("../index");var DelayOperator=function(){function DelayOperator(dt,ins){this.dt=dt;this.ins=ins;this.type="delay";this.out=null}DelayOperator.prototype._start=function(out){this.out=out;this.ins._add(this)};DelayOperator.prototype._stop=function(){this.ins._remove(this);this.out=null};DelayOperator.prototype._n=function(t){var u=this.out;if(!u)return;var id=setInterval(function(){u._n(t);clearInterval(id)},this.dt)};DelayOperator.prototype._e=function(err){var u=this.out;if(!u)return;var id=setInterval(function(){u._e(err);clearInterval(id)},this.dt)};DelayOperator.prototype._c=function(){var u=this.out;if(!u)return;var id=setInterval(function(){u._c();clearInterval(id)},this.dt)};return DelayOperator}();function delay(period){return function delayOperator(ins){return new index_1.Stream(new DelayOperator(period,ins))}}exports.default=delay},{"../index":107}],104:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var index_1=require("../index");var empty={};var DropRepeatsOperator=function(){function DropRepeatsOperator(ins,fn){this.ins=ins;this.type="dropRepeats";this.out=null;this.v=empty;this.isEq=fn?fn:function(x,y){return x===y}}DropRepeatsOperator.prototype._start=function(out){this.out=out;this.ins._add(this)};DropRepeatsOperator.prototype._stop=function(){this.ins._remove(this);this.out=null;this.v=empty};DropRepeatsOperator.prototype._n=function(t){var u=this.out;if(!u)return;var v=this.v;if(v!==empty&&this.isEq(t,v))return;this.v=t;u._n(t)};DropRepeatsOperator.prototype._e=function(err){var u=this.out;if(!u)return;u._e(err)};DropRepeatsOperator.prototype._c=function(){var u=this.out;if(!u)return;u._c()};return DropRepeatsOperator}();exports.DropRepeatsOperator=DropRepeatsOperator;function dropRepeats(isEqual){if(isEqual===void 0){isEqual=void 0}return function dropRepeatsOperator(ins){return new index_1.Stream(new DropRepeatsOperator(ins,isEqual))}}exports.default=dropRepeats},{"../index":107}],105:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var index_1=require("../index");var NO={};var SampleCombineListener=function(){function SampleCombineListener(i,p){this.i=i;this.p=p;p.ils[i]=this}SampleCombineListener.prototype._n=function(t){var p=this.p;if(p.out===NO)return;p.up(t,this.i)};SampleCombineListener.prototype._e=function(err){this.p._e(err)};SampleCombineListener.prototype._c=function(){this.p.down(this.i,this)};return SampleCombineListener}();exports.SampleCombineListener=SampleCombineListener;var SampleCombineOperator=function(){function SampleCombineOperator(ins,streams){this.type="sampleCombine";this.ins=ins;this.others=streams;this.out=NO;this.ils=[];this.Nn=0;this.vals=[]}SampleCombineOperator.prototype._start=function(out){this.out=out;var s=this.others;var n=this.Nn=s.length;var vals=this.vals=new Array(n);for(var i=0;i<n;i++){vals[i]=NO;s[i]._add(new SampleCombineListener(i,this))}this.ins._add(this)};SampleCombineOperator.prototype._stop=function(){var s=this.others;var n=s.length;var ils=this.ils;this.ins._remove(this);for(var i=0;i<n;i++){s[i]._remove(ils[i])}this.out=NO;this.vals=[];this.ils=[]};SampleCombineOperator.prototype._n=function(t){var out=this.out;if(out===NO)return;if(this.Nn>0)return;out._n([t].concat(this.vals))};SampleCombineOperator.prototype._e=function(err){var out=this.out;if(out===NO)return;out._e(err)};SampleCombineOperator.prototype._c=function(){var out=this.out;if(out===NO)return;out._c()};SampleCombineOperator.prototype.up=function(t,i){var v=this.vals[i];if(this.Nn>0&&v===NO){this.Nn--}this.vals[i]=t};SampleCombineOperator.prototype.down=function(i,l){this.others[i]._remove(l)};return SampleCombineOperator}();exports.SampleCombineOperator=SampleCombineOperator;var sampleCombine;sampleCombine=function sampleCombine(){var streams=[];for(var _i=0;_i<arguments.length;_i++){streams[_i]=arguments[_i]}return function sampleCombineOperator(sampler){return new index_1.Stream(new SampleCombineOperator(sampler,streams))}};exports.default=sampleCombine},{"../index":107}],106:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});var index_1=require("../index");var concat_1=require("./concat");function interpolate(y,from,to){return from*(1-y)+to*y}function flip(fn){return function(x){return 1-fn(1-x)}}function createEasing(fn){var fnFlipped=flip(fn);return{easeIn:function(x,from,to){return interpolate(fn(x),from,to)},easeOut:function(x,from,to){return interpolate(fnFlipped(x),from,to)},easeInOut:function(x,from,to){var y=x<.5?fn(2*x)*.5:.5+fnFlipped(2*(x-.5))*.5;return interpolate(y,from,to)}}}var easingPower2=createEasing(function(x){return x*x});var easingPower3=createEasing(function(x){return x*x*x});var easingPower4=createEasing(function(x){var xx=x*x;return xx*xx});var EXP_WEIGHT=6;var EXP_MAX=Math.exp(EXP_WEIGHT)-1;function expFn(x){return(Math.exp(x*EXP_WEIGHT)-1)/EXP_MAX}var easingExponential=createEasing(expFn);var OVERSHOOT=1.70158;var easingBack=createEasing(function(x){return x*x*((OVERSHOOT+1)*x-OVERSHOOT)});var PARAM1=7.5625;var PARAM2=2.75;function easeOutFn(x){var z=x;if(z<1/PARAM2){return PARAM1*z*z}else if(z<2/PARAM2){return PARAM1*(z-=1.5/PARAM2)*z+.75}else if(z<2.5/PARAM2){return PARAM1*(z-=2.25/PARAM2)*z+.9375}else{return PARAM1*(z-=2.625/PARAM2)*z+.984375}}var easingBounce=createEasing(function(x){return 1-easeOutFn(1-x)});var easingCirc=createEasing(function(x){return-(Math.sqrt(1-x*x)-1)});var PERIOD=.3;var OVERSHOOT_ELASTIC=PERIOD/4;var AMPLITUDE=1;function elasticIn(x){var z=x;if(z<=0){return 0}else if(z>=1){return 1}else{z-=1;return-(AMPLITUDE*Math.pow(2,10*z))*Math.sin((z-OVERSHOOT_ELASTIC)*(2*Math.PI)/PERIOD)}}var easingElastic=createEasing(elasticIn);var HALF_PI=Math.PI*.5;var easingSine=createEasing(function(x){return 1-Math.cos(x*HALF_PI)});var DEFAULT_INTERVAL=15;function tween(_a){var from=_a.from,to=_a.to,duration=_a.duration,_b=_a.ease,ease=_b===void 0?tweenFactory.linear.ease:_b,_c=_a.interval,interval=_c===void 0?DEFAULT_INTERVAL:_c;var totalTicks=Math.round(duration/interval);return index_1.Stream.periodic(interval).take(totalTicks).map(function(tick){return ease(tick/totalTicks,from,to)}).compose(function(s){return concat_1.default(s,index_1.Stream.of(to))})}var tweenFactory=tween;tweenFactory.linear={ease:interpolate};tweenFactory.power2=easingPower2;tweenFactory.power3=easingPower3;tweenFactory.power4=easingPower4;tweenFactory.exponential=easingExponential;tweenFactory.back=easingBack;tweenFactory.bounce=easingBounce;tweenFactory.circular=easingCirc;tweenFactory.elastic=easingElastic;tweenFactory.sine=easingSine;exports.default=tweenFactory},{"../index":107,"./concat":102}],107:[function(require,module,exports){"use strict";var __extends=this&&this.__extends||function(){var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(b.hasOwnProperty(p))d[p]=b[p]};return function(d,b){extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();Object.defineProperty(exports,"__esModule",{value:true});var symbol_observable_1=require("symbol-observable");var NO={};exports.NO=NO;function noop(){}function cp(a){var l=a.length;var b=Array(l);for(var i=0;i<l;++i)b[i]=a[i];return b}function and(f1,f2){return function andFn(t){return f1(t)&&f2(t)}}function _try(c,t,u){try{return c.f(t)}catch(e){u._e(e);return NO}}var NO_IL={_n:noop,_e:noop,_c:noop};exports.NO_IL=NO_IL;function internalizeProducer(producer){producer._start=function _start(il){il.next=il._n;il.error=il._e;il.complete=il._c;this.start(il)};producer._stop=producer.stop}var StreamSub=function(){function StreamSub(_stream,_listener){this._stream=_stream;this._listener=_listener}StreamSub.prototype.unsubscribe=function(){this._stream._remove(this._listener)};return StreamSub}();var Observer=function(){function Observer(_listener){this._listener=_listener}Observer.prototype.next=function(value){this._listener._n(value)};Observer.prototype.error=function(err){this._listener._e(err)};Observer.prototype.complete=function(){this._listener._c()};return Observer}();var FromObservable=function(){function FromObservable(observable){this.type="fromObservable";this.ins=observable;this.active=false}FromObservable.prototype._start=function(out){this.out=out;this.active=true;this._sub=this.ins.subscribe(new Observer(out));if(!this.active)this._sub.unsubscribe()};FromObservable.prototype._stop=function(){if(this._sub)this._sub.unsubscribe();this.active=false};return FromObservable}();var Merge=function(){function Merge(insArr){this.type="merge";this.insArr=insArr;this.out=NO;this.ac=0}Merge.prototype._start=function(out){this.out=out;var s=this.insArr;var L=s.length;this.ac=L;for(var i=0;i<L;i++)s[i]._add(this)};Merge.prototype._stop=function(){var s=this.insArr;var L=s.length;for(var i=0;i<L;i++)s[i]._remove(this);this.out=NO};Merge.prototype._n=function(t){var u=this.out;if(u===NO)return;u._n(t)};Merge.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};Merge.prototype._c=function(){if(--this.ac<=0){var u=this.out;if(u===NO)return;u._c()}};return Merge}();var CombineListener=function(){function CombineListener(i,out,p){this.i=i;this.out=out;this.p=p;p.ils.push(this)}CombineListener.prototype._n=function(t){var p=this.p,out=this.out;if(out===NO)return;if(p.up(t,this.i)){var a=p.vals;var l=a.length;var b=Array(l);for(var i=0;i<l;++i)b[i]=a[i];out._n(b)}};CombineListener.prototype._e=function(err){var out=this.out;if(out===NO)return;out._e(err)};CombineListener.prototype._c=function(){var p=this.p;if(p.out===NO)return;if(--p.Nc===0)p.out._c()};return CombineListener}();var Combine=function(){function Combine(insArr){this.type="combine";this.insArr=insArr;this.out=NO;this.ils=[];this.Nc=this.Nn=0;this.vals=[]}Combine.prototype.up=function(t,i){var v=this.vals[i];var Nn=!this.Nn?0:v===NO?--this.Nn:this.Nn;this.vals[i]=t;return Nn===0};Combine.prototype._start=function(out){this.out=out;var s=this.insArr;var n=this.Nc=this.Nn=s.length;var vals=this.vals=new Array(n);if(n===0){out._n([]);out._c()}else{for(var i=0;i<n;i++){vals[i]=NO;s[i]._add(new CombineListener(i,out,this))}}};Combine.prototype._stop=function(){var s=this.insArr;var n=s.length;var ils=this.ils;for(var i=0;i<n;i++)s[i]._remove(ils[i]);this.out=NO;this.ils=[];this.vals=[]};return Combine}();var FromArray=function(){function FromArray(a){this.type="fromArray";this.a=a}FromArray.prototype._start=function(out){var a=this.a;for(var i=0,n=a.length;i<n;i++)out._n(a[i]);out._c()};FromArray.prototype._stop=function(){};return FromArray}();var FromPromise=function(){function FromPromise(p){this.type="fromPromise";this.on=false;this.p=p}FromPromise.prototype._start=function(out){var prod=this;this.on=true;this.p.then(function(v){if(prod.on){out._n(v);out._c()}},function(e){out._e(e)}).then(noop,function(err){setTimeout(function(){throw err})})};FromPromise.prototype._stop=function(){this.on=false};return FromPromise}();var Periodic=function(){function Periodic(period){this.type="periodic";this.period=period;this.intervalID=-1;this.i=0}Periodic.prototype._start=function(out){var self=this;function intervalHandler(){out._n(self.i++)}this.intervalID=setInterval(intervalHandler,this.period)};Periodic.prototype._stop=function(){if(this.intervalID!==-1)clearInterval(this.intervalID);this.intervalID=-1;this.i=0};return Periodic}();var Debug=function(){function Debug(ins,arg){this.type="debug";this.ins=ins;this.out=NO;this.s=noop;this.l="";if(typeof arg==="string")this.l=arg;else if(typeof arg==="function")this.s=arg}Debug.prototype._start=function(out){this.out=out;this.ins._add(this)};Debug.prototype._stop=function(){this.ins._remove(this);this.out=NO};Debug.prototype._n=function(t){var u=this.out;if(u===NO)return;var s=this.s,l=this.l;if(s!==noop){try{s(t)}catch(e){u._e(e)}}else if(l)console.log(l+":",t);else console.log(t);u._n(t)};Debug.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};Debug.prototype._c=function(){var u=this.out;if(u===NO)return;u._c()};return Debug}();var Drop=function(){function Drop(max,ins){this.type="drop";this.ins=ins;this.out=NO;this.max=max;this.dropped=0}Drop.prototype._start=function(out){this.out=out;this.dropped=0;this.ins._add(this)};Drop.prototype._stop=function(){this.ins._remove(this);this.out=NO};Drop.prototype._n=function(t){var u=this.out;if(u===NO)return;if(this.dropped++>=this.max)u._n(t)};Drop.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};Drop.prototype._c=function(){var u=this.out;if(u===NO)return;u._c()};return Drop}();var EndWhenListener=function(){function EndWhenListener(out,op){this.out=out;this.op=op}EndWhenListener.prototype._n=function(){this.op.end()};EndWhenListener.prototype._e=function(err){this.out._e(err)};EndWhenListener.prototype._c=function(){this.op.end()};return EndWhenListener}();var EndWhen=function(){function EndWhen(o,ins){this.type="endWhen";this.ins=ins;this.out=NO;this.o=o;this.oil=NO_IL}EndWhen.prototype._start=function(out){this.out=out;this.o._add(this.oil=new EndWhenListener(out,this));this.ins._add(this)};EndWhen.prototype._stop=function(){this.ins._remove(this);this.o._remove(this.oil);this.out=NO;this.oil=NO_IL};EndWhen.prototype.end=function(){var u=this.out;if(u===NO)return;u._c()};EndWhen.prototype._n=function(t){var u=this.out;if(u===NO)return;u._n(t)};EndWhen.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};EndWhen.prototype._c=function(){this.end()};return EndWhen}();var Filter=function(){function Filter(passes,ins){this.type="filter";this.ins=ins;this.out=NO;this.f=passes}Filter.prototype._start=function(out){this.out=out;this.ins._add(this)};Filter.prototype._stop=function(){this.ins._remove(this);this.out=NO};Filter.prototype._n=function(t){var u=this.out;if(u===NO)return;var r=_try(this,t,u);if(r===NO||!r)return;u._n(t)};Filter.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};Filter.prototype._c=function(){var u=this.out;if(u===NO)return;u._c()};return Filter}();var FlattenListener=function(){function FlattenListener(out,op){this.out=out;this.op=op}FlattenListener.prototype._n=function(t){this.out._n(t)};FlattenListener.prototype._e=function(err){this.out._e(err)};FlattenListener.prototype._c=function(){this.op.inner=NO;this.op.less()};return FlattenListener}();var Flatten=function(){function Flatten(ins){this.type="flatten";this.ins=ins;this.out=NO;this.open=true;this.inner=NO;this.il=NO_IL}Flatten.prototype._start=function(out){this.out=out;this.open=true;this.inner=NO;this.il=NO_IL;this.ins._add(this)};Flatten.prototype._stop=function(){this.ins._remove(this);if(this.inner!==NO)this.inner._remove(this.il);this.out=NO;this.open=true;this.inner=NO;this.il=NO_IL};Flatten.prototype.less=function(){var u=this.out;if(u===NO)return;if(!this.open&&this.inner===NO)u._c()};Flatten.prototype._n=function(s){var u=this.out;if(u===NO)return;var _a=this,inner=_a.inner,il=_a.il;if(inner!==NO&&il!==NO_IL)inner._remove(il);(this.inner=s)._add(this.il=new FlattenListener(u,this))};Flatten.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};Flatten.prototype._c=function(){this.open=false;this.less()};return Flatten}();var Fold=function(){function Fold(f,seed,ins){var _this=this;this.type="fold";this.ins=ins;this.out=NO;this.f=function(t){return f(_this.acc,t)};this.acc=this.seed=seed}Fold.prototype._start=function(out){this.out=out;this.acc=this.seed;out._n(this.acc);this.ins._add(this)};Fold.prototype._stop=function(){this.ins._remove(this);this.out=NO;this.acc=this.seed};Fold.prototype._n=function(t){var u=this.out;if(u===NO)return;var r=_try(this,t,u);if(r===NO)return;u._n(this.acc=r)};Fold.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};Fold.prototype._c=function(){var u=this.out;if(u===NO)return;u._c()};return Fold}();var Last=function(){function Last(ins){this.type="last";this.ins=ins;this.out=NO;this.has=false;this.val=NO}Last.prototype._start=function(out){this.out=out;this.has=false;this.ins._add(this)};Last.prototype._stop=function(){this.ins._remove(this);this.out=NO;this.val=NO};Last.prototype._n=function(t){this.has=true;this.val=t};Last.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};Last.prototype._c=function(){var u=this.out;if(u===NO)return;if(this.has){u._n(this.val);u._c()}else u._e(new Error("last() failed because input stream completed"))};return Last}();var MapOp=function(){function MapOp(project,ins){this.type="map";this.ins=ins;this.out=NO;this.f=project}MapOp.prototype._start=function(out){this.out=out;this.ins._add(this)};MapOp.prototype._stop=function(){this.ins._remove(this);this.out=NO};MapOp.prototype._n=function(t){var u=this.out;if(u===NO)return;var r=_try(this,t,u);if(r===NO)return;u._n(r)};MapOp.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};MapOp.prototype._c=function(){var u=this.out;if(u===NO)return;u._c()};return MapOp}();var Remember=function(){function Remember(ins){this.type="remember";this.ins=ins;this.out=NO}Remember.prototype._start=function(out){this.out=out;this.ins._add(out)};Remember.prototype._stop=function(){this.ins._remove(this.out);this.out=NO};return Remember}();var ReplaceError=function(){function ReplaceError(replacer,ins){this.type="replaceError";this.ins=ins;this.out=NO;this.f=replacer}ReplaceError.prototype._start=function(out){this.out=out;this.ins._add(this)};ReplaceError.prototype._stop=function(){this.ins._remove(this);this.out=NO};ReplaceError.prototype._n=function(t){var u=this.out;if(u===NO)return;u._n(t)};ReplaceError.prototype._e=function(err){var u=this.out;if(u===NO)return;try{this.ins._remove(this);(this.ins=this.f(err))._add(this)}catch(e){u._e(e)}};ReplaceError.prototype._c=function(){var u=this.out;if(u===NO)return;u._c()};return ReplaceError}();var StartWith=function(){function StartWith(ins,val){this.type="startWith";this.ins=ins;this.out=NO;this.val=val}StartWith.prototype._start=function(out){this.out=out;this.out._n(this.val);this.ins._add(out)};StartWith.prototype._stop=function(){this.ins._remove(this.out);this.out=NO};return StartWith}();var Take=function(){function Take(max,ins){this.type="take";this.ins=ins;this.out=NO;this.max=max;this.taken=0}Take.prototype._start=function(out){this.out=out;this.taken=0;if(this.max<=0)out._c();else this.ins._add(this)};Take.prototype._stop=function(){this.ins._remove(this);this.out=NO};Take.prototype._n=function(t){var u=this.out;if(u===NO)return;var m=++this.taken;if(m<this.max)u._n(t);else if(m===this.max){u._n(t);u._c()}};Take.prototype._e=function(err){var u=this.out;if(u===NO)return;u._e(err)};Take.prototype._c=function(){var u=this.out;if(u===NO)return;u._c()};return Take}();var Stream=function(){function Stream(producer){this._prod=producer||NO;this._ils=[];this._stopID=NO;this._dl=NO;this._d=false;this._target=NO;this._err=NO}Stream.prototype._n=function(t){var a=this._ils;var L=a.length;if(this._d)this._dl._n(t);if(L==1)a[0]._n(t);else if(L==0)return;else{var b=cp(a);for(var i=0;i<L;i++)b[i]._n(t)}};Stream.prototype._e=function(err){if(this._err!==NO)return;this._err=err;var a=this._ils;var L=a.length;this._x();if(this._d)this._dl._e(err);if(L==1)a[0]._e(err);else if(L==0)return;else{var b=cp(a);for(var i=0;i<L;i++)b[i]._e(err)}if(!this._d&&L==0)throw this._err};Stream.prototype._c=function(){var a=this._ils;var L=a.length;this._x();if(this._d)this._dl._c();if(L==1)a[0]._c();else if(L==0)return;else{var b=cp(a);for(var i=0;i<L;i++)b[i]._c()}};Stream.prototype._x=function(){if(this._ils.length===0)return;if(this._prod!==NO)this._prod._stop();this._err=NO;this._ils=[]};Stream.prototype._stopNow=function(){this._prod._stop();this._err=NO;this._stopID=NO};Stream.prototype._add=function(il){var ta=this._target;if(ta!==NO)return ta._add(il);var a=this._ils;a.push(il);if(a.length>1)return;if(this._stopID!==NO){clearTimeout(this._stopID);this._stopID=NO}else{var p=this._prod;if(p!==NO)p._start(this)}};Stream.prototype._remove=function(il){var _this=this;var ta=this._target;if(ta!==NO)return ta._remove(il);var a=this._ils;var i=a.indexOf(il);if(i>-1){a.splice(i,1);if(this._prod!==NO&&a.length<=0){this._err=NO;this._stopID=setTimeout(function(){return _this._stopNow()})}else if(a.length===1){this._pruneCycles()}}};Stream.prototype._pruneCycles=function(){if(this._hasNoSinks(this,[]))this._remove(this._ils[0])};Stream.prototype._hasNoSinks=function(x,trace){if(trace.indexOf(x)!==-1)return true;else if(x.out===this)return true;else if(x.out&&x.out!==NO)return this._hasNoSinks(x.out,trace.concat(x));else if(x._ils){for(var i=0,N=x._ils.length;i<N;i++)if(!this._hasNoSinks(x._ils[i],trace.concat(x)))return false;return true}else return false};Stream.prototype.ctor=function(){return this instanceof MemoryStream?MemoryStream:Stream};Stream.prototype.addListener=function(listener){
listener._n=listener.next||noop;listener._e=listener.error||noop;listener._c=listener.complete||noop;this._add(listener)};Stream.prototype.removeListener=function(listener){this._remove(listener)};Stream.prototype.subscribe=function(listener){this.addListener(listener);return new StreamSub(this,listener)};Stream.prototype[symbol_observable_1.default]=function(){return this};Stream.create=function(producer){if(producer){if(typeof producer.start!=="function"||typeof producer.stop!=="function")throw new Error("producer requires both start and stop functions");internalizeProducer(producer)}return new Stream(producer)};Stream.createWithMemory=function(producer){if(producer)internalizeProducer(producer);return new MemoryStream(producer)};Stream.never=function(){return new Stream({_start:noop,_stop:noop})};Stream.empty=function(){return new Stream({_start:function(il){il._c()},_stop:noop})};Stream.throw=function(error){return new Stream({_start:function(il){il._e(error)},_stop:noop})};Stream.from=function(input){if(typeof input[symbol_observable_1.default]==="function")return Stream.fromObservable(input);else if(typeof input.then==="function")return Stream.fromPromise(input);else if(Array.isArray(input))return Stream.fromArray(input);throw new TypeError("Type of input to from() must be an Array, Promise, or Observable")};Stream.of=function(){var items=[];for(var _i=0;_i<arguments.length;_i++){items[_i]=arguments[_i]}return Stream.fromArray(items)};Stream.fromArray=function(array){return new Stream(new FromArray(array))};Stream.fromPromise=function(promise){return new Stream(new FromPromise(promise))};Stream.fromObservable=function(obs){if(obs.endWhen)return obs;var o=typeof obs[symbol_observable_1.default]==="function"?obs[symbol_observable_1.default]():obs;return new Stream(new FromObservable(o))};Stream.periodic=function(period){return new Stream(new Periodic(period))};Stream.prototype._map=function(project){return new(this.ctor())(new MapOp(project,this))};Stream.prototype.map=function(project){return this._map(project)};Stream.prototype.mapTo=function(projectedValue){var s=this.map(function(){return projectedValue});var op=s._prod;op.type="mapTo";return s};Stream.prototype.filter=function(passes){var p=this._prod;if(p instanceof Filter)return new Stream(new Filter(and(p.f,passes),p.ins));return new Stream(new Filter(passes,this))};Stream.prototype.take=function(amount){return new(this.ctor())(new Take(amount,this))};Stream.prototype.drop=function(amount){return new Stream(new Drop(amount,this))};Stream.prototype.last=function(){return new Stream(new Last(this))};Stream.prototype.startWith=function(initial){return new MemoryStream(new StartWith(this,initial))};Stream.prototype.endWhen=function(other){return new(this.ctor())(new EndWhen(other,this))};Stream.prototype.fold=function(accumulate,seed){return new MemoryStream(new Fold(accumulate,seed,this))};Stream.prototype.replaceError=function(replace){return new(this.ctor())(new ReplaceError(replace,this))};Stream.prototype.flatten=function(){var p=this._prod;return new Stream(new Flatten(this))};Stream.prototype.compose=function(operator){return operator(this)};Stream.prototype.remember=function(){return new MemoryStream(new Remember(this))};Stream.prototype.debug=function(labelOrSpy){return new(this.ctor())(new Debug(this,labelOrSpy))};Stream.prototype.imitate=function(target){if(target instanceof MemoryStream)throw new Error("A MemoryStream was given to imitate(), but it only "+"supports a Stream. Read more about this restriction here: "+"path_to_url#faq");this._target=target;for(var ils=this._ils,N=ils.length,i=0;i<N;i++)target._add(ils[i]);this._ils=[]};Stream.prototype.shamefullySendNext=function(value){this._n(value)};Stream.prototype.shamefullySendError=function(error){this._e(error)};Stream.prototype.shamefullySendComplete=function(){this._c()};Stream.prototype.setDebugListener=function(listener){if(!listener){this._d=false;this._dl=NO}else{this._d=true;listener._n=listener.next||noop;listener._e=listener.error||noop;listener._c=listener.complete||noop;this._dl=listener}};Stream.merge=function merge(){var streams=[];for(var _i=0;_i<arguments.length;_i++){streams[_i]=arguments[_i]}return new Stream(new Merge(streams))};Stream.combine=function combine(){var streams=[];for(var _i=0;_i<arguments.length;_i++){streams[_i]=arguments[_i]}return new Stream(new Combine(streams))};return Stream}();exports.Stream=Stream;var MemoryStream=function(_super){__extends(MemoryStream,_super);function MemoryStream(producer){var _this=_super.call(this,producer)||this;_this._has=false;return _this}MemoryStream.prototype._n=function(x){this._v=x;this._has=true;_super.prototype._n.call(this,x)};MemoryStream.prototype._add=function(il){var ta=this._target;if(ta!==NO)return ta._add(il);var a=this._ils;a.push(il);if(a.length>1){if(this._has)il._n(this._v);return}if(this._stopID!==NO){if(this._has)il._n(this._v);clearTimeout(this._stopID);this._stopID=NO}else if(this._has)il._n(this._v);else{var p=this._prod;if(p!==NO)p._start(this)}};MemoryStream.prototype._stopNow=function(){this._has=false;_super.prototype._stopNow.call(this)};MemoryStream.prototype._x=function(){this._has=false;_super.prototype._x.call(this)};MemoryStream.prototype.map=function(project){return this._map(project)};MemoryStream.prototype.mapTo=function(projectedValue){return _super.prototype.mapTo.call(this,projectedValue)};MemoryStream.prototype.take=function(amount){return _super.prototype.take.call(this,amount)};MemoryStream.prototype.endWhen=function(other){return _super.prototype.endWhen.call(this,other)};MemoryStream.prototype.replaceError=function(replace){return _super.prototype.replaceError.call(this,replace)};MemoryStream.prototype.remember=function(){return this};MemoryStream.prototype.debug=function(labelOrSpy){return _super.prototype.debug.call(this,labelOrSpy)};return MemoryStream}(Stream);exports.MemoryStream=MemoryStream;var xs=Stream;exports.default=xs},{"symbol-observable":90}]},{},[33]);
```
|
```ruby
class Libsvg < Formula
desc "Library for SVG files"
homepage "path_to_url"
url "path_to_url"
sha256 your_sha256_hash
license "LGPL-2.1-or-later"
revision 2
livecheck do
url "path_to_url"
regex(/href=.*?libsvg[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
bottle do
sha256 cellar: :any, arm64_sonoma: your_sha256_hash
sha256 cellar: :any, arm64_ventura: your_sha256_hash
sha256 cellar: :any, arm64_monterey: your_sha256_hash
sha256 cellar: :any, arm64_big_sur: your_sha256_hash
sha256 cellar: :any, sonoma: your_sha256_hash
sha256 cellar: :any, ventura: your_sha256_hash
sha256 cellar: :any, monterey: your_sha256_hash
sha256 cellar: :any, big_sur: your_sha256_hash
sha256 cellar: :any, catalina: your_sha256_hash
sha256 cellar: :any_skip_relocation, x86_64_linux: your_sha256_hash
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "jpeg-turbo"
depends_on "libpng"
uses_from_macos "libxml2"
# Fix undefined reference to 'png_set_gray_1_2_4_to_8' in libpng 1.4.0+
patch do
url "path_to_url"
sha256 your_sha256_hash
end
# Allow building on M1 Macs. This patch is adapted from
# path_to_url
patch :DATA
def install
system "autoreconf", "--force", "--install", "--verbose"
system "./configure", *std_configure_args
system "make", "install"
end
test do
(testpath/"test.svg").write <<~EOS
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns:svg="path_to_url" height="72pt" width="144pt" viewBox="0 -20 144 72"><text font-size="12" text-anchor="left" y="0" x="0" font-family="Times New Roman" fill="green">sample text here</text></svg>
EOS
(testpath/"test.c").write <<~EOS
#include <stdio.h>
#include "svg.h"
int main(int argc, char **argv) {
svg_t *svg = NULL;
svg_status_t result = SVG_STATUS_SUCCESS;
FILE *fp = NULL;
printf("1\\n");
result = svg_create(&svg);
if (SVG_STATUS_SUCCESS != result) {
printf ("svg_create failed\\n");
/* Fail if alloc failed */
return -1;
}
printf("2\\n");
result = svg_parse(svg, "test.svg");
if (SVG_STATUS_SUCCESS != result) {
printf ("svg_parse failed\\n");
/* Fail if alloc failed */
return -2;
}
printf("3\\n");
result = svg_destroy(svg);
if (SVG_STATUS_SUCCESS != result) {
printf ("svg_destroy failed\\n");
/* Fail if alloc failed */
return -3;
}
svg = NULL;
printf("4\\n");
result = svg_create(&svg);
if (SVG_STATUS_SUCCESS != result) {
printf ("svg_create failed\\n");
/* Fail if alloc failed */
return -4;
}
fp = fopen("test.svg", "r");
if (NULL == fp) {
printf ("failed to fopen test.svg\\n");
/* Fail if alloc failed */
return -5;
}
printf("5\\n");
result = svg_parse_file(svg, fp);
if (SVG_STATUS_SUCCESS != result) {
printf ("svg_parse_file failed\\n");
/* Fail if alloc failed */
return -6;
}
printf("6\\n");
result = svg_destroy(svg);
if (SVG_STATUS_SUCCESS != result) {
printf ("svg_destroy failed\\n");
/* Fail if alloc failed */
return -7;
}
svg = NULL;
printf("SUCCESS\\n");
return 0;
}
EOS
system ENV.cc, "test.c", "-o", "test",
"-I#{include}", "-L#{lib}", "-lsvg",
"-L#{Formula["libpng"].opt_lib}", "-lpng",
"-L#{Formula["jpeg-turbo"].opt_lib}", "-ljpeg",
"-Wl,-rpath,#{Formula["jpeg-turbo"].opt_lib}",
"-Wl,-rpath,#{HOMEBREW_PREFIX}/lib"
assert_equal "1\n2\n3\n4\n5\n6\nSUCCESS\n", shell_output("./test")
end
end
__END__
diff --git a/configure.in b/configure.in
index a9f871e..c84d417 100755
--- a/configure.in
+++ b/configure.in
@@ -8,18 +8,18 @@ LIBSVG_VERSION=0.1.4
# libtool shared library version
# Increment if the interface has additions, changes, removals.
-LT_CURRENT=1
+m4_define(LT_CURRENT, 1)
# Increment any time the source changes; set to
# 0 if you increment CURRENT
-LT_REVISION=0
+m4_define(LT_REVISION, 0)
# Increment if any interfaces have been added; set to 0
# if any interfaces have been removed. removal has
# precedence over adding, so set to 0 if both happened.
-LT_AGE=0
+m4_define(LT_AGE, 0)
-VERSION_INFO="$LT_CURRENT:$LT_REVISION:$LT_AGE"
+VERSION_INFO="LT_CURRENT():LT_REVISION():LT_AGE()"
AC_SUBST(VERSION_INFO)
dnl ===========================================================================
```
|
```java
package edu.umd.cs.findbugs.detect;
import edu.umd.cs.findbugs.AbstractIntegrationTest;
import edu.umd.cs.findbugs.test.matcher.BugInstanceMatcher;
import edu.umd.cs.findbugs.test.matcher.BugInstanceMatcherBuilder;
import org.junit.jupiter.api.Test;
import static edu.umd.cs.findbugs.test.CountMatcher.containsExactly;
import static org.hamcrest.MatcherAssert.assertThat;
class Issue1765Test extends AbstractIntegrationTest {
@Test
void testIssue() {
performAnalysis("ghIssues/Issue1765.class");
BugInstanceMatcher matcher = new BugInstanceMatcherBuilder()
.bugType("HE_HASHCODE_USE_OBJECT_EQUALS").build();
assertThat(getBugCollection(), containsExactly(1, matcher));
}
}
```
|
Aodan is the name of three reservoirs in Afghanistan on the road from Khulm (Tashkurgan) to Kunduz, and another one on the road from Kunduz to Hazrat Imam. Taken as a whole, these reservoirs had been the only water available between Kunduz and the Hazrat Imam.
References
Reservoirs in Afghanistan
|
The Reda–Hel railway is a Polish railway line, that connects the Hel Peninsula with Reda and Gdynia. The railway is located in the northern part of the Pomeranian Voivodeship.
The line is single-track and non-electrified.
Opening
This is the only standard gauge railway line built on the spit. The line was created in stages from 1879 to 1928. Construction of the final stretch of the line started in 1922 was opened in 1928. Part of the line at the port of Hel was later demolished.
Closure
In Swarzewo was the only railway junction on the route (other than the one at Reda where the line begins) with the Swarzewo–Krokowa railway which closed in 1991. For the third time rail traffic from Puck to Krokowa it was suspended in the late 80s and early 90s in May 1989 on this route ceased to run passenger trains, and in 1991 also marks
In March 2001, thanks to the intervention and funding the local government of Pomerania line was saved from closure.
Modernisation
On 26 September 1993 the last scheduled steam passenger train operated along the line.
In 1998 the line was modernised. Stations have been equipped with a remotely controlled traffic centre from Gdynia, so that the presence of service stations along the route (in addition to the ticket offices) became redundant.
In 2005, to support local connections between Gdynia and Hel began to be use railcars and diesel multiple units manufactured by PESA SA. In 2006, these vehicles took over all the services on the line. In the summer season due to the increasing number of travellers, locomotive hauled trains are also used.
On 5 October 2011 an agreement with Salcef Costruzioni edili E Ferroviaria for the revitalization of the entire line No. 213 was signed. Modernisation of the line included improving the track, the platforms and renovating buildings. The speed was increased to with the exception of the Puck-Wladyslawowo section, where the speed is . This was to shorten the travel time by 15 to 25 minutes. Renovation began in spring of 2012 and resulted in the temporary closure of the line until 10 September 2012. Due to increased transportation during the holiday season, train traffic was reinstated during the summer of 2013. In the period from 2 September 2013 to 14 June 2014 traffic on the line was again suspended. The next closure took place on between 15 and 19 November 2014. On 4 to 11 May 2015 traffic on the route Władysławowo - Hel was again stopped. Modernisation was finally completed in July 2015. With the execution of the planned works travel time between Reda and Hel has been shortened by 17 minutes.
Usage
Due to the number of tourists to the area the line has high variations through the seasons, therefore two timetables exist for the line depending on the season. The line is used year-round by regional services between Gdynia, Reda and Hel.
Long-distance trains only operate during the summer holidays due to the influx of tourists to the Hel Peninsula. Then, this route runs several pairs of express trains from other parts of Poland. These trains are hauled by diesel locomotives from Gdynia.
There is little freight traffic along the line due to a lack in industry.
See also
Railway lines of Poland
References
External links
Railway lines in Poland
Pomeranian Voivodeship
Railway lines opened in 1879
|
"Let's kill all the lawyers" is a quotation from the William Shakespeare play Henry VI, Part 2. It may also refer to:
Let's Kill All the Lawyers, a 1992 American film
"...Let's Kill All The Lawyers!," title of an issue of The Trial Of James T. Kirk series of Star Trek comics
Kill all the Lawyers, a novel by Paul Levine
"First Thing We Do, Let's Kill All the Lawyers", an episode from season two of the US television series The Newsroom
|
```java
Two ways to use an `Iterator`
Use `Arrays.asList()` to initialise lists
Finding a substring in a string
Retrieve the component type of an array
Do not attempt comparisons with NaN
```
|
```processing
/*
Andor Salga
Processing Compliant
KDE
*/
void setup(){
size(300, 300);
noStroke();
background(255);
}
void circle(int i){
if(i == 15) return;
fill(255, 255, 0);
if(i%2==0){fill(0, 0, 255);}
int j = (i > 7) ? -10 : 10;
translate(j, 0);
ellipse(0, 0, 260 - (i*20), 260 - (i*20));
circle(i+1);
}
void draw(){
translate(width/2, height/2);
rotate(frameCount/50.0f);
translate(-10, 0);
circle(0);
}
```
|
Johnny E. Morrison is a judge for the Third Circuit of Virginia and the chief judge for the Portsmouth City Circuit Court.
Career
In 2015, Morrison was reelected for an eight-year term.
In September 2019, Morrison approved the condemnation of the buildings at the Portsmouth Civic Center Complex, but allowed the Portsmouth City Jail located at the complex to continue operating. The city sheriff argued that it was the city's job to maintain the jail and stated the city had not maintained the building. In January 2020, Morrison ruled that the city could not close the jail, stating that the jail must be "repaired and maintained." In March 2020, the Portsmouth City Council voted 4-3 in favor of closing the jail due to its poor conditions. Following the vote, Morrison ruled once again that the jail could not be closed, despite the decision of the city council.
Personal life
In 2021, Morrison received a kidney transplant after his next-door neighbor, Virginia House of Delegates member Don Scott donated one of his kidneys to Morrison. He is married to Cynthia P. Morrison, who serves as the Clerk of the Portsmouth City Circuit Court.
References
Living people
20th-century American lawyers
21st-century American judges
Virginia circuit court judges
Virginia lawyers
Year of birth missing (living people)
|
Kurowice is a village in the administrative district of Gmina Jerzmanowa, within Głogów County, Lower Silesian Voivodeship, in south-western Poland. It lies approximately north of Jerzmanowa, south-west of Głogów, and north-west of the regional capital Wrocław.
The village has an approximate population of 279 people as of April 2011.
References
Kurowice
|
The title of a book, or any other published text or work of art, is a name for the work which is usually chosen by the author. A title can be used to identify the work, to put it in context, to convey a minimal summary of its contents, and to pique the reader's curiosity.
Some works supplement the title with a subtitle. Texts without separate titles may be referred to by their incipit (first word), especially those produced before the practice of titling became popular. During development, a work may be referred to by a temporary working title. A piece of legislation may have both a short title and a long title. In library cataloging, a uniform title is assigned to a work whose title is ambiguous.
In book design, the title is typically shown on the spine, the front cover, and the title page.
History
The first books, such as the Five Books of Moses, in Hebrew Torah, did not have titles. They were referred to by their incipit: Be-reshit, "In the beginning" (Genesis), Va-yikra, "And He [God] called" (Leviticus). The concept of a title is a step in the development of the modern book.
In Ancient Greek Literature, books have one-word titles that are not the initial words: new words, but following grammatical principles. The Iliad is the story of Ilion (Troy), the Trojan War; the Odysseia (Odyssey) that of Odysseus (Ulysses). The first history book in the modern sense, Thucydides' History of the Peloponnesian War, had no more title than Historiai (Histories or Stories).
When books take the form of a scroll or roll, as in the case of the Torah or the Five Megillot, it is impractical to single out an initial page. The first page, rolled up, would not be fully visible unless unrolled. For that reason, scrolls are marked with external identifying decorations.
A book with pages is not a scroll, but a codex, a stack of pages bound together through binding on one edge. Codices (plural of "codex") are much more recent than scrolls, and replaced them because codices are easier to use. The title "page" is a consequence of a bound book having pages. Until books had covers (another development in the history of the book), the top page was highly visible. To make the content of the book easy to ascertain, there came the custom of printing on the top page a title, a few words in larger letters than the body, and thus readable from a greater distance.
As the book evolved, most books became the product of an author. Early books, like those of the Old Testament, did not have authors. Gradually the concept took hold—Homer is a complicated case—but authorship of books, all of which were or were believed to be non-fiction, was not the same as, since the Western Renaissance, writing a novel. The concept of intellectual property did not exist; copying another person's work was once praiseworthy. The invention of printing changed the economics of the book, making it possible for the owner of a manuscript to make money selling printed copies. The concept of authorship became much more important. The name of the author would also go on the title page.
Gradually more and more information was added to the title page: the location printed, the printer, at later dates the publisher, and the date. Sometimes a book's title continued at length, becoming an advertisement for the book which a possible purchaser would see in a bookshop (see example).
Typographical conventions
Most English-language style guides, including the Chicago Manual of Style, the Modern Language Association Style Guide, and APA style recommend that the titles of longer or complete works such as books, movies, plays, albums, and periodicals be written in italics, like: the New York Times is a major American newspaper. These guides recommend that the titles of shorter or subsidiary works, such as articles, chapters, and poems, be placed written within quotation marks, like: "Stopping by Woods on a Snowy Evening" is a poem by Robert Frost. The AP Stylebook recommends that book titles be written in quotation marks. Underlining is used where italics are not possible, such as on a typewriter or in handwriting.
Titles may also be written in title case, with most or all words capitalized. This is true both when the title is written in or on the work in question, and when mentioned in other writing. The original author or publisher may deviate from this for stylistic purposes, and other publications might or might not replicate the original capitalization when mentioning the work. Quotes, italics, and underlines are generally not used in the title on the work itself.
See also
References
Further reading
Book design
Names
Publishing
|
CSS Rob Roy was a Confederate blockade runner commanded by Captain William Watson, that ran to and from Bermuda, the Bahamas and Cuba from 1862 to 1864, during the American Civil War.
Watson, who had immigrated from Great Britain several years before, had originally enlisted in the Confederate Army as a sergeant before being wounded at the Second Battle of Corinth, and discharged due to his injuries. Hiring out a schooner, commissioned as Rob Roy, Williams would bring desperately needed supplies into blockaded southern ports, specifically Galveston, Texas before selling the ship after financial disagreements with business associates. She was finally chased ashore and run aground by the Union vessel Fox and the on 2 March 1865 at Deadmans Bay where her crew set her on fire. Williams would later write about his wartime naval career in an autobiography The Civil War Adventures of a Blockade Runner in 1892.
Citations
References
Further reading
Rob Roy
Maritime incidents in March 1865
|
Neha Sharad is an Indian television actor and poet. She has worked in TV shows, including Tara, Waqt ki Raftar, Mamta, Gumraah, Yeh Duniya Ghazab Ki and Farmaan.
Life
Neha was born in Bhopal and grew up in Bombay. She is the daughter of writer Padma Shri Sharad Joshi and theatre artist Irfana Siddiqui. She was involved in the 2009 TV series, Lapataganj, as a creative head, as the initial episodes were based on her father's works.
She has organized literary festivals, such as Sharadotsav, to commemorate her father's works.
References
External links
Indian television actresses
Living people
Actresses from Mumbai
1970 births
|
```c
/* packet-rip.c
* Routines for RIPv1 and RIPv2 packet disassembly
* RFC1058 (STD 34), RFC1388, RFC1723, RFC2453 (STD 56)
*
* RFC2082 ( Keyed Message Digest Algorithm )
* Emanuele Caratti <wiz@iol.it>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
*
* This program is free software; you can redistribute it and/or
* as published by the Free Software Foundation; either version 2
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#define NEW_PROTO_TREE_API
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
#include <epan/prefs.h>
#include <epan/to_str.h>
#define UDP_PORT_RIP 520
#define RIPv1 1
#define RIPv2 2
void proto_register_rip(void);
static const value_string version_vals[] = {
{ RIPv1, "RIPv1" },
{ RIPv2, "RIPv2" },
{ 0, NULL }
};
static const value_string command_vals[] = {
{ 1, "Request" },
{ 2, "Response" },
{ 3, "Traceon" },
{ 4, "Traceoff" },
{ 5, "Vendor specific (Sun)" },
{ 0, NULL }
};
#define AFVAL_UNSPEC 0
#define AFVAL_IP 2
static const value_string family_vals[] = {
{ AFVAL_UNSPEC, "Unspecified" },
{ AFVAL_IP, "IP" },
{ 0, NULL }
};
#define AUTH_IP_ROUTE 1
#define AUTH_PASSWORD 2
#define AUTH_KEYED_MSG_DIGEST 3
static const value_string rip_auth_type[] = {
{ AUTH_IP_ROUTE, "IP Route" },
{ AUTH_PASSWORD, "Simple Password" },
{ AUTH_KEYED_MSG_DIGEST, "Keyed Message Digest" },
{ 0, NULL }
};
#define RIP_HEADER_LENGTH 4
#define RIP_ENTRY_LENGTH 20
#define MD5_AUTH_DATA_LEN 16
static gboolean pref_display_routing_domain = FALSE;
void proto_reg_handoff_rip(void);
static dissector_handle_t rip_handle;
static header_field_info *hfi_rip = NULL;
#define RIP_HFI_INIT HFI_INIT(proto_rip)
static header_field_info hfi_rip_command RIP_HFI_INIT = {
"Command", "rip.command", FT_UINT8, BASE_DEC,
VALS(command_vals), 0, "What type of RIP Command is this", HFILL };
static header_field_info hfi_rip_version RIP_HFI_INIT = {
"Version", "rip.version", FT_UINT8, BASE_DEC,
VALS(version_vals), 0, "Version of the RIP protocol", HFILL };
static header_field_info hfi_rip_routing_domain RIP_HFI_INIT = {
"Routing Domain", "rip.routing_domain", FT_UINT16, BASE_DEC,
NULL, 0, "RIPv2 Routing Domain", HFILL };
static header_field_info hfi_rip_ip RIP_HFI_INIT = {
"IP Address", "rip.ip", FT_IPv4, BASE_NONE,
NULL, 0, NULL, HFILL};
static header_field_info hfi_rip_netmask RIP_HFI_INIT = {
"Netmask", "rip.netmask", FT_IPv4, BASE_NETMASK,
NULL, 0, NULL, HFILL};
static header_field_info hfi_rip_next_hop RIP_HFI_INIT = {
"Next Hop", "rip.next_hop", FT_IPv4, BASE_NONE,
NULL, 0, "Next Hop router for this route", HFILL};
static header_field_info hfi_rip_metric RIP_HFI_INIT = {
"Metric", "rip.metric", FT_UINT16, BASE_DEC,
NULL, 0, "Metric for this route", HFILL };
static header_field_info hfi_rip_auth RIP_HFI_INIT = {
"Authentication type", "rip.auth.type", FT_UINT16, BASE_DEC,
VALS(rip_auth_type), 0, "Type of authentication", HFILL };
static header_field_info hfi_rip_auth_passwd RIP_HFI_INIT = {
"Password", "rip.auth.passwd", FT_STRING, BASE_NONE,
NULL, 0, "Authentication password", HFILL };
static header_field_info hfi_rip_family RIP_HFI_INIT = {
"Address Family", "rip.family", FT_UINT16, BASE_DEC,
VALS(family_vals), 0, NULL, HFILL };
static header_field_info hfi_rip_route_tag RIP_HFI_INIT = {
"Route Tag", "rip.route_tag", FT_UINT16, BASE_DEC,
NULL, 0, NULL, HFILL };
static header_field_info hfi_rip_zero_padding RIP_HFI_INIT = {
"Zero adding", "rip.zero_padding", FT_STRING, BASE_NONE,
NULL, 0, "Authentication password", HFILL };
static header_field_info hfi_rip_digest_offset RIP_HFI_INIT = {
"Digest Offset", "rip.digest_offset", FT_UINT16, BASE_DEC,
NULL, 0, NULL, HFILL };
static header_field_info hfi_rip_key_id RIP_HFI_INIT = {
"Key ID", "rip.key_id", FT_UINT8, BASE_DEC,
NULL, 0, NULL, HFILL };
static header_field_info hfi_rip_auth_data_len RIP_HFI_INIT = {
"Auth Data Len", "rip.auth_data_len", FT_UINT8, BASE_DEC,
NULL, 0, NULL, HFILL };
static header_field_info hfi_rip_auth_seq_num RIP_HFI_INIT = {
"Seq num", "rip.seq_num", FT_UINT32, BASE_DEC,
NULL, 0, NULL, HFILL };
static header_field_info hfi_rip_authentication_data RIP_HFI_INIT = {
"Authentication Data", "rip.authentication_data", FT_BYTES, BASE_NONE,
NULL, 0, NULL, HFILL };
static gint ett_rip = -1;
static gint ett_rip_vec = -1;
static gint ett_auth_vec = -1;
static expert_field ei_rip_unknown_address_family = EI_INIT;
static void dissect_unspec_rip_vektor(tvbuff_t *tvb, int offset, guint8 version,
proto_tree *tree);
static void dissect_ip_rip_vektor(tvbuff_t *tvb, int offset, guint8 version,
proto_tree *tree);
static gint dissect_rip_authentication(tvbuff_t *tvb, int offset,
proto_tree *tree);
static int
dissect_rip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
int offset = 0;
proto_tree *rip_tree = NULL;
proto_item *ti;
guint8 command;
guint8 version;
guint16 family;
gint trailer_len = 0;
gboolean is_md5_auth = FALSE;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RIP");
col_clear(pinfo->cinfo, COL_INFO);
command = tvb_get_guint8(tvb, 0);
version = tvb_get_guint8(tvb, 1);
col_set_str(pinfo->cinfo, COL_PROTOCOL,
val_to_str_const(version, version_vals, "RIP"));
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(command, command_vals, "Unknown command (%u)"));
ti = proto_tree_add_item(tree, hfi_rip, tvb, 0, -1, ENC_NA);
rip_tree = proto_item_add_subtree(ti, ett_rip);
proto_tree_add_uint(rip_tree, &hfi_rip_command, tvb, 0, 1, command);
proto_tree_add_uint(rip_tree, &hfi_rip_version, tvb, 1, 1, version);
if (version == RIPv2 && pref_display_routing_domain == TRUE)
proto_tree_add_uint(rip_tree, &hfi_rip_routing_domain, tvb, 2, 2,
tvb_get_ntohs(tvb, 2));
/* skip header */
offset = RIP_HEADER_LENGTH;
/* zero or more entries */
while (tvb_reported_length_remaining(tvb, offset) > trailer_len ) {
family = tvb_get_ntohs(tvb, offset);
switch (family) {
case AFVAL_UNSPEC: /* Unspecified */
/*
* There should be one entry in the request, and a metric
* of infinity, meaning "show the entire routing table".
*/
dissect_unspec_rip_vektor(tvb, offset, version, rip_tree);
break;
case AFVAL_IP: /* IP */
dissect_ip_rip_vektor(tvb, offset, version, rip_tree);
break;
case 0xFFFF:
if( offset == RIP_HEADER_LENGTH ) {
trailer_len=dissect_rip_authentication(tvb, offset, rip_tree);
is_md5_auth = TRUE;
break;
}
if(is_md5_auth && tvb_reported_length_remaining(tvb, offset) == 20)
break;
/* Intentional fall through: auth Entry MUST be the first! */
default:
proto_tree_add_expert_format(rip_tree, pinfo, &ei_rip_unknown_address_family, tvb, offset,
RIP_ENTRY_LENGTH, "Unknown address family %u", family);
break;
}
offset += RIP_ENTRY_LENGTH;
}
return tvb_captured_length(tvb);
}
static void
dissect_unspec_rip_vektor(tvbuff_t *tvb, int offset, guint8 version,
proto_tree *tree)
{
proto_tree *rip_vektor_tree;
guint32 metric;
metric = tvb_get_ntohl(tvb, offset+16);
rip_vektor_tree = proto_tree_add_subtree_format(tree, tvb, offset,
RIP_ENTRY_LENGTH, ett_rip_vec, NULL, "Address not specified, Metric: %u",
metric);
proto_tree_add_item(rip_vektor_tree, &hfi_rip_family, tvb, offset, 2, ENC_BIG_ENDIAN);
if (version == RIPv2) {
proto_tree_add_item(rip_vektor_tree, &hfi_rip_route_tag, tvb, offset+2, 2,
ENC_BIG_ENDIAN);
proto_tree_add_item(rip_vektor_tree, &hfi_rip_netmask, tvb, offset+8, 4,
ENC_BIG_ENDIAN);
proto_tree_add_item(rip_vektor_tree, &hfi_rip_next_hop, tvb, offset+12, 4,
ENC_BIG_ENDIAN);
}
proto_tree_add_uint(rip_vektor_tree, &hfi_rip_metric, tvb,
offset+16, 4, metric);
}
static void
dissect_ip_rip_vektor(tvbuff_t *tvb, int offset, guint8 version,
proto_tree *tree)
{
proto_tree *rip_vektor_tree;
guint32 metric;
metric = tvb_get_ntohl(tvb, offset+16);
rip_vektor_tree = proto_tree_add_subtree_format(tree, tvb, offset,
RIP_ENTRY_LENGTH, ett_rip_vec, NULL, "IP Address: %s, Metric: %u",
tvb_ip_to_str(tvb, offset+4), metric);
proto_tree_add_item(rip_vektor_tree, &hfi_rip_family, tvb, offset, 2, ENC_BIG_ENDIAN);
if (version == RIPv2) {
proto_tree_add_item(rip_vektor_tree, &hfi_rip_route_tag, tvb, offset+2, 2,
ENC_BIG_ENDIAN);
}
proto_tree_add_item(rip_vektor_tree, &hfi_rip_ip, tvb, offset+4, 4, ENC_BIG_ENDIAN);
if (version == RIPv2) {
proto_tree_add_item(rip_vektor_tree, &hfi_rip_netmask, tvb, offset+8, 4,
ENC_BIG_ENDIAN);
proto_tree_add_item(rip_vektor_tree, &hfi_rip_next_hop, tvb, offset+12, 4,
ENC_BIG_ENDIAN);
}
proto_tree_add_uint(rip_vektor_tree, &hfi_rip_metric, tvb,
offset+16, 4, metric);
}
static gint
dissect_rip_authentication(tvbuff_t *tvb, int offset, proto_tree *tree)
{
proto_tree *rip_authentication_tree;
guint16 authtype;
guint32 digest_off, auth_data_len;
auth_data_len = 0;
authtype = tvb_get_ntohs(tvb, offset + 2);
rip_authentication_tree = proto_tree_add_subtree_format(tree, tvb, offset, RIP_ENTRY_LENGTH,
ett_rip_vec, NULL, "Authentication: %s", val_to_str( authtype, rip_auth_type, "Unknown (%u)" ) );
proto_tree_add_uint(rip_authentication_tree, &hfi_rip_auth, tvb, offset+2, 2,
authtype);
switch ( authtype ) {
case AUTH_PASSWORD: /* Plain text password */
proto_tree_add_item(rip_authentication_tree, &hfi_rip_auth_passwd,
tvb, offset+4, 16, ENC_ASCII|ENC_NA);
break;
case AUTH_KEYED_MSG_DIGEST: /* Keyed MD5 rfc 2082 */
digest_off = tvb_get_ntohs( tvb, offset+4 );
proto_tree_add_item( rip_authentication_tree, &hfi_rip_digest_offset, tvb, offset+4, 2, ENC_BIG_ENDIAN);
proto_tree_add_item( rip_authentication_tree, &hfi_rip_key_id, tvb, offset+6, 1, ENC_NA);
auth_data_len = tvb_get_guint8( tvb, offset+7 );
proto_tree_add_item( rip_authentication_tree, &hfi_rip_auth_data_len, tvb, offset+7, 1, ENC_NA);
proto_tree_add_item( rip_authentication_tree, &hfi_rip_auth_seq_num, tvb, offset+8, 4, ENC_BIG_ENDIAN);
proto_tree_add_item( rip_authentication_tree, &hfi_rip_zero_padding, tvb, offset+12, 8, ENC_NA);
rip_authentication_tree = proto_tree_add_subtree( rip_authentication_tree, tvb, offset-4+digest_off,
MD5_AUTH_DATA_LEN+4, ett_auth_vec, NULL, "Authentication Data Trailer" );
proto_tree_add_item( rip_authentication_tree, &hfi_rip_authentication_data, tvb, offset-4+digest_off+4,
MD5_AUTH_DATA_LEN, ENC_NA);
break;
}
return auth_data_len;
}
void
proto_register_rip(void)
{
#ifndef HAVE_HFI_SECTION_INIT
static header_field_info *hfi[] = {
&hfi_rip_command,
&hfi_rip_version,
&hfi_rip_routing_domain,
&hfi_rip_ip,
&hfi_rip_netmask,
&hfi_rip_next_hop,
&hfi_rip_metric,
&hfi_rip_auth,
&hfi_rip_auth_passwd,
&hfi_rip_family,
&hfi_rip_route_tag,
&hfi_rip_zero_padding,
&hfi_rip_digest_offset,
&hfi_rip_key_id,
&hfi_rip_auth_data_len,
&hfi_rip_auth_seq_num,
&hfi_rip_authentication_data,
};
#endif /* HAVE_HFI_SECTION_INIT */
static gint *ett[] = {
&ett_rip,
&ett_rip_vec,
&ett_auth_vec,
};
static ei_register_info ei[] = {
{ &ei_rip_unknown_address_family, { "rip.unknown_address_family", PI_PROTOCOL, PI_WARN, "Unknown address family", EXPFILL }},
};
expert_module_t* expert_rip;
module_t *rip_module;
int proto_rip;
proto_rip = proto_register_protocol("Routing Information Protocol", "RIP", "rip");
hfi_rip = proto_registrar_get_nth(proto_rip);
proto_register_fields(proto_rip, hfi, array_length(hfi));
proto_register_subtree_array(ett, array_length(ett));
expert_rip = expert_register_protocol(proto_rip);
expert_register_field_array(expert_rip, ei, array_length(ei));
rip_module = prefs_register_protocol(proto_rip, proto_reg_handoff_rip);
prefs_register_bool_preference(rip_module, "display_routing_domain", "Display Routing Domain field", "Display the third and forth bytes of the RIPv2 header as the Routing Domain field (introduced in RFC 1388 [January 1993] and obsolete as of RFC 1723 [November 1994])", &pref_display_routing_domain);
rip_handle = create_dissector_handle(dissect_rip, proto_rip);
}
void
proto_reg_handoff_rip(void)
{
dissector_add_uint("udp.port", UDP_PORT_RIP, rip_handle);
}
/*
* Editor modelines - path_to_url
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/
```
|
A Happy Event () is a 2011 French-Belgian comedy-drama film directed by Rémi Bezançon.
Plot
Barbara and Nicolas spin the perfect love. But there is one thing missing to their happiness: a child. One day, Barbara becomes pregnant and the birth of a baby girl will trouble her relationship with Nicolas and his family.
Cast
Louise Bourgoin - Barbara
Pio Marmaï - Nicolas
Josiane Balasko - Claire
Thierry Frémont - Tony
Gabrielle Lazure - Édith
Firmine Richard - Midwife
Lannick Gautry - Doctor Camille Rose
Daphné Bürki - Katia
Louis-Do de Lencquesaing - Jean-François Truffard
Myriem Akheddiou - Nurse
References
External links
French pregnancy films
Gaumont Film Company films
2011 comedy-drama films
2011 films
French comedy-drama films
Belgian comedy-drama films
Films directed by Rémi Bezançon
Films based on French novels
2010s pregnancy films
Belgian pregnancy films
2010s French films
|
Fabrizio Zambrella (born 1 March 1986) is a Swiss-former Italian professional footballer who played for FC Meyrin.
Career
Zambrella played for Brescia, leaving the club at the end of his contract on 30 June 2009. On 20 October 2009, FC Sion signed the Swiss midfielder on a free transfer until June 2013. He joined PAS Giannina on a three-month loan in January 2012. Following his return to Sion, the player was seen as surplus to requirements and did not feature at all for the first-team during the 2012–13 season. After one year out of competitive football, Zambrella made a return by joining FC Lausanne-Sport on 1 July 2013, signing a two-year contract.
International career
Zambrella was a squad member of Switzerland's teams in the 2004 UEFA European Under-19 Championship and the 2005 FIFA World Youth Championship.
Honours
Sion
Swiss Cup: 2010–11
References
External links
1986 births
Living people
Footballers from Geneva
Men's association football midfielders
Swiss men's footballers
Italian men's footballers
Swiss people of Italian descent
Switzerland men's youth international footballers
Switzerland men's under-21 international footballers
Swiss expatriate men's footballers
Swiss expatriate sportspeople in Italy
Expatriate men's footballers in Italy
Expatriate men's footballers in Greece
Servette FC players
Brescia Calcio players
FC Sion players
FC Lausanne-Sport players
PAS Giannina F.C. players
Swiss Super League players
Serie A players
Serie B players
Super League Greece players
FC Stade Nyonnais players
|
Trevor Noah (born 20 February 1984) is a South African comedian, writer, producer, political commentator, actor, and former television host. He was the host of The Daily Show, an American late-night talk show and satirical news program on Comedy Central, from 2015 to 2022. Noah has won various awards, including a Primetime Emmy Award from 11 nominations. He was named one of "The 35 Most Powerful People in New York Media" by The Hollywood Reporter in 2017 and 2018. In 2018, Time magazine named him one of the hundred most influential people in the world. In 2023, he won the Erasmus Prize.
Born in Johannesburg, Noah began his career in South Africa in 2002. He had several hosting roles with the South African Broadcasting Corporation (SABC) and was the runner-up in the fourth season of South Africa's iteration of Strictly Come Dancing in 2008. From 2010 to 2011, he hosted the late-night talk show Tonight with Trevor Noah, which he created and aired on M-Net and DStv.
In 2014, Noah became the Senior International Correspondent for The Daily Show, and in 2015 succeeded long-time host Jon Stewart. His autobiographical comedy book Born a Crime was published in 2016. He hosted the 63rd, the 64th and the 65th Annual Grammy Awards as well as the 2022 White House Correspondents Dinner.
Early life
Trevor Noah was born on 20 February 1984, in Johannesburg, Transvaal (now Gauteng), South Africa. His father, Robert, is Swiss-German, and his mother, Patricia Nombuyiselo Noah, is Xhosa.
Under apartheid legislation, Noah's mother was classified as Black, and his father was classified as White. Noah himself was classified as Coloured. At the time of his birth, his parents' interracial relationship was illegal, which Noah highlights in his autobiography. Interracial sexual relations and marriages were decriminalised a year after his birth, when the Immorality Act was amended in 1985. Patricia and her mother, Nomalizo Frances Noah, raised Trevor in the black township of Soweto. Noah began his schooling at Maryvale College, a private Roman Catholic primary and high school in Maryvale, Gauteng, a suburb of Johannesburg.
Career
Early work and breakthrough
In 2002, Noah had a small role on an episode of the South African soap opera Isidingo. He later hosted his own radio show Noah's Ark on Gauteng's leading youth-radio station, YFM. When he was 21 years old, his friends dared him to perform a comedy routine at a nightclub. He entertained the audience with humorous stories about his friends and his life. After that night Noah continued performing at comedy clubs, gaining recognition along the way. He dropped his radio show and acting to focus on comedy, and has performed with South African comedians such as: David Kau, Kagiso Lediga, Riaad Moosa, Darren Simpson, Marc Lottering, Barry Hilton, and Nik Rabinowitz, international comedians such as Paul Rodriguez, Carl Barron, Dan Ilic, and Paul Zerdin, and as the opening act for American comedian Gabriel Iglesias in November 2007 and Canadian comedian Russell Peters on his South African tour.
Noah hosted an educational TV programme, Run the Adventure (2004–2006) on SABC 2. In 2007, he hosted The Real Goboza, a gossip-themed show on SABC 1, and Siyadlala, a sports show also on the SABC. In 2008, Noah cohosted, alongside Pabi Moloi, The Amazing Date (a dating gameshow) and was a Strictly Come Dancing contestant in the fourth series. In 2009, he hosted the 3rd Annual South Africa Film and Television Awards (SAFTAs) and co-hosted alongside Eugene Khoza on The Axe Sweet Life, a reality competition series. In 2010, Noah hosted the 16th annual South African Music Awards and also hosted Tonight with Trevor Noah on MNet (for the second series, it moved to DStv's Mzansi Magic Channel). In 2010, Noah also became a spokesperson and consumer protection agent for Cell C, South Africa's third-largest mobile phone network provider.
Noah performed in The Blacks Only Comedy Show, the Heavyweight Comedy Jam, the Vodacom Campus Comedy Tour, the Cape Town International Comedy Festival, the Jozi Comedy Festival, and Bafunny Bafunny (2010). His stand-up comedy specials in South Africa include The Daywalker (2009), Crazy Normal (2011), That's Racist (2012), and It's My Culture (2013).
In 2011, he relocated to the United States. In January 2012, Noah became the first South African stand-up comedian to appear on The Tonight Show; and in May 2013, he became the first to appear on Late Show with David Letterman. Noah was the subject of the 2012 documentary You Laugh But It's True. The same year, he starred in the one-man comedy show Trevor Noah: The Racist, which was based on his similarly titled South African special That's Racist. In September 2012, Noah was the Roastmaster in a Comedy Central Roast of South African Afrikaans singer Steve Hofmeyr. In 2013, he performed the comedy special Trevor Noah: African American. In October 2013, he was a guest on BBC Two's comedy panel show QI. In November 2013, he was a panellist on Channel 4 game show 8 Out of 10 Cats and appeared on Sean Lock's team in 8 Out of 10 Cats Does Countdown in September 2014.
The Daily Show
In December 2014, Noah became a recurring contributor on The Daily Show. In March 2015, Comedy Central announced that Noah would succeed Jon Stewart as host of The Daily Show; his tenure began on 28 September 2015.
Following his announcement as Stewart's successor, attention was drawn on the Internet to jokes he had posted on his Twitter account, some of which were criticised as being misogynistic, and others as antisemitic or mocking the Holocaust. Noah responded by tweeting: "To reduce my views to a handful of jokes that didn't land is not a true reflection of my character, nor my evolution as a comedian." Comedy Central stood behind Noah, saying in a statement, "Like many comedians, Trevor Noah pushes boundaries; he is provocative and spares no one, himself included... To judge him or his comedy based on a handful of jokes is unfair. Trevor is a talented comedian with a bright future at Comedy Central." Mary Kluk, chairperson of the South African Jewish Board of Deputies (SAJBD), said that the jokes were not signs of anti-Jewish prejudice and that they were part of Noah's style of comedy. Noah has faced further criticism after video clips of him joking about Aboriginal women and the Marikana massacre in old standup routines resurfaced.
After Noah took over from Stewart, viewership dropped 37%, and its Nielsen ratings fell below those of several other shows hosted by Daily Show alumni; however, according to Comedy Central's president, the Daily Show under Noah was the number-one show for millennials. James Poniewozik of The New York Times praised him and the show's writers, saying, "Mr. Noah's debut was largely successful, it was also because of the operating system—the show's writing—running under the surface". Robert Lloyd of the Los Angeles Times described him as "charming and composed—almost inevitably low-key compared with the habitually antic and astonished Stewart". Other critics gave him less favourable reviews, with Salon writing "Jon Stewart created a national treasure. Noah has dulled its knife, weakened the satire, let the powerful run free." Noah's platform on the show has led to three stand-up specials on Comedy Central and Netflix. By 2017, nightly viewership was less than half of what it had been during the end of Stewart's tenure; viewership among millennials remained solid, however, and Comedy Central extended Noah's contract as host of The Daily Show through 2022. He would also produce and host annual end-of-year specials for Comedy Central.
After France won the 2018 FIFA World Cup, Noah commented, "I get it, they have to say it's the French team. But look at those guys. You don't get that tan by hanging out in the south of France, my friends. Basically if you don't understand, France is Africans' backup team." The French Ambassador to the United States, Gérard Araud, issued a letter condemning Noah's joke. He wrote, "Unlike the United States of America, France does not refer to its citizens based on their race, religion or origin. For us, there is no hyphenated identity, the roots are an individual reality. By calling them an African team, it seems that you are denying their Frenchness." Noah responded to the controversy, saying he did not intend to deny that the team was French, and instead to celebrate their African heritage.
In April 2017, Noah began developing a talk show for Jordan Klepper: The Opposition with Jordan Klepper, which premiered in September, and ran for one season. Noah also executive-produced Klepper, a primetime weekly docuseries, beginning in May 2019. In March 2018, Noah signed a multiyear contract with Viacom giving them first-look rights to any future projects by him. In addition to the deal, Noah would also be launching an international production and distribution company called Day Zero Productions.
In March 2022, Noah criticized the greater emphasis on events in Ukraine than on those in other regions such as Africa and the Middle East, claiming racial bias and a racial "double standard" when it comes to news reporting. He pointed to the willingness of Eastern European countries like Poland to accept Ukrainian refugees and noted how "interesting" it was that the countries of Central and Eastern Europe has been "so willing and able to accept a million people coming into their countries in just a few days when just recently they didn't seem to have any space for a different group of refugees." In September 2022, he mocked the sham referendums held in the Russian-occupied parts of Ukraine.
In October 2022, after Rishi Sunak became Prime Minister of the United Kingdom, Noah claimed that there was a racist backlash in the UK against someone of Indian heritage taking that role. British Conservative politician Sajid Javid described Noah's remarks as "A narrative catered to his audience, at a cost of being completely detached from reality." There were suggestions that Noah was projecting the U.S. political context onto the UK—English author Tom Holland stated: "As ever, the inability of American liberals to understand the world beyond the US in anything but American terms is a thing of wonder." Sunak's spokesperson insisted, in response to Noah's claims, that the UK is not a racist country; Noah stated that he never made a statement about the country as a whole, only about "some people".
On , Noah requested some extra minutes during that night's program and announced that he would be leaving The Daily Show at an undetermined future date after hosting the show for seven years. After revisiting stand-up comedy, he felt a longing to return to visiting countries for shows, learning new languages and "being everywhere, doing everything". It was confirmed the following month that Noah's last show would be on 8 December 2022.
Books
His memoir Born a Crime was published in November 2016 and was received favourably by major U.S. book reviewers. Other than the author, his mother has a central role in the book, while his European father is mentioned only occasionally. It became a No. 1 New York Times Bestseller and was named one of the best books of the year by The New York Times, Newsday, Esquire, NPR, and Booklist. It was announced that a film adaptation based on the book would star Lupita Nyong'o as his mother.
In July 2018, Noah and The Daily Show writing staff released The Donald J. Trump Presidential Twitter Library, a book comprising hundreds of Trump tweets and featuring a foreword by Pulitzer Prize-winning historian Jon Meacham.
Other work
In 2017, he made an appearance on the TV series Nashville. In 2018, he appeared in Black Panther, Coming 2 America, and American Vandal.
In addition to hosting The Daily Show, Noah has hosted the Grammy Awards thrice: in 2021, in 2022, and in 2023. He also served as host of the White House Correspondents' Dinner in 2022.
As of June 20, 2023 it is announced that Trevor Noah is set to launch a weekly Spotify original podcast going over various topics. The podcast is set to release later in 2023 and the name as of the podcast is yet to be announced.
Influences
In 2013, Noah said of his comedic influences, He also cited Jon Stewart as an influence and a mentor, following his appointment to succeed Stewart as host of The Daily Show. In an interview with The New York Times, Noah likened Stewart to "a Jewish Yoda" and recounted advice Stewart gave him, saying,
Among comedians who say they were influenced by Noah are Michelle Wolf, Jordan Klepper, and Hasan Minhaj. Noah's mixed-race ancestry, his experiences growing up in Soweto, and his observations about race and ethnicity are leading themes in his comedy.
Personal life
Noah speaks English, Southern Sotho, Zulu, Xhosa, Tswana, Tsonga and very basic Afrikaans. Noah has ADHD. He resides in New York City.
In 1992, Noah's mother, Patricia Nombuyiselo, married Ngisaveni Abel Shingange; they had two sons together. Shingange physically abused both Trevor and his mother, and the couple legally divorced in 1996. In 2009, after Patricia married Sfiso Khoza, Shingange shot her in the leg and through the back of her head; she survived as the bullet went through the base of her head, avoiding the spinal cord, brain, and all major nerves and blood vessels, then exiting with minor damage to her nostril. When Noah confronted him over the phone about the shooting, Shingange threatened his life, prompting Noah to leave Johannesburg for Los Angeles.
In 2011, Shingange was convicted of attempted murder and sentenced the following year to three years of correctional supervision. Noah stated that he hoped the attention surrounding the incident would raise awareness of the broader issue of domestic violence in South Africa: "For years my mother reached out to police for help with domestic abuse, and nothing was ever done. This is the norm in South Africa. Dockets went missing and cases never went to court."
Noah has described himself as being progressive and having a global perspective. However, he has clarified that he considers himself a "progressive person", but not a "political progressive" and prefers not to be categorised as being either right or left in the context of US partisanship.
In April 2018, Noah launched The Trevor Noah Foundation, a youth development initiative that works to provide access to high-quality education. Noah's vision is a world where an education enables youth to dream, see and build the impossible.
Noah was selected as the Class Day speaker for Princeton University's Class of 2021. He gave his address virtually on 15 May 2021, and was inducted as an honorary member of the Class of 2021.
Filmography
Film
Television
Awards
Bibliography
Audiobooks
2016: Born a Crime: Stories from a South African Childhood (read by the author), Audible Studios on Brilliance Audio,
See also
New Yorkers in journalism
References
External links
1984 births
Living people
21st-century South African male actors
21st-century South African writers
Coloured South African people
Late night television talk show hosts
Male television writers
Media critics
People from Soweto
People of Swiss-German descent
People with attention deficit hyperactivity disorder
Progressivism in South Africa
Shorty Award winners
South African autobiographers
South African Christians
South African emigrants to the United States
South African expatriates in the United States
South African impressionists (entertainers)
South African male comedians
South African male film actors
South African male television actors
South African people of Swiss descent
South African people of Xhosa descent
South African satirists
South African stand-up comedians
South African television producers
South African television writers
South African voice actors
Xhosa people
|
Karuna Badwal is an Indian film producer; she has co-produced hit films like Chennai Express and Happy New Year.
Career
She started her film career as Shahrukh Khan's business manager.
Personal life
She is married to Ravinder Singh Badwal and the couple have two children Hans Badwal and Shums Badwal.
Filmography
References
External links
Happy New Year (2014 film)
Chennai Express
Living people
Film producers from Mumbai
Year of birth missing (living people)
Indian women film producers
Hindi film producers
Businesswomen from Maharashtra
|
O Chifrudo is a theatrical comedy in two acts, written by Miguel M. Abrahão, in 1978 and published first in 1983 in Brazil.
Plot summary
O Chifrudo is a comedy that requires actors with great experience and versatility. This text gave opportunity to the author, Miguel M. Abrahão, to reassess, on his way, one of the most common themes and best known in world literature: the love triangle. The story is not focused on the content melodramatic as one would predict. First and foremost is an acid criticism of consumerism.
Dayse, the woman is presented to the public as consumer object, just as Hermes, her husband, her lover, Dondoco, or even the two neighboring, whose profiles are comically different.
With surprise ending and original, the piece always captivated audiences in the country and gave great opportunities to actors in search of roles that allow for true theatrical performance and not the easy laughter and obvious humor of modern.
Bibliography
COUTINHO, Afrânio; SOUSA, J. Galante de. Enciclopédia de literatura brasileira. São Paulo: Global; Rio de Janeiro: Fundação Biblioteca Nacional, Academia Brasileira de Letras, 2001: 2v.
Sociedade Brasileira de Autores Teatrais
National Library of Brazil - Archives
External links
- Digital Library of Literature of UFSC
ENCYCLOPEDIA OF THEATRE
Brazilian Society of playwrights
Notes
1978 plays
Brazilian plays
|
```objective-c
/*
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Paul Vixie.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* @(#)bitstring.h 5.2 (Berkeley) 4/4/90
*/
typedef unsigned char bitstr_t;
/* internal macros */
/* byte of the bitstring bit is in */
#define _bit_byte(bit) \
((bit) >> 3)
/* mask for the bit within its byte */
#define _bit_mask(bit) \
(1 << ((bit)&0x7))
/* external macros */
/* bytes in a bitstring of nbits bits */
#define bitstr_size(nbits) \
((((nbits) - 1) >> 3) + 1)
/* allocate a bitstring */
#define bit_alloc(nbits) \
(bitstr_t *)malloc(1, \
(unsigned int)bitstr_size(nbits) * sizeof(bitstr_t))
/* allocate a bitstring on the stack */
#define bit_decl(name, nbits) \
(name)[bitstr_size(nbits)]
/* is bit N of bitstring name set? */
#define bit_test(name, bit) \
((name)[_bit_byte(bit)] & _bit_mask(bit))
/* set bit N of bitstring name */
#define bit_set(name, bit) \
(name)[_bit_byte(bit)] |= _bit_mask(bit)
/* clear bit N of bitstring name */
#define bit_clear(name, bit) \
(name)[_bit_byte(bit)] &= ~_bit_mask(bit)
/* clear bits start ... stop in bitstring */
#define bit_nclear(name, start, stop) { \
register bitstr_t *_name = name; \
register int _start = start, _stop = stop; \
register int _startbyte = _bit_byte(_start); \
register int _stopbyte = _bit_byte(_stop); \
if (_startbyte == _stopbyte) { \
_name[_startbyte] &= ((0xff >> (8 - (_start&0x7))) | \
(0xff << ((_stop&0x7) + 1))); \
} else { \
_name[_startbyte] &= 0xff >> (8 - (_start&0x7)); \
while (++_startbyte < _stopbyte) \
_name[_startbyte] = 0; \
_name[_stopbyte] &= 0xff << ((_stop&0x7) + 1); \
} \
}
/* set bits start ... stop in bitstring */
#define bit_nset(name, start, stop) { \
register bitstr_t *_name = name; \
register int _start = start, _stop = stop; \
register int _startbyte = _bit_byte(_start); \
register int _stopbyte = _bit_byte(_stop); \
if (_startbyte == _stopbyte) { \
_name[_startbyte] |= ((0xff << (_start&0x7)) & \
(0xff >> (7 - (_stop&0x7)))); \
} else { \
_name[_startbyte] |= 0xff << ((_start)&0x7); \
while (++_startbyte < _stopbyte) \
_name[_startbyte] = 0xff; \
_name[_stopbyte] |= 0xff >> (7 - (_stop&0x7)); \
} \
}
/* find first bit clear in name */
#define bit_ffc(name, nbits, value) { \
register bitstr_t *_name = name; \
register int _byte, _nbits = nbits; \
register int _stopbyte = _bit_byte(_nbits), _value = -1; \
for (_byte = 0; _byte <= _stopbyte; ++_byte) \
if (_name[_byte] != 0xff) { \
_value = _byte << 3; \
for (_stopbyte = _name[_byte]; (_stopbyte&0x1); \
++_value, _stopbyte >>= 1); \
break; \
} \
*(value) = _value; \
}
/* find first bit set in name */
#define bit_ffs(name, nbits, value) { \
register bitstr_t *_name = name; \
register int _byte, _nbits = nbits; \
register int _stopbyte = _bit_byte(_nbits), _value = -1; \
for (_byte = 0; _byte <= _stopbyte; ++_byte) \
if (_name[_byte]) { \
_value = _byte << 3; \
for (_stopbyte = _name[_byte]; !(_stopbyte&0x1); \
++_value, _stopbyte >>= 1); \
break; \
} \
*(value) = _value; \
}
```
|
Huya () was an Egyptian noble living around 1350 BC. He was the "Superintendent of the Royal Harem", "Superintendent of the Treasury" and "Superintendent of the House", all titles that are associated with Queen Tiye, mother of Akhenaten.
He had a tomb constructed in the Northern cemetery at Amarna, although his remains have never been identified. His tomb contained a large amount of material about the royal family and the Aten cult, including a Hymn to the Aten.
References
External links
Northern tomb no. 1 of Huya
Officials of the Eighteenth Dynasty of Egypt
14th-century BC Egyptian people
|
```python
#
#
# path_to_url
#
# Unless required by applicable law or agreed to in writing, software
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
import os
import xacro
import tempfile
def to_urdf(xacro_path, parameters=None):
"""Convert the given xacro file to URDF file.
* xacro_path -- the path to the xacro file
* parameters -- to be used when xacro file is parsed.
"""
with tempfile.NamedTemporaryFile(prefix="%s_" % os.path.basename(xacro_path), delete=False) as xacro_file:
urdf_path = xacro_file.name
# open and process file
doc = xacro.process_file(xacro_path, mappings=parameters)
# open the output file
with open(urdf_path, 'w') as urdf_file:
urdf_file.write(doc.toprettyxml(indent=' '))
return urdf_path
```
|
Hajjiabad (, also Romanized as Ḩājjīābād) is a village in Baz Kia Gurab Rural District, in the Central District of Lahijan County, Gilan Province, Iran. At the 2006 census, its population was 1,673, in 468 families.
References
Populated places in Lahijan County
|
This article deals with the system of transport in Belgrade, both public and private.
Urban
Belgrade has an extensive public transport system, which consists of buses, trams, trolley buses and trains operated by the city-owned GSP Belgrade and several private companies. All companies participate in Integrated Tariff System (ITS), which makes tickets transferable between companies and vehicle types. Tickets can be purchased in numerous kiosks or from the driver. They must be validated inside the vehicle and are valid for one ride only. On February 1, 2012, BusPlus, a modern electronic system for managing vehicles and transportation tickets in public transport was introduced, a system based on a vague contract which does not explicitly state the profit made by Apex Technology Solutions, and the giveaway of advertising space on bus stations.
Buses
The main Belgrade Bus Station is located at Železnička 4.
City public bus transportation is operated by 7 main carriers:
Gradsko saobraćajno preduzeće Beograd (GSP) – city-owned company
Saobraćajno preduzeće Lasta
Udruženje privatnih prevoznika (Association of private carriers)
Arriva LUV
Poslovno udruženje Beobus
Tamnava trans
Domiko
There are 149 regular lines and 25 night lines. Night lines are 15, 26, 27, 29, 31, 32, 33, 37, 47, 48, 51, 56, 68, 75, 101, 202, 301, 304, 308, 401, 511, 601, 603, 704, 706.
Presto: 15, 26, 101, 601Arriva (formerly Veolia): 47, 48, 51, 56, 68, 202, 706Ćurdić: 32, 33, 304, 603, 704Lasta: 31, 37, 308, 401, 511LUI Travel: 27, 29, 75, 301
Night lines that are abolished are: 7, 9, 11, 96, 701. Night lines that are introduced are: 33, 37, 48, 704 and 706. Night line 304 goes as trolleybus line 28 (Makedonska - Svetogorska - Takovska - Jaše Prodanovića - Cvijićeva - Dimitrija Tucovića) and her next route is: Batutova - Bulevar kralja Aleksandra - Smederevski put - Profesora Vasića - Palih boraca - Miloša Obrenovića - Vinča - Miloša Obrenovića - Palih boraca - Profesora Vasića - Smederevski put - Kružni put - Ravan - Leštane - Ravan - Kružni put - Smederevski put - Put za Boleč - Maršala Tita - Jumbina - Boleč - Jumbina - Maršala Tita - Put za Boleč - Smederevski put - Put za Ritopek - Maršala Tita - Ritopek. Night line 401 goes as tramway line 10 (Cara Dušana - Džordža Vašingtona - 27. marta - Starine Novaka - Beogradska - Trg Slavija - Bulevar oslobođenja - Trg oslobođenja - Vojvode Stepe - Bebelova - Baštovanska) and her next route is: Paunova - Bulevar oslobođenja - Put za Avalu - Vase Čarapića - Beli potok - Vase Čarapića - Put za Avalu - Put za Pinosavu - Pinosava.
Each of the regular lines is operated by GSP and by one of the other carriers, while night lines are conducted only by private carriers.
Private carriers were introduced in 1990s after many strikes in GSP, which had the monopoly till then. There were many unsuccessful efforts by the city after 2000 to unify them into the same ticket system. Finally, in 2004 it was agreed that ITS (integrated tariff system) will be introduced. These 6 companies will carry the public transportation till 2012, when the City Government will decide whether GSP is going to remain the only transport company.
City Bus Lines:
15 – Zeleni venаc – Zemun (Novi grаd)
16 – Kаrаburmа 2 – New Belgrade (Pohorskа street)
17 – Konjаrnik – Zemun (Gornji grаd)
18 – Medаković 3 – Zemun (Bаčkа street)
20 – Mirijevo 3 – Veliki Mokri Lug
23 – Kаrаburmа 2 – Vidikovаc
24 – Dorćol (SRC ″Milan Muškаtirović″) – Neimаr
25 – Kаrаburmа 2 – Kumodrаž 2
25P – Mirijevo 4 – MZ Kumodrаž
26 – Dorćol (Dunаvskа street) – Brаće Jerković
27 – Trg Republike – Mirijevo 3
27E – Trg Republike – Mirijevo 4
30 – Slаvijа (Birčаninovа street) – Medаković 2
31 – Studentski trg – Konjаrnik
32 – Vukov spomenik – Višnjicа
32E – Trg Republike – Višnjicа
33 – Pаnčevаčki most (Railway station) – Kumodrаž
34 – Železnička stanica ”Beograd Centar” – Ul. Pere Velimirovića
35 – Trg Republike – Lešće (Groblje)
35L – Omlаdinski stаdion – Lešće (Groblje) (line has shorter route of line 202 and night line 202)
36 – Železnička stanica ″Beograd centar″ – Trg Slavija – Main railway station – Železnička stanica ″Beograd centar″
37 – Pаnčevаčki most (Railway station) – Kneževаc
38 – Šumice – Pogon „Kosmаj“
39 – Slаvijа (Birčаninovа street) – Kumodrаž 1
42 – Slаvijа (Birčаninovа street) – Bаnjicа (VMA) – Petlovo brdo
43 – Trg Republike – Kotež
44 – Topčidersko brdo (Senjаk) – Viline vode – Dunаv Stаnicа
45 – Zemun (Novi grad) – Blok 44
46 – Main railway station – Mirijevo 2
47 – Slаvijа (Birčаninovа street) – Resnik (Railway station)
48 – Pаnčevаčki most (Railway station) – Miljаkovаc 3
49 – Banovo Brdo – Naselje Stepa Stepanović
50 – Ustаničkа – Bаnovo brdo
51 – Main railway station – Bele vode
52 – Zeleni venаc – Cerаk vinogrаdi
53 – Zeleni venаc – Vidikovаc
54 – Miljаkovаc 1 – Železnik – MZ Mаkiš
55 – Zvezdara (Pijaca) – Stаri Železnik
56 – Zeleni venаc – Petlovo brdo
56L – Zeleni venаc – Čukаričkа pаdinа (line has shorter route of line 56)
57 – Bаnovo brdo – Nаselje "Golf" – Bаnovo brdo
58 – Pаnčevаčki most (Railway station) – Novi Železnik
59 – Slаvijа (Birčаninovа street) – Petlovo brdo
60 – Zeleni venаc – Toplаnа (New Belgrade)
65 – Zvezdara 2 – Block 37 (New Belgrade)
67 – Zeleni venаc – Block 70A (New Belgrade)
68 – Zeleni venаc – Block 70 (New Belgrade)
70 – Bežanijska kosa – IKEA
71 – Zeleni venаc – Bežаnijа (Ledine)
72 – Zeleni venаc – Aerodrom „Nikolа Teslа“ – LINE TO THE AIRPORT
73 – Block 45 (New Belgrade) – Bаtаjnicа (Railway station)
74 – Omladinski stadion – Bežanijska kosa
75 – Zeleni venаc – Bežаnijskа kosа
76 – Block 70A (New Belgrade) – Bežаnijskа kosа
77 – Zvezdara – Bežаnijskа kosа
78 – Bаnjicа 2 – Zemun (Novi grаd)
79 – Dorćol (SRC „Milan Muškаtirović“) – Zvezdara (Pijaca)
81 – New Belgrade (Pohorskа street) – Ugrinovаčki put – Altinа
81L – New Belgrade (Pohorskа street) – Dobаnovаčki put – Altinа
82 – Zemun (Kej oslobođenja) – Bežаnijsko groblje – Blok 44
83 – Crveni Krst – Zemun (Bаčkа)
84 – Zeleni venаc – Novа Gаlenikа
85 – Banovo brdo — Borča 3
87 – Čukаričkа pаdinа – Bаnovo brdo (Zrmanjska) – Čukаričkа pаdinа
88 – Zemun (Kej oslobođenja) – Novi Železnik
89 – Vidikovаc – Čukаričkа pаdinа – Blok 61
91 – Main railway station – Ostružnicа (Novo nаselje)
92 – Main railway station – Ostružnicа (Kаrаulа)
94 – Block 45 (New Belgrade) – Miljаkovаc 1
95 – Block 45 (New Belgrade) – Borčа 3
96 – Trg Republike – Borčа 3
101 – Omlаdinski stаdion – Padinska Skelа
102 – Padinska skela – Vrbovsko
104 – Omlаdinski stаdion – Crvenkа
105 – Omlаdinski stаdion – Ovčа
106 – Omlаdinski stаdion – PKB Kovilovo – Jabučki rit
107 – Padinska skela – Omlаdinski stаdion – Dunavac
108 – Omlаdinski stаdion – Reva (Dubokа bara)
109 – Padinska skela – Čentа
110 – Padinska skela – Opovo
202 – Omlаdinski stаdion – Veliko Selo
302 – Ustаničkа – Grockа – Begаljicа
303 – Ustаničkа – Vrčin
304 – Ustаničkа – Ritopek
305 – Ustаničkа – Boleč
306 – Ustаničkа – Leštаne – Bubаnj Potok
307 – Ustаničkа – Vinčа
308 – Šumice – Veliki Mokri Lug
309 – Zvezdara (Pijаcа) – Kаluđericа
310 – Šumice - Mali Mokri Lug
401 – Voždovаc – Pinosаvа
402 – Voždovаc – Beli Potok
403 – Voždovаc – Zuce
404 – Ripanj (Groblje) – Trešnja (Okretnica)
405 – Voždovаc – Glumčevo brdo
405L – Glumčevo brdo - Nenadovac - Karaula - Glumčevo brdo
406 – Voždovаc – Beli Potok (Railway station)
406L – Voždovac – Zemljoradinička street – Beli Potok (Railway station)
407 – Voždovаc – Belа Rekа
408 – Voždovаc – Ralja (Drumine)
503 – Voždovаc – Resnik (Railway station)
504 – Miljаkovаc 3 – Resnik (Railway station)
511 – Main railway station – Sremčicа
512 – Bаnovo brdo – Sremčicа (Nаselje Goricа)
513 – Sremčicа (Nаselje Goricа) - Velika Moštanica (centar)
521 – Vidikovаc – Borа Kečić
522 – Novi Železnik - Milorada Ćirića - Novi Železnik
531 – Bаnovo brdo – Rušаnj
532 – Bаnovo brdo – Rušаnj (Ul. oslobođenjа)
533 – Bаnovo brdo – Orlovаčа (Groblje)
534 – Cerаk vinogrаdi – Ripаnj (Centаr)
551 – Main railway station – Velikа Moštаnicа
553 – Main railway station – Rucka
601 – Main railway station – Surčin
602 – Block 45 (New Belgrade) – SRC „Surčin“
603 – Bežаnijа (Ledine) – Ugrinovci
604 – Block 45 (New Belgrade) – Prekа kаldrmа
605 – Block 45 (New Belgrade) – Boljevci – Progаr
606 – Dobаnovci – Grmovаc
610 – Zemun (Kej oslobođenja) – Jаkovo
611 – Zemun (Kej oslobođenja) – Dobаnovci
612 – New Belgrade (Pohorskа street) – Kvаntаškа pijаcа – Novа Gаlenikа
613 – New Belgrade (Pohorskа street) – Radiofar
700 – Bаtаjnicа (Railway station) - Bаtаjnicа (Railway station)
702 – Bаtаjnicа (Railway station) – Busije
703 – Bаtаjnicа (Railway station) – Ugrinovci
704 – Zeleni venаc – Zemun polje
705 – Zemun (Kej oslobođenja) – „13. mаj“
706 – Zeleni venаc – Bаtаjnicа
706E – Zemun (Kej oslobođenja) – Bаtаjnicа
707 – Zeleni venаc – Altina – Zemun polje
708 – Block 70A (New Belgrade) – Zemun polje
709 – Zemun (Novi grаd) – Zemun polje
711 – New Belgrade (Pohorskа street) – Ugrinovci
Tramways and trolleys
The first tram line was introduced in 1892. The current extent of the network track has been unchanged since 1988, though with some re-routings of the tram lines. Trams and trolleys are operated exclusively by GSP Beograd, and there are 11 regular tram lines and 7 regular trolleybus lines.
Belgrade has 11 current trams (2, 3, 5, 6, 7, 9, 10, 11, 12, 13 and 14). Tram line 2 (dva) is a circular line around the downtown, so often downtown is referred to as krug dvojke (the circle of line 2).
Tram Lines:
2 – Pristаnište – Vukov spomenik – Pristаnište
3 – Kneževаc – Slavija – Omladinski stadion
5 – Kаlemegdаn (Donji grad) – Ustаničkа
6 – Tаšmаjdаn – Ustаničkа
7 – Ustаničkа – Block 45 (New Belgrade)
9 – Banjica – Block 45 (New Belgrade)
10 – Kalemegdan (Donji grad) – Banjica
11 – Kalemegdan (Donji grad) – Block 45 (New Belgrade)
12 – Bаnovo brdo – Omlаdinski stаdion
13 – Banovo brdo – Block 45 (New Belgrade)
14 – Ustanička – Banjica
Tram network and termini:
All the revenue service track is constructed as parallel double track with terminal loops.
There are 8 revenue service loops in the system: Kneževac, Omladinski stadion, Kalemegdan, Ustanička, Tašmajdan, Block 45, Banjica, Banovo brdo.
There are further 9 auxiliary loops: Pristanište, Slavija, Autokomanda, Trošarina, Radio industrija, Gospodarska mehana, Topčider, Railway station, Rakovica. Only the first three are actively used for cutting short during the schedule disruptions. The loops Slavija and Autokomanda are located in roundabouts and are normally used for the revenue thru-traffic. Other auxiliary loops are used only as alternatives during the closures. The last two loops (Rakovica and Railway Station) are defunct. The track at Rakovica is disconnected from the main line. The loop at Railway station was recently reconstructed but is completely out of use due to unworkable design. The circular line 2 does not use loops at its terminus at Pristanište. It makes the service stops on the main line instead.
Tram depots:
There are 3 tram depots in Belgrade. Sava is the central active service depot built in New Belgrade in 1988. Dorćol ("Lower depot") is the historical electrical cars depot from 1894 which is used only for auxiliary and overhaul purposes. It is co-located with the active service trolleybus depot. The two single-track lines leading to it are the only exceptions to otherwise parallel double track network in the system and are not used in the revenue service. The third "Upper depot" is the historical horse-drawn cars depot from 1892. It retains its track but was recently disconnected from the main line. The depot is completely void of trams and is now housing only the overhead wiring maintenance unit. The plans to adapt it into the public transportation museum have never materialised.
Trolley Lines:
The first trolleybus line was introduced in 1947 to replace trams on the central corridor Kalemegdan-Slavija. The network extent is unchanged since late 1980s, though with minor relocation of the central terminus from Kalemegdan to Studentski trg in late 1990s. Belgrade has 7 current trolleybuses (19, 21, 22, 28, 29, 40 and 41).
19 – Studentski trg – Konjаrnik
21 – Studentski trg – Učiteljsko nаselje
22 – Studentski trg – Kruševаčkа
28 – Studentski trg – Zvezdara
29 – Studentski trg – Medаković 3
40 – Zvezdara – Bаnjicа 2
41 – Studentski trg – Bаnjicа 2
Trolley network and termini:
There are 4 revenue service terminal loops in the system: Studentski trg, Konjarnik, Banjica 2, Medaković 3. The peripheral termini Učiteljsko naselje, Kruševačka and Zvezdara have no purpose-built loops: the trolleybuses are circling around the city block instead.
Additionally, there are 3 auxiliary loops in the system: Slavija, Crveni krst and Banjica 1. The auxiliary loops are actively used for cutting short during the schedule disruptions (the line number carries the suffix "L" on the departures to be cut short). Crveni krst and Banjica 1 can be used only in the direction towards the peripheral termini, Slavija can be used in both directions.
Minibuses
In April 2007, six minibus lines were introduced (E1-E7, except E3) which criss-cross Belgrade. Minibuses are all air-conditioned, smaller and generally quicker than buses. However, tickets are bought inside a minibus and they are more expensive than ordinary ones – since minibuses are out of integrated tariff system.
Minibus City Lines:
A1.Slavija – Aerodrom „Nikolа Teslа“ /Express/ – LINE TO THE AIRPORT
E1.Ustanička – Blok 45
E2.Dunav stanica – Petlovo Brdo
E5.Zvezdara (Pijaca) – Novi Beograd (Blok 70) (line has almost same route as 50)
E6.Novi Beograd (Blok 45) – Mirijevo 4
E9.Dorćol (SRC "Milan Gale Muškatirović") – Kumodraž
Night Lines:
15 – Trg Republike – Zemun (Novi grad)
26 – Dorćol (Dunavska street) – Braće Jerković
27 – Trg Republike – Mirijevo 3
29 – Studentski trg – Medaković 3
31 – Studentski trg – Konjarnik
32 – Trg Republike – Višnjica
33 – Trg Republike – Kumodraž
37 – Trg Republike – Kneževac (line has shorter route of line 37)
47 – Trg Republike – Resnik (Railway station)
48 – Trg Republike – Miljakovac 2
51 – Trg Republike – Bele Vode
56 – Trg Republike – Petlovo brdo – Rušanj
68 – Trg Republike – Block 45 (New Belgrade)
75 – Trg Republike – Bežanijska kosa
101 – Trg Republike – Padinska skela
202 – Trg Republike – Veliko selo
301 – Trg Republike – Begaljica
304 – Trg Republike – Ritopek
308 – Trg Slavija – Veliki Mokri Lug
401 – Dorćol /garage/ – Pinosava
511 – Trg Republike – Sremčica
601 – Main railway station – Dobanovci
603 – Trg Republike – Ugrinovci
704 – Trg Republike – Nova Galenika – Zemun polje
706 – Trg Republike – Batajnica
Lines that are ceased to exist:
7 – Ustanička – Slavija – Block 45 (New Belgrade) (night line)
7L – Tašmajdan – Block 45 (New Belgrade)
9 – Banjica 2 – Block 45 (New Belgrade) (night line)
11 – Tašmajdan – Kalemegdan – Block 45 (New Belgrade) (night line)
13 – Kalemegdan (Donji grad) – Banovo brdo
22L – Studentski trg – Trg Slavija
27L – Vukov spomenik – Mirijevo
34 – Admirala Geprata – Železnička stanica ″Beograd centar″
34L – Železnička stanica ″Beograd centar" – Bolnica ″Dragiša Mišović″
36 – Trg Republike – Viline vode – Dunav Stanica
69 – GO Novi Beograd – Depo Sava
93 – Pančevački most /Railway station/ – Zvezdara (Pijaca)
96 – Trg Republike – Kotež – Borča 3 (night line)
110 – Padinska skela – Široka greda
302L – Ustanička – Restoran ″Boleč″
306L – Ustanička – Leštane
404 – Voždovac – Ripanj (Brđani)
406 – Voždovac – Stara Lipovica
552 – Main railway station – Umka
600 – Bežanija (Ledine) – Dobanovci
602 – Surčin – Jakovo
606 – Surčin – Dobanovci
701 – Trg Republike – Nova Galenika – Zemun polje – Nova Pazova (night line)
E3 – Cerak vinogradi – Block 45 (New Belgrade)
E4 – Bežanijska kosa – Mirijevo 3
E7 – Pančevački most /Railway station/ – Petlovo brdo
E8 – Dorćol (SRC ″Milan Gale Muškatirović″) – Braće Jerković
Rapid transit
Belgrade is one of the few European capitals and cities with a population of over a million which have no metro/subway or another rapid transit system.
Metro
The idea of a metro system for Belgrade has been around for nearly a century. The Belgrade Metro started construction in November 2021 and the first line is scheduled to open in the year 2028. It is considered to be the third most important project in the country, after work on roads and railways. The two projects of highest priority are the Belgrade bypass and Pan-European corridor X.
Inter-Cityrail
On September 1, 2010, as an "almost" metro line and the actual metro's 1st phase, the first line of Belgrade's new urban BG:Voz system, separate from suburban commuter Beovoz system, started its operation. The first line at the time connected Pančevački Most Station with Novi Beograd Railway Station and used the semi-underground level of Beograd Centar rail station, two underground stations (Vukov Spomenik and Karađorđev park) and tunnels in the city centre that were built for ground rail tracks to Novi Beograd. The line had just 5 stations (Pančevački most, Vukov spomenik, Karađorđev park, Beograd Centar and Novi Beograd, which it shared with Beovoz), was 8 kilometer long and the commute took about 16 minutes. Train frequency was from 30 minutes with 15 minutes frequency during rush hour. The line uses the stock similar to suburban Soviet/Latvian electric rolling stocks with upper current collectors including ER31 with 3 doors along the side of car. In April 2011, the line was extended to Batajnica, and in December 2016 to Ovča. The new line has a daily riding of about 18500. A new line from Ovča to Resnik is planned to open in 2018.
Suburban
Buses
Suburban bus transportation is conducted by SP Lasta. Beside Lasta, certain number of suburban lines are operated by other carriers, too.
Suburban transport on the territory of Belgrade is performed within the integrated tariff system 2 (ITS2), with over 300 lines and 2,500 daily departures. The network of suburban lines spreads radially from Belgrade to the centers of the suburban municipalities, from which Lasta's local lines can be used to reach smaller places. Suburban buses depart from the Lasta Bus Station in Belgrade and from the terminus of Šumice near Konjarnik in the neighbourhood of Zvezdara and another in Banovo Brdo. Lasta transports passengers in the local transport in the areas of the Mladenovac, Sopot, Lazarevac, Obrenovac, Grocka, and Barajevo municipalities.
Bus Lines:
351 Šumice - Grocka - Dražanj
352 Šumice - Autoputem - Dražanj
353 Dražanj - Živkovac - Šumice (autoputem)
354 Šumice - Vrčin - Zaklopača - Grocka - Kamendol
354A Živkovac - Grocka - Zaklopača - Vrčin - Šumice
354B Šumice - Vrčin - Zaklopača - Grocka
355 Dražanj - Kamendol - Grocka - Šumice
355A Šumice - Živkovac - Dražanj
355L Grocka - Kamendol - Umčari
356 Šumice - Grocka - Brestovik - Pudarci
361 Šumice - Grocka - Živkovac
361L Dražanj - Grocka
361B Šumice - Grocka - Živkovac - Dražanj
362 Živkovac - Šumice (autoputem)
363 Živkovac - Grocka - Šumice
363A Šumice - Grocka - Živkovac
363L Grocka - Kamendol - Živkovac
366 Kamendol - Šumice (autoputem)
366A Kamendol - Ilinski kraj - Šumice (autoputem)
450 Beograd - Ralja - Sopot
451 Beograd - Ralja - Staro selo - Stojnik
451A Beograd - Ralja - Stojnik
460 Beograd - Autoputem - Mala Ivanča
460A Beograd - Autoputem - Drumine - Mala Ivanča
461 Šumice - Vrčin - Ramnice
462 Šumice - Vrčin - Jaričište
463 Šumice - Vrčin - Jaričište - Ramnice
464 Beograd - Autoputem - Mali Požarevac - Drumine - Sopot
465 Beograd - Autoputem - Stanojevac - Sopot (polazak u 23:30 saobraća preko Slavije i nosi oznaku 4652)
466 Beograd - Jaričište - Vrčin
466A Beograd - Jaričište - Vrčin
468 Beograd - Jaričište - Vrčin - Grocka
470 Beograd - Ralja - Mala Ivanča
470A Beograd - Ralja - Parcani - Mala Ivanča
474 Beograd - Ralja - Parcani
491 Beograd - Ralja - Mladenovac
491A Beograd - Slavija - Ralja - Sopot - Mladenovac
493 Beograd - Autoputem - Mladenovac
493A Beograd - Slavija - Autoputem - Mladenovac
494A Beograd - Autoputem - Senaja - Mladenovac
499 Beograd - Autoputem - Senaja - Šepšin - Dubona - Mladenovac
560 Banovo brdo - Barajevo
560A Banovo brdo - Sremčica - Barajevo
560E Banovo brdo - Barajevo
561 Banovo brdo - Meljak - Baćevac - Guncati - Barajevo
561A Banovo brdo - Guncati - Baćevac - Barajevo
581 Beograd - Stepojevac - Vreoci - Lazarevac
581A Beograd - Stepojevac - Vreoci - Lazarevac (Bolnica)
581E Beograd - Stepojevac - Vreoci - Lazarevac
583 Beograd - Stepojevac - Vreoci - Rudovci - Kruševica - Trbušnica
583A Beograd - Stepojevac - Vreoci - Rudovci - Kruševica
585 Beograd - Stepojevac - Mirosaljci (Gunjevac)
586 Banovo brdo - Stepojevac - Veliki Crljeni
588 Beograd - Leskovac - Stepojevac - Mirosaljci (Gunjevac)
591 Banovo brdo - Vranić - Taraiš
591A Banovo brdo - Vranić - Rašića kraj
592 Banovo brdo - Vranić - Rašića kraj - Draževac
593 Banovo brdo - Meljak - Šiljakovac - Vranić - Taraiš
593A Banovo brdo - Meljak - Šiljakovac - Vranić - Rašića kraj
593B Banovo brdo - Meljak - Šiljakovac
860 Beograd - Obrenovac
860E Beograd - Obrenovac
861A Beograd - Mala Moštanica - Obrenovac
865 Banovo brdo - Sremčica - Velika Moštanica
904 Surčin - Obrenovac
Railway (now disfunct)
Similar to French RER, suburban rail system Beovoz was operated by Serbian Railways, the national railway company. In its final stage, Beovoz had six lines with 41 stations and 70 km length:
Line 1 Nova Pazova – Pančevo Vojlovica
Line 2 Ripanj – Pančevo Vojlovica
Line 3 Nova Pazova – Novi Beograd
Line 4 Pančevo Vojlovica – Valjevo
Line 5 Pančevo Glavna – Valjevo
This system became defunct in 2013.
The most of system's stations are now used for the BG voz system.
Taxi
Taxi service is operated by 24 taxi companies, and it's not very expensive (start is about 1.5 euros (150 Dinars).
Every Belgrade taxi company has to have 2 signs: a company unique sign and a smaller blue sign with 4 white numbers – a unique number of each vehicle of Belgrade taxi.
Bus
Belgrade is connected by intercity bus lines with all major towns in Serbia, while during summer and winter tourist seasons there are also special seasonal lines.
There is a good connection with the cities in Republika Srpska and North Macedonia. The international bus lines to Western Europe are mainly focused on Germany, Austria, Switzerland and France, where buses can be taken for all other destinations.
SP Lasta, besides suburban transport, carries passengers in intercity transport on regular lines in Serbia and Montenegro and Republika Srpska and in international transport, as part of the Eurolines organization.
Train
The Belgrade railroad network is currently under reconstruction . The massive reconstruction scheme of the Belgrade railway junction calls for completion of the new central Prokop railway station that is to replace the historical Belgrade Main railway station (, Glavna železnička stanica) situated near the downtown and Sava river. Belgrade is directly connected by train with many European cities (Thessaloniki, Istanbul, Sofia, Bucharest, Budapest, Vienna, Kiev, Moscow, etc).
In addition, there are 5 more railway stations in Belgrade (Centar – Prokop, Dunav, Rakovica, Novi Beograd, Zemun). Some long distance and international trains do not call at Central Station, but at Novi Beograd.
A new central railway station has been under construction since 1977 at the site named Prokop. The new railway station will be called "Beograd Center"; upon its completion all Belgrade rail traffic currently handled by the old railway station situated near the downtown district will be transferred to the new station freeing thousands of square meters of prime real estate along the Sava and substantially easing the rail travel into Belgrade. After years of delay, this ambitious project is set to be completed in the next few years pending the new international tender for its completion set to be announced by the government at the beginning of March 2006. The train terminals will be situated underground while the vast passenger terminal will be above ground featuring commercial spaces, possibly a hotel and other amenities. Most of the rough work on the station's train terminals has been completed thus far. Belgrade has been restricted in its use of its vast waterfront precisely because of the large rail infrastructure that hug the river banks of the Old Town. Completion of this station is signaling a major boom in Belgrade's waterfront development.
Air
The international airport, Belgrade Nikola Tesla Airport, is located 12 km outside the city. It is connected with the city by the Belgrade – Zagreb highway. Bus line of public transport number 72 and A1 connect Airport with downtown. Airport provides connections with many cities in Europe, Asia and Africa.
A major expansion of the airport in Belgrade has been detailed with a development deal signed with DynaCorp. Inc. to build a regional air cargo hub, but the plan has failed. Belgrade airport also plans to build a third passenger terminal and another runway; however this may not be feasible in the immediate future.
Batajnica Air Base is a military airport located in the Batajnica suburb of Belgrade.
River
Belgrade has a commercial port on the banks of Danube named Luka Beograd. There is also a tourist port on the banks of the Sava welcoming various river cruise vessels from across Europe. Belgrade has several impromptu sporting marinas near the islands of Ada Ciganlija and Ada Međica harbouring small sail boats and sporting/recreational vessels. There are no regular passenger lines from the Belgrade Port (Luka Beograd), although tourist and individual lines run occasionally. Answering to the need for a real sporting/recreational marina a detailed plan for a marina in Dorćol on the banks of the Danube has been presented to the public, and an international tender for its development has been announced.
Bridges
There are nine bridges over the Sava and two over the Danube river, listed below:
Sava
Obrenovac-Surčin Bridge (Most Obrenovac-Surčin), the two-lane road truss bridge over the Sava at Obrenovac — 30 km southwest of Belgrade, constructed by Mostogradnja between 1994 and 1999. The total length of the bridge is 446.5 m, with the longest span of 141 m. The bridge was originally designed to carry only two heating water pipelines, but was later redesigned and built as a road bridge with the two pipelines on side cantilevers. Finished in 2011.
Obrenovac-Surčin Bridge (A2 motorway) Six lanes expressway bridge under construction. Opening is late 2019.
The single-track railway truss bridge over Sava at Ostružnica — just outside the urbanized area of Belgrade, serving the freight bypass line. The bridge was badly damaged during the 1999 NATO bombing. Fully reconstructed in 2002.
Ostružnica Bridge (Ostružnički most) is the three-lane semi-highway girder bridge over Sava at Ostružnica on the Belgrade bypass motorway — constructed by Mostogradnja between 1990 and 1998. Total length of the bridge is 1,789.6 m, with a 588 m long continuous steel structure crossing the river in five spans. The largest span is 198 m. The bridge was bombed by NATO during the Kosovo war in 1999 and fully reconstructed by 2004. The additional three-lane span is currently under construction and it will be opened in March 2020.
Ada Bridge (Most na Adi) a 969 m long and 200 m tall pylon bridge with six-lane roadway and unlaid double-track mass transit right-of-way is opened in 2012.
New Railroad Bridge (Novi železnički most) over the Sava — a double-track cable-stayed bridge built in 1979.
Old Railroad Bridge (Stari železnički most) over the Sava — a single-track truss-bridge originally built in 1886.
Gazela Bridge (Gazela) — a single-span six-lane motorway bridge over the Sava, the main traffic artery into the city, built in 1970.
Old Sava Bridge (Stari savski most) — a 410 m long two-lane road and tram bridge. The main span is a tied arch bridge over 100 m in length. During World War II it was the only road bridge available in Belgrade, the current span being installed in 1942, and one of the few bridges in Europe which the retreating German forces failed to demolish. In October 1944, the bridge, already laden with explosives and prepared for demolition, was saved by a local resistance veteran Miladin Zarić who managed to cut the detonator wires. Adding new lanes and full reconstruction is scheduled for 2017. Total investment is 60 million Euros.
Branko's Bridge (Brankov most) — a 450 m long six-lane road girder bridge over Sava, connecting the center of Belgrade to the densely populated residential suburb of Novi Beograd. Originally built as Most kralja Aleksandra (Bridge of King Alexander) in 1934 it was a chain-bridge. The bridge was destroyed in 1941 and rebuilt in 1956 as a single-span bridgeč at the time it was the longest bridge of that kind in the world.
Danube
Pupin Bridge (Pupinov most) is the newest six-lane road bridge over the Danube. Named after scientist Mihajlo Pupin, it was constructed by the China Road and Bridge Corporation and opened in December 2014.
Pančevo Bridge (Pančevački most) — a 1,075 m long combined four-lane road and double-track railroad truss bridge over the Danube, originally built in 1935. It was destroyed during World War II, and rebuilt after the end of the war in 1946. The overhaul and installation of the second rail track was completed in 2015.
Roads
Belgrade is connected by motorways to Zagreb to the west, Novi Sad to the north and Niš to the south. The motorways feed traffic into a large interchange popularly called Mostar. A wide boulevard, Kneza Miloša street, connects the interchange to the city centre.
A traffic decongestion project named unutrašnji magistralni prsten ("inner ring road") is set to begin with the goal of easing the congestion in the city centre and on the motorways.
References
External links
BelgradeMaps.com – Belgrade public transport maps
|
```c
/*
*
* This program is free software; you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <pjlib.h>
#include <pjlib-util.h>
#define kMinInputLength 10
#define kMaxInputLength 5120
pj_pool_factory *mem;
int XML_parse(uint8_t *data, size_t Size) {
pj_pool_t *pool;
pj_xml_node *root;
char *output;
size_t output_size;
pool = pj_pool_create(mem, "xml", 4096, 1024, NULL);
root = pj_xml_parse(pool, (char *)data, Size);
if (!root) {
goto on_error;
}
output = (char*)pj_pool_zalloc(pool, Size + 512);
output_size = pj_xml_print(root, output, Size + 512, PJ_TRUE);
if (output_size < 1) {
goto on_error;
}
pj_pool_release(pool);
return 0;
on_error:
pj_pool_release(pool);
return 1;
}
extern int
LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
{
if (Size < kMinInputLength || Size > kMaxInputLength) {
return 1;
}
int ret = 0;
uint8_t *data;
pj_caching_pool caching_pool;
/* Add NULL byte */
data = (uint8_t *)calloc((Size+1), sizeof(uint8_t));
memcpy((void *)data, (void *)Data, Size);
/* init Calls */
pj_init();
pj_caching_pool_init( &caching_pool, &pj_pool_factory_default_policy, 0);
pj_log_set_level(0);
mem = &caching_pool.factory;
/*Calls fuzzer*/
ret = XML_parse(data, Size);
free(data);
pj_caching_pool_destroy(&caching_pool);
return ret;
}
```
|
```smalltalk
using System;
using System.Threading;
using System.Threading.Tasks;
using GameServerCore.Content;
using GameServerCore.Enums;
using LeagueSandbox.GameServer.Players;
using LeagueSandbox.GameServer.GameObjects.AttackableUnits.AI;
namespace LeagueSandbox.GameServer.Chatbox.Commands
{
public class RainbowCommand : ChatCommandBase
{
private readonly PlayerManager _playerManager;
private Champion _me;
private bool _run;
private float _a = 0.5f;
private float _speed = 0.25f;
private int _delay = 250;
public override string Command => "rainbow";
public override string Syntax => $"{Command} alpha speed";
public RainbowCommand(ChatCommandManager chatCommandManager, Game game)
: base(chatCommandManager, game)
{
_playerManager = game.PlayerManager;
}
public override void Execute(int userId, bool hasReceivedArguments, string arguments = "")
{
var split = arguments.ToLower().Split(' ');
_me = _playerManager.GetPeerInfo(userId).Champion;
if (split.Length > 1)
{
float.TryParse(split[1], out _a);
}
if (split.Length > 2)
{
float.TryParse(split[2], out _speed);
_delay = (int)(_speed * 1000);
}
_run = !_run;
if (_run)
{
Task.Run(() => TaskRainbow());
}
}
public void TaskRainbow()
{
while (_run)
{
var rainbow = new byte[4];
new Random().NextBytes(rainbow);
Thread.Sleep(_delay);
BroadcastTint(_me.Team, false, 0.0f, 0, 0, 0, 1f);
BroadcastTint(_me.Team, true, _speed, rainbow[1], rainbow[2], rainbow[3], _a);
}
Thread.Sleep(_delay);
BroadcastTint(_me.Team, false, 0.0f, 0, 0, 0, 1f);
}
public void BroadcastTint(TeamId team, bool enable, float speed, byte r, byte g, byte b, float a)
{
Color color = new Color();
color.R = r;
color.G = g;
color.B = b;
color.A = (byte) (uint)(a*255.0f);
Game.PacketNotifier.NotifyTint(team, enable, speed, color);
}
}
}
```
|
In computing, a polyglot is a computer program or script (or other file) written in a valid form of multiple programming languages or file formats. The name was coined by analogy to multilingualism. A polyglot file is composed by combining syntax from two or more different formats. When the file formats are to be compiled or interpreted as source code, the file can be said to be a polyglot program, though file formats and source code syntax are both fundamentally streams of bytes, and exploiting this commonality is key to the development of polyglots. Polyglot files have practical applications in compatibility, but can also present a security risk when used to bypass validation or to exploit a vulnerability.
History
Polyglot programs have been crafted as challenges and curios in hacker culture since at least the early 1990s. A notable early example, named simply polyglot was published on the Usenet group rec.puzzles in 1991, supporting 8 languages, though this was inspired by even earlier programs. In 2000, a polyglot program was named a winner in the International Obfuscated C Code Contest.
In the 21st century, polyglot programs and files gained attention as a covert channel mechanism for propagation of malware.
Construction
A polyglot is composed by combining syntax from two or more different formats, leveraging various syntactic constructs that are either common between the formats, or constructs that are language specific but carrying different meaning in each language. A file is a valid polyglot if it can be successfully interpreted by multiple interpreting programs. For example, a PDF-Zip polyglot might be opened as both a valid PDF document and decompressed as a valid zip archive. To maintain validity across interpreting programs, one must ensure that constructs specific to one interpreter are not interpreted by another, and vice versa.
This is often accomplished by hiding language-specific constructs in segments interpreted as comments or plain text of the other format.
Examples
C, PHP, and Bash
Two commonly used techniques for constructing a polyglot program are to make use of languages that use different characters for comments, and to redefine various tokens as others in different languages. These are demonstrated in this public domain polyglot written in ANSI C, PHP and bash:
Highlit for Bash
#define a /*
#<?php
echo "\010Hello, world!\n";// 2> /dev/null > /dev/null \ ;
// 2> /dev/null; x=a;
$x=5; // 2> /dev/null \ ;
if (($x))
// 2> /dev/null; then
return 0;
// 2> /dev/null; fi
#define e ?>
#define b */
#include <stdio.h>
#define main() int main(void)
#define printf printf(
#define true )
#define function
function main()
{
printf "Hello, world!\n"true/* 2> /dev/null | grep -v true*/;
return 0;
}
#define c /*
main
#*/
Highlit for PHP
#define a /*
#<?php
echo "\010Hello, world!\n";// 2> /dev/null > /dev/null \ ;
// 2> /dev/null; x=a;
$x=5; // 2> /dev/null \ ;
if (($x))
// 2> /dev/null; then
return 0;
// 2> /dev/null; fi
#define e ?>
#define b */
#include <stdio.h>
#define main() int main(void)
#define printf printf(
#define true )
#define function
function main()
{
printf "Hello, world!\n"true/* 2> /dev/null | grep -v true*/;
return 0;
}
#define c /*
main
#*/
Highlit for C
#define a /*
#<?php
echo "\010Hello, world!\n";// 2> /dev/null > /dev/null \ ;
// 2> /dev/null; x=a;
$x=5; // 2> /dev/null \ ;
if (($x))
// 2> /dev/null; then
return 0;
// 2> /dev/null; fi
#define e ?>
#define b */
#include <stdio.h>
#define main() int main(void)
#define printf printf(
#define true )
#define function
function main()
{
printf "Hello, world!\n"true/* 2> /dev/null | grep -v true*/;
return 0;
}
#define c /*
main
#*/
Note the following:
A hash sign marks a preprocessor statement in C, but is a comment in both bash and PHP.
"//" is a comment in both PHP and C and the root directory in bash.
Shell redirection is used to eliminate undesirable outputs.
Even on commented out lines, the "<?php" and "?>" PHP indicators still have effect.
The statement "function main()" is valid in both PHP and bash; C #defines are used to convert it into "int main(void)" at compile time.
Comment indicators can be combined to perform various operations.
"if (($x))" is a valid statement in both bash and PHP.
printf is a bash shell builtin which is identical to the C printf except for its omission of brackets (which the C preprocessor adds if this is compiled with a C compiler).
The final three lines are only used by bash, to call the main function. In PHP the main function is defined but not called and in C there is no need to explicitly call the main function.
SNOBOL4, Win32Forth, PureBasicv4.x, and REBOL
The following is written simultaneously in SNOBOL4, Win32Forth, PureBasicv4.x, and REBOL:
Highlit for SNOBOL
*BUFFER : A.A ; .( Hello, world !) @ To Including?
Macro SkipThis; OUTPUT = Char(10) "Hello, World !"
;OneKeyInput Input('Char', 1, '[-f2-q1]') ; Char
End; SNOBOL4 + PureBASIC + Win32Forth + REBOL = <3
EndMacro: OpenConsole() : PrintN("Hello, world !")
Repeat : Until Inkey() : Macro SomeDummyMacroHere
REBOL [ Title: "'Hello, World !' in 4 languages"
CopyLeft: "Developed in 2010 by Society" ] Print
"Hello, world !" EndMacro: func [][] set-modes
system/ports/input [binary: true] Input set-modes
system/ports/input [binary: false] NOP:: EndMacro
; Wishing to refine it with new language ? Go on !
Highlit for Forth
*BUFFER : A.A ; .( Hello, world !) @ To Including?
Macro SkipThis; OUTPUT = Char(10) "Hello, World !"
;OneKeyInput Input('Char', 1, '[-f2-q1]') ; Char
End; SNOBOL4 + PureBASIC + Win32Forth + REBOL = <3
EndMacro: OpenConsole() : PrintN("Hello, world !")
Repeat : Until Inkey() : Macro SomeDummyMacroHere
REBOL [ Title: "'Hello, World !' in 4 languages"
CopyLeft: "Developed in 2010 by Society" ] Print
"Hello, world !" EndMacro: func [][] set-modes
system/ports/input [binary: true] Input set-modes
system/ports/input [binary: false] NOP:: EndMacro
; Wishing to refine it with new language ? Go on !
Highlit for BASIC
*BUFFER : A.A ; .( Hello, world !) @ To Including?
Macro SkipThis; OUTPUT = Char(10) "Hello, World !"
;OneKeyInput Input('Char', 1, '[-f2-q1]') ; Char
End; SNOBOL4 + PureBASIC + Win32Forth + REBOL = <3
EndMacro: OpenConsole() : PrintN("Hello, world !")
Repeat : Until Inkey() : Macro SomeDummyMacroHere
REBOL [ Title: "'Hello, World !' in 4 languages"
CopyLeft: "Developed in 2010 by Society" ] Print
"Hello, world !" EndMacro: func [][] set-modes
system/ports/input [binary: true] Input set-modes
system/ports/input [binary: false] NOP:: EndMacro
; Wishing to refine it with new language ? Go on !
Highlit for REBOL
*BUFFER : A.A ; .( Hello, world !) @ To Including?
Macro SkipThis; OUTPUT = Char(10) "Hello, World !"
;OneKeyInput Input('Char', 1, '[-f2-q1]') ; Char
End; SNOBOL4 + PureBASIC + Win32Forth + REBOL = <3
EndMacro: OpenConsole() : PrintN("Hello, world !")
Repeat : Until Inkey() : Macro SomeDummyMacroHere
REBOL [ Title: "'Hello, World !' in 4 languages"
CopyLeft: "Developed in 2010 by Society" ] Print
"Hello, world !" EndMacro: func [][] set-modes
system/ports/input [binary: true] Input set-modes
system/ports/input [binary: false] NOP:: EndMacro
; Wishing to refine it with new language ? Go on !
DOS batch file and Perl
The following file runs as a DOS batch file, then re-runs itself in Perl:
Highlit for DOS batch
@rem = ' --PERL--
@echo off
perl "%~dpnx0" %*
goto endofperl
@rem ';
#!perl
print "Hello, world!\n";
:endofperl
Highlit for Perl
@rem = ' --PERL--
@echo off
perl "%~dpnx0" %*
goto endofperl
@rem ';
#!perl
print "Hello, world!\n";
:endofperl
This allows creating Perl scripts that can be run on DOS systems with minimal effort. Note that there is no requirement for a file to perform exactly the same function in the different interpreters.
Types
Polyglot types include:
stacks, where multiple files are concatenated with each other
parasites where a secondary file format is hidden within comment fields in a primary file format
zippers where two files are mutually arranged within each others' comments
cavities, where a secondary file format is hidden within null-padded areas of the primary file.
Benefits
Polyglot markup
Polyglot markup has been proposed as a useful combination of the benefits of HTML5 and XHTML. Such documents can be parsed as either HTML (which is SGML-compatible) or XML, and will produce the same DOM structure either way. For example, in order for an HTML5 document to meet these criteria, the two requirements are that it must have an HTML5 doctype, and be written in well-formed XHTML. The same document can then be served as either HTML or XHTML, depending on browser support and MIME type.
As expressed by the html-polyglot recommendation, to write a polyglot HTML5 document, the following key points should be observed:
Processing instructions and the XML declaration are both forbidden in polyglot markup
Specifying a document’s character encoding
The DOCTYPE
Namespaces
Element syntax (i.e. End tags are not optional. Use self-closing tags for void elements.)
Element content
Text (i.e. pre and textarea should not start with newline character)
Attributes (i.e. Values must be quoted)
Named entity references (i.e. Only amp, lt, gt, apos, quot)
Comments (i.e. Use <!-- syntax -->)
Scripting and styling polyglot markup
The most basic possible polyglot markup document would therefore look like this:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<title>The title element must not be empty.</title>
</head>
<body>
</body>
</html>
In a polyglot markup document non-void elements (such as script, p, div) cannot be self-closing even if they are empty, as this is not valid HTML. For example, to add an empty textarea to a page, one cannot use <textarea/>, but has to use <textarea></textarea> instead.
Composing formats
The DICOM medical imaging format was designed to allow polyglotting with TIFF files, allowing efficient storage of the same image data in a file that can be interpreted by either DICOM or TIFF viewers.
Compatibility
The Python 2 and Python 3 programming languages were not designed to be compatible with each other, but there is sufficient commonality of syntax that a polyglot Python program can be written than runs in both versions.
Security implications
A polyglot of two formats may steganographically compose a malicious payload within an ostensibly benign and widely accepted wrapper
format, such as a JPEG file that allows arbitrary data in its comment field. A vulnerable JPEG renderer could then be coerced into executing the payload, handing control to the attacker. The mismatch between what the interpreting program expects, and what the file actually contains, is the root cause of the vulnerability.
SQL Injection is a trivial form of polyglot, where a server naively expects user-controlled input to conform to a certain constraint, but the user supplies syntax which is interpreted as SQL code.
Note that in a security context, there is no requirement for a polyglot file to be strictly valid in multiple formats; it is sufficient for the file to trigger unintended behaviour when being interpreted by its primary interpreter.
Highly flexible or extensible file formats have greater scope for polyglotting, and therefore more tightly constrained interpretation offers some mitigation against attacks using polyglot techniques. For example, the PDF file format requires that the magic number %PDF appears at byte offset zero, but many PDF interpreters waive this constraint and accept the file as valid PDF as long as the string appears within the first 1024 bytes. This creates a window of opportunity for polyglot PDF files to smuggle non-PDF content in the header of the file. The PDF format has been described as "diverse and vague", and due to significantly varying behaviour between different PDF parsing engines, it is possible to create a PDF-PDF polyglot that renders as two entirely different documents in two different PDF readers.
Detecting malware concealed within polyglot files requires more sophisticated analysis than relying on file-type identification utilities such as file. In 2019, an evaluation of commercial anti-malware software determined that several such packages were unable to detect any of the polyglot malware under test.
In 2019, the DICOM medical imaging file format was found to be vulnerable to malware injection using a PE-DICOM polyglot technique. The polyglot nature of the attack, combined with regulatory considerations, led to disinfection complications: because "the malware is essentially fused to legitimate imaging files", "incident response teams and A/V software cannot delete the malware file as it contains protected patient health information".
GIFAR attack
A Graphics Interchange Format Java Archives (GIFAR) is a polyglot file that is simultaneously in the GIF and JAR file format. This technique can be used to exploit security vulnerabilities, for example through uploading a GIFAR to a website that allows image uploading (as it is a valid GIF file), and then causing the Java portion of the GIFAR to be executed as though it were part of the website's intended code, being delivered to the browser from the same origin. Java was patched in JRE 6 Update 11, with a CVE published in December 2008.
GIFARs are possible because GIF images store their header in the beginning of the file, and JAR files (as with any ZIP archive-based format) store their data at the end.
Related terminology
Polyglot programming, referring to the practise of building systems using multiple programming languages, but not necessarily in the same file.
Polyglot persistence is similar, but about databases.
See also
Quine (computing)
References
External links
CSE HTML Validator for Windows with polyglot markup support
Benefits of polyglot XHTML5
A polyglot in 434 different languages
A polyglot in 16 different languages
A polyglot in 8 different languages (written in COBOL, Pascal, Fortran, C, PostScript, Unix shell, Intel x86 machine language and Perl 5)
A polyglot in 7 different languages (written in C, Pascal, PostScript, TeX, Bash, Perl and Befunge98)
A polyglot in 6 different languages (written in Perl, C, Unix shell, Brainfuck, Whitespace and Befunge)
List of generic polyglots
A PDF-MP3 polyglot, being a PDF document which is also an MP3 audio version of its content
PoC||GTFO, a security publication published as polyglot PDF documents
Computer programming
Source code
Steganography
Computer file formats
|
Sir Archibald Auldjo Jamieson KBE MC (1884 – 23 October 1959) was a British soldier and businessman, chairman of the British arms and aircraft company Vickers during World War II.
Family
His father George was a senior partner in the Edinburgh accountancy firm Lindsay, Jamieson, and Haldane, and a councillor in Edinburgh; his mother was George Jamieson's second wife, Susan Helena (née Oliphant). He was educated at Winchester College and New College, Oxford. He trained as an accountant. He served during the First World War, being mentioned in despatches and awarded the Military Cross.
In 1917 he married Doris Pearce, daughter of Henry Pearce, RN; the couple had two sons and two daughters; their eldest son was David Auldjo Jamieson who was awarded the VC in 1944 during the Second World War. Their other son Gerald James "Jerrie" (died 1992) was married to Lady Mariegold Fitzalan-Howard, daughter of the 3rd Baron Howard of Glossop. Jamieson himself was knighted (KBE) in 1946. Lady Doris died in 1947. In 1956, he remarried, to Margretta Stroup Austin. He died three years later, in 1959.
Career
Jamieson became a director of armaments company Vickers in 1928 and chairman in 1937; in the late 1930s he helped integrate the main firm more closely with its subsidiaries, increasing production in the run-up to World War II.
Notes
References
JAMIESON, Sir Archibald Auldjo, Who Was Who, A & C Black, an imprint of Bloomsbury Publishing plc., 1920–2008; online edition, Oxford University Press, December 2012; online edition, November 2012 accessed 30 December 2012
People educated at Winchester College
Alumni of New College, Oxford
Knights Commander of the Order of the British Empire
Recipients of the Military Cross
1884 births
1959 deaths
Date of birth unknown
Royal Scots officers
British Army personnel of World War I
|
Biology of the Cell is a peer-reviewed scientific journal in the field of cell biology, cell physiology, and molecular biology of animal and plant cells, microorganisms and protists. Topics covered include development, neurobiology, and immunology, as well as theoretical or biophysical modelling.
The journal is currently published monthly by Wiley-Blackwell on behalf of the Société Française des Microscopies and the Société de Biologie Cellulaire de France.
History
The journal first appeared in 1962 and was originally titled Journal de Microscopie (1962–1974). In 1975 the journal was retitled Journal de Microscopie et de Biologie Cellulaire (; 1975–1976). It was later retitled Biologie Cellulaire (; 1977–1980), becoming Biology of the Cell in 1981.
Articles were originally published in either English or French, with summaries in both languages.
Modern journal
Content from 1988 is available online in PDF format, with papers from 2005 also being available in HTML, and from 2006 in an enhanced full-text format.
The journal's 2014 impact factor was 3.506. Biology of the Cell is indexed by BIOBASE, BIOSIS, CAB International, Cambridge Scientific Abstracts, Chemical Abstracts Service, Current Contents/Life Sciences, EMBASE/Excerpta Medica, MEDLINE/Index Medicus, and ProQuest Information and Learning
Articles are primarily research and reviews. Themed series on specific topics are scheduled. They were: Stem Cells (2005), RNA localization (2005), Aquaporins (2005), Synapses (2007), Cell Cycle and Cancer (2008), Microtubules, RNA regulation (2008), Microbiology and Cell Biology (2010), Cilia (2011), Endoplasmic Reticulum (2012), Epigenetics (2012), Post-Translational Modification and Virus Intracellular Trafficking (2012), Optogenetics (2014), Microvesicles and Exosomes (2015), Systems Cell Biology (2015), Translating Canceromics into function (2015).
The editor-in-chief of this journal is René-Marc Mège, a team leader at the Institut Jacques Monod. He was preceded by Thierry Galli (INSERM) who was editor from 2009 - 2017.
Osborne HB. (2005) What's new for Biology of the Cell in 2005? (Editorial) Biol Cell 97: 1–2== References ==
External links
Biology of the Cell home page
Société Française des Microscopies
Société de Biologie Cellulaire de France
Delayed open access journals
Academic journals established in 1962
Molecular and cellular biology journals
Monthly journals
English-language journals
|
```c++
/*=============================================================================
Boost.Wave: A Standard compliant C++ preprocessor library
path_to_url
LICENSE_1_0.txt or copy at path_to_url
=============================================================================*/
// This sample is taken from the C++ standard 16.3.5.5 [cpp.scope]
// Currently this test fails due to a pathologic border case, which is included
// here. Wave currently does not support expanding macros, where the
// replacement-list terminates in partial macro expansion (such as the
// definition of the macro h below). This will be fixed in a future release.
#define x 3
#define f(a) f(x * (a))
#undef x
#define x 2
#define g f
#define z z[0]
#define h g( ~
#define m(a) a(w)
#define w 0,1
#define t(a) a
f(y+1) + f(f(z)) % t(t(g)(0) + t)(1);
g(x+(3,4)-w)
h 5) & m(f)^m(m);
//R #line 27 "t_1_014.cpp"
//R f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
//R f(2 * (2+(3,4)-0,1))
//E t_1_014.cpp(29): error: improperly terminated macro invocation or replacement-list terminates in partial macro expansion (not supported yet): missing ')'
// should expand to: f(2 * g( ~ 5)) & f(2 * (0,1))^m(0,1);
```
|
```yaml
# COCO AP 40.6% for float16 precision is achieved with the configuration below.
# Expected COCO AP for float32 from OD API is 41.92 +/- 0.16.
runtime:
distribution_strategy: 'tpu'
mixed_precision_dtype: 'bfloat16'
task:
model:
num_classes: 90
max_num_instances: 128
input_size: [512, 512, 3]
backbone:
type: hourglass
hourglass:
model_id: 52
num_hourglasses: 2
head:
heatmap_bias: -2.19
input_levels: ['2_0', '2']
detection_generator:
max_detections: 100
peak_error: 0.000001
peak_extract_kernel_size: 3
use_nms: false
nms_pre_thresh: 0.1
nms_thresh: 0.4
class_offset: 1
norm_activation:
norm_epsilon: 0.00001
norm_momentum: 0.1
use_sync_bn: true
losses:
detection:
offset_weight: 1.0
scale_weight: 0.1
gaussian_iou: 0.7
class_offset: 1
per_category_metrics: false
weight_decay: 0.0005
gradient_clip_norm: 10.0
annotation_file: '/readahead/200M/placer/prod/home/tensorflow-performance-data/datasets/coco/instances_val2017.json'
init_checkpoint: gs://tf_model_garden/vision/centernet/extremenet_hg104_512x512_coco17
init_checkpoint_modules: 'backbone'
train_data:
input_path: '/readahead/200M/placer/prod/home/tensorflow-performance-data/datasets/coco/train*'
drop_remainder: true
dtype: 'bfloat16'
global_batch_size: 128
is_training: true
parser:
aug_rand_hflip: true
aug_scale_min: 0.6
aug_scale_max: 1.3
aug_rand_saturation: true
aug_rand_brightness: true
aug_rand_hue: true
aug_rand_contrast: true
odapi_augmentation: true
validation_data:
input_path: '/readahead/200M/placer/prod/home/tensorflow-performance-data/datasets/coco/val*'
drop_remainder: false
dtype: 'bfloat16'
global_batch_size: 64
is_training: false
trainer:
train_steps: 140000
validation_steps: 78 # 5000 / 64
steps_per_loop: 924 # 118287 / 128
validation_interval: 924
summary_interval: 924
checkpoint_interval: 924
optimizer_config:
learning_rate:
type: 'cosine'
cosine:
initial_learning_rate: 0.001
decay_steps: 140000
optimizer:
type: adam
adam:
epsilon: 0.0000001
warmup:
type: 'linear'
linear:
warmup_steps: 2000
```
|
```java
package com.example.jingbin.cloudreader.utils;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.example.jingbin.cloudreader.R;
import com.example.jingbin.cloudreader.view.byview.NeteaseLoadMoreView;
import com.example.jingbin.cloudreader.view.byview.NeteaseRefreshHeaderView;
import me.jingbin.bymvvm.utils.CommonUtils;
import me.jingbin.library.ByRecyclerView;
import me.jingbin.library.decoration.GridSpaceItemDecoration;
import me.jingbin.library.decoration.SpacesItemDecoration;
/**
* @author jingbin
* @data 2019/11/7
*/
public class RefreshHelper {
public static void initStaggeredGrid(ByRecyclerView recyclerView, int spanCount, int spacing) {
recyclerView.setLayoutManager(new StaggeredGridLayoutManager(spanCount, StaggeredGridLayoutManager.VERTICAL));
// item
recyclerView.setHasFixedSize(true);
// recyclerView.setItemAnimator(null);
recyclerView.addItemDecoration(new GridSpaceItemDecoration(spacing));
recyclerView.setRefreshHeaderView(new NeteaseRefreshHeaderView(recyclerView.getContext()));
recyclerView.setLoadingMoreView(new NeteaseLoadMoreView(recyclerView.getContext()));
}
public static ByRecyclerView initLinear(ByRecyclerView recyclerView, boolean isDivider) {
return initLinear(recyclerView, isDivider, 0);
}
public static ByRecyclerView initLinear(ByRecyclerView recyclerView, boolean isDivider, int headerNoShowSize) {
recyclerView.setLayoutManager(new LinearLayoutManager(recyclerView.getContext()));
// recyclerView.setItemAnimator(null);
if (isDivider) {
recyclerView.addItemDecoration(new SpacesItemDecoration(recyclerView.getContext(), SpacesItemDecoration.VERTICAL, headerNoShowSize).setDrawable(R.drawable.shape_line));
}
recyclerView.setRefreshHeaderView(new NeteaseRefreshHeaderView(recyclerView.getContext()));
recyclerView.setLoadingMoreView(new NeteaseLoadMoreView(recyclerView.getContext()));
return recyclerView;
}
public static ByRecyclerView setDefaultAnimator(ByRecyclerView recyclerView) {
recyclerView.setItemAnimator(new DefaultItemAnimator());
return recyclerView;
}
public static void setSwipeRefreshView(SwipeRefreshLayout swipeRefreshView) {
swipeRefreshView.setColorSchemeColors(CommonUtils.getColor(swipeRefreshView.getContext(), R.color.colorTheme));
swipeRefreshView.setProgressBackgroundColorSchemeColor(CommonUtils.getColor(swipeRefreshView.getContext(), R.color.colorSwipeRefresh));
}
}
```
|
```qmake
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/joaquimley/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# path_to_url
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
```
|
```html
<!DOCTYPE html>\n'b'
<html>
\n'b'
<head>
\n'b'
<title>SAS2019 Presentation</title>
\n'b'
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
\n'b'
<meta name="generator" content="pdftohtml 0.36"/>
\n'b'
<meta name="author" content="SAS2019"/>
\n'b'
<meta name="keywords" content="SAS2019"/>
\n'b'
<meta name="date" content="2019-04-12T11:05:45+00:00"/>
\n'b'
</head>
\n'b'
<frameset cols="100,*">
\n'b'
<frame name="links" src="PDF_ind.html"/>
\n'b'
<frame name="contents" src="PDFs.html"/>
\n'b'
</frameset>
\n'b'
</html>
\n'b'<!DOCTYPE html>
<html xmlns="path_to_url" lang="" xml:lang="">
\n'b'
<head>
\n'b'
<title></title>
\n'b'
</head>
\n'b'
<body>\n'b'<a href="PDFs.html#1" target="contents" >Page 1</a><br/>\n'b'<a href="PDFs.html#2" target="contents" >Page 2</a><br/>\n'b'<a href="PDFs.html#3" target="contents" >Page 3</a><br/>\n'b'<a href="PDFs.html#4" target="contents" >Page 4</a><br/>\n'b'<a href="PDFs.html#5" target="contents" >Page 5</a><br/>\n'b'<a href="PDFs.html#6" target="contents" >Page 6</a><br/>\n'b'<a href="PDFs.html#7" target="contents" >Page 7</a><br/>\n'b'<a href="PDFs.html#8" target="contents" >Page 8</a><br/>\n'b'<a href="PDFs.html#9" target="contents" >Page 9</a><br/>\n'b'<a href="PDFs.html#10" target="contents" >Page 10</a><br/>\n'b'<a href="PDFs.html#11" target="contents" >Page 11</a><br/>\n'b'<a href="PDFs.html#12" target="contents" >Page 12</a><br/>\n'b'<a href="PDFs.html#13" target="contents" >Page 13</a><br/>\n'b'<a href="PDFs.html#14" target="contents" >Page 14</a><br/>\n'b'<a href="PDFs.html#15" target="contents" >Page 15</a><br/>\n'b'<a href="PDFs.html#16" target="contents" >Page 16</a><br/>\n'b'<a href="PDFs.html#17" target="contents" >Page 17</a><br/>\n'b'<a href="PDFs.html#18" target="contents" >Page 18</a><br/>\n'b'<a href="PDFs.html#19" target="contents" >Page 19</a><br/>\n'b'<a href="PDFs.html#20" target="contents" >Page 20</a><br/>\n'b'<a href="PDFs.html#21" target="contents" >Page 21</a><br/>\n'b'<a href="PDFs.html#22" target="contents" >Page 22</a><br/>\n'b'<a href="PDFs.html#23" target="contents" >Page 23</a><br/>\n'b'<a href="PDFs.html#24" target="contents" >Page 24</a><br/>\n'b'<a href="PDFs.html#25" target="contents" >Page 25</a><br/>\n'b'<a href="PDFs.html#26" target="contents" >Page 26</a><br/>\n'b'<a href="PDFs.html#27" target="contents" >Page 27</a><br/>\n'b'<a href="PDFs.html#28" target="contents" >Page 28</a><br/>\n'b'<a href="PDFs.html#29" target="contents" >Page 29</a><br/>\n'b'<a href="PDFs.html#30" target="contents" >Page 30</a><br/>\n'b'<a href="PDFs.html#31" target="contents" >Page 31</a><br/>\n'b'<a href="PDFs.html#32" target="contents" >Page 32</a><br/>\n'b'</body>
\n'b'
</html>
\n'b'<!DOCTYPE html>
<html>
\n'b'
<head>
\n'b'
<title></title>
\n'b'
<style type="text/css">
\n'b'<!--\n'b'.xflip {\n'b' -moz-transform: scaleX(-1);\n'b' -webkit-transform: scaleX(-1);\n'b' -o-transform: scaleX(-1);\n'b' transform: scaleX(-1);\n'b' filter: fliph;\n'b'}\n'b'.yflip {\n'b' -moz-transform: scaleY(-1);\n'b' -webkit-transform: scaleY(-1);\n'b' -o-transform: scaleY(-1);\n'b' transform: scaleY(-1);\n'b' filter: flipv;\n'b'}\n'b'.xyflip {\n'b' -moz-transform: scaleX(-1) scaleY(-1);\n'b' -webkit-transform: scaleX(-1) scaleY(-1);\n'b' -o-transform: scaleX(-1) scaleY(-1);\n'b' transform: scaleX(-1) scaleY(-1);\n'b' filter: fliph + flipv;\n'b'}\n'b'-->\n'b'
</style>
\n'b'
</head>
</html>
\n
```
|
The Buckner Cabin, also known as William Buzzard's Cabin, located about northwest of Stehekin, Washington in Lake Chelan National Recreation Area of North Cascades National Park Complex, is one of a group of structures relating to the theme of early settlement in the Lake Chelan area. The original cabin, listed individually as the Buckner Cabin on the National Register of Historic Places, was built in 1889 by Willam Buzzard and altered in 1911 by William and Harry Buckner. The surrounding structures are included in the Buckner Homestead Historic District.
The cabin has been added to the National Register of Historic Placesin 1974 and has been included in the Buckner Homestead Historic District in 1989.
References
Houses on the National Register of Historic Places in Washington (state)
Buildings and structures in Stehekin, Washington
Houses in Chelan County, Washington
National Register of Historic Places in Chelan County, Washington
Houses completed in 1889
Individually listed contributing properties to historic districts on the National Register in Washington (state)
|
```java
//
//
// path_to_url
//
// Unless required by applicable law or agreed to in writing, software
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
package google.registry.model.pricing;
import static com.google.common.base.Preconditions.checkNotNull;
import static google.registry.util.DomainNameUtils.getTldFromDomainName;
import com.google.common.net.InternetDomainName;
import google.registry.model.tld.Tld;
import google.registry.model.tld.label.PremiumListDao;
import java.util.Optional;
import javax.inject.Inject;
import org.joda.money.Money;
import org.joda.time.DateTime;
/** A premium list pricing engine that stores static pricing information in database entities. */
public final class StaticPremiumListPricingEngine implements PremiumPricingEngine {
/** The name of the pricing engine, as used in {@code Registry.pricingEngineClassName}. */
public static final String NAME = "google.registry.model.pricing.StaticPremiumListPricingEngine";
@Inject StaticPremiumListPricingEngine() {}
@Override
public DomainPrices getDomainPrices(String domainName, DateTime priceTime) {
String tldStr = getTldFromDomainName(domainName);
String label = InternetDomainName.from(domainName).parts().get(0);
Tld tld = Tld.get(checkNotNull(tldStr, "tld"));
Optional<Money> premiumPrice =
tld.getPremiumListName().flatMap(pl -> PremiumListDao.getPremiumPrice(pl, label));
return DomainPrices.create(
premiumPrice.isPresent(),
premiumPrice.orElse(tld.getCreateBillingCost(priceTime)),
premiumPrice.orElse(tld.getStandardRenewCost(priceTime)));
}
}
```
|
The Portuguese Springs Formation is a geologic formation in Nevada. It preserves fossils dating back to the Permian period.
See also
List of fossiliferous stratigraphic units in Nevada
Paleontology in Nevada
References
Permian geology of Nevada
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.