From 883d19f78ce8965bcce04b14aba5a2c30913b7cf Mon Sep 17 00:00:00 2001 From: h0lybyte <5599058+h0lybyte@users.noreply.github.com> Date: Thu, 13 Feb 2025 11:27:43 +0000 Subject: [PATCH] Merge pull request #3909 from KBVE/beta Preparing Release Branch --- docs/_astro/@supabase.CVkg5Wqw.js | 7 + docs/_astro/@supabase.DH5uoBuY.js | 7 - ...v.BAymX-kZ.js => DashboardNav.Cwl1Hg0Y.js} | 2 +- ...re.BQoyWod4.js => DevCodeCore.DglLLE_-.js} | 2 +- ...enu.Iy5NmxS8.js => KanbanMenu.Z-Py2CVo.js} | 2 +- ...Form.h5vFVMdi.js => LoginForm.BzvLvisg.js} | 2 +- ...e.3WAuKRwZ.js => ReachProfile.BTJdxRer.js} | 2 +- ...BduIIYcg.js => ReactDashboard._1dPg9dO.js} | 2 +- ...an.Awa0CltN.js => ReactKanban.CW5lb4sk.js} | 2 +- ...ut.Dqo5iiZg.js => ReactLogout.DMynibY9.js} | 2 +- ...ity.9zefHR_r.js => ReactUnity.CQo0q535.js} | 2 +- ....js => SupabaseSvelteRegister.8VmSQGgW.js} | 2 +- docs/_astro/ec.8zarh.js | 3 + docs/_astro/ec.tm3va.css | 1 + ...{loader.7yziqgW4.js => loader.a1m5Rqtc.js} | 2 +- ...ler.Bw6Te69l.js => npchandler.BSw-qpjL.js} | 2 +- docs/_astro/shiki.DPhLURod.js | 1 - docs/_astro/shiki.Db3H6uFj.js | 1 + .../technical-specifications/index.html | 4 +- docs/api/graph.json | 2 +- docs/api/itemdb.json | 2 +- docs/api/music.json | 2 +- docs/api/services.json | 2 +- docs/application/android/index.html | 162 +-- docs/application/ansible/index.html | 111 +- docs/application/appwrite/index.html | 83 +- docs/application/cubejs/index.html | 26 +- docs/application/docker/index.html | 102 +- docs/application/gcloud/index.html | 63 +- docs/application/git/index.html | 246 +---- docs/application/godot/index.html | 2 +- docs/application/javascript/index.html | 997 ++++-------------- docs/application/kubernetes/index.html | 69 +- docs/application/linux/index.html | 4 +- docs/application/longhorn/index.html | 32 +- docs/application/ml/index.html | 43 +- docs/application/nmap/index.html | 4 +- docs/application/php/index.html | 26 +- docs/application/pocketbase/index.html | 34 +- docs/application/portainer/index.html | 19 +- docs/application/proxmox/index.html | 93 +- docs/application/python/index.html | 198 +--- docs/application/rust/index.html | 63 +- docs/application/sql/index.html | 102 +- docs/application/traefik/index.html | 52 +- docs/application/unity/index.html | 283 +---- docs/application/wireguard/index.html | 133 +-- docs/arcade/index.html | 6 +- docs/auth/unity/index.html | 2 +- docs/content-assets.mjs | 4 +- docs/content-modules.mjs | 182 ++-- docs/crypto/btc/index.html | 4 +- docs/crypto/doge/index.html | 4 +- docs/crypto/index.html | 4 +- docs/dashboard/index.html | 2 +- docs/de/welcome-to-docs/index.html | 4 +- .../guides/first-project-checklist/index.html | 4 +- docs/fr/guides/getting-started/index.html | 4 +- docs/gaming/wow/index.html | 71 +- docs/guides/getting-started/index.html | 35 +- docs/guides/intro/index.html | 4 +- docs/index.html | 6 +- .../starlight-sitemap-integration/types.d.ts | 4 +- docs/itemdb/food/candy/index.html | 4 +- docs/itemdb/food/fish/index.html | 4 +- docs/itemdb/potion/index.html | 4 +- .../guides/first-project-checklist/index.html | 4 +- docs/ja/guides/intro/index.html | 4 +- docs/journal/01-02/index.html | 35 +- docs/journal/01-03/index.html | 18 +- docs/journal/01-04/index.html | 29 +- docs/journal/01-05/index.html | 4 +- docs/journal/01-06/index.html | 4 +- docs/journal/01-08/index.html | 16 +- docs/journal/01-09/index.html | 4 +- docs/journal/01-10/index.html | 2 +- docs/journal/01-11/index.html | 37 +- docs/journal/01-12/index.html | 21 +- docs/journal/01-14/index.html | 6 +- docs/journal/01-15/index.html | 24 +- docs/journal/01-16/index.html | 32 +- docs/journal/01-18/index.html | 4 +- docs/journal/01-19/index.html | 8 +- docs/journal/01-20/index.html | 6 +- docs/journal/01-21/index.html | 48 +- docs/journal/01-22/index.html | 17 +- docs/journal/01-23/index.html | 8 +- docs/journal/01-24/index.html | 8 +- docs/journal/01-25/index.html | 2 +- docs/journal/01-26/index.html | 15 +- docs/journal/01-27/index.html | 25 +- docs/journal/01-28/index.html | 36 +- docs/journal/01-29/index.html | 42 +- docs/journal/02-04/index.html | 154 +-- docs/journal/02-05/index.html | 79 +- docs/journal/02-07/index.html | 6 +- docs/journal/02-08/index.html | 58 +- docs/journal/02-09/index.html | 24 +- docs/journal/02-10/index.html | 10 +- docs/journal/02-11/index.html | 133 +-- docs/journal/02-12/index.html | 119 +-- docs/journal/02-13/index.html | 9 + docs/journal/02-14/index.html | 11 +- docs/journal/02-15/index.html | 18 +- docs/journal/02-17/index.html | 35 +- docs/journal/02-18/index.html | 3 +- docs/journal/02-19/index.html | 7 +- docs/journal/02-21/index.html | 2 +- docs/journal/02-22/index.html | 2 +- docs/journal/02-25/index.html | 32 +- docs/journal/02-26/index.html | 9 +- docs/journal/03-01/index.html | 26 +- docs/journal/03-02/index.html | 2 +- docs/journal/03-03/index.html | 6 +- docs/journal/03-04/index.html | 61 +- docs/journal/03-06/index.html | 2 +- docs/journal/03-07/index.html | 2 +- docs/journal/03-08/index.html | 2 +- docs/journal/03-09/index.html | 2 +- docs/journal/03-13/index.html | 40 +- docs/journal/03-14/index.html | 9 +- docs/journal/03-15/index.html | 50 +- docs/journal/03-16/index.html | 2 +- docs/journal/03-19/index.html | 79 +- docs/journal/03-20/index.html | 55 +- docs/journal/03-21/index.html | 2 +- docs/journal/03-22/index.html | 2 +- docs/journal/03-23/index.html | 4 +- docs/journal/03-25/index.html | 77 +- docs/journal/03-26/index.html | 137 +-- docs/journal/03-27/index.html | 2 +- docs/journal/03-28/index.html | 49 +- docs/journal/03-29/index.html | 2 +- docs/journal/04-01/index.html | 143 +-- docs/journal/04-02/index.html | 42 +- docs/journal/04-03/index.html | 58 +- docs/journal/04-07/index.html | 188 +--- docs/journal/04-09/index.html | 96 +- docs/journal/04-10/index.html | 73 +- docs/journal/04-11/index.html | 23 +- docs/journal/04-13/index.html | 40 +- docs/journal/04-14/index.html | 31 +- docs/journal/04-16/index.html | 2 +- docs/journal/04-17/index.html | 19 +- docs/journal/04-18/index.html | 46 +- docs/journal/04-19/index.html | 39 +- docs/journal/04-23/index.html | 32 +- docs/journal/04-24/index.html | 8 +- docs/journal/04-27/index.html | 2 +- docs/journal/04-28/index.html | 2 +- docs/journal/04-29/index.html | 2 +- docs/journal/04-30/index.html | 10 +- docs/journal/05-01/index.html | 72 +- docs/journal/05-04/index.html | 34 +- docs/journal/05-05/index.html | 2 +- docs/journal/05-06/index.html | 8 +- docs/journal/05-07/index.html | 104 +- docs/journal/05-08/index.html | 90 +- docs/journal/05-09/index.html | 41 +- docs/journal/05-14/index.html | 2 +- docs/journal/05-15/index.html | 2 +- docs/journal/05-16/index.html | 4 +- docs/journal/05-18/index.html | 9 +- docs/journal/05-19/index.html | 55 +- docs/journal/05-20/index.html | 2 +- docs/journal/05-21/index.html | 6 +- docs/journal/05-22/index.html | 2 +- docs/journal/05-23/index.html | 2 +- docs/journal/05-25/index.html | 2 +- docs/journal/05-26/index.html | 2 +- docs/journal/05-29/index.html | 2 +- docs/journal/05-31/index.html | 2 +- docs/journal/06-01/index.html | 2 +- docs/journal/06-04/index.html | 20 +- docs/journal/06-05/index.html | 36 +- docs/journal/06-06/index.html | 40 +- docs/journal/06-07/index.html | 6 +- docs/journal/06-08/index.html | 40 +- docs/journal/06-09/index.html | 7 +- docs/journal/06-10/index.html | 152 +-- docs/journal/06-12/index.html | 23 +- docs/journal/06-15/index.html | 32 +- docs/journal/06-16/index.html | 12 +- docs/journal/06-17/index.html | 10 +- docs/journal/06-18/index.html | 8 +- docs/journal/06-19/index.html | 7 +- docs/journal/06-20/index.html | 12 +- docs/journal/06-21/index.html | 40 +- docs/journal/06-22/index.html | 5 +- docs/journal/06-23/index.html | 30 +- docs/journal/06-24/index.html | 16 +- docs/journal/06-26/index.html | 10 +- docs/journal/06-27/index.html | 7 +- docs/journal/06-29/index.html | 2 +- docs/journal/06-30/index.html | 2 +- docs/journal/07-01/index.html | 4 +- docs/journal/07-03/index.html | 4 +- docs/journal/07-04/index.html | 2 +- docs/journal/07-05/index.html | 2 +- docs/journal/07-06/index.html | 25 +- docs/journal/07-07/index.html | 73 +- docs/journal/07-08/index.html | 2 +- docs/journal/07-09/index.html | 51 +- docs/journal/07-12/index.html | 98 +- docs/journal/07-14/index.html | 25 +- docs/journal/07-16/index.html | 20 +- docs/journal/07-20/index.html | 2 +- docs/journal/07-21/index.html | 2 +- docs/journal/07-22/index.html | 4 +- docs/journal/07-23/index.html | 8 +- docs/journal/07-24/index.html | 8 +- docs/journal/07-25/index.html | 2 +- docs/journal/07-26/index.html | 183 +--- docs/journal/07-27/index.html | 23 +- docs/journal/07-28/index.html | 2 +- docs/journal/07-31/index.html | 138 +-- docs/journal/08-01/index.html | 22 +- docs/journal/08-02/index.html | 4 +- docs/journal/08-03/index.html | 54 +- docs/journal/08-05/index.html | 40 +- docs/journal/08-06/index.html | 22 +- docs/journal/08-07/index.html | 9 +- docs/journal/08-08/index.html | 6 +- docs/journal/08-10/index.html | 8 +- docs/journal/08-11/index.html | 21 +- docs/journal/08-12/index.html | 34 +- docs/journal/08-14/index.html | 39 +- docs/journal/08-16/index.html | 11 +- docs/journal/08-17/index.html | 2 +- docs/journal/08-18/index.html | 2 +- docs/journal/08-19/index.html | 2 +- docs/journal/08-20/index.html | 2 +- docs/journal/08-21/index.html | 2 +- docs/journal/08-22/index.html | 14 +- docs/journal/08-23/index.html | 4 +- docs/journal/08-29/index.html | 14 +- docs/journal/08-30/index.html | 14 +- docs/journal/08-31/index.html | 193 +--- docs/journal/09-02/index.html | 2 +- docs/journal/09-03/index.html | 2 +- docs/journal/09-08/index.html | 2 +- docs/journal/09-10/index.html | 13 +- docs/journal/09-11/index.html | 41 +- docs/journal/09-12/index.html | 18 +- docs/journal/09-13/index.html | 68 +- docs/journal/09-14/index.html | 2 +- docs/journal/09-15/index.html | 41 +- docs/journal/09-16/index.html | 8 +- docs/journal/09-17/index.html | 14 +- docs/journal/09-18/index.html | 2 +- docs/journal/09-19/index.html | 2 +- docs/journal/09-20/index.html | 27 +- docs/journal/09-21/index.html | 7 +- docs/journal/09-22/index.html | 34 +- docs/journal/09-23/index.html | 5 +- docs/journal/09-24/index.html | 35 +- docs/journal/09-25/index.html | 17 +- docs/journal/09-27/index.html | 95 +- docs/journal/09-28/index.html | 105 +- docs/journal/09-29/index.html | 18 +- docs/journal/09-30/index.html | 37 +- docs/journal/10-01/index.html | 64 +- docs/journal/10-02/index.html | 6 +- docs/journal/10-03/index.html | 2 +- docs/journal/10-04/index.html | 2 +- docs/journal/10-05/index.html | 29 +- docs/journal/10-10/index.html | 12 +- docs/journal/10-11/index.html | 2 +- docs/journal/10-12/index.html | 8 +- docs/journal/10-13/index.html | 2 +- docs/journal/10-15/index.html | 2 +- docs/journal/10-16/index.html | 2 +- docs/journal/10-17/index.html | 29 +- docs/journal/10-18/index.html | 31 +- docs/journal/10-19/index.html | 21 +- docs/journal/10-21/index.html | 2 +- docs/journal/10-22/index.html | 2 +- docs/journal/10-24/index.html | 8 +- docs/journal/10-25/index.html | 34 +- docs/journal/10-26/index.html | 19 +- docs/journal/10-27/index.html | 4 +- docs/journal/10-28/index.html | 59 +- docs/journal/10-30/index.html | 4 +- docs/journal/11-01/index.html | 6 +- docs/journal/11-03/index.html | 23 +- docs/journal/11-04/index.html | 15 +- docs/journal/11-09/index.html | 2 +- docs/journal/11-10/index.html | 25 +- docs/journal/11-11/index.html | 4 +- docs/journal/11-12/index.html | 4 +- docs/journal/11-15/index.html | 9 +- docs/journal/11-17/index.html | 5 +- docs/journal/11-20/index.html | 16 +- docs/journal/11-21/index.html | 2 +- docs/journal/11-23/index.html | 2 +- docs/journal/11-24/index.html | 2 +- docs/journal/11-26/index.html | 2 +- docs/journal/11-27/index.html | 12 +- docs/journal/11-28/index.html | 2 +- docs/journal/11-30/index.html | 17 +- docs/journal/12-05/index.html | 13 +- docs/journal/12-12/index.html | 4 +- docs/journal/12-17/index.html | 13 +- docs/journal/12-23/index.html | 2 +- docs/journal/12-24/index.html | 4 +- docs/kanban/index.html | 2 +- docs/legal/privacy/index.html | 4 +- docs/legal/tos/index.html | 4 +- docs/login/index.html | 2 +- docs/logout/index.html | 2 +- docs/music/ambient/index.html | 4 +- docs/music/chillstep/index.html | 4 +- docs/npcdb/citizen/chip/index.html | 4 +- docs/pagefind/fragment/en_1160bb6.pf_fragment | Bin 0 -> 1304 bytes docs/pagefind/fragment/en_11f5292.pf_fragment | Bin 0 -> 11823 bytes docs/pagefind/fragment/en_15e631b.pf_fragment | Bin 3626 -> 0 bytes docs/pagefind/fragment/en_1a8bcd6.pf_fragment | Bin 28137 -> 0 bytes ...22d.pf_fragment => en_1bf915b.pf_fragment} | Bin 990 -> 992 bytes docs/pagefind/fragment/en_1e5ff89.pf_fragment | Bin 0 -> 2816 bytes docs/pagefind/fragment/en_1f80a2b.pf_fragment | Bin 1893 -> 0 bytes ...09e.pf_fragment => en_2387ada.pf_fragment} | Bin 5952 -> 5952 bytes docs/pagefind/fragment/en_2b7769d.pf_fragment | Bin 0 -> 931 bytes docs/pagefind/fragment/en_2d48768.pf_fragment | Bin 0 -> 4738 bytes docs/pagefind/fragment/en_2f30289.pf_fragment | Bin 11192 -> 0 bytes docs/pagefind/fragment/en_3b93323.pf_fragment | Bin 4738 -> 0 bytes docs/pagefind/fragment/en_3bcc61d.pf_fragment | Bin 0 -> 5370 bytes docs/pagefind/fragment/en_424c8f8.pf_fragment | Bin 0 -> 2081 bytes docs/pagefind/fragment/en_42e1aa6.pf_fragment | Bin 0 -> 1808 bytes docs/pagefind/fragment/en_433bf3c.pf_fragment | Bin 0 -> 1915 bytes docs/pagefind/fragment/en_47c0bce.pf_fragment | Bin 0 -> 3629 bytes docs/pagefind/fragment/en_48178ff.pf_fragment | Bin 0 -> 5574 bytes docs/pagefind/fragment/en_5117acc.pf_fragment | Bin 0 -> 2674 bytes docs/pagefind/fragment/en_5135edd.pf_fragment | Bin 3854 -> 0 bytes docs/pagefind/fragment/en_5345d4c.pf_fragment | Bin 2058 -> 0 bytes docs/pagefind/fragment/en_5b88e34.pf_fragment | Bin 544 -> 0 bytes docs/pagefind/fragment/en_5f2378f.pf_fragment | Bin 470 -> 0 bytes docs/pagefind/fragment/en_5fee475.pf_fragment | Bin 2789 -> 0 bytes docs/pagefind/fragment/en_62e1af3.pf_fragment | Bin 6862 -> 0 bytes ...59d.pf_fragment => en_6aa48c8.pf_fragment} | Bin 4737 -> 4739 bytes docs/pagefind/fragment/en_79af9de.pf_fragment | Bin 0 -> 557 bytes docs/pagefind/fragment/en_8245145.pf_fragment | Bin 0 -> 4319 bytes docs/pagefind/fragment/en_8435799.pf_fragment | Bin 11834 -> 0 bytes docs/pagefind/fragment/en_8459b30.pf_fragment | Bin 0 -> 3869 bytes docs/pagefind/fragment/en_8a419b6.pf_fragment | Bin 912 -> 0 bytes docs/pagefind/fragment/en_972cba2.pf_fragment | Bin 3132 -> 0 bytes docs/pagefind/fragment/en_987a39c.pf_fragment | Bin 0 -> 6880 bytes docs/pagefind/fragment/en_a1f28b6.pf_fragment | Bin 0 -> 3172 bytes docs/pagefind/fragment/en_a34f976.pf_fragment | Bin 0 -> 18499 bytes docs/pagefind/fragment/en_a479304.pf_fragment | Bin 4288 -> 0 bytes docs/pagefind/fragment/en_a525b4d.pf_fragment | Bin 1792 -> 0 bytes docs/pagefind/fragment/en_a82c5ad.pf_fragment | Bin 0 -> 11217 bytes docs/pagefind/fragment/en_aa84623.pf_fragment | Bin 5357 -> 0 bytes docs/pagefind/fragment/en_b25d06d.pf_fragment | Bin 0 -> 1650 bytes docs/pagefind/fragment/en_b7bafe9.pf_fragment | Bin 0 -> 28261 bytes docs/pagefind/fragment/en_bdedc41.pf_fragment | Bin 2679 -> 0 bytes docs/pagefind/fragment/en_c3987b6.pf_fragment | Bin 0 -> 2533 bytes docs/pagefind/fragment/en_c5664ae.pf_fragment | Bin 811 -> 0 bytes docs/pagefind/fragment/en_c9a58e4.pf_fragment | Bin 1294 -> 0 bytes docs/pagefind/fragment/en_cde9191.pf_fragment | Bin 0 -> 11860 bytes docs/pagefind/fragment/en_d6d47a3.pf_fragment | Bin 0 -> 828 bytes docs/pagefind/fragment/en_dbf25c6.pf_fragment | Bin 5526 -> 0 bytes docs/pagefind/fragment/en_e091fd5.pf_fragment | Bin 18490 -> 0 bytes docs/pagefind/fragment/en_e19348f.pf_fragment | Bin 11783 -> 0 bytes docs/pagefind/fragment/en_e58e77f.pf_fragment | Bin 2510 -> 0 bytes docs/pagefind/fragment/en_ee7f5ef.pf_fragment | Bin 0 -> 8176 bytes docs/pagefind/fragment/en_fe9e6ff.pf_fragment | Bin 1629 -> 0 bytes docs/pagefind/index/en_1c85b83.pf_index | Bin 14625 -> 0 bytes docs/pagefind/index/en_1d7cde3.pf_index | Bin 0 -> 44272 bytes docs/pagefind/index/en_382451c.pf_index | Bin 44346 -> 0 bytes docs/pagefind/index/en_433a592.pf_index | Bin 41610 -> 0 bytes docs/pagefind/index/en_52494ee.pf_index | Bin 45685 -> 0 bytes docs/pagefind/index/en_58e5e1b.pf_index | Bin 41173 -> 0 bytes docs/pagefind/index/en_5aa213f.pf_index | Bin 0 -> 41027 bytes docs/pagefind/index/en_621a8b9.pf_index | Bin 0 -> 21662 bytes docs/pagefind/index/en_69b43db.pf_index | Bin 41163 -> 0 bytes docs/pagefind/index/en_7fc07ae.pf_index | Bin 0 -> 41395 bytes docs/pagefind/index/en_a33db15.pf_index | Bin 0 -> 40389 bytes docs/pagefind/index/en_a3753f3.pf_index | Bin 0 -> 41276 bytes docs/pagefind/index/en_ac678dd.pf_index | Bin 40407 -> 0 bytes docs/pagefind/index/en_af35eeb.pf_index | Bin 41148 -> 0 bytes docs/pagefind/index/en_bca48cd.pf_index | Bin 0 -> 40186 bytes docs/pagefind/index/en_d1a345a.pf_index | Bin 41378 -> 0 bytes docs/pagefind/index/en_d67323e.pf_index | Bin 0 -> 41515 bytes docs/pagefind/index/en_f486c96.pf_index | Bin 0 -> 40975 bytes docs/pagefind/index/en_f77d37b.pf_index | Bin 0 -> 41125 bytes docs/pagefind/index/en_fb24dfe.pf_index | Bin 40957 -> 0 bytes docs/pagefind/pagefind-entry.json | 2 +- docs/pagefind/pagefind.en_d547daea5d.pf_meta | Bin 0 -> 1307 bytes docs/pagefind/pagefind.en_d6d13f0a05.pf_meta | Bin 1306 -> 0 bytes docs/profile/index.html | 2 +- docs/project/api/index.html | 12 +- docs/project/brackeys/index.html | 29 +- docs/project/graph/index.html | 4 +- docs/project/herbmail/index.html | 4 +- docs/project/lofifocus/index.html | 38 +- docs/project/vip/index.html | 4 +- docs/recipe/mango-juice/index.html | 4 +- docs/register/index.html | 2 +- docs/services/index.html | 38 +- docs/shop/services/data-storage/index.html | 4 +- .../services/software-automation/index.html | 4 +- docs/sitegraph/sitemap.json | 10 +- docs/theory/automation/index.html | 4 +- docs/theory/deadcode/index.html | 8 +- docs/theory/emulation/index.html | 2 +- docs/tools/conch/index.html | 4 +- docs/tools/equipment-care/index.html | 4 +- docs/webmaster/index.html | 122 +-- docs/welcome-to-docs/index.html | 4 +- 409 files changed, 1773 insertions(+), 7834 deletions(-) create mode 100644 docs/_astro/@supabase.CVkg5Wqw.js delete mode 100644 docs/_astro/@supabase.DH5uoBuY.js rename docs/_astro/{DashboardNav.BAymX-kZ.js => DashboardNav.Cwl1Hg0Y.js} (94%) rename docs/_astro/{DevCodeCore.BQoyWod4.js => DevCodeCore.DglLLE_-.js} (97%) rename docs/_astro/{KanbanMenu.Iy5NmxS8.js => KanbanMenu.Z-Py2CVo.js} (94%) rename docs/_astro/{LoginForm.h5vFVMdi.js => LoginForm.BzvLvisg.js} (98%) rename docs/_astro/{ReachProfile.3WAuKRwZ.js => ReachProfile.BTJdxRer.js} (96%) rename docs/_astro/{ReactDashboard.BduIIYcg.js => ReactDashboard._1dPg9dO.js} (97%) rename docs/_astro/{ReactKanban.Awa0CltN.js => ReactKanban.CW5lb4sk.js} (98%) rename docs/_astro/{ReactLogout.Dqo5iiZg.js => ReactLogout.DMynibY9.js} (88%) rename docs/_astro/{ReactUnity.9zefHR_r.js => ReactUnity.CQo0q535.js} (97%) rename docs/_astro/{SupabaseSvelteRegister.DZlZMrro.js => SupabaseSvelteRegister.8VmSQGgW.js} (98%) create mode 100644 docs/_astro/ec.8zarh.js create mode 100644 docs/_astro/ec.tm3va.css rename docs/_astro/{loader.7yziqgW4.js => loader.a1m5Rqtc.js} (91%) rename docs/_astro/{npchandler.Bw6Te69l.js => npchandler.BSw-qpjL.js} (99%) delete mode 100644 docs/_astro/shiki.DPhLURod.js create mode 100644 docs/_astro/shiki.Db3H6uFj.js create mode 100644 docs/pagefind/fragment/en_1160bb6.pf_fragment create mode 100644 docs/pagefind/fragment/en_11f5292.pf_fragment delete mode 100644 docs/pagefind/fragment/en_15e631b.pf_fragment delete mode 100644 docs/pagefind/fragment/en_1a8bcd6.pf_fragment rename docs/pagefind/fragment/{en_a0e522d.pf_fragment => en_1bf915b.pf_fragment} (56%) create mode 100644 docs/pagefind/fragment/en_1e5ff89.pf_fragment delete mode 100644 docs/pagefind/fragment/en_1f80a2b.pf_fragment rename docs/pagefind/fragment/{en_23e309e.pf_fragment => en_2387ada.pf_fragment} (81%) create mode 100644 docs/pagefind/fragment/en_2b7769d.pf_fragment create mode 100644 docs/pagefind/fragment/en_2d48768.pf_fragment delete mode 100644 docs/pagefind/fragment/en_2f30289.pf_fragment delete mode 100644 docs/pagefind/fragment/en_3b93323.pf_fragment create mode 100644 docs/pagefind/fragment/en_3bcc61d.pf_fragment create mode 100644 docs/pagefind/fragment/en_424c8f8.pf_fragment create mode 100644 docs/pagefind/fragment/en_42e1aa6.pf_fragment create mode 100644 docs/pagefind/fragment/en_433bf3c.pf_fragment create mode 100644 docs/pagefind/fragment/en_47c0bce.pf_fragment create mode 100644 docs/pagefind/fragment/en_48178ff.pf_fragment create mode 100644 docs/pagefind/fragment/en_5117acc.pf_fragment delete mode 100644 docs/pagefind/fragment/en_5135edd.pf_fragment delete mode 100644 docs/pagefind/fragment/en_5345d4c.pf_fragment delete mode 100644 docs/pagefind/fragment/en_5b88e34.pf_fragment delete mode 100644 docs/pagefind/fragment/en_5f2378f.pf_fragment delete mode 100644 docs/pagefind/fragment/en_5fee475.pf_fragment delete mode 100644 docs/pagefind/fragment/en_62e1af3.pf_fragment rename docs/pagefind/fragment/{en_94e459d.pf_fragment => en_6aa48c8.pf_fragment} (80%) create mode 100644 docs/pagefind/fragment/en_79af9de.pf_fragment create mode 100644 docs/pagefind/fragment/en_8245145.pf_fragment delete mode 100644 docs/pagefind/fragment/en_8435799.pf_fragment create mode 100644 docs/pagefind/fragment/en_8459b30.pf_fragment delete mode 100644 docs/pagefind/fragment/en_8a419b6.pf_fragment delete mode 100644 docs/pagefind/fragment/en_972cba2.pf_fragment create mode 100644 docs/pagefind/fragment/en_987a39c.pf_fragment create mode 100644 docs/pagefind/fragment/en_a1f28b6.pf_fragment create mode 100644 docs/pagefind/fragment/en_a34f976.pf_fragment delete mode 100644 docs/pagefind/fragment/en_a479304.pf_fragment delete mode 100644 docs/pagefind/fragment/en_a525b4d.pf_fragment create mode 100644 docs/pagefind/fragment/en_a82c5ad.pf_fragment delete mode 100644 docs/pagefind/fragment/en_aa84623.pf_fragment create mode 100644 docs/pagefind/fragment/en_b25d06d.pf_fragment create mode 100644 docs/pagefind/fragment/en_b7bafe9.pf_fragment delete mode 100644 docs/pagefind/fragment/en_bdedc41.pf_fragment create mode 100644 docs/pagefind/fragment/en_c3987b6.pf_fragment delete mode 100644 docs/pagefind/fragment/en_c5664ae.pf_fragment delete mode 100644 docs/pagefind/fragment/en_c9a58e4.pf_fragment create mode 100644 docs/pagefind/fragment/en_cde9191.pf_fragment create mode 100644 docs/pagefind/fragment/en_d6d47a3.pf_fragment delete mode 100644 docs/pagefind/fragment/en_dbf25c6.pf_fragment delete mode 100644 docs/pagefind/fragment/en_e091fd5.pf_fragment delete mode 100644 docs/pagefind/fragment/en_e19348f.pf_fragment delete mode 100644 docs/pagefind/fragment/en_e58e77f.pf_fragment create mode 100644 docs/pagefind/fragment/en_ee7f5ef.pf_fragment delete mode 100644 docs/pagefind/fragment/en_fe9e6ff.pf_fragment delete mode 100644 docs/pagefind/index/en_1c85b83.pf_index create mode 100644 docs/pagefind/index/en_1d7cde3.pf_index delete mode 100644 docs/pagefind/index/en_382451c.pf_index delete mode 100644 docs/pagefind/index/en_433a592.pf_index delete mode 100644 docs/pagefind/index/en_52494ee.pf_index delete mode 100644 docs/pagefind/index/en_58e5e1b.pf_index create mode 100644 docs/pagefind/index/en_5aa213f.pf_index create mode 100644 docs/pagefind/index/en_621a8b9.pf_index delete mode 100644 docs/pagefind/index/en_69b43db.pf_index create mode 100644 docs/pagefind/index/en_7fc07ae.pf_index create mode 100644 docs/pagefind/index/en_a33db15.pf_index create mode 100644 docs/pagefind/index/en_a3753f3.pf_index delete mode 100644 docs/pagefind/index/en_ac678dd.pf_index delete mode 100644 docs/pagefind/index/en_af35eeb.pf_index create mode 100644 docs/pagefind/index/en_bca48cd.pf_index delete mode 100644 docs/pagefind/index/en_d1a345a.pf_index create mode 100644 docs/pagefind/index/en_d67323e.pf_index create mode 100644 docs/pagefind/index/en_f486c96.pf_index create mode 100644 docs/pagefind/index/en_f77d37b.pf_index delete mode 100644 docs/pagefind/index/en_fb24dfe.pf_index create mode 100644 docs/pagefind/pagefind.en_d547daea5d.pf_meta delete mode 100644 docs/pagefind/pagefind.en_d6d13f0a05.pf_meta diff --git a/docs/_astro/@supabase.CVkg5Wqw.js b/docs/_astro/@supabase.CVkg5Wqw.js new file mode 100644 index 0000000000..9fd8cb8a76 --- /dev/null +++ b/docs/_astro/@supabase.CVkg5Wqw.js @@ -0,0 +1,7 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_astro/ws.BkT5Wpo5.js","_astro/@react-three.BOv1JqT7.js","_astro/react.C2V1wh_4.js"])))=>i.map(i=>d[i]); +import{g as vt,a as yt}from"./@react-three.BOv1JqT7.js";import{_ as Q}from"./Page.astro_astro_type_script_index_0_lang.COYkzBTz.js";const wt=n=>{let e;return n?e=n:typeof fetch>"u"?e=(...t)=>Q(async()=>{const{default:s}=await Promise.resolve().then(()=>X);return{default:s}},void 0).then(({default:s})=>s(...t)):e=fetch,(...t)=>e(...t)};class Ee extends Error{constructor(e,t="FunctionsError",s){super(e),this.name=t,this.context=s}}class mt extends Ee{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class bt extends Ee{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class kt extends Ee{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var ye;(function(n){n.Any="any",n.ApNortheast1="ap-northeast-1",n.ApNortheast2="ap-northeast-2",n.ApSouth1="ap-south-1",n.ApSoutheast1="ap-southeast-1",n.ApSoutheast2="ap-southeast-2",n.CaCentral1="ca-central-1",n.EuCentral1="eu-central-1",n.EuWest1="eu-west-1",n.EuWest2="eu-west-2",n.EuWest3="eu-west-3",n.SaEast1="sa-east-1",n.UsEast1="us-east-1",n.UsWest1="us-west-1",n.UsWest2="us-west-2"})(ye||(ye={}));var St=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{h(s.next(l))}catch(u){o(u)}}function c(l){try{h(s.throw(l))}catch(u){o(u)}}function h(l){l.done?i(l.value):r(l.value).then(a,c)}h((s=s.apply(n,e||[])).next())})};class Tt{constructor(e,{headers:t={},customFetch:s,region:r=ye.Any}={}){this.url=e,this.headers=t,this.region=r,this.fetch=wt(s)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var s;return St(this,void 0,void 0,function*(){try{const{headers:r,method:i,body:o}=t;let a={},{region:c}=t;c||(c=this.region),c&&c!=="any"&&(a["x-region"]=c);let h;o&&(r&&!Object.prototype.hasOwnProperty.call(r,"Content-Type")||!r)&&(typeof Blob<"u"&&o instanceof Blob||o instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",h=o):typeof o=="string"?(a["Content-Type"]="text/plain",h=o):typeof FormData<"u"&&o instanceof FormData?h=o:(a["Content-Type"]="application/json",h=JSON.stringify(o)));const l=yield this.fetch(`${this.url}/${e}`,{method:i||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),r),body:h}).catch(g=>{throw new mt(g)}),u=l.headers.get("x-relay-error");if(u&&u==="true")throw new bt(l);if(!l.ok)throw new kt(l);let d=((s=l.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),f;return d==="application/json"?f=yield l.json():d==="application/octet-stream"?f=yield l.blob():d==="text/event-stream"?f=l:d==="multipart/form-data"?f=yield l.formData():f=yield l.text(),{data:f,error:null}}catch(r){return{data:null,error:r}}})}}var m={},F={},M={},z={},J={},H={},Et=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},Y=Et();const Ot=Y.fetch,Ze=Y.fetch.bind(Y),et=Y.Headers,Pt=Y.Request,jt=Y.Response,X=Object.freeze(Object.defineProperty({__proto__:null,Headers:et,Request:Pt,Response:jt,default:Ze,fetch:Ot},Symbol.toStringTag,{value:"Module"})),$t=vt(X);var ae={},Ae;function tt(){if(Ae)return ae;Ae=1,Object.defineProperty(ae,"__esModule",{value:!0});class n extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}}return ae.default=n,ae}var Re;function st(){if(Re)return H;Re=1;var n=H&&H.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(H,"__esModule",{value:!0});const e=n($t),t=n(tt());class s{constructor(i){this.shouldThrowOnError=!1,this.method=i.method,this.url=i.url,this.headers=i.headers,this.schema=i.schema,this.body=i.body,this.shouldThrowOnError=i.shouldThrowOnError,this.signal=i.signal,this.isMaybeSingle=i.isMaybeSingle,i.fetch?this.fetch=i.fetch:typeof fetch>"u"?this.fetch=e.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(i,o){return this.headers=Object.assign({},this.headers),this.headers[i]=o,this}then(i,o){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const a=this.fetch;let c=a(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async h=>{var l,u,d;let f=null,g=null,y=null,_=h.status,E=h.statusText;if(h.ok){if(this.method!=="HEAD"){const T=await h.text();T===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?g=T:g=JSON.parse(T))}const k=(l=this.headers.Prefer)===null||l===void 0?void 0:l.match(/count=(exact|planned|estimated)/),S=(u=h.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");k&&S&&S.length>1&&(y=parseInt(S[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(g)&&(g.length>1?(f={code:"PGRST116",details:`Results contain ${g.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},g=null,y=null,_=406,E="Not Acceptable"):g.length===1?g=g[0]:g=null)}else{const k=await h.text();try{f=JSON.parse(k),Array.isArray(f)&&h.status===404&&(g=[],f=null,_=200,E="OK")}catch{h.status===404&&k===""?(_=204,E="No Content"):f={message:k}}if(f&&this.isMaybeSingle&&(!((d=f?.details)===null||d===void 0)&&d.includes("0 rows"))&&(f=null,_=200,E="OK"),f&&this.shouldThrowOnError)throw new t.default(f)}return{error:f,data:g,count:y,status:_,statusText:E}});return this.shouldThrowOnError||(c=c.catch(h=>{var l,u,d;return{error:{message:`${(l=h?.name)!==null&&l!==void 0?l:"FetchError"}: ${h?.message}`,details:`${(u=h?.stack)!==null&&u!==void 0?u:""}`,hint:"",code:`${(d=h?.code)!==null&&d!==void 0?d:""}`},data:null,count:null,status:0,statusText:""}})),c.then(i,o)}}return H.default=s,H}var Ce;function rt(){if(Ce)return J;Ce=1;var n=J&&J.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(J,"__esModule",{value:!0});const e=n(st());class t extends e.default{select(r){let i=!1;const o=(r??"*").split("").map(a=>/\s/.test(a)&&!i?"":(a==='"'&&(i=!i),a)).join("");return this.url.searchParams.set("select",o),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(r,{ascending:i=!0,nullsFirst:o,foreignTable:a,referencedTable:c=a}={}){const h=c?`${c}.order`:"order",l=this.url.searchParams.get(h);return this.url.searchParams.set(h,`${l?`${l},`:""}${r}.${i?"asc":"desc"}${o===void 0?"":o?".nullsfirst":".nullslast"}`),this}limit(r,{foreignTable:i,referencedTable:o=i}={}){const a=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(a,`${r}`),this}range(r,i,{foreignTable:o,referencedTable:a=o}={}){const c=typeof a>"u"?"offset":`${a}.offset`,h=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(c,`${r}`),this.url.searchParams.set(h,`${i-r+1}`),this}abortSignal(r){return this.signal=r,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?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:r=!1,verbose:i=!1,settings:o=!1,buffers:a=!1,wal:c=!1,format:h="text"}={}){var l;const u=[r?"analyze":null,i?"verbose":null,o?"settings":null,a?"buffers":null,c?"wal":null].filter(Boolean).join("|"),d=(l=this.headers.Accept)!==null&&l!==void 0?l:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${h}; for="${d}"; options=${u};`,h==="json"?this:this}rollback(){var r;return((r=this.headers.Prefer)!==null&&r!==void 0?r:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}}return J.default=t,J}var xe;function Oe(){if(xe)return z;xe=1;var n=z&&z.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(z,"__esModule",{value:!0});const e=n(rt());class t extends e.default{eq(r,i){return this.url.searchParams.append(r,`eq.${i}`),this}neq(r,i){return this.url.searchParams.append(r,`neq.${i}`),this}gt(r,i){return this.url.searchParams.append(r,`gt.${i}`),this}gte(r,i){return this.url.searchParams.append(r,`gte.${i}`),this}lt(r,i){return this.url.searchParams.append(r,`lt.${i}`),this}lte(r,i){return this.url.searchParams.append(r,`lte.${i}`),this}like(r,i){return this.url.searchParams.append(r,`like.${i}`),this}likeAllOf(r,i){return this.url.searchParams.append(r,`like(all).{${i.join(",")}}`),this}likeAnyOf(r,i){return this.url.searchParams.append(r,`like(any).{${i.join(",")}}`),this}ilike(r,i){return this.url.searchParams.append(r,`ilike.${i}`),this}ilikeAllOf(r,i){return this.url.searchParams.append(r,`ilike(all).{${i.join(",")}}`),this}ilikeAnyOf(r,i){return this.url.searchParams.append(r,`ilike(any).{${i.join(",")}}`),this}is(r,i){return this.url.searchParams.append(r,`is.${i}`),this}in(r,i){const o=Array.from(new Set(i)).map(a=>typeof a=="string"&&new RegExp("[,()]").test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(r,`in.(${o})`),this}contains(r,i){return typeof i=="string"?this.url.searchParams.append(r,`cs.${i}`):Array.isArray(i)?this.url.searchParams.append(r,`cs.{${i.join(",")}}`):this.url.searchParams.append(r,`cs.${JSON.stringify(i)}`),this}containedBy(r,i){return typeof i=="string"?this.url.searchParams.append(r,`cd.${i}`):Array.isArray(i)?this.url.searchParams.append(r,`cd.{${i.join(",")}}`):this.url.searchParams.append(r,`cd.${JSON.stringify(i)}`),this}rangeGt(r,i){return this.url.searchParams.append(r,`sr.${i}`),this}rangeGte(r,i){return this.url.searchParams.append(r,`nxl.${i}`),this}rangeLt(r,i){return this.url.searchParams.append(r,`sl.${i}`),this}rangeLte(r,i){return this.url.searchParams.append(r,`nxr.${i}`),this}rangeAdjacent(r,i){return this.url.searchParams.append(r,`adj.${i}`),this}overlaps(r,i){return typeof i=="string"?this.url.searchParams.append(r,`ov.${i}`):this.url.searchParams.append(r,`ov.{${i.join(",")}}`),this}textSearch(r,i,{config:o,type:a}={}){let c="";a==="plain"?c="pl":a==="phrase"?c="ph":a==="websearch"&&(c="w");const h=o===void 0?"":`(${o})`;return this.url.searchParams.append(r,`${c}fts${h}.${i}`),this}match(r){return Object.entries(r).forEach(([i,o])=>{this.url.searchParams.append(i,`eq.${o}`)}),this}not(r,i,o){return this.url.searchParams.append(r,`not.${i}.${o}`),this}or(r,{foreignTable:i,referencedTable:o=i}={}){const a=o?`${o}.or`:"or";return this.url.searchParams.append(a,`(${r})`),this}filter(r,i,o){return this.url.searchParams.append(r,`${i}.${o}`),this}}return z.default=t,z}var Ie;function it(){if(Ie)return M;Ie=1;var n=M&&M.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(M,"__esModule",{value:!0});const e=n(Oe());class t{constructor(r,{headers:i={},schema:o,fetch:a}){this.url=r,this.headers=i,this.schema=o,this.fetch=a}select(r,{head:i=!1,count:o}={}){const a=i?"HEAD":"GET";let c=!1;const h=(r??"*").split("").map(l=>/\s/.test(l)&&!c?"":(l==='"'&&(c=!c),l)).join("");return this.url.searchParams.set("select",h),o&&(this.headers.Prefer=`count=${o}`),new e.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(r,{count:i,defaultToNull:o=!0}={}){const a="POST",c=[];if(this.headers.Prefer&&c.push(this.headers.Prefer),i&&c.push(`count=${i}`),o||c.push("missing=default"),this.headers.Prefer=c.join(","),Array.isArray(r)){const h=r.reduce((l,u)=>l.concat(Object.keys(u)),[]);if(h.length>0){const l=[...new Set(h)].map(u=>`"${u}"`);this.url.searchParams.set("columns",l.join(","))}}return new e.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:r,fetch:this.fetch,allowEmpty:!1})}upsert(r,{onConflict:i,ignoreDuplicates:o=!1,count:a,defaultToNull:c=!0}={}){const h="POST",l=[`resolution=${o?"ignore":"merge"}-duplicates`];if(i!==void 0&&this.url.searchParams.set("on_conflict",i),this.headers.Prefer&&l.push(this.headers.Prefer),a&&l.push(`count=${a}`),c||l.push("missing=default"),this.headers.Prefer=l.join(","),Array.isArray(r)){const u=r.reduce((d,f)=>d.concat(Object.keys(f)),[]);if(u.length>0){const d=[...new Set(u)].map(f=>`"${f}"`);this.url.searchParams.set("columns",d.join(","))}}return new e.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:r,fetch:this.fetch,allowEmpty:!1})}update(r,{count:i}={}){const o="PATCH",a=[];return this.headers.Prefer&&a.push(this.headers.Prefer),i&&a.push(`count=${i}`),this.headers.Prefer=a.join(","),new e.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:r,fetch:this.fetch,allowEmpty:!1})}delete({count:r}={}){const i="DELETE",o=[];return r&&o.push(`count=${r}`),this.headers.Prefer&&o.unshift(this.headers.Prefer),this.headers.Prefer=o.join(","),new e.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}}return M.default=t,M}var Z={},ee={},Le;function At(){return Le||(Le=1,Object.defineProperty(ee,"__esModule",{value:!0}),ee.version=void 0,ee.version="0.0.0-automated"),ee}var Ue;function Rt(){if(Ue)return Z;Ue=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.DEFAULT_HEADERS=void 0;const n=At();return Z.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${n.version}`},Z}var De;function Ct(){if(De)return F;De=1;var n=F&&F.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(F,"__esModule",{value:!0});const e=n(it()),t=n(Oe()),s=Rt();class r{constructor(o,{headers:a={},schema:c,fetch:h}={}){this.url=o,this.headers=Object.assign(Object.assign({},s.DEFAULT_HEADERS),a),this.schemaName=c,this.fetch=h}from(o){const a=new URL(`${this.url}/${o}`);return new e.default(a,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(o){return new r(this.url,{headers:this.headers,schema:o,fetch:this.fetch})}rpc(o,a={},{head:c=!1,get:h=!1,count:l}={}){let u;const d=new URL(`${this.url}/rpc/${o}`);let f;c||h?(u=c?"HEAD":"GET",Object.entries(a).filter(([y,_])=>_!==void 0).map(([y,_])=>[y,Array.isArray(_)?`{${_.join(",")}}`:`${_}`]).forEach(([y,_])=>{d.searchParams.append(y,_)})):(u="POST",f=a);const g=Object.assign({},this.headers);return l&&(g.Prefer=`count=${l}`),new t.default({method:u,url:d,headers:g,schema:this.schemaName,body:f,fetch:this.fetch,allowEmpty:!1})}}return F.default=r,F}var Be;function xt(){if(Be)return m;Be=1;var n=m&&m.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(m,"__esModule",{value:!0}),m.PostgrestError=m.PostgrestBuilder=m.PostgrestTransformBuilder=m.PostgrestFilterBuilder=m.PostgrestQueryBuilder=m.PostgrestClient=void 0;const e=n(Ct());m.PostgrestClient=e.default;const t=n(it());m.PostgrestQueryBuilder=t.default;const s=n(Oe());m.PostgrestFilterBuilder=s.default;const r=n(rt());m.PostgrestTransformBuilder=r.default;const i=n(st());m.PostgrestBuilder=i.default;const o=n(tt());return m.PostgrestError=o.default,m.default={PostgrestClient:e.default,PostgrestQueryBuilder:t.default,PostgrestFilterBuilder:s.default,PostgrestTransformBuilder:r.default,PostgrestBuilder:i.default,PostgrestError:o.default},m}var It=xt();const Lt=yt(It),{PostgrestClient:Ut,PostgrestQueryBuilder:fr,PostgrestFilterBuilder:gr,PostgrestTransformBuilder:pr,PostgrestBuilder:_r,PostgrestError:vr}=Lt,Dt="2.11.2",Bt={"X-Client-Info":`realtime-js/${Dt}`},Nt="1.0.0",nt=1e4,qt=1e3;var W;(function(n){n[n.connecting=0]="connecting",n[n.open=1]="open",n[n.closing=2]="closing",n[n.closed=3]="closed"})(W||(W={}));var P;(function(n){n.closed="closed",n.errored="errored",n.joined="joined",n.joining="joining",n.leaving="leaving"})(P||(P={}));var j;(function(n){n.close="phx_close",n.error="phx_error",n.join="phx_join",n.reply="phx_reply",n.leave="phx_leave",n.access_token="access_token"})(j||(j={}));var we;(function(n){n.websocket="websocket"})(we||(we={}));var B;(function(n){n.Connecting="connecting",n.Open="open",n.Closing="closing",n.Closed="closed"})(B||(B={}));class Ft{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):t(typeof e=="string"?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 o=this.HEADER_LENGTH+2;const a=s.decode(e.slice(o,o+r));o=o+r;const c=s.decode(e.slice(o,o+i));o=o+i;const h=JSON.parse(s.decode(e.slice(o,e.byteLength)));return{ref:null,topic:a,event:c,payload:h}}}class ot{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))}}var w;(function(n){n.abstime="abstime",n.bool="bool",n.date="date",n.daterange="daterange",n.float4="float4",n.float8="float8",n.int2="int2",n.int4="int4",n.int4range="int4range",n.int8="int8",n.int8range="int8range",n.json="json",n.jsonb="jsonb",n.money="money",n.numeric="numeric",n.oid="oid",n.reltime="reltime",n.text="text",n.time="time",n.timestamp="timestamp",n.timestamptz="timestamptz",n.timetz="timetz",n.tsrange="tsrange",n.tstzrange="tstzrange"})(w||(w={}));const Ne=(n,e,t={})=>{var s;const r=(s=t.skipTypes)!==null&&s!==void 0?s:[];return Object.keys(e).reduce((i,o)=>(i[o]=Mt(o,n,e,r),i),{})},Mt=(n,e,t,s)=>{const r=e.find(a=>a.name===n),i=r?.type,o=t[n];return i&&!s.includes(i)?at(i,o):me(o)},at=(n,e)=>{if(n.charAt(0)==="_"){const t=n.slice(1,n.length);return Gt(e,t)}switch(n){case w.bool:return zt(e);case w.float4:case w.float8:case w.int2:case w.int4:case w.int8:case w.numeric:case w.oid:return Jt(e);case w.json:case w.jsonb:return Ht(e);case w.timestamp:return Kt(e);case w.abstime:case w.date:case w.daterange:case w.int4range:case w.int8range:case w.money:case w.reltime:case w.text:case w.time:case w.timestamptz:case w.timetz:case w.tsrange:case w.tstzrange:return me(e);default:return me(e)}},me=n=>n,zt=n=>{switch(n){case"t":return!0;case"f":return!1;default:return n}},Jt=n=>{if(typeof n=="string"){const e=parseFloat(n);if(!Number.isNaN(e))return e}return n},Ht=n=>{if(typeof n=="string")try{return JSON.parse(n)}catch(e){return console.log(`JSON parse error: ${e}`),n}return n},Gt=(n,e)=>{if(typeof n!="string")return n;const t=n.length-1,s=n[t];if(n[0]==="{"&&s==="}"){let i;const o=n.slice(1,t);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(a=>at(e,a))}return n},Kt=n=>typeof n=="string"?n.replace(" ","T"):n,ct=n=>{let e=n;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")};class ge{constructor(e,t,s={},r=nt){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((s=this.receivedResp)===null||s===void 0?void 0:s.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=t=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=t,this._matchReceive(t)};this.channel._on(this.refEvent,{},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(s=>s.status===e).forEach(s=>s.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var qe;(function(n){n.SYNC="sync",n.JOIN="join",n.LEAVE="leave"})(qe||(qe={}));class re{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const s=t?.events||{state:"presence_state",diff:"presence_diff"};this.channel._on(s.state,{},r=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel._joinRef(),this.state=re.syncState(this.state,r,i,o),this.pendingDiffs.forEach(c=>{this.state=re.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],a()}),this.channel._on(s.diff,{},r=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(r):(this.state=re.syncDiff(this.state,r,i,o),a())}),this.onJoin((r,i,o)=>{this.channel._trigger("presence",{event:"join",key:r,currentPresences:i,newPresences:o})}),this.onLeave((r,i,o)=>{this.channel._trigger("presence",{event:"leave",key:r,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,s,r){const i=this.cloneDeep(e),o=this.transformState(t),a={},c={};return this.map(i,(h,l)=>{o[h]||(c[h]=l)}),this.map(o,(h,l)=>{const u=i[h];if(u){const d=l.map(_=>_.presence_ref),f=u.map(_=>_.presence_ref),g=l.filter(_=>f.indexOf(_.presence_ref)<0),y=u.filter(_=>d.indexOf(_.presence_ref)<0);g.length>0&&(a[h]=g),y.length>0&&(c[h]=y)}else a[h]=l}),this.syncDiff(i,{joins:a,leaves:c},s,r)}static syncDiff(e,t,s,r){const{joins:i,leaves:o}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return s||(s=()=>{}),r||(r=()=>{}),this.map(i,(a,c)=>{var h;const l=(h=e[a])!==null&&h!==void 0?h:[];if(e[a]=this.cloneDeep(c),l.length>0){const u=e[a].map(f=>f.presence_ref),d=l.filter(f=>u.indexOf(f.presence_ref)<0);e[a].unshift(...d)}s(a,l,c)}),this.map(o,(a,c)=>{let h=e[a];if(!h)return;const l=c.map(u=>u.presence_ref);h=h.filter(u=>l.indexOf(u.presence_ref)<0),e[a]=h,r(a,h,c),h.length===0&&delete e[a]}),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"metas"in r?t[s]=r.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):t[s]=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()}}var Fe;(function(n){n.ALL="*",n.INSERT="INSERT",n.UPDATE="UPDATE",n.DELETE="DELETE"})(Fe||(Fe={}));var Me;(function(n){n.BROADCAST="broadcast",n.PRESENCE="presence",n.POSTGRES_CHANGES="postgres_changes",n.SYSTEM="system"})(Me||(Me={}));var R;(function(n){n.SUBSCRIBED="SUBSCRIBED",n.TIMED_OUT="TIMED_OUT",n.CLOSED="CLOSED",n.CHANNEL_ERROR="CHANNEL_ERROR"})(R||(R={}));class Pe{constructor(e,t={config:{}},s){this.topic=e,this.params=t,this.socket=s,this.bindings={},this.state=P.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},t.config),this.timeout=this.socket.timeout,this.joinPush=new ge(this,j.join,this.params,this.timeout),this.rejoinTimer=new ot(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=P.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=P.closed,this.socket._remove(this)}),this._onError(r=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,r),this.state=P.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=P.errored,this.rejoinTimer.scheduleTimeout())}),this._on(j.reply,{},(r,i)=>{this._trigger(this._replyEventName(i),r)}),this.presence=new re(this),this.broadcastEndpointURL=ct(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}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:o,private:a}}=this.params;this._onError(l=>e?.(R.CHANNEL_ERROR,l)),this._onClose(()=>e?.(R.CLOSED));const c={},h={broadcast:i,presence:o,postgres_changes:(r=(s=this.bindings.postgres_changes)===null||s===void 0?void 0:s.map(l=>l.filter))!==null&&r!==void 0?r:[],private:a};this.socket.accessTokenValue&&(c.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:h},c)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",async({postgres_changes:l})=>{var u;if(this.socket.setAuth(),l===void 0){e?.(R.SUBSCRIBED);return}else{const d=this.bindings.postgres_changes,f=(u=d?.length)!==null&&u!==void 0?u:0,g=[];for(let y=0;y{e?.(R.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(l).join(", ")||"error")))}).receive("timeout",()=>{e?.(R.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()&&e.type==="broadcast"){const{event:i,payload:o}=e,c={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const h=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(s=t.timeout)!==null&&s!==void 0?s:this.timeout);return await((r=h.body)===null||r===void 0?void 0:r.cancel()),h.ok?"ok":"error"}catch(h){return h.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,c;const h=this._push(e.type,e,t.timeout||this.timeout);e.type==="broadcast"&&!(!((c=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||c===void 0)&&c.ack)&&i("ok"),h.receive("ok",()=>i("ok")),h.receive("error",()=>i("error")),h.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=P.leaving;const t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(j.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(s=>{const r=new ge(this,j.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",{})})}async _fetchWithTimeout(e,t,s){const r=new AbortController,i=setTimeout(()=>r.abort(),s),o=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(i),o}_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 ge(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 o=e.toLocaleLowerCase(),{close:a,error:c,leave:h,join:l}=j;if(s&&[a,c,h,l].indexOf(o)>=0&&s!==this._joinRef())return;let d=this._onMessage(o,t,s);if(t&&!d)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(r=this.bindings.postgres_changes)===null||r===void 0||r.filter(f=>{var g,y,_;return((g=f.filter)===null||g===void 0?void 0:g.event)==="*"||((_=(y=f.filter)===null||y===void 0?void 0:y.event)===null||_===void 0?void 0:_.toLocaleLowerCase())===o}).map(f=>f.callback(d,s)):(i=this.bindings[o])===null||i===void 0||i.filter(f=>{var g,y,_,E,$,k;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in f){const S=f.id,T=(g=f.filter)===null||g===void 0?void 0:g.event;return S&&((y=t.ids)===null||y===void 0?void 0:y.includes(S))&&(T==="*"||T?.toLocaleLowerCase()===((_=t.data)===null||_===void 0?void 0:_.type.toLocaleLowerCase()))}else{const S=($=(E=f?.filter)===null||E===void 0?void 0:E.event)===null||$===void 0?void 0:$.toLocaleLowerCase();return S==="*"||S===((k=t?.event)===null||k===void 0?void 0:k.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===o}).map(f=>{if(typeof d=="object"&&"ids"in d){const g=d.data,{schema:y,table:_,commit_timestamp:E,type:$,errors:k}=g;d=Object.assign(Object.assign({},{schema:y,table:_,commit_timestamp:E,eventType:$,new:{},old:{},errors:k}),this._getPayloadRecords(g))}f.callback(d,s)})}_isClosed(){return this.state===P.closed}_isJoined(){return this.state===P.joined}_isJoining(){return this.state===P.joining}_isLeaving(){return this.state===P.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(r=>{var i;return!(((i=r.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===s&&Pe.isEqual(r.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(j.close,{},e)}_onError(e){this._on(j.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=P.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const t={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(t.new=Ne(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(t.old=Ne(e.columns,e.old_record)),t}}const Vt=()=>{},Wt=typeof WebSocket<"u",Qt=` + addEventListener("message", (e) => { + if (e.data.event === "start") { + setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); + } + });`;class Yt{constructor(e,t){var s;this.accessTokenValue=null,this.apiKey=null,this.channels=[],this.endPoint="",this.httpEndpoint="",this.headers=Bt,this.params={},this.timeout=nt,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=Vt,this.conn=null,this.sendBuffer=[],this.serializer=new Ft,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=i=>{let o;return i?o=i:typeof fetch>"u"?o=(...a)=>Q(async()=>{const{default:c}=await Promise.resolve().then(()=>X);return{default:c}},void 0).then(({default:c})=>c(...a)):o=fetch,(...a)=>o(...a)},this.endPoint=`${e}/${we.websocket}`,this.httpEndpoint=ct(e),t?.transport?this.transport=t.transport:this.transport=null,t?.params&&(this.params=t.params),t?.headers&&(this.headers=Object.assign(Object.assign({},this.headers),t.headers)),t?.timeout&&(this.timeout=t.timeout),t?.logger&&(this.logger=t.logger),t?.heartbeatIntervalMs&&(this.heartbeatIntervalMs=t.heartbeatIntervalMs);const r=(s=t?.params)===null||s===void 0?void 0:s.apikey;if(r&&(this.accessTokenValue=r,this.apiKey=r),this.reconnectAfterMs=t?.reconnectAfterMs?t.reconnectAfterMs:i=>[1e3,2e3,5e3,1e4][i-1]||1e4,this.encode=t?.encode?t.encode:(i,o)=>o(JSON.stringify(i)),this.decode=t?.decode?t.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new ot(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(t?.fetch),t?.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=t?.worker||!1,this.workerUrl=t?.workerUrl}this.accessToken=t?.accessToken||null}connect(){if(!this.conn){if(this.transport){this.conn=new this.transport(this.endpointURL(),void 0,{headers:this.headers});return}if(Wt){this.conn=new WebSocket(this.endpointURL()),this.setupConnection();return}this.conn=new Xt(this.endpointURL(),void 0,{close:()=>{this.conn=null}}),Q(async()=>{const{default:e}=await import("./ws.BkT5Wpo5.js").then(t=>t.b);return{default:e}},__vite__mapDeps([0,1,2])).then(({default:e})=>{this.conn=new e(this.endpointURL(),void 0,{headers:this.headers}),this.setupConnection()})}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:Nt}))}disconnect(e,t){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,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 this.channels.length===0&&this.disconnect(),t}async removeAllChannels(){const e=await Promise.all(this.channels.map(t=>t.unsubscribe()));return this.disconnect(),e}log(e,t,s){this.logger(e,t,s)}connectionState(){switch(this.conn&&this.conn.readyState){case W.connecting:return B.Connecting;case W.open:return B.Open;case W.closing:return B.Closing;default:return B.Closed}}isConnected(){return this.connectionState()===B.Open}channel(e,t={config:{}}){const s=new Pe(`realtime:${e}`,t,this);return this.channels.push(s),s}push(e){const{topic:t,event:s,payload:r,ref:i}=e,o=()=>{this.encode(e,a=>{var c;(c=this.conn)===null||c===void 0||c.send(a)})};this.log("push",`${t} ${s} (${i})`,r),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(e=null){let t=e||this.accessToken&&await this.accessToken()||this.accessTokenValue;if(t){let s=null;try{s=JSON.parse(atob(t.split(".")[1]))}catch{}if(s&&s.exp&&!(Math.floor(Date.now()/1e3)-s.exp<0))return this.log("auth",`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${s.exp}`),Promise.reject(`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${s.exp}`);this.accessTokenValue=t,this.channels.forEach(r=>{t&&r.updateJoinPayload({access_token:t}),r.joinedOnce&&r._isJoined()&&r._push(j.access_token,{access_token:t})})}}async sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),(e=this.conn)===null||e===void 0||e.close(qt,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth()}}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_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(s=>s.topic===e&&(s._isJoined()||s._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))}_onConnMessage(e){this.decode(e.data,t=>{let{topic:s,event:r,payload:i,ref:o}=t;o&&o===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${i.status||""} ${s} ${r} ${o&&"("+o+")"||""}`,i),this.channels.filter(a=>a._isMember(s)).forEach(a=>a._trigger(r,i,o)),this.stateChangeCallbacks.message.forEach(a=>a(t))})}async _onConnOpen(){if(this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),!this.worker)this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs);else{this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=t=>{this.log("worker","worker error",t.message),this.workerRef.terminate()},this.workerRef.onmessage=t=>{t.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval: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(j.error))}_appendParams(e,t){if(Object.keys(t).length===0)return e;const s=e.match(/\?/)?"&":"?",r=new URLSearchParams(t);return`${e}${s}${r}`}_workerObjectUrl(e){let t;if(e)t=e;else{const s=new Blob([Qt],{type:"application/javascript"});t=URL.createObjectURL(s)}return t}}class Xt{constructor(e,t,s){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=W.connecting,this.send=()=>{},this.url=null,this.url=e,this.close=s.close}}class je extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function b(n){return typeof n=="object"&&n!==null&&"__isStorageError"in n}class Zt extends je{constructor(e,t){super(e),this.name="StorageApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class be extends je{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}var es=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{h(s.next(l))}catch(u){o(u)}}function c(l){try{h(s.throw(l))}catch(u){o(u)}}function h(l){l.done?i(l.value):r(l.value).then(a,c)}h((s=s.apply(n,e||[])).next())})};const lt=n=>{let e;return n?e=n:typeof fetch>"u"?e=(...t)=>Q(async()=>{const{default:s}=await Promise.resolve().then(()=>X);return{default:s}},void 0).then(({default:s})=>s(...t)):e=fetch,(...t)=>e(...t)},ts=()=>es(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Q(()=>Promise.resolve().then(()=>X),void 0)).Response:Response}),ke=n=>{if(Array.isArray(n))return n.map(t=>ke(t));if(typeof n=="function"||n!==Object(n))return n;const e={};return Object.entries(n).forEach(([t,s])=>{const r=t.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[r]=ke(s)}),e};var N=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{h(s.next(l))}catch(u){o(u)}}function c(l){try{h(s.throw(l))}catch(u){o(u)}}function h(l){l.done?i(l.value):r(l.value).then(a,c)}h((s=s.apply(n,e||[])).next())})};const pe=n=>n.msg||n.message||n.error_description||n.error||JSON.stringify(n),ss=(n,e,t)=>N(void 0,void 0,void 0,function*(){const s=yield ts();n instanceof s&&!t?.noResolveJson?n.json().then(r=>{e(new Zt(pe(r),n.status||500))}).catch(r=>{e(new be(pe(r),r))}):e(new be(pe(n),n))}),rs=(n,e,t,s)=>{const r={method:n,headers:e?.headers||{}};return n==="GET"?r:(r.headers=Object.assign({"Content-Type":"application/json"},e?.headers),s&&(r.body=JSON.stringify(s)),Object.assign(Object.assign({},r),t))};function oe(n,e,t,s,r,i){return N(this,void 0,void 0,function*(){return new Promise((o,a)=>{n(t,rs(e,s,r,i)).then(c=>{if(!c.ok)throw c;return s?.noResolveJson?c:c.json()}).then(c=>o(c)).catch(c=>ss(c,a,s))})})}function de(n,e,t,s){return N(this,void 0,void 0,function*(){return oe(n,"GET",e,t,s)})}function I(n,e,t,s,r){return N(this,void 0,void 0,function*(){return oe(n,"POST",e,s,r,t)})}function is(n,e,t,s,r){return N(this,void 0,void 0,function*(){return oe(n,"PUT",e,s,r,t)})}function ns(n,e,t,s){return N(this,void 0,void 0,function*(){return oe(n,"HEAD",e,Object.assign(Object.assign({},t),{noResolveJson:!0}),s)})}function ht(n,e,t,s,r){return N(this,void 0,void 0,function*(){return oe(n,"DELETE",e,s,r,t)})}var O=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{h(s.next(l))}catch(u){o(u)}}function c(l){try{h(s.throw(l))}catch(u){o(u)}}function h(l){l.done?i(l.value):r(l.value).then(a,c)}h((s=s.apply(n,e||[])).next())})};const os={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},ze={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class as{constructor(e,t={},s,r){this.url=e,this.headers=t,this.bucketId=s,this.fetch=lt(r)}uploadOrUpdate(e,t,s,r){return O(this,void 0,void 0,function*(){try{let i;const o=Object.assign(Object.assign({},ze),r);let a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&s instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c)),i.append("",s)):typeof FormData<"u"&&s instanceof FormData?(i=s,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c))):(i=s,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,c&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(c)))),r?.headers&&(a=Object.assign(Object.assign({},a),r.headers));const h=this._removeEmptyFolders(t),l=this._getFinalPath(h),u=yield this.fetch(`${this.url}/object/${l}`,Object.assign({method:e,body:i,headers:a},o?.duplex?{duplex:o.duplex}:{})),d=yield u.json();return u.ok?{data:{path:h,id:d.Id,fullPath:d.Key},error:null}:{data:null,error:d}}catch(i){if(b(i))return{data:null,error:i};throw i}})}upload(e,t,s){return O(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,s)})}uploadToSignedUrl(e,t,s,r){return O(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(e),o=this._getFinalPath(i),a=new URL(this.url+`/object/upload/sign/${o}`);a.searchParams.set("token",t);try{let c;const h=Object.assign({upsert:ze.upsert},r),l=Object.assign(Object.assign({},this.headers),{"x-upsert":String(h.upsert)});typeof Blob<"u"&&s instanceof Blob?(c=new FormData,c.append("cacheControl",h.cacheControl),c.append("",s)):typeof FormData<"u"&&s instanceof FormData?(c=s,c.append("cacheControl",h.cacheControl)):(c=s,l["cache-control"]=`max-age=${h.cacheControl}`,l["content-type"]=h.contentType);const u=yield this.fetch(a.toString(),{method:"PUT",body:c,headers:l}),d=yield u.json();return u.ok?{data:{path:i,fullPath:d.Key},error:null}:{data:null,error:d}}catch(c){if(b(c))return{data:null,error:c};throw c}})}createSignedUploadUrl(e,t){return O(this,void 0,void 0,function*(){try{let s=this._getFinalPath(e);const r=Object.assign({},this.headers);t?.upsert&&(r["x-upsert"]="true");const i=yield I(this.fetch,`${this.url}/object/upload/sign/${s}`,{},{headers:r}),o=new URL(this.url+i.url),a=o.searchParams.get("token");if(!a)throw new je("No token returned by API");return{data:{signedUrl:o.toString(),path:e,token:a},error:null}}catch(s){if(b(s))return{data:null,error:s};throw s}})}update(e,t,s){return O(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,s)})}move(e,t,s){return O(this,void 0,void 0,function*(){try{return{data:yield I(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:s?.destinationBucket},{headers:this.headers}),error:null}}catch(r){if(b(r))return{data:null,error:r};throw r}})}copy(e,t,s){return O(this,void 0,void 0,function*(){try{return{data:{path:(yield I(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:s?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(r){if(b(r))return{data:null,error:r};throw r}})}createSignedUrl(e,t,s){return O(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e),i=yield I(this.fetch,`${this.url}/object/sign/${r}`,Object.assign({expiresIn:t},s?.transform?{transform:s.transform}:{}),{headers:this.headers});const o=s?.download?`&download=${s.download===!0?"":s.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(r){if(b(r))return{data:null,error:r};throw r}})}createSignedUrls(e,t,s){return O(this,void 0,void 0,function*(){try{const r=yield I(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),i=s?.download?`&download=${s.download===!0?"":s.download}`:"";return{data:r.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${i}`):null})),error:null}}catch(r){if(b(r))return{data:null,error:r};throw r}})}download(e,t){return O(this,void 0,void 0,function*(){const r=typeof t?.transform<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString(t?.transform||{}),o=i?`?${i}`:"";try{const a=this._getFinalPath(e);return{data:yield(yield de(this.fetch,`${this.url}/${r}/${a}${o}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if(b(a))return{data:null,error:a};throw a}})}info(e){return O(this,void 0,void 0,function*(){const t=this._getFinalPath(e);try{const s=yield de(this.fetch,`${this.url}/object/info/${t}`,{headers:this.headers});return{data:ke(s),error:null}}catch(s){if(b(s))return{data:null,error:s};throw s}})}exists(e){return O(this,void 0,void 0,function*(){const t=this._getFinalPath(e);try{return yield ns(this.fetch,`${this.url}/object/${t}`,{headers:this.headers}),{data:!0,error:null}}catch(s){if(b(s)&&s instanceof be){const r=s.originalError;if([400,404].includes(r?.status))return{data:!1,error:s}}throw s}})}getPublicUrl(e,t){const s=this._getFinalPath(e),r=[],i=t?.download?`download=${t.download===!0?"":t.download}`:"";i!==""&&r.push(i);const a=typeof t?.transform<"u"?"render/image":"object",c=this.transformOptsToQueryString(t?.transform||{});c!==""&&r.push(c);let h=r.join("&");return h!==""&&(h=`?${h}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${s}${h}`)}}}remove(e){return O(this,void 0,void 0,function*(){try{return{data:yield ht(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(t){if(b(t))return{data:null,error:t};throw t}})}list(e,t,s){return O(this,void 0,void 0,function*(){try{const r=Object.assign(Object.assign(Object.assign({},os),t),{prefix:e||""});return{data:yield I(this.fetch,`${this.url}/object/list/${this.bucketId}`,r,{headers:this.headers},s),error:null}}catch(r){if(b(r))return{data:null,error:r};throw r}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(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 cs="2.7.1",ls={"X-Client-Info":`storage-js/${cs}`};var G=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{h(s.next(l))}catch(u){o(u)}}function c(l){try{h(s.throw(l))}catch(u){o(u)}}function h(l){l.done?i(l.value):r(l.value).then(a,c)}h((s=s.apply(n,e||[])).next())})};class hs{constructor(e,t={},s){this.url=e,this.headers=Object.assign(Object.assign({},ls),t),this.fetch=lt(s)}listBuckets(){return G(this,void 0,void 0,function*(){try{return{data:yield de(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(b(e))return{data:null,error:e};throw e}})}getBucket(e){return G(this,void 0,void 0,function*(){try{return{data:yield de(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(t){if(b(t))return{data:null,error:t};throw t}})}createBucket(e,t={public:!1}){return G(this,void 0,void 0,function*(){try{return{data:yield I(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(s){if(b(s))return{data:null,error:s};throw s}})}updateBucket(e,t){return G(this,void 0,void 0,function*(){try{return{data:yield is(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}),error:null}}catch(s){if(b(s))return{data:null,error:s};throw s}})}emptyBucket(e){return G(this,void 0,void 0,function*(){try{return{data:yield I(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(t){if(b(t))return{data:null,error:t};throw t}})}deleteBucket(e){return G(this,void 0,void 0,function*(){try{return{data:yield ht(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(t){if(b(t))return{data:null,error:t};throw t}})}}class us extends hs{constructor(e,t={},s){super(e,t,s)}from(e){return new as(this.url,this.headers,e,this.fetch)}}const ds="2.48.1";let se="";typeof Deno<"u"?se="deno":typeof document<"u"?se="web":typeof navigator<"u"&&navigator.product==="ReactNative"?se="react-native":se="node";const fs={"X-Client-Info":`supabase-js-${se}/${ds}`},gs={headers:fs},ps={schema:"public"},_s={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},vs={};var ys=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{h(s.next(l))}catch(u){o(u)}}function c(l){try{h(s.throw(l))}catch(u){o(u)}}function h(l){l.done?i(l.value):r(l.value).then(a,c)}h((s=s.apply(n,e||[])).next())})};const ws=n=>{let e;return n?e=n:typeof fetch>"u"?e=Ze:e=fetch,(...t)=>e(...t)},ms=()=>typeof Headers>"u"?et:Headers,bs=(n,e,t)=>{const s=ws(t),r=ms();return(i,o)=>ys(void 0,void 0,void 0,function*(){var a;const c=(a=yield e())!==null&&a!==void 0?a:n;let h=new r(o?.headers);return h.has("apikey")||h.set("apikey",n),h.has("Authorization")||h.set("Authorization",`Bearer ${c}`),s(i,Object.assign(Object.assign({},o),{headers:h}))})};var ks=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{h(s.next(l))}catch(u){o(u)}}function c(l){try{h(s.throw(l))}catch(u){o(u)}}function h(l){l.done?i(l.value):r(l.value).then(a,c)}h((s=s.apply(n,e||[])).next())})};function Ss(n){return n.replace(/\/$/,"")}function Ts(n,e){const{db:t,auth:s,realtime:r,global:i}=n,{db:o,auth:a,realtime:c,global:h}=e,l={db:Object.assign(Object.assign({},o),t),auth:Object.assign(Object.assign({},a),s),realtime:Object.assign(Object.assign({},c),r),global:Object.assign(Object.assign({},h),i),accessToken:()=>ks(this,void 0,void 0,function*(){return""})};return n.accessToken?l.accessToken=n.accessToken:delete l.accessToken,l}const ut="2.67.3",Es="http://localhost:9999",Os="supabase.auth.token",Ps={"X-Client-Info":`gotrue-js/${ut}`},Je=10,Se="X-Supabase-Api-Version",dt={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}};function js(n){return Math.round(Date.now()/1e3)+n}function $s(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const e=Math.random()*16|0;return(n=="x"?e:e&3|8).toString(16)})}const A=()=>typeof window<"u"&&typeof document<"u",U={tested:!1,writable:!1},ie=()=>{if(!A())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(U.tested)return U.writable;const n=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(n,n),globalThis.localStorage.removeItem(n),U.tested=!0,U.writable=!0}catch{U.tested=!0,U.writable=!1}return U.writable};function As(n){const e={},t=new URL(n);if(t.hash&&t.hash[0]==="#")try{new URLSearchParams(t.hash.substring(1)).forEach((r,i)=>{e[i]=r})}catch{}return t.searchParams.forEach((s,r)=>{e[r]=s}),e}const ft=n=>{let e;return n?e=n:typeof fetch>"u"?e=(...t)=>Q(async()=>{const{default:s}=await Promise.resolve().then(()=>X);return{default:s}},void 0).then(({default:s})=>s(...t)):e=fetch,(...t)=>e(...t)},Rs=n=>typeof n=="object"&&n!==null&&"status"in n&&"ok"in n&&"json"in n&&typeof n.json=="function",gt=async(n,e,t)=>{await n.setItem(e,JSON.stringify(t))},ce=async(n,e)=>{const t=await n.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch{return t}},le=async(n,e)=>{await n.removeItem(e)};function Cs(n){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let t="",s,r,i,o,a,c,h,l=0;for(n=n.replace("-","+").replace("_","/");l>4,r=(a&15)<<4|c>>2,i=(c&3)<<6|h,t=t+String.fromCharCode(s),c!=64&&r!=0&&(t=t+String.fromCharCode(r)),h!=64&&i!=0&&(t=t+String.fromCharCode(i));return t}class fe{constructor(){this.promise=new fe.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}fe.promiseConstructor=Promise;function He(n){const e=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,t=n.split(".");if(t.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!e.test(t[1]))throw new Error("JWT is not valid: payload is not in base64url format");const s=t[1];return JSON.parse(Cs(s))}async function xs(n){return await new Promise(e=>{setTimeout(()=>e(null),n)})}function Is(n,e){return new Promise((s,r)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await n(i);if(!e(i,null,o)){s(o);return}}catch(o){if(!e(i,o)){r(o);return}}})()})}function Ls(n){return("0"+n.toString(16)).substr(-2)}function Us(){const e=new Uint32Array(56);if(typeof crypto>"u"){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",s=t.length;let r="";for(let i=0;i<56;i++)r+=t.charAt(Math.floor(Math.random()*s));return r}return crypto.getRandomValues(e),Array.from(e,Ls).join("")}async function Ds(n){const t=new TextEncoder().encode(n),s=await crypto.subtle.digest("SHA-256",t),r=new Uint8Array(s);return Array.from(r).map(i=>String.fromCharCode(i)).join("")}function Bs(n){return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Ns(n){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),n;const t=await Ds(n);return Bs(t)}async function K(n,e,t=!1){const s=Us();let r=s;t&&(r+="/PASSWORD_RECOVERY"),await gt(n,`${e}-code-verifier`,r);const i=await Ns(s);return[i,s===i?"plain":"s256"]}const qs=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Fs(n){const e=n.headers.get(Se);if(!e||!e.match(qs))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}class $e extends Error{constructor(e,t,s){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=s}}function p(n){return typeof n=="object"&&n!==null&&"__isAuthError"in n}class Ms extends $e{constructor(e,t,s){super(e,t,s),this.name="AuthApiError",this.status=t,this.code=s}}function zs(n){return p(n)&&n.name==="AuthApiError"}class pt extends $e{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class q extends $e{constructor(e,t,s,r){super(e,s,r),this.name=t,this.status=s}}class C extends q{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Js(n){return p(n)&&n.name==="AuthSessionMissingError"}class _e extends q{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class he extends q{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class ue extends q{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function Hs(n){return p(n)&&n.name==="AuthImplicitGrantRedirectError"}class Ge extends q{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Te extends q{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function ve(n){return p(n)&&n.name==="AuthRetryableFetchError"}class Ke extends q{constructor(e,t,s){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=s}}var Gs=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);rn.msg||n.message||n.error_description||n.error||JSON.stringify(n),Ks=[502,503,504];async function Ve(n){var e;if(!Rs(n))throw new Te(D(n),0);if(Ks.includes(n.status))throw new Te(D(n),n.status);let t;try{t=await n.json()}catch(i){throw new pt(D(i),i)}let s;const r=Fs(n);if(r&&r.getTime()>=dt["2024-01-01"].timestamp&&typeof t=="object"&&t&&typeof t.code=="string"?s=t.code:typeof t=="object"&&t&&typeof t.error_code=="string"&&(s=t.error_code),s){if(s==="weak_password")throw new Ke(D(t),n.status,((e=t.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(s==="session_not_found")throw new C}else if(typeof t=="object"&&t&&typeof t.weak_password=="object"&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((i,o)=>i&&typeof o=="string",!0))throw new Ke(D(t),n.status,t.weak_password.reasons);throw new Ms(D(t),n.status||500,s)}const Vs=(n,e,t,s)=>{const r={method:n,headers:e?.headers||{}};return n==="GET"?r:(r.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e?.headers),r.body=JSON.stringify(s),Object.assign(Object.assign({},r),t))};async function v(n,e,t,s){var r;const i=Object.assign({},s?.headers);i[Se]||(i[Se]=dt["2024-01-01"].name),s?.jwt&&(i.Authorization=`Bearer ${s.jwt}`);const o=(r=s?.query)!==null&&r!==void 0?r:{};s?.redirectTo&&(o.redirect_to=s.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await Ws(n,e,t+a,{headers:i,noResolveJson:s?.noResolveJson},{},s?.body);return s?.xform?s?.xform(c):{data:Object.assign({},c),error:null}}async function Ws(n,e,t,s,r,i){const o=Vs(e,s,r,i);let a;try{a=await n(t,Object.assign({},o))}catch(c){throw console.error(c),new Te(D(c),0)}if(a.ok||await Ve(a),s?.noResolveJson)return a;try{return await a.json()}catch(c){await Ve(c)}}function x(n){var e;let t=null;Zs(n)&&(t=Object.assign({},n),n.expires_at||(t.expires_at=js(n.expires_in)));const s=(e=n.user)!==null&&e!==void 0?e:n;return{data:{session:t,user:s},error:null}}function We(n){const e=x(n);return!e.error&&n.weak_password&&typeof n.weak_password=="object"&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.message&&typeof n.weak_password.message=="string"&&n.weak_password.reasons.reduce((t,s)=>t&&typeof s=="string",!0)&&(e.data.weak_password=n.weak_password),e}function L(n){var e;return{data:{user:(e=n.user)!==null&&e!==void 0?e:n},error:null}}function Qs(n){return{data:n,error:null}}function Ys(n){const{action_link:e,email_otp:t,hashed_token:s,redirect_to:r,verification_type:i}=n,o=Gs(n,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:t,hashed_token:s,redirect_to:r,verification_type:i},c=Object.assign({},o);return{data:{properties:a,user:c},error:null}}function Xs(n){return n}function Zs(n){return n.access_token&&n.refresh_token&&n.expires_in}var er=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r0&&(f.forEach(g=>{const y=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),_=JSON.parse(g.split(";")[1].split("=")[1]);h[`${_}Page`]=y}),h.total=parseInt(d)),{data:Object.assign(Object.assign({},u),h),error:null}}catch(h){if(p(h))return{data:{users:[]},error:h};throw h}}async getUserById(e){try{return await v(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:L})}catch(t){if(p(t))return{data:{user:null},error:t};throw t}}async updateUserById(e,t){try{return await v(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:L})}catch(s){if(p(s))return{data:{user:null},error:s};throw s}}async deleteUser(e,t=!1){try{return await v(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:L})}catch(s){if(p(s))return{data:{user:null},error:s};throw s}}async _listFactors(e){try{const{data:t,error:s}=await v(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:r=>({data:{factors:r},error:null})});return{data:t,error:s}}catch(t){if(p(t))return{data:null,error:t};throw t}}async _deleteFactor(e){try{return{data:await v(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(t){if(p(t))return{data:null,error:t};throw t}}}const sr={getItem:n=>ie()?globalThis.localStorage.getItem(n):null,setItem:(n,e)=>{ie()&&globalThis.localStorage.setItem(n,e)},removeItem:n=>{ie()&&globalThis.localStorage.removeItem(n)}};function Qe(n={}){return{getItem:e=>n[e]||null,setItem:(e,t)=>{n[e]=t},removeItem:e=>{delete n[e]}}}function rr(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}const V={debug:!!(globalThis&&ie()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class _t extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class ir extends _t{}async function nr(n,e,t){V.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",n,e);const s=new globalThis.AbortController;return e>0&&setTimeout(()=>{s.abort(),V.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",n)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(n,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:s.signal},async r=>{if(r){V.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",n,r.name);try{return await t()}finally{V.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",n,r.name)}}else{if(e===0)throw V.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",n),new ir(`Acquiring an exclusive Navigator LockManager lock "${n}" immediately failed`);if(V.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null," "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}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 t()}}))}rr();const or={url:Es,storageKey:Os,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Ps,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},te=30*1e3,Ye=3;async function Xe(n,e,t){return await t()}class ne{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.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=ne.nextInstanceID,ne.nextInstanceID+=1,this.instanceID>0&&A()&&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 r=Object.assign(Object.assign({},or),e);if(this.logDebugMessages=!!r.debug,typeof r.debug=="function"&&(this.logger=r.debug),this.persistSession=r.persistSession,this.storageKey=r.storageKey,this.autoRefreshToken=r.autoRefreshToken,this.admin=new tr({url:r.url,headers:r.headers,fetch:r.fetch}),this.url=r.url,this.headers=r.headers,this.fetch=ft(r.fetch),this.lock=r.lock||Xe,this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.flowType,this.hasCustomAuthorizationHeader=r.hasCustomAuthorizationHeader,r.lock?this.lock=r.lock:A()&&(!((t=globalThis?.navigator)===null||t===void 0)&&t.locks)?this.lock=nr:this.lock=Xe,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?r.storage?this.storage=r.storage:ie()?this.storage=sr:(this.memoryStorage={},this.storage=Qe(this.memoryStorage)):(this.memoryStorage={},this.storage=Qe(this.memoryStorage)),A()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${ut}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{const t=As(window.location.href);let s="none";if(this._isImplicitGrantCallback(t)?s="implicit":await this._isPKCECallback(t)&&(s="pkce"),A()&&this.detectSessionInUrl&&s!=="none"){const{data:r,error:i}=await this._getSessionFromURL(t,s);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),Hs(i)){const c=(e=i.details)===null||e===void 0?void 0:e.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:o,redirectType:a}=r;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(t){return p(t)?{error:t}:{error:new pt("Unexpected error during initialization",t)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,s,r;try{const i=await v(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(s=(t=e?.options)===null||t===void 0?void 0:t.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:(r=e?.options)===null||r===void 0?void 0:r.captchaToken}},xform:x}),{data:o,error:a}=i;if(a||!o)return{data:{user:null,session:null},error:a};const c=o.session,h=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:h,session:c},error:null}}catch(i){if(p(i))return{data:{user:null,session:null},error:i};throw i}}async signUp(e){var t,s,r;try{let i;if("email"in e){const{email:l,password:u,options:d}=e;let f=null,g=null;this.flowType==="pkce"&&([f,g]=await K(this.storage,this.storageKey)),i=await v(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:d?.emailRedirectTo,body:{email:l,password:u,data:(t=d?.data)!==null&&t!==void 0?t:{},gotrue_meta_security:{captcha_token:d?.captchaToken},code_challenge:f,code_challenge_method:g},xform:x})}else if("phone"in e){const{phone:l,password:u,options:d}=e;i=await v(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:l,password:u,data:(s=d?.data)!==null&&s!==void 0?s:{},channel:(r=d?.channel)!==null&&r!==void 0?r:"sms",gotrue_meta_security:{captcha_token:d?.captchaToken}},xform:x})}else throw new he("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return{data:{user:null,session:null},error:a};const c=o.session,h=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:h,session:c},error:null}}catch(i){if(p(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithPassword(e){try{let t;if("email"in e){const{email:i,password:o,options:a}=e;t=await v(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:We})}else if("phone"in e){const{phone:i,password:o,options:a}=e;t=await v(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:We})}else throw new he("You must provide either an email or phone number and a password");const{data:s,error:r}=t;return r?{data:{user:null,session:null},error:r}:!s||!s.session||!s.user?{data:{user:null,session:null},error:new _e}:(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})}catch(t){if(p(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOAuth(e){var t,s,r,i;return await this._handleProviderSignIn(e.provider,{redirectTo:(t=e.options)===null||t===void 0?void 0:t.redirectTo,scopes:(s=e.options)===null||s===void 0?void 0:s.scopes,queryParams:(r=e.options)===null||r===void 0?void 0:r.queryParams,skipBrowserRedirect:(i=e.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){const t=await ce(this.storage,`${this.storageKey}-code-verifier`),[s,r]=(t??"").split("/");try{const{data:i,error:o}=await v(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:s},xform:x});if(await le(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!i||!i.session||!i.user?{data:{user:null,session:null,redirectType:null},error:new _e}:(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign(Object.assign({},i),{redirectType:r??null}),error:o})}catch(i){if(p(i))return{data:{user:null,session:null,redirectType:null},error:i};throw i}}async signInWithIdToken(e){try{const{options:t,provider:s,token:r,access_token:i,nonce:o}=e,a=await v(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:r,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:t?.captchaToken}},xform:x}),{data:c,error:h}=a;return h?{data:{user:null,session:null},error:h}:!c||!c.session||!c.user?{data:{user:null,session:null},error:new _e}:(c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),{data:c,error:h})}catch(t){if(p(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOtp(e){var t,s,r,i,o;try{if("email"in e){const{email:a,options:c}=e;let h=null,l=null;this.flowType==="pkce"&&([h,l]=await K(this.storage,this.storageKey));const{error:u}=await v(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(t=c?.data)!==null&&t!==void 0?t:{},create_user:(s=c?.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:c?.captchaToken},code_challenge:h,code_challenge_method:l},redirectTo:c?.emailRedirectTo});return{data:{user:null,session:null},error:u}}if("phone"in e){const{phone:a,options:c}=e,{data:h,error:l}=await v(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(r=c?.data)!==null&&r!==void 0?r:{},create_user:(i=c?.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:c?.captchaToken},channel:(o=c?.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:h?.message_id},error:l}}throw new he("You must provide either an email or phone number.")}catch(a){if(p(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var t,s;try{let r,i;"options"in e&&(r=(t=e.options)===null||t===void 0?void 0:t.redirectTo,i=(s=e.options)===null||s===void 0?void 0:s.captchaToken);const{data:o,error:a}=await v(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:r,xform:x});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,h=o.user;return c?.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),{data:{user:h,session:c},error:null}}catch(r){if(p(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithSSO(e){var t,s,r;try{let i=null,o=null;return this.flowType==="pkce"&&([i,o]=await K(this.storage,this.storageKey)),await v(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:(s=(t=e.options)===null||t===void 0?void 0:t.redirectTo)!==null&&s!==void 0?s:void 0}),!((r=e?.options)===null||r===void 0)&&r.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:o}),headers:this.headers,xform:Qs})}catch(i){if(p(i))return{data:null,error:i};throw i}}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 C;const{error:r}=await v(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return{data:{user:null,session:null},error:r}})}catch(e){if(p(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{const t=`${this.url}/resend`;if("email"in e){const{email:s,type:r,options:i}=e,{error:o}=await v(this.fetch,"POST",t,{headers:this.headers,body:{email:s,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},redirectTo:i?.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in e){const{phone:s,type:r,options:i}=e,{data:o,error:a}=await v(this.fetch,"POST",t,{headers:this.headers,body:{phone:s,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}}});return{data:{user:null,session:null,messageId:o?.message_id},error:a}}throw new he("You must provide either an email or phone number and a type")}catch(t){if(p(t))return{data:{user:null,session:null},error:t};throw t}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async t=>t))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const s=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=(async()=>(await s,await t()))();return this.pendingInLock.push((async()=>{try{await r}catch{}})()),r}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const s=t();for(this.pendingInLock.push((async()=>{try{await s}catch{}})()),await s;this.pendingInLock.length;){const r=[...this.pendingInLock];await Promise.all(r),this.pendingInLock.splice(0,r.length)}return await s}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 ce(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),t!==null&&(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:!1;if(this._debug("#__loadSession()",`session has${s?"":" not"} expired`,"expires_at",e.expires_at),!s){if(this.storage.isServer){let o=this.suppressGetSessionWarning;e=new Proxy(e,{get:(c,h,l)=>(!o&&h==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),o=!0,this.suppressGetSessionWarning=!0),Reflect.get(c,h,l))})}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,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await v(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:L}):await this._useSession(async t=>{var s,r,i;const{data:o,error:a}=t;if(a)throw a;return!(!((s=o.session)===null||s===void 0)&&s.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new C}:await v(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(r=o.session)===null||r===void 0?void 0:r.access_token)!==null&&i!==void 0?i:void 0,xform:L})})}catch(t){if(p(t))return Js(t)&&(await this._removeSession(),await le(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:t};throw t}}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 C;const o=r.session;let a=null,c=null;this.flowType==="pkce"&&e.email!=null&&([a,c]=await K(this.storage,this.storageKey));const{data:h,error:l}=await v(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:t?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:c}),jwt:o.access_token,xform:L});if(l)throw l;return o.user=h.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(s){if(p(s))return{data:{user:null},error:s};throw s}}_decodeJWT(e){return He(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 C;const t=Date.now()/1e3;let s=t,r=!0,i=null;const o=He(e.access_token);if(o.exp&&(s=o.exp,r=s<=t),r){const{session:a,error:c}=await this._callRefreshToken(e.refresh_token);if(c)return{data:{user:null,session:null},error:c};if(!a)return{data:{user:null,session:null},error:null};i=a}else{const{data:a,error:c}=await this._getUser(e.access_token);if(c)throw c;i={access_token:e.access_token,refresh_token:e.refresh_token,user:a.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(t){if(p(t))return{data:{session:null,user:null},error:t};throw t}}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:o,error:a}=t;if(a)throw a;e=(s=o.session)!==null&&s!==void 0?s:void 0}if(!e?.refresh_token)throw new C;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(t){if(p(t))return{data:{user:null,session:null},error:t};throw t}}async _getSessionFromURL(e,t){try{if(!A())throw new ue("No browser detected.");if(e.error||e.error_description||e.error_code)throw new ue(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if(this.flowType==="pkce")throw new Ge("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new ue("Not a valid implicit grant flow url.");break;default:}if(t==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new Ge("No code detected.");const{data:$,error:k}=await this._exchangeCodeForSession(e.code);if(k)throw k;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:$.session,redirectType:null},error:null}}const{provider_token:s,provider_refresh_token:r,access_token:i,refresh_token:o,expires_in:a,expires_at:c,token_type:h}=e;if(!i||!a||!o||!h)throw new ue("No session defined in URL");const l=Math.round(Date.now()/1e3),u=parseInt(a);let d=l+u;c&&(d=parseInt(c));const f=d-l;f*1e3<=te&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${u}s`);const g=d-u;l-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,d,l):l-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,d,l);const{data:y,error:_}=await this._getUser(i);if(_)throw _;const E={provider_token:s,provider_refresh_token:r,access_token:i,expires_in:u,expires_at:d,refresh_token:o,token_type:h,user:y.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:E,redirectType:e.type},error:null}}catch(s){if(p(s))return{data:{session:null,redirectType:null},error:s};throw s}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const t=await ce(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 o=(s=r.session)===null||s===void 0?void 0:s.access_token;if(o){const{error:a}=await this.admin.signOut(o,e);if(a&&!(zs(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await le(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){const t=$s(),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:i},error:o}=t;if(o)throw o;await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",e,"session",i)}catch(i){await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",i),console.error(i)}})}async resetPasswordForEmail(e,t={}){let s=null,r=null;this.flowType==="pkce"&&([s,r]=await K(this.storage,this.storageKey,!0));try{return await v(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(i){if(p(i))return{data:null,error:i};throw i}}async getUserIdentities(){var e;try{const{data:t,error:s}=await this.getUser();if(s)throw s;return{data:{identities:(e=t.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(t){if(p(t))return{data:null,error:t};throw t}}async linkIdentity(e){var t;try{const{data:s,error:r}=await this._useSession(async i=>{var o,a,c,h,l;const{data:u,error:d}=i;if(d)throw d;const f=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(c=e.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await v(this.fetch,"GET",f,{headers:this.headers,jwt:(l=(h=u.session)===null||h===void 0?void 0:h.access_token)!==null&&l!==void 0?l:void 0})});if(r)throw r;return A()&&!(!((t=e.options)===null||t===void 0)&&t.skipBrowserRedirect)&&window.location.assign(s?.url),{data:{provider:e.provider,url:s?.url},error:null}}catch(s){if(p(s))return{data:{provider:e.provider,url:null},error:s};throw s}}async unlinkIdentity(e){try{return await this._useSession(async t=>{var s,r;const{data:i,error:o}=t;if(o)throw o;return await v(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(r=(s=i.session)===null||s===void 0?void 0:s.access_token)!==null&&r!==void 0?r:void 0})})}catch(t){if(p(t))return{data:null,error:t};throw t}}async _refreshAccessToken(e){const t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{const s=Date.now();return await Is(async r=>(r>0&&await xs(200*Math.pow(2,r-1)),this._debug(t,"refreshing attempt",r),await v(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:x})),(r,i)=>{const o=200*Math.pow(2,r);return i&&ve(i)&&Date.now()+o-s{try{await a.callback(e,t)}catch(c){i.push(c)}});if(await Promise.all(o),i.length>0){for(let a=0;athis._autoRefreshTokenTick(),te);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&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){this._debug("#_autoRefreshTokenTick()","no session");return}const r=Math.floor((s.expires_at*1e3-e)/te);this._debug("#_autoRefreshTokenTick()",`access token expires in ${r} ticks, a tick lasts ${te}ms, refresh threshold is ${Ye} ticks`),r<=Ye&&await this._callRefreshToken(s.refresh_token)})}catch(t){console.error("Auto refresh tick failed with error. This is likely a transient error.",t)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof _t)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!A()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),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),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,s){const r=[`provider=${encodeURIComponent(t)}`];if(s?.redirectTo&&r.push(`redirect_to=${encodeURIComponent(s.redirectTo)}`),s?.scopes&&r.push(`scopes=${encodeURIComponent(s.scopes)}`),this.flowType==="pkce"){const[i,o]=await K(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});r.push(a.toString())}if(s?.queryParams){const i=new URLSearchParams(s.queryParams);r.push(i.toString())}return 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 v(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(s=r?.session)===null||s===void 0?void 0:s.access_token})})}catch(t){if(p(t))return{data:null,error:t};throw t}}async _enroll(e){try{return await this._useSession(async t=>{var s,r;const{data:i,error:o}=t;if(o)return{data:null,error:o};const a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:c,error:h}=await v(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(s=i?.session)===null||s===void 0?void 0:s.access_token});return h?{data:null,error:h}:(e.factorType==="totp"&&(!((r=c?.totp)===null||r===void 0)&&r.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),{data:c,error:null})})}catch(t){if(p(t))return{data:null,error:t};throw t}}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:o,error:a}=await v(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(s=r?.session)===null||s===void 0?void 0:s.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),{data:o,error:a})})}catch(t){if(p(t))return{data:null,error:t};throw t}})}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 v(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(s=r?.session)===null||s===void 0?void 0:s.access_token})})}catch(t){if(p(t))return{data:null,error:t};throw t}})}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=e?.factors||[],r=s.filter(o=>o.factor_type==="totp"&&o.status==="verified"),i=s.filter(o=>o.factor_type==="phone"&&o.status==="verified");return{data:{all:s,totp:r,phone:i},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 o=this._decodeJWT(r.access_token);let a=null;o.aal&&(a=o.aal);let c=a;((s=(t=r.user.factors)===null||t===void 0?void 0:t.filter(u=>u.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(c="aal2");const l=o.amr||[];return{data:{currentLevel:a,nextLevel:c,currentAuthenticationMethods:l},error:null}}))}}ne.nextInstanceID=0;const ar=ne;class cr extends ar{constructor(e){super(e)}}var lr=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{h(s.next(l))}catch(u){o(u)}}function c(l){try{h(s.throw(l))}catch(u){o(u)}}function h(l){l.done?i(l.value):r(l.value).then(a,c)}h((s=s.apply(n,e||[])).next())})};class hr{constructor(e,t,s){var r,i,o;if(this.supabaseUrl=e,this.supabaseKey=t,!e)throw new Error("supabaseUrl is required.");if(!t)throw new Error("supabaseKey is required.");const a=Ss(e);this.realtimeUrl=`${a}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${a}/auth/v1`,this.storageUrl=`${a}/storage/v1`,this.functionsUrl=`${a}/functions/v1`;const c=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,h={db:ps,realtime:vs,auth:Object.assign(Object.assign({},_s),{storageKey:c}),global:gs},l=Ts(s??{},h);this.storageKey=(r=l.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(i=l.global.headers)!==null&&i!==void 0?i:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(u,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=l.auth)!==null&&o!==void 0?o:{},this.headers,l.global.fetch),this.fetch=bs(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.rest=new Ut(`${a}/rest/v1`,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),l.accessToken||this._listenForAuthEvents()}get functions(){return new Tt(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new us(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 lr(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:s}=yield this.auth.getSession();return(t=(e=s.session)===null||e===void 0?void 0:e.access_token)!==null&&t!==void 0?t:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:r,storageKey:i,flowType:o,lock:a,debug:c},h,l){const u={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new cr({url:this.authUrl,headers:Object.assign(Object.assign({},u),h),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:r,flowType:o,lock:a,debug:c,fetch:l,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(e){return new Yt(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,s)=>{this._handleTokenChanged(t,"CLIENT",s?.access_token)})}_handleTokenChanged(e,t,s){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==s?this.changedAccessToken=s:e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const yr=(n,e,t)=>new hr(n,e,t);export{yr as c}; diff --git a/docs/_astro/@supabase.DH5uoBuY.js b/docs/_astro/@supabase.DH5uoBuY.js deleted file mode 100644 index 0517364cf1..0000000000 --- a/docs/_astro/@supabase.DH5uoBuY.js +++ /dev/null @@ -1,7 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_astro/ws.BkT5Wpo5.js","_astro/@react-three.BOv1JqT7.js","_astro/react.C2V1wh_4.js"])))=>i.map(i=>d[i]); -import{g as yt,a as wt}from"./@react-three.BOv1JqT7.js";import{_ as V}from"./Page.astro_astro_type_script_index_0_lang.COYkzBTz.js";const mt=n=>{let e;return n?e=n:typeof fetch>"u"?e=(...t)=>V(async()=>{const{default:s}=await Promise.resolve().then(()=>Y);return{default:s}},void 0).then(({default:s})=>s(...t)):e=fetch,(...t)=>e(...t)};class Ee extends Error{constructor(e,t="FunctionsError",s){super(e),this.name=t,this.context=s}}class bt extends Ee{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class kt extends Ee{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class St extends Ee{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var ye;(function(n){n.Any="any",n.ApNortheast1="ap-northeast-1",n.ApNortheast2="ap-northeast-2",n.ApSouth1="ap-south-1",n.ApSoutheast1="ap-southeast-1",n.ApSoutheast2="ap-southeast-2",n.CaCentral1="ca-central-1",n.EuCentral1="eu-central-1",n.EuWest1="eu-west-1",n.EuWest2="eu-west-2",n.EuWest3="eu-west-3",n.SaEast1="sa-east-1",n.UsEast1="us-east-1",n.UsWest1="us-west-1",n.UsWest2="us-west-2"})(ye||(ye={}));var Tt=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{h(s.next(l))}catch(u){o(u)}}function c(l){try{h(s.throw(l))}catch(u){o(u)}}function h(l){l.done?i(l.value):r(l.value).then(a,c)}h((s=s.apply(n,e||[])).next())})};class Et{constructor(e,{headers:t={},customFetch:s,region:r=ye.Any}={}){this.url=e,this.headers=t,this.region=r,this.fetch=mt(s)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var s;return Tt(this,void 0,void 0,function*(){try{const{headers:r,method:i,body:o}=t;let a={},{region:c}=t;c||(c=this.region),c&&c!=="any"&&(a["x-region"]=c);let h;o&&(r&&!Object.prototype.hasOwnProperty.call(r,"Content-Type")||!r)&&(typeof Blob<"u"&&o instanceof Blob||o instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",h=o):typeof o=="string"?(a["Content-Type"]="text/plain",h=o):typeof FormData<"u"&&o instanceof FormData?h=o:(a["Content-Type"]="application/json",h=JSON.stringify(o)));const l=yield this.fetch(`${this.url}/${e}`,{method:i||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),r),body:h}).catch(g=>{throw new bt(g)}),u=l.headers.get("x-relay-error");if(u&&u==="true")throw new kt(l);if(!l.ok)throw new St(l);let d=((s=l.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),f;return d==="application/json"?f=yield l.json():d==="application/octet-stream"?f=yield l.blob():d==="text/event-stream"?f=l:d==="multipart/form-data"?f=yield l.formData():f=yield l.text(),{data:f,error:null}}catch(r){return{data:null,error:r}}})}}var m={},q={},F={},M={},z={},J={},Ot=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},Q=Ot();const Pt=Q.fetch,et=Q.fetch.bind(Q),tt=Q.Headers,jt=Q.Request,$t=Q.Response,Y=Object.freeze(Object.defineProperty({__proto__:null,Headers:tt,Request:jt,Response:$t,default:et,fetch:Pt},Symbol.toStringTag,{value:"Module"})),At=yt(Y);var oe={},Ae;function st(){if(Ae)return oe;Ae=1,Object.defineProperty(oe,"__esModule",{value:!0});let n=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}};return oe.default=n,oe}var Re;function rt(){if(Re)return J;Re=1;var n=J&&J.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(J,"__esModule",{value:!0});const e=n(At),t=n(st());class s{constructor(i){this.shouldThrowOnError=!1,this.method=i.method,this.url=i.url,this.headers=i.headers,this.schema=i.schema,this.body=i.body,this.shouldThrowOnError=i.shouldThrowOnError,this.signal=i.signal,this.isMaybeSingle=i.isMaybeSingle,i.fetch?this.fetch=i.fetch:typeof fetch>"u"?this.fetch=e.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(i,o){return this.headers=Object.assign({},this.headers),this.headers[i]=o,this}then(i,o){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const a=this.fetch;let c=a(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async h=>{var l,u,d;let f=null,g=null,y=null,p=h.status,E=h.statusText;if(h.ok){if(this.method!=="HEAD"){const T=await h.text();T===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?g=T:g=JSON.parse(T))}const k=(l=this.headers.Prefer)===null||l===void 0?void 0:l.match(/count=(exact|planned|estimated)/),S=(u=h.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");k&&S&&S.length>1&&(y=parseInt(S[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(g)&&(g.length>1?(f={code:"PGRST116",details:`Results contain ${g.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},g=null,y=null,p=406,E="Not Acceptable"):g.length===1?g=g[0]:g=null)}else{const k=await h.text();try{f=JSON.parse(k),Array.isArray(f)&&h.status===404&&(g=[],f=null,p=200,E="OK")}catch{h.status===404&&k===""?(p=204,E="No Content"):f={message:k}}if(f&&this.isMaybeSingle&&(!((d=f?.details)===null||d===void 0)&&d.includes("0 rows"))&&(f=null,p=200,E="OK"),f&&this.shouldThrowOnError)throw new t.default(f)}return{error:f,data:g,count:y,status:p,statusText:E}});return this.shouldThrowOnError||(c=c.catch(h=>{var l,u,d;return{error:{message:`${(l=h?.name)!==null&&l!==void 0?l:"FetchError"}: ${h?.message}`,details:`${(u=h?.stack)!==null&&u!==void 0?u:""}`,hint:"",code:`${(d=h?.code)!==null&&d!==void 0?d:""}`},data:null,count:null,status:0,statusText:""}})),c.then(i,o)}}return J.default=s,J}var Ce;function it(){if(Ce)return z;Ce=1;var n=z&&z.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(z,"__esModule",{value:!0});const e=n(rt());class t extends e.default{select(r){let i=!1;const o=(r??"*").split("").map(a=>/\s/.test(a)&&!i?"":(a==='"'&&(i=!i),a)).join("");return this.url.searchParams.set("select",o),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(r,{ascending:i=!0,nullsFirst:o,foreignTable:a,referencedTable:c=a}={}){const h=c?`${c}.order`:"order",l=this.url.searchParams.get(h);return this.url.searchParams.set(h,`${l?`${l},`:""}${r}.${i?"asc":"desc"}${o===void 0?"":o?".nullsfirst":".nullslast"}`),this}limit(r,{foreignTable:i,referencedTable:o=i}={}){const a=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(a,`${r}`),this}range(r,i,{foreignTable:o,referencedTable:a=o}={}){const c=typeof a>"u"?"offset":`${a}.offset`,h=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(c,`${r}`),this.url.searchParams.set(h,`${i-r+1}`),this}abortSignal(r){return this.signal=r,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?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:r=!1,verbose:i=!1,settings:o=!1,buffers:a=!1,wal:c=!1,format:h="text"}={}){var l;const u=[r?"analyze":null,i?"verbose":null,o?"settings":null,a?"buffers":null,c?"wal":null].filter(Boolean).join("|"),d=(l=this.headers.Accept)!==null&&l!==void 0?l:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${h}; for="${d}"; options=${u};`,h==="json"?this:this}rollback(){var r;return((r=this.headers.Prefer)!==null&&r!==void 0?r:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}}return z.default=t,z}var xe;function Oe(){if(xe)return M;xe=1;var n=M&&M.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(M,"__esModule",{value:!0});const e=n(it());class t extends e.default{eq(r,i){return this.url.searchParams.append(r,`eq.${i}`),this}neq(r,i){return this.url.searchParams.append(r,`neq.${i}`),this}gt(r,i){return this.url.searchParams.append(r,`gt.${i}`),this}gte(r,i){return this.url.searchParams.append(r,`gte.${i}`),this}lt(r,i){return this.url.searchParams.append(r,`lt.${i}`),this}lte(r,i){return this.url.searchParams.append(r,`lte.${i}`),this}like(r,i){return this.url.searchParams.append(r,`like.${i}`),this}likeAllOf(r,i){return this.url.searchParams.append(r,`like(all).{${i.join(",")}}`),this}likeAnyOf(r,i){return this.url.searchParams.append(r,`like(any).{${i.join(",")}}`),this}ilike(r,i){return this.url.searchParams.append(r,`ilike.${i}`),this}ilikeAllOf(r,i){return this.url.searchParams.append(r,`ilike(all).{${i.join(",")}}`),this}ilikeAnyOf(r,i){return this.url.searchParams.append(r,`ilike(any).{${i.join(",")}}`),this}is(r,i){return this.url.searchParams.append(r,`is.${i}`),this}in(r,i){const o=Array.from(new Set(i)).map(a=>typeof a=="string"&&new RegExp("[,()]").test(a)?`"${a}"`:`${a}`).join(",");return this.url.searchParams.append(r,`in.(${o})`),this}contains(r,i){return typeof i=="string"?this.url.searchParams.append(r,`cs.${i}`):Array.isArray(i)?this.url.searchParams.append(r,`cs.{${i.join(",")}}`):this.url.searchParams.append(r,`cs.${JSON.stringify(i)}`),this}containedBy(r,i){return typeof i=="string"?this.url.searchParams.append(r,`cd.${i}`):Array.isArray(i)?this.url.searchParams.append(r,`cd.{${i.join(",")}}`):this.url.searchParams.append(r,`cd.${JSON.stringify(i)}`),this}rangeGt(r,i){return this.url.searchParams.append(r,`sr.${i}`),this}rangeGte(r,i){return this.url.searchParams.append(r,`nxl.${i}`),this}rangeLt(r,i){return this.url.searchParams.append(r,`sl.${i}`),this}rangeLte(r,i){return this.url.searchParams.append(r,`nxr.${i}`),this}rangeAdjacent(r,i){return this.url.searchParams.append(r,`adj.${i}`),this}overlaps(r,i){return typeof i=="string"?this.url.searchParams.append(r,`ov.${i}`):this.url.searchParams.append(r,`ov.{${i.join(",")}}`),this}textSearch(r,i,{config:o,type:a}={}){let c="";a==="plain"?c="pl":a==="phrase"?c="ph":a==="websearch"&&(c="w");const h=o===void 0?"":`(${o})`;return this.url.searchParams.append(r,`${c}fts${h}.${i}`),this}match(r){return Object.entries(r).forEach(([i,o])=>{this.url.searchParams.append(i,`eq.${o}`)}),this}not(r,i,o){return this.url.searchParams.append(r,`not.${i}.${o}`),this}or(r,{foreignTable:i,referencedTable:o=i}={}){const a=o?`${o}.or`:"or";return this.url.searchParams.append(a,`(${r})`),this}filter(r,i,o){return this.url.searchParams.append(r,`${i}.${o}`),this}}return M.default=t,M}var Ie;function nt(){if(Ie)return F;Ie=1;var n=F&&F.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(F,"__esModule",{value:!0});const e=n(Oe());class t{constructor(r,{headers:i={},schema:o,fetch:a}){this.url=r,this.headers=i,this.schema=o,this.fetch=a}select(r,{head:i=!1,count:o}={}){const a=i?"HEAD":"GET";let c=!1;const h=(r??"*").split("").map(l=>/\s/.test(l)&&!c?"":(l==='"'&&(c=!c),l)).join("");return this.url.searchParams.set("select",h),o&&(this.headers.Prefer=`count=${o}`),new e.default({method:a,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(r,{count:i,defaultToNull:o=!0}={}){const a="POST",c=[];if(this.headers.Prefer&&c.push(this.headers.Prefer),i&&c.push(`count=${i}`),o||c.push("missing=default"),this.headers.Prefer=c.join(","),Array.isArray(r)){const h=r.reduce((l,u)=>l.concat(Object.keys(u)),[]);if(h.length>0){const l=[...new Set(h)].map(u=>`"${u}"`);this.url.searchParams.set("columns",l.join(","))}}return new e.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:r,fetch:this.fetch,allowEmpty:!1})}upsert(r,{onConflict:i,ignoreDuplicates:o=!1,count:a,defaultToNull:c=!0}={}){const h="POST",l=[`resolution=${o?"ignore":"merge"}-duplicates`];if(i!==void 0&&this.url.searchParams.set("on_conflict",i),this.headers.Prefer&&l.push(this.headers.Prefer),a&&l.push(`count=${a}`),c||l.push("missing=default"),this.headers.Prefer=l.join(","),Array.isArray(r)){const u=r.reduce((d,f)=>d.concat(Object.keys(f)),[]);if(u.length>0){const d=[...new Set(u)].map(f=>`"${f}"`);this.url.searchParams.set("columns",d.join(","))}}return new e.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:r,fetch:this.fetch,allowEmpty:!1})}update(r,{count:i}={}){const o="PATCH",a=[];return this.headers.Prefer&&a.push(this.headers.Prefer),i&&a.push(`count=${i}`),this.headers.Prefer=a.join(","),new e.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:r,fetch:this.fetch,allowEmpty:!1})}delete({count:r}={}){const i="DELETE",o=[];return r&&o.push(`count=${r}`),this.headers.Prefer&&o.unshift(this.headers.Prefer),this.headers.Prefer=o.join(","),new e.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}}return F.default=t,F}var X={},Z={},Le;function Rt(){return Le||(Le=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.version=void 0,Z.version="0.0.0-automated"),Z}var Ue;function Ct(){if(Ue)return X;Ue=1,Object.defineProperty(X,"__esModule",{value:!0}),X.DEFAULT_HEADERS=void 0;const n=Rt();return X.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${n.version}`},X}var De;function xt(){if(De)return q;De=1;var n=q&&q.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(q,"__esModule",{value:!0});const e=n(nt()),t=n(Oe()),s=Ct();class r{constructor(o,{headers:a={},schema:c,fetch:h}={}){this.url=o,this.headers=Object.assign(Object.assign({},s.DEFAULT_HEADERS),a),this.schemaName=c,this.fetch=h}from(o){const a=new URL(`${this.url}/${o}`);return new e.default(a,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(o){return new r(this.url,{headers:this.headers,schema:o,fetch:this.fetch})}rpc(o,a={},{head:c=!1,get:h=!1,count:l}={}){let u;const d=new URL(`${this.url}/rpc/${o}`);let f;c||h?(u=c?"HEAD":"GET",Object.entries(a).filter(([y,p])=>p!==void 0).map(([y,p])=>[y,Array.isArray(p)?`{${p.join(",")}}`:`${p}`]).forEach(([y,p])=>{d.searchParams.append(y,p)})):(u="POST",f=a);const g=Object.assign({},this.headers);return l&&(g.Prefer=`count=${l}`),new t.default({method:u,url:d,headers:g,schema:this.schemaName,body:f,fetch:this.fetch,allowEmpty:!1})}}return q.default=r,q}var Be;function It(){if(Be)return m;Be=1;var n=m&&m.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(m,"__esModule",{value:!0}),m.PostgrestError=m.PostgrestBuilder=m.PostgrestTransformBuilder=m.PostgrestFilterBuilder=m.PostgrestQueryBuilder=m.PostgrestClient=void 0;const e=n(xt());m.PostgrestClient=e.default;const t=n(nt());m.PostgrestQueryBuilder=t.default;const s=n(Oe());m.PostgrestFilterBuilder=s.default;const r=n(it());m.PostgrestTransformBuilder=r.default;const i=n(rt());m.PostgrestBuilder=i.default;const o=n(st());return m.PostgrestError=o.default,m.default={PostgrestClient:e.default,PostgrestQueryBuilder:t.default,PostgrestFilterBuilder:s.default,PostgrestTransformBuilder:r.default,PostgrestBuilder:i.default,PostgrestError:o.default},m}var Lt=It();const Ut=wt(Lt),{PostgrestClient:Dt,PostgrestQueryBuilder:fr,PostgrestFilterBuilder:gr,PostgrestTransformBuilder:pr,PostgrestBuilder:_r}=Ut,Bt="2.10.7",Nt={"X-Client-Info":`realtime-js/${Bt}`},qt="1.0.0",ot=1e4,Ft=1e3;var W;(function(n){n[n.connecting=0]="connecting",n[n.open=1]="open",n[n.closing=2]="closing",n[n.closed=3]="closed"})(W||(W={}));var P;(function(n){n.closed="closed",n.errored="errored",n.joined="joined",n.joining="joining",n.leaving="leaving"})(P||(P={}));var $;(function(n){n.close="phx_close",n.error="phx_error",n.join="phx_join",n.reply="phx_reply",n.leave="phx_leave",n.access_token="access_token"})($||($={}));var we;(function(n){n.websocket="websocket"})(we||(we={}));var D;(function(n){n.Connecting="connecting",n.Open="open",n.Closing="closing",n.Closed="closed"})(D||(D={}));class Mt{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):t(typeof e=="string"?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 o=this.HEADER_LENGTH+2;const a=s.decode(e.slice(o,o+r));o=o+r;const c=s.decode(e.slice(o,o+i));o=o+i;const h=JSON.parse(s.decode(e.slice(o,e.byteLength)));return{ref:null,topic:a,event:c,payload:h}}}class at{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))}}var w;(function(n){n.abstime="abstime",n.bool="bool",n.date="date",n.daterange="daterange",n.float4="float4",n.float8="float8",n.int2="int2",n.int4="int4",n.int4range="int4range",n.int8="int8",n.int8range="int8range",n.json="json",n.jsonb="jsonb",n.money="money",n.numeric="numeric",n.oid="oid",n.reltime="reltime",n.text="text",n.time="time",n.timestamp="timestamp",n.timestamptz="timestamptz",n.timetz="timetz",n.tsrange="tsrange",n.tstzrange="tstzrange"})(w||(w={}));const Ne=(n,e,t={})=>{var s;const r=(s=t.skipTypes)!==null&&s!==void 0?s:[];return Object.keys(e).reduce((i,o)=>(i[o]=zt(o,n,e,r),i),{})},zt=(n,e,t,s)=>{const r=e.find(a=>a.name===n),i=r?.type,o=t[n];return i&&!s.includes(i)?ct(i,o):me(o)},ct=(n,e)=>{if(n.charAt(0)==="_"){const t=n.slice(1,n.length);return Gt(e,t)}switch(n){case w.bool:return Jt(e);case w.float4:case w.float8:case w.int2:case w.int4:case w.int8:case w.numeric:case w.oid:return Ht(e);case w.json:case w.jsonb:return Kt(e);case w.timestamp:return Wt(e);case w.abstime:case w.date:case w.daterange:case w.int4range:case w.int8range:case w.money:case w.reltime:case w.text:case w.time:case w.timestamptz:case w.timetz:case w.tsrange:case w.tstzrange:return me(e);default:return me(e)}},me=n=>n,Jt=n=>{switch(n){case"t":return!0;case"f":return!1;default:return n}},Ht=n=>{if(typeof n=="string"){const e=parseFloat(n);if(!Number.isNaN(e))return e}return n},Kt=n=>{if(typeof n=="string")try{return JSON.parse(n)}catch(e){return console.log(`JSON parse error: ${e}`),n}return n},Gt=(n,e)=>{if(typeof n!="string")return n;const t=n.length-1,s=n[t];if(n[0]==="{"&&s==="}"){let i;const o=n.slice(1,t);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(a=>ct(e,a))}return n},Wt=n=>typeof n=="string"?n.replace(" ","T"):n,lt=n=>{let e=n;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")};class fe{constructor(e,t,s={},r=ot){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((s=this.receivedResp)===null||s===void 0?void 0:s.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=t=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=t,this._matchReceive(t)};this.channel._on(this.refEvent,{},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(s=>s.status===e).forEach(s=>s.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var qe;(function(n){n.SYNC="sync",n.JOIN="join",n.LEAVE="leave"})(qe||(qe={}));class se{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const s=t?.events||{state:"presence_state",diff:"presence_diff"};this.channel._on(s.state,{},r=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel._joinRef(),this.state=se.syncState(this.state,r,i,o),this.pendingDiffs.forEach(c=>{this.state=se.syncDiff(this.state,c,i,o)}),this.pendingDiffs=[],a()}),this.channel._on(s.diff,{},r=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(r):(this.state=se.syncDiff(this.state,r,i,o),a())}),this.onJoin((r,i,o)=>{this.channel._trigger("presence",{event:"join",key:r,currentPresences:i,newPresences:o})}),this.onLeave((r,i,o)=>{this.channel._trigger("presence",{event:"leave",key:r,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,s,r){const i=this.cloneDeep(e),o=this.transformState(t),a={},c={};return this.map(i,(h,l)=>{o[h]||(c[h]=l)}),this.map(o,(h,l)=>{const u=i[h];if(u){const d=l.map(p=>p.presence_ref),f=u.map(p=>p.presence_ref),g=l.filter(p=>f.indexOf(p.presence_ref)<0),y=u.filter(p=>d.indexOf(p.presence_ref)<0);g.length>0&&(a[h]=g),y.length>0&&(c[h]=y)}else a[h]=l}),this.syncDiff(i,{joins:a,leaves:c},s,r)}static syncDiff(e,t,s,r){const{joins:i,leaves:o}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return s||(s=()=>{}),r||(r=()=>{}),this.map(i,(a,c)=>{var h;const l=(h=e[a])!==null&&h!==void 0?h:[];if(e[a]=this.cloneDeep(c),l.length>0){const u=e[a].map(f=>f.presence_ref),d=l.filter(f=>u.indexOf(f.presence_ref)<0);e[a].unshift(...d)}s(a,l,c)}),this.map(o,(a,c)=>{let h=e[a];if(!h)return;const l=c.map(u=>u.presence_ref);h=h.filter(u=>l.indexOf(u.presence_ref)<0),e[a]=h,r(a,h,c),h.length===0&&delete e[a]}),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"metas"in r?t[s]=r.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):t[s]=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()}}var Fe;(function(n){n.ALL="*",n.INSERT="INSERT",n.UPDATE="UPDATE",n.DELETE="DELETE"})(Fe||(Fe={}));var Me;(function(n){n.BROADCAST="broadcast",n.PRESENCE="presence",n.POSTGRES_CHANGES="postgres_changes",n.SYSTEM="system"})(Me||(Me={}));var ze;(function(n){n.SUBSCRIBED="SUBSCRIBED",n.TIMED_OUT="TIMED_OUT",n.CLOSED="CLOSED",n.CHANNEL_ERROR="CHANNEL_ERROR"})(ze||(ze={}));class Pe{constructor(e,t={config:{}},s){this.topic=e,this.params=t,this.socket=s,this.bindings={},this.state=P.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},t.config),this.timeout=this.socket.timeout,this.joinPush=new fe(this,$.join,this.params,this.timeout),this.rejoinTimer=new at(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=P.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=P.closed,this.socket._remove(this)}),this._onError(r=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,r),this.state=P.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=P.errored,this.rejoinTimer.scheduleTimeout())}),this._on($.reply,{},(r,i)=>{this._trigger(this._replyEventName(i),r)}),this.presence=new se(this),this.broadcastEndpointURL=lt(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}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:o,private:a}}=this.params;this._onError(l=>e&&e("CHANNEL_ERROR",l)),this._onClose(()=>e&&e("CLOSED"));const c={},h={broadcast:i,presence:o,postgres_changes:(r=(s=this.bindings.postgres_changes)===null||s===void 0?void 0:s.map(l=>l.filter))!==null&&r!==void 0?r:[],private:a};this.socket.accessToken&&(c.access_token=this.socket.accessToken),this.updateJoinPayload(Object.assign({config:h},c)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",({postgres_changes:l})=>{var u;if(this.socket.accessToken&&this.socket.setAuth(this.socket.accessToken),l===void 0){e&&e("SUBSCRIBED");return}else{const d=this.bindings.postgres_changes,f=(u=d?.length)!==null&&u!==void 0?u:0,g=[];for(let y=0;y{e&&e("CHANNEL_ERROR",new Error(JSON.stringify(Object.values(l).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()&&e.type==="broadcast"){const{event:i,payload:o}=e,a={method:"POST",headers:{Authorization:this.socket.accessToken?`Bearer ${this.socket.accessToken}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(s=t.timeout)!==null&&s!==void 0?s:this.timeout);return await((r=c.body)===null||r===void 0?void 0:r.cancel()),c.ok?"ok":"error"}catch(c){return c.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,c;const h=this._push(e.type,e,t.timeout||this.timeout);e.type==="broadcast"&&!(!((c=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||c===void 0)&&c.ack)&&i("ok"),h.receive("ok",()=>i("ok")),h.receive("error",()=>i("error")),h.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=P.leaving;const t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger($.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(s=>{const r=new fe(this,$.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",{})})}async _fetchWithTimeout(e,t,s){const r=new AbortController,i=setTimeout(()=>r.abort(),s),o=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(i),o}_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 fe(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 o=e.toLocaleLowerCase(),{close:a,error:c,leave:h,join:l}=$;if(s&&[a,c,h,l].indexOf(o)>=0&&s!==this._joinRef())return;let d=this._onMessage(o,t,s);if(t&&!d)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(r=this.bindings.postgres_changes)===null||r===void 0||r.filter(f=>{var g,y,p;return((g=f.filter)===null||g===void 0?void 0:g.event)==="*"||((p=(y=f.filter)===null||y===void 0?void 0:y.event)===null||p===void 0?void 0:p.toLocaleLowerCase())===o}).map(f=>f.callback(d,s)):(i=this.bindings[o])===null||i===void 0||i.filter(f=>{var g,y,p,E,A,k;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in f){const S=f.id,T=(g=f.filter)===null||g===void 0?void 0:g.event;return S&&((y=t.ids)===null||y===void 0?void 0:y.includes(S))&&(T==="*"||T?.toLocaleLowerCase()===((p=t.data)===null||p===void 0?void 0:p.type.toLocaleLowerCase()))}else{const S=(A=(E=f?.filter)===null||E===void 0?void 0:E.event)===null||A===void 0?void 0:A.toLocaleLowerCase();return S==="*"||S===((k=t?.event)===null||k===void 0?void 0:k.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===o}).map(f=>{if(typeof d=="object"&&"ids"in d){const g=d.data,{schema:y,table:p,commit_timestamp:E,type:A,errors:k}=g;d=Object.assign(Object.assign({},{schema:y,table:p,commit_timestamp:E,eventType:A,new:{},old:{},errors:k}),this._getPayloadRecords(g))}f.callback(d,s)})}_isClosed(){return this.state===P.closed}_isJoined(){return this.state===P.joined}_isJoining(){return this.state===P.joining}_isLeaving(){return this.state===P.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(r=>{var i;return!(((i=r.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===s&&Pe.isEqual(r.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($.close,{},e)}_onError(e){this._on($.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=P.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const t={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(t.new=Ne(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(t.old=Ne(e.columns,e.old_record)),t}}const Vt=()=>{},Qt=typeof WebSocket<"u",Yt=` - addEventListener("message", (e) => { - if (e.data.event === "start") { - setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); - } - });`;class Xt{constructor(e,t){var s;this.accessToken=null,this.apiKey=null,this.channels=[],this.endPoint="",this.httpEndpoint="",this.headers=Nt,this.params={},this.timeout=ot,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=Vt,this.conn=null,this.sendBuffer=[],this.serializer=new Mt,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this._resolveFetch=i=>{let o;return i?o=i:typeof fetch>"u"?o=(...a)=>V(async()=>{const{default:c}=await Promise.resolve().then(()=>Y);return{default:c}},void 0).then(({default:c})=>c(...a)):o=fetch,(...a)=>o(...a)},this.endPoint=`${e}/${we.websocket}`,this.httpEndpoint=lt(e),t?.transport?this.transport=t.transport:this.transport=null,t?.params&&(this.params=t.params),t?.headers&&(this.headers=Object.assign(Object.assign({},this.headers),t.headers)),t?.timeout&&(this.timeout=t.timeout),t?.logger&&(this.logger=t.logger),t?.heartbeatIntervalMs&&(this.heartbeatIntervalMs=t.heartbeatIntervalMs);const r=(s=t?.params)===null||s===void 0?void 0:s.apikey;if(r&&(this.accessToken=r,this.apiKey=r),this.reconnectAfterMs=t?.reconnectAfterMs?t.reconnectAfterMs:i=>[1e3,2e3,5e3,1e4][i-1]||1e4,this.encode=t?.encode?t.encode:(i,o)=>o(JSON.stringify(i)),this.decode=t?.decode?t.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new at(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(t?.fetch),t?.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=t?.worker||!1,this.workerUrl=t?.workerUrl}}connect(){if(!this.conn){if(this.transport){this.conn=new this.transport(this._endPointURL(),void 0,{headers:this.headers});return}if(Qt){this.conn=new WebSocket(this._endPointURL()),this.setupConnection();return}this.conn=new Zt(this._endPointURL(),void 0,{close:()=>{this.conn=null}}),V(async()=>{const{default:e}=await import("./ws.BkT5Wpo5.js").then(t=>t.b);return{default:e}},__vite__mapDeps([0,1,2])).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,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 this.channels.length===0&&this.disconnect(),t}async removeAllChannels(){const e=await Promise.all(this.channels.map(t=>t.unsubscribe()));return this.disconnect(),e}log(e,t,s){this.logger(e,t,s)}connectionState(){switch(this.conn&&this.conn.readyState){case W.connecting:return D.Connecting;case W.open:return D.Open;case W.closing:return D.Closing;default:return D.Closed}}isConnected(){return this.connectionState()===D.Open}channel(e,t={config:{}}){const s=new Pe(`realtime:${e}`,t,this);return this.channels.push(s),s}push(e){const{topic:t,event:s,payload:r,ref:i}=e,o=()=>{this.encode(e,a=>{var c;(c=this.conn)===null||c===void 0||c.send(a)})};this.log("push",`${t} ${s} (${i})`,r),this.isConnected()?o():this.sendBuffer.push(o)}setAuth(e){this.accessToken=e,this.channels.forEach(t=>{e&&t.updateJoinPayload({access_token:e}),t.joinedOnce&&t._isJoined()&&t._push($.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(s=>s.topic===e&&(s._isJoined()||s._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:qt}))}_onConnMessage(e){this.decode(e.data,t=>{let{topic:s,event:r,payload:i,ref:o}=t;(o&&o===this.pendingHeartbeatRef||r===i?.type)&&(this.pendingHeartbeatRef=null),this.log("receive",`${i.status||""} ${s} ${r} ${o&&"("+o+")"||""}`,i),this.channels.filter(a=>a._isMember(s)).forEach(a=>a._trigger(r,i,o)),this.stateChangeCallbacks.message.forEach(a=>a(t))})}async _onConnOpen(){if(this.log("transport",`connected to ${this._endPointURL()}`),this._flushSendBuffer(),this.reconnectTimer.reset(),!this.worker)this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this._sendHeartbeat(),this.heartbeatIntervalMs);else{this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=t=>{this.log("worker","worker error",t.message),this.workerRef.terminate()},this.workerRef.onmessage=t=>{t.data.event==="keepAlive"&&this._sendHeartbeat()},this.workerRef.postMessage({event:"start",interval: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($.error))}_appendParams(e,t){if(Object.keys(t).length===0)return e;const s=e.match(/\?/)?"&":"?",r=new URLSearchParams(t);return`${e}${s}${r}`}_flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),(e=this.conn)===null||e===void 0||e.close(Ft,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth(this.accessToken)}}_workerObjectUrl(e){let t;if(e)t=e;else{const s=new Blob([Yt],{type:"application/javascript"});t=URL.createObjectURL(s)}return t}}class Zt{constructor(e,t,s){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=W.connecting,this.send=()=>{},this.url=null,this.url=e,this.close=s.close}}class je extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function b(n){return typeof n=="object"&&n!==null&&"__isStorageError"in n}class es extends je{constructor(e,t){super(e),this.name="StorageApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class be extends je{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}var ts=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{h(s.next(l))}catch(u){o(u)}}function c(l){try{h(s.throw(l))}catch(u){o(u)}}function h(l){l.done?i(l.value):r(l.value).then(a,c)}h((s=s.apply(n,e||[])).next())})};const ht=n=>{let e;return n?e=n:typeof fetch>"u"?e=(...t)=>V(async()=>{const{default:s}=await Promise.resolve().then(()=>Y);return{default:s}},void 0).then(({default:s})=>s(...t)):e=fetch,(...t)=>e(...t)},ss=()=>ts(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield V(()=>Promise.resolve().then(()=>Y),void 0)).Response:Response}),ke=n=>{if(Array.isArray(n))return n.map(t=>ke(t));if(typeof n=="function"||n!==Object(n))return n;const e={};return Object.entries(n).forEach(([t,s])=>{const r=t.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[r]=ke(s)}),e};var B=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{h(s.next(l))}catch(u){o(u)}}function c(l){try{h(s.throw(l))}catch(u){o(u)}}function h(l){l.done?i(l.value):r(l.value).then(a,c)}h((s=s.apply(n,e||[])).next())})};const ge=n=>n.msg||n.message||n.error_description||n.error||JSON.stringify(n),rs=(n,e,t)=>B(void 0,void 0,void 0,function*(){const s=yield ss();n instanceof s&&!t?.noResolveJson?n.json().then(r=>{e(new es(ge(r),n.status||500))}).catch(r=>{e(new be(ge(r),r))}):e(new be(ge(n),n))}),is=(n,e,t,s)=>{const r={method:n,headers:e?.headers||{}};return n==="GET"?r:(r.headers=Object.assign({"Content-Type":"application/json"},e?.headers),s&&(r.body=JSON.stringify(s)),Object.assign(Object.assign({},r),t))};function ne(n,e,t,s,r,i){return B(this,void 0,void 0,function*(){return new Promise((o,a)=>{n(t,is(e,s,r,i)).then(c=>{if(!c.ok)throw c;return s?.noResolveJson?c:c.json()}).then(c=>o(c)).catch(c=>rs(c,a,s))})})}function ue(n,e,t,s){return B(this,void 0,void 0,function*(){return ne(n,"GET",e,t,s)})}function x(n,e,t,s,r){return B(this,void 0,void 0,function*(){return ne(n,"POST",e,s,r,t)})}function ns(n,e,t,s,r){return B(this,void 0,void 0,function*(){return ne(n,"PUT",e,s,r,t)})}function os(n,e,t,s){return B(this,void 0,void 0,function*(){return ne(n,"HEAD",e,Object.assign(Object.assign({},t),{noResolveJson:!0}),s)})}function ut(n,e,t,s,r){return B(this,void 0,void 0,function*(){return ne(n,"DELETE",e,s,r,t)})}var O=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{h(s.next(l))}catch(u){o(u)}}function c(l){try{h(s.throw(l))}catch(u){o(u)}}function h(l){l.done?i(l.value):r(l.value).then(a,c)}h((s=s.apply(n,e||[])).next())})};const as={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Je={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class cs{constructor(e,t={},s,r){this.url=e,this.headers=t,this.bucketId=s,this.fetch=ht(r)}uploadOrUpdate(e,t,s,r){return O(this,void 0,void 0,function*(){try{let i;const o=Object.assign(Object.assign({},Je),r);let a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const c=o.metadata;typeof Blob<"u"&&s instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c)),i.append("",s)):typeof FormData<"u"&&s instanceof FormData?(i=s,i.append("cacheControl",o.cacheControl),c&&i.append("metadata",this.encodeMetadata(c))):(i=s,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,c&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(c)))),r?.headers&&(a=Object.assign(Object.assign({},a),r.headers));const h=this._removeEmptyFolders(t),l=this._getFinalPath(h),u=yield this.fetch(`${this.url}/object/${l}`,Object.assign({method:e,body:i,headers:a},o?.duplex?{duplex:o.duplex}:{})),d=yield u.json();return u.ok?{data:{path:h,id:d.Id,fullPath:d.Key},error:null}:{data:null,error:d}}catch(i){if(b(i))return{data:null,error:i};throw i}})}upload(e,t,s){return O(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,s)})}uploadToSignedUrl(e,t,s,r){return O(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(e),o=this._getFinalPath(i),a=new URL(this.url+`/object/upload/sign/${o}`);a.searchParams.set("token",t);try{let c;const h=Object.assign({upsert:Je.upsert},r),l=Object.assign(Object.assign({},this.headers),{"x-upsert":String(h.upsert)});typeof Blob<"u"&&s instanceof Blob?(c=new FormData,c.append("cacheControl",h.cacheControl),c.append("",s)):typeof FormData<"u"&&s instanceof FormData?(c=s,c.append("cacheControl",h.cacheControl)):(c=s,l["cache-control"]=`max-age=${h.cacheControl}`,l["content-type"]=h.contentType);const u=yield this.fetch(a.toString(),{method:"PUT",body:c,headers:l}),d=yield u.json();return u.ok?{data:{path:i,fullPath:d.Key},error:null}:{data:null,error:d}}catch(c){if(b(c))return{data:null,error:c};throw c}})}createSignedUploadUrl(e,t){return O(this,void 0,void 0,function*(){try{let s=this._getFinalPath(e);const r=Object.assign({},this.headers);t?.upsert&&(r["x-upsert"]="true");const i=yield x(this.fetch,`${this.url}/object/upload/sign/${s}`,{},{headers:r}),o=new URL(this.url+i.url),a=o.searchParams.get("token");if(!a)throw new je("No token returned by API");return{data:{signedUrl:o.toString(),path:e,token:a},error:null}}catch(s){if(b(s))return{data:null,error:s};throw s}})}update(e,t,s){return O(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,s)})}move(e,t,s){return O(this,void 0,void 0,function*(){try{return{data:yield x(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:s?.destinationBucket},{headers:this.headers}),error:null}}catch(r){if(b(r))return{data:null,error:r};throw r}})}copy(e,t,s){return O(this,void 0,void 0,function*(){try{return{data:{path:(yield x(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:s?.destinationBucket},{headers:this.headers})).Key},error:null}}catch(r){if(b(r))return{data:null,error:r};throw r}})}createSignedUrl(e,t,s){return O(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e),i=yield x(this.fetch,`${this.url}/object/sign/${r}`,Object.assign({expiresIn:t},s?.transform?{transform:s.transform}:{}),{headers:this.headers});const o=s?.download?`&download=${s.download===!0?"":s.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(r){if(b(r))return{data:null,error:r};throw r}})}createSignedUrls(e,t,s){return O(this,void 0,void 0,function*(){try{const r=yield x(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),i=s?.download?`&download=${s.download===!0?"":s.download}`:"";return{data:r.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${i}`):null})),error:null}}catch(r){if(b(r))return{data:null,error:r};throw r}})}download(e,t){return O(this,void 0,void 0,function*(){const r=typeof t?.transform<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString(t?.transform||{}),o=i?`?${i}`:"";try{const a=this._getFinalPath(e);return{data:yield(yield ue(this.fetch,`${this.url}/${r}/${a}${o}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if(b(a))return{data:null,error:a};throw a}})}info(e){return O(this,void 0,void 0,function*(){const t=this._getFinalPath(e);try{const s=yield ue(this.fetch,`${this.url}/object/info/${t}`,{headers:this.headers});return{data:ke(s),error:null}}catch(s){if(b(s))return{data:null,error:s};throw s}})}exists(e){return O(this,void 0,void 0,function*(){const t=this._getFinalPath(e);try{return yield os(this.fetch,`${this.url}/object/${t}`,{headers:this.headers}),{data:!0,error:null}}catch(s){if(b(s)&&s instanceof be){const r=s.originalError;if([400,404].includes(r?.status))return{data:!1,error:s}}throw s}})}getPublicUrl(e,t){const s=this._getFinalPath(e),r=[],i=t?.download?`download=${t.download===!0?"":t.download}`:"";i!==""&&r.push(i);const a=typeof t?.transform<"u"?"render/image":"object",c=this.transformOptsToQueryString(t?.transform||{});c!==""&&r.push(c);let h=r.join("&");return h!==""&&(h=`?${h}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${s}${h}`)}}}remove(e){return O(this,void 0,void 0,function*(){try{return{data:yield ut(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(t){if(b(t))return{data:null,error:t};throw t}})}list(e,t,s){return O(this,void 0,void 0,function*(){try{const r=Object.assign(Object.assign(Object.assign({},as),t),{prefix:e||""});return{data:yield x(this.fetch,`${this.url}/object/list/${this.bucketId}`,r,{headers:this.headers},s),error:null}}catch(r){if(b(r))return{data:null,error:r};throw r}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(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 ls="2.7.1",hs={"X-Client-Info":`storage-js/${ls}`};var H=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{h(s.next(l))}catch(u){o(u)}}function c(l){try{h(s.throw(l))}catch(u){o(u)}}function h(l){l.done?i(l.value):r(l.value).then(a,c)}h((s=s.apply(n,e||[])).next())})};class us{constructor(e,t={},s){this.url=e,this.headers=Object.assign(Object.assign({},hs),t),this.fetch=ht(s)}listBuckets(){return H(this,void 0,void 0,function*(){try{return{data:yield ue(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(b(e))return{data:null,error:e};throw e}})}getBucket(e){return H(this,void 0,void 0,function*(){try{return{data:yield ue(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(t){if(b(t))return{data:null,error:t};throw t}})}createBucket(e,t={public:!1}){return H(this,void 0,void 0,function*(){try{return{data:yield x(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(s){if(b(s))return{data:null,error:s};throw s}})}updateBucket(e,t){return H(this,void 0,void 0,function*(){try{return{data:yield ns(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}),error:null}}catch(s){if(b(s))return{data:null,error:s};throw s}})}emptyBucket(e){return H(this,void 0,void 0,function*(){try{return{data:yield x(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(t){if(b(t))return{data:null,error:t};throw t}})}deleteBucket(e){return H(this,void 0,void 0,function*(){try{return{data:yield ut(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(t){if(b(t))return{data:null,error:t};throw t}})}}class ds extends us{constructor(e,t={},s){super(e,t,s)}from(e){return new cs(this.url,this.headers,e,this.fetch)}}const fs="2.45.6";let te="";typeof Deno<"u"?te="deno":typeof document<"u"?te="web":typeof navigator<"u"&&navigator.product==="ReactNative"?te="react-native":te="node";const gs={"X-Client-Info":`supabase-js-${te}/${fs}`},ps={headers:gs},_s={schema:"public"},vs={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},ys={};var ws=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{h(s.next(l))}catch(u){o(u)}}function c(l){try{h(s.throw(l))}catch(u){o(u)}}function h(l){l.done?i(l.value):r(l.value).then(a,c)}h((s=s.apply(n,e||[])).next())})};const ms=n=>{let e;return n?e=n:typeof fetch>"u"?e=et:e=fetch,(...t)=>e(...t)},bs=()=>typeof Headers>"u"?tt:Headers,ks=(n,e,t)=>{const s=ms(t),r=bs();return(i,o)=>ws(void 0,void 0,void 0,function*(){var a;const c=(a=yield e())!==null&&a!==void 0?a:n;let h=new r(o?.headers);return h.has("apikey")||h.set("apikey",n),h.has("Authorization")||h.set("Authorization",`Bearer ${c}`),s(i,Object.assign(Object.assign({},o),{headers:h}))})};var Ss=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{h(s.next(l))}catch(u){o(u)}}function c(l){try{h(s.throw(l))}catch(u){o(u)}}function h(l){l.done?i(l.value):r(l.value).then(a,c)}h((s=s.apply(n,e||[])).next())})};function Ts(n){return n.replace(/\/$/,"")}function Es(n,e){const{db:t,auth:s,realtime:r,global:i}=n,{db:o,auth:a,realtime:c,global:h}=e,l={db:Object.assign(Object.assign({},o),t),auth:Object.assign(Object.assign({},a),s),realtime:Object.assign(Object.assign({},c),r),global:Object.assign(Object.assign({},h),i),accessToken:()=>Ss(this,void 0,void 0,function*(){return""})};return n.accessToken?l.accessToken=n.accessToken:delete l.accessToken,l}const dt="2.65.1",Os="http://localhost:9999",Ps="supabase.auth.token",js={"X-Client-Info":`gotrue-js/${dt}`},He=10,Se="X-Supabase-Api-Version",ft={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}};function $s(n){return Math.round(Date.now()/1e3)+n}function As(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const e=Math.random()*16|0;return(n=="x"?e:e&3|8).toString(16)})}const j=()=>typeof document<"u",L={tested:!1,writable:!1},re=()=>{if(!j())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(L.tested)return L.writable;const n=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(n,n),globalThis.localStorage.removeItem(n),L.tested=!0,L.writable=!0}catch{L.tested=!0,L.writable=!1}return L.writable};function pe(n){const e={},t=new URL(n);if(t.hash&&t.hash[0]==="#")try{new URLSearchParams(t.hash.substring(1)).forEach((r,i)=>{e[i]=r})}catch{}return t.searchParams.forEach((s,r)=>{e[r]=s}),e}const gt=n=>{let e;return n?e=n:typeof fetch>"u"?e=(...t)=>V(async()=>{const{default:s}=await Promise.resolve().then(()=>Y);return{default:s}},void 0).then(({default:s})=>s(...t)):e=fetch,(...t)=>e(...t)},Rs=n=>typeof n=="object"&&n!==null&&"status"in n&&"ok"in n&&"json"in n&&typeof n.json=="function",pt=async(n,e,t)=>{await n.setItem(e,JSON.stringify(t))},ae=async(n,e)=>{const t=await n.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch{return t}},ce=async(n,e)=>{await n.removeItem(e)};function Cs(n){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let t="",s,r,i,o,a,c,h,l=0;for(n=n.replace("-","+").replace("_","/");l>4,r=(a&15)<<4|c>>2,i=(c&3)<<6|h,t=t+String.fromCharCode(s),c!=64&&r!=0&&(t=t+String.fromCharCode(r)),h!=64&&i!=0&&(t=t+String.fromCharCode(i));return t}class de{constructor(){this.promise=new de.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}de.promiseConstructor=Promise;function Ke(n){const e=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,t=n.split(".");if(t.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!e.test(t[1]))throw new Error("JWT is not valid: payload is not in base64url format");const s=t[1];return JSON.parse(Cs(s))}async function xs(n){return await new Promise(e=>{setTimeout(()=>e(null),n)})}function Is(n,e){return new Promise((s,r)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await n(i);if(!e(i,null,o)){s(o);return}}catch(o){if(!e(i,o)){r(o);return}}})()})}function Ls(n){return("0"+n.toString(16)).substr(-2)}function Us(){const e=new Uint32Array(56);if(typeof crypto>"u"){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",s=t.length;let r="";for(let i=0;i<56;i++)r+=t.charAt(Math.floor(Math.random()*s));return r}return crypto.getRandomValues(e),Array.from(e,Ls).join("")}async function Ds(n){const t=new TextEncoder().encode(n),s=await crypto.subtle.digest("SHA-256",t),r=new Uint8Array(s);return Array.from(r).map(i=>String.fromCharCode(i)).join("")}function Bs(n){return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Ns(n){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),n;const t=await Ds(n);return Bs(t)}async function K(n,e,t=!1){const s=Us();let r=s;t&&(r+="/PASSWORD_RECOVERY"),await pt(n,`${e}-code-verifier`,r);const i=await Ns(s);return[i,s===i?"plain":"s256"]}const qs=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Fs(n){const e=n.headers.get(Se);if(!e||!e.match(qs))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}class $e extends Error{constructor(e,t,s){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=s}}function _(n){return typeof n=="object"&&n!==null&&"__isAuthError"in n}class Ms extends $e{constructor(e,t,s){super(e,t,s),this.name="AuthApiError",this.status=t,this.code=s}}function zs(n){return _(n)&&n.name==="AuthApiError"}class _t extends $e{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class N extends $e{constructor(e,t,s,r){super(e,s,r),this.name=t,this.status=s}}class R extends N{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Js(n){return _(n)&&n.name==="AuthSessionMissingError"}class _e extends N{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class le extends N{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class he extends N{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Ge extends N{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Te extends N{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function ve(n){return _(n)&&n.name==="AuthRetryableFetchError"}class We extends N{constructor(e,t,s){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=s}}var Hs=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);rn.msg||n.message||n.error_description||n.error||JSON.stringify(n),Ks=[502,503,504];async function Ve(n){var e;if(!Rs(n))throw new Te(U(n),0);if(Ks.includes(n.status))throw new Te(U(n),n.status);let t;try{t=await n.json()}catch(i){throw new _t(U(i),i)}let s;const r=Fs(n);if(r&&r.getTime()>=ft["2024-01-01"].timestamp&&typeof t=="object"&&t&&typeof t.code=="string"?s=t.code:typeof t=="object"&&t&&typeof t.error_code=="string"&&(s=t.error_code),s){if(s==="weak_password")throw new We(U(t),n.status,((e=t.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(s==="session_not_found")throw new R}else if(typeof t=="object"&&t&&typeof t.weak_password=="object"&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((i,o)=>i&&typeof o=="string",!0))throw new We(U(t),n.status,t.weak_password.reasons);throw new Ms(U(t),n.status||500,s)}const Gs=(n,e,t,s)=>{const r={method:n,headers:e?.headers||{}};return n==="GET"?r:(r.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e?.headers),r.body=JSON.stringify(s),Object.assign(Object.assign({},r),t))};async function v(n,e,t,s){var r;const i=Object.assign({},s?.headers);i[Se]||(i[Se]=ft["2024-01-01"].name),s?.jwt&&(i.Authorization=`Bearer ${s.jwt}`);const o=(r=s?.query)!==null&&r!==void 0?r:{};s?.redirectTo&&(o.redirect_to=s.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",c=await Ws(n,e,t+a,{headers:i,noResolveJson:s?.noResolveJson},{},s?.body);return s?.xform?s?.xform(c):{data:Object.assign({},c),error:null}}async function Ws(n,e,t,s,r,i){const o=Gs(e,s,r,i);let a;try{a=await n(t,Object.assign({},o))}catch(c){throw console.error(c),new Te(U(c),0)}if(a.ok||await Ve(a),s?.noResolveJson)return a;try{return await a.json()}catch(c){await Ve(c)}}function C(n){var e;let t=null;Xs(n)&&(t=Object.assign({},n),n.expires_at||(t.expires_at=$s(n.expires_in)));const s=(e=n.user)!==null&&e!==void 0?e:n;return{data:{session:t,user:s},error:null}}function Qe(n){const e=C(n);return!e.error&&n.weak_password&&typeof n.weak_password=="object"&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.message&&typeof n.weak_password.message=="string"&&n.weak_password.reasons.reduce((t,s)=>t&&typeof s=="string",!0)&&(e.data.weak_password=n.weak_password),e}function I(n){var e;return{data:{user:(e=n.user)!==null&&e!==void 0?e:n},error:null}}function Vs(n){return{data:n,error:null}}function Qs(n){const{action_link:e,email_otp:t,hashed_token:s,redirect_to:r,verification_type:i}=n,o=Hs(n,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:t,hashed_token:s,redirect_to:r,verification_type:i},c=Object.assign({},o);return{data:{properties:a,user:c},error:null}}function Ys(n){return n}function Xs(n){return n.access_token&&n.refresh_token&&n.expires_in}var Zs=function(n,e){var t={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.indexOf(s)<0&&(t[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(n);r0&&(f.forEach(g=>{const y=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),p=JSON.parse(g.split(";")[1].split("=")[1]);h[`${p}Page`]=y}),h.total=parseInt(d)),{data:Object.assign(Object.assign({},u),h),error:null}}catch(h){if(_(h))return{data:{users:[]},error:h};throw h}}async getUserById(e){try{return await v(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:I})}catch(t){if(_(t))return{data:{user:null},error:t};throw t}}async updateUserById(e,t){try{return await v(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:I})}catch(s){if(_(s))return{data:{user:null},error:s};throw s}}async deleteUser(e,t=!1){try{return await v(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:I})}catch(s){if(_(s))return{data:{user:null},error:s};throw s}}async _listFactors(e){try{const{data:t,error:s}=await v(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:r=>({data:{factors:r},error:null})});return{data:t,error:s}}catch(t){if(_(t))return{data:null,error:t};throw t}}async _deleteFactor(e){try{return{data:await v(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(t){if(_(t))return{data:null,error:t};throw t}}}const tr={getItem:n=>re()?globalThis.localStorage.getItem(n):null,setItem:(n,e)=>{re()&&globalThis.localStorage.setItem(n,e)},removeItem:n=>{re()&&globalThis.localStorage.removeItem(n)}};function Ye(n={}){return{getItem:e=>n[e]||null,setItem:(e,t)=>{n[e]=t},removeItem:e=>{delete n[e]}}}function sr(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}const G={debug:!!(globalThis&&re()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class vt extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class rr extends vt{}async function ir(n,e,t){G.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",n,e);const s=new globalThis.AbortController;return e>0&&setTimeout(()=>{s.abort(),G.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",n)},e),await globalThis.navigator.locks.request(n,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:s.signal},async r=>{if(r){G.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",n,r.name);try{return await t()}finally{G.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",n,r.name)}}else{if(e===0)throw G.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",n),new rr(`Acquiring an exclusive Navigator LockManager lock "${n}" immediately failed`);if(G.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null," "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}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 t()}})}sr();const nr={url:Os,storageKey:Ps,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:js,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1},ee=30*1e3,Xe=3;async function Ze(n,e,t){return await t()}class ie{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.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=ie.nextInstanceID,ie.nextInstanceID+=1,this.instanceID>0&&j()&&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 r=Object.assign(Object.assign({},nr),e);if(this.logDebugMessages=!!r.debug,typeof r.debug=="function"&&(this.logger=r.debug),this.persistSession=r.persistSession,this.storageKey=r.storageKey,this.autoRefreshToken=r.autoRefreshToken,this.admin=new er({url:r.url,headers:r.headers,fetch:r.fetch}),this.url=r.url,this.headers=r.headers,this.fetch=gt(r.fetch),this.lock=r.lock||Ze,this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.flowType,this.hasCustomAuthorizationHeader=r.hasCustomAuthorizationHeader,r.lock?this.lock=r.lock:j()&&(!((t=globalThis?.navigator)===null||t===void 0)&&t.locks)?this.lock=ir:this.lock=Ze,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?r.storage?this.storage=r.storage:re()?this.storage=tr:(this.memoryStorage={},this.storage=Ye(this.memoryStorage)):(this.memoryStorage={},this.storage=Ye(this.memoryStorage)),j()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${dt}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){try{const e=j()?await this._isPKCEFlow():!1;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),s?.code==="identity_already_exists"?{error:s}:(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()=>{i==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",r):await this._notifyAllSubscribers("SIGNED_IN",r)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return _(e)?{error:e}:{error:new _t("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,s,r;try{const i=await v(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(s=(t=e?.options)===null||t===void 0?void 0:t.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:(r=e?.options)===null||r===void 0?void 0:r.captchaToken}},xform:C}),{data:o,error:a}=i;if(a||!o)return{data:{user:null,session:null},error:a};const c=o.session,h=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:h,session:c},error:null}}catch(i){if(_(i))return{data:{user:null,session:null},error:i};throw i}}async signUp(e){var t,s,r;try{let i;if("email"in e){const{email:l,password:u,options:d}=e;let f=null,g=null;this.flowType==="pkce"&&([f,g]=await K(this.storage,this.storageKey)),i=await v(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:d?.emailRedirectTo,body:{email:l,password:u,data:(t=d?.data)!==null&&t!==void 0?t:{},gotrue_meta_security:{captcha_token:d?.captchaToken},code_challenge:f,code_challenge_method:g},xform:C})}else if("phone"in e){const{phone:l,password:u,options:d}=e;i=await v(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:l,password:u,data:(s=d?.data)!==null&&s!==void 0?s:{},channel:(r=d?.channel)!==null&&r!==void 0?r:"sms",gotrue_meta_security:{captcha_token:d?.captchaToken}},xform:C})}else throw new le("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return{data:{user:null,session:null},error:a};const c=o.session,h=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",c)),{data:{user:h,session:c},error:null}}catch(i){if(_(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithPassword(e){try{let t;if("email"in e){const{email:i,password:o,options:a}=e;t=await v(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:Qe})}else if("phone"in e){const{phone:i,password:o,options:a}=e;t=await v(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:Qe})}else throw new le("You must provide either an email or phone number and a password");const{data:s,error:r}=t;return r?{data:{user:null,session:null},error:r}:!s||!s.session||!s.user?{data:{user:null,session:null},error:new _e}:(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})}catch(t){if(_(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOAuth(e){var t,s,r,i;return await this._handleProviderSignIn(e.provider,{redirectTo:(t=e.options)===null||t===void 0?void 0:t.redirectTo,scopes:(s=e.options)===null||s===void 0?void 0:s.scopes,queryParams:(r=e.options)===null||r===void 0?void 0:r.queryParams,skipBrowserRedirect:(i=e.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){const t=await ae(this.storage,`${this.storageKey}-code-verifier`),[s,r]=(t??"").split("/");try{const{data:i,error:o}=await v(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:s},xform:C});if(await ce(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!i||!i.session||!i.user?{data:{user:null,session:null,redirectType:null},error:new _e}:(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign(Object.assign({},i),{redirectType:r??null}),error:o})}catch(i){if(_(i))return{data:{user:null,session:null,redirectType:null},error:i};throw i}}async signInWithIdToken(e){try{const{options:t,provider:s,token:r,access_token:i,nonce:o}=e,a=await v(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:r,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:t?.captchaToken}},xform:C}),{data:c,error:h}=a;return h?{data:{user:null,session:null},error:h}:!c||!c.session||!c.user?{data:{user:null,session:null},error:new _e}:(c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),{data:c,error:h})}catch(t){if(_(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOtp(e){var t,s,r,i,o;try{if("email"in e){const{email:a,options:c}=e;let h=null,l=null;this.flowType==="pkce"&&([h,l]=await K(this.storage,this.storageKey));const{error:u}=await v(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(t=c?.data)!==null&&t!==void 0?t:{},create_user:(s=c?.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:c?.captchaToken},code_challenge:h,code_challenge_method:l},redirectTo:c?.emailRedirectTo});return{data:{user:null,session:null},error:u}}if("phone"in e){const{phone:a,options:c}=e,{data:h,error:l}=await v(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(r=c?.data)!==null&&r!==void 0?r:{},create_user:(i=c?.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:c?.captchaToken},channel:(o=c?.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:h?.message_id},error:l}}throw new le("You must provide either an email or phone number.")}catch(a){if(_(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var t,s;try{let r,i;"options"in e&&(r=(t=e.options)===null||t===void 0?void 0:t.redirectTo,i=(s=e.options)===null||s===void 0?void 0:s.captchaToken);const{data:o,error:a}=await v(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:r,xform:C});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const c=o.session,h=o.user;return c?.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),{data:{user:h,session:c},error:null}}catch(r){if(_(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithSSO(e){var t,s,r;try{let i=null,o=null;return this.flowType==="pkce"&&([i,o]=await K(this.storage,this.storageKey)),await v(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:(s=(t=e.options)===null||t===void 0?void 0:t.redirectTo)!==null&&s!==void 0?s:void 0}),!((r=e?.options)===null||r===void 0)&&r.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:i,code_challenge_method:o}),headers:this.headers,xform:Vs})}catch(i){if(_(i))return{data:null,error:i};throw i}}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 R;const{error:r}=await v(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return{data:{user:null,session:null},error:r}})}catch(e){if(_(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{const t=`${this.url}/resend`;if("email"in e){const{email:s,type:r,options:i}=e,{error:o}=await v(this.fetch,"POST",t,{headers:this.headers,body:{email:s,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}},redirectTo:i?.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in e){const{phone:s,type:r,options:i}=e,{data:o,error:a}=await v(this.fetch,"POST",t,{headers:this.headers,body:{phone:s,type:r,gotrue_meta_security:{captcha_token:i?.captchaToken}}});return{data:{user:null,session:null,messageId:o?.message_id},error:a}}throw new le("You must provide either an email or phone number and a type")}catch(t){if(_(t))return{data:{user:null,session:null},error:t};throw t}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async t=>t))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const s=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=(async()=>(await s,await t()))();return this.pendingInLock.push((async()=>{try{await r}catch{}})()),r}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const s=t();for(this.pendingInLock.push((async()=>{try{await s}catch{}})()),await s;this.pendingInLock.length;){const r=[...this.pendingInLock];await Promise.all(r),this.pendingInLock.splice(0,r.length)}return await s}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 ae(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),t!==null&&(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:!1;if(this._debug("#__loadSession()",`session has${s?"":" not"} expired`,"expires_at",e.expires_at),!s){if(this.storage.isServer){let o=this.suppressGetSessionWarning;e=new Proxy(e,{get:(c,h,l)=>(!o&&h==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and many not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),o=!0,this.suppressGetSessionWarning=!0),Reflect.get(c,h,l))})}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,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await v(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:I}):await this._useSession(async t=>{var s,r,i;const{data:o,error:a}=t;if(a)throw a;return!(!((s=o.session)===null||s===void 0)&&s.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new R}:await v(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(r=o.session)===null||r===void 0?void 0:r.access_token)!==null&&i!==void 0?i:void 0,xform:I})})}catch(t){if(_(t))return Js(t)&&(await this._removeSession(),await ce(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:t};throw t}}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 R;const o=r.session;let a=null,c=null;this.flowType==="pkce"&&e.email!=null&&([a,c]=await K(this.storage,this.storageKey));const{data:h,error:l}=await v(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:t?.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:c}),jwt:o.access_token,xform:I});if(l)throw l;return o.user=h.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(s){if(_(s))return{data:{user:null},error:s};throw s}}_decodeJWT(e){return Ke(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 R;const t=Date.now()/1e3;let s=t,r=!0,i=null;const o=Ke(e.access_token);if(o.exp&&(s=o.exp,r=s<=t),r){const{session:a,error:c}=await this._callRefreshToken(e.refresh_token);if(c)return{data:{user:null,session:null},error:c};if(!a)return{data:{user:null,session:null},error:null};i=a}else{const{data:a,error:c}=await this._getUser(e.access_token);if(c)throw c;i={access_token:e.access_token,refresh_token:e.refresh_token,user:a.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(t){if(_(t))return{data:{session:null,user:null},error:t};throw t}}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:o,error:a}=t;if(a)throw a;e=(s=o.session)!==null&&s!==void 0?s:void 0}if(!e?.refresh_token)throw new R;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(t){if(_(t))return{data:{user:null,session:null},error:t};throw t}}async _getSessionFromURL(e){try{if(!j())throw new he("No browser detected.");if(this.flowType==="implicit"&&!this._isImplicitGrantFlow())throw new he("Not a valid implicit grant flow url.");if(this.flowType=="pkce"&&!e)throw new Ge("Not a valid PKCE flow url.");const t=pe(window.location.href);if(e){if(!t.code)throw new Ge("No code detected.");const{data:A,error:k}=await this._exchangeCodeForSession(t.code);if(k)throw k;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:A.session,redirectType:null},error:null}}if(t.error||t.error_description||t.error_code)throw new he(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:r,access_token:i,refresh_token:o,expires_in:a,expires_at:c,token_type:h}=t;if(!i||!a||!o||!h)throw new he("No session defined in URL");const l=Math.round(Date.now()/1e3),u=parseInt(a);let d=l+u;c&&(d=parseInt(c));const f=d-l;f*1e3<=ee&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${u}s`);const g=d-u;l-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,d,l):l-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,d,l);const{data:y,error:p}=await this._getUser(i);if(p)throw p;const E={provider_token:s,provider_refresh_token:r,access_token:i,expires_in:u,expires_at:d,refresh_token:o,token_type:h,user:y.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:E,redirectType:t.type},error:null}}catch(t){if(_(t))return{data:{session:null,redirectType:null},error:t};throw t}}_isImplicitGrantFlow(){const e=pe(window.location.href);return!!(j()&&(e.access_token||e.error_description))}async _isPKCEFlow(){const e=pe(window.location.href),t=await ae(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 o=(s=r.session)===null||s===void 0?void 0:s.access_token;if(o){const{error:a}=await this.admin.signOut(o,e);if(a&&!(zs(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return e!=="others"&&(await this._removeSession(),await ce(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){const t=As(),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:i},error:o}=t;if(o)throw o;await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",e,"session",i)}catch(i){await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",i),console.error(i)}})}async resetPasswordForEmail(e,t={}){let s=null,r=null;this.flowType==="pkce"&&([s,r]=await K(this.storage,this.storageKey,!0));try{return await v(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(i){if(_(i))return{data:null,error:i};throw i}}async getUserIdentities(){var e;try{const{data:t,error:s}=await this.getUser();if(s)throw s;return{data:{identities:(e=t.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(t){if(_(t))return{data:null,error:t};throw t}}async linkIdentity(e){var t;try{const{data:s,error:r}=await this._useSession(async i=>{var o,a,c,h,l;const{data:u,error:d}=i;if(d)throw d;const f=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(c=e.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await v(this.fetch,"GET",f,{headers:this.headers,jwt:(l=(h=u.session)===null||h===void 0?void 0:h.access_token)!==null&&l!==void 0?l:void 0})});if(r)throw r;return j()&&!(!((t=e.options)===null||t===void 0)&&t.skipBrowserRedirect)&&window.location.assign(s?.url),{data:{provider:e.provider,url:s?.url},error:null}}catch(s){if(_(s))return{data:{provider:e.provider,url:null},error:s};throw s}}async unlinkIdentity(e){try{return await this._useSession(async t=>{var s,r;const{data:i,error:o}=t;if(o)throw o;return await v(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(r=(s=i.session)===null||s===void 0?void 0:s.access_token)!==null&&r!==void 0?r:void 0})})}catch(t){if(_(t))return{data:null,error:t};throw t}}async _refreshAccessToken(e){const t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{const s=Date.now();return await Is(async r=>(r>0&&await xs(200*Math.pow(2,r-1)),this._debug(t,"refreshing attempt",r),await v(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:C})),(r,i)=>{const o=200*Math.pow(2,r);return i&&ve(i)&&Date.now()+o-s{try{await a.callback(e,t)}catch(c){i.push(c)}});if(await Promise.all(o),i.length>0){for(let a=0;athis._autoRefreshTokenTick(),ee);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&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){this._debug("#_autoRefreshTokenTick()","no session");return}const r=Math.floor((s.expires_at*1e3-e)/ee);this._debug("#_autoRefreshTokenTick()",`access token expires in ${r} ticks, a tick lasts ${ee}ms, refresh threshold is ${Xe} ticks`),r<=Xe&&await this._callRefreshToken(s.refresh_token)})}catch(t){console.error("Auto refresh tick failed with error. This is likely a transient error.",t)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof vt)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!j()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),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),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,s){const r=[`provider=${encodeURIComponent(t)}`];if(s?.redirectTo&&r.push(`redirect_to=${encodeURIComponent(s.redirectTo)}`),s?.scopes&&r.push(`scopes=${encodeURIComponent(s.scopes)}`),this.flowType==="pkce"){const[i,o]=await K(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});r.push(a.toString())}if(s?.queryParams){const i=new URLSearchParams(s.queryParams);r.push(i.toString())}return 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 v(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(s=r?.session)===null||s===void 0?void 0:s.access_token})})}catch(t){if(_(t))return{data:null,error:t};throw t}}async _enroll(e){try{return await this._useSession(async t=>{var s,r;const{data:i,error:o}=t;if(o)return{data:null,error:o};const a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:c,error:h}=await v(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(s=i?.session)===null||s===void 0?void 0:s.access_token});return h?{data:null,error:h}:(e.factorType==="totp"&&(!((r=c?.totp)===null||r===void 0)&&r.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),{data:c,error:null})})}catch(t){if(_(t))return{data:null,error:t};throw t}}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:o,error:a}=await v(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(s=r?.session)===null||s===void 0?void 0:s.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),{data:o,error:a})})}catch(t){if(_(t))return{data:null,error:t};throw t}})}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 v(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(s=r?.session)===null||s===void 0?void 0:s.access_token})})}catch(t){if(_(t))return{data:null,error:t};throw t}})}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=e?.factors||[],r=s.filter(o=>o.factor_type==="totp"&&o.status==="verified"),i=s.filter(o=>o.factor_type==="phone"&&o.status==="verified");return{data:{all:s,totp:r,phone:i},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 o=this._decodeJWT(r.access_token);let a=null;o.aal&&(a=o.aal);let c=a;((s=(t=r.user.factors)===null||t===void 0?void 0:t.filter(u=>u.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(c="aal2");const l=o.amr||[];return{data:{currentLevel:a,nextLevel:c,currentAuthenticationMethods:l},error:null}}))}}ie.nextInstanceID=0;const or=ie;class ar extends or{constructor(e){super(e)}}var cr=function(n,e,t,s){function r(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{h(s.next(l))}catch(u){o(u)}}function c(l){try{h(s.throw(l))}catch(u){o(u)}}function h(l){l.done?i(l.value):r(l.value).then(a,c)}h((s=s.apply(n,e||[])).next())})};class lr{constructor(e,t,s){var r,i,o;if(this.supabaseUrl=e,this.supabaseKey=t,!e)throw new Error("supabaseUrl is required.");if(!t)throw new Error("supabaseKey is required.");const a=Ts(e);this.realtimeUrl=`${a}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${a}/auth/v1`,this.storageUrl=`${a}/storage/v1`,this.functionsUrl=`${a}/functions/v1`;const c=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,h={db:_s,realtime:ys,auth:Object.assign(Object.assign({},vs),{storageKey:c}),global:ps},l=Es(s??{},h);this.storageKey=(r=l.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(i=l.global.headers)!==null&&i!==void 0?i:{},l.accessToken?(this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(u,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=l.auth)!==null&&o!==void 0?o:{},this.headers,l.global.fetch),this.fetch=ks(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},l.realtime)),this.rest=new Dt(`${a}/rest/v1`,{headers:this.headers,schema:l.db.schema,fetch:this.fetch}),l.accessToken||this._listenForAuthEvents()}get functions(){return new Et(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new ds(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 cr(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:s}=yield this.auth.getSession();return(t=(e=s.session)===null||e===void 0?void 0:e.access_token)!==null&&t!==void 0?t:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:r,storageKey:i,flowType:o,lock:a,debug:c},h,l){var u;const d={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new ar({url:this.authUrl,headers:Object.assign(Object.assign({},d),h),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:r,flowType:o,lock:a,debug:c,fetch:l,hasCustomAuthorizationHeader:(u="Authorization"in this.headers)!==null&&u!==void 0?u:!1})}_initRealtimeClient(e){return new Xt(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,s)=>{this._handleTokenChanged(t,"CLIENT",s?.access_token)})}_handleTokenChanged(e,t,s){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==s?(this.realtime.setAuth(s??null),this.changedAccessToken=s):e==="SIGNED_OUT"&&(this.realtime.setAuth(this.supabaseKey),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const vr=(n,e,t)=>new lr(n,e,t);export{vr as c}; diff --git a/docs/_astro/DashboardNav.BAymX-kZ.js b/docs/_astro/DashboardNav.Cwl1Hg0Y.js similarity index 94% rename from docs/_astro/DashboardNav.BAymX-kZ.js rename to docs/_astro/DashboardNav.Cwl1Hg0Y.js index 3c9960f2c9..64b08c2355 100644 --- a/docs/_astro/DashboardNav.BAymX-kZ.js +++ b/docs/_astro/DashboardNav.Cwl1Hg0Y.js @@ -1 +1 @@ -import{j as e,r as p}from"./react.C2V1wh_4.js";import{c as n}from"./clsx.B-dksMZM.js";import{t as r}from"./tailwind-merge.B9ugUrge.js";import{u as c}from"./@nanostores.4Ikc6yb_.js";import{$ as g}from"./npchandler.Bw6Te69l.js";import"./@react-three.BOv1JqT7.js";import"./nanostores.Bo9-_MAV.js";import"./@supabase.DH5uoBuY.js";import"./Page.astro_astro_type_script_index_0_lang.COYkzBTz.js";import"./react-dom.D0pYwg_m.js";import"./scheduler.C323NY8X.js";import"./svelte.BG-3nfZ7.js";import"./esm-env.rsSWfq8L.js";import"./dexie.Db70IFYj.js";import"./axios.Bw-gCGc_.js";const a=({text:o,href:t,onClick:s,className:l})=>{const i=()=>{s&&s(),t&&(window.location.href=t)},d=r("relative z-10 px-5 py-3 overflow-visible font-medium text-gray-600 bg-gray-100 border border-gray-100 rounded-lg shadow-inner group","hover:text-white",l),u=n("absolute top-0 left-0 w-0 h-0 transition-all duration-200 border-t-2 border-gray-600 group-hover:w-full ease","absolute bottom-0 right-0 w-0 h-0 transition-all duration-200 border-b-2 border-gray-600 group-hover:w-full ease"),m=n("absolute top-0 left-0 w-full h-0 transition-all duration-300 delay-200 bg-gray-600 group-hover:h-full ease","absolute bottom-0 left-0 w-full h-0 transition-all duration-300 delay-200 bg-gray-600 group-hover:h-full ease","absolute inset-0 w-full h-full duration-300 delay-300 bg-gray-900 opacity-0 group-hover:opacity-100");return e.jsxs("button",{type:"button",className:d,onClick:i,children:[e.jsx("span",{className:u}),e.jsx("span",{className:m}),e.jsx("span",{className:"relative z-20 transition-colors duration-300 delay-200 group-hover:text-white ease",children:o})]})},L=()=>{const[o,t]=p.useState(!1),s=c(g),l=()=>{t(!o)};return e.jsx("nav",{className:r("bg-yellow-50/60 dark:bg-neutral-900 border-dashed hover:border-double border-2 border-cyan-500"),children:e.jsxs("div",{className:r("max-w-[85rem] w-full mx-auto sm:flex sm:flex-row sm:justify-between sm:items-center sm:gap-x-3 py-3 px-4 sm:px-6 lg:px-8"),children:[e.jsxs("div",{className:r("flex justify-between items-center gap-x-3"),children:[e.jsx("div",{className:r("grow"),children:e.jsx("span",{className:r("font-semibold whitespace-nowrap text-gray-800 dark:text-neutral-200"),children:`Good to see you, ${s.username}!`})}),e.jsxs("button",{type:"button",className:r("hs-collapse-toggle sm:hidden py-1.5 px-2 inline-flex items-center font-medium text-xs rounded-md border border-gray-200 bg-white text-gray-800 shadow-sm","hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 focus:outline-none focus:bg-gray-100","dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"),onClick:l,"aria-controls":"hs-nav-secondary","aria-label":"Toggle navigation",children:["Overview",e.jsx("svg",{className:n("hs-dropdown-open:rotate-180 shrink-0 size-4 ms-1 transition-transform",o&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})]})]}),e.jsx("div",{id:"hs-nav-secondary",className:r("hs-collapse overflow-hidden transition-all duration-300 basis-full grow sm:block",o?"block":"hidden"),children:e.jsxs("div",{className:r("py-3 sm:py-0 flex flex-col sm:flex-row sm:justify-end gap-y-2 sm:gap-y-0 sm:gap-x-6"),children:[e.jsx(a,{text:"Overview",href:"#"}),e.jsx(a,{text:"Resources",href:"#"}),e.jsx(a,{text:"Profile",href:"/profile"}),e.jsx(a,{text:"Logout",href:"/logout"})]})})]})})};export{L as default}; +import{j as e,r as p}from"./react.C2V1wh_4.js";import{c as n}from"./clsx.B-dksMZM.js";import{t as r}from"./tailwind-merge.B9ugUrge.js";import{u as c}from"./@nanostores.4Ikc6yb_.js";import{$ as g}from"./npchandler.BSw-qpjL.js";import"./@react-three.BOv1JqT7.js";import"./nanostores.Bo9-_MAV.js";import"./@supabase.CVkg5Wqw.js";import"./Page.astro_astro_type_script_index_0_lang.COYkzBTz.js";import"./react-dom.D0pYwg_m.js";import"./scheduler.C323NY8X.js";import"./svelte.BG-3nfZ7.js";import"./esm-env.rsSWfq8L.js";import"./dexie.Db70IFYj.js";import"./axios.Bw-gCGc_.js";const a=({text:o,href:t,onClick:s,className:l})=>{const i=()=>{s&&s(),t&&(window.location.href=t)},d=r("relative z-10 px-5 py-3 overflow-visible font-medium text-gray-600 bg-gray-100 border border-gray-100 rounded-lg shadow-inner group","hover:text-white",l),u=n("absolute top-0 left-0 w-0 h-0 transition-all duration-200 border-t-2 border-gray-600 group-hover:w-full ease","absolute bottom-0 right-0 w-0 h-0 transition-all duration-200 border-b-2 border-gray-600 group-hover:w-full ease"),m=n("absolute top-0 left-0 w-full h-0 transition-all duration-300 delay-200 bg-gray-600 group-hover:h-full ease","absolute bottom-0 left-0 w-full h-0 transition-all duration-300 delay-200 bg-gray-600 group-hover:h-full ease","absolute inset-0 w-full h-full duration-300 delay-300 bg-gray-900 opacity-0 group-hover:opacity-100");return e.jsxs("button",{type:"button",className:d,onClick:i,children:[e.jsx("span",{className:u}),e.jsx("span",{className:m}),e.jsx("span",{className:"relative z-20 transition-colors duration-300 delay-200 group-hover:text-white ease",children:o})]})},L=()=>{const[o,t]=p.useState(!1),s=c(g),l=()=>{t(!o)};return e.jsx("nav",{className:r("bg-yellow-50/60 dark:bg-neutral-900 border-dashed hover:border-double border-2 border-cyan-500"),children:e.jsxs("div",{className:r("max-w-[85rem] w-full mx-auto sm:flex sm:flex-row sm:justify-between sm:items-center sm:gap-x-3 py-3 px-4 sm:px-6 lg:px-8"),children:[e.jsxs("div",{className:r("flex justify-between items-center gap-x-3"),children:[e.jsx("div",{className:r("grow"),children:e.jsx("span",{className:r("font-semibold whitespace-nowrap text-gray-800 dark:text-neutral-200"),children:`Good to see you, ${s.username}!`})}),e.jsxs("button",{type:"button",className:r("hs-collapse-toggle sm:hidden py-1.5 px-2 inline-flex items-center font-medium text-xs rounded-md border border-gray-200 bg-white text-gray-800 shadow-sm","hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 focus:outline-none focus:bg-gray-100","dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700"),onClick:l,"aria-controls":"hs-nav-secondary","aria-label":"Toggle navigation",children:["Overview",e.jsx("svg",{className:n("hs-dropdown-open:rotate-180 shrink-0 size-4 ms-1 transition-transform",o&&"rotate-180"),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"m6 9 6 6 6-6"})})]})]}),e.jsx("div",{id:"hs-nav-secondary",className:r("hs-collapse overflow-hidden transition-all duration-300 basis-full grow sm:block",o?"block":"hidden"),children:e.jsxs("div",{className:r("py-3 sm:py-0 flex flex-col sm:flex-row sm:justify-end gap-y-2 sm:gap-y-0 sm:gap-x-6"),children:[e.jsx(a,{text:"Overview",href:"#"}),e.jsx(a,{text:"Resources",href:"#"}),e.jsx(a,{text:"Profile",href:"/profile"}),e.jsx(a,{text:"Logout",href:"/logout"})]})})]})})};export{L as default}; diff --git a/docs/_astro/DevCodeCore.BQoyWod4.js b/docs/_astro/DevCodeCore.DglLLE_-.js similarity index 97% rename from docs/_astro/DevCodeCore.BQoyWod4.js rename to docs/_astro/DevCodeCore.DglLLE_-.js index f3741978e9..6267ca36cc 100644 --- a/docs/_astro/DevCodeCore.BQoyWod4.js +++ b/docs/_astro/DevCodeCore.DglLLE_-.js @@ -1 +1 @@ -import{r as a,j as t}from"./react.C2V1wh_4.js";import{p as d}from"./html-react-parser.DlEmv1HH.js";import{c as s}from"./clsx.B-dksMZM.js";import{t as l}from"./tailwind-merge.B9ugUrge.js";import{g as h}from"./shiki.DPhLURod.js";import{m as o}from"./framer-motion.RVOhqTqp.js";import"./@react-three.BOv1JqT7.js";import"./html-dom-parser.CWKSAJ8O.js";import"./domhandler.B5fzKD_L.js";import"./domelementtype.C_FFwB5S.js";import"./react-property.DkBHvQjb.js";import"./style-to-js.CIPQq9Rv.js";import"./style-to-object.CugZxCwN.js";import"./inline-style-parser.D4u_cg7q.js";import"./Page.astro_astro_type_script_index_0_lang.COYkzBTz.js";import"./react-dom.D0pYwg_m.js";import"./scheduler.C323NY8X.js";import"./svelte.BG-3nfZ7.js";import"./esm-env.rsSWfq8L.js";import"./@shikijs.t1TIUwJu.js";import"./hast-util-to-html.CoPpPbWO.js";import"./html-void-elements.CkdplsNl.js";import"./property-information.BGMNvqfX.js";import"./zwitch.C2o2j-tx.js";import"./stringify-entities.Dinj3Ath.js";import"./character-entities-legacy.BpoLgcEt.js";import"./character-entities-html4.D7taRCQ7.js";import"./ccount.c2V3InAJ.js";import"./comma-separated-tokens.D8TqSuIK.js";import"./space-separated-tokens.DD3iYX1K.js";import"./hast-util-whitespace.D4Wp6AEg.js";const g=async r=>{const e=await h({theme:"nord"});return await e.loadTheme("nord"),await e.loadLanguage("html"),e.codeToHtml(r,{lang:"html",theme:"nord",lineOptions:[{lineNumber:!0},{wrap:!0}]})},U=({htmlCode:r})=>{const[e,i]=a.useState("preview"),[c,p]=a.useState("");a.useEffect(()=>{(async()=>{const m=await g(r);p(m)})()},[r]);const n=()=>{navigator.clipboard.writeText(r)};return t.jsxs("div",{className:"border border-gray-200 rounded overflow-hidden",children:[t.jsxs("div",{className:"flex border-b border-gray-200",children:[t.jsx(o.button,{className:l("py-2 text-center cursor-pointer",s({"bg-[var(--sl-color-black)] border-b-2 border-blue-500 font-bold":e==="preview","opacity-50":e!=="preview"})),style:{flex:e==="preview"?2:1},onClick:()=>i("preview"),whileHover:{scale:1.05},whileTap:{scale:.95},children:"Preview"}),t.jsx(o.button,{className:l("py-2 text-center cursor-pointer",s({"bg-[var(--sl-color-black)] border-b-2 border-blue-500 font-bold":e==="code","opacity-50":e!=="code"})),style:{flex:e==="code"?2:1},onClick:()=>i("code"),whileHover:{scale:1.05},whileTap:{scale:.95},children:"Code"})]}),t.jsxs("div",{className:"p-4",children:[e==="preview"&&t.jsx(o.div,{initial:{opacity:0},animate:{opacity:1},className:"max-w-none",children:d(r)}),e==="code"&&t.jsx(o.div,{initial:{opacity:0},animate:{opacity:1},children:t.jsxs("div",{className:"relative",children:[t.jsx("button",{className:"absolute right-0 top-0 bg-cyan-600 text-white px-2 py-1 rounded",onClick:n,children:"Copy"}),t.jsx("div",{dangerouslySetInnerHTML:{__html:c}})]})})]})]})};export{U as default}; +import{r as a,j as t}from"./react.C2V1wh_4.js";import{p as d}from"./html-react-parser.DlEmv1HH.js";import{c as s}from"./clsx.B-dksMZM.js";import{t as l}from"./tailwind-merge.B9ugUrge.js";import{g as h}from"./shiki.Db3H6uFj.js";import{m as o}from"./framer-motion.RVOhqTqp.js";import"./@react-three.BOv1JqT7.js";import"./html-dom-parser.CWKSAJ8O.js";import"./domhandler.B5fzKD_L.js";import"./domelementtype.C_FFwB5S.js";import"./react-property.DkBHvQjb.js";import"./style-to-js.CIPQq9Rv.js";import"./style-to-object.CugZxCwN.js";import"./inline-style-parser.D4u_cg7q.js";import"./Page.astro_astro_type_script_index_0_lang.COYkzBTz.js";import"./react-dom.D0pYwg_m.js";import"./scheduler.C323NY8X.js";import"./svelte.BG-3nfZ7.js";import"./esm-env.rsSWfq8L.js";import"./@shikijs.t1TIUwJu.js";import"./hast-util-to-html.CoPpPbWO.js";import"./html-void-elements.CkdplsNl.js";import"./property-information.BGMNvqfX.js";import"./zwitch.C2o2j-tx.js";import"./stringify-entities.Dinj3Ath.js";import"./character-entities-legacy.BpoLgcEt.js";import"./character-entities-html4.D7taRCQ7.js";import"./ccount.c2V3InAJ.js";import"./comma-separated-tokens.D8TqSuIK.js";import"./space-separated-tokens.DD3iYX1K.js";import"./hast-util-whitespace.D4Wp6AEg.js";const g=async r=>{const e=await h({theme:"nord"});return await e.loadTheme("nord"),await e.loadLanguage("html"),e.codeToHtml(r,{lang:"html",theme:"nord",lineOptions:[{lineNumber:!0},{wrap:!0}]})},U=({htmlCode:r})=>{const[e,i]=a.useState("preview"),[c,p]=a.useState("");a.useEffect(()=>{(async()=>{const m=await g(r);p(m)})()},[r]);const n=()=>{navigator.clipboard.writeText(r)};return t.jsxs("div",{className:"border border-gray-200 rounded overflow-hidden",children:[t.jsxs("div",{className:"flex border-b border-gray-200",children:[t.jsx(o.button,{className:l("py-2 text-center cursor-pointer",s({"bg-[var(--sl-color-black)] border-b-2 border-blue-500 font-bold":e==="preview","opacity-50":e!=="preview"})),style:{flex:e==="preview"?2:1},onClick:()=>i("preview"),whileHover:{scale:1.05},whileTap:{scale:.95},children:"Preview"}),t.jsx(o.button,{className:l("py-2 text-center cursor-pointer",s({"bg-[var(--sl-color-black)] border-b-2 border-blue-500 font-bold":e==="code","opacity-50":e!=="code"})),style:{flex:e==="code"?2:1},onClick:()=>i("code"),whileHover:{scale:1.05},whileTap:{scale:.95},children:"Code"})]}),t.jsxs("div",{className:"p-4",children:[e==="preview"&&t.jsx(o.div,{initial:{opacity:0},animate:{opacity:1},className:"max-w-none",children:d(r)}),e==="code"&&t.jsx(o.div,{initial:{opacity:0},animate:{opacity:1},children:t.jsxs("div",{className:"relative",children:[t.jsx("button",{className:"absolute right-0 top-0 bg-cyan-600 text-white px-2 py-1 rounded",onClick:n,children:"Copy"}),t.jsx("div",{dangerouslySetInnerHTML:{__html:c}})]})})]})]})};export{U as default}; diff --git a/docs/_astro/KanbanMenu.Iy5NmxS8.js b/docs/_astro/KanbanMenu.Z-Py2CVo.js similarity index 94% rename from docs/_astro/KanbanMenu.Iy5NmxS8.js rename to docs/_astro/KanbanMenu.Z-Py2CVo.js index 1bb5b196ed..1481ce4bab 100644 --- a/docs/_astro/KanbanMenu.Iy5NmxS8.js +++ b/docs/_astro/KanbanMenu.Z-Py2CVo.js @@ -1 +1 @@ -import{r as o,j as e}from"./react.C2V1wh_4.js";import{t as s}from"./tailwind-merge.B9ugUrge.js";import{e as l}from"./npchandler.Bw6Te69l.js";import"./@react-three.BOv1JqT7.js";import"./@supabase.DH5uoBuY.js";import"./Page.astro_astro_type_script_index_0_lang.COYkzBTz.js";import"./react-dom.D0pYwg_m.js";import"./scheduler.C323NY8X.js";import"./svelte.BG-3nfZ7.js";import"./esm-env.rsSWfq8L.js";import"./dexie.Db70IFYj.js";import"./@nanostores.4Ikc6yb_.js";import"./nanostores.Bo9-_MAV.js";import"./axios.Bw-gCGc_.js";const n=({onClick:t,children:r})=>e.jsxs("button",{onClick:t,className:"relative inline-block text-lg group",children:[e.jsxs("span",{className:"relative z-10 block px-5 py-3 overflow-hidden font-medium leading-tight text-gray-800 transition-colors duration-300 ease-out border-2 border-gray-900 rounded-lg group-hover:text-white",children:[e.jsx("span",{className:"absolute inset-0 w-full h-full px-5 py-3 rounded-lg bg-gray-50"}),e.jsx("span",{className:"absolute left-0 w-48 h-48 -ml-2 transition-all duration-300 origin-top-right -rotate-90 -translate-x-full translate-y-12 bg-gray-900 group-hover:-rotate-180 ease"}),e.jsx("span",{className:"relative",children:r})]}),e.jsx("span",{className:"absolute bottom-0 right-0 w-full h-12 -mb-1 -mr-1 transition-all duration-200 ease-linear bg-gray-900 rounded-lg group-hover:mb-0 group-hover:mr-0","data-rounded":"rounded-lg"})]}),w=()=>{const[t,r]=o.useState(!1),a=()=>{console.log("Button clicked!"),l.emit("npcInteraction",{npcId:"Reset",npcName:"Reset",actions:["clear"],coords:{x:0,y:0}})};return e.jsx("nav",{className:s("bg-yellow-50/60 dark:bg-neutral-900 border-dashed hover:border-double border-2 border-cyan-500"),children:e.jsxs("div",{className:s("max-w-[85rem] w-full mx-auto sm:flex sm:flex-row sm:justify-between sm:items-center sm:gap-x-3 py-3 px-4 sm:px-6 lg:px-8"),children:[e.jsx("div",{className:s("flex justify-between items-center gap-x-3"),children:e.jsx("div",{className:s("grow"),children:e.jsx("span",{className:s("font-semibold whitespace-nowrap text-gray-800 dark:text-neutral-200"),children:"Good to see you!"})})}),e.jsx("div",{id:"hs-nav-secondary",className:s("hs-collapse overflow-hidden transition-all duration-300 basis-full grow sm:block",t?"block":"hidden"),children:e.jsx("div",{className:s("py-3 sm:py-0 flex flex-col sm:flex-row sm:justify-end gap-y-2 sm:gap-y-0 sm:gap-x-6"),children:e.jsx(n,{onClick:a,children:"Reset"})})})]})})};export{w as default}; +import{r as o,j as e}from"./react.C2V1wh_4.js";import{t as s}from"./tailwind-merge.B9ugUrge.js";import{e as l}from"./npchandler.BSw-qpjL.js";import"./@react-three.BOv1JqT7.js";import"./@supabase.CVkg5Wqw.js";import"./Page.astro_astro_type_script_index_0_lang.COYkzBTz.js";import"./react-dom.D0pYwg_m.js";import"./scheduler.C323NY8X.js";import"./svelte.BG-3nfZ7.js";import"./esm-env.rsSWfq8L.js";import"./dexie.Db70IFYj.js";import"./@nanostores.4Ikc6yb_.js";import"./nanostores.Bo9-_MAV.js";import"./axios.Bw-gCGc_.js";const n=({onClick:t,children:r})=>e.jsxs("button",{onClick:t,className:"relative inline-block text-lg group",children:[e.jsxs("span",{className:"relative z-10 block px-5 py-3 overflow-hidden font-medium leading-tight text-gray-800 transition-colors duration-300 ease-out border-2 border-gray-900 rounded-lg group-hover:text-white",children:[e.jsx("span",{className:"absolute inset-0 w-full h-full px-5 py-3 rounded-lg bg-gray-50"}),e.jsx("span",{className:"absolute left-0 w-48 h-48 -ml-2 transition-all duration-300 origin-top-right -rotate-90 -translate-x-full translate-y-12 bg-gray-900 group-hover:-rotate-180 ease"}),e.jsx("span",{className:"relative",children:r})]}),e.jsx("span",{className:"absolute bottom-0 right-0 w-full h-12 -mb-1 -mr-1 transition-all duration-200 ease-linear bg-gray-900 rounded-lg group-hover:mb-0 group-hover:mr-0","data-rounded":"rounded-lg"})]}),w=()=>{const[t,r]=o.useState(!1),a=()=>{console.log("Button clicked!"),l.emit("npcInteraction",{npcId:"Reset",npcName:"Reset",actions:["clear"],coords:{x:0,y:0}})};return e.jsx("nav",{className:s("bg-yellow-50/60 dark:bg-neutral-900 border-dashed hover:border-double border-2 border-cyan-500"),children:e.jsxs("div",{className:s("max-w-[85rem] w-full mx-auto sm:flex sm:flex-row sm:justify-between sm:items-center sm:gap-x-3 py-3 px-4 sm:px-6 lg:px-8"),children:[e.jsx("div",{className:s("flex justify-between items-center gap-x-3"),children:e.jsx("div",{className:s("grow"),children:e.jsx("span",{className:s("font-semibold whitespace-nowrap text-gray-800 dark:text-neutral-200"),children:"Good to see you!"})})}),e.jsx("div",{id:"hs-nav-secondary",className:s("hs-collapse overflow-hidden transition-all duration-300 basis-full grow sm:block",t?"block":"hidden"),children:e.jsx("div",{className:s("py-3 sm:py-0 flex flex-col sm:flex-row sm:justify-end gap-y-2 sm:gap-y-0 sm:gap-x-6"),children:e.jsx(n,{onClick:a,children:"Reset"})})})]})})};export{w as default}; diff --git a/docs/_astro/LoginForm.h5vFVMdi.js b/docs/_astro/LoginForm.BzvLvisg.js similarity index 98% rename from docs/_astro/LoginForm.h5vFVMdi.js rename to docs/_astro/LoginForm.BzvLvisg.js index ea1ff2a02b..9249a4e867 100644 --- a/docs/_astro/LoginForm.h5vFVMdi.js +++ b/docs/_astro/LoginForm.BzvLvisg.js @@ -1 +1 @@ -import{a as Pe,w as Te,x as h,o as je,y as Fe,z as Oe,A as Ue,i as Ke,t as w,B as qe,C,D as ne,E as Re,F as E,d as I,G as de,v as a,H as Ne,f as u,I as R,g as Ge,s as v,J as d,b as o,j as s,k as _,K as He,L as ce,M as Je,N as ue,r as l,O as Ve,P as S,q as M}from"./svelte.BG-3nfZ7.js";import{r as We,C as Qe}from"./loader.7yziqgW4.js";import{K as ve,k as z}from"./npchandler.Bw6Te69l.js";import"./react.C2V1wh_4.js";import"./esm-env.rsSWfq8L.js";import"./@supabase.DH5uoBuY.js";import"./@react-three.BOv1JqT7.js";import"./Page.astro_astro_type_script_index_0_lang.COYkzBTz.js";import"./react-dom.D0pYwg_m.js";import"./scheduler.C323NY8X.js";import"./dexie.Db70IFYj.js";import"./@nanostores.4Ikc6yb_.js";import"./nanostores.Bo9-_MAV.js";import"./axios.Bw-gCGc_.js";var Xe=Je(" Skip to content
\ No newline at end of file diff --git a/docs/application/ansible/index.html b/docs/application/ansible/index.html index beb03a73f7..f15ceef7b1 100644 --- a/docs/application/ansible/index.html +++ b/docs/application/ansible/index.html @@ -140,72 +140,19 @@

Playbook

Whether you need to install software, configure settings, run commands, or anything else, an Ansible playbook will make it happen in a snap.

Playbook Examples

Let me dazzle you with an example of a playbook that I borrowed from the Ansible documentation.

-
- name: Update web servers
-  hosts: webservers
-  remote_user: root
-  tasks:
-      - name: Ensure apache is at the latest version
-        ansible.builtin.yum:
-            name: httpd
-            state: latest
-      - name: Write the apache config file
-        ansible.builtin.template:
-            src: /srv/httpd.j2
-            dest: /etc/httpd.conf
-
-- name: Update db servers
-  hosts: databases
-  remote_user: root
-  tasks:
-      - name: Ensure postgresql is at the latest version
-        ansible.builtin.yum:
-            name: postgresql
-            state: latest
-      - name: Ensure that postgresql is started
-        ansible.builtin.service:
-            name: postgresql
-            state: started
+
- name: Update web servers
hosts: webservers
remote_user: root
tasks:
- name: Ensure apache is at the latest version
ansible.builtin.yum:
name: httpd
state: latest
- name: Write the apache config file
ansible.builtin.template:
src: /srv/httpd.j2
dest: /etc/httpd.conf
+
- name: Update db servers
hosts: databases
remote_user: root
tasks:
- name: Ensure postgresql is at the latest version
ansible.builtin.yum:
name: postgresql
state: latest
- name: Ensure that postgresql is started
ansible.builtin.service:
name: postgresql
state: started

This playbook has two plays. The first one updates the web servers by installing the latest version of apache and writing a config file. The second one updates the database servers by installing the latest version of postgresql and starting the service. Each play has a name, a list of hosts to target, a remote user to execute the tasks, and a list of tasks to perform. Each task has a name and a module to call with some parameters.

Minecraft Server Update Playbook Example

-
- name: Update Minecraft server
-  hosts: minecraft
-  vars:
-      minecraft_version: latest
-      minecraft_url: https://s3.amazonaws.com/Minecraft.Download/versions
-      minecraft_home: /srv/minecraft
-  tasks:
-      - name: Get latest Minecraft version
-        uri:
-            url: '{{ minecraft_url }}/latest.json'
-            return_content: yes
-        register: latest_version
-        when: minecraft_version == "latest"
-
-      - name: Set Minecraft version
-        set_fact:
-            minecraft_version: '{{ latest_version.json.id }}'
-        when: minecraft_version == "latest"
-
-      - name: Check if Minecraft server jar exists
-        stat:
-            path: '{{ minecraft_home }}/minecraft_server.{{ minecraft_version }}.jar'
-        register: jar_file
-
-      - name: Download Minecraft server jar
-        get_url:
-            url: '{{ minecraft_url }}/{{ minecraft_version }}/minecraft_server.{{ minecraft_version }}.jar'
-            dest: '{{ minecraft_home }}'
-        when: not jar_file.stat.exists
-
-      - name: Restart Minecraft service
-        systemd:
-            name: minecraft
-            state: restarted
-        when: not jar_file.stat.exists
+
- name: Update Minecraft server
hosts: minecraft
vars:
minecraft_version: latest
minecraft_url: https://s3.amazonaws.com/Minecraft.Download/versions
minecraft_home: /srv/minecraft
tasks:
- name: Get latest Minecraft version
uri:
url: '{{ minecraft_url }}/latest.json'
return_content: yes
register: latest_version
when: minecraft_version == "latest"
+
- name: Set Minecraft version
set_fact:
minecraft_version: '{{ latest_version.json.id }}'
when: minecraft_version == "latest"
+
- name: Check if Minecraft server jar exists
stat:
path: '{{ minecraft_home }}/minecraft_server.{{ minecraft_version }}.jar'
register: jar_file
+
- name: Download Minecraft server jar
get_url:
url: '{{ minecraft_url }}/{{ minecraft_version }}/minecraft_server.{{ minecraft_version }}.jar'
dest: '{{ minecraft_home }}'
when: not jar_file.stat.exists
+
- name: Restart Minecraft service
systemd:
name: minecraft
state: restarted
when: not jar_file.stat.exists

This playbook is composed of four parts:

  • The name of the playbook, which is Update Minecraft server.
  • @@ -241,47 +188,20 @@

    GCP Modules

    Create GCP Instance

    Creating a compute instance with a specific name, zone, machine type, image and network:

    -
    - name: create gcp instance
    -  google.cloud.gcp_compute_instance:
    -      name: test_object
    -      zone: us-central1-a
    -      machine_type: n1-standard-1
    -      disks:
    -          - auto_delete: true
    -            boot: true
    -            source: '{{ disk }}'
    -      network_interfaces:
    -          - network: '{{ network }}'
    -            access_configs:
    -                - name: External NAT
    -                  nat_ip: '{{ address }}'
    -                  type: ONE_TO_ONE_NAT
    -      state: present
    +
    - name: create gcp instance
    google.cloud.gcp_compute_instance:
    name: test_object
    zone: us-central1-a
    machine_type: n1-standard-1
    disks:
    - auto_delete: true
    boot: true
    source: '{{ disk }}'
    network_interfaces:
    - network: '{{ network }}'
    access_configs:
    - name: External NAT
    nat_ip: '{{ address }}'
    type: ONE_TO_ONE_NAT
    state: present

    This example creates a compute instance with a specific name, zone, machine type, image and network. It uses the state: present parameter to indicate that the instance should exist. It also specifies the disks and network_interfaces parameters to configure the disk and network settings of the instance. The disk and network variables are assumed to be defined elsewhere in the playbook or inventory.

    Delete GCP Instance

    Deleting a compute instance with a specific name and zone:

    -
    - name: dlete gcp instance
    -  google.cloud.gcp_compute_instance:
    -      name: test_object
    -      zone: us-central1-a
    -      state: absent
    +
    - name: dlete gcp instance
    google.cloud.gcp_compute_instance:
    name: test_object
    zone: us-central1-a
    state: absent

    For this task, it deletes a compute instance with a specific name and zone. It uses the state: absent parameter to indicate that the instance should not exist. It does not need to specify any other parameters, as the name and zone are enough to identify the instance to delete.

    Update GCP Instance

    Updating a compute instance with a new machine type and labels

    -
    - name: update gcp instance
    -  google.cloud.gcp_compute_instance:
    -      name: test_object
    -      zone: us-central1-a
    -      machine_type: n1-standard-2
    -      labels:
    -          env: prod
    -          webserver: nginx
    -      state: present
    +
    - name: update gcp instance
    google.cloud.gcp_compute_instance:
    name: test_object
    zone: us-central1-a
    machine_type: n1-standard-2
    labels:
    env: prod
    webserver: nginx
    state: present

    The update example performs the task of updating a compute instance with a new machine type and labels. It uses the state: present parameter to indicate that the instance should exist. It also specifies the machine_type and labels parameters to change the machine type and labels of the instance. @@ -329,16 +249,9 @@

    AWX Terraform

  • Official Registry Link:

Example Usage - With Username/Password:

-
provider "awx" {
-    hostname = "http://localhost:8078"
-    username = "kbvetest"
-    password = "changemepassword"
-}
+
provider "awx" {
hostname = "http://localhost:8078"
username = "kbvetest"
password = "changemepassword"
}

Example Usage - With Token:

-
provider "awx" {
-  hostname = "http://localhost:8078"
-  token    = "awxtoken"
-}
+
provider "awx" {
hostname = "http://localhost:8078"
token = "awxtoken"
}

Remember that if you set both (username/password) and (token), then the (token) will have precedence.

diff --git a/docs/application/appwrite/index.html b/docs/application/appwrite/index.html index 3910f7aa8b..9b639dcce1 100644 --- a/docs/application/appwrite/index.html +++ b/docs/application/appwrite/index.html @@ -130,27 +130,11 @@

Initializing Your Appwrite Cl
  • Reference Core for the basics.
  • Here is a basic / starter.
  • -
    module.exports = async (req, res) => {
    -	const payload =
    -		req.payload ||
    -		'No payload provided. Add custom data when executing function.';
    -
    -	const secretKey =
    -		req.variables.SECRET_KEY ||
    -		'SECRET_KEY variable not found. You can set it in Function settings.';
    -
    -	const randomNumber = Math.random();
    -
    -	const trigger = req.variables.APPWRITE_FUNCTION_TRIGGER;
    -
    -	res.json({
    -		message: 'Hello from Appwrite!',
    -		payload,
    -		secretKey,
    -		randomNumber,
    -		trigger,
    -	});
    -};
    +
    module.exports = async (req, res) => {
    const payload =
    req.payload ||
    'No payload provided. Add custom data when executing function.';
    +
    const secretKey =
    req.variables.SECRET_KEY ||
    'SECRET_KEY variable not found. You can set it in Function settings.';
    +
    const randomNumber = Math.random();
    +
    const trigger = req.variables.APPWRITE_FUNCTION_TRIGGER;
    +
    res.json({
    message: 'Hello from Appwrite!',
    payload,
    secretKey,
    randomNumber,
    trigger,
    });
    };
  • Packaging :

    @@ -178,7 +162,7 @@

    Core

    General documentation and information in reference to the cloud functions / open runtime for Appwrite.

    Remember to import the SDK outside of the module function.

    The main module.exports is usually written like this

    -
    module.exports = async function (req, res) {}; // Passing req and res
    +
    module.exports = async function (req, res) {}; // Passing req and res

    The req contains these three main objects:

    req.headers - An object with the request headers for the function. req.payload - An object with the payload, which is the main body data. @@ -187,19 +171,9 @@

    Core

    res.send - returns a text and statusCode. res.json - returns an object and statusCode.

    Example of parsing the req.payload check and res.json return.

    -
    if (req.payload) {
    -	try {
    -		payload = JSON.parse(req.payload);
    -	} catch (error) {
    -		errorHandler('Corrupt payload for the function.');
    -	}
    -} else {
    -	errorHandler('Missing payload for the function.');
    -}
    +
    if (req.payload) {
    try {
    payload = JSON.parse(req.payload);
    } catch (error) {
    errorHandler('Corrupt payload for the function.');
    }
    } else {
    errorHandler('Missing payload for the function.');
    }

    In this case our errorHandler function would be:

    -
    const errorHandler = (__errorMessage, statusCode = 418) => {
    -	res.json({ data: 'error', message: __errorMessage }, statusCode);
    -};
    +
    const errorHandler = (__errorMessage, statusCode = 418) => {
    res.json({ data: 'error', message: __errorMessage }, statusCode);
    };

    Extra

    In the context of Appwrite Cloud Functions, “extra libraries” refer to external dependencies or packages that your function might need to execute correctly. Due to the isolated nature of cloud functions, they don’t inherently have access to all the libraries or tools available in a full-fledged server environment. @@ -226,39 +200,14 @@

    Appwrite Python SDK Install

    Python wizards, gather ‘round! Elevate your coding cauldron with a sprinkle of Appwrite magic by simply chanting pip install appwrite. And just like that, your Python broomstick is turbocharged and ready to soar through the backend skies!

    Calling the appwrite in python is really easy! Just add this below:

    -
    
    -from appwrite.client import Client
    -
    -client = Client()
    -
    -client = (client
    -    .set_endpoint('https://ap.kbve.com/v1') # Your API Endpoint
    -    .set_project('[PROJECT_ID]')                # Your project ID
    -    .set_key('919c2db5d4...a2a3346ad2')          # Your secret API key
    -)
    -
    +
    from appwrite.client import Client
    +
    client = Client()
    +
    client = (client
    .set_endpoint('https://ap.kbve.com/v1') # Your API Endpoint
    .set_project('[PROJECT_ID]') # Your project ID
    .set_key('919c2db5d4...a2a3346ad2') # Your secret API key
    )

    And you will be good to go!

    Appwrite Python SDK Demo

    Here is a quick and easy demo for Appwrite python below!

    -
    
    -from appwrite.client import Client
    -from appwrite.id import ID
    -from appwrite.services.users import Users
    -
    -client = Client()
    -
    -client = (client
    -    .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
    -    .set_project('[PROJECT_ID]')                # Your project ID
    -    .set_key('919c2db5d4...a2a3346ad2')          # Your secret API key
    -)
    -
    -users = Users(client)
    -
    -user = users.create(
    -    user_id=ID.unique(),
    -    email='email@example.com',
    -    phone=None,
    -    password='password'
    -)
    -
    \ No newline at end of file +
    from appwrite.client import Client
    from appwrite.id import ID
    from appwrite.services.users import Users
    +
    client = Client()
    +
    client = (client
    .set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
    .set_project('[PROJECT_ID]') # Your project ID
    .set_key('919c2db5d4...a2a3346ad2') # Your secret API key
    )
    +
    users = Users(client)
    +
    user = users.create(
    user_id=ID.unique(),
    email='email@example.com',
    phone=None,
    password='password'
    )
    \ No newline at end of file diff --git a/docs/application/cubejs/index.html b/docs/application/cubejs/index.html index 3182b4961e..91152e0c89 100644 --- a/docs/application/cubejs/index.html +++ b/docs/application/cubejs/index.html @@ -109,15 +109,7 @@

    Docker

    There are a couple ways that we can deploy CubeJS via Docker, including dev mode and swarm.

    These following commands will run CubeJS in a docker container and expose it on port 4000 / 3000. Furthermore, it will also mount the current directory as a volume for CubeJS configuration and schema files.

    -
    docker run -d -p 3000:3000 -p 4000:4000 \
    -  -e CUBEJS_DB_HOST=postgres://hostname \
    -  -e CUBEJS_DB_NAME=<DB_NAME> \
    -  -e CUBEJS_DB_USER=<USER> \
    -  -e CUBEJS_DB_PASS=<PASS> \
    -  -e CUBEJS_DB_TYPE=<DB_TYPE> \
    -  -e CUBEJS_API_SECRET=<API_SECRET> \
    -  -v $(pwd):/cube/conf \
    -  cubejs/cube:latest
    +
    Terminal window
    docker run -d -p 3000:3000 -p 4000:4000 \
    -e CUBEJS_DB_HOST=postgres://hostname \
    -e CUBEJS_DB_NAME=<DB_NAME> \
    -e CUBEJS_DB_USER=<USER> \
    -e CUBEJS_DB_PASS=<PASS> \
    -e CUBEJS_DB_TYPE=<DB_TYPE> \
    -e CUBEJS_API_SECRET=<API_SECRET> \
    -v $(pwd):/cube/conf \
    cubejs/cube:latest

    To enable dev mode, pass along the environmental variable -e CUBEJS_DEV_MODE=true \ inside of the command.

    For the Docker Swarm, we recommend that you deploy a CubeJS Docker Compose via Portainer or your swarm platform of choice.

    NodeJS

    @@ -128,26 +120,26 @@

    NodeJS

    • NPM
    -
    npm install -g cubejs-cli
    +
    Terminal window
    npm install -g cubejs-cli
    • YARN
    -
    yarn add cubejs-cli
    +
    Terminal window
    yarn add cubejs-cli

    After the installation, we recommend that you launch a test case.

    Create a new CubeJS project using cubejs create command. You need to specify the name of your project and the type of your data source. For example, if you want to use Postgres, which is a database system, you can run this command:

    -
    cubejs create dashboard-backend -d postgres
    +
    Terminal window
    cubejs create dashboard-backend -d postgres

    This will create a new folder with your project files and install the necessary dependencies. You can then start your CubeJS server by running this command inside your project folder:

    • NPM
    -
    npm run dev
    +
    Terminal window
    npm run dev
    • YARN
    -
    yarn dev
    +
    Terminal window
    yarn dev

    This will start your CubeJS test case server on http://localhost:4000. You can then open this URL in your browser and follow the instructions to connect to your data source and start building your data model and queries.


    @@ -157,15 +149,15 @@

    Update

    Update Docker

    If you are using Docker, you can upgrade CubeJS by pulling the latest image from the Docker Hub. You can run this command in your terminal:

    -
    docker pull cubejs/cube:latest
    +
    Terminal window
    docker pull cubejs/cube:latest

    Update NodeJS

    If you are using Node.js, you can upgrade CubeJS by updating the version of the @cubejs-backend/server or @cubejs-backend/server-core package in your package.json file. You can also use npm or yarn to update the package. For example, you can run this command in your terminal:

    • NPM
    -
    npm update @cubejs-backend/server
    +
    Terminal window
    npm update @cubejs-backend/server
    • YARN
    -
    yarn upgrade @cubejs-backend/server
    \ No newline at end of file +
    Terminal window
    yarn upgrade @cubejs-backend/server
    \ No newline at end of file diff --git a/docs/application/docker/index.html b/docs/application/docker/index.html index 87cc2056e2..490ec255e1 100644 --- a/docs/application/docker/index.html +++ b/docs/application/docker/index.html @@ -1143,26 +1143,26 @@

    BuildX

  • Verify Docker Installation:

    First, check if Docker is installed by running the following command in your terminal:

    -
    docker --version
    +
    Terminal window
    docker --version

    You should see output similar to:

    -
    Docker version 20.10.7, build f0df350
    +
    Docker version 20.10.7, build f0df350
  • Check for Buildx in the Apt List:

    Before installing Buildx, let’s check if it is available in the apt package list. Run the following command:

    -
    apt-cache search docker-buildx
    +
    Terminal window
    apt-cache search docker-buildx

    If Buildx is available, you should see an output similar to:

    -
    docker-buildx - Docker CLI plugin for extended build capabilities with BuildKit
    +
    docker-buildx - Docker CLI plugin for extended build capabilities with BuildKit
  • Install Buildx (if available in apt):

    If Buildx is available in the apt list, you can install it using:

    -
    sudo apt-get install docker-buildx
    +
    Terminal window
    sudo apt-get install docker-buildx

    Verify the installation by running:

    -
    docker buildx version
    +
    Terminal window
    docker buildx version

    You should see output indicating the version of Buildx installed.

    An example of this output would be like this:

    -
    github.com/docker/buildx 0.11.2 0.11.2-0ubuntu1^22.04.2
    +
    github.com/docker/buildx 0.11.2 0.11.2-0ubuntu1^22.04.2
  • Add Buildx (if not available in apt):

    @@ -1172,18 +1172,17 @@

    BuildX

  • Download the Buildx Binary:

    Download the latest Buildx release from GitHub:

    -
    mkdir -p ~/.docker/cli-plugins/
    -curl -Lo ~/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/latest/download/buildx-v0.10.0.linux-amd64
    +
    Terminal window
    mkdir -p ~/.docker/cli-plugins/
    curl -Lo ~/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/latest/download/buildx-v0.10.0.linux-amd64
  • Make the Binary Executable:

    Make the downloaded binary executable:

    -
    chmod +x ~/.docker/cli-plugins/docker-buildx
    +
    Terminal window
    chmod +x ~/.docker/cli-plugins/docker-buildx
  • Verify the Installation:

    Check the Buildx version to ensure it was installed correctly:

    -
    docker buildx version
    +
    Terminal window
    docker buildx version

    You should see output indicating the version of Buildx installed.

  • @@ -1191,14 +1190,14 @@

    BuildX

  • Create and Use a New Builder Instance:

    Create a new builder instance and switch to it:

    -
    docker buildx create --name mybuilder --use
    +
    Terminal window
    docker buildx create --name mybuilder --use

    You can verify that the new builder instance is being used by running:

    -
    docker buildx inspect --bootstrap
    +
    Terminal window
    docker buildx inspect --bootstrap
  • Build and Push Multi-Platform Images:

    With Buildx, you can now build and push multi-platform images. For example:

    -
    docker buildx build --platform linux/amd64,linux/arm64 -t username/repository:tag . --push
    +
    Terminal window
    docker buildx build --platform linux/amd64,linux/arm64 -t username/repository:tag . --push

    Congratulations! You have successfully set up Docker Buildx on your system.

  • @@ -1212,18 +1211,7 @@

    WatchTower

    Notifications can be sent to various channels such as email, Slack, or other messaging services, keeping teams informed about the update process. This feature is particularly useful for maintaining transparency and ensuring that stakeholders are aware of the changes happening within the containerized environment.

    To enable WatchTower notifications, set the appropriate environmental variables in the command line. For example:

    -
    docker run -d \
    -  --name watchtower \
    -  -v /var/run/docker.sock:/var/run/docker.sock \
    -  -e WATCHTOWER_NOTIFICATIONS=email \
    -  -e WATCHTOWER_NOTIFICATION_EMAIL_FROM=fromaddress@gmail.com \
    -  -e WATCHTOWER_NOTIFICATION_EMAIL_TO=toaddress@gmail.com \
    -  -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER=smtp.gmail.com \
    -  -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=587 \
    -  -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER=fromaddress@gmail.com \
    -  -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=app_password \
    -  -e WATCHTOWER_NOTIFICATION_EMAIL_DELAY=2 \
    -  containrrr/watchtower
    +
    Terminal window
    docker run -d \
    --name watchtower \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -e WATCHTOWER_NOTIFICATIONS=email \
    -e WATCHTOWER_NOTIFICATION_EMAIL_FROM=fromaddress@gmail.com \
    -e WATCHTOWER_NOTIFICATION_EMAIL_TO=toaddress@gmail.com \
    -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER=smtp.gmail.com \
    -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=587 \
    -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER=fromaddress@gmail.com \
    -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=app_password \
    -e WATCHTOWER_NOTIFICATION_EMAIL_DELAY=2 \
    containrrr/watchtower

    This command configures WatchTower to send email notifications regarding the status of container updates. Adjust the variables to suit the desired notification method and settings. By utilizing WatchTower and its notification features, administrators can ensure that their Docker environments remain up-to-date and secure with minimal effort.

    @@ -1234,62 +1222,20 @@

    Scripts

    or example, the script below demonstrates a series of Docker commands combined to build an image from the current directory, stop and remove a running container, and then run a new container with specific configurations. This script builds the Docker image with the tag myapp, stops any running container named myapp_container, removes it, and finally starts a new container named myapp_container in detached mode with specified ports and shared memory size.

    Build & Deploy

    -
    docker build . -t myapp && docker stop myapp_container && docker rm myapp_container && docker run --name myapp_container -d -p 3000:3000 -p 8086:8086 --shm-size=2g myapp
    +
    Terminal window
    docker build . -t myapp && docker stop myapp_container && docker rm myapp_container && docker run --name myapp_container -d -p 3000:3000 -p 8086:8086 --shm-size=2g myapp

    Additional parts of the script to include:

    -
    docker logs -f --until=2s -name myapp_container
    +
    Terminal window
    docker logs -f --until=2s -name myapp_container

    Clean Up:

    -
    docker system prune all -a
    +
    Terminal window
    docker system prune all -a

    Here is how it would look:

    An updated version of the script that includes checks to ensure each step completes successfully before moving on to the next.

    -
    #!/bin/bash
    -
    -# Variables
    -IMAGE_NAME="myapp"
    -CONTAINER_NAME="myapp_container"
    -PORTS="-p 3000:3000 -p 8086:8086"
    -SHM_SIZE="2g"
    -
    -# Build the Docker image
    -echo "Building Docker image..."
    -docker build . -t $IMAGE_NAME
    -if [ $? -ne 0 ]; then
    -    echo "Failed to build Docker image."
    -    exit 1
    -fi
    -
    -# Stop the running container if it exists
    -if [ $(docker ps -q -f name=$CONTAINER_NAME) ]; then
    -    echo "Stopping running container..."
    -    docker stop $CONTAINER_NAME
    -    if [ $? -ne 0 ]; then
    -        echo "Failed to stop container $CONTAINER_NAME."
    -        exit 1
    -    fi
    -else
    -    echo "No running container named $CONTAINER_NAME found."
    -fi
    -
    -# Remove the container if it exists
    -if [ $(docker ps -a -q -f name=$CONTAINER_NAME) ]; then
    -    echo "Removing existing container..."
    -    docker rm $CONTAINER_NAME
    -    if [ $? -ne 0 ]; then
    -        echo "Failed to remove container $CONTAINER_NAME."
    -        exit 1
    -    fi
    -else
    -    echo "No existing container named $CONTAINER_NAME found."
    -fi
    -
    -# Run a new container
    -echo "Running a new container..."
    -docker run --name $CONTAINER_NAME -d $PORTS --shm-size=$SHM_SIZE $IMAGE_NAME
    -if [ $? -ne 0 ]; then
    -    echo "Failed to run the container."
    -    exit 1
    -fi
    -
    -echo "Container $CONTAINER_NAME is up and running."
    +
    #!/bin/bash
    +
    # Variables
    IMAGE_NAME="myapp"
    CONTAINER_NAME="myapp_container"
    PORTS="-p 3000:3000 -p 8086:8086"
    SHM_SIZE="2g"
    +
    # Build the Docker image
    echo "Building Docker image..."
    docker build . -t $IMAGE_NAME
    if [ $? -ne 0 ]; then
    echo "Failed to build Docker image."
    exit 1
    fi
    +
    # Stop the running container if it exists
    if [ $(docker ps -q -f name=$CONTAINER_NAME) ]; then
    echo "Stopping running container..."
    docker stop $CONTAINER_NAME
    if [ $? -ne 0 ]; then
    echo "Failed to stop container $CONTAINER_NAME."
    exit 1
    fi
    else
    echo "No running container named $CONTAINER_NAME found."
    fi
    +
    # Remove the container if it exists
    if [ $(docker ps -a -q -f name=$CONTAINER_NAME) ]; then
    echo "Removing existing container..."
    docker rm $CONTAINER_NAME
    if [ $? -ne 0 ]; then
    echo "Failed to remove container $CONTAINER_NAME."
    exit 1
    fi
    else
    echo "No existing container named $CONTAINER_NAME found."
    fi
    +
    # Run a new container
    echo "Running a new container..."
    docker run --name $CONTAINER_NAME -d $PORTS --shm-size=$SHM_SIZE $IMAGE_NAME
    if [ $? -ne 0 ]; then
    echo "Failed to run the container."
    exit 1
    fi
    +
    echo "Container $CONTAINER_NAME is up and running."

    This script includes the following enhancements:

    1. Variables: Defined variables for the image name, container name, ports, and shared memory size for easier adjustments.
    2. diff --git a/docs/application/gcloud/index.html b/docs/application/gcloud/index.html index bc590071b1..35698be1fe 100644 --- a/docs/application/gcloud/index.html +++ b/docs/application/gcloud/index.html @@ -130,21 +130,13 @@

      Load Balancer

      Shell command for VM that is running nginx inside of a debian operating system.

      • -
               gcloud compute instances create www-server-1 \
        -          --zone=us-west1-b \
        -          --tags=network-lb-tag \
        -          --machine-type=e2-medium \
        -          --image-family=debian-11 \
        -          --image-project=debian-cloud \
        -          --metadata=startup-script=start_nginx.sh
        +
        Terminal window
        gcloud compute instances create www-server-1 \
        --zone=us-west1-b \
        --tags=network-lb-tag \
        --machine-type=e2-medium \
        --image-family=debian-11 \
        --image-project=debian-cloud \
        --metadata=startup-script=start_nginx.sh
        • start_nginx.sh ->

          • -
                              #!/bin/bash
            -                  apt-get update
            -                  apt-get install nginx -y
            +
            #!/bin/bash
            apt-get update
            apt-get install nginx -y
        • @@ -163,16 +155,7 @@

          Load Balancer

          The shell below is an example of an instance template that creates the load balance backend template.

          • -
                gcloud compute instance-templates create lb-backend-template \
            -    --region=us-west1 \
            -    --network=default \
            -    --subnet=default \
            -    --tags=allow-health-check \
            -    --machine-type=e2-medium \
            -    --image-family=debian-11 \
            -    --image-project=debian-cloud \
            -    --metadata=startup-script=start_nginx_script.sh
            -    
            +
            Terminal window
            gcloud compute instance-templates create lb-backend-template \
            --region=us-west1 \
            --network=default \
            --subnet=default \
            --tags=allow-health-check \
            --machine-type=e2-medium \
            --image-family=debian-11 \
            --image-project=debian-cloud \
            --metadata=startup-script=start_nginx_script.sh
          @@ -188,43 +171,25 @@

          Load Balancer

          Manage Instance Group for the load balancer:

          • -
                gcloud compute instance-groups managed create lb-backend-group \
            -    --template=lb-backend-template --size=2 --zone=us-west1-b
            +
            Terminal window
            gcloud compute instance-groups managed create lb-backend-group \
            --template=lb-backend-template --size=2 --zone=us-west1-b
          • Health Check:

          • -
                gcloud compute firewall-rules create fw-allow-health-check \
            -    --network=default \
            -    --action=allow \
            -    --direction=ingress \
            -    --source-ranges=130.211.0.0/22,35.191.0.0/16 \
            -    --target-tags=allow-health-check \
            -    --rules=tcp:80
            -    ```
            -
            +
            Terminal window
            gcloud compute firewall-rules create fw-allow-health-check \
            --network=default \
            --action=allow \
            --direction=ingress \
            --source-ranges=130.211.0.0/22,35.191.0.0/16 \
            --target-tags=allow-health-check \
            --rules=tcp:80
            ```
          • Backend-Services for gcloud compute

            • -
              
              -  gcloud compute backend-services create web-backend-service \
              -      --protocol=HTTP \
              -      --port-name=http \
              -      --health-checks=http-basic-check \
              -      --global
              -
              +
              Terminal window
              gcloud compute backend-services create web-backend-service \
              --protocol=HTTP \
              --port-name=http \
              --health-checks=http-basic-check \
              --global
              • Add Instance Group as the Backend to the Backend Service:

                • -
                        gcloud compute backend-services add-backend web-backend-service \
                  -  --instance-group=lb-backend-group \
                  -  --instance-group-zone=us-west1-b \
                  -  --global
                  +
                  Terminal window
                  gcloud compute backend-services add-backend web-backend-service \
                  --instance-group=lb-backend-group \
                  --instance-group-zone=us-west1-b \
                  --global
              • @@ -232,10 +197,7 @@

                Load Balancer

                Create a URL Map for routing the requests to the default backend services.

                • -
                        gcloud compute url-maps create web-map-http \
                  -      --default-service web-backend-service
                  -      ```
                  -
                  +
                  Terminal window
                  gcloud compute url-maps create web-map-http \
                  --default-service web-backend-service
                  ```
                • Extra information regarding the URL Map: @@ -249,8 +211,7 @@

                  Load Balancer

                  Create a target HTTP proxy to route requests:

                  • -
                            gcloud compute target-http-proxies create http-lb-proxy \
                    -        --url-map web-map-http
                    +
                    Terminal window
                    gcloud compute target-http-proxies create http-lb-proxy \
                    --url-map web-map-http
                • @@ -258,11 +219,7 @@

                  Load Balancer

                  Global forwarding rule to route incoming requests to the proxy:

                  • -
                            gcloud compute forwarding-rules create http-content-rule \
                    -        --address=lb-ipv4-1\
                    -        --global \
                    -        --target-http-proxy=http-lb-proxy \
                    -        --ports=80
                    +
                    Terminal window
                    gcloud compute forwarding-rules create http-content-rule \
                    --address=lb-ipv4-1\
                    --global \
                    --target-http-proxy=http-lb-proxy \
                    --ports=80
                  diff --git a/docs/application/git/index.html b/docs/application/git/index.html index 53506926bc..482c1dfc8e 100644 --- a/docs/application/git/index.html +++ b/docs/application/git/index.html @@ -444,97 +444,26 @@

                  ci-patch.yml

                  It first checks out the code using the actions/checkout action. Then, it uses the diillson/auto-pull-request action to automatically create a pull request from the patch branch to the dev branch. The pull request will have a title indicating the source branch and a body containing the message “An automated PR”. Additionally, the pull request will be labeled with “auto-pr”.

                  -
                  name: CI Patch
                  -
                  -on:
                  -  push:
                  -    branches:
                  -      - 'patch*'
                  -
                  -jobs:
                  -  handle:
                  -    runs-on: ubuntu-latest
                  -    steps:
                  -      - name: Checkout
                  -        uses: actions/checkout@v4
                  -
                  -      - name: Auto-Pull
                  -        uses: diillson/auto-pull-request@latest
                  -        with:
                  -          github_token: ${{ secrets.GITHUB_TOKEN }}
                  -          destination_branch: 'dev'
                  -          pr_title: 'Pulling ${{ github.ref }} into Dev'
                  -          pr_body: |
                  -            *An automated PR*
                  -          pr_label: 'auto-pr'
                  +
                  name: CI Patch
                  +
                  on:
                  push:
                  branches:
                  - 'patch*'
                  +
                  jobs:
                  handle:
                  runs-on: ubuntu-latest
                  steps:
                  - name: Checkout
                  uses: actions/checkout@v4
                  +
                  - name: Auto-Pull
                  uses: diillson/auto-pull-request@latest
                  with:
                  github_token: ${{ secrets.GITHUB_TOKEN }}
                  destination_branch: 'dev'
                  pr_title: 'Pulling ${{ github.ref }} into Dev'
                  pr_body: |
                  *An automated PR*
                  pr_label: 'auto-pr'

                  kbve-shell

                  Example of calling the KBVE Shell

                  -
                  - name: React Fish & Chip
                  -  if: needs.alter.outputs.reactfishchip == 'true'
                  -  uses: ./.github/actions/kbve-shell
                  -  with:
                  -    flag: '-build react-phaser-fish-chip'
                  -    create_pull_request: true
                  -    github_token: ${{ secrets.GITHUB_TOKEN }}
                  -    pull_request_title: 'react-fish-chip-built-request'
                  -    pull_request_body: 'React Fish and Chip Built Request'
                  +
                  - name: React Fish & Chip
                  if: needs.alter.outputs.reactfishchip == 'true'
                  uses: ./.github/actions/kbve-shell
                  with:
                  flag: '-build react-phaser-fish-chip'
                  create_pull_request: true
                  github_token: ${{ secrets.GITHUB_TOKEN }}
                  pull_request_title: 'react-fish-chip-built-request'
                  pull_request_body: 'React Fish and Chip Built Request'

                  Music

                  These are brief notes on the i-music-process.yml within our monorepo.

                  These two steps are the core for the action that would process our music issue tickets. The first is design to parse the body of the created issue ticket and prepare it for a JSON POST, while the second step does the actual system prompt and sends the post request to the API.

                  -
                  
                  - - name: Escape issue body for JSON
                  -      if: env.HAS_YOUTUBE_LINK == 'true' && env.IS_MUSIC_ISSUE == 'true'
                  -      uses: actions/github-script@v7
                  -      with:
                  -        script: |
                  -              const marked = require('marked');
                  -              const DOMPurify = require('dompurify')(new (require('jsdom').JSDOM)().window);
                  -              const { JSDOM } = require('jsdom');
                  -
                  -              function markdownToJsonSafeString(markdownContent) {
                  -                  // Convert markdown to HTML
                  -                  const htmlContent = marked.parse(markdownContent);
                  -
                  -                  // Sanitize the HTML content
                  -                  const sanitizedHtmlContent = DOMPurify.sanitize(htmlContent);
                  -
                  -                  // Use jsdom to create a temporary DOM element to extract text content from sanitized HTML
                  -                  const dom = new JSDOM(sanitizedHtmlContent);
                  -                  const textContent = dom.window.document.body.textContent || '';
                  -
                  -                  // Ensure the text content is JSON-safe
                  -                  const jsonSafeString = JSON.stringify(textContent);
                  -
                  -                  return jsonSafeString;
                  -              }
                  -
                  -              const issueBody = context.payload.issue.body;
                  -              const escapedIssueBody = markdownToJsonSafeString(issueBody);
                  -              core.exportVariable('ESCAPED_ISSUE_BODY', escapedIssueBody);
                  -
                  -    - name: Extract and display YouTube ID if link is found
                  -      if: env.HAS_YOUTUBE_LINK == 'true' && env.IS_MUSIC_ISSUE == 'true'
                  -      uses: actions/github-script@v7
                  -      with:
                  -        script: |
                  -          const { YOUTUBE_ID, ESCAPED_ISSUE_BODY } = process.env;
                  -          const system = `Imagine three different data experts are answering this task. All experts will write down their steps of their thinking, then share it with the group. Then all experts will go on to the next step, etc. If any expert realizes they're wrong at any point then they leave. Remember the goal is to complete all of the steps provided and generate the final command. \n\n Please read the provided text, extract the required information, sanitize the title, and fill it into the specified command format. The title should only contain numbers, letters, spaces, hyphens, and characters (, ), ., and -. Your task is to complete a finalized kbve.sh shell command with the extracted information. If you can not complete the command, go back and process the input data again. \n\n Hint: Titles may contain multiple words separated by quotes and hyphens. These words are often the band name and followed by the song. **Example:**\n\`\`\`\n\n**Fill out the Form**\n\nYouTube Link: https://www.youtube.com/watch?v=<yt_id>\nTitle:  <title> \nGenre:  <genre>\n\nPick only one of the different genres!\ndnb, chillstep, lofihiphop, nujazz, electroswing, edm, rock, japrock\n\n\n\`\`\`\n\n**Output:**\n\n\`\`\`bash\n./kbve.sh -nx kbve.com:music --args=\\\"--file=<genre>--title='<title>' --ytid=<yt_id>\\\"\"\n\nHere is the template for the command:\n\`\`\`\n./kbve.sh -nx kbve.com:music --args=\\\"--file=[insert file/genre here] --title='[insert sanitized title here]' --ytid=[insert YouTube ID here]\\\"\n\nEnsure to:\n1. Extract the \`File/Genre\`, \`Title\`, and \`YouTube ID\` from the text.\n2. Sanitize the \`Title\` to only include numbers, letters, spaces, hyphens, quotes, periods, the characters () . and -. Please do not replace spaces with any other characters and keep the spaces in the sanitized title.\n3. Only acceptable genres/file are dnb, chillstep, lofihiphop, nujazz, electroswing, edm, rock, japrock\n4. Fill in the command template with the extracted and sanitized values.\n\n**Your Task:**\nPlease parse the provided text below and generate the command. You must follow all the steps that are stated and make sure to wrap the kbve.sh command in bash code block. \n\n`;
                  -          const message = ESCAPED_ISSUE_BODY;
                  -          const payload = JSON.stringify({
                  -            system,
                  -            message,
                  -            model: "mixtral-8x7b-32768"
                  -          });
                  -
                  -          const axios = require('axios');
                  -          const response = await axios.post('https://rust.kbve.com/api/v1/call_groq', payload, {
                  -            headers: {
                  -              'Content-Type': 'application/json'
                  -            }
                  -          });
                  -          core.exportVariable('GROQ_OUTPUT', response.data);
                  -
                  +
                  - name: Escape issue body for JSON
                  if: env.HAS_YOUTUBE_LINK == 'true' && env.IS_MUSIC_ISSUE == 'true'
                  uses: actions/github-script@v7
                  with:
                  script: |
                  const marked = require('marked');
                  const DOMPurify = require('dompurify')(new (require('jsdom').JSDOM)().window);
                  const { JSDOM } = require('jsdom');
                  +
                  function markdownToJsonSafeString(markdownContent) {
                  // Convert markdown to HTML
                  const htmlContent = marked.parse(markdownContent);
                  +
                  // Sanitize the HTML content
                  const sanitizedHtmlContent = DOMPurify.sanitize(htmlContent);
                  +
                  // Use jsdom to create a temporary DOM element to extract text content from sanitized HTML
                  const dom = new JSDOM(sanitizedHtmlContent);
                  const textContent = dom.window.document.body.textContent || '';
                  +
                  // Ensure the text content is JSON-safe
                  const jsonSafeString = JSON.stringify(textContent);
                  +
                  return jsonSafeString;
                  }
                  +
                  const issueBody = context.payload.issue.body;
                  const escapedIssueBody = markdownToJsonSafeString(issueBody);
                  core.exportVariable('ESCAPED_ISSUE_BODY', escapedIssueBody);
                  +
                  - name: Extract and display YouTube ID if link is found
                  if: env.HAS_YOUTUBE_LINK == 'true' && env.IS_MUSIC_ISSUE == 'true'
                  uses: actions/github-script@v7
                  with:
                  script: |
                  const { YOUTUBE_ID, ESCAPED_ISSUE_BODY } = process.env;
                  const system = `Imagine three different data experts are answering this task. All experts will write down their steps of their thinking, then share it with the group. Then all experts will go on to the next step, etc. If any expert realizes they're wrong at any point then they leave. Remember the goal is to complete all of the steps provided and generate the final command. \n\n Please read the provided text, extract the required information, sanitize the title, and fill it into the specified command format. The title should only contain numbers, letters, spaces, hyphens, and characters (, ), ., and -. Your task is to complete a finalized kbve.sh shell command with the extracted information. If you can not complete the command, go back and process the input data again. \n\n Hint: Titles may contain multiple words separated by quotes and hyphens. These words are often the band name and followed by the song. **Example:**\n\`\`\`\n\n**Fill out the Form**\n\nYouTube Link: https://www.youtube.com/watch?v=<yt_id>\nTitle: <title> \nGenre: <genre>\n\nPick only one of the different genres!\ndnb, chillstep, lofihiphop, nujazz, electroswing, edm, rock, japrock\n\n\n\`\`\`\n\n**Output:**\n\n\`\`\`bash\n./kbve.sh -nx kbve.com:music --args=\\\"--file=<genre>--title='<title>' --ytid=<yt_id>\\\"\"\n\nHere is the template for the command:\n\`\`\`\n./kbve.sh -nx kbve.com:music --args=\\\"--file=[insert file/genre here] --title='[insert sanitized title here]' --ytid=[insert YouTube ID here]\\\"\n\nEnsure to:\n1. Extract the \`File/Genre\`, \`Title\`, and \`YouTube ID\` from the text.\n2. Sanitize the \`Title\` to only include numbers, letters, spaces, hyphens, quotes, periods, the characters () . and -. Please do not replace spaces with any other characters and keep the spaces in the sanitized title.\n3. Only acceptable genres/file are dnb, chillstep, lofihiphop, nujazz, electroswing, edm, rock, japrock\n4. Fill in the command template with the extracted and sanitized values.\n\n**Your Task:**\nPlease parse the provided text below and generate the command. You must follow all the steps that are stated and make sure to wrap the kbve.sh command in bash code block. \n\n`;
                  const message = ESCAPED_ISSUE_BODY;
                  const payload = JSON.stringify({
                  system,
                  message,
                  model: "mixtral-8x7b-32768"
                  });
                  +
                  const axios = require('axios');
                  const response = await axios.post('https://rust.kbve.com/api/v1/call_groq', payload, {
                  headers: {
                  'Content-Type': 'application/json'
                  }
                  });
                  core.exportVariable('GROQ_OUTPUT', response.data);

                  Itch

                  Github Action for deploying the application build onto the Itch platform!

                  Deploying your application build to the Itch platform has never been easier, thanks to GitHub Actions! @@ -547,72 +476,13 @@

                  Itch

                  This powerful tool takes the manual effort out of deploying to Itch.io, allowing you to focus more on development and less on the repetitive tasks of deployment. Embrace automation and enhance your productivity with GitHub Actions and Itch.io!

                  Below is an example of a GitHub Itch workflow configuration. Note that tab indentations might be out of sync!

                  -
                  name: Itch Deploy
                  -
                  -on: push
                  -env:
                  -  ITCH_USERNAME: my-itch-username
                  -  ITCH_GAME_ID: my-itch-game-id
                  -jobs:
                  -  deploy:
                  -    name: Upload to Itch
                  -    runs-on: ubuntu-latest
                  -    strategy:
                  -      fail-fast: true
                  -      matrix:
                  -        channel:
                  -          - windows
                  -          - webgl
                  -    runs-on: ubuntu-latest
                  -    name: Deploy - Itch.io ${{ matrix.template }}
                  -    steps:
                  -      - uses: actions/download-artifact@v2.0.8
                  -        with:
                  -          name: ${{ matrix.channel }}
                  -          path: build/${{ matrix.channel }}
                  -      - uses: KikimoraGames/itch-publish@v0.0.3
                  -        with:
                  -          butlerApiKey: ${{secrets.BUTLER_API_KEY}}
                  -          gameData: ./build/${{ matrix.template }}
                  -          itchUsername: ${{env.ITCH_USERNAME}}
                  -          itchGameId: ${{ env.ITCH_GAME_ID }}
                  -          buildChannel: ${{ matrix.channel }}
                  -          buildNumber: ${{ needs.version.outputs.version_hash }}
                  -
                  +
                  name: Itch Deploy
                  +
                  on: push
                  env:
                  ITCH_USERNAME: my-itch-username
                  ITCH_GAME_ID: my-itch-game-id
                  jobs:
                  deploy:
                  name: Upload to Itch
                  runs-on: ubuntu-latest
                  strategy:
                  fail-fast: true
                  matrix:
                  channel:
                  - windows
                  - webgl
                  runs-on: ubuntu-latest
                  name: Deploy - Itch.io ${{ matrix.template }}
                  steps:
                  - uses: actions/download-artifact@v2.0.8
                  with:
                  name: ${{ matrix.channel }}
                  path: build/${{ matrix.channel }}
                  - uses: KikimoraGames/itch-publish@v0.0.3
                  with:
                  butlerApiKey: ${{secrets.BUTLER_API_KEY}}
                  gameData: ./build/${{ matrix.template }}
                  itchUsername: ${{env.ITCH_USERNAME}}
                  itchGameId: ${{ env.ITCH_GAME_ID }}
                  buildChannel: ${{ matrix.channel }}
                  buildNumber: ${{ needs.version.outputs.version_hash }}

                  Remember to add your secrets, BUTLER_API_KEY, before deploying to Itch.

                  You can grab the BUTLER_API_KEY from Itch via API Keys , which will allow Github Actions to communicate with Itch.io’s API.

                  KBVE Example:

                  -
                  name: Itch KBVE Deploy
                  -
                  -on: push
                  -env:
                  -  ITCH_USERNAME: kbve
                  -  ITCH_GAME_ID: my-itch-game-id
                  -jobs:
                  -  deploy:
                  -    name: Upload to Itch
                  -    runs-on: ubuntu-latest
                  -    strategy:
                  -      fail-fast: true
                  -      matrix:
                  -        channel:
                  -          - windows
                  -          - webgl
                  -    runs-on: ubuntu-latest
                  -    name: Deploy - Itch.io ${{ matrix.template }}
                  -    steps:
                  -      - uses: actions/download-artifact@v2.0.8
                  -        with:
                  -          name: ${{ matrix.channel }}
                  -          path: build/${{ matrix.channel }}
                  -      - uses: KikimoraGames/itch-publish@v0.0.3
                  -        with:
                  -          butlerApiKey: ${{secrets.BUTLER_API_KEY}}
                  -          gameData: ./build/${{ matrix.template }}
                  -          itchUsername: ${{env.ITCH_USERNAME}}
                  -          itchGameId: ${{ env.ITCH_GAME_ID }}
                  -          buildChannel: ${{ matrix.channel }}
                  -          buildNumber: ${{ needs.version.outputs.version_hash }}
                  +
                  name: Itch KBVE Deploy
                  +
                  on: push
                  env:
                  ITCH_USERNAME: kbve
                  ITCH_GAME_ID: my-itch-game-id
                  jobs:
                  deploy:
                  name: Upload to Itch
                  runs-on: ubuntu-latest
                  strategy:
                  fail-fast: true
                  matrix:
                  channel:
                  - windows
                  - webgl
                  runs-on: ubuntu-latest
                  name: Deploy - Itch.io ${{ matrix.template }}
                  steps:
                  - uses: actions/download-artifact@v2.0.8
                  with:
                  name: ${{ matrix.channel }}
                  path: build/${{ matrix.channel }}
                  - uses: KikimoraGames/itch-publish@v0.0.3
                  with:
                  butlerApiKey: ${{secrets.BUTLER_API_KEY}}
                  gameData: ./build/${{ matrix.template }}
                  itchUsername: ${{env.ITCH_USERNAME}}
                  itchGameId: ${{ env.ITCH_GAME_ID }}
                  buildChannel: ${{ matrix.channel }}
                  buildNumber: ${{ needs.version.outputs.version_hash }}

                  Unity

                  Introducing the Unity Test Runner as a GitHub Action, a seamless way to integrate automated testing into your Unity projects! This action allows you to run unit tests, integration tests, and play mode tests directly from your GitHub repository, ensuring your game code maintains high quality and functionality throughout development.

                  @@ -624,22 +494,7 @@

                  Unity

                  By incorporating the Unity Test Runner into your CI/CD pipeline, you can automate testing, catch bugs early, and maintain code quality with minimal effort. Elevate your Unity development process with this efficient and reliable testing solution!

                  Below is a sample GitHub Actions configuration for running Unity tests, ensuring your game code maintains high quality and functionality through continuous integration.

                  -
                  
                  -- uses: game-ci/unity-test-runner@v2.1.0
                  -    id: testRunner
                  -    env:
                  -        UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
                  -    with:
                  -        projectPath: ${{ matrix.projectPath }}
                  -        unityVersion: ${{ matrix.unityVersion }}
                  -        githubToken: ${{ secrets.GITHUB_TOKEN }}
                  -        customParameters: '-nographics'
                  -- uses: actions/upload-artifact@v2
                  -        if: always()
                  -        with:
                  -            name: Test results (all modes)
                  -            path: ${{ steps.testRunner.outputs.artifactsPath }}
                  -
                  +
                  - uses: game-ci/unity-test-runner@v2.1.0
                  id: testRunner
                  env:
                  UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
                  with:
                  projectPath: ${{ matrix.projectPath }}
                  unityVersion: ${{ matrix.unityVersion }}
                  githubToken: ${{ secrets.GITHUB_TOKEN }}
                  customParameters: '-nographics'
                  - uses: actions/upload-artifact@v2
                  if: always()
                  with:
                  name: Test results (all modes)
                  path: ${{ steps.testRunner.outputs.artifactsPath }}
                  • Remember that you will need a valid Unity license for this action!
                  @@ -647,33 +502,28 @@

                  Unity

                  1. Define the Workflow

                    -
                    name: Unity Test Runner
                    +
                    name: Unity Test Runner
                    • The name field sets the name of the workflow, making it easier to identify in the GitHub Actions tab.
                  2. Specify the Trigger Events

                    -
                    on: [push, pull_request]
                    +
                    on: [push, pull_request]
                    • The on field specifies the events that trigger this workflow. Here, it triggers on push and pull_request events.
                  3. Define the Job and Environment

                    -
                    jobs:
                    -  test:
                    -    runs-on: ubuntu-latest
                    +
                    jobs:
                    test:
                    runs-on: ubuntu-latest
                    • The jobs field defines the jobs that will run as part of this workflow. The test job runs on the ubuntu-latest environment, which provides a clean and consistent Linux environment for running the tests.
                  4. Set Up the Matrix Strategy

                    -
                    strategy:
                    -  matrix:
                    -    projectPath: [path/to/your/project]
                    -    unityVersion: [2020.3.11f1, 2021.1.13f1]
                    +
                    strategy:
                    matrix:
                    projectPath: [path/to/your/project]
                    unityVersion: [2020.3.11f1, 2021.1.13f1]
                    • The matrix strategy allows you to define multiple configurations for your jobs. Here, it sets up multiple Unity versions and project paths to test against, ensuring compatibility across different environments.
                    • @@ -681,9 +531,7 @@

                      Unity

                    • Checkout the Repository

                      -
                      steps:
                      -  - name: Checkout repository
                      -    uses: actions/checkout@v2
                      +
                      steps:
                      - name: Checkout repository
                      uses: actions/checkout@v2
                      • The steps field lists the steps in the job. The first step uses the actions/checkout action to clone the repository, providing access to the codebase for subsequent steps.
                      • @@ -691,13 +539,7 @@

                        Unity

                      • Cache Unity Packages

                        -
                        - name: Cache Unity packages
                        -  uses: actions/cache@v2
                        -  with:
                        -    path: ~/.local/share/unity3d/Unity/
                        -    key: ${{ runner.os }}-unity-${{ matrix.unityVersion }}
                        -    restore-keys: |
                        -      ${{ runner.os }}-unity-
                        +
                        - name: Cache Unity packages
                        uses: actions/cache@v2
                        with:
                        path: ~/.local/share/unity3d/Unity/
                        key: ${{ runner.os }}-unity-${{ matrix.unityVersion }}
                        restore-keys: |
                        ${{ runner.os }}-unity-
                        • Caching saves downloaded Unity packages between workflow runs, reducing the time needed for setup. The cache is identified by a unique key based on the runner OS and Unity version.
                        • @@ -705,16 +547,7 @@

                          Unity

                        • Run Unity Test Runner

                          -
                          - name: Run Unity Test Runner
                          -  uses: game-ci/unity-test-runner@v2.1.0
                          -  id: testRunner
                          -  env:
                          -    UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
                          -  with:
                          -    projectPath: ${{ matrix.projectPath }}
                          -    unityVersion: ${{ matrix.unityVersion }}
                          -    githubToken: ${{ secrets.GITHUB_TOKEN }}
                          -    customParameters: '-nographics'
                          +
                          - name: Run Unity Test Runner
                          uses: game-ci/unity-test-runner@v2.1.0
                          id: testRunner
                          env:
                          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
                          with:
                          projectPath: ${{ matrix.projectPath }}
                          unityVersion: ${{ matrix.unityVersion }}
                          githubToken: ${{ secrets.GITHUB_TOKEN }}
                          customParameters: '-nographics'
                          • This step runs the Unity Test Runner action:
                              @@ -735,12 +568,7 @@

                              Unity

                            • Upload Test Results

                              -
                              - name: Upload Test Results
                              -  uses: actions/upload-artifact@v2
                              -  if: always()
                              -  with:
                              -    name: Test results (all modes)
                              -    path: ${{ steps.testRunner.outputs.artifactsPath }}
                              +
                              - name: Upload Test Results
                              uses: actions/upload-artifact@v2
                              if: always()
                              with:
                              name: Test results (all modes)
                              path: ${{ steps.testRunner.outputs.artifactsPath }}
                              • This step uploads the test results as artifacts:
                                  @@ -801,15 +629,9 @@

                                  KBVE Module Example

                                  Suppose we have already added our submodule for an Unity project, via KBVE/UnitySubModule and wanted to link them into our source, well this is how:

                                  Create a folder inside of Assets named Plugins and then cd into it:

                                  Example of the shell, do not copy and paste, make sure you read through the commands and swap out the right variables!

                                  -
                                  cd ./unityRootProject
                                  -cd ./Assets
                                  -mkdir Plugins
                                  -cd ./Plugins
                                  -
                                  +
                                  Terminal window
                                  cd ./unityRootProject
                                  cd ./Assets
                                  mkdir Plugins
                                  cd ./Plugins

                                  Once inside the Plugins folder, we can execute the symbolic link using the ln command, like this:

                                  -
                                  
                                  -ln -s ../../submodules/UnitySubModules/Vuplex
                                  -
                                  +
                                  Terminal window
                                  ln -s ../../submodules/UnitySubModules/Vuplex

                                  Scripts

                                  Script commands for Git act as powerful helper scripts that automate and streamline various Git operations. @@ -819,27 +641,27 @@

                                  Scripts

                                  Commit

                                  The commit command stages all changes, commits them with the message “Minor change sync,” and pushes the commit to the current branch. This sequence ensures that all modifications are saved and synchronized with the remote repository.

                                  -
                                  branch=$(git rev-parse --abbrev-ref HEAD) && git add . && git commit -m "Minor change sync" && git push origin $branch
                                  +
                                  Terminal window
                                  branch=$(git rev-parse --abbrev-ref HEAD) && git add . && git commit -m "Minor change sync" && git push origin $branch

                                  This command does the following:

                                  1. Environmentals:

                                    -
                                    branch=$(git rev-parse --abbrev-ref HEAD)
                                    +
                                    Terminal window
                                    branch=$(git rev-parse --abbrev-ref HEAD)

                                    Stores the current branch name in the branch variable.

                                  2. Git Add

                                    -
                                    git add .
                                    +
                                    Terminal window
                                    git add .

                                    Stages all changes.

                                  3. Commit

                                    -
                                    git commit -m "Minor change sync"
                                    +
                                    Terminal window
                                    git commit -m "Minor change sync"

                                    : Commits the changes with the message “Minor change sync”.

                                  4. Push:

                                    -
                                    git push origin $branch
                                    +
                                    Terminal window
                                    git push origin $branch

                                    Pushes the changes to the current branch on the remote repository.

                                  diff --git a/docs/application/godot/index.html b/docs/application/godot/index.html index c45527be17..61656d8f03 100644 --- a/docs/application/godot/index.html +++ b/docs/application/godot/index.html @@ -92,7 +92,7 @@ })();

                                  GoDot

                                  Information

                                  +

                                  GoDot

                                  Information

                                  GoDot is a free and open source game engine that offers a unique and innovative way to create 2D and 3D games for various platforms, using a node and scene system, multiple programming languages, and a community-driven development model.

                                  // Abstract Factory
                                  class GUIFactory {
                                  createButton() {}
                                  createTextbox() {}
                                  }
                                  +
                                  // Concrete Factory for Windows
                                  class WindowsFactory extends GUIFactory {
                                  createButton() {
                                  return new WindowsButton();
                                  }
                                  createTextbox() {
                                  return new WindowsTextbox();
                                  }
                                  }
                                  +
                                  // Concrete Factory for MacOS
                                  class MacOSFactory extends GUIFactory {
                                  createButton() {
                                  return new MacOSButton();
                                  }
                                  createTextbox() {
                                  return new MacOSTextbox();
                                  }
                                  }
                                  +
                                  // Abstract Products
                                  class Button {
                                  render() {}
                                  }
                                  class Textbox {
                                  render() {}
                                  }
                                  +
                                  // Concrete Products for Windows
                                  class WindowsButton extends Button {
                                  render() {
                                  console.log('Rendering Windows button');
                                  }
                                  }
                                  class WindowsTextbox extends Textbox {
                                  render() {
                                  console.log('Rendering Windows textbox');
                                  }
                                  }
                                  +
                                  // Concrete Products for MacOS
                                  class MacOSButton extends Button {
                                  render() {
                                  console.log('Rendering MacOS button');
                                  }
                                  }
                                  class MacOSTextbox extends Textbox {
                                  render() {
                                  console.log('Rendering MacOS textbox');
                                  }
                                  }
                                  +
                                  // Client code
                                  function renderUI(factory) {
                                  const button = factory.createButton();
                                  button.render();
                                  const textbox = factory.createTextbox();
                                  textbox.render();
                                  }
                                  +
                                  const windowsFactory = new WindowsFactory();
                                  const macFactory = new MacOSFactory();
                                  +
                                  renderUI(windowsFactory);
                                  renderUI(macFactory);

                                  Abstract Factory Pattern Quick Tip:

                                  Use the Abstract Factory pattern when you need to ensure that your application can create and manage families of related or dependent products, or when you want to provide a library of products without exposing the implementation details. This pattern not only fosters system scalability and interchangeability but also promotes consistency among products.

                                  Advantages

                                    @@ -244,96 +182,34 @@

                                    Asbtract Factory Tutorial

                                  • Define Abstract Factory Interface:

                                    Create an interface for the abstract factory. This interface will declare methods for creating each type of vehicle.

                                    -
                                    
                                    -class VehicleFactory {
                                    -createCar() {}
                                    -createBoat() {}
                                    -}
                                    -
                                    +
                                    class VehicleFactory {
                                    createCar() {}
                                    createBoat() {}
                                    }
                                  • Create Concrete Factory Classes:

                                    Implement concrete factories that extend the abstract factory interface. Each factory will provide specific implementations for creating vehicles suitable for its environment.

                                    -
                                    
                                    -    class LandVehicleFactory extends VehicleFactory {
                                    -        createCar() {
                                    -            return new Sedan();
                                    -        }
                                    -        createBoat() {
                                    -            return new Canoe(); // Just for demonstration, usually wouldn't be in LandVehicleFactory
                                    -        }
                                    -    }
                                    -
                                    -    class WaterVehicleFactory extends VehicleFactory {
                                    -        createCar() {
                                    -            return new AmphibiousCar();
                                    -        }
                                    -        createBoat() {
                                    -            return new SpeedBoat();
                                    -        }
                                    -    }
                                    -
                                    -
                                    +
                                    class LandVehicleFactory extends VehicleFactory {
                                    createCar() {
                                    return new Sedan();
                                    }
                                    createBoat() {
                                    return new Canoe(); // Just for demonstration, usually wouldn't be in LandVehicleFactory
                                    }
                                    }
                                    +
                                    class WaterVehicleFactory extends VehicleFactory {
                                    createCar() {
                                    return new AmphibiousCar();
                                    }
                                    createBoat() {
                                    return new SpeedBoat();
                                    }
                                    }
                                  • Define Abstract Product Interfaces:

                                    Define interfaces for each type of vehicle. These interfaces will include methods that all concrete vehicle products must implement.

                                    -
                                    
                                    -class Car {
                                    -    drive() {}
                                    -}
                                    -
                                    -class Boat {
                                    -    sail() {}
                                    -}
                                    -
                                    +
                                    class Car {
                                    drive() {}
                                    }
                                    +
                                    class Boat {
                                    sail() {}
                                    }
                                  • Create Concrete Product Classes:

                                    Implement the product interfaces with concrete classes. These classes will define the specific characteristics of vehicles.

                                    -
                                    
                                    -class Sedan extends Car {
                                    -    drive() {
                                    -        console.log("Driving a sedan on roads");
                                    -    }
                                    -}
                                    -
                                    -class Canoe extends Boat {
                                    -    sail() {
                                    -        console.log("Canoeing in calm waters");
                                    -    }
                                    -}
                                    -
                                    -class AmphibiousCar extends Car {
                                    -    drive() {
                                    -        console.log("Driving an amphibious car on land and water");
                                    -    }
                                    -}
                                    -
                                    -class SpeedBoat extends Boat {
                                    -    sail() {
                                    -        console.log("Speeding through water with a speedboat");
                                    -    }
                                    -}
                                    -
                                    +
                                    class Sedan extends Car {
                                    drive() {
                                    console.log("Driving a sedan on roads");
                                    }
                                    }
                                    +
                                    class Canoe extends Boat {
                                    sail() {
                                    console.log("Canoeing in calm waters");
                                    }
                                    }
                                    +
                                    class AmphibiousCar extends Car {
                                    drive() {
                                    console.log("Driving an amphibious car on land and water");
                                    }
                                    }
                                    +
                                    class SpeedBoat extends Boat {
                                    sail() {
                                    console.log("Speeding through water with a speedboat");
                                    }
                                    }
                                  • Implement Client Code:

                                    Write the client code that utilizes the factories to create objects. The client should interact with these objects through their abstract interfaces.

                                    -
                                    
                                    -function testVehicle(factory) {
                                    -    const car = factory.createCar();
                                    -    car.drive();
                                    -    const boat = factory.createBoat();
                                    -    boat.sail();
                                    -}
                                    -
                                    -const landFactory = new LandVehicleFactory();
                                    -const waterFactory = new WaterVehicleFactory();
                                    -
                                    -testVehicle(landFactory);
                                    -testVehicle(waterFactory);
                                    -
                                    +
                                    function testVehicle(factory) {
                                    const car = factory.createCar();
                                    car.drive();
                                    const boat = factory.createBoat();
                                    boat.sail();
                                    }
                                    +
                                    const landFactory = new LandVehicleFactory();
                                    const waterFactory = new WaterVehicleFactory();
                                    +
                                    testVehicle(landFactory);
                                    testVehicle(waterFactory);
                                  • Test Your Implementation: @@ -357,40 +233,13 @@

                                    Implementation

                                  • Director: Takes a builder instance and executes the necessary operations to produce a part of the object. The director knows which builder to use to get the desired object configuration.
                                  • Product: The complex object that is being built. The builder returns the product as a final step.
                                  - +

                                  Advantages

                                  • Flexibility in Object Construction: Builders can construct objects step-by-step, vary the process based on the situation, and easily create different types of objects with the same construction code.
                                  • @@ -410,28 +259,11 @@

                                    Singleton

                                    Singletons also help in conserving system resources, as they avoid constant creation and destruction of objects when a single object is sufficient. However, care must be taken with Singletons as they can introduce global state into an application, which can complicate testing and limit flexibility.

                                    Overall, the Singleton pattern provides an elegant solution to ensuring a class has only one instance while offering a global point of access, thereby contributing to a cleaner and more manageable codebase.

                                    -
                  @@ -1452,12 +998,12 @@

                  SWUP Install

                  • Adding swup page into your nodejs application via yarn.

                    -
                        pnpm add swup
                    +
                    Terminal window
                    pnpm add swup

                    or yarn

                  • Plugins to install for swup via yarn.

                    -
                        yarn add @swup/scripts-plugin @swup/a11y-plugin @swup/head-plugin @swup/slide-theme @swup/scroll-plugin @swup/preload-plugin @swup/body-class-plugin @swup/debug-plugin
                    +
                    Terminal window
                    yarn add @swup/scripts-plugin @swup/a11y-plugin @swup/head-plugin @swup/slide-theme @swup/scroll-plugin @swup/preload-plugin @swup/body-class-plugin @swup/debug-plugin

                  @@ -1471,7 +1017,7 @@

                  ESBuild Setup

                • Install ESBuild:

                  First, you need to install ESBuild. You can do this using npm or yarn. Open your terminal and run one of the following commands:

                  -
                  npm install esbuild --save-dev
                  +
                  Terminal window
                  npm install esbuild --save-dev
                • Create Your Project Structure:

                  @@ -1485,14 +1031,9 @@

                  ESBuild Setup

                • Write Your JSX Component:

                  Create a simple React component in src/components/Graph.jsx:

                  -
                  // src/components/Graph.jsx
                  -import React from 'react';
                  -
                  -const Graph = () => {
                  -	return <div>This is a Graph component.</div>;
                  -};
                  -
                  -export default Graph;
                  +
                  src/components/Graph.jsx
                  import React from 'react';
                  +
                  const Graph = () => {
                  return <div>This is a Graph component.</div>;
                  };
                  +
                  export default Graph;
                  • Directorymy-project/
                    • Directorysrc/
                      • Directorycomponents/ @@ -1502,20 +1043,7 @@

                        ESBuild Setup

                      • Create an HTML File;

                        Create a simple HTML file in public/index.html to include your bundled script:

                        -
                        <!doctype html>
                        -<html lang="en">
                        -	<head>
                        -		<meta charset="UTF-8" />
                        -		<meta
                        -			name="viewport"
                        -			content="width=device-width, initial-scale=1.0" />
                        -		<title>ESBuild Example</title>
                        -	</head>
                        -	<body>
                        -		<div id="root"></div>
                        -		<script src="graph.js"></script>
                        -	</body>
                        -</html>
                        +
                        <!doctype html>
                        <html lang="en">
                        <head>
                        <meta charset="UTF-8" />
                        <meta
                        name="viewport"
                        content="width=device-width, initial-scale=1.0" />
                        <title>ESBuild Example</title>
                        </head>
                        <body>
                        <div id="root"></div>
                        <script src="graph.js"></script>
                        </body>
                        </html>
                        • Directorymy-project/
                          • Directorysrc/
                            • Directorycomponents/ @@ -1525,61 +1053,31 @@

                              ESBuild Setup

                            • Create an ESBuild Configuration File:

                              Create an esbuild.config.js file in the root of your project:

                              -
                              // esbuild.config.js
                              -const esbuild = require('esbuild');
                              -
                              -esbuild
                              -	.build({
                              -		entryPoints: ['src/components/Graph.jsx'],
                              -		bundle: true,
                              -		outfile: 'public/graph.js',
                              -		minify: true,
                              -		sourcemap: true,
                              -		platform: 'browser',
                              -		target: 'es2020',
                              -		jsxFactory: 'React.createElement',
                              -		jsxFragment: 'React.Fragment',
                              -	})
                              -	.catch(() => process.exit(1));
                              +
                              esbuild.config.js
                              const esbuild = require('esbuild');
                              +
                              esbuild
                              .build({
                              entryPoints: ['src/components/Graph.jsx'],
                              bundle: true,
                              outfile: 'public/graph.js',
                              minify: true,
                              sourcemap: true,
                              platform: 'browser',
                              target: 'es2020',
                              jsxFactory: 'React.createElement',
                              jsxFragment: 'React.Fragment',
                              })
                              .catch(() => process.exit(1));
                            • Add Build Script to package.json:

                              In your package.json, add a script to run the ESBuild configuration:

                              -
                              {
                              -	"name": "my-project",
                              -	"version": "1.0.0",
                              -	"scripts": {
                              -		"build": "node esbuild.config.js"
                              -	},
                              -	"devDependencies": {
                              -		"esbuild": "^0.13.0",
                              -		"react": "^17.0.0",
                              -		"react-dom": "^17.0.0"
                              -	}
                              -}
                              +
                              {
                              "name": "my-project",
                              "version": "1.0.0",
                              "scripts": {
                              "build": "node esbuild.config.js"
                              },
                              "devDependencies": {
                              "esbuild": "^0.13.0",
                              "react": "^17.0.0",
                              "react-dom": "^17.0.0"
                              }
                              }
                            • Build Your Project:

                              Run the build script from your terminal:

                              -
                              npm run build
                              +
                              Terminal window
                              npm run build

                              This command will bundle your Graph.jsx component, minify the output, generate a source map, and output the final script to public/graph.js.

                            • Serve Your HTML File:

                              You can use any static file server to serve your public directory. For simplicity, you can use the serve package:

                              -
                              # Install the serve package globally
                              -npm install -g serve
                              -
                              -# Serve the public directory
                              -serve public
                              +
                              Terminal window
                              # Install the serve package globally
                              npm install -g serve
                              +
                              # Serve the public directory
                              serve public

                              Now, open your browser and navigate to the URL provided by the serve command. You should see your HTML page with the bundled Graph component.

    ESBuild Example

    -
    
    -esbuild src/components/Graph.jsx --bundle --outfile=public/graph.js --minify --sourcemap --platform=browser --target=es2020 --jsx-factory=React.createElement --jsx-fragment=React.Fragment
    -
    +
    Terminal window
    esbuild src/components/Graph.jsx --bundle --outfile=public/graph.js --minify --sourcemap --platform=browser --target=es2020 --jsx-factory=React.createElement --jsx-fragment=React.Fragment

    This command tells esbuild to: