diff --git a/.gitignore b/.gitignore index 85df22867..8537fc545 100644 --- a/.gitignore +++ b/.gitignore @@ -76,6 +76,7 @@ cache tempChangelog.md prev trash +/Changelog.md # tests error_screenshots/ diff --git a/app/Changelog.md b/app/Changelog.md index 00d9a7ec1..b8d9023df 100644 --- a/app/Changelog.md +++ b/app/Changelog.md @@ -1,3 +1,42 @@ +## v4.0.1 + +*Sun Feb 18 2024* + +### ⚡️ General Improvements + +* Changed button text from Save to Apply (#495 by @AnukratiMehta) +* Improve migration script for v4 to handle cases when assets had broken references to groups + +### 🐛 Bug Fixes + +* Fix migration code for v4 throwing an error if a project did not use fittoscreen catmod. +* Fix `pointer.collides` method +* Tabs of deleted assets must automatically close. Closes #491 +* Update copies in room editors if their linked text style has changed. Closes #493 + +### 🍱 Demos, Dependencies and Stuff + +* :zap: JettyCat's example project should use a text base class for its highscore label in the defeat screen +* 🐛 Fix fullscreen switcher in Catformer example(#490 by @sk757a) + +### 📝 Docs + +* :hankey: Use a vanilla document search +* Drop `ct.` prefix in catmod docs (#494 by @ehanahamed) + +### 🌐 Website + +* :bento: Update screenshots in the presskit +* :bug: Remove downloads for MacOS ARM builds that no longer exist +* :zap: Update text in the presskit +* :zap: Update the changelog + +### 😱 Misc + +* :globe_with_meridians: Update Debug and Comments translation files +* :globe_with_meridians: Update Russian UI translation file +* Fix supabase catmod (#497 by @ehanahamed) + ## v4.0.0 *Sat Feb 10 2024* diff --git a/app/data/ct.libs/fs/DOCS.md b/app/data/ct.libs/fs/DOCS.md index 5a6428916..77e0abf0f 100644 --- a/app/data/ct.libs/fs/DOCS.md +++ b/app/data/ct.libs/fs/DOCS.md @@ -1,55 +1,55 @@ -## `ct.fs.forceLocal: boolean` +## `fs.forceLocal: boolean` When set to `true`, any operations towards files outside the game's save directory will fail. Set to `true` by default. -## `ct.fs.isAvailable: boolean` +## `fs.isAvailable: boolean` When set to `false`, the game is running in a way that disallows access to the filesystem (such as a web release) -## `ct.fs.save(filename: string, data: object|Array): Promise` +## `fs.save(filename: string, data: object|Array): Promise` Saves an object/array to a file. -## `ct.fs.load(filename: string): Promise` +## `fs.load(filename: string): Promise` -Loads an object/array from a file written by `ct.fs.save`. +Loads an object/array from a file written by `fs.save`. -## `ct.fs.saveText(filename: string, text: string): Promise` +## `fs.saveText(filename: string, text: string): Promise` Converts any value to a string and puts it into a file. -## `ct.fs.loadText(filename: string): Promise` +## `fs.loadText(filename: string): Promise` -Loads a string from a file, previously written by ct.fs.saveText. +Loads a string from a file, previously written by fs.saveText. -## `ct.fs.makeDir(path: string): Promise` +## `fs.makeDir(path: string): Promise` Creates a directory and all the preceding folders, if needed. -## `ct.fs.deleteDir(path: string): Promise` +## `fs.deleteDir(path: string): Promise` Removes a given directory with all its contents. If an EBUSY, EMFILE, ENFILE, ENOTEMPTY, or EPERM error is encountered, it will try again at max 10 times in one second. -## `ct.fs.copy(filename: string, dest: string): Promise` +## `fs.copy(filename: string, dest: string): Promise` Copies a file from one location to another. Does nothing if `filename` and `dest` point to one location. -## `ct.fs.move(filename: string, dest: string): Promise` +## `fs.move(filename: string, dest: string): Promise` Copies a file, then deletes the original. Does nothing if `filename` and `dest` point to one location. -## `ct.fs.listFiles(directory?: string): Promise>` +## `fs.listFiles(directory?: string): Promise>` Returns a promise that resolves into an array of file names in a given directory -## `ct.fs.stat(filename: string): Promise` +## `fs.stat(filename: string): Promise` Gets information about a given file. See https://nodejs.org/api/fs.html#fs_class_fs_stats -**Alias:** `ct.fs.exists` +**Alias:** `fs.exists` -## `ct.fs.getPath(partial: string): string` +## `fs.getPath(partial: string): string` When given a relative path, returns the absolute path equivalent to the given one, resolving it relative to the game's save directory. @@ -57,10 +57,10 @@ to the given one, resolving it relative to the game's save directory. No need to use it with `ct.fs` — `getPath` is already used in all its methods. The method is useful when working with other libraries, and for debugging. -## `ct.fs.rename(): Promise` -An alias for `ct.fs.move`. Copies a file from one location to another. Does nothing if `filename` and `dest` point to one location. +## `fs.rename(): Promise` +An alias for `fs.move`. Copies a file from one location to another. Does nothing if `filename` and `dest` point to one location. -## `ct.fs.exists(): Promise` +## `fs.exists(): Promise` -An alias for `ct.fs.stat`. Gets information about a given file. +An alias for `fs.stat`. Gets information about a given file. See https://nodejs.org/api/fs.html#fs_class_fs_stats diff --git a/app/data/ct.libs/fs/README.md b/app/data/ct.libs/fs/README.md index 3cf7d8c6d..20348dbb3 100644 --- a/app/data/ct.libs/fs/README.md +++ b/app/data/ct.libs/fs/README.md @@ -11,20 +11,20 @@ Within the application directory, ct.js will create a path using the defined Aut > **For Example**: If a player with the name `naturecodevoid` was running the game `jettyCat` by `comigo` on Linux, the default directory would be: `/home/naturecodevoid/.local/share/comigo/jettyCat` - You can verify this by calling `ct.fs.getPath('')` or by checking the variable `ct.fs.gameFolder`. + You can verify this by calling `fs.getPath('')` or by checking the variable `fs.gameFolder`. -It is not recommended, but you can set `ct.fs.gameFolder` to a different directory. This is useful if your meta fields (Author Name, Project Name) have changed, but you wish to preserve user data. +It is not recommended, but you can set `fs.gameFolder` to a different directory. This is useful if your meta fields (Author Name, Project Name) have changed, but you wish to preserve user data. -Also to note, operations outside of the game folder are not recommended and by default are not allowed, causing an error to appear in the game's console. To allow operations outside of the game folder set `ct.fs.forceLocal` to `false` first. +Also to note, operations outside of the game folder are not recommended and by default are not allowed, causing an error to appear in the game's console. To allow operations outside of the game folder set `fs.forceLocal` to `false` first. -Every action in `ct.fs` is asynchronous so that a game stays responsive even on heavy loads, and thus you have to use JS Promises. This is not hard, though: +Every action in `fs` is asynchronous so that a game stays responsive even on heavy loads, and thus you have to use JS Promises. This is not hard, though: ```js // Here we store an object in a JSON file. -ct.fs.save('savedGame.json', this.gameData) +fs.save('savedGame.json', this.gameData) .then(() => { // Here our operation has completed, we can add a feedback now - ct.templates.copy('GenericNotification', 20, 20, { + templates.copy('GenericNotification', 20, 20, { message: 'Game saved!' }); }); @@ -37,25 +37,25 @@ this.kill = true; ## Determining if ct.fs is supported -Ct.fs is designed for use on desktop devices, and its methods won't work in browsers. You can check for `ct.fs.isAvailable` to determine what you can do: +Ct.fs is designed for use on desktop devices, and its methods won't work in browsers. You can check for `fs.isAvailable` to determine what you can do: ```js -if (ct.fs.isAvailable) { +if (fs.isAvailable) { // All is well, we have an access to the filesystem. - ct.fs.save('saveData.cat', ct.game); // your file should not necessarily have `json` extension, btw ;) + fs.save('saveData.cat', game); // your file should not necessarily have `json` extension, btw ;) } else { // File system is not available; we can add a fallback to a browser's local storage instead. // see https://docs.ctjs.rocks/localstorage.html - localStorage.saveData = JSON.stringify(ct.game); + localStorage.saveData = JSON.stringify(game); } ``` ## Hints -* If you store all your game progression info in one object, you can make your whole save/load system in about 2-3 lines of code with `ct.fs.save` and `ct.fs.load`. +* If you store all your game progression info in one object, you can make your whole save/load system in about 2-3 lines of code with `fs.save` and `fs.load`. * You can't simply store copies inside a save file, but you can serialize them by using a bit of js magic: ```js - const hero = ct.templates.list['Hero'][0]; + const hero = templates.list['Hero'][0]; const saveData = { hero: { x: hero.x, @@ -63,23 +63,23 @@ if (ct.fs.isAvailable) { }, enemies: [] }; - for (const enemy of ct.templates.list['Enemy']) { + for (const enemy of templates.list['Enemy']) { saveData.enemies.push({ x: enemy.x, y: enemy.y, hp: enemy.hp }); } - ct.fs.save('savegame.json', saveData); + fs.save('savegame.json', saveData); // Later… - ct.fs.load('savegame.json', saveData => { - const hero = ct.templates.list['Hero'][0]; + fs.load('savegame.json', saveData => { + const hero = templates.list['Hero'][0]; hero.x = saveData.hero.x; hero.y = saveData.hero.y; for (const enemy of saveData.enemies) { - ct.templates.copy('Enemy', enemy.x, enemy.y); + templates.copy('Enemy', enemy.x, enemy.y); } }); ``` diff --git a/app/data/ct.libs/fs/types.d.ts b/app/data/ct.libs/fs/types.d.ts index cb396a608..27068a69e 100644 --- a/app/data/ct.libs/fs/types.d.ts +++ b/app/data/ct.libs/fs/types.d.ts @@ -26,88 +26,82 @@ interface IStats { isSymbolicLink(): boolean; } -declare namespace ct { - /** A module that provides a uniform API for storing and loading data for your desktop games. */ - namespace fs { - - /** - * When set to `true`, any operations towards files outside the game's save directory will fail. - * Set to `true` by default. - */ - var forceLocal: boolean; - - /** - * When set to `false`, the game is running in a way that disallows access to the filesystem (such as a web release) - */ - var isAvailable: boolean; - - /** - * The base location for application data. Not for normal usage. - */ - var gameFolder: string; - - /** Saves an object/array to a file. */ - function save(filename: string, data: object|any[]): Promise; - - /** Loads an object/array from a file written by `ct.fs.save`. */ - function load(filename: string): Promise; - - /** Converts any value to a string and puts it into a file. */ - function saveText(filename: string, text: string): Promise; - - /** Loads a string from a file, previously written by ct.fs.saveText. */ - function loadText(filename: string): Promise; - - /** Creates a directory and all the preceding folders, if needed. */ - function makeDir(path: string): Promise; - - /** - * Removes a given directory with all its contents. - * If an EBUSY, EMFILE, ENFILE, ENOTEMPTY, or EPERM error is encountered, - * it will try again at max 10 times in one second. - */ - function deleteDir(path: string): Promise; - - /** Copies a file from one location to another. Does nothing if `filename` and `dest` point to one location.*/ - function copy(filename: string, dest: string): Promise; - - /** Copies a file, then deletes the original. Does nothing if `filename` and `dest` point to one location. */ - function move(filename: string, dest: string): Promise; - - /** Returns a promise that resolves into an array of file names in a given directory */ - function listFiles(directory?: string): Promise; - - /** - * Gets information about a given file. - * @see https://nodejs.org/api/fs.html#fs_class_fs_stats - */ - function stat(filename: string): Promise; - - /** - * When given a relative path, returns the absolute path equivalent - * to the given one, resolving it relative to the game's save directory. - * - * No need to use it with `ct.fs` — `getPath` is already used in all its methods. - * The method is useful when working with other libraries, and for debugging. - */ - function getPath(partial: string): string; - - /** An alias for `ct.fs.move`. Copies a file from one location to another. Does nothing if `filename` and `dest` point to one location. */ - function rename(): Promise; - - /** - * An alias for `ct.fs.stat`. Gets information about a given file. - * @see https://nodejs.org/api/fs.html#fs_class_fs_stats - */ - function exists(): Promise; - - } +/** A module that provides a uniform API for storing and loading data for your desktop games. */ +declare namespace fs { + /** + * When set to `true`, any operations towards files outside the game's save directory will fail. + * Set to `true` by default. + */ + var forceLocal: boolean; + + /** + * When set to `false`, the game is running in a way that disallows access to the filesystem (such as a web release) + */ + var isAvailable: boolean; + + /** + * The base location for application data. Not for normal usage. + */ + var gameFolder: string; + + /** Saves an object/array to a file. */ + function save(filename: string, data: object|any[]): Promise; + + /** Loads an object/array from a file written by `ct.fs.save`. */ + function load(filename: string): Promise; + + /** Converts any value to a string and puts it into a file. */ + function saveText(filename: string, text: string): Promise; + + /** Loads a string from a file, previously written by ct.fs.saveText. */ + function loadText(filename: string): Promise; + + /** Creates a directory and all the preceding folders, if needed. */ + function makeDir(path: string): Promise; + + /** + * Removes a given directory with all its contents. + * If an EBUSY, EMFILE, ENFILE, ENOTEMPTY, or EPERM error is encountered, + * it will try again at max 10 times in one second. + */ + function deleteDir(path: string): Promise; + + /** Copies a file from one location to another. Does nothing if `filename` and `dest` point to one location.*/ + function copy(filename: string, dest: string): Promise; + + /** Copies a file, then deletes the original. Does nothing if `filename` and `dest` point to one location. */ + function move(filename: string, dest: string): Promise; + + /** Returns a promise that resolves into an array of file names in a given directory */ + function listFiles(directory?: string): Promise; + + /** + * Gets information about a given file. + * @see https://nodejs.org/api/fs.html#fs_class_fs_stats + */ + function stat(filename: string): Promise; + + /** + * When given a relative path, returns the absolute path equivalent + * to the given one, resolving it relative to the game's save directory. + * + * No need to use it with `ct.fs` — `getPath` is already used in all its methods. + * The method is useful when working with other libraries, and for debugging. + */ + function getPath(partial: string): string; + + /** An alias for `ct.fs.move`. Copies a file from one location to another. Does nothing if `filename` and `dest` point to one location. */ + function rename(): Promise; + + /** + * An alias for `ct.fs.stat`. Gets information about a given file. + * @see https://nodejs.org/api/fs.html#fs_class_fs_stats + */ + function exists(): Promise; } -declare namespace ct { - namespace fs { - /** Removes a given file */ - var _delete: function(string): Promise; - export {_delete as delete}; - } +declare namespace fs { + /** Removes a given file */ + var _delete: function(string): Promise; + export {_delete as delete}; } diff --git a/app/data/ct.libs/pointer/docs/General use.md b/app/data/ct.libs/pointer/docs/General use.md index 484721975..8dc012caf 100644 --- a/app/data/ct.libs/pointer/docs/General use.md +++ b/app/data/ct.libs/pointer/docs/General use.md @@ -7,33 +7,33 @@ For those who worked with `ct.mouse` and/or `ct.touch`, `ct.pointer` is a module For newcomers, you will probably start with the following: * Use the Actions system to read global pointer input. For example, you can have an action `Jump` that is triggered by pointer's primary button, so your character can jump when you click with your mouse or press with your finger. -* To position objects under the cursor, use `ct.pointer.x` and `ct.pointer.y` for gameplay elements and `ct.pointer.xui` and `ct.pointer.yui` for UI elements. +* To position objects under the cursor, use `pointer.x` and `pointer.y` for gameplay elements and `pointer.xui` and `pointer.yui` for UI elements. * To get if a player is pressing your button, in its On Step event use the following code: ```js - if (ct.pointer.collides(this)) { + if (pointer.collides(this)) { // Do something! :D // The button is currently pressed } ``` This code can also be expanded to account for hover and idle state: ```js - if (ct.pointer.collides(this)) { + if (pointer.collides(this)) { // Do something! :D // The button is currently down this.tex = 'Button_Pressed'; - } else if (ct.pointer.hovers(this)) { + } else if (pointer.hovers(this)) { this.tex = 'Button_Hover'; } else { this.tex = 'Button_Normal'; } ``` -* `ct.pointer.collides` returns `true` continuously while the pointer's button is held down. If you want to do something once the button is released, use its expanded form that catches only released buttons: +* `pointer.collides` returns `true` continuously while the pointer's button is held down. If you want to do something once the button is released, use its expanded form that catches only released buttons: ```js // Second argument is a specific pointer to check against. // We pass undefined, meaning that we pass no pointer at all, // so it checks against all the pointers. // The third argument tells to check against released pointer events. - if (ct.pointer.collides(this, undefined, true)) { - ct.sound.spawn('UI_Blep'); + if (pointer.collides(this, undefined, true)) { + sound.spawn('UI_Blep'); } ``` diff --git a/app/data/ct.libs/pointer/docs/Helper methods for buttons.md b/app/data/ct.libs/pointer/docs/Helper methods for buttons.md index 9942badc3..82fc2c006 100644 --- a/app/data/ct.libs/pointer/docs/Helper methods for buttons.md +++ b/app/data/ct.libs/pointer/docs/Helper methods for buttons.md @@ -2,10 +2,10 @@ There are four methods that can tell whether your copy is currently under a cursor (or a pen) and whether it is currently being pressed: -* `ct.pointer.collides(copy, specificPointer, releasedOnly)` -* `ct.pointer.collidesUi(copy, specificPointer, releasedOnly)` -* `ct.pointer.hovers(copy, specificPointer)` -* `ct.pointer.hoversUi(copy, specificPointer)` +* `pointer.collides(copy, specificPointer, releasedOnly)` +* `pointer.collidesUi(copy, specificPointer, releasedOnly)` +* `pointer.hovers(copy, specificPointer)` +* `pointer.hoversUi(copy, specificPointer)` `copy` is the copy you want to check against. @@ -16,13 +16,13 @@ There are four methods that can tell whether your copy is currently under a curs A generic button code with three states plus an action would look like this: ```js -if (ct.pointer.collides(this, undefined, true)) { - ct.sound.spawn('UI_Click'); +if (pointer.collides(this, undefined, true)) { + sound.spawn('UI_Click'); // Do something } -if (ct.pointer.collides(this)) { +if (pointer.collides(this)) { this.tex = 'Button_Pressed'; -} else if (ct.pointer.hovers(this)) { +} else if (pointer.hovers(this)) { this.tex = 'Button_Hover'; } else { this.tex = 'Button_Normal'; diff --git a/app/data/ct.libs/pointer/docs/Pointer Lock mode.md b/app/data/ct.libs/pointer/docs/Pointer Lock mode.md index 5eabcd4bf..5e6115139 100644 --- a/app/data/ct.libs/pointer/docs/Pointer Lock mode.md +++ b/app/data/ct.libs/pointer/docs/Pointer Lock mode.md @@ -7,30 +7,30 @@ This mode also works with touch and pen events, though its advantages are notice The locking mode can be enabled in two ways: * By turning on the option "Start with locking mode" inside ct.pointer's settings, or -* By calling `ct.pointer.lock()` any time during your game. +* By calling `pointer.lock()` any time during your game. -You can disable the locking mode with `ct.pointer.unlock()`. +You can disable the locking mode with `pointer.unlock()`. **When the locking mode is on, the following happens:** -* System cursor becomes hidden — you will need to create a copy that follows `ct.pointer.xlocked` and `ct.pointer.ylocked` if you need one. -* Most of the properties of `ct.pointer`, like `ct.pointer.x`, `ct.pointer.xui`, remain unchanged during the pointer movement, so they should **not** be used. -* Due to that, `ct.pointer.collides`, `ct.pointer.hovers` and their UI-space versions will always return `false`. Use the `ct.place.occupiedUi` method with your custom cursor if you still need UI events, or disable the locking mode for pause menus and other interfaces. - * For touch controls, consider not using the locking mode at all, as locking mode makes little sense with control methods already bound to screen size hardware-wise. You can use `ct.pointer.type` to differ between mouse and touch controls. +* System cursor becomes hidden — you will need to create a copy that follows `pointer.xlocked` and `pointer.ylocked` if you need one. +* Most of the properties of `pointer`, like `pointer.x`, `pointer.xui`, remain unchanged during the pointer movement, so they should **not** be used. +* Due to that, `pointer.collides`, `pointer.hovers` and their UI-space versions will always return `false`. Use the `place.occupiedUi` method with your custom cursor if you still need UI events, or disable the locking mode for pause menus and other interfaces. + * For touch controls, consider not using the locking mode at all, as locking mode makes little sense with control methods already bound to screen size hardware-wise. You can use `pointer.type` to differ between mouse and touch controls. You should use the following properties during the lock mode: -* `ct.pointer.xlocked` and `ct.pointer.ylocked` to read the position of the pointer in UI space. Use `ct.u.uiToGameCoord(ct.pointer.xlocked, ct.pointer.ylocked)` to convert them in gameplay space. - * Contrary to `ct.pointer.xui` and `ct.pointer.yui`, these two can be changed by you. For example, you can limit the area a cursor inside an RTS game can move in, or move the cursor to specific buttons automatically as an accessibility feature. -* `ct.pointer.xmovement` and `ct.pointer.ymovement` to read the movement speed of the pointer. These can be used, for example, to rotate camera in a shooter. +* `pointer.xlocked` and `pointer.ylocked` to read the position of the pointer in UI space. Use `u.uiToGameCoord(pointer.xlocked, pointer.ylocked)` to convert them in gameplay space. + * Contrary to `pointer.xui` and `pointer.yui`, these two can be changed by you. For example, you can limit the area a cursor inside an RTS game can move in, or move the cursor to specific buttons automatically as an accessibility feature. +* `pointer.xmovement` and `pointer.ymovement` to read the movement speed of the pointer. These can be used, for example, to rotate camera in a shooter. ## Getting whether a pointer is locked -A property `ct.pointer.locked` tells whether a pointer is currently locked (`true`) or not (`false`). -This property may be `false` after calling `ct.pointer.lock()` in several cases: +A property `pointer.locked` tells whether a pointer is currently locked (`true`) or not (`false`). +This property may be `false` after calling `pointer.lock()` in several cases: * A player switched to another app; * A player interrupted the pointer lock with the Escape key; * Pointer Lock is not supported in player's browser. This may happen on several mobile browsers, notably with Samsung's browser, and in Internet Explorer. -In any case, `ct.pointer` will lock the pointer again once a user clicks inside the game's window. +In any case, `pointer` will lock the pointer again once a user clicks inside the game's window. diff --git a/app/data/ct.libs/pointer/docs/Reading pointer properties.md b/app/data/ct.libs/pointer/docs/Reading pointer properties.md index 2a8b60163..7299ce049 100644 --- a/app/data/ct.libs/pointer/docs/Reading pointer properties.md +++ b/app/data/ct.libs/pointer/docs/Reading pointer properties.md @@ -2,33 +2,33 @@ `ct.pointer` tracks all the current pointers on-screen, but selects one as a **primary pointer**. For touch-only devices, it will be the first touch in a multi-touch session. For devices with mouse, it will probably be the mouse. -The properties of a primary pointer can be read with these properties (in form of `ct.pointer.x`, `ct.pointer.y` and so on): +The properties of a primary pointer can be read with these properties (in form of `pointer.x`, `pointer.y` and so on): * `x`, `y` — the current position of the pointer in gameplay coordinates; * `xprev`, `yprev` — the position of the pointer in gameplay coordinates during the passed frame; * `xui`, `yui` — the current position of the pointer in UI coordinates; * `xuiprev`, `yuiprev` — the position of the pointer in UI coordinates during the passed frame; * `pressure` — a float between 0 and 1 representing the pressure dealt on the pointer (think of a tablet pen where values close to 0 represent light strokes, and values close to 1 — ones made with strong pressure); -* `buttons` — a bit mask showing which buttons are pressed on the pointer's device. Use `ct.pointer.isButtonPressed` to get whether a particular button is pressed. See more info about the `buttons` property on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events#determining_button_states). +* `buttons` — a bit mask showing which buttons are pressed on the pointer's device. Use `pointer.isButtonPressed` to get whether a particular button is pressed. See more info about the `buttons` property on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events#determining_button_states). * `tiltX`, `tiltY` — floats between -90 and 90 indicating a pen's tilt. * `twist` — a value between 0 and 360 indicating the rotation of the pointer's device, clockwise. * `width`, `height` — the size of the pointer in gameplay coordinates. * `type` — usually is `'mouse'`, `'pen'`, or `'touch'`. Tells which device is used as a primary pointer. -You can also read pointers from arrays `ct.pointer.hover`, `ct.pointer.down`, and `ct.pointer.released`. These have all the current pointer events in three different states. **Note that pointers that are currently pressed down also count as hovering pointers.** +You can also read pointers from arrays `pointer.hover`, `pointer.down`, and `pointer.released`. These have all the current pointer events in three different states. **Note that pointers that are currently pressed down also count as hovering pointers.** -Besides that, you can get pointers from methods `ct.pointer.hovers`, `ct.pointer.collides`, and from their UI-space versions. All these pointer objects have the same properties as `ct.pointer`. +Besides that, you can get pointers from methods `pointer.hovers`, `pointer.collides`, and from their UI-space versions. All these pointer objects have the same properties as `pointer`. ## Getting currently pressed buttons -Generally you will only need to use data from the Actions system, but if you need to check against a specific pointer, you can use the `ct.pointer.isButtonPressed` method. Consider the following example: +Generally you will only need to use data from the Actions system, but if you need to check against a specific pointer, you can use the `pointer.isButtonPressed` method. Consider the following example: ```js // Say, `this` is a UI button that queues units production in RTS or production facilities in a clicker game. -const pointer = ct.pointer.collidesUi(this); +const pointer = pointer.collidesUi(this); if (pointer) { // Was the secondary button pressed? (Right-click for mouse, additional buttons for tablet pens) - if (ct.pointer.isButtonPressed(pointer, 'Secondary')) { + if (pointer.isButtonPressed(pointer, 'Secondary')) { buyFive('Tanks'); } else { buyOne('Tanks'); diff --git a/app/data/ct.libs/pointer/index.js b/app/data/ct.libs/pointer/index.js index 411317e3a..44a15c22b 100644 --- a/app/data/ct.libs/pointer/index.js +++ b/app/data/ct.libs/pointer/index.js @@ -288,7 +288,7 @@ const pointer = (function mountCtPointer() { pointer.released.length = 0; }, collides(copy, p, checkReleased) { - var set = checkReleased ? p.released : p.down; + var set = checkReleased ? pointer.released : pointer.down; return genericCollisionCheck(copy, p, set, false); }, collidesUi(copy, p, checkReleased) { diff --git a/app/data/ct.libs/sprite/README.md b/app/data/ct.libs/sprite/README.md index 7f04c8233..e7b9ec5b1 100644 --- a/app/data/ct.libs/sprite/README.md +++ b/app/data/ct.libs/sprite/README.md @@ -7,7 +7,7 @@ The workflow of this module is simple: you add one function call, giving an exis # ![Source strip](./data/ct.libs/sprite/SlimeExample.png) # + ```js -ct.sprite( +sprite( 'Slime', 'Slime_Idle', [0, 1, 2, 3, 2, 1, 0, 0, 0, 4, 5, 4, 0, 4, 5, 4] ); @@ -22,16 +22,16 @@ this.tex = 'Slime_Idle'; If we would like to split the source strip into tho separate animations, we would do this: ```js -ct.sprite( +sprite( 'Slime', 'Slime_Blink', [0, 1, 2, 3, 2, 1, 0, 0, 0] ); -ct.sprite( +sprite( 'Slime', 'Slime_Wiggle', [0, 4, 5, 4] ); /* Later, in project's code */ -this.tex = ct.random.dice('Slime_Blink', 'Slime_Wiggle); +this.tex = random.dice('Slime_Blink', 'Slime_Wiggle); ``` # = -# ![Gif result](./data/ct.libs/sprite/SlimeExample_Blink.gif) or ![Gif result](./data/ct.libs/sprite/SlimeExample_Wiggle.gif) \ No newline at end of file +# ![Gif result](./data/ct.libs/sprite/SlimeExample_Blink.gif) or ![Gif result](./data/ct.libs/sprite/SlimeExample_Wiggle.gif) diff --git a/app/data/ct.libs/supabase/index.js b/app/data/ct.libs/supabase/index.js index 04391c709..c2bb4eb14 100644 --- a/app/data/ct.libs/supabase/index.js +++ b/app/data/ct.libs/supabase/index.js @@ -1,2 +1,3 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.supabaseInit=t():e.supabaseInit=t()}(self,(()=>(()=>{"use strict";var e,t,s,r,i={982:(e,t,s)=>{s.r(t),s.d(t,{FunctionsClient:()=>a,FunctionsError:()=>r,FunctionsFetchError:()=>i,FunctionsHttpError:()=>o,FunctionsRelayError:()=>n});class r extends Error{constructor(e,t="FunctionsError",s){super(e),this.name=t,this.context=s}}class i extends r{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class n extends r{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class o extends r{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}class a{constructor(e,{headers:t={},customFetch:r}={}){this.url=e,this.headers=t,this.fetch=(e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>Promise.resolve().then(s.bind(s,743)).then((({default:t})=>t(...e))):fetch),(...e)=>t(...e)})(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var s,r,a,c,l;return r=this,a=void 0,l=function*(){try{const{headers:r,method:a,body:c}=t;let l,h={};c&&(r&&!Object.prototype.hasOwnProperty.call(r,"Content-Type")||!r)&&("undefined"!=typeof Blob&&c instanceof Blob||c instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",l=c):"string"==typeof c?(h["Content-Type"]="text/plain",l=c):"undefined"!=typeof FormData&&c instanceof FormData?l=c:(h["Content-Type"]="application/json",l=JSON.stringify(c)));const u=yield this.fetch(`${this.url}/${e}`,{method:a||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),r),body:l}).catch((e=>{throw new i(e)})),d=u.headers.get("x-relay-error");if(d&&"true"===d)throw new n(u);if(!u.ok)throw new o(u);let f,p=(null!==(s=u.headers.get("Content-Type"))&&void 0!==s?s:"text/plain").split(";")[0].trim();return f="application/json"===p?yield u.json():"application/octet-stream"===p?yield u.blob():"multipart/form-data"===p?yield u.formData():yield u.text(),{data:f,error:null}}catch(e){return{data:null,error:e}}},new((c=void 0)||(c=Promise))((function(e,t){function s(e){try{n(l.next(e))}catch(e){t(e)}}function i(e){try{n(l.throw(e))}catch(e){t(e)}}function n(t){var r;t.done?e(t.value):(r=t.value,r instanceof c?r:new c((function(e){e(r)}))).then(s,i)}n((l=l.apply(r,a||[])).next())}))}}},745:(e,t,s)=>{s.r(t),s.d(t,{AuthAdminApi:()=>te,AuthApiError:()=>_,AuthClient:()=>se,AuthError:()=>v,AuthImplicitGrantRedirectError:()=>O,AuthInvalidCredentialsError:()=>E,AuthInvalidTokenResponseError:()=>S,AuthPKCEGrantCodeExchangeError:()=>j,AuthRetryableFetchError:()=>P,AuthSessionMissingError:()=>T,AuthUnknownError:()=>w,AuthWeakPasswordError:()=>$,CustomAuthError:()=>k,GoTrueAdminApi:()=>q,GoTrueClient:()=>ee,NavigatorLockAcquireTimeoutError:()=>W,isAuthApiError:()=>b,isAuthError:()=>m,isAuthRetryableFetchError:()=>A,isAuthWeakPasswordError:()=>x,lockInternals:()=>H,navigatorLock:()=>Y});const r=()=>"undefined"!=typeof document,i={tested:!1,writable:!1},n=()=>{if(!r())return!1;try{if("object"!=typeof globalThis.localStorage)return!1}catch(e){return!1}if(i.tested)return i.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),i.tested=!0,i.writable=!0}catch(e){i.tested=!0,i.writable=!1}return i.writable};function o(e){const t={},s=new URL(e);if(s.hash&&"#"===s.hash[0])try{new URLSearchParams(s.hash.substring(1)).forEach(((e,s)=>{t[s]=e}))}catch(e){}return s.searchParams.forEach(((e,s)=>{t[s]=e})),t}const a=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>Promise.resolve().then(s.bind(s,743)).then((({default:t})=>t(...e))):fetch),(...e)=>t(...e)},c=e=>"object"==typeof e&&null!==e&&"status"in e&&"ok"in e&&"json"in e&&"function"==typeof e.json,l=async(e,t,s)=>{await e.setItem(t,JSON.stringify(s))},h=async(e,t)=>{const s=await e.getItem(t);if(!s)return null;try{return JSON.parse(s)}catch(e){return s}},u=async(e,t)=>{await e.removeItem(t)};class d{constructor(){this.promise=new d.promiseConstructor(((e,t)=>{this.resolve=e,this.reject=t}))}}function f(e){const t=e.split(".");if(3!==t.length)throw new Error("JWT is not valid: not a JWT structure");if(!/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i.test(t[1]))throw new Error("JWT is not valid: payload is not in base64url format");const s=t[1];return JSON.parse(function(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s,r,i,n,o,a,c,l="",h=0;for(e=e.replace("-","+").replace("_","/");h>4,r=(15&o)<<4|a>>2,i=(3&a)<<6|c,l+=String.fromCharCode(s),64!=a&&0!=r&&(l+=String.fromCharCode(r)),64!=c&&0!=i&&(l+=String.fromCharCode(i));return l}(s))}function p(e){return("0"+e.toString(16)).substr(-2)}function g(){const e=new Uint32Array(56);if("undefined"==typeof crypto){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",t=e.length;let s="";for(let r=0;r<56;r++)s+=e.charAt(Math.floor(Math.random()*t));return s}return crypto.getRandomValues(e),Array.from(e,p).join("")}async function y(e){if("undefined"==typeof crypto||void 0===crypto.subtle||"undefined"==typeof TextEncoder)return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const t=await async function(e){const t=(new TextEncoder).encode(e),s=await crypto.subtle.digest("SHA-256",t),r=new Uint8Array(s);return Array.from(r).map((e=>String.fromCharCode(e))).join("")}(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}d.promiseConstructor=Promise;class v extends Error{constructor(e,t){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t}}function m(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}class _ extends v{constructor(e,t){super(e,t),this.name="AuthApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}function b(e){return m(e)&&"AuthApiError"===e.name}class w extends v{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class k extends v{constructor(e,t,s){super(e),this.name=t,this.status=s}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class T extends k{constructor(){super("Auth session missing!","AuthSessionMissingError",400)}}class S extends k{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500)}}class E extends k{constructor(e){super(e,"AuthInvalidCredentialsError",400)}}class O extends k{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class j extends k{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class P extends k{constructor(e,t){super(e,"AuthRetryableFetchError",t)}}function A(e){return m(e)&&"AuthRetryableFetchError"===e.name}class $ extends k{constructor(e,t,s){super(e,"AuthWeakPasswordError",t),this.reasons=s}}function x(e){return m(e)&&"AuthWeakPasswordError"===e.name}const C=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),R=[502,503,504];async function I(e){if(!c(e))throw new P(C(e),0);if(R.includes(e.status))throw new P(C(e),e.status);let t;try{t=await e.json()}catch(e){throw new w(C(e),e)}if("object"==typeof t&&t&&"object"==typeof t.weak_password&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce(((e,t)=>e&&"string"==typeof t),!0))throw new $(C(t),e.status,t.weak_password.reasons);throw new _(C(t),e.status||500)}async function L(e,t,s,r){var i;const n=Object.assign({},null==r?void 0:r.headers);(null==r?void 0:r.jwt)&&(n.Authorization=`Bearer ${r.jwt}`);const o=null!==(i=null==r?void 0:r.query)&&void 0!==i?i:{};(null==r?void 0:r.redirectTo)&&(o.redirect_to=r.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await async function(e,t,s,r,i,n){const o=((e,t,s,r)=>{const i={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null==t?void 0:t.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),s))})(t,r,{},n);let a;try{a=await e(s,o)}catch(e){throw console.error(e),new P(C(e),0)}if(a.ok||await I(a),null==r?void 0:r.noResolveJson)return a;try{return await a.json()}catch(e){await I(e)}}(e,t,s+a,{headers:n,noResolveJson:null==r?void 0:r.noResolveJson},0,null==r?void 0:r.body);return(null==r?void 0:r.xform)?null==r?void 0:r.xform(c):{data:Object.assign({},c),error:null}}function U(e){var t;let s=null;var r;return function(e){return e.access_token&&e.refresh_token&&e.expires_in}(e)&&(s=Object.assign({},e),e.expires_at||(s.expires_at=(r=e.expires_in,Math.round(Date.now()/1e3)+r))),{data:{session:s,user:null!==(t=e.user)&&void 0!==t?t:e},error:null}}function N(e){const t=U(e);return!t.error&&e.weak_password&&"object"==typeof e.weak_password&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&"string"==typeof e.weak_password.message&&e.weak_password.reasons.reduce(((e,t)=>e&&"string"==typeof t),!0)&&(t.data.weak_password=e.weak_password),t}function D(e){var t;return{data:{user:null!==(t=e.user)&&void 0!==t?t:e},error:null}}function F(e){return{data:e,error:null}}function M(e){const{action_link:t,email_otp:s,hashed_token:r,redirect_to:i,verification_type:n}=e,o=function(e,t){var s={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(s[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0&&(d.forEach((e=>{const t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),s=JSON.parse(e.split(";")[1].split("=")[1]);c[`${s}Page`]=t})),c.total=parseInt(u)),{data:Object.assign(Object.assign({},h),c),error:null}}catch(e){if(m(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){try{return await L(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:D})}catch(e){if(m(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){try{return await L(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:D})}catch(e){if(m(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){try{return await L(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:D})}catch(e){if(m(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){try{const{data:t,error:s}=await L(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:s}}catch(e){if(m(e))return{data:null,error:e};throw e}}async _deleteFactor(e){try{return{data:await L(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(m(e))return{data:null,error:e};throw e}}}const J="0.0.0",z={"X-Client-Info":`gotrue-js/${J}`},K={getItem:e=>n()?globalThis.localStorage.getItem(e):null,setItem:(e,t)=>{n()&&globalThis.localStorage.setItem(e,t)},removeItem:e=>{n()&&globalThis.localStorage.removeItem(e)}};function G(e={}){return{getItem:t=>e[t]||null,setItem:(t,s)=>{e[t]=s},removeItem:t=>{delete e[t]}}}const H={debug:!!(globalThis&&n()&&globalThis.localStorage&&"true"===globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug"))};class V extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class W extends V{}async function Y(e,t,s){H.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;return t>0&&setTimeout((()=>{r.abort(),H.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)}),t),await globalThis.navigator.locks.request(e,0===t?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},(async r=>{if(!r){if(0===t)throw H.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new W(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(H.debug)try{const e=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(e,null," "))}catch(e){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",e)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await s()}H.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,r.name);try{return await s()}finally{H.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,r.name)}}))}!function(){if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(e){"undefined"!=typeof self&&(self.globalThis=self)}}();const X={url:"http://localhost:9999",storageKey:"supabase.auth.token",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:z,flowType:"implicit",debug:!1},Q=3e4;async function Z(e,t,s){return await s()}class ee{constructor(e){var t,s;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=ee.nextInstanceID,ee.nextInstanceID+=1,this.instanceID>0&&r()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const i=Object.assign(Object.assign({},X),e);if(this.logDebugMessages=!!i.debug,"function"==typeof i.debug&&(this.logger=i.debug),this.persistSession=i.persistSession,this.storageKey=i.storageKey,this.autoRefreshToken=i.autoRefreshToken,this.admin=new q({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=a(i.fetch),this.lock=i.lock||Z,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,i.lock?this.lock=i.lock:r()&&(null===(t=null===globalThis||void 0===globalThis?void 0:globalThis.navigator)||void 0===t?void 0:t.locks)?this.lock=Y:this.lock=Z,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?i.storage?this.storage=i.storage:n()?this.storage=K:(this.memoryStorage={},this.storage=G(this.memoryStorage)):(this.memoryStorage={},this.storage=G(this.memoryStorage)),r()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",e)}null===(s=this.broadcastChannel)||void 0===s||s.addEventListener("message",(async e=>{this._debug("received broadcast notification from other tab or client",e),await this._notifyAllSubscribers(e.data.event,e.data.session,!1)}))}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${J}) ${(new Date).toISOString()}`,...e),this}async initialize(){return this.initializePromise||(this.initializePromise=(async()=>await this._acquireLock(-1,(async()=>await this._initialize())))()),await this.initializePromise}async _initialize(){try{const e=!!r()&&await this._isPKCEFlow();if(this._debug("#_initialize()","begin","is PKCE flow",e),e||this.detectSessionInUrl&&this._isImplicitGrantFlow()){const{data:t,error:s}=await this._getSessionFromURL(e);if(s)return this._debug("#_initialize()","error detecting session from URL",s),"Identity is already linked"===(null==s?void 0:s.message)||"Identity is already linked to another user"===(null==s?void 0:s.message)||await this._removeSession(),{error:s};const{session:r,redirectType:i}=t;return this._debug("#_initialize()","detected session in URL",r,"redirect type",i),await this._saveSession(r),setTimeout((async()=>{"recovery"===i?await this._notifyAllSubscribers("PASSWORD_RECOVERY",r):await this._notifyAllSubscribers("SIGNED_IN",r)}),0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return m(e)?{error:e}:{error:new w("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signUp(e){var t,s,r;try{let i;if(await this._removeSession(),"email"in e){const{email:s,password:r,options:n}=e;let o=null,a=null;if("pkce"===this.flowType){const e=g();await l(this.storage,`${this.storageKey}-code-verifier`,e),o=await y(e),a=e===o?"plain":"s256"}i=await L(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:null==n?void 0:n.emailRedirectTo,body:{email:s,password:r,data:null!==(t=null==n?void 0:n.data)&&void 0!==t?t:{},gotrue_meta_security:{captcha_token:null==n?void 0:n.captchaToken},code_challenge:o,code_challenge_method:a},xform:U})}else{if(!("phone"in e))throw new E("You must provide either an email or phone number and a password");{const{phone:t,password:n,options:o}=e;i=await L(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:n,data:null!==(s=null==o?void 0:o.data)&&void 0!==s?s:{},channel:null!==(r=null==o?void 0:o.channel)&&void 0!==r?r:"sms",gotrue_meta_security:{captcha_token:null==o?void 0:o.captchaToken}},xform:U})}}const{data:n,error:o}=i;if(o||!n)return{data:{user:null,session:null},error:o};const a=n.session,c=n.user;return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",a)),{data:{user:c,session:a},error:null}}catch(e){if(m(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithPassword(e){try{let t;if(await this._removeSession(),"email"in e){const{email:s,password:r,options:i}=e;t=await L(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:N})}else{if(!("phone"in e))throw new E("You must provide either an email or phone number and a password");{const{phone:s,password:r,options:i}=e;t=await L(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:N})}}const{data:s,error:r}=t;return r?{data:{user:null,session:null},error:r}:s&&s.session&&s.user?(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:Object.assign({user:s.user,session:s.session},s.weak_password?{weakPassword:s.weak_password}:null),error:r}):{data:{user:null,session:null},error:new S}}catch(e){if(m(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithOAuth(e){var t,s,r,i;return await this._removeSession(),await this._handleProviderSignIn(e.provider,{redirectTo:null===(t=e.options)||void 0===t?void 0:t.redirectTo,scopes:null===(s=e.options)||void 0===s?void 0:s.scopes,queryParams:null===(r=e.options)||void 0===r?void 0:r.queryParams,skipBrowserRedirect:null===(i=e.options)||void 0===i?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,(async()=>this._exchangeCodeForSession(e)))}async _exchangeCodeForSession(e){const t=await h(this.storage,`${this.storageKey}-code-verifier`),[s,r]=(null!=t?t:"").split("/"),{data:i,error:n}=await L(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:s},xform:U});return await u(this.storage,`${this.storageKey}-code-verifier`),n?{data:{user:null,session:null,redirectType:null},error:n}:i&&i.session&&i.user?(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign(Object.assign({},i),{redirectType:null!=r?r:null}),error:n}):{data:{user:null,session:null,redirectType:null},error:new S}}async signInWithIdToken(e){await this._removeSession();try{const{options:t,provider:s,token:r,access_token:i,nonce:n}=e,o=await L(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:r,access_token:i,nonce:n,gotrue_meta_security:{captcha_token:null==t?void 0:t.captchaToken}},xform:U}),{data:a,error:c}=o;return c?{data:{user:null,session:null},error:c}:a&&a.session&&a.user?(a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),{data:a,error:c}):{data:{user:null,session:null},error:new S}}catch(e){if(m(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithOtp(e){var t,s,r,i,n;try{if(await this._removeSession(),"email"in e){const{email:r,options:i}=e;let n=null,o=null;if("pkce"===this.flowType){const e=g();await l(this.storage,`${this.storageKey}-code-verifier`,e),n=await y(e),o=e===n?"plain":"s256"}const{error:a}=await L(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:r,data:null!==(t=null==i?void 0:i.data)&&void 0!==t?t:{},create_user:null===(s=null==i?void 0:i.shouldCreateUser)||void 0===s||s,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken},code_challenge:n,code_challenge_method:o},redirectTo:null==i?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:a}}if("phone"in e){const{phone:t,options:s}=e,{data:o,error:a}=await L(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:null!==(r=null==s?void 0:s.data)&&void 0!==r?r:{},create_user:null===(i=null==s?void 0:s.shouldCreateUser)||void 0===i||i,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken},channel:null!==(n=null==s?void 0:s.channel)&&void 0!==n?n:"sms"}});return{data:{user:null,session:null,messageId:null==o?void 0:o.message_id},error:a}}throw new E("You must provide either an email or phone number.")}catch(e){if(m(e))return{data:{user:null,session:null},error:e};throw e}}async verifyOtp(e){var t,s;try{let r,i;"email_change"!==e.type&&"phone_change"!==e.type&&await this._removeSession(),"options"in e&&(r=null===(t=e.options)||void 0===t?void 0:t.redirectTo,i=null===(s=e.options)||void 0===s?void 0:s.captchaToken);const{data:n,error:o}=await L(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:r,xform:U});if(o)throw o;if(!n)throw new Error("An error occurred on token verification.");const a=n.session,c=n.user;return(null==a?void 0:a.access_token)&&(await this._saveSession(a),await this._notifyAllSubscribers("recovery"==e.type?"PASSWORD_RECOVERY":"SIGNED_IN",a)),{data:{user:c,session:a},error:null}}catch(e){if(m(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithSSO(e){var t,s,r;try{await this._removeSession();let i=null,n=null;if("pkce"===this.flowType){const e=g();await l(this.storage,`${this.storageKey}-code-verifier`,e),i=await y(e),n=e===i?"plain":"s256"}return await L(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:null!==(s=null===(t=e.options)||void 0===t?void 0:t.redirectTo)&&void 0!==s?s:void 0}),(null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:n}),headers:this.headers,xform:F})}catch(e){if(m(e))return{data:null,error:e};throw e}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,(async()=>await this._reauthenticate()))}async _reauthenticate(){try{return await this._useSession((async e=>{const{data:{session:t},error:s}=e;if(s)throw s;if(!t)throw new T;const{error:r}=await L(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return{data:{user:null,session:null},error:r}}))}catch(e){if(m(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{"email_change"!=e.type&&"phone_change"!=e.type&&await this._removeSession();const t=`${this.url}/resend`;if("email"in e){const{email:s,type:r,options:i}=e,{error:n}=await L(this.fetch,"POST",t,{headers:this.headers,body:{email:s,type:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},redirectTo:null==i?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:n}}if("phone"in e){const{phone:s,type:r,options:i}=e,{data:n,error:o}=await L(this.fetch,"POST",t,{headers:this.headers,body:{phone:s,type:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}}});return{data:{user:null,session:null,messageId:null==n?void 0:n.message_id},error:o}}throw new E("You must provide either an email or phone number and a type")}catch(e){if(m(e))return{data:{user:null,session:null},error:e};throw e}}async getSession(){return await this.initializePromise,this._acquireLock(-1,(async()=>this._useSession((async e=>e))))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await s}catch(e){}})()),s}return await this.lock(`lock:${this.storageKey}`,e,(async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const e=t();for(this.pendingInLock.push((async()=>{try{await e}catch(e){}})()),await e;this.pendingInLock.length;){const e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}}))}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",(new Error).stack);try{let e=null;const t=await h(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),null!==t&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const s=!!e.expires_at&&e.expires_at<=Date.now()/1e3;if(this._debug("#__loadSession()",`session has${s?"":" not"} expired`,"expires_at",e.expires_at),!s)return{data:{session:e},error:null};const{session:r,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{session:null},error:i}:{data:{session:r},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,this._acquireLock(-1,(async()=>await this._getUser())))}async _getUser(e){try{return e?await L(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:D}):await this._useSession((async e=>{var t,s;const{data:r,error:i}=e;if(i)throw i;return await L(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:null!==(s=null===(t=r.session)||void 0===t?void 0:t.access_token)&&void 0!==s?s:void 0,xform:D})}))}catch(e){if(m(e))return{data:{user:null},error:e};throw e}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(-1,(async()=>await this._updateUser(e,t)))}async _updateUser(e,t={}){try{return await this._useSession((async s=>{const{data:r,error:i}=s;if(i)throw i;if(!r.session)throw new T;const n=r.session;let o=null,a=null;if("pkce"===this.flowType&&null!=e.email){const e=g();await l(this.storage,`${this.storageKey}-code-verifier`,e),o=await y(e),a=e===o?"plain":"s256"}const{data:c,error:h}=await L(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:null==t?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:a}),jwt:n.access_token,xform:D});if(h)throw h;return n.user=c.user,await this._saveSession(n),await this._notifyAllSubscribers("USER_UPDATED",n),{data:{user:n.user},error:null}}))}catch(e){if(m(e))return{data:{user:null},error:e};throw e}}_decodeJWT(e){return f(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,(async()=>await this._setSession(e)))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new T;const t=Date.now()/1e3;let s=t,r=!0,i=null;const n=f(e.access_token);if(n.exp&&(s=n.exp,r=s<=t),r){const{session:t,error:s}=await this._callRefreshToken(e.refresh_token);if(s)return{data:{user:null,session:null},error:s};if(!t)return{data:{user:null,session:null},error:null};i=t}else{const{data:r,error:n}=await this._getUser(e.access_token);if(n)throw n;i={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:"bearer",expires_in:s-t,expires_at:s},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(e){if(m(e))return{data:{session:null,user:null},error:e};throw e}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,(async()=>await this._refreshSession(e)))}async _refreshSession(e){try{return await this._useSession((async t=>{var s;if(!e){const{data:r,error:i}=t;if(i)throw i;e=null!==(s=r.session)&&void 0!==s?s:void 0}if(!(null==e?void 0:e.refresh_token))throw new T;const{session:r,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{user:null,session:null},error:i}:r?{data:{user:r.user,session:r},error:null}:{data:{user:null,session:null},error:null}}))}catch(e){if(m(e))return{data:{user:null,session:null},error:e};throw e}}async _getSessionFromURL(e){try{if(!r())throw new O("No browser detected.");if("implicit"===this.flowType&&!this._isImplicitGrantFlow())throw new O("Not a valid implicit grant flow url.");if("pkce"==this.flowType&&!e)throw new j("Not a valid PKCE flow url.");const t=o(window.location.href);if(e){if(!t.code)throw new j("No code detected.");const{data:e,error:s}=await this._exchangeCodeForSession(t.code);if(s)throw s;const r=new URL(window.location.href);return r.searchParams.delete("code"),window.history.replaceState(window.history.state,"",r.toString()),{data:{session:e.session,redirectType:null},error:null}}if(t.error||t.error_description||t.error_code)throw new O(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});const{provider_token:s,provider_refresh_token:i,access_token:n,refresh_token:a,expires_in:c,expires_at:l,token_type:h}=t;if(!(n&&c&&a&&h))throw new O("No session defined in URL");const u=Math.round(Date.now()/1e3),d=parseInt(c);let f=u+d;l&&(f=parseInt(l));const p=f-u;1e3*p<=Q&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${d}s`);const g=f-d;u-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,f,u):u-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clok for skew",g,f,u);const{data:y,error:v}=await this._getUser(n);if(v)throw v;const m={provider_token:s,provider_refresh_token:i,access_token:n,expires_in:d,expires_at:f,refresh_token:a,token_type:h,user:y.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:m,redirectType:t.type},error:null}}catch(e){if(m(e))return{data:{session:null,redirectType:null},error:e};throw e}}_isImplicitGrantFlow(){const e=o(window.location.href);return!(!r()||!e.access_token&&!e.error_description)}async _isPKCEFlow(){const e=o(window.location.href),t=await h(this.storage,`${this.storageKey}-code-verifier`);return!(!e.code||!t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,(async()=>await this._signOut(e)))}async _signOut({scope:e}={scope:"global"}){return await this._useSession((async t=>{var s;const{data:r,error:i}=t;if(i)return{error:i};const n=null===(s=r.session)||void 0===s?void 0:s.access_token;if(n){const{error:t}=await this.admin.signOut(n,e);if(t&&(!b(t)||404!==t.status&&401!==t.status))return{error:t}}return"others"!==e&&(await this._removeSession(),await u(this.storage,`${this.storageKey}-code-verifier`),await this._notifyAllSubscribers("SIGNED_OUT",null)),{error:null}}))}onAuthStateChange(e){const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),s={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,s),(async()=>{await this.initializePromise,await this._acquireLock(-1,(async()=>{this._emitInitialSession(t)}))})(),{data:{subscription:s}}}async _emitInitialSession(e){return await this._useSession((async t=>{var s,r;try{const{data:{session:r},error:i}=t;if(i)throw i;await(null===(s=this.stateChangeEmitters.get(e))||void 0===s?void 0:s.callback("INITIAL_SESSION",r)),this._debug("INITIAL_SESSION","callback id",e,"session",r)}catch(t){await(null===(r=this.stateChangeEmitters.get(e))||void 0===r?void 0:r.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",t),console.error(t)}}))}async resetPasswordForEmail(e,t={}){let s=null,r=null;if("pkce"===this.flowType){const e=g();await l(this.storage,`${this.storageKey}-code-verifier`,`${e}/PASSWORD_RECOVERY`),s=await y(e),r=e===s?"plain":"s256"}try{return await L(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:s,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(m(e))return{data:null,error:e};throw e}}async getUserIdentities(){var e;try{const{data:t,error:s}=await this.getUser();if(s)throw s;return{data:{identities:null!==(e=t.user.identities)&&void 0!==e?e:[]},error:null}}catch(e){if(m(e))return{data:null,error:e};throw e}}async linkIdentity(e){var t;try{const{data:s,error:i}=await this._useSession((async t=>{var s,r,i,n,o;const{data:a,error:c}=t;if(c)throw c;const l=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:null===(s=e.options)||void 0===s?void 0:s.redirectTo,scopes:null===(r=e.options)||void 0===r?void 0:r.scopes,queryParams:null===(i=e.options)||void 0===i?void 0:i.queryParams,skipBrowserRedirect:!0});return await L(this.fetch,"GET",l,{headers:this.headers,jwt:null!==(o=null===(n=a.session)||void 0===n?void 0:n.access_token)&&void 0!==o?o:void 0})}));if(i)throw i;return r()&&!(null===(t=e.options)||void 0===t?void 0:t.skipBrowserRedirect)&&window.location.assign(null==s?void 0:s.url),{data:{provider:e.provider,url:null==s?void 0:s.url},error:null}}catch(t){if(m(t))return{data:{provider:e.provider,url:null},error:t};throw t}}async unlinkIdentity(e){try{return await this._useSession((async t=>{var s,r;const{data:i,error:n}=t;if(n)throw n;return await L(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:null!==(r=null===(s=i.session)||void 0===s?void 0:s.access_token)&&void 0!==r?r:void 0})}))}catch(e){if(m(e))return{data:null,error:e};throw e}}async _refreshAccessToken(e){const t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{const i=Date.now();return await(s=async s=>(await async function(e){return await new Promise((t=>{setTimeout((()=>t(null)),e)}))}(200*s),this._debug(t,"refreshing attempt",s),await L(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:U})),r=(e,t,s)=>s&&s.error&&A(s.error)&&Date.now()+200*(e+1)-i{(async()=>{for(let i=0;i<1/0;i++)try{const t=await s(i);if(!r(i,0,t))return void e(t)}catch(e){if(!r(i))return void t(e)}})()})))}catch(e){if(this._debug(t,"error",e),m(e))return{data:{session:null,user:null},error:e};throw e}finally{this._debug(t,"end")}var s,r}_isValidSession(e){return"object"==typeof e&&null!==e&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){const s=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",s),r()&&!t.skipBrowserRedirect&&window.location.assign(s),{data:{provider:e,url:s},error:null}}async _recoverAndRefresh(){var e;const t="#_recoverAndRefresh()";this._debug(t,"begin");try{const s=await h(this.storage,this.storageKey);if(this._debug(t,"session from storage",s),!this._isValidSession(s))return this._debug(t,"session is not valid"),void(null!==s&&await this._removeSession());const r=Math.round(Date.now()/1e3),i=(null!==(e=s.expires_at)&&void 0!==e?e:1/0){try{await s.callback(e,t)}catch(e){r.push(e)}}));if(await Promise.all(i),r.length>0){for(let e=0;ethis._autoRefreshTokenTick()),Q);this.autoRefreshTicker=e,e&&"object"==typeof e&&"function"==typeof e.unref?e.unref():"undefined"!=typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(e),setTimeout((async()=>{await this.initializePromise,await this._autoRefreshTokenTick()}),0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,(async()=>{try{const e=Date.now();try{return await this._useSession((async t=>{const{data:{session:s}}=t;if(!s||!s.refresh_token||!s.expires_at)return void this._debug("#_autoRefreshTokenTick()","no session");const r=Math.floor((1e3*s.expires_at-e)/Q);this._debug("#_autoRefreshTokenTick()",`access token expires in ${r} ticks, a tick lasts 30000ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(s.refresh_token)}))}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}))}catch(e){if(!(e.isAcquireTimeout||e instanceof V))throw e;this._debug("auto refresh token tick lock not available")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!r()||!(null===window||void 0===window?void 0:window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),null===window||void 0===window||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),"visible"===document.visibilityState?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,(async()=>{"visible"===document.visibilityState?await this._recoverAndRefresh():this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting")})))):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,s){const r=[`provider=${encodeURIComponent(t)}`];if((null==s?void 0:s.redirectTo)&&r.push(`redirect_to=${encodeURIComponent(s.redirectTo)}`),(null==s?void 0:s.scopes)&&r.push(`scopes=${encodeURIComponent(s.scopes)}`),"pkce"===this.flowType){const e=g();await l(this.storage,`${this.storageKey}-code-verifier`,e);const t=await y(e),s=e===t?"plain":"s256";this._debug("PKCE","code verifier",`${e.substring(0,5)}...`,"code challenge",t,"method",s);const i=new URLSearchParams({code_challenge:`${encodeURIComponent(t)}`,code_challenge_method:`${encodeURIComponent(s)}`});r.push(i.toString())}if(null==s?void 0:s.queryParams){const e=new URLSearchParams(s.queryParams);r.push(e.toString())}return(null==s?void 0:s.skipBrowserRedirect)&&r.push(`skip_http_redirect=${s.skipBrowserRedirect}`),`${e}?${r.join("&")}`}async _unenroll(e){try{return await this._useSession((async t=>{var s;const{data:r,error:i}=t;return i?{data:null,error:i}:await L(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null===(s=null==r?void 0:r.session)||void 0===s?void 0:s.access_token})}))}catch(e){if(m(e))return{data:null,error:e};throw e}}async _enroll(e){try{return await this._useSession((async t=>{var s,r;const{data:i,error:n}=t;if(n)return{data:null,error:n};const{data:o,error:a}=await L(this.fetch,"POST",`${this.url}/factors`,{body:{friendly_name:e.friendlyName,factor_type:e.factorType,issuer:e.issuer},headers:this.headers,jwt:null===(s=null==i?void 0:i.session)||void 0===s?void 0:s.access_token});return a?{data:null,error:a}:((null===(r=null==o?void 0:o.totp)||void 0===r?void 0:r.qr_code)&&(o.totp.qr_code=`data:image/svg+xml;utf-8,${o.totp.qr_code}`),{data:o,error:null})}))}catch(e){if(m(e))return{data:null,error:e};throw e}}async _verify(e){return this._acquireLock(-1,(async()=>{try{return await this._useSession((async t=>{var s;const{data:r,error:i}=t;if(i)return{data:null,error:i};const{data:n,error:o}=await L(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:null===(s=null==r?void 0:r.session)||void 0===s?void 0:s.access_token});return o?{data:null,error:o}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+n.expires_in},n)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",n),{data:n,error:o})}))}catch(e){if(m(e))return{data:null,error:e};throw e}}))}async _challenge(e){return this._acquireLock(-1,(async()=>{try{return await this._useSession((async t=>{var s;const{data:r,error:i}=t;return i?{data:null,error:i}:await L(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{headers:this.headers,jwt:null===(s=null==r?void 0:r.session)||void 0===s?void 0:s.access_token})}))}catch(e){if(m(e))return{data:null,error:e};throw e}}))}async _challengeAndVerify(e){const{data:t,error:s}=await this._challenge({factorId:e.factorId});return s?{data:null,error:s}:await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){const{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};const s=(null==e?void 0:e.factors)||[],r=s.filter((e=>"totp"===e.factor_type&&"verified"===e.status));return{data:{all:s,totp:r},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,(async()=>await this._useSession((async e=>{var t,s;const{data:{session:r},error:i}=e;if(i)return{data:null,error:i};if(!r)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const n=this._decodeJWT(r.access_token);let o=null;n.aal&&(o=n.aal);let a=o;return(null!==(s=null===(t=r.user.factors)||void 0===t?void 0:t.filter((e=>"verified"===e.status)))&&void 0!==s?s:[]).length>0&&(a="aal2"),{data:{currentLevel:o,nextLevel:a,currentAuthenticationMethods:n.amr||[]},error:null}}))))}}ee.nextInstanceID=0;const te=q,se=ee},743:(e,t,s)=>{s.r(t),s.d(t,{Headers:()=>o,Request:()=>a,Response:()=>c,default:()=>n,fetch:()=>i});var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==s.g)return s.g;throw new Error("unable to locate global object")}();const i=r.fetch,n=r.fetch.bind(r),o=r.Headers,a=r.Request,c=r.Response},0:(e,t,s)=>{s.r(t),s.d(t,{PostgrestBuilder:()=>n,PostgrestClient:()=>h,PostgrestFilterBuilder:()=>a,PostgrestQueryBuilder:()=>c,PostgrestTransformBuilder:()=>o});var r=s(743);class i extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}}class n{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:"undefined"==typeof fetch?this.fetch=r.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}then(e,t){void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),"GET"!==this.method&&"HEAD"!==this.method&&(this.headers["Content-Type"]="application/json");let s=(0,this.fetch)(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then((async e=>{var t,s,r;let n=null,o=null,a=null,c=e.status,l=e.statusText;if(e.ok){if("HEAD"!==this.method){const t=await e.text();""===t||(o="text/csv"===this.headers.Accept||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?t:JSON.parse(t))}const r=null===(t=this.headers.Prefer)||void 0===t?void 0:t.match(/count=(exact|planned|estimated)/),i=null===(s=e.headers.get("content-range"))||void 0===s?void 0:s.split("/");r&&i&&i.length>1&&(a=parseInt(i[1])),this.isMaybeSingle&&"GET"===this.method&&Array.isArray(o)&&(o.length>1?(n={code:"PGRST116",details:`Results contain ${o.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},o=null,a=null,c=406,l="Not Acceptable"):o=1===o.length?o[0]:null)}else{const t=await e.text();try{n=JSON.parse(t),Array.isArray(n)&&404===e.status&&(o=[],n=null,c=200,l="OK")}catch(s){404===e.status&&""===t?(c=204,l="No Content"):n={message:t}}if(n&&this.isMaybeSingle&&(null===(r=null==n?void 0:n.details)||void 0===r?void 0:r.includes("0 rows"))&&(n=null,c=200,l="OK"),n&&this.shouldThrowOnError)throw new i(n)}return{error:n,data:o,count:a,status:c,statusText:l}}));return this.shouldThrowOnError||(s=s.catch((e=>{var t,s,r;return{error:{message:`${null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"FetchError"}: ${null==e?void 0:e.message}`,details:`${null!==(s=null==e?void 0:e.stack)&&void 0!==s?s:""}`,hint:"",code:`${null!==(r=null==e?void 0:e.code)&&void 0!==r?r:""}`},data:null,count:null,status:0,statusText:""}}))),s.then(e,t)}}class o extends n{select(e){let t=!1;const s=(null!=e?e:"*").split("").map((e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e))).join("");return this.url.searchParams.set("select",s),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:t=!0,nullsFirst:s,foreignTable:r,referencedTable:i=r}={}){const n=i?`${i}.order`:"order",o=this.url.searchParams.get(n);return this.url.searchParams.set(n,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${void 0===s?"":s?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:s=t}={}){const r=void 0===s?"limit":`${s}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:s,referencedTable:r=s}={}){const i=void 0===r?"offset":`${r}.offset`,n=void 0===r?"limit":`${r}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(n,""+(t-e+1)),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return"GET"===this.method?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:t=!1,settings:s=!1,buffers:r=!1,wal:i=!1,format:n="text"}={}){var o;const a=[e?"analyze":null,t?"verbose":null,s?"settings":null,r?"buffers":null,i?"wal":null].filter(Boolean).join("|"),c=null!==(o=this.headers.Accept)&&void 0!==o?o:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${n}; for="${c}"; options=${a};`,this}rollback(){var e;return(null!==(e=this.headers.Prefer)&&void 0!==e?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}}class a extends o{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}in(e,t){const s=t.map((e=>"string"==typeof e&&new RegExp("[,()]").test(e)?`"${e}"`:`${e}`)).join(",");return this.url.searchParams.append(e,`in.(${s})`),this}contains(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return"string"==typeof t?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:s,type:r}={}){let i="";"plain"===r?i="pl":"phrase"===r?i="ph":"websearch"===r&&(i="w");const n=void 0===s?"":`(${s})`;return this.url.searchParams.append(e,`${i}fts${n}.${t}`),this}match(e){return Object.entries(e).forEach((([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)})),this}not(e,t,s){return this.url.searchParams.append(e,`not.${t}.${s}`),this}or(e,{foreignTable:t,referencedTable:s=t}={}){const r=s?`${s}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,s){return this.url.searchParams.append(e,`${t}.${s}`),this}}class c{constructor(e,{headers:t={},schema:s,fetch:r}){this.url=e,this.headers=t,this.schema=s,this.fetch=r}select(e,{head:t=!1,count:s}={}){const r=t?"HEAD":"GET";let i=!1;const n=(null!=e?e:"*").split("").map((e=>/\s/.test(e)&&!i?"":('"'===e&&(i=!i),e))).join("");return this.url.searchParams.set("select",n),s&&(this.headers.Prefer=`count=${s}`),new a({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:t,defaultToNull:s=!0}={}){const r=[];if(this.headers.Prefer&&r.push(this.headers.Prefer),t&&r.push(`count=${t}`),s||r.push("missing=default"),this.headers.Prefer=r.join(","),Array.isArray(e)){const t=e.reduce(((e,t)=>e.concat(Object.keys(t))),[]);if(t.length>0){const e=[...new Set(t)].map((e=>`"${e}"`));this.url.searchParams.set("columns",e.join(","))}}return new a({method:"POST",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:t,ignoreDuplicates:s=!1,count:r,defaultToNull:i=!0}={}){const n=[`resolution=${s?"ignore":"merge"}-duplicates`];if(void 0!==t&&this.url.searchParams.set("on_conflict",t),this.headers.Prefer&&n.push(this.headers.Prefer),r&&n.push(`count=${r}`),i||n.push("missing=default"),this.headers.Prefer=n.join(","),Array.isArray(e)){const t=e.reduce(((e,t)=>e.concat(Object.keys(t))),[]);if(t.length>0){const e=[...new Set(t)].map((e=>`"${e}"`));this.url.searchParams.set("columns",e.join(","))}}return new a({method:"POST",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:t}={}){const s=[];return this.headers.Prefer&&s.push(this.headers.Prefer),t&&s.push(`count=${t}`),this.headers.Prefer=s.join(","),new a({method:"PATCH",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){const t=[];return e&&t.push(`count=${e}`),this.headers.Prefer&&t.unshift(this.headers.Prefer),this.headers.Prefer=t.join(","),new a({method:"DELETE",url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}}const l={"X-Client-Info":"postgrest-js/1.9.2"};class h{constructor(e,{headers:t={},schema:s,fetch:r}={}){this.url=e,this.headers=Object.assign(Object.assign({},l),t),this.schemaName=s,this.fetch=r}from(e){const t=new URL(`${this.url}/${e}`);return new c(t,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new h(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,t={},{head:s=!1,count:r}={}){let i;const n=new URL(`${this.url}/rpc/${e}`);let o;s?(i="HEAD",Object.entries(t).forEach((([e,t])=>{n.searchParams.append(e,`${t}`)}))):(i="POST",o=t);const c=Object.assign({},this.headers);return r&&(c.Prefer=`count=${r}`),new a({method:i,url:n,headers:c,schema:this.schemaName,body:o,fetch:this.fetch,allowEmpty:!1})}}},73:(e,t,s)=>{s.r(t),s.d(t,{REALTIME_CHANNEL_STATES:()=>j,REALTIME_LISTEN_TYPES:()=>E,REALTIME_POSTGRES_CHANGES_LISTEN_EVENT:()=>S,REALTIME_PRESENCE_LISTEN_EVENTS:()=>l,REALTIME_SUBSCRIBE_STATES:()=>O,RealtimeChannel:()=>P,RealtimeClient:()=>x,RealtimePresence:()=>p});const r={"X-Client-Info":"realtime-js/2.9.3"};var i,n,o,a,c,l,h;!function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"}(i||(i={})),function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"}(n||(n={})),function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"}(o||(o={})),function(e){e.websocket="websocket"}(a||(a={})),function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"}(c||(c={}));class u{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout((()=>{this.tries=this.tries+1,this.callback()}),this.timerCalc(this.tries+1))}}class d{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):t("string"==typeof e?JSON.parse(e):{})}_binaryDecode(e){const t=new DataView(e),s=new TextDecoder;return this._decodeBroadcast(e,t,s)}_decodeBroadcast(e,t,s){const r=t.getUint8(1),i=t.getUint8(2);let n=this.HEADER_LENGTH+2;const o=s.decode(e.slice(n,n+r));n+=r;const a=s.decode(e.slice(n,n+i));return n+=i,{ref:null,topic:o,event:a,payload:JSON.parse(s.decode(e.slice(n,e.byteLength)))}}}class f{constructor(e,t,s={},r=1e4){this.channel=e,this.event=t,this.payload=s,this.timeout=r,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var s;return this._hasReceived(e)&&t(null===(s=this.receivedResp)||void 0===s?void 0:s.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){this.timeoutTimer||(this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref),this.channel._on(this.refEvent,{},(e=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=e,this._matchReceive(e)})),this.timeoutTimer=setTimeout((()=>{this.trigger("timeout",{})}),this.timeout))}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter((t=>t.status===e)).forEach((e=>e.callback(t)))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}!function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"}(l||(l={}));class p{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const s=(null==t?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(s.state,{},(e=>{const{onJoin:t,onLeave:s,onSync:r}=this.caller;this.joinRef=this.channel._joinRef(),this.state=p.syncState(this.state,e,t,s),this.pendingDiffs.forEach((e=>{this.state=p.syncDiff(this.state,e,t,s)})),this.pendingDiffs=[],r()})),this.channel._on(s.diff,{},(e=>{const{onJoin:t,onLeave:s,onSync:r}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(e):(this.state=p.syncDiff(this.state,e,t,s),r())})),this.onJoin(((e,t,s)=>{this.channel._trigger("presence",{event:"join",key:e,currentPresences:t,newPresences:s})})),this.onLeave(((e,t,s)=>{this.channel._trigger("presence",{event:"leave",key:e,currentPresences:t,leftPresences:s})})),this.onSync((()=>{this.channel._trigger("presence",{event:"sync"})}))}static syncState(e,t,s,r){const i=this.cloneDeep(e),n=this.transformState(t),o={},a={};return this.map(i,((e,t)=>{n[e]||(a[e]=t)})),this.map(n,((e,t)=>{const s=i[e];if(s){const r=t.map((e=>e.presence_ref)),i=s.map((e=>e.presence_ref)),n=t.filter((e=>i.indexOf(e.presence_ref)<0)),c=s.filter((e=>r.indexOf(e.presence_ref)<0));n.length>0&&(o[e]=n),c.length>0&&(a[e]=c)}else o[e]=t})),this.syncDiff(i,{joins:o,leaves:a},s,r)}static syncDiff(e,t,s,r){const{joins:i,leaves:n}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return s||(s=()=>{}),r||(r=()=>{}),this.map(i,((t,r)=>{var i;const n=null!==(i=e[t])&&void 0!==i?i:[];if(e[t]=this.cloneDeep(r),n.length>0){const s=e[t].map((e=>e.presence_ref)),r=n.filter((e=>s.indexOf(e.presence_ref)<0));e[t].unshift(...r)}s(t,n,r)})),this.map(n,((t,s)=>{let i=e[t];if(!i)return;const n=s.map((e=>e.presence_ref));i=i.filter((e=>n.indexOf(e.presence_ref)<0)),e[t]=i,r(t,i,s),0===i.length&&delete e[t]})),e}static map(e,t){return Object.getOwnPropertyNames(e).map((s=>t(s,e[s])))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce(((t,s)=>{const r=e[s];return t[s]="metas"in r?r.metas.map((e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))):r,t}),{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}!function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"}(h||(h={}));const g=(e,t,s={})=>{var r;const i=null!==(r=s.skipTypes)&&void 0!==r?r:[];return Object.keys(t).reduce(((s,r)=>(s[r]=y(r,e,t,i),s)),{})},y=(e,t,s,r)=>{const i=t.find((t=>t.name===e)),n=null==i?void 0:i.type,o=s[e];return n&&!r.includes(n)?v(n,o):m(o)},v=(e,t)=>{if("_"===e.charAt(0)){const s=e.slice(1,e.length);return k(t,s)}switch(e){case h.bool:return _(t);case h.float4:case h.float8:case h.int2:case h.int4:case h.int8:case h.numeric:case h.oid:return b(t);case h.json:case h.jsonb:return w(t);case h.timestamp:return T(t);case h.abstime:case h.date:case h.daterange:case h.int4range:case h.int8range:case h.money:case h.reltime:case h.text:case h.time:case h.timestamptz:case h.timetz:case h.tsrange:case h.tstzrange:default:return m(t)}},m=e=>e,_=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},b=e=>{if("string"==typeof e){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},w=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},k=(e,t)=>{if("string"!=typeof e)return e;const s=e.length-1,r=e[s];if("{"===e[0]&&"}"===r){let r;const i=e.slice(1,s);try{r=JSON.parse("["+i+"]")}catch(e){r=i?i.split(","):[]}return r.map((e=>v(t,e)))}return e},T=e=>"string"==typeof e?e.replace(" ","T"):e;var S,E,O;!function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"}(S||(S={})),function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes"}(E||(E={})),function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"}(O||(O={}));const j=n;class P{constructor(e,t={config:{}},s){this.topic=e,this.params=t,this.socket=s,this.bindings={},this.state=n.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""}},t.config),this.timeout=this.socket.timeout,this.joinPush=new f(this,o.join,this.params,this.timeout),this.rejoinTimer=new u((()=>this._rejoinUntilConnected()),this.socket.reconnectAfterMs),this.joinPush.receive("ok",(()=>{this.state=n.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach((e=>e.send())),this.pushBuffer=[]})),this._onClose((()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=n.closed,this.socket._remove(this)})),this._onError((e=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,e),this.state=n.errored,this.rejoinTimer.scheduleTimeout())})),this.joinPush.receive("timeout",(()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=n.errored,this.rejoinTimer.scheduleTimeout())})),this._on(o.reply,{},((e,t)=>{this._trigger(this._replyEventName(t),e)})),this.presence=new p(this),this.broadcastEndpointURL=this._broadcastEndpointURL()}subscribe(e,t=this.timeout){var s,r;if(this.socket.isConnected()||this.socket.connect(),this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{const{config:{broadcast:i,presence:n}}=this.params;this._onError((t=>e&&e("CHANNEL_ERROR",t))),this._onClose((()=>e&&e("CLOSED")));const o={},a={broadcast:i,presence:n,postgres_changes:null!==(r=null===(s=this.bindings.postgres_changes)||void 0===s?void 0:s.map((e=>e.filter)))&&void 0!==r?r:[]};this.socket.accessToken&&(o.access_token=this.socket.accessToken),this.updateJoinPayload(Object.assign({config:a},o)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",(({postgres_changes:t})=>{var s;if(this.socket.accessToken&&this.socket.setAuth(this.socket.accessToken),void 0!==t){const r=this.bindings.postgres_changes,i=null!==(s=null==r?void 0:r.length)&&void 0!==s?s:0,n=[];for(let s=0;s{e&&e("CHANNEL_ERROR",new Error(JSON.stringify(Object.values(t).join(", ")||"error")))})).receive("timeout",(()=>{e&&e("TIMED_OUT")}))}return this}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,s){return this._on(e,t,s)}async send(e,t={}){var s,r;if(this._canPush()||"broadcast"!==e.type)return new Promise((s=>{var r,i,n;const o=this._push(e.type,e,t.timeout||this.timeout);"broadcast"!==e.type||(null===(n=null===(i=null===(r=this.params)||void 0===r?void 0:r.config)||void 0===i?void 0:i.broadcast)||void 0===n?void 0:n.ack)||s("ok"),o.receive("ok",(()=>s("ok"))),o.receive("timeout",(()=>s("timed out")))}));{const{event:i,payload:n}=e,o={method:"POST",headers:{apikey:null!==(s=this.socket.apiKey)&&void 0!==s?s:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:n}]})};try{return(await this._fetchWithTimeout(this.broadcastEndpointURL,o,null!==(r=t.timeout)&&void 0!==r?r:this.timeout)).ok?"ok":"error"}catch(e){return"AbortError"===e.name?"timed out":"error"}}}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=n.leaving;const t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(o.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise((s=>{const r=new f(this,o.leave,{},e);r.receive("ok",(()=>{t(),s("ok")})).receive("timeout",(()=>{t(),s("timed out")})).receive("error",(()=>{s("error")})),r.send(),this._canPush()||r.trigger("ok",{})}))}_broadcastEndpointURL(){let e=this.socket.endPoint;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")+"/api/broadcast"}async _fetchWithTimeout(e,t,s){const r=new AbortController,i=setTimeout((()=>r.abort()),s),n=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(i),n}_push(e,t,s=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let r=new f(this,e,t,s);return this._canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}_onMessage(e,t,s){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,s){var r,i;const n=e.toLocaleLowerCase(),{close:a,error:c,leave:l,join:h}=o;if(s&&[a,c,l,h].indexOf(n)>=0&&s!==this._joinRef())return;let u=this._onMessage(n,t,s);if(t&&!u)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(n)?null===(r=this.bindings.postgres_changes)||void 0===r||r.filter((e=>{var t,s,r;return"*"===(null===(t=e.filter)||void 0===t?void 0:t.event)||(null===(r=null===(s=e.filter)||void 0===s?void 0:s.event)||void 0===r?void 0:r.toLocaleLowerCase())===n})).map((e=>e.callback(u,s))):null===(i=this.bindings[n])||void 0===i||i.filter((e=>{var s,r,i,o,a,c;if(["broadcast","presence","postgres_changes"].includes(n)){if("id"in e){const n=e.id,o=null===(s=e.filter)||void 0===s?void 0:s.event;return n&&(null===(r=t.ids)||void 0===r?void 0:r.includes(n))&&("*"===o||(null==o?void 0:o.toLocaleLowerCase())===(null===(i=t.data)||void 0===i?void 0:i.type.toLocaleLowerCase()))}{const s=null===(a=null===(o=null==e?void 0:e.filter)||void 0===o?void 0:o.event)||void 0===a?void 0:a.toLocaleLowerCase();return"*"===s||s===(null===(c=null==t?void 0:t.event)||void 0===c?void 0:c.toLocaleLowerCase())}}return e.type.toLocaleLowerCase()===n})).map((e=>{if("object"==typeof u&&"ids"in u){const e=u.data,{schema:t,table:s,commit_timestamp:r,type:i,errors:n}=e,o={schema:t,table:s,commit_timestamp:r,eventType:i,new:{},old:{},errors:n};u=Object.assign(Object.assign({},o),this._getPayloadRecords(e))}e.callback(u,s)}))}_isClosed(){return this.state===n.closed}_isJoined(){return this.state===n.joined}_isJoining(){return this.state===n.joining}_isLeaving(){return this.state===n.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,s){const r=e.toLocaleLowerCase(),i={type:r,filter:t,callback:s};return this.bindings[r]?this.bindings[r].push(i):this.bindings[r]=[i],this}_off(e,t){const s=e.toLocaleLowerCase();return this.bindings[s]=this.bindings[s].filter((e=>{var r;return!((null===(r=e.type)||void 0===r?void 0:r.toLocaleLowerCase())===s&&P.isEqual(e.filter,t))})),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(o.close,{},e)}_onError(e){this._on(o.error,{},(t=>e(t)))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=n.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const t={new:{},old:{}};return"INSERT"!==e.type&&"UPDATE"!==e.type||(t.new=g(e.columns,e.record)),"UPDATE"!==e.type&&"DELETE"!==e.type||(t.old=g(e.columns,e.old_record)),t}}const A=()=>{},$="undefined"!=typeof WebSocket;class x{constructor(e,t){var i;this.accessToken=null,this.apiKey=null,this.channels=[],this.endPoint="",this.headers=r,this.params={},this.timeout=1e4,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=A,this.conn=null,this.sendBuffer=[],this.serializer=new d,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this._resolveFetch=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>Promise.resolve().then(s.bind(s,743)).then((({default:t})=>t(...e))):fetch),(...e)=>t(...e)},this.endPoint=`${e}/${a.websocket}`,(null==t?void 0:t.transport)?this.transport=t.transport:this.transport=null,(null==t?void 0:t.params)&&(this.params=t.params),(null==t?void 0:t.headers)&&(this.headers=Object.assign(Object.assign({},this.headers),t.headers)),(null==t?void 0:t.timeout)&&(this.timeout=t.timeout),(null==t?void 0:t.logger)&&(this.logger=t.logger),(null==t?void 0:t.heartbeatIntervalMs)&&(this.heartbeatIntervalMs=t.heartbeatIntervalMs);const n=null===(i=null==t?void 0:t.params)||void 0===i?void 0:i.apikey;n&&(this.accessToken=n,this.apiKey=n),this.reconnectAfterMs=(null==t?void 0:t.reconnectAfterMs)?t.reconnectAfterMs:e=>[1e3,2e3,5e3,1e4][e-1]||1e4,this.encode=(null==t?void 0:t.encode)?t.encode:(e,t)=>t(JSON.stringify(e)),this.decode=(null==t?void 0:t.decode)?t.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new u((async()=>{this.disconnect(),this.connect()}),this.reconnectAfterMs),this.fetch=this._resolveFetch(null==t?void 0:t.fetch)}connect(){if(!this.conn)if(this.transport)this.conn=new this.transport(this._endPointURL(),void 0,{headers:this.headers});else{if($)return this.conn=new WebSocket(this._endPointURL()),void this.setupConnection();this.conn=new C(this._endPointURL(),void 0,{close:()=>{this.conn=null}}),s.e(26).then(s.t.bind(s,26,23)).then((({default:e})=>{this.conn=new e(this._endPointURL(),void 0,{headers:this.headers}),this.setupConnection()}))}}disconnect(e,t){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,null!=t?t:""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}async removeChannel(e){const t=await e.unsubscribe();return 0===this.channels.length&&this.disconnect(),t}async removeAllChannels(){const e=await Promise.all(this.channels.map((e=>e.unsubscribe())));return this.disconnect(),e}log(e,t,s){this.logger(e,t,s)}connectionState(){switch(this.conn&&this.conn.readyState){case i.connecting:return c.Connecting;case i.open:return c.Open;case i.closing:return c.Closing;default:return c.Closed}}isConnected(){return this.connectionState()===c.Open}channel(e,t={config:{}}){const s=new P(`realtime:${e}`,t,this);return this.channels.push(s),s}push(e){const{topic:t,event:s,payload:r,ref:i}=e,n=()=>{this.encode(e,(e=>{var t;null===(t=this.conn)||void 0===t||t.send(e)}))};this.log("push",`${t} ${s} (${i})`,r),this.isConnected()?n():this.sendBuffer.push(n)}setAuth(e){this.accessToken=e,this.channels.forEach((t=>{e&&t.updateJoinPayload({access_token:e}),t.joinedOnce&&t._isJoined()&&t._push(o.access_token,{access_token:e})}))}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find((t=>t.topic===e&&(t._isJoined()||t._isJoining())));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter((t=>t._joinRef()!==e._joinRef()))}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_endPointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:"1.0.0"}))}_onConnMessage(e){this.decode(e.data,(e=>{let{topic:t,event:s,payload:r,ref:i}=e;(i&&i===this.pendingHeartbeatRef||s===(null==r?void 0:r.type))&&(this.pendingHeartbeatRef=null),this.log("receive",`${r.status||""} ${t} ${s} ${i&&"("+i+")"||""}`,r),this.channels.filter((e=>e._isMember(t))).forEach((e=>e._trigger(s,r,i))),this.stateChangeCallbacks.message.forEach((t=>t(e)))}))}_onConnOpen(){this.log("transport",`connected to ${this._endPointURL()}`),this._flushSendBuffer(),this.reconnectTimer.reset(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval((()=>this._sendHeartbeat()),this.heartbeatIntervalMs),this.stateChangeCallbacks.open.forEach((e=>e()))}_onConnClose(e){this.log("transport","close",e),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach((t=>t(e)))}_onConnError(e){this.log("transport",e.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach((t=>t(e)))}_triggerChanError(){this.channels.forEach((e=>e._trigger(o.error)))}_appendParams(e,t){if(0===Object.keys(t).length)return e;const s=e.match(/\?/)?"&":"?";return`${e}${s}${new URLSearchParams(t)}`}_flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach((e=>e())),this.sendBuffer=[])}_sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef)return this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),void(null===(e=this.conn)||void 0===e||e.close(1e3,"hearbeat timeout"));this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth(this.accessToken)}}}class C{constructor(e,t,s){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=i.connecting,this.send=()=>{},this.url=null,this.url=e,this.close=s.close}}},752:(e,t,s)=>{s.r(t),s.d(t,{StorageApiError:()=>n,StorageClient:()=>T,StorageError:()=>r,StorageUnknownError:()=>o,isStorageError:()=>i});class r extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function i(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}class n extends r{constructor(e,t){super(e),this.name="StorageApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class o extends r{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}const a=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>Promise.resolve().then(s.bind(s,743)).then((({default:t})=>t(...e))):fetch),(...e)=>t(...e)};var c=function(e,t,s,r){return new(s||(s=Promise))((function(i,n){function o(e){try{c(r.next(e))}catch(e){n(e)}}function a(e){try{c(r.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};const l=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),h=(e,t)=>c(void 0,void 0,void 0,(function*(){const r=yield(i=void 0,a=void 0,c=void 0,h=function*(){return"undefined"==typeof Response?(yield Promise.resolve().then(s.bind(s,743))).Response:Response},new(c||(c=Promise))((function(e,t){function s(e){try{n(h.next(e))}catch(e){t(e)}}function r(e){try{n(h.throw(e))}catch(e){t(e)}}function n(t){var i;t.done?e(t.value):(i=t.value,i instanceof c?i:new c((function(e){e(i)}))).then(s,r)}n((h=h.apply(i,a||[])).next())})));var i,a,c,h;e instanceof r?e.json().then((s=>{t(new n(l(s),e.status||500))})).catch((e=>{t(new o(l(e),e))})):t(new o(l(e),e))})),u=(e,t,s,r)=>{const i={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?i:(i.headers=Object.assign({"Content-Type":"application/json"},null==t?void 0:t.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),s))};function d(e,t,s,r,i,n){return c(this,void 0,void 0,(function*(){return new Promise(((o,a)=>{e(s,u(t,r,i,n)).then((e=>{if(!e.ok)throw e;return(null==r?void 0:r.noResolveJson)?e:e.json()})).then((e=>o(e))).catch((e=>h(e,a)))}))}))}function f(e,t,s,r){return c(this,void 0,void 0,(function*(){return d(e,"GET",t,s,r)}))}function p(e,t,s,r,i){return c(this,void 0,void 0,(function*(){return d(e,"POST",t,r,i,s)}))}function g(e,t,s,r,i){return c(this,void 0,void 0,(function*(){return d(e,"DELETE",t,r,i,s)}))}var y=function(e,t,s,r){return new(s||(s=Promise))((function(i,n){function o(e){try{c(r.next(e))}catch(e){n(e)}}function a(e){try{c(r.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};const v={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},m={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class _{constructor(e,t={},s,r){this.url=e,this.headers=t,this.bucketId=s,this.fetch=a(r)}uploadOrUpdate(e,t,s,r){return y(this,void 0,void 0,(function*(){try{let i;const n=Object.assign(Object.assign({},m),r),o=Object.assign(Object.assign({},this.headers),"POST"===e&&{"x-upsert":String(n.upsert)});"undefined"!=typeof Blob&&s instanceof Blob?(i=new FormData,i.append("cacheControl",n.cacheControl),i.append("",s)):"undefined"!=typeof FormData&&s instanceof FormData?(i=s,i.append("cacheControl",n.cacheControl)):(i=s,o["cache-control"]=`max-age=${n.cacheControl}`,o["content-type"]=n.contentType);const a=this._removeEmptyFolders(t),c=this._getFinalPath(a),l=yield this.fetch(`${this.url}/object/${c}`,Object.assign({method:e,body:i,headers:o},(null==n?void 0:n.duplex)?{duplex:n.duplex}:{})),h=yield l.json();return l.ok?{data:{path:a,id:h.Id,fullPath:h.Key},error:null}:{data:null,error:h}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}upload(e,t,s){return y(this,void 0,void 0,(function*(){return this.uploadOrUpdate("POST",e,t,s)}))}uploadToSignedUrl(e,t,s,r){return y(this,void 0,void 0,(function*(){const n=this._removeEmptyFolders(e),o=this._getFinalPath(n),a=new URL(this.url+`/object/upload/sign/${o}`);a.searchParams.set("token",t);try{let e;const t=Object.assign({upsert:m.upsert},r),i=Object.assign(Object.assign({},this.headers),{"x-upsert":String(t.upsert)});"undefined"!=typeof Blob&&s instanceof Blob?(e=new FormData,e.append("cacheControl",t.cacheControl),e.append("",s)):"undefined"!=typeof FormData&&s instanceof FormData?(e=s,e.append("cacheControl",t.cacheControl)):(e=s,i["cache-control"]=`max-age=${t.cacheControl}`,i["content-type"]=t.contentType);const o=yield this.fetch(a.toString(),{method:"PUT",body:e,headers:i}),c=yield o.json();return o.ok?{data:{path:n,fullPath:c.Key},error:null}:{data:null,error:c}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}createSignedUploadUrl(e){return y(this,void 0,void 0,(function*(){try{let t=this._getFinalPath(e);const s=yield p(this.fetch,`${this.url}/object/upload/sign/${t}`,{},{headers:this.headers}),i=new URL(this.url+s.url),n=i.searchParams.get("token");if(!n)throw new r("No token returned by API");return{data:{signedUrl:i.toString(),path:e,token:n},error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}update(e,t,s){return y(this,void 0,void 0,(function*(){return this.uploadOrUpdate("PUT",e,t,s)}))}move(e,t){return y(this,void 0,void 0,(function*(){try{return{data:yield p(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers}),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}copy(e,t){return y(this,void 0,void 0,(function*(){try{return{data:{path:(yield p(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers})).Key},error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}createSignedUrl(e,t,s){return y(this,void 0,void 0,(function*(){try{let r=this._getFinalPath(e),i=yield p(this.fetch,`${this.url}/object/sign/${r}`,Object.assign({expiresIn:t},(null==s?void 0:s.transform)?{transform:s.transform}:{}),{headers:this.headers});const n=(null==s?void 0:s.download)?`&download=${!0===s.download?"":s.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${n}`)},{data:i,error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}createSignedUrls(e,t,s){return y(this,void 0,void 0,(function*(){try{const r=yield p(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),i=(null==s?void 0:s.download)?`&download=${!0===s.download?"":s.download}`:"";return{data:r.map((e=>Object.assign(Object.assign({},e),{signedUrl:e.signedURL?encodeURI(`${this.url}${e.signedURL}${i}`):null}))),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}download(e,t){return y(this,void 0,void 0,(function*(){const s=void 0!==(null==t?void 0:t.transform)?"render/image/authenticated":"object",r=this.transformOptsToQueryString((null==t?void 0:t.transform)||{}),n=r?`?${r}`:"";try{const t=this._getFinalPath(e),r=yield f(this.fetch,`${this.url}/${s}/${t}${n}`,{headers:this.headers,noResolveJson:!0});return{data:yield r.blob(),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}getPublicUrl(e,t){const s=this._getFinalPath(e),r=[],i=(null==t?void 0:t.download)?`download=${!0===t.download?"":t.download}`:"";""!==i&&r.push(i);const n=void 0!==(null==t?void 0:t.transform)?"render/image":"object",o=this.transformOptsToQueryString((null==t?void 0:t.transform)||{});""!==o&&r.push(o);let a=r.join("&");return""!==a&&(a=`?${a}`),{data:{publicUrl:encodeURI(`${this.url}/${n}/public/${s}${a}`)}}}remove(e){return y(this,void 0,void 0,(function*(){try{return{data:yield g(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}list(e,t,s){return y(this,void 0,void 0,(function*(){try{const r=Object.assign(Object.assign(Object.assign({},v),t),{prefix:e||""});return{data:yield p(this.fetch,`${this.url}/object/list/${this.bucketId}`,r,{headers:this.headers},s),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}}const b={"X-Client-Info":"storage-js/2.5.5"};var w=function(e,t,s,r){return new(s||(s=Promise))((function(i,n){function o(e){try{c(r.next(e))}catch(e){n(e)}}function a(e){try{c(r.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};class k{constructor(e,t={},s){this.url=e,this.headers=Object.assign(Object.assign({},b),t),this.fetch=a(s)}listBuckets(){return w(this,void 0,void 0,(function*(){try{return{data:yield f(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}getBucket(e){return w(this,void 0,void 0,(function*(){try{return{data:yield f(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}createBucket(e,t={public:!1}){return w(this,void 0,void 0,(function*(){try{return{data:yield p(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}updateBucket(e,t){return w(this,void 0,void 0,(function*(){try{const s=yield function(e,t,s,r,i){return c(this,void 0,void 0,(function*(){return d(e,"PUT",t,r,undefined,s)}))}(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers});return{data:s,error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}emptyBucket(e){return w(this,void 0,void 0,(function*(){try{return{data:yield p(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}deleteBucket(e){return w(this,void 0,void 0,(function*(){try{return{data:yield g(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}}class T extends k{constructor(e,t={},s){super(e,t,s)}from(e){return new _(this.url,this.headers,e,this.fetch)}}},296:function(e,t,s){var r=this&&this.__awaiter||function(e,t,s,r){return new(s||(s=Promise))((function(i,n){function o(e){try{c(r.next(e))}catch(e){n(e)}}function a(e){try{c(r.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=s(982),n=s(0),o=s(73),a=s(752),c=s(678),l=s(716),h=s(610),u=s(283);t.default=class{constructor(e,t,s){var r,i,o,a,u,d,f,p;if(this.supabaseUrl=e,this.supabaseKey=t,this.from=e=>this.rest.from(e),this.schema=e=>this.rest.schema(e),this.rpc=(e,t={},s)=>this.rest.rpc(e,t,s),!e)throw new Error("supabaseUrl is required.");if(!t)throw new Error("supabaseKey is required.");const g=(0,h.stripTrailingSlash)(e);this.realtimeUrl=`${g}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${g}/auth/v1`,this.storageUrl=`${g}/storage/v1`,this.functionsUrl=`${g}/functions/v1`;const y=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,v={db:c.DEFAULT_DB_OPTIONS,realtime:c.DEFAULT_REALTIME_OPTIONS,auth:Object.assign(Object.assign({},c.DEFAULT_AUTH_OPTIONS),{storageKey:y}),global:c.DEFAULT_GLOBAL_OPTIONS},m=(0,h.applySettingDefaults)(null!=s?s:{},v);this.storageKey=null!==(i=null===(r=m.auth)||void 0===r?void 0:r.storageKey)&&void 0!==i?i:"",this.headers=null!==(a=null===(o=m.global)||void 0===o?void 0:o.headers)&&void 0!==a?a:{},this.auth=this._initSupabaseAuthClient(null!==(u=m.auth)&&void 0!==u?u:{},this.headers,null===(d=m.global)||void 0===d?void 0:d.fetch),this.fetch=(0,l.fetchWithAuth)(t,this._getAccessToken.bind(this),null===(f=m.global)||void 0===f?void 0:f.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},m.realtime)),this.rest=new n.PostgrestClient(`${g}/rest/v1`,{headers:this.headers,schema:null===(p=m.db)||void 0===p?void 0:p.schema,fetch:this.fetch}),this._listenForAuthEvents()}get functions(){return new i.FunctionsClient(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new a.StorageClient(this.storageUrl,this.headers,this.fetch)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,t;return r(this,void 0,void 0,(function*(){const{data:s}=yield this.auth.getSession();return null!==(t=null===(e=s.session)||void 0===e?void 0:e.access_token)&&void 0!==t?t:null}))}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:r,storageKey:i,flowType:n,debug:o},a,c){const l={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new u.SupabaseAuthClient({url:this.authUrl,headers:Object.assign(Object.assign({},l),a),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:r,flowType:n,debug:o,fetch:c})}_initRealtimeClient(e){return new o.RealtimeClient(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},null==e?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange(((e,t)=>{this._handleTokenChanged(e,"CLIENT",null==t?void 0:t.access_token)}))}_handleTokenChanged(e,t,s){"TOKEN_REFRESHED"!==e&&"SIGNED_IN"!==e||this.changedAccessToken===s?"SIGNED_OUT"===e&&(this.realtime.setAuth(this.supabaseKey),"STORAGE"==t&&this.auth.signOut(),this.changedAccessToken=void 0):(this.realtime.setAuth(null!=s?s:null),this.changedAccessToken=s)}}},341:function(e,t,s){var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s);var i=Object.getOwnPropertyDescriptor(t,s);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,r,i)}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),i=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||r(t,e,s)},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createClient=t.SupabaseClient=t.FunctionsError=t.FunctionsRelayError=t.FunctionsFetchError=t.FunctionsHttpError=void 0;const o=n(s(296));i(s(745),t);var a=s(982);Object.defineProperty(t,"FunctionsHttpError",{enumerable:!0,get:function(){return a.FunctionsHttpError}}),Object.defineProperty(t,"FunctionsFetchError",{enumerable:!0,get:function(){return a.FunctionsFetchError}}),Object.defineProperty(t,"FunctionsRelayError",{enumerable:!0,get:function(){return a.FunctionsRelayError}}),Object.defineProperty(t,"FunctionsError",{enumerable:!0,get:function(){return a.FunctionsError}}),i(s(73),t);var c=s(296);Object.defineProperty(t,"SupabaseClient",{enumerable:!0,get:function(){return n(c).default}}),t.createClient=(e,t,s)=>new o.default(e,t,s)},283:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SupabaseAuthClient=void 0;const r=s(745);class i extends r.GoTrueClient{constructor(e){super(e)}}t.SupabaseAuthClient=i},678:(e,t,s)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_REALTIME_OPTIONS=t.DEFAULT_AUTH_OPTIONS=t.DEFAULT_DB_OPTIONS=t.DEFAULT_GLOBAL_OPTIONS=t.DEFAULT_HEADERS=void 0;const r=s(506);let i="";i="undefined"!=typeof Deno?"deno":"undefined"!=typeof document?"web":"undefined"!=typeof navigator&&"ReactNative"===navigator.product?"react-native":"node",t.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${i}/${r.version}`},t.DEFAULT_GLOBAL_OPTIONS={headers:t.DEFAULT_HEADERS},t.DEFAULT_DB_OPTIONS={schema:"public"},t.DEFAULT_AUTH_OPTIONS={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},t.DEFAULT_REALTIME_OPTIONS={}},716:function(e,t,s){var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s);var i=Object.getOwnPropertyDescriptor(t,s);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,r,i)}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return i(t,e),t},o=this&&this.__awaiter||function(e,t,s,r){return new(s||(s=Promise))((function(i,n){function o(e){try{c(r.next(e))}catch(e){n(e)}}function a(e){try{c(r.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchWithAuth=t.resolveHeadersConstructor=t.resolveFetch=void 0;const a=n(s(743));t.resolveFetch=e=>{let t;return t=e||("undefined"==typeof fetch?a.default:fetch),(...e)=>t(...e)},t.resolveHeadersConstructor=()=>"undefined"==typeof Headers?a.Headers:Headers,t.fetchWithAuth=(e,s,r)=>{const i=(0,t.resolveFetch)(r),n=(0,t.resolveHeadersConstructor)();return(t,r)=>o(void 0,void 0,void 0,(function*(){var o;const a=null!==(o=yield s())&&void 0!==o?o:e;let c=new n(null==r?void 0:r.headers);return c.has("apikey")||c.set("apikey",e),c.has("Authorization")||c.set("Authorization",`Bearer ${a}`),i(t,Object.assign(Object.assign({},r),{headers:c}))}))}},610:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.applySettingDefaults=t.isBrowser=t.stripTrailingSlash=t.uuid=void 0,t.uuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))},t.stripTrailingSlash=function(e){return e.replace(/\/$/,"")},t.isBrowser=()=>"undefined"!=typeof window,t.applySettingDefaults=function(e,t){const{db:s,auth:r,realtime:i,global:n}=e,{db:o,auth:a,realtime:c,global:l}=t;return{db:Object.assign(Object.assign({},o),s),auth:Object.assign(Object.assign({},a),r),realtime:Object.assign(Object.assign({},c),i),global:Object.assign(Object.assign({},l),n)}}},506:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="2.39.6"}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={exports:{}};return i[e].call(s.exports,s,s.exports,o),s.exports}return o.m=i,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(s,r){if(1&r&&(s=this(s)),8&r)return s;if("object"==typeof s&&s){if(4&r&&s.__esModule)return s;if(16&r&&"function"==typeof s.then)return s}var i=Object.create(null);o.r(i);var n={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&s;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>n[e]=()=>s[e]));return n.default=()=>s,o.d(i,n),i},o.d=(e,t)=>{for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,s)=>(o.f[s](e,t),t)),[])),o.u=e=>e+".supabase.js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s={},r="supabase:",o.l=(e,t,i,n)=>{if(s[e])s[e].push(t);else{var a,c;if(void 0!==i)for(var l=document.getElementsByTagName("script"),h=0;h{a.onerror=a.onload=null,clearTimeout(f);var i=s[e];if(delete s[e],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((e=>e(r))),t)return t(r)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),c&&document.head.appendChild(a)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var s=t.getElementsByTagName("script");if(s.length)for(var r=s.length-1;r>-1&&!e;)e=s[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e={179:0};o.f.j=(t,s)=>{var r=o.o(e,t)?e[t]:void 0;if(0!==r)if(r)s.push(r[2]);else{var i=new Promise(((s,i)=>r=e[t]=[s,i]));s.push(r[2]=i);var n=o.p+o.u(t),a=new Error;o.l(n,(s=>{if(o.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=s&&("load"===s.type?"missing":s.type),n=s&&s.target&&s.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+n+")",a.name="ChunkLoadError",a.type=i,a.request=n,r[1](a)}}),"chunk-"+t,t)}};var t=(t,s)=>{var r,i,[n,a,c]=s,l=0;if(n.some((t=>0!==e[t]))){for(r in a)o.o(a,r)&&(o.m[r]=a[r]);c&&c(o)}for(t&&t(s);l(()=>{var e,t,s={982:(e,t,s)=>{"use strict";s.r(t),s.d(t,{FunctionsClient:()=>a,FunctionsError:()=>r,FunctionsFetchError:()=>i,FunctionsHttpError:()=>o,FunctionsRelayError:()=>n});class r extends Error{constructor(e,t="FunctionsError",s){super(e),this.name=t,this.context=s}}class i extends r{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class n extends r{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class o extends r{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}class a{constructor(e,{headers:t={},customFetch:r}={}){this.url=e,this.headers=t,this.fetch=(e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>Promise.resolve().then(s.t.bind(s,743,23)).then((({default:t})=>t(...e))):fetch),(...e)=>t(...e)})(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var s,r,a,c,l;return r=this,a=void 0,l=function*(){try{const{headers:r,method:a,body:c}=t;let l,h={};c&&(r&&!Object.prototype.hasOwnProperty.call(r,"Content-Type")||!r)&&("undefined"!=typeof Blob&&c instanceof Blob||c instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",l=c):"string"==typeof c?(h["Content-Type"]="text/plain",l=c):"undefined"!=typeof FormData&&c instanceof FormData?l=c:(h["Content-Type"]="application/json",l=JSON.stringify(c)));const u=yield this.fetch(`${this.url}/${e}`,{method:a||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),r),body:l}).catch((e=>{throw new i(e)})),d=u.headers.get("x-relay-error");if(d&&"true"===d)throw new n(u);if(!u.ok)throw new o(u);let f,p=(null!==(s=u.headers.get("Content-Type"))&&void 0!==s?s:"text/plain").split(";")[0].trim();return f="application/json"===p?yield u.json():"application/octet-stream"===p?yield u.blob():"multipart/form-data"===p?yield u.formData():yield u.text(),{data:f,error:null}}catch(e){return{data:null,error:e}}},new((c=void 0)||(c=Promise))((function(e,t){function s(e){try{n(l.next(e))}catch(e){t(e)}}function i(e){try{n(l.throw(e))}catch(e){t(e)}}function n(t){var r;t.done?e(t.value):(r=t.value,r instanceof c?r:new c((function(e){e(r)}))).then(s,i)}n((l=l.apply(r,a||[])).next())}))}}},765:(e,t,s)=>{"use strict";s.r(t),s.d(t,{AuthApiError:()=>_,AuthError:()=>v,AuthImplicitGrantRedirectError:()=>j,AuthInvalidCredentialsError:()=>E,AuthInvalidTokenResponseError:()=>T,AuthPKCEGrantCodeExchangeError:()=>O,AuthRetryableFetchError:()=>P,AuthSessionMissingError:()=>S,AuthUnknownError:()=>w,AuthWeakPasswordError:()=>x,CustomAuthError:()=>k,GoTrueAdminApi:()=>q,GoTrueClient:()=>Z,NavigatorLockAcquireTimeoutError:()=>V,isAuthApiError:()=>b,isAuthError:()=>m,isAuthRetryableFetchError:()=>$,isAuthWeakPasswordError:()=>A,lockInternals:()=>H,navigatorLock:()=>W});const r=()=>"undefined"!=typeof document,i={tested:!1,writable:!1},n=()=>{if(!r())return!1;try{if("object"!=typeof globalThis.localStorage)return!1}catch(e){return!1}if(i.tested)return i.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),i.tested=!0,i.writable=!0}catch(e){i.tested=!0,i.writable=!1}return i.writable};function o(e){const t={},s=new URL(e);if(s.hash&&"#"===s.hash[0])try{new URLSearchParams(s.hash.substring(1)).forEach(((e,s)=>{t[s]=e}))}catch(e){}return s.searchParams.forEach(((e,s)=>{t[s]=e})),t}const a=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>Promise.resolve().then(s.t.bind(s,743,23)).then((({default:t})=>t(...e))):fetch),(...e)=>t(...e)},c=e=>"object"==typeof e&&null!==e&&"status"in e&&"ok"in e&&"json"in e&&"function"==typeof e.json,l=async(e,t,s)=>{await e.setItem(t,JSON.stringify(s))},h=async(e,t)=>{const s=await e.getItem(t);if(!s)return null;try{return JSON.parse(s)}catch(e){return s}},u=async(e,t)=>{await e.removeItem(t)};class d{constructor(){this.promise=new d.promiseConstructor(((e,t)=>{this.resolve=e,this.reject=t}))}}function f(e){const t=e.split(".");if(3!==t.length)throw new Error("JWT is not valid: not a JWT structure");if(!/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i.test(t[1]))throw new Error("JWT is not valid: payload is not in base64url format");const s=t[1];return JSON.parse(function(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s,r,i,n,o,a,c,l="",h=0;for(e=e.replace("-","+").replace("_","/");h>4,r=(15&o)<<4|a>>2,i=(3&a)<<6|c,l+=String.fromCharCode(s),64!=a&&0!=r&&(l+=String.fromCharCode(r)),64!=c&&0!=i&&(l+=String.fromCharCode(i));return l}(s))}function p(e){return("0"+e.toString(16)).substr(-2)}function g(){const e=new Uint32Array(56);if("undefined"==typeof crypto){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",t=e.length;let s="";for(let r=0;r<56;r++)s+=e.charAt(Math.floor(Math.random()*t));return s}return crypto.getRandomValues(e),Array.from(e,p).join("")}async function y(e){if("undefined"==typeof crypto||void 0===crypto.subtle||"undefined"==typeof TextEncoder)return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const t=await async function(e){const t=(new TextEncoder).encode(e),s=await crypto.subtle.digest("SHA-256",t),r=new Uint8Array(s);return Array.from(r).map((e=>String.fromCharCode(e))).join("")}(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}d.promiseConstructor=Promise;class v extends Error{constructor(e,t){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t}}function m(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}class _ extends v{constructor(e,t){super(e,t),this.name="AuthApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}function b(e){return m(e)&&"AuthApiError"===e.name}class w extends v{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class k extends v{constructor(e,t,s){super(e),this.name=t,this.status=s}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class S extends k{constructor(){super("Auth session missing!","AuthSessionMissingError",400)}}class T extends k{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500)}}class E extends k{constructor(e){super(e,"AuthInvalidCredentialsError",400)}}class j extends k{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class O extends k{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class P extends k{constructor(e,t){super(e,"AuthRetryableFetchError",t)}}function $(e){return m(e)&&"AuthRetryableFetchError"===e.name}class x extends k{constructor(e,t,s){super(e,"AuthWeakPasswordError",t),this.reasons=s}}function A(e){return m(e)&&"AuthWeakPasswordError"===e.name}const C=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),R=[502,503,504];async function I(e){if(!c(e))throw new P(C(e),0);if(R.includes(e.status))throw new P(C(e),e.status);let t;try{t=await e.json()}catch(e){throw new w(C(e),e)}if("object"==typeof t&&t&&"object"==typeof t.weak_password&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce(((e,t)=>e&&"string"==typeof t),!0))throw new x(C(t),e.status,t.weak_password.reasons);throw new _(C(t),e.status||500)}async function L(e,t,s,r){var i;const n=Object.assign({},null==r?void 0:r.headers);(null==r?void 0:r.jwt)&&(n.Authorization=`Bearer ${r.jwt}`);const o=null!==(i=null==r?void 0:r.query)&&void 0!==i?i:{};(null==r?void 0:r.redirectTo)&&(o.redirect_to=r.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await async function(e,t,s,r,i,n){const o=((e,t,s,r)=>{const i={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null==t?void 0:t.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),s))})(t,r,{},n);let a;try{a=await e(s,o)}catch(e){throw console.error(e),new P(C(e),0)}if(a.ok||await I(a),null==r?void 0:r.noResolveJson)return a;try{return await a.json()}catch(e){await I(e)}}(e,t,s+a,{headers:n,noResolveJson:null==r?void 0:r.noResolveJson},0,null==r?void 0:r.body);return(null==r?void 0:r.xform)?null==r?void 0:r.xform(c):{data:Object.assign({},c),error:null}}function U(e){var t;let s=null;var r;return function(e){return e.access_token&&e.refresh_token&&e.expires_in}(e)&&(s=Object.assign({},e),e.expires_at||(s.expires_at=(r=e.expires_in,Math.round(Date.now()/1e3)+r))),{data:{session:s,user:null!==(t=e.user)&&void 0!==t?t:e},error:null}}function N(e){var t;return{data:{user:null!==(t=e.user)&&void 0!==t?t:e},error:null}}function D(e){return{data:e,error:null}}function F(e){const{action_link:t,email_otp:s,hashed_token:r,redirect_to:i,verification_type:n}=e,o=function(e,t){var s={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(s[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0&&(d.forEach((e=>{const t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),s=JSON.parse(e.split(";")[1].split("=")[1]);c[`${s}Page`]=t})),c.total=parseInt(u)),{data:Object.assign(Object.assign({},h),c),error:null}}catch(e){if(m(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){try{return await L(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:N})}catch(e){if(m(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){try{return await L(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:N})}catch(e){if(m(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){try{return await L(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:N})}catch(e){if(m(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){try{const{data:t,error:s}=await L(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:s}}catch(e){if(m(e))return{data:null,error:e};throw e}}async _deleteFactor(e){try{return{data:await L(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(e){if(m(e))return{data:null,error:e};throw e}}}const B="2.60.1",J={"X-Client-Info":`gotrue-js/${B}`},z={getItem:e=>n()?globalThis.localStorage.getItem(e):null,setItem:(e,t)=>{n()&&globalThis.localStorage.setItem(e,t)},removeItem:e=>{n()&&globalThis.localStorage.removeItem(e)}};function G(e={}){return{getItem:t=>e[t]||null,setItem:(t,s)=>{e[t]=s},removeItem:t=>{delete e[t]}}}const H={debug:!!(globalThis&&n()&&globalThis.localStorage&&"true"===globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug"))};class K extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class V extends K{}async function W(e,t,s){H.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;return t>0&&setTimeout((()=>{r.abort(),H.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)}),t),await globalThis.navigator.locks.request(e,0===t?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},(async r=>{if(!r){if(0===t)throw H.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new V(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(H.debug)try{const e=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(e,null," "))}catch(e){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",e)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await s()}H.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,r.name);try{return await s()}finally{H.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,r.name)}}))}!function(){if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(e){"undefined"!=typeof self&&(self.globalThis=self)}}();const Y={url:"http://localhost:9999",storageKey:"supabase.auth.token",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:J,flowType:"implicit",debug:!1},X=3e4;async function Q(e,t,s){return await s()}class Z{constructor(e){var t;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=Z.nextInstanceID,Z.nextInstanceID+=1,this.instanceID>0&&r()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const s=Object.assign(Object.assign({},Y),e);if(this.logDebugMessages=!!s.debug,"function"==typeof s.debug&&(this.logger=s.debug),this.persistSession=s.persistSession,this.storageKey=s.storageKey,this.autoRefreshToken=s.autoRefreshToken,this.admin=new q({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=a(s.fetch),this.lock=s.lock||Q,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?s.storage?this.storage=s.storage:n()?this.storage=z:(this.memoryStorage={},this.storage=G(this.memoryStorage)):(this.memoryStorage={},this.storage=G(this.memoryStorage)),r()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",e)}null===(t=this.broadcastChannel)||void 0===t||t.addEventListener("message",(async e=>{this._debug("received broadcast notification from other tab or client",e),await this._notifyAllSubscribers(e.data.event,e.data.session,!1)}))}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${B}) ${(new Date).toISOString()}`,...e),this}async initialize(){return this.initializePromise||(this.initializePromise=(async()=>await this._acquireLock(-1,(async()=>await this._initialize())))()),await this.initializePromise}async _initialize(){try{const e=!!r()&&await this._isPKCEFlow();if(this._debug("#_initialize()","begin","is PKCE flow",e),e||this.detectSessionInUrl&&this._isImplicitGrantFlow()){const{data:t,error:s}=await this._getSessionFromURL(e);if(s)return this._debug("#_initialize()","error detecting session from URL",s),"Identity is already linked"===(null==s?void 0:s.message)||"Identity is already linked to another user"===(null==s?void 0:s.message)||await this._removeSession(),{error:s};const{session:r,redirectType:i}=t;return this._debug("#_initialize()","detected session in URL",r,"redirect type",i),await this._saveSession(r),setTimeout((async()=>{"recovery"===i?await this._notifyAllSubscribers("PASSWORD_RECOVERY",r):await this._notifyAllSubscribers("SIGNED_IN",r)}),0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return m(e)?{error:e}:{error:new w("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signUp(e){var t,s,r;try{let i;if(await this._removeSession(),"email"in e){const{email:s,password:r,options:n}=e;let o=null,a=null;if("pkce"===this.flowType){const e=g();await l(this.storage,`${this.storageKey}-code-verifier`,e),o=await y(e),a=e===o?"plain":"s256"}i=await L(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:null==n?void 0:n.emailRedirectTo,body:{email:s,password:r,data:null!==(t=null==n?void 0:n.data)&&void 0!==t?t:{},gotrue_meta_security:{captcha_token:null==n?void 0:n.captchaToken},code_challenge:o,code_challenge_method:a},xform:U})}else{if(!("phone"in e))throw new E("You must provide either an email or phone number and a password");{const{phone:t,password:n,options:o}=e;i=await L(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:n,data:null!==(s=null==o?void 0:o.data)&&void 0!==s?s:{},channel:null!==(r=null==o?void 0:o.channel)&&void 0!==r?r:"sms",gotrue_meta_security:{captcha_token:null==o?void 0:o.captchaToken}},xform:U})}}const{data:n,error:o}=i;if(o||!n)return{data:{user:null,session:null},error:o};const a=n.session,c=n.user;return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",a)),{data:{user:c,session:a},error:null}}catch(e){if(m(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithPassword(e){try{let t;if(await this._removeSession(),"email"in e){const{email:s,password:r,options:i}=e;t=await L(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:U})}else{if(!("phone"in e))throw new E("You must provide either an email or phone number and a password");{const{phone:s,password:r,options:i}=e;t=await L(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:U})}}const{data:s,error:r}=t;return r?{data:{user:null,session:null},error:r}:s&&s.session&&s.user?(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:{user:s.user,session:s.session},error:r}):{data:{user:null,session:null},error:new T}}catch(e){if(m(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithOAuth(e){var t,s,r,i;return await this._removeSession(),await this._handleProviderSignIn(e.provider,{redirectTo:null===(t=e.options)||void 0===t?void 0:t.redirectTo,scopes:null===(s=e.options)||void 0===s?void 0:s.scopes,queryParams:null===(r=e.options)||void 0===r?void 0:r.queryParams,skipBrowserRedirect:null===(i=e.options)||void 0===i?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,(async()=>this._exchangeCodeForSession(e)))}async _exchangeCodeForSession(e){const[t,s]=(await h(this.storage,`${this.storageKey}-code-verifier`)).split("/"),{data:r,error:i}=await L(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:t},xform:U});return await u(this.storage,`${this.storageKey}-code-verifier`),i?{data:{user:null,session:null,redirectType:null},error:i}:r&&r.session&&r.user?(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:Object.assign(Object.assign({},r),{redirectType:null!=s?s:null}),error:i}):{data:{user:null,session:null,redirectType:null},error:new T}}async signInWithIdToken(e){await this._removeSession();try{const{options:t,provider:s,token:r,access_token:i,nonce:n}=e,o=await L(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:r,access_token:i,nonce:n,gotrue_meta_security:{captcha_token:null==t?void 0:t.captchaToken}},xform:U}),{data:a,error:c}=o;return c?{data:{user:null,session:null},error:c}:a&&a.session&&a.user?(a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),{data:a,error:c}):{data:{user:null,session:null},error:new T}}catch(e){if(m(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithOtp(e){var t,s,r,i,n;try{if(await this._removeSession(),"email"in e){const{email:r,options:i}=e;let n=null,o=null;if("pkce"===this.flowType){const e=g();await l(this.storage,`${this.storageKey}-code-verifier`,e),n=await y(e),o=e===n?"plain":"s256"}const{error:a}=await L(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:r,data:null!==(t=null==i?void 0:i.data)&&void 0!==t?t:{},create_user:null===(s=null==i?void 0:i.shouldCreateUser)||void 0===s||s,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken},code_challenge:n,code_challenge_method:o},redirectTo:null==i?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:a}}if("phone"in e){const{phone:t,options:s}=e,{data:o,error:a}=await L(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:null!==(r=null==s?void 0:s.data)&&void 0!==r?r:{},create_user:null===(i=null==s?void 0:s.shouldCreateUser)||void 0===i||i,gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken},channel:null!==(n=null==s?void 0:s.channel)&&void 0!==n?n:"sms"}});return{data:{user:null,session:null,messageId:null==o?void 0:o.message_id},error:a}}throw new E("You must provide either an email or phone number.")}catch(e){if(m(e))return{data:{user:null,session:null},error:e};throw e}}async verifyOtp(e){var t,s;try{let r,i;"email_change"!==e.type&&"phone_change"!==e.type&&await this._removeSession(),"options"in e&&(r=null===(t=e.options)||void 0===t?void 0:t.redirectTo,i=null===(s=e.options)||void 0===s?void 0:s.captchaToken);const{data:n,error:o}=await L(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:r,xform:U});if(o)throw o;if(!n)throw new Error("An error occurred on token verification.");const a=n.session,c=n.user;return(null==a?void 0:a.access_token)&&(await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)),{data:{user:c,session:a},error:null}}catch(e){if(m(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithSSO(e){var t,s,r;try{await this._removeSession();let i=null,n=null;if("pkce"===this.flowType){const e=g();await l(this.storage,`${this.storageKey}-code-verifier`,e),i=await y(e),n=e===i?"plain":"s256"}return await L(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:null!==(s=null===(t=e.options)||void 0===t?void 0:t.redirectTo)&&void 0!==s?s:void 0}),(null===(r=null==e?void 0:e.options)||void 0===r?void 0:r.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:n}),headers:this.headers,xform:D})}catch(e){if(m(e))return{data:null,error:e};throw e}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,(async()=>await this._reauthenticate()))}async _reauthenticate(){try{return await this._useSession((async e=>{const{data:{session:t},error:s}=e;if(s)throw s;if(!t)throw new S;const{error:r}=await L(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return{data:{user:null,session:null},error:r}}))}catch(e){if(m(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{"email_change"!=e.type&&"phone_change"!=e.type&&await this._removeSession();const t=`${this.url}/resend`;if("email"in e){const{email:s,type:r,options:i}=e,{error:n}=await L(this.fetch,"POST",t,{headers:this.headers,body:{email:s,type:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},redirectTo:null==i?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:n}}if("phone"in e){const{phone:s,type:r,options:i}=e,{data:n,error:o}=await L(this.fetch,"POST",t,{headers:this.headers,body:{phone:s,type:r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}}});return{data:{user:null,session:null,messageId:null==n?void 0:n.message_id},error:o}}throw new E("You must provide either an email or phone number and a type")}catch(e){if(m(e))return{data:{user:null,session:null},error:e};throw e}}async getSession(){return await this.initializePromise,this._acquireLock(-1,(async()=>this._useSession((async e=>e))))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const e=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await e,await t()))();return this.pendingInLock.push((async()=>{try{await s}catch(e){}})()),s}return await this.lock(`lock:${this.storageKey}`,e,(async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const e=t();for(this.pendingInLock.push((async()=>{try{await e}catch(e){}})()),await e;this.pendingInLock.length;){const e=[...this.pendingInLock];await Promise.all(e),this.pendingInLock.splice(0,e.length)}return await e}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}}))}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",(new Error).stack);try{let e=null;const t=await h(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),null!==t&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const s=!!e.expires_at&&e.expires_at<=Date.now()/1e3;if(this._debug("#__loadSession()",`session has${s?"":" not"} expired`,"expires_at",e.expires_at),!s)return{data:{session:e},error:null};const{session:r,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{session:null},error:i}:{data:{session:r},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,this._acquireLock(-1,(async()=>await this._getUser())))}async _getUser(e){try{return e?await L(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:N}):await this._useSession((async e=>{var t,s;const{data:r,error:i}=e;if(i)throw i;return await L(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:null!==(s=null===(t=r.session)||void 0===t?void 0:t.access_token)&&void 0!==s?s:void 0,xform:N})}))}catch(e){if(m(e))return{data:{user:null},error:e};throw e}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(-1,(async()=>await this._updateUser(e,t)))}async _updateUser(e,t={}){try{return await this._useSession((async s=>{const{data:r,error:i}=s;if(i)throw i;if(!r.session)throw new S;const n=r.session;let o=null,a=null;if("pkce"===this.flowType&&null!=e.email){const e=g();await l(this.storage,`${this.storageKey}-code-verifier`,e),o=await y(e),a=e===o?"plain":"s256"}const{data:c,error:h}=await L(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:null==t?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:o,code_challenge_method:a}),jwt:n.access_token,xform:N});if(h)throw h;return n.user=c.user,await this._saveSession(n),await this._notifyAllSubscribers("USER_UPDATED",n),{data:{user:n.user},error:null}}))}catch(e){if(m(e))return{data:{user:null},error:e};throw e}}_decodeJWT(e){return f(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,(async()=>await this._setSession(e)))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new S;const t=Date.now()/1e3;let s=t,r=!0,i=null;const n=f(e.access_token);if(n.exp&&(s=n.exp,r=s<=t),r){const{session:t,error:s}=await this._callRefreshToken(e.refresh_token);if(s)return{data:{user:null,session:null},error:s};if(!t)return{data:{user:null,session:null},error:null};i=t}else{const{data:r,error:n}=await this._getUser(e.access_token);if(n)throw n;i={access_token:e.access_token,refresh_token:e.refresh_token,user:r.user,token_type:"bearer",expires_in:s-t,expires_at:s},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(e){if(m(e))return{data:{session:null,user:null},error:e};throw e}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,(async()=>await this._refreshSession(e)))}async _refreshSession(e){try{return await this._useSession((async t=>{var s;if(!e){const{data:r,error:i}=t;if(i)throw i;e=null!==(s=r.session)&&void 0!==s?s:void 0}if(!(null==e?void 0:e.refresh_token))throw new S;const{session:r,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{user:null,session:null},error:i}:r?{data:{user:r.user,session:r},error:null}:{data:{user:null,session:null},error:null}}))}catch(e){if(m(e))return{data:{user:null,session:null},error:e};throw e}}async _getSessionFromURL(e){try{if(!r())throw new j("No browser detected.");if("implicit"===this.flowType&&!this._isImplicitGrantFlow())throw new j("Not a valid implicit grant flow url.");if("pkce"==this.flowType&&!e)throw new O("Not a valid PKCE flow url.");const t=o(window.location.href);if(e){if(!t.code)throw new O("No code detected.");const{data:e,error:s}=await this._exchangeCodeForSession(t.code);if(s)throw s;const r=new URL(window.location.href);return r.searchParams.delete("code"),window.history.replaceState(window.history.state,"",r.toString()),{data:{session:e.session,redirectType:null},error:null}}if(t.error||t.error_description||t.error_code)throw new j(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});const{provider_token:s,provider_refresh_token:i,access_token:n,refresh_token:a,expires_in:c,expires_at:l,token_type:h}=t;if(!(n&&c&&a&&h))throw new j("No session defined in URL");const u=Math.round(Date.now()/1e3),d=parseInt(c);let f=u+d;l&&(f=parseInt(l));const p=f-u;1e3*p<=X&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${d}s`);const g=f-d;u-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,f,u):u-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clok for skew",g,f,u);const{data:y,error:v}=await this._getUser(n);if(v)throw v;const m={provider_token:s,provider_refresh_token:i,access_token:n,expires_in:d,expires_at:f,refresh_token:a,token_type:h,user:y.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:m,redirectType:t.type},error:null}}catch(e){if(m(e))return{data:{session:null,redirectType:null},error:e};throw e}}_isImplicitGrantFlow(){const e=o(window.location.href);return!(!r()||!e.access_token&&!e.error_description)}async _isPKCEFlow(){const e=o(window.location.href),t=await h(this.storage,`${this.storageKey}-code-verifier`);return!(!e.code||!t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,(async()=>await this._signOut(e)))}async _signOut({scope:e}={scope:"global"}){return await this._useSession((async t=>{var s;const{data:r,error:i}=t;if(i)return{error:i};const n=null===(s=r.session)||void 0===s?void 0:s.access_token;if(n){const{error:t}=await this.admin.signOut(n,e);if(t&&(!b(t)||404!==t.status&&401!==t.status))return{error:t}}return"others"!==e&&(await this._removeSession(),await u(this.storage,`${this.storageKey}-code-verifier`),await this._notifyAllSubscribers("SIGNED_OUT",null)),{error:null}}))}onAuthStateChange(e){const t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),s={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,s),(async()=>{await this.initializePromise,await this._acquireLock(-1,(async()=>{this._emitInitialSession(t)}))})(),{data:{subscription:s}}}async _emitInitialSession(e){return await this._useSession((async t=>{var s,r;try{const{data:{session:r},error:i}=t;if(i)throw i;await(null===(s=this.stateChangeEmitters.get(e))||void 0===s?void 0:s.callback("INITIAL_SESSION",r)),this._debug("INITIAL_SESSION","callback id",e,"session",r)}catch(t){await(null===(r=this.stateChangeEmitters.get(e))||void 0===r?void 0:r.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",t),console.error(t)}}))}async resetPasswordForEmail(e,t={}){let s=null,r=null;if("pkce"===this.flowType){const e=g();await l(this.storage,`${this.storageKey}-code-verifier`,`${e}/PASSWORD_RECOVERY`),s=await y(e),r=e===s?"plain":"s256"}try{return await L(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:s,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(m(e))return{data:null,error:e};throw e}}async getUserIdentities(){var e;try{const{data:t,error:s}=await this.getUser();if(s)throw s;return{data:{identities:null!==(e=t.user.identities)&&void 0!==e?e:[]},error:null}}catch(e){if(m(e))return{data:null,error:e};throw e}}async linkIdentity(e){var t;try{const{data:s,error:i}=await this._useSession((async t=>{var s,r,i,n,o;const{data:a,error:c}=t;if(c)throw c;const l=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:null===(s=e.options)||void 0===s?void 0:s.redirectTo,scopes:null===(r=e.options)||void 0===r?void 0:r.scopes,queryParams:null===(i=e.options)||void 0===i?void 0:i.queryParams,skipBrowserRedirect:!0});return await L(this.fetch,"GET",l,{headers:this.headers,jwt:null!==(o=null===(n=a.session)||void 0===n?void 0:n.access_token)&&void 0!==o?o:void 0})}));if(i)throw i;return r()&&!(null===(t=e.options)||void 0===t?void 0:t.skipBrowserRedirect)&&window.location.assign(null==s?void 0:s.url),{data:{provider:e.provider,url:null==s?void 0:s.url},error:null}}catch(t){if(m(t))return{data:{provider:e.provider,url:null},error:t};throw t}}async unlinkIdentity(e){try{return await this._useSession((async t=>{var s,r;const{data:i,error:n}=t;if(n)throw n;return await L(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:null!==(r=null===(s=i.session)||void 0===s?void 0:s.access_token)&&void 0!==r?r:void 0})}))}catch(e){if(m(e))return{data:null,error:e};throw e}}async _refreshAccessToken(e){const t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{const i=Date.now();return await(s=async s=>(await async function(e){return await new Promise((t=>{setTimeout((()=>t(null)),e)}))}(200*s),this._debug(t,"refreshing attempt",s),await L(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:U})),r=(e,t,s)=>s&&s.error&&$(s.error)&&Date.now()+200*(e+1)-i{(async()=>{for(let i=0;i<1/0;i++)try{const t=await s(i);if(!r(i,0,t))return void e(t)}catch(e){if(!r(i))return void t(e)}})()})))}catch(e){if(this._debug(t,"error",e),m(e))return{data:{session:null,user:null},error:e};throw e}finally{this._debug(t,"end")}var s,r}_isValidSession(e){return"object"==typeof e&&null!==e&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){const s=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",s),r()&&!t.skipBrowserRedirect&&window.location.assign(s),{data:{provider:e,url:s},error:null}}async _recoverAndRefresh(){var e;const t="#_recoverAndRefresh()";this._debug(t,"begin");try{const s=await h(this.storage,this.storageKey);if(this._debug(t,"session from storage",s),!this._isValidSession(s))return this._debug(t,"session is not valid"),void(null!==s&&await this._removeSession());const r=Math.round(Date.now()/1e3),i=(null!==(e=s.expires_at)&&void 0!==e?e:1/0){try{await s.callback(e,t)}catch(e){r.push(e)}}));if(await Promise.all(i),r.length>0){for(let e=0;ethis._autoRefreshTokenTick()),X);this.autoRefreshTicker=e,e&&"object"==typeof e&&"function"==typeof e.unref?e.unref():"undefined"!=typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(e),setTimeout((async()=>{await this.initializePromise,await this._autoRefreshTokenTick()}),0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,(async()=>{try{const e=Date.now();try{return await this._useSession((async t=>{const{data:{session:s}}=t;if(!s||!s.refresh_token||!s.expires_at)return void this._debug("#_autoRefreshTokenTick()","no session");const r=Math.floor((1e3*s.expires_at-e)/X);this._debug("#_autoRefreshTokenTick()",`access token expires in ${r} ticks, a tick lasts 30000ms, refresh threshold is 3 ticks`),r<=3&&await this._callRefreshToken(s.refresh_token)}))}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}))}catch(e){if(!(e.isAcquireTimeout||e instanceof K))throw e;this._debug("auto refresh token tick lock not available")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!r()||!(null===window||void 0===window?void 0:window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),null===window||void 0===window||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),"visible"===document.visibilityState?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,(async()=>{"visible"===document.visibilityState?await this._recoverAndRefresh():this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting")})))):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,s){const r=[`provider=${encodeURIComponent(t)}`];if((null==s?void 0:s.redirectTo)&&r.push(`redirect_to=${encodeURIComponent(s.redirectTo)}`),(null==s?void 0:s.scopes)&&r.push(`scopes=${encodeURIComponent(s.scopes)}`),"pkce"===this.flowType){const e=g();await l(this.storage,`${this.storageKey}-code-verifier`,e);const t=await y(e),s=e===t?"plain":"s256";this._debug("PKCE","code verifier",`${e.substring(0,5)}...`,"code challenge",t,"method",s);const i=new URLSearchParams({code_challenge:`${encodeURIComponent(t)}`,code_challenge_method:`${encodeURIComponent(s)}`});r.push(i.toString())}if(null==s?void 0:s.queryParams){const e=new URLSearchParams(s.queryParams);r.push(e.toString())}return(null==s?void 0:s.skipBrowserRedirect)&&r.push(`skip_http_redirect=${s.skipBrowserRedirect}`),`${e}?${r.join("&")}`}async _unenroll(e){try{return await this._useSession((async t=>{var s;const{data:r,error:i}=t;return i?{data:null,error:i}:await L(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null===(s=null==r?void 0:r.session)||void 0===s?void 0:s.access_token})}))}catch(e){if(m(e))return{data:null,error:e};throw e}}async _enroll(e){try{return await this._useSession((async t=>{var s,r;const{data:i,error:n}=t;if(n)return{data:null,error:n};const{data:o,error:a}=await L(this.fetch,"POST",`${this.url}/factors`,{body:{friendly_name:e.friendlyName,factor_type:e.factorType,issuer:e.issuer},headers:this.headers,jwt:null===(s=null==i?void 0:i.session)||void 0===s?void 0:s.access_token});return a?{data:null,error:a}:((null===(r=null==o?void 0:o.totp)||void 0===r?void 0:r.qr_code)&&(o.totp.qr_code=`data:image/svg+xml;utf-8,${o.totp.qr_code}`),{data:o,error:null})}))}catch(e){if(m(e))return{data:null,error:e};throw e}}async _verify(e){return this._acquireLock(-1,(async()=>{try{return await this._useSession((async t=>{var s;const{data:r,error:i}=t;if(i)return{data:null,error:i};const{data:n,error:o}=await L(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:null===(s=null==r?void 0:r.session)||void 0===s?void 0:s.access_token});return o?{data:null,error:o}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+n.expires_in},n)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",n),{data:n,error:o})}))}catch(e){if(m(e))return{data:null,error:e};throw e}}))}async _challenge(e){return this._acquireLock(-1,(async()=>{try{return await this._useSession((async t=>{var s;const{data:r,error:i}=t;return i?{data:null,error:i}:await L(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{headers:this.headers,jwt:null===(s=null==r?void 0:r.session)||void 0===s?void 0:s.access_token})}))}catch(e){if(m(e))return{data:null,error:e};throw e}}))}async _challengeAndVerify(e){const{data:t,error:s}=await this._challenge({factorId:e.factorId});return s?{data:null,error:s}:await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){const{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};const s=(null==e?void 0:e.factors)||[],r=s.filter((e=>"totp"===e.factor_type&&"verified"===e.status));return{data:{all:s,totp:r},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,(async()=>await this._useSession((async e=>{var t,s;const{data:{session:r},error:i}=e;if(i)return{data:null,error:i};if(!r)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const n=this._decodeJWT(r.access_token);let o=null;n.aal&&(o=n.aal);let a=o;return(null!==(s=null===(t=r.user.factors)||void 0===t?void 0:t.filter((e=>"verified"===e.status)))&&void 0!==s?s:[]).length>0&&(a="aal2"),{data:{currentLevel:o,nextLevel:a,currentAuthenticationMethods:n.amr||[]},error:null}}))))}}Z.nextInstanceID=0},743:(e,t,s)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==s.g)return s.g;throw new Error("unable to locate global object")}();e.exports=t=r.fetch,r.fetch&&(t.default=r.fetch.bind(r)),t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response},189:(e,t,s)=>{"use strict";s.r(t),s.d(t,{PostgrestBuilder:()=>n,PostgrestClient:()=>h,PostgrestFilterBuilder:()=>a,PostgrestQueryBuilder:()=>c,PostgrestTransformBuilder:()=>o});var r=s(743),i=s.n(r);class n{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:"undefined"==typeof fetch?this.fetch=i():this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}then(e,t){void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),"GET"!==this.method&&"HEAD"!==this.method&&(this.headers["Content-Type"]="application/json");let s=(0,this.fetch)(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then((async e=>{var t,s,r;let i=null,n=null,o=null,a=e.status,c=e.statusText;if(e.ok){if("HEAD"!==this.method){const t=await e.text();""===t||(n="text/csv"===this.headers.Accept||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?t:JSON.parse(t))}const r=null===(t=this.headers.Prefer)||void 0===t?void 0:t.match(/count=(exact|planned|estimated)/),l=null===(s=e.headers.get("content-range"))||void 0===s?void 0:s.split("/");r&&l&&l.length>1&&(o=parseInt(l[1])),this.isMaybeSingle&&"GET"===this.method&&Array.isArray(n)&&(n.length>1?(i={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,o=null,a=406,c="Not Acceptable"):n=1===n.length?n[0]:null)}else{const t=await e.text();try{i=JSON.parse(t),Array.isArray(i)&&404===e.status&&(n=[],i=null,a=200,c="OK")}catch(s){404===e.status&&""===t?(a=204,c="No Content"):i={message:t}}if(i&&this.isMaybeSingle&&(null===(r=null==i?void 0:i.details)||void 0===r?void 0:r.includes("0 rows"))&&(i=null,a=200,c="OK"),i&&this.shouldThrowOnError)throw i}return{error:i,data:n,count:o,status:a,statusText:c}}));return this.shouldThrowOnError||(s=s.catch((e=>{var t,s,r;return{error:{message:`${null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"FetchError"}: ${null==e?void 0:e.message}`,details:`${null!==(s=null==e?void 0:e.stack)&&void 0!==s?s:""}`,hint:"",code:`${null!==(r=null==e?void 0:e.code)&&void 0!==r?r:""}`},data:null,count:null,status:0,statusText:""}}))),s.then(e,t)}}class o extends n{select(e){let t=!1;const s=(null!=e?e:"*").split("").map((e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e))).join("");return this.url.searchParams.set("select",s),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:t=!0,nullsFirst:s,foreignTable:r,referencedTable:i=r}={}){const n=i?`${i}.order`:"order",o=this.url.searchParams.get(n);return this.url.searchParams.set(n,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${void 0===s?"":s?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:s=t}={}){const r=void 0===s?"limit":`${s}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:s,referencedTable:r=s}={}){const i=void 0===r?"offset":`${r}.offset`,n=void 0===r?"limit":`${r}.limit`;return this.url.searchParams.set(i,`${e}`),this.url.searchParams.set(n,""+(t-e+1)),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return"GET"===this.method?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:t=!1,settings:s=!1,buffers:r=!1,wal:i=!1,format:n="text"}={}){var o;const a=[e?"analyze":null,t?"verbose":null,s?"settings":null,r?"buffers":null,i?"wal":null].filter(Boolean).join("|"),c=null!==(o=this.headers.Accept)&&void 0!==o?o:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${n}; for="${c}"; options=${a};`,this}rollback(){var e;return(null!==(e=this.headers.Prefer)&&void 0!==e?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}}class a extends o{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}in(e,t){const s=t.map((e=>"string"==typeof e&&new RegExp("[,()]").test(e)?`"${e}"`:`${e}`)).join(",");return this.url.searchParams.append(e,`in.(${s})`),this}contains(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return"string"==typeof t?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return"string"==typeof t?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:s,type:r}={}){let i="";"plain"===r?i="pl":"phrase"===r?i="ph":"websearch"===r&&(i="w");const n=void 0===s?"":`(${s})`;return this.url.searchParams.append(e,`${i}fts${n}.${t}`),this}match(e){return Object.entries(e).forEach((([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)})),this}not(e,t,s){return this.url.searchParams.append(e,`not.${t}.${s}`),this}or(e,{foreignTable:t,referencedTable:s=t}={}){const r=s?`${s}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,s){return this.url.searchParams.append(e,`${t}.${s}`),this}}class c{constructor(e,{headers:t={},schema:s,fetch:r}){this.url=e,this.headers=t,this.schema=s,this.fetch=r}select(e,{head:t=!1,count:s}={}){const r=t?"HEAD":"GET";let i=!1;const n=(null!=e?e:"*").split("").map((e=>/\s/.test(e)&&!i?"":('"'===e&&(i=!i),e))).join("");return this.url.searchParams.set("select",n),s&&(this.headers.Prefer=`count=${s}`),new a({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:t,defaultToNull:s=!0}={}){const r=[];if(this.headers.Prefer&&r.push(this.headers.Prefer),t&&r.push(`count=${t}`),s||r.push("missing=default"),this.headers.Prefer=r.join(","),Array.isArray(e)){const t=e.reduce(((e,t)=>e.concat(Object.keys(t))),[]);if(t.length>0){const e=[...new Set(t)].map((e=>`"${e}"`));this.url.searchParams.set("columns",e.join(","))}}return new a({method:"POST",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:t,ignoreDuplicates:s=!1,count:r,defaultToNull:i=!0}={}){const n=[`resolution=${s?"ignore":"merge"}-duplicates`];if(void 0!==t&&this.url.searchParams.set("on_conflict",t),this.headers.Prefer&&n.push(this.headers.Prefer),r&&n.push(`count=${r}`),i||n.push("missing=default"),this.headers.Prefer=n.join(","),Array.isArray(e)){const t=e.reduce(((e,t)=>e.concat(Object.keys(t))),[]);if(t.length>0){const e=[...new Set(t)].map((e=>`"${e}"`));this.url.searchParams.set("columns",e.join(","))}}return new a({method:"POST",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:t}={}){const s=[];return this.headers.Prefer&&s.push(this.headers.Prefer),t&&s.push(`count=${t}`),this.headers.Prefer=s.join(","),new a({method:"PATCH",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){const t=[];return e&&t.push(`count=${e}`),this.headers.Prefer&&t.unshift(this.headers.Prefer),this.headers.Prefer=t.join(","),new a({method:"DELETE",url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}}const l={"X-Client-Info":"postgrest-js/1.8.6"};class h{constructor(e,{headers:t={},schema:s,fetch:r}={}){this.url=e,this.headers=Object.assign(Object.assign({},l),t),this.schemaName=s,this.fetch=r}from(e){const t=new URL(`${this.url}/${e}`);return new c(t,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new h(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,t={},{head:s=!1,count:r}={}){let i;const n=new URL(`${this.url}/rpc/${e}`);let o;s?(i="HEAD",Object.entries(t).forEach((([e,t])=>{n.searchParams.append(e,`${t}`)}))):(i="POST",o=t);const c=Object.assign({},this.headers);return r&&(c.Prefer=`count=${r}`),new a({method:i,url:n,headers:c,schema:this.schemaName,body:o,fetch:this.fetch,allowEmpty:!1})}}},73:(e,t,s)=>{"use strict";s.r(t),s.d(t,{REALTIME_CHANNEL_STATES:()=>P,REALTIME_LISTEN_TYPES:()=>j,REALTIME_POSTGRES_CHANGES_LISTEN_EVENT:()=>E,REALTIME_PRESENCE_LISTEN_EVENTS:()=>h,REALTIME_SUBSCRIBE_STATES:()=>O,RealtimeChannel:()=>$,RealtimeClient:()=>A,RealtimePresence:()=>g});var r=s(840);const i={"X-Client-Info":"realtime-js/2.8.4"};var n,o,a,c,l,h,u;!function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"}(n||(n={})),function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"}(o||(o={})),function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"}(a||(a={})),function(e){e.websocket="websocket"}(c||(c={})),function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"}(l||(l={}));class d{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout((()=>{this.tries=this.tries+1,this.callback()}),this.timerCalc(this.tries+1))}}class f{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):t("string"==typeof e?JSON.parse(e):{})}_binaryDecode(e){const t=new DataView(e),s=new TextDecoder;return this._decodeBroadcast(e,t,s)}_decodeBroadcast(e,t,s){const r=t.getUint8(1),i=t.getUint8(2);let n=this.HEADER_LENGTH+2;const o=s.decode(e.slice(n,n+r));n+=r;const a=s.decode(e.slice(n,n+i));return n+=i,{ref:null,topic:o,event:a,payload:JSON.parse(s.decode(e.slice(n,e.byteLength)))}}}class p{constructor(e,t,s={},r=1e4){this.channel=e,this.event=t,this.payload=s,this.timeout=r,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var s;return this._hasReceived(e)&&t(null===(s=this.receivedResp)||void 0===s?void 0:s.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){this.timeoutTimer||(this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref),this.channel._on(this.refEvent,{},(e=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=e,this._matchReceive(e)})),this.timeoutTimer=setTimeout((()=>{this.trigger("timeout",{})}),this.timeout))}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter((t=>t.status===e)).forEach((e=>e.callback(t)))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}!function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"}(h||(h={}));class g{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const s=(null==t?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(s.state,{},(e=>{const{onJoin:t,onLeave:s,onSync:r}=this.caller;this.joinRef=this.channel._joinRef(),this.state=g.syncState(this.state,e,t,s),this.pendingDiffs.forEach((e=>{this.state=g.syncDiff(this.state,e,t,s)})),this.pendingDiffs=[],r()})),this.channel._on(s.diff,{},(e=>{const{onJoin:t,onLeave:s,onSync:r}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(e):(this.state=g.syncDiff(this.state,e,t,s),r())})),this.onJoin(((e,t,s)=>{this.channel._trigger("presence",{event:"join",key:e,currentPresences:t,newPresences:s})})),this.onLeave(((e,t,s)=>{this.channel._trigger("presence",{event:"leave",key:e,currentPresences:t,leftPresences:s})})),this.onSync((()=>{this.channel._trigger("presence",{event:"sync"})}))}static syncState(e,t,s,r){const i=this.cloneDeep(e),n=this.transformState(t),o={},a={};return this.map(i,((e,t)=>{n[e]||(a[e]=t)})),this.map(n,((e,t)=>{const s=i[e];if(s){const r=t.map((e=>e.presence_ref)),i=s.map((e=>e.presence_ref)),n=t.filter((e=>i.indexOf(e.presence_ref)<0)),c=s.filter((e=>r.indexOf(e.presence_ref)<0));n.length>0&&(o[e]=n),c.length>0&&(a[e]=c)}else o[e]=t})),this.syncDiff(i,{joins:o,leaves:a},s,r)}static syncDiff(e,t,s,r){const{joins:i,leaves:n}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return s||(s=()=>{}),r||(r=()=>{}),this.map(i,((t,r)=>{var i;const n=null!==(i=e[t])&&void 0!==i?i:[];if(e[t]=this.cloneDeep(r),n.length>0){const s=e[t].map((e=>e.presence_ref)),r=n.filter((e=>s.indexOf(e.presence_ref)<0));e[t].unshift(...r)}s(t,n,r)})),this.map(n,((t,s)=>{let i=e[t];if(!i)return;const n=s.map((e=>e.presence_ref));i=i.filter((e=>n.indexOf(e.presence_ref)<0)),e[t]=i,r(t,i,s),0===i.length&&delete e[t]})),e}static map(e,t){return Object.getOwnPropertyNames(e).map((s=>t(s,e[s])))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce(((t,s)=>{const r=e[s];return t[s]="metas"in r?r.metas.map((e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))):r,t}),{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}!function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"}(u||(u={}));const y=(e,t,s={})=>{var r;const i=null!==(r=s.skipTypes)&&void 0!==r?r:[];return Object.keys(t).reduce(((s,r)=>(s[r]=v(r,e,t,i),s)),{})},v=(e,t,s,r)=>{const i=t.find((t=>t.name===e)),n=null==i?void 0:i.type,o=s[e];return n&&!r.includes(n)?m(n,o):_(o)},m=(e,t)=>{if("_"===e.charAt(0)){const s=e.slice(1,e.length);return S(t,s)}switch(e){case u.bool:return b(t);case u.float4:case u.float8:case u.int2:case u.int4:case u.int8:case u.numeric:case u.oid:return w(t);case u.json:case u.jsonb:return k(t);case u.timestamp:return T(t);case u.abstime:case u.date:case u.daterange:case u.int4range:case u.int8range:case u.money:case u.reltime:case u.text:case u.time:case u.timestamptz:case u.timetz:case u.tsrange:case u.tstzrange:default:return _(t)}},_=e=>e,b=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},w=e=>{if("string"==typeof e){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},k=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},S=(e,t)=>{if("string"!=typeof e)return e;const s=e.length-1,r=e[s];if("{"===e[0]&&"}"===r){let r;const i=e.slice(1,s);try{r=JSON.parse("["+i+"]")}catch(e){r=i?i.split(","):[]}return r.map((e=>m(t,e)))}return e},T=e=>"string"==typeof e?e.replace(" ","T"):e;var E,j,O;!function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"}(E||(E={})),function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes"}(j||(j={})),function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"}(O||(O={}));const P=o;class ${constructor(e,t={config:{}},s){this.topic=e,this.params=t,this.socket=s,this.bindings={},this.state=o.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""}},t.config),this.timeout=this.socket.timeout,this.joinPush=new p(this,a.join,this.params,this.timeout),this.rejoinTimer=new d((()=>this._rejoinUntilConnected()),this.socket.reconnectAfterMs),this.joinPush.receive("ok",(()=>{this.state=o.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach((e=>e.send())),this.pushBuffer=[]})),this._onClose((()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=o.closed,this.socket._remove(this)})),this._onError((e=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,e),this.state=o.errored,this.rejoinTimer.scheduleTimeout())})),this.joinPush.receive("timeout",(()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=o.errored,this.rejoinTimer.scheduleTimeout())})),this._on(a.reply,{},((e,t)=>{this._trigger(this._replyEventName(t),e)})),this.presence=new g(this),this.broadcastEndpointURL=this._broadcastEndpointURL()}subscribe(e,t=this.timeout){var s,r;if(this.socket.isConnected()||this.socket.connect(),this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{const{config:{broadcast:i,presence:n}}=this.params;this._onError((t=>e&&e("CHANNEL_ERROR",t))),this._onClose((()=>e&&e("CLOSED")));const o={},a={broadcast:i,presence:n,postgres_changes:null!==(r=null===(s=this.bindings.postgres_changes)||void 0===s?void 0:s.map((e=>e.filter)))&&void 0!==r?r:[]};this.socket.accessToken&&(o.access_token=this.socket.accessToken),this.updateJoinPayload(Object.assign({config:a},o)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",(({postgres_changes:t})=>{var s;if(this.socket.accessToken&&this.socket.setAuth(this.socket.accessToken),void 0!==t){const r=this.bindings.postgres_changes,i=null!==(s=null==r?void 0:r.length)&&void 0!==s?s:0,n=[];for(let s=0;s{e&&e("CHANNEL_ERROR",new Error(JSON.stringify(Object.values(t).join(", ")||"error")))})).receive("timeout",(()=>{e&&e("TIMED_OUT")}))}return this}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,s){return this._on(e,t,s)}async send(e,t={}){var s,r;if(this._canPush()||"broadcast"!==e.type)return new Promise((s=>{var r,i,n;const o=this._push(e.type,e,t.timeout||this.timeout);"broadcast"!==e.type||(null===(n=null===(i=null===(r=this.params)||void 0===r?void 0:r.config)||void 0===i?void 0:i.broadcast)||void 0===n?void 0:n.ack)||s("ok"),o.receive("ok",(()=>s("ok"))),o.receive("timeout",(()=>s("timed out")))}));{const{event:i,payload:n}=e,o={method:"POST",headers:{apikey:null!==(s=this.socket.accessToken)&&void 0!==s?s:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:n}]})};try{return(await this._fetchWithTimeout(this.broadcastEndpointURL,o,null!==(r=t.timeout)&&void 0!==r?r:this.timeout)).ok?"ok":"error"}catch(e){return"AbortError"===e.name?"timed out":"error"}}}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=o.leaving;const t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(a.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise((s=>{const r=new p(this,a.leave,{},e);r.receive("ok",(()=>{t(),s("ok")})).receive("timeout",(()=>{t(),s("timed out")})).receive("error",(()=>{s("error")})),r.send(),this._canPush()||r.trigger("ok",{})}))}_broadcastEndpointURL(){let e=this.socket.endPoint;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")+"/api/broadcast"}async _fetchWithTimeout(e,t,s){const r=new AbortController,i=setTimeout((()=>r.abort()),s),n=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(i),n}_push(e,t,s=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let r=new p(this,e,t,s);return this._canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}_onMessage(e,t,s){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,s){var r,i;const n=e.toLocaleLowerCase(),{close:o,error:c,leave:l,join:h}=a;if(s&&[o,c,l,h].indexOf(n)>=0&&s!==this._joinRef())return;let u=this._onMessage(n,t,s);if(t&&!u)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(n)?null===(r=this.bindings.postgres_changes)||void 0===r||r.filter((e=>{var t,s,r;return"*"===(null===(t=e.filter)||void 0===t?void 0:t.event)||(null===(r=null===(s=e.filter)||void 0===s?void 0:s.event)||void 0===r?void 0:r.toLocaleLowerCase())===n})).map((e=>e.callback(u,s))):null===(i=this.bindings[n])||void 0===i||i.filter((e=>{var s,r,i,o,a,c;if(["broadcast","presence","postgres_changes"].includes(n)){if("id"in e){const n=e.id,o=null===(s=e.filter)||void 0===s?void 0:s.event;return n&&(null===(r=t.ids)||void 0===r?void 0:r.includes(n))&&("*"===o||(null==o?void 0:o.toLocaleLowerCase())===(null===(i=t.data)||void 0===i?void 0:i.type.toLocaleLowerCase()))}{const s=null===(a=null===(o=null==e?void 0:e.filter)||void 0===o?void 0:o.event)||void 0===a?void 0:a.toLocaleLowerCase();return"*"===s||s===(null===(c=null==t?void 0:t.event)||void 0===c?void 0:c.toLocaleLowerCase())}}return e.type.toLocaleLowerCase()===n})).map((e=>{if("object"==typeof u&&"ids"in u){const e=u.data,{schema:t,table:s,commit_timestamp:r,type:i,errors:n}=e,o={schema:t,table:s,commit_timestamp:r,eventType:i,new:{},old:{},errors:n};u=Object.assign(Object.assign({},o),this._getPayloadRecords(e))}e.callback(u,s)}))}_isClosed(){return this.state===o.closed}_isJoined(){return this.state===o.joined}_isJoining(){return this.state===o.joining}_isLeaving(){return this.state===o.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,s){const r=e.toLocaleLowerCase(),i={type:r,filter:t,callback:s};return this.bindings[r]?this.bindings[r].push(i):this.bindings[r]=[i],this}_off(e,t){const s=e.toLocaleLowerCase();return this.bindings[s]=this.bindings[s].filter((e=>{var r;return!((null===(r=e.type)||void 0===r?void 0:r.toLocaleLowerCase())===s&&$.isEqual(e.filter,t))})),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(a.close,{},e)}_onError(e){this._on(a.error,{},(t=>e(t)))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=o.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const t={new:{},old:{}};return"INSERT"!==e.type&&"UPDATE"!==e.type||(t.new=y(e.columns,e.record)),"UPDATE"!==e.type&&"DELETE"!==e.type||(t.old=y(e.columns,e.old_record)),t}}const x=()=>{};class A{constructor(e,t){var n;this.accessToken=null,this.channels=[],this.endPoint="",this.headers=i,this.params={},this.timeout=1e4,this.transport=r.w3cwebsocket,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=x,this.conn=null,this.sendBuffer=[],this.serializer=new f,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this._resolveFetch=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>Promise.resolve().then(s.t.bind(s,743,23)).then((({default:t})=>t(...e))):fetch),(...e)=>t(...e)},this.endPoint=`${e}/${c.websocket}`,(null==t?void 0:t.params)&&(this.params=t.params),(null==t?void 0:t.headers)&&(this.headers=Object.assign(Object.assign({},this.headers),t.headers)),(null==t?void 0:t.timeout)&&(this.timeout=t.timeout),(null==t?void 0:t.logger)&&(this.logger=t.logger),(null==t?void 0:t.transport)&&(this.transport=t.transport),(null==t?void 0:t.heartbeatIntervalMs)&&(this.heartbeatIntervalMs=t.heartbeatIntervalMs);const o=null===(n=null==t?void 0:t.params)||void 0===n?void 0:n.apikey;o&&(this.accessToken=o),this.reconnectAfterMs=(null==t?void 0:t.reconnectAfterMs)?t.reconnectAfterMs:e=>[1e3,2e3,5e3,1e4][e-1]||1e4,this.encode=(null==t?void 0:t.encode)?t.encode:(e,t)=>t(JSON.stringify(e)),this.decode=(null==t?void 0:t.decode)?t.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new d((async()=>{this.disconnect(),this.connect()}),this.reconnectAfterMs),this.fetch=this._resolveFetch(null==t?void 0:t.fetch)}connect(){this.conn||(this.conn=new this.transport(this._endPointURL(),[],null,this.headers),this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e)))}disconnect(e,t){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,null!=t?t:""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}async removeChannel(e){const t=await e.unsubscribe();return 0===this.channels.length&&this.disconnect(),t}async removeAllChannels(){const e=await Promise.all(this.channels.map((e=>e.unsubscribe())));return this.disconnect(),e}log(e,t,s){this.logger(e,t,s)}connectionState(){switch(this.conn&&this.conn.readyState){case n.connecting:return l.Connecting;case n.open:return l.Open;case n.closing:return l.Closing;default:return l.Closed}}isConnected(){return this.connectionState()===l.Open}channel(e,t={config:{}}){const s=new $(`realtime:${e}`,t,this);return this.channels.push(s),s}push(e){const{topic:t,event:s,payload:r,ref:i}=e,n=()=>{this.encode(e,(e=>{var t;null===(t=this.conn)||void 0===t||t.send(e)}))};this.log("push",`${t} ${s} (${i})`,r),this.isConnected()?n():this.sendBuffer.push(n)}setAuth(e){this.accessToken=e,this.channels.forEach((t=>{e&&t.updateJoinPayload({access_token:e}),t.joinedOnce&&t._isJoined()&&t._push(a.access_token,{access_token:e})}))}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find((t=>t.topic===e&&(t._isJoined()||t._isJoining())));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter((t=>t._joinRef()!==e._joinRef()))}_endPointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:"1.0.0"}))}_onConnMessage(e){this.decode(e.data,(e=>{let{topic:t,event:s,payload:r,ref:i}=e;(i&&i===this.pendingHeartbeatRef||s===(null==r?void 0:r.type))&&(this.pendingHeartbeatRef=null),this.log("receive",`${r.status||""} ${t} ${s} ${i&&"("+i+")"||""}`,r),this.channels.filter((e=>e._isMember(t))).forEach((e=>e._trigger(s,r,i))),this.stateChangeCallbacks.message.forEach((t=>t(e)))}))}_onConnOpen(){this.log("transport",`connected to ${this._endPointURL()}`),this._flushSendBuffer(),this.reconnectTimer.reset(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval((()=>this._sendHeartbeat()),this.heartbeatIntervalMs),this.stateChangeCallbacks.open.forEach((e=>e()))}_onConnClose(e){this.log("transport","close",e),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach((t=>t(e)))}_onConnError(e){this.log("transport",e.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach((t=>t(e)))}_triggerChanError(){this.channels.forEach((e=>e._trigger(a.error)))}_appendParams(e,t){if(0===Object.keys(t).length)return e;const s=e.match(/\?/)?"&":"?";return`${e}${s}${new URLSearchParams(t)}`}_flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach((e=>e())),this.sendBuffer=[])}_sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef)return this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),void(null===(e=this.conn)||void 0===e||e.close(1e3,"hearbeat timeout"));this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth(this.accessToken)}}}},752:(e,t,s)=>{"use strict";s.r(t),s.d(t,{StorageApiError:()=>n,StorageClient:()=>S,StorageError:()=>r,StorageUnknownError:()=>o,isStorageError:()=>i});class r extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function i(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}class n extends r{constructor(e,t){super(e),this.name="StorageApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class o extends r{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}const a=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>Promise.resolve().then(s.t.bind(s,743,23)).then((({default:t})=>t(...e))):fetch),(...e)=>t(...e)};var c=function(e,t,s,r){return new(s||(s=Promise))((function(i,n){function o(e){try{c(r.next(e))}catch(e){n(e)}}function a(e){try{c(r.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};const l=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),h=(e,t)=>c(void 0,void 0,void 0,(function*(){const r=yield(i=void 0,a=void 0,c=void 0,h=function*(){return"undefined"==typeof Response?(yield Promise.resolve().then(s.t.bind(s,743,23))).Response:Response},new(c||(c=Promise))((function(e,t){function s(e){try{n(h.next(e))}catch(e){t(e)}}function r(e){try{n(h.throw(e))}catch(e){t(e)}}function n(t){var i;t.done?e(t.value):(i=t.value,i instanceof c?i:new c((function(e){e(i)}))).then(s,r)}n((h=h.apply(i,a||[])).next())})));var i,a,c,h;e instanceof r?e.json().then((s=>{t(new n(l(s),e.status||500))})).catch((e=>{t(new o(l(e),e))})):t(new o(l(e),e))})),u=(e,t,s,r)=>{const i={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?i:(i.headers=Object.assign({"Content-Type":"application/json"},null==t?void 0:t.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),s))};function d(e,t,s,r,i,n){return c(this,void 0,void 0,(function*(){return new Promise(((o,a)=>{e(s,u(t,r,i,n)).then((e=>{if(!e.ok)throw e;return(null==r?void 0:r.noResolveJson)?e:e.json()})).then((e=>o(e))).catch((e=>h(e,a)))}))}))}function f(e,t,s,r){return c(this,void 0,void 0,(function*(){return d(e,"GET",t,s,r)}))}function p(e,t,s,r,i){return c(this,void 0,void 0,(function*(){return d(e,"POST",t,r,i,s)}))}function g(e,t,s,r,i){return c(this,void 0,void 0,(function*(){return d(e,"DELETE",t,r,i,s)}))}var y=function(e,t,s,r){return new(s||(s=Promise))((function(i,n){function o(e){try{c(r.next(e))}catch(e){n(e)}}function a(e){try{c(r.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};const v={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},m={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class _{constructor(e,t={},s,r){this.url=e,this.headers=t,this.bucketId=s,this.fetch=a(r)}uploadOrUpdate(e,t,s,r){return y(this,void 0,void 0,(function*(){try{let i;const n=Object.assign(Object.assign({},m),r),o=Object.assign(Object.assign({},this.headers),"POST"===e&&{"x-upsert":String(n.upsert)});"undefined"!=typeof Blob&&s instanceof Blob?(i=new FormData,i.append("cacheControl",n.cacheControl),i.append("",s)):"undefined"!=typeof FormData&&s instanceof FormData?(i=s,i.append("cacheControl",n.cacheControl)):(i=s,o["cache-control"]=`max-age=${n.cacheControl}`,o["content-type"]=n.contentType);const a=this._removeEmptyFolders(t),c=this._getFinalPath(a),l=yield this.fetch(`${this.url}/object/${c}`,Object.assign({method:e,body:i,headers:o},(null==n?void 0:n.duplex)?{duplex:n.duplex}:{}));return l.ok?{data:{path:a},error:null}:{data:null,error:yield l.json()}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}upload(e,t,s){return y(this,void 0,void 0,(function*(){return this.uploadOrUpdate("POST",e,t,s)}))}uploadToSignedUrl(e,t,s,r){return y(this,void 0,void 0,(function*(){const n=this._removeEmptyFolders(e),o=this._getFinalPath(n),a=new URL(this.url+`/object/upload/sign/${o}`);a.searchParams.set("token",t);try{let e;const t=Object.assign({upsert:m.upsert},r),i=Object.assign(Object.assign({},this.headers),{"x-upsert":String(t.upsert)});"undefined"!=typeof Blob&&s instanceof Blob?(e=new FormData,e.append("cacheControl",t.cacheControl),e.append("",s)):"undefined"!=typeof FormData&&s instanceof FormData?(e=s,e.append("cacheControl",t.cacheControl)):(e=s,i["cache-control"]=`max-age=${t.cacheControl}`,i["content-type"]=t.contentType);const o=yield this.fetch(a.toString(),{method:"PUT",body:e,headers:i});return o.ok?{data:{path:n},error:null}:{data:null,error:yield o.json()}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}createSignedUploadUrl(e){return y(this,void 0,void 0,(function*(){try{let t=this._getFinalPath(e);const s=yield p(this.fetch,`${this.url}/object/upload/sign/${t}`,{},{headers:this.headers}),i=new URL(this.url+s.url),n=i.searchParams.get("token");if(!n)throw new r("No token returned by API");return{data:{signedUrl:i.toString(),path:e,token:n},error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}update(e,t,s){return y(this,void 0,void 0,(function*(){return this.uploadOrUpdate("PUT",e,t,s)}))}move(e,t){return y(this,void 0,void 0,(function*(){try{return{data:yield p(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers}),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}copy(e,t){return y(this,void 0,void 0,(function*(){try{return{data:{path:(yield p(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers})).Key},error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}createSignedUrl(e,t,s){return y(this,void 0,void 0,(function*(){try{let r=this._getFinalPath(e),i=yield p(this.fetch,`${this.url}/object/sign/${r}`,Object.assign({expiresIn:t},(null==s?void 0:s.transform)?{transform:s.transform}:{}),{headers:this.headers});const n=(null==s?void 0:s.download)?`&download=${!0===s.download?"":s.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${n}`)},{data:i,error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}createSignedUrls(e,t,s){return y(this,void 0,void 0,(function*(){try{const r=yield p(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),i=(null==s?void 0:s.download)?`&download=${!0===s.download?"":s.download}`:"";return{data:r.map((e=>Object.assign(Object.assign({},e),{signedUrl:e.signedURL?encodeURI(`${this.url}${e.signedURL}${i}`):null}))),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}download(e,t){return y(this,void 0,void 0,(function*(){const s=void 0!==(null==t?void 0:t.transform)?"render/image/authenticated":"object",r=this.transformOptsToQueryString((null==t?void 0:t.transform)||{}),n=r?`?${r}`:"";try{const t=this._getFinalPath(e),r=yield f(this.fetch,`${this.url}/${s}/${t}${n}`,{headers:this.headers,noResolveJson:!0});return{data:yield r.blob(),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}getPublicUrl(e,t){const s=this._getFinalPath(e),r=[],i=(null==t?void 0:t.download)?`download=${!0===t.download?"":t.download}`:"";""!==i&&r.push(i);const n=void 0!==(null==t?void 0:t.transform)?"render/image":"object",o=this.transformOptsToQueryString((null==t?void 0:t.transform)||{});""!==o&&r.push(o);let a=r.join("&");return""!==a&&(a=`?${a}`),{data:{publicUrl:encodeURI(`${this.url}/${n}/public/${s}${a}`)}}}remove(e){return y(this,void 0,void 0,(function*(){try{return{data:yield g(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}list(e,t,s){return y(this,void 0,void 0,(function*(){try{const r=Object.assign(Object.assign(Object.assign({},v),t),{prefix:e||""});return{data:yield p(this.fetch,`${this.url}/object/list/${this.bucketId}`,r,{headers:this.headers},s),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}}const b={"X-Client-Info":"storage-js/2.5.4"};var w=function(e,t,s,r){return new(s||(s=Promise))((function(i,n){function o(e){try{c(r.next(e))}catch(e){n(e)}}function a(e){try{c(r.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};class k{constructor(e,t={},s){this.url=e,this.headers=Object.assign(Object.assign({},b),t),this.fetch=a(s)}listBuckets(){return w(this,void 0,void 0,(function*(){try{return{data:yield f(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}getBucket(e){return w(this,void 0,void 0,(function*(){try{return{data:yield f(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}createBucket(e,t={public:!1}){return w(this,void 0,void 0,(function*(){try{return{data:yield p(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}updateBucket(e,t){return w(this,void 0,void 0,(function*(){try{const s=yield function(e,t,s,r,i){return c(this,void 0,void 0,(function*(){return d(e,"PUT",t,r,undefined,s)}))}(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers});return{data:s,error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}emptyBucket(e){return w(this,void 0,void 0,(function*(){try{return{data:yield p(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}deleteBucket(e){return w(this,void 0,void 0,(function*(){try{return{data:yield g(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(e){if(i(e))return{data:null,error:e};throw e}}))}}class S extends k{constructor(e,t={},s){super(e,t,s)}from(e){return new _(this.url,this.headers,e,this.fetch)}}},284:e=>{var t=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return t()}try{return __global__||t()}finally{delete Object.prototype.__global__}}()},296:function(e,t,s){"use strict";var r=this&&this.__awaiter||function(e,t,s,r){return new(s||(s=Promise))((function(i,n){function o(e){try{c(r.next(e))}catch(e){n(e)}}function a(e){try{c(r.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=s(982),n=s(189),o=s(73),a=s(752),c=s(678),l=s(716),h=s(610),u=s(283),d={headers:c.DEFAULT_HEADERS},f={schema:"public"},p={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},g={};t.default=class{constructor(e,t,s){var r,i,o,a,c,u,y,v;if(this.supabaseUrl=e,this.supabaseKey=t,!e)throw new Error("supabaseUrl is required.");if(!t)throw new Error("supabaseKey is required.");const m=(0,h.stripTrailingSlash)(e);this.realtimeUrl=`${m}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${m}/auth/v1`,this.storageUrl=`${m}/storage/v1`,this.functionsUrl=`${m}/functions/v1`;const _=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,b={db:f,realtime:g,auth:Object.assign(Object.assign({},p),{storageKey:_}),global:d},w=(0,h.applySettingDefaults)(null!=s?s:{},b);this.storageKey=null!==(i=null===(r=w.auth)||void 0===r?void 0:r.storageKey)&&void 0!==i?i:"",this.headers=null!==(a=null===(o=w.global)||void 0===o?void 0:o.headers)&&void 0!==a?a:{},this.auth=this._initSupabaseAuthClient(null!==(c=w.auth)&&void 0!==c?c:{},this.headers,null===(u=w.global)||void 0===u?void 0:u.fetch),this.fetch=(0,l.fetchWithAuth)(t,this._getAccessToken.bind(this),null===(y=w.global)||void 0===y?void 0:y.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},w.realtime)),this.rest=new n.PostgrestClient(`${m}/rest/v1`,{headers:this.headers,schema:null===(v=w.db)||void 0===v?void 0:v.schema,fetch:this.fetch}),this._listenForAuthEvents()}get functions(){return new i.FunctionsClient(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new a.StorageClient(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},s){return this.rest.rpc(e,t,s)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,t;return r(this,void 0,void 0,(function*(){const{data:s}=yield this.auth.getSession();return null!==(t=null===(e=s.session)||void 0===e?void 0:e.access_token)&&void 0!==t?t:null}))}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:r,storageKey:i,flowType:n,debug:o},a,c){const l={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new u.SupabaseAuthClient({url:this.authUrl,headers:Object.assign(Object.assign({},l),a),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:r,flowType:n,debug:o,fetch:c})}_initRealtimeClient(e){return new o.RealtimeClient(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},null==e?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange(((e,t)=>{this._handleTokenChanged(e,"CLIENT",null==t?void 0:t.access_token)}))}_handleTokenChanged(e,t,s){"TOKEN_REFRESHED"!==e&&"SIGNED_IN"!==e||this.changedAccessToken===s?"SIGNED_OUT"===e&&(this.realtime.setAuth(this.supabaseKey),"STORAGE"==t&&this.auth.signOut(),this.changedAccessToken=void 0):(this.realtime.setAuth(null!=s?s:null),this.changedAccessToken=s)}}},341:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s);var i=Object.getOwnPropertyDescriptor(t,s);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,r,i)}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),i=this&&this.__exportStar||function(e,t){for(var s in e)"default"===s||Object.prototype.hasOwnProperty.call(t,s)||r(t,e,s)},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createClient=t.SupabaseClient=t.FunctionsError=t.FunctionsRelayError=t.FunctionsFetchError=t.FunctionsHttpError=void 0;const o=n(s(296));i(s(765),t);var a=s(982);Object.defineProperty(t,"FunctionsHttpError",{enumerable:!0,get:function(){return a.FunctionsHttpError}}),Object.defineProperty(t,"FunctionsFetchError",{enumerable:!0,get:function(){return a.FunctionsFetchError}}),Object.defineProperty(t,"FunctionsRelayError",{enumerable:!0,get:function(){return a.FunctionsRelayError}}),Object.defineProperty(t,"FunctionsError",{enumerable:!0,get:function(){return a.FunctionsError}}),i(s(73),t);var c=s(296);Object.defineProperty(t,"SupabaseClient",{enumerable:!0,get:function(){return n(c).default}}),t.createClient=(e,t,s)=>new o.default(e,t,s)},283:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SupabaseAuthClient=void 0;const r=s(765);class i extends r.GoTrueClient{constructor(e){super(e)}}t.SupabaseAuthClient=i},678:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_HEADERS=void 0;const r=s(506);let i="";i="undefined"!=typeof Deno?"deno":"undefined"!=typeof document?"web":"undefined"!=typeof navigator&&"ReactNative"===navigator.product?"react-native":"node",t.DEFAULT_HEADERS={"X-Client-Info":`supabase-js-${i}/${r.version}`}},716:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){void 0===r&&(r=s);var i=Object.getOwnPropertyDescriptor(t,s);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[s]}}),Object.defineProperty(e,r,i)}:function(e,t,s,r){void 0===r&&(r=s),e[r]=t[s]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var s in e)"default"!==s&&Object.prototype.hasOwnProperty.call(e,s)&&r(t,e,s);return i(t,e),t},o=this&&this.__awaiter||function(e,t,s,r){return new(s||(s=Promise))((function(i,n){function o(e){try{c(r.next(e))}catch(e){n(e)}}function a(e){try{c(r.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchWithAuth=t.resolveHeadersConstructor=t.resolveFetch=void 0;const a=n(s(743));t.resolveFetch=e=>{let t;return t=e||("undefined"==typeof fetch?a.default:fetch),(...e)=>t(...e)},t.resolveHeadersConstructor=()=>"undefined"==typeof Headers?a.Headers:Headers,t.fetchWithAuth=(e,s,r)=>{const i=(0,t.resolveFetch)(r),n=(0,t.resolveHeadersConstructor)();return(t,r)=>o(void 0,void 0,void 0,(function*(){var o;const a=null!==(o=yield s())&&void 0!==o?o:e;let c=new n(null==r?void 0:r.headers);return c.has("apikey")||c.set("apikey",e),c.has("Authorization")||c.set("Authorization",`Bearer ${a}`),i(t,Object.assign(Object.assign({},r),{headers:c}))}))}},610:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applySettingDefaults=t.isBrowser=t.stripTrailingSlash=t.uuid=void 0,t.uuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))},t.stripTrailingSlash=function(e){return e.replace(/\/$/,"")},t.isBrowser=()=>"undefined"!=typeof window,t.applySettingDefaults=function(e,t){const{db:s,auth:r,realtime:i,global:n}=e,{db:o,auth:a,realtime:c,global:l}=t;return{db:Object.assign(Object.assign({},o),s),auth:Object.assign(Object.assign({},a),r),realtime:Object.assign(Object.assign({},c),i),global:Object.assign(Object.assign({},l),n)}}},506:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=void 0,t.version="2.39.1"},840:(e,t,s)=>{var r;if("object"==typeof globalThis)r=globalThis;else try{r=s(284)}catch(e){}finally{if(r||"undefined"==typeof window||(r=window),!r)throw new Error("Could not determine global this")}var i=r.WebSocket||r.MozWebSocket,n=s(387);function o(e,t){return t?new i(e,t):new i(e)}i&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach((function(e){Object.defineProperty(o,e,{get:function(){return i[e]}})})),e.exports={w3cwebsocket:i?o:null,version:n}},387:(e,t,s)=>{e.exports=s(794).version},794:e=>{"use strict";e.exports={version:"1.0.34"}}},r={};function i(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={exports:{}};return s[e].call(n.exports,n,n.exports,i),n.exports}return i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(s,r){if(1&r&&(s=this(s)),8&r)return s;if("object"==typeof s&&s){if(4&r&&s.__esModule)return s;if(16&r&&"function"==typeof s.then)return s}var n=Object.create(null);i.r(n);var o={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&s;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>o[e]=()=>s[e]));return o.default=()=>s,i.d(n,o),n},i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(341)})())); diff --git a/app/data/ct.libs/supabase/module.json b/app/data/ct.libs/supabase/module.json index 2ef624156..3a2a3d853 100644 --- a/app/data/ct.libs/supabase/module.json +++ b/app/data/ct.libs/supabase/module.json @@ -2,7 +2,7 @@ "main": { "name": "supabase", "tagline": "A module/catmod for ct.js games using Supabase", - "version": "2.39.1", + "version": "2.39.6", "authors": [ { "name": "Ehan Ahamed", diff --git a/app/data/ct.libs/yarn/DOCS.md b/app/data/ct.libs/yarn/DOCS.md index d065a6e91..3b6d33601 100644 --- a/app/data/ct.libs/yarn/DOCS.md +++ b/app/data/ct.libs/yarn/DOCS.md @@ -1,10 +1,10 @@ ## Loading a story -### ct.yarn.openStory(data) ⇒ `YarnStory` +### yarn.openStory(data) ⇒ `YarnStory` Opens the given JSON object and returns a YarnStory object, ready for playing. -### ct.yarn.openFromFile(path) ⇒ `Promise` +### yarn.openFromFile(path) ⇒ `Promise` Opens the given JSON file and returns a promise that resolves into a YarnStory. @@ -121,4 +121,4 @@ For other event-related functions, see [PIXI.utils.EventEmitter](http://pixijs.d * `command` — called when the story has advanced and faced a command. * `options` — called when the story has advanced and faced a number of dialogue options. * `text` — called when the story has advanced and returned a new dialogue line. -* `next` — called when the story advances in some way. \ No newline at end of file +* `next` — called when the story advances in some way. diff --git a/app/data/i18n/Comments.json b/app/data/i18n/Comments.json index 066b20a89..e392f2f4a 100644 --- a/app/data/i18n/Comments.json +++ b/app/data/i18n/Comments.json @@ -118,12 +118,50 @@ "", "", "" + ], + "behavior": [ + "", + "", + "" + ], + "script": [ + "", + "", + "" ] }, "next": "", "previous": "", "undo": "About Undo/Redo operations", - "redo": "About Undo/Redo operations" + "redo": "About Undo/Redo operations", + "addBehavior": "", + "copyNamesList": "", + "copyNamesArray": "", + "create": "", + "discard": "", + "experimentalFeature": "", + "goBack": "", + "sortByDate": "", + "sortByName": "", + "sortByType": "", + "reimportSourceMissing": "", + "dropToImport": "", + "reimport": "", + "alignModes": { + "left": "", + "right": "", + "top": "", + "bottom": "", + "center": "", + "topLeft": "", + "topCenter": "", + "topRight": "", + "bottomLeft": "", + "bottomCenter": "", + "bottomRight": "", + "fill": "", + "Scale": "" + } }, "colorPicker": { "current": "", @@ -152,14 +190,23 @@ "downloadAndroidStudio": "", "requiresInternetNotice": "", "noJdkFound": "", - "downloadJDK": "" + "downloadJDK": "", + "goodToGo": "", + "nodeJsNotFound": "", + "nodeJsDownloadPage": "", + "nodeJsIcons": "" }, "intro": { "loading": "", "newProject": { "input": "", "selectProjectFolder": "", - "nameError": "" + "nameError": "", + "header": "", + "projectName": "", + "language": "", + "saveFolder": "", + "languageError": "" }, "recovery": { "message": "", @@ -189,7 +236,8 @@ "templatesInfo": "", "boosty": "Boosty is a service, similar to Patreon.", "sponsoredBy": "", - "supportedBy": "" + "supportedBy": "", + "nothingToShowFiller": "" }, "modules": { "author": "", @@ -255,7 +303,8 @@ "global": "", "backToHome": "", "modulesPages": "", - "helpPages": "" + "helpPages": "", + "docsAndNotes": "" }, "curveEditor": { "curveLineHint": "", @@ -332,7 +381,8 @@ "spawnType": "", "spawnShapes": { "rectangle": "", - "star": "" + "star": "", + "torus": "" }, "width": "", "height": "", @@ -348,7 +398,32 @@ "alreadyHasAnImportingTexture": "", "changeGrid": "", "newGridSize": "", - "setPreviewTexture": "" + "setPreviewTexture": "", + "textureMethod": "", + "textureMethods": { + "random": "", + "animated": "" + }, + "animatedFramerate": "", + "easingHeader": "", + "easing": { + "none": "", + "linear": "", + "smooth": "" + }, + "movementType": "", + "movementTypes": { + "linear": "", + "accelerated": "" + }, + "rotateTexture": "", + "rotationMethod": "", + "rotationMethods": { + "static": "", + "dynamic": "" + }, + "burstSpacing": "", + "burstStart": "" }, "patreon": { "aboutPatrons": "", @@ -429,7 +504,11 @@ "splashScreen": "", "splashScreenNotice": "", "forceSmoothIcons": "", - "forceSmoothSplashScreen": "" + "forceSmoothSplashScreen": "", + "alternativeCtjsLogo": "", + "alternativeCtjsNotice": "", + "customLoadingText": "", + "customLoadingTextHint": "" }, "modules": { "heading": "" @@ -456,6 +535,23 @@ "unspecified": "", "landscape": "", "portrait": "" + }, + "viewportMode": "", + "viewportModes": { + "asIs": "", + "fastScale": "", + "fastScaleInteger": "", + "expand": "", + "scaleFit": "", + "scaleFill": "" + }, + "viewportModesDescriptions": { + "asIs": "", + "fastScale": "", + "fastScaleInteger": "", + "expand": "", + "scaleFit": "", + "scaleFill": "" } }, "scripts": { @@ -477,7 +573,12 @@ "none": "", "minify": "", "obfuscate": "" - } + }, + "assetTree": "", + "assetTreeNote": "", + "exportAssetTree": "", + "exportAssetTypes": "", + "autocloseDesktop": "" }, "content": { "heading": "", @@ -499,9 +600,15 @@ "confirmDeletionMessage": "", "gotoEntries": "", "entries": "", - "array": "" + "array": "", + "fixedLength": "" }, - "contentTypes": "" + "contentTypes": "", + "main": { + "heading": "The heading of the settings section with main project settings", + "miscHeading": "The heading of the settings section with project settings that did not fit into other groups", + "backups": "" + } }, "extensionsEditor": { "noEntries": "", @@ -558,7 +665,10 @@ "disableAcceleration": "", "disableBuiltInDebugger": "", "postAnIssue": "", - "heading": "" + "heading": "", + "disableVulkan": "", + "disableVulkanSDHint": "", + "restartMessage": "" }, "deploy": { "exportDesktop": "", @@ -609,7 +719,9 @@ "startNewWindow": "", "successZipProject": "", "zipProject": "", - "heading": "" + "heading": "", + "convertToJs": "", + "confirmationConvertToJs": "" }, "meta": { "license": "", @@ -658,9 +770,25 @@ "tabMainMenuMeta": "", "helpPanelReminder": "", "buttonStartTutorial": "" - } + }, + "assets": "", + "applyAssetsQuestion": "", + "applyAssetsExplanation": "", + "unsavedAssets": "", + "runWithoutApplying": "", + "applyAndRun": "", + "cantAddEditor": "" + }, + "assetViewer": { + "root": "", + "toggleFolderTree": "", + "addNewFolder": "", + "newFolderName": "", + "unwrapFolder": "", + "confirmDeleteFolder": "", + "confirmUnwrapFolder": "", + "exportBehavior": "" }, - "assetViewer": {}, "soundRecorder": { "recorderHeading": "", "record": "", @@ -687,7 +815,10 @@ "show": "", "hide": "", "findTileset": "", - "addTileLayer": "" + "addTileLayer": "", + "addTileLayerFirst": "", + "cacheLayer": "", + "cacheLayerWarning": "" }, "roomView": { "name": "", @@ -760,9 +891,55 @@ "addCopies": "", "addTiles": "", "manageBackgrounds": "", - "roomProperties": "" + "roomProperties": "", + "uiTools": "" }, - "resetView": "Running this command brings camera back to the center of the room, and resets zoom" + "resetView": "Running this command brings camera back to the center of the room, and resets zoom", + "viewportHeading": "", + "followTemplate": "", + "followCodeHint": "", + "sendToBack": "", + "sendToFront": "", + "emptyTextFiller": "", + "uiTools": { + "noSelectionNotice": "", + "textSettings": "", + "customText": "", + "customTextSize": "", + "wordWrapWidth": "", + "textAlignment": "", + "alignmentSettings": "", + "enableAutoAlignment": "", + "autoAlignHint": "", + "frame": "", + "framePadding": "", + "innerFrameMarker": "", + "outerFrameMarker": "", + "constrains": "", + "constrainsTooltips": { + "left": "", + "right": "", + "top": "", + "bottom": "", + "centerVertical": "", + "centerHorizontal": "" + }, + "bindings": "", + "bindingsHelp": "", + "bindingNames": { + "text": "", + "disabled": "", + "visible": "", + "tex": "", + "tint": "", + "count": "" + }, + "bindingTypes": { + "string": "", + "boolean": "", + "number": "" + } + } }, "styleView": { "active": "", @@ -839,7 +1016,11 @@ "marginY": "", "offX": "", "offY": "", - "blankTextureNotice": "" + "blankTextureNotice": "", + "slicing": "", + "viewSettings": "", + "exportSettings": "", + "axisExplanation": "" }, "fontView": { "italic": "", @@ -898,7 +1079,42 @@ "screen": "" }, "animationFPS": "", - "loopAnimation": "" + "loopAnimation": "", + "hoverTexture": "", + "pressedTexture": "", + "disabledTexture": "", + "defaultText": "", + "textStyle": "", + "fieldType": "", + "fieldTypes": { + "text": "", + "number": "", + "email": "", + "password": "" + }, + "useCustomSelectionColor": "", + "maxLength": "", + "baseClass": { + "AnimatedSprite": "", + "Text": "", + "NineSlicePlane": "", + "Container": "", + "Button": "", + "RepeatingTexture": "", + "SpritedCounter": "", + "TextBox": "" + }, + "nineSliceTop": "", + "nineSliceRight": "", + "nineSliceBottom": "", + "nineSliceLeft": "", + "autoUpdateNineSlice": "", + "autoUpdateNineSliceHint": "", + "panelHeading": "", + "scrollSpeedX": "", + "scrollSpeedY": "", + "isUi": "To use u.time or u.timeUi", + "defaultCount": "A label for a field that sets how many sprites are shown when no value has been set through code." }, "assetInput": { "changeAsset": "", @@ -933,7 +1149,9 @@ "pointer": "", "misc": "", "animation": "", - "timers": "" + "timers": "", + "input": "A name of an event when someone inputs something into a text field", + "app": "" }, "coreEvents": { "OnCreate": "", @@ -956,7 +1174,11 @@ "OnFrameChange": "", "OnAnimationLoop": "", "OnAnimationComplete": "", - "Timer": "" + "Timer": "", + "OnAppFocus": "", + "OnAppBlur": "", + "OnTextChange": "", + "OnTextInput": "" }, "coreParameterizedNames": { "OnActionPress": "", @@ -976,7 +1198,9 @@ }, "coreEventsLocals": { "OnActionDown_value": "", - "OnActionPress_value": "" + "OnActionPress_value": "", + "OnTextChange_value": "", + "OnTextInput_value": "" }, "coreEventsDescriptions": { "OnCreate": "", @@ -990,7 +1214,91 @@ "OnActionDown": "", "OnAnimationLoop": "", "OnAnimationComplete": "", - "Timer": "" - } + "Timer": "", + "OnAppFocus": "", + "OnAppBlur": "", + "OnTextChange": "", + "OnTextInput": "" + }, + "jumpToProblem": "", + "staticEventWarning": "", + "restrictedEventWarning": "", + "baseClassWarning": "" + }, + "assetConfirm": { + "confirmHeading": "", + "confirmParagraph": "" + }, + "behaviorEditor": { + "customFields": "", + "customFieldsDescription": "" + }, + "createAsset": { + "newAsset": "", + "placeholderTexture": "", + "assetGallery": "", + "behaviorTemplate": "", + "behaviorRoom": "", + "behaviorImport": "", + "behaviorMissingCatmods": "", + "formatError": "" + }, + "exporterError": { + "exporterErrorHeader": "", + "errorSource": "", + "clueSolutions": { + "syntax": "", + "eventConfiguration": "", + "emptySound": "", + "emptyEmitter": "", + "windowsFileLock": "", + "noTemplateTexture": "" + }, + "stacktrace": "", + "jumpToProblem": "", + "saveAndQuit": "" + }, + "folderEditor": { + "title": "", + "icon": "", + "color": "" + }, + "languageSelector": { + "chooseLanguageHeader": "", + "chooseLanguageExplanation": "", + "coffeeScriptDescription": "", + "pickCoffeeScript": "", + "jsAndTs": "", + "jsTsDescription": "", + "pickJsTs": "", + "acceptAndSpecifyDirectory": "" + }, + "newAssetPrompt": { + "heading": "", + "selectNewName": "" + }, + "scriptView": { + "runAutomatically": "", + "language": "", + "convertToJavaScript": "" + }, + "soundView": { + "variants": "", + "addVariant": "", + "preload": "", + "volume": "", + "pitch": "", + "distortion": "", + "effects": "", + "reverb": "", + "reverbDuration": "", + "reverbDecay": "", + "reverseReverb": "", + "equalizer": "", + "hertz": "", + "positionalAudio": "", + "falloff": "", + "refDistance": "", + "positionalAudioHint": "" } -} +} \ No newline at end of file diff --git a/app/data/i18n/Debug.json b/app/data/i18n/Debug.json index 7841be12c..703cf96ae 100644 --- a/app/data/i18n/Debug.json +++ b/app/data/i18n/Debug.json @@ -6,61 +6,46 @@ }, "common": { "add": "common.add", - "addBehavior": "common.addBehavior", "apply": "common.apply", "cancel": "common.cancel", "cannotBeEmpty": "common.cannotBeEmpty", - "clear": "common.clear", - "close": "common.close", "confirmDelete": "common.confirmDelete", "contribute": "common.contribute", "copy": "common.copy", "copyName": "common.copyName", - "copyNamesList": "common.copyNamesList", - "copyNamesArray": "common.copyNamesArray", - "couldNotLoadFromClipboard": "common.couldNotLoadFromClipboard", - "create": "common.create", "cut": "common.cut", "delete": "common.delete", - "discard": "common.discard", - "docsShort": "common.docsShort", - "docsLong": "common.docsLong", "donate": "common.donate", "done": "common.done", "duplicate": "common.duplicate", "exit": "common.exit", - "edit": "common.edit", - "filter": "common.filter", - "goBack": "common.goBack", - "loading": "common.loading", "name": "common.name", - "next": "common.next", "no": "common.no", "none": "common.none", - "nothingToShowFiller": "common.nothingToShowFiller", "ok": "common.ok", "open": "common.open", "paste": "common.paste", - "pastedFromClipboard": "common.pastedFromClipboard", - "previous": "common.previous", "rename": "common.rename", - "required": "common.required", "save": "common.save", - "selectDialogue": "common.selectDialogue", - "select": "common.select", - "search": "common.search", - "settings": "common.settings", "sort": "common.sort", - "sortByDate": "common.sortByDate", - "sortByName": "common.sortByName", - "sortByType": "common.sortByType", "wrongFormat": "common.wrongFormat", "yes": "common.yes", + "loading": "common.loading", + "select": "common.select", "zoom": "common.zoom", "zoomIn": "common.zoomIn", "zoomOut": "common.zoomOut", - "undo": "common.undo", - "redo": "common.redo", + "clear": "common.clear", + "filter": "common.filter", + "selectDialogue": "common.selectDialogue", + "search": "common.search", + "close": "common.close", + "couldNotLoadFromClipboard": "common.couldNotLoadFromClipboard", + "pastedFromClipboard": "common.pastedFromClipboard", + "edit": "common.edit", + "nothingToShowFiller": "common.nothingToShowFiller", + "required": "common.required", + "settings": "common.settings", "fieldTypes": { "checkbox": "common.fieldTypes.checkbox", "code": "common.fieldTypes.code", @@ -85,36 +70,15 @@ "savedMessage": "common.savedMessage", "reallyExitConfirm": "common.reallyExitConfirm", "notFoundOrUnknown": "common.notFoundOrUnknown", - "reimportSourceMissing": "common.reimportSourceMissing", "nameTaken": "common.nameTaken", - "dropToImport": "common.dropToImport", - "reimport": "common.reimport", "addToNotes": "common.addToNotes", "noRooms": "common.noRooms", "tileLayer": "common.tileLayer", "ctSite": "common.ctSite", + "docsShort": "common.docsShort", + "docsLong": "common.docsLong", "openAssetGallery": "common.openAssetGallery", - "alignModes": { - "left": "common.alignModes.left", - "right": "common.alignModes.right", - "top": "common.alignModes.top", - "bottom": "common.alignModes.bottom", - "center": "common.alignModes.center", - "topLeft": "common.alignModes.topLeft", - "topCenter": "common.alignModes.topCenter", - "topRight": "common.alignModes.topRight", - "bottomLeft": "common.alignModes.bottomLeft", - "bottomCenter": "common.alignModes.bottomCenter", - "bottomRight": "common.alignModes.bottomRight", - "fill": "common.alignModes.fill", - "Scale": "common.alignModes.Scale" - }, "assetTypes": { - "behavior": [ - "common.assetTypes.behavior.0", - "common.assetTypes.behavior.1", - "common.assetTypes.behavior.2" - ], "texture": [ "common.assetTypes.texture.0", "common.assetTypes.texture.1", @@ -154,46 +118,51 @@ "common.assetTypes.skeleton.0", "common.assetTypes.skeleton.1", "common.assetTypes.skeleton.2" + ], + "behavior": [ + "common.assetTypes.behavior.0", + "common.assetTypes.behavior.1", + "common.assetTypes.behavior.2" + ], + "script": [ + "common.assetTypes.script.0", + "common.assetTypes.script.1", + "common.assetTypes.script.2" ] + }, + "next": "common.next", + "previous": "common.previous", + "undo": "common.undo", + "redo": "common.redo", + "addBehavior": "common.addBehavior", + "copyNamesList": "common.copyNamesList", + "copyNamesArray": "common.copyNamesArray", + "create": "common.create", + "discard": "common.discard", + "experimentalFeature": "common.experimentalFeature", + "goBack": "common.goBack", + "sortByDate": "common.sortByDate", + "sortByName": "common.sortByName", + "sortByType": "common.sortByType", + "reimportSourceMissing": "common.reimportSourceMissing", + "dropToImport": "common.dropToImport", + "reimport": "common.reimport", + "alignModes": { + "left": "common.alignModes.left", + "right": "common.alignModes.right", + "top": "common.alignModes.top", + "bottom": "common.alignModes.bottom", + "center": "common.alignModes.center", + "topLeft": "common.alignModes.topLeft", + "topCenter": "common.alignModes.topCenter", + "topRight": "common.alignModes.topRight", + "bottomLeft": "common.alignModes.bottomLeft", + "bottomCenter": "common.alignModes.bottomCenter", + "bottomRight": "common.alignModes.bottomRight", + "fill": "common.alignModes.fill", + "Scale": "common.alignModes.Scale" } }, - "assetConfirm": { - "confirmHeading": "assetConfirm.confirmHeading", - "confirmParagraph": "assetConfirm.confirmParagraph" - }, - "assetInput": { - "changeAsset": "assetInput.changeAsset", - "jumpToAsset": "assetInput.jumpToAsset", - "selectAssetHeader": "assetInput.selectAssetHeader" - }, - "assetViewer": { - "root": "assetViewer.root", - "toggleFolderTree": "assetViewer.toggleFolderTree", - "addNewFolder": "assetViewer.addNewFolder", - "newFolderName": "assetViewer.newFolderName", - "unwrapFolder": "assetViewer.unwrapFolder", - "confirmDeleteFolder": "assetViewer.confirmDeleteFolder", - "confirmUnwrapFolder": "assetViewer.confirmUnwrapFolder", - "exportBehavior": "assetViewer.exportBehavior" - }, - "behaviorEditor": { - "customFields": "behaviorEditor.customFields", - "customFieldsDescription": "behaviorEditor.customFieldsDescription" - }, - "builtinAssetGallery": { - "galleryTip": "builtinAssetGallery.galleryTip", - "assetGalleryHeader": "builtinAssetGallery.assetGalleryHeader", - "importIntoProject": "builtinAssetGallery.importIntoProject", - "importAll": "builtinAssetGallery.importAll", - "byAuthorPrefix": "builtinAssetGallery.byAuthorPrefix", - "cannotImportExplanation": "builtinAssetGallery.cannotImportExplanation", - "nameOccupied": "builtinAssetGallery.nameOccupied", - "cannotImportNameOccupied": "builtinAssetGallery.cannotImportNameOccupied", - "visitSource": "builtinAssetGallery.visitSource", - "visitAuthorsItch": "builtinAssetGallery.visitAuthorsItch", - "visitAuthorsTwitter": "builtinAssetGallery.visitAuthorsTwitter", - "tipAuthor": "builtinAssetGallery.tipAuthor" - }, "colorPicker": { "current": "colorPicker.current", "globalPalette": "colorPicker.globalPalette", @@ -201,42 +170,9 @@ "old": "colorPicker.old", "projectPalette": "colorPicker.projectPalette" }, - "createAsset": { - "newAsset": "createAsset.newAsset", - "placeholderTexture": "createAsset.placeholderTexture", - "behaviorTemplate": "createAsset.behaviorTemplate", - "behaviorRoom": "createAsset.behaviorRoom", - "behaviorImport": "createAsset.behaviorImport", - "behaviorMissingCatmods": "createAsset.behaviorMissingCatmods", - "formatError": "createAsset.formatError" - }, - "curveEditor": { - "curveLineHint": "curveEditor.curveLineHint", - "dragPointHint": "curveEditor.dragPointHint", - "pointTime": "curveEditor.pointTime", - "pointValue": "curveEditor.pointValue" - }, - "debuggerToolbar": { - "pause": "debuggerToolbar.pause", - "resume": "debuggerToolbar.resume", - "restartGame": "debuggerToolbar.restartGame", - "restartRoom": "debuggerToolbar.restartRoom", - "switchRoom": "debuggerToolbar.switchRoom", - "toggleDevTools": "debuggerToolbar.toggleDevTools", - "screenshot": "debuggerToolbar.screenshot", - "enterFullscreen": "debuggerToolbar.enterFullscreen", - "exitFullscreen": "debuggerToolbar.exitFullscreen", - "links": "debuggerToolbar.links", - "openExternal": "debuggerToolbar.openExternal", - "close": "debuggerToolbar.close" - }, "docsShortcut": { "openDocs": "docsShortcut.openDocs" }, - "docsPanel": { - "documentation": "docsPanel.documentation", - "reference": "docsPanel.reference" - }, "exportPanel": { "hide": "exportPanel.hide", "working": "exportPanel.working", @@ -246,6 +182,7 @@ "log": "exportPanel.log", "windowsCrossBuildWarning": "exportPanel.windowsCrossBuildWarning", "cannotBuildForMacOnWin": "exportPanel.cannotBuildForMacOnWin", + "firstRunNotice": "exportPanel.firstRunNotice", "projectTitleRequired": "exportPanel.projectTitleRequired", "appIdRequired": "exportPanel.appIdRequired", "noAndroidSdkFound": "exportPanel.noAndroidSdkFound", @@ -254,46 +191,21 @@ "requiresInternetNotice": "exportPanel.requiresInternetNotice", "noJdkFound": "exportPanel.noJdkFound", "downloadJDK": "exportPanel.downloadJDK", - "firstRunNotice": "exportPanel.firstRunNotice" - }, - "exporterError": { - "exporterErrorHeader": "exporterError.exporterErrorHeader", - "errorSource": "exporterError.errorSource", - "clueSolutions": { - "syntax": "exporterError.clueSolutions.syntax", - "eventConfiguration": "exporterError.clueSolutions.eventConfiguration", - "emptySound": "exporterError.clueSolutions.emptySound", - "emptyEmitter": "exporterError.clueSolutions.emptyEmitter", - "windowsFileLock": "exporterError.clueSolutions.windowsFileLock" - }, - "stacktrace": "exporterError.stacktrace", - "jumpToProblem": "exporterError.jumpToProblem", - "saveAndQuit": "exporterError.saveAndQuit" - }, - "extensionsEditor": { - "noEntries": "extensionsEditor.noEntries", - "addRow": "extensionsEditor.addRow", - "actions": "extensionsEditor.actions", - "values": "extensionsEditor.values", - "moveDown": "extensionsEditor.moveDown", - "moveUp": "extensionsEditor.moveUp", - "deleteRow": "extensionsEditor.deleteRow" - }, - "folderEditor": { - "title": "folderEditor.title", - "icon": "folderEditor.icon", - "color": "folderEditor.color" + "goodToGo": "exportPanel.goodToGo", + "nodeJsNotFound": "exportPanel.nodeJsNotFound", + "nodeJsDownloadPage": "exportPanel.nodeJsDownloadPage", + "nodeJsIcons": "exportPanel.nodeJsIcons" }, "intro": { "loading": "intro.loading", "newProject": { + "input": "intro.newProject.input", + "selectProjectFolder": "intro.newProject.selectProjectFolder", + "nameError": "intro.newProject.nameError", "header": "intro.newProject.header", "projectName": "intro.newProject.projectName", "language": "intro.newProject.language", "saveFolder": "intro.newProject.saveFolder", - "input": "intro.newProject.input", - "selectProjectFolder": "intro.newProject.selectProjectFolder", - "nameError": "intro.newProject.nameError", "languageError": "intro.newProject.languageError" }, "recovery": { @@ -308,202 +220,40 @@ "homepage": "intro.homepage", "latestVersion": "intro.latestVersion", "forgetProject": "intro.forgetProject", - "cloneProject": "intro.cloneProject", "browse": "intro.browse", "latest": "intro.latest", - "nothingToShowFiller": "intro.nothingToShowFiller", - "examples": "intro.examples", - "templates": "intro.templates", - "templatesInfo": "intro.templatesInfo", "unableToWriteToFolders": "intro.unableToWriteToFolders", "twitter": "intro.twitter", "discord": "intro.discord", + "examples": "intro.examples", + "createOrBrowseJunction": "intro.createOrBrowseJunction", + "cloneProject": "intro.cloneProject", "github": "intro.github", "itch": "intro.itch", "vkontakte": "intro.vkontakte", "patreon": "intro.patreon", + "templates": "intro.templates", + "templatesInfo": "intro.templatesInfo", "boosty": "intro.boosty", "sponsoredBy": "intro.sponsoredBy", "supportedBy": "intro.supportedBy", - "createOrBrowseJunction": "intro.createOrBrowseJunction" - }, - "onboarding": { - "hoorayHeader": "onboarding.hoorayHeader", - "nowWhatParagraph": "onboarding.nowWhatParagraph", - "openSpaceShooterTutorial": "onboarding.openSpaceShooterTutorial", - "openPlatformerTutorial": "onboarding.openPlatformerTutorial", - "openJettyCatTutorial": "onboarding.openJettyCatTutorial", - "doNothing": "onboarding.doNothing", - "showOnboardingCheckbox": "onboarding.showOnboardingCheckbox" - }, - "languageSelector": { - "chooseLanguageHeader": "languageSelector.chooseLanguageHeader", - "chooseLanguageExplanation": "languageSelector.chooseLanguageExplanation", - "coffeeScriptDescription": "languageSelector.coffeeScriptDescription", - "pickCoffeeScript": "languageSelector.pickCoffeeScript", - "jsAndTs": "languageSelector.jsAndTs", - "jsTsDescription": "languageSelector.jsTsDescription", - "pickJsTs": "languageSelector.pickJsTs", - "acceptAndSpecifyDirectory": "languageSelector.acceptAndSpecifyDirectory" - }, - "settings": { - "actions": { - "heading": "settings.actions.heading", - "actions": "settings.actions.actions", - "addAction": "settings.actions.addAction", - "addMethod": "settings.actions.addMethod", - "deleteAction": "settings.actions.deleteAction", - "deleteMethod": "settings.actions.deleteMethod", - "inputActionNamePlaceholder": "settings.actions.inputActionNamePlaceholder", - "methodModuleMissing": "settings.actions.methodModuleMissing", - "methods": "settings.actions.methods", - "multiplier": "settings.actions.multiplier", - "noActionsYet": "settings.actions.noActionsYet", - "makeFromScratch": "settings.actions.makeFromScratch", - "presets": "settings.actions.presets", - "presetXYMovement": "settings.actions.presetXYMovement", - "presetTouchAndMouse": "settings.actions.presetTouchAndMouse", - "presetCustom": "settings.actions.presetCustom", - "exportActionPreset": "settings.actions.exportActionPreset", - "importErrorMissingModules": "settings.actions.importErrorMissingModules", - "importErrorNotCtJsPreset": "settings.actions.importErrorNotCtJsPreset" - }, - "authoring": { - "heading": "settings.authoring.heading", - "author": "settings.authoring.author", - "site": "settings.authoring.site", - "title": "settings.authoring.title", - "version": "settings.authoring.version", - "versionPostfix": "settings.authoring.versionPostfix", - "appId": "settings.authoring.appId", - "appIdExplanation": "settings.authoring.appIdExplanation" - }, - "branding": { - "heading": "settings.branding.heading", - "accent": "settings.branding.accent", - "accentNotice": "settings.branding.accentNotice", - "icon": "settings.branding.icon", - "iconNotice": "settings.branding.iconNotice", - "splashScreen": "settings.branding.splashScreen", - "splashScreenNotice": "settings.branding.splashScreenNotice", - "forceSmoothIcons": "settings.branding.forceSmoothIcons", - "forceSmoothSplashScreen": "settings.branding.forceSmoothSplashScreen", - "invertPreloaderScheme": "settings.branding.invertPreloaderScheme", - "alternativeCtjsLogo": "settings.branding.alternativeCtjsLogo", - "alternativeCtjsNotice": "settings.branding.alternativeCtjsNotice", - "hideLoadingLogo": "settings.branding.hideLoadingLogo", - "customLoadingText": "settings.branding.customLoadingText", - "customLoadingTextHint": "settings.branding.customLoadingTextHint" - }, - "content": { - "heading": "settings.content.heading", - "addContentType": "settings.content.addContentType", - "missingTypeName": "settings.content.missingTypeName", - "unnamedContentTypeHint": "settings.content.unnamedContentTypeHint", - "typeName": "settings.content.typeName", - "typeNameHint": "settings.content.typeNameHint", - "typeReadableName": "settings.content.typeReadableName", - "typeReadableNameHint": "settings.content.typeReadableNameHint", - "icon": "settings.content.icon", - "typeSpecification": "settings.content.typeSpecification", - "fieldName": "settings.content.fieldName", - "fieldNameHint": "settings.content.fieldNameHint", - "fieldReadableName": "settings.content.fieldReadableName", - "fieldReadableNameHint": "settings.content.fieldReadableNameHint", - "fixedLength": "settings.content.fixedLength", - "fieldType": "settings.content.fieldType", - "array": "settings.content.array", - "deleteContentType": "settings.content.deleteContentType", - "confirmDeletionMessage": "settings.content.confirmDeletionMessage", - "gotoEntries": "settings.content.gotoEntries", - "entries": "settings.content.entries" - }, - "modules": { - "heading": "settings.modules.heading" - }, - "rendering": { - "heading": "settings.rendering.heading", - "framerate": "settings.rendering.framerate", - "highDensity": "settings.rendering.highDensity", - "maxFPS": "settings.rendering.maxFPS", - "hideCursor": "settings.rendering.hideCursor", - "usePixiLegacy": "settings.rendering.usePixiLegacy", - "viewportMode": "settings.rendering.viewportMode", - "viewportModes": { - "asIs": "settings.rendering.viewportModes.asIs", - "fastScale": "settings.rendering.viewportModes.fastScale", - "fastScaleInteger": "settings.rendering.viewportModes.fastScaleInteger", - "expand": "settings.rendering.viewportModes.expand", - "scaleFit": "settings.rendering.viewportModes.scaleFit", - "scaleFill": "settings.rendering.viewportModes.scaleFill" - }, - "viewportModesDescriptions": { - "asIs": "settings.rendering.viewportModesDescriptions.asIs", - "fastScale": "settings.rendering.viewportModesDescriptions.fastScale", - "fastScaleInteger": "settings.rendering.viewportModesDescriptions.fastScaleInteger", - "expand": "settings.rendering.viewportModesDescriptions.expand", - "scaleFit": "settings.rendering.viewportModesDescriptions.scaleFit", - "scaleFill": "settings.rendering.viewportModesDescriptions.scaleFill" - }, - "useTransparent": "settings.rendering.useTransparent", - "desktopBuilds": "settings.rendering.desktopBuilds", - "launchMode": "settings.rendering.launchMode", - "launchModes": { - "maximized": "settings.rendering.launchModes.maximized", - "fullscreen": "settings.rendering.launchModes.fullscreen", - "windowed": "settings.rendering.launchModes.windowed" - }, - "mobileBuilds": "settings.rendering.mobileBuilds", - "screenOrientation": "settings.rendering.screenOrientation", - "screenOrientations": { - "unspecified": "settings.rendering.screenOrientations.unspecified", - "landscape": "settings.rendering.screenOrientations.landscape", - "portrait": "settings.rendering.screenOrientations.portrait" - }, - "pixelatedRender": "settings.rendering.pixelatedRender" - }, - "scripts": { - "heading": "settings.scripts.heading", - "addNew": "settings.scripts.addNew", - "deleteScript": "settings.scripts.deleteScript", - "moveDown": "settings.scripts.moveDown", - "moveUp": "settings.scripts.moveUp", - "newScriptComment": "settings.scripts.newScriptComment" - }, - "export": { - "heading": "settings.export.heading", - "functionWrap": "settings.export.functionWrap", - "codeModifier": "settings.export.codeModifier", - "obfuscateWarning": "settings.export.obfuscateWarning", - "codeModifierAndWrapNote": "settings.export.codeModifierAndWrapNote", - "codeModifiers": { - "none": "settings.export.codeModifiers.none", - "minify": "settings.export.codeModifiers.minify", - "obfuscate": "settings.export.codeModifiers.obfuscate" - } - }, - "catmodsSettings": "settings.catmodsSettings", - "contentTypes": "settings.contentTypes" + "nothingToShowFiller": "intro.nothingToShowFiller" }, "modules": { "author": "modules.author", - "dependencies": "modules.dependencies", "help": "modules.help", "info": "modules.info", "license": "modules.license", "logs": "modules.logs", "methods": "modules.methods", - "optionalDependencies": "modules.optionalDependencies", "parameters": "modules.parameters", "logs2": "modules.logs2", - "settings": "modules.settings", + "dependencies": "modules.dependencies", + "optionalDependencies": "modules.optionalDependencies", "importModules": "modules.importModules", "enabledModules": "modules.enabledModules", "availableModules": "modules.availableModules", "filter": "modules.filter", - "preview": "modules.preview", - "previewTooltip": "modules.previewTooltip", - "deprecatedTooltip": "modules.deprecatedTooltip", "categories": { "customization": "modules.categories.customization", "utilities": "modules.categories.utilities", @@ -517,54 +267,24 @@ "integrations": "modules.categories.integrations", "tweaks": "modules.categories.tweaks", "networking": "modules.categories.networking" - } - }, - "newAssetPrompt": { - "heading": "newAssetPrompt.heading", - "selectNewName": "newAssetPrompt.selectNewName" + }, + "preview": "modules.preview", + "previewTooltip": "modules.previewTooltip", + "deprecatedTooltip": "modules.deprecatedTooltip", + "settings": "modules.settings" }, "texture": { "create": "texture.create", "import": "texture.import", "skeletons": "texture.skeletons", - "textures": "texture.textures", "createTemplate": "texture.createTemplate", "importFromClipboard": "texture.importFromClipboard", - "generatePlaceholder": "texture.generatePlaceholder" - }, - "textureGenerator": { - "name": "textureGenerator.name", - "width": "textureGenerator.width", - "height": "textureGenerator.height", - "color": "textureGenerator.color", - "label": "textureGenerator.label", - "optional": "textureGenerator.optional", - "createAndClose": "textureGenerator.createAndClose", - "createAndContinue": "textureGenerator.createAndContinue", - "scalingAtX4": "textureGenerator.scalingAtX4", - "generationSuccessMessage": "textureGenerator.generationSuccessMessage", - "form": "textureGenerator.form", - "formRectangular": "textureGenerator.formRectangular", - "formRound": "textureGenerator.formRound", - "formDiamond": "textureGenerator.formDiamond", - "filler": "textureGenerator.filler", - "fillerNone": "textureGenerator.fillerNone", - "fillerCross": "textureGenerator.fillerCross", - "fillerArrow": "textureGenerator.fillerArrow", - "fillerLabel": "textureGenerator.fillerLabel" + "generatePlaceholder": "texture.generatePlaceholder", + "textures": "texture.textures" }, "sounds": { "record": "sounds.record" }, - "soundRecorder": { - "recorderHeading": "soundRecorder.recorderHeading", - "record": "soundRecorder.record", - "stopRecording": "soundRecorder.stopRecording", - "discardRecording": "soundRecorder.discardRecording", - "finishRecording": "soundRecorder.finishRecording", - "cannotRecordSound": "soundRecorder.cannotRecordSound", - "troubleshootingWindows": "soundRecorder.troubleshootingWindows" - }, "styles": { "create": "styles.create", "styles": "styles.styles" @@ -574,6 +294,47 @@ "import": "fonts.import", "italic": "fonts.italic" }, + "rooms": { + "create": "rooms.create", + "makeStarting": "rooms.makeStarting" + }, + "notepad": { + "local": "notepad.local", + "global": "notepad.global", + "backToHome": "notepad.backToHome", + "modulesPages": "notepad.modulesPages", + "helpPages": "notepad.helpPages", + "docsAndNotes": "notepad.docsAndNotes" + }, + "curveEditor": { + "curveLineHint": "curveEditor.curveLineHint", + "dragPointHint": "curveEditor.dragPointHint", + "pointTime": "curveEditor.pointTime", + "pointValue": "curveEditor.pointValue" + }, + "debuggerToolbar": { + "pause": "debuggerToolbar.pause", + "resume": "debuggerToolbar.resume", + "restartGame": "debuggerToolbar.restartGame", + "restartRoom": "debuggerToolbar.restartRoom", + "switchRoom": "debuggerToolbar.switchRoom", + "toggleDevTools": "debuggerToolbar.toggleDevTools", + "screenshot": "debuggerToolbar.screenshot", + "enterFullscreen": "debuggerToolbar.enterFullscreen", + "exitFullscreen": "debuggerToolbar.exitFullscreen", + "links": "debuggerToolbar.links", + "openExternal": "debuggerToolbar.openExternal", + "close": "debuggerToolbar.close" + }, + "onboarding": { + "hoorayHeader": "onboarding.hoorayHeader", + "nowWhatParagraph": "onboarding.nowWhatParagraph", + "openSpaceShooterTutorial": "onboarding.openSpaceShooterTutorial", + "openPlatformerTutorial": "onboarding.openPlatformerTutorial", + "openJettyCatTutorial": "onboarding.openJettyCatTutorial", + "doNothing": "onboarding.doNothing", + "showOnboardingCheckbox": "onboarding.showOnboardingCheckbox" + }, "particleEmitters": { "emittersHeading": "particleEmitters.emittersHeading", "emitterHeading": "particleEmitters.emitterHeading", @@ -581,19 +342,7 @@ "to": "particleEmitters.to", "textureHeading": "particleEmitters.textureHeading", "selectTexture": "particleEmitters.selectTexture", - "textureMethod": "particleEmitters.textureMethod", - "textureMethods": { - "random": "particleEmitters.textureMethods.random", - "animated": "particleEmitters.textureMethods.animated" - }, - "animatedFramerate": "particleEmitters.animatedFramerate", "importBuiltin": "particleEmitters.importBuiltin", - "easingHeader": "particleEmitters.easingHeader", - "easing": { - "none": "particleEmitters.easing.none", - "linear": "particleEmitters.easing.linear", - "smooth": "particleEmitters.easing.smooth" - }, "colorAndOpacityHeading": "particleEmitters.colorAndOpacityHeading", "stepped": "particleEmitters.stepped", "steppedColor": "particleEmitters.steppedColor", @@ -608,11 +357,6 @@ "minimumSize": "particleEmitters.minimumSize", "minimumSizeHint": "particleEmitters.minimumSizeHint", "velocityHeading": "particleEmitters.velocityHeading", - "movementType": "particleEmitters.movementType", - "movementTypes": { - "linear": "particleEmitters.movementTypes.linear", - "accelerated": "particleEmitters.movementTypes.accelerated" - }, "velocity": "particleEmitters.velocity", "minimumSpeed": "particleEmitters.minimumSpeed", "minimumSpeedHint": "particleEmitters.minimumSpeedHint", @@ -621,18 +365,10 @@ "gravityNotice": "particleEmitters.gravityNotice", "directionHeading": "particleEmitters.directionHeading", "startingDirection": "particleEmitters.startingDirection", - "rotateTexture": "particleEmitters.rotateTexture", "rotationHeading": "particleEmitters.rotationHeading", - "rotationMethod": "particleEmitters.rotationMethod", - "rotationMethods": { - "static": "particleEmitters.rotationMethods.static", - "dynamic": "particleEmitters.rotationMethods.dynamic" - }, "rotationSpeed": "particleEmitters.rotationSpeed", "rotationAcceleration": "particleEmitters.rotationAcceleration", "spawningHeading": "particleEmitters.spawningHeading", - "burstSpacing": "particleEmitters.burstSpacing", - "burstStart": "particleEmitters.burstStart", "timeBetweenBursts": "particleEmitters.timeBetweenBursts", "spawnAtOnce": "particleEmitters.spawnAtOnce", "chanceToSpawn": "particleEmitters.chanceToSpawn", @@ -645,8 +381,8 @@ "spawnType": "particleEmitters.spawnType", "spawnShapes": { "rectangle": "particleEmitters.spawnShapes.rectangle", - "torus": "particleEmitters.spawnShapes.torus", - "star": "particleEmitters.spawnShapes.star" + "star": "particleEmitters.spawnShapes.star", + "torus": "particleEmitters.spawnShapes.torus" }, "width": "particleEmitters.width", "height": "particleEmitters.height", @@ -662,31 +398,37 @@ "alreadyHasAnImportingTexture": "particleEmitters.alreadyHasAnImportingTexture", "changeGrid": "particleEmitters.changeGrid", "newGridSize": "particleEmitters.newGridSize", - "setPreviewTexture": "particleEmitters.setPreviewTexture" - }, - "rooms": { - "create": "rooms.create", - "makeStarting": "rooms.makeStarting" - }, - "notepad": { - "local": "notepad.local", - "global": "notepad.global", - "backToHome": "notepad.backToHome", - "modulesPages": "notepad.modulesPages", - "helpPages": "notepad.helpPages", - "docsAndNotes": "notepad.docsAndNotes" + "setPreviewTexture": "particleEmitters.setPreviewTexture", + "textureMethod": "particleEmitters.textureMethod", + "textureMethods": { + "random": "particleEmitters.textureMethods.random", + "animated": "particleEmitters.textureMethods.animated" + }, + "animatedFramerate": "particleEmitters.animatedFramerate", + "easingHeader": "particleEmitters.easingHeader", + "easing": { + "none": "particleEmitters.easing.none", + "linear": "particleEmitters.easing.linear", + "smooth": "particleEmitters.easing.smooth" + }, + "movementType": "particleEmitters.movementType", + "movementTypes": { + "linear": "particleEmitters.movementTypes.linear", + "accelerated": "particleEmitters.movementTypes.accelerated" + }, + "rotateTexture": "particleEmitters.rotateTexture", + "rotationMethod": "particleEmitters.rotationMethod", + "rotationMethods": { + "static": "particleEmitters.rotationMethods.static", + "dynamic": "particleEmitters.rotationMethods.dynamic" + }, + "burstSpacing": "particleEmitters.burstSpacing", + "burstStart": "particleEmitters.burstStart" }, "patreon": { "aboutPatrons": "patreon.aboutPatrons", - "thankAllPatrons": "patreon.thankAllPatrons", "patronsHeader": "patreon.patronsHeader", - "sponsors": "patreon.sponsors", - "noSponsorsYet": "patreon.noSponsorsYet", - "sponsorsDescription": "patreon.sponsorsDescription", - "businessCats": "patreon.businessCats", - "businessCatsDescription": "patreon.businessCatsDescription", - "cats": "patreon.cats", - "catsDescription": "patreon.catsDescription", + "thankAllPatrons": "patreon.thankAllPatrons", "becomeAPatron": "patreon.becomeAPatron", "aboutFillers": [ "patreon.aboutFillers.0", @@ -706,7 +448,197 @@ "patreon.aboutFillers.14", "patreon.aboutFillers.15", "patreon.aboutFillers.16" - ] + ], + "sponsors": "patreon.sponsors", + "noSponsorsYet": "patreon.noSponsorsYet", + "sponsorsDescription": "patreon.sponsorsDescription", + "businessCats": "patreon.businessCats", + "businessCatsDescription": "patreon.businessCatsDescription", + "cats": "patreon.cats", + "catsDescription": "patreon.catsDescription" + }, + "docsPanel": { + "documentation": "docsPanel.documentation", + "reference": "docsPanel.reference" + }, + "settings": { + "actions": { + "heading": "settings.actions.heading", + "actions": "settings.actions.actions", + "addAction": "settings.actions.addAction", + "addMethod": "settings.actions.addMethod", + "deleteAction": "settings.actions.deleteAction", + "deleteMethod": "settings.actions.deleteMethod", + "inputActionNamePlaceholder": "settings.actions.inputActionNamePlaceholder", + "methodModuleMissing": "settings.actions.methodModuleMissing", + "methods": "settings.actions.methods", + "multiplier": "settings.actions.multiplier", + "noActionsYet": "settings.actions.noActionsYet", + "makeFromScratch": "settings.actions.makeFromScratch", + "presets": "settings.actions.presets", + "presetXYMovement": "settings.actions.presetXYMovement", + "presetTouchAndMouse": "settings.actions.presetTouchAndMouse", + "presetCustom": "settings.actions.presetCustom", + "exportActionPreset": "settings.actions.exportActionPreset", + "importErrorMissingModules": "settings.actions.importErrorMissingModules", + "importErrorNotCtJsPreset": "settings.actions.importErrorNotCtJsPreset" + }, + "authoring": { + "heading": "settings.authoring.heading", + "author": "settings.authoring.author", + "site": "settings.authoring.site", + "title": "settings.authoring.title", + "version": "settings.authoring.version", + "versionPostfix": "settings.authoring.versionPostfix", + "appId": "settings.authoring.appId", + "appIdExplanation": "settings.authoring.appIdExplanation" + }, + "branding": { + "heading": "settings.branding.heading", + "accent": "settings.branding.accent", + "accentNotice": "settings.branding.accentNotice", + "icon": "settings.branding.icon", + "iconNotice": "settings.branding.iconNotice", + "invertPreloaderScheme": "settings.branding.invertPreloaderScheme", + "hideLoadingLogo": "settings.branding.hideLoadingLogo", + "splashScreen": "settings.branding.splashScreen", + "splashScreenNotice": "settings.branding.splashScreenNotice", + "forceSmoothIcons": "settings.branding.forceSmoothIcons", + "forceSmoothSplashScreen": "settings.branding.forceSmoothSplashScreen", + "alternativeCtjsLogo": "settings.branding.alternativeCtjsLogo", + "alternativeCtjsNotice": "settings.branding.alternativeCtjsNotice", + "customLoadingText": "settings.branding.customLoadingText", + "customLoadingTextHint": "settings.branding.customLoadingTextHint" + }, + "modules": { + "heading": "settings.modules.heading" + }, + "rendering": { + "heading": "settings.rendering.heading", + "framerate": "settings.rendering.framerate", + "highDensity": "settings.rendering.highDensity", + "maxFPS": "settings.rendering.maxFPS", + "desktopBuilds": "settings.rendering.desktopBuilds", + "launchMode": "settings.rendering.launchMode", + "launchModes": { + "maximized": "settings.rendering.launchModes.maximized", + "fullscreen": "settings.rendering.launchModes.fullscreen", + "windowed": "settings.rendering.launchModes.windowed" + }, + "hideCursor": "settings.rendering.hideCursor", + "pixelatedRender": "settings.rendering.pixelatedRender", + "usePixiLegacy": "settings.rendering.usePixiLegacy", + "useTransparent": "settings.rendering.useTransparent", + "mobileBuilds": "settings.rendering.mobileBuilds", + "screenOrientation": "settings.rendering.screenOrientation", + "screenOrientations": { + "unspecified": "settings.rendering.screenOrientations.unspecified", + "landscape": "settings.rendering.screenOrientations.landscape", + "portrait": "settings.rendering.screenOrientations.portrait" + }, + "viewportMode": "settings.rendering.viewportMode", + "viewportModes": { + "asIs": "settings.rendering.viewportModes.asIs", + "fastScale": "settings.rendering.viewportModes.fastScale", + "fastScaleInteger": "settings.rendering.viewportModes.fastScaleInteger", + "expand": "settings.rendering.viewportModes.expand", + "scaleFit": "settings.rendering.viewportModes.scaleFit", + "scaleFill": "settings.rendering.viewportModes.scaleFill" + }, + "viewportModesDescriptions": { + "asIs": "settings.rendering.viewportModesDescriptions.asIs", + "fastScale": "settings.rendering.viewportModesDescriptions.fastScale", + "fastScaleInteger": "settings.rendering.viewportModesDescriptions.fastScaleInteger", + "expand": "settings.rendering.viewportModesDescriptions.expand", + "scaleFit": "settings.rendering.viewportModesDescriptions.scaleFit", + "scaleFill": "settings.rendering.viewportModesDescriptions.scaleFill" + } + }, + "scripts": { + "heading": "settings.scripts.heading", + "addNew": "settings.scripts.addNew", + "deleteScript": "settings.scripts.deleteScript", + "moveDown": "settings.scripts.moveDown", + "moveUp": "settings.scripts.moveUp", + "newScriptComment": "settings.scripts.newScriptComment" + }, + "catmodsSettings": "settings.catmodsSettings", + "export": { + "heading": "settings.export.heading", + "functionWrap": "settings.export.functionWrap", + "codeModifier": "settings.export.codeModifier", + "obfuscateWarning": "settings.export.obfuscateWarning", + "codeModifierAndWrapNote": "settings.export.codeModifierAndWrapNote", + "codeModifiers": { + "none": "settings.export.codeModifiers.none", + "minify": "settings.export.codeModifiers.minify", + "obfuscate": "settings.export.codeModifiers.obfuscate" + }, + "assetTree": "settings.export.assetTree", + "assetTreeNote": "settings.export.assetTreeNote", + "exportAssetTree": "settings.export.exportAssetTree", + "exportAssetTypes": "settings.export.exportAssetTypes", + "autocloseDesktop": "settings.export.autocloseDesktop" + }, + "content": { + "heading": "settings.content.heading", + "addContentType": "settings.content.addContentType", + "missingTypeName": "settings.content.missingTypeName", + "unnamedContentTypeHint": "settings.content.unnamedContentTypeHint", + "typeName": "settings.content.typeName", + "typeNameHint": "settings.content.typeNameHint", + "typeReadableName": "settings.content.typeReadableName", + "typeReadableNameHint": "settings.content.typeReadableNameHint", + "icon": "settings.content.icon", + "typeSpecification": "settings.content.typeSpecification", + "fieldName": "settings.content.fieldName", + "fieldNameHint": "settings.content.fieldNameHint", + "fieldReadableName": "settings.content.fieldReadableName", + "fieldReadableNameHint": "settings.content.fieldReadableNameHint", + "fieldType": "settings.content.fieldType", + "deleteContentType": "settings.content.deleteContentType", + "confirmDeletionMessage": "settings.content.confirmDeletionMessage", + "gotoEntries": "settings.content.gotoEntries", + "entries": "settings.content.entries", + "array": "settings.content.array", + "fixedLength": "settings.content.fixedLength" + }, + "contentTypes": "settings.contentTypes", + "main": { + "heading": "settings.main.heading", + "miscHeading": "settings.main.miscHeading", + "backups": "settings.main.backups" + } + }, + "extensionsEditor": { + "noEntries": "extensionsEditor.noEntries", + "addRow": "extensionsEditor.addRow", + "actions": "extensionsEditor.actions", + "values": "extensionsEditor.values", + "moveDown": "extensionsEditor.moveDown", + "moveUp": "extensionsEditor.moveUp", + "deleteRow": "extensionsEditor.deleteRow" + }, + "textureGenerator": { + "name": "textureGenerator.name", + "width": "textureGenerator.width", + "height": "textureGenerator.height", + "color": "textureGenerator.color", + "label": "textureGenerator.label", + "optional": "textureGenerator.optional", + "createAndClose": "textureGenerator.createAndClose", + "createAndContinue": "textureGenerator.createAndContinue", + "scalingAtX4": "textureGenerator.scalingAtX4", + "generationSuccessMessage": "textureGenerator.generationSuccessMessage", + "filler": "textureGenerator.filler", + "fillerNone": "textureGenerator.fillerNone", + "fillerCross": "textureGenerator.fillerCross", + "fillerLabel": "textureGenerator.fillerLabel", + "form": "textureGenerator.form", + "formRectangular": "textureGenerator.formRectangular", + "formRound": "textureGenerator.formRound", + "formDiamond": "textureGenerator.formDiamond", + "fillerArrow": "textureGenerator.fillerArrow" }, "textureInput": { "jumpToTexture": "textureInput.jumpToTexture", @@ -733,20 +665,22 @@ "disableAcceleration": "mainMenu.troubleshooting.disableAcceleration", "disableBuiltInDebugger": "mainMenu.troubleshooting.disableBuiltInDebugger", "postAnIssue": "mainMenu.troubleshooting.postAnIssue", - "heading": "mainMenu.troubleshooting.heading" + "heading": "mainMenu.troubleshooting.heading", + "disableVulkan": "mainMenu.troubleshooting.disableVulkan", + "disableVulkanSDHint": "mainMenu.troubleshooting.disableVulkanSDHint", + "restartMessage": "mainMenu.troubleshooting.restartMessage" }, "deploy": { - "heading": "mainMenu.deploy.heading", "exportDesktop": "mainMenu.deploy.exportDesktop", "successZipExport": "mainMenu.deploy.successZipExport", "zipExport": "mainMenu.deploy.zipExport", + "heading": "mainMenu.deploy.heading", "exportAndroid": "mainMenu.deploy.exportAndroid" }, "latestProjects": { "recentProjects": "mainMenu.latestProjects.recentProjects" }, "settings": { - "heading": "mainMenu.settings.heading", "theme": "mainMenu.settings.theme", "themes": { "Day": "mainMenu.settings.themes.Day", @@ -759,9 +693,6 @@ "RosePineMoon": "mainMenu.settings.themes.RosePineMoon", "RosePineDawn": "mainMenu.settings.themes.RosePineDawn" }, - "prideMode": "mainMenu.settings.prideMode", - "language": "mainMenu.settings.language", - "translateToYourLanguage": "mainMenu.settings.translateToYourLanguage", "codeFontDefault": "mainMenu.settings.codeFontDefault", "codeFontOldSchool": "mainMenu.settings.codeFontOldSchool", "codeFontSystem": "mainMenu.settings.codeFontSystem", @@ -770,13 +701,16 @@ "codeFont": "mainMenu.settings.codeFont", "codeLigatures": "mainMenu.settings.codeLigatures", "codeDense": "mainMenu.settings.codeDense", - "altTemplateLayout": "mainMenu.settings.altTemplateLayout", "disableSounds": "mainMenu.settings.disableSounds", "changeDataFolder": "mainMenu.settings.changeDataFolder", - "forceProductionForDebug": "mainMenu.settings.forceProductionForDebug" + "forceProductionForDebug": "mainMenu.settings.forceProductionForDebug", + "heading": "mainMenu.settings.heading", + "language": "mainMenu.settings.language", + "translateToYourLanguage": "mainMenu.settings.translateToYourLanguage", + "prideMode": "mainMenu.settings.prideMode", + "altTemplateLayout": "mainMenu.settings.altTemplateLayout" }, "project": { - "heading": "mainMenu.project.heading", "save": "mainMenu.project.save", "openIncludeFolder": "mainMenu.project.openIncludeFolder", "openProject": "mainMenu.project.openProject", @@ -785,34 +719,29 @@ "startNewWindow": "mainMenu.project.startNewWindow", "successZipProject": "mainMenu.project.successZipProject", "zipProject": "mainMenu.project.zipProject", + "heading": "mainMenu.project.heading", "convertToJs": "mainMenu.project.convertToJs", "confirmationConvertToJs": "mainMenu.project.confirmationConvertToJs" }, "meta": { - "heading": "mainMenu.meta.heading", "license": "mainMenu.meta.license", "visitDiscordForGamedevSupport": "mainMenu.meta.visitDiscordForGamedevSupport", "openIconList": "mainMenu.meta.openIconList", - "openStylebook": "mainMenu.meta.openStylebook", + "heading": "mainMenu.meta.heading", "twitter": "mainMenu.meta.twitter", "vkontakte": "mainMenu.meta.vkontakte", - "ctjsForum": "mainMenu.meta.ctjsForum" + "ctjsForum": "mainMenu.meta.ctjsForum", + "openStylebook": "mainMenu.meta.openStylebook" } }, "appView": { "ctIDE": "appView.ctIDE", "launch": "appView.launch", - "launchHotkeys": "appView.launchHotkeys", "min": "appView.min", + "launchHotkeys": "appView.launchHotkeys", "patrons": "appView.patrons", "restart": "appView.restart", "project": "appView.project", - "assets": "appView.assets", - "applyAssetsQuestion": "appView.applyAssetsQuestion", - "applyAssetsExplanation": "appView.applyAssetsExplanation", - "unsavedAssets": "appView.unsavedAssets", - "runWithoutApplying": "appView.runWithoutApplying", - "applyAndRun": "appView.applyAndRun", "tour": { "header": "appView.tour.header", "aboutTour": "appView.tour.aboutTour", @@ -841,7 +770,33 @@ "tabMainMenuMeta": "appView.tour.tabMainMenuMeta", "helpPanelReminder": "appView.tour.helpPanelReminder", "buttonStartTutorial": "appView.tour.buttonStartTutorial" - } + }, + "assets": "appView.assets", + "applyAssetsQuestion": "appView.applyAssetsQuestion", + "applyAssetsExplanation": "appView.applyAssetsExplanation", + "unsavedAssets": "appView.unsavedAssets", + "runWithoutApplying": "appView.runWithoutApplying", + "applyAndRun": "appView.applyAndRun", + "cantAddEditor": "appView.cantAddEditor" + }, + "assetViewer": { + "root": "assetViewer.root", + "toggleFolderTree": "assetViewer.toggleFolderTree", + "addNewFolder": "assetViewer.addNewFolder", + "newFolderName": "assetViewer.newFolderName", + "unwrapFolder": "assetViewer.unwrapFolder", + "confirmDeleteFolder": "assetViewer.confirmDeleteFolder", + "confirmUnwrapFolder": "assetViewer.confirmUnwrapFolder", + "exportBehavior": "assetViewer.exportBehavior" + }, + "soundRecorder": { + "recorderHeading": "soundRecorder.recorderHeading", + "record": "soundRecorder.record", + "stopRecording": "soundRecorder.stopRecording", + "discardRecording": "soundRecorder.discardRecording", + "finishRecording": "soundRecorder.finishRecording", + "cannotRecordSound": "soundRecorder.cannotRecordSound", + "troubleshootingWindows": "soundRecorder.troubleshootingWindows" }, "roomBackgrounds": { "add": "roomBackgrounds.add", @@ -861,32 +816,22 @@ "hide": "roomTiles.hide", "findTileset": "roomTiles.findTileset", "addTileLayer": "roomTiles.addTileLayer", - "addTileLayerFirst": "roomTiles.addTileLayerFirst" + "addTileLayerFirst": "roomTiles.addTileLayerFirst", + "cacheLayer": "roomTiles.cacheLayer", + "cacheLayerWarning": "roomTiles.cacheLayerWarning" }, "roomView": { "name": "roomView.name", - "viewportHeading": "roomView.viewportHeading", "width": "roomView.width", "height": "roomView.height", - "followTemplate": "roomView.followTemplate", - "followCodeHint": "roomView.followCodeHint", - "isUi": "roomView.isUi", - "simulate": "roomView.simulate", - "grid": "roomView.grid", - "toggleDiagonalGrid": "roomView.toggleDiagonalGrid", - "changeGridSize": "roomView.changeGridSize", "events": "roomView.events", - "gridOff": "roomView.gridOff", - "xrayMode": "roomView.xrayMode", - "colorizeTileLayers": "roomView.colorizeTileLayers", "copies": "roomView.copies", "backgrounds": "roomView.backgrounds", - "backgroundColor": "roomView.backgroundColor", "tiles": "roomView.tiles", - "properties": "roomView.properties", "add": "roomView.add", "none": "roomView.none", "done": "roomView.done", + "grid": "roomView.grid", "hotkeysNotice": "roomView.hotkeysNotice", "hotkeysNoticeMovement": "roomView.hotkeysNoticeMovement", "shift": "roomView.shift", @@ -896,20 +841,20 @@ "draw": "roomView.draw", "deleteCopies": "roomView.deleteCopies", "shiftCopies": "roomView.shiftCopies", - "sortHorizontally": "roomView.sortHorizontally", - "sortVertically": "roomView.sortVertically", "selectAndMove": "roomView.selectAndMove", - "customProperties": "roomView.customProperties", "findTileset": "roomView.findTileset", - "resetView": "roomView.resetView", - "emptyTextFiller": "roomView.emptyTextFiller", + "properties": "roomView.properties", + "isUi": "roomView.isUi", + "backgroundColor": "roomView.backgroundColor", + "sortHorizontally": "roomView.sortHorizontally", + "sortVertically": "roomView.sortVertically", "copyProperties": { "position": "roomView.copyProperties.position", "rotation": "roomView.copyProperties.rotation", "scale": "roomView.copyProperties.scale", + "multipleValues": "roomView.copyProperties.multipleValues", "opacity": "roomView.copyProperties.opacity", - "tint": "roomView.copyProperties.tint", - "multipleValues": "roomView.copyProperties.multipleValues" + "tint": "roomView.copyProperties.tint" }, "copyCustomProperties": { "addProperty": "roomView.copyCustomProperties.addProperty", @@ -917,6 +862,45 @@ "value": "roomView.copyCustomProperties.value", "nameOccupied": "roomView.copyCustomProperties.nameOccupied" }, + "customProperties": "roomView.customProperties", + "restrictCamera": "roomView.restrictCamera", + "minimumX": "roomView.minimumX", + "minimumY": "roomView.minimumY", + "maximumX": "roomView.maximumX", + "maximumY": "roomView.maximumY", + "gridOff": "roomView.gridOff", + "gridSize": "roomView.gridSize", + "toCenter": "roomView.toCenter", + "shiftLabel": "roomView.shiftLabel", + "newDepth": "roomView.newDepth", + "deleteCopy": "roomView.deleteCopy", + "changeCopyScale": "roomView.changeCopyScale", + "shiftCopy": "roomView.shiftCopy", + "deleteTile": "roomView.deleteTile", + "deleteTiles": "roomView.deleteTiles", + "moveTilesToLayer": "roomView.moveTilesToLayer", + "shiftTiles": "roomView.shiftTiles", + "changeCopyRotation": "roomView.changeCopyRotation", + "simulate": "roomView.simulate", + "toggleDiagonalGrid": "roomView.toggleDiagonalGrid", + "changeGridSize": "roomView.changeGridSize", + "xrayMode": "roomView.xrayMode", + "colorizeTileLayers": "roomView.colorizeTileLayers", + "tools": { + "select": "roomView.tools.select", + "addCopies": "roomView.tools.addCopies", + "addTiles": "roomView.tools.addTiles", + "manageBackgrounds": "roomView.tools.manageBackgrounds", + "roomProperties": "roomView.tools.roomProperties", + "uiTools": "roomView.tools.uiTools" + }, + "resetView": "roomView.resetView", + "viewportHeading": "roomView.viewportHeading", + "followTemplate": "roomView.followTemplate", + "followCodeHint": "roomView.followCodeHint", + "sendToBack": "roomView.sendToBack", + "sendToFront": "roomView.sendToFront", + "emptyTextFiller": "roomView.emptyTextFiller", "uiTools": { "noSelectionNotice": "roomView.uiTools.noSelectionNotice", "textSettings": "roomView.uiTools.textSettings", @@ -947,38 +931,14 @@ "disabled": "roomView.uiTools.bindingNames.disabled", "visible": "roomView.uiTools.bindingNames.visible", "tex": "roomView.uiTools.bindingNames.tex", - "tint": "roomView.uiTools.bindingNames.tint" + "tint": "roomView.uiTools.bindingNames.tint", + "count": "roomView.uiTools.bindingNames.count" }, "bindingTypes": { "string": "roomView.uiTools.bindingTypes.string", "boolean": "roomView.uiTools.bindingTypes.boolean", "number": "roomView.uiTools.bindingTypes.number" } - }, - "restrictCamera": "roomView.restrictCamera", - "minimumX": "roomView.minimumX", - "minimumY": "roomView.minimumY", - "maximumX": "roomView.maximumX", - "maximumY": "roomView.maximumY", - "gridSize": "roomView.gridSize", - "toCenter": "roomView.toCenter", - "shiftLabel": "roomView.shiftLabel", - "newDepth": "roomView.newDepth", - "deleteCopy": "roomView.deleteCopy", - "changeCopyScale": "roomView.changeCopyScale", - "shiftCopy": "roomView.shiftCopy", - "deleteTile": "roomView.deleteTile", - "deleteTiles": "roomView.deleteTiles", - "moveTilesToLayer": "roomView.moveTilesToLayer", - "shiftTiles": "roomView.shiftTiles", - "changeCopyRotation": "roomView.changeCopyRotation", - "tools": { - "select": "roomView.tools.select", - "addCopies": "roomView.tools.addCopies", - "addTiles": "roomView.tools.addTiles", - "manageBackgrounds": "roomView.tools.manageBackgrounds", - "uiTools": "roomView.tools.uiTools", - "roomProperties": "roomView.tools.roomProperties" } }, "styleView": { @@ -1016,11 +976,7 @@ "fontSize": "styleView.fontSize" }, "textureView": { - "slicing": "textureView.slicing", - "viewSettings": "textureView.viewSettings", - "exportSettings": "textureView.exportSettings", "center": "textureView.center", - "axisExplanation": "textureView.axisExplanation", "cols": "textureView.cols", "done": "textureView.done", "fill": "textureView.fill", @@ -1034,11 +990,7 @@ "rows": "textureView.rows", "speed": "textureView.speed", "tiled": "textureView.tiled", - "updateFromClipboard": "textureView.updateFromClipboard", "corrupted": "textureView.corrupted", - "showFrameIndices": "textureView.showFrameIndices", - "blankTexture": "textureView.blankTexture", - "blankTextureNotice": "textureView.blankTextureNotice", "width": "textureView.width", "height": "textureView.height", "strip": "textureView.strip", @@ -1050,7 +1002,10 @@ "symmetryTool": "textureView.symmetryTool", "padding": "textureView.padding", "paddingNotice": "textureView.paddingNotice", + "updateFromClipboard": "textureView.updateFromClipboard", "previewAnimationNotice": "textureView.previewAnimationNotice", + "showFrameIndices": "textureView.showFrameIndices", + "blankTexture": "textureView.blankTexture", "pasteCollisionMask": "textureView.pasteCollisionMask", "copyCollisionMask": "textureView.copyCollisionMask", "bgColor": "textureView.bgColor", @@ -1060,22 +1015,12 @@ "marginX": "textureView.marginX", "marginY": "textureView.marginY", "offX": "textureView.offX", - "offY": "textureView.offY" - }, - "soundView": { - "variants": "soundView.variants", - "addVariant": "soundView.addVariant", - "preload": "soundView.preload", - "volume": "soundView.volume", - "pitch": "soundView.pitch", - "distortion": "soundView.distortion", - "effects": "soundView.effects", - "reverb": "soundView.reverb", - "reverbDuration": "soundView.reverbDuration", - "reverbDecay": "soundView.reverbDecay", - "reverseReverb": "soundView.reverseReverb", - "equalizer": "soundView.equalizer", - "hertz": "soundView.hertz" + "offY": "textureView.offY", + "blankTextureNotice": "textureView.blankTextureNotice", + "slicing": "textureView.slicing", + "viewSettings": "textureView.viewSettings", + "exportSettings": "textureView.exportSettings", + "axisExplanation": "textureView.axisExplanation" }, "fontView": { "italic": "fontView.italic", @@ -1114,6 +1059,82 @@ "attributionAAssets": "licensePanel.attributionAAssets", "theLicense": "licensePanel.theLicense" }, + "templates": { + "create": "templates.create" + }, + "templateView": { + "change": "templateView.change", + "depth": "templateView.depth", + "learnAboutTypes": "templateView.learnAboutTypes", + "name": "templateView.name", + "visible": "templateView.visible", + "appearance": "templateView.appearance", + "opacity": "templateView.opacity", + "blendMode": "templateView.blendMode", + "playAnimationOnStart": "templateView.playAnimationOnStart", + "blendModes": { + "normal": "templateView.blendModes.normal", + "add": "templateView.blendModes.add", + "multiply": "templateView.blendModes.multiply", + "screen": "templateView.blendModes.screen" + }, + "animationFPS": "templateView.animationFPS", + "loopAnimation": "templateView.loopAnimation", + "hoverTexture": "templateView.hoverTexture", + "pressedTexture": "templateView.pressedTexture", + "disabledTexture": "templateView.disabledTexture", + "defaultText": "templateView.defaultText", + "textStyle": "templateView.textStyle", + "fieldType": "templateView.fieldType", + "fieldTypes": { + "text": "templateView.fieldTypes.text", + "number": "templateView.fieldTypes.number", + "email": "templateView.fieldTypes.email", + "password": "templateView.fieldTypes.password" + }, + "useCustomSelectionColor": "templateView.useCustomSelectionColor", + "maxLength": "templateView.maxLength", + "baseClass": { + "AnimatedSprite": "templateView.baseClass.AnimatedSprite", + "Text": "templateView.baseClass.Text", + "NineSlicePlane": "templateView.baseClass.NineSlicePlane", + "Container": "templateView.baseClass.Container", + "Button": "templateView.baseClass.Button", + "RepeatingTexture": "templateView.baseClass.RepeatingTexture", + "SpritedCounter": "templateView.baseClass.SpritedCounter", + "TextBox": "templateView.baseClass.TextBox" + }, + "nineSliceTop": "templateView.nineSliceTop", + "nineSliceRight": "templateView.nineSliceRight", + "nineSliceBottom": "templateView.nineSliceBottom", + "nineSliceLeft": "templateView.nineSliceLeft", + "autoUpdateNineSlice": "templateView.autoUpdateNineSlice", + "autoUpdateNineSliceHint": "templateView.autoUpdateNineSliceHint", + "panelHeading": "templateView.panelHeading", + "scrollSpeedX": "templateView.scrollSpeedX", + "scrollSpeedY": "templateView.scrollSpeedY", + "isUi": "templateView.isUi", + "defaultCount": "templateView.defaultCount" + }, + "assetInput": { + "changeAsset": "assetInput.changeAsset", + "jumpToAsset": "assetInput.jumpToAsset", + "selectAssetHeader": "assetInput.selectAssetHeader" + }, + "builtinAssetGallery": { + "galleryTip": "builtinAssetGallery.galleryTip", + "assetGalleryHeader": "builtinAssetGallery.assetGalleryHeader", + "importIntoProject": "builtinAssetGallery.importIntoProject", + "importAll": "builtinAssetGallery.importAll", + "byAuthorPrefix": "builtinAssetGallery.byAuthorPrefix", + "cannotImportExplanation": "builtinAssetGallery.cannotImportExplanation", + "nameOccupied": "builtinAssetGallery.nameOccupied", + "cannotImportNameOccupied": "builtinAssetGallery.cannotImportNameOccupied", + "visitSource": "builtinAssetGallery.visitSource", + "visitAuthorsItch": "builtinAssetGallery.visitAuthorsItch", + "visitAuthorsTwitter": "builtinAssetGallery.visitAuthorsTwitter", + "tipAuthor": "builtinAssetGallery.tipAuthor" + }, "scriptables": { "addEvent": "scriptables.addEvent", "removeEvent": "scriptables.removeEvent", @@ -1122,17 +1143,15 @@ "eventAlreadyExists": "scriptables.eventAlreadyExists", "localEventVars": "scriptables.localEventVars", "createEventHint": "scriptables.createEventHint", - "jumpToProblem": "scriptables.jumpToProblem", - "staticEventWarning": "scriptables.staticEventWarning", - "restrictedEventWarning": "scriptables.restrictedEventWarning", - "baseClassWarning": "scriptables.baseClassWarning", "coreEventsCategories": { "lifecycle": "scriptables.coreEventsCategories.lifecycle", "actions": "scriptables.coreEventsCategories.actions", "pointer": "scriptables.coreEventsCategories.pointer", "misc": "scriptables.coreEventsCategories.misc", "animation": "scriptables.coreEventsCategories.animation", - "timers": "scriptables.coreEventsCategories.timers" + "timers": "scriptables.coreEventsCategories.timers", + "input": "scriptables.coreEventsCategories.input", + "app": "scriptables.coreEventsCategories.app" }, "coreEvents": { "OnCreate": "scriptables.coreEvents.OnCreate", @@ -1155,7 +1174,11 @@ "OnFrameChange": "scriptables.coreEvents.OnFrameChange", "OnAnimationLoop": "scriptables.coreEvents.OnAnimationLoop", "OnAnimationComplete": "scriptables.coreEvents.OnAnimationComplete", - "Timer": "scriptables.coreEvents.Timer" + "Timer": "scriptables.coreEvents.Timer", + "OnAppFocus": "scriptables.coreEvents.OnAppFocus", + "OnAppBlur": "scriptables.coreEvents.OnAppBlur", + "OnTextChange": "scriptables.coreEvents.OnTextChange", + "OnTextInput": "scriptables.coreEvents.OnTextInput" }, "coreParameterizedNames": { "OnActionPress": "scriptables.coreParameterizedNames.OnActionPress", @@ -1175,7 +1198,9 @@ }, "coreEventsLocals": { "OnActionDown_value": "scriptables.coreEventsLocals.OnActionDown_value", - "OnActionPress_value": "scriptables.coreEventsLocals.OnActionPress_value" + "OnActionPress_value": "scriptables.coreEventsLocals.OnActionPress_value", + "OnTextChange_value": "scriptables.coreEventsLocals.OnTextChange_value", + "OnTextInput_value": "scriptables.coreEventsLocals.OnTextInput_value" }, "coreEventsDescriptions": { "OnCreate": "scriptables.coreEventsDescriptions.OnCreate", @@ -1189,49 +1214,91 @@ "OnActionDown": "scriptables.coreEventsDescriptions.OnActionDown", "OnAnimationLoop": "scriptables.coreEventsDescriptions.OnAnimationLoop", "OnAnimationComplete": "scriptables.coreEventsDescriptions.OnAnimationComplete", - "Timer": "scriptables.coreEventsDescriptions.Timer" - } + "Timer": "scriptables.coreEventsDescriptions.Timer", + "OnAppFocus": "scriptables.coreEventsDescriptions.OnAppFocus", + "OnAppBlur": "scriptables.coreEventsDescriptions.OnAppBlur", + "OnTextChange": "scriptables.coreEventsDescriptions.OnTextChange", + "OnTextInput": "scriptables.coreEventsDescriptions.OnTextInput" + }, + "jumpToProblem": "scriptables.jumpToProblem", + "staticEventWarning": "scriptables.staticEventWarning", + "restrictedEventWarning": "scriptables.restrictedEventWarning", + "baseClassWarning": "scriptables.baseClassWarning" }, - "templates": { - "create": "templates.create" + "assetConfirm": { + "confirmHeading": "assetConfirm.confirmHeading", + "confirmParagraph": "assetConfirm.confirmParagraph" }, - "templateView": { - "change": "templateView.change", - "hoverTexture": "templateView.hoverTexture", - "pressedTexture": "templateView.pressedTexture", - "disabledTexture": "templateView.disabledTexture", - "defaultText": "templateView.defaultText", - "textStyle": "templateView.textStyle", - "learnAboutTypes": "templateView.learnAboutTypes", - "name": "templateView.name", - "appearance": "templateView.appearance", - "visible": "templateView.visible", - "depth": "templateView.depth", - "opacity": "templateView.opacity", - "blendMode": "templateView.blendMode", - "animationFPS": "templateView.animationFPS", - "playAnimationOnStart": "templateView.playAnimationOnStart", - "loopAnimation": "templateView.loopAnimation", - "blendModes": { - "normal": "templateView.blendModes.normal", - "add": "templateView.blendModes.add", - "multiply": "templateView.blendModes.multiply", - "screen": "templateView.blendModes.screen" - }, - "baseClass": { - "AnimatedSprite": "templateView.baseClass.AnimatedSprite", - "Text": "templateView.baseClass.Text", - "NineSlicePlane": "templateView.baseClass.NineSlicePlane", - "Container": "templateView.baseClass.Container", - "Button": "templateView.baseClass.Button", - "TextBox": "templateView.baseClass.TextBox" + "behaviorEditor": { + "customFields": "behaviorEditor.customFields", + "customFieldsDescription": "behaviorEditor.customFieldsDescription" + }, + "createAsset": { + "newAsset": "createAsset.newAsset", + "placeholderTexture": "createAsset.placeholderTexture", + "assetGallery": "createAsset.assetGallery", + "behaviorTemplate": "createAsset.behaviorTemplate", + "behaviorRoom": "createAsset.behaviorRoom", + "behaviorImport": "createAsset.behaviorImport", + "behaviorMissingCatmods": "createAsset.behaviorMissingCatmods", + "formatError": "createAsset.formatError" + }, + "exporterError": { + "exporterErrorHeader": "exporterError.exporterErrorHeader", + "errorSource": "exporterError.errorSource", + "clueSolutions": { + "syntax": "exporterError.clueSolutions.syntax", + "eventConfiguration": "exporterError.clueSolutions.eventConfiguration", + "emptySound": "exporterError.clueSolutions.emptySound", + "emptyEmitter": "exporterError.clueSolutions.emptyEmitter", + "windowsFileLock": "exporterError.clueSolutions.windowsFileLock", + "noTemplateTexture": "exporterError.clueSolutions.noTemplateTexture" }, - "nineSliceTop": "templateView.nineSliceTop", - "nineSliceRight": "templateView.nineSliceRight", - "nineSliceBottom": "templateView.nineSliceBottom", - "nineSliceLeft": "templateView.nineSliceLeft", - "autoUpdateNineSlice": "templateView.autoUpdateNineSlice", - "autoUpdateNineSliceHint": "templateView.autoUpdateNineSliceHint", - "panelHeading": "templateView.panelHeading" + "stacktrace": "exporterError.stacktrace", + "jumpToProblem": "exporterError.jumpToProblem", + "saveAndQuit": "exporterError.saveAndQuit" + }, + "folderEditor": { + "title": "folderEditor.title", + "icon": "folderEditor.icon", + "color": "folderEditor.color" + }, + "languageSelector": { + "chooseLanguageHeader": "languageSelector.chooseLanguageHeader", + "chooseLanguageExplanation": "languageSelector.chooseLanguageExplanation", + "coffeeScriptDescription": "languageSelector.coffeeScriptDescription", + "pickCoffeeScript": "languageSelector.pickCoffeeScript", + "jsAndTs": "languageSelector.jsAndTs", + "jsTsDescription": "languageSelector.jsTsDescription", + "pickJsTs": "languageSelector.pickJsTs", + "acceptAndSpecifyDirectory": "languageSelector.acceptAndSpecifyDirectory" + }, + "newAssetPrompt": { + "heading": "newAssetPrompt.heading", + "selectNewName": "newAssetPrompt.selectNewName" + }, + "scriptView": { + "runAutomatically": "scriptView.runAutomatically", + "language": "scriptView.language", + "convertToJavaScript": "scriptView.convertToJavaScript" + }, + "soundView": { + "variants": "soundView.variants", + "addVariant": "soundView.addVariant", + "preload": "soundView.preload", + "volume": "soundView.volume", + "pitch": "soundView.pitch", + "distortion": "soundView.distortion", + "effects": "soundView.effects", + "reverb": "soundView.reverb", + "reverbDuration": "soundView.reverbDuration", + "reverbDecay": "soundView.reverbDecay", + "reverseReverb": "soundView.reverseReverb", + "equalizer": "soundView.equalizer", + "hertz": "soundView.hertz", + "positionalAudio": "soundView.positionalAudio", + "falloff": "soundView.falloff", + "refDistance": "soundView.refDistance", + "positionalAudioHint": "soundView.positionalAudioHint" } -} +} \ No newline at end of file diff --git a/app/data/i18n/English.json b/app/data/i18n/English.json index a2477e6d4..53498014c 100644 --- a/app/data/i18n/English.json +++ b/app/data/i18n/English.json @@ -757,7 +757,7 @@ "disableBuiltInDebugger": "Disable built-in debugger", "postAnIssue": "Post an issue on Github…", "disableVulkan": "Disable Vulkan support", - "disableVulkanSDHint": "Fixes \"no WebGL support\" issues on SteamDeck. Requires a restart to take effect.", + "disableVulkanSDHint": "Fixes \"no WebGL support\" issues on SteamDeck and some other Linux systems. Requires a restart to take effect.", "restartMessage": "Please restart the app to apply the changes." }, "deploy": { @@ -1301,4 +1301,4 @@ "isUi": "Use UI time", "defaultCount": "Default sprite count:" } -} +} \ No newline at end of file diff --git a/app/data/i18n/Russian.json b/app/data/i18n/Russian.json index 9b40e92a4..fdc4dfcdd 100644 --- a/app/data/i18n/Russian.json +++ b/app/data/i18n/Russian.json @@ -204,7 +204,8 @@ "eventConfiguration": "Одно из событий было неправильно сконфигурировано и у него есть пустые поля. Зайди в ассет и отредактируй параметры события.", "emptySound": "В одном из звуковых ассетов не было прикреплено никаких звуковых файлов. Зайди в него и добавь звук, или удали ассет.", "emptyEmitter": "В одной из систем частиц есть эмиттер без текстуры. Тебе нужно либо поставить текстуру, либо удалить этот эмиттер.", - "windowsFileLock": "Это проблема Windows с блокировкой файлов. Закрой все внешние браузеры, что запускали эту игру, и попробуй ещё. Если это не поможет, перезапусти ct.js." + "windowsFileLock": "Это проблема Windows с блокировкой файлов. Закрой все внешние браузеры, что запускали эту игру, и попробуй ещё. Если это не поможет, перезапусти ct.js.", + "noTemplateTexture": "В одном из твоих шаблонов не указана текстура. Тебе нужно указать текстуру для него." }, "stacktrace": "Стек вызова", "jumpToProblem": "Перейти к проблеме", @@ -404,7 +405,12 @@ "array": "Массив", "fixedLength": "Фиксированный размер" }, - "contentTypes": "Типы контента" + "contentTypes": "Типы контента", + "main": { + "heading": "Основные настройки", + "miscHeading": "Другие настройки", + "backups": "Хранить следующее количество бэкап-файлов:" + } }, "modules": { "author": "Автор котомода", @@ -674,7 +680,10 @@ "disableAcceleration": "Отключить графическое ускорение (требует перезапуск)", "disableBuiltInDebugger": "Выключить встроенный отладчик игр", "postAnIssue": "Зайти на GitHub", - "heading": "В случае неполадок" + "heading": "В случае неполадок", + "disableVulkan": "Выключить поддержку Vulkan", + "disableVulkanSDHint": "Исправляет ошибку \"no WebGL support\" на SteamDeck и некоторых других системах Linux. После изменения нужно будет перезапустить ct.js.", + "restartMessage": "Перезапусти ct.js, чтобы применить изменения." }, "deploy": { "exportDesktop": "Экспортировать для ПК", @@ -822,7 +831,9 @@ "hide": "Спрятать слой", "findTileset": "Найти тайлсет", "addTileLayer": "Добавить слой тайлов", - "addTileLayerFirst": "Сначала добавь слой тайлов в левой панели!" + "addTileLayerFirst": "Сначала добавь слой тайлов в левой панели!", + "cacheLayer": "Кэшировать этот слой", + "cacheLayerWarning": "Кеширование серьёзно ускоряет отрисовку слоёв тайлов. Эту опцию следует отключать только в том случае, если ты собираешься менять этот слой тайлов программно в ходе игры." }, "roomView": { "name": "Имя:", @@ -933,14 +944,17 @@ "disabled": "Отключить:", "visible": "Видимость:", "tex": "Текстура:", - "tint": "Цвет:" + "tint": "Цвет:", + "count": "Количество спрайтов:" }, "bindingTypes": { "string": "Строковое значение", "boolean": "Булево значение (true или false)", "number": "Число" } - } + }, + "sendToBack": "На задний план", + "sendToFront": "На передний план" }, "styleView": { "active": "Активно?", @@ -1091,7 +1105,10 @@ "Text": "Текст", "NineSlicePlane": "Панель", "Container": "Контейнер", - "Button": "Кнопка" + "Button": "Кнопка", + "RepeatingTexture": "Повторяющаяся текстура", + "SpritedCounter": "Спрайтовый счётчик", + "TextBox": "Поле ввода" }, "nineSliceTop": "Верхний срез, в пикселях", "nineSliceRight": "Правый срез, в пикселях", @@ -1099,7 +1116,20 @@ "nineSliceLeft": "Правый срез, в пикселях", "autoUpdateNineSlice": "Автоматически обновлять маску коллизии", "autoUpdateNineSliceHint": "Если панель поменяет свой размер, эта настройка автоматом обновит её маску коллизии. Обычно это не нужно на чисто декоративных элементах, или на тех, что никогда не поменяют свой размер после создания. Ты всё равно можешь обновить маску столкновений в любой момент с помощью команды u.reshapeNinePatch(this).", - "panelHeading": "Настройки раскройки текстуры" + "panelHeading": "Настройки раскройки текстуры", + "fieldType": "Тип поля:", + "fieldTypes": { + "text": "Текст", + "number": "Число", + "email": "Адрес эл. почты", + "password": "Пароль" + }, + "useCustomSelectionColor": "Использовать другой цвет для выделенного текста", + "maxLength": "Максимальная длина:", + "scrollSpeedX": "Скорость прокрутки по X:", + "scrollSpeedY": "Скорость прокрутки по Y:", + "isUi": "Использовать UI время", + "defaultCount": "Кол-во спрайтов по умолчанию:" }, "assetInput": { "changeAsset": "Нажмите, чтобы заменить ассет", @@ -1135,7 +1165,8 @@ "misc": "Разное", "animation": "Анимация", "timers": "Таймеры", - "app": "Приложение" + "app": "Приложение", + "input": " Ввод" }, "coreEvents": { "OnCreate": "Создание", @@ -1160,7 +1191,9 @@ "OnAnimationComplete": "Конец анимации", "Timer": "Таймер $1", "OnAppFocus": "Приложение активно", - "OnAppBlur": "Приложение в фоне" + "OnAppBlur": "Приложение в фоне", + "OnTextChange": "Когда сменился текст", + "OnTextInput": "Когда вводят текст" }, "coreParameterizedNames": { "OnActionPress": "При нажатии %%action%%", @@ -1180,7 +1213,9 @@ }, "coreEventsLocals": { "OnActionDown_value": "Текущее значение действия", - "OnActionPress_value": "Текущее значение Действия" + "OnActionPress_value": "Текущее значение Действия", + "OnTextChange_value": "Новый текст", + "OnTextInput_value": "Новый текст" }, "coreEventsDescriptions": { "OnCreate": "Срабатывает при создании копии.", @@ -1196,7 +1231,9 @@ "OnAnimationComplete": "Срабатывает один раз, когда нецикличная анимация заканчивается.", "Timer": "Взведи таймер командой this.timer$1 = 3; (напр. 3 — это три секунды)", "OnAppFocus": "Срабатывает, когда пользователь возвращается к твоему приложению.", - "OnAppBlur": "Срабатывает, когда пользователь переключается с твоей игры на что-то другое — переходя по вкладкам, переключаясь между окнами, или сворачивая игру." + "OnAppBlur": "Срабатывает, когда пользователь переключается с твоей игры на что-то другое — переходя по вкладкам, переключаясь между окнами, или сворачивая игру.", + "OnTextChange": "Срабатывает, когда пользователь заканчивает редактирование нажатием вне поля или кнопкой Enter.", + "OnTextInput": "Срабатывает каждый раз, когда пользователь меняет текст в этом поле." }, "jumpToProblem": "Перейти к проблеме", "staticEventWarning": "Это событие делает это поведение статичным. Ты не сможешь добавлять его в игре динамически через API поведений, но в остальном оно прекрасно работает.", @@ -1264,4 +1301,4 @@ "language": "Язык:", "convertToJavaScript": "Конвертировать в JavaScript" } -} +} \ No newline at end of file diff --git a/app/package-lock.json b/app/package-lock.json index 06f9a2f36..f8ec9c72a 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -1,12 +1,12 @@ { "name": "ctjs", - "version": "4.0.0", + "version": "4.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ctjs", - "version": "4.0.0", + "version": "4.0.1", "license": "MIT", "dependencies": { "@capacitor/cli": "^5.5.0", diff --git a/app/package.json b/app/package.json index 0de3d442e..a84bfb089 100644 --- a/app/package.json +++ b/app/package.json @@ -2,7 +2,7 @@ "main": "index.html", "name": "ctjs", "description": "ct.js — a free 2D game engine", - "version": "4.0.0", + "version": "4.0.1", "homepage": "https://ctjs.rocks/", "author": { "name": "Cosmo Myzrail Gorynych", diff --git a/docs b/docs index 038a69b31..0db0da893 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 038a69b31d986a2cfc10b453e19254204c00d282 +Subproject commit 0db0da89356937f0546277d09f4557b6cca2c39c diff --git a/lint.txt b/lint.txt deleted file mode 100644 index af8406f25..000000000 --- a/lint.txt +++ /dev/null @@ -1,1554 +0,0 @@ -[19:13:16] Using gulpfile D:\ctjs\gulpfile.js -[19:13:16] Starting 'lint'... -[19:13:16] Starting 'lintJS'... -[19:13:21] -D:\ctjs\src\node_requires\platformUtils.js - 50:22 warning Unexpected use of process.env no-process-env - 50:44 warning Unexpected use of process.env no-process-env - 50:75 warning Unexpected use of process.env no-process-env - -D:\ctjs\src\node_requires\resources\skeletons.js - 76:62 warning 'group' is defined but never used @typescript-eslint/no-unused-vars - -D:\ctjs\app\data\ct.release\camera.js - 61:7 warning 'Camera' is assigned a value but never used @typescript-eslint/no-unused-vars - -✖ 5 problems (0 errors, 5 warnings) - -[19:13:21] Finished 'lintJS' after 4.9 s -[19:13:21] Starting 'lintTags'... -[19:13:25] Finished 'lintTags' after 3.47 s -[19:13:25] Starting 'lintStylus'... -[19:13:25] Finished 'lintStylus' after 420 ms -[19:13:25] Starting 'lintI18n'... - -Translation report: -=================== - -Translation file Brazilian Portuguese.json ------------------------------------------- -Coverage: 75% 😕 A decent coverage, but it could be better! -Not translated: 112 - common.close - common.couldNotLoadFromClipboard - common.edit - common.nothingToShowFiller - common.pastedFromClipboard - common.required - common.settings - common.fieldTypes - copyCustomProperties - assetViewer - extensionsEditor.noEntries - extensionsEditor.addRow - groupEditor - intro.cloneProject - intro.examples - intro.github - intro.itch - intro.vkontakte - intro.patreon - intro.createOrBrowseJunction - settings.actions.makeFromScratch - settings.actions.presets - settings.actions.presetXYMovement - settings.actions.presetTouchAndMouse - settings.actions.presetCustom - settings.actions.exportActionPreset - settings.actions.importErrorMissingModules - settings.actions.importErrorNotCtJsPreset - settings.branding.hideLoadingLogo - settings.content - settings.rendering.hideCursor - settings.export.heading - settings.export.functionWrap - settings.export.codeModifier - settings.export.obfuscateWarning - settings.export.codeModifierAndWrapNote - settings.export.codeModifiers.none - settings.export.codeModifiers.minify - settings.export.codeModifiers.obfuscate - settings.contentTypes - modules.preview - modules.previewTooltip - modules.deprecatedTooltip - texture.importFromClipboard - texture.generatePlaceholder - textureGenerator.name - textureGenerator.width - textureGenerator.height - textureGenerator.color - textureGenerator.label - textureGenerator.optional - textureGenerator.createAndClose - textureGenerator.createAndContinue - textureGenerator.scalingAtX4 - textureGenerator.generationSuccessMessage - textureGenerator.form - textureGenerator.formRectangular - textureGenerator.formRound - textureGenerator.formDiamond - textureGenerator.filler - textureGenerator.fillerNone - textureGenerator.fillerCross - textureGenerator.fillerArrow - textureGenerator.fillerLabel - textureview.updateFromClipboard - textureview.showFrameIndices - textureview.previewAnimationNotice - textureview.pasteCollisionMask - textureview.copyCollisionMask - sounds.record - soundRecorder - styleview.code - styleview.copyCode - types - typeview.visible - roombackgrounds.notBackgroundTextureWarning - roombackgrounds.fixBackground - roombackgrounds.dismissWarning - roomview.isUi - roomview.backgroundColor - roomview.sortHorizontally - roomview.sortVertically - roomview.customProperties - roomview.copyProperties.position - roomview.copyProperties.rotation - roomview.copyProperties.scale - roomview.restrictCamera - roomview.minimumX - roomview.minimumY - roomview.maximumX - roomview.maximumY - textureInput.jumpToTexture - textureInput.changeTexture - writableFolderPrompt.headerSelectFolderForData - writableFolderPrompt.paragraphCouldNotPickDirectory - writableFolderPrompt.paragraphDirectoryDirections - writableFolderPrompt.selectFolder - writableFolderSelector.folderDoesNotExist - writableFolderSelector.notADirectory - writableFolderSelector.folderNotWritable - writableFolderSelector.complete - mainMenu.deploy.heading - mainMenu.settings.themes.Horizon - mainMenu.settings.themes.HCBlack - mainMenu.settings.changeDataFolder - mainMenu.settings.forceProductionForDebug - mainMenu.project.heading - mainMenu.meta.heading - mainMenu.meta.openIconList - mainMenu.meta.twitter - mainMenu.meta.vkontakte - mainMenu.meta.ctjsForum -Excess: 0 ✅ - - -Translation file Chinese Simplified.json ----------------------------------------- -Coverage: 85% ✅ Good! -Not translated: 45 - common.edit - common.nothingToShowFiller - common.required - common.settings - common.fieldTypes - copyCustomProperties - assetViewer - groupEditor - intro.cloneProject - intro.github - intro.itch - intro.vkontakte - intro.patreon - settings.actions.makeFromScratch - settings.actions.presets - settings.actions.presetXYMovement - settings.actions.presetTouchAndMouse - settings.actions.presetCustom - settings.actions.exportActionPreset - settings.actions.importErrorMissingModules - settings.actions.importErrorNotCtJsPreset - settings.branding.hideLoadingLogo - settings.content - settings.contentTypes - textureGenerator.form - textureGenerator.formRectangular - textureGenerator.formRound - textureGenerator.formDiamond - textureGenerator.fillerArrow - textureview.showFrameIndices - textureview.pasteCollisionMask - textureview.copyCollisionMask - sounds.record - soundRecorder - styleview.code - styleview.copyCode - roomview.customProperties - roomview.restrictCamera - roomview.minimumX - roomview.minimumY - roomview.maximumX - roomview.maximumY - mainMenu.meta.twitter - mainMenu.meta.vkontakte - mainMenu.meta.ctjsForum -Excess: 0 ✅ - - -Translation file Dutch.json ---------------------------- -Coverage: 67% 👎 Meh -Not translated: 164 - common.clear - common.close - common.couldNotLoadFromClipboard - common.edit - common.filter - common.nothingToShowFiller - common.pastedFromClipboard - common.required - common.selectDialogue - common.search - common.settings - common.fieldTypes - copyCustomProperties - assetViewer - docsPanel.documentation - docsPanel.reference - extensionsEditor.noEntries - extensionsEditor.addRow - groupEditor - intro.cloneProject - intro.examples - intro.github - intro.itch - intro.vkontakte - intro.patreon - intro.createOrBrowseJunction - onboarding.openJettyCatTutorial - settings.actions.makeFromScratch - settings.actions.presets - settings.actions.presetXYMovement - settings.actions.presetTouchAndMouse - settings.actions.presetCustom - settings.actions.exportActionPreset - settings.actions.importErrorMissingModules - settings.actions.importErrorNotCtJsPreset - settings.branding.hideLoadingLogo - settings.content - settings.modules.heading - settings.rendering.hideCursor - settings.rendering.desktopBuilds - settings.scripts.moveDown - settings.scripts.moveUp - settings.export.heading - settings.export.functionWrap - settings.export.codeModifier - settings.export.obfuscateWarning - settings.export.codeModifierAndWrapNote - settings.export.codeModifiers.none - settings.export.codeModifiers.minify - settings.export.codeModifiers.obfuscate - settings.catmodsSettings - settings.contentTypes - modules.enabledModules - modules.availableModules - modules.filter - modules.preview - modules.previewTooltip - modules.deprecatedTooltip - modules.categories.customization - modules.categories.utilities - modules.categories.media - modules.categories.misc - modules.categories.desktop - modules.categories.motionPlanning - modules.categories.inputs - modules.categories.fx - modules.categories.mobile - modules.categories.integrations - modules.categories.tweaks - modules.categories.networking - texture.createType - texture.importFromClipboard - texture.generatePlaceholder - textureGenerator.name - textureGenerator.width - textureGenerator.height - textureGenerator.color - textureGenerator.label - textureGenerator.optional - textureGenerator.createAndClose - textureGenerator.createAndContinue - textureGenerator.scalingAtX4 - textureGenerator.generationSuccessMessage - textureGenerator.form - textureGenerator.formRectangular - textureGenerator.formRound - textureGenerator.formDiamond - textureGenerator.filler - textureGenerator.fillerNone - textureGenerator.fillerCross - textureGenerator.fillerArrow - textureGenerator.fillerLabel - textureview.updateFromClipboard - textureview.showFrameIndices - textureview.previewAnimationNotice - textureview.pasteCollisionMask - textureview.copyCollisionMask - sounds.record - soundRecorder - styleview.useCustomFont - styleview.code - styleview.copyCode - fontview.generateBitmapFont - fontview.bitmapFont - fontview.bitmapFontSize - fontview.bitmapFontLineHeight - fontview.resultingBitmapFontName - fontview.charset - fontview.charsets.punctuation - fontview.charsets.basicLatin - fontview.charsets.latinExtended - fontview.charsets.cyrillic - fontview.charsets.greekCoptic - fontview.charsets.custom - fontview.charsets.allInFont - fontview.customCharsetHint - typeview.visible - roombackgrounds.notBackgroundTextureWarning - roombackgrounds.fixBackground - roombackgrounds.dismissWarning - roomview.isUi - roomview.backgroundColor - roomview.properties - roomview.sortHorizontally - roomview.sortVertically - roomview.changecopyrotation - roomview.customProperties - roomview.copyProperties.position - roomview.copyProperties.rotation - roomview.copyProperties.scale - roomview.restrictCamera - roomview.minimumX - roomview.minimumY - roomview.maximumX - roomview.maximumY - notepad.modulespages - textureInput.jumpToTexture - textureInput.changeTexture - writableFolderPrompt.headerSelectFolderForData - writableFolderPrompt.paragraphCouldNotPickDirectory - writableFolderPrompt.paragraphDirectoryDirections - writableFolderPrompt.selectFolder - writableFolderSelector.folderDoesNotExist - writableFolderSelector.notADirectory - writableFolderSelector.folderNotWritable - writableFolderSelector.complete - mainMenu.deploy.heading - mainMenu.settings.themes.SpringStream - mainMenu.settings.themes.LucasDracula - mainMenu.settings.themes.Horizon - mainMenu.settings.themes.HCBlack - mainMenu.settings.disableSounds - mainMenu.settings.changeDataFolder - mainMenu.settings.forceProductionForDebug - mainMenu.project.heading - mainMenu.project.openProject - mainMenu.project.openExample - mainMenu.meta.heading - mainMenu.meta.openIconList - mainMenu.meta.twitter - mainMenu.meta.vkontakte - mainMenu.meta.ctjsForum - appView.restart - appView.project -Excess: 0 ✅ - - -Translation file French.json ----------------------------- -Coverage: 64% 👎 Meh -Not translated: 178 - common.clear - common.close - common.couldNotLoadFromClipboard - common.edit - common.filter - common.nothingToShowFiller - common.pastedFromClipboard - common.required - common.selectDialogue - common.search - common.settings - common.fieldTypes - copyCustomProperties - assetViewer - docsPanel.documentation - docsPanel.reference - exportPanel.cannotBuildForMacOnWin - extensionsEditor.noEntries - extensionsEditor.addRow - groupEditor - intro.cloneProject - intro.examples - intro.github - intro.itch - intro.vkontakte - intro.patreon - intro.createOrBrowseJunction - onboarding.openJettyCatTutorial - settings.actions.makeFromScratch - settings.actions.presets - settings.actions.presetXYMovement - settings.actions.presetTouchAndMouse - settings.actions.presetCustom - settings.actions.exportActionPreset - settings.actions.importErrorMissingModules - settings.actions.importErrorNotCtJsPreset - settings.branding.hideLoadingLogo - settings.content - settings.modules.heading - settings.rendering.hideCursor - settings.rendering.desktopBuilds - settings.export.heading - settings.export.functionWrap - settings.export.codeModifier - settings.export.obfuscateWarning - settings.export.codeModifierAndWrapNote - settings.export.codeModifiers.none - settings.export.codeModifiers.minify - settings.export.codeModifiers.obfuscate - settings.catmodsSettings - settings.contentTypes - modules.dependencies - modules.optionalDependencies - modules.enabledModules - modules.availableModules - modules.filter - modules.preview - modules.previewTooltip - modules.deprecatedTooltip - modules.categories.customization - modules.categories.utilities - modules.categories.media - modules.categories.misc - modules.categories.desktop - modules.categories.motionPlanning - modules.categories.inputs - modules.categories.fx - modules.categories.mobile - modules.categories.integrations - modules.categories.tweaks - modules.categories.networking - texture.createType - texture.importFromClipboard - texture.generatePlaceholder - textureGenerator.name - textureGenerator.width - textureGenerator.height - textureGenerator.color - textureGenerator.label - textureGenerator.optional - textureGenerator.createAndClose - textureGenerator.createAndContinue - textureGenerator.scalingAtX4 - textureGenerator.generationSuccessMessage - textureGenerator.form - textureGenerator.formRectangular - textureGenerator.formRound - textureGenerator.formDiamond - textureGenerator.filler - textureGenerator.fillerNone - textureGenerator.fillerCross - textureGenerator.fillerArrow - textureGenerator.fillerLabel - textureview.updateFromClipboard - textureview.showFrameIndices - textureview.previewAnimationNotice - textureview.pasteCollisionMask - textureview.copyCollisionMask - sounds.record - soundRecorder - styleview.useCustomFont - styleview.code - styleview.copyCode - fontview.generateBitmapFont - fontview.bitmapFont - fontview.bitmapFontSize - fontview.bitmapFontLineHeight - fontview.resultingBitmapFontName - fontview.charset - fontview.charsets.punctuation - fontview.charsets.basicLatin - fontview.charsets.latinExtended - fontview.charsets.cyrillic - fontview.charsets.greekCoptic - fontview.charsets.custom - fontview.charsets.allInFont - fontview.customCharsetHint - particleEmitters.showShapeVisualizer - particleEmitters.changeGrid - particleEmitters.newGridSize - particleEmitters.setPreviewTexture - typeview.visible - roombackgrounds.notBackgroundTextureWarning - roombackgrounds.fixBackground - roombackgrounds.dismissWarning - roomview.isUi - roomview.backgroundColor - roomview.properties - roomview.sortHorizontally - roomview.sortVertically - roomview.changecopyrotation - roomview.customProperties - roomview.copyProperties.position - roomview.copyProperties.rotation - roomview.copyProperties.scale - roomview.restrictCamera - roomview.minimumX - roomview.minimumY - roomview.maximumX - roomview.maximumY - notepad.modulespages - textureInput.jumpToTexture - textureInput.changeTexture - writableFolderPrompt.headerSelectFolderForData - writableFolderPrompt.paragraphCouldNotPickDirectory - writableFolderPrompt.paragraphDirectoryDirections - writableFolderPrompt.selectFolder - writableFolderSelector.folderDoesNotExist - writableFolderSelector.notADirectory - writableFolderSelector.folderNotWritable - writableFolderSelector.complete - mainMenu.troubleshooting.toggleDevTools - mainMenu.troubleshooting.copySystemInfo - mainMenu.troubleshooting.systemInfoWait - mainMenu.troubleshooting.systemInfoDone - mainMenu.troubleshooting.disableAcceleration - mainMenu.troubleshooting.disableBuiltInDebugger - mainMenu.troubleshooting.postAnIssue - mainMenu.troubleshooting.heading - mainMenu.deploy.heading - mainMenu.settings.themes.SpringStream - mainMenu.settings.themes.LucasDracula - mainMenu.settings.themes.Horizon - mainMenu.settings.themes.HCBlack - mainMenu.settings.disableSounds - mainMenu.settings.changeDataFolder - mainMenu.settings.forceProductionForDebug - mainMenu.project.heading - mainMenu.project.openProject - mainMenu.project.openExample - mainMenu.meta.heading - mainMenu.meta.visitDiscordForGamedevSupport - mainMenu.meta.openIconList - mainMenu.meta.twitter - mainMenu.meta.vkontakte - mainMenu.meta.ctjsForum - appView.restart - appView.project -Excess: 0 ✅ - - -Translation file German.json ----------------------------- -Coverage: 63% 👎 Meh -Not translated: 186 - common.clear - common.close - common.couldNotLoadFromClipboard - common.edit - common.filter - common.nothingToShowFiller - common.pastedFromClipboard - common.required - common.selectDialogue - common.search - common.settings - common.fieldTypes - copyCustomProperties - assetViewer - docsPanel.documentation - docsPanel.reference - exportPanel.windowsCrossBuildWarning - exportPanel.cannotBuildForMacOnWin - extensionsEditor.noEntries - extensionsEditor.addRow - groupEditor - intro.cloneProject - intro.examples - intro.github - intro.itch - intro.vkontakte - intro.patreon - intro.createOrBrowseJunction - onboarding.openJettyCatTutorial - settings.actions.makeFromScratch - settings.actions.presets - settings.actions.presetXYMovement - settings.actions.presetTouchAndMouse - settings.actions.presetCustom - settings.actions.exportActionPreset - settings.actions.importErrorMissingModules - settings.actions.importErrorNotCtJsPreset - settings.branding.hideLoadingLogo - settings.content - settings.modules.heading - settings.rendering.hideCursor - settings.rendering.desktopBuilds - settings.rendering.launchMode - settings.rendering.launchModes.maximized - settings.rendering.launchModes.fullscreen - settings.rendering.launchModes.windowed - settings.export.heading - settings.export.functionWrap - settings.export.codeModifier - settings.export.obfuscateWarning - settings.export.codeModifierAndWrapNote - settings.export.codeModifiers.none - settings.export.codeModifiers.minify - settings.export.codeModifiers.obfuscate - settings.catmodsSettings - settings.contentTypes - modules.dependencies - modules.optionalDependencies - modules.enabledModules - modules.availableModules - modules.filter - modules.preview - modules.previewTooltip - modules.deprecatedTooltip - modules.categories.customization - modules.categories.utilities - modules.categories.media - modules.categories.misc - modules.categories.desktop - modules.categories.motionPlanning - modules.categories.inputs - modules.categories.fx - modules.categories.mobile - modules.categories.integrations - modules.categories.tweaks - modules.categories.networking - texture.createType - texture.importFromClipboard - texture.generatePlaceholder - textureGenerator.name - textureGenerator.width - textureGenerator.height - textureGenerator.color - textureGenerator.label - textureGenerator.optional - textureGenerator.createAndClose - textureGenerator.createAndContinue - textureGenerator.scalingAtX4 - textureGenerator.generationSuccessMessage - textureGenerator.form - textureGenerator.formRectangular - textureGenerator.formRound - textureGenerator.formDiamond - textureGenerator.filler - textureGenerator.fillerNone - textureGenerator.fillerCross - textureGenerator.fillerArrow - textureGenerator.fillerLabel - textureview.updateFromClipboard - textureview.showFrameIndices - textureview.padding - textureview.paddingNotice - textureview.previewAnimationNotice - textureview.pasteCollisionMask - textureview.copyCollisionMask - sounds.record - soundRecorder - styleview.useCustomFont - styleview.code - styleview.copyCode - fontview.generateBitmapFont - fontview.bitmapFont - fontview.bitmapFontSize - fontview.bitmapFontLineHeight - fontview.resultingBitmapFontName - fontview.charset - fontview.charsets.punctuation - fontview.charsets.basicLatin - fontview.charsets.latinExtended - fontview.charsets.cyrillic - fontview.charsets.greekCoptic - fontview.charsets.custom - fontview.charsets.allInFont - fontview.customCharsetHint - particleEmitters.showShapeVisualizer - particleEmitters.changeGrid - particleEmitters.newGridSize - particleEmitters.setPreviewTexture - typeview.visible - roombackgrounds.notBackgroundTextureWarning - roombackgrounds.fixBackground - roombackgrounds.dismissWarning - roomview.isUi - roomview.backgroundColor - roomview.properties - roomview.sortHorizontally - roomview.sortVertically - roomview.changecopyrotation - roomview.customProperties - roomview.findTileset - roomview.copyProperties.position - roomview.copyProperties.rotation - roomview.copyProperties.scale - roomview.restrictCamera - roomview.minimumX - roomview.minimumY - roomview.maximumX - roomview.maximumY - notepad.modulespages - textureInput.jumpToTexture - textureInput.changeTexture - writableFolderPrompt.headerSelectFolderForData - writableFolderPrompt.paragraphCouldNotPickDirectory - writableFolderPrompt.paragraphDirectoryDirections - writableFolderPrompt.selectFolder - writableFolderSelector.folderDoesNotExist - writableFolderSelector.notADirectory - writableFolderSelector.folderNotWritable - writableFolderSelector.complete - mainMenu.troubleshooting.toggleDevTools - mainMenu.troubleshooting.copySystemInfo - mainMenu.troubleshooting.systemInfoWait - mainMenu.troubleshooting.systemInfoDone - mainMenu.troubleshooting.disableAcceleration - mainMenu.troubleshooting.disableBuiltInDebugger - mainMenu.troubleshooting.postAnIssue - mainMenu.troubleshooting.heading - mainMenu.deploy.heading - mainMenu.settings.themes.SpringStream - mainMenu.settings.themes.LucasDracula - mainMenu.settings.themes.Horizon - mainMenu.settings.themes.HCBlack - mainMenu.settings.disableSounds - mainMenu.settings.changeDataFolder - mainMenu.settings.forceProductionForDebug - mainMenu.project.heading - mainMenu.project.openProject - mainMenu.project.openExample - mainMenu.meta.heading - mainMenu.meta.visitDiscordForGamedevSupport - mainMenu.meta.openIconList - mainMenu.meta.twitter - mainMenu.meta.vkontakte - mainMenu.meta.ctjsForum - appView.restart - appView.project -Excess: 0 ✅ - - -Translation file Polish.json ----------------------------- -Coverage: 50% 👎 Meh -Not translated: 269 - common.clear - common.close - common.couldNotLoadFromClipboard - common.edit - common.filter - common.nothingToShowFiller - common.pastedFromClipboard - common.required - common.selectDialogue - common.select - common.search - common.settings - common.fieldTypes - copyCustomProperties - assetViewer - curveEditor.curveLineHint - curveEditor.dragPointHint - curveEditor.pointTime - curveEditor.pointValue - debuggerToolbar.pause - debuggerToolbar.resume - debuggerToolbar.restartGame - debuggerToolbar.restartRoom - debuggerToolbar.switchRoom - debuggerToolbar.toggleDevTools - debuggerToolbar.screenshot - debuggerToolbar.enterFullscreen - debuggerToolbar.exitFullscreen - debuggerToolbar.links - debuggerToolbar.openExternal - debuggerToolbar.close - docsPanel.documentation - docsPanel.reference - exportPanel.windowsCrossBuildWarning - exportPanel.cannotBuildForMacOnWin - extensionsEditor.noEntries - extensionsEditor.addRow - groupEditor - intro.cloneProject - intro.examples - intro.github - intro.itch - intro.vkontakte - intro.patreon - intro.createOrBrowseJunction - onboarding.openJettyCatTutorial - settings.actions.makeFromScratch - settings.actions.presets - settings.actions.presetXYMovement - settings.actions.presetTouchAndMouse - settings.actions.presetCustom - settings.actions.exportActionPreset - settings.actions.importErrorMissingModules - settings.actions.importErrorNotCtJsPreset - settings.branding.heading - settings.branding.accent - settings.branding.accentNotice - settings.branding.icon - settings.branding.iconNotice - settings.branding.invertPreloaderScheme - settings.branding.hideLoadingLogo - settings.content - settings.modules.heading - settings.rendering.hideCursor - settings.rendering.desktopBuilds - settings.rendering.launchMode - settings.rendering.launchModes.maximized - settings.rendering.launchModes.fullscreen - settings.rendering.launchModes.windowed - settings.export.heading - settings.export.functionWrap - settings.export.codeModifier - settings.export.obfuscateWarning - settings.export.codeModifierAndWrapNote - settings.export.codeModifiers.none - settings.export.codeModifiers.minify - settings.export.codeModifiers.obfuscate - settings.catmodsSettings - settings.contentTypes - modules.dependencies - modules.optionalDependencies - modules.enabledModules - modules.availableModules - modules.filter - modules.preview - modules.previewTooltip - modules.deprecatedTooltip - modules.categories.customization - modules.categories.utilities - modules.categories.media - modules.categories.misc - modules.categories.desktop - modules.categories.motionPlanning - modules.categories.inputs - modules.categories.fx - modules.categories.mobile - modules.categories.integrations - modules.categories.tweaks - modules.categories.networking - texture.createType - texture.importFromClipboard - texture.generatePlaceholder - textureGenerator.name - textureGenerator.width - textureGenerator.height - textureGenerator.color - textureGenerator.label - textureGenerator.optional - textureGenerator.createAndClose - textureGenerator.createAndContinue - textureGenerator.scalingAtX4 - textureGenerator.generationSuccessMessage - textureGenerator.form - textureGenerator.formRectangular - textureGenerator.formRound - textureGenerator.formDiamond - textureGenerator.filler - textureGenerator.fillerNone - textureGenerator.fillerCross - textureGenerator.fillerArrow - textureGenerator.fillerLabel - textureview.updateFromClipboard - textureview.showFrameIndices - textureview.padding - textureview.paddingNotice - textureview.previewAnimationNotice - textureview.pasteCollisionMask - textureview.copyCollisionMask - sounds.record - soundRecorder - styleview.useCustomFont - styleview.code - styleview.copyCode - fontview.generateBitmapFont - fontview.bitmapFont - fontview.bitmapFontSize - fontview.bitmapFontLineHeight - fontview.resultingBitmapFontName - fontview.charset - fontview.charsets.punctuation - fontview.charsets.basicLatin - fontview.charsets.latinExtended - fontview.charsets.cyrillic - fontview.charsets.greekCoptic - fontview.charsets.custom - fontview.charsets.allInFont - fontview.customCharsetHint - particleEmitters.emittersHeading - particleEmitters.emitterHeading - particleEmitters.from - particleEmitters.to - particleEmitters.textureHeading - particleEmitters.selectTexture - particleEmitters.importBuiltin - particleEmitters.colorAndOpacityHeading - particleEmitters.stepped - particleEmitters.steppedColor - particleEmitters.steppedAlpha - particleEmitters.blendMode - particleEmitters.regular - particleEmitters.darken - particleEmitters.lighten - particleEmitters.burn - particleEmitters.scalingHeading - particleEmitters.scale - particleEmitters.minimumSize - particleEmitters.minimumSizeHint - particleEmitters.velocityHeading - particleEmitters.velocity - particleEmitters.minimumSpeed - particleEmitters.minimumSpeedHint - particleEmitters.maxSpeed - particleEmitters.gravityHeading - particleEmitters.gravityNotice - particleEmitters.directionHeading - particleEmitters.startingDirection - particleEmitters.preserveTextureDirection - particleEmitters.rotationHeading - particleEmitters.rotationSpeed - particleEmitters.rotationAcceleration - particleEmitters.spawningHeading - particleEmitters.timeBetweenBursts - particleEmitters.spawnAtOnce - particleEmitters.chanceToSpawn - particleEmitters.maxParticles - particleEmitters.lifetime - particleEmitters.emitterLifetime - particleEmitters.prewarmDelay - particleEmitters.prewarmDelayNotice - particleEmitters.shapeAndPositioningHeading - particleEmitters.spawnType - particleEmitters.spawnShapes.point - particleEmitters.spawnShapes.rectangle - particleEmitters.spawnShapes.circle - particleEmitters.spawnShapes.ring - particleEmitters.spawnShapes.star - particleEmitters.width - particleEmitters.height - particleEmitters.radius - particleEmitters.starPoints - particleEmitters.startAngle - particleEmitters.showShapeVisualizer - particleEmitters.relativeEmitterPosition - particleEmitters.addEmitter - particleEmitters.reset - particleEmitters.changeBg - particleEmitters.inspectorComplete - particleEmitters.alreadyHasAnImportingTexture - particleEmitters.changeGrid - particleEmitters.newGridSize - particleEmitters.setPreviewTexture - typeview.visible - roombackgrounds.notBackgroundTextureWarning - roombackgrounds.fixBackground - roombackgrounds.dismissWarning - roomview.isUi - roomview.backgroundColor - roomview.properties - roomview.sortHorizontally - roomview.sortVertically - roomview.changecopyrotation - roomview.customProperties - roomview.copyProperties.position - roomview.copyProperties.rotation - roomview.copyProperties.scale - roomview.restrictCamera - roomview.minimumX - roomview.minimumY - roomview.maximumX - roomview.maximumY - notepad.modulespages - textureInput.jumpToTexture - textureInput.changeTexture - writableFolderPrompt.headerSelectFolderForData - writableFolderPrompt.paragraphCouldNotPickDirectory - writableFolderPrompt.paragraphDirectoryDirections - writableFolderPrompt.selectFolder - writableFolderSelector.folderDoesNotExist - writableFolderSelector.notADirectory - writableFolderSelector.folderNotWritable - writableFolderSelector.complete - mainMenu.troubleshooting.toggleDevTools - mainMenu.troubleshooting.copySystemInfo - mainMenu.troubleshooting.systemInfoWait - mainMenu.troubleshooting.systemInfoDone - mainMenu.troubleshooting.disableAcceleration - mainMenu.troubleshooting.disableBuiltInDebugger - mainMenu.troubleshooting.postAnIssue - mainMenu.troubleshooting.heading - mainMenu.deploy.heading - mainMenu.settings.themes.SpringStream - mainMenu.settings.themes.LucasDracula - mainMenu.settings.themes.Horizon - mainMenu.settings.themes.HCBlack - mainMenu.settings.disableSounds - mainMenu.settings.changeDataFolder - mainMenu.settings.forceProductionForDebug - mainMenu.project.heading - mainMenu.project.openProject - mainMenu.project.openExample - mainMenu.meta.heading - mainMenu.meta.visitDiscordForGamedevSupport - mainMenu.meta.openIconList - mainMenu.meta.twitter - mainMenu.meta.vkontakte - mainMenu.meta.ctjsForum - appView.restart - appView.project - appView.fx -Excess: 0 ✅ - - -Translation file Romanian.json ------------------------------- -Coverage: 41% 🆘 Someone help, please! -Not translated: 330 - common.clear - common.close - common.contribute - common.couldNotLoadFromClipboard - common.edit - common.filter - common.loading - common.nothingToShowFiller - common.pastedFromClipboard - common.required - common.selectDialogue - common.select - common.search - common.settings - common.fieldTypes - copyCustomProperties - assetViewer - curveEditor.curveLineHint - curveEditor.dragPointHint - curveEditor.pointTime - curveEditor.pointValue - debuggerToolbar.pause - debuggerToolbar.resume - debuggerToolbar.restartGame - debuggerToolbar.restartRoom - debuggerToolbar.switchRoom - debuggerToolbar.toggleDevTools - debuggerToolbar.screenshot - debuggerToolbar.enterFullscreen - debuggerToolbar.exitFullscreen - debuggerToolbar.links - debuggerToolbar.openExternal - debuggerToolbar.close - docsPanel.documentation - docsPanel.reference - exportPanel.windowsCrossBuildWarning - exportPanel.cannotBuildForMacOnWin - extensionsEditor.noEntries - extensionsEditor.addRow - groupEditor - intro.newProject.saveProjectHere - intro.newProject.selectProjectFolder - intro.loadingProject - intro.loadingProjectError - intro.cloneProject - intro.examples - intro.unableToWriteToFolders - intro.github - intro.itch - intro.vkontakte - intro.patreon - intro.createOrBrowseJunction - licensepanel.ctjslicense - onboarding.hoorayHeader - onboarding.nowWhatParagraph - onboarding.openSpaceShooterTutorial - onboarding.openPlatformerTutorial - onboarding.openJettyCatTutorial - onboarding.doNothing - onboarding.showOnboardingCheckbox - settings.actions.makeFromScratch - settings.actions.presets - settings.actions.presetXYMovement - settings.actions.presetTouchAndMouse - settings.actions.presetCustom - settings.actions.exportActionPreset - settings.actions.importErrorMissingModules - settings.actions.importErrorNotCtJsPreset - settings.branding.heading - settings.branding.accent - settings.branding.accentNotice - settings.branding.icon - settings.branding.iconNotice - settings.branding.invertPreloaderScheme - settings.branding.hideLoadingLogo - settings.content - settings.modules.heading - settings.rendering.highDensity - settings.rendering.maxFPS - settings.rendering.hideCursor - settings.rendering.desktopBuilds - settings.rendering.launchMode - settings.rendering.launchModes.maximized - settings.rendering.launchModes.fullscreen - settings.rendering.launchModes.windowed - settings.export.heading - settings.export.functionWrap - settings.export.codeModifier - settings.export.obfuscateWarning - settings.export.codeModifierAndWrapNote - settings.export.codeModifiers.none - settings.export.codeModifiers.minify - settings.export.codeModifiers.obfuscate - settings.catmodsSettings - settings.contentTypes - modules.dependencies - modules.optionalDependencies - modules.importModules - modules.enabledModules - modules.availableModules - modules.filter - modules.preview - modules.previewTooltip - modules.deprecatedTooltip - modules.categories.customization - modules.categories.utilities - modules.categories.media - modules.categories.misc - modules.categories.desktop - modules.categories.motionPlanning - modules.categories.inputs - modules.categories.fx - modules.categories.mobile - modules.categories.integrations - modules.categories.tweaks - modules.categories.networking - texture.createType - texture.importFromClipboard - texture.generatePlaceholder - textureGenerator.name - textureGenerator.width - textureGenerator.height - textureGenerator.color - textureGenerator.label - textureGenerator.optional - textureGenerator.createAndClose - textureGenerator.createAndContinue - textureGenerator.scalingAtX4 - textureGenerator.generationSuccessMessage - textureGenerator.form - textureGenerator.formRectangular - textureGenerator.formRound - textureGenerator.formDiamond - textureGenerator.filler - textureGenerator.fillerNone - textureGenerator.fillerCross - textureGenerator.fillerArrow - textureGenerator.fillerLabel - textureview.updateFromClipboard - textureview.showFrameIndices - textureview.padding - textureview.paddingNotice - textureview.previewAnimationNotice - textureview.pasteCollisionMask - textureview.copyCollisionMask - sounds.record - soundRecorder - styleview.useCustomFont - styleview.code - styleview.copyCode - fontview.generateBitmapFont - fontview.bitmapFont - fontview.bitmapFontSize - fontview.bitmapFontLineHeight - fontview.resultingBitmapFontName - fontview.charset - fontview.charsets.punctuation - fontview.charsets.basicLatin - fontview.charsets.latinExtended - fontview.charsets.cyrillic - fontview.charsets.greekCoptic - fontview.charsets.custom - fontview.charsets.allInFont - fontview.customCharsetHint - particleEmitters.emittersHeading - particleEmitters.emitterHeading - particleEmitters.from - particleEmitters.to - particleEmitters.textureHeading - particleEmitters.selectTexture - particleEmitters.importBuiltin - particleEmitters.colorAndOpacityHeading - particleEmitters.stepped - particleEmitters.steppedColor - particleEmitters.steppedAlpha - particleEmitters.blendMode - particleEmitters.regular - particleEmitters.darken - particleEmitters.lighten - particleEmitters.burn - particleEmitters.scalingHeading - particleEmitters.scale - particleEmitters.minimumSize - particleEmitters.minimumSizeHint - particleEmitters.velocityHeading - particleEmitters.velocity - particleEmitters.minimumSpeed - particleEmitters.minimumSpeedHint - particleEmitters.maxSpeed - particleEmitters.gravityHeading - particleEmitters.gravityNotice - particleEmitters.directionHeading - particleEmitters.startingDirection - particleEmitters.preserveTextureDirection - particleEmitters.rotationHeading - particleEmitters.rotationSpeed - particleEmitters.rotationAcceleration - particleEmitters.spawningHeading - particleEmitters.timeBetweenBursts - particleEmitters.spawnAtOnce - particleEmitters.chanceToSpawn - particleEmitters.maxParticles - particleEmitters.lifetime - particleEmitters.emitterLifetime - particleEmitters.prewarmDelay - particleEmitters.prewarmDelayNotice - particleEmitters.shapeAndPositioningHeading - particleEmitters.spawnType - particleEmitters.spawnShapes.point - particleEmitters.spawnShapes.rectangle - particleEmitters.spawnShapes.circle - particleEmitters.spawnShapes.ring - particleEmitters.spawnShapes.star - particleEmitters.width - particleEmitters.height - particleEmitters.radius - particleEmitters.starPoints - particleEmitters.startAngle - particleEmitters.showShapeVisualizer - particleEmitters.relativeEmitterPosition - particleEmitters.addEmitter - particleEmitters.reset - particleEmitters.changeBg - particleEmitters.inspectorComplete - particleEmitters.alreadyHasAnImportingTexture - particleEmitters.changeGrid - particleEmitters.newGridSize - particleEmitters.setPreviewTexture - typeview.visible - roombackgrounds.notBackgroundTextureWarning - roombackgrounds.fixBackground - roombackgrounds.dismissWarning - roomview.isUi - roomview.backgroundColor - roomview.properties - roomview.sortHorizontally - roomview.sortVertically - roomview.changecopyrotation - roomview.customProperties - roomview.findTileset - roomview.copyProperties.position - roomview.copyProperties.rotation - roomview.copyProperties.scale - roomview.restrictCamera - roomview.minimumX - roomview.minimumY - roomview.maximumX - roomview.maximumY - notepad.modulespages - patreon.aboutPatrons - patreon.patronsHeader - patreon.businessShuttles - patreon.noShuttlesYet - patreon.shuttlesDescription - patreon.spacePirates - patreon.noPiratesYet - patreon.piratesDescription - patreon.spaceProgrammers - patreon.programmersDescription - patreon.aspiringAstronauts - patreon.noAstronautsYet - patreon.astronautsDescription - patreon.thankAllPatrons - patreon.becomeAPatron - patreon.aboutFillers.0 - patreon.aboutFillers.1 - patreon.aboutFillers.2 - patreon.aboutFillers.3 - patreon.aboutFillers.4 - patreon.aboutFillers.5 - patreon.aboutFillers.6 - patreon.aboutFillers.7 - patreon.aboutFillers.8 - patreon.aboutFillers.9 - patreon.aboutFillers.10 - patreon.aboutFillers.11 - patreon.aboutFillers.12 - patreon.aboutFillers.13 - patreon.aboutFillers.14 - patreon.aboutFillers.15 - patreon.aboutFillers.16 - textureInput.jumpToTexture - textureInput.changeTexture - writableFolderPrompt.headerSelectFolderForData - writableFolderPrompt.paragraphCouldNotPickDirectory - writableFolderPrompt.paragraphDirectoryDirections - writableFolderPrompt.selectFolder - writableFolderSelector.folderDoesNotExist - writableFolderSelector.notADirectory - writableFolderSelector.folderNotWritable - writableFolderSelector.complete - mainMenu.troubleshooting.toggleDevTools - mainMenu.troubleshooting.copySystemInfo - mainMenu.troubleshooting.systemInfoWait - mainMenu.troubleshooting.systemInfoDone - mainMenu.troubleshooting.disableAcceleration - mainMenu.troubleshooting.disableBuiltInDebugger - mainMenu.troubleshooting.postAnIssue - mainMenu.troubleshooting.heading - mainMenu.deploy.heading - mainMenu.settings.themes.SpringStream - mainMenu.settings.themes.LucasDracula - mainMenu.settings.themes.Horizon - mainMenu.settings.themes.HCBlack - mainMenu.settings.codeFontDefault - mainMenu.settings.codeFontOldSchool - mainMenu.settings.codeFontSystem - mainMenu.settings.codeFontCustom - mainMenu.settings.newFont - mainMenu.settings.codeFont - mainMenu.settings.codeLigatures - mainMenu.settings.codeDense - mainMenu.settings.disableSounds - mainMenu.settings.changeDataFolder - mainMenu.settings.forceProductionForDebug - mainMenu.project.heading - mainMenu.project.openIncludeFolder - mainMenu.project.openProject - mainMenu.project.openExample - mainMenu.meta.heading - mainMenu.meta.visitDiscordForGamedevSupport - mainMenu.meta.openIconList - mainMenu.meta.twitter - mainMenu.meta.vkontakte - mainMenu.meta.ctjsForum - appView.launchHotkeys - appView.patrons - appView.restart - appView.project - appView.fx -Excess: 0 ✅ - - -Translation file Russian.json ------------------------------ -Coverage: 88% ✅ Good! -Not translated: 28 - common.edit - common.nothingToShowFiller - common.required - common.settings - common.fieldTypes - assetViewer - groupEditor - settings.actions.makeFromScratch - settings.actions.presets - settings.actions.presetXYMovement - settings.actions.presetTouchAndMouse - settings.actions.presetCustom - settings.actions.exportActionPreset - settings.actions.importErrorMissingModules - settings.actions.importErrorNotCtJsPreset - settings.content - settings.contentTypes - textureGenerator.form - textureGenerator.formRectangular - textureGenerator.formRound - textureGenerator.formDiamond - textureGenerator.fillerArrow - textureview.pasteCollisionMask - textureview.copyCollisionMask - sounds.record - soundRecorder - styleview.code - styleview.copyCode -Excess: 0 ✅ - - -Translation file Spanish.json ------------------------------ -Coverage: 71% 😕 A decent coverage, but it could be better! -Not translated: 136 - common.close - common.couldNotLoadFromClipboard - common.edit - common.filter - common.nothingToShowFiller - common.pastedFromClipboard - common.required - common.search - common.settings - common.fieldTypes - copyCustomProperties - assetViewer - docsPanel.documentation - docsPanel.reference - extensionsEditor.noEntries - extensionsEditor.addRow - groupEditor - intro.cloneProject - intro.examples - intro.github - intro.itch - intro.vkontakte - intro.patreon - intro.createOrBrowseJunction - settings.actions.makeFromScratch - settings.actions.presets - settings.actions.presetXYMovement - settings.actions.presetTouchAndMouse - settings.actions.presetCustom - settings.actions.exportActionPreset - settings.actions.importErrorMissingModules - settings.actions.importErrorNotCtJsPreset - settings.branding.hideLoadingLogo - settings.content - settings.modules.heading - settings.rendering.hideCursor - settings.export.heading - settings.export.functionWrap - settings.export.codeModifier - settings.export.obfuscateWarning - settings.export.codeModifierAndWrapNote - settings.export.codeModifiers.none - settings.export.codeModifiers.minify - settings.export.codeModifiers.obfuscate - settings.catmodsSettings - settings.contentTypes - modules.enabledModules - modules.availableModules - modules.filter - modules.preview - modules.previewTooltip - modules.deprecatedTooltip - modules.categories.customization - modules.categories.utilities - modules.categories.media - modules.categories.misc - modules.categories.desktop - modules.categories.motionPlanning - modules.categories.inputs - modules.categories.fx - modules.categories.mobile - modules.categories.integrations - modules.categories.tweaks - modules.categories.networking - texture.importFromClipboard - texture.generatePlaceholder - textureGenerator.name - textureGenerator.width - textureGenerator.height - textureGenerator.color - textureGenerator.label - textureGenerator.optional - textureGenerator.createAndClose - textureGenerator.createAndContinue - textureGenerator.scalingAtX4 - textureGenerator.generationSuccessMessage - textureGenerator.form - textureGenerator.formRectangular - textureGenerator.formRound - textureGenerator.formDiamond - textureGenerator.filler - textureGenerator.fillerNone - textureGenerator.fillerCross - textureGenerator.fillerArrow - textureGenerator.fillerLabel - textureview.updateFromClipboard - textureview.showFrameIndices - textureview.previewAnimationNotice - textureview.pasteCollisionMask - textureview.copyCollisionMask - sounds.record - soundRecorder - styleview.useCustomFont - styleview.code - styleview.copyCode - typeview.visible - roombackgrounds.notBackgroundTextureWarning - roombackgrounds.fixBackground - roombackgrounds.dismissWarning - roomview.isUi - roomview.backgroundColor - roomview.properties - roomview.sortHorizontally - roomview.sortVertically - roomview.customProperties - roomview.copyProperties.position - roomview.copyProperties.rotation - roomview.copyProperties.scale - roomview.restrictCamera - roomview.minimumX - roomview.minimumY - roomview.maximumX - roomview.maximumY - notepad.modulespages - textureInput.jumpToTexture - textureInput.changeTexture - writableFolderPrompt.headerSelectFolderForData - writableFolderPrompt.paragraphCouldNotPickDirectory - writableFolderPrompt.paragraphDirectoryDirections - writableFolderPrompt.selectFolder - writableFolderSelector.folderDoesNotExist - writableFolderSelector.notADirectory - writableFolderSelector.folderNotWritable - writableFolderSelector.complete - mainMenu.deploy.heading - mainMenu.settings.themes.Horizon - mainMenu.settings.themes.HCBlack - mainMenu.settings.disableSounds - mainMenu.settings.changeDataFolder - mainMenu.settings.forceProductionForDebug - mainMenu.project.heading - mainMenu.meta.heading - mainMenu.meta.openIconList - mainMenu.meta.twitter - mainMenu.meta.vkontakte - mainMenu.meta.ctjsForum -Excess: 0 ✅ - - -Stats: - 😕 75% Brazilian Portuguese.json - ✅ 85% Chinese Simplified.json - 👎 67% Dutch.json - 👎 64% French.json - 👎 63% German.json - 👎 50% Polish.json - 🆘 41% Romanian.json - ✅ 88% Russian.json - 😕 71% Spanish.json - - -Problematic files: - ✅ None -[19:13:25] Finished 'lintI18n' after 24 ms -[19:13:25] Finished 'lint' after 8.82 s diff --git a/package-lock.json b/package-lock.json index feb22e7cb..5792a6eb3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ctjsbuildenvironment", - "version": "4.0.0", + "version": "4.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ctjsbuildenvironment", - "version": "4.0.0", + "version": "4.0.1", "license": "MIT", "dependencies": { "@ct.js/gulp-typescript": "^6.0.0", diff --git a/package.json b/package.json index 9390dd4b7..f3a8b6a3f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ctjsbuildenvironment", - "version": "4.0.0", + "version": "4.0.1", "description": "", "directories": { "doc": "docs" diff --git a/src/examples/JettyCat.ict b/src/examples/JettyCat.ict index 1c0334e8b..b9e63f6a2 100644 --- a/src/examples/JettyCat.ict +++ b/src/examples/JettyCat.ict @@ -1,4 +1,4 @@ -ctjsVersion: 4.0.0-next-5 +ctjsVersion: 4.0.0 notes: /* empty */ libs: place: @@ -507,7 +507,7 @@ assets: uid: 8748598b-4494-433f-9f18-fbe985c2a583 texture: -1 extends: {} - lastmod: 1657025852826 + lastmod: 1708231349105 events: - lib: core arguments: {} @@ -521,9 +521,8 @@ assets: var scoreText = `Your score: ${rooms.current.stars} Highscore: ${localStorage['JettyCat_HighScore']}`; - this.label = new PIXI.Text(scoreText, styles.get('Orange')); - this.label.anchor.x = this.label.anchor.y = 0.5; - this.addChild(this.label); + + this.text = scoreText; eventKey: OnCreate type: template loopAnimation: true @@ -532,13 +531,15 @@ assets: animationFPS: 30 playAnimationOnStart: false behaviors: [] - baseClass: AnimatedSprite + baseClass: Text nineSliceSettings: left: 16 top: 16 right: 16 bottom: 16 style: -1 + defaultText: 'Your score: 100500' + textStyle: 316e5f08-494c-4570-ba65-8cd45d8b946f - type: template name: PotatoCat_Stunned depth: 0 @@ -898,6 +899,7 @@ assets: uid: 92049024-c0ef-41ae-8512-851ce20cad3a exts: {} customProperties: {} + bindings: {} - x: 540 'y': 1344 opacity: 1 @@ -909,6 +911,7 @@ assets: uid: 25ac0f9b-57ff-461d-8eb7-a9ce800b9c71 exts: {} customProperties: {} + bindings: {} - x: 540 'y': 832 opacity: 1 @@ -920,16 +923,24 @@ assets: uid: 8748598b-4494-433f-9f18-fbe985c2a583 exts: {} customProperties: {} + bindings: {} + customAnchor: + x: 0.5 + 'y': 0.5 + customText: |- + Your score: 100 + Highscore: 200 tiles: - depth: -10 tiles: [] extends: {} hidden: false + cache: true uid: 158a085c-c48c-4b57-8e64-e38a4cd0cc21 thumbnail: e38a4cd0cc21 gridX: 540 gridY: 64 - lastmod: 1701063875636 + lastmod: 1708231376422 events: - lib: core arguments: {} diff --git a/src/examples/catformer.ict b/src/examples/catformer.ict index a7987a621..bfe90e48a 100644 --- a/src/examples/catformer.ict +++ b/src/examples/catformer.ict @@ -547,7 +547,7 @@ assets: code: 'this.gotoAndStop(settings.fullscreen? 1 : 0);' eventKey: OnDraw - eventKey: OnPointerClick - code: fittoscreen.toggleFullscreen(); + code: settings.fullscreen = !settings.fullscreen; arguments: {} lib: core type: template diff --git a/src/js/projectMigrationScripts/4.0.0-next-1.js b/src/js/projectMigrationScripts/4.0.0-next-1.js index 5ebefde5e..614f0bda3 100644 --- a/src/js/projectMigrationScripts/4.0.0-next-1.js +++ b/src/js/projectMigrationScripts/4.0.0-next-1.js @@ -5,7 +5,11 @@ window.migrationProcess.push({ process: project => new Promise(resolve => { // Cleanup old catmods const {rendering} = project.settings; - rendering.viewMode ??= project.libs.fittoscreen.mode; + if (project.libs.fittoscreen) { + rendering.viewMode ??= project.libs.fittoscreen.mode; + } else { + rendering.viewMode ??= 'asIs'; + } delete project.libs.fittoscreen; delete project.libs.touch; delete project.libs['sound.howler']; diff --git a/src/js/projectMigrationScripts/4.0.0-next-2.js b/src/js/projectMigrationScripts/4.0.0-next-2.js index 1cf7f6390..1e22195a7 100644 --- a/src/js/projectMigrationScripts/4.0.0-next-2.js +++ b/src/js/projectMigrationScripts/4.0.0-next-2.js @@ -207,9 +207,13 @@ window.migrationProcess.push({ for (const asset of project[collectionName]) { asset.type = assetType; if (asset.group) { - const groupName = project.groups[collectionName] - .find(g => g.uid === asset.group.uid).name; - oldGroups[groupName].entries.push(asset); + const group = project.groups[collectionName] + .find(g => g.uid === asset.group.uid); + if (group) { + oldGroups[group.name].entries.push(asset); + } else { + project.assets.push(asset); + } } else { project.assets.push(asset); } diff --git a/src/node_requires/roomEditor/index.ts b/src/node_requires/roomEditor/index.ts index ced0e88de..d09a1064c 100644 --- a/src/node_requires/roomEditor/index.ts +++ b/src/node_requires/roomEditor/index.ts @@ -236,6 +236,7 @@ class RoomEditor extends PIXI.Application { this.cleanupTemplatesHandle = (templateId: string) => this.cleanupTemplates(templateId); window.signals.on('pixiTextureChanged', this.updateTexturesHandle); window.signals.on('templateChanged', this.updateCopiesHandle); + window.signals.on('styleChanged', this.updateCopiesHandle); window.signals.on('templatesChanged', this.updateCopiesHandle); window.signals.on('templateRemoved', this.cleanupTemplatesHandle); } @@ -749,10 +750,10 @@ class RoomEditor extends PIXI.Application { } } } - updateCopies(templateId: string): void { + updateCopies(id: string): void { for (const child of this.room.children) { if (child instanceof Copy) { - if (child.templateId === templateId) { + if (child.templateId === id || child.cachedTemplate.textStyle === id) { child.recreate(); } } diff --git a/src/riotTags/app-view.tag b/src/riotTags/app-view.tag index 107057abf..0498c4da6 100644 --- a/src/riotTags/app-view.tag +++ b/src/riotTags/app-view.tag @@ -169,6 +169,17 @@ app-view.flexcol this.on('unmount', () => { window.signals.off('assetChanged', this.refreshDirty); }); + const checkDeletedTabs = id => { + if (typeof this.tab !== 'string' && this.tab.uid === id) { + this.tab = 'assets'; + } + this.openedAssets = this.openedAssets.filter(t => t.uid !== id); + this.update(); + }; + window.signals.on('assetRemoved', checkDeletedTabs); + this.on('unmount', () => { + window.signals.off('assetRemoved', checkDeletedTabs); + }); const resources = require('./data/node_requires/resources'); this.editorMap = resources.editorMap; diff --git a/src/riotTags/editors/room-editor/room-editor.tag b/src/riotTags/editors/room-editor/room-editor.tag index 45155fa94..d39243d79 100644 --- a/src/riotTags/editors/room-editor/room-editor.tag +++ b/src/riotTags/editors/room-editor/room-editor.tag @@ -147,7 +147,7 @@ room-editor.aPanel.aView button(onclick="{saveRoom}") svg.feather use(xlink:href="#check") - span {vocGlob.save} + span {vocGlob.apply} room-events-editor(if="{editingEvents}" room="{room}" onsave="{closeRoomEvents}") context-menu(menu="{gridMenu}" ref="gridMenu") diff --git a/src/riotTags/editors/texture-editor.tag b/src/riotTags/editors/texture-editor.tag index e4a375181..f0cea7bba 100644 --- a/src/riotTags/editors/texture-editor.tag +++ b/src/riotTags/editors/texture-editor.tag @@ -361,8 +361,8 @@ texture-editor(onclick="{tryClose}") .flexfix-footer button.wide(onclick="{triggerSave}" title="Shift+Control+S" data-hotkey="Control+S") svg.feather - use(xlink:href="#save") - span {this.vocGlob.save} + use(xlink:href="#check") + span {this.vocGlob.apply} color-picker( ref="previewBackgroundColor" if="{changingPreviewBg}" hidealpha="true"