mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge branch 'feat-database-indexing' into feat-storage-buckets
This commit is contained in:
commit
f5e48033ec
70 files changed
+1651
-30587
No files matched your search
@@ -1,8 +1,6 @@
|
||||
app/db/SQL
|
||||
node_modules
|
||||
storage
|
||||
public/scripts
|
||||
public/styles
|
||||
.git
|
||||
.idea
|
||||
.cd .babelrc
|
||||
|
||||
+16
-2
@@ -1,10 +1,24 @@
|
||||
app/config/* linguist-detectable=false
|
||||
app/config/* linguist-detectable=false
|
||||
app/config/*/* linguist-detectable=false
|
||||
app/config/*/*/* linguist-detectable=false
|
||||
app/config/*/*/*/* linguist-detectable=false
|
||||
app/views/* linguist-detectable=false
|
||||
app/views/*/* linguist-detectable=false
|
||||
app/views/*/*/* linguist-detectable=false
|
||||
app/views/*/*/*/* linguist-detectable=false
|
||||
app/controllers/* linguist-detectable=false
|
||||
app/controllers/*/* linguist-detectable=false
|
||||
app/controllers/*/*/* linguist-detectable=false
|
||||
app/controllers/*/*/*/* linguist-detectable=false
|
||||
app/controllers/*/*/*/*/* linguist-detectable=false
|
||||
src/* linguist-detectable=false
|
||||
src/*/* linguist-detectable=false
|
||||
src/*/*/* linguist-detectable=false
|
||||
src/*/*/*/* linguist-detectable=false
|
||||
src/*/*/*/*/* linguist-detectable=false
|
||||
tests/* linguist-detectable=false
|
||||
tests/*/* linguist-detectable=false
|
||||
tests/*/*/* linguist-detectable=false
|
||||
tests/*/*/*/* linguist-detectable=false
|
||||
tests/*/*/*/*/* linguist-detectable=false
|
||||
tests/*/*/*/*/* linguist-detectable=false
|
||||
tests/*/*/*/*/*/* linguist-detectable=false
|
||||
@@ -3,6 +3,7 @@
|
||||
/node_modules/
|
||||
/tests/resources/storage/
|
||||
/app/sdks/*
|
||||
/public/dist/*
|
||||
/.idea/
|
||||
.DS_Store
|
||||
.php_cs.cache
|
||||
|
||||
+9
-9
@@ -107,7 +107,7 @@
|
||||
- Refactored E-Mail template (#1422)
|
||||
- Improved locale management (#1440)
|
||||
- Added `$permissions` to execution response (#948)
|
||||
- Switch from using Docker CLI to Docker API by intergrating [utopia-php/orchestration](https://github.com/utopia-php/orchestration) (#1420)
|
||||
- Switch from using Docker CLI to Docker API by integrating [utopia-php/orchestration](https://github.com/utopia-php/orchestration) (#1420)
|
||||
- Added DOCKERHUB_PULL_USERNAME, DOCKERHUB_PULL_PASSWORD and DOCKERHUB_PULL_EMAIL env variables for pulling from private DockerHub repos (#1420)
|
||||
- Added `updateName`, `updateEmail` and `updatePassword` to Users service and console (#1547)
|
||||
|
||||
@@ -162,7 +162,7 @@
|
||||
- Added internal support for connection pools for improved performance (#1278)
|
||||
- Added new abstraction for workers executable files (#1276)
|
||||
- Added a new API in the Users API to allow you to force update your user verification status (#1223)
|
||||
- Using a fixed commit to avoid breaking changes for imagemagick extenstion (#1274)
|
||||
- Using a fixed commit to avoid breaking changes for imagemagick extension (#1274)
|
||||
- Updated the design of all the email templates (#1225)
|
||||
- Refactored Devices page in Console: (#1167)
|
||||
- Renamed *Devices* to *Sessions*
|
||||
@@ -193,7 +193,7 @@
|
||||
- Fixed a bug in the Twitch OAuth adapter (#1209)
|
||||
- Fixed missing session object when OAuth session creation event is triggered (#1208)
|
||||
- Fixed bug where we didn't ignore the email case, converted all emails to lowercase internally (#1243)
|
||||
- Fixed a console bug where you can't click a user with no name, added a placehoder for anonyomous users (#1220)
|
||||
- Fixed a console bug where you can't click a user with no name, added a placeholder for anonymous users (#1220)
|
||||
- Fixed unique keys not being updated when changing a user's email address (#1301)
|
||||
- Fixed a bug where decimal integers where wrongly used with database filters (#1349)
|
||||
|
||||
@@ -287,8 +287,8 @@
|
||||
|
||||
## Upgrades
|
||||
|
||||
- Upgraded redis extenstion lib to version 5.3.3
|
||||
- Upgraded maxmind extenstion lib to version 1.10.0
|
||||
- Upgraded redis extension lib to version 5.3.3
|
||||
- Upgraded maxmind extension lib to version 1.10.0
|
||||
- Upgraded utopia-php/cli lib to version 0.10.0
|
||||
- Upgraded matomo/device-detector lib to version 4.1.0
|
||||
- Upgraded dragonmantank/cron-expression lib to version 3.1.0
|
||||
@@ -300,7 +300,7 @@
|
||||
## Bug Fixes
|
||||
|
||||
- Updated missing storage env vars
|
||||
- Fixed a bug, that added a wrong timzone offset to user log timestamps
|
||||
- Fixed a bug, that added a wrong timezone offset to user log timestamps
|
||||
- Fixed a bug, that Response format header was not added in the access-control-allow-header list.
|
||||
- Fixed a bug where countryName is unknown on sessions (#933)
|
||||
- Added missing event users.update.prefs (#952)
|
||||
@@ -379,13 +379,13 @@
|
||||
- Upgraded Influxdb Docker image to version 1.8 (alpine)
|
||||
- Upgraded Redis Resque queue library to version 1.3.6 ([#319](https://github.com/appwrite/appwrite/issues/319))
|
||||
- Upgraded ClamAV container image to version 1.0.11 ([#412](https://github.com/appwrite/appwrite/issues/412))
|
||||
- Upgraded device detctor to version 3.12.6
|
||||
- Upgraded device detector to version 3.12.6
|
||||
- Upgraded GEOIP DB file to Feb 2021 release
|
||||
|
||||
## Breaking Changes (Read before upgrading!)
|
||||
|
||||
- **Deprecated** `first` and `last` query params for documents list route in the database API
|
||||
- **Deprecated** Deprectaed Pubjabi Translations ('pn')
|
||||
- **Deprecated** Deprecated Pubjabi Translations ('pn')
|
||||
- **Deprecated** `PATCH /account/prefs` is now updating the prefs payload and not just merging it
|
||||
- **Deprecated** `PATCH /users/:userId/prefs` is now updating the prefs payload and not just merging it
|
||||
- Switched order of limit and offset params in all the SDKs `listDocuments` method for better consistency
|
||||
@@ -431,7 +431,7 @@
|
||||
- Block iframe access to Appwrite console using the `X-Frame-Options` header.
|
||||
- Fixed `roles` param input validator
|
||||
- API Keys are now stored encrypted
|
||||
- Disabled domains whitlist ACL for the Appwrite console
|
||||
- Disabled domains whitelist ACL for the Appwrite console
|
||||
|
||||
# Version 0.6.2 (PRE-RELEASE)
|
||||
|
||||
|
||||
+15
-1
@@ -12,6 +12,18 @@ RUN composer update --ignore-platform-reqs --optimize-autoloader \
|
||||
--no-plugins --no-scripts --prefer-dist \
|
||||
`if [ "$TESTING" != "true" ]; then echo "--no-dev"; fi`
|
||||
|
||||
FROM node:16-alpine as node
|
||||
|
||||
WORKDIR /usr/local/src/
|
||||
|
||||
COPY package-lock.json /usr/local/src/
|
||||
COPY package.json /usr/local/src/
|
||||
COPY gulpfile.js /usr/local/src/
|
||||
COPY public /usr/local/src/public
|
||||
|
||||
RUN npm ci
|
||||
RUN npm run build
|
||||
|
||||
FROM php:8.0-cli-alpine as compile
|
||||
|
||||
ARG DEBUG=false
|
||||
@@ -206,6 +218,7 @@ RUN \
|
||||
WORKDIR /usr/src/code
|
||||
|
||||
COPY --from=composer /usr/local/src/vendor /usr/src/code/vendor
|
||||
COPY --from=node /usr/local/src/public/dist /usr/src/code/public/dist
|
||||
COPY --from=swoole /usr/local/lib/php/extensions/no-debug-non-zts-20200930/swoole.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/yasd.so* /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
|
||||
COPY --from=redis /usr/local/lib/php/extensions/no-debug-non-zts-20200930/redis.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
|
||||
COPY --from=imagick /usr/local/lib/php/extensions/no-debug-non-zts-20200930/imagick.so /usr/local/lib/php/extensions/no-debug-non-zts-20200930/
|
||||
@@ -217,7 +230,8 @@ COPY --from=mongodb /usr/local/lib/php/extensions/no-debug-non-zts-20200930/mong
|
||||
COPY ./app /usr/src/code/app
|
||||
COPY ./bin /usr/local/bin
|
||||
COPY ./docs /usr/src/code/docs
|
||||
COPY ./public /usr/src/code/public
|
||||
COPY ./public/fonts /usr/src/code/public/fonts
|
||||
COPY ./public/images /usr/src/code/public/images
|
||||
COPY ./src /usr/src/code/src
|
||||
|
||||
# Set Volumes
|
||||
|
||||
@@ -37,16 +37,16 @@ return [
|
||||
'kn', // Kannada
|
||||
'km', // Khmer
|
||||
'ko', // Korean
|
||||
'la', // Latin
|
||||
'lb', // Luxembourgish
|
||||
'lt', // Lithuanian
|
||||
'lv', // Latvian
|
||||
'ml', // Malayalam
|
||||
'mr', // Marathi
|
||||
'ms', // Malay
|
||||
'nb', // Norwegian - Bokmål
|
||||
'nb', // Norwegian bokmål
|
||||
'nl', // Dutch
|
||||
'nn', // Norwegian (nynorsk)
|
||||
'no', // Norwegian (bokmål)
|
||||
'nn', // Norwegian nynorsk
|
||||
'ne', // Nepali
|
||||
'or', // Oriya
|
||||
'tl', // Filipino
|
||||
@@ -64,6 +64,7 @@ return [
|
||||
'sq', // Albanian
|
||||
'sv', // Swedish
|
||||
'ta', // Tamil
|
||||
'te', // Telugu
|
||||
'th', // Thai
|
||||
'tr', // Turkish
|
||||
'uk', // Ukrainian
|
||||
|
||||
@@ -593,11 +593,6 @@ return [
|
||||
"name" => "Norwegian Nynorsk",
|
||||
"nativeName" => "Norsk nynorsk"
|
||||
],
|
||||
[
|
||||
"code" => "no",
|
||||
"name" => "Norwegian",
|
||||
"nativeName" => "Norsk"
|
||||
],
|
||||
[
|
||||
"code" => "nr",
|
||||
"name" => "South Ndebele",
|
||||
|
||||
@@ -3,30 +3,30 @@
|
||||
"settings.locale": "bn",
|
||||
"settings.direction": "ltr",
|
||||
"emails.sender": "%s টীম",
|
||||
"emails.verification.subject": "",
|
||||
"emails.verification.hello": "",
|
||||
"emails.verification.body": "",
|
||||
"emails.verification.footer": "",
|
||||
"emails.verification.thanks": "",
|
||||
"emails.verification.signature": "",
|
||||
"emails.magicSession.subject": "",
|
||||
"emails.magicSession.hello": "",
|
||||
"emails.magicSession.body": "",
|
||||
"emails.magicSession.footer": "",
|
||||
"emails.magicSession.thanks": "",
|
||||
"emails.magicSession.signature": "",
|
||||
"emails.recovery.subject": "",
|
||||
"emails.recovery.hello": "",
|
||||
"emails.recovery.body": "",
|
||||
"emails.recovery.footer": "",
|
||||
"emails.recovery.thanks": "",
|
||||
"emails.recovery.signature": "",
|
||||
"emails.invitation.subject": "",
|
||||
"emails.invitation.hello": "",
|
||||
"emails.invitation.body": "",
|
||||
"emails.invitation.footer": "",
|
||||
"emails.invitation.thanks": "",
|
||||
"emails.invitation.signature": "",
|
||||
"emails.verification.subject": "বিষয়",
|
||||
"emails.verification.hello": "নমস্কার {{name}}",
|
||||
"emails.verification.body": "এই লিঙ্কের মাধ্যমে ইমেইল যাচাই করুন।",
|
||||
"emails.verification.footer": "আপনি যদি এই ঠিকানা যাচাই করতে না বলেন, তাহলে আপনি এই বার্তাটি উপেক্ষা করতে পারেন।",
|
||||
"emails.verification.thanks": "ধন্যবাদ",
|
||||
"emails.verification.signature": "{{project}} টীম",
|
||||
"emails.magicSession.subject": "লগ ইন",
|
||||
"emails.magicSession.hello": "নমস্কার",
|
||||
"emails.magicSession.body": "এই লিঙ্কের মাধ্যমে লগ ইন করুন।",
|
||||
"emails.magicSession.footer": "আপনি যদি এই ইমেলটি ব্যবহার করে লগইন করতে না বলেন, তাহলে আপনি এই বার্তাটি উপেক্ষা করতে পারেন।",
|
||||
"emails.magicSession.thanks": "ধন্যবাদ",
|
||||
"emails.magicSession.signature": "{{project}} টীম",
|
||||
"emails.recovery.subject": "পাসওয়ার্ড রিসেট",
|
||||
"emails.recovery.hello": "নমস্কার {{name}}",
|
||||
"emails.recovery.body": "এই লিঙ্কের মাধ্যমে আপনার {{project}} পাসওয়ার্ড পুনরায় সেট করুন।",
|
||||
"emails.recovery.footer": "আপনি যদি আপনার পাসওয়ার্ড পুনরায় সেট করতে না বলেন, তাহলে আপনি এই বার্তাটি উপেক্ষা করতে পারেন।",
|
||||
"emails.recovery.thanks": "ধন্যবাদ",
|
||||
"emails.recovery.signature": "{{project}} টীম",
|
||||
"emails.invitation.subject": "%s টিমকে %s তে আমন্ত্রণ জানান",
|
||||
"emails.invitation.hello": "নমস্কার",
|
||||
"emails.invitation.body": "এই মেইলটি আপনাকে পাঠানো হয়েছে কারণ {{owner}} আপনাকে {{project}} এর সাথে যুক্ত {{team}} টিমের সদস্য হওয়ার জন্য আমন্ত্রণ জানাতে চেয়েছিলেন।",
|
||||
"emails.invitation.footer": "যদি এটি আপনার জন্য প্রয়োজনীয় না হয়, আপনি এই বার্তাটি উপেক্ষা করতে পারেন।",
|
||||
"emails.invitation.thanks": "ধন্যবাদ",
|
||||
"emails.invitation.signature": "{{project}} টীম",
|
||||
"locale.country.unknown": "অজানা",
|
||||
"countries.af": "আফগানিস্তান",
|
||||
"countries.ao": "অ্যাঙ্গোলা",
|
||||
@@ -229,4 +229,4 @@
|
||||
"continents.na": "উত্তর আমেরিকা",
|
||||
"continents.oc": "ওশেনিয়া",
|
||||
"continents.sa": "দক্ষিণ আমেরিকা"
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,30 @@
|
||||
{
|
||||
"settings.inspire": "\"बुद्धिमान होने की कला यह जानने की कला है कि क्या अनदेखा करना चाहिए |\"",
|
||||
"settings.inspire": "\"बुद्धिमान होने की कला यह जानने की कला है कि क्या अनदेखा किया जाए |\"",
|
||||
"settings.locale": "hi",
|
||||
"settings.direction": "ltr",
|
||||
"emails.sender": "%s टीम",
|
||||
"emails.verification.subject": "खाता सत्यापन",
|
||||
"emails.verification.subject": "अकाउंट वेरिफिकेशन ",
|
||||
"emails.verification.hello": "नमस्ते {{name}}",
|
||||
"emails.verification.body": "इस लिंक के माध्यम से ईमेल सत्यापित कीजिये।",
|
||||
"emails.verification.footer": "यदि आपने इस पते को सत्यापित करने के लिए नहीं कहा है, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।",
|
||||
"emails.verification.body": "इस लिंक के माध्यम से अपने ईमेल को सत्यापित कीजिये।",
|
||||
"emails.verification.footer": "यदि आपने इस पते को सत्यापित नहीं करना चाहते है, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।",
|
||||
"emails.verification.thanks": "धन्यवाद",
|
||||
"emails.verification.signature": "{{project}} टीम",
|
||||
"emails.magicSession.subject": "लॉग इन",
|
||||
"emails.magicSession.hello": "नमस्ते,",
|
||||
"emails.magicSession.body": "इस लिंक के माध्यम से लॉग इन करें।",
|
||||
"emails.magicSession.footer": "यदि आपने इस ईमेल का उपयोग करके लॉगिन करने के लिए नहीं कहा है, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।",
|
||||
"emails.magicSession.body": "इस लिंक के माध्यम से लॉग-इन करें।",
|
||||
"emails.magicSession.footer": "यदि आप इस ईमेल द्वारा लॉगिन नहीं करना चाहते है, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।",
|
||||
"emails.magicSession.thanks": "धन्यवाद",
|
||||
"emails.magicSession.signature": "{{project}} टीम",
|
||||
"emails.recovery.subject": "पासवर्ड रीसेट",
|
||||
"emails.recovery.hello": "नमस्ते {{name}}",
|
||||
"emails.recovery.body": "इस लिंक के माध्यम से अपना {{project}} पासवर्ड रीसेट करें।",
|
||||
"emails.recovery.footer": "यदि आपने अपना पासवर्ड रीसेट करने के लिए नहीं कहा है, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।",
|
||||
"emails.recovery.footer": "यदि आप अपना पासवर्ड रिसेट नहीं करना चाहते है, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।",
|
||||
"emails.recovery.thanks": "धन्यवाद",
|
||||
"emails.recovery.signature": "{{project}} टीम",
|
||||
"emails.invitation.subject": "%s टीम को %s पर आमंत्रण",
|
||||
"emails.invitation.subject": "%s टीम का यहाँ %s पर आमंत्रण",
|
||||
"emails.invitation.hello": "नमस्ते",
|
||||
"emails.invitation.body": "यह मेल आपको इसलिए भेजा गया था क्योंकि {{owner}} आपको {{team}} टीम का सदस्य बनने के लिए आमंत्रित करना चाहते थे जो {{project}} से जुड़ा है।",
|
||||
"emails.invitation.footer": "यदि यह आपके लिए आवश्यक नहीं है, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।",
|
||||
"emails.invitation.body": "यह मेल आपको इसलिए भेजा गया था क्योंकि {{owner}} आपको {{team}} टीम का सदस्य बनाना चाहते थे, जो {{project}} से जुड़ा हुआ है।",
|
||||
"emails.invitation.footer": "यदि आप इसमे रूचि नहीं रखते, तो आप इस संदेश को नज़रअंदाज़ कर सकते हैं।",
|
||||
"emails.invitation.thanks": "धन्यवाद",
|
||||
"emails.invitation.signature": "{{project}} टीम",
|
||||
"locale.country.unknown": "अज्ञात",
|
||||
|
||||
@@ -3,30 +3,30 @@
|
||||
"settings.locale": "hu",
|
||||
"settings.direction": "ltr",
|
||||
"emails.sender": "%s Csapat",
|
||||
"emails.verification.subject": "",
|
||||
"emails.verification.hello": "",
|
||||
"emails.verification.body": "",
|
||||
"emails.verification.footer": "",
|
||||
"emails.verification.thanks": "",
|
||||
"emails.verification.signature": "",
|
||||
"emails.magicSession.subject": "",
|
||||
"emails.magicSession.hello": "",
|
||||
"emails.magicSession.body": "",
|
||||
"emails.magicSession.footer": "",
|
||||
"emails.magicSession.thanks": "",
|
||||
"emails.magicSession.signature": "",
|
||||
"emails.recovery.subject": "",
|
||||
"emails.recovery.hello": "",
|
||||
"emails.recovery.body": "",
|
||||
"emails.recovery.footer": "",
|
||||
"emails.recovery.thanks": "",
|
||||
"emails.recovery.signature": "",
|
||||
"emails.invitation.subject": "",
|
||||
"emails.invitation.hello": "",
|
||||
"emails.invitation.body": "",
|
||||
"emails.invitation.footer": "",
|
||||
"emails.invitation.thanks": "",
|
||||
"emails.invitation.signature": "",
|
||||
"emails.verification.subject": "Fiók Megerősítése",
|
||||
"emails.verification.hello": "Szia {{name}}",
|
||||
"emails.verification.body": "Kattints a linkre, hogy megerősítsd az email címedet.",
|
||||
"emails.verification.footer": "Ha nem te kérted a címed megerősítését, akkor nyugodtan hagyd figyelmen kívül ezt az üzenetet.",
|
||||
"emails.verification.thanks": "Köszönettel",
|
||||
"emails.verification.signature": "a {{project}} csapat",
|
||||
"emails.magicSession.subject": "Bejelentkezés",
|
||||
"emails.magicSession.hello": "Szia,",
|
||||
"emails.magicSession.body": "Kattints a linkre a bejelentkezéshez.",
|
||||
"emails.magicSession.footer": "Ha nem te szerettél volna bejelentkezni ezzel az email címmel, akkor nyugodtan hagyd figyelmen kívül ezt az üzenetet.",
|
||||
"emails.magicSession.thanks": "Köszönettel",
|
||||
"emails.magicSession.signature": "a {{project}} csapat",
|
||||
"emails.recovery.subject": "Jelszó Visszaállítása",
|
||||
"emails.recovery.hello": "Hahó, {{name}}",
|
||||
"emails.recovery.body": "Kattints a linkre a {{project}} jelszavad visszaállításához.",
|
||||
"emails.recovery.footer": "Ha nem te kezdeményezted a jelszavad visszaállítását, akkor nyugodtan hagyd figyelmen kívül ezt az üzenetet.",
|
||||
"emails.recovery.thanks": "Köszönettel",
|
||||
"emails.recovery.signature": "a {{project}} csapat",
|
||||
"emails.invitation.subject": "Meghívó a(z) %s csapatba, a(z) %s projektbe",
|
||||
"emails.invitation.hello": "Szia",
|
||||
"emails.invitation.body": "Ezt a levelet azért kaptad, mert {{owner}} meghívott, hogy légy a {{team}} csapat tagja a {{project}} projektben.",
|
||||
"emails.invitation.footer": "Ha nem érdekel a lehetőség, nyugodtan hagyd figyelmen kívül ezt az üzenetet.",
|
||||
"emails.invitation.thanks": "Köszönettel",
|
||||
"emails.invitation.signature": "a {{project}} csapat",
|
||||
"locale.country.unknown": "Ismeretlen",
|
||||
"countries.af": "Afganisztán",
|
||||
"countries.ao": "Angola",
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
{
|
||||
"settings.inspire": "\"Ars sapiendi est ars sciendi quid negligat.\"",
|
||||
"settings.locale": "la",
|
||||
"settings.direction": "ltr*",
|
||||
"emails.sender": "%s team",
|
||||
"emails.verification.subject": "Ratio comprobatio",
|
||||
"emails.verification.hello": "Salve ibi {{name}}",
|
||||
"emails.verification.body": "Sequere hanc nexum ut quin inscriptionem tuum.",
|
||||
"emails.verification.footer": "Si verificationem huius inscriptionis non postulasti, nuntium hunc ignorare potes.",
|
||||
"emails.verification.thanks": "Gratias",
|
||||
"emails.verification.signature": "{{project}} Team",
|
||||
"emails.magicSession.subject": "Log in",
|
||||
"emails.magicSession.hello": "Salve ibi,",
|
||||
"emails.magicSession.body": "Hanc nexum cum login",
|
||||
"emails.magicSession.footer": "Si verificationem huius inscriptionis non postulasti, nuntium hunc ignorare potes.",
|
||||
"emails.magicSession.thanks": "Gratias",
|
||||
"emails.magicSession.signature": "{{project}} team",
|
||||
"emails.recovery.subject": "Recuperet password",
|
||||
"emails.recovery.hello": "Salve ibi {{name}}",
|
||||
"emails.recovery.body": "Sequere hanc conjunctionem ut recipias project password {{project}}",
|
||||
"emails.recovery.footer": "Si tesseram tuam recuperare non petis, nuntium hunc ignorare potes",
|
||||
"emails.recovery.thanks": "Gratias",
|
||||
"emails.recovery.signature": "{{project}} team",
|
||||
"emails.invitation.subject": "Invitatio pro %s in quadrigis %s",
|
||||
"emails.invitation.hello": "Salve ibi",
|
||||
"emails.invitation.body": "Haec inscriptio ad te missa est quia dominus incepto {{owner}} te invitare vult ut membrum {{team}} quadrigis fias ad {{project}}",
|
||||
"emails.invitation.footer": "Si non quaero, potes hunc nuntium ignorare",
|
||||
"emails.invitation.thanks": "Gratias",
|
||||
"emails.invitation.signature": "{{project}} team",
|
||||
"locale.country.unknown": "Ignotum",
|
||||
"countries.af": "Afghanistan",
|
||||
"countries.ao": "Angola",
|
||||
"countries.al": "Albania",
|
||||
"countries.ad": "Andorra",
|
||||
"countries.ae": "Emiratos Arabes Unidos",
|
||||
"countries.ar": "Argentina",
|
||||
"countries.am": "Armenia",
|
||||
"countries.ag": "Antigua and Barbuda",
|
||||
"countries.au": "Australia",
|
||||
"countries.at": "Austria",
|
||||
"countries.az": "Azerbaijan",
|
||||
"countries.bi": "Burundi",
|
||||
"countries.be": "Belgium",
|
||||
"countries.bj": "Benin",
|
||||
"countries.bf": "Burkina Faso",
|
||||
"countries.bd": "Bangladesh",
|
||||
"countries.bg": "Bulgaria",
|
||||
"countries.bh": "Bahrain",
|
||||
"countries.bs": "Bahamas",
|
||||
"countries.ba": "Bosnia and Herzegovina",
|
||||
"countries.by": "Belarus",
|
||||
"countries.bz": "Belize",
|
||||
"countries.bo": "Bolivia",
|
||||
"countries.br": "Brazil",
|
||||
"countries.bb": "Barbados",
|
||||
"countries.bn": "Brunei",
|
||||
"countries.bt": "Bhutan",
|
||||
"countries.bw": "Botswana",
|
||||
"countries.cf": "Central African Republic",
|
||||
"countries.ca": "Canada",
|
||||
"countries.ch": "Switzerland",
|
||||
"countries.cl": "Chile",
|
||||
"countries.cn": "China",
|
||||
"countries.ci": "Ivory Coast",
|
||||
"countries.cm": "Cameroon",
|
||||
"countries.cd": "DR Congo",
|
||||
"countries.cg": "Republic of the Congo",
|
||||
"countries.co": "Colombia",
|
||||
"countries.km": "Comoros",
|
||||
"countries.cv": "Cape Verde",
|
||||
"countries.cr": "Costa Rica",
|
||||
"countries.cu": "Cuba",
|
||||
"countries.cy": "Cyprus",
|
||||
"countries.cz": "Czechia",
|
||||
"countries.de": "Germany",
|
||||
"countries.dj": "Djibouti",
|
||||
"countries.dm": "Dominica",
|
||||
"countries.dk": "Denmark",
|
||||
"countries.do": "Republica dominicana",
|
||||
"countries.dz": "Algeria",
|
||||
"countries.ec": "Ecuador",
|
||||
"countries.eg": "Egypt",
|
||||
"countries.er": "Eritrea",
|
||||
"countries.es": "Spain",
|
||||
"countries.ee": "Estonia",
|
||||
"countries.et": "Ethiopia",
|
||||
"countries.fi": "Finland",
|
||||
"countries.fj": "Fiji",
|
||||
"countries.fr": "France",
|
||||
"countries.fm": "Micronesia",
|
||||
"countries.ga": "Gabon",
|
||||
"countries.gb": "Reino Unido",
|
||||
"countries.ge": "Georgia",
|
||||
"countries.gh": "Ghana",
|
||||
"countries.gn": "Guinea",
|
||||
"countries.gm": "Gambia",
|
||||
"countries.gw": "Guinea-Bissau",
|
||||
"countries.gq": "Equatorial Guinea",
|
||||
"countries.gr": "Greece",
|
||||
"countries.gd": "Grenada",
|
||||
"countries.gt": "Guatemala",
|
||||
"countries.gy": "Guyana",
|
||||
"countries.hn": "Honduras",
|
||||
"countries.hr": "Croatia",
|
||||
"countries.ht": "Haiti",
|
||||
"countries.hu": "Hungary",
|
||||
"countries.id": "Indonesia",
|
||||
"countries.in": "India",
|
||||
"countries.ie": "Ireland",
|
||||
"countries.ir": "Iran",
|
||||
"countries.iq": "Iraq",
|
||||
"countries.is": "Iceland",
|
||||
"countries.il": "Israel",
|
||||
"countries.it": "Italy",
|
||||
"countries.jm": "Jamaica",
|
||||
"countries.jo": "Jordan",
|
||||
"countries.jp": "Japan",
|
||||
"countries.kz": "Kazakhstan",
|
||||
"countries.ke": "Kenya",
|
||||
"countries.kg": "Kyrgyzstan",
|
||||
"countries.kh": "Cambodia",
|
||||
"countries.ki": "Kiribati",
|
||||
"countries.kn": "Saint Kitts and Nevis",
|
||||
"countries.kr": "South Korea",
|
||||
"countries.kw": "Kuwait",
|
||||
"countries.la": "Laos",
|
||||
"countries.lb": "Lebanon",
|
||||
"countries.lr": "Liberia",
|
||||
"countries.ly": "Libya",
|
||||
"countries.lc": "Saint Lucia",
|
||||
"countries.li": "Liechtenstein",
|
||||
"countries.lk": "Sri Lanka",
|
||||
"countries.ls": "Lesotho",
|
||||
"countries.lt": "Lithuania",
|
||||
"countries.lu": "Luxembourg",
|
||||
"countries.lv": "Latvia",
|
||||
"countries.ma": "Morocco",
|
||||
"countries.mc": "Monaco",
|
||||
"countries.md": "Moldova",
|
||||
"countries.mg": "Madagascar",
|
||||
"countries.mv": "Maldives",
|
||||
"countries.mx": "Mexico",
|
||||
"countries.mh": "Marshall Islands",
|
||||
"countries.mk": "Macedonia",
|
||||
"countries.ml": "Mali",
|
||||
"countries.mt": "Malta",
|
||||
"countries.mm": "Myanmar",
|
||||
"countries.me": "Montenegro",
|
||||
"countries.mn": "Mongolia",
|
||||
"countries.mz": "Mozambique",
|
||||
"countries.mr": "Mauritania",
|
||||
"countries.mu": "Mauritius",
|
||||
"countries.mw": "Malawi",
|
||||
"countries.my": "Malaysia",
|
||||
"countries.na": "Namibia",
|
||||
"countries.ne": "Niger",
|
||||
"countries.ng": "Nigeria",
|
||||
"countries.ni": "Nicaragua",
|
||||
"countries.nl": "Netherlands",
|
||||
"countries.no": "Norway",
|
||||
"countries.np": "Nepal",
|
||||
"countries.nr": "Nauru",
|
||||
"countries.nz": "New Zealand",
|
||||
"countries.om": "Oman",
|
||||
"countries.pk": "Pakistan",
|
||||
"countries.pa": "Panama",
|
||||
"countries.pe": "Peru",
|
||||
"countries.ph": "Philippines",
|
||||
"countries.pw": "Palau",
|
||||
"countries.pg": "Papua New Guinea",
|
||||
"countries.pl": "Poland",
|
||||
"countries.kp": "North Korea",
|
||||
"countries.pt": "Portugal",
|
||||
"countries.py": "Paraguay",
|
||||
"countries.qa": "Qatar",
|
||||
"countries.ro": "Romania",
|
||||
"countries.ru": "Russia",
|
||||
"countries.rw": "Rwanda",
|
||||
"countries.sa": "Saudi Arabia",
|
||||
"countries.sd": "Sudan",
|
||||
"countries.sn": "Senegal",
|
||||
"countries.sg": "Singapore",
|
||||
"countries.sb": "Solomon Islands",
|
||||
"countries.sl": "Sierra Leone",
|
||||
"countries.sv": "El Salvador",
|
||||
"countries.sm": "San Marino",
|
||||
"countries.so": "Somalia",
|
||||
"countries.rs": "Serbia",
|
||||
"countries.ss": "South Sudan",
|
||||
"countries.st": "São Tomé and Príncipe",
|
||||
"countries.sr": "Suriname",
|
||||
"countries.sk": "Slovakia",
|
||||
"countries.si": "Slovenia",
|
||||
"countries.se": "Sweden",
|
||||
"countries.sz": "Swaziland",
|
||||
"countries.sc": "Seychelles",
|
||||
"countries.sy": "Syria",
|
||||
"countries.td": "Chad",
|
||||
"countries.tg": "Togo",
|
||||
"countries.th": "Thailand",
|
||||
"countries.tj": "Tajikistan",
|
||||
"countries.tm": "Turkmenistan",
|
||||
"countries.tl": "Timor-Leste",
|
||||
"countries.to": "Tonga",
|
||||
"countries.tt": "Trinidad and Tobago",
|
||||
"countries.tn": "Tunisia",
|
||||
"countries.tr": "Turkey",
|
||||
"countries.tv": "Tuvalu",
|
||||
"countries.tz": "Tanzania",
|
||||
"countries.ug": "Uganda",
|
||||
"countries.ua": "Ukraine",
|
||||
"countries.uy": "Uruguay",
|
||||
"countries.us": "United States",
|
||||
"countries.uz": "Uzbekistan",
|
||||
"countries.va": "Vatican City",
|
||||
"countries.vc": "Saint Vincent and the Grenadines",
|
||||
"countries.ve": "Venezuela",
|
||||
"countries.vn": "Vietnam",
|
||||
"countries.vu": "Vanuatu",
|
||||
"countries.ws": "Samoa",
|
||||
"countries.ye": "Yemen",
|
||||
"countries.za": "Sud-Africa",
|
||||
"countries.zm": "Zambia",
|
||||
"countries.zw": "Zimbabwe",
|
||||
"continents.af": "Africa",
|
||||
"continents.an": "Antarctica",
|
||||
"continents.as": "Asia",
|
||||
"continents.eu": "Europe",
|
||||
"continents.na": "America del Norte",
|
||||
"continents.oc": "Oceania",
|
||||
"continents.sa": "America del Sur"
|
||||
}
|
||||
@@ -2,31 +2,31 @@
|
||||
"settings.inspire": "\"Kunsten å være klok er kunsten å vite hva man skal overse.\"",
|
||||
"settings.locale": "nb",
|
||||
"settings.direction": "ltr",
|
||||
"emails.sender": "%s Teamet",
|
||||
"emails.verification.subject": "Konto Verifisering",
|
||||
"emails.sender": "%s Team",
|
||||
"emails.verification.subject": "Kontobekreftelse",
|
||||
"emails.verification.hello": "Hei {{name}}",
|
||||
"emails.verification.body": "Følg denne lenken for å verifisere din epost adresse.",
|
||||
"emails.verification.footer": "Hvis du ikke ba om å bekrefte denne adressen, kan du ignorere denne meldingen.",
|
||||
"emails.verification.body": "Følg denne lenken for å bekrefte din e-postadresse.",
|
||||
"emails.verification.footer": "Dersom du ikke ba om å bekrefte e-postadressen, kan du se bort fra denne meldingen.",
|
||||
"emails.verification.thanks": "Takk",
|
||||
"emails.verification.signature": "{{project}} teamet",
|
||||
"emails.magicSession.subject": "Login",
|
||||
"emails.verification.signature": "{{project}} team",
|
||||
"emails.magicSession.subject": "Pålogging",
|
||||
"emails.magicSession.hello": "Hei,",
|
||||
"emails.magicSession.body": "Følg denne lenken for å logge inn.",
|
||||
"emails.magicSession.footer": "Hvis du ikke ba om å logge inn med denne adressen, kan du ignorere denne meldingen.",
|
||||
"emails.magicSession.body": "Følg denne lenken for å logge på.",
|
||||
"emails.magicSession.footer": "Dersom du ikke ba om å logge på med denne e-postadressen, kan du se bort fra denne meldingen.",
|
||||
"emails.magicSession.thanks": "Takk",
|
||||
"emails.magicSession.signature": "{{project}} teamet",
|
||||
"emails.recovery.subject": "Reset Passord",
|
||||
"emails.magicSession.signature": "{{project}} team",
|
||||
"emails.recovery.subject": "Nullstille passord",
|
||||
"emails.recovery.hello": "Hei {{name}}",
|
||||
"emails.recovery.body": "Følg denne lenken for å resette ditt {{project}} passord.",
|
||||
"emails.recovery.footer": "Hvis du ikke ba om å resette ditt passord, kan du ignorere denne meldingen.",
|
||||
"emails.recovery.body": "Følg denne lenken for å nullstille ditt {{project}} passord.",
|
||||
"emails.recovery.footer": "Dersom du ikke ba om å nullstille passordet ditt, kan du se bort fra denne meldingen.",
|
||||
"emails.recovery.thanks": "Takk",
|
||||
"emails.recovery.signature": "{{project}} teamet",
|
||||
"emails.recovery.signature": "{{project}} team",
|
||||
"emails.invitation.subject": "Invitasjon til %s Team ved %s",
|
||||
"emails.invitation.hello": "Hei",
|
||||
"emails.invitation.body": "Denne mailen ble sendt til deg fordi {{owner}} hadde lyst til å invitere deg til å bli et medlem av {{team}} teamet ved {{project}}.",
|
||||
"emails.invitation.footer": "Hvis du ikke er interessert, kan du ignorere denne meldingen.",
|
||||
"emails.invitation.body": "Denne meldingen ble sendt til deg fordi {{owner}} ønsket å invitere deg til å bli medlem av {{team}} team ved {{project}}.",
|
||||
"emails.invitation.footer": "Dersom du ikke er interessert, kan du se bort fra denne meldingen.",
|
||||
"emails.invitation.thanks": "Takk",
|
||||
"emails.invitation.signature": "{{project}} teamet",
|
||||
"emails.invitation.signature": "{{project}} team",
|
||||
"locale.country.unknown": "Ukjent",
|
||||
"countries.af": "Afghanistan",
|
||||
"countries.ao": "Angola",
|
||||
@@ -229,4 +229,4 @@
|
||||
"continents.na": "Nord-Amerika",
|
||||
"continents.oc": "Oseania",
|
||||
"continents.sa": "Sør-Amerika"
|
||||
}
|
||||
}
|
||||
@@ -1,232 +0,0 @@
|
||||
{
|
||||
"settings.inspire": "\"Kunsten å være klok er kunsten å vite hva man skal overse.\"",
|
||||
"settings.locale": "no",
|
||||
"settings.direction": "ltr",
|
||||
"emails.sender": "%s Team",
|
||||
"emails.verification.subject": "Kontobekreftelse",
|
||||
"emails.verification.hello": "Hallo {{name}}",
|
||||
"emails.verification.body": "Følg denne lenken for å bekrefte din e-postadresse.",
|
||||
"emails.verification.footer": "Dersom du ikke ba om å bekrefte e-postadressen, kan du se bort fra denne meldingen.",
|
||||
"emails.verification.thanks": "Takk",
|
||||
"emails.verification.signature": "{{project}} team",
|
||||
"emails.magicSession.subject": "Pålogging",
|
||||
"emails.magicSession.hello": "Hei,",
|
||||
"emails.magicSession.body": "Følg denne lenken for å logge på.",
|
||||
"emails.magicSession.footer": "Dersom du ikke ba om å logge på med denne e-postadressen, kan du se bort fra denne meldingen.",
|
||||
"emails.magicSession.thanks": "Takk",
|
||||
"emails.magicSession.signature": "{{project}} team",
|
||||
"emails.recovery.subject": "Nullstille passord",
|
||||
"emails.recovery.hello": "Hallo {{name}}",
|
||||
"emails.recovery.body": "Følg denne lenken for å nullstille ditt {{project}} passord.",
|
||||
"emails.recovery.footer": "Dersom du ikke ba om å nullstille passordet ditt, kan du se bort fra denne meldingen.",
|
||||
"emails.recovery.thanks": "Takk",
|
||||
"emails.recovery.signature": "{{project}} team",
|
||||
"emails.invitation.subject": "Invitasjon til %s Team ved %s",
|
||||
"emails.invitation.hello": "Hallo",
|
||||
"emails.invitation.body": "Denne meldingen ble sendt til deg fordi {{owner}} ønsket å invitere deg til å bli medlem av {{team}} team i {{project}}.",
|
||||
"emails.invitation.footer": "Dersom du ikke er interessert, kan du se bort fra denne meldingen.",
|
||||
"emails.invitation.thanks": "Takk",
|
||||
"emails.invitation.signature": "{{project}} team",
|
||||
"locale.country.unknown": "Ukjent",
|
||||
"countries.af": "Afghanistan",
|
||||
"countries.ao": "Angola",
|
||||
"countries.al": "Albania",
|
||||
"countries.ad": "Andorra",
|
||||
"countries.ae": "De forente arabiske emirater",
|
||||
"countries.ar": "Argentina",
|
||||
"countries.am": "Armenia",
|
||||
"countries.ag": "Antigua og Barbuda",
|
||||
"countries.au": "Australia",
|
||||
"countries.at": "Østerrike",
|
||||
"countries.az": "Aserbajdsjan",
|
||||
"countries.bi": "Burundi",
|
||||
"countries.be": "Belgia",
|
||||
"countries.bj": "Benin",
|
||||
"countries.bf": "Burkina Faso",
|
||||
"countries.bd": "Bangladesh",
|
||||
"countries.bg": "Bulgaria",
|
||||
"countries.bh": "Bahrain",
|
||||
"countries.bs": "Bahamas",
|
||||
"countries.ba": "Bosnia-Hercegovina",
|
||||
"countries.by": "Hviterussland",
|
||||
"countries.bz": "Belize",
|
||||
"countries.bo": "Bolivia",
|
||||
"countries.br": "Brasil",
|
||||
"countries.bb": "Barbados",
|
||||
"countries.bn": "Brunei Darussalam",
|
||||
"countries.bt": "Bhutan",
|
||||
"countries.bw": "Botswana",
|
||||
"countries.cf": "Den sentralafrikanske republikken",
|
||||
"countries.ca": "Canada",
|
||||
"countries.ch": "Sveits",
|
||||
"countries.cl": "Chile",
|
||||
"countries.cn": "Kina",
|
||||
"countries.ci": "Elfenbenskysten",
|
||||
"countries.cm": "Kamerun",
|
||||
"countries.cd": "Den demokratiske republikken Kongo",
|
||||
"countries.cg": "Republikken Kongo",
|
||||
"countries.co": "Colombia",
|
||||
"countries.km": "Komorene",
|
||||
"countries.cv": "Kapp Verde",
|
||||
"countries.cr": "Costa Rica",
|
||||
"countries.cu": "Cuba",
|
||||
"countries.cy": "Kypros",
|
||||
"countries.cz": "Tjekkia",
|
||||
"countries.de": "Tyskland",
|
||||
"countries.dj": "Djibouti",
|
||||
"countries.dm": "Dominica",
|
||||
"countries.dk": "Danmark",
|
||||
"countries.do": "Den dominikanske republikk",
|
||||
"countries.dz": "Algerie",
|
||||
"countries.ec": "Ecuador",
|
||||
"countries.eg": "Egypt",
|
||||
"countries.er": "Eritrea",
|
||||
"countries.es": "Spania",
|
||||
"countries.ee": "Estland",
|
||||
"countries.et": "Etiopia",
|
||||
"countries.fi": "Finland",
|
||||
"countries.fj": "Fiji",
|
||||
"countries.fr": "Frankrike",
|
||||
"countries.fm": "Mikronesia",
|
||||
"countries.ga": "Gabon",
|
||||
"countries.gb": "Storbritannia",
|
||||
"countries.ge": "Georgia",
|
||||
"countries.gh": "Ghana",
|
||||
"countries.gn": "Guinea",
|
||||
"countries.gm": "Gambia",
|
||||
"countries.gw": "Guinea-Bissau",
|
||||
"countries.gq": "Ekvatorial-Guinea",
|
||||
"countries.gr": "Hellas",
|
||||
"countries.gd": "Grenada",
|
||||
"countries.gt": "Guatemala",
|
||||
"countries.gy": "Guyana",
|
||||
"countries.hn": "Honduras",
|
||||
"countries.hr": "Kroatia",
|
||||
"countries.ht": "Haiti",
|
||||
"countries.hu": "Ungarn",
|
||||
"countries.id": "Indonesia",
|
||||
"countries.in": "India",
|
||||
"countries.ie": "Irland",
|
||||
"countries.ir": "Iran",
|
||||
"countries.iq": "Irak",
|
||||
"countries.is": "Island",
|
||||
"countries.il": "Israel",
|
||||
"countries.it": "Italia",
|
||||
"countries.jm": "Jamaica",
|
||||
"countries.jo": "Jordan",
|
||||
"countries.jp": "Japan",
|
||||
"countries.kz": "Kasakhstan",
|
||||
"countries.ke": "Kenya",
|
||||
"countries.kg": "Kirgisistan",
|
||||
"countries.kh": "Kambodsja",
|
||||
"countries.ki": "Kiribati",
|
||||
"countries.kn": "Saint Kitts og Nevis",
|
||||
"countries.kr": "Sør-Korea",
|
||||
"countries.kw": "Kuwait",
|
||||
"countries.la": "Laos",
|
||||
"countries.lb": "Libanon",
|
||||
"countries.lr": "Liberia",
|
||||
"countries.ly": "Libya",
|
||||
"countries.lc": "Saint Lucia",
|
||||
"countries.li": "Liechtenstein",
|
||||
"countries.lk": "Sri Lanka",
|
||||
"countries.ls": "Lesotho",
|
||||
"countries.lt": "Litauen",
|
||||
"countries.lu": "Luxembourg",
|
||||
"countries.lv": "Latvia",
|
||||
"countries.ma": "Marokko",
|
||||
"countries.mc": "Monaco",
|
||||
"countries.md": "Moldova",
|
||||
"countries.mg": "Madagaskar",
|
||||
"countries.mv": "Maldivene",
|
||||
"countries.mx": "Mexico",
|
||||
"countries.mh": "Marshalløyene",
|
||||
"countries.mk": "Nord-Makedonia",
|
||||
"countries.ml": "Mali",
|
||||
"countries.mt": "Malta",
|
||||
"countries.mm": "Myanmar",
|
||||
"countries.me": "Montenegro",
|
||||
"countries.mn": "Mongolia",
|
||||
"countries.mz": "Mozambik",
|
||||
"countries.mr": "Mauritania",
|
||||
"countries.mu": "Mauritius",
|
||||
"countries.mw": "Malawi",
|
||||
"countries.my": "Malaysia",
|
||||
"countries.na": "Namibia",
|
||||
"countries.ne": "Niger",
|
||||
"countries.ng": "Nigeria",
|
||||
"countries.ni": "Nicaragua",
|
||||
"countries.nl": "Nederland",
|
||||
"countries.no": "Norge",
|
||||
"countries.np": "Nepal",
|
||||
"countries.nr": "Nauru",
|
||||
"countries.nz": "New Zealand",
|
||||
"countries.om": "Oman",
|
||||
"countries.pk": "Pakistan",
|
||||
"countries.pa": "Panama",
|
||||
"countries.pe": "Peru",
|
||||
"countries.ph": "Filippinene",
|
||||
"countries.pw": "Palau",
|
||||
"countries.pg": "Papua Ny-Guinea",
|
||||
"countries.pl": "Polen",
|
||||
"countries.kp": "Nord-Korea",
|
||||
"countries.pt": "Portugal",
|
||||
"countries.py": "Paraguay",
|
||||
"countries.qa": "Qatar",
|
||||
"countries.ro": "Romania",
|
||||
"countries.ru": "Russland",
|
||||
"countries.rw": "Rwanda",
|
||||
"countries.sa": "Saudi-Arabia",
|
||||
"countries.sd": "Sudan",
|
||||
"countries.sn": "Senegal",
|
||||
"countries.sg": "Singapore",
|
||||
"countries.sb": "Solomonøyene",
|
||||
"countries.sl": "Sierra Leone",
|
||||
"countries.sv": "El Salvador",
|
||||
"countries.sm": "San Marino",
|
||||
"countries.so": "Somalia",
|
||||
"countries.rs": "Serbia",
|
||||
"countries.ss": "Sør-Sudan",
|
||||
"countries.st": "São Tomé og Príncipe",
|
||||
"countries.sr": "Surinam",
|
||||
"countries.sk": "Slovakia",
|
||||
"countries.si": "Slovenia",
|
||||
"countries.se": "Sverige",
|
||||
"countries.sz": "Swaziland",
|
||||
"countries.sc": "Seychellene",
|
||||
"countries.sy": "Syria",
|
||||
"countries.td": "Tsjad",
|
||||
"countries.tg": "Togo",
|
||||
"countries.th": "Thailand",
|
||||
"countries.tj": "Tajikistan",
|
||||
"countries.tm": "Turkmenistan",
|
||||
"countries.tl": "Øst-Timor",
|
||||
"countries.to": "Tonga",
|
||||
"countries.tt": "Trinidad og Tobago",
|
||||
"countries.tn": "Tunisia",
|
||||
"countries.tr": "Tyrkia",
|
||||
"countries.tv": "Tuvalu",
|
||||
"countries.tz": "Tanzania",
|
||||
"countries.ug": "Uganda",
|
||||
"countries.ua": "Ukraina",
|
||||
"countries.uy": "Uruguay",
|
||||
"countries.us": "Amerikas forente stater",
|
||||
"countries.uz": "Usbekistan",
|
||||
"countries.va": "Vatikanstaten",
|
||||
"countries.vc": "Saint Vincent og Grenadinene",
|
||||
"countries.ve": "Venezuela",
|
||||
"countries.vn": "Vietnam",
|
||||
"countries.vu": "Vanuatu",
|
||||
"countries.ws": "Samoa",
|
||||
"countries.ye": "Jemen",
|
||||
"countries.za": "Sør-Africa",
|
||||
"countries.zm": "Zambia",
|
||||
"countries.zw": "Zimbabwe",
|
||||
"continents.af": "Afrika",
|
||||
"continents.an": "Antarktis",
|
||||
"continents.as": "Asia",
|
||||
"continents.eu": "Europa",
|
||||
"continents.na": "Nord-Amerika",
|
||||
"continents.oc": "Oseania",
|
||||
"continents.sa": "Sør-Amerika"
|
||||
}
|
||||
@@ -3,30 +3,30 @@
|
||||
"settings.locale": "ta",
|
||||
"settings.direction": "ltr",
|
||||
"emails.sender": "%s குழு",
|
||||
"emails.verification.subject": "",
|
||||
"emails.verification.hello": "",
|
||||
"emails.verification.body": "",
|
||||
"emails.verification.footer": "",
|
||||
"emails.verification.thanks": "",
|
||||
"emails.verification.signature": "",
|
||||
"emails.magicSession.subject": "",
|
||||
"emails.magicSession.hello": "",
|
||||
"emails.magicSession.body": "",
|
||||
"emails.magicSession.footer": "",
|
||||
"emails.magicSession.thanks": "",
|
||||
"emails.magicSession.signature": "",
|
||||
"emails.recovery.subject": "",
|
||||
"emails.recovery.hello": "",
|
||||
"emails.recovery.body": "",
|
||||
"emails.recovery.footer": "",
|
||||
"emails.recovery.thanks": "",
|
||||
"emails.recovery.signature": "",
|
||||
"emails.invitation.subject": "",
|
||||
"emails.invitation.hello": "",
|
||||
"emails.invitation.body": "",
|
||||
"emails.invitation.footer": "",
|
||||
"emails.invitation.thanks": "",
|
||||
"emails.invitation.signature": "",
|
||||
"emails.verification.subject": "கணக்கு சரிபார்ப்பு",
|
||||
"emails.verification.hello": "ஏய் {{name}}",
|
||||
"emails.verification.body": "உங்கள் மின்னஞ்சல் முகவரியைச் சரிபார்க்க இந்த இணைப்பைப் பின்தொடரவும்.",
|
||||
"emails.verification.footer": "இந்த முகவரியைச் சரிபார்க்கும்படி உங்களிடம் கேட்கப்படவில்லை என்றால், இந்தச் செய்தியை நீங்கள் புறக்கணிக்கலாம்.",
|
||||
"emails.verification.thanks": "நன்றி",
|
||||
"emails.verification.signature": "{{project}} குழு ",
|
||||
"emails.magicSession.subject": "உள்நுழைய",
|
||||
"emails.magicSession.hello": "ஏய்,",
|
||||
"emails.magicSession.body": "இந்த இணைப்பைப் பின்தொடரவும் உள்நுழைய",
|
||||
"emails.magicSession.footer": "இந்த மின்னஞ்சலைப் பயன்படுத்தி உள்நுழையுமாறு உங்களிடம் கேட்கப்படாவிட்டால், இந்தச் செய்தியைப் புறக்கணிக்கலாம்.",
|
||||
"emails.magicSession.thanks": "நன்றி",
|
||||
"emails.magicSession.signature": "{{project}} குழு",
|
||||
"emails.recovery.subject": "கடவுச்சொல் மீட்டமைப்பு",
|
||||
"emails.recovery.hello": "வணக்கம் {{name}}",
|
||||
"emails.recovery.body": "மீட்டமைக்க இந்த இணைப்பைப் பின்தொடரவும் {{project}} கடவுச்சொல்.",
|
||||
"emails.recovery.footer": "உங்கள் கடவுச்சொல்லை மீட்டமைக்கும்படி உங்களிடம் கேட்கப்படவில்லை என்றால், இந்தச் செய்தியை நீங்கள் புறக்கணிக்கலாம்.",
|
||||
"emails.recovery.thanks": "நன்றி",
|
||||
"emails.recovery.signature": "{{project}} குழு",
|
||||
"emails.invitation.subject": "அழைப்பிதழ் %s குழு %s ",
|
||||
"emails.invitation.hello": "வணக்கம்",
|
||||
"emails.invitation.body": "{{project}} இல் {{team}} குழுவில் உறுப்பினராக உங்களை {{owner}} அழைக்க விரும்புவதால், இந்த அஞ்சல் உங்களுக்கு அனுப்பப்பட்டது.",
|
||||
"emails.invitation.footer": "உங்களுக்கு ஆர்வம் இல்லை என்றால், இந்த செய்தியை நீங்கள் புறக்கணிக்கலாம்.",
|
||||
"emails.invitation.thanks": "நன்றி",
|
||||
"emails.invitation.signature": "{{project}} குழு",
|
||||
"locale.country.unknown": "அறியவில்லை",
|
||||
"countries.af": "ஆப்கானித்தான்",
|
||||
"countries.ao": "அங்கோலா",
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
{
|
||||
"settings.inspire": "\"ఏది విస్మరించాలో తెలుసుకోవడమే తెలివైన వ్యక్తి యొక్క కళ.\"",
|
||||
"settings.locale": "te",
|
||||
"settings.direction": "ltr",
|
||||
"emails.sender": "%s జట్టు",
|
||||
"emails.verification.subject": "ఖాతా ధృవీకరణ",
|
||||
"emails.verification.hello": "నమస్కారము {{name}}",
|
||||
"emails.verification.body": "ఈ లింక్ ద్వారా ఇమెయిల్ ని ధృవీకరించండి",
|
||||
"emails.verification.footer": "మీరు ఈ చిరునామాను ధృవీకరించమని అడగనట్లయితే, మీరు ఈ సందేశాన్ని విస్మరించవచ్చు",
|
||||
"emails.verification.thanks": "ధన్యవాదాలు",
|
||||
"emails.verification.signature": "{{project}} జట్",
|
||||
"emails.magicSession.subject": "లాగిన్",
|
||||
"emails.magicSession.hello": "నమస్కారము,",
|
||||
"emails.magicSession.body": "లాగిన్ చేయడానికి ఈ లింక్ ని అనుసరించండి",
|
||||
"emails.magicSession.footer": "మీరు ఈ ఇమెయిల్ ని ఉపయోగించి లాగిన్ చేయమని అడగకపోతే, మీరు ఈ సందేశాన్ని విస్మరించవచ్చు",
|
||||
"emails.magicSession.thanks": "ధన్యవాదాలు",
|
||||
"emails.magicSession.signature": "{{project}} జట్",
|
||||
"emails.recovery.subject": "పాస్వర్డ్ రీసెట్",
|
||||
"emails.recovery.hello": "నమస్కారమ {{name}}",
|
||||
"emails.recovery.body": "మీ {{project}} పాస్వర్డ్ ని రీసెట్ చేయడానికి ఈ లింక్ ని అనుసరించండి",
|
||||
"emails.recovery.footer": "మీరు మీ పాస్వర్డ్ ని రీసెట్ చేయమని అడగనట్లయితే, మీరు ఈ సందేశాన్ని విస్మరించవచ్చు",
|
||||
"emails.recovery.thanks": "ధన్యవాదాల",
|
||||
"emails.recovery.signature": "{{project}} జట్",
|
||||
"emails.invitation.subject": "%s వద్ద %s బృందానికి ఆహ్వానం",
|
||||
"emails.invitation.hello": "నమస్కారమ",
|
||||
"emails.invitation.body": "{{owner}} మిమ్మల్ని {{project}} లో {{team}} బృందంలో సభ్యునిగా ఉండమని ఆహ్వానించాలనుకుంటున్నందున ఈ మెయిల్ మీకు పంపబడింది.",
|
||||
"emails.invitation.footer": "మీకు ఆసక్తి లేకుంటే, మీరు ఈ సందేశాన్ని విస్మరించవచ్చు.",
|
||||
"emails.invitation.thanks": "ధన్యవాదాల",
|
||||
"emails.invitation.signature": "{{project}} జట్",
|
||||
"locale.country.unknown": "తెలియని",
|
||||
"countries.af": "ఆఫ్ఘనిస్తాన్",
|
||||
"countries.ao": "అంగోలా",
|
||||
"countries.al": "అల్బేనియా",
|
||||
"countries.ad": "అండోరా",
|
||||
"countries.ae": "యునైటెడ్ అరబ్ ఎమిరేట్స్",
|
||||
"countries.ar": "అర్జెంటీనా",
|
||||
"countries.am": "అర్మేనియా",
|
||||
"countries.ag": "ఆంటిగ్వా మరియు బార్బుడా",
|
||||
"countries.au": "ఆస్ట్రేలియా",
|
||||
"countries.at": "ఆస్ట్రియా",
|
||||
"countries.az": "అజర్బైజాన్",
|
||||
"countries.bi": "బురుండి",
|
||||
"countries.be": "బెల్జియం",
|
||||
"countries.bj": "బెనిన్",
|
||||
"countries.bf": "బుర్కినా ఫాసో",
|
||||
"countries.bd": "బంగ్లాదేశ్",
|
||||
"countries.bg": "బల్గేరియా",
|
||||
"countries.bh": "బహ్రెయిన్",
|
||||
"countries.bs": "బహామాస్",
|
||||
"countries.ba": "బోస్నియా మరియు హెర్జెగోవినా",
|
||||
"countries.by": "బెలారస్",
|
||||
"countries.bz": "బెలీజ్",
|
||||
"countries.bo": "బొలీవియా",
|
||||
"countries.br": "బ్రెజిల్",
|
||||
"countries.bb": "బార్బడోస్",
|
||||
"countries.bn": "బ్రూనై",
|
||||
"countries.bt": "భూటాన్",
|
||||
"countries.bw": "బోట్స్వానా",
|
||||
"countries.cf": "సెంట్రల్ ఆఫ్రికన్ రిపబ్లిక్",
|
||||
"countries.ca": "కెనడా",
|
||||
"countries.ch": "స్విట్జర్లాండ్",
|
||||
"countries.cl": "చిలీ",
|
||||
"countries.cn": "చైనా",
|
||||
"countries.ci": "ఐవరీ కోస్ట్",
|
||||
"countries.cm": "కామెరూన్",
|
||||
"countries.cd": "DR కాంగో",
|
||||
"countries.cg": "రిపబ్లిక్ ఆఫ్ కాంగో",
|
||||
"countries.co": "కొలంబియా",
|
||||
"countries.km": "కొమోరోస్",
|
||||
"countries.cv": "కేప్ వర్దె",
|
||||
"countries.cr": "కోస్టా రికా",
|
||||
"countries.cu": "క్యూబా",
|
||||
"countries.cy": "సైప్రస్",
|
||||
"countries.cz": "చెకియా",
|
||||
"countries.de": "జర్మనీ",
|
||||
"countries.dj": "జిబౌటీ",
|
||||
"countries.dm": "డొమినికా",
|
||||
"countries.dk": "డెన్మార్క్",
|
||||
"countries.do": "డొమినికన్ రిపబ్లిక్",
|
||||
"countries.dz": "అల్జీరియా",
|
||||
"countries.ec": "ఈక్వెడార్",
|
||||
"countries.eg": "ఈజిప్ట్",
|
||||
"countries.er": "ఎరిత్రియా",
|
||||
"countries.es": "స్పెయిన్",
|
||||
"countries.ee": "ఎస్టోనియా",
|
||||
"countries.et": "ఇథియోపియా",
|
||||
"countries.fi": "ఫిన్లాండ్",
|
||||
"countries.fj": "ఫిజీ",
|
||||
"countries.fr": "ఫ్రాన్స్",
|
||||
"countries.fm": "మైక్రోనేషియా",
|
||||
"countries.ga": "గాబోన్",
|
||||
"countries.gb": "యునైటెడ్ కింగ్డమ్",
|
||||
"countries.ge": "జార్జియా",
|
||||
"countries.gh": "ఘానా",
|
||||
"countries.gn": "గినియా",
|
||||
"countries.gm": "గాంబియా",
|
||||
"countries.gw": "గిన్-బిస్సౌ",
|
||||
"countries.gq": "ఈక్వటోరియల్ గిన్",
|
||||
"countries.gr": "గ్రీస్",
|
||||
"countries.gd": "గ్రెనడా",
|
||||
"countries.gt": "గ్వాటెమాల",
|
||||
"countries.gy": "గయానా",
|
||||
"countries.hn": "హోండురాస్",
|
||||
"countries.hr": "క్రొయేషియా",
|
||||
"countries.ht": "హైతీ",
|
||||
"countries.hu": "హంగేరి",
|
||||
"countries.id": "ఇండోనేషియా",
|
||||
"countries.in": "భారతదేశం",
|
||||
"countries.ie": "ఐర్లాండ్",
|
||||
"countries.ir": "ఇరాన్",
|
||||
"countries.iq": "ఇరాక్",
|
||||
"countries.is": "ఐస్లాండ్",
|
||||
"countries.il": "ఇజ్రాయెల్",
|
||||
"countries.it": "ఇటలీ",
|
||||
"countries.jm": "జమైకా",
|
||||
"countries.jo": "జోర్డాన్",
|
||||
"countries.jp": "జపాన్",
|
||||
"countries.kz": "కజకిస్తాన్",
|
||||
"countries.ke": "కెన్యా",
|
||||
"countries.kg": "కిర్గిజ్స్తాన్",
|
||||
"countries.kh": "కంబోడియా",
|
||||
"countries.ki": "కిరిబాటి",
|
||||
"countries.kn": "సెయింట్ కిట్స్ అండ్ నెవిస్",
|
||||
"countries.kr": "దక్షిణ కొరియా",
|
||||
"countries.kw": "కువైట్",
|
||||
"countries.la": "లావోస్",
|
||||
"countries.lb": "లెబనాన్",
|
||||
"countries.lr": "లైబీరియా",
|
||||
"countries.ly": "లిబియా",
|
||||
"countries.lc": "సెయింట్ లూసియా",
|
||||
"countries.li": "లీచ్టెన్స్టెయిన్",
|
||||
"countries.lk": "శ్రీలంక",
|
||||
"countries.ls": "లెసోతో",
|
||||
"countries.lt": "లిథువేనియా",
|
||||
"countries.lu": "లక్సెంబర్గ్",
|
||||
"countries.lv": "లాట్వియా",
|
||||
"countries.ma": "మొరాకో",
|
||||
"countries.mc": "మొనాకో",
|
||||
"countries.md": "మోల్డోవా",
|
||||
"countries.mg": "మడగాస్కర్",
|
||||
"countries.mv": "మాల్దీవులు",
|
||||
"countries.mx": "మెక్సికో",
|
||||
"countries.mh": "మార్షల్ దీవులు",
|
||||
"countries.mk": "మాసిడోనియా",
|
||||
"countries.ml": "మాలి",
|
||||
"countries.mt": "మాల్టా",
|
||||
"countries.mm": "మయన్మార్",
|
||||
"countries.me": "మాంటెనెగ్రో",
|
||||
"countries.mn": "మంగోలియా",
|
||||
"countries.mz": "మొజాంబిక్",
|
||||
"countries.mr": "మౌరిటానియా",
|
||||
"countries.mu": "మారిషస్",
|
||||
"countries.mw": "మలావి",
|
||||
"countries.my": "మలేషియా",
|
||||
"countries.na": "నమీబియా",
|
||||
"countries.ne": "నైజర్",
|
||||
"countries.ng": "నైజీరియా",
|
||||
"countries.ni": "నికరాగ్వా",
|
||||
"countries.nl": "నెదర్లాండ్స్",
|
||||
"countries.no": "నార్వే",
|
||||
"countries.np": "నేపాల్",
|
||||
"countries.nr": "నౌరు",
|
||||
"countries.nz": "న్యూజిలాండ్",
|
||||
"countries.om": "ఒమన్",
|
||||
"countries.pk": "పాకిస్తాన్",
|
||||
"countries.pa": "పనామా",
|
||||
"countries.pe": "పెరూ",
|
||||
"countries.ph": "ఫిలిప్పీన్స్",
|
||||
"countries.pw": "పలావ్",
|
||||
"countries.pg": "పాపువా న్యూ గిన్",
|
||||
"countries.pl": "పోలాండ్",
|
||||
"countries.kp": "ఉత్తర కొరియా",
|
||||
"countries.pt": "పోర్చుగల్",
|
||||
"countries.py": "పరాగ్వే",
|
||||
"countries.qa": "ఖతార్",
|
||||
"countries.ro": "రొమేనియా",
|
||||
"countries.ru": "రష్యా",
|
||||
"countries.rw": "రువాండా",
|
||||
"countries.sa": "సౌదీ అరేబియా",
|
||||
"countries.sd": "సూడాన్",
|
||||
"countries.sn": "సెనెగల్",
|
||||
"countries.sg": "సింగపూర్",
|
||||
"countries.sb": "సోలమన్ దీవులు",
|
||||
"countries.sl": "సియెర్రా లియోన్",
|
||||
"countries.sv": "ఎల్ సాల్వడార్",
|
||||
"countries.sm": "శాన్ మారినో",
|
||||
"countries.so": "సోమాలియా",
|
||||
"countries.rs": "సెర్బియా",
|
||||
"countries.ss": "దక్షిణ సూడాన్",
|
||||
"countries.st": "సావో టోమ్ మరియు ప్రిన్సిపే",
|
||||
"countries.sr": "సురినామ్",
|
||||
"countries.sk": "స్లోవేకియా",
|
||||
"countries.si": "స్లోవేనియా",
|
||||
"countries.se": "స్వీడన్",
|
||||
"countries.sz": "స్వాజిలాండ్",
|
||||
"countries.sc": "సీషెల్స్",
|
||||
"countries.sy": "సిరియా",
|
||||
"countries.td": "చాడ్",
|
||||
"countries.tg": "టోగో",
|
||||
"countries.th": "థాయిలాండ్",
|
||||
"countries.tj": "తజికిస్తాన్",
|
||||
"countries.tm": "తుర్క్మెనిస్తాన్",
|
||||
"countries.tl": "తైమోర్-లెస్టే",
|
||||
"countries.to": "టాంగా",
|
||||
"countries.tt": "ట్రినిడాడ్ మరియు టొబాగో",
|
||||
"countries.tn": "ట్యునీషియా",
|
||||
"countries.tr": "టర్కీ",
|
||||
"countries.tv": "తువాలు",
|
||||
"countries.tz": "టాంజానియా",
|
||||
"countries.ug": "ఉగాండా",
|
||||
"countries.ua": "ఉక్రెయిన్",
|
||||
"countries.uy": "ఉరుగ్వే",
|
||||
"countries.us": "యునైటెడ్ స్టేట్స్",
|
||||
"countries.uz": "ఉజ్బెకిస్తాన్",
|
||||
"countries.va": "వాటికన్ నగరం",
|
||||
"countries.vc": "సెయింట్ విన్సెంట్ మరియు గ్రెనడిన్స్",
|
||||
"countries.ve": "వెనిజులా",
|
||||
"countries.vn": "వియత్నాం",
|
||||
"countries.vu": "వనాటు",
|
||||
"countries.ws": "సమోవా",
|
||||
"countries.ye": "యెమెన్",
|
||||
"countries.za": "దక్షిణాఫ్రికా",
|
||||
"countries.zm": "జాంబియా",
|
||||
"countries.zw": "జింబాబ్వే",
|
||||
"continents.af": "ఆఫ్రికా",
|
||||
"continents.an": "అంటార్కిటికా",
|
||||
"continents.as": "ఆసియా",
|
||||
"continents.eu": "యూరోప్",
|
||||
"continents.na": "ఉత్తర అమెరికా",
|
||||
"continents.oc": "ఓషియానియా",
|
||||
"continents.sa": "దక్షిణ అమెరికా"
|
||||
}
|
||||
@@ -3,30 +3,30 @@
|
||||
"settings.locale": "ur",
|
||||
"settings.direction": "rtl",
|
||||
"emails.sender": "%s ٹیم",
|
||||
"emails.verification.subject": "",
|
||||
"emails.verification.hello": "",
|
||||
"emails.verification.body": "",
|
||||
"emails.verification.footer": "",
|
||||
"emails.verification.thanks": "",
|
||||
"emails.verification.signature": "",
|
||||
"emails.magicSession.subject": "",
|
||||
"emails.magicSession.hello": "",
|
||||
"emails.magicSession.body": "",
|
||||
"emails.magicSession.footer": "",
|
||||
"emails.magicSession.thanks": "",
|
||||
"emails.magicSession.signature": "",
|
||||
"emails.recovery.subject": "",
|
||||
"emails.recovery.hello": "",
|
||||
"emails.recovery.body": "",
|
||||
"emails.recovery.footer": "",
|
||||
"emails.recovery.thanks": "",
|
||||
"emails.recovery.signature": "",
|
||||
"emails.invitation.subject": "",
|
||||
"emails.invitation.hello": "",
|
||||
"emails.invitation.body": "",
|
||||
"emails.invitation.footer": "",
|
||||
"emails.invitation.thanks": "",
|
||||
"emails.invitation.signature": "",
|
||||
"emails.verification.subject": "اکاؤنٹ کی تصدیق",
|
||||
"emails.verification.hello": "خوش آمدید {{name}}",
|
||||
"emails.verification.body": "براہ کرم اپنے ای میل کی تصدیق کے لیے درج ذیل لنک پر عمل کریں۔",
|
||||
"emails.verification.footer": "اگر آپ نے اس پتے کی تصدیق کے لیے نہیں کہا تو آپ اس پیغام کو نظر انداز کر سکتے ہیں۔",
|
||||
"emails.verification.thanks": "شکریہ",
|
||||
"emails.verification.signature": "ٹیم۔ {{project}}",
|
||||
"emails.magicSession.subject": "اگ ان کریں",
|
||||
"emails.magicSession.hello": "خوش آمدید,",
|
||||
"emails.magicSession.body": "لاگ ان کرنے کے لیے اس لنک پر عمل کریں۔",
|
||||
"emails.magicSession.footer": "اگر آپ نے اس ای میل کا استعمال کرتے ہوئے لاگ ان کرنے کے لیے نہیں کہا تو آپ اس پیغام کو نظر انداز کر سکتے ہیں۔",
|
||||
"emails.magicSession.thanks": "شکریہ",
|
||||
"emails.magicSession.signature": "ٹیم۔ {{project}}",
|
||||
"emails.recovery.subject": "پاس ورڈ ری سیٹ۔",
|
||||
"emails.recovery.hello": "ہیلو {{name}}",
|
||||
"emails.recovery.body": "{{project}} کا پاس ورڈ تبدیل کرنے کے لیے درج ذیل لنک پر عمل کریں",
|
||||
"emails.recovery.footer": "اگر آپ نے اپنا پاس ورڈ دوبارہ ترتیب دینے کے لیے نہیں کہا تو آپ اس پیغام کو نظر انداز کر سکتے ہیں۔",
|
||||
"emails.recovery.thanks": "شکریہ",
|
||||
"emails.recovery.signature": "ٹیم۔ {{project}}",
|
||||
"emails.invitation.subject": "%s پر %s ٹیم کو دعوت",
|
||||
"emails.invitation.hello": "خوش آمدید",
|
||||
"emails.invitation.body": "یہ پیغام آپ کو اس لیے بھیجا گیا تھا کہ {{owner}} نے آپ کو {{project}} میں {{team}} ٹیم کا رکن بننے کی دعوت بھیجی",
|
||||
"emails.invitation.footer": "اگر آپ دلچسپی نہیں رکھتے تو آپ اس پیغام کو نظر انداز کر سکتے ہیں۔",
|
||||
"emails.invitation.thanks": "شکریہ",
|
||||
"emails.invitation.signature": "ٹیم۔ {{project}",
|
||||
"locale.country.unknown": "نامعلوم",
|
||||
"countries.af": "افغانستان",
|
||||
"countries.ao": "انگولا",
|
||||
@@ -229,4 +229,4 @@
|
||||
"continents.na": "شمالی امریکہ",
|
||||
"continents.oc": "اوشینیا",
|
||||
"continents.sa": "جنوبی امریکہ"
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ return [
|
||||
],
|
||||
[
|
||||
'name' => '_APP_CONSOLE_WHITELIST_ROOT',
|
||||
'description' => 'This option allows you to disable the creation of new users on the Appwrite console. When enabled only 1 user will be able to use the registration form. New users can be added by invting them to your project. By default this option is enabled.',
|
||||
'description' => 'This option allows you to disable the creation of new users on the Appwrite console. When enabled only 1 user will be able to use the registration form. New users can be added by inviting them to your project. By default this option is enabled.',
|
||||
'introduction' => '0.8.0',
|
||||
'default' => 'enabled',
|
||||
'required' => false,
|
||||
@@ -368,7 +368,7 @@ return [
|
||||
'variables' => [
|
||||
[
|
||||
'name' => '_APP_STORAGE_LIMIT',
|
||||
'description' => 'Maximun file size allowed for file upload. The default value is 10MB limitation. You should pass your size limit value in bytes.',
|
||||
'description' => 'Maximum file size allowed for file upload. The default value is 10MB limitation. You should pass your size limit value in bytes.',
|
||||
'introduction' => '0.7.0',
|
||||
'default' => '10000000',
|
||||
'required' => false,
|
||||
@@ -464,7 +464,7 @@ return [
|
||||
],
|
||||
[
|
||||
'name' => '_APP_FUNCTIONS_ENVS',
|
||||
'description' => 'Deprectated with 0.8.0, use \'_APP_FUNCTIONS_RUNTIMES\' instead!',
|
||||
'description' => 'Deprecated with 0.8.0, use \'_APP_FUNCTIONS_RUNTIMES\' instead!',
|
||||
'introduction' => '0.7.0',
|
||||
'default' => 'node-16.0,php-7.4,python-3.9,ruby-3.0,java-16.0',
|
||||
'required' => false,
|
||||
@@ -542,4 +542,4 @@ return [
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
];
|
||||
@@ -46,7 +46,7 @@ App::post('/v1/account')
|
||||
->label('abuse-limit', 10)
|
||||
->param('userId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('email', '', new Email(), 'User email.')
|
||||
->param('password', '', new Password(), 'User password. Must be between 6 to 32 chars.')
|
||||
->param('password', '', new Password(), 'User password. Must be at least 8 chars.')
|
||||
->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true)
|
||||
->inject('request')
|
||||
->inject('response')
|
||||
@@ -150,7 +150,7 @@ App::post('/v1/account/sessions')
|
||||
->label('abuse-limit', 10)
|
||||
->label('abuse-key', 'url:{url},email:{param-email}')
|
||||
->param('email', '', new Email(), 'User email.')
|
||||
->param('password', '', new Password(), 'User password. Must be between 6 to 32 chars.')
|
||||
->param('password', '', new Password(), 'User password. Must be at least 8 chars.')
|
||||
->inject('request')
|
||||
->inject('response')
|
||||
->inject('dbForInternal')
|
||||
@@ -1367,8 +1367,8 @@ App::patch('/v1/account/password')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->param('password', '', new Password(), 'New user password. Must be between 6 to 32 chars.')
|
||||
->param('oldPassword', '', new Password(), 'Old user password. Must be between 6 to 32 chars.', true)
|
||||
->param('password', '', new Password(), 'User password. Must be at least 8 chars.')
|
||||
->param('oldPassword', '', new Password(), 'Old user password. Must be at least 8 chars.', true)
|
||||
->inject('response')
|
||||
->inject('user')
|
||||
->inject('dbForInternal')
|
||||
@@ -1416,7 +1416,7 @@ App::patch('/v1/account/email')
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->param('email', '', new Email(), 'User email.')
|
||||
->param('password', '', new Password(), 'User password. Must be between 6 to 32 chars.')
|
||||
->param('password', '', new Password(), 'User password. Must be at least 8 chars.')
|
||||
->inject('response')
|
||||
->inject('user')
|
||||
->inject('dbForInternal')
|
||||
@@ -1869,8 +1869,8 @@ App::put('/v1/account/recovery')
|
||||
->label('abuse-key', 'url:{url},userId:{param-userId}')
|
||||
->param('userId', '', new UID(), 'User account UID address.')
|
||||
->param('secret', '', new Text(256), 'Valid reset token.')
|
||||
->param('password', '', new Password(), 'New password. Must be between 6 to 32 chars.')
|
||||
->param('passwordAgain', '', new Password(), 'New password again. Must be between 6 to 32 chars.')
|
||||
->param('password', '', new Password(), 'User password. Must be at least 8 chars.')
|
||||
->param('passwordAgain', '', new Password(), 'New password again. Must be at least 8 chars.')
|
||||
->inject('response')
|
||||
->inject('dbForInternal')
|
||||
->inject('audits')
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Appwrite\Auth\Auth;
|
||||
use Appwrite\Auth\Validator\Password;
|
||||
use Appwrite\Database\Validator\CustomId;
|
||||
use Appwrite\Network\Validator\CNAME;
|
||||
use Appwrite\Network\Validator\Domain as DomainValidator;
|
||||
@@ -8,7 +9,6 @@ use Appwrite\Network\Validator\URL;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Utopia\Abuse\Adapters\TimeLimit;
|
||||
use Utopia\App;
|
||||
use Utopia\CLI\CLI;
|
||||
use Utopia\Audit\Audit;
|
||||
use Utopia\Config\Config;
|
||||
use Utopia\Database\Database;
|
||||
@@ -534,7 +534,7 @@ App::delete('/v1/projects/:projectId')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->param('projectId', '', new UID(), 'Project unique ID.')
|
||||
->param('password', '', new UID(), 'Your user password for confirmation. Must be between 6 to 32 chars.')
|
||||
->param('password', '', new Password(), 'Your user password for confirmation. Must be at least 8 chars.')
|
||||
->inject('response')
|
||||
->inject('user')
|
||||
->inject('dbForConsole')
|
||||
|
||||
@@ -836,7 +836,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
|
||||
->param('borderColor', '', new HexColor(), 'Preview image border color. Use a valid HEX color, no # is needed for prefix.', true)
|
||||
->param('borderRadius', 0, new Range(0, 4000), 'Preview image border radius in pixels. Pass an integer between 0 to 4000.', true)
|
||||
->param('opacity', 1, new Range(0,1, Range::TYPE_FLOAT), 'Preview image opacity. Only works with images having an alpha channel (like png). Pass a number between 0 to 1.', true)
|
||||
->param('rotation', 0, new Range(0,360), 'Preview image rotation in degrees. Pass an integer between 0 and 360.', true)
|
||||
->param('rotation', 0, new Range(-360,360), 'Preview image rotation in degrees. Pass an integer between -360 and 360.', true)
|
||||
->param('background', '', new HexColor(), 'Preview image background color. Only works with transparent images (png). Use a valid HEX color, no # is needed for prefix.', true)
|
||||
->param('output', '', new WhiteList(\array_keys(Config::getParam('storage-outputs')), true), 'Output format type (jpeg, jpg, png, gif and webp).', true)
|
||||
->inject('request')
|
||||
@@ -974,7 +974,7 @@ App::get('/v1/storage/buckets/:bucketId/files/:fileId/preview')
|
||||
}
|
||||
|
||||
if (!empty($rotation)) {
|
||||
$image->setRotation($rotation);
|
||||
$image->setRotation(($rotation + 360) % 360);
|
||||
}
|
||||
|
||||
$output = (empty($output)) ? $type : $output;
|
||||
|
||||
@@ -36,7 +36,7 @@ App::post('/v1/users')
|
||||
->label('sdk.response.model', Response::MODEL_USER)
|
||||
->param('userId', '', new CustomId(), 'Unique Id. Choose your own unique ID or pass the string `unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
|
||||
->param('email', '', new Email(), 'User email.')
|
||||
->param('password', '', new Password(), 'User password. Must be between 6 to 32 chars.')
|
||||
->param('password', '', new Password(), 'User password. Must be at least 8 chars.')
|
||||
->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true)
|
||||
->inject('response')
|
||||
->inject('dbForInternal')
|
||||
|
||||
+2
-1
@@ -536,6 +536,7 @@ Locale::setLanguageFromJSON('jv', __DIR__.'/config/locale/translations/jv.json')
|
||||
Locale::setLanguageFromJSON('kn', __DIR__.'/config/locale/translations/kn.json');
|
||||
Locale::setLanguageFromJSON('km', __DIR__.'/config/locale/translations/km.json');
|
||||
Locale::setLanguageFromJSON('ko', __DIR__.'/config/locale/translations/ko.json');
|
||||
Locale::setLanguageFromJSON('la', __DIR__.'/config/locale/translations/la.json');
|
||||
Locale::setLanguageFromJSON('lb', __DIR__.'/config/locale/translations/lb.json');
|
||||
Locale::setLanguageFromJSON('lt', __DIR__.'/config/locale/translations/lt.json');
|
||||
Locale::setLanguageFromJSON('lv', __DIR__.'/config/locale/translations/lv.json');
|
||||
@@ -546,7 +547,6 @@ Locale::setLanguageFromJSON('nb', __DIR__.'/config/locale/translations/nb.json')
|
||||
Locale::setLanguageFromJSON('ne', __DIR__.'/config/locale/translations/ne.json');
|
||||
Locale::setLanguageFromJSON('nl', __DIR__.'/config/locale/translations/nl.json');
|
||||
Locale::setLanguageFromJSON('nn', __DIR__.'/config/locale/translations/nn.json');
|
||||
Locale::setLanguageFromJSON('no', __DIR__.'/config/locale/translations/no.json');
|
||||
Locale::setLanguageFromJSON('or', __DIR__.'/config/locale/translations/or.json');
|
||||
Locale::setLanguageFromJSON('pa', __DIR__.'/config/locale/translations/pa.json');
|
||||
Locale::setLanguageFromJSON('pl', __DIR__.'/config/locale/translations/pl.json');
|
||||
@@ -562,6 +562,7 @@ Locale::setLanguageFromJSON('sl', __DIR__ . '/config/locale/translations/sl.json
|
||||
Locale::setLanguageFromJSON('sq', __DIR__ . '/config/locale/translations/sq.json');
|
||||
Locale::setLanguageFromJSON('sv', __DIR__ . '/config/locale/translations/sv.json');
|
||||
Locale::setLanguageFromJSON('ta', __DIR__ . '/config/locale/translations/ta.json');
|
||||
Locale::setLanguageFromJSON('te', __DIR__.'/config/locale/translations/te.json');
|
||||
Locale::setLanguageFromJSON('th', __DIR__.'/config/locale/translations/th.json');
|
||||
Locale::setLanguageFromJSON('tl', __DIR__.'/config/locale/translations/tl.json');
|
||||
Locale::setLanguageFromJSON('tr', __DIR__.'/config/locale/translations/tr.json');
|
||||
|
||||
+2
-1
@@ -474,7 +474,8 @@ $server->onMessage(function (int $connection, string $message) use ($server, $re
|
||||
*
|
||||
* Abuse limits are sending 32 times per minute and connection.
|
||||
*/
|
||||
$timeLimit = new TimeLimit('url:{url},conection:{connection}', 32, 60, $database);
|
||||
$timeLimit = new TimeLimit('url:{url},connection:{connection}', 32, 60, $database);
|
||||
|
||||
$timeLimit
|
||||
->setParam('{connection}', $connection)
|
||||
->setParam('{container}', $containerId);
|
||||
|
||||
@@ -213,6 +213,7 @@ $logs = $this->getParam('logs', null);
|
||||
:class="(doc[attr.key].length - 1) === index ? 'margin-bottom' : ''"
|
||||
type="checkbox"
|
||||
:name="attr.key"
|
||||
:value="attr.key"
|
||||
:checked="doc[attr.key][index]" />
|
||||
</template>
|
||||
<template x-if="attr.type === 'string' && !attr.format">
|
||||
|
||||
@@ -465,7 +465,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled', true);
|
||||
<div class="row responsive thin margin-top-small">
|
||||
<?php foreach ($events as $i => $event): ?>
|
||||
<div class="col span-6 text-one-liner margin-bottom text-height-large text-size-small" title="<?php echo $event; ?>">
|
||||
<input type="checkbox" name="events" data-ls-bind="{{project-function.events}}" id="<?php echo $event; ?>" value="<?php echo $event; ?>" />
|
||||
<input type="checkbox" name="events" data-ls-bind="{{project-function.events}}" id="<?php echo $event; ?>" value="<?php echo $event; ?>" data-by-key="true" />
|
||||
|
||||
<label class="inline" for="<?php echo $event; ?>"><?php echo $event; ?></label>
|
||||
</div>
|
||||
|
||||
@@ -59,7 +59,7 @@ $scopes = $this->getParam('scopes', []);
|
||||
<div class="row responsive thin">
|
||||
<?php foreach ($scopes as $i => $scope): ?>
|
||||
<div class="col span-6 text-one-liner margin-bottom text-height-large text-size-small" title="<?php echo $scope; ?>">
|
||||
<input data-ls-attrs="id=scope-<?php echo $scope; ?>" type="checkbox" name="scopes" data-ls-bind="{{key.scopes}}" value="<?php echo $scope; ?>" />
|
||||
<input data-ls-attrs="id=scope-<?php echo $scope; ?>" type="checkbox" name="scopes" data-ls-bind="{{key.scopes}}" value="<?php echo $scope; ?>" data-by-key="true" />
|
||||
|
||||
<label class="inline" for="scope-<?php echo $scope; ?>"><?php echo $scope; ?></label>
|
||||
</div>
|
||||
@@ -162,7 +162,7 @@ $scopes = $this->getParam('scopes', []);
|
||||
<div class="row responsive thin">
|
||||
<?php foreach ($scopes as $i => $scope): ?>
|
||||
<div class="col span-6 text-one-liner margin-bottom text-height-large text-size-small" title="<?php echo $scope; ?>">
|
||||
<input type="checkbox" name="scopes" id="<?php echo $scope; ?>" value="<?php echo $scope; ?>" />
|
||||
<input type="checkbox" name="scopes" id="<?php echo $scope; ?>" value="<?php echo $scope; ?>" data-by-key="true" />
|
||||
|
||||
<label class="inline" for="<?php echo $scope; ?>"><?php echo $scope; ?></label>
|
||||
</div>
|
||||
|
||||
@@ -66,7 +66,7 @@ $events = array_keys($this->getParam('events', []));
|
||||
<div class="row responsive thin">
|
||||
<?php foreach ($events as $i => $event): ?>
|
||||
<div class="col span-6 text-one-liner margin-bottom text-height-large text-size-small" title="<?php echo $event; ?>">
|
||||
<input type="checkbox" name="events" data-ls-bind="{{webhook.events}}" id="update-<?php echo $event; ?>" value="<?php echo $event; ?>" />
|
||||
<input type="checkbox" name="events" data-ls-bind="{{webhook.events}}" id="update-<?php echo $event; ?>" value="<?php echo $event; ?>" data-by-key="true" />
|
||||
|
||||
<label class="inline" for="update-<?php echo $event; ?>"><?php echo $event; ?></label>
|
||||
</div>
|
||||
@@ -188,7 +188,7 @@ $events = array_keys($this->getParam('events', []));
|
||||
<div class="row responsive thin">
|
||||
<?php foreach ($events as $i => $event): ?>
|
||||
<div class="col span-6 text-one-liner margin-bottom text-height-large text-size-small" title="<?php echo $event; ?>">
|
||||
<input type="checkbox" name="events" id="add-<?php echo $event; ?>" value="<?php echo $event; ?>" />
|
||||
<input type="checkbox" name="events" id="add-<?php echo $event; ?>" value="<?php echo $event; ?>" data-by-key="true" />
|
||||
|
||||
<label class="inline" for="add-<?php echo $event; ?>"><?php echo $event; ?></label>
|
||||
</div>
|
||||
|
||||
@@ -46,7 +46,7 @@ $root = ($this->getParam('root') !== 'disabled');
|
||||
<input name="email" type="email" autocomplete="email" placeholder="" required data-ls-bind="{{router.params.email}}">
|
||||
|
||||
<label>Password</label>
|
||||
<input name="password" type="password" autocomplete="off" placeholder="" required data-forms-password-meter pattern=".{6,}" title="Six or more characters">
|
||||
<input name="password" type="password" autocomplete="off" placeholder="" required data-forms-password-meter pattern=".{8,}" title="Eight or more characters">
|
||||
|
||||
<div class="agree margin-top-large margin-bottom-large">
|
||||
<div class="pull-start margin-end-small margin-bottom">
|
||||
|
||||
@@ -51,7 +51,7 @@ if(!empty($platforms)) {
|
||||
<?php endforeach; ?>
|
||||
<base href="/">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5" />
|
||||
<meta name="theme-color" content="#24f4d4">
|
||||
<meta name="theme-color" content="#f02e65">
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="<?php echo $this->escape($this->getParam('title', '')); ?>" />
|
||||
<meta property="og:description" content="<?php echo $this->escape($this->getParam('description', '')); ?>" />
|
||||
|
||||
@@ -359,7 +359,7 @@ class FunctionsV1 extends Worker
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($list[$container]) && !(\substr($list[$container]->getStatus(), 0, 2) === 'Up')) { // Remove conatiner if not online
|
||||
if (isset($list[$container]) && !(\substr($list[$container]->getStatus(), 0, 2) === 'Up')) { // Remove container if not online
|
||||
$stdout = '';
|
||||
$stderr = '';
|
||||
|
||||
@@ -381,7 +381,7 @@ class FunctionsV1 extends Worker
|
||||
* Make sure no access to NFS server / storage volumes
|
||||
* Access Appwrite REST from internal network for improved performance
|
||||
*/
|
||||
if (!isset($list[$container])) { // Create contianer if not ready
|
||||
if (!isset($list[$container])) { // Create container if not ready
|
||||
$stdout = '';
|
||||
$stderr = '';
|
||||
|
||||
|
||||
Generated
+57
-50
@@ -3655,16 +3655,16 @@
|
||||
},
|
||||
{
|
||||
"name": "nikic/php-parser",
|
||||
"version": "v4.13.1",
|
||||
"version": "v4.13.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nikic/PHP-Parser.git",
|
||||
"reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd"
|
||||
"reference": "210577fe3cf7badcc5814d99455df46564f3c077"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/63a79e8daa781cac14e5195e63ed8ae231dd10fd",
|
||||
"reference": "63a79e8daa781cac14e5195e63ed8ae231dd10fd",
|
||||
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077",
|
||||
"reference": "210577fe3cf7badcc5814d99455df46564f3c077",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3705,9 +3705,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/nikic/PHP-Parser/issues",
|
||||
"source": "https://github.com/nikic/PHP-Parser/tree/v4.13.1"
|
||||
"source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2"
|
||||
},
|
||||
"time": "2021-11-03T20:52:16+00:00"
|
||||
"time": "2021-11-30T19:35:32+00:00"
|
||||
},
|
||||
{
|
||||
"name": "openlss/lib-array2xml",
|
||||
@@ -4523,22 +4523,27 @@
|
||||
},
|
||||
{
|
||||
"name": "psr/container",
|
||||
"version": "1.1.2",
|
||||
"version": "2.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/container.git",
|
||||
"reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
|
||||
"reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
|
||||
"reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
|
||||
"url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963",
|
||||
"reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.4.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Container\\": "src/"
|
||||
@@ -4565,9 +4570,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/php-fig/container/issues",
|
||||
"source": "https://github.com/php-fig/container/tree/1.1.2"
|
||||
"source": "https://github.com/php-fig/container/tree/2.0.2"
|
||||
},
|
||||
"time": "2021-11-05T16:50:12+00:00"
|
||||
"time": "2021-11-05T16:47:00+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/cli-parser",
|
||||
@@ -5587,28 +5592,29 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v5.3.11",
|
||||
"version": "v5.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "3e7ab8f5905058984899b05a4648096f558bfeba"
|
||||
"reference": "ec3661faca1d110d6c307e124b44f99ac54179e3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/3e7ab8f5905058984899b05a4648096f558bfeba",
|
||||
"reference": "3e7ab8f5905058984899b05a4648096f558bfeba",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/ec3661faca1d110d6c307e124b44f99ac54179e3",
|
||||
"reference": "ec3661faca1d110d6c307e124b44f99ac54179e3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"symfony/deprecation-contracts": "^2.1",
|
||||
"symfony/deprecation-contracts": "^2.1|^3",
|
||||
"symfony/polyfill-mbstring": "~1.0",
|
||||
"symfony/polyfill-php73": "^1.8",
|
||||
"symfony/polyfill-php80": "^1.16",
|
||||
"symfony/service-contracts": "^1.1|^2",
|
||||
"symfony/string": "^5.1"
|
||||
"symfony/service-contracts": "^1.1|^2|^3",
|
||||
"symfony/string": "^5.1|^6.0"
|
||||
},
|
||||
"conflict": {
|
||||
"psr/log": ">=3",
|
||||
"symfony/dependency-injection": "<4.4",
|
||||
"symfony/dotenv": "<5.1",
|
||||
"symfony/event-dispatcher": "<4.4",
|
||||
@@ -5620,12 +5626,12 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/log": "^1|^2",
|
||||
"symfony/config": "^4.4|^5.0",
|
||||
"symfony/dependency-injection": "^4.4|^5.0",
|
||||
"symfony/event-dispatcher": "^4.4|^5.0",
|
||||
"symfony/lock": "^4.4|^5.0",
|
||||
"symfony/process": "^4.4|^5.0",
|
||||
"symfony/var-dumper": "^4.4|^5.0"
|
||||
"symfony/config": "^4.4|^5.0|^6.0",
|
||||
"symfony/dependency-injection": "^4.4|^5.0|^6.0",
|
||||
"symfony/event-dispatcher": "^4.4|^5.0|^6.0",
|
||||
"symfony/lock": "^4.4|^5.0|^6.0",
|
||||
"symfony/process": "^4.4|^5.0|^6.0",
|
||||
"symfony/var-dumper": "^4.4|^5.0|^6.0"
|
||||
},
|
||||
"suggest": {
|
||||
"psr/log": "For using the console logger",
|
||||
@@ -5665,7 +5671,7 @@
|
||||
"terminal"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/console/tree/v5.3.11"
|
||||
"source": "https://github.com/symfony/console/tree/v5.4.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -5681,7 +5687,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-11-21T19:41:05+00:00"
|
||||
"time": "2021-11-29T15:30:56+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-intl-grapheme",
|
||||
@@ -6009,22 +6015,21 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/service-contracts",
|
||||
"version": "v2.5.0",
|
||||
"version": "v3.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/service-contracts.git",
|
||||
"reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc"
|
||||
"reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc",
|
||||
"reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc",
|
||||
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/36715ebf9fb9db73db0cb24263c79077c6fe8603",
|
||||
"reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"psr/container": "^1.1",
|
||||
"symfony/deprecation-contracts": "^2.1"
|
||||
"php": ">=8.0.2",
|
||||
"psr/container": "^2.0"
|
||||
},
|
||||
"conflict": {
|
||||
"ext-psr": "<1.1|>=2"
|
||||
@@ -6035,7 +6040,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "2.5-dev"
|
||||
"dev-main": "3.0-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
@@ -6072,7 +6077,7 @@
|
||||
"standards"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/service-contracts/tree/v2.5.0"
|
||||
"source": "https://github.com/symfony/service-contracts/tree/v3.0.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -6088,35 +6093,37 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-11-04T16:48:04+00:00"
|
||||
"time": "2021-11-04T17:53:12+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/string",
|
||||
"version": "v5.3.10",
|
||||
"version": "v6.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/string.git",
|
||||
"reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c"
|
||||
"reference": "ba727797426af0f587f4800566300bdc0cda0777"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/string/zipball/d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c",
|
||||
"reference": "d70c35bb20bbca71fc4ab7921e3c6bda1a82a60c",
|
||||
"url": "https://api.github.com/repos/symfony/string/zipball/ba727797426af0f587f4800566300bdc0cda0777",
|
||||
"reference": "ba727797426af0f587f4800566300bdc0cda0777",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"php": ">=8.0.2",
|
||||
"symfony/polyfill-ctype": "~1.8",
|
||||
"symfony/polyfill-intl-grapheme": "~1.0",
|
||||
"symfony/polyfill-intl-normalizer": "~1.0",
|
||||
"symfony/polyfill-mbstring": "~1.0",
|
||||
"symfony/polyfill-php80": "~1.15"
|
||||
"symfony/polyfill-mbstring": "~1.0"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/translation-contracts": "<2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/error-handler": "^4.4|^5.0",
|
||||
"symfony/http-client": "^4.4|^5.0",
|
||||
"symfony/translation-contracts": "^1.1|^2",
|
||||
"symfony/var-exporter": "^4.4|^5.0"
|
||||
"symfony/error-handler": "^5.4|^6.0",
|
||||
"symfony/http-client": "^5.4|^6.0",
|
||||
"symfony/translation-contracts": "^2.0|^3.0",
|
||||
"symfony/var-exporter": "^5.4|^6.0"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -6155,7 +6162,7 @@
|
||||
"utf8"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/string/tree/v5.3.10"
|
||||
"source": "https://github.com/symfony/string/tree/v6.0.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -6171,7 +6178,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-10-27T18:21:46+00:00"
|
||||
"time": "2021-10-29T07:35:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "textalk/websocket",
|
||||
|
||||
@@ -73,7 +73,6 @@ services:
|
||||
- ./app:/usr/src/code/app
|
||||
# - ./vendor:/usr/src/code/vendor
|
||||
- ./docs:/usr/src/code/docs
|
||||
- ./public:/usr/src/code/public
|
||||
- ./src:/usr/src/code/src
|
||||
# - ./debug:/tmp
|
||||
- ./dev:/usr/local/dev
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.
|
||||
This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
|
||||
Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.
|
||||
This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
|
||||
@@ -1 +1 @@
|
||||
Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email recieved by the user.
|
||||
Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
## 0.2.2
|
||||
|
||||
- Fixed an error that happend when the OAuth session creation request was sent before any other API call
|
||||
- Fixed an error that happened when the OAuth session creation request was sent before any other API call
|
||||
- Fixed a bug in the Avatars service where location URL generation had syntax error
|
||||
|
||||
## 0.2.1
|
||||
@@ -27,7 +27,7 @@
|
||||
## 0.2.0
|
||||
|
||||
- Updated flutter_web_auth plugin to version 0.2.4
|
||||
- Added per project unique callback for OAuth2 redirects to aviod conflicts between multiple Appwrite projects
|
||||
- Added per project unique callback for OAuth2 redirects to avoid conflicts between multiple Appwrite projects
|
||||
|
||||
## 0.1.1
|
||||
|
||||
@@ -56,9 +56,9 @@
|
||||
|
||||
## 0.0.9
|
||||
|
||||
- Updated deafult params
|
||||
- Updated default params
|
||||
|
||||
## 0.0.8
|
||||
|
||||
- Fixed compilation error in Client class
|
||||
- Shorter description for package
|
||||
- Shorter description for package
|
||||
@@ -120,7 +120,7 @@
|
||||
|
||||
## 0.2.2
|
||||
|
||||
- Fixed an error that happend when the OAuth session creation request was sent before any other API call
|
||||
- Fixed an error that happened when the OAuth session creation request was sent before any other API call
|
||||
- Fixed a bug in the Avatars service where location URL generation had syntax error
|
||||
|
||||
## 0.2.1
|
||||
@@ -130,7 +130,7 @@
|
||||
## 0.2.0
|
||||
|
||||
- Updated flutter_web_auth plugin to version 0.2.4
|
||||
- Added per project unique callback for OAuth2 redirects to aviod conflicts between multiple Appwrite projects
|
||||
- Added per project unique callback for OAuth2 redirects to avoid conflicts between multiple Appwrite projects
|
||||
|
||||
## 0.1.1
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
|
||||
## 0.0.9
|
||||
|
||||
- Updated deafult params
|
||||
- Updated default params
|
||||
|
||||
## 0.0.8
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Adding new features may require various configurations options to be set by the
|
||||
|
||||
This tutorial will cover, how to properly add a new environment variable in Appwrite.
|
||||
|
||||
### Naming environment varialbe
|
||||
### Naming environment variable
|
||||
The environment variables in Appwrite are prefixed with `_APP_`. If it belongs to a specific category, the category name is appended as `_APP_REDIS` for the redis category. The available categories are General, Redis, MariaDB, InfluxDB, StatsD, SMTP, Storage and Functions. Finally a properly describing name is given to the variable. For example `_APP_REDIS_HOST` is an environment variable for redis connection host. You can find more information on available categories and existing environment variables in the [environment variables doc](https://appwrite.io/docs/environment-variables).
|
||||
|
||||
### Describe new environment variable
|
||||
|
||||
@@ -0,0 +1,257 @@
|
||||
# Creating a new functions runtime 🏃
|
||||
|
||||
This document is part of the Appwrite contributors' guide. Before you continue reading this document make sure you have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/master/CODE_OF_CONDUCT.md) and the [Contributing Guide](https://github.com/appwrite/appwrite/blob/master/CONTRIBUTING.md).
|
||||
|
||||
## Getting started
|
||||
Function Runtimes allow you to execute code written in any language and form the basis of Appwrite's Cloud Functions! Appwrite's goal is to support as many function runtimes as possible.
|
||||
|
||||
## 1. Prerequisites
|
||||
For a function runtime to work, two prerequisites **must** be met due to the way Appwrite's Runtime Execution Model works:
|
||||
|
||||
- [ ] The Language in question must be able to run a web server that can serve JSON and text.
|
||||
- [ ] The Runtime must be able to be packaged into a Docker container
|
||||
|
||||
Note: Both Compiled and Interpreted languages work with Appwrite's execution model but are written in slightly different ways.
|
||||
|
||||
It's really easy to contribute to an open-source project, but when using GitHub, there are a few steps we need to follow. This section will take you step-by-step through the process of preparing your local version of Appwrite, where you can make any changes without affecting Appwrite right away.
|
||||
> If you are experienced with GitHub or have made a pull request before, you can skip to [Implement new runtime](https://github.com/appwrite/appwrite/blob/master/docs/tutorials/add-runtime.md#2-implement-new-runtime).
|
||||
|
||||
### 1.1 Fork the Appwrite repository
|
||||
|
||||
Before making any changes, you will need to fork Appwrite's repository to keep branches on the official repo clean. To do that, visit [Appwrite's Runtime repository](https://github.com/appwrite/php-runtimes) and click on the fork button.
|
||||
|
||||
[](https://github.com/appwrite/appwrite/blob/master/docs/tutorials/images/fork.png)
|
||||
|
||||
This will redirect you from `github.com/appwrite/php-runtimes` to `github.com/YOUR_USERNAME/php-runtimes`, meaning all changes you do are only done inside your repository. Once you are there, click the highlighted `Code` button, copy the URL and clone the repository to your computer using the `git clone` command:
|
||||
```bash
|
||||
$ git clone COPIED_URL
|
||||
```
|
||||
|
||||
> To fork a repository, you will need a basic understanding of CLI and git-cli binaries installed. If you are a beginner, we recommend you to use `Github Desktop`. It is a clean and simple visual Git client.
|
||||
|
||||
Finally, you will need to create a `feat-XXX-YYY-runtime` branch based on the `refactor` branch and switch to it. The `XXX` should represent the issue ID and `YYY` the runtime name.
|
||||
|
||||
## 2. Implement new runtime
|
||||
|
||||
### 2.1 Preparing the files for your new runtime
|
||||
The first step to writing a new runtime is to create a folder within `/runtimes` with the name of the runtime and the version separated by a dash. For instance, if I was to write a Rust Runtime with version 1.55 the folder name would be: `rust-1.55`
|
||||
|
||||
Within that folder you will need to create a few basic files that all Appwrite runtimes require:
|
||||
```
|
||||
Dockerfile - Dockerfile that explains how the container will be built.
|
||||
README.md - A readme file explaining the runtime and any special notes for the runtime. A good example of this is the PHP 8.0 runtime.
|
||||
```
|
||||
|
||||
### 2.2 Differences between compiled and interpreted runtimes
|
||||
Runtimes within Appwrite are created differently depending on whether they are compiled or interpreted. This is due to the fundamental differences between the two ways of running the code.
|
||||
|
||||
Interpreted languages have both a `build.sh` file and a `launch.sh` file.
|
||||
The `build.sh` file for an interpreted runtime is normally used for installing any dependencies for both the server itself and the user's code and then to copy it to the `/usr/code` folder which is then packaged and can be used later for running the server.
|
||||
The build script is always executed during the build stage of tag deployment.
|
||||
|
||||
The `launch.sh` file for an interpreted runtime should extract the `/tmp/code.tar.gz` file that contains both the user's code and the dependencies. This tarball was created by Appwrite from the `/usr/code` folder and should install the dependencies that were pre-installed by the build stage and move them into the relevant locations for that runtime. It will then run the server ready for execution.
|
||||
|
||||
---
|
||||
Compiled Languages only have a `build.sh` file.
|
||||
The `build.sh` script for a compiled runtime is used to move the user's source code and rename it into source files for the runtime (The `APPWRITE_ENTRYPOINT_NAME` environment variable can help with this) it will also build the code and move it into the `/usr/code` folder. Compiled runtime executables **must** be called `runtime` for the ubuntu or alpine images to detect and run them.
|
||||
|
||||
#### Note:
|
||||
`/tmp/code.tar.gz` is always created from the `/usr/code` folder in the build stage. If you need any files for either compiled or interpreted runtimes you should place them there and extract them from the `/tmp/code.tar.gz` during the `launch.sh` script to get the files you need.
|
||||
|
||||
### 2.3 Writing the runtime
|
||||
Internally the runtime can be anything you like as long as it follows the standards set by the other runtimes.
|
||||
|
||||
The best way to go about writing a runtime is like so:
|
||||
Initialize a web server that runs on port 3000 and uses any IP Address (0.0.0.0) and on each `POST` request do the following:
|
||||
1. Check that the `x-internal-challenge` header matches the `APPWRITE_INTERNAL_RUNTIME_KEY` environment variable. If not return an error with a `401` status code and an `unauthorized` error message.
|
||||
2. Decode the executor's JSON POST request. This normally looks like so:
|
||||
```json
|
||||
{
|
||||
"path": "/usr/code",
|
||||
"file": "index.js",
|
||||
"env": {
|
||||
"hello":"world!"
|
||||
},
|
||||
"payload":"An Example Payload",
|
||||
"timeout": 10
|
||||
}
|
||||
```
|
||||
For a compiled language you can disregard the `path` and `file` attribute if you like,
|
||||
|
||||
`timeout` is also an optional parameter to deal with, if you can handle it please do. Otherwise, it doesn't matter since the connection will simply be dropped by the executor.
|
||||
|
||||
You must create two classes for users to use within their scripts. A `Request` Class and a `Response` class
|
||||
The `Request` class must store `env`, `payload` and `headers` and pass them to the user's function.
|
||||
The Request always goes before the response in the user's function parameters.
|
||||
The `Response` class must have two functions.
|
||||
- A `send(string)` function which will return text to the request
|
||||
- and a `json(object)` function which will return JSON to the request setting the appropriate headers
|
||||
|
||||
For interpreted languages use the `path` and `file` parameters to find the file and require it.
|
||||
Please make sure to add appropriate checks to make sure the imported file is a function that you can execute.
|
||||
|
||||
5. Finally execute the function and handle whatever response the user's code returns. Try to wrap the function into a `try catch` statement to handle any errors the user's function encounters and return them cleanly to the executor with the error schema.
|
||||
|
||||
### 2.4 The Error Schema
|
||||
All errors that occur during the execution of a user's function **MUST** be returned using this JSON Object otherwise Appwrite will be unable to parse them for the user.
|
||||
```json
|
||||
{
|
||||
"code": 500, // (Int) Use 404 if function not found or use 401 if the x-internal-challenge check failed.
|
||||
"message": "Error: Tried to divide by 0 \n /usr/code/index.js:80:7", // (String) Try to return a stacktrace and detailed error message if possible. This is shown to the user.
|
||||
}
|
||||
```
|
||||
|
||||
### 2.5 Writing your Dockerfile
|
||||
The Dockerfile is very important as it's the environment you are creating to run build the runtime and also run the code if you are writing an Interpreted Runtime (Compiled runtimes will use an alpine or ubuntu image)
|
||||
|
||||
The first thing you need to do is find a docker image to base your runtime off, You can find these at [Docker Hub](https://hub.docker.com). If possible try to use verified official builds of the language you are creating a runtime for.
|
||||
|
||||
Next in your Dockerfile at the start add the docker image you want to base it off at the top like so:
|
||||
```bash
|
||||
FROM Dart:2.12 # Dart is used as an example.
|
||||
```
|
||||
This will download and require the image when you build your runtime and allow you to use the toolset of the language you are building a runtime for.
|
||||
|
||||
Create a user and group for the runtime, this user will be used to both build and run the code:
|
||||
```bash
|
||||
RUN groupadd -g 2000 appwrite \
|
||||
&& useradd -m -u 2001 -g appwrite appwrite
|
||||
```
|
||||
|
||||
then create the folders you will use in your build step:
|
||||
```bash
|
||||
RUN mkdir -p /usr/local/src/
|
||||
RUN mkdir -p /usr/code
|
||||
RUN mkdir -p /usr/workspace
|
||||
RUN mkdir -p /usr/builtCode
|
||||
```
|
||||
|
||||
Next copy your source code and set the working directory for the image like so:
|
||||
```
|
||||
WORKDIR /usr/local/src
|
||||
COPY . /usr/local/src
|
||||
```
|
||||
|
||||
Next, you want to make sure you are adding execute permissions to any scripts you may run, the main ones are `build.sh` and `launch.sh`. You can run commands in Dockerfile's using the `RUN` prefix like so:
|
||||
```
|
||||
RUN chmod +x ./build.sh
|
||||
RUN chmod +x ./launch.sh
|
||||
```
|
||||
Note: Do not chmod a `launch.sh` file if you don't have one.
|
||||
|
||||
If needed use the `RUN` commands to install any dependencies you require for the build stage.
|
||||
|
||||
Next set the permissions for the user you created so your build and run step will have access to them:
|
||||
```
|
||||
RUN ["chown", "-R", "appwrite:appwrite", "/usr/local/src"]
|
||||
RUN ["chown", "-R", "appwrite:appwrite", "/usr/code"]
|
||||
RUN ["chown", "-R", "appwrite:appwrite", "/usr/workspace"]
|
||||
RUN ["chown", "-R", "appwrite:appwrite", "/usr/builtCode"]
|
||||
```
|
||||
|
||||
Finally, you'll add a `CMD` command. For an interpreted language this should be:
|
||||
```
|
||||
CMD ["/usr/local/src/launch.sh"]
|
||||
```
|
||||
Since this will use your launch script when the runtime starts.
|
||||
|
||||
For a compiled language this must be:
|
||||
```
|
||||
CMD ["tail", "-f", "/dev/null"]
|
||||
```
|
||||
so the build steps can be run.
|
||||
|
||||
## 3. Building your Docker image and adding it to the list
|
||||
With your runtime successfully created you can now move on to building your docker image and adding it to the script files used for generating all of the image files.
|
||||
|
||||
Open up the `/runtimes/buildLocalOnly.sh` script first and add your runtime to it. The following is an example with dart version 2.12
|
||||
```
|
||||
echo 'Dart 2.12...'
|
||||
docker build -t dart-runtime:2.12 ./runtimes/dart-2.12
|
||||
```
|
||||
Next, open up the `/runtimes/build.sh` script and also add your runtime to it. This one is slightly different as this is the one that will be used for cross-platform compiles and deploying it to Docker hub. The following is an example also with dart version 2.12:
|
||||
```
|
||||
echo 'Dart 2.12...'
|
||||
docker buildx build --platform linux/amd64,linux/arm64 -t dart-runtime:2.12 ./runtimes/dart-2.12/ --push
|
||||
```
|
||||
|
||||
## 4. Adding the runtime to the runtimes list
|
||||
In `src/Runtimes/Runtimes` create a new entry in the `__construct()` method in the Runtimes class like so:
|
||||
```
|
||||
$dart = new Runtime('dart', 'Dart');
|
||||
$dart->addVersion('2.12', 'dart-runtime:2.12', 'appwrite-ubuntu:20.04', [System::X86, System::ARM]);
|
||||
$this->runtimes['dart'] = $dart;
|
||||
```
|
||||
This is an example of what you would do for a compiled language such as dart.
|
||||
|
||||
The first line is creating a new language entry, The first parameter is the internal name and the second one is the external one which is what the user will see in Appwrite.
|
||||
|
||||
The second line adds a new version to the language entry, I'll break down the parameters:
|
||||
```
|
||||
1: Version - The version of the runtime you are creating.
|
||||
2: Build Image - The image used to build the code
|
||||
3: Run Image - The image used to run the code.
|
||||
For interpreted languages, this is normally the same as the Build Image, but for compiled languages, this can be either "appwrite-alpine:3.13.6" or "appwrite-ubuntu:20.04"
|
||||
We recommend using Alpine when possible and using Ubuntu if the runtime doesn't work on Alpine.
|
||||
4: Platforms Supported - These are the architectures this runtime is available to.
|
||||
```
|
||||
The third line simply adds the new runtime to the main list.
|
||||
|
||||
## 5. Adding tests
|
||||
|
||||
### 5.1 Writing your test execution script
|
||||
Adding tests for your runtime is simple, go into the `/tests/resources` folder and create a folder for the language you are creating then within the folder create a source code file for the language you are writing a runtime for as if you were creating a user function for your runtime. Within this user function you are writing all you need to do is return some JSON with the following schema:
|
||||
```json
|
||||
{
|
||||
"normal": "Hello World!",
|
||||
"env1": request.env['ENV1'], // ENV1 from the request environment variable
|
||||
"payload": request.payload, // Payload from the request
|
||||
}
|
||||
```
|
||||
### 5.2 Creating the test packaging script for your runtime
|
||||
With your test execution written you can move on to writing the script used to package your test execution script into a tarball for later use by the test system. Move into `/test/resources` again and notice how we have shell scripts for all runtimes we have made tests for.
|
||||
|
||||
Next create a shell script yourself with your language name. As an example, the shell script name for dart would be `package-dart.sh`
|
||||
|
||||
Within this newly created script copy-paste this script and replace all the `LANGUAGE_NAME` parts with your language's name
|
||||
```
|
||||
echo 'LANGUAGE_NAME Packaging...'
|
||||
rm $(pwd)/tests/resources/LANGUAGE_NAME.tar.gz
|
||||
tar -zcvf $(pwd)/tests/resources/LANGUAGE_NAME.tar.gz -C $(pwd)/tests/resources/LANGUAGE_NAME .
|
||||
```
|
||||
Then save this file. Then `cd` into the root of the `php-runtimes` project in a terminal. Run the following command replacing the `LANGUAGE_NAME` with your language's name:
|
||||
```
|
||||
chmod +x ./tests/resources/package-LANGUAGE_NAME.sh && ./tests/resources/package-LANGUAGE_NAME.sh
|
||||
```
|
||||
This command adds execution permissions to your script and executes it.
|
||||
|
||||
NOTE: If you ever want to repackage your script you can simply run: `./tests/resources/package-LANGUAGE_NAME.sh` in the root of the `php-runtimes` project since you don't have to change permissions more than once.
|
||||
|
||||
### 5.3 Adding your runtime to the main testing script
|
||||
Now you have created your test execution script and have packaged it up for your runtime to execute you can now add it to the main testing script. Open up the `./tests/Runtimes/RuntimesTest.php` file and find the part where we are defining `$this->tests`.
|
||||
|
||||
Once you have found this, Add your own entry into this array like so:
|
||||
```php
|
||||
'LANGUAGE_NAME-VERSION' => [
|
||||
'code' => $functionsDir . ' /LANGUAGE_NAME.tar.gz',
|
||||
'entrypoint' => 'Test file', // Replace with the name of the test file you wrote in ./tests/resources/LANGUAGE_NAME
|
||||
'timeout' => 15,
|
||||
'runtime' => 'LANGUAGE_NAME-VERSION',
|
||||
'tarname' => 'LANGUAGE_NAME-VERSION.tar.gz', // Note: If your version has a point in it replace it with a dash instead for this value.
|
||||
],
|
||||
```
|
||||
Make sure to replace all instances of `LANGUAGE_NAME` with your language's name and `VERSION` with your runtime's version.
|
||||
|
||||
Once you have done this and saved it, it is finally time to move onto one of the final steps.
|
||||
|
||||
### 5.4 Running the tests.
|
||||
Running the tests is easy, simply run `docker-compose up` in the root of the `php-runtimes` folder. This will launch a Docker container with the test script and start running through all the runtimes making sure to test them thoroughly.
|
||||
|
||||
If all tests pass then congratulations! You can now go ahead and file a PR against the `php-runtimes` repo making sure to target the `refactor` branch, make sure you're ready to respond to any feedback which can arise during our code review.
|
||||
|
||||
## 6. Raise a pull request
|
||||
First of all, commit the changes with the message `Added XXX Runtime` and push it. This will publish a new branch to your forked version of Appwrite. If you visit it at `github.com/YOUR_USERNAME/php-runtimes`, you will see a new alert saying you are ready to submit a pull request. Follow the steps GitHub provides, and at the end, you will have your pull request submitted.
|
||||
|
||||
##  Stuck ?
|
||||
|
||||
If you need any help with the contribution, feel free to head over to [our discord channel](https://appwrite.io/discord) and we'll be happy to help you out.
|
||||
+43
-18
@@ -9,7 +9,7 @@ const gulpCleanCSS = require('gulp-clean-css');
|
||||
|
||||
// Config
|
||||
|
||||
const configApp = {
|
||||
const configApp = {
|
||||
mainFile: 'app.js',
|
||||
src: [
|
||||
'public/scripts/dependencies/litespeed.js',
|
||||
@@ -82,7 +82,7 @@ const configApp = {
|
||||
'public/scripts/views/general/switch.js',
|
||||
'public/scripts/views/general/theme.js',
|
||||
'public/scripts/views/general/version.js',
|
||||
|
||||
|
||||
'public/scripts/views/paging/back.js',
|
||||
'public/scripts/views/paging/next.js',
|
||||
|
||||
@@ -93,19 +93,44 @@ const configApp = {
|
||||
'public/scripts/views/ui/phases.js',
|
||||
'public/scripts/views/ui/trigger.js',
|
||||
],
|
||||
|
||||
dest: './public/dist/scripts'
|
||||
};
|
||||
|
||||
const configDep = {
|
||||
mainFile: 'app-dep.js',
|
||||
src: [
|
||||
//'node_modules/appwrite/src/sdk.js',
|
||||
'public/scripts/dependencies/appwrite.js',
|
||||
'public/scripts/dependencies/chart.js',
|
||||
'public/scripts/dependencies/markdown-it.js',
|
||||
'public/scripts/dependencies/pell.js',
|
||||
'public/scripts/dependencies/prism.js',
|
||||
'public/scripts/dependencies/turndown.js',
|
||||
'node_modules/chart.js/dist/chart.js',
|
||||
'node_modules/markdown-it/dist/markdown-it.js',
|
||||
'node_modules/pell/dist/pell.js',
|
||||
'node_modules/turndown/dist/turndown.js',
|
||||
// PrismJS Core
|
||||
'node_modules/prismjs/components/prism-core.min.js',
|
||||
// PrismJS Languages
|
||||
'node_modules/prismjs/components/prism-markup.min.js',
|
||||
'node_modules/prismjs/components/prism-css.min.js',
|
||||
'node_modules/prismjs/components/prism-clike.min.js',
|
||||
'node_modules/prismjs/components/prism-javascript.min.js',
|
||||
'node_modules/prismjs/components/prism-bash.min.js',
|
||||
'node_modules/prismjs/components/prism-csharp.min.js',
|
||||
'node_modules/prismjs/components/prism-dart.min.js',
|
||||
'node_modules/prismjs/components/prism-go.min.js',
|
||||
'node_modules/prismjs/components/prism-graphql.min.js',
|
||||
'node_modules/prismjs/components/prism-http.min.js',
|
||||
'node_modules/prismjs/components/prism-java.min.js',
|
||||
'node_modules/prismjs/components/prism-json.min.js',
|
||||
'node_modules/prismjs/components/prism-kotlin.min.js',
|
||||
'node_modules/prismjs/components/prism-markup-templating.min.js',
|
||||
'node_modules/prismjs/components/prism-php.min.js',
|
||||
'node_modules/prismjs/components/prism-powershell.min.js',
|
||||
'node_modules/prismjs/components/prism-python.min.js',
|
||||
'node_modules/prismjs/components/prism-ruby.min.js',
|
||||
'node_modules/prismjs/components/prism-swift.min.js',
|
||||
'node_modules/prismjs/components/prism-typescript.min.js',
|
||||
'node_modules/prismjs/components/prism-yaml.min.js',
|
||||
// PrismJS Plugins
|
||||
'node_modules/prismjs/plugins/line-numbers/prism-line-numbers.min.js',
|
||||
],
|
||||
dest: './public/dist/scripts'
|
||||
};
|
||||
@@ -119,40 +144,40 @@ const config = {
|
||||
dest: './public/dist/scripts'
|
||||
};
|
||||
|
||||
function lessLTR () {
|
||||
function lessLTR() {
|
||||
return src('./public/styles/default-ltr.less')
|
||||
.pipe(gulpLess())
|
||||
.pipe(gulpCleanCSS({compatibility: 'ie8'}))
|
||||
.pipe(gulpCleanCSS({ compatibility: 'ie8' }))
|
||||
.pipe(dest('./public/dist/styles'));
|
||||
}
|
||||
|
||||
function lessRTL () {
|
||||
function lessRTL() {
|
||||
return src('./public/styles/default-rtl.less')
|
||||
.pipe(gulpLess())
|
||||
.pipe(gulpCleanCSS({compatibility: 'ie8'}))
|
||||
.pipe(gulpCleanCSS({ compatibility: 'ie8' }))
|
||||
.pipe(dest('./public/dist/styles'));
|
||||
}
|
||||
|
||||
function concatApp () {
|
||||
function concatApp() {
|
||||
return src(configApp.src)
|
||||
.pipe(gulpConcat(configApp.mainFile))
|
||||
.pipe(gulpJsmin())
|
||||
.pipe(dest(configApp.dest));
|
||||
}
|
||||
|
||||
function concatDep () {
|
||||
function concatDep() {
|
||||
return src(configDep.src)
|
||||
.pipe(gulpConcat(configDep.mainFile))
|
||||
.pipe(gulpJsmin())
|
||||
.pipe(dest(configDep.dest));
|
||||
}
|
||||
|
||||
function concat () {
|
||||
function concat() {
|
||||
return src(config.src)
|
||||
.pipe(gulpConcat(config.mainFile))
|
||||
.pipe(dest(config.dest));
|
||||
}
|
||||
|
||||
exports.import = series(concatDep);
|
||||
exports.less = series(lessLTR, lessRTL);
|
||||
exports.build = series(concatApp, concat);
|
||||
exports.import = series(concatDep);
|
||||
exports.less = series(lessLTR, lessRTL);
|
||||
exports.build = series(concatApp, concat);
|
||||
Generated
+149
@@ -8,6 +8,13 @@
|
||||
"name": "appwrite-server",
|
||||
"version": "0.1.0",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"chart.js": "^3.6.2",
|
||||
"markdown-it": "^12.2.0",
|
||||
"pell": "^1.0.6",
|
||||
"prismjs": "^1.25.0",
|
||||
"turndown": "^7.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-clean-css": "^4.3.0",
|
||||
@@ -116,6 +123,11 @@
|
||||
"integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/argparse": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
||||
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
|
||||
},
|
||||
"node_modules/arr-diff": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
|
||||
@@ -536,6 +548,11 @@
|
||||
"node": ">= 0.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/chart.js": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.6.2.tgz",
|
||||
"integrity": "sha512-Xz7f/fgtVltfQYWq0zL1Xbv7N2inpG+B54p3D5FSvpCdy3sM+oZhbqa42eNuYXltaVvajgX5UpKCU2GeeJIgxg=="
|
||||
},
|
||||
"node_modules/chokidar": {
|
||||
"version": "2.1.8",
|
||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz",
|
||||
@@ -980,6 +997,11 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/domino": {
|
||||
"version": "2.1.6",
|
||||
"resolved": "https://registry.npmjs.org/domino/-/domino-2.1.6.tgz",
|
||||
"integrity": "sha512-3VdM/SXBZX2omc9JF9nOPCtDaYQ67BGp5CoLpIQlO2KCAPETs8TcDHacF26jXadGbvUteZzRTeos2fhID5+ucQ=="
|
||||
},
|
||||
"node_modules/duplexer2": {
|
||||
"version": "0.0.2",
|
||||
"resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz",
|
||||
@@ -1044,6 +1066,14 @@
|
||||
"once": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/entities": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz",
|
||||
"integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==",
|
||||
"funding": {
|
||||
"url": "https://github.com/fb55/entities?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/errno": {
|
||||
"version": "0.1.8",
|
||||
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz",
|
||||
@@ -2575,6 +2605,14 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/linkify-it": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz",
|
||||
"integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==",
|
||||
"dependencies": {
|
||||
"uc.micro": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/load-json-file": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
|
||||
@@ -2823,6 +2861,21 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/markdown-it": {
|
||||
"version": "12.2.0",
|
||||
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.2.0.tgz",
|
||||
"integrity": "sha512-Wjws+uCrVQRqOoJvze4HCqkKl1AsSh95iFAeQDwnyfxM09divCBSXlDR1uTvyUP3Grzpn4Ru8GeCxYPM8vkCQg==",
|
||||
"dependencies": {
|
||||
"argparse": "^2.0.1",
|
||||
"entities": "~2.1.0",
|
||||
"linkify-it": "^3.0.1",
|
||||
"mdurl": "^1.0.1",
|
||||
"uc.micro": "^1.0.5"
|
||||
},
|
||||
"bin": {
|
||||
"markdown-it": "bin/markdown-it.js"
|
||||
}
|
||||
},
|
||||
"node_modules/matchdep": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz",
|
||||
@@ -2865,6 +2918,11 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/mdurl": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
|
||||
"integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4="
|
||||
},
|
||||
"node_modules/meow": {
|
||||
"version": "3.7.0",
|
||||
"resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
|
||||
@@ -3438,6 +3496,11 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/pell": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/pell/-/pell-1.0.6.tgz",
|
||||
"integrity": "sha512-wuackvgjFCHmVABy7ACSmY2u53w+TlYFrVL2hN6V3rGL/iWWwVXMw2uphpZSXNnqFQTI8nMpD3UNNX8+R4BAYw=="
|
||||
},
|
||||
"node_modules/pify": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
|
||||
@@ -3502,6 +3565,11 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/prismjs": {
|
||||
"version": "1.25.0",
|
||||
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.25.0.tgz",
|
||||
"integrity": "sha512-WCjJHl1KEWbnkQom1+SzftbtXMKQoezOCYs5rECqMN+jP+apI7ftoflyqigqzopSO3hMhTEb0mFClA8lkolgEg=="
|
||||
},
|
||||
"node_modules/process-nextick-args": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||
@@ -4548,6 +4616,14 @@
|
||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/turndown": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/turndown/-/turndown-7.1.1.tgz",
|
||||
"integrity": "sha512-BEkXaWH7Wh7e9bd2QumhfAXk5g34+6QUmmWx+0q6ThaVOLuLUqsnkq35HQ5SBHSaxjSfSM7US5o4lhJNH7B9MA==",
|
||||
"dependencies": {
|
||||
"domino": "^2.1.6"
|
||||
}
|
||||
},
|
||||
"node_modules/type": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz",
|
||||
@@ -4560,6 +4636,11 @@
|
||||
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/uc.micro": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz",
|
||||
"integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA=="
|
||||
},
|
||||
"node_modules/unc-path-regex": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz",
|
||||
@@ -5068,6 +5149,11 @@
|
||||
"integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=",
|
||||
"dev": true
|
||||
},
|
||||
"argparse": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
||||
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
|
||||
},
|
||||
"arr-diff": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
|
||||
@@ -5397,6 +5483,11 @@
|
||||
"integrity": "sha1-W5UvniDqIc0Iyn/hNaEPb+kcEJ4=",
|
||||
"dev": true
|
||||
},
|
||||
"chart.js": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.6.2.tgz",
|
||||
"integrity": "sha512-Xz7f/fgtVltfQYWq0zL1Xbv7N2inpG+B54p3D5FSvpCdy3sM+oZhbqa42eNuYXltaVvajgX5UpKCU2GeeJIgxg=="
|
||||
},
|
||||
"chokidar": {
|
||||
"version": "2.1.8",
|
||||
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz",
|
||||
@@ -5761,6 +5852,11 @@
|
||||
"integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=",
|
||||
"dev": true
|
||||
},
|
||||
"domino": {
|
||||
"version": "2.1.6",
|
||||
"resolved": "https://registry.npmjs.org/domino/-/domino-2.1.6.tgz",
|
||||
"integrity": "sha512-3VdM/SXBZX2omc9JF9nOPCtDaYQ67BGp5CoLpIQlO2KCAPETs8TcDHacF26jXadGbvUteZzRTeos2fhID5+ucQ=="
|
||||
},
|
||||
"duplexer2": {
|
||||
"version": "0.0.2",
|
||||
"resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz",
|
||||
@@ -5827,6 +5923,11 @@
|
||||
"once": "^1.4.0"
|
||||
}
|
||||
},
|
||||
"entities": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz",
|
||||
"integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w=="
|
||||
},
|
||||
"errno": {
|
||||
"version": "0.1.8",
|
||||
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz",
|
||||
@@ -7076,6 +7177,14 @@
|
||||
"resolve": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"linkify-it": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz",
|
||||
"integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==",
|
||||
"requires": {
|
||||
"uc.micro": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"load-json-file": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
|
||||
@@ -7303,6 +7412,18 @@
|
||||
"object-visit": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"markdown-it": {
|
||||
"version": "12.2.0",
|
||||
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.2.0.tgz",
|
||||
"integrity": "sha512-Wjws+uCrVQRqOoJvze4HCqkKl1AsSh95iFAeQDwnyfxM09divCBSXlDR1uTvyUP3Grzpn4Ru8GeCxYPM8vkCQg==",
|
||||
"requires": {
|
||||
"argparse": "^2.0.1",
|
||||
"entities": "~2.1.0",
|
||||
"linkify-it": "^3.0.1",
|
||||
"mdurl": "^1.0.1",
|
||||
"uc.micro": "^1.0.5"
|
||||
}
|
||||
},
|
||||
"matchdep": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/matchdep/-/matchdep-2.0.0.tgz",
|
||||
@@ -7338,6 +7459,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"mdurl": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
|
||||
"integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4="
|
||||
},
|
||||
"meow": {
|
||||
"version": "3.7.0",
|
||||
"resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz",
|
||||
@@ -7800,6 +7926,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"pell": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/pell/-/pell-1.0.6.tgz",
|
||||
"integrity": "sha512-wuackvgjFCHmVABy7ACSmY2u53w+TlYFrVL2hN6V3rGL/iWWwVXMw2uphpZSXNnqFQTI8nMpD3UNNX8+R4BAYw=="
|
||||
},
|
||||
"pify": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
|
||||
@@ -7846,6 +7977,11 @@
|
||||
"integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=",
|
||||
"dev": true
|
||||
},
|
||||
"prismjs": {
|
||||
"version": "1.25.0",
|
||||
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.25.0.tgz",
|
||||
"integrity": "sha512-WCjJHl1KEWbnkQom1+SzftbtXMKQoezOCYs5rECqMN+jP+apI7ftoflyqigqzopSO3hMhTEb0mFClA8lkolgEg=="
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||
@@ -8710,6 +8846,14 @@
|
||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
|
||||
"dev": true
|
||||
},
|
||||
"turndown": {
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/turndown/-/turndown-7.1.1.tgz",
|
||||
"integrity": "sha512-BEkXaWH7Wh7e9bd2QumhfAXk5g34+6QUmmWx+0q6ThaVOLuLUqsnkq35HQ5SBHSaxjSfSM7US5o4lhJNH7B9MA==",
|
||||
"requires": {
|
||||
"domino": "^2.1.6"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz",
|
||||
@@ -8722,6 +8866,11 @@
|
||||
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
|
||||
"dev": true
|
||||
},
|
||||
"uc.micro": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz",
|
||||
"integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA=="
|
||||
},
|
||||
"unc-path-regex": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz",
|
||||
|
||||
@@ -15,5 +15,12 @@
|
||||
"gulp-concat": "^2.6.1",
|
||||
"gulp-jsmin": "^0.1.5",
|
||||
"gulp-less": "^5.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"chart.js": "^3.6.2",
|
||||
"markdown-it": "^12.2.0",
|
||||
"pell": "^1.0.6",
|
||||
"prismjs": "^1.25.0",
|
||||
"turndown": "^7.1.1"
|
||||
}
|
||||
}
|
||||
Vendored
-3782
File diff suppressed because it is too large.
Load diff
Vendored
-2934
File diff suppressed because it is too large.
Load diff
Vendored
-848
@@ -1,848 +0,0 @@
|
||||
|
||||
window.ls=window.ls||{};window.ls.container=function(){let stock={};let listeners={};let namespaces={};let set=function(name,object,singleton,watch=true){if(typeof name!=='string'){throw new Error('var name must be of type string');}
|
||||
if(typeof singleton!=='boolean'){throw new Error('var singleton "'+singleton+'" of service "'+name+'" must be of type boolean');}
|
||||
stock[name]={name:name,object:object,singleton:singleton,instance:null,watch:watch,};if(!watch){return this;}
|
||||
let binds=listeners[name]||{};for(let key in binds){if(binds.hasOwnProperty(key)){document.dispatchEvent(new CustomEvent(key));}}
|
||||
return this;};let get=function(name){let service=(undefined!==stock[name])?stock[name]:null;if(null==service){return null;}
|
||||
if(service.instance){return service.instance;}
|
||||
let instance=(typeof service.object==='function')?this.resolve(service.object):service.object;let skip=false;if(service.watch&&name!=='window'&&name!=='document'&&name!=='element'&&typeof instance==='object'&&instance!==null){let handler={name:service.name,watch:function(){},get:function(target,key){if(key==="__name"){return this.name;}
|
||||
if(key==="__watch"){return this.watch;}
|
||||
if(key==="__proxy"){return true;}
|
||||
if(key!=='constructor'&&typeof target[key]==='function'&&([Map,Set,WeakMap,WeakSet].includes(target.constructor))){return target[key].bind(target);}
|
||||
if(typeof target[key]==='object'&&target[key]!==null&&!target[key].__proxy){let handler=Object.assign({},this);handler.name=handler.name+'.'+key;return new Proxy(target[key],handler)}
|
||||
else{return target[key];}},set:function(target,key,value,receiver){if(key==="__name"){return this.name=value;}
|
||||
if(key==="__watch"){return this.watch=value;}
|
||||
target[key]=value;let path=receiver.__name+'.'+key;document.dispatchEvent(new CustomEvent(path+'.changed'));if(skip){return true;}
|
||||
skip=true;container.set('$prop',key,true);container.set('$value',value,true);container.resolve(this.watch);container.set('$key',null,true);container.set('$value',null,true);skip=false;return true;},};instance=new Proxy(instance,handler);}
|
||||
if(service.singleton){service.instance=instance;}
|
||||
return instance;};let resolve=function(target){if(!target){return()=>{};}
|
||||
let self=this;const REGEX_COMMENTS=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;const REGEX_FUNCTION_PARAMS=/(?:\s*(?:function\s*[^(]*)?\s*)((?:[^'"]|(?:(?:(['"])(?:(?:.*?[^\\]\2)|\2))))*?)\s*(?=(?:=>)|{)/m;const REGEX_PARAMETERS_VALUES=/\s*([\w\\$]+)\s*(?:=\s*((?:(?:(['"])(?:\3|(?:.*?[^\\]\3)))((\s*\+\s*)(?:(?:(['"])(?:\6|(?:.*?[^\\]\6)))|(?:[\w$]*)))*)|.*?))?\s*(?:,|$)/gm;function getParams(func){let functionAsString=func.toString();let params=[];let match;functionAsString=functionAsString.replace(REGEX_COMMENTS,'');functionAsString=functionAsString.match(REGEX_FUNCTION_PARAMS)[1];if(functionAsString.charAt(0)==='('){functionAsString=functionAsString.slice(1,-1);}
|
||||
while(match=REGEX_PARAMETERS_VALUES.exec(functionAsString)){params.push(match[1]);}
|
||||
return params;}
|
||||
let args=getParams(target);return target.apply(target,args.map(function(value){return self.get(value.trim());}));};let path=function(path,value,type){type=(type)?type:'assign';path=container.scope(path).split('.');let name=path.shift();let object=container.get(name);let result=null;while(path.length>1){if(!object){return null;}
|
||||
object=object[path.shift()];}
|
||||
let shift=path.shift();if(value!==null&&value!==undefined&&object&&shift&&(object[shift]!==undefined||object[shift]!==null)){switch(type){case'append':if(!Array.isArray(object[shift])){object[shift]=[];}
|
||||
object[shift].push(value);break;case'prepend':if(!Array.isArray(object[shift])){object[shift]=[];}
|
||||
object[shift].unshift(value);break;case'splice':if(!Array.isArray(object[shift])){object[shift]=[];}
|
||||
object[shift].splice(value,1);break;default:object[shift]=value;}
|
||||
return true;}
|
||||
if(!object){return null;}
|
||||
if(!shift){result=object;}
|
||||
else{return object[shift];}
|
||||
return result;};let bind=function(element,path,callback){let event=container.scope(path)+'.changed';let service=event.split('.').slice(0,1).pop();let debug=element.getAttribute('data-debug')||false;listeners[service]=listeners[service]||{};listeners[service][event]=true;let printer=(function(x){return function(){if(!document.body.contains(element)){element=null;document.removeEventListener(event,printer,false);return false;}
|
||||
let oldNamespaces=namespaces;namespaces=x;callback();namespaces=oldNamespaces;}}(Object.assign({},namespaces)));document.addEventListener(event,printer);};let addNamespace=function(key,scope){namespaces[key]=scope;return this;}
|
||||
let removeNamespace=function(key){delete namespaces[key];return this;}
|
||||
let scope=function(path){for(let[key,value]of Object.entries(namespaces)){path=(path.indexOf('.')>-1)?path.replace(key+'.',value+'.'):path.replace(key,value);}
|
||||
return path;}
|
||||
let container={set:set,get:get,resolve:resolve,path:path,bind:bind,scope:scope,addNamespace:addNamespace,removeNamespace:removeNamespace,stock:stock,listeners:listeners,namespaces:namespaces,};set('container',container,true,false);return container;}();window.ls.container.set('http',function(document){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){param=encodeURIComponent(param);let a=document.createElement('a');param+=(value?"="+encodeURIComponent(value):"");a.href=url;a.search+=(a.search?"&":"")+param;return a.href;};let request=function(method,url,headers,payload,progress){let i;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name');}
|
||||
if(typeof url!=='string'){throw new Error('var url must be of type string');}
|
||||
if(typeof headers!=='object'){throw new Error('var headers must be of type object');}
|
||||
if(typeof url!=='string'){throw new Error('var url must be of type string');}
|
||||
for(i=0;i<globalParams.length;i++){url=addParam(url,globalParams[i].key,globalParams[i].value);}
|
||||
return new Promise(function(resolve,reject){let xmlhttp=new XMLHttpRequest();xmlhttp.open(method,url,true);for(i=0;i<globalHeaders.length;i++){xmlhttp.setRequestHeader(globalHeaders[i].key,globalHeaders[i].value);}
|
||||
for(let key in headers){if(headers.hasOwnProperty(key)){xmlhttp.setRequestHeader(key,headers[key]);}}
|
||||
xmlhttp.onload=function(){if(4===xmlhttp.readyState&&200===xmlhttp.status){resolve(xmlhttp.response);}
|
||||
else{document.dispatchEvent(new CustomEvent('http-'+method.toLowerCase()+'-'+xmlhttp.status));reject(new Error(xmlhttp.statusText));}};if(progress){xmlhttp.addEventListener('progress',progress);xmlhttp.upload.addEventListener('progress',progress,false);}
|
||||
xmlhttp.onerror=function(){reject(new Error("Network Error"));};xmlhttp.send(payload);})};return{'get':function(url){return request('GET',url,{},'')},'post':function(url,headers,payload){return request('POST',url,headers,payload)},'put':function(url,headers,payload){return request('PUT',url,headers,payload)},'patch':function(url,headers,payload){return request('PATCH',url,headers,payload)},'delete':function(url){return request('DELETE',url,{},'')},'addGlobalParam':function(key,value){globalParams.push({key:key,value:value});},'addGlobalHeader':function(key,value){globalHeaders.push({key:key,value:value});}}},true,false);window.ls.container.set('cookie',function(document){function get(name){let value="; "+document.cookie,parts=value.split("; "+name+"=");if(parts.length===2){return parts.pop().split(";").shift();}
|
||||
return null;}
|
||||
function set(name,value,days){let date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));let expires=(0<days)?'expires='+date.toUTCString():'expires=0';document.cookie=name+"="+value+";"+expires+";path=/";return this;}
|
||||
return{'get':get,'set':set}},true,false);window.ls.container.set('view',function(http,container){let stock={};let execute=function(view,node,container){container.set('element',node,true,false);container.resolve(view.controller);if(true!==view.repeat){node.removeAttribute(view.selector);}};let parse=function(node,skip,callback){if(node.tagName==='SCRIPT'){return;}
|
||||
if(node.attributes&&skip!==true){let attrs=[];let attrsLen=node.attributes.length;for(let x=0;x<attrsLen;x++){attrs.push(node.attributes[x].nodeName);}
|
||||
if(1!==node.nodeType){return;}
|
||||
if(attrs&&attrsLen){for(let x=0;x<attrsLen;x++){if(node.$lsSkip===true){break;}
|
||||
let pointer=(!/Edge/.test(navigator.userAgent))?x:(attrsLen-1)-x;let length=attrsLen;let attr=attrs[pointer];if(!stock[attr]){continue;}
|
||||
let comp=stock[attr];if(typeof comp.template==="function"){comp.template=container.resolve(comp.template);}
|
||||
if(!comp.template){(function(comp,node,container){execute(comp,node,container);})(comp,node,container);if(length!==attrsLen){x--;}
|
||||
if(callback){callback();}
|
||||
continue;}
|
||||
node.classList.remove('load-end');node.classList.add('load-start');node.$lsSkip=true;http.get(comp.template).then(function(node,comp){return function(data){node.$lsSkip=false;node.innerHTML=data;node.classList.remove('load-start');node.classList.add('load-end');(function(comp,node,container){execute(comp,node,container);})(comp,node,container);parse(node,true);if(callback){callback();}}}(node,comp),function(error){throw new Error('Failed to load comp template: '+error.message);});}}}
|
||||
if(true===node.$lsSkip){return;}
|
||||
let list=(node)?node.childNodes:[];if(node.$lsSkip===true){list=[];}
|
||||
for(let i=0;i<list.length;i++){let child=list[i];parse(child);}};return{stock:stock,add:function(object){if(typeof object!=='object'){throw new Error('object must be of type object');}
|
||||
let defaults={'selector':'','controller':function(){},'template':'','repeat':false,'protected':false};for(let prop in defaults){if(!defaults.hasOwnProperty(prop)){continue;}
|
||||
if(prop in object){continue;}
|
||||
object[prop]=defaults[prop];}
|
||||
if(!object.selector){throw new Error('View component is missing a selector attribute');}
|
||||
stock[object.selector]=object;return this;},render:function(element,callback){parse(element,false,callback);element.dispatchEvent(new window.Event('rendered',{bubbles:false}));}}},true,false);window.ls.container.set('router',function(window){let getJsonFromUrl=function(URL){let query;if(URL){let pos=location.search.indexOf('?');if(pos===-1)return[];query=location.search.substr(pos+1);}else{query=location.search.substr(1);}
|
||||
let result={};query.split('&').forEach(function(part){if(!part){return;}
|
||||
part=part.split('+').join(' ');let eq=part.indexOf('=');let key=eq>-1?part.substr(0,eq):part;let val=eq>-1?decodeURIComponent(part.substr(eq+1)):'';let from=key.indexOf('[');if(from===-1){result[decodeURIComponent(key)]=val;}
|
||||
else{let to=key.indexOf(']');let index=decodeURIComponent(key.substring(from+1,to));key=decodeURIComponent(key.substring(0,from));if(!result[key]){result[key]=[];}
|
||||
if(!index){result[key].push(val);}
|
||||
else{result[key][index]=val;}}});return result;};let states=[];let params=getJsonFromUrl(window.location.search);let hash=window.location.hash;let current=null;let previous=null;let getPrevious=()=>previous;let getCurrent=()=>current;let setPrevious=(value)=>{previous=value;return this;};let setCurrent=(value)=>{current=value;return this;};let setParam=function(key,value){params[key]=value;return this;};let getParam=function(key,def){if(key in params){return params[key];}
|
||||
return def;};let getParams=function(){return params;};let getURL=function(){return window.location.href;};let add=function(path,view){if(typeof path!=='string'){throw new Error('path must be of type string');}
|
||||
if(typeof view!=='object'){throw new Error('view must be of type object');}
|
||||
states[states.length++]={path:path,view:view};return this;};let match=function(location){let url=location.pathname;if(url.endsWith('/')){url=url.slice(0,-1);}
|
||||
states.sort(function(a,b){return b.path.length-a.path.length;});states.sort(function(a,b){let n=b.path.split('/').length-a.path.split('/').length;if(n!==0){return n;}
|
||||
return b.path.length-a.path.length;});for(let i=0;i<states.length;i++){let value=states[i];value.path=(value.path.substring(0,1)!=='/')?location.pathname+value.path:value.path;let match=new RegExp("^"+value.path.replace(/:[^\s/]+/g,'([\\w-]+)')+"$");let found=url.match(match);if(found){previous=current;current=value;return value;}}
|
||||
return null};let change=function(URL,replace){if(!replace){window.history.pushState({},'',URL);}
|
||||
else{window.history.replaceState({},'',URL);}
|
||||
window.dispatchEvent(new PopStateEvent('popstate',{}));return this;};let reload=function(){return change(window.location.href);};return{setParam:setParam,getParam:getParam,getParams:getParams,getURL:getURL,add:add,change:change,reload:reload,match:match,getCurrent:getCurrent,setCurrent:setCurrent,getPrevious:getPrevious,setPrevious:setPrevious,params:params,hash:hash,reset:function(){this.params=getJsonFromUrl(window.location.search);this.hash=window.location.hash;}};},true,true);window.ls.container.set('expression',function(container,filter){let paths=[];return{regex:/(\{{.*?\}})/gi,parse:function(string,def,cast=false){def=def||'';paths=[];return string.replace(this.regex,match=>{let reference=match.substring(2,match.length-2).replace('[\'','.').replace('\']','').trim();reference=reference.split('|');let path=container.scope((reference[0]||''));let result=container.path(path);path=container.scope(path);if(!paths.includes(path)){paths.push(path);}
|
||||
if(reference.length>=2){for(let i=1;i<reference.length;i++){result=filter.apply(reference[i],result);}}
|
||||
if(null===result||undefined===result){result=def;}
|
||||
else if(typeof result==='object'){result=JSON.stringify(result,null,4);}
|
||||
else if(((typeof result==='object')||(typeof result==='string'))&&cast){result='\''+result+'\'';}
|
||||
return result;}).replace(/\\{/g,"{").replace(/\\}/g,"}");},getPaths:()=>paths,}},true,false);window.ls.container.set('filter',function(container){let filters={};let add=function(name,callback){filters[name]=callback;return this;};let apply=function(name,value){container.set('$value',value,true,false);return container.resolve(filters[name]);};add('uppercase',($value)=>{if(typeof $value!=='string'){return $value;}
|
||||
return $value.toUpperCase();});add('lowercase',($value)=>{if(typeof $value!=='string'){return $value;}
|
||||
return $value.toLowerCase();});return{add:add,apply:apply}},true,false);window.ls.container.get('filter').add('escape',$value=>{if(typeof $value!=='string'){return $value;}
|
||||
return $value.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/\"/g,'"').replace(/\'/g,''').replace(/\//g,'/');});window.ls=window.ls||{};window.ls.container.set('window',window,true,false).set('document',window.document,true,false).set('element',window.document,true,false);window.ls.run=function(window){try{this.view.render(window.document);}
|
||||
catch(error){let handler=window.ls.container.resolve(this.error);handler(error);}};window.ls.error=()=>{return error=>{console.error('ls-error',error.message,error.stack,error.toString());}};window.ls.router=window.ls.container.get('router');window.ls.view=window.ls.container.get('view');window.ls.filter=window.ls.container.get('filter');window.ls.container.get('view').add({selector:'data-ls-router',controller:function(element,window,document,view,router){let firstFromServer=(element.getAttribute('data-first-from-server')==='true');let scope={selector:'data-ls-scope',template:false,repeat:true,controller:function(){},};let init=function(route){let count=parseInt(element.getAttribute('data-ls-scope-count')||0);element.setAttribute('data-ls-scope-count',count+1);window.scrollTo(0,0);if(window.document.body.scrollTo){window.document.body.scrollTo(0,0);}
|
||||
router.reset();if(null===route){return;}
|
||||
scope.template=(undefined!==route.view.template)?route.view.template:null;scope.controller=(undefined!==route.view.controller)?route.view.controller:function(){};document.dispatchEvent(new CustomEvent('state-change'));if(firstFromServer&&null===router.getPrevious()){scope.template='';document.dispatchEvent(new CustomEvent('state-changed'));}
|
||||
else if(count===1){view.render(element,function(){document.dispatchEvent(new CustomEvent('state-changed'));});}
|
||||
else if(null!==router.getPrevious()){view.render(element,function(){document.dispatchEvent(new CustomEvent('state-changed'));});}};let findParent=function(tagName,el){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;}
|
||||
while(el=el.parentNode){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;}}
|
||||
return null;};element.removeAttribute('data-ls-router');element.setAttribute('data-ls-scope','');element.setAttribute('data-ls-scope-count',1);view.add(scope);document.addEventListener('click',function(event){let target=findParent('a',event.target);if(!target){return false;}
|
||||
if(!target.href){return false;}
|
||||
if((event.metaKey)){return false;}
|
||||
if((target.hasAttribute('target'))&&('_blank'===target.getAttribute('target'))){return false;}
|
||||
if(target.hostname!==window.location.hostname){return false;}
|
||||
let route=router.match(target);if(null===route){return false;}
|
||||
event.preventDefault();if(window.location===target.href){return false;}
|
||||
route.view.state=(undefined===route.view.state)?true:route.view.state;if(true===route.view.state){if(router.getPrevious()&&router.getPrevious().view&&(router.getPrevious().view.scope!==route.view.scope)){window.location.href=target.href;return false;}
|
||||
window.history.pushState({},'Unknown',target.href);}
|
||||
init(route);return true;});window.addEventListener('popstate',function(){init(router.match(window.location));});window.addEventListener('hashchange',function(){init(router.match(window.location));});init(router.match(window.location));}});window.ls.container.get('view').add({selector:'data-ls-attrs',controller:function(element,expression,container){let attrs=element.getAttribute('data-ls-attrs').trim().split(',');let paths=[];let debug=element.getAttribute('data-debug')||false;let check=()=>{container.set('element',element,true,false);if(debug){console.info('debug-ls-attrs attributes:',attrs);}
|
||||
for(let i=0;i<attrs.length;i++){let attr=attrs[i];let key=expression.parse((attr.substring(0,attr.indexOf('='))||attr));paths=paths.concat(expression.getPaths());let value='';if(attr.indexOf('=')>-1){value=expression.parse(attr.substring(attr.indexOf('=')+1))||'';paths=paths.concat(expression.getPaths());}
|
||||
if(!key){return null;}
|
||||
element.setAttribute(key,value);}};check();for(let i=0;i<paths.length;i++){let path=paths[i].split('.');while(path.length){container.bind(element,path.join('.'),check);path.pop();}}}});window.ls.container.get('view').add({selector:'data-ls-bind',controller:function(element,expression,container){let debug=element.getAttribute('data-debug')||false;let echo=function(value,bind=true){if(element.tagName==='INPUT'||element.tagName==='SELECT'||element.tagName==='BUTTON'||element.tagName==='TEXTAREA'){let type=element.getAttribute('type');if('radio'===type){if(value.toString()===element.value){element.setAttribute('checked','checked');}
|
||||
else{element.removeAttribute('checked');}
|
||||
if(bind){element.addEventListener('change',()=>{for(let i=0;i<paths.length;i++){if(element.checked){value=element.value;}
|
||||
container.path(paths[i],value);}});}
|
||||
return;}
|
||||
if('checkbox'===type){if(typeof value==='boolean'||value==='true'||value==='false'){if(value===true||value==='true'){element.setAttribute('checked','checked');element.checked=true;}
|
||||
else{element.removeAttribute('checked');element.checked=false;}}
|
||||
else{try{value=JSON.parse(value);element.checked=(Array.isArray(value)&&(value.indexOf(element.value)>-1));value=element.value;}
|
||||
catch{return null;}}
|
||||
if(bind){element.addEventListener('change',()=>{for(let i=0;i<paths.length;i++){let value=container.path(paths[i]);let index=value.indexOf(element.value);if(element.checked&&index<0){value.push(element.value);}
|
||||
if(!element.checked&&index>-1){value.splice(index,1);}
|
||||
container.path(paths[i],value);}});}
|
||||
return;}
|
||||
if(element.value!==value){element.value=value;element.dispatchEvent(new Event('change'));}
|
||||
if(bind){element.addEventListener('input',sync);element.addEventListener('change',sync);}}
|
||||
else{if(element.textContent!=value){element.textContent=value;}}};let sync=(()=>{return()=>{if(debug){console.info('debug-ls-bind','sync-path',paths);console.info('debug-ls-bind','sync-syntax',syntax);console.info('debug-ls-bind','sync-syntax-parsed',parsedSyntax);console.info('debug-ls-bind','sync-value',element.value);}
|
||||
for(let i=0;i<paths.length;i++){if('{{'+paths[i]+'}}'!==parsedSyntax){if(debug){console.info('debug-ls-bind','sync-skipped-path',paths[i]);console.info('debug-ls-bind','sync-skipped-syntax',syntax);console.info('debug-ls-bind','sync-skipped-syntax-parsed',parsedSyntax);}
|
||||
continue;}
|
||||
if(debug){console.info('debug-ls-bind','sync-loop-path',paths[i]);console.info('debug-ls-bind','sync-loop-syntax',parsedSyntax);}
|
||||
container.path(paths[i],element.value);}}})();let syntax=element.getAttribute('data-ls-bind');let parsedSyntax=container.scope(syntax);let unsync=(!!element.getAttribute('data-unsync'))||false;let result=expression.parse(syntax);let paths=expression.getPaths();echo(result,!unsync);element.addEventListener('looped',function(){echo(expression.parse(parsedSyntax),false);});for(let i=0;i<paths.length;i++){let path=paths[i].split('.');if(debug){console.info('debug-ls-bind','bind-path',path);console.info('debug-ls-bind','bind-syntax',syntax);}
|
||||
while(path.length){container.bind(element,path.join('.'),()=>{echo(expression.parse(parsedSyntax),false);});path.pop();}}}});window.ls.container.get('view').add({selector:'data-ls-if',controller:function(element,expression,container,view){let result='';let syntax=element.getAttribute('data-ls-if')||'';let debug=element.getAttribute('data-debug')||false;let paths=[];let check=()=>{if(debug){console.info('debug-ls-if',expression.parse(syntax.replace(/(\r\n|\n|\r)/gm,' '),'undefined',true));}
|
||||
try{result=(eval(expression.parse(syntax.replace(/(\r\n|\n|\r)/gm,' '),'undefined',true)));}
|
||||
catch(error){throw new Error('Failed to evaluate expression "'+syntax+' (resulted with: "'+result+'")": '+error);}
|
||||
if(debug){console.info('debug-ls-if result:',result);}
|
||||
paths=expression.getPaths();let prv=element.$lsSkip;element.$lsSkip=!result;if(!result){element.style.visibility='hidden';element.style.display='none';}
|
||||
else{element.style.removeProperty('display');element.style.removeProperty('visibility');}
|
||||
if(prv===true&&element.$lsSkip===false){view.render(element)}};check();for(let i=0;i<paths.length;i++){let path=paths[i].split('.');while(path.length){container.bind(element,path.join('.'),check);path.pop();}}}});window.ls.container.get('view').add({selector:'data-ls-loop',template:false,nested:false,controller:function(element,view,container,window,expression){let expr=expression.parse(element.getAttribute('data-ls-loop'));let as=element.getAttribute('data-ls-as');let key=element.getAttribute('data-ls-key')||'$index';let limit=parseInt(expression.parse(element.getAttribute('data-limit')||'')||-1);let debug=element.getAttribute('data-debug')||false;let echo=function(){let array=container.path(expr);let counter=0;array=(!array)?[]:array;let watch=!!(array&&array.__proxy);while(element.hasChildNodes()){element.removeChild(element.lastChild);element.lastChild=null;}
|
||||
if(array instanceof Array&&typeof array!=='object'){throw new Error('Reference value must be array or object. '+(typeof array)+' given');}
|
||||
let children=[];element.$lsSkip=true;element.style.visibility=(0===array.length&&element.style.visibility=='')?'hidden':'visible';for(let prop in array){if(counter==limit){break;}
|
||||
counter++;if(!array.hasOwnProperty(prop)){continue;}
|
||||
children[prop]=template.cloneNode(true);element.appendChild(children[prop]);(index=>{let context=expr+'.'+index;container.addNamespace(as,context);if(debug){console.info('debug-ls-loop','index',index);console.info('debug-ls-loop','context',context);console.info('debug-ls-loop','context-path',container.path(context).name);console.info('debug-ls-loop','namespaces',container.namespaces);}
|
||||
container.set(as,container.path(context),true,watch);container.set(key,index,true,false);view.render(children[prop]);container.removeNamespace(as);})(prop);}
|
||||
element.dispatchEvent(new Event('looped'));};let template=(element.children.length===1)?element.children[0]:window.document.createElement('li');echo();container.bind(element,expr+'.length',echo);let path=(expr+'.length').split('.');while(path.length){container.bind(element,path.join('.'),echo);path.pop();}}});window.ls.container.get('view').add({selector:'data-ls-template',template:false,controller:function(element,view,http,expression,document,container){let template=element.getAttribute('data-ls-template')||'';let type=element.getAttribute('data-type')||'url';let debug=element.getAttribute('data-debug')||false;let paths=[];let check=function(init=false){let source=expression.parse(template);paths=expression.getPaths();element.innerHTML='';if('script'===type){let inlineTemplate=document.getElementById(source);if(inlineTemplate&&inlineTemplate.innerHTML){element.innerHTML=inlineTemplate.innerHTML;element.dispatchEvent(new CustomEvent('template-loaded',{bubbles:true,cancelable:false}));}
|
||||
else{if(debug){console.error('Missing template "'+source+'"');}}
|
||||
if(!init){view.render(element);}
|
||||
return;}
|
||||
http.get(source).then(function(element){return function(data){element.innerHTML=data;view.render(element);element.dispatchEvent(new CustomEvent('template-loaded',{bubbles:true,cancelable:false}));}}(element),function(){throw new Error('Failed loading template');});};check(true);for(let i=0;i<paths.length;i++){let path=paths[i].split('.');while(path.length){container.bind(element,path.join('.'),check);path.pop();}}}});(()=>{var flushPending=false;var flushing=false;var queue=[];function scheduler(callback){queueJob(callback);}
|
||||
function queueJob(job){if(!queue.includes(job))
|
||||
queue.push(job);queueFlush();}
|
||||
function queueFlush(){if(!flushing&&!flushPending){flushPending=true;queueMicrotask(flushJobs);}}
|
||||
function flushJobs(){flushPending=false;flushing=true;for(let i=0;i<queue.length;i++){queue[i]();}
|
||||
queue.length=0;flushing=false;}
|
||||
var reactive;var effect;var release;var raw;var shouldSchedule=true;function disableEffectScheduling(callback){shouldSchedule=false;callback();shouldSchedule=true;}
|
||||
function setReactivityEngine(engine){reactive=engine.reactive;release=engine.release;effect=(callback)=>engine.effect(callback,{scheduler:(task)=>{if(shouldSchedule){scheduler(task);}else{task();}}});raw=engine.raw;}
|
||||
function overrideEffect(override){effect=override;}
|
||||
function elementBoundEffect(el){let cleanup2=()=>{};let wrappedEffect=(callback)=>{let effectReference=effect(callback);if(!el._x_effects){el._x_effects=new Set();el._x_runEffects=()=>{el._x_effects.forEach((i)=>i());};}
|
||||
el._x_effects.add(effectReference);cleanup2=()=>{if(effectReference===void 0)
|
||||
return;el._x_effects.delete(effectReference);release(effectReference);};};return[wrappedEffect,()=>{cleanup2();}];}
|
||||
var onAttributeAddeds=[];var onElRemoveds=[];var onElAddeds=[];function onElAdded(callback){onElAddeds.push(callback);}
|
||||
function onElRemoved(callback){onElRemoveds.push(callback);}
|
||||
function onAttributesAdded(callback){onAttributeAddeds.push(callback);}
|
||||
function onAttributeRemoved(el,name,callback){if(!el._x_attributeCleanups)
|
||||
el._x_attributeCleanups={};if(!el._x_attributeCleanups[name])
|
||||
el._x_attributeCleanups[name]=[];el._x_attributeCleanups[name].push(callback);}
|
||||
function cleanupAttributes(el,names){if(!el._x_attributeCleanups)
|
||||
return;Object.entries(el._x_attributeCleanups).forEach(([name,value])=>{if(names===void 0||names.includes(name)){value.forEach((i)=>i());delete el._x_attributeCleanups[name];}});}
|
||||
var observer=new MutationObserver(onMutate);var currentlyObserving=false;function startObservingMutations(){observer.observe(document,{subtree:true,childList:true,attributes:true,attributeOldValue:true});currentlyObserving=true;}
|
||||
function stopObservingMutations(){flushObserver();observer.disconnect();currentlyObserving=false;}
|
||||
var recordQueue=[];var willProcessRecordQueue=false;function flushObserver(){recordQueue=recordQueue.concat(observer.takeRecords());if(recordQueue.length&&!willProcessRecordQueue){willProcessRecordQueue=true;queueMicrotask(()=>{processRecordQueue();willProcessRecordQueue=false;});}}
|
||||
function processRecordQueue(){onMutate(recordQueue);recordQueue.length=0;}
|
||||
function mutateDom(callback){if(!currentlyObserving)
|
||||
return callback();stopObservingMutations();let result=callback();startObservingMutations();return result;}
|
||||
var isCollecting=false;var deferredMutations=[];function deferMutations(){isCollecting=true;}
|
||||
function flushAndStopDeferringMutations(){isCollecting=false;onMutate(deferredMutations);deferredMutations=[];}
|
||||
function onMutate(mutations){if(isCollecting){deferredMutations=deferredMutations.concat(mutations);return;}
|
||||
let addedNodes=[];let removedNodes=[];let addedAttributes=new Map();let removedAttributes=new Map();for(let i=0;i<mutations.length;i++){if(mutations[i].target._x_ignoreMutationObserver)
|
||||
continue;if(mutations[i].type==="childList"){mutations[i].addedNodes.forEach((node)=>node.nodeType===1&&addedNodes.push(node));mutations[i].removedNodes.forEach((node)=>node.nodeType===1&&removedNodes.push(node));}
|
||||
if(mutations[i].type==="attributes"){let el=mutations[i].target;let name=mutations[i].attributeName;let oldValue=mutations[i].oldValue;let add2=()=>{if(!addedAttributes.has(el))
|
||||
addedAttributes.set(el,[]);addedAttributes.get(el).push({name,value:el.getAttribute(name)});};let remove=()=>{if(!removedAttributes.has(el))
|
||||
removedAttributes.set(el,[]);removedAttributes.get(el).push(name);};if(el.hasAttribute(name)&&oldValue===null){add2();}else if(el.hasAttribute(name)){remove();add2();}else{remove();}}}
|
||||
removedAttributes.forEach((attrs,el)=>{cleanupAttributes(el,attrs);});addedAttributes.forEach((attrs,el)=>{onAttributeAddeds.forEach((i)=>i(el,attrs));});for(let node of addedNodes){if(removedNodes.includes(node))
|
||||
continue;onElAddeds.forEach((i)=>i(node));}
|
||||
for(let node of removedNodes){if(addedNodes.includes(node))
|
||||
continue;onElRemoveds.forEach((i)=>i(node));}
|
||||
addedNodes=null;removedNodes=null;addedAttributes=null;removedAttributes=null;}
|
||||
function addScopeToNode(node,data2,referenceNode){node._x_dataStack=[data2,...closestDataStack(referenceNode||node)];return()=>{node._x_dataStack=node._x_dataStack.filter((i)=>i!==data2);};}
|
||||
function refreshScope(element,scope){let existingScope=element._x_dataStack[0];Object.entries(scope).forEach(([key,value])=>{existingScope[key]=value;});}
|
||||
function closestDataStack(node){if(node._x_dataStack)
|
||||
return node._x_dataStack;if(typeof ShadowRoot==="function"&&node instanceof ShadowRoot){return closestDataStack(node.host);}
|
||||
if(!node.parentNode){return[];}
|
||||
return closestDataStack(node.parentNode);}
|
||||
function mergeProxies(objects){let thisProxy=new Proxy({},{ownKeys:()=>{return Array.from(new Set(objects.flatMap((i)=>Object.keys(i))));},has:(target,name)=>{return objects.some((obj)=>obj.hasOwnProperty(name));},get:(target,name)=>{return(objects.find((obj)=>{if(obj.hasOwnProperty(name)){let descriptor=Object.getOwnPropertyDescriptor(obj,name);if(descriptor.get&&descriptor.get._x_alreadyBound||descriptor.set&&descriptor.set._x_alreadyBound){return true;}
|
||||
if((descriptor.get||descriptor.set)&&descriptor.enumerable){let getter=descriptor.get;let setter=descriptor.set;let property=descriptor;getter=getter&&getter.bind(thisProxy);setter=setter&&setter.bind(thisProxy);if(getter)
|
||||
getter._x_alreadyBound=true;if(setter)
|
||||
setter._x_alreadyBound=true;Object.defineProperty(obj,name,{...property,get:getter,set:setter});}
|
||||
return true;}
|
||||
return false;})||{})[name];},set:(target,name,value)=>{let closestObjectWithKey=objects.find((obj)=>obj.hasOwnProperty(name));if(closestObjectWithKey){closestObjectWithKey[name]=value;}else{objects[objects.length-1][name]=value;}
|
||||
return true;}});return thisProxy;}
|
||||
function initInterceptors(data2){let isObject2=(val)=>typeof val==="object"&&!Array.isArray(val)&&val!==null;let recurse=(obj,basePath="")=>{Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key,{value,enumerable}])=>{if(enumerable===false||value===void 0)
|
||||
return;let path=basePath===""?key:`${basePath}.${key}`;if(typeof value==="object"&&value!==null&&value._x_interceptor){obj[key]=value.initialize(data2,path,key);}else{if(isObject2(value)&&value!==obj&&!(value instanceof Element)){recurse(value,path);}}});};return recurse(data2);}
|
||||
function interceptor(callback,mutateObj=()=>{}){let obj={initialValue:void 0,_x_interceptor:true,initialize(data2,path,key){return callback(this.initialValue,()=>get(data2,path),(value)=>set(data2,path,value),path,key);}};mutateObj(obj);return(initialValue)=>{if(typeof initialValue==="object"&&initialValue!==null&&initialValue._x_interceptor){let initialize=obj.initialize.bind(obj);obj.initialize=(data2,path,key)=>{let innerValue=initialValue.initialize(data2,path,key);obj.initialValue=innerValue;return initialize(data2,path,key);};}else{obj.initialValue=initialValue;}
|
||||
return obj;};}
|
||||
function get(obj,path){return path.split(".").reduce((carry,segment)=>carry[segment],obj);}
|
||||
function set(obj,path,value){if(typeof path==="string")
|
||||
path=path.split(".");if(path.length===1)
|
||||
obj[path[0]]=value;else if(path.length===0)
|
||||
throw error;else{if(obj[path[0]])
|
||||
return set(obj[path[0]],path.slice(1),value);else{obj[path[0]]={};return set(obj[path[0]],path.slice(1),value);}}}
|
||||
var magics={};function magic(name,callback){magics[name]=callback;}
|
||||
function injectMagics(obj,el){Object.entries(magics).forEach(([name,callback])=>{Object.defineProperty(obj,`$${name}`,{get(){return callback(el,{Alpine:alpine_default,interceptor});},enumerable:false});});return obj;}
|
||||
function tryCatch(el,expression,callback,...args){try{return callback(...args);}catch(e){handleError(e,el,expression);}}
|
||||
function handleError(error2,el,expression=void 0){Object.assign(error2,{el,expression});console.warn(`Alpine Expression Error: ${error2.message}
|
||||
|
||||
${expression ? 'Expression: "' + expression + '"\n\n' : ""}`,el);setTimeout(()=>{throw error2;},0);}
|
||||
function evaluate(el,expression,extras={}){let result;evaluateLater(el,expression)((value)=>result=value,extras);return result;}
|
||||
function evaluateLater(...args){return theEvaluatorFunction(...args);}
|
||||
var theEvaluatorFunction=normalEvaluator;function setEvaluator(newEvaluator){theEvaluatorFunction=newEvaluator;}
|
||||
function normalEvaluator(el,expression){let overriddenMagics={};injectMagics(overriddenMagics,el);let dataStack=[overriddenMagics,...closestDataStack(el)];if(typeof expression==="function"){return generateEvaluatorFromFunction(dataStack,expression);}
|
||||
let evaluator=generateEvaluatorFromString(dataStack,expression,el);return tryCatch.bind(null,el,expression,evaluator);}
|
||||
function generateEvaluatorFromFunction(dataStack,func){return(receiver=()=>{},{scope={},params=[]}={})=>{let result=func.apply(mergeProxies([scope,...dataStack]),params);runIfTypeOfFunction(receiver,result);};}
|
||||
var evaluatorMemo={};function generateFunctionFromString(expression,el){if(evaluatorMemo[expression]){return evaluatorMemo[expression];}
|
||||
let AsyncFunction=Object.getPrototypeOf(async function(){}).constructor;let rightSideSafeExpression=/^[\n\s]*if.*\(.*\)/.test(expression)||/^(let|const)\s/.test(expression)?`(() => { ${expression} })()`:expression;const safeAsyncFunction=()=>{try{return new AsyncFunction(["__self","scope"],`with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`);}catch(error2){handleError(error2,el,expression);return Promise.resolve();}};let func=safeAsyncFunction();evaluatorMemo[expression]=func;return func;}
|
||||
function generateEvaluatorFromString(dataStack,expression,el){let func=generateFunctionFromString(expression,el);return(receiver=()=>{},{scope={},params=[]}={})=>{func.result=void 0;func.finished=false;let completeScope=mergeProxies([scope,...dataStack]);if(typeof func==="function"){let promise=func(func,completeScope).catch((error2)=>handleError(error2,el,expression));if(func.finished){runIfTypeOfFunction(receiver,func.result,completeScope,params,el);}else{promise.then((result)=>{runIfTypeOfFunction(receiver,result,completeScope,params,el);}).catch((error2)=>handleError(error2,el,expression));}}};}
|
||||
function runIfTypeOfFunction(receiver,value,scope,params,el){if(typeof value==="function"){let result=value.apply(scope,params);if(result instanceof Promise){result.then((i)=>runIfTypeOfFunction(receiver,i,scope,params)).catch((error2)=>handleError(error2,el,value));}else{receiver(result);}}else{receiver(value);}}
|
||||
var prefixAsString="x-";function prefix(subject=""){return prefixAsString+subject;}
|
||||
function setPrefix(newPrefix){prefixAsString=newPrefix;}
|
||||
var directiveHandlers={};function directive(name,callback){directiveHandlers[name]=callback;}
|
||||
function directives(el,attributes,originalAttributeOverride){let transformedAttributeMap={};let directives2=Array.from(attributes).map(toTransformedAttributes((newName,oldName)=>transformedAttributeMap[newName]=oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap,originalAttributeOverride)).sort(byPriority);return directives2.map((directive2)=>{return getDirectiveHandler(el,directive2);});}
|
||||
function attributesOnly(attributes){return Array.from(attributes).map(toTransformedAttributes()).filter((attr)=>!outNonAlpineAttributes(attr));}
|
||||
var isDeferringHandlers=false;var directiveHandlerStacks=new Map();var currentHandlerStackKey=Symbol();function deferHandlingDirectives(callback){isDeferringHandlers=true;let key=Symbol();currentHandlerStackKey=key;directiveHandlerStacks.set(key,[]);let flushHandlers=()=>{while(directiveHandlerStacks.get(key).length)
|
||||
directiveHandlerStacks.get(key).shift()();directiveHandlerStacks.delete(key);};let stopDeferring=()=>{isDeferringHandlers=false;flushHandlers();};callback(flushHandlers);stopDeferring();}
|
||||
function getDirectiveHandler(el,directive2){let noop=()=>{};let handler3=directiveHandlers[directive2.type]||noop;let cleanups=[];let cleanup2=(callback)=>cleanups.push(callback);let[effect3,cleanupEffect]=elementBoundEffect(el);cleanups.push(cleanupEffect);let utilities={Alpine:alpine_default,effect:effect3,cleanup:cleanup2,evaluateLater:evaluateLater.bind(evaluateLater,el),evaluate:evaluate.bind(evaluate,el)};let doCleanup=()=>cleanups.forEach((i)=>i());onAttributeRemoved(el,directive2.original,doCleanup);let fullHandler=()=>{if(el._x_ignore||el._x_ignoreSelf)
|
||||
return;handler3.inline&&handler3.inline(el,directive2,utilities);handler3=handler3.bind(handler3,el,directive2,utilities);isDeferringHandlers?directiveHandlerStacks.get(currentHandlerStackKey).push(handler3):handler3();};fullHandler.runCleanups=doCleanup;return fullHandler;}
|
||||
var startingWith=(subject,replacement)=>({name,value})=>{if(name.startsWith(subject))
|
||||
name=name.replace(subject,replacement);return{name,value};};var into=(i)=>i;function toTransformedAttributes(callback=()=>{}){return({name,value})=>{let{name:newName,value:newValue}=attributeTransformers.reduce((carry,transform)=>{return transform(carry);},{name,value});if(newName!==name)
|
||||
callback(newName,name);return{name:newName,value:newValue};};}
|
||||
var attributeTransformers=[];function mapAttributes(callback){attributeTransformers.push(callback);}
|
||||
function outNonAlpineAttributes({name}){return alpineAttributeRegex().test(name);}
|
||||
var alpineAttributeRegex=()=>new RegExp(`^${prefixAsString}([^:^.]+)\\b`);function toParsedDirectives(transformedAttributeMap,originalAttributeOverride){return({name,value})=>{let typeMatch=name.match(alpineAttributeRegex());let valueMatch=name.match(/:([a-zA-Z0-9\-:]+)/);let modifiers=name.match(/\.[^.\]]+(?=[^\]]*$)/g)||[];let original=originalAttributeOverride||transformedAttributeMap[name]||name;return{type:typeMatch?typeMatch[1]:null,value:valueMatch?valueMatch[1]:null,modifiers:modifiers.map((i)=>i.replace(".","")),expression:value,original};};}
|
||||
var DEFAULT="DEFAULT";var directiveOrder=["ignore","ref","data","bind","init","for","model","transition","show","if",DEFAULT,"element"];function byPriority(a,b){let typeA=directiveOrder.indexOf(a.type)===-1?DEFAULT:a.type;let typeB=directiveOrder.indexOf(b.type)===-1?DEFAULT:b.type;return directiveOrder.indexOf(typeA)-directiveOrder.indexOf(typeB);}
|
||||
function dispatch(el,name,detail={}){el.dispatchEvent(new CustomEvent(name,{detail,bubbles:true,composed:true,cancelable:true}));}
|
||||
var tickStack=[];var isHolding=false;function nextTick(callback){tickStack.push(callback);queueMicrotask(()=>{isHolding||setTimeout(()=>{releaseNextTicks();});});}
|
||||
function releaseNextTicks(){isHolding=false;while(tickStack.length)
|
||||
tickStack.shift()();}
|
||||
function holdNextTicks(){isHolding=true;}
|
||||
function walk(el,callback){if(typeof ShadowRoot==="function"&&el instanceof ShadowRoot){Array.from(el.children).forEach((el2)=>walk(el2,callback));return;}
|
||||
let skip=false;callback(el,()=>skip=true);if(skip)
|
||||
return;let node=el.firstElementChild;while(node){walk(node,callback,false);node=node.nextElementSibling;}}
|
||||
function warn(message,...args){console.warn(`Alpine Warning: ${message}`,...args);}
|
||||
function start(){if(!document.body)
|
||||
warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");dispatch(document,"alpine:init");dispatch(document,"alpine:initializing");startObservingMutations();onElAdded((el)=>initTree(el,walk));onElRemoved((el)=>nextTick(()=>destroyTree(el)));onAttributesAdded((el,attrs)=>{directives(el,attrs).forEach((handle)=>handle());});let outNestedComponents=(el)=>!closestRoot(el.parentElement,true);Array.from(document.querySelectorAll(allSelectors())).filter(outNestedComponents).forEach((el)=>{initTree(el);});dispatch(document,"alpine:initialized");}
|
||||
var rootSelectorCallbacks=[];var initSelectorCallbacks=[];function rootSelectors(){return rootSelectorCallbacks.map((fn)=>fn());}
|
||||
function allSelectors(){return rootSelectorCallbacks.concat(initSelectorCallbacks).map((fn)=>fn());}
|
||||
function addRootSelector(selectorCallback){rootSelectorCallbacks.push(selectorCallback);}
|
||||
function addInitSelector(selectorCallback){initSelectorCallbacks.push(selectorCallback);}
|
||||
function closestRoot(el,includeInitSelectors=false){if(!el)
|
||||
return;const selectors=includeInitSelectors?allSelectors():rootSelectors();if(selectors.some((selector)=>el.matches(selector)))
|
||||
return el;if(!el.parentElement)
|
||||
return;return closestRoot(el.parentElement,includeInitSelectors);}
|
||||
function isRoot(el){return rootSelectors().some((selector)=>el.matches(selector));}
|
||||
function initTree(el,walker=walk){deferHandlingDirectives(()=>{walker(el,(el2,skip)=>{directives(el2,el2.attributes).forEach((handle)=>handle());el2._x_ignore&&skip();});});}
|
||||
function destroyTree(root){walk(root,(el)=>cleanupAttributes(el));}
|
||||
function setClasses(el,value){if(Array.isArray(value)){return setClassesFromString(el,value.join(" "));}else if(typeof value==="object"&&value!==null){return setClassesFromObject(el,value);}else if(typeof value==="function"){return setClasses(el,value());}
|
||||
return setClassesFromString(el,value);}
|
||||
function setClassesFromString(el,classString){let split=(classString2)=>classString2.split(" ").filter(Boolean);let missingClasses=(classString2)=>classString2.split(" ").filter((i)=>!el.classList.contains(i)).filter(Boolean);let addClassesAndReturnUndo=(classes)=>{el.classList.add(...classes);return()=>{el.classList.remove(...classes);};};classString=classString===true?classString="":classString||"";return addClassesAndReturnUndo(missingClasses(classString));}
|
||||
function setClassesFromObject(el,classObject){let split=(classString)=>classString.split(" ").filter(Boolean);let forAdd=Object.entries(classObject).flatMap(([classString,bool])=>bool?split(classString):false).filter(Boolean);let forRemove=Object.entries(classObject).flatMap(([classString,bool])=>!bool?split(classString):false).filter(Boolean);let added=[];let removed=[];forRemove.forEach((i)=>{if(el.classList.contains(i)){el.classList.remove(i);removed.push(i);}});forAdd.forEach((i)=>{if(!el.classList.contains(i)){el.classList.add(i);added.push(i);}});return()=>{removed.forEach((i)=>el.classList.add(i));added.forEach((i)=>el.classList.remove(i));};}
|
||||
function setStyles(el,value){if(typeof value==="object"&&value!==null){return setStylesFromObject(el,value);}
|
||||
return setStylesFromString(el,value);}
|
||||
function setStylesFromObject(el,value){let previousStyles={};Object.entries(value).forEach(([key,value2])=>{previousStyles[key]=el.style[key];el.style.setProperty(kebabCase(key),value2);});setTimeout(()=>{if(el.style.length===0){el.removeAttribute("style");}});return()=>{setStyles(el,previousStyles);};}
|
||||
function setStylesFromString(el,value){let cache=el.getAttribute("style",value);el.setAttribute("style",value);return()=>{el.setAttribute("style",cache);};}
|
||||
function kebabCase(subject){return subject.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();}
|
||||
function once(callback,fallback=()=>{}){let called=false;return function(){if(!called){called=true;callback.apply(this,arguments);}else{fallback.apply(this,arguments);}};}
|
||||
directive("transition",(el,{value,modifiers,expression},{evaluate:evaluate2})=>{if(typeof expression==="function")
|
||||
expression=evaluate2(expression);if(!expression){registerTransitionsFromHelper(el,modifiers,value);}else{registerTransitionsFromClassString(el,expression,value);}});function registerTransitionsFromClassString(el,classString,stage){registerTransitionObject(el,setClasses,"");let directiveStorageMap={enter:(classes)=>{el._x_transition.enter.during=classes;},"enter-start":(classes)=>{el._x_transition.enter.start=classes;},"enter-end":(classes)=>{el._x_transition.enter.end=classes;},leave:(classes)=>{el._x_transition.leave.during=classes;},"leave-start":(classes)=>{el._x_transition.leave.start=classes;},"leave-end":(classes)=>{el._x_transition.leave.end=classes;}};directiveStorageMap[stage](classString);}
|
||||
function registerTransitionsFromHelper(el,modifiers,stage){registerTransitionObject(el,setStyles);let doesntSpecify=!modifiers.includes("in")&&!modifiers.includes("out")&&!stage;let transitioningIn=doesntSpecify||modifiers.includes("in")||["enter"].includes(stage);let transitioningOut=doesntSpecify||modifiers.includes("out")||["leave"].includes(stage);if(modifiers.includes("in")&&!doesntSpecify){modifiers=modifiers.filter((i,index)=>index<modifiers.indexOf("out"));}
|
||||
if(modifiers.includes("out")&&!doesntSpecify){modifiers=modifiers.filter((i,index)=>index>modifiers.indexOf("out"));}
|
||||
let wantsAll=!modifiers.includes("opacity")&&!modifiers.includes("scale");let wantsOpacity=wantsAll||modifiers.includes("opacity");let wantsScale=wantsAll||modifiers.includes("scale");let opacityValue=wantsOpacity?0:1;let scaleValue=wantsScale?modifierValue(modifiers,"scale",95)/100:1;let delay=modifierValue(modifiers,"delay",0);let origin=modifierValue(modifiers,"origin","center");let property="opacity, transform";let durationIn=modifierValue(modifiers,"duration",150)/1e3;let durationOut=modifierValue(modifiers,"duration",75)/1e3;let easing=`cubic-bezier(0.4, 0.0, 0.2, 1)`;if(transitioningIn){el._x_transition.enter.during={transformOrigin:origin,transitionDelay:delay,transitionProperty:property,transitionDuration:`${durationIn}s`,transitionTimingFunction:easing};el._x_transition.enter.start={opacity:opacityValue,transform:`scale(${scaleValue})`};el._x_transition.enter.end={opacity:1,transform:`scale(1)`};}
|
||||
if(transitioningOut){el._x_transition.leave.during={transformOrigin:origin,transitionDelay:delay,transitionProperty:property,transitionDuration:`${durationOut}s`,transitionTimingFunction:easing};el._x_transition.leave.start={opacity:1,transform:`scale(1)`};el._x_transition.leave.end={opacity:opacityValue,transform:`scale(${scaleValue})`};}}
|
||||
function registerTransitionObject(el,setFunction,defaultValue={}){if(!el._x_transition)
|
||||
el._x_transition={enter:{during:defaultValue,start:defaultValue,end:defaultValue},leave:{during:defaultValue,start:defaultValue,end:defaultValue},in(before=()=>{},after=()=>{}){transition(el,setFunction,{during:this.enter.during,start:this.enter.start,end:this.enter.end},before,after);},out(before=()=>{},after=()=>{}){transition(el,setFunction,{during:this.leave.during,start:this.leave.start,end:this.leave.end},before,after);}};}
|
||||
window.Element.prototype._x_toggleAndCascadeWithTransitions=function(el,value,show,hide){let clickAwayCompatibleShow=()=>{document.visibilityState==="visible"?requestAnimationFrame(show):setTimeout(show);};if(value){if(el._x_transition&&(el._x_transition.enter||el._x_transition.leave)){el._x_transition.enter&&(Object.entries(el._x_transition.enter.during).length||Object.entries(el._x_transition.enter.start).length||Object.entries(el._x_transition.enter.end).length)?el._x_transition.in(show):clickAwayCompatibleShow();}else{el._x_transition?el._x_transition.in(show):clickAwayCompatibleShow();}
|
||||
return;}
|
||||
el._x_hidePromise=el._x_transition?new Promise((resolve,reject)=>{el._x_transition.out(()=>{},()=>resolve(hide));el._x_transitioning.beforeCancel(()=>reject({isFromCancelledTransition:true}));}):Promise.resolve(hide);queueMicrotask(()=>{let closest=closestHide(el);if(closest){if(!closest._x_hideChildren)
|
||||
closest._x_hideChildren=[];closest._x_hideChildren.push(el);}else{queueMicrotask(()=>{let hideAfterChildren=(el2)=>{let carry=Promise.all([el2._x_hidePromise,...(el2._x_hideChildren||[]).map(hideAfterChildren)]).then(([i])=>i());delete el2._x_hidePromise;delete el2._x_hideChildren;return carry;};hideAfterChildren(el).catch((e)=>{if(!e.isFromCancelledTransition)
|
||||
throw e;});});}});};function closestHide(el){let parent=el.parentNode;if(!parent)
|
||||
return;return parent._x_hidePromise?parent:closestHide(parent);}
|
||||
function transition(el,setFunction,{during,start:start2,end}={},before=()=>{},after=()=>{}){if(el._x_transitioning)
|
||||
el._x_transitioning.cancel();if(Object.keys(during).length===0&&Object.keys(start2).length===0&&Object.keys(end).length===0){before();after();return;}
|
||||
let undoStart,undoDuring,undoEnd;performTransition(el,{start(){undoStart=setFunction(el,start2);},during(){undoDuring=setFunction(el,during);},before,end(){undoStart();undoEnd=setFunction(el,end);},after,cleanup(){undoDuring();undoEnd();}});}
|
||||
function performTransition(el,stages){let interrupted,reachedBefore,reachedEnd;let finish=once(()=>{mutateDom(()=>{interrupted=true;if(!reachedBefore)
|
||||
stages.before();if(!reachedEnd){stages.end();releaseNextTicks();}
|
||||
stages.after();if(el.isConnected)
|
||||
stages.cleanup();delete el._x_transitioning;});});el._x_transitioning={beforeCancels:[],beforeCancel(callback){this.beforeCancels.push(callback);},cancel:once(function(){while(this.beforeCancels.length){this.beforeCancels.shift()();};finish();}),finish};mutateDom(()=>{stages.start();stages.during();});holdNextTicks();requestAnimationFrame(()=>{if(interrupted)
|
||||
return;let duration=Number(getComputedStyle(el).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3;let delay=Number(getComputedStyle(el).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;if(duration===0)
|
||||
duration=Number(getComputedStyle(el).animationDuration.replace("s",""))*1e3;mutateDom(()=>{stages.before();});reachedBefore=true;requestAnimationFrame(()=>{if(interrupted)
|
||||
return;mutateDom(()=>{stages.end();});releaseNextTicks();setTimeout(el._x_transitioning.finish,duration+delay);reachedEnd=true;});});}
|
||||
function modifierValue(modifiers,key,fallback){if(modifiers.indexOf(key)===-1)
|
||||
return fallback;const rawValue=modifiers[modifiers.indexOf(key)+1];if(!rawValue)
|
||||
return fallback;if(key==="scale"){if(isNaN(rawValue))
|
||||
return fallback;}
|
||||
if(key==="duration"){let match=rawValue.match(/([0-9]+)ms/);if(match)
|
||||
return match[1];}
|
||||
if(key==="origin"){if(["top","right","left","center","bottom"].includes(modifiers[modifiers.indexOf(key)+2])){return[rawValue,modifiers[modifiers.indexOf(key)+2]].join(" ");}}
|
||||
return rawValue;}
|
||||
function debounce(func,wait){var timeout;return function(){var context=this,args=arguments;var later=function(){timeout=null;func.apply(context,args);};clearTimeout(timeout);timeout=setTimeout(later,wait);};}
|
||||
function throttle(func,limit){let inThrottle;return function(){let context=this,args=arguments;if(!inThrottle){func.apply(context,args);inThrottle=true;setTimeout(()=>inThrottle=false,limit);}};}
|
||||
function plugin(callback){callback(alpine_default);}
|
||||
var stores={};var isReactive=false;function store(name,value){if(!isReactive){stores=reactive(stores);isReactive=true;}
|
||||
if(value===void 0){return stores[name];}
|
||||
stores[name]=value;if(typeof value==="object"&&value!==null&&value.hasOwnProperty("init")&&typeof value.init==="function"){stores[name].init();}
|
||||
initInterceptors(stores[name]);}
|
||||
function getStores(){return stores;}
|
||||
var isCloning=false;function skipDuringClone(callback,fallback=()=>{}){return(...args)=>isCloning?fallback(...args):callback(...args);}
|
||||
function clone(oldEl,newEl){newEl._x_dataStack=oldEl._x_dataStack;isCloning=true;dontRegisterReactiveSideEffects(()=>{cloneTree(newEl);});isCloning=false;}
|
||||
function cloneTree(el){let hasRunThroughFirstEl=false;let shallowWalker=(el2,callback)=>{walk(el2,(el3,skip)=>{if(hasRunThroughFirstEl&&isRoot(el3))
|
||||
return skip();hasRunThroughFirstEl=true;callback(el3,skip);});};initTree(el,shallowWalker);}
|
||||
function dontRegisterReactiveSideEffects(callback){let cache=effect;overrideEffect((callback2,el)=>{let storedEffect=cache(callback2);release(storedEffect);return()=>{};});callback();overrideEffect(cache);}
|
||||
var datas={};function data(name,callback){datas[name]=callback;}
|
||||
function injectDataProviders(obj,context){Object.entries(datas).forEach(([name,callback])=>{Object.defineProperty(obj,name,{get(){return(...args)=>{return callback.bind(context)(...args);};},enumerable:false});});return obj;}
|
||||
var Alpine={get reactive(){return reactive;},get release(){return release;},get effect(){return effect;},get raw(){return raw;},version:"3.5.1",flushAndStopDeferringMutations,disableEffectScheduling,setReactivityEngine,skipDuringClone,addRootSelector,deferMutations,mapAttributes,evaluateLater,setEvaluator,mergeProxies,closestRoot,interceptor,transition,setStyles,mutateDom,directive,throttle,debounce,evaluate,initTree,nextTick,prefix:setPrefix,plugin,magic,store,start,clone,data};var alpine_default=Alpine;function makeMap(str,expectsLowerCase){const map=Object.create(null);const list=str.split(",");for(let i=0;i<list.length;i++){map[list[i]]=true;}
|
||||
return expectsLowerCase?(val)=>!!map[val.toLowerCase()]:(val)=>!!map[val];}
|
||||
var PatchFlagNames={[1]:`TEXT`,[2]:`CLASS`,[4]:`STYLE`,[8]:`PROPS`,[16]:`FULL_PROPS`,[32]:`HYDRATE_EVENTS`,[64]:`STABLE_FRAGMENT`,[128]:`KEYED_FRAGMENT`,[256]:`UNKEYED_FRAGMENT`,[512]:`NEED_PATCH`,[1024]:`DYNAMIC_SLOTS`,[2048]:`DEV_ROOT_FRAGMENT`,[-1]:`HOISTED`,[-2]:`BAIL`};var slotFlagsText={[1]:"STABLE",[2]:"DYNAMIC",[3]:"FORWARDED"};var specialBooleanAttrs=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;var isBooleanAttr=makeMap(specialBooleanAttrs+`,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);var EMPTY_OBJ=true?Object.freeze({}):{};var EMPTY_ARR=true?Object.freeze([]):[];var extend=Object.assign;var hasOwnProperty=Object.prototype.hasOwnProperty;var hasOwn=(val,key)=>hasOwnProperty.call(val,key);var isArray=Array.isArray;var isMap=(val)=>toTypeString(val)==="[object Map]";var isString=(val)=>typeof val==="string";var isSymbol=(val)=>typeof val==="symbol";var isObject=(val)=>val!==null&&typeof val==="object";var objectToString=Object.prototype.toString;var toTypeString=(value)=>objectToString.call(value);var toRawType=(value)=>{return toTypeString(value).slice(8,-1);};var isIntegerKey=(key)=>isString(key)&&key!=="NaN"&&key[0]!=="-"&&""+parseInt(key,10)===key;var cacheStringFunction=(fn)=>{const cache=Object.create(null);return(str)=>{const hit=cache[str];return hit||(cache[str]=fn(str));};};var camelizeRE=/-(\w)/g;var camelize=cacheStringFunction((str)=>{return str.replace(camelizeRE,(_,c)=>c?c.toUpperCase():"");});var hyphenateRE=/\B([A-Z])/g;var hyphenate=cacheStringFunction((str)=>str.replace(hyphenateRE,"-$1").toLowerCase());var capitalize=cacheStringFunction((str)=>str.charAt(0).toUpperCase()+str.slice(1));var toHandlerKey=cacheStringFunction((str)=>str?`on${capitalize(str)}`:``);var hasChanged=(value,oldValue)=>value!==oldValue&&(value===value||oldValue===oldValue);var targetMap=new WeakMap();var effectStack=[];var activeEffect;var ITERATE_KEY=Symbol(true?"iterate":"");var MAP_KEY_ITERATE_KEY=Symbol(true?"Map key iterate":"");function isEffect(fn){return fn&&fn._isEffect===true;}
|
||||
function effect2(fn,options=EMPTY_OBJ){if(isEffect(fn)){fn=fn.raw;}
|
||||
const effect3=createReactiveEffect(fn,options);if(!options.lazy){effect3();}
|
||||
return effect3;}
|
||||
function stop(effect3){if(effect3.active){cleanup(effect3);if(effect3.options.onStop){effect3.options.onStop();}
|
||||
effect3.active=false;}}
|
||||
var uid=0;function createReactiveEffect(fn,options){const effect3=function reactiveEffect(){if(!effect3.active){return fn();}
|
||||
if(!effectStack.includes(effect3)){cleanup(effect3);try{enableTracking();effectStack.push(effect3);activeEffect=effect3;return fn();}finally{effectStack.pop();resetTracking();activeEffect=effectStack[effectStack.length-1];}}};effect3.id=uid++;effect3.allowRecurse=!!options.allowRecurse;effect3._isEffect=true;effect3.active=true;effect3.raw=fn;effect3.deps=[];effect3.options=options;return effect3;}
|
||||
function cleanup(effect3){const{deps}=effect3;if(deps.length){for(let i=0;i<deps.length;i++){deps[i].delete(effect3);}
|
||||
deps.length=0;}}
|
||||
var shouldTrack=true;var trackStack=[];function pauseTracking(){trackStack.push(shouldTrack);shouldTrack=false;}
|
||||
function enableTracking(){trackStack.push(shouldTrack);shouldTrack=true;}
|
||||
function resetTracking(){const last=trackStack.pop();shouldTrack=last===void 0?true:last;}
|
||||
function track(target,type,key){if(!shouldTrack||activeEffect===void 0){return;}
|
||||
let depsMap=targetMap.get(target);if(!depsMap){targetMap.set(target,depsMap=new Map());}
|
||||
let dep=depsMap.get(key);if(!dep){depsMap.set(key,dep=new Set());}
|
||||
if(!dep.has(activeEffect)){dep.add(activeEffect);activeEffect.deps.push(dep);if(activeEffect.options.onTrack){activeEffect.options.onTrack({effect:activeEffect,target,type,key});}}}
|
||||
function trigger(target,type,key,newValue,oldValue,oldTarget){const depsMap=targetMap.get(target);if(!depsMap){return;}
|
||||
const effects=new Set();const add2=(effectsToAdd)=>{if(effectsToAdd){effectsToAdd.forEach((effect3)=>{if(effect3!==activeEffect||effect3.allowRecurse){effects.add(effect3);}});}};if(type==="clear"){depsMap.forEach(add2);}else if(key==="length"&&isArray(target)){depsMap.forEach((dep,key2)=>{if(key2==="length"||key2>=newValue){add2(dep);}});}else{if(key!==void 0){add2(depsMap.get(key));}
|
||||
switch(type){case"add":if(!isArray(target)){add2(depsMap.get(ITERATE_KEY));if(isMap(target)){add2(depsMap.get(MAP_KEY_ITERATE_KEY));}}else if(isIntegerKey(key)){add2(depsMap.get("length"));}
|
||||
break;case"delete":if(!isArray(target)){add2(depsMap.get(ITERATE_KEY));if(isMap(target)){add2(depsMap.get(MAP_KEY_ITERATE_KEY));}}
|
||||
break;case"set":if(isMap(target)){add2(depsMap.get(ITERATE_KEY));}
|
||||
break;}}
|
||||
const run=(effect3)=>{if(effect3.options.onTrigger){effect3.options.onTrigger({effect:effect3,target,key,type,newValue,oldValue,oldTarget});}
|
||||
if(effect3.options.scheduler){effect3.options.scheduler(effect3);}else{effect3();}};effects.forEach(run);}
|
||||
var isNonTrackableKeys=makeMap(`__proto__,__v_isRef,__isVue`);var builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).map((key)=>Symbol[key]).filter(isSymbol));var get2=createGetter();var shallowGet=createGetter(false,true);var readonlyGet=createGetter(true);var shallowReadonlyGet=createGetter(true,true);var arrayInstrumentations={};["includes","indexOf","lastIndexOf"].forEach((key)=>{const method=Array.prototype[key];arrayInstrumentations[key]=function(...args){const arr=toRaw(this);for(let i=0,l=this.length;i<l;i++){track(arr,"get",i+"");}
|
||||
const res=method.apply(arr,args);if(res===-1||res===false){return method.apply(arr,args.map(toRaw));}else{return res;}};});["push","pop","shift","unshift","splice"].forEach((key)=>{const method=Array.prototype[key];arrayInstrumentations[key]=function(...args){pauseTracking();const res=method.apply(this,args);resetTracking();return res;};});function createGetter(isReadonly=false,shallow=false){return function get3(target,key,receiver){if(key==="__v_isReactive"){return!isReadonly;}else if(key==="__v_isReadonly"){return isReadonly;}else if(key==="__v_raw"&&receiver===(isReadonly?shallow?shallowReadonlyMap:readonlyMap:shallow?shallowReactiveMap:reactiveMap).get(target)){return target;}
|
||||
const targetIsArray=isArray(target);if(!isReadonly&&targetIsArray&&hasOwn(arrayInstrumentations,key)){return Reflect.get(arrayInstrumentations,key,receiver);}
|
||||
const res=Reflect.get(target,key,receiver);if(isSymbol(key)?builtInSymbols.has(key):isNonTrackableKeys(key)){return res;}
|
||||
if(!isReadonly){track(target,"get",key);}
|
||||
if(shallow){return res;}
|
||||
if(isRef(res)){const shouldUnwrap=!targetIsArray||!isIntegerKey(key);return shouldUnwrap?res.value:res;}
|
||||
if(isObject(res)){return isReadonly?readonly(res):reactive2(res);}
|
||||
return res;};}
|
||||
var set2=createSetter();var shallowSet=createSetter(true);function createSetter(shallow=false){return function set3(target,key,value,receiver){let oldValue=target[key];if(!shallow){value=toRaw(value);oldValue=toRaw(oldValue);if(!isArray(target)&&isRef(oldValue)&&!isRef(value)){oldValue.value=value;return true;}}
|
||||
const hadKey=isArray(target)&&isIntegerKey(key)?Number(key)<target.length:hasOwn(target,key);const result=Reflect.set(target,key,value,receiver);if(target===toRaw(receiver)){if(!hadKey){trigger(target,"add",key,value);}else if(hasChanged(value,oldValue)){trigger(target,"set",key,value,oldValue);}}
|
||||
return result;};}
|
||||
function deleteProperty(target,key){const hadKey=hasOwn(target,key);const oldValue=target[key];const result=Reflect.deleteProperty(target,key);if(result&&hadKey){trigger(target,"delete",key,void 0,oldValue);}
|
||||
return result;}
|
||||
function has(target,key){const result=Reflect.has(target,key);if(!isSymbol(key)||!builtInSymbols.has(key)){track(target,"has",key);}
|
||||
return result;}
|
||||
function ownKeys(target){track(target,"iterate",isArray(target)?"length":ITERATE_KEY);return Reflect.ownKeys(target);}
|
||||
var mutableHandlers={get:get2,set:set2,deleteProperty,has,ownKeys};var readonlyHandlers={get:readonlyGet,set(target,key){if(true){console.warn(`Set operation on key "${String(key)}" failed: target is readonly.`,target);}
|
||||
return true;},deleteProperty(target,key){if(true){console.warn(`Delete operation on key "${String(key)}" failed: target is readonly.`,target);}
|
||||
return true;}};var shallowReactiveHandlers=extend({},mutableHandlers,{get:shallowGet,set:shallowSet});var shallowReadonlyHandlers=extend({},readonlyHandlers,{get:shallowReadonlyGet});var toReactive=(value)=>isObject(value)?reactive2(value):value;var toReadonly=(value)=>isObject(value)?readonly(value):value;var toShallow=(value)=>value;var getProto=(v)=>Reflect.getPrototypeOf(v);function get$1(target,key,isReadonly=false,isShallow=false){target=target["__v_raw"];const rawTarget=toRaw(target);const rawKey=toRaw(key);if(key!==rawKey){!isReadonly&&track(rawTarget,"get",key);}
|
||||
!isReadonly&&track(rawTarget,"get",rawKey);const{has:has2}=getProto(rawTarget);const wrap=isShallow?toShallow:isReadonly?toReadonly:toReactive;if(has2.call(rawTarget,key)){return wrap(target.get(key));}else if(has2.call(rawTarget,rawKey)){return wrap(target.get(rawKey));}else if(target!==rawTarget){target.get(key);}}
|
||||
function has$1(key,isReadonly=false){const target=this["__v_raw"];const rawTarget=toRaw(target);const rawKey=toRaw(key);if(key!==rawKey){!isReadonly&&track(rawTarget,"has",key);}
|
||||
!isReadonly&&track(rawTarget,"has",rawKey);return key===rawKey?target.has(key):target.has(key)||target.has(rawKey);}
|
||||
function size(target,isReadonly=false){target=target["__v_raw"];!isReadonly&&track(toRaw(target),"iterate",ITERATE_KEY);return Reflect.get(target,"size",target);}
|
||||
function add(value){value=toRaw(value);const target=toRaw(this);const proto=getProto(target);const hadKey=proto.has.call(target,value);if(!hadKey){target.add(value);trigger(target,"add",value,value);}
|
||||
return this;}
|
||||
function set$1(key,value){value=toRaw(value);const target=toRaw(this);const{has:has2,get:get3}=getProto(target);let hadKey=has2.call(target,key);if(!hadKey){key=toRaw(key);hadKey=has2.call(target,key);}else if(true){checkIdentityKeys(target,has2,key);}
|
||||
const oldValue=get3.call(target,key);target.set(key,value);if(!hadKey){trigger(target,"add",key,value);}else if(hasChanged(value,oldValue)){trigger(target,"set",key,value,oldValue);}
|
||||
return this;}
|
||||
function deleteEntry(key){const target=toRaw(this);const{has:has2,get:get3}=getProto(target);let hadKey=has2.call(target,key);if(!hadKey){key=toRaw(key);hadKey=has2.call(target,key);}else if(true){checkIdentityKeys(target,has2,key);}
|
||||
const oldValue=get3?get3.call(target,key):void 0;const result=target.delete(key);if(hadKey){trigger(target,"delete",key,void 0,oldValue);}
|
||||
return result;}
|
||||
function clear(){const target=toRaw(this);const hadItems=target.size!==0;const oldTarget=true?isMap(target)?new Map(target):new Set(target):void 0;const result=target.clear();if(hadItems){trigger(target,"clear",void 0,void 0,oldTarget);}
|
||||
return result;}
|
||||
function createForEach(isReadonly,isShallow){return function forEach(callback,thisArg){const observed=this;const target=observed["__v_raw"];const rawTarget=toRaw(target);const wrap=isShallow?toShallow:isReadonly?toReadonly:toReactive;!isReadonly&&track(rawTarget,"iterate",ITERATE_KEY);return target.forEach((value,key)=>{return callback.call(thisArg,wrap(value),wrap(key),observed);});};}
|
||||
function createIterableMethod(method,isReadonly,isShallow){return function(...args){const target=this["__v_raw"];const rawTarget=toRaw(target);const targetIsMap=isMap(rawTarget);const isPair=method==="entries"||method===Symbol.iterator&&targetIsMap;const isKeyOnly=method==="keys"&&targetIsMap;const innerIterator=target[method](...args);const wrap=isShallow?toShallow:isReadonly?toReadonly:toReactive;!isReadonly&&track(rawTarget,"iterate",isKeyOnly?MAP_KEY_ITERATE_KEY:ITERATE_KEY);return{next(){const{value,done}=innerIterator.next();return done?{value,done}:{value:isPair?[wrap(value[0]),wrap(value[1])]:wrap(value),done};},[Symbol.iterator](){return this;}};};}
|
||||
function createReadonlyMethod(type){return function(...args){if(true){const key=args[0]?`on key "${args[0]}" `:``;console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`,toRaw(this));}
|
||||
return type==="delete"?false:this;};}
|
||||
var mutableInstrumentations={get(key){return get$1(this,key);},get size(){return size(this);},has:has$1,add,set:set$1,delete:deleteEntry,clear,forEach:createForEach(false,false)};var shallowInstrumentations={get(key){return get$1(this,key,false,true);},get size(){return size(this);},has:has$1,add,set:set$1,delete:deleteEntry,clear,forEach:createForEach(false,true)};var readonlyInstrumentations={get(key){return get$1(this,key,true);},get size(){return size(this,true);},has(key){return has$1.call(this,key,true);},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(true,false)};var shallowReadonlyInstrumentations={get(key){return get$1(this,key,true,true);},get size(){return size(this,true);},has(key){return has$1.call(this,key,true);},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(true,true)};var iteratorMethods=["keys","values","entries",Symbol.iterator];iteratorMethods.forEach((method)=>{mutableInstrumentations[method]=createIterableMethod(method,false,false);readonlyInstrumentations[method]=createIterableMethod(method,true,false);shallowInstrumentations[method]=createIterableMethod(method,false,true);shallowReadonlyInstrumentations[method]=createIterableMethod(method,true,true);});function createInstrumentationGetter(isReadonly,shallow){const instrumentations=shallow?isReadonly?shallowReadonlyInstrumentations:shallowInstrumentations:isReadonly?readonlyInstrumentations:mutableInstrumentations;return(target,key,receiver)=>{if(key==="__v_isReactive"){return!isReadonly;}else if(key==="__v_isReadonly"){return isReadonly;}else if(key==="__v_raw"){return target;}
|
||||
return Reflect.get(hasOwn(instrumentations,key)&&key in target?instrumentations:target,key,receiver);};}
|
||||
var mutableCollectionHandlers={get:createInstrumentationGetter(false,false)};var shallowCollectionHandlers={get:createInstrumentationGetter(false,true)};var readonlyCollectionHandlers={get:createInstrumentationGetter(true,false)};var shallowReadonlyCollectionHandlers={get:createInstrumentationGetter(true,true)};function checkIdentityKeys(target,has2,key){const rawKey=toRaw(key);if(rawKey!==key&&has2.call(target,rawKey)){const type=toRawType(target);console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? `as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);}}
|
||||
var reactiveMap=new WeakMap();var shallowReactiveMap=new WeakMap();var readonlyMap=new WeakMap();var shallowReadonlyMap=new WeakMap();function targetTypeMap(rawType){switch(rawType){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0;}}
|
||||
function getTargetType(value){return value["__v_skip"]||!Object.isExtensible(value)?0:targetTypeMap(toRawType(value));}
|
||||
function reactive2(target){if(target&&target["__v_isReadonly"]){return target;}
|
||||
return createReactiveObject(target,false,mutableHandlers,mutableCollectionHandlers,reactiveMap);}
|
||||
function readonly(target){return createReactiveObject(target,true,readonlyHandlers,readonlyCollectionHandlers,readonlyMap);}
|
||||
function createReactiveObject(target,isReadonly,baseHandlers,collectionHandlers,proxyMap){if(!isObject(target)){if(true){console.warn(`value cannot be made reactive: ${String(target)}`);}
|
||||
return target;}
|
||||
if(target["__v_raw"]&&!(isReadonly&&target["__v_isReactive"])){return target;}
|
||||
const existingProxy=proxyMap.get(target);if(existingProxy){return existingProxy;}
|
||||
const targetType=getTargetType(target);if(targetType===0){return target;}
|
||||
const proxy=new Proxy(target,targetType===2?collectionHandlers:baseHandlers);proxyMap.set(target,proxy);return proxy;}
|
||||
function toRaw(observed){return observed&&toRaw(observed["__v_raw"])||observed;}
|
||||
function isRef(r){return Boolean(r&&r.__v_isRef===true);}
|
||||
magic("nextTick",()=>nextTick);magic("dispatch",(el)=>dispatch.bind(dispatch,el));magic("watch",(el)=>(key,callback)=>{let evaluate2=evaluateLater(el,key);let firstTime=true;let oldValue;effect(()=>evaluate2((value)=>{let div=document.createElement("div");div.dataset.throwAway=value;if(!firstTime){queueMicrotask(()=>{callback(value,oldValue);oldValue=value;});}else{oldValue=value;}
|
||||
firstTime=false;}));});magic("store",getStores);magic("data",(el)=>{return mergeProxies(closestDataStack(el));});magic("root",(el)=>closestRoot(el));magic("refs",(el)=>{if(el._x_refs_proxy)
|
||||
return el._x_refs_proxy;el._x_refs_proxy=mergeProxies(getArrayOfRefObject(el));return el._x_refs_proxy;});function getArrayOfRefObject(el){let refObjects=[];let currentEl=el;while(currentEl){if(currentEl._x_refs)
|
||||
refObjects.push(currentEl._x_refs);currentEl=currentEl.parentNode;}
|
||||
return refObjects;}
|
||||
magic("el",(el)=>el);var handler=()=>{};handler.inline=(el,{modifiers},{cleanup:cleanup2})=>{modifiers.includes("self")?el._x_ignoreSelf=true:el._x_ignore=true;cleanup2(()=>{modifiers.includes("self")?delete el._x_ignoreSelf:delete el._x_ignore;});};directive("ignore",handler);directive("effect",(el,{expression},{effect:effect3})=>effect3(evaluateLater(el,expression)));function bind(el,name,value,modifiers=[]){if(!el._x_bindings)
|
||||
el._x_bindings=reactive({});el._x_bindings[name]=value;name=modifiers.includes("camel")?camelCase(name):name;switch(name){case"value":bindInputValue(el,value);break;case"style":bindStyles(el,value);break;case"class":bindClasses(el,value);break;default:bindAttribute(el,name,value);break;}}
|
||||
function bindInputValue(el,value){if(el.type==="radio"){if(el.attributes.value===void 0){el.value=value;}
|
||||
if(window.fromModel){el.checked=checkedAttrLooseCompare(el.value,value);}}else if(el.type==="checkbox"){if(Number.isInteger(value)){el.value=value;}else if(!Number.isInteger(value)&&!Array.isArray(value)&&typeof value!=="boolean"&&![null,void 0].includes(value)){el.value=String(value);}else{if(Array.isArray(value)){el.checked=value.some((val)=>checkedAttrLooseCompare(val,el.value));}else{el.checked=!!value;}}}else if(el.tagName==="SELECT"){updateSelect(el,value);}else{if(el.value===value)
|
||||
return;el.value=value;}}
|
||||
function bindClasses(el,value){if(el._x_undoAddedClasses)
|
||||
el._x_undoAddedClasses();el._x_undoAddedClasses=setClasses(el,value);}
|
||||
function bindStyles(el,value){if(el._x_undoAddedStyles)
|
||||
el._x_undoAddedStyles();el._x_undoAddedStyles=setStyles(el,value);}
|
||||
function bindAttribute(el,name,value){if([null,void 0,false].includes(value)&&attributeShouldntBePreservedIfFalsy(name)){el.removeAttribute(name);}else{if(isBooleanAttr2(name))
|
||||
value=name;setIfChanged(el,name,value);}}
|
||||
function setIfChanged(el,attrName,value){if(el.getAttribute(attrName)!=value){el.setAttribute(attrName,value);}}
|
||||
function updateSelect(el,value){const arrayWrappedValue=[].concat(value).map((value2)=>{return value2+"";});Array.from(el.options).forEach((option)=>{option.selected=arrayWrappedValue.includes(option.value);});}
|
||||
function camelCase(subject){return subject.toLowerCase().replace(/-(\w)/g,(match,char)=>char.toUpperCase());}
|
||||
function checkedAttrLooseCompare(valueA,valueB){return valueA==valueB;}
|
||||
function isBooleanAttr2(attrName){const booleanAttributes=["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"];return booleanAttributes.includes(attrName);}
|
||||
function attributeShouldntBePreservedIfFalsy(name){return!["aria-pressed","aria-checked","aria-expanded"].includes(name);}
|
||||
function on(el,event,modifiers,callback){let listenerTarget=el;let handler3=(e)=>callback(e);let options={};let wrapHandler=(callback2,wrapper)=>(e)=>wrapper(callback2,e);if(modifiers.includes("dot"))
|
||||
event=dotSyntax(event);if(modifiers.includes("camel"))
|
||||
event=camelCase2(event);if(modifiers.includes("passive"))
|
||||
options.passive=true;if(modifiers.includes("capture"))
|
||||
options.capture=true;if(modifiers.includes("window"))
|
||||
listenerTarget=window;if(modifiers.includes("document"))
|
||||
listenerTarget=document;if(modifiers.includes("prevent"))
|
||||
handler3=wrapHandler(handler3,(next,e)=>{e.preventDefault();next(e);});if(modifiers.includes("stop"))
|
||||
handler3=wrapHandler(handler3,(next,e)=>{e.stopPropagation();next(e);});if(modifiers.includes("self"))
|
||||
handler3=wrapHandler(handler3,(next,e)=>{e.target===el&&next(e);});if(modifiers.includes("away")||modifiers.includes("outside")){listenerTarget=document;handler3=wrapHandler(handler3,(next,e)=>{if(el.contains(e.target))
|
||||
return;if(el.offsetWidth<1&&el.offsetHeight<1)
|
||||
return;if(el._x_isShown===false)
|
||||
return;next(e);});}
|
||||
handler3=wrapHandler(handler3,(next,e)=>{if(isKeyEvent(event)){if(isListeningForASpecificKeyThatHasntBeenPressed(e,modifiers)){return;}}
|
||||
next(e);});if(modifiers.includes("debounce")){let nextModifier=modifiers[modifiers.indexOf("debounce")+1]||"invalid-wait";let wait=isNumeric(nextModifier.split("ms")[0])?Number(nextModifier.split("ms")[0]):250;handler3=debounce(handler3,wait);}
|
||||
if(modifiers.includes("throttle")){let nextModifier=modifiers[modifiers.indexOf("throttle")+1]||"invalid-wait";let wait=isNumeric(nextModifier.split("ms")[0])?Number(nextModifier.split("ms")[0]):250;handler3=throttle(handler3,wait);}
|
||||
if(modifiers.includes("once")){handler3=wrapHandler(handler3,(next,e)=>{next(e);listenerTarget.removeEventListener(event,handler3,options);});}
|
||||
listenerTarget.addEventListener(event,handler3,options);return()=>{listenerTarget.removeEventListener(event,handler3,options);};}
|
||||
function dotSyntax(subject){return subject.replace(/-/g,".");}
|
||||
function camelCase2(subject){return subject.toLowerCase().replace(/-(\w)/g,(match,char)=>char.toUpperCase());}
|
||||
function isNumeric(subject){return!Array.isArray(subject)&&!isNaN(subject);}
|
||||
function kebabCase2(subject){return subject.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase();}
|
||||
function isKeyEvent(event){return["keydown","keyup"].includes(event);}
|
||||
function isListeningForASpecificKeyThatHasntBeenPressed(e,modifiers){let keyModifiers=modifiers.filter((i)=>{return!["window","document","prevent","stop","once"].includes(i);});if(keyModifiers.includes("debounce")){let debounceIndex=keyModifiers.indexOf("debounce");keyModifiers.splice(debounceIndex,isNumeric((keyModifiers[debounceIndex+1]||"invalid-wait").split("ms")[0])?2:1);}
|
||||
if(keyModifiers.length===0)
|
||||
return false;if(keyModifiers.length===1&&keyToModifiers(e.key).includes(keyModifiers[0]))
|
||||
return false;const systemKeyModifiers=["ctrl","shift","alt","meta","cmd","super"];const selectedSystemKeyModifiers=systemKeyModifiers.filter((modifier)=>keyModifiers.includes(modifier));keyModifiers=keyModifiers.filter((i)=>!selectedSystemKeyModifiers.includes(i));if(selectedSystemKeyModifiers.length>0){const activelyPressedKeyModifiers=selectedSystemKeyModifiers.filter((modifier)=>{if(modifier==="cmd"||modifier==="super")
|
||||
modifier="meta";return e[`${modifier}Key`];});if(activelyPressedKeyModifiers.length===selectedSystemKeyModifiers.length){if(keyToModifiers(e.key).includes(keyModifiers[0]))
|
||||
return false;}}
|
||||
return true;}
|
||||
function keyToModifiers(key){if(!key)
|
||||
return[];key=kebabCase2(key);let modifierToKeyMap={ctrl:"control",slash:"/",space:"-",spacebar:"-",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"="};modifierToKeyMap[key]=key;return Object.keys(modifierToKeyMap).map((modifier)=>{if(modifierToKeyMap[modifier]===key)
|
||||
return modifier;}).filter((modifier)=>modifier);}
|
||||
directive("model",(el,{modifiers,expression},{effect:effect3,cleanup:cleanup2})=>{let evaluate2=evaluateLater(el,expression);let assignmentExpression=`${expression} = rightSideOfExpression($event, ${expression})`;let evaluateAssignment=evaluateLater(el,assignmentExpression);var event=el.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(el.type)||modifiers.includes("lazy")?"change":"input";let assigmentFunction=generateAssignmentFunction(el,modifiers,expression);let removeListener=on(el,event,modifiers,(e)=>{evaluateAssignment(()=>{},{scope:{$event:e,rightSideOfExpression:assigmentFunction}});});cleanup2(()=>removeListener());let evaluateSetModel=evaluateLater(el,`${expression} = __placeholder`);el._x_model={get(){let result;evaluate2((value)=>result=value);return result;},set(value){evaluateSetModel(()=>{},{scope:{__placeholder:value}});}};el._x_forceModelUpdate=()=>{evaluate2((value)=>{if(value===void 0&&expression.match(/\./))
|
||||
value="";window.fromModel=true;mutateDom(()=>bind(el,"value",value));delete window.fromModel;});};effect3(()=>{if(modifiers.includes("unintrusive")&&document.activeElement.isSameNode(el))
|
||||
return;el._x_forceModelUpdate();});});function generateAssignmentFunction(el,modifiers,expression){if(el.type==="radio"){mutateDom(()=>{if(!el.hasAttribute("name"))
|
||||
el.setAttribute("name",expression);});}
|
||||
return(event,currentValue)=>{return mutateDom(()=>{if(event instanceof CustomEvent&&event.detail!==void 0){return event.detail||event.target.value;}else if(el.type==="checkbox"){if(Array.isArray(currentValue)){let newValue=modifiers.includes("number")?safeParseNumber(event.target.value):event.target.value;return event.target.checked?currentValue.concat([newValue]):currentValue.filter((el2)=>!checkedAttrLooseCompare2(el2,newValue));}else{return event.target.checked;}}else if(el.tagName.toLowerCase()==="select"&&el.multiple){return modifiers.includes("number")?Array.from(event.target.selectedOptions).map((option)=>{let rawValue=option.value||option.text;return safeParseNumber(rawValue);}):Array.from(event.target.selectedOptions).map((option)=>{return option.value||option.text;});}else{let rawValue=event.target.value;return modifiers.includes("number")?safeParseNumber(rawValue):modifiers.includes("trim")?rawValue.trim():rawValue;}});};}
|
||||
function safeParseNumber(rawValue){let number=rawValue?parseFloat(rawValue):null;return isNumeric2(number)?number:rawValue;}
|
||||
function checkedAttrLooseCompare2(valueA,valueB){return valueA==valueB;}
|
||||
function isNumeric2(subject){return!Array.isArray(subject)&&!isNaN(subject);}
|
||||
directive("cloak",(el)=>queueMicrotask(()=>mutateDom(()=>el.removeAttribute(prefix("cloak")))));addInitSelector(()=>`[${prefix("init")}]`);directive("init",skipDuringClone((el,{expression})=>{if(typeof expression==="string"){return!!expression.trim()&&evaluate(el,expression,{},false);}
|
||||
return evaluate(el,expression,{},false);}));directive("text",(el,{expression},{effect:effect3,evaluateLater:evaluateLater2})=>{let evaluate2=evaluateLater2(expression);effect3(()=>{evaluate2((value)=>{mutateDom(()=>{el.textContent=value;});});});});directive("html",(el,{expression},{effect:effect3,evaluateLater:evaluateLater2})=>{let evaluate2=evaluateLater2(expression);effect3(()=>{evaluate2((value)=>{el.innerHTML=value;});});});mapAttributes(startingWith(":",into(prefix("bind:"))));directive("bind",(el,{value,modifiers,expression,original},{effect:effect3})=>{if(!value)
|
||||
return applyBindingsObject(el,expression,original,effect3);if(value==="key")
|
||||
return storeKeyForXFor(el,expression);let evaluate2=evaluateLater(el,expression);effect3(()=>evaluate2((result)=>{if(result===void 0&&expression.match(/\./))
|
||||
result="";mutateDom(()=>bind(el,value,result,modifiers));}));});function applyBindingsObject(el,expression,original,effect3){let getBindings=evaluateLater(el,expression);let cleanupRunners=[];effect3(()=>{while(cleanupRunners.length)
|
||||
cleanupRunners.pop()();getBindings((bindings)=>{let attributes=Object.entries(bindings).map(([name,value])=>({name,value}));attributes=attributes.filter((attr)=>{return!(typeof attr.value==="object"&&!Array.isArray(attr.value)&&attr.value!==null);});let staticAttributes=attributesOnly(attributes);attributes=attributes.map((attribute)=>{if(staticAttributes.find((attr)=>attr.name===attribute.name)){return{name:`x-bind:${attribute.name}`,value:`"${attribute.value}"`};}
|
||||
return attribute;});directives(el,attributes,original).map((handle)=>{cleanupRunners.push(handle.runCleanups);handle();});});});}
|
||||
function storeKeyForXFor(el,expression){el._x_keyExpression=expression;}
|
||||
addRootSelector(()=>`[${prefix("data")}]`);directive("data",skipDuringClone((el,{expression},{cleanup:cleanup2})=>{expression=expression===""?"{}":expression;let magicContext={};injectMagics(magicContext,el);let dataProviderContext={};injectDataProviders(dataProviderContext,magicContext);let data2=evaluate(el,expression,{scope:dataProviderContext});if(data2===void 0)
|
||||
data2={};injectMagics(data2,el);let reactiveData=reactive(data2);initInterceptors(reactiveData);let undo=addScopeToNode(el,reactiveData);reactiveData["init"]&&evaluate(el,reactiveData["init"]);cleanup2(()=>{undo();reactiveData["destroy"]&&evaluate(el,reactiveData["destroy"]);});}));directive("show",(el,{modifiers,expression},{effect:effect3})=>{let evaluate2=evaluateLater(el,expression);let hide=()=>mutateDom(()=>{el.style.display="none";el._x_isShown=false;});let show=()=>mutateDom(()=>{if(el.style.length===1&&el.style.display==="none"){el.removeAttribute("style");}else{el.style.removeProperty("display");}
|
||||
el._x_isShown=true;});let clickAwayCompatibleShow=()=>setTimeout(show);let toggle=once((value)=>value?show():hide(),(value)=>{if(typeof el._x_toggleAndCascadeWithTransitions==="function"){el._x_toggleAndCascadeWithTransitions(el,value,show,hide);}else{value?clickAwayCompatibleShow():hide();}});let oldValue;let firstTime=true;effect3(()=>evaluate2((value)=>{if(!firstTime&&value===oldValue)
|
||||
return;if(modifiers.includes("immediate"))
|
||||
value?clickAwayCompatibleShow():hide();toggle(value);oldValue=value;firstTime=false;}));});directive("for",(el,{expression},{effect:effect3,cleanup:cleanup2})=>{let iteratorNames=parseForExpression(expression);let evaluateItems=evaluateLater(el,iteratorNames.items);let evaluateKey=evaluateLater(el,el._x_keyExpression||"index");el._x_prevKeys=[];el._x_lookup={};effect3(()=>loop(el,iteratorNames,evaluateItems,evaluateKey));cleanup2(()=>{Object.values(el._x_lookup).forEach((el2)=>el2.remove());delete el._x_prevKeys;delete el._x_lookup;});});function loop(el,iteratorNames,evaluateItems,evaluateKey){let isObject2=(i)=>typeof i==="object"&&!Array.isArray(i);let templateEl=el;evaluateItems((items)=>{if(isNumeric3(items)&&items>=0){items=Array.from(Array(items).keys(),(i)=>i+1);}
|
||||
if(items===void 0)
|
||||
items=[];let lookup=el._x_lookup;let prevKeys=el._x_prevKeys;let scopes=[];let keys=[];if(isObject2(items)){items=Object.entries(items).map(([key,value])=>{let scope=getIterationScopeVariables(iteratorNames,value,key,items);evaluateKey((value2)=>keys.push(value2),{scope:{index:key,...scope}});scopes.push(scope);});}else{for(let i=0;i<items.length;i++){let scope=getIterationScopeVariables(iteratorNames,items[i],i,items);evaluateKey((value)=>keys.push(value),{scope:{index:i,...scope}});scopes.push(scope);}}
|
||||
let adds=[];let moves=[];let removes=[];let sames=[];for(let i=0;i<prevKeys.length;i++){let key=prevKeys[i];if(keys.indexOf(key)===-1)
|
||||
removes.push(key);}
|
||||
prevKeys=prevKeys.filter((key)=>!removes.includes(key));let lastKey="template";for(let i=0;i<keys.length;i++){let key=keys[i];let prevIndex=prevKeys.indexOf(key);if(prevIndex===-1){prevKeys.splice(i,0,key);adds.push([lastKey,i]);}else if(prevIndex!==i){let keyInSpot=prevKeys.splice(i,1)[0];let keyForSpot=prevKeys.splice(prevIndex-1,1)[0];prevKeys.splice(i,0,keyForSpot);prevKeys.splice(prevIndex,0,keyInSpot);moves.push([keyInSpot,keyForSpot]);}else{sames.push(key);}
|
||||
lastKey=key;}
|
||||
for(let i=0;i<removes.length;i++){let key=removes[i];lookup[key].remove();lookup[key]=null;delete lookup[key];}
|
||||
for(let i=0;i<moves.length;i++){let[keyInSpot,keyForSpot]=moves[i];let elInSpot=lookup[keyInSpot];let elForSpot=lookup[keyForSpot];let marker=document.createElement("div");mutateDom(()=>{elForSpot.after(marker);elInSpot.after(elForSpot);marker.before(elInSpot);marker.remove();});refreshScope(elForSpot,scopes[keys.indexOf(keyForSpot)]);}
|
||||
for(let i=0;i<adds.length;i++){let[lastKey2,index]=adds[i];let lastEl=lastKey2==="template"?templateEl:lookup[lastKey2];let scope=scopes[index];let key=keys[index];let clone2=document.importNode(templateEl.content,true).firstElementChild;addScopeToNode(clone2,reactive(scope),templateEl);mutateDom(()=>{lastEl.after(clone2);initTree(clone2);});if(typeof key==="object"){warn("x-for key cannot be an object, it must be a string or an integer",templateEl);}
|
||||
lookup[key]=clone2;}
|
||||
for(let i=0;i<sames.length;i++){refreshScope(lookup[sames[i]],scopes[keys.indexOf(sames[i])]);}
|
||||
templateEl._x_prevKeys=keys;});}
|
||||
function parseForExpression(expression){let forIteratorRE=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/;let stripParensRE=/^\s*\(|\)\s*$/g;let forAliasRE=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;let inMatch=expression.match(forAliasRE);if(!inMatch)
|
||||
return;let res={};res.items=inMatch[2].trim();let item=inMatch[1].replace(stripParensRE,"").trim();let iteratorMatch=item.match(forIteratorRE);if(iteratorMatch){res.item=item.replace(forIteratorRE,"").trim();res.index=iteratorMatch[1].trim();if(iteratorMatch[2]){res.collection=iteratorMatch[2].trim();}}else{res.item=item;}
|
||||
return res;}
|
||||
function getIterationScopeVariables(iteratorNames,item,index,items){let scopeVariables={};if(/^\[.*\]$/.test(iteratorNames.item)&&Array.isArray(item)){let names=iteratorNames.item.replace("[","").replace("]","").split(",").map((i)=>i.trim());names.forEach((name,i)=>{scopeVariables[name]=item[i];});}else if(/^\{.*\}$/.test(iteratorNames.item)&&!Array.isArray(item)&&typeof item==="object"){let names=iteratorNames.item.replace("{","").replace("}","").split(",").map((i)=>i.trim());names.forEach((name)=>{scopeVariables[name]=item[name];});}else{scopeVariables[iteratorNames.item]=item;}
|
||||
if(iteratorNames.index)
|
||||
scopeVariables[iteratorNames.index]=index;if(iteratorNames.collection)
|
||||
scopeVariables[iteratorNames.collection]=items;return scopeVariables;}
|
||||
function isNumeric3(subject){return!Array.isArray(subject)&&!isNaN(subject);}
|
||||
function handler2(){}
|
||||
handler2.inline=(el,{expression},{cleanup:cleanup2})=>{let root=closestRoot(el);if(!root._x_refs)
|
||||
root._x_refs={};root._x_refs[expression]=el;cleanup2(()=>delete root._x_refs[expression]);};directive("ref",handler2);directive("if",(el,{expression},{effect:effect3,cleanup:cleanup2})=>{let evaluate2=evaluateLater(el,expression);let show=()=>{if(el._x_currentIfEl)
|
||||
return el._x_currentIfEl;let clone2=el.content.cloneNode(true).firstElementChild;addScopeToNode(clone2,{},el);mutateDom(()=>{el.after(clone2);initTree(clone2);});el._x_currentIfEl=clone2;el._x_undoIf=()=>{clone2.remove();delete el._x_currentIfEl;};return clone2;};let hide=()=>{if(!el._x_undoIf)
|
||||
return;el._x_undoIf();delete el._x_undoIf;};effect3(()=>evaluate2((value)=>{value?show():hide();}));cleanup2(()=>el._x_undoIf&&el._x_undoIf());});mapAttributes(startingWith("@",into(prefix("on:"))));directive("on",skipDuringClone((el,{value,modifiers,expression},{cleanup:cleanup2})=>{let evaluate2=expression?evaluateLater(el,expression):()=>{};let removeListener=on(el,value,modifiers,(e)=>{evaluate2(()=>{},{scope:{$event:e},params:[e]});});cleanup2(()=>removeListener());}));alpine_default.setEvaluator(normalEvaluator);alpine_default.setReactivityEngine({reactive:reactive2,effect:effect2,release:stop,raw:toRaw});var src_default=alpine_default;window.Alpine=src_default;queueMicrotask(()=>{src_default.start();});})();window.ls.error=function(){return function(error){window.console.error(error);if(window.location.pathname!=='/console'){window.location='/console';}};};window.addEventListener("error",function(event){console.error("ERROR-EVENT:",event.error.message,event.error.stack);});document.addEventListener("account.deleteSession",function(){window.location="/auth/signin";});document.addEventListener("account.create",function(){let container=window.ls.container;let form=container.get('serviceForm');let sdk=container.get('console');let promise=sdk.account.createSession(form.email,form.password);container.set("serviceForm",{},true,true);promise.then(function(){var subscribe=document.getElementById('newsletter').checked;if(subscribe){let alerts=container.get('alerts');let loaderId=alerts.add({text:'Loading...',class:""},0);fetch('https://appwrite.io/v1/newsletter/subscribe',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({name:form.name,email:form.email,}),}).finally(function(){alerts.remove(loaderId);window.location='/console';});}else{window.location='/console';}},function(error){window.location='/auth/signup?failure=1';});});window.addEventListener("load",async()=>{const bars=12;const realtime=window.ls.container.get('realtime');const sleep=ms=>new Promise(resolve=>setTimeout(resolve,ms));let current={};window.ls.container.get('console').subscribe('project',event=>{for(let project in event.payload){current[project]=event.payload[project]??0;}});while(true){let newHistory={};let createdHistory=false;for(const project in current){let history=realtime?.history??{};if(!(project in history)){history[project]=new Array(bars).fill({percentage:0,value:0});}
|
||||
history=history[project];history.push({percentage:0,value:current[project]});if(history.length>=bars){history.shift();}
|
||||
const highest=history.reduce((prev,curr)=>{return(curr.value>prev)?curr.value:prev;},0);history=history.map(({percentage,value})=>{createdHistory=true;percentage=value===0?0:((Math.round((value/highest)*10)/10)*100);if(percentage>100)percentage=100;else if(percentage==0&&value!=0)percentage=5;return{percentage:percentage,value:value};})
|
||||
newHistory[project]=history;}
|
||||
let currentSnapshot={...current};for(let index=.1;index<=1;index+=.05){let currentTransition={...currentSnapshot};for(const project in current){if(project in newHistory){let base=newHistory[project][bars-2].value;let cur=currentSnapshot[project];let offset=(cur-base)*index;currentTransition[project]=base+Math.floor(offset);}}
|
||||
realtime.setCurrent(currentTransition);await sleep(250);}
|
||||
realtime.setHistory(newHistory);}});window.formValidation=(form,fields)=>{const elements=Array.from(form.querySelectorAll('[name]')).reduce((prev,curr)=>{if(!curr.name){return prev;}
|
||||
prev[curr.name]=curr;return prev;},{});const actionHandler=(action,attribute)=>{switch(action){case"disable":elements[attribute].setAttribute("disabled",true);elements[attribute].dispatchEvent(new Event('change'));break;case"enable":elements[attribute].removeAttribute("disabled");elements[attribute].dispatchEvent(new Event('change'));break;case"unvalue":elements[attribute].value="";break;case"check":elements[attribute].value="true";break;case"uncheck":elements[attribute].value="false";break;}};for(const field in fields){for(const attribute in fields[field]){const attr=fields[field][attribute];if(Array.isArray(attr)){attr.forEach(action=>{if(elements[field].value==="true"){actionHandler(action,attribute);}})}else{const condition=attr.if.some(c=>{return elements[c].value==="true";});if(condition){for(const thenAction in attr.then){attr.then[thenAction].forEach(action=>{actionHandler(action,thenAction);});}}else{for(const elseAction in attr.else){attr.else[elseAction].forEach(action=>{actionHandler(action,elseAction);});}}}}}
|
||||
form.addEventListener("reset",()=>{for(const key in fields){if(Object.hasOwnProperty.call(fields,key)){const element=elements[key];element.setAttribute("value","");element.removeAttribute("disabled");element.dispatchEvent(new Event("change"));}}});};(function(window){"use strict";window.ls.container.set('alerts',function(window){return{list:[],ids:0,counter:0,max:5,add:function(message,time){var scope=this;message.id=scope.ids++;message.remove=function(){scope.remove(message.id);};scope.counter++;scope.list.unshift(message);if(scope.counter>scope.max){scope.list.pop();scope.counter--;}
|
||||
if(time>0){window.setTimeout(function(message){return function(){scope.remove(message.id)}}(message),time);}
|
||||
return message.id;},remove:function(id){let scope=this;for(let index=0;index<scope.list.length;index++){let obj=scope.list[index];if(obj.id===parseInt(id)){scope.counter--;if(typeof obj.callback==="function"){obj.callback();}
|
||||
scope.list.splice(index,1);};}}};},true,true);})(window);(function(window){"use strict";window.ls.container.set('appwrite',function(window,env){let config={endpoint:'https://appwrite.io/v1',};let http=function(document,env){let globalParams=[],globalHeaders=[];let addParam=function(url,param,value){let a=document.createElement('a'),regex=/(?:\?|&|&)+([^=]+)(?:=([^&]*))*/g;let match,str=[];a.href=url;param=encodeURIComponent(param);while(match=regex.exec(a.search))if(param!==match[1])str.push(match[1]+(match[2]?"="+match[2]:""));str.push(param+(value?"="+encodeURIComponent(value):""));a.search=str.join("&");return a.href;};let buildQuery=function(params){let str=[];for(let p in params){if(params.hasOwnProperty(p)){str.push(encodeURIComponent(p)+"="+encodeURIComponent(params[p]));}}
|
||||
return str.join("&");};let addGlobalHeader=function(key,value){globalHeaders[key]={key:key.toLowerCase(),value:value.toLowerCase()};};let addGlobalParam=function(key,value){globalParams.push({key:key,value:value});};addGlobalHeader('content-type','');let call=function(method,path,headers={},params={},progress=null){let i;path=config.endpoint+path;if(-1===['GET','POST','PUT','DELETE','TRACE','HEAD','OPTIONS','CONNECT','PATCH'].indexOf(method)){throw new Error('var method must contain a valid HTTP method name');}
|
||||
if(typeof path!=='string'){throw new Error('var path must be of type string');}
|
||||
if(typeof headers!=='object'){throw new Error('var headers must be of type object');}
|
||||
for(i=0;i<globalParams.length;i++){path=addParam(path,globalParams[i].key,globalParams[i].value);}
|
||||
for(let key in globalHeaders){if(globalHeaders.hasOwnProperty(key)){if(!headers[globalHeaders[key].key]){headers[globalHeaders[key].key]=globalHeaders[key].value;}}}
|
||||
if(method==='GET'){for(let param in params){if(param.hasOwnProperty(key)){path=addParam(path,key,params[key]);}}}
|
||||
switch(headers['content-type']){case'application/json':params=JSON.stringify(params);break;case'multipart/form-data':let formData=new FormData();for(let param in params){if(param.hasOwnProperty(key)){formData.append(key,param[key]);}}
|
||||
params=formData;break;}
|
||||
return new Promise(function(resolve,reject){let request=new XMLHttpRequest(),key;request.withCredentials=true;request.open(method,path,true);for(key in headers){if(headers.hasOwnProperty(key)){request.setRequestHeader(key,headers[key]);}}
|
||||
request.onload=function(){if(4===request.readyState&&399>=request.status){let data=request.response;let contentType=this.getResponseHeader('content-type');contentType=contentType.substring(0,contentType.indexOf(';'));switch(contentType){case'application/json':data=JSON.parse(data);break;}
|
||||
resolve(data);}else{reject(new Error(request.statusText));}};if(progress){request.addEventListener('progress',progress);request.upload.addEventListener('progress',progress,false);}
|
||||
request.onerror=function(){reject(new Error("Network Error"));};request.send(params);})};return{'get':function(path,headers={},params={}){return call('GET',path+((params.length>0)?'?'+buildQuery(params):''),headers,{});},'post':function(path,headers={},params={},progress=null){return call('POST',path,headers,params,progress);},'put':function(path,headers={},params={},progress=null){return call('PUT',headers,params,progress);},'patch':function(path,headers={},params={},progress=null){return call('PATCH',path,headers,params,progress);},'delete':function(path,headers={},params={},progress=null){return call('DELETE',path,headers,params,progress);},'addGlobalParam':addGlobalParam,'addGlobalHeader':addGlobalHeader}}(window.document);let analytics={create:function(id,source,activity,url){return http.post('/analytics',{'content-type':'application/json'},{id:id,source:source,activity:activity,url:url,version:env.VERSION,setup:env.SETUP});},};return{analytics:analytics,};},true);})(window);(function(window){"use strict";window.ls.container.set('console',function(window){var sdk=new window.Appwrite();var endpoint=window.location.origin+'/v1';sdk.setEndpoint(endpoint).setProject('console').setLocale(APP_ENV.LOCALE);return sdk;},true);})(window);(function(window){"use strict";window.ls.container.set('date',function(){function format(format,timestamp){var jsdate,f
|
||||
var txtWords=['Sun','Mon','Tues','Wednes','Thurs','Fri','Satur','January','February','March','April','May','June','July','August','September','October','November','December']
|
||||
var formatChr=/\\?(.?)/gi
|
||||
var formatChrCb=function(t,s){return f[t]?f[t]():s}
|
||||
var _pad=function(n,c){n=String(n)
|
||||
while(n.length<c){n='0'+n}
|
||||
return n}
|
||||
f={d:function(){return _pad(f.j(),2)},D:function(){return f.l().slice(0,3)},j:function(){return jsdate.getDate()},l:function(){return txtWords[f.w()]+'day'},N:function(){return f.w()||7},S:function(){var j=f.j()
|
||||
var i=j%10
|
||||
if(i<=3&&parseInt((j%100)/10,10)===1){i=0}
|
||||
return['st','nd','rd'][i-1]||'th'},w:function(){return jsdate.getDay()},z:function(){var a=new Date(f.Y(),f.n()-1,f.j())
|
||||
var b=new Date(f.Y(),0,1)
|
||||
return Math.round((a-b)/864e5)},W:function(){var a=new Date(f.Y(),f.n()-1,f.j()-f.N()+3)
|
||||
var b=new Date(a.getFullYear(),0,4)
|
||||
return _pad(1+Math.round((a-b)/864e5/7),2)},F:function(){return txtWords[6+f.n()]},m:function(){return _pad(f.n(),2)},M:function(){return f.F().slice(0,3)},n:function(){return jsdate.getMonth()+1},t:function(){return(new Date(f.Y(),f.n(),0)).getDate()},L:function(){var j=f.Y()
|
||||
return j%4===0&j%100!==0|j%400===0},o:function(){var n=f.n()
|
||||
var W=f.W()
|
||||
var Y=f.Y()
|
||||
return Y+(n===12&&W<9?1:n===1&&W>9?-1:0)},Y:function(){return jsdate.getFullYear()},y:function(){return f.Y().toString().slice(-2)},a:function(){return jsdate.getHours()>11?'pm':'am'},A:function(){return f.a().toUpperCase()},B:function(){var H=jsdate.getUTCHours()*36e2
|
||||
var i=jsdate.getUTCMinutes()*60
|
||||
var s=jsdate.getUTCSeconds()
|
||||
return _pad(Math.floor((H+i+s+36e2)/86.4)%1e3,3)},g:function(){return f.G()%12||12},G:function(){return jsdate.getHours()},h:function(){return _pad(f.g(),2)},H:function(){return _pad(f.G(),2)},i:function(){return _pad(jsdate.getMinutes(),2)},s:function(){return _pad(jsdate.getSeconds(),2)},u:function(){return _pad(jsdate.getMilliseconds()*1000,6)},e:function(){var msg='Not supported (see source code of date() for timezone on how to add support)'
|
||||
throw new Error(msg)},I:function(){var a=new Date(f.Y(),0)
|
||||
var c=Date.UTC(f.Y(),0)
|
||||
var b=new Date(f.Y(),6)
|
||||
var d=Date.UTC(f.Y(),6)
|
||||
return((a-c)!==(b-d))?1:0},O:function(){var tzo=jsdate.getTimezoneOffset()
|
||||
var a=Math.abs(tzo)
|
||||
return(tzo>0?'-':'+')+_pad(Math.floor(a/60)*100+a%60,4)},P:function(){var O=f.O()
|
||||
return(O.substr(0,3)+':'+O.substr(3,2))},T:function(){return'UTC'},Z:function(){return-jsdate.getTimezoneOffset()*60},c:function(){return'Y-m-d\\TH:i:sP'.replace(formatChr,formatChrCb)},r:function(){return'D, d M Y H:i:s O'.replace(formatChr,formatChrCb)},U:function(){return jsdate/1000|0}}
|
||||
var _date=function(format,timestamp){jsdate=(timestamp===undefined?new Date():(timestamp instanceof Date)?new Date(timestamp):new Date(timestamp*1000))
|
||||
return format.replace(formatChr,formatChrCb)}
|
||||
return _date(format,timestamp)}
|
||||
function strtotime(text,now){var parsed
|
||||
var match
|
||||
var today
|
||||
var year
|
||||
var date
|
||||
var days
|
||||
var ranges
|
||||
var len
|
||||
var times
|
||||
var regex
|
||||
var i
|
||||
var fail=false
|
||||
if(!text){return fail}
|
||||
text=text.replace(/^\s+|\s+$/g,'').replace(/\s{2,}/g,' ').replace(/[\t\r\n]/g,'').toLowerCase()
|
||||
var pattern=new RegExp(['^(\\d{1,4})','([\\-\\.\\/:])','(\\d{1,2})','([\\-\\.\\/:])','(\\d{1,4})','(?:\\s(\\d{1,2}):(\\d{2})?:?(\\d{2})?)?','(?:\\s([A-Z]+)?)?$'].join(''))
|
||||
match=text.match(pattern)
|
||||
if(match&&match[2]===match[4]){if(match[1]>1901){switch(match[2]){case'-':if(match[3]>12||match[5]>31){return fail}
|
||||
return new Date(match[1],parseInt(match[3],10)-1,match[5],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1000
|
||||
case'.':return fail
|
||||
case'/':if(match[3]>12||match[5]>31){return fail}
|
||||
return new Date(match[1],parseInt(match[3],10)-1,match[5],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1000}}else if(match[5]>1901){switch(match[2]){case'-':if(match[3]>12||match[1]>31){return fail}
|
||||
return new Date(match[5],parseInt(match[3],10)-1,match[1],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1000
|
||||
case'.':if(match[3]>12||match[1]>31){return fail}
|
||||
return new Date(match[5],parseInt(match[3],10)-1,match[1],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1000
|
||||
case'/':if(match[1]>12||match[3]>31){return fail}
|
||||
return new Date(match[5],parseInt(match[1],10)-1,match[3],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1000}}else{switch(match[2]){case'-':if(match[3]>12||match[5]>31||(match[1]<70&&match[1]>38)){return fail}
|
||||
year=match[1]>=0&&match[1]<=38?+match[1]+2000:match[1]
|
||||
return new Date(year,parseInt(match[3],10)-1,match[5],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1000
|
||||
case'.':if(match[5]>=70){if(match[3]>12||match[1]>31){return fail}
|
||||
return new Date(match[5],parseInt(match[3],10)-1,match[1],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1000}
|
||||
if(match[5]<60&&!match[6]){if(match[1]>23||match[3]>59){return fail}
|
||||
today=new Date()
|
||||
return new Date(today.getFullYear(),today.getMonth(),today.getDate(),match[1]||0,match[3]||0,match[5]||0,match[9]||0)/1000}
|
||||
return fail
|
||||
case'/':if(match[1]>12||match[3]>31||(match[5]<70&&match[5]>38)){return fail}
|
||||
year=match[5]>=0&&match[5]<=38?+match[5]+2000:match[5]
|
||||
return new Date(year,parseInt(match[1],10)-1,match[3],match[6]||0,match[7]||0,match[8]||0,match[9]||0)/1000
|
||||
case':':if(match[1]>23||match[3]>59||match[5]>59){return fail}
|
||||
today=new Date()
|
||||
return new Date(today.getFullYear(),today.getMonth(),today.getDate(),match[1]||0,match[3]||0,match[5]||0)/1000}}}
|
||||
if(text==='now'){return now===null||isNaN(now)?new Date().getTime()/1000|0:now|0}
|
||||
if(!isNaN(parsed=Date.parse(text))){return parsed/1000|0}
|
||||
pattern=new RegExp(['^([0-9]{4}-[0-9]{2}-[0-9]{2})','[ t]','([0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?)','([\\+-][0-9]{2}(:[0-9]{2})?|z)'].join(''))
|
||||
match=text.match(pattern)
|
||||
if(match){if(match[4]==='z'){match[4]='Z'}else if(match[4].match(/^([+-][0-9]{2})$/)){match[4]=match[4]+':00'}
|
||||
if(!isNaN(parsed=Date.parse(match[1]+'T'+match[2]+match[4]))){return parsed/1000|0}}
|
||||
date=now?new Date(now*1000):new Date()
|
||||
days={'sun':0,'mon':1,'tue':2,'wed':3,'thu':4,'fri':5,'sat':6}
|
||||
ranges={'yea':'FullYear','mon':'Month','day':'Date','hou':'Hours','min':'Minutes','sec':'Seconds'}
|
||||
function lastNext(type,range,modifier){var diff
|
||||
var day=days[range]
|
||||
if(typeof day!=='undefined'){diff=day-date.getDay()
|
||||
if(diff===0){diff=7*modifier}else if(diff>0&&type==='last'){diff-=7}else if(diff<0&&type==='next'){diff+=7}
|
||||
date.setDate(date.getDate()+diff)}}
|
||||
function process(val){var splt=val.split(' ')
|
||||
var type=splt[0]
|
||||
var range=splt[1].substring(0,3)
|
||||
var typeIsNumber=/\d+/.test(type)
|
||||
var ago=splt[2]==='ago'
|
||||
var num=(type==='last'?-1:1)*(ago?-1:1)
|
||||
if(typeIsNumber){num*=parseInt(type,10)}
|
||||
if(ranges.hasOwnProperty(range)&&!splt[1].match(/^mon(day|\.)?$/i)){return date['set'+ranges[range]](date['get'+ranges[range]]()+num)}
|
||||
if(range==='wee'){return date.setDate(date.getDate()+(num*7))}
|
||||
if(type==='next'||type==='last'){lastNext(type,range,num)}else if(!typeIsNumber){return false}
|
||||
return true}
|
||||
times='(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec'+'|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?'+'|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)'
|
||||
regex='([+-]?\\d+\\s'+times+'|'+'(last|next)\\s'+times+')(\\sago)?'
|
||||
match=text.match(new RegExp(regex,'gi'))
|
||||
if(!match){return fail}
|
||||
for(i=0,len=match.length;i<len;i++){if(!process(match[i])){return fail}}
|
||||
return(date.getTime()/1000)}
|
||||
return{format:format,strtotime:strtotime}}(),true);})(window);(function(window){"use strict";window.ls.container.set('env',function(){return APP_ENV;},true);})(window);(function(window){"use strict";window.ls.container.set('form',function(){function cast(value,to){if(value&&Array.isArray(value)&&to!=='array'){value=value.map(element=>cast(element,to));return value;}
|
||||
switch(to){case'int':case'integer':value=parseInt(value);break;case'float':value=parseFloat(parseFloat(value).toFixed(2));break;case'numeric':value=Number(value);break;case'float':value=parseFloat(value);break;case'string':value=value.toString();if(value.length===0){value=null;}
|
||||
break;case'json':value=(value)?JSON.parse(value):[];break;case'array':value=(value&&value.constructor&&value.constructor===Array)?value:[value];break;case'array-empty':value=[];break;case'bool':case'boolean':value=(value==='false')?false:value;value=!!value;break;}
|
||||
return value;}
|
||||
function toJson(element,json){json=json||{};let name=element.getAttribute('name');let type=element.getAttribute('type');let castTo=element.getAttribute('data-cast-to');let ref=json;if(name&&'FORM'!==element.tagName){if(name.startsWith('[')){let splitName=name.split('.');if(splitName.length>1&&splitName[0].endsWith(']')){name=splitName[splitName.length-1];}}
|
||||
if('FIELDSET'===element.tagName){if(castTo==='object'){if(json[name]===undefined){json[name]={};}
|
||||
ref=json[name];}
|
||||
else{if(!Array.isArray(json[name])){json[name]=[];}
|
||||
json[name].push({});ref=json[name][json[name].length-1];}}
|
||||
else if(undefined!==element.value){if('SELECT'===element.tagName&&element.children>0){json[name]=element.children[element.selectedIndex].value;}
|
||||
else if('radio'===type){if(element.checked){json[name]=element.value;}}
|
||||
else if('checkbox'===type){if(Array.isArray(json[name])){json[name].push(element.checked);}else{json[name]=element.checked;}}
|
||||
else if('file'===type){json[name]=element.files[0];}
|
||||
else if(undefined!==element.value){if((json[name]!==undefined)&&(!Array.isArray(json[name]))){json[name]=[json[name]];}
|
||||
if(Array.isArray(json[name])){json[name].push(element.value);}
|
||||
else{json[name]=element.value;}}
|
||||
json[name]=cast(json[name],castTo);}}
|
||||
for(let i=0;i<element.children.length;i++){if(Array.isArray(ref)){ref.push({});toJson(element.children[i],ref[ref.length]);}
|
||||
else{toJson(element.children[i],ref);}}
|
||||
return json;}
|
||||
return{'toJson':toJson}},true,false);})(window);(function(window){"use strict";window.ls.container.set('markdown',function(window){var md=window.markdownit();function renderEm(tokens,idx,opts,_,slf){var token=tokens[idx];if(token.markup==='__'){token.tag='u';}
|
||||
return slf.renderToken(tokens,idx,opts);}
|
||||
md.renderer.rules.strong_open=renderEm;md.renderer.rules.strong_close=renderEm;return md;},true);})(window);(function(window){"use strict";window.ls.container.set('rtl',function(){var rtlStock="^ا^ب^ت^ث^ج^ح^خ^د^ذ^ر^ز^س^ش^ص^ض^ط^ظ^ع^غ^ف^ق^ك^ل^م^ن^ه^و^ي^א^ב^ג^ד^ה^ו^ז^ח^ט^י^כ^ך^ל^מ^ם^נ^ן^ס^ע^פ^ף^צ^ץ^ק^ר^ש^ת^";var special=["\n"," "," ","״",'"',"_","'","!","@","#","$","^","&","%","*","(",")","+","=","-","[","]","\\","/","{","}","|",":","<",">","?",",",".","0","1","2","3","4","5","6","7","8","9"];var isRTL=function(value){for(var i=0;i<value.length;i++){if(/\s/g.test(value[i])){continue;}
|
||||
if(-1===special.indexOf(value[i])){var firstChar=value[i];break;}}
|
||||
if(-1<rtlStock.indexOf("^"+firstChar+"^")){return true;}
|
||||
return false;};return{isRTL:isRTL,};},true);})(window);(function(window){"use strict";window.ls.container.set('sdk',function(window,router){var sdk=new window.Appwrite();var endpoint=window.location.origin+'/v1';sdk.setEndpoint(endpoint).setProject(router.params.project||'').setLocale(APP_ENV.LOCALE).setMode('admin');return sdk;},false);})(window);(function(window){"use strict";window.ls.container.set('search',function(window){return{params:{},path:'',pointer:'',selected:'',};},true,true);})(window);(function(window){"use strict";window.ls.container.set('timezone',function(){return{convert:function(unixTime){var timezoneMinutes=new Date().getTimezoneOffset();timezoneMinutes=(timezoneMinutes===0)?0:-timezoneMinutes;return parseInt(unixTime)+(timezoneMinutes*60);}};},true);})(window);(function(window){"use strict";window.ls.container.set('realtime',()=>{return{current:null,history:null,setCurrent:function(currentConnections){var scope=this;scope.current=currentConnections;return scope.current;},setHistory:function(history){var scope=this;scope.history=history;return scope.history;}};},true,true);})(window);window.ls.router.add("/auth/signin",{template:"/auth/signin?version="+APP_ENV.CACHEBUSTER,scope:"home"}).add("/auth/signup",{template:"/auth/signup?version="+APP_ENV.CACHEBUSTER,scope:"home"}).add("/auth/recovery",{template:"/auth/recovery?version="+APP_ENV.CACHEBUSTER,scope:"home"}).add("/auth/recovery/reset",{template:"/auth/recovery/reset?version="+APP_ENV.CACHEBUSTER,scope:"home"}).add("/auth/confirm",{template:"/auth/confirm?version="+APP_ENV.CACHEBUSTER,scope:"home"}).add("/auth/join",{template:"/auth/join?version="+APP_ENV.CACHEBUSTER,scope:"home"}).add("/auth/magic-url",{template:"/auth/magic-url?version="+APP_ENV.CACHEBUSTER,scope:"home"}).add("/auth/oauth2/success",{template:"/auth/oauth2/success?version="+APP_ENV.CACHEBUSTER,scope:"home"}).add("/auth/oauth2/failure",{template:"/auth/oauth2/failure?version="+APP_ENV.CACHEBUSTER,scope:"home"}).add("/console",{template:"/console?version="+APP_ENV.CACHEBUSTER,scope:"console"}).add("/console/account",{template:"/console/account?version="+APP_ENV.CACHEBUSTER,scope:"console"}).add("/console/account/:tab",{template:"/console/account?version="+APP_ENV.CACHEBUSTER,scope:"console"}).add("/console/home",{template:"/console/home?version="+APP_ENV.CACHEBUSTER,scope:"console",project:true}).add("/console/home/:tab",{template:"/console/home?version="+APP_ENV.CACHEBUSTER,scope:"console",project:true}).add("/console/platforms/:platform",{template:function(window){return window.location.pathname+"?version="+APP_ENV.CACHEBUSTER;},scope:"console",project:true}).add("/console/notifications",{template:"/console/notifications?version="+APP_ENV.CACHEBUSTER,scope:"console"}).add("/console/settings",{template:"/console/settings?version="+APP_ENV.CACHEBUSTER,scope:"console",project:true}).add("/console/settings/:tab",{template:"/console/settings?version="+APP_ENV.CACHEBUSTER,scope:"console",project:true}).add("/console/webhooks",{template:"/console/webhooks?version="+APP_ENV.CACHEBUSTER,scope:"console",project:true}).add("/console/webhooks/:tab",{template:"/console/webhooks?version="+APP_ENV.CACHEBUSTER,scope:"console",project:true}).add("/console/keys",{template:"/console/keys?version="+APP_ENV.CACHEBUSTER,scope:"console",project:true}).add("/console/keys/:tab",{template:"/console/keys?version="+APP_ENV.CACHEBUSTER,scope:"console",project:true}).add("/console/tasks",{template:"/console/tasks?version="+APP_ENV.CACHEBUSTER,scope:"console",project:true}).add("/console/tasks/:tab",{template:"/console/tasks?version="+APP_ENV.CACHEBUSTER,scope:"console",project:true}).add("/console/database",{template:"/console/database?version="+APP_ENV.CACHEBUSTER,scope:"console",project:true}).add("/console/database/usage",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.CACHEBUSTER;},scope:"console",project:true}).add("/console/database/collection",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.CACHEBUSTER;},scope:"console",project:true}).add("/console/database/collection/:tab",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.CACHEBUSTER;},scope:"console",project:true}).add("/console/database/document",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.CACHEBUSTER;},scope:"console",project:true}).add("/console/database/document/:tab",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.CACHEBUSTER;},scope:"console",project:true}).add("/console/storage",{template:"/console/storage?version="+APP_ENV.CACHEBUSTER,scope:"console",project:true}).add("/console/storage/usage",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.CACHEBUSTER;},scope:"console",project:true}).add("/console/storage/Line truncated
|
||||
let size=element.dataset["size"]||80;let name=$value.name||$value||"";name=(typeof name!=='string')?'--':name;return def="/v1/avatars/initials?project=console"+"&name="+
|
||||
encodeURIComponent(name)+"&width="+
|
||||
size+"&height="+
|
||||
size;}).add("selectedCollection",function($value,router){return $value===router.params.collectionId?"selected":"";}).add("selectedDocument",function($value,router){return $value===router.params.documentId?"selected":"";}).add("localeString",function($value){$value=parseInt($value);return!Number.isNaN($value)?$value.toLocaleString():"";}).add("date",function($value,date){return date.format("Y-m-d",$value);}).add("dateTime",function($value,date){return date.format("Y-m-d H:i",$value);}).add("dateText",function($value,date){return date.format("d M Y",$value);}).add("timeSince",function($value){$value=$value*1000;let seconds=Math.floor((Date.now()-$value)/1000);let unit="second";let direction="ago";if(seconds<0){seconds=-seconds;direction="from now";}
|
||||
let value=seconds;if(seconds>=31536000){value=Math.floor(seconds/31536000);unit="year";}
|
||||
else if(seconds>=86400){value=Math.floor(seconds/86400);unit="day";}
|
||||
else if(seconds>=3600){value=Math.floor(seconds/3600);unit="hour";}
|
||||
else if(seconds>=60){value=Math.floor(seconds/60);unit="minute";}
|
||||
if(value!=1){unit=unit+"s";}
|
||||
return value+" "+unit+" "+direction;}).add("ms2hum",function($value){let temp=$value;const years=Math.floor(temp/31536000),days=Math.floor((temp%=31536000)/86400),hours=Math.floor((temp%=86400)/3600),minutes=Math.floor((temp%=3600)/60),seconds=temp%60;if(days||hours||seconds||minutes){return((years?years+"y ":"")+
|
||||
(days?days+"d ":"")+
|
||||
(hours?hours+"h ":"")+
|
||||
(minutes?minutes+"m ":"")+
|
||||
Number.parseFloat(seconds).toFixed(0)+"s");}
|
||||
return"< 1s";}).add("seconds2hum",function($value){var seconds=($value).toFixed(3);var minutes=($value/(60)).toFixed(1);var hours=($value/(60*60)).toFixed(1);var days=($value/(60*60*24)).toFixed(1);if(seconds<60){return seconds+"s";}else if(minutes<60){return minutes+"m";}else if(hours<24){return hours+"h";}else{return days+"d"}}).add("markdown",function($value,markdown){return markdown.render($value);}).add("pageCurrent",function($value,env){return Math.ceil(parseInt($value||0)/env.PAGING_LIMIT)+1;}).add("pageTotal",function($value,env){let total=Math.ceil(parseInt($value||0)/env.PAGING_LIMIT);return total?total:1;}).add("humanFileSize",function($value){if(!$value){return 0;}
|
||||
let thresh=1000;if(Math.abs($value)<thresh){return $value;}
|
||||
let units=["kB","MB","GB","TB","PB","EB","ZB","YB"];let u=-1;do{$value/=thresh;++u;}while(Math.abs($value)>=thresh&&u<units.length-1);return $value.toFixed(1);}).add("humanFileUnit",function($value){if(!$value){return'';}
|
||||
let thresh=1000;if(Math.abs($value)<thresh){return'B';}
|
||||
let units=["kB","MB","GB","TB","PB","EB","ZB","YB"];let u=-1;do{$value/=thresh;++u;}while(Math.abs($value)>=thresh&&u<units.length-1);return units[u];}).add("statsTotal",function($value){if(!$value){return 0;}
|
||||
$value=abbreviate($value,0,false,false);return $value??"N/A";}).add("statsGetLast",function($value){if(!$value||$value.length<1){return 0;}
|
||||
return $value[$value.length-1].value;}).add("isEmpty",function($value){return(!!$value);}).add("isEmptyObject",function($value){return((Object.keys($value).length===0&&$value.constructor===Object)||$value.length===0)}).add("activeDomainsCount",function($value){let result=[];if(Array.isArray($value)){result=$value.filter(function(node){return(node.verification&&node.certificateId);});}
|
||||
return result.length;}).add("documentAction",function(container){let collection=container.get('project-collection');let document=container.get('project-document');if(collection&&document&&!document.$id){return'database.createDocument';}
|
||||
return'database.updateDocument';}).add("documentSuccess",function(container){let document=container.get('project-document');if(document&&!document.$id){return',redirect';}
|
||||
return'';}).add("firstElement",function($value){if($value&&$value[0]){return $value[0];}
|
||||
return $value;}).add("platformsLimit",function($value){return $value;}).add("limit",function($value){let postfix=($value.length>=50)?'...':'';return $value.substring(0,50)+postfix;;}).add("arraySentence",function($value){if(!Array.isArray($value)){return'';}
|
||||
return $value.join(", ").replace(/,\s([^,]+)$/,' and $1');}).add("runtimeName",function($value,env){if(env&&env.RUNTIMES&&env.RUNTIMES[$value]){return env.RUNTIMES[$value].name;}
|
||||
return'';}).add("runtimeLogo",function($value,env){if(env&&env.RUNTIMES&&env.RUNTIMES[$value]){return env.RUNTIMES[$value].logo;}
|
||||
return'';}).add("runtimeVersion",function($value,env){if(env&&env.RUNTIMES&&env.RUNTIMES[$value]){return env.RUNTIMES[$value].version;}
|
||||
return'';}).add("indexAttributes",function($value){let output='';for(let i=0;i<$value.attributes.length;i++){output+=$value.attributes[i]+' ('+$value.orders[i]+'), '}
|
||||
return output.slice(0,-2);}).add("collectionAttributes",function($value){if(!Array.isArray($value)){return[];}
|
||||
$value.unshift({$id:'$id'});return $value;}).add("documentAttribute",function($value,attribute){if(attribute.key in $value){return $value[attribute.key];}
|
||||
return null;}).add("accessProject",function($value,router){return($value&&$value.hasOwnProperty(router.params.project))?$value[router.params.project]:0;}).add("first",function($value){return $value[0].$id;}).add("last",function($value){return $value[$value.length-1].$id;});function abbreviate(number,maxPlaces,forcePlaces,forceLetter){number=Number(number);forceLetter=forceLetter||false;if(forceLetter!==false){return annotate(number,maxPlaces,forcePlaces,forceLetter);}
|
||||
let abbr;if(number>=1e12){abbr="T";}else if(number>=1e9){abbr="B";}else if(number>=1e6){abbr="M";}else if(number>=1e3){abbr="K";}else{abbr="";}
|
||||
return annotate(number,maxPlaces,forcePlaces,abbr);}
|
||||
function annotate(number,maxPlaces,forcePlaces,abbr){let rounded=0;switch(abbr){case"T":rounded=number/1e12;break;case"B":rounded=number/1e9;break;case"M":rounded=number/1e6;break;case"K":rounded=number/1e3;break;case"":rounded=number;break;}
|
||||
if(maxPlaces!==false){let test=new RegExp("\\.\\d{"+(maxPlaces+1)+",}$");if(test.test(""+rounded)){rounded=rounded.toFixed(maxPlaces);}}
|
||||
if(forcePlaces!==false){rounded=Number(rounded).toFixed(forcePlaces);}
|
||||
return rounded+abbr;}
|
||||
window.ls.container.get("view").add({selector:"data-acl",controller:function(element,document,router,alerts){document.body.classList.remove("console");document.body.classList.remove("home");document.body.classList.add(router.getCurrent().view.scope);if(!router.getCurrent().view.project){document.body.classList.add("hide-nav");document.body.classList.remove("show-nav");}else{document.body.classList.add("show-nav");document.body.classList.remove("hide-nav");}
|
||||
if("/console"===router.getCurrent().path){document.body.classList.add("index");}else{document.body.classList.remove("index");}}}).add({selector:"data-prism",controller:function(window,document,element,alerts){Prism.highlightElement(element);let copy=document.createElement("i");copy.className="icon-docs copy";copy.title="Copy to Clipboard";copy.textContent="Click Here to Copy";copy.addEventListener("click",function(){window.getSelection().removeAllRanges();let range=document.createRange();range.selectNode(element);window.getSelection().addRange(range);try{document.execCommand("copy");alerts.add({text:"Copied to clipboard",class:""},3000);}catch(err){alerts.add({text:"Failed to copy text ",class:"error"},3000);}
|
||||
window.getSelection().removeAllRanges();});element.parentNode.parentNode.appendChild(copy);}});(function(window){"use strict";window.ls.view.add({selector:"data-service",controller:function(element,view,container,form,alerts,expression,window){let action=element.dataset["service"];let service=element.dataset["name"]||null;let event=expression.parse(element.dataset["event"]);let confirm=element.dataset["confirm"]||"";let loading=element.dataset["loading"]||"";let loaderId=null;let scope=element.dataset["scope"]||"sdk";let success=element.dataset["success"]||"";let failure=element.dataset["failure"]||"";let running=false;let callbacks={hide:function(){return function(){return element.style.opacity='0';};},reset:function(){return function(){if("FORM"===element.tagName){return element.reset();}
|
||||
throw new Error("This callback is only valid for forms");};},alert:function(text,classname){return function(alerts){alerts.add({text:text,class:classname||"success"},3000);};},redirect:function(url){return function(router){window.location=url||"/";};},reload:function(){return function(router){router.reload();};},state:function(keys){let updateQueryString=function(key,value,url){var re=new RegExp("([?&])"+key+"=.*?(&|#|$)(.*)","gi"),hash;if(re.test(url)){if(typeof value!=="undefined"&&value!==null){return url.replace(re,"$1"+key+"="+value+"$2$3");}else{hash=url.split("#");url=hash[0].replace(re,"$1$3").replace(/(&|\?)$/,"");if(typeof hash[1]!=="undefined"&&hash[1]!==null){url+="#"+hash[1];}
|
||||
return url;}}else{if(typeof value!=="undefined"&&value!==null){var separator=url.indexOf("?")!==-1?"&":"?";hash=url.split("#");url=hash[0]+separator+key+"="+value;if(typeof hash[1]!=="undefined"&&hash[1]!==null){url+="#"+hash[1];}
|
||||
return url;}else{return url;}}};keys=keys.split(",").map(element=>element.trim());return function(serviceForm,router,window){let url=window.location.href;keys.map(node=>{node=node.split("=");let key=node[0]||"";let name=node[1]||key;let value=getValue(key,"param",serviceForm);url=updateQueryString(name,value?value:null,url);});if(url!==window.location.href){window.history.pushState({},"",url);router.reset();}};},trigger:function(events){return function(document){events=events.trim().split(",");for(let i=0;i<events.length;i++){if(""===events[i]){continue;}
|
||||
document.dispatchEvent(new CustomEvent(events[i]));}};},setId:function name(params){},default:function(){let collection=container.get('project-collection');let document=container.get('project-document');if(collection&&document&&collection.$id===document.$id){for(const[key,value]of Object.entries(document)){delete document[key];}
|
||||
if(collection.rules){for(let index=0;index<collection.rules.length;index++){const element=collection.rules[index];switch(element.type){case'text':case'email':case'url':case'ip':document[element.key]=element.default||'';break;case'numeric':document[element.key]=element.default||'0';break;case'boolean':document[element.key]=element.default||false;break;case'document':document[element.key]=element.default||{'$id':'','$collection':'','$permissions':{}};break;default:document[element.key]=null;break;}
|
||||
if(element.array){document[element.key]=[];}}}}}};let getParams=function getParams(func){const REGEX_COMMENTS=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;const REGEX_FUNCTION_PARAMS=/(?:\s*(?:function\s*[^(]*)?\s*)((?:[^'"]|(?:(?:(['"])(?:(?:.*?[^\\]\2)|\2))))*?)\s*(?=(?:=>)|{)/m;const REGEX_PARAMETERS_VALUES=/\s*([\w\\$]+)\s*(?:=\s*((?:(?:(['"])(?:\3|(?:.*?[^\\]\3)))((\s*\+\s*)(?:(?:(['"])(?:\6|(?:.*?[^\\]\6)))|(?:[\w$]*)))*)|.*?))?\s*(?:,|$)/gm;let functionAsString=func.toString();let params=[];let match;functionAsString=functionAsString.replaceAll('={}',"");functionAsString=functionAsString.replaceAll('=[]',"");functionAsString=functionAsString.replace(REGEX_COMMENTS,"");functionAsString=functionAsString.match(REGEX_FUNCTION_PARAMS)[1];if(functionAsString.charAt(0)==="("){functionAsString=functionAsString.slice(1,-1);}
|
||||
while((match=REGEX_PARAMETERS_VALUES.exec(functionAsString))){params.push(match[1]);}
|
||||
return params;};let getValue=function(key,prefix,data){let result=null;if(!key){return null;}
|
||||
let attrKey=prefix+key.charAt(0).toUpperCase()+key.slice(1);if(element.dataset[attrKey]){result=expression.parse(element.dataset[attrKey]);if(element.dataset[attrKey+"CastTo"]==="array"){result=result.split(",");}}
|
||||
if(typeof data[key]!=='undefined'){result=data[key];}
|
||||
if(typeof result==='undefined'){result="";}
|
||||
return result;};let resolve=function(target,prefix="param",data={}){if(!target){return function(){};}
|
||||
let args=getParams(target);return target.apply(target,args.map(function(value){let result=getValue(value,prefix,data);return result??undefined;}));};let exec=function(event){let parsedSuccess=expression.parse(success);let parsedFailure=expression.parse(failure);let parsedAction=expression.parse(action);parsedSuccess=parsedSuccess&&parsedSuccess!=""?parsedSuccess.split(",").map(element=>element.trim()):[];parsedFailure=parsedFailure&&parsedFailure!=""?parsedFailure.split(",").map(element=>element.trim()):[];element.$lsSkip=true;element.classList.add("load-service-start");if(!document.body.contains(element)){element=undefined;return false;}
|
||||
if(event){event.preventDefault();}
|
||||
if(running){return false;}
|
||||
running=true;element.style.backgroud='red';if(confirm){if(window.confirm(confirm)!==true){element.classList.add("load-service-end");element.$lsSkip=false;running=false;return false;}}
|
||||
if(loading){loaderId=alerts.add({text:loading,class:""},0);}
|
||||
let method=container.path(scope+"."+parsedAction);if(!method){throw new Error('Method "'+scope+"."+parsedAction+'" not found');}
|
||||
let formData="FORM"===element.tagName?form.toJson(element):{};let result=resolve(method,"param",formData);if(!result){return;}
|
||||
if(Promise.resolve(result)!=result){result=new Promise((resolve,reject)=>{resolve(result);});}
|
||||
result.then(function(data){if(loaderId!==null){alerts.remove(loaderId);}
|
||||
if(!element){return;}
|
||||
running=false;element.style.backgroud='transparent';element.classList.add("load-service-end");if(service){container.set(service.replace(".","-"),data,true,true);}
|
||||
container.set("serviceData",data,true,true);container.set("serviceForm",formData,true,true);for(let i=0;i<parsedSuccess.length;i++){container.resolve(resolve(callbacks[parsedSuccess[i]],"successParam"+
|
||||
parsedSuccess[i].charAt(0).toUpperCase()+
|
||||
parsedSuccess[i].slice(1),{}));}
|
||||
container.set("serviceData",null,true,true);container.set("serviceForm",null,true,true);element.$lsSkip=false;view.render(element);},function(exception){console.error(exception);if(loaderId!==null){alerts.remove(loaderId);}
|
||||
if(!element){return;}
|
||||
running=false;element.style.backgroud='transparent';element.classList.add("load-service-end");for(let i=0;i<parsedFailure.length;i++){container.resolve(resolve(callbacks[parsedFailure[i]],"failureParam"+
|
||||
parsedFailure[i].charAt(0).toUpperCase()+
|
||||
parsedFailure[i].slice(1),{text:exception.message??undefined}));}
|
||||
element.$lsSkip=false;view.render(element);});};let events=event.trim().split(",");for(let y=0;y<events.length;y++){if(""===events[y]){continue;}
|
||||
switch(events[y].trim()){case"load":exec();break;case"none":break;case"click":case"change":case"keypress":case"keydown":case"keyup":case"input":case"submit":element.addEventListener(events[y],exec);break;default:document.addEventListener(events[y],exec);}}}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-analytics",controller:function(element){let action=element.getAttribute("data-analytics-event")||"click";let doNotTrack=window.navigator.doNotTrack;if(doNotTrack=='1'){return;}
|
||||
element.addEventListener(action,function(){let category=element.getAttribute("data-analytics-category")||"undefined";let label=element.getAttribute("data-analytics-label")||"undefined";if(!ga){console.error("Google Analytics ga object is not available");}
|
||||
ga("send",{hitType:"event",eventCategory:category,eventAction:action,eventLabel:label});});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-analytics-activity",controller:function(window,element,appwrite,container){let action=element.getAttribute("data-analytics-event")||"click";let activity=element.getAttribute("data-analytics-label")||"None";let doNotTrack=window.navigator.doNotTrack;if(doNotTrack=='1'){return;}
|
||||
element.addEventListener(action,function(){let account=container.get('account');let email=account?.email||element?.elements['email']?.value||'';appwrite.analytics.create(email,'console',activity,window.location.href)});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-analytics-pageview",controller:function(window,router,env){if(!ga){console.error("Google Analytics ga object is not available");}
|
||||
let doNotTrack=window.navigator.doNotTrack;if(doNotTrack=='1'){return;}
|
||||
let project=router.params["project"]||'None';ga("set","page",window.location.pathname);ga("set","dimension1",project);ga('set','dimension2',env.VERSION);ga('set','dimension3',env.SETUP);ga("send","pageview");}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-clone",controller:function(element,document,view,expression){element.removeAttribute('data-forms-clone');view.render(element);var template=element.innerHTML.toString();var label=element.dataset["label"]||"Add";var icon=element.dataset["icon"]||null;var target=expression.parse(element.dataset["target"]||null);var first=parseInt(element.dataset["first"]||1);var button=document.createElement("button");var debug=element.dataset["debug"]||false;button.type="button";button.innerText=" "+label+" ";button.classList.add("margin-end");button.classList.add("margin-bottom-small");button.classList.add("reverse");if(icon){var iconElement=document.createElement("i");iconElement.className=icon;button.insertBefore(iconElement,button.firstChild);}
|
||||
if(target){target=document.getElementById(target);}
|
||||
button.addEventListener("click",function(){var clone=document.createElement(element.tagName);if(element.name){clone.name=element.name;}
|
||||
clone.innerHTML=template;clone.className=element.className;var input=clone.querySelector("input, select, textarea");view.render(clone);if(debug){console.log('Debug: clone: ',clone);console.log('Debug: target: ',target);}
|
||||
if(target){target.appendChild(clone);}else{button.parentNode.insertBefore(clone,button);}
|
||||
if(input){input.focus();}
|
||||
Array.prototype.slice.call(clone.querySelectorAll("[data-remove]")).map(function(obj){obj.addEventListener("click",function(){clone.parentNode.removeChild(clone);obj.scrollIntoView({behavior:"smooth"});});});Array.prototype.slice.call(clone.querySelectorAll("[data-up]")).map(function(obj){obj.addEventListener("click",function(){if(clone.previousElementSibling){clone.parentNode.insertBefore(clone,clone.previousElementSibling);obj.scrollIntoView({behavior:"smooth"});}});});Array.prototype.slice.call(clone.querySelectorAll("[data-down]")).map(function(obj){obj.addEventListener("click",function(){if(clone.nextElementSibling){clone.parentNode.insertBefore(clone.nextElementSibling,clone);obj.scrollIntoView({behavior:"smooth"});}});});});element.parentNode.insertBefore(button,element.nextSibling);element.parentNode.removeChild(element);button.form.addEventListener('reset',function(event){target.innerHTML='';if(first){button.click();}});if(first){button.click();}}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-add",repeat:false,controller:function(element,view,container,document){for(var i=0;i<element.children.length;i++){let button=document.createElement("button");let template=element.children[i].cloneNode(true);let as=element.getAttribute('data-ls-as');let counter=0;button.type="button";button.innerText="Add";button.classList.add("reverse");button.classList.add("margin-end-small");button.addEventListener('click',function(){container.addNamespace(as,'new-'+counter++);console.log(container.namespaces,container.get(as),as);container.set(as,null,true,true);let child=template.cloneNode(true);view.render(child);element.appendChild(child);element.style.visibility='visible';let inputs=child.querySelectorAll('input,textarea');for(let index=0;index<inputs.length;++index){if(inputs[index].type!=='hidden'){inputs[index].focus();break;}}});element.after(button);}}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-chart",controller:function(element,container,date,document){let wrapper=document.createElement("div");let child=document.createElement("canvas");let sources=element.getAttribute('data-forms-chart');let width=element.getAttribute('data-width')||500;let height=element.getAttribute('data-height')||175;let showXAxis=element.getAttribute('data-show-x-axis')||false;let showYAxis=element.getAttribute('data-show-y-axis')||false;let colors=(element.getAttribute('data-colors')||'blue,green,orange,red').split(',');let themes={'blue':'#29b5d9','green':'#4eb55b','orange':'#fba233','red':'#dc3232','create':'#00b680','read':'#009cde','update':'#696fd7','delete':'#da5d95',};let range={'24h':'H:i','7d':'d F Y','30d':'d F Y','90d':'d F Y'}
|
||||
let ticksCount=5;element.parentNode.insertBefore(wrapper,element.nextSibling);wrapper.classList.add('content');child.width=width;child.height=height;sources=sources.split(',');wrapper.appendChild(child);let chart=null;let check=function(){let config={type:"line",data:{labels:[],datasets:[]},options:{responsive:true,hover:{mode:"nearest",intersect:false},scales:{x:{display:showXAxis},y:{display:showYAxis,min:0,ticks:{fontColor:"#8f8f8f"}}},plugins:{title:{display:false,text:"Stats"},legend:{display:false},tooltip:{mode:"index",intersect:false,caretPadding:0}}}};let highest=0;for(let i=0;i<sources.length;i++){let label=sources[i].substring(0,sources[i].indexOf('='));let path=sources[i].substring(sources[i].indexOf('=')+1);let usage=container.get('usage');let data=usage[path];let value=JSON.parse(element.value);config.data.labels[i]=label;config.data.datasets[i]={};config.data.datasets[i].label=label;config.data.datasets[i].borderColor=themes[colors[i]];config.data.datasets[i].backgroundColor=themes[colors[i]]+'36';config.data.datasets[i].borderWidth=2;config.data.datasets[i].data=[0,0,0,0,0,0,0];config.data.datasets[i].fill=true;if(!data){return;}
|
||||
let dateFormat=(value.range&&range[value.range])?range[value.range]:'d F Y';for(let x=0;x<data.length;x++){if(data[x].value>highest){highest=data[x].value;}
|
||||
config.data.datasets[i].data[x]=data[x].value;config.data.labels[x]=date.format(dateFormat,data[x].date);}}
|
||||
if(highest==0){config.options.scales.y.ticks.stepSize=1;config.options.scales.y.max=ticksCount;}else{highest=Math.ceil(highest/ticksCount)*ticksCount;config.options.scales.y.ticks.stepSize=highest/ticksCount;config.options.scales.y.max=highest;}
|
||||
if(chart){chart.destroy();}
|
||||
else{}
|
||||
chart=new Chart(child.getContext("2d"),config);wrapper.dataset["canvas"]=true;}
|
||||
check();element.addEventListener('change',check);}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-chart-bars",controller:(element)=>{let observer=null;let populateChart=()=>{let history=element.dataset?.history;if(history==0){history=new Array(12).fill({percentage:0,value:0});}else{history=JSON.parse(history);}
|
||||
element.innerHTML='';history.forEach(({percentage,value},index)=>{const seconds=60-(index*5);const bar=document.createElement('span');bar.classList.add('bar');bar.classList.add(`bar-${percentage}`);bar.classList.add('tooltip');bar.classList.add('down');bar.setAttribute('data-tooltip',`${value} (${seconds} seconds ago)`);element.appendChild(bar);})}
|
||||
if(observer){observer.disconnect();}else{observer=new MutationObserver(populateChart);observer.observe(element,{attributes:true,attributeFilter:['data-history']});}
|
||||
populateChart();}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-code",controller:function(element,alerts){let lang=element.dataset["formsCode"]||"json";let div=document.createElement("div");let pre=document.createElement("pre");let code=document.createElement("code");let copy=document.createElement("i");div.appendChild(pre);div.appendChild(copy);pre.appendChild(code);element.parentNode.appendChild(div);element.style.display='none';div.className="ide";div.dataset['langLabel']=element.dataset["langLabel"]||'JSON';div.dataset['lang']=element.dataset["lang"]||'json';pre.className="line-numbers";code.className="prism language-"+lang;copy.className="icon-docs copy";copy.textContent="Click Here to Copy";copy.title="Copy to Clipboard";copy.addEventListener("click",function(){window.getSelection().removeAllRanges();let range=document.createRange();range.selectNode(code);window.getSelection().addRange(range);try{document.execCommand("copy");alerts.add({text:"Copied to clipboard",class:""},3000);}catch(err){alerts.add({text:"Failed to copy text ",class:"error"},3000);}
|
||||
window.getSelection().removeAllRanges();});let check=function(){if(!element.value){return;}
|
||||
let value=null;try{value=JSON.stringify(JSON.parse(element.value),null,4);}catch(error){value=element.value;}
|
||||
code.innerHTML=value;Prism.highlightElement(code);div.scrollTop=0;};element.addEventListener("change",check);check();}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-color",controller:function(element){var preview=document.createElement("div");var picker=document.createElement("input");picker.type="color";preview.className="color-preview";preview.appendChild(picker);picker.addEventListener("change",syncA);picker.addEventListener("input",syncA);element.addEventListener("input",update);element.addEventListener("change",update);function update(){if(element.validity.valid){preview.style.background=element.value;syncB();}}
|
||||
function syncA(){element.value=picker.value;update();}
|
||||
function syncB(){picker.value=element.value;}
|
||||
element.parentNode.insertBefore(preview,element);update();syncB();}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-copy",controller:function(element,alerts,document,window){var button=window.document.createElement("i");button.type="button";button.className="icon-docs note copy";button.style.cursor="pointer";element.parentNode.insertBefore(button,element.nextSibling);var copy=function(event){let disabled=element.disabled;element.disabled=false;element.focus();element.select();document.execCommand("Copy");if(document.selection){document.selection.empty();}else if(window.getSelection){window.getSelection().removeAllRanges();}
|
||||
element.disabled=disabled;element.blur();alerts.add({text:"Copied to clipboard",class:""},3000);};button.addEventListener("click",copy);}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-custom-id",controller:function(element,sdk,console,window){let prevData="";let idType=element.getAttribute('data-id-type');let disableSwitch=element.getAttribute('data-disable-switch');const div=window.document.createElement("div");if(disableSwitch!=="true"){div.className="input-copy";}
|
||||
const button=window.document.createElement("i");button.type="button";button.style.cursor="pointer";const writer=window.document.createElement("input");writer.type="text";writer.setAttribute("maxlength",element.getAttribute("maxlength"));const placeholder=element.getAttribute("placeholder");if(placeholder){writer.setAttribute("placeholder",placeholder);}
|
||||
const info=window.document.createElement("div");info.className="text-fade text-size-xs margin-top-negative-small margin-bottom";div.appendChild(writer);if(disableSwitch!=="true"){div.appendChild(button);}
|
||||
element.parentNode.insertBefore(div,element);element.parentNode.insertBefore(info,div.nextSibling);const switchType=function(event){if(idType=="custom"){idType="auto";setIdType(idType);}else{idType="custom";setIdType(idType);}}
|
||||
const validate=function(event){const[service,method]=element.dataset["validator"].split('.');const value=event.target.value;if(value.length<1){event.target.setCustomValidity("ID is required");}else{switch(service){case'projects':setValidity(console[service][method](value),event.target);break;default:setValidity(sdk[service][method](value),event.target);}}}
|
||||
const setValidity=async function(promise,target){try{await promise;target.setCustomValidity("ID already exists");}catch(e){target.setCustomValidity("");}}
|
||||
const setIdType=function(idType){if(idType=="custom"){element.setAttribute("data-id-type",idType);info.innerHTML="Allowed Characters A-Z, a-z, 0-9, and non-leading underscore";if(prevData==='auto-generated'){prevData=""}
|
||||
writer.setAttribute("value",prevData);writer.value=prevData;element.value=prevData;writer.removeAttribute("disabled");writer.focus();writer.addEventListener('blur',validate);}else{idType='auto'
|
||||
element.setAttribute("data-id-type",idType);info.innerHTML="Appwrite will generate a unique ID";prevData=writer.value;writer.setAttribute("disabled",true);writer.setAttribute("value","auto-generated");writer.value="auto-generated";element.value='unique()';}
|
||||
button.className=idType=="custom"?"icon-shuffle copy":"icon-edit copy";}
|
||||
const syncEditorWithID=function(event){if(element.value!=='unique()'||idType!='auto'){writer.value=element.value;}
|
||||
if(idType=='auto'){element.value='unique()';}}
|
||||
const keypress=function(e){const key=e.which||e.keyCode;const ZERO=48;const NINE=57;const SMALL_A=97;const SMALL_Z=122;const CAPITAL_A=65;const CAPITAL_Z=90;const UNDERSCORE=95;const HYPHEN=45;const PERIOD=46;const isNotValidDigit=key<ZERO||key>NINE;const isNotValidSmallAlphabet=key<SMALL_A||key>SMALL_Z;const isNotValidCapitalAlphabet=key<CAPITAL_A||key>CAPITAL_Z;const isNotValidFirstChar=(key===UNDERSCORE||key===HYPHEN||key===PERIOD);if(isNotValidFirstChar&&e.target.value.length==0){e.preventDefault();}
|
||||
if(key!=UNDERSCORE&&key!=HYPHEN&&key!=PERIOD&&isNotValidDigit&&isNotValidSmallAlphabet&&isNotValidCapitalAlphabet){e.preventDefault();}}
|
||||
syncEditorWithID();setIdType(idType);writer.addEventListener("change",function(event){element.value=writer.value;});writer.form.addEventListener('reset',function(event){const resetEvent=new Event('reset');element.dispatchEvent(resetEvent);});element.addEventListener('reset',function(event){idType=element.getAttribute('data-id-type');setIdType(idType);});writer.addEventListener('keypress',keypress);button.addEventListener("click",switchType);}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-document",controller:function(element,container,search){var formsDocument=(element.dataset["formsDocument"]||'');var searchButton=(element.dataset["search"]||0);let path=container.scope(searchButton);element.addEventListener('click',function(){search.selected=element.value;search.path=path;document.dispatchEvent(new CustomEvent(formsDocument,{bubbles:false,cancelable:true}));});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-duplications",controller:function(element){let validate=function(element){let duplication=0;let form=element.form;for(let i=0;i<form.elements.length;i++){let field=form.elements[i];if(field.name===element.name&&field.value===element.value){duplication++;}}
|
||||
if(duplication>1){element.setCustomValidity("Duplicated value");}
|
||||
else{element.setCustomValidity("");}};element.addEventListener('change',function(event){validate(event.target)});element.addEventListener('focus',function(event){validate(event.target)});element.addEventListener('blur',function(event){validate(event.target)});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-document-preview",controller:function(element,container,search){element.addEventListener('change',function(){console.log(element.value);});}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-forms-filter",controller:function(document,container,expression,element,form,di){let name=element.dataset["formsFilter"]||"";let events=element.dataset["event"]||"";let serialize=function(obj,prefix){let str=[],p;for(p in obj){if(obj.hasOwnProperty(p)){let k=prefix?prefix+"["+p+"]":p,v=obj[p];if(v===""){continue;}
|
||||
str.push(v!==null&&typeof v==="object"?serialize(v,k):encodeURIComponent(k)+"="+encodeURIComponent(v));}}
|
||||
return str.join("&");};let parse=function(filter){if(filter===""){return null;}
|
||||
let operatorsMap=["!=",">=","<=","=",">","<"];let operator=null;for(let key=0;key<operatorsMap.length;key++){if(filter.indexOf(operatorsMap[key])>-1){operator=operatorsMap[key];}}
|
||||
if(operator===null){throw new Error("Invalid operator");}
|
||||
filter=filter.split(operator);if(filter.length!==2){throw new Error("Invalid filter expression");}
|
||||
return{key:filter[0],value:filter[1],operator:operator};};let flatten=function(params){let list={};for(let key in params){if(params.hasOwnProperty(key)){if(key!=="filters"){list[key]=params[key];}else{for(let i=0;i<params[key].length;i++){let filter=parse(params[key][i]);if(null===filter){continue;}
|
||||
list["filters-"+filter.key]=params[key][i];}}}}
|
||||
return list;};let apply=function(params){let cached=container.get(name);cached=cached?cached.params:[];params=Object.assign(cached,params);container.set(name,{name:name,params:params,query:serialize(params),forward:parseInt(params.offset)+parseInt(params.limit),backward:parseInt(params.offset)-parseInt(params.limit),keys:flatten(params)},true,name);document.dispatchEvent(new CustomEvent(name+"-changed",{bubbles:false,cancelable:true}));};switch(element.tagName){case"INPUT":break;case"TEXTAREA":break;case"BUTTON":element.addEventListener("click",function(){apply(JSON.parse(expression.parse(element.dataset["params"]||"{}")));});break;case"FORM":element.addEventListener("input",function(){apply(form.toJson(element));});element.addEventListener("change",function(){apply(form.toJson(element));});element.addEventListener("reset",function(){setTimeout(function(){apply(form.toJson(element));},0);});events=events.trim().split(",");for(let y=0;y<events.length;y++){if(events[y]==="init"){element.addEventListener("rendered",function(){apply(form.toJson(element));},{once:true});}else{}
|
||||
element.setAttribute("data-event","none");}
|
||||
break;default:break;}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-forms-headers",controller:function(element){let key=document.createElement("input");let value=document.createElement("input");let wrap=document.createElement("div");let cell1=document.createElement("div");let cell2=document.createElement("div");key.type="text";key.className="margin-bottom-no";key.placeholder="Key";value.type="text";value.className="margin-bottom-no";value.placeholder="Value";wrap.className="row thin margin-bottom-small";cell1.className="col span-6";cell2.className="col span-6";element.parentNode.insertBefore(wrap,element);cell1.appendChild(key);cell2.appendChild(value);wrap.appendChild(cell1);wrap.appendChild(cell2);key.addEventListener("input",function(){syncA();});value.addEventListener("input",function(){syncA();});element.addEventListener("change",function(){syncB();});let syncA=function(){element.value=key.value.toLowerCase()+":"+value.value.toLowerCase();};let syncB=function(){let split=element.value.toLowerCase().split(":");key.value=split[0]||"";value.value=split[1]||"";key.value=key.value.trim();value.value=value.value.trim();};syncB();}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-forms-key-value",controller:function(element){let key=document.createElement("input");let value=document.createElement("input");let wrap=document.createElement("div");let cell1=document.createElement("div");let cell2=document.createElement("div");key.type="text";key.className="margin-bottom-no";key.placeholder="Key";key.required=true;value.type="text";value.className="margin-bottom-no";value.placeholder="Value";value.required=true;wrap.className="row thin margin-bottom-small";cell1.className="col span-6";cell2.className="col span-6";element.parentNode.insertBefore(wrap,element);cell1.appendChild(key);cell2.appendChild(value);wrap.appendChild(cell1);wrap.appendChild(cell2);key.addEventListener("input",function(){syncA();});value.addEventListener("input",function(){syncA();});element.addEventListener("change",function(){syncB();});let syncA=function(){element.name=key.value;element.value=value.value;};let syncB=function(){key.value=element.name||"";value.value=element.value||"";};syncB();}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-move-down",controller:function(element){Array.prototype.slice.call(element.querySelectorAll("[data-move-down]")).map(function(obj){obj.addEventListener("click",function(){if(element.nextElementSibling){console.log('down',element.offsetHeight);element.parentNode.insertBefore(element.nextElementSibling,element);element.scrollIntoView({block:'center'});}});});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-move-up",controller:function(element){Array.prototype.slice.call(element.querySelectorAll("[data-move-up]")).map(function(obj){obj.addEventListener("click",function(){if(element.previousElementSibling){console.log('up',element);element.parentNode.insertBefore(element,element.previousElementSibling);element.scrollIntoView({block:'center'});}});});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-nav",repeat:false,controller:function(element,view,container,document){let titles=document.querySelectorAll('[data-forms-nav-anchor]');let links=element.querySelectorAll('[data-forms-nav-link]');let minLink=null;let check=function(){let minDistance=null;let minElement=null;for(let i=0;i<titles.length;++i){let title=titles[i];let distance=title.getBoundingClientRect().top;console.log(i);if((minDistance===null||minDistance>=distance)&&(distance>=0)){if(minLink){minLink.classList.remove('selected');}
|
||||
console.log('old',minLink);minDistance=distance;minElement=title;minLink=links[i];minLink.classList.add('selected');console.log('new',minLink);}}};window.addEventListener('scroll',check);check();}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-oauth-apple",controller:function(element){let container=document.createElement("div");let row=document.createElement("div");let col1=document.createElement("div");let col2=document.createElement("div");let keyID=document.createElement("input");let keyLabel=document.createElement("label");let teamID=document.createElement("input");let teamLabel=document.createElement("label");let p8=document.createElement("textarea");let p8Label=document.createElement("label");keyLabel.textContent='Key ID';teamLabel.textContent='Team ID';p8Label.textContent='P8 File';row.classList.add('row');row.classList.add('thin');container.appendChild(row);container.appendChild(p8Label);container.appendChild(p8);row.appendChild(col1);row.appendChild(col2);col1.classList.add('col');col1.classList.add('span-6');col1.appendChild(keyLabel);col1.appendChild(keyID);col2.classList.add('col');col2.classList.add('span-6');col2.appendChild(teamLabel);col2.appendChild(teamID);keyID.type='text';keyID.placeholder='SHAB13ROFN';teamID.type='text';teamID.placeholder='ELA2CD3AED';p8.accept='.p8';p8.classList.add('margin-bottom-no');element.parentNode.insertBefore(container,element.nextSibling);element.addEventListener('change',sync);keyID.addEventListener('change',update);teamID.addEventListener('change',update);p8.addEventListener('change',update);function update(){let json={};json.keyID=keyID.value;json.teamID=teamID.value;json.p8=p8.value;element.value=JSON.stringify(json);}
|
||||
function sync(){if(!element.value){return;}
|
||||
let json={};try{json=JSON.parse(element.value);}catch(error){console.error('Failed to parse secret key');}
|
||||
teamID.value=json.teamID||'';keyID.value=json.keyID||'';p8.value=json.p8||'';}
|
||||
sync();}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-password-meter",controller:function(element,window){var calc=function(password){var score=0;if(!password)return score;var letters=new window.Object();for(var i=0;i<password.length;i++){letters[password[i]]=(letters[password[i]]||0)+1;score+=5.0/letters[password[i]];}
|
||||
var variations={digits:/\d/.test(password),lower:/[a-z]/.test(password),upper:/[A-Z]/.test(password),nonWords:/\W/.test(password)};var variationCount=0;for(var check in variations){if(variations.hasOwnProperty(check)){variationCount+=variations[check]===true?1:0;}}
|
||||
score+=(variationCount-1)*10;return parseInt(score);};var callback=function(){var score=calc(this.value);if(""===this.value)return(meter.className="password-meter");if(score>60)return(meter.className="password-meter strong");if(score>30)return(meter.className="password-meter medium");if(score>=0)return(meter.className="password-meter weak");};var meter=window.document.createElement("div");meter.className="password-meter";element.parentNode.insertBefore(meter,element.nextSibling);element.addEventListener("change",callback);element.addEventListener("keypress",callback);element.addEventListener("keyup",callback);element.addEventListener("keydown",callback);}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-pell",controller:function(element,window,document,markdown,rtl){var div=document.createElement("div");element.className="pell hide";div.className="input pell";element.parentNode.insertBefore(div,element);element.tabIndex=-1;var turndownService=new TurndownService();turndownService.addRule("underline",{filter:["u"],replacement:function(content){return"__"+content+"__";}});var editor=window.pell.init({element:div,onChange:function onChange(html){alignText();element.value=turndownService.turndown(html);},defaultParagraphSeparator:"p",actions:[{name:"bold",icon:'<i class="icon-bold"></i>'},{name:"underline",icon:'<i class="icon-underline"></i>'},{name:"italic",icon:'<i class="icon-italic"></i>'},{name:"olist",icon:'<i class="icon-list-numbered"></i>'},{name:"ulist",icon:'<i class="icon-list-bullet"></i>'},{name:"link",icon:'<i class="icon-link"></i>'}]});var clean=function(e){e.stopPropagation();e.preventDefault();var clipboardData=e.clipboardData||window.clipboardData;console.log(clipboardData.getData("Text"));window.pell.exec("insertText",clipboardData.getData("Text"));return true;};var alignText=function(){let paragraphs=editor.content.querySelectorAll('p,li');let last='';for(let paragraph of paragraphs){var content=paragraph.textContent;if(content.trim()===''){content=last.textContent;}
|
||||
if(rtl.isRTL(content)){paragraph.style.direction='rtl';paragraph.style.textAlign='right';}
|
||||
else{paragraph.style.direction='ltr';paragraph.style.textAlign='left';}
|
||||
last=paragraph;}};var santize=function(e){clean(e);alignText(e);};element.addEventListener("change",function(){editor.content.innerHTML=markdown.render(element.value);alignText();});editor.content.setAttribute("placeholder",element.placeholder);editor.content.innerHTML=markdown.render(element.value);editor.content.tabIndex=0;alignText();editor.content.onkeydown=function preventTab(event){if(event.which===9){event.preventDefault();if(document.activeElement){var focussable=Array.prototype.filter.call(document.querySelectorAll('a:not([disabled]), button:not([disabled]), select:not([disabled]), input[type=text]:not([disabled]), input[type=checkbox]:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])'),function(element){return(element.offsetWidth>0||element.offsetHeight>0||element===document.activeElement);});var index=focussable.indexOf(document.activeElement);if(index>-1){if(event.shiftKey){var prevElement=focussable[index-1]||focussable[focussable.length-1];prevElement.focus();}else{var nextElement=focussable[index+1]||focussable[0];nextElement.focus();}}}}};div.addEventListener("paste",santize);div.addEventListener("drop",santize);}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-required",controller:function(element,expression){const isRequired=expression.parse(element.getAttribute('data-forms-required'))==="true";if(isRequired){element.setAttribute("required",true);}else{element.removeAttribute("disabled");}}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-remove",controller:function(element){Array.prototype.slice.call(element.querySelectorAll("[data-remove]")).map(function(obj){obj.addEventListener("click",function(){element.parentNode.removeChild(element);});});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-run",repeat:false,controller:function(element,expression,container){let action=expression.parse(element.dataset["formsRun"]||'');element.addEventListener('click',function(){return container.path(action)();});}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-select-all",controller:function(element){let select=document.createElement("button");let unselect=document.createElement("button");select.textContent='Select All';unselect.textContent='Unselect All';select.classList.add('link');select.classList.add('margin-top-tiny');select.classList.add('margin-start-small');select.classList.add('text-size-small');select.classList.add('pull-end');unselect.classList.add('link');unselect.classList.add('margin-top-tiny');unselect.classList.add('margin-start-small');unselect.classList.add('text-size-small');unselect.classList.add('pull-end');select.type='button';unselect.type='button';element.parentNode.insertBefore(select,element);element.parentNode.insertBefore(unselect,element);select.addEventListener('click',function(){let checkboxes=element.querySelectorAll("input[type='checkbox']");for(var i=0;i<checkboxes.length;i++){checkboxes[i].checked=true;checkboxes[i].dispatchEvent(new Event('change'));}})
|
||||
unselect.addEventListener('click',function(){let checkboxes=element.querySelectorAll("input[type='checkbox']");for(var i=0;i<checkboxes.length;i++){checkboxes[i].checked=false;checkboxes[i].dispatchEvent(new Event('change'));}})}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-selected",controller:function(element,expression){const isSelected=expression.parse(element.getAttribute('data-forms-selected'))===element.getAttribute('value');if(isSelected){element.setAttribute("selected",true);}else{element.removeAttribute("selected");}}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-show-secret",controller:function(element,document){let button=document.createElement('span');button.className="link pull-end text-size-small margin-top-negative icon-eye";button.innerHTML=(element.type=='password')?'Show Secret':'Hide Secret';button.style.visibility=(element.value=='')?'hidden':'visible';element.insertAdjacentElement("beforebegin",button);button.addEventListener("click",function(event){switch(element.type){case"password":element.type="text";button.innerHTML='Hide Secret';break;case"text":element.type="password";button.innerHTML='Show Secret';break;default:console.warn("data-forms-show-secret: element.type NOT text NOR password");}});let sync=function(event){button.style.visibility=(element.value=='')?'hidden':'visible';};element.addEventListener("keyup",sync);element.addEventListener("change",sync);},});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-switch",controller:function(element){let input=window.document.createElement("input");input.type="checkbox";input.className="button switch "+element.className;let syncA=function(){let value=input.checked?"true":"false"
|
||||
let old=element.value;element.value=value;if(value!==old){element.dispatchEvent(new Event('change'));}};let syncB=function(){input.checked=(element.value==="true");if(element.disabled){input.setAttribute("disabled",true);}else{input.removeAttribute("disabled");}};input.addEventListener("input",syncA);input.addEventListener("change",syncA);element.addEventListener("input",syncB);element.addEventListener("change",syncB);syncA();element.parentNode.insertBefore(input,element);}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-tags",controller:function(element){let array=[];let tags=window.document.createElement("div");let preview=window.document.createElement("ul");let add=window.document.createElement("input");let listen=function(event){if((event.key==="Enter"||event.key===" "||event.key==="Tab")&&add.value.length>0){array.push(add.value);add.value="";element.value=JSON.stringify(array);check();if(event.key!=="Tab"){event.preventDefault();}}
|
||||
if((event.key==="Backspace"||event.key==="Delete")&&add.value===""){array.splice(-1,1);element.value=JSON.stringify(array);check();}
|
||||
return false;};let check=function(){try{array=JSON.parse(element.value)||[];}catch(error){array=[];}
|
||||
if(!Array.isArray(array)){array=[];}
|
||||
preview.innerHTML="";for(let index=0;index<array.length;index++){let value=array[index];let tag=window.document.createElement("li");if(!value||value===' '){continue;}
|
||||
tag.className="tag";tag.textContent=value;tag.addEventListener("click",function(){array.splice(index,1);element.value=JSON.stringify(array);check();});preview.appendChild(tag);}
|
||||
if(element.required&&array.length===0){add.setCustomValidity("Please add permissions");}else{add.setCustomValidity("");}};tags.className="tags";preview.className="tags-list";add.type="text";add.className="add";add.placeholder=element.placeholder;tags.addEventListener("click",function(){add.focus();});add.addEventListener("keydown",listen);add.addEventListener("blur",function(event){if(add.value!==''){array.push(add.value);add.value="";element.value=JSON.stringify(array);check();}});tags.appendChild(preview);tags.appendChild(add);element.parentNode.insertBefore(tags,element);element.addEventListener("change",check);check();}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-text-count",controller:function(element){var counter=document.createElement("div");counter.className="counter";element.parentNode.insertBefore(counter,element.nextSibling);var count=function(){if(0<=element.maxLength){counter.innerText=(element.maxLength-element.value.length).toString()+" / "+
|
||||
element.maxLength;}else{var words=element.value!==""?element.value.trim().split(" ").length:0;counter.innerText=words+" words and "+element.value.length.toString()+" chars";}};element.addEventListener("keyup",count);element.addEventListener("change",count);element.addEventListener("cut",count);element.addEventListener("paste",count);element.addEventListener("drop",count);count();}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-text-direction",controller:function(element,rtl){var setDirection=function(){var value=element.value[0]?element.value:"";var direction="ltr";var align="left";if(rtl.isRTL(value)){direction="rtl";align="right";}
|
||||
element.style.direction=direction;element.style.textAlign=align;};element.addEventListener("keyup",setDirection);element.addEventListener("change",setDirection);element.addEventListener("cut",setDirection);element.addEventListener("paste",setDirection);element.addEventListener("drop",setDirection);setDirection();}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-text-resize",controller:function(element,window){function resize(){var scrollLeft=window.pageXOffset||(window.document.documentElement||window.document.body.parentNode||window.document.body).scrollLeft;var scrollTop=window.pageYOffset||(window.document.documentElement||window.document.body.parentNode||window.document.body).scrollTop;var offset=element.offsetHeight-element.clientHeight;element.style.height="auto";element.style.height=element.scrollHeight+offset+"px";window.scrollTo(scrollLeft,scrollTop);}
|
||||
element.addEventListener("keyup",resize);element.addEventListener("change",resize);element.addEventListener("cut",resize);element.addEventListener("paste",resize);element.addEventListener("drop",resize);window.addEventListener("resize",resize);resize();}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-upload",controller:function(element,container,alerts,expression,env,search){var scope=element.dataset["scope"];var project=expression.parse(element.dataset["project"]||"console");var labelButton=element.dataset["labelButton"]||"Upload";var labelLoading=element.dataset["labelLoading"]||"Uploading...";var previewWidth=element.dataset["previewWidth"]||200;var previewHeight=element.dataset["previewHeight"]||200;var previewAlt=element.dataset["previewAlt"]||200;var accept=element.dataset["accept"]||"";var searchButton=(element.dataset["search"]||0);var required=element.dataset["required"]||false;var className=element.dataset["class"]||"upload";var max=parseInt(element.dataset["max"]||4);var sdk=scope==="sdk"?container.get("sdk"):container.get("console");var output=element.value||null;var wrapper=document.createElement("div");var input=document.createElement("input");var upload=document.createElement("div");var preview=document.createElement("ul");var progress=document.createElement("div");var count=document.createElement("div");wrapper.className=className;input.type="file";input.accept=accept;input.required=required;input.tabIndex=-1;count.className="count";upload.className="button reverse margin-bottom-small";upload.innerHTML='<i class="icon icon-upload"></i> '+labelButton;upload.tabIndex=0;preview.className="preview";progress.className="progress";progress.style.width="0%";progress.style.display="none";var onComplete=function(message){alerts.remove(message);input.disabled=false;upload.classList.remove("disabled");progress.style.width="0%";progress.style.display="none";};var render=function(result){preview.innerHTML="";count.innerHTML="0 / "+max;if(!result){return;}
|
||||
var file=document.createElement("li");var image=document.createElement("img");image.src=image.src=env.API+"/storage/files/"+
|
||||
result+"/preview?width="+
|
||||
previewWidth+"&height="+
|
||||
previewHeight+"&project="+project+"&mode=admin";image.alt=previewAlt;file.className="file avatar";file.tabIndex=0;file.appendChild(image);preview.appendChild(file);var remove=(function(result){return function(event){render(result.$id);element.value='';};})(result);file.addEventListener("click",remove);file.addEventListener("keypress",remove);element.value=result;};input.addEventListener("change",function(){var message=alerts.add({text:labelLoading,class:""},0);var files=input.files;var read=JSON.parse(expression.parse(element.dataset["read"]||"[]"));var write=JSON.parse(expression.parse(element.dataset["write"]||"[]"));sdk.storage.createFile('unique()',files[0],read,write,1).then(function(response){onComplete(message);render(response.$id);},function(error){alerts.add({text:"An error occurred!",class:""},3000);onComplete(message);});input.disabled=true;});element.addEventListener("change",function(){if(!element.value){return;}
|
||||
render(element.value);wrapper.scrollIntoView();});upload.addEventListener("keypress",function(){input.click();});element.parentNode.insertBefore(wrapper,element);wrapper.appendChild(preview);wrapper.appendChild(progress);wrapper.appendChild(upload);upload.appendChild(input);render(output);if(searchButton){let searchOpen=document.createElement("button");searchOpen.type='button';searchOpen.innerHTML='<i class="icon icon-search"></i> Search';searchOpen.classList.add('reverse');let path=container.scope(searchButton);searchOpen.addEventListener('click',function(){search.selected=element.value;search.path=path;document.dispatchEvent(new CustomEvent("open-file-serach",{bubbles:false,cancelable:true}));});wrapper.appendChild(searchOpen);}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-cookies",controller:function(element,alerts,cookie,env){if(!cookie.get("cookie-alert")){let text=element.dataset["cookies"]||"";alerts.add({text:text,class:"cookie-alert",link:env.HOME+"/policy/cookies",label:'Learn More',callback:function(){cookie.set("cookie-alert","true",365*10);}},0);}}});})(window);(function(window){"use strict";window.ls.view.add({selector:'data-general-copy',repeat:false,controller:function(document,element,alerts){let button=document.createElement("i");button.type="button";button.title="Copy to Clipboard";button.className=element.getAttribute("data-class")||"icon-docs note copy";button.style.cursor="pointer";element.parentNode.insertBefore(button,element.nextSibling);let copy=function(event){window.getSelection().removeAllRanges();let range=document.createRange();range.selectNode(element);window.getSelection().addRange(range);try{document.execCommand("copy");alerts.add({text:"Copied to clipboard",class:""},3000);}catch(err){alerts.add({text:"Failed to copy text ",class:"error"},3000);}
|
||||
window.getSelection().removeAllRanges();};button.addEventListener("click",copy);}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-page-title",repeat:true,controller:function(element,document,expression){document.title=expression.parse(element.getAttribute("data-page-title"))||document.title;}});})(window);(function(window){"use strict";window.ls.view.add({selector:'data-general-scroll-to',repeat:false,controller:function(element,window){let button=window.document.createElement('button');button.className='scroll-to icon-up-dir';button.alt='Back To Top';button.title='Back To Top';button.addEventListener('click',function(){element.scrollIntoView(true,{behavior:'smooth'});button.blur();},false);element.appendChild(button);}});})(window);(function(window){"use strict";window.ls.view.add({selector:'data-general-scroll-direction',repeat:false,controller:function(element,window){let position=0;let check=function(){let direction=window.document.documentElement.scrollTop;if(direction>position){element.classList.remove('scroll-to-top')
|
||||
element.classList.add('scroll-to-bottom')}
|
||||
else{element.classList.remove('scroll-to-bottom')
|
||||
element.classList.add('scroll-to-top')}
|
||||
position=direction;let current=Math.ceil(direction/window.innerHeight);element.setAttribute('data-views-total',Math.ceil(element.scrollHeight/window.innerHeight));element.setAttribute('data-views-current',current);if(element.scrollHeight<=(direction+element.offsetHeight+300)&&direction>0){element.classList.add('scroll-end')}
|
||||
else{element.classList.remove('scroll-end')}};window.addEventListener('scroll',check,false);window.addEventListener('resize',check,false);check();}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-setup",controller:function(element,console,form,alerts,router){element.addEventListener("submit",function(event){event.preventDefault();let loaderId=alerts.add({text:'Creating new project...',class:""},0);let formData=form.toJson(element);formData["name"]=formData["name"]||(element.dataset["defaultName"]||"");console.teams.create('unique()',formData["name"]||"").then(function(data){let team=data["$id"];formData=JSON.parse(JSON.stringify(formData).replace(new RegExp("{{teamId}}","g"),team));console.projects.create(formData["projectId"],formData["name"],team).then(function(project){alerts.remove(loaderId);window.location.href="/console/home?project="+project["$id"];},function(){throw new Error("Failed to setup project");});},function(){throw new Error("Setup failed creating project team");});});}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-switch",controller:function(element,router,document){let check=function(c){if(!element.value){return;}
|
||||
if(element.value===router.params.project){return;}
|
||||
return router.change("/console/home?project="+element.value);};element.addEventListener("change",function(){check();});}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-general-theme",controller:function(element,router,document){let toggle=function(c){if(document.body.classList.contains('theme-light')){document.body.classList.remove('theme-light');document.body.classList.add('theme-dark');window.localStorage.setItem('user-theme','theme-dark')}
|
||||
else{document.body.classList.remove('theme-dark');document.body.classList.add('theme-light');window.localStorage.setItem('user-theme','theme-light')}};element.addEventListener("click",function(){toggle();});}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-version",controller:function(alerts,env,cookie){let cookieName="version-update-"+env.VERSION.replace(/\./g,"_");if(!cookie.get(cookieName)){var xhr=new XMLHttpRequest();xhr.open('GET','/console/version',true);xhr.onload=function(){if(this.readyState==4&&this.status==200){let data=JSON.parse(this.responseText);let text='Appwrite version '+data.version+' is avaliable, check the';if(isNewerVersion(env.VERSION,data.version)){alerts.add({text:text,class:"success",link:"https://github.com/appwrite/appwrite/releases",label:'release notes',callback:function(){cookie.set(cookieName,"true",365*10);}},0);}}};xhr.send(null);function isNewerVersion(oldVer,newVer){const oldParts=oldVer.split('.')
|
||||
const newParts=newVer.split('.')
|
||||
for(var i=0;i<newParts.length;i++){const a=parseInt(newParts[i])||0
|
||||
const b=parseInt(oldParts[i])||0
|
||||
if(a>b)return true
|
||||
if(a<b)return false}
|
||||
return false}}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-paging-back",controller:function(element,container,expression,env){let paths=[];let limit=env.PAGING_LIMIT;let check=function(){let offset=parseInt(expression.parse(element.dataset["offset"])||"0");paths=paths.concat(expression.getPaths());if(offset-limit<0){element.disabled=true;}else{element.disabled=false;element.value=offset-limit;}};check();for(let i=0;i<paths.length;i++){let path=paths[i].split(".");while(path.length){container.bind(element,path.join("."),check);path.pop();}}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-paging-next",controller:function(element,container,expression,env){let paths=[];let limit=env.PAGING_LIMIT;let check=function(){let offset=parseInt(expression.parse(element.dataset["offset"])||"0");paths=paths.concat(expression.getPaths());let sum=parseInt(expression.parse(element.dataset["sum"])||"0");paths=paths.concat(expression.getPaths());if(offset+limit>=sum){element.disabled=true;}else{element.disabled=false;element.value=offset+limit;}};check();for(let i=0;i<paths.length;i++){let path=paths[i].split(".");while(path.length){container.bind(element,path.join("."),check);path.pop();}}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-ui-highlight",controller:function(element,expression,document){let check=function(){let links=element.getElementsByTagName("a");let selected=null;let list=[];for(let i=0;i<links.length;i++){list.push(links[i]);}
|
||||
list.sort(function(a,b){return a.pathname.length-b.pathname.length;});if(selected&&list[selected].dataset["selected"]){let parent=element.querySelector("a[href='"+list[selected].dataset["selected"]+"']");if(parent){parent.classList.remove("selected");}}
|
||||
for(let i=0;i<list.length;i++){let path=list[i].pathname;if(path===window.location.pathname.substring(0,path.length)){list[i].classList.add("selected");if(selected!==null){list[selected].classList.remove("selected");}
|
||||
selected=i;}else{list[i].classList.remove("selected");}}
|
||||
if(selected&&list[selected].dataset["selected"]){let parent=element.querySelector("a[href='"+list[selected].dataset["selected"]+"']");if(parent){parent.classList.add("selected");}}};document.addEventListener("state-changed",check);check();},});})(window);(function(window){window.ls.container.get("view").add({selector:"data-ls-ui-loader",controller:function(element,document){document.addEventListener('account.get',function(){element.classList.add('loaded');});}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-ui-modal",controller:function(document,element,expression){let name=expression.parse(element.dataset["name"]||'');let buttonText=expression.parse(element.dataset["buttonText"]||"");let buttonElement=expression.parse(element.dataset["buttonElement"]||"button");let buttonClass=expression.parse(element.dataset["buttonClass"]||"button-class");let buttonIcon=expression.parse(element.dataset["buttonIcon"]||'');let buttonEvent=expression.parse(element.dataset["buttonEvent"]||"");let buttonHide=expression.parse(element.dataset["buttonHide"]||"");let buttonAlias=expression.parse(element.dataset["buttonAlias"]||"");let buttonElements=!buttonAlias?[document.createElement(buttonElement)]:document.querySelectorAll(buttonAlias);let openEvent=expression.parse(element.dataset["openEvent"]||'');let closeEvent=expression.parse(element.dataset["closeEvent"]||'submit');let background=document.getElementById("modal-bg");if(!background){background=document.createElement("div");background.id="modal-bg";background.className="modal-bg";document.body.appendChild(background);background.addEventListener("click",function(){document.dispatchEvent(new CustomEvent("modal-close",{bubbles:false,cancelable:true}));});}
|
||||
if(!buttonAlias){buttonElements.forEach(button=>{button.innerText=buttonText;button.className=buttonClass;button.type=buttonElement;if(buttonIcon){let iconElement=document.createElement("i");iconElement.className=buttonIcon;button.insertBefore(iconElement,button.firstChild);}});}
|
||||
if(buttonEvent){buttonElements.forEach(button=>{button.addEventListener("click",function(){document.dispatchEvent(new CustomEvent(buttonEvent,{bubbles:false,cancelable:true}));});});}
|
||||
element.classList.add("modal");if(!buttonAlias&&!buttonHide){buttonElements.forEach(button=>{element.parentNode.insertBefore(button,element);});}
|
||||
let open=function(){document.documentElement.classList.add("modal-open");document.dispatchEvent(new CustomEvent("modal-open",{bubbles:false,cancelable:true}));element.classList.add("open");element.classList.remove("close");let form=element.querySelector('form');let elements=form?form.querySelectorAll('[name]'):[];for(const element of elements){if(element.type!=='hidden'&&element.type!=='button'&&element.type!=='submit'&&!element.disabled){element.focus();break;}}};let close=function(event){document.documentElement.classList.remove("modal-open");element.classList.add("close");element.classList.remove("open");};if(name){document.querySelectorAll("[data-ui-modal-ref='"+name+"']").forEach(function(elem){elem.addEventListener("click",open);});}
|
||||
if(openEvent){document.addEventListener(openEvent,open);}
|
||||
buttonElements.forEach(button=>{button.addEventListener("click",open);});document.addEventListener("keydown",function(event){if(event.which===27){close();}});element.addEventListener("blur",close);let closeButtons=element.querySelectorAll("[data-ui-modal-close]");for(let i=0;i<closeButtons.length;i++){closeButtons[i].addEventListener("click",close);}
|
||||
document.addEventListener("modal-close",close);element.addEventListener(closeEvent,close);}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-ls-ui-open",controller:function(element,window){let def=element.classList.contains("open")?"open":"close";let buttonClass=element.dataset["buttonClass"]||"ls-ui-open";let buttonText=element.dataset["buttonText"]||"";let buttonIcon=element.dataset["buttonIcon"]||"";let buttonAria=element.dataset["buttonAria"]||"Open";let buttonSelector=element.dataset["buttonSelector"]||"";let hover=element.hasAttribute("data-hover");let blur=element.hasAttribute("data-blur");let button=window.document.createElement("button");let isTouch=function(){return("ontouchstart"in window||navigator.maxTouchPoints);};button.innerText=buttonText;button.className=buttonClass;button.type="button";if(buttonIcon){let icon=window.document.createElement("i");icon.className=buttonIcon;button.insertBefore(icon,button.firstChild);}
|
||||
if(buttonAria){button.setAttribute('aria-label',buttonAria);}
|
||||
if(def==="close"){element.classList.add("close");element.classList.remove("open");}else{element.classList.add("open");element.classList.remove("close");}
|
||||
button.addEventListener("click",function(){element.classList.toggle("open");element.classList.toggle("close");});if(hover&&!isTouch()){element.addEventListener("mouseover",function(){element.classList.add("open");element.classList.remove("close");});element.addEventListener("mouseout",function(){element.classList.add("close");element.classList.remove("open");});}
|
||||
let close=function(){element.classList.add("close");element.classList.remove("open");};let closeDelay=function(){window.setTimeout(function(){close();},400);};let findParent=function(tagName,el){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;}
|
||||
while((el=el.parentNode)){if((el.nodeName||el.tagName).toLowerCase()===tagName.toLowerCase()){return el;}}
|
||||
return null;};if(blur){button.addEventListener("blur",closeDelay);}
|
||||
if(buttonSelector){let buttonElements=element.querySelectorAll(buttonSelector);buttonElements.forEach(node=>{node.addEventListener("click",function(){element.classList.toggle("open");element.classList.toggle("close");});if(blur){node.addEventListener("blur",closeDelay);}});}
|
||||
element.addEventListener('click',function(event){let targetA=findParent('a',event.target);let targetB=findParent('button',event.target);if(!targetA&&!targetB){return false;}
|
||||
if(targetA&&!targetA.href){return false;}
|
||||
if(targetB&&!targetB.classList.contains('link')){return false;}
|
||||
closeDelay();});element.insertBefore(button,element.firstChild);}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-ui-phases",controller:function(element,window,document,expression,router,view){var tabs=document.createElement("ul");var container=document.createElement("div");var titles=Array.prototype.slice.call(element.querySelectorAll("li > h1"));var next=Array.prototype.slice.call(element.querySelectorAll("[data-next]"));var previous=Array.prototype.slice.call(element.querySelectorAll("[data-previous]"));var position=0;var init=false;if(titles.length===0){titles=Array.prototype.slice.call(element.querySelectorAll("li > h2"));}
|
||||
if(titles.length===0){titles=Array.prototype.slice.call(element.querySelectorAll("li > h3"));}
|
||||
if(titles.length===0){titles=Array.prototype.slice.call(element.querySelectorAll("li > h4"));}
|
||||
if(titles.length===0){titles=Array.prototype.slice.call(element.querySelectorAll("li > h5"));}
|
||||
if(titles.length===0){titles=Array.prototype.slice.call(element.querySelectorAll("li > h6"));}
|
||||
for(var i=0;i<element.children.length;i++){var tabState=expression.parse(element.children[i].dataset["state"]||"");if(tabState&&tabState===(window.location.pathname+window.location.search).substring(0,tabState.length)){position=i;}}
|
||||
var setTab=function(index){var tabState=expression.parse(element.children[index].dataset["state"]||"");var url="";if(tabState!==""&&tabState!==window.location.pathname+window.location.search){var parser=document.createElement("a");parser.href=tabState;url=!init?parser.pathname+window.location.search:tabState;if(position!=index){window.history.pushState({},"",url);router.reset();}}
|
||||
element.children[position].classList.remove("selected");element.children[index].classList.add("selected");tabs.children[position].classList.remove("selected");tabs.children[index].classList.add("selected");position=index;document.dispatchEvent(new CustomEvent("tab-changed"));init=true;};tabs.classList.add("tabs");container.classList.add("container");container.classList.add("close");container.dataset["lsUiOpen"]="";container.dataset["buttonClass"]="icon icon-down-dir";titles.map(function(obj,i){var title=document.createElement("li");title.innerHTML=obj.innerHTML;title.className=obj.className;title.tabIndex=0;tabs.appendChild(title);title.addEventListener("click",function(){setTab(i);});title.addEventListener("keyup",function(){if(event.which===13){setTab(i);}});view.render(title);});next.map(function(obj){obj.addEventListener("click",function(){setTab(position+1);});});previous.map(function(obj){obj.addEventListener("click",function(){setTab(position-1);});});setTab(position);container.appendChild(tabs);element.parentNode.insertBefore(container,element);}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-ls-ui-trigger",controller:function(element,document,expression){let trigger=expression.parse(element.dataset["lsUiTrigger"]||'').trim().split(',');let event=expression.parse(element.dataset["event"]||'click');let debug=element.getAttribute('data-debug')||false;for(let index=0;index<trigger.length;index++){let name=trigger[index];element.addEventListener(event,function(){if(debug){console.log('Debug: event triggered: '+name);}
|
||||
document.dispatchEvent(new CustomEvent(name));});}}});})(window);
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
.pull-start{float:left}.pull-end{float:right}img[src=""]{visibility:hidden;display:inline-block}:root{--config-width:910px;--config-width-xxl:1000px;--config-width-xl:910px;--config-width-large:700px;--config-width-medium:550px;--config-width-small:320px;--config-color-primary:#f02e65;--config-color-link:#1e849e;--config-color-background:#eceff1;--config-color-background-dark:#dfe2e4;--config-color-background-fade:#ffffff;--config-color-background-fade-super:#fdfdfd;--config-color-background-focus:#f5f5f5;--config-color-background-input:#ffffff;--config-color-placeholder:#868686;--config-color-tooltip-text:#dce8f5;--config-color-tooltip-background:#333333;--config-color-focus:#f02e65;--config-color-focus-fade:#fef8fa;--config-color-focus-hover:#ff729b;--config-color-focus-glow:#fce5ec;--config-color-focus-dark:#c52653;--config-color-normal:#40404c;--config-color-dark:#313131;--config-color-fade:#8f8f8f;--config-color-fade-dark:#6e6e6e;--config-color-fade-light:#e2e2e2;--config-color-fade-super:#f1f3f5;--config-color-danger:#f53d3d;--config-color-success:#1bbf61;--config-color-warning:#fffbdd;--config-color-info:#386fd2;--config-color-chart:#29b5d9;--config-color-chart-fade:#d4f0f7;--config-border-color:#f3f3f3;--config-border-fade:#e0e3e4;--config-border-fade-super:#f7f7f7;--config-border-radius:10px;--config-prism-background:#373738;--config-prism-numbers:#39393c;--config-note-background:#f1fbff;--config-note-border:#5bceff;--config-warning-background:#fdf7d9;--config-warning-border:#f8e380;--config-social-twitter:#1da1f2;--config-social-github:#000000;--config-social-discord:#7189dc;--config-social-facebook:#4070b4;--config-language-bash:#2b2626;--config-language-bash-contrast:#fff;--config-language-javascript:#fff054;--config-language-javascript-contrast:#333232;--config-language-web:#fff054;--config-language-web-contrast:#333232;--config-language-html:#ff895b;--config-language-html-contrast:#ffffff;--config-language-yaml:#ca3333;--config-language-yaml-contrast:#ffffff;--config-language-php:#6182bb;--config-language-php-contrast:#ffffff;--config-language-nodejs:#8cc500;--config-language-nodejs-contrast:#ffffff;--config-language-ruby:#fc3f48;--config-language-ruby-contrast:#ffffff;--config-language-python:#3873a2;--config-language-python-contrast:#ffffff;--config-language-go:#00add8;--config-language-go-contrast:#ffffff;--config-language-dart:#035698;--config-language-dart-contrast:#ffffff;--config-language-flutter:#035698;--config-language-flutter-contrast:#ffffff;--config-language-android:#a4c439;--config-language-android-contrast:#ffffff;--config-language-kotlin:#766DB2;--config-language-kotlin-contrast:#ffffff;--config-language-swift:#f2624c;--config-language-swift-contrast:#ffffff;--config-language-java:#0074bd;--config-language-java-contrast:#ffffff;--config-modal-note-background:#f5fbff;--config-modal-note-border:#eaf2f7;--config-modal-note-color:#3b5d73;--config-switch-background:#e2e2e2;--config-console-background:#eceff1;--config-console-nav-start:#143650;--config-console-nav-end:#302839;--config-console-nav-border:#2a253a;--config-console-nav-switch-background:#ececec;--config-console-nav-switch-color:#868686;--config-console-nav-switch-arrow:url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'><path fill='%23868686' d='M7.406 7.828l4.594 4.594 4.594-4.594 1.406 1.406-6 6-6-6z'></path></svg>")}:root .theme-dark{--config-color-primary:#f02e65;--config-color-background:#061F2F;--config-color-background-dark:#262d50;--config-color-background-fade:#1c223a;--config-color-background-fade-super:#1a1f35;--config-color-background-focus:#1a1f35;--config-color-background-input:#dce8f5;--config-color-tooltip-text:#061F2F;--config-color-tooltip-background:#dce8f5;--config-color-link:#4caedb;--config-color-placeholder:#9ea1af;--config-color-focus:#c7d8eb;--config-color-focus-fade:#1e233e;--config-color-focus-hover:#d3deea;--config-color-focus-glow:#d3deea;--config-color-focus-dark:#657586;--config-color-normal:#c7d8eb;--config-color-dark:#c7d8eb;--config-color-fade:#bec3e0;--config-color-fade-dark:#81859b;--config-color-fade-light:#181818;--config-color-fade-super:#262D50;--config-color-danger:#d84a4a;--config-color-success:#34b86d;--config-color-warning:#e0d56d;--config-color-info:#386fd2;--config-color-chart:#29b5d9;--config-color-chart-fade:#c7d8eb;--config-border-color:#262D50;--config-border-fade:#19203a;--config-border-fade-super:#262D50;--config-prism-background:#1F253F;--config-prism-numbers:#1F253F;--config-note-background:#171e33;--config-note-border:#262D50;--config-warning-background:#1F253F;--config-warning-border:#262D50;--config-social-twitter:var(--config-color-normal);--config-social-github:var(--config-color-normal);--config-social-discord:var(--config-color-normal);--config-social-facebook:var(--config-color-normal);--config-language-bash:var(--config-color-normal);--config-Line truncated
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
.pull-start{float:right}.pull-end{float:left}img[src=""]{visibility:hidden;display:inline-block}:root{--config-width:910px;--config-width-xxl:1000px;--config-width-xl:910px;--config-width-large:700px;--config-width-medium:550px;--config-width-small:320px;--config-color-primary:#f02e65;--config-color-link:#1e849e;--config-color-background:#eceff1;--config-color-background-dark:#dfe2e4;--config-color-background-fade:#ffffff;--config-color-background-fade-super:#fdfdfd;--config-color-background-focus:#f5f5f5;--config-color-background-input:#ffffff;--config-color-placeholder:#868686;--config-color-tooltip-text:#dce8f5;--config-color-tooltip-background:#333333;--config-color-focus:#f02e65;--config-color-focus-fade:#fef8fa;--config-color-focus-hover:#ff729b;--config-color-focus-glow:#fce5ec;--config-color-focus-dark:#c52653;--config-color-normal:#40404c;--config-color-dark:#313131;--config-color-fade:#8f8f8f;--config-color-fade-dark:#6e6e6e;--config-color-fade-light:#e2e2e2;--config-color-fade-super:#f1f3f5;--config-color-danger:#f53d3d;--config-color-success:#1bbf61;--config-color-warning:#fffbdd;--config-color-info:#386fd2;--config-color-chart:#29b5d9;--config-color-chart-fade:#d4f0f7;--config-border-color:#f3f3f3;--config-border-fade:#e0e3e4;--config-border-fade-super:#f7f7f7;--config-border-radius:10px;--config-prism-background:#373738;--config-prism-numbers:#39393c;--config-note-background:#f1fbff;--config-note-border:#5bceff;--config-warning-background:#fdf7d9;--config-warning-border:#f8e380;--config-social-twitter:#1da1f2;--config-social-github:#000000;--config-social-discord:#7189dc;--config-social-facebook:#4070b4;--config-language-bash:#2b2626;--config-language-bash-contrast:#fff;--config-language-javascript:#fff054;--config-language-javascript-contrast:#333232;--config-language-web:#fff054;--config-language-web-contrast:#333232;--config-language-html:#ff895b;--config-language-html-contrast:#ffffff;--config-language-yaml:#ca3333;--config-language-yaml-contrast:#ffffff;--config-language-php:#6182bb;--config-language-php-contrast:#ffffff;--config-language-nodejs:#8cc500;--config-language-nodejs-contrast:#ffffff;--config-language-ruby:#fc3f48;--config-language-ruby-contrast:#ffffff;--config-language-python:#3873a2;--config-language-python-contrast:#ffffff;--config-language-go:#00add8;--config-language-go-contrast:#ffffff;--config-language-dart:#035698;--config-language-dart-contrast:#ffffff;--config-language-flutter:#035698;--config-language-flutter-contrast:#ffffff;--config-language-android:#a4c439;--config-language-android-contrast:#ffffff;--config-language-kotlin:#766DB2;--config-language-kotlin-contrast:#ffffff;--config-language-swift:#f2624c;--config-language-swift-contrast:#ffffff;--config-language-java:#0074bd;--config-language-java-contrast:#ffffff;--config-modal-note-background:#f5fbff;--config-modal-note-border:#eaf2f7;--config-modal-note-color:#3b5d73;--config-switch-background:#e2e2e2;--config-console-background:#eceff1;--config-console-nav-start:#143650;--config-console-nav-end:#302839;--config-console-nav-border:#2a253a;--config-console-nav-switch-background:#ececec;--config-console-nav-switch-color:#868686;--config-console-nav-switch-arrow:url("data:image/svg+xml;utf8,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' width='24' height='24' viewBox='0 0 24 24'><path fill='%23868686' d='M7.406 7.828l4.594 4.594 4.594-4.594 1.406 1.406-6 6-6-6z'></path></svg>")}:root .theme-dark{--config-color-primary:#f02e65;--config-color-background:#061F2F;--config-color-background-dark:#262d50;--config-color-background-fade:#1c223a;--config-color-background-fade-super:#1a1f35;--config-color-background-focus:#1a1f35;--config-color-background-input:#dce8f5;--config-color-tooltip-text:#061F2F;--config-color-tooltip-background:#dce8f5;--config-color-link:#4caedb;--config-color-placeholder:#9ea1af;--config-color-focus:#c7d8eb;--config-color-focus-fade:#1e233e;--config-color-focus-hover:#d3deea;--config-color-focus-glow:#d3deea;--config-color-focus-dark:#657586;--config-color-normal:#c7d8eb;--config-color-dark:#c7d8eb;--config-color-fade:#bec3e0;--config-color-fade-dark:#81859b;--config-color-fade-light:#181818;--config-color-fade-super:#262D50;--config-color-danger:#d84a4a;--config-color-success:#34b86d;--config-color-warning:#e0d56d;--config-color-info:#386fd2;--config-color-chart:#29b5d9;--config-color-chart-fade:#c7d8eb;--config-border-color:#262D50;--config-border-fade:#19203a;--config-border-fade-super:#262D50;--config-prism-background:#1F253F;--config-prism-numbers:#1F253F;--config-note-background:#171e33;--config-note-border:#262D50;--config-warning-background:#1F253F;--config-warning-border:#262D50;--config-social-twitter:var(--config-color-normal);--config-social-github:var(--config-color-normal);--config-social-discord:var(--config-color-normal);--config-social-facebook:var(--config-color-normal);--config-language-bash:var(--config-color-normal);--config-Line truncated
|
||||
@@ -199,7 +199,7 @@
|
||||
*
|
||||
* Use this endpoint to allow a new user to register a new account in your
|
||||
* project. After the user registration completes successfully, you can use
|
||||
* the [/account/verfication](/docs/client/account#accountCreateVerification)
|
||||
* the [/account/verification](/docs/client/account#accountCreateVerification)
|
||||
* route to start verifying the user email address. To allow the new user to
|
||||
* login to their new account, you need to create a new [account
|
||||
* session](/docs/client/account#accountCreateSession).
|
||||
@@ -4529,7 +4529,7 @@
|
||||
* Update Team Membership Status
|
||||
*
|
||||
* Use this endpoint to allow a user to accept an invitation to join a team
|
||||
* after being redirected back to your app from the invitation email recieved
|
||||
* after being redirected back to your app from the invitation email received
|
||||
* by the user.
|
||||
*
|
||||
* @param {string} teamId
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
||||
/*https://github.com/jaredreich/pell*/!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.pell={})}(this,function(t){"use strict";var e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},n=function(t,e,n){return t.addEventListener(e,n)},r=function(t,e){return t.appendChild(e)},i=function(t){return document.createElement(t)},o=function(t){return document.queryCommandState(t)},u=function(t){return document.queryCommandValue(t)},c=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return document.execCommand(t,!1,e)},l={bold:{icon:"<b>B</b>",title:"Bold",state:function(){return o("bold")},result:function(){return c("bold")}},italic:{icon:"<i>I</i>",title:"Italic",state:function(){return o("italic")},result:function(){return c("italic")}},underline:{icon:"<u>U</u>",title:"Underline",state:function(){return o("underline")},result:function(){return c("underline")}},strikethrough:{icon:"<strike>S</strike>",title:"Strike-through",state:function(){return o("strikeThrough")},result:function(){return c("strikeThrough")}},heading1:{icon:"<b>H<sub>1</sub></b>",title:"Heading 1",result:function(){return c("formatBlock","<h1>")}},heading2:{icon:"<b>H<sub>2</sub></b>",title:"Heading 2",result:function(){return c("formatBlock","<h2>")}},paragraph:{icon:"¶",title:"Paragraph",result:function(){return c("formatBlock","<p>")}},quote:{icon:"“ ”",title:"Quote",result:function(){return c("formatBlock","<blockquote>")}},olist:{icon:"#",title:"Ordered List",result:function(){return c("insertOrderedList")}},ulist:{icon:"•",title:"Unordered List",result:function(){return c("insertUnorderedList")}},code:{icon:"</>",title:"Code",result:function(){return c("formatBlock","<pre>")}},line:{icon:"―",title:"Horizontal Line",result:function(){return c("insertHorizontalRule")}},link:{icon:"🔗",title:"Link",result:function(){var t=window.prompt("Enter the link URL");t&&c("createLink",t)}},image:{icon:"📷",title:"Image",result:function(){var t=window.prompt("Enter the image URL");t&&c("insertImage",t)}}},a={actionbar:"pell-actionbar",button:"pell-button",content:"pell-content",selected:"pell-button-selected"},s=function(t){var o=t.actions?t.actions.map(function(t){return"string"==typeof t?l[t]:l[t.name]?e({},l[t.name],t):t}):Object.keys(l).map(function(t){return l[t]}),s=e({},a,t.classes),f=t.defaultParagraphSeparator||"div",d=i("div");d.className=s.actionbar,r(t.element,d);var m=t.element.content=i("div");return m.contentEditable=!0,m.className=s.content,m.oninput=function(e){var n=e.target.firstChild;n&&3===n.nodeType?c("formatBlock","<"+f+">"):"<br>"===m.innerHTML&&(m.innerHTML=""),t.onChange(m.innerHTML)},m.onkeydown=function(t){"Tab"===t.key?t.preventDefault():"Enter"===t.key&&"blockquote"===u("formatBlock")&&setTimeout(function(){return c("formatBlock","<"+f+">")},0)},r(t.element,m),o.forEach(function(t){var e=i("button");if(e.className=s.button,e.innerHTML=t.icon,e.title=t.title,e.setAttribute("type","button"),e.onclick=function(){return t.result()&&m.focus()},t.state){var o=function(){return e.classList[t.state()?"add":"remove"](s.selected)};n(m,"keyup",o),n(m,"mouseup",o),n(e,"click",o)}r(d,e)}),t.styleWithCSS&&c("styleWithCSS"),c("defaultParagraphSeparator",f),t.element},f={exec:c,init:s};t.exec=c,t.init=s,t.default=f,Object.defineProperty(t,"__esModule",{value:!0})});
|
||||
@@ -1,25 +0,0 @@
|
||||
/* PrismJS 1.23.0
|
||||
https://prismjs.com/download.html#themes=prism-okaidia&languages=markup+css+clike+javascript+bash+csharp+dart+go+graphql+http+java+json+kotlin+markup-templating+php+powershell+python+ruby+swift+typescript+yaml&plugins=line-numbers */
|
||||
var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(u){var c=/\blang(?:uage)?-([\w-]+)\b/i,n=0,M={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof W?new W(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function r(e,t){var a,n;switch(t=t||{},M.util.type(e)){case"Object":if(n=M.util.objId(e),t[n])return t[n];for(var i in a={},t[n]=a,e)e.hasOwnProperty(i)&&(a[i]=r(e[i],t));return a;case"Array":return n=M.util.objId(e),t[n]?t[n]:(a=[],t[n]=a,e.forEach(function(e,n){a[n]=r(e,t)}),a);default:return e}},getLanguage:function(e){for(;e&&!c.test(e.className);)e=e.parentElement;return e?(e.className.match(c)||[,"none"])[1].toLowerCase():"none"},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(e){var n=(/at [^(\r\n]*\((.*):.+:.+\)$/i.exec(e.stack)||[])[1];if(n){var r=document.getElementsByTagName("script");for(var t in r)if(r[t].src==n)return r[t]}return null}},isActive:function(e,n,r){for(var t="no-"+n;e;){var a=e.classList;if(a.contains(n))return!0;if(a.contains(t))return!1;e=e.parentElement}return!!r}},languages:{extend:function(e,n){var r=M.util.clone(M.languages[e]);for(var t in n)r[t]=n[t];return r},insertBefore:function(r,e,n,t){var a=(t=t||M.languages)[r],i={};for(var l in a)if(a.hasOwnProperty(l)){if(l==e)for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o]);n.hasOwnProperty(l)||(i[l]=a[l])}var s=t[r];return t[r]=i,M.languages.DFS(M.languages,function(e,n){n===s&&e!=r&&(this[e]=i)}),i},DFS:function e(n,r,t,a){a=a||{};var i=M.util.objId;for(var l in n)if(n.hasOwnProperty(l)){r.call(n,l,n[l],t||l);var o=n[l],s=M.util.type(o);"Object"!==s||a[i(o)]?"Array"!==s||a[i(o)]||(a[i(o)]=!0,e(o,r,l,a)):(a[i(o)]=!0,e(o,r,null,a))}}},plugins:{},highlightAll:function(e,n){M.highlightAllUnder(document,e,n)},highlightAllUnder:function(e,n,r){var t={callback:r,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};M.hooks.run("before-highlightall",t),t.elements=Array.prototype.slice.apply(t.container.querySelectorAll(t.selector)),M.hooks.run("before-all-elements-highlight",t);for(var a,i=0;a=t.elements[i++];)M.highlightElement(a,!0===n,t.callback)},highlightElement:function(e,n,r){var t=M.util.getLanguage(e),a=M.languages[t];e.className=e.className.replace(c,"").replace(/\s+/g," ")+" language-"+t;var i=e.parentElement;i&&"pre"===i.nodeName.toLowerCase()&&(i.className=i.className.replace(c,"").replace(/\s+/g," ")+" language-"+t);var l={element:e,language:t,grammar:a,code:e.textContent};function o(e){l.highlightedCode=e,M.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,M.hooks.run("after-highlight",l),M.hooks.run("complete",l),r&&r.call(l.element)}if(M.hooks.run("before-sanity-check",l),!l.code)return M.hooks.run("complete",l),void(r&&r.call(l.element));if(M.hooks.run("before-highlight",l),l.grammar)if(n&&u.Worker){var s=new Worker(M.filename);s.onmessage=function(e){o(e.data)},s.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else o(M.highlight(l.code,l.grammar,l.language));else o(M.util.encode(l.code))},highlight:function(e,n,r){var t={code:e,grammar:n,language:r};return M.hooks.run("before-tokenize",t),t.tokens=M.tokenize(t.code,t.grammar),M.hooks.run("after-tokenize",t),W.stringify(M.util.encode(t.tokens),t.language)},tokenize:function(e,n){var r=n.rest;if(r){for(var t in r)n[t]=r[t];delete n.rest}var a=new i;return I(a,a.head,e),function e(n,r,t,a,i,l){for(var o in t)if(t.hasOwnProperty(o)&&t[o]){var s=t[o];s=Array.isArray(s)?s:[s];for(var u=0;u<s.length;++u){if(l&&l.cause==o+","+u)return;var c=s[u],g=c.inside,f=!!c.lookbehind,h=!!c.greedy,d=c.alias;if(h&&!c.pattern.global){var v=c.pattern.toString().match(/[imsuy]*$/)[0];c.pattern=RegExp(c.pattern.source,v+"g")}for(var p=c.pattern||c,m=a.next,y=i;m!==r.tail&&!(l&&y>=l.reach);y+=m.value.length,m=m.next){var k=m.value;if(r.length>n.length)return;if(!(k instanceof W)){var b,x=1;if(h){if(!(b=z(p,y,n,f)))break;var w=b.index,A=b.index+b[0].length,P=y;for(P+=m.value.length;P<=w;)m=m.next,P+=m.value.length;if(P-=m.value.length,y=P,m.value instanceof W)continue;for(var S=m;S!==r.tail&&(P<A||"string"==typeof S.value);S=S.next)x++,P+=S.value.length;x--,k=n.slice(y,P),b.index-=y}else if(!(b=z(p,0,k,f)))continue;var w=b.index,E=b[0],O=k.slice(0,w),L=k.slice(w+E.length),N=y+k.length;l&&N>l.reach&&(l.reach=N);var j=m.prev;O&&(j=I(r,j,O),y+=O.length),q(r,j,x);var C=new W(o,g?M.tokenize(E,g):E,d,E);if(m=I(r,j,C),L&&I(r,m,L),1<x){var _={cause:o+","+u,reach:Line truncated
|
||||
Prism.languages.markup={comment:/<!--[\s\S]*?-->/,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/,name:/[^\s<>'"]+/}},cdata:/<!\[CDATA\[[\s\S]*?]]>/i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(a,e){var s={};s["language-"+e]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[e]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var n={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};n["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var t={};t[a]={pattern:RegExp("(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[^])*?(?=</__>)".replace(/__/g,function(){return a}),"i"),lookbehind:!0,greedy:!0,inside:n},Prism.languages.insertBefore("markup","cdata",t)}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml;
|
||||
!function(s){var e=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;s.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|(?:[^\\\\\r\n()\"']|\\\\[^])*)\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:RegExp("[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),string:{pattern:e,greedy:!0},property:/(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,important:/!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},s.languages.css.atrule.inside.rest=s.languages.css;var t=s.languages.markup;t&&(t.tag.addInlined("style","css"),s.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/(^|["'\s])style\s*=\s*(?:"[^"]*"|'[^']*')/i,lookbehind:!0,inside:{"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{style:{pattern:/(["'])[\s\S]+(?=["']$)/,lookbehind:!0,alias:"language-css",inside:s.languages.css},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},"attr-name":/^style/i}}},t.tag))}(Prism);
|
||||
Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(?:true|false)\b/,function:/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};
|
||||
Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-flags":/[a-z]+$/,"regex-delimiter":/^\/|\/$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.js=Prism.languages.javascript;
|
||||
!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},a={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)\w+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b\w+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+?)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:a},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)(["'])(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|(?!\2)[^\\`$])*\2/,lookbehind:!0,greedy:!0,inside:a}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:a.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|aptitude|apt-cache|apt-get|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:if|then|else|elif|fi|for|while|in|case|esac|function|select|do|done|until)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|break|cd|continue|eval|exec|exit|export|getopts|hash|pwd|readonly|return|shift|test|times|trap|umask|unset|alias|bind|builtin|caller|command|declare|echo|enable|help|let|local|logout|mapfile|printf|read|readarray|souLine truncated
|
||||
!function(s){function a(e,s){return e.replace(/<<(\d+)>>/g,function(e,n){return"(?:"+s[+n]+")"})}function t(e,n,s){return RegExp(a(e,n),s||"")}function e(e,n){for(var s=0;s<n;s++)e=e.replace(/<<self>>/g,function(){return"(?:"+e+")"});return e.replace(/<<self>>/g,"[^\\s\\S]")}var n="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",i="class enum interface struct",r="add alias and ascending async await by descending from get global group into join let nameof not notnull on or orderby partial remove select set unmanaged value when where",o="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var d=l(i),p=RegExp(l(n+" "+i+" "+r+" "+o)),c=l(i+" "+r+" "+o),u=l(n+" "+i+" "+o),g=e("<(?:[^<>;=+\\-*/%&|^]|<<self>>)*>",2),b=e("\\((?:[^()]|<<self>>)*\\)",2),h="@?\\b[A-Za-z_]\\w*\\b",f=a("<<0>>(?:\\s*<<1>>)?",[h,g]),m=a("(?!<<0>>)<<1>>(?:\\s*\\.\\s*<<1>>)*",[c,f]),k="\\[\\s*(?:,\\s*)*\\]",y=a("<<0>>(?:\\s*(?:\\?\\s*)?<<1>>)*(?:\\s*\\?)?",[m,k]),w=a("(?:<<0>>|<<1>>)(?:\\s*(?:\\?\\s*)?<<2>>)*(?:\\s*\\?)?",[a("\\(<<0>>+(?:,<<0>>+)+\\)",[a("[^,()<>[\\];=+\\-*/%&|^]|<<0>>|<<1>>|<<2>>",[g,b,k])]),m,k]),v={keyword:p,punctuation:/[<>()?,.:[\]]/},x="'(?:[^\r\n'\\\\]|\\\\.|\\\\[Uux][\\da-fA-F]{1,8})'",$='"(?:\\\\.|[^\\\\"\r\n])*"';s.languages.csharp=s.languages.extend("clike",{string:[{pattern:t("(^|[^$\\\\])<<0>>",['@"(?:""|\\\\[^]|[^\\\\"])*"(?!")']),lookbehind:!0,greedy:!0},{pattern:t("(^|[^@$\\\\])<<0>>",[$]),lookbehind:!0,greedy:!0},{pattern:RegExp(x),greedy:!0,alias:"character"}],"class-name":[{pattern:t("(\\busing\\s+static\\s+)<<0>>(?=\\s*;)",[m]),lookbehind:!0,inside:v},{pattern:t("(\\busing\\s+<<0>>\\s*=\\s*)<<1>>(?=\\s*;)",[h,w]),lookbehind:!0,inside:v},{pattern:t("(\\busing\\s+)<<0>>(?=\\s*=)",[h]),lookbehind:!0},{pattern:t("(\\b<<0>>\\s+)<<1>>",[d,f]),lookbehind:!0,inside:v},{pattern:t("(\\bcatch\\s*\\(\\s*)<<0>>",[m]),lookbehind:!0,inside:v},{pattern:t("(\\bwhere\\s+)<<0>>",[h]),lookbehind:!0},{pattern:t("(\\b(?:is(?:\\s+not)?|as)\\s+)<<0>>",[y]),lookbehind:!0,inside:v},{pattern:t("\\b<<0>>(?=\\s+(?!<<1>>)<<2>>(?:\\s*[=,;:{)\\]]|\\s+(?:in|when)\\b))",[w,u,h]),inside:v}],keyword:p,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:ul|lu|[dflmu])?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),s.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),s.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:t("([(,]\\s*)<<0>>(?=\\s*:)",[h]),lookbehind:!0,alias:"punctuation"}}),s.languages.insertBefore("csharp","class-name",{namespace:{pattern:t("(\\b(?:namespace|using)\\s+)<<0>>(?:\\s*\\.\\s*<<0>>)*(?=\\s*[;{])",[h]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:t("(\\b(?:default|typeof|sizeof)\\s*\\(\\s*(?!\\s))(?:[^()\\s]|\\s(?!\\s)|<<0>>)*(?=\\s*\\))",[b]),lookbehind:!0,alias:"class-name",inside:v},"return-type":{pattern:t("<<0>>(?=\\s+(?:<<1>>\\s*(?:=>|[({]|\\.\\s*this\\s*\\[)|this\\s*\\[))",[w,m]),inside:v,alias:"class-name"},"constructor-invocation":{pattern:t("(\\bnew\\s+)<<0>>(?=\\s*[[({])",[w]),lookbehind:!0,inside:v,alias:"class-name"},"generic-method":{pattern:t("<<0>>\\s*<<1>>(?=\\s*\\()",[h,g]),inside:{function:t("^<<0>>",[h]),generic:{pattern:RegExp(g),alias:"class-name",inside:v}}},"type-list":{pattern:t("\\b((?:<<0>>\\s+<<1>>|where\\s+<<2>>)\\s*:\\s*)(?:<<3>>|<<4>>)(?:\\s*,\\s*(?:<<3>>|<<4>>))*(?=\\s*(?:where|[{;]|=>|$))",[d,f,h,w,p.source]),lookbehind:!0,inside:{keyword:p,"class-name":{pattern:RegExp(w),greedy:!0,inside:v},punctuation:/,/}},preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(\s*#)\b(?:define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var _=$+"|"+x,B=a("/(?![*/])|//[^\r\n]*[\r\n]|/\\*(?:[^*]|\\*(?!/))*\\*/|<<0>>",[_]),E=e(a("[^\"'/()]|<<0>>|\\(<<self>>*\\)",[B]),2),R="\\b(?:assembly|event|field|method|module|param|property|return|type)\\b",P=a("<<0>>(?:\\s*\\(<<1>>*\\))?",[m,E]);s.languages.insertBefore("csharp","class-name",{attribute:{pattern:t("((?:^|[^\\s\\w>)?])\\s*\\[\\s*)(?:<<0>>\\s*:\\s*)?<<1>>(?:\\s*,\\s*<<1>>)*(?=\\s*\\])",[R,P]),lookbehind:!0,greedy:!0,inside:{target:{pattern:t("^<<0>>(?=\\s*:)",[R]),alias:"keyword"},"attribute-arguments":{pattern:t("\\(<<0>>*\\)",[E]),inside:s.languages.csharp},"class-name":{pattern:RegExp(m),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var z=":[^}\r\n]+",S=e(a("[^\"'/()]|<<0>>|\\(<<self>>*Line truncated
|
||||
Prism.languages.dart=Prism.languages.extend("clike",{string:[{pattern:/r?("""|''')[\s\S]*?\1/,greedy:!0},{pattern:/r?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0}],keyword:[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extension|external|extends|factory|final|finally|for|Function|get|hide|if|implements|interface|import|in|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),Prism.languages.insertBefore("dart","function",{metadata:{pattern:/@\w+/,alias:"symbol"}});
|
||||
Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|iota|nil|true|false)\b/,number:/(?:\b0x[a-f\d]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[-+]?\d+)?)i?/i,operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:bool|byte|complex(?:64|128)|error|float(?:32|64)|rune|string|u?int(?:8|16|32|64)?|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(?:ln)?|real|recover)\b/}),delete Prism.languages.go["class-name"];
|
||||
Prism.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:Prism.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:true|false)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*)[a-zA-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,punctuation:/[!(){}\[\]:=,]/,constant:/\b(?!ID\b)[A-Z][A-Z_\d]*\b/};
|
||||
!function(t){t.languages.http={"request-line":{pattern:/^(?:GET|HEAD|POST|PUT|DELETE|CONNECT|OPTIONS|TRACE|PATCH|PRI|SEARCH)\s(?:https?:\/\/|\/)\S*\sHTTP\/[0-9.]+/m,inside:{method:{pattern:/^[A-Z]+\b/,alias:"property"},"request-target":{pattern:/^(\s)(?:https?:\/\/|\/)\S*(?=\s)/,lookbehind:!0,alias:"url",inside:t.languages.uri},"http-version":{pattern:/^(\s)HTTP\/[0-9.]+/,lookbehind:!0,alias:"property"}}},"response-status":{pattern:/^HTTP\/[0-9.]+ \d+ .+/m,inside:{"http-version":{pattern:/^HTTP\/[0-9.]+/,alias:"property"},"status-code":{pattern:/^(\s)\d+(?=\s)/,lookbehind:!0,alias:"number"},"reason-phrase":{pattern:/^(\s).+/,lookbehind:!0,alias:"string"}}},"header-name":{pattern:/^[\w-]+:(?=.)/m,alias:"keyword"}};var a,e,s,n=t.languages,i={"application/javascript":n.javascript,"application/json":n.json||n.javascript,"application/xml":n.xml,"text/xml":n.xml,"text/html":n.html,"text/css":n.css},r={"application/json":!0,"application/xml":!0};for(var p in i)if(i[p]){a=a||{};var o=r[p]?(void 0,s=(e=p).replace(/^[a-z]+\//,""),"(?:"+e+"|\\w+/(?:[\\w.-]+\\+)+"+s+"(?![+\\w.-]))"):p;a[p.replace(/\//g,"-")]={pattern:RegExp("(content-type:\\s*"+o+".*)(?:\\r?\\n|\\r){2}[\\s\\S]*","i"),lookbehind:!0,inside:i[p]}}a&&t.languages.insertBefore("http","header-name",a)}(Prism);
|
||||
!function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n="(^|[^\\w.])(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*",a={pattern:RegExp(n+"[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b"),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{"class-name":[a,{pattern:RegExp(n+"[A-Z]\\w*(?=\\s+\\w+\\s*[;,=())])"),lookbehind:!0,inside:a.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(\:\:\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0}}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":a,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},namespace:{pattern:RegExp("(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?".replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism);
|
||||
Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json;
|
||||
!function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"],e.languages.insertBefore("kotlin","string",{"raw-string":{pattern:/("""|''')[\s\S]*?\1/,alias:"string"}}),e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\w+@|@\w+/,alias:"symbol"}});var n=[{pattern:/\$\{[^}]+\}/,inside:{delimiter:{pattern:/^\$\{|\}$/,alias:"variable"},rest:e.languages.kotlin}},{pattern:/\$\w+/,alias:"variable"}];e.languages.kotlin.string.inside=e.languages.kotlin["raw-string"].inside={interpolation:n},e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(Prism);
|
||||
!function(h){function v(e,n){return"___"+e.toUpperCase()+n+"___"}Object.defineProperties(h.languages["markup-templating"]={},{buildPlaceholders:{value:function(a,r,e,o){if(a.language===r){var c=a.tokenStack=[];a.code=a.code.replace(e,function(e){if("function"==typeof o&&!o(e))return e;for(var n,t=c.length;-1!==a.code.indexOf(n=v(r,t));)++t;return c[t]=e,n}),a.grammar=h.languages.markup}}},tokenizePlaceholders:{value:function(p,k){if(p.language===k&&p.tokenStack){p.grammar=h.languages[k];var m=0,d=Object.keys(p.tokenStack);!function e(n){for(var t=0;t<n.length&&!(m>=d.length);t++){var a=n[t];if("string"==typeof a||a.content&&"string"==typeof a.content){var r=d[m],o=p.tokenStack[r],c="string"==typeof a?a:a.content,i=v(k,r),u=c.indexOf(i);if(-1<u){++m;var g=c.substring(0,u),l=new h.Token(k,h.tokenize(o,p.grammar),"language-"+k,o),s=c.substring(u+i.length),f=[];g&&f.push.apply(f,e([g])),f.push(l),s&&f.push.apply(f,e([s])),"string"==typeof a?n.splice.apply(n,[t,1].concat(f)):a.content=f}}else a.content&&e(a.content)}return n}(p.tokens)}}}})}(Prism);
|
||||
!function(a){var e=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,t=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/,/\b(?:null)\b/i],i=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,n=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,s=/[{}\[\](),:;]/;a.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:e,variable:/\$+(?:\w+\b|(?={))/i,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},keyword:[{pattern:/(\(\s*)\b(?:bool|boolean|int|integer|float|string|object|array)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:bool|int|float|string|object|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*[a-z0-9_|]\|\s*)(?:null|false)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|self|static|callable|iterable|(?:null|false)(?=\s*\|))\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?[a-z0-9_|]\|\s*)(?:null|false)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:bool|int|float|string|object|void|array(?!\s*\()|mixed|iterable|(?:null|false)(?=\s*\|))\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:null|false)\b/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},/\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|match|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i],"argument-name":/\b[a-z_]\w*(?=\s*:(?!:))/i,"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:t,function:/\w+\s*(?=\()/,property:{pattern:/(->)[\w]+/,lookbehind:!0},number:i,operator:n,punctuation:s};var l={pattern:/{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)*)/,lookbehind:!0,inside:a.languages.php},r=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:l}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:l}}];a.languages.insertBefore("php","variable",{string:r}),a.languLine truncated
|
||||
!function(e){var i=Prism.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:{function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:{}}}},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*]|[^\[\]])*]|[^\[\]])*]/i,boolean:/\$(?:true|false)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(\W?)(?:!|-(?:eq|ne|gt|ge|lt|le|sh[lr]|not|b?(?:and|x?or)|(?:Not)?(?:Like|Match|Contains|In)|Replace|Join|is(?:Not)?|as)\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/},r=i.string[0].inside;r.boolean=i.boolean,r.variable=i.variable,r.function.inside=i}();
|
||||
Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"string-interpolation":{pattern:/(?:f|rf|fr)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:{{)*){(?!{)(?:[^{}]|{(?!{)(?:[^{}]|{(?!{)(?:[^{}])+})+})+}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|rb|br)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^\s*)@\w+(?:\.\w+)*/im,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:True|False|None)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python;
|
||||
!function(e){e.languages.ruby=e.languages.extend("clike",{comment:[/#.*/,{pattern:/^=begin\s[\s\S]*?^=end/m,greedy:!0}],"class-name":{pattern:/(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/});var n={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:e.languages.ruby}};delete e.languages.ruby.function,e.languages.insertBefore("ruby","keyword",{regex:[{pattern:RegExp("%r(?:"+["([^a-zA-Z0-9\\s{(\\[<])(?:(?!\\1)[^\\\\]|\\\\[^])*\\1[gim]{0,3}","\\((?:[^()\\\\]|\\\\[^])*\\)[gim]{0,3}","\\{(?:[^#{}\\\\]|#(?:\\{[^}]+\\})?|\\\\[^])*\\}[gim]{0,3}","\\[(?:[^\\[\\]\\\\]|\\\\[^])*\\][gim]{0,3}","<(?:[^<>\\\\]|\\\\[^])*>[gim]{0,3}"].join("|")+")"),greedy:!0,inside:{interpolation:n}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[gim]{0,3}(?=\s*(?:$|[\r\n,.;})]))/,lookbehind:!0,greedy:!0}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:{pattern:/(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/,lookbehind:!0},"method-definition":{pattern:/(\bdef\s+)[\w.]+/,lookbehind:!0,inside:{function:/\w+$/,rest:e.languages.ruby}}}),e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z]\w*(?:[?!]|\b)/}),e.languages.ruby.string=[{pattern:RegExp("%[qQiIwWxs]?(?:"+["([^a-zA-Z0-9\\s{(\\[<])(?:(?!\\1)[^\\\\]|\\\\[^])*\\1","\\((?:[^()\\\\]|\\\\[^])*\\)","\\{(?:[^#{}\\\\]|#(?:\\{[^}]+\\})?|\\\\[^])*\\}","\\[(?:[^\\[\\]\\\\]|\\\\[^])*\\]","<(?:[^<>\\\\]|\\\\[^])*>"].join("|")+")"),greedy:!0,inside:{interpolation:n}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:n}}],e.languages.rb=e.languages.ruby}(Prism);
|
||||
Prism.languages.swift=Prism.languages.extend("clike",{string:{pattern:/("|')(?:\\(?:\((?:[^()]|\([^)]+\))+\)|\r\n|[^(])|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{interpolation:{pattern:/\\\((?:[^()]|\([^)]+\))+\)/,inside:{delimiter:{pattern:/^\\\(|\)$/,alias:"variable"}}}}},keyword:/\b(?:as|associativity|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic(?:Type)?|else|enum|extension|fallthrough|final|for|func|get|guard|if|import|in|infix|init|inout|internal|is|lazy|left|let|mutating|new|none|nonmutating|operator|optional|override|postfix|precedence|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|Self|set|static|struct|subscript|super|switch|throws?|try|Type|typealias|unowned|unsafe|var|weak|where|while|willSet|__(?:COLUMN__|FILE__|FUNCTION__|LINE__))\b/,number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,constant:/\b(?:nil|[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,atrule:/@\b(?:IB(?:Outlet|Designable|Action|Inspectable)|class_protocol|exported|noreturn|NS(?:Copying|Managed)|objc|UIApplicationMain|auto_closure)\b/,builtin:/\b(?:[A-Z]\S+|abs|advance|alignof(?:Value)?|assert|contains|count(?:Elements)?|debugPrint(?:ln)?|distance|drop(?:First|Last)|dump|enumerate|equal|filter|find|first|getVaList|indices|isEmpty|join|last|lexicographicalCompare|map|max(?:Element)?|min(?:Element)?|numericCast|overlaps|partition|print(?:ln)?|reduce|reflect|reverse|sizeof(?:Value)?|sort(?:ed)?|split|startsWith|stride(?:of(?:Value)?)?|suffix|swap|toDebugString|toString|transcode|underestimateCount|unsafeBitCast|with(?:ExtendedLifetime|Unsafe(?:MutablePointers?|Pointers?)|VaList))\b/}),Prism.languages.swift.string.inside.interpolation.inside.rest=Prism.languages.swift;
|
||||
!function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},keyword:/\b(?:abstract|as|asserts|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|undefined|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/}),delete e.languages.typescript.parameter;var n=e.languages.extend("typescript",{});delete n["class-name"],e.languages.typescript["class-name"].inside=n,e.languages.insertBefore("typescript","function",{"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),e.languages.ts=e.languages.typescript}(Prism);
|
||||
!function(e){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,t="(?:"+r.source+"(?:[ \t]+"+n.source+")?|"+n.source+"(?:[ \t]+"+r.source+")?)",a="(?:[^\\s\\x00-\\x08\\x0e-\\x1f!\"#%&'*,\\-:>?@[\\]`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*".replace(/<PLAIN>/g,function(){return"[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]"}),d="\"(?:[^\"\\\\\r\n]|\\\\.)*\"|'(?:[^'\\\\\r\n]|\\\\.)*'";function o(e,n){n=(n||"").replace(/m/g,"")+"m";var r="([:\\-,[{]\\s*(?:\\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|]|}|(?:[\r\n]\\s*)?#))".replace(/<<prop>>/g,function(){return t}).replace(/<<value>>/g,function(){return e});return RegExp(r,n)}e.languages.yaml={scalar:{pattern:RegExp("([\\-:]\\s*(?:\\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\\S[^\r\n]*(?:\\2[^\r\n]+)*)".replace(/<<prop>>/g,function(){return t})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp("((?:^|[:\\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\\s*:\\s)".replace(/<<prop>>/g,function(){return t}).replace(/<<key>>/g,function(){return"(?:"+a+"|"+d+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o("\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?"),lookbehind:!0,alias:"number"},boolean:{pattern:o("true|false","i"),lookbehind:!0,alias:"important"},null:{pattern:o("null|~","i"),lookbehind:!0,alias:"important"},string:{pattern:o(d),lookbehind:!0,greedy:!0},number:{pattern:o("[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.?\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)","i"),lookbehind:!0},tag:r,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Prism);
|
||||
!function(){if("undefined"!=typeof self&&self.Prism&&self.document){var o="line-numbers",a=/\n(?!$)/g,e=Prism.plugins.lineNumbers={getLine:function(e,n){if("PRE"===e.tagName&&e.classList.contains(o)){var t=e.querySelector(".line-numbers-rows");if(t){var i=parseInt(e.getAttribute("data-start"),10)||1,r=i+(t.children.length-1);n<i&&(n=i),r<n&&(n=r);var s=n-i;return t.children[s]}}},resize:function(e){u([e])},assumeViewportIndependence:!0},t=function(e){return e?window.getComputedStyle?getComputedStyle(e):e.currentStyle||null:null},n=void 0;window.addEventListener("resize",function(){e.assumeViewportIndependence&&n===window.innerWidth||(n=window.innerWidth,u(Array.prototype.slice.call(document.querySelectorAll("pre."+o))))}),Prism.hooks.add("complete",function(e){if(e.code){var n=e.element,t=n.parentNode;if(t&&/pre/i.test(t.nodeName)&&!n.querySelector(".line-numbers-rows")&&Prism.util.isActive(n,o)){n.classList.remove(o),t.classList.add(o);var i,r=e.code.match(a),s=r?r.length+1:1,l=new Array(s+1).join("<span></span>");(i=document.createElement("span")).setAttribute("aria-hidden","true"),i.className="line-numbers-rows",i.innerHTML=l,t.hasAttribute("data-start")&&(t.style.counterReset="linenumber "+(parseInt(t.getAttribute("data-start"),10)-1)),e.element.appendChild(i),u([t]),Prism.hooks.run("line-numbers",e)}}}),Prism.hooks.add("line-numbers",function(e){e.plugins=e.plugins||{},e.plugins.lineNumbers=!0})}function u(e){if(0!=(e=e.filter(function(e){var n=t(e)["white-space"];return"pre-wrap"===n||"pre-line"===n})).length){var n=e.map(function(e){var n=e.querySelector("code"),t=e.querySelector(".line-numbers-rows");if(n&&t){var i=e.querySelector(".line-numbers-sizer"),r=n.textContent.split(a);i||((i=document.createElement("span")).className="line-numbers-sizer",n.appendChild(i)),i.innerHTML="0",i.style.display="block";var s=i.getBoundingClientRect().height;return i.innerHTML="",{element:e,lines:r,lineHeights:[],oneLinerHeight:s,sizer:i}}}).filter(Boolean);n.forEach(function(e){var i=e.sizer,n=e.lines,r=e.lineHeights,s=e.oneLinerHeight;r[n.length-1]=void 0,n.forEach(function(e,n){if(e&&1<e.length){var t=i.appendChild(document.createElement("span"));t.style.display="block",t.textContent=e}else r[n]=s})}),n.forEach(function(e){for(var n=e.sizer,t=e.lineHeights,i=0,r=0;r<t.length;r++)void 0===t[r]&&(t[r]=n.children[i++].getBoundingClientRect().height)}),n.forEach(function(e){var n=e.sizer,t=e.element.querySelector(".line-numbers-rows");n.style.display="none",n.innerHTML="",e.lineHeights.forEach(function(e,n){t.children[n].style.height=e+"px"})})}}}();
|
||||
@@ -1,932 +0,0 @@
|
||||
var TurndownService = (function () {
|
||||
'use strict';
|
||||
|
||||
function extend (destination) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
for (var key in source) {
|
||||
if (source.hasOwnProperty(key)) destination[key] = source[key];
|
||||
}
|
||||
}
|
||||
return destination
|
||||
}
|
||||
|
||||
function repeat (character, count) {
|
||||
return Array(count + 1).join(character)
|
||||
}
|
||||
|
||||
var blockElements = [
|
||||
'address', 'article', 'aside', 'audio', 'blockquote', 'body', 'canvas',
|
||||
'center', 'dd', 'dir', 'div', 'dl', 'dt', 'fieldset', 'figcaption',
|
||||
'figure', 'footer', 'form', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
|
||||
'header', 'hgroup', 'hr', 'html', 'isindex', 'li', 'main', 'menu', 'nav',
|
||||
'noframes', 'noscript', 'ol', 'output', 'p', 'pre', 'section', 'table',
|
||||
'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'ul'
|
||||
];
|
||||
|
||||
function isBlock (node) {
|
||||
return blockElements.indexOf(node.nodeName.toLowerCase()) !== -1
|
||||
}
|
||||
|
||||
var voidElements = [
|
||||
'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input',
|
||||
'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'
|
||||
];
|
||||
|
||||
function isVoid (node) {
|
||||
return voidElements.indexOf(node.nodeName.toLowerCase()) !== -1
|
||||
}
|
||||
|
||||
var voidSelector = voidElements.join();
|
||||
function hasVoid (node) {
|
||||
return node.querySelector && node.querySelector(voidSelector)
|
||||
}
|
||||
|
||||
var rules = {};
|
||||
|
||||
rules.paragraph = {
|
||||
filter: 'p',
|
||||
|
||||
replacement: function (content) {
|
||||
return '\n\n' + content + '\n\n'
|
||||
}
|
||||
};
|
||||
|
||||
rules.lineBreak = {
|
||||
filter: 'br',
|
||||
|
||||
replacement: function (content, node, options) {
|
||||
return options.br + '\n'
|
||||
}
|
||||
};
|
||||
|
||||
rules.heading = {
|
||||
filter: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
|
||||
|
||||
replacement: function (content, node, options) {
|
||||
var hLevel = Number(node.nodeName.charAt(1));
|
||||
|
||||
if (options.headingStyle === 'setext' && hLevel < 3) {
|
||||
var underline = repeat((hLevel === 1 ? '=' : '-'), content.length);
|
||||
return (
|
||||
'\n\n' + content + '\n' + underline + '\n\n'
|
||||
)
|
||||
} else {
|
||||
return '\n\n' + repeat('#', hLevel) + ' ' + content + '\n\n'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
rules.blockquote = {
|
||||
filter: 'blockquote',
|
||||
|
||||
replacement: function (content) {
|
||||
content = content.replace(/^\n+|\n+$/g, '');
|
||||
content = content.replace(/^/gm, '> ');
|
||||
return '\n\n' + content + '\n\n'
|
||||
}
|
||||
};
|
||||
|
||||
rules.list = {
|
||||
filter: ['ul', 'ol'],
|
||||
|
||||
replacement: function (content, node) {
|
||||
var parent = node.parentNode;
|
||||
if (parent.nodeName === 'LI' && parent.lastElementChild === node) {
|
||||
return '\n' + content
|
||||
} else {
|
||||
return '\n\n' + content + '\n\n'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
rules.listItem = {
|
||||
filter: 'li',
|
||||
|
||||
replacement: function (content, node, options) {
|
||||
content = content
|
||||
.replace(/^\n+/, '') // remove leading newlines
|
||||
.replace(/\n+$/, '\n') // replace trailing newlines with just a single one
|
||||
.replace(/\n/gm, '\n '); // indent
|
||||
var prefix = options.bulletListMarker + ' ';
|
||||
var parent = node.parentNode;
|
||||
if (parent.nodeName === 'OL') {
|
||||
var start = parent.getAttribute('start');
|
||||
var index = Array.prototype.indexOf.call(parent.children, node);
|
||||
prefix = (start ? Number(start) + index : index + 1) + '. ';
|
||||
}
|
||||
return (
|
||||
prefix + content + (node.nextSibling && !/\n$/.test(content) ? '\n' : '')
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
rules.indentedCodeBlock = {
|
||||
filter: function (node, options) {
|
||||
return (
|
||||
options.codeBlockStyle === 'indented' &&
|
||||
node.nodeName === 'PRE' &&
|
||||
node.firstChild &&
|
||||
node.firstChild.nodeName === 'CODE'
|
||||
)
|
||||
},
|
||||
|
||||
replacement: function (content, node, options) {
|
||||
return (
|
||||
'\n\n ' +
|
||||
node.firstChild.textContent.replace(/\n/g, '\n ') +
|
||||
'\n\n'
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
rules.fencedCodeBlock = {
|
||||
filter: function (node, options) {
|
||||
return (
|
||||
options.codeBlockStyle === 'fenced' &&
|
||||
node.nodeName === 'PRE' &&
|
||||
node.firstChild &&
|
||||
node.firstChild.nodeName === 'CODE'
|
||||
)
|
||||
},
|
||||
|
||||
replacement: function (content, node, options) {
|
||||
var className = node.firstChild.className || '';
|
||||
var language = (className.match(/language-(\S+)/) || [null, ''])[1];
|
||||
|
||||
return (
|
||||
'\n\n' + options.fence + language + '\n' +
|
||||
node.firstChild.textContent +
|
||||
'\n' + options.fence + '\n\n'
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
rules.horizontalRule = {
|
||||
filter: 'hr',
|
||||
|
||||
replacement: function (content, node, options) {
|
||||
return '\n\n' + options.hr + '\n\n'
|
||||
}
|
||||
};
|
||||
|
||||
rules.inlineLink = {
|
||||
filter: function (node, options) {
|
||||
return (
|
||||
options.linkStyle === 'inlined' &&
|
||||
node.nodeName === 'A' &&
|
||||
node.getAttribute('href')
|
||||
)
|
||||
},
|
||||
|
||||
replacement: function (content, node) {
|
||||
var href = node.getAttribute('href');
|
||||
var title = node.title ? ' "' + node.title + '"' : '';
|
||||
return '[' + content + '](' + href + title + ')'
|
||||
}
|
||||
};
|
||||
|
||||
rules.referenceLink = {
|
||||
filter: function (node, options) {
|
||||
return (
|
||||
options.linkStyle === 'referenced' &&
|
||||
node.nodeName === 'A' &&
|
||||
node.getAttribute('href')
|
||||
)
|
||||
},
|
||||
|
||||
replacement: function (content, node, options) {
|
||||
var href = node.getAttribute('href');
|
||||
var title = node.title ? ' "' + node.title + '"' : '';
|
||||
var replacement;
|
||||
var reference;
|
||||
|
||||
switch (options.linkReferenceStyle) {
|
||||
case 'collapsed':
|
||||
replacement = '[' + content + '][]';
|
||||
reference = '[' + content + ']: ' + href + title;
|
||||
break
|
||||
case 'shortcut':
|
||||
replacement = '[' + content + ']';
|
||||
reference = '[' + content + ']: ' + href + title;
|
||||
break
|
||||
default:
|
||||
var id = this.references.length + 1;
|
||||
replacement = '[' + content + '][' + id + ']';
|
||||
reference = '[' + id + ']: ' + href + title;
|
||||
}
|
||||
|
||||
this.references.push(reference);
|
||||
return replacement
|
||||
},
|
||||
|
||||
references: [],
|
||||
|
||||
append: function (options) {
|
||||
var references = '';
|
||||
if (this.references.length) {
|
||||
references = '\n\n' + this.references.join('\n') + '\n\n';
|
||||
this.references = []; // Reset references
|
||||
}
|
||||
return references
|
||||
}
|
||||
};
|
||||
|
||||
rules.emphasis = {
|
||||
filter: ['em', 'i'],
|
||||
|
||||
replacement: function (content, node, options) {
|
||||
if (!content.trim()) return ''
|
||||
return options.emDelimiter + content + options.emDelimiter
|
||||
}
|
||||
};
|
||||
|
||||
rules.strong = {
|
||||
filter: ['strong', 'b'],
|
||||
|
||||
replacement: function (content, node, options) {
|
||||
if (!content.trim()) return ''
|
||||
return options.strongDelimiter + content + options.strongDelimiter
|
||||
}
|
||||
};
|
||||
|
||||
rules.code = {
|
||||
filter: function (node) {
|
||||
var hasSiblings = node.previousSibling || node.nextSibling;
|
||||
var isCodeBlock = node.parentNode.nodeName === 'PRE' && !hasSiblings;
|
||||
|
||||
return node.nodeName === 'CODE' && !isCodeBlock
|
||||
},
|
||||
|
||||
replacement: function (content) {
|
||||
if (!content.trim()) return ''
|
||||
|
||||
var delimiter = '`';
|
||||
var leadingSpace = '';
|
||||
var trailingSpace = '';
|
||||
var matches = content.match(/`+/gm);
|
||||
if (matches) {
|
||||
if (/^`/.test(content)) leadingSpace = ' ';
|
||||
if (/`$/.test(content)) trailingSpace = ' ';
|
||||
while (matches.indexOf(delimiter) !== -1) delimiter = delimiter + '`';
|
||||
}
|
||||
|
||||
return delimiter + leadingSpace + content + trailingSpace + delimiter
|
||||
}
|
||||
};
|
||||
|
||||
rules.image = {
|
||||
filter: 'img',
|
||||
|
||||
replacement: function (content, node) {
|
||||
var alt = node.alt || '';
|
||||
var src = node.getAttribute('src') || '';
|
||||
var title = node.title || '';
|
||||
var titlePart = title ? ' "' + title + '"' : '';
|
||||
return src ? '![' + alt + ']' + '(' + src + titlePart + ')' : ''
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Manages a collection of rules used to convert HTML to Markdown
|
||||
*/
|
||||
|
||||
function Rules (options) {
|
||||
this.options = options;
|
||||
this._keep = [];
|
||||
this._remove = [];
|
||||
|
||||
this.blankRule = {
|
||||
replacement: options.blankReplacement
|
||||
};
|
||||
|
||||
this.keepReplacement = options.keepReplacement;
|
||||
|
||||
this.defaultRule = {
|
||||
replacement: options.defaultReplacement
|
||||
};
|
||||
|
||||
this.array = [];
|
||||
for (var key in options.rules) this.array.push(options.rules[key]);
|
||||
}
|
||||
|
||||
Rules.prototype = {
|
||||
add: function (key, rule) {
|
||||
this.array.unshift(rule);
|
||||
},
|
||||
|
||||
keep: function (filter) {
|
||||
this._keep.unshift({
|
||||
filter: filter,
|
||||
replacement: this.keepReplacement
|
||||
});
|
||||
},
|
||||
|
||||
remove: function (filter) {
|
||||
this._remove.unshift({
|
||||
filter: filter,
|
||||
replacement: function () {
|
||||
return ''
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
forNode: function (node) {
|
||||
if (node.isBlank) return this.blankRule
|
||||
var rule;
|
||||
|
||||
if ((rule = findRule(this.array, node, this.options))) return rule
|
||||
if ((rule = findRule(this._keep, node, this.options))) return rule
|
||||
if ((rule = findRule(this._remove, node, this.options))) return rule
|
||||
|
||||
return this.defaultRule
|
||||
},
|
||||
|
||||
forEach: function (fn) {
|
||||
for (var i = 0; i < this.array.length; i++) fn(this.array[i], i);
|
||||
}
|
||||
};
|
||||
|
||||
function findRule (rules, node, options) {
|
||||
for (var i = 0; i < rules.length; i++) {
|
||||
var rule = rules[i];
|
||||
if (filterValue(rule, node, options)) return rule
|
||||
}
|
||||
return void 0
|
||||
}
|
||||
|
||||
function filterValue (rule, node, options) {
|
||||
var filter = rule.filter;
|
||||
if (typeof filter === 'string') {
|
||||
if (filter === node.nodeName.toLowerCase()) return true
|
||||
} else if (Array.isArray(filter)) {
|
||||
if (filter.indexOf(node.nodeName.toLowerCase()) > -1) return true
|
||||
} else if (typeof filter === 'function') {
|
||||
if (filter.call(rule, node, options)) return true
|
||||
} else {
|
||||
throw new TypeError('`filter` needs to be a string, array, or function')
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The collapseWhitespace function is adapted from collapse-whitespace
|
||||
* by Luc Thevenard.
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014 Luc Thevenard <lucthevenard@gmail.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* collapseWhitespace(options) removes extraneous whitespace from an the given element.
|
||||
*
|
||||
* @param {Object} options
|
||||
*/
|
||||
function collapseWhitespace (options) {
|
||||
var element = options.element;
|
||||
var isBlock = options.isBlock;
|
||||
var isVoid = options.isVoid;
|
||||
var isPre = options.isPre || function (node) {
|
||||
return node.nodeName === 'PRE'
|
||||
};
|
||||
|
||||
if (!element.firstChild || isPre(element)) return
|
||||
|
||||
var prevText = null;
|
||||
var prevVoid = false;
|
||||
|
||||
var prev = null;
|
||||
var node = next(prev, element, isPre);
|
||||
|
||||
while (node !== element) {
|
||||
if (node.nodeType === 3 || node.nodeType === 4) { // Node.TEXT_NODE or Node.CDATA_SECTION_NODE
|
||||
var text = node.data.replace(/[ \r\n\t]+/g, ' ');
|
||||
|
||||
if ((!prevText || / $/.test(prevText.data)) &&
|
||||
!prevVoid && text[0] === ' ') {
|
||||
text = text.substr(1);
|
||||
}
|
||||
|
||||
// `text` might be empty at this point.
|
||||
if (!text) {
|
||||
node = remove(node);
|
||||
continue
|
||||
}
|
||||
|
||||
node.data = text;
|
||||
|
||||
prevText = node;
|
||||
} else if (node.nodeType === 1) { // Node.ELEMENT_NODE
|
||||
if (isBlock(node) || node.nodeName === 'BR') {
|
||||
if (prevText) {
|
||||
prevText.data = prevText.data.replace(/ $/, '');
|
||||
}
|
||||
|
||||
prevText = null;
|
||||
prevVoid = false;
|
||||
} else if (isVoid(node)) {
|
||||
// Avoid trimming space around non-block, non-BR void elements.
|
||||
prevText = null;
|
||||
prevVoid = true;
|
||||
}
|
||||
} else {
|
||||
node = remove(node);
|
||||
continue
|
||||
}
|
||||
|
||||
var nextNode = next(prev, node, isPre);
|
||||
prev = node;
|
||||
node = nextNode;
|
||||
}
|
||||
|
||||
if (prevText) {
|
||||
prevText.data = prevText.data.replace(/ $/, '');
|
||||
if (!prevText.data) {
|
||||
remove(prevText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* remove(node) removes the given node from the DOM and returns the
|
||||
* next node in the sequence.
|
||||
*
|
||||
* @param {Node} node
|
||||
* @return {Node} node
|
||||
*/
|
||||
function remove (node) {
|
||||
var next = node.nextSibling || node.parentNode;
|
||||
|
||||
node.parentNode.removeChild(node);
|
||||
|
||||
return next
|
||||
}
|
||||
|
||||
/**
|
||||
* next(prev, current, isPre) returns the next node in the sequence, given the
|
||||
* current and previous nodes.
|
||||
*
|
||||
* @param {Node} prev
|
||||
* @param {Node} current
|
||||
* @param {Function} isPre
|
||||
* @return {Node}
|
||||
*/
|
||||
function next (prev, current, isPre) {
|
||||
if ((prev && prev.parentNode === current) || isPre(current)) {
|
||||
return current.nextSibling || current.parentNode
|
||||
}
|
||||
|
||||
return current.firstChild || current.nextSibling || current.parentNode
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up window for Node.js
|
||||
*/
|
||||
|
||||
var root = (typeof window !== 'undefined' ? window : {});
|
||||
|
||||
/*
|
||||
* Parsing HTML strings
|
||||
*/
|
||||
|
||||
function canParseHTMLNatively () {
|
||||
var Parser = root.DOMParser;
|
||||
var canParse = false;
|
||||
|
||||
// Adapted from https://gist.github.com/1129031
|
||||
// Firefox/Opera/IE throw errors on unsupported types
|
||||
try {
|
||||
// WebKit returns null on unsupported types
|
||||
if (new Parser().parseFromString('', 'text/html')) {
|
||||
canParse = true;
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
return canParse
|
||||
}
|
||||
|
||||
function createHTMLParser () {
|
||||
var Parser = function () {};
|
||||
|
||||
{
|
||||
if (shouldUseActiveX()) {
|
||||
Parser.prototype.parseFromString = function (string) {
|
||||
var doc = new window.ActiveXObject('htmlfile');
|
||||
doc.designMode = 'on'; // disable on-page scripts
|
||||
doc.open();
|
||||
doc.write(string);
|
||||
doc.close();
|
||||
return doc
|
||||
};
|
||||
} else {
|
||||
Parser.prototype.parseFromString = function (string) {
|
||||
var doc = document.implementation.createHTMLDocument('');
|
||||
doc.open();
|
||||
doc.write(string);
|
||||
doc.close();
|
||||
return doc
|
||||
};
|
||||
}
|
||||
}
|
||||
return Parser
|
||||
}
|
||||
|
||||
function shouldUseActiveX () {
|
||||
var useActiveX = false;
|
||||
try {
|
||||
document.implementation.createHTMLDocument('').open();
|
||||
} catch (e) {
|
||||
if (window.ActiveXObject) useActiveX = true;
|
||||
}
|
||||
return useActiveX
|
||||
}
|
||||
|
||||
var HTMLParser = canParseHTMLNatively() ? root.DOMParser : createHTMLParser();
|
||||
|
||||
function RootNode (input) {
|
||||
var root;
|
||||
if (typeof input === 'string') {
|
||||
var doc = htmlParser().parseFromString(
|
||||
// DOM parsers arrange elements in the <head> and <body>.
|
||||
// Wrapping in a custom element ensures elements are reliably arranged in
|
||||
// a single element.
|
||||
'<x-turndown id="turndown-root">' + input + '</x-turndown>',
|
||||
'text/html'
|
||||
);
|
||||
root = doc.getElementById('turndown-root');
|
||||
} else {
|
||||
root = input.cloneNode(true);
|
||||
}
|
||||
collapseWhitespace({
|
||||
element: root,
|
||||
isBlock: isBlock,
|
||||
isVoid: isVoid
|
||||
});
|
||||
|
||||
return root
|
||||
}
|
||||
|
||||
var _htmlParser;
|
||||
function htmlParser () {
|
||||
_htmlParser = _htmlParser || new HTMLParser();
|
||||
return _htmlParser
|
||||
}
|
||||
|
||||
function Node (node) {
|
||||
node.isBlock = isBlock(node);
|
||||
node.isCode = node.nodeName.toLowerCase() === 'code' || node.parentNode.isCode;
|
||||
node.isBlank = isBlank(node);
|
||||
node.flankingWhitespace = flankingWhitespace(node);
|
||||
return node
|
||||
}
|
||||
|
||||
function isBlank (node) {
|
||||
return (
|
||||
['A', 'TH', 'TD'].indexOf(node.nodeName) === -1 &&
|
||||
/^\s*$/i.test(node.textContent) &&
|
||||
!isVoid(node) &&
|
||||
!hasVoid(node)
|
||||
)
|
||||
}
|
||||
|
||||
function flankingWhitespace (node) {
|
||||
var leading = '';
|
||||
var trailing = '';
|
||||
|
||||
if (!node.isBlock) {
|
||||
var hasLeading = /^[ \r\n\t]/.test(node.textContent);
|
||||
var hasTrailing = /[ \r\n\t]$/.test(node.textContent);
|
||||
|
||||
if (hasLeading && !isFlankedByWhitespace('left', node)) {
|
||||
leading = ' ';
|
||||
}
|
||||
if (hasTrailing && !isFlankedByWhitespace('right', node)) {
|
||||
trailing = ' ';
|
||||
}
|
||||
}
|
||||
|
||||
return { leading: leading, trailing: trailing }
|
||||
}
|
||||
|
||||
function isFlankedByWhitespace (side, node) {
|
||||
var sibling;
|
||||
var regExp;
|
||||
var isFlanked;
|
||||
|
||||
if (side === 'left') {
|
||||
sibling = node.previousSibling;
|
||||
regExp = / $/;
|
||||
} else {
|
||||
sibling = node.nextSibling;
|
||||
regExp = /^ /;
|
||||
}
|
||||
|
||||
if (sibling) {
|
||||
if (sibling.nodeType === 3) {
|
||||
isFlanked = regExp.test(sibling.nodeValue);
|
||||
} else if (sibling.nodeType === 1 && !isBlock(sibling)) {
|
||||
isFlanked = regExp.test(sibling.textContent);
|
||||
}
|
||||
}
|
||||
return isFlanked
|
||||
}
|
||||
|
||||
var reduce = Array.prototype.reduce;
|
||||
var leadingNewLinesRegExp = /^\n*/;
|
||||
var trailingNewLinesRegExp = /\n*$/;
|
||||
|
||||
function TurndownService (options) {
|
||||
if (!(this instanceof TurndownService)) return new TurndownService(options)
|
||||
|
||||
var defaults = {
|
||||
rules: rules,
|
||||
headingStyle: 'setext',
|
||||
hr: '* * *',
|
||||
bulletListMarker: '*',
|
||||
codeBlockStyle: 'indented',
|
||||
fence: '```',
|
||||
emDelimiter: '_',
|
||||
strongDelimiter: '**',
|
||||
linkStyle: 'inlined',
|
||||
linkReferenceStyle: 'full',
|
||||
br: ' ',
|
||||
blankReplacement: function (content, node) {
|
||||
return node.isBlock ? '\n\n' : ''
|
||||
},
|
||||
keepReplacement: function (content, node) {
|
||||
return node.isBlock ? '\n\n' + node.outerHTML + '\n\n' : node.outerHTML
|
||||
},
|
||||
defaultReplacement: function (content, node) {
|
||||
return node.isBlock ? '\n\n' + content + '\n\n' : content
|
||||
}
|
||||
};
|
||||
this.options = extend({}, defaults, options);
|
||||
this.rules = new Rules(this.options);
|
||||
}
|
||||
|
||||
TurndownService.prototype = {
|
||||
/**
|
||||
* The entry point for converting a string or DOM node to Markdown
|
||||
* @public
|
||||
* @param {String|HTMLElement} input The string or DOM node to convert
|
||||
* @returns A Markdown representation of the input
|
||||
* @type String
|
||||
*/
|
||||
|
||||
turndown: function (input) {
|
||||
if (!canConvert(input)) {
|
||||
throw new TypeError(
|
||||
input + ' is not a string, or an element/document/fragment node.'
|
||||
)
|
||||
}
|
||||
|
||||
if (input === '') return ''
|
||||
|
||||
var output = process.call(this, new RootNode(input));
|
||||
return postProcess.call(this, output)
|
||||
},
|
||||
|
||||
/**
|
||||
* Add one or more plugins
|
||||
* @public
|
||||
* @param {Function|Array} plugin The plugin or array of plugins to add
|
||||
* @returns The Turndown instance for chaining
|
||||
* @type Object
|
||||
*/
|
||||
|
||||
use: function (plugin) {
|
||||
if (Array.isArray(plugin)) {
|
||||
for (var i = 0; i < plugin.length; i++) this.use(plugin[i]);
|
||||
} else if (typeof plugin === 'function') {
|
||||
plugin(this);
|
||||
} else {
|
||||
throw new TypeError('plugin must be a Function or an Array of Functions')
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
/**
|
||||
* Adds a rule
|
||||
* @public
|
||||
* @param {String} key The unique key of the rule
|
||||
* @param {Object} rule The rule
|
||||
* @returns The Turndown instance for chaining
|
||||
* @type Object
|
||||
*/
|
||||
|
||||
addRule: function (key, rule) {
|
||||
this.rules.add(key, rule);
|
||||
return this
|
||||
},
|
||||
|
||||
/**
|
||||
* Keep a node (as HTML) that matches the filter
|
||||
* @public
|
||||
* @param {String|Array|Function} filter The unique key of the rule
|
||||
* @returns The Turndown instance for chaining
|
||||
* @type Object
|
||||
*/
|
||||
|
||||
keep: function (filter) {
|
||||
this.rules.keep(filter);
|
||||
return this
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove a node that matches the filter
|
||||
* @public
|
||||
* @param {String|Array|Function} filter The unique key of the rule
|
||||
* @returns The Turndown instance for chaining
|
||||
* @type Object
|
||||
*/
|
||||
|
||||
remove: function (filter) {
|
||||
this.rules.remove(filter);
|
||||
return this
|
||||
},
|
||||
|
||||
/**
|
||||
* Escapes Markdown syntax
|
||||
* @public
|
||||
* @param {String} string The string to escape
|
||||
* @returns A string with Markdown syntax escaped
|
||||
* @type String
|
||||
*/
|
||||
|
||||
escape: function (string) {
|
||||
return (
|
||||
string
|
||||
// Escape backslash escapes!
|
||||
.replace(/\\(\S)/g, '\\\\$1')
|
||||
|
||||
// Escape headings
|
||||
.replace(/^(#{1,6} )/gm, '\\$1')
|
||||
|
||||
// Escape hr
|
||||
.replace(/^([-*_] *){3,}$/gm, function (match, character) {
|
||||
return match.split(character).join('\\' + character)
|
||||
})
|
||||
|
||||
// Escape ol bullet points
|
||||
.replace(/^(\W* {0,3})(\d+)\. /gm, '$1$2\\. ')
|
||||
|
||||
// Escape ul bullet points
|
||||
.replace(/^([^\\\w]*)[*+-] /gm, function (match) {
|
||||
return match.replace(/([*+-])/g, '\\$1')
|
||||
})
|
||||
|
||||
// Escape blockquote indents
|
||||
.replace(/^(\W* {0,3})> /gm, '$1\\> ')
|
||||
|
||||
// Escape em/strong *
|
||||
.replace(/\*+(?![*\s\W]).+?\*+/g, function (match) {
|
||||
return match.replace(/\*/g, '\\*')
|
||||
})
|
||||
|
||||
// Escape em/strong _
|
||||
.replace(/_+(?![_\s\W]).+?_+/g, function (match) {
|
||||
return match.replace(/_/g, '\\_')
|
||||
})
|
||||
|
||||
// Escape code _
|
||||
.replace(/`+(?![`\s\W]).+?`+/g, function (match) {
|
||||
return match.replace(/`/g, '\\`')
|
||||
})
|
||||
|
||||
// Escape link brackets
|
||||
.replace(/[\[\]]/g, '\\$&') // eslint-disable-line no-useless-escape
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Reduces a DOM node down to its Markdown string equivalent
|
||||
* @private
|
||||
* @param {HTMLElement} parentNode The node to convert
|
||||
* @returns A Markdown representation of the node
|
||||
* @type String
|
||||
*/
|
||||
|
||||
function process (parentNode) {
|
||||
var self = this;
|
||||
return reduce.call(parentNode.childNodes, function (output, node) {
|
||||
node = new Node(node);
|
||||
|
||||
var replacement = '';
|
||||
if (node.nodeType === 3) {
|
||||
replacement = node.isCode ? node.nodeValue : self.escape(node.nodeValue);
|
||||
} else if (node.nodeType === 1) {
|
||||
replacement = replacementForNode.call(self, node);
|
||||
}
|
||||
|
||||
return join(output, replacement)
|
||||
}, '')
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends strings as each rule requires and trims the output
|
||||
* @private
|
||||
* @param {String} output The conversion output
|
||||
* @returns A trimmed version of the ouput
|
||||
* @type String
|
||||
*/
|
||||
|
||||
function postProcess (output) {
|
||||
var self = this;
|
||||
this.rules.forEach(function (rule) {
|
||||
if (typeof rule.append === 'function') {
|
||||
output = join(output, rule.append(self.options));
|
||||
}
|
||||
});
|
||||
|
||||
return output.replace(/^[\t\r\n]+/, '').replace(/[\t\r\n\s]+$/, '')
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an element node to its Markdown equivalent
|
||||
* @private
|
||||
* @param {HTMLElement} node The node to convert
|
||||
* @returns A Markdown representation of the node
|
||||
* @type String
|
||||
*/
|
||||
|
||||
function replacementForNode (node) {
|
||||
var rule = this.rules.forNode(node);
|
||||
var content = process.call(this, node);
|
||||
var whitespace = node.flankingWhitespace;
|
||||
if (whitespace.leading || whitespace.trailing) content = content.trim();
|
||||
return (
|
||||
whitespace.leading +
|
||||
rule.replacement(content, node, this.options) +
|
||||
whitespace.trailing
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the new lines between the current output and the replacement
|
||||
* @private
|
||||
* @param {String} output The current conversion output
|
||||
* @param {String} replacement The string to append to the output
|
||||
* @returns The whitespace to separate the current output and the replacement
|
||||
* @type String
|
||||
*/
|
||||
|
||||
function separatingNewlines (output, replacement) {
|
||||
var newlines = [
|
||||
output.match(trailingNewLinesRegExp)[0],
|
||||
replacement.match(leadingNewLinesRegExp)[0]
|
||||
].sort();
|
||||
var maxNewlines = newlines[newlines.length - 1];
|
||||
return maxNewlines.length < 2 ? maxNewlines : '\n\n'
|
||||
}
|
||||
|
||||
function join (string1, string2) {
|
||||
var separator = separatingNewlines(string1, string2);
|
||||
|
||||
// Remove trailing/leading newlines and replace with separator
|
||||
string1 = string1.replace(trailingNewLinesRegExp, '');
|
||||
string2 = string2.replace(leadingNewLinesRegExp, '');
|
||||
|
||||
return string1 + separator + string2
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether an input can be converted
|
||||
* @private
|
||||
* @param {String|HTMLElement} input Describe this parameter
|
||||
* @returns Describe what it returns
|
||||
* @type String|Object|Array|Boolean|Number
|
||||
*/
|
||||
|
||||
function canConvert (input) {
|
||||
return (
|
||||
input != null && (
|
||||
typeof input === 'string' ||
|
||||
(input.nodeType && (
|
||||
input.nodeType === 1 || input.nodeType === 9 || input.nodeType === 11
|
||||
))
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
return TurndownService;
|
||||
|
||||
}());
|
||||
@@ -25,7 +25,7 @@ document.addEventListener("account.create", function () {
|
||||
|
||||
let promise = sdk.account.createSession(form.email, form.password);
|
||||
|
||||
container.set("serviceForm", {}, true, true); // Remove sensetive data when not needed
|
||||
container.set("serviceForm", {}, true, true); // Remove sensitive data when not needed
|
||||
|
||||
promise.then(function () {
|
||||
var subscribe = document.getElementById('newsletter').checked;
|
||||
|
||||
@@ -90,10 +90,21 @@
|
||||
}
|
||||
}
|
||||
else if ('checkbox' === type) { // Checkbox
|
||||
if (Array.isArray(json[name])) {
|
||||
json[name].push(element.checked);
|
||||
const byKey = !!element.getAttribute('data-by-key');
|
||||
if (byKey) {
|
||||
if (!Array.isArray(json[name])) {
|
||||
json[name] = [];
|
||||
}
|
||||
|
||||
if (element.checked) {
|
||||
json[name].push(element.value);
|
||||
}
|
||||
} else {
|
||||
json[name] = element.checked;
|
||||
if (Array.isArray(json[name])) {
|
||||
json[name].push(element.checked);
|
||||
} else {
|
||||
json[name] = element.checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ('file' === type) { // File upload
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
search.path = path;
|
||||
|
||||
document.dispatchEvent(
|
||||
new CustomEvent("open-file-serach", {
|
||||
new CustomEvent("open-file-search", {
|
||||
bubbles: false,
|
||||
cancelable: true
|
||||
}));
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
xhr.onload = function () {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
let data = JSON.parse(this.responseText);
|
||||
let text = 'Appwrite version ' + data.version + ' is avaliable, check the';
|
||||
let text = 'Appwrite version ' + data.version + ' is available, check the';
|
||||
|
||||
if(isNewerVersion(env.VERSION, data.version)) {
|
||||
alerts.add({
|
||||
@@ -44,4 +44,4 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
})(window);
|
||||
})(window);
|
||||
@@ -19,6 +19,7 @@ img[src=""] {
|
||||
@import "icons";
|
||||
@import "polyfills";
|
||||
@import "forms";
|
||||
@import "ide";
|
||||
@import "scopes/console";
|
||||
@import "scopes/home";
|
||||
@import "comps/alerts";
|
||||
@@ -32,7 +33,6 @@ img[src=""] {
|
||||
@import "comps/modal";
|
||||
@import "comps/scroll";
|
||||
@import "comps/tabs";
|
||||
@import "dependencies/prism";
|
||||
|
||||
html {
|
||||
padding: 0;
|
||||
|
||||
@@ -1,358 +0,0 @@
|
||||
/* PrismJS 1.15.0
|
||||
https://prismjs.com/download.html#themes=prism-okaidia&languages=markup+css+clike+javascript+ruby+markup-templating+php&plugins=line-numbers */
|
||||
/**
|
||||
* okaidia theme for JavaScript, CSS and HTML
|
||||
* Loosely based on Monokai textmate theme by http://www.monokai.nl/
|
||||
* @author ocodia
|
||||
*/
|
||||
|
||||
.ide {
|
||||
background-color: var(--config-prism-background);
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
box-shadow: 0 2px 4px 0 rgba(50,50,93,.3);
|
||||
border-radius: 10px;
|
||||
margin-bottom: 30px;
|
||||
&:extend(.force-left);
|
||||
&:extend(.force-ltr);
|
||||
|
||||
* {
|
||||
font-family: 'Source Code Pro', monospace;
|
||||
}
|
||||
|
||||
&[data-lang]::after {
|
||||
content: attr(data-lang-label);
|
||||
display: inline-block;
|
||||
background: #ffffff;
|
||||
color: #000000;
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
padding: 5px 10px;
|
||||
border-radius: 15px;
|
||||
font-size: 10px;
|
||||
right: 10px; // should be right for both ltr and rtl
|
||||
opacity: 0.95;
|
||||
}
|
||||
|
||||
&[data-lang="bash"]::after {
|
||||
background: var(--config-language-bash);
|
||||
color: var(--config-language-bash-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="javascript"]::after {
|
||||
background: var(--config-language-javascript);
|
||||
color: var(--config-language-javascript-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="web"]::after {
|
||||
background: var(--config-language-web);
|
||||
color: var(--config-language-web-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="html"]::after {
|
||||
background: var(--config-language-html);
|
||||
color: var(--config-language-html-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="php"]::after {
|
||||
background: var(--config-language-php);
|
||||
color: var(--config-language-php-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="nodejs"]::after {
|
||||
background: var(--config-language-nodejs);
|
||||
color: var(--config-language-nodejs-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="ruby"]::after {
|
||||
background: var(--config-language-ruby);
|
||||
color: var(--config-language-ruby-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="python"]::after {
|
||||
background: var(--config-language-python);
|
||||
color: var(--config-language-python-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="go"]::after {
|
||||
background: var(--config-language-go);
|
||||
color: var(--config-language-go-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="dart"]::after {
|
||||
background: var(--config-language-dart);
|
||||
color: var(--config-language-dart-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="flutter"]::after {
|
||||
background: var(--config-language-flutter);
|
||||
color: var(--config-language-flutter-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="android"]::after {
|
||||
background: var(--config-language-android);
|
||||
color: var(--config-language-android-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="kotlin"]::after {
|
||||
background: var(--config-language-kotlin);
|
||||
color: var(--config-language-kotlin-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="java"]::after {
|
||||
background: var(--config-language-java);
|
||||
color: var(--config-language-java-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="yaml"]::after {
|
||||
background: var(--config-language-yaml);
|
||||
color: var(--config-language-yaml-contrast);
|
||||
}
|
||||
|
||||
.tag {
|
||||
color: inherit!important;
|
||||
background: transparent!important;
|
||||
padding: inherit!important;
|
||||
font-size: inherit!important;
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
.copy {
|
||||
cursor: pointer;
|
||||
content: attr(data-lang);
|
||||
display: inline-block;
|
||||
background: #ffffff;
|
||||
color: #000000;
|
||||
position: absolute;
|
||||
transform: translateX(-50%);
|
||||
bottom: -20px;
|
||||
padding: 5px 10px;
|
||||
border-radius: 15px;
|
||||
font-size: 10px;
|
||||
font-style: normal;
|
||||
.func-start(50%);
|
||||
opacity: 0;
|
||||
transition: bottom .3s, opacity .3s;
|
||||
line-height: normal;
|
||||
font-family: 'Poppins', sans-serif;
|
||||
|
||||
&::before {
|
||||
.func-padding-end(5px);
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.copy {
|
||||
transition: bottom .3s, opacity .3s;
|
||||
opacity: 0.90;
|
||||
bottom: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
pre {
|
||||
-webkit-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
hyphens: none;
|
||||
color: #e6ebf1;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
font-size: 13px;
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
padding-left: 60px;
|
||||
}
|
||||
|
||||
&.light {
|
||||
box-shadow: 0 2px 4px 0 rgba(50,50,93,.1);
|
||||
background-color: #ffffff;
|
||||
|
||||
pre {
|
||||
color: #414770;
|
||||
}
|
||||
|
||||
.token.comment,
|
||||
.token.prolog,
|
||||
.token.doctype,
|
||||
.token.cdata {
|
||||
color: #91a2b0;
|
||||
}
|
||||
|
||||
.token.selector,
|
||||
.token.attr-name,
|
||||
.token.string,
|
||||
.token.char,
|
||||
.token.builtin,
|
||||
.token.inserted {
|
||||
color: #149570;
|
||||
}
|
||||
|
||||
.token.punctuation {
|
||||
color: #414770;
|
||||
}
|
||||
|
||||
.token.operator,
|
||||
.token.entity,
|
||||
.token.url,
|
||||
.language-css .token.string,
|
||||
.style .token.string,
|
||||
.token.variable {
|
||||
color: #414770;
|
||||
}
|
||||
|
||||
.line-numbers .line-numbers-rows {
|
||||
background: #f2feef;
|
||||
}
|
||||
|
||||
.line-numbers-rows > span:before {
|
||||
color: #5dc79e;
|
||||
}
|
||||
|
||||
.token.keyword {
|
||||
color: #6772e4;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
text-align: left;
|
||||
white-space: pre;
|
||||
word-spacing: normal;
|
||||
word-break: normal;
|
||||
word-wrap: normal;
|
||||
-moz-tab-size: 4;
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
}
|
||||
|
||||
/* Code blocks */
|
||||
pre[class*="language-"] {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* Inline code */
|
||||
:not(pre) > code[class*="language-"] {
|
||||
padding: .1em;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.token.comment,
|
||||
.token.prolog,
|
||||
.token.doctype,
|
||||
.token.cdata {
|
||||
color: #6b7c93;
|
||||
}
|
||||
|
||||
.token.punctuation {
|
||||
color: #f8f8f2;
|
||||
}
|
||||
|
||||
.namespace {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
.token.property,
|
||||
.token.tag,
|
||||
.token.constant,
|
||||
.token.symbol,
|
||||
.token.deleted {
|
||||
color: #f92672;
|
||||
}
|
||||
|
||||
.token.boolean,
|
||||
.token.number {
|
||||
color: #f79a59;
|
||||
}
|
||||
|
||||
.token.selector,
|
||||
.token.attr-name,
|
||||
.token.string,
|
||||
.token.char,
|
||||
.token.builtin,
|
||||
.token.inserted {
|
||||
color: #3ecf8e;
|
||||
}
|
||||
|
||||
.token.operator,
|
||||
.token.entity,
|
||||
.token.url,
|
||||
.language-css .token.string,
|
||||
.style .token.string,
|
||||
.token.variable {
|
||||
color: #f8f8f2;
|
||||
}
|
||||
|
||||
.token.atrule,
|
||||
.token.attr-value,
|
||||
.token.function,
|
||||
.token.class-name {
|
||||
color: #45b2e8;
|
||||
}
|
||||
|
||||
.token.keyword {
|
||||
color: #7795f8;
|
||||
}
|
||||
|
||||
.token.regex,
|
||||
.token.important {
|
||||
color: #fd971f;
|
||||
}
|
||||
|
||||
.token.important,
|
||||
.token.bold {
|
||||
//font-weight: bold;
|
||||
}
|
||||
.token.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.token.entity {
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
pre[class*="language-"].line-numbers {
|
||||
position: relative;
|
||||
padding-left: 60px;
|
||||
counter-reset: linenumber;
|
||||
}
|
||||
|
||||
pre[class*="language-"].line-numbers > code {
|
||||
position: relative;
|
||||
white-space: inherit;
|
||||
}
|
||||
|
||||
.line-numbers .line-numbers-rows {
|
||||
background: var(--config-prism-numbers);
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
top: -20px;
|
||||
bottom: -21px;
|
||||
padding: 20px 0;
|
||||
font-size: 100%;
|
||||
left: -60px;
|
||||
width: 40px; /* works for line-numbers below 1000 lines */
|
||||
letter-spacing: -1px;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.line-numbers-rows > span {
|
||||
.func-padding-end(5px);
|
||||
pointer-events: none;
|
||||
display: block;
|
||||
counter-increment: linenumber;
|
||||
}
|
||||
|
||||
.line-numbers-rows > span:before {
|
||||
content: counter(linenumber);
|
||||
color: #636365;
|
||||
display: block;
|
||||
padding-right: 0.8em;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,349 @@
|
||||
.ide {
|
||||
background-color: var(--config-prism-background);
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
box-shadow: 0 2px 4px 0 rgba(50, 50, 93, 0.3);
|
||||
border-radius: 10px;
|
||||
margin-bottom: 30px;
|
||||
&:extend(.force-left);
|
||||
&:extend(.force-ltr);
|
||||
|
||||
* {
|
||||
font-family: "Source Code Pro", monospace;
|
||||
}
|
||||
|
||||
&[data-lang]::after {
|
||||
content: attr(data-lang-label);
|
||||
display: inline-block;
|
||||
background: #ffffff;
|
||||
color: #000000;
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
padding: 5px 10px;
|
||||
border-radius: 15px;
|
||||
font-size: 10px;
|
||||
right: 10px; // should be right for both ltr and rtl
|
||||
opacity: 0.95;
|
||||
}
|
||||
|
||||
&[data-lang="bash"]::after {
|
||||
background: var(--config-language-bash);
|
||||
color: var(--config-language-bash-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="javascript"]::after {
|
||||
background: var(--config-language-javascript);
|
||||
color: var(--config-language-javascript-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="web"]::after {
|
||||
background: var(--config-language-web);
|
||||
color: var(--config-language-web-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="html"]::after {
|
||||
background: var(--config-language-html);
|
||||
color: var(--config-language-html-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="php"]::after {
|
||||
background: var(--config-language-php);
|
||||
color: var(--config-language-php-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="nodejs"]::after {
|
||||
background: var(--config-language-nodejs);
|
||||
color: var(--config-language-nodejs-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="ruby"]::after {
|
||||
background: var(--config-language-ruby);
|
||||
color: var(--config-language-ruby-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="python"]::after {
|
||||
background: var(--config-language-python);
|
||||
color: var(--config-language-python-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="go"]::after {
|
||||
background: var(--config-language-go);
|
||||
color: var(--config-language-go-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="dart"]::after {
|
||||
background: var(--config-language-dart);
|
||||
color: var(--config-language-dart-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="flutter"]::after {
|
||||
background: var(--config-language-flutter);
|
||||
color: var(--config-language-flutter-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="android"]::after {
|
||||
background: var(--config-language-android);
|
||||
color: var(--config-language-android-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="kotlin"]::after {
|
||||
background: var(--config-language-kotlin);
|
||||
color: var(--config-language-kotlin-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="java"]::after {
|
||||
background: var(--config-language-java);
|
||||
color: var(--config-language-java-contrast);
|
||||
}
|
||||
|
||||
&[data-lang="yaml"]::after {
|
||||
background: var(--config-language-yaml);
|
||||
color: var(--config-language-yaml-contrast);
|
||||
}
|
||||
|
||||
.tag {
|
||||
color: inherit !important;
|
||||
background: transparent !important;
|
||||
padding: inherit !important;
|
||||
font-size: inherit !important;
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
.copy {
|
||||
cursor: pointer;
|
||||
content: attr(data-lang);
|
||||
display: inline-block;
|
||||
background: #ffffff;
|
||||
color: #000000;
|
||||
position: absolute;
|
||||
transform: translateX(-50%);
|
||||
bottom: -20px;
|
||||
padding: 5px 10px;
|
||||
border-radius: 15px;
|
||||
font-size: 10px;
|
||||
font-style: normal;
|
||||
.func-start(50%);
|
||||
opacity: 0;
|
||||
transition: bottom 0.3s, opacity 0.3s;
|
||||
line-height: normal;
|
||||
font-family: "Poppins", sans-serif;
|
||||
|
||||
&::before {
|
||||
.func-padding-end(5px);
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.copy {
|
||||
transition: bottom 0.3s, opacity 0.3s;
|
||||
opacity: 0.9;
|
||||
bottom: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
pre {
|
||||
-webkit-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
hyphens: none;
|
||||
color: #e6ebf1;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
font-size: 13px;
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
padding-left: 60px;
|
||||
}
|
||||
|
||||
&.light {
|
||||
box-shadow: 0 2px 4px 0 rgba(50, 50, 93, 0.1);
|
||||
background-color: #ffffff;
|
||||
|
||||
pre {
|
||||
color: #414770;
|
||||
}
|
||||
|
||||
.token.comment,
|
||||
.token.prolog,
|
||||
.token.doctype,
|
||||
.token.cdata {
|
||||
color: #91a2b0;
|
||||
}
|
||||
|
||||
.token.selector,
|
||||
.token.attr-name,
|
||||
.token.string,
|
||||
.token.char,
|
||||
.token.builtin,
|
||||
.token.inserted {
|
||||
color: #149570;
|
||||
}
|
||||
|
||||
.token.punctuation {
|
||||
color: #414770;
|
||||
}
|
||||
|
||||
.token.operator,
|
||||
.token.entity,
|
||||
.token.url,
|
||||
.language-css .token.string,
|
||||
.style .token.string,
|
||||
.token.variable {
|
||||
color: #414770;
|
||||
}
|
||||
|
||||
.line-numbers .line-numbers-rows {
|
||||
background: #f2feef;
|
||||
}
|
||||
|
||||
.line-numbers-rows > span:before {
|
||||
color: #5dc79e;
|
||||
}
|
||||
|
||||
.token.keyword {
|
||||
color: #6772e4;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
text-align: left;
|
||||
white-space: pre;
|
||||
word-spacing: normal;
|
||||
word-break: normal;
|
||||
word-wrap: normal;
|
||||
-moz-tab-size: 4;
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
}
|
||||
|
||||
/* Code blocks */
|
||||
pre[class*="language-"] {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* Inline code */
|
||||
:not(pre) > code[class*="language-"] {
|
||||
padding: 0.1em;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.token.comment,
|
||||
.token.prolog,
|
||||
.token.doctype,
|
||||
.token.cdata {
|
||||
color: #6b7c93;
|
||||
}
|
||||
|
||||
.token.punctuation {
|
||||
color: #f8f8f2;
|
||||
}
|
||||
|
||||
.namespace {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.token.property,
|
||||
.token.tag,
|
||||
.token.constant,
|
||||
.token.symbol,
|
||||
.token.deleted {
|
||||
color: #f92672;
|
||||
}
|
||||
|
||||
.token.boolean,
|
||||
.token.number {
|
||||
color: #f79a59;
|
||||
}
|
||||
|
||||
.token.selector,
|
||||
.token.attr-name,
|
||||
.token.string,
|
||||
.token.char,
|
||||
.token.builtin,
|
||||
.token.inserted {
|
||||
color: #3ecf8e;
|
||||
}
|
||||
|
||||
.token.operator,
|
||||
.token.entity,
|
||||
.token.url,
|
||||
.language-css .token.string,
|
||||
.style .token.string,
|
||||
.token.variable {
|
||||
color: #f8f8f2;
|
||||
}
|
||||
|
||||
.token.atrule,
|
||||
.token.attr-value,
|
||||
.token.function,
|
||||
.token.class-name {
|
||||
color: #45b2e8;
|
||||
}
|
||||
|
||||
.token.keyword {
|
||||
color: #7795f8;
|
||||
}
|
||||
|
||||
.token.regex,
|
||||
.token.important {
|
||||
color: #fd971f;
|
||||
}
|
||||
|
||||
.token.important,
|
||||
.token.bold {
|
||||
//font-weight: bold;
|
||||
}
|
||||
.token.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.token.entity {
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
pre[class*="language-"].line-numbers {
|
||||
position: relative;
|
||||
padding-left: 60px;
|
||||
counter-reset: linenumber;
|
||||
}
|
||||
|
||||
pre[class*="language-"].line-numbers > code {
|
||||
position: relative;
|
||||
white-space: inherit;
|
||||
}
|
||||
|
||||
.line-numbers .line-numbers-rows {
|
||||
background: var(--config-prism-numbers);
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
top: -20px;
|
||||
bottom: -21px;
|
||||
padding: 20px 0;
|
||||
font-size: 100%;
|
||||
left: -60px;
|
||||
width: 40px; /* works for line-numbers below 1000 lines */
|
||||
letter-spacing: -1px;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.line-numbers-rows > span {
|
||||
.func-padding-end(5px);
|
||||
pointer-events: none;
|
||||
display: block;
|
||||
counter-increment: linenumber;
|
||||
}
|
||||
|
||||
.line-numbers-rows > span:before {
|
||||
content: counter(linenumber);
|
||||
color: #636365;
|
||||
display: block;
|
||||
padding-right: 0.8em;
|
||||
text-align: right;
|
||||
}
|
||||
@@ -233,7 +233,7 @@ class Auth
|
||||
}
|
||||
|
||||
/**
|
||||
* Is Previligged User?
|
||||
* Is Privileged User?
|
||||
*
|
||||
* @param array $roles
|
||||
*
|
||||
|
||||
@@ -20,21 +20,23 @@ class Password extends Validator
|
||||
*/
|
||||
public function getDescription()
|
||||
{
|
||||
return 'Password must be between 6 and 32 chars and contain ...';
|
||||
return 'Password must be at least 8 characters';
|
||||
}
|
||||
|
||||
/**
|
||||
* Is valid.
|
||||
*
|
||||
* Validation username
|
||||
*
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
if (\strlen($value) < 6 || \strlen($value) > 32) {
|
||||
if (!\is_string($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (\strlen($value) < 8) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ use Appwrite\Utopia\Response\Model\File;
|
||||
use Appwrite\Utopia\Response\Model\Bucket;
|
||||
use Appwrite\Utopia\Response\Model\Func;
|
||||
use Appwrite\Utopia\Response\Model\Index;
|
||||
use Appwrite\Utopia\Response\Model\FuncPermissions;
|
||||
use Appwrite\Utopia\Response\Model\JWT;
|
||||
use Appwrite\Utopia\Response\Model\Key;
|
||||
use Appwrite\Utopia\Response\Model\Language;
|
||||
@@ -146,6 +147,7 @@ class Response extends SwooleResponse
|
||||
const MODEL_TAG_LIST = 'tagList';
|
||||
const MODEL_EXECUTION = 'execution';
|
||||
const MODEL_EXECUTION_LIST = 'executionList';
|
||||
const MODEL_FUNC_PERMISSIONS = 'funcPermissions';
|
||||
|
||||
// Project
|
||||
const MODEL_PROJECT = 'project';
|
||||
@@ -241,6 +243,7 @@ class Response extends SwooleResponse
|
||||
->setModel(new Team())
|
||||
->setModel(new Membership())
|
||||
->setModel(new Func())
|
||||
->setModel(new FuncPermissions())
|
||||
->setModel(new Tag())
|
||||
->setModel(new Execution())
|
||||
->setModel(new Project())
|
||||
|
||||
@@ -17,11 +17,11 @@ class Func extends Model
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('execute', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Document execute permissions.',
|
||||
'default' => '',
|
||||
'example' => 'role:all',
|
||||
'array' => true,
|
||||
'type' => Response::MODEL_FUNC_PERMISSIONS,
|
||||
'description' => 'Function permissions.',
|
||||
'default' => new \stdClass,
|
||||
'example' => new \stdClass,
|
||||
'array' => false,
|
||||
])
|
||||
->addRule('name', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Appwrite\Utopia\Response\Model;
|
||||
|
||||
use Appwrite\Utopia\Response;
|
||||
use Appwrite\Utopia\Response\Model;
|
||||
|
||||
class FuncPermissions extends Model
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
->addRule('execute', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Execution permissions.',
|
||||
'default' => [],
|
||||
'example' => 'user:5e5ea5c16897e',
|
||||
'array' => true,
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Name
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getName():string
|
||||
{
|
||||
return 'FuncPermissions';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Collection
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType():string
|
||||
{
|
||||
return Response::MODEL_FUNC_PERMISSIONS;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ trait DatabasePermissionsScope
|
||||
public array $users = [];
|
||||
public array $teams = [];
|
||||
|
||||
public function createUser(string $id, string $email, string $password = 'test123'): array
|
||||
public function createUser(string $id, string $email, string $password = 'test123!'): array
|
||||
{
|
||||
$user = $this->client->call(Client::METHOD_POST, '/account', [
|
||||
'origin' => 'http://localhost',
|
||||
|
||||
@@ -205,15 +205,15 @@ trait LocaleBase
|
||||
|
||||
$this->assertEquals($response['headers']['status-code'], 200);
|
||||
$this->assertIsArray($response['body']);
|
||||
$this->assertEquals(185, $response['body']['sum']);
|
||||
$this->assertEquals(184, $response['body']['sum']);
|
||||
|
||||
$this->assertEquals($response['body']['languages'][0]['code'], 'aa');
|
||||
$this->assertEquals($response['body']['languages'][0]['name'], 'Afar');
|
||||
$this->assertEquals($response['body']['languages'][0]['nativeName'], 'Afar');
|
||||
|
||||
$this->assertEquals($response['body']['languages'][184]['code'], 'zu');
|
||||
$this->assertEquals($response['body']['languages'][184]['name'], 'Zulu');
|
||||
$this->assertEquals($response['body']['languages'][184]['nativeName'], 'isiZulu');
|
||||
$this->assertEquals($response['body']['languages'][183]['code'], 'zu');
|
||||
$this->assertEquals($response['body']['languages'][183]['name'], 'Zulu');
|
||||
$this->assertEquals($response['body']['languages'][183]['nativeName'], 'isiZulu');
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
|
||||
@@ -272,6 +272,31 @@ trait StorageBase
|
||||
$this->assertEquals('image/png', $file6['headers']['content-type']);
|
||||
$this->assertNotEmpty($file6['body']);
|
||||
|
||||
// Test for negative angle values in fileGetPreview
|
||||
$file7 = $this->client->call(Client::METHOD_GET, '/storage/files/' . $data['fileId'] . '/preview', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'width' => 300,
|
||||
'height' => 100,
|
||||
'borderRadius' => '50',
|
||||
'opacity' => '0.5',
|
||||
'output' => 'png',
|
||||
'rotation' => '-315',
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $file7['headers']['status-code']);
|
||||
$this->assertEquals('image/png', $file7['headers']['content-type']);
|
||||
$this->assertNotEmpty($file7['body']);
|
||||
|
||||
$image = new \Imagick();
|
||||
$image->readImageBlob($file7['body']);
|
||||
$original = new \Imagick(__DIR__ . '/../../../resources/logo-after.png');
|
||||
|
||||
$this->assertEquals($image->getImageWidth(), $original->getImageWidth());
|
||||
$this->assertEquals($image->getImageHeight(), $original->getImageHeight());
|
||||
$this->assertEquals('PNG', $image->getImageFormat());
|
||||
|
||||
/**
|
||||
* Test large files decompress successfully
|
||||
*/
|
||||
|
||||
@@ -26,5 +26,5 @@ echo $_ENV['APPWRITE_FUNCTION_RUNTIME_VERSION']."\n";
|
||||
// echo $result['$id'];
|
||||
echo $_ENV['APPWRITE_FUNCTION_EVENT']."\n";
|
||||
echo $_ENV['APPWRITE_FUNCTION_EVENT_DATA']."\n";
|
||||
// Test unknwon UTF-8 chars
|
||||
// Test unknown UTF-8 chars
|
||||
echo "\xEA\xE4\n";
|
||||
@@ -31,9 +31,8 @@ class PasswordTest extends TestCase
|
||||
$this->assertEquals($this->object->isValid('123'), false);
|
||||
$this->assertEquals($this->object->isValid('1234'), false);
|
||||
$this->assertEquals($this->object->isValid('12345'), false);
|
||||
$this->assertEquals($this->object->isValid('123456'), true);
|
||||
$this->assertEquals($this->object->isValid('1234567'), true);
|
||||
$this->assertEquals($this->object->isValid('123456'), false);
|
||||
$this->assertEquals($this->object->isValid('1234567'), false);
|
||||
$this->assertEquals($this->object->isValid('WUnOZcn0piQMN8Mh31xw4KQPF0gcNGVA'), true);
|
||||
$this->assertEquals($this->object->isValid('WUnOZcn0piQMN8Mh31xw4KQPF0gcNGVAx'), false);
|
||||
}
|
||||
}
|
||||
@@ -22,13 +22,13 @@ class CollectionsTest extends TestCase
|
||||
foreach ($this->collections as $key => $collection) {
|
||||
if (array_key_exists('attributes', $collection)) {
|
||||
foreach ($collection['attributes'] as $check) {
|
||||
$occurences = 0;
|
||||
$occurrences = 0;
|
||||
foreach ($collection['attributes'] as $attribute) {
|
||||
if ($attribute['$id'] == $check['$id']) {
|
||||
$occurences++;
|
||||
$occurrences++;
|
||||
}
|
||||
}
|
||||
$this->assertEquals(1, $occurences);
|
||||
$this->assertEquals(1, $occurrences);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user