showai-reader 0.9.0 → 0.10.0-reader.uevm5c4a
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.
- package/README.md +2 -2
- package/chunks/CardGrid-B5ZPO2BI.js +2 -0
- package/chunks/CommandReference-HHKCV753.js +3 -0
- package/chunks/ComparisonMatrix-RIUGQRNA.js +1 -0
- package/chunks/EventTimeline-AEWZDJSH.js +2 -0
- package/chunks/ExperimentTracker-W2H5ZDFY.js +1 -0
- package/chunks/{ExternalDiagram-3BONLRGZ.js → ExternalDiagram-SIOOYLR7.js} +7924 -4810
- package/chunks/Flowchart-6ZTZQZXC.js +12 -0
- package/chunks/{G2Chart-GQH7Q6PL.js → G2Chart-CWQQA4ZV.js} +2 -2
- package/chunks/LayerDiagram-GTULFZZP.js +2 -0
- package/chunks/{Mindmap-UMIFB7CR.js → Mindmap-7GTBDPMC.js} +2 -2
- package/chunks/RichTextEditor-PNTZXV2D.js +155 -0
- package/chunks/Roadmap-7TFBP7BZ.js +2 -0
- package/chunks/{Scene3D-J7TCRL6V.js → Scene3D-YUDPPF42.js} +2 -2
- package/chunks/SequenceDiagram-RWUR35XN.js +2 -0
- package/chunks/StatusTree-VXXL53J4.js +1 -0
- package/chunks/StepGuide-GJ3LBGVS.js +1 -0
- package/chunks/StructureBrowser-LXVTJ4CR.js +3 -0
- package/chunks/Waterfall-T4FNP6RH.js +2 -0
- package/chunks/chunk-2CCUVSMI.js +1 -0
- package/chunks/chunk-2YDDS4TW.js +1 -0
- package/chunks/{chunk-MPVTJQTD.js → chunk-36N4B6F4.js} +2 -2
- package/chunks/chunk-3RZMLHCB.js +1 -0
- package/chunks/{chunk-WDYURK6F.js → chunk-5AW2WUSZ.js} +1 -1
- package/chunks/chunk-7G6RMB6W.js +5 -0
- package/chunks/chunk-AIBH6MTQ.js +1 -0
- package/chunks/chunk-DCANE7XH.js +1 -0
- package/chunks/chunk-DVIFPZLZ.js +2 -0
- package/chunks/chunk-GLP5VV7P.js +1 -0
- package/chunks/chunk-IBO6QHGV.js +4 -0
- package/chunks/chunk-J6IRWTF7.js +1 -0
- package/chunks/chunk-JXKAISUX.js +1 -0
- package/chunks/{chunk-CEJFAFXK.js → chunk-LSZMAKEI.js} +43 -40
- package/chunks/chunk-LWAPR3HQ.js +1 -0
- package/chunks/{chunk-LY26FKQZ.js → chunk-MENLQ7WW.js} +1 -1
- package/chunks/chunk-MGSP3OGB.js +9 -0
- package/chunks/chunk-N2G7RUAJ.js +1 -0
- package/chunks/{chunk-SWLYSV5D.js → chunk-P2CMIXOU.js} +1 -1
- package/chunks/chunk-S4EP5SMX.js +21 -0
- package/chunks/{chunk-4QSHXFHM.js.LEGAL.txt → chunk-S4EP5SMX.js.LEGAL.txt} +24 -8
- package/chunks/{chunk-7GHGKKPY.js → chunk-SNEZ3O5V.js} +1 -1
- package/chunks/{chunk-LAAA5HWB.js → chunk-VRAMSIGC.js} +1 -1
- package/chunks/chunk-XI4I5HQF.js +1 -0
- package/chunks/code-highlighting-F3WJZEML.js +1 -0
- package/chunks/{pdf-engine-PQMJ3BVE.js → pdf-engine-XQHKQXXX.js} +1 -1
- package/index.js +1 -1
- package/manifest.json +6 -5
- package/package.json +1 -1
- package/reader-UEVM5C4A.js +46 -0
- package/chunks/ComparisonMatrix-SYFIP5WP.js +0 -1
- package/chunks/ExperimentTracker-HOUNXCEC.js +0 -1
- package/chunks/Flowchart-72CIZ5IT.js +0 -10
- package/chunks/RichTextEditor-YMFOBGOU.js +0 -155
- package/chunks/StatusTree-MDKGDYK5.js +0 -1
- package/chunks/chunk-4QSHXFHM.js +0 -21
- package/chunks/chunk-6WHB3GS2.js +0 -2
- package/chunks/chunk-DUIGVKKG.js +0 -1
- package/chunks/chunk-M3KEZP5Z.js +0 -1
- package/chunks/chunk-QSELZI5S.js +0 -1
- package/chunks/chunk-YSVZKKKM.js +0 -1
- package/reader-N3YKYCK3.js +0 -40
- /package/chunks/{Flowchart-72CIZ5IT.js.LEGAL.txt → Flowchart-6ZTZQZXC.js.LEGAL.txt} +0 -0
- /package/chunks/{G2Chart-GQH7Q6PL.js.LEGAL.txt → G2Chart-CWQQA4ZV.js.LEGAL.txt} +0 -0
- /package/chunks/{Scene3D-J7TCRL6V.js.LEGAL.txt → Scene3D-YUDPPF42.js.LEGAL.txt} +0 -0
- /package/chunks/{chunk-MPVTJQTD.js.LEGAL.txt → chunk-36N4B6F4.js.LEGAL.txt} +0 -0
- /package/{reader-N3YKYCK3.js.LEGAL.txt → reader-UEVM5C4A.js.LEGAL.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r=n=>{throw new Error(n)},b=n=>!!n&&typeof n=="object"&&!Array.isArray(n);function c(n,t){(typeof n!="string"||!n.trim())&&r(`${t} must be non-empty text.`)}function a(n,t){n!==void 0&&c(n,t)}function $(n,t,e,s=0){return(!Array.isArray(n)||n.length<s||n.length>e)&&r(`${t} must be an array of ${s} to ${e} items.`),n.forEach((o,i)=>{b(o)||r(`${t}[${i}] must be an object.`)}),n}function d(n,t,e){c(t,e),n.has(t)&&r(`${e} duplicates id ${t}.`),n.add(t)}function y(n,t){n!==void 0&&!u.includes(n)&&r(`${t} must be one of ${u.join(", ")}.`)}var u=["accent","teal","orange","violet","rose","slate"],x=["accent","teal","violet","orange","rose","slate"],m=["call","reply","note"],p={actors:8,steps:40},h={layers:8,modules:12};function g(n){a(n.description,"description");let t=new Set;$(n.actors,"actors",p.actors,1).forEach((e,s)=>{let o=`actors[${s}]`;d(t,e.id,`${o}.id`),c(e.label,`${o}.label`),a(e.sub,`${o}.sub`),a(e.icon,`${o}.icon`),e.icon!==void 0&&Array.from(e.icon).length>8&&r(`${o}.icon must be a single emoji or short symbol.`),y(e.tone,`${o}.tone`)}),$(n.steps,"steps",p.steps,1).forEach((e,s)=>{let o=`steps[${s}]`;for(let i of["from","to"])c(e[i],`${o}.${i}`),t.has(e[i])||r(`${o}.${i} ${e[i]} does not match an actor id.`);c(e.label,`${o}.label`),a(e.detail,`${o}.detail`),e.kind!==void 0&&!m.includes(e.kind)&&r(`${o}.kind must be one of ${m.join(", ")}.`)})}function S(n){a(n.caption,"caption");let t=new Set,e=new Set;$(n.layers,"layers",h.layers,1).forEach((s,o)=>{let i=`layers[${o}]`;d(t,s.id,`${i}.id`),c(s.name,`${i}.name`),a(s.sub,`${i}.sub`),y(s.tone,`${i}.tone`),$(s.modules,`${i}.modules`,h.modules).forEach((f,E)=>{let l=`${i}.modules[${E}]`;d(e,f.id,`${l}.id`),c(f.name,`${l}.name`),a(f.path,`${l}.path`),a(f.detail,`${l}.detail`)})}),n.initial!==void 0&&(c(n.initial,"initial"),e.has(n.initial)||r(`initial ${n.initial} does not match a module id.`))}function A(n,t){return b(t)||r("Component data must be an object."),a(t.title,"title"),n==="sequence-diagram"?g(t):n==="layer-diagram"?S(t):r(`Unknown diagram component ${n}.`),t}function j(n){return typeof n!="string"?[]:n.split(/\n+/).map(t=>t.trim()).filter(Boolean)}export{u as a,x as b,A as c,j as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(b,a)=>()=>{try{return a||b((a={exports:{}}).exports,a),a.exports}catch(c){throw a=0,c}},n=(b,a)=>{for(var c in a)e(b,c,{get:a[c],enumerable:!0})},l=(b,a,c,f)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of i(a))!k.call(b,d)&&d!==c&&e(b,d,{get:()=>a[d],enumerable:!(f=h(a,d))||f.enumerable});return b};var o=(b,a,c)=>(c=b!=null?g(j(b)):{},l(a||!b||!b.__esModule?e(c,"default",{value:b,enumerable:!0}):c,b));export{m as a,n as b,o as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as g,c as C,hb as x,ib as H,kb as w}from"./chunk-S4EP5SMX.js";import{a as v}from"./chunk-J6IRWTF7.js";import{c as l}from"./chunk-DCANE7XH.js";g(`.editor-tool{display:inline-flex;align-items:center;justify-content:center;width:28px;height:29px;padding:0;flex-shrink:0;color:var(--muted);border:0;border-radius:4px;background:transparent}.editor-tool svg{stroke-width:1.65}.editor-tool:hover,.editor-tool.is-active{color:var(--accent);background:var(--editor-soft)}.editor-tool:disabled{opacity:.32}.editor-bubble{--editor-line: var(--line, #e8ece5);--editor-soft: var(--accent-soft, #edf2e9);position:fixed;z-index:80;display:flex;align-items:center;gap:2px;padding:5px;border:1px solid var(--line, #e8ece5);border-radius:6px;background:var(--paper, #fff);color:var(--text, #343a35);font-family:var(--font-ui, system-ui, sans-serif);font-size:12px;font-weight:400;line-height:1.2;letter-spacing:normal;box-shadow:0 5px 20px #2434291c;animation:editor-menu-appear .13s ease;max-width:calc(100vw - 16px);overflow-x:auto}@keyframes editor-menu-appear{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.editor-bubble{animation:none!important;transition:none!important}}@media print{.editor-bubble{display:none!important}}
|
|
2
|
+
`);var i=l(C(),1),h=l(H(),1);var y=v("editor",{"zh-CN":{selectionToolbar:"\u9009\u4E2D\u6587\u5B57\u683C\u5F0F"},en:{selectionToolbar:"Selected text formatting"}});var k=l(x(),1);function O({id:M,anchor:n,anchorElement:t,children:L,onEscape:E,label:T,keyboardScope:z,viewportTop:d=8,className:b}){let R=w(y),u=(0,i.useRef)(null),[D,S]=(0,i.useState)(n);return(0,i.useLayoutEffect)(()=>{let e=u.current,r=()=>{let{width:o,height:c}=e.getBoundingClientRect(),a=t?.isConnected?t.getBoundingClientRect():null,s=a?{left:(a.left+a.right)/2,top:a.top,bottom:a.bottom}:n,m={left:Math.max(8,Math.min(s.left-o/2,window.innerWidth-o-8)),top:Math.max(d,Math.min(s.top-c-8>=d?s.top-c-8:(s.bottom??s.top)+8,window.innerHeight-c-8))};S(f=>f.left===m.left&&f.top===m.top?f:m)};r();let p=new ResizeObserver(r);if(p.observe(e),t)for(let o=t;o;o=o.parentElement)p.observe(o);return window.addEventListener("resize",r),t&&window.addEventListener("scroll",r,!0),()=>{p.disconnect(),window.removeEventListener("resize",r),t&&window.removeEventListener("scroll",r,!0)}},[n.left,n.top,n.bottom,t,d]),(0,h.createPortal)((0,k.jsx)("div",{ref:u,id:M,className:`editor-bubble${b?` ${b}`:""}`,"data-editor-menu-trigger":"selection","data-editor-keyboard-scope":z,role:"toolbar","aria-label":T??R("selectionToolbar"),style:D,onMouseDown:e=>{e.target.closest("input,select,textarea")||e.preventDefault()},onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),E())},children:L}),document.body)}export{O as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var b=new Set(["request","skill","decision","reference","query","result"]),E=new Set(["__proto__","prototype","constructor"]),y=["ok","warn","bad","idle","active"],p=new Set(y);function s(e,n,o=!1,t=1e4){if(!(e===void 0&&!o)&&(typeof e!="string"||e.length>t||o&&!e.trim()))throw new Error(`${n} must be ${o?"non-empty ":""}text.`)}function l(e,n,o){if(!Array.isArray(e)||e.length>o)throw new Error(`${n} must contain at most ${o} items.`);let t=new Set;for(let r of e){if(!r||typeof r!="object"||Array.isArray(r))throw new Error(`${n} requires objects.`);if(s(r.id,`${n}.id`,!0,200),E.has(r.id)||t.has(r.id))throw new Error(`${n} requires unique, non-reserved IDs.`);t.add(r.id)}return t}function A(e){if(s(e.title,"flowchart.title"),s(e.description,"flowchart.description"),e.height!==void 0&&(!Number.isFinite(e.height)||e.height<360||e.height>1200))throw new Error("Flowchart height must be between 360 and 1200.");l(e.flows,"flowchart.flows",20);for(let n of e.flows){if(s(n.label,"flow.label",!0,200),s(n.description,"flow.description"),n.direction!==void 0&&!["TB","LR"].includes(n.direction))throw new Error("Flow direction must be TB or LR.");let o=l(n.nodes,"flow.nodes",200);l(n.edges,"flow.edges",400);for(let t of n.nodes){s(t.label,"node.label",!0,200),s(t.subtitle,"node.subtitle",!1,300),s(t.detail,"node.detail");for(let r of["sourceSide","targetSide"])if(t[r]!==void 0&&!["top","bottom","left","right"].includes(t[r]))throw new Error(`${r} must be a valid connection side.`);if(t.kind!==void 0&&!b.has(t.kind))throw new Error("Unsupported flow node kind.");for(let r of["commands","references"])if(t[r]!==void 0){if(!Array.isArray(t[r])||t[r].length>30)throw new Error(`${r} must have at most 30 entries.`);t[r].forEach(d=>s(d,r,!0,3e3))}if(t.position&&(!Number.isFinite(t.position.x)||!Number.isFinite(t.position.y)))throw new Error("Node positions must be finite.")}for(let t of n.edges){if(!o.has(t.source)||!o.has(t.target))throw new Error(`Flow edge ${t.id} references a missing node.`);s(t.label,"edge.label",!1,300)}S(n,`flowchart.flows[${e.flows.indexOf(n)}]`)}return e}function $(e,n){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${n} must be an object.`)}function S(e,n){let o=new Set(e.nodes.map(r=>r.id)),t=new Map(e.edges.map(r=>[r.id,r]));if(e.journeys!==void 0){let r=l(e.journeys,`${n}.journeys`,12);if(e.journeys.forEach((d,a)=>{let f=`${n}.journeys[${a}]`;if(s(d.label,`${f}.label`,!0,200),s(d.summary,`${f}.summary`,!1,1e3),!Array.isArray(d.steps)||!d.steps.length||d.steps.length>60)throw new Error(`${f}.steps must contain 1 to 60 steps.`);d.steps.forEach((i,h)=>{let c=`${f}.steps[${h}]`;if($(i,c),!o.has(i.node))throw new Error(`${c}.node references a missing node.`);if(s(i.title,`${c}.title`,!0,200),s(i.text,`${c}.text`,!0,3e3),i.edge===void 0)return;let u=t.get(i.edge);if(!u)throw new Error(`${c}.edge references a missing edge.`);if(u.source!==i.node&&u.target!==i.node)throw new Error(`${c}.edge must connect to node ${i.node}.`)})}),e.initialJourney!==void 0&&!r.has(e.initialJourney))throw new Error(`${n}.initialJourney references a missing journey.`)}else if(e.initialJourney!==void 0)throw new Error(`${n}.initialJourney requires journeys.`);if(e.stages!==void 0){let r=l(e.stages,`${n}.stages`,30);if(e.stages.forEach((d,a)=>{let f=`${n}.stages[${a}]`;s(d.label,`${f}.label`,!0,200),s(d.summary,`${f}.summary`,!1,3e3);for(let[i,h,c]of[["nodes",o,"note"],["edges",t,"label"]]){if(d[i]===void 0)continue;$(d[i],`${f}.${i}`);let u=Object.entries(d[i]);if(u.length>(i==="nodes"?200:400))throw new Error(`${f}.${i} has too many entries.`);for(let[m,g]of u){let w=`${f}.${i}.${m}`;if(!h.has(m))throw new Error(`${w} references a missing ${i==="nodes"?"node":"edge"}.`);if($(g,w),!p.has(g.state))throw new Error(`${w}.state must be one of ${y.join(", ")}.`);s(g[c],`${w}.${c}`,!1,300)}}}),e.initialStage!==void 0&&!r.has(e.initialStage))throw new Error(`${n}.initialStage references a missing stage.`)}else if(e.initialStage!==void 0)throw new Error(`${n}.initialStage requires stages.`)}function j(e,n){return n.steps.map((o,t)=>{if(o.edge!==void 0)return o.edge;let r=n.steps[t-1]?.node;return r===void 0||r===o.node?void 0:(e.edges.find(a=>a.source===r&&a.target===o.node)??e.edges.find(a=>a.source===o.node&&a.target===r))?.id})}export{A as a,j as b};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{b as J,c as Q}from"./chunk-N2G7RUAJ.js";import{d as U,f as v}from"./chunk-2CCUVSMI.js";import{d as Z}from"./chunk-XI4I5HQF.js";import{a as q,c as rs,hb as F,kb as j}from"./chunk-S4EP5SMX.js";import{a as X}from"./chunk-J6IRWTF7.js";import{c as B}from"./chunk-DCANE7XH.js";var d=B(rs(),1);q(`.sb-block.sg-block :is(h3,h4,p,ul,ol,li,pre):not(svg){margin:0}.sb-block.sg-block li:not(svg){padding:0}.sb-block.sg-block pre:not(svg){border:0;border-radius:0;background:none;color:inherit}.sb-block.sg-block{--sg-text: var(--text, #222222);--sg-muted: var(--muted, #6a6a6a);--sg-faint: var(--subtle, #929292);--sg-line: var(--line, #dddddd);--sg-paper: var(--paper, #ffffff);--sg-surface: var(--surface, #fafafa);--sg-accent: var(--accent, #120a8f);--sg-accent-soft: var(--accent-soft, #eeedf9);--sg-on-accent: var(--paper, #ffffff);--sg-good: #2f6b4f;--sg-good-soft: #e6efe9;--sg-warn: #a86b34;--sg-warn-soft: #f6ece2;--sg-wait: #d9a85b;--sg-wait-soft: #f8ead0;color:var(--sg-text);font-family:inherit;font-size:14px;line-height:1.7;padding:8px 0;container-type:inline-size;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}:root[data-theme=dark] .sb-block.sg-block,[data-theme=dark] .sb-block.sg-block{--sg-good: #7cc3a0;--sg-good-soft: #20352b;--sg-warn: #e0a96f;--sg-warn-soft: #3a2c1e;--sg-wait: #b88a45;--sg-wait-soft: #3a2f1c}.sb-block.sg-block *{box-sizing:border-box}.sb-block.sg-block button{font:inherit;cursor:pointer}.sb-block.sg-block button:focus-visible,.sb-block.sg-block pre:focus-visible,.sb-block.sg-block a:focus-visible{outline:2px solid var(--sg-accent);outline-offset:2px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-head{margin-bottom:14px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-heading{margin:0;font-size:17px;font-weight:700}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-sub{margin:2px 0 0;color:var(--sg-muted);font-size:13px}.sb-block.sg-block strong{font-weight:650}.sb-block.sg-block :not(pre)>code{font-family:var(--font-mono, ui-monospace, monospace);font-size:.88em;background:var(--sg-surface);border:1px solid var(--sg-line);border-radius:4px;padding:0 4px}.sb-block.sg-block a{color:var(--sg-accent);text-decoration:none;border-bottom:1px solid color-mix(in srgb,var(--sg-accent) 35%,transparent)}.sb-block.sg-block a:hover{border-bottom-color:var(--sg-accent)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-announce{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);margin:0}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-progress{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin:0 0 16px;font-size:12px;line-height:1.4;color:var(--sg-muted)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-count{white-space:nowrap}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-bar{flex:1;max-width:220px;min-width:60px;height:3px;border-radius:2px;background:var(--sg-line);overflow:hidden}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-bar i{display:block;height:100%;background:var(--sg-accent);border-radius:2px;transition:width .25s ease}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-tip{color:var(--sg-faint);white-space:nowrap}.sb-block.sg-block .sg-clear{border:0;background:none;padding:2px 4px;margin:-2px -4px;font-size:12px;color:var(--sg-muted);border-radius:4px}.sb-block.sg-block .sg-clear:hover{color:var(--sg-accent)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-list{list-style:none;margin:0;padding:0}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-step{display:grid;grid-template-columns:30px minmax(0,1fr);gap:0 16px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-rail{position:relative;display:flex;flex-direction:column;align-items:center}.sb-block.sg-block .sg-num{position:relative;z-index:1;flex:none;display:grid;place-items:center;width:30px;height:30px;padding:0;border-radius:50%;border:1px solid var(--sg-line);background:var(--sg-paper);color:var(--sg-text);font-size:13px;font-weight:600;transition:border-color .15s,background-color .15s,color .15s,box-shadow .15s}.sb-block.sg-block .sg-num:hover{border-color:var(--sg-accent);color:var(--sg-accent);box-shadow:0 0 0 3px var(--sg-accent-soft)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-num svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.sb-block.sg-block .sg-num[aria-pressed=true]{background:var(--sg-accent);border-color:var(--sg-accent);color:var(--sg-on-accent)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-line{flex:1;width:1px;margin:6px 0;background:var(--sg-line);position:relative}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-line:after{content:"";position:absolute;width:2px;inset:0 0 0 -.5px;background:var(--sg-accent);transform:scaleY(0);transform-origin:top;transition:transform .3s ease}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-step.is-done .sg-line:after{transform:scaleY(1)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-content{min-width:0;padding:3px 0 28px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-step:last-child .sg-content{padding-bottom:4px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-title{margin:0;font-size:16px;line-height:1.5;font-weight:650}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-badge{display:inline-block;vertical-align:2px;margin-left:8px;padding:0 8px;border:1px solid var(--sg-line);border-radius:999px;font-size:11.5px;font-weight:600;line-height:1.7;color:var(--sg-muted);background:var(--sg-paper)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-body{margin:6px 0 0}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-note,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-result{display:flex;align-items:flex-start;gap:8px;margin:12px 0 0;font-size:13px;line-height:1.65}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-note{color:var(--sg-muted)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-note svg,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-result svg{flex:none;width:16px;height:16px;margin-top:2px;fill:none;stroke-linecap:round;stroke-linejoin:round}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-note svg{stroke:var(--sg-faint);stroke-width:1.3}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-result{background:var(--sg-good-soft);border-radius:6px;padding:8px 12px 8px 10px;width:fit-content;max-width:100%}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-result svg circle{fill:var(--sg-good);stroke:none}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-result svg path{stroke:var(--sg-good-soft);stroke-width:1.8}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-hint{margin:10px 0 0;padding:8px 12px;border-radius:8px;font-size:13.5px;line-height:1.6}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-hint b{margin-right:8px;font-weight:650}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-hint.is-cue{background:var(--sg-good-soft)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-hint.is-cue b{color:var(--sg-good)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-hint.is-wait{background:var(--sg-warn-soft)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-hint.is-wait b{color:var(--sg-warn)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-print,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-print-only{display:none}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer-static{margin:10px 0 0;font-size:13px;color:var(--sg-muted)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code{--sg-code-line: var(--line, #dddddd);margin-top:12px;border:1px solid var(--sg-code-line);border-radius:10px;background:var(--surface, #fafafa);color:var(--text, #222222);overflow:hidden}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-codebar{display:flex;align-items:center;gap:10px;min-height:38px;padding:0 6px 0 12px;border-bottom:1px solid var(--sg-code-line);background:color-mix(in srgb,var(--line, #dddddd) 30%,var(--surface, #fafafa))}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-lang{font-family:var(--font-mono, ui-monospace, monospace);font-size:11.5px;color:var(--muted, #6a6a6a);letter-spacing:.02em}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-tabs{display:flex;align-self:stretch;gap:2px;margin-left:-4px;overflow-x:auto;scrollbar-width:none}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code .sg-tabs button{position:relative;border:0;background:none;padding:0 10px;font:inherit;font-size:12.5px;color:var(--muted, #6a6a6a);white-space:nowrap;cursor:pointer}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code .sg-tabs button:hover,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code .sg-tabs button[aria-selected=true]{color:var(--text, #222222)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code .sg-tabs button[aria-selected=true]{font-weight:650}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code .sg-tabs button[aria-selected=true]:after{content:"";position:absolute;left:10px;right:10px;bottom:-1px;height:2px;border-radius:1px;background:var(--accent, #120a8f)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-copy-hint{flex:1;min-width:0;text-align:right;font-size:12px;color:var(--muted, #6a6a6a);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code .sg-copy{flex:none;display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 9px;border:1px solid transparent;border-radius:6px;background:none;font:inherit;font-size:12px;color:var(--muted, #6a6a6a);cursor:pointer}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code .sg-copy:hover{color:var(--text, #222222);background:var(--paper, #ffffff);border-color:var(--sg-code-line)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-copy svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code .sg-copy.is-ok{color:var(--accent, #120a8f)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code .sg-tabs button:focus-visible,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code .sg-copy:focus-visible,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code .sg-pre:focus-visible{outline:2px solid var(--accent, #120a8f);outline-offset:-2px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code .sg-pre{margin:0;padding:13px 16px 14px;overflow-x:auto;font-family:var(--font-mono, ui-monospace, monospace);font-size:12.5px;line-height:1.7;tab-size:2;background:none}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code .sg-pre code{font:inherit;color:inherit;background:none;border:0;padding:0;white-space:pre}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code .sg-comment{color:var(--muted, #6a6a6a)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin-top:12px;padding:8px 10px 8px 14px;border:1px solid var(--sg-line);border-radius:12px;background:var(--sg-paper);width:fit-content;max-width:100%}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-clock{display:flex;align-items:baseline;gap:8px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-clock b{font-size:18px;font-weight:700}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-clock span{font-size:12px;color:var(--sg-muted)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-meter{width:72px;height:4px;border-radius:2px;background:var(--sg-line);overflow:hidden}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-meter i{display:block;height:100%;background:var(--sg-accent)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer.is-run .sg-meter i{background:var(--sg-good)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer-buttons{display:flex;flex-wrap:wrap;gap:6px}.sb-block.sg-block .sg-go,.sb-block.sg-block .sg-reset{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:4px 12px;font-size:13px;font-weight:600}.sb-block.sg-block .sg-go{border:1px solid var(--sg-accent);background:var(--sg-accent);color:var(--sg-on-accent)}.sb-block.sg-block .sg-timer.is-run .sg-go{background:var(--sg-good);border-color:var(--sg-good)}.sb-block.sg-block .sg-reset{border:1px solid var(--sg-line);background:var(--sg-paper);color:var(--sg-muted)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer.is-done{border-color:var(--sg-warn);background:var(--sg-warn-soft);animation:sg-ding .6s ease 3}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer.is-done .sg-clock b{color:var(--sg-warn)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer.is-large{position:relative;flex-direction:column;justify-content:flex-start;width:100%;margin:0;padding:14px 10px 12px;border-radius:16px;gap:10px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-ring{width:132px;height:132px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-ring-bg{fill:none;stroke:var(--sg-line);stroke-width:9}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-ring-fg{fill:none;stroke:var(--sg-accent);stroke-width:9;stroke-linecap:round;transition:stroke-dashoffset .3s linear}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer.is-run .sg-ring-fg{stroke:var(--sg-good)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer.is-done .sg-ring-fg{stroke:var(--sg-warn)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer.is-large .sg-clock{position:absolute;top:14px;height:132px;width:110px;flex-direction:column;align-items:center;justify-content:center;gap:0;text-align:center}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer.is-large .sg-clock b{font-size:26px;line-height:1.2}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer.is-large.is-done .sg-clock b{font-size:18px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer.is-large .sg-clock span{line-height:1.3;margin-top:2px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer.is-large .sg-timer-buttons{justify-content:center}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-ribbon{margin:0 0 16px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-ribbon-sum{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 18px;margin-bottom:8px;font-size:13px;color:var(--sg-muted)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-ribbon-total b{font-size:20px;font-weight:700;color:var(--sg-text)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-key{display:inline-flex;align-items:center;gap:6px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-key b{color:var(--sg-text)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-key i{display:inline-block;width:20px;height:9px;border-radius:3px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-key.is-active i,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-seg.is-active{background:var(--sg-accent)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-key.is-wait i,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-seg.is-wait{background:repeating-linear-gradient(135deg,var(--sg-wait-soft) 0 5px,var(--sg-wait) 5px 7px)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-ribbon-hint{margin-left:auto;font-size:12px;color:var(--sg-faint)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-ribbon-rows{background:var(--sg-surface);border:1px solid var(--sg-line);border-radius:12px;padding:8px 12px 4px}.sb-block.sg-block .sg-row{display:grid;grid-template-columns:118px minmax(0,1fr);align-items:center;width:100%;height:24px;padding:0;border:0;border-radius:6px;background:none;color:inherit;text-align:left}.sb-block.sg-block .sg-row:hover{background:var(--sg-paper)}.sb-block.sg-block .sg-row.is-current{background:var(--sg-accent-soft)}.sb-block.sg-block .sg-row:focus-visible{outline-offset:0}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-row-label{padding-left:4px;font-size:12.5px;color:var(--sg-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-row-label em{font-style:normal;font-weight:700;margin-right:6px;color:var(--sg-faint)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-row.is-current .sg-row-label{color:var(--sg-text);font-weight:650}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-row.is-current .sg-row-label em{color:var(--sg-accent)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-track{position:relative;display:block;height:100%}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-grid{position:absolute;top:0;bottom:0;border-left:1px dashed var(--sg-line)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-seg{position:absolute;top:6px;height:12px;min-width:3px;border-radius:4px;opacity:.6;transition:opacity .2s}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-row:hover .sg-seg,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-row.is-current .sg-seg{opacity:1}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-row.is-done .sg-seg{opacity:.35}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-live{position:absolute;inset:-3px;border-radius:6px;border:2px solid var(--sg-good);animation:sg-pulse 1.2s ease-in-out infinite}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-axis{display:grid;grid-template-columns:118px minmax(0,1fr);height:20px;font-size:11px;color:var(--sg-faint)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-axis .sg-track span{position:absolute;top:3px;transform:translate(-50%);white-space:nowrap}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-axis .sg-track span:first-child{transform:none}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-tray{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 14px}.sb-block.sg-block .sg-tray button{display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:3px 11px;border:1px solid transparent;border-radius:999px;background:var(--sg-good-soft);color:var(--sg-text);font-size:12.5px}.sb-block.sg-block .sg-tray button.is-done{background:var(--sg-warn-soft);border-color:var(--sg-warn)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-tray-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:12em}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-card{display:grid;grid-template-columns:minmax(0,1fr) 200px;gap:22px;padding:18px 20px;border:1px solid var(--sg-line);border-radius:16px;background:var(--sg-paper);animation:sg-in .25s ease}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-card:not(:has(.sg-card-side)){grid-template-columns:minmax(0,1fr)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-card-main{min-width:0}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-card-head{display:flex;align-items:center;flex-wrap:wrap;gap:8px 14px;margin-bottom:4px}.sb-block.sg-block .sg-num.is-large{width:46px;height:46px;font-size:22px;font-weight:700}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-num.is-large svg{width:22px;height:22px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-card-titles{flex:1;min-width:0}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-card-titles small{font-size:12px;color:var(--sg-muted);letter-spacing:.04em}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-card-titles .sg-title{font-size:20px;line-height:1.3}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-card-head>.sg-badge{margin-left:0}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-card .sg-body{font-size:15.5px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-foot{display:flex;align-items:center;flex-wrap:wrap;gap:10px 12px;margin-top:14px}.sb-block.sg-block .sg-nav{padding:6px 16px;border:1px solid var(--sg-line);border-radius:999px;background:var(--sg-paper);color:var(--sg-text);font-size:14px;font-weight:600}.sb-block.sg-block .sg-nav.is-next{margin-left:auto;background:var(--sg-accent);border-color:var(--sg-accent);color:var(--sg-on-accent)}.sb-block.sg-block .sg-nav:disabled{opacity:.4;cursor:default}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-dots{display:flex;flex-wrap:wrap;gap:6px;min-width:0}.sb-block.sg-block .sg-dots button{width:10px;height:10px;padding:0;border:0;border-radius:50%;background:var(--sg-line)}.sb-block.sg-block .sg-dots button.is-done{background:color-mix(in srgb,var(--sg-accent) 45%,var(--sg-line))}.sb-block.sg-block .sg-dots button.is-current{width:22px;border-radius:6px;background:var(--sg-accent)}@keyframes sg-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}@keyframes sg-pulse{0%,to{opacity:.3}50%{opacity:1}}@keyframes sg-ding{0%,to{transform:none}25%{transform:rotate(-1.5deg)}75%{transform:rotate(1.5deg)}}@container (max-width: 640px){:is(.sb-block.sg-block,.sb-block.cr-block) .sg-step{grid-template-columns:26px minmax(0,1fr);gap:0 12px}.sb-block.sg-block .sg-num{width:26px;height:26px;font-size:12px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-content{padding:1px 0 24px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-tip,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-ribbon-hint{display:none}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-bar{max-width:none}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code .sg-pre{padding:12px 13px;font-size:12px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-codebar{flex-wrap:wrap}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-codebar>:first-child{flex:1;min-width:0}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-copy-hint{order:3;flex-basis:100%;text-align:left;white-space:normal}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-copy-hint:empty{display:none}.sb-block.sg-block .sg-row,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-axis{grid-template-columns:76px minmax(0,1fr)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-card{grid-template-columns:minmax(0,1fr);padding:14px 12px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-ring{width:104px;height:104px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer.is-large .sg-clock{width:92px;height:104px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer.is-large .sg-clock b{font-size:20px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-card-titles .sg-title{font-size:18px}.sb-block.sg-block .sg-nav{padding:6px 12px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-dots{order:3;flex-basis:100%;justify-content:center}}@media(prefers-reduced-motion:reduce){.sb-block.sg-block *,.sb-block.sg-block *:after{transition:none!important}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-card,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-live,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer.is-done{animation:none}}@media print{:is(.sb-block.sg-block,.sb-block.cr-block) .sg-progress,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-tray,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-ribbon-hint,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-copy,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-copy-hint,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-card,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-foot,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-screen,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-timer-buttons{display:none}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-print,:is(.sb-block.sg-block,.sb-block.cr-block) .sg-print-only{display:block}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-print{margin:0;padding-left:1.6em}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-print>li{break-inside:avoid;margin-bottom:16px}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code .sg-pre{overflow:visible}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code pre[hidden]{display:block;border-top:1px solid var(--sg-code-line)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code pre[data-label]:before{content:attr(data-label);display:block;margin-bottom:4px;font-family:var(--font-sans, sans-serif);font-size:11.5px;font-weight:650;color:var(--muted, #6a6a6a)}:is(.sb-block.sg-block,.sb-block.cr-block) .sg-code .sg-pre code{white-space:pre-wrap}}
|
|
2
|
+
`);var K=X("stepGuide",{"zh-CN":{title:"\u64CD\u4F5C\u6B65\u9AA4",progress:"\u5DF2\u5B8C\u6210 {done} / {total} \u6B65",allDone:"\u5168\u90E8\u5B8C\u6210",resetProgress:"\u91CD\u7F6E",resetProgressLabel:"\u6E05\u9664\u5168\u90E8\u5B8C\u6210\u6807\u8BB0",tickHint:"\u70B9\u51FB\u5E8F\u53F7\u6807\u8BB0\u5B8C\u6210",markDone:"\u5C06\u7B2C {number} \u6B65\u6807\u8BB0\u4E3A\u5DF2\u5B8C\u6210",markUndone:"\u7B2C {number} \u6B65\u5DF2\u5B8C\u6210\uFF0C\u70B9\u51FB\u53D6\u6D88",note:"\u63D0\u793A",result:"\u5B8C\u6210\u540E",cue:"\u770B\u5230\u8FD9\u6837\u5C31\u5BF9\u4E86",wait:"\u7B49\u5F85\u65F6","code.label":"\u4EE3\u7801","code.variants":"\u9009\u62E9\u73AF\u5883","code.copy":"\u590D\u5236","code.copied":"\u5DF2\u590D\u5236","code.copyLabel":"\u590D\u5236{label}","code.selected":"\u5DF2\u9009\u4E2D\uFF0C\u6309 \u2318C / Ctrl+C \u590D\u5236","code.stepLabel":"\u7B2C {number} \u6B65\u7684\u4EE3\u7801","timer.label":"\u8BA1\u65F6\u5668","timer.start":"\u5F00\u59CB\u8BA1\u65F6","timer.pause":"\u6682\u505C","timer.resume":"\u7EE7\u7EED","timer.reset":"\u91CD\u7F6E","timer.timeUp":"\u65F6\u95F4\u5230","timer.timeUpStep":"\u7B2C {number} \u6B65\u65F6\u95F4\u5230","timer.tray":"\u6B63\u5728\u8BA1\u65F6","timer.trayItem":"\u7B2C {number} \u6B65 {label}\uFF1A{time}\uFF0C\u70B9\u51FB\u67E5\u770B","timer.of":"{label} \xB7 {minutes}","duration.minutes":"{minutes} \u5206\u949F","duration.hours":"{hours} \u5C0F\u65F6","duration.hoursMinutes":"{hours} \u5C0F\u65F6 {minutes} \u5206\u949F","ribbon.label":"\u65F6\u95F4\u7EBF","ribbon.total":"\u603B\u8BA1","ribbon.active":"\u52A8\u624B","ribbon.wait":"\u7B49\u5F85","ribbon.hint":"\u70B9\u51FB\u4E00\u884C\u8DF3\u5230\u8BE5\u6B65\u9AA4","ribbon.row":"\u7B2C {number} \u6B65 {label}","focus.position":"\u6B65\u9AA4 {number} / {total}","focus.prev":"\u4E0A\u4E00\u6B65","focus.next":"\u4E0B\u4E00\u6B65","focus.nav":"\u6B65\u9AA4\u5BFC\u822A","focus.goTo":"\u8DF3\u5230\u7B2C {number} \u6B65\uFF1A{title}"},en:{title:"Steps",progress:"{done} of {total} steps done",allDone:"All steps done",resetProgress:"Reset",resetProgressLabel:"Clear every done mark",tickHint:"Click a number to mark it done",markDone:"Mark step {number} as done",markUndone:"Step {number} is done; click to undo",note:"Note",result:"Result",cue:"You are there when",wait:"While you wait","code.label":"Code","code.variants":"Choose an environment","code.copy":"Copy","code.copied":"Copied","code.copyLabel":"Copy {label}","code.selected":"Selected. Press \u2318C / Ctrl+C to copy","code.stepLabel":"code for step {number}","timer.label":"Timer","timer.start":"Start timer","timer.pause":"Pause","timer.resume":"Resume","timer.reset":"Reset","timer.timeUp":"Time's up","timer.timeUpStep":"Step {number}: time's up","timer.tray":"Running timers","timer.trayItem":"Step {number} {label}: {time}; click to view","timer.of":"{label} \xB7 {minutes}","duration.minutes":"{minutes} min","duration.hours":"{hours} h","duration.hoursMinutes":"{hours} h {minutes} min","ribbon.label":"Timeline","ribbon.total":"total","ribbon.active":"Hands-on","ribbon.wait":"Waiting","ribbon.hint":"Click a row to jump to that step","ribbon.row":"Step {number} {label}","focus.position":"Step {number} of {total}","focus.prev":"Previous","focus.next":"Next","focus.nav":"Step navigation","focus.goTo":"Go to step {number}: {title}"}});var s=B(F(),1);function bs({source:l,className:c}){return(0,s.jsx)(s.Fragment,{children:l.split(/\n+/).filter(t=>t.trim()).map((t,r)=>(0,s.jsx)("p",{className:c,children:(0,s.jsx)(v,{source:t})},r))})}function as(l,c){let t=document.activeElement,r=document.createElement("textarea");r.value=l,r.setAttribute("readonly",""),r.style.cssText="position:fixed;top:0;left:0;width:1px;height:1px;opacity:0;pointer-events:none",document.body.appendChild(r),r.select();let n=document.execCommand("copy");if(r.remove(),t?.focus?.({preventScroll:!0}),!n&&c){let g=document.createRange();g.selectNodeContents(c);let i=window.getSelection();i?.removeAllRanges(),i?.addRange(g)}return n}var is=(l,c)=>{let t=l.trimStart();return t.startsWith("//")?!0:t.startsWith("#")&&!t.startsWith("#!")&&!/^(md|markdown)$/i.test(c??"")};function ns({variants:l,name:c,fallbackLang:t}){let r=j(K),n=(0,d.useId)(),[g,i]=(0,d.useState)(0),[k,y]=(0,d.useState)("idle"),N=(0,d.useRef)(null),S=(0,d.useRef)(null),z=(0,d.useRef)(void 0);(0,d.useEffect)(()=>()=>window.clearTimeout(z.current),[]);let a=l.length>1,x=l[Math.min(g,l.length-1)],D=x.code.replace(/\n+$/,""),h=x.lang??t,L=()=>{let u=as(D,N.current);y(u?"copied":"selected"),window.clearTimeout(z.current),z.current=window.setTimeout(()=>y("idle"),u?1500:4e3)},R=u=>{i(u),y("idle")},E=u=>{let p={ArrowRight:g+1,ArrowLeft:g-1,Home:0,End:l.length-1};if(!(u.key in p))return;u.preventDefault();let T=(p[u.key]+l.length)%l.length;R(T),S.current?.children[T]?.focus()};return(0,s.jsxs)("div",{className:"sg-code",children:[(0,s.jsxs)("div",{className:"sg-codebar",children:[a?(0,s.jsx)("div",{className:"sg-tabs",role:"tablist","aria-label":r("code.variants"),ref:S,onKeyDown:E,children:l.map((u,p)=>(0,s.jsx)("button",{type:"button",role:"tab",id:`${n}-tab${p}`,"aria-selected":p===g,"aria-controls":`${n}-panel${p}`,tabIndex:p===g?0:-1,onClick:()=>R(p),children:u.label},p))}):(0,s.jsx)("span",{className:"sg-lang",children:x.label||h||r("code.label")}),(0,s.jsx)("span",{className:"sg-copy-hint","aria-live":"polite",children:k==="selected"?r("code.selected"):""}),(0,s.jsxs)("button",{type:"button",className:`sg-copy${k==="copied"?" is-ok":""}`,onClick:L,"aria-label":k==="copied"?r("code.copied"):r("code.copyLabel",{label:c}),children:[k==="copied"?(0,s.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M3.5 8.5l3 3 6-7"})}):(0,s.jsxs)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,s.jsx)("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5"}),(0,s.jsx)("path",{d:"M10.5 3.5v-.5a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h.5"})]}),(0,s.jsx)("span",{children:r(k==="copied"?"code.copied":"code.copy")})]})]}),l.map((u,p)=>(0,s.jsx)("pre",{className:"sg-pre",id:`${n}-panel${p}`,role:a?"tabpanel":void 0,"aria-labelledby":a?`${n}-tab${p}`:void 0,"aria-label":a?void 0:c,"data-label":a?u.label:void 0,hidden:p!==g,tabIndex:0,children:(0,s.jsx)("code",{ref:p===g?N:void 0,children:u.code.replace(/\n+$/,"").split(`
|
|
3
|
+
`).map((T,C)=>(0,s.jsxs)("span",{className:is(T,u.lang??t)?"sg-comment":void 0,children:[T,`
|
|
4
|
+
`]},C))})},p))]})}function H(l,c){let t=Math.floor(l/60),r=Math.round(l%60);return t?r?c("duration.hoursMinutes",{hours:t,minutes:r}):c("duration.hours",{hours:t}):c("duration.minutes",{minutes:r})}function ss(l){let c=Math.max(0,Math.ceil(l/1e3)),t=Math.floor(c/3600),r=Math.floor(c%3600/60),n=String(c%60).padStart(2,"0");return t?`${t}:${String(r).padStart(2,"0")}:${n}`:`${r}:${n}`}var gs=l=>l===0?"0":`${Math.floor(l/60)}:${String(l%60).padStart(2,"0")}`,ks=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;function ds({step:l,number:c,timer:t,left:r,large:n,onToggle:g,onReset:i,t:k}){let y=l.timer.minutes*6e4,N=y?r/y:0,S=54,z=2*Math.PI*S,a=l.timer.label,x=t?.done?" is-done":t?.endAt?" is-run":"";return(0,s.jsxs)("div",{className:`sg-timer${n?" is-large":""}${x}`,role:"group","aria-label":a?`${k("timer.label")} \xB7 ${a}`:k("timer.label"),children:[n&&(0,s.jsxs)("svg",{viewBox:"0 0 132 132",className:"sg-ring","aria-hidden":"true",children:[(0,s.jsx)("circle",{cx:"66",cy:"66",r:S,className:"sg-ring-bg"}),(0,s.jsx)("circle",{cx:"66",cy:"66",r:S,className:"sg-ring-fg",strokeDasharray:z,strokeDashoffset:z*(1-N),transform:"rotate(-90 66 66)"})]}),(0,s.jsxs)("div",{className:"sg-clock",children:[(0,s.jsx)("b",{role:"timer",children:t?.done?k("timer.timeUp"):ss(r)}),a&&(0,s.jsx)("span",{children:a})]}),!n&&(0,s.jsx)("span",{className:"sg-meter","aria-hidden":"true",children:(0,s.jsx)("i",{style:{width:`${(1-N)*100}%`}})}),(0,s.jsxs)("div",{className:"sg-timer-buttons",children:[!t?.done&&(0,s.jsxs)("button",{type:"button",className:"sg-go",onClick:g,"aria-label":`${t?.endAt?k("timer.pause"):k(t?"timer.resume":"timer.start")} \xB7 ${c}`,children:[(0,s.jsx)("span",{"aria-hidden":"true",children:t?.endAt?"\u275A\u275A":"\u25B6"}),t?.endAt?k("timer.pause"):k(t?"timer.resume":"timer.start")]}),t&&(0,s.jsxs)("button",{type:"button",className:"sg-reset",onClick:i,children:[(0,s.jsx)("span",{"aria-hidden":"true",children:"\u21BA"}),k("timer.reset")]})]})]})}function G({step:l,number:c,t,timer:r}){let n=l.variants?.length?l.variants:l.code?[{label:"",code:l.code,lang:l.lang}]:null;return(0,s.jsxs)(s.Fragment,{children:[l.body&&(0,s.jsx)(bs,{source:l.body,className:"sg-body"}),n&&(0,s.jsx)(ns,{variants:n,name:t("code.stepLabel",{number:c}),fallbackLang:l.lang}),l.cue&&(0,s.jsxs)("p",{className:"sg-hint is-cue",children:[(0,s.jsx)("b",{children:t("cue")}),(0,s.jsx)("span",{children:(0,s.jsx)(v,{source:l.cue})})]}),l.wait&&(0,s.jsxs)("p",{className:"sg-hint is-wait",children:[(0,s.jsx)("b",{children:t("wait")}),(0,s.jsx)("span",{children:(0,s.jsx)(v,{source:l.wait})})]}),l.note&&(0,s.jsxs)("p",{className:"sg-note",children:[(0,s.jsxs)("svg",{viewBox:"0 0 16 16",role:"img","aria-label":t("note"),children:[(0,s.jsx)("circle",{cx:"8",cy:"8",r:"6.2"}),(0,s.jsx)("path",{d:"M8 7.2v3.6M8 5.1v.1"})]}),(0,s.jsx)("span",{children:(0,s.jsx)(v,{source:l.note})})]}),l.result&&(0,s.jsxs)("p",{className:"sg-result",children:[(0,s.jsxs)("svg",{viewBox:"0 0 16 16",role:"img","aria-label":t("result"),children:[(0,s.jsx)("circle",{cx:"8",cy:"8",r:"7"}),(0,s.jsx)("path",{d:"M4.9 8.2l2.1 2.1 4.1-4.5"})]}),(0,s.jsx)("span",{children:(0,s.jsx)(v,{source:l.result})})]}),r]})}function _({step:l,t:c}){if(!l.timer)return null;let t=H(l.timer.minutes,c);return(0,s.jsxs)("p",{className:"sg-timer-static",children:[(0,s.jsx)("span",{"aria-hidden":"true",children:"\u23F1 "}),l.timer.label?c("timer.of",{label:l.timer.label,minutes:t}):t]})}var ps=()=>(0,s.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M3.8 8.4l2.8 2.8 5.6-6.4"})});function Ss({data:l}){let c=j(K),t=l,r=t.steps,n=t.layout==="focus",g=t.start??1,i=(o,e)=>o.id??`#${e}`,k=o=>o.short??U(o.title),y=(0,d.useId)(),N=o=>`${y}-step${o}`,[S,z]=(0,d.useState)(()=>Math.min(Math.max(t.initialStep??0,0),r.length-1)),a=Math.min(S,r.length-1),[x,D]=(0,d.useState)(()=>new Set),[h,L]=(0,d.useState)({}),[R,E]=(0,d.useState)(()=>Date.now()),[u,p]=(0,d.useState)(""),T=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(!Object.values(h).some(e=>e.endAt))return;let o=window.setInterval(()=>{let e=Date.now();E(e);let b=Object.entries(h).filter(([,f])=>f.endAt!==null&&f.endAt<=e);if(!b.length)return;L(f=>{let $={...f};for(let[ls]of b)$[ls]={left:0,endAt:null,done:!0};return $});let m=r.findIndex((f,$)=>i(f,$)===b[0][0]);p(c("timer.timeUpStep",{number:g+m}))},250);return()=>window.clearInterval(o)},[h,r,g,c]);let C=r.filter((o,e)=>x.has(i(o,e))).length,os=o=>D(e=>{let b=new Set(e);return b.has(o)?b.delete(o):b.add(o),b}),P=(o,e)=>{let b=h[i(o,e)];return b?b.endAt?Math.max(0,b.endAt-R):b.left:(o.timer?.minutes??0)*6e4},es=(o,e)=>{let b=i(o,e),m=h[b];if(m?.done)return;let f=P(o,e),$=Date.now();E($),L({...h,[b]:m?.endAt?{left:f,endAt:null,done:!1}:{left:f,endAt:$+f,done:!1}})},cs=(o,e)=>{let b={...h};delete b[i(o,e)],L(b)},M=o=>{let e=Math.min(r.length-1,Math.max(0,o));if(z(e),n)return;let b=T.current?.querySelector(`[id="${N(e)}"]`);b?.scrollIntoView({block:"nearest",behavior:ks()?"auto":"smooth"}),b?.querySelector(".sg-num")?.focus({preventScroll:!0})},ts=o=>{if(!(!n||o.defaultPrevented||o.target.closest("[role=tablist], pre, input, textarea"))){if(o.key==="ArrowRight")M(a+1);else if(o.key==="ArrowLeft")M(a-1);else return;o.preventDefault()}},O=(o,e,b)=>o.timer?(0,s.jsx)(ds,{step:o,number:g+e,timer:h[i(o,e)],left:P(o,e),large:b,onToggle:()=>es(o,e),onReset:()=>cs(o,e),t:c}):null,W=(o,e,b="sg-num")=>{let m=g+e,f=x.has(i(o,e));return(0,s.jsx)("button",{type:"button",className:b,"aria-pressed":f,"aria-label":f?c("markUndone",{number:m}):c("markDone",{number:m}),onClick:()=>os(i(o,e)),children:f?(0,s.jsx)(ps,{}):m})},V=r.map((o,e)=>({step:o,i:e,timer:h[i(o,e)]})).filter(({i:o,timer:e})=>e&&(e.endAt||e.done)&&!(n&&o===a)),A=J(r),Y=Q(A.total),I=o=>`${o/A.total*100}%`,w=r[a];return(0,s.jsxs)("section",{ref:T,className:`sb-block sg-block ${n?"is-focus":"is-list"}`,"aria-label":Z(t.title,c("title")),onKeyDown:ts,children:[(t.title||t.description)&&(0,s.jsxs)("div",{className:"sg-head",children:[t.title&&(0,s.jsx)("h3",{className:"sg-heading",children:t.title}),t.description&&(0,s.jsx)("p",{className:"sg-sub",children:(0,s.jsx)(v,{source:t.description})})]}),r.length>1&&(0,s.jsxs)("div",{className:"sg-progress",children:[(0,s.jsx)("span",{className:"sg-count","aria-live":"polite",children:C===r.length?c("allDone"):c("progress",{done:C,total:r.length})}),(0,s.jsx)("span",{className:"sg-bar","aria-hidden":"true",children:(0,s.jsx)("i",{style:{width:`${C/r.length*100}%`}})}),C>0?(0,s.jsx)("button",{type:"button",className:"sg-clear","aria-label":c("resetProgressLabel"),onClick:()=>D(new Set),children:c("resetProgress")}):!n&&(0,s.jsx)("span",{className:"sg-tip",children:c("tickHint")})]}),A.total>0&&(0,s.jsxs)("div",{className:"sg-ribbon",role:"group","aria-label":c("ribbon.label"),children:[(0,s.jsxs)("div",{className:"sg-ribbon-sum",children:[(0,s.jsxs)("span",{className:"sg-ribbon-total",children:[(0,s.jsx)("b",{children:H(A.total,c)})," ",c("ribbon.total")]}),(0,s.jsxs)("span",{className:"sg-key is-active",children:[(0,s.jsx)("i",{"aria-hidden":"true"})," ",c("ribbon.active")," ",(0,s.jsx)("b",{children:H(A.active,c)})]}),(0,s.jsxs)("span",{className:"sg-key is-wait",children:[(0,s.jsx)("i",{"aria-hidden":"true"})," ",c("ribbon.wait")," ",(0,s.jsx)("b",{children:H(A.wait,c)})]}),(0,s.jsx)("span",{className:"sg-ribbon-hint",children:c("ribbon.hint")})]}),(0,s.jsxs)("div",{className:"sg-ribbon-rows",children:[r.map((o,e)=>o.segments?.length?(0,s.jsxs)("button",{type:"button",className:`sg-row${n&&e===a?" is-current":""}${x.has(i(o,e))?" is-done":""}`,"aria-current":n&&e===a?"step":void 0,"aria-label":c("ribbon.row",{number:g+e,label:k(o)}),onClick:()=>M(e),children:[(0,s.jsxs)("span",{className:"sg-row-label","aria-hidden":"true",children:[(0,s.jsx)("em",{children:g+e}),k(o)]}),(0,s.jsxs)("span",{className:"sg-track","aria-hidden":"true",children:[Y.map(b=>(0,s.jsx)("span",{className:"sg-grid",style:{left:I(b)}},b)),o.segments.map((b,m)=>(0,s.jsx)("span",{className:`sg-seg is-${b.kind}`,style:{left:I(b.start),width:I(b.minutes)},children:h[i(o,e)]?.endAt&&m===o.segments.length-1&&(0,s.jsx)("span",{className:"sg-live"})},m))]})]},i(o,e)):null),(0,s.jsxs)("div",{className:"sg-axis","aria-hidden":"true",children:[(0,s.jsx)("span",{}),(0,s.jsx)("span",{className:"sg-track",children:Y.map(o=>(0,s.jsx)("span",{style:{left:I(o)},children:gs(o)},o))})]})]})]}),V.length>0&&(0,s.jsx)("div",{className:"sg-tray",role:"group","aria-label":c("timer.tray"),children:V.map(({step:o,i:e,timer:b})=>{let m=b.done?c("timer.timeUp"):ss(P(o,e));return(0,s.jsxs)("button",{type:"button",className:b.done?"is-done":void 0,"aria-label":c("timer.trayItem",{number:g+e,label:k(o),time:m}),onClick:()=>M(e),children:[(0,s.jsx)("span",{"aria-hidden":"true",children:b.done?"\u23F0":"\u23F1"}),(0,s.jsx)("span",{className:"sg-tray-label",children:k(o)}),(0,s.jsx)("b",{children:m})]},i(o,e))})}),n?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"sg-card",children:[(0,s.jsxs)("div",{className:"sg-card-main",children:[(0,s.jsxs)("div",{className:`sg-card-head${x.has(i(w,a))?" is-done":""}`,children:[W(w,a,"sg-num is-large"),(0,s.jsxs)("div",{className:"sg-card-titles",children:[(0,s.jsx)("small",{children:c("focus.position",{number:a+1,total:r.length})}),(0,s.jsx)("h4",{className:"sg-title","aria-live":"polite",children:(0,s.jsx)(v,{source:w.title})})]}),w.badge&&(0,s.jsx)("span",{className:"sg-badge",children:w.badge})]}),(0,s.jsx)(G,{step:w,number:g+a,t:c})]}),w.timer&&(0,s.jsx)("div",{className:"sg-card-side",children:O(w,a,!0)})]},i(w,a)),(0,s.jsxs)("nav",{className:"sg-foot","aria-label":c("focus.nav"),children:[(0,s.jsxs)("button",{type:"button",className:"sg-nav",onClick:()=>M(a-1),disabled:a===0,children:[(0,s.jsx)("span",{"aria-hidden":"true",children:"\u2190 "}),c("focus.prev")]}),(0,s.jsx)("div",{className:"sg-dots",children:r.map((o,e)=>(0,s.jsx)("button",{type:"button","aria-label":c("focus.goTo",{number:g+e,title:U(o.title)}),"aria-current":e===a?"step":void 0,className:`${e===a?"is-current":""}${x.has(i(o,e))?" is-done":""}`,onClick:()=>M(e)},i(o,e)))}),(0,s.jsxs)("button",{type:"button",className:"sg-nav is-next",onClick:()=>M(a+1),disabled:a===r.length-1,children:[c("focus.next"),(0,s.jsx)("span",{"aria-hidden":"true",children:" \u2192"})]})]}),(0,s.jsx)("ol",{className:"sg-print",start:g,children:r.map((o,e)=>(0,s.jsxs)("li",{children:[(0,s.jsxs)("h4",{className:"sg-title",children:[(0,s.jsx)(v,{source:o.title}),o.badge&&(0,s.jsx)("span",{className:"sg-badge",children:o.badge})]}),(0,s.jsx)(G,{step:o,number:g+e,t:c,timer:(0,s.jsx)(_,{step:o,t:c})})]},i(o,e)))})]}):(0,s.jsx)("ol",{className:"sg-list",children:r.map((o,e)=>{let b=x.has(i(o,e));return(0,s.jsxs)("li",{id:N(e),className:`sg-step${b?" is-done":""}`,children:[(0,s.jsxs)("div",{className:"sg-rail",children:[W(o,e),e<r.length-1&&(0,s.jsx)("span",{className:"sg-line","aria-hidden":"true"})]}),(0,s.jsxs)("div",{className:"sg-content",children:[(0,s.jsxs)("h4",{className:"sg-title",children:[(0,s.jsx)(v,{source:o.title}),o.badge&&(0,s.jsx)("span",{className:"sg-badge",children:o.badge})]}),(0,s.jsx)(G,{step:o,number:g+e,t:c,timer:o.timer&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"sg-screen",children:O(o,e,!1)}),(0,s.jsx)("div",{className:"sg-print-only",children:(0,s.jsx)(_,{step:o,t:c})})]})})]})]},i(o,e))})}),(0,s.jsx)("p",{className:"sg-announce","aria-live":"assertive",children:u})]})}export{ns as a,Ss as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function m(e,n){return{name:e,catalogs:n}}function f(e){let t=(typeof e=="string"?[e]:e??[]).find(r=>!!r&&r.trim()!=="");return t&&/^zh\b/i.test(t.trim())?"zh-CN":"en"}function c(){return typeof process<"u"&&process.env?process.env:{}}function d(){let e=c().SHOWAI_LANGUAGE;if(e)return[e];if(typeof navigator<"u"){if(navigator.languages?.length)return navigator.languages;if(navigator.language)return[navigator.language]}let n=c(),t=n.LC_ALL||n.LC_MESSAGES||n.LANG;return t&&t!=="C"&&t!=="POSIX"?[t.split(/[.@]/)[0].replace("_","-")]:[Intl.DateTimeFormat().resolvedOptions().locale]}function p(){if(typeof document>"u")return;let e=document.documentElement?.dataset.showaiLocale;return e==="zh-CN"||e==="en"?e:void 0}var g=f(d());var a=p()??g,i=new Set;function L(e,n=!1){if(typeof document<"u"&&(document.documentElement.lang=e,document.documentElement.dataset.showaiLocale=e),!(e===a&&!n)){a=e;for(let t of[...i])t()}}function T(){return a}function h(e,n){n&&(g=n),L(e)}function x(e){return i.add(e),()=>i.delete(e)}var l=new Map;function y(e,n,t=a){let r;if(typeof e=="string")r=e;else{let o=Number(n?.count??0),s=l.get(t);s||l.set(t,s=new Intl.PluralRules(t));let u=o===0&&e.zero!==void 0?"zero":s.select(o);r=e[u]??e.other}return n?r.replace(/\{(\w+)\}/g,(o,s)=>Object.prototype.hasOwnProperty.call(n,s)?String(n[s]):o):r}function v(e){return(n,t)=>{let o=e.catalogs[a][n]??e.catalogs["zh-CN"][n];return o===void 0?`${e.name}.${n}`:y(o,t)}}export{m as a,f as b,T as c,h as d,x as e,v as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=e=>{throw new Error(e)},E=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function c(e,n){(typeof e!="string"||!e.trim())&&o(`${n} must be non-empty text.`)}function d(e,n){e!==void 0&&c(e,n)}function b(e,n){(typeof e!="number"||!Number.isFinite(e))&&o(`${n} must be a finite number.`)}function $(e,n,i,u=0){return(!Array.isArray(e)||e.length<u||e.length>i)&&o(`${n} must be an array of ${u} to ${i} items.`),e.forEach((r,a)=>{E(r)||o(`${n}[${a}] must be an object.`)}),e}function g(e,n){e!==void 0&&!/^#[0-9a-fA-F]{6}$/.test(e)&&o(`${n} must be a six-digit hex color.`)}function N(e,n){e!==void 0&&typeof e!="boolean"&&o(`${n} must be true or false.`)}function h(e,n){e!==void 0&&!T.includes(e)&&o(`${n} must be one of ${T.join(", ")}.`)}var T=["neutral","info","good","warn","bad","accent"],k=["number","clock","date"],x={points:500,series:3,phases:12,kinds:8,events:80,summary:6},v=/^([01]\d|2[0-3]):[0-5]\d$/,D=/^\d{4}-\d{2}-\d{2}$/,S=864e5;function A(e){let[n,i,u]=e.split("-").map(Number),r=Date.UTC(n,i-1,u),a=new Date(r);return a.getUTCFullYear()===n&&a.getUTCMonth()===i-1&&a.getUTCDate()===u?r:NaN}function y(e,n,i){(!Number.isInteger(e)||e<0||e>=i)&&o(`${n} must be a point index from 0 to ${i-1}.`)}function C(e){if(E(e)||o("axis must be an object."),k.includes(e.type)||o(`axis.type must be one of ${k.join(", ")}.`),d(e.label,"axis.label"),e.step!==void 0&&(b(e.step,"axis.step"),e.step<=0&&o("axis.step must be greater than 0."),e.type!=="number"&&!Number.isInteger(e.step)&&o(`axis.step must be a whole number of ${e.type==="clock"?"minutes":"days"}.`)),e.type==="number"){e.start!==void 0&&b(e.start,"axis.start");for(let n of["prefix","unit"])e[n]!==void 0&&(typeof e[n]!="string"||!e[n].trim())&&o(`axis.${n} must be non-empty text.`)}else e.type==="clock"?(typeof e.start!="string"||!v.test(e.start))&&o("axis.start must be a 24-hour time like 13:50 for a clock axis."):(typeof e.start!="string"||!D.test(e.start)||Number.isNaN(A(e.start)))&&o("axis.start must be a date like 2026-10-18 for a date axis.");if(e.count!==void 0){let{points:n}=x;(!Number.isInteger(e.count)||e.count<2||e.count>n)&&o(`axis.count must be a whole number from 2 to ${n}.`)}}function I(e){return e.axis.count??e.series?.[0]?.values.length??0}function _(e){E(e)||o("Component data must be an object."),d(e.title,"title"),d(e.description,"description"),d(e.note,"note"),C(e.axis);let n=x,i=$(e.series??[],"series",n.series),u=new Set;i.forEach((t,f)=>{let s=`series[${f}]`;c(t.id,`${s}.id`),u.has(t.id)&&o(`series contains duplicate id ${t.id}.`),u.add(t.id),c(t.label,`${s}.label`),d(t.unit,`${s}.unit`),h(t.tone,`${s}.tone`),g(t.color,`${s}.color`),N(t.area,`${s}.area`),N(t.dashed,`${s}.dashed`),t.axis!==void 0&&!["left","right"].includes(t.axis)&&o(`${s}.axis must be left or right.`),t.min!==void 0&&b(t.min,`${s}.min`),t.max!==void 0&&b(t.max,`${s}.max`),t.min!==void 0&&t.max!==void 0&&t.min>=t.max&&o(`${s}.min must be below ${s}.max.`),Array.isArray(t.values)||o(`${s}.values must be an array of numbers.`),t.values.forEach((l,w)=>{l!==null&&b(l,`${s}.values[${w}]`)}),t.values.some(l=>l!==null)||o(`${s}.values needs at least one number.`)}),e.axis.count===void 0&&i.length===0&&o("axis.count is required when there are no series.");let r=I(e);(r<2||r>n.points)&&o(`The axis must have 2 to ${n.points} points.`),i.forEach((t,f)=>{t.values.length!==r&&o(`series[${f}].values must have ${r} values, one per axis point.`)}),$(e.phases??[],"phases",n.phases).forEach((t,f)=>{let s=`phases[${f}]`;c(t.label,`${s}.label`),h(t.tone,`${s}.tone`),y(t.from,`${s}.from`,r),y(t.to,`${s}.to`,r),t.to<=t.from&&o(`${s}.to must be after ${s}.from.`);let l=e.phases[f-1];l&&t.from<l.to&&o(`${s} overlaps the previous phase; phases must be in order.`)});let a=$(e.kinds??[],"kinds",n.kinds),m=new Set;a.forEach((t,f)=>{c(t.id,`kinds[${f}].id`),m.has(t.id)&&o(`kinds contains duplicate id ${t.id}.`),m.add(t.id),c(t.label,`kinds[${f}].label`),h(t.tone,`kinds[${f}].tone`),g(t.color,`kinds[${f}].color`)});let p=$(e.events,"events",n.events);return p.forEach((t,f)=>{let s=`events[${f}]`;y(t.at,`${s}.at`,r),f>0&&t.at<p[f-1].at&&o(`${s}.at is before the previous event; list events in time order.`),c(t.title,`${s}.title`),d(t.detail,`${s}.detail`),t.kind!==void 0&&!m.has(t.kind)&&o(`${s}.kind ${t.kind} is not a defined kind.`)}),$(e.summary??[],"summary",n.summary).forEach((t,f)=>{c(t.label,`summary[${f}].label`),c(t.value,`summary[${f}].value`),h(t.tone,`summary[${f}].tone`)}),e.initialAt!==void 0&&y(e.initialAt,"initialAt",r),e}function j(e,n){let i=-1;return e.forEach((u,r)=>{u.at<=n&&(i=r)}),i}function F(e,n){let i=-1;return(e??[]).forEach((u,r)=>{u.from<=n&&n<=u.to&&(i=r)}),i}function L(e){return e.initialAt??e.events[0]?.at??I(e)-1}function M(e,n,i="en"){let u=e.step??1;if(e.type==="clock"){let[m,p]=e.start.split(":").map(Number),t=((m*60+p+n*u)%1440+1440)%1440;return`${String(Math.floor(t/60)).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`}if(e.type==="date")return new Intl.DateTimeFormat(i,{month:"numeric",day:"numeric",timeZone:"UTC"}).format(new Date(A(e.start)+n*u*S));let r=(e.start??0)+n*u,a=new Intl.NumberFormat(i,{maximumFractionDigits:3}).format(r);return`${e.prefix??""}${a}${e.unit??""}`}export{I as a,_ as b,j as c,F as d,L as e,M as f};
|