limixbot 0.3.56 → 0.3.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/dist/assets/{ActivityPanel-BVWYtrBe.js → ActivityPanel-0dlI1cZd.js} +1 -1
  2. package/dist/assets/{App-DmZz5o3J.js → App-CNqHO0Df.js} +9 -9
  3. package/dist/assets/{AppEventEditor-hCU3G2d1.js → AppEventEditor-BoSbr8sy.js} +1 -1
  4. package/dist/assets/{BotSettingsDialog-DL9z3aTi.js → BotSettingsDialog-DCnD6tH6.js} +1 -1
  5. package/dist/assets/{BrowserPanel-Ch__-OWg.js → BrowserPanel-DwkgzTh_.js} +1 -1
  6. package/dist/assets/{BrowserProfilesManager-CWA7mNoJ.js → BrowserProfilesManager-r8b7auV7.js} +1 -1
  7. package/dist/assets/{CloudAddDialog-D0IQITYc.js → CloudAddDialog-De4y8mF7.js} +1 -1
  8. package/dist/assets/{ComputerFilesPane-5wJrZa_u.js → ComputerFilesPane-DJagbIz4.js} +1 -1
  9. package/dist/assets/{ComputerPanel-B9KOFlNv.js → ComputerPanel-BCqe9Raj.js} +2 -2
  10. package/dist/assets/{DataPanel-B-JyQ7xc.js → DataPanel-CvhDoIuE.js} +1 -1
  11. package/dist/assets/{DesktopViewer-CCRdZbJF.js → DesktopViewer-8VFpsBvQ.js} +1 -1
  12. package/dist/assets/{FilesView-Bo4im_IT.js → FilesView-BcUfo8-m.js} +1 -1
  13. package/dist/assets/{GrokMoveDialog-BmXh6WA6.js → GrokMoveDialog-Crsz0qXw.js} +1 -1
  14. package/dist/assets/{InspectorPanel-pLEtaTZb.js → InspectorPanel-DwVoocbt.js} +1 -1
  15. package/dist/assets/{KeyboardShortcutsModal-VVipblqw.js → KeyboardShortcutsModal-CHsCzZf5.js} +1 -1
  16. package/dist/assets/{LimixChannelReview-BeNoqtuA.js → LimixChannelReview-Ctk6Qy6x.js} +1 -1
  17. package/dist/assets/{LiveDesktop-CXLpkt-k.js → LiveDesktop-BrHBDN5F.js} +1 -1
  18. package/dist/assets/{LocalVmWorkspace-B_1-9bTL.js → LocalVmWorkspace-Bc9f2b7u.js} +1 -1
  19. package/dist/assets/{MacLocalControl-BNRvCp7x.js → MacLocalControl-DHKPie0W.js} +1 -1
  20. package/dist/assets/{MarkdownFilePreview-D_XuMRdt.js → MarkdownFilePreview-EztVh4Qw.js} +1 -1
  21. package/dist/assets/{MenuMotion-BzOv8GJU.js → MenuMotion-BPNzITQk.js} +1 -1
  22. package/dist/assets/{NewBotDialog-P5QSRk_p.js → NewBotDialog-CxRA6ccj.js} +1 -1
  23. package/dist/assets/{PhoneAppDialog-D0zlYeqp.js → PhoneAppDialog-mKHayL_D.js} +1 -1
  24. package/dist/assets/{PlacesRail-IXn46tS1.js → PlacesRail-BGrgyyPN.js} +1 -1
  25. package/dist/assets/{PluginsPanel-DDJBKWEI.js → PluginsPanel-DEhECA1B.js} +1 -1
  26. package/dist/assets/{ProIntroduction-DQdu8iPK.js → ProIntroduction-hJeS2L4J.js} +1 -1
  27. package/dist/assets/{RemoteAgentSettingsPanel-D_zDGobD.js → RemoteAgentSettingsPanel-BssLnGhb.js} +1 -1
  28. package/dist/assets/{RoomPanel-CvWYisRC.js → RoomPanel-BDQfhtxC.js} +1 -1
  29. package/dist/assets/{RoutinesPage-MXfJ68R7.js → RoutinesPage-C1ZoB5sX.js} +1 -1
  30. package/dist/assets/{SettingsModal-Dwqi1VvU.js → SettingsModal-C56RNEWI.js} +1 -1
  31. package/dist/assets/{ShareTeamDialog-Ck0nAFFF.js → ShareTeamDialog-BooQ61vf.js} +1 -1
  32. package/dist/assets/{SignedInSites-BQk2nv46.js → SignedInSites-DduK69sb.js} +1 -1
  33. package/dist/assets/{TeamLibraryPanel-id-wJc3O.js → TeamLibraryPanel-BzShgxgy.js} +1 -1
  34. package/dist/assets/{TeamMapPage-Ch8DldTB.js → TeamMapPage-BvVVgqpy.js} +1 -1
  35. package/dist/assets/{TriggersPage-BgscytLu.js → TriggersPage-wwKKDI7M.js} +1 -1
  36. package/dist/assets/{VisibilitySection-Cuc3tlvq.js → VisibilitySection-D7Lvg-5m.js} +1 -1
  37. package/dist/assets/{WebhookTrigger-DoPiJhIh.js → WebhookTrigger-C-ZjH-YC.js} +1 -1
  38. package/dist/assets/{WorksOnGrid-B4KZkoC8.js → WorksOnGrid-D0CPLOqw.js} +1 -1
  39. package/dist/assets/{abnfDiagram-YUKMZFIV-CkJVSH6s.js → abnfDiagram-YUKMZFIV-C_JWNcbg.js} +1 -1
  40. package/dist/assets/{activity-C8fOzEZ6.js → activity-B41QcYoI.js} +1 -1
  41. package/dist/assets/{architectureDiagram-47P4ROYG-yW8Sv4kE.js → architectureDiagram-47P4ROYG-BmHQWF54.js} +1 -1
  42. package/dist/assets/{blockDiagram-E7TT5TSB-C7-vXTup.js → blockDiagram-E7TT5TSB-B0GhPvhm.js} +1 -1
  43. package/dist/assets/{c4Diagram-CRA5TL53-BmnygxjQ.js → c4Diagram-CRA5TL53-DO3TlAnO.js} +1 -1
  44. package/dist/assets/{calendar-days-CzPsyl4M.js → calendar-days-CACCISbV.js} +1 -1
  45. package/dist/assets/channel-BdqybvfO.js +1 -0
  46. package/dist/assets/{chunk-2Q5K7J3B-CH_vhlsJ.js → chunk-2Q5K7J3B-DpYBQmmM.js} +1 -1
  47. package/dist/assets/{chunk-5VM5RSS4-pcO8scT8.js → chunk-5VM5RSS4-DAbxfbL8.js} +1 -1
  48. package/dist/assets/{chunk-7TKQ45FW-DYdm98Qy.js → chunk-7TKQ45FW-u5OqMtnx.js} +1 -1
  49. package/dist/assets/{chunk-AW2ZBBNX--jITUvl9.js → chunk-AW2ZBBNX-ChuJcdB0.js} +1 -1
  50. package/dist/assets/{chunk-FVRAUYC3-D5B1J9-v.js → chunk-FVRAUYC3-CA4O-xlU.js} +2 -2
  51. package/dist/assets/{chunk-HTAEGDNF-BJSMfdax.js → chunk-HTAEGDNF-BvezmuDo.js} +1 -1
  52. package/dist/assets/{chunk-JWPE2WC7-C9017Ca8.js → chunk-JWPE2WC7-By5XfKu6.js} +1 -1
  53. package/dist/assets/{chunk-KQW6MTUR-jOaJJkrI.js → chunk-KQW6MTUR-866Km0o6.js} +1 -1
  54. package/dist/assets/{chunk-XXDRQBXY-D4wIrDdc.js → chunk-XXDRQBXY-CSSJnPQH.js} +1 -1
  55. package/dist/assets/{classDiagram-v2-K4WV4PDN-BH6hDrcF.js → classDiagram-v2-K4WV4PDN-C_5wMUxz.js} +1 -1
  56. package/dist/assets/{core-DcGXEdUJ.js → core-AbD6uegb.js} +1 -1
  57. package/dist/assets/{cose-bilkent-JH36ORCC-CHBL-qYe.js → cose-bilkent-JH36ORCC-ORD_r5MA.js} +1 -1
  58. package/dist/assets/{cynefin-EF2NZ3EQ-gSQ27OWL.js → cynefin-EF2NZ3EQ-DoQI9XJs.js} +1 -1
  59. package/dist/assets/{cynefinDiagram-3GCD6N5R-7VtkR4Rm.js → cynefinDiagram-3GCD6N5R-ireGBLi9.js} +1 -1
  60. package/dist/assets/{dagre-W4DXFKR2-CZZwuoI3.js → dagre-W4DXFKR2-zO-nsqal.js} +1 -1
  61. package/dist/assets/de-DSdUUIw0.js +8 -0
  62. package/dist/assets/{diagram-2UJZ2QOL-BkqQDsVi.js → diagram-2UJZ2QOL-CCQ8QxXk.js} +1 -1
  63. package/dist/assets/{diagram-OVF4WLC6-DZtdv2os.js → diagram-OVF4WLC6-1vmt64xi.js} +1 -1
  64. package/dist/assets/{diagram-PFPMY2P6-mHuvg1Yh.js → diagram-PFPMY2P6-BUHxHAzh.js} +1 -1
  65. package/dist/assets/{diagram-UMYRVEAY-DmWbPetf.js → diagram-UMYRVEAY-Cv0jKtl1.js} +1 -1
  66. package/dist/assets/{diagram-YEKJPTXX-ckEmz9MJ.js → diagram-YEKJPTXX-Dea8LxWp.js} +1 -1
  67. package/dist/assets/{diagram-ZIFT7M5P-BZbbAtN9.js → diagram-ZIFT7M5P-r0zQalwr.js} +1 -1
  68. package/dist/assets/{ebnfDiagram-VR2GEFS7-CEETAObG.js → ebnfDiagram-VR2GEFS7-BEuGYi56.js} +1 -1
  69. package/dist/assets/{elk-IJKZMXRS-DMHNkQxa.js → elk-IJKZMXRS-CCzCbeiz.js} +1 -1
  70. package/dist/assets/{erDiagram-O2IAPWRE-D0fm6YqD.js → erDiagram-O2IAPWRE-BAqrGlLo.js} +1 -1
  71. package/dist/assets/es-BHqvB5c_.js +6 -0
  72. package/dist/assets/{file-up-CGwEtDyl.js → file-up-7MSRu_tJ.js} +1 -1
  73. package/dist/assets/{flowDiagram-OXPTDLAJ-B1cKra-a.js → flowDiagram-OXPTDLAJ-CSozz9cS.js} +1 -1
  74. package/dist/assets/fr-BYea3ESR.js +8 -0
  75. package/dist/assets/{ganttDiagram-R7TSEDQI-Cs7lgJry.js → ganttDiagram-R7TSEDQI-pxhWOeWs.js} +1 -1
  76. package/dist/assets/{gitGraphDiagram-XJZIOB7I-CkYHekRq.js → gitGraphDiagram-XJZIOB7I-BADU6OSW.js} +1 -1
  77. package/dist/assets/hi-BAQE8TUj.js +1 -0
  78. package/dist/assets/{import-name-BEvkUHkR.js → import-name-C35sK-z3.js} +1 -1
  79. package/dist/assets/{index-cdZEFcNp.js → index-BpYftBNA.js} +1 -1
  80. package/dist/assets/{index-b3hQyJEl.js → index-DeEV-ND6.js} +3 -3
  81. package/dist/assets/{infoDiagram-5W2HQ5XZ-CuiZTzT6.js → infoDiagram-5W2HQ5XZ-CWoM5P-i.js} +1 -1
  82. package/dist/assets/{ishikawaDiagram-K3B6WC7H-Bbh6xyQ7.js → ishikawaDiagram-K3B6WC7H-BYXaYGzO.js} +1 -1
  83. package/dist/assets/it-BgRy0Y9T.js +13 -0
  84. package/dist/assets/ja-CDXnSplJ.js +13 -0
  85. package/dist/assets/{journeyDiagram-COXZFDF6-DGaQhzj7.js → journeyDiagram-COXZFDF6-CqOlHXSn.js} +1 -1
  86. package/dist/assets/{kanban-definition-P3RFRI5V-BfCjxcll.js → kanban-definition-P3RFRI5V-CFM1ORKv.js} +1 -1
  87. package/dist/assets/ko-DezefdWQ.js +13 -0
  88. package/dist/assets/{mcp-servers-CvIknXo6.js → mcp-servers-BEhtY7mu.js} +1 -1
  89. package/dist/assets/{mermaid.core-CfjIa7ec.js → mermaid.core-Cq11VdvX.js} +4 -4
  90. package/dist/assets/{mindmap-definition-LZFPQGKD-CSS6kKR8.js → mindmap-definition-LZFPQGKD-CS7kENCW.js} +1 -1
  91. package/dist/assets/{minimize-DBwcqTox.js → minimize-DSd0Havw.js} +1 -1
  92. package/dist/assets/{monitor-n8uYDoOi.js → monitor-DMjY_pXA.js} +1 -1
  93. package/dist/assets/{new-bot-r1NwO8HB.js → new-bot-B9uH0G1Y.js} +1 -1
  94. package/dist/assets/{org-library-DnF5sIUO.js → org-library-Bhp2doCp.js} +1 -1
  95. package/dist/assets/{package-format-B1aGys02.js → package-format-BiueDhzD.js} +1 -1
  96. package/dist/assets/{pegDiagram-BGZESJAR-CTRMLOh7.js → pegDiagram-BGZESJAR-D4DpGqoR.js} +1 -1
  97. package/dist/assets/{pieDiagram-CAPJLFHJ-C_5n677f.js → pieDiagram-CAPJLFHJ-C7YD3yGc.js} +1 -1
  98. package/dist/assets/pl-BBipFXI_.js +13 -0
  99. package/dist/assets/{pt-br-DiNqB940.js → pt-br-BJxfvqNu.js} +1 -1
  100. package/dist/assets/{quadrantDiagram-GDMTTRAM-Bbi8xLPN.js → quadrantDiagram-GDMTTRAM-DSXyfiSU.js} +1 -1
  101. package/dist/assets/{rail-MWyXJ2-b.js → rail-Dl45wDIl.js} +1 -1
  102. package/dist/assets/{railroadDiagram-SM67HX2B-BOrvGwno.js → railroadDiagram-SM67HX2B-CWvP9ANq.js} +1 -1
  103. package/dist/assets/{remote-desktop-panel-EQKttheJ.js → remote-desktop-panel-D-sQFlns.js} +1 -1
  104. package/dist/assets/{requirementDiagram-X7JNWC4A-DPGI5xVy.js → requirementDiagram-X7JNWC4A-9Dmjtk9f.js} +1 -1
  105. package/dist/assets/ru-D10lnyhT.js +13 -0
  106. package/dist/assets/{sankeyDiagram-UM26HJRW-DeHp-o1c.js → sankeyDiagram-UM26HJRW-Ctjh3RCW.js} +1 -1
  107. package/dist/assets/{sequenceDiagram-ZO4K6R2Y-E3Zucn1w.js → sequenceDiagram-ZO4K6R2Y-Dr7jO8Y7.js} +1 -1
  108. package/dist/assets/{sizeCapture-INFHLROL-kTgEkxEN.js → sizeCapture-INFHLROL-Dty4N3xe.js} +1 -1
  109. package/dist/assets/{stateDiagram-v2-TBUQTH76-BxZAmV_n.js → stateDiagram-v2-TBUQTH76-BYPhHQGL.js} +1 -1
  110. package/dist/assets/{styles-CvSVuxAa.js → styles-DmZQm0by.js} +1 -1
  111. package/dist/assets/{swimlanes-N4OXWK64-DxaVFa3q.js → swimlanes-N4OXWK64-DwVktbPI.js} +1 -1
  112. package/dist/assets/swimlanesDiagram-K3J5GTZL-CG80Flt0.js +8 -0
  113. package/dist/assets/{team-share-b9qqfYzp.js → team-share-nTnUcSy7.js} +1 -1
  114. package/dist/assets/{timeline-definition-YOQAKGHF-BeJIJIDZ.js → timeline-definition-YOQAKGHF-CpkiCfH_.js} +1 -1
  115. package/dist/assets/tr-DxJLR15s.js +6 -0
  116. package/dist/assets/uk-s288K1L0.js +1 -0
  117. package/dist/assets/{usecaseDiagram-VIAY4XPW-CVaWhI6e.js → usecaseDiagram-VIAY4XPW-DzH8xxcu.js} +1 -1
  118. package/dist/assets/{vennDiagram-BLWOH2XV-CSxjkbPN.js → vennDiagram-BLWOH2XV-CRfpSl9L.js} +1 -1
  119. package/dist/assets/{wardleyDiagram-YMQ3BMBF-r0pC7pPz.js → wardleyDiagram-YMQ3BMBF-Cd9szXxh.js} +1 -1
  120. package/dist/assets/{xychartDiagram-TAQBALBS-B2FXWNCp.js → xychartDiagram-TAQBALBS-CZ1XJHda.js} +1 -1
  121. package/dist/assets/zh-DwqheaKo.js +13 -0
  122. package/dist/assets/{zh-tw-DXbqGzsI.js → zh-tw-Cru2GKm6.js} +1 -1
  123. package/dist/index.html +2 -2
  124. package/dist/rail.html +4 -4
  125. package/dist-server/index.js +3 -3
  126. package/dist-server/package.json +1 -1
  127. package/dist-server/server/limix-image-routing.js +4 -2
  128. package/package.json +1 -1
  129. package/dist/assets/channel-D8QxWOVp.js +0 -1
  130. package/dist/assets/de-C8GllVmL.js +0 -8
  131. package/dist/assets/es-DL-LT7LK.js +0 -6
  132. package/dist/assets/fr-Cqgsh6FT.js +0 -8
  133. package/dist/assets/hi-DRlAa-mm.js +0 -1
  134. package/dist/assets/it-BapR4fyG.js +0 -13
  135. package/dist/assets/ja-rH-EVVS5.js +0 -13
  136. package/dist/assets/ko-DXzDBiEb.js +0 -13
  137. package/dist/assets/pl-BV7GtmiM.js +0 -13
  138. package/dist/assets/ru-DSSPfQyi.js +0 -13
  139. package/dist/assets/swimlanesDiagram-K3J5GTZL-CT8pJ1TX.js +0 -8
  140. package/dist/assets/tr-DJNxAMAd.js +0 -6
  141. package/dist/assets/uk-SbiO0vE9.js +0 -1
  142. package/dist/assets/zh-Ce8h_nYy.js +0 -13
@@ -1 +1 @@
1
- import{n as a}from"./App-DmZz5o3J.js";async function f(s,e){const t=await a("/api/teams/import?mode=add",{method:"POST",body:JSON.stringify(s)});for(const o of t.bots)e({type:"botAdded",bot:o});for(const o of t.groups??[])e({type:"groupPatched",group:o});for(const o of t.routines??[])e({type:"routinePatched",routine:o});const r=t.bots.find(o=>!o.hidden);return r&&e({type:"select",id:r.id}),{...t,...r?{first:r}:{}}}function c(s,e,t=100){const r=s.trim().slice(0,t);let o=r;for(let n=2;e.has(o.toLowerCase());n++){const i=` ${n}`;o=`${r.slice(0,t-i.length).trimEnd()}${i}`}return e.add(o.toLowerCase()),o}export{f as a,c as t};
1
+ import{n as a}from"./App-CNqHO0Df.js";async function f(s,e){const t=await a("/api/teams/import?mode=add",{method:"POST",body:JSON.stringify(s)});for(const o of t.bots)e({type:"botAdded",bot:o});for(const o of t.groups??[])e({type:"groupPatched",group:o});for(const o of t.routines??[])e({type:"routinePatched",routine:o});const r=t.bots.find(o=>!o.hidden);return r&&e({type:"select",id:r.id}),{...t,...r?{first:r}:{}}}function c(s,e,t=100){const r=s.trim().slice(0,t);let o=r;for(let n=2;e.has(o.toLowerCase());n++){const i=` ${n}`;o=`${r.slice(0,t-i.length).trimEnd()}${i}`}return e.add(o.toLowerCase()),o}export{f as a,c as t};
@@ -1,3 +1,3 @@
1
- import{d9 as W,da as A,db as k,dc as C,dd as $,de as q,df as z,dg as U,dh as X}from"./App-DmZz5o3J.js";import T from"./katex-HP8lGamR.js";import"./styles-CvSVuxAa.js";import"./index-b3hQyJEl.js";import"./PlacesRail-IXn46tS1.js";import"./monitor-n8uYDoOi.js";import"./MenuMotion-BzOv8GJU.js";const j=/[#.]/g;function Y(e,t){const n=e||"",r={};let o=0,i,s;for(;o<n.length;){j.lastIndex=o;const a=j.exec(n),c=n.slice(o,a?a.index:n.length);c&&(i?i==="#"?r.id=c:Array.isArray(r.className)?r.className.push(c):r.className=[c]:s=c,o+=c.length),a&&(i=a[0],o++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function B(e,t,n){const r=n?v(n):void 0;function o(i,s,...a){let c;if(i==null){c={type:"root",children:[]};const f=s;a.unshift(f)}else{c=Y(i,t);const f=c.tagName.toLowerCase(),l=r?r.get(f):void 0;if(c.tagName=l||f,J(s))a.unshift(s);else for(const[u,d]of Object.entries(s))Q(e,c.properties,u,d)}for(const f of a)w(c.children,f);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return o}function J(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const o=t[r];if(o&&typeof o=="object"){if(!Array.isArray(o))return!0;const i=o;for(const s of i)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function Q(e,t,n,r){const o=W(e,n);let i;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;i=r}else typeof r=="boolean"?i=r:typeof r=="string"?o.spaceSeparated?i=A(r):o.commaSeparated?i=k(r):o.commaOrSpaceSeparated?i=A(k(r).join(" ")):i=E(o,o.property,r):Array.isArray(r)?i=[...r]:i=o.property==="style"?Z(r):String(r);if(Array.isArray(i)){const s=[];for(const a of i)s.push(E(o,o.property,a));i=s}o.property==="className"&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[o.property]=i}}function w(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)w(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?w(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function E(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||C(n)===C(t)))return!0}return n}function Z(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function v(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const ee=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],te=B($,"div"),ne=B(q,"g",ee),y={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function re(e,t){return P(e,{})||{type:"root",children:[]}}function P(e,t){const n=oe(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function oe(e,t){switch(e.nodeType){case 1:return ae(e,t);case 3:return se(e);case 8:return ce(e);case 9:return S(e,t);case 10:return ie();case 11:return S(e,t);default:return}}function S(e,t){return{type:"root",children:D(e,t)}}function ie(){return{type:"doctype"}}function se(e){return{type:"text",value:e.nodeValue||""}}function ce(e){return{type:"comment",value:e.nodeValue||""}}function ae(e,t){const n=e.namespaceURI,r=n===y.svg?ne:te,o=n===y.html?e.tagName.toLowerCase():e.tagName,i=n===y.html&&o==="template"?e.content:e,s=e.getAttributeNames(),a={};let c=-1;for(;++c<s.length;)a[s[c]]=e.getAttribute(s[c])||"";return r(o,a,D(i,t))}function D(e,t){const n=e.childNodes,r=[];let o=-1;for(;++o<n.length;){const i=P(n[o],t);i!==void 0&&r.push(i)}return r}new DOMParser;function fe(e,t){const n=le(e);return re(n)}function le(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const I=(function(e,t,n){const r=z(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),h=(function(e){if(e==null)return he;if(typeof e=="string")return pe(e);if(typeof e=="object")return ue(e);if(typeof e=="function")return b(e);throw new Error("Expected function, string, or array as `test`")});function ue(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=h(e[n]);return b(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function pe(e){return b(t);function t(n){return n.tagName===e}}function b(e){return t;function t(n,r,o){return!!(de(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function he(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function de(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const O=/\n/g,M=/[\t ]+/g,N=h("br"),F=h(Ae),me=h("p"),L=h("tr"),ge=h(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",xe,ke]),G=h(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function ye(e,t){const n=t||{},r="children"in e?e.children:[],o=G(e),i=H(e,{whitespace:n.whitespace||"normal"}),s=[];(e.type==="text"||e.type==="comment")&&s.push(..._(e,{breakBefore:!0,breakAfter:!0}));let a=-1;for(;++a<r.length;)s.push(...R(r[a],e,{whitespace:i,breakBefore:a?void 0:o,breakAfter:a<r.length-1?N(r[a+1]):o}));const c=[];let f;for(a=-1;++a<s.length;){const l=s[a];typeof l=="number"?f!==void 0&&l>f&&(f=l):l&&(f!==void 0&&f>-1&&c.push(`
1
+ import{d9 as W,da as A,db as k,dc as C,dd as $,de as q,df as z,dg as U,dh as X}from"./App-CNqHO0Df.js";import T from"./katex-HP8lGamR.js";import"./styles-DmZQm0by.js";import"./index-DeEV-ND6.js";import"./PlacesRail-BGrgyyPN.js";import"./monitor-DMjY_pXA.js";import"./MenuMotion-BPNzITQk.js";const j=/[#.]/g;function Y(e,t){const n=e||"",r={};let o=0,i,s;for(;o<n.length;){j.lastIndex=o;const a=j.exec(n),c=n.slice(o,a?a.index:n.length);c&&(i?i==="#"?r.id=c:Array.isArray(r.className)?r.className.push(c):r.className=[c]:s=c,o+=c.length),a&&(i=a[0],o++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function B(e,t,n){const r=n?v(n):void 0;function o(i,s,...a){let c;if(i==null){c={type:"root",children:[]};const f=s;a.unshift(f)}else{c=Y(i,t);const f=c.tagName.toLowerCase(),l=r?r.get(f):void 0;if(c.tagName=l||f,J(s))a.unshift(s);else for(const[u,d]of Object.entries(s))Q(e,c.properties,u,d)}for(const f of a)w(c.children,f);return c.type==="element"&&c.tagName==="template"&&(c.content={type:"root",children:c.children},c.children=[]),c}return o}function J(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const o=t[r];if(o&&typeof o=="object"){if(!Array.isArray(o))return!0;const i=o;for(const s of i)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function Q(e,t,n,r){const o=W(e,n);let i;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;i=r}else typeof r=="boolean"?i=r:typeof r=="string"?o.spaceSeparated?i=A(r):o.commaSeparated?i=k(r):o.commaOrSpaceSeparated?i=A(k(r).join(" ")):i=E(o,o.property,r):Array.isArray(r)?i=[...r]:i=o.property==="style"?Z(r):String(r);if(Array.isArray(i)){const s=[];for(const a of i)s.push(E(o,o.property,a));i=s}o.property==="className"&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[o.property]=i}}function w(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)w(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?w(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function E(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||C(n)===C(t)))return!0}return n}function Z(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function v(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const ee=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],te=B($,"div"),ne=B(q,"g",ee),y={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function re(e,t){return P(e,{})||{type:"root",children:[]}}function P(e,t){const n=oe(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function oe(e,t){switch(e.nodeType){case 1:return ae(e,t);case 3:return se(e);case 8:return ce(e);case 9:return S(e,t);case 10:return ie();case 11:return S(e,t);default:return}}function S(e,t){return{type:"root",children:D(e,t)}}function ie(){return{type:"doctype"}}function se(e){return{type:"text",value:e.nodeValue||""}}function ce(e){return{type:"comment",value:e.nodeValue||""}}function ae(e,t){const n=e.namespaceURI,r=n===y.svg?ne:te,o=n===y.html?e.tagName.toLowerCase():e.tagName,i=n===y.html&&o==="template"?e.content:e,s=e.getAttributeNames(),a={};let c=-1;for(;++c<s.length;)a[s[c]]=e.getAttribute(s[c])||"";return r(o,a,D(i,t))}function D(e,t){const n=e.childNodes,r=[];let o=-1;for(;++o<n.length;){const i=P(n[o],t);i!==void 0&&r.push(i)}return r}new DOMParser;function fe(e,t){const n=le(e);return re(n)}function le(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const I=(function(e,t,n){const r=z(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),h=(function(e){if(e==null)return he;if(typeof e=="string")return pe(e);if(typeof e=="object")return ue(e);if(typeof e=="function")return b(e);throw new Error("Expected function, string, or array as `test`")});function ue(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=h(e[n]);return b(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function pe(e){return b(t);function t(n){return n.tagName===e}}function b(e){return t;function t(n,r,o){return!!(de(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function he(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function de(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const O=/\n/g,M=/[\t ]+/g,N=h("br"),F=h(Ae),me=h("p"),L=h("tr"),ge=h(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",xe,ke]),G=h(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function ye(e,t){const n=t||{},r="children"in e?e.children:[],o=G(e),i=H(e,{whitespace:n.whitespace||"normal"}),s=[];(e.type==="text"||e.type==="comment")&&s.push(..._(e,{breakBefore:!0,breakAfter:!0}));let a=-1;for(;++a<r.length;)s.push(...R(r[a],e,{whitespace:i,breakBefore:a?void 0:o,breakAfter:a<r.length-1?N(r[a+1]):o}));const c=[];let f;for(a=-1;++a<s.length;){const l=s[a];typeof l=="number"?f!==void 0&&l>f&&(f=l):l&&(f!==void 0&&f>-1&&c.push(`
2
2
  `.repeat(f)||" "),f=-1,c.push(l))}return c.join("")}function R(e,t,n){return e.type==="element"?we(e,t,n):e.type==="text"?n.whitespace==="normal"?_(e,n):Ne(e):[]}function we(e,t,n){const r=H(e,n),o=e.children||[];let i=-1,s=[];if(ge(e))return s;let a,c;for(N(e)||L(e)&&I(t,e,L)?c=`
3
3
  `:me(e)?(a=2,c=2):G(e)&&(a=1,c=1);++i<o.length;)s=s.concat(R(o[i],e,{whitespace:r,breakBefore:i?void 0:a,breakAfter:i<o.length-1?N(o[i+1]):c}));return F(e)&&I(t,e,F)&&s.push(" "),a&&s.unshift(a),c&&s.push(c),s}function _(e,t){const n=String(e.value),r=[],o=[];let i=0;for(;i<=n.length;){O.lastIndex=i;const c=O.exec(n),f=c&&"index"in c?c.index:n.length;r.push(be(n.slice(i,f).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),i===0?t.breakBefore:!0,f===n.length?t.breakAfter:!0)),i=f+1}let s=-1,a;for(;++s<r.length;)r[s].charCodeAt(r[s].length-1)===8203||s<r.length-1&&r[s+1].charCodeAt(0)===8203?(o.push(r[s]),a=void 0):r[s]?(typeof a=="number"&&o.push(a),o.push(r[s]),a=0):(s===0||s===r.length-1)&&o.push(0);return o}function Ne(e){return[String(e.value)]}function be(e,t,n){const r=[];let o=0,i;for(;o<e.length;){M.lastIndex=o;const s=M.exec(e);i=s?s.index:e.length,!o&&!i&&s&&!t&&r.push(""),o!==i&&r.push(e.slice(o,i)),o=s?i+s[0].length:i}return o!==i&&!n&&r.push(""),r.join(" ")}function H(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function xe(e){return!!(e.properties||{}).hidden}function Ae(e){return e.tagName==="td"||e.tagName==="th"}function ke(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const Ce={},Te=[];function Le(e){const t=e||Ce;return function(n,r){U(n,"element",function(o,i){const s=Array.isArray(o.properties.className)?o.properties.className:Te,a=s.includes("language-math"),c=s.includes("math-display"),f=s.includes("math-inline");let l=c;if(!a&&!c&&!f)return;let u=i[i.length-1],d=o;if(o.tagName==="code"&&a&&u&&u.type==="element"&&u.tagName==="pre"&&(d=u,u=i[i.length-2],l=!0),!u)return;const m=ye(d,{whitespace:"pre"});let p;try{p=T.renderToString(m,{...t,displayMode:l,throwOnError:!0})}catch(g){const x=g,V=x.name.toLowerCase();r.message("Could not render math with KaTeX",{ancestors:[...i,o],cause:x,place:o.position,ruleId:V,source:"rehype-katex"});try{p=T.renderToString(m,{...t,displayMode:l,strict:"ignore",throwOnError:!1})}catch{p=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(g)},children:[{type:"text",value:m}]}]}}typeof p=="string"&&(p=fe(p).children);const K=u.children.indexOf(d);return u.children.splice(K,1,...p),X})}}export{Le as default};
@@ -1,3 +1,3 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/App-DmZz5o3J.js","assets/styles-CvSVuxAa.js","assets/styles-Ce5Qc_2r.css","assets/PlacesRail-IXn46tS1.js","assets/monitor-n8uYDoOi.js","assets/MenuMotion-BzOv8GJU.js","assets/DesktopViewer-CCRdZbJF.js","assets/desktop-connection-Dfaq6k5a.js","assets/desktop-viewer-CF-OpSo0.js","assets/minimize-DBwcqTox.js"])))=>i.map(i=>d[i]);
2
- import{t as s,ar as St,s as I,as as jt,h as qe,o as be,at as Je,N as Nt,I as Et,r as u,au as Ct,y as ge,av as Ie,w as Te,aw as _e,ax as Pt,ay as It,j as r,S as Ze,X as Tt,a as $,az as _t,aA as At,l as K,L as Ot,a8 as ae,R as se,ae as Ae,p as H,aB as Lt,b as Rt,x as $t,z as Ht,A as Mt,B as Dt,aC as zt,aD as Bt,E as Ft,D as Ut,F as Wt,P as Kt,_ as Qe}from"./styles-CvSVuxAa.js";function xo(e,t){if(!t)return;if(t.kind!=="session")return t.kind==="loopback"?e:void 0;if(t.team||t.scopes.includes("admin"))return e;const n=t.email;if(n?.trim())return e?.email?.trim().toLowerCase()===n.trim().toLowerCase()?e:{email:n}}const et="omb.team-sign-in";function Vt(e){try{e&&globalThis.localStorage?.setItem(et,e)}catch{}}function Xt(){try{return globalThis.localStorage?.getItem(et)??null}catch{return null}}async function ne(e=fetch){let t;try{t=await e("/api/auth/session",{credentials:"same-origin"})}catch(a){return{kind:"unreachable",error:a instanceof Error?a.message:String(a)}}const n=await t.json().catch(()=>({})),o=Object(n);return t.status===401||t.status===403?{kind:"unauthenticated",error:typeof o.error=="string"?o.error:`${t.status}`}:t.ok?o.kind==="session"&&typeof o.id=="string"?{kind:"session",id:o.id,label:typeof o.label=="string"?o.label:"",...typeof o.email=="string"?{email:o.email}:{},scopes:Array.isArray(o.scopes)?o.scopes.filter(a=>typeof a=="string"):[],expiresAt:typeof o.expiresAt=="number"?o.expiresAt:0,...typeof o.reactor=="string"?{reactor:o.reactor}:{},...typeof o.teamSignIn=="string"?{teamSignIn:o.teamSignIn}:{},...Oe(o.team)?{team:Oe(o.team),openedThreads:Array.isArray(o.openedThreads)?o.openedThreads.filter(a=>typeof a=="string"):[]}:{},...o.cloudGuest===!0?{cloudGuest:!0,openedThreads:Array.isArray(o.openedThreads)?o.openedThreads.filter(a=>typeof a=="string"):[]}:{}}:o.trust==="service"?{kind:"loopback",trust:"service"}:{kind:"loopback"}:{kind:"unreachable",error:`${t.status} ${t.statusText}`}}function Oe(e){const t=Object(e);return typeof t.id=="string"&&typeof t.name=="string"&&typeof t.role=="string"?{id:t.id,name:t.name,role:t.role}:null}function Gt(e){return e?.kind==="session"||e?.kind==="loopback"&&e.trust!=="service"}function tt(e){return e?e.kind==="loopback"?e.trust!=="service":e.kind==="session"&&e.scopes.includes("admin"):!1}function Yt(){const e=/[#&]code=([^&]+)/.exec(location.hash);return e?(history.replaceState(null,"",location.pathname+location.search),decodeURIComponent(e[1])):null}function qt(){if(!/[#&]signin=/.test(location.hash))return null;const e=/[#&]signin=(omb_pair_[A-Za-z0-9_-]{43})(?:&|$)/.exec(location.hash);return history.replaceState(null,"",location.pathname+location.search),e?e[1]:null}function Jt(){const e=new URLSearchParams(location.search),t=e.get("email")?.trim().toLowerCase()??"";if(!t)return null;e.delete("email");const n=e.toString();return history.replaceState(null,"",location.pathname+(n?`?${n}`:"")+location.hash),/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(t)?t:null}function nt(e=navigator.userAgent){const t=/Edg\//.test(e)?"Edge":/OPR\//.test(e)?"Opera":/Chrome\//.test(e)?"Chrome":/Firefox\//.test(e)?"Firefox":/Safari\//.test(e)?"Safari":"Browser",n=/iPhone/.test(e)?"iPhone":/iPad/.test(e)?"iPad":/Android/.test(e)?"Android":/Mac OS X/.test(e)?"Mac":/Windows/.test(e)?"Windows":/Linux/.test(e)?"Linux":"";return n?`${t} on ${n}`:t}function Z(){return typeof crypto?.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,14)}`}function ot(e,t){const n=Reflect.get(Object(e),"error");return St(e,typeof n=="string"?n:`${t.status} ${t.statusText}`)}async function ue(e,t=fetch){let n;try{n=await t("/api/auth/pair",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({code:e.code,label:e.label,cookie:!0,attemptId:e.attemptId??Z(),...e.browser?{browser:!0}:{}})})}catch(a){return{ok:!1,error:s("pair.unreachable",{error:a instanceof Error?a.message:String(a)})}}const o=await n.json().catch(()=>({}));return n.ok?{ok:!0}:{ok:!1,error:ot(o,n)}}async function Zt(e,t=fetch){try{const n=await t("/api/auth/pair",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({code:e,browser:!0,preview:!0})}),o=Object(await n.json().catch(()=>({}))),a=Reflect.get(o,"owner"),i=Reflect.get(o,"team");return n.ok&&typeof a=="string"&&a?{owner:a,...typeof i=="string"&&i.trim()?{team:i.trim()}:{}}:null}catch{return null}}function Qt(e,t,n=fetch){return ue({code:e,label:nt(),attemptId:t,browser:!0},n)}function bo(e){const t=Object(e);return t.cloudHome===!0&&typeof t.owner=="string"&&t.owner?t.owner:null}async function rt(e,t,n){let o;try{o=await n(e,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}catch(i){return{ok:!1,error:s("pair.unreachable",{error:i instanceof Error?i.message:String(i)})}}const a=await o.json().catch(()=>({}));return o.ok?{ok:!0}:{ok:!1,error:ot(a,o)}}function en(e,t=fetch){return rt("/api/auth/email/start",{email:e},t)}function tn(e,t=fetch){return rt("/api/auth/email/verify",{email:e.email,code:e.code,label:e.label},t)}function Le(e){return!e||/through a proxy|loopback host required|cross-origin request|^40[13]$/i.test(e)?null:e}function nn(){window.ogb?.softwareRendering===!0&&(document.documentElement.dataset.softwareRendering="")}const on="/api/theme-assets/",rn="safe-look",at={cssChars:1e5,assetBytes:10*1024*1024},an=/^[a-z0-9][a-z0-9-]{0,47}$/,sn=/^[a-z0-9][a-z0-9_-]{0,79}\.(png|jpe?g|webp|gif|avif|svg|woff2?|ttf|otf)$/,ln=/^\/api\/theme-assets\/[a-z0-9][a-z0-9-]{0,47}\/[a-z0-9][a-z0-9_-]{0,79}\.[a-z0-9]{2,5}$/,st=["app","panel","frame","raised","raised-hover","card","inset","control","composer","composer-ring","menu","menu-hover","menu-active","hairline","edge","scrollbar","ink","ink-secondary","ink-tertiary","accent","accent-border","accent-text","accent-ink","focus","bubble-user","bubble-user-ink","success","success-ink","danger","danger-ink","warning"],Q=I().trim().regex(/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,"a hex colour such as #1a2b3c"),cn=I().trim().min(1).max(120).regex(/^[#a-z0-9(),.%\s/+-]+$/i,"a CSS colour such as #1a2b3c, rgb(…) or color-mix(…)").refine(e=>!/url|image|src|attr/i.test(e),"a colour, not a file"),it=jt(qe(st),cn),Re=be({canvas:Q.optional(),accent:Q.optional(),colors:it.optional()}).strict(),ye=be({name:I().trim().min(1).max(60),skin:qe([...Je,"system"]).optional(),canvas:Q.optional(),accent:Q.optional(),colors:it.optional(),light:Re.optional(),dark:Re.optional(),font:I().trim().max(300).regex(/^[\w\s"',.-]*$/,'a font-family list such as "Inter Variable", serif').optional(),css:I().max(at.cssChars).optional()}).strict(),un=1;be({mausbotTheme:Et(un),id:I().regex(an).optional(),theme:ye,assets:Nt(I().regex(sn),I().max(Math.ceil(at.assetBytes*1.4)).regex(/^data:[\w/+.-]+;base64,[A-Za-z0-9+/=]+$/)).optional()}).strict();function lt(e){return/^data:/i.test(e)||e.startsWith("#")||ln.test(e)&&!e.includes("..")}function ct(e){const t=e.toLowerCase(),n=[];for(let o=t.indexOf("url(");o!==-1;o=t.indexOf("url(",o+4)){let a=o+4;for(;/\s/.test(e[a]??"");)a++;const i=e[a];let c;if(i==='"'||i==="'"){const l=e.indexOf(i,a+1);if(l===-1)return null;for(c=e.slice(a+1,l),a=l+1;/\s/.test(e[a]??"");)a++;if(e[a]!==")")return null}else{const l=e.indexOf(")",a);if(l===-1||(c=e.slice(a,l).trim(),/[\s"'(]/.test(c)))return null}n.push(c.trim())}return n}const ut=/image-set\(|\bimage\(|\bsrc\(/i;function dt(e){if(e.includes("\\")||ut.test(e))return!0;const t=ct(e);return t===null||t.some(n=>!lt(n))}function dn(e){let t="";for(let n=0;n<e.length;n++){const o=e[n];if(o==="/"&&e[n+1]==="*"){const a=e.indexOf("*/",n+2);n=a===-1?e.length:a+1,t+=" "}else if(o==='"'||o==="'"){let a=n+1;for(;a<e.length&&e[a]!==o&&e[a]!==`
3
- `;)a+=e[a]==="\\"?2:1;t+=`${o}${" ".repeat(Math.max(0,a-n-1))}${o}`,n=a}else t+=o}return t}function go(e){const t=dn(e);if(/@import/i.test(t))return"@import is not allowed: themes cannot load other stylesheets.";if(t.includes("\\"))return"Backslash escapes are only allowed inside quoted strings.";if(ut.test(t))return"image-set(), image() and src() are not allowed: use url() with a theme file or a data: address.";const n=e.replace(/\/\*[\s\S]*?\*\//g," "),o=ct(n);if(o===null)return'A url() could not be read. Write url("/api/theme-assets/<theme>/<file>").';const a=o.find(i=>!lt(i));return a!==void 0?`url(${a.slice(0,80)}) is not allowed: themes load only their own files (${on}<theme>/<file>), data: addresses or #ids, never the internet.`:null}function de(e=typeof document>"u"?null:document.documentElement){if(!e||typeof window>"u"||typeof window.getComputedStyle!="function")return"dark";try{return window.getComputedStyle(e).getPropertyValue("--code-color-scheme").trim()==="light"?"light":"dark"}catch{return"dark"}}function yo(){const[e,t]=u.useState(()=>de());return u.useEffect(()=>{const n=()=>t(de());if(n(),typeof MutationObserver>"u")return;const o=new MutationObserver(n);return o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-skin"]}),()=>o.disconnect()},[]),e}const N=[255,255,255],P=[0,0,0];function ee(e){const t=e.trim().replace(/^#/,""),n=t.length===3?[...t].map(a=>a+a).join(""):t,o=Number.parseInt(n.slice(0,6),16);return Number.isFinite(o)?[o>>16&255,o>>8&255,o&255]:P}const V=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0"),d=([e,t,n],o)=>`#${V(e)}${V(t)}${V(n)}${o===void 0?"":V(o*255)}`,v=(e,t,n)=>[0,1,2].map(o=>e[o]+(t[o]-e[o])*n);function te([e,t,n]){const o=a=>{const i=a/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4};return .2126*o(e)+.7152*o(t)+.0722*o(n)}function me(e,t){const[n,o]=[te(e),te(t)].sort((a,i)=>i-a);return(n+.05)/(o+.05)}const $e=e=>te(ee(e))<.2?"dark":"light";function G(e,t,n){const o=te(t)<.2?N:P;let a=e;for(let i=1;i<=20&&me(a,t)<n;i++)a=v(e,o,i/20);return a}const mt=e=>me(N,e)>=me(P,e)?N:[17,17,17];function mn(e,t){const n=ee(e),o=t==="dark",a=f=>v(n,o?N:P,f),i=o?a(.08):v(n,N,.85),c=a(o?.14:.06),l=G(v(o?N:P,n,o?.04:.1),n,12),x=a(o?.22:.07);return{app:d(n),panel:d(o?v(n,P,.25):v(n,N,.45)),frame:d(o?v(n,P,.25):v(n,N,.45)),raised:d(i),"raised-hover":d(c),card:d(o?a(.07):i),inset:d(o?a(.04):n),control:d(a(o?.12:.07)),composer:d(o?a(.07):i),"composer-ring":d(a(o?.14:.12)),menu:d(i),"menu-hover":d(l,.06),"menu-active":d(l,.09),hairline:d(a(.2)),edge:d(l,.08),scrollbar:d(a(o?.25:.22)),ink:d(l),"ink-secondary":d(G(v(l,n,o?.3:.4),c,4.5)),"ink-tertiary":d(G(v(l,n,o?.42:.5),c,4.5)),"bubble-user":d(x),"bubble-user-ink":d(o?mt(x):l)}}function pn(e,t,n){const o=ee(e),a=G(o,ee(n),4.5);return{accent:d(o),"accent-ink":d(mt(o)),"accent-border":d(t==="dark"?v(o,N,.2):v(o,P,.1)),"accent-text":d(a),focus:d(a)}}class fn extends Error{}function Y(e,t){const n=globalThis[t];return typeof n=="function"&&e instanceof n}function He(e){const t=e.style;return t&&typeof t=="object"&&typeof t.getPropertyValue=="function"?t:null}function Me(e){for(let t=e.length-1;t>=0;t--){const n=e.item(t);dt(e.getPropertyValue(n))&&e.removeProperty(n)}}const hn=e=>"cssRules"in e&&typeof e.deleteRule=="function";function De(e,t,n){try{e.deleteRule(t)}catch{if(!Y(n,"CSSNamespaceRule"))throw new fn}}function pt(e){for(let t=e.cssRules.length-1;t>=0;t--){const n=e.cssRules[t];if(!n)continue;if(Y(n,"CSSKeyframesRule")){for(const a of Array.from(n.cssRules)){const i=He(a);i&&Me(i)}continue}if(Y(n,"CSSPropertyRule")){dt(n.initialValue??"")&&De(e,t,n);continue}const o=He(n);o&&Me(o),hn(n)?pt(n):!o&&!Y(n,"CSSLayerStatementRule")&&De(e,t,n)}}let R=null,ze="";function Be(e){if(!(typeof document>"u"||typeof CSSStyleSheet>"u"||!("adoptedStyleSheets"in document))&&e!==ze){ze=e,R||(R=new CSSStyleSheet,document.adoptedStyleSheets=[...document.adoptedStyleSheets,R]);try{R.replaceSync(e),pt(R)}catch{R.replaceSync("")}}}const pe="omb-theme",Fe="omb-safe-look";let A=null,F=[],ie=!1;const fe=new Set;function U(e){try{return typeof window>"u"?void 0:window[e]}catch{return}}function xn(){try{return typeof location<"u"&&new URLSearchParams(location.search).has(rn)&&U("sessionStorage")?.setItem(Fe,"1"),U("sessionStorage")?.getItem(Fe)==="1"}catch{return!1}}function ko(){return A}function wo(e){return fe.add(e),()=>{fe.delete(e)}}function bn(e){for(const t of F)e.style.removeProperty(t);F=[]}function q(){if(!(typeof document>"u"||ie)){ie=!0;try{const e=document.documentElement;bn(e);const t=xn()?null:A?.theme;if(!t){delete e.dataset.theme,Be(""),Te(_e());return}const n=t.skin??(t.canvas?Pt[$e(t.canvas)]:void 0);Te(n?It(n):_e());const o=de(e),a=t[o],i=a?.canvas??(t.canvas&&$e(t.canvas)===o?t.canvas:void 0),c=a?.accent??t.accent,l={...i?mn(i,o):{},...c?pn(c,o,i??(o==="dark"?"#121212":"#ffffff")):{},...t.colors,...a?.colors};for(const x of st){const f=l[x];f&&(e.style.setProperty(`--color-${x}`,f),F.push(`--color-${x}`))}i&&(e.style.setProperty("--code-color-scheme",o),F.push("--code-color-scheme")),t.font&&(e.style.setProperty("--font-sans",t.font),F.push("--font-sans")),e.dataset.theme=A.id,Be(t.css??"")}finally{ie=!1;for(const e of fe)e()}}}function ke(e){A=e;try{e?U("localStorage")?.setItem(pe,JSON.stringify(e)):U("localStorage")?.removeItem(pe)}catch{}q()}function gn(){try{const e=JSON.parse(U("localStorage")?.getItem(pe)??"null"),t=ye.safeParse(e?.theme);return typeof e?.id=="string"&&t.success?{id:e.id,theme:t.data}:null}catch{return null}}async function we(){try{const e=await fetch("/api/themes/active",{headers:{accept:"application/json"}});if(!e.ok)return;const t=await e.json(),n=t.theme?ye.safeParse(t.theme):null;ke(t.id&&n?.success?{id:t.id,theme:n.data}:null)}catch{}}function vo(e){const t=e.skin;(t==="system"||Je.includes(t))&&ge(t),we()}const ve=(e,t)=>fetch("/api/themes/active",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({id:e,...t?{skin:t}:{}})}).then(n=>n.ok,()=>!1);function So(){A&&(ke(null),ve(null))}async function jo(e){const t=await ve(e);return t&&await we(),t}function yn(){ge(Ie),ke(null),ve(null,Ie)}const kn=e=>e.code==="KeyR"&&e.altKey&&e.shiftKey&&(e.metaKey||e.ctrlKey);function wn(){if(!(typeof window>"u")){if(window.addEventListener("keydown",e=>{kn(e)&&(e.preventDefault(),e.stopPropagation(),yn())},{capture:!0}),Ct(q),typeof matchMedia=="function")try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",q)}catch{}A=gn(),A&&q()}}function vn({credential:e,owner:t,team:n}){const[o]=u.useState(()=>Z()),[a,i]=u.useState(!1),[c,l]=u.useState(null);async function x(){i(!0),l(null);const f=await Qt(e,o);if(f.ok){location.replace("/");return}i(!1),l(f.error)}return r.jsx("main",{className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:r.jsxs("div",{className:"w-full max-w-[420px]",children:[r.jsx("h1",{className:"text-[20px] font-semibold",children:n?s("pair.browser.teamTitle",{team:n,owner:t}):s("pair.browser.title",{owner:t})}),r.jsx("p",{className:"mt-1.5 text-[14px] text-ink-secondary",children:s("pair.browser.notYou")}),c?r.jsx("p",{role:"alert",className:"mt-3 text-[13px] text-danger",children:c}):null,r.jsx("button",{type:"button",onClick:()=>{x()},disabled:a,className:"mt-5 w-full rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink disabled:opacity-50",children:s(a?"pair.signingIn":"pair.continue")})]})})}const Se="bg-composer ring-1 ring-inset ring-ink/[0.07]",Sn="bg-composer ring-[0.5px] ring-ink/10",No=`${Sn} shadow-(--shadow-float)`,ft="transition-colors duration-[120ms] hover:bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]",jn=`${ft} aria-expanded:bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]`,Eo="bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]",Co="focus-visible:outline-2 focus-visible:-outline-offset-2! focus-visible:outline-focus",ht="flex size-9 shrink-0 items-center justify-center rounded-full text-ink/90",je="focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",Nn=`${ht} ${Se} ${jn} ${je}`,Po=`${ht} ${Se} ${ft} ${je}`,En=`flex size-[26px] shrink-0 items-center justify-center rounded-lg text-ink-secondary transition-colors hover:bg-ink/[0.06] hover:text-ink aria-expanded:bg-ink/[0.06] aria-expanded:text-ink ${je}`,Io="flex size-10 shrink-0 items-center justify-center rounded-full border border-hairline bg-card text-ink hover:bg-raised focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",Cn="flex size-9 shrink-0 items-center justify-center rounded-xl text-ink-secondary hover:bg-raised/60 hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus";function To({open:e,onToggle:t,corner:n=!1,ref:o}){return r.jsx("button",{ref:o,type:"button","data-sidebar-search-toggle":!0,onClick:t,"aria-label":s("sidebar.searchAria"),"aria-expanded":e,title:s("sidebar.searchAria"),className:n?En:Nn,children:r.jsx(Ze,{size:n?17:18,strokeWidth:1.5,"aria-hidden":"true"})})}function _o({query:e,onQuery:t,onClose:n}){return r.jsx("div",{"data-sidebar-search-pill":!0,className:"px-3 pb-2 pt-0.5",children:r.jsxs("div",{className:$("flex h-[34px] items-center gap-2 rounded-full pl-3 pr-1.5 text-ink-secondary focus-within:ring-focus",Se),children:[r.jsx(Ze,{size:15,"aria-hidden":"true",className:"shrink-0"}),r.jsx("input",{autoFocus:!0,value:e,onChange:o=>t(o.target.value),onKeyDown:o=>{o.key==="Escape"&&(o.preventDefault(),n())},placeholder:s("sidebar.searchAria"),"aria-label":s("sidebar.searchAria"),className:"min-w-0 flex-1 bg-transparent text-[13px] text-ink placeholder:text-ink-tertiary focus:outline-none"}),r.jsx("button",{type:"button",onClick:n,"aria-label":s("sidebar.searchClose"),title:s("sidebar.searchClose"),className:"flex size-6 shrink-0 items-center justify-center rounded-full text-ink-tertiary hover:bg-raised hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-focus",children:r.jsx(Tt,{size:14,"aria-hidden":"true"})})]})})}function Pn(e,{howTo:t=!1,onClosed:n}={}){return e.menu(t?{from:"howto"}:void 0).finally(()=>{t&&n?.()})}function Ao(e){e({type:"cloudHowTo",open:!1})}function Ue({text:e}){return r.jsxs("span",{className:"font-normal text-ink-secondary",children:[" · ",e]})}function In(e){return e?.sleeps===!0?!0:e?.status==="paid"?!1:null}function Tn(e){const t=e&&!window.ogb?.remoteClient?.active?window.ogb?.cloudPlan:void 0,n=e||window.ogb?.remoteClient?.active?void 0:window.ogb?.cloudAccount,[o,a]=u.useState(null),[i,c]=u.useState(!1);return u.useEffect(()=>{if(!t)return;let l=!0;return t.state().then(x=>{l&&a(In(x))}).catch(()=>{}),()=>{l=!1}},[t]),u.useEffect(()=>n?.onState(l=>c(l.waking===!0)),[n]),{sleeps:t?o:null,waking:i}}function _n({cloudHome:e=!1,howTo:t=!1,onMenuClosed:n}){const o=window.ogb?.workspaces,[a,i]=u.useState(null),[c,l]=u.useState(!1),[x,f]=u.useState("");u.useEffect(()=>{let p=!0;const k=()=>{o?.state().then(E=>{p&&i(E)}).catch(()=>{})};k();const T=o?.onChanged?.(k);return()=>{p=!1,T?.()}},[o]);const w=Tn(e||a?.home===!0),m=w.sleeps===null?"":s(w.sleeps?"cloudSetup.sleepsWhenIdle":"cloudSetup.alwaysOn"),g=w.waking?s("cloudHome.waking"):"";return{bridge:o,current:a,cloudHome:e,open:c,error:x,onLine:m,waking:g,openMenu:()=>{!o||c||(f(""),l(!0),Pn(o,{howTo:t,onClosed:n}).catch(()=>f(s("sidebar.switchServerError"))).finally(()=>l(!1)))},switchable:!!o&&a?.home!==!0}}function An(e){const t=_t(),n=r.jsx(On,{...e});return At(t)?r.jsx("div",{"data-switcher-beside-rail":!0,className:t.beside?"hidden":"contents md:hidden",children:n}):n}function On({compact:e=!1,inline:t=!1,pill:n=!1,rail:o=!1,cloudHome:a=!1,owner:i=null,howTo:c=!1,place:l,onMenuClosed:x}){const f=l||s("cloudSetup.myCloud"),{bridge:w,current:m,open:g,error:y,onLine:p,waking:k,openMenu:T}=_n({cloudHome:a,howTo:c,onMenuClosed:x}),E=b=>p?`${b} · ${p}`:b;if(!w||m?.home===!0){if(!a&&!m?.home)return null;const b=i?s("sidebar.cloudOwner",{email:i}):"",j=`${E(f)}${b?` · ${b}`:""}`;return o?r.jsx("div",{"data-cloud-home-indicator":!0,"data-workspace-switcher":"rail",role:"img","aria-label":j,title:j,className:"flex size-9 items-center justify-center text-ink-secondary",children:r.jsx(K,{size:18,"aria-hidden":"true"})}):t?r.jsxs("div",{"data-cloud-home-indicator":!0,"data-workspace-switcher":"inline",title:j,className:n?"flex h-8 min-w-0 items-center gap-1 rounded-full bg-raised/50 px-3 text-[13px] font-medium text-ink":"flex min-w-0 items-center gap-1.5 px-1.5 text-[13px] font-medium text-ink",children:[r.jsx(K,{size:n?15:14,"aria-hidden":"true",className:n?"hidden shrink-0 text-ink-secondary @max-[124px]/sidebar-top:block":"shrink-0 text-ink-secondary"}),r.jsx("span",{className:n?"min-w-0 truncate @max-[124px]/sidebar-top:hidden":"min-w-0 truncate",children:f}),(p||b)&&r.jsxs("span",{className:"sr-only",children:[p?` · ${p}`:"",b?` · ${b}`:""]})]}):r.jsx("div",{"data-cloud-home-indicator":!0,className:$("py-1.5",e?"px-2":"px-3"),children:r.jsxs("div",{title:j,className:$("flex items-center gap-2 py-2 text-[13px] font-medium text-ink",e?"justify-center px-1":"px-2"),children:[r.jsx(K,{size:16,"aria-hidden":"true",className:"shrink-0 text-ink-secondary"}),e?r.jsx("span",{className:"sr-only",children:j}):r.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[f,p&&r.jsx(Ue,{text:p}),b&&r.jsx("span",{className:"block truncate text-[12px] font-normal text-ink-secondary",children:b})]})]})})}const O=m?.profileName??(m?.local&&!m.localPath?s("place.local"):m?.name)??(a?f:s("sidebar.servers")),S=m?.local===!1||a&&!m?K:Ot,M=a?E(O):O,_=m?.origin?`${M} · ${m.origin}`:M,L=s("sidebar.switchServer",{name:M});return o?r.jsxs("div",{"data-workspace-switcher":"rail",className:"relative",children:[r.jsx("button",{type:"button","aria-label":L,"aria-haspopup":"menu","aria-expanded":g,"data-cloud-home-indicator":a||void 0,"data-tour":"server-switcher",title:_,onClick:T,className:$(Cn,"aria-expanded:bg-raised"),style:{WebkitAppRegion:"no-drag"},children:ae(m?.color)?r.jsx(se,{color:m?.color,size:18}):r.jsx(S,{size:18,"aria-hidden":"true"})}),y&&r.jsx("p",{role:"alert",className:"absolute bottom-0 left-full z-40 ml-2 w-56 rounded-md bg-menu px-2 py-1 text-[11px] text-danger shadow-lg",children:y}),k&&!y&&r.jsx("p",{role:"status","data-cloud-waking":!0,className:"absolute bottom-0 left-full z-40 ml-2 w-56 rounded-md bg-menu px-2 py-1 text-[11px] text-ink-secondary shadow-lg",children:k})]}):t?r.jsxs("div",{"data-workspace-switcher":"inline",className:"flex min-w-0",children:[r.jsxs("button",{type:"button","aria-label":L,"aria-haspopup":"menu","aria-expanded":g,"data-cloud-home-indicator":a||void 0,"data-tour":"server-switcher",title:_,onClick:T,className:n?"flex h-8 min-w-0 max-w-full items-center gap-1 overflow-hidden rounded-full bg-raised/50 pl-2.5 pr-1.5 text-left text-[13px] font-medium text-ink hover:bg-raised aria-expanded:bg-raised focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus":"flex h-7 min-w-0 max-w-full items-center gap-1.5 overflow-hidden rounded-md px-1.5 text-left text-[13px] font-medium text-ink hover:bg-control focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",style:{WebkitAppRegion:"no-drag"},children:[ae(m?.color)?r.jsx(se,{color:m?.color,size:16}):r.jsx(S,{size:n?15:14,"aria-hidden":"true","data-switcher-icon":!0,className:n?"hidden shrink-0 text-ink-secondary @max-[124px]/sidebar-top:block":"shrink-0 text-ink-secondary"}),r.jsx("span",{className:n?"min-w-0 truncate @max-[124px]/sidebar-top:hidden":"min-w-0 truncate @max-[96px]/sidebar-top:hidden",children:O}),r.jsx(Ae,{size:n?12:11,"aria-hidden":"true",className:n?"shrink-0 text-ink-tertiary":"shrink-0 text-ink-secondary"})]}),y&&r.jsx("p",{role:"alert",className:"absolute right-2 top-full z-40 mt-1 w-56 max-w-[calc(100%-1rem)] rounded-md bg-menu px-2 py-1 text-[11px] text-danger shadow-lg",children:y}),k&&!y&&r.jsx("p",{role:"status","data-cloud-waking":!0,className:"absolute right-2 top-full z-40 mt-1 w-56 max-w-[calc(100%-1rem)] rounded-md bg-menu px-2 py-1 text-[11px] text-ink-secondary shadow-lg",children:k})]}):r.jsxs("div",{className:$("py-1.5",e?"px-2":"px-3"),children:[r.jsxs("button",{type:"button","aria-label":L,"aria-haspopup":"menu","aria-expanded":g,"data-cloud-home-indicator":a||void 0,"data-tour":"server-switcher",title:_,onClick:T,className:$("flex w-full items-center gap-2 rounded-lg py-2 text-left text-[13px] font-medium text-ink hover:bg-control focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",e?"justify-center px-1":"px-2"),style:{WebkitAppRegion:"no-drag"},children:[ae(m?.color)?r.jsx(se,{color:m?.color,size:20}):r.jsx(S,{size:16,className:"shrink-0 text-ink-secondary"}),!e&&r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[O,a&&p&&r.jsx(Ue,{text:p})]}),r.jsx(Ae,{size:13,className:"shrink-0 text-ink-secondary"})]})]}),y&&r.jsx("p",{role:"alert",className:"mt-1 text-[11px] text-danger",children:y}),k&&!y&&r.jsx("p",{role:"status","data-cloud-waking":!0,className:"mt-1 text-[11px] text-ink-secondary",children:k})]})}function Ln(e){const t=e&&typeof e=="object"?e.membership:void 0,n=t&&typeof t=="object"?t:{};let o=null;if(typeof n.peopleUrl=="string")try{new URL(n.peopleUrl).protocol==="https:"&&(o=n.peopleUrl)}catch{o=null}return{authority:n.authority==="portal"?"portal":"local",pairingCodes:n.pairingCodes!==!1,peopleUrl:o}}const Oo=()=>({type:"toggleAppSettings",open:!0,section:"companion",phonePairing:!0});function Lo(e){const t=typeof window>"u"?void 0:window.ogb;return Rn({companion:!!t?.companion,remoteClient:t?.remoteClient?.active===!0,cloudHome:e})}function Rn(e){return e.cloudHome?"cloud":e.companion&&!e.remoteClient?"computer":"server"}const $n={computer:"sidebar.menu.connectPhone.computer",cloud:"sidebar.menu.connectPhone.cloud",server:"sidebar.menu.connectPhone.server"};function Ro(e,t){const n=t?.session?.kind==="session"?t.session.team?.name:void 0;return n?{target:e,subtitleKey:"sidebar.menu.connectPhone.team",team:n}:e!=="computer"&&!(t&&t.pairingCodes&&tt(t.session))?null:{target:e,subtitleKey:$n[e]}}function $o(e,t){if(!e)return[];const n={...e,id:"here"};return e.target,[n]}let We=null;function Ho(e=fetch){return We??=ne(e).then(async t=>{if(!tt(t))return{session:t,pairingCodes:!1};const n=await e("/api/config",{credentials:"same-origin"}).then(o=>o.ok?o.json():null).catch(()=>null);return{session:t,pairingCodes:Ln(n).pairingCodes}}),We}const Hn="data-phone-pairing-action";function Mo(e,t=n=>window.requestAnimationFrame(n)){return e?(t(()=>{e.scrollIntoView?.({block:"start"}),(e.querySelector(`[${Hn}]:not([disabled])`)??e).focus({preventScroll:!0})}),!0):!1}function Do(e){const t=new URL(e);return t.searchParams.get("desktop-settings")!=="phone"?null:(t.searchParams.delete("desktop-settings"),`${t.pathname}${t.search}${t.hash}`)}function le(e){const t=new URLSearchParams(e);if(t.get("desktop-settings")==="phone")return"/?desktop-settings=phone";const n=t.get("next");return n&&/^\/(?!\/)/.test(n)&&!n.startsWith("/pair")&&!/[\\\s]/.test(n)?n:"/"}const Mn="23456789ABCDEFGHJKLMNPQRSTUVWXYZ",Dn=12,zn="omb_pair_",Bn=/^omb_pair_[A-Za-z0-9_-]{43}$/;function xt(e){return e.toUpperCase().replace(/[^A-Z0-9]/g,"").replace(/0/g,"O").replace(/1/g,"I")}function Fn(e){return xt(e).match(/.{1,4}/g)?.join("-")??e}const Un={emailCode:"serverError.pair.emailCode",oldCode:"serverError.pair.oldCode",scriptKey:"serverError.pair.scriptKey",notACode:"serverError.pair.notACode"};function Wn(e){let t;try{t=new URL(e)}catch{return null}const n=new URLSearchParams(t.hash.replace(/^#/,""));return t.searchParams.get("token")??t.searchParams.get("code")??n.get("code")}function Ne(e){let t=e.trim();if(!t)return{kind:"empty"};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)){const a=Wn(t);if(!a)return{kind:"wrong",problem:"notACode"};t=a.trim()}if(t.startsWith("omb_sess_"))return{kind:"wrong",problem:"scriptKey"};if(t.startsWith(zn))return Bn.test(t)?{kind:"credential",credential:t}:{kind:"wrong",problem:"notACode"};const n=t.replace(/[\s-]/g,"");if(/^\d{8}$/.test(n))return{kind:"wrong",problem:"emailCode"};if(/^\d{6}$/.test(n))return{kind:"wrong",problem:"oldCode"};const o=xt(t);return o.length!==Dn||[...o].some(a=>!Mn.includes(a))?{kind:"wrong",problem:"notACode"}:{kind:"code",code:o}}const z="mt-1 w-full rounded-md border border-hairline/40 bg-inset px-3 py-2 text-[14px] text-ink outline-none focus:border-accent-border",Ke="mt-5 w-full rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink disabled:opacity-50",B="mt-4 block text-[12px] font-medium text-ink-secondary";function Kn(e,t=typeof window<"u"&&!!window.ogb?.workspaces){return!!e&&t}function Vn({mode:e,sent:t,email:n,cloudHome:o}){return e==="email"?t?s("pair.intro.emailSent",{email:n}):s("pair.intro.email"):o?s("pair.intro.cloud",{app:H(),open:s("cloudHome.connect"),section:s("settings.section.cloudAccount")}):s("pair.intro.code")}function Xn(e){const t=Ne(e);return t.kind==="wrong"&&t.problem!=="notACode"?s(Un[t.problem]):null}function Gn(e){const t=Ne(e).kind;return t==="code"||t==="credential"}function Yn(e,t){const n=Ne(t),o=n.kind==="code"?`&code=${encodeURIComponent(Fn(n.code))}`:"";return`openmausbot://pair?address=${encodeURIComponent(e)}${o}`}function qn(e){return e.protocol==="http:"&&!Lt(e.hostname)}function Ve(e,t=Xt()){if(!e?.capabilities.cloudTeam||typeof t!="string")return null;try{const n=new URL(t),o=n.protocol==="http:"&&["127.0.0.1","localhost","[::1]"].includes(n.hostname);return(n.protocol==="https:"||o)&&!n.username&&!n.password&&!n.hash?n.href:null}catch{return null}}function Jn(e,t){return e?.capabilities.cloudTeam?e.label:e?.capabilities.cloudHome?s("pair.myCloud"):s(t==="email"?"pair.signInTo":"pair.connectTo",{name:e?.label??s("pair.thisOpenMausBot",{app:H()})})}function Zn({team:e}){return r.jsx("main",{"data-team-left":!0,className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:r.jsx("p",{role:"status",className:"max-w-[420px] text-[16px]",children:s("homeLine.left",{name:e??s("pair.thisOpenMausBot",{app:H()})})})})}function X({initialCode:e,initialEmail:t=null,reason:n}){const[o,a]=u.useState(e??""),[i,c]=u.useState(nt()),[l,x]=u.useState(null),[f,w]=u.useState(null),[m,g]=u.useState(!1),[y,p]=u.useState(null),[k,T]=u.useState(()=>Z()),[E,O]=u.useState(t&&!e?"email":"code"),[S,M]=u.useState(t??""),[_,L]=u.useState(""),[b,j]=u.useState(!1),[oe,gt]=u.useState(()=>Kn(e));u.useEffect(()=>{if(!oe||!e)return;let h=!0;return ue({code:e,label:i,attemptId:k}).then(C=>{if(h){if(C.ok){location.replace(le(location.search));return}gt(!1),p(C.error)}}),()=>{h=!1}},[]),u.useEffect(()=>{fetch("/.well-known/openmausbot/environment").then(h=>h.ok?h.json():null).then(h=>{x(h)}).catch(()=>{x(null)}),ne().then(w)},[]);const re=Gt(f),yt=l?.capabilities.emailSignIn===!0,D=l?.capabilities.cloudHome===!0,kt=!D&&l?.capabilities.cloudTeam!==!0,Ce=Xn(o),W=typeof location<"u"&&typeof location.protocol=="string"?location:null;async function wt(h){h.preventDefault(),g(!0),p(null);const C=await ue({code:o,label:i,attemptId:k});if(g(!1),C.ok){location.replace(le(location.search));return}p(C.error)}async function vt(h){h.preventDefault(),g(!0),p(null);const C=b?await tn({email:S,code:_,label:i}):await en(S);if(g(!1),!C.ok){p(C.error);return}if(b){location.replace(le(location.search));return}j(!0)}function Pe(h){O(h),p(null)}return r.jsxs("main",{className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:[r.jsx("div",{className:"absolute left-3 top-12 max-w-[280px]",children:r.jsx(An,{})}),r.jsxs("div",{className:"w-full max-w-[420px]",children:[W&&qn(W)?r.jsx("p",{role:"alert",className:"mb-4 rounded-md border border-warning/30 bg-warning/10 px-3 py-2 text-[13px] text-warning",children:s("pair.notEncrypted")}):null,oe?r.jsx("p",{role:"status",className:"text-[20px] font-semibold",children:D?s("pair.openingCloud"):s("pair.connectingTo",{name:l?.label??s("pair.thisOpenMausBot")})}):r.jsxs(r.Fragment,{children:[r.jsx("h1",{className:"text-[20px] font-semibold",children:Jn(l,E)}),r.jsxs("p",{className:"mt-1.5 text-[14px] leading-relaxed text-ink-secondary",children:[l&&!D?`${s("pair.version",{version:l.version,platform:l.platform})} `:"",Vn({mode:E,sent:b,email:S,cloudHome:D})]}),Le(n)&&!re?r.jsx("p",{className:"mt-3 text-[13px] text-ink-secondary",children:Le(n)}):null,y&&D&&e?r.jsx("p",{className:"mt-3 text-[13px] text-ink-secondary",children:s("pair.expired",{app:H(),open:s("cloudHome.connect"),section:s("settings.section.cloudAccount")})}):null,!re&&Ve(l)?r.jsxs("div",{"data-team-sign-in":!0,className:"mt-4 flex flex-col items-start gap-1.5",children:[r.jsx("a",{href:Ve(l),className:"rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink",children:s("pair.team.open",{team:l.label})}),r.jsx("p",{className:"text-[13px] text-ink-secondary",children:s("pair.team.openHint")})]}):null]}),oe?null:re?r.jsxs("p",{className:"mt-4 text-[14px]",children:[s("pair.alreadyConnected")," ",r.jsx("a",{href:"/",className:"text-accent underline",children:s("pair.openApp")})]}):E==="email"?r.jsxs("form",{onSubmit:vt,children:[r.jsx("label",{className:B,htmlFor:"signin-email",children:s("cloudBuy.signIn.email")}),r.jsx("input",{id:"signin-email",type:"email",value:S,onChange:h=>{M(h.target.value),j(!1),L("")},autoComplete:"email",inputMode:"email",spellCheck:!1,className:z}),b?r.jsxs(r.Fragment,{children:[r.jsx("label",{className:B,htmlFor:"signin-code",children:s("pair.emailCode")}),r.jsx("input",{id:"signin-code",value:_,onChange:h=>L(h.target.value),placeholder:"12345678",autoComplete:"one-time-code",inputMode:"numeric",spellCheck:!1,className:`${z} font-mono text-[15px] tracking-[0.12em]`}),r.jsx("label",{className:B,htmlFor:"signin-label",children:s("pair.deviceLabel")}),r.jsx("input",{id:"signin-label",value:i,onChange:h=>c(h.target.value),maxLength:80,className:z})]}):null,y?r.jsx("p",{className:"mt-3 text-[13px] text-danger",children:y}):null,r.jsx("button",{type:"submit",disabled:m||!S.includes("@")||b&&_.replace(/\D/g,"").length<8,className:Ke,children:s(m?b?"pair.signingIn":"pair.sending":b?"pair.signIn":"cloudBuy.signIn.send")}),b?r.jsx("button",{type:"button",onClick:()=>j(!1),className:"mt-3 w-full text-[13px] text-ink-secondary underline",children:s("pair.resend")}):null,r.jsx("button",{type:"button",onClick:()=>Pe("code"),className:"mt-3 w-full text-[13px] text-ink-secondary underline",children:s("pair.useCode")})]}):r.jsxs("form",{onSubmit:wt,children:[r.jsx("label",{className:B,htmlFor:"pair-code",children:s("pair.code")}),r.jsx("input",{id:"pair-code",value:o,onChange:h=>{a(h.target.value),T(Z())},placeholder:"XXXX-XXXX-XXXX","aria-describedby":e&&o===e?"pair-code-from-link":void 0,autoComplete:"one-time-code",autoCapitalize:"characters",spellCheck:!1,className:`${z} font-mono text-[15px] tracking-[0.12em]`}),e&&o===e?r.jsx("p",{id:"pair-code-from-link",className:"mt-1 text-[12px] text-ink-secondary",children:s("pair.fromLink")}):null,r.jsx("label",{className:B,htmlFor:"pair-label",children:s("pair.deviceLabel")}),r.jsx("input",{id:"pair-label",value:i,onChange:h=>c(h.target.value),maxLength:80,className:z}),Ce?r.jsx("p",{role:"alert",className:"mt-3 text-[13px] text-danger",children:Ce}):y?r.jsx("p",{className:"mt-3 text-[13px] text-danger",children:y}):null,r.jsx("button",{type:"submit",disabled:m||!Gn(o),className:Ke,children:s(m?"pair.connecting":"pair.connect")}),W?.origin?r.jsxs("p",{className:"mt-3 text-[13px] text-ink-secondary",children:[s("pair.onPhone")," ",r.jsx("a",{href:Yn(W.origin,o),className:"text-accent underline",children:s("pair.openInApp",{app:H()})})]}):null,kt?r.jsxs("p",{className:"mt-3 text-[13px] text-ink-secondary",children:[s("pair.noCode")," ",r.jsx("code",{className:"select-all rounded bg-inset px-1.5 py-0.5 text-[12px] text-ink",children:"npx limixbot pair"})]}):null,yt?r.jsxs("p",{className:"mt-5 border-t border-hairline/40 pt-4 text-[13px] text-ink-secondary",children:[s("pair.invitedByEmail")," ",r.jsx("button",{type:"button",onClick:()=>Pe("email"),className:"text-accent underline",children:s("pair.useEmail")})]}):null]})]})]})}const zo="cloud-welcome-done",Qn="unauthorized: you are no longer in this team",Xe=[["reserving","cloudHome.step.reserving"],["storage","cloudHome.step.storage"],["starting","cloudHome.step.starting"],["checking","cloudHome.step.checking"]];function eo({step:e}){const t=Xe.findIndex(([n])=>n===e);return r.jsx("ol",{"data-cloud-setup":e,className:"flex flex-col gap-1 text-[13px]",children:Xe.map(([n,o],a)=>r.jsx("li",{"aria-current":a===t?"step":void 0,className:a===t?"font-medium text-ink":a<t?"text-ink-secondary line-through decoration-ink-secondary/40":"text-ink-secondary",children:s(o)},n))})}const to={stopped:"cloudHome.stopped","payment-problem":"cloudHome.paymentProblem",failed:"cloudHome.failed"},Ge={host:"cloudHome.unreachableHost",no_answer:"cloudHome.unreachable"};function no(e,t=Date.now()){const n=new Date(e).getFullYear()!==new Date(t).getFullYear();return new Intl.DateTimeFormat(Rt(),{day:"numeric",month:"long",...n?{year:"numeric"}:{}}).format(new Date(e))}function oo(e,t=Date.now()){const n=e?.name??null,o=(a,i)=>n?s(i,{name:n}):s(a);return e?.screen==="setup"?{title:o("homeScreen.setup","homeScreen.setupNamed"),body:s(e.slow?"cloudHome.slow":"homeScreen.setupBody"),reason:null,action:null,busy:!0}:e?.screen==="offline"?{title:o("homeScreen.offline","homeScreen.offlineNamed"),body:s("homeScreen.offlineBack"),reason:e.cause&&Object.hasOwn(Ge,e.cause)?s(Ge[e.cause]):e.reason??null,action:"retry",busy:!1}:e?.screen==="signin"?{title:o("homeScreen.signIn","homeScreen.signInNamed"),body:s(e.other?"homeScreen.signInOther":"homeScreen.signInEnded"),reason:null,action:"sign-in",busy:!1}:e?.screen==="plan"&&e.member&&e.machine!=="failed"?{title:o("homeScreen.plan","homeScreen.planNamed"),body:s("cloudHome.stoppedMember"),reason:null,action:null,busy:!1}:e?.screen==="plan"?{title:o("homeScreen.plan","homeScreen.planNamed"),body:s(to[e.machine]??"cloudHome.failed"),reason:null,action:e.machine==="failed"?null:"manage",busy:!1}:e?.screen==="ended"?{title:o("cloudHome.ended","cloudHome.endedNamed"),body:e.deleteAt?s("cloudHome.endedFiles",{date:no(e.deleteAt,t)}):null,reason:null,action:"buy",busy:!1}:e?.screen==="checkout"?{title:o("cloudHome.checkout","cloudHome.checkoutNamed"),body:null,reason:null,action:"continue",busy:!1}:e?.screen==="payment"?{title:o("cloudHome.payment","cloudHome.paymentNamed"),body:s("cloudHome.paymentBody"),reason:null,action:"card",busy:!1}:e?.screen==="waking"?{title:s("homeScreen.waking"),body:null,reason:null,action:null,busy:!0}:e?.screen==="moving"?{title:o("homeScreen.moving","homeScreen.movingNamed"),body:null,reason:null,action:null,busy:!0}:{title:o("homeScreen.opening","homeScreen.openingNamed"),body:null,reason:null,action:null,busy:!0}}const ro={retry:"cloudHome.tryAgain",buy:"cloudHome.buyAgain",continue:"cloudHome.continue",card:"cloudHome.updateCard"};function ao({name:e,remove:t}){const[n,o]=u.useState(!1),[a,i]=u.useState(!1),[c,l]=u.useState(null),x=()=>{i(!0),l(null),t().then(f=>{i(!1),f!=="removed"&&f!=="gone"&&(o(!1),l(f==="refused"?"refused":"failed"))},()=>{i(!1),o(!1),l("failed")})};return r.jsxs("div",{"data-home-remove":!0,className:"flex flex-col items-start gap-2",children:[n?r.jsxs("div",{role:"alertdialog","aria-label":s("rail.remove"),className:"flex flex-col gap-2 rounded-xl border border-hairline/70 bg-card/70 px-4 py-3",children:[r.jsx("p",{className:"text-[13px] leading-relaxed text-ink",children:s("rail.removeAsk",{name:e})}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button","data-home-remove-confirm":!0,className:"ui-button ui-button-primary",disabled:a,onClick:x,children:s("rail.removeYes")}),r.jsx("button",{type:"button",className:"ui-button",disabled:a,onClick:()=>o(!1),children:s("rail.removeNo")})]})]}):r.jsx("button",{type:"button","data-home-remove-ask":!0,className:"text-[13px] text-ink-secondary underline-offset-2 hover:text-ink hover:underline",onClick:()=>{l(null),o(!0)},children:s("rail.remove")}),c&&r.jsx("p",{role:"alert",className:"text-[13px] text-danger",children:s(c==="refused"?"rail.removeRefused":"rail.removeFailed")})]})}function so({bridge:e,manage:t}){const[n,o]=u.useState(null),[a,i]=u.useState(!1);u.useEffect(()=>{let g=!0;const y=e.onState(k=>o(k)),p=()=>{e.retry().then(k=>{g&&o(k)}).catch(()=>{})};return e.state().then(k=>{g&&o(k)}).catch(()=>{}).then(p),window.addEventListener("online",p),window.addEventListener("focus",p),()=>{g=!1,y(),window.removeEventListener("online",p),window.removeEventListener("focus",p)}},[e]);const c=oo(n),l=g=>{i(!1),g().catch(()=>i(!0))},x=window.ogb?.cloudAdd?.reopen,f={retry:()=>e.retry().then(g=>o(g)),...t?{manage:t,buy:t,card:t,continue:async()=>{x&&await x().catch(()=>!1)||await t()}}:{}},w=c.action&&c.action!=="sign-in"&&c.action!=="manage"?c.action:null,m=(n?.screen==="ended"||n?.screen==="payment")&&n.removable===!0&&typeof e.remove=="function";return r.jsx("main",{"data-home-screen":n?.screen??"opening",className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",style:{WebkitAppRegion:"drag"},children:r.jsxs("div",{className:"flex w-full max-w-[420px] flex-col items-start gap-3",style:{WebkitAppRegion:"no-drag"},children:[r.jsxs("p",{role:"status",className:"flex items-center gap-2 text-[20px] font-semibold",children:[c.busy&&r.jsx("span",{"aria-hidden":"true",className:"size-3.5 shrink-0 animate-spin rounded-full border-2 border-hairline border-t-accent"}),c.title]}),c.body&&r.jsx("p",{className:"text-[14px] leading-relaxed text-ink-secondary",children:c.body}),n?.screen==="setup"&&r.jsx(eo,{step:n.step??"reserving"}),c.reason&&r.jsx("p",{"data-home-reason":!0,className:"text-[13px] leading-relaxed text-ink-secondary",children:c.reason}),c.action==="sign-in"&&r.jsx("button",{type:"button",className:"ui-button ui-button-primary mt-2",onClick:()=>l(()=>e.signIn()),children:s("homeScreen.signInButton")}),c.action==="manage"&&t&&r.jsx("button",{type:"button",className:"ui-button mt-2",onClick:()=>l(t),children:s("cloudAccount.manageInBrowser")}),w&&f[w]&&r.jsx("button",{type:"button","data-home-action":w,className:w==="retry"?"ui-button mt-2":"ui-button ui-button-primary mt-2",onClick:()=>l(f[w]),children:s(ro[w])}),m&&r.jsx(ao,{name:n.name??s("cloudSetup.myCloud"),remove:()=>e.remove()}),a&&r.jsx("p",{role:"alert",className:"text-[13px] text-danger",children:s("cloudAccount.actionFailed")})]})})}function io({bridge:e,fallback:t}){const[n,o]=u.useState(!1);return u.useEffect(()=>{e.repair().catch(()=>o(!0))},[e]),n?r.jsx(r.Fragment,{children:t}):r.jsx("main",{"data-home-screen":"opening",className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:r.jsx("p",{role:"status",className:"w-full max-w-[420px] text-[20px] font-semibold",children:s("homeScreen.opening")})})}const Ee="omb.session-ended";let he=!1,ce=null;const xe=new Set;function Bo(){he||ce||(ce=ne().then(e=>{if(e.kind==="unauthenticated"){he=!0;try{sessionStorage.setItem(Ee,"1")}catch{}for(const t of xe)t()}}).finally(()=>{ce=null}))}function Ye(){return he}function Fo(){return u.useSyncExternalStore(e=>(xe.add(e),()=>xe.delete(e)),Ye,Ye)}function lo(){try{return sessionStorage.getItem(Ee)==="1"}catch{return!1}}function co(){try{sessionStorage.removeItem(Ee)}catch{}}$t();ge(Ht());Mt(Dt());nn();zt(Bt());wn();const J=Ft(),uo=new Set(["/home","/pair","/desktop-viewer"]),bt=()=>Qe(()=>import("./App-DmZz5o3J.js").then(e=>e.jV),__vite__mapDeps([0,1,2,3,4,5])).catch(e=>({default:()=>{throw e}})),mo=uo.has(location.pathname)?null:bt(),po=()=>fetch("/.well-known/openmausbot/environment").then(e=>e.json()).then(e=>e.capabilities?.cloudTeam===!0&&typeof e.label=="string"?e.label:null,()=>null);async function fo(){const e=window.ogb?.home;if(location.pathname==="/home"&&e)return r.jsx(so,{bridge:e,manage:window.ogb?.cloudPlan?.manage});if(location.pathname==="/pair"){const o=qt();if(o){const a=await Zt(o);return await J,a?r.jsx(vn,{credential:o,owner:a.owner,team:a.team}):r.jsx(X,{initialCode:null,reason:s("pair.browser.signInFailed")})}return r.jsx(X,{initialCode:Yt(),initialEmail:Jt()})}const t=await ne();if(t.kind==="unauthenticated"){if(await J,t.error===Qn)return r.jsx(Zn,{team:await po()});const o=r.jsx(X,{initialCode:null,reason:lo()?s("pair.sessionEnded"):t.error});return e?r.jsx(io,{bridge:e,fallback:o}):o}if(co(),t.kind==="session"&&Vt(t.teamSignIn),t.kind==="loopback"&&t.trust==="service")return await J,r.jsx(X,{initialCode:null,reason:s("pair.serviceTrust")});if(location.pathname==="/desktop-viewer"){const{DesktopViewer:o}=await Qe(async()=>{const{DesktopViewer:a}=await import("./DesktopViewer-CCRdZbJF.js");return{DesktopViewer:a}},__vite__mapDeps([6,1,2,7,8,5,4,9]));return r.jsx(o,{})}const{default:n}=await(mo??bt());return we(),r.jsx(n,{})}document.title=H();Promise.all([Ut(),fo(),J]).then(([,e])=>{Wt.createRoot(document.getElementById("root")).render(r.jsx(u.StrictMode,{children:r.jsx(Kt,{children:e})}))});export{Po as A,bo as B,eo as C,Co as D,No as E,En as F,An as G,To as H,_o as I,Sn as J,de as K,Eo as L,zo as M,Fo as N,X as O,Io as P,Do as Q,Nn as S,at as T,Ln as a,Mo as b,xn as c,yn as d,jo as e,So as f,Lo as g,vo as h,tt as i,jn as j,Se as k,we as l,$o as m,Bo as n,Pn as o,Oo as p,xo as q,ne as r,wo as s,go as t,yo as u,Ho as v,ko as w,Ro as x,_n as y,Ao as z};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/App-CNqHO0Df.js","assets/styles-DmZQm0by.js","assets/styles-Ce5Qc_2r.css","assets/PlacesRail-BGrgyyPN.js","assets/monitor-DMjY_pXA.js","assets/MenuMotion-BPNzITQk.js","assets/DesktopViewer-8VFpsBvQ.js","assets/desktop-connection-Dfaq6k5a.js","assets/desktop-viewer-CF-OpSo0.js","assets/minimize-DSd0Havw.js"])))=>i.map(i=>d[i]);
2
+ import{t as s,ar as St,s as I,as as jt,h as qe,o as be,at as Je,N as Nt,I as Et,r as u,au as Ct,y as ge,av as Ie,w as Te,aw as _e,ax as Pt,ay as It,j as r,S as Ze,X as Tt,a as $,az as _t,aA as At,l as K,L as Ot,a8 as ae,R as se,ae as Ae,p as H,aB as Lt,b as Rt,x as $t,z as Ht,A as Mt,B as Dt,aC as zt,aD as Bt,E as Ft,D as Ut,F as Wt,P as Kt,_ as Qe}from"./styles-DmZQm0by.js";function xo(e,t){if(!t)return;if(t.kind!=="session")return t.kind==="loopback"?e:void 0;if(t.team||t.scopes.includes("admin"))return e;const n=t.email;if(n?.trim())return e?.email?.trim().toLowerCase()===n.trim().toLowerCase()?e:{email:n}}const et="omb.team-sign-in";function Vt(e){try{e&&globalThis.localStorage?.setItem(et,e)}catch{}}function Xt(){try{return globalThis.localStorage?.getItem(et)??null}catch{return null}}async function ne(e=fetch){let t;try{t=await e("/api/auth/session",{credentials:"same-origin"})}catch(a){return{kind:"unreachable",error:a instanceof Error?a.message:String(a)}}const n=await t.json().catch(()=>({})),o=Object(n);return t.status===401||t.status===403?{kind:"unauthenticated",error:typeof o.error=="string"?o.error:`${t.status}`}:t.ok?o.kind==="session"&&typeof o.id=="string"?{kind:"session",id:o.id,label:typeof o.label=="string"?o.label:"",...typeof o.email=="string"?{email:o.email}:{},scopes:Array.isArray(o.scopes)?o.scopes.filter(a=>typeof a=="string"):[],expiresAt:typeof o.expiresAt=="number"?o.expiresAt:0,...typeof o.reactor=="string"?{reactor:o.reactor}:{},...typeof o.teamSignIn=="string"?{teamSignIn:o.teamSignIn}:{},...Oe(o.team)?{team:Oe(o.team),openedThreads:Array.isArray(o.openedThreads)?o.openedThreads.filter(a=>typeof a=="string"):[]}:{},...o.cloudGuest===!0?{cloudGuest:!0,openedThreads:Array.isArray(o.openedThreads)?o.openedThreads.filter(a=>typeof a=="string"):[]}:{}}:o.trust==="service"?{kind:"loopback",trust:"service"}:{kind:"loopback"}:{kind:"unreachable",error:`${t.status} ${t.statusText}`}}function Oe(e){const t=Object(e);return typeof t.id=="string"&&typeof t.name=="string"&&typeof t.role=="string"?{id:t.id,name:t.name,role:t.role}:null}function Gt(e){return e?.kind==="session"||e?.kind==="loopback"&&e.trust!=="service"}function tt(e){return e?e.kind==="loopback"?e.trust!=="service":e.kind==="session"&&e.scopes.includes("admin"):!1}function Yt(){const e=/[#&]code=([^&]+)/.exec(location.hash);return e?(history.replaceState(null,"",location.pathname+location.search),decodeURIComponent(e[1])):null}function qt(){if(!/[#&]signin=/.test(location.hash))return null;const e=/[#&]signin=(omb_pair_[A-Za-z0-9_-]{43})(?:&|$)/.exec(location.hash);return history.replaceState(null,"",location.pathname+location.search),e?e[1]:null}function Jt(){const e=new URLSearchParams(location.search),t=e.get("email")?.trim().toLowerCase()??"";if(!t)return null;e.delete("email");const n=e.toString();return history.replaceState(null,"",location.pathname+(n?`?${n}`:"")+location.hash),/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(t)?t:null}function nt(e=navigator.userAgent){const t=/Edg\//.test(e)?"Edge":/OPR\//.test(e)?"Opera":/Chrome\//.test(e)?"Chrome":/Firefox\//.test(e)?"Firefox":/Safari\//.test(e)?"Safari":"Browser",n=/iPhone/.test(e)?"iPhone":/iPad/.test(e)?"iPad":/Android/.test(e)?"Android":/Mac OS X/.test(e)?"Mac":/Windows/.test(e)?"Windows":/Linux/.test(e)?"Linux":"";return n?`${t} on ${n}`:t}function Z(){return typeof crypto?.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,14)}`}function ot(e,t){const n=Reflect.get(Object(e),"error");return St(e,typeof n=="string"?n:`${t.status} ${t.statusText}`)}async function ue(e,t=fetch){let n;try{n=await t("/api/auth/pair",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({code:e.code,label:e.label,cookie:!0,attemptId:e.attemptId??Z(),...e.browser?{browser:!0}:{}})})}catch(a){return{ok:!1,error:s("pair.unreachable",{error:a instanceof Error?a.message:String(a)})}}const o=await n.json().catch(()=>({}));return n.ok?{ok:!0}:{ok:!1,error:ot(o,n)}}async function Zt(e,t=fetch){try{const n=await t("/api/auth/pair",{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({code:e,browser:!0,preview:!0})}),o=Object(await n.json().catch(()=>({}))),a=Reflect.get(o,"owner"),i=Reflect.get(o,"team");return n.ok&&typeof a=="string"&&a?{owner:a,...typeof i=="string"&&i.trim()?{team:i.trim()}:{}}:null}catch{return null}}function Qt(e,t,n=fetch){return ue({code:e,label:nt(),attemptId:t,browser:!0},n)}function bo(e){const t=Object(e);return t.cloudHome===!0&&typeof t.owner=="string"&&t.owner?t.owner:null}async function rt(e,t,n){let o;try{o=await n(e,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}catch(i){return{ok:!1,error:s("pair.unreachable",{error:i instanceof Error?i.message:String(i)})}}const a=await o.json().catch(()=>({}));return o.ok?{ok:!0}:{ok:!1,error:ot(a,o)}}function en(e,t=fetch){return rt("/api/auth/email/start",{email:e},t)}function tn(e,t=fetch){return rt("/api/auth/email/verify",{email:e.email,code:e.code,label:e.label},t)}function Le(e){return!e||/through a proxy|loopback host required|cross-origin request|^40[13]$/i.test(e)?null:e}function nn(){window.ogb?.softwareRendering===!0&&(document.documentElement.dataset.softwareRendering="")}const on="/api/theme-assets/",rn="safe-look",at={cssChars:1e5,assetBytes:10*1024*1024},an=/^[a-z0-9][a-z0-9-]{0,47}$/,sn=/^[a-z0-9][a-z0-9_-]{0,79}\.(png|jpe?g|webp|gif|avif|svg|woff2?|ttf|otf)$/,ln=/^\/api\/theme-assets\/[a-z0-9][a-z0-9-]{0,47}\/[a-z0-9][a-z0-9_-]{0,79}\.[a-z0-9]{2,5}$/,st=["app","panel","frame","raised","raised-hover","card","inset","control","composer","composer-ring","menu","menu-hover","menu-active","hairline","edge","scrollbar","ink","ink-secondary","ink-tertiary","accent","accent-border","accent-text","accent-ink","focus","bubble-user","bubble-user-ink","success","success-ink","danger","danger-ink","warning"],Q=I().trim().regex(/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,"a hex colour such as #1a2b3c"),cn=I().trim().min(1).max(120).regex(/^[#a-z0-9(),.%\s/+-]+$/i,"a CSS colour such as #1a2b3c, rgb(…) or color-mix(…)").refine(e=>!/url|image|src|attr/i.test(e),"a colour, not a file"),it=jt(qe(st),cn),Re=be({canvas:Q.optional(),accent:Q.optional(),colors:it.optional()}).strict(),ye=be({name:I().trim().min(1).max(60),skin:qe([...Je,"system"]).optional(),canvas:Q.optional(),accent:Q.optional(),colors:it.optional(),light:Re.optional(),dark:Re.optional(),font:I().trim().max(300).regex(/^[\w\s"',.-]*$/,'a font-family list such as "Inter Variable", serif').optional(),css:I().max(at.cssChars).optional()}).strict(),un=1;be({mausbotTheme:Et(un),id:I().regex(an).optional(),theme:ye,assets:Nt(I().regex(sn),I().max(Math.ceil(at.assetBytes*1.4)).regex(/^data:[\w/+.-]+;base64,[A-Za-z0-9+/=]+$/)).optional()}).strict();function lt(e){return/^data:/i.test(e)||e.startsWith("#")||ln.test(e)&&!e.includes("..")}function ct(e){const t=e.toLowerCase(),n=[];for(let o=t.indexOf("url(");o!==-1;o=t.indexOf("url(",o+4)){let a=o+4;for(;/\s/.test(e[a]??"");)a++;const i=e[a];let c;if(i==='"'||i==="'"){const l=e.indexOf(i,a+1);if(l===-1)return null;for(c=e.slice(a+1,l),a=l+1;/\s/.test(e[a]??"");)a++;if(e[a]!==")")return null}else{const l=e.indexOf(")",a);if(l===-1||(c=e.slice(a,l).trim(),/[\s"'(]/.test(c)))return null}n.push(c.trim())}return n}const ut=/image-set\(|\bimage\(|\bsrc\(/i;function dt(e){if(e.includes("\\")||ut.test(e))return!0;const t=ct(e);return t===null||t.some(n=>!lt(n))}function dn(e){let t="";for(let n=0;n<e.length;n++){const o=e[n];if(o==="/"&&e[n+1]==="*"){const a=e.indexOf("*/",n+2);n=a===-1?e.length:a+1,t+=" "}else if(o==='"'||o==="'"){let a=n+1;for(;a<e.length&&e[a]!==o&&e[a]!==`
3
+ `;)a+=e[a]==="\\"?2:1;t+=`${o}${" ".repeat(Math.max(0,a-n-1))}${o}`,n=a}else t+=o}return t}function go(e){const t=dn(e);if(/@import/i.test(t))return"@import is not allowed: themes cannot load other stylesheets.";if(t.includes("\\"))return"Backslash escapes are only allowed inside quoted strings.";if(ut.test(t))return"image-set(), image() and src() are not allowed: use url() with a theme file or a data: address.";const n=e.replace(/\/\*[\s\S]*?\*\//g," "),o=ct(n);if(o===null)return'A url() could not be read. Write url("/api/theme-assets/<theme>/<file>").';const a=o.find(i=>!lt(i));return a!==void 0?`url(${a.slice(0,80)}) is not allowed: themes load only their own files (${on}<theme>/<file>), data: addresses or #ids, never the internet.`:null}function de(e=typeof document>"u"?null:document.documentElement){if(!e||typeof window>"u"||typeof window.getComputedStyle!="function")return"dark";try{return window.getComputedStyle(e).getPropertyValue("--code-color-scheme").trim()==="light"?"light":"dark"}catch{return"dark"}}function yo(){const[e,t]=u.useState(()=>de());return u.useEffect(()=>{const n=()=>t(de());if(n(),typeof MutationObserver>"u")return;const o=new MutationObserver(n);return o.observe(document.documentElement,{attributes:!0,attributeFilter:["data-skin"]}),()=>o.disconnect()},[]),e}const N=[255,255,255],P=[0,0,0];function ee(e){const t=e.trim().replace(/^#/,""),n=t.length===3?[...t].map(a=>a+a).join(""):t,o=Number.parseInt(n.slice(0,6),16);return Number.isFinite(o)?[o>>16&255,o>>8&255,o&255]:P}const V=e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,"0"),d=([e,t,n],o)=>`#${V(e)}${V(t)}${V(n)}${o===void 0?"":V(o*255)}`,v=(e,t,n)=>[0,1,2].map(o=>e[o]+(t[o]-e[o])*n);function te([e,t,n]){const o=a=>{const i=a/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4};return .2126*o(e)+.7152*o(t)+.0722*o(n)}function me(e,t){const[n,o]=[te(e),te(t)].sort((a,i)=>i-a);return(n+.05)/(o+.05)}const $e=e=>te(ee(e))<.2?"dark":"light";function G(e,t,n){const o=te(t)<.2?N:P;let a=e;for(let i=1;i<=20&&me(a,t)<n;i++)a=v(e,o,i/20);return a}const mt=e=>me(N,e)>=me(P,e)?N:[17,17,17];function mn(e,t){const n=ee(e),o=t==="dark",a=f=>v(n,o?N:P,f),i=o?a(.08):v(n,N,.85),c=a(o?.14:.06),l=G(v(o?N:P,n,o?.04:.1),n,12),x=a(o?.22:.07);return{app:d(n),panel:d(o?v(n,P,.25):v(n,N,.45)),frame:d(o?v(n,P,.25):v(n,N,.45)),raised:d(i),"raised-hover":d(c),card:d(o?a(.07):i),inset:d(o?a(.04):n),control:d(a(o?.12:.07)),composer:d(o?a(.07):i),"composer-ring":d(a(o?.14:.12)),menu:d(i),"menu-hover":d(l,.06),"menu-active":d(l,.09),hairline:d(a(.2)),edge:d(l,.08),scrollbar:d(a(o?.25:.22)),ink:d(l),"ink-secondary":d(G(v(l,n,o?.3:.4),c,4.5)),"ink-tertiary":d(G(v(l,n,o?.42:.5),c,4.5)),"bubble-user":d(x),"bubble-user-ink":d(o?mt(x):l)}}function pn(e,t,n){const o=ee(e),a=G(o,ee(n),4.5);return{accent:d(o),"accent-ink":d(mt(o)),"accent-border":d(t==="dark"?v(o,N,.2):v(o,P,.1)),"accent-text":d(a),focus:d(a)}}class fn extends Error{}function Y(e,t){const n=globalThis[t];return typeof n=="function"&&e instanceof n}function He(e){const t=e.style;return t&&typeof t=="object"&&typeof t.getPropertyValue=="function"?t:null}function Me(e){for(let t=e.length-1;t>=0;t--){const n=e.item(t);dt(e.getPropertyValue(n))&&e.removeProperty(n)}}const hn=e=>"cssRules"in e&&typeof e.deleteRule=="function";function De(e,t,n){try{e.deleteRule(t)}catch{if(!Y(n,"CSSNamespaceRule"))throw new fn}}function pt(e){for(let t=e.cssRules.length-1;t>=0;t--){const n=e.cssRules[t];if(!n)continue;if(Y(n,"CSSKeyframesRule")){for(const a of Array.from(n.cssRules)){const i=He(a);i&&Me(i)}continue}if(Y(n,"CSSPropertyRule")){dt(n.initialValue??"")&&De(e,t,n);continue}const o=He(n);o&&Me(o),hn(n)?pt(n):!o&&!Y(n,"CSSLayerStatementRule")&&De(e,t,n)}}let R=null,ze="";function Be(e){if(!(typeof document>"u"||typeof CSSStyleSheet>"u"||!("adoptedStyleSheets"in document))&&e!==ze){ze=e,R||(R=new CSSStyleSheet,document.adoptedStyleSheets=[...document.adoptedStyleSheets,R]);try{R.replaceSync(e),pt(R)}catch{R.replaceSync("")}}}const pe="omb-theme",Fe="omb-safe-look";let A=null,F=[],ie=!1;const fe=new Set;function U(e){try{return typeof window>"u"?void 0:window[e]}catch{return}}function xn(){try{return typeof location<"u"&&new URLSearchParams(location.search).has(rn)&&U("sessionStorage")?.setItem(Fe,"1"),U("sessionStorage")?.getItem(Fe)==="1"}catch{return!1}}function ko(){return A}function wo(e){return fe.add(e),()=>{fe.delete(e)}}function bn(e){for(const t of F)e.style.removeProperty(t);F=[]}function q(){if(!(typeof document>"u"||ie)){ie=!0;try{const e=document.documentElement;bn(e);const t=xn()?null:A?.theme;if(!t){delete e.dataset.theme,Be(""),Te(_e());return}const n=t.skin??(t.canvas?Pt[$e(t.canvas)]:void 0);Te(n?It(n):_e());const o=de(e),a=t[o],i=a?.canvas??(t.canvas&&$e(t.canvas)===o?t.canvas:void 0),c=a?.accent??t.accent,l={...i?mn(i,o):{},...c?pn(c,o,i??(o==="dark"?"#121212":"#ffffff")):{},...t.colors,...a?.colors};for(const x of st){const f=l[x];f&&(e.style.setProperty(`--color-${x}`,f),F.push(`--color-${x}`))}i&&(e.style.setProperty("--code-color-scheme",o),F.push("--code-color-scheme")),t.font&&(e.style.setProperty("--font-sans",t.font),F.push("--font-sans")),e.dataset.theme=A.id,Be(t.css??"")}finally{ie=!1;for(const e of fe)e()}}}function ke(e){A=e;try{e?U("localStorage")?.setItem(pe,JSON.stringify(e)):U("localStorage")?.removeItem(pe)}catch{}q()}function gn(){try{const e=JSON.parse(U("localStorage")?.getItem(pe)??"null"),t=ye.safeParse(e?.theme);return typeof e?.id=="string"&&t.success?{id:e.id,theme:t.data}:null}catch{return null}}async function we(){try{const e=await fetch("/api/themes/active",{headers:{accept:"application/json"}});if(!e.ok)return;const t=await e.json(),n=t.theme?ye.safeParse(t.theme):null;ke(t.id&&n?.success?{id:t.id,theme:n.data}:null)}catch{}}function vo(e){const t=e.skin;(t==="system"||Je.includes(t))&&ge(t),we()}const ve=(e,t)=>fetch("/api/themes/active",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({id:e,...t?{skin:t}:{}})}).then(n=>n.ok,()=>!1);function So(){A&&(ke(null),ve(null))}async function jo(e){const t=await ve(e);return t&&await we(),t}function yn(){ge(Ie),ke(null),ve(null,Ie)}const kn=e=>e.code==="KeyR"&&e.altKey&&e.shiftKey&&(e.metaKey||e.ctrlKey);function wn(){if(!(typeof window>"u")){if(window.addEventListener("keydown",e=>{kn(e)&&(e.preventDefault(),e.stopPropagation(),yn())},{capture:!0}),Ct(q),typeof matchMedia=="function")try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",q)}catch{}A=gn(),A&&q()}}function vn({credential:e,owner:t,team:n}){const[o]=u.useState(()=>Z()),[a,i]=u.useState(!1),[c,l]=u.useState(null);async function x(){i(!0),l(null);const f=await Qt(e,o);if(f.ok){location.replace("/");return}i(!1),l(f.error)}return r.jsx("main",{className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:r.jsxs("div",{className:"w-full max-w-[420px]",children:[r.jsx("h1",{className:"text-[20px] font-semibold",children:n?s("pair.browser.teamTitle",{team:n,owner:t}):s("pair.browser.title",{owner:t})}),r.jsx("p",{className:"mt-1.5 text-[14px] text-ink-secondary",children:s("pair.browser.notYou")}),c?r.jsx("p",{role:"alert",className:"mt-3 text-[13px] text-danger",children:c}):null,r.jsx("button",{type:"button",onClick:()=>{x()},disabled:a,className:"mt-5 w-full rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink disabled:opacity-50",children:s(a?"pair.signingIn":"pair.continue")})]})})}const Se="bg-composer ring-1 ring-inset ring-ink/[0.07]",Sn="bg-composer ring-[0.5px] ring-ink/10",No=`${Sn} shadow-(--shadow-float)`,ft="transition-colors duration-[120ms] hover:bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]",jn=`${ft} aria-expanded:bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]`,Eo="bg-[color-mix(in_srgb,var(--color-composer),var(--color-ink)_7%)]",Co="focus-visible:outline-2 focus-visible:-outline-offset-2! focus-visible:outline-focus",ht="flex size-9 shrink-0 items-center justify-center rounded-full text-ink/90",je="focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",Nn=`${ht} ${Se} ${jn} ${je}`,Po=`${ht} ${Se} ${ft} ${je}`,En=`flex size-[26px] shrink-0 items-center justify-center rounded-lg text-ink-secondary transition-colors hover:bg-ink/[0.06] hover:text-ink aria-expanded:bg-ink/[0.06] aria-expanded:text-ink ${je}`,Io="flex size-10 shrink-0 items-center justify-center rounded-full border border-hairline bg-card text-ink hover:bg-raised focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",Cn="flex size-9 shrink-0 items-center justify-center rounded-xl text-ink-secondary hover:bg-raised/60 hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus";function To({open:e,onToggle:t,corner:n=!1,ref:o}){return r.jsx("button",{ref:o,type:"button","data-sidebar-search-toggle":!0,onClick:t,"aria-label":s("sidebar.searchAria"),"aria-expanded":e,title:s("sidebar.searchAria"),className:n?En:Nn,children:r.jsx(Ze,{size:n?17:18,strokeWidth:1.5,"aria-hidden":"true"})})}function _o({query:e,onQuery:t,onClose:n}){return r.jsx("div",{"data-sidebar-search-pill":!0,className:"px-3 pb-2 pt-0.5",children:r.jsxs("div",{className:$("flex h-[34px] items-center gap-2 rounded-full pl-3 pr-1.5 text-ink-secondary focus-within:ring-focus",Se),children:[r.jsx(Ze,{size:15,"aria-hidden":"true",className:"shrink-0"}),r.jsx("input",{autoFocus:!0,value:e,onChange:o=>t(o.target.value),onKeyDown:o=>{o.key==="Escape"&&(o.preventDefault(),n())},placeholder:s("sidebar.searchAria"),"aria-label":s("sidebar.searchAria"),className:"min-w-0 flex-1 bg-transparent text-[13px] text-ink placeholder:text-ink-tertiary focus:outline-none"}),r.jsx("button",{type:"button",onClick:n,"aria-label":s("sidebar.searchClose"),title:s("sidebar.searchClose"),className:"flex size-6 shrink-0 items-center justify-center rounded-full text-ink-tertiary hover:bg-raised hover:text-ink focus-visible:outline focus-visible:outline-2 focus-visible:outline-focus",children:r.jsx(Tt,{size:14,"aria-hidden":"true"})})]})})}function Pn(e,{howTo:t=!1,onClosed:n}={}){return e.menu(t?{from:"howto"}:void 0).finally(()=>{t&&n?.()})}function Ao(e){e({type:"cloudHowTo",open:!1})}function Ue({text:e}){return r.jsxs("span",{className:"font-normal text-ink-secondary",children:[" · ",e]})}function In(e){return e?.sleeps===!0?!0:e?.status==="paid"?!1:null}function Tn(e){const t=e&&!window.ogb?.remoteClient?.active?window.ogb?.cloudPlan:void 0,n=e||window.ogb?.remoteClient?.active?void 0:window.ogb?.cloudAccount,[o,a]=u.useState(null),[i,c]=u.useState(!1);return u.useEffect(()=>{if(!t)return;let l=!0;return t.state().then(x=>{l&&a(In(x))}).catch(()=>{}),()=>{l=!1}},[t]),u.useEffect(()=>n?.onState(l=>c(l.waking===!0)),[n]),{sleeps:t?o:null,waking:i}}function _n({cloudHome:e=!1,howTo:t=!1,onMenuClosed:n}){const o=window.ogb?.workspaces,[a,i]=u.useState(null),[c,l]=u.useState(!1),[x,f]=u.useState("");u.useEffect(()=>{let p=!0;const k=()=>{o?.state().then(E=>{p&&i(E)}).catch(()=>{})};k();const T=o?.onChanged?.(k);return()=>{p=!1,T?.()}},[o]);const w=Tn(e||a?.home===!0),m=w.sleeps===null?"":s(w.sleeps?"cloudSetup.sleepsWhenIdle":"cloudSetup.alwaysOn"),g=w.waking?s("cloudHome.waking"):"";return{bridge:o,current:a,cloudHome:e,open:c,error:x,onLine:m,waking:g,openMenu:()=>{!o||c||(f(""),l(!0),Pn(o,{howTo:t,onClosed:n}).catch(()=>f(s("sidebar.switchServerError"))).finally(()=>l(!1)))},switchable:!!o&&a?.home!==!0}}function An(e){const t=_t(),n=r.jsx(On,{...e});return At(t)?r.jsx("div",{"data-switcher-beside-rail":!0,className:t.beside?"hidden":"contents md:hidden",children:n}):n}function On({compact:e=!1,inline:t=!1,pill:n=!1,rail:o=!1,cloudHome:a=!1,owner:i=null,howTo:c=!1,place:l,onMenuClosed:x}){const f=l||s("cloudSetup.myCloud"),{bridge:w,current:m,open:g,error:y,onLine:p,waking:k,openMenu:T}=_n({cloudHome:a,howTo:c,onMenuClosed:x}),E=b=>p?`${b} · ${p}`:b;if(!w||m?.home===!0){if(!a&&!m?.home)return null;const b=i?s("sidebar.cloudOwner",{email:i}):"",j=`${E(f)}${b?` · ${b}`:""}`;return o?r.jsx("div",{"data-cloud-home-indicator":!0,"data-workspace-switcher":"rail",role:"img","aria-label":j,title:j,className:"flex size-9 items-center justify-center text-ink-secondary",children:r.jsx(K,{size:18,"aria-hidden":"true"})}):t?r.jsxs("div",{"data-cloud-home-indicator":!0,"data-workspace-switcher":"inline",title:j,className:n?"flex h-8 min-w-0 items-center gap-1 rounded-full bg-raised/50 px-3 text-[13px] font-medium text-ink":"flex min-w-0 items-center gap-1.5 px-1.5 text-[13px] font-medium text-ink",children:[r.jsx(K,{size:n?15:14,"aria-hidden":"true",className:n?"hidden shrink-0 text-ink-secondary @max-[124px]/sidebar-top:block":"shrink-0 text-ink-secondary"}),r.jsx("span",{className:n?"min-w-0 truncate @max-[124px]/sidebar-top:hidden":"min-w-0 truncate",children:f}),(p||b)&&r.jsxs("span",{className:"sr-only",children:[p?` · ${p}`:"",b?` · ${b}`:""]})]}):r.jsx("div",{"data-cloud-home-indicator":!0,className:$("py-1.5",e?"px-2":"px-3"),children:r.jsxs("div",{title:j,className:$("flex items-center gap-2 py-2 text-[13px] font-medium text-ink",e?"justify-center px-1":"px-2"),children:[r.jsx(K,{size:16,"aria-hidden":"true",className:"shrink-0 text-ink-secondary"}),e?r.jsx("span",{className:"sr-only",children:j}):r.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[f,p&&r.jsx(Ue,{text:p}),b&&r.jsx("span",{className:"block truncate text-[12px] font-normal text-ink-secondary",children:b})]})]})})}const O=m?.profileName??(m?.local&&!m.localPath?s("place.local"):m?.name)??(a?f:s("sidebar.servers")),S=m?.local===!1||a&&!m?K:Ot,M=a?E(O):O,_=m?.origin?`${M} · ${m.origin}`:M,L=s("sidebar.switchServer",{name:M});return o?r.jsxs("div",{"data-workspace-switcher":"rail",className:"relative",children:[r.jsx("button",{type:"button","aria-label":L,"aria-haspopup":"menu","aria-expanded":g,"data-cloud-home-indicator":a||void 0,"data-tour":"server-switcher",title:_,onClick:T,className:$(Cn,"aria-expanded:bg-raised"),style:{WebkitAppRegion:"no-drag"},children:ae(m?.color)?r.jsx(se,{color:m?.color,size:18}):r.jsx(S,{size:18,"aria-hidden":"true"})}),y&&r.jsx("p",{role:"alert",className:"absolute bottom-0 left-full z-40 ml-2 w-56 rounded-md bg-menu px-2 py-1 text-[11px] text-danger shadow-lg",children:y}),k&&!y&&r.jsx("p",{role:"status","data-cloud-waking":!0,className:"absolute bottom-0 left-full z-40 ml-2 w-56 rounded-md bg-menu px-2 py-1 text-[11px] text-ink-secondary shadow-lg",children:k})]}):t?r.jsxs("div",{"data-workspace-switcher":"inline",className:"flex min-w-0",children:[r.jsxs("button",{type:"button","aria-label":L,"aria-haspopup":"menu","aria-expanded":g,"data-cloud-home-indicator":a||void 0,"data-tour":"server-switcher",title:_,onClick:T,className:n?"flex h-8 min-w-0 max-w-full items-center gap-1 overflow-hidden rounded-full bg-raised/50 pl-2.5 pr-1.5 text-left text-[13px] font-medium text-ink hover:bg-raised aria-expanded:bg-raised focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus":"flex h-7 min-w-0 max-w-full items-center gap-1.5 overflow-hidden rounded-md px-1.5 text-left text-[13px] font-medium text-ink hover:bg-control focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",style:{WebkitAppRegion:"no-drag"},children:[ae(m?.color)?r.jsx(se,{color:m?.color,size:16}):r.jsx(S,{size:n?15:14,"aria-hidden":"true","data-switcher-icon":!0,className:n?"hidden shrink-0 text-ink-secondary @max-[124px]/sidebar-top:block":"shrink-0 text-ink-secondary"}),r.jsx("span",{className:n?"min-w-0 truncate @max-[124px]/sidebar-top:hidden":"min-w-0 truncate @max-[96px]/sidebar-top:hidden",children:O}),r.jsx(Ae,{size:n?12:11,"aria-hidden":"true",className:n?"shrink-0 text-ink-tertiary":"shrink-0 text-ink-secondary"})]}),y&&r.jsx("p",{role:"alert",className:"absolute right-2 top-full z-40 mt-1 w-56 max-w-[calc(100%-1rem)] rounded-md bg-menu px-2 py-1 text-[11px] text-danger shadow-lg",children:y}),k&&!y&&r.jsx("p",{role:"status","data-cloud-waking":!0,className:"absolute right-2 top-full z-40 mt-1 w-56 max-w-[calc(100%-1rem)] rounded-md bg-menu px-2 py-1 text-[11px] text-ink-secondary shadow-lg",children:k})]}):r.jsxs("div",{className:$("py-1.5",e?"px-2":"px-3"),children:[r.jsxs("button",{type:"button","aria-label":L,"aria-haspopup":"menu","aria-expanded":g,"data-cloud-home-indicator":a||void 0,"data-tour":"server-switcher",title:_,onClick:T,className:$("flex w-full items-center gap-2 rounded-lg py-2 text-left text-[13px] font-medium text-ink hover:bg-control focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",e?"justify-center px-1":"px-2"),style:{WebkitAppRegion:"no-drag"},children:[ae(m?.color)?r.jsx(se,{color:m?.color,size:20}):r.jsx(S,{size:16,className:"shrink-0 text-ink-secondary"}),!e&&r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[O,a&&p&&r.jsx(Ue,{text:p})]}),r.jsx(Ae,{size:13,className:"shrink-0 text-ink-secondary"})]})]}),y&&r.jsx("p",{role:"alert",className:"mt-1 text-[11px] text-danger",children:y}),k&&!y&&r.jsx("p",{role:"status","data-cloud-waking":!0,className:"mt-1 text-[11px] text-ink-secondary",children:k})]})}function Ln(e){const t=e&&typeof e=="object"?e.membership:void 0,n=t&&typeof t=="object"?t:{};let o=null;if(typeof n.peopleUrl=="string")try{new URL(n.peopleUrl).protocol==="https:"&&(o=n.peopleUrl)}catch{o=null}return{authority:n.authority==="portal"?"portal":"local",pairingCodes:n.pairingCodes!==!1,peopleUrl:o}}const Oo=()=>({type:"toggleAppSettings",open:!0,section:"companion",phonePairing:!0});function Lo(e){const t=typeof window>"u"?void 0:window.ogb;return Rn({companion:!!t?.companion,remoteClient:t?.remoteClient?.active===!0,cloudHome:e})}function Rn(e){return e.cloudHome?"cloud":e.companion&&!e.remoteClient?"computer":"server"}const $n={computer:"sidebar.menu.connectPhone.computer",cloud:"sidebar.menu.connectPhone.cloud",server:"sidebar.menu.connectPhone.server"};function Ro(e,t){const n=t?.session?.kind==="session"?t.session.team?.name:void 0;return n?{target:e,subtitleKey:"sidebar.menu.connectPhone.team",team:n}:e!=="computer"&&!(t&&t.pairingCodes&&tt(t.session))?null:{target:e,subtitleKey:$n[e]}}function $o(e,t){if(!e)return[];const n={...e,id:"here"};return e.target,[n]}let We=null;function Ho(e=fetch){return We??=ne(e).then(async t=>{if(!tt(t))return{session:t,pairingCodes:!1};const n=await e("/api/config",{credentials:"same-origin"}).then(o=>o.ok?o.json():null).catch(()=>null);return{session:t,pairingCodes:Ln(n).pairingCodes}}),We}const Hn="data-phone-pairing-action";function Mo(e,t=n=>window.requestAnimationFrame(n)){return e?(t(()=>{e.scrollIntoView?.({block:"start"}),(e.querySelector(`[${Hn}]:not([disabled])`)??e).focus({preventScroll:!0})}),!0):!1}function Do(e){const t=new URL(e);return t.searchParams.get("desktop-settings")!=="phone"?null:(t.searchParams.delete("desktop-settings"),`${t.pathname}${t.search}${t.hash}`)}function le(e){const t=new URLSearchParams(e);if(t.get("desktop-settings")==="phone")return"/?desktop-settings=phone";const n=t.get("next");return n&&/^\/(?!\/)/.test(n)&&!n.startsWith("/pair")&&!/[\\\s]/.test(n)?n:"/"}const Mn="23456789ABCDEFGHJKLMNPQRSTUVWXYZ",Dn=12,zn="omb_pair_",Bn=/^omb_pair_[A-Za-z0-9_-]{43}$/;function xt(e){return e.toUpperCase().replace(/[^A-Z0-9]/g,"").replace(/0/g,"O").replace(/1/g,"I")}function Fn(e){return xt(e).match(/.{1,4}/g)?.join("-")??e}const Un={emailCode:"serverError.pair.emailCode",oldCode:"serverError.pair.oldCode",scriptKey:"serverError.pair.scriptKey",notACode:"serverError.pair.notACode"};function Wn(e){let t;try{t=new URL(e)}catch{return null}const n=new URLSearchParams(t.hash.replace(/^#/,""));return t.searchParams.get("token")??t.searchParams.get("code")??n.get("code")}function Ne(e){let t=e.trim();if(!t)return{kind:"empty"};if(/^[a-z][a-z0-9+.-]*:\/\//i.test(t)){const a=Wn(t);if(!a)return{kind:"wrong",problem:"notACode"};t=a.trim()}if(t.startsWith("omb_sess_"))return{kind:"wrong",problem:"scriptKey"};if(t.startsWith(zn))return Bn.test(t)?{kind:"credential",credential:t}:{kind:"wrong",problem:"notACode"};const n=t.replace(/[\s-]/g,"");if(/^\d{8}$/.test(n))return{kind:"wrong",problem:"emailCode"};if(/^\d{6}$/.test(n))return{kind:"wrong",problem:"oldCode"};const o=xt(t);return o.length!==Dn||[...o].some(a=>!Mn.includes(a))?{kind:"wrong",problem:"notACode"}:{kind:"code",code:o}}const z="mt-1 w-full rounded-md border border-hairline/40 bg-inset px-3 py-2 text-[14px] text-ink outline-none focus:border-accent-border",Ke="mt-5 w-full rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink disabled:opacity-50",B="mt-4 block text-[12px] font-medium text-ink-secondary";function Kn(e,t=typeof window<"u"&&!!window.ogb?.workspaces){return!!e&&t}function Vn({mode:e,sent:t,email:n,cloudHome:o}){return e==="email"?t?s("pair.intro.emailSent",{email:n}):s("pair.intro.email"):o?s("pair.intro.cloud",{app:H(),open:s("cloudHome.connect"),section:s("settings.section.cloudAccount")}):s("pair.intro.code")}function Xn(e){const t=Ne(e);return t.kind==="wrong"&&t.problem!=="notACode"?s(Un[t.problem]):null}function Gn(e){const t=Ne(e).kind;return t==="code"||t==="credential"}function Yn(e,t){const n=Ne(t),o=n.kind==="code"?`&code=${encodeURIComponent(Fn(n.code))}`:"";return`openmausbot://pair?address=${encodeURIComponent(e)}${o}`}function qn(e){return e.protocol==="http:"&&!Lt(e.hostname)}function Ve(e,t=Xt()){if(!e?.capabilities.cloudTeam||typeof t!="string")return null;try{const n=new URL(t),o=n.protocol==="http:"&&["127.0.0.1","localhost","[::1]"].includes(n.hostname);return(n.protocol==="https:"||o)&&!n.username&&!n.password&&!n.hash?n.href:null}catch{return null}}function Jn(e,t){return e?.capabilities.cloudTeam?e.label:e?.capabilities.cloudHome?s("pair.myCloud"):s(t==="email"?"pair.signInTo":"pair.connectTo",{name:e?.label??s("pair.thisOpenMausBot",{app:H()})})}function Zn({team:e}){return r.jsx("main",{"data-team-left":!0,className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:r.jsx("p",{role:"status",className:"max-w-[420px] text-[16px]",children:s("homeLine.left",{name:e??s("pair.thisOpenMausBot",{app:H()})})})})}function X({initialCode:e,initialEmail:t=null,reason:n}){const[o,a]=u.useState(e??""),[i,c]=u.useState(nt()),[l,x]=u.useState(null),[f,w]=u.useState(null),[m,g]=u.useState(!1),[y,p]=u.useState(null),[k,T]=u.useState(()=>Z()),[E,O]=u.useState(t&&!e?"email":"code"),[S,M]=u.useState(t??""),[_,L]=u.useState(""),[b,j]=u.useState(!1),[oe,gt]=u.useState(()=>Kn(e));u.useEffect(()=>{if(!oe||!e)return;let h=!0;return ue({code:e,label:i,attemptId:k}).then(C=>{if(h){if(C.ok){location.replace(le(location.search));return}gt(!1),p(C.error)}}),()=>{h=!1}},[]),u.useEffect(()=>{fetch("/.well-known/openmausbot/environment").then(h=>h.ok?h.json():null).then(h=>{x(h)}).catch(()=>{x(null)}),ne().then(w)},[]);const re=Gt(f),yt=l?.capabilities.emailSignIn===!0,D=l?.capabilities.cloudHome===!0,kt=!D&&l?.capabilities.cloudTeam!==!0,Ce=Xn(o),W=typeof location<"u"&&typeof location.protocol=="string"?location:null;async function wt(h){h.preventDefault(),g(!0),p(null);const C=await ue({code:o,label:i,attemptId:k});if(g(!1),C.ok){location.replace(le(location.search));return}p(C.error)}async function vt(h){h.preventDefault(),g(!0),p(null);const C=b?await tn({email:S,code:_,label:i}):await en(S);if(g(!1),!C.ok){p(C.error);return}if(b){location.replace(le(location.search));return}j(!0)}function Pe(h){O(h),p(null)}return r.jsxs("main",{className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:[r.jsx("div",{className:"absolute left-3 top-12 max-w-[280px]",children:r.jsx(An,{})}),r.jsxs("div",{className:"w-full max-w-[420px]",children:[W&&qn(W)?r.jsx("p",{role:"alert",className:"mb-4 rounded-md border border-warning/30 bg-warning/10 px-3 py-2 text-[13px] text-warning",children:s("pair.notEncrypted")}):null,oe?r.jsx("p",{role:"status",className:"text-[20px] font-semibold",children:D?s("pair.openingCloud"):s("pair.connectingTo",{name:l?.label??s("pair.thisOpenMausBot")})}):r.jsxs(r.Fragment,{children:[r.jsx("h1",{className:"text-[20px] font-semibold",children:Jn(l,E)}),r.jsxs("p",{className:"mt-1.5 text-[14px] leading-relaxed text-ink-secondary",children:[l&&!D?`${s("pair.version",{version:l.version,platform:l.platform})} `:"",Vn({mode:E,sent:b,email:S,cloudHome:D})]}),Le(n)&&!re?r.jsx("p",{className:"mt-3 text-[13px] text-ink-secondary",children:Le(n)}):null,y&&D&&e?r.jsx("p",{className:"mt-3 text-[13px] text-ink-secondary",children:s("pair.expired",{app:H(),open:s("cloudHome.connect"),section:s("settings.section.cloudAccount")})}):null,!re&&Ve(l)?r.jsxs("div",{"data-team-sign-in":!0,className:"mt-4 flex flex-col items-start gap-1.5",children:[r.jsx("a",{href:Ve(l),className:"rounded-md bg-accent px-4 py-2 text-[14px] font-medium text-accent-ink",children:s("pair.team.open",{team:l.label})}),r.jsx("p",{className:"text-[13px] text-ink-secondary",children:s("pair.team.openHint")})]}):null]}),oe?null:re?r.jsxs("p",{className:"mt-4 text-[14px]",children:[s("pair.alreadyConnected")," ",r.jsx("a",{href:"/",className:"text-accent underline",children:s("pair.openApp")})]}):E==="email"?r.jsxs("form",{onSubmit:vt,children:[r.jsx("label",{className:B,htmlFor:"signin-email",children:s("cloudBuy.signIn.email")}),r.jsx("input",{id:"signin-email",type:"email",value:S,onChange:h=>{M(h.target.value),j(!1),L("")},autoComplete:"email",inputMode:"email",spellCheck:!1,className:z}),b?r.jsxs(r.Fragment,{children:[r.jsx("label",{className:B,htmlFor:"signin-code",children:s("pair.emailCode")}),r.jsx("input",{id:"signin-code",value:_,onChange:h=>L(h.target.value),placeholder:"12345678",autoComplete:"one-time-code",inputMode:"numeric",spellCheck:!1,className:`${z} font-mono text-[15px] tracking-[0.12em]`}),r.jsx("label",{className:B,htmlFor:"signin-label",children:s("pair.deviceLabel")}),r.jsx("input",{id:"signin-label",value:i,onChange:h=>c(h.target.value),maxLength:80,className:z})]}):null,y?r.jsx("p",{className:"mt-3 text-[13px] text-danger",children:y}):null,r.jsx("button",{type:"submit",disabled:m||!S.includes("@")||b&&_.replace(/\D/g,"").length<8,className:Ke,children:s(m?b?"pair.signingIn":"pair.sending":b?"pair.signIn":"cloudBuy.signIn.send")}),b?r.jsx("button",{type:"button",onClick:()=>j(!1),className:"mt-3 w-full text-[13px] text-ink-secondary underline",children:s("pair.resend")}):null,r.jsx("button",{type:"button",onClick:()=>Pe("code"),className:"mt-3 w-full text-[13px] text-ink-secondary underline",children:s("pair.useCode")})]}):r.jsxs("form",{onSubmit:wt,children:[r.jsx("label",{className:B,htmlFor:"pair-code",children:s("pair.code")}),r.jsx("input",{id:"pair-code",value:o,onChange:h=>{a(h.target.value),T(Z())},placeholder:"XXXX-XXXX-XXXX","aria-describedby":e&&o===e?"pair-code-from-link":void 0,autoComplete:"one-time-code",autoCapitalize:"characters",spellCheck:!1,className:`${z} font-mono text-[15px] tracking-[0.12em]`}),e&&o===e?r.jsx("p",{id:"pair-code-from-link",className:"mt-1 text-[12px] text-ink-secondary",children:s("pair.fromLink")}):null,r.jsx("label",{className:B,htmlFor:"pair-label",children:s("pair.deviceLabel")}),r.jsx("input",{id:"pair-label",value:i,onChange:h=>c(h.target.value),maxLength:80,className:z}),Ce?r.jsx("p",{role:"alert",className:"mt-3 text-[13px] text-danger",children:Ce}):y?r.jsx("p",{className:"mt-3 text-[13px] text-danger",children:y}):null,r.jsx("button",{type:"submit",disabled:m||!Gn(o),className:Ke,children:s(m?"pair.connecting":"pair.connect")}),W?.origin?r.jsxs("p",{className:"mt-3 text-[13px] text-ink-secondary",children:[s("pair.onPhone")," ",r.jsx("a",{href:Yn(W.origin,o),className:"text-accent underline",children:s("pair.openInApp",{app:H()})})]}):null,kt?r.jsxs("p",{className:"mt-3 text-[13px] text-ink-secondary",children:[s("pair.noCode")," ",r.jsx("code",{className:"select-all rounded bg-inset px-1.5 py-0.5 text-[12px] text-ink",children:"npx limixbot pair"})]}):null,yt?r.jsxs("p",{className:"mt-5 border-t border-hairline/40 pt-4 text-[13px] text-ink-secondary",children:[s("pair.invitedByEmail")," ",r.jsx("button",{type:"button",onClick:()=>Pe("email"),className:"text-accent underline",children:s("pair.useEmail")})]}):null]})]})]})}const zo="cloud-welcome-done",Qn="unauthorized: you are no longer in this team",Xe=[["reserving","cloudHome.step.reserving"],["storage","cloudHome.step.storage"],["starting","cloudHome.step.starting"],["checking","cloudHome.step.checking"]];function eo({step:e}){const t=Xe.findIndex(([n])=>n===e);return r.jsx("ol",{"data-cloud-setup":e,className:"flex flex-col gap-1 text-[13px]",children:Xe.map(([n,o],a)=>r.jsx("li",{"aria-current":a===t?"step":void 0,className:a===t?"font-medium text-ink":a<t?"text-ink-secondary line-through decoration-ink-secondary/40":"text-ink-secondary",children:s(o)},n))})}const to={stopped:"cloudHome.stopped","payment-problem":"cloudHome.paymentProblem",failed:"cloudHome.failed"},Ge={host:"cloudHome.unreachableHost",no_answer:"cloudHome.unreachable"};function no(e,t=Date.now()){const n=new Date(e).getFullYear()!==new Date(t).getFullYear();return new Intl.DateTimeFormat(Rt(),{day:"numeric",month:"long",...n?{year:"numeric"}:{}}).format(new Date(e))}function oo(e,t=Date.now()){const n=e?.name??null,o=(a,i)=>n?s(i,{name:n}):s(a);return e?.screen==="setup"?{title:o("homeScreen.setup","homeScreen.setupNamed"),body:s(e.slow?"cloudHome.slow":"homeScreen.setupBody"),reason:null,action:null,busy:!0}:e?.screen==="offline"?{title:o("homeScreen.offline","homeScreen.offlineNamed"),body:s("homeScreen.offlineBack"),reason:e.cause&&Object.hasOwn(Ge,e.cause)?s(Ge[e.cause]):e.reason??null,action:"retry",busy:!1}:e?.screen==="signin"?{title:o("homeScreen.signIn","homeScreen.signInNamed"),body:s(e.other?"homeScreen.signInOther":"homeScreen.signInEnded"),reason:null,action:"sign-in",busy:!1}:e?.screen==="plan"&&e.member&&e.machine!=="failed"?{title:o("homeScreen.plan","homeScreen.planNamed"),body:s("cloudHome.stoppedMember"),reason:null,action:null,busy:!1}:e?.screen==="plan"?{title:o("homeScreen.plan","homeScreen.planNamed"),body:s(to[e.machine]??"cloudHome.failed"),reason:null,action:e.machine==="failed"?null:"manage",busy:!1}:e?.screen==="ended"?{title:o("cloudHome.ended","cloudHome.endedNamed"),body:e.deleteAt?s("cloudHome.endedFiles",{date:no(e.deleteAt,t)}):null,reason:null,action:"buy",busy:!1}:e?.screen==="checkout"?{title:o("cloudHome.checkout","cloudHome.checkoutNamed"),body:null,reason:null,action:"continue",busy:!1}:e?.screen==="payment"?{title:o("cloudHome.payment","cloudHome.paymentNamed"),body:s("cloudHome.paymentBody"),reason:null,action:"card",busy:!1}:e?.screen==="waking"?{title:s("homeScreen.waking"),body:null,reason:null,action:null,busy:!0}:e?.screen==="moving"?{title:o("homeScreen.moving","homeScreen.movingNamed"),body:null,reason:null,action:null,busy:!0}:{title:o("homeScreen.opening","homeScreen.openingNamed"),body:null,reason:null,action:null,busy:!0}}const ro={retry:"cloudHome.tryAgain",buy:"cloudHome.buyAgain",continue:"cloudHome.continue",card:"cloudHome.updateCard"};function ao({name:e,remove:t}){const[n,o]=u.useState(!1),[a,i]=u.useState(!1),[c,l]=u.useState(null),x=()=>{i(!0),l(null),t().then(f=>{i(!1),f!=="removed"&&f!=="gone"&&(o(!1),l(f==="refused"?"refused":"failed"))},()=>{i(!1),o(!1),l("failed")})};return r.jsxs("div",{"data-home-remove":!0,className:"flex flex-col items-start gap-2",children:[n?r.jsxs("div",{role:"alertdialog","aria-label":s("rail.remove"),className:"flex flex-col gap-2 rounded-xl border border-hairline/70 bg-card/70 px-4 py-3",children:[r.jsx("p",{className:"text-[13px] leading-relaxed text-ink",children:s("rail.removeAsk",{name:e})}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{type:"button","data-home-remove-confirm":!0,className:"ui-button ui-button-primary",disabled:a,onClick:x,children:s("rail.removeYes")}),r.jsx("button",{type:"button",className:"ui-button",disabled:a,onClick:()=>o(!1),children:s("rail.removeNo")})]})]}):r.jsx("button",{type:"button","data-home-remove-ask":!0,className:"text-[13px] text-ink-secondary underline-offset-2 hover:text-ink hover:underline",onClick:()=>{l(null),o(!0)},children:s("rail.remove")}),c&&r.jsx("p",{role:"alert",className:"text-[13px] text-danger",children:s(c==="refused"?"rail.removeRefused":"rail.removeFailed")})]})}function so({bridge:e,manage:t}){const[n,o]=u.useState(null),[a,i]=u.useState(!1);u.useEffect(()=>{let g=!0;const y=e.onState(k=>o(k)),p=()=>{e.retry().then(k=>{g&&o(k)}).catch(()=>{})};return e.state().then(k=>{g&&o(k)}).catch(()=>{}).then(p),window.addEventListener("online",p),window.addEventListener("focus",p),()=>{g=!1,y(),window.removeEventListener("online",p),window.removeEventListener("focus",p)}},[e]);const c=oo(n),l=g=>{i(!1),g().catch(()=>i(!0))},x=window.ogb?.cloudAdd?.reopen,f={retry:()=>e.retry().then(g=>o(g)),...t?{manage:t,buy:t,card:t,continue:async()=>{x&&await x().catch(()=>!1)||await t()}}:{}},w=c.action&&c.action!=="sign-in"&&c.action!=="manage"?c.action:null,m=(n?.screen==="ended"||n?.screen==="payment")&&n.removable===!0&&typeof e.remove=="function";return r.jsx("main",{"data-home-screen":n?.screen??"opening",className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",style:{WebkitAppRegion:"drag"},children:r.jsxs("div",{className:"flex w-full max-w-[420px] flex-col items-start gap-3",style:{WebkitAppRegion:"no-drag"},children:[r.jsxs("p",{role:"status",className:"flex items-center gap-2 text-[20px] font-semibold",children:[c.busy&&r.jsx("span",{"aria-hidden":"true",className:"size-3.5 shrink-0 animate-spin rounded-full border-2 border-hairline border-t-accent"}),c.title]}),c.body&&r.jsx("p",{className:"text-[14px] leading-relaxed text-ink-secondary",children:c.body}),n?.screen==="setup"&&r.jsx(eo,{step:n.step??"reserving"}),c.reason&&r.jsx("p",{"data-home-reason":!0,className:"text-[13px] leading-relaxed text-ink-secondary",children:c.reason}),c.action==="sign-in"&&r.jsx("button",{type:"button",className:"ui-button ui-button-primary mt-2",onClick:()=>l(()=>e.signIn()),children:s("homeScreen.signInButton")}),c.action==="manage"&&t&&r.jsx("button",{type:"button",className:"ui-button mt-2",onClick:()=>l(t),children:s("cloudAccount.manageInBrowser")}),w&&f[w]&&r.jsx("button",{type:"button","data-home-action":w,className:w==="retry"?"ui-button mt-2":"ui-button ui-button-primary mt-2",onClick:()=>l(f[w]),children:s(ro[w])}),m&&r.jsx(ao,{name:n.name??s("cloudSetup.myCloud"),remove:()=>e.remove()}),a&&r.jsx("p",{role:"alert",className:"text-[13px] text-danger",children:s("cloudAccount.actionFailed")})]})})}function io({bridge:e,fallback:t}){const[n,o]=u.useState(!1);return u.useEffect(()=>{e.repair().catch(()=>o(!0))},[e]),n?r.jsx(r.Fragment,{children:t}):r.jsx("main",{"data-home-screen":"opening",className:"flex min-h-screen items-center justify-center bg-app px-6 text-ink",children:r.jsx("p",{role:"status",className:"w-full max-w-[420px] text-[20px] font-semibold",children:s("homeScreen.opening")})})}const Ee="omb.session-ended";let he=!1,ce=null;const xe=new Set;function Bo(){he||ce||(ce=ne().then(e=>{if(e.kind==="unauthenticated"){he=!0;try{sessionStorage.setItem(Ee,"1")}catch{}for(const t of xe)t()}}).finally(()=>{ce=null}))}function Ye(){return he}function Fo(){return u.useSyncExternalStore(e=>(xe.add(e),()=>xe.delete(e)),Ye,Ye)}function lo(){try{return sessionStorage.getItem(Ee)==="1"}catch{return!1}}function co(){try{sessionStorage.removeItem(Ee)}catch{}}$t();ge(Ht());Mt(Dt());nn();zt(Bt());wn();const J=Ft(),uo=new Set(["/home","/pair","/desktop-viewer"]),bt=()=>Qe(()=>import("./App-CNqHO0Df.js").then(e=>e.jV),__vite__mapDeps([0,1,2,3,4,5])).catch(e=>({default:()=>{throw e}})),mo=uo.has(location.pathname)?null:bt(),po=()=>fetch("/.well-known/openmausbot/environment").then(e=>e.json()).then(e=>e.capabilities?.cloudTeam===!0&&typeof e.label=="string"?e.label:null,()=>null);async function fo(){const e=window.ogb?.home;if(location.pathname==="/home"&&e)return r.jsx(so,{bridge:e,manage:window.ogb?.cloudPlan?.manage});if(location.pathname==="/pair"){const o=qt();if(o){const a=await Zt(o);return await J,a?r.jsx(vn,{credential:o,owner:a.owner,team:a.team}):r.jsx(X,{initialCode:null,reason:s("pair.browser.signInFailed")})}return r.jsx(X,{initialCode:Yt(),initialEmail:Jt()})}const t=await ne();if(t.kind==="unauthenticated"){if(await J,t.error===Qn)return r.jsx(Zn,{team:await po()});const o=r.jsx(X,{initialCode:null,reason:lo()?s("pair.sessionEnded"):t.error});return e?r.jsx(io,{bridge:e,fallback:o}):o}if(co(),t.kind==="session"&&Vt(t.teamSignIn),t.kind==="loopback"&&t.trust==="service")return await J,r.jsx(X,{initialCode:null,reason:s("pair.serviceTrust")});if(location.pathname==="/desktop-viewer"){const{DesktopViewer:o}=await Qe(async()=>{const{DesktopViewer:a}=await import("./DesktopViewer-8VFpsBvQ.js");return{DesktopViewer:a}},__vite__mapDeps([6,1,2,7,8,5,4,9]));return r.jsx(o,{})}const{default:n}=await(mo??bt());return we(),r.jsx(n,{})}document.title=H();Promise.all([Ut(),fo(),J]).then(([,e])=>{Wt.createRoot(document.getElementById("root")).render(r.jsx(u.StrictMode,{children:r.jsx(Kt,{children:e})}))});export{Po as A,bo as B,eo as C,Co as D,No as E,En as F,An as G,To as H,_o as I,Sn as J,de as K,Eo as L,zo as M,Fo as N,X as O,Io as P,Do as Q,Nn as S,at as T,Ln as a,Mo as b,xn as c,yn as d,jo as e,So as f,Lo as g,vo as h,tt as i,jn as j,Se as k,we as l,$o as m,Bo as n,Pn as o,Oo as p,xo as q,ne as r,wo as s,go as t,yo as u,Ho as v,ko as w,Ro as x,_n as y,Ao as z};
@@ -1,2 +1,2 @@
1
- import{_ as e,l as s,T as n,d as i}from"./mermaid.core-CfjIa7ec.js";import{p}from"./cynefin-EF2NZ3EQ-gSQ27OWL.js";import"./styles-CvSVuxAa.js";import"./step-CkmJJ7wq.js";var g={parse:e(async r=>{const a=await p("info",r);s.debug(a)},"parse")},d={version:"12.1.0"},v=e(()=>d.version,"getVersion"),m={getVersion:v},c=e((r,a,o)=>{s.debug(`rendering info diagram
1
+ import{_ as e,l as s,T as n,d as i}from"./mermaid.core-Cq11VdvX.js";import{p}from"./cynefin-EF2NZ3EQ-DoQI9XJs.js";import"./styles-DmZQm0by.js";import"./step-CkmJJ7wq.js";var g={parse:e(async r=>{const a=await p("info",r);s.debug(a)},"parse")},d={version:"12.1.0"},v=e(()=>d.version,"getVersion"),m={getVersion:v},c=e((r,a,o)=>{s.debug(`rendering info diagram
2
2
  `+r);const t=n(a);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw"),l={draw:c},w={parser:g,db:m,renderer:l};export{w as diagram};
@@ -1,4 +1,4 @@
1
- import{_ as o,c as ot,Y as ut,T as dt,ae as yt,D as ft,m as pt,v as it,a as gt,b as kt,g as mt,s as wt,x as _t,d as bt}from"./mermaid.core-CfjIa7ec.js";import"./styles-CvSVuxAa.js";import"./step-CkmJJ7wq.js";var J=(function(){var e=o(function(T,t,s,i){for(s=s||{},i=T.length;i--;s[T[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],u=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],D={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,c,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return c;case 15:c.addNode(n[w-1].length,n[w].trim());break;case 16:c.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(u,[2,18],{14:[1,21]}),e(u,[2,16]),e(u,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(u,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],c=[],p=[null],n=[],v=this.table,w="",I=0,$=0,L=2,A=1,C=n.slice.call(arguments,1),b=Object.create(this.lexer),S={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(S.yy[P]=this.yy[P]);b.setInput(t,S.yy),S.yy.lexer=b,S.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var R=b.yylloc;n.push(R);var G=b.options&&b.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(B){i.length=i.length-2*B,p.length=p.length-B,n.length=n.length-B}o(X,"popStack");function tt(){var B;return B=c.pop()||b.lex()||A,typeof B!="number"&&(B instanceof Array&&(c=B,B=c.pop()),B=s.symbols_[B]||B),B}o(tt,"lex");for(var M,W,N,K,F={},U,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?N=this.defaultActions[W]:((M===null||typeof M>"u")&&(M=tt()),N=v[W]&&v[W][M]),typeof N>"u"||!N.length||!N[0]){var q="";Y=[];for(U in v[W])this.terminals_[U]&&U>L&&Y.push("'"+this.terminals_[U]+"'");b.showPosition?q="Parse error on line "+(I+1)+`:
1
+ import{_ as o,c as ot,Y as ut,T as dt,ae as yt,D as ft,m as pt,v as it,a as gt,b as kt,g as mt,s as wt,x as _t,d as bt}from"./mermaid.core-Cq11VdvX.js";import"./styles-DmZQm0by.js";import"./step-CkmJJ7wq.js";var J=(function(){var e=o(function(T,t,s,i){for(s=s||{},i=T.length;i--;s[T[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],u=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],D={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,c,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return c;case 15:c.addNode(n[w-1].length,n[w].trim());break;case 16:c.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(u,[2,18],{14:[1,21]}),e(u,[2,16]),e(u,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(u,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],c=[],p=[null],n=[],v=this.table,w="",I=0,$=0,L=2,A=1,C=n.slice.call(arguments,1),b=Object.create(this.lexer),S={yy:{}};for(var P in this.yy)Object.prototype.hasOwnProperty.call(this.yy,P)&&(S.yy[P]=this.yy[P]);b.setInput(t,S.yy),S.yy.lexer=b,S.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var R=b.yylloc;n.push(R);var G=b.options&&b.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function X(B){i.length=i.length-2*B,p.length=p.length-B,n.length=n.length-B}o(X,"popStack");function tt(){var B;return B=c.pop()||b.lex()||A,typeof B!="number"&&(B instanceof Array&&(c=B,B=c.pop()),B=s.symbols_[B]||B),B}o(tt,"lex");for(var M,W,N,K,F={},U,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?N=this.defaultActions[W]:((M===null||typeof M>"u")&&(M=tt()),N=v[W]&&v[W][M]),typeof N>"u"||!N.length||!N[0]){var q="";Y=[];for(U in v[W])this.terminals_[U]&&U>L&&Y.push("'"+this.terminals_[U]+"'");b.showPosition?q="Parse error on line "+(I+1)+`:
2
2
  `+b.showPosition()+`
3
3
  Expecting `+Y.join(", ")+", got '"+(this.terminals_[M]||M)+"'":q="Parse error on line "+(I+1)+": Unexpected "+(M==A?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(q,{text:b.match,token:this.terminals_[M]||M,line:b.yylineno,loc:R,expected:Y})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+M);switch(N[0]){case 1:i.push(M),p.push(b.yytext),n.push(b.yylloc),i.push(N[1]),M=null,$=b.yyleng,w=b.yytext,I=b.yylineno,R=b.yylloc;break;case 2:if(V=this.productions_[N[1]][1],F.$=p[p.length-V],F._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},G&&(F._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),K=this.performAction.apply(F,[w,$,I,S.yy,N[1],p,n].concat(C)),typeof K<"u")return K;V&&(i=i.slice(0,-1*V*2),p=p.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[N[1]][0]),p.push(F.$),n.push(F._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=(function(){var T={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===c.length?this.yylloc.first_column:0)+c[c.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`