@a9n-shoji/rvw 0.3.2 → 0.4.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.
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MermaidExpandedView-CyWRss2q.js","assets/rolldown-runtime-hePW80VL.js","assets/MermaidSurface-Dt2_Hu6n.js","assets/preload-helper-Czpn1I53.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{D as r,L as i,N as a,R as o,T as s,V as c,a as l,b as u,i as d,k as f,n as p,s as m,t as h,w as g,x as _,y as v}from"./MermaidSurface-Dt2_Hu6n.js";import{a as y,c as b,d as x,f as ee,i as S,l as C,n as w,o as T,r as E,s as D,t as te,u as ne}from"./ccount-DFmD81E1.js";import{t as re}from"./preload-helper-Czpn1I53.js";var O=class extends g{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||k(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=s({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),r.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function k(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ie=class extends c{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),i(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&f(t.mutationKey)!==f(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??k();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){r.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},A=t(_(),1);function ae(e,t){let n=v(t),[i]=A.useState(()=>new ie(n,e));A.useEffect(()=>{i.setOptions(e)},[i,e]);let s=A.useSyncExternalStore(A.useCallback(e=>i.subscribe(r.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),c=A.useCallback((e,t)=>{i.mutate(e,t).catch(a)},[i]);if(s.error&&o(i.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:c,mutateAsync:s.mutate}}var j=u(),oe={kind:`pull-request-markdown`};function M(e){return e.kind===`pull-request-markdown`?`pull-request-markdown`:e.kind===`walkthrough`?`walkthrough:${e.id}`:`file:${e.path}`}function se(e,t){return`${e}:${M(t)}`}function ce(e){return e.kind===`pull-request-markdown`?`Pull Request.md`:e.kind===`walkthrough`?e.title:e.path}function le(e){let t=ce(e);return t.split(`/`).at(-1)??t}function ue(){return{documents:{left:[oe],right:[]},active:{left:oe,right:null},focusedPane:`left`,navigationRevision:{left:0,right:0}}}function de(e,t,n=!1){return t===e?e:{...t,navigationRevision:{left:e.navigationRevision.left+Number(n||e.active.left!==t.active.left),right:e.navigationRevision.right+Number(n||e.active.right!==t.active.right)}}}function fe(e){return e===`left`?`right`:`left`}function pe(e,t,n){let r=M(t);return e.documents[n].find(e=>M(e)===r)}function me(e,t){return[`left`,`right`].filter(n=>pe(e,t,n))}function he(e,t){let n=[];for(let r of[`left`,`right`]){let i=fe(r);for(let a of e.documents[r]){if(pe(t,a,r))continue;let e=pe(t,a,i);e&&n.push({sourceDocument:a,targetDocument:e,sourcePane:r,targetPane:i})}}return n}function ge(e,t){return pe(e,t,e.focusedPane)?e.focusedPane:me(e,t)[0]??e.focusedPane}function _e(e){return e.documents.left.length>0||e.documents.right.length===0?e:{...e,documents:{left:e.documents.right,right:[]},active:{left:e.active.right??e.documents.right[0]??null,right:null},focusedPane:`left`}}function ve(e,t,n){let r=M(t),i=e.documents[n].findIndex(e=>M(e)===r),a=i<0?[...e.documents[n],t]:e.documents[n].map((e,n)=>n===i?t:e);return{...e,documents:{...e.documents,[n]:a},active:{...e.active,[n]:t},focusedPane:n}}function ye(e,t,n,r){if(n===r)return ve(e,t,r);let i=M(t),a=e.documents[n].findIndex(e=>M(e)===i);if(a<0)return e;let o=e.documents[n].filter(e=>M(e)!==i),s=e.documents[r].findIndex(e=>M(e)===i),c=s<0?[...e.documents[r],t]:e.documents[r].map((e,n)=>n===s?t:e),l={...e.active,[r]:t};return e.active[n]&&M(e.active[n])===i&&(l[n]=o[Math.min(a,o.length-1)]??o.at(-1)??null),_e({...e,documents:{...e.documents,[n]:o,[r]:c},active:l,focusedPane:r})}function be(e,t,n){let r=M(t),i=n??[`left`,`right`].find(n=>e.documents[n].some(e=>e===t))??(pe(e,t,e.focusedPane)?e.focusedPane:me(e,t)[0]);if(!i)return e;let a=e.documents[i].findIndex(e=>M(e)===r);if(a<0)return e;let o=e.documents[i].filter(e=>M(e)!==r),s={...e.active};s[i]&&M(s[i])===r&&(s[i]=o[Math.min(a,o.length-1)]??o.at(-1)??null);let c=e.focusedPane===i&&!s[i]?fe(i):e.focusedPane;return _e({...e,documents:{...e.documents,[i]:o},active:s,focusedPane:c})}function xe(e){return e.kind===`pull-request-markdown`?{kind:`pull-request-markdown`}:e.kind===`walkthrough`||e.comparisonPolicy===`reference-target`?e:{kind:`repository-file`,path:e.path}}var Se=new Map,Ce=new Map,we=new Map,Te=new Set,Ee=new Map;function De(){return[...Se.values()].some(e=>e.size>0)||[...Ce.values()].some(e=>e.size>0)}function Oe(e){return e.kind===`pull-request-markdown`?[`pull-request-markdown`]:e.kind===`walkthrough`?[`walkthrough`,e.id,e.sourceOid]:[`repository-file`,e.path,e.oldPath??null,e.newPath??null,e.sourceOid??null,e.comparisonPolicy??null,e.referenceContext?.latestHeadOid??null,e.referenceContext?.outcome??null]}function ke(e){return Array.isArray(e)?e[0]===`pull-request-markdown`?`pull-request-markdown`:e[0]===`walkthrough`&&typeof e[1]==`string`?`walkthrough:${e[1]}`:e[0]===`repository-file`&&typeof e[1]==`string`?`file:${e[1]}`:null:null}function Ae(e){return JSON.stringify([e.pane,Oe(e.activeDocument),e.selectedOid,e.oldOid,e.displayMode])}function je(e){return Ee.get(e)??0}function Me(e){let t=je(e),n=we.get(e);if(n?.revision===t)return n;let r={revision:t,body:``,focused:!1};return we.set(e,r),r}function Ne(){for(let e of Te)e()}function Pe(e){return Te.add(e),()=>Te.delete(e)}function Fe(e,t){return se(e,t)}function Ie(e,t,n,r,i){if(r===i)return[];let a=Ce.get(e);if(!a)return[];let o=`inline:${Fe(r,t)}:`,s=`inline:${Fe(i,n)}:`;return[...a.entries()].filter(([e])=>e.startsWith(o)).map(([e,t])=>({sourceKey:e,targetKey:`${s}${e.slice(o.length)}`,draft:t}))}function Le(e,t,n,r){if(n===r)return[];let i=Se.get(e);if(!i)return[];let a=M(t),o=[];for(let[e,t]of i){let i;try{i=JSON.parse(e)}catch{continue}if(!Array.isArray(i)||i.length!==5||i[0]!==n||ke(i[1])!==a)continue;let s=i;o.push({sourceKey:e,targetKey:JSON.stringify([r,...s.slice(1)]),draft:t})}return o}function Re(e,t,n){let r=[],i=[];for(let a of he(t,n))r.push(...Ie(e,a.sourceDocument,a.targetDocument,a.sourcePane,a.targetPane)),i.push(...Le(e,a.sourceDocument,a.sourcePane,a.targetPane));let a=Ce.get(e),o=Se.get(e);if(r.some(({targetKey:e})=>a?.has(e))||i.some(({targetKey:e})=>o?.has(e)))return{status:`conflict`};for(let{sourceKey:e}of r)a?.delete(e);for(let{targetKey:e,draft:t}of r)a?.set(e,t);for(let{sourceKey:e}of i)o?.delete(e);for(let{targetKey:e,draft:t}of i)o?.set(e,t);return r.length>0&&Ne(),{status:`applied`,commentDraftsMoved:i.length>0}}function ze(e,t){return Ce.get(e)?.get(t)??Me(e)}function Be(e,t,n){if(n.revision!==je(e))return;let r=ze(e,t);if(r.body===n.body&&r.focused===n.focused)return;let i=Ce.get(e);i||(i=new Map,Ce.set(e,i)),n.body||n.focused?i.set(t,n):i.delete(t),i.size===0&&Ce.delete(e),Ne()}function Ve(e,t){let n=Ce.get(e);if(!n)return;let r=!1;for(let e of n.keys())e.endsWith(`:${t}`)&&(n.delete(e),r=!0);r&&(n.size===0&&Ce.delete(e),Ne())}function He(e,t){return Se.get(e)?.get(t)}function Ue(e,t,n,r){if(n!==je(e))return;let i=Se.get(e);i||(i=new Map,Se.set(e,i)),i.set(t,r)}function We(e,t,n){if(n!==je(e))return;let r=Se.get(e);r?.delete(t),r?.size===0&&Se.delete(e)}function Ge(e){Se.delete(e),Ce.delete(e),Ee.set(e,je(e)+1),we.delete(e),Ne()}function Ke({error:e}){if(!e)return null;let t=e instanceof Error?e.message:`予期しないエラーが発生しました。`,n=e instanceof d?e.code:null,r=e instanceof d?e.suggestions:[];return(0,j.jsxs)(`div`,{className:`error-notice`,role:`alert`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`strong`,{children:`処理に失敗しました。`}),n&&(0,j.jsx)(`code`,{children:n})]}),(0,j.jsx)(`p`,{children:t}),r.length>0&&(0,j.jsx)(`ul`,{children:r.map(e=>(0,j.jsx)(`li`,{children:e},e))})]})}function qe(e,t,n){e.key!==`Enter`||!e.metaKey&&!e.ctrlKey||e.repeat||e.nativeEvent.isComposing||(e.preventDefault(),t&&n())}function Je(){return(0,j.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 16 16`,width:`16`,height:`16`,children:(0,j.jsx)(`path`,{fill:`currentColor`,d:`M1.75 2.5A1.75 1.75 0 0 1 3.5.75h9A1.75 1.75 0 0 1 14.25 2.5v7A1.75 1.75 0 0 1 12.5 11.25H7.06l-3.88 3.1A.75.75 0 0 1 2 13.77v-2.7A1.75 1.75 0 0 1 1.75 9.5v-7Zm1.75-.25a.25.25 0 0 0-.25.25v7c0 .14.11.25.25.25V12.2l3.03-2.42a.75.75 0 0 1 .47-.17h5.5a.25.25 0 0 0 .25-.25V2.5a.25.25 0 0 0-.25-.25h-9Z`})})}function Ye({body:e,label:t,disabled:n=!1,pending:r,error:i,validationError:a,placement:o,onBodyChange:s,onCancel:c,onSubmit:l}){let u=!!e.trim()&&!n&&!r;return(0,j.jsxs)(`div`,{className:`inline-comment-composer inline-comment-composer--${o}`,children:[(0,j.jsx)(`strong`,{children:t}),(0,j.jsx)(`textarea`,{autoFocus:!0,rows:4,value:e,onChange:e=>s(e.target.value),onKeyDown:e=>{if(e.key===`Escape`&&!e.nativeEvent.isComposing){e.preventDefault(),c();return}qe(e,u,l)},placeholder:`コメントを入力(Markdown対応)`,"aria-label":t}),a&&(0,j.jsx)(`p`,{className:`form-error`,children:a}),(0,j.jsx)(Ke,{error:i}),(0,j.jsxs)(`div`,{className:`inline-comment-actions`,children:[(0,j.jsx)(`button`,{type:`button`,className:`button--quiet`,disabled:r,onPointerDown:e=>{e.preventDefault(),c()},onClick:c,children:`キャンセル`}),(0,j.jsx)(`button`,{type:`button`,disabled:!u,onClick:l,children:`コメント`})]})]})}function Xe(){}var Ze=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Qe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$e={};function et(e,t){return((t||$e).jsx?Qe:Ze).test(e)}var tt={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},nt=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MermaidExpandedView-BjmXfluL.js","assets/rolldown-runtime-hePW80VL.js","assets/MermaidSurface-B2Z3pJme.js","assets/FileIcon-AhP8Ezk9.js","assets/preload-helper-Czpn1I53.js"])))=>i.map(i=>d[i]);
2
+ import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{A as r,N as i,T as a,_ as o,g as s,k as c,p as l,t as u,x as d,y as f}from"./MermaidSurface-B2Z3pJme.js";import{c as p,i as m,o as h,r as g,s as _,t as v}from"./FileIcon-AhP8Ezk9.js";import{a as y,c as b,d as x,f as ee,i as S,l as C,n as w,o as T,r as E,s as D,t as te,u as ne}from"./ccount-DFmD81E1.js";import{t as re}from"./preload-helper-Czpn1I53.js";var O=class extends s{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||k(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=o({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),f.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function k(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ie=class extends i{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),c(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&d(t.mutationKey)!==d(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??k();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){f.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},A=t(p(),1);function ae(e,t){let n=l(t),[i]=A.useState(()=>new ie(n,e));A.useEffect(()=>{i.setOptions(e)},[i,e]);let o=A.useSyncExternalStore(A.useCallback(e=>i.subscribe(f.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),s=A.useCallback((e,t)=>{i.mutate(e,t).catch(a)},[i]);if(o.error&&r(i.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}var j=_(),oe={kind:`pull-request-markdown`};function M(e){return e.kind===`pull-request-markdown`?`pull-request-markdown`:e.kind===`walkthrough`?`walkthrough:${e.id}`:e.kind===`structure`?`structure:${e.id}`:`file:${e.path}`}function se(e,t){return`${e}:${M(t)}`}function ce(e){return e.kind===`pull-request-markdown`?`Pull Request.md`:e.kind===`walkthrough`||e.kind===`structure`?e.title:e.path}function le(e){let t=ce(e);return t.split(`/`).at(-1)??t}function ue(){return{documents:{left:[oe],right:[]},active:{left:oe,right:null},focusedPane:`left`,navigationRevision:{left:0,right:0}}}function de(e,t,n=!1){return t===e?e:{...t,navigationRevision:{left:e.navigationRevision.left+Number(n||e.active.left!==t.active.left),right:e.navigationRevision.right+Number(n||e.active.right!==t.active.right)}}}function fe(e){return e===`left`?`right`:`left`}function pe(e,t,n){let r=M(t);return e.documents[n].find(e=>M(e)===r)}function me(e,t){return[`left`,`right`].filter(n=>pe(e,t,n))}function he(e,t){let n=[];for(let r of[`left`,`right`]){let i=fe(r);for(let a of e.documents[r]){if(pe(t,a,r))continue;let e=pe(t,a,i);e&&n.push({sourceDocument:a,targetDocument:e,sourcePane:r,targetPane:i})}}return n}function ge(e,t){return pe(e,t,e.focusedPane)?e.focusedPane:me(e,t)[0]??e.focusedPane}function _e(e){return e.documents.left.length>0||e.documents.right.length===0?e:{...e,documents:{left:e.documents.right,right:[]},active:{left:e.active.right??e.documents.right[0]??null,right:null},focusedPane:`left`}}function ve(e,t,n){let r=M(t),i=e.documents[n].findIndex(e=>M(e)===r),a=i<0?[...e.documents[n],t]:e.documents[n].map((e,n)=>n===i?t:e);return{...e,documents:{...e.documents,[n]:a},active:{...e.active,[n]:t},focusedPane:n}}function ye(e,t,n,r){if(n===r)return ve(e,t,r);let i=M(t),a=e.documents[n].findIndex(e=>M(e)===i);if(a<0)return e;let o=e.documents[n].filter(e=>M(e)!==i),s=e.documents[r].findIndex(e=>M(e)===i),c=s<0?[...e.documents[r],t]:e.documents[r].map((e,n)=>n===s?t:e),l={...e.active,[r]:t};return e.active[n]&&M(e.active[n])===i&&(l[n]=o[Math.min(a,o.length-1)]??o.at(-1)??null),_e({...e,documents:{...e.documents,[n]:o,[r]:c},active:l,focusedPane:r})}function be(e,t,n){let r=M(t),i=n??[`left`,`right`].find(n=>e.documents[n].some(e=>e===t))??(pe(e,t,e.focusedPane)?e.focusedPane:me(e,t)[0]);if(!i)return e;let a=e.documents[i].findIndex(e=>M(e)===r);if(a<0)return e;let o=e.documents[i].filter(e=>M(e)!==r),s={...e.active};s[i]&&M(s[i])===r&&(s[i]=o[Math.min(a,o.length-1)]??o.at(-1)??null);let c=e.focusedPane===i&&!s[i]?fe(i):e.focusedPane;return _e({...e,documents:{...e.documents,[i]:o},active:s,focusedPane:c})}function xe(e){return e.kind===`pull-request-markdown`?{kind:`pull-request-markdown`}:e.kind===`walkthrough`||e.kind===`structure`||e.comparisonPolicy===`reference-target`?e:{kind:`repository-file`,path:e.path}}var Se=new Map,Ce=new Map,we=new Map,Te=new Set,Ee=new Map;function De(){return[...Se.values()].some(e=>e.size>0)||[...Ce.values()].some(e=>e.size>0)}function Oe(e){return e.kind===`pull-request-markdown`?[`pull-request-markdown`]:e.kind===`walkthrough`?[`walkthrough`,e.id,e.sourceOid]:e.kind===`structure`?[`structure`,e.id,e.sourceOid]:[`repository-file`,e.path,e.oldPath??null,e.newPath??null,e.sourceOid??null,e.comparisonPolicy??null,e.referenceContext?.latestHeadOid??null,e.referenceContext?.outcome??null]}function ke(e){return Array.isArray(e)?e[0]===`pull-request-markdown`?`pull-request-markdown`:e[0]===`walkthrough`&&typeof e[1]==`string`?`walkthrough:${e[1]}`:e[0]===`structure`&&typeof e[1]==`string`?`structure:${e[1]}`:e[0]===`repository-file`&&typeof e[1]==`string`?`file:${e[1]}`:null:null}function Ae(e){return JSON.stringify([e.pane,Oe(e.activeDocument),e.selectedOid,e.oldOid,e.displayMode])}function je(e){return Ee.get(e)??0}function Me(e){let t=je(e),n=we.get(e);if(n?.revision===t)return n;let r={revision:t,body:``,focused:!1};return we.set(e,r),r}function Ne(){for(let e of Te)e()}function Pe(e){return Te.add(e),()=>Te.delete(e)}function Fe(e,t){return se(e,t)}function Ie(e,t,n,r,i){if(r===i)return[];let a=Ce.get(e);if(!a)return[];let o=`inline:${Fe(r,t)}:`,s=`inline:${Fe(i,n)}:`;return[...a.entries()].filter(([e])=>e.startsWith(o)).map(([e,t])=>({sourceKey:e,targetKey:`${s}${e.slice(o.length)}`,draft:t}))}function Le(e,t,n,r){if(n===r)return[];let i=Se.get(e);if(!i)return[];let a=M(t),o=[];for(let[e,t]of i){let i;try{i=JSON.parse(e)}catch{continue}if(!Array.isArray(i)||i.length!==5||i[0]!==n||ke(i[1])!==a)continue;let s=i;o.push({sourceKey:e,targetKey:JSON.stringify([r,...s.slice(1)]),draft:t})}return o}function Re(e,t,n){let r=[],i=[];for(let a of he(t,n))r.push(...Ie(e,a.sourceDocument,a.targetDocument,a.sourcePane,a.targetPane)),i.push(...Le(e,a.sourceDocument,a.sourcePane,a.targetPane));let a=Ce.get(e),o=Se.get(e);if(r.some(({targetKey:e})=>a?.has(e))||i.some(({targetKey:e})=>o?.has(e)))return{status:`conflict`};for(let{sourceKey:e}of r)a?.delete(e);for(let{targetKey:e,draft:t}of r)a?.set(e,t);for(let{sourceKey:e}of i)o?.delete(e);for(let{targetKey:e,draft:t}of i)o?.set(e,t);return r.length>0&&Ne(),{status:`applied`,commentDraftsMoved:i.length>0}}function ze(e,t){return Ce.get(e)?.get(t)??Me(e)}function Be(e,t,n){if(n.revision!==je(e))return;let r=ze(e,t);if(r.body===n.body&&r.focused===n.focused)return;let i=Ce.get(e);i||(i=new Map,Ce.set(e,i)),n.body||n.focused?i.set(t,n):i.delete(t),i.size===0&&Ce.delete(e),Ne()}function Ve(e,t){let n=Ce.get(e);if(!n)return;let r=!1;for(let e of n.keys())e.endsWith(`:${t}`)&&(n.delete(e),r=!0);r&&(n.size===0&&Ce.delete(e),Ne())}function He(e,t){return Se.get(e)?.get(t)}function Ue(e,t,n,r){if(n!==je(e))return;let i=Se.get(e);i||(i=new Map,Se.set(e,i)),i.set(t,r)}function We(e,t,n){if(n!==je(e))return;let r=Se.get(e);r?.delete(t),r?.size===0&&Se.delete(e)}function Ge(e){Se.delete(e),Ce.delete(e),Ee.set(e,je(e)+1),we.delete(e),Ne()}function Ke({error:e}){if(!e)return null;let t=e instanceof Error?e.message:`予期しないエラーが発生しました。`,n=e instanceof g?e.code:null,r=e instanceof g?e.suggestions:[];return(0,j.jsxs)(`div`,{className:`error-notice`,role:`alert`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`strong`,{children:`処理に失敗しました。`}),n&&(0,j.jsx)(`code`,{children:n})]}),(0,j.jsx)(`p`,{children:t}),r.length>0&&(0,j.jsx)(`ul`,{children:r.map(e=>(0,j.jsx)(`li`,{children:e},e))})]})}function qe(e,t,n){e.key!==`Enter`||!e.metaKey&&!e.ctrlKey||e.repeat||e.nativeEvent.isComposing||(e.preventDefault(),t&&n())}function Je(){return(0,j.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 16 16`,width:`16`,height:`16`,children:(0,j.jsx)(`path`,{fill:`currentColor`,d:`M1.75 2.5A1.75 1.75 0 0 1 3.5.75h9A1.75 1.75 0 0 1 14.25 2.5v7A1.75 1.75 0 0 1 12.5 11.25H7.06l-3.88 3.1A.75.75 0 0 1 2 13.77v-2.7A1.75 1.75 0 0 1 1.75 9.5v-7Zm1.75-.25a.25.25 0 0 0-.25.25v7c0 .14.11.25.25.25V12.2l3.03-2.42a.75.75 0 0 1 .47-.17h5.5a.25.25 0 0 0 .25-.25V2.5a.25.25 0 0 0-.25-.25h-9Z`})})}function Ye({body:e,label:t,disabled:n=!1,pending:r,error:i,validationError:a,placement:o,onBodyChange:s,onCancel:c,onSubmit:l}){let u=!!e.trim()&&!n&&!r;return(0,j.jsxs)(`div`,{className:`inline-comment-composer inline-comment-composer--${o}`,children:[(0,j.jsx)(`strong`,{children:t}),(0,j.jsx)(`textarea`,{autoFocus:!0,rows:4,value:e,onChange:e=>s(e.target.value),onKeyDown:e=>{if(e.key===`Escape`&&!e.nativeEvent.isComposing){e.preventDefault(),c();return}qe(e,u,l)},placeholder:`コメントを入力(Markdown対応)`,"aria-label":t}),a&&(0,j.jsx)(`p`,{className:`form-error`,children:a}),(0,j.jsx)(Ke,{error:i}),(0,j.jsxs)(`div`,{className:`inline-comment-actions`,children:[(0,j.jsx)(`button`,{type:`button`,className:`button--quiet`,disabled:r,onPointerDown:e=>{e.preventDefault(),c()},onClick:c,children:`キャンセル`}),(0,j.jsx)(`button`,{type:`button`,disabled:!u,onClick:l,children:`コメント`})]})]})}function Xe(){}var Ze=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Qe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$e={};function et(e,t){return((t||$e).jsx?Qe:Ze).test(e)}var tt={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},nt=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
3
3
  `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),rt=n((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(nt());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),it=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),at=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(rt()),r=it();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),ot=ct(`end`),st=ct(`start`);function ct(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function lt(e){let t=st(e),n=ot(e);if(t&&n)return{start:t,end:n}}function ut(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?ft(e.position):`start`in e||`end`in e?ft(e):`line`in e||`column`in e?dt(e):``}function dt(e){return pt(e&&e.line)+`:`+pt(e&&e.column)}function ft(e){return dt(e&&e.start)+`-`+dt(e&&e.end)}function pt(e){return e&&typeof e==`number`?e:1}var N=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=ut(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};N.prototype.file=``,N.prototype.name=``,N.prototype.reason=``,N.prototype.message=``,N.prototype.stack=``,N.prototype.column=void 0,N.prototype.line=void 0,N.prototype.ancestors=void 0,N.prototype.cause=void 0,N.prototype.fatal=void 0,N.prototype.place=void 0,N.prototype.ruleId=void 0,N.prototype.source=void 0;var mt=t(at(),1),ht={}.hasOwnProperty,gt=new Map,_t=/[A-Z]/g,vt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),yt=new Set([`td`,`th`]);function bt(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=jt(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=At(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?D:T,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=xt(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function xt(e,t,n){if(t.type===`element`)return St(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Ct(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Tt(e,t,n);if(t.type===`mdxjsEsm`)return wt(e,t);if(t.type===`root`)return Et(e,t,n);if(t.type===`text`)return Dt(e,t)}function St(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=D,e.schema=i),e.ancestors.push(t);let a=Lt(e,t.tagName,!1),o=Mt(e,t),s=Pt(e,t);return vt.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!ne(e)})),Ot(e,o,a,t),kt(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ct(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Rt(e,t.position)}function wt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rt(e,t.position)}function Tt(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=D,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Lt(e,t.name,!0),o=Nt(e,t),s=Pt(e,t);return Ot(e,o,a,t),kt(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Et(e,t,n){let r={};return kt(r,Pt(e,t)),e.create(t,e.Fragment,r,n)}function Dt(e,t){return t.value}function Ot(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function kt(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function At(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function jt(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=st(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Mt(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&ht.call(t.properties,i)){let a=Ft(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&yt.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Nt(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Rt(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Rt(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Pt(e,t){let n=[],r=-1,i=e.passKeys?new Map:gt;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=xt(e,a,o);s!==void 0&&n.push(s)}return n}function Ft(e,t,n){let r=b(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?ee(n):y(n)),r.property===`style`){let t=typeof n==`object`?n:It(e,String(n));return e.stylePropertyNameCase===`css`&&(t=zt(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?tt[r.property]||r.property:r.attribute,n]}}function It(e,t){try{return(0,mt.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new N("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function Lt(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=et(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=et(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return ht.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Rt(e)}function Rt(e,t){let n=new N("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function zt(e){let t={},n;for(n in e)ht.call(e,n)&&(t[Bt(n)]=e[n]);return t}function Bt(e){let t=e.replace(_t,Vt);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Vt(e){return`-`+e.toLowerCase()}var Ht={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Ut={};function Wt(e,t){let n=t||Ut;return Gt(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Gt(e,t,n){if(qt(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Kt(e.children,t,n)}return Array.isArray(e)?Kt(e,t,n):``}function Kt(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Gt(e[i],t,n);return r.join(``)}function qt(e){return!!(e&&typeof e==`object`)}var Jt=document.createElement(`i`);function Yt(e){let t=`&`+e+`;`;Jt.innerHTML=t;let n=Jt.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function Xt(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Zt(e,t){return e.length>0?(Xt(e,e.length,0,t),e):t}var Qt={}.hasOwnProperty;function $t(e){let t={},n=-1;for(;++n<e.length;)en(t,e[n]);return t}function en(e,t){let n;for(n in t){let r=(Qt.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Qt.call(r,a)||(r[a]=[]);let e=i[a];tn(r[a],Array.isArray(e)?e:e?[e]:[])}}}function tn(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Xt(e,0,0,r)}function nn(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function rn(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var P=fn(/[A-Za-z]/),F=fn(/[\dA-Za-z]/),an=fn(/[#-'*+\--9=?A-Z^-~]/);function on(e){return e!==null&&(e<32||e===127)}var sn=fn(/\d/),cn=fn(/[\dA-Fa-f]/),ln=fn(/[!-/:-@[-`{-~]/);function I(e){return e!==null&&e<-2}function L(e){return e!==null&&(e<0||e===32)}function R(e){return e===-2||e===-1||e===32}var un=fn(/\p{P}|\p{S}/u),dn=fn(/\s/);function fn(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function pn(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&F(e.charCodeAt(n+1))&&F(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function z(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return R(r)?(e.enter(n),s(r)):t(r)}function s(r){return R(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var mn={tokenize:hn};function hn(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),z(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return I(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var gn={tokenize:vn},_n={tokenize:yn};function vn(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Xt(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(_n,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(_n,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return I(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;Xt(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function yn(e,t,n){return z(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function bn(e){if(e===null||L(e)||dn(e))return 1;if(un(e))return 2}function xn(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Sn={name:`attention`,resolveAll:Cn,tokenize:wn};function Cn(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Tn(d,-c),Tn(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Zt(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Zt(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Zt(l,xn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Zt(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Zt(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Xt(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function wn(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=bn(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=bn(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Tn(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var En={name:`autolink`,tokenize:Dn};function Dn(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return P(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||F(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||F(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||on(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):an(t)?(e.consume(t),l):n(t)}function u(e){return F(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||F(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var On={partial:!0,tokenize:kn};function kn(e,t,n){return r;function r(t){return R(t)?z(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||I(e)?t(e):n(e)}}var An={continuation:{tokenize:Mn},exit:Nn,name:`blockQuote`,tokenize:jn};function jn(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return R(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Mn(e,t,n){let r=this;return i;function i(t){return R(t)?z(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(An,t,n)(r)}}function Nn(e){e.exit(`blockQuote`)}var Pn={name:`characterEscape`,tokenize:Fn};function Fn(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return ln(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var In={name:`characterReference`,tokenize:Ln};function Ln(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=F,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=cn,u):(e.enter(`characterReferenceValue`),a=7,o=sn,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===F&&!Yt(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Rn={partial:!0,tokenize:Vn},zn={concrete:!0,name:`codeFenced`,tokenize:Bn};function Bn(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),R(t)?z(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||I(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Rn,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||I(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):R(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),z(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||I(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||I(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&R(t)?z(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||I(t)?e.check(Rn,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||I(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),R(t)?z(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),R(t)?z(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||I(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Vn(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Hn={name:`codeIndented`,tokenize:Wn},Un={partial:!0,tokenize:Gn};function Wn(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),z(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):I(t)?e.attempt(Un,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||I(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Gn(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):I(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):z(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):I(e)?i(e):n(e)}}var Kn={name:`codeText`,previous:Jn,resolve:qn,tokenize:Yn};function qn(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Jn(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Yn(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):I(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||I(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Xn=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Zn(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Zn(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Zn(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Zn(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Zn(this.left,t.reverse())}}}};function Zn(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Qn(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Xn(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,$n(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Xt(e,0,1/0,u.slice(0)),!l}function $n(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var er={resolve:nr,tokenize:rr},tr={partial:!0,tokenize:ir};function nr(e){return Qn(e),e}function rr(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):I(t)?e.check(tr,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function ir(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),z(e,a,`linePrefix`)}function a(i){if(i===null||I(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function ar(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||on(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||I(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||L(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||on(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function or(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):I(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||I(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!R(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function sr(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):I(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),z(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||I(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function cr(e,t){let n;return r;function r(i){return I(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):R(i)?z(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var lr={name:`definition`,tokenize:dr},ur={partial:!0,tokenize:fr};function dr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return or.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=rn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return L(t)?cr(e,l)(t):l(t)}function l(t){return ar(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(ur,d,d)(t)}function d(t){return R(t)?z(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||I(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function fr(e,t,n){return r;function r(t){return L(t)?cr(e,i)(t):n(t)}function i(t){return sr(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return R(t)?z(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||I(e)?t(e):n(e)}}var pr={name:`hardBreakEscape`,tokenize:mr};function mr(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return I(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var hr={name:`headingAtx`,resolve:gr,tokenize:_r};function gr(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},Xt(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function _r(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||L(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||I(n)?(e.exit(`atxHeading`),t(n)):R(n)?z(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||L(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var vr=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),yr=[`pre`,`script`,`style`,`textarea`],br={concrete:!0,name:`htmlFlow`,resolveTo:Cr,tokenize:wr},xr={partial:!0,tokenize:Er},Sr={partial:!0,tokenize:Tr};function Cr(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function wr(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ae):P(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):P(a)?(e.consume(a),i=4,r.interrupt?t:ae):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ae):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return P(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||L(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&yr.includes(l)?(i=1,r.interrupt?t(s):D(s)):vr.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||F(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return R(t)?(e.consume(t),v):T(t)}function y(t){return t===47?(e.consume(t),T):t===58||t===95||P(t)?(e.consume(t),b):R(t)?(e.consume(t),y):T(t)}function b(t){return t===45||t===46||t===58||t===95||F(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),ee):R(t)?(e.consume(t),x):y(t)}function ee(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,S):R(t)?(e.consume(t),ee):C(t)}function S(t){return t===c?(e.consume(t),c=null,w):t===null||I(t)?n(t):(e.consume(t),S)}function C(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||L(t)?x(t):(e.consume(t),C)}function w(e){return e===47||e===62||R(e)?y(e):n(e)}function T(t){return t===62?(e.consume(t),E):n(t)}function E(t){return t===null||I(t)?D(t):R(t)?(e.consume(t),E):n(t)}function D(t){return t===45&&i===2?(e.consume(t),O):t===60&&i===1?(e.consume(t),k):t===62&&i===4?(e.consume(t),j):t===63&&i===3?(e.consume(t),ae):t===93&&i===5?(e.consume(t),A):I(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(xr,oe,te)(t)):t===null||I(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),D)}function te(t){return e.check(Sr,ne,oe)(t)}function ne(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return t===null||I(t)?te(t):(e.enter(`htmlFlowData`),D(t))}function O(t){return t===45?(e.consume(t),ae):D(t)}function k(t){return t===47?(e.consume(t),o=``,ie):D(t)}function ie(t){if(t===62){let n=o.toLowerCase();return yr.includes(n)?(e.consume(t),j):D(t)}return P(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ie):D(t)}function A(t){return t===93?(e.consume(t),ae):D(t)}function ae(t){return t===62?(e.consume(t),j):t===45&&i===2?(e.consume(t),ae):D(t)}function j(t){return t===null||I(t)?(e.exit(`htmlFlowData`),oe(t)):(e.consume(t),j)}function oe(n){return e.exit(`htmlFlow`),t(n)}}function Tr(e,t,n){let r=this;return i;function i(t){return I(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Er(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(On,t,n)}}var Dr={name:`htmlText`,tokenize:Or};function Or(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):P(t)?(e.consume(t),C):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):P(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):I(t)?(o=d,k(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?O(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):I(t)?(o=h,k(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?O(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?O(t):I(t)?(o=v,k(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):I(t)?(o=y,k(t)):(e.consume(t),y)}function b(e){return e===62?O(e):y(e)}function x(t){return P(t)?(e.consume(t),ee):n(t)}function ee(t){return t===45||F(t)?(e.consume(t),ee):S(t)}function S(t){return I(t)?(o=S,k(t)):R(t)?(e.consume(t),S):O(t)}function C(t){return t===45||F(t)?(e.consume(t),C):t===47||t===62||L(t)?w(t):n(t)}function w(t){return t===47?(e.consume(t),O):t===58||t===95||P(t)?(e.consume(t),T):I(t)?(o=w,k(t)):R(t)?(e.consume(t),w):O(t)}function T(t){return t===45||t===46||t===58||t===95||F(t)?(e.consume(t),T):E(t)}function E(t){return t===61?(e.consume(t),D):I(t)?(o=E,k(t)):R(t)?(e.consume(t),E):w(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):I(t)?(o=D,k(t)):R(t)?(e.consume(t),D):(e.consume(t),ne)}function te(t){return t===i?(e.consume(t),i=void 0,re):t===null?n(t):I(t)?(o=te,k(t)):(e.consume(t),te)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||L(t)?w(t):(e.consume(t),ne)}function re(e){return e===47||e===62||L(e)?w(e):n(e)}function O(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function k(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ie}function ie(t){return R(t)?z(e,A,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):A(t)}function A(t){return e.enter(`htmlTextData`),o(t)}}var kr={name:`labelEnd`,resolveAll:Nr,resolveTo:Pr,tokenize:Fr},Ar={tokenize:Ir},jr={tokenize:Lr},Mr={tokenize:Rr};function Nr(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Xt(e,0,e.length,n),e}function Pr(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Zt(s,e.slice(a+1,a+r+3)),s=Zt(s,[[`enter`,u,t]]),s=Zt(s,xn(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Zt(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Zt(s,e.slice(o+1)),s=Zt(s,[[`exit`,c,t]]),Xt(e,a,e.length,s),e}function Fr(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(rn(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Ar,u,o?u:d)(t):t===91?e.attempt(jr,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Mr,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Ir(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return L(t)?cr(e,a)(t):a(t)}function a(t){return t===41?u(t):ar(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return L(t)?cr(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?sr(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return L(t)?cr(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Lr(e,t,n){let r=this;return i;function i(t){return or.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(rn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Rr(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var zr={name:`labelStartImage`,resolveAll:kr.resolveAll,tokenize:Br};function Br(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Vr={name:`labelStartLink`,resolveAll:kr.resolveAll,tokenize:Hr};function Hr(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Ur={name:`lineEnding`,tokenize:Wr};function Wr(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),z(e,t,`linePrefix`)}}var Gr={name:`thematicBreak`,tokenize:Kr};function Kr(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||I(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),R(t)?z(e,s,`whitespace`)(t):s(t))}}var B={continuation:{tokenize:Xr},exit:Qr,name:`list`,tokenize:Yr},qr={partial:!0,tokenize:$r},Jr={partial:!0,tokenize:Zr};function Yr(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:sn(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Gr,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return sn(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(On,r.interrupt?n:u,e.attempt(qr,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return R(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Xr(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(On,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,z(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!R(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Jr,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,z(e,e.attempt(B,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Zr(e,t,n){let r=this;return z(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Qr(e){e.exit(this.containerState.type)}function $r(e,t,n){let r=this;return z(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!R(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var ei={name:`setextUnderline`,resolveTo:ti,tokenize:ni};function ti(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function ni(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),R(t)?z(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||I(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var ri={tokenize:ii};function ii(e){let t=this,n=e.attempt(On,r,e.attempt(this.parser.constructs.flowInitial,i,z(e,e.attempt(this.parser.constructs.flow,i,e.attempt(er,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var ai={resolveAll:li()},oi=ci(`string`),si=ci(`text`);function ci(e){return{resolveAll:li(e===`text`?ui:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function li(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function ui(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var di=e({attentionMarkers:()=>yi,contentInitial:()=>pi,disable:()=>bi,document:()=>fi,flow:()=>hi,flowInitial:()=>mi,insideSpan:()=>vi,string:()=>gi,text:()=>_i}),fi={42:B,43:B,45:B,48:B,49:B,50:B,51:B,52:B,53:B,54:B,55:B,56:B,57:B,62:An},pi={91:lr},mi={[-2]:Hn,[-1]:Hn,32:Hn},hi={35:hr,42:Gr,45:[ei,Gr],60:br,61:ei,95:Gr,96:zn,126:zn},gi={38:In,92:Pn},_i={[-5]:Ur,[-4]:Ur,[-3]:Ur,33:zr,38:In,42:Sn,60:[En,Dr],91:Vr,92:[pr,Pn],93:kr,95:Sn,96:Kn},vi={null:[Sn,ai]},yi={null:[42,95]},bi={null:[]};function xi(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:S(x),check:S(ee),consume:v,enter:y,exit:b,interrupt:S(ee,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Zt(o,e),g(),o[o.length-1]===null?(C(t,0),l.events=xn(a,l.events,l),l.events):[]}function f(e,t){return Ci(p(e),t)}function p(e){return Si(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,T()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){I(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,T()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){C(e,t.from)}function ee(e,t){t.restore()}function S(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=w(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function C(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Xt(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function w(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Si(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Ci(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
4
4
  `;break;case-3:o=`\r
5
5
  `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function wi(e){let t={constructs:$t([di,...(e||{}).extensions||[]]),content:n(mn),defined:[],document:n(gn),flow:n(ri),lazy:{},string:n(oi),text:n(si)};return t;function n(e){return n;function n(n){return xi(t,e,n)}}}function Ti(e){for(;!Qn(e););return e}var Ei=/[\0\t\n\r]/g;function Di(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Ei.lastIndex=u,c=Ei.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Oi=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ki(e){return e.replace(Oi,Ai)}function Ai(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return nn(n.slice(t?2:1),t?16:10)}return Yt(n)||e}var ji={}.hasOwnProperty;function Mi(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Ni(n)(Ti(wi(n).document().write(Di()(e,t,!0))))}function Ni(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Se),autolinkProtocol:w,autolinkEmail:w,atxHeading:a(ve),blockQuote:a(pe),characterEscape:w,characterReference:w,codeFenced:a(me),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(me,o),codeText:a(he,o),codeTextData:w,data:w,codeFlowValue:w,definition:a(ge),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(_e),hardBreakEscape:a(ye),hardBreakTrailing:a(ye),htmlFlow:a(be,o),htmlFlowData:w,htmlText:a(be,o),htmlTextData:w,image:a(xe),label:o,link:a(Se),listItem:a(we),listItemValue:f,listOrdered:a(Ce,d),listUnordered:a(Ce),paragraph:a(Te),reference:M,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ve),strong:a(Ee),thematicBreak:a(Oe)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:fe,autolinkProtocol:de,blockQuote:c(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:le,characterReference:ue,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:T,codeIndented:c(_),codeText:c(re),codeTextData:T,data:T,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(te),htmlFlowData:T,htmlText:c(ne),htmlTextData:T,image:c(k),label:A,labelText:ie,lineEnding:E,link:c(O),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:se,resourceDestinationString:ae,resourceTitleString:j,resource:oe,setextHeading:c(C),setextHeadingLineSequence:S,setextHeadingText:ee,strong:c(),thematicBreak:c()}};Fi(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];ji.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Li).call(a,void 0,e[0])}for(r.position={start:Pi(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Pi(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Pi(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Li).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+ut({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Pi(e.end)}function u(){return Wt(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=rn(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function ee(){this.data.setextHeadingSlurpLineEnding=!0}function S(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function C(){this.data.setextHeadingSlurpLineEnding=void 0}function w(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=De(),n.position={start:Pi(e.start),end:void 0},t.push(n)),this.stack.push(n)}function T(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Pi(e.end)}function E(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Pi(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(w.call(this,e),T.call(this,e))}function D(){this.data.atHardBreak=!0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function O(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function k(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ie(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=ki(t),n.identifier=rn(t).toLowerCase()}function A(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ae(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function oe(){this.data.inReference=void 0}function M(){this.data.referenceType=`collapsed`}function se(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=rn(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ce(e){this.data.characterReferenceType=e.type}function le(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=nn(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Yt(t);let i=this.stack[this.stack.length-1];i.value+=r}function ue(e){let t=this.stack.pop();t.position.end=Pi(e.end)}function de(e){T.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function fe(e){T.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function pe(){return{type:`blockquote`,children:[]}}function me(){return{type:`code`,lang:null,meta:null,value:``}}function he(){return{type:`inlineCode`,value:``}}function ge(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function _e(){return{type:`emphasis`,children:[]}}function ve(){return{type:`heading`,depth:0,children:[]}}function ye(){return{type:`break`}}function be(){return{type:`html`,value:``}}function xe(){return{type:`image`,title:null,url:``,alt:null}}function Se(){return{type:`link`,title:null,url:``,children:[]}}function Ce(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function we(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Te(){return{type:`paragraph`,children:[]}}function Ee(){return{type:`strong`,children:[]}}function De(){return{type:`text`,value:``}}function Oe(){return{type:`thematicBreak`}}}function Pi(e){return{line:e.line,column:e.column,offset:e.offset}}function Fi(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Fi(e,r):Ii(e,r)}}function Ii(e,t){let n;for(n in t)if(ji.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Li(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+ut({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ut({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+ut({start:t.start,end:t.end})+`) is still open`)}function Ri(e){let t=this;t.parser=n;function n(n){return Mi(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function zi(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Bi(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
@@ -28,6 +28,6 @@ import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{D as r,L
28
28
  `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
29
29
  `,...a.current()});return/^[\t ]/.test(l)&&(l=Dp(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Np.peek=Pp;function Np(e){return e.value||``}function Pp(){return`<`}Fp.peek=Ip;function Fp(e,t,n,r){let i=wp(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Ip(){return`!`}Lp.peek=Rp;function Lp(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Rp(){return`!`}zp.peek=Bp;function zp(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Bp(){return"`"}function Vp(e,t){let n=Wt(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Hp.peek=Up;function Hp(e,t,n,r){let i=wp(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(Vp(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Up(e,t,n){return Vp(e,n)?`<`:`[`}Wp.peek=Gp;function Wp(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Gp(){return`[`}function Kp(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function qp(e){let t=Kp(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Jp(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Yp(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Xp(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Jp(n):Kp(n),s=e.ordered?o===`.`?`)`:`.`:qp(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Yp(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Zp(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Qp(e,t,n,r){let i=Zp(n),a=n.bulletCurrent||Kp(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function $p(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var em=Ma([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function tm(e,t,n,r){return(e.children.some(function(e){return em(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function nm(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}rm.peek=im;function rm(e,t,n,r){let i=nm(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Op(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Dp(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Op(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Dp(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function im(e,t,n){return n.options.strong||`*`}function am(e,t,n,r){return n.safe(e.value,r)}function om(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function sm(e,t,n){let r=(Yp(n)+(n.options.ruleSpaces?` `:``)).repeat(om(n));return n.options.ruleSpaces?r.slice(0,-1):r}var cm={blockquote:mp,break:vp,code:Sp,definition:Tp,emphasis:kp,hardBreak:vp,heading:Mp,html:Np,image:Fp,imageReference:Lp,inlineCode:zp,link:Hp,linkReference:Wp,list:Xp,listItem:Qp,paragraph:$p,root:tm,strong:rm,text:am,thematicBreak:sm};function lm(){return{enter:{table:um,tableData:mm,tableHeader:mm,tableRow:fm},exit:{codeText:hm,table:dm,tableData:pm,tableHeader:pm,tableRow:pm}}}function um(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function dm(e){this.exit(e),this.data.inTable=void 0}function fm(e){this.enter({type:`tableRow`,children:[]},e)}function pm(e){this.exit(e)}function mm(e){this.enter({type:`tableCell`,children:[]},e)}function hm(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gm));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gm(e,t){return t===`|`?t:e}function _m(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
30
30
  `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
31
- `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return dp(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=cm.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function vm(){return{exit:{taskListCheckValueChecked:bm,taskListCheckValueUnchecked:bm,paragraph:xm}}}function ym(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Sm}}}function bm(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function xm(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Sm(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=cm.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Cm(){return[kf(),$f(),ip(),lm(),vm()]}function wm(e){return{extensions:[Af(),ep(e),ap(),_m(e),ym()]}}var Tm={tokenize:zm,partial:!0},Em={tokenize:Bm,partial:!0},Dm={tokenize:Vm,partial:!0},Om={tokenize:Hm,partial:!0},km={tokenize:Um,partial:!0},Am={name:`wwwAutolink`,tokenize:Lm,previous:Wm},jm={name:`protocolAutolink`,tokenize:Rm,previous:Gm},Mm={name:`emailAutolink`,tokenize:Im,previous:Km},Nm={};function Pm(){return{text:Nm}}for(var Fm=48;Fm<123;)Nm[Fm]=Mm,Fm++,Fm===58?Fm=65:Fm===91&&(Fm=97);Nm[43]=Mm,Nm[45]=Mm,Nm[46]=Mm,Nm[95]=Mm,Nm[72]=[Mm,jm],Nm[104]=[Mm,jm],Nm[87]=[Mm,Am],Nm[119]=[Mm,Am];function Im(e,t,n){let r=this,i,a;return o;function o(t){return!qm(t)||!Km.call(r,r.previous)||Jm(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return qm(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(km,u,l)(t):t===45||t===95||F(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&P(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Lm(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Wm.call(r,r.previous)||Jm(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Tm,e.attempt(Em,e.attempt(Dm,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Rm(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Gm.call(r,r.previous)&&!Jm(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(P(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||on(t)||L(t)||dn(t)||un(t)?n(t):e.attempt(Em,e.attempt(Dm,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function zm(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Bm(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Om,c,s)(t):t===null||L(t)||dn(t)||t!==45&&un(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Vm(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Om,t,a)(o):o===null||L(o)||dn(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Hm(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||L(o)||dn(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||L(e)||dn(e)?t(e):r(e)}function a(e){return P(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):P(t)?(e.consume(t),o):n(t)}}function Um(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return F(e)?n(e):t(e)}}function Wm(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||L(e)}function Gm(e){return!P(e)}function Km(e){return!(e===47||qm(e))}function qm(e){return e===43||e===45||e===46||e===95||F(e)}function Jm(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Ym={tokenize:rh,partial:!0};function Xm(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:eh,continuation:{tokenize:th},exit:nh}},text:{91:{name:`gfmFootnoteCall`,tokenize:$m},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Zm,resolveTo:Qm}}}}function Zm(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=rn(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Qm(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function $m(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||L(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(rn(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return L(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function eh(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||L(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=rn(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return L(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),z(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function th(e,t,n){return e.check(On,t,e.attempt(Ym,t,n))}function nh(e){e.exit(`gfmFootnoteDefinition`)}function rh(e,t,n){let r=this;return z(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function ih(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Xt(o,o.length,0,xn(s,e.slice(r+1,n),t)),Xt(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Xt(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=bn(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=bn(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var ah=class{constructor(){this.map=[]}add(e,t,n){oh(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function oh(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function sh(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function ch(){return{flow:{null:{name:`table`,tokenize:lh,resolveAll:uh}}}}function lh(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?ee:c;return a===ee&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):I(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):R(t)?z(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||L(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,R(t)?z(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return R(t)?z(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||I(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return R(t)?z(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||I(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function ee(t){return e.enter(`tableRow`),S(t)}function S(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),S):n===null||I(n)?(e.exit(`tableRow`),t(n)):R(n)?z(e,S,`whitespace`)(n):(e.enter(`data`),C(n))}function C(t){return t===null||t===124||L(t)?(e.exit(`data`),S(t)):(e.consume(t),t===92?w:C)}function w(t){return t===92||t===124?(e.consume(t),C):C(t)}}function uh(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new ah;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(fh(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=dh(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=dh(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=dh(f,t,o,i,n,d)):(o[0]=o[1],d=dh(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&fh(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=sh(t.events,n))}return e}function dh(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},ph(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=ph(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=ph(t.events,n[2]),a=ph(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},ph(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function fh(e,t,n,r,i){let a=[],o=ph(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function ph(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var mh={name:`tasklistCheck`,tokenize:gh};function hh(){return{text:{91:mh}}}function gh(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return L(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return I(r)?t(r):R(r)?e.check({tokenize:_h},t,n)(r):n(r)}}function _h(e,t,n){return z(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function vh(e){return $t([Pm(),Xm(),ih(e),ch(),hh()])}var yh={};function bh(e){let t=this,n=e||yh,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(vh(n)),a.push(Cm()),o.push(wm(n))}var xh=[`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.avif`,`.svg`],Sh=/^\/user-attachments\/assets\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;new TextDecoder(`utf-8`,{fatal:!0});function Ch(e){let t=e.toLowerCase();return xh.some(e=>t.endsWith(e))}function wh(e){if(!e?.startsWith(`https://github.com/`))return null;let t;try{t=new URL(e)}catch{return null}return t.protocol!==`https:`||t.hostname!==`github.com`||t.username!==``||t.password!==``||t.port!==``||t.search!==``||t.hash!==``||!Sh.test(t.pathname)?null:t.href}var Th=/^[A-Za-z][A-Za-z\d+.-]*:/;function Eh(e,t,n){return`/api/pull-requests/${e}/markdown-asset?${new URLSearchParams({sourceOid:t,path:n}).toString()}`}function Dh(e,t){let n=wh(t);return n?`/api/pull-requests/${e}/github-attachment?${new URLSearchParams({url:n}).toString()}`:null}function Oh(e,t){return!!(e&&Math.hypot(t.x-e.x,t.y-e.y)>4)}function kh(e){if(!e)return!1;let t=e.trim();return Th.test(t)||t.startsWith(`//`)}function Ah(e,t){if(!e)return null;let n=e.trim();if(n.length===0||n.startsWith(`#`)||n.startsWith(`?`)||kh(n))return null;let r=n.split(/[?#]/,1)[0];if(!r)return null;let i;try{i=decodeURIComponent(r).replaceAll(`\\`,`/`)}catch{return null}let a=i.startsWith(`/`)?[]:t?.split(`/`).slice(0,-1).filter(Boolean)??[];for(let e of i.split(`/`))if(!(!e||e===`.`)){if(e===`..`){if(a.length===0)return null;a.pop();continue}if(e.includes(`\0`))return null;a.push(e)}return a.length>0?a.join(`/`):null}var jh=new Map,Mh={...ef,protocols:{...ef.protocols,href:[...ef.protocols?.href??[],`rvw-ref`]}};function Nh(e){return e?.startsWith(`rvw-ref:`)?e.slice(8):null}function Ph(e){return e.startLine===null||e.endLine===null?null:e.startLine===e.endLine?`L${e.startLine}`:`L${e.startLine}–${e.endLine}`}function Fh(e){let t=Ph(e);return t?`${e.path}:${t}`:e.path}function Ih({reference:e,children:t,className:n,onOpen:r}){return(0,j.jsxs)(`button`,{className:[`code-inline-reference`,n].filter(Boolean).join(` `),title:Fh(e),onPointerDown:e=>{e.button===0&&jh.set(e.pointerId,{x:e.clientX,y:e.clientY})},onPointerUp:t=>{let n=jh.get(t.pointerId);jh.delete(t.pointerId),!(!n||Math.hypot(t.clientX-n.x,t.clientY-n.y)>4)&&(t.preventDefault(),t.stopPropagation(),r(e,t.metaKey||t.ctrlKey))},onPointerCancel:e=>{jh.delete(e.pointerId)},onClick:t=>{t.preventDefault(),t.detail===0&&r(e,!1)},onContextMenu:e=>{(e.ctrlKey||e.metaKey)&&e.preventDefault()},children:[(0,j.jsx)(p,{path:e.path,kind:`file`}),(0,j.jsx)(`span`,{children:t}),(0,j.jsx)(`small`,{children:Ph(e)??`File`})]})}function Lh({alt:e,title:t,sourceAttributes:n,reason:r=`blocked`}){let i=e?.trim()||t?.trim()||`説明なし`,a=r===`load-error`?`画像を読み込めません`:`画像を自動読み込みしません`;return(0,j.jsxs)(`span`,{...n,className:`markdown-image-placeholder`,role:`img`,"aria-label":`画像: ${i}(${r===`load-error`?`読み込み失敗`:`自動読み込み停止`})`,children:[a,`: `,i]})}function Rh({src:e,alt:t,title:n,sourceAttributes:r,...i}){let[a,o]=(0,A.useState)(null),s=a===e;return(0,A.useEffect)(()=>{a!==null&&a!==e&&o(null)},[a,e]),s?(0,j.jsx)(Lh,{alt:t,title:n,sourceAttributes:r,reason:`load-error`}):(0,j.jsx)(`img`,{...r,...i,src:e,alt:t??``,title:n,onError:()=>o(e)})}var zh=(0,A.lazy)(async()=>({default:(await re(()=>import(`./MermaidExpandedView-CyWRss2q.js`),__vite__mapDeps([0,1,2,3]))).MermaidExpandedView}));function Bh(){return(0,j.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 16 16`,children:(0,j.jsx)(`path`,{d:`M6.25 2.5H2.5v3.75M9.75 2.5h3.75v3.75M6.25 13.5H2.5V9.75M9.75 13.5h3.75V9.75`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.35`})})}function Vh({source:e,themePreference:t,renderIdPrefix:n,review:r,renderInline:i}){let[a,o]=(0,A.useState)(!1);return(0,j.jsxs)(j.Fragment,{children:[i((0,j.jsx)(`button`,{type:`button`,className:`mermaid-expand-button`,"aria-label":`Mermaid diagramを拡大`,"aria-haspopup":`dialog`,title:`Expand Mermaid diagram`,onClick:()=>o(!0),children:(0,j.jsx)(Bh,{})})),a&&(0,j.jsx)(A.Suspense,{fallback:null,children:(0,j.jsx)(zh,{source:e,themePreference:t,renderIdPrefix:n,review:r,onClose:()=>o(!1)})})]})}function Hh(e){return A.Children.toArray(e).map(e=>typeof e==`string`||typeof e==`number`?String(e):(0,A.isValidElement)(e)?Hh(e.props.children):``).join(``)}function Uh({source:e,themePreference:t,review:n}){let r=(0,A.useRef)(null),[i,a]=(0,A.useState)(!1);return(0,A.useEffect)(()=>{let e=r.current;if(!e)return;if(!(`IntersectionObserver`in window)){a(!0);return}let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(a(!0),t.disconnect())},{rootMargin:`160px`});return t.observe(e),()=>t.disconnect()},[]),(0,j.jsx)(Vh,{source:e,themePreference:t,renderIdPrefix:`rvwComment`,review:n,renderInline:n=>(0,j.jsxs)(`div`,{className:`comment-mermaid-shell`,ref:r,children:[(0,j.jsxs)(`div`,{className:`comment-mermaid-toolbar`,children:[(0,j.jsx)(`span`,{children:`Mermaid diagram`}),n]}),i?(0,j.jsx)(h,{className:`comment-mermaid`,role:`img`,"aria-label":`Mermaid diagram`,source:e,themePreference:t,renderIdPrefix:`rvwComment`,errorClassName:`comment-mermaid-error`}):(0,j.jsx)(`div`,{className:`comment-mermaid-placeholder`,children:`diagramを準備しています…`})]})})}function Wh({body:e,pullRequestId:t,sourceOid:n,sourcePath:r,references:i,themePreference:a,mermaidReview:o,onOpenCodeReference:s,onOpenRepositoryLink:c}){let l=(0,A.useRef)(null),u=(0,A.useMemo)(()=>new Map(i.map(e=>[e.id,e])),[i]),d=(0,A.useMemo)(()=>({table:({children:e,node:t,...n})=>(0,j.jsx)(`div`,{className:`comment-markdown-table-scroll`,children:(0,j.jsx)(`table`,{...n,children:e})}),a:({href:e,children:t,node:i,...a})=>{let o=Nh(e);if(o!==null){let e=u.get(o);return e&&s?(0,j.jsx)(Ih,{reference:e,className:`comment-inline-reference`,onOpen:s,children:t}):(0,j.jsx)(`span`,{children:t})}let d=Ah(e,r);if(!d){if(!e)return(0,j.jsx)(`span`,{children:t});let n=kh(e);return(0,j.jsx)(`a`,{...a,href:e,target:n?`_blank`:void 0,rel:n?`noopener noreferrer`:void 0,children:t})}return c?(0,j.jsx)(`a`,{...a,href:e,onPointerDown:e=>{e.button===0&&(l.current={x:e.clientX,y:e.clientY})},onPointerUp:e=>{if(e.button!==0||!l.current)return;let t=Oh(l.current,{x:e.clientX,y:e.clientY});if(l.current=null,t){e.currentTarget.dataset.rvwLinkDragged=`true`;return}e.preventDefault(),c(d,n,e.metaKey||e.ctrlKey)},onPointerCancel:()=>{l.current=null},onClick:e=>{if(e.preventDefault(),e.currentTarget.dataset.rvwLinkDragged===`true`){delete e.currentTarget.dataset.rvwLinkDragged;return}e.detail===0&&c(d,n,!1)},onContextMenu:e=>{(e.ctrlKey||e.metaKey)&&e.preventDefault()},children:t}):(0,j.jsx)(`span`,{className:`comment-markdown-unavailable-link`,title:d,children:t})},img:({src:e,alt:i,title:a,node:o,...s})=>{let c=Ah(e,r);return c?(0,j.jsx)(Rh,{...s,src:Eh(t,n,c),alt:i,title:a,sourceAttributes:{}}):(0,j.jsx)(Lh,{alt:i,title:a,sourceAttributes:{}})},pre:({children:e,node:t,...n})=>{let r=A.Children.count(e)===1?A.Children.only(e):null;return!(0,A.isValidElement)(r)||!r.props.className?.split(/\s+/u).includes(`language-mermaid`)?(0,j.jsx)(`pre`,{...n,children:e}):(0,j.jsx)(Uh,{source:Hh(r.props.children).trim(),themePreference:a,review:o})}}),[s,c,t,u,o,n,r,a]);return(0,j.jsx)(`div`,{className:`comment-markdown`,children:(0,j.jsx)(Vo,{rehypePlugins:[Qd,[vf,Mh]],remarkPlugins:[bh,Ef],urlTransform:e=>e.startsWith(`rvw-ref:`)?e:Go(e),components:d,children:e})})}var Gh=new Map,Kh=new Set,qh=2400;function Jh(e,t){if(e.target.kind===`pull-request`||e.target.startLine===null)return null;let n=t&&!t.outdated?t.range:null,r=n?.startLine??e.target.startLine,i=n?.endLine??e.target.endLine??r;return r===i?`L${r}`:`L${r}–${i}`}function Yh(e,t,n){if(e.target.kind===`pull-request`)return`Pull Request全体`;if(e.target.kind===`walkthrough`)return[e.target.walkthroughTitle,Jh(e,t)??`ウォークスルー全体`].join(` · `);let r=t?.path??(e.target.documentKind===`pull-request-markdown`?`Pull Request.md`:e.target.path),i=Jh(e,t)??`文書全体`;return[r,n===`deletions`?`変更前`:n===`additions`?`変更後`:null,i].filter(Boolean).join(` · `)}function Xh(e,t,n){if(e.target.kind===`pull-request`)return`Pull Request全体`;if(e.target.kind===`walkthrough`)return Jh(e,t)??`ウォークスルー全体`;let r=Jh(e,t)??(e.target.documentKind===`pull-request-markdown`?`文書全体`:`ファイル全体`);return n===`deletions`?`変更前 · ${r}`:r}function Zh(e){return e.target.kind===`pull-request`?`Pull Request.mdを開く`:`コメント対象を開く`}function Qh(e){let t=new Date(e);return Number.isNaN(t.valueOf())?e:new Intl.DateTimeFormat(`ja-JP`,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}).format(t)}function $h({comment:e,post:t,markdownSourceOid:n,themePreference:r,mermaidReviewDisabled:i,onOpenCodeReference:a,onOpenRepositoryLink:o}){let[s,c]=(0,A.useState)(null),l=(0,A.useRef)(null),u=e.target.kind===`document`&&e.target.documentKind===`repository-file`?e.target:null,d=t.relatedCommitOid??u?.sourceOid??n??e.createdHeadOid;(0,A.useEffect)(()=>()=>{l.current!==null&&window.clearTimeout(l.current)},[]);let f=(0,A.useCallback)(async(e,t)=>{if(!a)return;let n=await a(d,e,t);n&&(l.current!==null&&window.clearTimeout(l.current),c(n),l.current=window.setTimeout(()=>{c(null),l.current=null},qh))},[a,d]),p=(0,A.useCallback)((e,t)=>{f(e,t)},[f]),m=(0,A.useMemo)(()=>i?void 0:{pullRequestId:e.pullRequestId,commentCount:1,onOpenCodeReference:a??(()=>Promise.resolve(`参照先を開けません。`)),renderComments:t=>(0,j.jsx)(eg,{comment:e,variant:`sidebar`,draftScope:`mermaid-expanded:${e.id}`,markdownSourceOid:n,themePreference:r,mermaidReviewDisabled:!0,cancelDraftOnEscape:!0,onOpenCodeReference:t,onOpenRepositoryLink:o})},[e,n,i,a,o,r]);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(Wh,{body:t.body,pullRequestId:e.pullRequestId,sourceOid:d,sourcePath:u?.path??null,references:t.references,themePreference:r,mermaidReview:m,onOpenCodeReference:p,onOpenRepositoryLink:o}),s&&(0,j.jsx)(`div`,{className:`code-reference-notice comment-reference-notice`,role:`status`,children:s})]})}function eg({comment:e,variant:t=`sidebar`,draftScope:n,placement:r=null,side:i=null,markdownSourceOid:a,themePreference:o,onOpenCodeReference:s,onOpenTarget:c,onOpenRepositoryLink:u,onDeleted:d,onActiveChange:f,mermaidReviewDisabled:p=!1,cancelDraftOnEscape:h=!1}){let g=v(),_=[t,n,e.id].filter(Boolean).join(`:`),y=(0,A.useSyncExternalStore)(Pe,()=>ze(e.pullRequestId,_),()=>ze(e.pullRequestId,_)),b=y.body,x=(0,A.useRef)(null),[ee,S]=(0,A.useState)(()=>{if(t===`sidebar`)return!0;let n=Gh.get(e.id);return n?.commentUpdatedAt===e.updatedAt?n.expanded:e.resolvedAt===null}),C=(0,A.useRef)(e.updatedAt),w=(0,A.useRef)(null),[T,E]=(0,A.useState)(null),[D,te]=(0,A.useState)(null),[ne,re]=(0,A.useState)(null),[O,k]=(0,A.useState)(``),[ie,oe]=(0,A.useState)(null),M=t===`sidebar`||ee,se=(0,A.useRef)(M),ce=e.posts.find(e=>e.isRoot)??e.posts[0],le=e.posts.filter(e=>!e.isRoot).length,ue=r?.outdated??!1;(0,A.useLayoutEffect)(()=>{!y.focused||document.activeElement===x.current||(x.current?.focus(),x.current?.setSelectionRange(b.length,b.length))},[b.length,y.focused]),(0,A.useEffect)(()=>{if(t!==`inline`||C.current===e.updatedAt)return;let n=e.resolvedAt===null;Gh.set(e.id,{expanded:n,commentUpdatedAt:e.updatedAt}),S(n),C.current=e.updatedAt},[e.id,e.resolvedAt,e.updatedAt,t]),(0,A.useLayoutEffect)(()=>{if(t!==`inline`||!Kh.has(e.id))return;Kh.delete(e.id);let n=window.requestAnimationFrame(()=>{w.current?.scrollIntoView({behavior:`auto`,block:`nearest`,inline:`nearest`})});return()=>window.cancelAnimationFrame(n)},[e.id,e.resolvedAt,e.updatedAt,t]),(0,A.useLayoutEffect)(()=>{let e=M&&!se.current;if(se.current=M,!e||t!==`inline`)return;let n=window.requestAnimationFrame(()=>{w.current?.scrollIntoView({behavior:`auto`,block:`nearest`,inline:`nearest`})});return()=>window.cancelAnimationFrame(n)},[M,t]),(0,A.useEffect)(()=>{if(!T)return;let e=e=>{let t=e.target;t instanceof Element&&(t.closest(`[data-comment-menu="${T}"]`)||E(null))},t=e=>{e.key===`Escape`&&(e.preventDefault(),Array.from(w.current?.querySelectorAll(`[data-comment-menu]`)??[]).find(e=>e.dataset.commentMenu===T)?.querySelector(`.comment-more-trigger`)?.focus(),E(null))};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[T]),(0,A.useLayoutEffect)(()=>{if(!T){te(null);return}let e=Array.from(w.current?.querySelectorAll(`[data-comment-menu]`)??[]).find(e=>e.dataset.commentMenu===T),t=e?.querySelector(`.comment-more-menu`);if(!e||!t)return;t.matches(`:popover-open`)||t.showPopover();let n=()=>{let n=8,r=window.innerWidth-8,i=window.innerHeight-8,a=8;for(let t=e.parentElement;t;t=t.parentElement){let e=window.getComputedStyle(t);if(![e.overflow,e.overflowX,e.overflowY].some(e=>/^(auto|clip|hidden|scroll)$/u.test(e)))continue;let o=t.getBoundingClientRect();n=Math.max(n,o.top+8),r=Math.min(r,o.right-8),i=Math.min(i,o.bottom-8),a=Math.max(a,o.left+8)}let o=e.getBoundingClientRect(),s=t.getBoundingClientRect(),c=o.top-n,l=i-o.bottom,u=s.height+3>l&&c>l,d=u?o.top-s.height-3:o.bottom+3,f=Math.max(n,i-s.height),p=Math.max(a,r-s.width),m={postId:T,top:Math.min(Math.max(d,n),f),left:Math.min(Math.max(o.right-s.width,a),p),opensUpward:u};te(e=>e?.postId===m.postId&&e.top===m.top&&e.left===m.left&&e.opensUpward===m.opensUpward?e:m)};return n(),D?.postId===T&&document.activeElement===e.querySelector(`.comment-more-trigger`)&&t.querySelector(`[role=menuitem]`)?.focus(),window.addEventListener(`resize`,n),window.addEventListener(`scroll`,n,!0),()=>{window.removeEventListener(`resize`,n),window.removeEventListener(`scroll`,n,!0)}},[D,T,M]);let de=async()=>{await Promise.all([g.invalidateQueries({queryKey:[`comments`]}),g.invalidateQueries({queryKey:[`change-sequence`]}),g.invalidateQueries({queryKey:[`annotations`]}),g.invalidateQueries({queryKey:[`comment-placement`]})])},fe=ae({mutationFn:async()=>await l(`/api/comments/${e.id}/posts`,m({body:b,authorLabel:`You`,relatedCommitOid:null})),onSuccess:async()=>{let n=ze(e.pullRequestId,_);Be(e.pullRequestId,_,{revision:n.revision,body:``,focused:n.focused}),t===`inline`&&Kh.add(e.id),await de()}}),pe=ae({mutationFn:async()=>await l(`/api/comments/${e.id}/${e.resolvedAt?`reopen`:`resolve`}`,m({})),onSuccess:de}),me=ae({mutationFn:async({postId:t,body:n})=>await l(`/api/comments/${e.id}/posts/${t}`,{...m({body:n}),method:`PATCH`}),onSuccess:async()=>{re(null),k(``),await de()}}),he=ae({mutationFn:async t=>await l(`/api/comments/${e.id}/posts/${t}`,{...m({}),method:`DELETE`}),onSuccess:async()=>{E(null),await de()}}),ge=ae({mutationFn:async()=>await l(`/api/comments/${e.id}`,{...m({}),method:`DELETE`}),onSuccess:async()=>{Ve(e.pullRequestId,e.id),d?.(),await de()}}),_e=async()=>{await navigator.clipboard.writeText(`rvw Skillを使って、次のコメントを確認してください。\n\n${e.ref}`),E(null),oe(`参照をコピーしました`),window.setTimeout(()=>oe(null),1600)},ve=e=>{S(!0),re(e.id),k(e.body),E(null),me.reset()},ye=()=>{let e=le>0?`\n返信${le}件もすべて削除されます。`:``;window.confirm(`このコメントスレッドを削除します。${e}\nコピー済みの参照は無効になります。\n\nこの操作は元に戻せません。`)&&ge.mutate()},be=e=>{window.confirm(`この返信を削除します。
31
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return dp(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=cm.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function vm(){return{exit:{taskListCheckValueChecked:bm,taskListCheckValueUnchecked:bm,paragraph:xm}}}function ym(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Sm}}}function bm(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function xm(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Sm(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=cm.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function Cm(){return[kf(),$f(),ip(),lm(),vm()]}function wm(e){return{extensions:[Af(),ep(e),ap(),_m(e),ym()]}}var Tm={tokenize:zm,partial:!0},Em={tokenize:Bm,partial:!0},Dm={tokenize:Vm,partial:!0},Om={tokenize:Hm,partial:!0},km={tokenize:Um,partial:!0},Am={name:`wwwAutolink`,tokenize:Lm,previous:Wm},jm={name:`protocolAutolink`,tokenize:Rm,previous:Gm},Mm={name:`emailAutolink`,tokenize:Im,previous:Km},Nm={};function Pm(){return{text:Nm}}for(var Fm=48;Fm<123;)Nm[Fm]=Mm,Fm++,Fm===58?Fm=65:Fm===91&&(Fm=97);Nm[43]=Mm,Nm[45]=Mm,Nm[46]=Mm,Nm[95]=Mm,Nm[72]=[Mm,jm],Nm[104]=[Mm,jm],Nm[87]=[Mm,Am],Nm[119]=[Mm,Am];function Im(e,t,n){let r=this,i,a;return o;function o(t){return!qm(t)||!Km.call(r,r.previous)||Jm(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return qm(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(km,u,l)(t):t===45||t===95||F(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&P(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Lm(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Wm.call(r,r.previous)||Jm(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Tm,e.attempt(Em,e.attempt(Dm,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Rm(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Gm.call(r,r.previous)&&!Jm(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(P(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||on(t)||L(t)||dn(t)||un(t)?n(t):e.attempt(Em,e.attempt(Dm,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function zm(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Bm(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Om,c,s)(t):t===null||L(t)||dn(t)||t!==45&&un(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Vm(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Om,t,a)(o):o===null||L(o)||dn(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Hm(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||L(o)||dn(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||L(e)||dn(e)?t(e):r(e)}function a(e){return P(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):P(t)?(e.consume(t),o):n(t)}}function Um(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return F(e)?n(e):t(e)}}function Wm(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||L(e)}function Gm(e){return!P(e)}function Km(e){return!(e===47||qm(e))}function qm(e){return e===43||e===45||e===46||e===95||F(e)}function Jm(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Ym={tokenize:rh,partial:!0};function Xm(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:eh,continuation:{tokenize:th},exit:nh}},text:{91:{name:`gfmFootnoteCall`,tokenize:$m},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Zm,resolveTo:Qm}}}}function Zm(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=rn(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Qm(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function $m(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||L(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(rn(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return L(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function eh(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||L(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=rn(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return L(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),z(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function th(e,t,n){return e.check(On,t,e.attempt(Ym,t,n))}function nh(e){e.exit(`gfmFootnoteDefinition`)}function rh(e,t,n){let r=this;return z(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function ih(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Xt(o,o.length,0,xn(s,e.slice(r+1,n),t)),Xt(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Xt(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=bn(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=bn(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var ah=class{constructor(){this.map=[]}add(e,t,n){oh(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function oh(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function sh(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function ch(){return{flow:{null:{name:`table`,tokenize:lh,resolveAll:uh}}}}function lh(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?ee:c;return a===ee&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):I(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):R(t)?z(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||L(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,R(t)?z(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return R(t)?z(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||I(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return R(t)?z(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||I(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function ee(t){return e.enter(`tableRow`),S(t)}function S(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),S):n===null||I(n)?(e.exit(`tableRow`),t(n)):R(n)?z(e,S,`whitespace`)(n):(e.enter(`data`),C(n))}function C(t){return t===null||t===124||L(t)?(e.exit(`data`),S(t)):(e.consume(t),t===92?w:C)}function w(t){return t===92||t===124?(e.consume(t),C):C(t)}}function uh(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new ah;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(fh(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=dh(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=dh(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=dh(f,t,o,i,n,d)):(o[0]=o[1],d=dh(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&fh(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=sh(t.events,n))}return e}function dh(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},ph(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=ph(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=ph(t.events,n[2]),a=ph(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},ph(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function fh(e,t,n,r,i){let a=[],o=ph(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function ph(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var mh={name:`tasklistCheck`,tokenize:gh};function hh(){return{text:{91:mh}}}function gh(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return L(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return I(r)?t(r):R(r)?e.check({tokenize:_h},t,n)(r):n(r)}}function _h(e,t,n){return z(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function vh(e){return $t([Pm(),Xm(),ih(e),ch(),hh()])}var yh={};function bh(e){let t=this,n=e||yh,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(vh(n)),a.push(Cm()),o.push(wm(n))}var xh=[`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.avif`,`.svg`],Sh=/^\/user-attachments\/assets\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;new TextDecoder(`utf-8`,{fatal:!0});function Ch(e){let t=e.toLowerCase();return xh.some(e=>t.endsWith(e))}function wh(e){if(!e?.startsWith(`https://github.com/`))return null;let t;try{t=new URL(e)}catch{return null}return t.protocol!==`https:`||t.hostname!==`github.com`||t.username!==``||t.password!==``||t.port!==``||t.search!==``||t.hash!==``||!Sh.test(t.pathname)?null:t.href}var Th=/^[A-Za-z][A-Za-z\d+.-]*:/;function Eh(e,t,n){return`/api/pull-requests/${e}/markdown-asset?${new URLSearchParams({sourceOid:t,path:n}).toString()}`}function Dh(e,t){let n=wh(t);return n?`/api/pull-requests/${e}/github-attachment?${new URLSearchParams({url:n}).toString()}`:null}function Oh(e,t){return!!(e&&Math.hypot(t.x-e.x,t.y-e.y)>4)}function kh(e){if(!e)return!1;let t=e.trim();return Th.test(t)||t.startsWith(`//`)}function Ah(e,t){if(!e)return null;let n=e.trim();if(n.length===0||n.startsWith(`#`)||n.startsWith(`?`)||kh(n))return null;let r=n.split(/[?#]/,1)[0];if(!r)return null;let i;try{i=decodeURIComponent(r).replaceAll(`\\`,`/`)}catch{return null}let a=i.startsWith(`/`)?[]:t?.split(`/`).slice(0,-1).filter(Boolean)??[];for(let e of i.split(`/`))if(!(!e||e===`.`)){if(e===`..`){if(a.length===0)return null;a.pop();continue}if(e.includes(`\0`))return null;a.push(e)}return a.length>0?a.join(`/`):null}var jh=new Map,Mh={...ef,protocols:{...ef.protocols,href:[...ef.protocols?.href??[],`rvw-ref`]}};function Nh(e){return e?.startsWith(`rvw-ref:`)?e.slice(8):null}function Ph(e){return e.startLine===null||e.endLine===null?null:e.startLine===e.endLine?`L${e.startLine}`:`L${e.startLine}–${e.endLine}`}function Fh(e){let t=Ph(e);return t?`${e.path}:${t}`:e.path}function Ih({reference:e,children:t,className:n,onOpen:r}){return(0,j.jsxs)(`button`,{className:[`code-inline-reference`,n].filter(Boolean).join(` `),title:Fh(e),onPointerDown:e=>{e.button===0&&jh.set(e.pointerId,{x:e.clientX,y:e.clientY})},onPointerUp:t=>{let n=jh.get(t.pointerId);jh.delete(t.pointerId),!(!n||Math.hypot(t.clientX-n.x,t.clientY-n.y)>4)&&(t.preventDefault(),t.stopPropagation(),r(e,t.metaKey||t.ctrlKey))},onPointerCancel:e=>{jh.delete(e.pointerId)},onClick:t=>{t.preventDefault(),t.detail===0&&r(e,!1)},onContextMenu:e=>{(e.ctrlKey||e.metaKey)&&e.preventDefault()},children:[(0,j.jsx)(v,{path:e.path,kind:`file`}),(0,j.jsx)(`span`,{children:t}),(0,j.jsx)(`small`,{children:Ph(e)??`File`})]})}function Lh({alt:e,title:t,sourceAttributes:n,reason:r=`blocked`}){let i=e?.trim()||t?.trim()||`説明なし`,a=r===`load-error`?`画像を読み込めません`:`画像を自動読み込みしません`;return(0,j.jsxs)(`span`,{...n,className:`markdown-image-placeholder`,role:`img`,"aria-label":`画像: ${i}(${r===`load-error`?`読み込み失敗`:`自動読み込み停止`})`,children:[a,`: `,i]})}function Rh({src:e,alt:t,title:n,sourceAttributes:r,...i}){let[a,o]=(0,A.useState)(null),s=a===e;return(0,A.useEffect)(()=>{a!==null&&a!==e&&o(null)},[a,e]),s?(0,j.jsx)(Lh,{alt:t,title:n,sourceAttributes:r,reason:`load-error`}):(0,j.jsx)(`img`,{...r,...i,src:e,alt:t??``,title:n,onError:()=>o(e)})}var zh=(0,A.lazy)(async()=>({default:(await re(()=>import(`./MermaidExpandedView-BjmXfluL.js`),__vite__mapDeps([0,1,2,3,4]))).MermaidExpandedView}));function Bh(){return(0,j.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 16 16`,children:(0,j.jsx)(`path`,{d:`M6.25 2.5H2.5v3.75M9.75 2.5h3.75v3.75M6.25 13.5H2.5V9.75M9.75 13.5h3.75V9.75`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`1.35`})})}function Vh({source:e,themePreference:t,renderIdPrefix:n,review:r,renderInline:i}){let[a,o]=(0,A.useState)(!1);return(0,j.jsxs)(j.Fragment,{children:[i((0,j.jsx)(`button`,{type:`button`,className:`mermaid-expand-button`,"aria-label":`Mermaid diagramを拡大`,"aria-haspopup":`dialog`,title:`Expand Mermaid diagram`,onClick:()=>o(!0),children:(0,j.jsx)(Bh,{})})),a&&(0,j.jsx)(A.Suspense,{fallback:null,children:(0,j.jsx)(zh,{source:e,themePreference:t,renderIdPrefix:n,review:r,onClose:()=>o(!1)})})]})}function Hh(e){return A.Children.toArray(e).map(e=>typeof e==`string`||typeof e==`number`?String(e):(0,A.isValidElement)(e)?Hh(e.props.children):``).join(``)}function Uh({source:e,themePreference:t,review:n}){let r=(0,A.useRef)(null),[i,a]=(0,A.useState)(!1);return(0,A.useEffect)(()=>{let e=r.current;if(!e)return;if(!(`IntersectionObserver`in window)){a(!0);return}let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(a(!0),t.disconnect())},{rootMargin:`160px`});return t.observe(e),()=>t.disconnect()},[]),(0,j.jsx)(Vh,{source:e,themePreference:t,renderIdPrefix:`rvwComment`,review:n,renderInline:n=>(0,j.jsxs)(`div`,{className:`comment-mermaid-shell`,ref:r,children:[(0,j.jsxs)(`div`,{className:`comment-mermaid-toolbar`,children:[(0,j.jsx)(`span`,{children:`Mermaid diagram`}),n]}),i?(0,j.jsx)(u,{className:`comment-mermaid`,role:`img`,"aria-label":`Mermaid diagram`,source:e,themePreference:t,renderIdPrefix:`rvwComment`,errorClassName:`comment-mermaid-error`}):(0,j.jsx)(`div`,{className:`comment-mermaid-placeholder`,children:`diagramを準備しています…`})]})})}function Wh({body:e,pullRequestId:t,sourceOid:n,sourcePath:r,references:i,themePreference:a,mermaidReview:o,onOpenCodeReference:s,onOpenRepositoryLink:c}){let l=(0,A.useRef)(null),u=(0,A.useMemo)(()=>new Map(i.map(e=>[e.id,e])),[i]),d=(0,A.useMemo)(()=>({table:({children:e,node:t,...n})=>(0,j.jsx)(`div`,{className:`comment-markdown-table-scroll`,children:(0,j.jsx)(`table`,{...n,children:e})}),a:({href:e,children:t,node:i,...a})=>{let o=Nh(e);if(o!==null){let e=u.get(o);return e&&s?(0,j.jsx)(Ih,{reference:e,className:`comment-inline-reference`,onOpen:s,children:t}):(0,j.jsx)(`span`,{children:t})}let d=Ah(e,r);if(!d){if(!e)return(0,j.jsx)(`span`,{children:t});let n=kh(e);return(0,j.jsx)(`a`,{...a,href:e,target:n?`_blank`:void 0,rel:n?`noopener noreferrer`:void 0,children:t})}return c?(0,j.jsx)(`a`,{...a,href:e,onPointerDown:e=>{e.button===0&&(l.current={x:e.clientX,y:e.clientY})},onPointerUp:e=>{if(e.button!==0||!l.current)return;let t=Oh(l.current,{x:e.clientX,y:e.clientY});if(l.current=null,t){e.currentTarget.dataset.rvwLinkDragged=`true`;return}e.preventDefault(),c(d,n,e.metaKey||e.ctrlKey)},onPointerCancel:()=>{l.current=null},onClick:e=>{if(e.preventDefault(),e.currentTarget.dataset.rvwLinkDragged===`true`){delete e.currentTarget.dataset.rvwLinkDragged;return}e.detail===0&&c(d,n,!1)},onContextMenu:e=>{(e.ctrlKey||e.metaKey)&&e.preventDefault()},children:t}):(0,j.jsx)(`span`,{className:`comment-markdown-unavailable-link`,title:d,children:t})},img:({src:e,alt:i,title:a,node:o,...s})=>{let c=Ah(e,r);return c?(0,j.jsx)(Rh,{...s,src:Eh(t,n,c),alt:i,title:a,sourceAttributes:{}}):(0,j.jsx)(Lh,{alt:i,title:a,sourceAttributes:{}})},pre:({children:e,node:t,...n})=>{let r=A.Children.count(e)===1?A.Children.only(e):null;return!(0,A.isValidElement)(r)||!r.props.className?.split(/\s+/u).includes(`language-mermaid`)?(0,j.jsx)(`pre`,{...n,children:e}):(0,j.jsx)(Uh,{source:Hh(r.props.children).trim(),themePreference:a,review:o})}}),[s,c,t,u,o,n,r,a]);return(0,j.jsx)(`div`,{className:`comment-markdown`,children:(0,j.jsx)(Vo,{rehypePlugins:[Qd,[vf,Mh]],remarkPlugins:[bh,Ef],urlTransform:e=>e.startsWith(`rvw-ref:`)?e:Go(e),components:d,children:e})})}var Gh=new Map,Kh=new Set,qh=2400;function Jh(e,t){if(e.target.kind===`pull-request`||e.target.startLine===null)return null;let n=t&&!t.outdated?t.range:null,r=n?.startLine??e.target.startLine,i=n?.endLine??e.target.endLine??r;return r===i?`L${r}`:`L${r}–${i}`}function Yh(e,t,n){if(e.target.kind===`pull-request`)return`Pull Request全体`;if(e.target.kind===`walkthrough`)return[e.target.walkthroughTitle,Jh(e,t)??`ウォークスルー全体`].join(` · `);let r=t?.path??(e.target.documentKind===`pull-request-markdown`?`Pull Request.md`:e.target.path),i=Jh(e,t)??`文書全体`;return[r,n===`deletions`?`変更前`:n===`additions`?`変更後`:null,i].filter(Boolean).join(` · `)}function Xh(e,t,n){if(e.target.kind===`pull-request`)return`Pull Request全体`;if(e.target.kind===`walkthrough`)return Jh(e,t)??`ウォークスルー全体`;let r=Jh(e,t)??(e.target.documentKind===`pull-request-markdown`?`文書全体`:`ファイル全体`);return n===`deletions`?`変更前 · ${r}`:r}function Zh(e){return e.target.kind===`pull-request`?`Pull Request.mdを開く`:`コメント対象を開く`}function Qh(e){let t=new Date(e);return Number.isNaN(t.valueOf())?e:new Intl.DateTimeFormat(`ja-JP`,{month:`numeric`,day:`numeric`,hour:`2-digit`,minute:`2-digit`}).format(t)}function $h({comment:e,post:t,markdownSourceOid:n,themePreference:r,mermaidReviewDisabled:i,onOpenCodeReference:a,onOpenRepositoryLink:o}){let[s,c]=(0,A.useState)(null),l=(0,A.useRef)(null),u=e.target.kind===`document`&&e.target.documentKind===`repository-file`?e.target:null,d=t.relatedCommitOid??u?.sourceOid??n??e.createdHeadOid;(0,A.useEffect)(()=>()=>{l.current!==null&&window.clearTimeout(l.current)},[]);let f=(0,A.useCallback)(async(e,t)=>{if(!a)return;let n=await a(d,e,t);n&&(l.current!==null&&window.clearTimeout(l.current),c(n),l.current=window.setTimeout(()=>{c(null),l.current=null},qh))},[a,d]),p=(0,A.useCallback)((e,t)=>{f(e,t)},[f]),m=(0,A.useMemo)(()=>i?void 0:{pullRequestId:e.pullRequestId,commentCount:1,onOpenCodeReference:a??(()=>Promise.resolve(`参照先を開けません。`)),renderComments:t=>(0,j.jsx)(eg,{comment:e,variant:`sidebar`,draftScope:`mermaid-expanded:${e.id}`,markdownSourceOid:n,themePreference:r,mermaidReviewDisabled:!0,cancelDraftOnEscape:!0,onOpenCodeReference:t,onOpenRepositoryLink:o})},[e,n,i,a,o,r]);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(Wh,{body:t.body,pullRequestId:e.pullRequestId,sourceOid:d,sourcePath:u?.path??null,references:t.references,themePreference:r,mermaidReview:m,onOpenCodeReference:p,onOpenRepositoryLink:o}),s&&(0,j.jsx)(`div`,{className:`code-reference-notice comment-reference-notice`,role:`status`,children:s})]})}function eg({comment:e,variant:t=`sidebar`,draftScope:n,placement:r=null,side:i=null,markdownSourceOid:a,themePreference:o,onOpenCodeReference:s,onOpenTarget:c,onOpenRepositoryLink:u,onDeleted:d,onActiveChange:f,mermaidReviewDisabled:p=!1,cancelDraftOnEscape:g=!1}){let _=l(),v=[t,n,e.id].filter(Boolean).join(`:`),y=(0,A.useSyncExternalStore)(Pe,()=>ze(e.pullRequestId,v),()=>ze(e.pullRequestId,v)),b=y.body,x=(0,A.useRef)(null),[ee,S]=(0,A.useState)(()=>{if(t===`sidebar`)return!0;let n=Gh.get(e.id);return n?.commentUpdatedAt===e.updatedAt?n.expanded:e.resolvedAt===null}),C=(0,A.useRef)(e.updatedAt),w=(0,A.useRef)(null),[T,E]=(0,A.useState)(null),[D,te]=(0,A.useState)(null),[ne,re]=(0,A.useState)(null),[O,k]=(0,A.useState)(``),[ie,oe]=(0,A.useState)(null),M=t===`sidebar`||ee,se=(0,A.useRef)(M),ce=e.posts.find(e=>e.isRoot)??e.posts[0],le=e.posts.filter(e=>!e.isRoot).length,ue=r?.outdated??!1;(0,A.useLayoutEffect)(()=>{!y.focused||document.activeElement===x.current||(x.current?.focus(),x.current?.setSelectionRange(b.length,b.length))},[b.length,y.focused]),(0,A.useEffect)(()=>{if(t!==`inline`||C.current===e.updatedAt)return;let n=e.resolvedAt===null;Gh.set(e.id,{expanded:n,commentUpdatedAt:e.updatedAt}),S(n),C.current=e.updatedAt},[e.id,e.resolvedAt,e.updatedAt,t]),(0,A.useLayoutEffect)(()=>{if(t!==`inline`||!Kh.has(e.id))return;Kh.delete(e.id);let n=window.requestAnimationFrame(()=>{w.current?.scrollIntoView({behavior:`auto`,block:`nearest`,inline:`nearest`})});return()=>window.cancelAnimationFrame(n)},[e.id,e.resolvedAt,e.updatedAt,t]),(0,A.useLayoutEffect)(()=>{let e=M&&!se.current;if(se.current=M,!e||t!==`inline`)return;let n=window.requestAnimationFrame(()=>{w.current?.scrollIntoView({behavior:`auto`,block:`nearest`,inline:`nearest`})});return()=>window.cancelAnimationFrame(n)},[M,t]),(0,A.useEffect)(()=>{if(!T)return;let e=e=>{let t=e.target;t instanceof Element&&(t.closest(`[data-comment-menu="${T}"]`)||E(null))},t=e=>{e.key===`Escape`&&(e.preventDefault(),Array.from(w.current?.querySelectorAll(`[data-comment-menu]`)??[]).find(e=>e.dataset.commentMenu===T)?.querySelector(`.comment-more-trigger`)?.focus(),E(null))};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t)}},[T]),(0,A.useLayoutEffect)(()=>{if(!T){te(null);return}let e=Array.from(w.current?.querySelectorAll(`[data-comment-menu]`)??[]).find(e=>e.dataset.commentMenu===T),t=e?.querySelector(`.comment-more-menu`);if(!e||!t)return;t.matches(`:popover-open`)||t.showPopover();let n=()=>{let n=8,r=window.innerWidth-8,i=window.innerHeight-8,a=8;for(let t=e.parentElement;t;t=t.parentElement){let e=window.getComputedStyle(t);if(![e.overflow,e.overflowX,e.overflowY].some(e=>/^(auto|clip|hidden|scroll)$/u.test(e)))continue;let o=t.getBoundingClientRect();n=Math.max(n,o.top+8),r=Math.min(r,o.right-8),i=Math.min(i,o.bottom-8),a=Math.max(a,o.left+8)}let o=e.getBoundingClientRect(),s=t.getBoundingClientRect(),c=o.top-n,l=i-o.bottom,u=s.height+3>l&&c>l,d=u?o.top-s.height-3:o.bottom+3,f=Math.max(n,i-s.height),p=Math.max(a,r-s.width),m={postId:T,top:Math.min(Math.max(d,n),f),left:Math.min(Math.max(o.right-s.width,a),p),opensUpward:u};te(e=>e?.postId===m.postId&&e.top===m.top&&e.left===m.left&&e.opensUpward===m.opensUpward?e:m)};return n(),D?.postId===T&&document.activeElement===e.querySelector(`.comment-more-trigger`)&&t.querySelector(`[role=menuitem]`)?.focus(),window.addEventListener(`resize`,n),window.addEventListener(`scroll`,n,!0),()=>{window.removeEventListener(`resize`,n),window.removeEventListener(`scroll`,n,!0)}},[D,T,M]);let de=async()=>{await Promise.all([_.invalidateQueries({queryKey:[`comments`]}),_.invalidateQueries({queryKey:[`change-sequence`]}),_.invalidateQueries({queryKey:[`annotations`]}),_.invalidateQueries({queryKey:[`comment-placement`]})])},fe=ae({mutationFn:async()=>await m(`/api/comments/${e.id}/posts`,h({body:b,authorLabel:`You`,relatedCommitOid:null})),onSuccess:async()=>{let n=ze(e.pullRequestId,v);Be(e.pullRequestId,v,{revision:n.revision,body:``,focused:n.focused}),t===`inline`&&Kh.add(e.id),await de()}}),pe=ae({mutationFn:async()=>await m(`/api/comments/${e.id}/${e.resolvedAt?`reopen`:`resolve`}`,h({})),onSuccess:de}),me=ae({mutationFn:async({postId:t,body:n})=>await m(`/api/comments/${e.id}/posts/${t}`,{...h({body:n}),method:`PATCH`}),onSuccess:async()=>{re(null),k(``),await de()}}),he=ae({mutationFn:async t=>await m(`/api/comments/${e.id}/posts/${t}`,{...h({}),method:`DELETE`}),onSuccess:async()=>{E(null),await de()}}),ge=ae({mutationFn:async()=>await m(`/api/comments/${e.id}`,{...h({}),method:`DELETE`}),onSuccess:async()=>{Ve(e.pullRequestId,e.id),d?.(),await de()}}),_e=async()=>{await navigator.clipboard.writeText(`rvw Skillを使って、次のコメントを確認してください。\n\n${e.ref}`),E(null),oe(`参照をコピーしました`),window.setTimeout(()=>oe(null),1600)},ve=e=>{S(!0),re(e.id),k(e.body),E(null),me.reset()},ye=()=>{let e=le>0?`\n返信${le}件もすべて削除されます。`:``;window.confirm(`このコメントスレッドを削除します。${e}\nコピー済みの参照は無効になります。\n\nこの操作は元に戻せません。`)&&ge.mutate()},be=e=>{window.confirm(`この返信を削除します。
32
32
 
33
- この操作は元に戻せません。`)&&he.mutate(e)},xe=Yh(e,r,i),Se=t===`inline`?Xh(e,r,i):xe,Ce=(0,j.jsxs)(j.Fragment,{children:[t===`inline`&&(0,j.jsx)(`span`,{className:`comment-thread-chevron`,"aria-hidden":`true`,children:M?`⌄`:`›`}),(0,j.jsxs)(`span`,{className:`comment-thread-summary-copy`,children:[(0,j.jsx)(`span`,{className:`comment-thread-target`,children:Se}),t===`sidebar`&&(0,j.jsxs)(j.Fragment,{children:[!M&&(0,j.jsx)(`span`,{className:`comment-thread-excerpt`,children:ce?.body??`コメント`}),(0,j.jsxs)(`span`,{className:`comment-thread-meta`,children:[ce?.authorLabel??`Unknown`,` · `,le,`返信 · 最終更新`,` `,Qh(e.updatedAt)]})]})]})]}),we=(e,t)=>{let n=e.isRoot?`コメントのその他の操作`:`${t}件目の返信のその他の操作`,r=T===e.id,i=D?.postId===e.id?D:null;return(0,j.jsxs)(`div`,{className:`comment-more`,"data-comment-menu":e.id,children:[(0,j.jsx)(`button`,{className:`comment-more-trigger`,"aria-label":n,"aria-haspopup":`menu`,"aria-expanded":r,onClick:()=>{te(null),E(t=>t===e.id?null:e.id)},children:`…`}),r&&(0,j.jsxs)(`div`,{className:`comment-more-menu${i?.opensUpward?` opens-upward`:``}`,role:`menu`,"aria-label":n,popover:`manual`,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),e.currentTarget.closest(`[data-comment-menu]`)?.querySelector(`.comment-more-trigger`)?.focus(),E(null);return}if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;let t=Array.from(e.currentTarget.querySelectorAll(`[role=menuitem]`));if(t.length===0)return;e.preventDefault();let n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:e.key===`ArrowUp`?(n-1+t.length)%t.length:(n+1)%t.length]?.focus()},style:{top:i?.top??0,left:i?.left??0,visibility:i?`visible`:`hidden`},children:[e.isRoot&&(0,j.jsx)(`button`,{role:`menuitem`,onClick:()=>void _e(),children:`参照をコピー`}),(0,j.jsx)(`button`,{role:`menuitem`,onClick:()=>ve(e),children:`編集`}),e.isRoot?(0,j.jsx)(`button`,{className:`is-danger`,role:`menuitem`,onClick:ye,children:`削除`}):(0,j.jsx)(`button`,{className:`is-danger`,role:`menuitem`,onClick:()=>be(e.id),children:`削除`})]})]})};return(0,j.jsxs)(`article`,{ref:w,className:`comment-thread comment-thread--${t}${M?` is-expanded`:` is-collapsed`}`,"data-comment-id":e.id,onPointerEnter:()=>f?.(e.id,!0),onPointerLeave:t=>{t.currentTarget.contains(document.activeElement)||f?.(e.id,!1)},onFocusCapture:()=>f?.(e.id,!0),onBlurCapture:t=>{let n=t.relatedTarget;(!(n instanceof Node)||!t.currentTarget.contains(n))&&!t.currentTarget.matches(`:hover`)&&f?.(e.id,!1)},children:[(0,j.jsxs)(`header`,{className:`comment-thread-header`,children:[t===`inline`?(0,j.jsx)(`button`,{className:`comment-thread-toggle`,"aria-expanded":M,"aria-label":`${xe}のコメントを${M?`折りたたむ`:`展開`}`,onClick:()=>S(t=>{let n=!t;return Gh.set(e.id,{expanded:n,commentUpdatedAt:e.updatedAt}),n}),children:Ce}):(0,j.jsx)(`div`,{className:`comment-thread-summary`,children:Ce}),(0,j.jsxs)(`div`,{className:`comment-thread-header-actions`,children:[!M&&ie&&(0,j.jsx)(`span`,{className:`comment-action-feedback comment-action-feedback--header`,role:`status`,children:ie}),(0,j.jsxs)(`div`,{className:`comment-thread-badges`,children:[ue&&(0,j.jsx)(`span`,{className:`badge badge--outdated`,children:`Outdated`}),(t===`sidebar`||e.resolvedAt)&&(0,j.jsx)(`span`,{className:e.resolvedAt?`badge badge--resolved`:`badge`,children:e.resolvedAt?`解決済み`:`未解決`})]}),ce&&we(ce,0)]})]}),M&&(0,j.jsxs)(`div`,{className:`comment-thread-content`,children:[ue&&(0,j.jsx)(`p`,{className:`comment-outdated-note`,children:e.target.kind===`walkthrough`?`現在のウォークスルーでは位置を特定できません。作成時の選択範囲を確認してください。`:`現在の文書では位置を特定できません。コメント対象を開くと、コメント時点の文書を確認できます。`}),(e.target.kind===`document`&&e.target.documentKind===`pull-request-markdown`||e.target.kind===`walkthrough`)&&e.target.quotedText&&ue&&(0,j.jsxs)(`div`,{className:`comment-source-quote`,children:[(0,j.jsx)(`small`,{children:`コメント作成時の選択範囲`}),(0,j.jsx)(`pre`,{children:e.target.quotedText})]}),(0,j.jsx)(`div`,{className:`comment-posts`,children:e.posts.map((t,n)=>(0,j.jsxs)(`div`,{className:`comment-post`,children:[(0,j.jsxs)(`div`,{className:`comment-post-meta`,children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:t.authorLabel??`Unknown`}),t.updatedAt!==t.createdAt&&(0,j.jsx)(`small`,{children:`編集済み`})]}),(0,j.jsxs)(`span`,{className:`comment-post-meta-end`,children:[(0,j.jsx)(`time`,{dateTime:t.createdAt,children:Qh(t.createdAt)}),!t.isRoot&&we(t,n)]})]}),ne===t.id?(0,j.jsxs)(`div`,{className:`comment-edit-composer`,children:[(0,j.jsx)(`textarea`,{autoFocus:!0,rows:3,value:O,"aria-label":t.isRoot?`コメントを編集`:`返信を編集`,onChange:e=>k(e.target.value),onKeyDown:e=>{if(h&&e.key===`Escape`&&!e.nativeEvent.isComposing){e.preventDefault(),e.stopPropagation(),re(null),k(``),me.reset();return}qe(e,!!O.trim()&&!me.isPending,()=>me.mutate({postId:t.id,body:O}))}}),(0,j.jsxs)(`div`,{className:`comment-edit-actions`,children:[(0,j.jsx)(`button`,{className:`button--quiet`,disabled:me.isPending,onClick:()=>{re(null),k(``),me.reset()},children:`キャンセル`}),(0,j.jsx)(`button`,{disabled:!O.trim()||me.isPending,onClick:()=>me.mutate({postId:t.id,body:O}),children:`保存`})]})]}):(0,j.jsx)($h,{comment:e,post:t,markdownSourceOid:a,themePreference:o,mermaidReviewDisabled:p,onOpenCodeReference:s,onOpenRepositoryLink:u}),t.relatedCommitOid&&(0,j.jsxs)(`small`,{children:[`commit `,t.relatedCommitOid.slice(0,8)]})]},t.id))}),(0,j.jsxs)(`div`,{className:`comment-reply-composer`,children:[(0,j.jsx)(`textarea`,{ref:x,value:b,onChange:t=>{let n=ze(e.pullRequestId,_);Be(e.pullRequestId,_,{...n,body:t.target.value})},onFocus:()=>{let t=ze(e.pullRequestId,_);Be(e.pullRequestId,_,{...t,focused:!0})},onBlur:()=>{let t=ze(e.pullRequestId,_);Be(e.pullRequestId,_,{...t,focused:!1})},onKeyDown:t=>{if(h&&t.key===`Escape`&&!t.nativeEvent.isComposing){t.preventDefault(),t.stopPropagation();let n=ze(e.pullRequestId,_);Be(e.pullRequestId,_,{...n,body:``,focused:!1}),t.currentTarget.blur();return}qe(t,!!b.trim()&&!fe.isPending,()=>fe.mutate())},placeholder:`返信を入力`,"aria-label":`${xe}へ返信`,rows:1}),(0,j.jsx)(`button`,{"aria-label":`${xe}の${t===`sidebar`?`サイドバー`:`コード内`}から返信を送信`,disabled:!b.trim()||fe.isPending,onClick:()=>fe.mutate(),children:`返信`})]}),(0,j.jsxs)(`div`,{className:`comment-actions`,children:[(0,j.jsx)(`button`,{className:`button--quiet`,disabled:pe.isPending,onClick:()=>pe.mutate(),children:e.resolvedAt?`再度開く`:`解決`}),c&&(0,j.jsx)(`button`,{className:`button--quiet`,onMouseDown:e=>{!e.metaKey&&!e.ctrlKey||(e.preventDefault(),c(!0))},onClick:e=>{!e.metaKey&&!e.ctrlKey&&c(!1)},onContextMenu:e=>{(e.ctrlKey||e.metaKey)&&e.preventDefault()},children:Zh(e)}),ie&&(0,j.jsx)(`span`,{className:`comment-action-feedback`,role:`status`,children:ie})]}),(0,j.jsx)(Ke,{error:fe.error??pe.error??me.error??he.error??ge.error})]})]})}export{ge as $,qe as A,Ue as B,Go as C,Xe as D,N as E,je as F,he as G,xe as H,We as I,ce as J,M as K,De as L,Ge as M,Ae as N,Je as O,Fe as P,_e as Q,Re as R,Vo as S,Mi as T,me as U,ve as V,se as W,ue as X,pe as Y,ye as Z,nf as _,Ih as a,jd as b,Dh as c,Oh as d,be as et,Ah as f,vf as g,Ef as h,Lh as i,Ke as j,Ye as k,kh as l,bh as m,Vh as n,ae as nt,Nh as o,Ch as p,le as q,Rh as r,O as rt,Mh as s,eg as t,de as tt,Eh as u,Qd as v,bo as w,ls as x,Ad as y,He as z};
33
+ この操作は元に戻せません。`)&&he.mutate(e)},xe=Yh(e,r,i),Se=t===`inline`?Xh(e,r,i):xe,Ce=(0,j.jsxs)(j.Fragment,{children:[t===`inline`&&(0,j.jsx)(`span`,{className:`comment-thread-chevron`,"aria-hidden":`true`,children:M?`⌄`:`›`}),(0,j.jsxs)(`span`,{className:`comment-thread-summary-copy`,children:[(0,j.jsx)(`span`,{className:`comment-thread-target`,children:Se}),t===`sidebar`&&(0,j.jsxs)(j.Fragment,{children:[!M&&(0,j.jsx)(`span`,{className:`comment-thread-excerpt`,children:ce?.body??`コメント`}),(0,j.jsxs)(`span`,{className:`comment-thread-meta`,children:[ce?.authorLabel??`Unknown`,` · `,le,`返信 · 最終更新`,` `,Qh(e.updatedAt)]})]})]})]}),we=(e,t)=>{let n=e.isRoot?`コメントのその他の操作`:`${t}件目の返信のその他の操作`,r=T===e.id,i=D?.postId===e.id?D:null;return(0,j.jsxs)(`div`,{className:`comment-more`,"data-comment-menu":e.id,children:[(0,j.jsx)(`button`,{className:`comment-more-trigger`,"aria-label":n,"aria-haspopup":`menu`,"aria-expanded":r,onClick:()=>{te(null),E(t=>t===e.id?null:e.id)},children:`…`}),r&&(0,j.jsxs)(`div`,{className:`comment-more-menu${i?.opensUpward?` opens-upward`:``}`,role:`menu`,"aria-label":n,popover:`manual`,onKeyDown:e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),e.currentTarget.closest(`[data-comment-menu]`)?.querySelector(`.comment-more-trigger`)?.focus(),E(null);return}if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;let t=Array.from(e.currentTarget.querySelectorAll(`[role=menuitem]`));if(t.length===0)return;e.preventDefault();let n=t.indexOf(document.activeElement);t[e.key===`Home`?0:e.key===`End`?t.length-1:e.key===`ArrowUp`?(n-1+t.length)%t.length:(n+1)%t.length]?.focus()},style:{top:i?.top??0,left:i?.left??0,visibility:i?`visible`:`hidden`},children:[e.isRoot&&(0,j.jsx)(`button`,{role:`menuitem`,onClick:()=>void _e(),children:`参照をコピー`}),(0,j.jsx)(`button`,{role:`menuitem`,onClick:()=>ve(e),children:`編集`}),e.isRoot?(0,j.jsx)(`button`,{className:`is-danger`,role:`menuitem`,onClick:ye,children:`削除`}):(0,j.jsx)(`button`,{className:`is-danger`,role:`menuitem`,onClick:()=>be(e.id),children:`削除`})]})]})};return(0,j.jsxs)(`article`,{ref:w,className:`comment-thread comment-thread--${t}${M?` is-expanded`:` is-collapsed`}`,"data-comment-id":e.id,onPointerEnter:()=>f?.(e.id,!0),onPointerLeave:t=>{t.currentTarget.contains(document.activeElement)||f?.(e.id,!1)},onFocusCapture:()=>f?.(e.id,!0),onBlurCapture:t=>{let n=t.relatedTarget;(!(n instanceof Node)||!t.currentTarget.contains(n))&&!t.currentTarget.matches(`:hover`)&&f?.(e.id,!1)},children:[(0,j.jsxs)(`header`,{className:`comment-thread-header`,children:[t===`inline`?(0,j.jsx)(`button`,{className:`comment-thread-toggle`,"aria-expanded":M,"aria-label":`${xe}のコメントを${M?`折りたたむ`:`展開`}`,onClick:()=>S(t=>{let n=!t;return Gh.set(e.id,{expanded:n,commentUpdatedAt:e.updatedAt}),n}),children:Ce}):(0,j.jsx)(`div`,{className:`comment-thread-summary`,children:Ce}),(0,j.jsxs)(`div`,{className:`comment-thread-header-actions`,children:[!M&&ie&&(0,j.jsx)(`span`,{className:`comment-action-feedback comment-action-feedback--header`,role:`status`,children:ie}),(0,j.jsxs)(`div`,{className:`comment-thread-badges`,children:[ue&&(0,j.jsx)(`span`,{className:`badge badge--outdated`,children:`Outdated`}),(t===`sidebar`||e.resolvedAt)&&(0,j.jsx)(`span`,{className:e.resolvedAt?`badge badge--resolved`:`badge`,children:e.resolvedAt?`解決済み`:`未解決`})]}),ce&&we(ce,0)]})]}),M&&(0,j.jsxs)(`div`,{className:`comment-thread-content`,children:[ue&&(0,j.jsx)(`p`,{className:`comment-outdated-note`,children:e.target.kind===`walkthrough`?`現在のウォークスルーでは位置を特定できません。作成時の選択範囲を確認してください。`:`現在の文書では位置を特定できません。コメント対象を開くと、コメント時点の文書を確認できます。`}),(e.target.kind===`document`&&e.target.documentKind===`pull-request-markdown`||e.target.kind===`walkthrough`)&&e.target.quotedText&&ue&&(0,j.jsxs)(`div`,{className:`comment-source-quote`,children:[(0,j.jsx)(`small`,{children:`コメント作成時の選択範囲`}),(0,j.jsx)(`pre`,{children:e.target.quotedText})]}),(0,j.jsx)(`div`,{className:`comment-posts`,children:e.posts.map((t,n)=>(0,j.jsxs)(`div`,{className:`comment-post`,children:[(0,j.jsxs)(`div`,{className:`comment-post-meta`,children:[(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:t.authorLabel??`Unknown`}),t.updatedAt!==t.createdAt&&(0,j.jsx)(`small`,{children:`編集済み`})]}),(0,j.jsxs)(`span`,{className:`comment-post-meta-end`,children:[(0,j.jsx)(`time`,{dateTime:t.createdAt,children:Qh(t.createdAt)}),!t.isRoot&&we(t,n)]})]}),ne===t.id?(0,j.jsxs)(`div`,{className:`comment-edit-composer`,children:[(0,j.jsx)(`textarea`,{autoFocus:!0,rows:3,value:O,"aria-label":t.isRoot?`コメントを編集`:`返信を編集`,onChange:e=>k(e.target.value),onKeyDown:e=>{if(g&&e.key===`Escape`&&!e.nativeEvent.isComposing){e.preventDefault(),e.stopPropagation(),re(null),k(``),me.reset();return}qe(e,!!O.trim()&&!me.isPending,()=>me.mutate({postId:t.id,body:O}))}}),(0,j.jsxs)(`div`,{className:`comment-edit-actions`,children:[(0,j.jsx)(`button`,{className:`button--quiet`,disabled:me.isPending,onClick:()=>{re(null),k(``),me.reset()},children:`キャンセル`}),(0,j.jsx)(`button`,{disabled:!O.trim()||me.isPending,onClick:()=>me.mutate({postId:t.id,body:O}),children:`保存`})]})]}):(0,j.jsx)($h,{comment:e,post:t,markdownSourceOid:a,themePreference:o,mermaidReviewDisabled:p,onOpenCodeReference:s,onOpenRepositoryLink:u}),t.relatedCommitOid&&(0,j.jsxs)(`small`,{children:[`commit `,t.relatedCommitOid.slice(0,8)]})]},t.id))}),(0,j.jsxs)(`div`,{className:`comment-reply-composer`,children:[(0,j.jsx)(`textarea`,{ref:x,value:b,onChange:t=>{let n=ze(e.pullRequestId,v);Be(e.pullRequestId,v,{...n,body:t.target.value})},onFocus:()=>{let t=ze(e.pullRequestId,v);Be(e.pullRequestId,v,{...t,focused:!0})},onBlur:()=>{let t=ze(e.pullRequestId,v);Be(e.pullRequestId,v,{...t,focused:!1})},onKeyDown:t=>{if(g&&t.key===`Escape`&&!t.nativeEvent.isComposing){t.preventDefault(),t.stopPropagation();let n=ze(e.pullRequestId,v);Be(e.pullRequestId,v,{...n,body:``,focused:!1}),t.currentTarget.blur();return}qe(t,!!b.trim()&&!fe.isPending,()=>fe.mutate())},placeholder:`返信を入力`,"aria-label":`${xe}へ返信`,rows:1}),(0,j.jsx)(`button`,{"aria-label":`${xe}の${t===`sidebar`?`サイドバー`:`コード内`}から返信を送信`,disabled:!b.trim()||fe.isPending,onClick:()=>fe.mutate(),children:`返信`})]}),(0,j.jsxs)(`div`,{className:`comment-actions`,children:[(0,j.jsx)(`button`,{className:`button--quiet`,disabled:pe.isPending,onClick:()=>pe.mutate(),children:e.resolvedAt?`再度開く`:`解決`}),c&&(0,j.jsx)(`button`,{className:`button--quiet`,onMouseDown:e=>{!e.metaKey&&!e.ctrlKey||(e.preventDefault(),c(!0))},onClick:e=>{!e.metaKey&&!e.ctrlKey&&c(!1)},onContextMenu:e=>{(e.ctrlKey||e.metaKey)&&e.preventDefault()},children:Zh(e)}),ie&&(0,j.jsx)(`span`,{className:`comment-action-feedback`,role:`status`,children:ie})]}),(0,j.jsx)(Ke,{error:fe.error??pe.error??me.error??he.error??ge.error})]})]})}export{ge as $,qe as A,Ue as B,Go as C,Xe as D,N as E,je as F,he as G,xe as H,We as I,ce as J,M as K,De as L,Ge as M,Ae as N,Je as O,Fe as P,_e as Q,Re as R,Vo as S,Mi as T,me as U,ve as V,se as W,ue as X,pe as Y,ye as Z,nf as _,Ih as a,jd as b,Dh as c,Oh as d,be as et,Ah as f,vf as g,Ef as h,Lh as i,Ke as j,Ye as k,kh as l,bh as m,Vh as n,ae as nt,Nh as o,Ch as p,le as q,Rh as r,O as rt,Mh as s,eg as t,de as tt,Eh as u,Qd as v,bo as w,ls as x,Ad as y,He as z};