dsh-claude-slides 2.4.0 → 2.5.0

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.
@@ -6,9 +6,9 @@
6
6
  <meta name="appifact-capabilities" content="{&quot;downloads&quot;:{},&quot;artifact&quot;:{},&quot;comments&quot;:{&quot;composer_only&quot;:true,&quot;customAnchors&quot;:true},&quot;db&quot;:{&quot;rules&quot;:[{&quot;path&quot;:&quot;&quot;,&quot;write&quot;:&quot;admin&quot;},{&quot;path&quot;:&quot;notes&quot;,&quot;read&quot;:&quot;admin&quot;,&quot;write&quot;:&quot;admin&quot;}]},&quot;assets&quot;:{},&quot;user&quot;:{&quot;scopes&quot;:[&quot;profile&quot;]}}">
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1">
8
8
  <script id="appifact-mode">(function(){var h=document.documentElement;function s(){var t=h.getAttribute('data-theme');if(t==='light'||t==='dark'){h.setAttribute('data-mode',t)}else{h.removeAttribute('data-mode')}}s();if(typeof MutationObserver==='function'){new MutationObserver(s).observe(h,{attributes:true,attributeFilter:['data-theme']})}})();</script>
9
- <script id="appifact-flags">(function(){var values={slides_theme_tab:true,appifact_extra_export_formats:window.parent===window};function kind(v){return v===null?"null":Array.isArray(v)?"array":typeof v}function copy(v){return JSON.parse(JSON.stringify(v))}globalThis.__appifact_flags={version:"appifact-flags:v1",ready:function(){return Promise.resolve(true)},get:function(key,fallback){if(!Object.prototype.hasOwnProperty.call(values,key)||kind(values[key])!==kind(fallback))return fallback;return copy(values[key])},all:function(){return copy(values)}};})();</script>
9
+ <script id="appifact-flags">(function(){var values={slides_theme_tab:true,appifact_icon_set:true,appifact_extra_export_formats:window.parent===window};function kind(v){return v===null?"null":Array.isArray(v)?"array":typeof v}function copy(v){return JSON.parse(JSON.stringify(v))}globalThis.__appifact_flags={version:"appifact-flags:v1",ready:function(){return Promise.resolve(true)},get:function(key,fallback){if(!Object.prototype.hasOwnProperty.call(values,key)||kind(values[key])!==kind(fallback))return fallback;return copy(values[key])},all:function(){return copy(values)}};})();</script>
10
10
  <title>Slides</title>
11
- <script type="module" crossorigin src="./assets/index-qb2rdK_o.js"></script>
11
+ <script type="module" crossorigin src="./assets/index-DULUou9H.js"></script>
12
12
  <link rel="stylesheet" crossorigin href="./assets/index-DooSdFer.css">
13
13
  </head>
14
14
  <body>
@@ -255280,6 +255280,13 @@ function installEditorApp(runtime2) {
255280
255280
  })
255281
255281
  ]
255282
255282
  }),
255283
+ // BaoCut: a seat for the comments button, right of Download. A page opened on its own (not in BaoCut's
255284
+ // iframe) draws claude.ai's comments button into it (@baoyu-design/comments, ui/toolbar.tsx); elsewhere
255285
+ // it stays empty.
255286
+ SlidesAppJsx.jsx("span", {
255287
+ "data-baoyu-comments-seat": "",
255288
+ style: { display: "contents" }
255289
+ }),
255283
255290
  toolbarMenus,
255284
255291
  SlidesAppJsx.jsx(runtime2.ToolbarWhenVisible, {
255285
255292
  children: SlidesAppJsx.jsx(runtime2.ArtifactToolbarDivider, {})
@@ -0,0 +1,83 @@
1
+ var x=window.__baoyuShare??{},k=x.role==="owner",y=x.noun??{en:"artifact",zh:"\u5185\u5BB9",zhThis:"\u8FD9\u4EFD\u5185\u5BB9"},M=["editor","commenter","viewer"],N=/^zh\b/i.test(navigator.language),t=N?{share:"\u5206\u4EAB",title:`\u5206\u4EAB${y.zhThis}`,close:"\u5173\u95ED",peopleWithAccess:"\u6709\u6743\u8BBF\u95EE\u7684\u4EBA",joinedPeople:"\u52A0\u5165\u7684\u4EBA",generalAccess:"\u4E00\u822C\u8BBF\u95EE\u6743\u9650",inviteLinks:"\u9080\u8BF7\u94FE\u63A5",you:"\uFF08\u4F60\uFF09",thisComputer:"\u8FD9\u53F0\u7535\u8111",owner:"\u6240\u6709\u8005",roleNames:{editor:"\u7F16\u8F91\u8005",commenter:"\u8BC4\u8BBA\u8005",viewer:"\u67E5\u770B\u8005"},linkTitles:{editor:"\u53EF\u7F16\u8F91",commenter:"\u53EF\u8BC4\u8BBA",viewer:"\u4EC5\u67E5\u770B"},roleNotes:{editor:"\u7F16\u8F91\u548C\u8BC4\u8BBA",commenter:x.reactions?"\u8BC4\u8BBA\u548C\u8868\u60C5\u56DE\u5E94\uFF0C\u4E0D\u80FD\u7F16\u8F91":"\u8BC4\u8BBA\uFF0C\u4E0D\u80FD\u7F16\u8F91",viewer:"\u53EA\u80FD\u770B"},changeRole:a=>`\u66F4\u6539\u300C${a}\u300D\u7684\u89D2\u8272`,linkOff:"\u94FE\u63A5\u5DF2\u5173\u95ED",online:"\u5728\u7EBF",seen:a=>`${a}\u6765\u8FC7`,paused:"\u94FE\u63A5\u5DF2\u5173\u95ED\uFF0C\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE",none:"\u8FD8\u6CA1\u6709\u4EBA\u52A0\u5165\u3002\u628A\u4E0B\u9762\u7684\u94FE\u63A5\u53D1\u7ED9\u5BF9\u65B9\u3002",remove:"\u79FB\u51FA",removeTitle:a=>`\u79FB\u51FA\u300C${a}\u300D\uFF1F`,removeText:`\u5BF9\u65B9\u5C06\u65E0\u6CD5\u518D\u8BBF\u95EE${y.zhThis}\uFF0C\u4E4B\u540E\u4ECD\u53EF\u4EE5\u7528\u94FE\u63A5\u91CD\u65B0\u52A0\u5165\u3002`,onlyHere:"\u4EC5\u8FD9\u53F0\u7535\u8111",onlyHereNote:"\u522B\u4EBA\u6253\u4E0D\u5F00\u8FD9\u4E9B\u94FE\u63A5\u3002",onLan:"\u540C\u4E00\u7F51\u7EDC\u91CC\u6709\u94FE\u63A5\u7684\u4EBA",onLanNote:"\u540C\u4E00 Wi-Fi \u6216\u5C40\u57DF\u7F51\u91CC\u7684\u4EBA\u7528\u94FE\u63A5\u6253\u5F00\uFF0C\u62FF\u5230\u54EA\u4E2A\u94FE\u63A5\u5C31\u662F\u54EA\u4E2A\u89D2\u8272\u3002",whereOff:"\u53EA\u6709\u8FD9\u53F0\u7535\u8111\u80FD\u6253\u5F00\u8FD9\u4E9B\u94FE\u63A5\u3002",whereOn:a=>`\u5C40\u57DF\u7F51\u5730\u5740\uFF1A${a}`,noAddress:"\u8FD9\u53F0\u7535\u8111\u6CA1\u6709\u5C40\u57DF\u7F51\u5730\u5740\u3002",copyLink:"\u590D\u5236\u94FE\u63A5",onlyAccess:"\u53EA\u6709\u6709\u6743\u8BBF\u95EE\u7684\u4EBA\u624D\u80FD\u6253\u5F00\u8FD9\u4E2A\u94FE\u63A5",guestInviteNote:"\u540C\u4E00\u7F51\u7EDC\u91CC\u7684\u4EBA\u6253\u5F00\u94FE\u63A5\uFF0C\u5C31\u4EE5\u8FD9\u4E2A\u89D2\u8272\u52A0\u5165\u3002\u6240\u6709\u8005\u80FD\u770B\u5230\u8C01\u52A0\u5165\u4E86\uFF0C\u53EF\u4EE5\u6539\u89D2\u8272\u6216\u79FB\u51FA\u3002",copied:"\u5DF2\u590D\u5236",turnOn:"\u5F00\u542F",more:"\u66F4\u591A",linkOffNote:"\u5DF2\u5173\u95ED\uFF0C\u6CA1\u4EBA\u80FD\u7528\u5B83\u52A0\u5165",turnOnLink:"\u5F00\u542F\u94FE\u63A5",turnOffLink:"\u5173\u95ED\u94FE\u63A5",turnOffNote:"\u7528\u5B83\u52A0\u5165\u7684\u4EBA\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE",resetLink:"\u91CD\u7F6E\u94FE\u63A5",resetNote:"\u6362\u4E00\u4E2A\u65B0\u5730\u5740\uFF0C\u7528\u65E7\u94FE\u63A5\u52A0\u5165\u7684\u4EBA\u4F1A\u88AB\u79FB\u51FA",resetTitle:a=>`\u91CD\u7F6E\u300C${a}\u300D\u94FE\u63A5\uFF1F`,resetText:"\u65E7\u94FE\u63A5\u4F1A\u5931\u6548\uFF0C\u901A\u8FC7\u5B83\u52A0\u5165\u7684\u4EBA\u4E5F\u4F1A\u5931\u53BB\u8BBF\u95EE\u6743\u9650\u3002",cancel:"\u53D6\u6D88",failed:"\u6CA1\u80FD\u5B8C\u6210\uFF1A"}:{share:"Share",title:`Share this ${y.en}`,close:"Close",peopleWithAccess:"People with access",joinedPeople:"People who joined",generalAccess:"General access",inviteLinks:"Invite links",you:" (you)",thisComputer:"This computer",owner:"Owner",roleNames:{editor:"Editor",commenter:"Commenter",viewer:"Viewer"},linkTitles:{editor:"Can edit",commenter:"Can comment",viewer:"Can view"},roleNotes:{editor:"Edit and comment",commenter:x.reactions?"Comment and react, no edits":"Comment, no edits",viewer:"Read only"},changeRole:a=>`Change ${a}'s role`,linkOff:"Link off",online:"Online",seen:a=>`Seen ${a}`,paused:"Link off: no access until it is back on",none:"Nobody has joined yet. Send someone a link below.",remove:"Remove",removeTitle:a=>`Remove ${a}?`,removeText:`They lose access to this ${y.en}. They can join again with a link.`,onlyHere:"Only this computer",onlyHereNote:"Nobody else can open the links.",onLan:"Anyone on your network with a link",onLanNote:"People on the same Wi-Fi or LAN open it with a link; the link sets their role.",whereOff:"Only this computer can open these links.",whereOn:a=>`On this network at ${a}`,noAddress:"This computer has no local network address.",copyLink:"Copy link",onlyAccess:"Only people with access can open this link",guestInviteNote:"Whoever on your network opens one joins in that role. The owner sees who joined and can change or remove them.",copied:"Copied",turnOn:"Turn on",more:"More",linkOffNote:"Off: nobody can join with it",turnOnLink:"Turn on link",turnOffLink:"Turn off link",turnOffNote:"Whoever joined with it loses access until it is back on",resetLink:"Reset link",resetNote:"A new address; whoever joined with the old one is removed",resetTitle:a=>`Reset the "${a}" link?`,resetText:"The old link stops working and the people who joined with it lose access.",cancel:"Cancel",failed:"Could not do that: "},C=a=>{if(!a)return"";let e=Math.max(0,(Date.now()-Date.parse(a))/1e3),i=new Intl.RelativeTimeFormat(N?"zh-CN":"en",{numeric:"auto"});return e<60?i.format(0,"second"):e<3600?i.format(-Math.round(e/60),"minute"):e<86400?i.format(-Math.round(e/3600),"hour"):i.format(-Math.round(e/86400),"day")};function T(a){let e=a.trim();if(!e)return"?";if(/^[぀-ヿ㐀-鿿가-힯]/.test(e))return[...e][0];let i=e.split(/\s+/);return((i[0]?.[0]??"")+(i[1]?.[0]??"")).toUpperCase()||"?"}var E=["#3d7a6c","#56688f","#8f6249","#76598f","#857536","#995466","#45799a","#667a45"],$=a=>{let e=0;for(let i of a)e=e*31+i.charCodeAt(0)|0;return E[Math.abs(e)%E.length]},m=(a,e=16)=>`<svg viewBox="0 0 16 16" width="${e}" height="${e}" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${a}</svg>`,p={share:m('<circle cx="4" cy="8" r="2"/><circle cx="12" cy="3.5" r="2"/><circle cx="12" cy="12.5" r="2"/><path d="M5.8 7 10.2 4.5M5.8 9l4.4 2.5"/>',16),close:m('<path d="M4 4l8 8M12 4l-8 8"/>',18),chevron:m('<path d="M4.5 6.2 8 9.7l3.5-3.5"/>',14),check:m('<path d="M3 8.6 6.3 11.8 13 4.6"/>',18),trash:m('<path d="M2.6 4.2h10.8M6.3 4.2V2.7h3.4v1.5M4 4.2l.7 9.1h6.6l.7-9.1M6.7 6.7v4.2M9.3 6.7v4.2"/>',17),link:m('<path d="M6.8 9.2a2.5 2.5 0 0 0 3.5 0l2.3-2.3a2.5 2.5 0 0 0-3.5-3.5l-.8.8M9.2 6.8a2.5 2.5 0 0 0-3.5 0L3.4 9.1a2.5 2.5 0 0 0 3.5 3.5l.8-.8"/>',15),more:'<svg viewBox="0 0 16 16" width="16" height="16" fill="currentColor" aria-hidden="true"><circle cx="3.5" cy="8" r="1.25"/><circle cx="8" cy="8" r="1.25"/><circle cx="12.5" cy="8" r="1.25"/></svg>',lock:m('<rect x="3.5" y="7" width="9" height="6.5" rx="1.6"/><path d="M5.6 7V5.2a2.4 2.4 0 0 1 4.8 0V7"/>',17),network:m('<path d="M1.8 6.3a9 9 0 0 1 12.4 0M4 8.7a5.8 5.8 0 0 1 8 0M6.3 11a2.5 2.5 0 0 1 3.4 0"/><circle cx="8" cy="13.2" r=".5" fill="currentColor"/>',17),editor:m('<path d="M10.4 2.9 13.1 5.6 5.9 12.8l-3.3.6.6-3.3z"/><path d="M9.1 4.2l2.7 2.7"/>',16),commenter:m('<path d="M3 3h10a1.2 1.2 0 0 1 1.2 1.2v5.6A1.2 1.2 0 0 1 13 11H7.2l-3.2 2.6V11H3a1.2 1.2 0 0 1-1.2-1.2V4.2A1.2 1.2 0 0 1 3 3z"/>',16),viewer:m('<path d="M1.5 8S3.9 3.6 8 3.6 14.5 8 14.5 8 12.1 12.4 8 12.4 1.5 8 1.5 8z"/><circle cx="8" cy="8" r="2"/>',16)},O=`
2
+ :host { all: initial; color: inherit; font-family: inherit; }
3
+ * { box-sizing: border-box; }
4
+ .wrap { --bg: #fff; --fg: #1a1915; --muted: #72706a; --faint: #a6a49d; --line: #e9e7e2; --soft: #f2f1ee; --hover: #e9e8e4;
5
+ --check: #2563d9; --ok: #2f8a4c; --danger: #c13b2e; --shadow: 0 16px 48px rgba(20,18,14,.16), 0 2px 8px rgba(20,18,14,.06);
6
+ font: 14px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--fg);
7
+ -webkit-font-smoothing: antialiased; }
8
+ @media (prefers-color-scheme: dark) { .wrap { --bg: #262624; --fg: #f3f2ef; --muted: #aaa8a2; --faint: #77756f; --line: #3a3936; --soft: #31302e; --hover: #3b3a37;
9
+ --check: #6ea2ff; --danger: #f07a6c; --shadow: 0 16px 48px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.3); } }
10
+ button { font: inherit; color: inherit; cursor: pointer; margin: 0; }
11
+ button:focus-visible { outline: 2px solid var(--check); outline-offset: 2px; }
12
+ button:disabled { cursor: default; }
13
+ svg { display: block; flex: none; }
14
+
15
+ /* The button wears its bar's colour and type, like the buttons beside it. */
16
+ .wrap.seat { color: inherit; font-family: inherit; }
17
+ .open { position: relative; height: 28px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 400; line-height: 1; white-space: nowrap; transition: background-color .12s ease-out; }
18
+ .open:hover, .open[aria-expanded="true"] { background: color-mix(in srgb, currentColor 6%, transparent); }
19
+ .open.bar { height: 24px; padding: 0 6px; border-radius: 6px; font-size: 13px; gap: 5px; }
20
+ .open.tool { width: 24px; height: 24px; padding: 0; border-radius: 6px; justify-content: center; }
21
+ .open.float { height: 32px; padding: 0 12px; color: var(--fg); background: var(--bg); box-shadow: 0 1px 3px rgba(20,18,14,.12), 0 0 0 1px rgba(20,18,14,.04); font-size: 13px; font-weight: 500; }
22
+ .open.float:hover, .open.float[aria-expanded="true"] { background: var(--soft); }
23
+ .open .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: none; }
24
+ .open.tool .dot { position: absolute; top: 2px; right: 2px; width: 5px; height: 5px; }
25
+
26
+ .pop { position: fixed; z-index: 2147483000; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
27
+ .caret { position: fixed; z-index: 2147483001; width: 14px; height: 14px; background: var(--bg); border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); border-radius: 3px 0 0 0; }
28
+ .body { overflow: auto; padding: 18px 20px 20px; overscroll-behavior: contain; }
29
+ .head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
30
+ h2 { flex: 1; min-width: 0; margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
31
+ .label { color: var(--muted); font-size: 13px; margin: 18px 0 8px; }
32
+
33
+ .row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 4px 0; }
34
+ .who { flex: 1; min-width: 0; }
35
+ .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
36
+ .name .faint { color: var(--muted); }
37
+ .sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
38
+ .sub.on { color: var(--ok); }
39
+ .sub.multi { white-space: normal; overflow-wrap: anywhere; }
40
+ .avatar { position: relative; width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-size: 13.5px; font-weight: 600; letter-spacing: .02em; }
41
+ .avatar.on::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--bg); }
42
+ .circle { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--soft); color: var(--fg); }
43
+ .off .circle, .off .who { opacity: .5; }
44
+ .paused .avatar { filter: grayscale(1); opacity: .55; }
45
+
46
+ .icon { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; display: grid; place-items: center; color: var(--fg); flex: none; }
47
+ .icon:hover { background: var(--soft); }
48
+ .icon.muted { color: var(--muted); }
49
+ .select { height: 32px; border: 0; border-radius: 8px; background: transparent; padding: 0 8px 0 10px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
50
+ .select:hover, .select[aria-expanded="true"] { background: var(--soft); }
51
+ .select.static { color: var(--faint); cursor: default; }
52
+ .select.static:hover { background: transparent; }
53
+ .select.wide { margin-left: -10px; max-width: 100%; font-weight: 500; }
54
+ .select.wide span { overflow: hidden; text-overflow: ellipsis; }
55
+ .pill { height: 32px; border: 0; border-radius: 8px; background: var(--soft); padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 500; font-size: 13.5px; flex: none; }
56
+ .pill:hover { background: var(--hover); }
57
+ .pill.done { color: var(--ok); }
58
+ .empty { color: var(--muted); font-size: 13px; padding: 6px 0 2px; }
59
+ .err { color: var(--danger); font-size: 12.5px; margin-top: 12px; }
60
+ .hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
61
+ .rule { height: 1px; background: var(--line); margin: 16px -20px 0; }
62
+ .foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
63
+ .foot .note { flex: 1; min-width: 0; color: var(--muted); font-size: 13.5px; }
64
+
65
+ .menu { position: fixed; z-index: 2147483002; min-width: 200px; max-width: min(340px, calc(100vw - 24px)); padding: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
66
+ .item { width: 100%; display: flex; align-items: center; gap: 16px; text-align: left; border: 0; background: transparent; border-radius: 9px; padding: 8px 10px 8px 12px; }
67
+ .item:hover:not(:disabled), .item:focus-visible { background: var(--soft); outline: none; }
68
+ .item:disabled { opacity: .45; }
69
+ .item .who { display: flex; flex-direction: column; }
70
+ .item .sub { white-space: normal; }
71
+ .item.danger .name { color: var(--danger); }
72
+ .item .tick { width: 18px; color: var(--check); }
73
+
74
+ .ask { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(2px); }
75
+ .ask-card { width: 100%; max-width: 360px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 18px; }
76
+ .ask h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
77
+ .ask p { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
78
+ .ask-row { display: flex; justify-content: flex-end; gap: 8px; }
79
+ .btn { height: 34px; border-radius: 8px; padding: 0 14px; border: 0; background: var(--soft); font-weight: 500; }
80
+ .btn:hover { background: var(--hover); }
81
+ .btn.danger { background: var(--danger); color: #fff; }
82
+ .btn.danger:hover { filter: brightness(.94); }
83
+ `;function n(a,e={},...i){let s=document.createElement(a);for(let[o,r]of Object.entries(e))o==="class"?s.className=r:o==="html"?s.innerHTML=r:s.setAttribute(o,r);return s.append(...i),s}function g(a,e,i,s,o){let r=n("button",{class:a,type:"button",...e});return i&&r.insertAdjacentHTML("beforeend",i),s!==void 0&&r.append(n("span",{},s)),o&&r.insertAdjacentHTML("beforeend",o),r}async function A(a){let e=await fetch("/__share",a?{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}:{cache:"no-store"}),i=await e.json();if(!e.ok)throw new Error(i?.message??`HTTP ${e.status}`);return i}async function S(a){try{await navigator.clipboard.writeText(a)}catch{let e=n("textarea",{style:"position:fixed;opacity:0"});e.value=a,document.body.append(e),e.select(),document.execCommand("copy"),e.remove()}}var L=class{host=n("span",{"data-baoyu-share":""});root=this.host.attachShadow({mode:"open"});wrap=n("div",{class:"wrap seat"});button=n("button",{class:"open float",type:"button","aria-haspopup":"dialog","aria-expanded":"false"});look="float";layer=n("div",{"data-baoyu-share-layer":""});layerRoot=this.layer.attachShadow({mode:"open"});layerWrap=n("div",{class:"wrap"});pop=null;caret=n("div",{class:"caret"});menu=null;menuAnchor=null;menuJustClosed=null;asking=null;view=null;invites=null;error="";timer;copied=null;constructor(){this.root.append(n("style",{},O),this.wrap),this.layerRoot.append(n("style",{},O),this.layerWrap),this.wrap.append(this.button),this.button.addEventListener("click",()=>this.pop?this.close():void this.open()),this.paintButton(),k&&A().then(e=>{this.view=e,this.paintButton()},()=>{})}mount(){let e=()=>{let i=H();if(!i){this.host.isConnected||(this.host.style.cssText="position:fixed;top:10px;right:120px;z-index:2147482000",document.body.append(this.host),this.setLook("float"));return}let[s,o,r]=i;s==="into"&&this.host.parentNode!==o&&o.append(this.host),s==="first"&&o.firstChild!==this.host&&o.prepend(this.host),s==="before"&&o.previousSibling!==this.host&&o.before(this.host),this.host.style.cssText="display:inline-flex;align-items:center",this.setLook(r),this.pop&&this.position()};e(),new MutationObserver(e).observe(document.body,{childList:!0,subtree:!0}),window.setInterval(e,1500)}setLook(e){e!==this.look&&(this.look=e,this.button.className=`open ${e}`,this.paintButton())}paintButton(){let e=k&&!!this.view?.lan;this.button.innerHTML=p.share,this.look==="tool"?(this.button.setAttribute("aria-label",t.share),this.button.title=e?`${t.share} \xB7 ${t.onLan}`:t.share):(this.button.removeAttribute("aria-label"),this.button.removeAttribute("title"),this.button.append(t.share)),e&&this.button.append(n("span",{class:"dot",title:t.onLan}))}async open(){if(this.pop)return;this.pop=n("div",{class:"pop",role:"dialog","aria-label":t.title}),this.layerWrap.append(this.pop,this.caret),document.body.append(this.layer),this.button.setAttribute("aria-expanded","true"),document.addEventListener("mousedown",this.onPointer,!0),window.addEventListener("keydown",this.onKey,!0),window.addEventListener("resize",this.position),window.addEventListener("scroll",this.position,!0),this.position();let e=k?()=>this.refresh():()=>this.refreshInvites();k||this.paintGuest(),await e(),this.timer=window.setInterval(()=>void e(),4e3)}close(){window.clearInterval(this.timer),document.removeEventListener("mousedown",this.onPointer,!0),window.removeEventListener("keydown",this.onKey,!0),window.removeEventListener("resize",this.position),window.removeEventListener("scroll",this.position,!0),this.closeMenu(),this.asking=null,this.pop?.remove(),this.pop=null,this.caret.remove(),this.layer.remove(),this.button.setAttribute("aria-expanded","false"),this.button.focus()}position=()=>{if(!this.pop)return;let e=window.innerWidth,i=window.innerHeight,s=this.button.getBoundingClientRect(),o=s.width>0&&s.bottom>0&&s.top<i,r=Math.min(460,e-24),c=o?s.right:e-16,h=Math.max(12,Math.min(c-r,e-r-12)),d=o?s.bottom+10:56;if(Object.assign(this.pop.style,{left:`${h}px`,top:`${d}px`,width:`${r}px`,maxHeight:`${Math.max(240,i-d-12)}px`}),o){let v=Math.max(h+18,Math.min(s.left+s.width/2-7,h+r-32));Object.assign(this.caret.style,{display:"",left:`${v}px`,top:`${d-7}px`})}else this.caret.style.display="none";this.menu&&this.menuAnchor&&this.placeMenu(this.menu,this.menuAnchor)};onPointer=e=>{let i=e.composedPath();this.menu&&!i.includes(this.menu)&&(this.menuJustClosed=this.menuAnchor,this.closeMenu(),setTimeout(()=>this.menuJustClosed=null,0)),!(!this.pop||i.includes(this.pop)||i.includes(this.host)||this.menu&&i.includes(this.menu))&&this.close()};onKey=e=>{if(e.key==="Escape")if(e.stopPropagation(),e.preventDefault(),this.asking)this.asking();else if(this.menu){let i=this.menuAnchor;this.closeMenu(),i?.focus()}else this.close()};async refresh(e){let i=JSON.stringify([this.view,this.error]);try{this.view=await A(e),this.error=""}catch(s){this.error=t.failed+s.message}this.paintButton(),!(!e&&(this.menu||this.asking||this.pop?.firstChild&&JSON.stringify([this.view,this.error])===i))&&this.paint()}async refreshInvites(){let e=JSON.stringify([this.invites,this.error]);try{let i=await fetch("/__share/invite",{cache:"no-store"}),s=await i.json();if(!i.ok)throw new Error(s?.message??`HTTP ${i.status}`);this.invites=s.links,this.error=""}catch(i){this.error=t.failed+i.message}JSON.stringify([this.invites,this.error])!==e&&this.paintGuest()}openMenu(e,i){if(this.menuJustClosed===e)return;this.closeMenu();let s=n("div",{class:"menu",role:"menu"});for(let o of i){let r=n("button",{class:`item${o.danger?" danger":""}`,type:"button",role:o.checked===void 0?"menuitem":"menuitemradio"});o.checked!==void 0&&r.setAttribute("aria-checked",String(o.checked)),r.disabled=o.disabled===!0,r.append(n("span",{class:"who"},n("span",{class:"name"},o.label),...o.sub?[n("span",{class:"sub"},o.sub)]:[])),o.checked!==void 0&&r.append(n("span",{class:"tick",html:o.checked?p.check:""})),r.addEventListener("click",()=>{this.closeMenu(),e.focus({preventScroll:!0}),o.run()}),s.append(r)}s.addEventListener("keydown",o=>{let r=[...s.querySelectorAll("button:not(:disabled)")],c=r.indexOf(this.layerRoot.activeElement),h=d=>r[(d+r.length)%r.length]?.focus();if(o.key==="ArrowDown")h(c+1);else if(o.key==="ArrowUp")h(c-1);else if(o.key==="Home")h(0);else if(o.key==="End")h(-1);else if(o.key==="Tab")this.closeMenu();else return;o.preventDefault()}),this.menu=s,this.menuAnchor=e,e.setAttribute("aria-expanded","true"),this.layerWrap.append(s),this.placeMenu(s,e),(s.querySelector('[aria-checked="true"]:not(:disabled)')??s.querySelector("button:not(:disabled)"))?.focus({preventScroll:!0})}placeMenu(e,i){let s=i.getBoundingClientRect(),o=e.getBoundingClientRect(),r=window.innerWidth,c=window.innerHeight,d=i.classList.contains("wide")?s.left:s.right-o.width;d=Math.max(12,Math.min(d,r-o.width-12));let v=s.bottom+6;v+o.height>c-12&&s.top-o.height-6>12&&(v=s.top-o.height-6),Object.assign(e.style,{left:`${d}px`,top:`${v}px`})}closeMenu(){this.menu?.remove(),this.menuAnchor?.setAttribute("aria-expanded","false"),this.menu=null,this.menuAnchor=null}ask(e,i,s){return new Promise(o=>{if(!this.pop)return o(!1);this.closeMenu();let r=n("div",{class:"ask",role:"alertdialog","aria-modal":"true","aria-label":e}),c=g("btn",{},"",t.cancel),h=g("btn danger",{},"",s),d=v=>{this.asking=null,r.remove(),o(v)};c.addEventListener("click",()=>d(!1)),h.addEventListener("click",()=>d(!0)),r.addEventListener("mousedown",v=>v.target===r&&d(!1)),r.append(n("div",{class:"ask-card"},n("h3",{},e),n("p",{},i),n("div",{class:"ask-row"},c,h))),this.asking=()=>d(!1),this.pop.append(r),c.focus()})}paint(){if(!this.pop||!this.view)return;let e=this.view,i=this.layerRoot.activeElement?.getAttribute("data-key"),s=this.pop.querySelector(".body")?.scrollTop??0,o=n("div",{class:"body"}),r=g("icon muted",{"aria-label":t.close,title:t.close,"data-key":"close"},p.close);r.addEventListener("click",()=>this.close()),o.append(n("div",{class:"head"},n("h2",{},e.title||t.title),r)),o.append(n("div",{class:"label"},t.peopleWithAccess));let c=x.name??"";o.append(n("div",{class:"row"},n("div",{class:"avatar",style:`background:${$("local"+c)}`},T(c)),n("div",{class:"who"},n("div",{class:"name"},c,n("span",{class:"faint"},t.you)),n("div",{class:"sub"},t.thisComputer)),n("span",{class:"select static",html:`<span>${t.owner}</span>${p.chevron}`}))),o.append(n("div",{class:"label"},t.joinedPeople)),e.guests.length||o.append(n("div",{class:"empty"},t.none));for(let l of[...e.guests].sort((u,f)=>Number(f.online)-Number(u.online)||(f.seen??f.joined).localeCompare(u.seen??u.joined))){let u=l.online?t.online:l.active?t.seen(C(l.seen??l.joined)):t.paused,f=g("select",{"aria-haspopup":"menu","aria-expanded":"false","aria-label":t.changeRole(l.name),"data-key":`role-${l.id}`},"",t.roleNames[l.role],p.chevron);f.addEventListener("click",()=>this.openMenu(f,M.map(w=>({label:t.roleNames[w],sub:e.links[w].on?void 0:t.linkOff,checked:w===l.role,disabled:!e.links[w].on,run:()=>w!==l.role&&void this.refresh({action:"role",guest:l.id,role:w})}))));let b=g("icon muted",{"aria-label":`${t.remove} ${l.name}`,title:t.remove,"data-key":`rm-${l.id}`},p.trash);b.addEventListener("click",async()=>{await this.ask(t.removeTitle(l.name),t.removeText,t.remove)&&this.refresh({action:"remove",guest:l.id})}),o.append(n("div",{class:`row${l.active?"":" paused"}`},n("div",{class:`avatar${l.online?" on":""}`,style:`background:${$(l.id)}`},T(l.name)),n("div",{class:"who"},n("div",{class:"name"},l.name),n("div",{class:`sub${l.online?" on":""}`},u)),f,b))}o.append(n("div",{class:"label"},t.generalAccess));let h=e.lan?e.addresses.length?t.whereOn(e.addresses.map(l=>`${l}:${e.port}`).join(" \xB7 ")):t.noAddress:t.whereOff,d=g("select wide",{"aria-haspopup":"menu","aria-expanded":"false","data-key":"lan"},"",e.lan?t.onLan:t.onlyHere,p.chevron);d.addEventListener("click",()=>this.openMenu(d,[{label:t.onlyHere,sub:t.onlyHereNote,checked:!e.lan,run:()=>e.lan&&void this.refresh({action:"lan",on:!1})},{label:t.onLan,sub:t.onLanNote,checked:e.lan,run:()=>!e.lan&&void this.refresh({action:"lan",on:!0})}])),o.append(n("div",{class:"row"},n("div",{class:"circle",html:e.lan?p.network:p.lock}),n("div",{class:"who"},d,n("div",{class:"sub multi"},h)))),o.append(n("div",{class:"label"},t.inviteLinks));for(let l of M){let u=e.links[l],f;u.on?f=this.copyButton(l,u.url):(f=g("pill",{"data-key":`copy-${l}`},"",t.turnOn),f.addEventListener("click",()=>void this.refresh({action:"link",role:l,on:!0})));let b=g("icon muted",{"aria-haspopup":"menu","aria-expanded":"false","aria-label":`${t.more}: ${t.linkTitles[l]}`,title:t.more,"data-key":`more-${l}`},p.more);b.addEventListener("click",()=>this.openMenu(b,[u.on?{label:t.turnOffLink,sub:t.turnOffNote,run:()=>void this.refresh({action:"link",role:l,on:!1})}:{label:t.turnOnLink,run:()=>void this.refresh({action:"link",role:l,on:!0})},{label:t.resetLink,sub:t.resetNote,danger:!0,run:async()=>{await this.ask(t.resetTitle(t.linkTitles[l]),t.resetText,t.resetLink)&&this.refresh({action:"reset",role:l})}}])),o.append(n("div",{class:`row${u.on?"":" off"}`,title:u.on?u.url:""},n("div",{class:"circle",html:p[l]}),n("div",{class:"who"},n("div",{class:"name"},t.linkTitles[l]),n("div",{class:"sub"},u.on?t.roleNotes[l]:t.linkOffNote)),f,b))}this.error&&o.append(n("div",{class:"err",role:"alert"},this.error)),this.pop.replaceChildren(o),o.scrollTop=s,this.position(),((i?o.querySelector(`[data-key="${i}"]`):null)??r).focus({preventScroll:!0})}paintGuest(){if(!this.pop)return;let e=this.layerRoot.activeElement?.getAttribute("data-key"),i=n("div",{class:"body"}),s=g("icon muted",{"aria-label":t.close,title:t.close,"data-key":"close"},p.close);if(s.addEventListener("click",()=>this.close()),i.append(n("div",{class:"head"},n("h2",{},x.title||document.title||t.title),s)),this.invites?.length){i.append(n("div",{class:"label"},t.inviteLinks));for(let{role:r,url:c}of this.invites)i.append(n("div",{class:"row",title:c},n("div",{class:"circle",html:p[r]}),n("div",{class:"who"},n("div",{class:"name"},t.linkTitles[r]),n("div",{class:"sub"},t.roleNotes[r])),this.copyButton(r,c)));i.append(n("div",{class:"hint"},t.guestInviteNote),n("div",{class:"rule"}))}i.append(n("div",{class:"foot"},n("div",{class:"note"},t.onlyAccess),this.copyButton("page",location.origin+location.pathname))),this.error&&i.append(n("div",{class:"err",role:"alert"},this.error)),this.pop.replaceChildren(i),this.position(),((e?i.querySelector(`[data-key="${e}"]`):null)??s).focus({preventScroll:!0})}copyButton(e,i){let s=this.copied===e,o=g(`pill${s?" done":""}`,{"data-key":`copy-${e}`},s?p.check:p.link,s?t.copied:t.copyLink),r=()=>k?this.paint():this.paintGuest();return o.addEventListener("click",async()=>{await S(i),this.copied=e,r(),setTimeout(()=>{this.copied===e&&(this.copied=null,!this.menu&&!this.asking&&r())},1600)}),o}};function H(){let a=document.querySelector("[data-baoyu-share-seat]")??document.querySelector("[data-baoyu-comments]")?.shadowRoot?.querySelector("[data-baoyu-share-seat]");if(a)return["into",a,"header"];let e=document.querySelector('[data-testid="ldoc-comments-btn"]'),i=e?.closest(".ml-auto")??e?.parentElement?.parentElement;if(i)return["first",i,"header"];let s=document.querySelector("[data-baoyu-comments-seat]");if(s)return["before",s,"tool"];let o=document.querySelector("header.tb-root .tb-card-end");return o?["first",o,"bar"]:null}var R=()=>new L().mount();document.readyState==="loading"?document.addEventListener("DOMContentLoaded",R,{once:!0}):R();