termdock 1.4.113 → 1.4.114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ModelPreview-aRiv3VyI.js → ModelPreview-D_ePHuIb.js} +1 -1
- package/dist/client/assets/{abnfDiagram-VRR7QNED-BSeclZa2.js → abnfDiagram-VRR7QNED-BZI0kiea.js} +1 -1
- package/dist/client/assets/{arc-BFrSt5wm.js → arc-Bf2XlwFP.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZJ3FMSHR-BTUzp9wa.js → architectureDiagram-ZJ3FMSHR-DftQsQGl.js} +1 -1
- package/dist/client/assets/{blockDiagram-677ZJIJ3-SOBUReGq.js → blockDiagram-677ZJIJ3-ZUmEG-dB.js} +1 -1
- package/dist/client/assets/{c4Diagram-LMCZKHZV-DM4zhiZk.js → c4Diagram-LMCZKHZV-sOeMyyUg.js} +1 -1
- package/dist/client/assets/channel-CcMim_aT.js +1 -0
- package/dist/client/assets/{chunk-2Q5K7J3B-Caun4f6Z.js → chunk-2Q5K7J3B-_arq_pE8.js} +1 -1
- package/dist/client/assets/{chunk-32BRIVSS-CM0l3Ihd.js → chunk-32BRIVSS-DjbhCFxb.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-BDIAjadQ.js → chunk-5VM5RSS4-lzD-6U8i.js} +1 -1
- package/dist/client/assets/{chunk-EX3LRPZG-CWxkBddU.js → chunk-EX3LRPZG-BqoUr3Kb.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-CFVZXFsx.js → chunk-JWPE2WC7-Y41_6y44.js} +1 -1
- package/dist/client/assets/{chunk-MOJQB5TN-CbaT3uMN.js → chunk-MOJQB5TN-D_OcIm_v.js} +1 -1
- package/dist/client/assets/{chunk-RYQCIY6F-Cj8TIX5y.js → chunk-RYQCIY6F-jFCEdSIZ.js} +1 -1
- package/dist/client/assets/{chunk-V7JOEXUC-CKwOk4Ma.js → chunk-V7JOEXUC-BKhbGZNQ.js} +1 -1
- package/dist/client/assets/{chunk-VR4S4FIN-DFmTDyFb.js → chunk-VR4S4FIN-CpVMtJAx.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-x3YG8-ha.js → chunk-XXDRQBXY-uhRjjTen.js} +1 -1
- package/dist/client/assets/classDiagram-OUVF2IWQ-xZk0_-0_.js +1 -0
- package/dist/client/assets/classDiagram-v2-EOCWNBFH-xZk0_-0_.js +1 -0
- package/dist/client/assets/{cose-bilkent-JH36ORCC-XA98byjZ.js → cose-bilkent-JH36ORCC-D27whsXo.js} +1 -1
- package/dist/client/assets/{cynefin-VYW2F7L2-CUvb2-IS.js → cynefin-VYW2F7L2-DjPmiAlB.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-TSTJHNR4-J9_pj2mu.js → cynefinDiagram-TSTJHNR4-D4fIR8xL.js} +1 -1
- package/dist/client/assets/{dagre-VKFMJZFB-DmNu9HVB.js → dagre-VKFMJZFB-RE7TM3YY.js} +1 -1
- package/dist/client/assets/{diagram-FQU43EPY-DdQ57IG5.js → diagram-FQU43EPY-c68o-BoX.js} +1 -1
- package/dist/client/assets/{diagram-G47NLZAW-CeupSJ08.js → diagram-G47NLZAW-C9zQgh2h.js} +1 -1
- package/dist/client/assets/{diagram-NH7WQ7WH-BWe5RV_L.js → diagram-NH7WQ7WH-D9jATmfe.js} +1 -1
- package/dist/client/assets/{diagram-OA4YK3LP-DEU45jL_.js → diagram-OA4YK3LP-DIg_X7Gm.js} +1 -1
- package/dist/client/assets/{diagram-WEI45ONY-SdkUpcCT.js → diagram-WEI45ONY-512KTyNr.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-CCIWWBDH-DObmPckn.js → ebnfDiagram-CCIWWBDH-DIQduMdo.js} +1 -1
- package/dist/client/assets/{erDiagram-Q63AITRT-B3viL24X.js → erDiagram-Q63AITRT-DJaJOquE.js} +1 -1
- package/dist/client/assets/{flowDiagram-23GEKE2U-CaMVMUJQ.js → flowDiagram-23GEKE2U-BleT-GIU.js} +1 -1
- package/dist/client/assets/{ganttDiagram-NO4QXBWP-OUds5A45.js → ganttDiagram-NO4QXBWP-Bi9uo6X5.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-IHSO6WYX-Bm6bpzjq.js → gitGraphDiagram-IHSO6WYX-BfaYIRkh.js} +1 -1
- package/dist/client/assets/{index-H--Bak2U.js → index-BPNZub0Z.js} +4 -4
- package/dist/client/assets/{infoDiagram-FWYZ7A6U-Ub0dfReE.js → infoDiagram-FWYZ7A6U-Ck_MEUjM.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-FXEZZL3T-BRC3NKAb.js → ishikawaDiagram-FXEZZL3T-Ct3e_G59.js} +1 -1
- package/dist/client/assets/{journeyDiagram-5HDEW3XC-DRhi_RAn.js → journeyDiagram-5HDEW3XC-BiXisFVi.js} +1 -1
- package/dist/client/assets/{kanban-definition-HUTT4EX6-MJwQ_3lr.js → kanban-definition-HUTT4EX6-CTAX2EZQ.js} +1 -1
- package/dist/client/assets/{linear-Bm7e3IJm.js → linear-gtzA009p.js} +1 -1
- package/dist/client/assets/{mermaid.core-DS6HGJsv.js → mermaid.core-BdXk5TA4.js} +4 -4
- package/dist/client/assets/{mindmap-definition-LN4V7U3C-jfF4Ah_g.js → mindmap-definition-LN4V7U3C-C7XVfI-0.js} +1 -1
- package/dist/client/assets/{pegDiagram-2B236MQR-DItfIx0G.js → pegDiagram-2B236MQR-f9OFTdAF.js} +1 -1
- package/dist/client/assets/{pieDiagram-ENE6RG2P-DYsVowsz.js → pieDiagram-ENE6RG2P-CexwcGUT.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-ABIIQ3AL-CqwBSt-i.js → quadrantDiagram-ABIIQ3AL-rEb1d4K9.js} +1 -1
- package/dist/client/assets/{railroadDiagram-RFXS5EU6-BXYGMARD.js → railroadDiagram-RFXS5EU6-uayZHK87.js} +1 -1
- package/dist/client/assets/{requirementDiagram-TGXJPOKE-OlhYo38c.js → requirementDiagram-TGXJPOKE-DWPla6v3.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-HTMAVEWB-BytDmytE.js → sankeyDiagram-HTMAVEWB-LPc9mQuH.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-DBY2YBRQ-C5IfDQCX.js → sequenceDiagram-DBY2YBRQ-BgHvqqFK.js} +1 -1
- package/dist/client/assets/{sizeCapture-X5ZJPWSS-IQqO80BP.js → sizeCapture-X5ZJPWSS-da41k81P.js} +1 -1
- package/dist/client/assets/{stateDiagram-2N3HPSRC-Dz8Zwv1f.js → stateDiagram-2N3HPSRC-Cls0ucKe.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-6OUMAXLB-BNqH077I.js +1 -0
- package/dist/client/assets/{swimlanes-5IMT3BWC-By1JQ2Vn.js → swimlanes-5IMT3BWC-D0Pk83r7.js} +2 -2
- package/dist/client/assets/swimlanesDiagram-G3AALYLV-CcVt_oli.js +8 -0
- package/dist/client/assets/{timeline-definition-FHXFAJF6-COV2kNQq.js → timeline-definition-FHXFAJF6-DYo44Edu.js} +1 -1
- package/dist/client/assets/{vennDiagram-L72KCM5P-6_6O4S_o.js → vennDiagram-L72KCM5P-CNhw73G2.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-EHGQE667-B6WaMN3B.js → wardleyDiagram-EHGQE667-D2jq9_Nm.js} +1 -1
- package/dist/client/assets/{xychartDiagram-FW5EYKEG-CAZgyI42.js → xychartDiagram-FW5EYKEG-3DLaKkZv.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/client/sw.js +1 -1
- package/dist/server/cli.js +9 -6
- package/dist/server/routes/terminal.js +32 -10
- package/package.json +1 -1
- package/runtime-manifest.json +2 -2
- package/dist/client/assets/channel-BzCBmRI-.js +0 -1
- package/dist/client/assets/classDiagram-OUVF2IWQ-KzxRTl2q.js +0 -1
- package/dist/client/assets/classDiagram-v2-EOCWNBFH-KzxRTl2q.js +0 -1
- package/dist/client/assets/stateDiagram-v2-6OUMAXLB-BiW7fZxb.js +0 -1
- package/dist/client/assets/swimlanesDiagram-G3AALYLV-Be_r6ANc.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Ca-rq7yX.js","assets/react-XDCjal2T.js","assets/ModelPreview-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Ca-rq7yX.js","assets/react-XDCjal2T.js","assets/ModelPreview-D_ePHuIb.js","assets/dnd-BCFAPC0L.js","assets/terminal-C7X98Amf.js","assets/katex-55ZPZeOF.css","assets/mermaid.core-BdXk5TA4.js","assets/purify.es-CC4Brkr_.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{r as sg,a as Qk,g as p7}from"./react-XDCjal2T.js";import{b,R as D,r as oa,a as $k}from"./dnd-BCFAPC0L.js";import{L as Hk,l as Uk}from"./terminal-C7X98Amf.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var f1={exports:{}},j0={};var y5;function zk(){if(y5)return j0;y5=1;var e=sg(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(c,u,f){var p,g={},y=null,v=null;f!==void 0&&(y=""+f),u.key!==void 0&&(y=""+u.key),u.ref!==void 0&&(v=u.ref);for(p in u)r.call(u,p)&&!i.hasOwnProperty(p)&&(g[p]=u[p]);if(c&&c.defaultProps)for(p in u=c.defaultProps,u)g[p]===void 0&&(g[p]=u[p]);return{$$typeof:t,type:c,key:y,ref:v,props:g,_owner:s.current}}return j0.Fragment=n,j0.jsx=l,j0.jsxs=l,j0}var v5;function Gk(){return v5||(v5=1,f1.exports=zk()),f1.exports}var o=Gk(),tp={},w5;function Wk(){if(w5)return tp;w5=1;var e=Qk();return tp.createRoot=e.createRoot,tp.hydrateRoot=e.hydrateRoot,tp}var Vk=Wk();const qk=p7(Vk);function S5(e){return e!==null&&typeof e=="object"&&"constructor"in e&&e.constructor===Object}function B2(e={},t={}){const n=["__proto__","constructor","prototype"];Object.keys(t).filter(r=>n.indexOf(r)<0).forEach(r=>{typeof e[r]>"u"?e[r]=t[r]:S5(t[r])&&S5(e[r])&&Object.keys(t[r]).length>0&&B2(e[r],t[r])})}const m7={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Uu(){const e=typeof document<"u"?document:{};return B2(e,m7),e}const Yk={document:m7,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>"u"||clearTimeout(e)}};function Qo(){const e=typeof window<"u"?window:{};return B2(e,Yk),e}function Kk(e=""){return e.trim().split(" ").filter(t=>!!t.trim())}function Xk(e){const t=e;Object.keys(t).forEach(n=>{try{t[n]=null}catch{}try{delete t[n]}catch{}})}function g7(e,t=0){return setTimeout(e,t)}function gm(){return Date.now()}function Zk(e){const t=Qo();let n;return t.getComputedStyle&&(n=t.getComputedStyle(e,null)),!n&&e.currentStyle&&(n=e.currentStyle),n||(n=e.style),n}function Jk(e,t="x"){const n=Qo();let r,s,i;const l=Zk(e);return n.WebKitCSSMatrix?(s=l.transform||l.webkitTransform,s.split(",").length>6&&(s=s.split(", ").map(c=>c.replace(",",".")).join(", ")),i=new n.WebKitCSSMatrix(s==="none"?"":s)):(i=l.MozTransform||l.OTransform||l.MsTransform||l.msTransform||l.transform||l.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),r=i.toString().split(",")),t==="x"&&(n.WebKitCSSMatrix?s=i.m41:r.length===16?s=parseFloat(r[12]):s=parseFloat(r[4])),t==="y"&&(n.WebKitCSSMatrix?s=i.m42:r.length===16?s=parseFloat(r[13]):s=parseFloat(r[5])),s||0}function np(e){return typeof e=="object"&&e!==null&&e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"}function e_(e){return typeof window<"u"&&typeof window.HTMLElement<"u"?e instanceof HTMLElement:e&&(e.nodeType===1||e.nodeType===11)}function xa(...e){const t=Object(e[0]);for(let n=1;n<e.length;n+=1){const r=e[n];if(r!=null&&!e_(r)){const s=Object.keys(Object(r)).filter(i=>i!=="__proto__"&&i!=="constructor"&&i!=="prototype");for(let i=0,l=s.length;i<l;i+=1){const c=s[i],u=Object.getOwnPropertyDescriptor(r,c);u!==void 0&&u.enumerable&&(np(t[c])&&np(r[c])?r[c].__swiper__?t[c]=r[c]:xa(t[c],r[c]):!np(t[c])&&np(r[c])?(t[c]={},r[c].__swiper__?t[c]=r[c]:xa(t[c],r[c])):t[c]=r[c])}}}return t}function dd(e,t,n){e.style.setProperty(t,n)}function x7({swiper:e,targetPosition:t,side:n}){const r=Qo(),s=-e.translate;let i=null,l;const c=e.params.speed;e.wrapperEl.style.scrollSnapType="none",r.cancelAnimationFrame(e.cssModeFrameID);const u=t>s?"next":"prev",f=(g,y)=>u==="next"&&g>=y||u==="prev"&&g<=y,p=()=>{l=new Date().getTime(),i===null&&(i=l);const g=Math.max(Math.min((l-i)/c,1),0),y=.5-Math.cos(g*Math.PI)/2;let v=s+y*(t-s);if(f(v,t)&&(v=t),e.wrapperEl.scrollTo({[n]:v}),f(v,t)){e.wrapperEl.style.overflow="hidden",e.wrapperEl.style.scrollSnapType="",setTimeout(()=>{e.wrapperEl.style.overflow="",e.wrapperEl.scrollTo({[n]:v})}),r.cancelAnimationFrame(e.cssModeFrameID);return}e.cssModeFrameID=r.requestAnimationFrame(p)};p()}function hc(e,t=""){const n=Qo(),r=[...e.children];return n.HTMLSlotElement&&e instanceof HTMLSlotElement&&r.push(...e.assignedElements()),t?r.filter(s=>s.matches(t)):r}function t_(e,t){const n=[t];for(;n.length>0;){const r=n.shift();if(e===r)return!0;n.push(...r.children,...r.shadowRoot?r.shadowRoot.children:[],...r.assignedElements?r.assignedElements():[])}}function n_(e,t){const n=Qo();let r=t.contains(e);return!r&&n.HTMLSlotElement&&t instanceof HTMLSlotElement&&(r=[...t.assignedElements()].includes(e),r||(r=t_(e,t))),r}function xm(e){try{console.warn(e);return}catch{}}function sb(e,t=[]){const n=document.createElement(e);return n.classList.add(...Array.isArray(t)?t:Kk(t)),n}function r_(e,t){const n=[];for(;e.previousElementSibling;){const r=e.previousElementSibling;t?r.matches(t)&&n.push(r):n.push(r),e=r}return n}function s_(e,t){const n=[];for(;e.nextElementSibling;){const r=e.nextElementSibling;t?r.matches(t)&&n.push(r):n.push(r),e=r}return n}function Uc(e,t){return Qo().getComputedStyle(e,null).getPropertyValue(t)}function A5(e){let t=e,n;if(t){for(n=0;(t=t.previousSibling)!==null;)t.nodeType===1&&(n+=1);return n}}function i_(e,t){const n=[];let r=e.parentElement;for(;r;)n.push(r),r=r.parentElement;return n}function T5(e,t,n){const r=Qo();return e[t==="width"?"offsetWidth":"offsetHeight"]+parseFloat(r.getComputedStyle(e,null).getPropertyValue(t==="width"?"margin-right":"margin-top"))+parseFloat(r.getComputedStyle(e,null).getPropertyValue(t==="width"?"margin-left":"margin-bottom"))}function C5(e,t=""){typeof trustedTypes<"u"?e.innerHTML=trustedTypes.createPolicy("html",{createHTML:n=>n}).createHTML(t):e.innerHTML=t}let h1;function o_(){const e=Qo(),t=Uu();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}function b7(){return h1||(h1=o_()),h1}let p1;function a_({userAgent:e}={}){const t=b7(),n=Qo(),r=n.navigator.platform,s=e||n.navigator.userAgent,i={ios:!1,android:!1},l=n.screen.width,c=n.screen.height,u=s.match(/(Android);?[\s\/]+([\d.]+)?/);let f=s.match(/(iPad)(?!\1).*OS\s([\d_]+)/);const p=s.match(/(iPod)(.*OS\s([\d_]+))?/),g=!f&&s.match(/(iPhone\sOS|iOS)\s([\d_]+)/),y=r==="Win32";let v=r==="MacIntel";const S=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!f&&v&&t.touch&&S.indexOf(`${l}x${c}`)>=0&&(f=s.match(/(Version)\/([\d.]+)/),f||(f=[0,1,"13_0_0"]),v=!1),u&&!y&&(i.os="android",i.android=!0),(f||g||p)&&(i.os="ios",i.ios=!0),i}function y7(e={}){return p1||(p1=a_(e)),p1}let m1;function l_(){const e=Qo(),t=y7();let n=!1;function r(){const c=e.navigator.userAgent.toLowerCase();return c.indexOf("safari")>=0&&c.indexOf("chrome")<0&&c.indexOf("android")<0}if(r()){const c=String(e.navigator.userAgent);if(c.includes("Version/")){const[u,f]=c.split("Version/")[1].split(" ")[0].split(".").map(p=>Number(p));n=u<16||u===16&&f<2}}const s=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent),i=r(),l=i||s&&t.ios;return{isSafari:n||i,needPerspectiveFix:n,need3dFix:l,isWebView:s}}function v7(){return m1||(m1=l_()),m1}function c_({swiper:e,on:t,emit:n}){const r=Qo();let s=null,i=null;const l=()=>{!e||e.destroyed||!e.initialized||(n("beforeResize"),n("resize"))},c=()=>{!e||e.destroyed||!e.initialized||(s=new ResizeObserver(p=>{i=r.requestAnimationFrame(()=>{const{width:g,height:y}=e;let v=g,S=y;p.forEach(({contentBoxSize:A,contentRect:T,target:L})=>{L&&L!==e.el||(v=T?T.width:(A[0]||A).inlineSize,S=T?T.height:(A[0]||A).blockSize)}),(v!==g||S!==y)&&l()})}),s.observe(e.el))},u=()=>{i&&r.cancelAnimationFrame(i),s&&s.unobserve&&e.el&&(s.unobserve(e.el),s=null)},f=()=>{!e||e.destroyed||!e.initialized||n("orientationchange")};t("init",()=>{if(e.params.resizeObserver&&typeof r.ResizeObserver<"u"){c();return}r.addEventListener("resize",l),r.addEventListener("orientationchange",f)}),t("destroy",()=>{u(),r.removeEventListener("resize",l),r.removeEventListener("orientationchange",f)})}function u_({swiper:e,extendParams:t,on:n,emit:r}){const s=[],i=Qo(),l=(f,p={})=>{const g=i.MutationObserver||i.WebkitMutationObserver,y=new g(v=>{if(e.__preventObserver__)return;if(v.length===1){r("observerUpdate",v[0]);return}const S=function(){r("observerUpdate",v[0])};i.requestAnimationFrame?i.requestAnimationFrame(S):i.setTimeout(S,0)});y.observe(f,{attributes:typeof p.attributes>"u"?!0:p.attributes,childList:e.isElement||(typeof p.childList>"u"?!0:p).childList,characterData:typeof p.characterData>"u"?!0:p.characterData}),s.push(y)},c=()=>{if(e.params.observer){if(e.params.observeParents){const f=i_(e.hostEl);for(let p=0;p<f.length;p+=1)l(f[p])}l(e.hostEl,{childList:e.params.observeSlideChildren}),l(e.wrapperEl,{attributes:!1})}},u=()=>{s.forEach(f=>{f.disconnect()}),s.splice(0,s.length)};t({observer:!1,observeParents:!1,observeSlideChildren:!1}),n("init",c),n("destroy",u)}var d_={on(e,t,n){const r=this;if(!r.eventsListeners||r.destroyed||typeof t!="function")return r;const s=n?"unshift":"push";return e.split(" ").forEach(i=>{r.eventsListeners[i]||(r.eventsListeners[i]=[]),r.eventsListeners[i][s](t)}),r},once(e,t,n){const r=this;if(!r.eventsListeners||r.destroyed||typeof t!="function")return r;function s(...i){r.off(e,s),s.__emitterProxy&&delete s.__emitterProxy,t.apply(r,i)}return s.__emitterProxy=t,r.on(e,s,n)},onAny(e,t){const n=this;if(!n.eventsListeners||n.destroyed||typeof e!="function")return n;const r=t?"unshift":"push";return n.eventsAnyListeners.indexOf(e)<0&&n.eventsAnyListeners[r](e),n},offAny(e){const t=this;if(!t.eventsListeners||t.destroyed||!t.eventsAnyListeners)return t;const n=t.eventsAnyListeners.indexOf(e);return n>=0&&t.eventsAnyListeners.splice(n,1),t},off(e,t){const n=this;return!n.eventsListeners||n.destroyed||!n.eventsListeners||e.split(" ").forEach(r=>{typeof t>"u"?n.eventsListeners[r]=[]:n.eventsListeners[r]&&n.eventsListeners[r].forEach((s,i)=>{(s===t||s.__emitterProxy&&s.__emitterProxy===t)&&n.eventsListeners[r].splice(i,1)})}),n},emit(...e){const t=this;if(!t.eventsListeners||t.destroyed||!t.eventsListeners)return t;let n,r,s;return typeof e[0]=="string"||Array.isArray(e[0])?(n=e[0],r=e.slice(1,e.length),s=t):(n=e[0].events,r=e[0].data,s=e[0].context||t),r.unshift(s),(Array.isArray(n)?n:n.split(" ")).forEach(l=>{t.eventsAnyListeners&&t.eventsAnyListeners.length&&t.eventsAnyListeners.forEach(c=>{c.apply(s,[l,...r])}),t.eventsListeners&&t.eventsListeners[l]&&t.eventsListeners[l].forEach(c=>{c.apply(s,r)})}),t}};function f_(){const e=this;let t,n;const r=e.el;typeof e.params.width<"u"&&e.params.width!==null?t=e.params.width:t=r.clientWidth,typeof e.params.height<"u"&&e.params.height!==null?n=e.params.height:n=r.clientHeight,!(t===0&&e.isHorizontal()||n===0&&e.isVertical())&&(t=t-parseInt(Uc(r,"padding-left")||0,10)-parseInt(Uc(r,"padding-right")||0,10),n=n-parseInt(Uc(r,"padding-top")||0,10)-parseInt(Uc(r,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(n)&&(n=0),Object.assign(e,{width:t,height:n,size:e.isHorizontal()?t:n}))}function h_(){const e=this;function t(q,V){return parseFloat(q.getPropertyValue(e.getDirectionLabel(V))||0)}const n=e.params,{wrapperEl:r,slidesEl:s,rtlTranslate:i,wrongRTL:l}=e,c=e.virtual&&n.virtual.enabled,u=c?e.virtual.slides.length:e.slides.length,f=hc(s,`.${e.params.slideClass}, swiper-slide`),p=c?e.virtual.slides.length:f.length;let g=[];const y=[],v=[];let S=n.slidesOffsetBefore;typeof S=="function"&&(S=n.slidesOffsetBefore.call(e));let A=n.slidesOffsetAfter;typeof A=="function"&&(A=n.slidesOffsetAfter.call(e));const T=e.snapGrid.length,L=e.slidesGrid.length,I=e.size-S-A;let j=n.spaceBetween,P=-S,F=0,R=0;if(typeof I>"u")return;typeof j=="string"&&j.indexOf("%")>=0?j=parseFloat(j.replace("%",""))/100*I:typeof j=="string"&&(j=parseFloat(j)),e.virtualSize=-j-S-A,f.forEach(q=>{i?q.style.marginLeft="":q.style.marginRight="",q.style.marginBottom="",q.style.marginTop=""}),n.centeredSlides&&n.cssMode&&(dd(r,"--swiper-centered-offset-before",""),dd(r,"--swiper-centered-offset-after","")),n.cssMode&&(dd(r,"--swiper-slides-offset-before",`${S}px`),dd(r,"--swiper-slides-offset-after",`${A}px`));const C=n.grid&&n.grid.rows>1&&e.grid;C?e.grid.initSlides(f):e.grid&&e.grid.unsetSlides();let $;const Q=n.slidesPerView==="auto"&&n.breakpoints&&Object.keys(n.breakpoints).filter(q=>typeof n.breakpoints[q].slidesPerView<"u").length>0;for(let q=0;q<p;q+=1){$=0;const V=f[q];if(!(V&&(C&&e.grid.updateSlide(q,V,f),Uc(V,"display")==="none"))){if(c&&n.slidesPerView==="auto")n.virtual.slidesPerViewAutoSlideSize&&($=n.virtual.slidesPerViewAutoSlideSize),$&&V&&(n.roundLengths&&($=Math.floor($)),V.style[e.getDirectionLabel("width")]=`${$}px`);else if(n.slidesPerView==="auto"){Q&&(V.style[e.getDirectionLabel("width")]="");const he=getComputedStyle(V),ee=V.style.transform,me=V.style.webkitTransform;if(ee&&(V.style.transform="none"),me&&(V.style.webkitTransform="none"),n.roundLengths)$=e.isHorizontal()?T5(V,"width"):T5(V,"height");else{const ye=t(he,"width"),ue=t(he,"padding-left"),ie=t(he,"padding-right"),G=t(he,"margin-left"),z=t(he,"margin-right"),X=he.getPropertyValue("box-sizing");if(X&&X==="border-box")$=ye+G+z;else{const{clientWidth:oe,offsetWidth:ge}=V;$=ye+ue+ie+G+z+(ge-oe)}}ee&&(V.style.transform=ee),me&&(V.style.webkitTransform=me),n.roundLengths&&($=Math.floor($))}else $=(I-(n.slidesPerView-1)*j)/n.slidesPerView,n.roundLengths&&($=Math.floor($)),V&&(V.style[e.getDirectionLabel("width")]=`${$}px`);V&&(V.swiperSlideSize=$),v.push($),n.centeredSlides?(P=P+$/2+F/2+j,F===0&&q!==0&&(P=P-I/2-j),q===0&&(P=P-I/2-j),Math.abs(P)<1/1e3&&(P=0),n.roundLengths&&(P=Math.floor(P)),R%n.slidesPerGroup===0&&g.push(P),y.push(P)):(n.roundLengths&&(P=Math.floor(P)),(R-Math.min(e.params.slidesPerGroupSkip,R))%e.params.slidesPerGroup===0&&g.push(P),y.push(P),P=P+$+j),e.virtualSize+=$+j,F=$,R+=1}}if(e.virtualSize=Math.max(e.virtualSize,I)+A,i&&l&&(n.effect==="slide"||n.effect==="coverflow")&&(r.style.width=`${e.virtualSize+j}px`),n.setWrapperSize&&(r.style[e.getDirectionLabel("width")]=`${e.virtualSize+j}px`),C&&e.grid.updateWrapperSize($,g),!n.centeredSlides){const q=n.slidesPerView!=="auto"&&n.slidesPerView%1!==0,V=n.snapToSlideEdge&&!n.loop&&(n.slidesPerView==="auto"||q);let he=g.length;if(V){let me;if(n.slidesPerView==="auto"){me=1;let ye=0;for(let ue=v.length-1;ue>=0&&(ye+=v[ue]+(ue<v.length-1?j:0),ye<=I);ue-=1)me=v.length-ue}else me=Math.floor(n.slidesPerView);he=Math.max(p-me,0)}const ee=[];for(let me=0;me<g.length;me+=1){let ye=g[me];n.roundLengths&&(ye=Math.floor(ye)),V?me<=he&&ee.push(ye):g[me]<=e.virtualSize-I&&ee.push(ye)}g=ee,Math.floor(e.virtualSize-I)-Math.floor(g[g.length-1])>1&&(V||g.push(e.virtualSize-I))}if(c&&n.loop){const q=v[0]+j;if(n.slidesPerGroup>1){const V=Math.ceil((e.virtual.slidesBefore+e.virtual.slidesAfter)/n.slidesPerGroup),he=q*n.slidesPerGroup;for(let ee=0;ee<V;ee+=1)g.push(g[g.length-1]+he)}for(let V=0;V<e.virtual.slidesBefore+e.virtual.slidesAfter;V+=1)n.slidesPerGroup===1&&g.push(g[g.length-1]+q),y.push(y[y.length-1]+q),e.virtualSize+=q}if(g.length===0&&(g=[0]),j!==0){const q=e.isHorizontal()&&i?"marginLeft":e.getDirectionLabel("marginRight");f.filter((V,he)=>!n.cssMode||n.loop?!0:he!==f.length-1).forEach(V=>{V.style[q]=`${j}px`})}if(n.centeredSlides&&n.centeredSlidesBounds){let q=0;v.forEach(he=>{q+=he+(j||0)}),q-=j;const V=q>I?q-I:0;g=g.map(he=>he<=0?-S:he>V?V+A:he)}if(n.centerInsufficientSlides){let q=0;if(v.forEach(V=>{q+=V+(j||0)}),q-=j,q<I){const V=(I-q)/2;g.forEach((he,ee)=>{g[ee]=he-V}),y.forEach((he,ee)=>{y[ee]=he+V})}}if(Object.assign(e,{slides:f,snapGrid:g,slidesGrid:y,slidesSizesGrid:v}),n.centeredSlides&&n.cssMode&&!n.centeredSlidesBounds){dd(r,"--swiper-centered-offset-before",`${-g[0]}px`),dd(r,"--swiper-centered-offset-after",`${e.size/2-v[v.length-1]/2}px`);const q=-e.snapGrid[0],V=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map(he=>he+q),e.slidesGrid=e.slidesGrid.map(he=>he+V)}if(p!==u&&e.emit("slidesLengthChange"),g.length!==T&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),y.length!==L&&e.emit("slidesGridLengthChange"),n.watchSlidesProgress&&e.updateSlidesOffset(),e.emit("slidesUpdated"),!c&&!n.cssMode&&(n.effect==="slide"||n.effect==="fade")){const q=`${n.containerModifierClass}backface-hidden`,V=e.el.classList.contains(q);p<=n.maxBackfaceHiddenSlides?V||e.el.classList.add(q):V&&e.el.classList.remove(q)}}function p_(e){const t=this,n=[],r=t.virtual&&t.params.virtual.enabled;let s=0,i;typeof e=="number"?t.setTransition(e):e===!0&&t.setTransition(t.params.speed);const l=c=>r?t.slides[t.getSlideIndexByData(c)]:t.slides[c];if(t.params.slidesPerView!=="auto"&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach(c=>{n.push(c)});else for(i=0;i<Math.ceil(t.params.slidesPerView);i+=1){const c=t.activeIndex+i;if(c>t.slides.length&&!r)break;n.push(l(c))}else n.push(l(t.activeIndex));for(i=0;i<n.length;i+=1)if(typeof n[i]<"u"){const c=n[i].offsetHeight;s=c>s?c:s}(s||s===0)&&(t.wrapperEl.style.height=`${s}px`)}function m_(){const e=this,t=e.slides,n=e.isElement?e.isHorizontal()?e.wrapperEl.offsetLeft:e.wrapperEl.offsetTop:0;for(let r=0;r<t.length;r+=1)t[r].swiperSlideOffset=(e.isHorizontal()?t[r].offsetLeft:t[r].offsetTop)-n-e.cssOverflowAdjustment()}const k5=(e,t,n)=>{t&&!e.classList.contains(n)?e.classList.add(n):!t&&e.classList.contains(n)&&e.classList.remove(n)};function g_(e=this&&this.translate||0){const t=this,n=t.params,{slides:r,rtlTranslate:s,snapGrid:i}=t;if(r.length===0)return;typeof r[0].swiperSlideOffset>"u"&&t.updateSlidesOffset();let l=-e;s&&(l=e),t.visibleSlidesIndexes=[],t.visibleSlides=[];let c=n.spaceBetween;typeof c=="string"&&c.indexOf("%")>=0?c=parseFloat(c.replace("%",""))/100*t.size:typeof c=="string"&&(c=parseFloat(c));for(let u=0;u<r.length;u+=1){const f=r[u];let p=f.swiperSlideOffset;n.cssMode&&n.centeredSlides&&(p-=r[0].swiperSlideOffset);const g=(l+(n.centeredSlides?t.minTranslate():0)-p)/(f.swiperSlideSize+c),y=(l-i[0]+(n.centeredSlides?t.minTranslate():0)-p)/(f.swiperSlideSize+c),v=-(l-p),S=v+t.slidesSizesGrid[u],A=v>=0&&v<=t.size-t.slidesSizesGrid[u],T=v>=0&&v<t.size-1||S>1&&S<=t.size||v<=0&&S>=t.size;T&&(t.visibleSlides.push(f),t.visibleSlidesIndexes.push(u)),k5(f,T,n.slideVisibleClass),k5(f,A,n.slideFullyVisibleClass),f.progress=s?-g:g,f.originalProgress=s?-y:y}}function x_(e){const t=this;if(typeof e>"u"){const p=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*p||0}const n=t.params,r=t.maxTranslate()-t.minTranslate();let{progress:s,isBeginning:i,isEnd:l,progressLoop:c}=t;const u=i,f=l;if(r===0)s=0,i=!0,l=!0;else{s=(e-t.minTranslate())/r;const p=Math.abs(e-t.minTranslate())<1,g=Math.abs(e-t.maxTranslate())<1;i=p||s<=0,l=g||s>=1,p&&(s=0),g&&(s=1)}if(n.loop){const p=t.getSlideIndexByData(0),g=t.getSlideIndexByData(t.slides.length-1),y=t.slidesGrid[p],v=t.slidesGrid[g],S=t.slidesGrid[t.slidesGrid.length-1],A=Math.abs(e);A>=y?c=(A-y)/S:c=(A+S-v)/S,c>1&&(c-=1)}Object.assign(t,{progress:s,progressLoop:c,isBeginning:i,isEnd:l}),(n.watchSlidesProgress||n.centeredSlides&&n.autoHeight)&&t.updateSlidesProgress(e),i&&!u&&t.emit("reachBeginning toEdge"),l&&!f&&t.emit("reachEnd toEdge"),(u&&!i||f&&!l)&&t.emit("fromEdge"),t.emit("progress",s)}const g1=(e,t,n)=>{t&&!e.classList.contains(n)?e.classList.add(n):!t&&e.classList.contains(n)&&e.classList.remove(n)};function b_(){const e=this,{slides:t,params:n,slidesEl:r,activeIndex:s}=e,i=e.virtual&&n.virtual.enabled,l=e.grid&&n.grid&&n.grid.rows>1,c=g=>hc(r,`.${n.slideClass}${g}, swiper-slide${g}`)[0];let u,f,p;if(i)if(n.loop){let g=s-e.virtual.slidesBefore;g<0&&(g=e.virtual.slides.length+g),g>=e.virtual.slides.length&&(g-=e.virtual.slides.length),u=c(`[data-swiper-slide-index="${g}"]`)}else u=c(`[data-swiper-slide-index="${s}"]`);else l?(u=t.find(g=>g.column===s),p=t.find(g=>g.column===s+1),f=t.find(g=>g.column===s-1)):u=t[s];u&&(l||(p=s_(u,`.${n.slideClass}, swiper-slide`)[0],n.loop&&!p&&(p=t[0]),f=r_(u,`.${n.slideClass}, swiper-slide`)[0],n.loop&&!f===0&&(f=t[t.length-1]))),t.forEach(g=>{g1(g,g===u,n.slideActiveClass),g1(g,g===p,n.slideNextClass),g1(g,g===f,n.slidePrevClass)}),e.emitSlidesClasses()}const Wp=(e,t)=>{if(!e||e.destroyed||!e.params)return;const n=()=>e.isElement?"swiper-slide":`.${e.params.slideClass}`,r=t.closest(n());if(r){let s=r.querySelector(`.${e.params.lazyPreloaderClass}`);!s&&e.isElement&&(r.shadowRoot?s=r.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{r.shadowRoot&&(s=r.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`),s&&!s.lazyPreloaderManaged&&s.remove())})),s&&!s.lazyPreloaderManaged&&s.remove()}},x1=(e,t)=>{if(!e.slides[t])return;const n=e.slides[t].querySelector('[loading="lazy"]');n&&n.removeAttribute("loading")},ib=e=>{if(!e||e.destroyed||!e.params)return;let t=e.params.lazyPreloadPrevNext;const n=e.slides.length;if(!n||!t||t<0)return;t=Math.min(t,n);const r=e.params.slidesPerView==="auto"?e.slidesPerViewDynamic():Math.ceil(e.params.slidesPerView),s=e.activeIndex;if(e.params.grid&&e.params.grid.rows>1){const l=s,c=[l-t];c.push(...Array.from({length:t}).map((u,f)=>l+r+f)),e.slides.forEach((u,f)=>{c.includes(u.column)&&x1(e,f)});return}const i=s+r-1;if(e.params.rewind||e.params.loop)for(let l=s-t;l<=i+t;l+=1){const c=(l%n+n)%n;(c<s||c>i)&&x1(e,c)}else for(let l=Math.max(s-t,0);l<=Math.min(i+t,n-1);l+=1)l!==s&&(l>i||l<s)&&x1(e,l)};function y_(e){const{slidesGrid:t,params:n}=e,r=e.rtlTranslate?e.translate:-e.translate;let s;for(let i=0;i<t.length;i+=1)typeof t[i+1]<"u"?r>=t[i]&&r<t[i+1]-(t[i+1]-t[i])/2?s=i:r>=t[i]&&r<t[i+1]&&(s=i+1):r>=t[i]&&(s=i);return n.normalizeSlideIndex&&(s<0||typeof s>"u")&&(s=0),s}function v_(e){const t=this,n=t.rtlTranslate?t.translate:-t.translate,{snapGrid:r,params:s,activeIndex:i,realIndex:l,snapIndex:c}=t;let u=e,f;const p=v=>{let S=v-t.virtual.slidesBefore;return S<0&&(S=t.virtual.slides.length+S),S>=t.virtual.slides.length&&(S-=t.virtual.slides.length),S};if(typeof u>"u"&&(u=y_(t)),r.indexOf(n)>=0)f=r.indexOf(n);else{const v=Math.min(s.slidesPerGroupSkip,u);f=v+Math.floor((u-v)/s.slidesPerGroup)}if(f>=r.length&&(f=r.length-1),u===i&&!t.params.loop){f!==c&&(t.snapIndex=f,t.emit("snapIndexChange"));return}if(u===i&&t.params.loop&&t.virtual&&t.params.virtual.enabled){t.realIndex=p(u);return}const g=t.grid&&s.grid&&s.grid.rows>1;let y;if(t.virtual&&s.virtual.enabled)s.loop?y=p(u):y=u;else if(g){const v=t.slides.find(A=>A.column===u);let S=parseInt(v.getAttribute("data-swiper-slide-index"),10);Number.isNaN(S)&&(S=Math.max(t.slides.indexOf(v),0)),y=Math.floor(S/s.grid.rows)}else if(t.slides[u]){const v=t.slides[u].getAttribute("data-swiper-slide-index");v?y=parseInt(v,10):y=u}else y=u;Object.assign(t,{previousSnapIndex:c,snapIndex:f,previousRealIndex:l,realIndex:y,previousIndex:i,activeIndex:u}),t.initialized&&ib(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&(l!==y&&t.emit("realIndexChange"),t.emit("slideChange"))}function w_(e,t){const n=this,r=n.params;let s=e.closest(`.${r.slideClass}, swiper-slide`);!s&&n.isElement&&t&&t.length>1&&t.includes(e)&&[...t.slice(t.indexOf(e)+1,t.length)].forEach(c=>{!s&&c.matches&&c.matches(`.${r.slideClass}, swiper-slide`)&&(s=c)});let i=!1,l;if(s){for(let c=0;c<n.slides.length;c+=1)if(n.slides[c]===s){i=!0,l=c;break}}if(s&&i)n.clickedSlide=s,n.virtual&&n.params.virtual.enabled?n.clickedIndex=parseInt(s.getAttribute("data-swiper-slide-index"),10):n.clickedIndex=l;else{n.clickedSlide=void 0,n.clickedIndex=void 0;return}r.slideToClickedSlide&&n.clickedIndex!==void 0&&n.clickedIndex!==n.activeIndex&&n.slideToClickedSlide()}var S_={updateSize:f_,updateSlides:h_,updateAutoHeight:p_,updateSlidesOffset:m_,updateSlidesProgress:g_,updateProgress:x_,updateSlidesClasses:b_,updateActiveIndex:v_,updateClickedSlide:w_};function A_(e=this.isHorizontal()?"x":"y"){const t=this,{params:n,rtlTranslate:r,translate:s,wrapperEl:i}=t;if(n.virtualTranslate)return r?-s:s;if(n.cssMode)return s;let l=Jk(i,e);return l+=t.cssOverflowAdjustment(),r&&(l=-l),l||0}function T_(e,t){const n=this,{rtlTranslate:r,params:s,wrapperEl:i,progress:l}=n;let c=0,u=0;const f=0;n.isHorizontal()?c=r?-e:e:u=e,s.roundLengths&&(c=Math.floor(c),u=Math.floor(u)),n.previousTranslate=n.translate,n.translate=n.isHorizontal()?c:u,s.cssMode?i[n.isHorizontal()?"scrollLeft":"scrollTop"]=n.isHorizontal()?-c:-u:s.virtualTranslate||(n.isHorizontal()?c-=n.cssOverflowAdjustment():u-=n.cssOverflowAdjustment(),i.style.transform=`translate3d(${c}px, ${u}px, ${f}px)`);let p;const g=n.maxTranslate()-n.minTranslate();g===0?p=0:p=(e-n.minTranslate())/g,p!==l&&n.updateProgress(e),n.emit("setTranslate",n.translate,t)}function C_(){return-this.snapGrid[0]}function k_(){return-this.snapGrid[this.snapGrid.length-1]}function __(e=0,t=this.params.speed,n=!0,r=!0,s){const i=this,{params:l,wrapperEl:c}=i;if(i.animating&&l.preventInteractionOnTransition)return!1;const u=i.minTranslate(),f=i.maxTranslate();let p;if(r&&e>u?p=u:r&&e<f?p=f:p=e,i.updateProgress(p),l.cssMode){const g=i.isHorizontal();if(t===0)c[g?"scrollLeft":"scrollTop"]=-p;else{if(!i.support.smoothScroll)return x7({swiper:i,targetPosition:-p,side:g?"left":"top"}),!0;c.scrollTo({[g?"left":"top"]:-p,behavior:"smooth"})}return!0}return t===0?(i.setTransition(0),i.setTranslate(p),n&&(i.emit("beforeTransitionStart",t,s),i.emit("transitionEnd"))):(i.setTransition(t),i.setTranslate(p),n&&(i.emit("beforeTransitionStart",t,s),i.emit("transitionStart")),i.animating||(i.animating=!0,i.onTranslateToWrapperTransitionEnd||(i.onTranslateToWrapperTransitionEnd=function(y){!i||i.destroyed||y.target===this&&(i.wrapperEl.removeEventListener("transitionend",i.onTranslateToWrapperTransitionEnd),i.onTranslateToWrapperTransitionEnd=null,delete i.onTranslateToWrapperTransitionEnd,i.animating=!1,n&&i.emit("transitionEnd"))}),i.wrapperEl.addEventListener("transitionend",i.onTranslateToWrapperTransitionEnd))),!0}var L_={getTranslate:A_,setTranslate:T_,minTranslate:C_,maxTranslate:k_,translateTo:__};function E_(e,t){const n=this;n.params.cssMode||(n.wrapperEl.style.transitionDuration=`${e}ms`,n.wrapperEl.style.transitionDelay=e===0?"0ms":""),n.emit("setTransition",e,t)}function w7({swiper:e,runCallbacks:t,direction:n,step:r}){const{activeIndex:s,previousIndex:i}=e;let l=n;l||(s>i?l="next":s<i?l="prev":l="reset"),e.emit(`transition${r}`),t&&l==="reset"?e.emit(`slideResetTransition${r}`):t&&s!==i&&(e.emit(`slideChangeTransition${r}`),l==="next"?e.emit(`slideNextTransition${r}`):e.emit(`slidePrevTransition${r}`))}function I_(e=!0,t){const n=this,{params:r}=n;r.cssMode||(r.autoHeight&&n.updateAutoHeight(),w7({swiper:n,runCallbacks:e,direction:t,step:"Start"}))}function R_(e=!0,t){const n=this,{params:r}=n;n.animating=!1,!r.cssMode&&(n.setTransition(0),w7({swiper:n,runCallbacks:e,direction:t,step:"End"}))}var N_={setTransition:E_,transitionStart:I_,transitionEnd:R_};function M_(e=0,t,n=!0,r,s){typeof e=="string"&&(e=parseInt(e,10));const i=this;let l=e;l<0&&(l=0);const{params:c,snapGrid:u,slidesGrid:f,previousIndex:p,activeIndex:g,rtlTranslate:y,wrapperEl:v,enabled:S}=i;if(!S&&!r&&!s||i.destroyed||i.animating&&c.preventInteractionOnTransition)return!1;typeof t>"u"&&(t=i.params.speed);const A=Math.min(i.params.slidesPerGroupSkip,l);let T=A+Math.floor((l-A)/i.params.slidesPerGroup);T>=u.length&&(T=u.length-1);const L=-u[T];if(c.normalizeSlideIndex)for(let C=0;C<f.length;C+=1){const $=-Math.floor(L*100),Q=Math.floor(f[C]*100),q=Math.floor(f[C+1]*100);typeof f[C+1]<"u"?$>=Q&&$<q-(q-Q)/2?l=C:$>=Q&&$<q&&(l=C+1):$>=Q&&(l=C)}if(i.initialized&&l!==g&&(!i.allowSlideNext&&(y?L>i.translate&&L>i.minTranslate():L<i.translate&&L<i.minTranslate())||!i.allowSlidePrev&&L>i.translate&&L>i.maxTranslate()&&(g||0)!==l))return!1;l!==(p||0)&&n&&i.emit("beforeSlideChangeStart"),i.updateProgress(L);let I;l>g?I="next":l<g?I="prev":I="reset";const j=i.virtual&&i.params.virtual.enabled;if(!(j&&s)&&(y&&-L===i.translate||!y&&L===i.translate))return i.updateActiveIndex(l),c.autoHeight&&i.updateAutoHeight(),i.updateSlidesClasses(),c.effect!=="slide"&&i.setTranslate(L),I!=="reset"&&(i.transitionStart(n,I),i.transitionEnd(n,I)),!1;if(c.cssMode){const C=i.isHorizontal(),$=y?L:-L;if(t===0)j&&(i.wrapperEl.style.scrollSnapType="none",i._immediateVirtual=!0),j&&!i._cssModeVirtualInitialSet&&i.params.initialSlide>0?(i._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{v[C?"scrollLeft":"scrollTop"]=$})):v[C?"scrollLeft":"scrollTop"]=$,j&&requestAnimationFrame(()=>{i.wrapperEl.style.scrollSnapType="",i._immediateVirtual=!1});else{if(!i.support.smoothScroll)return x7({swiper:i,targetPosition:$,side:C?"left":"top"}),!0;v.scrollTo({[C?"left":"top"]:$,behavior:"smooth"})}return!0}const R=v7().isSafari;return j&&!s&&R&&i.isElement&&i.virtual.update(!1,!1,l),i.setTransition(t),i.setTranslate(L),i.updateActiveIndex(l),i.updateSlidesClasses(),i.emit("beforeTransitionStart",t,r),i.transitionStart(n,I),t===0?i.transitionEnd(n,I):i.animating||(i.animating=!0,i.onSlideToWrapperTransitionEnd||(i.onSlideToWrapperTransitionEnd=function($){!i||i.destroyed||$.target===this&&(i.wrapperEl.removeEventListener("transitionend",i.onSlideToWrapperTransitionEnd),i.onSlideToWrapperTransitionEnd=null,delete i.onSlideToWrapperTransitionEnd,i.transitionEnd(n,I))}),i.wrapperEl.addEventListener("transitionend",i.onSlideToWrapperTransitionEnd)),!0}function D_(e=0,t,n=!0,r){typeof e=="string"&&(e=parseInt(e,10));const s=this;if(s.destroyed)return;typeof t>"u"&&(t=s.params.speed);const i=s.grid&&s.params.grid&&s.params.grid.rows>1;let l=e;if(s.params.loop)if(s.virtual&&s.params.virtual.enabled)l=l+s.virtual.slidesBefore;else{let c;if(i){const A=l*s.params.grid.rows;c=s.slides.find(T=>T.getAttribute("data-swiper-slide-index")*1===A).column}else c=s.getSlideIndexByData(l);const u=i?Math.ceil(s.slides.length/s.params.grid.rows):s.slides.length,{centeredSlides:f,slidesOffsetBefore:p,slidesOffsetAfter:g}=s.params,y=f||!!p||!!g;let v=s.params.slidesPerView;v==="auto"?v=s.slidesPerViewDynamic():(v=Math.ceil(parseFloat(s.params.slidesPerView,10)),y&&v%2===0&&(v=v+1));let S=u-c<v;if(y&&(S=S||c<Math.ceil(v/2)),r&&y&&s.params.slidesPerView!=="auto"&&!i&&(S=!1),S){const A=y?c<s.activeIndex?"prev":"next":c-s.activeIndex-1<s.params.slidesPerView?"next":"prev";s.loopFix({direction:A,slideTo:!0,activeSlideIndex:A==="next"?c+1:c-u+1,slideRealIndex:A==="next"?s.realIndex:void 0})}if(i){const A=l*s.params.grid.rows;l=s.slides.find(T=>T.getAttribute("data-swiper-slide-index")*1===A).column}else l=s.getSlideIndexByData(l)}return requestAnimationFrame(()=>{s.slideTo(l,t,n,r)}),s}function j_(e,t=!0,n){const r=this,{enabled:s,params:i,animating:l}=r;if(!s||r.destroyed)return r;typeof e>"u"&&(e=r.params.speed);let c=i.slidesPerGroup;i.slidesPerView==="auto"&&i.slidesPerGroup===1&&i.slidesPerGroupAuto&&(c=Math.max(r.slidesPerViewDynamic("current",!0),1));const u=r.activeIndex<i.slidesPerGroupSkip?1:c,f=r.virtual&&i.virtual.enabled;if(i.loop){if(l&&!f&&i.loopPreventsSliding)return!1;if(r.loopFix({direction:"next"}),r._clientLeft=r.wrapperEl.clientLeft,r.activeIndex===r.slides.length-1&&i.cssMode)return requestAnimationFrame(()=>{r.slideTo(r.activeIndex+u,e,t,n)}),!0}return i.rewind&&r.isEnd?r.slideTo(0,e,t,n):r.slideTo(r.activeIndex+u,e,t,n)}function P_(e,t=!0,n){const r=this,{params:s,snapGrid:i,slidesGrid:l,rtlTranslate:c,enabled:u,animating:f}=r;if(!u||r.destroyed)return r;typeof e>"u"&&(e=r.params.speed);const p=r.virtual&&s.virtual.enabled;if(s.loop){if(f&&!p&&s.loopPreventsSliding)return!1;r.loopFix({direction:"prev"}),r._clientLeft=r.wrapperEl.clientLeft}const g=c?r.translate:-r.translate;function y(I){return I<0?-Math.floor(Math.abs(I)):Math.floor(I)}const v=y(g),S=i.map(I=>y(I)),A=s.freeMode&&s.freeMode.enabled;let T=i[S.indexOf(v)-1];if(typeof T>"u"&&(s.cssMode||A)){let I;i.forEach((j,P)=>{v>=j&&(I=P)}),typeof I<"u"&&(T=A?i[I]:i[I>0?I-1:I])}let L=0;if(typeof T<"u"&&(L=l.indexOf(T),L<0&&(L=r.activeIndex-1),s.slidesPerView==="auto"&&s.slidesPerGroup===1&&s.slidesPerGroupAuto&&(L=L-r.slidesPerViewDynamic("previous",!0)+1,L=Math.max(L,0))),s.rewind&&r.isBeginning){const I=r.params.virtual&&r.params.virtual.enabled&&r.virtual?r.virtual.slides.length-1:r.slides.length-1;return r.slideTo(I,e,t,n)}else if(s.loop&&r.activeIndex===0&&s.cssMode)return requestAnimationFrame(()=>{r.slideTo(L,e,t,n)}),!0;return r.slideTo(L,e,t,n)}function B_(e,t=!0,n){const r=this;if(!r.destroyed)return typeof e>"u"&&(e=r.params.speed),r.slideTo(r.activeIndex,e,t,n)}function F_(e,t=!0,n,r=.5){const s=this;if(s.destroyed)return;typeof e>"u"&&(e=s.params.speed);let i=s.activeIndex;const l=Math.min(s.params.slidesPerGroupSkip,i),c=l+Math.floor((i-l)/s.params.slidesPerGroup),u=s.rtlTranslate?s.translate:-s.translate;if(u>=s.snapGrid[c]){const f=s.snapGrid[c],p=s.snapGrid[c+1];u-f>(p-f)*r&&(i+=s.params.slidesPerGroup)}else{const f=s.snapGrid[c-1],p=s.snapGrid[c];u-f<=(p-f)*r&&(i-=s.params.slidesPerGroup)}return i=Math.max(i,0),i=Math.min(i,s.slidesGrid.length-1),s.slideTo(i,e,t,n)}function O_(){const e=this;if(e.destroyed)return;const{params:t,slidesEl:n}=e,r=t.slidesPerView==="auto"?e.slidesPerViewDynamic():t.slidesPerView;let s=e.getSlideIndexWhenGrid(e.clickedIndex),i;const l=e.isElement?"swiper-slide":`.${t.slideClass}`,c=e.grid&&e.params.grid&&e.params.grid.rows>1;if(t.loop){if(e.animating)return;i=parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?e.slideToLoop(i):s>(c?(e.slides.length-r)/2-(e.params.grid.rows-1):e.slides.length-r)?(e.loopFix(),s=e.getSlideIndex(hc(n,`${l}[data-swiper-slide-index="${i}"]`)[0]),g7(()=>{e.slideTo(s)})):e.slideTo(s)}else e.slideTo(s)}var Q_={slideTo:M_,slideToLoop:D_,slideNext:j_,slidePrev:P_,slideReset:B_,slideToClosest:F_,slideToClickedSlide:O_};function $_(e,t){const n=this,{params:r,slidesEl:s}=n;if(!r.loop||n.virtual&&n.params.virtual.enabled)return;const i=()=>{hc(s,`.${r.slideClass}, swiper-slide`).forEach((S,A)=>{S.setAttribute("data-swiper-slide-index",A)})},l=()=>{const v=hc(s,`.${r.slideBlankClass}`);v.forEach(S=>{S.remove()}),v.length>0&&(n.recalcSlides(),n.updateSlides())},c=n.grid&&r.grid&&r.grid.rows>1;r.loopAddBlankSlides&&(r.slidesPerGroup>1||c)&&l();const u=r.slidesPerGroup*(c?r.grid.rows:1),f=n.slides.length%u!==0,p=c&&n.slides.length%r.grid.rows!==0,g=v=>{for(let S=0;S<v;S+=1){const A=n.isElement?sb("swiper-slide",[r.slideBlankClass]):sb("div",[r.slideClass,r.slideBlankClass]);n.slidesEl.append(A)}};if(f){if(r.loopAddBlankSlides){const v=u-n.slides.length%u;g(v),n.recalcSlides(),n.updateSlides()}else xm("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else if(p){if(r.loopAddBlankSlides){const v=r.grid.rows-n.slides.length%r.grid.rows;g(v),n.recalcSlides(),n.updateSlides()}else xm("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else i();const y=r.centeredSlides||!!r.slidesOffsetBefore||!!r.slidesOffsetAfter;n.loopFix({slideRealIndex:e,direction:y?void 0:"next",initial:t})}function H_({slideRealIndex:e,slideTo:t=!0,direction:n,setTranslate:r,activeSlideIndex:s,initial:i,byController:l,byMousewheel:c}={}){const u=this;if(!u.params.loop)return;u.emit("beforeLoopFix");const{slides:f,allowSlidePrev:p,allowSlideNext:g,slidesEl:y,params:v}=u,{centeredSlides:S,slidesOffsetBefore:A,slidesOffsetAfter:T,initialSlide:L}=v,I=S||!!A||!!T;if(u.allowSlidePrev=!0,u.allowSlideNext=!0,u.virtual&&v.virtual.enabled){t&&(!I&&u.snapIndex===0?u.slideTo(u.virtual.slides.length,0,!1,!0):I&&u.snapIndex<v.slidesPerView?u.slideTo(u.virtual.slides.length+u.snapIndex,0,!1,!0):u.snapIndex===u.snapGrid.length-1&&u.slideTo(u.virtual.slidesBefore,0,!1,!0)),u.allowSlidePrev=p,u.allowSlideNext=g,u.emit("loopFix");return}let j=v.slidesPerView;j==="auto"?j=u.slidesPerViewDynamic():(j=Math.ceil(parseFloat(v.slidesPerView,10)),I&&j%2===0&&(j=j+1));const P=v.slidesPerGroupAuto?j:v.slidesPerGroup;let F=I?Math.max(P,Math.ceil(j/2)):P;F%P!==0&&(F+=P-F%P),F+=v.loopAdditionalSlides,u.loopedSlides=F;const R=u.grid&&v.grid&&v.grid.rows>1;f.length<j+F||u.params.effect==="cards"&&f.length<j+F*2?xm("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):R&&v.grid.fill==="row"&&xm("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const C=[],$=[],Q=R?Math.ceil(f.length/v.grid.rows):f.length,q=i&&Q-L<j&&!I;let V=q?L:u.activeIndex;typeof s>"u"?s=u.getSlideIndex(f.find(G=>G.classList.contains(v.slideActiveClass))):V=s;const he=n==="next"||!n,ee=n==="prev"||!n;let me=0,ye=0;const ie=(R?f[s].column:s)+(I&&typeof r>"u"?-j/2+.5:0);if(ie<F){me=Math.max(F-ie,P);for(let G=0;G<F-ie;G+=1){const z=G-Math.floor(G/Q)*Q;if(R){const X=Q-z-1;for(let oe=f.length-1;oe>=0;oe-=1)f[oe].column===X&&C.push(oe)}else C.push(Q-z-1)}}else if(ie+j>Q-F){ye=Math.max(ie-(Q-F*2),P),q&&(ye=Math.max(ye,j-Q+L+1));for(let G=0;G<ye;G+=1){const z=G-Math.floor(G/Q)*Q;R?f.forEach((X,oe)=>{X.column===z&&$.push(oe)}):$.push(z)}}if(u.__preventObserver__=!0,requestAnimationFrame(()=>{u.__preventObserver__=!1}),u.params.effect==="cards"&&f.length<j+F*2&&($.includes(s)&&$.splice($.indexOf(s),1),C.includes(s)&&C.splice(C.indexOf(s),1)),ee&&C.forEach(G=>{f[G].swiperLoopMoveDOM=!0,y.prepend(f[G]),f[G].swiperLoopMoveDOM=!1}),he&&$.forEach(G=>{f[G].swiperLoopMoveDOM=!0,y.append(f[G]),f[G].swiperLoopMoveDOM=!1}),u.recalcSlides(),v.slidesPerView==="auto"?u.updateSlides():R&&(C.length>0&&ee||$.length>0&&he)&&u.slides.forEach((G,z)=>{u.grid.updateSlide(z,G,u.slides)}),v.watchSlidesProgress&&u.updateSlidesOffset(),t){if(C.length>0&&ee){if(typeof e>"u"){const G=u.slidesGrid[V],X=u.slidesGrid[V+me]-G;c?u.setTranslate(u.translate-X):(u.slideTo(V+Math.ceil(me),0,!1,!0),r&&(u.touchEventsData.startTranslate=u.touchEventsData.startTranslate-X,u.touchEventsData.currentTranslate=u.touchEventsData.currentTranslate-X))}else if(r){const G=R?C.length/v.grid.rows:C.length;u.slideTo(u.activeIndex+G,0,!1,!0),u.touchEventsData.currentTranslate=u.translate}}else if($.length>0&&he)if(typeof e>"u"){const G=u.slidesGrid[V],X=u.slidesGrid[V-ye]-G;c?u.setTranslate(u.translate-X):(u.slideTo(V-ye,0,!1,!0),r&&(u.touchEventsData.startTranslate=u.touchEventsData.startTranslate-X,u.touchEventsData.currentTranslate=u.touchEventsData.currentTranslate-X))}else{const G=R?$.length/v.grid.rows:$.length;u.slideTo(u.activeIndex-G,0,!1,!0)}}if(u.allowSlidePrev=p,u.allowSlideNext=g,u.controller&&u.controller.control&&!l){const G={slideRealIndex:e,direction:n,setTranslate:r,activeSlideIndex:s,byController:!0};Array.isArray(u.controller.control)?u.controller.control.forEach(z=>{!z.destroyed&&z.params.loop&&z.loopFix({...G,slideTo:z.params.slidesPerView===v.slidesPerView?t:!1})}):u.controller.control instanceof u.constructor&&u.controller.control.params.loop&&u.controller.control.loopFix({...G,slideTo:u.controller.control.params.slidesPerView===v.slidesPerView?t:!1})}u.emit("loopFix")}function U_(){const e=this,{params:t,slidesEl:n}=e;if(!t.loop||!n||e.virtual&&e.params.virtual.enabled)return;e.recalcSlides();const r=[];e.slides.forEach(s=>{const i=typeof s.swiperSlideIndex>"u"?s.getAttribute("data-swiper-slide-index")*1:s.swiperSlideIndex;r[i]=s}),e.slides.forEach(s=>{s.removeAttribute("data-swiper-slide-index")}),r.forEach(s=>{n.append(s)}),e.recalcSlides(),e.slideTo(e.realIndex,0)}var z_={loopCreate:$_,loopFix:H_,loopDestroy:U_};function G_(e){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const n=t.params.touchEventsTarget==="container"?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),n.style.cursor="move",n.style.cursor=e?"grabbing":"grab",t.isElement&&requestAnimationFrame(()=>{t.__preventObserver__=!1})}function W_(){const e=this;e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.isElement&&(e.__preventObserver__=!0),e[e.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",e.isElement&&requestAnimationFrame(()=>{e.__preventObserver__=!1}))}var V_={setGrabCursor:G_,unsetGrabCursor:W_};function q_(e,t=this){function n(r){if(!r||r===Uu()||r===Qo())return null;r.assignedSlot&&(r=r.assignedSlot);const s=r.closest(e);return!s&&!r.getRootNode?null:s||n(r.getRootNode().host)}return n(t)}function _5(e,t,n){const r=Qo(),{params:s}=e,i=s.edgeSwipeDetection,l=s.edgeSwipeThreshold;return i&&(n<=l||n>=r.innerWidth-l)?i==="prevent"?(t.preventDefault(),!0):!1:!0}function Y_(e){const t=this;if(t.destroyed)return;const n=Uu();let r=e;r.originalEvent&&(r=r.originalEvent);const s=t.touchEventsData;if(r.type==="pointerdown"){if(s.pointerId!==null&&s.pointerId!==r.pointerId)return;s.pointerId=r.pointerId}else r.type==="touchstart"&&r.targetTouches.length===1&&(s.touchId=r.targetTouches[0].identifier);if(r.type==="touchstart"){_5(t,r,r.targetTouches[0].pageX);return}const{params:i,touches:l,enabled:c}=t;if(!c||!i.simulateTouch&&r.pointerType==="mouse"||t.animating&&i.preventInteractionOnTransition)return;!t.animating&&i.cssMode&&i.loop&&t.loopFix();let u=r.target;if(i.touchEventsTarget==="wrapper"&&!n_(u,t.wrapperEl)||"which"in r&&r.which===3||"button"in r&&r.button>0||s.isTouched&&s.isMoved)return;const f=!!i.noSwipingClass&&i.noSwipingClass!=="",p=r.composedPath?r.composedPath():r.path;f&&r.target&&r.target.shadowRoot&&p&&(u=p[0]);const g=i.noSwipingSelector?i.noSwipingSelector:`.${i.noSwipingClass}`,y=!!(r.target&&r.target.shadowRoot);if(i.noSwiping&&(y?q_(g,u):u.closest(g))){t.allowClick=!0;return}if(i.swipeHandler&&!u.closest(i.swipeHandler))return;l.currentX=r.pageX,l.currentY=r.pageY;const v=l.currentX,S=l.currentY;if(!_5(t,r,v))return;Object.assign(s,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),l.startX=v,l.startY=S,s.touchStartTime=gm(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,i.threshold>0&&(s.allowThresholdMove=!1);let A=!0;u.matches(s.focusableElements)&&(A=!1,u.nodeName==="SELECT"&&(s.isTouched=!1)),n.activeElement&&n.activeElement.matches(s.focusableElements)&&n.activeElement!==u&&(r.pointerType==="mouse"||r.pointerType!=="mouse"&&!u.matches(s.focusableElements))&&n.activeElement.blur();const T=A&&t.allowTouchMove&&i.touchStartPreventDefault;(i.touchStartForcePreventDefault||T)&&!u.isContentEditable&&r.preventDefault(),i.freeMode&&i.freeMode.enabled&&t.freeMode&&t.animating&&!i.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",r)}function K_(e){const t=Uu(),n=this;if(n.destroyed)return;const r=n.touchEventsData,{params:s,touches:i,rtlTranslate:l,enabled:c}=n;if(!c||!s.simulateTouch&&e.pointerType==="mouse")return;let u=e;if(u.originalEvent&&(u=u.originalEvent),u.type==="pointermove"&&(r.touchId!==null||u.pointerId!==r.pointerId))return;let f;if(u.type==="touchmove"){if(f=[...u.changedTouches].find(F=>F.identifier===r.touchId),!f||f.identifier!==r.touchId)return}else f=u;if(!r.isTouched){r.startMoving&&r.isScrolling&&n.emit("touchMoveOpposite",u);return}const p=f.pageX,g=f.pageY;if(u.preventedByNestedSwiper){i.startX=p,i.startY=g;return}if(!n.allowTouchMove){u.target.matches(r.focusableElements)||(n.allowClick=!1),r.isTouched&&(Object.assign(i,{startX:p,startY:g,currentX:p,currentY:g}),r.touchStartTime=gm());return}if(s.touchReleaseOnEdges&&!s.loop)if(n.isVertical()){if(g<i.startY&&n.translate<=n.maxTranslate()||g>i.startY&&n.translate>=n.minTranslate()){r.isTouched=!1,r.isMoved=!1;return}}else{if(l&&(p>i.startX&&-n.translate<=n.maxTranslate()||p<i.startX&&-n.translate>=n.minTranslate()))return;if(!l&&(p<i.startX&&n.translate<=n.maxTranslate()||p>i.startX&&n.translate>=n.minTranslate()))return}if(t.activeElement&&t.activeElement.matches(r.focusableElements)&&t.activeElement!==u.target&&u.pointerType!=="mouse"&&t.activeElement.blur(),t.activeElement&&u.target===t.activeElement&&u.target.matches(r.focusableElements)){r.isMoved=!0,n.allowClick=!1;return}r.allowTouchCallbacks&&n.emit("touchMove",u),i.previousX=i.currentX,i.previousY=i.currentY,i.currentX=p,i.currentY=g;const y=i.currentX-i.startX,v=i.currentY-i.startY;if(n.params.threshold&&Math.sqrt(y**2+v**2)<n.params.threshold)return;if(typeof r.isScrolling>"u"){let F;n.isHorizontal()&&i.currentY===i.startY||n.isVertical()&&i.currentX===i.startX?r.isScrolling=!1:y*y+v*v>=25&&(F=Math.atan2(Math.abs(v),Math.abs(y))*180/Math.PI,r.isScrolling=n.isHorizontal()?F>s.touchAngle:90-F>s.touchAngle)}if(r.isScrolling&&n.emit("touchMoveOpposite",u),typeof r.startMoving>"u"&&(i.currentX!==i.startX||i.currentY!==i.startY)&&(r.startMoving=!0),r.isScrolling||u.type==="touchmove"&&r.preventTouchMoveFromPointerMove){r.isTouched=!1;return}if(!r.startMoving)return;n.allowClick=!1,!s.cssMode&&u.cancelable&&u.preventDefault(),s.touchMoveStopPropagation&&!s.nested&&u.stopPropagation();let S=n.isHorizontal()?y:v,A=n.isHorizontal()?i.currentX-i.previousX:i.currentY-i.previousY;s.oneWayMovement&&(S=Math.abs(S)*(l?1:-1),A=Math.abs(A)*(l?1:-1)),i.diff=S,S*=s.touchRatio,l&&(S=-S,A=-A);const T=n.touchesDirection;n.swipeDirection=S>0?"prev":"next",n.touchesDirection=A>0?"prev":"next";const L=n.params.loop&&!s.cssMode,I=n.touchesDirection==="next"&&n.allowSlideNext||n.touchesDirection==="prev"&&n.allowSlidePrev;if(!r.isMoved){if(L&&I&&n.loopFix({direction:n.swipeDirection}),r.startTranslate=n.getTranslate(),n.setTransition(0),n.animating){const F=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});n.wrapperEl.dispatchEvent(F)}r.allowMomentumBounce=!1,s.grabCursor&&(n.allowSlideNext===!0||n.allowSlidePrev===!0)&&n.setGrabCursor(!0),n.emit("sliderFirstMove",u)}if(new Date().getTime(),s._loopSwapReset!==!1&&r.isMoved&&r.allowThresholdMove&&T!==n.touchesDirection&&L&&I&&Math.abs(S)>=1){Object.assign(i,{startX:p,startY:g,currentX:p,currentY:g,startTranslate:r.currentTranslate}),r.loopSwapReset=!0,r.startTranslate=r.currentTranslate;return}n.emit("sliderMove",u),r.isMoved=!0,r.currentTranslate=S+r.startTranslate;let j=!0,P=s.resistanceRatio;if(s.touchReleaseOnEdges&&(P=0),S>0?(L&&I&&r.allowThresholdMove&&r.currentTranslate>(s.centeredSlides?n.minTranslate()-n.slidesSizesGrid[n.activeIndex+1]-(s.slidesPerView!=="auto"&&n.slides.length-s.slidesPerView>=2?n.slidesSizesGrid[n.activeIndex+1]+n.params.spaceBetween:0)-n.params.spaceBetween:n.minTranslate())&&n.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),r.currentTranslate>n.minTranslate()&&(j=!1,s.resistance&&(r.currentTranslate=n.minTranslate()-1+(-n.minTranslate()+r.startTranslate+S)**P))):S<0&&(L&&I&&r.allowThresholdMove&&r.currentTranslate<(s.centeredSlides?n.maxTranslate()+n.slidesSizesGrid[n.slidesSizesGrid.length-1]+n.params.spaceBetween+(s.slidesPerView!=="auto"&&n.slides.length-s.slidesPerView>=2?n.slidesSizesGrid[n.slidesSizesGrid.length-1]+n.params.spaceBetween:0):n.maxTranslate())&&n.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:n.slides.length-(s.slidesPerView==="auto"?n.slidesPerViewDynamic():Math.ceil(parseFloat(s.slidesPerView,10)))}),r.currentTranslate<n.maxTranslate()&&(j=!1,s.resistance&&(r.currentTranslate=n.maxTranslate()+1-(n.maxTranslate()-r.startTranslate-S)**P))),j&&(u.preventedByNestedSwiper=!0),!n.allowSlideNext&&n.swipeDirection==="next"&&r.currentTranslate<r.startTranslate&&(r.currentTranslate=r.startTranslate),!n.allowSlidePrev&&n.swipeDirection==="prev"&&r.currentTranslate>r.startTranslate&&(r.currentTranslate=r.startTranslate),!n.allowSlidePrev&&!n.allowSlideNext&&(r.currentTranslate=r.startTranslate),s.threshold>0)if(Math.abs(S)>s.threshold||r.allowThresholdMove){if(!r.allowThresholdMove){r.allowThresholdMove=!0,i.startX=i.currentX,i.startY=i.currentY,r.currentTranslate=r.startTranslate,i.diff=n.isHorizontal()?i.currentX-i.startX:i.currentY-i.startY;return}}else{r.currentTranslate=r.startTranslate;return}!s.followFinger||s.cssMode||((s.freeMode&&s.freeMode.enabled&&n.freeMode||s.watchSlidesProgress)&&(n.updateActiveIndex(),n.updateSlidesClasses()),s.freeMode&&s.freeMode.enabled&&n.freeMode&&n.freeMode.onTouchMove(),n.updateProgress(r.currentTranslate),n.setTranslate(r.currentTranslate))}function X_(e){const t=this;if(t.destroyed)return;const n=t.touchEventsData;let r=e;r.originalEvent&&(r=r.originalEvent);let s;if(r.type==="touchend"||r.type==="touchcancel"){if(s=[...r.changedTouches].find(F=>F.identifier===n.touchId),!s||s.identifier!==n.touchId)return}else{if(n.touchId!==null||r.pointerId!==n.pointerId)return;s=r}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(r.type)&&!(["pointercancel","contextmenu"].includes(r.type)&&(t.browser.isSafari||t.browser.isWebView)))return;n.pointerId=null,n.touchId=null;const{params:l,touches:c,rtlTranslate:u,slidesGrid:f,enabled:p}=t;if(!p||!l.simulateTouch&&r.pointerType==="mouse")return;if(n.allowTouchCallbacks&&t.emit("touchEnd",r),n.allowTouchCallbacks=!1,!n.isTouched){n.isMoved&&l.grabCursor&&t.setGrabCursor(!1),n.isMoved=!1,n.startMoving=!1;return}l.grabCursor&&n.isMoved&&n.isTouched&&(t.allowSlideNext===!0||t.allowSlidePrev===!0)&&t.setGrabCursor(!1);const g=gm(),y=g-n.touchStartTime;if(t.allowClick){const F=r.path||r.composedPath&&r.composedPath();t.updateClickedSlide(F&&F[0]||r.target,F),t.emit("tap click",r),y<300&&g-n.lastClickTime<300&&t.emit("doubleTap doubleClick",r)}if(n.lastClickTime=gm(),g7(()=>{t.destroyed||(t.allowClick=!0)}),!n.isTouched||!n.isMoved||!t.swipeDirection||c.diff===0&&!n.loopSwapReset||n.currentTranslate===n.startTranslate&&!n.loopSwapReset){n.isTouched=!1,n.isMoved=!1,n.startMoving=!1;return}n.isTouched=!1,n.isMoved=!1,n.startMoving=!1;let v;if(l.followFinger?v=u?t.translate:-t.translate:v=-n.currentTranslate,l.cssMode)return;if(l.freeMode&&l.freeMode.enabled){t.freeMode.onTouchEnd({currentPos:v});return}const S=v>=-t.maxTranslate()&&!t.params.loop;let A=0,T=t.slidesSizesGrid[0];for(let F=0;F<f.length;F+=F<l.slidesPerGroupSkip?1:l.slidesPerGroup){const R=F<l.slidesPerGroupSkip-1?1:l.slidesPerGroup;typeof f[F+R]<"u"?(S||v>=f[F]&&v<f[F+R])&&(A=F,T=f[F+R]-f[F]):(S||v>=f[F])&&(A=F,T=f[f.length-1]-f[f.length-2])}let L=null,I=null;l.rewind&&(t.isBeginning?I=l.virtual&&l.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(L=0));const j=(v-f[A])/T,P=A<l.slidesPerGroupSkip-1?1:l.slidesPerGroup;if(y>l.longSwipesMs){if(!l.longSwipes){t.slideTo(t.activeIndex);return}t.swipeDirection==="next"&&(j>=l.longSwipesRatio?t.slideTo(l.rewind&&t.isEnd?L:A+P):t.slideTo(A)),t.swipeDirection==="prev"&&(j>1-l.longSwipesRatio?t.slideTo(A+P):I!==null&&j<0&&Math.abs(j)>l.longSwipesRatio?t.slideTo(I):t.slideTo(A))}else{if(!l.shortSwipes){t.slideTo(t.activeIndex);return}t.navigation&&(r.target===t.navigation.nextEl||r.target===t.navigation.prevEl)?r.target===t.navigation.nextEl?t.slideTo(A+P):t.slideTo(A):(t.swipeDirection==="next"&&t.slideTo(L!==null?L:A+P),t.swipeDirection==="prev"&&t.slideTo(I!==null?I:A))}}function L5(){const e=this,{params:t,el:n}=e;if(n&&n.offsetWidth===0)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:r,allowSlidePrev:s,snapGrid:i}=e,l=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const c=l&&t.loop;if((t.slidesPerView==="auto"||t.slidesPerView>1)&&e.isEnd&&!e.isBeginning&&!e.params.centeredSlides&&!c){const u=l?e.virtual.slides:e.slides;e.slideTo(u.length-1,0,!1,!0)}else e.params.loop&&!l?e.slideToLoop(e.realIndex,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0);e.autoplay&&e.autoplay.running&&e.autoplay.paused&&(clearTimeout(e.autoplay.resizeTimeout),e.autoplay.resizeTimeout=setTimeout(()=>{e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.resume()},500)),e.allowSlidePrev=s,e.allowSlideNext=r,e.params.watchOverflow&&i!==e.snapGrid&&e.checkOverflow()}function Z_(e){const t=this;t.destroyed||t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function J_(){const e=this;if(e.destroyed)return;const{wrapperEl:t,rtlTranslate:n,enabled:r}=e;if(!r)return;e.previousTranslate=e.translate,e.isHorizontal()?e.translate=-t.scrollLeft:e.translate=-t.scrollTop,e.translate===0&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();let s;const i=e.maxTranslate()-e.minTranslate();i===0?s=0:s=(e.translate-e.minTranslate())/i,s!==e.progress&&e.updateProgress(n?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}function eL(e){const t=this;t.destroyed||(Wp(t,e.target),!(t.params.cssMode||t.params.slidesPerView!=="auto"&&!t.params.autoHeight)&&t.update())}function tL(){const e=this;e.destroyed||e.documentTouchHandlerProceeded||(e.documentTouchHandlerProceeded=!0,e.params.touchReleaseOnEdges&&(e.el.style.touchAction="auto"))}const S7=(e,t)=>{const n=Uu(),{params:r,el:s,wrapperEl:i,device:l}=e,c=!!r.nested,u=t==="on"?"addEventListener":"removeEventListener",f=t;!s||typeof s=="string"||(n[u]("touchstart",e.onDocumentTouchStart,{passive:!1,capture:c}),s[u]("touchstart",e.onTouchStart,{passive:!1}),s[u]("pointerdown",e.onTouchStart,{passive:!1}),n[u]("touchmove",e.onTouchMove,{passive:!1,capture:c}),n[u]("pointermove",e.onTouchMove,{passive:!1,capture:c}),n[u]("touchend",e.onTouchEnd,{passive:!0}),n[u]("pointerup",e.onTouchEnd,{passive:!0}),n[u]("pointercancel",e.onTouchEnd,{passive:!0}),n[u]("touchcancel",e.onTouchEnd,{passive:!0}),n[u]("pointerout",e.onTouchEnd,{passive:!0}),n[u]("pointerleave",e.onTouchEnd,{passive:!0}),n[u]("contextmenu",e.onTouchEnd,{passive:!0}),(r.preventClicks||r.preventClicksPropagation)&&s[u]("click",e.onClick,!0),r.cssMode&&i[u]("scroll",e.onScroll),r.updateOnWindowResize?e[f](l.ios||l.android?"resize orientationchange observerUpdate":"resize observerUpdate",L5,!0):e[f]("observerUpdate",L5,!0),s[u]("load",e.onLoad,{capture:!0}))};function nL(){const e=this,{params:t}=e;e.onTouchStart=Y_.bind(e),e.onTouchMove=K_.bind(e),e.onTouchEnd=X_.bind(e),e.onDocumentTouchStart=tL.bind(e),t.cssMode&&(e.onScroll=J_.bind(e)),e.onClick=Z_.bind(e),e.onLoad=eL.bind(e),S7(e,"on")}function rL(){S7(this,"off")}var sL={attachEvents:nL,detachEvents:rL};const E5=(e,t)=>e.grid&&t.grid&&t.grid.rows>1;function iL(){const e=this,{realIndex:t,initialized:n,params:r,el:s}=e,i=r.breakpoints;if(!i||i&&Object.keys(i).length===0)return;const l=Uu(),c=r.breakpointsBase==="window"||!r.breakpointsBase?r.breakpointsBase:"container",u=["window","container"].includes(r.breakpointsBase)||!r.breakpointsBase?e.el:l.querySelector(r.breakpointsBase),f=e.getBreakpoint(i,c,u);if(!f||e.currentBreakpoint===f)return;const g=(f in i?i[f]:void 0)||e.originalParams,y=E5(e,r),v=E5(e,g),S=e.params.grabCursor,A=g.grabCursor,T=r.enabled;y&&!v?(s.classList.remove(`${r.containerModifierClass}grid`,`${r.containerModifierClass}grid-column`),e.emitContainerClasses()):!y&&v&&(s.classList.add(`${r.containerModifierClass}grid`),(g.grid.fill&&g.grid.fill==="column"||!g.grid.fill&&r.grid.fill==="column")&&s.classList.add(`${r.containerModifierClass}grid-column`),e.emitContainerClasses()),S&&!A?e.unsetGrabCursor():!S&&A&&e.setGrabCursor(),["navigation","pagination","scrollbar"].forEach(R=>{if(typeof g[R]>"u")return;const C=r[R]&&r[R].enabled,$=g[R]&&g[R].enabled;C&&!$&&e[R].disable(),!C&&$&&e[R].enable()});const L=g.direction&&g.direction!==r.direction,I=r.loop&&(g.slidesPerView!==r.slidesPerView||L),j=r.loop;L&&n&&e.changeDirection(),xa(e.params,g);const P=e.params.enabled,F=e.params.loop;Object.assign(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),T&&!P?e.disable():!T&&P&&e.enable(),e.currentBreakpoint=f,e.emit("_beforeBreakpoint",g),n&&(I?(e.loopDestroy(),e.loopCreate(t),e.updateSlides()):!j&&F?(e.loopCreate(t),e.updateSlides()):j&&!F&&e.loopDestroy()),e.emit("breakpoint",g)}function oL(e,t="window",n){if(!e||t==="container"&&!n)return;let r=!1;const s=Qo(),i=t==="window"?s.innerHeight:n.clientHeight,l=Object.keys(e).map(c=>{if(typeof c=="string"&&c.indexOf("@")===0){const u=parseFloat(c.substr(1));return{value:i*u,point:c}}return{value:c,point:c}});l.sort((c,u)=>parseInt(c.value,10)-parseInt(u.value,10));for(let c=0;c<l.length;c+=1){const{point:u,value:f}=l[c];t==="window"?s.matchMedia(`(min-width: ${f}px)`).matches&&(r=u):f<=n.clientWidth&&(r=u)}return r||"max"}var aL={setBreakpoint:iL,getBreakpoint:oL};function lL(e,t){const n=[];return e.forEach(r=>{typeof r=="object"?Object.keys(r).forEach(s=>{r[s]&&n.push(t+s)}):typeof r=="string"&&n.push(t+r)}),n}function cL(){const e=this,{classNames:t,params:n,rtl:r,el:s,device:i}=e,l=lL(["initialized",n.direction,{"free-mode":e.params.freeMode&&n.freeMode.enabled},{autoheight:n.autoHeight},{rtl:r},{grid:n.grid&&n.grid.rows>1},{"grid-column":n.grid&&n.grid.rows>1&&n.grid.fill==="column"},{android:i.android},{ios:i.ios},{"css-mode":n.cssMode},{centered:n.cssMode&&n.centeredSlides},{"watch-progress":n.watchSlidesProgress}],n.containerModifierClass);t.push(...l),s.classList.add(...t),e.emitContainerClasses()}function uL(){const e=this,{el:t,classNames:n}=e;!t||typeof t=="string"||(t.classList.remove(...n),e.emitContainerClasses())}var dL={addClasses:cL,removeClasses:uL};function fL(){const e=this,{isLocked:t,params:n}=e,{slidesOffsetBefore:r}=n;if(r){const s=e.slides.length-1,i=e.slidesGrid[s]+e.slidesSizesGrid[s]+r*2;e.isLocked=e.size>i}else e.isLocked=e.snapGrid.length===1;n.allowSlideNext===!0&&(e.allowSlideNext=!e.isLocked),n.allowSlidePrev===!0&&(e.allowSlidePrev=!e.isLocked),t&&t!==e.isLocked&&(e.isEnd=!1),t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock")}var hL={checkOverflow:fL},ob={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,snapToSlideEdge:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function pL(e,t){return function(r={}){const s=Object.keys(r)[0],i=r[s];if(typeof i!="object"||i===null){xa(t,r);return}if(e[s]===!0&&(e[s]={enabled:!0}),s==="navigation"&&e[s]&&e[s].enabled&&!e[s].prevEl&&!e[s].nextEl&&(e[s].auto=!0),["pagination","scrollbar"].indexOf(s)>=0&&e[s]&&e[s].enabled&&!e[s].el&&(e[s].auto=!0),!(s in e&&"enabled"in i)){xa(t,r);return}typeof e[s]=="object"&&!("enabled"in e[s])&&(e[s].enabled=!0),e[s]||(e[s]={enabled:!1}),xa(t,r)}}const b1={eventsEmitter:d_,update:S_,translate:L_,transition:N_,slide:Q_,loop:z_,grabCursor:V_,events:sL,breakpoints:aL,checkOverflow:hL,classes:dL},y1={};let F2=class uc{constructor(...t){let n,r;t.length===1&&t[0].constructor&&Object.prototype.toString.call(t[0]).slice(8,-1)==="Object"?r=t[0]:[n,r]=t,r||(r={}),r=xa({},r),n&&!r.el&&(r.el=n);const s=Uu();if(r.el&&typeof r.el=="string"&&s.querySelectorAll(r.el).length>1){const u=[];return s.querySelectorAll(r.el).forEach(f=>{const p=xa({},r,{el:f});u.push(new uc(p))}),u}const i=this;i.__swiper__=!0,i.support=b7(),i.device=y7({userAgent:r.userAgent}),i.browser=v7(),i.eventsListeners={},i.eventsAnyListeners=[],i.modules=[...i.__modules__],r.modules&&Array.isArray(r.modules)&&r.modules.forEach(u=>{typeof u=="function"&&i.modules.indexOf(u)<0&&i.modules.push(u)});const l={};i.modules.forEach(u=>{u({params:r,swiper:i,extendParams:pL(r,l),on:i.on.bind(i),once:i.once.bind(i),off:i.off.bind(i),emit:i.emit.bind(i)})});const c=xa({},ob,l);return i.params=xa({},c,y1,r),i.originalParams=xa({},i.params),i.passedParams=xa({},r),i.params&&i.params.on&&Object.keys(i.params.on).forEach(u=>{i.on(u,i.params.on[u])}),i.params&&i.params.onAny&&i.onAny(i.params.onAny),Object.assign(i,{enabled:i.params.enabled,el:n,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return i.params.direction==="horizontal"},isVertical(){return i.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:i.params.allowSlideNext,allowSlidePrev:i.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:i.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:i.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),i.emit("_swiper"),i.params.init&&i.init(),i}getDirectionLabel(t){return this.isHorizontal()?t:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[t]}getSlideIndex(t){const{slidesEl:n,params:r}=this,s=hc(n,`.${r.slideClass}, swiper-slide`),i=A5(s[0]);return A5(t)-i}getSlideIndexByData(t){return this.getSlideIndex(this.slides.find(n=>n.getAttribute("data-swiper-slide-index")*1===t))}getSlideIndexWhenGrid(t){return this.grid&&this.params.grid&&this.params.grid.rows>1&&(this.params.grid.fill==="column"?t=Math.floor(t/this.params.grid.rows):this.params.grid.fill==="row"&&(t=t%Math.ceil(this.slides.length/this.params.grid.rows))),t}recalcSlides(){const t=this,{slidesEl:n,params:r}=t;t.slides=hc(n,`.${r.slideClass}, swiper-slide`)}enable(){const t=this;t.enabled||(t.enabled=!0,t.params.grabCursor&&t.setGrabCursor(),t.emit("enable"))}disable(){const t=this;t.enabled&&(t.enabled=!1,t.params.grabCursor&&t.unsetGrabCursor(),t.emit("disable"))}setProgress(t,n){const r=this;t=Math.min(Math.max(t,0),1);const s=r.minTranslate(),l=(r.maxTranslate()-s)*t+s;r.translateTo(l,typeof n>"u"?0:n),r.updateActiveIndex(),r.updateSlidesClasses()}emitContainerClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const n=t.el.className.split(" ").filter(r=>r.indexOf("swiper")===0||r.indexOf(t.params.containerModifierClass)===0);t.emit("_containerClasses",n.join(" "))}getSlideClasses(t){const n=this;return n.destroyed?"":t.className.split(" ").filter(r=>r.indexOf("swiper-slide")===0||r.indexOf(n.params.slideClass)===0).join(" ")}emitSlidesClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const n=[];t.slides.forEach(r=>{const s=t.getSlideClasses(r);n.push({slideEl:r,classNames:s}),t.emit("_slideClass",r,s)}),t.emit("_slideClasses",n)}slidesPerViewDynamic(t="current",n=!1){const r=this,{params:s,slides:i,slidesGrid:l,slidesSizesGrid:c,size:u,activeIndex:f}=r;let p=1;if(typeof s.slidesPerView=="number")return s.slidesPerView;if(s.centeredSlides){let g=i[f]?Math.ceil(i[f].swiperSlideSize):0,y;for(let v=f+1;v<i.length;v+=1)i[v]&&!y&&(g+=Math.ceil(i[v].swiperSlideSize),p+=1,g>u&&(y=!0));for(let v=f-1;v>=0;v-=1)i[v]&&!y&&(g+=i[v].swiperSlideSize,p+=1,g>u&&(y=!0))}else if(t==="current")for(let g=f+1;g<i.length;g+=1)(n?l[g]+c[g]-l[f]<u:l[g]-l[f]<u)&&(p+=1);else for(let g=f-1;g>=0;g-=1)l[f]-l[g]<u&&(p+=1);return p}update(){const t=this;if(!t||t.destroyed)return;const{snapGrid:n,params:r}=t;r.breakpoints&&t.setBreakpoint(),[...t.el.querySelectorAll('[loading="lazy"]')].forEach(l=>{l.complete&&Wp(t,l)}),t.updateSize(),t.updateSlides(),t.updateProgress(),t.updateSlidesClasses();function s(){const l=t.rtlTranslate?t.translate*-1:t.translate,c=Math.min(Math.max(l,t.maxTranslate()),t.minTranslate());t.setTranslate(c),t.updateActiveIndex(),t.updateSlidesClasses()}let i;if(r.freeMode&&r.freeMode.enabled&&!r.cssMode)s(),r.autoHeight&&t.updateAutoHeight();else{if((r.slidesPerView==="auto"||r.slidesPerView>1)&&t.isEnd&&!r.centeredSlides){const l=t.virtual&&r.virtual.enabled?t.virtual.slides:t.slides;i=t.slideTo(l.length-1,0,!1,!0)}else i=t.slideTo(t.activeIndex,0,!1,!0);i||s()}r.watchOverflow&&n!==t.snapGrid&&t.checkOverflow(),t.emit("update")}changeDirection(t,n=!0){const r=this,s=r.params.direction;return t||(t=s==="horizontal"?"vertical":"horizontal"),t===s||t!=="horizontal"&&t!=="vertical"||(r.el.classList.remove(`${r.params.containerModifierClass}${s}`),r.el.classList.add(`${r.params.containerModifierClass}${t}`),r.emitContainerClasses(),r.params.direction=t,r.slides.forEach(i=>{t==="vertical"?i.style.width="":i.style.height=""}),r.emit("changeDirection"),n&&r.update()),r}changeLanguageDirection(t){const n=this;n.rtl&&t==="rtl"||!n.rtl&&t==="ltr"||(n.rtl=t==="rtl",n.rtlTranslate=n.params.direction==="horizontal"&&n.rtl,n.rtl?(n.el.classList.add(`${n.params.containerModifierClass}rtl`),n.el.dir="rtl"):(n.el.classList.remove(`${n.params.containerModifierClass}rtl`),n.el.dir="ltr"),n.update())}mount(t){const n=this;if(n.mounted)return!0;let r=t||n.params.el;if(typeof r=="string"&&(r=document.querySelector(r)),!r)return!1;r.swiper=n,r.parentNode&&r.parentNode.host&&r.parentNode.host.nodeName===n.params.swiperElementNodeName.toUpperCase()&&(n.isElement=!0);const s=()=>`.${(n.params.wrapperClass||"").trim().split(" ").join(".")}`;let l=r&&r.shadowRoot&&r.shadowRoot.querySelector?r.shadowRoot.querySelector(s()):hc(r,s())[0];return!l&&n.params.createElements&&(l=sb("div",n.params.wrapperClass),r.append(l),hc(r,`.${n.params.slideClass}`).forEach(c=>{l.append(c)})),Object.assign(n,{el:r,wrapperEl:l,slidesEl:n.isElement&&!r.parentNode.host.slideSlots?r.parentNode.host:l,hostEl:n.isElement?r.parentNode.host:r,mounted:!0,rtl:r.dir.toLowerCase()==="rtl"||Uc(r,"direction")==="rtl",rtlTranslate:n.params.direction==="horizontal"&&(r.dir.toLowerCase()==="rtl"||Uc(r,"direction")==="rtl"),wrongRTL:Uc(l,"display")==="-webkit-box"}),!0}init(t){const n=this;if(n.initialized||n.mount(t)===!1)return n;n.emit("beforeInit"),n.params.breakpoints&&n.setBreakpoint(),n.addClasses(),n.updateSize(),n.updateSlides(),n.params.watchOverflow&&n.checkOverflow(),n.params.grabCursor&&n.enabled&&n.setGrabCursor(),n.params.loop&&n.virtual&&n.params.virtual.enabled?n.slideTo(n.params.initialSlide+n.virtual.slidesBefore,0,n.params.runCallbacksOnInit,!1,!0):n.slideTo(n.params.initialSlide,0,n.params.runCallbacksOnInit,!1,!0),n.params.loop&&n.loopCreate(void 0,!0),n.attachEvents();const s=[...n.el.querySelectorAll('[loading="lazy"]')];return n.isElement&&s.push(...n.hostEl.querySelectorAll('[loading="lazy"]')),s.forEach(i=>{i.complete?Wp(n,i):i.addEventListener("load",l=>{Wp(n,l.target)})}),ib(n),n.initialized=!0,ib(n),n.emit("init"),n.emit("afterInit"),n}destroy(t=!0,n=!0){const r=this,{params:s,el:i,wrapperEl:l,slides:c}=r;return typeof r.params>"u"||r.destroyed||(r.emit("beforeDestroy"),r.initialized=!1,r.detachEvents(),s.loop&&r.loopDestroy(),n&&(r.removeClasses(),i&&typeof i!="string"&&i.removeAttribute("style"),l&&l.removeAttribute("style"),c&&c.length&&c.forEach(u=>{u.classList.remove(s.slideVisibleClass,s.slideFullyVisibleClass,s.slideActiveClass,s.slideNextClass,s.slidePrevClass),u.removeAttribute("style"),u.removeAttribute("data-swiper-slide-index")})),r.emit("destroy"),Object.keys(r.eventsListeners).forEach(u=>{r.off(u)}),t!==!1&&(r.el&&typeof r.el!="string"&&(r.el.swiper=null),Xk(r)),r.destroyed=!0),null}static extendDefaults(t){xa(y1,t)}static get extendedDefaults(){return y1}static get defaults(){return ob}static installModule(t){uc.prototype.__modules__||(uc.prototype.__modules__=[]);const n=uc.prototype.__modules__;typeof t=="function"&&n.indexOf(t)<0&&n.push(t)}static use(t){return Array.isArray(t)?(t.forEach(n=>uc.installModule(n)),uc):(uc.installModule(t),uc)}};Object.keys(b1).forEach(e=>{Object.keys(b1[e]).forEach(t=>{F2.prototype[t]=b1[e][t]})});F2.use([c_,u_]);const A7=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","swiperElementNodeName","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_snapToSlideEdge","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopAdditionalSlides","loopAddBlankSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideFullyVisibleClass","slideNextClass","slidePrevClass","slideBlankClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function Fu(e){return typeof e=="object"&&e!==null&&e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"&&!e.__swiper__}function $d(e,t){const n=["__proto__","constructor","prototype"];Object.keys(t).filter(r=>n.indexOf(r)<0).forEach(r=>{typeof e[r]>"u"?e[r]=t[r]:Fu(t[r])&&Fu(e[r])&&Object.keys(t[r]).length>0?t[r].__swiper__?e[r]=t[r]:$d(e[r],t[r]):e[r]=t[r]})}function T7(e={}){return e.navigation&&typeof e.navigation.nextEl>"u"&&typeof e.navigation.prevEl>"u"}function C7(e={}){return e.pagination&&typeof e.pagination.el>"u"}function k7(e={}){return e.scrollbar&&typeof e.scrollbar.el>"u"}function _7(e=""){const t=e.split(" ").map(r=>r.trim()).filter(r=>!!r),n=[];return t.forEach(r=>{n.indexOf(r)<0&&n.push(r)}),n.join(" ")}function mL(e=""){return e?e.includes("swiper-wrapper")?e:`swiper-wrapper ${e}`:"swiper-wrapper"}function gL({swiper:e,slides:t,passedParams:n,changedParams:r,nextEl:s,prevEl:i,scrollbarEl:l,paginationEl:c}){const u=r.filter($=>$!=="children"&&$!=="direction"&&$!=="wrapperClass"),{params:f,pagination:p,navigation:g,scrollbar:y,virtual:v,thumbs:S}=e;let A,T,L,I,j,P,F,R;r.includes("thumbs")&&n.thumbs&&n.thumbs.swiper&&!n.thumbs.swiper.destroyed&&f.thumbs&&(!f.thumbs.swiper||f.thumbs.swiper.destroyed)&&(A=!0),r.includes("controller")&&n.controller&&n.controller.control&&f.controller&&!f.controller.control&&(T=!0),r.includes("pagination")&&n.pagination&&(n.pagination.el||c)&&(f.pagination||f.pagination===!1)&&p&&!p.el&&(L=!0),r.includes("scrollbar")&&n.scrollbar&&(n.scrollbar.el||l)&&(f.scrollbar||f.scrollbar===!1)&&y&&!y.el&&(I=!0),r.includes("navigation")&&n.navigation&&(n.navigation.prevEl||i)&&(n.navigation.nextEl||s)&&(f.navigation||f.navigation===!1)&&g&&!g.prevEl&&!g.nextEl&&(j=!0);const C=$=>{e[$]&&(e[$].destroy(),$==="navigation"?(e.isElement&&(e[$].prevEl.remove(),e[$].nextEl.remove()),f[$].prevEl=void 0,f[$].nextEl=void 0,e[$].prevEl=void 0,e[$].nextEl=void 0):(e.isElement&&e[$].el.remove(),f[$].el=void 0,e[$].el=void 0))};r.includes("loop")&&e.isElement&&(f.loop&&!n.loop?P=!0:!f.loop&&n.loop?F=!0:R=!0),u.forEach($=>{if(Fu(f[$])&&Fu(n[$]))Object.assign(f[$],n[$]),($==="navigation"||$==="pagination"||$==="scrollbar")&&"enabled"in n[$]&&!n[$].enabled&&C($);else{const Q=n[$];(Q===!0||Q===!1)&&($==="navigation"||$==="pagination"||$==="scrollbar")?Q===!1&&C($):f[$]=n[$]}}),u.includes("controller")&&!T&&e.controller&&e.controller.control&&f.controller&&f.controller.control&&(e.controller.control=f.controller.control),r.includes("children")&&t&&v&&f.virtual.enabled?(v.slides=t,v.update(!0)):r.includes("virtual")&&v&&f.virtual.enabled&&(t&&(v.slides=t),v.update(!0)),r.includes("children")&&t&&f.loop&&(R=!0),A&&S.init()&&S.update(!0),T&&(e.controller.control=f.controller.control),L&&(e.isElement&&(!c||typeof c=="string")&&(c=document.createElement("div"),c.classList.add("swiper-pagination"),c.part.add("pagination"),e.el.appendChild(c)),c&&(f.pagination.el=c),p.init(),p.render(),p.update()),I&&(e.isElement&&(!l||typeof l=="string")&&(l=document.createElement("div"),l.classList.add("swiper-scrollbar"),l.part.add("scrollbar"),e.el.appendChild(l)),l&&(f.scrollbar.el=l),y.init(),y.updateSize(),y.setTranslate()),j&&(e.isElement&&((!s||typeof s=="string")&&(s=document.createElement("div"),s.classList.add("swiper-button-next"),C5(s,e.navigation.arrowSvg),s.part.add("button-next"),e.el.appendChild(s)),(!i||typeof i=="string")&&(i=document.createElement("div"),i.classList.add("swiper-button-prev"),C5(i,e.navigation.arrowSvg),i.part.add("button-prev"),e.el.appendChild(i))),s&&(f.navigation.nextEl=s),i&&(f.navigation.prevEl=i),g.init(),g.update()),r.includes("allowSlideNext")&&(e.allowSlideNext=n.allowSlideNext),r.includes("allowSlidePrev")&&(e.allowSlidePrev=n.allowSlidePrev),r.includes("direction")&&e.changeDirection(n.direction,!1),(P||R)&&e.loopDestroy(),(F||R)&&e.loopCreate(),e.update()}function xL(e={},t=!0){const n={on:{}},r={},s={};$d(n,ob),n._emitClasses=!0,n.init=!1;const i={},l=A7.map(u=>u.replace(/_/,"")),c=Object.assign({},e);return Object.keys(c).forEach(u=>{typeof e[u]>"u"||(l.indexOf(u)>=0?Fu(e[u])?(n[u]={},s[u]={},$d(n[u],e[u]),$d(s[u],e[u])):(n[u]=e[u],s[u]=e[u]):u.search(/on[A-Z]/)===0&&typeof e[u]=="function"?t?r[`${u[2].toLowerCase()}${u.substr(3)}`]=e[u]:n.on[`${u[2].toLowerCase()}${u.substr(3)}`]=e[u]:i[u]=e[u])}),["navigation","pagination","scrollbar"].forEach(u=>{n[u]===!0&&(n[u]={}),n[u]===!1&&delete n[u]}),{params:n,passedParams:s,rest:i,events:r}}function bL({el:e,nextEl:t,prevEl:n,paginationEl:r,scrollbarEl:s,swiper:i},l){T7(l)&&t&&n&&(i.params.navigation.nextEl=t,i.originalParams.navigation.nextEl=t,i.params.navigation.prevEl=n,i.originalParams.navigation.prevEl=n),C7(l)&&r&&(i.params.pagination.el=r,i.originalParams.pagination.el=r),k7(l)&&s&&(i.params.scrollbar.el=s,i.originalParams.scrollbar.el=s),i.init(e)}function yL(e,t,n,r,s){const i=[];if(!t)return i;const l=u=>{i.indexOf(u)<0&&i.push(u)};if(n&&r){const u=r.map(s),f=n.map(s);u.join("")!==f.join("")&&l("children"),r.length!==n.length&&l("children")}return A7.filter(u=>u[0]==="_").map(u=>u.replace(/_/,"")).forEach(u=>{if(u in e&&u in t)if(Fu(e[u])&&Fu(t[u])){const f=Object.keys(e[u]),p=Object.keys(t[u]);f.length!==p.length?l(u):(f.forEach(g=>{e[u][g]!==t[u][g]&&l(u)}),p.forEach(g=>{e[u][g]!==t[u][g]&&l(u)}))}else e[u]!==t[u]&&l(u)}),i}const vL=e=>{!e||e.destroyed||!e.params.virtual||e.params.virtual&&!e.params.virtual.enabled||(e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.emit("_virtualUpdated"),e.parallax&&e.params.parallax&&e.params.parallax.enabled&&e.parallax.setTranslate())};function bm(){return bm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bm.apply(this,arguments)}function L7(e){return e.type&&e.type.displayName&&e.type.displayName.includes("SwiperSlide")}function E7(e){const t=[];return D.Children.toArray(e).forEach(n=>{L7(n)?t.push(n):n.props&&n.props.children&&E7(n.props.children).forEach(r=>t.push(r))}),t}function wL(e){const t=[],n={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return D.Children.toArray(e).forEach(r=>{if(L7(r))t.push(r);else if(r.props&&r.props.slot&&n[r.props.slot])n[r.props.slot].push(r);else if(r.props&&r.props.children){const s=E7(r.props.children);s.length>0?s.forEach(i=>t.push(i)):n["container-end"].push(r)}else n["container-end"].push(r)}),{slides:t,slots:n}}function SL(e,t,n){if(!n)return null;const r=p=>{let g=p;return p<0?g=t.length+p:g>=t.length&&(g=g-t.length),g},s=e.isHorizontal()?{[e.rtlTranslate?"right":"left"]:`${n.offset}px`}:{top:`${n.offset}px`},{from:i,to:l}=n,c=e.params.loop?-t.length:0,u=e.params.loop?t.length*2:t.length,f=[];for(let p=c;p<u;p+=1)p>=i&&p<=l&&f.push(t[r(p)]);return f.map((p,g)=>D.cloneElement(p,{swiper:e,style:s,key:p.props.virtualIndex||p.key||`slide-${g}`}))}function Tf(e,t){return typeof window>"u"?b.useEffect(e,t):b.useLayoutEffect(e,t)}const I5=b.createContext(null),AL=b.createContext(null),rh=b.forwardRef(({className:e,tag:t="div",wrapperTag:n="div",children:r,onSwiper:s,...i}={},l)=>{let c=!1;const[u,f]=b.useState("swiper"),[p,g]=b.useState(null),[y,v]=b.useState(!1),S=b.useRef(!1),A=b.useRef(null),T=b.useRef(null),L=b.useRef(null),I=b.useRef(null),j=b.useRef(null),P=b.useRef(null),F=b.useRef(null),R=b.useRef(null),{params:C,passedParams:$,rest:Q,events:q}=xL(i),{slides:V,slots:he}=wL(r),ee=()=>{v(!y)};Object.assign(C.on,{_containerClasses(G,z){f(z)}});const me=()=>{Object.assign(C.on,q),c=!0;const G={...C};if(delete G.wrapperClass,T.current=new F2(G),T.current.virtual&&T.current.params.virtual.enabled){T.current.virtual.slides=V;const z={cache:!1,slides:V,renderExternal:g,renderExternalUpdate:!1};$d(T.current.params.virtual,z),$d(T.current.originalParams.virtual,z)}};A.current||me(),T.current&&T.current.on("_beforeBreakpoint",ee);const ye=()=>{c||!q||!T.current||Object.keys(q).forEach(G=>{T.current.on(G,q[G])})},ue=()=>{!q||!T.current||Object.keys(q).forEach(G=>{T.current.off(G,q[G])})};b.useEffect(()=>()=>{T.current&&T.current.off("_beforeBreakpoint",ee)}),b.useEffect(()=>{!S.current&&T.current&&(T.current.emitSlidesClasses(),S.current=!0)}),Tf(()=>{if(l&&(l.current=A.current),!!A.current)return T.current.destroyed&&me(),bL({el:A.current,nextEl:j.current,prevEl:P.current,paginationEl:F.current,scrollbarEl:R.current,swiper:T.current},C),s&&!T.current.destroyed&&s(T.current),()=>{T.current&&!T.current.destroyed&&T.current.destroy(!0,!1)}},[]),Tf(()=>{ye();const G=yL($,L.current,V,I.current,z=>z.key);return L.current=$,I.current=V,G.length&&T.current&&!T.current.destroyed&&gL({swiper:T.current,slides:V,passedParams:$,changedParams:G,nextEl:j.current,prevEl:P.current,scrollbarEl:R.current,paginationEl:F.current}),()=>{ue()}}),Tf(()=>{vL(T.current)},[p]);function ie(){return C.virtual?SL(T.current,V,p):V.map((G,z)=>D.cloneElement(G,{swiper:T.current,swiperSlideIndex:z}))}return D.createElement(t,bm({ref:A,className:_7(`${u}${e?` ${e}`:""}`)},Q),D.createElement(AL.Provider,{value:T.current},he["container-start"],D.createElement(n,{className:mL(C.wrapperClass)},he["wrapper-start"],ie(),he["wrapper-end"]),T7(C)&&D.createElement(D.Fragment,null,D.createElement("div",{ref:P,className:"swiper-button-prev"}),D.createElement("div",{ref:j,className:"swiper-button-next"})),k7(C)&&D.createElement("div",{ref:R,className:"swiper-scrollbar"}),C7(C)&&D.createElement("div",{ref:F,className:"swiper-pagination"}),he["container-end"]))});rh.displayName="Swiper";const Ou=b.forwardRef(({tag:e="div",children:t,className:n="",swiper:r,zoom:s,lazy:i,virtualIndex:l,swiperSlideIndex:c,...u}={},f)=>{const p=b.useRef(null),[g,y]=b.useState("swiper-slide"),[v,S]=b.useState(!1);function A(j,P,F){P===p.current&&y(F)}Tf(()=>{if(typeof c<"u"&&(p.current.swiperSlideIndex=c),f&&(f.current=p.current),!(!p.current||!r)){if(r.destroyed){g!=="swiper-slide"&&y("swiper-slide");return}return r.on("_slideClass",A),()=>{r&&r.off("_slideClass",A)}}}),Tf(()=>{r&&p.current&&!r.destroyed&&y(r.getSlideClasses(p.current))},[r]);const T={isActive:g.indexOf("swiper-slide-active")>=0,isVisible:g.indexOf("swiper-slide-visible")>=0,isFullyVisible:g.indexOf("swiper-slide-fully-visible")>=0,isPrev:g.indexOf("swiper-slide-prev")>=0,isNext:g.indexOf("swiper-slide-next")>=0},L=()=>typeof t=="function"?t(T):t,I=()=>{S(!0)};return D.createElement(e,bm({ref:p,className:_7(`${g}${n?` ${n}`:""}`),"data-swiper-slide-index":l,onLoad:I},u),s&&D.createElement(I5.Provider,{value:T},D.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof s=="number"?s:void 0},L(),i&&!v&&D.createElement("div",{className:"swiper-lazy-preloader",ref:j=>{j&&(j.lazyPreloaderManaged=!0)}}))),!s&&D.createElement(I5.Provider,{value:T},L(),i&&!v&&D.createElement("div",{className:"swiper-lazy-preloader",ref:j=>{j&&(j.lazyPreloaderManaged=!0)}})))});Ou.displayName="SwiperSlide";const Ki=[];for(let e=0;e<256;++e)Ki.push((e+256).toString(16).slice(1));function TL(e,t=0){return(Ki[e[t+0]]+Ki[e[t+1]]+Ki[e[t+2]]+Ki[e[t+3]]+"-"+Ki[e[t+4]]+Ki[e[t+5]]+"-"+Ki[e[t+6]]+Ki[e[t+7]]+"-"+Ki[e[t+8]]+Ki[e[t+9]]+"-"+Ki[e[t+10]]+Ki[e[t+11]]+Ki[e[t+12]]+Ki[e[t+13]]+Ki[e[t+14]]+Ki[e[t+15]]).toLowerCase()}let v1;const CL=new Uint8Array(16);function kL(){if(!v1){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");v1=crypto.getRandomValues.bind(crypto)}return v1(CL)}const _L=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),R5={randomUUID:_L};function LL(e,t,n){e=e||{};const r=e.random??e.rng?.()??kL();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,TL(r)}function EL(e,t,n){return R5.randomUUID&&!e?R5.randomUUID():LL(e)}const IL={},N5=e=>{let t;const n=new Set,r=(p,g)=>{const y=typeof p=="function"?p(t):p;if(!Object.is(y,t)){const v=t;t=g??(typeof y!="object"||y===null)?y:Object.assign({},t,y),n.forEach(S=>S(t,v))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>f,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(IL?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=t=e(r,s,u);return u},RL=e=>e?N5(e):N5;var w1={exports:{}},S1={},A1={exports:{}},T1={};var M5;function NL(){if(M5)return T1;M5=1;var e=sg();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function c(g,y){var v=y(),S=r({inst:{value:v,getSnapshot:y}}),A=S[0].inst,T=S[1];return i(function(){A.value=v,A.getSnapshot=y,u(A)&&T({inst:A})},[g,v,y]),s(function(){return u(A)&&T({inst:A}),g(function(){u(A)&&T({inst:A})})},[g]),l(v),v}function u(g){var y=g.getSnapshot;g=g.value;try{var v=y();return!n(g,v)}catch{return!0}}function f(g,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return T1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,T1}var D5;function ML(){return D5||(D5=1,A1.exports=NL()),A1.exports}var j5;function DL(){if(j5)return S1;j5=1;var e=sg(),t=ML();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,c=e.useMemo,u=e.useDebugValue;return S1.useSyncExternalStoreWithSelector=function(f,p,g,y,v){var S=i(null);if(S.current===null){var A={hasValue:!1,value:null};S.current=A}else A=S.current;S=c(function(){function L(R){if(!I){if(I=!0,j=R,R=y(R),v!==void 0&&A.hasValue){var C=A.value;if(v(C,R))return P=C}return P=R}if(C=P,r(j,R))return C;var $=y(R);return v!==void 0&&v(C,$)?(j=R,C):(j=R,P=$)}var I=!1,j,P,F=g===void 0?null:g;return[function(){return L(p())},F===null?void 0:function(){return L(F())}]},[p,g,y,v]);var T=s(f,S[0],S[1]);return l(function(){A.hasValue=!0,A.value=T},[T]),u(T),T},S1}var P5;function jL(){return P5||(P5=1,w1.exports=DL()),w1.exports}var PL=jL();const BL=p7(PL),I7={},{useDebugValue:FL}=D,{useSyncExternalStoreWithSelector:OL}=BL;let B5=!1;const QL=e=>e;function $L(e,t=QL,n){(I7?"production":void 0)!=="production"&&n&&!B5&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),B5=!0);const r=OL(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return FL(r),r}const F5=e=>{(I7?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?RL(e):e,n=(r,s)=>$L(t,r,s);return Object.assign(n,t),n},R7=e=>e?F5(e):F5,ym="auth:unauthorized";let Bd=null;class Sl extends Error{constructor(t,n,r){super(t),this.status=n,this.code=r,this.name="TerminalApiError"}status;code}async function HL(){const e=await fetch("/api/terminal/update");if(!e.ok)throw new Sl("Failed to load update state",e.status);return e.json()}async function UL(){const e=await ur(),t=await fetch("/api/terminal/update/check",{method:"POST",headers:{"X-XSRF-TOKEN":e}});if(!t.ok)throw new Sl("Failed to check for updates",t.status);return t.json()}async function zL(){const e=await ur(),t=await fetch("/api/terminal/update/restart",{method:"POST",headers:{"X-XSRF-TOKEN":e}});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to restart Termdock"}));throw new Sl(n.error||"Failed to restart Termdock",t.status)}return t.json()}async function GL(){const e=await fetch("/api/terminal/quota");if(!e.ok)throw new Sl("Failed to fetch quota",e.status);return e.json()}async function WL(){const e=await ur(),t=await fetch("/api/terminal/quota/refresh",{method:"POST",headers:{"X-XSRF-TOKEN":e}});if(!t.ok)throw new Sl("Failed to refresh quota",t.status);return t.json()}const eu=8e3,VL=32e3,zl=1e4,Hd=45e3,qL=8e3,YL=8e3,KL=15e3,XL=1e4,Yd=5e3;let ZL=0;const Vp=[];let C1=!1;function Dc(e,t={}){if(typeof window>"u")return;const n=JSON.stringify({level:e==="error"||e==="timeout_or_abort"||e==="response_body_timeout"||e==="response_body_parse_error"?"warn":"info",message:`DIFF_API ${e}`,data:{seq:++ZL,ts:Date.now(),...t}});Vp.push(n),JL()}async function JL(){if(!C1){C1=!0;try{for(;Vp.length>0;){const e=Vp[0];try{await fetch("/api/client-log",{method:"POST",headers:{"Content-Type":"application/json"},body:e,keepalive:!0}),Vp.shift()}catch{break}}}finally{C1=!1}}}function eE(e,t,n){const r=new AbortController;let s=setTimeout(()=>{r.abort(new DOMException(n,"TimeoutError"))},t);const i=()=>r.abort(e?.reason);return e&&(e.aborted?i():e.addEventListener("abort",i,{once:!0})),{signal:r.signal,cleanup:()=>{s&&(clearTimeout(s),s=null),e?.removeEventListener("abort",i)}}}async function ks(e,t,n,r){const{signal:s,cleanup:i}=eE(t?.signal??void 0,n,r);try{return await fetch(e,{...t,signal:s})}catch(l){throw l instanceof DOMException&&l.name==="TimeoutError"?new Error(r):l}finally{i()}}async function N7(e,t,n){let r=null;const s=new Promise((i,l)=>{r=setTimeout(()=>l(new Error(n)),t)});try{return await Promise.race([e.text(),s])}finally{r&&clearTimeout(r)}}async function Kd(e,t,n){const r=await N7(e,t,n);return JSON.parse(r)}if(typeof window<"u"&&!window.__termdockFetchPatched){window.__termdockFetchPatched=!0;const e=window.fetch.bind(window);window.fetch=async(...t)=>{const n=await e(...t);if(n.status===401){Bd=null;try{window.dispatchEvent(new CustomEvent(ym))}catch{}}return n}}async function ur(){if(Bd)return Bd;const e=await ks("/api/csrf-token",void 0,qL,"CSRF token request timed out");if(!e.ok)throw new Error("Failed to get CSRF token");const t=await Kd(e,Yd,"CSRF token response timed out");if(!t.csrfToken)throw new Error("Invalid CSRF token response");return Bd=t.csrfToken,Bd}function M7(){Bd=null}const tE=2e4,O5=8e3,nE=1500,so=new Map,rE=24,sE=40,iE=40;function oE(e){return e.retryState.retryCount>=2||e.pendingInputs.length>=iE?"congested":e.retryState.retryCount>=1||e.pendingInputs.length>=8?"degraded":"good"}function Q5(e){if(e.pendingInputs.length===0||e.ws.readyState!==WebSocket.OPEN)return;const t=e.pendingInputs.splice(0);for(const n of t)try{e.ws.send(JSON.stringify({type:"input",data:n}))}catch{}}function D7(e){if(e.ws.readyState!==WebSocket.OPEN)return;const t=oE(e);if(t==="good"){Q5(e);return}if(e.inputFlushTimer)return;const n=t==="congested"?sE:rE;e.inputFlushTimer=setTimeout(()=>{e.inputFlushTimer=null,Q5(e)},n)}const Cf=new Map;function aE(e,t,n,r){const s=Cf.get(e);s&&(Cf.delete(e),t?s.resolve({success:!0,layout:n}):s.reject(new Error(r||"Tmux action failed")))}function lE(e,t){const r=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}/api/terminal/${e}/ws`;return t>0?`${r}?since=${t}`:r}const $5=new Map;async function cE(e){const t=await ur(),n=await fetch("/api/terminal/create",{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify({cols:e.cols||80,rows:e.rows||24,mode:e.mode||"shell",tmuxSessionName:e.tmuxSessionName,cwd:e.cwd,termType:e.termType})});if(!n.ok){const r=await n.json().catch(()=>({error:"Failed to create terminal"}));throw new Error(r.error||"Failed to create terminal session")}return n.json()}function uE(e,t,n,r={}){const{maxRetries:s=10,initialRetryDelay:i=1e3,maxRetryDelay:l=2e4,connectionTimeout:c=15e3}=r,u={maxRetries:s,initialDelayMs:i,maxDelayMs:l,connectionTimeoutMs:c,retryCount:0,retryTimeout:null,connectionTimeoutId:null,isClosed:!1,isSuspended:!1};let f=null,p=$5.get(e)??0;$5.delete(e);const g=[];let y=!1,v=null;const S=new WeakSet,A=()=>{u.retryTimeout&&(clearTimeout(u.retryTimeout),u.retryTimeout=null),u.connectionTimeoutId&&(clearTimeout(u.connectionTimeoutId),u.connectionTimeoutId=null),v&&(clearTimeout(v),v=null)},T=F=>{F.heartbeatTimer&&(clearInterval(F.heartbeatTimer),F.heartbeatTimer=null),F.pongTimer&&(clearTimeout(F.pongTimer),F.pongTimer=null),F.inputFlushTimer&&(clearTimeout(F.inputFlushTimer),F.inputFlushTimer=null)},L=F=>{T(F),F.heartbeatTimer=setInterval(()=>{if(F.ws.readyState===WebSocket.OPEN){try{F.ws.send(JSON.stringify({type:"ping"}))}catch{}F.pongTimer&&clearTimeout(F.pongTimer),F.pongTimer=setTimeout(()=>{if(Date.now()-F.lastInboundAt>=O5)try{F.ws.close()}catch{}},O5)}},tE)},I=()=>{if(u.isClosed=!0,A(),f){T(f),so.delete(e);try{f.ws.close()}catch{}f=null}},j=()=>{if(u.isClosed)return;if(f){S.add(f.ws),T(f);try{f.ws.close()}catch{}}const F=lE(e,p),R=new WebSocket(F);y=!1,u.connectionTimeoutId=setTimeout(()=>{R.readyState!==WebSocket.OPEN&&(y=!0,R.close(),P(new Error("WebSocket connection timeout"),!1))},c);const C={ws:R,onEvent:t,onError:n,reconnectNow:()=>{if(!u.isClosed&&(u.isSuspended=!1,!v)){if(A(),f){S.add(f.ws),T(f);try{f.ws.close()}catch{}}t({type:"reconnecting",attempt:Math.min(u.retryCount+1,s),maxAttempts:s}),u.retryCount=Math.min(u.retryCount+1,s),y=!0,v=setTimeout(()=>{v=null,y=!1,j()},0)}},suspendReconnect:()=>{u.isClosed||(u.isSuspended=!0,u.retryTimeout&&(clearTimeout(u.retryTimeout),u.retryTimeout=null))},retryState:u,lastSeq:p,pendingInputs:g,inputFlushTimer:null,heartbeatTimer:null,pongTimer:null,lastInboundAt:Date.now(),inboundSequence:0};R.onopen=()=>{A(),u.retryCount=0,C.lastInboundAt=Date.now(),C.inboundSequence+=1,L(C),D7(C)},R.onmessage=$=>{C.lastInboundAt=Date.now(),C.inboundSequence+=1;try{const Q=JSON.parse($.data);if(Q.type==="pong"){C.pongTimer&&(clearTimeout(C.pongTimer),C.pongTimer=null);return}if(Q.type==="tmux-result"&&Q.reqId){aE(Q.reqId,Q.success!==!1,Q.layout,Q.error);return}if(Q.type==="tmux-layout"&&Q.layout){t({type:"tmux-layout",layout:Q.layout});return}if(Q.type==="tmux-screen-sync"&&Array.isArray(Q.chunks)){t({type:"tmux-screen-sync",chunks:Q.chunks.filter(V=>typeof V=="string"),cols:typeof Q.cols=="number"?Q.cols:void 0,rows:typeof Q.rows=="number"?Q.rows:void 0,generation:typeof Q.generation=="number"?Q.generation:void 0});return}if(Q.type==="active-program"){t({type:"active-program",activeProgram:Q.activeProgram,activeProgramRaw:Q.activeProgramRaw,activeProgramSource:Q.activeProgramSource});return}if(Q.type==="cwd"){t({type:"cwd",cwd:Q.cwd});return}if(Q.type==="agent-status"){t({type:"agent-status",agentStatus:Q.agentStatus??null,agentIndicator:Q.agentIndicator??null,agentStatusDetail:Q.agentStatusDetail??null,agent:Q.agent??null,agentMessage:Q.agentMessage??null,agentNativeSessionId:Q.agentNativeSessionId??null,agentResumeRecovered:Q.agentResumeRecovered===!0,agentRich:Q.agentRich===!0,agentActivity:typeof Q.agentActivity=="number"?Q.agentActivity:0,agentCwd:Q.agentCwd??null,reviewed:typeof Q.reviewed=="boolean"?Q.reviewed:null});return}if(Q.type==="git-status"){t({type:"git-status",gitStatus:Q.gitStatus??null});return}if(Q.type==="quota-status"&&Array.isArray(Q.providers)){window.dispatchEvent(new CustomEvent("termdock:quota-update",{detail:Q.providers}));return}if(Q.type==="focus-mode"){t({type:"focus-mode",focusTrackingRequested:Q.focusTrackingRequested===!0});return}if(Q.type==="resize-ack"){t({type:"resize-ack",seq:typeof Q.seq=="number"?Q.seq:void 0,cols:typeof Q.cols=="number"?Q.cols:void 0,rows:typeof Q.rows=="number"?Q.rows:void 0,ok:Q.ok!==!1,error:typeof Q.error=="string"?Q.error:void 0});return}if(Q.type==="pty-size"){t({type:"pty-size",cols:typeof Q.cols=="number"?Q.cols:void 0,rows:typeof Q.rows=="number"?Q.rows:void 0,source:typeof Q.source=="string"?Q.source:void 0});return}if(Q.type==="shell-title"){t({type:"shell-title",title:typeof Q.title=="string"?Q.title:""});return}if(Q.type==="prompt-state"){t({type:"prompt-state",state:Q.state==="running"?"running":"idle",exitCode:typeof Q.exitCode=="number"?Q.exitCode:void 0});return}const q=Q;if(q.type==="connected"){typeof q.replayLastSeq=="number"&&q.replayLastSeq>0&&(p=q.replayLastSeq,C.lastSeq=p),t(q);return}if(q.type==="exit"){I(),t(q);return}t(q),q.type==="data"&&typeof q.seq=="number"&&Number.isFinite(q.seq)&&q.seq>p&&(p=q.seq,C.lastSeq=p)}catch(Q){n?.(Q,!1)}},R.onerror=()=>{S.has(R)||(A(),T(C),y||(y=!0,P(new Error("WebSocket connection error"),!1)))},R.onclose=$=>{if(!S.has(R)&&(A(),T(C),!u.isClosed&&!y)){if(y=!0,$.code===4001){console.warn("[Terminal] WS 4001: Session not found on server",{code:$.code,reason:$.reason,stack:new Error().stack}),P(new Error("Session not found on server"),!0);return}if($.code===4003||$.code===4401){try{window.dispatchEvent(new CustomEvent(ym))}catch{}P(new Error("Authentication required"),!0);return}P(new Error("WebSocket connection closed"),!1)}},f=C,so.set(e,f)},P=(F,R)=>{if(!u.isClosed)if(R)n?.(F,!0),I();else{u.retryCount=Math.min(u.retryCount+1,Math.max(1,s));const C=Math.min(i*Math.pow(2,u.retryCount-1),l);if(t({type:"reconnecting",attempt:u.retryCount,maxAttempts:s}),u.isSuspended)return;u.retryTimeout=setTimeout(()=>{u.isClosed||j()},C)}};return j(),I}async function j7(e,t){const n=so.get(e);if(n){if(n.ws.readyState===WebSocket.OPEN){n.pendingInputs.push(t),D7(n);return}if(n.ws.readyState===WebSocket.CONNECTING){n.pendingInputs.push(t);return}}const r=await ur(),s=await fetch(`/api/terminal/${e}/input`,{method:"POST",headers:{"Content-Type":"text/plain","X-XSRF-TOKEN":r},body:t});if(!s.ok){const i=await s.json().catch(()=>({error:"Failed to send input"}));throw new Error(i.error||"Failed to send terminal input")}}function dE(e,t){const n=so.get(e);if(!n)return!1;if(n.retryState.isSuspended=!1,n.ws.readyState!==WebSocket.OPEN)return n.reconnectNow(),!0;const r=n.inboundSequence;try{n.ws.send(JSON.stringify({type:"ping"}))}catch{}return setTimeout(()=>{so.get(e)!==n||n.retryState.isClosed||(n.inboundSequence<=r?n.reconnectNow():t?.())},nE),!0}function fE(e){const t=so.get(e);return t?(t.reconnectNow(),!0):!1}function H5(){for(const e of so.values())e.suspendReconnect()}function U5(e,t,n){const r=so.get(e);if(!(!r||r.ws.readyState!==WebSocket.OPEN))try{r.ws.send(JSON.stringify({type:"focus",focused:t,reason:n}))}catch{}}function z5(e,t,n){const r=so.get(e);if(!(!r||r.ws.readyState!==WebSocket.OPEN))try{r.ws.send(JSON.stringify({type:"viewing",viewing:t,reason:n}))}catch{}}function G5(e){const t=so.get(e);if(!(!t||t.ws.readyState!==WebSocket.OPEN))try{t.ws.send(JSON.stringify({type:"agent-review-ack"}))}catch{}}function W5(e,t,n){const r=so.get(e);if(!(!r||r.ws.readyState!==WebSocket.OPEN))try{r.ws.send(JSON.stringify({type:"flow-control",paused:t,reason:n}))}catch{}}async function hE(e,t,n,r){const s=so.get(e);if(s&&s.ws.readyState===WebSocket.OPEN)try{s.ws.send(JSON.stringify({type:"resize",cols:t,rows:n,seq:r}));return}catch{}const i=await ur(),l=await fetch(`/api/terminal/${e}/resize`,{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":i},body:JSON.stringify({cols:t,rows:n,seq:r})});if(!l.ok){const u=await l.json().catch(()=>({error:"Failed to resize terminal"}));throw new Error(u.error||"Failed to resize terminal")}const c=await l.json().catch(()=>({success:!0}));if(c?.success===!1||c?.ok===!1)throw new Error(c?.error||"Failed to resize terminal")}async function pE(e,t){const n=so.get(e);if(n&&n.ws.readyState===WebSocket.OPEN)return t.action==="scroll"?(n.ws.send(JSON.stringify({type:"tmux",...t})),{success:!0}):new Promise((i,l)=>{const c=Math.random().toString(36).substring(7);Cf.set(c,{resolve:i,reject:l}),n.ws.send(JSON.stringify({type:"tmux",reqId:c,...t})),setTimeout(()=>{Cf.has(c)&&(Cf.delete(c),l(new Error("Tmux action timed out")))},3e4)});const r=await ur(),s=await fetch(`/api/terminal/${e}/tmux`,{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":r},body:JSON.stringify(t)});if(!s.ok){const i=await s.json().catch(()=>({error:"Failed to execute tmux action"}));throw new Error(i.error||"Failed to execute tmux action")}return s.json()}async function P7(e){const t=so.get(e);if(t){t.retryState.isClosed=!0;try{t.ws.close()}catch{}so.delete(e)}const n=await ur(),r=await fetch(`/api/terminal/${e}`,{method:"DELETE",headers:{"X-XSRF-TOKEN":n}});if(r.status!==404&&!r.ok){const s=await r.json().catch(()=>({error:"Failed to close terminal"}));throw new Error(s.error||"Failed to close terminal")}}async function mE(e,t){const n=so.get(e);if(n){n.retryState.isClosed=!0;try{n.ws.close()}catch{}so.delete(e)}const r=await ur(),s=await fetch(`/api/terminal/${e}/restart`,{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":r},body:JSON.stringify({...t.cwd?{cwd:t.cwd}:{},cols:t.cols??80,rows:t.rows??24,mode:t.mode,tmuxSessionName:t.tmuxSessionName})});if(!s.ok){const i=await s.json().catch(()=>({error:"Failed to restart terminal"}));throw new Error(i.error||"Failed to restart terminal session")}return s.json()}async function gE(e){const t=await ks(`/api/terminal/${e}/health`,{method:"GET"},YL,"Terminal health check timed out");if(!t.ok){if(t.status===404)return{healthy:!1,sessionId:e};const n=await Kd(t,Yd,"Terminal health error response timed out").catch(()=>({error:"Failed to check terminal health"}));throw new Error(n.error||"Failed to check terminal health")}return Kd(t,Yd,"Terminal health response timed out")}async function xE(e){const t=await ur(),n=await ks("/api/terminal/force-kill",{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify(e)},XL,"Terminal force-kill request timed out");if(!n.ok){const r=await Kd(n,Yd,"Terminal force-kill error response timed out").catch(()=>({error:"Failed to force kill terminal"}));throw new Error(r.error||"Failed to force kill terminal")}}async function ab(){const e=await fetch("/api/terminal/tmux/sessions",{method:"GET"});if(!e.ok){const n=await e.json().catch(()=>({error:"Failed to list tmux sessions"}));throw new Error(n.error||"Failed to list tmux sessions")}const t=await e.json();return Array.isArray(t.sessions)?t.sessions:[]}async function lb(){const e=await fetch("/api/terminal/tmux/status",{method:"GET"});if(!e.ok){const t=await e.json().catch(()=>({error:"Failed to get tmux status"}));throw new Error(t.error||"Failed to get tmux status")}return e.json()}async function B7(e){const t=e.trim();if(!t)throw new Error("tmux session name is required");const n=await ur(),r=await fetch(`/api/terminal/tmux/sessions/${encodeURIComponent(t)}`,{method:"DELETE",headers:{"X-XSRF-TOKEN":n}});if(!r.ok){const i=await r.json().catch(()=>({error:"Failed to kill tmux session"}));throw new Error(i.error||"Failed to kill tmux session")}const s=await r.json();return{cleanedSessions:Array.isArray(s.cleanedSessions)?s.cleanedSessions:[],alreadyGone:!!s.alreadyGone}}const rp=new Map;function bE(e){return JSON.stringify({preferredFrontendSessionId:e.preferredFrontendSessionId??null,mode:e.mode??null,tmuxSessionName:e.tmuxSessionName??null,cwd:e.cwd??null,termType:e.termType??null,createIfEmpty:e.createIfEmpty===!0,requireExisting:e.requireExisting===!0})}async function yE(){const e=await fetch("/api/terminal/session-inventory",{method:"GET"});if(!e.ok){const t=await e.json().catch(()=>({error:"Failed to load session inventory"}));throw new Error(t.error||"Failed to load session inventory")}return e.json()}async function F7(e){const t=bE(e),n=rp.get(t);if(n)return n;const r=await ur(),s=ks("/api/terminal/session-inventory/open",{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":r},body:JSON.stringify(e)},KL,"Terminal session open request timed out").then(async i=>{if(!i.ok){const l=await Kd(i,Yd,"Terminal session open error response timed out").catch(()=>({error:"Failed to open session"}));throw new Sl(l.error||"Failed to open session",i.status,typeof l.code=="string"?l.code:void 0)}return Kd(i,Yd,"Terminal session open response timed out")}).finally(()=>{rp.get(t)===s&&rp.delete(t)});return rp.set(t,s),s}async function qp(e,t){const n=await ur(),r=await fetch(`/api/terminal/session-inventory/sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":n},body:JSON.stringify(t)});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to update session"}));throw new Error(s.error||"Failed to update session")}return r.json()}async function vE(e){const t=await ur(),n=await fetch("/api/terminal/session-inventory/reorder",{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify({sessionIds:e})});if(!n.ok){const r=await n.json().catch(()=>({error:"Failed to reorder sessions"}));throw new Error(r.error||"Failed to reorder sessions")}return n.json()}async function wE(e){const t=await ur(),n=await fetch(`/api/terminal/session-inventory/sessions/${encodeURIComponent(e)}`,{method:"DELETE",headers:{"X-XSRF-TOKEN":t}});if(!n.ok){const r=await n.json().catch(()=>({error:"Failed to remove session"}));throw new Error(r.error||"Failed to remove session")}}async function SE(){const e=await ur(),t=await fetch("/api/terminal/session-inventory/sessions",{method:"DELETE",headers:{"X-XSRF-TOKEN":e}});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to clear sessions"}));throw new Error(n.error||"Failed to clear sessions")}}async function V5(){const e=await fetch("/api/terminal/toolbar-presets",{method:"GET"});if(!e.ok){const t=await e.json().catch(()=>({error:"Failed to load toolbar presets"}));throw new Error(t.error||"Failed to load toolbar presets")}return e.json()}async function AE(e){const t=await ur(),n=await fetch("/api/terminal/toolbar-presets",{method:"PUT",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify(e)});if(!n.ok){const r=await n.json().catch(()=>({error:"Failed to save toolbar presets"})),s=new Error(r.error||"Failed to save toolbar presets");throw s.current=r.current,s.code=r.code,s}return n.json()}async function ig(){const e=await fetch("/api/terminal/settings",{method:"GET"});if(!e.ok){const t=await e.json().catch(()=>({error:"Failed to load settings"}));throw new Error(t.error||"Failed to load settings")}return e.json()}async function qa(e){const t=await ur(),n=await fetch("/api/terminal/settings",{method:"PUT",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify(e)});if(!n.ok){const r=await n.json().catch(()=>({error:"Failed to update settings"}));throw new Error(r.error||"Failed to update settings")}return n.json()}async function P0(e=!1){const t=await fetch(`/api/terminal/auto-title/catalog${e?"?refresh=1":""}`);if(!t.ok)throw new Error("Failed to discover title models");const n=await t.json();return Array.isArray(n?.namers)?n.namers:[]}async function TE(){const e=await fetch("/api/terminal/context-draft",{method:"GET"});if(!e.ok){const t=await e.json().catch(()=>({error:"Failed to load context draft"}));throw new Error(t.error||"Failed to load context draft")}return e.json()}async function CE(e,t){const n=await ur(),r=await fetch("/api/terminal/context-draft",{method:"PUT",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":n},body:JSON.stringify({text:e,origin:t})});if(!r.ok){const s=await r.json().catch(()=>({error:"Failed to update context draft"}));throw new Error(s.error||"Failed to update context draft")}return r.json()}async function kE(){const e=await fetch("/api/auth/status");if(!e.ok)throw new Error("Failed to query auth status");return e.json()}async function _E(e){const t=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:e})});if(t.ok)return M7(),{ok:!0};const n=await t.json().catch(()=>null);return t.status===429?{ok:!1,rateLimited:!0,retryAfterMs:typeof n?.retryAfterMs=="number"?n.retryAfterMs:void 0,error:n?.error||"Too many failed attempts. Please wait and try again."}:{ok:!1,error:n?.error||"Login failed"}}async function LE(){const e=await ur();await fetch("/api/auth/logout",{method:"POST",headers:{"X-XSRF-TOKEN":e}}),M7()}async function O7(){const e=await fetch("/api/terminal/agent-launchers");if(!e.ok)throw new Error("Failed to detect agent launchers");const t=await e.json();return Array.isArray(t?.agents)?t.agents:[]}async function EE(){const e=await fetch("/api/terminal/agent-hooks");if(!e.ok)throw new Error("Failed to get agent hooks");const t=await e.json();return Array.isArray(t?.agents)?t.agents:[]}async function IE(e){const t=await ur(),n=await fetch(`/api/terminal/agent-hooks/${encodeURIComponent(e)}/install`,{method:"POST",headers:{"X-XSRF-TOKEN":t}}),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error||"Failed to install agent hooks");return{summary:r.summary??"Installed",devMode:r.devMode===!0}}async function RE(e){const t=await ur(),n=await fetch(`/api/terminal/agent-hooks/${encodeURIComponent(e)}/uninstall`,{method:"POST",headers:{"X-XSRF-TOKEN":t}}),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error||"Failed to uninstall agent hooks");return r.summary??"Removed"}class O2 extends Error{constructor(t,n,r){super(t),this.code=n,this.migration=r,this.name="AgentPluginManifestError"}code;migration}async function NE(){const e=await fetch("/api/terminal/agent-plugins");if(!e.ok)throw new Error("Failed to get agent plugins");return await e.json()}async function ME(e){const t=await ur(),n=await fetch("/api/terminal/agent-plugins",{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify(e)}),r=await n.json().catch(()=>({}));if(!n.ok)throw new O2(r.error||"Failed to create agent plugin",r.code,r.migration);return r}async function DE(e){const t=await ur(),n=await fetch("/api/terminal/agent-plugins/install",{method:"POST",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify({source:e})}),r=await n.json().catch(()=>({}));if(!n.ok)throw new O2(r.error||"Failed to install agent plugin",r.code,r.migration);return r}async function jE(e){const t=await ur(),n=await fetch(`/api/terminal/agent-plugins/${encodeURIComponent(e)}/check-update`,{method:"POST",headers:{"X-XSRF-TOKEN":t}}),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error||"Failed to check plugin updates");return r}async function PE(e){const t=await ur(),n=await fetch(`/api/terminal/agent-plugins/${encodeURIComponent(e)}/update`,{method:"POST",headers:{"X-XSRF-TOKEN":t}}),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error||"Failed to update plugin");return r}async function BE(e){const t=await ur(),n=await fetch(`/api/terminal/agent-plugins/${encodeURIComponent(e)}/doctor`,{method:"POST",headers:{"X-XSRF-TOKEN":t}}),r=await n.json().catch(()=>({}));if(!n.ok)throw new Error(r.error||"Failed to diagnose plugin");return r}async function FE(e){const t=await ur(),n=await fetch(`/api/terminal/agent-plugins/${encodeURIComponent(e)}`,{method:"DELETE",headers:{"X-XSRF-TOKEN":t}});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||"Failed to delete agent plugin")}}async function OE(e){const t=await ur(),n=await fetch(`/api/terminal/${encodeURIComponent(e)}/agent-resume`,{method:"POST",headers:{"X-XSRF-TOKEN":t}}),r=await n.json().catch(()=>({}));if(!n.ok)throw new Sl(r.error||"Failed to resume agent session",n.status,typeof r.code=="string"?r.code:void 0);return{command:r.command??""}}async function q5(){const e=await fetch("/api/terminal/agent-resume-history",{method:"GET"});if(!e.ok)throw new Error("Failed to load Agent resume history");const t=await e.json().catch(()=>({entries:[]}));return Array.isArray(t.entries)?t.entries:[]}async function Q7(e){const t=await ur(),n=await fetch(`/api/terminal/agent-resume-history/${encodeURIComponent(e)}/prepare`,{method:"POST",headers:{"X-XSRF-TOKEN":t}}),r=await n.json().catch(()=>({}));if(!n.ok)throw new Sl(r.error||"Failed to prepare Agent session resume",n.status,typeof r.code=="string"?r.code:void 0);return r}async function QE(e){const t=await ur(),n=await fetch(`/api/terminal/agent-resume-history/${encodeURIComponent(e)}`,{method:"DELETE",headers:{"X-XSRF-TOKEN":t}});if(!n.ok&&n.status!==404)throw new Error("Failed to remove Agent resume history")}async function fd(e){const t=await ur(),n=await fetch("/api/terminal/program-rules",{method:"PUT",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify(e)});if(!n.ok){const r=await n.json().catch(()=>({error:"Failed to update program rules"}));throw new Error(r.error||"Failed to update program rules")}return n.json()}async function $E(){const e=await ur(),t=await fetch("/api/terminal/program-rules",{method:"DELETE",headers:{"X-XSRF-TOKEN":e}});if(!t.ok)throw new Error("Failed to reset program rules");return t.json()}async function HE(){const e=await fetch("/api/terminal/program-detection");if(!e.ok)throw new Error("Failed to get program detection config");return e.json()}async function Y5(e){const t=await ur(),n=await fetch("/api/terminal/program-detection",{method:"PUT",headers:{"Content-Type":"application/json","X-XSRF-TOKEN":t},body:JSON.stringify(e)});if(!n.ok)throw new Error("Failed to save program detection config");return n.json()}async function UE(){const e=await ur(),t=await fetch("/api/terminal/program-detection",{method:"DELETE",headers:{"X-XSRF-TOKEN":e}});if(!t.ok)throw new Error("Failed to reset program detection config");return t.json()}const zE={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".bmp":"image/bmp",".ico":"image/x-icon",".svg":"image/svg+xml",".heic":"image/heic",".heif":"image/heif"};function Q2(e){const t=e.lastIndexOf(".");return t<0?null:zE[e.slice(t).toLowerCase()]??null}function $2(e){return Q2(e)!==null}function $7(e){const t=Q2(e);return t==="image/heic"||t==="image/heif"}const GE={".mp4":"video/mp4",".m4v":"video/x-m4v",".webm":"video/webm",".mov":"video/quicktime",".ogv":"video/ogg",".mpeg":"video/mpeg",".mpg":"video/mpeg"};function H7(e){const t=e.lastIndexOf(".");return t<0?null:GE[e.slice(t).toLowerCase()]??null}function U7(e){return H7(e)!==null}function WE(e){return`/api/terminal/fs/video?path=${encodeURIComponent(e)}&action=view_file`}const VE=[".stl",".glb",".gltf"];function z7(e){const t=e.lastIndexOf(".");if(t<0)return null;const n=e.slice(t).toLowerCase();return VE.includes(n)?n:null}function G7(e){return z7(e)!==null}function W7(e){const t=e.toLowerCase();return t.endsWith(".kicad_sch")?".kicad_sch":t.endsWith(".kicad_pcb")?".kicad_pcb":null}function qE(e){return W7(e)!==null}function YE(e){return W7(e)===".kicad_pcb"?"pcb-front":"schematic"}const KE=[".html",".htm"];function B0(e){const t=e.lastIndexOf(".");if(t<0)return!1;const n=e.slice(t).toLowerCase();return KE.includes(n)}function XE(e){return`/api/terminal/fs/preview/${e.split(/[\\/]+/).filter(Boolean).map(n=>encodeURIComponent(n)).join("/")}`}const ZE={".stl":"model/stl",".glb":"model/gltf-binary",".gltf":"model/gltf+json"};async function V7(e,t,n,r="list_directory",s){const i=new URLSearchParams({path:e});n&&i.set("showHidden","true"),i.set("action",r),s&&i.set("requestSlotId",s);const l=await ks(`/api/terminal/fs/list?${i}`,{signal:t},eu,"Directory listing took too long. The folder may be on slow storage or blocked by another process.");if(!l.ok){const c=await l.json().catch(()=>({error:"Failed to list directory"}));throw new Error(c.error||"Failed to list directory")}return l.json()}async function JE(e,t,n,r,s,i="name",l){const c=new URLSearchParams({path:e,query:t,stream:"true"});s&&c.set("showHidden","true"),i==="content"&&c.set("mode","content"),l&&c.set("requestSlotId",l);const u=await fetch(`/api/terminal/fs/search?${c}`,{signal:r});if(!u.ok||!u.body){const v=await u.json().catch(()=>({error:"Failed to search files"}));throw new Error(v.error||"Failed to search files")}const f=u.body.getReader(),p=new TextDecoder;let g="";const y=v=>{if(!v.trim())return;const S=JSON.parse(v);if(S.type==="meta")n({path:S.path,query:S.query,engine:S.engine,mode:S.mode,limited:S.limited});else if(S.type==="batch")n({entries:S.entries??[]});else if(S.type==="content-batch")n({contentEntries:S.contentEntries??[]});else{if(S.type==="error")throw new Error(S.message||"Search failed");S.type==="done"&&n({total:S.total,truncated:S.truncated,limited:S.limited,engine:S.engine,mode:S.mode,done:!0})}};for(;;){const{value:v,done:S}=await f.read();if(S)break;g+=p.decode(v,{stream:!0});let A=g.indexOf(`
|
|
3
3
|
`);for(;A>=0;)y(g.slice(0,A)),g=g.slice(A+1),A=g.indexOf(`
|
|
4
4
|
`)}g+=p.decode(),y(g)}async function eI(e,t,n){const r=new URLSearchParams;r.set("roots",e.join("|"));const s=await fetch(`/api/terminal/fs/watch?${r}`,{signal:n});if(!s.ok||!s.body){const f=await s.json().catch(()=>({error:"Failed to watch files"}));throw new Error(f.error||"Failed to watch files")}const i=s.body.getReader(),l=new TextDecoder;let c="";const u=f=>{if(!f.trim())return;const p=JSON.parse(f);p.type==="events"&&p.events?.length&&t(p.events)};for(;;){const{value:f,done:p}=await i.read();if(p)break;c+=l.decode(f,{stream:!0});let g=c.indexOf(`
|
|
@@ -176,12 +176,12 @@ ${z.desc}`:""}`,"aria-pressed":T===z.key,onPointerEnter:()=>A(z.key),onPointerLe
|
|
|
176
176
|
|
|
177
177
|
`;return`${e}${r}${n}`}function $Z(e,t){const n=e.trim();return n?t?`${n}\r`:/\s$/.test(e)?e:`${n} `:""}const w2="termdock:right-sidebar:html-view-mode-by-file:v1";function HZ(e){return e==="preview"||e==="source"}function hT(e){return!e||typeof e!="object"||Array.isArray(e)?!1:Object.values(e).every(HZ)}function pT(e,t){if(!t)return null;const n=e&&!t.startsWith("/")?`${e}/${t}`:t;return e?`${e}::${n}`:n}function m4(e,t){const n=pT(e,t);return n?Or(w2,hT)?.[n]??"source":"source"}function UZ(e,t,n){const r=pT(e,t);if(!r)return;const s=Or(w2,hT)??{};Qn(w2,{...s,[r]:n})}function Fx(e){const t=Number.isFinite(e)&&e>0?Math.floor(e):0,n=Math.floor(t/3600),r=Math.floor(t%3600/60),s=t%60,i=String(r).padStart(2,"0"),l=String(s).padStart(2,"0");return n>0?`${n}:${i}:${l}`:`${i}:${l}`}function zZ(e,t,n){return!Number.isFinite(n)||n<=0||!t.width?0:Math.min(1,Math.max(0,(e-t.left)/t.width))*n}const GZ=350,WZ=12,VZ=90;function qZ({url:e,onLoadError:t}){const{t:n}=Vn(),r=b.useRef(null),s=b.useRef(null),i=b.useRef(null),l=b.useRef(null),c=b.useRef(!1),u=b.useRef(null),f=b.useRef(null),p=b.useRef(0),g=b.useRef(!1),y=b.useRef(!1),v=b.useRef(!1),S=b.useRef(null),A=b.useRef(null),T=b.useRef(!1),L=b.useRef(1),I=b.useRef(!1),[j,P]=b.useState(0),[F,R]=b.useState(0),[C,$]=b.useState(!1),[Q,q]=b.useState(!1),[V,he]=b.useState(null),[ee,me]=b.useState(!1),[ye,ue]=b.useState(0),[ie,G]=b.useState(!1),[z,X]=b.useState({width:0,height:0}),oe=b.useCallback(()=>{S.current!==null&&(clearTimeout(S.current),S.current=null)},[]),ge=b.useCallback(()=>{if(oe(),A.current=null,!T.current)return!1;const Te=i.current;return Te&&(Te.playbackRate=L.current),T.current=!1,me(!1),!0},[oe]);b.useEffect(()=>()=>{u.current!==null&&cancelAnimationFrame(u.current),f.current!==null&&clearTimeout(f.current),oe();const Te=i.current;Te&&T.current&&(Te.playbackRate=L.current)},[oe]),b.useEffect(()=>{const Te=s.current;if(!Te||typeof ResizeObserver>"u")return;const Ke=new ResizeObserver(([vt])=>{vt&&X({width:vt.contentRect.width,height:vt.contentRect.height})});return Ke.observe(Te),()=>Ke.disconnect()},[]),b.useEffect(()=>{const Te=()=>G(document.fullscreenElement===r.current);return document.addEventListener("fullscreenchange",Te),()=>document.removeEventListener("fullscreenchange",Te)},[]);const Ee=b.useCallback((Te,Ke=!1)=>{const vt=i.current;if(!vt)return!1;const gt=Number.isFinite(vt.duration)?vt.duration:Te,rn=Math.min(Math.max(Te,0),gt);if(R(rn),Math.abs(vt.currentTime-rn)<1/120)return!1;const dn=vt.fastSeek;return Ke&&typeof dn=="function"?dn.call(vt,rn):vt.currentTime=rn,!0},[]),pe=b.useCallback(()=>{u.current===null&&(u.current=requestAnimationFrame(()=>{u.current=null;const Te=i.current;if(!Te||!g.current||y.current||Te.seeking)return;const Ke=v.current;v.current=!1,y.current=Ee(p.current,!Ke)}))},[Ee]),we=b.useCallback(Te=>{const Ke=l.current,vt=i.current;if(!Ke||!vt)return;const gt=Ke.getBoundingClientRect(),rn=zZ(Te,gt,vt.duration);p.current=rn,he(rn),v.current=!1,pe(),f.current!==null&&clearTimeout(f.current),f.current=setTimeout(()=>{f.current=null,v.current=!0,pe()},VZ)},[pe]),ve=b.useCallback(()=>{u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),f.current!==null&&(clearTimeout(f.current),f.current=null),v.current=!1,y.current=!1,Ee(p.current)},[Ee]),K=b.useCallback(Te=>{const Ke=i.current;if(!(!Ke||!Number.isFinite(Ke.duration)||Ke.duration<=0)){c.current=!Ke.paused,Ke.pause(),g.current=!0,q(!0);try{Te.currentTarget.setPointerCapture(Te.pointerId)}catch{}we(Te.clientX)}},[we]),nt=b.useCallback(()=>{g.current=!1,ve(),q(!1),he(null);const Te=i.current;Te&&c.current&&!Te.ended&&Te.play().catch(()=>{}),c.current=!1},[ve]),st=b.useCallback(()=>{const Te=i.current;if(Te){if(I.current){I.current=!1;return}Te.paused?Te.play().catch(()=>{}):Te.pause()}},[]),it=b.useCallback(Te=>{const Ke=i.current;!Ke||Ke.paused||Te.button!==0||(oe(),A.current={id:Te.pointerId,x:Te.clientX,y:Te.clientY},S.current=setTimeout(()=>{S.current=null,L.current=Ke.playbackRate,Ke.playbackRate=2,T.current=!0,me(!0)},GZ))},[oe]),ke=b.useCallback(Te=>{const Ke=A.current;!Ke||Ke.id!==Te.pointerId||T.current||Math.hypot(Te.clientX-Ke.x,Te.clientY-Ke.y)>WZ&&(oe(),A.current=null)},[oe]),Pe=b.useCallback(()=>{ge()&&(I.current=!0)},[ge]);b.useEffect(()=>(window.addEventListener("pointerup",Pe),window.addEventListener("pointercancel",Pe),window.addEventListener("blur",Pe),()=>{window.removeEventListener("pointerup",Pe),window.removeEventListener("pointercancel",Pe),window.removeEventListener("blur",Pe)}),[Pe]);const de=b.useCallback(async()=>{const Te=r.current,Ke=i.current;if(!(!Te||!Ke))try{document.fullscreenElement===Te?await document.exitFullscreen():Te.requestFullscreen?await Te.requestFullscreen():Ke.webkitEnterFullscreen?.()}catch{Ke.webkitEnterFullscreen?.()}},[]),je=b.useCallback(()=>ue(Te=>(Te+90)%360),[]),$e=b.useCallback(Te=>{const Ke=i.current;if(!Ke||!Number.isFinite(Ke.duration))return;const vt=Te.shiftKey?10:5;let gt=null;Te.key==="ArrowLeft"?gt=Ke.currentTime-vt:Te.key==="ArrowRight"?gt=Ke.currentTime+vt:Te.key==="Home"?gt=0:Te.key==="End"&&(gt=Ke.duration),gt!==null&&(Te.preventDefault(),Ee(gt))},[Ee]),Ze=Q&&V!==null?V:F,ae=j>0?Math.min(1,Math.max(0,Ze/j)):0,Ue=(ye===90||ye===270)&&z.width>0&&z.height>0?{width:`${z.height}px`,height:`${z.width}px`}:{width:"100%",height:"100%"};return o.jsxs("div",{ref:r,className:"flex h-full min-h-0 flex-col overflow-hidden rounded-lg bg-background fullscreen:h-screen fullscreen:w-screen fullscreen:rounded-none","data-testid":"file-preview-video-player","data-rotation":ye,children:[o.jsxs("div",{ref:s,className:"relative min-h-0 flex-1 overflow-hidden bg-background",children:[o.jsx("video",{ref:i,"data-testid":"file-preview-video",className:"absolute left-1/2 top-1/2 max-w-none object-contain transition-transform duration-200",style:{...Ue,transform:`translate(-50%, -50%) rotate(${ye}deg)`},src:e,preload:"auto",playsInline:!0,onClick:st,onPointerDown:it,onPointerMove:ke,onPointerUp:Pe,onPointerCancel:Pe,onContextMenu:Te=>{T.current&&Te.preventDefault()},onPlay:()=>$(!0),onPause:()=>$(!1),onTimeUpdate:Te=>R(Te.currentTarget.currentTime),onSeeked:Te=>{const Ke=Te.currentTarget;if(R(Ke.currentTime),y.current=!1,!g.current)return;const vt=Ke.requestVideoFrameCallback;typeof vt=="function"?vt.call(Ke,()=>{g.current&&pe()}):requestAnimationFrame(()=>{g.current&&pe()})},onLoadedMetadata:Te=>P(Number.isFinite(Te.currentTarget.duration)?Te.currentTarget.duration:0),onDurationChange:Te=>P(Number.isFinite(Te.currentTarget.duration)?Te.currentTarget.duration:0),onError:t,children:n("rightSidebar.videoUnsupported")}),ee&&o.jsx("div",{className:"pointer-events-none absolute left-1/2 top-3 z-10 -translate-x-1/2 rounded-full bg-surface-elevated px-3 py-1 text-xs font-semibold tabular-nums text-foreground shadow-md",children:n("rightSidebar.videoLongPressSpeed")}),Q&&V!==null&&o.jsx("div",{className:"pointer-events-none absolute bottom-1 z-10 -translate-x-1/2 rounded-md bg-surface-elevated px-2 py-1 text-[11px] font-medium text-foreground shadow-md",style:{left:`${ae*100}%`},"data-testid":"file-preview-video-scrub-time",children:Fx(V)})]}),o.jsx("div",{"data-testid":"file-preview-video-controls",className:`shrink-0 border-t border-border/60 bg-background px-2 py-1.5 ${c9}`,[u9]:"",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("button",{type:"button",onClick:st,"aria-label":n(C?"rightSidebar.videoPause":"rightSidebar.videoPlay"),title:n(C?"rightSidebar.videoPause":"rightSidebar.videoPlay"),className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-foreground transition hover:bg-surface-elevated active:scale-95","data-testid":"file-preview-video-play",children:C?o.jsx(tM,{size:14}):o.jsx(h8,{size:14})}),o.jsxs("div",{ref:l,role:"slider","aria-label":"Seek","aria-valuemin":0,"aria-valuemax":Math.floor(j),"aria-valuenow":Math.floor(Ze),tabIndex:0,className:"group relative h-5 min-w-0 flex-1 cursor-pointer touch-none py-2","data-testid":"file-preview-video-track",onPointerDown:K,onPointerMove:Te=>{Q&&we(Te.clientX)},onPointerUp:nt,onPointerCancel:nt,onKeyDown:$e,children:[o.jsx("div",{className:"h-1 w-full rounded-full bg-surface-elevated"}),o.jsx("div",{className:"absolute inset-y-0 left-0 my-auto h-1 rounded-full bg-primary",style:{width:`${ae*100}%`}}),o.jsx("div",{className:"absolute top-1/2 h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary shadow",style:{left:`${ae*100}%`}})]}),o.jsxs("div",{className:"shrink-0 text-[11px] tabular-nums text-muted-foreground","data-testid":"file-preview-video-time",children:[Fx(Ze)," / ",Fx(j)]}),o.jsx("button",{type:"button",onClick:je,"aria-label":n("rightSidebar.videoRotate"),title:n("rightSidebar.videoRotate"),className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-foreground transition hover:bg-surface-elevated active:scale-95","data-testid":"file-preview-video-rotate",children:o.jsx(pM,{size:14})}),o.jsx("button",{type:"button",onClick:()=>{de()},"aria-label":n(ie?"rightSidebar.videoFullscreenExit":"rightSidebar.videoFullscreenEnter"),title:n(ie?"rightSidebar.videoFullscreenExit":"rightSidebar.videoFullscreenEnter"),className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-foreground transition hover:bg-surface-elevated active:scale-95","data-testid":"file-preview-video-fullscreen",children:ie?o.jsx(UN,{size:14}):o.jsx(FN,{size:14})})]})})]})}function YZ(e){const t=Math.max(0,Math.min(100,e.xPercent)),n=Math.max(0,Math.min(100,e.yPercent));return{...t<=50?{left:`calc(${t}% + 8px)`}:{right:`calc(${100-t}% + 8px)`},...n<=50?{top:`calc(${n}% + 8px)`}:{bottom:`calc(${100-n}% + 8px)`}}}function Ng({anchor:e,children:t,disabled:n=!1,onClick:r,title:s}){return o.jsxs("button",{type:"button","data-floating-annotation-button":!0,disabled:n,onClick:i=>{i.stopPropagation(),r()},title:s,style:YZ(e),className:"absolute z-30 inline-flex h-7 items-center gap-1 rounded-full bg-primary px-3 text-[11px] font-semibold text-primary-foreground shadow-lg ring-1 ring-primary/30 transition hover:bg-primary/90 active:scale-95 disabled:cursor-wait disabled:opacity-50",children:[o.jsx(Al,{size:11}),t]})}function KZ(e,t,n,r){if(n.width<=0||n.height<=0||r.width<=0||r.height<=0)return null;const s=Math.min(n.width/r.width,n.height/r.height);if(!Number.isFinite(s)||s<=0)return null;const i=r.width*s,l=r.height*s,c=n.left+(n.width-i)/2,u=n.top+(n.height-l)/2,f=e-c,p=t-u;if(f<0||p<0||f>i||p>l)return null;const g=f/i*100,y=p/l*100;return{x:r.x+r.width*g/100,y:r.y+r.height*y/100,xPercent:g,yPercent:y}}function XZ(e,t,n){const r=[`SVG标注: ${e}`,`视图: ${t}`,`SVG坐标: (${n.x.toFixed(2)},${n.y.toFixed(2)}) [viewBox坐标]`,`图片位置: (${n.xPercent.toFixed(1)}%,${n.yPercent.toFixed(1)}%) [相对内容边界左上角]`];return n.nearestText&&r.push(`最近文字: ${n.nearestText}`),`"${r.join(" / ")}"`}function ZZ(e){const t=new DOMParser().parseFromString(e,"image/svg+xml"),n=t.documentElement;if(n.nodeName.toLowerCase()!=="svg"||t.querySelector("parsererror"))throw new Error("Invalid SVG document");return t.querySelectorAll("script,foreignObject,iframe,object,embed").forEach(r=>r.remove()),t.querySelectorAll("*").forEach(r=>{for(const s of Array.from(r.attributes)){const i=s.name.toLowerCase(),l=s.value.trim();(i.startsWith("on")||(i==="href"||i.endsWith(":href"))&&l&&!l.startsWith("#"))&&r.removeAttribute(s.name)}}),n.removeAttribute("width"),n.removeAttribute("height"),n.setAttribute("preserveAspectRatio","xMidYMid meet"),new XMLSerializer().serializeToString(n)}function JZ(e,t,n){let r=null;for(const s of Array.from(e.querySelectorAll("text"))){const i=(s.textContent??"").replace(/\s+/g," ").trim();if(!i)continue;const l=Number(s.getAttribute("x")),c=Number(s.getAttribute("y"));if(!Number.isFinite(l)||!Number.isFinite(c))continue;const u=Math.hypot(l-t,c-n);(!r||u<r.distance)&&(r={text:i,distance:u})}return r?.text.slice(0,120)}function mT({blobUrl:e,filePath:t,viewLabel:n,onInsertAnnotation:r}){const s=b.useRef(null),i=b.useRef(null),[l,c]=b.useState(null),[u,f]=b.useState(null),[p,g]=b.useState(1),[y,v]=b.useState(!1),[S,A]=b.useState(null),T=b.useRef(new Map),L=b.useRef(null),I=b.useRef(!1),j=b.useRef(null),P=b.useRef(p);P.current=p,b.useEffect(()=>{const ie=new AbortController;return c(null),f(null),A(null),g(1),fetch(e,{signal:ie.signal}).then(G=>G.text()).then(G=>c(ZZ(G))).catch(G=>{ie.signal.aborted||f(G instanceof Error?G.message:"SVG preview failed")}),()=>ie.abort()},[e]),b.useEffect(()=>{if(!y)return;const ie=G=>{G.key==="Escape"&&v(!1)};return window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)},[y]),b.useLayoutEffect(()=>{const ie=i.current,G=ie?.querySelector("[data-svg-document] > svg");if(!ie||!G)return;let z;try{z=G.getBBox()}catch{return}if(!z.width||!z.height)return;const X=Math.max(2,Math.min(z.width,z.height)*.025);G.setAttribute("viewBox",`${z.x-X} ${z.y-X} ${z.width+2*X} ${z.height+2*X}`),G.style.width=`${p*100}%`,G.style.height=`${p*100}%`,G.style.minWidth=`${p*100}%`,G.style.minHeight=`${p*100}%`,G.style.display="block"},[l,p]);const F=b.useMemo(()=>S?XZ(t,n,S):null,[t,S,n]),R=ie=>{if(I.current){I.current=!1;return}const G=i.current,z=G?.querySelector("[data-svg-document] > svg"),X=s.current;if(!G||!z||!X)return;const oe=z.viewBox.baseVal,ge=KZ(ie.clientX,ie.clientY,z.getBoundingClientRect(),oe);if(!ge)return;const Ee=X.getBoundingClientRect();A({...ge,nearestText:JZ(z,ge.x,ge.y),stageX:ie.clientX-Ee.left,stageY:ie.clientY-Ee.top,stageXPercent:(ie.clientX-Ee.left)/Ee.width*100,stageYPercent:(ie.clientY-Ee.top)/Ee.height*100})},C=ie=>Math.max(1,Math.min(12,ie)),$=(ie,G)=>{const z=C(G),X=ie.querySelector("[data-svg-document] > svg");if(!X)return z;const oe=`${z*100}%`;return X.style.width=oe,X.style.height=oe,X.style.minWidth=oe,X.style.minHeight=oe,P.current=z,z},Q=(ie,G,z,X)=>{const oe=P.current,ge=ie.getBoundingClientRect(),Ee=z-ge.left,pe=X-ge.top,we=(ie.scrollLeft+Ee)/oe,ve=(ie.scrollTop+pe)/oe,K=$(ie,G);return ie.scrollLeft=we*K-Ee,ie.scrollTop=ve*K-pe,K},q=()=>{const ie=Array.from(T.current.values());return ie.length>=2?Math.hypot(ie[0].x-ie[1].x,ie[0].y-ie[1].y):0},V=ie=>{if(ie.pointerType==="mouse"&&ie.button!==0)return;const G=i.current;G&&(T.current.set(ie.pointerId,{x:ie.clientX,y:ie.clientY}),G.setPointerCapture?.(ie.pointerId),T.current.size>=2?(L.current={kind:"pinch",startX:ie.clientX,startY:ie.clientY,startScrollLeft:G.scrollLeft,startScrollTop:G.scrollTop,startDistance:q(),startZoom:P.current,moved:!1},I.current=!0):P.current>1&&(L.current={kind:"pan",startX:ie.clientX,startY:ie.clientY,startScrollLeft:G.scrollLeft,startScrollTop:G.scrollTop,startZoom:P.current,moved:!1}))},he=ie=>{if(!T.current.has(ie.pointerId))return;T.current.set(ie.pointerId,{x:ie.clientX,y:ie.clientY});const G=i.current,z=L.current;if(!(!G||!z)){if(T.current.size>=2&&z.kind==="pinch"){const X=q();if(!z.startDistance||!X)return;const oe=C(z.startZoom*X/z.startDistance);if(Math.abs(oe-P.current)<.01)return;const ge=Array.from(T.current.values()),Ee=(ge[0].x+ge[1].x)/2,pe=(ge[0].y+ge[1].y)/2;z.moved=!0,I.current=!0,Q(G,oe,Ee,pe),ie.preventDefault();return}if(z.kind==="pan"&&T.current.size===1){const X=ie.clientX-z.startX,oe=ie.clientY-z.startY;if(!z.moved&&Math.hypot(X,oe)<6)return;z.moved=!0,I.current=!0,G.scrollLeft=z.startScrollLeft-X,G.scrollTop=z.startScrollTop-oe,ie.preventDefault()}}},ee=ie=>{const G=i.current,z=L.current,X=T.current.size===1&&!z?.moved;T.current.delete(ie.pointerId);try{G?.releasePointerCapture?.(ie.pointerId)}catch{}if(T.current.size===1&&z?.kind==="pinch"){const Ee=Array.from(T.current.values())[0];L.current=G?{kind:"pan",startX:Ee.x,startY:Ee.y,startScrollLeft:G.scrollLeft,startScrollTop:G.scrollTop,startZoom:P.current,moved:!1}:null;return}if(T.current.size>0||(L.current=null,z?.kind==="pinch"&&g(P.current),!X||I.current))return;const oe=Date.now(),ge=j.current;ge&&oe-ge.time<350&&Math.hypot(ie.clientX-ge.x,ie.clientY-ge.y)<24?(j.current=null,I.current=!0,g(Ee=>Ee>1?1:2.5)):j.current={time:oe,x:ie.clientX,y:ie.clientY}},me=ie=>{if(!ie.ctrlKey&&!ie.metaKey)return;const G=i.current;if(!G)return;ie.preventDefault();const z=Q(G,P.current*Math.exp(-ie.deltaY*.01),ie.clientX,ie.clientY);g(z)},ye=()=>{g(1),P.current=1,i.current&&(i.current.scrollLeft=0,i.current.scrollTop=0)},ue=o.jsxs("div",{className:y?"fixed inset-0 z-modal-panel flex min-h-0 flex-col bg-surface pt-[env(safe-area-inset-top,0px)]":"flex h-full min-h-0 flex-col bg-surface",children:[o.jsxs("div",{ref:s,className:"relative min-h-0 flex-1",children:[o.jsx("div",{ref:i,role:"button",tabIndex:0,onClick:R,onDoubleClick:ie=>{ie.preventDefault(),g(G=>G>1?1:2.5)},onPointerDown:V,onPointerMove:he,onPointerUp:ee,onPointerCancel:ee,onWheel:me,onScroll:()=>A(null),className:"h-full touch-none cursor-crosshair overflow-auto bg-white p-3 text-slate-900",children:u?o.jsx("div",{className:"p-4 text-sm text-destructive",children:u}):l?o.jsx("div",{"data-svg-document":!0,className:"h-full min-h-[240px] w-full",dangerouslySetInnerHTML:{__html:l}}):o.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Loading SVG…"})}),S&&o.jsx("span",{"data-svg-pick-marker":!0,className:"pointer-events-none absolute z-10 h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-primary bg-white shadow-sm",style:{left:S.stageX,top:S.stageY}}),S&&F&&o.jsx(Ng,{anchor:{xPercent:S.stageXPercent,yPercent:S.stageYPercent},title:"引用 SVG 标注",onClick:()=>{r?.(F,`svg:${S.x.toFixed(2)}:${S.y.toFixed(2)}`),A(null)},children:"引用 SVG 标注"}),o.jsxs("div",{"data-svg-toolbar":!0,className:"absolute right-2 top-2 z-20 flex gap-1",children:[p>1.001&&o.jsx("button",{type:"button","aria-label":"适合窗口",title:"适合窗口",onClick:ie=>{ie.stopPropagation(),ye()},className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-slate-200 bg-white/95 text-slate-600 shadow-sm backdrop-blur transition active:scale-95",children:o.jsx(xM,{size:14})}),o.jsx("button",{type:"button","aria-label":y?"退出全屏 SVG":"全屏 SVG",title:y?"退出全屏 SVG":"全屏 SVG",onClick:ie=>{ie.stopPropagation(),v(G=>!G)},className:"inline-flex h-9 w-9 items-center justify-center rounded-full border border-slate-200 bg-white/95 text-slate-600 shadow-sm backdrop-blur transition active:scale-95",children:y?o.jsx(X2,{size:14}):o.jsx(K2,{size:14})})]})]}),o.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 border-t border-border/15 px-3 py-2",children:o.jsx("span",{className:"min-w-0 truncate text-[11px] text-muted-foreground",children:S?`SVG (${S.x.toFixed(2)}, ${S.y.toFixed(2)}) · ${S.nearestText??"附近无文字"}`:"点击 SVG 的问题位置生成精确引用"})})]});return y?oa.createPortal(ue,document.body):ue}function hm(e){switch(e){case"schematic":return"原理图第1页";case"pcb-front":return"PCB正面";case"pcb-back":return"PCB背面(镜像)";case"pcb-3d":return"PCB 3D正面"}}function eJ(e,t,n,r){const s=[`电子标注: ${e}`,`视图: ${hm(t)}`,`图片位置: (${n.xPercent.toFixed(1)}%,${n.yPercent.toFixed(1)}%) [相对渲染图左上角]`];if(r?.available&&r.xMm!==void 0&&r.yMm!==void 0&&(s.push(`PCB坐标: (${r.xMm.toFixed(2)},${r.yMm.toFixed(2)})mm [KiCad板坐标]`),r.layer&&s.push(`显示层: ${r.layer}`),r.nearest)){const i=[r.nearest.net?`网络 ${r.nearest.net}`:null,`对象层 ${r.nearest.layer}`,`距离 ${r.nearest.distanceMm.toFixed(2)}mm`].filter(Boolean).join(",");s.push(`最近对象: ${r.nearest.label}${i?`(${i})`:""}`)}return`"${s.join(" / ")}"`}function tJ({blobUrl:e,filePath:t,view:n,board:r,onViewChange:s,onInsertAnnotation:i,onRefresh:l,interactive3d:c}){const{t:u}=Vn(),f=b.useRef(null),p=b.useRef(null),g=b.useRef(null),[y,v]=b.useState(null),[S,A]=b.useState(!1);b.useEffect(()=>(g.current?.abort(),v(null),A(!1),()=>g.current?.abort()),[e,n]);const T=b.useMemo(()=>y?eJ(t,n,y,y.inspection):null,[t,y,n]),L=j=>{const P=f.current,F=p.current;if(!P||!F||!F.naturalWidth||!F.naturalHeight)return;const R=P.getBoundingClientRect(),C=Math.min(R.width/F.naturalWidth,R.height/F.naturalHeight),$=F.naturalWidth*C,Q=F.naturalHeight*C,q=R.left+(R.width-$)/2,V=R.top+(R.height-Q)/2,he=j.clientX-q,ee=j.clientY-V;if(he<0||ee<0||he>$||ee>Q)return;const me={xPercent:Math.max(0,Math.min(100,he/$*100)),yPercent:Math.max(0,Math.min(100,ee/Q*100)),stageXPercent:(j.clientX-R.left)/R.width*100,stageYPercent:(j.clientY-R.top)/R.height*100,inspecting:r&&n!=="pcb-3d"};if(v(me),g.current?.abort(),!me.inspecting)return;const ye=new AbortController;g.current=ye,rI(t,n,me.xPercent,me.yPercent,ye.signal).then(ue=>v(ie=>ie===me?{...ie,inspection:ue,inspecting:!1}:ie)).catch(()=>{ye.signal.aborted||v(ue=>ue===me?{...ue,inspection:{available:!1},inspecting:!1}:ue)})},I=r?["pcb-front","pcb-back","pcb-3d"]:["schematic"];return o.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-surface",children:[o.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-border/15 px-3 py-2",children:[o.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto",children:I.map(j=>o.jsx("button",{type:"button",onClick:()=>s(j),className:`h-8 shrink-0 rounded-full px-3 text-xs font-semibold transition active:scale-95 ${j===n?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground hover:bg-surface-elevated hover:text-foreground"}`,children:hm(j)},j))}),o.jsx("button",{type:"button",onClick:l,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-surface-2 text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground active:scale-95",title:u("rightSidebar.edaRefresh"),"aria-label":u("rightSidebar.edaRefresh"),children:o.jsx(fi,{size:13})})]}),r&&c?o.jsx("div",{className:n==="pcb-3d"?"flex min-h-0 flex-1 flex-col overflow-hidden":"hidden",children:c}):null,r?n==="pcb-3d"?c?null:o.jsx("div",{className:"min-h-0 flex-1"}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{ref:f,role:"button",tabIndex:0,onClick:L,onKeyDown:j=>{j.key!=="Enter"&&j.key!==" "||(j.preventDefault(),v({xPercent:50,yPercent:50,stageXPercent:50,stageYPercent:50}))},className:"relative min-h-0 flex-1 cursor-crosshair overflow-hidden bg-surface p-3 outline-none",title:u("rightSidebar.edaPickHint"),children:[o.jsx("img",{ref:p,src:e,alt:`${t} ${hm(n)}`,onLoad:()=>A(!0),className:`pointer-events-none h-full w-full object-contain transition-opacity ${S?"opacity-100":"opacity-0"}`}),y&&o.jsx("span",{className:"pointer-events-none absolute h-4 w-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-primary bg-surface shadow-sm",style:{left:`${y.stageXPercent}%`,top:`${y.stageYPercent}%`}}),y&&T&&o.jsx(Ng,{anchor:{xPercent:y.stageXPercent,yPercent:y.stageYPercent},disabled:y.inspecting,title:u("rightSidebar.edaInsertAnnotation"),onClick:()=>{i?.(T,`eda:${n}:${y.xPercent.toFixed(1)}:${y.yPercent.toFixed(1)}`),v(null)},children:u("rightSidebar.edaInsertAnnotation")})]}),o.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 border-t border-border/15 px-3 py-2",children:o.jsx("span",{className:"min-w-0 truncate text-[11px] text-muted-foreground",children:y?y.inspecting?u("rightSidebar.edaInspecting"):y.inspection?.available?u("rightSidebar.edaPickedBoardPosition",{x:y.inspection.xMm?.toFixed(2)??"—",y:y.inspection.yMm?.toFixed(2)??"—",object:y.inspection.nearest?.label??u("rightSidebar.edaNoNearbyObject")}):u("rightSidebar.edaPickedPosition",{x:y.xPercent.toFixed(1),y:y.yPercent.toFixed(1)}):u("rightSidebar.edaPickHint")})})]}):o.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:o.jsx(mT,{blobUrl:e,filePath:t,viewLabel:hm(n),onInsertAnnotation:i})})]})}function nJ(e){const t=[];let n=[],r="",s=!1;for(let i=0;i<e.length;i+=1){const l=e[i];s?l==='"'&&e[i+1]==='"'?(r+='"',i+=1):l==='"'?s=!1:r+=l:l==='"'?s=!0:l===","?(n.push(r),r=""):l===`
|
|
178
178
|
`?(n.push(r.replace(/\r$/,"")),t.push(n),n=[],r=""):r+=l}return(r||n.length>0)&&(n.push(r.replace(/\r$/,"")),t.push(n)),t}function rJ(e,t,n,r,s){const i=t[s]||`第${s+1}列`,l=n[s]??"",c=t.map((u,f)=>`${u||`第${f+1}列`}=${n[f]??""}`).join(";");return`"表格标注: ${e} / 数据行: ${r+1} / 列: ${i} / 值: ${l} / 记录: ${c}"`}function sJ({content:e,filePath:t,onInsertAnnotation:n}){const{t:r}=Vn(),s=b.useMemo(()=>nJ(e),[e]),i=s[0]??[],l=s.slice(1),c=b.useRef(null),[u,f]=b.useState(null),p=u?l[u.row]:null,g=u&&p?rJ(t,i,p,u.row+1,u.column):null;return o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col bg-surface",children:[o.jsxs("div",{ref:c,className:"relative min-h-0 flex-1",children:[o.jsx("div",{className:"h-full overflow-auto",children:o.jsxs("table",{className:"min-w-full border-separate border-spacing-0 text-left text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"sticky left-0 top-0 z-20 border-b border-r border-border/20 bg-surface-elevated px-2 py-2 text-[10px] font-semibold text-muted-foreground",children:"#"}),i.map((y,v)=>o.jsx("th",{className:"sticky top-0 z-10 min-w-28 border-b border-r border-border/20 bg-surface-elevated px-3 py-2 font-semibold text-foreground",children:y||r("rightSidebar.csvUnnamedColumn",{index:v+1})},`${y}:${v}`))]})}),o.jsx("tbody",{children:l.map((y,v)=>o.jsxs("tr",{className:"hover:bg-surface-2",children:[o.jsx("th",{className:"sticky left-0 z-10 border-b border-r border-border/15 bg-surface px-2 py-2 text-right text-[10px] font-normal text-muted-foreground",children:v+1}),i.map((S,A)=>{const T=u?.row===v&&u.column===A;return o.jsx("td",{className:`border-b border-r border-border/15 p-0 ${T?"bg-primary/15":""}`,children:o.jsx("button",{type:"button",onClick:L=>{const I=c.current?.getBoundingClientRect(),j=L.currentTarget.getBoundingClientRect();if(!I?.width||!I.height)return;const P=L.clientX||j.left+j.width/2,F=L.clientY||j.top+j.height/2;f({row:v,column:A,xPercent:(P-I.left)/I.width*100,yPercent:(F-I.top)/I.height*100})},className:"block h-full min-h-9 w-full whitespace-pre-wrap px-3 py-2 text-left text-foreground outline-none hover:bg-primary/10 focus-visible:bg-primary/10",children:y[A]||" "})},`cell:${v}:${A}`)})]},`row:${v}`))})]})}),u&&g&&o.jsx(Ng,{anchor:{xPercent:u.xPercent,yPercent:u.yPercent},title:r("rightSidebar.csvInsertAnnotation"),onClick:()=>{n?.(g,`csv:${t}:${u.row+1}:${u.column+1}`),f(null)},children:r("rightSidebar.csvInsertAnnotation")})]}),o.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 border-t border-border/15 px-3 py-2",children:o.jsx("span",{className:"min-w-0 truncate text-[11px] text-muted-foreground",children:u&&p?r("rightSidebar.csvSelectedCell",{row:u.row+1,column:i[u.column]||u.column+1}):r("rightSidebar.csvPickHint",{rows:l.length,columns:i.length})})})]})}function Td(e,t){let n=e;for(const r of t){if(!n||typeof n!="object")return;n=n[r]}return n}function iJ(e,t){const n=JSON.parse(e),r=Td(n,["meta","version"]);if(t)return[{label:"文件性质",value:"KiCad 本机界面状态,不属于电气设计源文件"},{label:"格式版本",value:String(r??"未知")},{label:"活动层编号",value:String(Td(n,["board","active_layer"])??"未知")},{label:"可见层掩码",value:String(Td(n,["board","visible_layers"])??"未知")},{label:"Git 集成",value:Td(n,["git","integration_disabled"])===!0?"已禁用":"未禁用"}];const s=Td(n,["net_settings","classes"]),i=Array.isArray(s)?s.find(c=>c&&typeof c=="object"&&c.name==="Default"):void 0,l=Td(n,["board","design_settings","drc_exclusions"]);return[{label:"文件性质",value:"KiCad 工程配置"},{label:"格式版本",value:String(r??"未知")},{label:"网络类数量",value:String(Array.isArray(s)?s.length:0)},{label:"默认间距",value:i?.clearance!==void 0?`${i.clearance} mm`:"未设置"},{label:"默认线宽",value:i?.track_width!==void 0?`${i.track_width} mm`:"未设置"},{label:"默认过孔",value:i?.via_diameter!==void 0?`${i.via_diameter} / ${i.via_drill??"—"} mm(外径/钻孔)`:"未设置"},{label:"DRC 排除项",value:String(Array.isArray(l)?l.length:0)}]}function oJ(e,t){return`"KiCad项目标注: ${e} / 项: ${t.label} / 值: ${t.value}"`}function aJ({content:e,filePath:t,localState:n,onInsertAnnotation:r}){const{t:s}=Vn(),i=b.useRef(null),[l,c]=b.useState(null),u=b.useMemo(()=>{try{return{items:iJ(e,n),error:null}}catch(p){return{items:[],error:p instanceof Error?p.message:String(p)}}},[e,n]),f=l===null?null:u.items[l.index];return u.error?o.jsx("pre",{className:"min-h-0 flex-1 overflow-auto whitespace-pre-wrap p-3 font-mono text-xs text-foreground",children:e}):o.jsxs("div",{className:"flex min-h-0 flex-1 flex-col bg-surface",children:[n&&o.jsx("div",{className:"border-b border-[color:var(--warning)]/20 bg-[color:var(--warning)]/5 px-3 py-2 text-xs text-[color:var(--warning)]",children:s("rightSidebar.kicadLocalStateNotice")}),o.jsxs("div",{ref:i,className:"relative min-h-0 flex-1",children:[o.jsxs("div",{className:"h-full overflow-auto px-3 py-2",children:[o.jsx("div",{className:"divide-y divide-border/15",children:u.items.map((p,g)=>o.jsxs("button",{type:"button",onClick:y=>{const v=i.current?.getBoundingClientRect(),S=y.currentTarget.getBoundingClientRect();if(!v?.width||!v.height)return;const A=y.clientX||S.left+S.width/2,T=y.clientY||S.top+S.height/2;c({index:g,xPercent:(A-v.left)/v.width*100,yPercent:(T-v.top)/v.height*100})},className:`grid w-full grid-cols-[minmax(7rem,0.8fr)_minmax(0,1.4fr)] gap-3 px-2 py-3 text-left transition hover:bg-surface-2 ${l?.index===g?"bg-primary/10":""}`,children:[o.jsx("span",{className:"text-xs font-semibold text-muted-foreground",children:p.label}),o.jsx("span",{className:"break-words text-xs text-foreground",children:p.value})]},p.label))}),o.jsxs("details",{className:"mt-3 border-t border-border/15 pt-3",children:[o.jsx("summary",{className:"cursor-pointer text-xs font-semibold text-muted-foreground",children:s("rightSidebar.kicadShowRawJson")}),o.jsx("pre",{className:"mt-2 overflow-auto whitespace-pre p-2 font-mono text-[10px] leading-relaxed text-foreground",children:e})]})]}),f&&l&&o.jsx(Ng,{anchor:{xPercent:l.xPercent,yPercent:l.yPercent},title:s("rightSidebar.kicadInsertSetting"),onClick:()=>{r?.(oJ(t,f),`kicad-project:${t}:${f.label}`),c(null)},children:s("rightSidebar.kicadInsertSetting")})]}),o.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 border-t border-border/15 px-3 py-2",children:o.jsx("span",{className:"min-w-0 truncate text-[11px] text-muted-foreground",children:f?`${f.label}: ${f.value}`:s("rightSidebar.kicadProjectPickHint")})})]})}const lJ=b.forwardRef(function({src:t,title:n,exitFullscreenLabel:r,onFullscreenChange:s},i){const l=b.useRef(null),[c,u]=b.useState(!1),[f,p]=b.useState(!1),g=c||f;b.useEffect(()=>{s?.(g)},[g,s]),b.useEffect(()=>{const S=()=>{u(document.fullscreenElement===l.current)};return document.addEventListener("fullscreenchange",S),()=>document.removeEventListener("fullscreenchange",S)},[]),b.useEffect(()=>{if(!f)return;const S=A=>{A.key==="Escape"&&p(!1)};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[f]);const y=b.useCallback(async()=>{const S=l.current;if(S){if(f){p(!1);return}if(document.fullscreenElement===S){await document.exitFullscreen();return}if(S.requestFullscreen&&document.fullscreenEnabled!==!1)try{await S.requestFullscreen();return}catch{}p(!0)}},[f]);b.useImperativeHandle(i,()=>({toggleFullscreen:y}),[y]);const v=o.jsxs("div",{ref:l,"data-html-preview-frame":!0,className:g?"fixed inset-0 z-modal-panel flex min-h-0 flex-col overflow-hidden bg-surface pt-[env(safe-area-inset-top,0px)] text-foreground":"flex h-full min-h-0 flex-col overflow-hidden bg-surface",children:[g&&o.jsxs("div",{className:"flex h-12 shrink-0 items-center justify-between gap-3 border-b border-border/15 bg-[var(--chrome-bg)] px-3",children:[o.jsx("span",{className:"min-w-0 truncate text-[12px] font-semibold",children:n}),o.jsx("button",{type:"button",onClick:()=>{y()},"aria-label":r,title:`${r} (Esc)`,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-surface-2 text-muted-foreground transition hover:bg-surface-elevated hover:text-foreground active:scale-95",children:o.jsx(X2,{size:15})})]}),o.jsx("iframe",{src:t,title:n,sandbox:"allow-scripts",className:"block min-h-0 w-full flex-1 border-0 bg-white"})]});return f?oa.createPortal(v,document.body):v}),gT="termdock-file-search-match",S2="termdock-file-search-current";function cJ(e){const t=e.metaKey||e.ctrlKey,n=e.key.toLocaleLowerCase();return t&&n==="f"?"open":t&&n==="g"||e.key==="F3"?e.shiftKey?"previous":"next":e.key==="Escape"?"close":null}function uJ(e){return e.parentElement?.closest("[data-markdown-preview-block-start], [data-file-preview-line]")??null}function dJ(e,t){const n=t.trim().toLocaleLowerCase();if(!n)return[];const r=[];let s="",i=null;const l=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let p=l.nextNode();p;p=l.nextNode()){if(!(p instanceof Text)||!p.data)continue;const g=uJ(p);if(!g)continue;i&&i!==g&&(s+=`
|
|
179
|
-
`);const y=s.length;s+=p.data,r.push({node:p,start:y,end:s.length,group:g}),i=g}const c=s.toLocaleLowerCase(),u=[];let f=0;for(;f<=c.length-n.length;){const p=c.indexOf(n,f);if(p<0)break;const g=p+n.length,y=r.find(S=>S.start<=p&&S.end>p),v=r.find(S=>S.start<g&&S.end>=g);if(y&&v&&y.group===v.group){const S=document.createRange();S.setStart(y.node,p-y.start),S.setEnd(v.node,g-v.start),u.push(S)}f=p+Math.max(n.length,1)}return u}function xT(){return typeof CSS<"u"&&CSS.highlights?CSS.highlights:null}function Bp(){const e=xT();e?.delete(gT),e?.delete(S2)}function g4(e,t){const n=xT();if(!n||typeof Highlight>"u")return;n.set(gT,new Highlight(...e));const r=e[t];r?n.set(S2,new Highlight(r)):n.delete(S2)}function x4(e){e?.startContainer.parentElement?.scrollIntoView({block:"center",inline:"nearest",behavior:"smooth"})}const Ky="termdock:right-sidebar:file-tree-scroll:v1",Xy="termdock:right-sidebar:file-preview-reading-state:v1",Sf="termdock:right-sidebar:file-tree-width:v1",bT="termdock:right-sidebar:markdown-view-mode:v1",yT="termdock:right-sidebar:diff-change-list-mode:v1",vT="termdock:right-sidebar:diff-wrap:v1",wT="termdock:diff-viewer:view-type:v1",ST="termdock:right-sidebar:file-search-mode:v1",Ox="termdock:right-sidebar:collapsed-git-repo-groups:v1",b4="termdock:right-sidebar:collapsed-diff-directories:v1",Qx="termdock:right-sidebar:branch-audit-module-open:v1",AT="termdock:right-sidebar:branch-audit-module:v1",fJ=150,TT="termdock:right-sidebar:active-git-repo:v1",y4="termdock:right-sidebar:context-draft-enabled:v1",v4="termdock:right-sidebar:context-draft-collapsed:v1",w4="termdock:right-sidebar:context-draft-auto-collapse:v1",$x="termdock:right-sidebar:context-draft-text:v1",hJ=300,pJ=20,mJ=120,gJ=250,xJ=250,bJ=120,yJ=700,Hx=600,S4=[2e3,5e3,15e3,3e4],vJ=320,wJ=500,SJ=20,AJ=12e3,A2=300,A4=240,TJ=560,CT="border-r px-2 py-1.5 sm:px-3 sm:py-2",Xm="max-w-[18rem] whitespace-normal break-words sm:max-w-[27rem]",kT=`${CT} border-b border-border/15 font-semibold last:border-r-0`,_T=`${CT} border-border/10 align-top text-muted-foreground last:border-r-0`,Zy="termdock-file-preview-horizontal-scroll",T4=b.lazy(()=>o0(()=>import("./ModelPreview-aRiv3VyI.js"),__vite__mapDeps([2,3,1,4]))),LT=`${Zy} termdock-md-table-scroll max-w-full overflow-x-auto overflow-y-hidden rounded-lg border border-border/20 bg-surface`,CJ=new Set([".md",".markdown",".mdown",".mkdn",".mkd"]);function kJ(e){return e==="preview"||e==="source"}function _J(e){return e==="list"||e==="tree"||e==="ai"}function C4(){return Or(bT,kJ)??"preview"}function LJ(){return Or(yT,_J)??"tree"}function Af(e){return typeof e=="boolean"}function EJ(e){return typeof e=="string"}function IJ(){return Or(vT,Af)??!0}function RJ(e){return e==="unified"||e==="split"}function NJ(){return Or(wT,RJ)??"unified"}function MJ(e){return e==="name"||e==="content"||e==="regex"}function DJ(){return Or(ST,MJ)??"name"}function jJ(e){return e.repositories??(e.context?.root?[{id:e.context.root,root:e.context.root,relativeRoot:".",name:Bo(e.context.root)||e.context.root,depth:0,nested:!1,available:e.available,files:e.files,context:e.context,error:e.error}]:[])}function PJ(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.values(e).every(t=>t===null||typeof t=="string")}function ET(){return Or(TT,PJ)??{}}function k4(e){if(!e)return;const t=ET();return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function Ux(e,t){e&&Qn(TT,{...ET(),[e]:t})}function BJ(e,t){if(!t)return null;const n=new Set((e.repoFilters??[]).map(r=>r.root));return n.has(t)?t:n.size>0?null:(e.repositories??[]).some(r=>r.root===t)?t:null}function T2(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function _4(e){const t=Or(e,T2);return t?new Set(t):new Set}function zx(e,t){Qn(e,[...t])}function FJ(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.filePath=="string"&&typeof t.hunkHeader=="string"&&typeof t.hunkIndex=="number"&&typeof t.fingerprint=="string"&&typeof t.additions=="number"&&typeof t.deletions=="number"&&typeof t.diff=="string"&&(t.oldPath===void 0||t.oldPath===null||typeof t.oldPath=="string")&&(t.newPath===void 0||t.newPath===null||typeof t.newPath=="string")&&(t.source===void 0||t.source==="committed"||t.source==="uncommitted"||t.source==="unknown")&&(t.commit===void 0||t.commit===null||typeof t.commit=="string")}function OJ(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.available=="boolean"&&(t.repoRoot===void 0||typeof t.repoRoot=="string")&&(t.workspaceRoot===void 0||typeof t.workspaceRoot=="string")&&(t.baseRef===void 0||typeof t.baseRef=="string")&&(t.baseBranch===void 0||typeof t.baseBranch=="string")&&(t.currentBranch===void 0||t.currentBranch===null||typeof t.currentBranch=="string")&&(t.headRef===void 0||t.headRef===null||typeof t.headRef=="string")&&(t.diffFingerprint===void 0||typeof t.diffFingerprint=="string")&&(t.stat===void 0||typeof t.stat=="string")&&(t.files===void 0||T2(t.files))&&(t.hunks===void 0||Array.isArray(t.hunks)&&t.hunks.every(FJ))&&(t.commits===void 0||T2(t.commits))&&(t.commitCount===void 0||typeof t.commitCount=="number")&&(t.diff===void 0||typeof t.diff=="string")&&(t.truncated===void 0||typeof t.truncated=="boolean")&&(t.error===void 0||typeof t.error=="string")}function QJ(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.key=="string"&&OJ(t.diff)&&typeof t.repoLabel=="string"&&typeof t.createdAt=="number"}function $J(e){return!e||typeof e!="object"||Array.isArray(e)?!1:Object.values(e).every(t=>{if(!t||typeof t!="object"||Array.isArray(t))return!1;const n=t;return Array.isArray(n.selectedRepoRoots)&&n.selectedRepoRoots.every(r=>typeof r=="string")&&!!n.repoTargetBranches&&typeof n.repoTargetBranches=="object"&&!Array.isArray(n.repoTargetBranches)&&Object.values(n.repoTargetBranches).every(r=>typeof r=="string")&&(n.repoBaseBranches===void 0||!!n.repoBaseBranches&&typeof n.repoBaseBranches=="object"&&!Array.isArray(n.repoBaseBranches)&&Object.values(n.repoBaseBranches).every(r=>typeof r=="string"))&&(n.previewEntries===void 0||Array.isArray(n.previewEntries)&&n.previewEntries.every(QJ))&&(n.selectedPreviewKey===void 0||n.selectedPreviewKey===null||typeof n.selectedPreviewKey=="string")&&(n.selectedPreviewFileKey===void 0||n.selectedPreviewFileKey===null||typeof n.selectedPreviewFileKey=="string")&&(n.previewDetailOpen===void 0||typeof n.previewDetailOpen=="boolean")&&(n.previewScrollTops===void 0||!!n.previewScrollTops&&typeof n.previewScrollTops=="object"&&!Array.isArray(n.previewScrollTops)&&Object.values(n.previewScrollTops).every(r=>typeof r=="number"))&&(n.previewMobileSlideIndex===void 0||typeof n.previewMobileSlideIndex=="number")&&(n.includeUncommitted===void 0||typeof n.includeUncommitted=="boolean")&&typeof n.updatedAt=="number"})}function L4(){return Or(AT,$J)??{}}function E4(e){return[e.repoRoot,e.baseRef,e.branchName??"",e.headRef??"",e.diffFingerprint??""].join("\0")}function I4(e){const t=e?.trim()??"",n=t.indexOf("/");return n>=0?t.slice(n+1):t}function IT(e,t){const n=e?.trim(),r=t?.trim();return!n||!r?!1:n===r||I4(n)===I4(r)}function R4(e){const t=e?.branch??null;return[e?.upstream,...e?.remoteBranches??[],...e?.branches??[]].find(r=>r&&!IT(r,t))??""}function C2(e,t){const n=Math.max(A4,t-320),r=Math.min(TJ,n);return Math.min(r,Math.max(A4,e))}function HJ(e){return typeof e=="number"&&Number.isFinite(e)}function UJ(e){return C2(Or(Sf,HJ)??A2,e)}function RT(e){const t=e.split(/[\\/]/).pop()??e,n=t.lastIndexOf(".");return n>=0?t.slice(n).toLowerCase():""}function lf(e){return CJ.has(RT(e))}function NT(e){const t=e.trim().replace(/\s+/g,"");return/^-{3,}$/.test(t)||/^\*{3,}$/.test(t)||/^_{3,}$/.test(t)}function k2(e){const t=e.trim();return/^#{1,6}\s+/.test(t)||NT(e)||/^>\s?/.test(t)||/^(```|~~~)/.test(t)||/^(?:[-+*]|\d+[.)])\s+/.test(t)}function zJ(e){const t=e.trim();return/^(https?:|mailto:|#|\/|\.\/|\.\.\/)/i.test(t)||!/^[a-z][a-z0-9+.-]*:/i.test(t)&&!/[<>]/.test(t)?t:null}const MT=b.createContext(null);function pm(e){return e.trim().replace(/\s+/g," ").toLowerCase()}function DT(e){return e.replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\[[^\]]*\]/g,"$1").replace(/[`*_~]/g,"").replace(/<[^>]+>/g,"").trim()}function jT(e){return e.replace(/\s+#+\s*$/,"").trim()}function _2(e,t){const r=DT(e).toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu,"").trim().replace(/\s+/g,"-")||"section",s=t.headingSlugCounts.get(r)??0;return t.headingSlugCounts.set(r,s+1),s===0?r:`${r}-${s}`}function N4(e){return DT(e)||e.trim()}function Zm(e){const t=e.match(/^\s{0,3}\[([^\]]+)\]:\s+(.+?)\s*$/);if(!t)return null;const n=E2(t[2]);return n?{id:pm(t[1]),definition:{href:n.href,title:n.title}}:null}function GJ(e){const t=new Map;for(const n of e){const r=Zm(n);r&&t.set(r.id,r.definition)}return t}function PT(e){return e.trim().toLowerCase()}function BT(e){const t=e.match(/^\s{0,3}\[\^([^\]]+)\]:\s+(.+)\s*$/);return t?{id:PT(t[1]),text:t[2]}:null}function WJ(e){const t=new Map;let n=null;for(const r of e){const s=BT(r);if(s){n=s.id,t.set(s.id,{id:s.id,text:s.text,index:t.size+1});continue}if(n&&/^\s{4,}\S/.test(r)){const i=t.get(n);i&&(i.text=`${i.text} ${r.trim()}`);continue}r.trim()&&(n=null)}return t}function VJ(e){const t=new Set;let n=!1;return e.forEach((r,s)=>{if(BT(r)){t.add(s),n=!0;return}if(n&&/^\s{4,}\S/.test(r)){t.add(s);return}r.trim()&&(n=!1)}),t}function qJ(e){const t=[...e];let n=0;const r=e[0]?.trim();if(r==="---"||r==="+++"){for(t[0]="",n=1;n<e.length&&e[n].trim()!==r;)t[n]="",n+=1;n<e.length&&(t[n]="",n+=1)}for(;n<e.length;){const s=e[n].trim();if(s.startsWith("<!--")){if(t[n]="",!s.includes("-->")){for(n+=1;n<e.length&&!e[n].includes("-->");)t[n]="",n+=1;n<e.length&&(t[n]="")}n+=1;continue}n+=1}return t}function FT(e){const t=e.replace(/\/+$/,""),n=t.lastIndexOf("/");return n<=0?n===0?"/":"":t.slice(0,n)}function Pf(e){const t=e.split(/[?#]/,1)[0],n=t.startsWith("/"),r=[];for(const i of t.split("/"))if(!(!i||i===".")){if(i===".."){r.length>0&&r.pop();continue}r.push(i)}return`${n?"/":""}${r.join("/")}`||(n?"/":".")}function YJ(e,t,n){const r=e.trim();if(!r||/^(?:https?:|mailto:|javascript:|data:|#)/i.test(r)||/^[a-z][a-z0-9+.-]*:/i.test(r))return null;const s=r.indexOf("#"),i=s>=0?r.slice(0,s):r,l=s>=0?r.slice(s+1):"",c=i.split("?",1)[0];if(!c)return null;let u,f=null;try{u=decodeURIComponent(c),f=l?decodeURIComponent(l):null}catch{return null}const p=n?Pf(n):null;let g;if(u.startsWith("/")){const y=p&&(u===p||u.startsWith(`${p}/`));g=Pf(p&&!y?`${p}/${u.slice(1)}`:u)}else{if(!t)return null;g=Pf(`${FT(t)}/${u}`)}return p&&g!==p&&!g.startsWith(`${p}/`)?null:{path:g,fragment:f,directory:/\/$/.test(c)}}function KJ(e,t,n){const r=e.trim();if(!r||/^(?:javascript|data):/i.test(r))return null;if(/^https?:\/\//i.test(r))return r;if(!$2(r.split(/[?#]/,1)[0]))return null;let s;if(r.startsWith("/")){const i=n&&(r===n||r.startsWith(`${n}/`));s=Pf(n&&!i?`${n}/${r.slice(1)}`:r)}else{if(!t)return null;s=Pf(`${FT(t)}/${r}`)}return`/api/terminal/fs/blob?path=${encodeURIComponent(s)}`}const L2=128,XJ=360,Gx=480;function Jy(e){try{return/\.svg(?=$|[?#&])/i.test(decodeURIComponent(e))}catch{return!1}}function ZJ(e,t,n,r){if(!t||!n)return null;let s,i;return Jy(e)?(i=Math.min(Math.max(n,L2),XJ),s=t*i/n):(s=t,i=n),r>0&&s>r&&(i=i*r/s,s=r),i>Gx&&(s=s*Gx/i,i=Gx),{width:Math.max(1,Math.round(s)),height:Math.max(1,Math.round(i))}}function JJ(e){if(!e.startsWith("/api/terminal/fs/blob?"))return null;try{return new URLSearchParams(e.slice(e.indexOf("?"))).get("path")}catch{return null}}function OT(e){const t=JJ(e),n=yt(r=>t?(r.fileChangeVersions.get(t)??0)+r.fileWatchEpoch:0);return t&&n>0?`${e}&v=${n}`:e}function eee({src:e,alt:t,title:n}){const r=Jy(e),s=OT(e),i=b.useRef(null),[l,c]=b.useState(!1),[u,f]=b.useState(0),[p,g]=b.useState({status:"loading"}),[y,v]=b.useState(null);b.useLayoutEffect(()=>{const T=i.current,L=T?.parentElement?.parentElement??T?.parentElement;if(!L)return;const I=()=>f(L.clientWidth);if(I(),typeof ResizeObserver>"u")return;const j=new ResizeObserver(I);return j.observe(L),()=>j.disconnect()},[]),b.useEffect(()=>{if(l)return;const T=i.current;if(!T||typeof IntersectionObserver>"u"){c(!0);return}const L=new IntersectionObserver(I=>{I.some(j=>j.isIntersecting)&&(c(!0),L.disconnect())},{rootMargin:"400px"});return L.observe(T),()=>L.disconnect()},[l]),b.useEffect(()=>{if(!l)return;const T=new AbortController;let L=null;g({status:"loading"});const I=window.setTimeout(()=>{T.abort(new DOMException("Image fetch timed out","TimeoutError"))},15e3);return fetch(s,{signal:T.signal}).then(async j=>{if(!j.ok)throw new Error(`HTTP ${j.status}`);const P=Number(j.headers.get("X-Image-Width"))||0,F=Number(j.headers.get("X-Image-Height"))||0;return{blob:await j.blob(),width:P,height:F}}).then(({blob:j,width:P,height:F})=>{T.signal.aborted||(L=URL.createObjectURL(j),P>0&&F>0&&v({width:P,height:F}),g({status:"ready",objectUrl:L}))}).catch(()=>{const j=T.signal.reason;T.signal.aborted&&!(j instanceof DOMException&&j.name==="TimeoutError")||g({status:"fallback"})}).finally(()=>{window.clearTimeout(I)}),()=>{window.clearTimeout(I),T.abort(),L&&URL.revokeObjectURL(L)}},[l,s]);const S=ZJ(e,y?.width??0,y?.height??0,u),A=S??{width:L2*2,height:L2};return o.jsx("div",{ref:i,className:"block max-w-full",style:S?{width:S.width,height:S.height}:void 0,children:p.status==="ready"?o.jsx("img",{src:p.objectUrl,alt:t,title:n,decoding:"async",className:`${r?"":"termdock-fade-in "}block max-h-[480px] max-w-full object-contain`,style:S?{width:S.width,height:S.height}:void 0,onLoad:T=>{if(y)return;const L=T.currentTarget;L.naturalWidth>0&&L.naturalHeight>0&&v({width:L.naturalWidth,height:L.naturalHeight})}}):p.status==="fallback"?o.jsx("img",{src:s,alt:t,title:n,loading:"lazy",decoding:"async",className:"block max-h-[480px] max-w-full object-contain",style:S?{width:S.width,height:S.height}:void 0,onLoad:T=>{if(y)return;const L=T.currentTarget;L.naturalWidth>0&&L.naturalHeight>0&&v({width:L.naturalWidth,height:L.naturalHeight})}}):o.jsx("div",{"aria-hidden":!0,className:"flex max-w-full animate-pulse items-center justify-center rounded bg-surface-elevated/60",style:{width:A.width,height:A.height},children:o.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:t||"…"})})})}function Wx(e,t,n,r,s){const i=KJ(n,s.markdownFilePath,s.rootPath);if(!i)return``;const l=s.images.length;s.images.push({kind:"image",src:i,alt:t,title:r});const c=o.jsx(eee,{src:i,alt:t,title:r});return s.onImageOpen?o.jsx("button",{type:"button",className:"my-2 block max-w-full overflow-hidden rounded-md border border-border/20 bg-surface-2 text-left transition hover:border-border-strong focus:outline-none focus:ring-2 focus:ring-ring/45",title:r||t||"Open image",onClick:u=>{u.stopPropagation(),s.onImageOpen?.(l)},children:c},e):o.jsx("span",{className:"my-2 block max-w-full overflow-hidden rounded-md border border-border/20 bg-surface-2",children:c},e)}function Vx(e){let t=e,n="";for(;/[.,;:!?)]$/.test(t);)n=`${t.slice(-1)}${n}`,t=t.slice(0,-1);return{linkText:t,suffix:n}}function M4(e){return/^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/.test(e)}function E2(e){const t=e.trim(),n=t.match(/^<([^>]+)>(?:\s+(?:"([^"]*)"|'([^']*)'|\(([^)]*)\)))?$/);if(n)return{href:n[1],title:n[2]??n[3]??n[4]};const r=t.match(/^(\S+)(?:\s+(?:"([^"]*)"|'([^']*)'|\(([^)]*)\)))?$/);return r?{href:r[1],title:r[2]??r[3]??r[4]}:null}const QT="",tee=/\\([\\`*{}\[\]#+\-.!_|~>$])/g;function nee(e){return e.replace(tee,(t,n)=>`${QT}${n.charCodeAt(0).toString(16).padStart(4,"0")}`)}function D4(e){return e.replace(new RegExp(`${QT}([0-9a-f]{4})`,"g"),(t,n)=>String.fromCharCode(Number.parseInt(n,16))).replace(/\\([()])/g,"$1")}function ree(e){const t=e.replace(/[\r\n]+/g," ");return/^ .+ $/.test(t)&&/[^ ]/.test(t.slice(1,-1))?t.slice(1,-1):t}const $T={ALLOWED_TAGS:["a","abbr","b","blockquote","br","code","del","details","div","em","i","kbd","li","mark","ol","p","pre","s","span","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"],ALLOWED_ATTR:["href","title","class","id","colspan","rowspan"],ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!0};let Fp=null;function HT(){return Fp||(Fp=o0(()=>import("./purify.es-CC4Brkr_.js"),[]).then(e=>e.default??e).catch(e=>{throw Fp=null,e})),Fp}function UT({html:e}){const{t}=Vn(),[n,r]=b.useState(null);return b.useEffect(()=>{let s=!1;return r(null),HT().then(i=>{s||r(i.sanitize(e,$T))}).catch(()=>{s||r("")}),()=>{s=!0}},[e]),n===null?o.jsx("div",{className:"py-2 text-xs text-muted-foreground",children:t("rightSidebar.renderingHtml")}):n?o.jsx("div",{className:"text-muted-foreground",dangerouslySetInnerHTML:{__html:n}}):null}function see({html:e}){const[t,n]=b.useState(null);return b.useEffect(()=>{let r=!1;return n(null),HT().then(s=>{r||n(s.sanitize(e,$T))}).catch(()=>{r||n("")}),()=>{r=!0}},[e]),t===null?null:t?o.jsx("span",{dangerouslySetInnerHTML:{__html:t}}):e}function zT(e){const t=e.trim().match(/^<(div|section|article|aside|table|p|ul|ol|li|blockquote|pre|figure|figcaption)\b[^>]*>/i);if(!t)return null;const n=t[1].toLowerCase();return{tag:n,selfContained:new RegExp(`</${n}>`,"i").test(e)}}let Op=null;function iee(){return Op||(Op=Promise.all([o0(()=>import("./katex-DnlPpQZa.js"),[]),o0(()=>Promise.resolve({}),__vite__mapDeps([5]))]).then(([e])=>e.default??e).catch(e=>{throw Op=null,e})),Op}function th({tex:e,display:t=!1}){const[n,r]=b.useState(null),[s,i]=b.useState(!1);if(b.useEffect(()=>{let c=!1;return r(null),i(!1),iee().then(u=>{c||r(u.renderToString(e,{displayMode:t,throwOnError:!1,trust:!1,strict:"ignore"}))}).catch(()=>{c||i(!0)}),()=>{c=!0}},[t,e]),s)return o.jsx("code",{className:"rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.92em] text-foreground",children:t?`$$${e}$$`:`$${e}$`});if(!n)return o.jsx("span",{className:"text-muted-foreground/70",children:t?"Rendering formula...":e});const l=t?"my-2 overflow-auto rounded-md bg-surface-2 px-3 py-2 text-center":"inline-block align-middle";return o.jsx("span",{className:l,dangerouslySetInnerHTML:{__html:n}})}function oee(e,t,n){if(/^<br\s*\/?>$/i.test(e))return o.jsx("br",{},t);const r=e.match(/^<(kbd|mark|sub|sup)>(.*?)<\/\1>$/i);if(!r)return/^<(a|abbr|span|b|strong|em|i|u|s|del|code)\b[\s\S]*<\/\1>$/i.test(e)?o.jsx(see,{html:e},t):null;const s=r[1].toLowerCase(),i=vi(r[2],`${t}-${s}`,!0,n);return s==="kbd"?o.jsx("kbd",{className:"rounded border border-border/30 bg-surface-2 px-1.5 py-0.5 font-mono text-[0.85em] text-foreground shadow-sm",children:i},t):s==="mark"?o.jsx("mark",{className:"rounded bg-warning/25 px-0.5 text-foreground",children:i},t):s==="sub"?o.jsx("sub",{children:i},t):o.jsx("sup",{children:i},t)}function vi(e,t,n=!0,r){const s=nee(e),i=/(\\\([^)]*\\\)|\$[^$\n]+\$|<br\s*\/?>|<(?:a|abbr|span|b|strong|em|i|u|s|del|code|kbd|mark|sub|sup)\b[\s\S]*?<\/(?:a|abbr|span|b|strong|em|i|u|s|del|code|kbd|mark|sub|sup)>|!?\[[^\]]*\]\((?:<[^>]+>|(?:[^\s()]+|\([^()\s]*\))+)(?:\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\)|!?\[[^\]]+\]\[[^\]]*\]|!?\[[^\]]+\]|\[\^[^\]]+\]|(`+)([\s\S]*?)\2|~~[^~]+~~|\*\*[^*]+\*\*|__[^_]+__|\*[^*\s][^*]*\*|_[^_\s][^_]*_|<https?:\/\/[^>\s]+>|<[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+>|https?:\/\/[^\s<]+|www\.[^\s<]+|[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+)/gi,l=[];let c=0,u;for(;(u=i.exec(s))!==null;){u.index>c&&l.push(D4(s.slice(c,u.index)));const f=u[0],p=`${t}-${u.index}`,g=f.startsWith("<")?oee(f,p,r):null;if(g)l.push(g);else if(f.startsWith("\\(")&&f.endsWith("\\)"))l.push(o.jsx(th,{tex:f.slice(2,-2)},p));else if(f.startsWith("$")&&f.endsWith("$"))l.push(o.jsx(th,{tex:f.slice(1,-1)},p));else if(f.startsWith("`")){const y=f.match(/^`+/)?.[0].length??1;l.push(o.jsx("code",{className:`${n?"break-all":"whitespace-nowrap"} rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.92em] text-foreground`,children:ree(f.slice(y,-y))},p))}else if(f.startsWith("~~"))l.push(o.jsx("del",{className:"text-muted-foreground decoration-border-strong",children:vi(f.slice(2,-2),`${p}-del`,n,r)},p));else if(f.startsWith("**")||f.startsWith("__"))l.push(o.jsx("strong",{className:"font-semibold text-foreground",children:vi(f.slice(2,-2),`${p}-strong`,n,r)},p));else if(f.startsWith("*")||f.startsWith("_"))l.push(o.jsx("em",{className:"italic",children:vi(f.slice(1,-1),`${p}-em`,n,r)},p));else if(f.startsWith("![")){const y=f.match(/^!\[([^\]]*)\]\((.*)\)$/),v=f.match(/^!\[([^\]]+)\]\[([^\]]*)\]$/),S=f.match(/^!\[([^\]]+)\]$/);if(y){const A=E2(y[2]);l.push(A?Wx(p,y[1],A.href,A.title,r):f)}else if(v){const A=v[2]||v[1],T=r.referenceDefinitions.get(pm(A));l.push(T?Wx(p,v[1],T.href,T.title,r):f)}else if(S){const A=r.referenceDefinitions.get(pm(S[1]));l.push(A?Wx(p,S[1],A.href,A.title,r):f)}else l.push(f)}else if(f.startsWith("[^")){const y=PT(f.slice(2,-1)),v=r.footnoteDefinitions.get(y);l.push(v?o.jsx("sup",{id:`fnref-${v.id}`,title:v.text,className:"ml-0.5 rounded bg-surface-2 px-1 text-[0.72em] font-semibold text-primary",children:o.jsx("a",{href:`#fn-${v.id}`,className:"text-primary no-underline",children:v.index})},p):f)}else if(f.startsWith("<http")){const y=f.slice(1,-1);l.push(o.jsx("a",{href:y,target:"_blank",rel:"noreferrer",className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},p))}else if(f.startsWith("<")&&f.endsWith(">")&&M4(f.slice(1,-1))){const y=f.slice(1,-1);l.push(o.jsx("a",{href:`mailto:${y}`,className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},p))}else if(M4(Vx(f).linkText)){const{linkText:y,suffix:v}=Vx(f);l.push(o.jsx("a",{href:`mailto:${y}`,className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},p)),v&&l.push(v)}else if(f.startsWith("http")||f.startsWith("www.")){const{linkText:y,suffix:v}=Vx(f),S=y.startsWith("www.")?`https://${y}`:y;l.push(o.jsx("a",{href:S,target:"_blank",rel:"noreferrer",className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},p)),v&&l.push(v)}else{const y=f.match(/^\[([^\]]+)\]\((.*)\)$/),v=f.match(/^\[([^\]]+)\]\[([^\]]*)\]$/),S=f.match(/^\[([^\]]+)\]$/),A=v?v[2]||v[1]:S?.[1]??null,T=A?r.referenceDefinitions.get(pm(A)):null,L=y?E2(y[2]):null,I=L?.href??T?.href??null,j=I?zJ(I):null,P=y?.[1]??v?.[1]??S?.[1]??"";l.push(j?o.jsx("a",{href:j,title:L?.title??T?.title,target:"_blank",rel:"noreferrer",className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:vi(P,`${p}-link`,n,r)},p):f)}c=i.lastIndex}return c<s.length&&l.push(D4(s.slice(c))),l.length>0?l:[e]}function GT(e){return/(?: {2,}|\\)$/.test(e)}function WT(e){return e.replace(/(?: {2,}|\\)$/,"")}function Jm(e){return/^(?: {4}|\t)/.test(e)}function VT(e){return e.startsWith(" ")?e.slice(1):e.replace(/^ {4}/,"")}function qT(e,t,n){const r=[];return e.forEach((s,i)=>{const l=GT(s);r.push(...vi(WT(s),`${t}-${i}`,!0,n)),i<e.length-1&&r.push(l?o.jsx("br",{},`${t}-${i}-br`):" ")}),r}function I2(e,t,n){const r=[],s=[];return e.forEach((i,l)=>{s.push(GT(i)),r.push(vi(WT(i),`${t}-${l}`,!0,n))}),{perLine:r,hardBreaks:s}}function R2(e,t,n,r,s){const i=[];return e.forEach((l,c)=>{const u=n[c]??0,f=!!(s&&u>=s.start&&u<=s.end);i.push(o.jsx("span",{"data-md-ref-start":u,"data-md-ref-end":u,"data-selected":f?"true":void 0,children:l},`${r}-ref-${c}`)),c<e.length-1&&i.push(t[c]?o.jsx("br",{},`${r}-${c}-br`):" ")}),i}function nh(e){const t=e.trim().replace(/^\|/,"").replace(/\|$/,""),n=[];let r="",s=!1,i=0,l=0;for(let c=0;c<t.length;c+=1){const u=t[c];if(s){r+=u,s=!1;continue}if(u==="\\"){s=!0;continue}if(u==="`"){const f=c;for(;c+1<t.length&&t[c+1]==="`";)c+=1;const p=c-f+1;r+="`".repeat(p),i===0?i=p:i===p&&(i=0);continue}if(i===0&&u==="["?l+=1:i===0&&u==="]"&&l>0&&(l-=1),u==="|"&&i===0&&l===0){n.push(r.trim()),r="";continue}r+=u}return s&&(r+="\\"),n.push(r.trim()),n}function YT(e){return nh(e).map(t=>/^:-+:$/.test(t)?"center":/^-+:$/.test(t)?"right":/^:-+$/.test(t)?"left":null)}function eg(e){return e==="center"?"text-center":e==="right"?"text-right":"text-left"}function tg(e){return/^\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)*\|?$/.test(e.trim())}function aee(e,t){return e>96||e>44&&t>.35}function e5(e){return(e.match(/^\s*/)?.[0]??"").replace(/\t/g," ").length}function t5(e){const t=e.trim().match(/^([-+*]|\d+[.)])\s+(.+)$/);if(!t)return null;const n=/^\d+[.)]$/.test(t[1]);return{ordered:n,start:n?Number.parseInt(t[1],10):void 0,content:t[2]}}function KT(e,t,n,r,s,i=new Set){const l=[],c=[];let u=t;for(;u<e.length;){const f=e[u];if(s&&(Zm(f)||i.has(u))){u+=1;continue}const p=t5(f),g=e5(f);if(!p){if(g>n&&c.length>0){([...c].reverse().find(A=>A.indent<g)?.item??c[c.length-1].item).paragraphs.push(f.trim());for(const A of c)A.item.lineEnd=u+1;u+=1;continue}break}if(g<n||g===n&&p.ordered!==r)break;const y={content:p.content,ordered:p.ordered,start:p.start,children:[],paragraphs:[],lineStart:u+1,lineEnd:u+1};for(;c.length>0&&c[c.length-1].indent>=g;)c.pop();const v=c[c.length-1]?.item??null;v?v.children.push(y):l.push(y),c.push({indent:g,item:y});for(const S of c)S.item.lineEnd=u+1;u+=1}return{items:l,nextIndex:u}}function n5(e,t,n,r=0){return e.map((s,i)=>{const l=s.content.match(/^\[([ xX])\]\s+(.+)$/);return{key:`item-${i}`,taskItem:!!l,refStart:s.lineStart+r,refEnd:s.lineEnd+r,content:o.jsxs(o.Fragment,{children:[l?o.jsx("input",{type:"checkbox",checked:l[1].toLowerCase()==="x",readOnly:!0,className:"mr-2 align-[-2px] accent-primary"}):null,vi(l?.[2]??s.content,`li-${t}-${i}`,!0,n),s.paragraphs.length>0&&o.jsx("div",{className:"mt-1 space-y-1 text-muted-foreground",children:s.paragraphs.map((c,u)=>o.jsx("p",{children:vi(c,`li-${t}-${i}-p-${u}`,!0,n)},`paragraph-${u}`))})]}),groups:lee(s.children,`${t}-${i}`,n,r)}})}function lee(e,t,n,r=0){const s=[];for(const i of e){const l=s[s.length-1];l&&l.ordered===i.ordered?l.items.push(i):s.push({ordered:i.ordered,items:[i]})}return s.map((i,l)=>({ordered:i.ordered,start:i.ordered?i.items[0]?.start:void 0,items:n5(i.items,`${t}-g${l}`,n,r)}))}function r5(e,t){return e.map(n=>{const r=!!(t&&n.refStart<=t.end&&n.refEnd>=t.start);return o.jsxs("li",{className:n.taskItem?"list-none":void 0,"data-md-ref-start":n.refStart,"data-md-ref-end":n.refEnd,"data-selected":r?"true":void 0,children:[n.content,n.groups.length>0&&cee(n.groups,t)]},n.key)})}function cee(e,t){return e.map((n,r)=>{const s=n.ordered?"ol":"ul";return o.jsx(s,{start:n.start,className:`${n.ordered?"list-decimal":"list-disc"} mt-1 space-y-0.5 pl-4 marker:text-muted-foreground/60`,children:r5(n.items,t)},`nested-${r}`)})}function uee(e){const t=Array.from(e.footnoteDefinitions.values()).sort((n,r)=>n.index-r.index);return t.length===0?null:o.jsxs("section",{className:"mt-3 border-t border-border/20 pt-2 text-[12px] leading-5 text-muted-foreground",children:[o.jsx("div",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/80",children:e.footnotesLabel}),o.jsx("ol",{className:"list-decimal space-y-1 pl-5",children:t.map(n=>o.jsxs("li",{id:`fn-${n.id}`,children:[vi(n.text,`footnote-${n.id}`,!0,e)," ",o.jsx("a",{href:`#fnref-${n.id}`,className:"text-primary no-underline","aria-label":e.backToFootnoteLabel(n.index),children:"↩"})]},n.id))})]})}function dee(e,t,n,r){const s=[];let i=0;const l=c=>r?.[c]??c+1;for(;i<e.length;){const c=e[i],u=c.trim();if(!u){i+=1;continue}if(/^<details>\s*$/i.test(u)){const L=i;let I="Details";const j=[];for(i+=1;i<e.length&&!/^<\/details>\s*$/i.test(e[i].trim());){const P=e[i].trim().match(/^<summary>(.*?)<\/summary>\s*$/i);P?I=P[1].trim()||I:j.push(e[i].trimStart()),i+=1}i<e.length&&(i+=1),s.push({kind:"static",node:o.jsxs("details",{className:"overflow-hidden rounded-lg border border-border/20 bg-surface px-3 py-2 text-muted-foreground",children:[o.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-foreground",children:vi(I,`${t}-details-${L}-summary`,!0,n)}),j.length>0&&o.jsx("div",{className:"mt-2 text-sm leading-6",children:qT(j,`${t}-details-${L}`,n)})]},`${t}-details-${L}`)});continue}const f=zT(c);if(f){const L=[c],I=i;for(i+=1;i<e.length&&!f.selfContained&&!new RegExp(`</${f.tag}>`,"i").test(e[i]);)L.push(e[i]),i+=1;i<e.length&&!f.selfContained&&(L.push(e[i]),i+=1),s.push({kind:"static",node:o.jsx(UT,{html:L.join(`
|
|
179
|
+
`);const y=s.length;s+=p.data,r.push({node:p,start:y,end:s.length,group:g}),i=g}const c=s.toLocaleLowerCase(),u=[];let f=0;for(;f<=c.length-n.length;){const p=c.indexOf(n,f);if(p<0)break;const g=p+n.length,y=r.find(S=>S.start<=p&&S.end>p),v=r.find(S=>S.start<g&&S.end>=g);if(y&&v&&y.group===v.group){const S=document.createRange();S.setStart(y.node,p-y.start),S.setEnd(v.node,g-v.start),u.push(S)}f=p+Math.max(n.length,1)}return u}function xT(){return typeof CSS<"u"&&CSS.highlights?CSS.highlights:null}function Bp(){const e=xT();e?.delete(gT),e?.delete(S2)}function g4(e,t){const n=xT();if(!n||typeof Highlight>"u")return;n.set(gT,new Highlight(...e));const r=e[t];r?n.set(S2,new Highlight(r)):n.delete(S2)}function x4(e){e?.startContainer.parentElement?.scrollIntoView({block:"center",inline:"nearest",behavior:"smooth"})}const Ky="termdock:right-sidebar:file-tree-scroll:v1",Xy="termdock:right-sidebar:file-preview-reading-state:v1",Sf="termdock:right-sidebar:file-tree-width:v1",bT="termdock:right-sidebar:markdown-view-mode:v1",yT="termdock:right-sidebar:diff-change-list-mode:v1",vT="termdock:right-sidebar:diff-wrap:v1",wT="termdock:diff-viewer:view-type:v1",ST="termdock:right-sidebar:file-search-mode:v1",Ox="termdock:right-sidebar:collapsed-git-repo-groups:v1",b4="termdock:right-sidebar:collapsed-diff-directories:v1",Qx="termdock:right-sidebar:branch-audit-module-open:v1",AT="termdock:right-sidebar:branch-audit-module:v1",fJ=150,TT="termdock:right-sidebar:active-git-repo:v1",y4="termdock:right-sidebar:context-draft-enabled:v1",v4="termdock:right-sidebar:context-draft-collapsed:v1",w4="termdock:right-sidebar:context-draft-auto-collapse:v1",$x="termdock:right-sidebar:context-draft-text:v1",hJ=300,pJ=20,mJ=120,gJ=250,xJ=250,bJ=120,yJ=700,Hx=600,S4=[2e3,5e3,15e3,3e4],vJ=320,wJ=500,SJ=20,AJ=12e3,A2=300,A4=240,TJ=560,CT="border-r px-2 py-1.5 sm:px-3 sm:py-2",Xm="max-w-[18rem] whitespace-normal break-words sm:max-w-[27rem]",kT=`${CT} border-b border-border/15 font-semibold last:border-r-0`,_T=`${CT} border-border/10 align-top text-muted-foreground last:border-r-0`,Zy="termdock-file-preview-horizontal-scroll",T4=b.lazy(()=>o0(()=>import("./ModelPreview-D_ePHuIb.js"),__vite__mapDeps([2,3,1,4]))),LT=`${Zy} termdock-md-table-scroll max-w-full overflow-x-auto overflow-y-hidden rounded-lg border border-border/20 bg-surface`,CJ=new Set([".md",".markdown",".mdown",".mkdn",".mkd"]);function kJ(e){return e==="preview"||e==="source"}function _J(e){return e==="list"||e==="tree"||e==="ai"}function C4(){return Or(bT,kJ)??"preview"}function LJ(){return Or(yT,_J)??"tree"}function Af(e){return typeof e=="boolean"}function EJ(e){return typeof e=="string"}function IJ(){return Or(vT,Af)??!0}function RJ(e){return e==="unified"||e==="split"}function NJ(){return Or(wT,RJ)??"unified"}function MJ(e){return e==="name"||e==="content"||e==="regex"}function DJ(){return Or(ST,MJ)??"name"}function jJ(e){return e.repositories??(e.context?.root?[{id:e.context.root,root:e.context.root,relativeRoot:".",name:Bo(e.context.root)||e.context.root,depth:0,nested:!1,available:e.available,files:e.files,context:e.context,error:e.error}]:[])}function PJ(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.values(e).every(t=>t===null||typeof t=="string")}function ET(){return Or(TT,PJ)??{}}function k4(e){if(!e)return;const t=ET();return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0}function Ux(e,t){e&&Qn(TT,{...ET(),[e]:t})}function BJ(e,t){if(!t)return null;const n=new Set((e.repoFilters??[]).map(r=>r.root));return n.has(t)?t:n.size>0?null:(e.repositories??[]).some(r=>r.root===t)?t:null}function T2(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function _4(e){const t=Or(e,T2);return t?new Set(t):new Set}function zx(e,t){Qn(e,[...t])}function FJ(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.filePath=="string"&&typeof t.hunkHeader=="string"&&typeof t.hunkIndex=="number"&&typeof t.fingerprint=="string"&&typeof t.additions=="number"&&typeof t.deletions=="number"&&typeof t.diff=="string"&&(t.oldPath===void 0||t.oldPath===null||typeof t.oldPath=="string")&&(t.newPath===void 0||t.newPath===null||typeof t.newPath=="string")&&(t.source===void 0||t.source==="committed"||t.source==="uncommitted"||t.source==="unknown")&&(t.commit===void 0||t.commit===null||typeof t.commit=="string")}function OJ(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.available=="boolean"&&(t.repoRoot===void 0||typeof t.repoRoot=="string")&&(t.workspaceRoot===void 0||typeof t.workspaceRoot=="string")&&(t.baseRef===void 0||typeof t.baseRef=="string")&&(t.baseBranch===void 0||typeof t.baseBranch=="string")&&(t.currentBranch===void 0||t.currentBranch===null||typeof t.currentBranch=="string")&&(t.headRef===void 0||t.headRef===null||typeof t.headRef=="string")&&(t.diffFingerprint===void 0||typeof t.diffFingerprint=="string")&&(t.stat===void 0||typeof t.stat=="string")&&(t.files===void 0||T2(t.files))&&(t.hunks===void 0||Array.isArray(t.hunks)&&t.hunks.every(FJ))&&(t.commits===void 0||T2(t.commits))&&(t.commitCount===void 0||typeof t.commitCount=="number")&&(t.diff===void 0||typeof t.diff=="string")&&(t.truncated===void 0||typeof t.truncated=="boolean")&&(t.error===void 0||typeof t.error=="string")}function QJ(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.key=="string"&&OJ(t.diff)&&typeof t.repoLabel=="string"&&typeof t.createdAt=="number"}function $J(e){return!e||typeof e!="object"||Array.isArray(e)?!1:Object.values(e).every(t=>{if(!t||typeof t!="object"||Array.isArray(t))return!1;const n=t;return Array.isArray(n.selectedRepoRoots)&&n.selectedRepoRoots.every(r=>typeof r=="string")&&!!n.repoTargetBranches&&typeof n.repoTargetBranches=="object"&&!Array.isArray(n.repoTargetBranches)&&Object.values(n.repoTargetBranches).every(r=>typeof r=="string")&&(n.repoBaseBranches===void 0||!!n.repoBaseBranches&&typeof n.repoBaseBranches=="object"&&!Array.isArray(n.repoBaseBranches)&&Object.values(n.repoBaseBranches).every(r=>typeof r=="string"))&&(n.previewEntries===void 0||Array.isArray(n.previewEntries)&&n.previewEntries.every(QJ))&&(n.selectedPreviewKey===void 0||n.selectedPreviewKey===null||typeof n.selectedPreviewKey=="string")&&(n.selectedPreviewFileKey===void 0||n.selectedPreviewFileKey===null||typeof n.selectedPreviewFileKey=="string")&&(n.previewDetailOpen===void 0||typeof n.previewDetailOpen=="boolean")&&(n.previewScrollTops===void 0||!!n.previewScrollTops&&typeof n.previewScrollTops=="object"&&!Array.isArray(n.previewScrollTops)&&Object.values(n.previewScrollTops).every(r=>typeof r=="number"))&&(n.previewMobileSlideIndex===void 0||typeof n.previewMobileSlideIndex=="number")&&(n.includeUncommitted===void 0||typeof n.includeUncommitted=="boolean")&&typeof n.updatedAt=="number"})}function L4(){return Or(AT,$J)??{}}function E4(e){return[e.repoRoot,e.baseRef,e.branchName??"",e.headRef??"",e.diffFingerprint??""].join("\0")}function I4(e){const t=e?.trim()??"",n=t.indexOf("/");return n>=0?t.slice(n+1):t}function IT(e,t){const n=e?.trim(),r=t?.trim();return!n||!r?!1:n===r||I4(n)===I4(r)}function R4(e){const t=e?.branch??null;return[e?.upstream,...e?.remoteBranches??[],...e?.branches??[]].find(r=>r&&!IT(r,t))??""}function C2(e,t){const n=Math.max(A4,t-320),r=Math.min(TJ,n);return Math.min(r,Math.max(A4,e))}function HJ(e){return typeof e=="number"&&Number.isFinite(e)}function UJ(e){return C2(Or(Sf,HJ)??A2,e)}function RT(e){const t=e.split(/[\\/]/).pop()??e,n=t.lastIndexOf(".");return n>=0?t.slice(n).toLowerCase():""}function lf(e){return CJ.has(RT(e))}function NT(e){const t=e.trim().replace(/\s+/g,"");return/^-{3,}$/.test(t)||/^\*{3,}$/.test(t)||/^_{3,}$/.test(t)}function k2(e){const t=e.trim();return/^#{1,6}\s+/.test(t)||NT(e)||/^>\s?/.test(t)||/^(```|~~~)/.test(t)||/^(?:[-+*]|\d+[.)])\s+/.test(t)}function zJ(e){const t=e.trim();return/^(https?:|mailto:|#|\/|\.\/|\.\.\/)/i.test(t)||!/^[a-z][a-z0-9+.-]*:/i.test(t)&&!/[<>]/.test(t)?t:null}const MT=b.createContext(null);function pm(e){return e.trim().replace(/\s+/g," ").toLowerCase()}function DT(e){return e.replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/\[([^\]]+)\]\[[^\]]*\]/g,"$1").replace(/[`*_~]/g,"").replace(/<[^>]+>/g,"").trim()}function jT(e){return e.replace(/\s+#+\s*$/,"").trim()}function _2(e,t){const r=DT(e).toLowerCase().replace(/[^\p{L}\p{N}\s-]/gu,"").trim().replace(/\s+/g,"-")||"section",s=t.headingSlugCounts.get(r)??0;return t.headingSlugCounts.set(r,s+1),s===0?r:`${r}-${s}`}function N4(e){return DT(e)||e.trim()}function Zm(e){const t=e.match(/^\s{0,3}\[([^\]]+)\]:\s+(.+?)\s*$/);if(!t)return null;const n=E2(t[2]);return n?{id:pm(t[1]),definition:{href:n.href,title:n.title}}:null}function GJ(e){const t=new Map;for(const n of e){const r=Zm(n);r&&t.set(r.id,r.definition)}return t}function PT(e){return e.trim().toLowerCase()}function BT(e){const t=e.match(/^\s{0,3}\[\^([^\]]+)\]:\s+(.+)\s*$/);return t?{id:PT(t[1]),text:t[2]}:null}function WJ(e){const t=new Map;let n=null;for(const r of e){const s=BT(r);if(s){n=s.id,t.set(s.id,{id:s.id,text:s.text,index:t.size+1});continue}if(n&&/^\s{4,}\S/.test(r)){const i=t.get(n);i&&(i.text=`${i.text} ${r.trim()}`);continue}r.trim()&&(n=null)}return t}function VJ(e){const t=new Set;let n=!1;return e.forEach((r,s)=>{if(BT(r)){t.add(s),n=!0;return}if(n&&/^\s{4,}\S/.test(r)){t.add(s);return}r.trim()&&(n=!1)}),t}function qJ(e){const t=[...e];let n=0;const r=e[0]?.trim();if(r==="---"||r==="+++"){for(t[0]="",n=1;n<e.length&&e[n].trim()!==r;)t[n]="",n+=1;n<e.length&&(t[n]="",n+=1)}for(;n<e.length;){const s=e[n].trim();if(s.startsWith("<!--")){if(t[n]="",!s.includes("-->")){for(n+=1;n<e.length&&!e[n].includes("-->");)t[n]="",n+=1;n<e.length&&(t[n]="")}n+=1;continue}n+=1}return t}function FT(e){const t=e.replace(/\/+$/,""),n=t.lastIndexOf("/");return n<=0?n===0?"/":"":t.slice(0,n)}function Pf(e){const t=e.split(/[?#]/,1)[0],n=t.startsWith("/"),r=[];for(const i of t.split("/"))if(!(!i||i===".")){if(i===".."){r.length>0&&r.pop();continue}r.push(i)}return`${n?"/":""}${r.join("/")}`||(n?"/":".")}function YJ(e,t,n){const r=e.trim();if(!r||/^(?:https?:|mailto:|javascript:|data:|#)/i.test(r)||/^[a-z][a-z0-9+.-]*:/i.test(r))return null;const s=r.indexOf("#"),i=s>=0?r.slice(0,s):r,l=s>=0?r.slice(s+1):"",c=i.split("?",1)[0];if(!c)return null;let u,f=null;try{u=decodeURIComponent(c),f=l?decodeURIComponent(l):null}catch{return null}const p=n?Pf(n):null;let g;if(u.startsWith("/")){const y=p&&(u===p||u.startsWith(`${p}/`));g=Pf(p&&!y?`${p}/${u.slice(1)}`:u)}else{if(!t)return null;g=Pf(`${FT(t)}/${u}`)}return p&&g!==p&&!g.startsWith(`${p}/`)?null:{path:g,fragment:f,directory:/\/$/.test(c)}}function KJ(e,t,n){const r=e.trim();if(!r||/^(?:javascript|data):/i.test(r))return null;if(/^https?:\/\//i.test(r))return r;if(!$2(r.split(/[?#]/,1)[0]))return null;let s;if(r.startsWith("/")){const i=n&&(r===n||r.startsWith(`${n}/`));s=Pf(n&&!i?`${n}/${r.slice(1)}`:r)}else{if(!t)return null;s=Pf(`${FT(t)}/${r}`)}return`/api/terminal/fs/blob?path=${encodeURIComponent(s)}`}const L2=128,XJ=360,Gx=480;function Jy(e){try{return/\.svg(?=$|[?#&])/i.test(decodeURIComponent(e))}catch{return!1}}function ZJ(e,t,n,r){if(!t||!n)return null;let s,i;return Jy(e)?(i=Math.min(Math.max(n,L2),XJ),s=t*i/n):(s=t,i=n),r>0&&s>r&&(i=i*r/s,s=r),i>Gx&&(s=s*Gx/i,i=Gx),{width:Math.max(1,Math.round(s)),height:Math.max(1,Math.round(i))}}function JJ(e){if(!e.startsWith("/api/terminal/fs/blob?"))return null;try{return new URLSearchParams(e.slice(e.indexOf("?"))).get("path")}catch{return null}}function OT(e){const t=JJ(e),n=yt(r=>t?(r.fileChangeVersions.get(t)??0)+r.fileWatchEpoch:0);return t&&n>0?`${e}&v=${n}`:e}function eee({src:e,alt:t,title:n}){const r=Jy(e),s=OT(e),i=b.useRef(null),[l,c]=b.useState(!1),[u,f]=b.useState(0),[p,g]=b.useState({status:"loading"}),[y,v]=b.useState(null);b.useLayoutEffect(()=>{const T=i.current,L=T?.parentElement?.parentElement??T?.parentElement;if(!L)return;const I=()=>f(L.clientWidth);if(I(),typeof ResizeObserver>"u")return;const j=new ResizeObserver(I);return j.observe(L),()=>j.disconnect()},[]),b.useEffect(()=>{if(l)return;const T=i.current;if(!T||typeof IntersectionObserver>"u"){c(!0);return}const L=new IntersectionObserver(I=>{I.some(j=>j.isIntersecting)&&(c(!0),L.disconnect())},{rootMargin:"400px"});return L.observe(T),()=>L.disconnect()},[l]),b.useEffect(()=>{if(!l)return;const T=new AbortController;let L=null;g({status:"loading"});const I=window.setTimeout(()=>{T.abort(new DOMException("Image fetch timed out","TimeoutError"))},15e3);return fetch(s,{signal:T.signal}).then(async j=>{if(!j.ok)throw new Error(`HTTP ${j.status}`);const P=Number(j.headers.get("X-Image-Width"))||0,F=Number(j.headers.get("X-Image-Height"))||0;return{blob:await j.blob(),width:P,height:F}}).then(({blob:j,width:P,height:F})=>{T.signal.aborted||(L=URL.createObjectURL(j),P>0&&F>0&&v({width:P,height:F}),g({status:"ready",objectUrl:L}))}).catch(()=>{const j=T.signal.reason;T.signal.aborted&&!(j instanceof DOMException&&j.name==="TimeoutError")||g({status:"fallback"})}).finally(()=>{window.clearTimeout(I)}),()=>{window.clearTimeout(I),T.abort(),L&&URL.revokeObjectURL(L)}},[l,s]);const S=ZJ(e,y?.width??0,y?.height??0,u),A=S??{width:L2*2,height:L2};return o.jsx("div",{ref:i,className:"block max-w-full",style:S?{width:S.width,height:S.height}:void 0,children:p.status==="ready"?o.jsx("img",{src:p.objectUrl,alt:t,title:n,decoding:"async",className:`${r?"":"termdock-fade-in "}block max-h-[480px] max-w-full object-contain`,style:S?{width:S.width,height:S.height}:void 0,onLoad:T=>{if(y)return;const L=T.currentTarget;L.naturalWidth>0&&L.naturalHeight>0&&v({width:L.naturalWidth,height:L.naturalHeight})}}):p.status==="fallback"?o.jsx("img",{src:s,alt:t,title:n,loading:"lazy",decoding:"async",className:"block max-h-[480px] max-w-full object-contain",style:S?{width:S.width,height:S.height}:void 0,onLoad:T=>{if(y)return;const L=T.currentTarget;L.naturalWidth>0&&L.naturalHeight>0&&v({width:L.naturalWidth,height:L.naturalHeight})}}):o.jsx("div",{"aria-hidden":!0,className:"flex max-w-full animate-pulse items-center justify-center rounded bg-surface-elevated/60",style:{width:A.width,height:A.height},children:o.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:t||"…"})})})}function Wx(e,t,n,r,s){const i=KJ(n,s.markdownFilePath,s.rootPath);if(!i)return``;const l=s.images.length;s.images.push({kind:"image",src:i,alt:t,title:r});const c=o.jsx(eee,{src:i,alt:t,title:r});return s.onImageOpen?o.jsx("button",{type:"button",className:"my-2 block max-w-full overflow-hidden rounded-md border border-border/20 bg-surface-2 text-left transition hover:border-border-strong focus:outline-none focus:ring-2 focus:ring-ring/45",title:r||t||"Open image",onClick:u=>{u.stopPropagation(),s.onImageOpen?.(l)},children:c},e):o.jsx("span",{className:"my-2 block max-w-full overflow-hidden rounded-md border border-border/20 bg-surface-2",children:c},e)}function Vx(e){let t=e,n="";for(;/[.,;:!?)]$/.test(t);)n=`${t.slice(-1)}${n}`,t=t.slice(0,-1);return{linkText:t,suffix:n}}function M4(e){return/^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/.test(e)}function E2(e){const t=e.trim(),n=t.match(/^<([^>]+)>(?:\s+(?:"([^"]*)"|'([^']*)'|\(([^)]*)\)))?$/);if(n)return{href:n[1],title:n[2]??n[3]??n[4]};const r=t.match(/^(\S+)(?:\s+(?:"([^"]*)"|'([^']*)'|\(([^)]*)\)))?$/);return r?{href:r[1],title:r[2]??r[3]??r[4]}:null}const QT="",tee=/\\([\\`*{}\[\]#+\-.!_|~>$])/g;function nee(e){return e.replace(tee,(t,n)=>`${QT}${n.charCodeAt(0).toString(16).padStart(4,"0")}`)}function D4(e){return e.replace(new RegExp(`${QT}([0-9a-f]{4})`,"g"),(t,n)=>String.fromCharCode(Number.parseInt(n,16))).replace(/\\([()])/g,"$1")}function ree(e){const t=e.replace(/[\r\n]+/g," ");return/^ .+ $/.test(t)&&/[^ ]/.test(t.slice(1,-1))?t.slice(1,-1):t}const $T={ALLOWED_TAGS:["a","abbr","b","blockquote","br","code","del","details","div","em","i","kbd","li","mark","ol","p","pre","s","span","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"],ALLOWED_ATTR:["href","title","class","id","colspan","rowspan"],ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!0};let Fp=null;function HT(){return Fp||(Fp=o0(()=>import("./purify.es-CC4Brkr_.js"),[]).then(e=>e.default??e).catch(e=>{throw Fp=null,e})),Fp}function UT({html:e}){const{t}=Vn(),[n,r]=b.useState(null);return b.useEffect(()=>{let s=!1;return r(null),HT().then(i=>{s||r(i.sanitize(e,$T))}).catch(()=>{s||r("")}),()=>{s=!0}},[e]),n===null?o.jsx("div",{className:"py-2 text-xs text-muted-foreground",children:t("rightSidebar.renderingHtml")}):n?o.jsx("div",{className:"text-muted-foreground",dangerouslySetInnerHTML:{__html:n}}):null}function see({html:e}){const[t,n]=b.useState(null);return b.useEffect(()=>{let r=!1;return n(null),HT().then(s=>{r||n(s.sanitize(e,$T))}).catch(()=>{r||n("")}),()=>{r=!0}},[e]),t===null?null:t?o.jsx("span",{dangerouslySetInnerHTML:{__html:t}}):e}function zT(e){const t=e.trim().match(/^<(div|section|article|aside|table|p|ul|ol|li|blockquote|pre|figure|figcaption)\b[^>]*>/i);if(!t)return null;const n=t[1].toLowerCase();return{tag:n,selfContained:new RegExp(`</${n}>`,"i").test(e)}}let Op=null;function iee(){return Op||(Op=Promise.all([o0(()=>import("./katex-DnlPpQZa.js"),[]),o0(()=>Promise.resolve({}),__vite__mapDeps([5]))]).then(([e])=>e.default??e).catch(e=>{throw Op=null,e})),Op}function th({tex:e,display:t=!1}){const[n,r]=b.useState(null),[s,i]=b.useState(!1);if(b.useEffect(()=>{let c=!1;return r(null),i(!1),iee().then(u=>{c||r(u.renderToString(e,{displayMode:t,throwOnError:!1,trust:!1,strict:"ignore"}))}).catch(()=>{c||i(!0)}),()=>{c=!0}},[t,e]),s)return o.jsx("code",{className:"rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.92em] text-foreground",children:t?`$$${e}$$`:`$${e}$`});if(!n)return o.jsx("span",{className:"text-muted-foreground/70",children:t?"Rendering formula...":e});const l=t?"my-2 overflow-auto rounded-md bg-surface-2 px-3 py-2 text-center":"inline-block align-middle";return o.jsx("span",{className:l,dangerouslySetInnerHTML:{__html:n}})}function oee(e,t,n){if(/^<br\s*\/?>$/i.test(e))return o.jsx("br",{},t);const r=e.match(/^<(kbd|mark|sub|sup)>(.*?)<\/\1>$/i);if(!r)return/^<(a|abbr|span|b|strong|em|i|u|s|del|code)\b[\s\S]*<\/\1>$/i.test(e)?o.jsx(see,{html:e},t):null;const s=r[1].toLowerCase(),i=vi(r[2],`${t}-${s}`,!0,n);return s==="kbd"?o.jsx("kbd",{className:"rounded border border-border/30 bg-surface-2 px-1.5 py-0.5 font-mono text-[0.85em] text-foreground shadow-sm",children:i},t):s==="mark"?o.jsx("mark",{className:"rounded bg-warning/25 px-0.5 text-foreground",children:i},t):s==="sub"?o.jsx("sub",{children:i},t):o.jsx("sup",{children:i},t)}function vi(e,t,n=!0,r){const s=nee(e),i=/(\\\([^)]*\\\)|\$[^$\n]+\$|<br\s*\/?>|<(?:a|abbr|span|b|strong|em|i|u|s|del|code|kbd|mark|sub|sup)\b[\s\S]*?<\/(?:a|abbr|span|b|strong|em|i|u|s|del|code|kbd|mark|sub|sup)>|!?\[[^\]]*\]\((?:<[^>]+>|(?:[^\s()]+|\([^()\s]*\))+)(?:\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\)|!?\[[^\]]+\]\[[^\]]*\]|!?\[[^\]]+\]|\[\^[^\]]+\]|(`+)([\s\S]*?)\2|~~[^~]+~~|\*\*[^*]+\*\*|__[^_]+__|\*[^*\s][^*]*\*|_[^_\s][^_]*_|<https?:\/\/[^>\s]+>|<[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+>|https?:\/\/[^\s<]+|www\.[^\s<]+|[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+)/gi,l=[];let c=0,u;for(;(u=i.exec(s))!==null;){u.index>c&&l.push(D4(s.slice(c,u.index)));const f=u[0],p=`${t}-${u.index}`,g=f.startsWith("<")?oee(f,p,r):null;if(g)l.push(g);else if(f.startsWith("\\(")&&f.endsWith("\\)"))l.push(o.jsx(th,{tex:f.slice(2,-2)},p));else if(f.startsWith("$")&&f.endsWith("$"))l.push(o.jsx(th,{tex:f.slice(1,-1)},p));else if(f.startsWith("`")){const y=f.match(/^`+/)?.[0].length??1;l.push(o.jsx("code",{className:`${n?"break-all":"whitespace-nowrap"} rounded bg-surface-2 px-1 py-0.5 font-mono text-[0.92em] text-foreground`,children:ree(f.slice(y,-y))},p))}else if(f.startsWith("~~"))l.push(o.jsx("del",{className:"text-muted-foreground decoration-border-strong",children:vi(f.slice(2,-2),`${p}-del`,n,r)},p));else if(f.startsWith("**")||f.startsWith("__"))l.push(o.jsx("strong",{className:"font-semibold text-foreground",children:vi(f.slice(2,-2),`${p}-strong`,n,r)},p));else if(f.startsWith("*")||f.startsWith("_"))l.push(o.jsx("em",{className:"italic",children:vi(f.slice(1,-1),`${p}-em`,n,r)},p));else if(f.startsWith("![")){const y=f.match(/^!\[([^\]]*)\]\((.*)\)$/),v=f.match(/^!\[([^\]]+)\]\[([^\]]*)\]$/),S=f.match(/^!\[([^\]]+)\]$/);if(y){const A=E2(y[2]);l.push(A?Wx(p,y[1],A.href,A.title,r):f)}else if(v){const A=v[2]||v[1],T=r.referenceDefinitions.get(pm(A));l.push(T?Wx(p,v[1],T.href,T.title,r):f)}else if(S){const A=r.referenceDefinitions.get(pm(S[1]));l.push(A?Wx(p,S[1],A.href,A.title,r):f)}else l.push(f)}else if(f.startsWith("[^")){const y=PT(f.slice(2,-1)),v=r.footnoteDefinitions.get(y);l.push(v?o.jsx("sup",{id:`fnref-${v.id}`,title:v.text,className:"ml-0.5 rounded bg-surface-2 px-1 text-[0.72em] font-semibold text-primary",children:o.jsx("a",{href:`#fn-${v.id}`,className:"text-primary no-underline",children:v.index})},p):f)}else if(f.startsWith("<http")){const y=f.slice(1,-1);l.push(o.jsx("a",{href:y,target:"_blank",rel:"noreferrer",className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},p))}else if(f.startsWith("<")&&f.endsWith(">")&&M4(f.slice(1,-1))){const y=f.slice(1,-1);l.push(o.jsx("a",{href:`mailto:${y}`,className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},p))}else if(M4(Vx(f).linkText)){const{linkText:y,suffix:v}=Vx(f);l.push(o.jsx("a",{href:`mailto:${y}`,className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},p)),v&&l.push(v)}else if(f.startsWith("http")||f.startsWith("www.")){const{linkText:y,suffix:v}=Vx(f),S=y.startsWith("www.")?`https://${y}`:y;l.push(o.jsx("a",{href:S,target:"_blank",rel:"noreferrer",className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:y},p)),v&&l.push(v)}else{const y=f.match(/^\[([^\]]+)\]\((.*)\)$/),v=f.match(/^\[([^\]]+)\]\[([^\]]*)\]$/),S=f.match(/^\[([^\]]+)\]$/),A=v?v[2]||v[1]:S?.[1]??null,T=A?r.referenceDefinitions.get(pm(A)):null,L=y?E2(y[2]):null,I=L?.href??T?.href??null,j=I?zJ(I):null,P=y?.[1]??v?.[1]??S?.[1]??"";l.push(j?o.jsx("a",{href:j,title:L?.title??T?.title,target:"_blank",rel:"noreferrer",className:`${n?"break-all":"whitespace-nowrap"} text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary`,children:vi(P,`${p}-link`,n,r)},p):f)}c=i.lastIndex}return c<s.length&&l.push(D4(s.slice(c))),l.length>0?l:[e]}function GT(e){return/(?: {2,}|\\)$/.test(e)}function WT(e){return e.replace(/(?: {2,}|\\)$/,"")}function Jm(e){return/^(?: {4}|\t)/.test(e)}function VT(e){return e.startsWith(" ")?e.slice(1):e.replace(/^ {4}/,"")}function qT(e,t,n){const r=[];return e.forEach((s,i)=>{const l=GT(s);r.push(...vi(WT(s),`${t}-${i}`,!0,n)),i<e.length-1&&r.push(l?o.jsx("br",{},`${t}-${i}-br`):" ")}),r}function I2(e,t,n){const r=[],s=[];return e.forEach((i,l)=>{s.push(GT(i)),r.push(vi(WT(i),`${t}-${l}`,!0,n))}),{perLine:r,hardBreaks:s}}function R2(e,t,n,r,s){const i=[];return e.forEach((l,c)=>{const u=n[c]??0,f=!!(s&&u>=s.start&&u<=s.end);i.push(o.jsx("span",{"data-md-ref-start":u,"data-md-ref-end":u,"data-selected":f?"true":void 0,children:l},`${r}-ref-${c}`)),c<e.length-1&&i.push(t[c]?o.jsx("br",{},`${r}-${c}-br`):" ")}),i}function nh(e){const t=e.trim().replace(/^\|/,"").replace(/\|$/,""),n=[];let r="",s=!1,i=0,l=0;for(let c=0;c<t.length;c+=1){const u=t[c];if(s){r+=u,s=!1;continue}if(u==="\\"){s=!0;continue}if(u==="`"){const f=c;for(;c+1<t.length&&t[c+1]==="`";)c+=1;const p=c-f+1;r+="`".repeat(p),i===0?i=p:i===p&&(i=0);continue}if(i===0&&u==="["?l+=1:i===0&&u==="]"&&l>0&&(l-=1),u==="|"&&i===0&&l===0){n.push(r.trim()),r="";continue}r+=u}return s&&(r+="\\"),n.push(r.trim()),n}function YT(e){return nh(e).map(t=>/^:-+:$/.test(t)?"center":/^-+:$/.test(t)?"right":/^:-+$/.test(t)?"left":null)}function eg(e){return e==="center"?"text-center":e==="right"?"text-right":"text-left"}function tg(e){return/^\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)*\|?$/.test(e.trim())}function aee(e,t){return e>96||e>44&&t>.35}function e5(e){return(e.match(/^\s*/)?.[0]??"").replace(/\t/g," ").length}function t5(e){const t=e.trim().match(/^([-+*]|\d+[.)])\s+(.+)$/);if(!t)return null;const n=/^\d+[.)]$/.test(t[1]);return{ordered:n,start:n?Number.parseInt(t[1],10):void 0,content:t[2]}}function KT(e,t,n,r,s,i=new Set){const l=[],c=[];let u=t;for(;u<e.length;){const f=e[u];if(s&&(Zm(f)||i.has(u))){u+=1;continue}const p=t5(f),g=e5(f);if(!p){if(g>n&&c.length>0){([...c].reverse().find(A=>A.indent<g)?.item??c[c.length-1].item).paragraphs.push(f.trim());for(const A of c)A.item.lineEnd=u+1;u+=1;continue}break}if(g<n||g===n&&p.ordered!==r)break;const y={content:p.content,ordered:p.ordered,start:p.start,children:[],paragraphs:[],lineStart:u+1,lineEnd:u+1};for(;c.length>0&&c[c.length-1].indent>=g;)c.pop();const v=c[c.length-1]?.item??null;v?v.children.push(y):l.push(y),c.push({indent:g,item:y});for(const S of c)S.item.lineEnd=u+1;u+=1}return{items:l,nextIndex:u}}function n5(e,t,n,r=0){return e.map((s,i)=>{const l=s.content.match(/^\[([ xX])\]\s+(.+)$/);return{key:`item-${i}`,taskItem:!!l,refStart:s.lineStart+r,refEnd:s.lineEnd+r,content:o.jsxs(o.Fragment,{children:[l?o.jsx("input",{type:"checkbox",checked:l[1].toLowerCase()==="x",readOnly:!0,className:"mr-2 align-[-2px] accent-primary"}):null,vi(l?.[2]??s.content,`li-${t}-${i}`,!0,n),s.paragraphs.length>0&&o.jsx("div",{className:"mt-1 space-y-1 text-muted-foreground",children:s.paragraphs.map((c,u)=>o.jsx("p",{children:vi(c,`li-${t}-${i}-p-${u}`,!0,n)},`paragraph-${u}`))})]}),groups:lee(s.children,`${t}-${i}`,n,r)}})}function lee(e,t,n,r=0){const s=[];for(const i of e){const l=s[s.length-1];l&&l.ordered===i.ordered?l.items.push(i):s.push({ordered:i.ordered,items:[i]})}return s.map((i,l)=>({ordered:i.ordered,start:i.ordered?i.items[0]?.start:void 0,items:n5(i.items,`${t}-g${l}`,n,r)}))}function r5(e,t){return e.map(n=>{const r=!!(t&&n.refStart<=t.end&&n.refEnd>=t.start);return o.jsxs("li",{className:n.taskItem?"list-none":void 0,"data-md-ref-start":n.refStart,"data-md-ref-end":n.refEnd,"data-selected":r?"true":void 0,children:[n.content,n.groups.length>0&&cee(n.groups,t)]},n.key)})}function cee(e,t){return e.map((n,r)=>{const s=n.ordered?"ol":"ul";return o.jsx(s,{start:n.start,className:`${n.ordered?"list-decimal":"list-disc"} mt-1 space-y-0.5 pl-4 marker:text-muted-foreground/60`,children:r5(n.items,t)},`nested-${r}`)})}function uee(e){const t=Array.from(e.footnoteDefinitions.values()).sort((n,r)=>n.index-r.index);return t.length===0?null:o.jsxs("section",{className:"mt-3 border-t border-border/20 pt-2 text-[12px] leading-5 text-muted-foreground",children:[o.jsx("div",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground/80",children:e.footnotesLabel}),o.jsx("ol",{className:"list-decimal space-y-1 pl-5",children:t.map(n=>o.jsxs("li",{id:`fn-${n.id}`,children:[vi(n.text,`footnote-${n.id}`,!0,e)," ",o.jsx("a",{href:`#fnref-${n.id}`,className:"text-primary no-underline","aria-label":e.backToFootnoteLabel(n.index),children:"↩"})]},n.id))})]})}function dee(e,t,n,r){const s=[];let i=0;const l=c=>r?.[c]??c+1;for(;i<e.length;){const c=e[i],u=c.trim();if(!u){i+=1;continue}if(/^<details>\s*$/i.test(u)){const L=i;let I="Details";const j=[];for(i+=1;i<e.length&&!/^<\/details>\s*$/i.test(e[i].trim());){const P=e[i].trim().match(/^<summary>(.*?)<\/summary>\s*$/i);P?I=P[1].trim()||I:j.push(e[i].trimStart()),i+=1}i<e.length&&(i+=1),s.push({kind:"static",node:o.jsxs("details",{className:"overflow-hidden rounded-lg border border-border/20 bg-surface px-3 py-2 text-muted-foreground",children:[o.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-foreground",children:vi(I,`${t}-details-${L}-summary`,!0,n)}),j.length>0&&o.jsx("div",{className:"mt-2 text-sm leading-6",children:qT(j,`${t}-details-${L}`,n)})]},`${t}-details-${L}`)});continue}const f=zT(c);if(f){const L=[c],I=i;for(i+=1;i<e.length&&!f.selfContained&&!new RegExp(`</${f.tag}>`,"i").test(e[i]);)L.push(e[i]),i+=1;i<e.length&&!f.selfContained&&(L.push(e[i]),i+=1),s.push({kind:"static",node:o.jsx(UT,{html:L.join(`
|
|
180
180
|
`)},`${t}-html-${I}`)});continue}const p=u.match(/^(```|~~~)\s*(.*)$/);if(p){const L=[],I=p[1],j=p[2]?.trim(),P=i;for(i+=1;i<e.length&&!e[i].trim().startsWith(I);)L.push(e[i]),i+=1;i<e.length&&(i+=1),j.toLowerCase()==="mermaid"?s.push({kind:"static",node:o.jsx(ZT,{code:L.join(`
|
|
181
181
|
`),blockKey:`${t}-code-${P}`},`${t}-code-${P}`)}):["math","latex","tex"].includes(j.toLowerCase())?s.push({kind:"static",node:o.jsx(th,{tex:L.join(`
|
|
182
182
|
`),display:!0},`${t}-code-${P}`)}):s.push({kind:"code",key:`${t}-code-${P}`,code:L.join(`
|
|
183
183
|
`),lang:j,blockKey:`${t}-code-${P}`,codeStartLine:l(P)+1});continue}if(Jm(c)){const L=[],I=i;for(;i<e.length&&(Jm(e[i])||!e[i].trim());)L.push(e[i].trim()?VT(e[i]):""),i+=1;s.push({kind:"code",key:`${t}-indented-code-${I}`,code:L.join(`
|
|
184
|
-
`).replace(/\n+$/,""),lang:"",blockKey:`${t}-indented-code-${I}`,codeStartLine:l(I)});continue}const g=u.match(/^(#{1,6})\s+(.+)$/);if(g){const I=`h${Math.min(6,g[1].length+1)}`,j=jT(g[2]),P=_2(j,n);s.push({kind:"static",node:o.jsx(I,{id:P,className:"scroll-mt-16 font-semibold text-foreground",children:vi(j,`${t}-heading-${i}`,!0,n)},`${t}-heading-${i}`)}),i+=1;continue}if(i+1<e.length&&c.includes("|")&&tg(e[i+1])){const L=nh(c),I=YT(e[i+1]),j=[],P=i;for(i+=2;i<e.length&&e[i].includes("|")&&e[i].trim();)j.push(nh(e[i])),i+=1;s.push({kind:"static",node:o.jsx("div",{className:LT,"data-markdown-table-scroll":!0,children:o.jsxs("table",{className:"w-max min-w-full max-w-none table-auto border-collapse text-left text-[11px] sm:text-xs",children:[o.jsx("thead",{className:"bg-surface-2 text-foreground",children:o.jsx("tr",{children:L.map((F,R)=>o.jsx("th",{className:`${kT} ${eg(I[R]??null)}`,children:o.jsx("div",{className:Xm,children:vi(F,`${t}-th-${P}-${R}`,!0,n)})},`h-${R}`))})}),o.jsx("tbody",{children:j.map((F,R)=>o.jsx("tr",{className:"border-t border-border/10",children:L.map((C,$)=>o.jsx("td",{className:`${_T} ${eg(I[$]??null)}`,children:o.jsx("div",{className:Xm,children:vi(F[$]??"",`${t}-td-${P}-${R}-${$}`,!0,n)})},`c-${$}`))},`r-${R}`))})]})},`${t}-table-${P}`)});continue}const y=t5(c);if(y){const L=y.ordered,I=e5(c),j=y.start,P=i,F=KT(e,i,I,L,!1);i=F.nextIndex,s.push({kind:"list",keyPrefix:`${t}-list-${P}`,ordered:L,start:L?j:void 0,renders:n5(F.items,`${t}-list-${P}`,n,l(0)-1)});continue}const v=[c.trimStart()],S=[l(i)],A=i;for(i+=1;i<e.length&&e[i].trim()&&!k2(e[i])&&!(i+1<e.length&&e[i].includes("|")&&tg(e[i+1]));)v.push(e[i].trimStart()),S.push(l(i)),i+=1;const T=I2(v,`${t}-p-${A}`,n);s.push({kind:"paragraph",keyPrefix:`${t}-p-${A}`,perLine:T.perLine,hardBreaks:T.hardBreaks,lineNums:S})}return s}function fee(e,t){return e.map(n=>{switch(n.kind){case"static":return n.node;case"paragraph":return o.jsx("p",{children:R2(n.perLine,n.hardBreaks,n.lineNums,n.keyPrefix,t)},n.keyPrefix);case"list":{const r=n.ordered?"ol":"ul";return o.jsx(r,{start:n.start,className:`${n.ordered?"list-decimal":"list-disc"} space-y-0.5 pl-4 marker:text-muted-foreground/70`,children:r5(n.renders,t)},n.keyPrefix)}case"code":return o.jsx(ng,{code:n.code,lang:n.lang,blockKey:n.blockKey,codeStartLine:n.codeStartLine,lineRange:t},n.key)}})}let Qp=null,j4=!1;const $p=16,XT=192;function hee(){return Qp||(Qp=o0(()=>import("./mermaid.core-
|
|
184
|
+
`).replace(/\n+$/,""),lang:"",blockKey:`${t}-indented-code-${I}`,codeStartLine:l(I)});continue}const g=u.match(/^(#{1,6})\s+(.+)$/);if(g){const I=`h${Math.min(6,g[1].length+1)}`,j=jT(g[2]),P=_2(j,n);s.push({kind:"static",node:o.jsx(I,{id:P,className:"scroll-mt-16 font-semibold text-foreground",children:vi(j,`${t}-heading-${i}`,!0,n)},`${t}-heading-${i}`)}),i+=1;continue}if(i+1<e.length&&c.includes("|")&&tg(e[i+1])){const L=nh(c),I=YT(e[i+1]),j=[],P=i;for(i+=2;i<e.length&&e[i].includes("|")&&e[i].trim();)j.push(nh(e[i])),i+=1;s.push({kind:"static",node:o.jsx("div",{className:LT,"data-markdown-table-scroll":!0,children:o.jsxs("table",{className:"w-max min-w-full max-w-none table-auto border-collapse text-left text-[11px] sm:text-xs",children:[o.jsx("thead",{className:"bg-surface-2 text-foreground",children:o.jsx("tr",{children:L.map((F,R)=>o.jsx("th",{className:`${kT} ${eg(I[R]??null)}`,children:o.jsx("div",{className:Xm,children:vi(F,`${t}-th-${P}-${R}`,!0,n)})},`h-${R}`))})}),o.jsx("tbody",{children:j.map((F,R)=>o.jsx("tr",{className:"border-t border-border/10",children:L.map((C,$)=>o.jsx("td",{className:`${_T} ${eg(I[$]??null)}`,children:o.jsx("div",{className:Xm,children:vi(F[$]??"",`${t}-td-${P}-${R}-${$}`,!0,n)})},`c-${$}`))},`r-${R}`))})]})},`${t}-table-${P}`)});continue}const y=t5(c);if(y){const L=y.ordered,I=e5(c),j=y.start,P=i,F=KT(e,i,I,L,!1);i=F.nextIndex,s.push({kind:"list",keyPrefix:`${t}-list-${P}`,ordered:L,start:L?j:void 0,renders:n5(F.items,`${t}-list-${P}`,n,l(0)-1)});continue}const v=[c.trimStart()],S=[l(i)],A=i;for(i+=1;i<e.length&&e[i].trim()&&!k2(e[i])&&!(i+1<e.length&&e[i].includes("|")&&tg(e[i+1]));)v.push(e[i].trimStart()),S.push(l(i)),i+=1;const T=I2(v,`${t}-p-${A}`,n);s.push({kind:"paragraph",keyPrefix:`${t}-p-${A}`,perLine:T.perLine,hardBreaks:T.hardBreaks,lineNums:S})}return s}function fee(e,t){return e.map(n=>{switch(n.kind){case"static":return n.node;case"paragraph":return o.jsx("p",{children:R2(n.perLine,n.hardBreaks,n.lineNums,n.keyPrefix,t)},n.keyPrefix);case"list":{const r=n.ordered?"ol":"ul";return o.jsx(r,{start:n.start,className:`${n.ordered?"list-decimal":"list-disc"} space-y-0.5 pl-4 marker:text-muted-foreground/70`,children:r5(n.renders,t)},n.keyPrefix)}case"code":return o.jsx(ng,{code:n.code,lang:n.lang,blockKey:n.blockKey,codeStartLine:n.codeStartLine,lineRange:t},n.key)}})}let Qp=null,j4=!1;const $p=16,XT=192;function hee(){return Qp||(Qp=o0(()=>import("./mermaid.core-BdXk5TA4.js").then(e=>e.aJ),__vite__mapDeps([6,1,7])).then(e=>e.default??e).catch(e=>{throw Qp=null,e})),Qp}function pee(e){j4||(e.initialize({startOnLoad:!1,securityLevel:"strict",theme:"neutral"}),j4=!0)}function mee(e){const t=e.match(/\sviewBox=(["'])([^"']+)\1/i);if(!t)return e;const[,,n]=t,r=n.trim().split(/[\s,]+/).map(Number),[,,s,i]=r;if(!Number.isFinite(s)||!Number.isFinite(i)||s<=0||i<=0)return e;const l=Math.max(XT,Math.ceil(s)),c=Math.ceil(l/s*i);return e.replace(/<svg\b([^>]*)>/i,(u,f)=>`<svg${f.replace(/\s(?:width|height)=(["']).*?\1/gi,"").replace(/\sstyle=(["']).*?\1/gi,"")} width="${l}" height="${c}">`)}function gee(e){const t=e?.querySelector("svg");if(!t)return;let n;try{n=t.getBBox()}catch{return}if(!Number.isFinite(n.width)||!Number.isFinite(n.height)||n.width<=0||n.height<=0)return;const r=n.x-$p,s=n.y-$p,i=n.width+$p*2,l=n.height+$p*2,c=Math.max(XT,Math.ceil(i)),u=Math.ceil(c/i*l);t.setAttribute("viewBox",`${r} ${s} ${i} ${l}`),t.setAttribute("width",String(c)),t.setAttribute("height",String(u)),t.removeAttribute("style")}function xee(e){const t=e.trim().split(/\s+/,1)[0]?.toLowerCase();if(!t)return null;const n=t.replace(/^language-/,"");return Jf(`code.${n}`)??n}function ZT({code:e,blockKey:t}){const{t:n}=Vn(),[r,s]=b.useState(null),[i,l]=b.useState(!1),c=b.useRef(null),u=b.useContext(MT);b.useEffect(()=>{let p=!1;return s(null),l(!1),hee().then(async g=>{pee(g);const y=`termdock-md-mermaid-${t.replace(/[^a-zA-Z0-9_-]/g,"-")}`,{svg:v}=await g.render(y,e);p||s(mee(v))}).catch(()=>{p||l(!0)}),()=>{p=!0}},[t,e]),b.useLayoutEffect(()=>{r&&gee(c.current)},[r]);const f=b.useCallback(()=>{const p=c.current?.querySelector("svg")?.outerHTML??r;p&&u?.(p)},[u,r]);return i?o.jsx(ng,{code:e,lang:"mermaid",blockKey:`${t}-fallback`}):o.jsxs("div",{className:"overflow-hidden rounded-lg border border-border/20 bg-surface shadow-sm",children:[o.jsx("div",{className:"border-b border-border/15 bg-surface-2 px-3 py-1.5 text-[10px] uppercase tracking-wide text-muted-foreground",children:"mermaid"}),o.jsx("div",{className:"bg-surface p-3",children:r?o.jsx("button",{type:"button",className:"block max-w-full rounded text-left focus:outline-none focus:ring-2 focus:ring-ring/45",title:n("rightSidebar.openMermaidDiagram"),onClick:p=>{p.stopPropagation(),f()},children:o.jsx("span",{ref:c,role:"img","aria-label":n("rightSidebar.mermaidDiagram"),className:"block max-h-[70vh] max-w-full overflow-auto rounded bg-white p-2 text-slate-900 [&_svg]:block [&_svg]:h-auto [&_svg]:max-w-full",dangerouslySetInnerHTML:{__html:r}})}):o.jsx("div",{className:"py-6 text-center text-xs text-muted-foreground",children:n("rightSidebar.renderingDiagram")})})]})}function ng({code:e,lang:t,blockKey:n,codeStartLine:r,lineRange:s}){const i=xee(t),[l,c]=b.useState(null);b.useEffect(()=>{if(!i||!q9(e)){c(null);return}let f=!1;return Y9().then(p=>{if(f||!p.registered(i)){f||c(null);return}try{c(K9(p,e,i))}catch{f||c(null)}}).catch(()=>{f||c(null)}),()=>{f=!0}},[n,e,i]);const u=l??(e||" ").split(`
|
|
185
185
|
`).map(f=>[f||" "]);return o.jsxs("div",{className:"overflow-hidden rounded-lg border border-border/20 bg-surface shadow-sm",children:[t&&o.jsx("div",{className:"border-b border-border/15 bg-surface-2 px-3 py-1.5 text-[10px] uppercase tracking-wide text-muted-foreground",children:t}),o.jsx("pre",{className:`${Zy} termdock-code overflow-auto p-3 text-[11px] leading-relaxed text-foreground`,children:o.jsx("code",{children:u.map((f,p)=>{const g=r!=null?r+p:null,y=!!(s&&g!=null&&g>=s.start&&g<=s.end);return o.jsxs("span",{"data-md-ref-start":g??void 0,"data-md-ref-end":g??void 0,"data-selected":y?"true":void 0,children:[f,p<u.length-1?`
|
|
186
186
|
`:null]},`${n}-line-${p}`)})})})]})}function bee(e,t,n,r,s){e=qJ(e);const i=GJ(e),l=VJ(e),c=[],u={markdownFilePath:t,rootPath:n,referenceDefinitions:i,footnoteDefinitions:WJ(e),headingSlugCounts:new Map,images:c,onImageOpen:r,footnotesLabel:s?.footnotes??"Footnotes",backToFootnoteLabel:s?.backToFootnote??(y=>`Back to footnote ${y}`)},f=[];let p=0;for(;p<e.length;){const y=e[p],v=y.trim();if(Zm(y)||l.has(p)){p+=1;continue}if(!v){p+=1;continue}if(/^<details>\s*$/i.test(v)){const R=p;let C="Details";const $=[];for(p+=1;p<e.length&&!/^<\/details>\s*$/i.test(e[p].trim());){const Q=e[p].trim().match(/^<summary>(.*?)<\/summary>\s*$/i);Q?C=Q[1].trim()||C:$.push(e[p].trimStart()),p+=1}p<e.length&&(p+=1),f.push({key:`details-${R}`,startLine:R+1,endLine:p,content:o.jsxs("details",{className:"overflow-hidden rounded-lg border border-border/20 bg-surface px-3 py-2 text-muted-foreground",children:[o.jsx("summary",{className:"cursor-pointer text-sm font-semibold text-foreground",children:vi(C,`details-${R}-summary`,!0,u)}),$.length>0&&o.jsx("div",{className:"mt-2 text-sm leading-6",children:qT($,`details-${R}`,u)})]})});continue}const S=zT(y);if(S){const R=[y],C=p;for(p+=1;p<e.length&&!S.selfContained&&!new RegExp(`</${S.tag}>`,"i").test(e[p]);)R.push(e[p]),p+=1;p<e.length&&!S.selfContained&&(R.push(e[p]),p+=1),f.push({key:`html-${C}`,startLine:C+1,endLine:p,content:o.jsx(UT,{html:R.join(`
|
|
187
187
|
`)})});continue}const A=v.match(/^(```|~~~)\s*(.*)$/);if(A){const R=[],C=A[1],$=A[2]?.trim(),Q=p;for(p+=1;p<e.length&&!e[p].trim().startsWith(C);)R.push(e[p]),p+=1;p<e.length&&(p+=1),f.push({key:`code-${Q}`,startLine:Q+1,endLine:p,fineGrained:$.toLowerCase()!=="mermaid"&&!["math","latex","tex"].includes($.toLowerCase()),content:$.toLowerCase()==="mermaid"?o.jsx(ZT,{code:R.join(`
|
|
@@ -454,4 +454,4 @@ ${Pt}
|
|
|
454
454
|
+ }
|
|
455
455
|
return context;
|
|
456
456
|
}`}};function a7(){if(typeof window>"u")return"kotlin";const t=new URLSearchParams(window.location.search).get("fixture");return t&&t in D2?t:"kotlin"}function l7(){return typeof window>"u"?"unified":new URLSearchParams(window.location.search).get("view")==="split"?"split":"unified"}function c7(){if(typeof window>"u")return"words";const e=new URLSearchParams(window.location.search).get("inline");return e==="none"||e==="chars"||e==="words"?e:"words"}function u7(){return typeof window>"u"?!0:new URLSearchParams(window.location.search).get("wrap")!=="off"}function Ite(){const[e,t]=b.useState(()=>a7()),[n,r]=b.useState(()=>l7()),[s,i]=b.useState(()=>c7()),[l,c]=b.useState(()=>u7()),u=D2[e],f=b.useMemo(()=>Object.entries(D2),[]);return b.useEffect(()=>{if(typeof window>"u")return;let p=window.location.search;const g=()=>{window.location.search!==p&&(p=window.location.search,t(a7()),r(l7()),i(c7()),c(u7()))};window.addEventListener("popstate",g),window.addEventListener("pageshow",g),window.addEventListener("focus",g);const y=window.setInterval(g,250);return()=>{window.removeEventListener("popstate",g),window.removeEventListener("pageshow",g),window.removeEventListener("focus",g),window.clearInterval(y)}},[]),o.jsx("div",{className:"min-h-screen bg-background-subtle text-foreground","data-diff-lab":!0,"data-diff-lab-fixture":e,"data-diff-lab-view":n,"data-diff-lab-inline":s,"data-diff-lab-wrap":l?"on":"off",children:o.jsxs("div",{className:"mx-auto flex min-h-screen max-w-[1180px] flex-col px-4 py-4",children:[o.jsxs("header",{className:"mb-3 flex flex-wrap items-center justify-between gap-3 border-b border-border/20 pb-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-sm font-semibold",children:"Diff Lab"}),o.jsx("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:"Fixed fixtures for iterating diff rendering without app auth, PWA state, or live Git data."})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("select",{value:e,onChange:p=>t(p.target.value),"aria-label":"Fixture",className:"h-8 rounded-md border border-border/30 bg-surface px-2 text-xs text-foreground outline-none",children:f.map(([p,g])=>o.jsx("option",{value:p,children:g.label},p))}),o.jsxs("div",{className:"inline-flex h-8 overflow-hidden rounded-full bg-surface-2 p-0.5",children:[o.jsx("button",{type:"button",onClick:()=>r("unified"),className:`rounded-full px-3 text-xs font-semibold ${n==="unified"?"bg-surface-elevated text-foreground":"text-muted-foreground"}`,children:"Unified"}),o.jsx("button",{type:"button",onClick:()=>r("split"),className:`rounded-full px-3 text-xs font-semibold ${n==="split"?"bg-surface-elevated text-foreground":"text-muted-foreground"}`,children:"Split"})]}),o.jsx("div",{className:"inline-flex h-8 overflow-hidden rounded-full bg-surface-2 p-0.5",children:["none","words","chars"].map(p=>o.jsx("button",{type:"button",onClick:()=>i(p),className:`rounded-full px-3 text-xs font-semibold ${s===p?"bg-surface-elevated text-foreground":"text-muted-foreground"}`,children:p},p))}),o.jsxs("button",{type:"button",onClick:()=>c(p=>!p),className:`h-8 rounded-full px-3 text-xs font-semibold ${l?"bg-primary/15 text-primary":"bg-surface-2 text-muted-foreground"}`,children:["Wrap ",l?"on":"off"]})]})]}),o.jsx("main",{className:"min-h-0 flex-1 overflow-auto rounded-lg border border-border/20 bg-surface",children:o.jsx(cT,{filePath:u.path,repoRoot:"/tmp/termdock-diff-lab",changedFile:{path:u.path,absolutePath:`/tmp/termdock-diff-lab/${u.path}`,repoRoot:"/tmp/termdock-diff-lab",status:"modified",staged:!1,unstaged:!0,untracked:!1,tracked:!0,canStage:!1,canUnstage:!1,canStash:!1,canRestoreWorktree:!1},diffOverride:u.diff,oldSourceOverride:u.oldSource,active:!0,wrap:l,showScrollHint:!l,viewType:n,inlineMode:s})})]})})}const dC=40,j2="/tmp/termdock-diff-review-lab";function d7(e,t){const n=[`diff --git a/${e} b/${e}`,`--- a/${e}`,`+++ b/${e}`,`@@ -1,${t} +1,${t} @@`];for(let r=0;r<t;r+=1)r%5===0&&n.push(`-const removed_${r} = ${r};`),r%3===0&&n.push(`+const added_${r} = ${r} * 2;`),n.push(` context line ${r} in ${e}`);return n.join(`
|
|
457
|
-
`)}function Rte(e,t){return Array.from({length:dC},(n,r)=>{const s=6+r*7%60,i=`src/module${String(r).padStart(2,"0")}/File${r}.ts`,l=`${j2}/${i}`,c=d7(i,s),u=d7(i,1);return{key:l,path:i,absolutePath:l,status:"modified",repoRoot:j2,displayName:`File${r}.ts`,displayDir:`src/module${String(r).padStart(2,"0")} · ${s} lines`,diffOverride:!t||e.has(r)?c:u,auditRecords:[]}})}function Nte(){const e=b.useMemo(()=>{if(typeof window>"u")return 0;const L=new URLSearchParams(window.location.search).get("delay"),I=L===null?0:Number.parseInt(L,10);return Number.isInteger(I)&&I>0?I:0},[]),t=e>0,[n,r]=b.useState(()=>new Set);b.useEffect(()=>{if(!t)return;const L=Array.from({length:dC},(I,j)=>window.setTimeout(()=>{r(P=>{const F=new Set(P);return F.add(j),F})},e+j*20));return()=>L.forEach(I=>window.clearTimeout(I))},[t,e]);const s=b.useMemo(()=>Rte(n,t),[n,t]),i=b.useMemo(()=>[{key:"mock-repo",root:j2,label:"diff-review-lab",files:s.map(L=>({key:L.key,path:L.path,absolutePath:L.absolutePath,displayName:L.displayName,displayDir:L.displayDir,status:L.status}))}],[s]),l=b.useMemo(()=>{if(typeof window>"u")return null;const L=new URLSearchParams(window.location.search).get("select");if(L===null)return null;const I=Number.parseInt(L,10);return Number.isInteger(I)&&I>=0&&I<s.length?I:null},[s.length]),[c,u]=b.useState(()=>l!==null?s[l].key:null),[f,p]=b.useState(()=>({key:l!==null?s[l].key:null,nonce:l!==null?1:0})),[g,y]=b.useState("list"),[v,S]=b.useState(new Set),[A,T]=b.useState(l!==null?1:0);return o.jsxs("div",{className:"flex h-screen flex-col bg-background text-foreground","data-diff-review-lab":!0,children:[o.jsxs("div",{className:"shrink-0 border-b border-border/20 px-3 py-2 text-xs text-muted-foreground",children:["DiffReview Lab · ",s.length," mock files · selected: ",o.jsx("span",{"data-lab-selected":!0,children:c??"none"})," · slide ",A]}),o.jsx("div",{className:"min-h-0 flex-1",children:o.jsx(qm,{mobile:!0,backLabel:"Back",files:s,groups:i,selectedKey:c,scrollToKey:f.key,scrollToKeyNonce:f.nonce,mode:g,onModeChange:L=>{L!=="ai"&&y(L)},collapsedDirectoryKeys:v,onToggleDirectory:L=>S(I=>{const j=new Set(I);return j.has(L)?j.delete(L):j.add(L),j}),onSelectFile:L=>{u(L.key),p(I=>({key:L.key,nonce:I.nonce+1}))},onMobileSlideChange:T,renderLeading:()=>null,renderStreamBadge:L=>o.jsx("span",{className:"text-[10px] text-muted-foreground",children:L}),wrap:!0,showScrollHint:!1,activePane:!0})})]})}const Mte=6e4,rb="termdock:build-id:v1";let f7=!1;function h7(){f7||(f7=!0,window.setTimeout(()=>{window.location.reload()},80))}function P2(e){e.waiting?.postMessage({type:"SKIP_WAITING"})}async function Dte(){if(typeof caches>"u")return;const e=await caches.keys();await Promise.all(e.map(t=>caches.delete(t)))}function jte(e){e.addEventListener("updatefound",()=>{const t=e.installing;t&&t.addEventListener("statechange",()=>{t.state==="installed"&&navigator.serviceWorker.controller&&P2(e)})})}function Pte(){if(typeof window>"u"||!("serviceWorker"in navigator))return;const e="
|
|
457
|
+
`)}function Rte(e,t){return Array.from({length:dC},(n,r)=>{const s=6+r*7%60,i=`src/module${String(r).padStart(2,"0")}/File${r}.ts`,l=`${j2}/${i}`,c=d7(i,s),u=d7(i,1);return{key:l,path:i,absolutePath:l,status:"modified",repoRoot:j2,displayName:`File${r}.ts`,displayDir:`src/module${String(r).padStart(2,"0")} · ${s} lines`,diffOverride:!t||e.has(r)?c:u,auditRecords:[]}})}function Nte(){const e=b.useMemo(()=>{if(typeof window>"u")return 0;const L=new URLSearchParams(window.location.search).get("delay"),I=L===null?0:Number.parseInt(L,10);return Number.isInteger(I)&&I>0?I:0},[]),t=e>0,[n,r]=b.useState(()=>new Set);b.useEffect(()=>{if(!t)return;const L=Array.from({length:dC},(I,j)=>window.setTimeout(()=>{r(P=>{const F=new Set(P);return F.add(j),F})},e+j*20));return()=>L.forEach(I=>window.clearTimeout(I))},[t,e]);const s=b.useMemo(()=>Rte(n,t),[n,t]),i=b.useMemo(()=>[{key:"mock-repo",root:j2,label:"diff-review-lab",files:s.map(L=>({key:L.key,path:L.path,absolutePath:L.absolutePath,displayName:L.displayName,displayDir:L.displayDir,status:L.status}))}],[s]),l=b.useMemo(()=>{if(typeof window>"u")return null;const L=new URLSearchParams(window.location.search).get("select");if(L===null)return null;const I=Number.parseInt(L,10);return Number.isInteger(I)&&I>=0&&I<s.length?I:null},[s.length]),[c,u]=b.useState(()=>l!==null?s[l].key:null),[f,p]=b.useState(()=>({key:l!==null?s[l].key:null,nonce:l!==null?1:0})),[g,y]=b.useState("list"),[v,S]=b.useState(new Set),[A,T]=b.useState(l!==null?1:0);return o.jsxs("div",{className:"flex h-screen flex-col bg-background text-foreground","data-diff-review-lab":!0,children:[o.jsxs("div",{className:"shrink-0 border-b border-border/20 px-3 py-2 text-xs text-muted-foreground",children:["DiffReview Lab · ",s.length," mock files · selected: ",o.jsx("span",{"data-lab-selected":!0,children:c??"none"})," · slide ",A]}),o.jsx("div",{className:"min-h-0 flex-1",children:o.jsx(qm,{mobile:!0,backLabel:"Back",files:s,groups:i,selectedKey:c,scrollToKey:f.key,scrollToKeyNonce:f.nonce,mode:g,onModeChange:L=>{L!=="ai"&&y(L)},collapsedDirectoryKeys:v,onToggleDirectory:L=>S(I=>{const j=new Set(I);return j.has(L)?j.delete(L):j.add(L),j}),onSelectFile:L=>{u(L.key),p(I=>({key:L.key,nonce:I.nonce+1}))},onMobileSlideChange:T,renderLeading:()=>null,renderStreamBadge:L=>o.jsx("span",{className:"text-[10px] text-muted-foreground",children:L}),wrap:!0,showScrollHint:!1,activePane:!0})})]})}const Mte=6e4,rb="termdock:build-id:v1";let f7=!1;function h7(){f7||(f7=!0,window.setTimeout(()=>{window.location.reload()},80))}function P2(e){e.waiting?.postMessage({type:"SKIP_WAITING"})}async function Dte(){if(typeof caches>"u")return;const e=await caches.keys();await Promise.all(e.map(t=>caches.delete(t)))}function jte(e){e.addEventListener("updatefound",()=>{const t=e.installing;t&&t.addEventListener("statechange",()=>{t.state==="installed"&&navigator.serviceWorker.controller&&P2(e)})})}function Pte(){if(typeof window>"u"||!("serviceWorker"in navigator))return;const e="1788104910368",t=window.localStorage.getItem(rb);if(t&&t!==e){Dte().finally(()=>{window.localStorage.setItem(rb,e),h7()});return}t!==e&&window.localStorage.setItem(rb,e);let n=null;navigator.serviceWorker.addEventListener("controllerchange",h7),window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js",{scope:"/"}).then(r=>{jte(r),P2(r);const s=()=>{document.visibilityState==="visible"&&r.update().then(()=>P2(r)).catch(()=>{})};s(),n=window.setInterval(s,Mte),document.addEventListener("visibilitychange",s)}).catch(()=>{})}),window.addEventListener("beforeunload",()=>{n!==null&&window.clearInterval(n)})}HF();Pte();try{const e=JSON.parse(window.localStorage.getItem("termdock-color-theme")||"null");(e==="dark"||e==="light")&&(document.documentElement.dataset.theme=e,YA(e))}catch{}function Bte(){const{t:e}=Vn(),[t,n]=b.useState(null),[r,s]=b.useState(null),i=b.useCallback(async()=>{try{const l=await kE();n(l),s(null)}catch(l){s(l instanceof Error?l.message:"Failed to query auth status")}},[]);return b.useEffect(()=>{i()},[i]),b.useEffect(()=>{const l=()=>{n(c=>c&&{...c,authenticated:!1})};return window.addEventListener(ym,l),()=>window.removeEventListener(ym,l)},[]),t===null?o.jsx("div",{className:"flex w-screen items-center justify-center bg-background text-muted-foreground",style:{height:"var(--app-vh, 100vh)"},children:r?`${e("common.error")}: ${r}`:e("common.loading")}):t.enabled&&!t.authenticated?o.jsx(Lte,{onLoginSuccess:i}):o.jsx(kte,{})}qk.createRoot(document.getElementById("root")).render(o.jsx(D.StrictMode,{children:o.jsx(dR,{children:o.jsx(tS,{children:(()=>{const e=new URLSearchParams(window.location.search);return e.get("dag-playground")==="1"?o.jsx(Ete,{}):e.get("diff-review-lab")==="1"?o.jsx(Nte,{}):e.get("diff-lab")==="1"?o.jsx(Ite,{}):o.jsx(Bte,{})})()})})}));export{FN as M,fi as R,RM as S,o0 as _,UN as a,GN as b,Mt as c,o as j,Vn as u,EL as v};
|