diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 00000000..645b114b
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "liveServer.settings.multiRootWorkspaceName": "developer-portal"
+}
\ No newline at end of file
diff --git a/components/osx/01-how-it-works/02-framework/index.md b/components/osx/01-how-it-works/02-framework/index.md
deleted file mode 100644
index 92630172..00000000
--- a/components/osx/01-how-it-works/02-framework/index.md
+++ /dev/null
@@ -1,30 +0,0 @@
----
-title: Framework - How Everything Connects
-sidebar_label: Framework
----
-
-## The Infrastructure Running the Aragon OSx Protocol
-
-The Aragon OSx protocol is composed of **framework-related contracts** creating and managing the **core contracts**. This includes the
-
-- [Creation of DAOs](01-dao-creation/index.md) and initial plugin configuration
-- [Management of plugins](02-plugin-management/index.md), which includes the
-
- - The setup in existing DAOs
- - The versioning of different implementations and respective setup contracts, UI, and related metadata
-
-- [Assignment of ENS Names](./03-ens-names.md) to `Plugin` and `DAO` contracts created through the framework
-
-An overview of the involved contracts and their interactions is shown below:
-
-
- Overview of the framework and core contracts of the Aragon OSx protocol.
-
-
-
-
-In the following sections, you will learn more about the framework-related contracts of the Aragon OSx protocol.
diff --git a/components/osx/01-how-it-works/index.md b/components/osx/01-how-it-works/index.md
deleted file mode 100644
index 6d5f1eee..00000000
--- a/components/osx/01-how-it-works/index.md
+++ /dev/null
@@ -1,29 +0,0 @@
----
-title: How It Works
----
-
-## The Aragon OSx DAO Framework
-
-The Aragon OSx protocol is a DAO framework structured as follows:
-
-
- Overview of the Aragon OSx protocol with its structural components and their responsibilities: the governance layer constituted by the framework DAO, the code layer including the framework and core contracts, which depends on external libraries and services
-
-
-
-### Code Layer
-
-The foundation of the Aragon OSx protocol is the **code layer** constituted by the core and framework related contracts.
-The [core contracts](./01-core/index.md) provide the core primitives intended to be used by users and implemented by developers of the DAO framework.
-The [framework contracts](./02-framework/index.md) provide the infrastructure to easily create and manage your DAOs and plugins easy.
-Both are built on top of external dependencies, most notably the [OpenZeppelin](https://www.openzeppelin.com/contracts) and the [Ethereum Name Service (ENS)](https://docs.ens.domains/) contracts.
-
-The core and framework contracts are free to use, and no additional fees are charged.
-
-### Governance Layer
-
-To govern the framework infrastructure, an Aragon OSx [Framework DAO](./03-framwork-dao.md) is deployed constituting the **governance layer** of the Aragon OSx protocol.
-
-In the next sections, you will learn more about the individual components of the framework.
diff --git a/components/osx/antora.yml b/components/osx/antora.yml
index bbd625bf..59f58514 100644
--- a/components/osx/antora.yml
+++ b/components/osx/antora.yml
@@ -1,3 +1,5 @@
-name: ROOT
-title: Home
+name: osx
+title: OSX
version: ~
+nav:
+ - modules/ROOT/nav.adoc
\ No newline at end of file
diff --git a/components/osx/modules/ROOT/nav.adoc b/components/osx/modules/ROOT/nav.adoc
new file mode 100644
index 00000000..01d50a6b
--- /dev/null
+++ b/components/osx/modules/ROOT/nav.adoc
@@ -0,0 +1,51 @@
+* xref:index.adoc[Overview]
+* xref:how-it-works/index.adoc[How it works]
+** xref:how-it-works/core/index.adoc[Smart Contracts]
+*** xref:how-it-works/core/dao/index.adoc[DAO]
+**** xref:how-it-works/core/dao/actions.adoc[Advanced DAO Actions]
+*** xref:how-it-works/core/permissions/index.adoc[Permissions]
+**** xref:how-it-works/core/permissions/conditions.adoc[Permission Conditions]
+*** xref:how-it-works/core/plugins/index.adoc[Plugins]
+
+** xref:how-it-works/framework/index.adoc[Framework]
+
+*** xref:how-it-works/framework/dao-creation/index.adoc[Creating a DAO]
+
+*** xref:how-it-works/framework/plugin-management/index.adoc[Plugins]
+**** xref:how-it-works/framework/plugin-management/plugin-repo/index.adoc[Plugin Repositories]
+***** xref:how-it-works/framework/plugin-management/plugin-repo/plugin-repo-creation.adoc[Publishing a Plugin]
+**** xref:how-it-works/framework/plugin-management/plugin-setup/index.adoc[Installing Plugins]
+***** xref:how-it-works/framework/plugin-management/plugin-setup/security-risk-mitigation.adoc[Plugin Security and Risks]
+
+*** xref:how-it-works/framework/ens-names.adoc[ENS Names]
+
+** xref:how-it-works/framework-dao.adoc[Protocol Governance]
+
+* xref:how-to-guides/index.adoc[Tutorials]
+** xref:how-to-guides/dao/index.adoc[Operating a DAO]
+*** xref:how-to-guides/dao/best-practices.adoc[Best Practices]
+*** xref:how-to-guides/dao/action-execution.adoc[Executing Actions on behalf of the DAO]
+*** xref:how-to-guides/dao/protocol-upgrades.adoc[Upgrade your DAO to future Aragon OSX versions]
+*** xref:how-to-guides/dao/managing-plugins.adoc[Managing your DAO's Plugins]
+
+** xref:how-to-guides/plugin-development/index.adoc[Developing a Plugin]
+*** xref:how-to-guides/plugin-development/best-practices.adoc[Before Starting]
+*** xref:how-to-guides/plugin-development/plugin-types.adoc[Choosing The Plugin Type]
+*** xref:how-to-guides/plugin-development/non-upgradeable-plugin/index.adoc[Non-Upgradeable Plugins]
+**** xref:how-to-guides/plugin-development/non-upgradeable-plugin/initialization.adoc[Initialization]
+**** xref:how-to-guides/plugin-development/non-upgradeable-plugin/implementation.adoc[Plugin Implementation Contract]
+**** xref:how-to-guides/plugin-development/non-upgradeable-plugin/setup.adoc[Plugin Setup Contract]
+*** xref:how-to-guides/plugin-development/upgradeable-plugin/index.adoc[Upgradeable Plugins]
+**** xref:how-to-guides/plugin-development/upgradeable-plugin/initialization.adoc[Initialization]
+**** xref:how-to-guides/plugin-development/upgradeable-plugin/implementation.adoc[Plugin Implementation Contract]
+**** xref:how-to-guides/plugin-development/upgradeable-plugin/setup.adoc[Plugin Setup Contract]
+**** xref:how-to-guides/plugin-development/upgradeable-plugin/subsequent-builds.adoc[Subsequent Builds]
+**** xref:how-to-guides/plugin-development/upgradeable-plugin/updating-versions.adoc[Upgrade a DAO Plugin]
+*** xref:how-to-guides/plugin-development/governance-plugins/index.adoc[Governance Plugins]
+**** xref:how-to-guides/plugin-development/governance-plugins/proposals.adoc[Proposal]
+**** xref:how-to-guides/plugin-development/governance-plugins/membership.adoc[Membership]
+*** xref:how-to-guides/plugin-development/meta-tx-plugins.adoc[Meta Transactions]
+*** xref:how-to-guides/plugin-development/publication/index.adoc[Publication of your plugin into Aragon OSx]
+**** xref:how-to-guides/plugin-development/publication/versioning.adoc[New Plugin Version]
+**** xref:how-to-guides/plugin-development/publication/metadata.adoc[Plugin Metadata]
+
diff --git a/components/osx/01-how-it-works/01-core/01-dao/01-actions.md b/components/osx/modules/ROOT/pages/how-it-works/core/dao/actions.adoc
similarity index 86%
rename from components/osx/01-how-it-works/01-core/01-dao/01-actions.md
rename to components/osx/modules/ROOT/pages/how-it-works/core/dao/actions.adoc
index b9d83de3..4e46d745 100644
--- a/components/osx/01-how-it-works/01-core/01-dao/01-actions.md
+++ b/components/osx/modules/ROOT/pages/how-it-works/core/dao/actions.adoc
@@ -1,21 +1,19 @@
----
-title: Advanced DAO Actions
----
+= Advanced DAO Actions
-## A Deep Dive into Actions and Execution
+=== A Deep Dive into Actions and Execution
The DAO's `execute` function is part of the `DAO.sol` contract and has the following function header:
-```solidity title="@aragon/osx/core/dao/DAO.sol"
+```solidity
function execute(
- bytes32 _callId,
- Action[] calldata _actions,
- uint256 _allowFailureMap
- )
- external
- override
- auth(address(this), EXECUTE_PERMISSION_ID)
- returns (bytes[] memory execResults, uint256 failureMap)
+ bytes32 _callId,
+ Action[] calldata _actions,
+ uint256 _allowFailureMap
+)
+external
+override
+auth(address(this), EXECUTE_PERMISSION_ID)
+returns (bytes[] memory execResults, uint256 failureMap)
```
It offers two features that we will dive into in this article:
@@ -46,13 +44,13 @@ Actions can be
- external services (e.g. Uniswap, Compound, etc.)
- Aragon OSx plugins (e.g., the DAO can be a member of a multisig installed in another DAO),
- - Aragon OSx protocol infrastructure (e.g., to [setup a plugin](../../02-framework/02-plugin-management/02-plugin-setup/index.md))
+ - Aragon OSx protocol infrastructure (e.g., to xref:how-it-works/framework/plugin-management/plugin-setup/index.adoc[setup a plugin]).
- transfers of native tokens
#### Example: Calling the wETH Contract
-We have an Aragon DAO deployed on the Goerli testnet. Now, we want to wrap `0.1 ETH` from the DAO treasury into `wETH` by depositing it into the [Goerli WETH contract](https://goerli.etherscan.io/token/0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6#writeContract) deployed on the address `0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6`. The corresponding `Action` and `execute` function call look as follows:
+We have an Aragon DAO deployed on the Goerli testnet. Now, we want to wrap `0.1 ETH` from the DAO treasury into `wETH` by depositing it into the link:https://goerli.etherscan.io/token/0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6#writeContract[Goerli WETH contract] deployed on the address `0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6`. The corresponding `Action` and `execute` function call look as follows:
```solidity
@@ -68,7 +66,7 @@ dao().execute({_callId: '', _actions: actions, _allowFailureMap: 0});
```
-For the `execute` call to work, the caller must have the required [`EXECUTE_PERMISSION_ID` permission](../02-permissions/index.md) on the DAO contract.
+For the `execute` call to work, the caller must have the required xref:how-it-works/core/permissions/index.adoc[`EXECUTE_PERMISSION_ID` permission] on the DAO contract.
### The Action Array
diff --git a/components/osx/01-how-it-works/01-core/01-dao/index.md b/components/osx/modules/ROOT/pages/how-it-works/core/dao/index.adoc
similarity index 61%
rename from components/osx/01-how-it-works/01-core/01-dao/index.md
rename to components/osx/modules/ROOT/pages/how-it-works/core/dao/index.adoc
index 2938a7b1..2e646904 100644
--- a/components/osx/01-how-it-works/01-core/01-dao/index.md
+++ b/components/osx/modules/ROOT/pages/how-it-works/core/dao/index.adoc
@@ -1,8 +1,6 @@
----
-title: DAO
----
+= DAO
-## The DAO Contract: The Identity and Basis of Your Organization
+=== The DAO Contract: The Identity and Basis of Your Organization
In this section, you will learn about the core functionality of every Aragon OSx DAO.
@@ -12,51 +10,44 @@ The `DAO` contract is the identity and basis of your organization. It is the add
The most important and basic functionality of your DAO is the **execution of arbitrary actions**, which allows you to execute the DAO's own functions as well as interacting with the rest of the world, i.e., calling methods in other contracts and sending assets to other addresses.
-:::note
-Typically, actions are scheduled in a proposal in a governance [plugin installed to your DAO](../03-plugins/index.md).
-:::
+NOTE: Typically, actions are scheduled in a proposal in a governance - xref:how-it-works/core/plugins/index.adoc[plugin installed to your DAO]
-Multiple `Action` structs can be put into one `Action[]` array and executed in a single transaction via the `execute` function. To learn more about actions and advanced features of the DAO executor, visit the [A Deep Dive Into Actions](./01-actions.md) section.
+Multiple `Action` structs can be put into one `Action[]` array and executed in a single transaction via the `execute` function. To learn more about actions and advanced features of the DAO executor, visit the xref:how-it-works/core/dao/actions.adoc[A Deep Dive Into Actions].
### 2. Asset Management
The DAO provides basic **asset management** functionality to deposit, withdraw, and keep track of
- native
-- [ERC-20 (Token Standard)](https://eips.ethereum.org/EIPS/eip-20),
-- [ERC-721 (NFT Standard)](https://eips.ethereum.org/EIPS/eip-721), and
-- [ERC-1155 (Multi Token Standard)](https://eips.ethereum.org/EIPS/eip-1155)
+- link:https://eips.ethereum.org/EIPS/eip-20[ERC-20 (Token Standard)]
+- link:https://eips.ethereum.org/EIPS/eip-721[ERC-721 (NFT Standard)], and
+- link:https://eips.ethereum.org/EIPS/eip-1155[ERC-1155 (Multi Token Standard)]
tokens in the treasury.
-In the future, more advanced asset management and finance functionality can be added to your DAO in the form of [plugins](../03-plugins/index.md).
+In the future, more advanced asset management and finance functionality can be added to your DAO in the form of xref:how-it-works/core/plugins/index.adoc[plugins].
### 3. Upgradeability
-Your DAO contract has the ability to be upgraded to a newer version (see [Upgrade your DAO](../../../02-how-to-guides/01-dao/03-protocol-upgrades.md)) if a new version of Aragon OSx is released in the future. These upgrades allow your DAO to smoothly transition to a new protocol version unlocking new features.
+Your DAO contract has the ability to be upgraded to a newer version (see xref:how-to-guides/dao/protocol-upgrades.adoc[Upgrade your DAO]) if a new version of Aragon OSx is released in the future. These upgrades allow your DAO to smoothly transition to a new protocol version unlocking new features.
-
### 4. Callback Handling
To interact with the DAO, external contracts might require certain callback functions to be present.
-Examples are the `onERC721Received` and `onERC1155Received` / `onERC1155BatchReceived` functions required by the [ERC-721 (NFT Standard)](https://eips.ethereum.org/EIPS/eip-721) and [ERC-1155 (Multi Token Standard)](https://eips.ethereum.org/EIPS/eip-1155) tokens.
+Examples are the `onERC721Received` and `onERC1155Received` / `onERC1155BatchReceived` functions required by the link:https://eips.ethereum.org/EIPS/eip-721[ERC-721 (NFT Standard)] and link:https://eips.ethereum.org/EIPS/eip-1155[ERC-1155 (Multi Token Standard)] tokens.
Our `CallbackHandler` allows to register the required callback responses dynamically so that the DAO contract does not need to be upgraded.
-
-
### 5. Signature Validation
Currently, externally owned accounts (EOAs) can sign messages with their associated private keys, but contracts cannot.
An exemplary use case is a decentralized exchange with an off-chain order book, where buy/sell orders are signed messages.
To accept such a request, both, the external service provider and caller need to follow a standard with which the signed message of the caller can be validated.
-By supporting the [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271) standard, your DAO can validate signatures via its `isValidSignature` function that forwards the call to a signature validator contract.
-
-
+By supporting the link:https://eips.ethereum.org/EIPS/eip-721[ERC-721 (NFT Standard)], your DAO can validate signatures via its `isValidSignature` function that forwards the call to a signature validator contract.
### 6. Permission Management
Lastly, it is essential that only the right entities (e.g., the DAO itself or trusted addresses) have permission to use the above-mentioned functionalities. This is why Aragon OSx DAOs contain a flexible and battle-tested **permission manager** being able to assign permissions for the above functionalities to specific addresses.
-Although possible, the permissions to execute arbitrary actions or upgrade the DAO should not be given to EOAs as this poses a security risk to the organization if the account is compromised or acts adversarial. Instead, the permissions for the above-mentioned functionalities are better restricted to the `DAO` contract itself and triggered through governance [plugins](../03-plugins/index.md) that you can install on your DAO.
+Although possible, the permissions to execute arbitrary actions or upgrade the DAO should not be given to EOAs as this poses a security risk to the organization if the account is compromised or acts adversarial. Instead, the permissions for the above-mentioned functionalities are better restricted to the `DAO` contract itself and triggered through governance xref:how-it-works/core/plugins/index.adoc[plugins] that you can install on your DAO.
-To learn more, visit the [permission manager](../02-permissions/index.md) section.
+To learn more, visit the xref:how-it-works/core/permissions/index.adoc[permission manager] section.
\ No newline at end of file
diff --git a/components/osx/01-how-it-works/01-core/index.md b/components/osx/modules/ROOT/pages/how-it-works/core/index.adoc
similarity index 54%
rename from components/osx/01-how-it-works/01-core/index.md
rename to components/osx/modules/ROOT/pages/how-it-works/core/index.adoc
index 009ca1b5..80ceeb3a 100644
--- a/components/osx/01-how-it-works/01-core/index.md
+++ b/components/osx/modules/ROOT/pages/how-it-works/core/index.adoc
@@ -1,9 +1,6 @@
----
-title: The Smart Contracts behind DAOs
-sidebar_label: Smart Contracts
----
+= The Smart Contracts behind DAOs
-## The Contracts Constituting Your DAO
+=== The Contracts Constituting Your DAO
In a nutshell, your Aragon OSx DAO consists of three pieces:
@@ -27,19 +24,13 @@ In a nutshell, your Aragon OSx DAO consists of three pieces:
The underlying smart contracts constitute **the core contracts** of the Aragon OSx DAO framework.
-
+image::../../../_/images/optimized-svg/plugins/dao-plugin.drawio.svg[align="center"]
-![Schematic depiction of the interaction between the DAO, the PermissionManager, and a Plugin contract.](/optimized-svg/plugins/dao-plugin.drawio.svg)
-
-
- An exemplary DAO setup showing interactions between the three core contract pieces triggered by different user groups: The DAO contract in blue containing the PermissionManager in red, respectively, as well as two Plugin contracts in green.
- Function calls are visualized as black arrows and require permission checks (red, dashed arrow). In this example, the permission manager determines whether the token voting plugin can execute actions on the DAO, a member can change its settings, or if a DeFi-related plugin is allowed to invest in a certain, external contract.
-
-
-
+An exemplary DAO setup showing interactions between the three core contract pieces triggered by different user groups: The `DAO` contract in blue containing the `PermissionManager` in red, respectively, as well as two `Plugin` contracts in green.
+Function calls are visualized as black arrows and require permission checks (red, dashed arrow). In this example, the permission manager determines whether the token voting plugin can execute actions on the DAO, a member can change its settings, or if a DeFi-related plugin is allowed to invest in a certain, external contract.
In the upcoming sections, you will learn about each of them in more depth.
-- [The DAO Contract: The Identity and Basis of Your Organization](./01-dao/index.md)
-- [Permissions: Managing Your DAO](./02-permissions/index.md)
-- [Plugins: Customizing your DAO](./03-plugins/index.md)
+- xref:how-it-works/core/dao/index.adoc[The DAO Contract: The Identity and Basis of Your Organization]
+- xref:how-it-works/core/permissions/index.adoc[Permissions: Managing Your DAO]
+- xref:how-it-works/core/plugins/index.adoc[Plugins: Customizing your DAO]
diff --git a/components/osx/01-how-it-works/01-core/02-permissions/01-conditions.md b/components/osx/modules/ROOT/pages/how-it-works/core/permissions/conditions.adoc
similarity index 84%
rename from components/osx/01-how-it-works/01-core/02-permissions/01-conditions.md
rename to components/osx/modules/ROOT/pages/how-it-works/core/permissions/conditions.adoc
index 8c38623d..b9e75c00 100644
--- a/components/osx/01-how-it-works/01-core/02-permissions/01-conditions.md
+++ b/components/osx/modules/ROOT/pages/how-it-works/core/permissions/conditions.adoc
@@ -1,13 +1,11 @@
----
-title: Permission Conditions
----
+= Permission Conditions
-## Permission Conditions
+=== Permission Conditions
Permission conditions relay the decision if an authorized call is permitted to another contract.
This contract must inherit from `PermissionCondition` and implement the `IPermissionCondition` interface.
-```solidity title="@aragon/osx/core/permission/IPermissionCondition.sol"
+```solidity
interface IPermissionCondition {
/// @notice This method is used to check if a call is permitted.
/// @param _where The address of the target contract.
@@ -54,13 +52,11 @@ The following examples illustrate
## Examples
-:::caution
-The following code examples serve educational purposes and are not intended to be used in production.
-:::
+CAUTION: The following code examples serve educational purposes and are not intended to be used in production.
Let’s assume we have an `Example` contract managed by a DAO `_dao` containing a `sendCoins` function allowing you to send an `_amount` to an address `_to` and being permissioned through the `auth` modifier:
-```solidity title="Example.sol"
+```solidity
contract Example is Plugin {
constructor(IDAO _dao) Plugin(_dao) {}
@@ -83,26 +79,28 @@ Let’s imagine that we want to make sure that `_amount` is not more than `1 ETH
We can realize this requirement by deploying a `ParameterConstraintCondition` condition.
-```solidity title="ParameterConstraintCondition.sol"
+```solidity
contract ParameterConstraintCondition is PermissionCondition {
- uint256 internal maxValue;
-
- constructor(uint256 _maxValue) {
- maxValue = _maxValue;
- }
-
- function isGranted(
- address _where,
- address _who,
- bytes32 _permissionId,
- bytes calldata _data
- ) external view returns (bool) {
+ uint256 internal maxValue;
+
+ constructor(uint256 _maxValue) {
+ maxValue = _maxValue;
+ }
+
+ function isGranted(
+ address _where,
+ address _who,
+ bytes32 _permissionId,
+ bytes calldata _data
+ ) external view returns (bool) {
(_where, _who, _permissionId); // Prevent compiler warnings resulting from unused arguments.
(address _to, uint256 _amount) = abi.decode(_data, (address, uint256));
- return _amount <= _maxValue;
+ return _amount <= _maxValue;
+ }
}
+
```
Now, after granting the `SEND_COINS_PERMISSION_ID` permission to `_where` and `_who` via the `grantWithCondition` function and pointing to the `ParameterConstraintCondition` condition contract, the `_who` address can only call the `sendCoins` of the `Example` contract deployed at address `_where` successfully if `_amount` is not larger than `_maxValue` stored in the condition contract.
@@ -111,7 +109,7 @@ Now, after granting the `SEND_COINS_PERMISSION_ID` permission to `_where` and `_
In another use-case, we might want to make sure that the `sendCoins` can only be called after a certain date. This would look as following:
-```solidity title="TimeCondition.sol"
+```solidity
contract TimeCondition is PermissionCondition {
uint256 internal date;
@@ -136,9 +134,9 @@ Here, the permission condition will only allow the call the `_date` specified in
### Condition 3: Using Curated Registries
-In another use-case, we might want to make sure that the `sendCoins` function can only be called by real humans to prevent sybil attacks. For this, let's say we use the [Proof of Humanity (PoH)](https://www.proofofhumanity.id/) registry providing a curated list of humans:
+In another use-case, we might want to make sure that the `sendCoins` function can only be called by real humans to prevent sybil attacks. For this, let's say we use the link:https://www.proofofhumanity.id/[Proof of Humanity (PoH)] registry providing a curated list of humans:
-```solidity title="IProofOfHumanity.sol"
+```solidity
interface IProofOfHumanity {
function isRegistered(address _submissionID) external view returns (bool);
}
@@ -170,7 +168,7 @@ Here, the permission condition will only allow the call if the PoH registry conf
In another use-case, we might want to make sure that the `sendCoins` function can only be called if the ETH price in USD is above a certain threshold:
-```solidity title="PriceOracleCondition.sol"
+```solidity
import '@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol';
contract PriceOracleCondition is PermissionCondition {
@@ -205,6 +203,6 @@ contract PriceOracleCondition is PermissionCondition {
}
}
-Here, we use [a data feed from a Chainlink oracle](https://docs.chain.link/docs/data-feeds/) providing us with the latest ETH/USD price on the Goerli testnet and require that the call is only allowed if the ETH price is over $9000.
+Here, we use https://docs.chain.link/docs/data-feeds/ providing us with the latest ETH/USD price on the Goerli testnet and require that the call is only allowed if the ETH price is over $9000.
````
diff --git a/components/osx/01-how-it-works/01-core/02-permissions/index.md b/components/osx/modules/ROOT/pages/how-it-works/core/permissions/index.adoc
similarity index 73%
rename from components/osx/01-how-it-works/01-core/02-permissions/index.md
rename to components/osx/modules/ROOT/pages/how-it-works/core/permissions/index.adoc
index 8efec6b0..4e970b0f 100644
--- a/components/osx/01-how-it-works/01-core/02-permissions/index.md
+++ b/components/osx/modules/ROOT/pages/how-it-works/core/permissions/index.adoc
@@ -1,15 +1,13 @@
----
-title: Permissions
----
+= Permissions
-## Managing Your DAO
+=== Managing Your DAO
At Aragon, we believe that **DAOs are permission management systems**.
Permissions between contracts and wallets allow a DAO to manage and govern its actions.
Here, you will learn how the permissions in Aragon OSx work, how they can be granted and revoked from wallets and contracts, and how they are managed through the DAO.
-As we mentioned earlier, it is essential that only the right person or contract can execute a certain action. As a developer, you might have seen or used [modifiers such as `onlyOwner`](https://docs.openzeppelin.com/contracts/2.x/api/ownership#Ownable) in contracts. This `onlyOwner` modifier provides basic access control to your DAO: only the `owner` address is permitted to execute the function to which the modifier is attached.
+As we mentioned earlier, it is essential that only the right person or contract can execute a certain action. As a developer, you might have seen or used link:https://docs.openzeppelin.com/contracts/2.x/api/ownership#Ownable[modifiers such as onlyOwner] in contracts. This `onlyOwner` modifier provides basic access control to your DAO: only the `owner` address is permitted to execute the function to which the modifier is attached.
In Aragon OSx, we follow the same approach but provide more advanced functionality:
Each `DAO` contracts includes a `PermissionManager` contract allowing to flexibly, securely, and collectively manage permissions through the DAO and, thus, govern its actions.
@@ -21,7 +19,7 @@ Identifiers, permissions, and modifiers link everything together.
To differentiate between different permissions, permission **identifiers** are used that you will frequently find at the top of Aragon OSx contracts. They look something like this:
-```solidity title="@aragon/osx/core/dao/DAO.sol"
+```solidity
bytes32 public constant EXECUTE_PERMISSION_ID = keccak256("EXECUTE_PERMISSION");
```
@@ -29,7 +27,7 @@ bytes32 public constant EXECUTE_PERMISSION_ID = keccak256("EXECUTE_PERMISSION");
A permission specifies an address `who` being allowed to call certain functions on a contract address `where`. In the `PermissionManager` contract, permissions are defined as the concatenation of the word `"PERMISSION"` with the `who` and `where` address, as well as the `bytes32` permission identifier `permissionId`.
-```solidity title="@aragon/osx/core/permission/PermissionManager.sol"
+```solidity
function permissionHash(
address _where,
address _who,
@@ -84,14 +82,13 @@ function grant(
To prevent these functions from being called by any address, they are themselves permissioned via the `auth` modifier and require the caller to have the `ROOT_PERMISSION_ID` permission in order to call them.
-:::note
-Typically, the `ROOT_PERMISSION_ID` permission is granted only to the `DAO` contract itself. Contracts related to the Aragon infrastructure temporarily require it during the [DAO creation](../../02-framework/01-dao-creation/index.md) and [plugin setup ](../../02-framework/02-plugin-management/02-plugin-setup/index.md) processes.
+
+NOTE: Typically, the `ROOT_PERMISSION_ID` permission is granted only to the `DAO` contract itself. Contracts related to the Aragon infrastructure temporarily require it during the xref:how-it-works/framework/dao-creation/index.adoc[DAO creation] and xref:how-it-works/framework/plugin-management/plugin-setup/index.adoc[plugin setup] processes.
This means, that these functions can only be called through the DAO’s `execute` function that, in turn, requires the calling address to have the `EXECUTE_PERMISSION_ID` permission.
Typically, the `EXECUTE_PERMISSION_ID` permission is granted to governance contracts (such as a majority voting plugin owned by the DAO or a multi-sig). Accordingly, a proposal is often required to change permissions.
-Exceptions are, again, the [DAO creation](../../02-framework/01-dao-creation/index.md) and [plugin setup ](../../02-framework/02-plugin-management/02-plugin-setup/index.md) processes.
-:::
+Exceptions are, again, the xref:how-it-works/framework/dao-creation/index.adoc[DAO creation] and xref:how-it-works/framework/plugin-management/plugin-setup/index.adoc[plugin setup] processes.
#### Granting Permission with Conditions
@@ -108,9 +105,9 @@ function grantWithCondition(
and specifying the `_condition` contract address. This provides full flexibility to customize the conditions under which the function call is allowed.
-Typically, conditions are written specifically for and installed together with [plugins](../../01-core/03-plugins/index.md).
+Typically, conditions are written specifically for and installed together with xref:how-it-works/core/plugins/index.adoc[plugins]
-To learn more about this advanced topic and possible applications, visit the [permission conditions](./01-conditions.md) section.
+To learn more about this advanced topic and possible applications, visit the xref:how-it-works/core/permissions/conditions.adoc[permission conditions].
#### Granting Permission to `ANY_ADDR`
@@ -141,14 +138,34 @@ Moreover, if a condition is set, we return its `isGranted` result and do not fal
The following functions in the DAO are permissioned:
-| Functions | Permission Identifier | Description |
-| --------------------------------------- | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
-| `grant`, `grantWithCondition`, `revoke` | `ROOT_PERMISSION_ID` | Required to manage permissions of the DAO and associated plugins. |
-| `execute` | `EXECUTE_PERMISSION_ID` | Required to execute arbitrary actions. |
-| `_authorizeUpgrade` | `UPGRADE_DAO_PERMISSION_ID` | Required to upgrade the DAO (via the [UUPS](https://eips.ethereum.org/EIPS/eip-1822)). |
-| `setMetadata` | `SET_METADATA_PERMISSION_ID` | Required to set the DAO’s metadata and [DAOstar.one DAO URI](https://eips.ethereum.org/EIPS/eip-4824). |
-| `setTrustedForwarder` | `SET_TRUSTED_FORWARDER_PERMISSION_ID` | Required to set the DAO’s trusted forwarder for meta transactions. |
-| `registerStandardCallback` | `REGISTER_STANDARD_CALLBACK_PERMISSION_ID` | Required to register a standard callback for an [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID. |
+|===
+|Functions |Permission Identifier |Description
+
+|`grant`, `grantWithCondition`, `revoke`
+|`ROOT_PERMISSION_ID`
+| Required to manage permissions of the DAO and associated plugins.
+
+|`execute`
+|`EXECUTE_PERMISSION_ID`
+|Required to execute arbitrary actions.
+
+| `_authorizeUpgrade`
+| `UPGRADE_DAO_PERMISSION_ID`
+| Required to upgrade the DAO (via the link:https://eips.ethereum.org/EIPS/eip-1822[UUPS]).
+
+| `setMetadata`
+| `SET_METADATA_PERMISSION_ID`
+| Required to set the DAO’s metadata and link:https://eips.ethereum.org/EIPS/eip-4824[DAOstar.one DAO URI]
+
+| `setTrustedForwarder`
+| `SET_TRUSTED_FORWARDER_PERMISSION_ID`
+| Required to set the DAO’s trusted forwarder for meta transactions.
+
+| `registerStandardCallback`
+| `REGISTER_STANDARD_CALLBACK_PERMISSION_ID`
+| Required to register a standard callback for an link:https://eips.ethereum.org/EIPS/eip-165[ERC-165] interface ID
+
+|===
Plugins installed on the DAO might introduce other permissions and associated permission identifiers.
diff --git a/components/osx/01-how-it-works/01-core/03-plugins/index.md b/components/osx/modules/ROOT/pages/how-it-works/core/plugins/index.adoc
similarity index 63%
rename from components/osx/01-how-it-works/01-core/03-plugins/index.md
rename to components/osx/modules/ROOT/pages/how-it-works/core/plugins/index.adoc
index 1040de56..024afe3e 100644
--- a/components/osx/01-how-it-works/01-core/03-plugins/index.md
+++ b/components/osx/modules/ROOT/pages/how-it-works/core/plugins/index.adoc
@@ -1,8 +1,6 @@
----
-title: Plugins
----
+= Plugins
-## Customizing your DAO
+=== Customizing your DAO
To add features beyond the base functionality available, you can customize your Aragon OSx DAO by installing a wide variety of plugins.
@@ -13,7 +11,7 @@ Plugins can be related to:
- **Asset Management:** allows the DAO to manage its **treasury** or use it to invest (e.g., in lending, staking, or NFT mints).
-- **Membership:** determines **who** will be a part of the DAO and what role they have. This can mean minting governance tokens like [ERC-20](https://eips.ethereum.org/EIPS/eip-20), NFTs, or any other token standard. Typically, membership-related plugins grant permissions based on token ownership or maintenance of a curated list of addresses.
+- **Membership:** determines **who** will be a part of the DAO and what role they have. This can mean minting governance tokens like link:https://eips.ethereum.org/EIPS/eip-20[ERC-20], NFTs, or any other token standard. Typically, membership-related plugins grant permissions based on token ownership or maintenance of a curated list of addresses.
- And **anything** else that comes to mind!
@@ -23,9 +21,7 @@ Whenever a DAO installs a plugin, an instance of that plugin's base template is
Each instance of a plugin is installed to a DAO through the granting of permissions.
-:::info
-Learn more about the different [plugin types](../../../02-how-to-guides/02-plugin-development/02-plugin-types.md) in our How-to guide.
-:::
+TIP: Learn more about the different xref:how-to-guides/plugin-development/plugin-types.adoc[plugin types] in our How-to guide.
This raises questions on how the DAO manages plugins and who actually owns plugins.
@@ -37,15 +33,12 @@ A DAO manages plugins and interactions between them. In more detail, its permiss
- authorizes calls to plugin functions carrying the `auth` modifier
- authorizes calls to DAO functions, for example the `execute` function, allowing to act as the DAO
-
+image::../../../../_/images/optimized-svg/plugins/dao-plugin.drawio.svg[align="center"]
-![Schematic depiction of the interaction between the DAO, the PermissionManager, and a Plugin contract.](/optimized-svg/plugins/dao-plugin.drawio.svg)
-
- An exemplary DAO setup showing interactions between the three core contract pieces triggered by different user groups: The DAO contract in blue containing the PermissionManager in red, respectively, as well as two Plugin contracts in green.
+An exemplary DAO setup showing interactions between the three core contract pieces triggered by different user groups: The `DAO` contract in blue containing the `PermissionManager` in red, respectively, as well as two `Plugin` contracts in green.
Function calls are visualized as black arrows and require permission checks (red, dashed arrow). In this example, the permission manager determines whether the token voting plugin can execute actions on the DAO, a member can change its settings, or if a DeFi-related plugin is allowed to invest in a certain, external contract.
-
-
-
-Whereas deployed plugin instances belong to the DAO, the developer of the original plugin implementation owns the implementation and setup contract of the plugin. The plugin developer is the maintainer of an Aragon OSx [plugin repo](../../02-framework/02-plugin-management/01-plugin-repo/index.md). Finally, the Aragon OSx protocol manages the registry in which the plugin repositories are listed, which is required to install a plugin using the Aragon OSx framework infrastructure to your DAO.
+Whereas deployed plugin instances belong to the DAO, the developer of the original plugin implementation owns the implementation
+and setup contract of the plugin. The plugin developer is the maintainer of an Aragon OSx xref:how-it-works/framework/plugin-management/plugin-repo/index.adoc[plugin repo].
+Finally, the Aragon OSx protocol manages the registry in which the plugin repositories are listed, which is required to install a plugin using the Aragon OSx framework infrastructure to your DAO.
diff --git a/components/osx/01-how-it-works/03-framwork-dao.md b/components/osx/modules/ROOT/pages/how-it-works/framework-dao.adoc
similarity index 100%
rename from components/osx/01-how-it-works/03-framwork-dao.md
rename to components/osx/modules/ROOT/pages/how-it-works/framework-dao.adoc
diff --git a/components/osx/01-how-it-works/02-framework/01-dao-creation/index.md b/components/osx/modules/ROOT/pages/how-it-works/framework/dao-creation/index.adoc
similarity index 51%
rename from components/osx/01-how-it-works/02-framework/01-dao-creation/index.md
rename to components/osx/modules/ROOT/pages/how-it-works/framework/dao-creation/index.adoc
index 32f8dbd6..ce3776e8 100644
--- a/components/osx/01-how-it-works/02-framework/01-dao-creation/index.md
+++ b/components/osx/modules/ROOT/pages/how-it-works/framework/dao-creation/index.adoc
@@ -1,44 +1,41 @@
----
-title: Creating a DAO
----
+= Creating a DAO
-## The DAO Creation Process
+=== The DAO Creation Process
Two framework contracts manage the `DAO` contract creation process:
-- The [`DAOFactory`](../../../03-reference-guide/framework/dao/DAOFactory.md)
-- The [`DAORegistry`](../../../03-reference-guide/framework/dao/DAORegistry.md).
+- The TODO:GIORGI [`DAOFactory`](../../../03-reference-guide/framework/dao/DAOFactory.md)
+- The TODO:GIORGI [`DAORegistry`](../../../03-reference-guide/framework/dao/DAORegistry.md).
-
### `DAOFactory`
The `DAOFactory` creates and sets up a `DAO` for you in four steps with the `createDao` function. The function requires the `DAOSettings` including
-- The trusted forwarder address for future [ERC-2771 (Meta Transaction)](https://eips.ethereum.org/EIPS/eip-2771) compatibility that is set to `address(0)` for now
+- The trusted forwarder address for future link:https://eips.ethereum.org/EIPS/eip-2771[ERC-2771 (Meta Transaction)] compatibility that is set to `address(0)` for now
- The ENS name (to be registered under the `dao.eth` domain)
-- The [ERC-4824 (Common Interfaces for DAOs)](https://eips.ethereum.org/EIPS/eip-4824) `daoURI`
+- The link:https://eips.ethereum.org/EIPS/eip-4824[ERC-4824 (Common Interfaces for DAOs)] `daoURI`
- Optional metadata
as well as an array of `PluginSettings` containing `PluginSetup` contract references and respective setup data for the initial set of plugins to be installed on the DAO.
The `DAOFactory` create the `DAO` in four steps and interacts with the `DAORegistry` and being also part of the Aragon OSx framework:
-1. Creates a new DAO by deploying an [ERC-1967](https://eips.ethereum.org/EIPS/eip-1967) proxy pointing to the latest Aragon OSx `DAO` implementation and becomes the initial owner.
+1. Creates a new DAO by deploying an link:https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] proxy pointing to the latest Aragon OSx `DAO` implementation and becomes the initial owner.
-2. Registers the new contract in the [`DAORegistry`](#daoregistry).
+2. Registers the new contract in the [`DAORegistry`](#daoregistry). TODO:GIORGI
-3. Installs the plugins using the `PluginSetupProcessor` (see also the section about [the plugin setup process](../02-plugin-management/02-plugin-setup/index.md)).
+3. Installs the plugins using the `PluginSetupProcessor` (see also the section about xref:how-it-works/framework/plugin-management/plugin-setup/index.adoc[the plugin setup process]).
-4. Sets the [native permissions](../../01-core/02-permissions/index.md#permissions-native-to-the-dao-contract) of the `DAO` and revokes its own ownership.
+4. Sets the xref:how-it-works/core/permissions/index.adoc##permissions-native-to-the-dao-contract[native permissions] of the `DAO` and revokes its own ownership.
-For more details visit the [`DAOFactory` reference guide entry](../../../03-reference-guide/framework/dao/DAOFactory.md).
+For more details visit the [`DAOFactory` reference guide entry](../../../03-reference-guide/framework/dao/DAOFactory.md). TODO: GIORGI
### `DAORegistry`
The `DAORegistry` is used by the `DAOFactory` and contains the `register` function
-```solidity title="@aragon/framework/dao/DAORegistry.sol"
+```solidity"
function register(
IDAO dao,
address creator,
@@ -48,8 +45,8 @@ function register(
requiring the `REGISTER_DAO_PERMISSION_ID` permission currently held only by the `DAOFactory`.
-If the requested ENS `subdomain` name [is valid](../03-ens-names.md) and not taken, the `DAORegistry` registers the subdomain and adds the `DAO` contract address to the `DAORegistry`.
+If the requested ENS `subdomain` name xref:how-it-works/framework/ens-names.md[is valid] and not taken, the `DAORegistry` registers the subdomain and adds the `DAO` contract address to the `DAORegistry`.
If the `subdomain` parameter is non-empty (not `""`) and still available, the ENS name will be registered.
If the registration was successful, the DAO name, contract and creator addresses are emitted in an event.
-For more details visit the [`DAORegistry` reference guide entry](../../../03-reference-guide/framework/dao/DAORegistry.md).
+For more details visit the [`DAORegistry` reference guide entry](../../../03-reference-guide/framework/dao/DAORegistry.md). TODO:GIORGI
diff --git a/components/osx/01-how-it-works/02-framework/03-ens-names.md b/components/osx/modules/ROOT/pages/how-it-works/framework/ens-names.adoc
similarity index 100%
rename from components/osx/01-how-it-works/02-framework/03-ens-names.md
rename to components/osx/modules/ROOT/pages/how-it-works/framework/ens-names.adoc
diff --git a/components/osx/modules/ROOT/pages/how-it-works/framework/index.adoc b/components/osx/modules/ROOT/pages/how-it-works/framework/index.adoc
new file mode 100644
index 00000000..9343596f
--- /dev/null
+++ b/components/osx/modules/ROOT/pages/how-it-works/framework/index.adoc
@@ -0,0 +1,19 @@
+= Framework - How Everything Connects
+
+=== The Infrastructure Running the Aragon OSx Protocol
+
+The Aragon OSx protocol is composed of **framework-related contracts** creating and managing the **core contracts**. This includes the
+
+- xref:how-it-works/framework/dao-creation/index.adoc[Creation of DAOs] and initial plugin configuration
+- xref:how-it-works/framework/plugin-management/index.adoc[Management of plugins] which includes the
+
+ - The setup in existing DAOs
+ - The versioning of different implementations and respective setup contracts, UI, and related metadata
+
+- xref:how-it-works/framework/ens-names.adoc[Assignment of ENS Names] to `Plugin` and `DAO` contracts created through the framework
+
+An overview of the involved contracts and their interactions is shown below:
+
+image::../../../_/images/optimized-svg/framework/aragon-os-infrastructure-core-overview.drawio.svg[align="center"]
+
+In the following sections, you will learn more about the framework-related contracts of the Aragon OSx protocol.
diff --git a/components/osx/01-how-it-works/02-framework/02-plugin-management/index.md b/components/osx/modules/ROOT/pages/how-it-works/framework/plugin-management/index.adoc
similarity index 56%
rename from components/osx/01-how-it-works/02-framework/02-plugin-management/index.md
rename to components/osx/modules/ROOT/pages/how-it-works/framework/plugin-management/index.adoc
index 61e5e63e..6b5c9789 100644
--- a/components/osx/01-how-it-works/02-framework/02-plugin-management/index.md
+++ b/components/osx/modules/ROOT/pages/how-it-works/framework/plugin-management/index.adoc
@@ -1,8 +1,6 @@
----
-title: Plugins
----
+= Plugins
-## Plugins
+=== Plugins
As mentioned earlier, plugins built by Aragon and third-party developers can be added and removed from your DAO to adapt it to your needs.
@@ -15,8 +13,6 @@ becomes as streamlined as possible.
In the following, we learn what a plugin consists of.
-
-
### What Does a Plugin Consist Of?
An Aragon OSx Plugin consists of:
@@ -36,18 +32,13 @@ An Aragon OSx Plugin consists of:
- Release number
- Build number
-A detailed explanation of the [build and release versioning](../../../02-how-to-guides/02-plugin-development/07-publication/01-versioning.md) is found in the How-to sections in our developer portal.
-
-
- A schematic depiction of a plugin bundle consisting of a version tag, the plugin setup contract pointing to the plugin implementation contract, and a metadata URI.
-
+A detailed explanation of the xref:how-to-guides/plugin-development/publication/versioning.adoc[build and release versioning] is found in the How-to sections in our developer portal.
-
+image::../../../../_/images/optimized-svg/plugins/plugin-version.drawio.svg[align="center"]
-The `PluginSetup` is written by you, the plugin developer. The processing of the setup is managed by the `PluginSetupProcessor`, the central component of the setup process in the Aragon OSx framework, which is explained in the section [The Plugin Setup Process](./02-plugin-setup/index.md).
+The `PluginSetup` is written by you, the plugin developer. The processing of the setup is managed by the `PluginSetupProcessor`,
+the central component of the setup process in the Aragon OSx framework, which is explained
+in the section xref:how-it-works/framework/plugin-management/plugin-setup/index.adoc[The Plugin Setup Process].
-Each plugin with its different builds and releases is versioned inside its own plugin repositories in a `PluginRepo` contract, which is explained in the next section.
+Each plugin with its different builds and releases is versioned inside its own plugin repositories in a `PluginRepo` contract,
+which is explained in the next section.
diff --git a/components/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/index.md b/components/osx/modules/ROOT/pages/how-it-works/framework/plugin-management/plugin-repo/index.adoc
similarity index 60%
rename from components/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/index.md
rename to components/osx/modules/ROOT/pages/how-it-works/framework/plugin-management/plugin-repo/index.adoc
index a8eb9f55..a9cff02e 100644
--- a/components/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/index.md
+++ b/components/osx/modules/ROOT/pages/how-it-works/framework/plugin-management/plugin-repo/index.adoc
@@ -1,8 +1,6 @@
----
-title: Plugin Repositories
----
+= Plugin Repositories
-## What are Plugin Repositories?
+=== What are Plugin Repositories?
Each plugin has its own Plugin Repository, unique ENS name, and on-chain repository contract, the `PluginRepo`, in which different versions of the plugin are stored for reference using version tags constituted by a **release** and **build** number.
@@ -12,26 +10,24 @@ Different versions might contain:
- new features
- breaking changes
-`PluginRepo` contracts themselves, each associated with a different plugin, are registered in the Aragon OSx [`PluginRepoRegistry`](./01-plugin-repo-creation.md#the-pluginreporegistry-contract) and carry their own [ENS name](../../03-ens-names.md) that the creator chooses. The [`PluginRepoRegistry` contract](./01-plugin-repo-creation.md#the-pluginreporegistry-contract) is described in the upcoming subsection.
+`PluginRepo` contracts themselves, each associated with a different plugin, are registered in the Aragon
+OSx xref:how-it-works/framework/plugin-management/plugin-repo/plugin-repo-creation.adoc#the_pluginreporegistry_contract[PluginRepoRegistry]
+and carry their own xrex:how-it-works/framework/ens-names.adoc[ENS name] that the creator chooses.
+The xref:how-it-works/framework/plugin-management/plugin-repo/plugin-repo-creation.adoc#the_pluginreporegistry_contract[PluginRepoRegistry] is described in the upcoming subsection.
-
+image::../../../../../_/images/optimized-svg/plugins/plugin-repo-overview.drawio.svg[align="center"]
-![Schematic depiction of the versioning taking place in the PluginRepoRegistry.](/optimized-svg/plugins/plugin-repo-overview.drawio.svg)
-
-
- Overview of the plugin versioning and registry in the Aragon OSx protocol. The `PluginRepoRegistry` contract, which is a curated list of ENS named `PluginRepo` contracts, is shown on the left. Each `PluginRepo` contract maintains a list of versions of the `PluginSetup` contract (internally referencing the `Plugin` implementation contract) and the associated UI building blocks as a URI, exemplarily shown on the right.
-
-
-
### The `PluginRepo` Contract
The `PluginRepo` contract versions the releases of a `Plugin`. The first version of a plugin is always published as release 1 and build 1 (version tag `1.1`).
-When you publish the first plugin version, a new plugin repository is automatically created for you by the Aragon OSx protocol in which you are the maintainer. The creation process is described in the [plugin repo creation process](./01-plugin-repo-creation.md) section.
+When you publish the first plugin version, a new plugin repository is automatically created for you by the Aragon OSx protocol in which you are the maintainer.
+The creation process is described in the xref:how-it-works/framework/plugin-management/plugin-repo/plugin-repo-creation.adoc[plugin repo creation process] section.
-The `PluginRepo` contract is [UUPS upgradeable](https://eips.ethereum.org/EIPS/eip-1822), inherits from the [`PermissionManager`](../../../01-core/02-permissions/index.md) and allows the maintainer of the repository to create new versions with the `createVersion` function:
+The `PluginRepo` contract is link:https://eips.ethereum.org/EIPS/eip-1822[UUPS upgradeable], inherits from the xref:how-it-works/core/permissions/index.adoc[PermissionManager]
+and allows the maintainer of the repository to create new versions with the `createVersion` function:
-```solidity title="@aragon/framework/repo/PluginRepo.sol"
+```solidity"
/// @notice Creates a new plugin version as the latest build for an existing release number or the first build for a new release number for the provided `PluginSetup` contract address and metadata.
/// @param _release The release number.
/// @param _pluginSetupAddress The address of the plugin setup contract.
@@ -52,6 +48,6 @@ The function receives four input arguments:
3. The `_buildMetadata` URI pointing to a JSON file containing the UI data, setup data, and change description for this specific version.
4. The `_releaseMetadata` URI pointing to a JSON file containing the plugin name, description, as well as optional data such as images to be shown in the aragonApp frontend.
-Other functions present in the contract allow you to query previous versions and to update the release metadata. For more details visit the [`PluginRepo` reference guide entry](../../../../03-reference-guide/framework/plugin/repo/PluginRepo.md).
+Other functions present in the contract allow you to query previous versions and to update the release metadata. For more details visit the [`PluginRepo` reference guide entry](../../../../03-reference-guide/framework/plugin/repo/PluginRepo.md). TODO:GIORGI
-The `PluginRepo` is created for you when you publish the `PluginSetup` contract of your first version to the Aragon OSx protocol, which is explained in the next section: [The Plugin Repo Creation Process](01-plugin-repo-creation.md).
+The `PluginRepo` is created for you when you publish the `PluginSetup` contract of your first version to the Aragon OSx protocol.
\ No newline at end of file
diff --git a/components/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/01-plugin-repo-creation.md b/components/osx/modules/ROOT/pages/how-it-works/framework/plugin-management/plugin-repo/plugin-repo-creation.adoc
similarity index 57%
rename from components/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/01-plugin-repo-creation.md
rename to components/osx/modules/ROOT/pages/how-it-works/framework/plugin-management/plugin-repo/plugin-repo-creation.adoc
index dcb875a8..25539e13 100644
--- a/components/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/01-plugin-repo-creation.md
+++ b/components/osx/modules/ROOT/pages/how-it-works/framework/plugin-management/plugin-repo/plugin-repo-creation.adoc
@@ -1,26 +1,19 @@
----
-title: Publishing a Plugin
----
+= Publishing a Plugin
-## Start publishing your Plugin by creating a PluginRepo
+=== Start publishing your Plugin by creating a PluginRepo
To be available for installation in the Aragon OSx framework, a `PluginRepo` must be created for each plugin. The `PluginRepo` creation process is handled by:
-- The [`PluginRepoFactory`](../../../../03-reference-guide/framework/plugin/repo/PluginRepoFactory.md): who creates the `PluginRepo` instance for each plugin to hold all plugin versions
-- The [`PluginRepoRegistry`](../../../../03-reference-guide/framework/plugin/repo/PluginRepoRegistry.md): who registers the Plugin into the Protocol for DAOs to install.
-
-
+- The TODO:GIORGI [`PluginRepoFactory`](../../../../03-reference-guide/framework/plugin/repo/PluginRepoFactory.md): who creates the `PluginRepo` instance for each plugin to hold all plugin versions
+- The TODO:GIORGI [`PluginRepoRegistry`](../../../../03-reference-guide/framework/plugin/repo/PluginRepoRegistry.md): who registers the Plugin into the Protocol for DAOs to install.
### The `PluginRepoFactory` Contract
-The `PluginRepoFactory` is the contract in charge of creating the first version of a plugin. It does this through the `createPluginRepoWithFirstVersion` function which creates a `PluginRepo` instance for the plugin with the first release and first build (`v1.1`).
+The `PluginRepoFactory` is the contract in charge of creating the first version of a plugin. It does this through
+the `createPluginRepoWithFirstVersion` function which creates a `PluginRepo` instance for the plugin with the first release
+and first build (`v1.1`).
-```solidity title="@aragon/framework/repo/PluginRepoFactory.sol"
+```solidity"
/// @notice Creates and registers a `PluginRepo` with an ENS subdomain and publishes an initial version `1.1`.
/// @param _subdomain The plugin repository subdomain.
/// @param _pluginSetup The plugin factory contract associated with the plugin version.
@@ -37,20 +30,20 @@ function createPluginRepoWithFirstVersion(
) external returns (PluginRepo pluginRepo);
```
-It also registers the plugin in the Aragon OSx `PluginRepoRegistry`contract with an [ENS subdomain](../../03-ens-names.md) under the `plugin.dao.eth` domain managed by Aragon.
+It also registers the plugin in the Aragon OSx `PluginRepoRegistry`contract with an xref:how-it-works/framework/ens-names.adoc[ENS subdomain] under the `plugin.dao.eth` domain managed by Aragon.
-Additional to the information required by the [`createVersion` function discussed earlier](./index.md#the-pluginrepo-contract), it receives:
+Additional to the information required by the xref:how-it-works/framework/plugin-management/plugin-repo/plugin-repo-creation.adoc#the-pluginrepo-contract[`createVersion` function discussed earlier], it receives:
- A valid ENS `_subdomain` unique name composed of letters from a-z, all in lower caps, separated by a `-`. For ex: `token-voting-plugin`.
- The address of the plugin repo maintainer who ends up having the `ROOT_PERMISSION_ID`, `MAINTAINER_PERMISSION_ID`, and `UPGRADE_REPO_PERMISSION_ID` permissions. These permissions enable the maintainer to call the internal `PermissionManager`, the `createVersion` and `updateReleaseMetadata` functions as well as upgrading the plugin contract.
-For more details visit the [`PluginRepoFactory` Reference Guide entry](../../../../03-reference-guide/framework/plugin/repo/PluginRepoFactory.md).
+For more details visit the TODO:GIORGI [`PluginRepoFactory` Reference Guide entry](../../../../03-reference-guide/framework/plugin/repo/PluginRepoFactory.md).
### The `PluginRepoRegistry` Contract
The `PluginRepoRegistry` contract is the central contract listing all the plugins managed through the Aragon OSx protocol. The `PluginRepoFactory` calls on the `PluginRepoRegistry` to register the plugin in the Aragon OSx protocol.
-```solidity title="@aragon/framework/PluginRepoRegistry.sol"
+```solidity"
/// @notice Registers a plugin repository with a subdomain and address.
/// @param subdomain The subdomain of the PluginRepo.
/// @param pluginRepo The address of the PluginRepo contract.
@@ -62,4 +55,4 @@ address pluginRepo
}
```
-For more details visit the [`PluginRepoRegistry` reference guide entry](../../../../03-reference-guide/framework/plugin/repo/PluginRepoRegistry.md).
+For more details visit the TODO:GIORGI [`PluginRepoRegistry` reference guide entry](../../../../03-reference-guide/framework/plugin/repo/PluginRepoRegistry.md).
diff --git a/components/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/index.md b/components/osx/modules/ROOT/pages/how-it-works/framework/plugin-management/plugin-setup/index.adoc
similarity index 59%
rename from components/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/index.md
rename to components/osx/modules/ROOT/pages/how-it-works/framework/plugin-management/plugin-setup/index.adoc
index c8d164e9..c0b4c921 100644
--- a/components/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/index.md
+++ b/components/osx/modules/ROOT/pages/how-it-works/framework/plugin-management/plugin-setup/index.adoc
@@ -1,36 +1,45 @@
----
-title: Installing Plugins
----
+= Installing Plugins
-## The Smart Contracts Behind Plugins
+=== The Smart Contracts Behind Plugins
A DAO can be set up and customized by the **installation, update, and uninstallation** of plugins. Plugins are composed of two key contracts:
- **Plugin contract:** contains the plugin's implementation logic; everything needed to extend the functionality for DAOs.
- **Plugin Setup contract:** contains the instructions needed to install, update, and uninstall the plugin into the DAO. This is done through granting or revoking permissions, enabling plugins to perform actions within the scope of the DAO.
-![Aragon OSx Plugins](/img/plugins/what_is_a_plugin.png)
+
+image::../../../../../_/images/img/plugins/what_is_a_plugin.png[align="center"]
+
How this works:
- Although a Plugin is composed by the `Plugin` and `PluginSetup` contracts, the Aragon OSx protocol only knows of the `PluginSetup` contract.
-- Since the `PluginSetup` contract is the one containing the plugin installation instructions, it is the one in charge of deploying the Plugin instance. Each plugin instance is specific to that DAO, deployed with its own unique parameters. You can review how to build a `PluginSetup` contract [here](../../../../02-how-to-guides/02-plugin-development/index.md).
+- Since the `PluginSetup` contract is the one containing the plugin installation instructions, it is the one in charge of deploying the Plugin instance. Each plugin instance is specific to that DAO, deployed with its own unique parameters.
+You can review how to build a `PluginSetup` contract xref:how-to-guides/plugin-development/index.adoc[here].
- The `PluginSetup` contract then interacts with the Aragon OSx framework's `PluginSetupProcessor` contract, which is in charge of applying the installation, update, or uninstallation of a plugin into a DAO.
-- Publishing a Plugin into the Aragon OSx protocol is done through creating the first version of the plugin's `PluginRepo`. The plugin's `PluginRepo` instance stores all plugin versions. You can read more about that [here](../../../../02-how-to-guides/02-plugin-development/07-publication/index.md).
+- Publishing a Plugin into the Aragon OSx protocol is done through creating the first version of the plugin's `PluginRepo`. The plugin's `PluginRepo` instance stores all plugin versions.
+You can read more about that xref:how-to-guides/plugin-development/publication/index.adoc[here].
- Except for the gas costs required, plugins are completely free to install, unless decided otherwise by the developer.
### How are Plugins installed in DAOs?
The `PluginSetup` processing is **security critical** because the permissions it handles are granted to third-party contracts.
-**Safety is our top priority in the design of the whole protocol.** We want to make sure that the DAO members know exactly what permissions are granted to whom before any processing takes place.
+**Safety is our top priority in the design of the whole protocol.** We want to make sure that the DAO members know exactly what
+permissions are granted to whom before any processing takes place.
This is why we see the installation process in two phases:
-1. **Preparation:** Defining the parameters to be set on the new plugin instance and helpers, as well as requesting the permissions needed for it to work properly. The `PluginSetup` contains the setup script where developers can perform any unprivileged operations. These will need a privileged confirmation in the next step.
-2. **Application:** The granting or revoking of the plugin's requested permissions (based on the preparation step above). This is a privileged action performed by Aragon's `PluginSetupProcessor` (you can understand it as the "installer"), so that the plugin becomes effectively installed or uninstalled. It gets executed whenever someone with `ROOT` privileges on the DAO applies it (most likely through a proposal).
+1. **Preparation:** Defining the parameters to be set on the new plugin instance and helpers, as well as requesting the permissions needed for it to work properly.
+The `PluginSetup` contains the setup script where developers can perform any unprivileged operations. These will need a privileged
+confirmation in the next step.
+2. **Application:** The granting or revoking of the plugin's requested permissions (based on the preparation step above).
+This is a privileged action performed by Aragon's `PluginSetupProcessor` (you can understand it as the "installer"),
+so that the plugin becomes effectively installed or uninstalled. It gets executed whenever someone with `ROOT` privileges on
+the DAO applies it (most likely through a proposal).
-The `PluginSetupProcessor` is the Aragon contract in charge of invoking the `prepareInstallation()` function from your plugin's `PluginSetup` contract and use it to prepare the installation and (eventually) apply it once it has been approved by the DAO.
+The `PluginSetupProcessor` is the Aragon contract in charge of invoking the `prepareInstallation()` function from your plugin's `PluginSetup`
+contract and use it to prepare the installation and (eventually) apply it once it has been approved by the DAO.
#### What happens during the Plugin Preparation?
@@ -40,7 +49,8 @@ The preparation of a `PluginSetup` contract proceeds as follows:
2. The DAO builder defines the parameters and settings that he/she wants for their DAO. Depending on the case, the `prepareInstallation`, `prepareUpdate`, or `prepareUninstallation` method in the `PluginSetup` contract is called through the `PluginSetupProcessor` (and creates a unique setup ID).
-3. The [`PluginSetup`](https://github.com/aragon/osx/blob/e24d9fa3bd6d5a4c9f5936c14ccda1fe9886c2b0/packages/contracts/src/framework/plugin/setup/PluginSetup.sol) contract deploys all the contracts and gathers addresses and other input arguments required for the installation/uninstallation/upgrade instructions. This can include:
+3. The link:https://github.com/aragon/osx/blob/e24d9fa3bd6d5a4c9f5936c14ccda1fe9886c2b0/packages/contracts/src/framework/plugin/setup/PluginSetup.sol[[`PluginSetup`]] contract deploys all the contracts
+and gathers addresses and other input arguments required for the installation/uninstallation/upgrade instructions. This can include:
- deployment of new contracts
- initialization of new storage variables
@@ -48,22 +58,17 @@ The preparation of a `PluginSetup` contract proceeds as follows:
- governance settings or other attributes
- ...
- Because the addresses of all associated contracts are now known, a static permission list can be emitted, hashed, and stored on-chain.
+Because the addresses of all associated contracts are now known, a static permission list can be emitted, hashed, and stored on-chain.
4. Once the Plugin installation has been prepared, we use it as the parameter of the `applyInstallation()` action. Once encoded, this action is what must be added to the `Action[]` array of the installation proposal. That way, when the proposal passes, the action becomes executable and the plugin can be installed in the DAO using the parameters defined in the prepare installation process. For a plugin to be installed, it needs to be approved by the governance mechanism (plugin) of the organization, passed as the encoded action of a proposal, and executed by a signer.
-:::info
-The governance plugin can be a simple majority vote, an optimistic process or an admin governance plugin that does not involve a waiting period. It can be any governance mechanism existing within the DAO which has access to the DAO's `execute` permission.
-:::
+TIP: The governance plugin can be a simple majority vote, an optimistic process or an admin governance plugin that does not involve a waiting period. It can be any governance mechanism existing within the DAO which has access to the DAO's `execute` permission.
This gives the DAO members the opportunity to check which permissions the `PluginSetup` contract request before granting/revoking them.
-Plugin setup proposals must be carefully examined as they can be a potential security risk if the `PluginSetup` contract comes from an untrusted source. To learn more visit the [Security](./01-security-risk-mitigation.md) section.
-
-
#### What happens during the Preparation Application?
@@ -79,20 +84,15 @@ This is processed as follows:
3. If the hash is valid, the list is processed and `PluginSetupProcessor` conducts the requested sequence of `grant`, `grantWithCondition` and `revoke` calls on the owning DAO.
Finally, the `PluginSetupProcessor` asks the DAO to revoke the `ROOT_PERMISSION_ID` permission from itself.
-:::info
-The two-step setup procedure in Aragon OSx is not limited to the setup of only one plugin — you can **setup multiple plugins at once** by first preparing them in a single proposal and then processing the entire setup sequence in one transaction. This is powerful and allows you to **transform your entire DAO in one proposal**, for example, to install a new governance plugin (e.g., a gasless ZK-vote) and finance plugin (e.g., to stream loans to your members), while uninstalling your old ERC20 token vote in one go.
-:::
+TIP: The two-step setup procedure in Aragon OSx is not limited to the setup of only one plugin — you can **setup multiple plugins at once**
+by first preparing them in a single proposal and then processing the entire setup sequence in one transaction. This is powerful and
+allows you to **transform your entire DAO in one proposal**, for example, to install a new governance plugin (e.g., a gasless ZK-vote) and finance plugin (e.g., to stream loans to your members), while uninstalling your old ERC20 token vote in one go.
In the next sections, you will learn about how plugins are curated on Aragon's repository.
-
-**a.** ![Schematic depiction of the plugin installation process.](/optimized-svg/plugins/plugin-installation.drawio.svg)
-**b.** ![Schematic depiction of the plugin update process.](/optimized-svg/plugins/plugin-update.drawio.svg)
-**c.** ![Schematic depiction of the plugin uninstallation process.](/optimized-svg/plugins/plugin-uninstallation.drawio.svg)
+image::../../../../../_/images/optimized-svg/plugins/plugin-installation.drawio.svg[align="center"]
+image::../../../../../_/images/optimized-svg/plugins/plugin-update.drawio.svg[align="center"]
+image::../../../../../_/images/optimized-svg/plugins/plugin-uninstallation.drawio.svg[align="center"]
-
- Simplified overview of the two-transaction plugin a. installation, b. update, and c. uninstallation process with the involved contracts as rounded rectangles, interactions between them as arrows, and relations as dashed lines. The first and second transaction are distinguished by numbering as well as solid and dotted lines, respectively.
-
-
diff --git a/components/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/01-security-risk-mitigation.md b/components/osx/modules/ROOT/pages/how-it-works/framework/plugin-management/plugin-setup/security-risk-mitigation.adoc
similarity index 100%
rename from components/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/01-security-risk-mitigation.md
rename to components/osx/modules/ROOT/pages/how-it-works/framework/plugin-management/plugin-setup/security-risk-mitigation.adoc
diff --git a/components/osx/modules/ROOT/pages/how-it-works/index.adoc b/components/osx/modules/ROOT/pages/how-it-works/index.adoc
new file mode 100644
index 00000000..0cb242eb
--- /dev/null
+++ b/components/osx/modules/ROOT/pages/how-it-works/index.adoc
@@ -0,0 +1,25 @@
+== How It Works
+
+
+## The Aragon OSx DAO Framework
+
+The Aragon OSx protocol is a DAO framework structured as follows:
+
+image::../../_/images/aragon-os-framework-overview.drawio.svg[align="center"]
+
+Overview of the Aragon OSx protocol with its structural components and their responsibilities: the governance layer constituted by the framework DAO, the code layer including the framework and core contracts, which depends on external libraries and services
+
+### Code Layer
+
+The foundation of the Aragon OSx protocol is the **code layer** constituted by the core and framework related contracts.
+The xref:how-it-works/core/index.adoc[core contracts] provide the core primitives intended to be used by users and implemented by developers of the DAO framework.
+The xref:how-it-works/framework/index.adoc[framework contracts] provide the infrastructure to easily create and manage your DAOs and plugins easy.
+Both are built on top of external dependencies, most notably the link:https://www.openzeppelin.com/contracts[OpenZeppelin] and the link:https://docs.ens.domains/[Ethereum Name Service (ENS)] contracts.
+
+The core and framework contracts are free to use, and no additional fees are charged.
+
+### Governance Layer
+
+To govern the framework infrastructure, an Aragon OSx [Framework DAO](./03-framwork-dao.md) is deployed constituting the **governance layer** of the Aragon OSx protocol.
+
+In the next sections, you will learn more about the individual components of the framework.
diff --git a/components/osx/02-how-to-guides/01-dao/02-action-execution.md b/components/osx/modules/ROOT/pages/how-to-guides/dao/action-execution.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/01-dao/02-action-execution.md
rename to components/osx/modules/ROOT/pages/how-to-guides/dao/action-execution.adoc
diff --git a/components/osx/02-how-to-guides/01-dao/01-best-practices.md b/components/osx/modules/ROOT/pages/how-to-guides/dao/best-practices.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/01-dao/01-best-practices.md
rename to components/osx/modules/ROOT/pages/how-to-guides/dao/best-practices.adoc
diff --git a/components/osx/02-how-to-guides/01-dao/index.md b/components/osx/modules/ROOT/pages/how-to-guides/dao/index.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/01-dao/index.md
rename to components/osx/modules/ROOT/pages/how-to-guides/dao/index.adoc
diff --git a/components/osx/02-how-to-guides/01-dao/04-managing-plugins/index.md b/components/osx/modules/ROOT/pages/how-to-guides/dao/managing-plugins.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/01-dao/04-managing-plugins/index.md
rename to components/osx/modules/ROOT/pages/how-to-guides/dao/managing-plugins.adoc
diff --git a/components/osx/02-how-to-guides/01-dao/03-protocol-upgrades.md b/components/osx/modules/ROOT/pages/how-to-guides/dao/protocol-upgrades.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/01-dao/03-protocol-upgrades.md
rename to components/osx/modules/ROOT/pages/how-to-guides/dao/protocol-upgrades.adoc
diff --git a/components/osx/02-how-to-guides/index.md b/components/osx/modules/ROOT/pages/how-to-guides/index.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/index.md
rename to components/osx/modules/ROOT/pages/how-to-guides/index.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/01-best-practices.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/best-practices.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/01-best-practices.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/best-practices.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/index.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/governance-plugins/index.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/index.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/governance-plugins/index.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/02-membership.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/governance-plugins/membership.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/02-membership.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/governance-plugins/membership.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/01-proposals.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/governance-plugins/proposals.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/01-proposals.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/governance-plugins/proposals.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/index.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/index.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/index.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/index.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/06-meta-tx-plugins.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/meta-tx-plugins.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/06-meta-tx-plugins.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/meta-tx-plugins.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/02-implementation.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/non-upgradeable-plugin/implementation.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/02-implementation.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/non-upgradeable-plugin/implementation.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/index.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/non-upgradeable-plugin/index.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/index.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/non-upgradeable-plugin/index.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/01-initialization.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/non-upgradeable-plugin/initialization.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/01-initialization.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/non-upgradeable-plugin/initialization.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/03-setup.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/non-upgradeable-plugin/setup.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/03-setup.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/non-upgradeable-plugin/setup.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/02-plugin-types.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/plugin-types.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/02-plugin-types.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/plugin-types.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/07-publication/index.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/publication/index.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/07-publication/index.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/publication/index.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/07-publication/02-metadata.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/publication/metadata.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/07-publication/02-metadata.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/publication/metadata.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/07-publication/01-versioning.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/publication/versioning.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/07-publication/01-versioning.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/publication/versioning.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/02-implementation.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/upgradeable-plugin/implementation.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/02-implementation.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/upgradeable-plugin/implementation.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/index.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/upgradeable-plugin/index.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/index.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/upgradeable-plugin/index.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/01-initialization.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/upgradeable-plugin/initialization.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/01-initialization.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/upgradeable-plugin/initialization.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/03-setup.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/upgradeable-plugin/setup.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/03-setup.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/upgradeable-plugin/setup.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/04-subsequent-builds.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/upgradeable-plugin/subsequent-builds.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/04-subsequent-builds.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/upgradeable-plugin/subsequent-builds.adoc
diff --git a/components/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/05-updating-versions.md b/components/osx/modules/ROOT/pages/how-to-guides/plugin-development/upgradeable-plugin/updating-versions.adoc
similarity index 100%
rename from components/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/05-updating-versions.md
rename to components/osx/modules/ROOT/pages/how-to-guides/plugin-development/upgradeable-plugin/updating-versions.adoc
diff --git a/components/osx/index.md b/components/osx/modules/ROOT/pages/index.adoc
similarity index 56%
rename from components/osx/index.md
rename to components/osx/modules/ROOT/pages/index.adoc
index 29ce22a1..0ce79046 100644
--- a/components/osx/index.md
+++ b/components/osx/modules/ROOT/pages/index.adoc
@@ -1,8 +1,4 @@
----
-title: Aragon OSx
-sidebar_label: Introduction
-sidebar_position: 0
----
+= Aragon OSx
## The Contracts Behind the Protocol
@@ -26,7 +22,7 @@ To facilitate this, Aragon OSx runs a set of **framework contracts**:
## Getting Started
-Users interact with the Aragon OSx protocol through the [Aragon App](https://app.aragon.org), the [Aragon SDK](https://devs.aragon.org/docs/sdk), or directly calling on the [protocol contracts](https://github.com/aragon/osx) - as well as through any third-party projects built using our stack.
+Users interact with the Aragon OSx protocol through the link:https://app.aragon.org[Aragon App], link:https://devs.aragon.org/docs/sdk[Aragon SDK] or directly calling on the link:https://github.com/aragon/osx[protocol contracts] - as well as through any third-party projects built using our stack.
To **add the contracts to your project**, open a terminal in the root folder of your Solidity project and run:
@@ -36,16 +32,35 @@ yarn add @aragon/osx
Then, to use the contracts within your project, **import the contracts** through something like:
-
+```solidity
+// contracts/Box.sol
+// SPDX-License-Identifier: MIT
+pragma solidity ^0.8.0;
-```solidity title="MyCoolPlugin.sol"
-// SPDX-License-Identifier: AGPL-3.0-or-later
-pragma solidity 0.8.21;
+// Import Auth from the access-control subdirectory
+import "./access-control/Auth.sol";
-import {Plugin, IDAO} from '@aragon/osx/core/plugin/Plugin.sol';
+contract Box {
+ uint256 private _value;
+ Auth private _auth;
-contract MyCoolPlugin is Plugin {
- // ...
+ event ValueChanged(uint256 value);
+
+ constructor() {
+ _auth = new Auth(msg.sender);
+ }
+
+ function store(uint256 value) public {
+ // Require that the caller is registered as an administrator in Auth
+ require(_auth.isAdministrator(msg.sender), "Unauthorized");
+
+ _value = value;
+ emit ValueChanged(value);
+ }
+
+ function retrieve() public view returns (uint256) {
+ return _value;
+ }
}
```
@@ -53,12 +68,12 @@ contract MyCoolPlugin is Plugin {
DAO Plugins are the best way to customize your DAO. These are modular extendable pieces of software which you can install or uninstall from your DAO as it evolves and grows.
-To learn more about plugins, check out our guide [here](./02-how-to-guides/02-plugin-development/index.md).
+To learn more about plugins, check out our guide xref:how-to-guides/plugin-development/index.adoc[here].
### Walkthrough
This documentation is divided into conceptual and practical sections as well as the reference guide.
-- Conceptual [How It Works articles](01-how-it-works/index.md) explain the architecture behind our protocol.
-- Practical [How-to Guides](02-how-to-guides/index.md) explain how to use and leverage our protocol.
-- The [Reference Guide](03-reference-guide/index.md) generated from the NatSpec comments of the latest `@aragon/osx` release documents each individual Solidity contract, function, and variable.
+- Conceptual xref:how-it-works/index.adoc[How It Works articles] explain the architecture behind our protocol.
+- Practical xref:how-to-guides/index.adoc[How-to Guides] explain how to use and leverage our protocol.
+- The TODO:GIORGI [Reference Guide](03-reference-guide/index.md) generated from the NatSpec comments of the latest `@aragon/osx` release documents each individual Solidity contract, function, and variable.
diff --git a/package.json b/package.json
index 0df444ef..4c47cd92 100644
--- a/package.json
+++ b/package.json
@@ -3,12 +3,6 @@
"version": "0.0.0",
"private": true,
"scripts": {
- "docusaurus": "docusaurus",
- "start": "docusaurus start",
- "swizzle": "docusaurus swizzle",
- "deploy": "docusaurus deploy",
- "clear": "docusaurus clear",
- "serve": "docusaurus serve",
"build": "bash scripts/build.sh --fetch playbook.yml",
"build:no-fetch": "bash scripts/build.sh playbook.yml",
"build:local": "bash scripts/build.sh playbook-local-only.yml",
@@ -20,29 +14,6 @@
"lint": "eslint '*/**/*.{js,ts,tsx}' --quiet --fix"
},
"dependencies": {
- "@aragon/ui-components": "0.1.3",
- "@cmfcmf/docusaurus-search-local": "^1.1.0",
- "@docusaurus/core": "^3.1.1",
- "@docusaurus/plugin-google-gtag": "^3.1.1",
- "@docusaurus/plugin-google-tag-manager": "^3.1.1",
- "@docusaurus/preset-classic": "^3.1.1",
- "@mantine/hooks": "^7.5.2",
- "@mdx-js/react": "^3.0.1",
- "autoprefixer": "^10.4.7",
- "clsx": "^2.1.0",
- "docusaurus-tailwindcss": "^0.1.0",
- "dotenv": "^16.4.5",
- "ethers": "^5.6.9",
- "hast-util-is-element": "3.0.0",
- "postcss": "^8.4.14",
- "prism-react-renderer": "^2.3.0",
- "react": "^18.2.0",
- "react-dom": "^18.2.0",
- "rehype-katex": "^7.0.0",
- "remark-math": "^6.0.0",
- "styled-components": "^6.1.9",
- "svgo": "^3.2.0",
- "tailwindcss": "^3.4.1",
"@antora/lunr-extension": "^1.0.0-alpha.8",
"antora": "^3.0.0",
"glob": "^7.1.4",
@@ -52,17 +23,6 @@
"yarn": "^1.19.1"
},
"devDependencies": {
- "@docusaurus/module-type-aliases": "^3.1.1",
- "@docusaurus/tsconfig": "3.1.1",
- "@typescript-eslint/eslint-plugin": "^5.48.1",
- "@typescript-eslint/parser": "^5.48.1",
- "eslint": "^8.24.0",
- "eslint-config-prettier": "^8.5.0",
- "eslint-plugin-prettier": "^4.2.1",
- "eslint-plugin-react": "^7.31.8",
- "prettier": "^3.2.5",
- "prettier-plugin-solidity": "^1.3.1",
- "typescript": "^5.3.3",
"fgbg": "^0.1.5",
"live-server": "^1.2.1",
"nodemon": "^2.0.6",
diff --git a/playbook.yml b/playbook.yml
index 3561505e..dcacdaa2 100644
--- a/playbook.yml
+++ b/playbook.yml
@@ -7,6 +7,9 @@ site:
gtm: 'GTM-W9X5Q6F'
content:
sources:
+ - url: .
+ branches: feature/new-way
+ start_path: components/home
- url: .
branches: feature/new-way
start_path: components/osx
diff --git a/ui/node_modules/.yarn-integrity b/ui/node_modules/.yarn-integrity
index 320e991b..45fc9cf7 100644
--- a/ui/node_modules/.yarn-integrity
+++ b/ui/node_modules/.yarn-integrity
@@ -27,9 +27,9 @@
"fromentries@^1.3.2",
"glob@^7.1.7",
"handlebars@^4.7.7",
- "highlight.js@^11.6.0",
+ "highlight.js@^11.10.0",
"highlightjs-cairo@^0.4.0",
- "highlightjs-solidity@^2.0.5",
+ "highlightjs-solidity@^2.0.6",
"live-server@^1.2.2",
"lodash.debounce@^4.0.8",
"rimraf@^3.0.2",
@@ -367,9 +367,9 @@
"has-values@^1.0.0": "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f",
"hasown@^2.0.0": "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003",
"hasown@^2.0.2": "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003",
- "highlight.js@^11.6.0": "https://registry.yarnpkg.com/highlight.js/-/highlight.js-11.10.0.tgz#6e3600dc4b33d6dc23d5bd94fbf72405f5892b92",
+ "highlight.js@^11.10.0": "https://registry.yarnpkg.com/highlight.js/-/highlight.js-11.10.0.tgz#6e3600dc4b33d6dc23d5bd94fbf72405f5892b92",
"highlightjs-cairo@^0.4.0": "https://registry.yarnpkg.com/highlightjs-cairo/-/highlightjs-cairo-0.4.0.tgz#c7b0e45b8c3f61a77a2235ecb00b55c3cb3b9be1",
- "highlightjs-solidity@^2.0.5": "https://registry.yarnpkg.com/highlightjs-solidity/-/highlightjs-solidity-2.0.6.tgz#e7a702a2b05e0a97f185e6ba39fd4846ad23a990",
+ "highlightjs-solidity@^2.0.6": "https://registry.yarnpkg.com/highlightjs-solidity/-/highlightjs-solidity-2.0.6.tgz#e7a702a2b05e0a97f185e6ba39fd4846ad23a990",
"http-auth@3.1.x": "https://registry.yarnpkg.com/http-auth/-/http-auth-3.1.3.tgz#945cfadd66521eaf8f7c84913d377d7b15f24e31",
"http-errors@^2.0.0": "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3",
"http-errors@~1.6.2": "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d",
diff --git a/ui/package.json b/ui/package.json
index 3263fc52..3111fd56 100644
--- a/ui/package.json
+++ b/ui/package.json
@@ -30,8 +30,6 @@
"fromentries": "^1.3.2",
"glob": "^7.1.7",
"handlebars": "^4.7.7",
- "highlight.js": "^11.6.0",
- "highlightjs-solidity": "^2.0.5",
"highlightjs-cairo": "^0.4.0",
"live-server": "^1.2.2",
"lodash.debounce": "^4.0.8",
@@ -42,5 +40,9 @@
"sass": "^1.34.1",
"server-destroy": "^1.0.1",
"yaml": "^2.2.2"
+ },
+ "dependencies": {
+ "highlight.js": "^11.10.0",
+ "highlightjs-solidity": "^2.0.6"
}
}
diff --git a/ui/src/js/04-page.js b/ui/src/js/04-page.js
index 62a0eaed..051d6fe7 100644
--- a/ui/src/js/04-page.js
+++ b/ui/src/js/04-page.js
@@ -67,7 +67,7 @@
title.classList.add('toc-title');
// title.textContent = 'On This Page';
var elTitle = document.querySelector('main .article-wrapper h1');
- title.textContent = elTitle.textContent;
+ title.textContent = elTitle?.textContent || 'On This Page'
menu.appendChild(title);
menu.appendChild(list);
diff --git a/ui/src/js/highlight.js b/ui/src/js/highlight.js
index d398db3b..b3eda484 100644
--- a/ui/src/js/highlight.js
+++ b/ui/src/js/highlight.js
@@ -10,4 +10,4 @@ hljs.registerLanguage('shell', require('highlight.js/lib/languages/shell'));
hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml'));
require('highlightjs-solidity')(hljs);
require('highlightjs-cairo')(hljs);
-hljs.initHighlightingOnLoad();
+hljs.highlightAll();
\ No newline at end of file
diff --git a/ui/theme/dist/index.js b/ui/theme/dist/index.js
index acd21a84..138baef2 100644
--- a/ui/theme/dist/index.js
+++ b/ui/theme/dist/index.js
@@ -1,2 +1,2 @@
-!function(){"use strict";function e(n){return n instanceof Map?n.clear=n.delete=n.set=function(){throw new Error("map is read-only")}:n instanceof Set&&(n.add=n.clear=n.delete=function(){throw new Error("set is read-only")}),Object.freeze(n),Object.getOwnPropertyNames(n).forEach((t=>{const a=n[t],s=typeof a;"object"!==s&&"function"!==s||Object.isFrozen(a)||e(a)})),n}(()=>{const e=document.querySelectorAll(".js-version");for(let n=0;ne.stopPropagation())),e[n].addEventListener("change",(e=>window.location.href=e.target.value))})(),function(){var e,n,t=document.querySelector("main .article-wrapper > .toc-sidebar");if(t)if(!document.querySelector(".body.ui-toc")&&(n=g("h1[id].sect0, .sect1 > h2[id]",e=document.querySelector(".article"))).length){var a,s,i={},r=n.reduce((function(e,n){var t=b(g("h3",n.parentNode)),a=document.createElement("ul");function s(e){const n=b(e.childNodes).reduce((function(e,n){return"A"!==n.nodeName&&e.appendChild(n.cloneNode(!0)),e}),document.createElement("a"));return i[n.href="#"+e.id]=n,n}a.classList.add("subheading-list"),t.map((e=>{var n=document.createElement("li");n.classList.add("subheading-item");var t=s(e);n.appendChild(t),a.appendChild(n)}));var r=s(n),o=document.createElement("li");return o.appendChild(r),t.length&&o.appendChild(a),e.appendChild(o),e}),document.createElement("ul"));(s=t&&t.querySelector(".toc-menu"))||((s=document.createElement("div")).className="toc-menu");var o=document.createElement("h3");o.classList.add("toc-title");var c=document.querySelector("main .article-wrapper h1");o.textContent=c.textContent,s.appendChild(o),s.appendChild(r),t&&window.addEventListener("load",(function(){u(),window.addEventListener("scroll",u)}));var l=e.querySelector("h1.page ~ :not(.labels)");if(l){var d=document.createElement("div");d.className="toc embedded",d.appendChild(s.cloneNode(!0)),e.insertBefore(d,l)}}else t.parentNode.removeChild(t);function u(){var n,t=g("h1[id].sect0, .sect1 > h2[id], .sect2 > h3[id]",e=document.querySelector(".article"));if(t.some((function(e){if(!(Math.floor(e.getBoundingClientRect().top)<=0))return!0;n="#"+e.id})),n){if(n!==a){a&&i[a].classList.remove("toc-active");var r=i[n];r.classList.add("toc-active"),s.scrollHeight>s.offsetHeight&&(s.scrollTop=Math.max(0,r.offsetTop+r.offsetHeight-s.offsetHeight)),a=n}}else a&&(i[a].classList.remove("toc-active"),a=void 0)}function g(e,n){return b((n||document).querySelectorAll(e))}function b(e){return[].slice.call(e)}}(),function(){const e=document.querySelector(".sidr-toggle"),n=document.querySelector("#sidr"),t=document.querySelector(".close-menu-btn");e.addEventListener("click",(function(e){n.classList.toggle("toggled")})),t.addEventListener("click",(function(e){n.classList.toggle("toggled")}));document.querySelectorAll(".collapse-toggle").forEach((function(e){const n=()=>e.classList.toggle("toggled");e.addEventListener("click",n);const t=[...e.parentElement.children].find((e=>e.matches("span.nav-link")));t?.addEventListener("click",n)}))}(),function(){window.addEventListener("click",(e=>{event.target.classList.contains("hardhat-truffle-toggle")&&(!function(){const e=s(),n="hardhat"===e?"truffle":"hardhat";document.body.classList.replace(`preference-${e}`,`preference-${n}`),a(n),function(e){const n=new URL(document.location),t=new URLSearchParams(n.search);t.set("pref",e),n.search=t.toString(),history.replaceState(null,"",[n])}(n)}(),e.preventDefault())}));const e="hardhat_truffle_preference",n="pref",t="hardhat";function a(n){document.cookie=`${e}=${n};path=/;max-age=31536000`}function s(){const a=new URLSearchParams(document.location.search).get(n)||function(){const n=document.cookie.split("; ").find((n=>n.startsWith(`${e}=`)));return n&&n.split("=")[1]}();return"hardhat"===a||"truffle"===a?a:t}const i=s();a(i),document.body.classList.add(`preference-${i}`)}(),function(){const e=["console","shell","sh","bash"];function n(n){let t=n.target.parentElement.innerText;const a=n.target.parentElement.querySelector("[data-lang]"),s=a?.dataset?.lang;e.includes(s)&&(t=t.replace(/\$ /gm,"")),navigator.clipboard.writeText(t)}var t;t=()=>{for(const e of document.querySelectorAll(".listingblock")){const t=document.createElement("button");t.classList.add("btn-icon","btn-copy","hljs"),t.setAttribute("aria-label","Copy"),t.innerHTML='',t.addEventListener("click",n),e.prepend(t)}},"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):t()}();class n{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function t(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function a(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n];return n.forEach((function(e){for(const n in e)t[n]=e[n]})),t}const s=e=>!!e.scope;class i{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=t(e)}openNode(e){if(!s(e))return;const n=((e,{prefix:n})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const t=e.split(".");return[`${n}${t.shift()}`,...t.map(((e,n)=>`${e}${"_".repeat(n+1)}`))].join(" ")}return`${n}${e}`})(e.scope,{prefix:this.classPrefix});this.span(n)}closeNode(e){s(e)&&(this.buffer+="")}value(){return this.buffer}span(e){this.buffer+=``}}const r=(e={})=>{const n={children:[]};return Object.assign(n,e),n};class o{constructor(){this.rootNode=r(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n=r({scope:e});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach((n=>this._walk(e,n))),e.closeNode(n)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{o._collapse(e)})))}}class c extends o{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,n){const t=e.root;n&&(t.scope=`language:${n}`),this.add(t)}toHTML(){return new i(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function l(e){return e?"string"==typeof e?e:e.source:null}function d(e){return b("(?=",e,")")}function u(e){return b("(?:",e,")*")}function g(e){return b("(?:",e,")?")}function b(...e){return e.map((e=>l(e))).join("")}function m(...e){const n=function(e){const n=e[e.length-1];return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{}}(e);return"("+(n.capture?"":"?:")+e.map((e=>l(e))).join("|")+")"}function h(e){return new RegExp(e.toString()+"|").exec("").length-1}const f=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function p(e,{joinWith:n}){let t=0;return e.map((e=>{t+=1;const n=t;let a=l(e),s="";for(;a.length>0;){const e=f.exec(a);if(!e){s+=a;break}s+=a.substring(0,e.index),a=a.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?s+="\\"+String(Number(e[1])+n):(s+=e[0],"("===e[0]&&t++)}return s})).map((e=>`(${e})`)).join(n)}const E="[a-zA-Z]\\w*",_="[a-zA-Z_]\\w*",y="\\b\\d+(\\.\\d+)?",N="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",v="\\b(0b[01]+)",w={begin:"\\\\[\\s\\S]",relevance:0},x={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[w]},S={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[w]},O=function(e,n,t={}){const s=a({scope:"comment",begin:e,end:n,contains:[]},t);s.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=m("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return s.contains.push({begin:b(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),s},A=O("//","$"),M=O("/\\*","\\*/"),k=O("#","$"),C={scope:"number",begin:y,relevance:0},R={scope:"number",begin:N,relevance:0},T={scope:"number",begin:v,relevance:0},L={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[w,{begin:/\[/,end:/\]/,relevance:0,contains:[w]}]},I={scope:"title",begin:E,relevance:0},D={scope:"title",begin:_,relevance:0},B={begin:"\\.\\s*"+_,relevance:0};var $=Object.freeze({__proto__:null,APOS_STRING_MODE:x,BACKSLASH_ESCAPE:w,BINARY_NUMBER_MODE:T,BINARY_NUMBER_RE:v,COMMENT:O,C_BLOCK_COMMENT_MODE:M,C_LINE_COMMENT_MODE:A,C_NUMBER_MODE:R,C_NUMBER_RE:N,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})},HASH_COMMENT_MODE:k,IDENT_RE:E,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:B,NUMBER_MODE:C,NUMBER_RE:y,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:S,REGEXP_MODE:L,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const n=/^#![ ]*\//;return e.binary&&(e.begin=b(n,/.*\b/,e.binary,/\b.*/)),a({scope:"meta",begin:n,end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},TITLE_MODE:I,UNDERSCORE_IDENT_RE:_,UNDERSCORE_TITLE_MODE:D});function j(e,n){"."===e.input[e.index-1]&&n.ignoreMatch()}function z(e,n){void 0!==e.className&&(e.scope=e.className,delete e.className)}function P(e,n){n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=j,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function U(e,n){Array.isArray(e.illegal)&&(e.illegal=m(...e.illegal))}function H(e,n){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Z(e,n){void 0===e.relevance&&(e.relevance=1)}const F=(e,n)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},e);Object.keys(e).forEach((n=>{delete e[n]})),e.keywords=t.keywords,e.begin=b(t.beforeMatch,d(t.begin)),e.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},e.relevance=0,delete t.beforeMatch},K=["of","and","for","in","not","or","if","then","parent","list","value"];function G(e,n,t="keyword"){const a=Object.create(null);return"string"==typeof e?s(t,e.split(" ")):Array.isArray(e)?s(t,e):Object.keys(e).forEach((function(t){Object.assign(a,G(e[t],n,t))})),a;function s(e,t){n&&(t=t.map((e=>e.toLowerCase()))),t.forEach((function(n){const t=n.split("|");a[t[0]]=[e,q(t[0],t[1])]}))}}function q(e,n){return n?Number(n):function(e){return K.includes(e.toLowerCase())}(e)?0:1}const W={},X=e=>{console.error(e)},Q=(e,...n)=>{console.log(`WARN: ${e}`,...n)},J=(e,n)=>{W[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),W[`${e}/${n}`]=!0)},V=new Error;function Y(e,n,{key:t}){let a=0;const s=e[t],i={},r={};for(let e=1;e<=n.length;e++)r[e+a]=s[e],i[e+a]=!0,a+=h(n[e-1]);e[t]=r,e[t]._emit=i,e[t]._multi=!0}function ee(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw X("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),V;if("object"!=typeof e.beginScope||null===e.beginScope)throw X("beginScope must be object"),V;Y(e,e.begin,{key:"beginScope"}),e.begin=p(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw X("skip, excludeEnd, returnEnd not compatible with endScope: {}"),V;if("object"!=typeof e.endScope||null===e.endScope)throw X("endScope must be object"),V;Y(e,e.end,{key:"endScope"}),e.end=p(e.end,{joinWith:""})}}(e)}function ne(e){function n(n,t){return new RegExp(l(n),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(t?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=h(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=n(p(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const n=this.matcherRe.exec(e);if(!n)return null;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),a=this.matchIndexes[t];return n.splice(0,t),Object.assign(n,a)}}class s{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))),n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;let t=n.exec(e);if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)}return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&this.considerAll()),t}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),function t(i,r){const o=i;if(i.isCompiled)return o;[z,H,ee,F].forEach((e=>e(i,r))),e.compilerExtensions.forEach((e=>e(i,r))),i.__beforeBegin=null,[P,U,Z].forEach((e=>e(i,r))),i.isCompiled=!0;let c=null;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),c=i.keywords.$pattern,delete i.keywords.$pattern),c=c||/\w+/,i.keywords&&(i.keywords=G(i.keywords,e.case_insensitive)),o.keywordPatternRe=n(c,!0),r&&(i.begin||(i.begin=/\B|\b/),o.beginRe=n(o.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(o.endRe=n(o.end)),o.terminatorEnd=l(o.end)||"",i.endsWithParent&&r.terminatorEnd&&(o.terminatorEnd+=(i.end?"|":"")+r.terminatorEnd)),i.illegal&&(o.illegalRe=n(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(n){return a(e,{variants:null},n)})));if(e.cachedVariants)return e.cachedVariants;if(te(e))return a(e,{starts:e.starts?a(e.starts):null});if(Object.isFrozen(e))return a(e);return e}("self"===e?i:e)}))),i.contains.forEach((function(e){t(e,o)})),i.starts&&t(i.starts,r),o.matcher=function(e){const n=new s;return e.contains.forEach((e=>n.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n}(o),o}(e)}function te(e){return!!e&&(e.endsWithParent||te(e.starts))}class ae extends Error{constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}}const se=t,ie=a,re=Symbol("nomatch"),oe=function(t){const a=Object.create(null),s=Object.create(null),i=[];let r=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",l={disableAutodetect:!0,name:"Plain text",contains:[]};let h={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:c};function f(e){return h.noHighlightRe.test(e)}function p(e,n,t){let a="",s="";"object"==typeof n?(a=e,t=n.ignoreIllegals,s=n.language):(J("10.7.0","highlight(lang, code, ...args) has been deprecated."),J("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),s=e,a=n),void 0===t&&(t=!0);const i={code:a,language:s};O("before:highlight",i);const r=i.result?i.result:E(i.language,i.code,t);return r.code=i.code,O("after:highlight",r),r}function E(e,t,s,i){const c=Object.create(null);function l(){if(!O.keywords)return void M.addText(k);let e=0;O.keywordPatternRe.lastIndex=0;let n=O.keywordPatternRe.exec(k),t="";for(;n;){t+=k.substring(e,n.index);const s=v.case_insensitive?n[0].toLowerCase():n[0],i=(a=s,O.keywords[a]);if(i){const[e,a]=i;if(M.addText(t),t="",c[s]=(c[s]||0)+1,c[s]<=7&&(C+=a),e.startsWith("_"))t+=n[0];else{const t=v.classNameAliases[e]||e;u(n[0],t)}}else t+=n[0];e=O.keywordPatternRe.lastIndex,n=O.keywordPatternRe.exec(k)}var a;t+=k.substring(e),M.addText(t)}function d(){null!=O.subLanguage?function(){if(""===k)return;let e=null;if("string"==typeof O.subLanguage){if(!a[O.subLanguage])return void M.addText(k);e=E(O.subLanguage,k,!0,A[O.subLanguage]),A[O.subLanguage]=e._top}else e=_(k,O.subLanguage.length?O.subLanguage:null);O.relevance>0&&(C+=e.relevance),M.__addSublanguage(e._emitter,e.language)}():l(),k=""}function u(e,n){""!==e&&(M.startScope(n),M.addText(e),M.endScope())}function g(e,n){let t=1;const a=n.length-1;for(;t<=a;){if(!e._emit[t]){t++;continue}const a=v.classNameAliases[e[t]]||e[t],s=n[t];a?u(s,a):(k=s,l(),k=""),t++}}function b(e,n){return e.scope&&"string"==typeof e.scope&&M.openNode(v.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(u(k,v.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),k=""):e.beginScope._multi&&(g(e.beginScope,n),k="")),O=Object.create(e,{parent:{value:O}}),O}function m(e,t,a){let s=function(e,n){const t=e&&e.exec(n);return t&&0===t.index}(e.endRe,a);if(s){if(e["on:end"]){const a=new n(e);e["on:end"](t,a),a.isMatchIgnored&&(s=!1)}if(s){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return m(e.parent,t,a)}function f(e){return 0===O.matcher.regexIndex?(k+=e[0],1):(L=!0,0)}function p(e){const n=e[0],a=t.substring(e.index),s=m(O,e,a);if(!s)return re;const i=O;O.endScope&&O.endScope._wrap?(d(),u(n,O.endScope._wrap)):O.endScope&&O.endScope._multi?(d(),g(O.endScope,e)):i.skip?k+=n:(i.returnEnd||i.excludeEnd||(k+=n),d(),i.excludeEnd&&(k=n));do{O.scope&&M.closeNode(),O.skip||O.subLanguage||(C+=O.relevance),O=O.parent}while(O!==s.parent);return s.starts&&b(s.starts,e),i.returnEnd?0:n.length}let y={};function N(a,i){const o=i&&i[0];if(k+=a,null==o)return d(),0;if("begin"===y.type&&"end"===i.type&&y.index===i.index&&""===o){if(k+=t.slice(i.index,i.index+1),!r){const n=new Error(`0 width match regex (${e})`);throw n.languageName=e,n.badRule=y.rule,n}return 1}if(y=i,"begin"===i.type)return function(e){const t=e[0],a=e.rule,s=new n(a),i=[a.__beforeBegin,a["on:begin"]];for(const n of i)if(n&&(n(e,s),s.isMatchIgnored))return f(t);return a.skip?k+=t:(a.excludeBegin&&(k+=t),d(),a.returnBegin||a.excludeBegin||(k=t)),b(a,e),a.returnBegin?0:t.length}(i);if("illegal"===i.type&&!s){const e=new Error('Illegal lexeme "'+o+'" for mode "'+(O.scope||"")+'"');throw e.mode=O,e}if("end"===i.type){const e=p(i);if(e!==re)return e}if("illegal"===i.type&&""===o)return 1;if(T>1e5&&T>3*i.index){throw new Error("potential infinite loop, way more iterations than matches")}return k+=o,o.length}const v=w(e);if(!v)throw X(o.replace("{}",e)),new Error('Unknown language: "'+e+'"');const x=ne(v);let S="",O=i||x;const A={},M=new h.__emitter(h);!function(){const e=[];for(let n=O;n!==v;n=n.parent)n.scope&&e.unshift(n.scope);e.forEach((e=>M.openNode(e)))}();let k="",C=0,R=0,T=0,L=!1;try{if(v.__emitTokens)v.__emitTokens(t,M);else{for(O.matcher.considerAll();;){T++,L?L=!1:O.matcher.considerAll(),O.matcher.lastIndex=R;const e=O.matcher.exec(t);if(!e)break;const n=N(t.substring(R,e.index),e);R=e.index+n}N(t.substring(R))}return M.finalize(),S=M.toHTML(),{language:e,value:S,relevance:C,illegal:!1,_emitter:M,_top:O}}catch(n){if(n.message&&n.message.includes("Illegal"))return{language:e,value:se(t),illegal:!0,relevance:0,_illegalBy:{message:n.message,index:R,context:t.slice(R-100,R+100),mode:n.mode,resultSoFar:S},_emitter:M};if(r)return{language:e,value:se(t),illegal:!1,relevance:0,errorRaised:n,_emitter:M,_top:O};throw n}}function _(e,n){n=n||h.languages||Object.keys(a);const t=function(e){const n={value:se(e),illegal:!1,relevance:0,_top:l,_emitter:new h.__emitter(h)};return n._emitter.addText(e),n}(e),s=n.filter(w).filter(S).map((n=>E(n,e,!1)));s.unshift(t);const i=s.sort(((e,n)=>{if(e.relevance!==n.relevance)return n.relevance-e.relevance;if(e.language&&n.language){if(w(e.language).supersetOf===n.language)return 1;if(w(n.language).supersetOf===e.language)return-1}return 0})),[r,o]=i,c=r;return c.secondBest=o,c}function y(e){let n=null;const t=function(e){let n=e.className+" ";n+=e.parentNode?e.parentNode.className:"";const t=h.languageDetectRe.exec(n);if(t){const n=w(t[1]);return n||(Q(o.replace("{}",t[1])),Q("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"}return n.split(/\s+/).find((e=>f(e)||w(e)))}(e);if(f(t))return;if(O("before:highlightElement",{el:e,language:t}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(h.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),h.throwUnescapedHTML)){throw new ae("One of your code blocks includes unescaped HTML.",e.innerHTML)}n=e;const a=n.textContent,i=t?p(a,{language:t,ignoreIllegals:!0}):_(a);e.innerHTML=i.value,e.dataset.highlighted="yes",function(e,n,t){const a=n&&s[n]||t;e.classList.add("hljs"),e.classList.add(`language-${a}`)}(e,t,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),O("after:highlightElement",{el:e,result:i,text:a})}let N=!1;function v(){if("loading"===document.readyState)return void(N=!0);document.querySelectorAll(h.cssSelector).forEach(y)}function w(e){return e=(e||"").toLowerCase(),a[e]||a[s[e]]}function x(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=>{s[e.toLowerCase()]=n}))}function S(e){const n=w(e);return n&&!n.disableAutodetect}function O(e,n){const t=e;i.forEach((function(e){e[t]&&e[t](n)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){N&&v()}),!1),Object.assign(t,{highlight:p,highlightAuto:_,highlightAll:v,highlightElement:y,highlightBlock:function(e){return J("10.7.0","highlightBlock will be removed entirely in v12.0"),J("10.7.0","Please use highlightElement now."),y(e)},configure:function(e){h=ie(h,e)},initHighlighting:()=>{v(),J("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){v(),J("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(e,n){let s=null;try{s=n(t)}catch(n){if(X("Language definition for '{}' could not be registered.".replace("{}",e)),!r)throw n;X(n),s=l}s.name||(s.name=e),a[e]=s,s.rawDefinition=n.bind(null,t),s.aliases&&x(s.aliases,{languageName:e})},unregisterLanguage:function(e){delete a[e];for(const n of Object.keys(s))s[n]===e&&delete s[n]},listLanguages:function(){return Object.keys(a)},getLanguage:w,registerAliases:x,autoDetection:S,inherit:ie,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{e["before:highlightBlock"](Object.assign({block:n.el},n))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{e["after:highlightBlock"](Object.assign({block:n.el},n))})}(e),i.push(e)},removePlugin:function(e){const n=i.indexOf(e);-1!==n&&i.splice(n,1)}}),t.debugMode=function(){r=!1},t.safeMode=function(){r=!0},t.versionString="11.10.0",t.regex={concat:b,lookahead:d,either:m,optional:g,anyNumberOfTimes:u};for(const n in $)"object"==typeof $[n]&&e($[n]);return Object.assign(t,$),t},ce=oe({});ce.newInstance=()=>oe({});var le=ce;ce.HighlightJS=ce,ce.default=ce;var de=function(e){const n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},t={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},a={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},s={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},i=e.inherit(a,{contains:[]}),r=e.inherit(s,{contains:[]});a.contains.push(r),s.contains.push(i);let o=[n,t];return[a,s,i,r].forEach((e=>{e.contains=e.contains.concat(o)})),o=o.concat(a,s),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:o},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:o}]}]},n,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a,s,{className:"quote",begin:"^>\\s+",contains:o,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},t,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}};const ue="[A-Za-z$_][0-9A-Za-z$_]*",ge=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],be=["true","false","null","undefined","NaN","Infinity"],me=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],he=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],fe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],pe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ee=[].concat(fe,me,he);var _e=function(e){const n=e.regex,t=ue,a="<>",s=">",i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{const t=e[0].length+e.index,a=e.input[t];if("<"===a||","===a)return void n.ignoreMatch();let s;">"===a&&(((e,{after:n})=>{const t=""+e[0].slice(1);return-1!==e.input.indexOf(t,n)})(e,{after:t})||n.ignoreMatch());const i=e.input.substring(t);((s=i.match(/^\s*=/))||(s=i.match(/^\s+extends\s+/))&&0===s.index)&&n.ignoreMatch()}},r={$pattern:ue,keyword:ge,literal:be,built_in:Ee,"variable.language":pe},o="[0-9](_?[0-9])*",c=`\\.(${o})`,l="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${l})((${c})|\\.)?|(${c}))[eE][+-]?(${o})\\b`},{begin:`\\b(${l})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},u={className:"subst",begin:"\\$\\{",end:"\\}",keywords:r,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"graphql"}},h={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,u]},f={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:t+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},p=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,g,b,m,h,{match:/\$\d+/},d];u.contains=p.concat({begin:/\{/,end:/\}/,keywords:r,contains:["self"].concat(p)});const E=[].concat(f,u.contains),_=E.concat([{begin:/(\s*)\(/,end:/\)/,keywords:r,contains:["self"].concat(E)}]),y={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:_},N={variants:[{match:[/class/,/\s+/,t,/\s+/,/extends/,/\s+/,n.concat(t,"(",n.concat(/\./,t),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,t],scope:{1:"keyword",3:"title.class"}}]},v={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...me,...he]}},w={variants:[{match:[/function/,/\s+/,t,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[y],illegal:/%/},x={match:n.concat(/\b/,(S=[...fe,"super","import"].map((e=>`${e}\\s*\\(`)),n.concat("(?!",S.join("|"),")")),t,n.lookahead(/\s*\(/)),className:"title.function",relevance:0};var S;const O={begin:n.concat(/\./,n.lookahead(n.concat(t,/(?![0-9A-Za-z$_(])/))),end:t,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},A={match:[/get|set/,/\s+/,t,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},y]},M="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",k={match:[/const|var|let/,/\s+/,t,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(M)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[y]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:r,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:v},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,g,b,m,h,f,{match:/\$\d+/},d,v,{className:"attr",begin:t+n.lookahead(":"),relevance:0},k,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[f,e.REGEXP_MODE,{className:"function",begin:M,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a,end:s},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},w,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[y,e.inherit(e.TITLE_MODE,{begin:t,className:"title.function"})]},{match:/\.\.\./,relevance:0},O,{match:"\\$"+t,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[y]},x,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},N,A,{match:/\$[(.]/}]}};const ye="[A-Za-z$_][0-9A-Za-z$_]*",Ne=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],ve=["true","false","null","undefined","NaN","Infinity"],we=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],xe=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Se=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Oe=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ae=[].concat(Se,we,xe);function Me(e){const n=e.regex,t=ye,a="<>",s=">",i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{const t=e[0].length+e.index,a=e.input[t];if("<"===a||","===a)return void n.ignoreMatch();let s;">"===a&&(((e,{after:n})=>{const t=""+e[0].slice(1);return-1!==e.input.indexOf(t,n)})(e,{after:t})||n.ignoreMatch());const i=e.input.substring(t);((s=i.match(/^\s*=/))||(s=i.match(/^\s+extends\s+/))&&0===s.index)&&n.ignoreMatch()}},r={$pattern:ye,keyword:Ne,literal:ve,built_in:Ae,"variable.language":Oe},o="[0-9](_?[0-9])*",c=`\\.(${o})`,l="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${l})((${c})|\\.)?|(${c}))[eE][+-]?(${o})\\b`},{begin:`\\b(${l})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},u={className:"subst",begin:"\\$\\{",end:"\\}",keywords:r,contains:[]},g={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"graphql"}},h={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,u]},f={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:t+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},p=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,g,b,m,h,{match:/\$\d+/},d];u.contains=p.concat({begin:/\{/,end:/\}/,keywords:r,contains:["self"].concat(p)});const E=[].concat(f,u.contains),_=E.concat([{begin:/(\s*)\(/,end:/\)/,keywords:r,contains:["self"].concat(E)}]),y={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:_},N={variants:[{match:[/class/,/\s+/,t,/\s+/,/extends/,/\s+/,n.concat(t,"(",n.concat(/\./,t),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,t],scope:{1:"keyword",3:"title.class"}}]},v={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...we,...xe]}},w={variants:[{match:[/function/,/\s+/,t,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[y],illegal:/%/};const x={match:n.concat(/\b/,(S=[...Se,"super","import"].map((e=>`${e}\\s*\\(`)),n.concat("(?!",S.join("|"),")")),t,n.lookahead(/\s*\(/)),className:"title.function",relevance:0};var S;const O={begin:n.concat(/\./,n.lookahead(n.concat(t,/(?![0-9A-Za-z$_(])/))),end:t,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},A={match:[/get|set/,/\s+/,t,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},y]},M="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",k={match:[/const|var|let/,/\s+/,t,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(M)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[y]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:r,exports:{PARAMS_CONTAINS:_,CLASS_REFERENCE:v},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,g,b,m,h,f,{match:/\$\d+/},d,v,{className:"attr",begin:t+n.lookahead(":"),relevance:0},k,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[f,e.REGEXP_MODE,{className:"function",begin:M,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:_}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a,end:s},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},w,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[y,e.inherit(e.TITLE_MODE,{begin:t,className:"title.function"})]},{match:/\.\.\./,relevance:0},O,{match:"\\$"+t,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[y]},x,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},N,A,{match:/\$[(.]/}]}}var ke=function(e){const n=Me(e),t=ye,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},i={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.exports.CLASS_REFERENCE]},r={$pattern:ye,keyword:Ne.concat(["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"]),literal:ve,built_in:Ae.concat(a),"variable.language":Oe},o={className:"meta",begin:"@"+t},c=(e,n,t)=>{const a=e.contains.findIndex((e=>e.label===n));if(-1===a)throw new Error("can not find mode to replace");e.contains.splice(a,1,t)};Object.assign(n.keywords,r),n.exports.PARAMS_CONTAINS.push(o);const l=n.contains.find((e=>"attr"===e.className));return n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,l]),n.contains=n.contains.concat([o,s,i]),c(n,"shebang",e.SHEBANG()),c(n,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),n.contains.find((e=>"func.def"===e.label)).relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n};var Ce=function(e){const n=["true","false","null"],t={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:n},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,t,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}};var Re=function(e){const n=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}};var Te=function(e){const n=e.regex,t=/[\p{XID_Start}_]\p{XID_Continue}*/u,a=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],s={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},i={className:"meta",begin:/^(>>>|\.\.\.) /},r={className:"subst",begin:/\{/,end:/\}/,keywords:s,illegal:/#/},o={begin:/\{\{/,relevance:0},c={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,i],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,i],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,i,o,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,i,o,r]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,o,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,o,r]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l="[0-9](_?[0-9])*",d=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,u=`\\b|${a.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${l})|(${d}))[eE][+-]?(${l})[jJ]?(?=${u})`},{begin:`(${d})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${u})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${u})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${u})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${u})`},{begin:`\\b(${l})[jJ](?=${u})`}]},b={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:s,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:["self",i,g,c,e.HASH_COMMENT_MODE]}]};return r.contains=[c,g,i],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:s,illegal:/(<\/|\?)|=>/,contains:[i,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},c,b,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,m,c]}]}};var Le=function(e){const n=e.regex,t=/(r#)?/,a=n.concat(t,e.UNDERSCORE_IDENT_RE),s=n.concat(t,e.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:n.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,n.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",o=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],c=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:c,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:o},illegal:"",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+r},{begin:"\\b0o([0-7_]+)"+r},{begin:"\\b0x([A-Fa-f0-9_]+)"+r},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+r}],relevance:0},{begin:[/fn/,/\s+/,a],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,a],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,a,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:o,type:c}},{className:"punctuation",begin:"->"},i]}};var Ie=function(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}};var De=function(e){const n=e.regex,t=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),a={className:"symbol",begin:/&[a-z]+;|[0-9]+;|[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},i=e.inherit(s,{begin:/\(/,end:/\)/}),r=e.inherit(e.APOS_STRING_MODE,{className:"string"}),o=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[s,o,r,i,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,i,o,r]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[o]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/