crewx 0.8.8 → 0.8.9-rc.1
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/assets/{MarketPage-D8C-Rlao.js → MarketPage-Bnv2saW1.js} +1 -1
- package/dist/assets/{PromptTab-DY8LtmCY.js → PromptTab-D0HHJwEv.js} +1 -1
- package/dist/assets/{arc-CzQV_ye4.js → arc-CFW0t9T4.js} +1 -1
- package/dist/assets/{architectureDiagram-UYN6MBPD-D0i7aygQ.js → architectureDiagram-UYN6MBPD-Bg4Tz5B9.js} +1 -1
- package/dist/assets/{blockDiagram-ZHA2E4KO-D7J4iDRu.js → blockDiagram-ZHA2E4KO-CZynHFsv.js} +1 -1
- package/dist/assets/{c4Diagram-6F5ED5ID-Ba_Cc5of.js → c4Diagram-6F5ED5ID-BUe_rR7Y.js} +1 -1
- package/dist/assets/channel-Deb-qFqi.js +1 -0
- package/dist/assets/{chunk-5HRBRIJM-BBQMHbzA.js → chunk-5HRBRIJM-VWEDho2B.js} +1 -1
- package/dist/assets/{chunk-7U56Z5CX-BOUPBcjo.js → chunk-7U56Z5CX-IVaYF1Wj.js} +1 -1
- package/dist/assets/{chunk-ASOPGD6M-BC-lEsww.js → chunk-ASOPGD6M-i8At8zRu.js} +1 -1
- package/dist/assets/{chunk-KFBOBJHC-BI3ZCKI3.js → chunk-KFBOBJHC-CxbLrU0W.js} +1 -1
- package/dist/assets/{chunk-T2TOU4HS-BAlaWcnS.js → chunk-T2TOU4HS-C4FogIJY.js} +1 -1
- package/dist/assets/{chunk-TMUBEWPD-CK825aJe.js → chunk-TMUBEWPD-Q3a3gmJu.js} +1 -1
- package/dist/assets/classDiagram-LNE6IOMH-4CBrVNwA.js +1 -0
- package/dist/assets/classDiagram-v2-MQ7JQ4JX-4CBrVNwA.js +1 -0
- package/dist/assets/{dagre-4EVJKHTY-BfMCYKXE.js → dagre-4EVJKHTY-BJ50i2_m.js} +1 -1
- package/dist/assets/{diagram-QW4FP2JN-DimopNi-.js → diagram-QW4FP2JN-0SUZm5X-.js} +1 -1
- package/dist/assets/{erDiagram-6RL3IURR-CTF3Vx9w.js → erDiagram-6RL3IURR-BAhBdC1z.js} +1 -1
- package/dist/assets/{flowDiagram-7ASYPVHJ-BsfbSUri.js → flowDiagram-7ASYPVHJ-DlrcDbvp.js} +1 -1
- package/dist/assets/{ganttDiagram-NTVNEXSI-BmNtoCBX.js → ganttDiagram-NTVNEXSI-BLSL7dfk.js} +1 -1
- package/dist/assets/{gitGraph-YCYPL57B-CJfFJ61R.js → gitGraph-YCYPL57B-D16xMGK9.js} +1 -1
- package/dist/assets/{gitGraphDiagram-NRZ2UAAF-Y2LdSzUs.js → gitGraphDiagram-NRZ2UAAF-7ip44CZQ.js} +1 -1
- package/dist/assets/{infoDiagram-A4XQUW5V-CHgQZgl1.js → infoDiagram-A4XQUW5V-CT9ls8r5.js} +1 -1
- package/dist/assets/{journeyDiagram-G5WM74LC-hRHcK6hW.js → journeyDiagram-G5WM74LC-BRE4IIDc.js} +1 -1
- package/dist/assets/{kanban-definition-QRCXZQQD-Y4J1NLNP.js → kanban-definition-QRCXZQQD-Dsh4cbhB.js} +1 -1
- package/dist/assets/{linear-BoK1zOS5.js → linear-Jngh3ocV.js} +1 -1
- package/dist/assets/{main-0MiOLUeX.js → main-DTxFfBE0.js} +7 -7
- package/dist/assets/{mindmap-definition-GWI6TPTV-CIbY17Q3.js → mindmap-definition-GWI6TPTV-BpT7MvEu.js} +1 -1
- package/dist/assets/{pieDiagram-YF2LJOPJ-SG8yyUQS.js → pieDiagram-YF2LJOPJ-CeKkxh4S.js} +1 -1
- package/dist/assets/{quadrantDiagram-OS5C2QUG-CbLVdWjN.js → quadrantDiagram-OS5C2QUG-BXiERIqS.js} +1 -1
- package/dist/assets/{requirementDiagram-MIRIMTAZ--q6KKZJt.js → requirementDiagram-MIRIMTAZ-wJozTJV-.js} +1 -1
- package/dist/assets/{sankeyDiagram-Y46BX6SQ-CU_Sn0Ew.js → sankeyDiagram-Y46BX6SQ-C8AMM3An.js} +1 -1
- package/dist/assets/{sequenceDiagram-G6AWOVSC-DbUmmd6U.js → sequenceDiagram-G6AWOVSC-BiqICp8h.js} +1 -1
- package/dist/assets/{stateDiagram-MAYHULR4-2tNTUSMA.js → stateDiagram-MAYHULR4-oVBKhczb.js} +1 -1
- package/dist/assets/stateDiagram-v2-4JROLMXI-BAEx6L5g.js +1 -0
- package/dist/assets/{timeline-definition-U7ZMHBDA-D2g94zIE.js → timeline-definition-U7ZMHBDA-D6vmf3rm.js} +1 -1
- package/dist/assets/{xychartDiagram-6QU3TZC5-uf-9lMPy.js → xychartDiagram-6QU3TZC5-BDaatX2I.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +6 -6
- package/packages/cli/package.json +1 -1
- package/dist/assets/channel-DkWSQjGV.js +0 -1
- package/dist/assets/classDiagram-LNE6IOMH-Cyiu-I1c.js +0 -1
- package/dist/assets/classDiagram-v2-MQ7JQ4JX-Cyiu-I1c.js +0 -1
- package/dist/assets/stateDiagram-v2-4JROLMXI-0m7UxY6u.js +0 -1
|
@@ -45,7 +45,7 @@ Error generating stack: `+c.message+`
|
|
|
45
45
|
*
|
|
46
46
|
* This source code is licensed under the MIT license found in the
|
|
47
47
|
* LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/var N7=F;function IFn(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var OFn=typeof Object.is=="function"?Object.is:IFn,LFn=N7.useState,PFn=N7.useEffect,RFn=N7.useLayoutEffect,$Fn=N7.useDebugValue;function FFn(t,n){var i=n(),o=LFn({inst:{value:i,getSnapshot:n}}),a=o[0].inst,c=o[1];return RFn(function(){a.value=i,a.getSnapshot=n,mIe(a)&&c({inst:a})},[t,i,n]),PFn(function(){return mIe(a)&&c({inst:a}),t(function(){mIe(a)&&c({inst:a})})},[t]),$Fn(i),i}function mIe(t){var n=t.getSnapshot;t=t.value;try{var i=n();return!OFn(t,i)}catch{return!0}}function BFn(t,n){return n()}var zFn=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?BFn:FFn;NKt.useSyncExternalStore=N7.useSyncExternalStore!==void 0?N7.useSyncExternalStore:zFn;MKt.exports=NKt;var Bge=MKt.exports;const HFn=(t,n)=>a9(n)?n:vFn(n)&&a9(n.defaultValue)?n.defaultValue:Array.isArray(t)?t[t.length-1]:t,UFn={t:HFn,ready:!1},WFn=()=>()=>{},Zn=(t,n={})=>{var te,Q,se;const{i18n:i}=n,{i18n:o,defaultNS:a}=F.useContext(jFn)||{},c=i||o||MFn();c&&!c.reportNamespaces&&(c.reportNamespaces=new DFn),c||_Kt(c,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const u=F.useMemo(()=>{var ce;return{...TFn(),...(ce=c==null?void 0:c.options)==null?void 0:ce.react,...n}},[c,n]),{useSuspense:f,keyPrefix:g}=u,w=a||((te=c==null?void 0:c.options)==null?void 0:te.defaultNS),x=a9(w)?[w]:w||["translation"],v=F.useMemo(()=>x,x);(se=(Q=c==null?void 0:c.reportNamespaces)==null?void 0:Q.addUsedNamespaces)==null||se.call(Q,v);const C=F.useRef(0),E=F.useCallback(ce=>{if(!c)return WFn;const{bindI18n:V,bindI18nStore:ae}=u,de=()=>{C.current+=1,ce()};return V&&c.on(V,de),ae&&c.store.on(ae,de),()=>{V&&V.split(" ").forEach(ee=>c.off(ee,de)),ae&&ae.split(" ").forEach(ee=>c.store.off(ee,de))}},[c,u]),A=F.useRef(),M=F.useCallback(()=>{if(!c)return UFn;const ce=!!(c.isInitialized||c.initializedStoreOnce)&&v.every(he=>xFn(he,c,u)),V=n.lng||c.language,ae=C.current,de=A.current;if(de&&de.ready===ce&&de.lng===V&&de.keyPrefix===g&&de.revision===ae)return de;const ue={t:c.getFixedT(V,u.nsMode==="fallback"?v:v[0],g),ready:ce,lng:V,keyPrefix:g,revision:ae};return A.current=ue,ue},[c,v,g,u,n.lng]),[I,D]=F.useState(0),{t:P,ready:R}=Bge.useSyncExternalStore(E,M,M);F.useEffect(()=>{if(c&&!R&&!f){const ce=()=>D(V=>V+1);n.lng?D7t(c,n.lng,v,ce):FPe(c,v,ce)}},[c,n.lng,v,R,f,I]);const z=c||{},U=F.useRef(null),W=F.useRef(),G=ce=>{const V=Object.getOwnPropertyDescriptors(ce);V.__original&&delete V.__original;const ae=Object.create(Object.getPrototypeOf(ce),V);if(!Object.prototype.hasOwnProperty.call(ae,"__original"))try{Object.defineProperty(ae,"__original",{value:ce,writable:!1,enumerable:!1,configurable:!1})}catch{}return ae},Y=F.useMemo(()=>{const ce=z,V=ce==null?void 0:ce.language;let ae=ce;ce&&(U.current&&U.current.__original===ce?W.current!==V?(ae=G(ce),U.current=ae,W.current=V):ae=U.current:(ae=G(ce),U.current=ae,W.current=V));const de=[P,ae,R];return de.t=P,de.i18n=ae,de.ready=R,de},[P,z,R,z.resolvedLanguage,z.language,z.languages]);if(c&&f&&!R)throw new Promise(ce=>{const V=()=>ce();n.lng?D7t(c,n.lng,v,V):FPe(c,v,V)});return Y},{slice:qFn,forEach:GFn}=[];function VFn(t){return GFn.call(qFn.call(arguments,1),n=>{if(n)for(const i in n)t[i]===void 0&&(t[i]=n[i])}),t}function KFn(t){return typeof t!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(i=>i.test(t))}const I7t=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,JFn=function(t,n){const o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},a=encodeURIComponent(n);let c=`${t}=${a}`;if(o.maxAge>0){const u=o.maxAge-0;if(Number.isNaN(u))throw new Error("maxAge should be a Number");c+=`; Max-Age=${Math.floor(u)}`}if(o.domain){if(!I7t.test(o.domain))throw new TypeError("option domain is invalid");c+=`; Domain=${o.domain}`}if(o.path){if(!I7t.test(o.path))throw new TypeError("option path is invalid");c+=`; Path=${o.path}`}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");c+=`; Expires=${o.expires.toUTCString()}`}if(o.httpOnly&&(c+="; HttpOnly"),o.secure&&(c+="; Secure"),o.sameSite)switch(typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite){case!0:c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"strict":c+="; SameSite=Strict";break;case"none":c+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o.partitioned&&(c+="; Partitioned"),c},O7t={create(t,n,i,o){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};i&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+i*60*1e3)),o&&(a.domain=o),document.cookie=JFn(t,n,a)},read(t){const n=`${t}=`,i=document.cookie.split(";");for(let o=0;o<i.length;o++){let a=i[o];for(;a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(n)===0)return a.substring(n.length,a.length)}return null},remove(t,n){this.create(t,"",-1,n)}};var YFn={name:"cookie",lookup(t){let{lookupCookie:n}=t;if(n&&typeof document<"u")return O7t.read(n)||void 0},cacheUserLanguage(t,n){let{lookupCookie:i,cookieMinutes:o,cookieDomain:a,cookieOptions:c}=n;i&&typeof document<"u"&&O7t.create(i,t,o,a,c)}},XFn={name:"querystring",lookup(t){var o;let{lookupQuerystring:n}=t,i;if(typeof window<"u"){let{search:a}=window.location;!window.location.search&&((o=window.location.hash)==null?void 0:o.indexOf("?"))>-1&&(a=window.location.hash.substring(window.location.hash.indexOf("?")));const u=a.substring(1).split("&");for(let f=0;f<u.length;f++){const g=u[f].indexOf("=");g>0&&u[f].substring(0,g)===n&&(i=u[f].substring(g+1))}}return i}},QFn={name:"hash",lookup(t){var a;let{lookupHash:n,lookupFromHashIndex:i}=t,o;if(typeof window<"u"){const{hash:c}=window.location;if(c&&c.length>2){const u=c.substring(1);if(n){const f=u.split("&");for(let g=0;g<f.length;g++){const w=f[g].indexOf("=");w>0&&f[g].substring(0,w)===n&&(o=f[g].substring(w+1))}}if(o)return o;if(!o&&i>-1){const f=c.match(/\/([a-zA-Z-]*)/g);return Array.isArray(f)?(a=f[typeof i=="number"?i:0])==null?void 0:a.replace("/",""):void 0}}}return o}};let dP=null;const L7t=()=>{if(dP!==null)return dP;try{if(dP=typeof window<"u"&&window.localStorage!==null,!dP)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{dP=!1}return dP};var ZFn={name:"localStorage",lookup(t){let{lookupLocalStorage:n}=t;if(n&&L7t())return window.localStorage.getItem(n)||void 0},cacheUserLanguage(t,n){let{lookupLocalStorage:i}=n;i&&L7t()&&window.localStorage.setItem(i,t)}};let fP=null;const P7t=()=>{if(fP!==null)return fP;try{if(fP=typeof window<"u"&&window.sessionStorage!==null,!fP)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{fP=!1}return fP};var eBn={name:"sessionStorage",lookup(t){let{lookupSessionStorage:n}=t;if(n&&P7t())return window.sessionStorage.getItem(n)||void 0},cacheUserLanguage(t,n){let{lookupSessionStorage:i}=n;i&&P7t()&&window.sessionStorage.setItem(i,t)}},tBn={name:"navigator",lookup(t){const n=[];if(typeof navigator<"u"){const{languages:i,userLanguage:o,language:a}=navigator;if(i)for(let c=0;c<i.length;c++)n.push(i[c]);o&&n.push(o),a&&n.push(a)}return n.length>0?n:void 0}},nBn={name:"htmlTag",lookup(t){let{htmlTag:n}=t,i;const o=n||(typeof document<"u"?document.documentElement:null);return o&&typeof o.getAttribute=="function"&&(i=o.getAttribute("lang")),i}},rBn={name:"path",lookup(t){var a;let{lookupFromPathIndex:n}=t;if(typeof window>"u")return;const i=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(i)?(a=i[typeof n=="number"?n:0])==null?void 0:a.replace("/",""):void 0}},iBn={name:"subdomain",lookup(t){var a,c;let{lookupFromSubdomainIndex:n}=t;const i=typeof n=="number"?n+1:1,o=typeof window<"u"&&((c=(a=window.location)==null?void 0:a.hostname)==null?void 0:c.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(o)return o[i]}};let jKt=!1;try{document.cookie,jKt=!0}catch{}const DKt=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];jKt||DKt.splice(1,1);const sBn=()=>({order:DKt,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class IKt{constructor(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(n,i)}init(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=VFn(i,this.options||{},sBn()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=a=>a.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(YFn),this.addDetector(XFn),this.addDetector(ZFn),this.addDetector(eBn),this.addDetector(tBn),this.addDetector(nBn),this.addDetector(rBn),this.addDetector(iBn),this.addDetector(QFn)}addDetector(n){return this.detectors[n.name]=n,this}detect(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,i=[];return n.forEach(o=>{if(this.detectors[o]){let a=this.detectors[o].lookup(this.options);a&&typeof a=="string"&&(a=[a]),a&&(i=i.concat(a))}}),i=i.filter(o=>o!=null&&!KFn(o)).map(o=>this.options.convertDetectedLanguage(o)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}cacheUserLanguage(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;i&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||i.forEach(o=>{this.detectors[o]&&this.detectors[o].cacheUserLanguage(n,this.options)}))}}IKt.type="languageDetector";const oBn={language:"언어",languageDesc:"UI 표시 언어를 변경합니다",theme:"테마",themeDesc:"화면 테마를 변경합니다",themeLight:"라이트",themeDark:"다크",themeSystemHint:"기본값은 시스템 설정을 따르며, 현재 {{theme}} 테마가 적용되고 있습니다.",tools:"도구",toolsDesc:"AI CLI 도구를 관리합니다",cliManager:"CLI 버전 관리",cliManagerDesc:"AI CLI 버전을 관리합니다 (업데이트/설치)",openCli:"열기",versionInfo:"버전 정보",versionInfoDesc:"현재 연결된 CrewX 서버 버전을 표시합니다",crewxVersion:"CrewX 버전",themeChanged:"테마가 변경되었습니다",languageChanged:"언어가 변경되었습니다",changeFailed:"설정 변경에 실패했습니다",onboarding:"온보딩 / AI 도구 설치",onboardingDesc:"AI 도구 설치 및 로그인 가이드를 다시 실행합니다",openOnboarding:"열기",analytics:"익명 사용 통계 수집",analyticsDesc:"제품 개선을 위해 익명 사용 통계를 수집합니다. 개인 정보는 포함되지 않습니다.",analyticsChanged:"사용 통계 설정이 변경되었습니다",apiTokens:{title:"API 액세스 토큰",description:"REST API 및 Chrome X 등 외부 클라이언트의 접근 권한을 토큰으로 관리합니다 (JWT 기반)",issue:"새 토큰 발급",empty:"발급된 API 토큰이 없습니다.",name:"이름",expiresAt:"만료일",agentScope:"에이전트 범위",status:"상태",actions:"동작",unrestricted:"제한 없음",sourceDirect:"직접 발급",sourceNegotiate:"Chrome X 승인",statusValue:{valid:"유효",expiringSoon:"곧 만료",expired:"만료됨",revoked:"폐기됨"},revoke:"폐기",revoking:"폐기 중...",revokedAction:"폐기됨",refresh:"새로고침",loading:"토큰 목록을 불러오는 중...",loadFailed:"토큰 목록을 불러오지 못했습니다.",revokeFailed:"토큰을 폐기하지 못했습니다.",revokeConfirm:'"{{name}}" 토큰을 폐기하시겠습니까?',issueModal:{title:"새 API 액세스 토큰 발급",successTitle:"토큰이 발급되었습니다",successDescription:"아래 토큰을 지금 바로 복사해 두세요",nameLabel:"이름",nameHint:"토큰을 식별할 이름입니다. 나중에 변경할 수 없습니다.",namePlaceholder:"예: dev-local-2026",expiresLabel:"만료 기간",agentScopeLabel:"에이전트 제한",agentScopeOptional:"선택",agentScopeHint:"특정 에이전트만 이 토큰으로 접근하도록 제한합니다.",agentScopePlaceholder:"예: @ui_frontend_dev",notice:"토큰은 발급 직후 한 번만 표시됩니다. 반드시 안전한 곳에 저장하세요.",tokenLabel:"액세스 토큰",danger:"이 창을 닫으면 토큰을 다시 볼 수 없습니다. 지금 복사해 두세요.",metaName:"이름",metaExpiresAt:"만료일",metaAgentScope:"에이전트 범위",expiresOption:{"30d":"30일","90d":"90일","1y":"1년"},cancel:"취소",submit:"발급",submitting:"발급 중...",confirm:"확인",copy:"복사",copied:"복사됨 ✓",error:{TOKEN_LIMIT_EXCEEDED:"FREE 플랜 API 토큰 한도({{limit}}개)에 도달했습니다.",UNKNOWN:"토큰 발급에 실패했습니다."}}}},aBn={back:"뒤로",noMessages:"메시지가 없습니다",noMessagesHint:"아래 입력창에서 에이전트에게 메시지를 보내세요",boxLabel:"📦 {{count}}개 태스크 · {{tokens}}K 토큰 (요약됨)",scrollToLatest:"최신 메시지로 이동",taskPanel:{retryStarted:"태스크 재시도를 시작했습니다",retryFailed:"태스크 재시도에 실패했습니다: {{message}}"}},lBn={placeholder:"마크다운을 입력하세요",toolbar:{h1:"제목 1",h2:"제목 2",h3:"제목 3",bold:"굵게",italic:"기울임",strike:"취소선",bulletList:"글머리 기호",orderedList:"번호 매기기",blockquote:"인용문",code:"코드",codeBlock:"코드 블록",horizontalRule:"구분선",undo:"실행 취소",redo:"다시 실행"}},cBn={noMessages:"메시지가 없습니다",noMessagesHint:"아래 입력창에서 에이전트에게 메시지를 보내세요",inputPlaceholder:"@agent 또는 /wf 명령을 입력하세요...",inputPlaceholderActive:"@{{agent}}에게 메시지...",activityLog:"활동 로그",noActivityLog:"활동 로그가 없습니다",subAgentReply:"Sub-Agent Reply",back:"뒤로",send:"전송",inputModeLabel:"모드",inputModeQuery:"Query",inputModeExecute:"Execute",captureScreen:"화면 캡처",captureAlt:"캡처된 화면",agentJoined:"── 🤖 @{{agent}} 님이 참여했습니다 ──",tokenUsage:"{{input}}↑ {{output}}↓",costLabel:"${{cost}}",running:"실행 중",failed:"실패",retry:"재시도",thinking:"생각 중...",systemChip:{retryFailedTask:"실패한 태스크 재시도",systemContext:"시스템 컨텍스트"},logDetail:{title:"활동 로그 상세",toolTitle:"{{tool}} 로그 상세",toolFallback:"도구",openFullView:"전체 보기 열기"}},uBn={attachFile:"파일 첨부",dropFile:"여기에 파일을 놓으세요",removeAttachment:"첨부 제거",fileTooLarge:'"{{name}}" 파일이 너무 커요 ({{size}}MB). 최대 {{max}}MB까지 첨부할 수 있어요.',sendTooLarge:"첨부 파일 용량이 너무 커서 전송하지 못했어요. 파일을 줄이거나 개수를 줄여보세요.",sendFailed:"메시지 전송에 실패했어요. 잠시 후 다시 시도해주세요."},dBn={crewxInstallNote:"AI 에이전트 팀 관리 도구"},fBn={management:"에이전트 관리",add:"에이전트 추가",edit:"에이전트 편집",delete:"삭제",deleteConfirmTitle:"에이전트 삭제",deleteConfirmMsg:"@{{id}}({{name}}) 에이전트를 삭제하시겠습니까?",deleteWarning:"이 작업은 되돌릴 수 없습니다.",cancel:"취소",save:"저장",back:"뒤로가기",backToList:"목록으로 돌아가기",notFound:"에이전트를 찾을 수 없습니다.",loadError:"에이전트 정보를 불러오지 못했습니다.",listError:"에이전트 목록을 불러오지 못했습니다.",loadFailTitle:"불러오기 실패",saveError:"저장에 실패했습니다.",createError:{AGENT_LIMIT_EXCEEDED:"베타 무료 플랜 에이전트 제한에 도달했습니다."},deleteError:"삭제에 실패했습니다.",retry:"재시도",providerState:{loading:"AI 엔진 정보 불러오는 중…",loadingSlow:"엔진 깨우는 중… 보통 10~20초 걸려요",error:"엔진 정보를 불러오지 못했어요. CLI 또는 AI 엔진 로그인이 필요할 수 있습니다.",retry:"다시 시도"},count:"({{count}}명)",team:{unassigned:"기타",memberCount:"{{count}}명",expand:"{{team}} 팀 펼치기",collapse:"{{team}} 팀 접기"},emptyTitle:"등록된 에이전트가 없습니다",emptyDesc:"+ 에이전트 추가 버튼으로 추가하세요",field:{id:"에이전트 ID",idHint:"고유 식별자 · 영문, 숫자, 언더스코어 사용 (예: ui_frontend_dev)",name:"이름",role:"역할",team:"팀",provider:"AI 엔진",model:"모델",searchModel:"모델 검색",description:"설명",descPlaceholder:"에이전트 역할과 기능 설명",selectProvider:"AI 엔진을 선택하세요",selectModel:"모델을 선택하세요",selectMode:"모드를 선택하세요",selectEffort:"Effort를 선택하세요",selectProviderFirst:"AI 엔진을 먼저 선택하세요",clearSelection:"선택 해제",noOptions:"선택 가능한 항목이 없습니다",noSearchResults:"검색 결과가 없습니다",custom:"커스텀",idPlaceholder:"ui_frontend_dev",namePlaceholder:"Frontend Developer",rolePlaceholder:"Frontend Developer",teamPlaceholder:"CrewX UI Team",recommended:"추천"},modeSettings:"모드 설정",queryMode:"질의 (Query)",executeMode:"실행 (Execute)",mode:"모드",effort:"Effort",validation:{required:"필수 입력 항목입니다"},engine:{claude:"Claude",codex:"Codex",gemini:"Gemini",copilot:"Copilot"},guide:{providerTitle:"AI 엔진 비교",modelTitle:"모델 비교 ({{provider}})",providerClaude:"코드 품질 최고, 대규모 코드베이스 이해력 우수",providerCodex:"IDE 통합 우수, 안전 제어 시스템, 웹 개발 이해력",providerGemini:"멀티모달 최강 (스크린샷/PDF 인라인), 무료 티어 넉넉",providerCopilot:"GitHub 연동이 자연스럽고 빠른 범용 작업에 적합"},model:{"claude-opus-4-6":{label:"Claude Opus 4.6",cost:"⚡ 소진 빠름",desc:"아키텍처 설계, 대규모 리팩토링, 복잡한 추론"},"claude-sonnet-4-6":{label:"Claude Sonnet 4.6",cost:"⚖️ 소진 보통",desc:"일반 코딩, 기능 구현 (추천)"},"claude-haiku-4-5":{label:"Claude Haiku 4.5",cost:"🟢 경제적",desc:"단순 질의, 빠른 검색, 대량 작업"},"claude-opus-4-5":{label:"Claude Opus 4.5",cost:"⚡ 소진 빠름",desc:"이전 세대 최상위, 복잡한 추론"},"claude-sonnet-4-5":{label:"Claude Sonnet 4.5",cost:"⚖️ 소진 보통",desc:"이전 세대 균형형, 일반 코딩"},"claude-sonnet-4":{label:"Claude Sonnet 4",cost:"⚖️ 소진 보통",desc:"레거시, 안정적 코딩"},"claude-opus-4-6-fast":{label:"Claude Opus 4.6 (fast mode)",cost:"🔥 소진 매우 빠름",desc:"최고 성능 + 빠른 응답, Preview"},"gpt-5.3-codex":{label:"GPT-5.3 Codex",cost:"⚡ 소진 빠름",desc:"최신, 가장 강력한 코딩"},"gpt-5.2-codex":{label:"GPT-5.2 Codex",cost:"⚖️ 소진 보통",desc:"안정적 코딩, 대규모 리팩토링"},"gpt-5.1-codex-mini":{label:"GPT-5.1 Codex Mini",cost:"🟢 경제적",desc:"경량 코딩, 비용 효율"},"o4-mini":{label:"o4-mini",cost:"🟢 경제적",desc:"레거시, 단순 작업"},"gemini-3-pro-preview":{label:"Gemini 3 Pro",cost:"⚖️ 소진 보통",desc:"고난도 추론, 설계 분석"},"gemini-3-flash-preview":{label:"Gemini 3 Flash",cost:"🟢 경제적",desc:"코딩 성능 우수, 빠른 응답 (추천)"},"gemini-2.5-pro":{label:"Gemini 2.5 Pro",cost:"⚖️ 소진 보통",desc:"안정적 프로덕션"},"gemini-2.5-flash":{label:"Gemini 2.5 Flash",cost:"💚 매우 경제적",desc:"대량 처리, 경량 작업"},"gpt-5.4":{label:"GPT-5.4",cost:"⚖️ 소진 보통",desc:"균형 잡힌 범용 작업, GitHub Copilot 기본 선택 (추천)"},"gpt-5.2":{label:"GPT-5.2",cost:"⚖️ 소진 보통",desc:"안정적 범용 코딩"},"gpt-5.1":{label:"GPT-5.1",cost:"⚖️ 소진 보통",desc:"범용 코딩"},"gpt-5.4-mini":{label:"GPT-5.4 Mini",cost:"🟢 경제적",desc:"경량 작업, 비용 효율"},"gpt-5-mini":{label:"GPT-5 Mini",cost:"💚 매우 경제적",desc:"단순 작업, 최저 비용"},"gpt-4.1":{label:"GPT-4.1",cost:"💚 매우 경제적",desc:"레거시, 단순 작업"}},duplicate:"복제",duplicateError:"복제할 에이전트 정보를 불러오지 못했습니다.",section:{basicTitle:"에이전트 정보",basicDescription:"에이전트의 기본 정보를 입력하세요.",skillsTitle:"사용할 스킬 선택",skillsDescription:"설치된 외부 스킬 중 이 에이전트가 사용할 항목을 체크하세요. 빌트인 스킬은 항상 활성화됩니다.",promptTitle:"시스템 프롬프트",promptDescription:"문서 블록과 변수 칩을 섞어 시스템 프롬프트를 시각적으로 편집하세요."},context:{title:"컨텍스트 공유",experimental:"실험적",description:"에이전트에게 사용자의 목표와 할 일을 공유하여 더 맥락에 맞는 응답을 받을 수 있습니다.",goalsLabel:"목표(Goal) 공유",goalsHint:"에이전트에게 OKR 목표를 공유",goalsAll:"전체 active Goal",goalsAllDesc:"활성 상태인 모든 Goal을 자동으로 공유합니다.",goalsSpecific:"특정 Goal 선택",goalsSpecificDesc:"공유할 Goal 파일을 직접 선택합니다.",goalsAdd:"추가",goalsPickerEmpty:"추가할 Goal이 없습니다.",dailyLabel:"데일리(Daily) 공유",dailyHint:"오늘의 할 일을 이 에이전트에게 공유"},skills:{emptyTitle:"설치된 외부 스킬이 없습니다",emptyDescription:"마켓에서 스킬을 설치하면 여기에 표시됩니다. 빌트인 스킬은 항상 활성화되어 별도 설정이 필요 없습니다.",openMarket:"마켓 열기",loadError:"설치된 스킬 목록을 불러오지 못했습니다."},tab:{basic:"기본 정보",skills:"스킬",prompt:"프롬프트"},prompt:{placeholder:"프롬프트를 입력하고 변수나 문서를 툴바에서 삽입하세요",editorLabel:"프롬프트 편집기",documentInsert:"문서 삽입",documentInsertLoading:"문서 목록을 불러오는 중입니다.",documentInsertEmpty:"삽입할 문서가 없습니다.",documentInsertError:"문서 목록을 불러오지 못했습니다.",documentInsertUnavailable:"문서 API가 아직 연결되지 않아 문서를 삽입할 수 없습니다.",variantContent:"본문",variantToc:"목차",documentChip:{delete:"삭제"},documentPicker:{searchPlaceholder:"문서 검색",inlineSection:"내장 문서",docsSection:"docs/",treeLoading:"문서 트리를 불러오는 중입니다.",treeError:"문서 트리를 불러오지 못했습니다.",noInlineResults:"일치하는 내장 문서가 없습니다.",noTreeResults:"일치하는 파일이 없습니다.",linked:"등록된 문서"},preview:{button:"미리보기",title:"미리보기",refresh:"새로고침",copy:"복사",loading:"렌더링 중...",unavailable:"미리보기 API가 아직 연결되지 않아 결과를 표시할 수 없습니다.",error:"렌더링 오류",empty:"프롬프트를 입력하면 렌더링 결과를 확인할 수 있습니다."},toolbar:{h1:"제목 1",h2:"제목 2",h3:"제목 3",bold:"굵게",italic:"기울임",strike:"취소선",code:"코드",bulletList:"글머리 기호",orderedList:"번호 매기기",blockquote:"인용문",codeBlock:"코드 블록",horizontalRule:"구분선",undo:"실행 취소",redo:"다시 실행",variable:"변수 삽입",insert:"삽입",search:"검색",empty:"표시할 항목이 없습니다."}},template:{title:"빠른 시작: 템플릿으로 만들기",subtitle:"자주 쓰는 에이전트 템플릿으로 빠르게 시작할 수 있습니다.",direct:"직접 설정",codingAssistant:"코딩 어시스턴트",codingAssistantDesc:"코드 구현과 리팩토링에 적합한 기본 템플릿",research:"리서치",researchDesc:"자료 조사와 비교 분석에 적합한 템플릿",dataAnalysis:"데이터 분석",dataAnalysisDesc:"분석과 리포트 작성 중심 템플릿",writing:"글쓰기",writingDesc:"문서 작성과 편집 중심 템플릿",designReview:"디자인 리뷰",designReviewDesc:"UI/UX 검토와 피드백 중심 템플릿"},skill:{memory:{label:"memory",description:"장기 기억 및 컨텍스트 관리"},search:{label:"search",description:"코드베이스 소스 검색 조회"},git:{label:"git",description:"CrewX 컨텍스트 내 깃 상태 조회"},cron:{label:"cron",description:"작업 스케줄 탭 설정"},wbs:{label:"wbs",description:"복잡한 작업을 단계별로 분해하여 관리"}},emptyAction:"+ 에이전트 추가"},hBn={title:"WBS",detail:"WBS 상세",totalCount:"{{count}}개 프로젝트",empty:"WBS 프로젝트가 없습니다",retry:"재시도",progress:"진행률",jobCount:"{{completed}}/{{total}} 작업",failedCount:"실패 {{count}}건",runningCount:"실행 중 {{count}}건",pendingCount:"대기 {{count}}건",backToList:"목록으로",jobs:"작업 목록",noJobs:"작업이 없습니다",agent:"담당 에이전트",createdAt:"생성일",completedAt:"완료일",expand:"펼치기",collapse:"접기",status:{planning:"계획",running:"실행 중",completed:"완료",partial:"부분 완료",on_hold:"보류"},jobStatus:{pending:"대기",running:"실행 중",completed:"완료",failed:"실패"},sort:{newest:"최신순",oldest:"오래된순",progress:"진행률순",name:"이름순"}},pBn={title:"문서 관리",fileTree:"파일 트리",searchPlaceholder:"파일 검색...",noFiles:"파일이 없습니다",noSearchResults:"검색 결과가 없습니다",selectFile:"왼쪽 파일 트리에서 파일을 선택하세요",copyPath:"경로 복사",pathCopied:"경로가 복사되었습니다",copyContent:"복사",contentCopied:"복사됨",imageUnavailable:"이미지를 불러올 수 없습니다",view:{fontLabel:"문서 글꼴",fontSystem:"기본",fontPretendard:"Pretendard",fontNotoSansKr:"Noto Sans KR",fontInter:"Inter",fontSerif:"명조",fontNotoSerifKr:"Noto Serif KR",fontMono:"고정폭",fontCoding:"코딩체",localFontsGroup:"로컬 폰트",localFontsLoading:"로컬 폰트 확인 중",localFontsUnsupported:"이 브라우저는 로컬 폰트 불러오기를 지원하지 않습니다",localFontsFailed:"로컬 폰트를 불러오지 못했습니다",localFontsEmpty:"불러온 로컬 폰트가 없습니다",zoomLabel:"확대율",zoomOut:"축소",zoomIn:"확대"},toggleTree:{show:"파일 트리 펼치기",hide:"파일 트리 접기"},edit:{button:"편집",save:"저장",cancel:"취소",dirtyMarker:"●",savedToast:"저장되었습니다",saveFailed:"저장 실패: {{message}}",discardConfirm:"변경사항을 버릴까요?",conflict:{title:"외부에서 파일이 수정되었습니다",message:"다른 창이나 외부 에디터에서 파일이 변경되었어요. 어떻게 할까요?",overwrite:"덮어쓰기",reload:"새로고침",dismiss:"취소"}},tab:{markdown:"마크다운 뷰",implStatus:"구현 상태"},impl:{totalScreens:"전체 화면 수",syncDone:"동기화 완료",mismatch:"불일치",id:"ID",name:"이름",doc:"설계서",pencil:"펜슬",code:"코드",empty:"구현 상태 데이터가 없습니다",legend:"범례: ✅ 존재 · ❌ 없음 (불일치 행은 빨간색으로 강조)"}},gBn={agents:"에이전트",planner:"데일리 플래너",cron:"스케줄",goals:"목표",wbs:"WBS",memory:"메모리",graph:"지식 그래프",docs:"문서 관리",market:"마켓",cliManager:"CLI 관리",settings:"설정",newTask:"새 대화",recentTasks:"최근 대화",noTasks:"대화가 없습니다",viewAll:"전체 보기 →",tools:"도구",search:"통합 검색",projects:"프로젝트",more:"더보기",freePlan:"무료 플랜",workflows:"워크플로",usage:"사용량",tasks:"태스크 이력",workspaces:"워크스페이스",openSidebar:"사이드바 열기",closeSidebar:"사이드바 닫기"},mBn={title:"데일리 플래너",subtitle:"오늘의 우선순위와 실행 흐름을 한눈에 정리합니다.",loadError:"플래너를 불러오지 못했습니다",saveError:"플래너 저장에 실패했습니다",retry:"다시 시도",loading:"플래너를 불러오는 중...",empty:"표시할 플래너 데이터가 없습니다",today:"오늘",previousDate:"이전 날짜",nextDate:"다음 날짜",status:{saved:"저장됨",saving:"저장 중...",unsaved:"미저장 변경사항"},mockNotice:"백엔드 API가 아직 준비되지 않아 임시 플래너 데이터를 표시하고 있습니다.",top3:{title:"가장 중요한 3가지",description:"덤프한 것 중에서 오늘 반드시 해야 할 3가지를 골라보세요.",empty:"오늘의 우선순위가 아직 없습니다",noAgents:"담당 에이전트 없음",placeholder:"가장 중요한 일...",inputLabel:"{{rank}}번째 우선순위"},braindump:{title:"브레인 덤프",description:"머릿속을 비우세요. 할 일, 걱정, 아이디어를 전부 쏟아내면 연관된 업무가 보입니다.",empty:"메모된 아이디어가 없습니다",placeholder:"머릿속에 있는 것들을 전부 쏟아내세요...",inputLabel:"브레인 덤프"},schedule:{title:"시간표",description:"시간대별로 할 일을 배치하고 체크하세요.",empty:"일정이 없습니다",toggleTask:"{{task}} 완료 상태 전환",placeholder:"할 일을 적어보세요...",inputLabel:"{{time}} 할 일",status:{done:"완료",pending:"예정",cancelled:"취소"}},notes:{title:"메모",description:"자유롭게 메모를 남겨두세요.",empty:"작성된 노트가 없습니다",placeholder:"메모를 적어보세요...",inputLabel:"메모"},goalChip:{title:"오늘의 목표 (Goal)",description:"지금 따라가고 있는 목표. 에이전트가 우선순위 힌트로 활용합니다.",addGoal:"목표 선택",removeChip:"이 데일리에서 제외"}},bBn={title:"스케줄",subtitle:"자동 실행 관리",apiUnavailable:"크론 API가 아직 준비되지 않았습니다. 백엔드가 연결되면 스케줄을 불러옵니다.",period:{am:"오전",pm:"오후"},days:{mon:"월",tue:"화",wed:"수",thu:"목",fri:"금",sat:"토",sun:"일"},repeat:{daily:"매일",weekdays:"평일마다",weekends:"주말마다",weekdaysOnly:"평일만",weekendsOnly:"주말만",custom:"커스텀",customLabel:"커스텀 반복",weekly:"매주 {{day}}요일"},actions:{new:"새 스케줄",add:"추가",save:"저장",delete:"삭제",cancel:"취소"},card:{untitled:"이름 없는 스케줄",toggle:"{{name}} 활성화 전환",cronBadge:"표현식"},daemon:{loading:"상태 확인 중...",running:"스케줄 동작 중",stopped:"스케줄 중지됨",pid:"PID {{pid}}",startBtn:"시작",stopBtn:"중지",starting:"시작 중...",stopping:"중지 중...",summary:"활성 {{enabled}} / 전체 {{total}}",startedAt:"시작 시각 {{date}}"},date:{todayAt:"오늘 {{time}}",tomorrowAt:"내일 {{time}}"},empty:{title:"등록된 스케줄이 없습니다",description:"새 스케줄을 추가해서 반복 실행을 시작하세요."},history:{title:"최근 실행",recentCount:"최근 5건",runCount:"{{count}}회 실행"},modal:{createTitle:"새 스케줄",editTitle:"스케줄 편집",subtitle:"시간과 반복만 정해서 간단히 자동 실행을 등록합니다.",unsupportedCron:"이 스케줄은 단순 시간 반복 형식이 아니라 현재 폼에서 일정 규칙을 수정할 수 없습니다.",hour:"시",minute:"분",repeatLabel:"반복",dayLabel:"요일 선택",nameLabel:"스케줄 이름",namePlaceholder:"예: Daily Report",agentLabel:"에이전트",agentPlaceholder:"에이전트를 선택하세요",modeLabel:"실행 모드",commandLabel:"실행 명령어",commandPlaceholder:"에이전트에게 시킬 작업을 입력하세요",timezoneLabel:"타임존",timezonePlaceholder:"타임존 선택",timezoneSearch:"타임존 검색...",timeoutLabel:"타임아웃 (ms)",workingDirectoryLabel:"작업 디렉토리",workingDirectoryPlaceholder:"예: /Users/name/project",allowConcurrentLabel:"이전 실행이 끝나지 않아도 동시에 실행",tabBasic:"기본",tabAdvanced:"고급",cannotSwitchToBasic:"이 표현식은 기본 모드에서 표현할 수 없습니다."},advanced:{cronLabel:"Cron 표현식",queryChip:"물어보기",aiHelperLabel:"자연어로 설명하면 표현식을 만들어 드려요",aiPlaceholder:"예: 평일 아침 9시에 실행해줘",generateBtn:"생성",aiGenerating:"AI가 표현식을 생성하고 있어요...",webllmLoading:"AI 모델을 불러오고 있어요 (최초 1회만 다운로드)",webllmFirstLoad:"처음 로드 시 모델을 다운로드해요. 이후에는 캐시돼요.",webllmReady:"AI 모델 준비 완료",webllmError:"AI 모델을 불러올 수 없어요",webllmFallback:"AI 모델을 사용할 수 없어 기본 패턴 매칭으로 동작합니다"},describe:{everyNMinutes:"매 {{n}}분마다 실행",everyNHours:"매 {{n}}시간마다 실행",everyDay:"매일",weekdays:"평일",weekends:"주말",atTime:"{{days}} {{time}}에 실행",monthly:"매월 {{days}}일 {{time}}에 실행"},mode:{execute:"execute",query:"query",command:"command"},preview:{summary:"{{repeat}} {{period}} {{time}}에 {{agent}}이 실행합니다",commandMode:"명령어"},validation:{hour:"시 값은 1부터 12 사이여야 합니다.",minute:"분 값은 0부터 59 사이여야 합니다.",days:"요일을 하나 이상 선택하세요.",agent:"에이전트를 선택하세요.",prompt:"실행할 명령을 입력하세요."},delete:{title:"스케줄을 삭제할까요?",description:'"{{name}}" 스케줄을 삭제합니다.'},field:{minute:"분",minuteTip:"0-59 또는 */5 (5분마다)",hour:"시",hourTip:"0-23 (24시간 기준)",day:"일",dayTip:"1-31 (매월 날짜)",month:"월",monthTip:"1-12 또는 JAN-DEC",weekday:"요일",weekdayTip:"0-6 (일=0, 토=6), 1-5=평일"},example:{every5min:"매 5분",daily9:"매일 9시",weekday9:"평일 9시",weeklySun:"매주 일요일",monthly1_15:"매월 1,15일"}},wBn={title:"목표",newGoal:"새 목표",loadError:"목표를 불러오지 못했습니다",retry:"다시 시도",loading:"목표를 불러오는 중...",empty:"등록된 목표가 없습니다. '+ 새 목표'로 첫 번째 목표를 시작하세요.",filterAll:"전체",filterActive:"진행 중",filterDone:"완료",filterDropped:"중단",sectionActive:"진행 중",sectionDone:"완료",sectionDropped:"중단",countUnit:"개",daysLeft:"D-{{days}} 남음",daysOverdue:"지연 D+{{days}}",completedAt:"완료 {{date}}",droppedAt:"중단 {{date}}",periodQuarter:"분기",periodHalf:"반기",periodYear:"연간",periodWeeks:"{{n}}주 스프린트",periodDays:"{{n}}일",saveButton:"저장",status:{saved:"저장됨",dirty:"변경됨",saving:"저장 중...",error:"저장 실패"},period:{title:"기간 (Period)",description:"이 목표의 기간과 상태. 분기·N주·반기·연간 자유롭게 설정.",start:"시작일",end:"종료일",progress:"진행",statusActive:"진행 중",statusDone:"완료",statusDropped:"중단",reasonRequired:"중단 사유를 입력해주세요",reasonPlaceholder:"중단 사유...",presetLabel:"빠른 설정",preset1w:"1주",preset2w:"2주",presetQuarter:"이번 분기",presetQuarterHint:"현재 분기의 시작일~종료일로 자동 설정",preset3m:"3개월",preset6m:"6개월",preset1y:"1년",overdueSub:"기간 종료 +{{days}}일 (지연)",remainingSub:"{{days}}일 남음"},objective:{title:"목표 (Objective)",description:"한 줄로 무엇을 이룰지. 측정이 아닌 방향 — 가슴 뛰는 한 문장.",titlePlaceholder:"예: 2026 Q2 제품-시장 적합성 검증",bodyPlaceholder:"이 분기에 무엇을 이루고 싶은지 한 단락으로..."},kr:{title:"핵심 결과 (Key Results)",description:"측정 가능한 결과 3~5개. 하위 항목이 있으면 진행률은 자동 계산 (가중 평균).",summary:"{{count}} KRs · 평균 {{avg}}%",addL1:"핵심 결과 추가",addL2:"하위 항목 추가",textPlaceholder:"핵심 결과...",weightTooltip:"가중치 (weight) — 이 KR의 중요도 비율",dragHandle:"드래그하여 순서 변경"},newMode:{templateKr1Text:"MAU 1,000 달성"},notes:{title:"메모 (Notes)",description:"자유롭게 메모. 회의 결과, 외부 인사이트, 기간 중 떠오른 생각.",placeholder:"메모를 적어보세요..."},reflection:{title:"회고 (Reflection)",description:"기간 종료 후 작성. 무엇이 되었고 무엇이 안 됐는지, 다음 기간에 무엇을 바꿀지.",notWritten:"미작성",placeholder:'아직 회고가 작성되지 않았습니다. 기간을 "완료"로 전환하면 회고 작성을 권유합니다.'},delete:{title:"이 목표를 삭제할까요?",body:"삭제하면 복구할 수 없습니다. status를 'dropped'로 두는 것이 권장됩니다 (회고 자산 보존).",cancel:"취소",confirm:"삭제",toast:{success:"목표가 삭제되었습니다",error:"목표 삭제에 실패했습니다"}}},yBn={title:"마켓",subtitle:{installed:"설치된 스킬 {{count}}개",official:"공식 스킬 {{count}}개",registries:"레지스트리 {{count}}개",summary:"설치됨 {{installed}}개 · 전체 {{total}}개 항목"},tabs:{installed:"설치된 스킬",official:"공식 스킬",registries:"내 레지스트리"},actions:{refresh:"새로고침",retry:"다시 시도",install:"설치",uninstall:"제거",confirmUninstall:"정말 {{name}}을(를) 제거하시겠습니까?",addRegistry:"레지스트리 추가",deleteRegistry:"삭제",cancel:"취소",manageSources:"소스 관리",checkUpdates:"업데이트 확인",close:"닫기"},badges:{unverified:"미인증",trusted:"신뢰됨",verified:"Verified",installed:"설치됨",updateAvailable:"업데이트 있음",customizedWarning:"커스텀됨"},types:{skill:"스킬",template:"템플릿",agent:"에이전트",workflow:"워크플로",plugin:"플러그인"},card:{unknownAuthor:"작성자 정보 없음",noDescription:"설명이 제공되지 않았습니다.",sourceDefault:"CrewX 기본 레지스트리에서 제공",sourceWithRegistry:"{{registry}} 레지스트리에서 제공"},official:{noticeTitle:"공식 스킬 카탈로그",noticeDescription:"{{registry}} 레지스트리의 검증된 스킬을 탐색하고 바로 설치할 수 있습니다."},registryPanel:{title:"커스텀 레지스트리 관리",description:"GitHub 레포지토리를 등록해 팀 전용 스킬 카탈로그를 CrewX UI에 연결할 수 있습니다."},registryCard:{defaultBadge:"기본",customBadge:"사용자",skillCount:"스킬 수",addedAt:"추가일",defaultHint:"기본 레지스트리는 항상 유지되며 삭제할 수 없습니다.",customHint:"사용자 레지스트리는 언제든지 제거할 수 있습니다.",lockedAction:"고정됨"},addRegistryModal:{title:"마켓 레지스트리 추가",description:"GitHub 레포 URL을 붙여넣으면 CrewX가 해당 마켓 레지스트리를 연결합니다.",urlLabel:"레지스트리 URL",urlPlaceholder:"https://github.com/owner/repository",compatibilityTitle:"Claude Code 스킬 포맷 호환",compatibilityDescription:"Claude Code 문서에서 안내하는 GitHub 레포 URL을 그대로 사용할 수 있습니다. CrewX는 등록된 레포의 스킬 메타데이터를 읽고 설치 흐름에 연결합니다."},empty:{installedTitle:"설치된 스킬이 없습니다",installedDescription:"공식 스킬 탭에서 필요한 스킬을 설치해 보세요.",officialTitle:"표시할 공식 스킬이 없습니다",officialDescription:"레지스트리 연결 상태를 확인한 뒤 다시 시도해 주세요.",registryTitle:"등록된 레지스트리가 없습니다",registryDescription:"기본 레지스트리 외에 팀 전용 레지스트리를 추가해 보세요.",filteredTitle:"조건에 맞는 항목이 없습니다",filteredDescription:"다른 검색어 또는 필터로 다시 시도해 보세요."},errors:{bannerTitle:"마켓 정보를 불러오지 못했습니다",addRegistry:"레지스트리를 추가하지 못했습니다.",detailLoad:"SKILL.md 본문을 불러오지 못해 기본 설명을 표시합니다."},trust:{blockedPlugin:"보안 정책에 의해 플러그인 설치가 차단됨",blockedExec:"보안 정책에 의해 실행 파일 설치가 차단됨"},filters:{all:"전체",installed:"설치됨",skill:"스킬",template:"템플릿",agent:"에이전트"},searchPlaceholder:"스킬, 템플릿, 에이전트 검색...",list:{title:"마켓 목록",count:"{{count}}개 항목",installedHeading:"설치됨",availableHeading:"둘러보기",updatedLabel:"{{time}} 업데이트"},detail:{emptyTitle:"마켓 항목을 선택하세요",emptyDescription:"왼쪽 목록에서 항목을 선택하면 상세 정보와 개발자 정보를 확인할 수 있습니다.",description:"설명",loadingBody:"SKILL.md 본문을 불러오는 중...",installToViewBody:"설치 후 상세 내용을 확인할 수 있습니다",tags:"태그",developers:"개발자",contributions:"기여 {{count}}회",unavailable:"정보 없음",stats:{stars:"스타",installs:"설치수",license:"라이선스",updatedAt:"업데이트 날짜"}},pluginDialog:{title:"플러그인 설치",description:"이 패키지에는 실행 가능한 플러그인이 포함되어 있습니다.",warning:"신뢰할 수 있는 출처의 플러그인만 설치하세요.",perm1:"코드 실행 권한",perm2:"로컬 파일 접근 권한"},registryModal:{title:"소스 관리",description:"연결된 레지스트리를 관리하고 팀용 마켓 소스를 추가할 수 있습니다."}},xBn={title:"메모리",allAgents:"전체 에이전트",summaryStats:"{{entries}}건 · {{topics}} 토픽 · 최근 갱신 {{date}}",summaryEmpty:"요약 정보 없음",countUnit:"건",searchPlaceholder:"검색...",emptyEntries:"항목이 없습니다",selectEntry:"왼쪽 목록에서 항목을 선택하세요",category:"카테고리",topic:"토픽",agent:"에이전트",date:"날짜"},vBn={title:"지식 허브",allAgents:"전체 에이전트",summaryStats:"{{entries}}건 · {{topics}} 토픽 · 최근 갱신 {{date}}",summaryEmpty:"요약 정보 없음",countUnit:"건",searchPlaceholder:"검색...",emptyEntries:"항목이 없습니다",selectEntry:"왼쪽 목록에서 항목을 선택하세요",category:"카테고리",topic:"토픽",agent:"에이전트",date:"날짜",graphComingSoon:"그래프 탭은 준비 중입니다",syncComingSoon:"동기화 탭은 준비 중입니다",tab:{list:"목록",graph:"그래프",sync:"동기화"}},kBn={title:"지식 그래프",allAgents:"전체 에이전트",memory:"Memory",docs:"Docs",knowhow:"Knowhow",loading:"그래프 로딩 중...",error:"그래프를 불러오지 못했습니다",retry:"재시도",empty:"표시할 노드가 없습니다",legend:"범례",nodeCount:"{{count}}개 노드",category:"카테고리",agent:"에이전트",date:"날짜",topic:"토픽",tags:"태그",detailError:"상세 정보를 불러오지 못했습니다",noDetail:"상세 정보가 없습니다"},CBn={back:"뒤로",agentTeam:"AI 에이전트팀",edit:"편집",delete:"삭제",cancel:"취소",deleteTitle:"프로젝트 삭제",deleteWarning:"이 작업은 취소할 수 없습니다",deleteConfirmMsg:'"{{name}}" 프로젝트를 삭제하시겠습니까?',deleteError:"프로젝트 삭제에 실패했습니다",newChat:"새 대화 시작",chatPrompt:"{{name}}에 무엇을 부탁할까요?",chatPlaceholder:"@에이전트 / 무엇을 시작할까요?",send:"전송",assignedAgents:"담당 에이전트",agentCount:"{{count}}명",noAgents:"담당 에이전트 없음",relatedThreads:"관련 대화",noThreads:"관련 대화가 없습니다",description:"설명",noDescription:"설명이 없습니다",relatedDocs:"관련 문서",noDocs:"관련 문서가 없습니다",unknownAgent:"알 수 없는 에이전트",yesterday:"어제",projectStatus:{active:"진행중",completed:"완료됨",on_hold:"보류"},notFound:"프로젝트를 찾을 수 없습니다",loadError:"프로젝트 정보를 불러오지 못했습니다",emptyPrompt:"(내용 없음)",justNow:"방금 전",minutesAgo:"{{count}}분 전",hoursAgo:"{{count}}시간 전",daysAgo:"{{count}}일 전",statusActive:"진행중",statusCompleted:"완료됨",statusOnHold:"보류",threadStatusPending:"대기",threadStatusRunning:"실행중",threadStatusSuccess:"완료",threadStatusFailed:"실패"},SBn={expand:"전체화면으로 보기",zoomIn:"확대",zoomOut:"축소",reset:"리셋",hintZoom:"확대/축소",hintDrag:"이동",hintZoomKeys:"줌",hintReset:"리셋",hintClose:"닫기",escHint:"ESC 또는 배경 클릭으로 닫기"},EBn={refresh:"새로고침",loadFailed:"로드 실패",durationMinSec:"{{m}}분 {{s}}초",durationSec:"{{s}}초",close:"닫기",copy:"복사",copied:"복사됨",somethingWentWrong:"문제가 발생했습니다",tryRefreshingPage:"페이지를 새로고침한 뒤 다시 시도해주세요."},_Bn={loading:"인증 상태를 확인하는 중...",login:{title:"CrewX 로그인",description:"외부 접속에는 CrewX 관리자 세션이 필요합니다.",notice:"localhost 접속은 자동으로 허용됩니다. 외부 접속은 설정된 ID와 비밀번호로 로그인해야 합니다.",usernameLabel:"아이디",usernamePlaceholder:"admin",passwordLabel:"비밀번호",passwordPlaceholder:"비밀번호를 입력하세요",submit:"로그인",submitting:"로그인 중...",error:{invalidCredentials:"잘못된 인증 정보입니다.",tooManyAttempts:"시도가 너무 많습니다. 잠시 후 다시 시도해주세요.",unknown:"로그인에 실패했습니다. 다시 시도해주세요."}}},TBn={title:"워크스페이스",loading:"워크스페이스를 불러오는 중...",loadingShort:"워크스페이스 불러오는 중...",loadingPath:"현재 워크스페이스를 확인하는 중",switchTitle:"워크스페이스 전환",switchingTitle:"워크스페이스 전환 중...",switchingDescription:"{{name}} 워크스페이스를 다시 시작하고 있습니다.",switchErrorTitle:"워크스페이스 전환에 실패했습니다",switchErrorDescription:"전환에 실패했습니다. 다시 시도해주세요.",shortcutHint:"⌘K로 빠르게 전환",manage:"워크스페이스 관리",create:"새 워크스페이스 만들기",createUnavailable:"베타 플랜 제한에 도달했습니다",currentBadge:"현재",slug:"슬러그",updatedAt:"업데이트",entryTitle:"CrewX에 오신 걸 환영합니다",entryDescription:"첫 워크스페이스를 만들고 에이전트 팀 작업을 시작하세요.",entryLogoAlt:"CrewX 로고",emptyTitle:"등록된 워크스페이스가 없습니다",emptyDescription:"워크스페이스가 등록되면 여기서 전환할 수 있습니다.",delete:{button:"워크스페이스 삭제",title:"워크스페이스 삭제",message:'"{{name}}" 워크스페이스를 삭제할까요?',note:"워크스페이스 등록만 제거됩니다. 디렉토리와 파일은 그대로 유지되며, 연결된 스레드는 보존되지만 워크스페이스 연결이 해제됩니다.",cancel:"취소",confirm:"삭제",currentDisabled:"현재 워크스페이스는 삭제할 수 없습니다. 다른 워크스페이스로 전환 후 삭제하세요.",error:{WORKSPACE_NOT_FOUND:"워크스페이스를 찾을 수 없습니다.",WORKSPACE_IS_CURRENT:"현재 워크스페이스는 삭제할 수 없습니다.",UNKNOWN:"삭제 중 오류가 발생했습니다."}},createModal:{title:"새 워크스페이스 등록",description:"crewx.yaml이 있는 프로젝트 경로를 등록해 에이전트 팀을 연결하세요.",pathLabel:"crewx.yaml이 있는 프로젝트 경로",pathPlaceholder:"/Users/me/projects/my-project",browse:"찾아보기",slugLabel:"slug (선택)",slugPlaceholder:"my-project",submit:"등록",cancel:"취소",success:"워크스페이스가 등록되었습니다.",confirmInit:{title:"이 폴더를 CrewX 프로젝트로 준비할까요?",description:"선택한 폴더에 설정 파일과 기본 자동 연동 구성을 만든 뒤 워크스페이스로 등록합니다.",pathLabel:"선택한 경로",filesLabel:"준비되는 항목",files:{config:"설정 파일 · crewx.yaml",automation:"자동 연동 · .crewx/, .claude/",registration:"워크스페이스 등록 · CrewX 목록 연결"},confirm:"준비하기",back:"경로 다시 선택"},initProgress:{title:"프로젝트 준비 중",description:"몇 초 정도 걸릴 수 있어요. 완료되면 바로 연결합니다.",step1:"설정 파일 준비 중",step2:"자동 연동 준비 중",step3:"워크스페이스 등록 중"},error:{WORKSPACE_LIMIT_EXCEEDED:"베타 무료 플랜 제한(워크스페이스 3개)에 도달했습니다. 얼리 액세스를 신청하면 정식 출시 시 우선 안내드립니다.",NOT_A_CREWX_WORKSPACE:"crewx.yaml이 없는 경로입니다. 먼저 터미널에서 `crewx init`을 실행하세요.",HOOK_INSTALL_FAILED:"설정 파일은 준비됐지만 자동 연동에 실패했어요. 일부 편의 기능이 제한될 수 있습니다.",INIT_FAILED:"프로젝트 준비 중 문제가 발생했어요. 잠시 후 다시 시도해주세요.",PATH_BLOCKED:"보안을 위해 해당 시스템 경로에는 접근할 수 없습니다.",PATH_NOT_FOUND:"경로가 존재하지 않습니다.",WORKSPACE_ALREADY_REGISTERED:"이미 등록된 워크스페이스입니다.",SLUG_CONFLICT:"slug가 이미 사용 중입니다.",UNKNOWN:"워크스페이스 생성에 실패했습니다."}}},ABn={title:"폴더 선택",description:"디렉터리를 탐색하고 등록할 워크스페이스 경로를 선택하세요.",loading:"디렉터리를 불러오는 중입니다...",empty:{default:"표시할 디렉터리가 없습니다.",workspaces:"이 폴더에 워크스페이스를 만드세요."},newFolder:{label:"새 폴더",placeholder:"폴더 이름",create:"만들기"},selected:"선택한 폴더",noneSelected:"선택한 폴더가 없습니다",select:"선택",cancel:"취소",alreadyRegistered:"등록됨",disabledTooltip:"이미 등록된 워크스페이스입니다.",badge:{crewxYaml:"crewx.yaml"},quickAccess:{title:"빠른 이동",home:"홈",workspaces:"워크스페이스"},error:{PATH_NOT_ABSOLUTE:"절대 경로를 입력하거나 선택해주세요.",PATH_BLOCKED:"보안을 위해 해당 시스템 경로에는 접근할 수 없습니다.",PATH_NOT_FOUND:"경로를 찾을 수 없습니다.",UNKNOWN:"디렉터리를 불러오지 못했습니다."},mkdir:{error:{PATH_BLOCKED:"이 위치에는 폴더를 만들 수 없습니다.",NAME_INVALID:"폴더 이름이 올바르지 않습니다.",PERMISSION_DENIED:"권한이 부족합니다.",PARENT_NOT_FOUND:"상위 폴더가 존재하지 않습니다.",NOT_A_DIRECTORY:"이미 같은 이름의 파일이 있습니다.",READ_ONLY_FS:"읽기 전용 파일시스템입니다.",NAME_TOO_LONG:"이름이 너무 깁니다.",MKDIR_FAILED:"폴더 생성에 실패했습니다.",UNKNOWN:"알 수 없는 오류로 폴더를 만들지 못했습니다."}}},MBn={banner:{workspace:{title:"워크스페이스 {{current}}/{{limit}}개 사용 중 · 베타 무료 플랜",description:"더 많은 워크스페이스가 필요하면 정식 출시 시 Pro 플랜으로 업그레이드할 수 있습니다."},agent:{title:"에이전트 {{current}}/{{limit}}개 사용 중 · 베타 무료 플랜",description:"워크스페이스당 에이전트 수는 Pro 플랜에서 확장됩니다."},token:{title:"API 토큰 {{current}}/{{limit}}개 사용 중 · 베타 무료 플랜",description:"추가 API 토큰 발급 한도는 Pro 플랜에서 확장됩니다."},grandfatherPromise:"현재 등록된 워크스페이스와 에이전트는 정식 출시 후에도 계속 사용할 수 있습니다."}},NBn={notice:{title:"CrewX 베타",description:"정식 출시 시 무료/Pro 플랜으로 전환됩니다. 지금 등록된 내용은 그대로 유지됩니다."}},jBn={waitlistCta:"Pro 얼리 액세스 신청"},DBn={title:"대화",refresh:"새로고침",filterAll:"전체",filterPlatform:"Platform",filterAgent:"Agent",sortNewest:"최신순",sortOldest:"오래된순",msgCount:"{{count}} msgs",empty:"대화 기록이 없습니다",emptyHint:"에이전트가 CLI 명령을 실행하면 대화가 생성됩니다",emptyPrompt:"(내용 없음)",loadMore:"더 보기",retry:"재시도",newThread:"새 대화",threadIdPlaceholder:"대화 ID",searchPlaceholder:"대화 검색...",open:"열기",searching:"검색 중...",searchResults:'"{{query}}" 검색 결과 {{count}}건',totalCount:"총 {{count}}개 대화",noResults:"검색 결과가 없습니다",noThreads:"아직 대화가 없습니다",emptyAction:"새 대화 시작",editPlaceholder:"대화 제목을 입력하세요",editAriaLabel:"대화 제목 편집",editButtonLabel:"대화 제목 수정",editEmptyError:"제목은 비워둘 수 없습니다",editSaveFailed:"대화 제목 저장에 실패했습니다: {{message}}",filterStarred:"스타",pinnedSection:"고정됨",pinAction:"대화 고정",unpinAction:"대화 고정 해제",starAction:"대화 스타 표시",unstarAction:"대화 스타 해제",pinSaveFailed:"대화 고정 상태 저장에 실패했습니다: {{message}}",starSaveFailed:"대화 스타 상태 저장에 실패했습니다: {{message}}",platforms:{cli:"CLI",web:"Web",api:"API",slack:"Slack"}},IBn={title:"프로젝트",newProject:"+ 새 프로젝트",totalCount:"총 {{count}}개",emptyTitle:"아직 프로젝트가 없습니다",emptyDesc:"새 프로젝트를 만들어 에이전트 팀을 구성하세요",loadError:"프로젝트 목록을 불러오지 못했습니다",retry:"재시도",threadCount:"대화 {{count}}개",docCount:"문서 {{count}}개",justNow:"방금 전",minutesAgo:"{{count}}분 전",hoursAgo:"{{count}}시간 전",daysAgo:"{{count}}일 전",weeksAgo:"{{count}}주 전",edit:"편집",delete:"삭제",menuAriaLabel:"프로젝트 메뉴",deleteConfirm:'"{{name}}" 프로젝트를 삭제하시겠습니까?'},OBn={title:"태스크",loading:"태스크를 불러오는 중...",retry:"재시도",empty:"태스크가 없습니다",emptyHint:"에이전트 실행 이력이 여기에 표시됩니다",totalCount:"총 {{count}}건",columns:{taskId:"태스크 ID",agent:"에이전트",status:"상태",duration:"실행시간",model:"모델",time:"시간",tokens:"토큰",cost:"비용"},filters:{searchPlaceholder:"태스크 검색...",agent:"에이전트",status:"상태",allAgents:"전체 에이전트",allStatuses:"전체 상태"},pagination:{previous:"이전",next:"다음"},relative:{justNow:"방금 전",minutesAgo:"{{count}}분 전",hoursAgo:"{{count}}시간 전",daysAgo:"{{count}}일 전",weeksAgo:"{{count}}주 전"},status:{pending:"대기",running:"진행중",success:"성공",failed:"실패"},panel:{title:"태스크 상세",request:"프롬프트",renderedPrompt:"렌더링된 프롬프트",result:"결과",childTasks:"하위 태스크",pendingTitle:"대기 중",pendingDescription:"이 태스크는 아직 실행되지 않았습니다.",copy:"복사",copyRequestSuccess:"프롬프트를 복사했습니다",copyRenderedPromptSuccess:"렌더링된 프롬프트를 복사했습니다",copyResultSuccess:"결과를 복사했습니다",copyFailed:"텍스트를 복사하지 못했습니다",showMore:"더보기",showLess:"접기",viewThread:"대화 보기 →",noThread:"연결된 대화 없음",retryDetail:"재시도",detailLoadError:"태스크 상세를 불러오지 못했습니다",stop:"중지",stopConfirm:"정말 중지?",stopping:"중지 중...",stopFailed:"태스크 중지에 실패했습니다",close:"패널 닫기",parentLabel:"Parent:",toolUsage:"도구 사용량",toolUsageTooltip:"{{tool}}: {{count}}회 ({{pct}}%)",tool:"도구",calls:"호출 횟수",ratio:"비율"}},LBn={heading:"팀에게 일을 시켜보세요",subheading:"에이전트를 클릭하면 바로 대화 시작",addAgent:"추가",inputPlaceholder:"@에이전트 / 작업 입력하세요...",inputHint:"Enter로 전송 · Shift+Enter로 줄바꿈",recommended:{codeReview:"코드 리뷰 해줘",sprintSummary:"이번 스프린트 정리",roadmapReview:"제품 로드맵 검토"}},PBn={heading:"비서팀에게 말을 걸어보세요",subheading:"비서를 선택하거나 자유롭게 입력해보세요",addAgent:"+ 추가",inputPlaceholder:"@agent 또는 /wf 로 작업을 시작하세요...",send:"전송",recommendedTitle:"추천 대화",agentsError:"에이전트 목록을 불러오지 못했습니다"},RBn={newTitle:"새 프로젝트",newSubtitle:"프로젝트를 생성하고 에이전트팀을 구성하세요",editTitle:"프로젝트 편집",editSubtitle:"프로젝트 기본 정보를 수정하세요",cancel:"취소",create:"프로젝트 생성",save:"저장",loading:"프로젝트 정보를 불러오는 중입니다...",createError:"프로젝트 생성에 실패했습니다.",updateError:"프로젝트 수정에 실패했습니다.",loadError:"프로젝트 정보를 불러오지 못했습니다.",nameRequired:"프로젝트 이름을 입력해주세요",sectionBasic:"기본 정보",fieldName:"프로젝트 이름",fieldNamePlaceholder:"예: crewx-ui 개발, 마케팅 캠페인 기획",fieldDescription:"설명 (선택)",fieldDescriptionPlaceholder:"이 프로젝트가 해결하려는 것을 간단히 설명하세요",sectionTeam:"팀 구성",sectionTeamDesc:"이 프로젝트에 참여할 에이전트를 선택하세요. 나중에 추가할 수 있습니다.",fieldAgent:"담당 에이전트",fieldAgentPlaceholder:"에이전트 선택...",agentsError:"에이전트 목록을 불러오지 못했습니다",noAgentsAvailable:"사용 가능한 에이전트가 없습니다",allAgentsSelected:"모든 에이전트가 선택되었습니다"},$Bn={pending:"대기 중",running:"실행 중",runningWithCount:"실행 중 {{count}}건",success:"완료",failed:"실패"},FBn={placeholder:"명령을 입력하세요...",close:"닫기"},BBn={title:"통합 검색",placeholder:"메모리와 문서에서 검색...",searchBtn:"검색",tabAll:"전체",tabMemory:"메모리",tabDocs:"문서",noResults:"검색 결과가 없습니다",hint:"검색어를 입력하고 Enter 또는 검색 버튼을 누르세요",tabDocsComingSoon:"문서 (준비 중)"},zBn={sidebarTitle:"내 티어 — Usage로 이동",promotionTitle:"티어 승급!",promotionSubtitle:"축하합니다! 새로운 티어에 도달했습니다",shareOnX:"X에 공유",shareText:"CrewX에서 {{tier}} 티어를 달성했습니다! 🏆 #CrewX #AI"},HBn={title:"사용량",loading:"사용량 데이터를 불러오는 중...",tabProvider:"프로바이더별",tabAgent:"에이전트별",totalCost:"총 비용",thisMonth:"이번 달",totalTokens:"총 토큰",tokens:"토큰",cost:"비용",byModel:"모델별",daily:"일간",monthly:"월간",workspaceBreakdown:"워크스페이스별 사용량",workspaceBreakdownDesc:"전체 워크스페이스 집계",loadingWorkspaces:"워크스페이스 사용량 로딩 중...",noWorkspaces:"기록된 워크스페이스 사용량이 없습니다.",unknownWorkspace:"알 수 없는 워크스페이스",input:"입력",output:"출력",cache:"캐시",tasks:"태스크",dailyDetails:"일별 상세",noData:"데이터가 없습니다.",date:"날짜",tierLabel:"현재 티어",toNext:"{{tier}}까지 {{tokens}} 남음",maxTier:"최고 티어 달성!",pace:"월말 예상",shareX:"X에 공유",noAgentData:"에이전트 사용량 데이터가 없습니다.",agentTrend:"에이전트별 사용량",ofTotal:"전체 대비",allWorkspaces:"전체 워크스페이스",workspaceFilterAria:"워크스페이스 필터",heroTitle:"이번 달 토큰 사용량",heroDescription:"이번 달 사용량을 한눈에 확인하세요.",heroCost:"tokens ≈ {{cost}}",previousMonthStat:"지난달 {{value}}",currentMonthStat:"이번달 {{value}}",tierProgressLabel:"→ {{tier}} ({{tokens}})",tierTooltipTitle:"티어 기준표",tierTooltipInfoLabel:"전체 티어 기준 보기",paceWithRemaining:"Pace ~{{pace}} · {{tier}}까지 {{remaining}}",paceOnly:"Pace ~{{pace}}",donutTitle:"에이전트별 비율",donutDescription:"이번 달 토큰 사용량 기준 상위 에이전트입니다.",topAgentsTitle:"Top 10 에이전트",agentCountLabel:"에이전트 {{count}}개",trendTitle:"30일 트렌드",trendDescription:"상위 에이전트의 일별 토큰 사용량입니다.",emptyTitle:"등록된 에이전트가 없습니다",emptyDescription:"에이전트를 등록하면 사용량이 여기에 표시됩니다.",emptyCta:"에이전트 등록하기",showMore:"더보기",showLess:"접기",rank:"순위",agent:"에이전트",share:"비율",trend:"추세",others:"기타"},UBn={guard:{redirecting:"온보딩 페이지로 이동합니다..."},common:{stepOf:"{{total}}단계 중 {{current}}단계",next:"다음 →",prev:"← 이전",skip:"건너뛰기",skipS1:"나중에 설치할게요",skipS2:"나중에 설정할게요",start:"시작하기 →",retry:"다시 시도",loading:"로딩 중..."},popup:{title:"처음이시네요!",description:"AI 도구 설치를 도와드릴까요? 5분이면 됩니다.",yes:"온보딩 시작",no:"괜찮아요"},s1:{title:"사용할 AI 도구를 선택하세요",subtitle:"설치 여부와 관계없이 원하는 도구를 선택하면, 설치를 도와드릴게요.",statusInstalled:"v{{version}} 설치됨",statusNotInstalled:"미설치",willInstall:"설치할게요",authLoggedIn:"✓ 로그인됨",authRequired:"⚠ 로그인 필요",authUnknown:"수동 확인 필요",loadingCards:"도구를 확인하고 있어요...",errorTitle:"도구 확인에 실패했어요",errorDesc:"다시 시도하시겠어요?",noToolsSelected:"사용할 도구를 하나 이상 선택하세요",descClaude:"Anthropic의 AI 코딩 도우미",descCodex:"OpenAI의 터미널 코딩 에이전트",descGemini:"Google의 AI 개발 도우미",descCopilot:"GitHub의 AI 페어 프로그래머",descOpencode:"오픈소스 AI 코딩 도우미"},s2:{title:"AI 도구를 설정하고 있어요",subtitle:"선택한 도구를 순서대로 설치하고 로그인합니다",installStarting:"설치를 시작합니다...",installOk:"설치 완료",loginWaiting:"{{name}} 로그인 대기 중... 브라우저에서 인증해주세요.",loginOk:"로그인 완료",loginSkipped:"로그인을 건너뛰었습니다",setupLog:"설치 로그",waitingForSetup:"설정을 준비하는 중...",statusInstalling:"⏳ 설치 중...",statusInstalled:"설치 완료",statusLoggingIn:"로그인 중...",statusComplete:"완료",statusFailed:"설치 실패"},bubble:{welcome:"안녕하세요! 잠시만 기다려 주세요",tip1:"CrewX는 여러 AI를 하나의 팀으로 묶어 관리해요.",tip2:"에이전트마다 역할을 지정하면 효율이 올라가요.",tip3:"로그인이 완료되면 바로 시작할 수 있어요!"}},WBn={title:"워크플로",totalCount:"{{count}}개 워크플로",searchPlaceholder:"ID, 이름, 설명으로 검색...",clearSearch:"검색어 지우기",bannerTitle:"여러 AI 직원이 순서대로 일하는 자동화 레시피입니다.",bannerBody:"대화창에서 /wf 를 입력하면 바로 사용할 수 있어요.",startChat:"대화 시작",runWorkflow:"실행",startChatTooltip:"/wf {{id}}",refresh:"새로고침",retry:"재시도",pageError:"워크플로 화면을 렌더링하는 중 문제가 발생했습니다.",errorsTitle:"{{count}}개 워크플로를 불러올 수 없습니다",errorItem:"{{file}}: {{reason}}",emptyTitle:"워크플로가 아직 없습니다",emptyDescription:"워크플로는 AI 에이전트들의 협업 순서를 정의합니다.",emptyAction:"팀의 개발자에게 워크플로 설정을 요청하세요.",emptyFilteredTitle:"검색 결과가 없습니다",emptyFilteredDescription:"ID, 이름, 설명 또는 에이전트 이름을 다시 확인해 주세요.",metadataAgents:"에이전트 수",metadataNodes:"노드 수",metadataTimeout:"타임아웃",metadataMaxIterations:"최대 반복",timeoutMinutes:"{{count}}분",iterationCount:"{{count}}회",noLimit:"제한 없음",diagramLoading:"다이어그램을 렌더링하는 중...",diagramError:"다이어그램 렌더링에 실패했습니다.",sourcePath:"소스 경로: {{path}}",stateVariablesTitle:"State Variables",mentionLabel:"워크플로 제안",noSuggestions:"표시할 제안이 없습니다.",selectedLabel:"/wf {{id}}",graph:{readonly:"읽기 전용",generated:"YAML에서 생성됨",descriptionFallback:"이 워크플로는 YAML 정의에서 생성된 실행 지도이며, 여기서는 노드를 편집하지 않고 구조만 확인합니다.",detailsTitle:"노드 정보",legendTitle:"범례",sourceTitle:"소스",sourceFile:"소스 파일",contract:"동작 계약",readonlyContract:"이 화면은 확인 전용입니다. 워크플로 수정은 YAML에서 하고 실행은 대화창에서 시작합니다.",nodeId:"노드 ID",nodeType:"타입",agent:"에이전트",description:"설명",input:"입력",condition:"분기 조건",if:"조건",noNodeSelected:"노드를 선택하면 정의를 확인할 수 있습니다.",noStateVariables:"State 변수는 워크플로 실행 중에 정의됩니다.",layouting:"워크플로 지도를 정리하는 중...",mermaidFallback:"Mermaid 대체 보기",closePanel:"닫기"}},qBn={autoDefault:"기본값: auto",noCurrentNode:"시작 대기",approvalHint:"승인이 필요한 지점에서 자동 실행이 멈췄습니다. 승인해야 다음 노드가 실행됩니다.",approval:{title:"승인 요청",fallbackQuestion:"이 워크플로의 다음 단계를 실행할까요?",approvePath:"승인하면:",rejectPath:"거절하면:"},lastAudit:"최근 실행: {{node}} · {{duration}}ms",approve:"승인",reject:"거절",refresh:"새로고침",started:"{{id}} 워크플로 실행을 시작했습니다.",startFailed:"워크플로 실행 실패: {{message}}",refreshFailed:"워크플로 상태 갱신 실패: {{message}}",approveFailed:"워크플로 승인 실패: {{message}}",rejectFailed:"워크플로 거절 실패: {{message}}",cancelFailed:"워크플로 중지 실패: {{message}}",stop:"중지",cancelledHint:"사용자가 워크플로 실행을 중지했습니다.",loadingCard:"워크플로 실행 상태를 불러오는 중...",unverifiedCard:"검증되지 않은 워크플로 카드입니다.",expiredCard:{title:"워크플로 카드가 만료되었습니다",description:"이 카드는 7일이 지나 만료되었습니다. /wf {{id}} 명령으로 워크플로를 다시 실행하세요."},state:{title:"State",keyCount:"{{count}}개 키",empty:"현재 저장된 state가 없습니다."},timeline:{title:"실행 절차",summary:"{{completed}}개 단계 완료",count:"{{visible}}개 도달",collapsed:"실행 절차 접힘 · {{completed}}개 단계 완료",status:{pending:"대기",current:"진행 중",waiting_approval:"승인 대기",paused:"일시 정지",completed:"완료",failed:"실패",cancelled:"중지됨"}},nodeType:{agent_task:"에이전트 작업",skill_task:"스킬 작업",shell_task:"쉘 작업",branch:"조건 분기",parallel:"병렬 실행",join:"병렬 합류",expression:"상태 계산",approval:"승인",end:"종료",error:"오류 종료"},phase:{not_started:"시작 중",running:"진행 중",waiting_approval:"승인 대기",paused:"일시 정지",completed:"완료",failed:"실패",cancelled:"중지됨"}},GBn={title:"CLI 버전 관리",subtitle:"AI CLI 도구의 설치 상태를 확인하고 업데이트합니다",actions:{refresh:"새로고침",install:"설치",update:"업데이트",openDocs:"{{name}} 문서 열기",openSignup:"{{name}} 서비스 페이지 열기"},status:{checking:"확인 중...",installing:"설치 중...",updating:"업데이트 중...",installed:"설치됨",notInstalled:"미설치",pending:"대기 중",error:"오류"},version:{selectLabel:"{{name}} 버전 선택",latestOption:"latest",latestVersion:"최신: v{{version}}"},terminal:{waiting:"CLI 상태를 기다리는 중...",processing:"처리 중..."},messages:{allUpToDate:"모든 CLI가 최신 상태입니다",someFailed:"일부 설치 또는 업데이트에 실패했습니다",crewxUnavailable:"이 화면을 열기 전에 CrewX CLI가 필요합니다.",crewxUpdateHint:"터미널에서 npm i -g crewx@latest로 업데이트"},logs:{checkingVersions:"CLI 버전을 확인하는 중...",checkComplete:"확인이 완료되었습니다. 각 CLI를 검토하고 계속 진행하세요.",checkFailed:"CLI 버전 확인에 실패했습니다: {{message}}",crewxDetected:"CrewX CLI v{{version}}이 감지되었습니다.",crewxUpdateAvailable:"CrewX CLI v{{current}} → v{{latest}} (업데이트 가능)",cliUpToDate:"{{name}} v{{version}}은(는) 최신 상태입니다.",cliUpdateAvailable:"{{name}} v{{current}} → v{{latest}} (업데이트 가능)",cliNotInstalled:"{{name}}이(가) 설치되어 있지 않습니다.",installing:"{{name}} 설치 중 ({{version}})...",updating:"{{name}} 업데이트 중 ({{version}})...",installSuccess:"{{name}} 설치 완료 (v{{version}}).",updateSuccess:"{{name}} 업데이트 완료 (v{{version}}).",actionFailed:"{{name}} {{action}}에 실패했습니다: {{message}}",crewxNotInstalled:"CrewX CLI가 글로벌 설치되어 있지 않습니다."}},VBn={settings:oBn,threadDetail:aBn,markdownEditor:lBn,taskDetail:cBn,chatInput:uBn,cliData:dBn,agent:fBn,wbs:hBn,docs:pBn,nav:gBn,planner:mBn,cron:bBn,goal:wBn,market:yBn,memory:xBn,knowledge:vBn,graph:kBn,projectDetail:CBn,mermaidFullscreen:SBn,common:EBn,auth:_Bn,workspace:TBn,dirPicker:ABn,limits:MBn,beta:NBn,upgrade:jBn,threads:DBn,projects:IBn,tasks:OBn,newTask:LBn,threadNew:PBn,project:RBn,status:$Bn,overlay:FBn,search:BBn,tier:zBn,usage:HBn,onboarding:UBn,workflow:WBn,workflowRun:qBn,cliManager:GBn},KBn={language:"Language",languageDesc:"Change the UI display language",theme:"Theme",themeDesc:"Change the screen theme",themeLight:"Light",themeDark:"Dark",themeSystemHint:"The default follows your system setting, and {{theme}} is currently applied.",tools:"Tools",toolsDesc:"Manage AI CLI tools",cliManager:"CLI Version Manager",cliManagerDesc:"Manage AI CLI versions (update/install)",openCli:"Open",versionInfo:"Version information",versionInfoDesc:"Shows the currently connected CrewX server version",crewxVersion:"CrewX version",themeChanged:"Theme updated",languageChanged:"Language updated",changeFailed:"Failed to update settings",onboarding:"Onboarding / CLI Setup",onboardingDesc:"Re-run the AI tool installation and login guide",openOnboarding:"Open",analytics:"Anonymous usage statistics",analyticsDesc:"Collect anonymous usage statistics to help improve the product. No personal information is included.",analyticsChanged:"Usage statistics setting updated",apiTokens:{title:"API access tokens",description:"Manage token-based access for external clients such as the REST API and Chrome X (JWT based)",issue:"Issue new token",empty:"No API tokens have been issued yet.",name:"Name",expiresAt:"Expires",agentScope:"Agent scope",status:"Status",actions:"Actions",unrestricted:"Unrestricted",sourceDirect:"Direct issue",sourceNegotiate:"Chrome X approval",statusValue:{valid:"Valid",expiringSoon:"Expiring soon",expired:"Expired",revoked:"Revoked"},revoke:"Revoke",revoking:"Revoking...",revokedAction:"Revoked",refresh:"Refresh",loading:"Loading tokens...",loadFailed:"Failed to load the token list.",revokeFailed:"Failed to revoke the token.",revokeConfirm:'Revoke the "{{name}}" token?',issueModal:{title:"Issue a new API access token",successTitle:"Token issued",successDescription:"Copy the token below right now",nameLabel:"Name",nameHint:"This name identifies the token and cannot be changed later.",namePlaceholder:"e.g. dev-local-2026",expiresLabel:"Expiration",agentScopeLabel:"Agent scope",agentScopeOptional:"Optional",agentScopeHint:"Restrict this token to a specific agent.",agentScopePlaceholder:"e.g. @ui_frontend_dev",notice:"The token is shown only once immediately after issuance. Store it somewhere safe.",tokenLabel:"Access token",danger:"Once you close this window, you cannot view the token again. Copy it now.",metaName:"Name",metaExpiresAt:"Expires",metaAgentScope:"Agent scope",expiresOption:{"30d":"30 days","90d":"90 days","1y":"1 year"},cancel:"Cancel",submit:"Issue",submitting:"Issuing...",confirm:"Done",copy:"Copy",copied:"Copied ✓",error:{TOKEN_LIMIT_EXCEEDED:"You have reached the FREE plan API token limit ({{limit}}).",UNKNOWN:"Failed to issue the token."}}}},JBn={back:"Back",noMessages:"No messages",noMessagesHint:"Send a message to an agent using the input below",boxLabel:"📦 {{count}} tasks · {{tokens}}K tokens (summarized)",scrollToLatest:"Jump to latest message",taskPanel:{retryStarted:"Task retry started",retryFailed:"Failed to retry task: {{message}}"}},YBn={placeholder:"Enter markdown",toolbar:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",bold:"Bold",italic:"Italic",strike:"Strikethrough",bulletList:"Bullet list",orderedList:"Ordered list",blockquote:"Blockquote",code:"Code",codeBlock:"Code block",horizontalRule:"Horizontal rule",undo:"Undo",redo:"Redo"}},XBn={noMessages:"No messages",noMessagesHint:"Send a message to an agent using the input below",inputPlaceholder:"Type an @agent message or /wf command...",inputPlaceholderActive:"Message @{{agent}}...",activityLog:"Activity Log",noActivityLog:"No activity log",subAgentReply:"Sub-Agent Reply",back:"Back",send:"Send",inputModeLabel:"Mode",inputModeQuery:"Query",inputModeExecute:"Execute",captureScreen:"Capture Screen",captureAlt:"Captured screen",agentJoined:"── 🤖 @{{agent}} joined ──",tokenUsage:"{{input}}↑ {{output}}↓",costLabel:"${{cost}}",running:"Running",failed:"Failed",retry:"Retry",thinking:"Thinking...",systemChip:{retryFailedTask:"Failed task retry",systemContext:"System context"},logDetail:{title:"Activity log detail",toolTitle:"{{tool}} log detail",toolFallback:"Tool",openFullView:"Open full view"}},QBn={attachFile:"Attach file",dropFile:"Drop file here",removeAttachment:"Remove attachment",fileTooLarge:'"{{name}}" is too large ({{size}}MB). The maximum attachment size is {{max}}MB.',sendTooLarge:"Couldn't send — attachments are too large. Try smaller files or fewer of them.",sendFailed:"Failed to send the message. Please try again in a moment."},ZBn={crewxInstallNote:"AI agent team management tool"},ezn={management:"Agent Management",add:"Add Agent",edit:"Edit Agent",delete:"Delete",deleteConfirmTitle:"Delete Agent",deleteConfirmMsg:"Are you sure you want to delete @{{id}} ({{name}})?",deleteWarning:"This action cannot be undone.",cancel:"Cancel",save:"Save",back:"Go back",backToList:"Back to list",notFound:"Agent not found.",loadError:"Failed to load agent information.",listError:"Failed to load agent list.",loadFailTitle:"Load Failed",saveError:"Failed to save.",createError:{AGENT_LIMIT_EXCEEDED:"You have reached the beta free plan agent limit."},deleteError:"Failed to delete.",retry:"Retry",providerState:{loading:"Loading AI engine info...",loadingSlow:"Waking up engine... this usually takes 10-20 seconds.",error:"Could not load engine info. You may need to sign in to the CLI or AI engine.",retry:"Try again"},count:"({{count}})",team:{unassigned:"Other",memberCount_one:"{{count}} member",memberCount_other:"{{count}} members",expand:"Expand {{team}} team",collapse:"Collapse {{team}} team"},emptyTitle:"No agents registered",emptyDesc:"Add an agent using the + Add Agent button",field:{id:"Agent ID",idHint:"Unique identifier · use letters, numbers, and underscores (e.g. ui_frontend_dev)",name:"Name",role:"Role",team:"Team",provider:"AI Engine",model:"Model",searchModel:"Search models",description:"Description",descPlaceholder:"Describe the agent's role and capabilities",selectProvider:"Select an AI engine",selectModel:"Select a model",selectMode:"Select mode",selectEffort:"Select effort",selectProviderFirst:"Select an AI engine first",clearSelection:"Clear selection",noOptions:"No selectable options",noSearchResults:"No matching results",custom:"custom",idPlaceholder:"ui_frontend_dev",namePlaceholder:"Frontend Developer",rolePlaceholder:"Frontend Developer",teamPlaceholder:"CrewX UI Team",recommended:"recommended"},modeSettings:"Mode Settings",queryMode:"Query",executeMode:"Execute",mode:"Mode",effort:"Effort",validation:{required:"This field is required"},engine:{claude:"Claude",codex:"Codex",gemini:"Gemini",copilot:"Copilot"},guide:{providerTitle:"AI Engine Comparison",modelTitle:"Model Comparison ({{provider}})",providerClaude:"Best code quality, excellent large codebase comprehension",providerCodex:"Great IDE integration, safety controls, web dev strength",providerGemini:"Best multimodal (screenshots/PDF inline), generous free tier",providerCopilot:"Smooth GitHub integration and strong default support for fast general work"},model:{"claude-opus-4-6":{label:"Claude Opus 4.6",cost:"⚡ Fast burn",desc:"Architecture design, large-scale refactoring, complex reasoning"},"claude-sonnet-4-6":{label:"Claude Sonnet 4.6",cost:"⚖️ Moderate",desc:"General coding, feature implementation (recommended)"},"claude-haiku-4-5":{label:"Claude Haiku 4.5",cost:"🟢 Efficient",desc:"Simple queries, quick search, bulk tasks"},"claude-opus-4-5":{label:"Claude Opus 4.5",cost:"⚡ Fast burn",desc:"Previous gen flagship, complex reasoning"},"claude-sonnet-4-5":{label:"Claude Sonnet 4.5",cost:"⚖️ Moderate",desc:"Previous gen balanced, general coding"},"claude-sonnet-4":{label:"Claude Sonnet 4",cost:"⚖️ Moderate",desc:"Legacy, stable coding"},"claude-opus-4-6-fast":{label:"Claude Opus 4.6 (fast mode)",cost:"🔥 Very fast burn",desc:"Top performance + fast response, Preview"},"gpt-5.3-codex":{label:"GPT-5.3 Codex",cost:"⚡ Fast burn",desc:"Latest, most powerful coding"},"gpt-5.2-codex":{label:"GPT-5.2 Codex",cost:"⚖️ Moderate",desc:"Stable coding, large-scale refactoring"},"gpt-5.1-codex-mini":{label:"GPT-5.1 Codex Mini",cost:"🟢 Efficient",desc:"Lightweight coding, cost efficient"},"o4-mini":{label:"o4-mini",cost:"🟢 Efficient",desc:"Legacy, simple tasks"},"gemini-3-pro-preview":{label:"Gemini 3 Pro",cost:"⚖️ Moderate",desc:"Complex reasoning, design analysis"},"gemini-3-flash-preview":{label:"Gemini 3 Flash",cost:"🟢 Efficient",desc:"Strong coding, fast responses (recommended)"},"gemini-2.5-pro":{label:"Gemini 2.5 Pro",cost:"⚖️ Moderate",desc:"Stable production"},"gemini-2.5-flash":{label:"Gemini 2.5 Flash",cost:"💚 Very efficient",desc:"Batch processing, lightweight tasks"},"gpt-5.4":{label:"GPT-5.4",cost:"⚖️ Moderate",desc:"Balanced general work and the default GitHub Copilot choice (recommended)"},"gpt-5.2":{label:"GPT-5.2",cost:"⚖️ Moderate",desc:"Stable general coding"},"gpt-5.1":{label:"GPT-5.1",cost:"⚖️ Moderate",desc:"General coding"},"gpt-5.4-mini":{label:"GPT-5.4 Mini",cost:"🟢 Economical",desc:"Lightweight tasks, cost efficient"},"gpt-5-mini":{label:"GPT-5 Mini",cost:"💚 Very economical",desc:"Simple tasks, lowest cost"},"gpt-4.1":{label:"GPT-4.1",cost:"💚 Very economical",desc:"Legacy, simple tasks"}},duplicate:"Duplicate",duplicateError:"Failed to load the source agent for duplication.",section:{basicTitle:"Agent information",basicDescription:"Enter the core information for this agent.",skillsTitle:"Select skills to use",skillsDescription:"Choose which installed external skills this agent can use. Built-in skills are always enabled.",promptTitle:"System prompt",promptDescription:"Visually edit the system prompt with document blocks and variable chips."},context:{title:"Context Sharing",experimental:"Experimental",description:"Share your goals and daily tasks with the agent for more contextual responses.",goalsLabel:"Share Goals",goalsHint:"Share OKR goals with the agent",goalsAll:"All active Goals",goalsAllDesc:"Automatically share all active goals.",goalsSpecific:"Select specific Goals",goalsSpecificDesc:"Manually select which goals to share.",goalsAdd:"Add",goalsPickerEmpty:"No goals available to add.",dailyLabel:"Share Daily",dailyHint:"Share today's tasks with this agent"},skills:{emptyTitle:"No installed external skills",emptyDescription:"Install skills from the market and they will appear here. Built-in skills are always enabled, so no extra setup is needed.",openMarket:"Open market",loadError:"Failed to load installed skills."},tab:{basic:"Basic Info",skills:"Skills",prompt:"Prompt"},prompt:{placeholder:"Type a prompt and insert variables or documents from the toolbar",editorLabel:"Prompt editor",documentInsert:"Insert document",documentInsertLoading:"Loading documents...",documentInsertEmpty:"No documents available to insert.",documentInsertError:"Failed to load documents.",documentInsertUnavailable:"The document API is not connected yet, so document insert is unavailable.",variantContent:"Content",variantToc:"TOC",documentChip:{delete:"Delete"},documentPicker:{searchPlaceholder:"Search documents",inlineSection:"Inline documents",docsSection:"docs/",treeLoading:"Loading the document tree...",treeError:"Failed to load the document tree.",noInlineResults:"No inline documents match your search.",noTreeResults:"No files match your search.",linked:"Registered document"},preview:{button:"Preview",title:"Preview",refresh:"Refresh",copy:"Copy",loading:"Rendering...",unavailable:"The preview API is not connected yet, so the rendered result is unavailable.",error:"Rendering error",empty:"Enter a prompt to preview the rendered result."},toolbar:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",bold:"Bold",italic:"Italic",strike:"Strikethrough",code:"Code",bulletList:"Bullet list",orderedList:"Ordered list",blockquote:"Blockquote",codeBlock:"Code block",horizontalRule:"Horizontal rule",undo:"Undo",redo:"Redo",variable:"Insert variable",insert:"Insert",search:"Search",empty:"No items to show."}},template:{title:"Quick start: build from a template",subtitle:"Start faster with a common agent template.",direct:"Direct setup",codingAssistant:"Coding Assistant",codingAssistantDesc:"A default template for implementation and refactoring",research:"Research",researchDesc:"A template for research and comparison work",dataAnalysis:"Data Analysis",dataAnalysisDesc:"A template focused on analysis and reporting",writing:"Writing",writingDesc:"A template for drafting and editing content",designReview:"Design Review",designReviewDesc:"A template for UI/UX review and feedback"},skill:{memory:{label:"memory",description:"Long-term memory and context management"},search:{label:"search",description:"Source and codebase search"},git:{label:"git",description:"Git status access inside the CrewX context"},cron:{label:"cron",description:"Scheduled task configuration"},wbs:{label:"wbs",description:"Step-by-step work breakdown management"}},emptyAction:"+ Add Agent"},tzn={title:"WBS",detail:"WBS Detail",totalCount:"{{count}} projects",empty:"No WBS projects",retry:"Retry",progress:"Progress",jobCount:"{{completed}}/{{total}} jobs",failedCount:"{{count}} failed",runningCount:"{{count}} running",pendingCount:"{{count}} pending",backToList:"Back to list",jobs:"Jobs",noJobs:"No jobs",agent:"Agent",createdAt:"Created",completedAt:"Completed",expand:"Expand",collapse:"Collapse",status:{planning:"Planning",running:"Running",completed:"Completed",partial:"Partial",on_hold:"On Hold"},jobStatus:{pending:"Pending",running:"Running",completed:"Completed",failed:"Failed"},sort:{newest:"Newest First",oldest:"Oldest First",progress:"Progress",name:"Name"}},nzn={title:"Docs",fileTree:"File Tree",searchPlaceholder:"Search files...",noFiles:"No files",noSearchResults:"No results found",selectFile:"Select a file from the tree on the left",copyPath:"Copy path",pathCopied:"Path copied",copyContent:"Copy",contentCopied:"Copied",imageUnavailable:"Image unavailable",view:{fontLabel:"Document font",fontSystem:"System",fontPretendard:"Pretendard",fontNotoSansKr:"Noto Sans KR",fontInter:"Inter",fontSerif:"Serif",fontNotoSerifKr:"Noto Serif KR",fontMono:"Mono",fontCoding:"Coding",localFontsGroup:"Local fonts",localFontsLoading:"Checking local fonts",localFontsUnsupported:"This browser does not support local font loading",localFontsFailed:"Could not load local fonts",localFontsEmpty:"No local fonts were loaded",zoomLabel:"Zoom",zoomOut:"Zoom out",zoomIn:"Zoom in"},toggleTree:{show:"Show file tree",hide:"Hide file tree"},edit:{button:"Edit",save:"Save",cancel:"Cancel",dirtyMarker:"●",savedToast:"Saved",saveFailed:"Save failed: {{message}}",discardConfirm:"Discard your changes?",conflict:{title:"This file was modified elsewhere",message:"The file changed in another window or external editor. What would you like to do?",overwrite:"Overwrite",reload:"Reload",dismiss:"Cancel"}},tab:{markdown:"Markdown",implStatus:"Impl Status"},impl:{totalScreens:"Total Screens",syncDone:"Synced",mismatch:"Mismatch",id:"ID",name:"Name",doc:"Doc",pencil:"Pencil",code:"Code",empty:"No implementation status data",legend:"Legend: ✅ exists · ❌ missing (mismatched rows highlighted in red)"}},rzn={agents:"Agents",planner:"Daily Planner",cron:"Schedules",goals:"Goals",wbs:"WBS",memory:"Memory",graph:"Knowledge Graph",docs:"Docs",market:"Market",cliManager:"CLI Manager",settings:"Settings",newTask:"New Chat",recentTasks:"Recent Chats",noTasks:"No chats",viewAll:"View all →",tools:"Tools",search:"Search",projects:"Projects",more:"More",freePlan:"Free Plan",workflows:"Workflows",usage:"Usage",tasks:"Task History",workspaces:"Workspaces",openSidebar:"Open sidebar",closeSidebar:"Close sidebar"},izn={title:"Daily Planner",subtitle:"Keep today's priorities and execution flow in one place.",loadError:"Failed to load the planner",saveError:"Failed to save the planner",retry:"Retry",loading:"Loading planner...",empty:"No planner data is available",today:"Today",previousDate:"Previous date",nextDate:"Next date",status:{saved:"Saved",saving:"Saving...",unsaved:"Unsaved changes"},mockNotice:"The backend API is not ready yet, so temporary planner data is being shown.",top3:{title:"Top 3 Priorities",description:"Pick the 3 things that must get done today from your dump.",empty:"No priorities have been set for today",noAgents:"No agents assigned",placeholder:"Most important task...",inputLabel:"Top priority {{rank}}"},braindump:{title:"Brain Dump",description:"Empty your mind. Dump every task, worry, and idea — connections will emerge.",empty:"No brain dump items yet",placeholder:"Pour out everything on your mind...",inputLabel:"Brain dump"},schedule:{title:"Schedule",description:"Assign tasks to time blocks and check them off.",empty:"No schedule items yet",toggleTask:"Toggle completion for {{task}}",placeholder:"What's planned for this slot?",inputLabel:"Task for {{time}}",status:{done:"Done",pending:"Pending",cancelled:"Cancelled"}},notes:{title:"Notes",description:"Freeform notes — anything goes.",empty:"No notes yet",placeholder:"Write your notes...",inputLabel:"Notes"},goalChip:{title:"Today's Goals",description:"Goals you're tracking. Agents use these as priority hints.",addGoal:"Select Goal",removeChip:"Remove from daily"}},szn={title:"Schedule",subtitle:"Automation control",apiUnavailable:"The cron API is not ready yet. Schedules will appear when the backend is connected.",period:{am:"AM",pm:"PM"},days:{mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat",sun:"Sun"},repeat:{daily:"Every day",weekdays:"Weekdays",weekends:"Weekends",weekdaysOnly:"Weekdays only",weekendsOnly:"Weekends only",custom:"Custom",customLabel:"Custom repeat",weekly:"Every {{day}}"},actions:{new:"New Schedule",add:"Add",save:"Save",delete:"Delete",cancel:"Cancel"},card:{untitled:"Untitled schedule",toggle:"Toggle {{name}}",cronBadge:"Expression"},daemon:{loading:"Checking status...",running:"Schedules active",stopped:"Schedules paused",pid:"PID {{pid}}",startBtn:"Start",stopBtn:"Stop",starting:"Starting...",stopping:"Stopping...",summary:"{{enabled}} enabled / {{total}} total",startedAt:"Started {{date}}"},date:{todayAt:"Today {{time}}",tomorrowAt:"Tomorrow {{time}}"},empty:{title:"No schedules yet",description:"Add a schedule to start recurring automation."},history:{title:"Recent activity",recentCount:"Recent 5",runCount:"{{count}} runs"},modal:{createTitle:"New Schedule",editTitle:"Edit Schedule",subtitle:"Set a simple alarm-style automation schedule.",unsupportedCron:"This schedule uses a pattern that cannot be edited with the simple repeat form yet.",hour:"Hour",minute:"Minute",repeatLabel:"Repeat",dayLabel:"Choose days",nameLabel:"Schedule name",namePlaceholder:"e.g. Daily Report",agentLabel:"Agent",agentPlaceholder:"Select an agent",modeLabel:"Mode",commandLabel:"Command",commandPlaceholder:"Describe what should run",timezoneLabel:"Timezone",timezonePlaceholder:"Select timezone",timezoneSearch:"Search timezone...",timeoutLabel:"Timeout (ms)",workingDirectoryLabel:"Working directory",workingDirectoryPlaceholder:"e.g. /Users/name/project",allowConcurrentLabel:"Allow overlapping runs",tabBasic:"Basic",tabAdvanced:"Advanced",cannotSwitchToBasic:"This expression cannot be represented in basic mode."},advanced:{cronLabel:"Cron Expression",queryChip:"Ask AI",aiHelperLabel:"Describe in natural language and we'll create the expression",aiPlaceholder:"e.g., Run every weekday at 9 AM",generateBtn:"Generate",aiGenerating:"AI is generating the expression...",webllmLoading:"Loading AI model (one-time download)",webllmFirstLoad:"First load downloads the model. Cached on subsequent visits.",webllmReady:"AI model ready",webllmError:"Failed to load AI model",webllmFallback:"AI model unavailable — using pattern matching instead"},describe:{everyNMinutes:"Runs every {{n}} minutes",everyNHours:"Runs every {{n}} hours",everyDay:"Every day",weekdays:"Weekdays",weekends:"Weekends",atTime:"Runs at {{time}} on {{days}}",monthly:"Runs on day {{days}} at {{time}} monthly"},mode:{execute:"execute",query:"query",command:"command"},preview:{summary:"{{repeat}} at {{time}} {{period}} by {{agent}}",commandMode:"the command"},validation:{hour:"Hour must be between 1 and 12.",minute:"Minute must be between 0 and 59.",days:"Choose at least one day.",agent:"Choose an agent.",prompt:"Enter a command."},delete:{title:"Delete this schedule?",description:'Delete "{{name}}".'},field:{minute:"Min",minuteTip:"0-59 or */5 (every 5 min)",hour:"Hour",hourTip:"0-23 (24h format)",day:"Day",dayTip:"1-31 (day of month)",month:"Mon",monthTip:"1-12 or JAN-DEC",weekday:"DoW",weekdayTip:"0-6 (Sun=0, Sat=6), 1-5=weekdays"},example:{every5min:"Every 5m",daily9:"Daily 9am",weekday9:"Weekday 9am",weeklySun:"Every Sunday",monthly1_15:"1st & 15th"}},ozn={title:"Goals",newGoal:"New Goal",loadError:"Failed to load goals",retry:"Retry",loading:"Loading goals...",empty:"No goals yet. Click '+ New Goal' to start your first goal.",filterAll:"All",filterActive:"Active",filterDone:"Done",filterDropped:"Dropped",sectionActive:"Active",sectionDone:"Done",sectionDropped:"Dropped",countUnit:"",daysLeft:"D-{{days}} left",daysOverdue:"Overdue D+{{days}}",completedAt:"Completed {{date}}",droppedAt:"Dropped {{date}}",periodQuarter:"Quarter",periodHalf:"Half-year",periodYear:"Annual",periodWeeks:"{{n}}-week sprint",periodDays:"{{n}} days",saveButton:"Save",status:{saved:"Saved",dirty:"Modified",saving:"Saving...",error:"Save failed"},period:{title:"Period",description:"Set the timeframe and status for this goal.",start:"Start",end:"End",progress:"Progress",statusActive:"Active",statusDone:"Done",statusDropped:"Dropped",reasonRequired:"Please enter a reason for dropping",reasonPlaceholder:"Reason for dropping...",presetLabel:"Quick Set",preset1w:"1 Week",preset2w:"2 Weeks",presetQuarter:"This Quarter",presetQuarterHint:"Auto-set to current quarter start and end dates",preset3m:"3 Months",preset6m:"6 Months",preset1y:"1 Year",overdueSub:"Overdue +{{days}} days",remainingSub:"{{days}} days left"},objective:{title:"Objective",description:"A single inspiring sentence — what will you achieve?",titlePlaceholder:"e.g. 2026 Q2 product-market fit validation",bodyPlaceholder:"In one paragraph, what do you want to achieve this period..."},kr:{title:"Key Results",description:"3-5 measurable outcomes. Sub-items trigger automatic progress (weighted average).",summary:"{{count}} KRs · avg {{avg}}%",addL1:"Add Key Result",addL2:"Add Sub-item",textPlaceholder:"Key result...",weightTooltip:"Weight — this KR's importance ratio",dragHandle:"Drag to reorder"},newMode:{templateKr1Text:"Reach MAU 1,000"},notes:{title:"Notes",description:"Free-form notes. Meeting outcomes, insights, thoughts during the period.",placeholder:"Write your notes..."},reflection:{title:"Reflection",description:"Write after the period ends. What worked, what didn't, what to change next time.",notWritten:"Not written",placeholder:'No reflection yet. Switch status to "Done" to start writing your reflection.'},delete:{title:"Delete this goal?",body:"This action cannot be undone. Consider setting status to 'dropped' instead to preserve retrospective assets.",cancel:"Cancel",confirm:"Delete",toast:{success:"Goal deleted",error:"Failed to delete goal"}}},azn={title:"Market",subtitle:{installed:"{{count}} installed skills",official:"{{count}} official skills",registries:"{{count}} registries",summary:"{{installed}} installed · {{total}} total items"},tabs:{installed:"Installed Skills",official:"Official Skills",registries:"My Registries"},actions:{refresh:"Refresh",retry:"Retry",install:"Install",uninstall:"Remove",confirmUninstall:"Are you sure you want to remove {{name}}?",addRegistry:"Add Registry",deleteRegistry:"Delete",cancel:"Cancel",manageSources:"Manage Sources",checkUpdates:"Check Updates",close:"Close"},badges:{unverified:"Unverified",trusted:"Trusted",verified:"Verified",installed:"Installed",updateAvailable:"Update Available",customizedWarning:"Customized"},types:{skill:"Skill",template:"Template",agent:"Agent",workflow:"Workflow",plugin:"Plugin"},card:{unknownAuthor:"Unknown author",noDescription:"No description provided.",sourceDefault:"Available from the default CrewX registry",sourceWithRegistry:"Available from the {{registry}} registry"},official:{noticeTitle:"Official Skill Catalog",noticeDescription:"Browse verified skills from the {{registry}} registry and install them right away."},registryPanel:{title:"Custom Registry Management",description:"Connect GitHub repositories to expose team-specific skill catalogs inside CrewX UI."},registryCard:{defaultBadge:"Default",customBadge:"Custom",skillCount:"Skill count",addedAt:"Added",defaultHint:"The default registry is always preserved and cannot be removed.",customHint:"Custom registries can be removed at any time.",lockedAction:"Locked"},addRegistryModal:{title:"Add Market Registry",description:"Paste a GitHub repository URL and CrewX will connect it as a market registry.",urlLabel:"Registry URL",urlPlaceholder:"https://github.com/owner/repository",compatibilityTitle:"Claude Code skill format compatible",compatibilityDescription:"You can reuse the same GitHub repository URL described in the Claude Code skill docs. CrewX reads the registry metadata and wires it into the install flow."},empty:{installedTitle:"No installed skills yet",installedDescription:"Install the skills you need from the official catalog.",officialTitle:"No official skills available",officialDescription:"Check the registry connection and try again.",registryTitle:"No registries available",registryDescription:"Add a team registry in addition to the default catalog.",filteredTitle:"No matching items",filteredDescription:"Try a different keyword or filter to find what you need."},errors:{bannerTitle:"Failed to load market data",addRegistry:"Failed to add registry.",detailLoad:"Failed to load SKILL.md content. Showing the summary instead."},trust:{blockedPlugin:"Plugin installation blocked by security policy",blockedExec:"Executable installation blocked by security policy"},filters:{all:"All",installed:"Installed",skill:"Skill",template:"Template",agent:"Agent"},searchPlaceholder:"Search skills, templates, or agents...",list:{title:"Market List",count:"{{count}} items",installedHeading:"Installed",availableHeading:"Available",updatedLabel:"Updated {{time}}"},detail:{emptyTitle:"Select a market item",emptyDescription:"Choose an item from the list to inspect details, developers, and metadata.",description:"Description",loadingBody:"Loading SKILL.md content...",installToViewBody:"Install this skill to view the detailed contents.",tags:"Tags",developers:"Developers",contributions:"{{count}} commits",unavailable:"Unavailable",stats:{stars:"Stars",installs:"Installs",license:"License",updatedAt:"Updated"}},pluginDialog:{title:"Plugin Installation",description:"This package includes executable plugins.",warning:"Only install plugins from trusted sources.",perm1:"Execute code on your machine",perm2:"Access local files"},registryModal:{title:"Source Management",description:"Manage connected registries and add more market sources for your team."}},lzn={title:"Memory",allAgents:"All Agents",summaryStats:"{{entries}} entries · {{topics}} topics · Last updated {{date}}",summaryEmpty:"No summary available",countUnit:"",searchPlaceholder:"Search...",emptyEntries:"No entries found",selectEntry:"Select an entry from the list",category:"Category",topic:"Topic",agent:"Agent",date:"Date"},czn={title:"Knowledge Hub",allAgents:"All Agents",summaryStats:"{{entries}} entries · {{topics}} topics · Last updated {{date}}",summaryEmpty:"No summary available",countUnit:"",searchPlaceholder:"Search...",emptyEntries:"No entries found",selectEntry:"Select an entry from the list",category:"Category",topic:"Topic",agent:"Agent",date:"Date",graphComingSoon:"Graph tab coming soon",syncComingSoon:"Sync tab coming soon",tab:{list:"List",graph:"Graph",sync:"Sync"}},uzn={title:"Knowledge Graph",allAgents:"All Agents",memory:"Memory",docs:"Docs",knowhow:"Knowhow",loading:"Loading graph...",error:"Failed to load graph",retry:"Retry",empty:"No nodes to display",legend:"Legend",nodeCount:"{{count}} nodes",category:"Category",agent:"Agent",date:"Date",topic:"Topic",tags:"Tags",detailError:"Failed to load details",noDetail:"No details available"},dzn={back:"Back",agentTeam:"AI Agent Team",edit:"Edit",delete:"Delete",cancel:"Cancel",deleteTitle:"Delete Project",deleteWarning:"This action cannot be undone",deleteConfirmMsg:'Are you sure you want to delete "{{name}}"?',deleteError:"Failed to delete project",newChat:"New Chat",chatPrompt:"What would you like to ask {{name}}?",chatPlaceholder:"@agent / What would you like to start?",send:"Send",assignedAgents:"Assigned Agents",agentCount:"{{count}} agent(s)",noAgents:"No assigned agents",relatedThreads:"Related Threads",noThreads:"No related threads",description:"Description",noDescription:"No description provided",relatedDocs:"Related Docs",noDocs:"No related documents",unknownAgent:"Unknown agent",yesterday:"yesterday",projectStatus:{active:"Active",completed:"Completed",on_hold:"On Hold"},notFound:"Project not found",loadError:"Failed to load project",emptyPrompt:"(empty)",justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago",statusActive:"Active",statusCompleted:"Completed",statusOnHold:"On Hold",threadStatusPending:"Pending",threadStatusRunning:"Running",threadStatusSuccess:"Done",threadStatusFailed:"Failed"},fzn={expand:"View fullscreen",zoomIn:"Zoom in",zoomOut:"Zoom out",reset:"Reset",hintZoom:"Zoom",hintDrag:"Move",hintZoomKeys:"Zoom",hintReset:"Reset",hintClose:"Close",escHint:"Press ESC or click backdrop to close"},hzn={refresh:"Refresh",loadFailed:"Load failed",durationMinSec:"{{m}}m {{s}}s",durationSec:"{{s}}s",close:"Close",copy:"Copy path",copied:"Copied",somethingWentWrong:"Something went wrong",tryRefreshingPage:"Please refresh the page and try again."},pzn={loading:"Checking authentication...",login:{title:"Sign in to CrewX",description:"External access requires a valid CrewX admin session.",notice:"Localhost access is automatic. External access requires the configured username and password.",usernameLabel:"Username",usernamePlaceholder:"admin",passwordLabel:"Password",passwordPlaceholder:"Enter your password",submit:"Log in",submitting:"Signing in...",error:{invalidCredentials:"Invalid credentials",tooManyAttempts:"Too many attempts. Try again later.",unknown:"Failed to sign in. Please try again."}}},gzn={title:"Workspaces",loading:"Loading workspaces...",loadingShort:"Loading workspace...",loadingPath:"Checking current workspace",switchTitle:"Switch workspace",switchingTitle:"Switching workspace...",switchingDescription:"Waiting for {{name}} to restart and become available.",switchErrorTitle:"Workspace switch failed",switchErrorDescription:"The switch failed. Please try again.",shortcutHint:"⌘K to switch faster",manage:"Manage workspaces",create:"Create workspace",createUnavailable:"You have reached the beta plan limit.",currentBadge:"Current",slug:"Slug",updatedAt:"Updated",entryTitle:"Welcome to CrewX",entryDescription:"Create your first workspace to start working with your agent team.",entryLogoAlt:"CrewX logo",emptyTitle:"No workspaces found",emptyDescription:"Once a workspace is registered, you can switch between them here.",delete:{button:"Delete workspace",title:"Delete workspace",message:'Delete the "{{name}}" workspace?',note:"Only the workspace registration is removed. The directory and files stay as-is, and linked threads are preserved but detached from this workspace.",cancel:"Cancel",confirm:"Delete",currentDisabled:"You cannot delete the current workspace. Switch to another workspace first.",error:{WORKSPACE_NOT_FOUND:"The workspace could not be found.",WORKSPACE_IS_CURRENT:"You cannot delete the current workspace.",UNKNOWN:"An error occurred while deleting the workspace."}},createModal:{title:"Register workspace",description:"Register a project path with crewx.yaml to connect an agent team.",pathLabel:"Project path containing crewx.yaml",pathPlaceholder:"/Users/me/projects/my-project",browse:"Browse",slugLabel:"Slug (optional)",slugPlaceholder:"my-project",submit:"Register",cancel:"Cancel",success:"Workspace registered successfully.",confirmInit:{title:"Prepare this folder as a CrewX project?",description:"We will add the config file, set up automatic integration, and register the folder as a workspace.",pathLabel:"Selected path",filesLabel:"What will be prepared",files:{config:"Config file · crewx.yaml",automation:"Automatic integration · .crewx/, .claude/",registration:"Workspace registration · connect in CrewX"},confirm:"Prepare workspace",back:"Choose another path"},initProgress:{title:"Preparing project",description:"This can take a few seconds. We will connect it right away when it is ready.",step1:"Preparing config file",step2:"Preparing automatic integration",step3:"Registering workspace"},error:{WORKSPACE_LIMIT_EXCEEDED:"You have reached the beta free plan limit (3 workspaces). Join early access to hear about Pro when it launches.",NOT_A_CREWX_WORKSPACE:"This path does not contain crewx.yaml. Run `crewx init` in your terminal first.",HOOK_INSTALL_FAILED:"The config file is ready, but automatic integration failed. Some convenience features may be limited.",INIT_FAILED:"Something went wrong while preparing the project. Please try again shortly.",PATH_BLOCKED:"That system path is blocked for safety. Choose another directory.",PATH_NOT_FOUND:"The path does not exist.",WORKSPACE_ALREADY_REGISTERED:"This workspace is already registered.",SLUG_CONFLICT:"That slug is already in use.",UNKNOWN:"Failed to create the workspace."}}},mzn={title:"Select folder",description:"Browse directories and choose the workspace path to register.",loading:"Loading directories...",empty:{default:"No directories found.",workspaces:"Create a workspace in this folder."},newFolder:{label:"New folder",placeholder:"Folder name",create:"Create"},selected:"Selected folder",noneSelected:"No folder selected",select:"Select",cancel:"Cancel",alreadyRegistered:"Registered",disabledTooltip:"This workspace is already registered.",badge:{crewxYaml:"crewx.yaml"},quickAccess:{title:"Quick access",home:"Home",workspaces:"Workspaces"},error:{PATH_NOT_ABSOLUTE:"Please enter or choose an absolute path.",PATH_BLOCKED:"That system path is blocked for safety.",PATH_NOT_FOUND:"The path could not be found.",UNKNOWN:"Failed to load directories."},mkdir:{error:{PATH_BLOCKED:"You cannot create a folder in this location.",NAME_INVALID:"The folder name is invalid.",PERMISSION_DENIED:"You do not have permission to create a folder here.",PARENT_NOT_FOUND:"The parent folder does not exist.",NOT_A_DIRECTORY:"A file with the same name already exists.",READ_ONLY_FS:"This filesystem is read-only.",NAME_TOO_LONG:"The folder name is too long.",MKDIR_FAILED:"Failed to create the folder.",UNKNOWN:"Could not create the folder because of an unknown error."}}},bzn={banner:{workspace:{title:"{{current}}/{{limit}} workspaces used · beta free plan",description:"If you need more workspaces, you will be able to upgrade to Pro when we launch."},agent:{title:"{{current}}/{{limit}} agents used · beta free plan",description:"The number of agents per workspace expands on Pro."},token:{title:"{{current}}/{{limit}} API tokens used · beta free plan",description:"The API token issuance limit expands on Pro."},grandfatherPromise:"Your currently registered workspaces and agents will continue to work after launch."}},wzn={notice:{title:"CrewX beta",description:"CrewX will move to free and Pro plans at launch. Everything you register now will stay available."}},yzn={waitlistCta:"Join Pro early access"},xzn={title:"Threads",refresh:"Refresh",filterAll:"All",filterPlatform:"Platform",filterAgent:"Agent",sortNewest:"Newest",sortOldest:"Oldest",msgCount:"{{count}} msgs",empty:"No threads yet",emptyHint:"Threads will appear here when agents run CLI commands",emptyPrompt:"(empty)",loadMore:"Load More",retry:"Retry",newThread:"New Thread",threadIdPlaceholder:"Thread ID",searchPlaceholder:"Search threads...",open:"Open",searching:"Searching...",searchResults:'{{count}} results for "{{query}}"',totalCount:"{{count}} threads",noResults:"No results found",noThreads:"No threads yet",emptyAction:"Start New Thread",editPlaceholder:"Enter a thread title",editAriaLabel:"Edit thread title",editButtonLabel:"Rename thread title",editEmptyError:"A title is required",editSaveFailed:"Failed to save the thread title: {{message}}",filterStarred:"Starred",pinnedSection:"Pinned",pinAction:"Pin thread",unpinAction:"Unpin thread",starAction:"Star thread",unstarAction:"Unstar thread",pinSaveFailed:"Failed to save the pin state: {{message}}",starSaveFailed:"Failed to save the star state: {{message}}",platforms:{cli:"CLI",web:"Web",api:"API",slack:"Slack"}},vzn={title:"Projects",newProject:"+ New Project",totalCount:"{{count}} total",emptyTitle:"No projects yet",emptyDesc:"Create a project to organize your agent team",loadError:"Failed to load projects",retry:"Retry",threadCount:"{{count}} threads",docCount:"{{count}} docs",justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago",weeksAgo:"{{count}}w ago",edit:"Edit",delete:"Delete",menuAriaLabel:"Project menu",deleteConfirm:'Delete project "{{name}}"?'},kzn={title:"Tasks",loading:"Loading tasks...",retry:"Retry",empty:"No tasks found",emptyHint:"Agent execution history will appear here.",totalCount:"{{count}} total",columns:{taskId:"Task ID",agent:"Agent",status:"Status",duration:"Duration",model:"Model",time:"Time",tokens:"Tokens",cost:"Cost"},filters:{searchPlaceholder:"Search tasks...",agent:"Agent",status:"Status",allAgents:"All agents",allStatuses:"All statuses"},pagination:{previous:"Previous",next:"Next"},relative:{justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago",weeksAgo:"{{count}}w ago"},status:{pending:"Pending",running:"Running",success:"Success",failed:"Failed"},panel:{title:"Task details",request:"Prompt",renderedPrompt:"Rendered Prompt",result:"Result",childTasks:"Child Tasks",pendingTitle:"Pending",pendingDescription:"This task has not started yet.",copy:"Copy",copyRequestSuccess:"Prompt copied",copyRenderedPromptSuccess:"Rendered prompt copied",copyResultSuccess:"Result copied",copyFailed:"Failed to copy text",showMore:"Show more",showLess:"Show less",viewThread:"View thread →",noThread:"No linked thread",retryDetail:"Retry",detailLoadError:"Failed to load task details",stop:"Stop",stopConfirm:"Stop for real?",stopping:"Stopping...",stopFailed:"Failed to stop task",close:"Close panel",parentLabel:"Parent:",toolUsage:"Tool Usage",toolUsageTooltip:"{{tool}}: {{count}} calls ({{pct}}%)",tool:"Tool",calls:"Calls",ratio:"Share"}},Czn={heading:"Put your team to work",subheading:"Click an agent to start a conversation",addAgent:"Add",inputPlaceholder:"@agent / Enter a task...",inputHint:"Enter to send · Shift+Enter for new line",recommended:{codeReview:"Review my code",sprintSummary:"Summarize this sprint",roadmapReview:"Review product roadmap"}},Szn={heading:"Talk to your AI team",subheading:"Select an agent or type freely",addAgent:"+ Add",inputPlaceholder:"Start with @agent or /wf...",send:"Send",recommendedTitle:"Suggested",agentsError:"Failed to load agents"},Ezn={newTitle:"New Project",newSubtitle:"Create a project and set up your agent team",editTitle:"Edit Project",editSubtitle:"Update project basic information",cancel:"Cancel",create:"Create Project",save:"Save",loading:"Loading project...",createError:"Failed to create project.",updateError:"Failed to update project.",loadError:"Failed to load project.",nameRequired:"Please enter a project name",sectionBasic:"Basic Info",fieldName:"Project Name",fieldNamePlaceholder:"e.g. crewx-ui dev, marketing campaign planning",fieldDescription:"Description (optional)",fieldDescriptionPlaceholder:"Briefly describe what this project aims to solve",sectionTeam:"Team Setup",sectionTeamDesc:"Select agents to participate in this project. You can add more later.",fieldAgent:"Assigned Agent",fieldAgentPlaceholder:"Select agent...",agentsError:"Failed to load agent list",noAgentsAvailable:"No agents available",allAgentsSelected:"All agents selected"},_zn={pending:"Pending",running:"Running",runningWithCount:"Running {{count}}",success:"Done",failed:"Failed"},Tzn={placeholder:"Type a command...",close:"Close"},Azn={title:"Unified Search",placeholder:"Search in memory and docs...",searchBtn:"Search",tabAll:"All",tabMemory:"Memory",tabDocs:"Docs",noResults:"No results found",hint:"Type a query and press Enter or click Search",tabDocsComingSoon:"Docs (Coming Soon)"},Mzn={sidebarTitle:"My Tier — Go to Usage",promotionTitle:"Tier Up!",promotionSubtitle:"Congratulations! You've reached a new tier",shareOnX:"Share on X",shareText:"I just reached {{tier}} tier on CrewX! 🏆 #CrewX #AI"},Nzn={title:"Usage",loading:"Loading usage data...",tabProvider:"By Provider",tabAgent:"By Agent",totalCost:"Total Cost",thisMonth:"This Month",totalTokens:"Total tokens",tokens:"Tokens",cost:"Cost",byModel:"By Model",daily:"Daily",monthly:"Monthly",workspaceBreakdown:"Workspace Breakdown",workspaceBreakdownDesc:"Usage aggregated across all workspaces",loadingWorkspaces:"Loading workspace usage...",noWorkspaces:"No workspace usage recorded yet.",unknownWorkspace:"Unknown workspace",input:"Input",output:"Output",cache:"Cache",tasks:"Tasks",dailyDetails:"Daily Details",noData:"No data available.",date:"Date",tierLabel:"Current Tier",toNext:"{{tokens}} to {{tier}}",maxTier:"Max tier reached!",pace:"Month-end pace",shareX:"Share on X",noAgentData:"No agent usage data available.",agentTrend:"Agent Usage Trend",ofTotal:"of total",allWorkspaces:"All workspaces",workspaceFilterAria:"Workspace filter",heroTitle:"This month token usage",heroDescription:"See your monthly usage at a glance.",heroCost:"tokens ≈ {{cost}}",previousMonthStat:"Last month {{value}}",currentMonthStat:"This month {{value}}",tierProgressLabel:"→ {{tier}} ({{tokens}})",tierTooltipTitle:"Tier benchmark",tierTooltipInfoLabel:"View all tier benchmarks",paceWithRemaining:"Pace ~{{pace}} · {{tier}} in {{remaining}}",paceOnly:"Pace ~{{pace}}",donutTitle:"Usage share by agent",donutDescription:"Top agents by token volume this month.",topAgentsTitle:"Top 10 agents",agentCountLabel:"{{count}} agents",trendTitle:"30-day trend",trendDescription:"Daily stacked token usage by top agents.",emptyTitle:"No agents registered yet",emptyDescription:"Register agents to see usage here.",emptyCta:"Register an agent",showMore:"Show more",showLess:"Show less",rank:"Rank",agent:"Agent",share:"Share",trend:"Trend",others:"Others"},jzn={guard:{redirecting:"Redirecting to onboarding..."},common:{stepOf:"Step {{current}} / {{total}}",next:"Next →",prev:"← Back",skip:"Skip",skipS1:"I'll install later",skipS2:"I'll set up later",start:"Get Started →",retry:"Retry",loading:"Loading..."},popup:{title:"Welcome!",description:"Would you like help setting up your AI tools? It only takes 5 minutes.",yes:"Start onboarding",no:"Not now"},s1:{title:"Choose your AI tools",subtitle:"Select the tools you want to use — we'll help you install them.",statusInstalled:"v{{version}} installed",statusNotInstalled:"Not installed",willInstall:"Will install",authLoggedIn:"✓ Logged in",authRequired:"⚠ Login required",authUnknown:"Manual check needed",loadingCards:"Checking tools...",errorTitle:"Failed to check tools",errorDesc:"Would you like to try again?",noToolsSelected:"Please select at least one tool",descClaude:"AI coding assistant by Anthropic",descCodex:"Terminal coding agent by OpenAI",descGemini:"AI development assistant by Google",descCopilot:"AI pair programmer by GitHub",descOpencode:"Open-source AI coding assistant"},s2:{title:"Setting up your AI tools",subtitle:"Installing and logging in to your selected tools",installStarting:"Starting installation...",installOk:"installed",loginWaiting:"Waiting for {{name}} login... Please authenticate in your browser.",loginOk:"logged in",loginSkipped:"Login skipped",setupLog:"Setup log",waitingForSetup:"Preparing setup...",statusInstalling:"⏳ Installing...",statusInstalled:"Installed",statusLoggingIn:"Logging in...",statusComplete:"Done",statusFailed:"Install failed"},bubble:{welcome:"Hello! Please wait a moment",tip1:"CrewX manages multiple AIs as a single team.",tip2:"Assigning roles to agents improves efficiency.",tip3:"You can start right away once login is complete!"}},Dzn={title:"Workflows",totalCount:"{{count}} workflows",searchPlaceholder:"Search by ID, name, or description...",clearSearch:"Clear search",bannerTitle:"This is an automation recipe where multiple AI teammates work in sequence.",bannerBody:"Type /wf in the chat box to use it right away.",startChat:"Start chat",runWorkflow:"Run",startChatTooltip:"/wf {{id}}",refresh:"Refresh",retry:"Retry",pageError:"Something went wrong while rendering the workflow screen.",errorsTitle:"{{count}} workflows could not be loaded",errorItem:"{{file}}: {{reason}}",emptyTitle:"No workflows yet",emptyDescription:"Workflows define how AI agents collaborate in sequence.",emptyAction:"Ask your team developer to configure a workflow.",emptyFilteredTitle:"No matching workflows",emptyFilteredDescription:"Try a different ID, name, description, or agent name.",metadataAgents:"Agents",metadataNodes:"Nodes",metadataTimeout:"Timeout",metadataMaxIterations:"Max iterations",timeoutMinutes:"{{count}} min",iterationCount:"{{count}} times",noLimit:"None",diagramLoading:"Rendering diagram...",diagramError:"Failed to render the diagram.",sourcePath:"Source path: {{path}}",stateVariablesTitle:"State Variables",mentionLabel:"Workflow suggestions",noSuggestions:"No suggestions available.",selectedLabel:"/wf {{id}}",graph:{readonly:"Read-only",generated:"Generated from YAML",descriptionFallback:"This workflow is generated from its YAML definition and can be inspected here without editing nodes.",detailsTitle:"Node details",legendTitle:"Legend",sourceTitle:"Source",sourceFile:"Source file",contract:"Contract",readonlyContract:"This view is for inspection only. Edit workflows in YAML and start runs from chat.",nodeId:"Node ID",nodeType:"Type",agent:"Agent",description:"Description",input:"Input",condition:"Condition",if:"If",noNodeSelected:"Select a node to inspect its definition.",noStateVariables:"State variables are defined while the workflow runs.",layouting:"Arranging workflow map...",mermaidFallback:"Mermaid fallback",closePanel:"Close"}},Izn={autoDefault:"Default: auto",noCurrentNode:"Waiting to start",approvalHint:"Auto execution paused at an approval point. Approve it to continue to the next node.",approval:{title:"Approval request",fallbackQuestion:"Run the next step of this workflow?",approvePath:"Approve:",rejectPath:"Reject:"},lastAudit:"Last run: {{node}} · {{duration}}ms",approve:"Approve",reject:"Reject",refresh:"Refresh",started:"Started {{id}} workflow.",startFailed:"Workflow start failed: {{message}}",refreshFailed:"Workflow refresh failed: {{message}}",approveFailed:"Workflow approval failed: {{message}}",rejectFailed:"Workflow rejection failed: {{message}}",cancelFailed:"Workflow stop failed: {{message}}",stop:"Stop",cancelledHint:"The workflow run was stopped by the user.",loadingCard:"Loading workflow run status...",unverifiedCard:"This workflow card is not verified.",expiredCard:{title:"Workflow card expired",description:"This card expired after 7 days. Run /wf {{id}} again to start a fresh workflow."},state:{title:"State",keyCount:"{{count}} keys",empty:"No state has been saved yet."},timeline:{title:"Execution timeline",summary:"{{completed}} steps completed",count:"{{visible}} reached",collapsed:"Timeline collapsed · {{completed}} steps completed",status:{pending:"Pending",current:"Running",waiting_approval:"Waiting approval",paused:"Paused",completed:"Completed",failed:"Failed",cancelled:"Stopped"}},nodeType:{agent_task:"Agent task",skill_task:"Skill task",shell_task:"Shell task",branch:"Branch",parallel:"Parallel",join:"Join",expression:"Expression",approval:"Approval",end:"End",error:"Error"},phase:{not_started:"Starting",running:"Running",waiting_approval:"Waiting approval",paused:"Paused",completed:"Completed",failed:"Failed",cancelled:"Stopped"}},Ozn={title:"CLI Version Manager",subtitle:"Check, install, and update AI CLI tools",actions:{refresh:"Refresh",install:"Install",update:"Update",openDocs:"Open {{name}} documentation",openSignup:"Open {{name}} service page"},status:{checking:"Checking...",installing:"Installing...",updating:"Updating...",installed:"Installed",notInstalled:"Not installed",pending:"Pending",error:"Error"},version:{selectLabel:"Select version for {{name}}",latestOption:"latest",latestVersion:"latest: v{{version}}"},terminal:{waiting:"Waiting for CLI checks...",processing:"Processing..."},messages:{allUpToDate:"All CLIs are up to date",someFailed:"Some installations failed",crewxUnavailable:"CrewX CLI is required before opening this page.",crewxUpdateHint:"Update in the terminal with npm i -g crewx@latest"},logs:{checkingVersions:"Checking CLI versions...",checkComplete:"Check complete. Review each CLI and continue.",checkFailed:"Failed to check CLI versions: {{message}}",crewxDetected:"CrewX CLI v{{version}} detected.",crewxUpdateAvailable:"CrewX CLI v{{current}} → v{{latest}} (update available)",cliUpToDate:"{{name}} v{{version}} is up to date.",cliUpdateAvailable:"{{name}} v{{current}} → v{{latest}} (update available)",cliNotInstalled:"{{name}} is not installed.",installing:"Installing {{name}} ({{version}})...",updating:"Updating {{name}} ({{version}})...",installSuccess:"{{name}} installed successfully (v{{version}}).",updateSuccess:"{{name}} updated successfully (v{{version}}).",actionFailed:"Failed to {{action}} {{name}}: {{message}}",crewxNotInstalled:"CrewX CLI is not installed globally."}},Lzn={settings:KBn,threadDetail:JBn,markdownEditor:YBn,taskDetail:XBn,chatInput:QBn,cliData:ZBn,agent:ezn,wbs:tzn,docs:nzn,nav:rzn,planner:izn,cron:szn,goal:ozn,market:azn,memory:lzn,knowledge:czn,graph:uzn,projectDetail:dzn,mermaidFullscreen:fzn,common:hzn,auth:pzn,workspace:gzn,dirPicker:mzn,limits:bzn,beta:wzn,upgrade:yzn,threads:xzn,projects:vzn,tasks:kzn,newTask:Czn,threadNew:Szn,project:Ezn,status:_zn,overlay:Tzn,search:Azn,tier:Mzn,usage:Nzn,onboarding:jzn,workflow:Dzn,workflowRun:Izn,cliManager:Ozn};var Pzn={};const R7t=t=>{let n;const i=new Set,o=(x,v)=>{const C=typeof x=="function"?x(n):x;if(!Object.is(C,n)){const E=n;n=v??(typeof C!="object"||C===null)?C:Object.assign({},n,C),i.forEach(A=>A(n,E))}},a=()=>n,g={setState:o,getState:a,getInitialState:()=>w,subscribe:x=>(i.add(x),()=>i.delete(x)),destroy:()=>{(Pzn?"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."),i.clear()}},w=n=t(o,a,g);return g},OKt=t=>t?R7t(t):R7t;var LKt={exports:{}},PKt={},RKt={exports:{}},$Kt={};/**
|
|
48
|
+
*/var N7=F;function IFn(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var OFn=typeof Object.is=="function"?Object.is:IFn,LFn=N7.useState,PFn=N7.useEffect,RFn=N7.useLayoutEffect,$Fn=N7.useDebugValue;function FFn(t,n){var i=n(),o=LFn({inst:{value:i,getSnapshot:n}}),a=o[0].inst,c=o[1];return RFn(function(){a.value=i,a.getSnapshot=n,mIe(a)&&c({inst:a})},[t,i,n]),PFn(function(){return mIe(a)&&c({inst:a}),t(function(){mIe(a)&&c({inst:a})})},[t]),$Fn(i),i}function mIe(t){var n=t.getSnapshot;t=t.value;try{var i=n();return!OFn(t,i)}catch{return!0}}function BFn(t,n){return n()}var zFn=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?BFn:FFn;NKt.useSyncExternalStore=N7.useSyncExternalStore!==void 0?N7.useSyncExternalStore:zFn;MKt.exports=NKt;var Bge=MKt.exports;const HFn=(t,n)=>a9(n)?n:vFn(n)&&a9(n.defaultValue)?n.defaultValue:Array.isArray(t)?t[t.length-1]:t,UFn={t:HFn,ready:!1},WFn=()=>()=>{},Zn=(t,n={})=>{var te,Q,se;const{i18n:i}=n,{i18n:o,defaultNS:a}=F.useContext(jFn)||{},c=i||o||MFn();c&&!c.reportNamespaces&&(c.reportNamespaces=new DFn),c||_Kt(c,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const u=F.useMemo(()=>{var ce;return{...TFn(),...(ce=c==null?void 0:c.options)==null?void 0:ce.react,...n}},[c,n]),{useSuspense:f,keyPrefix:g}=u,w=a||((te=c==null?void 0:c.options)==null?void 0:te.defaultNS),x=a9(w)?[w]:w||["translation"],v=F.useMemo(()=>x,x);(se=(Q=c==null?void 0:c.reportNamespaces)==null?void 0:Q.addUsedNamespaces)==null||se.call(Q,v);const C=F.useRef(0),E=F.useCallback(ce=>{if(!c)return WFn;const{bindI18n:V,bindI18nStore:ae}=u,de=()=>{C.current+=1,ce()};return V&&c.on(V,de),ae&&c.store.on(ae,de),()=>{V&&V.split(" ").forEach(ee=>c.off(ee,de)),ae&&ae.split(" ").forEach(ee=>c.store.off(ee,de))}},[c,u]),A=F.useRef(),M=F.useCallback(()=>{if(!c)return UFn;const ce=!!(c.isInitialized||c.initializedStoreOnce)&&v.every(he=>xFn(he,c,u)),V=n.lng||c.language,ae=C.current,de=A.current;if(de&&de.ready===ce&&de.lng===V&&de.keyPrefix===g&&de.revision===ae)return de;const ue={t:c.getFixedT(V,u.nsMode==="fallback"?v:v[0],g),ready:ce,lng:V,keyPrefix:g,revision:ae};return A.current=ue,ue},[c,v,g,u,n.lng]),[I,D]=F.useState(0),{t:P,ready:R}=Bge.useSyncExternalStore(E,M,M);F.useEffect(()=>{if(c&&!R&&!f){const ce=()=>D(V=>V+1);n.lng?D7t(c,n.lng,v,ce):FPe(c,v,ce)}},[c,n.lng,v,R,f,I]);const z=c||{},U=F.useRef(null),W=F.useRef(),G=ce=>{const V=Object.getOwnPropertyDescriptors(ce);V.__original&&delete V.__original;const ae=Object.create(Object.getPrototypeOf(ce),V);if(!Object.prototype.hasOwnProperty.call(ae,"__original"))try{Object.defineProperty(ae,"__original",{value:ce,writable:!1,enumerable:!1,configurable:!1})}catch{}return ae},Y=F.useMemo(()=>{const ce=z,V=ce==null?void 0:ce.language;let ae=ce;ce&&(U.current&&U.current.__original===ce?W.current!==V?(ae=G(ce),U.current=ae,W.current=V):ae=U.current:(ae=G(ce),U.current=ae,W.current=V));const de=[P,ae,R];return de.t=P,de.i18n=ae,de.ready=R,de},[P,z,R,z.resolvedLanguage,z.language,z.languages]);if(c&&f&&!R)throw new Promise(ce=>{const V=()=>ce();n.lng?D7t(c,n.lng,v,V):FPe(c,v,V)});return Y},{slice:qFn,forEach:GFn}=[];function VFn(t){return GFn.call(qFn.call(arguments,1),n=>{if(n)for(const i in n)t[i]===void 0&&(t[i]=n[i])}),t}function KFn(t){return typeof t!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(i=>i.test(t))}const I7t=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,JFn=function(t,n){const o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},a=encodeURIComponent(n);let c=`${t}=${a}`;if(o.maxAge>0){const u=o.maxAge-0;if(Number.isNaN(u))throw new Error("maxAge should be a Number");c+=`; Max-Age=${Math.floor(u)}`}if(o.domain){if(!I7t.test(o.domain))throw new TypeError("option domain is invalid");c+=`; Domain=${o.domain}`}if(o.path){if(!I7t.test(o.path))throw new TypeError("option path is invalid");c+=`; Path=${o.path}`}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");c+=`; Expires=${o.expires.toUTCString()}`}if(o.httpOnly&&(c+="; HttpOnly"),o.secure&&(c+="; Secure"),o.sameSite)switch(typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite){case!0:c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"strict":c+="; SameSite=Strict";break;case"none":c+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o.partitioned&&(c+="; Partitioned"),c},O7t={create(t,n,i,o){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};i&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+i*60*1e3)),o&&(a.domain=o),document.cookie=JFn(t,n,a)},read(t){const n=`${t}=`,i=document.cookie.split(";");for(let o=0;o<i.length;o++){let a=i[o];for(;a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(n)===0)return a.substring(n.length,a.length)}return null},remove(t,n){this.create(t,"",-1,n)}};var YFn={name:"cookie",lookup(t){let{lookupCookie:n}=t;if(n&&typeof document<"u")return O7t.read(n)||void 0},cacheUserLanguage(t,n){let{lookupCookie:i,cookieMinutes:o,cookieDomain:a,cookieOptions:c}=n;i&&typeof document<"u"&&O7t.create(i,t,o,a,c)}},XFn={name:"querystring",lookup(t){var o;let{lookupQuerystring:n}=t,i;if(typeof window<"u"){let{search:a}=window.location;!window.location.search&&((o=window.location.hash)==null?void 0:o.indexOf("?"))>-1&&(a=window.location.hash.substring(window.location.hash.indexOf("?")));const u=a.substring(1).split("&");for(let f=0;f<u.length;f++){const g=u[f].indexOf("=");g>0&&u[f].substring(0,g)===n&&(i=u[f].substring(g+1))}}return i}},QFn={name:"hash",lookup(t){var a;let{lookupHash:n,lookupFromHashIndex:i}=t,o;if(typeof window<"u"){const{hash:c}=window.location;if(c&&c.length>2){const u=c.substring(1);if(n){const f=u.split("&");for(let g=0;g<f.length;g++){const w=f[g].indexOf("=");w>0&&f[g].substring(0,w)===n&&(o=f[g].substring(w+1))}}if(o)return o;if(!o&&i>-1){const f=c.match(/\/([a-zA-Z-]*)/g);return Array.isArray(f)?(a=f[typeof i=="number"?i:0])==null?void 0:a.replace("/",""):void 0}}}return o}};let dP=null;const L7t=()=>{if(dP!==null)return dP;try{if(dP=typeof window<"u"&&window.localStorage!==null,!dP)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{dP=!1}return dP};var ZFn={name:"localStorage",lookup(t){let{lookupLocalStorage:n}=t;if(n&&L7t())return window.localStorage.getItem(n)||void 0},cacheUserLanguage(t,n){let{lookupLocalStorage:i}=n;i&&L7t()&&window.localStorage.setItem(i,t)}};let fP=null;const P7t=()=>{if(fP!==null)return fP;try{if(fP=typeof window<"u"&&window.sessionStorage!==null,!fP)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{fP=!1}return fP};var eBn={name:"sessionStorage",lookup(t){let{lookupSessionStorage:n}=t;if(n&&P7t())return window.sessionStorage.getItem(n)||void 0},cacheUserLanguage(t,n){let{lookupSessionStorage:i}=n;i&&P7t()&&window.sessionStorage.setItem(i,t)}},tBn={name:"navigator",lookup(t){const n=[];if(typeof navigator<"u"){const{languages:i,userLanguage:o,language:a}=navigator;if(i)for(let c=0;c<i.length;c++)n.push(i[c]);o&&n.push(o),a&&n.push(a)}return n.length>0?n:void 0}},nBn={name:"htmlTag",lookup(t){let{htmlTag:n}=t,i;const o=n||(typeof document<"u"?document.documentElement:null);return o&&typeof o.getAttribute=="function"&&(i=o.getAttribute("lang")),i}},rBn={name:"path",lookup(t){var a;let{lookupFromPathIndex:n}=t;if(typeof window>"u")return;const i=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(i)?(a=i[typeof n=="number"?n:0])==null?void 0:a.replace("/",""):void 0}},iBn={name:"subdomain",lookup(t){var a,c;let{lookupFromSubdomainIndex:n}=t;const i=typeof n=="number"?n+1:1,o=typeof window<"u"&&((c=(a=window.location)==null?void 0:a.hostname)==null?void 0:c.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(o)return o[i]}};let jKt=!1;try{document.cookie,jKt=!0}catch{}const DKt=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];jKt||DKt.splice(1,1);const sBn=()=>({order:DKt,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class IKt{constructor(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(n,i)}init(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=VFn(i,this.options||{},sBn()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=a=>a.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(YFn),this.addDetector(XFn),this.addDetector(ZFn),this.addDetector(eBn),this.addDetector(tBn),this.addDetector(nBn),this.addDetector(rBn),this.addDetector(iBn),this.addDetector(QFn)}addDetector(n){return this.detectors[n.name]=n,this}detect(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,i=[];return n.forEach(o=>{if(this.detectors[o]){let a=this.detectors[o].lookup(this.options);a&&typeof a=="string"&&(a=[a]),a&&(i=i.concat(a))}}),i=i.filter(o=>o!=null&&!KFn(o)).map(o=>this.options.convertDetectedLanguage(o)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}cacheUserLanguage(n){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;i&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||i.forEach(o=>{this.detectors[o]&&this.detectors[o].cacheUserLanguage(n,this.options)}))}}IKt.type="languageDetector";const oBn={language:"언어",languageDesc:"UI 표시 언어를 변경합니다",theme:"테마",themeDesc:"화면 테마를 변경합니다",themeLight:"라이트",themeDark:"다크",themeSystemHint:"기본값은 시스템 설정을 따르며, 현재 {{theme}} 테마가 적용되고 있습니다.",tools:"도구",toolsDesc:"AI CLI 도구를 관리합니다",cliManager:"CLI 버전 관리",cliManagerDesc:"AI CLI 버전을 관리합니다 (업데이트/설치)",openCli:"열기",versionInfo:"버전 정보",versionInfoDesc:"현재 연결된 CrewX 서버 버전을 표시합니다",crewxVersion:"CrewX 버전",themeChanged:"테마가 변경되었습니다",languageChanged:"언어가 변경되었습니다",changeFailed:"설정 변경에 실패했습니다",onboarding:"온보딩 / AI 도구 설치",onboardingDesc:"AI 도구 설치 및 로그인 가이드를 다시 실행합니다",openOnboarding:"열기",analytics:"익명 사용 통계 수집",analyticsDesc:"제품 개선을 위해 익명 사용 통계를 수집합니다. 개인 정보는 포함되지 않습니다.",analyticsChanged:"사용 통계 설정이 변경되었습니다",apiTokens:{title:"API 액세스 토큰",description:"REST API 및 Chrome X 등 외부 클라이언트의 접근 권한을 토큰으로 관리합니다 (JWT 기반)",issue:"새 토큰 발급",empty:"발급된 API 토큰이 없습니다.",name:"이름",expiresAt:"만료일",agentScope:"에이전트 범위",status:"상태",actions:"동작",unrestricted:"제한 없음",sourceDirect:"직접 발급",sourceNegotiate:"Chrome X 승인",statusValue:{valid:"유효",expiringSoon:"곧 만료",expired:"만료됨",revoked:"폐기됨"},revoke:"폐기",revoking:"폐기 중...",revokedAction:"폐기됨",refresh:"새로고침",loading:"토큰 목록을 불러오는 중...",loadFailed:"토큰 목록을 불러오지 못했습니다.",revokeFailed:"토큰을 폐기하지 못했습니다.",revokeConfirm:'"{{name}}" 토큰을 폐기하시겠습니까?',issueModal:{title:"새 API 액세스 토큰 발급",successTitle:"토큰이 발급되었습니다",successDescription:"아래 토큰을 지금 바로 복사해 두세요",nameLabel:"이름",nameHint:"토큰을 식별할 이름입니다. 나중에 변경할 수 없습니다.",namePlaceholder:"예: dev-local-2026",expiresLabel:"만료 기간",agentScopeLabel:"에이전트 제한",agentScopeOptional:"선택",agentScopeHint:"특정 에이전트만 이 토큰으로 접근하도록 제한합니다.",agentScopePlaceholder:"예: @ui_frontend_dev",notice:"토큰은 발급 직후 한 번만 표시됩니다. 반드시 안전한 곳에 저장하세요.",tokenLabel:"액세스 토큰",danger:"이 창을 닫으면 토큰을 다시 볼 수 없습니다. 지금 복사해 두세요.",metaName:"이름",metaExpiresAt:"만료일",metaAgentScope:"에이전트 범위",expiresOption:{"30d":"30일","90d":"90일","1y":"1년"},cancel:"취소",submit:"발급",submitting:"발급 중...",confirm:"확인",copy:"복사",copied:"복사됨 ✓",error:{TOKEN_LIMIT_EXCEEDED:"FREE 플랜 API 토큰 한도({{limit}}개)에 도달했습니다.",UNKNOWN:"토큰 발급에 실패했습니다."}}}},aBn={back:"뒤로",noMessages:"메시지가 없습니다",noMessagesHint:"아래 입력창에서 에이전트에게 메시지를 보내세요",boxLabel:"📦 {{count}}개 태스크 · {{tokens}}K 토큰 (요약됨)",scrollToLatest:"최신 메시지로 이동",taskPanel:{retryStarted:"태스크 재시도를 시작했습니다",retryFailed:"태스크 재시도에 실패했습니다: {{message}}"}},lBn={placeholder:"마크다운을 입력하세요",toolbar:{h1:"제목 1",h2:"제목 2",h3:"제목 3",bold:"굵게",italic:"기울임",strike:"취소선",bulletList:"글머리 기호",orderedList:"번호 매기기",blockquote:"인용문",code:"코드",codeBlock:"코드 블록",horizontalRule:"구분선",undo:"실행 취소",redo:"다시 실행"}},cBn={noMessages:"메시지가 없습니다",noMessagesHint:"아래 입력창에서 에이전트에게 메시지를 보내세요",inputPlaceholder:"@agent 또는 /wf 명령을 입력하세요...",inputPlaceholderActive:"@{{agent}}에게 메시지...",activityLog:"활동 로그",noActivityLog:"활동 로그가 없습니다",subAgentReply:"Sub-Agent Reply",back:"뒤로",send:"전송",inputModeLabel:"모드",inputModeQuery:"Query",inputModeExecute:"Execute",captureScreen:"화면 캡처",captureAlt:"캡처된 화면",agentJoined:"── 🤖 @{{agent}} 님이 참여했습니다 ──",tokenUsage:"{{input}}↑ {{output}}↓",costLabel:"${{cost}}",running:"실행 중",failed:"실패",retry:"재시도",thinking:"생각 중...",systemChip:{hint:"대화 힌트",retryFailedTask:"실패한 태스크 재시도",systemContext:"시스템 컨텍스트"},logDetail:{title:"활동 로그 상세",toolTitle:"{{tool}} 로그 상세",toolFallback:"도구",openFullView:"전체 보기 열기"}},uBn={attachFile:"파일 첨부",dropFile:"여기에 파일을 놓으세요",removeAttachment:"첨부 제거",fileTooLarge:'"{{name}}" 파일이 너무 커요 ({{size}}MB). 최대 {{max}}MB까지 첨부할 수 있어요.',sendTooLarge:"첨부 파일 용량이 너무 커서 전송하지 못했어요. 파일을 줄이거나 개수를 줄여보세요.",sendFailed:"메시지 전송에 실패했어요. 잠시 후 다시 시도해주세요."},dBn={crewxInstallNote:"AI 에이전트 팀 관리 도구"},fBn={management:"에이전트 관리",add:"에이전트 추가",edit:"에이전트 편집",delete:"삭제",deleteConfirmTitle:"에이전트 삭제",deleteConfirmMsg:"@{{id}}({{name}}) 에이전트를 삭제하시겠습니까?",deleteWarning:"이 작업은 되돌릴 수 없습니다.",cancel:"취소",save:"저장",back:"뒤로가기",backToList:"목록으로 돌아가기",notFound:"에이전트를 찾을 수 없습니다.",loadError:"에이전트 정보를 불러오지 못했습니다.",listError:"에이전트 목록을 불러오지 못했습니다.",loadFailTitle:"불러오기 실패",saveError:"저장에 실패했습니다.",createError:{AGENT_LIMIT_EXCEEDED:"베타 무료 플랜 에이전트 제한에 도달했습니다."},deleteError:"삭제에 실패했습니다.",retry:"재시도",providerState:{loading:"AI 엔진 정보 불러오는 중…",loadingSlow:"엔진 깨우는 중… 보통 10~20초 걸려요",error:"엔진 정보를 불러오지 못했어요. CLI 또는 AI 엔진 로그인이 필요할 수 있습니다.",retry:"다시 시도"},count:"({{count}}명)",team:{unassigned:"기타",memberCount:"{{count}}명",expand:"{{team}} 팀 펼치기",collapse:"{{team}} 팀 접기"},emptyTitle:"등록된 에이전트가 없습니다",emptyDesc:"+ 에이전트 추가 버튼으로 추가하세요",field:{id:"에이전트 ID",idHint:"고유 식별자 · 영문, 숫자, 언더스코어 사용 (예: ui_frontend_dev)",name:"이름",role:"역할",team:"팀",provider:"AI 엔진",model:"모델",searchModel:"모델 검색",description:"설명",descPlaceholder:"에이전트 역할과 기능 설명",selectProvider:"AI 엔진을 선택하세요",selectModel:"모델을 선택하세요",selectMode:"모드를 선택하세요",selectEffort:"Effort를 선택하세요",selectProviderFirst:"AI 엔진을 먼저 선택하세요",clearSelection:"선택 해제",noOptions:"선택 가능한 항목이 없습니다",noSearchResults:"검색 결과가 없습니다",custom:"커스텀",idPlaceholder:"ui_frontend_dev",namePlaceholder:"Frontend Developer",rolePlaceholder:"Frontend Developer",teamPlaceholder:"CrewX UI Team",recommended:"추천"},modeSettings:"모드 설정",queryMode:"질의 (Query)",executeMode:"실행 (Execute)",mode:"모드",effort:"Effort",validation:{required:"필수 입력 항목입니다"},engine:{claude:"Claude",codex:"Codex",gemini:"Gemini",copilot:"Copilot"},guide:{providerTitle:"AI 엔진 비교",modelTitle:"모델 비교 ({{provider}})",providerClaude:"코드 품질 최고, 대규모 코드베이스 이해력 우수",providerCodex:"IDE 통합 우수, 안전 제어 시스템, 웹 개발 이해력",providerGemini:"멀티모달 최강 (스크린샷/PDF 인라인), 무료 티어 넉넉",providerCopilot:"GitHub 연동이 자연스럽고 빠른 범용 작업에 적합"},model:{"claude-opus-4-6":{label:"Claude Opus 4.6",cost:"⚡ 소진 빠름",desc:"아키텍처 설계, 대규모 리팩토링, 복잡한 추론"},"claude-sonnet-4-6":{label:"Claude Sonnet 4.6",cost:"⚖️ 소진 보통",desc:"일반 코딩, 기능 구현 (추천)"},"claude-haiku-4-5":{label:"Claude Haiku 4.5",cost:"🟢 경제적",desc:"단순 질의, 빠른 검색, 대량 작업"},"claude-opus-4-5":{label:"Claude Opus 4.5",cost:"⚡ 소진 빠름",desc:"이전 세대 최상위, 복잡한 추론"},"claude-sonnet-4-5":{label:"Claude Sonnet 4.5",cost:"⚖️ 소진 보통",desc:"이전 세대 균형형, 일반 코딩"},"claude-sonnet-4":{label:"Claude Sonnet 4",cost:"⚖️ 소진 보통",desc:"레거시, 안정적 코딩"},"claude-opus-4-6-fast":{label:"Claude Opus 4.6 (fast mode)",cost:"🔥 소진 매우 빠름",desc:"최고 성능 + 빠른 응답, Preview"},"gpt-5.3-codex":{label:"GPT-5.3 Codex",cost:"⚡ 소진 빠름",desc:"최신, 가장 강력한 코딩"},"gpt-5.2-codex":{label:"GPT-5.2 Codex",cost:"⚖️ 소진 보통",desc:"안정적 코딩, 대규모 리팩토링"},"gpt-5.1-codex-mini":{label:"GPT-5.1 Codex Mini",cost:"🟢 경제적",desc:"경량 코딩, 비용 효율"},"o4-mini":{label:"o4-mini",cost:"🟢 경제적",desc:"레거시, 단순 작업"},"gemini-3-pro-preview":{label:"Gemini 3 Pro",cost:"⚖️ 소진 보통",desc:"고난도 추론, 설계 분석"},"gemini-3-flash-preview":{label:"Gemini 3 Flash",cost:"🟢 경제적",desc:"코딩 성능 우수, 빠른 응답 (추천)"},"gemini-2.5-pro":{label:"Gemini 2.5 Pro",cost:"⚖️ 소진 보통",desc:"안정적 프로덕션"},"gemini-2.5-flash":{label:"Gemini 2.5 Flash",cost:"💚 매우 경제적",desc:"대량 처리, 경량 작업"},"gpt-5.4":{label:"GPT-5.4",cost:"⚖️ 소진 보통",desc:"균형 잡힌 범용 작업, GitHub Copilot 기본 선택 (추천)"},"gpt-5.2":{label:"GPT-5.2",cost:"⚖️ 소진 보통",desc:"안정적 범용 코딩"},"gpt-5.1":{label:"GPT-5.1",cost:"⚖️ 소진 보통",desc:"범용 코딩"},"gpt-5.4-mini":{label:"GPT-5.4 Mini",cost:"🟢 경제적",desc:"경량 작업, 비용 효율"},"gpt-5-mini":{label:"GPT-5 Mini",cost:"💚 매우 경제적",desc:"단순 작업, 최저 비용"},"gpt-4.1":{label:"GPT-4.1",cost:"💚 매우 경제적",desc:"레거시, 단순 작업"}},duplicate:"복제",duplicateError:"복제할 에이전트 정보를 불러오지 못했습니다.",section:{basicTitle:"에이전트 정보",basicDescription:"에이전트의 기본 정보를 입력하세요.",skillsTitle:"사용할 스킬 선택",skillsDescription:"설치된 외부 스킬 중 이 에이전트가 사용할 항목을 체크하세요. 빌트인 스킬은 항상 활성화됩니다.",promptTitle:"시스템 프롬프트",promptDescription:"문서 블록과 변수 칩을 섞어 시스템 프롬프트를 시각적으로 편집하세요."},context:{title:"컨텍스트 공유",experimental:"실험적",description:"에이전트에게 사용자의 목표와 할 일을 공유하여 더 맥락에 맞는 응답을 받을 수 있습니다.",goalsLabel:"목표(Goal) 공유",goalsHint:"에이전트에게 OKR 목표를 공유",goalsAll:"전체 active Goal",goalsAllDesc:"활성 상태인 모든 Goal을 자동으로 공유합니다.",goalsSpecific:"특정 Goal 선택",goalsSpecificDesc:"공유할 Goal 파일을 직접 선택합니다.",goalsAdd:"추가",goalsPickerEmpty:"추가할 Goal이 없습니다.",dailyLabel:"데일리(Daily) 공유",dailyHint:"오늘의 할 일을 이 에이전트에게 공유"},skills:{emptyTitle:"설치된 외부 스킬이 없습니다",emptyDescription:"마켓에서 스킬을 설치하면 여기에 표시됩니다. 빌트인 스킬은 항상 활성화되어 별도 설정이 필요 없습니다.",openMarket:"마켓 열기",loadError:"설치된 스킬 목록을 불러오지 못했습니다."},tab:{basic:"기본 정보",skills:"스킬",prompt:"프롬프트"},prompt:{placeholder:"프롬프트를 입력하고 변수나 문서를 툴바에서 삽입하세요",editorLabel:"프롬프트 편집기",documentInsert:"문서 삽입",documentInsertLoading:"문서 목록을 불러오는 중입니다.",documentInsertEmpty:"삽입할 문서가 없습니다.",documentInsertError:"문서 목록을 불러오지 못했습니다.",documentInsertUnavailable:"문서 API가 아직 연결되지 않아 문서를 삽입할 수 없습니다.",variantContent:"본문",variantToc:"목차",documentChip:{delete:"삭제"},documentPicker:{searchPlaceholder:"문서 검색",inlineSection:"내장 문서",docsSection:"docs/",treeLoading:"문서 트리를 불러오는 중입니다.",treeError:"문서 트리를 불러오지 못했습니다.",noInlineResults:"일치하는 내장 문서가 없습니다.",noTreeResults:"일치하는 파일이 없습니다.",linked:"등록된 문서"},preview:{button:"미리보기",title:"미리보기",refresh:"새로고침",copy:"복사",loading:"렌더링 중...",unavailable:"미리보기 API가 아직 연결되지 않아 결과를 표시할 수 없습니다.",error:"렌더링 오류",empty:"프롬프트를 입력하면 렌더링 결과를 확인할 수 있습니다."},toolbar:{h1:"제목 1",h2:"제목 2",h3:"제목 3",bold:"굵게",italic:"기울임",strike:"취소선",code:"코드",bulletList:"글머리 기호",orderedList:"번호 매기기",blockquote:"인용문",codeBlock:"코드 블록",horizontalRule:"구분선",undo:"실행 취소",redo:"다시 실행",variable:"변수 삽입",insert:"삽입",search:"검색",empty:"표시할 항목이 없습니다."}},template:{title:"빠른 시작: 템플릿으로 만들기",subtitle:"자주 쓰는 에이전트 템플릿으로 빠르게 시작할 수 있습니다.",direct:"직접 설정",codingAssistant:"코딩 어시스턴트",codingAssistantDesc:"코드 구현과 리팩토링에 적합한 기본 템플릿",research:"리서치",researchDesc:"자료 조사와 비교 분석에 적합한 템플릿",dataAnalysis:"데이터 분석",dataAnalysisDesc:"분석과 리포트 작성 중심 템플릿",writing:"글쓰기",writingDesc:"문서 작성과 편집 중심 템플릿",designReview:"디자인 리뷰",designReviewDesc:"UI/UX 검토와 피드백 중심 템플릿"},skill:{memory:{label:"memory",description:"장기 기억 및 컨텍스트 관리"},search:{label:"search",description:"코드베이스 소스 검색 조회"},git:{label:"git",description:"CrewX 컨텍스트 내 깃 상태 조회"},cron:{label:"cron",description:"작업 스케줄 탭 설정"},wbs:{label:"wbs",description:"복잡한 작업을 단계별로 분해하여 관리"}},emptyAction:"+ 에이전트 추가"},hBn={title:"WBS",detail:"WBS 상세",totalCount:"{{count}}개 프로젝트",empty:"WBS 프로젝트가 없습니다",retry:"재시도",progress:"진행률",jobCount:"{{completed}}/{{total}} 작업",failedCount:"실패 {{count}}건",runningCount:"실행 중 {{count}}건",pendingCount:"대기 {{count}}건",backToList:"목록으로",jobs:"작업 목록",noJobs:"작업이 없습니다",agent:"담당 에이전트",createdAt:"생성일",completedAt:"완료일",expand:"펼치기",collapse:"접기",status:{planning:"계획",running:"실행 중",completed:"완료",partial:"부분 완료",on_hold:"보류"},jobStatus:{pending:"대기",running:"실행 중",completed:"완료",failed:"실패"},sort:{newest:"최신순",oldest:"오래된순",progress:"진행률순",name:"이름순"}},pBn={title:"문서 관리",fileTree:"파일 트리",searchPlaceholder:"파일 검색...",noFiles:"파일이 없습니다",noSearchResults:"검색 결과가 없습니다",selectFile:"왼쪽 파일 트리에서 파일을 선택하세요",copyPath:"경로 복사",pathCopied:"경로가 복사되었습니다",copyContent:"복사",contentCopied:"복사됨",imageUnavailable:"이미지를 불러올 수 없습니다",view:{fontLabel:"문서 글꼴",fontSystem:"기본",fontPretendard:"Pretendard",fontNotoSansKr:"Noto Sans KR",fontInter:"Inter",fontSerif:"명조",fontNotoSerifKr:"Noto Serif KR",fontMono:"고정폭",fontCoding:"코딩체",localFontsGroup:"로컬 폰트",localFontsLoading:"로컬 폰트 확인 중",localFontsUnsupported:"이 브라우저는 로컬 폰트 불러오기를 지원하지 않습니다",localFontsFailed:"로컬 폰트를 불러오지 못했습니다",localFontsEmpty:"불러온 로컬 폰트가 없습니다",zoomLabel:"확대율",zoomOut:"축소",zoomIn:"확대"},toggleTree:{show:"파일 트리 펼치기",hide:"파일 트리 접기"},edit:{button:"편집",save:"저장",cancel:"취소",dirtyMarker:"●",savedToast:"저장되었습니다",saveFailed:"저장 실패: {{message}}",discardConfirm:"변경사항을 버릴까요?",conflict:{title:"외부에서 파일이 수정되었습니다",message:"다른 창이나 외부 에디터에서 파일이 변경되었어요. 어떻게 할까요?",overwrite:"덮어쓰기",reload:"새로고침",dismiss:"취소"}},tab:{markdown:"마크다운 뷰",implStatus:"구현 상태"},impl:{totalScreens:"전체 화면 수",syncDone:"동기화 완료",mismatch:"불일치",id:"ID",name:"이름",doc:"설계서",pencil:"펜슬",code:"코드",empty:"구현 상태 데이터가 없습니다",legend:"범례: ✅ 존재 · ❌ 없음 (불일치 행은 빨간색으로 강조)"}},gBn={agents:"에이전트",planner:"데일리 플래너",cron:"스케줄",goals:"목표",wbs:"WBS",memory:"메모리",graph:"지식 그래프",docs:"문서 관리",market:"마켓",cliManager:"CLI 관리",settings:"설정",newTask:"새 대화",recentTasks:"최근 대화",noTasks:"대화가 없습니다",viewAll:"전체 보기 →",tools:"도구",search:"통합 검색",projects:"프로젝트",more:"더보기",freePlan:"무료 플랜",workflows:"워크플로",usage:"사용량",tasks:"태스크 이력",workspaces:"워크스페이스",openSidebar:"사이드바 열기",closeSidebar:"사이드바 닫기"},mBn={title:"데일리 플래너",subtitle:"오늘의 우선순위와 실행 흐름을 한눈에 정리합니다.",loadError:"플래너를 불러오지 못했습니다",saveError:"플래너 저장에 실패했습니다",retry:"다시 시도",loading:"플래너를 불러오는 중...",empty:"표시할 플래너 데이터가 없습니다",today:"오늘",previousDate:"이전 날짜",nextDate:"다음 날짜",status:{saved:"저장됨",saving:"저장 중...",unsaved:"미저장 변경사항"},mockNotice:"백엔드 API가 아직 준비되지 않아 임시 플래너 데이터를 표시하고 있습니다.",top3:{title:"가장 중요한 3가지",description:"덤프한 것 중에서 오늘 반드시 해야 할 3가지를 골라보세요.",empty:"오늘의 우선순위가 아직 없습니다",noAgents:"담당 에이전트 없음",placeholder:"가장 중요한 일...",inputLabel:"{{rank}}번째 우선순위"},braindump:{title:"브레인 덤프",description:"머릿속을 비우세요. 할 일, 걱정, 아이디어를 전부 쏟아내면 연관된 업무가 보입니다.",empty:"메모된 아이디어가 없습니다",placeholder:"머릿속에 있는 것들을 전부 쏟아내세요...",inputLabel:"브레인 덤프"},schedule:{title:"시간표",description:"시간대별로 할 일을 배치하고 체크하세요.",empty:"일정이 없습니다",toggleTask:"{{task}} 완료 상태 전환",placeholder:"할 일을 적어보세요...",inputLabel:"{{time}} 할 일",status:{done:"완료",pending:"예정",cancelled:"취소"}},notes:{title:"메모",description:"자유롭게 메모를 남겨두세요.",empty:"작성된 노트가 없습니다",placeholder:"메모를 적어보세요...",inputLabel:"메모"},goalChip:{title:"오늘의 목표 (Goal)",description:"지금 따라가고 있는 목표. 에이전트가 우선순위 힌트로 활용합니다.",addGoal:"목표 선택",removeChip:"이 데일리에서 제외"}},bBn={title:"스케줄",subtitle:"자동 실행 관리",apiUnavailable:"크론 API가 아직 준비되지 않았습니다. 백엔드가 연결되면 스케줄을 불러옵니다.",period:{am:"오전",pm:"오후"},days:{mon:"월",tue:"화",wed:"수",thu:"목",fri:"금",sat:"토",sun:"일"},repeat:{daily:"매일",weekdays:"평일마다",weekends:"주말마다",weekdaysOnly:"평일만",weekendsOnly:"주말만",custom:"커스텀",customLabel:"커스텀 반복",weekly:"매주 {{day}}요일"},actions:{new:"새 스케줄",add:"추가",save:"저장",delete:"삭제",cancel:"취소"},card:{untitled:"이름 없는 스케줄",toggle:"{{name}} 활성화 전환",cronBadge:"표현식"},daemon:{loading:"상태 확인 중...",running:"스케줄 동작 중",stopped:"스케줄 중지됨",pid:"PID {{pid}}",startBtn:"시작",stopBtn:"중지",starting:"시작 중...",stopping:"중지 중...",summary:"활성 {{enabled}} / 전체 {{total}}",startedAt:"시작 시각 {{date}}"},date:{todayAt:"오늘 {{time}}",tomorrowAt:"내일 {{time}}"},empty:{title:"등록된 스케줄이 없습니다",description:"새 스케줄을 추가해서 반복 실행을 시작하세요."},history:{title:"최근 실행",recentCount:"최근 5건",runCount:"{{count}}회 실행"},modal:{createTitle:"새 스케줄",editTitle:"스케줄 편집",subtitle:"시간과 반복만 정해서 간단히 자동 실행을 등록합니다.",unsupportedCron:"이 스케줄은 단순 시간 반복 형식이 아니라 현재 폼에서 일정 규칙을 수정할 수 없습니다.",hour:"시",minute:"분",repeatLabel:"반복",dayLabel:"요일 선택",nameLabel:"스케줄 이름",namePlaceholder:"예: Daily Report",agentLabel:"에이전트",agentPlaceholder:"에이전트를 선택하세요",modeLabel:"실행 모드",commandLabel:"실행 명령어",commandPlaceholder:"에이전트에게 시킬 작업을 입력하세요",timezoneLabel:"타임존",timezonePlaceholder:"타임존 선택",timezoneSearch:"타임존 검색...",timeoutLabel:"타임아웃 (ms)",workingDirectoryLabel:"작업 디렉토리",workingDirectoryPlaceholder:"예: /Users/name/project",allowConcurrentLabel:"이전 실행이 끝나지 않아도 동시에 실행",tabBasic:"기본",tabAdvanced:"고급",cannotSwitchToBasic:"이 표현식은 기본 모드에서 표현할 수 없습니다."},advanced:{cronLabel:"Cron 표현식",queryChip:"물어보기",aiHelperLabel:"자연어로 설명하면 표현식을 만들어 드려요",aiPlaceholder:"예: 평일 아침 9시에 실행해줘",generateBtn:"생성",aiGenerating:"AI가 표현식을 생성하고 있어요...",webllmLoading:"AI 모델을 불러오고 있어요 (최초 1회만 다운로드)",webllmFirstLoad:"처음 로드 시 모델을 다운로드해요. 이후에는 캐시돼요.",webllmReady:"AI 모델 준비 완료",webllmError:"AI 모델을 불러올 수 없어요",webllmFallback:"AI 모델을 사용할 수 없어 기본 패턴 매칭으로 동작합니다"},describe:{everyNMinutes:"매 {{n}}분마다 실행",everyNHours:"매 {{n}}시간마다 실행",everyDay:"매일",weekdays:"평일",weekends:"주말",atTime:"{{days}} {{time}}에 실행",monthly:"매월 {{days}}일 {{time}}에 실행"},mode:{execute:"execute",query:"query",command:"command"},preview:{summary:"{{repeat}} {{period}} {{time}}에 {{agent}}이 실행합니다",commandMode:"명령어"},validation:{hour:"시 값은 1부터 12 사이여야 합니다.",minute:"분 값은 0부터 59 사이여야 합니다.",days:"요일을 하나 이상 선택하세요.",agent:"에이전트를 선택하세요.",prompt:"실행할 명령을 입력하세요."},delete:{title:"스케줄을 삭제할까요?",description:'"{{name}}" 스케줄을 삭제합니다.'},field:{minute:"분",minuteTip:"0-59 또는 */5 (5분마다)",hour:"시",hourTip:"0-23 (24시간 기준)",day:"일",dayTip:"1-31 (매월 날짜)",month:"월",monthTip:"1-12 또는 JAN-DEC",weekday:"요일",weekdayTip:"0-6 (일=0, 토=6), 1-5=평일"},example:{every5min:"매 5분",daily9:"매일 9시",weekday9:"평일 9시",weeklySun:"매주 일요일",monthly1_15:"매월 1,15일"}},wBn={title:"목표",newGoal:"새 목표",loadError:"목표를 불러오지 못했습니다",retry:"다시 시도",loading:"목표를 불러오는 중...",empty:"등록된 목표가 없습니다. '+ 새 목표'로 첫 번째 목표를 시작하세요.",filterAll:"전체",filterActive:"진행 중",filterDone:"완료",filterDropped:"중단",sectionActive:"진행 중",sectionDone:"완료",sectionDropped:"중단",countUnit:"개",daysLeft:"D-{{days}} 남음",daysOverdue:"지연 D+{{days}}",completedAt:"완료 {{date}}",droppedAt:"중단 {{date}}",periodQuarter:"분기",periodHalf:"반기",periodYear:"연간",periodWeeks:"{{n}}주 스프린트",periodDays:"{{n}}일",saveButton:"저장",status:{saved:"저장됨",dirty:"변경됨",saving:"저장 중...",error:"저장 실패"},period:{title:"기간 (Period)",description:"이 목표의 기간과 상태. 분기·N주·반기·연간 자유롭게 설정.",start:"시작일",end:"종료일",progress:"진행",statusActive:"진행 중",statusDone:"완료",statusDropped:"중단",reasonRequired:"중단 사유를 입력해주세요",reasonPlaceholder:"중단 사유...",presetLabel:"빠른 설정",preset1w:"1주",preset2w:"2주",presetQuarter:"이번 분기",presetQuarterHint:"현재 분기의 시작일~종료일로 자동 설정",preset3m:"3개월",preset6m:"6개월",preset1y:"1년",overdueSub:"기간 종료 +{{days}}일 (지연)",remainingSub:"{{days}}일 남음"},objective:{title:"목표 (Objective)",description:"한 줄로 무엇을 이룰지. 측정이 아닌 방향 — 가슴 뛰는 한 문장.",titlePlaceholder:"예: 2026 Q2 제품-시장 적합성 검증",bodyPlaceholder:"이 분기에 무엇을 이루고 싶은지 한 단락으로..."},kr:{title:"핵심 결과 (Key Results)",description:"측정 가능한 결과 3~5개. 하위 항목이 있으면 진행률은 자동 계산 (가중 평균).",summary:"{{count}} KRs · 평균 {{avg}}%",addL1:"핵심 결과 추가",addL2:"하위 항목 추가",textPlaceholder:"핵심 결과...",weightTooltip:"가중치 (weight) — 이 KR의 중요도 비율",dragHandle:"드래그하여 순서 변경"},newMode:{templateKr1Text:"MAU 1,000 달성"},notes:{title:"메모 (Notes)",description:"자유롭게 메모. 회의 결과, 외부 인사이트, 기간 중 떠오른 생각.",placeholder:"메모를 적어보세요..."},reflection:{title:"회고 (Reflection)",description:"기간 종료 후 작성. 무엇이 되었고 무엇이 안 됐는지, 다음 기간에 무엇을 바꿀지.",notWritten:"미작성",placeholder:'아직 회고가 작성되지 않았습니다. 기간을 "완료"로 전환하면 회고 작성을 권유합니다.'},delete:{title:"이 목표를 삭제할까요?",body:"삭제하면 복구할 수 없습니다. status를 'dropped'로 두는 것이 권장됩니다 (회고 자산 보존).",cancel:"취소",confirm:"삭제",toast:{success:"목표가 삭제되었습니다",error:"목표 삭제에 실패했습니다"}}},yBn={title:"마켓",subtitle:{installed:"설치된 스킬 {{count}}개",official:"공식 스킬 {{count}}개",registries:"레지스트리 {{count}}개",summary:"설치됨 {{installed}}개 · 전체 {{total}}개 항목"},tabs:{installed:"설치된 스킬",official:"공식 스킬",registries:"내 레지스트리"},actions:{refresh:"새로고침",retry:"다시 시도",install:"설치",uninstall:"제거",confirmUninstall:"정말 {{name}}을(를) 제거하시겠습니까?",addRegistry:"레지스트리 추가",deleteRegistry:"삭제",cancel:"취소",manageSources:"소스 관리",checkUpdates:"업데이트 확인",close:"닫기"},badges:{unverified:"미인증",trusted:"신뢰됨",verified:"Verified",installed:"설치됨",updateAvailable:"업데이트 있음",customizedWarning:"커스텀됨"},types:{skill:"스킬",template:"템플릿",agent:"에이전트",workflow:"워크플로",plugin:"플러그인"},card:{unknownAuthor:"작성자 정보 없음",noDescription:"설명이 제공되지 않았습니다.",sourceDefault:"CrewX 기본 레지스트리에서 제공",sourceWithRegistry:"{{registry}} 레지스트리에서 제공"},official:{noticeTitle:"공식 스킬 카탈로그",noticeDescription:"{{registry}} 레지스트리의 검증된 스킬을 탐색하고 바로 설치할 수 있습니다."},registryPanel:{title:"커스텀 레지스트리 관리",description:"GitHub 레포지토리를 등록해 팀 전용 스킬 카탈로그를 CrewX UI에 연결할 수 있습니다."},registryCard:{defaultBadge:"기본",customBadge:"사용자",skillCount:"스킬 수",addedAt:"추가일",defaultHint:"기본 레지스트리는 항상 유지되며 삭제할 수 없습니다.",customHint:"사용자 레지스트리는 언제든지 제거할 수 있습니다.",lockedAction:"고정됨"},addRegistryModal:{title:"마켓 레지스트리 추가",description:"GitHub 레포 URL을 붙여넣으면 CrewX가 해당 마켓 레지스트리를 연결합니다.",urlLabel:"레지스트리 URL",urlPlaceholder:"https://github.com/owner/repository",compatibilityTitle:"Claude Code 스킬 포맷 호환",compatibilityDescription:"Claude Code 문서에서 안내하는 GitHub 레포 URL을 그대로 사용할 수 있습니다. CrewX는 등록된 레포의 스킬 메타데이터를 읽고 설치 흐름에 연결합니다."},empty:{installedTitle:"설치된 스킬이 없습니다",installedDescription:"공식 스킬 탭에서 필요한 스킬을 설치해 보세요.",officialTitle:"표시할 공식 스킬이 없습니다",officialDescription:"레지스트리 연결 상태를 확인한 뒤 다시 시도해 주세요.",registryTitle:"등록된 레지스트리가 없습니다",registryDescription:"기본 레지스트리 외에 팀 전용 레지스트리를 추가해 보세요.",filteredTitle:"조건에 맞는 항목이 없습니다",filteredDescription:"다른 검색어 또는 필터로 다시 시도해 보세요."},errors:{bannerTitle:"마켓 정보를 불러오지 못했습니다",addRegistry:"레지스트리를 추가하지 못했습니다.",detailLoad:"SKILL.md 본문을 불러오지 못해 기본 설명을 표시합니다."},trust:{blockedPlugin:"보안 정책에 의해 플러그인 설치가 차단됨",blockedExec:"보안 정책에 의해 실행 파일 설치가 차단됨"},filters:{all:"전체",installed:"설치됨",skill:"스킬",template:"템플릿",agent:"에이전트"},searchPlaceholder:"스킬, 템플릿, 에이전트 검색...",list:{title:"마켓 목록",count:"{{count}}개 항목",installedHeading:"설치됨",availableHeading:"둘러보기",updatedLabel:"{{time}} 업데이트"},detail:{emptyTitle:"마켓 항목을 선택하세요",emptyDescription:"왼쪽 목록에서 항목을 선택하면 상세 정보와 개발자 정보를 확인할 수 있습니다.",description:"설명",loadingBody:"SKILL.md 본문을 불러오는 중...",installToViewBody:"설치 후 상세 내용을 확인할 수 있습니다",tags:"태그",developers:"개발자",contributions:"기여 {{count}}회",unavailable:"정보 없음",stats:{stars:"스타",installs:"설치수",license:"라이선스",updatedAt:"업데이트 날짜"}},pluginDialog:{title:"플러그인 설치",description:"이 패키지에는 실행 가능한 플러그인이 포함되어 있습니다.",warning:"신뢰할 수 있는 출처의 플러그인만 설치하세요.",perm1:"코드 실행 권한",perm2:"로컬 파일 접근 권한"},registryModal:{title:"소스 관리",description:"연결된 레지스트리를 관리하고 팀용 마켓 소스를 추가할 수 있습니다."}},xBn={title:"메모리",allAgents:"전체 에이전트",summaryStats:"{{entries}}건 · {{topics}} 토픽 · 최근 갱신 {{date}}",summaryEmpty:"요약 정보 없음",countUnit:"건",searchPlaceholder:"검색...",emptyEntries:"항목이 없습니다",selectEntry:"왼쪽 목록에서 항목을 선택하세요",category:"카테고리",topic:"토픽",agent:"에이전트",date:"날짜"},vBn={title:"지식 허브",allAgents:"전체 에이전트",summaryStats:"{{entries}}건 · {{topics}} 토픽 · 최근 갱신 {{date}}",summaryEmpty:"요약 정보 없음",countUnit:"건",searchPlaceholder:"검색...",emptyEntries:"항목이 없습니다",selectEntry:"왼쪽 목록에서 항목을 선택하세요",category:"카테고리",topic:"토픽",agent:"에이전트",date:"날짜",graphComingSoon:"그래프 탭은 준비 중입니다",syncComingSoon:"동기화 탭은 준비 중입니다",tab:{list:"목록",graph:"그래프",sync:"동기화"}},kBn={title:"지식 그래프",allAgents:"전체 에이전트",memory:"Memory",docs:"Docs",knowhow:"Knowhow",loading:"그래프 로딩 중...",error:"그래프를 불러오지 못했습니다",retry:"재시도",empty:"표시할 노드가 없습니다",legend:"범례",nodeCount:"{{count}}개 노드",category:"카테고리",agent:"에이전트",date:"날짜",topic:"토픽",tags:"태그",detailError:"상세 정보를 불러오지 못했습니다",noDetail:"상세 정보가 없습니다"},CBn={back:"뒤로",agentTeam:"AI 에이전트팀",edit:"편집",delete:"삭제",cancel:"취소",deleteTitle:"프로젝트 삭제",deleteWarning:"이 작업은 취소할 수 없습니다",deleteConfirmMsg:'"{{name}}" 프로젝트를 삭제하시겠습니까?',deleteError:"프로젝트 삭제에 실패했습니다",newChat:"새 대화 시작",chatPrompt:"{{name}}에 무엇을 부탁할까요?",chatPlaceholder:"@에이전트 / 무엇을 시작할까요?",send:"전송",assignedAgents:"담당 에이전트",agentCount:"{{count}}명",noAgents:"담당 에이전트 없음",relatedThreads:"관련 대화",noThreads:"관련 대화가 없습니다",description:"설명",noDescription:"설명이 없습니다",relatedDocs:"관련 문서",noDocs:"관련 문서가 없습니다",unknownAgent:"알 수 없는 에이전트",yesterday:"어제",projectStatus:{active:"진행중",completed:"완료됨",on_hold:"보류"},notFound:"프로젝트를 찾을 수 없습니다",loadError:"프로젝트 정보를 불러오지 못했습니다",emptyPrompt:"(내용 없음)",justNow:"방금 전",minutesAgo:"{{count}}분 전",hoursAgo:"{{count}}시간 전",daysAgo:"{{count}}일 전",statusActive:"진행중",statusCompleted:"완료됨",statusOnHold:"보류",threadStatusPending:"대기",threadStatusRunning:"실행중",threadStatusSuccess:"완료",threadStatusFailed:"실패"},SBn={expand:"전체화면으로 보기",zoomIn:"확대",zoomOut:"축소",reset:"리셋",hintZoom:"확대/축소",hintDrag:"이동",hintZoomKeys:"줌",hintReset:"리셋",hintClose:"닫기",escHint:"ESC 또는 배경 클릭으로 닫기"},EBn={refresh:"새로고침",loadFailed:"로드 실패",durationMinSec:"{{m}}분 {{s}}초",durationSec:"{{s}}초",close:"닫기",copy:"복사",copied:"복사됨",somethingWentWrong:"문제가 발생했습니다",tryRefreshingPage:"페이지를 새로고침한 뒤 다시 시도해주세요."},_Bn={loading:"인증 상태를 확인하는 중...",login:{title:"CrewX 로그인",description:"외부 접속에는 CrewX 관리자 세션이 필요합니다.",notice:"localhost 접속은 자동으로 허용됩니다. 외부 접속은 설정된 ID와 비밀번호로 로그인해야 합니다.",usernameLabel:"아이디",usernamePlaceholder:"admin",passwordLabel:"비밀번호",passwordPlaceholder:"비밀번호를 입력하세요",submit:"로그인",submitting:"로그인 중...",error:{invalidCredentials:"잘못된 인증 정보입니다.",tooManyAttempts:"시도가 너무 많습니다. 잠시 후 다시 시도해주세요.",unknown:"로그인에 실패했습니다. 다시 시도해주세요."}}},TBn={title:"워크스페이스",loading:"워크스페이스를 불러오는 중...",loadingShort:"워크스페이스 불러오는 중...",loadingPath:"현재 워크스페이스를 확인하는 중",switchTitle:"워크스페이스 전환",switchingTitle:"워크스페이스 전환 중...",switchingDescription:"{{name}} 워크스페이스를 다시 시작하고 있습니다.",switchErrorTitle:"워크스페이스 전환에 실패했습니다",switchErrorDescription:"전환에 실패했습니다. 다시 시도해주세요.",shortcutHint:"⌘K로 빠르게 전환",manage:"워크스페이스 관리",create:"새 워크스페이스 만들기",createUnavailable:"베타 플랜 제한에 도달했습니다",currentBadge:"현재",slug:"슬러그",updatedAt:"업데이트",entryTitle:"CrewX에 오신 걸 환영합니다",entryDescription:"첫 워크스페이스를 만들고 에이전트 팀 작업을 시작하세요.",entryLogoAlt:"CrewX 로고",emptyTitle:"등록된 워크스페이스가 없습니다",emptyDescription:"워크스페이스가 등록되면 여기서 전환할 수 있습니다.",delete:{button:"워크스페이스 삭제",title:"워크스페이스 삭제",message:'"{{name}}" 워크스페이스를 삭제할까요?',note:"워크스페이스 등록만 제거됩니다. 디렉토리와 파일은 그대로 유지되며, 연결된 스레드는 보존되지만 워크스페이스 연결이 해제됩니다.",cancel:"취소",confirm:"삭제",currentDisabled:"현재 워크스페이스는 삭제할 수 없습니다. 다른 워크스페이스로 전환 후 삭제하세요.",error:{WORKSPACE_NOT_FOUND:"워크스페이스를 찾을 수 없습니다.",WORKSPACE_IS_CURRENT:"현재 워크스페이스는 삭제할 수 없습니다.",UNKNOWN:"삭제 중 오류가 발생했습니다."}},createModal:{title:"새 워크스페이스 등록",description:"crewx.yaml이 있는 프로젝트 경로를 등록해 에이전트 팀을 연결하세요.",pathLabel:"crewx.yaml이 있는 프로젝트 경로",pathPlaceholder:"/Users/me/projects/my-project",browse:"찾아보기",slugLabel:"slug (선택)",slugPlaceholder:"my-project",submit:"등록",cancel:"취소",success:"워크스페이스가 등록되었습니다.",confirmInit:{title:"이 폴더를 CrewX 프로젝트로 준비할까요?",description:"선택한 폴더에 설정 파일과 기본 자동 연동 구성을 만든 뒤 워크스페이스로 등록합니다.",pathLabel:"선택한 경로",filesLabel:"준비되는 항목",files:{config:"설정 파일 · crewx.yaml",automation:"자동 연동 · .crewx/, .claude/",registration:"워크스페이스 등록 · CrewX 목록 연결"},confirm:"준비하기",back:"경로 다시 선택"},initProgress:{title:"프로젝트 준비 중",description:"몇 초 정도 걸릴 수 있어요. 완료되면 바로 연결합니다.",step1:"설정 파일 준비 중",step2:"자동 연동 준비 중",step3:"워크스페이스 등록 중"},error:{WORKSPACE_LIMIT_EXCEEDED:"베타 무료 플랜 제한(워크스페이스 3개)에 도달했습니다. 얼리 액세스를 신청하면 정식 출시 시 우선 안내드립니다.",NOT_A_CREWX_WORKSPACE:"crewx.yaml이 없는 경로입니다. 먼저 터미널에서 `crewx init`을 실행하세요.",HOOK_INSTALL_FAILED:"설정 파일은 준비됐지만 자동 연동에 실패했어요. 일부 편의 기능이 제한될 수 있습니다.",INIT_FAILED:"프로젝트 준비 중 문제가 발생했어요. 잠시 후 다시 시도해주세요.",PATH_BLOCKED:"보안을 위해 해당 시스템 경로에는 접근할 수 없습니다.",PATH_NOT_FOUND:"경로가 존재하지 않습니다.",WORKSPACE_ALREADY_REGISTERED:"이미 등록된 워크스페이스입니다.",SLUG_CONFLICT:"slug가 이미 사용 중입니다.",UNKNOWN:"워크스페이스 생성에 실패했습니다."}}},ABn={title:"폴더 선택",description:"디렉터리를 탐색하고 등록할 워크스페이스 경로를 선택하세요.",loading:"디렉터리를 불러오는 중입니다...",empty:{default:"표시할 디렉터리가 없습니다.",workspaces:"이 폴더에 워크스페이스를 만드세요."},newFolder:{label:"새 폴더",placeholder:"폴더 이름",create:"만들기"},selected:"선택한 폴더",noneSelected:"선택한 폴더가 없습니다",select:"선택",cancel:"취소",alreadyRegistered:"등록됨",disabledTooltip:"이미 등록된 워크스페이스입니다.",badge:{crewxYaml:"crewx.yaml"},quickAccess:{title:"빠른 이동",home:"홈",workspaces:"워크스페이스"},error:{PATH_NOT_ABSOLUTE:"절대 경로를 입력하거나 선택해주세요.",PATH_BLOCKED:"보안을 위해 해당 시스템 경로에는 접근할 수 없습니다.",PATH_NOT_FOUND:"경로를 찾을 수 없습니다.",UNKNOWN:"디렉터리를 불러오지 못했습니다."},mkdir:{error:{PATH_BLOCKED:"이 위치에는 폴더를 만들 수 없습니다.",NAME_INVALID:"폴더 이름이 올바르지 않습니다.",PERMISSION_DENIED:"권한이 부족합니다.",PARENT_NOT_FOUND:"상위 폴더가 존재하지 않습니다.",NOT_A_DIRECTORY:"이미 같은 이름의 파일이 있습니다.",READ_ONLY_FS:"읽기 전용 파일시스템입니다.",NAME_TOO_LONG:"이름이 너무 깁니다.",MKDIR_FAILED:"폴더 생성에 실패했습니다.",UNKNOWN:"알 수 없는 오류로 폴더를 만들지 못했습니다."}}},MBn={banner:{workspace:{title:"워크스페이스 {{current}}/{{limit}}개 사용 중 · 베타 무료 플랜",description:"더 많은 워크스페이스가 필요하면 정식 출시 시 Pro 플랜으로 업그레이드할 수 있습니다."},agent:{title:"에이전트 {{current}}/{{limit}}개 사용 중 · 베타 무료 플랜",description:"워크스페이스당 에이전트 수는 Pro 플랜에서 확장됩니다."},token:{title:"API 토큰 {{current}}/{{limit}}개 사용 중 · 베타 무료 플랜",description:"추가 API 토큰 발급 한도는 Pro 플랜에서 확장됩니다."},grandfatherPromise:"현재 등록된 워크스페이스와 에이전트는 정식 출시 후에도 계속 사용할 수 있습니다."}},NBn={notice:{title:"CrewX 베타",description:"정식 출시 시 무료/Pro 플랜으로 전환됩니다. 지금 등록된 내용은 그대로 유지됩니다."}},jBn={waitlistCta:"Pro 얼리 액세스 신청"},DBn={title:"대화",refresh:"새로고침",filterAll:"전체",filterPlatform:"Platform",filterAgent:"Agent",sortNewest:"최신순",sortOldest:"오래된순",msgCount:"{{count}} msgs",empty:"대화 기록이 없습니다",emptyHint:"에이전트가 CLI 명령을 실행하면 대화가 생성됩니다",emptyPrompt:"(내용 없음)",loadMore:"더 보기",retry:"재시도",newThread:"새 대화",threadIdPlaceholder:"대화 ID",searchPlaceholder:"대화 검색...",open:"열기",searching:"검색 중...",searchResults:'"{{query}}" 검색 결과 {{count}}건',totalCount:"총 {{count}}개 대화",noResults:"검색 결과가 없습니다",noThreads:"아직 대화가 없습니다",emptyAction:"새 대화 시작",editPlaceholder:"대화 제목을 입력하세요",editAriaLabel:"대화 제목 편집",editButtonLabel:"대화 제목 수정",editEmptyError:"제목은 비워둘 수 없습니다",editSaveFailed:"대화 제목 저장에 실패했습니다: {{message}}",filterStarred:"스타",pinnedSection:"고정됨",pinAction:"대화 고정",unpinAction:"대화 고정 해제",starAction:"대화 스타 표시",unstarAction:"대화 스타 해제",pinSaveFailed:"대화 고정 상태 저장에 실패했습니다: {{message}}",starSaveFailed:"대화 스타 상태 저장에 실패했습니다: {{message}}",platforms:{cli:"CLI",web:"Web",api:"API",slack:"Slack"}},IBn={title:"프로젝트",newProject:"+ 새 프로젝트",totalCount:"총 {{count}}개",emptyTitle:"아직 프로젝트가 없습니다",emptyDesc:"새 프로젝트를 만들어 에이전트 팀을 구성하세요",loadError:"프로젝트 목록을 불러오지 못했습니다",retry:"재시도",threadCount:"대화 {{count}}개",docCount:"문서 {{count}}개",justNow:"방금 전",minutesAgo:"{{count}}분 전",hoursAgo:"{{count}}시간 전",daysAgo:"{{count}}일 전",weeksAgo:"{{count}}주 전",edit:"편집",delete:"삭제",menuAriaLabel:"프로젝트 메뉴",deleteConfirm:'"{{name}}" 프로젝트를 삭제하시겠습니까?'},OBn={title:"태스크",loading:"태스크를 불러오는 중...",retry:"재시도",empty:"태스크가 없습니다",emptyHint:"에이전트 실행 이력이 여기에 표시됩니다",totalCount:"총 {{count}}건",columns:{taskId:"태스크 ID",agent:"에이전트",status:"상태",duration:"실행시간",model:"모델",time:"시간",tokens:"토큰",cost:"비용"},filters:{searchPlaceholder:"태스크 검색...",agent:"에이전트",status:"상태",allAgents:"전체 에이전트",allStatuses:"전체 상태"},pagination:{previous:"이전",next:"다음"},relative:{justNow:"방금 전",minutesAgo:"{{count}}분 전",hoursAgo:"{{count}}시간 전",daysAgo:"{{count}}일 전",weeksAgo:"{{count}}주 전"},status:{pending:"대기",running:"진행중",success:"성공",failed:"실패"},panel:{title:"태스크 상세",request:"프롬프트",renderedPrompt:"렌더링된 프롬프트",result:"결과",childTasks:"하위 태스크",pendingTitle:"대기 중",pendingDescription:"이 태스크는 아직 실행되지 않았습니다.",copy:"복사",copyRequestSuccess:"프롬프트를 복사했습니다",copyRenderedPromptSuccess:"렌더링된 프롬프트를 복사했습니다",copyResultSuccess:"결과를 복사했습니다",copyFailed:"텍스트를 복사하지 못했습니다",showMore:"더보기",showLess:"접기",viewThread:"대화 보기 →",noThread:"연결된 대화 없음",retryDetail:"재시도",detailLoadError:"태스크 상세를 불러오지 못했습니다",stop:"중지",stopConfirm:"정말 중지?",stopping:"중지 중...",stopFailed:"태스크 중지에 실패했습니다",close:"패널 닫기",parentLabel:"Parent:",toolUsage:"도구 사용량",toolUsageTooltip:"{{tool}}: {{count}}회 ({{pct}}%)",tool:"도구",calls:"호출 횟수",ratio:"비율"}},LBn={heading:"팀에게 일을 시켜보세요",subheading:"에이전트를 클릭하면 바로 대화 시작",addAgent:"추가",inputPlaceholder:"@에이전트 / 작업 입력하세요...",inputHint:"Enter로 전송 · Shift+Enter로 줄바꿈",recommended:{codeReview:"코드 리뷰 해줘",sprintSummary:"이번 스프린트 정리",roadmapReview:"제품 로드맵 검토"}},PBn={heading:"비서팀에게 말을 걸어보세요",subheading:"비서를 선택하거나 자유롭게 입력해보세요",addAgent:"+ 추가",inputPlaceholder:"@agent 또는 /wf 로 작업을 시작하세요...",send:"전송",recommendedTitle:"추천 대화",agentsError:"에이전트 목록을 불러오지 못했습니다"},RBn={newTitle:"새 프로젝트",newSubtitle:"프로젝트를 생성하고 에이전트팀을 구성하세요",editTitle:"프로젝트 편집",editSubtitle:"프로젝트 기본 정보를 수정하세요",cancel:"취소",create:"프로젝트 생성",save:"저장",loading:"프로젝트 정보를 불러오는 중입니다...",createError:"프로젝트 생성에 실패했습니다.",updateError:"프로젝트 수정에 실패했습니다.",loadError:"프로젝트 정보를 불러오지 못했습니다.",nameRequired:"프로젝트 이름을 입력해주세요",sectionBasic:"기본 정보",fieldName:"프로젝트 이름",fieldNamePlaceholder:"예: crewx-ui 개발, 마케팅 캠페인 기획",fieldDescription:"설명 (선택)",fieldDescriptionPlaceholder:"이 프로젝트가 해결하려는 것을 간단히 설명하세요",sectionTeam:"팀 구성",sectionTeamDesc:"이 프로젝트에 참여할 에이전트를 선택하세요. 나중에 추가할 수 있습니다.",fieldAgent:"담당 에이전트",fieldAgentPlaceholder:"에이전트 선택...",agentsError:"에이전트 목록을 불러오지 못했습니다",noAgentsAvailable:"사용 가능한 에이전트가 없습니다",allAgentsSelected:"모든 에이전트가 선택되었습니다"},$Bn={pending:"대기 중",running:"실행 중",runningWithCount:"실행 중 {{count}}건",success:"완료",failed:"실패"},FBn={placeholder:"명령을 입력하세요...",close:"닫기"},BBn={title:"통합 검색",placeholder:"메모리와 문서에서 검색...",searchBtn:"검색",tabAll:"전체",tabMemory:"메모리",tabDocs:"문서",noResults:"검색 결과가 없습니다",hint:"검색어를 입력하고 Enter 또는 검색 버튼을 누르세요",tabDocsComingSoon:"문서 (준비 중)"},zBn={sidebarTitle:"내 티어 — Usage로 이동",promotionTitle:"티어 승급!",promotionSubtitle:"축하합니다! 새로운 티어에 도달했습니다",shareOnX:"X에 공유",shareText:"CrewX에서 {{tier}} 티어를 달성했습니다! 🏆 #CrewX #AI"},HBn={title:"사용량",loading:"사용량 데이터를 불러오는 중...",tabProvider:"프로바이더별",tabAgent:"에이전트별",totalCost:"총 비용",thisMonth:"이번 달",totalTokens:"총 토큰",tokens:"토큰",cost:"비용",byModel:"모델별",daily:"일간",monthly:"월간",workspaceBreakdown:"워크스페이스별 사용량",workspaceBreakdownDesc:"전체 워크스페이스 집계",loadingWorkspaces:"워크스페이스 사용량 로딩 중...",noWorkspaces:"기록된 워크스페이스 사용량이 없습니다.",unknownWorkspace:"알 수 없는 워크스페이스",input:"입력",output:"출력",cache:"캐시",tasks:"태스크",dailyDetails:"일별 상세",noData:"데이터가 없습니다.",date:"날짜",tierLabel:"현재 티어",toNext:"{{tier}}까지 {{tokens}} 남음",maxTier:"최고 티어 달성!",pace:"월말 예상",shareX:"X에 공유",noAgentData:"에이전트 사용량 데이터가 없습니다.",agentTrend:"에이전트별 사용량",ofTotal:"전체 대비",allWorkspaces:"전체 워크스페이스",workspaceFilterAria:"워크스페이스 필터",heroTitle:"이번 달 토큰 사용량",heroDescription:"이번 달 사용량을 한눈에 확인하세요.",heroCost:"tokens ≈ {{cost}}",previousMonthStat:"지난달 {{value}}",currentMonthStat:"이번달 {{value}}",tierProgressLabel:"→ {{tier}} ({{tokens}})",tierTooltipTitle:"티어 기준표",tierTooltipInfoLabel:"전체 티어 기준 보기",paceWithRemaining:"Pace ~{{pace}} · {{tier}}까지 {{remaining}}",paceOnly:"Pace ~{{pace}}",donutTitle:"에이전트별 비율",donutDescription:"이번 달 토큰 사용량 기준 상위 에이전트입니다.",topAgentsTitle:"Top 10 에이전트",agentCountLabel:"에이전트 {{count}}개",trendTitle:"30일 트렌드",trendDescription:"상위 에이전트의 일별 토큰 사용량입니다.",emptyTitle:"등록된 에이전트가 없습니다",emptyDescription:"에이전트를 등록하면 사용량이 여기에 표시됩니다.",emptyCta:"에이전트 등록하기",showMore:"더보기",showLess:"접기",rank:"순위",agent:"에이전트",share:"비율",trend:"추세",others:"기타"},UBn={guard:{redirecting:"온보딩 페이지로 이동합니다..."},common:{stepOf:"{{total}}단계 중 {{current}}단계",next:"다음 →",prev:"← 이전",skip:"건너뛰기",skipS1:"나중에 설치할게요",skipS2:"나중에 설정할게요",start:"시작하기 →",retry:"다시 시도",loading:"로딩 중..."},popup:{title:"처음이시네요!",description:"AI 도구 설치를 도와드릴까요? 5분이면 됩니다.",yes:"온보딩 시작",no:"괜찮아요"},s1:{title:"사용할 AI 도구를 선택하세요",subtitle:"설치 여부와 관계없이 원하는 도구를 선택하면, 설치를 도와드릴게요.",statusInstalled:"v{{version}} 설치됨",statusNotInstalled:"미설치",willInstall:"설치할게요",authLoggedIn:"✓ 로그인됨",authRequired:"⚠ 로그인 필요",authUnknown:"수동 확인 필요",loadingCards:"도구를 확인하고 있어요...",errorTitle:"도구 확인에 실패했어요",errorDesc:"다시 시도하시겠어요?",noToolsSelected:"사용할 도구를 하나 이상 선택하세요",descClaude:"Anthropic의 AI 코딩 도우미",descCodex:"OpenAI의 터미널 코딩 에이전트",descGemini:"Google의 AI 개발 도우미",descCopilot:"GitHub의 AI 페어 프로그래머",descOpencode:"오픈소스 AI 코딩 도우미"},s2:{title:"AI 도구를 설정하고 있어요",subtitle:"선택한 도구를 순서대로 설치하고 로그인합니다",installStarting:"설치를 시작합니다...",installOk:"설치 완료",loginWaiting:"{{name}} 로그인 대기 중... 브라우저에서 인증해주세요.",loginOk:"로그인 완료",loginSkipped:"로그인을 건너뛰었습니다",setupLog:"설치 로그",waitingForSetup:"설정을 준비하는 중...",statusInstalling:"⏳ 설치 중...",statusInstalled:"설치 완료",statusLoggingIn:"로그인 중...",statusComplete:"완료",statusFailed:"설치 실패"},bubble:{welcome:"안녕하세요! 잠시만 기다려 주세요",tip1:"CrewX는 여러 AI를 하나의 팀으로 묶어 관리해요.",tip2:"에이전트마다 역할을 지정하면 효율이 올라가요.",tip3:"로그인이 완료되면 바로 시작할 수 있어요!"}},WBn={title:"워크플로",totalCount:"{{count}}개 워크플로",searchPlaceholder:"ID, 이름, 설명으로 검색...",clearSearch:"검색어 지우기",bannerTitle:"여러 AI 직원이 순서대로 일하는 자동화 레시피입니다.",bannerBody:"대화창에서 /wf 를 입력하면 바로 사용할 수 있어요.",startChat:"대화 시작",runWorkflow:"실행",startChatTooltip:"/wf {{id}}",refresh:"새로고침",retry:"재시도",pageError:"워크플로 화면을 렌더링하는 중 문제가 발생했습니다.",errorsTitle:"{{count}}개 워크플로를 불러올 수 없습니다",errorItem:"{{file}}: {{reason}}",emptyTitle:"워크플로가 아직 없습니다",emptyDescription:"워크플로는 AI 에이전트들의 협업 순서를 정의합니다.",emptyAction:"팀의 개발자에게 워크플로 설정을 요청하세요.",emptyFilteredTitle:"검색 결과가 없습니다",emptyFilteredDescription:"ID, 이름, 설명 또는 에이전트 이름을 다시 확인해 주세요.",metadataAgents:"에이전트 수",metadataNodes:"노드 수",metadataTimeout:"타임아웃",metadataMaxIterations:"최대 반복",timeoutMinutes:"{{count}}분",iterationCount:"{{count}}회",noLimit:"제한 없음",diagramLoading:"다이어그램을 렌더링하는 중...",diagramError:"다이어그램 렌더링에 실패했습니다.",sourcePath:"소스 경로: {{path}}",stateVariablesTitle:"State Variables",mentionLabel:"워크플로 제안",noSuggestions:"표시할 제안이 없습니다.",selectedLabel:"/wf {{id}}",graph:{readonly:"읽기 전용",generated:"YAML에서 생성됨",descriptionFallback:"이 워크플로는 YAML 정의에서 생성된 실행 지도이며, 여기서는 노드를 편집하지 않고 구조만 확인합니다.",detailsTitle:"노드 정보",legendTitle:"범례",sourceTitle:"소스",sourceFile:"소스 파일",contract:"동작 계약",readonlyContract:"이 화면은 확인 전용입니다. 워크플로 수정은 YAML에서 하고 실행은 대화창에서 시작합니다.",nodeId:"노드 ID",nodeType:"타입",agent:"에이전트",description:"설명",input:"입력",condition:"분기 조건",if:"조건",noNodeSelected:"노드를 선택하면 정의를 확인할 수 있습니다.",noStateVariables:"State 변수는 워크플로 실행 중에 정의됩니다.",layouting:"워크플로 지도를 정리하는 중...",mermaidFallback:"Mermaid 대체 보기",closePanel:"닫기"}},qBn={autoDefault:"기본값: auto",noCurrentNode:"시작 대기",approvalHint:"승인이 필요한 지점에서 자동 실행이 멈췄습니다. 승인해야 다음 노드가 실행됩니다.",approval:{title:"승인 요청",fallbackQuestion:"이 워크플로의 다음 단계를 실행할까요?",approvePath:"승인하면:",rejectPath:"거절하면:"},lastAudit:"최근 실행: {{node}} · {{duration}}ms",approve:"승인",reject:"거절",refresh:"새로고침",started:"{{id}} 워크플로 실행을 시작했습니다.",startFailed:"워크플로 실행 실패: {{message}}",refreshFailed:"워크플로 상태 갱신 실패: {{message}}",approveFailed:"워크플로 승인 실패: {{message}}",rejectFailed:"워크플로 거절 실패: {{message}}",cancelFailed:"워크플로 중지 실패: {{message}}",stop:"중지",cancelledHint:"사용자가 워크플로 실행을 중지했습니다.",loadingCard:"워크플로 실행 상태를 불러오는 중...",unverifiedCard:"검증되지 않은 워크플로 카드입니다.",expiredCard:{title:"워크플로 카드가 만료되었습니다",description:"이 카드는 7일이 지나 만료되었습니다. /wf {{id}} 명령으로 워크플로를 다시 실행하세요."},state:{title:"State",keyCount:"{{count}}개 키",empty:"현재 저장된 state가 없습니다."},timeline:{title:"실행 절차",summary:"{{completed}}개 단계 완료",count:"{{visible}}개 도달",collapsed:"실행 절차 접힘 · {{completed}}개 단계 완료",status:{pending:"대기",current:"진행 중",waiting_approval:"승인 대기",paused:"일시 정지",completed:"완료",failed:"실패",cancelled:"중지됨"}},nodeType:{agent_task:"에이전트 작업",skill_task:"스킬 작업",shell_task:"쉘 작업",branch:"조건 분기",parallel:"병렬 실행",join:"병렬 합류",expression:"상태 계산",approval:"승인",end:"종료",error:"오류 종료"},phase:{not_started:"시작 중",running:"진행 중",waiting_approval:"승인 대기",paused:"일시 정지",completed:"완료",failed:"실패",cancelled:"중지됨"}},GBn={title:"CLI 버전 관리",subtitle:"AI CLI 도구의 설치 상태를 확인하고 업데이트합니다",actions:{refresh:"새로고침",install:"설치",update:"업데이트",openDocs:"{{name}} 문서 열기",openSignup:"{{name}} 서비스 페이지 열기"},status:{checking:"확인 중...",installing:"설치 중...",updating:"업데이트 중...",installed:"설치됨",notInstalled:"미설치",pending:"대기 중",error:"오류"},version:{selectLabel:"{{name}} 버전 선택",latestOption:"latest",latestVersion:"최신: v{{version}}"},terminal:{waiting:"CLI 상태를 기다리는 중...",processing:"처리 중..."},messages:{allUpToDate:"모든 CLI가 최신 상태입니다",someFailed:"일부 설치 또는 업데이트에 실패했습니다",crewxUnavailable:"이 화면을 열기 전에 CrewX CLI가 필요합니다.",crewxUpdateHint:"터미널에서 npm i -g crewx@latest로 업데이트"},logs:{checkingVersions:"CLI 버전을 확인하는 중...",checkComplete:"확인이 완료되었습니다. 각 CLI를 검토하고 계속 진행하세요.",checkFailed:"CLI 버전 확인에 실패했습니다: {{message}}",crewxDetected:"CrewX CLI v{{version}}이 감지되었습니다.",crewxUpdateAvailable:"CrewX CLI v{{current}} → v{{latest}} (업데이트 가능)",cliUpToDate:"{{name}} v{{version}}은(는) 최신 상태입니다.",cliUpdateAvailable:"{{name}} v{{current}} → v{{latest}} (업데이트 가능)",cliNotInstalled:"{{name}}이(가) 설치되어 있지 않습니다.",installing:"{{name}} 설치 중 ({{version}})...",updating:"{{name}} 업데이트 중 ({{version}})...",installSuccess:"{{name}} 설치 완료 (v{{version}}).",updateSuccess:"{{name}} 업데이트 완료 (v{{version}}).",actionFailed:"{{name}} {{action}}에 실패했습니다: {{message}}",crewxNotInstalled:"CrewX CLI가 글로벌 설치되어 있지 않습니다."}},VBn={settings:oBn,threadDetail:aBn,markdownEditor:lBn,taskDetail:cBn,chatInput:uBn,cliData:dBn,agent:fBn,wbs:hBn,docs:pBn,nav:gBn,planner:mBn,cron:bBn,goal:wBn,market:yBn,memory:xBn,knowledge:vBn,graph:kBn,projectDetail:CBn,mermaidFullscreen:SBn,common:EBn,auth:_Bn,workspace:TBn,dirPicker:ABn,limits:MBn,beta:NBn,upgrade:jBn,threads:DBn,projects:IBn,tasks:OBn,newTask:LBn,threadNew:PBn,project:RBn,status:$Bn,overlay:FBn,search:BBn,tier:zBn,usage:HBn,onboarding:UBn,workflow:WBn,workflowRun:qBn,cliManager:GBn},KBn={language:"Language",languageDesc:"Change the UI display language",theme:"Theme",themeDesc:"Change the screen theme",themeLight:"Light",themeDark:"Dark",themeSystemHint:"The default follows your system setting, and {{theme}} is currently applied.",tools:"Tools",toolsDesc:"Manage AI CLI tools",cliManager:"CLI Version Manager",cliManagerDesc:"Manage AI CLI versions (update/install)",openCli:"Open",versionInfo:"Version information",versionInfoDesc:"Shows the currently connected CrewX server version",crewxVersion:"CrewX version",themeChanged:"Theme updated",languageChanged:"Language updated",changeFailed:"Failed to update settings",onboarding:"Onboarding / CLI Setup",onboardingDesc:"Re-run the AI tool installation and login guide",openOnboarding:"Open",analytics:"Anonymous usage statistics",analyticsDesc:"Collect anonymous usage statistics to help improve the product. No personal information is included.",analyticsChanged:"Usage statistics setting updated",apiTokens:{title:"API access tokens",description:"Manage token-based access for external clients such as the REST API and Chrome X (JWT based)",issue:"Issue new token",empty:"No API tokens have been issued yet.",name:"Name",expiresAt:"Expires",agentScope:"Agent scope",status:"Status",actions:"Actions",unrestricted:"Unrestricted",sourceDirect:"Direct issue",sourceNegotiate:"Chrome X approval",statusValue:{valid:"Valid",expiringSoon:"Expiring soon",expired:"Expired",revoked:"Revoked"},revoke:"Revoke",revoking:"Revoking...",revokedAction:"Revoked",refresh:"Refresh",loading:"Loading tokens...",loadFailed:"Failed to load the token list.",revokeFailed:"Failed to revoke the token.",revokeConfirm:'Revoke the "{{name}}" token?',issueModal:{title:"Issue a new API access token",successTitle:"Token issued",successDescription:"Copy the token below right now",nameLabel:"Name",nameHint:"This name identifies the token and cannot be changed later.",namePlaceholder:"e.g. dev-local-2026",expiresLabel:"Expiration",agentScopeLabel:"Agent scope",agentScopeOptional:"Optional",agentScopeHint:"Restrict this token to a specific agent.",agentScopePlaceholder:"e.g. @ui_frontend_dev",notice:"The token is shown only once immediately after issuance. Store it somewhere safe.",tokenLabel:"Access token",danger:"Once you close this window, you cannot view the token again. Copy it now.",metaName:"Name",metaExpiresAt:"Expires",metaAgentScope:"Agent scope",expiresOption:{"30d":"30 days","90d":"90 days","1y":"1 year"},cancel:"Cancel",submit:"Issue",submitting:"Issuing...",confirm:"Done",copy:"Copy",copied:"Copied ✓",error:{TOKEN_LIMIT_EXCEEDED:"You have reached the FREE plan API token limit ({{limit}}).",UNKNOWN:"Failed to issue the token."}}}},JBn={back:"Back",noMessages:"No messages",noMessagesHint:"Send a message to an agent using the input below",boxLabel:"📦 {{count}} tasks · {{tokens}}K tokens (summarized)",scrollToLatest:"Jump to latest message",taskPanel:{retryStarted:"Task retry started",retryFailed:"Failed to retry task: {{message}}"}},YBn={placeholder:"Enter markdown",toolbar:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",bold:"Bold",italic:"Italic",strike:"Strikethrough",bulletList:"Bullet list",orderedList:"Ordered list",blockquote:"Blockquote",code:"Code",codeBlock:"Code block",horizontalRule:"Horizontal rule",undo:"Undo",redo:"Redo"}},XBn={noMessages:"No messages",noMessagesHint:"Send a message to an agent using the input below",inputPlaceholder:"Type an @agent message or /wf command...",inputPlaceholderActive:"Message @{{agent}}...",activityLog:"Activity Log",noActivityLog:"No activity log",subAgentReply:"Sub-Agent Reply",back:"Back",send:"Send",inputModeLabel:"Mode",inputModeQuery:"Query",inputModeExecute:"Execute",captureScreen:"Capture Screen",captureAlt:"Captured screen",agentJoined:"── 🤖 @{{agent}} joined ──",tokenUsage:"{{input}}↑ {{output}}↓",costLabel:"${{cost}}",running:"Running",failed:"Failed",retry:"Retry",thinking:"Thinking...",systemChip:{hint:"Conversation hint",retryFailedTask:"Failed task retry",systemContext:"System context"},logDetail:{title:"Activity log detail",toolTitle:"{{tool}} log detail",toolFallback:"Tool",openFullView:"Open full view"}},QBn={attachFile:"Attach file",dropFile:"Drop file here",removeAttachment:"Remove attachment",fileTooLarge:'"{{name}}" is too large ({{size}}MB). The maximum attachment size is {{max}}MB.',sendTooLarge:"Couldn't send — attachments are too large. Try smaller files or fewer of them.",sendFailed:"Failed to send the message. Please try again in a moment."},ZBn={crewxInstallNote:"AI agent team management tool"},ezn={management:"Agent Management",add:"Add Agent",edit:"Edit Agent",delete:"Delete",deleteConfirmTitle:"Delete Agent",deleteConfirmMsg:"Are you sure you want to delete @{{id}} ({{name}})?",deleteWarning:"This action cannot be undone.",cancel:"Cancel",save:"Save",back:"Go back",backToList:"Back to list",notFound:"Agent not found.",loadError:"Failed to load agent information.",listError:"Failed to load agent list.",loadFailTitle:"Load Failed",saveError:"Failed to save.",createError:{AGENT_LIMIT_EXCEEDED:"You have reached the beta free plan agent limit."},deleteError:"Failed to delete.",retry:"Retry",providerState:{loading:"Loading AI engine info...",loadingSlow:"Waking up engine... this usually takes 10-20 seconds.",error:"Could not load engine info. You may need to sign in to the CLI or AI engine.",retry:"Try again"},count:"({{count}})",team:{unassigned:"Other",memberCount_one:"{{count}} member",memberCount_other:"{{count}} members",expand:"Expand {{team}} team",collapse:"Collapse {{team}} team"},emptyTitle:"No agents registered",emptyDesc:"Add an agent using the + Add Agent button",field:{id:"Agent ID",idHint:"Unique identifier · use letters, numbers, and underscores (e.g. ui_frontend_dev)",name:"Name",role:"Role",team:"Team",provider:"AI Engine",model:"Model",searchModel:"Search models",description:"Description",descPlaceholder:"Describe the agent's role and capabilities",selectProvider:"Select an AI engine",selectModel:"Select a model",selectMode:"Select mode",selectEffort:"Select effort",selectProviderFirst:"Select an AI engine first",clearSelection:"Clear selection",noOptions:"No selectable options",noSearchResults:"No matching results",custom:"custom",idPlaceholder:"ui_frontend_dev",namePlaceholder:"Frontend Developer",rolePlaceholder:"Frontend Developer",teamPlaceholder:"CrewX UI Team",recommended:"recommended"},modeSettings:"Mode Settings",queryMode:"Query",executeMode:"Execute",mode:"Mode",effort:"Effort",validation:{required:"This field is required"},engine:{claude:"Claude",codex:"Codex",gemini:"Gemini",copilot:"Copilot"},guide:{providerTitle:"AI Engine Comparison",modelTitle:"Model Comparison ({{provider}})",providerClaude:"Best code quality, excellent large codebase comprehension",providerCodex:"Great IDE integration, safety controls, web dev strength",providerGemini:"Best multimodal (screenshots/PDF inline), generous free tier",providerCopilot:"Smooth GitHub integration and strong default support for fast general work"},model:{"claude-opus-4-6":{label:"Claude Opus 4.6",cost:"⚡ Fast burn",desc:"Architecture design, large-scale refactoring, complex reasoning"},"claude-sonnet-4-6":{label:"Claude Sonnet 4.6",cost:"⚖️ Moderate",desc:"General coding, feature implementation (recommended)"},"claude-haiku-4-5":{label:"Claude Haiku 4.5",cost:"🟢 Efficient",desc:"Simple queries, quick search, bulk tasks"},"claude-opus-4-5":{label:"Claude Opus 4.5",cost:"⚡ Fast burn",desc:"Previous gen flagship, complex reasoning"},"claude-sonnet-4-5":{label:"Claude Sonnet 4.5",cost:"⚖️ Moderate",desc:"Previous gen balanced, general coding"},"claude-sonnet-4":{label:"Claude Sonnet 4",cost:"⚖️ Moderate",desc:"Legacy, stable coding"},"claude-opus-4-6-fast":{label:"Claude Opus 4.6 (fast mode)",cost:"🔥 Very fast burn",desc:"Top performance + fast response, Preview"},"gpt-5.3-codex":{label:"GPT-5.3 Codex",cost:"⚡ Fast burn",desc:"Latest, most powerful coding"},"gpt-5.2-codex":{label:"GPT-5.2 Codex",cost:"⚖️ Moderate",desc:"Stable coding, large-scale refactoring"},"gpt-5.1-codex-mini":{label:"GPT-5.1 Codex Mini",cost:"🟢 Efficient",desc:"Lightweight coding, cost efficient"},"o4-mini":{label:"o4-mini",cost:"🟢 Efficient",desc:"Legacy, simple tasks"},"gemini-3-pro-preview":{label:"Gemini 3 Pro",cost:"⚖️ Moderate",desc:"Complex reasoning, design analysis"},"gemini-3-flash-preview":{label:"Gemini 3 Flash",cost:"🟢 Efficient",desc:"Strong coding, fast responses (recommended)"},"gemini-2.5-pro":{label:"Gemini 2.5 Pro",cost:"⚖️ Moderate",desc:"Stable production"},"gemini-2.5-flash":{label:"Gemini 2.5 Flash",cost:"💚 Very efficient",desc:"Batch processing, lightweight tasks"},"gpt-5.4":{label:"GPT-5.4",cost:"⚖️ Moderate",desc:"Balanced general work and the default GitHub Copilot choice (recommended)"},"gpt-5.2":{label:"GPT-5.2",cost:"⚖️ Moderate",desc:"Stable general coding"},"gpt-5.1":{label:"GPT-5.1",cost:"⚖️ Moderate",desc:"General coding"},"gpt-5.4-mini":{label:"GPT-5.4 Mini",cost:"🟢 Economical",desc:"Lightweight tasks, cost efficient"},"gpt-5-mini":{label:"GPT-5 Mini",cost:"💚 Very economical",desc:"Simple tasks, lowest cost"},"gpt-4.1":{label:"GPT-4.1",cost:"💚 Very economical",desc:"Legacy, simple tasks"}},duplicate:"Duplicate",duplicateError:"Failed to load the source agent for duplication.",section:{basicTitle:"Agent information",basicDescription:"Enter the core information for this agent.",skillsTitle:"Select skills to use",skillsDescription:"Choose which installed external skills this agent can use. Built-in skills are always enabled.",promptTitle:"System prompt",promptDescription:"Visually edit the system prompt with document blocks and variable chips."},context:{title:"Context Sharing",experimental:"Experimental",description:"Share your goals and daily tasks with the agent for more contextual responses.",goalsLabel:"Share Goals",goalsHint:"Share OKR goals with the agent",goalsAll:"All active Goals",goalsAllDesc:"Automatically share all active goals.",goalsSpecific:"Select specific Goals",goalsSpecificDesc:"Manually select which goals to share.",goalsAdd:"Add",goalsPickerEmpty:"No goals available to add.",dailyLabel:"Share Daily",dailyHint:"Share today's tasks with this agent"},skills:{emptyTitle:"No installed external skills",emptyDescription:"Install skills from the market and they will appear here. Built-in skills are always enabled, so no extra setup is needed.",openMarket:"Open market",loadError:"Failed to load installed skills."},tab:{basic:"Basic Info",skills:"Skills",prompt:"Prompt"},prompt:{placeholder:"Type a prompt and insert variables or documents from the toolbar",editorLabel:"Prompt editor",documentInsert:"Insert document",documentInsertLoading:"Loading documents...",documentInsertEmpty:"No documents available to insert.",documentInsertError:"Failed to load documents.",documentInsertUnavailable:"The document API is not connected yet, so document insert is unavailable.",variantContent:"Content",variantToc:"TOC",documentChip:{delete:"Delete"},documentPicker:{searchPlaceholder:"Search documents",inlineSection:"Inline documents",docsSection:"docs/",treeLoading:"Loading the document tree...",treeError:"Failed to load the document tree.",noInlineResults:"No inline documents match your search.",noTreeResults:"No files match your search.",linked:"Registered document"},preview:{button:"Preview",title:"Preview",refresh:"Refresh",copy:"Copy",loading:"Rendering...",unavailable:"The preview API is not connected yet, so the rendered result is unavailable.",error:"Rendering error",empty:"Enter a prompt to preview the rendered result."},toolbar:{h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",bold:"Bold",italic:"Italic",strike:"Strikethrough",code:"Code",bulletList:"Bullet list",orderedList:"Ordered list",blockquote:"Blockquote",codeBlock:"Code block",horizontalRule:"Horizontal rule",undo:"Undo",redo:"Redo",variable:"Insert variable",insert:"Insert",search:"Search",empty:"No items to show."}},template:{title:"Quick start: build from a template",subtitle:"Start faster with a common agent template.",direct:"Direct setup",codingAssistant:"Coding Assistant",codingAssistantDesc:"A default template for implementation and refactoring",research:"Research",researchDesc:"A template for research and comparison work",dataAnalysis:"Data Analysis",dataAnalysisDesc:"A template focused on analysis and reporting",writing:"Writing",writingDesc:"A template for drafting and editing content",designReview:"Design Review",designReviewDesc:"A template for UI/UX review and feedback"},skill:{memory:{label:"memory",description:"Long-term memory and context management"},search:{label:"search",description:"Source and codebase search"},git:{label:"git",description:"Git status access inside the CrewX context"},cron:{label:"cron",description:"Scheduled task configuration"},wbs:{label:"wbs",description:"Step-by-step work breakdown management"}},emptyAction:"+ Add Agent"},tzn={title:"WBS",detail:"WBS Detail",totalCount:"{{count}} projects",empty:"No WBS projects",retry:"Retry",progress:"Progress",jobCount:"{{completed}}/{{total}} jobs",failedCount:"{{count}} failed",runningCount:"{{count}} running",pendingCount:"{{count}} pending",backToList:"Back to list",jobs:"Jobs",noJobs:"No jobs",agent:"Agent",createdAt:"Created",completedAt:"Completed",expand:"Expand",collapse:"Collapse",status:{planning:"Planning",running:"Running",completed:"Completed",partial:"Partial",on_hold:"On Hold"},jobStatus:{pending:"Pending",running:"Running",completed:"Completed",failed:"Failed"},sort:{newest:"Newest First",oldest:"Oldest First",progress:"Progress",name:"Name"}},nzn={title:"Docs",fileTree:"File Tree",searchPlaceholder:"Search files...",noFiles:"No files",noSearchResults:"No results found",selectFile:"Select a file from the tree on the left",copyPath:"Copy path",pathCopied:"Path copied",copyContent:"Copy",contentCopied:"Copied",imageUnavailable:"Image unavailable",view:{fontLabel:"Document font",fontSystem:"System",fontPretendard:"Pretendard",fontNotoSansKr:"Noto Sans KR",fontInter:"Inter",fontSerif:"Serif",fontNotoSerifKr:"Noto Serif KR",fontMono:"Mono",fontCoding:"Coding",localFontsGroup:"Local fonts",localFontsLoading:"Checking local fonts",localFontsUnsupported:"This browser does not support local font loading",localFontsFailed:"Could not load local fonts",localFontsEmpty:"No local fonts were loaded",zoomLabel:"Zoom",zoomOut:"Zoom out",zoomIn:"Zoom in"},toggleTree:{show:"Show file tree",hide:"Hide file tree"},edit:{button:"Edit",save:"Save",cancel:"Cancel",dirtyMarker:"●",savedToast:"Saved",saveFailed:"Save failed: {{message}}",discardConfirm:"Discard your changes?",conflict:{title:"This file was modified elsewhere",message:"The file changed in another window or external editor. What would you like to do?",overwrite:"Overwrite",reload:"Reload",dismiss:"Cancel"}},tab:{markdown:"Markdown",implStatus:"Impl Status"},impl:{totalScreens:"Total Screens",syncDone:"Synced",mismatch:"Mismatch",id:"ID",name:"Name",doc:"Doc",pencil:"Pencil",code:"Code",empty:"No implementation status data",legend:"Legend: ✅ exists · ❌ missing (mismatched rows highlighted in red)"}},rzn={agents:"Agents",planner:"Daily Planner",cron:"Schedules",goals:"Goals",wbs:"WBS",memory:"Memory",graph:"Knowledge Graph",docs:"Docs",market:"Market",cliManager:"CLI Manager",settings:"Settings",newTask:"New Chat",recentTasks:"Recent Chats",noTasks:"No chats",viewAll:"View all →",tools:"Tools",search:"Search",projects:"Projects",more:"More",freePlan:"Free Plan",workflows:"Workflows",usage:"Usage",tasks:"Task History",workspaces:"Workspaces",openSidebar:"Open sidebar",closeSidebar:"Close sidebar"},izn={title:"Daily Planner",subtitle:"Keep today's priorities and execution flow in one place.",loadError:"Failed to load the planner",saveError:"Failed to save the planner",retry:"Retry",loading:"Loading planner...",empty:"No planner data is available",today:"Today",previousDate:"Previous date",nextDate:"Next date",status:{saved:"Saved",saving:"Saving...",unsaved:"Unsaved changes"},mockNotice:"The backend API is not ready yet, so temporary planner data is being shown.",top3:{title:"Top 3 Priorities",description:"Pick the 3 things that must get done today from your dump.",empty:"No priorities have been set for today",noAgents:"No agents assigned",placeholder:"Most important task...",inputLabel:"Top priority {{rank}}"},braindump:{title:"Brain Dump",description:"Empty your mind. Dump every task, worry, and idea — connections will emerge.",empty:"No brain dump items yet",placeholder:"Pour out everything on your mind...",inputLabel:"Brain dump"},schedule:{title:"Schedule",description:"Assign tasks to time blocks and check them off.",empty:"No schedule items yet",toggleTask:"Toggle completion for {{task}}",placeholder:"What's planned for this slot?",inputLabel:"Task for {{time}}",status:{done:"Done",pending:"Pending",cancelled:"Cancelled"}},notes:{title:"Notes",description:"Freeform notes — anything goes.",empty:"No notes yet",placeholder:"Write your notes...",inputLabel:"Notes"},goalChip:{title:"Today's Goals",description:"Goals you're tracking. Agents use these as priority hints.",addGoal:"Select Goal",removeChip:"Remove from daily"}},szn={title:"Schedule",subtitle:"Automation control",apiUnavailable:"The cron API is not ready yet. Schedules will appear when the backend is connected.",period:{am:"AM",pm:"PM"},days:{mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat",sun:"Sun"},repeat:{daily:"Every day",weekdays:"Weekdays",weekends:"Weekends",weekdaysOnly:"Weekdays only",weekendsOnly:"Weekends only",custom:"Custom",customLabel:"Custom repeat",weekly:"Every {{day}}"},actions:{new:"New Schedule",add:"Add",save:"Save",delete:"Delete",cancel:"Cancel"},card:{untitled:"Untitled schedule",toggle:"Toggle {{name}}",cronBadge:"Expression"},daemon:{loading:"Checking status...",running:"Schedules active",stopped:"Schedules paused",pid:"PID {{pid}}",startBtn:"Start",stopBtn:"Stop",starting:"Starting...",stopping:"Stopping...",summary:"{{enabled}} enabled / {{total}} total",startedAt:"Started {{date}}"},date:{todayAt:"Today {{time}}",tomorrowAt:"Tomorrow {{time}}"},empty:{title:"No schedules yet",description:"Add a schedule to start recurring automation."},history:{title:"Recent activity",recentCount:"Recent 5",runCount:"{{count}} runs"},modal:{createTitle:"New Schedule",editTitle:"Edit Schedule",subtitle:"Set a simple alarm-style automation schedule.",unsupportedCron:"This schedule uses a pattern that cannot be edited with the simple repeat form yet.",hour:"Hour",minute:"Minute",repeatLabel:"Repeat",dayLabel:"Choose days",nameLabel:"Schedule name",namePlaceholder:"e.g. Daily Report",agentLabel:"Agent",agentPlaceholder:"Select an agent",modeLabel:"Mode",commandLabel:"Command",commandPlaceholder:"Describe what should run",timezoneLabel:"Timezone",timezonePlaceholder:"Select timezone",timezoneSearch:"Search timezone...",timeoutLabel:"Timeout (ms)",workingDirectoryLabel:"Working directory",workingDirectoryPlaceholder:"e.g. /Users/name/project",allowConcurrentLabel:"Allow overlapping runs",tabBasic:"Basic",tabAdvanced:"Advanced",cannotSwitchToBasic:"This expression cannot be represented in basic mode."},advanced:{cronLabel:"Cron Expression",queryChip:"Ask AI",aiHelperLabel:"Describe in natural language and we'll create the expression",aiPlaceholder:"e.g., Run every weekday at 9 AM",generateBtn:"Generate",aiGenerating:"AI is generating the expression...",webllmLoading:"Loading AI model (one-time download)",webllmFirstLoad:"First load downloads the model. Cached on subsequent visits.",webllmReady:"AI model ready",webllmError:"Failed to load AI model",webllmFallback:"AI model unavailable — using pattern matching instead"},describe:{everyNMinutes:"Runs every {{n}} minutes",everyNHours:"Runs every {{n}} hours",everyDay:"Every day",weekdays:"Weekdays",weekends:"Weekends",atTime:"Runs at {{time}} on {{days}}",monthly:"Runs on day {{days}} at {{time}} monthly"},mode:{execute:"execute",query:"query",command:"command"},preview:{summary:"{{repeat}} at {{time}} {{period}} by {{agent}}",commandMode:"the command"},validation:{hour:"Hour must be between 1 and 12.",minute:"Minute must be between 0 and 59.",days:"Choose at least one day.",agent:"Choose an agent.",prompt:"Enter a command."},delete:{title:"Delete this schedule?",description:'Delete "{{name}}".'},field:{minute:"Min",minuteTip:"0-59 or */5 (every 5 min)",hour:"Hour",hourTip:"0-23 (24h format)",day:"Day",dayTip:"1-31 (day of month)",month:"Mon",monthTip:"1-12 or JAN-DEC",weekday:"DoW",weekdayTip:"0-6 (Sun=0, Sat=6), 1-5=weekdays"},example:{every5min:"Every 5m",daily9:"Daily 9am",weekday9:"Weekday 9am",weeklySun:"Every Sunday",monthly1_15:"1st & 15th"}},ozn={title:"Goals",newGoal:"New Goal",loadError:"Failed to load goals",retry:"Retry",loading:"Loading goals...",empty:"No goals yet. Click '+ New Goal' to start your first goal.",filterAll:"All",filterActive:"Active",filterDone:"Done",filterDropped:"Dropped",sectionActive:"Active",sectionDone:"Done",sectionDropped:"Dropped",countUnit:"",daysLeft:"D-{{days}} left",daysOverdue:"Overdue D+{{days}}",completedAt:"Completed {{date}}",droppedAt:"Dropped {{date}}",periodQuarter:"Quarter",periodHalf:"Half-year",periodYear:"Annual",periodWeeks:"{{n}}-week sprint",periodDays:"{{n}} days",saveButton:"Save",status:{saved:"Saved",dirty:"Modified",saving:"Saving...",error:"Save failed"},period:{title:"Period",description:"Set the timeframe and status for this goal.",start:"Start",end:"End",progress:"Progress",statusActive:"Active",statusDone:"Done",statusDropped:"Dropped",reasonRequired:"Please enter a reason for dropping",reasonPlaceholder:"Reason for dropping...",presetLabel:"Quick Set",preset1w:"1 Week",preset2w:"2 Weeks",presetQuarter:"This Quarter",presetQuarterHint:"Auto-set to current quarter start and end dates",preset3m:"3 Months",preset6m:"6 Months",preset1y:"1 Year",overdueSub:"Overdue +{{days}} days",remainingSub:"{{days}} days left"},objective:{title:"Objective",description:"A single inspiring sentence — what will you achieve?",titlePlaceholder:"e.g. 2026 Q2 product-market fit validation",bodyPlaceholder:"In one paragraph, what do you want to achieve this period..."},kr:{title:"Key Results",description:"3-5 measurable outcomes. Sub-items trigger automatic progress (weighted average).",summary:"{{count}} KRs · avg {{avg}}%",addL1:"Add Key Result",addL2:"Add Sub-item",textPlaceholder:"Key result...",weightTooltip:"Weight — this KR's importance ratio",dragHandle:"Drag to reorder"},newMode:{templateKr1Text:"Reach MAU 1,000"},notes:{title:"Notes",description:"Free-form notes. Meeting outcomes, insights, thoughts during the period.",placeholder:"Write your notes..."},reflection:{title:"Reflection",description:"Write after the period ends. What worked, what didn't, what to change next time.",notWritten:"Not written",placeholder:'No reflection yet. Switch status to "Done" to start writing your reflection.'},delete:{title:"Delete this goal?",body:"This action cannot be undone. Consider setting status to 'dropped' instead to preserve retrospective assets.",cancel:"Cancel",confirm:"Delete",toast:{success:"Goal deleted",error:"Failed to delete goal"}}},azn={title:"Market",subtitle:{installed:"{{count}} installed skills",official:"{{count}} official skills",registries:"{{count}} registries",summary:"{{installed}} installed · {{total}} total items"},tabs:{installed:"Installed Skills",official:"Official Skills",registries:"My Registries"},actions:{refresh:"Refresh",retry:"Retry",install:"Install",uninstall:"Remove",confirmUninstall:"Are you sure you want to remove {{name}}?",addRegistry:"Add Registry",deleteRegistry:"Delete",cancel:"Cancel",manageSources:"Manage Sources",checkUpdates:"Check Updates",close:"Close"},badges:{unverified:"Unverified",trusted:"Trusted",verified:"Verified",installed:"Installed",updateAvailable:"Update Available",customizedWarning:"Customized"},types:{skill:"Skill",template:"Template",agent:"Agent",workflow:"Workflow",plugin:"Plugin"},card:{unknownAuthor:"Unknown author",noDescription:"No description provided.",sourceDefault:"Available from the default CrewX registry",sourceWithRegistry:"Available from the {{registry}} registry"},official:{noticeTitle:"Official Skill Catalog",noticeDescription:"Browse verified skills from the {{registry}} registry and install them right away."},registryPanel:{title:"Custom Registry Management",description:"Connect GitHub repositories to expose team-specific skill catalogs inside CrewX UI."},registryCard:{defaultBadge:"Default",customBadge:"Custom",skillCount:"Skill count",addedAt:"Added",defaultHint:"The default registry is always preserved and cannot be removed.",customHint:"Custom registries can be removed at any time.",lockedAction:"Locked"},addRegistryModal:{title:"Add Market Registry",description:"Paste a GitHub repository URL and CrewX will connect it as a market registry.",urlLabel:"Registry URL",urlPlaceholder:"https://github.com/owner/repository",compatibilityTitle:"Claude Code skill format compatible",compatibilityDescription:"You can reuse the same GitHub repository URL described in the Claude Code skill docs. CrewX reads the registry metadata and wires it into the install flow."},empty:{installedTitle:"No installed skills yet",installedDescription:"Install the skills you need from the official catalog.",officialTitle:"No official skills available",officialDescription:"Check the registry connection and try again.",registryTitle:"No registries available",registryDescription:"Add a team registry in addition to the default catalog.",filteredTitle:"No matching items",filteredDescription:"Try a different keyword or filter to find what you need."},errors:{bannerTitle:"Failed to load market data",addRegistry:"Failed to add registry.",detailLoad:"Failed to load SKILL.md content. Showing the summary instead."},trust:{blockedPlugin:"Plugin installation blocked by security policy",blockedExec:"Executable installation blocked by security policy"},filters:{all:"All",installed:"Installed",skill:"Skill",template:"Template",agent:"Agent"},searchPlaceholder:"Search skills, templates, or agents...",list:{title:"Market List",count:"{{count}} items",installedHeading:"Installed",availableHeading:"Available",updatedLabel:"Updated {{time}}"},detail:{emptyTitle:"Select a market item",emptyDescription:"Choose an item from the list to inspect details, developers, and metadata.",description:"Description",loadingBody:"Loading SKILL.md content...",installToViewBody:"Install this skill to view the detailed contents.",tags:"Tags",developers:"Developers",contributions:"{{count}} commits",unavailable:"Unavailable",stats:{stars:"Stars",installs:"Installs",license:"License",updatedAt:"Updated"}},pluginDialog:{title:"Plugin Installation",description:"This package includes executable plugins.",warning:"Only install plugins from trusted sources.",perm1:"Execute code on your machine",perm2:"Access local files"},registryModal:{title:"Source Management",description:"Manage connected registries and add more market sources for your team."}},lzn={title:"Memory",allAgents:"All Agents",summaryStats:"{{entries}} entries · {{topics}} topics · Last updated {{date}}",summaryEmpty:"No summary available",countUnit:"",searchPlaceholder:"Search...",emptyEntries:"No entries found",selectEntry:"Select an entry from the list",category:"Category",topic:"Topic",agent:"Agent",date:"Date"},czn={title:"Knowledge Hub",allAgents:"All Agents",summaryStats:"{{entries}} entries · {{topics}} topics · Last updated {{date}}",summaryEmpty:"No summary available",countUnit:"",searchPlaceholder:"Search...",emptyEntries:"No entries found",selectEntry:"Select an entry from the list",category:"Category",topic:"Topic",agent:"Agent",date:"Date",graphComingSoon:"Graph tab coming soon",syncComingSoon:"Sync tab coming soon",tab:{list:"List",graph:"Graph",sync:"Sync"}},uzn={title:"Knowledge Graph",allAgents:"All Agents",memory:"Memory",docs:"Docs",knowhow:"Knowhow",loading:"Loading graph...",error:"Failed to load graph",retry:"Retry",empty:"No nodes to display",legend:"Legend",nodeCount:"{{count}} nodes",category:"Category",agent:"Agent",date:"Date",topic:"Topic",tags:"Tags",detailError:"Failed to load details",noDetail:"No details available"},dzn={back:"Back",agentTeam:"AI Agent Team",edit:"Edit",delete:"Delete",cancel:"Cancel",deleteTitle:"Delete Project",deleteWarning:"This action cannot be undone",deleteConfirmMsg:'Are you sure you want to delete "{{name}}"?',deleteError:"Failed to delete project",newChat:"New Chat",chatPrompt:"What would you like to ask {{name}}?",chatPlaceholder:"@agent / What would you like to start?",send:"Send",assignedAgents:"Assigned Agents",agentCount:"{{count}} agent(s)",noAgents:"No assigned agents",relatedThreads:"Related Threads",noThreads:"No related threads",description:"Description",noDescription:"No description provided",relatedDocs:"Related Docs",noDocs:"No related documents",unknownAgent:"Unknown agent",yesterday:"yesterday",projectStatus:{active:"Active",completed:"Completed",on_hold:"On Hold"},notFound:"Project not found",loadError:"Failed to load project",emptyPrompt:"(empty)",justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago",statusActive:"Active",statusCompleted:"Completed",statusOnHold:"On Hold",threadStatusPending:"Pending",threadStatusRunning:"Running",threadStatusSuccess:"Done",threadStatusFailed:"Failed"},fzn={expand:"View fullscreen",zoomIn:"Zoom in",zoomOut:"Zoom out",reset:"Reset",hintZoom:"Zoom",hintDrag:"Move",hintZoomKeys:"Zoom",hintReset:"Reset",hintClose:"Close",escHint:"Press ESC or click backdrop to close"},hzn={refresh:"Refresh",loadFailed:"Load failed",durationMinSec:"{{m}}m {{s}}s",durationSec:"{{s}}s",close:"Close",copy:"Copy path",copied:"Copied",somethingWentWrong:"Something went wrong",tryRefreshingPage:"Please refresh the page and try again."},pzn={loading:"Checking authentication...",login:{title:"Sign in to CrewX",description:"External access requires a valid CrewX admin session.",notice:"Localhost access is automatic. External access requires the configured username and password.",usernameLabel:"Username",usernamePlaceholder:"admin",passwordLabel:"Password",passwordPlaceholder:"Enter your password",submit:"Log in",submitting:"Signing in...",error:{invalidCredentials:"Invalid credentials",tooManyAttempts:"Too many attempts. Try again later.",unknown:"Failed to sign in. Please try again."}}},gzn={title:"Workspaces",loading:"Loading workspaces...",loadingShort:"Loading workspace...",loadingPath:"Checking current workspace",switchTitle:"Switch workspace",switchingTitle:"Switching workspace...",switchingDescription:"Waiting for {{name}} to restart and become available.",switchErrorTitle:"Workspace switch failed",switchErrorDescription:"The switch failed. Please try again.",shortcutHint:"⌘K to switch faster",manage:"Manage workspaces",create:"Create workspace",createUnavailable:"You have reached the beta plan limit.",currentBadge:"Current",slug:"Slug",updatedAt:"Updated",entryTitle:"Welcome to CrewX",entryDescription:"Create your first workspace to start working with your agent team.",entryLogoAlt:"CrewX logo",emptyTitle:"No workspaces found",emptyDescription:"Once a workspace is registered, you can switch between them here.",delete:{button:"Delete workspace",title:"Delete workspace",message:'Delete the "{{name}}" workspace?',note:"Only the workspace registration is removed. The directory and files stay as-is, and linked threads are preserved but detached from this workspace.",cancel:"Cancel",confirm:"Delete",currentDisabled:"You cannot delete the current workspace. Switch to another workspace first.",error:{WORKSPACE_NOT_FOUND:"The workspace could not be found.",WORKSPACE_IS_CURRENT:"You cannot delete the current workspace.",UNKNOWN:"An error occurred while deleting the workspace."}},createModal:{title:"Register workspace",description:"Register a project path with crewx.yaml to connect an agent team.",pathLabel:"Project path containing crewx.yaml",pathPlaceholder:"/Users/me/projects/my-project",browse:"Browse",slugLabel:"Slug (optional)",slugPlaceholder:"my-project",submit:"Register",cancel:"Cancel",success:"Workspace registered successfully.",confirmInit:{title:"Prepare this folder as a CrewX project?",description:"We will add the config file, set up automatic integration, and register the folder as a workspace.",pathLabel:"Selected path",filesLabel:"What will be prepared",files:{config:"Config file · crewx.yaml",automation:"Automatic integration · .crewx/, .claude/",registration:"Workspace registration · connect in CrewX"},confirm:"Prepare workspace",back:"Choose another path"},initProgress:{title:"Preparing project",description:"This can take a few seconds. We will connect it right away when it is ready.",step1:"Preparing config file",step2:"Preparing automatic integration",step3:"Registering workspace"},error:{WORKSPACE_LIMIT_EXCEEDED:"You have reached the beta free plan limit (3 workspaces). Join early access to hear about Pro when it launches.",NOT_A_CREWX_WORKSPACE:"This path does not contain crewx.yaml. Run `crewx init` in your terminal first.",HOOK_INSTALL_FAILED:"The config file is ready, but automatic integration failed. Some convenience features may be limited.",INIT_FAILED:"Something went wrong while preparing the project. Please try again shortly.",PATH_BLOCKED:"That system path is blocked for safety. Choose another directory.",PATH_NOT_FOUND:"The path does not exist.",WORKSPACE_ALREADY_REGISTERED:"This workspace is already registered.",SLUG_CONFLICT:"That slug is already in use.",UNKNOWN:"Failed to create the workspace."}}},mzn={title:"Select folder",description:"Browse directories and choose the workspace path to register.",loading:"Loading directories...",empty:{default:"No directories found.",workspaces:"Create a workspace in this folder."},newFolder:{label:"New folder",placeholder:"Folder name",create:"Create"},selected:"Selected folder",noneSelected:"No folder selected",select:"Select",cancel:"Cancel",alreadyRegistered:"Registered",disabledTooltip:"This workspace is already registered.",badge:{crewxYaml:"crewx.yaml"},quickAccess:{title:"Quick access",home:"Home",workspaces:"Workspaces"},error:{PATH_NOT_ABSOLUTE:"Please enter or choose an absolute path.",PATH_BLOCKED:"That system path is blocked for safety.",PATH_NOT_FOUND:"The path could not be found.",UNKNOWN:"Failed to load directories."},mkdir:{error:{PATH_BLOCKED:"You cannot create a folder in this location.",NAME_INVALID:"The folder name is invalid.",PERMISSION_DENIED:"You do not have permission to create a folder here.",PARENT_NOT_FOUND:"The parent folder does not exist.",NOT_A_DIRECTORY:"A file with the same name already exists.",READ_ONLY_FS:"This filesystem is read-only.",NAME_TOO_LONG:"The folder name is too long.",MKDIR_FAILED:"Failed to create the folder.",UNKNOWN:"Could not create the folder because of an unknown error."}}},bzn={banner:{workspace:{title:"{{current}}/{{limit}} workspaces used · beta free plan",description:"If you need more workspaces, you will be able to upgrade to Pro when we launch."},agent:{title:"{{current}}/{{limit}} agents used · beta free plan",description:"The number of agents per workspace expands on Pro."},token:{title:"{{current}}/{{limit}} API tokens used · beta free plan",description:"The API token issuance limit expands on Pro."},grandfatherPromise:"Your currently registered workspaces and agents will continue to work after launch."}},wzn={notice:{title:"CrewX beta",description:"CrewX will move to free and Pro plans at launch. Everything you register now will stay available."}},yzn={waitlistCta:"Join Pro early access"},xzn={title:"Threads",refresh:"Refresh",filterAll:"All",filterPlatform:"Platform",filterAgent:"Agent",sortNewest:"Newest",sortOldest:"Oldest",msgCount:"{{count}} msgs",empty:"No threads yet",emptyHint:"Threads will appear here when agents run CLI commands",emptyPrompt:"(empty)",loadMore:"Load More",retry:"Retry",newThread:"New Thread",threadIdPlaceholder:"Thread ID",searchPlaceholder:"Search threads...",open:"Open",searching:"Searching...",searchResults:'{{count}} results for "{{query}}"',totalCount:"{{count}} threads",noResults:"No results found",noThreads:"No threads yet",emptyAction:"Start New Thread",editPlaceholder:"Enter a thread title",editAriaLabel:"Edit thread title",editButtonLabel:"Rename thread title",editEmptyError:"A title is required",editSaveFailed:"Failed to save the thread title: {{message}}",filterStarred:"Starred",pinnedSection:"Pinned",pinAction:"Pin thread",unpinAction:"Unpin thread",starAction:"Star thread",unstarAction:"Unstar thread",pinSaveFailed:"Failed to save the pin state: {{message}}",starSaveFailed:"Failed to save the star state: {{message}}",platforms:{cli:"CLI",web:"Web",api:"API",slack:"Slack"}},vzn={title:"Projects",newProject:"+ New Project",totalCount:"{{count}} total",emptyTitle:"No projects yet",emptyDesc:"Create a project to organize your agent team",loadError:"Failed to load projects",retry:"Retry",threadCount:"{{count}} threads",docCount:"{{count}} docs",justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago",weeksAgo:"{{count}}w ago",edit:"Edit",delete:"Delete",menuAriaLabel:"Project menu",deleteConfirm:'Delete project "{{name}}"?'},kzn={title:"Tasks",loading:"Loading tasks...",retry:"Retry",empty:"No tasks found",emptyHint:"Agent execution history will appear here.",totalCount:"{{count}} total",columns:{taskId:"Task ID",agent:"Agent",status:"Status",duration:"Duration",model:"Model",time:"Time",tokens:"Tokens",cost:"Cost"},filters:{searchPlaceholder:"Search tasks...",agent:"Agent",status:"Status",allAgents:"All agents",allStatuses:"All statuses"},pagination:{previous:"Previous",next:"Next"},relative:{justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago",weeksAgo:"{{count}}w ago"},status:{pending:"Pending",running:"Running",success:"Success",failed:"Failed"},panel:{title:"Task details",request:"Prompt",renderedPrompt:"Rendered Prompt",result:"Result",childTasks:"Child Tasks",pendingTitle:"Pending",pendingDescription:"This task has not started yet.",copy:"Copy",copyRequestSuccess:"Prompt copied",copyRenderedPromptSuccess:"Rendered prompt copied",copyResultSuccess:"Result copied",copyFailed:"Failed to copy text",showMore:"Show more",showLess:"Show less",viewThread:"View thread →",noThread:"No linked thread",retryDetail:"Retry",detailLoadError:"Failed to load task details",stop:"Stop",stopConfirm:"Stop for real?",stopping:"Stopping...",stopFailed:"Failed to stop task",close:"Close panel",parentLabel:"Parent:",toolUsage:"Tool Usage",toolUsageTooltip:"{{tool}}: {{count}} calls ({{pct}}%)",tool:"Tool",calls:"Calls",ratio:"Share"}},Czn={heading:"Put your team to work",subheading:"Click an agent to start a conversation",addAgent:"Add",inputPlaceholder:"@agent / Enter a task...",inputHint:"Enter to send · Shift+Enter for new line",recommended:{codeReview:"Review my code",sprintSummary:"Summarize this sprint",roadmapReview:"Review product roadmap"}},Szn={heading:"Talk to your AI team",subheading:"Select an agent or type freely",addAgent:"+ Add",inputPlaceholder:"Start with @agent or /wf...",send:"Send",recommendedTitle:"Suggested",agentsError:"Failed to load agents"},Ezn={newTitle:"New Project",newSubtitle:"Create a project and set up your agent team",editTitle:"Edit Project",editSubtitle:"Update project basic information",cancel:"Cancel",create:"Create Project",save:"Save",loading:"Loading project...",createError:"Failed to create project.",updateError:"Failed to update project.",loadError:"Failed to load project.",nameRequired:"Please enter a project name",sectionBasic:"Basic Info",fieldName:"Project Name",fieldNamePlaceholder:"e.g. crewx-ui dev, marketing campaign planning",fieldDescription:"Description (optional)",fieldDescriptionPlaceholder:"Briefly describe what this project aims to solve",sectionTeam:"Team Setup",sectionTeamDesc:"Select agents to participate in this project. You can add more later.",fieldAgent:"Assigned Agent",fieldAgentPlaceholder:"Select agent...",agentsError:"Failed to load agent list",noAgentsAvailable:"No agents available",allAgentsSelected:"All agents selected"},_zn={pending:"Pending",running:"Running",runningWithCount:"Running {{count}}",success:"Done",failed:"Failed"},Tzn={placeholder:"Type a command...",close:"Close"},Azn={title:"Unified Search",placeholder:"Search in memory and docs...",searchBtn:"Search",tabAll:"All",tabMemory:"Memory",tabDocs:"Docs",noResults:"No results found",hint:"Type a query and press Enter or click Search",tabDocsComingSoon:"Docs (Coming Soon)"},Mzn={sidebarTitle:"My Tier — Go to Usage",promotionTitle:"Tier Up!",promotionSubtitle:"Congratulations! You've reached a new tier",shareOnX:"Share on X",shareText:"I just reached {{tier}} tier on CrewX! 🏆 #CrewX #AI"},Nzn={title:"Usage",loading:"Loading usage data...",tabProvider:"By Provider",tabAgent:"By Agent",totalCost:"Total Cost",thisMonth:"This Month",totalTokens:"Total tokens",tokens:"Tokens",cost:"Cost",byModel:"By Model",daily:"Daily",monthly:"Monthly",workspaceBreakdown:"Workspace Breakdown",workspaceBreakdownDesc:"Usage aggregated across all workspaces",loadingWorkspaces:"Loading workspace usage...",noWorkspaces:"No workspace usage recorded yet.",unknownWorkspace:"Unknown workspace",input:"Input",output:"Output",cache:"Cache",tasks:"Tasks",dailyDetails:"Daily Details",noData:"No data available.",date:"Date",tierLabel:"Current Tier",toNext:"{{tokens}} to {{tier}}",maxTier:"Max tier reached!",pace:"Month-end pace",shareX:"Share on X",noAgentData:"No agent usage data available.",agentTrend:"Agent Usage Trend",ofTotal:"of total",allWorkspaces:"All workspaces",workspaceFilterAria:"Workspace filter",heroTitle:"This month token usage",heroDescription:"See your monthly usage at a glance.",heroCost:"tokens ≈ {{cost}}",previousMonthStat:"Last month {{value}}",currentMonthStat:"This month {{value}}",tierProgressLabel:"→ {{tier}} ({{tokens}})",tierTooltipTitle:"Tier benchmark",tierTooltipInfoLabel:"View all tier benchmarks",paceWithRemaining:"Pace ~{{pace}} · {{tier}} in {{remaining}}",paceOnly:"Pace ~{{pace}}",donutTitle:"Usage share by agent",donutDescription:"Top agents by token volume this month.",topAgentsTitle:"Top 10 agents",agentCountLabel:"{{count}} agents",trendTitle:"30-day trend",trendDescription:"Daily stacked token usage by top agents.",emptyTitle:"No agents registered yet",emptyDescription:"Register agents to see usage here.",emptyCta:"Register an agent",showMore:"Show more",showLess:"Show less",rank:"Rank",agent:"Agent",share:"Share",trend:"Trend",others:"Others"},jzn={guard:{redirecting:"Redirecting to onboarding..."},common:{stepOf:"Step {{current}} / {{total}}",next:"Next →",prev:"← Back",skip:"Skip",skipS1:"I'll install later",skipS2:"I'll set up later",start:"Get Started →",retry:"Retry",loading:"Loading..."},popup:{title:"Welcome!",description:"Would you like help setting up your AI tools? It only takes 5 minutes.",yes:"Start onboarding",no:"Not now"},s1:{title:"Choose your AI tools",subtitle:"Select the tools you want to use — we'll help you install them.",statusInstalled:"v{{version}} installed",statusNotInstalled:"Not installed",willInstall:"Will install",authLoggedIn:"✓ Logged in",authRequired:"⚠ Login required",authUnknown:"Manual check needed",loadingCards:"Checking tools...",errorTitle:"Failed to check tools",errorDesc:"Would you like to try again?",noToolsSelected:"Please select at least one tool",descClaude:"AI coding assistant by Anthropic",descCodex:"Terminal coding agent by OpenAI",descGemini:"AI development assistant by Google",descCopilot:"AI pair programmer by GitHub",descOpencode:"Open-source AI coding assistant"},s2:{title:"Setting up your AI tools",subtitle:"Installing and logging in to your selected tools",installStarting:"Starting installation...",installOk:"installed",loginWaiting:"Waiting for {{name}} login... Please authenticate in your browser.",loginOk:"logged in",loginSkipped:"Login skipped",setupLog:"Setup log",waitingForSetup:"Preparing setup...",statusInstalling:"⏳ Installing...",statusInstalled:"Installed",statusLoggingIn:"Logging in...",statusComplete:"Done",statusFailed:"Install failed"},bubble:{welcome:"Hello! Please wait a moment",tip1:"CrewX manages multiple AIs as a single team.",tip2:"Assigning roles to agents improves efficiency.",tip3:"You can start right away once login is complete!"}},Dzn={title:"Workflows",totalCount:"{{count}} workflows",searchPlaceholder:"Search by ID, name, or description...",clearSearch:"Clear search",bannerTitle:"This is an automation recipe where multiple AI teammates work in sequence.",bannerBody:"Type /wf in the chat box to use it right away.",startChat:"Start chat",runWorkflow:"Run",startChatTooltip:"/wf {{id}}",refresh:"Refresh",retry:"Retry",pageError:"Something went wrong while rendering the workflow screen.",errorsTitle:"{{count}} workflows could not be loaded",errorItem:"{{file}}: {{reason}}",emptyTitle:"No workflows yet",emptyDescription:"Workflows define how AI agents collaborate in sequence.",emptyAction:"Ask your team developer to configure a workflow.",emptyFilteredTitle:"No matching workflows",emptyFilteredDescription:"Try a different ID, name, description, or agent name.",metadataAgents:"Agents",metadataNodes:"Nodes",metadataTimeout:"Timeout",metadataMaxIterations:"Max iterations",timeoutMinutes:"{{count}} min",iterationCount:"{{count}} times",noLimit:"None",diagramLoading:"Rendering diagram...",diagramError:"Failed to render the diagram.",sourcePath:"Source path: {{path}}",stateVariablesTitle:"State Variables",mentionLabel:"Workflow suggestions",noSuggestions:"No suggestions available.",selectedLabel:"/wf {{id}}",graph:{readonly:"Read-only",generated:"Generated from YAML",descriptionFallback:"This workflow is generated from its YAML definition and can be inspected here without editing nodes.",detailsTitle:"Node details",legendTitle:"Legend",sourceTitle:"Source",sourceFile:"Source file",contract:"Contract",readonlyContract:"This view is for inspection only. Edit workflows in YAML and start runs from chat.",nodeId:"Node ID",nodeType:"Type",agent:"Agent",description:"Description",input:"Input",condition:"Condition",if:"If",noNodeSelected:"Select a node to inspect its definition.",noStateVariables:"State variables are defined while the workflow runs.",layouting:"Arranging workflow map...",mermaidFallback:"Mermaid fallback",closePanel:"Close"}},Izn={autoDefault:"Default: auto",noCurrentNode:"Waiting to start",approvalHint:"Auto execution paused at an approval point. Approve it to continue to the next node.",approval:{title:"Approval request",fallbackQuestion:"Run the next step of this workflow?",approvePath:"Approve:",rejectPath:"Reject:"},lastAudit:"Last run: {{node}} · {{duration}}ms",approve:"Approve",reject:"Reject",refresh:"Refresh",started:"Started {{id}} workflow.",startFailed:"Workflow start failed: {{message}}",refreshFailed:"Workflow refresh failed: {{message}}",approveFailed:"Workflow approval failed: {{message}}",rejectFailed:"Workflow rejection failed: {{message}}",cancelFailed:"Workflow stop failed: {{message}}",stop:"Stop",cancelledHint:"The workflow run was stopped by the user.",loadingCard:"Loading workflow run status...",unverifiedCard:"This workflow card is not verified.",expiredCard:{title:"Workflow card expired",description:"This card expired after 7 days. Run /wf {{id}} again to start a fresh workflow."},state:{title:"State",keyCount:"{{count}} keys",empty:"No state has been saved yet."},timeline:{title:"Execution timeline",summary:"{{completed}} steps completed",count:"{{visible}} reached",collapsed:"Timeline collapsed · {{completed}} steps completed",status:{pending:"Pending",current:"Running",waiting_approval:"Waiting approval",paused:"Paused",completed:"Completed",failed:"Failed",cancelled:"Stopped"}},nodeType:{agent_task:"Agent task",skill_task:"Skill task",shell_task:"Shell task",branch:"Branch",parallel:"Parallel",join:"Join",expression:"Expression",approval:"Approval",end:"End",error:"Error"},phase:{not_started:"Starting",running:"Running",waiting_approval:"Waiting approval",paused:"Paused",completed:"Completed",failed:"Failed",cancelled:"Stopped"}},Ozn={title:"CLI Version Manager",subtitle:"Check, install, and update AI CLI tools",actions:{refresh:"Refresh",install:"Install",update:"Update",openDocs:"Open {{name}} documentation",openSignup:"Open {{name}} service page"},status:{checking:"Checking...",installing:"Installing...",updating:"Updating...",installed:"Installed",notInstalled:"Not installed",pending:"Pending",error:"Error"},version:{selectLabel:"Select version for {{name}}",latestOption:"latest",latestVersion:"latest: v{{version}}"},terminal:{waiting:"Waiting for CLI checks...",processing:"Processing..."},messages:{allUpToDate:"All CLIs are up to date",someFailed:"Some installations failed",crewxUnavailable:"CrewX CLI is required before opening this page.",crewxUpdateHint:"Update in the terminal with npm i -g crewx@latest"},logs:{checkingVersions:"Checking CLI versions...",checkComplete:"Check complete. Review each CLI and continue.",checkFailed:"Failed to check CLI versions: {{message}}",crewxDetected:"CrewX CLI v{{version}} detected.",crewxUpdateAvailable:"CrewX CLI v{{current}} → v{{latest}} (update available)",cliUpToDate:"{{name}} v{{version}} is up to date.",cliUpdateAvailable:"{{name}} v{{current}} → v{{latest}} (update available)",cliNotInstalled:"{{name}} is not installed.",installing:"Installing {{name}} ({{version}})...",updating:"Updating {{name}} ({{version}})...",installSuccess:"{{name}} installed successfully (v{{version}}).",updateSuccess:"{{name}} updated successfully (v{{version}}).",actionFailed:"Failed to {{action}} {{name}}: {{message}}",crewxNotInstalled:"CrewX CLI is not installed globally."}},Lzn={settings:KBn,threadDetail:JBn,markdownEditor:YBn,taskDetail:XBn,chatInput:QBn,cliData:ZBn,agent:ezn,wbs:tzn,docs:nzn,nav:rzn,planner:izn,cron:szn,goal:ozn,market:azn,memory:lzn,knowledge:czn,graph:uzn,projectDetail:dzn,mermaidFullscreen:fzn,common:hzn,auth:pzn,workspace:gzn,dirPicker:mzn,limits:bzn,beta:wzn,upgrade:yzn,threads:xzn,projects:vzn,tasks:kzn,newTask:Czn,threadNew:Szn,project:Ezn,status:_zn,overlay:Tzn,search:Azn,tier:Mzn,usage:Nzn,onboarding:jzn,workflow:Dzn,workflowRun:Izn,cliManager:Ozn};var Pzn={};const R7t=t=>{let n;const i=new Set,o=(x,v)=>{const C=typeof x=="function"?x(n):x;if(!Object.is(C,n)){const E=n;n=v??(typeof C!="object"||C===null)?C:Object.assign({},n,C),i.forEach(A=>A(n,E))}},a=()=>n,g={setState:o,getState:a,getInitialState:()=>w,subscribe:x=>(i.add(x),()=>i.delete(x)),destroy:()=>{(Pzn?"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."),i.clear()}},w=n=t(o,a,g);return g},OKt=t=>t?R7t(t):R7t;var LKt={exports:{}},PKt={},RKt={exports:{}},$Kt={};/**
|
|
49
49
|
* @license React
|
|
50
50
|
* use-sync-external-store-shim.production.min.js
|
|
51
51
|
*
|
|
@@ -888,8 +888,8 @@ res:`,Ri.polygon(n,w,C)),Ri.polygon(n,w,C)},a}pe(yrn,"question");async function
|
|
|
888
888
|
M${x},${v-w} L${x},${v+g}`;n.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const D=E.path(I,A),P=a.insert(()=>D,":first-child");return P.attr("transform",`translate(${w/2}, ${w/2})`),P.attr("class","basic label-container"),C&&n.look!=="handDrawn"&&P.selectAll("path").attr("style",C),o&&n.look!=="handDrawn"&&P.selectAll("path").attr("style",o),u.attr("transform",`translate(${-(c.width/2)+w/2-(c.x-(c.left??0))}, ${-(c.height/2)+w/2-(c.y-(c.top??0))})`),ss(n,P),n.intersect=function(R){return Ri.polygon(n,M,R)},a}pe(Brn,"windowPane");async function zrn(t,n,i,o,a=i.class.padding??12){const c=o?0:3,u=t.insert("g").attr("class",Ys(n)).attr("id",n.domId||n.id);let f=null,g=null,w=null,x=null,v=0,C=0,E=0;if(f=u.insert("g").attr("class","annotation-group text"),n.annotations.length>0){const P=n.annotations[0];await gV(f,{text:`«${P}»`},0),v=f.node().getBBox().height}g=u.insert("g").attr("class","label-group text"),await gV(g,n,0,["font-weight: bolder"]);const A=g.node().getBBox();C=A.height,w=u.insert("g").attr("class","members-group text");let M=0;for(const P of n.members){const R=await gV(w,P,M,[P.parseClassifier()]);M+=R+c}E=w.node().getBBox().height,E<=0&&(E=a/2),x=u.insert("g").attr("class","methods-group text");let I=0;for(const P of n.methods){const R=await gV(x,P,I,[P.parseClassifier()]);I+=R+c}let D=u.node().getBBox();if(f!==null){const P=f.node().getBBox();f.attr("transform",`translate(${-P.width/2})`)}return g.attr("transform",`translate(${-A.width/2}, ${v})`),D=u.node().getBBox(),w.attr("transform",`translate(0, ${v+C+a*2})`),D=u.node().getBBox(),x.attr("transform",`translate(0, ${v+C+(E?E+a*4:a*2)})`),D=u.node().getBBox(),{shapeSvg:u,bbox:D}}pe(zrn,"textHelper");async function gV(t,n,i,o=[]){const a=t.insert("g").attr("class","label").attr("style",o.join("; ")),c=Qv();let u="useHtmlLabels"in n?n.useHtmlLabels:kg(c.htmlLabels)??!0,f="";"text"in n?f=n.text:f=n.label,!u&&f.startsWith("\\")&&(f=f.substring(1)),H7(f)&&(u=!0);const g=await DR(a,eZt(jR(f)),{width:V7(f,c)+50,classes:"markdown-node-label",useHtmlLabels:u},c);let w,x=1;if(u){const v=g.children[0],C=xo(g);x=v.innerHTML.split("<br>").length,v.innerHTML.includes("</math>")&&(x+=v.innerHTML.split("<mrow>").length-1);const E=v.getElementsByTagName("img");if(E){const A=f.replace(/<img[^>]*>/g,"").trim()==="";await Promise.all([...E].map(M=>new Promise(I=>{function D(){var P;if(M.style.display="flex",M.style.flexDirection="column",A){const R=((P=c.fontSize)==null?void 0:P.toString())??window.getComputedStyle(document.body).fontSize,U=parseInt(R,10)*5+"px";M.style.minWidth=U,M.style.maxWidth=U}else M.style.width="100%";I(M)}pe(D,"setupImage"),setTimeout(()=>{M.complete&&D()}),M.addEventListener("error",D),M.addEventListener("load",D)})))}w=v.getBoundingClientRect(),C.attr("width",w.width),C.attr("height",w.height)}else{o.includes("font-weight: bolder")&&xo(g).selectAll("tspan").attr("font-weight",""),x=g.children.length;const v=g.children[0];(g.textContent===""||g.textContent.includes(">"))&&(v.textContent=f[0]+f.substring(1).replaceAll(">",">").replaceAll("<","<").trim(),f[1]===" "&&(v.textContent=v.textContent[0]+" "+v.textContent.substring(1))),v.textContent==="undefined"&&(v.textContent=""),w=g.getBBox()}return a.attr("transform","translate(0,"+(-w.height/(2*x)+i)+")"),w.height}pe(gV,"addText");async function Hrn(t,n){var te,Q;const i=Pl(),o=i.class.padding??12,a=o,c=n.useHtmlLabels??kg(i.htmlLabels)??!0,u=n;u.annotations=u.annotations??[],u.members=u.members??[],u.methods=u.methods??[];const{shapeSvg:f,bbox:g}=await zrn(t,n,i,c,a),{labelStyles:w,nodeStyles:x}=as(n);n.labelStyle=w,n.cssStyles=u.styles||"";const v=((te=u.styles)==null?void 0:te.join(";"))||x||"";n.cssStyles||(n.cssStyles=v.replaceAll("!important","").split(";"));const C=u.members.length===0&&u.methods.length===0&&!((Q=i.class)!=null&&Q.hideEmptyMembersBox),E=qi.svg(f),A=Xi(n,{});n.look!=="handDrawn"&&(A.roughness=0,A.fillStyle="solid");const M=g.width;let I=g.height;u.members.length===0&&u.methods.length===0?I+=a:u.members.length>0&&u.methods.length===0&&(I+=a*2);const D=-M/2,P=-I/2,R=E.rectangle(D-o,P-o-(C?o:u.members.length===0&&u.methods.length===0?-o/2:0),M+2*o,I+2*o+(C?o*2:u.members.length===0&&u.methods.length===0?-o:0),A),z=f.insert(()=>R,":first-child");z.attr("class","basic label-container");const U=z.node().getBBox();f.selectAll(".text").each((se,ce,V)=>{var ge;const ae=xo(V[ce]),de=ae.attr("transform");let ee=0;if(de){const Ae=RegExp(/translate\(([^,]+),([^)]+)\)/).exec(de);Ae&&(ee=parseFloat(Ae[2]))}let ue=ee+P+o-(C?o:u.members.length===0&&u.methods.length===0?-o/2:0);c||(ue-=4);let he=D;(ae.attr("class").includes("label-group")||ae.attr("class").includes("annotation-group"))&&(he=-((ge=ae.node())==null?void 0:ge.getBBox().width)/2||0,f.selectAll("text").each(function(oe,Ae,Te){window.getComputedStyle(Te[Ae]).textAnchor==="middle"&&(he=0)})),ae.attr("transform",`translate(${he}, ${ue})`)});const W=f.select(".annotation-group").node().getBBox().height-(C?o/2:0)||0,G=f.select(".label-group").node().getBBox().height-(C?o/2:0)||0,Y=f.select(".members-group").node().getBBox().height-(C?o/2:0)||0;if(u.members.length>0||u.methods.length>0||C){const se=E.line(U.x,W+G+P+o,U.x+U.width,W+G+P+o,A);f.insert(()=>se).attr("class","divider").attr("style",v)}if(C||u.members.length>0||u.methods.length>0){const se=E.line(U.x,W+G+Y+P+a*2+o,U.x+U.width,W+G+Y+P+o+a*2,A);f.insert(()=>se).attr("class","divider").attr("style",v)}if(u.look!=="handDrawn"&&f.selectAll("path").attr("style",v),z.select(":nth-child(2)").attr("style",v),f.selectAll(".divider").select("path").attr("style",v),n.labelStyle?f.selectAll("span").attr("style",n.labelStyle):f.selectAll("span").attr("style",v),!c){const se=RegExp(/color\s*:\s*([^;]*)/),ce=se.exec(v);if(ce){const V=ce[0].replace("color","fill");f.selectAll("tspan").attr("style",V)}else if(w){const V=se.exec(w);if(V){const ae=V[0].replace("color","fill");f.selectAll("tspan").attr("style",ae)}}}return ss(n,z),n.intersect=function(se){return Ri.rect(n,se)},f}pe(Hrn,"classBox");var hwr=pe(t=>{switch(t){case"Very High":return"red";case"High":return"orange";case"Medium":return null;case"Low":return"blue";case"Very Low":return"lightblue"}},"colorFromPriority");async function Urn(t,n,{config:i}){var ce,V;const{labelStyles:o,nodeStyles:a}=as(n);n.labelStyle=o||"";const c=10,u=n.width;n.width=(n.width??200)-10;const{shapeSvg:f,bbox:g,label:w}=await Js(t,n,Ys(n)),x=n.padding||10;let v="",C;"ticket"in n&&n.ticket&&((ce=i==null?void 0:i.kanban)!=null&&ce.ticketBaseUrl)&&(v=(V=i==null?void 0:i.kanban)==null?void 0:V.ticketBaseUrl.replace("#TICKET#",n.ticket),C=f.insert("svg:a",":first-child").attr("class","kanban-ticket-link").attr("xlink:href",v).attr("target","_blank"));const E={useHtmlLabels:n.useHtmlLabels,labelStyle:n.labelStyle||"",width:n.width,img:n.img,padding:n.padding||8,centerLabel:!1};let A,M;C?{label:A,bbox:M}=await SOe(C,"ticket"in n&&n.ticket||"",E):{label:A,bbox:M}=await SOe(f,"ticket"in n&&n.ticket||"",E);const{label:I,bbox:D}=await SOe(f,"assigned"in n&&n.assigned||"",E);n.width=u;const P=10,R=(n==null?void 0:n.width)||0,z=Math.max(M.height,D.height)/2,U=Math.max(g.height+P*2,(n==null?void 0:n.height)||0)+z,W=-R/2,G=-U/2;w.attr("transform","translate("+(x-R/2)+", "+(-z-g.height/2)+")"),A.attr("transform","translate("+(x-R/2)+", "+(-z+g.height/2)+")"),I.attr("transform","translate("+(x+R/2-D.width-2*c)+", "+(-z+g.height/2)+")");let Y;const{rx:te,ry:Q}=n,{cssStyles:se}=n;if(n.look==="handDrawn"){const ae=qi.svg(f),de=Xi(n,{}),ee=te||Q?ae.path(A5(W,G,R,U,te||0),de):ae.rectangle(W,G,R,U,de);Y=f.insert(()=>ee,":first-child"),Y.attr("class","basic label-container").attr("style",se||null)}else{Y=f.insert("rect",":first-child"),Y.attr("class","basic label-container __APA__").attr("style",a).attr("rx",te??5).attr("ry",Q??5).attr("x",W).attr("y",G).attr("width",R).attr("height",U);const ae="priority"in n&&n.priority;if(ae){const de=f.append("line"),ee=W+2,ue=G+Math.floor((te??0)/2),he=G+U-Math.floor((te??0)/2);de.attr("x1",ee).attr("y1",ue).attr("x2",ee).attr("y2",he).attr("stroke-width","4").attr("stroke",hwr(ae))}}return ss(n,Y),n.height=U,n.intersect=function(ae){return Ri.rect(n,ae)},f}pe(Urn,"kanbanItem");var pwr=[{semanticName:"Process",name:"Rectangle",shortName:"rect",description:"Standard process shape",aliases:["proc","process","rectangle"],internalAliases:["squareRect"],handler:Ern},{semanticName:"Event",name:"Rounded Rectangle",shortName:"rounded",description:"Represents an event",aliases:["event"],internalAliases:["roundedRect"],handler:krn},{semanticName:"Terminal Point",name:"Stadium",shortName:"stadium",description:"Terminal point",aliases:["terminal","pill"],handler:_rn},{semanticName:"Subprocess",name:"Framed Rectangle",shortName:"fr-rect",description:"Subprocess",aliases:["subprocess","subproc","framed-rectangle","subroutine"],handler:Nrn},{semanticName:"Database",name:"Cylinder",shortName:"cyl",description:"Database storage",aliases:["db","database","cylinder"],handler:Jnn},{semanticName:"Start",name:"Circle",shortName:"circle",description:"Starting point",aliases:["circ"],handler:Hnn},{semanticName:"Decision",name:"Diamond",shortName:"diam",description:"Decision-making step",aliases:["decision","diamond","question"],handler:yrn},{semanticName:"Prepare Conditional",name:"Hexagon",shortName:"hex",description:"Preparation or condition step",aliases:["hexagon","prepare"],handler:nrn},{semanticName:"Data Input/Output",name:"Lean Right",shortName:"lean-r",description:"Represents input or output",aliases:["lean-right","in-out"],internalAliases:["lean_right"],handler:frn},{semanticName:"Data Input/Output",name:"Lean Left",shortName:"lean-l",description:"Represents output or input",aliases:["lean-left","out-in"],internalAliases:["lean_left"],handler:drn},{semanticName:"Priority Action",name:"Trapezoid Base Bottom",shortName:"trap-b",description:"Priority action",aliases:["priority","trapezoid-bottom","trapezoid"],handler:Lrn},{semanticName:"Manual Operation",name:"Trapezoid Base Top",shortName:"trap-t",description:"Represents a manual task",aliases:["manual","trapezoid-top","inv-trapezoid"],internalAliases:["inv_trapezoid"],handler:crn},{semanticName:"Stop",name:"Double Circle",shortName:"dbl-circ",description:"Represents a stop point",aliases:["double-circle"],internalAliases:["doublecircle"],handler:Xnn},{semanticName:"Text Block",name:"Text Block",shortName:"text",description:"Text block",handler:Irn},{semanticName:"Card",name:"Notched Rectangle",shortName:"notch-rect",description:"Represents a card",aliases:["card","notched-rectangle"],handler:Bnn},{semanticName:"Lined/Shaded Process",name:"Lined Rectangle",shortName:"lin-rect",description:"Lined process shape",aliases:["lined-rectangle","lined-process","lin-proc","shaded-process"],handler:Crn},{semanticName:"Start",name:"Small Circle",shortName:"sm-circ",description:"Small starting point",aliases:["start","small-circle"],internalAliases:["stateStart"],handler:Mrn},{semanticName:"Stop",name:"Framed Circle",shortName:"fr-circ",description:"Stop point",aliases:["stop","framed-circle"],internalAliases:["stateEnd"],handler:Arn},{semanticName:"Fork/Join",name:"Filled Rectangle",shortName:"fork",description:"Fork or join in process flow",aliases:["join"],internalAliases:["forkJoin"],handler:ern},{semanticName:"Collate",name:"Hourglass",shortName:"hourglass",description:"Represents a collate operation",aliases:["hourglass","collate"],handler:rrn},{semanticName:"Comment",name:"Curly Brace",shortName:"brace",description:"Adds a comment",aliases:["comment","brace-l"],handler:qnn},{semanticName:"Comment Right",name:"Curly Brace",shortName:"brace-r",description:"Adds a comment",handler:Gnn},{semanticName:"Comment with braces on both sides",name:"Curly Braces",shortName:"braces",description:"Adds a comment",handler:Vnn},{semanticName:"Com Link",name:"Lightning Bolt",shortName:"bolt",description:"Communication link",aliases:["com-link","lightning-bolt"],handler:hrn},{semanticName:"Document",name:"Document",shortName:"doc",description:"Represents a document",aliases:["doc","document"],handler:$rn},{semanticName:"Delay",name:"Half-Rounded Rectangle",shortName:"delay",description:"Represents a delay",aliases:["half-rounded-rectangle"],handler:trn},{semanticName:"Direct Access Storage",name:"Horizontal Cylinder",shortName:"h-cyl",description:"Direct access storage",aliases:["das","horizontal-cylinder"],handler:Orn},{semanticName:"Disk Storage",name:"Lined Cylinder",shortName:"lin-cyl",description:"Disk storage",aliases:["disk","lined-cylinder"],handler:prn},{semanticName:"Display",name:"Curved Trapezoid",shortName:"curv-trap",description:"Represents a display",aliases:["curved-trapezoid","display"],handler:Knn},{semanticName:"Divided Process",name:"Divided Rectangle",shortName:"div-rect",description:"Divided process shape",aliases:["div-proc","divided-rectangle","divided-process"],handler:Ynn},{semanticName:"Extract",name:"Triangle",shortName:"tri",description:"Extraction process",aliases:["extract","triangle"],handler:Rrn},{semanticName:"Internal Storage",name:"Window Pane",shortName:"win-pane",description:"Internal storage",aliases:["internal-storage","window-pane"],handler:Brn},{semanticName:"Junction",name:"Filled Circle",shortName:"f-circ",description:"Junction point",aliases:["junction","filled-circle"],handler:Qnn},{semanticName:"Loop Limit",name:"Trapezoidal Pentagon",shortName:"notch-pent",description:"Loop limit step",aliases:["loop-limit","notched-pentagon"],handler:Prn},{semanticName:"Manual File",name:"Flipped Triangle",shortName:"flip-tri",description:"Manual file operation",aliases:["manual-file","flipped-triangle"],handler:Znn},{semanticName:"Manual Input",name:"Sloped Rectangle",shortName:"sl-rect",description:"Manual input step",aliases:["manual-input","sloped-rectangle"],handler:Srn},{semanticName:"Multi-Document",name:"Stacked Document",shortName:"docs",description:"Multiple documents",aliases:["documents","st-doc","stacked-document"],handler:brn},{semanticName:"Multi-Process",name:"Stacked Rectangle",shortName:"st-rect",description:"Multiple processes",aliases:["procs","processes","stacked-rectangle"],handler:mrn},{semanticName:"Stored Data",name:"Bow Tie Rectangle",shortName:"bow-rect",description:"Stored data",aliases:["stored-data","bow-tie-rectangle"],handler:Fnn},{semanticName:"Summary",name:"Crossed Circle",shortName:"cross-circ",description:"Summary",aliases:["summary","crossed-circle"],handler:Wnn},{semanticName:"Tagged Document",name:"Tagged Document",shortName:"tag-doc",description:"Tagged document",aliases:["tag-doc","tagged-document"],handler:Drn},{semanticName:"Tagged Process",name:"Tagged Rectangle",shortName:"tag-rect",description:"Tagged process",aliases:["tagged-rectangle","tag-proc","tagged-process"],handler:jrn},{semanticName:"Paper Tape",name:"Flag",shortName:"flag",description:"Paper tape",aliases:["paper-tape"],handler:Frn},{semanticName:"Odd",name:"Odd",shortName:"odd",description:"Odd shape",internalAliases:["rect_left_inv_arrow"],handler:xrn},{semanticName:"Lined Document",name:"Lined Document",shortName:"lin-doc",description:"Lined document",aliases:["lined-document"],handler:grn}],gwr=pe(()=>{const n=[...Object.entries({state:Trn,choice:znn,note:wrn,rectWithTitle:vrn,labelRect:urn,iconSquare:arn,iconCircle:srn,icon:irn,iconRounded:orn,imageSquare:lrn,anchor:$nn,kanbanItem:Urn,classBox:Hrn}),...pwr.flatMap(i=>[i.shortName,..."aliases"in i?i.aliases:[],..."internalAliases"in i?i.internalAliases:[]].map(a=>[a,i.handler]))];return Object.fromEntries(n)},"generateShapeMap"),Wrn=gwr();function mwr(t){return t in Wrn}pe(mwr,"isValidShape");var I0e=new Map;async function qrn(t,n,i){let o,a;n.shape==="rect"&&(n.rx&&n.ry?n.shape="roundedRect":n.shape="squareRect");const c=n.shape?Wrn[n.shape]:void 0;if(!c)throw new Error(`No such shape: ${n.shape}. Please check your syntax.`);if(n.link){let u;i.config.securityLevel==="sandbox"?u="_top":n.linkTarget&&(u=n.linkTarget||"_blank"),o=t.insert("svg:a").attr("xlink:href",n.link).attr("target",u??null),a=await c(o,n,i)}else a=await c(t,n,i),o=a;return n.tooltip&&a.attr("title",n.tooltip),I0e.set(n.id,o),n.haveCallback&&o.attr("class",o.attr("class")+" clickable"),o}pe(qrn,"insertNode");var kWr=pe((t,n)=>{I0e.set(n.id,t)},"setNodeElem"),CWr=pe(()=>{I0e.clear()},"clear"),SWr=pe(t=>{const n=I0e.get(t.id);Pn.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const i=8,o=t.diff||0;return t.clusterNode?n.attr("transform","translate("+(t.x+o-t.width/2)+", "+(t.y-t.height/2-i)+")"):n.attr("transform","translate("+t.x+", "+t.y+")"),o},"positionNode"),ix={aggregation:18,extension:18,composition:18,dependency:6,lollipop:13.5,arrow_point:4};function mV(t,n){if(t===void 0||n===void 0)return{angle:0,deltaX:0,deltaY:0};t=Hu(t),n=Hu(n);const[i,o]=[t.x,t.y],[a,c]=[n.x,n.y],u=a-i,f=c-o;return{angle:Math.atan(f/u),deltaX:u,deltaY:f}}pe(mV,"calculateDeltaAndAngle");var Hu=pe(t=>Array.isArray(t)?{x:t[0],y:t[1]}:t,"pointTransformer"),bwr=pe(t=>({x:pe(function(n,i,o){let a=0;const c=Hu(o[0]).x<Hu(o[o.length-1]).x?"left":"right";if(i===0&&Object.hasOwn(ix,t.arrowTypeStart)){const{angle:E,deltaX:A}=mV(o[0],o[1]);a=ix[t.arrowTypeStart]*Math.cos(E)*(A>=0?1:-1)}else if(i===o.length-1&&Object.hasOwn(ix,t.arrowTypeEnd)){const{angle:E,deltaX:A}=mV(o[o.length-1],o[o.length-2]);a=ix[t.arrowTypeEnd]*Math.cos(E)*(A>=0?1:-1)}const u=Math.abs(Hu(n).x-Hu(o[o.length-1]).x),f=Math.abs(Hu(n).y-Hu(o[o.length-1]).y),g=Math.abs(Hu(n).x-Hu(o[0]).x),w=Math.abs(Hu(n).y-Hu(o[0]).y),x=ix[t.arrowTypeStart],v=ix[t.arrowTypeEnd],C=1;if(u<v&&u>0&&f<v){let E=v+C-u;E*=c==="right"?-1:1,a-=E}if(g<x&&g>0&&w<x){let E=x+C-g;E*=c==="right"?-1:1,a+=E}return Hu(n).x+a},"x"),y:pe(function(n,i,o){let a=0;const c=Hu(o[0]).y<Hu(o[o.length-1]).y?"down":"up";if(i===0&&Object.hasOwn(ix,t.arrowTypeStart)){const{angle:E,deltaY:A}=mV(o[0],o[1]);a=ix[t.arrowTypeStart]*Math.abs(Math.sin(E))*(A>=0?1:-1)}else if(i===o.length-1&&Object.hasOwn(ix,t.arrowTypeEnd)){const{angle:E,deltaY:A}=mV(o[o.length-1],o[o.length-2]);a=ix[t.arrowTypeEnd]*Math.abs(Math.sin(E))*(A>=0?1:-1)}const u=Math.abs(Hu(n).y-Hu(o[o.length-1]).y),f=Math.abs(Hu(n).x-Hu(o[o.length-1]).x),g=Math.abs(Hu(n).y-Hu(o[0]).y),w=Math.abs(Hu(n).x-Hu(o[0]).x),x=ix[t.arrowTypeStart],v=ix[t.arrowTypeEnd],C=1;if(u<v&&u>0&&f<v){let E=v+C-u;E*=c==="up"?-1:1,a-=E}if(g<x&&g>0&&w<x){let E=x+C-g;E*=c==="up"?-1:1,a+=E}return Hu(n).y+a},"y")}),"getLineFunctionsWithOffset"),wwr=pe((t,n,i,o,a)=>{n.arrowTypeStart&&azt(t,"start",n.arrowTypeStart,i,o,a),n.arrowTypeEnd&&azt(t,"end",n.arrowTypeEnd,i,o,a)},"addEdgeMarkers"),ywr={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},azt=pe((t,n,i,o,a,c)=>{const u=ywr[i];if(!u){Pn.warn(`Unknown arrow type: ${i}`);return}const f=n==="start"?"Start":"End";t.attr(`marker-${n}`,`url(${o}#${a}_${c}-${u}${f})`)},"addEdgeMarker"),upe=new Map,dg=new Map,EWr=pe(()=>{upe.clear(),dg.clear()},"clear"),BG=pe(t=>t?t.reduce((i,o)=>i+";"+o,""):"","getLabelStyles"),xwr=pe(async(t,n)=>{let i=kg(Pl().flowchart.htmlLabels);const o=await DR(t,n.label,{style:BG(n.labelStyle),useHtmlLabels:i,addSvgBackground:!0,isNode:!1});Pn.info("abc82",n,n.labelType);const a=t.insert("g").attr("class","edgeLabel"),c=a.insert("g").attr("class","label");c.node().appendChild(o);let u=o.getBBox();if(i){const g=o.children[0],w=xo(o);u=g.getBoundingClientRect(),w.attr("width",u.width),w.attr("height",u.height)}c.attr("transform","translate("+-u.width/2+", "+-u.height/2+")"),upe.set(n.id,a),n.width=u.width,n.height=u.height;let f;if(n.startLabelLeft){const g=await $D(n.startLabelLeft,BG(n.labelStyle)),w=t.insert("g").attr("class","edgeTerminals"),x=w.insert("g").attr("class","inner");f=x.node().appendChild(g);const v=g.getBBox();x.attr("transform","translate("+-v.width/2+", "+-v.height/2+")"),dg.get(n.id)||dg.set(n.id,{}),dg.get(n.id).startLeft=w,bV(f,n.startLabelLeft)}if(n.startLabelRight){const g=await $D(n.startLabelRight,BG(n.labelStyle)),w=t.insert("g").attr("class","edgeTerminals"),x=w.insert("g").attr("class","inner");f=w.node().appendChild(g),x.node().appendChild(g);const v=g.getBBox();x.attr("transform","translate("+-v.width/2+", "+-v.height/2+")"),dg.get(n.id)||dg.set(n.id,{}),dg.get(n.id).startRight=w,bV(f,n.startLabelRight)}if(n.endLabelLeft){const g=await $D(n.endLabelLeft,BG(n.labelStyle)),w=t.insert("g").attr("class","edgeTerminals"),x=w.insert("g").attr("class","inner");f=x.node().appendChild(g);const v=g.getBBox();x.attr("transform","translate("+-v.width/2+", "+-v.height/2+")"),w.node().appendChild(g),dg.get(n.id)||dg.set(n.id,{}),dg.get(n.id).endLeft=w,bV(f,n.endLabelLeft)}if(n.endLabelRight){const g=await $D(n.endLabelRight,BG(n.labelStyle)),w=t.insert("g").attr("class","edgeTerminals"),x=w.insert("g").attr("class","inner");f=x.node().appendChild(g);const v=g.getBBox();x.attr("transform","translate("+-v.width/2+", "+-v.height/2+")"),w.node().appendChild(g),dg.get(n.id)||dg.set(n.id,{}),dg.get(n.id).endRight=w,bV(f,n.endLabelRight)}return o},"insertEdgeLabel");function bV(t,n){Pl().flowchart.htmlLabels&&t&&(t.style.width=n.length*9+"px",t.style.height="12px")}pe(bV,"setTerminalWidth");var vwr=pe((t,n)=>{Pn.debug("Moving label abc88 ",t.id,t.label,upe.get(t.id),n);let i=n.updatedPath?n.updatedPath:n.originalPath;const o=Pl(),{subGraphTitleTotalMargin:a}=GBe(o);if(t.label){const c=upe.get(t.id);let u=t.x,f=t.y;if(i){const g=nC.calcLabelPosition(i);Pn.debug("Moving label "+t.label+" from (",u,",",f,") to (",g.x,",",g.y,") abc88"),n.updatedPath&&(u=g.x,f=g.y)}c.attr("transform",`translate(${u}, ${f+a/2})`)}if(t.startLabelLeft){const c=dg.get(t.id).startLeft;let u=t.x,f=t.y;if(i){const g=nC.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",i);u=g.x,f=g.y}c.attr("transform",`translate(${u}, ${f})`)}if(t.startLabelRight){const c=dg.get(t.id).startRight;let u=t.x,f=t.y;if(i){const g=nC.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",i);u=g.x,f=g.y}c.attr("transform",`translate(${u}, ${f})`)}if(t.endLabelLeft){const c=dg.get(t.id).endLeft;let u=t.x,f=t.y;if(i){const g=nC.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",i);u=g.x,f=g.y}c.attr("transform",`translate(${u}, ${f})`)}if(t.endLabelRight){const c=dg.get(t.id).endRight;let u=t.x,f=t.y;if(i){const g=nC.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",i);u=g.x,f=g.y}c.attr("transform",`translate(${u}, ${f})`)}},"positionEdgeLabel"),kwr=pe((t,n)=>{const i=t.x,o=t.y,a=Math.abs(n.x-i),c=Math.abs(n.y-o),u=t.width/2,f=t.height/2;return a>=u||c>=f},"outsideNode"),Cwr=pe((t,n,i)=>{Pn.debug(`intersection calc abc89:
|
|
889
889
|
outsidePoint: ${JSON.stringify(n)}
|
|
890
890
|
insidePoint : ${JSON.stringify(i)}
|
|
891
|
-
node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const o=t.x,a=t.y,c=Math.abs(o-i.x),u=t.width/2;let f=i.x<n.x?u-c:u+c;const g=t.height/2,w=Math.abs(n.y-i.y),x=Math.abs(n.x-i.x);if(Math.abs(a-n.y)*u>Math.abs(o-n.x)*g){let v=i.y<n.y?n.y-g-a:a-g-n.y;f=x*v/w;const C={x:i.x<n.x?i.x+f:i.x-x+f,y:i.y<n.y?i.y+w-v:i.y-w+v};return f===0&&(C.x=n.x,C.y=n.y),x===0&&(C.x=n.x),w===0&&(C.y=n.y),Pn.debug(`abc89 top/bottom calc, Q ${w}, q ${v}, R ${x}, r ${f}`,C),C}else{i.x<n.x?f=n.x-u-o:f=o-u-n.x;let v=w*f/x,C=i.x<n.x?i.x+x-f:i.x-x+f,E=i.y<n.y?i.y+v:i.y-v;return Pn.debug(`sides calc abc89, Q ${w}, q ${v}, R ${x}, r ${f}`,{_x:C,_y:E}),f===0&&(C=n.x,E=n.y),x===0&&(C=n.x),w===0&&(E=n.y),{x:C,y:E}}},"intersection"),lzt=pe((t,n)=>{Pn.warn("abc88 cutPathAtIntersect",t,n);let i=[],o=t[0],a=!1;return t.forEach(c=>{if(Pn.info("abc88 checking point",c,n),!kwr(n,c)&&!a){const u=Cwr(n,o,c);Pn.debug("abc88 inside",c,o,u),Pn.debug("abc88 intersection",u,n);let f=!1;i.forEach(g=>{f=f||g.x===u.x&&g.y===u.y}),i.some(g=>g.x===u.x&&g.y===u.y)?Pn.warn("abc88 no intersect",u,i):i.push(u),a=!0}else Pn.warn("abc88 outside",c,o),o=c,a||i.push(c)}),Pn.debug("returning points",i),i},"cutPathAtIntersect");function Grn(t){const n=[],i=[];for(let o=1;o<t.length-1;o++){const a=t[o-1],c=t[o],u=t[o+1];(a.x===c.x&&c.y===u.y&&Math.abs(c.x-u.x)>5&&Math.abs(c.y-a.y)>5||a.y===c.y&&c.x===u.x&&Math.abs(c.x-a.x)>5&&Math.abs(c.y-u.y)>5)&&(n.push(c),i.push(o))}return{cornerPoints:n,cornerPointPositions:i}}pe(Grn,"extractCornerPoints");var czt=pe(function(t,n,i){const o=n.x-t.x,a=n.y-t.y,c=Math.sqrt(o*o+a*a),u=i/c;return{x:n.x-u*o,y:n.y-u*a}},"findAdjacentPoint"),Swr=pe(function(t){const{cornerPointPositions:n}=Grn(t),i=[];for(let o=0;o<t.length;o++)if(n.includes(o)){const a=t[o-1],c=t[o+1],u=t[o],f=czt(a,u,5),g=czt(c,u,5),w=g.x-f.x,x=g.y-f.y;i.push(f);const v=Math.sqrt(2)*2;let C={x:u.x,y:u.y};if(Math.abs(c.x-a.x)>10&&Math.abs(c.y-a.y)>=10){Pn.debug("Corner point fixing",Math.abs(c.x-a.x),Math.abs(c.y-a.y));const E=5;u.x===f.x?C={x:w<0?f.x-E+v:f.x+E-v,y:x<0?f.y-v:f.y+v}:C={x:w<0?f.x-v:f.x+v,y:x<0?f.y-E+v:f.y+E-v}}else Pn.debug("Corner point skipping fixing",Math.abs(c.x-a.x),Math.abs(c.y-a.y));i.push(C,g)}else i.push(t[o]);return i},"fixCorners"),Ewr=pe(function(t,n,i,o,a,c,u){const{handDrawnSeed:f}=Pl();let g=n.points,w=!1;const x=a;var v=c;v.intersect&&x.intersect&&(g=g.slice(1,n.points.length-1),g.unshift(x.intersect(g[0])),Pn.debug("Last point APA12",n.start,"-->",n.end,g[g.length-1],v,v.intersect(g[g.length-1])),g.push(v.intersect(g[g.length-1]))),n.toCluster&&(Pn.info("to cluster abc88",i.get(n.toCluster)),g=lzt(n.points,i.get(n.toCluster).node),w=!0),n.fromCluster&&(Pn.debug("from cluster abc88",i.get(n.fromCluster),JSON.stringify(g,null,2)),g=lzt(g.reverse(),i.get(n.fromCluster).node).reverse(),w=!0);let C=g.filter(G=>!Number.isNaN(G.y));C=Swr(C);let E=wtn;n.curve&&(E=n.curve);const{x:A,y:M}=bwr(n),I=_gr().x(A).y(M).curve(E);let D;switch(n.thickness){case"normal":D="edge-thickness-normal";break;case"thick":D="edge-thickness-thick";break;case"invisible":D="edge-thickness-invisible";break;default:D="edge-thickness-normal"}switch(n.pattern){case"solid":D+=" edge-pattern-solid";break;case"dotted":D+=" edge-pattern-dotted";break;case"dashed":D+=" edge-pattern-dashed";break;default:D+=" edge-pattern-solid"}let P,R=I(C);const z=Array.isArray(n.style)?n.style:[n.style];if(n.look==="handDrawn"){const G=qi.svg(t);Object.assign([],C);const Y=G.path(R,{roughness:.3,seed:f});D+=" transition",P=xo(Y).select("path").attr("id",n.id).attr("class"," "+D+(n.classes?" "+n.classes:"")).attr("style",z?z.reduce((Q,se)=>Q+";"+se,""):"");let te=P.attr("d");P.attr("d",te),t.node().appendChild(P.node())}else P=t.append("path").attr("d",R).attr("id",n.id).attr("class"," "+D+(n.classes?" "+n.classes:"")).attr("style",z?z.reduce((G,Y)=>G+";"+Y,""):"");let U="";(Pl().flowchart.arrowMarkerAbsolute||Pl().state.arrowMarkerAbsolute)&&(U=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,U=U.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),Pn.info("arrowTypeStart",n.arrowTypeStart),Pn.info("arrowTypeEnd",n.arrowTypeEnd),wwr(P,n,U,u,o);let W={};return w&&(W.updatedPath=g),W.originalPath=n.points,W},"insertEdge"),_wr=pe((t,n,i,o)=>{n.forEach(a=>{Pwr[a](t,i,o)})},"insertMarkers"),Twr=pe((t,n,i)=>{Pn.trace("Making markers for ",i),t.append("defs").append("marker").attr("id",i+"_"+n+"-extensionStart").attr("class","marker extension "+n).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",i+"_"+n+"-extensionEnd").attr("class","marker extension "+n).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Awr=pe((t,n,i)=>{t.append("defs").append("marker").attr("id",i+"_"+n+"-compositionStart").attr("class","marker composition "+n).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",i+"_"+n+"-compositionEnd").attr("class","marker composition "+n).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Mwr=pe((t,n,i)=>{t.append("defs").append("marker").attr("id",i+"_"+n+"-aggregationStart").attr("class","marker aggregation "+n).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",i+"_"+n+"-aggregationEnd").attr("class","marker aggregation "+n).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Nwr=pe((t,n,i)=>{t.append("defs").append("marker").attr("id",i+"_"+n+"-dependencyStart").attr("class","marker dependency "+n).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",i+"_"+n+"-dependencyEnd").attr("class","marker dependency "+n).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),jwr=pe((t,n,i)=>{t.append("defs").append("marker").attr("id",i+"_"+n+"-lollipopStart").attr("class","marker lollipop "+n).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",i+"_"+n+"-lollipopEnd").attr("class","marker lollipop "+n).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Dwr=pe((t,n,i)=>{t.append("marker").attr("id",i+"_"+n+"-pointEnd").attr("class","marker "+n).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",i+"_"+n+"-pointStart").attr("class","marker "+n).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Iwr=pe((t,n,i)=>{t.append("marker").attr("id",i+"_"+n+"-circleEnd").attr("class","marker "+n).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",i+"_"+n+"-circleStart").attr("class","marker "+n).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),Owr=pe((t,n,i)=>{t.append("marker").attr("id",i+"_"+n+"-crossEnd").attr("class","marker cross "+n).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",i+"_"+n+"-crossStart").attr("class","marker cross "+n).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),Lwr=pe((t,n,i)=>{t.append("defs").append("marker").attr("id",i+"_"+n+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Pwr={extension:Twr,composition:Awr,aggregation:Mwr,dependency:Nwr,lollipop:jwr,point:Dwr,circle:Iwr,cross:Owr,barb:Lwr},Rwr=_wr,$wr={common:AR,getConfig:Qv,insertCluster:Xbr,insertEdge:Ewr,insertEdgeLabel:xwr,insertMarkers:Rwr,insertNode:qrn,interpolateToCurve:lze,labelHelper:Js,log:Pn,positionEdgeLabel:vwr},QK={},Vrn=pe(t=>{for(const n of t)QK[n.name]=n},"registerLayoutLoaders"),Fwr=pe(()=>{Vrn([{name:"dagre",loader:pe(async()=>await Cl(()=>import("./dagre-4EVJKHTY-BfMCYKXE.js"),__vite__mapDeps([0,1,2])),"loader")}])},"registerDefaultLayoutLoaders");Fwr();var _Wr=pe(async(t,n)=>{if(!(t.layoutAlgorithm in QK))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);const i=QK[t.layoutAlgorithm];return(await i.loader()).render(t,n,$wr,{algorithm:i.algorithm})},"render"),TWr=pe((t="",{fallback:n="dagre"}={})=>{if(t in QK)return t;if(n in QK)return Pn.warn(`Layout algorithm ${t} is not registered. Using ${n} as fallback.`),n;throw new Error(`Both layout algorithms ${t} and ${n} are not registered.`)},"getRegisteredLayoutAlgorithm"),uzt="11.4.1",Bwr=pe(t=>{var a;const{securityLevel:n}=Pl();let i=xo("body");if(n==="sandbox"){const u=((a=xo(`#i${t}`).node())==null?void 0:a.contentDocument)??document;i=xo(u.body)}return i.select(`#${t}`)},"selectSvgElement"),Krn="comm",Jrn="rule",Yrn="decl",zwr="@import",Hwr="@namespace",Uwr="@keyframes",Wwr="@layer",qwr=Math.abs,QV=String.fromCharCode;function Xrn(t){return t.trim()}function cRe(t,n,i){return t.replace(n,i)}function p7(t,n){return t.charCodeAt(n)|0}function K7(t,n,i){return t.slice(n,i)}function Z3(t){return t.length}function Gwr(t){return t.length}function Kue(t,n){return n.push(t),t}var O0e=1,J7=1,Qrn=0,_x=0,uh=0,LR="";function Eze(t,n,i,o,a,c,u,f){return{value:t,root:n,parent:i,type:o,props:a,children:c,line:O0e,column:J7,length:u,return:"",siblings:f}}function Vwr(){return uh}function Kwr(){return uh=_x>0?p7(LR,--_x):0,J7--,uh===10&&(J7=1,O0e--),uh}function Vv(){return uh=_x<Qrn?p7(LR,_x++):0,J7++,uh===10&&(J7=1,O0e++),uh}function l6(){return p7(LR,_x)}function pfe(){return _x}function L0e(t,n){return K7(LR,t,n)}function ZK(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Jwr(t){return O0e=J7=1,Qrn=Z3(LR=t),_x=0,[]}function Ywr(t){return LR="",t}function EOe(t){return Xrn(L0e(_x-1,uRe(t===91?t+2:t===40?t+1:t)))}function Xwr(t){for(;(uh=l6())&&uh<33;)Vv();return ZK(t)>2||ZK(uh)>3?"":" "}function Qwr(t,n){for(;--n&&Vv()&&!(uh<48||uh>102||uh>57&&uh<65||uh>70&&uh<97););return L0e(t,pfe()+(n<6&&l6()==32&&Vv()==32))}function uRe(t){for(;Vv();)switch(uh){case t:return _x;case 34:case 39:t!==34&&t!==39&&uRe(uh);break;case 40:t===41&&uRe(t);break;case 92:Vv();break}return _x}function Zwr(t,n){for(;Vv()&&t+uh!==57;)if(t+uh===84&&l6()===47)break;return"/*"+L0e(n,_x-1)+"*"+QV(t===47?t:Vv())}function eyr(t){for(;!ZK(l6());)Vv();return L0e(t,_x)}function tyr(t){return Ywr(gfe("",null,null,null,[""],t=Jwr(t),0,[0],t))}function gfe(t,n,i,o,a,c,u,f,g){for(var w=0,x=0,v=u,C=0,E=0,A=0,M=1,I=1,D=1,P=0,R=0,z="",U=a,W=c,G=o,Y=z;I;)switch(A=R,R=Vv()){case 40:A!=108&&p7(Y,v-1)==58?(P++,Y+="("):Y+=EOe(R);break;case 41:P--,Y+=")";break;case 34:case 39:case 91:Y+=EOe(R);break;case 9:case 10:case 13:case 32:if(P>0){Y+=QV(R);break}Y+=Xwr(A);break;case 92:Y+=Qwr(pfe()-1,7);continue;case 47:switch(l6()){case 42:case 47:Kue(nyr(Zwr(Vv(),pfe()),n,i,g),g),(ZK(A||1)==5||ZK(l6()||1)==5)&&Z3(Y)&&K7(Y,-1,void 0)!==" "&&(Y+=" ");break;default:Y+="/"}break;case 123*M:f[w++]=Z3(Y)*D;case 125*M:case 59:case 0:if(P>0&&R){Y+=QV(R);break}switch(R){case 0:case 125:I=0;case 59+x:D==-1&&(Y=cRe(Y,/\f/g,"")),E>0&&(Z3(Y)-v||M===0)&&Kue(E>32?fzt(Y+";",o,i,v-1,g):fzt(cRe(Y," ","")+";",o,i,v-2,g),g);break;case 59:Y+=";";default:if(Kue(G=dzt(Y,n,i,w,x,a,f,z,U=[],W=[],v,c),c),R===123)if(x===0)gfe(Y,n,G,G,U,c,v,f,W);else{switch(C){case 99:if(p7(Y,3)===110)break;case 108:if(p7(Y,2)===97)break;default:x=0;case 100:case 109:case 115:}x?gfe(t,G,G,o&&Kue(dzt(t,G,G,0,0,a,f,z,a,U=[],v,W),W),a,W,v,f,o?U:W):gfe(Y,G,G,G,[""],W,0,f,W)}}w=x=E=0,M=D=1,z=Y="",v=u;break;case 58:v=1+Z3(Y),E=A;default:if(M<1){if(R==123)--M;else if(R==125&&M++==0&&Kwr()==125)continue}switch(Y+=QV(R),R*M){case 38:D=x>0?1:(Y+="\f",-1);break;case 44:if(P>0)break;f[w++]=(Z3(Y)-1)*D,D=1;break;case 64:l6()===45&&(Y+=EOe(Vv())),C=l6(),x=v=Z3(z=Y+=eyr(pfe())),R++;break;case 45:A===45&&Z3(Y)==2&&(M=0)}}return c}function dzt(t,n,i,o,a,c,u,f,g,w,x,v){for(var C=a-1,E=a===0?c:[""],A=Gwr(E),M=0,I=0,D=0;M<o;++M)for(var P=0,R=K7(t,C+1,C=qwr(I=u[M])),z=t;P<A;++P)(z=Xrn(I>0?E[P]+" "+R:cRe(R,/&\f/g,E[P])))&&(g[D++]=z);return Eze(t,n,i,a===0?Jrn:f,g,w,x,v)}function nyr(t,n,i,o){return Eze(t,n,i,Krn,QV(Vwr()),K7(t,2,-2),0,o)}function fzt(t,n,i,o,a){return Eze(t,n,i,Yrn,K7(t,0,o),K7(t,o+1,-1),o,a)}function dRe(t,n){for(var i="",o=0;o<t.length;o++)i+=n(t[o],o,t,n)||"";return i}function ryr(t,n,i,o){switch(t.type){case Wwr:if(t.children.length)break;case zwr:case Hwr:case Yrn:return t.return=t.return||t.value;case Krn:return"";case Uwr:return t.return=t.value+"{"+dRe(t.children,o)+"}";case Jrn:if(!Z3(t.value=t.props.join(",")))return""}return Z3(i=dRe(t.children,o))?t.return=t.value+"{"+i+"}":""}var iyr=Otn(Object.keys,Object),syr=Object.prototype,oyr=syr.hasOwnProperty;function ayr(t){if(!E0e(t))return iyr(t);var n=[];for(var i in Object(t))oyr.call(t,i)&&i!="constructor"&&n.push(i);return n}var fRe=B9(SC,"DataView"),hRe=B9(SC,"Promise"),pRe=B9(SC,"Set"),gRe=B9(SC,"WeakMap"),hzt="[object Map]",lyr="[object Object]",pzt="[object Promise]",gzt="[object Set]",mzt="[object WeakMap]",bzt="[object DataView]",cyr=F9(fRe),uyr=F9(XK),dyr=F9(hRe),fyr=F9(pRe),hyr=F9(gRe),kD=MR;(fRe&&kD(new fRe(new ArrayBuffer(1)))!=bzt||XK&&kD(new XK)!=hzt||hRe&&kD(hRe.resolve())!=pzt||pRe&&kD(new pRe)!=gzt||gRe&&kD(new gRe)!=mzt)&&(kD=function(t){var n=MR(t),i=n==lyr?t.constructor:void 0,o=i?F9(i):"";if(o)switch(o){case cyr:return bzt;case uyr:return hzt;case dyr:return pzt;case fyr:return gzt;case hyr:return mzt}return n});var pyr="[object Map]",gyr="[object Set]",myr=Object.prototype,byr=myr.hasOwnProperty;function wzt(t){if(t==null)return!0;if(_0e(t)&&(tpe(t)||typeof t=="string"||typeof t.splice=="function"||oze(t)||aze(t)||epe(t)))return!t.length;var n=kD(t);if(n==pyr||n==gyr)return!t.size;if(E0e(t))return!ayr(t).length;for(var i in t)if(byr.call(t,i))return!1;return!0}var Zrn="c4",wyr=pe(t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),yyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./c4Diagram-6F5ED5ID-Ba_Cc5of.js"),__vite__mapDeps([3,4]));return{id:Zrn,diagram:t}},"loader"),xyr={id:Zrn,detector:wyr,loader:yyr},vyr=xyr,ein="flowchart",kyr=pe((t,n)=>{var i,o;return((i=n==null?void 0:n.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"||((o=n==null?void 0:n.flowchart)==null?void 0:o.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),Cyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./flowDiagram-7ASYPVHJ-BsfbSUri.js"),__vite__mapDeps([5,6,7]));return{id:ein,diagram:t}},"loader"),Syr={id:ein,detector:kyr,loader:Cyr},Eyr=Syr,tin="flowchart-v2",_yr=pe((t,n)=>{var i,o,a;return((i=n==null?void 0:n.flowchart)==null?void 0:i.defaultRenderer)==="dagre-d3"?!1:(((o=n==null?void 0:n.flowchart)==null?void 0:o.defaultRenderer)==="elk"&&(n.layout="elk"),/^\s*graph/.test(t)&&((a=n==null?void 0:n.flowchart)==null?void 0:a.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),Tyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./flowDiagram-7ASYPVHJ-BsfbSUri.js"),__vite__mapDeps([5,6,7]));return{id:tin,diagram:t}},"loader"),Ayr={id:tin,detector:_yr,loader:Tyr},Myr=Ayr,nin="er",Nyr=pe(t=>/^\s*erDiagram/.test(t),"detector"),jyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./erDiagram-6RL3IURR-CTF3Vx9w.js"),__vite__mapDeps([8,1,2]));return{id:nin,diagram:t}},"loader"),Dyr={id:nin,detector:Nyr,loader:jyr},Iyr=Dyr,rin="gitGraph",Oyr=pe(t=>/^\s*gitGraph/.test(t),"detector"),Lyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./gitGraphDiagram-NRZ2UAAF-Y2LdSzUs.js"),__vite__mapDeps([9,10,11,12]));return{id:rin,diagram:t}},"loader"),Pyr={id:rin,detector:Oyr,loader:Lyr},Ryr=Pyr,iin="gantt",$yr=pe(t=>/^\s*gantt/.test(t),"detector"),Fyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./ganttDiagram-NTVNEXSI-BmNtoCBX.js"),__vite__mapDeps([13,14,15]));return{id:iin,diagram:t}},"loader"),Byr={id:iin,detector:$yr,loader:Fyr},zyr=Byr,sin="info",Hyr=pe(t=>/^\s*info/.test(t),"detector"),Uyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./infoDiagram-A4XQUW5V-CHgQZgl1.js"),__vite__mapDeps([16,12]));return{id:sin,diagram:t}},"loader"),Wyr={id:sin,detector:Hyr,loader:Uyr},oin="pie",qyr=pe(t=>/^\s*pie/.test(t),"detector"),Gyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./pieDiagram-YF2LJOPJ-SG8yyUQS.js"),__vite__mapDeps([17,10,12,18,19,15]));return{id:oin,diagram:t}},"loader"),Vyr={id:oin,detector:qyr,loader:Gyr},ain="quadrantChart",Kyr=pe(t=>/^\s*quadrantChart/.test(t),"detector"),Jyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./quadrantDiagram-OS5C2QUG-CbLVdWjN.js"),__vite__mapDeps([20,14,15]));return{id:ain,diagram:t}},"loader"),Yyr={id:ain,detector:Kyr,loader:Jyr},Xyr=Yyr,lin="xychart",Qyr=pe(t=>/^\s*xychart-beta/.test(t),"detector"),Zyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./xychartDiagram-6QU3TZC5-uf-9lMPy.js"),__vite__mapDeps([21,15,19,14]));return{id:lin,diagram:t}},"loader"),exr={id:lin,detector:Qyr,loader:Zyr},txr=exr,cin="requirement",nxr=pe(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),rxr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./requirementDiagram-MIRIMTAZ--q6KKZJt.js"),__vite__mapDeps([22,1,2]));return{id:cin,diagram:t}},"loader"),ixr={id:cin,detector:nxr,loader:rxr},sxr=ixr,uin="sequence",oxr=pe(t=>/^\s*sequenceDiagram/.test(t),"detector"),axr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./sequenceDiagram-G6AWOVSC-DbUmmd6U.js"),__vite__mapDeps([23,4,11]));return{id:uin,diagram:t}},"loader"),lxr={id:uin,detector:oxr,loader:axr},cxr=lxr,din="class",uxr=pe((t,n)=>{var i;return((i=n==null?void 0:n.class)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),dxr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./classDiagram-LNE6IOMH-Cyiu-I1c.js"),__vite__mapDeps([24,25,6]));return{id:din,diagram:t}},"loader"),fxr={id:din,detector:uxr,loader:dxr},hxr=fxr,fin="classDiagram",pxr=pe((t,n)=>{var i;return/^\s*classDiagram/.test(t)&&((i=n==null?void 0:n.class)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),gxr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./classDiagram-v2-MQ7JQ4JX-Cyiu-I1c.js"),__vite__mapDeps([26,25,6]));return{id:fin,diagram:t}},"loader"),mxr={id:fin,detector:pxr,loader:gxr},bxr=mxr,hin="state",wxr=pe((t,n)=>{var i;return((i=n==null?void 0:n.state)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),yxr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./stateDiagram-MAYHULR4-2tNTUSMA.js"),__vite__mapDeps([27,28,6,1,2]));return{id:hin,diagram:t}},"loader"),xxr={id:hin,detector:wxr,loader:yxr},vxr=xxr,pin="stateDiagram",kxr=pe((t,n)=>{var i;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((i=n==null?void 0:n.state)==null?void 0:i.defaultRenderer)==="dagre-wrapper")},"detector"),Cxr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./stateDiagram-v2-4JROLMXI-0m7UxY6u.js"),__vite__mapDeps([29,28,6]));return{id:pin,diagram:t}},"loader"),Sxr={id:pin,detector:kxr,loader:Cxr},Exr=Sxr,gin="journey",_xr=pe(t=>/^\s*journey/.test(t),"detector"),Txr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./journeyDiagram-G5WM74LC-hRHcK6hW.js"),__vite__mapDeps([30,4,18]));return{id:gin,diagram:t}},"loader"),Axr={id:gin,detector:_xr,loader:Txr},Mxr=Axr,Nxr=pe((t,n,i)=>{Pn.debug(`rendering svg for syntax error
|
|
892
|
-
`);const o=Bwr(n),a=o.append("g");o.attr("viewBox","0 0 2412 512"),QQt(o,100,512,!0),a.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),a.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),a.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),a.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),a.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),a.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),a.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),a.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${i}`)},"draw"),min={draw:Nxr},jxr=min,Dxr={db:{},renderer:min,parser:{parse:pe(()=>{},"parse")}},Ixr=Dxr,bin="flowchart-elk",Oxr=pe((t,n={})=>{var i;return/^\s*flowchart-elk/.test(t)||/^\s*flowchart|graph/.test(t)&&((i=n==null?void 0:n.flowchart)==null?void 0:i.defaultRenderer)==="elk"?(n.layout="elk",!0):!1},"detector"),Lxr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./flowDiagram-7ASYPVHJ-
|
|
891
|
+
node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const o=t.x,a=t.y,c=Math.abs(o-i.x),u=t.width/2;let f=i.x<n.x?u-c:u+c;const g=t.height/2,w=Math.abs(n.y-i.y),x=Math.abs(n.x-i.x);if(Math.abs(a-n.y)*u>Math.abs(o-n.x)*g){let v=i.y<n.y?n.y-g-a:a-g-n.y;f=x*v/w;const C={x:i.x<n.x?i.x+f:i.x-x+f,y:i.y<n.y?i.y+w-v:i.y-w+v};return f===0&&(C.x=n.x,C.y=n.y),x===0&&(C.x=n.x),w===0&&(C.y=n.y),Pn.debug(`abc89 top/bottom calc, Q ${w}, q ${v}, R ${x}, r ${f}`,C),C}else{i.x<n.x?f=n.x-u-o:f=o-u-n.x;let v=w*f/x,C=i.x<n.x?i.x+x-f:i.x-x+f,E=i.y<n.y?i.y+v:i.y-v;return Pn.debug(`sides calc abc89, Q ${w}, q ${v}, R ${x}, r ${f}`,{_x:C,_y:E}),f===0&&(C=n.x,E=n.y),x===0&&(C=n.x),w===0&&(E=n.y),{x:C,y:E}}},"intersection"),lzt=pe((t,n)=>{Pn.warn("abc88 cutPathAtIntersect",t,n);let i=[],o=t[0],a=!1;return t.forEach(c=>{if(Pn.info("abc88 checking point",c,n),!kwr(n,c)&&!a){const u=Cwr(n,o,c);Pn.debug("abc88 inside",c,o,u),Pn.debug("abc88 intersection",u,n);let f=!1;i.forEach(g=>{f=f||g.x===u.x&&g.y===u.y}),i.some(g=>g.x===u.x&&g.y===u.y)?Pn.warn("abc88 no intersect",u,i):i.push(u),a=!0}else Pn.warn("abc88 outside",c,o),o=c,a||i.push(c)}),Pn.debug("returning points",i),i},"cutPathAtIntersect");function Grn(t){const n=[],i=[];for(let o=1;o<t.length-1;o++){const a=t[o-1],c=t[o],u=t[o+1];(a.x===c.x&&c.y===u.y&&Math.abs(c.x-u.x)>5&&Math.abs(c.y-a.y)>5||a.y===c.y&&c.x===u.x&&Math.abs(c.x-a.x)>5&&Math.abs(c.y-u.y)>5)&&(n.push(c),i.push(o))}return{cornerPoints:n,cornerPointPositions:i}}pe(Grn,"extractCornerPoints");var czt=pe(function(t,n,i){const o=n.x-t.x,a=n.y-t.y,c=Math.sqrt(o*o+a*a),u=i/c;return{x:n.x-u*o,y:n.y-u*a}},"findAdjacentPoint"),Swr=pe(function(t){const{cornerPointPositions:n}=Grn(t),i=[];for(let o=0;o<t.length;o++)if(n.includes(o)){const a=t[o-1],c=t[o+1],u=t[o],f=czt(a,u,5),g=czt(c,u,5),w=g.x-f.x,x=g.y-f.y;i.push(f);const v=Math.sqrt(2)*2;let C={x:u.x,y:u.y};if(Math.abs(c.x-a.x)>10&&Math.abs(c.y-a.y)>=10){Pn.debug("Corner point fixing",Math.abs(c.x-a.x),Math.abs(c.y-a.y));const E=5;u.x===f.x?C={x:w<0?f.x-E+v:f.x+E-v,y:x<0?f.y-v:f.y+v}:C={x:w<0?f.x-v:f.x+v,y:x<0?f.y-E+v:f.y+E-v}}else Pn.debug("Corner point skipping fixing",Math.abs(c.x-a.x),Math.abs(c.y-a.y));i.push(C,g)}else i.push(t[o]);return i},"fixCorners"),Ewr=pe(function(t,n,i,o,a,c,u){const{handDrawnSeed:f}=Pl();let g=n.points,w=!1;const x=a;var v=c;v.intersect&&x.intersect&&(g=g.slice(1,n.points.length-1),g.unshift(x.intersect(g[0])),Pn.debug("Last point APA12",n.start,"-->",n.end,g[g.length-1],v,v.intersect(g[g.length-1])),g.push(v.intersect(g[g.length-1]))),n.toCluster&&(Pn.info("to cluster abc88",i.get(n.toCluster)),g=lzt(n.points,i.get(n.toCluster).node),w=!0),n.fromCluster&&(Pn.debug("from cluster abc88",i.get(n.fromCluster),JSON.stringify(g,null,2)),g=lzt(g.reverse(),i.get(n.fromCluster).node).reverse(),w=!0);let C=g.filter(G=>!Number.isNaN(G.y));C=Swr(C);let E=wtn;n.curve&&(E=n.curve);const{x:A,y:M}=bwr(n),I=_gr().x(A).y(M).curve(E);let D;switch(n.thickness){case"normal":D="edge-thickness-normal";break;case"thick":D="edge-thickness-thick";break;case"invisible":D="edge-thickness-invisible";break;default:D="edge-thickness-normal"}switch(n.pattern){case"solid":D+=" edge-pattern-solid";break;case"dotted":D+=" edge-pattern-dotted";break;case"dashed":D+=" edge-pattern-dashed";break;default:D+=" edge-pattern-solid"}let P,R=I(C);const z=Array.isArray(n.style)?n.style:[n.style];if(n.look==="handDrawn"){const G=qi.svg(t);Object.assign([],C);const Y=G.path(R,{roughness:.3,seed:f});D+=" transition",P=xo(Y).select("path").attr("id",n.id).attr("class"," "+D+(n.classes?" "+n.classes:"")).attr("style",z?z.reduce((Q,se)=>Q+";"+se,""):"");let te=P.attr("d");P.attr("d",te),t.node().appendChild(P.node())}else P=t.append("path").attr("d",R).attr("id",n.id).attr("class"," "+D+(n.classes?" "+n.classes:"")).attr("style",z?z.reduce((G,Y)=>G+";"+Y,""):"");let U="";(Pl().flowchart.arrowMarkerAbsolute||Pl().state.arrowMarkerAbsolute)&&(U=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,U=U.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),Pn.info("arrowTypeStart",n.arrowTypeStart),Pn.info("arrowTypeEnd",n.arrowTypeEnd),wwr(P,n,U,u,o);let W={};return w&&(W.updatedPath=g),W.originalPath=n.points,W},"insertEdge"),_wr=pe((t,n,i,o)=>{n.forEach(a=>{Pwr[a](t,i,o)})},"insertMarkers"),Twr=pe((t,n,i)=>{Pn.trace("Making markers for ",i),t.append("defs").append("marker").attr("id",i+"_"+n+"-extensionStart").attr("class","marker extension "+n).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",i+"_"+n+"-extensionEnd").attr("class","marker extension "+n).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),Awr=pe((t,n,i)=>{t.append("defs").append("marker").attr("id",i+"_"+n+"-compositionStart").attr("class","marker composition "+n).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",i+"_"+n+"-compositionEnd").attr("class","marker composition "+n).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),Mwr=pe((t,n,i)=>{t.append("defs").append("marker").attr("id",i+"_"+n+"-aggregationStart").attr("class","marker aggregation "+n).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",i+"_"+n+"-aggregationEnd").attr("class","marker aggregation "+n).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),Nwr=pe((t,n,i)=>{t.append("defs").append("marker").attr("id",i+"_"+n+"-dependencyStart").attr("class","marker dependency "+n).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",i+"_"+n+"-dependencyEnd").attr("class","marker dependency "+n).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),jwr=pe((t,n,i)=>{t.append("defs").append("marker").attr("id",i+"_"+n+"-lollipopStart").attr("class","marker lollipop "+n).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",i+"_"+n+"-lollipopEnd").attr("class","marker lollipop "+n).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),Dwr=pe((t,n,i)=>{t.append("marker").attr("id",i+"_"+n+"-pointEnd").attr("class","marker "+n).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",i+"_"+n+"-pointStart").attr("class","marker "+n).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),Iwr=pe((t,n,i)=>{t.append("marker").attr("id",i+"_"+n+"-circleEnd").attr("class","marker "+n).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",i+"_"+n+"-circleStart").attr("class","marker "+n).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),Owr=pe((t,n,i)=>{t.append("marker").attr("id",i+"_"+n+"-crossEnd").attr("class","marker cross "+n).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",i+"_"+n+"-crossStart").attr("class","marker cross "+n).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),Lwr=pe((t,n,i)=>{t.append("defs").append("marker").attr("id",i+"_"+n+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),Pwr={extension:Twr,composition:Awr,aggregation:Mwr,dependency:Nwr,lollipop:jwr,point:Dwr,circle:Iwr,cross:Owr,barb:Lwr},Rwr=_wr,$wr={common:AR,getConfig:Qv,insertCluster:Xbr,insertEdge:Ewr,insertEdgeLabel:xwr,insertMarkers:Rwr,insertNode:qrn,interpolateToCurve:lze,labelHelper:Js,log:Pn,positionEdgeLabel:vwr},QK={},Vrn=pe(t=>{for(const n of t)QK[n.name]=n},"registerLayoutLoaders"),Fwr=pe(()=>{Vrn([{name:"dagre",loader:pe(async()=>await Cl(()=>import("./dagre-4EVJKHTY-BJ50i2_m.js"),__vite__mapDeps([0,1,2])),"loader")}])},"registerDefaultLayoutLoaders");Fwr();var _Wr=pe(async(t,n)=>{if(!(t.layoutAlgorithm in QK))throw new Error(`Unknown layout algorithm: ${t.layoutAlgorithm}`);const i=QK[t.layoutAlgorithm];return(await i.loader()).render(t,n,$wr,{algorithm:i.algorithm})},"render"),TWr=pe((t="",{fallback:n="dagre"}={})=>{if(t in QK)return t;if(n in QK)return Pn.warn(`Layout algorithm ${t} is not registered. Using ${n} as fallback.`),n;throw new Error(`Both layout algorithms ${t} and ${n} are not registered.`)},"getRegisteredLayoutAlgorithm"),uzt="11.4.1",Bwr=pe(t=>{var a;const{securityLevel:n}=Pl();let i=xo("body");if(n==="sandbox"){const u=((a=xo(`#i${t}`).node())==null?void 0:a.contentDocument)??document;i=xo(u.body)}return i.select(`#${t}`)},"selectSvgElement"),Krn="comm",Jrn="rule",Yrn="decl",zwr="@import",Hwr="@namespace",Uwr="@keyframes",Wwr="@layer",qwr=Math.abs,QV=String.fromCharCode;function Xrn(t){return t.trim()}function cRe(t,n,i){return t.replace(n,i)}function p7(t,n){return t.charCodeAt(n)|0}function K7(t,n,i){return t.slice(n,i)}function Z3(t){return t.length}function Gwr(t){return t.length}function Kue(t,n){return n.push(t),t}var O0e=1,J7=1,Qrn=0,_x=0,uh=0,LR="";function Eze(t,n,i,o,a,c,u,f){return{value:t,root:n,parent:i,type:o,props:a,children:c,line:O0e,column:J7,length:u,return:"",siblings:f}}function Vwr(){return uh}function Kwr(){return uh=_x>0?p7(LR,--_x):0,J7--,uh===10&&(J7=1,O0e--),uh}function Vv(){return uh=_x<Qrn?p7(LR,_x++):0,J7++,uh===10&&(J7=1,O0e++),uh}function l6(){return p7(LR,_x)}function pfe(){return _x}function L0e(t,n){return K7(LR,t,n)}function ZK(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Jwr(t){return O0e=J7=1,Qrn=Z3(LR=t),_x=0,[]}function Ywr(t){return LR="",t}function EOe(t){return Xrn(L0e(_x-1,uRe(t===91?t+2:t===40?t+1:t)))}function Xwr(t){for(;(uh=l6())&&uh<33;)Vv();return ZK(t)>2||ZK(uh)>3?"":" "}function Qwr(t,n){for(;--n&&Vv()&&!(uh<48||uh>102||uh>57&&uh<65||uh>70&&uh<97););return L0e(t,pfe()+(n<6&&l6()==32&&Vv()==32))}function uRe(t){for(;Vv();)switch(uh){case t:return _x;case 34:case 39:t!==34&&t!==39&&uRe(uh);break;case 40:t===41&&uRe(t);break;case 92:Vv();break}return _x}function Zwr(t,n){for(;Vv()&&t+uh!==57;)if(t+uh===84&&l6()===47)break;return"/*"+L0e(n,_x-1)+"*"+QV(t===47?t:Vv())}function eyr(t){for(;!ZK(l6());)Vv();return L0e(t,_x)}function tyr(t){return Ywr(gfe("",null,null,null,[""],t=Jwr(t),0,[0],t))}function gfe(t,n,i,o,a,c,u,f,g){for(var w=0,x=0,v=u,C=0,E=0,A=0,M=1,I=1,D=1,P=0,R=0,z="",U=a,W=c,G=o,Y=z;I;)switch(A=R,R=Vv()){case 40:A!=108&&p7(Y,v-1)==58?(P++,Y+="("):Y+=EOe(R);break;case 41:P--,Y+=")";break;case 34:case 39:case 91:Y+=EOe(R);break;case 9:case 10:case 13:case 32:if(P>0){Y+=QV(R);break}Y+=Xwr(A);break;case 92:Y+=Qwr(pfe()-1,7);continue;case 47:switch(l6()){case 42:case 47:Kue(nyr(Zwr(Vv(),pfe()),n,i,g),g),(ZK(A||1)==5||ZK(l6()||1)==5)&&Z3(Y)&&K7(Y,-1,void 0)!==" "&&(Y+=" ");break;default:Y+="/"}break;case 123*M:f[w++]=Z3(Y)*D;case 125*M:case 59:case 0:if(P>0&&R){Y+=QV(R);break}switch(R){case 0:case 125:I=0;case 59+x:D==-1&&(Y=cRe(Y,/\f/g,"")),E>0&&(Z3(Y)-v||M===0)&&Kue(E>32?fzt(Y+";",o,i,v-1,g):fzt(cRe(Y," ","")+";",o,i,v-2,g),g);break;case 59:Y+=";";default:if(Kue(G=dzt(Y,n,i,w,x,a,f,z,U=[],W=[],v,c),c),R===123)if(x===0)gfe(Y,n,G,G,U,c,v,f,W);else{switch(C){case 99:if(p7(Y,3)===110)break;case 108:if(p7(Y,2)===97)break;default:x=0;case 100:case 109:case 115:}x?gfe(t,G,G,o&&Kue(dzt(t,G,G,0,0,a,f,z,a,U=[],v,W),W),a,W,v,f,o?U:W):gfe(Y,G,G,G,[""],W,0,f,W)}}w=x=E=0,M=D=1,z=Y="",v=u;break;case 58:v=1+Z3(Y),E=A;default:if(M<1){if(R==123)--M;else if(R==125&&M++==0&&Kwr()==125)continue}switch(Y+=QV(R),R*M){case 38:D=x>0?1:(Y+="\f",-1);break;case 44:if(P>0)break;f[w++]=(Z3(Y)-1)*D,D=1;break;case 64:l6()===45&&(Y+=EOe(Vv())),C=l6(),x=v=Z3(z=Y+=eyr(pfe())),R++;break;case 45:A===45&&Z3(Y)==2&&(M=0)}}return c}function dzt(t,n,i,o,a,c,u,f,g,w,x,v){for(var C=a-1,E=a===0?c:[""],A=Gwr(E),M=0,I=0,D=0;M<o;++M)for(var P=0,R=K7(t,C+1,C=qwr(I=u[M])),z=t;P<A;++P)(z=Xrn(I>0?E[P]+" "+R:cRe(R,/&\f/g,E[P])))&&(g[D++]=z);return Eze(t,n,i,a===0?Jrn:f,g,w,x,v)}function nyr(t,n,i,o){return Eze(t,n,i,Krn,QV(Vwr()),K7(t,2,-2),0,o)}function fzt(t,n,i,o,a){return Eze(t,n,i,Yrn,K7(t,0,o),K7(t,o+1,-1),o,a)}function dRe(t,n){for(var i="",o=0;o<t.length;o++)i+=n(t[o],o,t,n)||"";return i}function ryr(t,n,i,o){switch(t.type){case Wwr:if(t.children.length)break;case zwr:case Hwr:case Yrn:return t.return=t.return||t.value;case Krn:return"";case Uwr:return t.return=t.value+"{"+dRe(t.children,o)+"}";case Jrn:if(!Z3(t.value=t.props.join(",")))return""}return Z3(i=dRe(t.children,o))?t.return=t.value+"{"+i+"}":""}var iyr=Otn(Object.keys,Object),syr=Object.prototype,oyr=syr.hasOwnProperty;function ayr(t){if(!E0e(t))return iyr(t);var n=[];for(var i in Object(t))oyr.call(t,i)&&i!="constructor"&&n.push(i);return n}var fRe=B9(SC,"DataView"),hRe=B9(SC,"Promise"),pRe=B9(SC,"Set"),gRe=B9(SC,"WeakMap"),hzt="[object Map]",lyr="[object Object]",pzt="[object Promise]",gzt="[object Set]",mzt="[object WeakMap]",bzt="[object DataView]",cyr=F9(fRe),uyr=F9(XK),dyr=F9(hRe),fyr=F9(pRe),hyr=F9(gRe),kD=MR;(fRe&&kD(new fRe(new ArrayBuffer(1)))!=bzt||XK&&kD(new XK)!=hzt||hRe&&kD(hRe.resolve())!=pzt||pRe&&kD(new pRe)!=gzt||gRe&&kD(new gRe)!=mzt)&&(kD=function(t){var n=MR(t),i=n==lyr?t.constructor:void 0,o=i?F9(i):"";if(o)switch(o){case cyr:return bzt;case uyr:return hzt;case dyr:return pzt;case fyr:return gzt;case hyr:return mzt}return n});var pyr="[object Map]",gyr="[object Set]",myr=Object.prototype,byr=myr.hasOwnProperty;function wzt(t){if(t==null)return!0;if(_0e(t)&&(tpe(t)||typeof t=="string"||typeof t.splice=="function"||oze(t)||aze(t)||epe(t)))return!t.length;var n=kD(t);if(n==pyr||n==gyr)return!t.size;if(E0e(t))return!ayr(t).length;for(var i in t)if(byr.call(t,i))return!1;return!0}var Zrn="c4",wyr=pe(t=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(t),"detector"),yyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./c4Diagram-6F5ED5ID-BUe_rR7Y.js"),__vite__mapDeps([3,4]));return{id:Zrn,diagram:t}},"loader"),xyr={id:Zrn,detector:wyr,loader:yyr},vyr=xyr,ein="flowchart",kyr=pe((t,n)=>{var i,o;return((i=n==null?void 0:n.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"||((o=n==null?void 0:n.flowchart)==null?void 0:o.defaultRenderer)==="elk"?!1:/^\s*graph/.test(t)},"detector"),Cyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./flowDiagram-7ASYPVHJ-DlrcDbvp.js"),__vite__mapDeps([5,6,7]));return{id:ein,diagram:t}},"loader"),Syr={id:ein,detector:kyr,loader:Cyr},Eyr=Syr,tin="flowchart-v2",_yr=pe((t,n)=>{var i,o,a;return((i=n==null?void 0:n.flowchart)==null?void 0:i.defaultRenderer)==="dagre-d3"?!1:(((o=n==null?void 0:n.flowchart)==null?void 0:o.defaultRenderer)==="elk"&&(n.layout="elk"),/^\s*graph/.test(t)&&((a=n==null?void 0:n.flowchart)==null?void 0:a.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(t))},"detector"),Tyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./flowDiagram-7ASYPVHJ-DlrcDbvp.js"),__vite__mapDeps([5,6,7]));return{id:tin,diagram:t}},"loader"),Ayr={id:tin,detector:_yr,loader:Tyr},Myr=Ayr,nin="er",Nyr=pe(t=>/^\s*erDiagram/.test(t),"detector"),jyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./erDiagram-6RL3IURR-BAhBdC1z.js"),__vite__mapDeps([8,1,2]));return{id:nin,diagram:t}},"loader"),Dyr={id:nin,detector:Nyr,loader:jyr},Iyr=Dyr,rin="gitGraph",Oyr=pe(t=>/^\s*gitGraph/.test(t),"detector"),Lyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./gitGraphDiagram-NRZ2UAAF-7ip44CZQ.js"),__vite__mapDeps([9,10,11,12]));return{id:rin,diagram:t}},"loader"),Pyr={id:rin,detector:Oyr,loader:Lyr},Ryr=Pyr,iin="gantt",$yr=pe(t=>/^\s*gantt/.test(t),"detector"),Fyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./ganttDiagram-NTVNEXSI-BLSL7dfk.js"),__vite__mapDeps([13,14,15]));return{id:iin,diagram:t}},"loader"),Byr={id:iin,detector:$yr,loader:Fyr},zyr=Byr,sin="info",Hyr=pe(t=>/^\s*info/.test(t),"detector"),Uyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./infoDiagram-A4XQUW5V-CT9ls8r5.js"),__vite__mapDeps([16,12]));return{id:sin,diagram:t}},"loader"),Wyr={id:sin,detector:Hyr,loader:Uyr},oin="pie",qyr=pe(t=>/^\s*pie/.test(t),"detector"),Gyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./pieDiagram-YF2LJOPJ-CeKkxh4S.js"),__vite__mapDeps([17,10,12,18,19,15]));return{id:oin,diagram:t}},"loader"),Vyr={id:oin,detector:qyr,loader:Gyr},ain="quadrantChart",Kyr=pe(t=>/^\s*quadrantChart/.test(t),"detector"),Jyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./quadrantDiagram-OS5C2QUG-BXiERIqS.js"),__vite__mapDeps([20,14,15]));return{id:ain,diagram:t}},"loader"),Yyr={id:ain,detector:Kyr,loader:Jyr},Xyr=Yyr,lin="xychart",Qyr=pe(t=>/^\s*xychart-beta/.test(t),"detector"),Zyr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./xychartDiagram-6QU3TZC5-BDaatX2I.js"),__vite__mapDeps([21,15,19,14]));return{id:lin,diagram:t}},"loader"),exr={id:lin,detector:Qyr,loader:Zyr},txr=exr,cin="requirement",nxr=pe(t=>/^\s*requirement(Diagram)?/.test(t),"detector"),rxr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./requirementDiagram-MIRIMTAZ-wJozTJV-.js"),__vite__mapDeps([22,1,2]));return{id:cin,diagram:t}},"loader"),ixr={id:cin,detector:nxr,loader:rxr},sxr=ixr,uin="sequence",oxr=pe(t=>/^\s*sequenceDiagram/.test(t),"detector"),axr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./sequenceDiagram-G6AWOVSC-BiqICp8h.js"),__vite__mapDeps([23,4,11]));return{id:uin,diagram:t}},"loader"),lxr={id:uin,detector:oxr,loader:axr},cxr=lxr,din="class",uxr=pe((t,n)=>{var i;return((i=n==null?void 0:n.class)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(t)},"detector"),dxr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./classDiagram-LNE6IOMH-4CBrVNwA.js"),__vite__mapDeps([24,25,6]));return{id:din,diagram:t}},"loader"),fxr={id:din,detector:uxr,loader:dxr},hxr=fxr,fin="classDiagram",pxr=pe((t,n)=>{var i;return/^\s*classDiagram/.test(t)&&((i=n==null?void 0:n.class)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(t)},"detector"),gxr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./classDiagram-v2-MQ7JQ4JX-4CBrVNwA.js"),__vite__mapDeps([26,25,6]));return{id:fin,diagram:t}},"loader"),mxr={id:fin,detector:pxr,loader:gxr},bxr=mxr,hin="state",wxr=pe((t,n)=>{var i;return((i=n==null?void 0:n.state)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(t)},"detector"),yxr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./stateDiagram-MAYHULR4-oVBKhczb.js"),__vite__mapDeps([27,28,6,1,2]));return{id:hin,diagram:t}},"loader"),xxr={id:hin,detector:wxr,loader:yxr},vxr=xxr,pin="stateDiagram",kxr=pe((t,n)=>{var i;return!!(/^\s*stateDiagram-v2/.test(t)||/^\s*stateDiagram/.test(t)&&((i=n==null?void 0:n.state)==null?void 0:i.defaultRenderer)==="dagre-wrapper")},"detector"),Cxr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./stateDiagram-v2-4JROLMXI-BAEx6L5g.js"),__vite__mapDeps([29,28,6]));return{id:pin,diagram:t}},"loader"),Sxr={id:pin,detector:kxr,loader:Cxr},Exr=Sxr,gin="journey",_xr=pe(t=>/^\s*journey/.test(t),"detector"),Txr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./journeyDiagram-G5WM74LC-BRE4IIDc.js"),__vite__mapDeps([30,4,18]));return{id:gin,diagram:t}},"loader"),Axr={id:gin,detector:_xr,loader:Txr},Mxr=Axr,Nxr=pe((t,n,i)=>{Pn.debug(`rendering svg for syntax error
|
|
892
|
+
`);const o=Bwr(n),a=o.append("g");o.attr("viewBox","0 0 2412 512"),QQt(o,100,512,!0),a.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),a.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),a.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),a.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),a.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),a.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),a.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),a.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${i}`)},"draw"),min={draw:Nxr},jxr=min,Dxr={db:{},renderer:min,parser:{parse:pe(()=>{},"parse")}},Ixr=Dxr,bin="flowchart-elk",Oxr=pe((t,n={})=>{var i;return/^\s*flowchart-elk/.test(t)||/^\s*flowchart|graph/.test(t)&&((i=n==null?void 0:n.flowchart)==null?void 0:i.defaultRenderer)==="elk"?(n.layout="elk",!0):!1},"detector"),Lxr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./flowDiagram-7ASYPVHJ-DlrcDbvp.js"),__vite__mapDeps([5,6,7]));return{id:bin,diagram:t}},"loader"),Pxr={id:bin,detector:Oxr,loader:Lxr},Rxr=Pxr,win="timeline",$xr=pe(t=>/^\s*timeline/.test(t),"detector"),Fxr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./timeline-definition-U7ZMHBDA-D6vmf3rm.js"),__vite__mapDeps([31,18]));return{id:win,diagram:t}},"loader"),Bxr={id:win,detector:$xr,loader:Fxr},zxr=Bxr,yin="mindmap",Hxr=pe(t=>/^\s*mindmap/.test(t),"detector"),Uxr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./mindmap-definition-GWI6TPTV-BpT7MvEu.js"),__vite__mapDeps([32,33]));return{id:yin,diagram:t}},"loader"),Wxr={id:yin,detector:Hxr,loader:Uxr},qxr=Wxr,xin="kanban",Gxr=pe(t=>/^\s*kanban/.test(t),"detector"),Vxr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./kanban-definition-QRCXZQQD-Dsh4cbhB.js"),__vite__mapDeps([]));return{id:xin,diagram:t}},"loader"),Kxr={id:xin,detector:Gxr,loader:Vxr},Jxr=Kxr,vin="sankey",Yxr=pe(t=>/^\s*sankey-beta/.test(t),"detector"),Xxr=pe(async()=>{const{diagram:t}=await Cl(()=>import("./sankeyDiagram-Y46BX6SQ-C8AMM3An.js"),__vite__mapDeps([34,19,15]));return{id:vin,diagram:t}},"loader"),Qxr={id:vin,detector:Yxr,loader:Xxr},Zxr=Qxr,kin="packet",e2r=pe(t=>/^\s*packet-beta/.test(t),"detector"),t2r=pe(async()=>{const{diagram:t}=await Cl(()=>import("./diagram-QW4FP2JN-0SUZm5X-.js"),__vite__mapDeps([35,10,12]));return{id:kin,diagram:t}},"loader"),n2r={id:kin,detector:e2r,loader:t2r},Cin="block",r2r=pe(t=>/^\s*block-beta/.test(t),"detector"),i2r=pe(async()=>{const{diagram:t}=await Cl(()=>import("./blockDiagram-ZHA2E4KO-CZynHFsv.js"),__vite__mapDeps([36,1,7]));return{id:Cin,diagram:t}},"loader"),s2r={id:Cin,detector:r2r,loader:i2r},o2r=s2r,Sin="architecture",a2r=pe(t=>/^\s*architecture/.test(t),"detector"),l2r=pe(async()=>{const{diagram:t}=await Cl(()=>import("./architectureDiagram-UYN6MBPD-Bg4Tz5B9.js"),__vite__mapDeps([37,10,11,12,33]));return{id:Sin,diagram:t}},"loader"),c2r={id:Sin,detector:a2r,loader:l2r},u2r=c2r,yzt=!1,P0e=pe(()=>{yzt||(yzt=!0,Ohe("error",Ixr,t=>t.toLowerCase().trim()==="error"),Ohe("---",{db:{clear:pe(()=>{},"clear")},styles:{},renderer:{draw:pe(()=>{},"draw")},parser:{parse:pe(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:pe(()=>null,"init")},t=>t.toLowerCase().trimStart().startsWith("---")),FQt(vyr,Jxr,bxr,hxr,Iyr,zyr,Wyr,Vyr,sxr,cxr,Rxr,Myr,Eyr,qxr,zxr,Ryr,Exr,vxr,Mxr,Xyr,Zxr,n2r,txr,o2r,u2r))},"addDiagrams"),d2r=pe(async()=>{Pn.debug("Loading registered diagrams");const n=(await Promise.allSettled(Object.entries(F7).map(async([i,{detector:o,loader:a}])=>{if(a)try{_7e(i)}catch{try{const{diagram:c,id:u}=await a();Ohe(u,c,o)}catch(c){throw Pn.error(`Failed to load external diagram with key ${i}. Removing from detectors.`),delete F7[i],c}}}))).filter(i=>i.status==="rejected");if(n.length>0){Pn.error(`Failed to load ${n.length} external diagrams`);for(const i of n)Pn.error(i);throw new Error(`Failed to load ${n.length} external diagrams`)}},"loadRegisteredDiagrams"),f2r="graphics-document document";function Ein(t,n){t.attr("role",f2r),n!==""&&t.attr("aria-roledescription",n)}pe(Ein,"setA11yDiagramInfo");function _in(t,n,i,o){if(t.insert!==void 0){if(i){const a=`chart-desc-${o}`;t.attr("aria-describedby",a),t.insert("desc",":first-child").attr("id",a).text(i)}if(n){const a=`chart-title-${o}`;t.attr("aria-labelledby",a),t.insert("title",":first-child").attr("id",a).text(n)}}}pe(_in,"addSVGa11yTitleDescription");var hR,mRe=(hR=class{constructor(n,i,o,a,c){this.type=n,this.text=i,this.db=o,this.parser=a,this.renderer=c}static async fromText(n,i={}){var w,x;const o=Qv(),a=IBe(n,o);n=H1r(n)+`
|
|
893
893
|
`;try{_7e(a)}catch{const v=ycr(a);if(!v)throw new $Qt(`Diagram ${a} not found.`);const{id:C,diagram:E}=await v();Ohe(C,E)}const{db:c,parser:u,renderer:f,init:g}=_7e(a);return u.parser&&(u.parser.yy=c),(w=c.clear)==null||w.call(c),g==null||g(o),i.title&&((x=c.setDiagramTitle)==null||x.call(c,i.title)),await u.parse(n),new hR(a,n,c,u,f)}async render(n,i){await this.renderer.draw(this.text,n,i,this)}getParser(){return this.parser}getType(){return this.type}},pe(hR,"Diagram"),hR),xzt=[],h2r=pe(()=>{xzt.forEach(t=>{t()}),xzt=[]},"attachFunctions"),p2r=pe(t=>t.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function Tin(t){const n=t.match(RQt);if(!n)return{text:t,metadata:{}};let i=wdr(n[1],{schema:bdr})??{};i=typeof i=="object"&&!Array.isArray(i)?i:{};const o={};return i.displayMode&&(o.displayMode=i.displayMode.toString()),i.title&&(o.title=i.title.toString()),i.config&&(o.config=i.config),{text:t.slice(n[0].length),metadata:o}}pe(Tin,"extractFrontMatter");var g2r=pe(t=>t.replace(/\r\n?/g,`
|
|
894
894
|
`).replace(/<(\w+)([^>]*)>/g,(n,i,o)=>"<"+i+o.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),m2r=pe(t=>{const{text:n,metadata:i}=Tin(t),{displayMode:o,title:a,config:c={}}=i;return o&&(c.gantt||(c.gantt={}),c.gantt.displayMode=o),{title:a,config:c,text:n}},"processFrontmatter"),b2r=pe(t=>{const n=nC.detectInit(t)??{},i=nC.detectDirective(t,"wrap");return Array.isArray(i)?n.wrap=i.some(({type:o})=>o==="wrap"):(i==null?void 0:i.type)==="wrap"&&(n.wrap=!0),{text:M1r(t),directive:n}},"processDirectives");function _ze(t){const n=g2r(t),i=m2r(n),o=b2r(i.text),a=hze(i.config,o.directive);return t=p2r(o.text),{code:t,title:i.title,config:a}}pe(_ze,"preprocessDiagram");function Ain(t){const n=new TextEncoder().encode(t),i=Array.from(n,o=>String.fromCodePoint(o)).join("");return btoa(i)}pe(Ain,"toBase64");var w2r=5e4,y2r="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",x2r="sandbox",v2r="loose",k2r="http://www.w3.org/2000/svg",C2r="http://www.w3.org/1999/xlink",S2r="http://www.w3.org/1999/xhtml",E2r="100%",_2r="100%",T2r="border:0;margin:0;",A2r="margin:0",M2r="allow-top-navigation-by-user-activation allow-popups",N2r='The "iframe" tag is not supported by your browser.',j2r=["foreignobject"],D2r=["dominant-baseline"];function Tze(t){const n=_ze(t);return Dhe(),Lcr(n.config??{}),n}pe(Tze,"processAndSetConfigs");async function Min(t,n){P0e();try{const{code:i,config:o}=Tze(t);return{diagramType:(await jin(i)).type,config:o}}catch(i){if(n!=null&&n.suppressErrors)return!1;throw i}}pe(Min,"parse");var vzt=pe((t,n,i=[])=>`
|
|
895
895
|
.${t} ${n} { ${i.join(" !important; ")} !important; }`,"cssImportantStyles"),I2r=pe((t,n=new Map)=>{var o;let i="";if(t.themeCSS!==void 0&&(i+=`
|
|
@@ -1000,7 +1000,7 @@ ${i}`:i;return a?{kind:"pre",content:a,className:n.isError?"bg-red-900 text-red-
|
|
|
1000
1000
|
`})),systemBlocks:n}}const Pkr=/<crewx_image\s+path="([^"]+)"\s+mime="([^"]+)"(?:\s+name="([^"]*)")?\s*\/>/g,Rkr=/<crewx_attachment\s+path="([^"]+)"\s+mime="([^"]+)"(?:\s+name="([^"]*)")?\s*\/>/g;function $kr(t){const n=[];return{cleanText:t.replace(Pkr,(o,a,c,u)=>(n.push({path:a,mime:c,...u?{name:u}:{}}),"")).trim(),images:n}}function Fkr(t){const n=[];return{cleanText:t.replace(Rkr,(o,a,c,u)=>(n.push({path:a,mime:c,...u?{name:u}:{}}),"")).trim(),attachments:n}}const Bkr=/<crewx_card\b(?<attrs>[^>]*)\/>/g,zkr=/\b([a-zA-Z_][\w:-]*)\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/g;function MOe(t){return t.replace(/\r\n/g,`
|
|
1001
1001
|
`).replace(/\n{3,}/g,`
|
|
1002
1002
|
|
|
1003
|
-
`).trim()}function Hkr(t){const n={};for(const i of t.matchAll(zkr)){const[,o,a,c,u]=i;o&&(n[o]=a??c??u??"")}return n}function Ukr(t,n){var g,w;const i=(g=n.type)==null?void 0:g.trim(),o=(w=n.version)==null?void 0:w.trim();if(!i||o!=="1")return null;const{id:a,type:c,version:u,...f}=n;return{type:i,version:1,...a?{id:a}:{},refs:f,raw:t}}function Wkr(t,n={}){var c;if(!n.allowCards){const u=MOe(t);return u?[{type:"text",content:u}]:[]}const i=[];let o=0;for(const u of t.matchAll(Bkr)){const f=u[0],g=u.index??0,w=MOe(t.slice(o,g));w&&i.push({type:"text",content:w});const x=Hkr(((c=u.groups)==null?void 0:c.attrs)??""),v=Ukr(f,x);v?i.push({type:"card",card:v}):i.push({type:"text",content:f}),o=g+f.length}const a=MOe(t.slice(o));return a&&i.push({type:"text",content:a}),i}const qkr=/(?:^|\/)(docs|skills)\//,Gkr=new Set(["AGENTS.md","README.md","CLAUDE.md"]),Vkr=/^(.+\.(?:md|markdown|mdx)):(\d+)$/i;function Ize(t){try{return decodeURIComponent(t)}catch{return t}}function Kkr(t){return t.replace(/%/g,"%25").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F").replace(/#/g,"%23").replace(/\s/g,"%20")}function esn(t){return t?Ize(t):null}function Jkr(t){let n=Ize(t.trim());n.startsWith("file://")&&(n=n.replace(/^file:\/+/,"/"));const i=qkr.exec(n);if((i==null?void 0:i.index)!==void 0)return n.slice(i.index).replace(/^\/+/,"");const o=n.split("/").filter(Boolean).at(-1);return o&&Gkr.has(o)?o:n.replace(/^\/+/,"")}function Rzt(t){if(!t)return;const n=Number.parseInt(t,10);return Number.isFinite(n)&&n>0?n:void 0}function tsn(t,n){const i=t.indexOf("?"),o=i>=0?t.slice(0,i):t,a=i>=0?t.slice(i+1):"",c=new URLSearchParams(a),u=Rzt(c.get("line")),f=Vkr.exec(o),g=Jkr(f?f[1]:o),w=u??Rzt((f==null?void 0:f[2])??null),x=n?Ize(n):void 0;return{path:g,...w?{line:w}:{},...x?{anchor:x}:{}}}function nsn(t,n,i=!1){const o=[`path=${Kkr(n.path)}`];return n.line&&o.push(`line=${n.line}`),{pathname:`/ws/${t}/docs`,search:`?${o.join("&")}`,hash:n.anchor?`#${i?encodeURIComponent(n.anchor):n.anchor}`:""}}const Ykr={retry:"taskDetail.systemChip.retryFailedTask"};function Xkr(t){for(const n of t){if(!n.type)continue;const i=Ykr[n.type];if(i)return i}return"taskDetail.systemChip.systemContext"}function NOe(t){return t instanceof Error?t.message:String(t)}function Qkr(t,n){const i=t.findIndex(a=>a.id===n.id);if(i===-1)return[n,...t];const o=[...t];return o[i]=n,o}const Iv=nf((t,n)=>{const i=(c,u)=>{t(f=>({loadingIds:{...f.loadingIds,[c]:u}}))},o=c=>(t(u=>({runs:Qkr(u.runs,c),error:null})),c),a=async(c,u)=>{i(c,!0);try{return o(await u())}catch(f){throw t({error:NOe(f)}),f}finally{i(c,!1)}};return{runs:[],loadingIds:{},error:null,startRun:async(c,u)=>{try{return o(await wn.startWorkflowRun(c,u))}catch(f){throw t({error:NOe(f)}),f}},resolveCard:async c=>{try{return o(await wn.resolveWorkflowCard(c))}catch(u){throw t({error:NOe(u)}),u}},refreshRun:c=>a(c,()=>wn.getWorkflowRun(c)),resumeRun:(c,u)=>a(c,()=>wn.resumeWorkflowRun(c,u)),approveRun:(c,u)=>a(c,()=>wn.approveWorkflowRun(c,u)),rejectRun:(c,u)=>a(c,()=>wn.rejectWorkflowRun(c,u)),cancelRun:(c,u)=>a(c,()=>wn.cancelWorkflowRun(c,u)),removeRun:c=>{t(u=>{const{[c]:f,...g}=u.loadingIds;return{runs:n().runs.filter(w=>w.id!==c),loadingIds:g}})}}});function Zkr(t,n){return n||t.phase==="running"||t.phase==="not_started"?S.jsx(Is,{size:16,className:"animate-spin text-blue-600","aria-hidden":"true"}):t.phase==="waiting_approval"?S.jsx(DFe,{size:16,className:"text-amber-600","aria-hidden":"true"}):t.phase==="completed"?S.jsx(bR,{size:16,className:"text-emerald-600","aria-hidden":"true"}):t.phase==="failed"?S.jsx(I9,{size:16,className:"text-red-600","aria-hidden":"true"}):t.phase==="cancelled"?S.jsx(qJ,{size:16,className:"text-gray-500","aria-hidden":"true"}):S.jsx(q6,{size:16,className:"text-gray-500","aria-hidden":"true"})}function e3r(t){if(typeof t!="number"||Number.isNaN(t))return"";if(t<1e3)return`${t}ms`;const n=t/1e3;if(n<60)return`${n.toFixed(n<10?1:0)}s`;const i=Math.floor(n/60),o=Math.round(n%60);return`${i}m ${o}s`}function t3r(t,n){return t.status==="current"&&n?S.jsx(Is,{size:14,className:"animate-spin","aria-hidden":"true"}):t.status==="current"?S.jsx(Is,{size:14,className:"animate-spin","aria-hidden":"true"}):t.status==="waiting_approval"?S.jsx(DFe,{size:14,"aria-hidden":"true"}):t.status==="paused"?S.jsx(rUn,{size:14,"aria-hidden":"true"}):t.status==="completed"?S.jsx(bR,{size:14,"aria-hidden":"true"}):t.status==="failed"?S.jsx(I9,{size:14,"aria-hidden":"true"}):t.status==="cancelled"?S.jsx(qJ,{size:14,"aria-hidden":"true"}):S.jsx(rJt,{size:10,"aria-hidden":"true"})}function n3r(t){return t.status==="completed"?"border-emerald-200 bg-emerald-50 text-emerald-700":t.status==="waiting_approval"?"border-amber-200 bg-amber-50 text-amber-700":t.status==="current"?"border-blue-200 bg-blue-50 text-blue-700":t.status==="failed"?"border-red-200 bg-red-50 text-red-700":t.status==="cancelled"?"border-gray-300 bg-gray-100 text-gray-600":t.status==="paused"?"border-violet-200 bg-violet-50 text-violet-700":"border-gray-200 bg-white text-gray-400"}function r3r(t){try{return JSON.stringify(t,null,2)}catch{return"{}"}}function $zt(t,n){return t?`${t.id} · ${n}`:""}function i3r({run:t,loading:n=!1,onApprove:i,onReject:o,onCancel:a,onRefresh:c}){var P;const{t:u}=Zn(),[f,g]=F.useState(()=>t.phase==="running"||t.phase==="waiting_approval"||t.phase==="failed"),w=t.audit.at(-1),x=R=>u(`workflowRun.nodeType.${R.type}`,{defaultValue:R.typeLabel||R.type}),v=t.currentNode?`${t.currentNode.id} · ${x(t.currentNode)}`:u("workflowRun.noCurrentNode"),C=t.phase==="waiting_approval",E=t.canCancel&&["not_started","running","paused","waiting_approval"].includes(t.phase),A=Object.keys(t.state??{}).length,M=r3r(t.state??{}),I=(P=t.timeline)!=null&&P.length?t.timeline:[],D=I.length;return S.jsxs("div",{className:"w-full rounded-lg border border-gray-200 bg-white shadow-sm",children:[S.jsxs("div",{className:"flex items-start gap-3 border-b border-gray-100 px-4 py-3",children:[S.jsx("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-blue-50 text-blue-600",children:S.jsx(D7,{size:17,"aria-hidden":"true"})}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[S.jsx("h3",{className:"truncate text-sm font-semibold text-gray-900",children:t.workflowName}),S.jsx("span",{className:"inline-flex items-center gap-1 rounded-full border border-blue-100 bg-blue-50 px-2 py-0.5 text-[11px] font-medium text-blue-700",children:u("workflowRun.autoDefault")}),S.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-gray-200 bg-gray-50 px-2 py-0.5 text-[11px] font-medium text-gray-600",children:[Zkr(t,n),u(`workflowRun.phase.${t.phase}`)]})]}),S.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-gray-500",children:t.workflowDescription||t.workflowId})]})]}),S.jsxs("div",{className:"space-y-3 px-4 py-3",children:[S.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md bg-gray-50 px-3 py-2 text-xs text-gray-600",children:[S.jsx("span",{children:v}),S.jsx("span",{children:u("workflowRun.timeline.summary",{completed:t.completedCount,visible:D})})]}),S.jsxs("div",{children:[S.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2 text-xs font-medium text-gray-700",children:[S.jsxs("button",{type:"button",onClick:()=>g(R=>!R),className:"inline-flex min-w-0 items-center gap-1.5 rounded px-1 py-0.5 text-left transition hover:bg-gray-100","aria-expanded":f,children:[S.jsx(vg,{size:14,"aria-hidden":"true",className:`shrink-0 transition-transform ${f?"":"-rotate-90"}`}),S.jsx("span",{children:u("workflowRun.timeline.title")})]}),S.jsx("button",{type:"button",onClick:()=>g(R=>!R),className:"shrink-0 rounded px-1 py-0.5 text-[11px] font-normal text-gray-400 transition hover:bg-gray-100 hover:text-gray-600","aria-expanded":f,children:u("workflowRun.timeline.count",{completed:t.completedCount,visible:D})})]}),f?S.jsx("ol",{className:"space-y-0",children:I.map((R,z)=>{var te,Q,se;const U=z===I.length-1,W=R.status==="waiting_approval"&&t.phase==="waiting_approval",G=e3r(R.durationMs),Y=x(R);return S.jsxs("li",{className:"relative grid grid-cols-[28px_1fr] gap-2 pb-3 last:pb-0",children:[!U&&S.jsx("span",{"aria-hidden":"true",className:["absolute left-[13px] top-7 h-[calc(100%-1.25rem)] w-px",R.status==="completed"?"bg-emerald-200":"bg-gray-200"].join(" ")}),S.jsx("span",{className:`relative z-10 mt-0.5 flex h-7 w-7 items-center justify-center rounded-full border ${n3r(R)}`,children:t3r(R,n)}),S.jsx("div",{className:["min-w-0 rounded-md border px-3 py-2",R.status==="pending"?"border-transparent bg-transparent px-0 text-gray-400":R.status==="waiting_approval"?"border-amber-200 bg-amber-50":R.status==="current"?"border-blue-100 bg-blue-50":R.status==="failed"?"border-red-100 bg-red-50":R.status==="cancelled"?"border-gray-200 bg-gray-50":"border-gray-100 bg-white"].join(" "),children:S.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[S.jsx("span",{className:"font-mono text-[11px] font-semibold text-gray-900",children:R.id}),S.jsx("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-[10px] font-medium text-gray-600",children:Y}),R.agent&&S.jsxs("span",{className:"rounded bg-blue-50 px-1.5 py-0.5 text-[10px] font-medium text-blue-700",children:["@",R.agent]})]}),R.description&&S.jsx("p",{className:"mt-1 line-clamp-2 text-xs leading-5 text-gray-600",children:R.description}),R.error&&S.jsx("p",{className:"mt-1 text-xs leading-5 text-red-700",children:R.error}),W&&S.jsxs("div",{className:"mt-3 rounded-md border border-amber-200 bg-white/70 px-3 py-3 text-xs text-amber-900",children:[S.jsx("div",{className:"mb-1 text-sm font-semibold text-amber-950",children:u("workflowRun.approval.title")}),S.jsx("p",{className:"whitespace-pre-wrap leading-5",children:((te=t.approval)==null?void 0:te.question)||u("workflowRun.approval.fallbackQuestion")}),S.jsxs("div",{className:"mt-3 grid gap-1.5 text-[11px] text-amber-800 sm:grid-cols-2",children:[((Q=t.approval)==null?void 0:Q.approveNode)&&S.jsxs("div",{className:"rounded border border-amber-200 bg-white/70 px-2 py-1.5",children:[S.jsx("span",{className:"font-medium",children:u("workflowRun.approval.approvePath")})," ",S.jsx("span",{children:$zt(t.approval.approveNode,x(t.approval.approveNode))})]}),((se=t.approval)==null?void 0:se.rejectNode)&&S.jsxs("div",{className:"rounded border border-amber-200 bg-white/70 px-2 py-1.5",children:[S.jsx("span",{className:"font-medium",children:u("workflowRun.approval.rejectPath")})," ",S.jsx("span",{children:$zt(t.approval.rejectNode,x(t.approval.rejectNode))})]})]})]})]}),S.jsxs("div",{className:"shrink-0 text-right text-[11px] text-gray-400",children:[S.jsx("div",{children:u(`workflowRun.timeline.status.${R.status}`)}),G&&S.jsx("div",{className:"mt-0.5",children:G})]})]})})]},R.id)})}):S.jsx("div",{className:"rounded-md border border-gray-100 bg-gray-50 px-3 py-2 text-xs text-gray-500",children:u("workflowRun.timeline.collapsed",{completed:t.completedCount,visible:D})})]}),t.phase==="failed"&&(w==null?void 0:w.error)&&S.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-700",children:w.error}),t.phase==="cancelled"&&S.jsx("div",{className:"rounded-md border border-gray-200 bg-gray-50 px-3 py-2 text-xs text-gray-600",children:(w==null?void 0:w.error)||u("workflowRun.cancelledHint")}),w&&t.phase!=="failed"&&S.jsx("div",{className:"truncate text-xs text-gray-500",children:u("workflowRun.lastAudit",{node:w.node_id,duration:w.duration_ms})}),S.jsxs("details",{className:"group rounded-md border border-gray-200 bg-gray-50",children:[S.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 px-3 py-2 text-xs font-medium text-gray-700 marker:hidden",children:[S.jsx("span",{children:u("workflowRun.state.title")}),S.jsx("span",{className:"text-[11px] font-normal text-gray-400",children:u("workflowRun.state.keyCount",{count:A})})]}),A===0?S.jsx("div",{className:"border-t border-gray-200 px-3 py-2 text-xs text-gray-500",children:u("workflowRun.state.empty")}):S.jsx("pre",{className:"max-h-64 overflow-auto border-t border-gray-200 px-3 py-2 font-mono text-[11px] leading-5 text-gray-700",children:M})]}),S.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[C&&S.jsxs(S.Fragment,{children:[S.jsxs("button",{type:"button",onClick:i,disabled:n||!t.canApprove,className:"inline-flex h-8 items-center gap-1.5 rounded-md bg-blue-600 px-3 text-xs font-medium text-white shadow-sm transition hover:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(dJt,{size:13,"aria-hidden":"true"}),u("workflowRun.approve")]}),S.jsx("button",{type:"button",onClick:o,disabled:n||!t.canReject,className:"inline-flex h-8 items-center rounded-md border border-gray-200 bg-white px-3 text-xs font-medium text-gray-700 shadow-sm transition hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",children:u("workflowRun.reject")})]}),E&&S.jsxs("button",{type:"button",onClick:a,disabled:n,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-red-200 bg-white px-3 text-xs font-medium text-red-700 shadow-sm transition hover:bg-red-50 disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(qJ,{size:13,"aria-hidden":"true"}),u("workflowRun.stop")]}),S.jsx("button",{type:"button",onClick:c,disabled:n,className:"inline-flex h-8 items-center rounded-md border border-gray-200 bg-white px-3 text-xs font-medium text-gray-700 shadow-sm transition hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",children:u("workflowRun.refresh")}),S.jsx("span",{className:"ml-auto truncate text-[11px] text-gray-400",children:t.id})]})]})]})}function rsn({card:t}){return S.jsx("div",{className:"rounded-md border border-gray-200 bg-gray-50 px-3 py-2 font-mono text-xs text-gray-500",children:t.raw})}function s3r({card:t}){const{t:n}=Zn(),i=Lm(R=>R.addToast),o=t.refs.run_id,a=t.refs.workflow_id,c=t.refs.mode==="manual"?"manual":"auto",u=t.refs.proof,f=Iv(R=>R.runs),g=Iv(R=>R.loadingIds),w=Iv(R=>R.resolveCard),x=Iv(R=>R.refreshRun),v=Iv(R=>R.approveRun),C=Iv(R=>R.rejectRun),E=Iv(R=>R.cancelRun),[A,M]=F.useState("pending"),I=f.find(R=>R.id===o),D=o?g[o]:!1;if(F.useEffect(()=>{if(!o||!a||!u){M("invalid");return}let R=!0;return M("pending"),w({type:"workflow",version:1,runId:o,workflowId:a,mode:c,proof:u}).then(()=>{R&&M("valid")}).catch(z=>{if(!R)return;const U=z instanceof Error?z.message:String(z);M(U.toLowerCase().includes("expired")?"expired":"invalid")}),()=>{R=!1}},[c,u,w,o,a]),!o||!a)return S.jsx(rsn,{card:t});if(A==="invalid")return S.jsx("div",{className:"rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-500",children:n("workflowRun.unverifiedCard")});if(A==="expired")return S.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-800",children:[S.jsx("div",{className:"font-medium",children:n("workflowRun.expiredCard.title")}),S.jsx("div",{className:"mt-1 text-xs",children:n("workflowRun.expiredCard.description",{id:a})})]});if(A!=="valid"||!I)return S.jsx("div",{className:"rounded-lg border border-gray-200 bg-white px-4 py-3 text-sm text-gray-500",children:n("workflowRun.loadingCard")});const P=(R,z)=>{i({type:"error",message:n(R,{message:z instanceof Error?z.message:String(z)})})};return S.jsx(i3r,{run:I,loading:D,onRefresh:()=>{x(I.id).catch(R=>P("workflowRun.refreshFailed",R))},onApprove:()=>{v(I.id,u).catch(R=>P("workflowRun.approveFailed",R))},onReject:()=>{C(I.id,u).catch(R=>P("workflowRun.rejectFailed",R))},onCancel:()=>{E(I.id,u).catch(R=>P("workflowRun.cancelFailed",R))}})}function o3r({card:t}){return t.type==="workflow"?S.jsx(s3r,{card:t}):S.jsx(rsn,{card:t})}function Fzt(t,n){try{return new Date(t).toLocaleTimeString(n,{hour:"2-digit",minute:"2-digit",hour12:!1})}catch{return""}}function Bzt(t,n,i){if(t.startsWith("blob:")||t.startsWith("data:"))return t;const o=t.split("/").pop()??"",a=t.split("/").at(-2)??i??"";return`/api/v1/ws/${n??"_"}/threads/${a}/messages/attachments/${o}`}function a3r(t,n){return(n==null?void 0:n.trim())||t.split("/").pop()||t}function SRe({message:t,logs:n,childTasks:i,taskStatus:o,taskError:a,onRequestLogs:c,onStopTask:u,onRetryTask:f}){var Ve,at;const{i18n:g,t:w}=Zn(),x=Ff(),v=Cg(),C=Zge(),E=!t.isAssistant,A=F.useCallback((yt,Nt)=>{v(nsn(x.slug??"_",tsn(yt,Nt)))},[v,x.slug]),[M,I]=F.useState(null),[D,P]=F.useState(!1),[R,z]=F.useState(!1),U=F.useRef(null),W=F.useRef(null),{cleanText:G,systemBlocks:Y}=F.useMemo(()=>Lkr(t.text??""),[t.text]),{userCleanText:te,userImages:Q,userAttachments:se}=F.useMemo(()=>{const{cleanText:yt,images:Nt}=$kr(G),{cleanText:pt,attachments:St}=Fkr(yt);return{userCleanText:pt,userImages:Nt,userAttachments:St}},[G]),ce=F.useMemo(()=>Y.length>0?Xkr(Y):null,[Y]);F.useEffect(()=>()=>{U.current&&window.clearTimeout(U.current),W.current&&window.clearTimeout(W.current)},[]);const V=(yt,Nt)=>{Nt(!0),yt.current&&window.clearTimeout(yt.current),yt.current=window.setTimeout(()=>{Nt(!1),yt.current=null},1500)},ae=async(yt,Nt,pt)=>{var St;if(yt.trim())try{if(!((St=navigator.clipboard)!=null&&St.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(yt),V(pt,Nt)}catch(Bt){console.error("[MessageBubble] Failed to copy text.",Bt)}};if(E){const yt=te.trim().length>0;return S.jsxs("div",{className:"group flex justify-end",children:[S.jsxs("div",{className:"relative max-w-[80%]",children:[S.jsx("button",{type:"button",onClick:()=>void ae(te,P,U),disabled:!yt,"aria-label":w(D?"common.copied":"common.copy"),className:"absolute right-full top-2 mr-2 inline-flex items-center justify-center rounded border border-gray-200 bg-white p-1 text-gray-400 shadow-sm opacity-0 transition-opacity duration-150 group-hover:opacity-100 disabled:pointer-events-none disabled:text-gray-200",children:D?S.jsx(xg,{size:12,"aria-hidden":"true"}):S.jsx(x5,{size:12,"aria-hidden":"true"})}),S.jsxs("div",{className:"bg-blue-600 rounded-xl rounded-br-none px-4 py-2.5",children:[Q.length>0&&S.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:Q.map((Nt,pt)=>{const St=Bzt(Nt.path,x.slug,x.threadId);return S.jsx("img",{src:St,alt:"",className:"max-w-[120px] max-h-[120px] rounded-lg cursor-pointer object-cover",onClick:()=>I({src:St})},pt)})}),se.length>0&&S.jsx("div",{className:"mb-2 flex flex-col gap-2",children:se.map((Nt,pt)=>{const St=Bzt(Nt.path,x.slug,x.threadId),Bt=a3r(Nt.path,Nt.name);return S.jsxs("a",{href:St,target:"_blank",rel:"noopener noreferrer",title:Bt,className:"inline-flex max-w-full items-center gap-3 rounded-lg border border-blue-200 bg-white px-3 py-2 text-gray-900 shadow-sm transition-colors hover:bg-blue-50",children:[S.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-red-50 text-red-600",children:S.jsx(Tx,{size:18,"aria-hidden":"true"})}),S.jsx("span",{className:"truncate text-sm font-medium",children:Bt})]},`${Nt.path}-${pt}`)})}),t.imageDataUrl?S.jsx("img",{src:t.imageDataUrl,alt:w("taskDetail.captureAlt"),className:"max-w-full rounded-lg"}):S.jsx(w9,{content:te,variant:"dark-bg",onLocalLink:A}),ce&&S.jsx("div",{className:"mt-3 border-t border-white/25 pt-2",children:S.jsxs("div",{className:"inline-flex max-w-full items-center gap-1.5 rounded-full border border-white/30 bg-white/10 px-2.5 py-1 text-[11px] font-medium text-blue-50 backdrop-blur-sm",children:[S.jsx("span",{className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-white/55 text-[10px] font-semibold leading-none text-white/90",children:"i"}),S.jsx("span",{className:"min-w-0 truncate",children:w(ce)})]})}),S.jsx("span",{className:"text-[10px] text-blue-200 mt-1 block text-right",children:Fzt(t.timestamp,g.language)})]})]}),M&&S.jsx(Dkr,{src:M.src,alt:M.alt,onClose:()=>I(null)})]})}const de=((Ve=t.metadata)==null?void 0:Ve.agent_id)??"assistant",ee=C[de],ue=(ee==null?void 0:ee.name)??de,he=!!((at=t.text)!=null&&at.trim()),ge=F.useMemo(()=>Wkr(t.text??"",{allowCards:!0}),[t.text]),oe=ge.some(yt=>yt.type==="card"&&yt.card.type==="workflow"),Ae=oe?null:o,Te=Ae==="running"||Ae==="pending",ve=Ae==="failed";return S.jsxs("div",{className:"flex gap-2.5",children:[S.jsx(G6,{provider:ee==null?void 0:ee.provider,size:16,className:"mt-1 h-8 w-8 rounded-full border border-gray-200 bg-white"}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[S.jsx("span",{className:"text-xs font-medium text-gray-900 truncate",title:ue,children:ue}),S.jsx("span",{className:"text-[10px] text-gray-500",children:Fzt(t.timestamp,g.language)}),Te&&S.jsxs(S.Fragment,{children:[S.jsxs("span",{className:"inline-flex items-center gap-1 bg-green-100 text-green-800 text-[11px] font-medium px-2 py-0.5 rounded-lg",children:[S.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 animate-blink"}),w("taskDetail.running","실행 중")]}),u&&S.jsx("button",{type:"button",onClick:u,className:"w-5 h-5 rounded-full bg-red-100 border border-red-300 text-red-500 hover:bg-red-500 hover:border-red-600 hover:text-white transition-colors flex items-center justify-center shrink-0",children:S.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentColor","aria-hidden":"true",children:S.jsx("rect",{x:"1",y:"1",width:"7",height:"7",rx:"1.5"})})})]}),ve&&S.jsxs(S.Fragment,{children:[S.jsxs("span",{className:"inline-flex items-center gap-1 bg-red-50 text-red-600 text-[11px] font-medium px-2 py-0.5 rounded-lg border border-red-200",children:[S.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500"}),w("taskDetail.failed","실패")]}),f&&S.jsx("button",{type:"button",onClick:f,title:w("taskDetail.retry","재시도"),className:"w-5 h-5 rounded-full bg-blue-50 border border-blue-300 text-blue-500 hover:bg-blue-500 hover:border-blue-600 hover:text-white transition-colors flex items-center justify-center shrink-0",children:S.jsx(y0,{size:10,"aria-hidden":"true"})})]})]}),t.text?S.jsxs("div",{className:"relative",children:[S.jsx("button",{type:"button",onClick:()=>void ae(t.text??"",z,W),disabled:!he,"aria-label":w(R?"common.copied":"common.copy"),className:"absolute right-2 top-2 z-10 inline-flex items-center justify-center rounded border border-gray-200 bg-white p-1 text-gray-400 shadow-sm transition-colors hover:bg-gray-50 hover:text-gray-600 disabled:cursor-not-allowed disabled:text-gray-200",children:R?S.jsx(xg,{size:12,"aria-hidden":"true"}):S.jsx(x5,{size:12,"aria-hidden":"true"})}),S.jsx("div",{className:"space-y-3 bg-white border border-gray-200 rounded-lg px-4 py-3 pr-8",children:ge.map((yt,Nt)=>yt.type==="card"?S.jsx(o3r,{card:yt.card},`${yt.card.type}-${yt.card.id??yt.card.refs.run_id??Nt}`):S.jsx(w9,{content:yt.content,onLocalLink:A},`text-${Nt}`))})]}):Te?S.jsx("div",{className:"bg-white border border-gray-200 rounded-lg px-4 py-3 w-fit",children:S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx("span",{className:"w-2 h-2 rounded-full bg-gray-400 animate-dot-bounce"}),S.jsx("span",{className:"w-2 h-2 rounded-full bg-gray-400 animate-dot-bounce [animation-delay:150ms]"}),S.jsx("span",{className:"w-2 h-2 rounded-full bg-gray-400 animate-dot-bounce [animation-delay:300ms]"})]})}):null,ve&&a&&S.jsxs("div",{className:"mt-1.5 flex items-center gap-2 rounded-md border border-red-200 bg-red-50 px-3 py-1.5 text-[11px] text-red-600",children:[S.jsx("span",{className:"flex-1 truncate",children:a}),f&&S.jsx("button",{type:"button",onClick:f,className:"shrink-0 font-medium underline hover:no-underline",children:w("taskDetail.retry","재시도")})]}),!oe&&S.jsx(Dze,{logs:n??[],childTasks:i??[],status:Ae??null,onRequestLogs:c}),!oe&&i&&i.length>0&&S.jsx(jkr,{children:i})]})]})}function fg(t){this.content=t}fg.prototype={constructor:fg,find:function(t){for(var n=0;n<this.content.length;n+=2)if(this.content[n]===t)return n;return-1},get:function(t){var n=this.find(t);return n==-1?void 0:this.content[n+1]},update:function(t,n,i){var o=i&&i!=t?this.remove(i):this,a=o.find(t),c=o.content.slice();return a==-1?c.push(i||t,n):(c[a+1]=n,i&&(c[a]=i)),new fg(c)},remove:function(t){var n=this.find(t);if(n==-1)return this;var i=this.content.slice();return i.splice(n,2),new fg(i)},addToStart:function(t,n){return new fg([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var i=this.remove(t).content.slice();return i.push(t,n),new fg(i)},addBefore:function(t,n,i){var o=this.remove(n),a=o.content.slice(),c=o.find(t);return a.splice(c==-1?a.length:c,0,n,i),new fg(a)},forEach:function(t){for(var n=0;n<this.content.length;n+=2)t(this.content[n],this.content[n+1])},prepend:function(t){return t=fg.from(t),t.size?new fg(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=fg.from(t),t.size?new fg(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=fg.from(t);for(var i=0;i<t.content.length;i+=2)n=n.remove(t.content[i]);return n},toObject:function(){var t={};return this.forEach(function(n,i){t[n]=i}),t},get size(){return this.content.length>>1}};fg.from=function(t){if(t instanceof fg)return t;var n=[];if(t)for(var i in t)n.push(i,t[i]);return new fg(n)};function isn(t,n,i){for(let o=0;;o++){if(o==t.childCount||o==n.childCount)return t.childCount==n.childCount?null:i;let a=t.child(o),c=n.child(o);if(a==c){i+=a.nodeSize;continue}if(!a.sameMarkup(c))return i;if(a.isText&&a.text!=c.text){for(let u=0;a.text[u]==c.text[u];u++)i++;return i}if(a.content.size||c.content.size){let u=isn(a.content,c.content,i+1);if(u!=null)return u}i+=a.nodeSize}}function ssn(t,n,i,o){for(let a=t.childCount,c=n.childCount;;){if(a==0||c==0)return a==c?null:{a:i,b:o};let u=t.child(--a),f=n.child(--c),g=u.nodeSize;if(u==f){i-=g,o-=g;continue}if(!u.sameMarkup(f))return{a:i,b:o};if(u.isText&&u.text!=f.text){let w=0,x=Math.min(u.text.length,f.text.length);for(;w<x&&u.text[u.text.length-w-1]==f.text[f.text.length-w-1];)w++,i--,o--;return{a:i,b:o}}if(u.content.size||f.content.size){let w=ssn(u.content,f.content,i-1,o-1);if(w)return w}i-=g,o-=g}}class An{constructor(n,i){if(this.content=n,this.size=i||0,i==null)for(let o=0;o<n.length;o++)this.size+=n[o].nodeSize}nodesBetween(n,i,o,a=0,c){for(let u=0,f=0;f<i;u++){let g=this.content[u],w=f+g.nodeSize;if(w>n&&o(g,a+f,c||null,u)!==!1&&g.content.size){let x=f+1;g.nodesBetween(Math.max(0,n-x),Math.min(g.content.size,i-x),o,a+x)}f=w}}descendants(n){this.nodesBetween(0,this.size,n)}textBetween(n,i,o,a){let c="",u=!0;return this.nodesBetween(n,i,(f,g)=>{let w=f.isText?f.text.slice(Math.max(n,g)-g,i-g):f.isLeaf?a?typeof a=="function"?a(f):a:f.type.spec.leafText?f.type.spec.leafText(f):"":"";f.isBlock&&(f.isLeaf&&w||f.isTextblock)&&o&&(u?u=!1:c+=o),c+=w},0),c}append(n){if(!n.size)return this;if(!this.size)return n;let i=this.lastChild,o=n.firstChild,a=this.content.slice(),c=0;for(i.isText&&i.sameMarkup(o)&&(a[a.length-1]=i.withText(i.text+o.text),c=1);c<n.content.length;c++)a.push(n.content[c]);return new An(a,this.size+n.size)}cut(n,i=this.size){if(n==0&&i==this.size)return this;let o=[],a=0;if(i>n)for(let c=0,u=0;u<i;c++){let f=this.content[c],g=u+f.nodeSize;g>n&&((u<n||g>i)&&(f.isText?f=f.cut(Math.max(0,n-u),Math.min(f.text.length,i-u)):f=f.cut(Math.max(0,n-u-1),Math.min(f.content.size,i-u-1))),o.push(f),a+=f.nodeSize),u=g}return new An(o,a)}cutByIndex(n,i){return n==i?An.empty:n==0&&i==this.content.length?this:new An(this.content.slice(n,i))}replaceChild(n,i){let o=this.content[n];if(o==i)return this;let a=this.content.slice(),c=this.size+i.nodeSize-o.nodeSize;return a[n]=i,new An(a,c)}addToStart(n){return new An([n].concat(this.content),this.size+n.nodeSize)}addToEnd(n){return new An(this.content.concat(n),this.size+n.nodeSize)}eq(n){if(this.content.length!=n.content.length)return!1;for(let i=0;i<this.content.length;i++)if(!this.content[i].eq(n.content[i]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(n){let i=this.content[n];if(!i)throw new RangeError("Index "+n+" out of range for "+this);return i}maybeChild(n){return this.content[n]||null}forEach(n){for(let i=0,o=0;i<this.content.length;i++){let a=this.content[i];n(a,o,i),o+=a.nodeSize}}findDiffStart(n,i=0){return isn(this,n,i)}findDiffEnd(n,i=this.size,o=n.size){return ssn(this,n,i,o)}findIndex(n){if(n==0)return Que(0,n);if(n==this.size)return Que(this.content.length,n);if(n>this.size||n<0)throw new RangeError(`Position ${n} outside of fragment (${this})`);for(let i=0,o=0;;i++){let a=this.child(i),c=o+a.nodeSize;if(c>=n)return c==n?Que(i+1,c):Que(i,o);o=c}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(n=>n.toJSON()):null}static fromJSON(n,i){if(!i)return An.empty;if(!Array.isArray(i))throw new RangeError("Invalid input for Fragment.fromJSON");return new An(i.map(n.nodeFromJSON))}static fromArray(n){if(!n.length)return An.empty;let i,o=0;for(let a=0;a<n.length;a++){let c=n[a];o+=c.nodeSize,a&&c.isText&&n[a-1].sameMarkup(c)?(i||(i=n.slice(0,a)),i[i.length-1]=c.withText(i[i.length-1].text+c.text)):i&&i.push(c)}return new An(i||n,o)}static from(n){if(!n)return An.empty;if(n instanceof An)return n;if(Array.isArray(n))return this.fromArray(n);if(n.attrs)return new An([n],n.nodeSize);throw new RangeError("Can not convert "+n+" to a Fragment"+(n.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}An.empty=new An([],0);const jOe={index:0,offset:0};function Que(t,n){return jOe.index=t,jOe.offset=n,jOe}function fpe(t,n){if(t===n)return!0;if(!(t&&typeof t=="object")||!(n&&typeof n=="object"))return!1;let i=Array.isArray(t);if(Array.isArray(n)!=i)return!1;if(i){if(t.length!=n.length)return!1;for(let o=0;o<t.length;o++)if(!fpe(t[o],n[o]))return!1}else{for(let o in t)if(!(o in n)||!fpe(t[o],n[o]))return!1;for(let o in n)if(!(o in t))return!1}return!0}let $l=class ERe{constructor(n,i){this.type=n,this.attrs=i}addToSet(n){let i,o=!1;for(let a=0;a<n.length;a++){let c=n[a];if(this.eq(c))return n;if(this.type.excludes(c.type))i||(i=n.slice(0,a));else{if(c.type.excludes(this.type))return n;!o&&c.type.rank>this.type.rank&&(i||(i=n.slice(0,a)),i.push(this),o=!0),i&&i.push(c)}}return i||(i=n.slice()),o||i.push(this),i}removeFromSet(n){for(let i=0;i<n.length;i++)if(this.eq(n[i]))return n.slice(0,i).concat(n.slice(i+1));return n}isInSet(n){for(let i=0;i<n.length;i++)if(this.eq(n[i]))return!0;return!1}eq(n){return this==n||this.type==n.type&&fpe(this.attrs,n.attrs)}toJSON(){let n={type:this.type.name};for(let i in this.attrs){n.attrs=this.attrs;break}return n}static fromJSON(n,i){if(!i)throw new RangeError("Invalid input for Mark.fromJSON");let o=n.marks[i.type];if(!o)throw new RangeError(`There is no mark type ${i.type} in this schema`);let a=o.create(i.attrs);return o.checkAttrs(a.attrs),a}static sameSet(n,i){if(n==i)return!0;if(n.length!=i.length)return!1;for(let o=0;o<n.length;o++)if(!n[o].eq(i[o]))return!1;return!0}static setFrom(n){if(!n||Array.isArray(n)&&n.length==0)return ERe.none;if(n instanceof ERe)return[n];let i=n.slice();return i.sort((o,a)=>o.type.rank-a.type.rank),i}};$l.none=[];class hpe extends Error{}class zr{constructor(n,i,o){this.content=n,this.openStart=i,this.openEnd=o}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(n,i){let o=asn(this.content,n+this.openStart,i);return o&&new zr(o,this.openStart,this.openEnd)}removeBetween(n,i){return new zr(osn(this.content,n+this.openStart,i+this.openStart),this.openStart,this.openEnd)}eq(n){return this.content.eq(n.content)&&this.openStart==n.openStart&&this.openEnd==n.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let n={content:this.content.toJSON()};return this.openStart>0&&(n.openStart=this.openStart),this.openEnd>0&&(n.openEnd=this.openEnd),n}static fromJSON(n,i){if(!i)return zr.empty;let o=i.openStart||0,a=i.openEnd||0;if(typeof o!="number"||typeof a!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new zr(An.fromJSON(n,i.content),o,a)}static maxOpen(n,i=!0){let o=0,a=0;for(let c=n.firstChild;c&&!c.isLeaf&&(i||!c.type.spec.isolating);c=c.firstChild)o++;for(let c=n.lastChild;c&&!c.isLeaf&&(i||!c.type.spec.isolating);c=c.lastChild)a++;return new zr(n,o,a)}}zr.empty=new zr(An.empty,0,0);function osn(t,n,i){let{index:o,offset:a}=t.findIndex(n),c=t.maybeChild(o),{index:u,offset:f}=t.findIndex(i);if(a==n||c.isText){if(f!=i&&!t.child(u).isText)throw new RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(i))}if(o!=u)throw new RangeError("Removing non-flat range");return t.replaceChild(o,c.copy(osn(c.content,n-a-1,i-a-1)))}function asn(t,n,i,o){let{index:a,offset:c}=t.findIndex(n),u=t.maybeChild(a);if(c==n||u.isText)return o&&!o.canReplace(a,a,i)?null:t.cut(0,n).append(i).append(t.cut(n));let f=asn(u.content,n-c-1,i,u);return f&&t.replaceChild(a,u.copy(f))}function l3r(t,n,i){if(i.openStart>t.depth)throw new hpe("Inserted content deeper than insertion position");if(t.depth-i.openStart!=n.depth-i.openEnd)throw new hpe("Inconsistent open depths");return lsn(t,n,i,0)}function lsn(t,n,i,o){let a=t.index(o),c=t.node(o);if(a==n.index(o)&&o<t.depth-i.openStart){let u=lsn(t,n,i,o+1);return c.copy(c.content.replaceChild(a,u))}else if(i.content.size)if(!i.openStart&&!i.openEnd&&t.depth==o&&n.depth==o){let u=t.parent,f=u.content;return YD(u,f.cut(0,t.parentOffset).append(i.content).append(f.cut(n.parentOffset)))}else{let{start:u,end:f}=c3r(i,t);return YD(c,usn(t,u,f,n,o))}else return YD(c,ppe(t,n,o))}function csn(t,n){if(!n.type.compatibleContent(t.type))throw new hpe("Cannot join "+n.type.name+" onto "+t.type.name)}function _Re(t,n,i){let o=t.node(i);return csn(o,n.node(i)),o}function JD(t,n){let i=n.length-1;i>=0&&t.isText&&t.sameMarkup(n[i])?n[i]=t.withText(n[i].text+t.text):n.push(t)}function ZV(t,n,i,o){let a=(n||t).node(i),c=0,u=n?n.index(i):a.childCount;t&&(c=t.index(i),t.depth>i?c++:t.textOffset&&(JD(t.nodeAfter,o),c++));for(let f=c;f<u;f++)JD(a.child(f),o);n&&n.depth==i&&n.textOffset&&JD(n.nodeBefore,o)}function YD(t,n){return t.type.checkContent(n),t.copy(n)}function usn(t,n,i,o,a){let c=t.depth>a&&_Re(t,n,a+1),u=o.depth>a&&_Re(i,o,a+1),f=[];return ZV(null,t,a,f),c&&u&&n.index(a)==i.index(a)?(csn(c,u),JD(YD(c,usn(t,n,i,o,a+1)),f)):(c&&JD(YD(c,ppe(t,n,a+1)),f),ZV(n,i,a,f),u&&JD(YD(u,ppe(i,o,a+1)),f)),ZV(o,null,a,f),new An(f)}function ppe(t,n,i){let o=[];if(ZV(null,t,i,o),t.depth>i){let a=_Re(t,n,i+1);JD(YD(a,ppe(t,n,i+1)),o)}return ZV(n,null,i,o),new An(o)}function c3r(t,n){let i=n.depth-t.openStart,a=n.node(i).copy(t.content);for(let c=i-1;c>=0;c--)a=n.node(c).copy(An.from(a));return{start:a.resolveNoCache(t.openStart+i),end:a.resolveNoCache(a.content.size-t.openEnd-i)}}class eJ{constructor(n,i,o){this.pos=n,this.path=i,this.parentOffset=o,this.depth=i.length/3-1}resolveDepth(n){return n==null?this.depth:n<0?this.depth+n:n}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(n){return this.path[this.resolveDepth(n)*3]}index(n){return this.path[this.resolveDepth(n)*3+1]}indexAfter(n){return n=this.resolveDepth(n),this.index(n)+(n==this.depth&&!this.textOffset?0:1)}start(n){return n=this.resolveDepth(n),n==0?0:this.path[n*3-1]+1}end(n){return n=this.resolveDepth(n),this.start(n)+this.node(n).content.size}before(n){if(n=this.resolveDepth(n),!n)throw new RangeError("There is no position before the top-level node");return n==this.depth+1?this.pos:this.path[n*3-1]}after(n){if(n=this.resolveDepth(n),!n)throw new RangeError("There is no position after the top-level node");return n==this.depth+1?this.pos:this.path[n*3-1]+this.path[n*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let n=this.parent,i=this.index(this.depth);if(i==n.childCount)return null;let o=this.pos-this.path[this.path.length-1],a=n.child(i);return o?n.child(i).cut(o):a}get nodeBefore(){let n=this.index(this.depth),i=this.pos-this.path[this.path.length-1];return i?this.parent.child(n).cut(0,i):n==0?null:this.parent.child(n-1)}posAtIndex(n,i){i=this.resolveDepth(i);let o=this.path[i*3],a=i==0?0:this.path[i*3-1]+1;for(let c=0;c<n;c++)a+=o.child(c).nodeSize;return a}marks(){let n=this.parent,i=this.index();if(n.content.size==0)return $l.none;if(this.textOffset)return n.child(i).marks;let o=n.maybeChild(i-1),a=n.maybeChild(i);if(!o){let f=o;o=a,a=f}let c=o.marks;for(var u=0;u<c.length;u++)c[u].type.spec.inclusive===!1&&(!a||!c[u].isInSet(a.marks))&&(c=c[u--].removeFromSet(c));return c}marksAcross(n){let i=this.parent.maybeChild(this.index());if(!i||!i.isInline)return null;let o=i.marks,a=n.parent.maybeChild(n.index());for(var c=0;c<o.length;c++)o[c].type.spec.inclusive===!1&&(!a||!o[c].isInSet(a.marks))&&(o=o[c--].removeFromSet(o));return o}sharedDepth(n){for(let i=this.depth;i>0;i--)if(this.start(i)<=n&&this.end(i)>=n)return i;return 0}blockRange(n=this,i){if(n.pos<this.pos)return n.blockRange(this);for(let o=this.depth-(this.parent.inlineContent||this.pos==n.pos?1:0);o>=0;o--)if(n.pos<=this.end(o)&&(!i||i(this.node(o))))return new gpe(this,n,o);return null}sameParent(n){return this.pos-this.parentOffset==n.pos-n.parentOffset}max(n){return n.pos>this.pos?n:this}min(n){return n.pos<this.pos?n:this}toString(){let n="";for(let i=1;i<=this.depth;i++)n+=(n?"/":"")+this.node(i).type.name+"_"+this.index(i-1);return n+":"+this.parentOffset}static resolve(n,i){if(!(i>=0&&i<=n.content.size))throw new RangeError("Position "+i+" out of range");let o=[],a=0,c=i;for(let u=n;;){let{index:f,offset:g}=u.content.findIndex(c),w=c-g;if(o.push(u,f,a+g),!w||(u=u.child(f),u.isText))break;c=w-1,a+=g+1}return new eJ(i,o,c)}static resolveCached(n,i){let o=zzt.get(n);if(o)for(let c=0;c<o.elts.length;c++){let u=o.elts[c];if(u.pos==i)return u}else zzt.set(n,o=new u3r);let a=o.elts[o.i]=eJ.resolve(n,i);return o.i=(o.i+1)%d3r,a}}class u3r{constructor(){this.elts=[],this.i=0}}const d3r=12,zzt=new WeakMap;class gpe{constructor(n,i,o){this.$from=n,this.$to=i,this.depth=o}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const f3r=Object.create(null);let f5=class TRe{constructor(n,i,o,a=$l.none){this.type=n,this.attrs=i,this.marks=a,this.content=o||An.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(n){return this.content.child(n)}maybeChild(n){return this.content.maybeChild(n)}forEach(n){this.content.forEach(n)}nodesBetween(n,i,o,a=0){this.content.nodesBetween(n,i,o,a,this)}descendants(n){this.nodesBetween(0,this.content.size,n)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(n,i,o,a){return this.content.textBetween(n,i,o,a)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(n){return this==n||this.sameMarkup(n)&&this.content.eq(n.content)}sameMarkup(n){return this.hasMarkup(n.type,n.attrs,n.marks)}hasMarkup(n,i,o){return this.type==n&&fpe(this.attrs,i||n.defaultAttrs||f3r)&&$l.sameSet(this.marks,o||$l.none)}copy(n=null){return n==this.content?this:new TRe(this.type,this.attrs,n,this.marks)}mark(n){return n==this.marks?this:new TRe(this.type,this.attrs,this.content,n)}cut(n,i=this.content.size){return n==0&&i==this.content.size?this:this.copy(this.content.cut(n,i))}slice(n,i=this.content.size,o=!1){if(n==i)return zr.empty;let a=this.resolve(n),c=this.resolve(i),u=o?0:a.sharedDepth(i),f=a.start(u),w=a.node(u).content.cut(a.pos-f,c.pos-f);return new zr(w,a.depth-u,c.depth-u)}replace(n,i,o){return l3r(this.resolve(n),this.resolve(i),o)}nodeAt(n){for(let i=this;;){let{index:o,offset:a}=i.content.findIndex(n);if(i=i.maybeChild(o),!i)return null;if(a==n||i.isText)return i;n-=a+1}}childAfter(n){let{index:i,offset:o}=this.content.findIndex(n);return{node:this.content.maybeChild(i),index:i,offset:o}}childBefore(n){if(n==0)return{node:null,index:0,offset:0};let{index:i,offset:o}=this.content.findIndex(n);if(o<n)return{node:this.content.child(i),index:i,offset:o};let a=this.content.child(i-1);return{node:a,index:i-1,offset:o-a.nodeSize}}resolve(n){return eJ.resolveCached(this,n)}resolveNoCache(n){return eJ.resolve(this,n)}rangeHasMark(n,i,o){let a=!1;return i>n&&this.nodesBetween(n,i,c=>(o.isInSet(c.marks)&&(a=!0),!a)),a}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let n=this.type.name;return this.content.size&&(n+="("+this.content.toStringInner()+")"),dsn(this.marks,n)}contentMatchAt(n){let i=this.type.contentMatch.matchFragment(this.content,0,n);if(!i)throw new Error("Called contentMatchAt on a node with invalid content");return i}canReplace(n,i,o=An.empty,a=0,c=o.childCount){let u=this.contentMatchAt(n).matchFragment(o,a,c),f=u&&u.matchFragment(this.content,i);if(!f||!f.validEnd)return!1;for(let g=a;g<c;g++)if(!this.type.allowsMarks(o.child(g).marks))return!1;return!0}canReplaceWith(n,i,o,a){if(a&&!this.type.allowsMarks(a))return!1;let c=this.contentMatchAt(n).matchType(o),u=c&&c.matchFragment(this.content,i);return u?u.validEnd:!1}canAppend(n){return n.content.size?this.canReplace(this.childCount,this.childCount,n.content):this.type.compatibleContent(n.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let n=$l.none;for(let i=0;i<this.marks.length;i++){let o=this.marks[i];o.type.checkAttrs(o.attrs),n=o.addToSet(n)}if(!$l.sameSet(n,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(i=>i.type.name)}`);this.content.forEach(i=>i.check())}toJSON(){let n={type:this.type.name};for(let i in this.attrs){n.attrs=this.attrs;break}return this.content.size&&(n.content=this.content.toJSON()),this.marks.length&&(n.marks=this.marks.map(i=>i.toJSON())),n}static fromJSON(n,i){if(!i)throw new RangeError("Invalid input for Node.fromJSON");let o;if(i.marks){if(!Array.isArray(i.marks))throw new RangeError("Invalid mark data for Node.fromJSON");o=i.marks.map(n.markFromJSON)}if(i.type=="text"){if(typeof i.text!="string")throw new RangeError("Invalid text node in JSON");return n.text(i.text,o)}let a=An.fromJSON(n,i.content),c=n.nodeType(i.type).create(i.attrs,a,o);return c.type.checkAttrs(c.attrs),c}};f5.prototype.text=void 0;class mpe extends f5{constructor(n,i,o,a){if(super(n,i,null,a),!o)throw new RangeError("Empty text nodes are not allowed");this.text=o}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):dsn(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(n,i){return this.text.slice(n,i)}get nodeSize(){return this.text.length}mark(n){return n==this.marks?this:new mpe(this.type,this.attrs,this.text,n)}withText(n){return n==this.text?this:new mpe(this.type,this.attrs,n,this.marks)}cut(n=0,i=this.text.length){return n==0&&i==this.text.length?this:this.withText(this.text.slice(n,i))}eq(n){return this.sameMarkup(n)&&this.text==n.text}toJSON(){let n=super.toJSON();return n.text=this.text,n}}function dsn(t,n){for(let i=t.length-1;i>=0;i--)n=t[i].type.name+"("+n+")";return n}class y9{constructor(n){this.validEnd=n,this.next=[],this.wrapCache=[]}static parse(n,i){let o=new h3r(n,i);if(o.next==null)return y9.empty;let a=fsn(o);o.next&&o.err("Unexpected trailing text");let c=x3r(y3r(a));return v3r(c,o),c}matchType(n){for(let i=0;i<this.next.length;i++)if(this.next[i].type==n)return this.next[i].next;return null}matchFragment(n,i=0,o=n.childCount){let a=this;for(let c=i;a&&c<o;c++)a=a.matchType(n.child(c).type);return a}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let n=0;n<this.next.length;n++){let{type:i}=this.next[n];if(!(i.isText||i.hasRequiredAttrs()))return i}return null}compatible(n){for(let i=0;i<this.next.length;i++)for(let o=0;o<n.next.length;o++)if(this.next[i].type==n.next[o].type)return!0;return!1}fillBefore(n,i=!1,o=0){let a=[this];function c(u,f){let g=u.matchFragment(n,o);if(g&&(!i||g.validEnd))return An.from(f.map(w=>w.createAndFill()));for(let w=0;w<u.next.length;w++){let{type:x,next:v}=u.next[w];if(!(x.isText||x.hasRequiredAttrs())&&a.indexOf(v)==-1){a.push(v);let C=c(v,f.concat(x));if(C)return C}}return null}return c(this,[])}findWrapping(n){for(let o=0;o<this.wrapCache.length;o+=2)if(this.wrapCache[o]==n)return this.wrapCache[o+1];let i=this.computeWrapping(n);return this.wrapCache.push(n,i),i}computeWrapping(n){let i=Object.create(null),o=[{match:this,type:null,via:null}];for(;o.length;){let a=o.shift(),c=a.match;if(c.matchType(n)){let u=[];for(let f=a;f.type;f=f.via)u.push(f.type);return u.reverse()}for(let u=0;u<c.next.length;u++){let{type:f,next:g}=c.next[u];!f.isLeaf&&!f.hasRequiredAttrs()&&!(f.name in i)&&(!a.type||g.validEnd)&&(o.push({match:f.contentMatch,type:f,via:a}),i[f.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(n){if(n>=this.next.length)throw new RangeError(`There's no ${n}th edge in this content match`);return this.next[n]}toString(){let n=[];function i(o){n.push(o);for(let a=0;a<o.next.length;a++)n.indexOf(o.next[a].next)==-1&&i(o.next[a].next)}return i(this),n.map((o,a)=>{let c=a+(o.validEnd?"*":" ")+" ";for(let u=0;u<o.next.length;u++)c+=(u?", ":"")+o.next[u].type.name+"->"+n.indexOf(o.next[u].next);return c}).join(`
|
|
1003
|
+
`).trim()}function Hkr(t){const n={};for(const i of t.matchAll(zkr)){const[,o,a,c,u]=i;o&&(n[o]=a??c??u??"")}return n}function Ukr(t,n){var g,w;const i=(g=n.type)==null?void 0:g.trim(),o=(w=n.version)==null?void 0:w.trim();if(!i||o!=="1")return null;const{id:a,type:c,version:u,...f}=n;return{type:i,version:1,...a?{id:a}:{},refs:f,raw:t}}function Wkr(t,n={}){var c;if(!n.allowCards){const u=MOe(t);return u?[{type:"text",content:u}]:[]}const i=[];let o=0;for(const u of t.matchAll(Bkr)){const f=u[0],g=u.index??0,w=MOe(t.slice(o,g));w&&i.push({type:"text",content:w});const x=Hkr(((c=u.groups)==null?void 0:c.attrs)??""),v=Ukr(f,x);v?i.push({type:"card",card:v}):i.push({type:"text",content:f}),o=g+f.length}const a=MOe(t.slice(o));return a&&i.push({type:"text",content:a}),i}const qkr=/(?:^|\/)(docs|skills)\//,Gkr=new Set(["AGENTS.md","README.md","CLAUDE.md"]),Vkr=/^(.+\.(?:md|markdown|mdx)):(\d+)$/i;function Ize(t){try{return decodeURIComponent(t)}catch{return t}}function Kkr(t){return t.replace(/%/g,"%25").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F").replace(/#/g,"%23").replace(/\s/g,"%20")}function esn(t){return t?Ize(t):null}function Jkr(t){let n=Ize(t.trim());n.startsWith("file://")&&(n=n.replace(/^file:\/+/,"/"));const i=qkr.exec(n);if((i==null?void 0:i.index)!==void 0)return n.slice(i.index).replace(/^\/+/,"");const o=n.split("/").filter(Boolean).at(-1);return o&&Gkr.has(o)?o:n.replace(/^\/+/,"")}function Rzt(t){if(!t)return;const n=Number.parseInt(t,10);return Number.isFinite(n)&&n>0?n:void 0}function tsn(t,n){const i=t.indexOf("?"),o=i>=0?t.slice(0,i):t,a=i>=0?t.slice(i+1):"",c=new URLSearchParams(a),u=Rzt(c.get("line")),f=Vkr.exec(o),g=Jkr(f?f[1]:o),w=u??Rzt((f==null?void 0:f[2])??null),x=n?Ize(n):void 0;return{path:g,...w?{line:w}:{},...x?{anchor:x}:{}}}function nsn(t,n,i=!1){const o=[`path=${Kkr(n.path)}`];return n.line&&o.push(`line=${n.line}`),{pathname:`/ws/${t}/docs`,search:`?${o.join("&")}`,hash:n.anchor?`#${i?encodeURIComponent(n.anchor):n.anchor}`:""}}const Ykr={hint:"taskDetail.systemChip.hint",retry:"taskDetail.systemChip.retryFailedTask"};function Xkr(t){for(const n of t){if(!n.type)continue;const i=Ykr[n.type];if(i)return i}return"taskDetail.systemChip.systemContext"}function NOe(t){return t instanceof Error?t.message:String(t)}function Qkr(t,n){const i=t.findIndex(a=>a.id===n.id);if(i===-1)return[n,...t];const o=[...t];return o[i]=n,o}const Iv=nf((t,n)=>{const i=(c,u)=>{t(f=>({loadingIds:{...f.loadingIds,[c]:u}}))},o=c=>(t(u=>({runs:Qkr(u.runs,c),error:null})),c),a=async(c,u)=>{i(c,!0);try{return o(await u())}catch(f){throw t({error:NOe(f)}),f}finally{i(c,!1)}};return{runs:[],loadingIds:{},error:null,startRun:async(c,u)=>{try{return o(await wn.startWorkflowRun(c,u))}catch(f){throw t({error:NOe(f)}),f}},resolveCard:async c=>{try{return o(await wn.resolveWorkflowCard(c))}catch(u){throw t({error:NOe(u)}),u}},refreshRun:c=>a(c,()=>wn.getWorkflowRun(c)),resumeRun:(c,u)=>a(c,()=>wn.resumeWorkflowRun(c,u)),approveRun:(c,u)=>a(c,()=>wn.approveWorkflowRun(c,u)),rejectRun:(c,u)=>a(c,()=>wn.rejectWorkflowRun(c,u)),cancelRun:(c,u)=>a(c,()=>wn.cancelWorkflowRun(c,u)),removeRun:c=>{t(u=>{const{[c]:f,...g}=u.loadingIds;return{runs:n().runs.filter(w=>w.id!==c),loadingIds:g}})}}});function Zkr(t,n){return n||t.phase==="running"||t.phase==="not_started"?S.jsx(Is,{size:16,className:"animate-spin text-blue-600","aria-hidden":"true"}):t.phase==="waiting_approval"?S.jsx(DFe,{size:16,className:"text-amber-600","aria-hidden":"true"}):t.phase==="completed"?S.jsx(bR,{size:16,className:"text-emerald-600","aria-hidden":"true"}):t.phase==="failed"?S.jsx(I9,{size:16,className:"text-red-600","aria-hidden":"true"}):t.phase==="cancelled"?S.jsx(qJ,{size:16,className:"text-gray-500","aria-hidden":"true"}):S.jsx(q6,{size:16,className:"text-gray-500","aria-hidden":"true"})}function e3r(t){if(typeof t!="number"||Number.isNaN(t))return"";if(t<1e3)return`${t}ms`;const n=t/1e3;if(n<60)return`${n.toFixed(n<10?1:0)}s`;const i=Math.floor(n/60),o=Math.round(n%60);return`${i}m ${o}s`}function t3r(t,n){return t.status==="current"&&n?S.jsx(Is,{size:14,className:"animate-spin","aria-hidden":"true"}):t.status==="current"?S.jsx(Is,{size:14,className:"animate-spin","aria-hidden":"true"}):t.status==="waiting_approval"?S.jsx(DFe,{size:14,"aria-hidden":"true"}):t.status==="paused"?S.jsx(rUn,{size:14,"aria-hidden":"true"}):t.status==="completed"?S.jsx(bR,{size:14,"aria-hidden":"true"}):t.status==="failed"?S.jsx(I9,{size:14,"aria-hidden":"true"}):t.status==="cancelled"?S.jsx(qJ,{size:14,"aria-hidden":"true"}):S.jsx(rJt,{size:10,"aria-hidden":"true"})}function n3r(t){return t.status==="completed"?"border-emerald-200 bg-emerald-50 text-emerald-700":t.status==="waiting_approval"?"border-amber-200 bg-amber-50 text-amber-700":t.status==="current"?"border-blue-200 bg-blue-50 text-blue-700":t.status==="failed"?"border-red-200 bg-red-50 text-red-700":t.status==="cancelled"?"border-gray-300 bg-gray-100 text-gray-600":t.status==="paused"?"border-violet-200 bg-violet-50 text-violet-700":"border-gray-200 bg-white text-gray-400"}function r3r(t){try{return JSON.stringify(t,null,2)}catch{return"{}"}}function $zt(t,n){return t?`${t.id} · ${n}`:""}function i3r({run:t,loading:n=!1,onApprove:i,onReject:o,onCancel:a,onRefresh:c}){var P;const{t:u}=Zn(),[f,g]=F.useState(()=>t.phase==="running"||t.phase==="waiting_approval"||t.phase==="failed"),w=t.audit.at(-1),x=R=>u(`workflowRun.nodeType.${R.type}`,{defaultValue:R.typeLabel||R.type}),v=t.currentNode?`${t.currentNode.id} · ${x(t.currentNode)}`:u("workflowRun.noCurrentNode"),C=t.phase==="waiting_approval",E=t.canCancel&&["not_started","running","paused","waiting_approval"].includes(t.phase),A=Object.keys(t.state??{}).length,M=r3r(t.state??{}),I=(P=t.timeline)!=null&&P.length?t.timeline:[],D=I.length;return S.jsxs("div",{className:"w-full rounded-lg border border-gray-200 bg-white shadow-sm",children:[S.jsxs("div",{className:"flex items-start gap-3 border-b border-gray-100 px-4 py-3",children:[S.jsx("div",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-blue-50 text-blue-600",children:S.jsx(D7,{size:17,"aria-hidden":"true"})}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[S.jsx("h3",{className:"truncate text-sm font-semibold text-gray-900",children:t.workflowName}),S.jsx("span",{className:"inline-flex items-center gap-1 rounded-full border border-blue-100 bg-blue-50 px-2 py-0.5 text-[11px] font-medium text-blue-700",children:u("workflowRun.autoDefault")}),S.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-gray-200 bg-gray-50 px-2 py-0.5 text-[11px] font-medium text-gray-600",children:[Zkr(t,n),u(`workflowRun.phase.${t.phase}`)]})]}),S.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-gray-500",children:t.workflowDescription||t.workflowId})]})]}),S.jsxs("div",{className:"space-y-3 px-4 py-3",children:[S.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md bg-gray-50 px-3 py-2 text-xs text-gray-600",children:[S.jsx("span",{children:v}),S.jsx("span",{children:u("workflowRun.timeline.summary",{completed:t.completedCount,visible:D})})]}),S.jsxs("div",{children:[S.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2 text-xs font-medium text-gray-700",children:[S.jsxs("button",{type:"button",onClick:()=>g(R=>!R),className:"inline-flex min-w-0 items-center gap-1.5 rounded px-1 py-0.5 text-left transition hover:bg-gray-100","aria-expanded":f,children:[S.jsx(vg,{size:14,"aria-hidden":"true",className:`shrink-0 transition-transform ${f?"":"-rotate-90"}`}),S.jsx("span",{children:u("workflowRun.timeline.title")})]}),S.jsx("button",{type:"button",onClick:()=>g(R=>!R),className:"shrink-0 rounded px-1 py-0.5 text-[11px] font-normal text-gray-400 transition hover:bg-gray-100 hover:text-gray-600","aria-expanded":f,children:u("workflowRun.timeline.count",{completed:t.completedCount,visible:D})})]}),f?S.jsx("ol",{className:"space-y-0",children:I.map((R,z)=>{var te,Q,se;const U=z===I.length-1,W=R.status==="waiting_approval"&&t.phase==="waiting_approval",G=e3r(R.durationMs),Y=x(R);return S.jsxs("li",{className:"relative grid grid-cols-[28px_1fr] gap-2 pb-3 last:pb-0",children:[!U&&S.jsx("span",{"aria-hidden":"true",className:["absolute left-[13px] top-7 h-[calc(100%-1.25rem)] w-px",R.status==="completed"?"bg-emerald-200":"bg-gray-200"].join(" ")}),S.jsx("span",{className:`relative z-10 mt-0.5 flex h-7 w-7 items-center justify-center rounded-full border ${n3r(R)}`,children:t3r(R,n)}),S.jsx("div",{className:["min-w-0 rounded-md border px-3 py-2",R.status==="pending"?"border-transparent bg-transparent px-0 text-gray-400":R.status==="waiting_approval"?"border-amber-200 bg-amber-50":R.status==="current"?"border-blue-100 bg-blue-50":R.status==="failed"?"border-red-100 bg-red-50":R.status==="cancelled"?"border-gray-200 bg-gray-50":"border-gray-100 bg-white"].join(" "),children:S.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[S.jsx("span",{className:"font-mono text-[11px] font-semibold text-gray-900",children:R.id}),S.jsx("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-[10px] font-medium text-gray-600",children:Y}),R.agent&&S.jsxs("span",{className:"rounded bg-blue-50 px-1.5 py-0.5 text-[10px] font-medium text-blue-700",children:["@",R.agent]})]}),R.description&&S.jsx("p",{className:"mt-1 line-clamp-2 text-xs leading-5 text-gray-600",children:R.description}),R.error&&S.jsx("p",{className:"mt-1 text-xs leading-5 text-red-700",children:R.error}),W&&S.jsxs("div",{className:"mt-3 rounded-md border border-amber-200 bg-white/70 px-3 py-3 text-xs text-amber-900",children:[S.jsx("div",{className:"mb-1 text-sm font-semibold text-amber-950",children:u("workflowRun.approval.title")}),S.jsx("p",{className:"whitespace-pre-wrap leading-5",children:((te=t.approval)==null?void 0:te.question)||u("workflowRun.approval.fallbackQuestion")}),S.jsxs("div",{className:"mt-3 grid gap-1.5 text-[11px] text-amber-800 sm:grid-cols-2",children:[((Q=t.approval)==null?void 0:Q.approveNode)&&S.jsxs("div",{className:"rounded border border-amber-200 bg-white/70 px-2 py-1.5",children:[S.jsx("span",{className:"font-medium",children:u("workflowRun.approval.approvePath")})," ",S.jsx("span",{children:$zt(t.approval.approveNode,x(t.approval.approveNode))})]}),((se=t.approval)==null?void 0:se.rejectNode)&&S.jsxs("div",{className:"rounded border border-amber-200 bg-white/70 px-2 py-1.5",children:[S.jsx("span",{className:"font-medium",children:u("workflowRun.approval.rejectPath")})," ",S.jsx("span",{children:$zt(t.approval.rejectNode,x(t.approval.rejectNode))})]})]})]})]}),S.jsxs("div",{className:"shrink-0 text-right text-[11px] text-gray-400",children:[S.jsx("div",{children:u(`workflowRun.timeline.status.${R.status}`)}),G&&S.jsx("div",{className:"mt-0.5",children:G})]})]})})]},R.id)})}):S.jsx("div",{className:"rounded-md border border-gray-100 bg-gray-50 px-3 py-2 text-xs text-gray-500",children:u("workflowRun.timeline.collapsed",{completed:t.completedCount,visible:D})})]}),t.phase==="failed"&&(w==null?void 0:w.error)&&S.jsx("div",{className:"rounded-md border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-700",children:w.error}),t.phase==="cancelled"&&S.jsx("div",{className:"rounded-md border border-gray-200 bg-gray-50 px-3 py-2 text-xs text-gray-600",children:(w==null?void 0:w.error)||u("workflowRun.cancelledHint")}),w&&t.phase!=="failed"&&S.jsx("div",{className:"truncate text-xs text-gray-500",children:u("workflowRun.lastAudit",{node:w.node_id,duration:w.duration_ms})}),S.jsxs("details",{className:"group rounded-md border border-gray-200 bg-gray-50",children:[S.jsxs("summary",{className:"flex cursor-pointer list-none items-center justify-between gap-2 px-3 py-2 text-xs font-medium text-gray-700 marker:hidden",children:[S.jsx("span",{children:u("workflowRun.state.title")}),S.jsx("span",{className:"text-[11px] font-normal text-gray-400",children:u("workflowRun.state.keyCount",{count:A})})]}),A===0?S.jsx("div",{className:"border-t border-gray-200 px-3 py-2 text-xs text-gray-500",children:u("workflowRun.state.empty")}):S.jsx("pre",{className:"max-h-64 overflow-auto border-t border-gray-200 px-3 py-2 font-mono text-[11px] leading-5 text-gray-700",children:M})]}),S.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[C&&S.jsxs(S.Fragment,{children:[S.jsxs("button",{type:"button",onClick:i,disabled:n||!t.canApprove,className:"inline-flex h-8 items-center gap-1.5 rounded-md bg-blue-600 px-3 text-xs font-medium text-white shadow-sm transition hover:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(dJt,{size:13,"aria-hidden":"true"}),u("workflowRun.approve")]}),S.jsx("button",{type:"button",onClick:o,disabled:n||!t.canReject,className:"inline-flex h-8 items-center rounded-md border border-gray-200 bg-white px-3 text-xs font-medium text-gray-700 shadow-sm transition hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",children:u("workflowRun.reject")})]}),E&&S.jsxs("button",{type:"button",onClick:a,disabled:n,className:"inline-flex h-8 items-center gap-1.5 rounded-md border border-red-200 bg-white px-3 text-xs font-medium text-red-700 shadow-sm transition hover:bg-red-50 disabled:cursor-not-allowed disabled:opacity-50",children:[S.jsx(qJ,{size:13,"aria-hidden":"true"}),u("workflowRun.stop")]}),S.jsx("button",{type:"button",onClick:c,disabled:n,className:"inline-flex h-8 items-center rounded-md border border-gray-200 bg-white px-3 text-xs font-medium text-gray-700 shadow-sm transition hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",children:u("workflowRun.refresh")}),S.jsx("span",{className:"ml-auto truncate text-[11px] text-gray-400",children:t.id})]})]})]})}function rsn({card:t}){return S.jsx("div",{className:"rounded-md border border-gray-200 bg-gray-50 px-3 py-2 font-mono text-xs text-gray-500",children:t.raw})}function s3r({card:t}){const{t:n}=Zn(),i=Lm(R=>R.addToast),o=t.refs.run_id,a=t.refs.workflow_id,c=t.refs.mode==="manual"?"manual":"auto",u=t.refs.proof,f=Iv(R=>R.runs),g=Iv(R=>R.loadingIds),w=Iv(R=>R.resolveCard),x=Iv(R=>R.refreshRun),v=Iv(R=>R.approveRun),C=Iv(R=>R.rejectRun),E=Iv(R=>R.cancelRun),[A,M]=F.useState("pending"),I=f.find(R=>R.id===o),D=o?g[o]:!1;if(F.useEffect(()=>{if(!o||!a||!u){M("invalid");return}let R=!0;return M("pending"),w({type:"workflow",version:1,runId:o,workflowId:a,mode:c,proof:u}).then(()=>{R&&M("valid")}).catch(z=>{if(!R)return;const U=z instanceof Error?z.message:String(z);M(U.toLowerCase().includes("expired")?"expired":"invalid")}),()=>{R=!1}},[c,u,w,o,a]),!o||!a)return S.jsx(rsn,{card:t});if(A==="invalid")return S.jsx("div",{className:"rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-500",children:n("workflowRun.unverifiedCard")});if(A==="expired")return S.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-800",children:[S.jsx("div",{className:"font-medium",children:n("workflowRun.expiredCard.title")}),S.jsx("div",{className:"mt-1 text-xs",children:n("workflowRun.expiredCard.description",{id:a})})]});if(A!=="valid"||!I)return S.jsx("div",{className:"rounded-lg border border-gray-200 bg-white px-4 py-3 text-sm text-gray-500",children:n("workflowRun.loadingCard")});const P=(R,z)=>{i({type:"error",message:n(R,{message:z instanceof Error?z.message:String(z)})})};return S.jsx(i3r,{run:I,loading:D,onRefresh:()=>{x(I.id).catch(R=>P("workflowRun.refreshFailed",R))},onApprove:()=>{v(I.id,u).catch(R=>P("workflowRun.approveFailed",R))},onReject:()=>{C(I.id,u).catch(R=>P("workflowRun.rejectFailed",R))},onCancel:()=>{E(I.id,u).catch(R=>P("workflowRun.cancelFailed",R))}})}function o3r({card:t}){return t.type==="workflow"?S.jsx(s3r,{card:t}):S.jsx(rsn,{card:t})}function Fzt(t,n){try{return new Date(t).toLocaleTimeString(n,{hour:"2-digit",minute:"2-digit",hour12:!1})}catch{return""}}function Bzt(t,n,i){if(t.startsWith("blob:")||t.startsWith("data:"))return t;const o=t.split("/").pop()??"",a=t.split("/").at(-2)??i??"";return`/api/v1/ws/${n??"_"}/threads/${a}/messages/attachments/${o}`}function a3r(t,n){return(n==null?void 0:n.trim())||t.split("/").pop()||t}function SRe({message:t,logs:n,childTasks:i,taskStatus:o,taskError:a,onRequestLogs:c,onStopTask:u,onRetryTask:f}){var Ve,at;const{i18n:g,t:w}=Zn(),x=Ff(),v=Cg(),C=Zge(),E=!t.isAssistant,A=F.useCallback((yt,Nt)=>{v(nsn(x.slug??"_",tsn(yt,Nt)))},[v,x.slug]),[M,I]=F.useState(null),[D,P]=F.useState(!1),[R,z]=F.useState(!1),U=F.useRef(null),W=F.useRef(null),{cleanText:G,systemBlocks:Y}=F.useMemo(()=>Lkr(t.text??""),[t.text]),{userCleanText:te,userImages:Q,userAttachments:se}=F.useMemo(()=>{const{cleanText:yt,images:Nt}=$kr(G),{cleanText:pt,attachments:St}=Fkr(yt);return{userCleanText:pt,userImages:Nt,userAttachments:St}},[G]),ce=F.useMemo(()=>Y.length>0?Xkr(Y):null,[Y]);F.useEffect(()=>()=>{U.current&&window.clearTimeout(U.current),W.current&&window.clearTimeout(W.current)},[]);const V=(yt,Nt)=>{Nt(!0),yt.current&&window.clearTimeout(yt.current),yt.current=window.setTimeout(()=>{Nt(!1),yt.current=null},1500)},ae=async(yt,Nt,pt)=>{var St;if(yt.trim())try{if(!((St=navigator.clipboard)!=null&&St.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(yt),V(pt,Nt)}catch(Bt){console.error("[MessageBubble] Failed to copy text.",Bt)}};if(E){const yt=te.trim().length>0;return S.jsxs("div",{className:"group flex justify-end",children:[S.jsxs("div",{className:"relative max-w-[80%]",children:[S.jsx("button",{type:"button",onClick:()=>void ae(te,P,U),disabled:!yt,"aria-label":w(D?"common.copied":"common.copy"),className:"absolute right-full top-2 mr-2 inline-flex items-center justify-center rounded border border-gray-200 bg-white p-1 text-gray-400 shadow-sm opacity-0 transition-opacity duration-150 group-hover:opacity-100 disabled:pointer-events-none disabled:text-gray-200",children:D?S.jsx(xg,{size:12,"aria-hidden":"true"}):S.jsx(x5,{size:12,"aria-hidden":"true"})}),S.jsxs("div",{className:"bg-blue-600 rounded-xl rounded-br-none px-4 py-2.5",children:[Q.length>0&&S.jsx("div",{className:"flex flex-wrap gap-2 mb-2",children:Q.map((Nt,pt)=>{const St=Bzt(Nt.path,x.slug,x.threadId);return S.jsx("img",{src:St,alt:"",className:"max-w-[120px] max-h-[120px] rounded-lg cursor-pointer object-cover",onClick:()=>I({src:St})},pt)})}),se.length>0&&S.jsx("div",{className:"mb-2 flex flex-col gap-2",children:se.map((Nt,pt)=>{const St=Bzt(Nt.path,x.slug,x.threadId),Bt=a3r(Nt.path,Nt.name);return S.jsxs("a",{href:St,target:"_blank",rel:"noopener noreferrer",title:Bt,className:"inline-flex max-w-full items-center gap-3 rounded-lg border border-blue-200 bg-white px-3 py-2 text-gray-900 shadow-sm transition-colors hover:bg-blue-50",children:[S.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-red-50 text-red-600",children:S.jsx(Tx,{size:18,"aria-hidden":"true"})}),S.jsx("span",{className:"truncate text-sm font-medium",children:Bt})]},`${Nt.path}-${pt}`)})}),t.imageDataUrl?S.jsx("img",{src:t.imageDataUrl,alt:w("taskDetail.captureAlt"),className:"max-w-full rounded-lg"}):S.jsx(w9,{content:te,variant:"dark-bg",onLocalLink:A}),ce&&S.jsx("div",{className:"mt-3 border-t border-white/25 pt-2",children:S.jsxs("div",{className:"inline-flex max-w-full items-center gap-1.5 rounded-full border border-white/30 bg-white/10 px-2.5 py-1 text-[11px] font-medium text-blue-50 backdrop-blur-sm",children:[S.jsx("span",{className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-white/55 text-[10px] font-semibold leading-none text-white/90",children:"i"}),S.jsx("span",{className:"min-w-0 truncate",children:w(ce)})]})}),S.jsx("span",{className:"text-[10px] text-blue-200 mt-1 block text-right",children:Fzt(t.timestamp,g.language)})]})]}),M&&S.jsx(Dkr,{src:M.src,alt:M.alt,onClose:()=>I(null)})]})}const de=((Ve=t.metadata)==null?void 0:Ve.agent_id)??"assistant",ee=C[de],ue=(ee==null?void 0:ee.name)??de,he=!!((at=t.text)!=null&&at.trim()),ge=F.useMemo(()=>Wkr(t.text??"",{allowCards:!0}),[t.text]),oe=ge.some(yt=>yt.type==="card"&&yt.card.type==="workflow"),Ae=oe?null:o,Te=Ae==="running"||Ae==="pending",ve=Ae==="failed";return S.jsxs("div",{className:"flex gap-2.5",children:[S.jsx(G6,{provider:ee==null?void 0:ee.provider,size:16,className:"mt-1 h-8 w-8 rounded-full border border-gray-200 bg-white"}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[S.jsx("span",{className:"text-xs font-medium text-gray-900 truncate",title:ue,children:ue}),S.jsx("span",{className:"text-[10px] text-gray-500",children:Fzt(t.timestamp,g.language)}),Te&&S.jsxs(S.Fragment,{children:[S.jsxs("span",{className:"inline-flex items-center gap-1 bg-green-100 text-green-800 text-[11px] font-medium px-2 py-0.5 rounded-lg",children:[S.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 animate-blink"}),w("taskDetail.running","실행 중")]}),u&&S.jsx("button",{type:"button",onClick:u,className:"w-5 h-5 rounded-full bg-red-100 border border-red-300 text-red-500 hover:bg-red-500 hover:border-red-600 hover:text-white transition-colors flex items-center justify-center shrink-0",children:S.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentColor","aria-hidden":"true",children:S.jsx("rect",{x:"1",y:"1",width:"7",height:"7",rx:"1.5"})})})]}),ve&&S.jsxs(S.Fragment,{children:[S.jsxs("span",{className:"inline-flex items-center gap-1 bg-red-50 text-red-600 text-[11px] font-medium px-2 py-0.5 rounded-lg border border-red-200",children:[S.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500"}),w("taskDetail.failed","실패")]}),f&&S.jsx("button",{type:"button",onClick:f,title:w("taskDetail.retry","재시도"),className:"w-5 h-5 rounded-full bg-blue-50 border border-blue-300 text-blue-500 hover:bg-blue-500 hover:border-blue-600 hover:text-white transition-colors flex items-center justify-center shrink-0",children:S.jsx(y0,{size:10,"aria-hidden":"true"})})]})]}),t.text?S.jsxs("div",{className:"relative",children:[S.jsx("button",{type:"button",onClick:()=>void ae(t.text??"",z,W),disabled:!he,"aria-label":w(R?"common.copied":"common.copy"),className:"absolute right-2 top-2 z-10 inline-flex items-center justify-center rounded border border-gray-200 bg-white p-1 text-gray-400 shadow-sm transition-colors hover:bg-gray-50 hover:text-gray-600 disabled:cursor-not-allowed disabled:text-gray-200",children:R?S.jsx(xg,{size:12,"aria-hidden":"true"}):S.jsx(x5,{size:12,"aria-hidden":"true"})}),S.jsx("div",{className:"space-y-3 bg-white border border-gray-200 rounded-lg px-4 py-3 pr-8",children:ge.map((yt,Nt)=>yt.type==="card"?S.jsx(o3r,{card:yt.card},`${yt.card.type}-${yt.card.id??yt.card.refs.run_id??Nt}`):S.jsx(w9,{content:yt.content,onLocalLink:A},`text-${Nt}`))})]}):Te?S.jsx("div",{className:"bg-white border border-gray-200 rounded-lg px-4 py-3 w-fit",children:S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx("span",{className:"w-2 h-2 rounded-full bg-gray-400 animate-dot-bounce"}),S.jsx("span",{className:"w-2 h-2 rounded-full bg-gray-400 animate-dot-bounce [animation-delay:150ms]"}),S.jsx("span",{className:"w-2 h-2 rounded-full bg-gray-400 animate-dot-bounce [animation-delay:300ms]"})]})}):null,ve&&a&&S.jsxs("div",{className:"mt-1.5 flex items-center gap-2 rounded-md border border-red-200 bg-red-50 px-3 py-1.5 text-[11px] text-red-600",children:[S.jsx("span",{className:"flex-1 truncate",children:a}),f&&S.jsx("button",{type:"button",onClick:f,className:"shrink-0 font-medium underline hover:no-underline",children:w("taskDetail.retry","재시도")})]}),!oe&&S.jsx(Dze,{logs:n??[],childTasks:i??[],status:Ae??null,onRequestLogs:c}),!oe&&i&&i.length>0&&S.jsx(jkr,{children:i})]})]})}function fg(t){this.content=t}fg.prototype={constructor:fg,find:function(t){for(var n=0;n<this.content.length;n+=2)if(this.content[n]===t)return n;return-1},get:function(t){var n=this.find(t);return n==-1?void 0:this.content[n+1]},update:function(t,n,i){var o=i&&i!=t?this.remove(i):this,a=o.find(t),c=o.content.slice();return a==-1?c.push(i||t,n):(c[a+1]=n,i&&(c[a]=i)),new fg(c)},remove:function(t){var n=this.find(t);if(n==-1)return this;var i=this.content.slice();return i.splice(n,2),new fg(i)},addToStart:function(t,n){return new fg([t,n].concat(this.remove(t).content))},addToEnd:function(t,n){var i=this.remove(t).content.slice();return i.push(t,n),new fg(i)},addBefore:function(t,n,i){var o=this.remove(n),a=o.content.slice(),c=o.find(t);return a.splice(c==-1?a.length:c,0,n,i),new fg(a)},forEach:function(t){for(var n=0;n<this.content.length;n+=2)t(this.content[n],this.content[n+1])},prepend:function(t){return t=fg.from(t),t.size?new fg(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=fg.from(t),t.size?new fg(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var n=this;t=fg.from(t);for(var i=0;i<t.content.length;i+=2)n=n.remove(t.content[i]);return n},toObject:function(){var t={};return this.forEach(function(n,i){t[n]=i}),t},get size(){return this.content.length>>1}};fg.from=function(t){if(t instanceof fg)return t;var n=[];if(t)for(var i in t)n.push(i,t[i]);return new fg(n)};function isn(t,n,i){for(let o=0;;o++){if(o==t.childCount||o==n.childCount)return t.childCount==n.childCount?null:i;let a=t.child(o),c=n.child(o);if(a==c){i+=a.nodeSize;continue}if(!a.sameMarkup(c))return i;if(a.isText&&a.text!=c.text){for(let u=0;a.text[u]==c.text[u];u++)i++;return i}if(a.content.size||c.content.size){let u=isn(a.content,c.content,i+1);if(u!=null)return u}i+=a.nodeSize}}function ssn(t,n,i,o){for(let a=t.childCount,c=n.childCount;;){if(a==0||c==0)return a==c?null:{a:i,b:o};let u=t.child(--a),f=n.child(--c),g=u.nodeSize;if(u==f){i-=g,o-=g;continue}if(!u.sameMarkup(f))return{a:i,b:o};if(u.isText&&u.text!=f.text){let w=0,x=Math.min(u.text.length,f.text.length);for(;w<x&&u.text[u.text.length-w-1]==f.text[f.text.length-w-1];)w++,i--,o--;return{a:i,b:o}}if(u.content.size||f.content.size){let w=ssn(u.content,f.content,i-1,o-1);if(w)return w}i-=g,o-=g}}class An{constructor(n,i){if(this.content=n,this.size=i||0,i==null)for(let o=0;o<n.length;o++)this.size+=n[o].nodeSize}nodesBetween(n,i,o,a=0,c){for(let u=0,f=0;f<i;u++){let g=this.content[u],w=f+g.nodeSize;if(w>n&&o(g,a+f,c||null,u)!==!1&&g.content.size){let x=f+1;g.nodesBetween(Math.max(0,n-x),Math.min(g.content.size,i-x),o,a+x)}f=w}}descendants(n){this.nodesBetween(0,this.size,n)}textBetween(n,i,o,a){let c="",u=!0;return this.nodesBetween(n,i,(f,g)=>{let w=f.isText?f.text.slice(Math.max(n,g)-g,i-g):f.isLeaf?a?typeof a=="function"?a(f):a:f.type.spec.leafText?f.type.spec.leafText(f):"":"";f.isBlock&&(f.isLeaf&&w||f.isTextblock)&&o&&(u?u=!1:c+=o),c+=w},0),c}append(n){if(!n.size)return this;if(!this.size)return n;let i=this.lastChild,o=n.firstChild,a=this.content.slice(),c=0;for(i.isText&&i.sameMarkup(o)&&(a[a.length-1]=i.withText(i.text+o.text),c=1);c<n.content.length;c++)a.push(n.content[c]);return new An(a,this.size+n.size)}cut(n,i=this.size){if(n==0&&i==this.size)return this;let o=[],a=0;if(i>n)for(let c=0,u=0;u<i;c++){let f=this.content[c],g=u+f.nodeSize;g>n&&((u<n||g>i)&&(f.isText?f=f.cut(Math.max(0,n-u),Math.min(f.text.length,i-u)):f=f.cut(Math.max(0,n-u-1),Math.min(f.content.size,i-u-1))),o.push(f),a+=f.nodeSize),u=g}return new An(o,a)}cutByIndex(n,i){return n==i?An.empty:n==0&&i==this.content.length?this:new An(this.content.slice(n,i))}replaceChild(n,i){let o=this.content[n];if(o==i)return this;let a=this.content.slice(),c=this.size+i.nodeSize-o.nodeSize;return a[n]=i,new An(a,c)}addToStart(n){return new An([n].concat(this.content),this.size+n.nodeSize)}addToEnd(n){return new An(this.content.concat(n),this.size+n.nodeSize)}eq(n){if(this.content.length!=n.content.length)return!1;for(let i=0;i<this.content.length;i++)if(!this.content[i].eq(n.content[i]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(n){let i=this.content[n];if(!i)throw new RangeError("Index "+n+" out of range for "+this);return i}maybeChild(n){return this.content[n]||null}forEach(n){for(let i=0,o=0;i<this.content.length;i++){let a=this.content[i];n(a,o,i),o+=a.nodeSize}}findDiffStart(n,i=0){return isn(this,n,i)}findDiffEnd(n,i=this.size,o=n.size){return ssn(this,n,i,o)}findIndex(n){if(n==0)return Que(0,n);if(n==this.size)return Que(this.content.length,n);if(n>this.size||n<0)throw new RangeError(`Position ${n} outside of fragment (${this})`);for(let i=0,o=0;;i++){let a=this.child(i),c=o+a.nodeSize;if(c>=n)return c==n?Que(i+1,c):Que(i,o);o=c}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(n=>n.toJSON()):null}static fromJSON(n,i){if(!i)return An.empty;if(!Array.isArray(i))throw new RangeError("Invalid input for Fragment.fromJSON");return new An(i.map(n.nodeFromJSON))}static fromArray(n){if(!n.length)return An.empty;let i,o=0;for(let a=0;a<n.length;a++){let c=n[a];o+=c.nodeSize,a&&c.isText&&n[a-1].sameMarkup(c)?(i||(i=n.slice(0,a)),i[i.length-1]=c.withText(i[i.length-1].text+c.text)):i&&i.push(c)}return new An(i||n,o)}static from(n){if(!n)return An.empty;if(n instanceof An)return n;if(Array.isArray(n))return this.fromArray(n);if(n.attrs)return new An([n],n.nodeSize);throw new RangeError("Can not convert "+n+" to a Fragment"+(n.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}An.empty=new An([],0);const jOe={index:0,offset:0};function Que(t,n){return jOe.index=t,jOe.offset=n,jOe}function fpe(t,n){if(t===n)return!0;if(!(t&&typeof t=="object")||!(n&&typeof n=="object"))return!1;let i=Array.isArray(t);if(Array.isArray(n)!=i)return!1;if(i){if(t.length!=n.length)return!1;for(let o=0;o<t.length;o++)if(!fpe(t[o],n[o]))return!1}else{for(let o in t)if(!(o in n)||!fpe(t[o],n[o]))return!1;for(let o in n)if(!(o in t))return!1}return!0}let $l=class ERe{constructor(n,i){this.type=n,this.attrs=i}addToSet(n){let i,o=!1;for(let a=0;a<n.length;a++){let c=n[a];if(this.eq(c))return n;if(this.type.excludes(c.type))i||(i=n.slice(0,a));else{if(c.type.excludes(this.type))return n;!o&&c.type.rank>this.type.rank&&(i||(i=n.slice(0,a)),i.push(this),o=!0),i&&i.push(c)}}return i||(i=n.slice()),o||i.push(this),i}removeFromSet(n){for(let i=0;i<n.length;i++)if(this.eq(n[i]))return n.slice(0,i).concat(n.slice(i+1));return n}isInSet(n){for(let i=0;i<n.length;i++)if(this.eq(n[i]))return!0;return!1}eq(n){return this==n||this.type==n.type&&fpe(this.attrs,n.attrs)}toJSON(){let n={type:this.type.name};for(let i in this.attrs){n.attrs=this.attrs;break}return n}static fromJSON(n,i){if(!i)throw new RangeError("Invalid input for Mark.fromJSON");let o=n.marks[i.type];if(!o)throw new RangeError(`There is no mark type ${i.type} in this schema`);let a=o.create(i.attrs);return o.checkAttrs(a.attrs),a}static sameSet(n,i){if(n==i)return!0;if(n.length!=i.length)return!1;for(let o=0;o<n.length;o++)if(!n[o].eq(i[o]))return!1;return!0}static setFrom(n){if(!n||Array.isArray(n)&&n.length==0)return ERe.none;if(n instanceof ERe)return[n];let i=n.slice();return i.sort((o,a)=>o.type.rank-a.type.rank),i}};$l.none=[];class hpe extends Error{}class zr{constructor(n,i,o){this.content=n,this.openStart=i,this.openEnd=o}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(n,i){let o=asn(this.content,n+this.openStart,i);return o&&new zr(o,this.openStart,this.openEnd)}removeBetween(n,i){return new zr(osn(this.content,n+this.openStart,i+this.openStart),this.openStart,this.openEnd)}eq(n){return this.content.eq(n.content)&&this.openStart==n.openStart&&this.openEnd==n.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let n={content:this.content.toJSON()};return this.openStart>0&&(n.openStart=this.openStart),this.openEnd>0&&(n.openEnd=this.openEnd),n}static fromJSON(n,i){if(!i)return zr.empty;let o=i.openStart||0,a=i.openEnd||0;if(typeof o!="number"||typeof a!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new zr(An.fromJSON(n,i.content),o,a)}static maxOpen(n,i=!0){let o=0,a=0;for(let c=n.firstChild;c&&!c.isLeaf&&(i||!c.type.spec.isolating);c=c.firstChild)o++;for(let c=n.lastChild;c&&!c.isLeaf&&(i||!c.type.spec.isolating);c=c.lastChild)a++;return new zr(n,o,a)}}zr.empty=new zr(An.empty,0,0);function osn(t,n,i){let{index:o,offset:a}=t.findIndex(n),c=t.maybeChild(o),{index:u,offset:f}=t.findIndex(i);if(a==n||c.isText){if(f!=i&&!t.child(u).isText)throw new RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(i))}if(o!=u)throw new RangeError("Removing non-flat range");return t.replaceChild(o,c.copy(osn(c.content,n-a-1,i-a-1)))}function asn(t,n,i,o){let{index:a,offset:c}=t.findIndex(n),u=t.maybeChild(a);if(c==n||u.isText)return o&&!o.canReplace(a,a,i)?null:t.cut(0,n).append(i).append(t.cut(n));let f=asn(u.content,n-c-1,i,u);return f&&t.replaceChild(a,u.copy(f))}function l3r(t,n,i){if(i.openStart>t.depth)throw new hpe("Inserted content deeper than insertion position");if(t.depth-i.openStart!=n.depth-i.openEnd)throw new hpe("Inconsistent open depths");return lsn(t,n,i,0)}function lsn(t,n,i,o){let a=t.index(o),c=t.node(o);if(a==n.index(o)&&o<t.depth-i.openStart){let u=lsn(t,n,i,o+1);return c.copy(c.content.replaceChild(a,u))}else if(i.content.size)if(!i.openStart&&!i.openEnd&&t.depth==o&&n.depth==o){let u=t.parent,f=u.content;return YD(u,f.cut(0,t.parentOffset).append(i.content).append(f.cut(n.parentOffset)))}else{let{start:u,end:f}=c3r(i,t);return YD(c,usn(t,u,f,n,o))}else return YD(c,ppe(t,n,o))}function csn(t,n){if(!n.type.compatibleContent(t.type))throw new hpe("Cannot join "+n.type.name+" onto "+t.type.name)}function _Re(t,n,i){let o=t.node(i);return csn(o,n.node(i)),o}function JD(t,n){let i=n.length-1;i>=0&&t.isText&&t.sameMarkup(n[i])?n[i]=t.withText(n[i].text+t.text):n.push(t)}function ZV(t,n,i,o){let a=(n||t).node(i),c=0,u=n?n.index(i):a.childCount;t&&(c=t.index(i),t.depth>i?c++:t.textOffset&&(JD(t.nodeAfter,o),c++));for(let f=c;f<u;f++)JD(a.child(f),o);n&&n.depth==i&&n.textOffset&&JD(n.nodeBefore,o)}function YD(t,n){return t.type.checkContent(n),t.copy(n)}function usn(t,n,i,o,a){let c=t.depth>a&&_Re(t,n,a+1),u=o.depth>a&&_Re(i,o,a+1),f=[];return ZV(null,t,a,f),c&&u&&n.index(a)==i.index(a)?(csn(c,u),JD(YD(c,usn(t,n,i,o,a+1)),f)):(c&&JD(YD(c,ppe(t,n,a+1)),f),ZV(n,i,a,f),u&&JD(YD(u,ppe(i,o,a+1)),f)),ZV(o,null,a,f),new An(f)}function ppe(t,n,i){let o=[];if(ZV(null,t,i,o),t.depth>i){let a=_Re(t,n,i+1);JD(YD(a,ppe(t,n,i+1)),o)}return ZV(n,null,i,o),new An(o)}function c3r(t,n){let i=n.depth-t.openStart,a=n.node(i).copy(t.content);for(let c=i-1;c>=0;c--)a=n.node(c).copy(An.from(a));return{start:a.resolveNoCache(t.openStart+i),end:a.resolveNoCache(a.content.size-t.openEnd-i)}}class eJ{constructor(n,i,o){this.pos=n,this.path=i,this.parentOffset=o,this.depth=i.length/3-1}resolveDepth(n){return n==null?this.depth:n<0?this.depth+n:n}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(n){return this.path[this.resolveDepth(n)*3]}index(n){return this.path[this.resolveDepth(n)*3+1]}indexAfter(n){return n=this.resolveDepth(n),this.index(n)+(n==this.depth&&!this.textOffset?0:1)}start(n){return n=this.resolveDepth(n),n==0?0:this.path[n*3-1]+1}end(n){return n=this.resolveDepth(n),this.start(n)+this.node(n).content.size}before(n){if(n=this.resolveDepth(n),!n)throw new RangeError("There is no position before the top-level node");return n==this.depth+1?this.pos:this.path[n*3-1]}after(n){if(n=this.resolveDepth(n),!n)throw new RangeError("There is no position after the top-level node");return n==this.depth+1?this.pos:this.path[n*3-1]+this.path[n*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let n=this.parent,i=this.index(this.depth);if(i==n.childCount)return null;let o=this.pos-this.path[this.path.length-1],a=n.child(i);return o?n.child(i).cut(o):a}get nodeBefore(){let n=this.index(this.depth),i=this.pos-this.path[this.path.length-1];return i?this.parent.child(n).cut(0,i):n==0?null:this.parent.child(n-1)}posAtIndex(n,i){i=this.resolveDepth(i);let o=this.path[i*3],a=i==0?0:this.path[i*3-1]+1;for(let c=0;c<n;c++)a+=o.child(c).nodeSize;return a}marks(){let n=this.parent,i=this.index();if(n.content.size==0)return $l.none;if(this.textOffset)return n.child(i).marks;let o=n.maybeChild(i-1),a=n.maybeChild(i);if(!o){let f=o;o=a,a=f}let c=o.marks;for(var u=0;u<c.length;u++)c[u].type.spec.inclusive===!1&&(!a||!c[u].isInSet(a.marks))&&(c=c[u--].removeFromSet(c));return c}marksAcross(n){let i=this.parent.maybeChild(this.index());if(!i||!i.isInline)return null;let o=i.marks,a=n.parent.maybeChild(n.index());for(var c=0;c<o.length;c++)o[c].type.spec.inclusive===!1&&(!a||!o[c].isInSet(a.marks))&&(o=o[c--].removeFromSet(o));return o}sharedDepth(n){for(let i=this.depth;i>0;i--)if(this.start(i)<=n&&this.end(i)>=n)return i;return 0}blockRange(n=this,i){if(n.pos<this.pos)return n.blockRange(this);for(let o=this.depth-(this.parent.inlineContent||this.pos==n.pos?1:0);o>=0;o--)if(n.pos<=this.end(o)&&(!i||i(this.node(o))))return new gpe(this,n,o);return null}sameParent(n){return this.pos-this.parentOffset==n.pos-n.parentOffset}max(n){return n.pos>this.pos?n:this}min(n){return n.pos<this.pos?n:this}toString(){let n="";for(let i=1;i<=this.depth;i++)n+=(n?"/":"")+this.node(i).type.name+"_"+this.index(i-1);return n+":"+this.parentOffset}static resolve(n,i){if(!(i>=0&&i<=n.content.size))throw new RangeError("Position "+i+" out of range");let o=[],a=0,c=i;for(let u=n;;){let{index:f,offset:g}=u.content.findIndex(c),w=c-g;if(o.push(u,f,a+g),!w||(u=u.child(f),u.isText))break;c=w-1,a+=g+1}return new eJ(i,o,c)}static resolveCached(n,i){let o=zzt.get(n);if(o)for(let c=0;c<o.elts.length;c++){let u=o.elts[c];if(u.pos==i)return u}else zzt.set(n,o=new u3r);let a=o.elts[o.i]=eJ.resolve(n,i);return o.i=(o.i+1)%d3r,a}}class u3r{constructor(){this.elts=[],this.i=0}}const d3r=12,zzt=new WeakMap;class gpe{constructor(n,i,o){this.$from=n,this.$to=i,this.depth=o}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const f3r=Object.create(null);let f5=class TRe{constructor(n,i,o,a=$l.none){this.type=n,this.attrs=i,this.marks=a,this.content=o||An.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(n){return this.content.child(n)}maybeChild(n){return this.content.maybeChild(n)}forEach(n){this.content.forEach(n)}nodesBetween(n,i,o,a=0){this.content.nodesBetween(n,i,o,a,this)}descendants(n){this.nodesBetween(0,this.content.size,n)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(n,i,o,a){return this.content.textBetween(n,i,o,a)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(n){return this==n||this.sameMarkup(n)&&this.content.eq(n.content)}sameMarkup(n){return this.hasMarkup(n.type,n.attrs,n.marks)}hasMarkup(n,i,o){return this.type==n&&fpe(this.attrs,i||n.defaultAttrs||f3r)&&$l.sameSet(this.marks,o||$l.none)}copy(n=null){return n==this.content?this:new TRe(this.type,this.attrs,n,this.marks)}mark(n){return n==this.marks?this:new TRe(this.type,this.attrs,this.content,n)}cut(n,i=this.content.size){return n==0&&i==this.content.size?this:this.copy(this.content.cut(n,i))}slice(n,i=this.content.size,o=!1){if(n==i)return zr.empty;let a=this.resolve(n),c=this.resolve(i),u=o?0:a.sharedDepth(i),f=a.start(u),w=a.node(u).content.cut(a.pos-f,c.pos-f);return new zr(w,a.depth-u,c.depth-u)}replace(n,i,o){return l3r(this.resolve(n),this.resolve(i),o)}nodeAt(n){for(let i=this;;){let{index:o,offset:a}=i.content.findIndex(n);if(i=i.maybeChild(o),!i)return null;if(a==n||i.isText)return i;n-=a+1}}childAfter(n){let{index:i,offset:o}=this.content.findIndex(n);return{node:this.content.maybeChild(i),index:i,offset:o}}childBefore(n){if(n==0)return{node:null,index:0,offset:0};let{index:i,offset:o}=this.content.findIndex(n);if(o<n)return{node:this.content.child(i),index:i,offset:o};let a=this.content.child(i-1);return{node:a,index:i-1,offset:o-a.nodeSize}}resolve(n){return eJ.resolveCached(this,n)}resolveNoCache(n){return eJ.resolve(this,n)}rangeHasMark(n,i,o){let a=!1;return i>n&&this.nodesBetween(n,i,c=>(o.isInSet(c.marks)&&(a=!0),!a)),a}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let n=this.type.name;return this.content.size&&(n+="("+this.content.toStringInner()+")"),dsn(this.marks,n)}contentMatchAt(n){let i=this.type.contentMatch.matchFragment(this.content,0,n);if(!i)throw new Error("Called contentMatchAt on a node with invalid content");return i}canReplace(n,i,o=An.empty,a=0,c=o.childCount){let u=this.contentMatchAt(n).matchFragment(o,a,c),f=u&&u.matchFragment(this.content,i);if(!f||!f.validEnd)return!1;for(let g=a;g<c;g++)if(!this.type.allowsMarks(o.child(g).marks))return!1;return!0}canReplaceWith(n,i,o,a){if(a&&!this.type.allowsMarks(a))return!1;let c=this.contentMatchAt(n).matchType(o),u=c&&c.matchFragment(this.content,i);return u?u.validEnd:!1}canAppend(n){return n.content.size?this.canReplace(this.childCount,this.childCount,n.content):this.type.compatibleContent(n.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let n=$l.none;for(let i=0;i<this.marks.length;i++){let o=this.marks[i];o.type.checkAttrs(o.attrs),n=o.addToSet(n)}if(!$l.sameSet(n,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(i=>i.type.name)}`);this.content.forEach(i=>i.check())}toJSON(){let n={type:this.type.name};for(let i in this.attrs){n.attrs=this.attrs;break}return this.content.size&&(n.content=this.content.toJSON()),this.marks.length&&(n.marks=this.marks.map(i=>i.toJSON())),n}static fromJSON(n,i){if(!i)throw new RangeError("Invalid input for Node.fromJSON");let o;if(i.marks){if(!Array.isArray(i.marks))throw new RangeError("Invalid mark data for Node.fromJSON");o=i.marks.map(n.markFromJSON)}if(i.type=="text"){if(typeof i.text!="string")throw new RangeError("Invalid text node in JSON");return n.text(i.text,o)}let a=An.fromJSON(n,i.content),c=n.nodeType(i.type).create(i.attrs,a,o);return c.type.checkAttrs(c.attrs),c}};f5.prototype.text=void 0;class mpe extends f5{constructor(n,i,o,a){if(super(n,i,null,a),!o)throw new RangeError("Empty text nodes are not allowed");this.text=o}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):dsn(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(n,i){return this.text.slice(n,i)}get nodeSize(){return this.text.length}mark(n){return n==this.marks?this:new mpe(this.type,this.attrs,this.text,n)}withText(n){return n==this.text?this:new mpe(this.type,this.attrs,n,this.marks)}cut(n=0,i=this.text.length){return n==0&&i==this.text.length?this:this.withText(this.text.slice(n,i))}eq(n){return this.sameMarkup(n)&&this.text==n.text}toJSON(){let n=super.toJSON();return n.text=this.text,n}}function dsn(t,n){for(let i=t.length-1;i>=0;i--)n=t[i].type.name+"("+n+")";return n}class y9{constructor(n){this.validEnd=n,this.next=[],this.wrapCache=[]}static parse(n,i){let o=new h3r(n,i);if(o.next==null)return y9.empty;let a=fsn(o);o.next&&o.err("Unexpected trailing text");let c=x3r(y3r(a));return v3r(c,o),c}matchType(n){for(let i=0;i<this.next.length;i++)if(this.next[i].type==n)return this.next[i].next;return null}matchFragment(n,i=0,o=n.childCount){let a=this;for(let c=i;a&&c<o;c++)a=a.matchType(n.child(c).type);return a}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let n=0;n<this.next.length;n++){let{type:i}=this.next[n];if(!(i.isText||i.hasRequiredAttrs()))return i}return null}compatible(n){for(let i=0;i<this.next.length;i++)for(let o=0;o<n.next.length;o++)if(this.next[i].type==n.next[o].type)return!0;return!1}fillBefore(n,i=!1,o=0){let a=[this];function c(u,f){let g=u.matchFragment(n,o);if(g&&(!i||g.validEnd))return An.from(f.map(w=>w.createAndFill()));for(let w=0;w<u.next.length;w++){let{type:x,next:v}=u.next[w];if(!(x.isText||x.hasRequiredAttrs())&&a.indexOf(v)==-1){a.push(v);let C=c(v,f.concat(x));if(C)return C}}return null}return c(this,[])}findWrapping(n){for(let o=0;o<this.wrapCache.length;o+=2)if(this.wrapCache[o]==n)return this.wrapCache[o+1];let i=this.computeWrapping(n);return this.wrapCache.push(n,i),i}computeWrapping(n){let i=Object.create(null),o=[{match:this,type:null,via:null}];for(;o.length;){let a=o.shift(),c=a.match;if(c.matchType(n)){let u=[];for(let f=a;f.type;f=f.via)u.push(f.type);return u.reverse()}for(let u=0;u<c.next.length;u++){let{type:f,next:g}=c.next[u];!f.isLeaf&&!f.hasRequiredAttrs()&&!(f.name in i)&&(!a.type||g.validEnd)&&(o.push({match:f.contentMatch,type:f,via:a}),i[f.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(n){if(n>=this.next.length)throw new RangeError(`There's no ${n}th edge in this content match`);return this.next[n]}toString(){let n=[];function i(o){n.push(o);for(let a=0;a<o.next.length;a++)n.indexOf(o.next[a].next)==-1&&i(o.next[a].next)}return i(this),n.map((o,a)=>{let c=a+(o.validEnd?"*":" ")+" ";for(let u=0;u<o.next.length;u++)c+=(u?", ":"")+o.next[u].type.name+"->"+n.indexOf(o.next[u].next);return c}).join(`
|
|
1004
1004
|
`)}}y9.empty=new y9(!0);class h3r{constructor(n,i){this.string=n,this.nodeTypes=i,this.inline=null,this.pos=0,this.tokens=n.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(n){return this.next==n&&(this.pos++||!0)}err(n){throw new SyntaxError(n+" (in content expression '"+this.string+"')")}}function fsn(t){let n=[];do n.push(p3r(t));while(t.eat("|"));return n.length==1?n[0]:{type:"choice",exprs:n}}function p3r(t){let n=[];do n.push(g3r(t));while(t.next&&t.next!=")"&&t.next!="|");return n.length==1?n[0]:{type:"seq",exprs:n}}function g3r(t){let n=w3r(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=m3r(t,n);else break;return n}function Hzt(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let n=Number(t.next);return t.pos++,n}function m3r(t,n){let i=Hzt(t),o=i;return t.eat(",")&&(t.next!="}"?o=Hzt(t):o=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:i,max:o,expr:n}}function b3r(t,n){let i=t.nodeTypes,o=i[n];if(o)return[o];let a=[];for(let c in i){let u=i[c];u.isInGroup(n)&&a.push(u)}return a.length==0&&t.err("No node type or group '"+n+"' found"),a}function w3r(t){if(t.eat("(")){let n=fsn(t);return t.eat(")")||t.err("Missing closing paren"),n}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let n=b3r(t,t.next).map(i=>(t.inline==null?t.inline=i.isInline:t.inline!=i.isInline&&t.err("Mixing inline and block content"),{type:"name",value:i}));return t.pos++,n.length==1?n[0]:{type:"choice",exprs:n}}}function y3r(t){let n=[[]];return a(c(t,0),i()),n;function i(){return n.push([])-1}function o(u,f,g){let w={term:g,to:f};return n[u].push(w),w}function a(u,f){u.forEach(g=>g.to=f)}function c(u,f){if(u.type=="choice")return u.exprs.reduce((g,w)=>g.concat(c(w,f)),[]);if(u.type=="seq")for(let g=0;;g++){let w=c(u.exprs[g],f);if(g==u.exprs.length-1)return w;a(w,f=i())}else if(u.type=="star"){let g=i();return o(f,g),a(c(u.expr,g),g),[o(g)]}else if(u.type=="plus"){let g=i();return a(c(u.expr,f),g),a(c(u.expr,g),g),[o(g)]}else{if(u.type=="opt")return[o(f)].concat(c(u.expr,f));if(u.type=="range"){let g=f;for(let w=0;w<u.min;w++){let x=i();a(c(u.expr,g),x),g=x}if(u.max==-1)a(c(u.expr,g),g);else for(let w=u.min;w<u.max;w++){let x=i();o(g,x),a(c(u.expr,g),x),g=x}return[o(g)]}else{if(u.type=="name")return[o(f,void 0,u.value)];throw new Error("Unknown expr type")}}}}function hsn(t,n){return n-t}function Uzt(t,n){let i=[];return o(n),i.sort(hsn);function o(a){let c=t[a];if(c.length==1&&!c[0].term)return o(c[0].to);i.push(a);for(let u=0;u<c.length;u++){let{term:f,to:g}=c[u];!f&&i.indexOf(g)==-1&&o(g)}}}function x3r(t){let n=Object.create(null);return i(Uzt(t,0));function i(o){let a=[];o.forEach(u=>{t[u].forEach(({term:f,to:g})=>{if(!f)return;let w;for(let x=0;x<a.length;x++)a[x][0]==f&&(w=a[x][1]);Uzt(t,g).forEach(x=>{w||a.push([f,w=[]]),w.indexOf(x)==-1&&w.push(x)})})});let c=n[o.join(",")]=new y9(o.indexOf(t.length-1)>-1);for(let u=0;u<a.length;u++){let f=a[u][1].sort(hsn);c.next.push({type:a[u][0],next:n[f.join(",")]||i(f)})}return c}}function v3r(t,n){for(let i=0,o=[t];i<o.length;i++){let a=o[i],c=!a.validEnd,u=[];for(let f=0;f<a.next.length;f++){let{type:g,next:w}=a.next[f];u.push(g.name),c&&!(g.isText||g.hasRequiredAttrs())&&(c=!1),o.indexOf(w)==-1&&o.push(w)}c&&n.err("Only non-generatable nodes ("+u.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function psn(t){let n=Object.create(null);for(let i in t){let o=t[i];if(!o.hasDefault)return null;n[i]=o.default}return n}function gsn(t,n){let i=Object.create(null);for(let o in t){let a=n&&n[o];if(a===void 0){let c=t[o];if(c.hasDefault)a=c.default;else throw new RangeError("No value supplied for attribute "+o)}i[o]=a}return i}function msn(t,n,i,o){for(let a in n)if(!(a in t))throw new RangeError(`Unsupported attribute ${a} for ${i} of type ${a}`);for(let a in t){let c=t[a];c.validate&&c.validate(n[a])}}function bsn(t,n){let i=Object.create(null);if(n)for(let o in n)i[o]=new C3r(t,o,n[o]);return i}let Wzt=class wsn{constructor(n,i,o){this.name=n,this.schema=i,this.spec=o,this.markSet=null,this.groups=o.group?o.group.split(" "):[],this.attrs=bsn(n,o.attrs),this.defaultAttrs=psn(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(o.inline||n=="text"),this.isText=n=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==y9.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(n){return this.groups.indexOf(n)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let n in this.attrs)if(this.attrs[n].isRequired)return!0;return!1}compatibleContent(n){return this==n||this.contentMatch.compatible(n.contentMatch)}computeAttrs(n){return!n&&this.defaultAttrs?this.defaultAttrs:gsn(this.attrs,n)}create(n=null,i,o){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new f5(this,this.computeAttrs(n),An.from(i),$l.setFrom(o))}createChecked(n=null,i,o){return i=An.from(i),this.checkContent(i),new f5(this,this.computeAttrs(n),i,$l.setFrom(o))}createAndFill(n=null,i,o){if(n=this.computeAttrs(n),i=An.from(i),i.size){let u=this.contentMatch.fillBefore(i);if(!u)return null;i=u.append(i)}let a=this.contentMatch.matchFragment(i),c=a&&a.fillBefore(An.empty,!0);return c?new f5(this,n,i.append(c),$l.setFrom(o)):null}validContent(n){let i=this.contentMatch.matchFragment(n);if(!i||!i.validEnd)return!1;for(let o=0;o<n.childCount;o++)if(!this.allowsMarks(n.child(o).marks))return!1;return!0}checkContent(n){if(!this.validContent(n))throw new RangeError(`Invalid content for node ${this.name}: ${n.toString().slice(0,50)}`)}checkAttrs(n){msn(this.attrs,n,"node",this.name)}allowsMarkType(n){return this.markSet==null||this.markSet.indexOf(n)>-1}allowsMarks(n){if(this.markSet==null)return!0;for(let i=0;i<n.length;i++)if(!this.allowsMarkType(n[i].type))return!1;return!0}allowedMarks(n){if(this.markSet==null)return n;let i;for(let o=0;o<n.length;o++)this.allowsMarkType(n[o].type)?i&&i.push(n[o]):i||(i=n.slice(0,o));return i?i.length?i:$l.none:n}static compile(n,i){let o=Object.create(null);n.forEach((c,u)=>o[c]=new wsn(c,i,u));let a=i.spec.topNode||"doc";if(!o[a])throw new RangeError("Schema is missing its top node type ('"+a+"')");if(!o.text)throw new RangeError("Every schema needs a 'text' type");for(let c in o.text.attrs)throw new RangeError("The text node type should not have attributes");return o}};function k3r(t,n,i){let o=i.split("|");return a=>{let c=a===null?"null":typeof a;if(o.indexOf(c)<0)throw new RangeError(`Expected value of type ${o} for attribute ${n} on type ${t}, got ${c}`)}}class C3r{constructor(n,i,o){this.hasDefault=Object.prototype.hasOwnProperty.call(o,"default"),this.default=o.default,this.validate=typeof o.validate=="string"?k3r(n,i,o.validate):o.validate}get isRequired(){return!this.hasDefault}}class F0e{constructor(n,i,o,a){this.name=n,this.rank=i,this.schema=o,this.spec=a,this.attrs=bsn(n,a.attrs),this.excluded=null;let c=psn(this.attrs);this.instance=c?new $l(this,c):null}create(n=null){return!n&&this.instance?this.instance:new $l(this,gsn(this.attrs,n))}static compile(n,i){let o=Object.create(null),a=0;return n.forEach((c,u)=>o[c]=new F0e(c,a++,i,u)),o}removeFromSet(n){for(var i=0;i<n.length;i++)n[i].type==this&&(n=n.slice(0,i).concat(n.slice(i+1)),i--);return n}isInSet(n){for(let i=0;i<n.length;i++)if(n[i].type==this)return n[i]}checkAttrs(n){msn(this.attrs,n,"mark",this.name)}excludes(n){return this.excluded.indexOf(n)>-1}}class Oze{constructor(n){this.linebreakReplacement=null,this.cached=Object.create(null);let i=this.spec={};for(let a in n)i[a]=n[a];i.nodes=fg.from(n.nodes),i.marks=fg.from(n.marks||{}),this.nodes=Wzt.compile(this.spec.nodes,this),this.marks=F0e.compile(this.spec.marks,this);let o=Object.create(null);for(let a in this.nodes){if(a in this.marks)throw new RangeError(a+" can not be both a node and a mark");let c=this.nodes[a],u=c.spec.content||"",f=c.spec.marks;if(c.contentMatch=o[u]||(o[u]=y9.parse(u,this.nodes)),c.inlineContent=c.contentMatch.inlineContent,c.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!c.isInline||!c.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=c}c.markSet=f=="_"?null:f?qzt(this,f.split(" ")):f==""||!c.inlineContent?[]:null}for(let a in this.marks){let c=this.marks[a],u=c.spec.excludes;c.excluded=u==null?[c]:u==""?[]:qzt(this,u.split(" "))}this.nodeFromJSON=a=>f5.fromJSON(this,a),this.markFromJSON=a=>$l.fromJSON(this,a),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(n,i=null,o,a){if(typeof n=="string")n=this.nodeType(n);else if(n instanceof Wzt){if(n.schema!=this)throw new RangeError("Node type from different schema used ("+n.name+")")}else throw new RangeError("Invalid node type: "+n);return n.createChecked(i,o,a)}text(n,i){let o=this.nodes.text;return new mpe(o,o.defaultAttrs,n,$l.setFrom(i))}mark(n,i){return typeof n=="string"&&(n=this.marks[n]),n.create(i)}nodeType(n){let i=this.nodes[n];if(!i)throw new RangeError("Unknown node type: "+n);return i}}function qzt(t,n){let i=[];for(let o=0;o<n.length;o++){let a=n[o],c=t.marks[a],u=c;if(c)i.push(c);else for(let f in t.marks){let g=t.marks[f];(a=="_"||g.spec.group&&g.spec.group.split(" ").indexOf(a)>-1)&&i.push(u=g)}if(!u)throw new SyntaxError("Unknown mark type: '"+n[o]+"'")}return i}function S3r(t){return t.tag!=null}function E3r(t){return t.style!=null}class h5{constructor(n,i){this.schema=n,this.rules=i,this.tags=[],this.styles=[];let o=this.matchedStyles=[];i.forEach(a=>{if(S3r(a))this.tags.push(a);else if(E3r(a)){let c=/[^=]*/.exec(a.style)[0];o.indexOf(c)<0&&o.push(c),this.styles.push(a)}}),this.normalizeLists=!this.tags.some(a=>{if(!/^(ul|ol)\b/.test(a.tag)||!a.node)return!1;let c=n.nodes[a.node];return c.contentMatch.matchType(c)})}parse(n,i={}){let o=new Vzt(this,i,!1);return o.addAll(n,$l.none,i.from,i.to),o.finish()}parseSlice(n,i={}){let o=new Vzt(this,i,!0);return o.addAll(n,$l.none,i.from,i.to),zr.maxOpen(o.finish())}matchTag(n,i,o){for(let a=o?this.tags.indexOf(o)+1:0;a<this.tags.length;a++){let c=this.tags[a];if(A3r(n,c.tag)&&(c.namespace===void 0||n.namespaceURI==c.namespace)&&(!c.context||i.matchesContext(c.context))){if(c.getAttrs){let u=c.getAttrs(n);if(u===!1)continue;c.attrs=u||void 0}return c}}}matchStyle(n,i,o,a){for(let c=a?this.styles.indexOf(a)+1:0;c<this.styles.length;c++){let u=this.styles[c],f=u.style;if(!(f.indexOf(n)!=0||u.context&&!o.matchesContext(u.context)||f.length>n.length&&(f.charCodeAt(n.length)!=61||f.slice(n.length+1)!=i))){if(u.getAttrs){let g=u.getAttrs(i);if(g===!1)continue;u.attrs=g||void 0}return u}}}static schemaRules(n){let i=[];function o(a){let c=a.priority==null?50:a.priority,u=0;for(;u<i.length;u++){let f=i[u];if((f.priority==null?50:f.priority)<c)break}i.splice(u,0,a)}for(let a in n.marks){let c=n.marks[a].spec.parseDOM;c&&c.forEach(u=>{o(u=Kzt(u)),u.mark||u.ignore||u.clearMark||(u.mark=a)})}for(let a in n.nodes){let c=n.nodes[a].spec.parseDOM;c&&c.forEach(u=>{o(u=Kzt(u)),u.node||u.ignore||u.mark||(u.node=a)})}return i}static fromSchema(n){return n.cached.domParser||(n.cached.domParser=new h5(n,h5.schemaRules(n)))}}const ysn={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},_3r={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},xsn={ol:!0,ul:!0},tJ=1,ARe=2,eK=4;function Gzt(t,n,i){return n!=null?(n?tJ:0)|(n==="full"?ARe:0):t&&t.whitespace=="pre"?tJ|ARe:i&~eK}class Zue{constructor(n,i,o,a,c,u){this.type=n,this.attrs=i,this.marks=o,this.solid=a,this.options=u,this.content=[],this.activeMarks=$l.none,this.match=c||(u&eK?null:n.contentMatch)}findWrapping(n){if(!this.match){if(!this.type)return[];let i=this.type.contentMatch.fillBefore(An.from(n));if(i)this.match=this.type.contentMatch.matchFragment(i);else{let o=this.type.contentMatch,a;return(a=o.findWrapping(n.type))?(this.match=o,a):null}}return this.match.findWrapping(n.type)}finish(n){if(!(this.options&tJ)){let o=this.content[this.content.length-1],a;if(o&&o.isText&&(a=/[ \t\r\n\u000c]+$/.exec(o.text))){let c=o;o.text.length==a[0].length?this.content.pop():this.content[this.content.length-1]=c.withText(c.text.slice(0,c.text.length-a[0].length))}}let i=An.from(this.content);return!n&&this.match&&(i=i.append(this.match.fillBefore(An.empty,!0))),this.type?this.type.create(this.attrs,i,this.marks):i}inlineContext(n){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:n.parentNode&&!ysn.hasOwnProperty(n.parentNode.nodeName.toLowerCase())}}class Vzt{constructor(n,i,o){this.parser=n,this.options=i,this.isOpen=o,this.open=0,this.localPreserveWS=!1;let a=i.topNode,c,u=Gzt(null,i.preserveWhitespace,0)|(o?eK:0);a?c=new Zue(a.type,a.attrs,$l.none,!0,i.topMatch||a.type.contentMatch,u):o?c=new Zue(null,null,$l.none,!0,null,u):c=new Zue(n.schema.topNodeType,null,$l.none,!0,null,u),this.nodes=[c],this.find=i.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(n,i){n.nodeType==3?this.addTextNode(n,i):n.nodeType==1&&this.addElement(n,i)}addTextNode(n,i){let o=n.nodeValue,a=this.top,c=a.options&ARe?"full":this.localPreserveWS||(a.options&tJ)>0,{schema:u}=this.parser;if(c==="full"||a.inlineContext(n)||/[^ \t\r\n\u000c]/.test(o)){if(c)if(c==="full")o=o.replace(/\r\n?/g,`
|
|
1005
1005
|
`);else if(u.linebreakReplacement&&/[\r\n]/.test(o)&&this.top.findWrapping(u.linebreakReplacement.create())){let f=o.split(/\r?\n|\r/);for(let g=0;g<f.length;g++)g&&this.insertNode(u.linebreakReplacement.create(),i,!0),f[g]&&this.insertNode(u.text(f[g]),i,!/\S/.test(f[g]));o=""}else o=o.replace(/\r?\n|\r/g," ");else if(o=o.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(o)&&this.open==this.nodes.length-1){let f=a.content[a.content.length-1],g=n.previousSibling;(!f||g&&g.nodeName=="BR"||f.isText&&/[ \t\r\n\u000c]$/.test(f.text))&&(o=o.slice(1))}o&&this.insertNode(u.text(o),i,!/\S/.test(o)),this.findInText(n)}else this.findInside(n)}addElement(n,i,o){let a=this.localPreserveWS,c=this.top;(n.tagName=="PRE"||/pre/.test(n.style&&n.style.whiteSpace))&&(this.localPreserveWS=!0);let u=n.nodeName.toLowerCase(),f;xsn.hasOwnProperty(u)&&this.parser.normalizeLists&&T3r(n);let g=this.options.ruleFromNode&&this.options.ruleFromNode(n)||(f=this.parser.matchTag(n,this,o));e:if(g?g.ignore:_3r.hasOwnProperty(u))this.findInside(n),this.ignoreFallback(n,i);else if(!g||g.skip||g.closeParent){g&&g.closeParent?this.open=Math.max(0,this.open-1):g&&g.skip.nodeType&&(n=g.skip);let w,x=this.needsBlock;if(ysn.hasOwnProperty(u))c.content.length&&c.content[0].isInline&&this.open&&(this.open--,c=this.top),w=!0,c.type||(this.needsBlock=!0);else if(!n.firstChild){this.leafFallback(n,i);break e}let v=g&&g.skip?i:this.readStyles(n,i);v&&this.addAll(n,v),w&&this.sync(c),this.needsBlock=x}else{let w=this.readStyles(n,i);w&&this.addElementByRule(n,g,w,g.consuming===!1?f:void 0)}this.localPreserveWS=a}leafFallback(n,i){n.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(n.ownerDocument.createTextNode(`
|
|
1006
1006
|
`),i)}ignoreFallback(n,i){n.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),i,!0)}readStyles(n,i){let o=n.style;if(o&&o.length)for(let a=0;a<this.parser.matchedStyles.length;a++){let c=this.parser.matchedStyles[a],u=o.getPropertyValue(c);if(u)for(let f=void 0;;){let g=this.parser.matchStyle(c,u,this,f);if(!g)break;if(g.ignore)return null;if(g.clearMark?i=i.filter(w=>!g.clearMark(w)):i=i.concat(this.parser.schema.marks[g.mark].create(g.attrs)),g.consuming===!1)f=g;else break}}return i}addElementByRule(n,i,o,a){let c,u;if(i.node)if(u=this.parser.schema.nodes[i.node],u.isLeaf)this.insertNode(u.create(i.attrs),o,n.nodeName=="BR")||this.leafFallback(n,o);else{let g=this.enter(u,i.attrs||null,o,i.preserveWhitespace);g&&(c=!0,o=g)}else{let g=this.parser.schema.marks[i.mark];o=o.concat(g.create(i.attrs))}let f=this.top;if(u&&u.isLeaf)this.findInside(n);else if(a)this.addElement(n,o,a);else if(i.getContent)this.findInside(n),i.getContent(n,this.parser.schema).forEach(g=>this.insertNode(g,o,!1));else{let g=n;typeof i.contentElement=="string"?g=n.querySelector(i.contentElement):typeof i.contentElement=="function"?g=i.contentElement(n):i.contentElement&&(g=i.contentElement),this.findAround(n,g,!0),this.addAll(g,o),this.findAround(n,g,!1)}c&&this.sync(f)&&this.open--}addAll(n,i,o,a){let c=o||0;for(let u=o?n.childNodes[o]:n.firstChild,f=a==null?null:n.childNodes[a];u!=f;u=u.nextSibling,++c)this.findAtPoint(n,c),this.addDOM(u,i);this.findAtPoint(n,c)}findPlace(n,i,o){let a,c;for(let u=this.open,f=0;u>=0;u--){let g=this.nodes[u],w=g.findWrapping(n);if(w&&(!a||a.length>w.length+f)&&(a=w,c=g,!w.length))break;if(g.solid){if(o)break;f+=2}}if(!a)return null;this.sync(c);for(let u=0;u<a.length;u++)i=this.enterInner(a[u],null,i,!1);return i}insertNode(n,i,o){if(n.isInline&&this.needsBlock&&!this.top.type){let c=this.textblockFromContext();c&&(i=this.enterInner(c,null,i))}let a=this.findPlace(n,i,o);if(a){this.closeExtra();let c=this.top;c.match&&(c.match=c.match.matchType(n.type));let u=$l.none;for(let f of a.concat(n.marks))(c.type?c.type.allowsMarkType(f.type):Jzt(f.type,n.type))&&(u=f.addToSet(u));return c.content.push(n.mark(u)),!0}return!1}enter(n,i,o,a){let c=this.findPlace(n.create(i),o,!1);return c&&(c=this.enterInner(n,i,o,!0,a)),c}enterInner(n,i,o,a=!1,c){this.closeExtra();let u=this.top;u.match=u.match&&u.match.matchType(n);let f=Gzt(n,c,u.options);u.options&eK&&u.content.length==0&&(f|=eK);let g=$l.none;return o=o.filter(w=>(u.type?u.type.allowsMarkType(w.type):Jzt(w.type,n))?(g=w.addToSet(g),!1):!0),this.nodes.push(new Zue(n,i,g,a,null,f)),this.open++,o}closeExtra(n=!1){let i=this.nodes.length-1;if(i>this.open){for(;i>this.open;i--)this.nodes[i-1].content.push(this.nodes[i].finish(n));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(n){for(let i=this.open;i>=0;i--){if(this.nodes[i]==n)return this.open=i,!0;this.localPreserveWS&&(this.nodes[i].options|=tJ)}return!1}get currentPos(){this.closeExtra();let n=0;for(let i=this.open;i>=0;i--){let o=this.nodes[i].content;for(let a=o.length-1;a>=0;a--)n+=o[a].nodeSize;i&&n++}return n}findAtPoint(n,i){if(this.find)for(let o=0;o<this.find.length;o++)this.find[o].node==n&&this.find[o].offset==i&&(this.find[o].pos=this.currentPos)}findInside(n){if(this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&n.nodeType==1&&n.contains(this.find[i].node)&&(this.find[i].pos=this.currentPos)}findAround(n,i,o){if(n!=i&&this.find)for(let a=0;a<this.find.length;a++)this.find[a].pos==null&&n.nodeType==1&&n.contains(this.find[a].node)&&i.compareDocumentPosition(this.find[a].node)&(o?2:4)&&(this.find[a].pos=this.currentPos)}findInText(n){if(this.find)for(let i=0;i<this.find.length;i++)this.find[i].node==n&&(this.find[i].pos=this.currentPos-(n.nodeValue.length-this.find[i].offset))}matchesContext(n){if(n.indexOf("|")>-1)return n.split(/\s*\|\s*/).some(this.matchesContext,this);let i=n.split("/"),o=this.options.context,a=!this.isOpen&&(!o||o.parent.type==this.nodes[0].type),c=-(o?o.depth+1:0)+(a?0:1),u=(f,g)=>{for(;f>=0;f--){let w=i[f];if(w==""){if(f==i.length-1||f==0)continue;for(;g>=c;g--)if(u(f-1,g))return!0;return!1}else{let x=g>0||g==0&&a?this.nodes[g].type:o&&g>=c?o.node(g-c).type:null;if(!x||x.name!=w&&!x.isInGroup(w))return!1;g--}}return!0};return u(i.length-1,this.open)}textblockFromContext(){let n=this.options.context;if(n)for(let i=n.depth;i>=0;i--){let o=n.node(i).contentMatchAt(n.indexAfter(i)).defaultType;if(o&&o.isTextblock&&o.defaultAttrs)return o}for(let i in this.parser.schema.nodes){let o=this.parser.schema.nodes[i];if(o.isTextblock&&o.defaultAttrs)return o}}}function T3r(t){for(let n=t.firstChild,i=null;n;n=n.nextSibling){let o=n.nodeType==1?n.nodeName.toLowerCase():null;o&&xsn.hasOwnProperty(o)&&i?(i.appendChild(n),n=i):o=="li"?i=n:o&&(i=null)}}function A3r(t,n){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,n)}function Kzt(t){let n={};for(let i in t)n[i]=t[i];return n}function Jzt(t,n){let i=n.schema.nodes;for(let o in i){let a=i[o];if(!a.allowsMarkType(t))continue;let c=[],u=f=>{c.push(f);for(let g=0;g<f.edgeCount;g++){let{type:w,next:x}=f.edge(g);if(w==n||c.indexOf(x)<0&&u(x))return!0}};if(u(a.contentMatch))return!0}}class H9{constructor(n,i){this.nodes=n,this.marks=i}serializeFragment(n,i={},o){o||(o=DOe(i).createDocumentFragment());let a=o,c=[];return n.forEach(u=>{if(c.length||u.marks.length){let f=0,g=0;for(;f<c.length&&g<u.marks.length;){let w=u.marks[g];if(!this.marks[w.type.name]){g++;continue}if(!w.eq(c[f][0])||w.type.spec.spanning===!1)break;f++,g++}for(;f<c.length;)a=c.pop()[1];for(;g<u.marks.length;){let w=u.marks[g++],x=this.serializeMark(w,u.isInline,i);x&&(c.push([w,a]),a.appendChild(x.dom),a=x.contentDOM||x.dom)}}a.appendChild(this.serializeNodeInner(u,i))}),o}serializeNodeInner(n,i){let{dom:o,contentDOM:a}=mfe(DOe(i),this.nodes[n.type.name](n),null,n.attrs);if(a){if(n.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(n.content,i,a)}return o}serializeNode(n,i={}){let o=this.serializeNodeInner(n,i);for(let a=n.marks.length-1;a>=0;a--){let c=this.serializeMark(n.marks[a],n.isInline,i);c&&((c.contentDOM||c.dom).appendChild(o),o=c.dom)}return o}serializeMark(n,i,o={}){let a=this.marks[n.type.name];return a&&mfe(DOe(o),a(n,i),null,n.attrs)}static renderSpec(n,i,o=null,a){return mfe(n,i,o,a)}static fromSchema(n){return n.cached.domSerializer||(n.cached.domSerializer=new H9(this.nodesFromSchema(n),this.marksFromSchema(n)))}static nodesFromSchema(n){let i=Yzt(n.nodes);return i.text||(i.text=o=>o.text),i}static marksFromSchema(n){return Yzt(n.marks)}}function Yzt(t){let n={};for(let i in t){let o=t[i].spec.toDOM;o&&(n[i]=o)}return n}function DOe(t){return t.document||window.document}const Xzt=new WeakMap;function M3r(t){let n=Xzt.get(t);return n===void 0&&Xzt.set(t,n=N3r(t)),n}function N3r(t){let n=null;function i(o){if(o&&typeof o=="object")if(Array.isArray(o))if(typeof o[0]=="string")n||(n=[]),n.push(o);else for(let a=0;a<o.length;a++)i(o[a]);else for(let a in o)i(o[a])}return i(t),n}function mfe(t,n,i,o){if(typeof n=="string")return{dom:t.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let a=n[0],c;if(typeof a!="string")throw new RangeError("Invalid array passed to renderSpec");if(o&&(c=M3r(o))&&c.indexOf(n)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let u=a.indexOf(" ");u>0&&(i=a.slice(0,u),a=a.slice(u+1));let f,g=i?t.createElementNS(i,a):t.createElement(a),w=n[1],x=1;if(w&&typeof w=="object"&&w.nodeType==null&&!Array.isArray(w)){x=2;for(let v in w)if(w[v]!=null){let C=v.indexOf(" ");C>0?g.setAttributeNS(v.slice(0,C),v.slice(C+1),w[v]):v=="style"&&g.style?g.style.cssText=w[v]:g.setAttribute(v,w[v])}}for(let v=x;v<n.length;v++){let C=n[v];if(C===0){if(v<n.length-1||v>x)throw new RangeError("Content hole must be the only child of its parent node");return{dom:g,contentDOM:g}}else{let{dom:E,contentDOM:A}=mfe(t,C,i,o);if(g.appendChild(E),A){if(f)throw new RangeError("Multiple content holes");f=A}}}return{dom:g,contentDOM:f}}const vsn=65535,ksn=Math.pow(2,16);function j3r(t,n){return t+n*ksn}function Qzt(t){return t&vsn}function D3r(t){return(t-(t&vsn))/ksn}const Csn=1,Ssn=2,bfe=4,Esn=8;class MRe{constructor(n,i,o){this.pos=n,this.delInfo=i,this.recover=o}get deleted(){return(this.delInfo&Esn)>0}get deletedBefore(){return(this.delInfo&(Csn|bfe))>0}get deletedAfter(){return(this.delInfo&(Ssn|bfe))>0}get deletedAcross(){return(this.delInfo&bfe)>0}}class Sw{constructor(n,i=!1){if(this.ranges=n,this.inverted=i,!n.length&&Sw.empty)return Sw.empty}recover(n){let i=0,o=Qzt(n);if(!this.inverted)for(let a=0;a<o;a++)i+=this.ranges[a*3+2]-this.ranges[a*3+1];return this.ranges[o*3]+i+D3r(n)}mapResult(n,i=1){return this._map(n,i,!1)}map(n,i=1){return this._map(n,i,!0)}_map(n,i,o){let a=0,c=this.inverted?2:1,u=this.inverted?1:2;for(let f=0;f<this.ranges.length;f+=3){let g=this.ranges[f]-(this.inverted?a:0);if(g>n)break;let w=this.ranges[f+c],x=this.ranges[f+u],v=g+w;if(n<=v){let C=w?n==g?-1:n==v?1:i:i,E=g+a+(C<0?0:x);if(o)return E;let A=n==(i<0?g:v)?null:j3r(f/3,n-g),M=n==g?Ssn:n==v?Csn:bfe;return(i<0?n!=g:n!=v)&&(M|=Esn),new MRe(E,M,A)}a+=x-w}return o?n+a:new MRe(n+a,0,null)}touches(n,i){let o=0,a=Qzt(i),c=this.inverted?2:1,u=this.inverted?1:2;for(let f=0;f<this.ranges.length;f+=3){let g=this.ranges[f]-(this.inverted?o:0);if(g>n)break;let w=this.ranges[f+c],x=g+w;if(n<=x&&f==a*3)return!0;o+=this.ranges[f+u]-w}return!1}forEach(n){let i=this.inverted?2:1,o=this.inverted?1:2;for(let a=0,c=0;a<this.ranges.length;a+=3){let u=this.ranges[a],f=u-(this.inverted?c:0),g=u+(this.inverted?0:c),w=this.ranges[a+i],x=this.ranges[a+o];n(f,f+w,g,g+x),c+=x-w}}invert(){return new Sw(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(n){return n==0?Sw.empty:new Sw(n<0?[0,-n,0]:[0,0,n])}}Sw.empty=new Sw([]);class nJ{constructor(n,i,o=0,a=n?n.length:0){this.mirror=i,this.from=o,this.to=a,this._maps=n||[],this.ownData=!(n||i)}get maps(){return this._maps}slice(n=0,i=this.maps.length){return new nJ(this._maps,this.mirror,n,i)}appendMap(n,i){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(n),i!=null&&this.setMirror(this._maps.length-1,i)}appendMapping(n){for(let i=0,o=this._maps.length;i<n._maps.length;i++){let a=n.getMirror(i);this.appendMap(n._maps[i],a!=null&&a<i?o+a:void 0)}}getMirror(n){if(this.mirror){for(let i=0;i<this.mirror.length;i++)if(this.mirror[i]==n)return this.mirror[i+(i%2?-1:1)]}}setMirror(n,i){this.mirror||(this.mirror=[]),this.mirror.push(n,i)}appendMappingInverted(n){for(let i=n.maps.length-1,o=this._maps.length+n._maps.length;i>=0;i--){let a=n.getMirror(i);this.appendMap(n._maps[i].invert(),a!=null&&a>i?o-a-1:void 0)}}invert(){let n=new nJ;return n.appendMappingInverted(this),n}map(n,i=1){if(this.mirror)return this._map(n,i,!0);for(let o=this.from;o<this.to;o++)n=this._maps[o].map(n,i);return n}mapResult(n,i=1){return this._map(n,i,!1)}_map(n,i,o){let a=0;for(let c=this.from;c<this.to;c++){let u=this._maps[c],f=u.mapResult(n,i);if(f.recover!=null){let g=this.getMirror(c);if(g!=null&&g>c&&g<this.to){c=g,n=this._maps[g].recover(f.recover);continue}}a|=f.delInfo,n=f.pos}return o?n:new MRe(n,a,null)}}const IOe=Object.create(null);class T0{getMap(){return Sw.empty}merge(n){return null}static fromJSON(n,i){if(!i||!i.stepType)throw new RangeError("Invalid input for Step.fromJSON");let o=IOe[i.stepType];if(!o)throw new RangeError(`No step type ${i.stepType} defined`);return o.fromJSON(n,i)}static jsonID(n,i){if(n in IOe)throw new RangeError("Duplicate use of step JSON ID "+n);return IOe[n]=i,i.prototype.jsonID=n,i}}class hh{constructor(n,i){this.doc=n,this.failed=i}static ok(n){return new hh(n,null)}static fail(n){return new hh(null,n)}static fromReplace(n,i,o,a){try{return hh.ok(n.replace(i,o,a))}catch(c){if(c instanceof hpe)return hh.fail(c.message);throw c}}}function Lze(t,n,i){let o=[];for(let a=0;a<t.childCount;a++){let c=t.child(a);c.content.size&&(c=c.copy(Lze(c.content,n,c))),c.isInline&&(c=n(c,i,a)),o.push(c)}return An.fromArray(o)}class c6 extends T0{constructor(n,i,o){super(),this.from=n,this.to=i,this.mark=o}apply(n){let i=n.slice(this.from,this.to),o=n.resolve(this.from),a=o.node(o.sharedDepth(this.to)),c=new zr(Lze(i.content,(u,f)=>!u.isAtom||!f.type.allowsMarkType(this.mark.type)?u:u.mark(this.mark.addToSet(u.marks)),a),i.openStart,i.openEnd);return hh.fromReplace(n,this.from,this.to,c)}invert(){return new $v(this.from,this.to,this.mark)}map(n){let i=n.mapResult(this.from,1),o=n.mapResult(this.to,-1);return i.deleted&&o.deleted||i.pos>=o.pos?null:new c6(i.pos,o.pos,this.mark)}merge(n){return n instanceof c6&&n.mark.eq(this.mark)&&this.from<=n.to&&this.to>=n.from?new c6(Math.min(this.from,n.from),Math.max(this.to,n.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(n,i){if(typeof i.from!="number"||typeof i.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new c6(i.from,i.to,n.markFromJSON(i.mark))}}T0.jsonID("addMark",c6);class $v extends T0{constructor(n,i,o){super(),this.from=n,this.to=i,this.mark=o}apply(n){let i=n.slice(this.from,this.to),o=new zr(Lze(i.content,a=>a.mark(this.mark.removeFromSet(a.marks)),n),i.openStart,i.openEnd);return hh.fromReplace(n,this.from,this.to,o)}invert(){return new c6(this.from,this.to,this.mark)}map(n){let i=n.mapResult(this.from,1),o=n.mapResult(this.to,-1);return i.deleted&&o.deleted||i.pos>=o.pos?null:new $v(i.pos,o.pos,this.mark)}merge(n){return n instanceof $v&&n.mark.eq(this.mark)&&this.from<=n.to&&this.to>=n.from?new $v(Math.min(this.from,n.from),Math.max(this.to,n.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(n,i){if(typeof i.from!="number"||typeof i.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new $v(i.from,i.to,n.markFromJSON(i.mark))}}T0.jsonID("removeMark",$v);class u6 extends T0{constructor(n,i){super(),this.pos=n,this.mark=i}apply(n){let i=n.nodeAt(this.pos);if(!i)return hh.fail("No node at mark step's position");let o=i.type.create(i.attrs,null,this.mark.addToSet(i.marks));return hh.fromReplace(n,this.pos,this.pos+1,new zr(An.from(o),0,i.isLeaf?0:1))}invert(n){let i=n.nodeAt(this.pos);if(i){let o=this.mark.addToSet(i.marks);if(o.length==i.marks.length){for(let a=0;a<i.marks.length;a++)if(!i.marks[a].isInSet(o))return new u6(this.pos,i.marks[a]);return new u6(this.pos,this.mark)}}return new x9(this.pos,this.mark)}map(n){let i=n.mapResult(this.pos,1);return i.deletedAfter?null:new u6(i.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(n,i){if(typeof i.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new u6(i.pos,n.markFromJSON(i.mark))}}T0.jsonID("addNodeMark",u6);class x9 extends T0{constructor(n,i){super(),this.pos=n,this.mark=i}apply(n){let i=n.nodeAt(this.pos);if(!i)return hh.fail("No node at mark step's position");let o=i.type.create(i.attrs,null,this.mark.removeFromSet(i.marks));return hh.fromReplace(n,this.pos,this.pos+1,new zr(An.from(o),0,i.isLeaf?0:1))}invert(n){let i=n.nodeAt(this.pos);return!i||!this.mark.isInSet(i.marks)?this:new u6(this.pos,this.mark)}map(n){let i=n.mapResult(this.pos,1);return i.deletedAfter?null:new x9(i.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(n,i){if(typeof i.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new x9(i.pos,n.markFromJSON(i.mark))}}T0.jsonID("removeNodeMark",x9);class lh extends T0{constructor(n,i,o,a=!1){super(),this.from=n,this.to=i,this.slice=o,this.structure=a}apply(n){return this.structure&&NRe(n,this.from,this.to)?hh.fail("Structure replace would overwrite content"):hh.fromReplace(n,this.from,this.to,this.slice)}getMap(){return new Sw([this.from,this.to-this.from,this.slice.size])}invert(n){return new lh(this.from,this.from+this.slice.size,n.slice(this.from,this.to))}map(n){let i=n.mapResult(this.to,-1),o=this.from==this.to&&lh.MAP_BIAS<0?i:n.mapResult(this.from,1);return o.deletedAcross&&i.deletedAcross?null:new lh(o.pos,Math.max(o.pos,i.pos),this.slice,this.structure)}merge(n){if(!(n instanceof lh)||n.structure||this.structure)return null;if(this.from+this.slice.size==n.from&&!this.slice.openEnd&&!n.slice.openStart){let i=this.slice.size+n.slice.size==0?zr.empty:new zr(this.slice.content.append(n.slice.content),this.slice.openStart,n.slice.openEnd);return new lh(this.from,this.to+(n.to-n.from),i,this.structure)}else if(n.to==this.from&&!this.slice.openStart&&!n.slice.openEnd){let i=this.slice.size+n.slice.size==0?zr.empty:new zr(n.slice.content.append(this.slice.content),n.slice.openStart,this.slice.openEnd);return new lh(n.from,this.to,i,this.structure)}else return null}toJSON(){let n={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(n.slice=this.slice.toJSON()),this.structure&&(n.structure=!0),n}static fromJSON(n,i){if(typeof i.from!="number"||typeof i.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new lh(i.from,i.to,zr.fromJSON(n,i.slice),!!i.structure)}}lh.MAP_BIAS=1;T0.jsonID("replace",lh);class Dp extends T0{constructor(n,i,o,a,c,u,f=!1){super(),this.from=n,this.to=i,this.gapFrom=o,this.gapTo=a,this.slice=c,this.insert=u,this.structure=f}apply(n){if(this.structure&&(NRe(n,this.from,this.gapFrom)||NRe(n,this.gapTo,this.to)))return hh.fail("Structure gap-replace would overwrite content");let i=n.slice(this.gapFrom,this.gapTo);if(i.openStart||i.openEnd)return hh.fail("Gap is not a flat range");let o=this.slice.insertAt(this.insert,i.content);return o?hh.fromReplace(n,this.from,this.to,o):hh.fail("Content does not fit in gap")}getMap(){return new Sw([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(n){let i=this.gapTo-this.gapFrom;return new Dp(this.from,this.from+this.slice.size+i,this.from+this.insert,this.from+this.insert+i,n.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(n){let i=n.mapResult(this.from,1),o=n.mapResult(this.to,-1),a=this.from==this.gapFrom?i.pos:n.map(this.gapFrom,-1),c=this.to==this.gapTo?o.pos:n.map(this.gapTo,1);return i.deletedAcross&&o.deletedAcross||a<i.pos||c>o.pos?null:new Dp(i.pos,o.pos,a,c,this.slice,this.insert,this.structure)}toJSON(){let n={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(n.slice=this.slice.toJSON()),this.structure&&(n.structure=!0),n}static fromJSON(n,i){if(typeof i.from!="number"||typeof i.to!="number"||typeof i.gapFrom!="number"||typeof i.gapTo!="number"||typeof i.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Dp(i.from,i.to,i.gapFrom,i.gapTo,zr.fromJSON(n,i.slice),i.insert,!!i.structure)}}T0.jsonID("replaceAround",Dp);function NRe(t,n,i){let o=t.resolve(n),a=i-n,c=o.depth;for(;a>0&&c>0&&o.indexAfter(c)==o.node(c).childCount;)c--,a--;if(a>0){let u=o.node(c).maybeChild(o.indexAfter(c));for(;a>0;){if(!u||u.isLeaf)return!0;u=u.firstChild,a--}}return!1}function I3r(t,n,i,o){let a=[],c=[],u,f;t.doc.nodesBetween(n,i,(g,w,x)=>{if(!g.isInline)return;let v=g.marks;if(!o.isInSet(v)&&x.type.allowsMarkType(o.type)){let C=Math.max(w,n),E=Math.min(w+g.nodeSize,i),A=o.addToSet(v);for(let M=0;M<v.length;M++)v[M].isInSet(A)||(u&&u.to==C&&u.mark.eq(v[M])?u.to=E:a.push(u=new $v(C,E,v[M])));f&&f.to==C?f.to=E:c.push(f=new c6(C,E,o))}}),a.forEach(g=>t.step(g)),c.forEach(g=>t.step(g))}function O3r(t,n,i,o){let a=[],c=0;t.doc.nodesBetween(n,i,(u,f)=>{if(!u.isInline)return;c++;let g=null;if(o instanceof F0e){let w=u.marks,x;for(;x=o.isInSet(w);)(g||(g=[])).push(x),w=x.removeFromSet(w)}else o?o.isInSet(u.marks)&&(g=[o]):g=u.marks;if(g&&g.length){let w=Math.min(f+u.nodeSize,i);for(let x=0;x<g.length;x++){let v=g[x],C;for(let E=0;E<a.length;E++){let A=a[E];A.step==c-1&&v.eq(a[E].style)&&(C=A)}C?(C.to=w,C.step=c):a.push({style:v,from:Math.max(f,n),to:w,step:c})}}}),a.forEach(u=>t.step(new $v(u.from,u.to,u.style)))}function Pze(t,n,i,o=i.contentMatch,a=!0){let c=t.doc.nodeAt(n),u=[],f=n+1;for(let g=0;g<c.childCount;g++){let w=c.child(g),x=f+w.nodeSize,v=o.matchType(w.type);if(!v)u.push(new lh(f,x,zr.empty));else{o=v;for(let C=0;C<w.marks.length;C++)i.allowsMarkType(w.marks[C].type)||t.step(new $v(f,x,w.marks[C]));if(a&&w.isText&&i.whitespace!="pre"){let C,E=/\r?\n|\r/g,A;for(;C=E.exec(w.text);)A||(A=new zr(An.from(i.schema.text(" ",i.allowedMarks(w.marks))),0,0)),u.push(new lh(f+C.index,f+C.index+C[0].length,A))}}f=x}if(!o.validEnd){let g=o.fillBefore(An.empty,!0);t.replace(f,f,new zr(g,0,0))}for(let g=u.length-1;g>=0;g--)t.step(u[g])}function L3r(t,n,i){return(n==0||t.canReplace(n,t.childCount))&&(i==t.childCount||t.canReplace(0,i))}function PR(t){let i=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let o=t.depth,a=0,c=0;;--o){let u=t.$from.node(o),f=t.$from.index(o)+a,g=t.$to.indexAfter(o)-c;if(o<t.depth&&u.canReplace(f,g,i))return o;if(o==0||u.type.spec.isolating||!L3r(u,f,g))break;f&&(a=1),g<u.childCount&&(c=1)}return null}function P3r(t,n,i){let{$from:o,$to:a,depth:c}=n,u=o.before(c+1),f=a.after(c+1),g=u,w=f,x=An.empty,v=0;for(let A=c,M=!1;A>i;A--)M||o.index(A)>0?(M=!0,x=An.from(o.node(A).copy(x)),v++):g--;let C=An.empty,E=0;for(let A=c,M=!1;A>i;A--)M||a.after(A+1)<a.end(A)?(M=!0,C=An.from(a.node(A).copy(C)),E++):w++;t.step(new Dp(g,w,u,f,new zr(x.append(C),v,E),x.size-v,!0))}function Rze(t,n,i=null,o=t){let a=R3r(t,n),c=a&&$3r(o,n);return c?a.map(Zzt).concat({type:n,attrs:i}).concat(c.map(Zzt)):null}function Zzt(t){return{type:t,attrs:null}}function R3r(t,n){let{parent:i,startIndex:o,endIndex:a}=t,c=i.contentMatchAt(o).findWrapping(n);if(!c)return null;let u=c.length?c[0]:n;return i.canReplaceWith(o,a,u)?c:null}function $3r(t,n){let{parent:i,startIndex:o,endIndex:a}=t,c=i.child(o),u=n.contentMatch.findWrapping(c.type);if(!u)return null;let g=(u.length?u[u.length-1]:n).contentMatch;for(let w=o;g&&w<a;w++)g=g.matchType(i.child(w).type);return!g||!g.validEnd?null:u}function F3r(t,n,i){let o=An.empty;for(let u=i.length-1;u>=0;u--){if(o.size){let f=i[u].type.contentMatch.matchFragment(o);if(!f||!f.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}o=An.from(i[u].type.create(i[u].attrs,o))}let a=n.start,c=n.end;t.step(new Dp(a,c,a,c,new zr(o,0,0),i.length,!0))}function B3r(t,n,i,o,a){if(!o.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let c=t.steps.length;t.doc.nodesBetween(n,i,(u,f)=>{let g=typeof a=="function"?a(u):a;if(u.isTextblock&&!u.hasMarkup(o,g)&&z3r(t.doc,t.mapping.slice(c).map(f),o)){let w=null;if(o.schema.linebreakReplacement){let E=o.whitespace=="pre",A=!!o.contentMatch.matchType(o.schema.linebreakReplacement);E&&!A?w=!1:!E&&A&&(w=!0)}w===!1&&Tsn(t,u,f,c),Pze(t,t.mapping.slice(c).map(f,1),o,void 0,w===null);let x=t.mapping.slice(c),v=x.map(f,1),C=x.map(f+u.nodeSize,1);return t.step(new Dp(v,C,v+1,C-1,new zr(An.from(o.create(g,null,u.marks)),0,0),1,!0)),w===!0&&_sn(t,u,f,c),!1}})}function _sn(t,n,i,o){n.forEach((a,c)=>{if(a.isText){let u,f=/\r?\n|\r/g;for(;u=f.exec(a.text);){let g=t.mapping.slice(o).map(i+1+c+u.index);t.replaceWith(g,g+1,n.type.schema.linebreakReplacement.create())}}})}function Tsn(t,n,i,o){n.forEach((a,c)=>{if(a.type==a.type.schema.linebreakReplacement){let u=t.mapping.slice(o).map(i+1+c);t.replaceWith(u,u+1,n.type.schema.text(`
|
|
@@ -1153,7 +1153,7 @@ ${i}
|
|
|
1153
1153
|
`?n.push({type:"hardBreak"}):c?n.push(tge("agent",c,a)):u&&n.push(tge("workflow",u,f||u)),i=g+o.length,o)),wUt(n,t.slice(i)),{type:"doc",content:[{type:"paragraph",content:n.length>0?n:void 0}]}}function E6r(t){const n=t.attrs??{},i=String(n.id??""),o=String(n.label??i);return(n.kind==="workflow"?"workflow":"agent")==="workflow"?`[[wf:${i}|${o}]]`:`@[${o}](${i})`}function Yan(t){if(!t)return"";switch(t.type){case"text":return t.text??"";case"hardBreak":return`
|
|
1154
1154
|
`;case"agentWorkflowMention":return E6r(t);default:return(t.content??[]).map(n=>Yan(n)).join("")}}function xUt(t){return(t.content??[]).map(n=>Yan(n)).join(`
|
|
1155
1155
|
`)}function vfe(t){return t.replace(/@\[([^\]]*)\]\(([^)]*)\)\s*/g,"@$2 ").replace(y6r,"/wf $1")}function _6r(t){return b6r.replace("__display__",t.name).replace("__id__",t.id)+" "}function T6r(t){return w6r.replace("__id__",t.id).replace("__display__",t.name)+" "}function A6r(t){const n=t.match(/\[\[wf:([^|\]]+)\|[^\]]*\]\]/);if(n!=null&&n[1])return n[1];const i=vfe(t).match(/(?:^|\s)\/wf\s+([^\s]+)/);return(i==null?void 0:i[1])??null}function M6r({$position:t}){var g;const n=(g=t.nodeBefore)!=null&&g.isText?t.nodeBefore.text??"":"";if(!n)return null;const i=t.pos-n.length,o=/(?:^|\s)(\/wf(?:\s+([^\n]*))?)$/.exec(n);if(!o||o.index===void 0)return null;const a=o[1]??"",c=o[2]??"",u=i+o.index+o[0].length-a.length,f=u+a.length;return u<t.pos&&f>=t.pos?{range:{from:u,to:f},query:c,text:a}:null}function N6r(t,n){const i=document.createElement("button");if(i.type="button",i.setAttribute("role","option"),i.setAttribute("aria-selected",n?"true":"false"),i.className="flex w-full cursor-pointer items-start gap-3 px-3 py-2 text-left transition-colors "+(n?"bg-blue-50":"bg-transparent hover:bg-gray-50"),t.kind==="workflow"){const c=document.createElement("span");c.className="mt-0.5 inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-blue-600 px-1.5 text-[10px] font-semibold uppercase tracking-wide text-white",c.textContent="wf",i.append(c)}const o=document.createElement("span");o.className="min-w-0 flex-1";const a=document.createElement("span");if(a.className="block truncate text-sm font-medium "+(n?"text-blue-700":"text-gray-900"),a.textContent=t.kind==="workflow"?t.label:`@${t.label}`,o.append(a),t.description||t.secondary){const c=document.createElement("span");c.className="mt-0.5 block truncate text-xs text-gray-500",c.textContent=t.secondary&&t.description?`${t.secondary} · ${t.description}`:t.secondary||t.description||"",o.append(c)}return i.append(o),i}function vUt(t){return()=>{let n=null,i=null,o=null,a=0,c=null;const u=()=>{c==null||c(),c=null,n==null||n.remove(),n=null,i=null,o=null,a=0,t.onVisibilityChange(!1)},f=()=>{if(!n||!(o!=null&&o.clientRect))return;const v=o.clientRect();if(!v)return;const C=n.offsetWidth||320,E=n.offsetHeight||0,A=Math.min(Math.max(12,v.left),Math.max(12,window.innerWidth-C-12)),M=v.bottom+8,I=Math.min(M,Math.max(12,window.innerHeight-E-12));n.style.left=`${A}px`,n.style.top=`${I}px`},g=v=>{if(!o)return;const C=o.items[v];C&&o.command(C)},w=()=>{if(!(!i||!o)){if(i.replaceChildren(),i.setAttribute("aria-label",t.label()),o.items.length===0){const v=document.createElement("div");v.className="px-3 py-2 text-sm text-gray-400",v.textContent=t.emptyLabel(),i.append(v),requestAnimationFrame(f);return}o.items.forEach((v,C)=>{const E=N6r(v,C===a);E.addEventListener("mousedown",A=>{A.preventDefault(),g(C)}),i==null||i.append(E)}),requestAnimationFrame(f)}},x=v=>{!o||o.items.length===0||(a=(a+v+o.items.length)%o.items.length,w())};return{onStart(v){o=v,a=0,n=document.createElement("div"),n.className="fixed z-[100] min-w-[320px] max-w-[360px] overflow-hidden rounded-xl border border-gray-200 bg-white shadow-lg",i=document.createElement("div"),i.setAttribute("role","listbox"),i.className="max-h-72 overflow-y-auto py-1",n.append(i),document.body.append(n);const C=E=>{const A=E.target;if(!(A instanceof Node)||n!=null&&n.contains(A))return;const M=o==null?void 0:o.editor.view.dom;M!=null&&M.contains(A)||u()};document.addEventListener("pointerdown",C,!0),c=()=>{document.removeEventListener("pointerdown",C,!0)},t.onVisibilityChange(!0),w()},onUpdate(v){o=v,a>=v.items.length&&(a=0),w()},onExit(){u()},onKeyDown({event:v}){return o?v.key==="ArrowDown"?(v.preventDefault(),x(1),!0):v.key==="ArrowUp"?(v.preventDefault(),x(-1),!0):v.key==="Enter"?o.items.length===0?!1:(v.preventDefault(),g(a),!0):v.key==="Escape"?(v.preventDefault(),u(),!0):!1:!1}}}}const j6r=v_r.extend({name:"agentWorkflowMention",addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),kind:{default:"agent",parseHTML:n=>n.getAttribute("data-kind")??"agent",renderHTML:n=>({"data-kind":String(n.kind??"agent")})}}},renderText({node:t}){const n=t.attrs.kind==="workflow"?"workflow":"agent",i=String(t.attrs.id??""),o=String(t.attrs.label??i);return n==="workflow"?`/wf ${i}`:`@${o}`},renderHTML({node:t,HTMLAttributes:n}){const i=t.attrs.kind==="workflow"?"workflow":"agent",o=String(t.attrs.id??""),a=String(t.attrs.label??o);return["span",{...n,class:i==="workflow"?"inline-flex items-center rounded-full bg-blue-50 px-2 py-0.5 text-xs font-medium text-blue-700":"inline-flex items-center rounded-full bg-blue-100 px-2 py-0.5 text-xs font-semibold text-blue-700","data-testid":i==="workflow"?"workflow-chip":"mention-chip"},i==="workflow"?`/wf ${o}`:`@${a}`]}});function kUt({value:t,onChange:n,onSend:i,agents:o,workflows:a=[],placeholder:c,disabled:u=!1,multiline:f=!1,className:g="",inputRef:w}){const{t:x}=Zn(),v=F.useRef(null),C=F.useRef(n),E=F.useRef(i),A=F.useRef(o),M=F.useRef(a),I=F.useRef(x("workflow.mentionLabel")),D=F.useRef(x("workflow.noSuggestions")),P=F.useRef(!1);C.current=n,E.current=i,A.current=o,M.current=a,I.current=x("workflow.mentionLabel"),D.current=x("workflow.noSuggestions");const R=F.useCallback(G=>{P.current=G},[]),z=F.useMemo(()=>[Jan.configure({heading:!1,blockquote:!1,bulletList:!1,orderedList:!1,listItem:!1,code:!1,codeBlock:!1,horizontalRule:!1}),wan.configure({placeholder:c??""}),j6r.configure({suggestions:[{char:"@",pluginKey:v6r,items:({query:G})=>{const Y=G.trim().toLowerCase();return A.current.filter(te=>Y?te.id.toLowerCase().includes(Y)||te.name.toLowerCase().includes(Y):!0).map(te=>({id:te.id,label:te.name,kind:"agent",description:[te.role,te.team].filter(Boolean).join(" · ")}))},render:vUt({label:()=>I.current,emptyLabel:()=>D.current,onVisibilityChange:R}),command:({editor:G,range:Y,props:te})=>{G.chain().focus().insertContentAt(Y,[tge("agent",te.id,te.label),{type:"text",text:" "}]).run()}},{char:"/",pluginKey:k6r,findSuggestionMatch:M6r,items:({query:G})=>M.current.map(Y=>({workflow:Y,score:S6r(Y,G)})).filter(Y=>Y.score>0).sort((Y,te)=>te.score-Y.score||Y.workflow.name.localeCompare(te.workflow.name)).slice(0,8).map(Y=>({id:Y.workflow.id,label:`/wf ${Y.workflow.id}`,kind:"workflow",description:Y.workflow.description,secondary:Y.workflow.name})),render:vUt({label:()=>I.current,emptyLabel:()=>D.current,onVisibilityChange:R}),command:({editor:G,range:Y,props:te})=>{const Q=M.current.find(se=>se.id===te.id);G.chain().focus().insertContentAt(Y,[tge("workflow",te.id,(Q==null?void 0:Q.name)??te.id),{type:"text",text:" "}]).run()}}]})],[R,c]),U=San({immediatelyRender:!1,extensions:z,content:yUt(t),editable:!u,editorProps:{attributes:{class:["focus:outline-none","text-sm","text-gray-900","break-words","[&_.is-editor-empty:first-child::before]:pointer-events-none","[&_.is-editor-empty:first-child::before]:float-left","[&_.is-editor-empty:first-child::before]:h-0","[&_.is-editor-empty:first-child::before]:text-gray-400","[&_.is-editor-empty:first-child::before]:content-[attr(data-placeholder)]",f?"min-h-[56px] max-h-[168px] overflow-y-auto px-4 py-3 whitespace-pre-wrap":"h-10 overflow-x-auto whitespace-nowrap px-4 py-[9px]"].join(" "),"data-testid":"mention-input-editor","aria-label":c||x("workflow.mentionLabel"),"aria-multiline":f?"true":"false",role:"textbox",placeholder:c??""},handleKeyDown:(G,Y)=>{var te;return Y.key==="Enter"&&!Y.shiftKey?P.current?!1:(Y.preventDefault(),(te=E.current)==null||te.call(E),!0):!f&&Y.key==="Enter"?(Y.preventDefault(),!0):!1}},onUpdate({editor:G}){const Y=xUt(G.getJSON());v.current=Y,C.current(Y)}},[z,u,f]);F.useEffect(()=>{U&&U.setEditable(!u)},[u,U]),F.useEffect(()=>{if(!U)return;const G=xUt(U.getJSON());t===G||t===v.current||(U.commands.setContent(yUt(t),{emitUpdate:!1}),v.current=t)},[U,t]);const W=["relative w-full border border-gray-200 bg-white transition-shadow",f?"rounded-xl":"rounded-md","focus-within:border-transparent focus-within:ring-2 focus-within:ring-blue-500",u?"pointer-events-none opacity-50":"",g].filter(Boolean).join(" ");return S.jsxs("div",{className:W,children:[w?S.jsx("textarea",{ref:w,tabIndex:-1,"aria-hidden":"true",className:"sr-only",onFocus:()=>{U==null||U.chain().focus("end").run()},readOnly:!0}):null,S.jsx(dHe,{editor:U})]})}function D6r(){var t;return typeof window<"u"&&typeof((t=window.electronAPI)==null?void 0:t.captureScreen)=="function"}function I6r(t){return new Promise((n,i)=>{const o=new FileReader;o.onload=()=>n(o.result.split(",")[1]),o.onerror=i,o.readAsDataURL(t)})}function CUt(t){return t.type.startsWith("image/")||t.type==="application/pdf"}const SUt=10*1024*1024;function oLe(t){t.startsWith("blob:")&&URL.revokeObjectURL(t)}const EUt=F.memo(function({files:n,onRemove:i}){const{t:o}=Zn();return n.length===0?null:S.jsx("div",{className:"flex gap-2 overflow-x-auto p-2",children:n.map(a=>S.jsxs("div",{className:a.mimeType==="application/pdf"?"relative h-[72px] w-44 shrink-0":"relative h-[72px] w-[72px] shrink-0",children:[a.mimeType==="application/pdf"?S.jsxs("div",{className:"flex h-full w-full items-center gap-3 rounded-lg border border-gray-200 bg-white px-3 shadow-sm",children:[S.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-red-50 text-red-600",children:S.jsx(Tx,{size:18})}),S.jsx("span",{className:"truncate text-xs font-medium text-gray-900",title:a.file.name,children:a.file.name})]}):S.jsx("img",{src:a.previewUrl,alt:a.file.name,loading:"lazy",decoding:"async",className:"h-full w-full rounded-lg object-cover"}),S.jsx("button",{type:"button",onClick:()=>i(a.id),className:"absolute -right-1.5 -top-1.5 flex h-5 w-5 items-center justify-center rounded-full bg-gray-800 text-white shadow transition-colors hover:bg-red-600","aria-label":o("chatInput.removeAttachment"),children:S.jsx(Op,{size:12})})]},a.id))})});function CHe({onSend:t,onCapture:n,disabled:i,activeAgent:o,value:a,onChange:c,agents:u,workflows:f,placeholder:g,sendLabel:w,multiline:x=!1,inputRef:v,variant:C="docked",className:E="",storageKey:A}){var Lr;const{t:M}=Zn(),[I,D]=F.useState(""),[P,R]=F.useState("query"),[z,U]=F.useState([]),[W,G]=F.useState(!1),[Y,te]=F.useState(!1),[Q,se]=F.useState([]),[ce,V]=F.useState(!1),ae=F.useRef(null),de=F.useRef(null),ee=F.useRef(Q);ee.current=Q;const ue=Zd(gn=>gn.currentWorkspaceId),he=b0(gn=>gn.workflows),ge=b0(gn=>gn.fetchWorkflows),oe=Zc(gn=>{var ti;return A?((ti=gn.chat.threads[A])==null?void 0:ti.mode)??"query":"query"}),Ae=Zc(gn=>gn.set),Te=Lm(gn=>gn.addToast),ve=D6r(),Ve=a??I,at=u??z,yt=f??he,Nt=A?oe:P,pt=F.useCallback(gn=>{if(c){c(gn);return}D(gn)},[c]);F.useEffect(()=>{u||wn.getAgents().then(gn=>U(gn.agents)).catch(()=>U([]))},[ue,u]),F.useEffect(()=>{f||ge().catch(()=>{})},[ge,f]),F.useEffect(()=>{if(!Y)return;const gn=Zt=>{var qr;(qr=ae.current)!=null&&qr.contains(Zt.target)||te(!1)},ti=Zt=>{Zt.key==="Escape"&&(Zt.preventDefault(),te(!1))};return window.addEventListener("mousedown",gn),window.addEventListener("keydown",ti),()=>{window.removeEventListener("mousedown",gn),window.removeEventListener("keydown",ti)}},[Y]),F.useEffect(()=>{i&&te(!1)},[i]),F.useEffect(()=>()=>{ee.current.forEach(gn=>oLe(gn.previewUrl))},[]);const St=F.useMemo(()=>{const gn=A6r(Ve);return yt.find(ti=>ti.id===gn)??null},[Ve,yt]),Bt=F.useMemo(()=>[{value:"query",label:M("taskDetail.inputModeQuery")},{value:"execute",label:M("taskDetail.inputModeExecute")}],[M]),bt=((Lr=Bt.find(gn=>gn.value===Nt))==null?void 0:Lr.label)??Bt[0].label,dn=x?"!border-0 !shadow-none !bg-transparent focus-within:!border-transparent focus-within:!ring-0 !rounded-none":"flex-1 shadow-sm",Mt=F.useCallback(gn=>{const ti=Array.from(gn).filter(CUt);if(ti.length===0)return;const Zt=ti.filter(_r=>_r.size>SUt?(Te({type:"error",message:M("chatInput.fileTooLarge",{name:_r.name,size:(_r.size/(1024*1024)).toFixed(1),max:SUt/(1024*1024)})}),!1):!0);if(Zt.length===0)return;const qr=Zt.map(_r=>({id:crypto.randomUUID(),file:_r,previewUrl:_r.type.startsWith("image/")?URL.createObjectURL(_r):"",mimeType:_r.type}));se(_r=>[..._r,...qr])},[Te,M]),vn=F.useCallback(gn=>{se(ti=>{const Zt=ti.find(qr=>qr.id===gn);return Zt&&oLe(Zt.previewUrl),ti.filter(qr=>qr.id!==gn)})},[]),er=F.useCallback(gn=>{var qr;const ti=(qr=gn.clipboardData)==null?void 0:qr.items;if(!ti)return;const Zt=[];for(let _r=0;_r<ti.length;_r++)if(ti[_r].kind==="file"&&(ti[_r].type.startsWith("image/")||ti[_r].type==="application/pdf")){const ks=ti[_r].getAsFile();ks&&CUt(ks)&&Zt.push(ks)}Zt.length>0&&Mt(Zt)},[Mt]),Mn=F.useCallback(gn=>{gn.preventDefault(),V(!0)},[]),yi=F.useCallback(gn=>{gn.preventDefault(),V(!1)},[]),hr=F.useCallback(gn=>{gn.preventDefault(),V(!1),Mt(gn.dataTransfer.files)},[Mt]),io=F.useCallback(gn=>{gn.target.files&&Mt(gn.target.files),gn.target.value=""},[Mt]),oi=F.useCallback(async()=>{const gn=Ve.trim();if(!gn||i)return;const ti=vfe(gn),Zt=ti.match(/^@(\S+)\s+([\s\S]+)/),qr=(Zt==null?void 0:Zt[1])||o||"",_r=(Zt==null?void 0:Zt[2])??ti;let ks;Q.length>0&&(ks=await Promise.all(Q.map(async Oo=>({data:await I6r(Oo.file),mimeType:Oo.mimeType,filename:Oo.file.name})))),await t(_r,qr,Nt,ks)!==!1&&(pt(""),Q.forEach(Oo=>oLe(Oo.previewUrl)),se([]))},[o,Q,i,Ve,Nt,t,pt]),on=F.useCallback(async()=>{var gn,ti;if(!W){G(!0);try{const Zt=await((ti=(gn=window.electronAPI)==null?void 0:gn.captureScreen)==null?void 0:ti.call(gn));Zt!=null&&Zt.success&&n&&n(Zt)}finally{G(!1)}}},[W,n]),ei=F.useCallback(gn=>{if(!A){R(gn);return}const ti=Zc.getState().chat.threads,{[A]:Zt,...qr}=ti;let _r={...qr,[A]:{mode:gn}};const ks=Object.keys(_r);ks.length>the&&(_r=Object.fromEntries(ks.slice(ks.length-the).map($a=>[$a,_r[$a]]))),Ae("chat",{threads:_r})},[Ae,A]),Ar=[C==="standalone"?"w-full":"shrink-0 border-t border-gray-200 bg-gray-50 px-5 py-3",E].filter(Boolean).join(" "),bi=x?["w-full rounded-2xl border border-gray-200 bg-white shadow-sm transition-shadow","focus-within:border-blue-400 focus-within:ring-2 focus-within:ring-blue-500/20",i?"opacity-60":""].filter(Boolean).join(" "):"flex items-center gap-2";function ds(){return ce?S.jsx("div",{className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-2xl bg-blue-50/80 border-2 border-dashed border-blue-400",children:S.jsx("span",{className:"text-sm font-medium text-blue-600",children:M("chatInput.dropFile")})}):null}function ct({size:gn=16,btnClassName:ti}){const Zt=x?"inline-flex h-8 w-8 items-center justify-center rounded-md text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600 disabled:cursor-not-allowed disabled:opacity-40":"inline-flex h-10 w-10 items-center justify-center rounded-md border border-gray-200 bg-white text-gray-400 shadow-sm transition-colors hover:border-gray-300 hover:bg-gray-50 hover:text-gray-600 disabled:cursor-not-allowed disabled:opacity-40";return S.jsx("button",{type:"button",onClick:()=>{var qr;return(qr=de.current)==null?void 0:qr.click()},disabled:i,className:ti??Zt,title:M("chatInput.attachFile"),"aria-label":M("chatInput.attachFile"),children:S.jsx(zUn,{size:gn})})}function jt(){return S.jsx("input",{ref:de,type:"file",accept:"image/*,application/pdf",multiple:!0,className:"hidden",onChange:io})}if(!x)return S.jsxs("div",{className:`${Ar} relative`,onPaste:er,onDragOver:Mn,onDragLeave:yi,onDrop:hr,children:[ds(),S.jsx(EUt,{files:Q,onRemove:vn}),S.jsx("div",{className:bi,children:yr()}),jt()]});return S.jsxs("div",{className:`${Ar} relative`,onDragOver:Mn,onDragLeave:yi,onDrop:hr,children:[ds(),S.jsxs("div",{className:bi,onPaste:er,children:[S.jsx(EUt,{files:Q,onRemove:vn}),S.jsxs("div",{className:"relative min-w-0",children:[St&&S.jsxs("div",{className:"pointer-events-none absolute bottom-full left-0 mb-2 flex items-center gap-2 rounded-lg bg-gray-900 px-3 py-2 text-xs text-white shadow-lg",children:[S.jsx(D7,{size:13,className:"text-blue-300"}),S.jsx("span",{className:"max-w-[420px] truncate",children:St.description||M("workflow.selectedLabel",{id:St.id})})]}),S.jsx(kUt,{value:Ve,onChange:pt,onSend:oi,agents:at,workflows:yt,placeholder:g??(o?M("taskDetail.inputPlaceholderActive",{agent:o}):M("taskDetail.inputPlaceholder")),disabled:i,multiline:!0,inputRef:v,className:dn})]}),S.jsxs("div",{className:"flex items-center gap-2 rounded-b-2xl border-t border-gray-100 bg-gray-50/50 px-3 py-2",children:[Sn(),ct({}),ve&&S.jsx("button",{onClick:on,disabled:i||W,className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600 disabled:cursor-not-allowed disabled:opacity-40",title:M("taskDetail.captureScreen"),"aria-label":M("taskDetail.captureScreen"),children:S.jsx(K7t,{size:16})}),S.jsx("div",{className:"flex-1"}),S.jsx("button",{onClick:oi,disabled:i||!vfe(Ve).trim(),className:"inline-flex h-8 shrink-0 items-center justify-center rounded-md bg-blue-600 px-4 text-sm font-medium text-white shadow-sm transition-colors hover:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-40",children:w??M("taskDetail.send")})]})]}),jt()]});function Sn(){return S.jsxs("div",{ref:ae,className:"relative shrink-0",children:[S.jsxs("button",{type:"button",onMouseDown:gn=>gn.preventDefault(),onClick:()=>{i||te(gn=>!gn)},disabled:i,"aria-expanded":Y,"aria-haspopup":"listbox",className:["inline-flex h-8 items-center justify-between gap-1 rounded-md border px-2.5 text-xs font-medium transition-all duration-150",Nt==="execute"?"border-red-200 bg-red-50 text-red-700 hover:border-red-300 hover:bg-red-100":"border-gray-200 bg-white text-gray-700 hover:border-gray-300 hover:bg-gray-50",i?"cursor-not-allowed opacity-40":""].filter(Boolean).join(" "),children:[S.jsx("span",{className:"truncate",children:bt}),S.jsx(vg,{size:12,className:`shrink-0 transition-transform duration-150 ${Y?"rotate-180":""}`})]}),S.jsx("div",{role:"listbox","aria-hidden":!Y,className:["absolute bottom-full left-0 z-20 mb-2 w-32 origin-bottom-left rounded-lg border bg-white p-1 shadow-lg transition-all duration-150",Y?"pointer-events-auto translate-y-0 scale-100 opacity-100":"pointer-events-none translate-y-1 scale-95 opacity-0",Nt==="execute"?"border-red-200":"border-gray-200"].filter(Boolean).join(" "),children:Bt.map(gn=>{const ti=gn.value===Nt;return S.jsx("button",{type:"button",role:"option","aria-selected":ti,onMouseDown:Zt=>Zt.preventDefault(),onClick:()=>{ei(gn.value),te(!1)},className:["flex w-full items-center rounded-md px-3 py-2 text-left text-xs font-medium transition-colors duration-150",ti?gn.value==="execute"?"bg-red-50 text-red-700":"bg-gray-100 text-gray-900":gn.value==="execute"?"text-gray-700 hover:bg-red-50 hover:text-red-700":"text-gray-700 hover:bg-gray-50 hover:text-gray-900"].join(" "),children:gn.label},gn.value)})})]})}function yr(){return S.jsxs(S.Fragment,{children:[S.jsxs("div",{ref:ae,className:"relative shrink-0",children:[S.jsxs("button",{type:"button",onMouseDown:gn=>gn.preventDefault(),onClick:()=>{i||te(gn=>!gn)},disabled:i,"aria-expanded":Y,"aria-haspopup":"listbox",className:["inline-flex h-10 w-24 items-center justify-between gap-1.5 rounded-md border px-3 text-sm font-medium shadow-sm transition-all duration-150",Nt==="execute"?"border-red-200 bg-red-50 text-red-700 hover:border-red-300 hover:bg-red-100":"border-gray-200 bg-white text-gray-700 hover:border-gray-300 hover:bg-gray-50",Y?"shadow-sm":"",i?"cursor-not-allowed opacity-40":""].filter(Boolean).join(" "),children:[S.jsx("span",{className:"truncate",children:bt}),S.jsx(vg,{size:14,className:`shrink-0 transition-transform duration-150 ${Y?"rotate-180":""}`})]}),S.jsx("div",{role:"listbox","aria-hidden":!Y,className:["absolute bottom-full left-0 z-20 mb-2 w-32 origin-bottom-left rounded-lg border bg-white p-1 shadow-lg transition-all duration-150",Y?"pointer-events-auto translate-y-0 scale-100 opacity-100":"pointer-events-none translate-y-1 scale-95 opacity-0",Nt==="execute"?"border-red-200":"border-gray-200"].filter(Boolean).join(" "),children:Bt.map(gn=>{const ti=gn.value===Nt;return S.jsx("button",{type:"button",role:"option","aria-selected":ti,onMouseDown:Zt=>Zt.preventDefault(),onClick:()=>{ei(gn.value),te(!1)},className:["flex w-full items-center rounded-md px-3 py-2 text-left text-xs font-medium transition-colors duration-150",ti?gn.value==="execute"?"bg-red-50 text-red-700":"bg-gray-100 text-gray-900":gn.value==="execute"?"text-gray-700 hover:bg-red-50 hover:text-red-700":"text-gray-700 hover:bg-gray-50 hover:text-gray-900"].join(" "),children:gn.label},gn.value)})})]}),S.jsx("div",{className:"min-w-0 flex-1",children:S.jsxs("div",{className:"relative flex min-w-0 items-center",children:[St&&S.jsxs("div",{className:"pointer-events-none absolute bottom-full left-0 mb-2 flex items-center gap-2 rounded-lg bg-gray-900 px-3 py-2 text-xs text-white shadow-lg",children:[S.jsx(D7,{size:13,className:"text-blue-300"}),S.jsx("span",{className:"max-w-[420px] truncate",children:St.description||M("workflow.selectedLabel",{id:St.id})})]}),S.jsx(kUt,{value:Ve,onChange:pt,onSend:oi,agents:at,workflows:yt,placeholder:g??(o?M("taskDetail.inputPlaceholderActive",{agent:o}):M("taskDetail.inputPlaceholder")),disabled:i,multiline:x,inputRef:v,className:dn})]})}),ct({size:18}),ve&&S.jsx("button",{onClick:on,disabled:i||W,className:"inline-flex h-10 w-10 items-center justify-center rounded-md border border-gray-200 bg-white text-gray-400 shadow-sm transition-colors hover:border-gray-300 hover:bg-gray-50 hover:text-gray-600 disabled:cursor-not-allowed disabled:opacity-40",title:M("taskDetail.captureScreen"),"aria-label":M("taskDetail.captureScreen"),children:S.jsx(K7t,{size:18})}),S.jsx("button",{onClick:oi,disabled:i||!vfe(Ve).trim(),className:"inline-flex h-10 shrink-0 items-center justify-center rounded-md bg-blue-600 px-5 text-sm font-medium text-white shadow-sm transition-colors hover:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-40",children:w??M("taskDetail.send")})]})}}function O6r(){const{t}=Zn(),{slug:n,taskId:i}=Ff(),o=F.useRef(null),{setPageHeader:a}=Sd(),{messages:c,loading:u,error:f,taskStatus:g,activeTaskId:w,logs:x,childTasks:v,sending:C,fetchDetail:E,sendMessage:A,addLocalMessage:M,refreshStatus:I,setLiveUpdatesConnected:D,stopPolling:P,reset:R}=UJt();F.useEffect(()=>{a({title:"",actions:null})},[a]),F.useEffect(()=>(i&&E(i),()=>{P(),R()}),[i]);const z=w??i??null,U=F.useMemo(()=>({"task.logged":se=>{se.taskId===z&&I(se.taskId)},"task.updated":se=>{se.taskId===z&&I(se.taskId)}}),[z,I]),{connected:W}=kR(n,U);if(F.useEffect(()=>{D(W)},[W,D]),F.useEffect(()=>{o.current&&(o.current.scrollTop=o.current.scrollHeight)},[c.length,x.length]),!i)return null;const G=(se,ce)=>{A(se,ce)},Y=se=>{M({id:`capture-${se.timestamp}`,userId:"user",text:"",timestamp:new Date(se.timestamp).toISOString(),isAssistant:!1,imageDataUrl:se.imageDataUrl})},te=c.reduceRight((se,ce,V)=>se===-1&&ce.isAssistant?V:se,-1),Q=(()=>{var V;const se=new Map;let ce=null;for(let ae=0;ae<c.length;ae++)if(c[ae].isAssistant){const de=((V=c[ae].metadata)==null?void 0:V.agent_id)??"assistant";de!==ce&&(se.set(ae,de),ce=de)}return se})();return S.jsxs("div",{className:"flex flex-col h-screen -m-6 bg-gray-50",children:[S.jsxs("div",{ref:o,className:"flex-1 overflow-y-auto px-8 py-6 space-y-5",children:[u&&S.jsx("div",{className:"flex items-center justify-center py-16",children:S.jsx(Is,{size:24,className:"animate-spin text-gray-500"})}),f&&!u&&S.jsxs("div",{className:"flex items-center gap-3 bg-red-50 text-red-600 text-sm rounded-lg px-4 py-3 border border-red-200",children:[S.jsx(wc,{size:16,className:"shrink-0"}),S.jsx("span",{children:f})]}),!u&&c.map((se,ce)=>{const V=ce===te,ae=Q.get(ce);return S.jsxs(F.Fragment,{children:[ae&&S.jsxs("div",{className:"flex items-center gap-3 py-1",children:[S.jsx("div",{className:"flex-1 h-px bg-gray-200"}),S.jsx("span",{className:"text-xs text-gray-400 shrink-0 select-none",children:t("taskDetail.agentJoined",{agent:ae})}),S.jsx("div",{className:"flex-1 h-px bg-gray-200"})]}),S.jsx(SRe,{message:se,logs:se.logs,childTasks:V?v:void 0,taskStatus:V?g:void 0})]},se.id)}),!u&&!f&&S.jsx("div",{className:"mt-2",children:S.jsx(Dze,{logs:x,childTasks:v,status:g})}),!u&&!f&&c.length===0&&S.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-gray-500",children:[S.jsx("p",{className:"text-sm",children:t("taskDetail.noMessages")}),S.jsx("p",{className:"text-xs mt-1 text-gray-600",children:t("taskDetail.noMessagesHint")})]})]}),S.jsx(CHe,{onSend:G,onCapture:Y,disabled:C,multiline:!0})]})}const L6r=5e3,P6r=1e3;function SHe(t,n){const i=F.useRef(t);F.useEffect(()=>{i.current=t},[t]);const{interval:o,idleOnly:a=!1,idleTimeout:c=L6r,enabled:u=!0}=n;F.useEffect(()=>{if(!u)return;const f=()=>{i.current()};if(!a){const I=window.setInterval(f,o);return()=>{window.clearInterval(I)}}let g=null,w=null,x=Number.NEGATIVE_INFINITY;const v=()=>{g!==null&&(window.clearTimeout(g),g=null)},C=()=>{w!==null&&(window.clearInterval(w),w=null)},E=()=>{w===null&&(w=window.setInterval(f,o))},A=()=>{v(),g=window.setTimeout(()=>{E()},c)},M=()=>{const I=Date.now();I-x<P6r||(x=I,C(),A())};return A(),document.addEventListener("mousemove",M,{passive:!0}),document.addEventListener("keydown",M,{passive:!0}),()=>{C(),v(),document.removeEventListener("mousemove",M),document.removeEventListener("keydown",M)}},[u,a,c,o])}const _Ut=[5e3,1e4,2e4,6e4];function Xan(t,n){const{fingerprint:i,connected:o,lastEventAt:a,ladder:c=_Ut,enabled:u=!0}=n,f=F.useMemo(()=>c.length>0?[...c]:[..._Ut],[c]),[g,w]=F.useState(0),x=F.useRef(null),v=F.useRef(0),C=F.useRef(a);F.useEffect(()=>{x.current=null,v.current=0,w(0)},[f]),F.useEffect(()=>{C.current=a},[a]),F.useEffect(()=>{(!u||!o)&&w(0)},[o,u]);const E=F.useCallback(async()=>{const A=v.current,M=C.current>A;try{await t()}catch{}const I=i(),D=x.current!==null&&I!==x.current;if(x.current=I,v.current=Date.now(),!o){w(0);return}if(D&&!M){w(0);return}w(P=>Math.min(P+1,f.length-1))},[o,i,f.length,t]);return SHe(E,{interval:f[g],enabled:u}),{intervalMs:f[g]}}const CP={id:"",name:"",role:"",team:"",description:"",provider:"",model:"",prompt:"",options:{query:{},execute:{}}},R6r={include:[]},$6r=new Set(["claude","gemini","copilot","codex","opencode"]),Qan=[{id:"coding-assistant",icon:"📝",titleKey:"agent.template.codingAssistant",descriptionKey:"agent.template.codingAssistantDesc",form:{name:"Coding Assistant",role:"Software Engineer",description:"General coding, implementation, debugging, and refactoring support",provider:"acp/claude",model:"claude-sonnet-4-6"}},{id:"research",icon:"🔍",titleKey:"agent.template.research",descriptionKey:"agent.template.researchDesc",form:{name:"Research Assistant",role:"Researcher",description:"Technical research, comparisons, and source-backed investigation",provider:"acp/gemini",model:"gemini-3-flash-preview"}},{id:"data-analysis",icon:"📊",titleKey:"agent.template.dataAnalysis",descriptionKey:"agent.template.dataAnalysisDesc",form:{name:"Data Analyst",role:"Data Analyst",description:"Data exploration, analysis, and reporting support",provider:"acp/copilot",model:"gpt-5.4"}},{id:"writing",icon:"✍️",titleKey:"agent.template.writing",descriptionKey:"agent.template.writingDesc",form:{name:"Writing Assistant",role:"Technical Writer",description:"Documentation drafting, editing, and structured content writing",provider:"acp/claude",model:"claude-sonnet-4-6"}},{id:"design-review",icon:"🎨",titleKey:"agent.template.designReview",descriptionKey:"agent.template.designReviewDesc",form:{name:"Design Reviewer",role:"Design Reviewer",description:"UI/UX review, multimodal inspection, and feedback support",provider:"acp/gemini",model:"gemini-3-pro-preview"}}];function SP(t){return{include:[...(t==null?void 0:t.include)??R6r.include]}}function F6r(t){return t&&t.charAt(0).toUpperCase()+t.slice(1)}function B6r(t){return t===!0?{enabled:!0,mode:"all",files:[]}:typeof t=="string"?{enabled:!0,mode:"specific",files:[t]}:Array.isArray(t)?{enabled:!0,mode:"specific",files:t.filter(n=>typeof n=="string")}:{enabled:!1,mode:"all",files:[]}}function TUt(t){const{goals:n,daily:i,...o}=t??{};return{...o,query:{...(t==null?void 0:t.query)??{}},execute:{...(t==null?void 0:t.execute)??{}}}}function M6(t){if(!t)return"";if(t.startsWith("cli/")){const n=t.slice(4);if($6r.has(n))return`acp/${n}`}return t}function fde(t,n,i){var a;const o=(a=t==null?void 0:t[n])==null?void 0:a[i];return typeof o=="string"?o:""}function kfe(t,n){if(!t)return"";const i=M6(t),o=i.includes("/")?i.split("/").at(-1)??i:i;if(n){const a=`agent.engine.${o}`,c=n(a);if(c!==a)return c}return F6r(o)}function uK(t,n){if(!t)return"";if(!n)return t;const i=`agent.model.${t}.label`,o=n(i);return o===i?t:o}const z6r=nf(t=>({activeTab:"basic",selectedTemplateId:null,form:CP,skills:SP(),goalsEnabled:!1,goalsMode:"all",goalsFiles:[],dailyEnabled:!1,setActiveTab:n=>t({activeTab:n}),setField:(n,i)=>{t(o=>({form:{...o.form,[n]:i}}))},setProvider:n=>{t(i=>({form:{...i.form,provider:M6(n),model:"",options:TUt()}}))},setOption:(n,i,o)=>{t(a=>({form:{...a.form,options:{...a.form.options,[n]:{...a.form.options[n]??{},[i]:o}}}}))},setSkillsInclude:n=>{t(i=>({skills:{...i.skills,include:[...n]}}))},setGoalsEnabled:n=>t({goalsEnabled:n}),setGoalsMode:n=>t({goalsMode:n}),setGoalsFiles:n=>t({goalsFiles:n}),setDailyEnabled:n=>t({dailyEnabled:n}),initializeBlank:()=>{t({activeTab:"basic",selectedTemplateId:null,form:CP,skills:SP(),goalsEnabled:!1,goalsMode:"all",goalsFiles:[],dailyEnabled:!1})},initializeFromAgent:(n,i)=>{var c,u;const o=(i==null?void 0:i.clearIdentity)??!1,a=B6r((c=n.options)==null?void 0:c.goals);t({activeTab:"basic",selectedTemplateId:null,form:{...CP,id:o?"":n.id??"",name:o?"":n.name??"",role:n.role??"",team:n.team??"",description:n.description??"",provider:M6(n.provider),model:n.model??"",prompt:n.prompt??"",options:TUt(n.options)},skills:SP(i==null?void 0:i.skills),goalsEnabled:a.enabled,goalsMode:a.mode,goalsFiles:a.files,dailyEnabled:((u=n.options)==null?void 0:u.daily)===!0})},applyTemplate:n=>{if(!n){t({activeTab:"basic",selectedTemplateId:null,form:CP,skills:SP(),goalsEnabled:!1,goalsMode:"all",goalsFiles:[],dailyEnabled:!1});return}const i=Qan.find(o=>o.id===n);i&&t({activeTab:"basic",selectedTemplateId:i.id,form:{...CP,...i.form,id:""},skills:SP(),goalsEnabled:!1,goalsMode:"all",goalsFiles:[],dailyEnabled:!1})},reset:()=>{t({activeTab:"basic",selectedTemplateId:null,form:CP,skills:SP(),goalsEnabled:!1,goalsMode:"all",goalsFiles:[],dailyEnabled:!1})}})),H6r={bash:"#a855f7",read:"#22c55e",grep:"#22c55e",edit:"#f97316",write:"#f97316"};function U6r(t){return H6r[t.trim().toLowerCase()]??"#6b7280"}function W6r(t){switch(t.trim().toLowerCase()){case"bash":return IFe;case"read":return Tx;case"grep":return mC;case"edit":case"write":return WJ;default:return gJt}}function q6r({stats:t,open:n,onToggle:i}){const{t:o}=Zn(),a=F.useMemo(()=>t.reduce((u,f)=>u+f.count,0),[t]),c=F.useMemo(()=>t.map(u=>{const f=a>0?u.count/a*100:0;return{...u,color:U6r(u.tool),percentage:f,displayPercentage:Math.round(f)}}),[t,a]);return t.length===0||a===0?null:S.jsxs("section",{className:"rounded-lg border border-gray-200 bg-white shadow-sm",children:[S.jsx("div",{className:"border-b border-gray-200 px-4 py-3",children:S.jsxs("button",{type:"button",onClick:i,"aria-expanded":n,className:"flex w-full items-center justify-between gap-4 text-left",children:[S.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[n?S.jsx(vg,{size:16,className:"shrink-0 text-gray-400"}):S.jsx(vx,{size:16,className:"shrink-0 text-gray-400"}),S.jsx("span",{className:"truncate text-sm font-semibold text-gray-900",children:o("tasks.panel.toolUsage")})]}),S.jsx("span",{className:"flex h-2.5 w-28 shrink-0 overflow-hidden rounded-full bg-gray-100","aria-hidden":"true",children:c.map(u=>S.jsx("span",{className:"h-full",style:{width:`${u.percentage}%`,backgroundColor:u.color},title:o("tasks.panel.toolUsageTooltip",{tool:u.tool,count:u.count,pct:u.displayPercentage})},u.tool))})]})}),n&&S.jsx("div",{className:"px-4 py-3",children:S.jsxs("table",{className:"w-full table-fixed text-sm",children:[S.jsx("thead",{children:S.jsxs("tr",{className:"text-left text-xs uppercase tracking-wide text-gray-500",children:[S.jsx("th",{className:"pb-2 font-medium",children:o("tasks.panel.tool")}),S.jsx("th",{className:"pb-2 text-right font-medium",children:o("tasks.panel.calls")}),S.jsx("th",{className:"pb-2 pl-4 font-medium",children:o("tasks.panel.ratio")})]})}),S.jsx("tbody",{className:"divide-y divide-gray-100",children:c.map(u=>{const f=W6r(u.tool);return S.jsxs("tr",{children:[S.jsx("td",{className:"py-3 pr-3",children:S.jsxs("div",{className:"flex items-center gap-2 text-gray-800",children:[S.jsx("span",{className:"inline-flex h-5 w-5 items-center justify-center rounded-full",style:{backgroundColor:`${u.color}1a`,color:u.color},children:S.jsx(f,{size:12})}),S.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:u.color},"aria-hidden":"true"}),S.jsx("span",{className:"truncate font-medium",children:u.tool})]})}),S.jsx("td",{className:"py-3 text-right font-mono text-xs text-gray-600",children:u.count}),S.jsx("td",{className:"py-3 pl-4",children:S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsxs("span",{className:"w-10 shrink-0 text-xs font-medium text-gray-600",children:[u.displayPercentage,"%"]}),S.jsx("div",{className:"h-2 flex-1 overflow-hidden rounded-full bg-gray-100",children:S.jsx("div",{className:"h-full rounded-full",style:{width:`${u.percentage}%`,backgroundColor:u.color},title:o("tasks.panel.toolUsageTooltip",{tool:u.tool,count:u.count,pct:u.displayPercentage})})})]})})]},u.tool)})})]})})]})}function aLe(t){switch(t){case"success":return{prompt:!1,renderedPrompt:!1,result:!0,toolUsage:!1,metadata:!1};case"failed":return{prompt:!0,renderedPrompt:!1,result:!1,toolUsage:!1,metadata:!1};case"running":return{prompt:!1,renderedPrompt:!1,result:!1,toolUsage:!1,metadata:!1};case"pending":default:return{prompt:!0,renderedPrompt:!1,result:!1,toolUsage:!1,metadata:!1}}}function G6r(t){return t?t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:`${t}`:"0"}function V6r(t,n){const i=(t??0)+(n??0);return i===0?"-":`${G6r(i)} tok`}function K6r(t){return t?t<.01?`$${t.toFixed(4)}`:`$${t.toFixed(2)}`:"-"}function J6r(t,n){return n==="running"||t==null?"—":`${(t/1e3).toFixed(1).replace(/\.0$/,"")}s`}function AUt(t){return t?new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(new Date(t)):"—"}function Y6r(t,n,i){return(n==null?void 0:n.agentId)??(i==null?void 0:i.agent)??t}function r$e({status:t}){const{t:n}=Zn(),i={success:"bg-green-100 text-green-800",failed:"bg-red-100 text-red-800",running:"bg-yellow-100 text-yellow-800",pending:"bg-gray-100 text-gray-800"};return S.jsx("span",{className:`inline-flex items-center rounded-full px-2.5 py-1 text-xs font-medium ${i[t]}`,children:n(`tasks.status.${t}`)})}function X6r({mode:t}){const{t:n}=Zn(),i=t==null?void 0:t.trim().toLowerCase();return i!=="execute"&&i!=="query"?null:S.jsx("span",{className:["rounded-md px-2 py-0.5 text-xs font-medium",i==="execute"?"border border-red-200 bg-red-50 text-red-700":"bg-gray-100 text-gray-900"].join(" "),children:n(i==="execute"?"agent.executeMode":"agent.queryMode")})}function MUt({title:t,content:n,open:i,onToggle:o,onCopy:a,clampLines:c}){const{t:u}=Zn(),[f,g]=F.useState(!1);F.useEffect(()=>{g(!1)},[n]);const w=!!c&&n.trim().length>240,x=c&&!f?`overflow-hidden [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:${c}]`:"";return S.jsxs("section",{className:"rounded-lg border border-gray-200 bg-white shadow-sm",children:[S.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-gray-200 px-4 py-3",children:[S.jsxs("button",{type:"button",onClick:o,"aria-expanded":i,className:"flex min-w-0 flex-1 items-center gap-2 text-left",children:[i?S.jsx(vg,{size:16,className:"shrink-0 text-gray-400"}):S.jsx(vx,{size:16,className:"shrink-0 text-gray-400"}),S.jsx("span",{className:"truncate text-sm font-semibold text-gray-900",children:t})]}),S.jsxs("button",{type:"button",onClick:a,className:"inline-flex items-center gap-1 rounded-md border border-gray-200 px-2.5 py-1.5 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-50",children:[S.jsx(x5,{size:13}),S.jsx("span",{children:u("tasks.panel.copy")})]})]}),i&&S.jsxs("div",{className:"px-4 py-3",children:[S.jsx("div",{className:`text-sm leading-6 text-gray-700 ${x}`,children:S.jsx(w9,{content:n})}),w&&S.jsx("button",{type:"button",onClick:()=>g(v=>!v),className:"mt-2 text-xs font-medium text-blue-600 transition-colors hover:text-blue-700",children:u(f?"tasks.panel.showLess":"tasks.panel.showMore")})]})]})}function Q6r({title:t,content:n,open:i,onToggle:o,onCopy:a}){const{t:c}=Zn(),[u,f]=F.useState(!1),w=F.useMemo(()=>n.split(`
|
|
1156
|
-
`).length,[n])>50;return F.useEffect(()=>{f(!1)},[n]),S.jsxs("section",{className:"rounded-lg border border-gray-200 bg-white shadow-sm",children:[S.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-gray-200 px-4 py-3",children:[S.jsxs("button",{type:"button",onClick:o,"aria-expanded":i,className:"flex min-w-0 flex-1 items-center gap-2 text-left",children:[i?S.jsx(vg,{size:16,className:"shrink-0 text-gray-400"}):S.jsx(vx,{size:16,className:"shrink-0 text-gray-400"}),S.jsx("span",{className:"truncate text-sm font-semibold text-gray-900",children:t})]}),S.jsxs("button",{type:"button",onClick:a,className:"inline-flex items-center gap-1 rounded-md border border-gray-200 px-2.5 py-1.5 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-50",children:[S.jsx(x5,{size:13}),S.jsx("span",{children:c("tasks.panel.copy")})]})]}),i&&S.jsxs("div",{className:"space-y-3 px-4 py-3",children:[S.jsx("pre",{className:["overflow-x-auto whitespace-pre-wrap break-words rounded-md bg-gray-900 p-4 font-mono text-xs leading-5 text-gray-100",w&&!u?"max-h-[62.5rem] overflow-hidden":""].join(" "),children:n}),w&&S.jsx("button",{type:"button",onClick:()=>f(x=>!x),className:"text-xs font-medium text-blue-600 transition-colors hover:text-blue-700",children:c(u?"tasks.panel.showLess":"tasks.panel.showMore")})]})]})}function Z6r({childTasks:t,onSelectTask:n}){const{t:i}=Zn();return S.jsxs("section",{className:"rounded-lg border border-gray-200 bg-white shadow-sm",children:[S.jsx("div",{className:"border-b border-gray-200 px-4 py-3",children:S.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:i("tasks.panel.childTasks")})}),S.jsx("div",{className:"divide-y divide-gray-200",children:t.map(o=>{if(n){const a=n;return S.jsxs("button",{type:"button",onClick:()=>a(o.taskId),className:"flex w-full cursor-pointer items-center justify-between gap-3 px-4 py-3 text-left transition-colors hover:bg-gray-50",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("p",{className:"truncate text-sm font-medium text-gray-900",children:o.agentId}),S.jsx("p",{className:"truncate font-mono text-xs text-blue-500",children:o.taskId})]}),S.jsx(r$e,{status:o.status})]},o.taskId)}return S.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("p",{className:"truncate text-sm font-medium text-gray-900",children:o.agentId}),S.jsx("p",{className:"truncate font-mono text-xs text-gray-400",children:o.taskId})]}),S.jsx(r$e,{status:o.status})]},o.taskId)})})]})}function eAr({taskId:t,task:n,onClose:i,onRefresh:o,onSelectTask:a}){const{t:c}=Zn(),{slug:u}=Ff(),f=S0(),g=Lm(Mt=>Mt.addToast),[w,x]=F.useState(null),[v,C]=F.useState(!0),[E,A]=F.useState(null),[M,I]=F.useState("idle"),[D,P]=F.useState(aLe((n==null?void 0:n.status)??"pending")),R=F.useRef(null),z=F.useRef(0),U=(w==null?void 0:w.status)??(n==null?void 0:n.status)??"pending",W=(w==null?void 0:w.prompt)??(n==null?void 0:n.prompt)??"",G=(w==null?void 0:w.renderedPrompt)??null,Y=(w==null?void 0:w.result)??"",te=(w==null?void 0:w.startedAt)??(n==null?void 0:n.startedAt),Q=(w==null?void 0:w.completedAt)??(n==null?void 0:n.completedAt),se=(w==null?void 0:w.durationMs)??(n==null?void 0:n.durationMs),ce=(w==null?void 0:w.model)??(n==null?void 0:n.model)??null,V=(w==null?void 0:w.threadId)??(n==null?void 0:n.threadId)??null,ae=(w==null?void 0:w.inputTokens)??(n==null?void 0:n.inputTokens),de=(w==null?void 0:w.outputTokens)??(n==null?void 0:n.outputTokens),ee=(w==null?void 0:w.costUsd)??(n==null?void 0:n.costUsd),ue=(w==null?void 0:w.error)??null,he=(w==null?void 0:w.logs)??[],ge=(w==null?void 0:w.childTasks)??[],oe=(w==null?void 0:w.parentTaskId)??null,Ae=w==null?void 0:w.mode,Te=w==null?void 0:w.crewxVersion,ve=w==null?void 0:w.pid,Ve=(w==null?void 0:w.metadata)??null,at=typeof(Ve==null?void 0:Ve.provider)=="string"?Ve.provider:void 0,yt=Y6r(t,n,w),Nt=F.useMemo(()=>{const Mt=(w==null?void 0:w.toolUsage)??{};return Object.entries(Mt).map(([vn,er])=>({tool:vn,count:er})).sort((vn,er)=>er.count-vn.count)},[w==null?void 0:w.toolUsage]),pt=F.useMemo(()=>[uK(ce??void 0,c)||"-",V6r(ae,de),K6r(ee),Te?`v${Te.replace(/^v/i,"")}`:null].filter(Boolean).join(" · "),[ee,Te,ae,ce,de,c]),St=F.useCallback(async(Mt=!0)=>{if(R.current){await R.current;return}const vn=++z.current;Mt&&C(!0);const er=(async()=>{try{const Mn=await wn.getTaskStatus(t,{include:"logs,children",skipRequestLog:!0});if(vn!==z.current)return;x(Mn),A(null)}catch(Mn){if(vn!==z.current)return;A(Mn instanceof Error?Mn.message:"Failed to load task details")}finally{vn===z.current&&Mt&&C(!1),vn===z.current&&(R.current=null)}})();R.current=er,await er},[t]);F.useEffect(()=>{z.current+=1,R.current=null,x(null),C(!0),A(null),I("idle"),P(aLe((n==null?void 0:n.status)??"pending")),St(!0)},[St,n==null?void 0:n.status,t]),F.useEffect(()=>{!n&&w&&P(aLe(w.status))},[w,n]),F.useEffect(()=>{if(M!=="confirming")return;const Mt=window.setTimeout(()=>{I("idle")},3e3);return()=>window.clearTimeout(Mt)},[M]);const Bt=F.useMemo(()=>({"task.logged":Mt=>{Mt.taskId===t&&St(!1)},"task.updated":Mt=>{Mt.taskId===t&&St(!1)}}),[St,t]);kR(u,Bt),SHe(()=>St(!1),{interval:5e3,enabled:U==="running"});const bt=F.useCallback(async(Mt,vn)=>{var er;try{if(!((er=navigator.clipboard)!=null&&er.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(Mt),g({type:"success",message:c(vn)})}catch(Mn){console.error("[TaskDetailPanel] Failed to copy text.",Mn),g({type:"error",message:c("tasks.panel.copyFailed")})}},[g,c]),dn=F.useCallback(async()=>{if(M!=="stopping"){if(M==="idle"){I("confirming");return}I("stopping");try{await wn.stopTask(t),await Promise.all([Promise.resolve(o==null?void 0:o()),St(!1)]),I("idle")}catch(Mt){console.error("[TaskDetailPanel] Failed to stop task.",Mt),g({type:"error",message:c("tasks.panel.stopFailed")}),I("idle")}}},[g,St,o,M,c,t]);return S.jsx(S.Fragment,{children:S.jsxs("aside",{role:"dialog","aria-label":c("tasks.panel.title"),className:"flex h-full w-full min-w-0 flex-col border-l border-gray-200 bg-white shadow-lg",children:[S.jsx("div",{className:"sticky top-0 z-10 border-b border-gray-200 bg-white p-4",children:S.jsxs("div",{className:"flex items-start gap-3",children:[S.jsx(G6,{provider:at,size:18,className:"h-11 w-11"}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsxs("div",{className:"flex items-start justify-between gap-3",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("p",{className:"truncate text-lg font-semibold text-gray-900",children:yt}),S.jsx("p",{className:"truncate font-mono text-xs text-gray-400",children:t})]}),S.jsx("button",{type:"button",onClick:i,className:"rounded-md p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600","aria-label":c("tasks.panel.close"),children:S.jsx(Op,{size:16})})]}),S.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[S.jsx(r$e,{status:U}),S.jsx(X6r,{mode:Ae}),S.jsx("span",{className:"text-sm font-medium text-gray-600",children:J6r(se,U)}),U==="running"&&typeof ve=="number"&&S.jsx("span",{className:"text-xs text-gray-500",children:`PID ${ve}`}),U==="running"&&S.jsx("button",{type:"button",onClick:()=>void dn(),disabled:M==="stopping",className:"inline-flex min-w-[108px] items-center justify-center gap-1.5 rounded-md border border-red-200 bg-red-50 px-3 py-1.5 text-xs font-semibold text-red-700 transition-colors hover:bg-red-100 disabled:cursor-not-allowed disabled:opacity-70",children:M==="stopping"?S.jsxs(S.Fragment,{children:[S.jsx(Is,{size:12,className:"animate-spin"}),S.jsx("span",{children:c("tasks.panel.stopping")})]}):M==="confirming"?S.jsx("span",{children:c("tasks.panel.stopConfirm")}):S.jsxs(S.Fragment,{children:[S.jsx(qJ,{size:12}),S.jsx("span",{children:c("tasks.panel.stop")})]})})]}),S.jsx("p",{className:"mt-3 text-sm text-gray-600",children:pt}),S.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-gray-500",children:[S.jsx("span",{children:`${AUt(te)} → ${AUt(Q)}`}),V?S.jsxs("button",{type:"button",onClick:()=>f(`/threads/${V}`),className:"inline-flex items-center gap-1 font-medium text-blue-600 transition-colors hover:text-blue-700",children:[S.jsx(gWn,{size:13}),S.jsx("span",{children:c("tasks.panel.viewThread")})]}):S.jsx("span",{className:"text-gray-400",children:c("tasks.panel.noThread")})]}),oe&&a&&S.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs text-gray-500",children:[S.jsx(sJt,{size:14}),S.jsx("span",{children:c("tasks.panel.parentLabel")}),S.jsxs("button",{type:"button",onClick:()=>a(oe),className:"font-medium text-blue-500 transition-colors hover:underline",children:["#",oe]})]})]})]})}),S.jsxs("div",{className:"flex-1 space-y-3 overflow-y-auto p-4",children:[U==="failed"&&ue&&S.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:[S.jsx(wc,{size:16,className:"mt-0.5 shrink-0"}),S.jsx("span",{children:ue})]}),E&&S.jsxs("div",{className:"rounded-lg border border-red-200 bg-white p-4 shadow-sm",children:[S.jsxs("div",{className:"flex items-start gap-3 text-sm text-red-700",children:[S.jsx(wc,{size:16,className:"mt-0.5 shrink-0"}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsx("p",{className:"font-medium",children:c("tasks.panel.detailLoadError")}),S.jsx("p",{className:"mt-1 break-words text-xs text-red-600",children:E})]})]}),S.jsx("button",{type:"button",onClick:()=>void St(!0),className:"mt-3 rounded-md bg-red-100 px-3 py-1.5 text-xs font-medium text-red-700 transition-colors hover:bg-red-200",children:c("tasks.panel.retryDetail")})]}),W&&S.jsx(MUt,{title:c("tasks.panel.request"),content:W,open:D.prompt,onToggle:()=>P(Mt=>({...Mt,prompt:!Mt.prompt})),onCopy:()=>void bt(W,"tasks.panel.copyRequestSuccess")}),G&&S.jsx(Q6r,{title:c("tasks.panel.renderedPrompt"),content:G,open:D.renderedPrompt,onToggle:()=>P(Mt=>({...Mt,renderedPrompt:!Mt.renderedPrompt})),onCopy:()=>void bt(G,"tasks.panel.copyRenderedPromptSuccess")}),v&&!w&&S.jsxs("div",{className:"space-y-3 rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[S.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-gray-200"}),S.jsx("div",{className:"h-4 w-full animate-pulse rounded bg-gray-100"}),S.jsx("div",{className:"h-4 w-4/5 animate-pulse rounded bg-gray-100"})]}),Y&&S.jsx(MUt,{title:c("tasks.panel.result"),content:Y,open:D.result,onToggle:()=>P(Mt=>({...Mt,result:!Mt.result})),onCopy:()=>void bt(Y,"tasks.panel.copyResultSuccess"),clampLines:5}),!v&&U==="pending"&&!Y&&S.jsxs("section",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[S.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:c("tasks.panel.pendingTitle")}),S.jsx("p",{className:"mt-2 text-sm text-gray-500",children:c("tasks.panel.pendingDescription")})]}),Nt.length>0&&S.jsx(q6r,{stats:Nt,open:D.toolUsage,onToggle:()=>P(Mt=>({...Mt,toolUsage:!Mt.toolUsage}))}),(he.length>0||U==="running"||U==="failed")&&S.jsx(Dze,{logs:he,childTasks:ge,status:U}),ge.length>0&&S.jsx(Z6r,{childTasks:ge,onSelectTask:a}),Ve&&S.jsxs("section",{className:"rounded-lg border border-gray-200 bg-white shadow-sm",children:[S.jsx("div",{className:"flex items-start justify-between gap-3 border-b border-gray-200 px-4 py-3",children:S.jsxs("button",{type:"button",onClick:()=>P(Mt=>({...Mt,metadata:!Mt.metadata})),"aria-expanded":D.metadata,className:"flex min-w-0 flex-1 items-center gap-2 text-left",children:[D.metadata?S.jsx(vg,{size:16,className:"shrink-0 text-gray-400"}):S.jsx(vx,{size:16,className:"shrink-0 text-gray-400"}),S.jsx("span",{className:"truncate text-sm font-semibold text-gray-900",children:"Metadata"})]})}),D.metadata&&S.jsx("div",{className:"px-4 py-3",children:S.jsx("pre",{className:"max-h-60 overflow-auto rounded bg-muted p-3 text-xs",children:JSON.stringify(Ve,null,2)})})]})]})]})})}const tAr=["pending","running","success","failed"];function nAr(t,n){const i=(t??0)+(n??0);return i===0?"-":i>=1e6?`${(i/1e6).toFixed(1)}M`:i>=1e3?`${(i/1e3).toFixed(1)}k`:String(i)}function rAr(t,n){if(n==="running"||t==null)return"—";const i=t/1e3;if(i<60)return`${i.toFixed(1).replace(/\.0$/,"")}초`;if(i<3600){const c=Math.floor(i/60),u=Math.round(i%60);return u>0?`${c}분 ${u}초`:`${c}분`}const o=Math.floor(i/3600),a=Math.round(i%3600/60);return a>0?`${o}시간 ${a}분`:`${o}시간`}function iAr(t,n){const i=new Date(t),o=Date.now()-i.getTime(),a=Math.floor(o/6e4);if(a<1)return n("tasks.relative.justNow");if(a<60)return n("tasks.relative.minutesAgo",{count:a});const c=Math.floor(a/60);return c<24?n("tasks.relative.hoursAgo",{count:c}):new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(i)}function sAr({status:t}){const{t:n}=Zn(),i={success:"bg-green-100 text-green-800",failed:"bg-red-100 text-red-800",running:"bg-yellow-100 text-yellow-800",pending:"bg-gray-100 text-gray-800"};return S.jsx("span",{className:`inline-flex items-center rounded-full px-2.5 py-1 text-xs font-medium ${i[t]}`,children:n(`tasks.status.${t}`)})}function NUt({label:t,options:n,selectedValues:i,allLabel:o,getOptionLabel:a,onChange:c}){const u=i.length===0?o:i.length===1?a(i[0]):`${t} (${i.length})`;return S.jsxs("details",{className:"relative min-w-[160px]",children:[S.jsxs("summary",{className:"flex h-10 cursor-pointer list-none items-center justify-between gap-2 rounded-lg border border-gray-200 bg-white px-3 text-sm text-gray-700 shadow-sm transition-colors hover:border-gray-300",children:[S.jsx("span",{className:"truncate",children:u}),S.jsx(vg,{size:16,className:"shrink-0 text-gray-400"})]}),S.jsx("div",{className:"absolute right-0 z-20 mt-2 w-full min-w-[180px] rounded-lg border border-gray-200 bg-white p-2 shadow-lg",children:S.jsx("div",{className:"max-h-60 overflow-y-auto",children:n.map(f=>{const g=i.includes(f);return S.jsxs("label",{className:"flex cursor-pointer items-center justify-between gap-3 rounded-md px-2 py-2 text-sm text-gray-700 transition-colors hover:bg-gray-50",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded border-gray-300 text-blue-500 focus:ring-blue-500",checked:g,onChange:()=>{c(g?i.filter(w=>w!==f):[...i,f])}}),S.jsx("span",{children:a(f)})]}),g&&S.jsx(xg,{size:14,className:"text-blue-500"})]},f)})})})]})}function oAr(t){return t?"hidden":""}function aAr(t,n){return n?t.find(i=>i.taskId===n)??null:null}function lAr(){const{t}=Zn(),{setPageHeader:n}=Sd(),{slug:i}=Ff(),[o,a]=KJ(),{tasks:c,total:u,page:f,limit:g,loading:w,error:x,searchQuery:v,agentFilter:C,statusFilter:E,availableAgents:A,fetchTasks:M,setTasks:I,setPage:D,setSearchQuery:P,setAgentFilter:R,setStatusFilter:z,refresh:U}=qJt(),[W,G]=F.useState(v),Y=o.get("selected"),te=F.useMemo(()=>aAr(c,Y),[Y,c]),Q=oAr(Y),se=Y?5:7,ce=Math.max(1,Math.ceil(u/g)),V=F.useMemo(()=>{const oe=Math.max(1,f-2),Ae=Math.min(ce,oe+4),Te=Math.max(1,Ae-4);return Array.from({length:Ae-Te+1},(ve,Ve)=>Te+Ve)},[f,ce]),ae=F.useCallback(oe=>{a(Ae=>{const Te=new URLSearchParams(Ae);return oe?Te.set("selected",oe):Te.delete("selected"),Te})},[a]),de=F.useCallback(()=>U(),[U]),ee=F.useMemo(()=>c.map(oe=>`${oe.taskId}:${oe.status}`).join("|"),[c]),ue=F.useMemo(()=>({"task.updated":oe=>{I(Ae=>Ae.map(Te=>Te.taskId===oe.taskId?{...Te,status:oe.status}:Te))},"task.created":()=>{de()}}),[de,I]),{connected:he,lastEventAt:ge}=kR(i,ue);return Xan(de,{connected:he,lastEventAt:ge,fingerprint:()=>ee}),F.useEffect(()=>{n({title:t("tasks.title"),actions:S.jsx("button",{onClick:de,className:"rounded-lg p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700",title:t("common.refresh"),children:S.jsx(y0,{size:16,className:w?"animate-spin":""})})})},[de,w,n,t]),F.useEffect(()=>{const oe=window.setTimeout(()=>{W!==v&&P(W)},300);return()=>window.clearTimeout(oe)},[W,v,P]),F.useEffect(()=>{M()},[C,M,f,v,E]),F.useEffect(()=>{if(!Y)return;const oe=Ae=>{Ae.key==="Escape"&&ae(null)};return window.addEventListener("keydown",oe),()=>window.removeEventListener("keydown",oe)},[Y,ae]),S.jsxs("div",{className:"space-y-5",children:[S.jsx("section",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:S.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center",children:[S.jsxs("label",{className:"relative block w-full max-w-[280px]",children:[S.jsx(mC,{size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),S.jsx("input",{type:"search",value:W,onChange:oe=>G(oe.target.value),placeholder:t("tasks.filters.searchPlaceholder"),className:"h-10 w-full rounded-lg border border-gray-200 bg-white pl-9 pr-3 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-100"})]}),S.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row",children:[S.jsx(NUt,{label:t("tasks.filters.agent"),options:A,selectedValues:C,allLabel:t("tasks.filters.allAgents"),getOptionLabel:oe=>oe,onChange:R}),S.jsx(NUt,{label:t("tasks.filters.status"),options:tAr,selectedValues:E,allLabel:t("tasks.filters.allStatuses"),getOptionLabel:oe=>t(`tasks.status.${oe}`),onChange:z})]})]})}),x&&S.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:[S.jsx(wc,{size:16,className:"shrink-0"}),S.jsx("span",{className:"flex-1",children:x}),S.jsx("button",{onClick:de,className:"rounded-md bg-red-100 px-3 py-1 text-xs font-medium text-red-700 transition-colors hover:bg-red-200",children:t("tasks.retry")})]}),S.jsxs("div",{className:"relative flex min-h-0 flex-col gap-5",children:[S.jsxs("section",{className:"min-w-0 flex-1 overflow-hidden rounded-lg border border-gray-200 bg-white shadow-sm",children:[S.jsx("div",{className:"overflow-x-auto",children:S.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[S.jsx("thead",{className:"bg-gray-50",children:S.jsxs("tr",{children:[S.jsx("th",{className:"w-[160px] px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-gray-500",children:t("tasks.columns.time")}),S.jsx("th",{className:`${Q} w-[200px] px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-gray-500`,children:t("tasks.columns.taskId")}),S.jsx("th",{className:"w-[140px] px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-gray-500",children:t("tasks.columns.agent")}),S.jsx("th",{className:"w-[80px] px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-gray-500",children:t("tasks.columns.status")}),S.jsx("th",{className:"w-[80px] px-4 py-3 text-right text-xs font-semibold uppercase tracking-wide text-gray-500",children:t("tasks.columns.duration")}),S.jsx("th",{className:`${Q} w-[160px] px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-gray-500`,children:t("tasks.columns.model")}),S.jsx("th",{className:"w-[90px] px-4 py-3 text-right text-xs font-semibold uppercase tracking-wide text-gray-500",children:t("tasks.columns.tokens")})]})}),S.jsx("tbody",{className:"divide-y divide-gray-200 bg-white",children:w&&c.length===0?S.jsx("tr",{children:S.jsx("td",{colSpan:se,className:"px-4 py-12 text-center text-sm text-gray-500",children:S.jsxs("div",{className:"inline-flex items-center gap-2",children:[S.jsx(y0,{size:16,className:"animate-spin text-gray-400"}),S.jsx("span",{children:t("tasks.loading")})]})})}):c.length===0?S.jsx("tr",{children:S.jsx("td",{colSpan:se,className:"px-4 py-14",children:S.jsxs("div",{className:"flex flex-col items-center justify-center text-center text-gray-400",children:[S.jsx(Hge,{size:36,className:"mb-3"}),S.jsx("p",{className:"text-sm font-medium text-gray-500",children:t("tasks.empty")}),S.jsx("p",{className:"mt-1 text-xs text-gray-400",children:t("tasks.emptyHint")})]})})}):c.map(oe=>{const Ae=Y===oe.taskId;return S.jsxs("tr",{"aria-selected":Ae,onClick:()=>ae(oe.taskId),className:`cursor-pointer transition-colors hover:bg-gray-50 ${Ae?"bg-blue-50":""}`,children:[S.jsx("td",{className:`px-4 py-3 text-sm text-gray-500 ${Ae?"border-l-2 border-l-blue-500 bg-blue-50":""}`,children:iAr(oe.startedAt,t)}),S.jsx("td",{className:`${Q} px-4 py-3 text-sm font-medium text-gray-900`,children:S.jsx("span",{className:"font-mono",title:oe.taskId,children:oe.taskId})}),S.jsx("td",{className:"px-4 py-3 text-sm font-medium text-gray-900",children:S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx(G6,{provider:oe.provider??void 0,size:16}),S.jsx("span",{children:oe.agentId})]})}),S.jsx("td",{className:"px-4 py-3 text-sm text-gray-700",children:S.jsx(sAr,{status:oe.status})}),S.jsx("td",{className:"px-4 py-3 text-right text-sm text-gray-700",children:rAr(oe.durationMs,oe.status)}),S.jsx("td",{className:`${Q} px-4 py-3 text-sm text-gray-700`,children:oe.model??"-"}),S.jsx("td",{className:"px-4 py-3 text-right text-sm text-gray-500 tabular-nums",children:nAr(oe.inputTokens,oe.outputTokens)})]},oe.taskId)})})]})}),S.jsxs("div",{className:"flex flex-col gap-3 border-t border-gray-200 px-4 py-4 sm:flex-row sm:items-center sm:justify-between",children:[S.jsx("p",{className:"text-sm text-gray-500",children:t("tasks.totalCount",{count:u})}),S.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[S.jsx("button",{onClick:()=>D(Math.max(1,f-1)),disabled:f<=1,className:"rounded-lg border border-gray-200 px-3 py-1.5 text-sm text-gray-600 transition-colors hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",children:t("tasks.pagination.previous")}),V.map(oe=>S.jsx("button",{onClick:()=>D(oe),className:`rounded-lg px-3 py-1.5 text-sm transition-colors ${oe===f?"bg-blue-500 text-white":"border border-gray-200 text-gray-600 hover:bg-gray-50"}`,children:oe},oe)),S.jsx("button",{onClick:()=>D(Math.min(ce,f+1)),disabled:f>=ce,className:"rounded-lg border border-gray-200 px-3 py-1.5 text-sm text-gray-600 transition-colors hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",children:t("tasks.pagination.next")})]})]})]}),Y&&S.jsx("div",{className:"fixed inset-y-0 right-0 z-40",children:S.jsx(Gge,{defaultWidth:400,minWidth:300,maxWidth:600,side:"left",panelKey:"taskDetail",children:S.jsx(eAr,{taskId:Y,task:te,onClose:()=>ae(null),onRefresh:U,onSelectTask:ae})})})]})]})}const jUt={경영진:bUn,개발팀:iJt,default:O9};function cAr({teamName:t,memberCount:n,isCollapsible:i=!1,isExpanded:o=!0,onToggle:a,className:c}){const{t:u}=Zn(),f=jUt[t]??jUt.default,g=o?vg:vx,w=S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-gray-100 text-gray-600",children:S.jsx(f,{size:18})}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"text-sm font-semibold text-gray-900",children:t}),S.jsx("span",{className:"rounded-full bg-gray-100 px-2.5 py-1 text-xs font-medium text-gray-500",children:u("agent.team.memberCount",{count:n})})]})]}),i&&S.jsx(g,{size:16,className:"shrink-0 text-gray-400"})]});return i?S.jsx("button",{type:"button",onClick:a,"aria-expanded":o,"aria-label":u(o?"agent.team.collapse":"agent.team.expand",{team:t}),className:`flex w-full items-center justify-between gap-3 rounded-xl border border-gray-200 bg-white px-4 py-3 text-left transition-colors hover:border-gray-300 hover:bg-gray-50 ${c??""}`.trim(),children:w}):S.jsx("div",{role:"button","aria-expanded":!0,className:`flex w-full items-center justify-between gap-3 rounded-xl border border-gray-200 bg-white px-4 py-3 ${c??""}`.trim(),children:w})}const VG="__unassigned__";function uAr(t){var a,c;const n=new Map,i=[];for(const u of t){const f=((a=u.team)==null?void 0:a.trim())||VG;n.has(f)||(n.set(f,[]),i.push(f)),(c=n.get(f))==null||c.push(u)}const o=i.filter(u=>u!==VG);return n.has(VG)&&o.push(VG),o.map(u=>({teamKey:u,agents:n.get(u)??[],isUnassigned:u===VG}))}function dAr(t){const n=t.length<=5;return Object.fromEntries(t.map(i=>[i.teamKey,n]))}function fAr({agent:t,onClose:n,onConfirm:i,deleting:o,t:a}){return S.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:S.jsxs("div",{className:"mx-4 w-full max-w-sm rounded-xl bg-white shadow-xl",children:[S.jsxs("div",{className:"px-6 py-5",children:[S.jsx("h3",{className:"mb-2 text-base font-semibold text-gray-900",children:a("agent.deleteConfirmTitle")}),S.jsx("p",{className:"text-sm text-gray-600",children:a("agent.deleteConfirmMsg",{id:t.id,name:t.name})}),S.jsx("p",{className:"mt-2 text-xs text-red-500",children:a("agent.deleteWarning")})]}),S.jsxs("div",{className:"flex justify-end gap-2 px-6 pb-5",children:[S.jsx("button",{onClick:n,className:"rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200",children:a("agent.cancel")}),S.jsxs("button",{onClick:i,disabled:o,className:"flex items-center gap-2 rounded-lg bg-red-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-red-600 disabled:cursor-not-allowed disabled:opacity-40",children:[o?S.jsx(Is,{size:14,className:"animate-spin"}):S.jsx(kx,{size:14}),a("agent.delete")]})]})]})})}function hAr(){const{setPageHeader:t}=Sd(),n=S0(),{t:i}=Zn(),o=Zd(ae=>ae.currentWorkspaceId),a=Zc(ae=>ae.agents.expandedTeams),c=Zc(ae=>ae.set),u=km(ae=>ae.limits),f=km(ae=>ae.limitsLoading),g=km(ae=>ae.fetchLimits),[w,x]=F.useState([]),[v,C]=F.useState(!0),[E,A]=F.useState(null),[M,I]=F.useState(null),[D,P]=F.useState(!1),R=F.useMemo(()=>uAr(w),[w]),z=F.useMemo(()=>{if(v||E)return{};const ae=dAr(R);return R.reduce((de,ee)=>(de[ee.teamKey]=typeof a[ee.teamKey]=="boolean"?a[ee.teamKey]:ae[ee.teamKey],de),{})},[E,R,v,a]),U=u==null?void 0:u.agentsPerWorkspace,W=U!==void 0&&U!==-1&&w.length>=U,G=f||!u||W,Y=W&&u?i("limits.banner.agent.title",{current:w.length,limit:u.agentsPerWorkspace}):void 0,te=!v&&!E?i("agent.count",{count:w.length}):void 0,Q=F.useMemo(()=>S.jsxs("button",{type:"button",disabled:G,title:Y,onClick:()=>n("/agents/new"),className:`inline-flex items-center gap-1.5 rounded-xl px-3.5 py-2 text-sm font-semibold transition-colors ${G?"bg-gray-100 text-gray-400":"bg-blue-500 text-white hover:bg-blue-600"}`,children:[S.jsx(ef,{size:14}),i("agent.add")]}),[Y,G,i,n]),se=F.useCallback(async()=>{C(!0),A(null);try{const ae=await wn.getAgents();x(ae.agents)}catch(ae){A(ae instanceof Error?ae.message:i("agent.listError"))}finally{C(!1)}},[i]);F.useEffect(()=>{t({title:i("agent.management"),subtitle:te,actions:Q})},[Q,te,t,i]),F.useEffect(()=>{se()},[o]),F.useEffect(()=>{g().catch(()=>{})},[o,g]);const ce=F.useCallback(async()=>{if(M){P(!0);try{await wn.deleteAgent(M.id),I(null),await se()}catch(ae){alert(ae instanceof Error?ae.message:i("agent.deleteError"))}finally{P(!1)}}},[M,se,i]),V=F.useCallback(ae=>{c("agents",{expandedTeams:{[ae]:!z[ae]}})},[z,c]);return S.jsxs("div",{className:"mx-auto max-w-4xl",children:[!v&&!E&&W&&u?S.jsx("div",{className:"mb-6",children:S.jsx(Che,{resource:"agent",current:w.length,limit:u.agentsPerWorkspace})}):null,v&&S.jsx("div",{className:"flex items-center justify-center py-16",children:S.jsx(Is,{size:24,className:"animate-spin text-gray-400"})}),!v&&E&&S.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-red-200 bg-red-50 p-4 text-red-600",children:[S.jsx(wc,{size:18,className:"shrink-0"}),S.jsxs("div",{children:[S.jsx("p",{className:"text-sm font-medium",children:i("agent.loadFailTitle")}),S.jsx("p",{className:"mt-0.5 text-xs",children:E})]}),S.jsx("button",{onClick:se,className:"ml-auto text-xs text-red-500 underline hover:text-red-700",children:i("agent.retry")})]}),!v&&!E&&w.length===0&&S.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-gray-400",children:[S.jsx(O9,{size:40,className:"mb-3 opacity-30"}),S.jsx("p",{className:"text-sm font-medium",children:i("agent.emptyTitle")}),S.jsx("p",{className:"mt-1 text-xs",children:i("agent.emptyDesc")}),S.jsxs("button",{type:"button",disabled:G,title:Y,onClick:()=>n("/agents/new"),className:`mt-4 flex items-center gap-1.5 rounded-lg px-4 py-2 text-sm font-medium transition-colors ${G?"bg-gray-100 text-gray-400":"bg-blue-500 text-white hover:bg-blue-600"}`,children:[S.jsx(ef,{size:16}),i("agent.emptyAction")]})]}),!v&&!E&&w.length>0&&S.jsx("div",{className:"space-y-4",children:R.map(ae=>{const de=z[ae.teamKey]??R.length<=5;return S.jsx("section",{children:S.jsxs("div",{className:"overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm",children:[S.jsx(cAr,{teamName:ae.isUnassigned?i("agent.team.unassigned"):ae.teamKey,memberCount:ae.agents.length,isCollapsible:!0,isExpanded:de,onToggle:()=>V(ae.teamKey),className:"rounded-none border-0 border-b border-gray-100 bg-transparent px-5 py-4 shadow-none hover:border-gray-100 hover:bg-gray-50"}),S.jsx("div",{className:"grid transition-[grid-template-rows,opacity] duration-300 ease-out",style:{gridTemplateRows:de?"1fr":"0fr",opacity:de?1:.7},children:S.jsx("div",{className:"min-h-0 overflow-hidden",children:S.jsx("div",{className:"divide-y divide-gray-100",children:ae.agents.map(ee=>{var he,ge,oe;const ue=[ee.role,kfe(ee.provider,i),uK(ee.model,i)].filter(Boolean).join(" · ");return S.jsxs("div",{className:"group flex items-center gap-4 px-5 py-4 transition-colors hover:bg-gray-50",children:[S.jsxs("div",{className:"relative shrink-0",children:[S.jsx(G6,{provider:ee.provider,size:18,className:"h-10 w-10 rounded-full border border-gray-200 bg-white"}),((he=ee.provider)==null?void 0:he.startsWith("remote/"))&&S.jsx("div",{className:`absolute -bottom-1 -right-1 flex h-5 w-5 items-center justify-center rounded-full border border-white ${(ge=ee.providerLocation)!=null&&ge.startsWith("file://")?"bg-gray-600":"bg-gray-700"}`,children:(oe=ee.providerLocation)!=null&&oe.startsWith("file://")?S.jsx(XUn,{size:11,className:"text-gray-300"}):S.jsx(uUn,{size:11,className:"text-blue-300"})})]}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"truncate text-sm font-semibold text-gray-900",children:ee.name}),S.jsxs("span",{className:"truncate text-xs text-gray-400",children:["@",ee.id]})]}),ue&&S.jsx("p",{className:"mt-0.5 truncate text-xs text-gray-500",children:ue}),ee.description&&S.jsx("p",{className:"mt-0.5 truncate text-xs text-gray-400",children:ee.description})]}),S.jsxs("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[S.jsxs("button",{onClick:()=>n(`/agents/new?from=${encodeURIComponent(ee.id)}`),className:"flex items-center gap-1.5 rounded-lg bg-blue-50 px-3 py-1.5 text-xs font-medium text-blue-700 transition-colors hover:bg-blue-100",children:[S.jsx(x5,{size:13}),i("agent.duplicate")]}),S.jsxs("button",{onClick:()=>n(`/agents/${ee.id}/edit`),className:"flex items-center gap-1.5 rounded-lg bg-gray-100 px-3 py-1.5 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-200",children:[S.jsx(oqn,{size:13}),i("agent.edit")]}),S.jsxs("button",{onClick:()=>I(ee),className:"flex items-center gap-1.5 rounded-lg bg-red-50 px-3 py-1.5 text-xs font-medium text-red-600 transition-colors hover:bg-red-100",children:[S.jsx(kx,{size:13}),i("agent.delete")]})]})]},ee.id)})})})})]})},ae.teamKey)})}),M&&S.jsx(fAr,{agent:M,onClose:()=>I(null),onConfirm:ce,deleting:D,t:i})]})}const pAr="선택 가능한 항목이 없습니다",gAr="검색 결과가 없습니다";function CV({options:t,value:n,onChange:i,placeholder:o,disabled:a=!1,invalid:c=!1,clearable:u=!1,clearLabel:f,label:g,className:w,searchable:x=!1,searchPlaceholder:v,emptyOptionsLabel:C=pAr,noSearchResultsLabel:E=gAr}){const A=F.useRef(null),M=F.useRef(null),I=F.useRef([]),D=F.useId(),P=F.useId(),R=t.findIndex(Te=>Te.id===n),z=R>=0?t[R]:void 0,[U,W]=F.useState(!1),[G,Y]=F.useState(""),[te,Q]=F.useState(R>=0?R:0),se=G.trim().toLowerCase(),ce=F.useMemo(()=>se?t.filter(Te=>{var ve;return Te.label.toLowerCase().includes(se)?!0:((ve=Te.description)==null?void 0:ve.toLowerCase().includes(se))??!1}):t,[se,t]),V=ce.findIndex(Te=>Te.id===n),ae=u&&!a&&!!z;F.useEffect(()=>{if(!U){Y("");return}const Te=V>=0?V:0;Q(Te)},[V,U]),F.useEffect(()=>{if(!U)return;const Te=ve=>{var Ve;(Ve=A.current)!=null&&Ve.contains(ve.target)||W(!1)};return document.addEventListener("mousedown",Te),()=>document.removeEventListener("mousedown",Te)},[U]),F.useEffect(()=>{if(!U||ce.length===0)return;const Te=I.current[te];Te&&typeof Te.scrollIntoView=="function"&&Te.scrollIntoView({block:"nearest"})},[ce.length,te,U]),F.useEffect(()=>{var Te;!U||!x||(Te=M.current)==null||Te.focus()},[U,x]),F.useEffect(()=>{te<ce.length||Q(Math.max(ce.length-1,0))},[ce.length,te]);const de=(z==null?void 0:z.label)??o??C,ee=g??(z==null?void 0:z.label)??o??C,ue=U&&ce[te]?`${P}-option-${ce[te].id}`:void 0,he=()=>{a||(Q(V>=0?V:0),W(!0))},ge=Te=>{if(!(a||ce.length===0)){if(!U){W(!0),Q(V>=0?V:Te>0?0:ce.length-1);return}Q(ve=>(ve+Te+ce.length)%ce.length)}},oe=Te=>{const ve=ce[Te];ve&&(i(ve.id),W(!1))},Ae=Te=>{if(a)return;const ve=x&&Te.target===M.current;if(Te.key==="Escape"){U&&(Te.preventDefault(),W(!1));return}if(Te.key==="ArrowDown"){Te.preventDefault(),ge(1);return}if(Te.key==="ArrowUp"){Te.preventDefault(),ge(-1);return}if(!(Te.key===" "&&ve)&&!(Te.key!=="Enter"&&Te.key!==" ")){if(Te.preventDefault(),!U){he();return}if(ce.length===0){W(!1);return}oe(te)}};return S.jsxs("div",{ref:A,onKeyDown:Ae,className:["relative",w].filter(Boolean).join(" "),children:[S.jsxs("button",{id:D,type:"button",disabled:a,"aria-invalid":c||void 0,"aria-label":ee,"aria-controls":P,"aria-expanded":U,"aria-haspopup":"listbox","aria-activedescendant":ue,onClick:()=>{a||W(Te=>(Te||Q(V>=0?V:0),!Te))},className:["flex min-h-[42px] w-full items-center justify-between gap-2 rounded-lg border px-3 py-2.5 text-left text-sm shadow-sm outline-none transition",ae?"pr-16":"","bg-[var(--settings-control-bg)] text-[var(--settings-text)]",c?"border-red-400 focus:border-red-500 focus:ring-2 focus:ring-red-500/20":"border-[var(--settings-border)] focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20",a?"cursor-not-allowed opacity-60":c?"hover:border-red-500":"hover:border-blue-400"].join(" "),children:[S.jsx("span",{className:["min-w-0 flex-1 truncate",z?"text-[var(--settings-text)]":"text-[var(--settings-muted)]"].join(" "),children:de}),U?S.jsx(YHn,{size:16,className:"shrink-0 text-[var(--settings-muted)]","aria-hidden":"true"}):S.jsx(vg,{size:16,className:"shrink-0 text-[var(--settings-muted)]","aria-hidden":"true"})]}),ae?S.jsx("button",{type:"button","aria-label":f??g??o??C,onMouseDown:Te=>{Te.preventDefault(),Te.stopPropagation()},onClick:Te=>{Te.preventDefault(),Te.stopPropagation(),i(""),W(!1)},className:"absolute right-8 top-1/2 inline-flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full text-[var(--settings-muted)] transition hover:bg-gray-200 hover:text-[var(--settings-text)]",children:S.jsx(Op,{size:12,"aria-hidden":"true"})}):null,U?S.jsxs("div",{id:P,role:"listbox","aria-labelledby":D,className:"absolute left-0 top-[calc(100%+0.25rem)] z-20 max-h-64 w-full overflow-y-auto rounded-lg border border-[var(--settings-border)] bg-[var(--settings-card-bg)] shadow-lg",children:[x?S.jsxs("label",{className:"flex items-center gap-2 border-b border-[var(--settings-border)] px-3 py-2 text-[var(--settings-muted)]",children:[S.jsx(mC,{size:14,className:"shrink-0","aria-hidden":"true"}),S.jsx("input",{ref:M,value:G,onChange:Te=>{Y(Te.target.value),Q(0)},className:"w-full bg-transparent text-sm text-[var(--settings-text)] outline-none placeholder:text-[var(--settings-muted)]","aria-label":v??g??o??C,placeholder:v??o})]}):null,t.length===0?S.jsx("div",{className:"px-3 py-3 text-sm text-[var(--settings-muted)]",children:C}):ce.length===0?S.jsx("div",{className:"px-3 py-3 text-sm text-[var(--settings-muted)]",children:E}):ce.map((Te,ve)=>{const Ve=Te.id===n,at=ve===te;return S.jsxs("button",{ref:yt=>{I.current[ve]=yt},id:`${P}-option-${Te.id}`,type:"button",role:"option","aria-selected":Ve,onMouseEnter:()=>Q(ve),onClick:()=>oe(ve),className:["flex w-full items-start gap-3 border-b border-[var(--settings-border)] px-3 py-2.5 text-left transition last:border-b-0",at?"bg-blue-50":"bg-transparent"].join(" "),children:[S.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center pt-0.5",children:Ve?S.jsx(xg,{size:14,className:"text-blue-500","aria-hidden":"true"}):null}),S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsx("span",{className:"block text-[13px] font-medium leading-5 text-[var(--settings-text)]",children:Te.label}),Te.description?S.jsx("span",{className:"mt-0.5 block text-[12px] leading-4 text-[var(--settings-muted)]",children:Te.description}):null]})]},Te.id)})]}):null]})}const mAr=F.lazy(()=>Cl(()=>import("./PromptTab-DY8LtmCY.js"),__vite__mapDeps([]))),bAr=new Set(["auto"]),DUt=["cli/antigravity"];function wAr(t){return t.trim()?t:""}function Zan(t){return{include:[...t]}}function IUt(t){if(!t)return;const n=Object.entries(t).filter(([,i])=>typeof i=="string"?i.trim().length>0:i!==void 0);return n.length>0?Object.fromEntries(n):void 0}function yAr(t){if(!t)return;const n={};for(const[a,c]of Object.entries(t))a==="query"||a==="execute"||(n[a]=c);const i=IUt(t.query);i&&(n.query=i);const o=IUt(t.execute);return o&&(n.execute=o),Object.keys(n).length>0?n:void 0}function xAr(t,n){return{id:t.id.trim(),name:t.name.trim(),role:t.role.trim(),team:t.team.trim(),description:t.description.trim(),provider:M6(t.provider)||void 0,model:t.model||void 0,prompt:wAr(t.prompt),skills:Zan(n),options:yAr(t.options)}}function OUt(t){return typeof t=="object"&&t!==null}function vAr(t){if(!(t instanceof bd))return"UNKNOWN";if(OUt(t.body)){if(typeof t.body.code=="string")return t.body.code;if(OUt(t.body.error)&&typeof t.body.error.code=="string")return t.body.error.code}return"UNKNOWN"}function kAr(t,n,i){const o=i("agent.validation.required"),a={};return t.id.trim()||(a.id=o),t.name.trim()||(a.name=o),M6(t.provider)||(a.provider=o),n&&!t.model.trim()&&(a.model=o),a}function LUt(){var ht;const t=S0(),{agentId:n}=Ff(),[i]=KJ(),{setPageHeader:o}=Sd(),{t:a}=Zn(),c=Zd(ft=>ft.currentWorkspaceId),u=Lm(ft=>ft.addToast),f=((ht=i.get("from"))==null?void 0:ht.trim())||null,g=!!n,w=!g&&!!f,x=!g&&!w,v=n??f,{form:C,skills:E,activeTab:A,selectedTemplateId:M,goalsEnabled:I,goalsMode:D,goalsFiles:P,dailyEnabled:R,setActiveTab:z,setField:U,setProvider:W,setOption:G,setSkillsInclude:Y,setGoalsEnabled:te,setGoalsMode:Q,setGoalsFiles:se,setDailyEnabled:ce,initializeBlank:V,initializeFromAgent:ae,applyTemplate:de,reset:ee}=z6r(),[ue,he]=F.useState(!!v),[ge,oe]=F.useState(!1),[Ae,Te]=F.useState(null),[ve,Ve]=F.useState(null),[at,yt]=F.useState([]),[Nt,pt]=F.useState(!0),[St,Bt]=F.useState(null),[bt,dn]=F.useState(!1),[Mt,vn]=F.useState(0),[er,Mn]=F.useState([]),[yi,hr]=F.useState(!0),[io,oi]=F.useState(null),[on,ei]=F.useState(0),[Ar,bi]=F.useState({}),[ds,ct]=F.useState([]),[jt,Sn]=F.useState(!1),[yr,Lr]=F.useState(!1),gn=C.provider.startsWith("remote/"),ti=g&&gn,Zt=F.useMemo(()=>{if(g&&n)return`@${n}`;if(w&&f)return`@${f}`},[n,w,g,f]),qr=F.useMemo(()=>{if(!(ue||Ae))return S.jsxs("button",{type:"submit",form:"agent-form",disabled:ge,className:"inline-flex items-center gap-2 rounded-lg bg-blue-500 px-5 py-2.5 text-sm font-medium text-white transition hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-40",children:[ge?S.jsx(Is,{size:15,className:"animate-spin"}):S.jsx(jFe,{size:15}),a(g?"agent.save":"agent.add")]})},[Ae,g,ue,ge,a]),_r=F.useMemo(()=>at.find(ft=>ft.id===M6(C.provider))??null,[C.provider,at]),ks=M6(C.provider),$a=!!ks&&!DUt.includes(ks),Oo=fde(C.options,"query","mode"),Zh=fde(C.options,"execute","mode"),Fl=fde(C.options,"query","effort"),ui=fde(C.options,"execute","effort"),Et=F.useMemo(()=>{const ft=at.map(Ir=>({id:Ir.id,label:Ir.name}));for(const Ir of DUt)ft.some(bo=>bo.id===Ir)||ft.push({id:Ir,label:kfe(Ir,a)});if(!C.provider)return ft;const yn=M6(C.provider);return ft.some(Ir=>Ir.id===yn)?ft:[{id:yn,label:kfe(yn,a)},...ft]},[C.provider,at,a]),Cn=F.useMemo(()=>{const ft=((_r==null?void 0:_r.models)??[]).map(yn=>({id:yn.id,label:yn.name??uK(yn.id,a),description:yn.description}));return!C.model||ft.some(yn=>yn.id===C.model)?ft:[{id:C.model,label:uK(C.model,a)||C.model},...ft]},[C.model,_r,a]),ai=F.useMemo(()=>{const ft=((_r==null?void 0:_r.modes)??[]).map(yn=>({id:yn.id,label:yn.name??yn.id,description:yn.description}));for(const yn of[Oo,Zh])!yn||ft.some(Ir=>Ir.id===yn)||ft.push({id:yn,label:yn,description:void 0});return ft},[Zh,Oo,_r]),di=F.useMemo(()=>{const ft=((_r==null?void 0:_r.effort)??[]).map(yn=>({id:yn,label:yn}));for(const yn of[Fl,ui])!yn||ft.some(Ir=>Ir.id===yn)||ft.push({id:yn,label:yn});return ft},[ui,Fl,_r]),ni=bAr.has(C.model),Xr=(((_r==null?void 0:_r.effort)??[]).length>0||!!(Fl||ui))&&!ni,vu=!ti&&Nt,Ed=!ti&&!!St,Xs=!ti&&$a,El=Xs&&(Nt||!!St),Lc=F.useMemo(()=>er.filter(ft=>ft.source!=="builtin"),[er]);F.useEffect(()=>{o({title:a(g?"agent.edit":"agent.add"),subtitle:Zt,actions:qr})},[qr,g,Zt,o,a]),F.useEffect(()=>()=>ee(),[ee]),F.useEffect(()=>{ni&&(Fl&&G("query","effort",""),ui&&G("execute","effort",""))},[ui,ni,Fl,G]);const mh=F.useCallback(ft=>{ae(ft,{clearIdentity:w,skills:ft.skills})},[ae,w]);F.useEffect(()=>{let ft=!1;return(async()=>{if(Te(null),!v){V(),he(!1);return}he(!0);try{const Ir=await wn.getAgents();if(ft)return;const bo=Ir.agents.find(Za=>Za.id===v);if(!bo){Te(a("agent.notFound"));return}mh(bo)}catch(Ir){if(ft)return;Te(Ir instanceof Error?Ir.message:a(w?"agent.duplicateError":"agent.loadError"))}finally{ft||he(!1)}})(),()=>{ft=!0}},[c,mh,V,w,v]),F.useEffect(()=>{let ft=!1;return(async()=>{pt(!0),Bt(null);try{const Ir=await wn.getProviders();if(ft)return;yt(Ir)}catch(Ir){if(ft)return;Bt(Ir instanceof Error?Ir.message:a("agent.loadError"))}finally{ft||pt(!1)}})(),()=>{ft=!0}},[c,Mt]),F.useEffect(()=>{if(!Nt){dn(!1);return}dn(!1);const ft=window.setTimeout(()=>{dn(!0)},5e3);return()=>{window.clearTimeout(ft)}},[Nt,Mt]),F.useEffect(()=>{let ft=!1;return(async()=>{hr(!0),oi(null);try{const Ir=await wn.getInstalledMarkets();if(ft)return;Mn(Ir.items)}catch(Ir){if(ft)return;oi(Ir instanceof Error?Ir.message:a("agent.skills.loadError"))}finally{ft||hr(!1)}})(),()=>{ft=!0}},[on]),F.useEffect(()=>{let ft=!1;return(async()=>{Sn(!0);try{const Ir=await wn.getGoals({status:"active"});ft||ct(Ir.goals)}catch{}finally{ft||Sn(!1)}})(),()=>{ft=!0}},[c]);const nu=F.useCallback(ft=>{const yn=E.include.includes(ft)?E.include.filter(Ir=>Ir!==ft):[...E.include,ft];Y(yn)},[Y,E.include]),Vu=F.useCallback(ft=>{bi(yn=>{let Ir=!1;const bo={...yn};for(const Za of ft)Za in bo&&(delete bo[Za],Ir=!0);return Ir?bo:yn})},[]),_d=ft=>yn=>{U(ft,yn.target.value),(ft==="id"||ft==="name")&&Vu([ft])},Sg=ft=>{de(ft),bi({})},A0=F.useCallback(ft=>{W(ft),Vu(["provider","model"])},[Vu,W]),NC=F.useCallback(()=>{vn(ft=>ft+1)},[]),Lp=F.useCallback((ft,yn)=>Ir=>{G(ft,yn,Ir)},[G]),nk=async ft=>{ft.preventDefault(),Ve(null);const yn=kAr(C,$a,a);if(Object.keys(yn).length>0){bi(yn),z("basic");return}bi({}),oe(!0);try{const Ir={...C.options};I&&(Ir.goals=D==="all"?!0:P.length===1?P[0]:[...P]),R&&(Ir.daily=!0);const bo=xAr({...C,options:Ir},E.include);if(g&&n){const Za={name:bo.name,role:bo.role,team:bo.team,description:bo.description,provider:bo.provider,model:bo.model,prompt:bo.prompt,skills:Zan(E.include),options:bo.options};await wn.updateAgent(n,Za)}else await wn.createAgent(bo);t("/agents")}catch(Ir){const bo=vAr(Ir);if(!g&&bo==="AGENT_LIMIT_EXCEEDED"){Ve(bo),u({type:"error",duration:1e4,message:S.jsxs("div",{className:"space-y-2",children:[S.jsx("div",{children:a("agent.createError.AGENT_LIMIT_EXCEEDED")}),S.jsx("a",{href:khe,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-sm font-medium text-red-700 underline underline-offset-2 transition-colors hover:text-red-800",children:a("upgrade.waitlistCta")})]})});return}alert(Ir instanceof Error?Ir.message:a("agent.saveError"))}finally{oe(!1)}},Eg="w-full rounded-lg border border-gray-300 bg-white px-3 py-2.5 text-sm text-gray-900 placeholder-gray-400 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20",Fw="bg-gray-100 text-gray-500 cursor-not-allowed",Bw="border-red-400 focus:border-red-500 focus:ring-red-500/20",_g="mb-1.5 block text-sm font-medium text-gray-700",Mi="rounded-xl border border-gray-200 bg-white p-6 shadow-sm";return ue?S.jsx("div",{className:"flex items-center justify-center py-24",children:S.jsx(Is,{size:28,className:"animate-spin text-gray-400"})}):Ae?S.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-8",children:[S.jsx("p",{className:"text-sm text-red-500",children:Ae}),S.jsx("button",{onClick:()=>t("/agents"),className:"mt-4 text-sm text-gray-500 underline transition hover:text-gray-900",children:a("agent.backToList")})]}):S.jsxs("div",{className:`mx-auto px-4 py-6 text-gray-900 ${A==="prompt"?"max-w-6xl":"max-w-3xl"}`,children:[x&&S.jsxs("section",{className:`${Mi} mb-5`,children:[S.jsxs("div",{className:"mb-4",children:[S.jsx("h2",{className:"text-sm font-semibold text-gray-900",children:a("agent.template.title")}),S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:a("agent.template.subtitle")})]}),S.jsxs("div",{className:"flex flex-wrap gap-2.5",children:[Qan.map(ft=>{const yn=M===ft.id;return S.jsxs("button",{type:"button",onClick:()=>Sg(ft.id),className:`inline-flex items-center gap-2 rounded-full border px-3.5 py-2 text-sm font-medium transition ${yn?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-200 bg-white text-gray-700 hover:border-gray-300 hover:bg-gray-50"}`,children:[S.jsx("span",{"aria-hidden":"true",children:ft.icon}),S.jsx("span",{children:a(ft.titleKey)})]},ft.id)}),S.jsx("button",{type:"button",onClick:()=>Sg(null),className:`inline-flex items-center gap-2 rounded-full border px-3.5 py-2 text-sm font-medium transition ${M===null?"border-blue-500 bg-blue-50 text-blue-700":"border-dashed border-gray-300 bg-white text-gray-600 hover:border-gray-400 hover:bg-gray-50"}`,children:S.jsx("span",{children:a("agent.template.direct")})})]})]}),ve==="AGENT_LIMIT_EXCEEDED"?S.jsxs("div",{className:"mb-5 rounded-xl border border-red-200 bg-red-50 px-4 py-4 text-sm text-red-700",children:[S.jsx("p",{children:a("agent.createError.AGENT_LIMIT_EXCEEDED")}),S.jsx("a",{href:khe,target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-flex items-center gap-1 text-sm font-medium text-red-700 transition-colors hover:text-red-800 hover:underline",children:a("upgrade.waitlistCta")})]}):null,S.jsx("form",{id:"agent-form",onSubmit:nk,noValidate:!0,className:"space-y-5",children:S.jsxs("div",{className:"overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm",children:[S.jsxs("div",{className:"flex border-b border-gray-200",children:[S.jsx("button",{type:"button",onClick:()=>z("basic"),className:`px-5 py-3 text-sm font-medium transition ${A==="basic"?"border-b-2 border-blue-500 text-blue-600":"text-gray-500 hover:text-gray-900"}`,children:a("agent.tab.basic")}),S.jsx("button",{type:"button",onClick:()=>z("skills"),className:`px-5 py-3 text-sm font-medium transition ${A==="skills"?"border-b-2 border-blue-500 text-blue-600":"text-gray-500 hover:text-gray-900"}`,children:a("agent.tab.skills")}),S.jsx("button",{type:"button",onClick:()=>z("prompt"),className:`px-5 py-3 text-sm font-medium transition ${A==="prompt"?"border-b-2 border-blue-500 text-blue-600":"text-gray-500 hover:text-gray-900"}`,children:a("agent.tab.prompt")})]}),S.jsx("div",{className:"p-6",children:A==="basic"?S.jsxs("div",{className:"space-y-5",children:[S.jsxs("div",{children:[S.jsx("h2",{className:"text-base font-semibold text-gray-900",children:a("agent.section.basicTitle")}),S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:a("agent.section.basicDescription")})]}),S.jsxs("div",{children:[S.jsxs("label",{className:_g,children:[a("agent.field.id")," ",S.jsx("span",{className:"text-red-500",children:"*"})]}),S.jsx("input",{type:"text",value:C.id,onChange:_d("id"),placeholder:a("agent.field.idPlaceholder"),"aria-invalid":Ar.id?"true":void 0,disabled:g,className:`${Eg} ${Ar.id?Bw:""} ${g?Fw:""}`}),!g&&S.jsx("p",{className:"mt-1.5 text-xs text-gray-500",children:a("agent.field.idHint")}),Ar.id?S.jsx("p",{className:"mt-1.5 text-xs text-red-500",role:"alert",children:Ar.id}):null]}),S.jsxs("div",{children:[S.jsxs("label",{className:_g,children:[a("agent.field.name")," ",S.jsx("span",{className:"text-red-500",children:"*"})]}),S.jsx("input",{type:"text",value:C.name,onChange:_d("name"),placeholder:a("agent.field.namePlaceholder"),"aria-invalid":Ar.name?"true":void 0,className:`${Eg} ${Ar.name?Bw:""}`}),Ar.name?S.jsx("p",{className:"mt-1.5 text-xs text-red-500",role:"alert",children:Ar.name}):null]}),S.jsxs("div",{children:[S.jsx("label",{className:_g,children:a("agent.field.role")}),S.jsx("input",{type:"text",value:C.role,onChange:_d("role"),placeholder:a("agent.field.rolePlaceholder"),className:Eg})]}),S.jsxs("div",{children:[S.jsx("label",{className:_g,children:a("agent.field.team")}),S.jsx("input",{type:"text",value:C.team,onChange:_d("team"),placeholder:a("agent.field.teamPlaceholder"),className:Eg})]}),S.jsxs("div",{children:[S.jsxs("label",{className:_g,children:[a("agent.field.provider")," ",S.jsx("span",{className:"text-red-500",children:"*"})]}),ti?S.jsx("input",{type:"text",value:kfe(C.provider,a),disabled:!0,"aria-invalid":Ar.provider?"true":void 0,className:`${Eg} ${Ar.provider?Bw:""} ${Fw}`}):vu?S.jsxs("div",{className:"flex min-h-[42px] w-full items-center gap-2 rounded-lg border border-gray-300 bg-gray-50 px-3 py-2.5 text-sm text-gray-500 shadow-sm",role:"status","aria-live":"polite",children:[S.jsx(Is,{size:16,className:"shrink-0 animate-spin text-blue-500","aria-hidden":"true"}),S.jsx("span",{children:a(bt?"agent.providerState.loadingSlow":"agent.providerState.loading")})]}):Ed?S.jsxs("div",{className:"w-full rounded-lg border border-red-200 bg-white px-3 py-2.5 shadow-sm",role:"alert",children:[S.jsxs("div",{className:"flex items-start gap-2 text-xs text-red-700",children:[S.jsx(wc,{size:16,className:"mt-0.5 shrink-0","aria-hidden":"true"}),S.jsx("span",{children:a("agent.providerState.error")})]}),S.jsxs("button",{type:"button",onClick:NC,className:"mt-2 inline-flex items-center gap-1.5 rounded-lg border border-gray-300 bg-white px-3 py-1.5 text-xs font-medium text-gray-700 transition hover:border-blue-500 hover:bg-blue-50 hover:text-blue-600",children:[S.jsx(qWn,{size:14,"aria-hidden":"true"}),a("agent.providerState.retry")]})]}):S.jsx(CV,{options:Et,value:ks,onChange:A0,placeholder:a("agent.field.selectProvider"),disabled:Nt||!!St,invalid:!!Ar.provider,label:a("agent.field.provider")}),Ar.provider?S.jsx("p",{className:"mt-1.5 text-xs text-red-500",role:"alert",children:Ar.provider}):null]}),ti&&_r||Xs?S.jsxs("div",{"data-testid":"provider-dependent-fields",className:`space-y-5 transition-opacity ${El?"opacity-40":"opacity-100"}`,children:[S.jsxs("div",{children:[S.jsxs("label",{className:_g,children:[a("agent.field.model")," ",S.jsx("span",{className:"text-red-500",children:"*"})]}),ti?S.jsx("input",{type:"text",value:uK(C.model,a)||C.model,disabled:!0,"aria-invalid":Ar.model?"true":void 0,className:`${Eg} ${Ar.model?Bw:""} ${Fw}`}):S.jsx(CV,{options:Cn,value:C.model,onChange:ft=>{U("model",ft),Vu(["model"])},placeholder:C.provider?a("agent.field.selectModel"):a("agent.field.selectProviderFirst"),disabled:!C.provider||Nt||!!St,invalid:!!Ar.model,label:a("agent.field.model"),searchable:!0,searchPlaceholder:a("agent.field.searchModel"),emptyOptionsLabel:a("agent.field.noOptions"),noSearchResultsLabel:a("agent.field.noSearchResults")}),Ar.model?S.jsx("p",{className:"mt-1.5 text-xs text-red-500",role:"alert",children:Ar.model}):null]}),ti?null:S.jsxs("div",{className:"space-y-3",children:[S.jsx("div",{children:S.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:a("agent.modeSettings")})}),S.jsx("div",{className:"grid grid-cols-2 gap-3",children:[{slot:"query",title:a("agent.queryMode"),modeValue:Oo,effortValue:Fl},{slot:"execute",title:a("agent.executeMode"),modeValue:Zh,effortValue:ui}].map(ft=>S.jsxs("div",{className:"space-y-3 rounded-lg border border-gray-200 bg-gray-50 p-4",children:[S.jsx("h4",{className:"text-sm font-semibold text-gray-900",children:ft.title}),S.jsxs("div",{children:[S.jsx("label",{className:_g,children:a("agent.mode")}),S.jsx(CV,{options:ai,value:ft.modeValue,onChange:Lp(ft.slot,"mode"),placeholder:C.provider?a("agent.field.selectMode"):a("agent.field.selectProviderFirst"),disabled:!C.provider||Nt||!!St,clearable:!0,clearLabel:a("agent.field.clearSelection"),label:`${ft.title} ${a("agent.mode")}`})]}),Xr?S.jsxs("div",{children:[S.jsx("label",{className:_g,children:a("agent.effort")}),S.jsx(CV,{options:di,value:ft.effortValue,onChange:Lp(ft.slot,"effort"),placeholder:C.provider?a("agent.field.selectEffort"):a("agent.field.selectProviderFirst"),disabled:!C.provider||Nt||!!St,clearable:!0,clearLabel:a("agent.field.clearSelection"),label:`${ft.title} ${a("agent.effort")}`})]}):null]},ft.slot))})]})]}):null,S.jsxs("div",{children:[S.jsx("label",{className:_g,children:a("agent.field.description")}),S.jsx("textarea",{value:C.description,onChange:_d("description"),placeholder:a("agent.field.descPlaceholder"),rows:5,className:`${Eg} resize-none`})]}),S.jsx("hr",{className:"border-t border-gray-200"}),S.jsxs("div",{className:"rounded-xl border border-gray-200 bg-gray-50/80 p-5",children:[S.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[S.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:a("agent.context.title")}),S.jsx("span",{className:"rounded-md bg-amber-100 px-2 py-0.5 text-[10px] font-semibold tracking-wide text-amber-700",children:a("agent.context.experimental")})]}),S.jsx("p",{className:"mb-4 text-xs text-gray-400",children:a("agent.context.description")}),S.jsxs("div",{className:"mb-4",children:[S.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[S.jsx("input",{type:"checkbox",checked:I,onChange:ft=>te(ft.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-500 focus:ring-blue-500"}),S.jsxs("span",{className:"text-sm font-semibold text-gray-700",children:[a("agent.context.goalsLabel"),S.jsxs("span",{className:"ml-1 text-xs font-normal text-gray-400",children:["— ",a("agent.context.goalsHint")]})]})]}),I?S.jsxs("div",{className:"ml-6 mt-2.5 rounded-lg border border-gray-200 bg-white p-3.5",children:[S.jsxs("div",{className:"flex flex-col gap-2.5",children:[S.jsxs("label",{className:"flex cursor-pointer items-start gap-2",children:[S.jsx("input",{type:"radio",name:"goalMode",checked:D==="all",onChange:()=>Q("all"),className:"mt-0.5 h-4 w-4 border-gray-300 text-blue-500 focus:ring-blue-500"}),S.jsxs("div",{children:[S.jsx("span",{className:"text-sm font-medium text-gray-700",children:a("agent.context.goalsAll")}),S.jsx("p",{className:"text-[11px] text-gray-400",children:a("agent.context.goalsAllDesc")})]})]}),S.jsxs("label",{className:"flex cursor-pointer items-start gap-2",children:[S.jsx("input",{type:"radio",name:"goalMode",checked:D==="specific",onChange:()=>Q("specific"),className:"mt-0.5 h-4 w-4 border-gray-300 text-blue-500 focus:ring-blue-500"}),S.jsxs("div",{children:[S.jsx("span",{className:"text-sm font-medium text-gray-700",children:a("agent.context.goalsSpecific")}),S.jsx("p",{className:"text-[11px] text-gray-400",children:a("agent.context.goalsSpecificDesc")})]})]})]}),S.jsxs("div",{className:`mt-2.5 flex min-h-[36px] flex-wrap items-center gap-1.5 rounded-lg border border-gray-300 bg-white px-2.5 py-1.5 ${D!=="specific"?"pointer-events-none opacity-35":""}`,children:[P.map(ft=>{const yn=ds.find(Ir=>`${Ir.goalId}.md`===ft);return S.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-blue-200 bg-blue-50 px-2 py-0.5 text-xs font-medium text-blue-700",children:[(yn==null?void 0:yn.title)??ft,S.jsx("button",{type:"button",onClick:()=>se(P.filter(Ir=>Ir!==ft)),className:"ml-0.5 rounded text-blue-300 transition hover:bg-red-50 hover:text-red-500",children:"×"})]},ft)}),S.jsxs("div",{className:"relative",children:[S.jsxs("button",{type:"button",onClick:()=>Lr(!yr),disabled:jt,className:"inline-flex items-center gap-1 rounded-md border border-dashed border-gray-300 bg-transparent px-2.5 py-0.5 text-xs font-medium text-gray-500 transition hover:border-blue-500 hover:bg-blue-50 hover:text-blue-500",children:[S.jsx(ef,{size:12}),a("agent.context.goalsAdd")]}),yr?S.jsxs("div",{className:"absolute left-0 top-full z-10 mt-1 max-h-48 w-64 overflow-y-auto rounded-lg border border-gray-200 bg-white py-1 shadow-lg",children:[ds.filter(ft=>!P.includes(`${ft.goalId}.md`)).map(ft=>S.jsx("button",{type:"button",onClick:()=>{se([...P,`${ft.goalId}.md`]),Lr(!1)},className:"flex w-full items-center px-3 py-2 text-left text-sm text-gray-700 transition hover:bg-gray-50",children:S.jsx("span",{className:"truncate",children:ft.title})},ft.goalId)),ds.filter(ft=>!P.includes(`${ft.goalId}.md`)).length===0?S.jsx("p",{className:"px-3 py-2 text-xs text-gray-400",children:a("agent.context.goalsPickerEmpty")}):null]}):null]})]})]}):null]}),S.jsxs("div",{children:[S.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[S.jsx("input",{type:"checkbox",checked:R,onChange:ft=>ce(ft.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-500 focus:ring-blue-500"}),S.jsx("span",{className:"text-sm font-semibold text-gray-700",children:a("agent.context.dailyLabel")})]}),R?S.jsxs("p",{className:"ml-6 mt-1 text-xs text-gray-400",children:["— ",a("agent.context.dailyHint")]}):null]})]})]}):A==="skills"?S.jsxs("div",{className:"space-y-4",children:[S.jsxs("div",{children:[S.jsx("h2",{className:"text-base font-semibold text-gray-900",children:a("agent.section.skillsTitle")}),S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:a("agent.section.skillsDescription")})]}),yi?S.jsx("div",{className:"flex items-center justify-center py-20",children:S.jsx(Is,{size:24,className:"animate-spin text-gray-400"})}):io?S.jsxs("div",{className:"rounded-xl border border-red-200 bg-red-50 px-4 py-4 text-sm text-red-700",children:[S.jsx("p",{children:io}),S.jsx("button",{type:"button",onClick:()=>ei(ft=>ft+1),className:"mt-3 font-medium underline underline-offset-2 transition hover:text-red-800",children:a("agent.retry")})]}):Lc.length===0?S.jsx("div",{className:"rounded-xl border border-gray-200 bg-white px-6 py-16",children:S.jsxs("div",{className:"mx-auto flex max-w-xl flex-col items-center text-center",children:[S.jsx("div",{className:"mb-5 rounded-full bg-gray-100 p-4 text-gray-500",children:S.jsx(cJt,{size:40,strokeWidth:1.8})}),S.jsx("h3",{className:"text-3xl font-semibold tracking-tight text-gray-900",children:a("agent.skills.emptyTitle")}),S.jsx("p",{className:"mt-4 text-lg leading-8 text-gray-500",children:a("agent.skills.emptyDescription")}),S.jsxs("button",{type:"button",onClick:()=>t("/market"),className:"mt-8 inline-flex items-center gap-2 rounded-2xl border border-gray-200 bg-white px-6 py-3 text-base font-semibold text-gray-900 shadow-sm transition hover:bg-gray-50",children:[S.jsx(MFe,{size:18}),a("agent.skills.openMarket")]})]})}):S.jsx("div",{className:"overflow-hidden rounded-xl border border-gray-200 bg-white",children:S.jsx("div",{className:"max-h-[420px] overflow-y-auto",children:Lc.map((ft,yn)=>{const Ir=E.include.includes(ft.name);return S.jsxs("label",{className:`flex cursor-pointer items-start gap-4 px-4 py-4 transition hover:bg-gray-50 ${yn>0?"border-t border-gray-200":""}`,children:[S.jsx("input",{type:"checkbox",checked:Ir,onChange:()=>nu(ft.name),"aria-label":ft.name,className:"mt-0.5 h-5 w-5 shrink-0 rounded border-gray-300 text-gray-900 focus:ring-gray-900"}),S.jsxs("div",{className:"min-w-0",children:[S.jsx("div",{className:"text-base font-semibold text-gray-900",children:ft.name}),ft.description?S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:ft.description}):null]})]},ft.name)})})})]}):S.jsx(F.Suspense,{fallback:S.jsx("div",{className:"flex items-center justify-center py-24",children:S.jsx(Is,{size:28,className:"animate-spin text-gray-400"})}),children:S.jsx(mAr,{previewAgentId:v})})})]})})]})}function eln({node:t,depth:n=0,expandedFolders:i,onToggle:o,onSelect:a,selectedPath:c,isFileDisabled:u,renderFileSuffix:f}){var M;const g=i.has(t.path),w=c===t.path,x=t.type==="dir",v=!x&&HFe(t.name),C=x&&(t.hasCrewxYaml!==void 0||t.isRegistered!==void 0),E=(!x||C)&&((u==null?void 0:u(t))??!1),A=()=>{if(x){E||o(t.path);return}E||a(t.path)};return S.jsxs("div",{children:[S.jsxs("button",{type:"button",onClick:A,disabled:E,style:{paddingLeft:`${8+n*16}px`},className:`flex w-full items-center gap-1.5 py-1 pr-2 text-left text-sm transition-colors ${w?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"} ${E?"cursor-not-allowed opacity-50 hover:bg-transparent":""}`,children:[x?S.jsxs(S.Fragment,{children:[g?S.jsx(vg,{className:"h-3.5 w-3.5 shrink-0 text-gray-400"}):S.jsx(vx,{className:"h-3.5 w-3.5 shrink-0 text-gray-400"}),g?S.jsx(a5,{className:"h-4 w-4 shrink-0 text-amber-500"}):S.jsx(TUn,{className:"h-4 w-4 shrink-0 text-amber-500"})]}):S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"w-3.5 shrink-0"}),v?S.jsx(UUn,{className:"h-4 w-4 shrink-0 text-blue-500"}):S.jsx(Tx,{className:"h-4 w-4 shrink-0 text-gray-400"})]}),S.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),!x||C?f==null?void 0:f(t):null]}),x&&g&&((M=t.children)!=null&&M.length)?S.jsx("div",{children:t.children.map(I=>S.jsx(eln,{node:I,depth:n+1,expandedFolders:i,onToggle:o,onSelect:a,selectedPath:c,isFileDisabled:u,renderFileSuffix:f},I.path))}):null]})}function tln({nodes:t,expandedFolders:n,onToggle:i,onSelect:o,selectedPath:a,isFileDisabled:c,renderFileSuffix:u}){return S.jsx("div",{children:t.map(f=>S.jsx(eln,{node:f,expandedFolders:n,onToggle:i,onSelect:o,selectedPath:a,isFileDisabled:c,renderFileSuffix:u},f.path))})}let i$e,s$e;if(typeof WeakMap<"u"){let t=new WeakMap;i$e=n=>t.get(n),s$e=(n,i)=>(t.set(n,i),i)}else{const t=[];let i=0;i$e=o=>{for(let a=0;a<t.length;a+=2)if(t[a]==o)return t[a+1]},s$e=(o,a)=>(i==10&&(i=0),t[i++]=o,t[i++]=a)}var Qd=class{constructor(t,n,i,o){this.width=t,this.height=n,this.map=i,this.problems=o}findCell(t){for(let n=0;n<this.map.length;n++){const i=this.map[n];if(i!=t)continue;const o=n%this.width,a=n/this.width|0;let c=o+1,u=a+1;for(let f=1;c<this.width&&this.map[n+f]==i;f++)c++;for(let f=1;u<this.height&&this.map[n+this.width*f]==i;f++)u++;return{left:o,top:a,right:c,bottom:u}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let n=0;n<this.map.length;n++)if(this.map[n]==t)return n%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,n,i){const{left:o,right:a,top:c,bottom:u}=this.findCell(t);return n=="horiz"?(i<0?o==0:a==this.width)?null:this.map[c*this.width+(i<0?o-1:a)]:(i<0?c==0:u==this.height)?null:this.map[o+this.width*(i<0?c-1:u)]}rectBetween(t,n){const{left:i,right:o,top:a,bottom:c}=this.findCell(t),{left:u,right:f,top:g,bottom:w}=this.findCell(n);return{left:Math.min(i,u),top:Math.min(a,g),right:Math.max(o,f),bottom:Math.max(c,w)}}cellsInRect(t){const n=[],i={};for(let o=t.top;o<t.bottom;o++)for(let a=t.left;a<t.right;a++){const c=o*this.width+a,u=this.map[c];i[u]||(i[u]=!0,!(a==t.left&&a&&this.map[c-1]==u||o==t.top&&o&&this.map[c-this.width]==u)&&n.push(u))}return n}positionAt(t,n,i){for(let o=0,a=0;;o++){const c=a+i.child(o).nodeSize;if(o==t){let u=n+t*this.width;const f=(t+1)*this.width;for(;u<f&&this.map[u]<a;)u++;return u==f?c-1:this.map[u]}a=c}}static get(t){return i$e(t)||s$e(t,CAr(t))}};function CAr(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const n=SAr(t),i=t.childCount,o=[];let a=0,c=null;const u=[];for(let w=0,x=n*i;w<x;w++)o[w]=0;for(let w=0,x=0;w<i;w++){const v=t.child(w);x++;for(let A=0;;A++){for(;a<o.length&&o[a]!=0;)a++;if(A==v.childCount)break;const M=v.child(A),{colspan:I,rowspan:D,colwidth:P}=M.attrs;for(let R=0;R<D;R++){if(R+w>=i){(c||(c=[])).push({type:"overlong_rowspan",pos:x,n:D-R});break}const z=a+R*n;for(let U=0;U<I;U++){o[z+U]==0?o[z+U]=x:(c||(c=[])).push({type:"collision",row:w,pos:x,n:I-U});const W=P&&P[U];if(W){const G=(z+U)%n*2,Y=u[G];Y==null||Y!=W&&u[G+1]==1?(u[G]=W,u[G+1]=1):Y==W&&u[G+1]++}}}a+=I,x+=M.nodeSize}const C=(w+1)*n;let E=0;for(;a<C;)o[a++]==0&&E++;E&&(c||(c=[])).push({type:"missing",row:w,n:E}),x++}(n===0||i===0)&&(c||(c=[])).push({type:"zero_sized"});const f=new Qd(n,i,o,c);let g=!1;for(let w=0;!g&&w<u.length;w+=2)u[w]!=null&&u[w+1]<i&&(g=!0);return g&&EAr(f,u,t),f}function SAr(t){let n=-1,i=!1;for(let o=0;o<t.childCount;o++){const a=t.child(o);let c=0;if(i)for(let u=0;u<o;u++){const f=t.child(u);for(let g=0;g<f.childCount;g++){const w=f.child(g);u+w.attrs.rowspan>o&&(c+=w.attrs.colspan)}}for(let u=0;u<a.childCount;u++){const f=a.child(u);c+=f.attrs.colspan,f.attrs.rowspan>1&&(i=!0)}n==-1?n=c:n!=c&&(n=Math.max(n,c))}return n}function EAr(t,n,i){t.problems||(t.problems=[]);const o={};for(let a=0;a<t.map.length;a++){const c=t.map[a];if(o[c])continue;o[c]=!0;const u=i.nodeAt(c);if(!u)throw new RangeError(`No cell with offset ${c} found`);let f=null;const g=u.attrs;for(let w=0;w<g.colspan;w++){const x=n[(a+w)%t.width*2];x!=null&&(!g.colwidth||g.colwidth[w]!=x)&&((f||(f=_Ar(g)))[w]=x)}f&&t.problems.unshift({type:"colwidth mismatch",pos:c,colwidth:f})}}function _Ar(t){if(t.colwidth)return t.colwidth.slice();const n=[];for(let i=0;i<t.colspan;i++)n.push(0);return n}function C0(t){let n=t.cached.tableNodeTypes;if(!n){n=t.cached.tableNodeTypes={};for(const i in t.nodes){const o=t.nodes[i],a=o.spec.tableRole;a&&(n[a]=o)}}return n}const J4=new Oc("selectingCells");function S9(t){for(let n=t.depth-1;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return t.node(0).resolve(t.before(n+1));return null}function TAr(t){for(let n=t.depth;n>0;n--){const i=t.node(n).type.spec.tableRole;if(i==="cell"||i==="header_cell")return t.node(n)}return null}function ek(t){const n=t.selection.$head;for(let i=n.depth;i>0;i--)if(n.node(i).type.spec.tableRole=="row")return!0;return!1}function tme(t){const n=t.selection;if("$anchorCell"in n&&n.$anchorCell)return n.$anchorCell.pos>n.$headCell.pos?n.$anchorCell:n.$headCell;if("node"in n&&n.node&&n.node.type.spec.tableRole=="cell")return n.$anchor;const i=S9(n.$head)||AAr(n.$head);if(i)return i;throw new RangeError(`No cell found around position ${n.head}`)}function AAr(t){for(let n=t.nodeAfter,i=t.pos;n;n=n.firstChild,i++){const o=n.type.spec.tableRole;if(o=="cell"||o=="header_cell")return t.doc.resolve(i)}for(let n=t.nodeBefore,i=t.pos;n;n=n.lastChild,i--){const o=n.type.spec.tableRole;if(o=="cell"||o=="header_cell")return t.doc.resolve(i-n.nodeSize)}}function o$e(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function MAr(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function EHe(t,n){return t.depth==n.depth&&t.pos>=n.start(-1)&&t.pos<=n.end(-1)}function nln(t,n,i){const o=t.node(-1),a=Qd.get(o),c=t.start(-1),u=a.nextCell(t.pos-c,n,i);return u==null?null:t.node(0).resolve(c+u)}function E9(t,n,i=1){const o={...t,colspan:t.colspan-i};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(n,i),o.colwidth.some(a=>a>0)||(o.colwidth=null)),o}function rln(t,n,i=1){const o={...t,colspan:t.colspan+i};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let a=0;a<i;a++)o.colwidth.splice(n,0,0)}return o}function NAr(t,n,i){const o=C0(n.type.schema).header_cell;for(let a=0;a<t.height;a++)if(n.nodeAt(t.map[i+a*t.width]).type!=o)return!1;return!0}var tu=class WE extends Fs{constructor(n,i=n){const o=n.node(-1),a=Qd.get(o),c=n.start(-1),u=a.rectBetween(n.pos-c,i.pos-c),f=n.node(0),g=a.cellsInRect(u).filter(x=>x!=i.pos-c);g.unshift(i.pos-c);const w=g.map(x=>{const v=o.nodeAt(x);if(!v)throw new RangeError(`No cell with offset ${x} found`);const C=c+x+1;return new Osn(f.resolve(C),f.resolve(C+v.content.size))});super(w[0].$from,w[0].$to,w),this.$anchorCell=n,this.$headCell=i}map(n,i){const o=n.resolve(i.map(this.$anchorCell.pos)),a=n.resolve(i.map(this.$headCell.pos));if(o$e(o)&&o$e(a)&&EHe(o,a)){const c=this.$anchorCell.node(-1)!=o.node(-1);return c&&this.isRowSelection()?WE.rowSelection(o,a):c&&this.isColSelection()?WE.colSelection(o,a):new WE(o,a)}return us.between(o,a)}content(){const n=this.$anchorCell.node(-1),i=Qd.get(n),o=this.$anchorCell.start(-1),a=i.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),c={},u=[];for(let g=a.top;g<a.bottom;g++){const w=[];for(let x=g*i.width+a.left,v=a.left;v<a.right;v++,x++){const C=i.map[x];if(c[C])continue;c[C]=!0;const E=i.findCell(C);let A=n.nodeAt(C);if(!A)throw new RangeError(`No cell with offset ${C} found`);const M=a.left-E.left,I=E.right-a.right;if(M>0||I>0){let D=A.attrs;if(M>0&&(D=E9(D,0,M)),I>0&&(D=E9(D,D.colspan-I,I)),E.left<a.left){if(A=A.type.createAndFill(D),!A)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(D)}`)}else A=A.type.create(D,A.content)}if(E.top<a.top||E.bottom>a.bottom){const D={...A.attrs,rowspan:Math.min(E.bottom,a.bottom)-Math.max(E.top,a.top)};E.top<a.top?A=A.type.createAndFill(D):A=A.type.create(D,A.content)}w.push(A)}u.push(n.child(g).copy(An.from(w)))}const f=this.isColSelection()&&this.isRowSelection()?n:u;return new zr(An.from(f),1,1)}replace(n,i=zr.empty){const o=n.steps.length,a=this.ranges;for(let u=0;u<a.length;u++){const{$from:f,$to:g}=a[u],w=n.mapping.slice(o);n.replace(w.map(f.pos),w.map(g.pos),u?zr.empty:i)}const c=Fs.findFrom(n.doc.resolve(n.mapping.slice(o).map(this.to)),-1);c&&n.setSelection(c)}replaceWith(n,i){this.replace(n,new zr(An.from(i),0,0))}forEachCell(n){const i=this.$anchorCell.node(-1),o=Qd.get(i),a=this.$anchorCell.start(-1),c=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-a,this.$headCell.pos-a));for(let u=0;u<c.length;u++)n(i.nodeAt(c[u]),a+c[u])}isColSelection(){const n=this.$anchorCell.index(-1),i=this.$headCell.index(-1);if(Math.min(n,i)>0)return!1;const o=n+this.$anchorCell.nodeAfter.attrs.rowspan,a=i+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,a)==this.$headCell.node(-1).childCount}static colSelection(n,i=n){const o=n.node(-1),a=Qd.get(o),c=n.start(-1),u=a.findCell(n.pos-c),f=a.findCell(i.pos-c),g=n.node(0);return u.top<=f.top?(u.top>0&&(n=g.resolve(c+a.map[u.left])),f.bottom<a.height&&(i=g.resolve(c+a.map[a.width*(a.height-1)+f.right-1]))):(f.top>0&&(i=g.resolve(c+a.map[f.left])),u.bottom<a.height&&(n=g.resolve(c+a.map[a.width*(a.height-1)+u.right-1]))),new WE(n,i)}isRowSelection(){const n=this.$anchorCell.node(-1),i=Qd.get(n),o=this.$anchorCell.start(-1),a=i.colCount(this.$anchorCell.pos-o),c=i.colCount(this.$headCell.pos-o);if(Math.min(a,c)>0)return!1;const u=a+this.$anchorCell.nodeAfter.attrs.colspan,f=c+this.$headCell.nodeAfter.attrs.colspan;return Math.max(u,f)==i.width}eq(n){return n instanceof WE&&n.$anchorCell.pos==this.$anchorCell.pos&&n.$headCell.pos==this.$headCell.pos}static rowSelection(n,i=n){const o=n.node(-1),a=Qd.get(o),c=n.start(-1),u=a.findCell(n.pos-c),f=a.findCell(i.pos-c),g=n.node(0);return u.left<=f.left?(u.left>0&&(n=g.resolve(c+a.map[u.top*a.width])),f.right<a.width&&(i=g.resolve(c+a.map[a.width*(f.top+1)-1]))):(f.left>0&&(i=g.resolve(c+a.map[f.top*a.width])),u.right<a.width&&(n=g.resolve(c+a.map[a.width*(u.top+1)-1]))),new WE(n,i)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(n,i){return new WE(n.resolve(i.anchor),n.resolve(i.head))}static create(n,i,o=i){return new WE(n.resolve(i),n.resolve(o))}getBookmark(){return new jAr(this.$anchorCell.pos,this.$headCell.pos)}};tu.prototype.visible=!1;Fs.jsonID("cell",tu);var jAr=class iln{constructor(n,i){this.anchor=n,this.head=i}map(n){return new iln(n.map(this.anchor),n.map(this.head))}resolve(n){const i=n.resolve(this.anchor),o=n.resolve(this.head);return i.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&i.index()<i.parent.childCount&&o.index()<o.parent.childCount&&EHe(i,o)?new tu(i,o):Fs.near(o,1)}};function DAr(t){if(!(t.selection instanceof tu))return null;const n=[];return t.selection.forEachCell((i,o)=>{n.push(Qh.node(o,o+i.nodeSize,{class:"selectedCell"}))}),Nc.create(t.doc,n)}function IAr({$from:t,$to:n}){if(t.pos==n.pos||t.pos<n.pos-6)return!1;let i=t.pos,o=n.pos,a=t.depth;for(;a>=0&&!(t.after(a+1)<t.end(a));a--,i++);for(let c=n.depth;c>=0&&!(n.before(c+1)>n.start(c));c--,o--);return i==o&&/row|table/.test(t.node(a).type.spec.tableRole)}function OAr({$from:t,$to:n}){let i,o;for(let a=t.depth;a>0;a--){const c=t.node(a);if(c.type.spec.tableRole==="cell"||c.type.spec.tableRole==="header_cell"){i=c;break}}for(let a=n.depth;a>0;a--){const c=n.node(a);if(c.type.spec.tableRole==="cell"||c.type.spec.tableRole==="header_cell"){o=c;break}}return i!==o&&n.parentOffset===0}function LAr(t,n,i){const o=(n||t).selection,a=(n||t).doc;let c,u;if(o instanceof es&&(u=o.node.type.spec.tableRole)){if(u=="cell"||u=="header_cell")c=tu.create(a,o.from);else if(u=="row"){const f=a.resolve(o.from+1);c=tu.rowSelection(f,f)}else if(!i){const f=Qd.get(o.node),g=o.from+1,w=g+f.map[f.width*f.height-1];c=tu.create(a,g+1,w)}}else o instanceof us&&IAr(o)?c=us.create(a,o.from):o instanceof us&&OAr(o)&&(c=us.create(a,o.$from.start(),o.$from.end()));return c&&(n||(n=t.tr)).setSelection(c),n}const PAr=new Oc("fix-tables");function sln(t,n,i,o){const a=t.childCount,c=n.childCount;e:for(let u=0,f=0;u<c;u++){const g=n.child(u);for(let w=f,x=Math.min(a,u+3);w<x;w++)if(t.child(w)==g){f=w+1,i+=g.nodeSize;continue e}o(g,i),f<a&&t.child(f).sameMarkup(g)?sln(t.child(f),g,i+1,o):g.nodesBetween(0,g.content.size,o,i+1),i+=g.nodeSize}}function oln(t,n){let i;const o=(a,c)=>{a.type.spec.tableRole=="table"&&(i=RAr(t,a,c,i))};return n?n.doc!=t.doc&&sln(n.doc,t.doc,0,o):t.doc.descendants(o),i}function RAr(t,n,i,o){const a=Qd.get(n);if(!a.problems)return o;o||(o=t.tr);const c=[];for(let g=0;g<a.height;g++)c.push(0);for(let g=0;g<a.problems.length;g++){const w=a.problems[g];if(w.type=="collision"){const x=n.nodeAt(w.pos);if(!x)continue;const v=x.attrs;for(let C=0;C<v.rowspan;C++)c[w.row+C]+=w.n;o.setNodeMarkup(o.mapping.map(i+1+w.pos),null,E9(v,v.colspan-w.n,w.n))}else if(w.type=="missing")c[w.row]+=w.n;else if(w.type=="overlong_rowspan"){const x=n.nodeAt(w.pos);if(!x)continue;o.setNodeMarkup(o.mapping.map(i+1+w.pos),null,{...x.attrs,rowspan:x.attrs.rowspan-w.n})}else if(w.type=="colwidth mismatch"){const x=n.nodeAt(w.pos);if(!x)continue;o.setNodeMarkup(o.mapping.map(i+1+w.pos),null,{...x.attrs,colwidth:w.colwidth})}else if(w.type=="zero_sized"){const x=o.mapping.map(i);o.delete(x,x+n.nodeSize)}}let u,f;for(let g=0;g<c.length;g++)c[g]&&(u==null&&(u=g),f=g);for(let g=0,w=i+1;g<a.height;g++){const x=n.child(g),v=w+x.nodeSize,C=c[g];if(C>0){let E="cell";x.firstChild&&(E=x.firstChild.type.spec.tableRole);const A=[];for(let I=0;I<C;I++){const D=C0(t.schema)[E].createAndFill();D&&A.push(D)}const M=(g==0||u==g-1)&&f==g?w+1:v-1;o.insert(o.mapping.map(M),A)}w=v}return o.setMeta(PAr,{fixTables:!0})}function EC(t){const n=t.selection,i=tme(t),o=i.node(-1),a=i.start(-1),c=Qd.get(o);return{...n instanceof tu?c.rectBetween(n.$anchorCell.pos-a,n.$headCell.pos-a):c.findCell(i.pos-a),tableStart:a,map:c,table:o}}function aln(t,{map:n,tableStart:i,table:o},a){let c=a>0?-1:0;NAr(n,o,a+c)&&(c=a==0||a==n.width?null:0);for(let u=0;u<n.height;u++){const f=u*n.width+a;if(a>0&&a<n.width&&n.map[f-1]==n.map[f]){const g=n.map[f],w=o.nodeAt(g);t.setNodeMarkup(t.mapping.map(i+g),null,rln(w.attrs,a-n.colCount(g))),u+=w.attrs.rowspan-1}else{const g=c==null?C0(o.type.schema).cell:o.nodeAt(n.map[f+c]).type,w=n.positionAt(u,a,o);t.insert(t.mapping.map(i+w),g.createAndFill())}}return t}function $Ar(t,n){if(!ek(t))return!1;if(n){const i=EC(t);n(aln(t.tr,i,i.left))}return!0}function FAr(t,n){if(!ek(t))return!1;if(n){const i=EC(t);n(aln(t.tr,i,i.right))}return!0}function BAr(t,{map:n,table:i,tableStart:o},a){const c=t.mapping.maps.length;for(let u=0;u<n.height;){const f=u*n.width+a,g=n.map[f],w=i.nodeAt(g),x=w.attrs;if(a>0&&n.map[f-1]==g||a<n.width-1&&n.map[f+1]==g)t.setNodeMarkup(t.mapping.slice(c).map(o+g),null,E9(x,a-n.colCount(g)));else{const v=t.mapping.slice(c).map(o+g);t.delete(v,v+w.nodeSize)}u+=x.rowspan}}function zAr(t,n){if(!ek(t))return!1;if(n){const i=EC(t),o=t.tr;if(i.left==0&&i.right==i.map.width)return!1;for(let a=i.right-1;BAr(o,i,a),a!=i.left;a--){const c=i.tableStart?o.doc.nodeAt(i.tableStart-1):o.doc;if(!c)throw new RangeError("No table found");i.table=c,i.map=Qd.get(c)}n(o)}return!0}function HAr(t,n,i){var o;const a=C0(n.type.schema).header_cell;for(let c=0;c<t.width;c++)if(((o=n.nodeAt(t.map[c+i*t.width]))===null||o===void 0?void 0:o.type)!=a)return!1;return!0}function lln(t,{map:n,tableStart:i,table:o},a){let c=i;for(let w=0;w<a;w++)c+=o.child(w).nodeSize;const u=[];let f=a>0?-1:0;HAr(n,o,a+f)&&(f=a==0||a==n.height?null:0);for(let w=0,x=n.width*a;w<n.width;w++,x++)if(a>0&&a<n.height&&n.map[x]==n.map[x-n.width]){const v=n.map[x],C=o.nodeAt(v).attrs;t.setNodeMarkup(i+v,null,{...C,rowspan:C.rowspan+1}),w+=C.colspan-1}else{var g;const v=f==null?C0(o.type.schema).cell:(g=o.nodeAt(n.map[x+f*n.width]))===null||g===void 0?void 0:g.type,C=v==null?void 0:v.createAndFill();C&&u.push(C)}return t.insert(c,C0(o.type.schema).row.create(null,u)),t}function UAr(t,n){if(!ek(t))return!1;if(n){const i=EC(t);n(lln(t.tr,i,i.top))}return!0}function WAr(t,n){if(!ek(t))return!1;if(n){const i=EC(t);n(lln(t.tr,i,i.bottom))}return!0}function qAr(t,{map:n,table:i,tableStart:o},a){let c=0;for(let w=0;w<a;w++)c+=i.child(w).nodeSize;const u=c+i.child(a).nodeSize,f=t.mapping.maps.length;t.delete(c+o,u+o);const g=new Set;for(let w=0,x=a*n.width;w<n.width;w++,x++){const v=n.map[x];if(!g.has(v)){if(g.add(v),a>0&&v==n.map[x-n.width]){const C=i.nodeAt(v).attrs;t.setNodeMarkup(t.mapping.slice(f).map(v+o),null,{...C,rowspan:C.rowspan-1}),w+=C.colspan-1}else if(a<n.height&&v==n.map[x+n.width]){const C=i.nodeAt(v),E=C.attrs,A=C.type.create({...E,rowspan:C.attrs.rowspan-1},C.content),M=n.positionAt(a+1,w,i);t.insert(t.mapping.slice(f).map(o+M),A),w+=E.colspan-1}}}}function GAr(t,n){if(!ek(t))return!1;if(n){const i=EC(t),o=t.tr;if(i.top==0&&i.bottom==i.map.height)return!1;for(let a=i.bottom-1;qAr(o,i,a),a!=i.top;a--){const c=i.tableStart?o.doc.nodeAt(i.tableStart-1):o.doc;if(!c)throw new RangeError("No table found");i.table=c,i.map=Qd.get(i.table)}n(o)}return!0}function PUt(t){const n=t.content;return n.childCount==1&&n.child(0).isTextblock&&n.child(0).childCount==0}function VAr({width:t,height:n,map:i},o){let a=o.top*t+o.left,c=a,u=(o.bottom-1)*t+o.left,f=a+(o.right-o.left-1);for(let g=o.top;g<o.bottom;g++){if(o.left>0&&i[c]==i[c-1]||o.right<t&&i[f]==i[f+1])return!0;c+=t,f+=t}for(let g=o.left;g<o.right;g++){if(o.top>0&&i[a]==i[a-t]||o.bottom<n&&i[u]==i[u+t])return!0;a++,u++}return!1}function RUt(t,n){const i=t.selection;if(!(i instanceof tu)||i.$anchorCell.pos==i.$headCell.pos)return!1;const o=EC(t),{map:a}=o;if(VAr(a,o))return!1;if(n){const c=t.tr,u={};let f=An.empty,g,w;for(let x=o.top;x<o.bottom;x++)for(let v=o.left;v<o.right;v++){const C=a.map[x*a.width+v],E=o.table.nodeAt(C);if(!(u[C]||!E))if(u[C]=!0,g==null)g=C,w=E;else{PUt(E)||(f=f.append(E.content));const A=c.mapping.map(C+o.tableStart);c.delete(A,A+E.nodeSize)}}if(g==null||w==null)return!0;if(c.setNodeMarkup(g+o.tableStart,null,{...rln(w.attrs,w.attrs.colspan,o.right-o.left-w.attrs.colspan),rowspan:o.bottom-o.top}),f.size>0){const x=g+1+w.content.size,v=PUt(w)?g+1:x;c.replaceWith(v+o.tableStart,x+o.tableStart,f)}c.setSelection(new tu(c.doc.resolve(g+o.tableStart))),n(c)}return!0}function $Ut(t,n){const i=C0(t.schema);return KAr(({node:o})=>i[o.type.spec.tableRole])(t,n)}function KAr(t){return(n,i)=>{const o=n.selection;let a,c;if(o instanceof tu){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;a=o.$anchorCell.nodeAfter,c=o.$anchorCell.pos}else{var u;if(a=TAr(o.$from),!a)return!1;c=(u=S9(o.$from))===null||u===void 0?void 0:u.pos}if(a==null||c==null||a.attrs.colspan==1&&a.attrs.rowspan==1)return!1;if(i){let f=a.attrs;const g=[],w=f.colwidth;f.rowspan>1&&(f={...f,rowspan:1}),f.colspan>1&&(f={...f,colspan:1});const x=EC(n),v=n.tr;for(let E=0;E<x.right-x.left;E++)g.push(w?{...f,colwidth:w&&w[E]?[w[E]]:null}:f);let C;for(let E=x.top;E<x.bottom;E++){let A=x.map.positionAt(E,x.left,x.table);E==x.top&&(A+=a.nodeSize);for(let M=x.left,I=0;M<x.right;M++,I++)M==x.left&&E==x.top||v.insert(C=v.mapping.map(A+x.tableStart,1),t({node:a,row:E,col:M}).createAndFill(g[I]))}v.setNodeMarkup(c,t({node:a,row:x.top,col:x.left}),g[0]),o instanceof tu&&v.setSelection(new tu(v.doc.resolve(o.$anchorCell.pos),C?v.doc.resolve(C):void 0)),i(v)}return!0}}function JAr(t,n){return function(i,o){if(!ek(i))return!1;const a=tme(i);if(a.nodeAfter.attrs[t]===n)return!1;if(o){const c=i.tr;i.selection instanceof tu?i.selection.forEachCell((u,f)=>{u.attrs[t]!==n&&c.setNodeMarkup(f,null,{...u.attrs,[t]:n})}):c.setNodeMarkup(a.pos,null,{...a.nodeAfter.attrs,[t]:n}),o(c)}return!0}}function YAr(t){return function(n,i){if(!ek(n))return!1;if(i){const o=C0(n.schema),a=EC(n),c=n.tr,u=a.map.cellsInRect(t=="column"?{left:a.left,top:0,right:a.right,bottom:a.map.height}:t=="row"?{left:0,top:a.top,right:a.map.width,bottom:a.bottom}:a),f=u.map(g=>a.table.nodeAt(g));for(let g=0;g<u.length;g++)f[g].type==o.header_cell&&c.setNodeMarkup(a.tableStart+u[g],o.cell,f[g].attrs);if(c.steps.length===0)for(let g=0;g<u.length;g++)c.setNodeMarkup(a.tableStart+u[g],o.header_cell,f[g].attrs);i(c)}return!0}}function FUt(t,n,i){const o=n.map.cellsInRect({left:0,top:0,right:t=="row"?n.map.width:1,bottom:t=="column"?n.map.height:1});for(let a=0;a<o.length;a++){const c=n.table.nodeAt(o[a]);if(c&&c.type!==i.header_cell)return!1}return!0}function dJ(t,n){return n=n||{useDeprecatedLogic:!1},n.useDeprecatedLogic?YAr(t):function(i,o){if(!ek(i))return!1;if(o){const a=C0(i.schema),c=EC(i),u=i.tr,f=FUt("row",c,a),g=FUt("column",c,a),w=(t==="column"?f:t==="row"&&g)?1:0,x=t=="column"?{left:0,top:w,right:1,bottom:c.map.height}:t=="row"?{left:w,top:0,right:c.map.width,bottom:1}:c,v=t=="column"?g?a.cell:a.header_cell:t=="row"?f?a.cell:a.header_cell:a.cell;c.map.cellsInRect(x).forEach(C=>{const E=C+c.tableStart,A=u.doc.nodeAt(E);A&&u.setNodeMarkup(E,v,A.attrs)}),o(u)}return!0}}dJ("row",{useDeprecatedLogic:!0});dJ("column",{useDeprecatedLogic:!0});const XAr=dJ("cell",{useDeprecatedLogic:!0});function QAr(t,n){if(n<0){const i=t.nodeBefore;if(i)return t.pos-i.nodeSize;for(let o=t.index(-1)-1,a=t.before();o>=0;o--){const c=t.node(-1).child(o),u=c.lastChild;if(u)return a-1-u.nodeSize;a-=c.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const i=t.node(-1);for(let o=t.indexAfter(-1),a=t.after();o<i.childCount;o++){const c=i.child(o);if(c.childCount)return a+1;a+=c.nodeSize}}return null}function BUt(t){return function(n,i){if(!ek(n))return!1;const o=QAr(tme(n),t);if(o==null)return!1;if(i){const a=n.doc.resolve(o);i(n.tr.setSelection(us.between(a,MAr(a))).scrollIntoView())}return!0}}function ZAr(t,n){const i=t.selection.$anchor;for(let o=i.depth;o>0;o--)if(i.node(o).type.spec.tableRole=="table")return n&&n(t.tr.delete(i.before(o),i.after(o)).scrollIntoView()),!0;return!1}function hde(t,n){const i=t.selection;if(!(i instanceof tu))return!1;if(n){const o=t.tr,a=C0(t.schema).cell.createAndFill().content;i.forEachCell((c,u)=>{c.content.eq(a)||o.replace(o.mapping.map(u+1),o.mapping.map(u+c.nodeSize-1),new zr(a,0,0))}),o.docChanged&&n(o)}return!0}function eMr(t){if(t.size===0)return null;let{content:n,openStart:i,openEnd:o}=t;for(;n.childCount==1&&(i>0&&o>0||n.child(0).type.spec.tableRole=="table");)i--,o--,n=n.child(0).content;const a=n.child(0),c=a.type.spec.tableRole,u=a.type.schema,f=[];if(c=="row")for(let g=0;g<n.childCount;g++){let w=n.child(g).content;const x=g?0:Math.max(0,i-1),v=g<n.childCount-1?0:Math.max(0,o-1);(x||v)&&(w=a$e(C0(u).row,new zr(w,x,v)).content),f.push(w)}else if(c=="cell"||c=="header_cell")f.push(i||o?a$e(C0(u).row,new zr(n,i,o)).content:n);else return null;return tMr(u,f)}function tMr(t,n){const i=[];for(let a=0;a<n.length;a++){const c=n[a];for(let u=c.childCount-1;u>=0;u--){const{rowspan:f,colspan:g}=c.child(u).attrs;for(let w=a;w<a+f;w++)i[w]=(i[w]||0)+g}}let o=0;for(let a=0;a<i.length;a++)o=Math.max(o,i[a]);for(let a=0;a<i.length;a++)if(a>=n.length&&n.push(An.empty),i[a]<o){const c=C0(t).cell.createAndFill(),u=[];for(let f=i[a];f<o;f++)u.push(c);n[a]=n[a].append(An.from(u))}return{height:n.length,width:o,rows:n}}function a$e(t,n){const i=t.createAndFill();return new $ze(i).replace(0,i.content.size,n).doc}function nMr({width:t,height:n,rows:i},o,a){if(t!=o){const c=[],u=[];for(let f=0;f<i.length;f++){const g=i[f],w=[];for(let x=c[f]||0,v=0;x<o;v++){let C=g.child(v%g.childCount);x+C.attrs.colspan>o&&(C=C.type.createChecked(E9(C.attrs,C.attrs.colspan,x+C.attrs.colspan-o),C.content)),w.push(C),x+=C.attrs.colspan;for(let E=1;E<C.attrs.rowspan;E++)c[f+E]=(c[f+E]||0)+C.attrs.colspan}u.push(An.from(w))}i=u,t=o}if(n!=a){const c=[];for(let u=0,f=0;u<a;u++,f++){const g=[],w=i[f%n];for(let x=0;x<w.childCount;x++){let v=w.child(x);u+v.attrs.rowspan>a&&(v=v.type.create({...v.attrs,rowspan:Math.max(1,a-v.attrs.rowspan)},v.content)),g.push(v)}c.push(An.from(g))}i=c,n=a}return{width:t,height:n,rows:i}}function rMr(t,n,i,o,a,c,u){const f=t.doc.type.schema,g=C0(f);let w,x;if(a>n.width)for(let v=0,C=0;v<n.height;v++){const E=i.child(v);C+=E.nodeSize;const A=[];let M;E.lastChild==null||E.lastChild.type==g.cell?M=w||(w=g.cell.createAndFill()):M=x||(x=g.header_cell.createAndFill());for(let I=n.width;I<a;I++)A.push(M);t.insert(t.mapping.slice(u).map(C-1+o),A)}if(c>n.height){const v=[];for(let A=0,M=(n.height-1)*n.width;A<Math.max(n.width,a);A++){const I=A>=n.width?!1:i.nodeAt(n.map[M+A]).type==g.header_cell;v.push(I?x||(x=g.header_cell.createAndFill()):w||(w=g.cell.createAndFill()))}const C=g.row.create(null,An.from(v)),E=[];for(let A=n.height;A<c;A++)E.push(C);t.insert(t.mapping.slice(u).map(o+i.nodeSize-2),E)}return!!(w||x)}function zUt(t,n,i,o,a,c,u,f){if(u==0||u==n.height)return!1;let g=!1;for(let w=a;w<c;w++){const x=u*n.width+w,v=n.map[x];if(n.map[x-n.width]==v){g=!0;const C=i.nodeAt(v),{top:E,left:A}=n.findCell(v);t.setNodeMarkup(t.mapping.slice(f).map(v+o),null,{...C.attrs,rowspan:u-E}),t.insert(t.mapping.slice(f).map(n.positionAt(u,A,i)),C.type.createAndFill({...C.attrs,rowspan:E+C.attrs.rowspan-u})),w+=C.attrs.colspan-1}}return g}function HUt(t,n,i,o,a,c,u,f){if(u==0||u==n.width)return!1;let g=!1;for(let w=a;w<c;w++){const x=w*n.width+u,v=n.map[x];if(n.map[x-1]==v){g=!0;const C=i.nodeAt(v),E=n.colCount(v),A=t.mapping.slice(f).map(v+o);t.setNodeMarkup(A,null,E9(C.attrs,u-E,C.attrs.colspan-(u-E))),t.insert(A+C.nodeSize,C.type.createAndFill(E9(C.attrs,0,u-E))),w+=C.attrs.rowspan-1}}return g}function UUt(t,n,i,o,a){let c=i?t.doc.nodeAt(i-1):t.doc;if(!c)throw new Error("No table found");let u=Qd.get(c);const{top:f,left:g}=o,w=g+a.width,x=f+a.height,v=t.tr;let C=0;function E(){if(c=i?v.doc.nodeAt(i-1):v.doc,!c)throw new Error("No table found");u=Qd.get(c),C=v.mapping.maps.length}rMr(v,u,c,i,w,x,C)&&E(),zUt(v,u,c,i,g,w,f,C)&&E(),zUt(v,u,c,i,g,w,x,C)&&E(),HUt(v,u,c,i,f,x,g,C)&&E(),HUt(v,u,c,i,f,x,w,C)&&E();for(let A=f;A<x;A++){const M=u.positionAt(A,g,c),I=u.positionAt(A,w,c);v.replace(v.mapping.slice(C).map(M+i),v.mapping.slice(C).map(I+i),new zr(a.rows[A-f],0,0))}E(),v.setSelection(new tu(v.doc.resolve(i+u.positionAt(f,g,c)),v.doc.resolve(i+u.positionAt(x-1,w-1,c)))),n(v)}const iMr=eHe({ArrowLeft:pde("horiz",-1),ArrowRight:pde("horiz",1),ArrowUp:pde("vert",-1),ArrowDown:pde("vert",1),"Shift-ArrowLeft":gde("horiz",-1),"Shift-ArrowRight":gde("horiz",1),"Shift-ArrowUp":gde("vert",-1),"Shift-ArrowDown":gde("vert",1),Backspace:hde,"Mod-Backspace":hde,Delete:hde,"Mod-Delete":hde});function Cfe(t,n,i){return i.eq(t.selection)?!1:(n&&n(t.tr.setSelection(i).scrollIntoView()),!0)}function pde(t,n){return(i,o,a)=>{if(!a)return!1;const c=i.selection;if(c instanceof tu)return Cfe(i,o,Fs.near(c.$headCell,n));if(t!="horiz"&&!c.empty)return!1;const u=cln(a,t,n);if(u==null)return!1;if(t=="horiz")return Cfe(i,o,Fs.near(i.doc.resolve(c.head+n),n));{const f=i.doc.resolve(u),g=nln(f,t,n);let w;return g?w=Fs.near(g,1):n<0?w=Fs.near(i.doc.resolve(f.before(-1)),-1):w=Fs.near(i.doc.resolve(f.after(-1)),1),Cfe(i,o,w)}}}function gde(t,n){return(i,o,a)=>{if(!a)return!1;const c=i.selection;let u;if(c instanceof tu)u=c;else{const g=cln(a,t,n);if(g==null)return!1;u=new tu(i.doc.resolve(g))}const f=nln(u.$headCell,t,n);return f?Cfe(i,o,new tu(u.$anchorCell,f)):!1}}function sMr(t,n){const i=t.state.doc,o=S9(i.resolve(n));return o?(t.dispatch(t.state.tr.setSelection(new tu(o))),!0):!1}function oMr(t,n,i){if(!ek(t.state))return!1;let o=eMr(i);const a=t.state.selection;if(a instanceof tu){o||(o={width:1,height:1,rows:[An.from(a$e(C0(t.state.schema).cell,i))]});const c=a.$anchorCell.node(-1),u=a.$anchorCell.start(-1),f=Qd.get(c).rectBetween(a.$anchorCell.pos-u,a.$headCell.pos-u);return o=nMr(o,f.right-f.left,f.bottom-f.top),UUt(t.state,t.dispatch,u,f,o),!0}else if(o){const c=tme(t.state),u=c.start(-1);return UUt(t.state,t.dispatch,u,Qd.get(c.node(-1)).findCell(c.pos-u),o),!0}else return!1}function aMr(t,n){var i;if(n.button!=0||n.ctrlKey||n.metaKey)return;const o=WUt(t,n.target);let a;if(n.shiftKey&&t.state.selection instanceof tu)c(t.state.selection.$anchorCell,n),n.preventDefault();else if(n.shiftKey&&o&&(a=S9(t.state.selection.$anchor))!=null&&((i=lLe(t,n))===null||i===void 0?void 0:i.pos)!=a.pos)c(a,n),n.preventDefault();else if(!o)return;function c(g,w){let x=lLe(t,w);const v=J4.getState(t.state)==null;if(!x||!EHe(g,x))if(v)x=g;else return;const C=new tu(g,x);if(v||!t.state.selection.eq(C)){const E=t.state.tr.setSelection(C);v&&E.setMeta(J4,g.pos),t.dispatch(E)}}function u(){t.root.removeEventListener("mouseup",u),t.root.removeEventListener("dragstart",u),t.root.removeEventListener("mousemove",f),J4.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(J4,-1))}function f(g){const w=g,x=J4.getState(t.state);let v;if(x!=null)v=t.state.doc.resolve(x);else if(WUt(t,w.target)!=o&&(v=lLe(t,n),!v))return u();v&&c(v,w)}t.root.addEventListener("mouseup",u),t.root.addEventListener("dragstart",u),t.root.addEventListener("mousemove",f)}function cln(t,n,i){if(!(t.state.selection instanceof us))return null;const{$head:o}=t.state.selection;for(let a=o.depth-1;a>=0;a--){const c=o.node(a);if((i<0?o.index(a):o.indexAfter(a))!=(i<0?0:c.childCount))return null;if(c.type.spec.tableRole=="cell"||c.type.spec.tableRole=="header_cell"){const u=o.before(a),f=n=="vert"?i>0?"down":"up":i>0?"right":"left";return t.endOfTextblock(f)?u:null}}return null}function WUt(t,n){for(;n&&n!=t.dom;n=n.parentNode)if(n.nodeName=="TD"||n.nodeName=="TH")return n;return null}function lLe(t,n){const i=t.posAtCoords({left:n.clientX,top:n.clientY});if(!i)return null;let{inside:o,pos:a}=i;return o>=0&&S9(t.state.doc.resolve(o))||S9(t.state.doc.resolve(a))}var lMr=class{constructor(n,i){this.node=n,this.defaultCellMinWidth=i,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${i}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),l$e(n,this.colgroup,this.table,i),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(n){return n.type!=this.node.type?!1:(this.node=n,l$e(n,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(n){return n.type=="attributes"&&(n.target==this.table||this.colgroup.contains(n.target))}};function l$e(t,n,i,o,a,c){let u=0,f=!0,g=n.firstChild;const w=t.firstChild;if(w){for(let v=0,C=0;v<w.childCount;v++){const{colspan:E,colwidth:A}=w.child(v).attrs;for(let M=0;M<E;M++,C++){const I=a==C?c:A&&A[M],D=I?I+"px":"";if(u+=I||o,I||(f=!1),g)g.style.width!=D&&(g.style.width=D),g=g.nextSibling;else{const P=document.createElement("col");P.style.width=D,n.appendChild(P)}}}for(;g;){var x;const v=g.nextSibling;(x=g.parentNode)===null||x===void 0||x.removeChild(g),g=v}f?(i.style.width=u+"px",i.style.minWidth=""):(i.style.width="",i.style.minWidth=u+"px")}}const Ew=new Oc("tableColumnResizing");function cMr({handleWidth:t=5,cellMinWidth:n=25,defaultCellMinWidth:i=100,View:o=lMr,lastColumnResizable:a=!0}={}){const c=new Ic({key:Ew,state:{init(u,f){var g;const w=(g=c.spec)===null||g===void 0||(g=g.props)===null||g===void 0?void 0:g.nodeViews,x=C0(f.schema).table.name;return o&&w&&(w[x]=(v,C)=>new o(v,i,C)),new uMr(-1,!1)},apply(u,f){return f.apply(u)}},props:{attributes:u=>{const f=Ew.getState(u);return f&&f.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(u,f)=>{dMr(u,f,t,a)},mouseleave:u=>{fMr(u)},mousedown:(u,f)=>{hMr(u,f,n,i)}},decorations:u=>{const f=Ew.getState(u);if(f&&f.activeHandle>-1)return wMr(u,f.activeHandle)},nodeViews:{}}});return c}var uMr=class Sfe{constructor(n,i){this.activeHandle=n,this.dragging=i}apply(n){const i=this,o=n.getMeta(Ew);if(o&&o.setHandle!=null)return new Sfe(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new Sfe(i.activeHandle,o.setDragging);if(i.activeHandle>-1&&n.docChanged){let a=n.mapping.map(i.activeHandle,-1);return o$e(n.doc.resolve(a))||(a=-1),new Sfe(a,i.dragging)}return i}};function dMr(t,n,i,o){if(!t.editable)return;const a=Ew.getState(t.state);if(a&&!a.dragging){const c=gMr(n.target);let u=-1;if(c){const{left:f,right:g}=c.getBoundingClientRect();n.clientX-f<=i?u=qUt(t,n,"left",i):g-n.clientX<=i&&(u=qUt(t,n,"right",i))}if(u!=a.activeHandle){if(!o&&u!==-1){const f=t.state.doc.resolve(u),g=f.node(-1),w=Qd.get(g),x=f.start(-1);if(w.colCount(f.pos-x)+f.nodeAfter.attrs.colspan-1==w.width-1)return}uln(t,u)}}}function fMr(t){if(!t.editable)return;const n=Ew.getState(t.state);n&&n.activeHandle>-1&&!n.dragging&&uln(t,-1)}function hMr(t,n,i,o){var a;if(!t.editable)return!1;const c=(a=t.dom.ownerDocument.defaultView)!==null&&a!==void 0?a:window,u=Ew.getState(t.state);if(!u||u.activeHandle==-1||u.dragging)return!1;const f=t.state.doc.nodeAt(u.activeHandle),g=pMr(t,u.activeHandle,f.attrs);t.dispatch(t.state.tr.setMeta(Ew,{setDragging:{startX:n.clientX,startWidth:g}}));function w(v){c.removeEventListener("mouseup",w),c.removeEventListener("mousemove",x);const C=Ew.getState(t.state);C!=null&&C.dragging&&(mMr(t,C.activeHandle,GUt(C.dragging,v,i)),t.dispatch(t.state.tr.setMeta(Ew,{setDragging:null})))}function x(v){if(!v.which)return w(v);const C=Ew.getState(t.state);if(C&&C.dragging){const E=GUt(C.dragging,v,i);VUt(t,C.activeHandle,E,o)}}return VUt(t,u.activeHandle,g,o),c.addEventListener("mouseup",w),c.addEventListener("mousemove",x),n.preventDefault(),!0}function pMr(t,n,{colspan:i,colwidth:o}){const a=o&&o[o.length-1];if(a)return a;const c=t.domAtPos(n);let u=c.node.childNodes[c.offset].offsetWidth,f=i;if(o)for(let g=0;g<i;g++)o[g]&&(u-=o[g],f--);return u/f}function gMr(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function qUt(t,n,i,o){const a=i=="right"?-o:o,c=t.posAtCoords({left:n.clientX+a,top:n.clientY});if(!c)return-1;const{pos:u}=c,f=S9(t.state.doc.resolve(u));if(!f)return-1;if(i=="right")return f.pos;const g=Qd.get(f.node(-1)),w=f.start(-1),x=g.map.indexOf(f.pos-w);return x%g.width==0?-1:w+g.map[x-1]}function GUt(t,n,i){const o=n.clientX-t.startX;return Math.max(i,t.startWidth+o)}function uln(t,n){t.dispatch(t.state.tr.setMeta(Ew,{setHandle:n}))}function mMr(t,n,i){const o=t.state.doc.resolve(n),a=o.node(-1),c=Qd.get(a),u=o.start(-1),f=c.colCount(o.pos-u)+o.nodeAfter.attrs.colspan-1,g=t.state.tr;for(let w=0;w<c.height;w++){const x=w*c.width+f;if(w&&c.map[x]==c.map[x-c.width])continue;const v=c.map[x],C=a.nodeAt(v).attrs,E=C.colspan==1?0:f-c.colCount(v);if(C.colwidth&&C.colwidth[E]==i)continue;const A=C.colwidth?C.colwidth.slice():bMr(C.colspan);A[E]=i,g.setNodeMarkup(u+v,null,{...C,colwidth:A})}g.docChanged&&t.dispatch(g)}function VUt(t,n,i,o){const a=t.state.doc.resolve(n),c=a.node(-1),u=a.start(-1),f=Qd.get(c).colCount(a.pos-u)+a.nodeAfter.attrs.colspan-1;let g=t.domAtPos(a.start(-1)).node;for(;g&&g.nodeName!="TABLE";)g=g.parentNode;g&&l$e(c,g.firstChild,g,o,f,i)}function bMr(t){return Array(t).fill(0)}function wMr(t,n){const i=[],o=t.doc.resolve(n),a=o.node(-1);if(!a)return Nc.empty;const c=Qd.get(a),u=o.start(-1),f=c.colCount(o.pos-u)+o.nodeAfter.attrs.colspan-1;for(let w=0;w<c.height;w++){const x=f+w*c.width;if((f==c.width-1||c.map[x]!=c.map[x+1])&&(w==0||c.map[x]!=c.map[x-c.width])){var g;const v=c.map[x],C=u+v+a.nodeAt(v).nodeSize-1,E=document.createElement("div");E.className="column-resize-handle",!((g=Ew.getState(t))===null||g===void 0)&&g.dragging&&i.push(Qh.node(u+v,u+v+a.nodeAt(v).nodeSize,{class:"column-resize-dragging"})),i.push(Qh.widget(C,E))}}return Nc.create(t.doc,i)}function yMr({allowTableNodeSelection:t=!1}={}){return new Ic({key:J4,state:{init(){return null},apply(n,i){const o=n.getMeta(J4);if(o!=null)return o==-1?null:o;if(i==null||!n.docChanged)return i;const{deleted:a,pos:c}=n.mapping.mapResult(i);return a?null:c}},props:{decorations:DAr,handleDOMEvents:{mousedown:aMr},createSelectionBetween(n){return J4.getState(n.state)!=null?n.state.selection:null},handleTripleClick:sMr,handleKeyDown:iMr,handlePaste:oMr},appendTransaction(n,i,o){return LAr(o,oln(o,i),t)}})}function nge(t){return t==="left"||t==="right"||t==="center"?t:null}function xMr(t){const n=(t.style.textAlign||"").trim().toLowerCase(),i=(t.getAttribute("align")||"").trim().toLowerCase();return nge(n||i)}function vMr(t){return nge(t==null?void 0:t.align)}function dln(){return{default:null,parseHTML:t=>xMr(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}var fln=Qa.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{var n,i;const o=t.getAttribute("colwidth"),a=o?o.split(",").map(c=>parseInt(c,10)):null;if(!a){const c=(n=t.closest("table"))==null?void 0:n.querySelectorAll("colgroup > col"),u=Array.from(((i=t.parentElement)==null?void 0:i.children)||[]).indexOf(t);if(u&&u>-1&&c&&c[u]){const f=c[u].getAttribute("width");return f?[parseInt(f,10)]:null}}return a}},align:dln()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",bc(this.options.HTMLAttributes,t),0]}}),hln=Qa.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const n=t.getAttribute("colwidth");return n?n.split(",").map(o=>parseInt(o,10)):null}},align:dln()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",bc(this.options.HTMLAttributes,t),0]}}),pln=Qa.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",bc(this.options.HTMLAttributes,t),0]}});function c$e(t,n){return n?["width",`${Math.max(n,t)}px`]:["min-width",`${t}px`]}function KUt(t,n,i,o,a,c){var u;let f=0,g=!0,w=n.firstChild;const x=t.firstChild;if(x!==null)for(let C=0,E=0;C<x.childCount;C+=1){const{colspan:A,colwidth:M}=x.child(C).attrs;for(let I=0;I<A;I+=1,E+=1){const D=a===E?c:M&&M[I],P=D?`${D}px`:"";if(f+=D||o,D||(g=!1),w){if(w.style.width!==P){const[R,z]=c$e(o,D);w.style.setProperty(R,z)}w=w.nextSibling}else{const R=document.createElement("col"),[z,U]=c$e(o,D);R.style.setProperty(z,U),n.appendChild(R)}}}for(;w;){const C=w.nextSibling;(u=w.parentNode)==null||u.removeChild(w),w=C}const v=t.attrs.style&&typeof t.attrs.style=="string"&&/\bwidth\s*:/i.test(t.attrs.style);g&&!v?(i.style.width=`${f}px`,i.style.minWidth=""):(i.style.width="",i.style.minWidth=`${f}px`)}var kMr=class{constructor(t,n){this.node=t,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),t.attrs.style&&(this.table.style.cssText=t.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),KUt(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,KUt(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){const n=t.target,i=this.dom.contains(n),o=this.contentDOM.contains(n);return!!(i&&!o&&(t.type==="attributes"||t.type==="childList"||t.type==="characterData"))}};function CMr(t,n,i,o){let a=0,c=!0;const u=[],f=t.firstChild;if(!f)return{};for(let v=0,C=0;v<f.childCount;v+=1){const{colspan:E,colwidth:A}=f.child(v).attrs;for(let M=0;M<E;M+=1,C+=1){const I=i===C?o:A&&A[M];a+=I||n,I||(c=!1);const[D,P]=c$e(n,I);u.push(["col",{style:`${D}: ${P}`}])}}const g=c?`${a}px`:"",w=c?"":`${a}px`;return{colgroup:["colgroup",{},...u],tableWidth:g,tableMinWidth:w}}function JUt(t,n){return t.createAndFill()}function SMr(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const n={};return Object.keys(t.nodes).forEach(i=>{const o=t.nodes[i];o.spec.tableRole&&(n[o.spec.tableRole]=o)}),t.cached.tableNodeTypes=n,n}function EMr(t,n,i,o,a){const c=SMr(t),u=[],f=[];for(let w=0;w<i;w+=1){const x=JUt(c.cell);if(x&&f.push(x),o){const v=JUt(c.header_cell);v&&u.push(v)}}const g=[];for(let w=0;w<n;w+=1)g.push(c.row.createChecked(null,o&&w===0?u:f));return c.table.createChecked(null,g)}function _Mr(t){return t instanceof tu}var mde=({editor:t})=>{const{selection:n}=t.state;if(!_Mr(n))return!1;let i=0;const o=$on(n.ranges[0].$from,c=>c.type.name==="table");return o==null||o.node.descendants(c=>{if(c.type.name==="table")return!1;["tableCell","tableHeader"].includes(c.type.name)&&(i+=1)}),i===n.ranges.length?(t.commands.deleteTable(),!0):!1},TMr="";function AMr(t){return(t||"").replace(/\s+/g," ").trim()}function MMr(t,n,i={}){var o;const a=(o=i.cellLineSeparator)!=null?o:TMr;if(!t||!t.content||t.content.length===0)return"";const c=[];t.content.forEach(M=>{const I=[];M.content&&M.content.forEach(D=>{let P="";D.content&&Array.isArray(D.content)&&D.content.length>1?P=D.content.map(G=>n.renderChildren(G)).join(a):P=D.content?n.renderChildren(D.content):"";const R=AMr(P),z=D.type==="tableHeader",U=vMr(D.attrs);I.push({text:R,isHeader:z,align:U})}),c.push(I)});const u=c.reduce((M,I)=>Math.max(M,I.length),0);if(u===0)return"";const f=new Array(u).fill(0);c.forEach(M=>{var I;for(let D=0;D<u;D+=1){const R=(((I=M[D])==null?void 0:I.text)||"").length;R>f[D]&&(f[D]=R),f[D]<3&&(f[D]=3)}});const g=(M,I)=>M+" ".repeat(Math.max(0,I-M.length)),w=c[0],x=w.some(M=>M.isHeader),v=new Array(u).fill(null);c.forEach(M=>{var I;for(let D=0;D<u;D+=1)!v[D]&&((I=M[D])!=null&&I.align)&&(v[D]=M[D].align)});let C=`
|
|
1156
|
+
`).length,[n])>50;return F.useEffect(()=>{f(!1)},[n]),S.jsxs("section",{className:"rounded-lg border border-gray-200 bg-white shadow-sm",children:[S.jsxs("div",{className:"flex items-start justify-between gap-3 border-b border-gray-200 px-4 py-3",children:[S.jsxs("button",{type:"button",onClick:o,"aria-expanded":i,className:"flex min-w-0 flex-1 items-center gap-2 text-left",children:[i?S.jsx(vg,{size:16,className:"shrink-0 text-gray-400"}):S.jsx(vx,{size:16,className:"shrink-0 text-gray-400"}),S.jsx("span",{className:"truncate text-sm font-semibold text-gray-900",children:t})]}),S.jsxs("button",{type:"button",onClick:a,className:"inline-flex items-center gap-1 rounded-md border border-gray-200 px-2.5 py-1.5 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-50",children:[S.jsx(x5,{size:13}),S.jsx("span",{children:c("tasks.panel.copy")})]})]}),i&&S.jsxs("div",{className:"space-y-3 px-4 py-3",children:[S.jsx("pre",{className:["overflow-x-auto whitespace-pre-wrap break-words rounded-md bg-gray-900 p-4 font-mono text-xs leading-5 text-gray-100",w&&!u?"max-h-[62.5rem] overflow-hidden":""].join(" "),children:n}),w&&S.jsx("button",{type:"button",onClick:()=>f(x=>!x),className:"text-xs font-medium text-blue-600 transition-colors hover:text-blue-700",children:c(u?"tasks.panel.showLess":"tasks.panel.showMore")})]})]})}function Z6r({childTasks:t,onSelectTask:n}){const{t:i}=Zn();return S.jsxs("section",{className:"rounded-lg border border-gray-200 bg-white shadow-sm",children:[S.jsx("div",{className:"border-b border-gray-200 px-4 py-3",children:S.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:i("tasks.panel.childTasks")})}),S.jsx("div",{className:"divide-y divide-gray-200",children:t.map(o=>{if(n){const a=n;return S.jsxs("button",{type:"button",onClick:()=>a(o.taskId),className:"flex w-full cursor-pointer items-center justify-between gap-3 px-4 py-3 text-left transition-colors hover:bg-gray-50",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("p",{className:"truncate text-sm font-medium text-gray-900",children:o.agentId}),S.jsx("p",{className:"truncate font-mono text-xs text-blue-500",children:o.taskId})]}),S.jsx(r$e,{status:o.status})]},o.taskId)}return S.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-3",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("p",{className:"truncate text-sm font-medium text-gray-900",children:o.agentId}),S.jsx("p",{className:"truncate font-mono text-xs text-gray-400",children:o.taskId})]}),S.jsx(r$e,{status:o.status})]},o.taskId)})})]})}function eAr({taskId:t,task:n,onClose:i,onRefresh:o,onSelectTask:a}){const{t:c}=Zn(),{slug:u}=Ff(),f=S0(),g=Lm(Mt=>Mt.addToast),[w,x]=F.useState(null),[v,C]=F.useState(!0),[E,A]=F.useState(null),[M,I]=F.useState("idle"),[D,P]=F.useState(aLe((n==null?void 0:n.status)??"pending")),R=F.useRef(null),z=F.useRef(0),U=(w==null?void 0:w.status)??(n==null?void 0:n.status)??"pending",W=(w==null?void 0:w.prompt)??(n==null?void 0:n.prompt)??"",G=(w==null?void 0:w.renderedPrompt)??null,Y=(w==null?void 0:w.result)??"",te=(w==null?void 0:w.startedAt)??(n==null?void 0:n.startedAt),Q=(w==null?void 0:w.completedAt)??(n==null?void 0:n.completedAt),se=(w==null?void 0:w.durationMs)??(n==null?void 0:n.durationMs),ce=(w==null?void 0:w.model)??(n==null?void 0:n.model)??null,V=(w==null?void 0:w.threadId)??(n==null?void 0:n.threadId)??null,ae=(w==null?void 0:w.inputTokens)??(n==null?void 0:n.inputTokens),de=(w==null?void 0:w.outputTokens)??(n==null?void 0:n.outputTokens),ee=(w==null?void 0:w.costUsd)??(n==null?void 0:n.costUsd),ue=(w==null?void 0:w.error)??null,he=(w==null?void 0:w.logs)??[],ge=(w==null?void 0:w.childTasks)??[],oe=(w==null?void 0:w.parentTaskId)??null,Ae=w==null?void 0:w.mode,Te=w==null?void 0:w.crewxVersion,ve=w==null?void 0:w.pid,Ve=(w==null?void 0:w.metadata)??null,at=typeof(Ve==null?void 0:Ve.provider)=="string"?Ve.provider:void 0,yt=Y6r(t,n,w),Nt=F.useMemo(()=>{const Mt=(w==null?void 0:w.toolUsage)??{};return Object.entries(Mt).map(([vn,er])=>({tool:vn,count:er})).sort((vn,er)=>er.count-vn.count)},[w==null?void 0:w.toolUsage]),pt=F.useMemo(()=>[uK(ce??void 0,c)||"-",V6r(ae,de),K6r(ee),Te?`v${Te.replace(/^v/i,"")}`:null].filter(Boolean).join(" · "),[ee,Te,ae,ce,de,c]),St=F.useCallback(async(Mt=!0)=>{if(R.current){await R.current;return}const vn=++z.current;Mt&&C(!0);const er=(async()=>{try{const Mn=await wn.getTaskStatus(t,{include:"logs,children",skipRequestLog:!0});if(vn!==z.current)return;x(Mn),A(null)}catch(Mn){if(vn!==z.current)return;A(Mn instanceof Error?Mn.message:"Failed to load task details")}finally{vn===z.current&&Mt&&C(!1),vn===z.current&&(R.current=null)}})();R.current=er,await er},[t]);F.useEffect(()=>{z.current+=1,R.current=null,x(null),C(!0),A(null),I("idle"),P(aLe((n==null?void 0:n.status)??"pending")),St(!0)},[St,n==null?void 0:n.status,t]),F.useEffect(()=>{!n&&w&&P(aLe(w.status))},[w,n]),F.useEffect(()=>{if(M!=="confirming")return;const Mt=window.setTimeout(()=>{I("idle")},3e3);return()=>window.clearTimeout(Mt)},[M]);const Bt=F.useMemo(()=>({"task.logged":Mt=>{Mt.taskId===t&&St(!1)},"task.updated":Mt=>{Mt.taskId===t&&St(!1)}}),[St,t]);kR(u,Bt),SHe(()=>St(!1),{interval:5e3,enabled:U==="running"});const bt=F.useCallback(async(Mt,vn)=>{var er;try{if(!((er=navigator.clipboard)!=null&&er.writeText))throw new Error("Clipboard unavailable");await navigator.clipboard.writeText(Mt),g({type:"success",message:c(vn)})}catch(Mn){console.error("[TaskDetailPanel] Failed to copy text.",Mn),g({type:"error",message:c("tasks.panel.copyFailed")})}},[g,c]),dn=F.useCallback(async()=>{if(M!=="stopping"){if(M==="idle"){I("confirming");return}I("stopping");try{await wn.stopTask(t),await Promise.all([Promise.resolve(o==null?void 0:o()),St(!1)]),I("idle")}catch(Mt){console.error("[TaskDetailPanel] Failed to stop task.",Mt),g({type:"error",message:c("tasks.panel.stopFailed")}),I("idle")}}},[g,St,o,M,c,t]);return S.jsx(S.Fragment,{children:S.jsxs("aside",{role:"dialog","aria-label":c("tasks.panel.title"),className:"flex h-full w-full min-w-0 flex-col border-l border-gray-200 bg-white shadow-lg",children:[S.jsx("div",{className:"sticky top-0 z-10 border-b border-gray-200 bg-white p-4",children:S.jsxs("div",{className:"flex items-start gap-3",children:[S.jsx(G6,{provider:at,size:18,className:"h-11 w-11"}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsxs("div",{className:"flex items-start justify-between gap-3",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("p",{className:"truncate text-lg font-semibold text-gray-900",children:yt}),S.jsx("p",{className:"truncate font-mono text-xs text-gray-400",children:t})]}),S.jsx("button",{type:"button",onClick:i,className:"rounded-md p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600","aria-label":c("tasks.panel.close"),children:S.jsx(Op,{size:16})})]}),S.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[S.jsx(r$e,{status:U}),S.jsx(X6r,{mode:Ae}),S.jsx("span",{className:"text-sm font-medium text-gray-600",children:J6r(se,U)}),U==="running"&&typeof ve=="number"&&S.jsx("span",{className:"text-xs text-gray-500",children:`PID ${ve}`}),U==="running"&&S.jsx("button",{type:"button",onClick:()=>void dn(),disabled:M==="stopping",className:"inline-flex min-w-[108px] items-center justify-center gap-1.5 rounded-md border border-red-200 bg-red-50 px-3 py-1.5 text-xs font-semibold text-red-700 transition-colors hover:bg-red-100 disabled:cursor-not-allowed disabled:opacity-70",children:M==="stopping"?S.jsxs(S.Fragment,{children:[S.jsx(Is,{size:12,className:"animate-spin"}),S.jsx("span",{children:c("tasks.panel.stopping")})]}):M==="confirming"?S.jsx("span",{children:c("tasks.panel.stopConfirm")}):S.jsxs(S.Fragment,{children:[S.jsx(qJ,{size:12}),S.jsx("span",{children:c("tasks.panel.stop")})]})})]}),S.jsx("p",{className:"mt-3 text-sm text-gray-600",children:pt}),S.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-gray-500",children:[S.jsx("span",{children:`${AUt(te)} → ${AUt(Q)}`}),V?S.jsxs("button",{type:"button",onClick:()=>f(`/threads/${V}`),className:"inline-flex items-center gap-1 font-medium text-blue-600 transition-colors hover:text-blue-700",children:[S.jsx(gWn,{size:13}),S.jsx("span",{children:c("tasks.panel.viewThread")})]}):S.jsx("span",{className:"text-gray-400",children:c("tasks.panel.noThread")})]}),oe&&a&&S.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs text-gray-500",children:[S.jsx(sJt,{size:14}),S.jsx("span",{children:c("tasks.panel.parentLabel")}),S.jsxs("button",{type:"button",onClick:()=>a(oe),className:"font-medium text-blue-500 transition-colors hover:underline",children:["#",oe]})]})]})]})}),S.jsxs("div",{className:"flex-1 space-y-3 overflow-y-auto p-4",children:[U==="failed"&&ue&&S.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:[S.jsx(wc,{size:16,className:"mt-0.5 shrink-0"}),S.jsx("span",{children:ue})]}),E&&S.jsxs("div",{className:"rounded-lg border border-red-200 bg-white p-4 shadow-sm",children:[S.jsxs("div",{className:"flex items-start gap-3 text-sm text-red-700",children:[S.jsx(wc,{size:16,className:"mt-0.5 shrink-0"}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsx("p",{className:"font-medium",children:c("tasks.panel.detailLoadError")}),S.jsx("p",{className:"mt-1 break-words text-xs text-red-600",children:E})]})]}),S.jsx("button",{type:"button",onClick:()=>void St(!0),className:"mt-3 rounded-md bg-red-100 px-3 py-1.5 text-xs font-medium text-red-700 transition-colors hover:bg-red-200",children:c("tasks.panel.retryDetail")})]}),W&&S.jsx(MUt,{title:c("tasks.panel.request"),content:W,open:D.prompt,onToggle:()=>P(Mt=>({...Mt,prompt:!Mt.prompt})),onCopy:()=>void bt(W,"tasks.panel.copyRequestSuccess")}),G&&S.jsx(Q6r,{title:c("tasks.panel.renderedPrompt"),content:G,open:D.renderedPrompt,onToggle:()=>P(Mt=>({...Mt,renderedPrompt:!Mt.renderedPrompt})),onCopy:()=>void bt(G,"tasks.panel.copyRenderedPromptSuccess")}),v&&!w&&S.jsxs("div",{className:"space-y-3 rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[S.jsx("div",{className:"h-4 w-32 animate-pulse rounded bg-gray-200"}),S.jsx("div",{className:"h-4 w-full animate-pulse rounded bg-gray-100"}),S.jsx("div",{className:"h-4 w-4/5 animate-pulse rounded bg-gray-100"})]}),Y&&S.jsx(MUt,{title:c("tasks.panel.result"),content:Y,open:D.result,onToggle:()=>P(Mt=>({...Mt,result:!Mt.result})),onCopy:()=>void bt(Y,"tasks.panel.copyResultSuccess"),clampLines:5}),!v&&U==="pending"&&!Y&&S.jsxs("section",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:[S.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:c("tasks.panel.pendingTitle")}),S.jsx("p",{className:"mt-2 text-sm text-gray-500",children:c("tasks.panel.pendingDescription")})]}),Nt.length>0&&S.jsx(q6r,{stats:Nt,open:D.toolUsage,onToggle:()=>P(Mt=>({...Mt,toolUsage:!Mt.toolUsage}))}),(he.length>0||U==="running"||U==="failed")&&S.jsx(Dze,{logs:he,childTasks:ge,status:U}),ge.length>0&&S.jsx(Z6r,{childTasks:ge,onSelectTask:a}),Ve&&S.jsxs("section",{className:"rounded-lg border border-gray-200 bg-white shadow-sm",children:[S.jsx("div",{className:"flex items-start justify-between gap-3 border-b border-gray-200 px-4 py-3",children:S.jsxs("button",{type:"button",onClick:()=>P(Mt=>({...Mt,metadata:!Mt.metadata})),"aria-expanded":D.metadata,className:"flex min-w-0 flex-1 items-center gap-2 text-left",children:[D.metadata?S.jsx(vg,{size:16,className:"shrink-0 text-gray-400"}):S.jsx(vx,{size:16,className:"shrink-0 text-gray-400"}),S.jsx("span",{className:"truncate text-sm font-semibold text-gray-900",children:"Metadata"})]})}),D.metadata&&S.jsx("div",{className:"px-4 py-3",children:S.jsx("pre",{className:"max-h-60 overflow-auto rounded bg-muted p-3 text-xs",children:JSON.stringify(Ve,null,2)})})]})]})]})})}const tAr=["pending","running","success","failed"];function nAr(t,n){const i=(t??0)+(n??0);return i===0?"-":i>=1e6?`${(i/1e6).toFixed(1)}M`:i>=1e3?`${(i/1e3).toFixed(1)}k`:String(i)}function rAr(t,n){if(n==="running"||t==null)return"—";const i=t/1e3;if(i<60)return`${i.toFixed(1).replace(/\.0$/,"")}초`;if(i<3600){const c=Math.floor(i/60),u=Math.round(i%60);return u>0?`${c}분 ${u}초`:`${c}분`}const o=Math.floor(i/3600),a=Math.round(i%3600/60);return a>0?`${o}시간 ${a}분`:`${o}시간`}function iAr(t,n){const i=new Date(t),o=Date.now()-i.getTime(),a=Math.floor(o/6e4);if(a<1)return n("tasks.relative.justNow");if(a<60)return n("tasks.relative.minutesAgo",{count:a});const c=Math.floor(a/60);return c<24?n("tasks.relative.hoursAgo",{count:c}):new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(i)}function sAr({status:t}){const{t:n}=Zn(),i={success:"bg-green-100 text-green-800",failed:"bg-red-100 text-red-800",running:"bg-yellow-100 text-yellow-800",pending:"bg-gray-100 text-gray-800"};return S.jsx("span",{className:`inline-flex items-center rounded-full px-2.5 py-1 text-xs font-medium ${i[t]}`,children:n(`tasks.status.${t}`)})}function NUt({label:t,options:n,selectedValues:i,allLabel:o,getOptionLabel:a,onChange:c}){const u=i.length===0?o:i.length===1?a(i[0]):`${t} (${i.length})`;return S.jsxs("details",{className:"relative min-w-[160px]",children:[S.jsxs("summary",{className:"flex h-10 cursor-pointer list-none items-center justify-between gap-2 rounded-lg border border-gray-200 bg-white px-3 text-sm text-gray-700 shadow-sm transition-colors hover:border-gray-300",children:[S.jsx("span",{className:"truncate",children:u}),S.jsx(vg,{size:16,className:"shrink-0 text-gray-400"})]}),S.jsx("div",{className:"absolute right-0 z-20 mt-2 w-full min-w-[180px] rounded-lg border border-gray-200 bg-white p-2 shadow-lg",children:S.jsx("div",{className:"max-h-60 overflow-y-auto",children:n.map(f=>{const g=i.includes(f);return S.jsxs("label",{className:"flex cursor-pointer items-center justify-between gap-3 rounded-md px-2 py-2 text-sm text-gray-700 transition-colors hover:bg-gray-50",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded border-gray-300 text-blue-500 focus:ring-blue-500",checked:g,onChange:()=>{c(g?i.filter(w=>w!==f):[...i,f])}}),S.jsx("span",{children:a(f)})]}),g&&S.jsx(xg,{size:14,className:"text-blue-500"})]},f)})})})]})}function oAr(t){return t?"hidden":""}function aAr(t,n){return n?t.find(i=>i.taskId===n)??null:null}function lAr(){const{t}=Zn(),{setPageHeader:n}=Sd(),{slug:i}=Ff(),[o,a]=KJ(),{tasks:c,total:u,page:f,limit:g,loading:w,error:x,searchQuery:v,agentFilter:C,statusFilter:E,availableAgents:A,fetchTasks:M,setTasks:I,setPage:D,setSearchQuery:P,setAgentFilter:R,setStatusFilter:z,refresh:U}=qJt(),[W,G]=F.useState(v),Y=o.get("selected"),te=F.useMemo(()=>aAr(c,Y),[Y,c]),Q=oAr(Y),se=Y?5:7,ce=Math.max(1,Math.ceil(u/g)),V=F.useMemo(()=>{const oe=Math.max(1,f-2),Ae=Math.min(ce,oe+4),Te=Math.max(1,Ae-4);return Array.from({length:Ae-Te+1},(ve,Ve)=>Te+Ve)},[f,ce]),ae=F.useCallback(oe=>{a(Ae=>{const Te=new URLSearchParams(Ae);return oe?Te.set("selected",oe):Te.delete("selected"),Te})},[a]),de=F.useCallback(()=>U(),[U]),ee=F.useMemo(()=>c.map(oe=>`${oe.taskId}:${oe.status}`).join("|"),[c]),ue=F.useMemo(()=>({"task.updated":oe=>{I(Ae=>Ae.map(Te=>Te.taskId===oe.taskId?{...Te,status:oe.status}:Te))},"task.created":()=>{de()}}),[de,I]),{connected:he,lastEventAt:ge}=kR(i,ue);return Xan(de,{connected:he,lastEventAt:ge,fingerprint:()=>ee}),F.useEffect(()=>{n({title:t("tasks.title"),actions:S.jsx("button",{onClick:de,className:"rounded-lg p-2 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700",title:t("common.refresh"),children:S.jsx(y0,{size:16,className:w?"animate-spin":""})})})},[de,w,n,t]),F.useEffect(()=>{const oe=window.setTimeout(()=>{W!==v&&P(W)},300);return()=>window.clearTimeout(oe)},[W,v,P]),F.useEffect(()=>{M()},[C,M,f,v,E]),F.useEffect(()=>{if(!Y)return;const oe=Ae=>{Ae.key==="Escape"&&ae(null)};return window.addEventListener("keydown",oe),()=>window.removeEventListener("keydown",oe)},[Y,ae]),S.jsxs("div",{className:"space-y-5",children:[S.jsx("section",{className:"rounded-lg border border-gray-200 bg-white p-4 shadow-sm",children:S.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center",children:[S.jsxs("label",{className:"relative block w-full max-w-[280px]",children:[S.jsx(mC,{size:16,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),S.jsx("input",{type:"search",value:W,onChange:oe=>G(oe.target.value),placeholder:t("tasks.filters.searchPlaceholder"),className:"h-10 w-full rounded-lg border border-gray-200 bg-white pl-9 pr-3 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-100"})]}),S.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row",children:[S.jsx(NUt,{label:t("tasks.filters.agent"),options:A,selectedValues:C,allLabel:t("tasks.filters.allAgents"),getOptionLabel:oe=>oe,onChange:R}),S.jsx(NUt,{label:t("tasks.filters.status"),options:tAr,selectedValues:E,allLabel:t("tasks.filters.allStatuses"),getOptionLabel:oe=>t(`tasks.status.${oe}`),onChange:z})]})]})}),x&&S.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:[S.jsx(wc,{size:16,className:"shrink-0"}),S.jsx("span",{className:"flex-1",children:x}),S.jsx("button",{onClick:de,className:"rounded-md bg-red-100 px-3 py-1 text-xs font-medium text-red-700 transition-colors hover:bg-red-200",children:t("tasks.retry")})]}),S.jsxs("div",{className:"relative flex min-h-0 flex-col gap-5",children:[S.jsxs("section",{className:"min-w-0 flex-1 overflow-hidden rounded-lg border border-gray-200 bg-white shadow-sm",children:[S.jsx("div",{className:"overflow-x-auto",children:S.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[S.jsx("thead",{className:"bg-gray-50",children:S.jsxs("tr",{children:[S.jsx("th",{className:"w-[160px] px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-gray-500",children:t("tasks.columns.time")}),S.jsx("th",{className:`${Q} w-[200px] px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-gray-500`,children:t("tasks.columns.taskId")}),S.jsx("th",{className:"w-[140px] px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-gray-500",children:t("tasks.columns.agent")}),S.jsx("th",{className:"w-[80px] px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-gray-500",children:t("tasks.columns.status")}),S.jsx("th",{className:"w-[80px] px-4 py-3 text-right text-xs font-semibold uppercase tracking-wide text-gray-500",children:t("tasks.columns.duration")}),S.jsx("th",{className:`${Q} w-[160px] px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-gray-500`,children:t("tasks.columns.model")}),S.jsx("th",{className:"w-[90px] px-4 py-3 text-right text-xs font-semibold uppercase tracking-wide text-gray-500",children:t("tasks.columns.tokens")})]})}),S.jsx("tbody",{className:"divide-y divide-gray-200 bg-white",children:w&&c.length===0?S.jsx("tr",{children:S.jsx("td",{colSpan:se,className:"px-4 py-12 text-center text-sm text-gray-500",children:S.jsxs("div",{className:"inline-flex items-center gap-2",children:[S.jsx(y0,{size:16,className:"animate-spin text-gray-400"}),S.jsx("span",{children:t("tasks.loading")})]})})}):c.length===0?S.jsx("tr",{children:S.jsx("td",{colSpan:se,className:"px-4 py-14",children:S.jsxs("div",{className:"flex flex-col items-center justify-center text-center text-gray-400",children:[S.jsx(Hge,{size:36,className:"mb-3"}),S.jsx("p",{className:"text-sm font-medium text-gray-500",children:t("tasks.empty")}),S.jsx("p",{className:"mt-1 text-xs text-gray-400",children:t("tasks.emptyHint")})]})})}):c.map(oe=>{const Ae=Y===oe.taskId;return S.jsxs("tr",{"aria-selected":Ae,onClick:()=>ae(oe.taskId),className:`cursor-pointer transition-colors hover:bg-gray-50 ${Ae?"bg-blue-50":""}`,children:[S.jsx("td",{className:`px-4 py-3 text-sm text-gray-500 ${Ae?"border-l-2 border-l-blue-500 bg-blue-50":""}`,children:iAr(oe.startedAt,t)}),S.jsx("td",{className:`${Q} px-4 py-3 text-sm font-medium text-gray-900`,children:S.jsx("span",{className:"font-mono",title:oe.taskId,children:oe.taskId})}),S.jsx("td",{className:"px-4 py-3 text-sm font-medium text-gray-900",children:S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx(G6,{provider:oe.provider??void 0,size:16}),S.jsx("span",{children:oe.agentId})]})}),S.jsx("td",{className:"px-4 py-3 text-sm text-gray-700",children:S.jsx(sAr,{status:oe.status})}),S.jsx("td",{className:"px-4 py-3 text-right text-sm text-gray-700",children:rAr(oe.durationMs,oe.status)}),S.jsx("td",{className:`${Q} px-4 py-3 text-sm text-gray-700`,children:oe.model??"-"}),S.jsx("td",{className:"px-4 py-3 text-right text-sm text-gray-500 tabular-nums",children:nAr(oe.inputTokens,oe.outputTokens)})]},oe.taskId)})})]})}),S.jsxs("div",{className:"flex flex-col gap-3 border-t border-gray-200 px-4 py-4 sm:flex-row sm:items-center sm:justify-between",children:[S.jsx("p",{className:"text-sm text-gray-500",children:t("tasks.totalCount",{count:u})}),S.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[S.jsx("button",{onClick:()=>D(Math.max(1,f-1)),disabled:f<=1,className:"rounded-lg border border-gray-200 px-3 py-1.5 text-sm text-gray-600 transition-colors hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",children:t("tasks.pagination.previous")}),V.map(oe=>S.jsx("button",{onClick:()=>D(oe),className:`rounded-lg px-3 py-1.5 text-sm transition-colors ${oe===f?"bg-blue-500 text-white":"border border-gray-200 text-gray-600 hover:bg-gray-50"}`,children:oe},oe)),S.jsx("button",{onClick:()=>D(Math.min(ce,f+1)),disabled:f>=ce,className:"rounded-lg border border-gray-200 px-3 py-1.5 text-sm text-gray-600 transition-colors hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",children:t("tasks.pagination.next")})]})]})]}),Y&&S.jsx("div",{className:"fixed inset-y-0 right-0 z-40",children:S.jsx(Gge,{defaultWidth:400,minWidth:300,maxWidth:600,side:"left",panelKey:"taskDetail",children:S.jsx(eAr,{taskId:Y,task:te,onClose:()=>ae(null),onRefresh:U,onSelectTask:ae})})})]})]})}const jUt={경영진:bUn,개발팀:iJt,default:O9};function cAr({teamName:t,memberCount:n,isCollapsible:i=!1,isExpanded:o=!0,onToggle:a,className:c}){const{t:u}=Zn(),f=jUt[t]??jUt.default,g=o?vg:vx,w=S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg bg-gray-100 text-gray-600",children:S.jsx(f,{size:18})}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"text-sm font-semibold text-gray-900",children:t}),S.jsx("span",{className:"rounded-full bg-gray-100 px-2.5 py-1 text-xs font-medium text-gray-500",children:u("agent.team.memberCount",{count:n})})]})]}),i&&S.jsx(g,{size:16,className:"shrink-0 text-gray-400"})]});return i?S.jsx("button",{type:"button",onClick:a,"aria-expanded":o,"aria-label":u(o?"agent.team.collapse":"agent.team.expand",{team:t}),className:`flex w-full items-center justify-between gap-3 rounded-xl border border-gray-200 bg-white px-4 py-3 text-left transition-colors hover:border-gray-300 hover:bg-gray-50 ${c??""}`.trim(),children:w}):S.jsx("div",{role:"button","aria-expanded":!0,className:`flex w-full items-center justify-between gap-3 rounded-xl border border-gray-200 bg-white px-4 py-3 ${c??""}`.trim(),children:w})}const VG="__unassigned__";function uAr(t){var a,c;const n=new Map,i=[];for(const u of t){const f=((a=u.team)==null?void 0:a.trim())||VG;n.has(f)||(n.set(f,[]),i.push(f)),(c=n.get(f))==null||c.push(u)}const o=i.filter(u=>u!==VG);return n.has(VG)&&o.push(VG),o.map(u=>({teamKey:u,agents:n.get(u)??[],isUnassigned:u===VG}))}function dAr(t){const n=t.length<=5;return Object.fromEntries(t.map(i=>[i.teamKey,n]))}function fAr({agent:t,onClose:n,onConfirm:i,deleting:o,t:a}){return S.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:S.jsxs("div",{className:"mx-4 w-full max-w-sm rounded-xl bg-white shadow-xl",children:[S.jsxs("div",{className:"px-6 py-5",children:[S.jsx("h3",{className:"mb-2 text-base font-semibold text-gray-900",children:a("agent.deleteConfirmTitle")}),S.jsx("p",{className:"text-sm text-gray-600",children:a("agent.deleteConfirmMsg",{id:t.id,name:t.name})}),S.jsx("p",{className:"mt-2 text-xs text-red-500",children:a("agent.deleteWarning")})]}),S.jsxs("div",{className:"flex justify-end gap-2 px-6 pb-5",children:[S.jsx("button",{onClick:n,className:"rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200",children:a("agent.cancel")}),S.jsxs("button",{onClick:i,disabled:o,className:"flex items-center gap-2 rounded-lg bg-red-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-red-600 disabled:cursor-not-allowed disabled:opacity-40",children:[o?S.jsx(Is,{size:14,className:"animate-spin"}):S.jsx(kx,{size:14}),a("agent.delete")]})]})]})})}function hAr(){const{setPageHeader:t}=Sd(),n=S0(),{t:i}=Zn(),o=Zd(ae=>ae.currentWorkspaceId),a=Zc(ae=>ae.agents.expandedTeams),c=Zc(ae=>ae.set),u=km(ae=>ae.limits),f=km(ae=>ae.limitsLoading),g=km(ae=>ae.fetchLimits),[w,x]=F.useState([]),[v,C]=F.useState(!0),[E,A]=F.useState(null),[M,I]=F.useState(null),[D,P]=F.useState(!1),R=F.useMemo(()=>uAr(w),[w]),z=F.useMemo(()=>{if(v||E)return{};const ae=dAr(R);return R.reduce((de,ee)=>(de[ee.teamKey]=typeof a[ee.teamKey]=="boolean"?a[ee.teamKey]:ae[ee.teamKey],de),{})},[E,R,v,a]),U=u==null?void 0:u.agentsPerWorkspace,W=U!==void 0&&U!==-1&&w.length>=U,G=f||!u||W,Y=W&&u?i("limits.banner.agent.title",{current:w.length,limit:u.agentsPerWorkspace}):void 0,te=!v&&!E?i("agent.count",{count:w.length}):void 0,Q=F.useMemo(()=>S.jsxs("button",{type:"button",disabled:G,title:Y,onClick:()=>n("/agents/new"),className:`inline-flex items-center gap-1.5 rounded-xl px-3.5 py-2 text-sm font-semibold transition-colors ${G?"bg-gray-100 text-gray-400":"bg-blue-500 text-white hover:bg-blue-600"}`,children:[S.jsx(ef,{size:14}),i("agent.add")]}),[Y,G,i,n]),se=F.useCallback(async()=>{C(!0),A(null);try{const ae=await wn.getAgents();x(ae.agents)}catch(ae){A(ae instanceof Error?ae.message:i("agent.listError"))}finally{C(!1)}},[i]);F.useEffect(()=>{t({title:i("agent.management"),subtitle:te,actions:Q})},[Q,te,t,i]),F.useEffect(()=>{se()},[o]),F.useEffect(()=>{g().catch(()=>{})},[o,g]);const ce=F.useCallback(async()=>{if(M){P(!0);try{await wn.deleteAgent(M.id),I(null),await se()}catch(ae){alert(ae instanceof Error?ae.message:i("agent.deleteError"))}finally{P(!1)}}},[M,se,i]),V=F.useCallback(ae=>{c("agents",{expandedTeams:{[ae]:!z[ae]}})},[z,c]);return S.jsxs("div",{className:"mx-auto max-w-4xl",children:[!v&&!E&&W&&u?S.jsx("div",{className:"mb-6",children:S.jsx(Che,{resource:"agent",current:w.length,limit:u.agentsPerWorkspace})}):null,v&&S.jsx("div",{className:"flex items-center justify-center py-16",children:S.jsx(Is,{size:24,className:"animate-spin text-gray-400"})}),!v&&E&&S.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-red-200 bg-red-50 p-4 text-red-600",children:[S.jsx(wc,{size:18,className:"shrink-0"}),S.jsxs("div",{children:[S.jsx("p",{className:"text-sm font-medium",children:i("agent.loadFailTitle")}),S.jsx("p",{className:"mt-0.5 text-xs",children:E})]}),S.jsx("button",{onClick:se,className:"ml-auto text-xs text-red-500 underline hover:text-red-700",children:i("agent.retry")})]}),!v&&!E&&w.length===0&&S.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-gray-400",children:[S.jsx(O9,{size:40,className:"mb-3 opacity-30"}),S.jsx("p",{className:"text-sm font-medium",children:i("agent.emptyTitle")}),S.jsx("p",{className:"mt-1 text-xs",children:i("agent.emptyDesc")}),S.jsxs("button",{type:"button",disabled:G,title:Y,onClick:()=>n("/agents/new"),className:`mt-4 flex items-center gap-1.5 rounded-lg px-4 py-2 text-sm font-medium transition-colors ${G?"bg-gray-100 text-gray-400":"bg-blue-500 text-white hover:bg-blue-600"}`,children:[S.jsx(ef,{size:16}),i("agent.emptyAction")]})]}),!v&&!E&&w.length>0&&S.jsx("div",{className:"space-y-4",children:R.map(ae=>{const de=z[ae.teamKey]??R.length<=5;return S.jsx("section",{children:S.jsxs("div",{className:"overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm",children:[S.jsx(cAr,{teamName:ae.isUnassigned?i("agent.team.unassigned"):ae.teamKey,memberCount:ae.agents.length,isCollapsible:!0,isExpanded:de,onToggle:()=>V(ae.teamKey),className:"rounded-none border-0 border-b border-gray-100 bg-transparent px-5 py-4 shadow-none hover:border-gray-100 hover:bg-gray-50"}),S.jsx("div",{className:"grid transition-[grid-template-rows,opacity] duration-300 ease-out",style:{gridTemplateRows:de?"1fr":"0fr",opacity:de?1:.7},children:S.jsx("div",{className:"min-h-0 overflow-hidden",children:S.jsx("div",{className:"divide-y divide-gray-100",children:ae.agents.map(ee=>{var he,ge,oe;const ue=[ee.role,kfe(ee.provider,i),uK(ee.model,i)].filter(Boolean).join(" · ");return S.jsxs("div",{className:"group flex items-center gap-4 px-5 py-4 transition-colors hover:bg-gray-50",children:[S.jsxs("div",{className:"relative shrink-0",children:[S.jsx(G6,{provider:ee.provider,size:18,className:"h-10 w-10 rounded-full border border-gray-200 bg-white"}),((he=ee.provider)==null?void 0:he.startsWith("remote/"))&&S.jsx("div",{className:`absolute -bottom-1 -right-1 flex h-5 w-5 items-center justify-center rounded-full border border-white ${(ge=ee.providerLocation)!=null&&ge.startsWith("file://")?"bg-gray-600":"bg-gray-700"}`,children:(oe=ee.providerLocation)!=null&&oe.startsWith("file://")?S.jsx(XUn,{size:11,className:"text-gray-300"}):S.jsx(uUn,{size:11,className:"text-blue-300"})})]}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"truncate text-sm font-semibold text-gray-900",children:ee.name}),S.jsxs("span",{className:"truncate text-xs text-gray-400",children:["@",ee.id]})]}),ue&&S.jsx("p",{className:"mt-0.5 truncate text-xs text-gray-500",children:ue}),ee.description&&S.jsx("p",{className:"mt-0.5 truncate text-xs text-gray-400",children:ee.description})]}),S.jsxs("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[S.jsxs("button",{onClick:()=>n(`/agents/new?from=${encodeURIComponent(ee.id)}`),className:"flex items-center gap-1.5 rounded-lg bg-blue-50 px-3 py-1.5 text-xs font-medium text-blue-700 transition-colors hover:bg-blue-100",children:[S.jsx(x5,{size:13}),i("agent.duplicate")]}),S.jsxs("button",{onClick:()=>n(`/agents/${ee.id}/edit`),className:"flex items-center gap-1.5 rounded-lg bg-gray-100 px-3 py-1.5 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-200",children:[S.jsx(oqn,{size:13}),i("agent.edit")]}),S.jsxs("button",{onClick:()=>I(ee),className:"flex items-center gap-1.5 rounded-lg bg-red-50 px-3 py-1.5 text-xs font-medium text-red-600 transition-colors hover:bg-red-100",children:[S.jsx(kx,{size:13}),i("agent.delete")]})]})]},ee.id)})})})})]})},ae.teamKey)})}),M&&S.jsx(fAr,{agent:M,onClose:()=>I(null),onConfirm:ce,deleting:D,t:i})]})}const pAr="선택 가능한 항목이 없습니다",gAr="검색 결과가 없습니다";function CV({options:t,value:n,onChange:i,placeholder:o,disabled:a=!1,invalid:c=!1,clearable:u=!1,clearLabel:f,label:g,className:w,searchable:x=!1,searchPlaceholder:v,emptyOptionsLabel:C=pAr,noSearchResultsLabel:E=gAr}){const A=F.useRef(null),M=F.useRef(null),I=F.useRef([]),D=F.useId(),P=F.useId(),R=t.findIndex(Te=>Te.id===n),z=R>=0?t[R]:void 0,[U,W]=F.useState(!1),[G,Y]=F.useState(""),[te,Q]=F.useState(R>=0?R:0),se=G.trim().toLowerCase(),ce=F.useMemo(()=>se?t.filter(Te=>{var ve;return Te.label.toLowerCase().includes(se)?!0:((ve=Te.description)==null?void 0:ve.toLowerCase().includes(se))??!1}):t,[se,t]),V=ce.findIndex(Te=>Te.id===n),ae=u&&!a&&!!z;F.useEffect(()=>{if(!U){Y("");return}const Te=V>=0?V:0;Q(Te)},[V,U]),F.useEffect(()=>{if(!U)return;const Te=ve=>{var Ve;(Ve=A.current)!=null&&Ve.contains(ve.target)||W(!1)};return document.addEventListener("mousedown",Te),()=>document.removeEventListener("mousedown",Te)},[U]),F.useEffect(()=>{if(!U||ce.length===0)return;const Te=I.current[te];Te&&typeof Te.scrollIntoView=="function"&&Te.scrollIntoView({block:"nearest"})},[ce.length,te,U]),F.useEffect(()=>{var Te;!U||!x||(Te=M.current)==null||Te.focus()},[U,x]),F.useEffect(()=>{te<ce.length||Q(Math.max(ce.length-1,0))},[ce.length,te]);const de=(z==null?void 0:z.label)??o??C,ee=g??(z==null?void 0:z.label)??o??C,ue=U&&ce[te]?`${P}-option-${ce[te].id}`:void 0,he=()=>{a||(Q(V>=0?V:0),W(!0))},ge=Te=>{if(!(a||ce.length===0)){if(!U){W(!0),Q(V>=0?V:Te>0?0:ce.length-1);return}Q(ve=>(ve+Te+ce.length)%ce.length)}},oe=Te=>{const ve=ce[Te];ve&&(i(ve.id),W(!1))},Ae=Te=>{if(a)return;const ve=x&&Te.target===M.current;if(Te.key==="Escape"){U&&(Te.preventDefault(),W(!1));return}if(Te.key==="ArrowDown"){Te.preventDefault(),ge(1);return}if(Te.key==="ArrowUp"){Te.preventDefault(),ge(-1);return}if(!(Te.key===" "&&ve)&&!(Te.key!=="Enter"&&Te.key!==" ")){if(Te.preventDefault(),!U){he();return}if(ce.length===0){W(!1);return}oe(te)}};return S.jsxs("div",{ref:A,onKeyDown:Ae,className:["relative",w].filter(Boolean).join(" "),children:[S.jsxs("button",{id:D,type:"button",disabled:a,"aria-invalid":c||void 0,"aria-label":ee,"aria-controls":P,"aria-expanded":U,"aria-haspopup":"listbox","aria-activedescendant":ue,onClick:()=>{a||W(Te=>(Te||Q(V>=0?V:0),!Te))},className:["flex min-h-[42px] w-full items-center justify-between gap-2 rounded-lg border px-3 py-2.5 text-left text-sm shadow-sm outline-none transition",ae?"pr-16":"","bg-[var(--settings-control-bg)] text-[var(--settings-text)]",c?"border-red-400 focus:border-red-500 focus:ring-2 focus:ring-red-500/20":"border-[var(--settings-border)] focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20",a?"cursor-not-allowed opacity-60":c?"hover:border-red-500":"hover:border-blue-400"].join(" "),children:[S.jsx("span",{className:["min-w-0 flex-1 truncate",z?"text-[var(--settings-text)]":"text-[var(--settings-muted)]"].join(" "),children:de}),U?S.jsx(YHn,{size:16,className:"shrink-0 text-[var(--settings-muted)]","aria-hidden":"true"}):S.jsx(vg,{size:16,className:"shrink-0 text-[var(--settings-muted)]","aria-hidden":"true"})]}),ae?S.jsx("button",{type:"button","aria-label":f??g??o??C,onMouseDown:Te=>{Te.preventDefault(),Te.stopPropagation()},onClick:Te=>{Te.preventDefault(),Te.stopPropagation(),i(""),W(!1)},className:"absolute right-8 top-1/2 inline-flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full text-[var(--settings-muted)] transition hover:bg-gray-200 hover:text-[var(--settings-text)]",children:S.jsx(Op,{size:12,"aria-hidden":"true"})}):null,U?S.jsxs("div",{id:P,role:"listbox","aria-labelledby":D,className:"absolute left-0 top-[calc(100%+0.25rem)] z-20 max-h-64 w-full overflow-y-auto rounded-lg border border-[var(--settings-border)] bg-[var(--settings-card-bg)] shadow-lg",children:[x?S.jsxs("label",{className:"flex items-center gap-2 border-b border-[var(--settings-border)] px-3 py-2 text-[var(--settings-muted)]",children:[S.jsx(mC,{size:14,className:"shrink-0","aria-hidden":"true"}),S.jsx("input",{ref:M,value:G,onChange:Te=>{Y(Te.target.value),Q(0)},className:"w-full bg-transparent text-sm text-[var(--settings-text)] outline-none placeholder:text-[var(--settings-muted)]","aria-label":v??g??o??C,placeholder:v??o})]}):null,t.length===0?S.jsx("div",{className:"px-3 py-3 text-sm text-[var(--settings-muted)]",children:C}):ce.length===0?S.jsx("div",{className:"px-3 py-3 text-sm text-[var(--settings-muted)]",children:E}):ce.map((Te,ve)=>{const Ve=Te.id===n,at=ve===te;return S.jsxs("button",{ref:yt=>{I.current[ve]=yt},id:`${P}-option-${Te.id}`,type:"button",role:"option","aria-selected":Ve,onMouseEnter:()=>Q(ve),onClick:()=>oe(ve),className:["flex w-full items-start gap-3 border-b border-[var(--settings-border)] px-3 py-2.5 text-left transition last:border-b-0",at?"bg-blue-50":"bg-transparent"].join(" "),children:[S.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center pt-0.5",children:Ve?S.jsx(xg,{size:14,className:"text-blue-500","aria-hidden":"true"}):null}),S.jsxs("span",{className:"min-w-0 flex-1",children:[S.jsx("span",{className:"block text-[13px] font-medium leading-5 text-[var(--settings-text)]",children:Te.label}),Te.description?S.jsx("span",{className:"mt-0.5 block text-[12px] leading-4 text-[var(--settings-muted)]",children:Te.description}):null]})]},Te.id)})]}):null]})}const mAr=F.lazy(()=>Cl(()=>import("./PromptTab-D0HHJwEv.js"),__vite__mapDeps([]))),bAr=new Set(["auto"]),DUt=["cli/antigravity"];function wAr(t){return t.trim()?t:""}function Zan(t){return{include:[...t]}}function IUt(t){if(!t)return;const n=Object.entries(t).filter(([,i])=>typeof i=="string"?i.trim().length>0:i!==void 0);return n.length>0?Object.fromEntries(n):void 0}function yAr(t){if(!t)return;const n={};for(const[a,c]of Object.entries(t))a==="query"||a==="execute"||(n[a]=c);const i=IUt(t.query);i&&(n.query=i);const o=IUt(t.execute);return o&&(n.execute=o),Object.keys(n).length>0?n:void 0}function xAr(t,n){return{id:t.id.trim(),name:t.name.trim(),role:t.role.trim(),team:t.team.trim(),description:t.description.trim(),provider:M6(t.provider)||void 0,model:t.model||void 0,prompt:wAr(t.prompt),skills:Zan(n),options:yAr(t.options)}}function OUt(t){return typeof t=="object"&&t!==null}function vAr(t){if(!(t instanceof bd))return"UNKNOWN";if(OUt(t.body)){if(typeof t.body.code=="string")return t.body.code;if(OUt(t.body.error)&&typeof t.body.error.code=="string")return t.body.error.code}return"UNKNOWN"}function kAr(t,n,i){const o=i("agent.validation.required"),a={};return t.id.trim()||(a.id=o),t.name.trim()||(a.name=o),M6(t.provider)||(a.provider=o),n&&!t.model.trim()&&(a.model=o),a}function LUt(){var ht;const t=S0(),{agentId:n}=Ff(),[i]=KJ(),{setPageHeader:o}=Sd(),{t:a}=Zn(),c=Zd(ft=>ft.currentWorkspaceId),u=Lm(ft=>ft.addToast),f=((ht=i.get("from"))==null?void 0:ht.trim())||null,g=!!n,w=!g&&!!f,x=!g&&!w,v=n??f,{form:C,skills:E,activeTab:A,selectedTemplateId:M,goalsEnabled:I,goalsMode:D,goalsFiles:P,dailyEnabled:R,setActiveTab:z,setField:U,setProvider:W,setOption:G,setSkillsInclude:Y,setGoalsEnabled:te,setGoalsMode:Q,setGoalsFiles:se,setDailyEnabled:ce,initializeBlank:V,initializeFromAgent:ae,applyTemplate:de,reset:ee}=z6r(),[ue,he]=F.useState(!!v),[ge,oe]=F.useState(!1),[Ae,Te]=F.useState(null),[ve,Ve]=F.useState(null),[at,yt]=F.useState([]),[Nt,pt]=F.useState(!0),[St,Bt]=F.useState(null),[bt,dn]=F.useState(!1),[Mt,vn]=F.useState(0),[er,Mn]=F.useState([]),[yi,hr]=F.useState(!0),[io,oi]=F.useState(null),[on,ei]=F.useState(0),[Ar,bi]=F.useState({}),[ds,ct]=F.useState([]),[jt,Sn]=F.useState(!1),[yr,Lr]=F.useState(!1),gn=C.provider.startsWith("remote/"),ti=g&&gn,Zt=F.useMemo(()=>{if(g&&n)return`@${n}`;if(w&&f)return`@${f}`},[n,w,g,f]),qr=F.useMemo(()=>{if(!(ue||Ae))return S.jsxs("button",{type:"submit",form:"agent-form",disabled:ge,className:"inline-flex items-center gap-2 rounded-lg bg-blue-500 px-5 py-2.5 text-sm font-medium text-white transition hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-40",children:[ge?S.jsx(Is,{size:15,className:"animate-spin"}):S.jsx(jFe,{size:15}),a(g?"agent.save":"agent.add")]})},[Ae,g,ue,ge,a]),_r=F.useMemo(()=>at.find(ft=>ft.id===M6(C.provider))??null,[C.provider,at]),ks=M6(C.provider),$a=!!ks&&!DUt.includes(ks),Oo=fde(C.options,"query","mode"),Zh=fde(C.options,"execute","mode"),Fl=fde(C.options,"query","effort"),ui=fde(C.options,"execute","effort"),Et=F.useMemo(()=>{const ft=at.map(Ir=>({id:Ir.id,label:Ir.name}));for(const Ir of DUt)ft.some(bo=>bo.id===Ir)||ft.push({id:Ir,label:kfe(Ir,a)});if(!C.provider)return ft;const yn=M6(C.provider);return ft.some(Ir=>Ir.id===yn)?ft:[{id:yn,label:kfe(yn,a)},...ft]},[C.provider,at,a]),Cn=F.useMemo(()=>{const ft=((_r==null?void 0:_r.models)??[]).map(yn=>({id:yn.id,label:yn.name??uK(yn.id,a),description:yn.description}));return!C.model||ft.some(yn=>yn.id===C.model)?ft:[{id:C.model,label:uK(C.model,a)||C.model},...ft]},[C.model,_r,a]),ai=F.useMemo(()=>{const ft=((_r==null?void 0:_r.modes)??[]).map(yn=>({id:yn.id,label:yn.name??yn.id,description:yn.description}));for(const yn of[Oo,Zh])!yn||ft.some(Ir=>Ir.id===yn)||ft.push({id:yn,label:yn,description:void 0});return ft},[Zh,Oo,_r]),di=F.useMemo(()=>{const ft=((_r==null?void 0:_r.effort)??[]).map(yn=>({id:yn,label:yn}));for(const yn of[Fl,ui])!yn||ft.some(Ir=>Ir.id===yn)||ft.push({id:yn,label:yn});return ft},[ui,Fl,_r]),ni=bAr.has(C.model),Xr=(((_r==null?void 0:_r.effort)??[]).length>0||!!(Fl||ui))&&!ni,vu=!ti&&Nt,Ed=!ti&&!!St,Xs=!ti&&$a,El=Xs&&(Nt||!!St),Lc=F.useMemo(()=>er.filter(ft=>ft.source!=="builtin"),[er]);F.useEffect(()=>{o({title:a(g?"agent.edit":"agent.add"),subtitle:Zt,actions:qr})},[qr,g,Zt,o,a]),F.useEffect(()=>()=>ee(),[ee]),F.useEffect(()=>{ni&&(Fl&&G("query","effort",""),ui&&G("execute","effort",""))},[ui,ni,Fl,G]);const mh=F.useCallback(ft=>{ae(ft,{clearIdentity:w,skills:ft.skills})},[ae,w]);F.useEffect(()=>{let ft=!1;return(async()=>{if(Te(null),!v){V(),he(!1);return}he(!0);try{const Ir=await wn.getAgents();if(ft)return;const bo=Ir.agents.find(Za=>Za.id===v);if(!bo){Te(a("agent.notFound"));return}mh(bo)}catch(Ir){if(ft)return;Te(Ir instanceof Error?Ir.message:a(w?"agent.duplicateError":"agent.loadError"))}finally{ft||he(!1)}})(),()=>{ft=!0}},[c,mh,V,w,v]),F.useEffect(()=>{let ft=!1;return(async()=>{pt(!0),Bt(null);try{const Ir=await wn.getProviders();if(ft)return;yt(Ir)}catch(Ir){if(ft)return;Bt(Ir instanceof Error?Ir.message:a("agent.loadError"))}finally{ft||pt(!1)}})(),()=>{ft=!0}},[c,Mt]),F.useEffect(()=>{if(!Nt){dn(!1);return}dn(!1);const ft=window.setTimeout(()=>{dn(!0)},5e3);return()=>{window.clearTimeout(ft)}},[Nt,Mt]),F.useEffect(()=>{let ft=!1;return(async()=>{hr(!0),oi(null);try{const Ir=await wn.getInstalledMarkets();if(ft)return;Mn(Ir.items)}catch(Ir){if(ft)return;oi(Ir instanceof Error?Ir.message:a("agent.skills.loadError"))}finally{ft||hr(!1)}})(),()=>{ft=!0}},[on]),F.useEffect(()=>{let ft=!1;return(async()=>{Sn(!0);try{const Ir=await wn.getGoals({status:"active"});ft||ct(Ir.goals)}catch{}finally{ft||Sn(!1)}})(),()=>{ft=!0}},[c]);const nu=F.useCallback(ft=>{const yn=E.include.includes(ft)?E.include.filter(Ir=>Ir!==ft):[...E.include,ft];Y(yn)},[Y,E.include]),Vu=F.useCallback(ft=>{bi(yn=>{let Ir=!1;const bo={...yn};for(const Za of ft)Za in bo&&(delete bo[Za],Ir=!0);return Ir?bo:yn})},[]),_d=ft=>yn=>{U(ft,yn.target.value),(ft==="id"||ft==="name")&&Vu([ft])},Sg=ft=>{de(ft),bi({})},A0=F.useCallback(ft=>{W(ft),Vu(["provider","model"])},[Vu,W]),NC=F.useCallback(()=>{vn(ft=>ft+1)},[]),Lp=F.useCallback((ft,yn)=>Ir=>{G(ft,yn,Ir)},[G]),nk=async ft=>{ft.preventDefault(),Ve(null);const yn=kAr(C,$a,a);if(Object.keys(yn).length>0){bi(yn),z("basic");return}bi({}),oe(!0);try{const Ir={...C.options};I&&(Ir.goals=D==="all"?!0:P.length===1?P[0]:[...P]),R&&(Ir.daily=!0);const bo=xAr({...C,options:Ir},E.include);if(g&&n){const Za={name:bo.name,role:bo.role,team:bo.team,description:bo.description,provider:bo.provider,model:bo.model,prompt:bo.prompt,skills:Zan(E.include),options:bo.options};await wn.updateAgent(n,Za)}else await wn.createAgent(bo);t("/agents")}catch(Ir){const bo=vAr(Ir);if(!g&&bo==="AGENT_LIMIT_EXCEEDED"){Ve(bo),u({type:"error",duration:1e4,message:S.jsxs("div",{className:"space-y-2",children:[S.jsx("div",{children:a("agent.createError.AGENT_LIMIT_EXCEEDED")}),S.jsx("a",{href:khe,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center text-sm font-medium text-red-700 underline underline-offset-2 transition-colors hover:text-red-800",children:a("upgrade.waitlistCta")})]})});return}alert(Ir instanceof Error?Ir.message:a("agent.saveError"))}finally{oe(!1)}},Eg="w-full rounded-lg border border-gray-300 bg-white px-3 py-2.5 text-sm text-gray-900 placeholder-gray-400 shadow-sm transition focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20",Fw="bg-gray-100 text-gray-500 cursor-not-allowed",Bw="border-red-400 focus:border-red-500 focus:ring-red-500/20",_g="mb-1.5 block text-sm font-medium text-gray-700",Mi="rounded-xl border border-gray-200 bg-white p-6 shadow-sm";return ue?S.jsx("div",{className:"flex items-center justify-center py-24",children:S.jsx(Is,{size:28,className:"animate-spin text-gray-400"})}):Ae?S.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-8",children:[S.jsx("p",{className:"text-sm text-red-500",children:Ae}),S.jsx("button",{onClick:()=>t("/agents"),className:"mt-4 text-sm text-gray-500 underline transition hover:text-gray-900",children:a("agent.backToList")})]}):S.jsxs("div",{className:`mx-auto px-4 py-6 text-gray-900 ${A==="prompt"?"max-w-6xl":"max-w-3xl"}`,children:[x&&S.jsxs("section",{className:`${Mi} mb-5`,children:[S.jsxs("div",{className:"mb-4",children:[S.jsx("h2",{className:"text-sm font-semibold text-gray-900",children:a("agent.template.title")}),S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:a("agent.template.subtitle")})]}),S.jsxs("div",{className:"flex flex-wrap gap-2.5",children:[Qan.map(ft=>{const yn=M===ft.id;return S.jsxs("button",{type:"button",onClick:()=>Sg(ft.id),className:`inline-flex items-center gap-2 rounded-full border px-3.5 py-2 text-sm font-medium transition ${yn?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-200 bg-white text-gray-700 hover:border-gray-300 hover:bg-gray-50"}`,children:[S.jsx("span",{"aria-hidden":"true",children:ft.icon}),S.jsx("span",{children:a(ft.titleKey)})]},ft.id)}),S.jsx("button",{type:"button",onClick:()=>Sg(null),className:`inline-flex items-center gap-2 rounded-full border px-3.5 py-2 text-sm font-medium transition ${M===null?"border-blue-500 bg-blue-50 text-blue-700":"border-dashed border-gray-300 bg-white text-gray-600 hover:border-gray-400 hover:bg-gray-50"}`,children:S.jsx("span",{children:a("agent.template.direct")})})]})]}),ve==="AGENT_LIMIT_EXCEEDED"?S.jsxs("div",{className:"mb-5 rounded-xl border border-red-200 bg-red-50 px-4 py-4 text-sm text-red-700",children:[S.jsx("p",{children:a("agent.createError.AGENT_LIMIT_EXCEEDED")}),S.jsx("a",{href:khe,target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-flex items-center gap-1 text-sm font-medium text-red-700 transition-colors hover:text-red-800 hover:underline",children:a("upgrade.waitlistCta")})]}):null,S.jsx("form",{id:"agent-form",onSubmit:nk,noValidate:!0,className:"space-y-5",children:S.jsxs("div",{className:"overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm",children:[S.jsxs("div",{className:"flex border-b border-gray-200",children:[S.jsx("button",{type:"button",onClick:()=>z("basic"),className:`px-5 py-3 text-sm font-medium transition ${A==="basic"?"border-b-2 border-blue-500 text-blue-600":"text-gray-500 hover:text-gray-900"}`,children:a("agent.tab.basic")}),S.jsx("button",{type:"button",onClick:()=>z("skills"),className:`px-5 py-3 text-sm font-medium transition ${A==="skills"?"border-b-2 border-blue-500 text-blue-600":"text-gray-500 hover:text-gray-900"}`,children:a("agent.tab.skills")}),S.jsx("button",{type:"button",onClick:()=>z("prompt"),className:`px-5 py-3 text-sm font-medium transition ${A==="prompt"?"border-b-2 border-blue-500 text-blue-600":"text-gray-500 hover:text-gray-900"}`,children:a("agent.tab.prompt")})]}),S.jsx("div",{className:"p-6",children:A==="basic"?S.jsxs("div",{className:"space-y-5",children:[S.jsxs("div",{children:[S.jsx("h2",{className:"text-base font-semibold text-gray-900",children:a("agent.section.basicTitle")}),S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:a("agent.section.basicDescription")})]}),S.jsxs("div",{children:[S.jsxs("label",{className:_g,children:[a("agent.field.id")," ",S.jsx("span",{className:"text-red-500",children:"*"})]}),S.jsx("input",{type:"text",value:C.id,onChange:_d("id"),placeholder:a("agent.field.idPlaceholder"),"aria-invalid":Ar.id?"true":void 0,disabled:g,className:`${Eg} ${Ar.id?Bw:""} ${g?Fw:""}`}),!g&&S.jsx("p",{className:"mt-1.5 text-xs text-gray-500",children:a("agent.field.idHint")}),Ar.id?S.jsx("p",{className:"mt-1.5 text-xs text-red-500",role:"alert",children:Ar.id}):null]}),S.jsxs("div",{children:[S.jsxs("label",{className:_g,children:[a("agent.field.name")," ",S.jsx("span",{className:"text-red-500",children:"*"})]}),S.jsx("input",{type:"text",value:C.name,onChange:_d("name"),placeholder:a("agent.field.namePlaceholder"),"aria-invalid":Ar.name?"true":void 0,className:`${Eg} ${Ar.name?Bw:""}`}),Ar.name?S.jsx("p",{className:"mt-1.5 text-xs text-red-500",role:"alert",children:Ar.name}):null]}),S.jsxs("div",{children:[S.jsx("label",{className:_g,children:a("agent.field.role")}),S.jsx("input",{type:"text",value:C.role,onChange:_d("role"),placeholder:a("agent.field.rolePlaceholder"),className:Eg})]}),S.jsxs("div",{children:[S.jsx("label",{className:_g,children:a("agent.field.team")}),S.jsx("input",{type:"text",value:C.team,onChange:_d("team"),placeholder:a("agent.field.teamPlaceholder"),className:Eg})]}),S.jsxs("div",{children:[S.jsxs("label",{className:_g,children:[a("agent.field.provider")," ",S.jsx("span",{className:"text-red-500",children:"*"})]}),ti?S.jsx("input",{type:"text",value:kfe(C.provider,a),disabled:!0,"aria-invalid":Ar.provider?"true":void 0,className:`${Eg} ${Ar.provider?Bw:""} ${Fw}`}):vu?S.jsxs("div",{className:"flex min-h-[42px] w-full items-center gap-2 rounded-lg border border-gray-300 bg-gray-50 px-3 py-2.5 text-sm text-gray-500 shadow-sm",role:"status","aria-live":"polite",children:[S.jsx(Is,{size:16,className:"shrink-0 animate-spin text-blue-500","aria-hidden":"true"}),S.jsx("span",{children:a(bt?"agent.providerState.loadingSlow":"agent.providerState.loading")})]}):Ed?S.jsxs("div",{className:"w-full rounded-lg border border-red-200 bg-white px-3 py-2.5 shadow-sm",role:"alert",children:[S.jsxs("div",{className:"flex items-start gap-2 text-xs text-red-700",children:[S.jsx(wc,{size:16,className:"mt-0.5 shrink-0","aria-hidden":"true"}),S.jsx("span",{children:a("agent.providerState.error")})]}),S.jsxs("button",{type:"button",onClick:NC,className:"mt-2 inline-flex items-center gap-1.5 rounded-lg border border-gray-300 bg-white px-3 py-1.5 text-xs font-medium text-gray-700 transition hover:border-blue-500 hover:bg-blue-50 hover:text-blue-600",children:[S.jsx(qWn,{size:14,"aria-hidden":"true"}),a("agent.providerState.retry")]})]}):S.jsx(CV,{options:Et,value:ks,onChange:A0,placeholder:a("agent.field.selectProvider"),disabled:Nt||!!St,invalid:!!Ar.provider,label:a("agent.field.provider")}),Ar.provider?S.jsx("p",{className:"mt-1.5 text-xs text-red-500",role:"alert",children:Ar.provider}):null]}),ti&&_r||Xs?S.jsxs("div",{"data-testid":"provider-dependent-fields",className:`space-y-5 transition-opacity ${El?"opacity-40":"opacity-100"}`,children:[S.jsxs("div",{children:[S.jsxs("label",{className:_g,children:[a("agent.field.model")," ",S.jsx("span",{className:"text-red-500",children:"*"})]}),ti?S.jsx("input",{type:"text",value:uK(C.model,a)||C.model,disabled:!0,"aria-invalid":Ar.model?"true":void 0,className:`${Eg} ${Ar.model?Bw:""} ${Fw}`}):S.jsx(CV,{options:Cn,value:C.model,onChange:ft=>{U("model",ft),Vu(["model"])},placeholder:C.provider?a("agent.field.selectModel"):a("agent.field.selectProviderFirst"),disabled:!C.provider||Nt||!!St,invalid:!!Ar.model,label:a("agent.field.model"),searchable:!0,searchPlaceholder:a("agent.field.searchModel"),emptyOptionsLabel:a("agent.field.noOptions"),noSearchResultsLabel:a("agent.field.noSearchResults")}),Ar.model?S.jsx("p",{className:"mt-1.5 text-xs text-red-500",role:"alert",children:Ar.model}):null]}),ti?null:S.jsxs("div",{className:"space-y-3",children:[S.jsx("div",{children:S.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:a("agent.modeSettings")})}),S.jsx("div",{className:"grid grid-cols-2 gap-3",children:[{slot:"query",title:a("agent.queryMode"),modeValue:Oo,effortValue:Fl},{slot:"execute",title:a("agent.executeMode"),modeValue:Zh,effortValue:ui}].map(ft=>S.jsxs("div",{className:"space-y-3 rounded-lg border border-gray-200 bg-gray-50 p-4",children:[S.jsx("h4",{className:"text-sm font-semibold text-gray-900",children:ft.title}),S.jsxs("div",{children:[S.jsx("label",{className:_g,children:a("agent.mode")}),S.jsx(CV,{options:ai,value:ft.modeValue,onChange:Lp(ft.slot,"mode"),placeholder:C.provider?a("agent.field.selectMode"):a("agent.field.selectProviderFirst"),disabled:!C.provider||Nt||!!St,clearable:!0,clearLabel:a("agent.field.clearSelection"),label:`${ft.title} ${a("agent.mode")}`})]}),Xr?S.jsxs("div",{children:[S.jsx("label",{className:_g,children:a("agent.effort")}),S.jsx(CV,{options:di,value:ft.effortValue,onChange:Lp(ft.slot,"effort"),placeholder:C.provider?a("agent.field.selectEffort"):a("agent.field.selectProviderFirst"),disabled:!C.provider||Nt||!!St,clearable:!0,clearLabel:a("agent.field.clearSelection"),label:`${ft.title} ${a("agent.effort")}`})]}):null]},ft.slot))})]})]}):null,S.jsxs("div",{children:[S.jsx("label",{className:_g,children:a("agent.field.description")}),S.jsx("textarea",{value:C.description,onChange:_d("description"),placeholder:a("agent.field.descPlaceholder"),rows:5,className:`${Eg} resize-none`})]}),S.jsx("hr",{className:"border-t border-gray-200"}),S.jsxs("div",{className:"rounded-xl border border-gray-200 bg-gray-50/80 p-5",children:[S.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[S.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:a("agent.context.title")}),S.jsx("span",{className:"rounded-md bg-amber-100 px-2 py-0.5 text-[10px] font-semibold tracking-wide text-amber-700",children:a("agent.context.experimental")})]}),S.jsx("p",{className:"mb-4 text-xs text-gray-400",children:a("agent.context.description")}),S.jsxs("div",{className:"mb-4",children:[S.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[S.jsx("input",{type:"checkbox",checked:I,onChange:ft=>te(ft.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-500 focus:ring-blue-500"}),S.jsxs("span",{className:"text-sm font-semibold text-gray-700",children:[a("agent.context.goalsLabel"),S.jsxs("span",{className:"ml-1 text-xs font-normal text-gray-400",children:["— ",a("agent.context.goalsHint")]})]})]}),I?S.jsxs("div",{className:"ml-6 mt-2.5 rounded-lg border border-gray-200 bg-white p-3.5",children:[S.jsxs("div",{className:"flex flex-col gap-2.5",children:[S.jsxs("label",{className:"flex cursor-pointer items-start gap-2",children:[S.jsx("input",{type:"radio",name:"goalMode",checked:D==="all",onChange:()=>Q("all"),className:"mt-0.5 h-4 w-4 border-gray-300 text-blue-500 focus:ring-blue-500"}),S.jsxs("div",{children:[S.jsx("span",{className:"text-sm font-medium text-gray-700",children:a("agent.context.goalsAll")}),S.jsx("p",{className:"text-[11px] text-gray-400",children:a("agent.context.goalsAllDesc")})]})]}),S.jsxs("label",{className:"flex cursor-pointer items-start gap-2",children:[S.jsx("input",{type:"radio",name:"goalMode",checked:D==="specific",onChange:()=>Q("specific"),className:"mt-0.5 h-4 w-4 border-gray-300 text-blue-500 focus:ring-blue-500"}),S.jsxs("div",{children:[S.jsx("span",{className:"text-sm font-medium text-gray-700",children:a("agent.context.goalsSpecific")}),S.jsx("p",{className:"text-[11px] text-gray-400",children:a("agent.context.goalsSpecificDesc")})]})]})]}),S.jsxs("div",{className:`mt-2.5 flex min-h-[36px] flex-wrap items-center gap-1.5 rounded-lg border border-gray-300 bg-white px-2.5 py-1.5 ${D!=="specific"?"pointer-events-none opacity-35":""}`,children:[P.map(ft=>{const yn=ds.find(Ir=>`${Ir.goalId}.md`===ft);return S.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md border border-blue-200 bg-blue-50 px-2 py-0.5 text-xs font-medium text-blue-700",children:[(yn==null?void 0:yn.title)??ft,S.jsx("button",{type:"button",onClick:()=>se(P.filter(Ir=>Ir!==ft)),className:"ml-0.5 rounded text-blue-300 transition hover:bg-red-50 hover:text-red-500",children:"×"})]},ft)}),S.jsxs("div",{className:"relative",children:[S.jsxs("button",{type:"button",onClick:()=>Lr(!yr),disabled:jt,className:"inline-flex items-center gap-1 rounded-md border border-dashed border-gray-300 bg-transparent px-2.5 py-0.5 text-xs font-medium text-gray-500 transition hover:border-blue-500 hover:bg-blue-50 hover:text-blue-500",children:[S.jsx(ef,{size:12}),a("agent.context.goalsAdd")]}),yr?S.jsxs("div",{className:"absolute left-0 top-full z-10 mt-1 max-h-48 w-64 overflow-y-auto rounded-lg border border-gray-200 bg-white py-1 shadow-lg",children:[ds.filter(ft=>!P.includes(`${ft.goalId}.md`)).map(ft=>S.jsx("button",{type:"button",onClick:()=>{se([...P,`${ft.goalId}.md`]),Lr(!1)},className:"flex w-full items-center px-3 py-2 text-left text-sm text-gray-700 transition hover:bg-gray-50",children:S.jsx("span",{className:"truncate",children:ft.title})},ft.goalId)),ds.filter(ft=>!P.includes(`${ft.goalId}.md`)).length===0?S.jsx("p",{className:"px-3 py-2 text-xs text-gray-400",children:a("agent.context.goalsPickerEmpty")}):null]}):null]})]})]}):null]}),S.jsxs("div",{children:[S.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[S.jsx("input",{type:"checkbox",checked:R,onChange:ft=>ce(ft.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-500 focus:ring-blue-500"}),S.jsx("span",{className:"text-sm font-semibold text-gray-700",children:a("agent.context.dailyLabel")})]}),R?S.jsxs("p",{className:"ml-6 mt-1 text-xs text-gray-400",children:["— ",a("agent.context.dailyHint")]}):null]})]})]}):A==="skills"?S.jsxs("div",{className:"space-y-4",children:[S.jsxs("div",{children:[S.jsx("h2",{className:"text-base font-semibold text-gray-900",children:a("agent.section.skillsTitle")}),S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:a("agent.section.skillsDescription")})]}),yi?S.jsx("div",{className:"flex items-center justify-center py-20",children:S.jsx(Is,{size:24,className:"animate-spin text-gray-400"})}):io?S.jsxs("div",{className:"rounded-xl border border-red-200 bg-red-50 px-4 py-4 text-sm text-red-700",children:[S.jsx("p",{children:io}),S.jsx("button",{type:"button",onClick:()=>ei(ft=>ft+1),className:"mt-3 font-medium underline underline-offset-2 transition hover:text-red-800",children:a("agent.retry")})]}):Lc.length===0?S.jsx("div",{className:"rounded-xl border border-gray-200 bg-white px-6 py-16",children:S.jsxs("div",{className:"mx-auto flex max-w-xl flex-col items-center text-center",children:[S.jsx("div",{className:"mb-5 rounded-full bg-gray-100 p-4 text-gray-500",children:S.jsx(cJt,{size:40,strokeWidth:1.8})}),S.jsx("h3",{className:"text-3xl font-semibold tracking-tight text-gray-900",children:a("agent.skills.emptyTitle")}),S.jsx("p",{className:"mt-4 text-lg leading-8 text-gray-500",children:a("agent.skills.emptyDescription")}),S.jsxs("button",{type:"button",onClick:()=>t("/market"),className:"mt-8 inline-flex items-center gap-2 rounded-2xl border border-gray-200 bg-white px-6 py-3 text-base font-semibold text-gray-900 shadow-sm transition hover:bg-gray-50",children:[S.jsx(MFe,{size:18}),a("agent.skills.openMarket")]})]})}):S.jsx("div",{className:"overflow-hidden rounded-xl border border-gray-200 bg-white",children:S.jsx("div",{className:"max-h-[420px] overflow-y-auto",children:Lc.map((ft,yn)=>{const Ir=E.include.includes(ft.name);return S.jsxs("label",{className:`flex cursor-pointer items-start gap-4 px-4 py-4 transition hover:bg-gray-50 ${yn>0?"border-t border-gray-200":""}`,children:[S.jsx("input",{type:"checkbox",checked:Ir,onChange:()=>nu(ft.name),"aria-label":ft.name,className:"mt-0.5 h-5 w-5 shrink-0 rounded border-gray-300 text-gray-900 focus:ring-gray-900"}),S.jsxs("div",{className:"min-w-0",children:[S.jsx("div",{className:"text-base font-semibold text-gray-900",children:ft.name}),ft.description?S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:ft.description}):null]})]},ft.name)})})})]}):S.jsx(F.Suspense,{fallback:S.jsx("div",{className:"flex items-center justify-center py-24",children:S.jsx(Is,{size:28,className:"animate-spin text-gray-400"})}),children:S.jsx(mAr,{previewAgentId:v})})})]})})]})}function eln({node:t,depth:n=0,expandedFolders:i,onToggle:o,onSelect:a,selectedPath:c,isFileDisabled:u,renderFileSuffix:f}){var M;const g=i.has(t.path),w=c===t.path,x=t.type==="dir",v=!x&&HFe(t.name),C=x&&(t.hasCrewxYaml!==void 0||t.isRegistered!==void 0),E=(!x||C)&&((u==null?void 0:u(t))??!1),A=()=>{if(x){E||o(t.path);return}E||a(t.path)};return S.jsxs("div",{children:[S.jsxs("button",{type:"button",onClick:A,disabled:E,style:{paddingLeft:`${8+n*16}px`},className:`flex w-full items-center gap-1.5 py-1 pr-2 text-left text-sm transition-colors ${w?"bg-blue-50 font-medium text-blue-700":"text-gray-700 hover:bg-gray-100"} ${E?"cursor-not-allowed opacity-50 hover:bg-transparent":""}`,children:[x?S.jsxs(S.Fragment,{children:[g?S.jsx(vg,{className:"h-3.5 w-3.5 shrink-0 text-gray-400"}):S.jsx(vx,{className:"h-3.5 w-3.5 shrink-0 text-gray-400"}),g?S.jsx(a5,{className:"h-4 w-4 shrink-0 text-amber-500"}):S.jsx(TUn,{className:"h-4 w-4 shrink-0 text-amber-500"})]}):S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"w-3.5 shrink-0"}),v?S.jsx(UUn,{className:"h-4 w-4 shrink-0 text-blue-500"}):S.jsx(Tx,{className:"h-4 w-4 shrink-0 text-gray-400"})]}),S.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.name}),!x||C?f==null?void 0:f(t):null]}),x&&g&&((M=t.children)!=null&&M.length)?S.jsx("div",{children:t.children.map(I=>S.jsx(eln,{node:I,depth:n+1,expandedFolders:i,onToggle:o,onSelect:a,selectedPath:c,isFileDisabled:u,renderFileSuffix:f},I.path))}):null]})}function tln({nodes:t,expandedFolders:n,onToggle:i,onSelect:o,selectedPath:a,isFileDisabled:c,renderFileSuffix:u}){return S.jsx("div",{children:t.map(f=>S.jsx(eln,{node:f,expandedFolders:n,onToggle:i,onSelect:o,selectedPath:a,isFileDisabled:c,renderFileSuffix:u},f.path))})}let i$e,s$e;if(typeof WeakMap<"u"){let t=new WeakMap;i$e=n=>t.get(n),s$e=(n,i)=>(t.set(n,i),i)}else{const t=[];let i=0;i$e=o=>{for(let a=0;a<t.length;a+=2)if(t[a]==o)return t[a+1]},s$e=(o,a)=>(i==10&&(i=0),t[i++]=o,t[i++]=a)}var Qd=class{constructor(t,n,i,o){this.width=t,this.height=n,this.map=i,this.problems=o}findCell(t){for(let n=0;n<this.map.length;n++){const i=this.map[n];if(i!=t)continue;const o=n%this.width,a=n/this.width|0;let c=o+1,u=a+1;for(let f=1;c<this.width&&this.map[n+f]==i;f++)c++;for(let f=1;u<this.height&&this.map[n+this.width*f]==i;f++)u++;return{left:o,top:a,right:c,bottom:u}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let n=0;n<this.map.length;n++)if(this.map[n]==t)return n%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,n,i){const{left:o,right:a,top:c,bottom:u}=this.findCell(t);return n=="horiz"?(i<0?o==0:a==this.width)?null:this.map[c*this.width+(i<0?o-1:a)]:(i<0?c==0:u==this.height)?null:this.map[o+this.width*(i<0?c-1:u)]}rectBetween(t,n){const{left:i,right:o,top:a,bottom:c}=this.findCell(t),{left:u,right:f,top:g,bottom:w}=this.findCell(n);return{left:Math.min(i,u),top:Math.min(a,g),right:Math.max(o,f),bottom:Math.max(c,w)}}cellsInRect(t){const n=[],i={};for(let o=t.top;o<t.bottom;o++)for(let a=t.left;a<t.right;a++){const c=o*this.width+a,u=this.map[c];i[u]||(i[u]=!0,!(a==t.left&&a&&this.map[c-1]==u||o==t.top&&o&&this.map[c-this.width]==u)&&n.push(u))}return n}positionAt(t,n,i){for(let o=0,a=0;;o++){const c=a+i.child(o).nodeSize;if(o==t){let u=n+t*this.width;const f=(t+1)*this.width;for(;u<f&&this.map[u]<a;)u++;return u==f?c-1:this.map[u]}a=c}}static get(t){return i$e(t)||s$e(t,CAr(t))}};function CAr(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const n=SAr(t),i=t.childCount,o=[];let a=0,c=null;const u=[];for(let w=0,x=n*i;w<x;w++)o[w]=0;for(let w=0,x=0;w<i;w++){const v=t.child(w);x++;for(let A=0;;A++){for(;a<o.length&&o[a]!=0;)a++;if(A==v.childCount)break;const M=v.child(A),{colspan:I,rowspan:D,colwidth:P}=M.attrs;for(let R=0;R<D;R++){if(R+w>=i){(c||(c=[])).push({type:"overlong_rowspan",pos:x,n:D-R});break}const z=a+R*n;for(let U=0;U<I;U++){o[z+U]==0?o[z+U]=x:(c||(c=[])).push({type:"collision",row:w,pos:x,n:I-U});const W=P&&P[U];if(W){const G=(z+U)%n*2,Y=u[G];Y==null||Y!=W&&u[G+1]==1?(u[G]=W,u[G+1]=1):Y==W&&u[G+1]++}}}a+=I,x+=M.nodeSize}const C=(w+1)*n;let E=0;for(;a<C;)o[a++]==0&&E++;E&&(c||(c=[])).push({type:"missing",row:w,n:E}),x++}(n===0||i===0)&&(c||(c=[])).push({type:"zero_sized"});const f=new Qd(n,i,o,c);let g=!1;for(let w=0;!g&&w<u.length;w+=2)u[w]!=null&&u[w+1]<i&&(g=!0);return g&&EAr(f,u,t),f}function SAr(t){let n=-1,i=!1;for(let o=0;o<t.childCount;o++){const a=t.child(o);let c=0;if(i)for(let u=0;u<o;u++){const f=t.child(u);for(let g=0;g<f.childCount;g++){const w=f.child(g);u+w.attrs.rowspan>o&&(c+=w.attrs.colspan)}}for(let u=0;u<a.childCount;u++){const f=a.child(u);c+=f.attrs.colspan,f.attrs.rowspan>1&&(i=!0)}n==-1?n=c:n!=c&&(n=Math.max(n,c))}return n}function EAr(t,n,i){t.problems||(t.problems=[]);const o={};for(let a=0;a<t.map.length;a++){const c=t.map[a];if(o[c])continue;o[c]=!0;const u=i.nodeAt(c);if(!u)throw new RangeError(`No cell with offset ${c} found`);let f=null;const g=u.attrs;for(let w=0;w<g.colspan;w++){const x=n[(a+w)%t.width*2];x!=null&&(!g.colwidth||g.colwidth[w]!=x)&&((f||(f=_Ar(g)))[w]=x)}f&&t.problems.unshift({type:"colwidth mismatch",pos:c,colwidth:f})}}function _Ar(t){if(t.colwidth)return t.colwidth.slice();const n=[];for(let i=0;i<t.colspan;i++)n.push(0);return n}function C0(t){let n=t.cached.tableNodeTypes;if(!n){n=t.cached.tableNodeTypes={};for(const i in t.nodes){const o=t.nodes[i],a=o.spec.tableRole;a&&(n[a]=o)}}return n}const J4=new Oc("selectingCells");function S9(t){for(let n=t.depth-1;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return t.node(0).resolve(t.before(n+1));return null}function TAr(t){for(let n=t.depth;n>0;n--){const i=t.node(n).type.spec.tableRole;if(i==="cell"||i==="header_cell")return t.node(n)}return null}function ek(t){const n=t.selection.$head;for(let i=n.depth;i>0;i--)if(n.node(i).type.spec.tableRole=="row")return!0;return!1}function tme(t){const n=t.selection;if("$anchorCell"in n&&n.$anchorCell)return n.$anchorCell.pos>n.$headCell.pos?n.$anchorCell:n.$headCell;if("node"in n&&n.node&&n.node.type.spec.tableRole=="cell")return n.$anchor;const i=S9(n.$head)||AAr(n.$head);if(i)return i;throw new RangeError(`No cell found around position ${n.head}`)}function AAr(t){for(let n=t.nodeAfter,i=t.pos;n;n=n.firstChild,i++){const o=n.type.spec.tableRole;if(o=="cell"||o=="header_cell")return t.doc.resolve(i)}for(let n=t.nodeBefore,i=t.pos;n;n=n.lastChild,i--){const o=n.type.spec.tableRole;if(o=="cell"||o=="header_cell")return t.doc.resolve(i-n.nodeSize)}}function o$e(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function MAr(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function EHe(t,n){return t.depth==n.depth&&t.pos>=n.start(-1)&&t.pos<=n.end(-1)}function nln(t,n,i){const o=t.node(-1),a=Qd.get(o),c=t.start(-1),u=a.nextCell(t.pos-c,n,i);return u==null?null:t.node(0).resolve(c+u)}function E9(t,n,i=1){const o={...t,colspan:t.colspan-i};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(n,i),o.colwidth.some(a=>a>0)||(o.colwidth=null)),o}function rln(t,n,i=1){const o={...t,colspan:t.colspan+i};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let a=0;a<i;a++)o.colwidth.splice(n,0,0)}return o}function NAr(t,n,i){const o=C0(n.type.schema).header_cell;for(let a=0;a<t.height;a++)if(n.nodeAt(t.map[i+a*t.width]).type!=o)return!1;return!0}var tu=class WE extends Fs{constructor(n,i=n){const o=n.node(-1),a=Qd.get(o),c=n.start(-1),u=a.rectBetween(n.pos-c,i.pos-c),f=n.node(0),g=a.cellsInRect(u).filter(x=>x!=i.pos-c);g.unshift(i.pos-c);const w=g.map(x=>{const v=o.nodeAt(x);if(!v)throw new RangeError(`No cell with offset ${x} found`);const C=c+x+1;return new Osn(f.resolve(C),f.resolve(C+v.content.size))});super(w[0].$from,w[0].$to,w),this.$anchorCell=n,this.$headCell=i}map(n,i){const o=n.resolve(i.map(this.$anchorCell.pos)),a=n.resolve(i.map(this.$headCell.pos));if(o$e(o)&&o$e(a)&&EHe(o,a)){const c=this.$anchorCell.node(-1)!=o.node(-1);return c&&this.isRowSelection()?WE.rowSelection(o,a):c&&this.isColSelection()?WE.colSelection(o,a):new WE(o,a)}return us.between(o,a)}content(){const n=this.$anchorCell.node(-1),i=Qd.get(n),o=this.$anchorCell.start(-1),a=i.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),c={},u=[];for(let g=a.top;g<a.bottom;g++){const w=[];for(let x=g*i.width+a.left,v=a.left;v<a.right;v++,x++){const C=i.map[x];if(c[C])continue;c[C]=!0;const E=i.findCell(C);let A=n.nodeAt(C);if(!A)throw new RangeError(`No cell with offset ${C} found`);const M=a.left-E.left,I=E.right-a.right;if(M>0||I>0){let D=A.attrs;if(M>0&&(D=E9(D,0,M)),I>0&&(D=E9(D,D.colspan-I,I)),E.left<a.left){if(A=A.type.createAndFill(D),!A)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(D)}`)}else A=A.type.create(D,A.content)}if(E.top<a.top||E.bottom>a.bottom){const D={...A.attrs,rowspan:Math.min(E.bottom,a.bottom)-Math.max(E.top,a.top)};E.top<a.top?A=A.type.createAndFill(D):A=A.type.create(D,A.content)}w.push(A)}u.push(n.child(g).copy(An.from(w)))}const f=this.isColSelection()&&this.isRowSelection()?n:u;return new zr(An.from(f),1,1)}replace(n,i=zr.empty){const o=n.steps.length,a=this.ranges;for(let u=0;u<a.length;u++){const{$from:f,$to:g}=a[u],w=n.mapping.slice(o);n.replace(w.map(f.pos),w.map(g.pos),u?zr.empty:i)}const c=Fs.findFrom(n.doc.resolve(n.mapping.slice(o).map(this.to)),-1);c&&n.setSelection(c)}replaceWith(n,i){this.replace(n,new zr(An.from(i),0,0))}forEachCell(n){const i=this.$anchorCell.node(-1),o=Qd.get(i),a=this.$anchorCell.start(-1),c=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-a,this.$headCell.pos-a));for(let u=0;u<c.length;u++)n(i.nodeAt(c[u]),a+c[u])}isColSelection(){const n=this.$anchorCell.index(-1),i=this.$headCell.index(-1);if(Math.min(n,i)>0)return!1;const o=n+this.$anchorCell.nodeAfter.attrs.rowspan,a=i+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,a)==this.$headCell.node(-1).childCount}static colSelection(n,i=n){const o=n.node(-1),a=Qd.get(o),c=n.start(-1),u=a.findCell(n.pos-c),f=a.findCell(i.pos-c),g=n.node(0);return u.top<=f.top?(u.top>0&&(n=g.resolve(c+a.map[u.left])),f.bottom<a.height&&(i=g.resolve(c+a.map[a.width*(a.height-1)+f.right-1]))):(f.top>0&&(i=g.resolve(c+a.map[f.left])),u.bottom<a.height&&(n=g.resolve(c+a.map[a.width*(a.height-1)+u.right-1]))),new WE(n,i)}isRowSelection(){const n=this.$anchorCell.node(-1),i=Qd.get(n),o=this.$anchorCell.start(-1),a=i.colCount(this.$anchorCell.pos-o),c=i.colCount(this.$headCell.pos-o);if(Math.min(a,c)>0)return!1;const u=a+this.$anchorCell.nodeAfter.attrs.colspan,f=c+this.$headCell.nodeAfter.attrs.colspan;return Math.max(u,f)==i.width}eq(n){return n instanceof WE&&n.$anchorCell.pos==this.$anchorCell.pos&&n.$headCell.pos==this.$headCell.pos}static rowSelection(n,i=n){const o=n.node(-1),a=Qd.get(o),c=n.start(-1),u=a.findCell(n.pos-c),f=a.findCell(i.pos-c),g=n.node(0);return u.left<=f.left?(u.left>0&&(n=g.resolve(c+a.map[u.top*a.width])),f.right<a.width&&(i=g.resolve(c+a.map[a.width*(f.top+1)-1]))):(f.left>0&&(i=g.resolve(c+a.map[f.top*a.width])),u.right<a.width&&(n=g.resolve(c+a.map[a.width*(u.top+1)-1]))),new WE(n,i)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(n,i){return new WE(n.resolve(i.anchor),n.resolve(i.head))}static create(n,i,o=i){return new WE(n.resolve(i),n.resolve(o))}getBookmark(){return new jAr(this.$anchorCell.pos,this.$headCell.pos)}};tu.prototype.visible=!1;Fs.jsonID("cell",tu);var jAr=class iln{constructor(n,i){this.anchor=n,this.head=i}map(n){return new iln(n.map(this.anchor),n.map(this.head))}resolve(n){const i=n.resolve(this.anchor),o=n.resolve(this.head);return i.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&i.index()<i.parent.childCount&&o.index()<o.parent.childCount&&EHe(i,o)?new tu(i,o):Fs.near(o,1)}};function DAr(t){if(!(t.selection instanceof tu))return null;const n=[];return t.selection.forEachCell((i,o)=>{n.push(Qh.node(o,o+i.nodeSize,{class:"selectedCell"}))}),Nc.create(t.doc,n)}function IAr({$from:t,$to:n}){if(t.pos==n.pos||t.pos<n.pos-6)return!1;let i=t.pos,o=n.pos,a=t.depth;for(;a>=0&&!(t.after(a+1)<t.end(a));a--,i++);for(let c=n.depth;c>=0&&!(n.before(c+1)>n.start(c));c--,o--);return i==o&&/row|table/.test(t.node(a).type.spec.tableRole)}function OAr({$from:t,$to:n}){let i,o;for(let a=t.depth;a>0;a--){const c=t.node(a);if(c.type.spec.tableRole==="cell"||c.type.spec.tableRole==="header_cell"){i=c;break}}for(let a=n.depth;a>0;a--){const c=n.node(a);if(c.type.spec.tableRole==="cell"||c.type.spec.tableRole==="header_cell"){o=c;break}}return i!==o&&n.parentOffset===0}function LAr(t,n,i){const o=(n||t).selection,a=(n||t).doc;let c,u;if(o instanceof es&&(u=o.node.type.spec.tableRole)){if(u=="cell"||u=="header_cell")c=tu.create(a,o.from);else if(u=="row"){const f=a.resolve(o.from+1);c=tu.rowSelection(f,f)}else if(!i){const f=Qd.get(o.node),g=o.from+1,w=g+f.map[f.width*f.height-1];c=tu.create(a,g+1,w)}}else o instanceof us&&IAr(o)?c=us.create(a,o.from):o instanceof us&&OAr(o)&&(c=us.create(a,o.$from.start(),o.$from.end()));return c&&(n||(n=t.tr)).setSelection(c),n}const PAr=new Oc("fix-tables");function sln(t,n,i,o){const a=t.childCount,c=n.childCount;e:for(let u=0,f=0;u<c;u++){const g=n.child(u);for(let w=f,x=Math.min(a,u+3);w<x;w++)if(t.child(w)==g){f=w+1,i+=g.nodeSize;continue e}o(g,i),f<a&&t.child(f).sameMarkup(g)?sln(t.child(f),g,i+1,o):g.nodesBetween(0,g.content.size,o,i+1),i+=g.nodeSize}}function oln(t,n){let i;const o=(a,c)=>{a.type.spec.tableRole=="table"&&(i=RAr(t,a,c,i))};return n?n.doc!=t.doc&&sln(n.doc,t.doc,0,o):t.doc.descendants(o),i}function RAr(t,n,i,o){const a=Qd.get(n);if(!a.problems)return o;o||(o=t.tr);const c=[];for(let g=0;g<a.height;g++)c.push(0);for(let g=0;g<a.problems.length;g++){const w=a.problems[g];if(w.type=="collision"){const x=n.nodeAt(w.pos);if(!x)continue;const v=x.attrs;for(let C=0;C<v.rowspan;C++)c[w.row+C]+=w.n;o.setNodeMarkup(o.mapping.map(i+1+w.pos),null,E9(v,v.colspan-w.n,w.n))}else if(w.type=="missing")c[w.row]+=w.n;else if(w.type=="overlong_rowspan"){const x=n.nodeAt(w.pos);if(!x)continue;o.setNodeMarkup(o.mapping.map(i+1+w.pos),null,{...x.attrs,rowspan:x.attrs.rowspan-w.n})}else if(w.type=="colwidth mismatch"){const x=n.nodeAt(w.pos);if(!x)continue;o.setNodeMarkup(o.mapping.map(i+1+w.pos),null,{...x.attrs,colwidth:w.colwidth})}else if(w.type=="zero_sized"){const x=o.mapping.map(i);o.delete(x,x+n.nodeSize)}}let u,f;for(let g=0;g<c.length;g++)c[g]&&(u==null&&(u=g),f=g);for(let g=0,w=i+1;g<a.height;g++){const x=n.child(g),v=w+x.nodeSize,C=c[g];if(C>0){let E="cell";x.firstChild&&(E=x.firstChild.type.spec.tableRole);const A=[];for(let I=0;I<C;I++){const D=C0(t.schema)[E].createAndFill();D&&A.push(D)}const M=(g==0||u==g-1)&&f==g?w+1:v-1;o.insert(o.mapping.map(M),A)}w=v}return o.setMeta(PAr,{fixTables:!0})}function EC(t){const n=t.selection,i=tme(t),o=i.node(-1),a=i.start(-1),c=Qd.get(o);return{...n instanceof tu?c.rectBetween(n.$anchorCell.pos-a,n.$headCell.pos-a):c.findCell(i.pos-a),tableStart:a,map:c,table:o}}function aln(t,{map:n,tableStart:i,table:o},a){let c=a>0?-1:0;NAr(n,o,a+c)&&(c=a==0||a==n.width?null:0);for(let u=0;u<n.height;u++){const f=u*n.width+a;if(a>0&&a<n.width&&n.map[f-1]==n.map[f]){const g=n.map[f],w=o.nodeAt(g);t.setNodeMarkup(t.mapping.map(i+g),null,rln(w.attrs,a-n.colCount(g))),u+=w.attrs.rowspan-1}else{const g=c==null?C0(o.type.schema).cell:o.nodeAt(n.map[f+c]).type,w=n.positionAt(u,a,o);t.insert(t.mapping.map(i+w),g.createAndFill())}}return t}function $Ar(t,n){if(!ek(t))return!1;if(n){const i=EC(t);n(aln(t.tr,i,i.left))}return!0}function FAr(t,n){if(!ek(t))return!1;if(n){const i=EC(t);n(aln(t.tr,i,i.right))}return!0}function BAr(t,{map:n,table:i,tableStart:o},a){const c=t.mapping.maps.length;for(let u=0;u<n.height;){const f=u*n.width+a,g=n.map[f],w=i.nodeAt(g),x=w.attrs;if(a>0&&n.map[f-1]==g||a<n.width-1&&n.map[f+1]==g)t.setNodeMarkup(t.mapping.slice(c).map(o+g),null,E9(x,a-n.colCount(g)));else{const v=t.mapping.slice(c).map(o+g);t.delete(v,v+w.nodeSize)}u+=x.rowspan}}function zAr(t,n){if(!ek(t))return!1;if(n){const i=EC(t),o=t.tr;if(i.left==0&&i.right==i.map.width)return!1;for(let a=i.right-1;BAr(o,i,a),a!=i.left;a--){const c=i.tableStart?o.doc.nodeAt(i.tableStart-1):o.doc;if(!c)throw new RangeError("No table found");i.table=c,i.map=Qd.get(c)}n(o)}return!0}function HAr(t,n,i){var o;const a=C0(n.type.schema).header_cell;for(let c=0;c<t.width;c++)if(((o=n.nodeAt(t.map[c+i*t.width]))===null||o===void 0?void 0:o.type)!=a)return!1;return!0}function lln(t,{map:n,tableStart:i,table:o},a){let c=i;for(let w=0;w<a;w++)c+=o.child(w).nodeSize;const u=[];let f=a>0?-1:0;HAr(n,o,a+f)&&(f=a==0||a==n.height?null:0);for(let w=0,x=n.width*a;w<n.width;w++,x++)if(a>0&&a<n.height&&n.map[x]==n.map[x-n.width]){const v=n.map[x],C=o.nodeAt(v).attrs;t.setNodeMarkup(i+v,null,{...C,rowspan:C.rowspan+1}),w+=C.colspan-1}else{var g;const v=f==null?C0(o.type.schema).cell:(g=o.nodeAt(n.map[x+f*n.width]))===null||g===void 0?void 0:g.type,C=v==null?void 0:v.createAndFill();C&&u.push(C)}return t.insert(c,C0(o.type.schema).row.create(null,u)),t}function UAr(t,n){if(!ek(t))return!1;if(n){const i=EC(t);n(lln(t.tr,i,i.top))}return!0}function WAr(t,n){if(!ek(t))return!1;if(n){const i=EC(t);n(lln(t.tr,i,i.bottom))}return!0}function qAr(t,{map:n,table:i,tableStart:o},a){let c=0;for(let w=0;w<a;w++)c+=i.child(w).nodeSize;const u=c+i.child(a).nodeSize,f=t.mapping.maps.length;t.delete(c+o,u+o);const g=new Set;for(let w=0,x=a*n.width;w<n.width;w++,x++){const v=n.map[x];if(!g.has(v)){if(g.add(v),a>0&&v==n.map[x-n.width]){const C=i.nodeAt(v).attrs;t.setNodeMarkup(t.mapping.slice(f).map(v+o),null,{...C,rowspan:C.rowspan-1}),w+=C.colspan-1}else if(a<n.height&&v==n.map[x+n.width]){const C=i.nodeAt(v),E=C.attrs,A=C.type.create({...E,rowspan:C.attrs.rowspan-1},C.content),M=n.positionAt(a+1,w,i);t.insert(t.mapping.slice(f).map(o+M),A),w+=E.colspan-1}}}}function GAr(t,n){if(!ek(t))return!1;if(n){const i=EC(t),o=t.tr;if(i.top==0&&i.bottom==i.map.height)return!1;for(let a=i.bottom-1;qAr(o,i,a),a!=i.top;a--){const c=i.tableStart?o.doc.nodeAt(i.tableStart-1):o.doc;if(!c)throw new RangeError("No table found");i.table=c,i.map=Qd.get(i.table)}n(o)}return!0}function PUt(t){const n=t.content;return n.childCount==1&&n.child(0).isTextblock&&n.child(0).childCount==0}function VAr({width:t,height:n,map:i},o){let a=o.top*t+o.left,c=a,u=(o.bottom-1)*t+o.left,f=a+(o.right-o.left-1);for(let g=o.top;g<o.bottom;g++){if(o.left>0&&i[c]==i[c-1]||o.right<t&&i[f]==i[f+1])return!0;c+=t,f+=t}for(let g=o.left;g<o.right;g++){if(o.top>0&&i[a]==i[a-t]||o.bottom<n&&i[u]==i[u+t])return!0;a++,u++}return!1}function RUt(t,n){const i=t.selection;if(!(i instanceof tu)||i.$anchorCell.pos==i.$headCell.pos)return!1;const o=EC(t),{map:a}=o;if(VAr(a,o))return!1;if(n){const c=t.tr,u={};let f=An.empty,g,w;for(let x=o.top;x<o.bottom;x++)for(let v=o.left;v<o.right;v++){const C=a.map[x*a.width+v],E=o.table.nodeAt(C);if(!(u[C]||!E))if(u[C]=!0,g==null)g=C,w=E;else{PUt(E)||(f=f.append(E.content));const A=c.mapping.map(C+o.tableStart);c.delete(A,A+E.nodeSize)}}if(g==null||w==null)return!0;if(c.setNodeMarkup(g+o.tableStart,null,{...rln(w.attrs,w.attrs.colspan,o.right-o.left-w.attrs.colspan),rowspan:o.bottom-o.top}),f.size>0){const x=g+1+w.content.size,v=PUt(w)?g+1:x;c.replaceWith(v+o.tableStart,x+o.tableStart,f)}c.setSelection(new tu(c.doc.resolve(g+o.tableStart))),n(c)}return!0}function $Ut(t,n){const i=C0(t.schema);return KAr(({node:o})=>i[o.type.spec.tableRole])(t,n)}function KAr(t){return(n,i)=>{const o=n.selection;let a,c;if(o instanceof tu){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;a=o.$anchorCell.nodeAfter,c=o.$anchorCell.pos}else{var u;if(a=TAr(o.$from),!a)return!1;c=(u=S9(o.$from))===null||u===void 0?void 0:u.pos}if(a==null||c==null||a.attrs.colspan==1&&a.attrs.rowspan==1)return!1;if(i){let f=a.attrs;const g=[],w=f.colwidth;f.rowspan>1&&(f={...f,rowspan:1}),f.colspan>1&&(f={...f,colspan:1});const x=EC(n),v=n.tr;for(let E=0;E<x.right-x.left;E++)g.push(w?{...f,colwidth:w&&w[E]?[w[E]]:null}:f);let C;for(let E=x.top;E<x.bottom;E++){let A=x.map.positionAt(E,x.left,x.table);E==x.top&&(A+=a.nodeSize);for(let M=x.left,I=0;M<x.right;M++,I++)M==x.left&&E==x.top||v.insert(C=v.mapping.map(A+x.tableStart,1),t({node:a,row:E,col:M}).createAndFill(g[I]))}v.setNodeMarkup(c,t({node:a,row:x.top,col:x.left}),g[0]),o instanceof tu&&v.setSelection(new tu(v.doc.resolve(o.$anchorCell.pos),C?v.doc.resolve(C):void 0)),i(v)}return!0}}function JAr(t,n){return function(i,o){if(!ek(i))return!1;const a=tme(i);if(a.nodeAfter.attrs[t]===n)return!1;if(o){const c=i.tr;i.selection instanceof tu?i.selection.forEachCell((u,f)=>{u.attrs[t]!==n&&c.setNodeMarkup(f,null,{...u.attrs,[t]:n})}):c.setNodeMarkup(a.pos,null,{...a.nodeAfter.attrs,[t]:n}),o(c)}return!0}}function YAr(t){return function(n,i){if(!ek(n))return!1;if(i){const o=C0(n.schema),a=EC(n),c=n.tr,u=a.map.cellsInRect(t=="column"?{left:a.left,top:0,right:a.right,bottom:a.map.height}:t=="row"?{left:0,top:a.top,right:a.map.width,bottom:a.bottom}:a),f=u.map(g=>a.table.nodeAt(g));for(let g=0;g<u.length;g++)f[g].type==o.header_cell&&c.setNodeMarkup(a.tableStart+u[g],o.cell,f[g].attrs);if(c.steps.length===0)for(let g=0;g<u.length;g++)c.setNodeMarkup(a.tableStart+u[g],o.header_cell,f[g].attrs);i(c)}return!0}}function FUt(t,n,i){const o=n.map.cellsInRect({left:0,top:0,right:t=="row"?n.map.width:1,bottom:t=="column"?n.map.height:1});for(let a=0;a<o.length;a++){const c=n.table.nodeAt(o[a]);if(c&&c.type!==i.header_cell)return!1}return!0}function dJ(t,n){return n=n||{useDeprecatedLogic:!1},n.useDeprecatedLogic?YAr(t):function(i,o){if(!ek(i))return!1;if(o){const a=C0(i.schema),c=EC(i),u=i.tr,f=FUt("row",c,a),g=FUt("column",c,a),w=(t==="column"?f:t==="row"&&g)?1:0,x=t=="column"?{left:0,top:w,right:1,bottom:c.map.height}:t=="row"?{left:w,top:0,right:c.map.width,bottom:1}:c,v=t=="column"?g?a.cell:a.header_cell:t=="row"?f?a.cell:a.header_cell:a.cell;c.map.cellsInRect(x).forEach(C=>{const E=C+c.tableStart,A=u.doc.nodeAt(E);A&&u.setNodeMarkup(E,v,A.attrs)}),o(u)}return!0}}dJ("row",{useDeprecatedLogic:!0});dJ("column",{useDeprecatedLogic:!0});const XAr=dJ("cell",{useDeprecatedLogic:!0});function QAr(t,n){if(n<0){const i=t.nodeBefore;if(i)return t.pos-i.nodeSize;for(let o=t.index(-1)-1,a=t.before();o>=0;o--){const c=t.node(-1).child(o),u=c.lastChild;if(u)return a-1-u.nodeSize;a-=c.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const i=t.node(-1);for(let o=t.indexAfter(-1),a=t.after();o<i.childCount;o++){const c=i.child(o);if(c.childCount)return a+1;a+=c.nodeSize}}return null}function BUt(t){return function(n,i){if(!ek(n))return!1;const o=QAr(tme(n),t);if(o==null)return!1;if(i){const a=n.doc.resolve(o);i(n.tr.setSelection(us.between(a,MAr(a))).scrollIntoView())}return!0}}function ZAr(t,n){const i=t.selection.$anchor;for(let o=i.depth;o>0;o--)if(i.node(o).type.spec.tableRole=="table")return n&&n(t.tr.delete(i.before(o),i.after(o)).scrollIntoView()),!0;return!1}function hde(t,n){const i=t.selection;if(!(i instanceof tu))return!1;if(n){const o=t.tr,a=C0(t.schema).cell.createAndFill().content;i.forEachCell((c,u)=>{c.content.eq(a)||o.replace(o.mapping.map(u+1),o.mapping.map(u+c.nodeSize-1),new zr(a,0,0))}),o.docChanged&&n(o)}return!0}function eMr(t){if(t.size===0)return null;let{content:n,openStart:i,openEnd:o}=t;for(;n.childCount==1&&(i>0&&o>0||n.child(0).type.spec.tableRole=="table");)i--,o--,n=n.child(0).content;const a=n.child(0),c=a.type.spec.tableRole,u=a.type.schema,f=[];if(c=="row")for(let g=0;g<n.childCount;g++){let w=n.child(g).content;const x=g?0:Math.max(0,i-1),v=g<n.childCount-1?0:Math.max(0,o-1);(x||v)&&(w=a$e(C0(u).row,new zr(w,x,v)).content),f.push(w)}else if(c=="cell"||c=="header_cell")f.push(i||o?a$e(C0(u).row,new zr(n,i,o)).content:n);else return null;return tMr(u,f)}function tMr(t,n){const i=[];for(let a=0;a<n.length;a++){const c=n[a];for(let u=c.childCount-1;u>=0;u--){const{rowspan:f,colspan:g}=c.child(u).attrs;for(let w=a;w<a+f;w++)i[w]=(i[w]||0)+g}}let o=0;for(let a=0;a<i.length;a++)o=Math.max(o,i[a]);for(let a=0;a<i.length;a++)if(a>=n.length&&n.push(An.empty),i[a]<o){const c=C0(t).cell.createAndFill(),u=[];for(let f=i[a];f<o;f++)u.push(c);n[a]=n[a].append(An.from(u))}return{height:n.length,width:o,rows:n}}function a$e(t,n){const i=t.createAndFill();return new $ze(i).replace(0,i.content.size,n).doc}function nMr({width:t,height:n,rows:i},o,a){if(t!=o){const c=[],u=[];for(let f=0;f<i.length;f++){const g=i[f],w=[];for(let x=c[f]||0,v=0;x<o;v++){let C=g.child(v%g.childCount);x+C.attrs.colspan>o&&(C=C.type.createChecked(E9(C.attrs,C.attrs.colspan,x+C.attrs.colspan-o),C.content)),w.push(C),x+=C.attrs.colspan;for(let E=1;E<C.attrs.rowspan;E++)c[f+E]=(c[f+E]||0)+C.attrs.colspan}u.push(An.from(w))}i=u,t=o}if(n!=a){const c=[];for(let u=0,f=0;u<a;u++,f++){const g=[],w=i[f%n];for(let x=0;x<w.childCount;x++){let v=w.child(x);u+v.attrs.rowspan>a&&(v=v.type.create({...v.attrs,rowspan:Math.max(1,a-v.attrs.rowspan)},v.content)),g.push(v)}c.push(An.from(g))}i=c,n=a}return{width:t,height:n,rows:i}}function rMr(t,n,i,o,a,c,u){const f=t.doc.type.schema,g=C0(f);let w,x;if(a>n.width)for(let v=0,C=0;v<n.height;v++){const E=i.child(v);C+=E.nodeSize;const A=[];let M;E.lastChild==null||E.lastChild.type==g.cell?M=w||(w=g.cell.createAndFill()):M=x||(x=g.header_cell.createAndFill());for(let I=n.width;I<a;I++)A.push(M);t.insert(t.mapping.slice(u).map(C-1+o),A)}if(c>n.height){const v=[];for(let A=0,M=(n.height-1)*n.width;A<Math.max(n.width,a);A++){const I=A>=n.width?!1:i.nodeAt(n.map[M+A]).type==g.header_cell;v.push(I?x||(x=g.header_cell.createAndFill()):w||(w=g.cell.createAndFill()))}const C=g.row.create(null,An.from(v)),E=[];for(let A=n.height;A<c;A++)E.push(C);t.insert(t.mapping.slice(u).map(o+i.nodeSize-2),E)}return!!(w||x)}function zUt(t,n,i,o,a,c,u,f){if(u==0||u==n.height)return!1;let g=!1;for(let w=a;w<c;w++){const x=u*n.width+w,v=n.map[x];if(n.map[x-n.width]==v){g=!0;const C=i.nodeAt(v),{top:E,left:A}=n.findCell(v);t.setNodeMarkup(t.mapping.slice(f).map(v+o),null,{...C.attrs,rowspan:u-E}),t.insert(t.mapping.slice(f).map(n.positionAt(u,A,i)),C.type.createAndFill({...C.attrs,rowspan:E+C.attrs.rowspan-u})),w+=C.attrs.colspan-1}}return g}function HUt(t,n,i,o,a,c,u,f){if(u==0||u==n.width)return!1;let g=!1;for(let w=a;w<c;w++){const x=w*n.width+u,v=n.map[x];if(n.map[x-1]==v){g=!0;const C=i.nodeAt(v),E=n.colCount(v),A=t.mapping.slice(f).map(v+o);t.setNodeMarkup(A,null,E9(C.attrs,u-E,C.attrs.colspan-(u-E))),t.insert(A+C.nodeSize,C.type.createAndFill(E9(C.attrs,0,u-E))),w+=C.attrs.rowspan-1}}return g}function UUt(t,n,i,o,a){let c=i?t.doc.nodeAt(i-1):t.doc;if(!c)throw new Error("No table found");let u=Qd.get(c);const{top:f,left:g}=o,w=g+a.width,x=f+a.height,v=t.tr;let C=0;function E(){if(c=i?v.doc.nodeAt(i-1):v.doc,!c)throw new Error("No table found");u=Qd.get(c),C=v.mapping.maps.length}rMr(v,u,c,i,w,x,C)&&E(),zUt(v,u,c,i,g,w,f,C)&&E(),zUt(v,u,c,i,g,w,x,C)&&E(),HUt(v,u,c,i,f,x,g,C)&&E(),HUt(v,u,c,i,f,x,w,C)&&E();for(let A=f;A<x;A++){const M=u.positionAt(A,g,c),I=u.positionAt(A,w,c);v.replace(v.mapping.slice(C).map(M+i),v.mapping.slice(C).map(I+i),new zr(a.rows[A-f],0,0))}E(),v.setSelection(new tu(v.doc.resolve(i+u.positionAt(f,g,c)),v.doc.resolve(i+u.positionAt(x-1,w-1,c)))),n(v)}const iMr=eHe({ArrowLeft:pde("horiz",-1),ArrowRight:pde("horiz",1),ArrowUp:pde("vert",-1),ArrowDown:pde("vert",1),"Shift-ArrowLeft":gde("horiz",-1),"Shift-ArrowRight":gde("horiz",1),"Shift-ArrowUp":gde("vert",-1),"Shift-ArrowDown":gde("vert",1),Backspace:hde,"Mod-Backspace":hde,Delete:hde,"Mod-Delete":hde});function Cfe(t,n,i){return i.eq(t.selection)?!1:(n&&n(t.tr.setSelection(i).scrollIntoView()),!0)}function pde(t,n){return(i,o,a)=>{if(!a)return!1;const c=i.selection;if(c instanceof tu)return Cfe(i,o,Fs.near(c.$headCell,n));if(t!="horiz"&&!c.empty)return!1;const u=cln(a,t,n);if(u==null)return!1;if(t=="horiz")return Cfe(i,o,Fs.near(i.doc.resolve(c.head+n),n));{const f=i.doc.resolve(u),g=nln(f,t,n);let w;return g?w=Fs.near(g,1):n<0?w=Fs.near(i.doc.resolve(f.before(-1)),-1):w=Fs.near(i.doc.resolve(f.after(-1)),1),Cfe(i,o,w)}}}function gde(t,n){return(i,o,a)=>{if(!a)return!1;const c=i.selection;let u;if(c instanceof tu)u=c;else{const g=cln(a,t,n);if(g==null)return!1;u=new tu(i.doc.resolve(g))}const f=nln(u.$headCell,t,n);return f?Cfe(i,o,new tu(u.$anchorCell,f)):!1}}function sMr(t,n){const i=t.state.doc,o=S9(i.resolve(n));return o?(t.dispatch(t.state.tr.setSelection(new tu(o))),!0):!1}function oMr(t,n,i){if(!ek(t.state))return!1;let o=eMr(i);const a=t.state.selection;if(a instanceof tu){o||(o={width:1,height:1,rows:[An.from(a$e(C0(t.state.schema).cell,i))]});const c=a.$anchorCell.node(-1),u=a.$anchorCell.start(-1),f=Qd.get(c).rectBetween(a.$anchorCell.pos-u,a.$headCell.pos-u);return o=nMr(o,f.right-f.left,f.bottom-f.top),UUt(t.state,t.dispatch,u,f,o),!0}else if(o){const c=tme(t.state),u=c.start(-1);return UUt(t.state,t.dispatch,u,Qd.get(c.node(-1)).findCell(c.pos-u),o),!0}else return!1}function aMr(t,n){var i;if(n.button!=0||n.ctrlKey||n.metaKey)return;const o=WUt(t,n.target);let a;if(n.shiftKey&&t.state.selection instanceof tu)c(t.state.selection.$anchorCell,n),n.preventDefault();else if(n.shiftKey&&o&&(a=S9(t.state.selection.$anchor))!=null&&((i=lLe(t,n))===null||i===void 0?void 0:i.pos)!=a.pos)c(a,n),n.preventDefault();else if(!o)return;function c(g,w){let x=lLe(t,w);const v=J4.getState(t.state)==null;if(!x||!EHe(g,x))if(v)x=g;else return;const C=new tu(g,x);if(v||!t.state.selection.eq(C)){const E=t.state.tr.setSelection(C);v&&E.setMeta(J4,g.pos),t.dispatch(E)}}function u(){t.root.removeEventListener("mouseup",u),t.root.removeEventListener("dragstart",u),t.root.removeEventListener("mousemove",f),J4.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(J4,-1))}function f(g){const w=g,x=J4.getState(t.state);let v;if(x!=null)v=t.state.doc.resolve(x);else if(WUt(t,w.target)!=o&&(v=lLe(t,n),!v))return u();v&&c(v,w)}t.root.addEventListener("mouseup",u),t.root.addEventListener("dragstart",u),t.root.addEventListener("mousemove",f)}function cln(t,n,i){if(!(t.state.selection instanceof us))return null;const{$head:o}=t.state.selection;for(let a=o.depth-1;a>=0;a--){const c=o.node(a);if((i<0?o.index(a):o.indexAfter(a))!=(i<0?0:c.childCount))return null;if(c.type.spec.tableRole=="cell"||c.type.spec.tableRole=="header_cell"){const u=o.before(a),f=n=="vert"?i>0?"down":"up":i>0?"right":"left";return t.endOfTextblock(f)?u:null}}return null}function WUt(t,n){for(;n&&n!=t.dom;n=n.parentNode)if(n.nodeName=="TD"||n.nodeName=="TH")return n;return null}function lLe(t,n){const i=t.posAtCoords({left:n.clientX,top:n.clientY});if(!i)return null;let{inside:o,pos:a}=i;return o>=0&&S9(t.state.doc.resolve(o))||S9(t.state.doc.resolve(a))}var lMr=class{constructor(n,i){this.node=n,this.defaultCellMinWidth=i,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${i}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),l$e(n,this.colgroup,this.table,i),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(n){return n.type!=this.node.type?!1:(this.node=n,l$e(n,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(n){return n.type=="attributes"&&(n.target==this.table||this.colgroup.contains(n.target))}};function l$e(t,n,i,o,a,c){let u=0,f=!0,g=n.firstChild;const w=t.firstChild;if(w){for(let v=0,C=0;v<w.childCount;v++){const{colspan:E,colwidth:A}=w.child(v).attrs;for(let M=0;M<E;M++,C++){const I=a==C?c:A&&A[M],D=I?I+"px":"";if(u+=I||o,I||(f=!1),g)g.style.width!=D&&(g.style.width=D),g=g.nextSibling;else{const P=document.createElement("col");P.style.width=D,n.appendChild(P)}}}for(;g;){var x;const v=g.nextSibling;(x=g.parentNode)===null||x===void 0||x.removeChild(g),g=v}f?(i.style.width=u+"px",i.style.minWidth=""):(i.style.width="",i.style.minWidth=u+"px")}}const Ew=new Oc("tableColumnResizing");function cMr({handleWidth:t=5,cellMinWidth:n=25,defaultCellMinWidth:i=100,View:o=lMr,lastColumnResizable:a=!0}={}){const c=new Ic({key:Ew,state:{init(u,f){var g;const w=(g=c.spec)===null||g===void 0||(g=g.props)===null||g===void 0?void 0:g.nodeViews,x=C0(f.schema).table.name;return o&&w&&(w[x]=(v,C)=>new o(v,i,C)),new uMr(-1,!1)},apply(u,f){return f.apply(u)}},props:{attributes:u=>{const f=Ew.getState(u);return f&&f.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(u,f)=>{dMr(u,f,t,a)},mouseleave:u=>{fMr(u)},mousedown:(u,f)=>{hMr(u,f,n,i)}},decorations:u=>{const f=Ew.getState(u);if(f&&f.activeHandle>-1)return wMr(u,f.activeHandle)},nodeViews:{}}});return c}var uMr=class Sfe{constructor(n,i){this.activeHandle=n,this.dragging=i}apply(n){const i=this,o=n.getMeta(Ew);if(o&&o.setHandle!=null)return new Sfe(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new Sfe(i.activeHandle,o.setDragging);if(i.activeHandle>-1&&n.docChanged){let a=n.mapping.map(i.activeHandle,-1);return o$e(n.doc.resolve(a))||(a=-1),new Sfe(a,i.dragging)}return i}};function dMr(t,n,i,o){if(!t.editable)return;const a=Ew.getState(t.state);if(a&&!a.dragging){const c=gMr(n.target);let u=-1;if(c){const{left:f,right:g}=c.getBoundingClientRect();n.clientX-f<=i?u=qUt(t,n,"left",i):g-n.clientX<=i&&(u=qUt(t,n,"right",i))}if(u!=a.activeHandle){if(!o&&u!==-1){const f=t.state.doc.resolve(u),g=f.node(-1),w=Qd.get(g),x=f.start(-1);if(w.colCount(f.pos-x)+f.nodeAfter.attrs.colspan-1==w.width-1)return}uln(t,u)}}}function fMr(t){if(!t.editable)return;const n=Ew.getState(t.state);n&&n.activeHandle>-1&&!n.dragging&&uln(t,-1)}function hMr(t,n,i,o){var a;if(!t.editable)return!1;const c=(a=t.dom.ownerDocument.defaultView)!==null&&a!==void 0?a:window,u=Ew.getState(t.state);if(!u||u.activeHandle==-1||u.dragging)return!1;const f=t.state.doc.nodeAt(u.activeHandle),g=pMr(t,u.activeHandle,f.attrs);t.dispatch(t.state.tr.setMeta(Ew,{setDragging:{startX:n.clientX,startWidth:g}}));function w(v){c.removeEventListener("mouseup",w),c.removeEventListener("mousemove",x);const C=Ew.getState(t.state);C!=null&&C.dragging&&(mMr(t,C.activeHandle,GUt(C.dragging,v,i)),t.dispatch(t.state.tr.setMeta(Ew,{setDragging:null})))}function x(v){if(!v.which)return w(v);const C=Ew.getState(t.state);if(C&&C.dragging){const E=GUt(C.dragging,v,i);VUt(t,C.activeHandle,E,o)}}return VUt(t,u.activeHandle,g,o),c.addEventListener("mouseup",w),c.addEventListener("mousemove",x),n.preventDefault(),!0}function pMr(t,n,{colspan:i,colwidth:o}){const a=o&&o[o.length-1];if(a)return a;const c=t.domAtPos(n);let u=c.node.childNodes[c.offset].offsetWidth,f=i;if(o)for(let g=0;g<i;g++)o[g]&&(u-=o[g],f--);return u/f}function gMr(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function qUt(t,n,i,o){const a=i=="right"?-o:o,c=t.posAtCoords({left:n.clientX+a,top:n.clientY});if(!c)return-1;const{pos:u}=c,f=S9(t.state.doc.resolve(u));if(!f)return-1;if(i=="right")return f.pos;const g=Qd.get(f.node(-1)),w=f.start(-1),x=g.map.indexOf(f.pos-w);return x%g.width==0?-1:w+g.map[x-1]}function GUt(t,n,i){const o=n.clientX-t.startX;return Math.max(i,t.startWidth+o)}function uln(t,n){t.dispatch(t.state.tr.setMeta(Ew,{setHandle:n}))}function mMr(t,n,i){const o=t.state.doc.resolve(n),a=o.node(-1),c=Qd.get(a),u=o.start(-1),f=c.colCount(o.pos-u)+o.nodeAfter.attrs.colspan-1,g=t.state.tr;for(let w=0;w<c.height;w++){const x=w*c.width+f;if(w&&c.map[x]==c.map[x-c.width])continue;const v=c.map[x],C=a.nodeAt(v).attrs,E=C.colspan==1?0:f-c.colCount(v);if(C.colwidth&&C.colwidth[E]==i)continue;const A=C.colwidth?C.colwidth.slice():bMr(C.colspan);A[E]=i,g.setNodeMarkup(u+v,null,{...C,colwidth:A})}g.docChanged&&t.dispatch(g)}function VUt(t,n,i,o){const a=t.state.doc.resolve(n),c=a.node(-1),u=a.start(-1),f=Qd.get(c).colCount(a.pos-u)+a.nodeAfter.attrs.colspan-1;let g=t.domAtPos(a.start(-1)).node;for(;g&&g.nodeName!="TABLE";)g=g.parentNode;g&&l$e(c,g.firstChild,g,o,f,i)}function bMr(t){return Array(t).fill(0)}function wMr(t,n){const i=[],o=t.doc.resolve(n),a=o.node(-1);if(!a)return Nc.empty;const c=Qd.get(a),u=o.start(-1),f=c.colCount(o.pos-u)+o.nodeAfter.attrs.colspan-1;for(let w=0;w<c.height;w++){const x=f+w*c.width;if((f==c.width-1||c.map[x]!=c.map[x+1])&&(w==0||c.map[x]!=c.map[x-c.width])){var g;const v=c.map[x],C=u+v+a.nodeAt(v).nodeSize-1,E=document.createElement("div");E.className="column-resize-handle",!((g=Ew.getState(t))===null||g===void 0)&&g.dragging&&i.push(Qh.node(u+v,u+v+a.nodeAt(v).nodeSize,{class:"column-resize-dragging"})),i.push(Qh.widget(C,E))}}return Nc.create(t.doc,i)}function yMr({allowTableNodeSelection:t=!1}={}){return new Ic({key:J4,state:{init(){return null},apply(n,i){const o=n.getMeta(J4);if(o!=null)return o==-1?null:o;if(i==null||!n.docChanged)return i;const{deleted:a,pos:c}=n.mapping.mapResult(i);return a?null:c}},props:{decorations:DAr,handleDOMEvents:{mousedown:aMr},createSelectionBetween(n){return J4.getState(n.state)!=null?n.state.selection:null},handleTripleClick:sMr,handleKeyDown:iMr,handlePaste:oMr},appendTransaction(n,i,o){return LAr(o,oln(o,i),t)}})}function nge(t){return t==="left"||t==="right"||t==="center"?t:null}function xMr(t){const n=(t.style.textAlign||"").trim().toLowerCase(),i=(t.getAttribute("align")||"").trim().toLowerCase();return nge(n||i)}function vMr(t){return nge(t==null?void 0:t.align)}function dln(){return{default:null,parseHTML:t=>xMr(t),renderHTML:t=>t.align?{style:`text-align: ${t.align}`}:{}}}var fln=Qa.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{var n,i;const o=t.getAttribute("colwidth"),a=o?o.split(",").map(c=>parseInt(c,10)):null;if(!a){const c=(n=t.closest("table"))==null?void 0:n.querySelectorAll("colgroup > col"),u=Array.from(((i=t.parentElement)==null?void 0:i.children)||[]).indexOf(t);if(u&&u>-1&&c&&c[u]){const f=c[u].getAttribute("width");return f?[parseInt(f,10)]:null}}return a}},align:dln()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",bc(this.options.HTMLAttributes,t),0]}}),hln=Qa.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const n=t.getAttribute("colwidth");return n?n.split(",").map(o=>parseInt(o,10)):null}},align:dln()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",bc(this.options.HTMLAttributes,t),0]}}),pln=Qa.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",bc(this.options.HTMLAttributes,t),0]}});function c$e(t,n){return n?["width",`${Math.max(n,t)}px`]:["min-width",`${t}px`]}function KUt(t,n,i,o,a,c){var u;let f=0,g=!0,w=n.firstChild;const x=t.firstChild;if(x!==null)for(let C=0,E=0;C<x.childCount;C+=1){const{colspan:A,colwidth:M}=x.child(C).attrs;for(let I=0;I<A;I+=1,E+=1){const D=a===E?c:M&&M[I],P=D?`${D}px`:"";if(f+=D||o,D||(g=!1),w){if(w.style.width!==P){const[R,z]=c$e(o,D);w.style.setProperty(R,z)}w=w.nextSibling}else{const R=document.createElement("col"),[z,U]=c$e(o,D);R.style.setProperty(z,U),n.appendChild(R)}}}for(;w;){const C=w.nextSibling;(u=w.parentNode)==null||u.removeChild(w),w=C}const v=t.attrs.style&&typeof t.attrs.style=="string"&&/\bwidth\s*:/i.test(t.attrs.style);g&&!v?(i.style.width=`${f}px`,i.style.minWidth=""):(i.style.width="",i.style.minWidth=`${f}px`)}var kMr=class{constructor(t,n){this.node=t,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),t.attrs.style&&(this.table.style.cssText=t.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),KUt(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,KUt(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){const n=t.target,i=this.dom.contains(n),o=this.contentDOM.contains(n);return!!(i&&!o&&(t.type==="attributes"||t.type==="childList"||t.type==="characterData"))}};function CMr(t,n,i,o){let a=0,c=!0;const u=[],f=t.firstChild;if(!f)return{};for(let v=0,C=0;v<f.childCount;v+=1){const{colspan:E,colwidth:A}=f.child(v).attrs;for(let M=0;M<E;M+=1,C+=1){const I=i===C?o:A&&A[M];a+=I||n,I||(c=!1);const[D,P]=c$e(n,I);u.push(["col",{style:`${D}: ${P}`}])}}const g=c?`${a}px`:"",w=c?"":`${a}px`;return{colgroup:["colgroup",{},...u],tableWidth:g,tableMinWidth:w}}function JUt(t,n){return t.createAndFill()}function SMr(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const n={};return Object.keys(t.nodes).forEach(i=>{const o=t.nodes[i];o.spec.tableRole&&(n[o.spec.tableRole]=o)}),t.cached.tableNodeTypes=n,n}function EMr(t,n,i,o,a){const c=SMr(t),u=[],f=[];for(let w=0;w<i;w+=1){const x=JUt(c.cell);if(x&&f.push(x),o){const v=JUt(c.header_cell);v&&u.push(v)}}const g=[];for(let w=0;w<n;w+=1)g.push(c.row.createChecked(null,o&&w===0?u:f));return c.table.createChecked(null,g)}function _Mr(t){return t instanceof tu}var mde=({editor:t})=>{const{selection:n}=t.state;if(!_Mr(n))return!1;let i=0;const o=$on(n.ranges[0].$from,c=>c.type.name==="table");return o==null||o.node.descendants(c=>{if(c.type.name==="table")return!1;["tableCell","tableHeader"].includes(c.type.name)&&(i+=1)}),i===n.ranges.length?(t.commands.deleteTable(),!0):!1},TMr="";function AMr(t){return(t||"").replace(/\s+/g," ").trim()}function MMr(t,n,i={}){var o;const a=(o=i.cellLineSeparator)!=null?o:TMr;if(!t||!t.content||t.content.length===0)return"";const c=[];t.content.forEach(M=>{const I=[];M.content&&M.content.forEach(D=>{let P="";D.content&&Array.isArray(D.content)&&D.content.length>1?P=D.content.map(G=>n.renderChildren(G)).join(a):P=D.content?n.renderChildren(D.content):"";const R=AMr(P),z=D.type==="tableHeader",U=vMr(D.attrs);I.push({text:R,isHeader:z,align:U})}),c.push(I)});const u=c.reduce((M,I)=>Math.max(M,I.length),0);if(u===0)return"";const f=new Array(u).fill(0);c.forEach(M=>{var I;for(let D=0;D<u;D+=1){const R=(((I=M[D])==null?void 0:I.text)||"").length;R>f[D]&&(f[D]=R),f[D]<3&&(f[D]=3)}});const g=(M,I)=>M+" ".repeat(Math.max(0,I-M.length)),w=c[0],x=w.some(M=>M.isHeader),v=new Array(u).fill(null);c.forEach(M=>{var I;for(let D=0;D<u;D+=1)!v[D]&&((I=M[D])!=null&&I.align)&&(v[D]=M[D].align)});let C=`
|
|
1157
1157
|
`;const E=new Array(u).fill(0).map((M,I)=>x&&w[I]&&w[I].text||"");return C+=`| ${E.map((M,I)=>g(M,f[I])).join(" | ")} |
|
|
1158
1158
|
`,C+=`| ${f.map((M,I)=>{const D=Math.max(3,M),P=v[I];return P==="left"?`:${"-".repeat(D)}`:P==="right"?`${"-".repeat(D)}:`:P==="center"?`:${"-".repeat(D)}:`:"-".repeat(D)}).join(" | ")} |
|
|
1159
1159
|
`,(x?c.slice(1):c).forEach(M=>{C+=`| ${new Array(u).fill(0).map((I,D)=>g(M[D]&&M[D].text||"",f[D])).join(" | ")} |
|
|
@@ -1280,10 +1280,10 @@ Output ONLY the cron expression. No explanation.`,sLr=`${Acn}
|
|
|
1280
1280
|
`),h.length!=2)throw Z(new Kt("Exactly two numbers are expected, "+h.length+" were found."));try{this.a=k2(C2(h[0])),this.b=k2(C2(h[1]))}catch(m){throw m=Oi(m),me(m,131)?(l=m,Z(new Kt(FEt+l))):Z(m)}},b.Ib=function(){return"("+this.a+","+this.b+")"},b.a=0,b.b=0;var ws=O(IO,"KVector",8);j(78,66,{3:1,4:1,20:1,31:1,56:1,18:1,66:1,16:1,78:1,414:1},Pc,k$,ict),b.Nc=function(){return YCn(this)},b.ag=function(r){var s,l,d,h,m,y;d=M2(r,`,|;|\\(|\\)|\\[|\\]|\\{|\\}| | |
|
|
1281
1281
|
`),au(this);try{for(l=0,m=0,h=0,y=0;l<d.length;)d[l]!=null&&C2(d[l]).length>0&&(m%2==0?h=k2(d[l]):y=k2(d[l]),m>0&&m%2!=0&&rr(this,new Re(h,y)),++m),++l}catch(k){throw k=Oi(k),me(k,131)?(s=k,Z(new Kt("The given string does not match the expected format for vectors."+s))):Z(k)}},b.Ib=function(){var r,s,l;for(r=new ku("("),s=Dn(this,0);s.b!=s.d.c;)l=p(Nn(s),8),nr(r,l.a+","+l.b),s.b!=s.d.c&&(r.a+="; ");return(r.a+=")",r).a};var kDe=O(IO,"KVectorChain",78);j(256,23,{3:1,35:1,23:1,256:1},AA);var ice,Nq,jq,IL,OL,Dq,CDe=_n(xl,"Alignment",256,Ln,Xvn,A1n),BIt;j(975,1,Dh,bZe),b.tf=function(r){j3t(r)};var SDe,sce,zIt,EDe,_De,HIt,TDe,UIt,WIt,ADe,MDe,qIt;O(xl,"BoxLayouterOptions",975),j(976,1,{},HJe),b.uf=function(){var r;return r=new qJe,r},b.vf=function(r){},O(xl,"BoxLayouterOptions/BoxFactory",976),j(299,23,{3:1,35:1,23:1,299:1},MA);var Oj,oce,Lj,Pj,Rj,ace,lce=_n(xl,"ContentAlignment",299,Ln,Qvn,M1n),GIt;j(689,1,Dh,Bme),b.tf=function(r){ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,W5t),""),"Layout Algorithm"),"Select a specific layout algorithm."),(Fb(),yE)),Ye),lt((up(),It))))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,q5t),""),"Resolved Layout Algorithm"),"Meta data associated with the selected algorithm."),Fh),m7n),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,N5e),""),"Alignment"),"Alignment of the selected node relative to other nodes; the exact meaning depends on the used algorithm."),NDe),li),CDe),lt(Pi)))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,vT),""),"Aspect Ratio"),"The desired aspect ratio of the drawing, that is the quotient of width by height."),zs),Hi),lt(It)))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,W_e),""),"Bend Points"),"A fixed list of bend points for the edge. This is used by the 'Fixed Layout' algorithm to specify a pre-defined routing for an edge. The vector chain must include the source point, any bend points, and the target point, so it must have at least two points."),Fh),kDe),lt(rh)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,sU),""),"Content Alignment"),"Specifies how the content of a node are aligned. Each node can individually control the alignment of its contents. I.e. if a node should be aligned top left in its parent node, the parent node should specify that option."),DDe),wE),lce),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,$O),""),"Debug Mode"),"Whether additional debug information shall be generated."),(zt(),!1)),ns),Ci),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,Rie),""),"Direction"),"Overall direction of edges: horizontal (right / left) or vertical (down / up)."),IDe),li),Fj),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,RO),""),"Edge Routing"),"What kind of edge routing style should be applied for the content of a parent node. Algorithms may also set this option to single edges in order to mark them as splines. The bend point list of edges with this option set to SPLINES must be interpreted as control points for a piecewise cubic spline."),PDe),li),kce),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,H_e),""),"Expand Nodes"),"If active, nodes are expanded to fill the area of their parent."),!1),ns),Ci),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,iU),""),"Hierarchy Handling"),"Determines whether separate layout runs are triggered for different compound nodes in a hierarchical graph. Setting a node's hierarchy handling to `INCLUDE_CHILDREN` will lay out that node and all of its descendants in a single layout run, until a descendant is encountered which has its hierarchy handling set to `SEPARATE_CHILDREN`. In general, `SEPARATE_CHILDREN` will ensure that a new layout run is triggered for a node with that setting. Including multiple levels of hierarchy in a single layout run may allow cross-hierarchical edges to be laid out properly. If the root node is set to `INHERIT` (or not set at all), the default behavior is `SEPARATE_CHILDREN`."),$De),li),T9e),Gr(It,ie(re($h,1),Pe,160,0,[Pi]))))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,P2),""),"Padding"),"The padding to be left to a parent element's border when placing child elements. This can also serve as an output option of a layout algorithm if node size calculation is setup appropriately."),JDe),Fh),L4e),Gr(It,ie(re($h,1),Pe,160,0,[Pi]))))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,fN),""),"Interactive"),"Whether the algorithm should be run in interactive mode for the content of a parent node. What this means exactly depends on how the specific algorithm interprets this option. Usually in the interactive mode algorithms try to modify the current layout as little as possible."),!1),ns),Ci),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,aU),""),"interactive Layout"),"Whether the graph should be changeable interactively and by setting constraints"),!1),ns),Ci),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,hN),""),"Omit Node Micro Layout"),"Node micro layout comprises the computation of node dimensions (if requested), the placement of ports and their labels, and the placement of node labels. The functionality is implemented independent of any specific layout algorithm and shouldn't have any negative impact on the layout algorithm's performance itself. Yet, if any unforeseen behavior occurs, this option allows to deactivate the micro layout."),!1),ns),Ci),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,Kre),""),"Port Constraints"),"Defines constraints of the position of the ports of a node."),e9e),li),N9e),lt(Pi)))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,oU),""),"Position"),"The position of a node, port, or label. This is used by the 'Fixed Layout' algorithm to specify a pre-defined position."),Fh),ws),Gr(Pi,ie(re($h,1),Pe,160,0,[lm,r0]))))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,TO),""),"Priority"),"Defines the priority of an object; its meaning depends on the specific layout algorithm and the context where it is used."),no),Qi),Gr(Pi,ie(re($h,1),Pe,160,0,[rh]))))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,FH),""),"Randomization Seed"),"Seed used for pseudo-random number generators to control the layout algorithm. If the value is 0, the seed shall be determined pseudo-randomly (e.g. from the system time)."),no),Qi),lt(It)))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,dN),""),"Separate Connected Components"),"Whether each connected component should be processed separately."),ns),Ci),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,z5e),""),"Junction Points"),"This option is not used as option, but as output of the layout algorithms. It is attached to edges and determines the points where junction symbols should be drawn in order to represent hyperedges with orthogonal routing. Whether such points are computed depends on the chosen layout algorithm and edge routing style. The points are put into the vector chain with no specific order."),zDe),Fh),kDe),lt(rh)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,q5e),""),"Comment Box"),"Whether the node should be regarded as a comment box instead of a regular node. In that case its placement should be similar to how labels are handled. Any edges incident to a comment box specify to which graph elements the comment is related."),!1),ns),Ci),lt(Pi)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,G5e),""),"Hypernode"),"Whether the node should be handled as a hypernode."),!1),ns),Ci),lt(Pi)))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,UPn),""),"Label Manager"),"Label managers can shorten labels upon a layout algorithm's request."),Fh),k7n),Gr(It,ie(re($h,1),Pe,160,0,[r0]))))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,G5t),""),"Softwrapping Fuzziness"),"Determines the amount of fuzziness to be used when performing softwrapping on labels. The value expresses the percent of overhang that is permitted for each line. If the next line would take up less space than this threshold, it is appended to the current line instead of being placed in a new line."),0),zs),Hi),lt(r0)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,K5e),""),"Margins"),"Margins define additional space around the actual bounds of a graph element. For instance, ports or labels being placed on the outside of a node's border might introduce such a margin. The margin is used to guarantee non-overlap of other graph elements with those ports or labels."),HDe),Fh),O4e),lt(Pi)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,A5e),""),"No Layout"),"No layout is done for the associated element. This is used to mark parts of a diagram to avoid their inclusion in the layout graph, or to mark parts of the layout graph to prevent layout engines from processing them. If you wish to exclude the contents of a compound node from automatic layout, while the node itself is still considered on its own layer, use the 'Fixed Layout' algorithm for that node."),!1),ns),Ci),Gr(Pi,ie(re($h,1),Pe,160,0,[rh,lm,r0]))))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,V5t),""),"Scale Factor"),"The scaling factor to be applied to the corresponding node in recursive layout. It causes the corresponding node's size to be adjusted, and its ports and labels to be sized and placed accordingly after the layout of that node has been determined (and before the node itself and its siblings are arranged). The scaling is not reverted afterwards, so the resulting layout graph contains the adjusted size and position data. This option is currently not supported if 'Layout Hierarchy' is set."),1),zs),Hi),lt(Pi)))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,K5t),""),"Child Area Width"),"The width of the area occupied by the laid out children of a node."),zs),Hi),lt(It)))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,J5t),""),"Child Area Height"),"The height of the area occupied by the laid out children of a node."),zs),Hi),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,AO),""),F5t),"Turns topdown layout on and off. If this option is enabled, hierarchical layout will be computed first for the root node and then for its children recursively. Layouts are then scaled down to fit the area provided by their parents. Graphs must follow a certain structure for topdown layout to work properly. {@link TopdownNodeTypes.PARALLEL_NODE} nodes must have children of type {@link TopdownNodeTypes.HIERARCHICAL_NODE} and must define {@link topdown.hierarchicalNodeWidth} and {@link topdown.hierarchicalNodeAspectRatio} for their children. Furthermore they need to be laid out using an algorithm that is a {@link TopdownLayoutProvider}. Hierarchical nodes can also be parents of other hierarchical nodes and can optionally use a {@link TopdownSizeApproximator} to dynamically set sizes during topdown layout. In this case {@link topdown.hierarchicalNodeWidth} and {@link topdown.hierarchicalNodeAspectRatio} should be set on the node itself rather than the parent. The values are then used by the size approximator as base values. Hierarchical nodes require the layout option {@link nodeSize.fixedGraphSize} to be true to prevent the algorithm used there from resizing the hierarchical node. This option is not supported if 'Hierarchy Handling' is set to 'INCLUDE_CHILDREN'"),!1),ns),Ci),lt(It)))),gi(r,AO,My,null),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,Y5t),""),"Animate"),"Whether the shift from the old layout to the new computed layout shall be animated."),!0),ns),Ci),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,X5t),""),"Animation Time Factor"),"Factor for computation of animation time. The higher the value, the longer the animation time. If the value is 0, the resulting time is always equal to the minimum defined by 'Minimal Animation Time'."),Oe(100)),no),Qi),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,Q5t),""),"Layout Ancestors"),"Whether the hierarchy levels on the path from the selected element to the root of the diagram shall be included in the layout process."),!1),ns),Ci),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,Z5t),""),"Maximal Animation Time"),"The maximal time for animations, in milliseconds."),Oe(4e3)),no),Qi),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,e_t),""),"Minimal Animation Time"),"The minimal time for animations, in milliseconds."),Oe(400)),no),Qi),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,t_t),""),"Progress Bar"),"Whether a progress bar shall be displayed during layout computations."),!1),ns),Ci),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,n_t),""),"Validate Graph"),"Whether the graph shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user."),!1),ns),Ci),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,r_t),""),"Validate Options"),"Whether layout options shall be validated before any layout algorithm is applied. If this option is enabled and at least one error is found, the layout process is aborted and a message is shown to the user."),!0),ns),Ci),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,i_t),""),"Zoom to Fit"),"Whether the zoom level shall be set to view the whole diagram after layout."),!1),ns),Ci),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,U_e),"box"),"Box Layout Mode"),"Configures the packing mode used by the {@link BoxLayoutProvider}. If SIMPLE is not required (neither priorities are used nor the interactive mode), GROUP_DEC can improve the packing and decrease the area. GROUP_MIXED and GROUP_INC may, in very specific scenarios, work better."),jDe),li),U9e),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,s_t),"json"),"Shape Coords"),"For layouts transferred into JSON graphs, specify the coordinate system to be used for nodes, ports, and labels of nodes and ports."),BDe),li),I9e),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,o_t),"json"),"Edge Coords"),"For layouts transferred into JSON graphs, specify the coordinate system to be used for edge route points and edge labels."),FDe),li),p9e),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,m5e),Oh),"Comment Comment Spacing"),"Spacing to be preserved between a comment box and other comment boxes connected to the same node. The space left between comment boxes of different nodes is controlled by the node-node spacing."),10),zs),Hi),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,b5e),Oh),"Comment Node Spacing"),"Spacing to be preserved between a node and its connected comment boxes. The space left between a node and the comments of another node is controlled by the node-node spacing."),10),zs),Hi),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,w5e),Oh),"Components Spacing"),"Spacing to be preserved between pairs of connected components. This option is only relevant if 'separateConnectedComponents' is activated."),20),zs),Hi),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,y5e),Oh),"Edge Spacing"),"Spacing to be preserved between any two edges. Note that while this can somewhat easily be satisfied for the segments of orthogonally drawn edges, it is harder for general polylines or splines."),10),zs),Hi),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,Vre),Oh),"Edge Label Spacing"),"The minimal distance to be preserved between a label and the edge it is associated with. Note that the placement of a label is influenced by the 'edgelabels.placement' option."),2),zs),Hi),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,Pie),Oh),"Edge Node Spacing"),"Spacing to be preserved between nodes and edges."),10),zs),Hi),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,x5e),Oh),"Label Spacing"),"Determines the amount of space to be left between two labels of the same graph element."),0),zs),Hi),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,C5e),Oh),"Label Node Spacing"),"Spacing to be preserved between labels and the border of node they are associated with. Note that the placement of a label is influenced by the 'nodelabels.placement' option."),5),zs),Hi),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,v5e),Oh),"Horizontal spacing between Label and Port"),"Horizontal spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option."),1),zs),Hi),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,k5e),Oh),"Vertical spacing between Label and Port"),"Vertical spacing to be preserved between labels and the ports they are associated with. Note that the placement of a label is influenced by the 'portlabels.placement' option."),1),zs),Hi),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,L2),Oh),"Node Spacing"),"The minimal distance to be preserved between each two nodes."),20),zs),Hi),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,S5e),Oh),"Node Self Loop Spacing"),"Spacing to be preserved between a node and its self loops."),10),zs),Hi),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,E5e),Oh),"Port Spacing"),"Spacing between pairs of ports of the same node."),10),zs),Hi),Gr(It,ie(re($h,1),Pe,160,0,[Pi]))))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,_5e),Oh),"Individual Spacing"),"Allows to specify individual spacing values for graph elements that shall be different from the value specified for the element's parent."),Fh),HOt),Gr(Pi,ie(re($h,1),Pe,160,0,[rh,lm,r0]))))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,J5e),Oh),"Additional Port Space"),"Additional space around the sets of ports on each node side. For each side of a node, this option can reserve additional space before and after the ports on each side. For example, a top spacing of 20 makes sure that the first port on the western and eastern side is 20 units away from the northern border."),u9e),Fh),O4e),lt(It)))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,Fie),c_t),"Layout Partition"),"Partition to which the node belongs. This requires Layout Partitioning to be active. Nodes with lower partition IDs will appear to the left of nodes with higher partition IDs (assuming a left-to-right layout direction)."),no),Qi),Gr(It,ie(re($h,1),Pe,160,0,[Pi]))))),gi(r,Fie,$ie,iOt),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,$ie),c_t),"Layout Partitioning"),"Whether to activate partitioned layout. This will allow to group nodes through the Layout Partition option. a pair of nodes with different partition indices is then placed such that the node with lower index is placed to the left of the other node (with left-to-right layout direction). Depending on the layout algorithm, this may only be guaranteed to work if all nodes have a layout partition configured, or at least if edges that cross partitions are not part of a partition-crossing cycle."),YDe),ns),Ci),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,I5e),u_t),"Node Label Padding"),"Define padding for node labels that are placed inside of a node."),WDe),Fh),L4e),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,CT),u_t),"Node Label Placement"),"Hints for where node labels are to be placed; if empty, the node label's position is not modified."),qDe),wE),To),Gr(Pi,ie(re($h,1),Pe,160,0,[r0]))))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,P5e),gU),"Port Alignment"),"Defines the default port distribution for a node. May be overridden for each side individually."),QDe),li),Uj),lt(Pi)))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,R5e),gU),"Port Alignment (North)"),"Defines how ports on the northern side are placed, overriding the node's general port alignment."),li),Uj),lt(Pi)))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,$5e),gU),"Port Alignment (South)"),"Defines how ports on the southern side are placed, overriding the node's general port alignment."),li),Uj),lt(Pi)))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,F5e),gU),"Port Alignment (West)"),"Defines how ports on the western side are placed, overriding the node's general port alignment."),li),Uj),lt(Pi)))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,B5e),gU),"Port Alignment (East)"),"Defines how ports on the eastern side are placed, overriding the node's general port alignment."),li),Uj),lt(Pi)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,Xk),use),"Node Size Constraints"),"What should be taken into account when calculating a node's size. Empty size constraints specify that a node's size is already fixed and should not be changed."),GDe),wE),Gj),lt(Pi)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,GS),use),"Node Size Options"),"Options modifying the behavior of the size constraints set on a node. Each member of the set specifies something that should be taken into account when calculating node sizes. The empty set corresponds to no further modifications."),KDe),wE),O9e),lt(Pi)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,VS),use),"Node Size Minimum"),"The minimal size to which a node can be reduced."),VDe),Fh),ws),lt(Pi)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,kT),use),"Fixed Graph Size"),"By default, the fixed layout provider will enlarge a graph until it is large enough to contain its children. If this option is set, it won't do so."),!1),ns),Ci),lt(It)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,U5e),Lie),"Edge Label Placement"),"Gives a hint on where to put edge labels."),ODe),li),g9e),lt(r0)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,BH),Lie),"Inline Edge Labels"),"If true, an edge label is placed directly on its edge. May only apply to center edge labels. This kind of label placement is only advisable if the label's rendering is such that it is not crossed by its edge and thus stays legible."),!1),ns),Ci),lt(r0)))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,WPn),"font"),"Font Name"),"Font name used for a label."),yE),Ye),lt(r0)))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,a_t),"font"),"Font Size"),"Font size used for a label."),no),Qi),lt(r0)))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,V5e),dse),"Port Anchor Offset"),"The offset to the port position where connections shall be attached."),Fh),ws),lt(lm)))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,W5e),dse),"Port Index"),"The index of a port in the fixed order around a node. The order is assumed as clockwise, starting with the leftmost port on the top side. This option must be set if 'Port Constraints' is set to FIXED_ORDER and no specific positions are given for the ports. Additionally, the option 'Port Side' must be defined in this case."),no),Qi),lt(lm)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,M5e),dse),"Port Side"),"The side of a node on which a port is situated. This option must be set if 'Port Constraints' is set to FIXED_SIDE or FIXED_ORDER and no specific positions are given for the ports."),r9e),li),go),lt(lm)))),ot(r,new Qe(it(rt(st(Ze(nt(et(tt(new Xe,T5e),dse),"Port Border Offset"),"The offset of ports on the node border. With a positive offset the port is moved outside of the node, while with a negative offset the port is moved towards the inside. An offset of 0 means that the port is placed directly on the node border, i.e. if the port side is north, the port's south border touches the nodes's north border; if the port side is east, the port's west border touches the nodes's east border; if the port side is south, the port's north border touches the node's south border; if the port side is west, the port's east border touches the node's west border."),zs),Hi),lt(lm)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,ST),V_e),"Port Label Placement"),"Decides on a placement method for port labels; if empty, the node label's position is not modified."),t9e),wE),Fq),lt(Pi)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,O5e),V_e),"Port Labels Next to Port"),"Use 'portLabels.placement': NEXT_TO_PORT_OF_POSSIBLE."),!1),ns),Ci),lt(Pi)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,L5e),V_e),"Treat Port Labels as Group"),"If this option is true (default), the labels of a port will be treated as a group when it comes to centering them next to their port. If this option is false, only the first label will be centered next to the port, with the others being placed below. This only applies to labels of eastern and western ports and will have no effect if labels are not placed next to their port."),!0),ns),Ci),lt(Pi)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,lse),IT),"Number of size categories"),"Defines the number of categories to use for the FIXED_INTEGER_RATIO_BOXES size approximator."),Oe(3)),no),Qi),lt(It)))),gi(r,lse,cse,mOt),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,q_e),IT),"Weight of a node containing children for determining the graph size"),"When determining the graph size for the size categorisation, this value determines how many times a node containing children is weighted more than a simple node. For example setting this value to four would result in a graph containing a simple node and a hierarchical node to be counted as having a size of five."),Oe(4)),no),Qi),lt(It)))),gi(r,q_e,lse,null),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,MO),IT),"Topdown Scale Factor"),"The scaling factor to be applied to the nodes laid out within the node in recursive topdown layout. The difference to 'Scale Factor' is that the node itself is not scaled. This value has to be set on hierarchical nodes."),1),zs),Hi),lt(It)))),gi(r,MO,My,hOt),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,cse),IT),"Topdown Size Approximator"),"The size approximator to be used to set sizes of hierarchical nodes during topdown layout. The default value is null, which results in nodes keeping whatever size is defined for them e.g. through parent parallel node or by manually setting the size."),null),Fh),b7n),lt(Pi)))),gi(r,cse,My,pOt),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,NO),IT),"Topdown Hierarchical Node Width"),"The fixed size of a hierarchical node when using topdown layout. If this value is set on a parallel node it applies to its children, when set on a hierarchical node it applies to the node itself."),150),zs),Hi),Gr(It,ie(re($h,1),Pe,160,0,[Pi]))))),gi(r,NO,My,null),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,jO),IT),"Topdown Hierarchical Node Aspect Ratio"),"The fixed aspect ratio of a hierarchical node when using topdown layout. Default is 1/sqrt(2). If this value is set on a parallel node it applies to its children, when set on a hierarchical node it applies to the node itself."),1.414),zs),Hi),Gr(It,ie(re($h,1),Pe,160,0,[Pi]))))),gi(r,jO,My,null),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,My),IT),"Topdown Node Type"),"The different node types used for topdown layout. If the node type is set to {@link TopdownNodeTypes.PARALLEL_NODE} the algorithm must be set to a {@link TopdownLayoutProvider} such as {@link TopdownPacking}. The {@link nodeSize.fixedGraphSize} option is technically only required for hierarchical nodes."),null),li),P9e),lt(Pi)))),gi(r,My,kT,null),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,G_e),IT),"Topdown Scale Cap"),"Determines the upper limit for the topdown scale factor. The default value is 1.0 which ensures that nested children never end up appearing larger than their parents in terms of unit sizes such as the font size. If the limit is larger, nodes will fully utilize the available space, but it is counteriniuitive for inner nodes to have a larger scale than outer nodes."),1),zs),Hi),lt(It)))),gi(r,G_e,My,fOt),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,j5e),d_t),"Activate Inside Self Loops"),"Whether this node allows to route self loops inside of it instead of around it. If set to true, this will make the node a compound node if it isn't already, and will require the layout algorithm to support compound nodes with hierarchical ports."),!1),ns),Ci),lt(Pi)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,D5e),d_t),"Inside Self Loop"),"Whether a self loop should be routed inside a node instead of around that node."),!1),ns),Ci),lt(rh)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,H5e),"edge"),"Edge Thickness"),"The thickness of an edge. This is a hint on the line width used to draw an edge, possibly requiring more space to be reserved for it."),1),zs),Hi),lt(rh)))),ot(r,new Qe(it(rt(st(mt(Ze(nt(et(tt(new Xe,l_t),"edge"),"Edge Type"),"The type of an edge. This is usually used for UML class diagrams, where associations must be handled differently from generalizations."),RDe),li),v9e),lt(rh)))),yA(r,new dS(hA(U5(H5(new jC,Ht),"Layered"),'The layer-based method was introduced by Sugiyama, Tagawa and Toda in 1981. It emphasizes the direction of edges by pointing as many edges as possible into the same direction. The nodes are arranged in layers, which are sometimes called "hierarchies", and then reordered such that the number of edge crossings is minimized. Afterwards, concrete coordinates are computed for the nodes and edge bend points.'))),yA(r,new dS(hA(U5(H5(new jC,"org.eclipse.elk.orthogonal"),"Orthogonal"),`Orthogonal methods that follow the "topology-shape-metrics" approach by Batini, Nardelli and Tamassia '86. The first phase determines the topology of the drawing by applying a planarization technique, which results in a planar representation of the graph. The orthogonal shape is computed in the second phase, which aims at minimizing the number of edge bends, and is called orthogonalization. The third phase leads to concrete coordinates for nodes and edge bend points by applying a compaction method, thus defining the metrics.`))),yA(r,new dS(hA(U5(H5(new jC,Ml),"Force"),"Layout algorithms that follow physical analogies by simulating a system of attractive and repulsive forces. The first successful method of this kind was proposed by Eades in 1984."))),yA(r,new dS(hA(U5(H5(new jC,"org.eclipse.elk.circle"),"Circle"),"Circular layout algorithms emphasize cycles or biconnected components of a graph by arranging them in circles. This is useful if a drawing is desired where such components are clearly grouped, or where cycles are shown as prominent OPTIONS of the graph."))),yA(r,new dS(hA(U5(H5(new jC,C5t),"Tree"),"Specialized layout methods for trees, i.e. acyclic graphs. The regular structure of graphs that have no undirected cycles can be emphasized using an algorithm of this type."))),yA(r,new dS(hA(U5(H5(new jC,"org.eclipse.elk.planar"),"Planar"),"Algorithms that require a planar or upward planar graph. Most of these algorithms are theoretically interesting, but not practically usable."))),yA(r,new dS(hA(U5(H5(new jC,ad),"Radial"),"Radial layout algorithms usually position the nodes of the graph on concentric circles."))),g3t((new wZe,r)),j3t((new bZe,r)),zkt((new yZe,r))};var xE,VIt,NDe,p4,KIt,JIt,jDe,cv,uv,YIt,LL,DDe,PL,aw,IDe,cce,uce,ODe,LDe,PDe,XIt,RDe,QIt,A3,$De,ZIt,RL,dce,$L,fce,eOt,FDe,tOt,BDe,M3,zDe,g4,HDe,UDe,WDe,N3,qDe,lw,GDe,dv,j3,VDe,D1,KDe,Iq,FL,rg,JDe,nOt,YDe,rOt,iOt,XDe,QDe,hce,pce,gce,mce,ZDe,Vc,$j,e9e,bce,wce,fv,t9e,n9e,D3,r9e,vE,BL,yce,hv,sOt,xce,oOt,aOt,lOt,cOt,i9e,s9e,kE,o9e,Oq,a9e,l9e,cm,uOt,c9e,u9e,d9e,m4,pv,b4,CE,dOt,fOt,Lq,hOt,Pq,pOt,gOt,mOt,bOt;O(xl,"CoreOptions",689),j(86,23,{3:1,35:1,23:1,86:1},w8);var Bh,Ho,Vo,zh,fd,Fj=_n(xl,"Direction",86,Ln,dvn,E1n),wOt;j(278,23,{3:1,35:1,23:1,278:1},X$);var Rq,zL,f9e,h9e,p9e=_n(xl,"EdgeCoords",278,Ln,O2n,_1n),yOt;j(279,23,{3:1,35:1,23:1,279:1},fQ);var w4,gv,y4,g9e=_n(xl,"EdgeLabelPlacement",279,Ln,jxn,T1n),xOt;j(222,23,{3:1,35:1,23:1,222:1},Q$);var x4,HL,SE,vce,kce=_n(xl,"EdgeRouting",222,Ln,L2n,S1n),vOt;j(327,23,{3:1,35:1,23:1,327:1},NA);var m9e,b9e,w9e,y9e,Cce,x9e,v9e=_n(xl,"EdgeType",327,Ln,tkn,L1n),kOt;j(973,1,Dh,wZe),b.tf=function(r){g3t(r)};var k9e,C9e,S9e,E9e,COt,_9e,Bj;O(xl,"FixedLayouterOptions",973),j(974,1,{},UJe),b.uf=function(){var r;return r=new QJe,r},b.vf=function(r){},O(xl,"FixedLayouterOptions/FixedFactory",974),j(347,23,{3:1,35:1,23:1,347:1},hQ);var um,$q,zj,T9e=_n(xl,"HierarchyHandling",347,Ln,Dxn,P1n),SOt,b7n=pi(xl,"ITopdownSizeApproximator");j(292,23,{3:1,35:1,23:1,292:1},Z$);var ig,I1,UL,WL,EOt=_n(xl,"LabelSide",292,Ln,P2n,O1n),_Ot;j(96,23,{3:1,35:1,23:1,96:1},ck);var i0,Tf,zd,Af,Ru,Mf,Hd,sg,Nf,To=_n(xl,"NodeLabelPlacement",96,Ln,n3n,N1n),TOt;j(257,23,{3:1,35:1,23:1,257:1},y8);var A9e,Hj,O1,M9e,qL,Uj=_n(xl,"PortAlignment",257,Ln,Cvn,j1n),AOt;j(102,23,{3:1,35:1,23:1,102:1},jA);var cw,Ka,og,v4,Hh,L1,N9e=_n(xl,"PortConstraints",102,Ln,ekn,D1n),MOt;j(280,23,{3:1,35:1,23:1,280:1},DA);var Wj,qj,s0,GL,P1,EE,Fq=_n(xl,"PortLabelPlacement",280,Ln,Zvn,I1n),NOt;j(64,23,{3:1,35:1,23:1,64:1},x8);var rn,Xt,hd,pd,Jl,Dl,Uh,jf,Tc,pc,dl,Ac,Yl,Xl,Df,$u,Fu,Ud,bn,ca,Qt,go=_n(xl,"PortSide",64,Ln,fvn,B1n),jOt;j(977,1,Dh,yZe),b.tf=function(r){zkt(r)};var DOt,IOt,j9e,OOt,LOt;O(xl,"RandomLayouterOptions",977),j(978,1,{},WJe),b.uf=function(){var r;return r=new tYe,r},b.vf=function(r){},O(xl,"RandomLayouterOptions/RandomFactory",978),j(300,23,{3:1,35:1,23:1,300:1},pQ);var VL,Sce,D9e,I9e=_n(xl,"ShapeCoords",300,Ln,Ixn,z1n),POt;j(380,23,{3:1,35:1,23:1,380:1},eF);var mv,KL,JL,uw,Gj=_n(xl,"SizeConstraint",380,Ln,$2n,H1n),ROt;j(266,23,{3:1,35:1,23:1,266:1},uk);var YL,Bq,k4,Ece,XL,Vj,zq,Hq,Uq,O9e=_n(xl,"SizeOptions",266,Ln,c3n,$1n),$Ot;j(281,23,{3:1,35:1,23:1,281:1},gQ);var bv,L9e,Wq,P9e=_n(xl,"TopdownNodeTypes",281,Ln,Oxn,F1n),FOt;j(288,23,bU);var R9e,_ce,$9e,F9e,QL=_n(xl,"TopdownSizeApproximator",288,Ln,R2n,R1n);j(969,288,bU,Hut),b.Sg=function(r){return Eyt(r)},_n(xl,"TopdownSizeApproximator/1",969,QL,null,null),j(970,288,bU,Sdt),b.Sg=function(r){var s,l,d,h,m,y,k,_,T,N,L,$,B,q,K,ne,fe,we,xe,Ne,_e,We,dt,ut,Ot;for(s=p(Le(r,(tr(),hv)),144),We=(Bm(),B=new aA,B),ZI(We,r),dt=new xn,m=new cn((!r.a&&(r.a=new De(Kn,r,10,11)),r.a));m.e!=m.i.gc();)d=p(fn(m),26),we=($=new aA,$),uH(we,We),ZI(we,d),Ot=Eyt(d),Vw(we,u.Math.max(d.g,Ot.a),u.Math.max(d.f,Ot.b)),ql(dt.f,d,we);for(h=new cn((!r.a&&(r.a=new De(Kn,r,10,11)),r.a));h.e!=h.i.gc();)for(d=p(fn(h),26),N=new cn((!d.e&&(d.e=new Rt(Wi,d,7,4)),d.e));N.e!=N.i.gc();)T=p(fn(N),85),Ne=p(ta(Po(dt.f,d)),26),_e=p(Wt(dt,be((!T.c&&(T.c=new Rt(En,T,5,8)),T.c),0)),26),xe=(L=new GY,L),jn((!xe.b&&(xe.b=new Rt(En,xe,4,7)),xe.b),Ne),jn((!xe.c&&(xe.c=new Rt(En,xe,5,8)),xe.c),_e),cH(xe,fi(Ne)),ZI(xe,T);K=p(G8(s.f),214);try{K.kf(We,new qY),dxe(s.f,K)}catch($t){throw $t=Oi($t),me($t,101)?(q=$t,Z(q)):Z($t)}return Gf(We,uv)||Gf(We,cv)||rre(We),_=ye(ke(Le(We,uv))),k=ye(ke(Le(We,cv))),y=_/k,l=ye(ke(Le(We,pv)))*u.Math.sqrt((!We.a&&(We.a=new De(Kn,We,10,11)),We.a).i),ut=p(Le(We,rg),104),fe=ut.b+ut.c+1,ne=ut.d+ut.a+1,new Re(u.Math.max(fe,l),u.Math.max(ne,l/y))},_n(xl,"TopdownSizeApproximator/2",970,QL,null,null),j(971,288,bU,Yft),b.Sg=function(r){var s,l,d,h,m,y;return l=ye(ke(Le(r,(tr(),pv)))),s=l/ye(ke(Le(r,m4))),d=c8n(r),m=p(Le(r,rg),104),h=ye(ke(qe(cm))),fi(r)&&(h=ye(ke(Le(fi(r),cm)))),y=Dg(new Re(l,s),d),Nr(y,new Re(-(m.b+m.c)-h,-(m.d+m.a)-h))},_n(xl,"TopdownSizeApproximator/3",971,QL,null,null),j(972,288,bU,Edt),b.Sg=function(r){var s,l,d,h,m,y,k,_,T,N;for(y=new cn((!r.a&&(r.a=new De(Kn,r,10,11)),r.a));y.e!=y.i.gc();)m=p(fn(y),26),Le(m,(tr(),Pq))!=null&&(!m.a&&(m.a=new De(Kn,m,10,11)),!!m.a)&&(!m.a&&(m.a=new De(Kn,m,10,11)),m.a).i>0?(l=p(Le(m,Pq),521),N=l.Sg(m),T=p(Le(m,rg),104),Vw(m,u.Math.max(m.g,N.a+T.b+T.c),u.Math.max(m.f,N.b+T.d+T.a))):(!m.a&&(m.a=new De(Kn,m,10,11)),m.a).i!=0&&Vw(m,ye(ke(Le(m,pv))),ye(ke(Le(m,pv)))/ye(ke(Le(m,m4))));s=p(Le(r,(tr(),hv)),144),_=p(G8(s.f),214);try{_.kf(r,new qY),dxe(s.f,_)}catch(L){throw L=Oi(L),me(L,101)?(k=L,Z(k)):Z(L)}return $r(r,xE,OT),Bpt(r),rre(r),h=ye(ke(Le(r,uv))),d=ye(ke(Le(r,cv))),new Re(h,d)},_n(xl,"TopdownSizeApproximator/4",972,QL,null,null);var BOt;j(345,1,{852:1},RC),b.Tg=function(r,s){return $xt(this,r,s)},b.Ug=function(){u2t(this)},b.Vg=function(){return this.q},b.Wg=function(){return this.f?aB(this.f):null},b.Xg=function(){return aB(this.a)},b.Yg=function(){return this.p},b.Zg=function(){return!1},b.$g=function(){return this.n},b._g=function(){return this.p!=null&&!this.b},b.ah=function(r){var s;this.n&&(s=r,Be(this.f,s))},b.bh=function(r,s){var l,d;this.n&&r&&Qxn(this,(l=new Fdt,d=Pne(l,r),KOn(l),d),(hz(),Ace))},b.dh=function(r){var s;return this.b?null:(s=Fkn(this,this.g),rr(this.a,s),s.i=this,this.d=r,s)},b.eh=function(r){r>0&&!this.b&&lve(this,r)},b.b=!1,b.c=0,b.d=-1,b.e=null,b.f=null,b.g=-1,b.j=!1,b.k=!1,b.n=!1,b.o=0,b.q=0,b.r=0,O(Ta,"BasicProgressMonitor",345),j(706,214,Ay,qJe),b.kf=function(r,s){K3t(r,s)},O(Ta,"BoxLayoutProvider",706),j(965,1,ir,_nt),b.Le=function(r,s){return KNn(this,p(r,26),p(s,26))},b.Fb=function(r){return this===r},b.Me=function(){return new Yn(this)},b.a=!1,O(Ta,"BoxLayoutProvider/1",965),j(167,1,{167:1},WB,rct),b.Ib=function(){return this.c?tSe(this.c):Ah(this.b)},O(Ta,"BoxLayoutProvider/Group",167),j(326,23,{3:1,35:1,23:1,326:1},tF);var B9e,z9e,H9e,Tce,U9e=_n(Ta,"BoxLayoutProvider/PackingMode",326,Ln,F2n,U1n),zOt;j(966,1,ir,GJe),b.Le=function(r,s){return iyn(p(r,167),p(s,167))},b.Fb=function(r){return this===r},b.Me=function(){return new Yn(this)},O(Ta,"BoxLayoutProvider/lambda$0$Type",966),j(967,1,ir,VJe),b.Le=function(r,s){return Kwn(p(r,167),p(s,167))},b.Fb=function(r){return this===r},b.Me=function(){return new Yn(this)},O(Ta,"BoxLayoutProvider/lambda$1$Type",967),j(968,1,ir,KJe),b.Le=function(r,s){return Jwn(p(r,167),p(s,167))},b.Fb=function(r){return this===r},b.Me=function(){return new Yn(this)},O(Ta,"BoxLayoutProvider/lambda$2$Type",968),j(1338,1,{829:1},JJe),b.Lg=function(r,s){return M$(),!me(s,174)||sst((kS(),p(r,174)),s)},O(Ta,"ElkSpacings/AbstractSpacingsBuilder/lambda$0$Type",1338),j(1339,1,ln,Tnt),b.Ad=function(r){XCn(this.a,p(r,147))},O(Ta,"ElkSpacings/AbstractSpacingsBuilder/lambda$1$Type",1339),j(1340,1,ln,YJe),b.Ad=function(r){p(r,105),M$()},O(Ta,"ElkSpacings/AbstractSpacingsBuilder/lambda$2$Type",1340),j(1344,1,ln,Ant),b.Ad=function(r){C3n(this.a,p(r,105))},O(Ta,"ElkSpacings/AbstractSpacingsBuilder/lambda$3$Type",1344),j(1342,1,Vn,eat),b.Mb=function(r){return ICn(this.a,this.b,p(r,147))},O(Ta,"ElkSpacings/AbstractSpacingsBuilder/lambda$4$Type",1342),j(1341,1,Vn,tat),b.Mb=function(r){return Vgn(this.a,this.b,p(r,829))},O(Ta,"ElkSpacings/AbstractSpacingsBuilder/lambda$5$Type",1341),j(1343,1,ln,nat),b.Ad=function(r){Gbn(this.a,this.b,p(r,147))},O(Ta,"ElkSpacings/AbstractSpacingsBuilder/lambda$6$Type",1343),j(930,1,{},XJe),b.Kb=function(r){return Xat(r)},b.Fb=function(r){return this===r},O(Ta,"ElkUtil/lambda$0$Type",930),j(931,1,ln,rat),b.Ad=function(r){QAn(this.a,this.b,p(r,85))},b.a=0,b.b=0,O(Ta,"ElkUtil/lambda$1$Type",931),j(932,1,ln,iat),b.Ad=function(r){Kfn(this.a,this.b,p(r,170))},b.a=0,b.b=0,O(Ta,"ElkUtil/lambda$2$Type",932),j(933,1,ln,sat),b.Ad=function(r){Hpn(this.a,this.b,p(r,157))},b.a=0,b.b=0,O(Ta,"ElkUtil/lambda$3$Type",933),j(934,1,ln,Mnt),b.Ad=function(r){gbn(this.a,p(r,372))},O(Ta,"ElkUtil/lambda$4$Type",934),j(331,1,{35:1,331:1},Cfn),b.Dd=function(r){return hgn(this,p(r,242))},b.Fb=function(r){var s;return me(r,331)?(s=p(r,331),this.a==s.a):!1},b.Hb=function(){return Qs(this.a)},b.Ib=function(){return this.a+" (exclusive)"},b.a=0,O(Ta,"ExclusiveBounds/ExclusiveLowerBound",331),j(1088,214,Ay,QJe),b.kf=function(r,s){var l,d,h,m,y,k,_,T,N,L,$,B,q,K,ne,fe,we,xe,Ne,_e,We,dt,ut;for(s.Tg("Fixed Layout",1),m=p(Le(r,(tr(),LDe)),222),L=0,$=0,we=new cn((!r.a&&(r.a=new De(Kn,r,10,11)),r.a));we.e!=we.i.gc();){for(ne=p(fn(we),26),ut=p(Le(ne,(pz(),Bj)),8),ut&&(Ju(ne,ut.a,ut.b),p(Le(ne,C9e),182).Gc((du(),mv))&&(B=p(Le(ne,E9e),8),B.a>0&&B.b>0&&Sy(ne,B.a,B.b,!0,!0))),L=u.Math.max(L,ne.i+ne.g),$=u.Math.max($,ne.j+ne.f),T=new cn((!ne.n&&(ne.n=new De(ua,ne,1,7)),ne.n));T.e!=T.i.gc();)k=p(fn(T),157),ut=p(Le(k,Bj),8),ut&&Ju(k,ut.a,ut.b),L=u.Math.max(L,ne.i+k.i+k.g),$=u.Math.max($,ne.j+k.j+k.f);for(_e=new cn((!ne.c&&(ne.c=new De(Kc,ne,9,9)),ne.c));_e.e!=_e.i.gc();)for(Ne=p(fn(_e),125),ut=p(Le(Ne,Bj),8),ut&&Ju(Ne,ut.a,ut.b),We=ne.i+Ne.i,dt=ne.j+Ne.j,L=u.Math.max(L,We+Ne.g),$=u.Math.max($,dt+Ne.f),_=new cn((!Ne.n&&(Ne.n=new De(ua,Ne,1,7)),Ne.n));_.e!=_.i.gc();)k=p(fn(_),157),ut=p(Le(k,Bj),8),ut&&Ju(k,ut.a,ut.b),L=u.Math.max(L,We+k.i+k.g),$=u.Math.max($,dt+k.j+k.f);for(h=new Jt(en(u1(ne).a.Jc(),new M));pn(h);)l=p(an(h),85),N=oSt(l),L=u.Math.max(L,N.a),$=u.Math.max($,N.b);for(d=new Jt(en(kne(ne).a.Jc(),new M));pn(d);)l=p(an(d),85),fi(lne(l))!=r&&(N=oSt(l),L=u.Math.max(L,N.a),$=u.Math.max($,N.b))}if(m==(Gg(),x4))for(fe=new cn((!r.a&&(r.a=new De(Kn,r,10,11)),r.a));fe.e!=fe.i.gc();)for(ne=p(fn(fe),26),d=new Jt(en(u1(ne).a.Jc(),new M));pn(d);)l=p(an(d),85),y=K9n(l),y.b==0?$r(l,M3,null):$r(l,M3,y);Je(Ke(Le(r,(pz(),S9e))))||(xe=p(Le(r,COt),104),K=L+xe.b+xe.c,q=$+xe.d+xe.a,Sy(r,K,q,!0,!0)),s.Ug()},O(Ta,"FixedLayoutProvider",1088),j(379,150,{3:1,414:1,379:1,105:1,150:1},WY,K0t),b.ag=function(r){var s,l,d,h,m,y,k,_,T;if(r)try{for(_=M2(r,";,;"),m=_,y=0,k=m.length;y<k;++y){if(h=m[y],l=M2(h,"\\:"),d=OSe(hM(),l[0]),!d)throw Z(new Kt("Invalid option id: "+l[0]));if(T=DSe(d,l[1]),T==null)throw Z(new Kt("Invalid option value: "+l[1]));T==null?(!this.q&&(this.q=new xn),gS(this.q,d)):(!this.q&&(this.q=new xn),cr(this.q,d,T))}}catch(N){throw N=Oi(N),me(N,101)?(s=N,Z(new Nbt(s))):Z(N)}},b.Ib=function(){var r;return r=Un(vc(pl((this.q?this.q:(At(),At(),Zp)).vc().Mc(),new ZJe),mkn(new kut,new er,new Bt,new dn,ie(re(Kl,1),Pe,130,0,[])))),r};var HOt=O(Ta,"IndividualSpacings",379);j(964,1,{},ZJe),b.Kb=function(r){return syn(p(r,45))},O(Ta,"IndividualSpacings/lambda$0$Type",964),j(708,1,{},tdt),b.c=0,O(Ta,"InstancePool",708),j(1816,1,{},eYe),O(Ta,"LoggedGraph",1816),j(407,23,{3:1,35:1,23:1,407:1},nF);var W9e,Ace,q9e,G9e,UOt=_n(Ta,"LoggedGraph/Type",407,Ln,B2n,W1n),WOt;j(614,1,{852:1},qY),b.Tg=function(r,s){return!1},b.Ug=function(){},b.Vg=function(){return 0},b.Wg=function(){return null},b.Xg=function(){return null},b.Yg=function(){return null},b.Zg=function(){return!1},b.$g=function(){return!1},b._g=function(){return!1},b.ah=function(r){},b.bh=function(r,s){},b.dh=function(r){return this},b.eh=function(r){},O(Ta,"NullElkProgressMonitor",614),j(49,1,{20:1,49:1},fo),b.Ic=function(r){Ws(this,r)},b.Fb=function(r){var s,l,d;return me(r,49)?(l=p(r,49),s=this.a==null?l.a==null:Tr(this.a,l.a),d=this.b==null?l.b==null:Tr(this.b,l.b),s&&d):!1},b.Hb=function(){var r,s,l,d,h,m;return l=this.a==null?0:Jr(this.a),r=l&Ki,s=l&-65536,m=this.b==null?0:Jr(this.b),d=m&Ki,h=m&-65536,r^h>>16&Ki|s^d<<16},b.Jc=function(){return new Nnt(this)},b.Ib=function(){return this.a==null&&this.b==null?"pair(null,null)":this.a==null?"pair(null,"+Yo(this.b)+")":this.b==null?"pair("+Yo(this.a)+",null)":"pair("+Yo(this.a)+","+Yo(this.b)+")"},O(Ta,"Pair",49),j(979,1,Ts,Nnt),b.Nb=function(r){Bs(this,r)},b.Ob=function(){return!this.c&&(!this.b&&this.a.a!=null||this.a.b!=null)},b.Pb=function(){if(!this.c&&!this.b&&this.a.a!=null)return this.b=!0,this.a.a;if(!this.c&&this.a.b!=null)return this.c=!0,this.a.b;throw Z(new Zo)},b.Qb=function(){throw this.c&&this.a.b!=null?this.a.b=null:this.b&&this.a.a!=null&&(this.a.a=null),Z(new sc)},b.b=!1,b.c=!1,O(Ta,"Pair/1",979),j(1078,214,Ay,tYe),b.kf=function(r,s){var l,d,h,m,y;if(s.Tg("Random Layout",1),(!r.a&&(r.a=new De(Kn,r,10,11)),r.a).i==0){s.Ug();return}m=p(Le(r,(Tke(),OOt)),15),m&&m.a!=0?h=new SB(m.a):h=new gte,l=Z9(ke(Le(r,DOt))),y=Z9(ke(Le(r,LOt))),d=p(Le(r,IOt),104),gLn(r,h,l,y,d),s.Ug()},O(Ta,"RandomLayoutProvider",1078),j(240,1,{240:1},JQ),b.Fb=function(r){return Ba(this.a,p(r,240).a)&&Ba(this.b,p(r,240).b)&&Ba(this.c,p(r,240).c)},b.Hb=function(){return gz(ie(re(cs,1),Pt,1,5,[this.a,this.b,this.c]))},b.Ib=function(){return"("+this.a+yl+this.b+yl+this.c+")"},O(Ta,"Triple",240);var qOt;j(550,1,{}),b.Jf=function(){return new Re(this.f.i,this.f.j)},b.mf=function(r){return Vft(r,(tr(),Vc))?Le(this.f,GOt):Le(this.f,r)},b.Kf=function(){return new Re(this.f.g,this.f.f)},b.Lf=function(){return this.g},b.nf=function(r){return Gf(this.f,r)},b.Mf=function(r){zc(this.f,r.a),Hc(this.f,r.b)},b.Nf=function(r){uy(this.f,r.a),cy(this.f,r.b)},b.Of=function(r){this.g=r},b.g=0;var GOt;O(CN,"ElkGraphAdapters/AbstractElkGraphElementAdapter",550),j(552,1,{837:1},o$),b.Pf=function(){var r,s;if(!this.b)for(this.b=bB(_Z(this.a).i),s=new cn(_Z(this.a));s.e!=s.i.gc();)r=p(fn(s),157),Be(this.b,new kX(r));return this.b},b.b=null,O(CN,"ElkGraphAdapters/ElkEdgeAdapter",552),j(260,550,{},Rm),b.Qf=function(){return qyt(this)},b.a=null,O(CN,"ElkGraphAdapters/ElkGraphAdapter",260),j(630,550,{187:1},kX),O(CN,"ElkGraphAdapters/ElkLabelAdapter",630),j(551,550,{685:1},xF),b.Pf=function(){return k_n(this)},b.Tf=function(){var r;return r=p(Le(this.f,(tr(),g4)),140),!r&&(r=new oA),r},b.Vf=function(){return C_n(this)},b.Xf=function(r){var s;s=new GQ(r),$r(this.f,(tr(),g4),s)},b.Yf=function(r){$r(this.f,(tr(),rg),new cye(r))},b.Rf=function(){return this.d},b.Sf=function(){var r,s;if(!this.a)for(this.a=new ze,s=new Jt(en(kne(p(this.f,26)).a.Jc(),new M));pn(s);)r=p(an(s),85),Be(this.a,new o$(r));return this.a},b.Uf=function(){var r,s;if(!this.c)for(this.c=new ze,s=new Jt(en(u1(p(this.f,26)).a.Jc(),new M));pn(s);)r=p(an(s),85),Be(this.c,new o$(r));return this.c},b.Wf=function(){return sB(p(this.f,26)).i!=0||Je(Ke(p(this.f,26).mf((tr(),RL))))},b.Zf=function(){xkn(this,(pb(),qOt))},b.a=null,b.b=null,b.c=null,b.d=null,b.e=null,O(CN,"ElkGraphAdapters/ElkNodeAdapter",551),j(1249,550,{836:1},jnt),b.Pf=function(){return N_n(this)},b.Sf=function(){var r,s;if(!this.a)for(this.a=Rp(p(this.f,125).gh().i),s=new cn(p(this.f,125).gh());s.e!=s.i.gc();)r=p(fn(s),85),Be(this.a,new o$(r));return this.a},b.Uf=function(){var r,s;if(!this.c)for(this.c=Rp(p(this.f,125).hh().i),s=new cn(p(this.f,125).hh());s.e!=s.i.gc();)r=p(fn(s),85),Be(this.c,new o$(r));return this.c},b.$f=function(){return p(p(this.f,125).mf((tr(),D3)),64)},b._f=function(){var r,s,l,d,h,m,y,k;for(d=xh(p(this.f,125)),l=new cn(p(this.f,125).hh());l.e!=l.i.gc();)for(r=p(fn(l),85),k=new cn((!r.c&&(r.c=new Rt(En,r,5,8)),r.c));k.e!=k.i.gc();){if(y=p(fn(k),84),u2(Go(y),d))return!0;if(Go(y)==d&&Je(Ke(Le(r,(tr(),dce)))))return!0}for(s=new cn(p(this.f,125).gh());s.e!=s.i.gc();)for(r=p(fn(s),85),m=new cn((!r.b&&(r.b=new Rt(En,r,4,7)),r.b));m.e!=m.i.gc();)if(h=p(fn(m),84),u2(Go(h),d))return!0;return!1},b.a=null,b.b=null,b.c=null,O(CN,"ElkGraphAdapters/ElkPortAdapter",1249),j(1250,1,ir,nYe),b.Le=function(r,s){return BDn(p(r,125),p(s,125))},b.Fb=function(r){return this===r},b.Me=function(){return new Yn(this)},O(CN,"ElkGraphAdapters/PortComparator",1250);var R1=pi(ld,"EObject"),C4=pi(t3,p_t),Bu=pi(t3,g_t),ZL=pi(t3,m_t),eP=pi(t3,"ElkShape"),En=pi(t3,b_t),Wi=pi(t3,J_e),ii=pi(t3,w_t),tP=pi(ld,y_t),Kj=pi(ld,"EFactory"),VOt,Mce=pi(ld,x_t),ih=pi(ld,"EPackage"),ys,KOt,JOt,V9e,qq,YOt,K9e,J9e,Y9e,ag,XOt,QOt,ua=pi(t3,Y_e),Kn=pi(t3,X_e),Kc=pi(t3,Q_e);j(93,1,v_t),b.qh=function(){return this.rh(),null},b.rh=function(){return null},b.sh=function(){return this.rh(),!1},b.th=function(){return!1},b.uh=function(r){Er(this,r)},O(YS,"BasicNotifierImpl",93),j(100,93,E_t),b.Vh=function(){return ru(this)},b.vh=function(r,s){return r},b.wh=function(){throw Z(new zn)},b.xh=function(r){var s;return s=yo(p(Dt(this.Ah(),this.Ch()),19)),this.Mh().Qh(this,s.n,s.f,r)},b.yh=function(r,s){throw Z(new zn)},b.zh=function(r,s,l){return Du(this,r,s,l)},b.Ah=function(){var r;return this.wh()&&(r=this.wh().Lk(),r)?r:this.fi()},b.Bh=function(){return xne(this)},b.Ch=function(){throw Z(new zn)},b.Dh=function(){var r,s;return s=this.Xh().Mk(),!s&&this.wh().Rk(s=(vA(),r=_xe(fp(this.Ah())),r==null?Rce:new _8(this,r))),s},b.Eh=function(r,s){return r},b.Fh=function(r){var s;return s=r.nk(),s?r.Jj():hi(this.Ah(),r)},b.Gh=function(){var r;return r=this.wh(),r?r.Ok():null},b.Hh=function(){return this.wh()?this.wh().Lk():null},b.Ih=function(r,s,l){return Rz(this,r,s,l)},b.Jh=function(r){return w_(this,r)},b.Kh=function(r,s){return oee(this,r,s)},b.Lh=function(){var r;return r=this.wh(),!!r&&r.Pk()},b.Mh=function(){throw Z(new zn)},b.Nh=function(){return Dz(this)},b.Oh=function(r,s,l,d){return AS(this,r,s,d)},b.Ph=function(r,s,l){var d;return d=p(Dt(this.Ah(),s),69),d.uk().xk(this,this.ei(),s-this.gi(),r,l)},b.Qh=function(r,s,l,d){return uB(this,r,s,d)},b.Rh=function(r,s,l){var d;return d=p(Dt(this.Ah(),s),69),d.uk().yk(this,this.ei(),s-this.gi(),r,l)},b.Sh=function(){return!!this.wh()&&!!this.wh().Nk()},b.Th=function(r){return Nte(this,r)},b.Uh=function(r){return lht(this,r)},b.Wh=function(r){return UCt(this,r)},b.Xh=function(){throw Z(new zn)},b.Yh=function(){return this.wh()?this.wh().Nk():null},b.Zh=function(){return Dz(this)},b.$h=function(r,s){gne(this,r,s)},b._h=function(r){this.Xh().Qk(r)},b.ai=function(r){this.Xh().Tk(r)},b.bi=function(r){this.Xh().Sk(r)},b.ci=function(r,s){var l,d,h,m;return m=this.Gh(),m&&r&&(s=co(m.Cl(),this,s),m.Gl(this)),d=this.Mh(),d&&(Ine(this,this.Mh(),this.Ch()).Bb&ho?(h=d.Nh(),h&&(r?!m&&h.Gl(this):h.Fl(this))):(s=(l=this.Ch(),l>=0?this.xh(s):this.Mh().Qh(this,-1-l,null,s)),s=this.zh(null,-1,s))),this.ai(r),s},b.di=function(r){var s,l,d,h,m,y,k,_;if(l=this.Ah(),m=hi(l,r),s=this.gi(),m>=s)return p(r,69).uk().Bk(this,this.ei(),m-s);if(m<=-1)if(y=Gk((dc(),Hs),l,r),y){if(wo(),p(y,69).vk()||(y=fS($o(Hs,y))),h=(d=this.Fh(y),p(d>=0?this.Ih(d,!0,!0):vy(this,y,!0),163)),_=y.Gk(),_>1||_==-1)return p(p(h,219).Ql(r,!1),77)}else throw Z(new Kt(y1+r.ve()+fse));else if(r.Hk())return d=this.Fh(r),p(d>=0?this.Ih(d,!1,!0):vy(this,r,!1),77);return k=new vat(this,r),k},b.ei=function(){return O2e(this)},b.fi=function(){return(Gm(),Ut).S},b.gi=function(){return mn(this.fi())},b.hi=function(r){fne(this,r)},b.Ib=function(){return wf(this)},O(Gt,"BasicEObjectImpl",100);var ZOt;j(117,100,{109:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1}),b.ii=function(r){var s;return s=L2e(this),s[r]},b.ji=function(r,s){var l;l=L2e(this),Ni(l,r,s)},b.ki=function(r){var s;s=L2e(this),Ni(s,r,null)},b.qh=function(){return p(Yt(this,4),129)},b.rh=function(){throw Z(new zn)},b.sh=function(){return(this.Db&4)!=0},b.wh=function(){throw Z(new zn)},b.li=function(r){_S(this,2,r)},b.yh=function(r,s){this.Db=s<<16|this.Db&255,this.li(r)},b.Ah=function(){return zl(this)},b.Ch=function(){return this.Db>>16},b.Dh=function(){var r,s;return vA(),s=_xe(fp((r=p(Yt(this,16),29),r||this.fi()))),s==null?Rce:new _8(this,s)},b.th=function(){return(this.Db&1)==0},b.Gh=function(){return p(Yt(this,128),1996)},b.Hh=function(){return p(Yt(this,16),29)},b.Lh=function(){return(this.Db&32)!=0},b.Mh=function(){return p(Yt(this,2),52)},b.Sh=function(){return(this.Db&64)!=0},b.Xh=function(){throw Z(new zn)},b.Yh=function(){return p(Yt(this,64),290)},b._h=function(r){_S(this,16,r)},b.ai=function(r){_S(this,128,r)},b.bi=function(r){_S(this,64,r)},b.ei=function(){return Tl(this)},b.Db=0,O(Gt,"MinimalEObjectImpl",117),j(118,117,{109:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),b.li=function(r){this.Cb=r},b.Mh=function(){return this.Cb},O(Gt,"MinimalEObjectImpl/Container",118),j(2045,118,{109:1,343:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),b.Ih=function(r,s,l){return Yke(this,r,s,l)},b.Rh=function(r,s,l){return F3e(this,r,s,l)},b.Th=function(r){return Uxe(this,r)},b.$h=function(r,s){Pve(this,r,s)},b.fi=function(){return Ia(),QOt},b.hi=function(r){Cve(this,r)},b.lf=function(){return dyt(this)},b.fh=function(){return!this.o&&(this.o=new cc((Ia(),ag),dm,this,0)),this.o},b.mf=function(r){return Le(this,r)},b.nf=function(r){return Gf(this,r)},b.of=function(r,s){return $r(this,r,s)},O(Gb,"EMapPropertyHolderImpl",2045),j(559,118,{109:1,372:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},XR),b.Ih=function(r,s,l){switch(r){case 0:return this.a;case 1:return this.b}return Rz(this,r,s,l)},b.Th=function(r){switch(r){case 0:return this.a!=0;case 1:return this.b!=0}return Nte(this,r)},b.$h=function(r,s){switch(r){case 0:qB(this,ye(ke(s)));return;case 1:GB(this,ye(ke(s)));return}gne(this,r,s)},b.fi=function(){return Ia(),KOt},b.hi=function(r){switch(r){case 0:qB(this,0);return;case 1:GB(this,0);return}fne(this,r)},b.Ib=function(){var r;return this.Db&64?wf(this):(r=new Nd(wf(this)),r.a+=" (x: ",sk(r,this.a),r.a+=", y: ",sk(r,this.b),r.a+=")",r.a)},b.a=0,b.b=0,O(Gb,"ElkBendPointImpl",559),j(727,2045,{109:1,343:1,174:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),b.Ih=function(r,s,l){return tke(this,r,s,l)},b.Ph=function(r,s,l){return ine(this,r,s,l)},b.Rh=function(r,s,l){return Uee(this,r,s,l)},b.Th=function(r){return bve(this,r)},b.$h=function(r,s){g3e(this,r,s)},b.fi=function(){return Ia(),YOt},b.hi=function(r){Xve(this,r)},b.ih=function(){return this.k},b.jh=function(){return _Z(this)},b.Ib=function(){return pte(this)},b.k=null,O(Gb,"ElkGraphElementImpl",727),j(728,727,{109:1,343:1,174:1,276:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),b.Ih=function(r,s,l){return pke(this,r,s,l)},b.Th=function(r){return vke(this,r)},b.$h=function(r,s){m3e(this,r,s)},b.fi=function(){return Ia(),XOt},b.hi=function(r){_ke(this,r)},b.kh=function(){return this.f},b.lh=function(){return this.g},b.mh=function(){return this.i},b.nh=function(){return this.j},b.oh=function(r,s){Vw(this,r,s)},b.ph=function(r,s){Ju(this,r,s)},b.Ib=function(){return une(this)},b.f=0,b.g=0,b.i=0,b.j=0,O(Gb,"ElkShapeImpl",728),j(729,728,{109:1,343:1,84:1,174:1,276:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1}),b.Ih=function(r,s,l){return Wke(this,r,s,l)},b.Ph=function(r,s,l){return c3e(this,r,s,l)},b.Rh=function(r,s,l){return u3e(this,r,s,l)},b.Th=function(r){return Dve(this,r)},b.$h=function(r,s){CCe(this,r,s)},b.fi=function(){return Ia(),JOt},b.hi=function(r){Fke(this,r)},b.gh=function(){return!this.d&&(this.d=new Rt(Wi,this,8,5)),this.d},b.hh=function(){return!this.e&&(this.e=new Rt(Wi,this,7,4)),this.e},O(Gb,"ElkConnectableShapeImpl",729),j(271,727,{109:1,343:1,85:1,174:1,271:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},GY),b.xh=function(r){return s3e(this,r)},b.Ih=function(r,s,l){switch(r){case 3:return r2(this);case 4:return!this.b&&(this.b=new Rt(En,this,4,7)),this.b;case 5:return!this.c&&(this.c=new Rt(En,this,5,8)),this.c;case 6:return!this.a&&(this.a=new De(ii,this,6,6)),this.a;case 7:return zt(),!this.b&&(this.b=new Rt(En,this,4,7)),!(this.b.i<=1&&(!this.c&&(this.c=new Rt(En,this,5,8)),this.c.i<=1));case 8:return zt(),!!UM(this);case 9:return zt(),!!xy(this);case 10:return zt(),!this.b&&(this.b=new Rt(En,this,4,7)),this.b.i!=0&&(!this.c&&(this.c=new Rt(En,this,5,8)),this.c.i!=0)}return tke(this,r,s,l)},b.Ph=function(r,s,l){var d;switch(s){case 3:return this.Cb&&(l=(d=this.Db>>16,d>=0?s3e(this,l):this.Cb.Qh(this,-1-d,null,l))),zwe(this,p(r,26),l);case 4:return!this.b&&(this.b=new Rt(En,this,4,7)),wl(this.b,r,l);case 5:return!this.c&&(this.c=new Rt(En,this,5,8)),wl(this.c,r,l);case 6:return!this.a&&(this.a=new De(ii,this,6,6)),wl(this.a,r,l)}return ine(this,r,s,l)},b.Rh=function(r,s,l){switch(s){case 3:return zwe(this,null,l);case 4:return!this.b&&(this.b=new Rt(En,this,4,7)),co(this.b,r,l);case 5:return!this.c&&(this.c=new Rt(En,this,5,8)),co(this.c,r,l);case 6:return!this.a&&(this.a=new De(ii,this,6,6)),co(this.a,r,l)}return Uee(this,r,s,l)},b.Th=function(r){switch(r){case 3:return!!r2(this);case 4:return!!this.b&&this.b.i!=0;case 5:return!!this.c&&this.c.i!=0;case 6:return!!this.a&&this.a.i!=0;case 7:return!this.b&&(this.b=new Rt(En,this,4,7)),!(this.b.i<=1&&(!this.c&&(this.c=new Rt(En,this,5,8)),this.c.i<=1));case 8:return UM(this);case 9:return xy(this);case 10:return!this.b&&(this.b=new Rt(En,this,4,7)),this.b.i!=0&&(!this.c&&(this.c=new Rt(En,this,5,8)),this.c.i!=0)}return bve(this,r)},b.$h=function(r,s){switch(r){case 3:cH(this,p(s,26));return;case 4:!this.b&&(this.b=new Rt(En,this,4,7)),Tn(this.b),!this.b&&(this.b=new Rt(En,this,4,7)),Ti(this.b,p(s,18));return;case 5:!this.c&&(this.c=new Rt(En,this,5,8)),Tn(this.c),!this.c&&(this.c=new Rt(En,this,5,8)),Ti(this.c,p(s,18));return;case 6:!this.a&&(this.a=new De(ii,this,6,6)),Tn(this.a),!this.a&&(this.a=new De(ii,this,6,6)),Ti(this.a,p(s,18));return}g3e(this,r,s)},b.fi=function(){return Ia(),V9e},b.hi=function(r){switch(r){case 3:cH(this,null);return;case 4:!this.b&&(this.b=new Rt(En,this,4,7)),Tn(this.b);return;case 5:!this.c&&(this.c=new Rt(En,this,5,8)),Tn(this.c);return;case 6:!this.a&&(this.a=new De(ii,this,6,6)),Tn(this.a);return}Xve(this,r)},b.Ib=function(){return uCt(this)},O(Gb,"ElkEdgeImpl",271),j(443,2045,{109:1,343:1,170:1,443:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},YR),b.xh=function(r){return t3e(this,r)},b.Ih=function(r,s,l){switch(r){case 1:return this.j;case 2:return this.k;case 3:return this.b;case 4:return this.c;case 5:return!this.a&&(this.a=new Gi(Bu,this,5)),this.a;case 6:return aht(this);case 7:return s?Lte(this):this.i;case 8:return s?Ote(this):this.f;case 9:return!this.g&&(this.g=new Rt(ii,this,9,10)),this.g;case 10:return!this.e&&(this.e=new Rt(ii,this,10,9)),this.e;case 11:return this.d}return Yke(this,r,s,l)},b.Ph=function(r,s,l){var d,h,m;switch(s){case 6:return this.Cb&&(l=(h=this.Db>>16,h>=0?t3e(this,l):this.Cb.Qh(this,-1-h,null,l))),Hwe(this,p(r,85),l);case 9:return!this.g&&(this.g=new Rt(ii,this,9,10)),wl(this.g,r,l);case 10:return!this.e&&(this.e=new Rt(ii,this,10,9)),wl(this.e,r,l)}return m=p(Dt((d=p(Yt(this,16),29),d||(Ia(),qq)),s),69),m.uk().xk(this,Tl(this),s-mn((Ia(),qq)),r,l)},b.Rh=function(r,s,l){switch(s){case 5:return!this.a&&(this.a=new Gi(Bu,this,5)),co(this.a,r,l);case 6:return Hwe(this,null,l);case 9:return!this.g&&(this.g=new Rt(ii,this,9,10)),co(this.g,r,l);case 10:return!this.e&&(this.e=new Rt(ii,this,10,9)),co(this.e,r,l)}return F3e(this,r,s,l)},b.Th=function(r){switch(r){case 1:return this.j!=0;case 2:return this.k!=0;case 3:return this.b!=0;case 4:return this.c!=0;case 5:return!!this.a&&this.a.i!=0;case 6:return!!aht(this);case 7:return!!this.i;case 8:return!!this.f;case 9:return!!this.g&&this.g.i!=0;case 10:return!!this.e&&this.e.i!=0;case 11:return this.d!=null}return Uxe(this,r)},b.$h=function(r,s){switch(r){case 1:Nk(this,ye(ke(s)));return;case 2:jk(this,ye(ke(s)));return;case 3:Ak(this,ye(ke(s)));return;case 4:Mk(this,ye(ke(s)));return;case 5:!this.a&&(this.a=new Gi(Bu,this,5)),Tn(this.a),!this.a&&(this.a=new Gi(Bu,this,5)),Ti(this.a,p(s,18));return;case 6:ckt(this,p(s,85));return;case 7:ZB(this,p(s,84));return;case 8:QB(this,p(s,84));return;case 9:!this.g&&(this.g=new Rt(ii,this,9,10)),Tn(this.g),!this.g&&(this.g=new Rt(ii,this,9,10)),Ti(this.g,p(s,18));return;case 10:!this.e&&(this.e=new Rt(ii,this,10,9)),Tn(this.e),!this.e&&(this.e=new Rt(ii,this,10,9)),Ti(this.e,p(s,18));return;case 11:ove(this,Un(s));return}Pve(this,r,s)},b.fi=function(){return Ia(),qq},b.hi=function(r){switch(r){case 1:Nk(this,0);return;case 2:jk(this,0);return;case 3:Ak(this,0);return;case 4:Mk(this,0);return;case 5:!this.a&&(this.a=new Gi(Bu,this,5)),Tn(this.a);return;case 6:ckt(this,null);return;case 7:ZB(this,null);return;case 8:QB(this,null);return;case 9:!this.g&&(this.g=new Rt(ii,this,9,10)),Tn(this.g);return;case 10:!this.e&&(this.e=new Rt(ii,this,10,9)),Tn(this.e);return;case 11:ove(this,null);return}Cve(this,r)},b.Ib=function(){return xvt(this)},b.b=0,b.c=0,b.d=null,b.j=0,b.k=0,O(Gb,"ElkEdgeSectionImpl",443),j(161,118,{109:1,94:1,93:1,158:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1}),b.Ih=function(r,s,l){var d;return r==0?(!this.Ab&&(this.Ab=new De(lr,this,0,3)),this.Ab):Zu(this,r-mn(this.fi()),Dt((d=p(Yt(this,16),29),d||this.fi()),r),s,l)},b.Ph=function(r,s,l){var d,h;return s==0?(!this.Ab&&(this.Ab=new De(lr,this,0,3)),wl(this.Ab,r,l)):(h=p(Dt((d=p(Yt(this,16),29),d||this.fi()),s),69),h.uk().xk(this,Tl(this),s-mn(this.fi()),r,l))},b.Rh=function(r,s,l){var d,h;return s==0?(!this.Ab&&(this.Ab=new De(lr,this,0,3)),co(this.Ab,r,l)):(h=p(Dt((d=p(Yt(this,16),29),d||this.fi()),s),69),h.uk().yk(this,Tl(this),s-mn(this.fi()),r,l))},b.Th=function(r){var s;return r==0?!!this.Ab&&this.Ab.i!=0:Qu(this,r-mn(this.fi()),Dt((s=p(Yt(this,16),29),s||this.fi()),r))},b.Wh=function(r){return zSe(this,r)},b.$h=function(r,s){var l;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab),!this.Ab&&(this.Ab=new De(lr,this,0,3)),Ti(this.Ab,p(s,18));return}sd(this,r-mn(this.fi()),Dt((l=p(Yt(this,16),29),l||this.fi()),r),s)},b.ai=function(r){_S(this,128,r)},b.fi=function(){return Tt(),bLt},b.hi=function(r){var s;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab);return}id(this,r-mn(this.fi()),Dt((s=p(Yt(this,16),29),s||this.fi()),r))},b.mi=function(){this.Bb|=1},b.ni=function(r){return YM(this,r)},b.Bb=0,O(Gt,"EModelElementImpl",161),j(710,161,{109:1,94:1,93:1,469:1,158:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1},zme),b.oi=function(r,s){return PCt(this,r,s)},b.pi=function(r){var s,l,d,h,m;if(this.a!=Tu(r)||r.Bb&256)throw Z(new Kt(pse+r.zb+Oy));for(d=qo(r);za(d.a).i!=0;){if(l=p(cO(d,0,(s=p(be(za(d.a),0),87),m=s.c,me(m,88)?p(m,29):(Tt(),Vd))),29),wy(l))return h=Tu(l).ti().pi(l),p(h,52)._h(r),h;d=qo(l)}return(r.D!=null?r.D:r.B)=="java.util.Map$Entry"?new zut(r):new Tye(r)},b.qi=function(r,s){return Ey(this,r,s)},b.Ih=function(r,s,l){var d;switch(r){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),this.Ab;case 1:return this.a}return Zu(this,r-mn((Tt(),B1)),Dt((d=p(Yt(this,16),29),d||B1),r),s,l)},b.Ph=function(r,s,l){var d,h;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),wl(this.Ab,r,l);case 1:return this.a&&(l=p(this.a,52).Qh(this,4,ih,l)),Jve(this,p(r,241),l)}return h=p(Dt((d=p(Yt(this,16),29),d||(Tt(),B1)),s),69),h.uk().xk(this,Tl(this),s-mn((Tt(),B1)),r,l)},b.Rh=function(r,s,l){var d,h;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),co(this.Ab,r,l);case 1:return Jve(this,null,l)}return h=p(Dt((d=p(Yt(this,16),29),d||(Tt(),B1)),s),69),h.uk().yk(this,Tl(this),s-mn((Tt(),B1)),r,l)},b.Th=function(r){var s;switch(r){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return!!this.a}return Qu(this,r-mn((Tt(),B1)),Dt((s=p(Yt(this,16),29),s||B1),r))},b.$h=function(r,s){var l;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab),!this.Ab&&(this.Ab=new De(lr,this,0,3)),Ti(this.Ab,p(s,18));return;case 1:Yxt(this,p(s,241));return}sd(this,r-mn((Tt(),B1)),Dt((l=p(Yt(this,16),29),l||B1),r),s)},b.fi=function(){return Tt(),B1},b.hi=function(r){var s;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab);return;case 1:Yxt(this,null);return}id(this,r-mn((Tt(),B1)),Dt((s=p(Yt(this,16),29),s||B1),r))};var Jj,X9e,eLt;O(Gt,"EFactoryImpl",710),j(1018,710,{109:1,2075:1,94:1,93:1,469:1,158:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1},iYe),b.oi=function(r,s){switch(r.fk()){case 12:return p(s,147).Og();case 13:return Yo(s);default:throw Z(new Kt(LT+r.ve()+Oy))}},b.pi=function(r){var s,l,d,h,m,y,k,_;switch(r.G==-1&&(r.G=(s=Tu(r),s?J0(s.si(),r):-1)),r.G){case 4:return m=new Pme,m;case 6:return y=new aA,y;case 7:return k=new D1e,k;case 8:return d=new GY,d;case 9:return l=new XR,l;case 10:return h=new YR,h;case 11:return _=new sYe,_;default:throw Z(new Kt(pse+r.zb+Oy))}},b.qi=function(r,s){switch(r.fk()){case 13:case 12:return null;default:throw Z(new Kt(LT+r.ve()+Oy))}},O(Gb,"ElkGraphFactoryImpl",1018),j(439,161,{109:1,94:1,93:1,158:1,197:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1}),b.Dh=function(){var r,s;return s=(r=p(Yt(this,16),29),_xe(fp(r||this.fi()))),s==null?(vA(),vA(),Rce):new lct(this,s)},b.Ih=function(r,s,l){var d;switch(r){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),this.Ab;case 1:return this.ve()}return Zu(this,r-mn(this.fi()),Dt((d=p(Yt(this,16),29),d||this.fi()),r),s,l)},b.Th=function(r){var s;switch(r){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null}return Qu(this,r-mn(this.fi()),Dt((s=p(Yt(this,16),29),s||this.fi()),r))},b.$h=function(r,s){var l;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab),!this.Ab&&(this.Ab=new De(lr,this,0,3)),Ti(this.Ab,p(s,18));return;case 1:this.ri(Un(s));return}sd(this,r-mn(this.fi()),Dt((l=p(Yt(this,16),29),l||this.fi()),r),s)},b.fi=function(){return Tt(),wLt},b.hi=function(r){var s;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab);return;case 1:this.ri(null);return}id(this,r-mn(this.fi()),Dt((s=p(Yt(this,16),29),s||this.fi()),r))},b.ve=function(){return this.zb},b.ri=function(r){bl(this,r)},b.Ib=function(){return SM(this)},b.zb=null,O(Gt,"ENamedElementImpl",439),j(184,439,{109:1,94:1,93:1,158:1,197:1,57:1,241:1,114:1,52:1,100:1,161:1,184:1,117:1,118:1,680:1},Dft),b.xh=function(r){return axt(this,r)},b.Ih=function(r,s,l){var d;switch(r){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.yb;case 3:return this.xb;case 4:return this.sb;case 5:return!this.rb&&(this.rb=new Zx(this,sh,this)),this.rb;case 6:return!this.vb&&(this.vb=new eS(ih,this,6,7)),this.vb;case 7:return s?this.Db>>16==7?p(this.Cb,241):null:pht(this)}return Zu(this,r-mn((Tt(),gm)),Dt((d=p(Yt(this,16),29),d||gm),r),s,l)},b.Ph=function(r,s,l){var d,h,m;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),wl(this.Ab,r,l);case 4:return this.sb&&(l=p(this.sb,52).Qh(this,1,Kj,l)),Qve(this,p(r,469),l);case 5:return!this.rb&&(this.rb=new Zx(this,sh,this)),wl(this.rb,r,l);case 6:return!this.vb&&(this.vb=new eS(ih,this,6,7)),wl(this.vb,r,l);case 7:return this.Cb&&(l=(h=this.Db>>16,h>=0?axt(this,l):this.Cb.Qh(this,-1-h,null,l))),Du(this,r,7,l)}return m=p(Dt((d=p(Yt(this,16),29),d||(Tt(),gm)),s),69),m.uk().xk(this,Tl(this),s-mn((Tt(),gm)),r,l)},b.Rh=function(r,s,l){var d,h;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),co(this.Ab,r,l);case 4:return Qve(this,null,l);case 5:return!this.rb&&(this.rb=new Zx(this,sh,this)),co(this.rb,r,l);case 6:return!this.vb&&(this.vb=new eS(ih,this,6,7)),co(this.vb,r,l);case 7:return Du(this,null,7,l)}return h=p(Dt((d=p(Yt(this,16),29),d||(Tt(),gm)),s),69),h.uk().yk(this,Tl(this),s-mn((Tt(),gm)),r,l)},b.Th=function(r){var s;switch(r){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.yb!=null;case 3:return this.xb!=null;case 4:return!!this.sb;case 5:return!!this.rb&&this.rb.i!=0;case 6:return!!this.vb&&this.vb.i!=0;case 7:return!!pht(this)}return Qu(this,r-mn((Tt(),gm)),Dt((s=p(Yt(this,16),29),s||gm),r))},b.Wh=function(r){var s;return s=ijn(this,r),s||zSe(this,r)},b.$h=function(r,s){var l;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab),!this.Ab&&(this.Ab=new De(lr,this,0,3)),Ti(this.Ab,p(s,18));return;case 1:bl(this,Un(s));return;case 2:sz(this,Un(s));return;case 3:iz(this,Un(s));return;case 4:cne(this,p(s,469));return;case 5:!this.rb&&(this.rb=new Zx(this,sh,this)),Tn(this.rb),!this.rb&&(this.rb=new Zx(this,sh,this)),Ti(this.rb,p(s,18));return;case 6:!this.vb&&(this.vb=new eS(ih,this,6,7)),Tn(this.vb),!this.vb&&(this.vb=new eS(ih,this,6,7)),Ti(this.vb,p(s,18));return}sd(this,r-mn((Tt(),gm)),Dt((l=p(Yt(this,16),29),l||gm),r),s)},b.bi=function(r){var s,l;if(r&&this.rb)for(l=new cn(this.rb);l.e!=l.i.gc();)s=fn(l),me(s,360)&&(p(s,360).w=null);_S(this,64,r)},b.fi=function(){return Tt(),gm},b.hi=function(r){var s;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab);return;case 1:bl(this,null);return;case 2:sz(this,null);return;case 3:iz(this,null);return;case 4:cne(this,null);return;case 5:!this.rb&&(this.rb=new Zx(this,sh,this)),Tn(this.rb);return;case 6:!this.vb&&(this.vb=new eS(ih,this,6,7)),Tn(this.vb);return}id(this,r-mn((Tt(),gm)),Dt((s=p(Yt(this,16),29),s||gm),r))},b.mi=function(){Kte(this)},b.si=function(){return!this.rb&&(this.rb=new Zx(this,sh,this)),this.rb},b.ti=function(){return this.sb},b.ui=function(){return this.ub},b.vi=function(){return this.xb},b.wi=function(){return this.yb},b.xi=function(r){this.ub=r},b.Ib=function(){var r;return this.Db&64?SM(this):(r=new Nd(SM(this)),r.a+=" (nsURI: ",Mo(r,this.yb),r.a+=", nsPrefix: ",Mo(r,this.xb),r.a+=")",r.a)},b.xb=null,b.yb=null,O(Gt,"EPackageImpl",184),j(556,184,{109:1,2077:1,556:1,94:1,93:1,158:1,197:1,57:1,241:1,114:1,52:1,100:1,161:1,184:1,117:1,118:1,680:1},Avt),b.q=!1,b.r=!1;var tLt=!1;O(Gb,"ElkGraphPackageImpl",556),j(362,728,{109:1,343:1,174:1,157:1,276:1,362:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},Pme),b.xh=function(r){return n3e(this,r)},b.Ih=function(r,s,l){switch(r){case 7:return Dxe(this);case 8:return this.a}return pke(this,r,s,l)},b.Ph=function(r,s,l){var d;switch(s){case 7:return this.Cb&&(l=(d=this.Db>>16,d>=0?n3e(this,l):this.Cb.Qh(this,-1-d,null,l))),Bye(this,p(r,174),l)}return ine(this,r,s,l)},b.Rh=function(r,s,l){return s==7?Bye(this,null,l):Uee(this,r,s,l)},b.Th=function(r){switch(r){case 7:return!!Dxe(this);case 8:return!xt("",this.a)}return vke(this,r)},b.$h=function(r,s){switch(r){case 7:FCe(this,p(s,174));return;case 8:rve(this,Un(s));return}m3e(this,r,s)},b.fi=function(){return Ia(),K9e},b.hi=function(r){switch(r){case 7:FCe(this,null);return;case 8:rve(this,"");return}_ke(this,r)},b.Ib=function(){return g2t(this)},b.a="",O(Gb,"ElkLabelImpl",362),j(206,729,{109:1,343:1,84:1,174:1,26:1,276:1,206:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},aA),b.xh=function(r){return o3e(this,r)},b.Ih=function(r,s,l){switch(r){case 9:return!this.c&&(this.c=new De(Kc,this,9,9)),this.c;case 10:return!this.a&&(this.a=new De(Kn,this,10,11)),this.a;case 11:return fi(this);case 12:return!this.b&&(this.b=new De(Wi,this,12,3)),this.b;case 13:return zt(),!this.a&&(this.a=new De(Kn,this,10,11)),this.a.i>0}return Wke(this,r,s,l)},b.Ph=function(r,s,l){var d;switch(s){case 9:return!this.c&&(this.c=new De(Kc,this,9,9)),wl(this.c,r,l);case 10:return!this.a&&(this.a=new De(Kn,this,10,11)),wl(this.a,r,l);case 11:return this.Cb&&(l=(d=this.Db>>16,d>=0?o3e(this,l):this.Cb.Qh(this,-1-d,null,l))),rye(this,p(r,26),l);case 12:return!this.b&&(this.b=new De(Wi,this,12,3)),wl(this.b,r,l)}return c3e(this,r,s,l)},b.Rh=function(r,s,l){switch(s){case 9:return!this.c&&(this.c=new De(Kc,this,9,9)),co(this.c,r,l);case 10:return!this.a&&(this.a=new De(Kn,this,10,11)),co(this.a,r,l);case 11:return rye(this,null,l);case 12:return!this.b&&(this.b=new De(Wi,this,12,3)),co(this.b,r,l)}return u3e(this,r,s,l)},b.Th=function(r){switch(r){case 9:return!!this.c&&this.c.i!=0;case 10:return!!this.a&&this.a.i!=0;case 11:return!!fi(this);case 12:return!!this.b&&this.b.i!=0;case 13:return!this.a&&(this.a=new De(Kn,this,10,11)),this.a.i>0}return Dve(this,r)},b.$h=function(r,s){switch(r){case 9:!this.c&&(this.c=new De(Kc,this,9,9)),Tn(this.c),!this.c&&(this.c=new De(Kc,this,9,9)),Ti(this.c,p(s,18));return;case 10:!this.a&&(this.a=new De(Kn,this,10,11)),Tn(this.a),!this.a&&(this.a=new De(Kn,this,10,11)),Ti(this.a,p(s,18));return;case 11:uH(this,p(s,26));return;case 12:!this.b&&(this.b=new De(Wi,this,12,3)),Tn(this.b),!this.b&&(this.b=new De(Wi,this,12,3)),Ti(this.b,p(s,18));return}CCe(this,r,s)},b.fi=function(){return Ia(),J9e},b.hi=function(r){switch(r){case 9:!this.c&&(this.c=new De(Kc,this,9,9)),Tn(this.c);return;case 10:!this.a&&(this.a=new De(Kn,this,10,11)),Tn(this.a);return;case 11:uH(this,null);return;case 12:!this.b&&(this.b=new De(Wi,this,12,3)),Tn(this.b);return}Fke(this,r)},b.Ib=function(){return tSe(this)},O(Gb,"ElkNodeImpl",206),j(193,729,{109:1,343:1,84:1,174:1,125:1,276:1,193:1,105:1,94:1,93:1,57:1,114:1,52:1,100:1,117:1,118:1},D1e),b.xh=function(r){return r3e(this,r)},b.Ih=function(r,s,l){return r==9?xh(this):Wke(this,r,s,l)},b.Ph=function(r,s,l){var d;switch(s){case 9:return this.Cb&&(l=(d=this.Db>>16,d>=0?r3e(this,l):this.Cb.Qh(this,-1-d,null,l))),Uwe(this,p(r,26),l)}return c3e(this,r,s,l)},b.Rh=function(r,s,l){return s==9?Uwe(this,null,l):u3e(this,r,s,l)},b.Th=function(r){return r==9?!!xh(this):Dve(this,r)},b.$h=function(r,s){switch(r){case 9:OCe(this,p(s,26));return}CCe(this,r,s)},b.fi=function(){return Ia(),Y9e},b.hi=function(r){switch(r){case 9:OCe(this,null);return}Fke(this,r)},b.Ib=function(){return a3t(this)},O(Gb,"ElkPortImpl",193);var nLt=pi(uo,"BasicEMap/Entry");j(1091,118,{109:1,45:1,94:1,93:1,136:1,57:1,114:1,52:1,100:1,117:1,118:1},sYe),b.Fb=function(r){return this===r},b.jd=function(){return this.b},b.Hb=function(){return Yw(this)},b.Ai=function(r){Z2e(this,p(r,147))},b.Ih=function(r,s,l){switch(r){case 0:return this.b;case 1:return this.c}return Rz(this,r,s,l)},b.Th=function(r){switch(r){case 0:return!!this.b;case 1:return this.c!=null}return Nte(this,r)},b.$h=function(r,s){switch(r){case 0:Z2e(this,p(s,147));return;case 1:eve(this,s);return}gne(this,r,s)},b.fi=function(){return Ia(),ag},b.hi=function(r){switch(r){case 0:Z2e(this,null);return;case 1:eve(this,null);return}fne(this,r)},b.yi=function(){var r;return this.a==-1&&(r=this.b,this.a=r?Jr(r):0),this.a},b.kd=function(){return this.c},b.zi=function(r){this.a=r},b.ld=function(r){var s;return s=this.c,eve(this,r),s},b.Ib=function(){var r;return this.Db&64?wf(this):(r=new $m,nr(nr(nr(r,this.b?this.b.Og():Gl),Yre),zA(this.c)),r.a)},b.a=-1,b.c=null;var dm=O(Gb,"ElkPropertyToValueMapEntryImpl",1091);j(980,1,{},oYe),O(Rs,"JsonAdapter",980),j(215,63,Jg,ep),O(Rs,"JsonImportException",215),j(850,1,{},Cvt),O(Rs,"JsonImporter",850),j(884,1,{},oat),b.Bi=function(r){bxt(this.a,this.b,p(r,139))},O(Rs,"JsonImporter/lambda$0$Type",884),j(885,1,{},aat),b.Bi=function(r){evt(this.a,this.b,p(r,139))},O(Rs,"JsonImporter/lambda$1$Type",885),j(893,1,{},Dnt),b.Bi=function(r){fft(this.a,p(r,149))},O(Rs,"JsonImporter/lambda$10$Type",893),j(895,1,{},lat),b.Bi=function(r){z2t(this.a,this.b,p(r,139))},O(Rs,"JsonImporter/lambda$11$Type",895),j(896,1,{},cat),b.Bi=function(r){H2t(this.a,this.b,p(r,139))},O(Rs,"JsonImporter/lambda$12$Type",896),j(902,1,{},kft),b.Bi=function(r){d2t(this.a,this.b,this.c,this.d,p(r,139))},O(Rs,"JsonImporter/lambda$13$Type",902),j(901,1,{},Cft),b.Bi=function(r){A3t(this.a,this.b,this.c,this.d,p(r,149))},O(Rs,"JsonImporter/lambda$14$Type",901),j(897,1,{},uat),b.Bi=function(r){$ct(this.a,this.b,Un(r))},O(Rs,"JsonImporter/lambda$15$Type",897),j(898,1,{},dat),b.Bi=function(r){Fct(this.a,this.b,Un(r))},O(Rs,"JsonImporter/lambda$16$Type",898),j(899,1,{},fat),b.Bi=function(r){Qyt(this.b,this.a,p(r,139))},O(Rs,"JsonImporter/lambda$17$Type",899),j(900,1,{},hat),b.Bi=function(r){Zyt(this.b,this.a,p(r,139))},O(Rs,"JsonImporter/lambda$18$Type",900),j(905,1,{},Int),b.Bi=function(r){n2t(this.a,p(r,149))},O(Rs,"JsonImporter/lambda$19$Type",905),j(886,1,{},Ont),b.Bi=function(r){uxt(this.a,p(r,139))},O(Rs,"JsonImporter/lambda$2$Type",886),j(903,1,{},Lnt),b.Bi=function(r){Nk(this.a,ye(ke(r)))},O(Rs,"JsonImporter/lambda$20$Type",903),j(904,1,{},Pnt),b.Bi=function(r){jk(this.a,ye(ke(r)))},O(Rs,"JsonImporter/lambda$21$Type",904),j(908,1,{},Rnt),b.Bi=function(r){t2t(this.a,p(r,149))},O(Rs,"JsonImporter/lambda$22$Type",908),j(906,1,{},$nt),b.Bi=function(r){Ak(this.a,ye(ke(r)))},O(Rs,"JsonImporter/lambda$23$Type",906),j(907,1,{},Fnt),b.Bi=function(r){Mk(this.a,ye(ke(r)))},O(Rs,"JsonImporter/lambda$24$Type",907),j(910,1,{},Bnt),b.Bi=function(r){Axt(this.a,p(r,139))},O(Rs,"JsonImporter/lambda$25$Type",910),j(909,1,{},znt),b.Bi=function(r){hft(this.a,p(r,149))},O(Rs,"JsonImporter/lambda$26$Type",909),j(911,1,ln,pat),b.Ad=function(r){ikn(this.b,this.a,Un(r))},O(Rs,"JsonImporter/lambda$27$Type",911),j(912,1,ln,gat),b.Ad=function(r){skn(this.b,this.a,Un(r))},O(Rs,"JsonImporter/lambda$28$Type",912),j(913,1,{},mat),b.Bi=function(r){Rvt(this.a,this.b,p(r,139))},O(Rs,"JsonImporter/lambda$29$Type",913),j(889,1,{},Hnt),b.Bi=function(r){kwt(this.a,p(r,149))},O(Rs,"JsonImporter/lambda$3$Type",889),j(914,1,{},bat),b.Bi=function(r){skt(this.a,this.b,p(r,139))},O(Rs,"JsonImporter/lambda$30$Type",914),j(915,1,{},Unt),b.Bi=function(r){W0t(this.a,ke(r))},O(Rs,"JsonImporter/lambda$31$Type",915),j(916,1,{},Wnt),b.Bi=function(r){q0t(this.a,ke(r))},O(Rs,"JsonImporter/lambda$32$Type",916),j(917,1,{},qnt),b.Bi=function(r){G0t(this.a,ke(r))},O(Rs,"JsonImporter/lambda$33$Type",917),j(918,1,{},Gnt),b.Bi=function(r){V0t(this.a,ke(r))},O(Rs,"JsonImporter/lambda$34$Type",918),j(919,1,{},Vnt),b.Bi=function(r){t6n(this.a,p(r,57))},O(Rs,"JsonImporter/lambda$35$Type",919),j(920,1,{},Knt),b.Bi=function(r){n6n(this.a,p(r,57))},O(Rs,"JsonImporter/lambda$36$Type",920),j(924,1,{},vft),O(Rs,"JsonImporter/lambda$37$Type",924),j(921,1,ln,but),b.Ad=function(r){j3n(this.a,this.c,this.b,p(r,372))},O(Rs,"JsonImporter/lambda$38$Type",921),j(922,1,ln,wat),b.Ad=function(r){mpn(this.a,this.b,p(r,170))},O(Rs,"JsonImporter/lambda$39$Type",922),j(887,1,{},Jnt),b.Bi=function(r){Nk(this.a,ye(ke(r)))},O(Rs,"JsonImporter/lambda$4$Type",887),j(923,1,ln,yat),b.Ad=function(r){bpn(this.a,this.b,p(r,170))},O(Rs,"JsonImporter/lambda$40$Type",923),j(925,1,ln,wut),b.Ad=function(r){D3n(this.a,this.b,this.c,p(r,8))},O(Rs,"JsonImporter/lambda$41$Type",925),j(888,1,{},Ynt),b.Bi=function(r){jk(this.a,ye(ke(r)))},O(Rs,"JsonImporter/lambda$5$Type",888),j(892,1,{},Xnt),b.Bi=function(r){Cwt(this.a,p(r,149))},O(Rs,"JsonImporter/lambda$6$Type",892),j(890,1,{},Qnt),b.Bi=function(r){Ak(this.a,ye(ke(r)))},O(Rs,"JsonImporter/lambda$7$Type",890),j(891,1,{},Znt),b.Bi=function(r){Mk(this.a,ye(ke(r)))},O(Rs,"JsonImporter/lambda$8$Type",891),j(894,1,{},ert),b.Bi=function(r){Mxt(this.a,p(r,139))},O(Rs,"JsonImporter/lambda$9$Type",894),j(944,1,ln,trt),b.Ad=function(r){lS(this.a,new t2(Un(r)))},O(Rs,"JsonMetaDataConverter/lambda$0$Type",944),j(945,1,ln,nrt),b.Ad=function(r){cwn(this.a,p(r,244))},O(Rs,"JsonMetaDataConverter/lambda$1$Type",945),j(946,1,ln,rrt),b.Ad=function(r){exn(this.a,p(r,144))},O(Rs,"JsonMetaDataConverter/lambda$2$Type",946),j(947,1,ln,irt),b.Ad=function(r){uwn(this.a,p(r,160))},O(Rs,"JsonMetaDataConverter/lambda$3$Type",947),j(244,23,{3:1,35:1,23:1,244:1},VC);var Gq,Vq,Nce,Kq,Jq,Yq,jce,Dce,Xq=_n(EO,"GraphFeature",244,Ln,Rkn,q1n),rLt;j(11,1,{35:1,147:1},Pr,ri,gt,Ls),b.Dd=function(r){return pgn(this,p(r,147))},b.Fb=function(r){return Vft(this,r)},b.Rg=function(){return qe(this)},b.Og=function(){return this.b},b.Hb=function(){return W0(this.b)},b.Ib=function(){return this.b},O(EO,"Property",11),j(657,1,ir,aX),b.Le=function(r,s){return JSn(this,p(r,105),p(s,105))},b.Fb=function(r){return this===r},b.Me=function(){return new Yn(this)},O(EO,"PropertyHolderComparator",657),j(698,1,Ts,b1e),b.Nb=function(r){Bs(this,r)},b.Pb=function(){return ckn(this)},b.Qb=function(){Qit()},b.Ob=function(){return!!this.a},O(xU,"ElkGraphUtil/AncestorIterator",698);var Q9e=pi(uo,"EList");j(71,56,{20:1,31:1,56:1,18:1,16:1,71:1,61:1}),b._c=function(r,s){TM(this,r,s)},b.Ec=function(r){return jn(this,r)},b.ad=function(r,s){return Eve(this,r,s)},b.Fc=function(r){return Ti(this,r)},b.Gi=function(){return new QC(this)},b.Hi=function(){return new E8(this)},b.Ii=function(r){return mI(this,r)},b.Ji=function(){return!0},b.Ki=function(r,s){},b.Li=function(){},b.Mi=function(r,s){uee(this,r,s)},b.Ni=function(r,s,l){},b.Oi=function(r,s){},b.Pi=function(r,s,l){},b.Fb=function(r){return Wkt(this,r)},b.Hb=function(){return vve(this)},b.Qi=function(){return!1},b.Jc=function(){return new cn(this)},b.cd=function(){return new XC(this)},b.dd=function(r){var s;if(s=this.gc(),r<0||r>s)throw Z(new Jx(r,s));return new gZ(this,r)},b.Si=function(r,s){this.Ri(r,this.bd(s))},b.Kc=function(r){return FB(this,r)},b.Ui=function(r,s){return s},b.fd=function(r,s){return Rk(this,r,s)},b.Ib=function(){return bke(this)},b.Wi=function(){return!0},b.Xi=function(r,s){return I_(this,s)},O(uo,"AbstractEList",71),j(67,71,xp,QR,ly,gve),b.Ci=function(r,s){return sne(this,r,s)},b.Di=function(r){return Iyt(this,r)},b.Ei=function(r,s){MI(this,r,s)},b.Fi=function(r){eI(this,r)},b.Yi=function(r){return N2e(this,r)},b.$b=function(){cM(this)},b.Gc=function(r){return J_(this,r)},b.Xb=function(r){return be(this,r)},b.Zi=function(r){var s,l,d;++this.j,l=this.g==null?0:this.g.length,r>l&&(d=this.g,s=l+(l/2|0)+4,s<r&&(s=r),this.g=this.$i(s),d!=null&&Wa(d,0,this.g,0,this.i))},b.bd=function(r){return nxt(this,r)},b.dc=function(){return this.i==0},b.Ri=function(r,s){return wne(this,r,s)},b.$i=function(r){return Ee(cs,Pt,1,r,5,1)},b.Ti=function(r){return this.g[r]},b.ed=function(r){return MS(this,r)},b.Vi=function(r,s){return xee(this,r,s)},b.gc=function(){return this.i},b.Nc=function(){return Yxe(this)},b.Oc=function(r){return Eke(this,r)},b.i=0;var Z9e=O(uo,"BasicEList",67),e8e=pi(uo,"TreeIterator");j(697,67,Ese),b.Nb=function(r){Bs(this,r)},b.Ob=function(){return this.g==null&&!this.c?jxe(this):this.g==null||this.i!=0&&p(this.g[this.i-1],50).Ob()},b.Pb=function(){return oH(this)},b.Qb=function(){if(!this.e)throw Z(new Lo("There is no valid object to remove."));this.e.Qb()},b.c=!1,O(uo,"AbstractTreeIterator",697),j(604,697,Ese,kQ),b._i=function(r){var s;return s=p(r,57).Dh().Jc(),me(s,287)&&p(s,287).ul(new aYe),s},O(xU,"ElkGraphUtil/PropertiesSkippingTreeIterator",604),j(948,1,{},aYe),O(xU,"ElkGraphUtil/PropertiesSkippingTreeIterator/1",948);var nP,Ice,rP=O(xU,"ElkReflect",null);j(882,1,B2,lYe),b.Qg=function(r){return pB(),Hxn(p(r,182))},O(xU,"ElkReflect/lambda$0$Type",882);var dw;pi(uo,"ResourceLocator"),j(1045,1,{}),O(uo,"DelegatingResourceLocator",1045),j(1046,1045,{}),O("org.eclipse.emf.common","EMFPlugin",1046);var Oce=pi(cTt,"Adapter"),w7n=pi(cTt,"Notification");j(1143,1,hTe),b.aj=function(){return this.d},b.bj=function(r){},b.cj=function(r){this.d=r},b.dj=function(r){this.d==r&&(this.d=null)},b.d=null,O(YS,"AdapterImpl",1143),j(2055,71,uTt),b.Ci=function(r,s){return kke(this,r,s)},b.Di=function(r){var s,l,d;if(++this.j,r.dc())return!1;for(s=this.Cj(),d=r.Jc();d.Ob();)l=d.Pb(),this.pj(this.Xi(s,l)),++s;return!0},b.Ei=function(r,s){yct(this,r,s)},b.Fi=function(r){Wdt(this,r)},b.nj=function(){return this.qj()},b.$b=function(){M8(this,this.Cj(),this.Dj())},b.Gc=function(r){return this.sj(r)},b.Hc=function(r){return this.tj(r)},b.oj=function(r,s){this.zj().Sm()},b.pj=function(r){this.zj().Sm()},b.qj=function(){return this.zj()},b.rj=function(){this.zj().Sm()},b.sj=function(r){return this.zj().Sm()},b.tj=function(r){return this.zj().Sm()},b.uj=function(r){return this.zj().Sm()},b.vj=function(r){return this.zj().Sm()},b.wj=function(){return this.zj().Sm()},b.xj=function(r){return this.zj().Sm()},b.yj=function(){return this.zj().Sm()},b.Aj=function(r){return this.zj().Sm()},b.Bj=function(r,s){return this.zj().Sm()},b.Cj=function(){return this.zj().Sm()},b.Dj=function(){return this.zj().Sm()},b.Ej=function(r){return this.zj().Sm()},b.Fj=function(){return this.zj().Sm()},b.Fb=function(r){return this.uj(r)},b.Xb=function(r){return this.Ui(r,this.vj(r))},b.Hb=function(){return this.wj()},b.bd=function(r){return this.xj(r)},b.dc=function(){return this.yj()},b.Ri=function(r,s){return P3e(this,r,s)},b.Ti=function(r){return this.vj(r)},b.ed=function(r){return OF(this,r)},b.Kc=function(r){var s;return s=this.bd(r),s>=0?(this.ed(s),!0):!1},b.Vi=function(r,s){return this.Bj(r,this.Xi(r,s))},b.gc=function(){return this.Cj()},b.Nc=function(){return this.Dj()},b.Oc=function(r){return this.Ej(r)},b.Ib=function(){return this.Fj()},O(uo,"DelegatingEList",2055),j(2056,2055,uTt),b.Ci=function(r,s){return gSe(this,r,s)},b.Di=function(r){return this.Ci(this.Cj(),r)},b.Ei=function(r,s){Mvt(this,r,s)},b.Fi=function(r){wvt(this,r)},b.Ji=function(){return!this.Kj()},b.$b=function(){nN(this)},b.Gj=function(r,s,l,d,h){return new qft(this,r,s,l,d,h)},b.Hj=function(r){Er(this.hj(),r)},b.Ij=function(){return null},b.Jj=function(){return-1},b.hj=function(){return null},b.Kj=function(){return!1},b.Lj=function(r,s){return s},b.Mj=function(r,s){return s},b.Nj=function(){return!1},b.Oj=function(){return!this.yj()},b.Ri=function(r,s){var l,d;return this.Nj()?(d=this.Oj(),l=P3e(this,r,s),this.Hj(this.Gj(7,Oe(s),l,r,d)),l):P3e(this,r,s)},b.ed=function(r){var s,l,d,h;return this.Nj()?(l=null,d=this.Oj(),s=this.Gj(4,h=OF(this,r),null,r,d),this.Kj()&&h?(l=this.Mj(h,l),l?(l.lj(s),l.mj()):this.Hj(s)):l?(l.lj(s),l.mj()):this.Hj(s),h):(h=OF(this,r),this.Kj()&&h&&(l=this.Mj(h,null),l&&l.mj()),h)},b.Vi=function(r,s){return B3t(this,r,s)},O(YS,"DelegatingNotifyingListImpl",2056),j(151,1,HO),b.lj=function(r){return v3e(this,r)},b.mj=function(){wee(this)},b.ej=function(){return this.d},b.Ij=function(){return null},b.Pj=function(){return null},b.fj=function(r){return-1},b.gj=function(){return Ekt(this)},b.hj=function(){return null},b.ij=function(){return WCe(this)},b.jj=function(){return this.o<0?this.o<-2?-2-this.o-1:-1:this.o},b.Qj=function(){return!1},b.kj=function(r){var s,l,d,h,m,y,k,_,T,N,L;switch(this.d){case 1:case 2:switch(h=r.ej(),h){case 1:case 2:if(m=r.hj(),Se(m)===Se(this.hj())&&this.fj(null)==r.fj(null))return this.g=r.gj(),r.ej()==1&&(this.d=1),!0}case 4:{switch(h=r.ej(),h){case 4:{if(m=r.hj(),Se(m)===Se(this.hj())&&this.fj(null)==r.fj(null))return T=ISe(this),_=this.o<0?this.o<-2?-2-this.o-1:-1:this.o,y=r.jj(),this.d=6,L=new ly(2),_<=y?(jn(L,this.n),jn(L,r.ij()),this.g=ie(re(Wn,1),ur,30,15,[this.o=_,y+1])):(jn(L,r.ij()),jn(L,this.n),this.g=ie(re(Wn,1),ur,30,15,[this.o=y,_])),this.n=L,T||(this.o=-2-this.o-1),!0;break}}break}case 6:{switch(h=r.ej(),h){case 4:{if(m=r.hj(),Se(m)===Se(this.hj())&&this.fj(null)==r.fj(null)){for(T=ISe(this),y=r.jj(),N=p(this.g,54),d=Ee(Wn,ur,30,N.length+1,15,1),s=0;s<N.length&&(k=N[s],k<=y);)d[s++]=k,++y;for(l=p(this.n,16),l._c(s,r.ij()),d[s]=y;++s<d.length;)d[s]=N[s-1];return this.g=d,T||(this.o=-2-d[0]),!0}break}}break}}return!1},b.Ib=function(){var r,s,l,d;switch(d=new Nd(fb(this.Pm)+"@"+(s=Jr(this)>>>0,s.toString(16))),d.a+=" (eventType: ",this.d){case 1:{d.a+="SET";break}case 2:{d.a+="UNSET";break}case 3:{d.a+="ADD";break}case 5:{d.a+="ADD_MANY";break}case 4:{d.a+="REMOVE";break}case 6:{d.a+="REMOVE_MANY";break}case 7:{d.a+="MOVE";break}case 8:{d.a+="REMOVING_ADAPTER";break}case 9:{d.a+="RESOLVE";break}default:{MX(d,this.d);break}}if(h3t(this)&&(d.a+=", touch: true"),d.a+=", position: ",MX(d,this.o<0?this.o<-2?-2-this.o-1:-1:this.o),d.a+=", notifier: ",LA(d,this.hj()),d.a+=", feature: ",LA(d,this.Ij()),d.a+=", oldValue: ",LA(d,WCe(this)),d.a+=", newValue: ",this.d==6&&me(this.g,54)){for(l=p(this.g,54),d.a+="[",r=0;r<l.length;)d.a+=l[r],++r<l.length&&(d.a+=yl);d.a+="]"}else LA(d,Ekt(this));return d.a+=", isTouch: ",D0(d,h3t(this)),d.a+=", wasSet: ",D0(d,ISe(this)),d.a+=")",d.a},b.d=0,b.e=0,b.f=0,b.j=0,b.k=0,b.o=0,b.p=0,O(YS,"NotificationImpl",151),j(1157,151,HO,qft),b.Ij=function(){return this.a.Ij()},b.fj=function(r){return this.a.Jj()},b.hj=function(){return this.a.hj()},O(YS,"DelegatingNotifyingListImpl/1",1157),j(252,67,xp,cYe,Fm),b.Ec=function(r){return _wt(this,p(r,373))},b.lj=function(r){return _wt(this,r)},b.mj=function(){var r,s,l;for(r=0;r<this.i;++r)s=p(this.g[r],373),l=s.hj(),l!=null&&s.ej()!=-1&&p(l,94).uh(s)},b.$i=function(r){return Ee(w7n,Pt,373,r,0,1)},O(YS,"NotificationChainImpl",252),j(1485,93,v_t),b.rh=function(){return this.e},b.th=function(){return(this.f&1)!=0},b.f=1,O(YS,"NotifierImpl",1485),j(2053,67,xp),b.Ci=function(r,s){return $ne(this,r,s)},b.Di=function(r){return this.Ci(this.i,r)},b.Ei=function(r,s){pCe(this,r,s)},b.Fi=function(r){yne(this,r)},b.Ji=function(){return!this.Kj()},b.$b=function(){Tn(this)},b.Gj=function(r,s,l,d,h){return new Gft(this,r,s,l,d,h)},b.Hj=function(r){Er(this.hj(),r)},b.Ij=function(){return null},b.Jj=function(){return-1},b.hj=function(){return null},b.Kj=function(){return!1},b.Rj=function(){return!1},b.Lj=function(r,s){return s},b.Mj=function(r,s){return s},b.Nj=function(){return!1},b.Oj=function(){return this.i!=0},b.Ri=function(r,s){return AM(this,r,s)},b.ed=function(r){return T2(this,r)},b.Vi=function(r,s){return rCt(this,r,s)},b.Sj=function(r,s){return s},b.Tj=function(r,s){return s},b.Uj=function(r,s,l){return l},O(YS,"NotifyingListImpl",2053),j(1156,151,HO,Gft),b.Ij=function(){return this.a.Ij()},b.fj=function(r){return this.a.Jj()},b.hj=function(){return this.a.hj()},O(YS,"NotifyingListImpl/1",1156),j(949,67,xp,vct),b.Gc=function(r){return this.i>10?((!this.b||this.c.j!=this.a)&&(this.b=new Xx(this),this.a=this.j),Md(this.b,r)):J_(this,r)},b.Wi=function(){return!0},b.a=0,O(uo,"AbstractEList/1",949),j(305,99,OH,Jx),O(uo,"AbstractEList/BasicIndexOutOfBoundsException",305),j(42,1,Ts,cn),b.Nb=function(r){Bs(this,r)},b.Vj=function(){if(this.i.j!=this.f)throw Z(new Ku)},b.Wj=function(){return fn(this)},b.Ob=function(){return this.e!=this.i.gc()},b.Pb=function(){return this.Wj()},b.Qb=function(){$M(this)},b.e=0,b.f=0,b.g=-1,O(uo,"AbstractEList/EIterator",42),j(286,42,Vp,XC,gZ),b.Qb=function(){$M(this)},b.Rb=function(r){Owt(this,r)},b.Xj=function(){var r;try{return r=this.d.Xb(--this.e),this.Vj(),this.g=this.e,r}catch(s){throw s=Oi(s),me(s,99)?(this.Vj(),Z(new Zo)):Z(s)}},b.Yj=function(r){Oyt(this,r)},b.Sb=function(){return this.e!=0},b.Tb=function(){return this.e},b.Ub=function(){return this.Xj()},b.Vb=function(){return this.e-1},b.Wb=function(r){this.Yj(r)},O(uo,"AbstractEList/EListIterator",286),j(355,42,Ts,QC),b.Wj=function(){return jte(this)},b.Qb=function(){throw Z(new zn)},O(uo,"AbstractEList/NonResolvingEIterator",355),j(391,286,Vp,E8,oye),b.Rb=function(r){throw Z(new zn)},b.Wj=function(){var r;try{return r=this.c.Ti(this.e),this.Vj(),this.g=this.e++,r}catch(s){throw s=Oi(s),me(s,99)?(this.Vj(),Z(new Zo)):Z(s)}},b.Xj=function(){var r;try{return r=this.c.Ti(--this.e),this.Vj(),this.g=this.e,r}catch(s){throw s=Oi(s),me(s,99)?(this.Vj(),Z(new Zo)):Z(s)}},b.Qb=function(){throw Z(new zn)},b.Wb=function(r){throw Z(new zn)},O(uo,"AbstractEList/NonResolvingEListIterator",391),j(2042,71,dTt),b.Ci=function(r,s){var l,d,h,m,y,k,_,T,N,L,$;if(h=s.gc(),h!=0){for(T=p(Yt(this.a,4),129),N=T==null?0:T.length,$=N+h,d=nte(this,$),L=N-r,L>0&&Wa(T,r,d,r+h,L),_=s.Jc(),y=0;y<h;++y)k=_.Pb(),l=r+y,SQ(d,l,I_(this,k));for(G_(this,d),m=0;m<h;++m)k=d[r],this.Ki(r,k),++r;return!0}else return++this.j,!1},b.Di=function(r){var s,l,d,h,m,y,k,_,T;if(d=r.gc(),d!=0){for(_=(l=p(Yt(this.a,4),129),l==null?0:l.length),T=_+d,s=nte(this,T),k=r.Jc(),m=_;m<T;++m)y=k.Pb(),SQ(s,m,I_(this,y));for(G_(this,s),h=_;h<T;++h)y=s[h],this.Ki(h,y);return!0}else return++this.j,!1},b.Ei=function(r,s){var l,d,h,m;d=p(Yt(this.a,4),129),h=d==null?0:d.length,l=nte(this,h+1),m=I_(this,s),r!=h&&Wa(d,r,l,r+1,h-r),Ni(l,r,m),G_(this,l),this.Ki(r,s)},b.Fi=function(r){var s,l,d;d=(l=p(Yt(this.a,4),129),l==null?0:l.length),s=nte(this,d+1),SQ(s,d,I_(this,r)),G_(this,s),this.Ki(d,r)},b.Gi=function(){return new pgt(this)},b.Hi=function(){return new Tdt(this)},b.Ii=function(r){var s,l;if(l=(s=p(Yt(this.a,4),129),s==null?0:s.length),r<0||r>l)throw Z(new Jx(r,l));return new oft(this,r)},b.$b=function(){var r,s;++this.j,r=p(Yt(this.a,4),129),s=r==null?0:r.length,G_(this,null),uee(this,s,r)},b.Gc=function(r){var s,l,d,h,m;if(s=p(Yt(this.a,4),129),s!=null){if(r!=null){for(d=s,h=0,m=d.length;h<m;++h)if(l=d[h],Tr(r,l))return!0}else for(d=s,h=0,m=d.length;h<m;++h)if(l=d[h],Se(l)===Se(r))return!0}return!1},b.Xb=function(r){var s,l;if(s=p(Yt(this.a,4),129),l=s==null?0:s.length,r>=l)throw Z(new Jx(r,l));return s[r]},b.bd=function(r){var s,l,d;if(s=p(Yt(this.a,4),129),s!=null){if(r!=null){for(l=0,d=s.length;l<d;++l)if(Tr(r,s[l]))return l}else for(l=0,d=s.length;l<d;++l)if(Se(s[l])===Se(r))return l}return-1},b.dc=function(){return p(Yt(this.a,4),129)==null},b.Jc=function(){return new hgt(this)},b.cd=function(){return new _dt(this)},b.dd=function(r){var s,l;if(l=(s=p(Yt(this.a,4),129),s==null?0:s.length),r<0||r>l)throw Z(new Jx(r,l));return new sft(this,r)},b.Ri=function(r,s){var l,d,h;if(l=Uwt(this),h=l==null?0:l.length,r>=h)throw Z(new fl(Cse+r+Vb+h));if(s>=h)throw Z(new fl(Sse+s+Vb+h));return d=l[s],r!=s&&(r<s?Wa(l,r,l,r+1,s-r):Wa(l,s+1,l,s,r-s),Ni(l,r,d),G_(this,l)),d},b.Ti=function(r){return p(Yt(this.a,4),129)[r]},b.ed=function(r){return iMn(this,r)},b.Vi=function(r,s){var l,d;return l=Uwt(this),d=l[r],SQ(l,r,I_(this,s)),G_(this,l),d},b.gc=function(){var r;return r=p(Yt(this.a,4),129),r==null?0:r.length},b.Nc=function(){var r,s,l;return r=p(Yt(this.a,4),129),l=r==null?0:r.length,s=Ee(Oce,Mse,415,l,0,1),l>0&&Wa(r,0,s,0,l),s},b.Oc=function(r){var s,l,d;return s=p(Yt(this.a,4),129),d=s==null?0:s.length,d>0&&(r.length<d&&(l=gI(lu(r).c,d),r=l),Wa(s,0,r,0,d)),r.length>d&&Ni(r,d,null),r};var iLt;O(uo,"ArrayDelegatingEList",2042),j(1032,42,Ts,hgt),b.Vj=function(){if(this.b.j!=this.f||Se(p(Yt(this.b.a,4),129))!==Se(this.a))throw Z(new Ku)},b.Qb=function(){$M(this),this.a=p(Yt(this.b.a,4),129)},O(uo,"ArrayDelegatingEList/EIterator",1032),j(712,286,Vp,_dt,sft),b.Vj=function(){if(this.b.j!=this.f||Se(p(Yt(this.b.a,4),129))!==Se(this.a))throw Z(new Ku)},b.Yj=function(r){Oyt(this,r),this.a=p(Yt(this.b.a,4),129)},b.Qb=function(){$M(this),this.a=p(Yt(this.b.a,4),129)},O(uo,"ArrayDelegatingEList/EListIterator",712),j(1033,355,Ts,pgt),b.Vj=function(){if(this.b.j!=this.f||Se(p(Yt(this.b.a,4),129))!==Se(this.a))throw Z(new Ku)},O(uo,"ArrayDelegatingEList/NonResolvingEIterator",1033),j(713,391,Vp,Tdt,oft),b.Vj=function(){if(this.b.j!=this.f||Se(p(Yt(this.b.a,4),129))!==Se(this.a))throw Z(new Ku)},O(uo,"ArrayDelegatingEList/NonResolvingEListIterator",713),j(605,305,OH,wQ),O(uo,"BasicEList/BasicIndexOutOfBoundsException",605),j(699,67,xp,Wbe),b._c=function(r,s){throw Z(new zn)},b.Ec=function(r){throw Z(new zn)},b.ad=function(r,s){throw Z(new zn)},b.Fc=function(r){throw Z(new zn)},b.$b=function(){throw Z(new zn)},b.Zi=function(r){throw Z(new zn)},b.Jc=function(){return this.Gi()},b.cd=function(){return this.Hi()},b.dd=function(r){return this.Ii(r)},b.Ri=function(r,s){throw Z(new zn)},b.Si=function(r,s){throw Z(new zn)},b.ed=function(r){throw Z(new zn)},b.Kc=function(r){throw Z(new zn)},b.fd=function(r,s){throw Z(new zn)},O(uo,"BasicEList/UnmodifiableEList",699),j(711,1,{3:1,20:1,18:1,16:1,61:1,586:1}),b._c=function(r,s){rgn(this,r,p(s,45))},b.Ec=function(r){return Xgn(this,p(r,45))},b.Ic=function(r){Ws(this,r)},b.Xb=function(r){return p(be(this.c,r),136)},b.Ri=function(r,s){return p(this.c.Ri(r,s),45)},b.Si=function(r,s){ign(this,r,p(s,45))},b.ed=function(r){return p(this.c.ed(r),45)},b.fd=function(r,s){return fwn(this,r,p(s,45))},b.gd=function(r){Mb(this,r)},b.Lc=function(){return new Ct(this,16)},b.Mc=function(){return new kt(null,new Ct(this,16))},b.ad=function(r,s){return this.c.ad(r,s)},b.Fc=function(r){return this.c.Fc(r)},b.$b=function(){this.c.$b()},b.Gc=function(r){return this.c.Gc(r)},b.Hc=function(r){return SI(this.c,r)},b.Zj=function(){var r,s,l;if(this.d==null){for(this.d=Ee(Z9e,pTe,67,2*this.f+1,0,1),l=this.e,this.f=0,s=this.c.Jc();s.e!=s.i.gc();)r=p(s.Wj(),136),Bz(this,r);this.e=l}},b.Fb=function(r){return Xct(this,r)},b.Hb=function(){return vve(this.c)},b.bd=function(r){return this.c.bd(r)},b.$j=function(){this.c=new srt(this)},b.dc=function(){return this.f==0},b.Jc=function(){return this.c.Jc()},b.cd=function(){return this.c.cd()},b.dd=function(r){return this.c.dd(r)},b._j=function(){return rI(this)},b.ak=function(r,s,l){return new yut(r,s,l)},b.bk=function(){return new dYe},b.Kc=function(r){return Umt(this,r)},b.gc=function(){return this.f},b.hd=function(r,s){return new Jm(this.c,r,s)},b.Nc=function(){return this.c.Nc()},b.Oc=function(r){return this.c.Oc(r)},b.Ib=function(){return bke(this.c)},b.e=0,b.f=0,O(uo,"BasicEMap",711),j(1027,67,xp,srt),b.Ki=function(r,s){Ffn(this,p(s,136))},b.Ni=function(r,s,l){var d;++(d=this,p(s,136),d).a.e},b.Oi=function(r,s){Bfn(this,p(s,136))},b.Pi=function(r,s,l){Rgn(this,p(s,136),p(l,136))},b.Mi=function(r,s){R1t(this.a)},O(uo,"BasicEMap/1",1027),j(1028,67,xp,dYe),b.$i=function(r){return Ee(y7n,fTt,611,r,0,1)},O(uo,"BasicEMap/2",1028),j(1029,Nh,fc,ort),b.$b=function(){this.a.c.$b()},b.Gc=function(r){return xte(this.a,r)},b.Jc=function(){return this.a.f==0?(t_(),iP.a):new Wit(this.a)},b.Kc=function(r){var s;return s=this.a.f,Nz(this.a,r),this.a.f!=s},b.gc=function(){return this.a.f},O(uo,"BasicEMap/3",1029),j(1030,31,j2,art),b.$b=function(){this.a.c.$b()},b.Gc=function(r){return qkt(this.a,r)},b.Jc=function(){return this.a.f==0?(t_(),iP.a):new qit(this.a)},b.gc=function(){return this.a.f},O(uo,"BasicEMap/4",1030),j(1031,Nh,fc,lrt),b.$b=function(){this.a.c.$b()},b.Gc=function(r){var s,l,d,h,m,y,k,_,T;if(this.a.f>0&&me(r,45)&&(this.a.Zj(),_=p(r,45),k=_.jd(),h=k==null?0:Jr(k),m=Wwe(this.a,h),s=this.a.d[m],s)){for(l=p(s.g,374),T=s.i,y=0;y<T;++y)if(d=l[y],d.yi()==h&&d.Fb(_))return!0}return!1},b.Jc=function(){return this.a.f==0?(t_(),iP.a):new DZ(this.a)},b.Kc=function(r){return Ovt(this,r)},b.gc=function(){return this.a.f},O(uo,"BasicEMap/5",1031),j(612,1,Ts,DZ),b.Nb=function(r){Bs(this,r)},b.Ob=function(){return this.b!=-1},b.Pb=function(){var r;if(this.f.e!=this.c)throw Z(new Ku);if(this.b==-1)throw Z(new Zo);return this.d=this.a,this.e=this.b,gxt(this),r=p(this.f.d[this.d].g[this.e],136),this.ck(r)},b.Qb=function(){if(this.f.e!=this.c)throw Z(new Ku);if(this.e==-1)throw Z(new sc);this.f.c.Kc(be(this.f.d[this.d],this.e)),this.c=this.f.e,this.e=-1,this.a==this.d&&this.b!=-1&&--this.b},b.ck=function(r){return r},b.a=0,b.b=-1,b.c=0,b.d=0,b.e=0,O(uo,"BasicEMap/BasicEMapIterator",612),j(1025,612,Ts,Wit),b.ck=function(r){return r.jd()},O(uo,"BasicEMap/BasicEMapKeyIterator",1025),j(1026,612,Ts,qit),b.ck=function(r){return r.kd()},O(uo,"BasicEMap/BasicEMapValueIterator",1026),j(vf,1,_y,crt),b.wc=function(r){wI(this,r)},b.$b=function(){this.a.c.$b()},b._b=function(r){return _at(this,r)},b.uc=function(r){return qkt(this.a,r)},b.vc=function(){return Fvn(this.a)},b.Fb=function(r){return Xct(this.a,r)},b.xc=function(r){return Jf(this.a,r)},b.Hb=function(){return vve(this.a.c)},b.dc=function(){return this.a.f==0},b.ec=function(){return $vn(this.a)},b.yc=function(r,s){return HI(this.a,r,s)},b.Ac=function(r){return Nz(this.a,r)},b.gc=function(){return this.a.f},b.Ib=function(){return bke(this.a.c)},b.Bc=function(){return Rvn(this.a)},O(uo,"BasicEMap/DelegatingMap",vf),j(611,1,{45:1,136:1,611:1},yut),b.Fb=function(r){var s;return me(r,45)?(s=p(r,45),(this.b!=null?Tr(this.b,s.jd()):Se(this.b)===Se(s.jd()))&&(this.c!=null?Tr(this.c,s.kd()):Se(this.c)===Se(s.kd()))):!1},b.yi=function(){return this.a},b.jd=function(){return this.b},b.kd=function(){return this.c},b.Hb=function(){return this.a^(this.c==null?0:Jr(this.c))},b.zi=function(r){this.a=r},b.Ai=function(r){throw Z(new ub)},b.ld=function(r){var s;return s=this.c,this.c=r,s},b.Ib=function(){return this.b+"->"+this.c},b.a=0;var y7n=O(uo,"BasicEMap/EntryImpl",611);j(534,1,{},ZR),O(uo,"BasicEMap/View",534);var iP;j(769,1,{}),b.Fb=function(r){return SCe((At(),po),r)},b.Hb=function(){return Ive((At(),po))},b.Ib=function(){return Ah((At(),po))},O(uo,"ECollections/BasicEmptyUnmodifiableEList",769),j(1302,1,Vp,uYe),b.Nb=function(r){Bs(this,r)},b.Rb=function(r){throw Z(new zn)},b.Ob=function(){return!1},b.Sb=function(){return!1},b.Pb=function(){throw Z(new Zo)},b.Tb=function(){return 0},b.Ub=function(){throw Z(new Zo)},b.Vb=function(){return-1},b.Qb=function(){throw Z(new zn)},b.Wb=function(r){throw Z(new zn)},O(uo,"ECollections/BasicEmptyUnmodifiableEList/1",1302),j(1300,769,{20:1,18:1,16:1,61:1},Xrt),b._c=function(r,s){hst()},b.Ec=function(r){return fst()},b.ad=function(r,s){return pst()},b.Fc=function(r){return gst()},b.$b=function(){mst()},b.Gc=function(r){return!1},b.Hc=function(r){return!1},b.Ic=function(r){Ws(this,r)},b.Xb=function(r){return Jbe((At(),r)),null},b.bd=function(r){return-1},b.dc=function(){return!0},b.Jc=function(){return this.a},b.cd=function(){return this.a},b.dd=function(r){return this.a},b.Ri=function(r,s){return bst()},b.Si=function(r,s){wst()},b.ed=function(r){return yst()},b.Kc=function(r){return xst()},b.fd=function(r,s){return vst()},b.gc=function(){return 0},b.gd=function(r){Mb(this,r)},b.Lc=function(){return new Ct(this,16)},b.Mc=function(){return new kt(null,new Ct(this,16))},b.hd=function(r,s){return At(),new Jm(po,r,s)},b.Nc=function(){return Uye((At(),po))},b.Oc=function(r){return At(),OM(po,r)},O(uo,"ECollections/EmptyUnmodifiableEList",1300),j(1301,769,{20:1,18:1,16:1,61:1,586:1},Qrt),b._c=function(r,s){hst()},b.Ec=function(r){return fst()},b.ad=function(r,s){return pst()},b.Fc=function(r){return gst()},b.$b=function(){mst()},b.Gc=function(r){return!1},b.Hc=function(r){return!1},b.Ic=function(r){Ws(this,r)},b.Xb=function(r){return Jbe((At(),r)),null},b.bd=function(r){return-1},b.dc=function(){return!0},b.Jc=function(){return this.a},b.cd=function(){return this.a},b.dd=function(r){return this.a},b.Ri=function(r,s){return bst()},b.Si=function(r,s){wst()},b.ed=function(r){return yst()},b.Kc=function(r){return xst()},b.fd=function(r,s){return vst()},b.gc=function(){return 0},b.gd=function(r){Mb(this,r)},b.Lc=function(){return new Ct(this,16)},b.Mc=function(){return new kt(null,new Ct(this,16))},b.hd=function(r,s){return At(),new Jm(po,r,s)},b.Nc=function(){return Uye((At(),po))},b.Oc=function(r){return At(),OM(po,r)},b._j=function(){return At(),At(),Zp},O(uo,"ECollections/EmptyUnmodifiableEMap",1301);var t8e=pi(uo,"Enumerator"),Qq;j(290,1,{290:1},Ane),b.Fb=function(r){var s;return this===r?!0:me(r,290)?(s=p(r,290),this.f==s.f&&Mbn(this.i,s.i)&&tZ(this.a,this.f&256?s.f&256?s.a:null:s.f&256?null:s.a)&&tZ(this.d,s.d)&&tZ(this.g,s.g)&&tZ(this.e,s.e)&&D5n(this,s)):!1},b.Hb=function(){return this.f},b.Ib=function(){return E3t(this)},b.f=0;var sLt=0,oLt=0,aLt=0,lLt=0,n8e=0,r8e=0,i8e=0,s8e=0,o8e=0,cLt,Yj=0,Xj=0,uLt=0,dLt=0,Zq,a8e;O(uo,"URI",290),j(1090,44,Jk,Zrt),b.yc=function(r,s){return p(Ro(this,Un(r),p(s,290)),290)},O(uo,"URI/URICache",1090),j(492,67,xp,fYe,BF),b.Qi=function(){return!0},O(uo,"UniqueEList",492),j(578,63,Jg,RB),O(uo,"WrappedException",578);var lr=pi(ld,gTt),wv=pi(ld,mTt),Ql=pi(ld,bTt),yv=pi(ld,wTt),sh=pi(ld,yTt),Wd=pi(ld,"EClass"),Lce=pi(ld,"EDataType"),fLt;j(1198,44,Jk,eit),b.xc=function(r){return Cs(r)?rl(this,r):ta(Po(this.f,r))},O(ld,"EDataType/Internal/ConversionDelegate/Factory/Registry/Impl",1198);var eG=pi(ld,"EEnum"),o0=pi(ld,xTt),Ao=pi(ld,vTt),qd=pi(ld,kTt),Gd,Yy=pi(ld,CTt),xv=pi(ld,STt);j(1023,1,{},hYe),b.Ib=function(){return"NIL"},O(ld,"EStructuralFeature/Internal/DynamicValueHolder/1",1023);var hLt;j(1022,44,Jk,tit),b.xc=function(r){return Cs(r)?rl(this,r):ta(Po(this.f,r))},O(ld,"EStructuralFeature/Internal/SettingDelegate/Factory/Registry/Impl",1022);var Il=pi(ld,ETt),_E=pi(ld,"EValidator/PatternMatcher"),l8e,c8e,Ut,fm,vv,$1,pLt,gLt,mLt,F1,hm,B1,Xy,Wh,bLt,wLt,Vd,pm,yLt,gm,kv,I3,mo,xLt,vLt,Qy,tG=pi(si,"FeatureMap/Entry");j(533,1,{75:1},rF),b.Jk=function(){return this.a},b.kd=function(){return this.b},O(Gt,"BasicEObjectImpl/1",533),j(1021,1,Nse,vat),b.Dk=function(r){return oee(this.a,this.b,r)},b.Oj=function(){return lht(this.a,this.b)},b.Wb=function(r){Nxe(this.a,this.b,r)},b.Ek=function(){Dwn(this.a,this.b)},O(Gt,"BasicEObjectImpl/4",1021),j(2043,1,{114:1}),b.Kk=function(r){this.e=r==0?kLt:Ee(cs,Pt,1,r,5,1)},b.ii=function(r){return this.e[r]},b.ji=function(r,s){this.e[r]=s},b.ki=function(r){this.e[r]=null},b.Lk=function(){return this.c},b.Mk=function(){throw Z(new zn)},b.Nk=function(){throw Z(new zn)},b.Ok=function(){return this.d},b.Pk=function(){return this.e!=null},b.Qk=function(r){this.c=r},b.Rk=function(r){throw Z(new zn)},b.Sk=function(r){throw Z(new zn)},b.Tk=function(r){this.d=r};var kLt;O(Gt,"BasicEObjectImpl/EPropertiesHolderBaseImpl",2043),j(192,2043,{114:1},Bf),b.Mk=function(){return this.a},b.Nk=function(){return this.b},b.Rk=function(r){this.a=r},b.Sk=function(r){this.b=r},O(Gt,"BasicEObjectImpl/EPropertiesHolderImpl",192),j(501,100,E_t,e$),b.rh=function(){return this.f},b.wh=function(){return this.k},b.yh=function(r,s){this.g=r,this.i=s},b.Ah=function(){return this.j&2?this.Xh().Lk():this.fi()},b.Ch=function(){return this.i},b.th=function(){return(this.j&1)!=0},b.Mh=function(){return this.g},b.Sh=function(){return(this.j&4)!=0},b.Xh=function(){return!this.k&&(this.k=new Bf),this.k},b._h=function(r){this.Xh().Qk(r),r?this.j|=2:this.j&=-3},b.bi=function(r){this.Xh().Sk(r),r?this.j|=4:this.j&=-5},b.fi=function(){return(Gm(),Ut).S},b.i=0,b.j=1,O(Gt,"EObjectImpl",501),j(785,501,{109:1,94:1,93:1,57:1,114:1,52:1,100:1},Tye),b.ii=function(r){return this.e[r]},b.ji=function(r,s){this.e[r]=s},b.ki=function(r){this.e[r]=null},b.Ah=function(){return this.d},b.Fh=function(r){return hi(this.d,r)},b.Hh=function(){return this.d},b.Lh=function(){return this.e!=null},b.Xh=function(){return!this.k&&(this.k=new pYe),this.k},b._h=function(r){this.d=r},b.ei=function(){var r;return this.e==null&&(r=mn(this.d),this.e=r==0?CLt:Ee(cs,Pt,1,r,5,1)),this},b.gi=function(){return 0};var CLt;O(Gt,"DynamicEObjectImpl",785),j(1483,785,{109:1,45:1,94:1,93:1,136:1,57:1,114:1,52:1,100:1},zut),b.Fb=function(r){return this===r},b.Hb=function(){return Yw(this)},b._h=function(r){this.d=r,this.b=tO(r,"key"),this.c=tO(r,_N)},b.yi=function(){var r;return this.a==-1&&(r=yee(this,this.b),this.a=r==null?0:Jr(r)),this.a},b.jd=function(){return yee(this,this.b)},b.kd=function(){return yee(this,this.c)},b.zi=function(r){this.a=r},b.Ai=function(r){Nxe(this,this.b,r)},b.ld=function(r){var s;return s=yee(this,this.c),Nxe(this,this.c,r),s},b.a=0,O(Gt,"DynamicEObjectImpl/BasicEMapEntry",1483),j(1484,1,{114:1},pYe),b.Kk=function(r){throw Z(new zn)},b.ii=function(r){throw Z(new zn)},b.ji=function(r,s){throw Z(new zn)},b.ki=function(r){throw Z(new zn)},b.Lk=function(){throw Z(new zn)},b.Mk=function(){return this.a},b.Nk=function(){return this.b},b.Ok=function(){return this.c},b.Pk=function(){throw Z(new zn)},b.Qk=function(r){throw Z(new zn)},b.Rk=function(r){this.a=r},b.Sk=function(r){this.b=r},b.Tk=function(r){this.c=r},O(Gt,"DynamicEObjectImpl/DynamicEPropertiesHolderImpl",1484),j(504,161,{109:1,94:1,93:1,587:1,158:1,57:1,114:1,52:1,100:1,504:1,161:1,117:1,118:1},Rme),b.xh=function(r){return i3e(this,r)},b.Ih=function(r,s,l){var d;switch(r){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),this.Ab;case 1:return this.d;case 2:return l?(!this.b&&(this.b=new su((Tt(),mo),ka,this)),this.b):(!this.b&&(this.b=new su((Tt(),mo),ka,this)),rI(this.b));case 3:return ght(this);case 4:return!this.a&&(this.a=new Gi(R1,this,4)),this.a;case 5:return!this.c&&(this.c=new wk(R1,this,5)),this.c}return Zu(this,r-mn((Tt(),fm)),Dt((d=p(Yt(this,16),29),d||fm),r),s,l)},b.Ph=function(r,s,l){var d,h,m;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),wl(this.Ab,r,l);case 3:return this.Cb&&(l=(h=this.Db>>16,h>=0?i3e(this,l):this.Cb.Qh(this,-1-h,null,l))),zye(this,p(r,158),l)}return m=p(Dt((d=p(Yt(this,16),29),d||(Tt(),fm)),s),69),m.uk().xk(this,Tl(this),s-mn((Tt(),fm)),r,l)},b.Rh=function(r,s,l){var d,h;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),co(this.Ab,r,l);case 2:return!this.b&&(this.b=new su((Tt(),mo),ka,this)),CF(this.b,r,l);case 3:return zye(this,null,l);case 4:return!this.a&&(this.a=new Gi(R1,this,4)),co(this.a,r,l)}return h=p(Dt((d=p(Yt(this,16),29),d||(Tt(),fm)),s),69),h.uk().yk(this,Tl(this),s-mn((Tt(),fm)),r,l)},b.Th=function(r){var s;switch(r){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.d!=null;case 2:return!!this.b&&this.b.f!=0;case 3:return!!ght(this);case 4:return!!this.a&&this.a.i!=0;case 5:return!!this.c&&this.c.i!=0}return Qu(this,r-mn((Tt(),fm)),Dt((s=p(Yt(this,16),29),s||fm),r))},b.$h=function(r,s){var l;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab),!this.Ab&&(this.Ab=new De(lr,this,0,3)),Ti(this.Ab,p(s,18));return;case 1:mbn(this,Un(s));return;case 2:!this.b&&(this.b=new su((Tt(),mo),ka,this)),oz(this.b,s);return;case 3:hkt(this,p(s,158));return;case 4:!this.a&&(this.a=new Gi(R1,this,4)),Tn(this.a),!this.a&&(this.a=new Gi(R1,this,4)),Ti(this.a,p(s,18));return;case 5:!this.c&&(this.c=new wk(R1,this,5)),Tn(this.c),!this.c&&(this.c=new wk(R1,this,5)),Ti(this.c,p(s,18));return}sd(this,r-mn((Tt(),fm)),Dt((l=p(Yt(this,16),29),l||fm),r),s)},b.fi=function(){return Tt(),fm},b.hi=function(r){var s;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab);return;case 1:nve(this,null);return;case 2:!this.b&&(this.b=new su((Tt(),mo),ka,this)),this.b.c.$b();return;case 3:hkt(this,null);return;case 4:!this.a&&(this.a=new Gi(R1,this,4)),Tn(this.a);return;case 5:!this.c&&(this.c=new wk(R1,this,5)),Tn(this.c);return}id(this,r-mn((Tt(),fm)),Dt((s=p(Yt(this,16),29),s||fm),r))},b.Ib=function(){return iwt(this)},b.d=null,O(Gt,"EAnnotationImpl",504),j(142,711,gTe,cc),b.Ei=function(r,s){zpn(this,r,p(s,45))},b.Uk=function(r,s){return z0n(this,p(r,45),s)},b.Yi=function(r){return p(p(this.c,72).Yi(r),136)},b.Gi=function(){return p(this.c,72).Gi()},b.Hi=function(){return p(this.c,72).Hi()},b.Ii=function(r){return p(this.c,72).Ii(r)},b.Vk=function(r,s){return CF(this,r,s)},b.Dk=function(r){return p(this.c,77).Dk(r)},b.$j=function(){},b.Oj=function(){return p(this.c,77).Oj()},b.ak=function(r,s,l){var d;return d=p(Tu(this.b).ti().pi(this.b),136),d.zi(r),d.Ai(s),d.ld(l),d},b.bk=function(){return new y1e(this)},b.Wb=function(r){oz(this,r)},b.Ek=function(){p(this.c,77).Ek()},O(si,"EcoreEMap",142),j(169,142,gTe,su),b.Zj=function(){var r,s,l,d,h,m;if(this.d==null){for(m=Ee(Z9e,pTe,67,2*this.f+1,0,1),l=this.c.Jc();l.e!=l.i.gc();)s=p(l.Wj(),136),d=s.yi(),h=(d&xr)%m.length,r=m[h],!r&&(r=m[h]=new y1e(this)),r.Ec(s);this.d=m}},O(Gt,"EAnnotationImpl/1",169),j(293,439,{109:1,94:1,93:1,158:1,197:1,57:1,114:1,470:1,52:1,100:1,161:1,293:1,117:1,118:1}),b.Ih=function(r,s,l){var d,h;switch(r){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),this.Ab;case 1:return this.zb;case 2:return zt(),!!(this.Bb&256);case 3:return zt(),!!(this.Bb&512);case 4:return Oe(this.s);case 5:return Oe(this.t);case 6:return zt(),!!this.Hk();case 7:return zt(),h=this.s,h>=1;case 8:return s?Ld(this):this.r;case 9:return this.q}return Zu(this,r-mn(this.fi()),Dt((d=p(Yt(this,16),29),d||this.fi()),r),s,l)},b.Rh=function(r,s,l){var d,h;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),co(this.Ab,r,l);case 9:return yZ(this,l)}return h=p(Dt((d=p(Yt(this,16),29),d||this.fi()),s),69),h.uk().yk(this,Tl(this),s-mn(this.fi()),r,l)},b.Th=function(r){var s,l;switch(r){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return this.Hk();case 7:return l=this.s,l>=1;case 8:return!!this.r&&!this.q.e&&ty(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&ty(this.q).i==0)}return Qu(this,r-mn(this.fi()),Dt((s=p(Yt(this,16),29),s||this.fi()),r))},b.$h=function(r,s){var l,d;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab),!this.Ab&&(this.Ab=new De(lr,this,0,3)),Ti(this.Ab,p(s,18));return;case 1:this.ri(Un(s));return;case 2:V0(this,Je(Ke(s)));return;case 3:K0(this,Je(Ke(s)));return;case 4:U0(this,p(s,15).a);return;case 5:this.Xk(p(s,15).a);return;case 8:Lb(this,p(s,143));return;case 9:d=Th(this,p(s,87),null),d&&d.mj();return}sd(this,r-mn(this.fi()),Dt((l=p(Yt(this,16),29),l||this.fi()),r),s)},b.fi=function(){return Tt(),vLt},b.hi=function(r){var s,l;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab);return;case 1:this.ri(null);return;case 2:V0(this,!0);return;case 3:K0(this,!0);return;case 4:U0(this,0);return;case 5:this.Xk(1);return;case 8:Lb(this,null);return;case 9:l=Th(this,null,null),l&&l.mj();return}id(this,r-mn(this.fi()),Dt((s=p(Yt(this,16),29),s||this.fi()),r))},b.mi=function(){Ld(this),this.Bb|=1},b.Fk=function(){return Ld(this)},b.Gk=function(){return this.t},b.Hk=function(){var r;return r=this.t,r>1||r==-1},b.Qi=function(){return(this.Bb&512)!=0},b.Wk=function(r,s){return Zve(this,r,s)},b.Xk=function(r){d2(this,r)},b.Ib=function(){return gCe(this)},b.s=0,b.t=1,O(Gt,"ETypedElementImpl",293),j(451,293,{109:1,94:1,93:1,158:1,197:1,57:1,179:1,69:1,114:1,470:1,52:1,100:1,161:1,451:1,293:1,117:1,118:1,682:1}),b.xh=function(r){return Jyt(this,r)},b.Ih=function(r,s,l){var d,h;switch(r){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),this.Ab;case 1:return this.zb;case 2:return zt(),!!(this.Bb&256);case 3:return zt(),!!(this.Bb&512);case 4:return Oe(this.s);case 5:return Oe(this.t);case 6:return zt(),!!this.Hk();case 7:return zt(),h=this.s,h>=1;case 8:return s?Ld(this):this.r;case 9:return this.q;case 10:return zt(),!!(this.Bb&vf);case 11:return zt(),!!(this.Bb&h1);case 12:return zt(),!!(this.Bb&I2);case 13:return this.j;case 14:return tT(this);case 15:return zt(),!!(this.Bb&hc);case 16:return zt(),!!(this.Bb&hp);case 17:return i2(this)}return Zu(this,r-mn(this.fi()),Dt((d=p(Yt(this,16),29),d||this.fi()),r),s,l)},b.Ph=function(r,s,l){var d,h,m;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),wl(this.Ab,r,l);case 17:return this.Cb&&(l=(h=this.Db>>16,h>=0?Jyt(this,l):this.Cb.Qh(this,-1-h,null,l))),Du(this,r,17,l)}return m=p(Dt((d=p(Yt(this,16),29),d||this.fi()),s),69),m.uk().xk(this,Tl(this),s-mn(this.fi()),r,l)},b.Rh=function(r,s,l){var d,h;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),co(this.Ab,r,l);case 9:return yZ(this,l);case 17:return Du(this,null,17,l)}return h=p(Dt((d=p(Yt(this,16),29),d||this.fi()),s),69),h.uk().yk(this,Tl(this),s-mn(this.fi()),r,l)},b.Th=function(r){var s,l;switch(r){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return this.Hk();case 7:return l=this.s,l>=1;case 8:return!!this.r&&!this.q.e&&ty(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&ty(this.q).i==0);case 10:return(this.Bb&vf)==0;case 11:return(this.Bb&h1)!=0;case 12:return(this.Bb&I2)!=0;case 13:return this.j!=null;case 14:return tT(this)!=null;case 15:return(this.Bb&hc)!=0;case 16:return(this.Bb&hp)!=0;case 17:return!!i2(this)}return Qu(this,r-mn(this.fi()),Dt((s=p(Yt(this,16),29),s||this.fi()),r))},b.$h=function(r,s){var l,d;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab),!this.Ab&&(this.Ab=new De(lr,this,0,3)),Ti(this.Ab,p(s,18));return;case 1:HZ(this,Un(s));return;case 2:V0(this,Je(Ke(s)));return;case 3:K0(this,Je(Ke(s)));return;case 4:U0(this,p(s,15).a);return;case 5:this.Xk(p(s,15).a);return;case 8:Lb(this,p(s,143));return;case 9:d=Th(this,p(s,87),null),d&&d.mj();return;case 10:$_(this,Je(Ke(s)));return;case 11:z_(this,Je(Ke(s)));return;case 12:B_(this,Je(Ke(s)));return;case 13:Gbe(this,Un(s));return;case 15:F_(this,Je(Ke(s)));return;case 16:H_(this,Je(Ke(s)));return}sd(this,r-mn(this.fi()),Dt((l=p(Yt(this,16),29),l||this.fi()),r),s)},b.fi=function(){return Tt(),xLt},b.hi=function(r){var s,l;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab);return;case 1:me(this.Cb,88)&&S2($c(p(this.Cb,88)),4),bl(this,null);return;case 2:V0(this,!0);return;case 3:K0(this,!0);return;case 4:U0(this,0);return;case 5:this.Xk(1);return;case 8:Lb(this,null);return;case 9:l=Th(this,null,null),l&&l.mj();return;case 10:$_(this,!0);return;case 11:z_(this,!1);return;case 12:B_(this,!1);return;case 13:this.i=null,ez(this,null);return;case 15:F_(this,!1);return;case 16:H_(this,!1);return}id(this,r-mn(this.fi()),Dt((s=p(Yt(this,16),29),s||this.fi()),r))},b.mi=function(){f_($o((dc(),Hs),this)),Ld(this),this.Bb|=1},b.nk=function(){return this.f},b.gk=function(){return tT(this)},b.ok=function(){return i2(this)},b.sk=function(){return null},b.Yk=function(){return this.k},b.Jj=function(){return this.n},b.tk=function(){return Vz(this)},b.uk=function(){var r,s,l,d,h,m,y,k,_;return this.p||(l=i2(this),(l.i==null&&fp(l),l.i).length,d=this.sk(),d&&mn(i2(d)),h=Ld(this),y=h.ik(),r=y?y.i&1?y==Zl?Ci:y==Wn?Qi:y==Sv?UT:y==As?Hi:y==ex?Py:y==R3?Ry:y==gc?XS:RN:y:null,s=tT(this),k=h.gk(),tEn(this),this.Bb&hp&&((m=d3e((dc(),Hs),l))&&m!=this||(m=fS($o(Hs,this))))?this.p=new Cat(this,m):this.Hk()?this.$k()?d?this.Bb&hc?r?this._k()?this.p=new kb(47,r,this,d):this.p=new kb(5,r,this,d):this._k()?this.p=new Ab(46,this,d):this.p=new Ab(4,this,d):r?this._k()?this.p=new kb(49,r,this,d):this.p=new kb(7,r,this,d):this._k()?this.p=new Ab(48,this,d):this.p=new Ab(6,this,d):this.Bb&hc?r?r==Yb?this.p=new R0(50,nLt,this):this._k()?this.p=new R0(43,r,this):this.p=new R0(1,r,this):this._k()?this.p=new F0(42,this):this.p=new F0(0,this):r?r==Yb?this.p=new R0(41,nLt,this):this._k()?this.p=new R0(45,r,this):this.p=new R0(3,r,this):this._k()?this.p=new F0(44,this):this.p=new F0(2,this):me(h,159)?r==tG?this.p=new F0(40,this):this.Bb&512?this.Bb&hc?r?this.p=new R0(9,r,this):this.p=new F0(8,this):r?this.p=new R0(11,r,this):this.p=new F0(10,this):this.Bb&hc?r?this.p=new R0(13,r,this):this.p=new F0(12,this):r?this.p=new R0(15,r,this):this.p=new F0(14,this):d?(_=d.t,_>1||_==-1?this._k()?this.Bb&hc?r?this.p=new kb(25,r,this,d):this.p=new Ab(24,this,d):r?this.p=new kb(27,r,this,d):this.p=new Ab(26,this,d):this.Bb&hc?r?this.p=new kb(29,r,this,d):this.p=new Ab(28,this,d):r?this.p=new kb(31,r,this,d):this.p=new Ab(30,this,d):this._k()?this.Bb&hc?r?this.p=new kb(33,r,this,d):this.p=new Ab(32,this,d):r?this.p=new kb(35,r,this,d):this.p=new Ab(34,this,d):this.Bb&hc?r?this.p=new kb(37,r,this,d):this.p=new Ab(36,this,d):r?this.p=new kb(39,r,this,d):this.p=new Ab(38,this,d)):this._k()?this.Bb&hc?r?this.p=new R0(17,r,this):this.p=new F0(16,this):r?this.p=new R0(19,r,this):this.p=new F0(18,this):this.Bb&hc?r?this.p=new R0(21,r,this):this.p=new F0(20,this):r?this.p=new R0(23,r,this):this.p=new F0(22,this):this.Zk()?this._k()?this.p=new fut(p(h,29),this,d):this.p=new Txe(p(h,29),this,d):me(h,159)?r==tG?this.p=new F0(40,this):this.Bb&hc?r?this.p=new cdt(s,k,this,(kte(),y==Wn?m8e:y==Zl?d8e:y==ex?b8e:y==Sv?g8e:y==As?p8e:y==R3?w8e:y==gc?f8e:y==gd?h8e:$ce)):this.p=new Eft(p(h,159),s,k,this):r?this.p=new ldt(s,k,this,(kte(),y==Wn?m8e:y==Zl?d8e:y==ex?b8e:y==Sv?g8e:y==As?p8e:y==R3?w8e:y==gc?f8e:y==gd?h8e:$ce)):this.p=new Sft(p(h,159),s,k,this):this.$k()?d?this.Bb&hc?this._k()?this.p=new put(p(h,29),this,d):this.p=new fye(p(h,29),this,d):this._k()?this.p=new hut(p(h,29),this,d):this.p=new KQ(p(h,29),this,d):this.Bb&hc?this._k()?this.p=new uct(p(h,29),this):this.p=new jwe(p(h,29),this):this._k()?this.p=new cct(p(h,29),this):this.p=new OQ(p(h,29),this):this._k()?d?this.Bb&hc?this.p=new gut(p(h,29),this,d):this.p=new hye(p(h,29),this,d):this.Bb&hc?this.p=new dct(p(h,29),this):this.p=new Dwe(p(h,29),this):d?this.Bb&hc?this.p=new mut(p(h,29),this,d):this.p=new pye(p(h,29),this,d):this.Bb&hc?this.p=new fct(p(h,29),this):this.p=new FF(p(h,29),this)),this.p},b.pk=function(){return(this.Bb&vf)!=0},b.Zk=function(){return!1},b.$k=function(){return!1},b.qk=function(){return(this.Bb&hp)!=0},b.vk=function(){return vee(this)},b._k=function(){return!1},b.rk=function(){return(this.Bb&hc)!=0},b.al=function(r){this.k=r},b.ri=function(r){HZ(this,r)},b.Ib=function(){return bH(this)},b.e=!1,b.n=0,O(Gt,"EStructuralFeatureImpl",451),j(335,451,{109:1,94:1,93:1,38:1,158:1,197:1,57:1,179:1,69:1,114:1,470:1,52:1,100:1,335:1,161:1,451:1,293:1,117:1,118:1,682:1},pX),b.Ih=function(r,s,l){var d,h;switch(r){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),this.Ab;case 1:return this.zb;case 2:return zt(),!!(this.Bb&256);case 3:return zt(),!!(this.Bb&512);case 4:return Oe(this.s);case 5:return Oe(this.t);case 6:return zt(),!!cCe(this);case 7:return zt(),h=this.s,h>=1;case 8:return s?Ld(this):this.r;case 9:return this.q;case 10:return zt(),!!(this.Bb&vf);case 11:return zt(),!!(this.Bb&h1);case 12:return zt(),!!(this.Bb&I2);case 13:return this.j;case 14:return tT(this);case 15:return zt(),!!(this.Bb&hc);case 16:return zt(),!!(this.Bb&hp);case 17:return i2(this);case 18:return zt(),!!(this.Bb&Aa);case 19:return s?Hee(this):Tgt(this)}return Zu(this,r-mn((Tt(),vv)),Dt((d=p(Yt(this,16),29),d||vv),r),s,l)},b.Th=function(r){var s,l;switch(r){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return cCe(this);case 7:return l=this.s,l>=1;case 8:return!!this.r&&!this.q.e&&ty(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&ty(this.q).i==0);case 10:return(this.Bb&vf)==0;case 11:return(this.Bb&h1)!=0;case 12:return(this.Bb&I2)!=0;case 13:return this.j!=null;case 14:return tT(this)!=null;case 15:return(this.Bb&hc)!=0;case 16:return(this.Bb&hp)!=0;case 17:return!!i2(this);case 18:return(this.Bb&Aa)!=0;case 19:return!!Tgt(this)}return Qu(this,r-mn((Tt(),vv)),Dt((s=p(Yt(this,16),29),s||vv),r))},b.$h=function(r,s){var l,d;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab),!this.Ab&&(this.Ab=new De(lr,this,0,3)),Ti(this.Ab,p(s,18));return;case 1:HZ(this,Un(s));return;case 2:V0(this,Je(Ke(s)));return;case 3:K0(this,Je(Ke(s)));return;case 4:U0(this,p(s,15).a);return;case 5:Xit(this,p(s,15).a);return;case 8:Lb(this,p(s,143));return;case 9:d=Th(this,p(s,87),null),d&&d.mj();return;case 10:$_(this,Je(Ke(s)));return;case 11:z_(this,Je(Ke(s)));return;case 12:B_(this,Je(Ke(s)));return;case 13:Gbe(this,Un(s));return;case 15:F_(this,Je(Ke(s)));return;case 16:H_(this,Je(Ke(s)));return;case 18:hte(this,Je(Ke(s)));return}sd(this,r-mn((Tt(),vv)),Dt((l=p(Yt(this,16),29),l||vv),r),s)},b.fi=function(){return Tt(),vv},b.hi=function(r){var s,l;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab);return;case 1:me(this.Cb,88)&&S2($c(p(this.Cb,88)),4),bl(this,null);return;case 2:V0(this,!0);return;case 3:K0(this,!0);return;case 4:U0(this,0);return;case 5:this.b=0,d2(this,1);return;case 8:Lb(this,null);return;case 9:l=Th(this,null,null),l&&l.mj();return;case 10:$_(this,!0);return;case 11:z_(this,!1);return;case 12:B_(this,!1);return;case 13:this.i=null,ez(this,null);return;case 15:F_(this,!1);return;case 16:H_(this,!1);return;case 18:hte(this,!1);return}id(this,r-mn((Tt(),vv)),Dt((s=p(Yt(this,16),29),s||vv),r))},b.mi=function(){Hee(this),f_($o((dc(),Hs),this)),Ld(this),this.Bb|=1},b.Hk=function(){return cCe(this)},b.Wk=function(r,s){return this.b=0,this.a=null,Zve(this,r,s)},b.Xk=function(r){Xit(this,r)},b.Ib=function(){var r;return this.Db&64?bH(this):(r=new Nd(bH(this)),r.a+=" (iD: ",D0(r,(this.Bb&Aa)!=0),r.a+=")",r.a)},b.b=0,O(Gt,"EAttributeImpl",335),j(360,439,{109:1,94:1,93:1,143:1,158:1,197:1,57:1,114:1,52:1,100:1,360:1,161:1,117:1,118:1,681:1}),b.bl=function(r){return r.Ah()==this},b.xh=function(r){return Vte(this,r)},b.yh=function(r,s){this.w=null,this.Db=s<<16|this.Db&255,this.Cb=r},b.Ih=function(r,s,l){var d;switch(r){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D!=null?this.D:this.B;case 3:return wy(this);case 4:return this.gk();case 5:return this.F;case 6:return s?Tu(this):g_(this);case 7:return!this.A&&(this.A=new oc(Il,this,7)),this.A}return Zu(this,r-mn(this.fi()),Dt((d=p(Yt(this,16),29),d||this.fi()),r),s,l)},b.Ph=function(r,s,l){var d,h,m;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),wl(this.Ab,r,l);case 6:return this.Cb&&(l=(h=this.Db>>16,h>=0?Vte(this,l):this.Cb.Qh(this,-1-h,null,l))),Du(this,r,6,l)}return m=p(Dt((d=p(Yt(this,16),29),d||this.fi()),s),69),m.uk().xk(this,Tl(this),s-mn(this.fi()),r,l)},b.Rh=function(r,s,l){var d,h;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),co(this.Ab,r,l);case 6:return Du(this,null,6,l);case 7:return!this.A&&(this.A=new oc(Il,this,7)),co(this.A,r,l)}return h=p(Dt((d=p(Yt(this,16),29),d||this.fi()),s),69),h.uk().yk(this,Tl(this),s-mn(this.fi()),r,l)},b.Th=function(r){var s;switch(r){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!wy(this);case 4:return this.gk()!=null;case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!g_(this);case 7:return!!this.A&&this.A.i!=0}return Qu(this,r-mn(this.fi()),Dt((s=p(Yt(this,16),29),s||this.fi()),r))},b.$h=function(r,s){var l;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab),!this.Ab&&(this.Ab=new De(lr,this,0,3)),Ti(this.Ab,p(s,18));return;case 1:gB(this,Un(s));return;case 2:vQ(this,Un(s));return;case 5:lT(this,Un(s));return;case 7:!this.A&&(this.A=new oc(Il,this,7)),Tn(this.A),!this.A&&(this.A=new oc(Il,this,7)),Ti(this.A,p(s,18));return}sd(this,r-mn(this.fi()),Dt((l=p(Yt(this,16),29),l||this.fi()),r),s)},b.fi=function(){return Tt(),pLt},b.hi=function(r){var s;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab);return;case 1:me(this.Cb,184)&&(p(this.Cb,184).tb=null),bl(this,null);return;case 2:O_(this,null),C_(this,this.D);return;case 5:lT(this,null);return;case 7:!this.A&&(this.A=new oc(Il,this,7)),Tn(this.A);return}id(this,r-mn(this.fi()),Dt((s=p(Yt(this,16),29),s||this.fi()),r))},b.fk=function(){var r;return this.G==-1&&(this.G=(r=Tu(this),r?J0(r.si(),this):-1)),this.G},b.gk=function(){return null},b.hk=function(){return Tu(this)},b.cl=function(){return this.v},b.ik=function(){return wy(this)},b.jk=function(){return this.D!=null?this.D:this.B},b.kk=function(){return this.F},b.dk=function(r){return Rne(this,r)},b.dl=function(r){this.v=r},b.el=function(r){m1t(this,r)},b.fl=function(r){this.C=r},b.ri=function(r){gB(this,r)},b.Ib=function(){return _z(this)},b.C=null,b.D=null,b.G=-1,O(Gt,"EClassifierImpl",360),j(88,360,{109:1,94:1,93:1,29:1,143:1,158:1,197:1,57:1,114:1,52:1,100:1,88:1,360:1,161:1,471:1,117:1,118:1,681:1},Hme),b.bl=function(r){return T0n(this,r.Ah())},b.Ih=function(r,s,l){var d;switch(r){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D!=null?this.D:this.B;case 3:return wy(this);case 4:return null;case 5:return this.F;case 6:return s?Tu(this):g_(this);case 7:return!this.A&&(this.A=new oc(Il,this,7)),this.A;case 8:return zt(),!!(this.Bb&256);case 9:return zt(),!!(this.Bb&512);case 10:return qo(this);case 11:return!this.q&&(this.q=new De(qd,this,11,10)),this.q;case 12:return qk(this);case 13:return ZM(this);case 14:return ZM(this),this.r;case 15:return qk(this),this.k;case 16:return Q3e(this);case 17:return zne(this);case 18:return fp(this);case 19:return lH(this);case 20:return qk(this),this.o;case 21:return!this.s&&(this.s=new De(Ql,this,21,17)),this.s;case 22:return za(this);case 23:return Tne(this)}return Zu(this,r-mn((Tt(),$1)),Dt((d=p(Yt(this,16),29),d||$1),r),s,l)},b.Ph=function(r,s,l){var d,h,m;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),wl(this.Ab,r,l);case 6:return this.Cb&&(l=(h=this.Db>>16,h>=0?Vte(this,l):this.Cb.Qh(this,-1-h,null,l))),Du(this,r,6,l);case 11:return!this.q&&(this.q=new De(qd,this,11,10)),wl(this.q,r,l);case 21:return!this.s&&(this.s=new De(Ql,this,21,17)),wl(this.s,r,l)}return m=p(Dt((d=p(Yt(this,16),29),d||(Tt(),$1)),s),69),m.uk().xk(this,Tl(this),s-mn((Tt(),$1)),r,l)},b.Rh=function(r,s,l){var d,h;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),co(this.Ab,r,l);case 6:return Du(this,null,6,l);case 7:return!this.A&&(this.A=new oc(Il,this,7)),co(this.A,r,l);case 11:return!this.q&&(this.q=new De(qd,this,11,10)),co(this.q,r,l);case 21:return!this.s&&(this.s=new De(Ql,this,21,17)),co(this.s,r,l);case 22:return co(za(this),r,l)}return h=p(Dt((d=p(Yt(this,16),29),d||(Tt(),$1)),s),69),h.uk().yk(this,Tl(this),s-mn((Tt(),$1)),r,l)},b.Th=function(r){var s;switch(r){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!wy(this);case 4:return!1;case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!g_(this);case 7:return!!this.A&&this.A.i!=0;case 8:return(this.Bb&256)!=0;case 9:return(this.Bb&512)!=0;case 10:return!!this.u&&za(this.u.a).i!=0&&!(this.n&&Pte(this.n));case 11:return!!this.q&&this.q.i!=0;case 12:return qk(this).i!=0;case 13:return ZM(this).i!=0;case 14:return ZM(this),this.r.i!=0;case 15:return qk(this),this.k.i!=0;case 16:return Q3e(this).i!=0;case 17:return zne(this).i!=0;case 18:return fp(this).i!=0;case 19:return lH(this).i!=0;case 20:return qk(this),!!this.o;case 21:return!!this.s&&this.s.i!=0;case 22:return!!this.n&&Pte(this.n);case 23:return Tne(this).i!=0}return Qu(this,r-mn((Tt(),$1)),Dt((s=p(Yt(this,16),29),s||$1),r))},b.Wh=function(r){var s;return s=this.i==null||this.q&&this.q.i!=0?null:tO(this,r),s||zSe(this,r)},b.$h=function(r,s){var l;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab),!this.Ab&&(this.Ab=new De(lr,this,0,3)),Ti(this.Ab,p(s,18));return;case 1:gB(this,Un(s));return;case 2:vQ(this,Un(s));return;case 5:lT(this,Un(s));return;case 7:!this.A&&(this.A=new oc(Il,this,7)),Tn(this.A),!this.A&&(this.A=new oc(Il,this,7)),Ti(this.A,p(s,18));return;case 8:nke(this,Je(Ke(s)));return;case 9:rke(this,Je(Ke(s)));return;case 10:nN(qo(this)),Ti(qo(this),p(s,18));return;case 11:!this.q&&(this.q=new De(qd,this,11,10)),Tn(this.q),!this.q&&(this.q=new De(qd,this,11,10)),Ti(this.q,p(s,18));return;case 21:!this.s&&(this.s=new De(Ql,this,21,17)),Tn(this.s),!this.s&&(this.s=new De(Ql,this,21,17)),Ti(this.s,p(s,18));return;case 22:Tn(za(this)),Ti(za(this),p(s,18));return}sd(this,r-mn((Tt(),$1)),Dt((l=p(Yt(this,16),29),l||$1),r),s)},b.fi=function(){return Tt(),$1},b.hi=function(r){var s;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab);return;case 1:me(this.Cb,184)&&(p(this.Cb,184).tb=null),bl(this,null);return;case 2:O_(this,null),C_(this,this.D);return;case 5:lT(this,null);return;case 7:!this.A&&(this.A=new oc(Il,this,7)),Tn(this.A);return;case 8:nke(this,!1);return;case 9:rke(this,!1);return;case 10:this.u&&nN(this.u);return;case 11:!this.q&&(this.q=new De(qd,this,11,10)),Tn(this.q);return;case 21:!this.s&&(this.s=new De(Ql,this,21,17)),Tn(this.s);return;case 22:this.n&&Tn(this.n);return}id(this,r-mn((Tt(),$1)),Dt((s=p(Yt(this,16),29),s||$1),r))},b.mi=function(){var r,s;if(qk(this),ZM(this),Q3e(this),zne(this),fp(this),lH(this),Tne(this),cM(J1n($c(this))),this.s)for(r=0,s=this.s.i;r<s;++r)T8(be(this.s,r));if(this.q)for(r=0,s=this.q.i;r<s;++r)T8(be(this.q,r));G0((dc(),Hs),this).ve(),this.Bb|=1},b.Ib=function(){return w3e(this)},b.k=null,b.r=null;var Qj,SLt,Pce;O(Gt,"EClassImpl",88),j(2054,2053,ATt),b.Ci=function(r,s){return $ne(this,r,s)},b.Di=function(r){return $ne(this,this.i,r)},b.Ei=function(r,s){pCe(this,r,s)},b.Fi=function(r){yne(this,r)},b.Uk=function(r,s){return wl(this,r,s)},b.Yi=function(r){return N2e(this,r)},b.Vk=function(r,s){return co(this,r,s)},b.Vi=function(r,s){return rCt(this,r,s)},b.Gi=function(){return new QC(this)},b.Hi=function(){return new E8(this)},b.Ii=function(r){return mI(this,r)},O(si,"NotifyingInternalEListImpl",2054),j(623,2054,Xo),b.Gc=function(r){return kCt(this,r)},b.Gj=function(r,s,l,d,h){return rM(this,r,s,l,d,h)},b.Hj=function(r){F5(this,r)},b.Dk=function(r){return this},b.Jk=function(){return Dt(this.e.Ah(),this.Jj())},b.Ij=function(){return this.Jk()},b.Jj=function(){return hi(this.e.Ah(),this.Jk())},b.gl=function(){return p(this.Jk().Fk(),29).ik()},b.hl=function(){return yo(p(this.Jk(),19)).n},b.hj=function(){return this.e},b.il=function(){return!0},b.jl=function(){return!1},b.kl=function(){return!1},b.ll=function(){return!1},b.bd=function(r){return J0(this,r)},b.Lj=function(r,s){var l;return l=p(r,52),this.kl()?this.il()?l.Oh(this.e,this.hl(),this.gl(),s):l.Oh(this.e,hi(l.Ah(),yo(p(this.Jk(),19))),null,s):l.Oh(this.e,-1-this.Jj(),null,s)},b.Mj=function(r,s){var l;return l=p(r,52),this.kl()?this.il()?l.Qh(this.e,this.hl(),this.gl(),s):l.Qh(this.e,hi(l.Ah(),yo(p(this.Jk(),19))),null,s):l.Qh(this.e,-1-this.Jj(),null,s)},b.$k=function(){return!1},b.ml=function(){return!0},b.dk=function(r){return jpt(this.d,r)},b.Nj=function(){return ru(this.e)},b.Oj=function(){return this.i!=0},b.$i=function(r){return gI(this.d,r)},b.Ui=function(r,s){return this.ml()&&this.ll()?PS(this,r,p(s,57)):s},b.nl=function(r){return r.Sh()?i1(this.e,p(r,52)):r},b.Wb=function(r){glt(this,r)},b.Nc=function(){return d0t(this)},b.Oc=function(r){var s;if(this.ll())for(s=this.i-1;s>=0;--s)be(this,s);return Eke(this,r)},b.Ek=function(){Tn(this)},b.Xi=function(r,s){return Hmt(this,r,s)},O(si,"EcoreEList",623),j(491,623,Xo,$8),b.Ji=function(){return!1},b.Jj=function(){return this.c},b.Kj=function(){return!1},b.ml=function(){return!0},b.Qi=function(){return!0},b.Ui=function(r,s){return s},b.Wi=function(){return!1},b.c=0,O(si,"EObjectEList",491),j(81,491,Xo,Gi),b.Kj=function(){return!0},b.kl=function(){return!1},b.$k=function(){return!0},O(si,"EObjectContainmentEList",81),j(543,81,Xo,pF),b.Li=function(){this.b=!0},b.Oj=function(){return this.b},b.Ek=function(){var r;Tn(this),ru(this.e)?(r=this.b,this.b=!1,Er(this.e,new ff(this.e,2,this.c,r,!1))):this.b=!1},b.b=!1,O(si,"EObjectContainmentEList/Unsettable",543),j(1130,543,Xo,udt),b.Ri=function(r,s){var l,d;return l=p(AM(this,r,s),87),ru(this.e)&&F5(this,new oI(this.a,7,(Tt(),gLt),Oe(s),(d=l.c,me(d,88)?p(d,29):Vd),r)),l},b.Sj=function(r,s){return IEn(this,p(r,87),s)},b.Tj=function(r,s){return OEn(this,p(r,87),s)},b.Uj=function(r,s,l){return LTn(this,p(r,87),p(s,87),l)},b.Gj=function(r,s,l,d,h){switch(r){case 3:return rM(this,r,s,l,d,this.i>1);case 5:return rM(this,r,s,l,d,this.i-p(l,16).gc()>0);default:return new zg(this.e,r,this.c,s,l,d,!0)}},b.Rj=function(){return!0},b.Oj=function(){return Pte(this)},b.Ek=function(){Tn(this)},O(Gt,"EClassImpl/1",1130),j(1144,1143,hTe),b.bj=function(r){var s,l,d,h,m,y,k;if(l=r.ej(),l!=8){if(d=b5n(r),d==0)switch(l){case 1:case 9:{k=r.ij(),k!=null&&(s=$c(p(k,471)),!s.c&&(s.c=new O5),FB(s.c,r.hj())),y=r.gj(),y!=null&&(h=p(y,471),h.Bb&1||(s=$c(h),!s.c&&(s.c=new O5),jn(s.c,p(r.hj(),29))));break}case 3:{y=r.gj(),y!=null&&(h=p(y,471),h.Bb&1||(s=$c(h),!s.c&&(s.c=new O5),jn(s.c,p(r.hj(),29))));break}case 5:{if(y=r.gj(),y!=null)for(m=p(y,18).Jc();m.Ob();)h=p(m.Pb(),471),h.Bb&1||(s=$c(h),!s.c&&(s.c=new O5),jn(s.c,p(r.hj(),29)));break}case 4:{k=r.ij(),k!=null&&(h=p(k,471),h.Bb&1||(s=$c(h),!s.c&&(s.c=new O5),FB(s.c,r.hj())));break}case 6:{if(k=r.ij(),k!=null)for(m=p(k,18).Jc();m.Ob();)h=p(m.Pb(),471),h.Bb&1||(s=$c(h),!s.c&&(s.c=new O5),FB(s.c,r.hj()));break}}this.ol(d)}},b.ol=function(r){Zkt(this,r)},b.b=63,O(Gt,"ESuperAdapter",1144),j(1145,1144,hTe,urt),b.ol=function(r){S2(this,r)},O(Gt,"EClassImpl/10",1145),j(1134,699,Xo),b.Ci=function(r,s){return sne(this,r,s)},b.Di=function(r){return Iyt(this,r)},b.Ei=function(r,s){MI(this,r,s)},b.Fi=function(r){eI(this,r)},b.Yi=function(r){return N2e(this,r)},b.Vi=function(r,s){return xee(this,r,s)},b.Uk=function(r,s){throw Z(new zn)},b.Gi=function(){return new QC(this)},b.Hi=function(){return new E8(this)},b.Ii=function(r){return mI(this,r)},b.Vk=function(r,s){throw Z(new zn)},b.Dk=function(r){return this},b.Oj=function(){return this.i!=0},b.Wb=function(r){throw Z(new zn)},b.Ek=function(){throw Z(new zn)},O(si,"EcoreEList/UnmodifiableEList",1134),j(333,1134,Xo,fk),b.Wi=function(){return!1},O(si,"EcoreEList/UnmodifiableEList/FastCompare",333),j(1137,333,Xo,lbt),b.bd=function(r){var s,l,d;if(me(r,179)&&(s=p(r,179),l=s.Jj(),l!=-1)){for(d=this.i;l<d;++l)if(Se(this.g[l])===Se(r))return l}return-1},O(Gt,"EClassImpl/1EAllStructuralFeaturesList",1137),j(1131,492,xp,gYe),b.$i=function(r){return Ee(Ao,MTt,87,r,0,1)},b.Wi=function(){return!1},O(Gt,"EClassImpl/1EGenericSuperTypeEList",1131),j(624,492,xp,VY),b.$i=function(r){return Ee(Ql,r3,179,r,0,1)},b.Wi=function(){return!1},O(Gt,"EClassImpl/1EStructuralFeatureUniqueEList",624),j(743,492,xp,$me),b.$i=function(r){return Ee(xv,r3,19,r,0,1)},b.Wi=function(){return!1},O(Gt,"EClassImpl/1ReferenceList",743),j(1132,492,xp,drt),b.Ki=function(r,s){Rbn(this,p(s,38))},b.$i=function(r){return Ee(yv,r3,38,r,0,1)},b.Wi=function(){return!1},O(Gt,"EClassImpl/2",1132),j(1133,492,xp,mYe),b.$i=function(r){return Ee(yv,r3,38,r,0,1)},b.Wi=function(){return!1},O(Gt,"EClassImpl/3",1133),j(1135,333,Xo,Dut),b.Ec=function(r){return ivn(this,p(r,38))},b.Fi=function(r){$hn(this,p(r,38))},O(Gt,"EClassImpl/4",1135),j(1136,333,Xo,Iut),b.Ec=function(r){return svn(this,p(r,19))},b.Fi=function(r){Fhn(this,p(r,19))},O(Gt,"EClassImpl/5",1136),j(1138,492,xp,bYe),b.$i=function(r){return Ee(qd,mTe,62,r,0,1)},b.Wi=function(){return!1},O(Gt,"EClassImpl/6",1138),j(1139,492,xp,wYe),b.$i=function(r){return Ee(xv,r3,19,r,0,1)},b.Wi=function(){return!1},O(Gt,"EClassImpl/7",1139),j(2057,2056,{3:1,4:1,20:1,31:1,56:1,18:1,16:1,71:1,61:1,72:1}),b.Ci=function(r,s){return gSe(this,r,s)},b.Di=function(r){return gSe(this,this.Cj(),r)},b.Ei=function(r,s){Mvt(this,r,s)},b.Fi=function(r){wvt(this,r)},b.Uk=function(r,s){return l_n(this,r,s)},b.Vk=function(r,s){return R5n(this,r,s)},b.Vi=function(r,s){return B3t(this,r,s)},b.Yi=function(r){return this.vj(r)},b.Gi=function(){return new QC(this)},b.nj=function(){return this.qj()},b.Hi=function(){return new E8(this)},b.Ii=function(r){return mI(this,r)},O(si,"DelegatingNotifyingInternalEListImpl",2057),j(744,2057,bTe),b.Ji=function(){var r;return r=Dt(zl(this.b),this.Jj()).Fk(),me(r,159)&&!me(r,459)&&(r.ik().i&1)==0},b.Gc=function(r){var s,l,d,h,m,y,k,_;if(this.ml()){if(_=this.Cj(),_>4)if(this.dk(r)){if(this.$k()){if(d=p(r,52),l=d.Bh(),k=l==this.b&&(this.kl()?d.vh(d.Ch(),p(Dt(zl(this.b),this.Jj()).Fk(),29).ik())==yo(p(Dt(zl(this.b),this.Jj()),19)).n:-1-d.Ch()==this.Jj()),this.ll()&&!k&&!l&&d.Gh()){for(h=0;h<_;++h)if(s=dZ(this,this.vj(h)),Se(s)===Se(r))return!0}return k}else if(this.kl()&&!this.jl()){if(m=p(r,57).Jh(yo(p(Dt(zl(this.b),this.Jj()),19))),Se(m)===Se(this.b))return!0;if(m==null||!p(m,57).Sh())return!1}}else return!1;if(y=this.sj(r),this.ll()&&!y){for(h=0;h<_;++h)if(d=dZ(this,this.vj(h)),Se(d)===Se(r))return!0}return y}else return this.sj(r)},b.Gj=function(r,s,l,d,h){return new zg(this.b,r,this.Jj(),s,l,d,h)},b.Hj=function(r){Er(this.b,r)},b.Dk=function(r){return this},b.Ij=function(){return Dt(zl(this.b),this.Jj())},b.Jj=function(){return hi(zl(this.b),Dt(zl(this.b),this.Jj()))},b.hj=function(){return this.b},b.il=function(){return!!Dt(zl(this.b),this.Jj()).Fk().ik()},b.Kj=function(){var r,s;return s=Dt(zl(this.b),this.Jj()),me(s,103)?(r=p(s,19),(r.Bb&Aa)!=0||!!yo(p(s,19))):!1},b.jl=function(){var r,s,l,d;return s=Dt(zl(this.b),this.Jj()),me(s,103)?(r=p(s,19),l=yo(r),!!l&&(d=l.t,d>1||d==-1)):!1},b.kl=function(){var r,s,l;return s=Dt(zl(this.b),this.Jj()),me(s,103)?(r=p(s,19),l=yo(r),!!l):!1},b.ll=function(){var r,s;return s=Dt(zl(this.b),this.Jj()),me(s,103)?(r=p(s,19),(r.Bb&ho)!=0):!1},b.bd=function(r){var s,l,d,h;if(d=this.xj(r),d>=0)return d;if(this.ml()){for(l=0,h=this.Cj();l<h;++l)if(s=dZ(this,this.vj(l)),Se(s)===Se(r))return l}return-1},b.Lj=function(r,s){var l;return l=p(r,52),this.kl()?this.il()?l.Oh(this.b,yo(p(Dt(zl(this.b),this.Jj()),19)).n,p(Dt(zl(this.b),this.Jj()).Fk(),29).ik(),s):l.Oh(this.b,hi(l.Ah(),yo(p(Dt(zl(this.b),this.Jj()),19))),null,s):l.Oh(this.b,-1-this.Jj(),null,s)},b.Mj=function(r,s){var l;return l=p(r,52),this.kl()?this.il()?l.Qh(this.b,yo(p(Dt(zl(this.b),this.Jj()),19)).n,p(Dt(zl(this.b),this.Jj()).Fk(),29).ik(),s):l.Qh(this.b,hi(l.Ah(),yo(p(Dt(zl(this.b),this.Jj()),19))),null,s):l.Qh(this.b,-1-this.Jj(),null,s)},b.$k=function(){var r,s;return s=Dt(zl(this.b),this.Jj()),me(s,103)?(r=p(s,19),(r.Bb&Aa)!=0):!1},b.ml=function(){return me(Dt(zl(this.b),this.Jj()).Fk(),88)},b.dk=function(r){return Dt(zl(this.b),this.Jj()).Fk().dk(r)},b.Nj=function(){return ru(this.b)},b.Oj=function(){return!this.yj()},b.Qi=function(){return Dt(zl(this.b),this.Jj()).Qi()},b.Ui=function(r,s){return cO(this,r,s)},b.Wb=function(r){nN(this),Ti(this,p(r,16))},b.Nc=function(){var r;if(this.ll())for(r=this.Cj()-1;r>=0;--r)cO(this,r,this.vj(r));return this.Dj()},b.Oc=function(r){var s;if(this.ll())for(s=this.Cj()-1;s>=0;--s)cO(this,s,this.vj(s));return this.Ej(r)},b.Ek=function(){nN(this)},b.Xi=function(r,s){return f0t(this,r,s)},O(si,"DelegatingEcoreEList",744),j(1140,744,bTe,kct),b.oj=function(r,s){n0n(this,r,p(s,29))},b.pj=function(r){Upn(this,p(r,29))},b.vj=function(r){var s,l;return s=p(be(za(this.a),r),87),l=s.c,me(l,88)?p(l,29):(Tt(),Vd)},b.Aj=function(r){var s,l;return s=p(T2(za(this.a),r),87),l=s.c,me(l,88)?p(l,29):(Tt(),Vd)},b.Bj=function(r,s){return c_n(this,r,p(s,29))},b.Ji=function(){return!1},b.Gj=function(r,s,l,d,h){return null},b.qj=function(){return new hrt(this)},b.rj=function(){Tn(za(this.a))},b.sj=function(r){return swt(this,r)},b.tj=function(r){var s,l;for(l=r.Jc();l.Ob();)if(s=l.Pb(),!swt(this,s))return!1;return!0},b.uj=function(r){var s,l,d;if(me(r,16)&&(d=p(r,16),d.gc()==za(this.a).i)){for(s=d.Jc(),l=new cn(this);s.Ob();)if(Se(s.Pb())!==Se(fn(l)))return!1;return!0}return!1},b.wj=function(){var r,s,l,d,h;for(l=1,s=new cn(za(this.a));s.e!=s.i.gc();)r=p(fn(s),87),d=(h=r.c,me(h,88)?p(h,29):(Tt(),Vd)),l=31*l+(d?Yw(d):0);return l},b.xj=function(r){var s,l,d,h;for(d=0,l=new cn(za(this.a));l.e!=l.i.gc();){if(s=p(fn(l),87),Se(r)===Se((h=s.c,me(h,88)?p(h,29):(Tt(),Vd))))return d;++d}return-1},b.yj=function(){return za(this.a).i==0},b.zj=function(){return null},b.Cj=function(){return za(this.a).i},b.Dj=function(){var r,s,l,d,h,m;for(m=za(this.a).i,h=Ee(cs,Pt,1,m,5,1),l=0,s=new cn(za(this.a));s.e!=s.i.gc();)r=p(fn(s),87),h[l++]=(d=r.c,me(d,88)?p(d,29):(Tt(),Vd));return h},b.Ej=function(r){var s,l,d,h,m,y,k;for(k=za(this.a).i,r.length<k&&(h=gI(lu(r).c,k),r=h),r.length>k&&Ni(r,k,null),d=0,l=new cn(za(this.a));l.e!=l.i.gc();)s=p(fn(l),87),m=(y=s.c,me(y,88)?p(y,29):(Tt(),Vd)),Ni(r,d++,m);return r},b.Fj=function(){var r,s,l,d,h;for(h=new j0,h.a+="[",r=za(this.a),s=0,d=za(this.a).i;s<d;)Mo(h,zA((l=p(be(r,s),87).c,me(l,88)?p(l,29):(Tt(),Vd)))),++s<d&&(h.a+=yl);return h.a+="]",h.a},b.Hj=function(r){},b.Jj=function(){return 10},b.il=function(){return!0},b.Kj=function(){return!1},b.jl=function(){return!1},b.kl=function(){return!1},b.ll=function(){return!0},b.$k=function(){return!1},b.ml=function(){return!0},b.dk=function(r){return me(r,88)},b.Oj=function(){return t2n(this.a)},b.Qi=function(){return!0},b.Wi=function(){return!0},O(Gt,"EClassImpl/8",1140),j(1141,2024,pT,hrt),b.dd=function(r){return mI(this.a,r)},b.gc=function(){return za(this.a.a).i},O(Gt,"EClassImpl/8/1",1141),j(1142,492,xp,yYe),b.$i=function(r){return Ee(sh,Pt,143,r,0,1)},b.Wi=function(){return!1},O(Gt,"EClassImpl/9",1142),j(1129,47,iEe,nit),O(Gt,"EClassImpl/MyHashSet",1129),j(563,360,{109:1,94:1,93:1,143:1,159:1,831:1,158:1,197:1,57:1,114:1,52:1,100:1,360:1,161:1,117:1,118:1,681:1},d$),b.Ih=function(r,s,l){var d;switch(r){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D!=null?this.D:this.B;case 3:return wy(this);case 4:return this.gk();case 5:return this.F;case 6:return s?Tu(this):g_(this);case 7:return!this.A&&(this.A=new oc(Il,this,7)),this.A;case 8:return zt(),!!(this.Bb&256)}return Zu(this,r-mn(this.fi()),Dt((d=p(Yt(this,16),29),d||this.fi()),r),s,l)},b.Th=function(r){var s;switch(r){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!wy(this);case 4:return this.gk()!=null;case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!g_(this);case 7:return!!this.A&&this.A.i!=0;case 8:return(this.Bb&256)==0}return Qu(this,r-mn(this.fi()),Dt((s=p(Yt(this,16),29),s||this.fi()),r))},b.$h=function(r,s){var l;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab),!this.Ab&&(this.Ab=new De(lr,this,0,3)),Ti(this.Ab,p(s,18));return;case 1:gB(this,Un(s));return;case 2:vQ(this,Un(s));return;case 5:lT(this,Un(s));return;case 7:!this.A&&(this.A=new oc(Il,this,7)),Tn(this.A),!this.A&&(this.A=new oc(Il,this,7)),Ti(this.A,p(s,18));return;case 8:wz(this,Je(Ke(s)));return}sd(this,r-mn(this.fi()),Dt((l=p(Yt(this,16),29),l||this.fi()),r),s)},b.fi=function(){return Tt(),mLt},b.hi=function(r){var s;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab);return;case 1:me(this.Cb,184)&&(p(this.Cb,184).tb=null),bl(this,null);return;case 2:O_(this,null),C_(this,this.D);return;case 5:lT(this,null);return;case 7:!this.A&&(this.A=new oc(Il,this,7)),Tn(this.A);return;case 8:wz(this,!0);return}id(this,r-mn(this.fi()),Dt((s=p(Yt(this,16),29),s||this.fi()),r))},b.mi=function(){G0((dc(),Hs),this).ve(),this.Bb|=1},b.mk=function(){var r,s,l;if(!this.c&&(r=Uvt(Tu(this)),!r.dc()))for(l=r.Jc();l.Ob();)s=Un(l.Pb()),YM(this,s)&&WSn(this);return this.b},b.gk=function(){var r;if(!this.e){r=null;try{r=wy(this)}catch(s){if(s=Oi(s),!me(s,101))throw Z(s)}this.d=null,r&&r.i&1&&(r==Zl?this.d=(zt(),v1):r==Wn?this.d=Oe(0):r==Sv?this.d=new K9(0):r==As?this.d=0:r==ex?this.d=y2(0):r==R3?this.d=P_(0):r==gc?this.d=fI(0):this.d=xI(0)),this.e=!0}return this.d},b.lk=function(){return(this.Bb&256)!=0},b.pl=function(r){r&&(this.D="org.eclipse.emf.common.util.AbstractEnumerator")},b.el=function(r){m1t(this,r),this.pl(r)},b.fl=function(r){this.C=r,this.e=!1},b.Ib=function(){var r;return this.Db&64?_z(this):(r=new Nd(_z(this)),r.a+=" (serializable: ",D0(r,(this.Bb&256)!=0),r.a+=")",r.a)},b.c=!1,b.d=null,b.e=!1,O(Gt,"EDataTypeImpl",563),j(459,563,{109:1,94:1,93:1,143:1,159:1,831:1,675:1,158:1,197:1,57:1,114:1,52:1,100:1,360:1,459:1,161:1,117:1,118:1,681:1},rit),b.Ih=function(r,s,l){var d;switch(r){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),this.Ab;case 1:return this.zb;case 2:return this.D!=null?this.D:this.B;case 3:return wy(this);case 4:return Uve(this);case 5:return this.F;case 6:return s?Tu(this):g_(this);case 7:return!this.A&&(this.A=new oc(Il,this,7)),this.A;case 8:return zt(),!!(this.Bb&256);case 9:return!this.a&&(this.a=new De(o0,this,9,5)),this.a}return Zu(this,r-mn((Tt(),F1)),Dt((d=p(Yt(this,16),29),d||F1),r),s,l)},b.Ph=function(r,s,l){var d,h,m;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),wl(this.Ab,r,l);case 6:return this.Cb&&(l=(h=this.Db>>16,h>=0?Vte(this,l):this.Cb.Qh(this,-1-h,null,l))),Du(this,r,6,l);case 9:return!this.a&&(this.a=new De(o0,this,9,5)),wl(this.a,r,l)}return m=p(Dt((d=p(Yt(this,16),29),d||(Tt(),F1)),s),69),m.uk().xk(this,Tl(this),s-mn((Tt(),F1)),r,l)},b.Rh=function(r,s,l){var d,h;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),co(this.Ab,r,l);case 6:return Du(this,null,6,l);case 7:return!this.A&&(this.A=new oc(Il,this,7)),co(this.A,r,l);case 9:return!this.a&&(this.a=new De(o0,this,9,5)),co(this.a,r,l)}return h=p(Dt((d=p(Yt(this,16),29),d||(Tt(),F1)),s),69),h.uk().yk(this,Tl(this),s-mn((Tt(),F1)),r,l)},b.Th=function(r){var s;switch(r){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.D!=null&&this.D==this.F;case 3:return!!wy(this);case 4:return!!Uve(this);case 5:return this.F!=null&&this.F!=this.D&&this.F!=this.B;case 6:return!!g_(this);case 7:return!!this.A&&this.A.i!=0;case 8:return(this.Bb&256)==0;case 9:return!!this.a&&this.a.i!=0}return Qu(this,r-mn((Tt(),F1)),Dt((s=p(Yt(this,16),29),s||F1),r))},b.$h=function(r,s){var l;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab),!this.Ab&&(this.Ab=new De(lr,this,0,3)),Ti(this.Ab,p(s,18));return;case 1:gB(this,Un(s));return;case 2:vQ(this,Un(s));return;case 5:lT(this,Un(s));return;case 7:!this.A&&(this.A=new oc(Il,this,7)),Tn(this.A),!this.A&&(this.A=new oc(Il,this,7)),Ti(this.A,p(s,18));return;case 8:wz(this,Je(Ke(s)));return;case 9:!this.a&&(this.a=new De(o0,this,9,5)),Tn(this.a),!this.a&&(this.a=new De(o0,this,9,5)),Ti(this.a,p(s,18));return}sd(this,r-mn((Tt(),F1)),Dt((l=p(Yt(this,16),29),l||F1),r),s)},b.fi=function(){return Tt(),F1},b.hi=function(r){var s;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab);return;case 1:me(this.Cb,184)&&(p(this.Cb,184).tb=null),bl(this,null);return;case 2:O_(this,null),C_(this,this.D);return;case 5:lT(this,null);return;case 7:!this.A&&(this.A=new oc(Il,this,7)),Tn(this.A);return;case 8:wz(this,!0);return;case 9:!this.a&&(this.a=new De(o0,this,9,5)),Tn(this.a);return}id(this,r-mn((Tt(),F1)),Dt((s=p(Yt(this,16),29),s||F1),r))},b.mi=function(){var r,s;if(this.a)for(r=0,s=this.a.i;r<s;++r)T8(be(this.a,r));G0((dc(),Hs),this).ve(),this.Bb|=1},b.gk=function(){return Uve(this)},b.dk=function(r){return r!=null},b.pl=function(r){},O(Gt,"EEnumImpl",459),j(568,439,{109:1,94:1,93:1,2001:1,684:1,158:1,197:1,57:1,114:1,52:1,100:1,568:1,161:1,117:1,118:1},xrt),b.ve=function(){return this.zb},b.xh=function(r){return oxt(this,r)},b.Ih=function(r,s,l){var d,h;switch(r){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),this.Ab;case 1:return this.zb;case 2:return Oe(this.d);case 3:return this.b?this.b:this.a;case 4:return h=this.c,h??this.zb;case 5:return this.Db>>16==5?p(this.Cb,675):null}return Zu(this,r-mn((Tt(),hm)),Dt((d=p(Yt(this,16),29),d||hm),r),s,l)},b.Ph=function(r,s,l){var d,h,m;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),wl(this.Ab,r,l);case 5:return this.Cb&&(l=(h=this.Db>>16,h>=0?oxt(this,l):this.Cb.Qh(this,-1-h,null,l))),Du(this,r,5,l)}return m=p(Dt((d=p(Yt(this,16),29),d||(Tt(),hm)),s),69),m.uk().xk(this,Tl(this),s-mn((Tt(),hm)),r,l)},b.Rh=function(r,s,l){var d,h;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),co(this.Ab,r,l);case 5:return Du(this,null,5,l)}return h=p(Dt((d=p(Yt(this,16),29),d||(Tt(),hm)),s),69),h.uk().yk(this,Tl(this),s-mn((Tt(),hm)),r,l)},b.Th=function(r){var s;switch(r){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return this.d!=0;case 3:return!!this.b;case 4:return this.c!=null;case 5:return!!(this.Db>>16==5&&p(this.Cb,675))}return Qu(this,r-mn((Tt(),hm)),Dt((s=p(Yt(this,16),29),s||hm),r))},b.$h=function(r,s){var l;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab),!this.Ab&&(this.Ab=new De(lr,this,0,3)),Ti(this.Ab,p(s,18));return;case 1:bl(this,Un(s));return;case 2:Tee(this,p(s,15).a);return;case 3:cvt(this,p(s,2001));return;case 4:Mee(this,Un(s));return}sd(this,r-mn((Tt(),hm)),Dt((l=p(Yt(this,16),29),l||hm),r),s)},b.fi=function(){return Tt(),hm},b.hi=function(r){var s;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab);return;case 1:bl(this,null);return;case 2:Tee(this,0);return;case 3:cvt(this,null);return;case 4:Mee(this,null);return}id(this,r-mn((Tt(),hm)),Dt((s=p(Yt(this,16),29),s||hm),r))},b.Ib=function(){var r;return r=this.c,r??this.zb},b.b=null,b.c=null,b.d=0,O(Gt,"EEnumLiteralImpl",568);var x7n=pi(Gt,"EFactoryImpl/InternalEDateTimeFormat");j(485,1,{2076:1},Y9),O(Gt,"EFactoryImpl/1ClientInternalEDateTimeFormat",485),j(248,118,{109:1,94:1,93:1,87:1,57:1,114:1,52:1,100:1,248:1,117:1,118:1},Uw),b.zh=function(r,s,l){var d;return l=Du(this,r,s,l),this.e&&me(r,179)&&(d=aH(this,this.e),d!=this.c&&(l=cT(this,d,l))),l},b.Ih=function(r,s,l){var d;switch(r){case 0:return this.f;case 1:return!this.d&&(this.d=new Gi(Ao,this,1)),this.d;case 2:return s?yH(this):this.c;case 3:return this.b;case 4:return this.e;case 5:return s?Fte(this):this.a}return Zu(this,r-mn((Tt(),Xy)),Dt((d=p(Yt(this,16),29),d||Xy),r),s,l)},b.Rh=function(r,s,l){var d,h;switch(s){case 0:return qbt(this,null,l);case 1:return!this.d&&(this.d=new Gi(Ao,this,1)),co(this.d,r,l);case 3:return Wbt(this,null,l)}return h=p(Dt((d=p(Yt(this,16),29),d||(Tt(),Xy)),s),69),h.uk().yk(this,Tl(this),s-mn((Tt(),Xy)),r,l)},b.Th=function(r){var s;switch(r){case 0:return!!this.f;case 1:return!!this.d&&this.d.i!=0;case 2:return!!this.c;case 3:return!!this.b;case 4:return!!this.e;case 5:return!!this.a}return Qu(this,r-mn((Tt(),Xy)),Dt((s=p(Yt(this,16),29),s||Xy),r))},b.$h=function(r,s){var l;switch(r){case 0:Ext(this,p(s,87));return;case 1:!this.d&&(this.d=new Gi(Ao,this,1)),Tn(this.d),!this.d&&(this.d=new Gi(Ao,this,1)),Ti(this.d,p(s,18));return;case 3:y3e(this,p(s,87));return;case 4:$3e(this,p(s,834));return;case 5:k_(this,p(s,143));return}sd(this,r-mn((Tt(),Xy)),Dt((l=p(Yt(this,16),29),l||Xy),r),s)},b.fi=function(){return Tt(),Xy},b.hi=function(r){var s;switch(r){case 0:Ext(this,null);return;case 1:!this.d&&(this.d=new Gi(Ao,this,1)),Tn(this.d);return;case 3:y3e(this,null);return;case 4:$3e(this,null);return;case 5:k_(this,null);return}id(this,r-mn((Tt(),Xy)),Dt((s=p(Yt(this,16),29),s||Xy),r))},b.Ib=function(){var r;return r=new ku(wf(this)),r.a+=" (expression: ",Gne(this,r),r.a+=")",r.a};var u8e;O(Gt,"EGenericTypeImpl",248),j(2029,2024,EU),b.Ei=function(r,s){Sct(this,r,s)},b.Uk=function(r,s){return Sct(this,this.gc(),r),s},b.Yi=function(r){return Ha(this.nj(),r)},b.Gi=function(){return this.Hi()},b.nj=function(){return new brt(this)},b.Hi=function(){return this.Ii(0)},b.Ii=function(r){return this.nj().dd(r)},b.Vk=function(r,s){return b2(this,r,!0),s},b.Ri=function(r,s){var l,d;return d=Yte(this,s),l=this.dd(r),l.Rb(d),d},b.Si=function(r,s){var l;b2(this,s,!0),l=this.dd(r),l.Rb(s)},O(si,"AbstractSequentialInternalEList",2029),j(482,2029,EU,_8),b.Yi=function(r){return Ha(this.nj(),r)},b.Gi=function(){return this.b==null?(L0(),L0(),sP):this.ql()},b.nj=function(){return new Uat(this.a,this.b)},b.Hi=function(){return this.b==null?(L0(),L0(),sP):this.ql()},b.Ii=function(r){var s,l;if(this.b==null){if(r<0||r>1)throw Z(new fl(TN+r+", size=0"));return L0(),L0(),sP}for(l=this.ql(),s=0;s<r;++s)az(l);return l},b.dc=function(){var r,s,l,d,h,m;if(this.b!=null){for(l=0;l<this.b.length;++l)if(r=this.b[l],!this.tl()||this.a.Uh(r)){if(m=this.a.Kh(r,!1),wo(),p(r,69).vk()){for(s=p(m,163),d=0,h=s.gc();d<h;++d)if(Jdt(s.Rl(d))&&s.Sl(d)!=null)return!1}else if(r.Hk()){if(!p(m,18).dc())return!1}else if(m!=null)return!1}}return!0},b.Jc=function(){return sve(this)},b.dd=function(r){var s,l;if(this.b==null){if(r!=0)throw Z(new fl(TN+r+", size=0"));return L0(),L0(),sP}for(l=this.sl()?this.rl():this.ql(),s=0;s<r;++s)az(l);return l},b.Ri=function(r,s){throw Z(new zn)},b.Si=function(r,s){throw Z(new zn)},b.ql=function(){return new yF(this.a,this.b)},b.rl=function(){return new Nwe(this.a,this.b)},b.sl=function(){return!0},b.gc=function(){var r,s,l,d,h,m,y;if(h=0,this.b!=null){for(l=0;l<this.b.length;++l)if(r=this.b[l],!this.tl()||this.a.Uh(r))if(y=this.a.Kh(r,!1),wo(),p(r,69).vk())for(s=p(y,163),d=0,m=s.gc();d<m;++d)Jdt(s.Rl(d))&&s.Sl(d)!=null&&++h;else r.Hk()?h+=p(y,18).gc():y!=null&&++h}return h},b.tl=function(){return!0};var Rce;O(si,"EContentsEList",482),j(1146,482,EU,lct),b.ql=function(){return new act(this.a,this.b)},b.rl=function(){return new oct(this.a,this.b)},b.tl=function(){return!1},O(Gt,"ENamedElementImpl/1",1146),j(287,1,_U,yF),b.Nb=function(r){Bs(this,r)},b.Rb=function(r){throw Z(new zn)},b.ul=function(r){if(this.g!=0||this.e)throw Z(new Lo("Iterator already in use or already filtered"));this.e=r},b.Ob=function(){var r,s,l,d,h,m;switch(this.g){case 3:case 2:return!0;case 1:return!1;case-3:this.p?this.p.Pb():++this.n;default:if(!this.k||(this.p?!k2t(this,this.p):!dvt(this))){for(;this.d<this.c.length;)if(s=this.c[this.d++],(!this.e||s.nk()!=C4||s.Jj()!=0)&&(!this.tl()||this.b.Uh(s))){if(m=this.b.Kh(s,this.sl()),this.f=(wo(),p(s,69).vk()),this.f||s.Hk()){if(this.sl()?(d=p(m,16),this.k=d):(d=p(m,72),this.k=this.j=d),me(this.k,59)?(this.p=null,this.o=this.k.gc(),this.n=0):this.p=this.j?this.j.Hi():this.k.cd(),this.p?k2t(this,this.p):dvt(this))return h=this.p?this.p.Pb():this.j?this.j.Yi(this.n++):this.k.Xb(this.n++),this.f?(r=p(h,75),r.Jk(),l=r.kd(),this.i=l):(l=h,this.i=l),this.g=3,!0}else if(m!=null)return this.k=null,this.p=null,l=m,this.i=l,this.g=2,!0}return this.k=null,this.p=null,this.f=!1,this.g=1,!1}else return h=this.p?this.p.Pb():this.j?this.j.Yi(this.n++):this.k.Xb(this.n++),this.f?(r=p(h,75),r.Jk(),l=r.kd(),this.i=l):(l=h,this.i=l),this.g=3,!0}},b.Sb=function(){var r,s,l,d,h,m;switch(this.g){case-3:case-2:return!0;case-1:return!1;case 3:this.p?this.p.Ub():--this.n;default:if(!this.k||(this.p?!C2t(this,this.p):!I2t(this))){for(;this.d>0;)if(s=this.c[--this.d],(!this.e||s.nk()!=C4||s.Jj()!=0)&&(!this.tl()||this.b.Uh(s))){if(m=this.b.Kh(s,this.sl()),this.f=(wo(),p(s,69).vk()),this.f||s.Hk()){if(this.sl()?(d=p(m,16),this.k=d):(d=p(m,72),this.k=this.j=d),me(this.k,59)?(this.o=this.k.gc(),this.n=this.o):this.p=this.j?this.j.Ii(this.k.gc()):this.k.dd(this.k.gc()),this.p?C2t(this,this.p):I2t(this))return h=this.p?this.p.Ub():this.j?this.j.Yi(--this.n):this.k.Xb(--this.n),this.f?(r=p(h,75),r.Jk(),l=r.kd(),this.i=l):(l=h,this.i=l),this.g=-3,!0}else if(m!=null)return this.k=null,this.p=null,l=m,this.i=l,this.g=-2,!0}return this.k=null,this.p=null,this.g=-1,!1}else return h=this.p?this.p.Ub():this.j?this.j.Yi(--this.n):this.k.Xb(--this.n),this.f?(r=p(h,75),r.Jk(),l=r.kd(),this.i=l):(l=h,this.i=l),this.g=-3,!0}},b.Pb=function(){return az(this)},b.Tb=function(){return this.a},b.Ub=function(){var r;if(this.g<-1||this.Sb())return--this.a,this.g=0,r=this.i,this.Sb(),r;throw Z(new Zo)},b.Vb=function(){return this.a-1},b.Qb=function(){throw Z(new zn)},b.sl=function(){return!1},b.Wb=function(r){throw Z(new zn)},b.tl=function(){return!0},b.a=0,b.d=0,b.f=!1,b.g=0,b.n=0,b.o=0;var sP;O(si,"EContentsEList/FeatureIteratorImpl",287),j(700,287,_U,Nwe),b.sl=function(){return!0},O(si,"EContentsEList/ResolvingFeatureIteratorImpl",700),j(1147,700,_U,oct),b.tl=function(){return!1},O(Gt,"ENamedElementImpl/1/1",1147),j(1148,287,_U,act),b.tl=function(){return!1},O(Gt,"ENamedElementImpl/1/2",1148),j(39,151,HO,l2,ZZ,ms,hee,zg,ff,H2e,Ght,U2e,Vht,r2e,Kht,G2e,Jht,i2e,Yht,W2e,Xht,YA,oI,IZ,q2e,Qht,s2e,Zht),b.Ij=function(){return S2e(this)},b.Pj=function(){var r;return r=S2e(this),r?r.gk():null},b.fj=function(r){return this.b==-1&&this.a&&(this.b=this.c.Eh(this.a.Jj(),this.a.nk())),this.c.vh(this.b,r)},b.hj=function(){return this.c},b.Qj=function(){var r;return r=S2e(this),r?r.rk():!1},b.b=-1,O(Gt,"ENotificationImpl",39),j(403,293,{109:1,94:1,93:1,158:1,197:1,57:1,62:1,114:1,470:1,52:1,100:1,161:1,403:1,293:1,117:1,118:1},gX),b.xh=function(r){return lxt(this,r)},b.Ih=function(r,s,l){var d,h,m;switch(r){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),this.Ab;case 1:return this.zb;case 2:return zt(),!!(this.Bb&256);case 3:return zt(),!!(this.Bb&512);case 4:return Oe(this.s);case 5:return Oe(this.t);case 6:return zt(),m=this.t,m>1||m==-1;case 7:return zt(),h=this.s,h>=1;case 8:return s?Ld(this):this.r;case 9:return this.q;case 10:return this.Db>>16==10?p(this.Cb,29):null;case 11:return!this.d&&(this.d=new oc(Il,this,11)),this.d;case 12:return!this.c&&(this.c=new De(Yy,this,12,10)),this.c;case 13:return!this.a&&(this.a=new N8(this,this)),this.a;case 14:return Bc(this)}return Zu(this,r-mn((Tt(),pm)),Dt((d=p(Yt(this,16),29),d||pm),r),s,l)},b.Ph=function(r,s,l){var d,h,m;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),wl(this.Ab,r,l);case 10:return this.Cb&&(l=(h=this.Db>>16,h>=0?lxt(this,l):this.Cb.Qh(this,-1-h,null,l))),Du(this,r,10,l);case 12:return!this.c&&(this.c=new De(Yy,this,12,10)),wl(this.c,r,l)}return m=p(Dt((d=p(Yt(this,16),29),d||(Tt(),pm)),s),69),m.uk().xk(this,Tl(this),s-mn((Tt(),pm)),r,l)},b.Rh=function(r,s,l){var d,h;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),co(this.Ab,r,l);case 9:return yZ(this,l);case 10:return Du(this,null,10,l);case 11:return!this.d&&(this.d=new oc(Il,this,11)),co(this.d,r,l);case 12:return!this.c&&(this.c=new De(Yy,this,12,10)),co(this.c,r,l);case 14:return co(Bc(this),r,l)}return h=p(Dt((d=p(Yt(this,16),29),d||(Tt(),pm)),s),69),h.uk().yk(this,Tl(this),s-mn((Tt(),pm)),r,l)},b.Th=function(r){var s,l,d;switch(r){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return d=this.t,d>1||d==-1;case 7:return l=this.s,l>=1;case 8:return!!this.r&&!this.q.e&&ty(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&ty(this.q).i==0);case 10:return!!(this.Db>>16==10&&p(this.Cb,29));case 11:return!!this.d&&this.d.i!=0;case 12:return!!this.c&&this.c.i!=0;case 13:return!!this.a&&Bc(this.a.a).i!=0&&!(this.b&&Rte(this.b));case 14:return!!this.b&&Rte(this.b)}return Qu(this,r-mn((Tt(),pm)),Dt((s=p(Yt(this,16),29),s||pm),r))},b.$h=function(r,s){var l,d;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab),!this.Ab&&(this.Ab=new De(lr,this,0,3)),Ti(this.Ab,p(s,18));return;case 1:bl(this,Un(s));return;case 2:V0(this,Je(Ke(s)));return;case 3:K0(this,Je(Ke(s)));return;case 4:U0(this,p(s,15).a);return;case 5:d2(this,p(s,15).a);return;case 8:Lb(this,p(s,143));return;case 9:d=Th(this,p(s,87),null),d&&d.mj();return;case 11:!this.d&&(this.d=new oc(Il,this,11)),Tn(this.d),!this.d&&(this.d=new oc(Il,this,11)),Ti(this.d,p(s,18));return;case 12:!this.c&&(this.c=new De(Yy,this,12,10)),Tn(this.c),!this.c&&(this.c=new De(Yy,this,12,10)),Ti(this.c,p(s,18));return;case 13:!this.a&&(this.a=new N8(this,this)),nN(this.a),!this.a&&(this.a=new N8(this,this)),Ti(this.a,p(s,18));return;case 14:Tn(Bc(this)),Ti(Bc(this),p(s,18));return}sd(this,r-mn((Tt(),pm)),Dt((l=p(Yt(this,16),29),l||pm),r),s)},b.fi=function(){return Tt(),pm},b.hi=function(r){var s,l;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab);return;case 1:bl(this,null);return;case 2:V0(this,!0);return;case 3:K0(this,!0);return;case 4:U0(this,0);return;case 5:d2(this,1);return;case 8:Lb(this,null);return;case 9:l=Th(this,null,null),l&&l.mj();return;case 11:!this.d&&(this.d=new oc(Il,this,11)),Tn(this.d);return;case 12:!this.c&&(this.c=new De(Yy,this,12,10)),Tn(this.c);return;case 13:this.a&&nN(this.a);return;case 14:this.b&&Tn(this.b);return}id(this,r-mn((Tt(),pm)),Dt((s=p(Yt(this,16),29),s||pm),r))},b.mi=function(){var r,s;if(this.c)for(r=0,s=this.c.i;r<s;++r)T8(be(this.c,r));Ld(this),this.Bb|=1},O(Gt,"EOperationImpl",403),j(499,744,bTe,N8),b.oj=function(r,s){r0n(this,r,p(s,143))},b.pj=function(r){Wpn(this,p(r,143))},b.vj=function(r){var s,l;return s=p(be(Bc(this.a),r),87),l=s.c,l||(Tt(),Wh)},b.Aj=function(r){var s,l;return s=p(T2(Bc(this.a),r),87),l=s.c,l||(Tt(),Wh)},b.Bj=function(r,s){return r5n(this,r,p(s,143))},b.Ji=function(){return!1},b.Gj=function(r,s,l,d,h){return null},b.qj=function(){return new prt(this)},b.rj=function(){Tn(Bc(this.a))},b.sj=function(r){return lwt(this,r)},b.tj=function(r){var s,l;for(l=r.Jc();l.Ob();)if(s=l.Pb(),!lwt(this,s))return!1;return!0},b.uj=function(r){var s,l,d;if(me(r,16)&&(d=p(r,16),d.gc()==Bc(this.a).i)){for(s=d.Jc(),l=new cn(this);s.Ob();)if(Se(s.Pb())!==Se(fn(l)))return!1;return!0}return!1},b.wj=function(){var r,s,l,d,h;for(l=1,s=new cn(Bc(this.a));s.e!=s.i.gc();)r=p(fn(s),87),d=(h=r.c,h||(Tt(),Wh)),l=31*l+(d?Jr(d):0);return l},b.xj=function(r){var s,l,d,h;for(d=0,l=new cn(Bc(this.a));l.e!=l.i.gc();){if(s=p(fn(l),87),Se(r)===Se((h=s.c,h||(Tt(),Wh))))return d;++d}return-1},b.yj=function(){return Bc(this.a).i==0},b.zj=function(){return null},b.Cj=function(){return Bc(this.a).i},b.Dj=function(){var r,s,l,d,h,m;for(m=Bc(this.a).i,h=Ee(cs,Pt,1,m,5,1),l=0,s=new cn(Bc(this.a));s.e!=s.i.gc();)r=p(fn(s),87),h[l++]=(d=r.c,d||(Tt(),Wh));return h},b.Ej=function(r){var s,l,d,h,m,y,k;for(k=Bc(this.a).i,r.length<k&&(h=gI(lu(r).c,k),r=h),r.length>k&&Ni(r,k,null),d=0,l=new cn(Bc(this.a));l.e!=l.i.gc();)s=p(fn(l),87),m=(y=s.c,y||(Tt(),Wh)),Ni(r,d++,m);return r},b.Fj=function(){var r,s,l,d,h;for(h=new j0,h.a+="[",r=Bc(this.a),s=0,d=Bc(this.a).i;s<d;)Mo(h,zA((l=p(be(r,s),87).c,l||(Tt(),Wh)))),++s<d&&(h.a+=yl);return h.a+="]",h.a},b.Hj=function(r){},b.Jj=function(){return 13},b.il=function(){return!0},b.Kj=function(){return!1},b.jl=function(){return!1},b.kl=function(){return!1},b.ll=function(){return!0},b.$k=function(){return!1},b.ml=function(){return!0},b.dk=function(r){return me(r,143)},b.Oj=function(){return n2n(this.a)},b.Qi=function(){return!0},b.Wi=function(){return!0},O(Gt,"EOperationImpl/1",499),j(1330,2024,pT,prt),b.dd=function(r){return mI(this.a,r)},b.gc=function(){return Bc(this.a.a).i},O(Gt,"EOperationImpl/1/1",1330),j(1331,543,Xo,ddt),b.Ri=function(r,s){var l,d;return l=p(AM(this,r,s),87),ru(this.e)&&F5(this,new oI(this.a,7,(Tt(),yLt),Oe(s),(d=l.c,d||Wh),r)),l},b.Sj=function(r,s){return TSn(this,p(r,87),s)},b.Tj=function(r,s){return ASn(this,p(r,87),s)},b.Uj=function(r,s,l){return p5n(this,p(r,87),p(s,87),l)},b.Gj=function(r,s,l,d,h){switch(r){case 3:return rM(this,r,s,l,d,this.i>1);case 5:return rM(this,r,s,l,d,this.i-p(l,16).gc()>0);default:return new zg(this.e,r,this.c,s,l,d,!0)}},b.Rj=function(){return!0},b.Oj=function(){return Rte(this)},b.Ek=function(){Tn(this)},O(Gt,"EOperationImpl/2",1331),j(493,1,{1999:1,493:1},kat),O(Gt,"EPackageImpl/1",493),j(14,81,Xo,De),b.gl=function(){return this.d},b.hl=function(){return this.b},b.kl=function(){return!0},b.b=0,O(si,"EObjectContainmentWithInverseEList",14),j(361,14,Xo,eS),b.ll=function(){return!0},b.Ui=function(r,s){return PS(this,r,p(s,57))},O(si,"EObjectContainmentWithInverseEList/Resolving",361),j(312,361,Xo,Zx),b.Li=function(){this.a.tb=null},O(Gt,"EPackageImpl/2",312),j(1243,1,{},zdn),O(Gt,"EPackageImpl/3",1243),j(721,44,Jk,I1e),b._b=function(r){return Cs(r)?OZ(this,r):!!Po(this.f,r)},O(Gt,"EPackageRegistryImpl",721),j(503,293,{109:1,94:1,93:1,158:1,197:1,57:1,2078:1,114:1,470:1,52:1,100:1,161:1,503:1,293:1,117:1,118:1},mX),b.xh=function(r){return cxt(this,r)},b.Ih=function(r,s,l){var d,h,m;switch(r){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),this.Ab;case 1:return this.zb;case 2:return zt(),!!(this.Bb&256);case 3:return zt(),!!(this.Bb&512);case 4:return Oe(this.s);case 5:return Oe(this.t);case 6:return zt(),m=this.t,m>1||m==-1;case 7:return zt(),h=this.s,h>=1;case 8:return s?Ld(this):this.r;case 9:return this.q;case 10:return this.Db>>16==10?p(this.Cb,62):null}return Zu(this,r-mn((Tt(),kv)),Dt((d=p(Yt(this,16),29),d||kv),r),s,l)},b.Ph=function(r,s,l){var d,h,m;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),wl(this.Ab,r,l);case 10:return this.Cb&&(l=(h=this.Db>>16,h>=0?cxt(this,l):this.Cb.Qh(this,-1-h,null,l))),Du(this,r,10,l)}return m=p(Dt((d=p(Yt(this,16),29),d||(Tt(),kv)),s),69),m.uk().xk(this,Tl(this),s-mn((Tt(),kv)),r,l)},b.Rh=function(r,s,l){var d,h;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),co(this.Ab,r,l);case 9:return yZ(this,l);case 10:return Du(this,null,10,l)}return h=p(Dt((d=p(Yt(this,16),29),d||(Tt(),kv)),s),69),h.uk().yk(this,Tl(this),s-mn((Tt(),kv)),r,l)},b.Th=function(r){var s,l,d;switch(r){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return d=this.t,d>1||d==-1;case 7:return l=this.s,l>=1;case 8:return!!this.r&&!this.q.e&&ty(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&ty(this.q).i==0);case 10:return!!(this.Db>>16==10&&p(this.Cb,62))}return Qu(this,r-mn((Tt(),kv)),Dt((s=p(Yt(this,16),29),s||kv),r))},b.fi=function(){return Tt(),kv},O(Gt,"EParameterImpl",503),j(103,451,{109:1,94:1,93:1,158:1,197:1,57:1,19:1,179:1,69:1,114:1,470:1,52:1,100:1,161:1,103:1,451:1,293:1,117:1,118:1,682:1},Owe),b.Ih=function(r,s,l){var d,h,m,y;switch(r){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),this.Ab;case 1:return this.zb;case 2:return zt(),!!(this.Bb&256);case 3:return zt(),!!(this.Bb&512);case 4:return Oe(this.s);case 5:return Oe(this.t);case 6:return zt(),y=this.t,y>1||y==-1;case 7:return zt(),h=this.s,h>=1;case 8:return s?Ld(this):this.r;case 9:return this.q;case 10:return zt(),!!(this.Bb&vf);case 11:return zt(),!!(this.Bb&h1);case 12:return zt(),!!(this.Bb&I2);case 13:return this.j;case 14:return tT(this);case 15:return zt(),!!(this.Bb&hc);case 16:return zt(),!!(this.Bb&hp);case 17:return i2(this);case 18:return zt(),!!(this.Bb&Aa);case 19:return zt(),m=yo(this),!!(m&&m.Bb&Aa);case 20:return zt(),!!(this.Bb&ho);case 21:return s?yo(this):this.b;case 22:return s?_ve(this):mgt(this);case 23:return!this.a&&(this.a=new wk(yv,this,23)),this.a}return Zu(this,r-mn((Tt(),I3)),Dt((d=p(Yt(this,16),29),d||I3),r),s,l)},b.Th=function(r){var s,l,d,h;switch(r){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return(this.Bb&256)==0;case 3:return(this.Bb&512)==0;case 4:return this.s!=0;case 5:return this.t!=1;case 6:return h=this.t,h>1||h==-1;case 7:return l=this.s,l>=1;case 8:return!!this.r&&!this.q.e&&ty(this.q).i==0;case 9:return!!this.q&&!(this.r&&!this.q.e&&ty(this.q).i==0);case 10:return(this.Bb&vf)==0;case 11:return(this.Bb&h1)!=0;case 12:return(this.Bb&I2)!=0;case 13:return this.j!=null;case 14:return tT(this)!=null;case 15:return(this.Bb&hc)!=0;case 16:return(this.Bb&hp)!=0;case 17:return!!i2(this);case 18:return(this.Bb&Aa)!=0;case 19:return d=yo(this),!!d&&(d.Bb&Aa)!=0;case 20:return(this.Bb&ho)==0;case 21:return!!this.b;case 22:return!!mgt(this);case 23:return!!this.a&&this.a.i!=0}return Qu(this,r-mn((Tt(),I3)),Dt((s=p(Yt(this,16),29),s||I3),r))},b.$h=function(r,s){var l,d;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab),!this.Ab&&(this.Ab=new De(lr,this,0,3)),Ti(this.Ab,p(s,18));return;case 1:HZ(this,Un(s));return;case 2:V0(this,Je(Ke(s)));return;case 3:K0(this,Je(Ke(s)));return;case 4:U0(this,p(s,15).a);return;case 5:d2(this,p(s,15).a);return;case 8:Lb(this,p(s,143));return;case 9:d=Th(this,p(s,87),null),d&&d.mj();return;case 10:$_(this,Je(Ke(s)));return;case 11:z_(this,Je(Ke(s)));return;case 12:B_(this,Je(Ke(s)));return;case 13:Gbe(this,Un(s));return;case 15:F_(this,Je(Ke(s)));return;case 16:H_(this,Je(Ke(s)));return;case 18:txn(this,Je(Ke(s)));return;case 20:cke(this,Je(Ke(s)));return;case 21:ave(this,p(s,19));return;case 23:!this.a&&(this.a=new wk(yv,this,23)),Tn(this.a),!this.a&&(this.a=new wk(yv,this,23)),Ti(this.a,p(s,18));return}sd(this,r-mn((Tt(),I3)),Dt((l=p(Yt(this,16),29),l||I3),r),s)},b.fi=function(){return Tt(),I3},b.hi=function(r){var s,l;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab);return;case 1:me(this.Cb,88)&&S2($c(p(this.Cb,88)),4),bl(this,null);return;case 2:V0(this,!0);return;case 3:K0(this,!0);return;case 4:U0(this,0);return;case 5:d2(this,1);return;case 8:Lb(this,null);return;case 9:l=Th(this,null,null),l&&l.mj();return;case 10:$_(this,!0);return;case 11:z_(this,!1);return;case 12:B_(this,!1);return;case 13:this.i=null,ez(this,null);return;case 15:F_(this,!1);return;case 16:H_(this,!1);return;case 18:uke(this,!1),me(this.Cb,88)&&S2($c(p(this.Cb,88)),2);return;case 20:cke(this,!0);return;case 21:ave(this,null);return;case 23:!this.a&&(this.a=new wk(yv,this,23)),Tn(this.a);return}id(this,r-mn((Tt(),I3)),Dt((s=p(Yt(this,16),29),s||I3),r))},b.mi=function(){_ve(this),f_($o((dc(),Hs),this)),Ld(this),this.Bb|=1},b.sk=function(){return yo(this)},b.Zk=function(){var r;return r=yo(this),!!r&&(r.Bb&Aa)!=0},b.$k=function(){return(this.Bb&Aa)!=0},b._k=function(){return(this.Bb&ho)!=0},b.Wk=function(r,s){return this.c=null,Zve(this,r,s)},b.Ib=function(){var r;return this.Db&64?bH(this):(r=new Nd(bH(this)),r.a+=" (containment: ",D0(r,(this.Bb&Aa)!=0),r.a+=", resolveProxies: ",D0(r,(this.Bb&ho)!=0),r.a+=")",r.a)},O(Gt,"EReferenceImpl",103),j(549,118,{109:1,45:1,94:1,93:1,136:1,57:1,114:1,52:1,100:1,549:1,117:1,118:1},xYe),b.Fb=function(r){return this===r},b.jd=function(){return this.b},b.kd=function(){return this.c},b.Hb=function(){return Yw(this)},b.Ai=function(r){bbn(this,Un(r))},b.ld=function(r){return obn(this,Un(r))},b.Ih=function(r,s,l){var d;switch(r){case 0:return this.b;case 1:return this.c}return Zu(this,r-mn((Tt(),mo)),Dt((d=p(Yt(this,16),29),d||mo),r),s,l)},b.Th=function(r){var s;switch(r){case 0:return this.b!=null;case 1:return this.c!=null}return Qu(this,r-mn((Tt(),mo)),Dt((s=p(Yt(this,16),29),s||mo),r))},b.$h=function(r,s){var l;switch(r){case 0:wbn(this,Un(s));return;case 1:tve(this,Un(s));return}sd(this,r-mn((Tt(),mo)),Dt((l=p(Yt(this,16),29),l||mo),r),s)},b.fi=function(){return Tt(),mo},b.hi=function(r){var s;switch(r){case 0:ive(this,null);return;case 1:tve(this,null);return}id(this,r-mn((Tt(),mo)),Dt((s=p(Yt(this,16),29),s||mo),r))},b.yi=function(){var r;return this.a==-1&&(r=this.b,this.a=r==null?0:W0(r)),this.a},b.zi=function(r){this.a=r},b.Ib=function(){var r;return this.Db&64?wf(this):(r=new Nd(wf(this)),r.a+=" (key: ",Mo(r,this.b),r.a+=", value: ",Mo(r,this.c),r.a+=")",r.a)},b.a=-1,b.b=null,b.c=null;var ka=O(Gt,"EStringToStringMapEntryImpl",549),ELt=pi(si,"FeatureMap/Entry/Internal");j(562,1,TU),b.vl=function(r){return this.wl(p(r,52))},b.wl=function(r){return this.vl(r)},b.Fb=function(r){var s,l;return this===r?!0:me(r,75)?(s=p(r,75),s.Jk()==this.c?(l=this.kd(),l==null?s.kd()==null:Tr(l,s.kd())):!1):!1},b.Jk=function(){return this.c},b.Hb=function(){var r;return r=this.kd(),Jr(this.c)^(r==null?0:Jr(r))},b.Ib=function(){var r,s;return r=this.c,s=Tu(r.ok()).vi(),r.ve(),(s!=null&&s.length!=0?s+":"+r.ve():r.ve())+"="+this.kd()},O(Gt,"EStructuralFeatureImpl/BasicFeatureMapEntry",562),j(777,562,TU,Bwe),b.wl=function(r){return new Bwe(this.c,r)},b.kd=function(){return this.a},b.xl=function(r,s,l){return U3n(this,r,this.a,s,l)},b.yl=function(r,s,l){return W3n(this,r,this.a,s,l)},O(Gt,"EStructuralFeatureImpl/ContainmentUpdatingFeatureMapEntry",777),j(1304,1,{},Cat),b.wk=function(r,s,l,d,h){var m;return m=p(w_(r,this.b),219),m.Wl(this.a).Dk(d)},b.xk=function(r,s,l,d,h){var m;return m=p(w_(r,this.b),219),m.Nl(this.a,d,h)},b.yk=function(r,s,l,d,h){var m;return m=p(w_(r,this.b),219),m.Ol(this.a,d,h)},b.zk=function(r,s,l){var d;return d=p(w_(r,this.b),219),d.Wl(this.a).Oj()},b.Ak=function(r,s,l,d){var h;h=p(w_(r,this.b),219),h.Wl(this.a).Wb(d)},b.Bk=function(r,s,l){return p(w_(r,this.b),219).Wl(this.a)},b.Ck=function(r,s,l){var d;d=p(w_(r,this.b),219),d.Wl(this.a).Ek()},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateFeatureMapDelegator",1304),j(89,1,{},R0,kb,F0,Ab),b.wk=function(r,s,l,d,h){var m;if(m=s.ii(l),m==null&&s.ji(l,m=MH(this,r)),!h)switch(this.e){case 50:case 41:return p(m,586)._j();case 40:return p(m,219).Tl()}return m},b.xk=function(r,s,l,d,h){var m,y;return y=s.ii(l),y==null&&s.ji(l,y=MH(this,r)),m=p(y,72).Uk(d,h),m},b.yk=function(r,s,l,d,h){var m;return m=s.ii(l),m!=null&&(h=p(m,72).Vk(d,h)),h},b.zk=function(r,s,l){var d;return d=s.ii(l),d!=null&&p(d,77).Oj()},b.Ak=function(r,s,l,d){var h;h=p(s.ii(l),77),!h&&s.ji(l,h=MH(this,r)),h.Wb(d)},b.Bk=function(r,s,l){var d,h;return h=s.ii(l),h==null&&s.ji(l,h=MH(this,r)),me(h,77)?p(h,77):(d=p(s.ii(l),16),new grt(d))},b.Ck=function(r,s,l){var d;d=p(s.ii(l),77),!d&&s.ji(l,d=MH(this,r)),d.Ek()},b.b=0,b.e=0,O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateMany",89),j(498,1,{}),b.xk=function(r,s,l,d,h){throw Z(new zn)},b.yk=function(r,s,l,d,h){throw Z(new zn)},b.Bk=function(r,s,l){return new xft(this,r,s,l)};var lg;O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingle",498),j(1321,1,Nse,xft),b.Dk=function(r){return this.a.wk(this.c,this.d,this.b,r,!0)},b.Oj=function(){return this.a.zk(this.c,this.d,this.b)},b.Wb=function(r){this.a.Ak(this.c,this.d,this.b,r)},b.Ek=function(){this.a.Ck(this.c,this.d,this.b)},b.b=0,O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingle/1",1321),j(770,498,{},Txe),b.wk=function(r,s,l,d,h){return Ine(r,r.Mh(),r.Ch())==this.b?this._k()&&d?xne(r):r.Mh():null},b.xk=function(r,s,l,d,h){var m,y;return r.Mh()&&(h=(m=r.Ch(),m>=0?r.xh(h):r.Mh().Qh(r,-1-m,null,h))),y=hi(r.Ah(),this.e),r.zh(d,y,h)},b.yk=function(r,s,l,d,h){var m;return m=hi(r.Ah(),this.e),r.zh(null,m,h)},b.zk=function(r,s,l){var d;return d=hi(r.Ah(),this.e),!!r.Mh()&&r.Ch()==d},b.Ak=function(r,s,l,d){var h,m,y,k,_;if(d!=null&&!Rne(this.a,d))throw Z(new B5(AU+(me(d,57)?w3e(p(d,57).Ah()):$2e(lu(d)))+MU+this.a+"'"));if(h=r.Mh(),y=hi(r.Ah(),this.e),Se(d)!==Se(h)||r.Ch()!=y&&d!=null){if(V_(r,p(d,57)))throw Z(new Kt(EN+r.Ib()));_=null,h&&(_=(m=r.Ch(),m>=0?r.xh(_):r.Mh().Qh(r,-1-m,null,_))),k=p(d,52),k&&(_=k.Oh(r,hi(k.Ah(),this.b),null,_)),_=r.zh(k,y,_),_&&_.mj()}else r.sh()&&r.th()&&Er(r,new ms(r,1,y,d,d))},b.Ck=function(r,s,l){var d,h,m,y;d=r.Mh(),d?(y=(h=r.Ch(),h>=0?r.xh(null):r.Mh().Qh(r,-1-h,null,null)),m=hi(r.Ah(),this.e),y=r.zh(null,m,y),y&&y.mj()):r.sh()&&r.th()&&Er(r,new YA(r,1,this.e,null,null))},b._k=function(){return!1},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleContainer",770),j(1305,770,{},fut),b._k=function(){return!0},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleContainerResolving",1305),j(560,498,{}),b.wk=function(r,s,l,d,h){var m;return m=s.ii(l),m==null?this.b:Se(m)===Se(lg)?null:m},b.zk=function(r,s,l){var d;return d=s.ii(l),d!=null&&(Se(d)===Se(lg)||!Tr(d,this.b))},b.Ak=function(r,s,l,d){var h,m;r.sh()&&r.th()?(h=(m=s.ii(l),m==null?this.b:Se(m)===Se(lg)?null:m),d==null?this.c!=null?(s.ji(l,null),d=this.b):this.b!=null?s.ji(l,lg):s.ji(l,null):(this.zl(d),s.ji(l,d)),Er(r,this.d.Al(r,1,this.e,h,d))):d==null?this.c!=null?s.ji(l,null):this.b!=null?s.ji(l,lg):s.ji(l,null):(this.zl(d),s.ji(l,d))},b.Ck=function(r,s,l){var d,h;r.sh()&&r.th()?(d=(h=s.ii(l),h==null?this.b:Se(h)===Se(lg)?null:h),s.ki(l),Er(r,this.d.Al(r,1,this.e,d,this.b))):s.ki(l)},b.zl=function(r){throw Z(new Ert)},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleData",560),j(i3,1,{},vYe),b.Al=function(r,s,l,d,h){return new YA(r,s,l,d,h)},b.Bl=function(r,s,l,d,h,m){return new IZ(r,s,l,d,h,m)};var d8e,f8e,h8e,p8e,g8e,m8e,b8e,$ce,w8e;O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator",i3),j(1322,i3,{},kYe),b.Al=function(r,s,l,d,h){return new s2e(r,s,l,Je(Ke(d)),Je(Ke(h)))},b.Bl=function(r,s,l,d,h,m){return new Zht(r,s,l,Je(Ke(d)),Je(Ke(h)),m)},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/1",1322),j(1323,i3,{},CYe),b.Al=function(r,s,l,d,h){return new H2e(r,s,l,p(d,221).a,p(h,221).a)},b.Bl=function(r,s,l,d,h,m){return new Ght(r,s,l,p(d,221).a,p(h,221).a,m)},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/2",1323),j(1324,i3,{},SYe),b.Al=function(r,s,l,d,h){return new U2e(r,s,l,p(d,180).a,p(h,180).a)},b.Bl=function(r,s,l,d,h,m){return new Vht(r,s,l,p(d,180).a,p(h,180).a,m)},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/3",1324),j(1325,i3,{},EYe),b.Al=function(r,s,l,d,h){return new r2e(r,s,l,ye(ke(d)),ye(ke(h)))},b.Bl=function(r,s,l,d,h,m){return new Kht(r,s,l,ye(ke(d)),ye(ke(h)),m)},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/4",1325),j(1326,i3,{},_Ye),b.Al=function(r,s,l,d,h){return new G2e(r,s,l,p(d,164).a,p(h,164).a)},b.Bl=function(r,s,l,d,h,m){return new Jht(r,s,l,p(d,164).a,p(h,164).a,m)},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/5",1326),j(1327,i3,{},TYe),b.Al=function(r,s,l,d,h){return new i2e(r,s,l,p(d,15).a,p(h,15).a)},b.Bl=function(r,s,l,d,h,m){return new Yht(r,s,l,p(d,15).a,p(h,15).a,m)},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/6",1327),j(1328,i3,{},AYe),b.Al=function(r,s,l,d,h){return new W2e(r,s,l,p(d,190).a,p(h,190).a)},b.Bl=function(r,s,l,d,h,m){return new Xht(r,s,l,p(d,190).a,p(h,190).a,m)},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/7",1328),j(1329,i3,{},MYe),b.Al=function(r,s,l,d,h){return new q2e(r,s,l,p(d,191).a,p(h,191).a)},b.Bl=function(r,s,l,d,h,m){return new Qht(r,s,l,p(d,191).a,p(h,191).a,m)},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleData/NotificationCreator/8",1329),j(1307,560,{},Sft),b.zl=function(r){if(!this.a.dk(r))throw Z(new B5(AU+lu(r)+MU+this.a+"'"))},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataDynamic",1307),j(1308,560,{},ldt),b.zl=function(r){},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataStatic",1308),j(771,560,{}),b.zk=function(r,s,l){var d;return d=s.ii(l),d!=null},b.Ak=function(r,s,l,d){var h,m;r.sh()&&r.th()?(h=!0,m=s.ii(l),m==null?(h=!1,m=this.b):Se(m)===Se(lg)&&(m=null),d==null?this.c!=null?(s.ji(l,null),d=this.b):s.ji(l,lg):(this.zl(d),s.ji(l,d)),Er(r,this.d.Bl(r,1,this.e,m,d,!h))):d==null?this.c!=null?s.ji(l,null):s.ji(l,lg):(this.zl(d),s.ji(l,d))},b.Ck=function(r,s,l){var d,h;r.sh()&&r.th()?(d=!0,h=s.ii(l),h==null?(d=!1,h=this.b):Se(h)===Se(lg)&&(h=null),s.ki(l),Er(r,this.d.Bl(r,2,this.e,h,this.b,d))):s.ki(l)},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettable",771),j(1309,771,{},Eft),b.zl=function(r){if(!this.a.dk(r))throw Z(new B5(AU+lu(r)+MU+this.a+"'"))},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableDynamic",1309),j(1310,771,{},cdt),b.zl=function(r){},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleDataUnsettableStatic",1310),j(402,498,{},FF),b.wk=function(r,s,l,d,h){var m,y,k,_,T;if(T=s.ii(l),this.rk()&&Se(T)===Se(lg))return null;if(this._k()&&d&&T!=null){if(k=p(T,52),k.Sh()&&(_=i1(r,k),k!=_)){if(!Rne(this.a,_))throw Z(new B5(AU+lu(_)+MU+this.a+"'"));s.ji(l,T=_),this.$k()&&(m=p(_,52),y=k.Qh(r,this.b?hi(k.Ah(),this.b):-1-hi(r.Ah(),this.e),null,null),!m.Mh()&&(y=m.Oh(r,this.b?hi(m.Ah(),this.b):-1-hi(r.Ah(),this.e),null,y)),y&&y.mj()),r.sh()&&r.th()&&Er(r,new YA(r,9,this.e,k,_))}return T}else return T},b.xk=function(r,s,l,d,h){var m,y;return y=s.ii(l),Se(y)===Se(lg)&&(y=null),s.ji(l,d),this.Kj()?Se(y)!==Se(d)&&y!=null&&(m=p(y,52),h=m.Qh(r,hi(m.Ah(),this.b),null,h)):this.$k()&&y!=null&&(h=p(y,52).Qh(r,-1-hi(r.Ah(),this.e),null,h)),r.sh()&&r.th()&&(!h&&(h=new Fm(4)),h.lj(new YA(r,1,this.e,y,d))),h},b.yk=function(r,s,l,d,h){var m;return m=s.ii(l),Se(m)===Se(lg)&&(m=null),s.ki(l),r.sh()&&r.th()&&(!h&&(h=new Fm(4)),this.rk()?h.lj(new YA(r,2,this.e,m,null)):h.lj(new YA(r,1,this.e,m,null))),h},b.zk=function(r,s,l){var d;return d=s.ii(l),d!=null},b.Ak=function(r,s,l,d){var h,m,y,k,_;if(d!=null&&!Rne(this.a,d))throw Z(new B5(AU+(me(d,57)?w3e(p(d,57).Ah()):$2e(lu(d)))+MU+this.a+"'"));_=s.ii(l),k=_!=null,this.rk()&&Se(_)===Se(lg)&&(_=null),y=null,this.Kj()?Se(_)!==Se(d)&&(_!=null&&(h=p(_,52),y=h.Qh(r,hi(h.Ah(),this.b),null,y)),d!=null&&(h=p(d,52),y=h.Oh(r,hi(h.Ah(),this.b),null,y))):this.$k()&&Se(_)!==Se(d)&&(_!=null&&(y=p(_,52).Qh(r,-1-hi(r.Ah(),this.e),null,y)),d!=null&&(y=p(d,52).Oh(r,-1-hi(r.Ah(),this.e),null,y))),d==null&&this.rk()?s.ji(l,lg):s.ji(l,d),r.sh()&&r.th()?(m=new IZ(r,1,this.e,_,d,this.rk()&&!k),y?(y.lj(m),y.mj()):Er(r,m)):y&&y.mj()},b.Ck=function(r,s,l){var d,h,m,y,k;k=s.ii(l),y=k!=null,this.rk()&&Se(k)===Se(lg)&&(k=null),m=null,k!=null&&(this.Kj()?(d=p(k,52),m=d.Qh(r,hi(d.Ah(),this.b),null,m)):this.$k()&&(m=p(k,52).Qh(r,-1-hi(r.Ah(),this.e),null,m))),s.ki(l),r.sh()&&r.th()?(h=new IZ(r,this.rk()?2:1,this.e,k,null,y),m?(m.lj(h),m.mj()):Er(r,h)):m&&m.mj()},b.Kj=function(){return!1},b.$k=function(){return!1},b._k=function(){return!1},b.rk=function(){return!1},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObject",402),j(561,402,{},OQ),b.$k=function(){return!0},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainment",561),j(1313,561,{},cct),b._k=function(){return!0},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentResolving",1313),j(773,561,{},jwe),b.rk=function(){return!0},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettable",773),j(1315,773,{},uct),b._k=function(){return!0},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentUnsettableResolving",1315),j(638,561,{},KQ),b.Kj=function(){return!0},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverse",638),j(1314,638,{},hut),b._k=function(){return!0},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseResolving",1314),j(774,638,{},fye),b.rk=function(){return!0},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettable",774),j(1316,774,{},put),b._k=function(){return!0},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectContainmentWithInverseUnsettableResolving",1316),j(639,402,{},Dwe),b._k=function(){return!0},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolving",639),j(1317,639,{},dct),b.rk=function(){return!0},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingUnsettable",1317),j(775,639,{},hye),b.Kj=function(){return!0},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverse",775),j(1318,775,{},gut),b.rk=function(){return!0},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectResolvingWithInverseUnsettable",1318),j(1311,402,{},fct),b.rk=function(){return!0},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectUnsettable",1311),j(772,402,{},pye),b.Kj=function(){return!0},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverse",772),j(1312,772,{},mut),b.rk=function(){return!0},O(Gt,"EStructuralFeatureImpl/InternalSettingDelegateSingleEObjectWithInverseUnsettable",1312),j(776,562,TU,uxe),b.wl=function(r){return new uxe(this.a,this.c,r)},b.kd=function(){return this.b},b.xl=function(r,s,l){return Bvn(this,r,this.b,l)},b.yl=function(r,s,l){return zvn(this,r,this.b,l)},O(Gt,"EStructuralFeatureImpl/InverseUpdatingFeatureMapEntry",776),j(1319,1,Nse,grt),b.Dk=function(r){return this.a},b.Oj=function(){return me(this.a,98)?p(this.a,98).Oj():!this.a.dc()},b.Wb=function(r){this.a.$b(),this.a.Fc(p(r,16))},b.Ek=function(){me(this.a,98)?p(this.a,98).Ek():this.a.$b()},O(Gt,"EStructuralFeatureImpl/SettingMany",1319),j(1320,562,TU,Hpt),b.vl=function(r){return new RQ((Fr(),tD),this.b.oi(this.a,r))},b.kd=function(){return null},b.xl=function(r,s,l){return l},b.yl=function(r,s,l){return l},O(Gt,"EStructuralFeatureImpl/SimpleContentFeatureMapEntry",1320),j(640,562,TU,RQ),b.vl=function(r){return new RQ(this.c,r)},b.kd=function(){return this.a},b.xl=function(r,s,l){return l},b.yl=function(r,s,l){return l},O(Gt,"EStructuralFeatureImpl/SimpleFeatureMapEntry",640),j(396,492,xp,O5),b.$i=function(r){return Ee(Wd,Pt,29,r,0,1)},b.Wi=function(){return!1},O(Gt,"ESuperAdapter/1",396),j(446,439,{109:1,94:1,93:1,158:1,197:1,57:1,114:1,834:1,52:1,100:1,161:1,446:1,117:1,118:1},KY),b.Ih=function(r,s,l){var d;switch(r){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),this.Ab;case 1:return this.zb;case 2:return!this.a&&(this.a=new GA(this,Ao,this)),this.a}return Zu(this,r-mn((Tt(),Qy)),Dt((d=p(Yt(this,16),29),d||Qy),r),s,l)},b.Rh=function(r,s,l){var d,h;switch(s){case 0:return!this.Ab&&(this.Ab=new De(lr,this,0,3)),co(this.Ab,r,l);case 2:return!this.a&&(this.a=new GA(this,Ao,this)),co(this.a,r,l)}return h=p(Dt((d=p(Yt(this,16),29),d||(Tt(),Qy)),s),69),h.uk().yk(this,Tl(this),s-mn((Tt(),Qy)),r,l)},b.Th=function(r){var s;switch(r){case 0:return!!this.Ab&&this.Ab.i!=0;case 1:return this.zb!=null;case 2:return!!this.a&&this.a.i!=0}return Qu(this,r-mn((Tt(),Qy)),Dt((s=p(Yt(this,16),29),s||Qy),r))},b.$h=function(r,s){var l;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab),!this.Ab&&(this.Ab=new De(lr,this,0,3)),Ti(this.Ab,p(s,18));return;case 1:bl(this,Un(s));return;case 2:!this.a&&(this.a=new GA(this,Ao,this)),Tn(this.a),!this.a&&(this.a=new GA(this,Ao,this)),Ti(this.a,p(s,18));return}sd(this,r-mn((Tt(),Qy)),Dt((l=p(Yt(this,16),29),l||Qy),r),s)},b.fi=function(){return Tt(),Qy},b.hi=function(r){var s;switch(r){case 0:!this.Ab&&(this.Ab=new De(lr,this,0,3)),Tn(this.Ab);return;case 1:bl(this,null);return;case 2:!this.a&&(this.a=new GA(this,Ao,this)),Tn(this.a);return}id(this,r-mn((Tt(),Qy)),Dt((s=p(Yt(this,16),29),s||Qy),r))},O(Gt,"ETypeParameterImpl",446),j(447,81,Xo,GA),b.Lj=function(r,s){return D4n(this,p(r,87),s)},b.Mj=function(r,s){return I4n(this,p(r,87),s)},O(Gt,"ETypeParameterImpl/1",447),j(637,44,Jk,bX),b.ec=function(){return new a$(this)},O(Gt,"ETypeParameterImpl/2",637),j(557,Nh,fc,a$),b.Ec=function(r){return qct(this,p(r,87))},b.Fc=function(r){var s,l,d;for(d=!1,l=r.Jc();l.Ob();)s=p(l.Pb(),87),cr(this.a,s,"")==null&&(d=!0);return d},b.$b=function(){Da(this.a)},b.Gc=function(r){return nl(this.a,r)},b.Jc=function(){var r;return r=new h2(new Nx(this.a).a),new l$(r)},b.Kc=function(r){return Agt(this,r)},b.gc=function(){return gA(this.a)},O(Gt,"ETypeParameterImpl/2/1",557),j(558,1,Ts,l$),b.Nb=function(r){Bs(this,r)},b.Pb=function(){return p(Dk(this.a).jd(),87)},b.Ob=function(){return this.a.b},b.Qb=function(){H0t(this.a)},O(Gt,"ETypeParameterImpl/2/1/1",558),j(1281,44,Jk,iit),b._b=function(r){return Cs(r)?OZ(this,r):!!Po(this.f,r)},b.xc=function(r){var s,l;return s=Cs(r)?rl(this,r):ta(Po(this.f,r)),me(s,835)?(l=p(s,835),s=l.Ik(),cr(this,p(r,241),s),s):s??(r==null?(LX(),TLt):null)},O(Gt,"EValidatorRegistryImpl",1281),j(1303,710,{109:1,94:1,93:1,469:1,158:1,57:1,114:1,2002:1,52:1,100:1,161:1,117:1,118:1},NYe),b.oi=function(r,s){switch(r.fk()){case 21:case 22:case 23:case 24:case 26:case 31:case 32:case 37:case 38:case 39:case 40:case 43:case 44:case 48:case 49:case 20:return s==null?null:Yo(s);case 25:return Qkn(s);case 27:return hkn(s);case 28:return pkn(s);case 29:return s==null?null:plt(Jj[0],p(s,205));case 41:return s==null?"":fb(p(s,298));case 42:return Yo(s);case 50:return Un(s);default:throw Z(new Kt(LT+r.ve()+Oy))}},b.pi=function(r){var s,l,d,h,m,y,k,_,T,N,L,$,B,q,K,ne;switch(r.G==-1&&(r.G=($=Tu(r),$?J0($.si(),r):-1)),r.G){case 0:return l=new pX,l;case 1:return s=new Rme,s;case 2:return d=new Hme,d;case 4:return h=new d$,h;case 5:return m=new rit,m;case 6:return y=new xrt,y;case 7:return k=new zme,k;case 10:return T=new e$,T;case 11:return N=new gX,N;case 12:return L=new Dft,L;case 13:return B=new mX,B;case 14:return q=new Owe,q;case 17:return K=new xYe,K;case 18:return _=new Uw,_;case 19:return ne=new KY,ne;default:throw Z(new Kt(pse+r.zb+Oy))}},b.qi=function(r,s){switch(r.fk()){case 20:return s==null?null:new tbe(s);case 21:return s==null?null:new Wm(s);case 23:case 22:return s==null?null:YEn(s);case 26:case 24:return s==null?null:fI(ju(s,-128,127)<<24>>24);case 25:return GMn(s);case 27:return D_n(s);case 28:return I_n(s);case 29:return Q4n(s);case 32:case 31:return s==null?null:k2(s);case 38:case 37:return s==null?null:new S1e(s);case 40:case 39:return s==null?null:Oe(ju(s,Ds,xr));case 41:return null;case 42:return s==null,null;case 44:case 43:return s==null?null:y2(AH(s));case 49:case 48:return s==null?null:P_(ju(s,NU,32767)<<16>>16);case 50:return s;default:throw Z(new Kt(LT+r.ve()+Oy))}},O(Gt,"EcoreFactoryImpl",1303),j(548,184,{109:1,94:1,93:1,158:1,197:1,57:1,241:1,114:1,2e3:1,52:1,100:1,161:1,184:1,548:1,117:1,118:1,680:1},rft),b.gb=!1,b.hb=!1;var y8e,_Lt=!1;O(Gt,"EcorePackageImpl",548),j(1199,1,{835:1},jYe),b.Ik=function(){return Rlt(),ALt},O(Gt,"EcorePackageImpl/1",1199),j(1208,1,fr,DYe),b.dk=function(r){return me(r,158)},b.ek=function(r){return Ee(tP,Pt,158,r,0,1)},O(Gt,"EcorePackageImpl/10",1208),j(1209,1,fr,IYe),b.dk=function(r){return me(r,197)},b.ek=function(r){return Ee(Mce,Pt,197,r,0,1)},O(Gt,"EcorePackageImpl/11",1209),j(1210,1,fr,OYe),b.dk=function(r){return me(r,57)},b.ek=function(r){return Ee(R1,Pt,57,r,0,1)},O(Gt,"EcorePackageImpl/12",1210),j(1211,1,fr,LYe),b.dk=function(r){return me(r,403)},b.ek=function(r){return Ee(qd,mTe,62,r,0,1)},O(Gt,"EcorePackageImpl/13",1211),j(1212,1,fr,PYe),b.dk=function(r){return me(r,241)},b.ek=function(r){return Ee(ih,Pt,241,r,0,1)},O(Gt,"EcorePackageImpl/14",1212),j(1213,1,fr,RYe),b.dk=function(r){return me(r,503)},b.ek=function(r){return Ee(Yy,Pt,2078,r,0,1)},O(Gt,"EcorePackageImpl/15",1213),j(1214,1,fr,$Ye),b.dk=function(r){return me(r,103)},b.ek=function(r){return Ee(xv,r3,19,r,0,1)},O(Gt,"EcorePackageImpl/16",1214),j(1215,1,fr,FYe),b.dk=function(r){return me(r,179)},b.ek=function(r){return Ee(Ql,r3,179,r,0,1)},O(Gt,"EcorePackageImpl/17",1215),j(1216,1,fr,BYe),b.dk=function(r){return me(r,470)},b.ek=function(r){return Ee(wv,Pt,470,r,0,1)},O(Gt,"EcorePackageImpl/18",1216),j(1217,1,fr,zYe),b.dk=function(r){return me(r,549)},b.ek=function(r){return Ee(ka,fTt,549,r,0,1)},O(Gt,"EcorePackageImpl/19",1217),j(1200,1,fr,HYe),b.dk=function(r){return me(r,335)},b.ek=function(r){return Ee(yv,r3,38,r,0,1)},O(Gt,"EcorePackageImpl/2",1200),j(1218,1,fr,UYe),b.dk=function(r){return me(r,248)},b.ek=function(r){return Ee(Ao,MTt,87,r,0,1)},O(Gt,"EcorePackageImpl/20",1218),j(1219,1,fr,WYe),b.dk=function(r){return me(r,446)},b.ek=function(r){return Ee(Il,Pt,834,r,0,1)},O(Gt,"EcorePackageImpl/21",1219),j(1220,1,fr,qYe),b.dk=function(r){return Hx(r)},b.ek=function(r){return Ee(Ci,Fe,473,r,8,1)},O(Gt,"EcorePackageImpl/22",1220),j(1221,1,fr,GYe),b.dk=function(r){return me(r,195)},b.ek=function(r){return Ee(gc,Fe,195,r,0,2)},O(Gt,"EcorePackageImpl/23",1221),j(1222,1,fr,VYe),b.dk=function(r){return me(r,221)},b.ek=function(r){return Ee(XS,Fe,221,r,0,1)},O(Gt,"EcorePackageImpl/24",1222),j(1223,1,fr,KYe),b.dk=function(r){return me(r,180)},b.ek=function(r){return Ee(RN,Fe,180,r,0,1)},O(Gt,"EcorePackageImpl/25",1223),j(1224,1,fr,JYe),b.dk=function(r){return me(r,205)},b.ek=function(r){return Ee(BU,Fe,205,r,0,1)},O(Gt,"EcorePackageImpl/26",1224),j(1225,1,fr,YYe),b.dk=function(r){return!1},b.ek=function(r){return Ee(R8e,Pt,2174,r,0,1)},O(Gt,"EcorePackageImpl/27",1225),j(1226,1,fr,XYe),b.dk=function(r){return Ux(r)},b.ek=function(r){return Ee(Hi,Fe,346,r,7,1)},O(Gt,"EcorePackageImpl/28",1226),j(1227,1,fr,QYe),b.dk=function(r){return me(r,61)},b.ek=function(r){return Ee(Q9e,O2,61,r,0,1)},O(Gt,"EcorePackageImpl/29",1227),j(1201,1,fr,ZYe),b.dk=function(r){return me(r,504)},b.ek=function(r){return Ee(lr,{3:1,4:1,5:1,1995:1},587,r,0,1)},O(Gt,"EcorePackageImpl/3",1201),j(1228,1,fr,eXe),b.dk=function(r){return me(r,568)},b.ek=function(r){return Ee(t8e,Pt,2001,r,0,1)},O(Gt,"EcorePackageImpl/30",1228),j(1229,1,fr,tXe),b.dk=function(r){return me(r,163)},b.ek=function(r){return Ee(S8e,O2,163,r,0,1)},O(Gt,"EcorePackageImpl/31",1229),j(1230,1,fr,nXe),b.dk=function(r){return me(r,75)},b.ek=function(r){return Ee(tG,$Tt,75,r,0,1)},O(Gt,"EcorePackageImpl/32",1230),j(1231,1,fr,rXe),b.dk=function(r){return me(r,164)},b.ek=function(r){return Ee(UT,Fe,164,r,0,1)},O(Gt,"EcorePackageImpl/33",1231),j(1232,1,fr,iXe),b.dk=function(r){return me(r,15)},b.ek=function(r){return Ee(Qi,Fe,15,r,0,1)},O(Gt,"EcorePackageImpl/34",1232),j(1233,1,fr,sXe),b.dk=function(r){return me(r,298)},b.ek=function(r){return Ee(MTe,Pt,298,r,0,1)},O(Gt,"EcorePackageImpl/35",1233),j(1234,1,fr,oXe),b.dk=function(r){return me(r,190)},b.ek=function(r){return Ee(Py,Fe,190,r,0,1)},O(Gt,"EcorePackageImpl/36",1234),j(1235,1,fr,aXe),b.dk=function(r){return me(r,92)},b.ek=function(r){return Ee(NTe,Pt,92,r,0,1)},O(Gt,"EcorePackageImpl/37",1235),j(1236,1,fr,lXe),b.dk=function(r){return me(r,588)},b.ek=function(r){return Ee(x8e,Pt,588,r,0,1)},O(Gt,"EcorePackageImpl/38",1236),j(1237,1,fr,cXe),b.dk=function(r){return!1},b.ek=function(r){return Ee($8e,Pt,2175,r,0,1)},O(Gt,"EcorePackageImpl/39",1237),j(1202,1,fr,uXe),b.dk=function(r){return me(r,88)},b.ek=function(r){return Ee(Wd,Pt,29,r,0,1)},O(Gt,"EcorePackageImpl/4",1202),j(1238,1,fr,dXe),b.dk=function(r){return me(r,191)},b.ek=function(r){return Ee(Ry,Fe,191,r,0,1)},O(Gt,"EcorePackageImpl/40",1238),j(1239,1,fr,fXe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Gt,"EcorePackageImpl/41",1239),j(1240,1,fr,hXe),b.dk=function(r){return me(r,585)},b.ek=function(r){return Ee(e8e,Pt,585,r,0,1)},O(Gt,"EcorePackageImpl/42",1240),j(1241,1,fr,pXe),b.dk=function(r){return!1},b.ek=function(r){return Ee(F8e,Fe,2176,r,0,1)},O(Gt,"EcorePackageImpl/43",1241),j(1242,1,fr,gXe),b.dk=function(r){return me(r,45)},b.ek=function(r){return Ee(Yb,jH,45,r,0,1)},O(Gt,"EcorePackageImpl/44",1242),j(1203,1,fr,mXe),b.dk=function(r){return me(r,143)},b.ek=function(r){return Ee(sh,Pt,143,r,0,1)},O(Gt,"EcorePackageImpl/5",1203),j(1204,1,fr,bXe),b.dk=function(r){return me(r,159)},b.ek=function(r){return Ee(Lce,Pt,159,r,0,1)},O(Gt,"EcorePackageImpl/6",1204),j(1205,1,fr,wXe),b.dk=function(r){return me(r,459)},b.ek=function(r){return Ee(eG,Pt,675,r,0,1)},O(Gt,"EcorePackageImpl/7",1205),j(1206,1,fr,yXe),b.dk=function(r){return me(r,568)},b.ek=function(r){return Ee(o0,Pt,684,r,0,1)},O(Gt,"EcorePackageImpl/8",1206),j(1207,1,fr,xXe),b.dk=function(r){return me(r,469)},b.ek=function(r){return Ee(Kj,Pt,469,r,0,1)},O(Gt,"EcorePackageImpl/9",1207),j(1019,2042,dTt,Ait),b.Ki=function(r,s){MSn(this,p(s,415))},b.Oi=function(r,s){j2t(this,r,p(s,415))},O(Gt,"MinimalEObjectImpl/1ArrayDelegatingAdapterList",1019),j(1020,151,HO,Vdt),b.hj=function(){return this.a.a},O(Gt,"MinimalEObjectImpl/1ArrayDelegatingAdapterList/1",1020),j(1047,1046,{},ilt),O("org.eclipse.emf.ecore.plugin","EcorePlugin",1047);var x8e=pi(FTt,"Resource");j(786,1485,BTt),b.Fl=function(r){},b.Gl=function(r){},b.Cl=function(){return!this.a&&(this.a=new lX(this)),this.a},b.Dl=function(r){var s,l,d,h,m;if(d=r.length,d>0)if(tn(0,r.length),r.charCodeAt(0)==47){for(m=new gl(4),h=1,s=1;s<d;++s)tn(s,r.length),r.charCodeAt(s)==47&&(Be(m,h==s?"":(Ps(h,s,r.length),r.substr(h,s-h))),h=s+1);return Be(m,(tn(h,r.length+1),r.substr(h))),STn(this,m)}else tn(d-1,r.length),r.charCodeAt(d-1)==63&&(l=nye(r,Wl(63),d-2),l>0&&(r=(Ps(0,l,r.length),r.substr(0,l))));return FAn(this,r)},b.El=function(){return this.c},b.Ib=function(){var r;return fb(this.Pm)+"@"+(r=Jr(this)>>>0,r.toString(16))+" uri='"+this.d+"'"},b.b=!1,O(jse,"ResourceImpl",786),j(1486,786,BTt,mrt),O(jse,"BinaryResourceImpl",1486),j(1159,697,Ese),b._i=function(r){return me(r,57)?myn(this,p(r,57)):me(r,588)?new cn(p(r,588).Cl()):Se(r)===Se(this.f)?p(r,18).Jc():(t_(),iP.a)},b.Ob=function(){return fCe(this)},b.a=!1,O(si,"EcoreUtil/ContentTreeIterator",1159),j(1487,1159,Ese,Cdt),b._i=function(r){return Se(r)===Se(this.f)?p(r,16).Jc():new Spt(p(r,57))},O(jse,"ResourceImpl/5",1487),j(647,2054,ATt,lX),b.Gc=function(r){return this.i<=4?J_(this,r):me(r,52)&&p(r,52).Gh()==this.a},b.Ki=function(r,s){r==this.i-1&&(this.a.b||(this.a.b=!0))},b.Mi=function(r,s){r==0?this.a.b||(this.a.b=!0):uee(this,r,s)},b.Oi=function(r,s){},b.Pi=function(r,s,l){},b.Jj=function(){return 2},b.hj=function(){return this.a},b.Kj=function(){return!0},b.Lj=function(r,s){var l;return l=p(r,52),s=l.ci(this.a,s),s},b.Mj=function(r,s){var l;return l=p(r,52),l.ci(null,s)},b.Nj=function(){return!1},b.Qi=function(){return!0},b.$i=function(r){return Ee(R1,Pt,57,r,0,1)},b.Wi=function(){return!1},O(jse,"ResourceImpl/ContentsEList",647),j(953,2024,pT,brt),b.dd=function(r){return this.a.Ii(r)},b.gc=function(){return this.a.gc()},O(si,"AbstractSequentialInternalEList/1",953);var v8e,k8e,Hs,C8e;j(625,1,{},_ut);var nG,rG;O(si,"BasicExtendedMetaData",625),j(1150,1,{},Sat),b.Hl=function(){return null},b.Il=function(){return this.a==-2&&afn(this,q4n(this.d,this.b)),this.a},b.Jl=function(){return null},b.Kl=function(){return At(),At(),po},b.ve=function(){return this.c==FT&&lfn(this,Zwt(this.d,this.b)),this.c},b.Ll=function(){return 0},b.a=-2,b.c=FT,O(si,"BasicExtendedMetaData/EClassExtendedMetaDataImpl",1150),j(1151,1,{},tpt),b.Hl=function(){return this.a==(b_(),nG)&&dfn(this,MDn(this.f,this.b)),this.a},b.Il=function(){return 0},b.Jl=function(){return this.c==(b_(),nG)&&cfn(this,NDn(this.f,this.b)),this.c},b.Kl=function(){return!this.d&&hfn(this,h8n(this.f,this.b)),this.d},b.ve=function(){return this.e==FT&&gfn(this,Zwt(this.f,this.b)),this.e},b.Ll=function(){return this.g==-2&&bfn(this,f4n(this.f,this.b)),this.g},b.e=FT,b.g=-2,O(si,"BasicExtendedMetaData/EDataTypeExtendedMetaDataImpl",1151),j(1149,1,{},Eat),b.b=!1,b.c=!1,O(si,"BasicExtendedMetaData/EPackageExtendedMetaDataImpl",1149),j(1152,1,{},npt),b.c=-2,b.e=FT,b.f=FT,O(si,"BasicExtendedMetaData/EStructuralFeatureExtendedMetaDataImpl",1152),j(581,623,Xo,NF),b.Jj=function(){return this.c},b.ml=function(){return!1},b.Ui=function(r,s){return s},b.c=0,O(si,"EDataTypeEList",581);var S8e=pi(si,"FeatureMap");j(76,581,{3:1,4:1,20:1,31:1,56:1,18:1,16:1,59:1,71:1,67:1,61:1,77:1,163:1,219:1,1998:1,72:1,98:1},Ai),b._c=function(r,s){YNn(this,r,p(s,75))},b.Ec=function(r){return hNn(this,p(r,75))},b.Fi=function(r){dwn(this,p(r,75))},b.Lj=function(r,s){return H0n(this,p(r,75),s)},b.Mj=function(r,s){return iye(this,p(r,75),s)},b.Ri=function(r,s){return x9n(this,r,s)},b.Ui=function(r,s){return lOn(this,r,p(s,75))},b.fd=function(r,s){return Ljn(this,r,p(s,75))},b.Sj=function(r,s){return U0n(this,p(r,75),s)},b.Tj=function(r,s){return Zct(this,p(r,75),s)},b.Uj=function(r,s,l){return t4n(this,p(r,75),p(s,75),l)},b.Xi=function(r,s){return nne(this,r,p(s,75))},b.Ml=function(r,s){return oSe(this,r,s)},b.ad=function(r,s){var l,d,h,m,y,k,_,T,N;for(T=new ly(s.gc()),h=s.Jc();h.Ob();)if(d=p(h.Pb(),75),m=d.Jk(),Kg(this.e,m))(!m.Qi()||!xB(this,m,d.kd())&&!J_(T,d))&&jn(T,d);else{for(N=Al(this.e.Ah(),m),l=p(this.g,122),y=!0,k=0;k<this.i;++k)if(_=l[k],N.$l(_.Jk())){p(Rk(this,k,d),75),y=!1;break}y&&jn(T,d)}return Eve(this,r,T)},b.Fc=function(r){var s,l,d,h,m,y,k,_,T;for(_=new ly(r.gc()),d=r.Jc();d.Ob();)if(l=p(d.Pb(),75),h=l.Jk(),Kg(this.e,h))(!h.Qi()||!xB(this,h,l.kd())&&!J_(_,l))&&jn(_,l);else{for(T=Al(this.e.Ah(),h),s=p(this.g,122),m=!0,y=0;y<this.i;++y)if(k=s[y],T.$l(k.Jk())){p(Rk(this,y,l),75),m=!1;break}m&&jn(_,l)}return Ti(this,_)},b.Di=function(r){return this.j=-1,$ne(this,this.i,r)},b.Nl=function(r,s,l){return QCe(this,r,s,l)},b.Vk=function(r,s){return iO(this,r,s)},b.Ol=function(r,s,l){return TSe(this,r,s,l)},b.Pl=function(){return this},b.Ql=function(r,s){return aO(this,r,s)},b.Rl=function(r){return p(be(this,r),75).Jk()},b.Sl=function(r){return p(be(this,r),75).kd()},b.Tl=function(){return this.b},b.Kj=function(){return!0},b.Rj=function(){return!0},b.Ul=function(r){return!OI(this,r)},b.$i=function(r){return Ee(ELt,$Tt,344,r,0,1)},b.nl=function(r){return LQ(this,r)},b.Wb=function(r){z8(this,r)},b.Vl=function(r,s){SH(this,r,s)},b.Wl=function(r){return n1t(this,r)},b.Xl=function(r){Ryt(this,r)},O(si,"BasicFeatureMap",76),j(1922,1,Vp),b.Nb=function(r){Bs(this,r)},b.Rb=function(r){if(this.g==-1)throw Z(new sc);GF(this);try{_kt(this.e,this.b,this.a,r),this.d=this.e.j,$z(this)}catch(s){throw s=Oi(s),me(s,99)?Z(new Ku):Z(s)}},b.Ob=function(){return tte(this)},b.Sb=function(){return jbt(this)},b.Pb=function(){return $z(this)},b.Tb=function(){return this.a},b.Ub=function(){var r;if(jbt(this))return GF(this),this.g=--this.a,this.sl()&&(r=HM(this.e,this.b,this.c,this.a,this.j),this.j=r),this.i=0,this.j;throw Z(new Zo)},b.Vb=function(){return this.a-1},b.Qb=function(){if(this.g==-1)throw Z(new sc);GF(this);try{m2t(this.e,this.b,this.g),this.d=this.e.j,this.g<this.a&&(--this.a,--this.c),--this.g}catch(r){throw r=Oi(r),me(r,99)?Z(new Ku):Z(r)}},b.sl=function(){return!1},b.Wb=function(r){if(this.g==-1)throw Z(new sc);GF(this);try{Q3t(this.e,this.b,this.g,r),this.d=this.e.j}catch(s){throw s=Oi(s),me(s,99)?Z(new Ku):Z(s)}},b.a=0,b.c=0,b.d=0,b.f=!1,b.g=0,b.i=0,O(si,"FeatureMapUtil/BasicFeatureEIterator",1922),j(412,1922,Vp,T_),b.Yl=function(){var r,s,l;for(l=this.e.i,r=p(this.e.g,122);this.c<l;){if(s=r[this.c],this.k.$l(s.Jk()))return this.j=this.f?s:s.kd(),this.i=2,!0;++this.c}return this.i=1,this.g=-1,!1},b.Zl=function(){var r,s;for(r=p(this.e.g,122);--this.c>=0;)if(s=r[this.c],this.k.$l(s.Jk()))return this.j=this.f?s:s.kd(),this.i=-2,!0;return this.i=-1,this.g=-1,!1},O(si,"BasicFeatureMap/FeatureEIterator",412),j(666,412,Vp,yQ),b.sl=function(){return!0},O(si,"BasicFeatureMap/ResolvingFeatureEIterator",666),j(951,482,EU,wlt),b.nj=function(){return this},O(si,"EContentsEList/1",951),j(952,482,EU,Uat),b.sl=function(){return!1},O(si,"EContentsEList/2",952),j(950,287,_U,ylt),b.ul=function(r){},b.Ob=function(){return!1},b.Sb=function(){return!1},O(si,"EContentsEList/FeatureIteratorImpl/1",950),j(824,581,Xo,fwe),b.Li=function(){this.a=!0},b.Oj=function(){return this.a},b.Ek=function(){var r;Tn(this),ru(this.e)?(r=this.a,this.a=!1,Er(this.e,new ff(this.e,2,this.c,r,!1))):this.a=!1},b.a=!1,O(si,"EDataTypeEList/Unsettable",824),j(1920,581,Xo,Elt),b.Qi=function(){return!0},O(si,"EDataTypeUniqueEList",1920),j(1921,824,Xo,_lt),b.Qi=function(){return!0},O(si,"EDataTypeUniqueEList/Unsettable",1921),j(145,81,Xo,oc),b.ll=function(){return!0},b.Ui=function(r,s){return PS(this,r,p(s,57))},O(si,"EObjectContainmentEList/Resolving",145),j(1153,543,Xo,Slt),b.ll=function(){return!0},b.Ui=function(r,s){return PS(this,r,p(s,57))},O(si,"EObjectContainmentEList/Unsettable/Resolving",1153),j(753,14,Xo,Xwe),b.Li=function(){this.a=!0},b.Oj=function(){return this.a},b.Ek=function(){var r;Tn(this),ru(this.e)?(r=this.a,this.a=!1,Er(this.e,new ff(this.e,2,this.c,r,!1))):this.a=!1},b.a=!1,O(si,"EObjectContainmentWithInverseEList/Unsettable",753),j(1187,753,Xo,Bct),b.ll=function(){return!0},b.Ui=function(r,s){return PS(this,r,p(s,57))},O(si,"EObjectContainmentWithInverseEList/Unsettable/Resolving",1187),j(745,491,Xo,dwe),b.Li=function(){this.a=!0},b.Oj=function(){return this.a},b.Ek=function(){var r;Tn(this),ru(this.e)?(r=this.a,this.a=!1,Er(this.e,new ff(this.e,2,this.c,r,!1))):this.a=!1},b.a=!1,O(si,"EObjectEList/Unsettable",745),j(339,491,Xo,wk),b.ll=function(){return!0},b.Ui=function(r,s){return PS(this,r,p(s,57))},O(si,"EObjectResolvingEList",339),j(1825,745,Xo,Tlt),b.ll=function(){return!0},b.Ui=function(r,s){return PS(this,r,p(s,57))},O(si,"EObjectResolvingEList/Unsettable",1825),j(1488,1,{},vXe);var TLt;O(si,"EObjectValidator",1488),j(547,491,Xo,JF),b.gl=function(){return this.d},b.hl=function(){return this.b},b.Kj=function(){return!0},b.kl=function(){return!0},b.b=0,O(si,"EObjectWithInverseEList",547),j(1190,547,Xo,zct),b.jl=function(){return!0},O(si,"EObjectWithInverseEList/ManyInverse",1190),j(626,547,Xo,BQ),b.Li=function(){this.a=!0},b.Oj=function(){return this.a},b.Ek=function(){var r;Tn(this),ru(this.e)?(r=this.a,this.a=!1,Er(this.e,new ff(this.e,2,this.c,r,!1))):this.a=!1},b.a=!1,O(si,"EObjectWithInverseEList/Unsettable",626),j(1189,626,Xo,Hct),b.jl=function(){return!0},O(si,"EObjectWithInverseEList/Unsettable/ManyInverse",1189),j(754,547,Xo,Qwe),b.ll=function(){return!0},b.Ui=function(r,s){return PS(this,r,p(s,57))},O(si,"EObjectWithInverseResolvingEList",754),j(33,754,Xo,Rt),b.jl=function(){return!0},O(si,"EObjectWithInverseResolvingEList/ManyInverse",33),j(755,626,Xo,Zwe),b.ll=function(){return!0},b.Ui=function(r,s){return PS(this,r,p(s,57))},O(si,"EObjectWithInverseResolvingEList/Unsettable",755),j(1188,755,Xo,Uct),b.jl=function(){return!0},O(si,"EObjectWithInverseResolvingEList/Unsettable/ManyInverse",1188),j(1154,623,Xo),b.Ji=function(){return(this.b&1792)==0},b.Li=function(){this.b|=1},b.il=function(){return(this.b&4)!=0},b.Kj=function(){return(this.b&40)!=0},b.jl=function(){return(this.b&16)!=0},b.kl=function(){return(this.b&8)!=0},b.ll=function(){return(this.b&h1)!=0},b.$k=function(){return(this.b&32)!=0},b.ml=function(){return(this.b&vf)!=0},b.dk=function(r){return this.d?jpt(this.d,r):this.Jk().Fk().dk(r)},b.Oj=function(){return this.b&2?(this.b&1)!=0:this.i!=0},b.Qi=function(){return(this.b&128)!=0},b.Ek=function(){var r;Tn(this),this.b&2&&(ru(this.e)?(r=(this.b&1)!=0,this.b&=-2,F5(this,new ff(this.e,2,hi(this.e.Ah(),this.Jk()),r,!1))):this.b&=-2)},b.Wi=function(){return(this.b&1536)==0},b.b=0,O(si,"EcoreEList/Generic",1154),j(1155,1154,Xo,Pft),b.Jk=function(){return this.a},O(si,"EcoreEList/Dynamic",1155),j(752,67,xp,y1e),b.$i=function(r){return gI(this.a.a,r)},O(si,"EcoreEMap/1",752),j(751,81,Xo,Kye),b.Ki=function(r,s){Bz(this.b,p(s,136))},b.Mi=function(r,s){R1t(this.b)},b.Ni=function(r,s,l){var d;++(d=this.b,p(s,136),d).e},b.Oi=function(r,s){dte(this.b,p(s,136))},b.Pi=function(r,s,l){dte(this.b,p(l,136)),Se(l)===Se(s)&&p(l,136).zi(Bpn(p(s,136).jd())),Bz(this.b,p(s,136))},O(si,"EcoreEMap/DelegateEObjectContainmentEList",751),j(1185,142,gTe,Kmt),O(si,"EcoreEMap/Unsettable",1185),j(1186,751,Xo,Wct),b.Li=function(){this.a=!0},b.Oj=function(){return this.a},b.Ek=function(){var r;Tn(this),ru(this.e)?(r=this.a,this.a=!1,Er(this.e,new ff(this.e,2,this.c,r,!1))):this.a=!1},b.a=!1,O(si,"EcoreEMap/Unsettable/UnsettableDelegateEObjectContainmentEList",1186),j(1158,223,Jk,Fdt),b.a=!1,b.b=!1,O(si,"EcoreUtil/Copier",1158),j(747,1,Ts,Spt),b.Nb=function(r){Bs(this,r)},b.Ob=function(){return $wt(this)},b.Pb=function(){var r;return $wt(this),r=this.b,this.b=null,r},b.Qb=function(){this.a.Qb()},O(si,"EcoreUtil/ProperContentIterator",747),j(1489,1488,{},xZe);var ALt;O(si,"EcoreValidator",1489);var MLt;pi(si,"FeatureMapUtil/Validator"),j(1258,1,{2003:1},kXe),b.$l=function(r){return!0},O(si,"FeatureMapUtil/1",1258),j(760,1,{2003:1},FSe),b.$l=function(r){var s;return this.c==r?!0:(s=Ke(Wt(this.a,r)),s==null?LDn(this,r)?(ygt(this.a,r,(zt(),HT)),!0):(ygt(this.a,r,(zt(),v1)),!1):s==(zt(),HT))},b.e=!1;var Fce;O(si,"FeatureMapUtil/BasicValidator",760),j(761,44,Jk,lwe),O(si,"FeatureMapUtil/BasicValidator/Cache",761),j(495,56,{20:1,31:1,56:1,18:1,16:1,61:1,77:1,72:1,98:1},v8),b._c=function(r,s){_kt(this.c,this.b,r,s)},b.Ec=function(r){return oSe(this.c,this.b,r)},b.ad=function(r,s){return eIn(this.c,this.b,r,s)},b.Fc=function(r){return FA(this,r)},b.Ei=function(r,s){Bkn(this.c,this.b,r,s)},b.Uk=function(r,s){return QCe(this.c,this.b,r,s)},b.Yi=function(r){return CH(this.c,this.b,r,!1)},b.Gi=function(){return Qat(this.c,this.b)},b.Hi=function(){return Dpn(this.c,this.b)},b.Ii=function(r){return Hvn(this.c,this.b,r)},b.Vk=function(r,s){return Cct(this,r,s)},b.$b=function(){LC(this)},b.Gc=function(r){return xB(this.c,this.b,r)},b.Hc=function(r){return z3n(this.c,this.b,r)},b.Xb=function(r){return CH(this.c,this.b,r,!0)},b.Dk=function(r){return this},b.bd=function(r){return Q2n(this.c,this.b,r)},b.dc=function(){return iF(this)},b.Oj=function(){return!OI(this.c,this.b)},b.Jc=function(){return Skn(this.c,this.b)},b.cd=function(){return Ekn(this.c,this.b)},b.dd=function(r){return GSn(this.c,this.b,r)},b.Ri=function(r,s){return U3t(this.c,this.b,r,s)},b.Si=function(r,s){Gvn(this.c,this.b,r,s)},b.ed=function(r){return m2t(this.c,this.b,r)},b.Kc=function(r){return s9n(this.c,this.b,r)},b.fd=function(r,s){return Q3t(this.c,this.b,r,s)},b.Wb=function(r){iH(this.c,this.b),FA(this,p(r,16))},b.gc=function(){return VSn(this.c,this.b)},b.Nc=function(){return Zxn(this.c,this.b)},b.Oc=function(r){return Z2n(this.c,this.b,r)},b.Ib=function(){var r,s;for(s=new j0,s.a+="[",r=Qat(this.c,this.b);tte(r);)Mo(s,zA($z(r))),tte(r)&&(s.a+=yl);return s.a+="]",s.a},b.Ek=function(){iH(this.c,this.b)},O(si,"FeatureMapUtil/FeatureEList",495),j(634,39,HO,eee),b.fj=function(r){return _M(this,r)},b.kj=function(r){var s,l,d,h,m,y,k;switch(this.d){case 1:case 2:{if(m=r.hj(),Se(m)===Se(this.c)&&_M(this,null)==r.fj(null))return this.g=r.gj(),r.ej()==1&&(this.d=1),!0;break}case 3:{switch(h=r.ej(),h){case 3:{if(m=r.hj(),Se(m)===Se(this.c)&&_M(this,null)==r.fj(null))return this.d=5,s=new ly(2),jn(s,this.g),jn(s,r.gj()),this.g=s,!0;break}}break}case 5:{switch(h=r.ej(),h){case 3:{if(m=r.hj(),Se(m)===Se(this.c)&&_M(this,null)==r.fj(null))return l=p(this.g,18),l.Ec(r.gj()),!0;break}}break}case 4:{switch(h=r.ej(),h){case 3:{if(m=r.hj(),Se(m)===Se(this.c)&&_M(this,null)==r.fj(null))return this.d=1,this.g=r.gj(),!0;break}case 4:{if(m=r.hj(),Se(m)===Se(this.c)&&_M(this,null)==r.fj(null))return this.d=6,k=new ly(2),jn(k,this.n),jn(k,r.ij()),this.n=k,y=ie(re(Wn,1),ur,30,15,[this.o,r.jj()]),this.g=y,!0;break}}break}case 6:{switch(h=r.ej(),h){case 4:{if(m=r.hj(),Se(m)===Se(this.c)&&_M(this,null)==r.fj(null))return l=p(this.n,18),l.Ec(r.ij()),y=p(this.g,54),d=Ee(Wn,ur,30,y.length+1,15,1),Wa(y,0,d,0,y.length),d[y.length]=r.jj(),this.g=d,!0;break}}break}}return!1},O(si,"FeatureMapUtil/FeatureENotificationImpl",634),j(553,495,{20:1,31:1,56:1,18:1,16:1,61:1,77:1,163:1,219:1,1998:1,72:1,98:1},LF),b.Ml=function(r,s){return oSe(this.c,r,s)},b.Nl=function(r,s,l){return QCe(this.c,r,s,l)},b.Ol=function(r,s,l){return TSe(this.c,r,s,l)},b.Pl=function(){return this},b.Ql=function(r,s){return aO(this.c,r,s)},b.Rl=function(r){return p(CH(this.c,this.b,r,!1),75).Jk()},b.Sl=function(r){return p(CH(this.c,this.b,r,!1),75).kd()},b.Tl=function(){return this.a},b.Ul=function(r){return!OI(this.c,r)},b.Vl=function(r,s){SH(this.c,r,s)},b.Wl=function(r){return n1t(this.c,r)},b.Xl=function(r){Ryt(this.c,r)},O(si,"FeatureMapUtil/FeatureFeatureMap",553),j(1257,1,Nse,Aat),b.Dk=function(r){return CH(this.b,this.a,-1,r)},b.Oj=function(){return!OI(this.b,this.a)},b.Wb=function(r){SH(this.b,this.a,r)},b.Ek=function(){iH(this.b,this.a)},O(si,"FeatureMapUtil/FeatureValue",1257);var TE,Bce,zce,AE,NLt,oP=pi(OU,"AnyType");j(670,63,Jg,SX),O(OU,"InvalidDatatypeValueException",670);var iG=pi(OU,HTt),aP=pi(OU,UTt),E8e=pi(OU,WTt),jLt,Ma,_8e,fw,DLt,ILt,OLt,LLt,PLt,RLt,$Lt,FLt,BLt,zLt,HLt,O3,ULt,L3,Zj,WLt,Zy,lP,cP,qLt,eD,tD;j(828,501,{109:1,94:1,93:1,57:1,52:1,100:1,841:1},O1e),b.Ih=function(r,s,l){switch(r){case 0:return l?(!this.c&&(this.c=new Ai(this,0)),this.c):(!this.c&&(this.c=new Ai(this,0)),this.c.b);case 1:return l?(!this.c&&(this.c=new Ai(this,0)),p(il(this.c,(Fr(),fw)),163)):(!this.c&&(this.c=new Ai(this,0)),p(p(il(this.c,(Fr(),fw)),163),219)).Tl();case 2:return l?(!this.b&&(this.b=new Ai(this,2)),this.b):(!this.b&&(this.b=new Ai(this,2)),this.b.b)}return Zu(this,r-mn(this.fi()),Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():this.fi(),r),s,l)},b.Rh=function(r,s,l){var d;switch(s){case 0:return!this.c&&(this.c=new Ai(this,0)),iO(this.c,r,l);case 1:return(!this.c&&(this.c=new Ai(this,0)),p(p(il(this.c,(Fr(),fw)),163),72)).Vk(r,l);case 2:return!this.b&&(this.b=new Ai(this,2)),iO(this.b,r,l)}return d=p(Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():this.fi(),s),69),d.uk().yk(this,O2e(this),s-mn(this.fi()),r,l)},b.Th=function(r){switch(r){case 0:return!!this.c&&this.c.i!=0;case 1:return!(!this.c&&(this.c=new Ai(this,0)),p(il(this.c,(Fr(),fw)),163)).dc();case 2:return!!this.b&&this.b.i!=0}return Qu(this,r-mn(this.fi()),Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():this.fi(),r))},b.$h=function(r,s){switch(r){case 0:!this.c&&(this.c=new Ai(this,0)),z8(this.c,s);return;case 1:(!this.c&&(this.c=new Ai(this,0)),p(p(il(this.c,(Fr(),fw)),163),219)).Wb(s);return;case 2:!this.b&&(this.b=new Ai(this,2)),z8(this.b,s);return}sd(this,r-mn(this.fi()),Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():this.fi(),r),s)},b.fi=function(){return Fr(),_8e},b.hi=function(r){switch(r){case 0:!this.c&&(this.c=new Ai(this,0)),Tn(this.c);return;case 1:(!this.c&&(this.c=new Ai(this,0)),p(il(this.c,(Fr(),fw)),163)).$b();return;case 2:!this.b&&(this.b=new Ai(this,2)),Tn(this.b);return}id(this,r-mn(this.fi()),Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():this.fi(),r))},b.Ib=function(){var r;return this.j&4?wf(this):(r=new Nd(wf(this)),r.a+=" (mixed: ",LA(r,this.c),r.a+=", anyAttribute: ",LA(r,this.b),r.a+=")",r.a)},O(Ji,"AnyTypeImpl",828),j(671,501,{109:1,94:1,93:1,57:1,52:1,100:1,2081:1,671:1},IXe),b.Ih=function(r,s,l){switch(r){case 0:return this.a;case 1:return this.b}return Zu(this,r-mn((Fr(),O3)),Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():O3,r),s,l)},b.Th=function(r){switch(r){case 0:return this.a!=null;case 1:return this.b!=null}return Qu(this,r-mn((Fr(),O3)),Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():O3,r))},b.$h=function(r,s){switch(r){case 0:xfn(this,Un(s));return;case 1:kfn(this,Un(s));return}sd(this,r-mn((Fr(),O3)),Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():O3,r),s)},b.fi=function(){return Fr(),O3},b.hi=function(r){switch(r){case 0:this.a=null;return;case 1:this.b=null;return}id(this,r-mn((Fr(),O3)),Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():O3,r))},b.Ib=function(){var r;return this.j&4?wf(this):(r=new Nd(wf(this)),r.a+=" (data: ",Mo(r,this.a),r.a+=", target: ",Mo(r,this.b),r.a+=")",r.a)},b.a=null,b.b=null,O(Ji,"ProcessingInstructionImpl",671),j(672,828,{109:1,94:1,93:1,57:1,52:1,100:1,841:1,2082:1,672:1},sit),b.Ih=function(r,s,l){switch(r){case 0:return l?(!this.c&&(this.c=new Ai(this,0)),this.c):(!this.c&&(this.c=new Ai(this,0)),this.c.b);case 1:return l?(!this.c&&(this.c=new Ai(this,0)),p(il(this.c,(Fr(),fw)),163)):(!this.c&&(this.c=new Ai(this,0)),p(p(il(this.c,(Fr(),fw)),163),219)).Tl();case 2:return l?(!this.b&&(this.b=new Ai(this,2)),this.b):(!this.b&&(this.b=new Ai(this,2)),this.b.b);case 3:return!this.c&&(this.c=new Ai(this,0)),Un(aO(this.c,(Fr(),Zj),!0));case 4:return tye(this.a,(!this.c&&(this.c=new Ai(this,0)),Un(aO(this.c,(Fr(),Zj),!0))));case 5:return this.a}return Zu(this,r-mn((Fr(),L3)),Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():L3,r),s,l)},b.Th=function(r){switch(r){case 0:return!!this.c&&this.c.i!=0;case 1:return!(!this.c&&(this.c=new Ai(this,0)),p(il(this.c,(Fr(),fw)),163)).dc();case 2:return!!this.b&&this.b.i!=0;case 3:return!this.c&&(this.c=new Ai(this,0)),Un(aO(this.c,(Fr(),Zj),!0))!=null;case 4:return tye(this.a,(!this.c&&(this.c=new Ai(this,0)),Un(aO(this.c,(Fr(),Zj),!0))))!=null;case 5:return!!this.a}return Qu(this,r-mn((Fr(),L3)),Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():L3,r))},b.$h=function(r,s){switch(r){case 0:!this.c&&(this.c=new Ai(this,0)),z8(this.c,s);return;case 1:(!this.c&&(this.c=new Ai(this,0)),p(p(il(this.c,(Fr(),fw)),163),219)).Wb(s);return;case 2:!this.b&&(this.b=new Ai(this,2)),z8(this.b,s);return;case 3:Hxe(this,Un(s));return;case 4:Hxe(this,eye(this.a,s));return;case 5:vfn(this,p(s,159));return}sd(this,r-mn((Fr(),L3)),Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():L3,r),s)},b.fi=function(){return Fr(),L3},b.hi=function(r){switch(r){case 0:!this.c&&(this.c=new Ai(this,0)),Tn(this.c);return;case 1:(!this.c&&(this.c=new Ai(this,0)),p(il(this.c,(Fr(),fw)),163)).$b();return;case 2:!this.b&&(this.b=new Ai(this,2)),Tn(this.b);return;case 3:!this.c&&(this.c=new Ai(this,0)),SH(this.c,(Fr(),Zj),null);return;case 4:Hxe(this,eye(this.a,null));return;case 5:this.a=null;return}id(this,r-mn((Fr(),L3)),Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():L3,r))},O(Ji,"SimpleAnyTypeImpl",672),j(673,501,{109:1,94:1,93:1,57:1,52:1,100:1,2083:1,673:1},oit),b.Ih=function(r,s,l){switch(r){case 0:return l?(!this.a&&(this.a=new Ai(this,0)),this.a):(!this.a&&(this.a=new Ai(this,0)),this.a.b);case 1:return l?(!this.b&&(this.b=new cc((Tt(),mo),ka,this,1)),this.b):(!this.b&&(this.b=new cc((Tt(),mo),ka,this,1)),rI(this.b));case 2:return l?(!this.c&&(this.c=new cc((Tt(),mo),ka,this,2)),this.c):(!this.c&&(this.c=new cc((Tt(),mo),ka,this,2)),rI(this.c));case 3:return!this.a&&(this.a=new Ai(this,0)),il(this.a,(Fr(),lP));case 4:return!this.a&&(this.a=new Ai(this,0)),il(this.a,(Fr(),cP));case 5:return!this.a&&(this.a=new Ai(this,0)),il(this.a,(Fr(),eD));case 6:return!this.a&&(this.a=new Ai(this,0)),il(this.a,(Fr(),tD))}return Zu(this,r-mn((Fr(),Zy)),Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():Zy,r),s,l)},b.Rh=function(r,s,l){var d;switch(s){case 0:return!this.a&&(this.a=new Ai(this,0)),iO(this.a,r,l);case 1:return!this.b&&(this.b=new cc((Tt(),mo),ka,this,1)),CF(this.b,r,l);case 2:return!this.c&&(this.c=new cc((Tt(),mo),ka,this,2)),CF(this.c,r,l);case 5:return!this.a&&(this.a=new Ai(this,0)),Cct(il(this.a,(Fr(),eD)),r,l)}return d=p(Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():(Fr(),Zy),s),69),d.uk().yk(this,O2e(this),s-mn((Fr(),Zy)),r,l)},b.Th=function(r){switch(r){case 0:return!!this.a&&this.a.i!=0;case 1:return!!this.b&&this.b.f!=0;case 2:return!!this.c&&this.c.f!=0;case 3:return!this.a&&(this.a=new Ai(this,0)),!iF(il(this.a,(Fr(),lP)));case 4:return!this.a&&(this.a=new Ai(this,0)),!iF(il(this.a,(Fr(),cP)));case 5:return!this.a&&(this.a=new Ai(this,0)),!iF(il(this.a,(Fr(),eD)));case 6:return!this.a&&(this.a=new Ai(this,0)),!iF(il(this.a,(Fr(),tD)))}return Qu(this,r-mn((Fr(),Zy)),Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():Zy,r))},b.$h=function(r,s){switch(r){case 0:!this.a&&(this.a=new Ai(this,0)),z8(this.a,s);return;case 1:!this.b&&(this.b=new cc((Tt(),mo),ka,this,1)),oz(this.b,s);return;case 2:!this.c&&(this.c=new cc((Tt(),mo),ka,this,2)),oz(this.c,s);return;case 3:!this.a&&(this.a=new Ai(this,0)),LC(il(this.a,(Fr(),lP))),!this.a&&(this.a=new Ai(this,0)),FA(il(this.a,lP),p(s,18));return;case 4:!this.a&&(this.a=new Ai(this,0)),LC(il(this.a,(Fr(),cP))),!this.a&&(this.a=new Ai(this,0)),FA(il(this.a,cP),p(s,18));return;case 5:!this.a&&(this.a=new Ai(this,0)),LC(il(this.a,(Fr(),eD))),!this.a&&(this.a=new Ai(this,0)),FA(il(this.a,eD),p(s,18));return;case 6:!this.a&&(this.a=new Ai(this,0)),LC(il(this.a,(Fr(),tD))),!this.a&&(this.a=new Ai(this,0)),FA(il(this.a,tD),p(s,18));return}sd(this,r-mn((Fr(),Zy)),Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():Zy,r),s)},b.fi=function(){return Fr(),Zy},b.hi=function(r){switch(r){case 0:!this.a&&(this.a=new Ai(this,0)),Tn(this.a);return;case 1:!this.b&&(this.b=new cc((Tt(),mo),ka,this,1)),this.b.c.$b();return;case 2:!this.c&&(this.c=new cc((Tt(),mo),ka,this,2)),this.c.c.$b();return;case 3:!this.a&&(this.a=new Ai(this,0)),LC(il(this.a,(Fr(),lP)));return;case 4:!this.a&&(this.a=new Ai(this,0)),LC(il(this.a,(Fr(),cP)));return;case 5:!this.a&&(this.a=new Ai(this,0)),LC(il(this.a,(Fr(),eD)));return;case 6:!this.a&&(this.a=new Ai(this,0)),LC(il(this.a,(Fr(),tD)));return}id(this,r-mn((Fr(),Zy)),Dt(this.j&2?(!this.k&&(this.k=new Bf),this.k).Lk():Zy,r))},b.Ib=function(){var r;return this.j&4?wf(this):(r=new Nd(wf(this)),r.a+=" (mixed: ",LA(r,this.a),r.a+=")",r.a)},O(Ji,"XMLTypeDocumentRootImpl",673),j(1990,710,{109:1,94:1,93:1,469:1,158:1,57:1,114:1,52:1,100:1,161:1,117:1,118:1,2084:1},CXe),b.oi=function(r,s){switch(r.fk()){case 7:case 8:case 9:case 10:case 16:case 22:case 23:case 24:case 25:case 26:case 32:case 33:case 34:case 36:case 37:case 44:case 45:case 50:case 51:case 53:case 55:case 56:case 57:case 58:case 60:case 61:case 4:return s==null?null:Yo(s);case 19:case 28:case 29:case 35:case 38:case 39:case 41:case 46:case 52:case 54:case 5:return Un(s);case 6:return a0n(p(s,195));case 12:case 47:case 49:case 11:return PCt(this,r,s);case 13:return s==null?null:oIn(p(s,247));case 15:case 14:return s==null?null:twn(ye(ke(s)));case 17:return _xt((Fr(),s));case 18:return _xt(s);case 21:case 20:return s==null?null:nwn(p(s,164).a);case 27:return o0n(p(s,195));case 30:return $yt((Fr(),p(s,16)));case 31:return $yt(p(s,16));case 40:return s0n((Fr(),s));case 42:return Txt((Fr(),s));case 43:return Txt(s);case 59:case 48:return i0n((Fr(),s));default:throw Z(new Kt(LT+r.ve()+Oy))}},b.pi=function(r){var s,l,d,h,m;switch(r.G==-1&&(r.G=(l=Tu(r),l?J0(l.si(),r):-1)),r.G){case 0:return s=new O1e,s;case 1:return d=new IXe,d;case 2:return h=new sit,h;case 3:return m=new oit,m;default:throw Z(new Kt(pse+r.zb+Oy))}},b.qi=function(r,s){var l,d,h,m,y,k,_,T,N,L,$,B,q,K,ne,fe;switch(r.fk()){case 5:case 52:case 4:return s;case 6:return S5n(s);case 8:case 7:return s==null?null:l4n(s);case 9:return s==null?null:fI(ju((d=al(s,!0),d.length>0&&(tn(0,d.length),d.charCodeAt(0)==43)?(tn(1,d.length+1),d.substr(1)):d),-128,127)<<24>>24);case 10:return s==null?null:fI(ju((h=al(s,!0),h.length>0&&(tn(0,h.length),h.charCodeAt(0)==43)?(tn(1,h.length+1),h.substr(1)):h),-128,127)<<24>>24);case 11:return Un(Ey(this,(Fr(),OLt),s));case 12:return Un(Ey(this,(Fr(),LLt),s));case 13:return s==null?null:new tbe(al(s,!0));case 15:case 14:return mNn(s);case 16:return Un(Ey(this,(Fr(),PLt),s));case 17:return Bwt((Fr(),s));case 18:return Bwt(s);case 28:case 29:case 35:case 38:case 39:case 41:case 54:case 19:return al(s,!0);case 21:case 20:return _Nn(s);case 22:return Un(Ey(this,(Fr(),RLt),s));case 23:return Un(Ey(this,(Fr(),$Lt),s));case 24:return Un(Ey(this,(Fr(),FLt),s));case 25:return Un(Ey(this,(Fr(),BLt),s));case 26:return Un(Ey(this,(Fr(),zLt),s));case 27:return g5n(s);case 30:return zwt((Fr(),s));case 31:return zwt(s);case 32:return s==null?null:Oe(ju((N=al(s,!0),N.length>0&&(tn(0,N.length),N.charCodeAt(0)==43)?(tn(1,N.length+1),N.substr(1)):N),Ds,xr));case 33:return s==null?null:new Wm((L=al(s,!0),L.length>0&&(tn(0,L.length),L.charCodeAt(0)==43)?(tn(1,L.length+1),L.substr(1)):L));case 34:return s==null?null:Oe(ju(($=al(s,!0),$.length>0&&(tn(0,$.length),$.charCodeAt(0)==43)?(tn(1,$.length+1),$.substr(1)):$),Ds,xr));case 36:return s==null?null:y2(AH((B=al(s,!0),B.length>0&&(tn(0,B.length),B.charCodeAt(0)==43)?(tn(1,B.length+1),B.substr(1)):B)));case 37:return s==null?null:y2(AH((q=al(s,!0),q.length>0&&(tn(0,q.length),q.charCodeAt(0)==43)?(tn(1,q.length+1),q.substr(1)):q)));case 40:return d_n((Fr(),s));case 42:return Hwt((Fr(),s));case 43:return Hwt(s);case 44:return s==null?null:new Wm((K=al(s,!0),K.length>0&&(tn(0,K.length),K.charCodeAt(0)==43)?(tn(1,K.length+1),K.substr(1)):K));case 45:return s==null?null:new Wm((ne=al(s,!0),ne.length>0&&(tn(0,ne.length),ne.charCodeAt(0)==43)?(tn(1,ne.length+1),ne.substr(1)):ne));case 46:return al(s,!1);case 47:return Un(Ey(this,(Fr(),HLt),s));case 59:case 48:return u_n((Fr(),s));case 49:return Un(Ey(this,(Fr(),ULt),s));case 50:return s==null?null:P_(ju((fe=al(s,!0),fe.length>0&&(tn(0,fe.length),fe.charCodeAt(0)==43)?(tn(1,fe.length+1),fe.substr(1)):fe),NU,32767)<<16>>16);case 51:return s==null?null:P_(ju((m=al(s,!0),m.length>0&&(tn(0,m.length),m.charCodeAt(0)==43)?(tn(1,m.length+1),m.substr(1)):m),NU,32767)<<16>>16);case 53:return Un(Ey(this,(Fr(),WLt),s));case 55:return s==null?null:P_(ju((y=al(s,!0),y.length>0&&(tn(0,y.length),y.charCodeAt(0)==43)?(tn(1,y.length+1),y.substr(1)):y),NU,32767)<<16>>16);case 56:return s==null?null:P_(ju((k=al(s,!0),k.length>0&&(tn(0,k.length),k.charCodeAt(0)==43)?(tn(1,k.length+1),k.substr(1)):k),NU,32767)<<16>>16);case 57:return s==null?null:y2(AH((_=al(s,!0),_.length>0&&(tn(0,_.length),_.charCodeAt(0)==43)?(tn(1,_.length+1),_.substr(1)):_)));case 58:return s==null?null:y2(AH((T=al(s,!0),T.length>0&&(tn(0,T.length),T.charCodeAt(0)==43)?(tn(1,T.length+1),T.substr(1)):T)));case 60:return s==null?null:Oe(ju((l=al(s,!0),l.length>0&&(tn(0,l.length),l.charCodeAt(0)==43)?(tn(1,l.length+1),l.substr(1)):l),Ds,xr));case 61:return s==null?null:Oe(ju(al(s,!0),Ds,xr));default:throw Z(new Kt(LT+r.ve()+Oy))}};var GLt,T8e,VLt,A8e;O(Ji,"XMLTypeFactoryImpl",1990),j(582,184,{109:1,94:1,93:1,158:1,197:1,57:1,241:1,114:1,52:1,100:1,161:1,184:1,117:1,118:1,680:1,2006:1,582:1},nft),b.N=!1,b.O=!1;var KLt=!1;O(Ji,"XMLTypePackageImpl",582),j(1923,1,{835:1},SXe),b.Ik=function(){return bSe(),rPt},O(Ji,"XMLTypePackageImpl/1",1923),j(1932,1,fr,EXe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/10",1932),j(1933,1,fr,_Xe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/11",1933),j(1934,1,fr,TXe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/12",1934),j(1935,1,fr,AXe),b.dk=function(r){return Ux(r)},b.ek=function(r){return Ee(Hi,Fe,346,r,7,1)},O(Ji,"XMLTypePackageImpl/13",1935),j(1936,1,fr,MXe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/14",1936),j(1937,1,fr,NXe),b.dk=function(r){return me(r,16)},b.ek=function(r){return Ee(Lu,O2,16,r,0,1)},O(Ji,"XMLTypePackageImpl/15",1937),j(1938,1,fr,jXe),b.dk=function(r){return me(r,16)},b.ek=function(r){return Ee(Lu,O2,16,r,0,1)},O(Ji,"XMLTypePackageImpl/16",1938),j(1939,1,fr,DXe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/17",1939),j(1940,1,fr,OXe),b.dk=function(r){return me(r,164)},b.ek=function(r){return Ee(UT,Fe,164,r,0,1)},O(Ji,"XMLTypePackageImpl/18",1940),j(1941,1,fr,LXe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/19",1941),j(1924,1,fr,PXe),b.dk=function(r){return me(r,841)},b.ek=function(r){return Ee(oP,Pt,841,r,0,1)},O(Ji,"XMLTypePackageImpl/2",1924),j(1942,1,fr,RXe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/20",1942),j(1943,1,fr,$Xe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/21",1943),j(1944,1,fr,FXe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/22",1944),j(1945,1,fr,BXe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/23",1945),j(1946,1,fr,zXe),b.dk=function(r){return me(r,195)},b.ek=function(r){return Ee(gc,Fe,195,r,0,2)},O(Ji,"XMLTypePackageImpl/24",1946),j(1947,1,fr,HXe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/25",1947),j(1948,1,fr,UXe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/26",1948),j(1949,1,fr,WXe),b.dk=function(r){return me(r,16)},b.ek=function(r){return Ee(Lu,O2,16,r,0,1)},O(Ji,"XMLTypePackageImpl/27",1949),j(1950,1,fr,qXe),b.dk=function(r){return me(r,16)},b.ek=function(r){return Ee(Lu,O2,16,r,0,1)},O(Ji,"XMLTypePackageImpl/28",1950),j(1951,1,fr,GXe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/29",1951),j(1925,1,fr,VXe),b.dk=function(r){return me(r,671)},b.ek=function(r){return Ee(iG,Pt,2081,r,0,1)},O(Ji,"XMLTypePackageImpl/3",1925),j(1952,1,fr,KXe),b.dk=function(r){return me(r,15)},b.ek=function(r){return Ee(Qi,Fe,15,r,0,1)},O(Ji,"XMLTypePackageImpl/30",1952),j(1953,1,fr,JXe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/31",1953),j(1954,1,fr,YXe),b.dk=function(r){return me(r,190)},b.ek=function(r){return Ee(Py,Fe,190,r,0,1)},O(Ji,"XMLTypePackageImpl/32",1954),j(1955,1,fr,XXe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/33",1955),j(1956,1,fr,QXe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/34",1956),j(1957,1,fr,ZXe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/35",1957),j(1958,1,fr,eQe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/36",1958),j(1959,1,fr,tQe),b.dk=function(r){return me(r,16)},b.ek=function(r){return Ee(Lu,O2,16,r,0,1)},O(Ji,"XMLTypePackageImpl/37",1959),j(1960,1,fr,nQe),b.dk=function(r){return me(r,16)},b.ek=function(r){return Ee(Lu,O2,16,r,0,1)},O(Ji,"XMLTypePackageImpl/38",1960),j(1961,1,fr,rQe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/39",1961),j(1926,1,fr,iQe),b.dk=function(r){return me(r,672)},b.ek=function(r){return Ee(aP,Pt,2082,r,0,1)},O(Ji,"XMLTypePackageImpl/4",1926),j(1962,1,fr,sQe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/40",1962),j(1963,1,fr,oQe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/41",1963),j(1964,1,fr,aQe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/42",1964),j(1965,1,fr,lQe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/43",1965),j(1966,1,fr,cQe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/44",1966),j(1967,1,fr,uQe),b.dk=function(r){return me(r,191)},b.ek=function(r){return Ee(Ry,Fe,191,r,0,1)},O(Ji,"XMLTypePackageImpl/45",1967),j(1968,1,fr,dQe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/46",1968),j(1969,1,fr,fQe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/47",1969),j(1970,1,fr,hQe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/48",1970),j(1971,1,fr,pQe),b.dk=function(r){return me(r,191)},b.ek=function(r){return Ee(Ry,Fe,191,r,0,1)},O(Ji,"XMLTypePackageImpl/49",1971),j(1927,1,fr,gQe),b.dk=function(r){return me(r,673)},b.ek=function(r){return Ee(E8e,Pt,2083,r,0,1)},O(Ji,"XMLTypePackageImpl/5",1927),j(1972,1,fr,mQe),b.dk=function(r){return me(r,190)},b.ek=function(r){return Ee(Py,Fe,190,r,0,1)},O(Ji,"XMLTypePackageImpl/50",1972),j(1973,1,fr,bQe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/51",1973),j(1974,1,fr,wQe),b.dk=function(r){return me(r,15)},b.ek=function(r){return Ee(Qi,Fe,15,r,0,1)},O(Ji,"XMLTypePackageImpl/52",1974),j(1928,1,fr,yQe),b.dk=function(r){return Cs(r)},b.ek=function(r){return Ee(Ye,Fe,2,r,6,1)},O(Ji,"XMLTypePackageImpl/6",1928),j(1929,1,fr,xQe),b.dk=function(r){return me(r,195)},b.ek=function(r){return Ee(gc,Fe,195,r,0,2)},O(Ji,"XMLTypePackageImpl/7",1929),j(1930,1,fr,vQe),b.dk=function(r){return Hx(r)},b.ek=function(r){return Ee(Ci,Fe,473,r,8,1)},O(Ji,"XMLTypePackageImpl/8",1930),j(1931,1,fr,kQe),b.dk=function(r){return me(r,221)},b.ek=function(r){return Ee(XS,Fe,221,r,0,1)},O(Ji,"XMLTypePackageImpl/9",1931);var qh,mm,nD,sG,le;j(53,63,Jg,Gn),O(nm,"RegEx/ParseException",53),j(820,1,{},Fme),b._l=function(r){return r<this.j&&Us(this.i,r)==63},b.am=function(){var r,s,l,d,h;if(this.c!=10)throw Z(new Gn(Jn((Hn(),kU))));switch(r=this.a,r){case 101:r=27;break;case 102:r=12;break;case 110:r=10;break;case 114:r=13;break;case 116:r=9;break;case 120:if(Cr(this),this.c!=0)throw Z(new Gn(Jn((Hn(),tm))));if(this.a==123){h=0,l=0;do{if(Cr(this),this.c!=0)throw Z(new Gn(Jn((Hn(),tm))));if((h=Rb(this.a))<0)break;if(l>l*16)throw Z(new Gn(Jn((Hn(),tTt))));l=l*16+h}while(!0);if(this.a!=125)throw Z(new Gn(Jn((Hn(),nTt))));if(l>BT)throw Z(new Gn(Jn((Hn(),rTt))));r=l}else{if(h=0,this.c!=0||(h=Rb(this.a))<0)throw Z(new Gn(Jn((Hn(),tm))));if(l=h,Cr(this),this.c!=0||(h=Rb(this.a))<0)throw Z(new Gn(Jn((Hn(),tm))));l=l*16+h,r=l}break;case 117:if(d=0,Cr(this),this.c!=0||(d=Rb(this.a))<0)throw Z(new Gn(Jn((Hn(),tm))));if(s=d,Cr(this),this.c!=0||(d=Rb(this.a))<0)throw Z(new Gn(Jn((Hn(),tm))));if(s=s*16+d,Cr(this),this.c!=0||(d=Rb(this.a))<0)throw Z(new Gn(Jn((Hn(),tm))));if(s=s*16+d,Cr(this),this.c!=0||(d=Rb(this.a))<0)throw Z(new Gn(Jn((Hn(),tm))));s=s*16+d,r=s;break;case 118:if(Cr(this),this.c!=0||(d=Rb(this.a))<0)throw Z(new Gn(Jn((Hn(),tm))));if(s=d,Cr(this),this.c!=0||(d=Rb(this.a))<0)throw Z(new Gn(Jn((Hn(),tm))));if(s=s*16+d,Cr(this),this.c!=0||(d=Rb(this.a))<0)throw Z(new Gn(Jn((Hn(),tm))));if(s=s*16+d,Cr(this),this.c!=0||(d=Rb(this.a))<0)throw Z(new Gn(Jn((Hn(),tm))));if(s=s*16+d,Cr(this),this.c!=0||(d=Rb(this.a))<0)throw Z(new Gn(Jn((Hn(),tm))));if(s=s*16+d,Cr(this),this.c!=0||(d=Rb(this.a))<0)throw Z(new Gn(Jn((Hn(),tm))));if(s=s*16+d,s>BT)throw Z(new Gn(Jn((Hn(),"parser.descappe.4"))));r=s;break;case 65:case 90:case 122:throw Z(new Gn(Jn((Hn(),iTt))))}return r},b.bm=function(r){var s,l;switch(r){case 100:l=(this.e&32)==32?f1("Nd",!0):(Sr(),oG);break;case 68:l=(this.e&32)==32?f1("Nd",!1):(Sr(),O8e);break;case 119:l=(this.e&32)==32?f1("IsWord",!0):(Sr(),_4);break;case 87:l=(this.e&32)==32?f1("IsWord",!1):(Sr(),P8e);break;case 115:l=(this.e&32)==32?f1("IsSpace",!0):(Sr(),ME);break;case 83:l=(this.e&32)==32?f1("IsSpace",!1):(Sr(),L8e);break;default:throw Z(new ea((s=r,i4t+s.toString(16))))}return l},b.cm=function(r){var s,l,d,h,m,y,k,_,T,N,L,$;for(this.b=1,Cr(this),s=null,this.c==0&&this.a==94?(Cr(this),r?N=(Sr(),Sr(),new Eu(5)):(s=(Sr(),Sr(),new Eu(4)),ol(s,0,BT),N=new Eu(4))):N=(Sr(),Sr(),new Eu(4)),h=!0;($=this.c)!=1&&!($==0&&this.a==93&&!h);){if(h=!1,l=this.a,d=!1,$==10)switch(l){case 100:case 68:case 119:case 87:case 115:case 83:N2(N,this.bm(l)),d=!0;break;case 105:case 73:case 99:case 67:l=this.sm(N,l),l<0&&(d=!0);break;case 112:case 80:if(L=uCe(this,l),!L)throw Z(new Gn(Jn((Hn(),Tse))));N2(N,L),d=!0;break;default:l=this.am()}else if($==20){if(y=Q5(this.i,58,this.d),y<0)throw Z(new Gn(Jn((Hn(),cTe))));if(k=!0,Us(this.i,this.d)==94&&(++this.d,k=!1),m=Dd(this.i,this.d,y),_=c0t(m,k,(this.e&512)==512),!_)throw Z(new Gn(Jn((Hn(),Y_t))));if(N2(N,_),d=!0,y+1>=this.j||Us(this.i,y+1)!=93)throw Z(new Gn(Jn((Hn(),cTe))));this.d=y+2}if(Cr(this),!d)if(this.c!=0||this.a!=45)ol(N,l,l);else{if(Cr(this),($=this.c)==1)throw Z(new Gn(Jn((Hn(),CU))));$==0&&this.a==93?(ol(N,l,l),ol(N,45,45)):(T=this.a,$==10&&(T=this.am()),Cr(this),ol(N,l,T))}(this.e&vf)==vf&&this.c==0&&this.a==44&&Cr(this)}if(this.c==1)throw Z(new Gn(Jn((Hn(),CU))));return s&&(rN(s,N),N=s),Hk(N),tN(N),this.b=0,Cr(this),N},b.dm=function(){var r,s,l,d;for(l=this.cm(!1);(d=this.c)!=7;)if(r=this.a,d==0&&(r==45||r==38)||d==4){if(Cr(this),this.c!=9)throw Z(new Gn(Jn((Hn(),Q_t))));if(s=this.cm(!1),d==4)N2(l,s);else if(r==45)rN(l,s);else if(r==38)DCt(l,s);else throw Z(new ea("ASSERT"))}else throw Z(new Gn(Jn((Hn(),Z_t))));return Cr(this),l},b.em=function(){var r,s;return r=this.a-48,s=(Sr(),Sr(),new RZ(12,null,r)),!this.g&&(this.g=new h$),f$(this.g,new x1e(r)),Cr(this),s},b.fm=function(){return Cr(this),Sr(),XLt},b.gm=function(){return Cr(this),Sr(),YLt},b.hm=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.im=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.jm=function(){return Cr(this),FCn()},b.km=function(){return Cr(this),Sr(),ZLt},b.lm=function(){return Cr(this),Sr(),tPt},b.mm=function(){var r;if(this.d>=this.j||((r=Us(this.i,this.d++))&65504)!=64)throw Z(new Gn(Jn((Hn(),V_t))));return Cr(this),Sr(),Sr(),new Fp(0,r-64)},b.nm=function(){return Cr(this),l8n()},b.om=function(){return Cr(this),Sr(),nPt},b.pm=function(){var r;return r=(Sr(),Sr(),new Fp(0,105)),Cr(this),r},b.qm=function(){return Cr(this),Sr(),ePt},b.rm=function(){return Cr(this),Sr(),QLt},b.sm=function(r,s){return this.am()},b.tm=function(){return Cr(this),Sr(),D8e},b.um=function(){var r,s,l,d,h;if(this.d+1>=this.j)throw Z(new Gn(Jn((Hn(),W_t))));if(d=-1,s=null,r=Us(this.i,this.d),49<=r&&r<=57){if(d=r-48,!this.g&&(this.g=new h$),f$(this.g,new x1e(d)),++this.d,Us(this.i,this.d)!=41)throw Z(new Gn(Jn((Hn(),Kb))));++this.d}else switch(r==63&&--this.d,Cr(this),s=USe(this),s.e){case 20:case 21:case 22:case 23:break;case 8:if(this.c!=7)throw Z(new Gn(Jn((Hn(),Kb))));break;default:throw Z(new Gn(Jn((Hn(),q_t))))}if(Cr(this),h=my(this),l=null,h.e==2){if(h.Nm()!=2)throw Z(new Gn(Jn((Hn(),G_t))));l=h.Jm(1),h=h.Jm(0)}if(this.c!=7)throw Z(new Gn(Jn((Hn(),Kb))));return Cr(this),Sr(),Sr(),new emt(d,s,h,l)},b.vm=function(){return Cr(this),Sr(),I8e},b.wm=function(){var r;if(Cr(this),r=YF(24,my(this)),this.c!=7)throw Z(new Gn(Jn((Hn(),Kb))));return Cr(this),r},b.xm=function(){var r;if(Cr(this),r=YF(20,my(this)),this.c!=7)throw Z(new Gn(Jn((Hn(),Kb))));return Cr(this),r},b.ym=function(){var r;if(Cr(this),r=YF(22,my(this)),this.c!=7)throw Z(new Gn(Jn((Hn(),Kb))));return Cr(this),r},b.zm=function(){var r,s,l,d,h;for(r=0,l=0,s=-1;this.d<this.j&&(s=Us(this.i,this.d),h=mCe(s),h!=0);)r|=h,++this.d;if(this.d>=this.j)throw Z(new Gn(Jn((Hn(),aTe))));if(s==45){for(++this.d;this.d<this.j&&(s=Us(this.i,this.d),h=mCe(s),h!=0);)l|=h,++this.d;if(this.d>=this.j)throw Z(new Gn(Jn((Hn(),aTe))))}if(s==58){if(++this.d,Cr(this),d=zdt(my(this),r,l),this.c!=7)throw Z(new Gn(Jn((Hn(),Kb))));Cr(this)}else if(s==41)++this.d,Cr(this),d=zdt(my(this),r,l);else throw Z(new Gn(Jn((Hn(),U_t))));return d},b.Am=function(){var r;if(Cr(this),r=YF(21,my(this)),this.c!=7)throw Z(new Gn(Jn((Hn(),Kb))));return Cr(this),r},b.Bm=function(){var r;if(Cr(this),r=YF(23,my(this)),this.c!=7)throw Z(new Gn(Jn((Hn(),Kb))));return Cr(this),r},b.Cm=function(){var r,s;if(Cr(this),r=this.f++,s=fZ(my(this),r),this.c!=7)throw Z(new Gn(Jn((Hn(),Kb))));return Cr(this),s},b.Dm=function(){var r;if(Cr(this),r=fZ(my(this),0),this.c!=7)throw Z(new Gn(Jn((Hn(),Kb))));return Cr(this),r},b.Em=function(r){return Cr(this),this.c==5?(Cr(this),HF(r,(Sr(),Sr(),new a2(9,r)))):HF(r,(Sr(),Sr(),new a2(3,r)))},b.Fm=function(r){var s;return Cr(this),s=(Sr(),Sr(),new $A(2)),this.c==5?(Cr(this),Bb(s,iD),Bb(s,r)):(Bb(s,r),Bb(s,iD)),s},b.Gm=function(r){return Cr(this),this.c==5?(Cr(this),Sr(),Sr(),new a2(9,r)):(Sr(),Sr(),new a2(3,r))},b.a=0,b.b=0,b.c=0,b.d=0,b.e=0,b.f=1,b.g=null,b.j=0,O(nm,"RegEx/RegexParser",820),j(1910,820,{},ait),b._l=function(r){return!1},b.am=function(){return KCe(this)},b.bm=function(r){return sT(r)},b.cm=function(r){return ESt(this)},b.dm=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.em=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.fm=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.gm=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.hm=function(){return Cr(this),sT(67)},b.im=function(){return Cr(this),sT(73)},b.jm=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.km=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.lm=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.mm=function(){return Cr(this),sT(99)},b.nm=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.om=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.pm=function(){return Cr(this),sT(105)},b.qm=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.rm=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.sm=function(r,s){return N2(r,sT(s)),-1},b.tm=function(){return Cr(this),Sr(),Sr(),new Fp(0,94)},b.um=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.vm=function(){return Cr(this),Sr(),Sr(),new Fp(0,36)},b.wm=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.xm=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.ym=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.zm=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.Am=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.Bm=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.Cm=function(){var r;if(Cr(this),r=fZ(my(this),0),this.c!=7)throw Z(new Gn(Jn((Hn(),Kb))));return Cr(this),r},b.Dm=function(){throw Z(new Gn(Jn((Hn(),cd))))},b.Em=function(r){return Cr(this),HF(r,(Sr(),Sr(),new a2(3,r)))},b.Fm=function(r){var s;return Cr(this),s=(Sr(),Sr(),new $A(2)),Bb(s,r),Bb(s,iD),s},b.Gm=function(r){return Cr(this),Sr(),Sr(),new a2(3,r)};var P3=null,S4=null;O(nm,"RegEx/ParserForXMLSchema",1910),j(121,1,zT,Hw),b.Hm=function(r){throw Z(new ea("Not supported."))},b.Im=function(){return-1},b.Jm=function(r){return null},b.Km=function(){return null},b.Lm=function(r){},b.Mm=function(r){},b.Nm=function(){return 0},b.Ib=function(){return this.Om(0)},b.Om=function(r){return this.e==11?".":""},b.e=0;var M8e,E4,rD,JLt,N8e,Cv=null,oG,Hce=null,j8e,iD,Uce=null,D8e,I8e,O8e,L8e,P8e,YLt,ME,XLt,QLt,ZLt,ePt,_4,tPt,nPt,v7n=O(nm,"RegEx/Token",121);j(137,121,{3:1,137:1,121:1},Eu),b.Om=function(r){var s,l,d;if(this.e==4)if(this==j8e)l=".";else if(this==oG)l="\\d";else if(this==_4)l="\\w";else if(this==ME)l="\\s";else{for(d=new j0,d.a+="[",s=0;s<this.b.length;s+=2)r&vf&&s>0&&(d.a+=","),this.b[s]===this.b[s+1]?Mo(d,oO(this.b[s])):(Mo(d,oO(this.b[s])),d.a+="-",Mo(d,oO(this.b[s+1])));d.a+="]",l=d.a}else if(this==O8e)l="\\D";else if(this==P8e)l="\\W";else if(this==L8e)l="\\S";else{for(d=new j0,d.a+="[^",s=0;s<this.b.length;s+=2)r&vf&&s>0&&(d.a+=","),this.b[s]===this.b[s+1]?Mo(d,oO(this.b[s])):(Mo(d,oO(this.b[s])),d.a+="-",Mo(d,oO(this.b[s+1])));d.a+="]",l=d.a}return l},b.a=!1,b.c=!1,O(nm,"RegEx/RangeToken",137),j(580,1,{580:1},x1e),b.a=0,O(nm,"RegEx/RegexParser/ReferencePosition",580),j(579,1,{3:1,579:1},Ust),b.Fb=function(r){var s;return r==null||!me(r,579)?!1:(s=p(r,579),xt(this.b,s.b)&&this.a==s.a)},b.Hb=function(){return W0(this.b+"/"+zCe(this.a))},b.Ib=function(){return this.c.Om(this.a)},b.a=0,O(nm,"RegEx/RegularExpression",579),j(228,121,zT,Fp),b.Im=function(){return this.a},b.Om=function(r){var s,l,d;switch(this.e){case 0:switch(this.a){case 124:case 42:case 43:case 63:case 40:case 41:case 46:case 91:case 123:case 92:d="\\"+$Q(this.a&Ki);break;case 12:d="\\f";break;case 10:d="\\n";break;case 13:d="\\r";break;case 9:d="\\t";break;case 27:d="\\e";break;default:this.a>=ho?(l=(s=this.a>>>0,"0"+s.toString(16)),d="\\v"+Dd(l,l.length-6,l.length)):d=""+$Q(this.a&Ki)}break;case 8:this==D8e||this==I8e?d=""+$Q(this.a&Ki):d="\\"+$Q(this.a&Ki);break;default:d=null}return d},b.a=0,O(nm,"RegEx/Token/CharToken",228),j(322,121,zT,a2),b.Jm=function(r){return this.a},b.Lm=function(r){this.b=r},b.Mm=function(r){this.c=r},b.Nm=function(){return 1},b.Om=function(r){var s;if(this.e==3)if(this.c<0&&this.b<0)s=this.a.Om(r)+"*";else if(this.c==this.b)s=this.a.Om(r)+"{"+this.c+"}";else if(this.c>=0&&this.b>=0)s=this.a.Om(r)+"{"+this.c+","+this.b+"}";else if(this.c>=0&&this.b<0)s=this.a.Om(r)+"{"+this.c+",}";else throw Z(new ea("Token#toString(): CLOSURE "+this.c+yl+this.b));else if(this.c<0&&this.b<0)s=this.a.Om(r)+"*?";else if(this.c==this.b)s=this.a.Om(r)+"{"+this.c+"}?";else if(this.c>=0&&this.b>=0)s=this.a.Om(r)+"{"+this.c+","+this.b+"}?";else if(this.c>=0&&this.b<0)s=this.a.Om(r)+"{"+this.c+",}?";else throw Z(new ea("Token#toString(): NONGREEDYCLOSURE "+this.c+yl+this.b));return s},b.b=0,b.c=0,O(nm,"RegEx/Token/ClosureToken",322),j(821,121,zT,Zye),b.Jm=function(r){return r==0?this.a:this.b},b.Nm=function(){return 2},b.Om=function(r){var s;return this.b.e==3&&this.b.Jm(0)==this.a?s=this.a.Om(r)+"+":this.b.e==9&&this.b.Jm(0)==this.a?s=this.a.Om(r)+"+?":s=this.a.Om(r)+(""+this.b.Om(r)),s},O(nm,"RegEx/Token/ConcatToken",821),j(1908,121,zT,emt),b.Jm=function(r){if(r==0)return this.d;if(r==1)return this.b;throw Z(new ea("Internal Error: "+r))},b.Nm=function(){return this.b?2:1},b.Om=function(r){var s;return this.c>0?s="(?("+this.c+")":this.a.e==8?s="(?("+this.a+")":s="(?"+this.a,this.b?s+=this.d+"|"+this.b+")":s+=this.d+")",s},b.c=0,O(nm,"RegEx/Token/ConditionToken",1908),j(1909,121,zT,$ht),b.Jm=function(r){return this.b},b.Nm=function(){return 1},b.Om=function(r){return"(?"+(this.a==0?"":zCe(this.a))+(this.c==0?"":zCe(this.c))+":"+this.b.Om(r)+")"},b.a=0,b.c=0,O(nm,"RegEx/Token/ModifierToken",1909),j(822,121,zT,cxe),b.Jm=function(r){return this.a},b.Nm=function(){return 1},b.Om=function(r){var s;switch(s=null,this.e){case 6:this.b==0?s="(?:"+this.a.Om(r)+")":s="("+this.a.Om(r)+")";break;case 20:s="(?="+this.a.Om(r)+")";break;case 21:s="(?!"+this.a.Om(r)+")";break;case 22:s="(?<="+this.a.Om(r)+")";break;case 23:s="(?<!"+this.a.Om(r)+")";break;case 24:s="(?>"+this.a.Om(r)+")"}return s},b.b=0,O(nm,"RegEx/Token/ParenToken",822),j(517,121,{3:1,121:1,517:1},RZ),b.Km=function(){return this.b},b.Om=function(r){return this.e==12?"\\"+this.a:nNn(this.b)},b.a=0,O(nm,"RegEx/Token/StringToken",517),j(466,121,zT,$A),b.Hm=function(r){Bb(this,r)},b.Jm=function(r){return p(ey(this.a,r),121)},b.Nm=function(){return this.a?this.a.a.c.length:0},b.Om=function(r){var s,l,d,h,m;if(this.e==1){if(this.a.a.c.length==2)s=p(ey(this.a,0),121),l=p(ey(this.a,1),121),l.e==3&&l.Jm(0)==s?h=s.Om(r)+"+":l.e==9&&l.Jm(0)==s?h=s.Om(r)+"+?":h=s.Om(r)+(""+l.Om(r));else{for(m=new j0,d=0;d<this.a.a.c.length;d++)Mo(m,p(ey(this.a,d),121).Om(r));h=m.a}return h}if(this.a.a.c.length==2&&p(ey(this.a,1),121).e==7)h=p(ey(this.a,0),121).Om(r)+"?";else if(this.a.a.c.length==2&&p(ey(this.a,0),121).e==7)h=p(ey(this.a,1),121).Om(r)+"??";else{for(m=new j0,Mo(m,p(ey(this.a,0),121).Om(r)),d=1;d<this.a.a.c.length;d++)m.a+="|",Mo(m,p(ey(this.a,d),121).Om(r));h=m.a}return h},O(nm,"RegEx/Token/UnionToken",466),j(514,1,{589:1},t8),b.Ib=function(){return this.a.b},O(l4t,"XMLTypeUtil/PatternMatcherImpl",514),j(1673,1488,{},CQe);var rPt;O(l4t,"XMLTypeValidator",1673),j(270,1,Kp,wb),b.Ic=function(r){Ws(this,r)},b.Jc=function(){return(this.b-this.a)*this.c<0?z1:new qm(this)},b.a=0,b.b=0,b.c=0;var z1;O(ATe,"ExclusiveRange",270),j(1054,1,Vp,SQe),b.Rb=function(r){p(r,15),Gpn()},b.Nb=function(r){Bs(this,r)},b.Pb=function(){return Lhn()},b.Ub=function(){return Phn()},b.Wb=function(r){p(r,15),Kpn()},b.Ob=function(){return!1},b.Sb=function(){return!1},b.Tb=function(){return-1},b.Vb=function(){return-1},b.Qb=function(){throw Z(new M0(d4t))},O(ATe,"ExclusiveRange/1",1054),j(259,1,Vp,qm),b.Rb=function(r){p(r,15),Vpn()},b.Nb=function(r){Bs(this,r)},b.Pb=function(){return lSn(this)},b.Ub=function(){return lkn(this)},b.Wb=function(r){p(r,15),Jpn()},b.Ob=function(){return this.c.c<0?this.a>=this.c.b:this.a<=this.c.b},b.Sb=function(){return this.b>0},b.Tb=function(){return this.b},b.Vb=function(){return this.b-1},b.Qb=function(){throw Z(new M0(d4t))},b.a=0,b.b=0,O(ATe,"ExclusiveRange/RangeIterator",259);var gd=u_(SU,"C"),Wn=u_(jN,"I"),Zl=u_($S,"Z"),ex=u_(DN,"J"),gc=u_(AN,"B"),As=u_(MN,"D"),Sv=u_(NN,"F"),R3=u_(IN,"S"),k7n=pi("org.eclipse.elk.core.labels","ILabelManager"),R8e=pi(uo,"DiagnosticChain"),$8e=pi(FTt,"ResourceSet"),F8e=O(uo,"InvocationTargetException",null),iPt=(y$(),hvn),sPt=sPt=GTn;u3n(Pfn),_3n("permProps",[[["locale","default"],[f4t,"gecko1_8"]],[["locale","default"],[f4t,"safari"]]]),sPt(null,"elk",null)}).call(this)}).call(this,typeof t9<"u"?t9:typeof self<"u"?self:typeof window<"u"?window:{})},{}],3:[function(i,o,a){function c(D){"@babel/helpers - typeof";return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(P){return typeof P}:function(P){return P&&typeof Symbol=="function"&&P.constructor===Symbol&&P!==Symbol.prototype?"symbol":typeof P},c(D)}function u(D,P,R){return Object.defineProperty(D,"prototype",{writable:!1}),D}function f(D,P){if(!(D instanceof P))throw new TypeError("Cannot call a class as a function")}function g(D,P,R){return P=C(P),w(D,v()?Reflect.construct(P,R||[],C(D).constructor):P.apply(D,R))}function w(D,P){if(P&&(c(P)=="object"||typeof P=="function"))return P;if(P!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return x(D)}function x(D){if(D===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function v(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(v=function(){return!!D})()}function C(D){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(P){return P.__proto__||Object.getPrototypeOf(P)},C(D)}function E(D,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function");D.prototype=Object.create(P&&P.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),P&&A(D,P)}function A(D,P){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(R,z){return R.__proto__=z,R},A(D,P)}var M=i("./elk-api.js").default,I=function(D){function P(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};f(this,P);var z=Object.assign({},R),U=!1;try{i.resolve("web-worker"),U=!0}catch{}if(R.workerUrl)if(U){var W=i("web-worker");z.workerFactory=function(te){return new W(te)}}else console.warn(`Web worker requested but 'web-worker' package not installed.
|
|
1282
1282
|
Consider installing the package or pass your own 'workerFactory' to ELK's constructor.
|
|
1283
|
-
... Falling back to non-web worker version.`);if(!z.workerFactory){var G=i("./elk-worker.min.js"),Y=G.Worker;z.workerFactory=function(te){return new Y(te)}}return g(this,P,[z])}return E(P,D),u(P)}(M);Object.defineProperty(o.exports,"__esModule",{value:!0}),o.exports=I,I.default=I},{"./elk-api.js":1,"./elk-worker.min.js":2,"web-worker":4}],4:[function(i,o,a){var c=typeof Worker<"u"?Worker:void 0;o.exports=c},{}]},{},[3])(3)})})(jdn);var JHr=jdn.exports;const YHr=S5(JHr),XHr=210,ZG=72,QHr={branch:86,expression:ZG,parallel:ZG,join:ZG,end:ZG,error:ZG,approval:96};function Ddn(t){return QHr[t]??122}const Idn="#64748b",ZHr=new YHr,eUr={type:_J.ArrowClosed,color:Idn,width:16,height:16};function tUr(t){const n=new Set(t.map(c=>c.id)),i=new Map(t.map((c,u)=>[c.id,u])),o=[],a=(c,u,f)=>{if(!u||!n.has(u))return;const g=`${c}->${u}${f?`:${f}`:""}`;if(o.some(C=>C.id===g))return;const w=i.get(c)??0,v=(i.get(u)??0)<w;o.push({id:g,source:c,target:u,type:"workflowRoute",label:f,data:{...f?{label:f}:{},...v?{backEdge:!0}:{}},markerEnd:eUr,style:{stroke:v?"#94a3b8":Idn,strokeWidth:v?1.5:1.7,...v?{strokeDasharray:"6 5"}:{}},labelBgPadding:[8,4],labelBgBorderRadius:6,labelBgStyle:{fill:"#ffffff",fillOpacity:.88},labelStyle:{fill:"#475569",fontSize:11,fontWeight:600},className:f?"workflow-edge workflow-edge-labeled":"workflow-edge"})};for(const c of t){if(a(c.id,c.next),c.branches)for(const[u,f]of Object.entries(c.branches))a(c.id,f,u);for(const u of c.parallelBranches??[])a(c.id,u,"parallel");a(c.id,c.join,"join"),a(c.id,c.onApprove,"approve"),a(c.id,c.onReject,"reject")}return o}function nUr(t,n){return{id:"workflow",layoutOptions:{"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.spacing.nodeNode":"64","elk.spacing.edgeEdge":"18","elk.spacing.edgeNode":"28","elk.layered.spacing.nodeNodeBetweenLayers":"88","elk.layered.spacing.edgeNodeBetweenLayers":"32","elk.layered.spacing.edgeEdgeBetweenLayers":"18","elk.layered.spacing.nodeNode":"64","elk.layered.crossingMinimization.strategy":"LAYER_SWEEP","elk.layered.nodePlacement.strategy":"BRANDES_KOEPF","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES","elk.layered.cycleBreaking.strategy":"GREEDY","elk.padding":"[top=36,left=36,bottom=36,right=36]"},children:t.map(i=>({id:i.id,width:XHr,height:Ddn(i.type)})),edges:n.map(i=>{var o,a,c;return{id:i.id,sources:[(o=i.data)!=null&&o.backEdge?i.target:i.source],targets:[(a=i.data)!=null&&a.backEdge?i.source:i.target],labels:(c=i.data)!=null&&c.label?[{text:String(i.data.label),width:56,height:18}]:void 0}})}}function rUr(t,n){var o;const i=new Map;for(const a of t.edges??[]){const u=(o=a.sections)==null?void 0:o[0];if(!u)continue;const f=[u.startPoint,...u.bendPoints??[],u.endPoint];i.set(a.id,n.has(a.id)?f.reverse():f)}return i}async function iUr(t){const n=tUr(t),i=new Set(n.filter(f=>{var g;return(g=f.data)==null?void 0:g.backEdge}).map(f=>f.id)),o=await ZHr.layout(nUr(t,n)),a=new Map((o.children??[]).map(f=>[f.id,f])),c=rUr(o,i),u=[];for(const f of t){const g=a.get(f.id);u.push({id:f.id,type:"workflow",position:{x:(g==null?void 0:g.x)??0,y:(g==null?void 0:g.y)??0},data:{label:f.id,nodeId:f.id,type:f.type,typeLabel:f.typeLabel,...f.agent?{agent:f.agent}:{},...f.description?{description:f.description}:{},...f.input?{input:f.input}:{},...f.condition?{condition:f.condition}:{}},draggable:!1,selectable:!0})}return{nodes:u,edges:n.map(f=>({...f,data:{...f.data??{},...c.has(f.id)?{points:c.get(f.id)}:{}}}))}}const D$e={agent_task:"border-blue-200 bg-blue-50 text-blue-700",branch:"border-amber-200 bg-amber-50 text-amber-700",approval:"border-emerald-200 bg-emerald-50 text-emerald-700",parallel:"border-violet-200 bg-violet-50 text-violet-700",join:"border-violet-200 bg-violet-50 text-violet-700",skill_task:"border-cyan-200 bg-cyan-50 text-cyan-700",shell_task:"border-rose-200 bg-rose-50 text-rose-700",expression:"border-slate-200 bg-slate-50 text-slate-700",end:"border-gray-200 bg-gray-50 text-gray-700",error:"border-red-200 bg-red-50 text-red-700"};function sUr({data:t,selected:n}){const{t:i}=Zn(),o=i(`workflowRun.nodeType.${t.type}`,{defaultValue:t.typeLabel}),a=D$e[t.type]??D$e.agent_task;return S.jsxs("div",{style:{height:Ddn(t.type)},className:`w-[210px] overflow-hidden rounded-xl border bg-white p-3 shadow-sm transition-shadow ${n?"shadow-md ring-2 ring-gray-900/10":""}`,children:[S.jsx(fR,{type:"target",position:is.Top,className:"opacity-0"}),S.jsxs("div",{className:"flex items-start justify-between gap-2",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("p",{className:"truncate font-mono text-[11px] font-semibold text-gray-500",children:t.nodeId}),S.jsx("p",{className:"mt-1 line-clamp-2 text-sm font-semibold leading-snug text-gray-950",children:t.description||t.nodeId})]}),S.jsx("span",{className:`shrink-0 rounded-full border px-2 py-1 text-[10px] font-semibold ${a}`,children:o})]}),t.agent?S.jsx("div",{className:"mt-3 inline-flex max-w-full items-center gap-1 rounded-md bg-gray-100 px-2 py-1 text-[11px] font-medium text-gray-600",children:S.jsxs("span",{className:"truncate",children:["@",t.agent]})}):null,S.jsx(fR,{type:"source",position:is.Bottom,className:"opacity-0"})]})}const oUr={workflow:F.memo(sUr)},aUr=8;function lUr(t){if(t.length===0)return"";if(t.length<3)return t.map((o,a)=>`${a===0?"M":"L"} ${o.x} ${o.y}`).join(" ");let n=`M ${t[0].x} ${t[0].y}`;for(let o=1;o<t.length-1;o++){const a=t[o-1],c=t[o],u=t[o+1],f=Math.hypot(c.x-a.x,c.y-a.y),g=Math.hypot(u.x-c.x,u.y-c.y),w=Math.min(aUr,f/2,g/2);if(w<1||f===0||g===0){n+=` L ${c.x} ${c.y}`;continue}const x=c.x-(c.x-a.x)/f*w,v=c.y-(c.y-a.y)/f*w,C=c.x+(u.x-c.x)/g*w,E=c.y+(u.y-c.y)/g*w;n+=` L ${x} ${v} Q ${c.x} ${c.y} ${C} ${E}`}const i=t[t.length-1];return`${n} L ${i.x} ${i.y}`}function cUr(t){if(t.length===0)return{x:0,y:0};if(t.length===1)return t[0];const n=Math.floor((t.length-1)/2),i=t[n],o=t[n+1]??i;return{x:(i.x+o.x)/2,y:(i.y+o.y)/2}}function uUr({id:t,data:n,markerEnd:i,style:o,sourceX:a,sourceY:c,targetX:u,targetY:f}){var v;const g=(v=n==null?void 0:n.points)!=null&&v.length?n.points:[{x:a,y:c},{x:u,y:f}],w=lUr(g),x=cUr(g);return S.jsxs(S.Fragment,{children:[S.jsx("path",{id:t,d:w,markerEnd:i,style:o,className:"react-flow__edge-path workflow-edge-path",fill:"none"}),n!=null&&n.label?S.jsx(vHr,{children:S.jsx("span",{className:"pointer-events-none absolute -translate-x-1/2 -translate-y-1/2 rounded-md border border-gray-200 bg-white/90 px-2 py-0.5 text-[11px] font-semibold text-gray-600 shadow-sm",style:{transform:`translate(${x.x}px, ${x.y}px) translate(-50%, -50%)`},children:n.label})}):null]})}const dUr={workflowRoute:F.memo(uUr)};function Nde({width:t,onClose:n,children:i}){const{t:o}=Zn();return S.jsxs("div",{className:`absolute right-14 top-3 z-10 flex max-h-[520px] ${t} flex-col overflow-hidden rounded-xl border border-gray-200 bg-white text-sm shadow-lg`,children:[S.jsx("button",{type:"button",onClick:n,"aria-label":o("workflow.graph.closePanel"),title:o("workflow.graph.closePanel"),className:"absolute right-2 top-2 z-10 inline-flex h-7 w-7 items-center justify-center rounded-md text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600",children:S.jsx(Op,{size:15})}),i]})}function fUr({openPanel:t,workflow:n,selectedNode:i,stateVariables:o,onClose:a}){const{t:c}=Zn();return t?t==="state"?S.jsx(Nde,{width:"w-80",onClose:a,children:S.jsxs("div",{className:"overflow-y-auto p-4",children:[S.jsxs("p",{className:"flex items-center gap-2 pr-6 font-semibold text-gray-950",children:[S.jsx(oJt,{size:15,className:"text-gray-500"}),c("workflow.stateVariablesTitle")]}),o.length>0?S.jsx("ul",{className:"mt-3 space-y-2 border-t border-gray-200 pt-3",children:o.map(u=>S.jsxs("li",{className:"flex items-center gap-2",children:[S.jsx("span",{"aria-hidden":"true",className:"h-1.5 w-1.5 rounded-full bg-gray-300"}),S.jsx("span",{className:"font-mono text-[11px] text-gray-600",children:u})]},u))}):S.jsx("p",{className:"mt-3 border-t border-gray-200 pt-3 text-gray-500",children:c("workflow.graph.noStateVariables")})]})}):t==="legend"?S.jsx(Nde,{width:"w-72",onClose:a,children:S.jsxs("div",{className:"overflow-y-auto p-4",children:[S.jsx("p",{className:"pr-6 font-semibold text-gray-950",children:c("workflow.graph.legendTitle")}),S.jsx("div",{className:"mt-3 grid grid-cols-1 gap-2",children:Object.entries(D$e).map(([u,f])=>S.jsxs("div",{className:"flex items-center justify-between gap-3",children:[S.jsx("span",{className:"text-gray-600",children:c(`workflowRun.nodeType.${u}`,{defaultValue:u})}),S.jsx("span",{className:`rounded-full border px-2 py-1 text-[10px] font-semibold ${f}`,children:u})]},u))})]})}):t==="source"?S.jsx(Nde,{width:"w-80",onClose:a,children:S.jsxs("div",{className:"overflow-y-auto p-4",children:[S.jsx("p",{className:"pr-6 font-semibold text-gray-950",children:c("workflow.graph.sourceTitle")}),S.jsxs("dl",{className:"mt-3 space-y-3",children:[S.jsxs("div",{children:[S.jsx("dt",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:c("workflow.graph.sourceFile")}),S.jsxs("dd",{className:"mt-1 font-mono text-xs text-gray-700",children:["workflows/",n.sourceFile]})]}),S.jsxs("div",{children:[S.jsx("dt",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:c("workflow.graph.contract")}),S.jsx("dd",{className:"mt-1 text-gray-600",children:c("workflow.graph.readonlyContract")})]})]})]})}):S.jsxs(Nde,{width:"w-80",onClose:a,children:[S.jsx("p",{className:"shrink-0 border-b border-gray-100 px-4 py-3 pr-10 font-semibold text-gray-950",children:c("workflow.graph.detailsTitle")}),i?S.jsxs("dl",{className:"space-y-3 overflow-y-auto px-4 py-3",children:[S.jsxs("div",{children:[S.jsx("dt",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:c("workflow.graph.nodeId")}),S.jsx("dd",{className:"mt-1 font-mono text-xs text-gray-700",children:i.nodeId})]}),S.jsxs("div",{children:[S.jsx("dt",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:c("workflow.graph.nodeType")}),S.jsx("dd",{className:"mt-1 text-gray-700",children:c(`workflowRun.nodeType.${i.type}`,{defaultValue:i.typeLabel})})]}),i.agent?S.jsxs("div",{children:[S.jsx("dt",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:c("workflow.graph.agent")}),S.jsxs("dd",{className:"mt-1 text-gray-700",children:["@",i.agent]})]}):null,i.description?S.jsxs("div",{children:[S.jsx("dt",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:c("workflow.graph.description")}),S.jsx("dd",{className:"mt-1 whitespace-pre-wrap break-words text-gray-700",children:i.description})]}):null,i.input?S.jsxs("div",{children:[S.jsx("dt",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:c("workflow.graph.input")}),S.jsx("dd",{className:"mt-1 whitespace-pre-wrap break-words rounded-lg border border-gray-100 bg-gray-50 p-2 font-mono text-xs leading-relaxed text-gray-700",children:i.input})]}):null,i.condition?S.jsxs("div",{children:[S.jsx("dt",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:c("workflow.graph.condition")}),S.jsx("dd",{className:"mt-1 whitespace-pre-wrap break-words rounded-lg border border-amber-100 bg-amber-50 p-2 font-mono text-xs text-amber-900",children:i.condition})]}):null]}):S.jsx("p",{className:"px-4 py-3 text-gray-500",children:c("workflow.graph.noNodeSelected")})]}):null}function hUr({workflow:t,stateVariables:n=[]}){const{t:i}=Zn(),[o,a]=F.useState({nodes:[],edges:[]}),[c,u]=F.useState(!0),[f,g]=F.useState(null),[w,x]=F.useState(null);return F.useEffect(()=>{let v=!1;return u(!0),iUr(t.nodes).then(C=>{v||a(C)}).finally(()=>{v||u(!1)}),()=>{v=!0}},[t.nodes]),S.jsx("section",{className:"overflow-hidden rounded-2xl border border-gray-200 bg-white shadow-sm",children:S.jsxs("div",{className:"relative h-[560px] bg-[#f8fafc]",children:[c?S.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-[#f8fafc] text-sm font-medium text-gray-500",children:i("workflow.graph.layouting")}):null,!c&&o.nodes.length>0?S.jsxs(yHr,{nodes:o.nodes,edges:o.edges,nodeTypes:oUr,edgeTypes:dUr,fitView:!0,fitViewOptions:{padding:.15,maxZoom:1,nodes:o.nodes.slice(0,2)},minZoom:.1,maxZoom:1.3,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,onNodeClick:(v,C)=>{g(C.data),x("details")},proOptions:{hideAttribution:!0},children:[S.jsx(_Hr,{gap:24,color:"#e2e8f0"}),S.jsx(IHr,{position:"bottom-right",showInteractive:!1,className:"!rounded-lg !border !border-gray-200 !bg-white/95 !shadow-sm"}),S.jsxs(MY,{position:"top-right",className:"m-3 flex flex-col gap-2",children:[S.jsx("button",{type:"button",onClick:()=>x(w==="details"?null:"details"),className:"inline-flex h-9 w-9 items-center justify-center rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm transition-colors hover:bg-gray-50",title:i("workflow.graph.detailsTitle"),children:S.jsx(wR,{size:16})}),S.jsx("button",{type:"button",onClick:()=>x(w==="legend"?null:"legend"),className:"inline-flex h-9 w-9 items-center justify-center rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm transition-colors hover:bg-gray-50",title:i("workflow.graph.legendTitle"),children:S.jsx(rWn,{size:16})}),S.jsx("button",{type:"button",onClick:()=>x(w==="state"?null:"state"),className:"inline-flex h-9 w-9 items-center justify-center rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm transition-colors hover:bg-gray-50",title:i("workflow.stateVariablesTitle"),children:S.jsx(oJt,{size:16})}),S.jsx("button",{type:"button",onClick:()=>x(w==="source"?null:"source"),className:"inline-flex h-9 w-9 items-center justify-center rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm transition-colors hover:bg-gray-50",title:i("workflow.graph.sourceTitle"),children:S.jsx(Tx,{size:16})})]})]},t.id):null,S.jsx(fUr,{openPanel:w,workflow:t,selectedNode:f,stateVariables:n,onClose:()=>x(null)})]})})}function jde({icon:t,label:n,value:i}){return S.jsxs("div",{className:"rounded-xl border border-gray-200 bg-white p-4 shadow-sm",children:[S.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-xl bg-blue-50 text-blue-600",children:S.jsx(t,{size:18})}),S.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:n}),S.jsx("p",{className:"mt-1 text-lg font-semibold text-gray-900",children:i})]})}function pUr(){const{t}=Zn(),n=S0(),{id:i}=Ff(),{setPageHeader:o}=Sd(),a=b0(M=>M.fetchWorkflowDetail),c=b0(M=>M.clearSelectedWorkflow),u=b0(M=>M.selectedWorkflow),f=b0(M=>M.detailLoading),g=b0(M=>M.detailError);F.useEffect(()=>{if(i)return a(i).catch(()=>{}),()=>c()},[c,a,i]);const w=F.useMemo(()=>u!=null&&u.timeout?t("workflow.timeoutMinutes",{count:Math.max(1,Math.round(u.timeout/60))}):t("workflow.noLimit"),[t,u==null?void 0:u.timeout]),x=F.useMemo(()=>u!=null&&u.maxIterations?t("workflow.iterationCount",{count:u.maxIterations}):t("workflow.noLimit"),[t,u==null?void 0:u.maxIterations]),v=F.useMemo(()=>Object.keys((u==null?void 0:u.state)??{}).sort((M,I)=>M.localeCompare(I)),[u==null?void 0:u.state]),C=u?v.length>0?"WFLUI003":"WFLUI002":null,E=v.length>0?"워크플로 상세 State":"워크플로 상세";FJt(C,E);const A=F.useCallback(()=>{u&&n(`/threads/new?workflow=${encodeURIComponent(u.id)}`)},[u,n]);return F.useEffect(()=>{o({title:(u==null?void 0:u.name)??i??t("workflow.title"),subtitle:(u==null?void 0:u.description)||(u==null?void 0:u.id),actions:S.jsx("div",{className:"flex items-center gap-2",children:S.jsxs("button",{type:"button",onClick:A,disabled:!u,title:u?t("workflow.startChatTooltip",{id:u.id}):void 0,className:"inline-flex items-center gap-1.5 rounded-lg bg-blue-500 px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-60",children:[S.jsx(sUn,{size:16}),S.jsx("span",{children:t("workflow.runWorkflow")})]})})})},[A,i,o,t,u]),S.jsx(kun,{fallback:S.jsx("div",{className:"rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-600",children:t("workflow.pageError")}),children:S.jsx("div",{className:"mx-auto flex max-w-7xl flex-col gap-6",children:f&&!u?S.jsx("div",{className:"flex min-h-[360px] items-center justify-center rounded-2xl border border-gray-200 bg-white shadow-sm",children:S.jsx(Is,{size:24,className:"animate-spin text-gray-400"})}):g?S.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-xl border border-red-200 bg-red-50 px-4 py-4 text-sm text-red-700",children:[S.jsx("span",{children:g}),i&&S.jsx("button",{type:"button",onClick:()=>a(i,!0).catch(()=>{}),className:"rounded-md bg-white px-3 py-2 font-medium text-red-700 transition-colors hover:bg-red-100",children:t("workflow.retry")})]}):u?S.jsxs(S.Fragment,{children:[S.jsx(hUr,{workflow:u,stateVariables:v}),S.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4",children:[S.jsx(jde,{icon:O9,label:t("workflow.metadataAgents"),value:String(u.agents.length)}),S.jsx(jde,{icon:D7,label:t("workflow.metadataNodes"),value:String(u.nodeCount)}),S.jsx(jde,{icon:pqn,label:t("workflow.metadataTimeout"),value:w}),S.jsx(jde,{icon:BWn,label:t("workflow.metadataMaxIterations"),value:x})]})]}):null})})}const FLe={"task.created":()=>({taskId:`tsk_test_${Date.now()}`,threadId:`thr_test_${Date.now()}`,agent:"test_agent",status:"running",updatedAt:new Date().toISOString()}),"task.updated":()=>({taskId:`tsk_test_${Date.now()}`,threadId:`thr_test_${Date.now()}`,agent:"test_agent",status:"success",costUsd:.001,updatedAt:new Date().toISOString()}),"task.logged":()=>({taskId:`tsk_test_${Date.now()}`,threadId:`thr_test_${Date.now()}`}),"thread.created":()=>({threadId:`thr_test_${Date.now()}`}),"thread.updated":()=>({threadId:`thr_test_${Date.now()}`,updatedAt:new Date().toISOString()}),"message.created":()=>({threadId:`thr_test_${Date.now()}`,taskId:`tsk_test_${Date.now()}`})};let gUr=0;function mUr(){const{slug:t}=Ff(),{setPageHeader:n}=Sd(),[i,o]=F.useState("task.updated"),[a,c]=F.useState(()=>JSON.stringify(FLe["task.updated"](),null,2)),[u,f]=F.useState(null),[g,w]=F.useState(!1),[x,v]=F.useState(null),[C,E]=F.useState([]),[A,M]=F.useState(!1),I=F.useRef(null);F.useEffect(()=>{n({title:"SSE 이벤트 테스트",actions:null})},[n]),F.useEffect(()=>{c(JSON.stringify(FLe[i](),null,2)),f(null)},[i]),F.useEffect(()=>{if(!t)return;const R=new EventSource(`/api/v1/ws/${encodeURIComponent(t)}/events`);R.onopen=()=>M(!0),R.onerror=()=>M(!1);const U=[...qPe,"ping"].map(W=>{const G=Y=>{const te=Y instanceof MessageEvent?Y.data:"";let Q=null;try{Q=JSON.parse(te)}catch{Q=te}E(se=>{const ce={id:++gUr,time:new Date().toLocaleTimeString(),type:W,data:Q,isPing:W==="ping"};return[...se.slice(-99),ce]})};return R.addEventListener(W,G),{type:W,listener:G}});return()=>{U.forEach(({type:W,listener:G})=>R.removeEventListener(W,G)),R.close(),M(!1)}},[t]),F.useEffect(()=>{var R;(R=I.current)==null||R.scrollIntoView({behavior:"smooth"})},[C]);function D(R){c(R);try{JSON.parse(R),f(null)}catch(z){f(z instanceof Error?z.message:"JSON 파싱 오류")}}async function P(){if(!t||u)return;let R;try{R=JSON.parse(a)}catch{f("JSON 파싱 오류");return}w(!0),v(null);try{const U=await(await fetch(`/api/v1/ws/${encodeURIComponent(t)}/test/emit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:i,data:R})})).json();v(JSON.stringify(U,null,2))}catch(z){v(`Error: ${z instanceof Error?z.message:String(z)}`)}finally{w(!1)}}return S.jsxs("div",{className:"flex h-full flex-col gap-4 p-6",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("h1",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:"SSE 이벤트 테스트"}),S.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium ${A?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-400"}`,children:[S.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${A?"bg-green-500":"bg-gray-400"}`}),A?"SSE 연결됨":"연결 중…"]}),S.jsxs("span",{className:"text-xs text-gray-400",children:["워크스페이스: ",t]})]}),S.jsxs("div",{className:"grid flex-1 grid-cols-2 gap-4 overflow-hidden",children:[S.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-900",children:[S.jsx("h2",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"이벤트 발행"}),S.jsxs("div",{className:"flex flex-col gap-1",children:[S.jsx("label",{className:"text-xs text-gray-500",children:"이벤트 타입"}),S.jsx("select",{value:i,onChange:R=>o(R.target.value),className:"rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100",children:qPe.map(R=>S.jsx("option",{value:R,children:R},R))})]}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("label",{className:"text-xs text-gray-500",children:"데이터 (JSON)"}),S.jsx("button",{type:"button",onClick:()=>c(JSON.stringify(FLe[i](),null,2)),className:"text-xs text-blue-500 hover:underline",children:"기본값 재생성"})]}),S.jsx("textarea",{value:a,onChange:R=>D(R.target.value),rows:10,spellCheck:!1,className:"flex-1 resize-none rounded-md border border-gray-300 bg-gray-50 p-2 font-mono text-xs dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100"}),u&&S.jsx("p",{className:"text-xs text-red-500",children:u})]}),S.jsx("button",{type:"button",onClick:P,disabled:g||!!u||!t,className:"rounded-lg bg-blue-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-600 disabled:opacity-50",children:g?"발행 중…":"이벤트 발행"}),x&&S.jsxs("div",{className:"flex flex-col gap-1",children:[S.jsx("span",{className:"text-xs text-gray-500",children:"서버 응답"}),S.jsx("pre",{className:"overflow-auto rounded-md border border-gray-200 bg-gray-50 p-2 text-xs dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300",children:x})]})]}),S.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-900",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("h2",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"수신 이벤트 피드"}),S.jsx("button",{type:"button",onClick:()=>E([]),className:"text-xs text-gray-400 hover:text-gray-600 dark:hover:text-gray-200",children:"비우기"})]}),S.jsxs("div",{className:"flex-1 overflow-y-auto rounded-md border border-gray-100 bg-gray-50 p-2 font-mono text-xs dark:border-gray-700 dark:bg-gray-800",children:[C.length===0&&S.jsx("p",{className:"text-center text-gray-400 py-8",children:"이벤트 수신 대기 중…"}),C.map(R=>S.jsxs("div",{className:`mb-1 rounded px-2 py-1 ${R.isPing?"text-gray-400 dark:text-gray-600":"bg-blue-50 dark:bg-blue-900/20"}`,children:[S.jsx("span",{className:"mr-2 text-gray-400",children:R.time}),S.jsx("span",{className:`mr-2 font-semibold ${R.isPing?"text-gray-400":"text-blue-600 dark:text-blue-400"}`,children:R.type}),!R.isPing&&S.jsx("span",{className:"text-gray-600 dark:text-gray-300",children:JSON.stringify(R.data)})]},R.id)),S.jsx("div",{ref:I})]})]})]})]})}function Odn(t){return t.map(n=>({name:n.name,path:n.path,type:n.isDirectory??n.type==="dir"?"dir":"file",isDirectory:n.isDirectory??n.type==="dir",children:n.children?Odn(n.children):[],hasCrewxYaml:n.hasCrewxYaml,isRegistered:n.isRegistered}))}async function bUr(t,n=3){const i=await wn.getFsTree(t,n);return{tree:Odn(i.data),quickAccess:i.quickAccess??[]}}async function wUr(t,n){return wn.mkdirFs(t,n)}function BLe(t){return/^(?:[A-Za-z]:\\|\/)/.test(t)}function Ldn(t){return t.includes("\\")?"\\":"/"}function yUr(t,n){return t===n?!0:t.startsWith(`${n}${Ldn(n)}`)}function xUr(t){return t?t.isDirectory??t.type==="dir":!1}function nGt(t,n){if(!n)return t;if(t===n)return"~";const i=Ldn(n);return t.startsWith(`${n}${i}`)?`~${t.slice(n.length)}`:t}function rGt(t,n){var i;return((i=t.find(o=>o.key===n))==null?void 0:i.path)??null}function EV(t,n){var i;for(const o of t){if(o.path===n)return o;if((i=o.children)!=null&&i.length){const a=EV(o.children,n);if(a)return a}}return null}function Pdn(t,n,i){let o=!1;const a=t.map(c=>{var f;if(c.path===n){const g=c.children??[];return g.some(w=>w.path===i.path)?c:(o=!0,{...c,children:[...g,i]})}if(!((f=c.children)!=null&&f.length))return c;const u=Pdn(c.children,n,i);return u===c.children?c:(o=!0,{...c,children:u})});return o?a:t}function vUr(t){return!t||t==="."||t===".."||t.includes("/")||t.includes("\\")||/[\x00-\x1f]/.test(t)?!1:t.length<=255}function iGt(t){if(!(t instanceof bd)||typeof t.body!="object"||t.body===null)return"UNKNOWN";const n=t.body;if(typeof n.code=="string")return n.code;if(typeof n.error=="object"&&n.error!==null){const i=n.error;if(typeof i.code=="string")return i.code}return"UNKNOWN"}function kUr({open:t,onClose:n,onSelect:i,initialPath:o}){const{t:a}=Zn(),[c,u]=F.useState([]),f=F.useMemo(()=>rGt(c,"home"),[c]),g=F.useMemo(()=>rGt(c,"workspaces"),[c]),w=F.useMemo(()=>{if(o&&BLe(o)){const Ve=[...c].sort((at,yt)=>yt.path.length-at.path.length).find(at=>yUr(o,at.path));return(Ve==null?void 0:Ve.path)??o}return g??f??"/"},[f,o,c,g]),[x,v]=F.useState(()=>o&&BLe(o)?o:"/"),[C,E]=F.useState([]),[A,M]=F.useState(new Set),[I,D]=F.useState(o??null),[P,R]=F.useState(!1),[z,U]=F.useState(null),[W,G]=F.useState(!1),[Y,te]=F.useState(""),[Q,se]=F.useState(!1),[ce,V]=F.useState(null),ae=F.useRef(0),de=F.useRef(x),ee=F.useMemo(()=>I?EV(C,I):null,[I,C]),ue=Y.trim(),he=vUr(ue)&&!Q,ge=x===g;F.useEffect(()=>{de.current=x},[x]),F.useEffect(()=>{t&&(v(o&&BLe(o)?o:"/"),D(o??null),M(new Set),U(null),u([]),G(!1),te(""),se(!1),V(null))},[o,t]),F.useEffect(()=>{t&&v(Ve=>Ve===w?Ve:w)},[w,t]),F.useEffect(()=>{if(!t)return;const Ve=at=>{at.key==="Escape"&&(at.preventDefault(),at.stopPropagation(),n())};return window.addEventListener("keydown",Ve),()=>window.removeEventListener("keydown",Ve)},[n,t]);const oe=F.useCallback(async(Ve,at)=>{const yt=ae.current+1;ae.current=yt,R(!0),U(null);try{const{tree:Nt,quickAccess:pt}=await bUr(Ve,3);if(yt!==ae.current)return;const St=at!=null&&at.createdNode&&at.parentPath&&!EV(Nt,at.createdNode.path)?Pdn(Nt,at.parentPath,at.createdNode):Nt;if(E(St),u(pt),at!=null&&at.selectedPath){D(at.selectedPath);return}D(Bt=>Bt&&EV(St,Bt)?Bt:null)}catch(Nt){if(yt!==ae.current)return;E([]),D(null),M(new Set),U(iGt(Nt))}finally{yt===ae.current&&R(!1)}},[]);if(F.useEffect(()=>{t&&oe(x)},[oe,t,x]),!t)return null;const Ae=()=>{G(!0),te(""),V(null)},Te=()=>{G(!1),te(""),se(!1),V(null)},ve=async()=>{if(!he)return;const Ve=x,at=ee&&xUr(ee)?ee.path:Ve,yt=ue;se(!0),V(null);try{const Nt=await wUr(at,yt),pt={name:yt,path:Nt.path,type:"dir",isDirectory:!0,children:[],hasCrewxYaml:!1,isRegistered:!1};if(de.current!==Ve)return;G(!1),te(""),M(St=>{const Bt=new Set(St);return at!==Ve&&Bt.add(at),Bt}),await oe(Ve,{parentPath:at,createdNode:pt,selectedPath:Nt.path})}catch(Nt){de.current===Ve&&V(iGt(Nt))}finally{se(!1)}};return S.jsx("div",{"data-testid":"directory-picker-backdrop",className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/40 p-4",onClick:n,children:S.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"directory-picker-title","data-testid":"directory-picker-dialog",className:"flex h-[70vh] w-full max-w-5xl flex-col overflow-hidden rounded-2xl border border-gray-200 bg-white shadow-xl",onClick:Ve=>Ve.stopPropagation(),children:[S.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-gray-200 px-6 py-5",children:[S.jsxs("div",{children:[S.jsx("h2",{id:"directory-picker-title",className:"text-lg font-semibold text-gray-900",children:a("dirPicker.title")}),S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:a("dirPicker.description")})]}),S.jsx("button",{type:"button",onClick:n,className:"rounded-lg bg-gray-100 px-3 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200",children:a("common.close")})]}),S.jsxs("div",{className:"min-h-0 flex flex-1",children:[S.jsxs("aside",{className:"w-48 border-r border-gray-200 bg-gray-50 px-4 py-4",children:[S.jsx("p",{className:"mb-3 text-xs font-semibold uppercase tracking-wide text-gray-500",children:a("dirPicker.quickAccess.title")}),S.jsx("div",{className:"space-y-2",children:c.map(Ve=>{const at=x===Ve.path;return S.jsxs("button",{type:"button",onClick:()=>{Te(),v(Ve.path),D(null),M(new Set)},className:`flex w-full items-center justify-between rounded-lg px-3 py-2 text-left text-sm transition-colors ${at?"bg-blue-100 text-blue-700":"text-gray-700 hover:bg-white"}`,children:[S.jsx("span",{children:a(`dirPicker.quickAccess.${Ve.key}`)}),at?S.jsx(xg,{className:"h-4 w-4"}):null]},Ve.key)})})]}),S.jsxs("div",{className:"flex min-h-0 flex-1 flex-col px-6 py-5",children:[S.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[S.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-600",children:[S.jsx(a5,{className:"h-4 w-4 shrink-0 text-gray-400"}),S.jsx("span",{className:"truncate",children:nGt(x,f)})]}),S.jsxs("button",{type:"button",onClick:Ae,className:"inline-flex items-center gap-2 rounded-lg bg-blue-600 px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-700",children:[S.jsx(yIe,{className:"h-4 w-4"}),a("dirPicker.newFolder.label")]})]}),W?S.jsx("div",{className:"mb-4 rounded-lg border border-gray-200 bg-gray-50 px-3 py-3",children:S.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[S.jsx("input",{type:"text",value:Y,onChange:Ve=>te(Ve.target.value),placeholder:a("dirPicker.newFolder.placeholder"),maxLength:255,autoFocus:!0,className:"min-w-0 flex-1 rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 outline-none transition-colors focus:border-blue-500"}),S.jsxs("button",{type:"button",onClick:()=>{ve()},disabled:!he,className:"inline-flex items-center gap-2 rounded-lg bg-blue-600 px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-blue-300",children:[Q?S.jsx(Is,{className:"h-4 w-4 animate-spin"}):null,a("dirPicker.newFolder.create")]}),S.jsx("button",{type:"button",onClick:Te,className:"rounded-lg bg-gray-100 px-3 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200",children:a("dirPicker.cancel")})]})}):null,ce?S.jsxs("div",{className:"mb-4 flex items-start gap-2 rounded-lg border border-red-200 bg-red-50 px-3 py-3 text-sm text-red-700",role:"alert",children:[S.jsx(wc,{className:"mt-0.5 h-4 w-4 shrink-0"}),S.jsx("span",{children:a(`dirPicker.mkdir.error.${ce}`,{defaultValue:a("dirPicker.mkdir.error.UNKNOWN")})})]}):null,S.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto rounded-xl border border-gray-200 bg-white px-3 py-3",children:P?S.jsxs("div",{className:"flex items-center gap-2 px-2 py-2 text-sm text-gray-500",children:[S.jsx(Is,{className:"h-4 w-4 animate-spin"}),S.jsx("span",{children:a("dirPicker.loading")})]}):z?S.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-red-200 bg-red-50 px-3 py-3 text-sm text-red-700",role:"alert",children:[S.jsx(wc,{className:"mt-0.5 h-4 w-4 shrink-0"}),S.jsx("span",{children:a(`dirPicker.error.${z}`,{defaultValue:a("dirPicker.error.UNKNOWN")})})]}):C.length===0?S.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 px-6 py-8 text-center",children:[S.jsx(yIe,{className:"h-8 w-8 text-gray-400"}),S.jsx("p",{className:"max-w-sm text-sm text-gray-500",children:a(ge?"dirPicker.empty.workspaces":"dirPicker.empty.default")}),S.jsxs("button",{type:"button",onClick:Ae,className:"inline-flex items-center gap-2 rounded-lg bg-blue-600 px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-700",children:[S.jsx(yIe,{className:"h-4 w-4"}),a("dirPicker.newFolder.label")]})]}):S.jsx(tln,{nodes:C,expandedFolders:A,selectedPath:I,onToggle:Ve=>{const at=EV(C,Ve);!at||at.isRegistered||(D(Ve),M(yt=>{const Nt=new Set(yt);return Nt.has(Ve)?Nt.delete(Ve):Nt.add(Ve),Nt}))},onSelect:Ve=>D(Ve),isFileDisabled:Ve=>Ve.isRegistered===!0,renderFileSuffix:Ve=>S.jsxs("span",{className:"ml-2 flex items-center gap-1",children:[Ve.hasCrewxYaml?S.jsx("span",{className:"rounded bg-blue-100 px-1.5 py-0.5 text-[10px] font-medium text-blue-700",children:a("dirPicker.badge.crewxYaml")}):null,Ve.isRegistered?S.jsx("span",{className:"rounded bg-gray-200 px-1.5 py-0.5 text-[10px] font-medium text-gray-600",title:a("dirPicker.disabledTooltip"),children:a("dirPicker.alreadyRegistered")}):null]})})}),S.jsxs("div",{className:"mt-4 rounded-lg border border-gray-200 bg-gray-50 px-3 py-3 text-sm text-gray-600",children:[S.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:a("dirPicker.selected")}),S.jsx("p",{className:"mt-1 truncate text-sm font-medium text-gray-900",children:I?nGt(I,f):a("dirPicker.noneSelected")})]})]})]}),S.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-gray-200 px-6 py-4",children:[S.jsx("button",{type:"button",onClick:n,className:"rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200",children:a("dirPicker.cancel")}),S.jsx("button",{type:"button",onClick:()=>{I&&ee&&!ee.isRegistered&&(i(I),n())},disabled:!I||!ee||ee.isRegistered===!0,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-blue-300",children:a("dirPicker.select")})]})]})})}const sGt=150;function oGt(t){return new Promise(n=>{window.setTimeout(n,t)})}function aGt(t){return typeof t=="object"&&t!==null}function lGt(t){if(!(t instanceof bd))return"UNKNOWN";if(aGt(t.body)){if(typeof t.body.code=="string")return t.body.code;if(aGt(t.body.error)&&typeof t.body.error.code=="string")return t.body.error.code}return"UNKNOWN"}function zLe(t,n,i){return n===0?"pending":t<n?"done":t===n?i?"current":"done":"pending"}function HLe({label:t,status:n}){return S.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-gray-200 bg-white px-4 py-3",children:[n==="done"?S.jsx(bR,{size:18,className:"shrink-0 text-green-600"}):n==="current"?S.jsx(Is,{size:18,className:"shrink-0 animate-spin text-blue-600"}):S.jsx(rJt,{size:18,className:"shrink-0 text-gray-300"}),S.jsx("span",{className:n==="pending"?"text-sm text-gray-400":n==="current"?"text-sm font-medium text-blue-700":"text-sm font-medium text-gray-900",children:t})]})}function cGt({open:t,onClose:n}){const{t:i}=Zn(),o=Cg();FJt(t?"WKSUI001-NEW":null,"워크스페이스 생성");const a=Lm(de=>de.addToast),c=km(de=>de.createWorkspace),[u,f]=F.useState(""),[g,w]=F.useState(""),[x,v]=F.useState("form"),[C,E]=F.useState(!1),[A,M]=F.useState(null),[I,D]=F.useState(null),[P,R]=F.useState(0),[z,U]=F.useState(null),[W,G]=F.useState(!1);F.useEffect(()=>{t||(f(""),w(""),v("form"),E(!1),M(null),D(null),R(0),U(null),G(!1))},[t]),F.useEffect(()=>{if(!t)return;const de=ee=>{ee.key!=="Escape"||C||W||(ee.preventDefault(),n())};return window.addEventListener("keydown",de),()=>window.removeEventListener("keydown",de)},[n,t,W,C]);const Y=F.useMemo(()=>A?i(`workspace.createModal.error.${A}`,{defaultValue:i("workspace.createModal.error.UNKNOWN")}):null,[A,i]),te=C||W,Q=[i("workspace.createModal.confirmInit.files.config"),i("workspace.createModal.confirmInit.files.automation"),i("workspace.createModal.confirmInit.files.registration")];if(!t)return null;const se=async()=>{const de=u.trim(),ee=g.trim();if(!(!de||C)){E(!0),M(null);try{const ue=await c({workspace_path:de,slug:ee||void 0,initIfMissing:!1});a({type:"success",message:i("workspace.createModal.success")}),n(),o(`/ws/${ue.slug}`,{replace:!0})}catch(ue){const he=lGt(ue);if(he==="NOT_A_CREWX_WORKSPACE"){D(de),v("confirm-init");return}M(he)}finally{E(!1)}}},ce=()=>{v("form"),M(null),U(null),R(0)},V=async()=>{var ue;const de=I??u.trim(),ee=g.trim();if(!(!de||C)){v("initializing"),E(!0),M(null),U(null),R(1);try{const he=await c({workspace_path:de,slug:ee||void 0,initIfMissing:!0});R(2),await oGt(sGt),R(3),E(!1);const ge=((ue=he.initResult)==null?void 0:ue.errors.some(oe=>oe.startsWith("HOOK_INSTALL_FAILED")))??!1;if(a({type:"success",message:i("workspace.createModal.success")}),ge){U(i("workspace.createModal.error.HOOK_INSTALL_FAILED"));return}await oGt(sGt),n(),o(`/ws/${he.slug}`,{replace:!0})}catch(he){E(!1),v("confirm-init"),R(0),M(lGt(he))}}},ae=()=>Y?S.jsxs("div",{className:"rounded-lg border border-red-200 bg-red-50 px-3 py-3 text-sm text-red-700",children:[S.jsx("p",{children:Y}),A==="WORKSPACE_LIMIT_EXCEEDED"?S.jsx("a",{href:khe,target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-flex items-center gap-1 text-sm font-medium text-red-700 transition-colors hover:text-red-800 hover:underline",children:i("upgrade.waitlistCta")}):null]}):null;return S.jsxs("div",{"data-testid":"create-workspace-modal-backdrop",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onClick:()=>{te||n()},children:[S.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"create-workspace-modal-title",className:"w-full max-w-lg rounded-2xl border border-gray-200 bg-white shadow-xl",onClick:de=>de.stopPropagation(),children:[S.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-gray-200 px-6 py-5",children:[S.jsxs("div",{children:[S.jsx("h2",{id:"create-workspace-modal-title",className:"text-lg font-semibold text-gray-900",children:i("workspace.createModal.title")}),S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:i("workspace.createModal.description")})]}),S.jsx("button",{type:"button",onClick:n,disabled:te,className:"rounded-lg bg-gray-100 p-2 text-gray-500 transition-colors hover:bg-gray-200 hover:text-gray-700 disabled:cursor-not-allowed disabled:opacity-50","aria-label":i("common.close"),children:S.jsx(Op,{size:16})})]}),S.jsxs("div",{className:"space-y-4 px-6 py-5",children:[x==="form"?S.jsxs(S.Fragment,{children:[S.jsxs("div",{children:[S.jsx("label",{htmlFor:"workspace-path",className:"mb-1 block text-sm font-medium text-gray-700",children:i("workspace.createModal.pathLabel")}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("input",{id:"workspace-path",type:"text",value:u,onChange:de=>{f(de.target.value),M(null)},placeholder:i("workspace.createModal.pathPlaceholder"),className:"min-w-0 flex-1 rounded-lg border border-gray-200 px-3 py-2 text-sm text-gray-900 shadow-sm outline-none transition-colors placeholder:text-gray-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-100"}),S.jsx("button",{type:"button",onClick:()=>G(!0),disabled:C,className:"shrink-0 rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200 disabled:cursor-not-allowed disabled:opacity-50",children:i("workspace.createModal.browse")})]})]}),S.jsxs("div",{children:[S.jsx("label",{htmlFor:"workspace-slug",className:"mb-1 block text-sm font-medium text-gray-700",children:i("workspace.createModal.slugLabel")}),S.jsx("input",{id:"workspace-slug",type:"text",value:g,onChange:de=>w(de.target.value),placeholder:i("workspace.createModal.slugPlaceholder"),className:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm text-gray-900 shadow-sm outline-none transition-colors placeholder:text-gray-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-100"})]}),ae()]}):null,x==="confirm-init"?S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx("h3",{className:"text-base font-semibold text-gray-900",children:i("workspace.createModal.confirmInit.title")}),S.jsx("p",{className:"text-sm text-gray-600",children:i("workspace.createModal.confirmInit.description")})]}),S.jsxs("div",{className:"rounded-lg border border-gray-200 bg-gray-50 px-4 py-3",children:[S.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:i("workspace.createModal.confirmInit.pathLabel")}),S.jsx("p",{className:"mt-1 break-all text-sm text-gray-900",children:I??u.trim()})]}),S.jsxs("div",{className:"rounded-lg border border-gray-200 bg-gray-50 px-4 py-3",children:[S.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:i("workspace.createModal.confirmInit.filesLabel")}),S.jsx("ul",{className:"mt-2 space-y-2 text-sm text-gray-700",children:Q.map(de=>S.jsx("li",{children:de},de))})]}),ae()]}):null,x==="initializing"?S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx("h3",{className:"text-base font-semibold text-gray-900",children:i("workspace.createModal.initProgress.title")}),S.jsx("p",{className:"text-sm text-gray-600",children:i("workspace.createModal.initProgress.description")})]}),S.jsxs("div",{className:"space-y-3 rounded-xl bg-gray-50 p-4",children:[S.jsx(HLe,{label:i("workspace.createModal.initProgress.step1"),status:zLe(1,P,C)}),S.jsx(HLe,{label:i("workspace.createModal.initProgress.step2"),status:zLe(2,P,C)}),S.jsx(HLe,{label:i("workspace.createModal.initProgress.step3"),status:zLe(3,P,C)})]}),z?S.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900",children:S.jsxs("div",{className:"flex items-start gap-3",children:[S.jsx(q6,{size:18,className:"mt-0.5 shrink-0 text-amber-600"}),S.jsxs("div",{className:"space-y-3",children:[S.jsx("p",{children:z}),S.jsx("button",{type:"button",onClick:n,className:"font-medium text-amber-900 underline underline-offset-2",children:i("common.close")})]})]})}):null]}):null]}),x!=="initializing"?S.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-gray-200 px-6 py-4",children:x==="form"?S.jsxs(S.Fragment,{children:[S.jsx("button",{type:"button",onClick:n,disabled:te,className:"rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200 disabled:cursor-not-allowed disabled:opacity-50",children:i("workspace.createModal.cancel")}),S.jsxs("button",{type:"button",onClick:()=>{se()},disabled:!u.trim()||C,className:"inline-flex items-center gap-2 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-blue-300",children:[C?S.jsx(Is,{size:14,className:"animate-spin"}):null,i("workspace.createModal.submit")]})]}):S.jsxs(S.Fragment,{children:[S.jsx("button",{type:"button",onClick:ce,disabled:C,className:"rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200 disabled:cursor-not-allowed disabled:opacity-50",children:i("workspace.createModal.confirmInit.back")}),S.jsxs("button",{type:"button",onClick:()=>{V()},disabled:!I||C,className:"inline-flex items-center gap-2 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-blue-300",children:[C?S.jsx(Is,{size:14,className:"animate-spin"}):null,i("workspace.createModal.confirmInit.confirm")]})]})}):null]}),S.jsx(kUr,{open:W,initialPath:u.trim()||void 0,onClose:()=>G(!1),onSelect:de=>{f(de),M(null)}})]})}function CUr(t){if(!t)return"—";const i=/^\/Users\/([^/]+)(\/.*)?$/.exec(t);return i?`~${i[2]??""}`:t}function SUr(t,n){const i=new Date(t);return Number.isNaN(i.getTime())?t:new Intl.DateTimeFormat(n,{dateStyle:"medium",timeStyle:"short"}).format(i)}function EUr(t){if(!(t instanceof bd)||typeof t.body!="object"||t.body===null)return"UNKNOWN";const n=t.body;if(typeof n.code=="string")return n.code;if(typeof n.error=="object"&&n.error!==null){const i=n.error;if(typeof i.code=="string")return i.code}return"UNKNOWN"}function _Ur({workspace:t,deleting:n,errorCode:i,onCancel:o,onConfirm:a,t:c}){return S.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:S.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"workspace-delete-dialog-title","aria-describedby":"workspace-delete-dialog-description",className:"w-full max-w-md rounded-2xl border border-gray-200 bg-white shadow-xl",children:[S.jsxs("div",{className:"border-b border-gray-200 px-6 py-5",children:[S.jsx("h3",{id:"workspace-delete-dialog-title",className:"text-base font-semibold text-gray-900",children:c("workspace.delete.title")}),S.jsx("p",{id:"workspace-delete-dialog-description",className:"mt-2 text-sm text-gray-600",children:c("workspace.delete.message",{name:t.name})}),S.jsx("p",{className:"mt-2 text-xs text-gray-500",children:c("workspace.delete.note")})]}),i?S.jsx("div",{className:"border-b border-red-100 bg-red-50 px-6 py-3 text-sm text-red-700",role:"alert",children:S.jsxs("div",{className:"flex items-start gap-2",children:[S.jsx(wc,{size:16,className:"mt-0.5 shrink-0"}),S.jsx("span",{children:c(`workspace.delete.error.${i}`,{defaultValue:c("workspace.delete.error.UNKNOWN")})})]})}):null,S.jsxs("div",{className:"flex justify-end gap-2 px-6 py-5",children:[S.jsx("button",{type:"button",onClick:o,disabled:n,className:"rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200 disabled:cursor-not-allowed disabled:opacity-50",children:c("workspace.delete.cancel")}),S.jsxs("button",{type:"button",onClick:a,disabled:n,className:"inline-flex items-center gap-2 rounded-lg bg-red-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-red-600 disabled:cursor-not-allowed disabled:opacity-40",children:[n?S.jsx(Is,{size:14,className:"animate-spin"}):S.jsx(kx,{size:14}),c("workspace.delete.confirm")]})]})]})})}function TUr({standalone:t=!1}){const{t:n,i18n:i}=Zn(),o=Cg(),{setPageHeader:a}=Sd(),c=Zd(ee=>ee.currentWorkspaceId),[u,f]=F.useState(!1),[g,w]=F.useState(null),[x,v]=F.useState(null),[C,E]=F.useState(null),A=km(ee=>ee.workspaces),M=km(ee=>ee.loading),I=km(ee=>ee.limitsLoading),D=km(ee=>ee.error),P=km(ee=>ee.limits),R=km(ee=>ee.fetchLimits),z=km(ee=>ee.deleteWorkspace),U=km(ee=>ee.initialize),W=P==null?void 0:P.workspaces,G=W!==void 0&&W!==-1&&A.length>=W,Y=I||G,te=G&&P?n("limits.banner.workspace.title",{current:A.length,limit:P.workspaces}):void 0;F.useEffect(()=>{t||a({title:n("workspace.title"),actions:S.jsxs("button",{type:"button",disabled:Y,title:te,onClick:()=>f(!0),className:`inline-flex items-center gap-2 rounded-lg border px-4 py-2 text-sm font-medium transition-colors ${Y?"border-gray-200 bg-white text-gray-400":"border-blue-600 bg-blue-600 text-white hover:bg-blue-700"}`,children:[S.jsx(ef,{size:16}),S.jsx("span",{children:n("workspace.create")})]})})},[te,Y,a,t,n]),F.useEffect(()=>{U().catch(()=>{})},[U]),F.useEffect(()=>{R().catch(()=>{})},[c,R]);const Q=F.useMemo(()=>A.find(ee=>ee.id===c)??null,[c,A]),se=S.jsxs("button",{type:"button",disabled:Y,title:te,onClick:()=>f(!0),className:`inline-flex items-center justify-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors ${Y?"bg-gray-100 text-gray-400":"bg-blue-600 text-white hover:bg-blue-700"}`,children:[S.jsx(ef,{size:16}),S.jsx("span",{children:n("workspace.create")})]}),ce=ee=>{if(ee.id===(Q==null?void 0:Q.id)){o(`/ws/${ee.slug}`);return}KJt(ee).then(()=>o(`/ws/${ee.slug}`)).catch(()=>{})},V=()=>{C||(w(null),v(null))},ae=async()=>{if(g){E(g.id),v(null);try{await z(g.id),w(null)}catch(ee){v(EUr(ee))}finally{E(null)}}};if(M&&A.length===0){const ee=S.jsx("div",{className:"rounded-2xl border border-gray-200 bg-white px-6 py-16 text-center text-sm text-gray-500",children:n("workspace.loading")});return t?S.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-50 px-4",children:S.jsx("div",{className:"w-full max-w-xl",children:ee})}):ee}if(D&&A.length===0){const ee=S.jsx("div",{className:"rounded-xl border border-amber-200 bg-amber-50 px-4 py-4 text-sm text-amber-800",children:D});return t?S.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-50 px-4",children:S.jsx("div",{className:"w-full max-w-xl",children:ee})}):ee}if(A.length===0){const ee=S.jsxs("div",{className:"w-full max-w-xl rounded-3xl border border-gray-200 bg-white px-8 py-10 text-center shadow-sm",children:[S.jsx("div",{className:"mx-auto flex h-20 w-20 items-center justify-center rounded-3xl bg-gray-50",children:S.jsx("img",{src:"/assets/crewx-logo.png",alt:n("workspace.entryLogoAlt"),className:"h-12 w-12 object-contain"})}),S.jsx("h1",{className:"mt-6 text-3xl font-semibold tracking-tight text-gray-900",children:n("workspace.entryTitle")}),S.jsx("p",{className:"mt-3 text-sm leading-6 text-gray-500",children:n("workspace.entryDescription")}),S.jsx("div",{className:"mt-8 flex justify-center",children:se})]});return S.jsxs(S.Fragment,{children:[G&&P?S.jsx("div",{className:t?"absolute left-4 right-4 top-4 mx-auto max-w-xl":void 0,children:S.jsx(Che,{resource:"workspace",current:A.length,limit:P.workspaces})}):null,S.jsx("div",{className:`bg-gray-50 px-4 ${t?"flex min-h-screen items-center justify-center py-12":"rounded-3xl py-12"}`,children:ee}),S.jsx(cGt,{open:u,onClose:()=>f(!1)})]})}const de=S.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col gap-6",children:[t?S.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[S.jsxs("div",{children:[S.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-gray-900",children:n("workspace.title")}),S.jsx("p",{className:"mt-2 text-sm text-gray-500",children:n("workspace.emptyDescription")})]}),S.jsx("div",{className:"shrink-0",children:se})]}):null,G&&P?S.jsx(Che,{resource:"workspace",current:A.length,limit:P.workspaces}):null,S.jsx("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2",children:A.map(ee=>{const ue=(Q==null?void 0:Q.id)===ee.id,he=ee.is_current||ue,ge=n(he?"workspace.delete.currentDisabled":"workspace.delete.button");return S.jsxs("div",{className:"relative",children:[he?S.jsx("span",{className:"absolute right-16 top-5 rounded-full bg-white px-2.5 py-1 text-xs font-medium text-blue-700",children:n("workspace.currentBadge")}):null,S.jsxs("button",{type:"button",onClick:()=>ce(ee),className:`w-full rounded-2xl border px-5 py-5 pr-28 text-left shadow-sm transition-colors ${ue?"border-blue-200 bg-blue-50":"border-gray-200 bg-white hover:border-gray-300 hover:bg-gray-50"}`,children:[S.jsxs("div",{className:"min-w-0",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(a5,{size:18,className:ue?"text-blue-600":"text-gray-400"}),S.jsx("h2",{className:"truncate text-lg font-semibold text-gray-900",children:ee.name})]}),S.jsx("p",{className:"mt-2 truncate text-sm text-gray-500",children:CUr(ee.workspace_path)})]}),S.jsxs("div",{className:"mt-5 grid grid-cols-2 gap-3 text-sm",children:[S.jsxs("div",{className:"rounded-xl bg-gray-50 px-3 py-3",children:[S.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:n("workspace.slug")}),S.jsx("p",{className:"mt-1 truncate font-medium text-gray-800",children:ee.slug})]}),S.jsxs("div",{className:"rounded-xl bg-gray-50 px-3 py-3",children:[S.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:n("workspace.updatedAt")}),S.jsx("p",{className:"mt-1 truncate font-medium text-gray-800",children:SUr(ee.updated_at,i.language)})]})]})]}),S.jsx("button",{type:"button",disabled:he,"aria-label":ge,title:ge,onClick:oe=>{oe.stopPropagation(),v(null),w(ee)},className:`absolute right-5 top-5 rounded-lg p-2 transition-colors ${he?"cursor-not-allowed text-gray-300":"text-gray-400 hover:bg-red-50 hover:text-red-600"}`,children:S.jsx(kx,{size:18})})]},ee.id)})})]});return S.jsxs(S.Fragment,{children:[S.jsx("div",{className:t?"min-h-screen bg-gray-50 px-4 py-10 sm:px-6 lg:px-8":void 0,children:de}),g?S.jsx(_Ur,{workspace:g,deleting:C===g.id,errorCode:x,onCancel:V,onConfirm:ae,t:n}):null,S.jsx(cGt,{open:u,onClose:()=>f(!1)})]})}function AUr({cli:t,version:n,authenticated:i,selected:o,description:a,onToggle:c}){const{t:u}=Zn(),f=t.installed,g=f?"border-green-500 border-solid bg-green-50":o?"border-blue-500 border-dashed bg-blue-50":"border-gray-200 border-solid bg-white";return S.jsxs("button",{type:"button",onClick:()=>c(!o),className:`w-full flex items-center gap-3 p-4 rounded-lg border-2 transition-colors text-left cursor-pointer hover:shadow-sm ${g}`,children:[S.jsx(G6,{provider:`cli/${t.name}`,size:20,className:"w-10 h-10 rounded-lg"}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("div",{className:"font-medium text-gray-900",children:t.displayName}),a&&S.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:a}),S.jsx("div",{className:"text-sm text-gray-600 mt-0.5",children:f?S.jsxs(S.Fragment,{children:[S.jsx("span",{children:u("onboarding.s1.statusInstalled",{version:n})}),S.jsx("span",{className:"mx-1.5",children:"·"}),i===!0&&S.jsx("span",{className:"text-green-600",children:u("onboarding.s1.authLoggedIn")}),i===!1&&S.jsx("span",{className:"text-amber-500",children:u("onboarding.s1.authRequired")}),i===null&&S.jsx("span",{className:"text-gray-400",children:u("onboarding.s1.authUnknown")})]}):o?S.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-blue-700 bg-blue-100 rounded-full",children:u("onboarding.s1.willInstall")}):S.jsx("span",{className:"text-gray-400",children:u("onboarding.s1.statusNotInstalled")})})]}),S.jsx("div",{className:"flex-shrink-0",children:S.jsx("div",{className:`w-5 h-5 rounded border-2 flex items-center justify-center ${o?"bg-blue-500 border-blue-500":"border-gray-300 bg-white"}`,children:o&&S.jsx(xg,{className:"w-3.5 h-3.5 text-white"})})})]})}const MUr={claude:"onboarding.s1.descClaude",codex:"onboarding.s1.descCodex",gemini:"onboarding.s1.descGemini",copilot:"onboarding.s1.descCopilot",opencode:"onboarding.s1.descOpencode"};function NUr({onNext:t}){const{t:n}=Zn(),[i,o]=F.useState([]),[a,c]=F.useState(new Set),[u,f]=F.useState(!0),[g,w]=F.useState(!1),x=async()=>{f(!0),w(!1);try{const A=(await wn.getVersions()).filter(D=>D.name!=="crewx"),M=await Promise.all(A.map(async D=>{if(!D.installed)return{...D};try{const P=await wn.check(D.name);return{...D,checkResult:P}}catch{return{...D}}}));o(M);const I=new Set(M.filter(D=>D.installed).map(D=>D.name));c(I)}catch{w(!0)}finally{f(!1)}};F.useEffect(()=>{x()},[]);const v=(E,A)=>{c(M=>{const I=new Set(M);return A?I.add(E):I.delete(E),I})},C=()=>{const E=i.filter(A=>a.has(A.name));t(E)};return u?S.jsxs("div",{className:"flex flex-col items-center gap-3 py-12",children:[S.jsx(Is,{className:"w-8 h-8 animate-spin text-blue-500"}),S.jsx("p",{className:"text-gray-500",children:n("onboarding.s1.loadingCards")})]}):g?S.jsxs("div",{className:"flex flex-col items-center gap-3 py-12",children:[S.jsx("p",{className:"text-gray-900 font-medium",children:n("onboarding.s1.errorTitle")}),S.jsx("p",{className:"text-gray-500",children:n("onboarding.s1.errorDesc")}),S.jsx("button",{type:"button",onClick:x,className:"px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600",children:n("onboarding.common.retry")})]}):S.jsxs("div",{className:"space-y-4",children:[i.map(E=>{var A;return S.jsx(AUr,{cli:E,version:E.currentVersion??void 0,authenticated:((A=E.checkResult)==null?void 0:A.authenticated)??null,selected:a.has(E.name),description:n(MUr[E.name]??""),onToggle:M=>v(E.name,M)},E.name)}),S.jsxs("div",{className:"pt-4",children:[S.jsx("button",{type:"button",onClick:C,disabled:a.size===0,className:"w-full px-6 py-3 bg-blue-500 text-white rounded-lg hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed font-medium",children:n("onboarding.common.next")}),a.size===0&&S.jsx("p",{className:"text-sm text-amber-600 text-center mt-2",children:n("onboarding.s1.noToolsSelected")})]})]})}function jUr({selectedCLIs:t,onComplete:n,onPrev:i}){const{t:o}=Zn(),[a,c]=F.useState([]),[u,f]=F.useState([]),[g,w]=F.useState(!1),[x,v]=F.useState(null),C=F.useRef(null),E=F.useRef(!1);F.useEffect(()=>{const U=t.map(W=>{var G,Y;return{name:W.name,displayName:W.displayName,status:"pending",needsInstall:!W.installed,needsLogin:((G=W.checkResult)==null?void 0:G.authenticated)!==!0,loginCommand:((Y=W.checkResult)==null?void 0:Y.loginCommand)??null}});c(U)},[t]);const A=F.useCallback((U,W="output")=>{f(G=>[...G,{text:U,type:W}])},[]),M=F.useCallback((U,W)=>{c(G=>G.map(Y=>Y.name===U?{...Y,...W}:Y))},[]);F.useEffect(()=>{C.current&&(C.current.scrollTop=C.current.scrollHeight)},[u]),F.useEffect(()=>{a.length===0||E.current||(E.current=!0,I())},[a.length]);const I=async()=>{const U=a.filter(Y=>Y.needsInstall);if(U.length>0){A(o("onboarding.s2.installStarting"),"output");const Y=U.map(async te=>{const Q=IUr(te.name);if(!Q){A("$ curl -fsSL https://antigravity.google/cli/install.sh | bash","command"),A(`${te.displayName} — 수동 설치가 필요합니다. 위 명령어를 터미널에서 실행하세요.`,"output"),M(te.name,{status:"done",needsInstall:!1});return}M(te.name,{status:"installing"}),A(`$ npm install -g ${Q}`,"command");try{await wn.update(te.name),M(te.name,{status:"installed",needsInstall:!1}),A(`✔ ${te.displayName} ${o("onboarding.s2.installOk")}`,"success")}catch(se){M(te.name,{status:"failed"});const ce=se instanceof Error?se.message:String(se);A(`✘ ${te.displayName}: ${ce}`,"error")}});await Promise.allSettled(Y)}const W=await Promise.all(a.map(async Y=>{if(Y.status==="failed")return Y;try{const te=await wn.check(Y.name);return{...Y,needsLogin:te.authenticated!==!0,loginCommand:te.loginCommand}}catch{return Y}}));c(W);const G=W.filter(Y=>Y.needsLogin&&Y.status!=="failed");for(const Y of G){const te=a.find(ce=>ce.name===Y.name);if((te==null?void 0:te.status)==="failed")continue;const Q=Y.loginCommand;if(!Q){M(Y.name,{status:"done"});continue}M(Y.name,{status:"logging_in"}),await wn.cliLogin(Y.name).catch(()=>{}),A(`$ ${Q}`,"command"),A(o("onboarding.s2.loginWaiting",{name:Y.displayName}),"output"),await D(Y.name)?(M(Y.name,{status:"done"}),A(`✔ ${Y.displayName} ${o("onboarding.s2.loginOk")}`,"success")):(A(`⚠ ${Y.displayName} ${o("onboarding.s2.loginSkipped")}`,"output"),M(Y.name,{status:"done"}))}c(Y=>Y.map(te=>te.status==="pending"||te.status==="installed"?{...te,status:"done"}:te)),w(!0)},D=async U=>{for(let W=0;W<60;W++){await new Promise(G=>setTimeout(G,3e3));try{if((await wn.check(U)).authenticated===!0)return!0}catch{}}return!1},P=async(U,W)=>{await navigator.clipboard.writeText(U),v(W),setTimeout(()=>v(null),2e3)},R=U=>{switch(U){case"installing":case"logging_in":return S.jsx(Is,{className:"w-4 h-4 animate-spin text-blue-500"});case"done":case"installed":return S.jsx(xg,{className:"w-4 h-4 text-green-600"});case"failed":return S.jsx(I9,{className:"w-4 h-4 text-red-500"});default:return S.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-gray-300"})}},z=U=>{switch(U.status){case"installing":return o("onboarding.s2.statusInstalling");case"installed":return`✅ ${o("onboarding.s2.statusInstalled")}`;case"logging_in":return`✅ ${o("onboarding.s2.statusInstalled")} · ⏳ ${o("onboarding.s2.statusLoggingIn")}`;case"done":return`✅ ${o("onboarding.s2.statusComplete")}`;case"failed":return`❌ ${o("onboarding.s2.statusFailed")}`;default:return""}};return S.jsxs("div",{className:"space-y-6",children:[S.jsx("div",{className:"space-y-3",children:a.map(U=>S.jsxs("div",{className:"flex items-center gap-3 p-3 bg-white border border-gray-200 rounded-lg",children:[R(U.status),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("span",{className:"font-medium text-gray-900",children:U.displayName}),S.jsx("span",{className:"ml-2 text-sm text-gray-500",children:z(U)})]})]},U.name))}),S.jsxs("div",{className:"rounded-lg overflow-hidden border border-gray-700",children:[S.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-gray-800 border-b border-gray-700",children:[S.jsxs("div",{className:"flex gap-1.5",children:[S.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),S.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),S.jsx("div",{className:"w-3 h-3 rounded-full bg-green-500"})]}),S.jsxs("span",{className:"text-xs text-gray-400 ml-2",children:["crewx — ",o("onboarding.s2.setupLog")]})]}),S.jsxs("div",{ref:C,className:"bg-gray-900 p-4 font-mono text-sm text-gray-100 max-h-64 overflow-y-auto space-y-1",children:[u.length===0&&S.jsx("div",{className:"text-gray-500",children:o("onboarding.s2.waitingForSetup")}),u.map((U,W)=>S.jsxs("div",{className:"flex items-start gap-2 group",children:[S.jsx("span",{className:U.type==="command"?"text-cyan-400":U.type==="success"?"text-green-400":U.type==="error"?"text-red-400":"text-gray-300",children:U.text}),U.type==="command"&&S.jsx("button",{type:"button",onClick:()=>P(U.text.replace(/^\$ /,""),`log-${W}`),className:"flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity text-gray-500 hover:text-white",children:x===`log-${W}`?S.jsx(xg,{className:"w-3.5 h-3.5"}):S.jsx(x5,{className:"w-3.5 h-3.5"})})]},W))]})]}),S.jsxs("div",{className:"flex gap-3 pt-2",children:[S.jsx("button",{type:"button",onClick:i,className:"flex-1 px-6 py-3 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 font-medium",children:o("onboarding.common.prev")}),S.jsx("button",{type:"button",onClick:n,className:`flex-1 px-6 py-3 rounded-lg font-medium ${g?"bg-blue-500 text-white hover:bg-blue-600 animate-pulse shadow-lg shadow-blue-200":"bg-blue-500 text-white hover:bg-blue-600"}`,children:o("onboarding.common.start")})]})]})}const DUr={claude:"@anthropic-ai/claude-code",codex:"@openai/codex",gemini:"@google/gemini-cli",antigravity:"",copilot:"@github/copilot",opencode:"opencode-ai"};function IUr(t){return DUr[t]??t}const Rdn=["#step1","#step2"],OUr=2;function ULe(t){return Rdn.includes(t)?t:"#step1"}function LUr(t){return Rdn.indexOf(t)+1}function PUr(){const{t}=Zn(),n=Cg(),i=ob(),[o,a]=F.useState(()=>ULe(i.hash||"#step1")),[c,u]=F.useState([]);F.useEffect(()=>{const E=ULe(i.hash);a(E),i.hash!==E&&(window.location.hash=E)},[i.hash]),F.useEffect(()=>{const E=()=>{a(ULe(window.location.hash))};return window.addEventListener("hashchange",E),()=>window.removeEventListener("hashchange",E)},[]),F.useEffect(()=>{window.location.hash||(window.location.hash="#step1")},[]);const f=F.useCallback(E=>{window.location.hash=E,a(E)},[]);F.useEffect(()=>{o!=="#step1"&&c.length===0&&f("#step1")},[o,c.length,f]);const g=F.useCallback(()=>{Zc.getState().set("ui",{onboardingDismissed:!0});const E=Zd.getState().currentWorkspaceSlug;n(E?`/ws/${E}`:"/workspaces",{replace:!0})},[n]),w=()=>{g()},x=E=>{if(u(E),c5("onboarding_step_complete",{step_id:"S1"}),E.every(M=>{var I;return M.installed&&((I=M.checkResult)==null?void 0:I.authenticated)===!0})){g();return}f("#step2")},v=()=>{c5("onboarding_step_complete",{step_id:"S2"}),g()},C=t(o==="#step1"?"onboarding.common.skipS1":"onboarding.common.skipS2");return S.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col",children:[S.jsxs("div",{className:"text-center pt-12 pb-6",children:[S.jsx("p",{className:"text-sm text-gray-500 mb-2",children:t("onboarding.common.stepOf",{current:LUr(o),total:OUr})}),S.jsxs("h1",{className:"text-2xl font-bold text-gray-900",children:[o==="#step1"&&t("onboarding.s1.title"),o==="#step2"&&t("onboarding.s2.title")]}),o==="#step1"&&S.jsx("p",{className:"text-gray-500 mt-2",children:t("onboarding.s1.subtitle")}),o==="#step2"&&S.jsx("p",{className:"text-gray-500 mt-2",children:t("onboarding.s2.subtitle")})]}),S.jsxs("div",{className:"flex-1 mx-auto w-full px-4 pb-8 max-w-lg",children:[o==="#step1"&&S.jsx(NUr,{onNext:x}),o==="#step2"&&c.length>0&&S.jsx(jUr,{selectedCLIs:c,onComplete:v,onPrev:()=>f("#step1")}),S.jsx("div",{className:"text-center mt-6",children:S.jsx("button",{type:"button",onClick:w,className:"text-sm text-gray-400 hover:text-gray-600 underline",children:C})})]})]})}function RUr({onDismiss:t}){const{t:n}=Zn(),i=Cg(),o=Zc(u=>u.set),a=()=>{i("/onboarding",{replace:!0})},c=()=>{o("ui",{onboardingDismissed:!0}),t()};return S.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:S.jsxs("div",{className:"bg-white rounded-xl shadow-2xl p-6 max-w-sm mx-4 text-center",children:[S.jsx("h2",{className:"text-lg font-bold text-gray-900 mb-2",children:n("onboarding.popup.title")}),S.jsx("p",{className:"text-sm text-gray-500 mb-6",children:n("onboarding.popup.description")}),S.jsxs("div",{className:"flex gap-3",children:[S.jsx("button",{type:"button",onClick:c,className:"flex-1 px-4 py-2.5 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 font-medium text-sm",children:n("onboarding.popup.no")}),S.jsx("button",{type:"button",onClick:a,className:"flex-1 px-4 py-2.5 bg-blue-500 text-white rounded-lg hover:bg-blue-600 font-medium text-sm",children:n("onboarding.popup.yes")})]})]})})}function $Ur(){const t=Zc(o=>o.ui.onboardingDismissed),[n,i]=F.useState(t?"done":"loading");return F.useEffect(()=>{if(t){i("done");return}wn.getAllTasks({status:["success"],limit:1}).then(o=>{const a=o.tasks.length>0;i(a?"done":"popup")}).catch(()=>{i("done")})},[t]),n==="loading"?S.jsx("div",{"data-testid":"onboarding-guard-loading",className:"flex items-center justify-center h-screen bg-gray-50",children:S.jsx(Is,{className:"w-8 h-8 animate-spin text-blue-500"})}):n==="popup"?S.jsxs(S.Fragment,{children:[S.jsx(RUr,{onDismiss:()=>i("done")}),S.jsx(ahe,{})]}):S.jsx(ahe,{})}class FUr extends F.Component{constructor(){super(...arguments);sn(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(i,o){CVn(SVn(i)),console.error("ErrorBoundary caught an error",i,o)}render(){return this.state.hasError?this.props.fallback:this.props.children}}function BUr({routes:t}){const{pathname:n}=ob();return F.useEffect(()=>{var a;const i=OFe(t,{pathname:n}),o=(a=i==null?void 0:i.at(-1))==null?void 0:a.route.handle;o!=null&&o.screenId&&(o.manualTracking||$Jt(o.screenId,o.screenTitle))},[n,t]),null}const zUr={success:{container:"border-emerald-200 bg-emerald-50 text-emerald-700",icon:S.jsx(bR,{size:18,className:"shrink-0"})},error:{container:"border-red-200 bg-red-50 text-red-700",icon:S.jsx(wc,{size:18,className:"shrink-0"})},info:{container:"border-blue-200 bg-blue-50 text-blue-700",icon:S.jsx(wR,{size:18,className:"shrink-0"})}};function HUr(){const t=Lm(n=>n.toasts);return t.length===0?null:S.jsx("div",{className:"pointer-events-none fixed bottom-6 right-6 z-50 flex w-full max-w-sm flex-col gap-3 px-4 sm:w-auto sm:px-0",children:t.map(n=>{const i=zUr[n.type];return S.jsxs("div",{role:n.type==="error"?"alert":"status","aria-live":n.type==="error"?"assertive":"polite",className:`pointer-events-auto flex items-start gap-3 rounded-lg border px-4 py-3 text-sm font-medium shadow-lg ${i.container}`,children:[i.icon,S.jsx("div",{className:"min-w-0 flex-1 leading-5",children:n.message})]},n.id)})})}function UUr(){const{t}=Zn(),n=DD(u=>u.phase),i=DD(u=>u.targetWorkspace),o=DD(u=>u.error),a=DD(u=>u.clear);if(n==="idle")return null;const c=n==="error";return S.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-gray-950/45 px-4",children:S.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-gray-200 bg-white p-6 shadow-xl",children:[S.jsx("div",{className:`flex h-12 w-12 items-center justify-center rounded-full ${c?"bg-red-50 text-red-500":"bg-blue-50 text-blue-500"}`,children:c?S.jsx(wc,{size:22}):S.jsx(Is,{size:22,className:"animate-spin"})}),S.jsx("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:t(c?"workspace.switchErrorTitle":"workspace.switchingTitle")}),S.jsx("p",{className:"mt-2 text-sm text-gray-500",children:c?o||t("workspace.switchErrorDescription"):t("workspace.switchingDescription",{name:(i==null?void 0:i.name)??""})}),c?S.jsx("div",{className:"mt-5",children:S.jsx("button",{type:"button",onClick:a,className:"inline-flex items-center justify-center rounded-lg bg-gray-900 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-gray-800",children:t("common.close")})}):null]})})}const WUr=F.lazy(()=>Cl(()=>import("./MarketPage-D8C-Rlao.js"),__vite__mapDeps([])));function ec(t,n,i){return{screenId:t,screenTitle:n,...i}}function qUr(){const{slug:t}=Ff(),n=Zd(u=>u.setCurrentWorkspaceId),i=Zd(u=>u.setCurrentWorkspaceSlug),o=Cg(),[a,c]=F.useState(null);return F.useEffect(()=>{if(!t)return;let u=!0;return c(null),i(t),wn.getWorkspaces().then(f=>{if(!u)return;const g=f.workspaces.find(w=>w.slug===t)??null;if(g){n(g.id),i(g.slug),c(g.slug);return}n(null),i(null),c(null),o("/workspaces",{replace:!0})}).catch(()=>{u&&(n(null),i(null),c(null),o("/workspaces",{replace:!0}))}),()=>{u=!1}},[t,n,i,o]),a!==t?S.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-50",children:S.jsx(Is,{size:24,className:"animate-spin text-gray-400"})}):S.jsx(ahe,{})}function GUr(){const t=Zd(f=>f.currentWorkspaceSlug),n=Zd(f=>f.setCurrentWorkspaceId),i=Zd(f=>f.setCurrentWorkspaceSlug),[o,a]=F.useState(()=>t?`/ws/${t}`:null),[c,u]=F.useState(()=>!t);return F.useEffect(()=>{if(t){a(`/ws/${t}`),u(!1);return}let f=!0;return u(!0),a(null),wn.getWorkspaces().then(g=>{if(!f)return;const w=g.workspaces.find(x=>x.is_current)??null;if(w){n(w.id),i(w.slug),a(`/ws/${w.slug}`),u(!1);return}n(null),i(null),a("/workspaces"),u(!1)}).catch(()=>{f&&(n(null),i(null),a("/workspaces"),u(!1))}),()=>{f=!1}},[t,n,i]),o?S.jsx(_D,{to:o,replace:!0}):c?S.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-50",children:S.jsx(Is,{size:24,className:"animate-spin text-gray-400"})}):S.jsx(_D,{to:"/workspaces",replace:!0})}function VUr(){return S.jsx(IJt,{children:S.jsx(TUr,{standalone:!0})})}const $dn=_Gn(S.jsxs(S.Fragment,{children:[S.jsx(da,{path:"/onboarding",element:S.jsx(PUr,{}),handle:ec("ONBUI001","온보딩 위자드")}),S.jsx(da,{path:"/workspaces",element:S.jsx(VUr,{}),handle:ec("WKSUI001","워크스페이스 관리")}),S.jsx(da,{path:"/",element:S.jsx(GUr,{})}),S.jsx(da,{path:"/ws/:slug",element:S.jsx(qUr,{}),children:S.jsx(da,{element:S.jsx($Ur,{}),children:S.jsxs(da,{element:S.jsx(IKn,{}),children:[S.jsx(da,{index:!0,element:S.jsx(AWt,{}),handle:ec("THDUI000","새 대화")}),S.jsx(da,{path:"tasks",element:S.jsx(lAr,{}),handle:ec("TSKUI001","태스크 목록")}),S.jsx(da,{path:"tasks/:taskId",element:S.jsx(O6r,{}),handle:ec("TSKUI002","태스크 상세")}),S.jsx(da,{path:"threads/new",element:S.jsx(AWt,{}),handle:ec("THDUI000","새 대화")}),S.jsx(da,{path:"threads",element:S.jsx(uOr,{}),handle:ec("THDUI001","대화 목록")}),S.jsx(da,{path:"threads/:threadId",element:S.jsx(COr,{}),handle:ec("THDUI002","대화창")}),S.jsx(da,{path:"workspaces",element:S.jsx(_D,{to:"/workspaces",replace:!0}),handle:ec("WKSUI001","워크스페이스 관리")}),S.jsx(da,{path:"projects",element:S.jsx(AOr,{}),handle:ec("PJTUI000","프로젝트 목록")}),S.jsx(da,{path:"projects/new",element:S.jsx(jOr,{}),handle:ec("PJTUI002","프로젝트 생성")}),S.jsx(da,{path:"projects/:id",element:S.jsx(POr,{}),handle:ec("PJTUI001","프로젝트 상세")}),S.jsx(da,{path:"daily-planner",element:S.jsx(tLr,{}),handle:ec("PLNUI001","데일리 플래너")}),S.jsx(da,{path:"cron-schedules",element:S.jsx(ALr,{}),handle:ec("CRONUI001","크론 스케줄")}),S.jsx(da,{path:"goals",element:S.jsx(PLr,{}),handle:ec("GOAUI000","목표 목록")}),S.jsx(da,{path:"goals/:goalId",element:S.jsx(CFr,{}),handle:ec("GOAUI001","목표 상세")}),S.jsx(da,{path:"search",element:S.jsx(E8r,{}),handle:{screenId:"SRCHUI001",screenTitle:"통합 검색"}}),S.jsx(da,{path:"docs",element:S.jsx(C8r,{}),handle:ec("DOCUI001","문서 관리")}),S.jsx(da,{path:"workflows",element:S.jsx(_Fr,{}),handle:ec("WFLUI001","워크플로 목록")}),S.jsx(da,{path:"workflows/:id",element:S.jsx(pUr,{}),handle:ec("WFLUI002","워크플로 상세",{manualTracking:!0})}),S.jsx(da,{path:"market",element:S.jsx(F.Suspense,{fallback:S.jsx("div",{className:"flex items-center justify-center py-16",children:S.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-gray-300 border-t-blue-500"})}),children:S.jsx(WUr,{})}),handle:ec("MKTUI001","마켓")}),S.jsx(da,{path:"agents",element:S.jsx(hAr,{}),handle:ec("AGTUI001","에이전트 관리")}),S.jsx(da,{path:"agents/new",element:S.jsx(LUt,{}),handle:ec("AGTUI002","에이전트 추가/편집")}),S.jsx(da,{path:"agents/:agentId/edit",element:S.jsx(LUt,{}),handle:ec("AGTUI002","에이전트 추가/편집")}),S.jsx(da,{path:"skills",element:S.jsx(_D,{to:"market",replace:!0})}),S.jsx(da,{path:"cli",element:S.jsx(UKn,{}),handle:ec("CLIVUI001","CLI 버전 관리")}),S.jsx(da,{path:"usage",element:S.jsx(WQn,{}),handle:ec("USGUI002","Usage 사용량")}),S.jsx(da,{path:"memory",element:S.jsx(_D,{to:"docs",replace:!0}),handle:ec("DOCUI001","문서 관리")}),S.jsx(da,{path:"graph",element:S.jsx(_D,{to:"docs",replace:!0}),handle:ec("DOCUI001","문서 관리")}),S.jsx(da,{path:"wbs/*",element:S.jsx(_D,{to:"..",relative:"path",replace:!0}),handle:ec("THDUI000","새 대화")}),S.jsx(da,{path:"settings",element:S.jsx(cZn,{}),handle:ec("STGUI001","환경 설정")}),S.jsx(da,{path:"test",element:S.jsx(mUr,{})})]})})})]}));function KUr(){const{t}=Zn();return S.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-50 px-4",children:S.jsxs("div",{className:"w-full max-w-md rounded-lg border border-red-200 bg-white p-6 text-center shadow-sm",children:[S.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:t("common.somethingWentWrong")}),S.jsx("p",{className:"mt-2 text-sm text-gray-500",children:t("common.tryRefreshingPage")}),S.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"mt-5 inline-flex items-center justify-center rounded-lg bg-blue-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-600",children:t("common.refresh")})]})})}function JUr(){return fGn($dn)}function YUr(){const t=Zc(n=>n.ui.theme);return F.useEffect(()=>{lHn(t)},[t]),S.jsx(XGn,{children:S.jsx(FUr,{fallback:S.jsx(KUr,{}),children:S.jsx(PKn,{children:S.jsxs(S.Fragment,{children:[S.jsx(BUr,{routes:$dn}),S.jsx(JUr,{}),S.jsx(HUr,{}),S.jsx(UUr,{})]})})})})}vVn();WLe.createRoot(document.getElementById("root")).render(S.jsx(or.StrictMode,{children:S.jsx(YUr,{})}));export{kgr as $,qV as A,cur as B,hze as C,UQt as D,Qv as E,O1r as F,Bwr as G,uzt as H,Ecr as I,bdr as J,_gr as K,H7 as L,iWr as M,T0e as N,OBe as O,rWr as P,wtn as Q,I1r as R,tY as S,Xcr as T,eY as U,rs as V,xs as W,bcr as X,ZQt as Y,E1r as Z,pe as _,rur as a,vg as a$,TBt as a0,_Bt as a1,gWr as a2,uWr as a3,hWr as a4,fWr as a5,lWr as a6,ZBe as a7,pWr as a8,cWr as a9,Fdr as aA,In as aB,nf as aC,wn as aD,Zn as aE,Sd as aF,F as aG,S as aH,y0 as aI,wc as aJ,mC as aK,Is as aL,TFe as aM,DFe as aN,rqn as aO,kx as aP,ef as aQ,QWn as aR,w9 as aS,pJt as aT,V7t as aU,she as aV,cJt as aW,gJt as aX,MFe as aY,Op as aZ,x5 as a_,yP as aa,bWr as ab,mWr as ac,dWr as ad,Xbr as ae,qrn as af,SWr as ag,Ks as ah,bC as ai,Sbr as aj,Rwr as ak,CWr as al,EWr as am,vWr as an,ss as ao,kWr as ap,GBe as aq,Ewr as ar,vwr as as,xwr as at,Cgr as au,t9 as av,S5 as aw,DR as ax,h0e as ay,Bdr as az,nur as b,Cl as b$,Tx as b0,tln as b1,MWr as b2,xg as b3,Qa as b4,NWr as b5,bc as b6,v_r as b7,LUn as b8,RUn as b9,rmr as bA,oY as bB,kD as bC,Kmr as bD,UBt as bE,$9 as bF,smr as bG,oze as bH,nmr as bI,lmr as bJ,NR as bK,Qmr as bL,bwr as bM,kg as bN,vnn as bO,jR as bP,Ytn as bQ,eC as bR,KV as bS,Z1 as bT,Uhr as bU,JBe as bV,etn as bW,iY as bX,rtn as bY,aWr as bZ,Hlr as b_,FUn as ba,FHn as bb,GUn as bc,uqn as bd,sWn as be,tWn as bf,LWn as bg,hUn as bh,iJt as bi,yR as bj,xqn as bk,RWn as bl,San as bm,Jan as bn,wan as bo,kan as bp,dHe as bq,Zd as br,z6r as bs,_0e as bt,s1r as bu,ayr as bv,Zmr as bw,tpe as bx,Qhe as by,imr as bz,Pl as c,xo as d,QQt as e,gg as f,sur as g,V7 as h,d9 as i,Hdr as j,AR as k,Pn as l,Qtn as m,aur as n,our as o,sWr as p,TWr as q,_Wr as r,iur as s,oWr as t,nC as u,tur as v,R1r as w,wdr as x,mwr as y,wWr as z};
|
|
1283
|
+
... Falling back to non-web worker version.`);if(!z.workerFactory){var G=i("./elk-worker.min.js"),Y=G.Worker;z.workerFactory=function(te){return new Y(te)}}return g(this,P,[z])}return E(P,D),u(P)}(M);Object.defineProperty(o.exports,"__esModule",{value:!0}),o.exports=I,I.default=I},{"./elk-api.js":1,"./elk-worker.min.js":2,"web-worker":4}],4:[function(i,o,a){var c=typeof Worker<"u"?Worker:void 0;o.exports=c},{}]},{},[3])(3)})})(jdn);var JHr=jdn.exports;const YHr=S5(JHr),XHr=210,ZG=72,QHr={branch:86,expression:ZG,parallel:ZG,join:ZG,end:ZG,error:ZG,approval:96};function Ddn(t){return QHr[t]??122}const Idn="#64748b",ZHr=new YHr,eUr={type:_J.ArrowClosed,color:Idn,width:16,height:16};function tUr(t){const n=new Set(t.map(c=>c.id)),i=new Map(t.map((c,u)=>[c.id,u])),o=[],a=(c,u,f)=>{if(!u||!n.has(u))return;const g=`${c}->${u}${f?`:${f}`:""}`;if(o.some(C=>C.id===g))return;const w=i.get(c)??0,v=(i.get(u)??0)<w;o.push({id:g,source:c,target:u,type:"workflowRoute",label:f,data:{...f?{label:f}:{},...v?{backEdge:!0}:{}},markerEnd:eUr,style:{stroke:v?"#94a3b8":Idn,strokeWidth:v?1.5:1.7,...v?{strokeDasharray:"6 5"}:{}},labelBgPadding:[8,4],labelBgBorderRadius:6,labelBgStyle:{fill:"#ffffff",fillOpacity:.88},labelStyle:{fill:"#475569",fontSize:11,fontWeight:600},className:f?"workflow-edge workflow-edge-labeled":"workflow-edge"})};for(const c of t){if(a(c.id,c.next),c.branches)for(const[u,f]of Object.entries(c.branches))a(c.id,f,u);for(const u of c.parallelBranches??[])a(c.id,u,"parallel");a(c.id,c.join,"join"),a(c.id,c.onApprove,"approve"),a(c.id,c.onReject,"reject")}return o}function nUr(t,n){return{id:"workflow",layoutOptions:{"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.spacing.nodeNode":"64","elk.spacing.edgeEdge":"18","elk.spacing.edgeNode":"28","elk.layered.spacing.nodeNodeBetweenLayers":"88","elk.layered.spacing.edgeNodeBetweenLayers":"32","elk.layered.spacing.edgeEdgeBetweenLayers":"18","elk.layered.spacing.nodeNode":"64","elk.layered.crossingMinimization.strategy":"LAYER_SWEEP","elk.layered.nodePlacement.strategy":"BRANDES_KOEPF","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES","elk.layered.cycleBreaking.strategy":"GREEDY","elk.padding":"[top=36,left=36,bottom=36,right=36]"},children:t.map(i=>({id:i.id,width:XHr,height:Ddn(i.type)})),edges:n.map(i=>{var o,a,c;return{id:i.id,sources:[(o=i.data)!=null&&o.backEdge?i.target:i.source],targets:[(a=i.data)!=null&&a.backEdge?i.source:i.target],labels:(c=i.data)!=null&&c.label?[{text:String(i.data.label),width:56,height:18}]:void 0}})}}function rUr(t,n){var o;const i=new Map;for(const a of t.edges??[]){const u=(o=a.sections)==null?void 0:o[0];if(!u)continue;const f=[u.startPoint,...u.bendPoints??[],u.endPoint];i.set(a.id,n.has(a.id)?f.reverse():f)}return i}async function iUr(t){const n=tUr(t),i=new Set(n.filter(f=>{var g;return(g=f.data)==null?void 0:g.backEdge}).map(f=>f.id)),o=await ZHr.layout(nUr(t,n)),a=new Map((o.children??[]).map(f=>[f.id,f])),c=rUr(o,i),u=[];for(const f of t){const g=a.get(f.id);u.push({id:f.id,type:"workflow",position:{x:(g==null?void 0:g.x)??0,y:(g==null?void 0:g.y)??0},data:{label:f.id,nodeId:f.id,type:f.type,typeLabel:f.typeLabel,...f.agent?{agent:f.agent}:{},...f.description?{description:f.description}:{},...f.input?{input:f.input}:{},...f.condition?{condition:f.condition}:{}},draggable:!1,selectable:!0})}return{nodes:u,edges:n.map(f=>({...f,data:{...f.data??{},...c.has(f.id)?{points:c.get(f.id)}:{}}}))}}const D$e={agent_task:"border-blue-200 bg-blue-50 text-blue-700",branch:"border-amber-200 bg-amber-50 text-amber-700",approval:"border-emerald-200 bg-emerald-50 text-emerald-700",parallel:"border-violet-200 bg-violet-50 text-violet-700",join:"border-violet-200 bg-violet-50 text-violet-700",skill_task:"border-cyan-200 bg-cyan-50 text-cyan-700",shell_task:"border-rose-200 bg-rose-50 text-rose-700",expression:"border-slate-200 bg-slate-50 text-slate-700",end:"border-gray-200 bg-gray-50 text-gray-700",error:"border-red-200 bg-red-50 text-red-700"};function sUr({data:t,selected:n}){const{t:i}=Zn(),o=i(`workflowRun.nodeType.${t.type}`,{defaultValue:t.typeLabel}),a=D$e[t.type]??D$e.agent_task;return S.jsxs("div",{style:{height:Ddn(t.type)},className:`w-[210px] overflow-hidden rounded-xl border bg-white p-3 shadow-sm transition-shadow ${n?"shadow-md ring-2 ring-gray-900/10":""}`,children:[S.jsx(fR,{type:"target",position:is.Top,className:"opacity-0"}),S.jsxs("div",{className:"flex items-start justify-between gap-2",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("p",{className:"truncate font-mono text-[11px] font-semibold text-gray-500",children:t.nodeId}),S.jsx("p",{className:"mt-1 line-clamp-2 text-sm font-semibold leading-snug text-gray-950",children:t.description||t.nodeId})]}),S.jsx("span",{className:`shrink-0 rounded-full border px-2 py-1 text-[10px] font-semibold ${a}`,children:o})]}),t.agent?S.jsx("div",{className:"mt-3 inline-flex max-w-full items-center gap-1 rounded-md bg-gray-100 px-2 py-1 text-[11px] font-medium text-gray-600",children:S.jsxs("span",{className:"truncate",children:["@",t.agent]})}):null,S.jsx(fR,{type:"source",position:is.Bottom,className:"opacity-0"})]})}const oUr={workflow:F.memo(sUr)},aUr=8;function lUr(t){if(t.length===0)return"";if(t.length<3)return t.map((o,a)=>`${a===0?"M":"L"} ${o.x} ${o.y}`).join(" ");let n=`M ${t[0].x} ${t[0].y}`;for(let o=1;o<t.length-1;o++){const a=t[o-1],c=t[o],u=t[o+1],f=Math.hypot(c.x-a.x,c.y-a.y),g=Math.hypot(u.x-c.x,u.y-c.y),w=Math.min(aUr,f/2,g/2);if(w<1||f===0||g===0){n+=` L ${c.x} ${c.y}`;continue}const x=c.x-(c.x-a.x)/f*w,v=c.y-(c.y-a.y)/f*w,C=c.x+(u.x-c.x)/g*w,E=c.y+(u.y-c.y)/g*w;n+=` L ${x} ${v} Q ${c.x} ${c.y} ${C} ${E}`}const i=t[t.length-1];return`${n} L ${i.x} ${i.y}`}function cUr(t){if(t.length===0)return{x:0,y:0};if(t.length===1)return t[0];const n=Math.floor((t.length-1)/2),i=t[n],o=t[n+1]??i;return{x:(i.x+o.x)/2,y:(i.y+o.y)/2}}function uUr({id:t,data:n,markerEnd:i,style:o,sourceX:a,sourceY:c,targetX:u,targetY:f}){var v;const g=(v=n==null?void 0:n.points)!=null&&v.length?n.points:[{x:a,y:c},{x:u,y:f}],w=lUr(g),x=cUr(g);return S.jsxs(S.Fragment,{children:[S.jsx("path",{id:t,d:w,markerEnd:i,style:o,className:"react-flow__edge-path workflow-edge-path",fill:"none"}),n!=null&&n.label?S.jsx(vHr,{children:S.jsx("span",{className:"pointer-events-none absolute -translate-x-1/2 -translate-y-1/2 rounded-md border border-gray-200 bg-white/90 px-2 py-0.5 text-[11px] font-semibold text-gray-600 shadow-sm",style:{transform:`translate(${x.x}px, ${x.y}px) translate(-50%, -50%)`},children:n.label})}):null]})}const dUr={workflowRoute:F.memo(uUr)};function Nde({width:t,onClose:n,children:i}){const{t:o}=Zn();return S.jsxs("div",{className:`absolute right-14 top-3 z-10 flex max-h-[520px] ${t} flex-col overflow-hidden rounded-xl border border-gray-200 bg-white text-sm shadow-lg`,children:[S.jsx("button",{type:"button",onClick:n,"aria-label":o("workflow.graph.closePanel"),title:o("workflow.graph.closePanel"),className:"absolute right-2 top-2 z-10 inline-flex h-7 w-7 items-center justify-center rounded-md text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600",children:S.jsx(Op,{size:15})}),i]})}function fUr({openPanel:t,workflow:n,selectedNode:i,stateVariables:o,onClose:a}){const{t:c}=Zn();return t?t==="state"?S.jsx(Nde,{width:"w-80",onClose:a,children:S.jsxs("div",{className:"overflow-y-auto p-4",children:[S.jsxs("p",{className:"flex items-center gap-2 pr-6 font-semibold text-gray-950",children:[S.jsx(oJt,{size:15,className:"text-gray-500"}),c("workflow.stateVariablesTitle")]}),o.length>0?S.jsx("ul",{className:"mt-3 space-y-2 border-t border-gray-200 pt-3",children:o.map(u=>S.jsxs("li",{className:"flex items-center gap-2",children:[S.jsx("span",{"aria-hidden":"true",className:"h-1.5 w-1.5 rounded-full bg-gray-300"}),S.jsx("span",{className:"font-mono text-[11px] text-gray-600",children:u})]},u))}):S.jsx("p",{className:"mt-3 border-t border-gray-200 pt-3 text-gray-500",children:c("workflow.graph.noStateVariables")})]})}):t==="legend"?S.jsx(Nde,{width:"w-72",onClose:a,children:S.jsxs("div",{className:"overflow-y-auto p-4",children:[S.jsx("p",{className:"pr-6 font-semibold text-gray-950",children:c("workflow.graph.legendTitle")}),S.jsx("div",{className:"mt-3 grid grid-cols-1 gap-2",children:Object.entries(D$e).map(([u,f])=>S.jsxs("div",{className:"flex items-center justify-between gap-3",children:[S.jsx("span",{className:"text-gray-600",children:c(`workflowRun.nodeType.${u}`,{defaultValue:u})}),S.jsx("span",{className:`rounded-full border px-2 py-1 text-[10px] font-semibold ${f}`,children:u})]},u))})]})}):t==="source"?S.jsx(Nde,{width:"w-80",onClose:a,children:S.jsxs("div",{className:"overflow-y-auto p-4",children:[S.jsx("p",{className:"pr-6 font-semibold text-gray-950",children:c("workflow.graph.sourceTitle")}),S.jsxs("dl",{className:"mt-3 space-y-3",children:[S.jsxs("div",{children:[S.jsx("dt",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:c("workflow.graph.sourceFile")}),S.jsxs("dd",{className:"mt-1 font-mono text-xs text-gray-700",children:["workflows/",n.sourceFile]})]}),S.jsxs("div",{children:[S.jsx("dt",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:c("workflow.graph.contract")}),S.jsx("dd",{className:"mt-1 text-gray-600",children:c("workflow.graph.readonlyContract")})]})]})]})}):S.jsxs(Nde,{width:"w-80",onClose:a,children:[S.jsx("p",{className:"shrink-0 border-b border-gray-100 px-4 py-3 pr-10 font-semibold text-gray-950",children:c("workflow.graph.detailsTitle")}),i?S.jsxs("dl",{className:"space-y-3 overflow-y-auto px-4 py-3",children:[S.jsxs("div",{children:[S.jsx("dt",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:c("workflow.graph.nodeId")}),S.jsx("dd",{className:"mt-1 font-mono text-xs text-gray-700",children:i.nodeId})]}),S.jsxs("div",{children:[S.jsx("dt",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:c("workflow.graph.nodeType")}),S.jsx("dd",{className:"mt-1 text-gray-700",children:c(`workflowRun.nodeType.${i.type}`,{defaultValue:i.typeLabel})})]}),i.agent?S.jsxs("div",{children:[S.jsx("dt",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:c("workflow.graph.agent")}),S.jsxs("dd",{className:"mt-1 text-gray-700",children:["@",i.agent]})]}):null,i.description?S.jsxs("div",{children:[S.jsx("dt",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:c("workflow.graph.description")}),S.jsx("dd",{className:"mt-1 whitespace-pre-wrap break-words text-gray-700",children:i.description})]}):null,i.input?S.jsxs("div",{children:[S.jsx("dt",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:c("workflow.graph.input")}),S.jsx("dd",{className:"mt-1 whitespace-pre-wrap break-words rounded-lg border border-gray-100 bg-gray-50 p-2 font-mono text-xs leading-relaxed text-gray-700",children:i.input})]}):null,i.condition?S.jsxs("div",{children:[S.jsx("dt",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:c("workflow.graph.condition")}),S.jsx("dd",{className:"mt-1 whitespace-pre-wrap break-words rounded-lg border border-amber-100 bg-amber-50 p-2 font-mono text-xs text-amber-900",children:i.condition})]}):null]}):S.jsx("p",{className:"px-4 py-3 text-gray-500",children:c("workflow.graph.noNodeSelected")})]}):null}function hUr({workflow:t,stateVariables:n=[]}){const{t:i}=Zn(),[o,a]=F.useState({nodes:[],edges:[]}),[c,u]=F.useState(!0),[f,g]=F.useState(null),[w,x]=F.useState(null);return F.useEffect(()=>{let v=!1;return u(!0),iUr(t.nodes).then(C=>{v||a(C)}).finally(()=>{v||u(!1)}),()=>{v=!0}},[t.nodes]),S.jsx("section",{className:"overflow-hidden rounded-2xl border border-gray-200 bg-white shadow-sm",children:S.jsxs("div",{className:"relative h-[560px] bg-[#f8fafc]",children:[c?S.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-[#f8fafc] text-sm font-medium text-gray-500",children:i("workflow.graph.layouting")}):null,!c&&o.nodes.length>0?S.jsxs(yHr,{nodes:o.nodes,edges:o.edges,nodeTypes:oUr,edgeTypes:dUr,fitView:!0,fitViewOptions:{padding:.15,maxZoom:1,nodes:o.nodes.slice(0,2)},minZoom:.1,maxZoom:1.3,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,onNodeClick:(v,C)=>{g(C.data),x("details")},proOptions:{hideAttribution:!0},children:[S.jsx(_Hr,{gap:24,color:"#e2e8f0"}),S.jsx(IHr,{position:"bottom-right",showInteractive:!1,className:"!rounded-lg !border !border-gray-200 !bg-white/95 !shadow-sm"}),S.jsxs(MY,{position:"top-right",className:"m-3 flex flex-col gap-2",children:[S.jsx("button",{type:"button",onClick:()=>x(w==="details"?null:"details"),className:"inline-flex h-9 w-9 items-center justify-center rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm transition-colors hover:bg-gray-50",title:i("workflow.graph.detailsTitle"),children:S.jsx(wR,{size:16})}),S.jsx("button",{type:"button",onClick:()=>x(w==="legend"?null:"legend"),className:"inline-flex h-9 w-9 items-center justify-center rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm transition-colors hover:bg-gray-50",title:i("workflow.graph.legendTitle"),children:S.jsx(rWn,{size:16})}),S.jsx("button",{type:"button",onClick:()=>x(w==="state"?null:"state"),className:"inline-flex h-9 w-9 items-center justify-center rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm transition-colors hover:bg-gray-50",title:i("workflow.stateVariablesTitle"),children:S.jsx(oJt,{size:16})}),S.jsx("button",{type:"button",onClick:()=>x(w==="source"?null:"source"),className:"inline-flex h-9 w-9 items-center justify-center rounded-lg border border-gray-200 bg-white text-gray-600 shadow-sm transition-colors hover:bg-gray-50",title:i("workflow.graph.sourceTitle"),children:S.jsx(Tx,{size:16})})]})]},t.id):null,S.jsx(fUr,{openPanel:w,workflow:t,selectedNode:f,stateVariables:n,onClose:()=>x(null)})]})})}function jde({icon:t,label:n,value:i}){return S.jsxs("div",{className:"rounded-xl border border-gray-200 bg-white p-4 shadow-sm",children:[S.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-xl bg-blue-50 text-blue-600",children:S.jsx(t,{size:18})}),S.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:n}),S.jsx("p",{className:"mt-1 text-lg font-semibold text-gray-900",children:i})]})}function pUr(){const{t}=Zn(),n=S0(),{id:i}=Ff(),{setPageHeader:o}=Sd(),a=b0(M=>M.fetchWorkflowDetail),c=b0(M=>M.clearSelectedWorkflow),u=b0(M=>M.selectedWorkflow),f=b0(M=>M.detailLoading),g=b0(M=>M.detailError);F.useEffect(()=>{if(i)return a(i).catch(()=>{}),()=>c()},[c,a,i]);const w=F.useMemo(()=>u!=null&&u.timeout?t("workflow.timeoutMinutes",{count:Math.max(1,Math.round(u.timeout/60))}):t("workflow.noLimit"),[t,u==null?void 0:u.timeout]),x=F.useMemo(()=>u!=null&&u.maxIterations?t("workflow.iterationCount",{count:u.maxIterations}):t("workflow.noLimit"),[t,u==null?void 0:u.maxIterations]),v=F.useMemo(()=>Object.keys((u==null?void 0:u.state)??{}).sort((M,I)=>M.localeCompare(I)),[u==null?void 0:u.state]),C=u?v.length>0?"WFLUI003":"WFLUI002":null,E=v.length>0?"워크플로 상세 State":"워크플로 상세";FJt(C,E);const A=F.useCallback(()=>{u&&n(`/threads/new?workflow=${encodeURIComponent(u.id)}`)},[u,n]);return F.useEffect(()=>{o({title:(u==null?void 0:u.name)??i??t("workflow.title"),subtitle:(u==null?void 0:u.description)||(u==null?void 0:u.id),actions:S.jsx("div",{className:"flex items-center gap-2",children:S.jsxs("button",{type:"button",onClick:A,disabled:!u,title:u?t("workflow.startChatTooltip",{id:u.id}):void 0,className:"inline-flex items-center gap-1.5 rounded-lg bg-blue-500 px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-60",children:[S.jsx(sUn,{size:16}),S.jsx("span",{children:t("workflow.runWorkflow")})]})})})},[A,i,o,t,u]),S.jsx(kun,{fallback:S.jsx("div",{className:"rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-600",children:t("workflow.pageError")}),children:S.jsx("div",{className:"mx-auto flex max-w-7xl flex-col gap-6",children:f&&!u?S.jsx("div",{className:"flex min-h-[360px] items-center justify-center rounded-2xl border border-gray-200 bg-white shadow-sm",children:S.jsx(Is,{size:24,className:"animate-spin text-gray-400"})}):g?S.jsxs("div",{className:"flex items-center justify-between gap-4 rounded-xl border border-red-200 bg-red-50 px-4 py-4 text-sm text-red-700",children:[S.jsx("span",{children:g}),i&&S.jsx("button",{type:"button",onClick:()=>a(i,!0).catch(()=>{}),className:"rounded-md bg-white px-3 py-2 font-medium text-red-700 transition-colors hover:bg-red-100",children:t("workflow.retry")})]}):u?S.jsxs(S.Fragment,{children:[S.jsx(hUr,{workflow:u,stateVariables:v}),S.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4",children:[S.jsx(jde,{icon:O9,label:t("workflow.metadataAgents"),value:String(u.agents.length)}),S.jsx(jde,{icon:D7,label:t("workflow.metadataNodes"),value:String(u.nodeCount)}),S.jsx(jde,{icon:pqn,label:t("workflow.metadataTimeout"),value:w}),S.jsx(jde,{icon:BWn,label:t("workflow.metadataMaxIterations"),value:x})]})]}):null})})}const FLe={"task.created":()=>({taskId:`tsk_test_${Date.now()}`,threadId:`thr_test_${Date.now()}`,agent:"test_agent",status:"running",updatedAt:new Date().toISOString()}),"task.updated":()=>({taskId:`tsk_test_${Date.now()}`,threadId:`thr_test_${Date.now()}`,agent:"test_agent",status:"success",costUsd:.001,updatedAt:new Date().toISOString()}),"task.logged":()=>({taskId:`tsk_test_${Date.now()}`,threadId:`thr_test_${Date.now()}`}),"thread.created":()=>({threadId:`thr_test_${Date.now()}`}),"thread.updated":()=>({threadId:`thr_test_${Date.now()}`,updatedAt:new Date().toISOString()}),"message.created":()=>({threadId:`thr_test_${Date.now()}`,taskId:`tsk_test_${Date.now()}`})};let gUr=0;function mUr(){const{slug:t}=Ff(),{setPageHeader:n}=Sd(),[i,o]=F.useState("task.updated"),[a,c]=F.useState(()=>JSON.stringify(FLe["task.updated"](),null,2)),[u,f]=F.useState(null),[g,w]=F.useState(!1),[x,v]=F.useState(null),[C,E]=F.useState([]),[A,M]=F.useState(!1),I=F.useRef(null);F.useEffect(()=>{n({title:"SSE 이벤트 테스트",actions:null})},[n]),F.useEffect(()=>{c(JSON.stringify(FLe[i](),null,2)),f(null)},[i]),F.useEffect(()=>{if(!t)return;const R=new EventSource(`/api/v1/ws/${encodeURIComponent(t)}/events`);R.onopen=()=>M(!0),R.onerror=()=>M(!1);const U=[...qPe,"ping"].map(W=>{const G=Y=>{const te=Y instanceof MessageEvent?Y.data:"";let Q=null;try{Q=JSON.parse(te)}catch{Q=te}E(se=>{const ce={id:++gUr,time:new Date().toLocaleTimeString(),type:W,data:Q,isPing:W==="ping"};return[...se.slice(-99),ce]})};return R.addEventListener(W,G),{type:W,listener:G}});return()=>{U.forEach(({type:W,listener:G})=>R.removeEventListener(W,G)),R.close(),M(!1)}},[t]),F.useEffect(()=>{var R;(R=I.current)==null||R.scrollIntoView({behavior:"smooth"})},[C]);function D(R){c(R);try{JSON.parse(R),f(null)}catch(z){f(z instanceof Error?z.message:"JSON 파싱 오류")}}async function P(){if(!t||u)return;let R;try{R=JSON.parse(a)}catch{f("JSON 파싱 오류");return}w(!0),v(null);try{const U=await(await fetch(`/api/v1/ws/${encodeURIComponent(t)}/test/emit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:i,data:R})})).json();v(JSON.stringify(U,null,2))}catch(z){v(`Error: ${z instanceof Error?z.message:String(z)}`)}finally{w(!1)}}return S.jsxs("div",{className:"flex h-full flex-col gap-4 p-6",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("h1",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:"SSE 이벤트 테스트"}),S.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium ${A?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-500 dark:bg-gray-800 dark:text-gray-400"}`,children:[S.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${A?"bg-green-500":"bg-gray-400"}`}),A?"SSE 연결됨":"연결 중…"]}),S.jsxs("span",{className:"text-xs text-gray-400",children:["워크스페이스: ",t]})]}),S.jsxs("div",{className:"grid flex-1 grid-cols-2 gap-4 overflow-hidden",children:[S.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-900",children:[S.jsx("h2",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"이벤트 발행"}),S.jsxs("div",{className:"flex flex-col gap-1",children:[S.jsx("label",{className:"text-xs text-gray-500",children:"이벤트 타입"}),S.jsx("select",{value:i,onChange:R=>o(R.target.value),className:"rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100",children:qPe.map(R=>S.jsx("option",{value:R,children:R},R))})]}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("label",{className:"text-xs text-gray-500",children:"데이터 (JSON)"}),S.jsx("button",{type:"button",onClick:()=>c(JSON.stringify(FLe[i](),null,2)),className:"text-xs text-blue-500 hover:underline",children:"기본값 재생성"})]}),S.jsx("textarea",{value:a,onChange:R=>D(R.target.value),rows:10,spellCheck:!1,className:"flex-1 resize-none rounded-md border border-gray-300 bg-gray-50 p-2 font-mono text-xs dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100"}),u&&S.jsx("p",{className:"text-xs text-red-500",children:u})]}),S.jsx("button",{type:"button",onClick:P,disabled:g||!!u||!t,className:"rounded-lg bg-blue-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-600 disabled:opacity-50",children:g?"발행 중…":"이벤트 발행"}),x&&S.jsxs("div",{className:"flex flex-col gap-1",children:[S.jsx("span",{className:"text-xs text-gray-500",children:"서버 응답"}),S.jsx("pre",{className:"overflow-auto rounded-md border border-gray-200 bg-gray-50 p-2 text-xs dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300",children:x})]})]}),S.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-900",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("h2",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"수신 이벤트 피드"}),S.jsx("button",{type:"button",onClick:()=>E([]),className:"text-xs text-gray-400 hover:text-gray-600 dark:hover:text-gray-200",children:"비우기"})]}),S.jsxs("div",{className:"flex-1 overflow-y-auto rounded-md border border-gray-100 bg-gray-50 p-2 font-mono text-xs dark:border-gray-700 dark:bg-gray-800",children:[C.length===0&&S.jsx("p",{className:"text-center text-gray-400 py-8",children:"이벤트 수신 대기 중…"}),C.map(R=>S.jsxs("div",{className:`mb-1 rounded px-2 py-1 ${R.isPing?"text-gray-400 dark:text-gray-600":"bg-blue-50 dark:bg-blue-900/20"}`,children:[S.jsx("span",{className:"mr-2 text-gray-400",children:R.time}),S.jsx("span",{className:`mr-2 font-semibold ${R.isPing?"text-gray-400":"text-blue-600 dark:text-blue-400"}`,children:R.type}),!R.isPing&&S.jsx("span",{className:"text-gray-600 dark:text-gray-300",children:JSON.stringify(R.data)})]},R.id)),S.jsx("div",{ref:I})]})]})]})]})}function Odn(t){return t.map(n=>({name:n.name,path:n.path,type:n.isDirectory??n.type==="dir"?"dir":"file",isDirectory:n.isDirectory??n.type==="dir",children:n.children?Odn(n.children):[],hasCrewxYaml:n.hasCrewxYaml,isRegistered:n.isRegistered}))}async function bUr(t,n=3){const i=await wn.getFsTree(t,n);return{tree:Odn(i.data),quickAccess:i.quickAccess??[]}}async function wUr(t,n){return wn.mkdirFs(t,n)}function BLe(t){return/^(?:[A-Za-z]:\\|\/)/.test(t)}function Ldn(t){return t.includes("\\")?"\\":"/"}function yUr(t,n){return t===n?!0:t.startsWith(`${n}${Ldn(n)}`)}function xUr(t){return t?t.isDirectory??t.type==="dir":!1}function nGt(t,n){if(!n)return t;if(t===n)return"~";const i=Ldn(n);return t.startsWith(`${n}${i}`)?`~${t.slice(n.length)}`:t}function rGt(t,n){var i;return((i=t.find(o=>o.key===n))==null?void 0:i.path)??null}function EV(t,n){var i;for(const o of t){if(o.path===n)return o;if((i=o.children)!=null&&i.length){const a=EV(o.children,n);if(a)return a}}return null}function Pdn(t,n,i){let o=!1;const a=t.map(c=>{var f;if(c.path===n){const g=c.children??[];return g.some(w=>w.path===i.path)?c:(o=!0,{...c,children:[...g,i]})}if(!((f=c.children)!=null&&f.length))return c;const u=Pdn(c.children,n,i);return u===c.children?c:(o=!0,{...c,children:u})});return o?a:t}function vUr(t){return!t||t==="."||t===".."||t.includes("/")||t.includes("\\")||/[\x00-\x1f]/.test(t)?!1:t.length<=255}function iGt(t){if(!(t instanceof bd)||typeof t.body!="object"||t.body===null)return"UNKNOWN";const n=t.body;if(typeof n.code=="string")return n.code;if(typeof n.error=="object"&&n.error!==null){const i=n.error;if(typeof i.code=="string")return i.code}return"UNKNOWN"}function kUr({open:t,onClose:n,onSelect:i,initialPath:o}){const{t:a}=Zn(),[c,u]=F.useState([]),f=F.useMemo(()=>rGt(c,"home"),[c]),g=F.useMemo(()=>rGt(c,"workspaces"),[c]),w=F.useMemo(()=>{if(o&&BLe(o)){const Ve=[...c].sort((at,yt)=>yt.path.length-at.path.length).find(at=>yUr(o,at.path));return(Ve==null?void 0:Ve.path)??o}return g??f??"/"},[f,o,c,g]),[x,v]=F.useState(()=>o&&BLe(o)?o:"/"),[C,E]=F.useState([]),[A,M]=F.useState(new Set),[I,D]=F.useState(o??null),[P,R]=F.useState(!1),[z,U]=F.useState(null),[W,G]=F.useState(!1),[Y,te]=F.useState(""),[Q,se]=F.useState(!1),[ce,V]=F.useState(null),ae=F.useRef(0),de=F.useRef(x),ee=F.useMemo(()=>I?EV(C,I):null,[I,C]),ue=Y.trim(),he=vUr(ue)&&!Q,ge=x===g;F.useEffect(()=>{de.current=x},[x]),F.useEffect(()=>{t&&(v(o&&BLe(o)?o:"/"),D(o??null),M(new Set),U(null),u([]),G(!1),te(""),se(!1),V(null))},[o,t]),F.useEffect(()=>{t&&v(Ve=>Ve===w?Ve:w)},[w,t]),F.useEffect(()=>{if(!t)return;const Ve=at=>{at.key==="Escape"&&(at.preventDefault(),at.stopPropagation(),n())};return window.addEventListener("keydown",Ve),()=>window.removeEventListener("keydown",Ve)},[n,t]);const oe=F.useCallback(async(Ve,at)=>{const yt=ae.current+1;ae.current=yt,R(!0),U(null);try{const{tree:Nt,quickAccess:pt}=await bUr(Ve,3);if(yt!==ae.current)return;const St=at!=null&&at.createdNode&&at.parentPath&&!EV(Nt,at.createdNode.path)?Pdn(Nt,at.parentPath,at.createdNode):Nt;if(E(St),u(pt),at!=null&&at.selectedPath){D(at.selectedPath);return}D(Bt=>Bt&&EV(St,Bt)?Bt:null)}catch(Nt){if(yt!==ae.current)return;E([]),D(null),M(new Set),U(iGt(Nt))}finally{yt===ae.current&&R(!1)}},[]);if(F.useEffect(()=>{t&&oe(x)},[oe,t,x]),!t)return null;const Ae=()=>{G(!0),te(""),V(null)},Te=()=>{G(!1),te(""),se(!1),V(null)},ve=async()=>{if(!he)return;const Ve=x,at=ee&&xUr(ee)?ee.path:Ve,yt=ue;se(!0),V(null);try{const Nt=await wUr(at,yt),pt={name:yt,path:Nt.path,type:"dir",isDirectory:!0,children:[],hasCrewxYaml:!1,isRegistered:!1};if(de.current!==Ve)return;G(!1),te(""),M(St=>{const Bt=new Set(St);return at!==Ve&&Bt.add(at),Bt}),await oe(Ve,{parentPath:at,createdNode:pt,selectedPath:Nt.path})}catch(Nt){de.current===Ve&&V(iGt(Nt))}finally{se(!1)}};return S.jsx("div",{"data-testid":"directory-picker-backdrop",className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/40 p-4",onClick:n,children:S.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"directory-picker-title","data-testid":"directory-picker-dialog",className:"flex h-[70vh] w-full max-w-5xl flex-col overflow-hidden rounded-2xl border border-gray-200 bg-white shadow-xl",onClick:Ve=>Ve.stopPropagation(),children:[S.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-gray-200 px-6 py-5",children:[S.jsxs("div",{children:[S.jsx("h2",{id:"directory-picker-title",className:"text-lg font-semibold text-gray-900",children:a("dirPicker.title")}),S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:a("dirPicker.description")})]}),S.jsx("button",{type:"button",onClick:n,className:"rounded-lg bg-gray-100 px-3 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200",children:a("common.close")})]}),S.jsxs("div",{className:"min-h-0 flex flex-1",children:[S.jsxs("aside",{className:"w-48 border-r border-gray-200 bg-gray-50 px-4 py-4",children:[S.jsx("p",{className:"mb-3 text-xs font-semibold uppercase tracking-wide text-gray-500",children:a("dirPicker.quickAccess.title")}),S.jsx("div",{className:"space-y-2",children:c.map(Ve=>{const at=x===Ve.path;return S.jsxs("button",{type:"button",onClick:()=>{Te(),v(Ve.path),D(null),M(new Set)},className:`flex w-full items-center justify-between rounded-lg px-3 py-2 text-left text-sm transition-colors ${at?"bg-blue-100 text-blue-700":"text-gray-700 hover:bg-white"}`,children:[S.jsx("span",{children:a(`dirPicker.quickAccess.${Ve.key}`)}),at?S.jsx(xg,{className:"h-4 w-4"}):null]},Ve.key)})})]}),S.jsxs("div",{className:"flex min-h-0 flex-1 flex-col px-6 py-5",children:[S.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[S.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2 text-sm text-gray-600",children:[S.jsx(a5,{className:"h-4 w-4 shrink-0 text-gray-400"}),S.jsx("span",{className:"truncate",children:nGt(x,f)})]}),S.jsxs("button",{type:"button",onClick:Ae,className:"inline-flex items-center gap-2 rounded-lg bg-blue-600 px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-700",children:[S.jsx(yIe,{className:"h-4 w-4"}),a("dirPicker.newFolder.label")]})]}),W?S.jsx("div",{className:"mb-4 rounded-lg border border-gray-200 bg-gray-50 px-3 py-3",children:S.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[S.jsx("input",{type:"text",value:Y,onChange:Ve=>te(Ve.target.value),placeholder:a("dirPicker.newFolder.placeholder"),maxLength:255,autoFocus:!0,className:"min-w-0 flex-1 rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 outline-none transition-colors focus:border-blue-500"}),S.jsxs("button",{type:"button",onClick:()=>{ve()},disabled:!he,className:"inline-flex items-center gap-2 rounded-lg bg-blue-600 px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-blue-300",children:[Q?S.jsx(Is,{className:"h-4 w-4 animate-spin"}):null,a("dirPicker.newFolder.create")]}),S.jsx("button",{type:"button",onClick:Te,className:"rounded-lg bg-gray-100 px-3 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200",children:a("dirPicker.cancel")})]})}):null,ce?S.jsxs("div",{className:"mb-4 flex items-start gap-2 rounded-lg border border-red-200 bg-red-50 px-3 py-3 text-sm text-red-700",role:"alert",children:[S.jsx(wc,{className:"mt-0.5 h-4 w-4 shrink-0"}),S.jsx("span",{children:a(`dirPicker.mkdir.error.${ce}`,{defaultValue:a("dirPicker.mkdir.error.UNKNOWN")})})]}):null,S.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto rounded-xl border border-gray-200 bg-white px-3 py-3",children:P?S.jsxs("div",{className:"flex items-center gap-2 px-2 py-2 text-sm text-gray-500",children:[S.jsx(Is,{className:"h-4 w-4 animate-spin"}),S.jsx("span",{children:a("dirPicker.loading")})]}):z?S.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-red-200 bg-red-50 px-3 py-3 text-sm text-red-700",role:"alert",children:[S.jsx(wc,{className:"mt-0.5 h-4 w-4 shrink-0"}),S.jsx("span",{children:a(`dirPicker.error.${z}`,{defaultValue:a("dirPicker.error.UNKNOWN")})})]}):C.length===0?S.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 px-6 py-8 text-center",children:[S.jsx(yIe,{className:"h-8 w-8 text-gray-400"}),S.jsx("p",{className:"max-w-sm text-sm text-gray-500",children:a(ge?"dirPicker.empty.workspaces":"dirPicker.empty.default")}),S.jsxs("button",{type:"button",onClick:Ae,className:"inline-flex items-center gap-2 rounded-lg bg-blue-600 px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-700",children:[S.jsx(yIe,{className:"h-4 w-4"}),a("dirPicker.newFolder.label")]})]}):S.jsx(tln,{nodes:C,expandedFolders:A,selectedPath:I,onToggle:Ve=>{const at=EV(C,Ve);!at||at.isRegistered||(D(Ve),M(yt=>{const Nt=new Set(yt);return Nt.has(Ve)?Nt.delete(Ve):Nt.add(Ve),Nt}))},onSelect:Ve=>D(Ve),isFileDisabled:Ve=>Ve.isRegistered===!0,renderFileSuffix:Ve=>S.jsxs("span",{className:"ml-2 flex items-center gap-1",children:[Ve.hasCrewxYaml?S.jsx("span",{className:"rounded bg-blue-100 px-1.5 py-0.5 text-[10px] font-medium text-blue-700",children:a("dirPicker.badge.crewxYaml")}):null,Ve.isRegistered?S.jsx("span",{className:"rounded bg-gray-200 px-1.5 py-0.5 text-[10px] font-medium text-gray-600",title:a("dirPicker.disabledTooltip"),children:a("dirPicker.alreadyRegistered")}):null]})})}),S.jsxs("div",{className:"mt-4 rounded-lg border border-gray-200 bg-gray-50 px-3 py-3 text-sm text-gray-600",children:[S.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:a("dirPicker.selected")}),S.jsx("p",{className:"mt-1 truncate text-sm font-medium text-gray-900",children:I?nGt(I,f):a("dirPicker.noneSelected")})]})]})]}),S.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-gray-200 px-6 py-4",children:[S.jsx("button",{type:"button",onClick:n,className:"rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200",children:a("dirPicker.cancel")}),S.jsx("button",{type:"button",onClick:()=>{I&&ee&&!ee.isRegistered&&(i(I),n())},disabled:!I||!ee||ee.isRegistered===!0,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-blue-300",children:a("dirPicker.select")})]})]})})}const sGt=150;function oGt(t){return new Promise(n=>{window.setTimeout(n,t)})}function aGt(t){return typeof t=="object"&&t!==null}function lGt(t){if(!(t instanceof bd))return"UNKNOWN";if(aGt(t.body)){if(typeof t.body.code=="string")return t.body.code;if(aGt(t.body.error)&&typeof t.body.error.code=="string")return t.body.error.code}return"UNKNOWN"}function zLe(t,n,i){return n===0?"pending":t<n?"done":t===n?i?"current":"done":"pending"}function HLe({label:t,status:n}){return S.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-gray-200 bg-white px-4 py-3",children:[n==="done"?S.jsx(bR,{size:18,className:"shrink-0 text-green-600"}):n==="current"?S.jsx(Is,{size:18,className:"shrink-0 animate-spin text-blue-600"}):S.jsx(rJt,{size:18,className:"shrink-0 text-gray-300"}),S.jsx("span",{className:n==="pending"?"text-sm text-gray-400":n==="current"?"text-sm font-medium text-blue-700":"text-sm font-medium text-gray-900",children:t})]})}function cGt({open:t,onClose:n}){const{t:i}=Zn(),o=Cg();FJt(t?"WKSUI001-NEW":null,"워크스페이스 생성");const a=Lm(de=>de.addToast),c=km(de=>de.createWorkspace),[u,f]=F.useState(""),[g,w]=F.useState(""),[x,v]=F.useState("form"),[C,E]=F.useState(!1),[A,M]=F.useState(null),[I,D]=F.useState(null),[P,R]=F.useState(0),[z,U]=F.useState(null),[W,G]=F.useState(!1);F.useEffect(()=>{t||(f(""),w(""),v("form"),E(!1),M(null),D(null),R(0),U(null),G(!1))},[t]),F.useEffect(()=>{if(!t)return;const de=ee=>{ee.key!=="Escape"||C||W||(ee.preventDefault(),n())};return window.addEventListener("keydown",de),()=>window.removeEventListener("keydown",de)},[n,t,W,C]);const Y=F.useMemo(()=>A?i(`workspace.createModal.error.${A}`,{defaultValue:i("workspace.createModal.error.UNKNOWN")}):null,[A,i]),te=C||W,Q=[i("workspace.createModal.confirmInit.files.config"),i("workspace.createModal.confirmInit.files.automation"),i("workspace.createModal.confirmInit.files.registration")];if(!t)return null;const se=async()=>{const de=u.trim(),ee=g.trim();if(!(!de||C)){E(!0),M(null);try{const ue=await c({workspace_path:de,slug:ee||void 0,initIfMissing:!1});a({type:"success",message:i("workspace.createModal.success")}),n(),o(`/ws/${ue.slug}`,{replace:!0})}catch(ue){const he=lGt(ue);if(he==="NOT_A_CREWX_WORKSPACE"){D(de),v("confirm-init");return}M(he)}finally{E(!1)}}},ce=()=>{v("form"),M(null),U(null),R(0)},V=async()=>{var ue;const de=I??u.trim(),ee=g.trim();if(!(!de||C)){v("initializing"),E(!0),M(null),U(null),R(1);try{const he=await c({workspace_path:de,slug:ee||void 0,initIfMissing:!0});R(2),await oGt(sGt),R(3),E(!1);const ge=((ue=he.initResult)==null?void 0:ue.errors.some(oe=>oe.startsWith("HOOK_INSTALL_FAILED")))??!1;if(a({type:"success",message:i("workspace.createModal.success")}),ge){U(i("workspace.createModal.error.HOOK_INSTALL_FAILED"));return}await oGt(sGt),n(),o(`/ws/${he.slug}`,{replace:!0})}catch(he){E(!1),v("confirm-init"),R(0),M(lGt(he))}}},ae=()=>Y?S.jsxs("div",{className:"rounded-lg border border-red-200 bg-red-50 px-3 py-3 text-sm text-red-700",children:[S.jsx("p",{children:Y}),A==="WORKSPACE_LIMIT_EXCEEDED"?S.jsx("a",{href:khe,target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-flex items-center gap-1 text-sm font-medium text-red-700 transition-colors hover:text-red-800 hover:underline",children:i("upgrade.waitlistCta")}):null]}):null;return S.jsxs("div",{"data-testid":"create-workspace-modal-backdrop",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onClick:()=>{te||n()},children:[S.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"create-workspace-modal-title",className:"w-full max-w-lg rounded-2xl border border-gray-200 bg-white shadow-xl",onClick:de=>de.stopPropagation(),children:[S.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-gray-200 px-6 py-5",children:[S.jsxs("div",{children:[S.jsx("h2",{id:"create-workspace-modal-title",className:"text-lg font-semibold text-gray-900",children:i("workspace.createModal.title")}),S.jsx("p",{className:"mt-1 text-sm text-gray-500",children:i("workspace.createModal.description")})]}),S.jsx("button",{type:"button",onClick:n,disabled:te,className:"rounded-lg bg-gray-100 p-2 text-gray-500 transition-colors hover:bg-gray-200 hover:text-gray-700 disabled:cursor-not-allowed disabled:opacity-50","aria-label":i("common.close"),children:S.jsx(Op,{size:16})})]}),S.jsxs("div",{className:"space-y-4 px-6 py-5",children:[x==="form"?S.jsxs(S.Fragment,{children:[S.jsxs("div",{children:[S.jsx("label",{htmlFor:"workspace-path",className:"mb-1 block text-sm font-medium text-gray-700",children:i("workspace.createModal.pathLabel")}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("input",{id:"workspace-path",type:"text",value:u,onChange:de=>{f(de.target.value),M(null)},placeholder:i("workspace.createModal.pathPlaceholder"),className:"min-w-0 flex-1 rounded-lg border border-gray-200 px-3 py-2 text-sm text-gray-900 shadow-sm outline-none transition-colors placeholder:text-gray-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-100"}),S.jsx("button",{type:"button",onClick:()=>G(!0),disabled:C,className:"shrink-0 rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200 disabled:cursor-not-allowed disabled:opacity-50",children:i("workspace.createModal.browse")})]})]}),S.jsxs("div",{children:[S.jsx("label",{htmlFor:"workspace-slug",className:"mb-1 block text-sm font-medium text-gray-700",children:i("workspace.createModal.slugLabel")}),S.jsx("input",{id:"workspace-slug",type:"text",value:g,onChange:de=>w(de.target.value),placeholder:i("workspace.createModal.slugPlaceholder"),className:"w-full rounded-lg border border-gray-200 px-3 py-2 text-sm text-gray-900 shadow-sm outline-none transition-colors placeholder:text-gray-400 focus:border-blue-500 focus:ring-2 focus:ring-blue-100"})]}),ae()]}):null,x==="confirm-init"?S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx("h3",{className:"text-base font-semibold text-gray-900",children:i("workspace.createModal.confirmInit.title")}),S.jsx("p",{className:"text-sm text-gray-600",children:i("workspace.createModal.confirmInit.description")})]}),S.jsxs("div",{className:"rounded-lg border border-gray-200 bg-gray-50 px-4 py-3",children:[S.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:i("workspace.createModal.confirmInit.pathLabel")}),S.jsx("p",{className:"mt-1 break-all text-sm text-gray-900",children:I??u.trim()})]}),S.jsxs("div",{className:"rounded-lg border border-gray-200 bg-gray-50 px-4 py-3",children:[S.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-500",children:i("workspace.createModal.confirmInit.filesLabel")}),S.jsx("ul",{className:"mt-2 space-y-2 text-sm text-gray-700",children:Q.map(de=>S.jsx("li",{children:de},de))})]}),ae()]}):null,x==="initializing"?S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx("h3",{className:"text-base font-semibold text-gray-900",children:i("workspace.createModal.initProgress.title")}),S.jsx("p",{className:"text-sm text-gray-600",children:i("workspace.createModal.initProgress.description")})]}),S.jsxs("div",{className:"space-y-3 rounded-xl bg-gray-50 p-4",children:[S.jsx(HLe,{label:i("workspace.createModal.initProgress.step1"),status:zLe(1,P,C)}),S.jsx(HLe,{label:i("workspace.createModal.initProgress.step2"),status:zLe(2,P,C)}),S.jsx(HLe,{label:i("workspace.createModal.initProgress.step3"),status:zLe(3,P,C)})]}),z?S.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900",children:S.jsxs("div",{className:"flex items-start gap-3",children:[S.jsx(q6,{size:18,className:"mt-0.5 shrink-0 text-amber-600"}),S.jsxs("div",{className:"space-y-3",children:[S.jsx("p",{children:z}),S.jsx("button",{type:"button",onClick:n,className:"font-medium text-amber-900 underline underline-offset-2",children:i("common.close")})]})]})}):null]}):null]}),x!=="initializing"?S.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-gray-200 px-6 py-4",children:x==="form"?S.jsxs(S.Fragment,{children:[S.jsx("button",{type:"button",onClick:n,disabled:te,className:"rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200 disabled:cursor-not-allowed disabled:opacity-50",children:i("workspace.createModal.cancel")}),S.jsxs("button",{type:"button",onClick:()=>{se()},disabled:!u.trim()||C,className:"inline-flex items-center gap-2 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-blue-300",children:[C?S.jsx(Is,{size:14,className:"animate-spin"}):null,i("workspace.createModal.submit")]})]}):S.jsxs(S.Fragment,{children:[S.jsx("button",{type:"button",onClick:ce,disabled:C,className:"rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200 disabled:cursor-not-allowed disabled:opacity-50",children:i("workspace.createModal.confirmInit.back")}),S.jsxs("button",{type:"button",onClick:()=>{V()},disabled:!I||C,className:"inline-flex items-center gap-2 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-700 disabled:cursor-not-allowed disabled:bg-blue-300",children:[C?S.jsx(Is,{size:14,className:"animate-spin"}):null,i("workspace.createModal.confirmInit.confirm")]})]})}):null]}),S.jsx(kUr,{open:W,initialPath:u.trim()||void 0,onClose:()=>G(!1),onSelect:de=>{f(de),M(null)}})]})}function CUr(t){if(!t)return"—";const i=/^\/Users\/([^/]+)(\/.*)?$/.exec(t);return i?`~${i[2]??""}`:t}function SUr(t,n){const i=new Date(t);return Number.isNaN(i.getTime())?t:new Intl.DateTimeFormat(n,{dateStyle:"medium",timeStyle:"short"}).format(i)}function EUr(t){if(!(t instanceof bd)||typeof t.body!="object"||t.body===null)return"UNKNOWN";const n=t.body;if(typeof n.code=="string")return n.code;if(typeof n.error=="object"&&n.error!==null){const i=n.error;if(typeof i.code=="string")return i.code}return"UNKNOWN"}function _Ur({workspace:t,deleting:n,errorCode:i,onCancel:o,onConfirm:a,t:c}){return S.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:S.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"workspace-delete-dialog-title","aria-describedby":"workspace-delete-dialog-description",className:"w-full max-w-md rounded-2xl border border-gray-200 bg-white shadow-xl",children:[S.jsxs("div",{className:"border-b border-gray-200 px-6 py-5",children:[S.jsx("h3",{id:"workspace-delete-dialog-title",className:"text-base font-semibold text-gray-900",children:c("workspace.delete.title")}),S.jsx("p",{id:"workspace-delete-dialog-description",className:"mt-2 text-sm text-gray-600",children:c("workspace.delete.message",{name:t.name})}),S.jsx("p",{className:"mt-2 text-xs text-gray-500",children:c("workspace.delete.note")})]}),i?S.jsx("div",{className:"border-b border-red-100 bg-red-50 px-6 py-3 text-sm text-red-700",role:"alert",children:S.jsxs("div",{className:"flex items-start gap-2",children:[S.jsx(wc,{size:16,className:"mt-0.5 shrink-0"}),S.jsx("span",{children:c(`workspace.delete.error.${i}`,{defaultValue:c("workspace.delete.error.UNKNOWN")})})]})}):null,S.jsxs("div",{className:"flex justify-end gap-2 px-6 py-5",children:[S.jsx("button",{type:"button",onClick:o,disabled:n,className:"rounded-lg bg-gray-100 px-4 py-2 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-200 disabled:cursor-not-allowed disabled:opacity-50",children:c("workspace.delete.cancel")}),S.jsxs("button",{type:"button",onClick:a,disabled:n,className:"inline-flex items-center gap-2 rounded-lg bg-red-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-red-600 disabled:cursor-not-allowed disabled:opacity-40",children:[n?S.jsx(Is,{size:14,className:"animate-spin"}):S.jsx(kx,{size:14}),c("workspace.delete.confirm")]})]})]})})}function TUr({standalone:t=!1}){const{t:n,i18n:i}=Zn(),o=Cg(),{setPageHeader:a}=Sd(),c=Zd(ee=>ee.currentWorkspaceId),[u,f]=F.useState(!1),[g,w]=F.useState(null),[x,v]=F.useState(null),[C,E]=F.useState(null),A=km(ee=>ee.workspaces),M=km(ee=>ee.loading),I=km(ee=>ee.limitsLoading),D=km(ee=>ee.error),P=km(ee=>ee.limits),R=km(ee=>ee.fetchLimits),z=km(ee=>ee.deleteWorkspace),U=km(ee=>ee.initialize),W=P==null?void 0:P.workspaces,G=W!==void 0&&W!==-1&&A.length>=W,Y=I||G,te=G&&P?n("limits.banner.workspace.title",{current:A.length,limit:P.workspaces}):void 0;F.useEffect(()=>{t||a({title:n("workspace.title"),actions:S.jsxs("button",{type:"button",disabled:Y,title:te,onClick:()=>f(!0),className:`inline-flex items-center gap-2 rounded-lg border px-4 py-2 text-sm font-medium transition-colors ${Y?"border-gray-200 bg-white text-gray-400":"border-blue-600 bg-blue-600 text-white hover:bg-blue-700"}`,children:[S.jsx(ef,{size:16}),S.jsx("span",{children:n("workspace.create")})]})})},[te,Y,a,t,n]),F.useEffect(()=>{U().catch(()=>{})},[U]),F.useEffect(()=>{R().catch(()=>{})},[c,R]);const Q=F.useMemo(()=>A.find(ee=>ee.id===c)??null,[c,A]),se=S.jsxs("button",{type:"button",disabled:Y,title:te,onClick:()=>f(!0),className:`inline-flex items-center justify-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-colors ${Y?"bg-gray-100 text-gray-400":"bg-blue-600 text-white hover:bg-blue-700"}`,children:[S.jsx(ef,{size:16}),S.jsx("span",{children:n("workspace.create")})]}),ce=ee=>{if(ee.id===(Q==null?void 0:Q.id)){o(`/ws/${ee.slug}`);return}KJt(ee).then(()=>o(`/ws/${ee.slug}`)).catch(()=>{})},V=()=>{C||(w(null),v(null))},ae=async()=>{if(g){E(g.id),v(null);try{await z(g.id),w(null)}catch(ee){v(EUr(ee))}finally{E(null)}}};if(M&&A.length===0){const ee=S.jsx("div",{className:"rounded-2xl border border-gray-200 bg-white px-6 py-16 text-center text-sm text-gray-500",children:n("workspace.loading")});return t?S.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-50 px-4",children:S.jsx("div",{className:"w-full max-w-xl",children:ee})}):ee}if(D&&A.length===0){const ee=S.jsx("div",{className:"rounded-xl border border-amber-200 bg-amber-50 px-4 py-4 text-sm text-amber-800",children:D});return t?S.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-50 px-4",children:S.jsx("div",{className:"w-full max-w-xl",children:ee})}):ee}if(A.length===0){const ee=S.jsxs("div",{className:"w-full max-w-xl rounded-3xl border border-gray-200 bg-white px-8 py-10 text-center shadow-sm",children:[S.jsx("div",{className:"mx-auto flex h-20 w-20 items-center justify-center rounded-3xl bg-gray-50",children:S.jsx("img",{src:"/assets/crewx-logo.png",alt:n("workspace.entryLogoAlt"),className:"h-12 w-12 object-contain"})}),S.jsx("h1",{className:"mt-6 text-3xl font-semibold tracking-tight text-gray-900",children:n("workspace.entryTitle")}),S.jsx("p",{className:"mt-3 text-sm leading-6 text-gray-500",children:n("workspace.entryDescription")}),S.jsx("div",{className:"mt-8 flex justify-center",children:se})]});return S.jsxs(S.Fragment,{children:[G&&P?S.jsx("div",{className:t?"absolute left-4 right-4 top-4 mx-auto max-w-xl":void 0,children:S.jsx(Che,{resource:"workspace",current:A.length,limit:P.workspaces})}):null,S.jsx("div",{className:`bg-gray-50 px-4 ${t?"flex min-h-screen items-center justify-center py-12":"rounded-3xl py-12"}`,children:ee}),S.jsx(cGt,{open:u,onClose:()=>f(!1)})]})}const de=S.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col gap-6",children:[t?S.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[S.jsxs("div",{children:[S.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-gray-900",children:n("workspace.title")}),S.jsx("p",{className:"mt-2 text-sm text-gray-500",children:n("workspace.emptyDescription")})]}),S.jsx("div",{className:"shrink-0",children:se})]}):null,G&&P?S.jsx(Che,{resource:"workspace",current:A.length,limit:P.workspaces}):null,S.jsx("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2",children:A.map(ee=>{const ue=(Q==null?void 0:Q.id)===ee.id,he=ee.is_current||ue,ge=n(he?"workspace.delete.currentDisabled":"workspace.delete.button");return S.jsxs("div",{className:"relative",children:[he?S.jsx("span",{className:"absolute right-16 top-5 rounded-full bg-white px-2.5 py-1 text-xs font-medium text-blue-700",children:n("workspace.currentBadge")}):null,S.jsxs("button",{type:"button",onClick:()=>ce(ee),className:`w-full rounded-2xl border px-5 py-5 pr-28 text-left shadow-sm transition-colors ${ue?"border-blue-200 bg-blue-50":"border-gray-200 bg-white hover:border-gray-300 hover:bg-gray-50"}`,children:[S.jsxs("div",{className:"min-w-0",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(a5,{size:18,className:ue?"text-blue-600":"text-gray-400"}),S.jsx("h2",{className:"truncate text-lg font-semibold text-gray-900",children:ee.name})]}),S.jsx("p",{className:"mt-2 truncate text-sm text-gray-500",children:CUr(ee.workspace_path)})]}),S.jsxs("div",{className:"mt-5 grid grid-cols-2 gap-3 text-sm",children:[S.jsxs("div",{className:"rounded-xl bg-gray-50 px-3 py-3",children:[S.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:n("workspace.slug")}),S.jsx("p",{className:"mt-1 truncate font-medium text-gray-800",children:ee.slug})]}),S.jsxs("div",{className:"rounded-xl bg-gray-50 px-3 py-3",children:[S.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-gray-400",children:n("workspace.updatedAt")}),S.jsx("p",{className:"mt-1 truncate font-medium text-gray-800",children:SUr(ee.updated_at,i.language)})]})]})]}),S.jsx("button",{type:"button",disabled:he,"aria-label":ge,title:ge,onClick:oe=>{oe.stopPropagation(),v(null),w(ee)},className:`absolute right-5 top-5 rounded-lg p-2 transition-colors ${he?"cursor-not-allowed text-gray-300":"text-gray-400 hover:bg-red-50 hover:text-red-600"}`,children:S.jsx(kx,{size:18})})]},ee.id)})})]});return S.jsxs(S.Fragment,{children:[S.jsx("div",{className:t?"min-h-screen bg-gray-50 px-4 py-10 sm:px-6 lg:px-8":void 0,children:de}),g?S.jsx(_Ur,{workspace:g,deleting:C===g.id,errorCode:x,onCancel:V,onConfirm:ae,t:n}):null,S.jsx(cGt,{open:u,onClose:()=>f(!1)})]})}function AUr({cli:t,version:n,authenticated:i,selected:o,description:a,onToggle:c}){const{t:u}=Zn(),f=t.installed,g=f?"border-green-500 border-solid bg-green-50":o?"border-blue-500 border-dashed bg-blue-50":"border-gray-200 border-solid bg-white";return S.jsxs("button",{type:"button",onClick:()=>c(!o),className:`w-full flex items-center gap-3 p-4 rounded-lg border-2 transition-colors text-left cursor-pointer hover:shadow-sm ${g}`,children:[S.jsx(G6,{provider:`cli/${t.name}`,size:20,className:"w-10 h-10 rounded-lg"}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("div",{className:"font-medium text-gray-900",children:t.displayName}),a&&S.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:a}),S.jsx("div",{className:"text-sm text-gray-600 mt-0.5",children:f?S.jsxs(S.Fragment,{children:[S.jsx("span",{children:u("onboarding.s1.statusInstalled",{version:n})}),S.jsx("span",{className:"mx-1.5",children:"·"}),i===!0&&S.jsx("span",{className:"text-green-600",children:u("onboarding.s1.authLoggedIn")}),i===!1&&S.jsx("span",{className:"text-amber-500",children:u("onboarding.s1.authRequired")}),i===null&&S.jsx("span",{className:"text-gray-400",children:u("onboarding.s1.authUnknown")})]}):o?S.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-blue-700 bg-blue-100 rounded-full",children:u("onboarding.s1.willInstall")}):S.jsx("span",{className:"text-gray-400",children:u("onboarding.s1.statusNotInstalled")})})]}),S.jsx("div",{className:"flex-shrink-0",children:S.jsx("div",{className:`w-5 h-5 rounded border-2 flex items-center justify-center ${o?"bg-blue-500 border-blue-500":"border-gray-300 bg-white"}`,children:o&&S.jsx(xg,{className:"w-3.5 h-3.5 text-white"})})})]})}const MUr={claude:"onboarding.s1.descClaude",codex:"onboarding.s1.descCodex",gemini:"onboarding.s1.descGemini",copilot:"onboarding.s1.descCopilot",opencode:"onboarding.s1.descOpencode"};function NUr({onNext:t}){const{t:n}=Zn(),[i,o]=F.useState([]),[a,c]=F.useState(new Set),[u,f]=F.useState(!0),[g,w]=F.useState(!1),x=async()=>{f(!0),w(!1);try{const A=(await wn.getVersions()).filter(D=>D.name!=="crewx"),M=await Promise.all(A.map(async D=>{if(!D.installed)return{...D};try{const P=await wn.check(D.name);return{...D,checkResult:P}}catch{return{...D}}}));o(M);const I=new Set(M.filter(D=>D.installed).map(D=>D.name));c(I)}catch{w(!0)}finally{f(!1)}};F.useEffect(()=>{x()},[]);const v=(E,A)=>{c(M=>{const I=new Set(M);return A?I.add(E):I.delete(E),I})},C=()=>{const E=i.filter(A=>a.has(A.name));t(E)};return u?S.jsxs("div",{className:"flex flex-col items-center gap-3 py-12",children:[S.jsx(Is,{className:"w-8 h-8 animate-spin text-blue-500"}),S.jsx("p",{className:"text-gray-500",children:n("onboarding.s1.loadingCards")})]}):g?S.jsxs("div",{className:"flex flex-col items-center gap-3 py-12",children:[S.jsx("p",{className:"text-gray-900 font-medium",children:n("onboarding.s1.errorTitle")}),S.jsx("p",{className:"text-gray-500",children:n("onboarding.s1.errorDesc")}),S.jsx("button",{type:"button",onClick:x,className:"px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600",children:n("onboarding.common.retry")})]}):S.jsxs("div",{className:"space-y-4",children:[i.map(E=>{var A;return S.jsx(AUr,{cli:E,version:E.currentVersion??void 0,authenticated:((A=E.checkResult)==null?void 0:A.authenticated)??null,selected:a.has(E.name),description:n(MUr[E.name]??""),onToggle:M=>v(E.name,M)},E.name)}),S.jsxs("div",{className:"pt-4",children:[S.jsx("button",{type:"button",onClick:C,disabled:a.size===0,className:"w-full px-6 py-3 bg-blue-500 text-white rounded-lg hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed font-medium",children:n("onboarding.common.next")}),a.size===0&&S.jsx("p",{className:"text-sm text-amber-600 text-center mt-2",children:n("onboarding.s1.noToolsSelected")})]})]})}function jUr({selectedCLIs:t,onComplete:n,onPrev:i}){const{t:o}=Zn(),[a,c]=F.useState([]),[u,f]=F.useState([]),[g,w]=F.useState(!1),[x,v]=F.useState(null),C=F.useRef(null),E=F.useRef(!1);F.useEffect(()=>{const U=t.map(W=>{var G,Y;return{name:W.name,displayName:W.displayName,status:"pending",needsInstall:!W.installed,needsLogin:((G=W.checkResult)==null?void 0:G.authenticated)!==!0,loginCommand:((Y=W.checkResult)==null?void 0:Y.loginCommand)??null}});c(U)},[t]);const A=F.useCallback((U,W="output")=>{f(G=>[...G,{text:U,type:W}])},[]),M=F.useCallback((U,W)=>{c(G=>G.map(Y=>Y.name===U?{...Y,...W}:Y))},[]);F.useEffect(()=>{C.current&&(C.current.scrollTop=C.current.scrollHeight)},[u]),F.useEffect(()=>{a.length===0||E.current||(E.current=!0,I())},[a.length]);const I=async()=>{const U=a.filter(Y=>Y.needsInstall);if(U.length>0){A(o("onboarding.s2.installStarting"),"output");const Y=U.map(async te=>{const Q=IUr(te.name);if(!Q){A("$ curl -fsSL https://antigravity.google/cli/install.sh | bash","command"),A(`${te.displayName} — 수동 설치가 필요합니다. 위 명령어를 터미널에서 실행하세요.`,"output"),M(te.name,{status:"done",needsInstall:!1});return}M(te.name,{status:"installing"}),A(`$ npm install -g ${Q}`,"command");try{await wn.update(te.name),M(te.name,{status:"installed",needsInstall:!1}),A(`✔ ${te.displayName} ${o("onboarding.s2.installOk")}`,"success")}catch(se){M(te.name,{status:"failed"});const ce=se instanceof Error?se.message:String(se);A(`✘ ${te.displayName}: ${ce}`,"error")}});await Promise.allSettled(Y)}const W=await Promise.all(a.map(async Y=>{if(Y.status==="failed")return Y;try{const te=await wn.check(Y.name);return{...Y,needsLogin:te.authenticated!==!0,loginCommand:te.loginCommand}}catch{return Y}}));c(W);const G=W.filter(Y=>Y.needsLogin&&Y.status!=="failed");for(const Y of G){const te=a.find(ce=>ce.name===Y.name);if((te==null?void 0:te.status)==="failed")continue;const Q=Y.loginCommand;if(!Q){M(Y.name,{status:"done"});continue}M(Y.name,{status:"logging_in"}),await wn.cliLogin(Y.name).catch(()=>{}),A(`$ ${Q}`,"command"),A(o("onboarding.s2.loginWaiting",{name:Y.displayName}),"output"),await D(Y.name)?(M(Y.name,{status:"done"}),A(`✔ ${Y.displayName} ${o("onboarding.s2.loginOk")}`,"success")):(A(`⚠ ${Y.displayName} ${o("onboarding.s2.loginSkipped")}`,"output"),M(Y.name,{status:"done"}))}c(Y=>Y.map(te=>te.status==="pending"||te.status==="installed"?{...te,status:"done"}:te)),w(!0)},D=async U=>{for(let W=0;W<60;W++){await new Promise(G=>setTimeout(G,3e3));try{if((await wn.check(U)).authenticated===!0)return!0}catch{}}return!1},P=async(U,W)=>{await navigator.clipboard.writeText(U),v(W),setTimeout(()=>v(null),2e3)},R=U=>{switch(U){case"installing":case"logging_in":return S.jsx(Is,{className:"w-4 h-4 animate-spin text-blue-500"});case"done":case"installed":return S.jsx(xg,{className:"w-4 h-4 text-green-600"});case"failed":return S.jsx(I9,{className:"w-4 h-4 text-red-500"});default:return S.jsx("div",{className:"w-4 h-4 rounded-full border-2 border-gray-300"})}},z=U=>{switch(U.status){case"installing":return o("onboarding.s2.statusInstalling");case"installed":return`✅ ${o("onboarding.s2.statusInstalled")}`;case"logging_in":return`✅ ${o("onboarding.s2.statusInstalled")} · ⏳ ${o("onboarding.s2.statusLoggingIn")}`;case"done":return`✅ ${o("onboarding.s2.statusComplete")}`;case"failed":return`❌ ${o("onboarding.s2.statusFailed")}`;default:return""}};return S.jsxs("div",{className:"space-y-6",children:[S.jsx("div",{className:"space-y-3",children:a.map(U=>S.jsxs("div",{className:"flex items-center gap-3 p-3 bg-white border border-gray-200 rounded-lg",children:[R(U.status),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("span",{className:"font-medium text-gray-900",children:U.displayName}),S.jsx("span",{className:"ml-2 text-sm text-gray-500",children:z(U)})]})]},U.name))}),S.jsxs("div",{className:"rounded-lg overflow-hidden border border-gray-700",children:[S.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 bg-gray-800 border-b border-gray-700",children:[S.jsxs("div",{className:"flex gap-1.5",children:[S.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),S.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),S.jsx("div",{className:"w-3 h-3 rounded-full bg-green-500"})]}),S.jsxs("span",{className:"text-xs text-gray-400 ml-2",children:["crewx — ",o("onboarding.s2.setupLog")]})]}),S.jsxs("div",{ref:C,className:"bg-gray-900 p-4 font-mono text-sm text-gray-100 max-h-64 overflow-y-auto space-y-1",children:[u.length===0&&S.jsx("div",{className:"text-gray-500",children:o("onboarding.s2.waitingForSetup")}),u.map((U,W)=>S.jsxs("div",{className:"flex items-start gap-2 group",children:[S.jsx("span",{className:U.type==="command"?"text-cyan-400":U.type==="success"?"text-green-400":U.type==="error"?"text-red-400":"text-gray-300",children:U.text}),U.type==="command"&&S.jsx("button",{type:"button",onClick:()=>P(U.text.replace(/^\$ /,""),`log-${W}`),className:"flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity text-gray-500 hover:text-white",children:x===`log-${W}`?S.jsx(xg,{className:"w-3.5 h-3.5"}):S.jsx(x5,{className:"w-3.5 h-3.5"})})]},W))]})]}),S.jsxs("div",{className:"flex gap-3 pt-2",children:[S.jsx("button",{type:"button",onClick:i,className:"flex-1 px-6 py-3 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 font-medium",children:o("onboarding.common.prev")}),S.jsx("button",{type:"button",onClick:n,className:`flex-1 px-6 py-3 rounded-lg font-medium ${g?"bg-blue-500 text-white hover:bg-blue-600 animate-pulse shadow-lg shadow-blue-200":"bg-blue-500 text-white hover:bg-blue-600"}`,children:o("onboarding.common.start")})]})]})}const DUr={claude:"@anthropic-ai/claude-code",codex:"@openai/codex",gemini:"@google/gemini-cli",antigravity:"",copilot:"@github/copilot",opencode:"opencode-ai"};function IUr(t){return DUr[t]??t}const Rdn=["#step1","#step2"],OUr=2;function ULe(t){return Rdn.includes(t)?t:"#step1"}function LUr(t){return Rdn.indexOf(t)+1}function PUr(){const{t}=Zn(),n=Cg(),i=ob(),[o,a]=F.useState(()=>ULe(i.hash||"#step1")),[c,u]=F.useState([]);F.useEffect(()=>{const E=ULe(i.hash);a(E),i.hash!==E&&(window.location.hash=E)},[i.hash]),F.useEffect(()=>{const E=()=>{a(ULe(window.location.hash))};return window.addEventListener("hashchange",E),()=>window.removeEventListener("hashchange",E)},[]),F.useEffect(()=>{window.location.hash||(window.location.hash="#step1")},[]);const f=F.useCallback(E=>{window.location.hash=E,a(E)},[]);F.useEffect(()=>{o!=="#step1"&&c.length===0&&f("#step1")},[o,c.length,f]);const g=F.useCallback(()=>{Zc.getState().set("ui",{onboardingDismissed:!0});const E=Zd.getState().currentWorkspaceSlug;n(E?`/ws/${E}`:"/workspaces",{replace:!0})},[n]),w=()=>{g()},x=E=>{if(u(E),c5("onboarding_step_complete",{step_id:"S1"}),E.every(M=>{var I;return M.installed&&((I=M.checkResult)==null?void 0:I.authenticated)===!0})){g();return}f("#step2")},v=()=>{c5("onboarding_step_complete",{step_id:"S2"}),g()},C=t(o==="#step1"?"onboarding.common.skipS1":"onboarding.common.skipS2");return S.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col",children:[S.jsxs("div",{className:"text-center pt-12 pb-6",children:[S.jsx("p",{className:"text-sm text-gray-500 mb-2",children:t("onboarding.common.stepOf",{current:LUr(o),total:OUr})}),S.jsxs("h1",{className:"text-2xl font-bold text-gray-900",children:[o==="#step1"&&t("onboarding.s1.title"),o==="#step2"&&t("onboarding.s2.title")]}),o==="#step1"&&S.jsx("p",{className:"text-gray-500 mt-2",children:t("onboarding.s1.subtitle")}),o==="#step2"&&S.jsx("p",{className:"text-gray-500 mt-2",children:t("onboarding.s2.subtitle")})]}),S.jsxs("div",{className:"flex-1 mx-auto w-full px-4 pb-8 max-w-lg",children:[o==="#step1"&&S.jsx(NUr,{onNext:x}),o==="#step2"&&c.length>0&&S.jsx(jUr,{selectedCLIs:c,onComplete:v,onPrev:()=>f("#step1")}),S.jsx("div",{className:"text-center mt-6",children:S.jsx("button",{type:"button",onClick:w,className:"text-sm text-gray-400 hover:text-gray-600 underline",children:C})})]})]})}function RUr({onDismiss:t}){const{t:n}=Zn(),i=Cg(),o=Zc(u=>u.set),a=()=>{i("/onboarding",{replace:!0})},c=()=>{o("ui",{onboardingDismissed:!0}),t()};return S.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:S.jsxs("div",{className:"bg-white rounded-xl shadow-2xl p-6 max-w-sm mx-4 text-center",children:[S.jsx("h2",{className:"text-lg font-bold text-gray-900 mb-2",children:n("onboarding.popup.title")}),S.jsx("p",{className:"text-sm text-gray-500 mb-6",children:n("onboarding.popup.description")}),S.jsxs("div",{className:"flex gap-3",children:[S.jsx("button",{type:"button",onClick:c,className:"flex-1 px-4 py-2.5 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 font-medium text-sm",children:n("onboarding.popup.no")}),S.jsx("button",{type:"button",onClick:a,className:"flex-1 px-4 py-2.5 bg-blue-500 text-white rounded-lg hover:bg-blue-600 font-medium text-sm",children:n("onboarding.popup.yes")})]})]})})}function $Ur(){const t=Zc(o=>o.ui.onboardingDismissed),[n,i]=F.useState(t?"done":"loading");return F.useEffect(()=>{if(t){i("done");return}wn.getAllTasks({status:["success"],limit:1}).then(o=>{const a=o.tasks.length>0;i(a?"done":"popup")}).catch(()=>{i("done")})},[t]),n==="loading"?S.jsx("div",{"data-testid":"onboarding-guard-loading",className:"flex items-center justify-center h-screen bg-gray-50",children:S.jsx(Is,{className:"w-8 h-8 animate-spin text-blue-500"})}):n==="popup"?S.jsxs(S.Fragment,{children:[S.jsx(RUr,{onDismiss:()=>i("done")}),S.jsx(ahe,{})]}):S.jsx(ahe,{})}class FUr extends F.Component{constructor(){super(...arguments);sn(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(i,o){CVn(SVn(i)),console.error("ErrorBoundary caught an error",i,o)}render(){return this.state.hasError?this.props.fallback:this.props.children}}function BUr({routes:t}){const{pathname:n}=ob();return F.useEffect(()=>{var a;const i=OFe(t,{pathname:n}),o=(a=i==null?void 0:i.at(-1))==null?void 0:a.route.handle;o!=null&&o.screenId&&(o.manualTracking||$Jt(o.screenId,o.screenTitle))},[n,t]),null}const zUr={success:{container:"border-emerald-200 bg-emerald-50 text-emerald-700",icon:S.jsx(bR,{size:18,className:"shrink-0"})},error:{container:"border-red-200 bg-red-50 text-red-700",icon:S.jsx(wc,{size:18,className:"shrink-0"})},info:{container:"border-blue-200 bg-blue-50 text-blue-700",icon:S.jsx(wR,{size:18,className:"shrink-0"})}};function HUr(){const t=Lm(n=>n.toasts);return t.length===0?null:S.jsx("div",{className:"pointer-events-none fixed bottom-6 right-6 z-50 flex w-full max-w-sm flex-col gap-3 px-4 sm:w-auto sm:px-0",children:t.map(n=>{const i=zUr[n.type];return S.jsxs("div",{role:n.type==="error"?"alert":"status","aria-live":n.type==="error"?"assertive":"polite",className:`pointer-events-auto flex items-start gap-3 rounded-lg border px-4 py-3 text-sm font-medium shadow-lg ${i.container}`,children:[i.icon,S.jsx("div",{className:"min-w-0 flex-1 leading-5",children:n.message})]},n.id)})})}function UUr(){const{t}=Zn(),n=DD(u=>u.phase),i=DD(u=>u.targetWorkspace),o=DD(u=>u.error),a=DD(u=>u.clear);if(n==="idle")return null;const c=n==="error";return S.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-gray-950/45 px-4",children:S.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-gray-200 bg-white p-6 shadow-xl",children:[S.jsx("div",{className:`flex h-12 w-12 items-center justify-center rounded-full ${c?"bg-red-50 text-red-500":"bg-blue-50 text-blue-500"}`,children:c?S.jsx(wc,{size:22}):S.jsx(Is,{size:22,className:"animate-spin"})}),S.jsx("h2",{className:"mt-4 text-lg font-semibold text-gray-900",children:t(c?"workspace.switchErrorTitle":"workspace.switchingTitle")}),S.jsx("p",{className:"mt-2 text-sm text-gray-500",children:c?o||t("workspace.switchErrorDescription"):t("workspace.switchingDescription",{name:(i==null?void 0:i.name)??""})}),c?S.jsx("div",{className:"mt-5",children:S.jsx("button",{type:"button",onClick:a,className:"inline-flex items-center justify-center rounded-lg bg-gray-900 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-gray-800",children:t("common.close")})}):null]})})}const WUr=F.lazy(()=>Cl(()=>import("./MarketPage-Bnv2saW1.js"),__vite__mapDeps([])));function ec(t,n,i){return{screenId:t,screenTitle:n,...i}}function qUr(){const{slug:t}=Ff(),n=Zd(u=>u.setCurrentWorkspaceId),i=Zd(u=>u.setCurrentWorkspaceSlug),o=Cg(),[a,c]=F.useState(null);return F.useEffect(()=>{if(!t)return;let u=!0;return c(null),i(t),wn.getWorkspaces().then(f=>{if(!u)return;const g=f.workspaces.find(w=>w.slug===t)??null;if(g){n(g.id),i(g.slug),c(g.slug);return}n(null),i(null),c(null),o("/workspaces",{replace:!0})}).catch(()=>{u&&(n(null),i(null),c(null),o("/workspaces",{replace:!0}))}),()=>{u=!1}},[t,n,i,o]),a!==t?S.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-50",children:S.jsx(Is,{size:24,className:"animate-spin text-gray-400"})}):S.jsx(ahe,{})}function GUr(){const t=Zd(f=>f.currentWorkspaceSlug),n=Zd(f=>f.setCurrentWorkspaceId),i=Zd(f=>f.setCurrentWorkspaceSlug),[o,a]=F.useState(()=>t?`/ws/${t}`:null),[c,u]=F.useState(()=>!t);return F.useEffect(()=>{if(t){a(`/ws/${t}`),u(!1);return}let f=!0;return u(!0),a(null),wn.getWorkspaces().then(g=>{if(!f)return;const w=g.workspaces.find(x=>x.is_current)??null;if(w){n(w.id),i(w.slug),a(`/ws/${w.slug}`),u(!1);return}n(null),i(null),a("/workspaces"),u(!1)}).catch(()=>{f&&(n(null),i(null),a("/workspaces"),u(!1))}),()=>{f=!1}},[t,n,i]),o?S.jsx(_D,{to:o,replace:!0}):c?S.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-50",children:S.jsx(Is,{size:24,className:"animate-spin text-gray-400"})}):S.jsx(_D,{to:"/workspaces",replace:!0})}function VUr(){return S.jsx(IJt,{children:S.jsx(TUr,{standalone:!0})})}const $dn=_Gn(S.jsxs(S.Fragment,{children:[S.jsx(da,{path:"/onboarding",element:S.jsx(PUr,{}),handle:ec("ONBUI001","온보딩 위자드")}),S.jsx(da,{path:"/workspaces",element:S.jsx(VUr,{}),handle:ec("WKSUI001","워크스페이스 관리")}),S.jsx(da,{path:"/",element:S.jsx(GUr,{})}),S.jsx(da,{path:"/ws/:slug",element:S.jsx(qUr,{}),children:S.jsx(da,{element:S.jsx($Ur,{}),children:S.jsxs(da,{element:S.jsx(IKn,{}),children:[S.jsx(da,{index:!0,element:S.jsx(AWt,{}),handle:ec("THDUI000","새 대화")}),S.jsx(da,{path:"tasks",element:S.jsx(lAr,{}),handle:ec("TSKUI001","태스크 목록")}),S.jsx(da,{path:"tasks/:taskId",element:S.jsx(O6r,{}),handle:ec("TSKUI002","태스크 상세")}),S.jsx(da,{path:"threads/new",element:S.jsx(AWt,{}),handle:ec("THDUI000","새 대화")}),S.jsx(da,{path:"threads",element:S.jsx(uOr,{}),handle:ec("THDUI001","대화 목록")}),S.jsx(da,{path:"threads/:threadId",element:S.jsx(COr,{}),handle:ec("THDUI002","대화창")}),S.jsx(da,{path:"workspaces",element:S.jsx(_D,{to:"/workspaces",replace:!0}),handle:ec("WKSUI001","워크스페이스 관리")}),S.jsx(da,{path:"projects",element:S.jsx(AOr,{}),handle:ec("PJTUI000","프로젝트 목록")}),S.jsx(da,{path:"projects/new",element:S.jsx(jOr,{}),handle:ec("PJTUI002","프로젝트 생성")}),S.jsx(da,{path:"projects/:id",element:S.jsx(POr,{}),handle:ec("PJTUI001","프로젝트 상세")}),S.jsx(da,{path:"daily-planner",element:S.jsx(tLr,{}),handle:ec("PLNUI001","데일리 플래너")}),S.jsx(da,{path:"cron-schedules",element:S.jsx(ALr,{}),handle:ec("CRONUI001","크론 스케줄")}),S.jsx(da,{path:"goals",element:S.jsx(PLr,{}),handle:ec("GOAUI000","목표 목록")}),S.jsx(da,{path:"goals/:goalId",element:S.jsx(CFr,{}),handle:ec("GOAUI001","목표 상세")}),S.jsx(da,{path:"search",element:S.jsx(E8r,{}),handle:{screenId:"SRCHUI001",screenTitle:"통합 검색"}}),S.jsx(da,{path:"docs",element:S.jsx(C8r,{}),handle:ec("DOCUI001","문서 관리")}),S.jsx(da,{path:"workflows",element:S.jsx(_Fr,{}),handle:ec("WFLUI001","워크플로 목록")}),S.jsx(da,{path:"workflows/:id",element:S.jsx(pUr,{}),handle:ec("WFLUI002","워크플로 상세",{manualTracking:!0})}),S.jsx(da,{path:"market",element:S.jsx(F.Suspense,{fallback:S.jsx("div",{className:"flex items-center justify-center py-16",children:S.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-gray-300 border-t-blue-500"})}),children:S.jsx(WUr,{})}),handle:ec("MKTUI001","마켓")}),S.jsx(da,{path:"agents",element:S.jsx(hAr,{}),handle:ec("AGTUI001","에이전트 관리")}),S.jsx(da,{path:"agents/new",element:S.jsx(LUt,{}),handle:ec("AGTUI002","에이전트 추가/편집")}),S.jsx(da,{path:"agents/:agentId/edit",element:S.jsx(LUt,{}),handle:ec("AGTUI002","에이전트 추가/편집")}),S.jsx(da,{path:"skills",element:S.jsx(_D,{to:"market",replace:!0})}),S.jsx(da,{path:"cli",element:S.jsx(UKn,{}),handle:ec("CLIVUI001","CLI 버전 관리")}),S.jsx(da,{path:"usage",element:S.jsx(WQn,{}),handle:ec("USGUI002","Usage 사용량")}),S.jsx(da,{path:"memory",element:S.jsx(_D,{to:"docs",replace:!0}),handle:ec("DOCUI001","문서 관리")}),S.jsx(da,{path:"graph",element:S.jsx(_D,{to:"docs",replace:!0}),handle:ec("DOCUI001","문서 관리")}),S.jsx(da,{path:"wbs/*",element:S.jsx(_D,{to:"..",relative:"path",replace:!0}),handle:ec("THDUI000","새 대화")}),S.jsx(da,{path:"settings",element:S.jsx(cZn,{}),handle:ec("STGUI001","환경 설정")}),S.jsx(da,{path:"test",element:S.jsx(mUr,{})})]})})})]}));function KUr(){const{t}=Zn();return S.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-50 px-4",children:S.jsxs("div",{className:"w-full max-w-md rounded-lg border border-red-200 bg-white p-6 text-center shadow-sm",children:[S.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:t("common.somethingWentWrong")}),S.jsx("p",{className:"mt-2 text-sm text-gray-500",children:t("common.tryRefreshingPage")}),S.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"mt-5 inline-flex items-center justify-center rounded-lg bg-blue-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-600",children:t("common.refresh")})]})})}function JUr(){return fGn($dn)}function YUr(){const t=Zc(n=>n.ui.theme);return F.useEffect(()=>{lHn(t)},[t]),S.jsx(XGn,{children:S.jsx(FUr,{fallback:S.jsx(KUr,{}),children:S.jsx(PKn,{children:S.jsxs(S.Fragment,{children:[S.jsx(BUr,{routes:$dn}),S.jsx(JUr,{}),S.jsx(HUr,{}),S.jsx(UUr,{})]})})})})}vVn();WLe.createRoot(document.getElementById("root")).render(S.jsx(or.StrictMode,{children:S.jsx(YUr,{})}));export{kgr as $,qV as A,cur as B,hze as C,UQt as D,Qv as E,O1r as F,Bwr as G,uzt as H,Ecr as I,bdr as J,_gr as K,H7 as L,iWr as M,T0e as N,OBe as O,rWr as P,wtn as Q,I1r as R,tY as S,Xcr as T,eY as U,rs as V,xs as W,bcr as X,ZQt as Y,E1r as Z,pe as _,rur as a,vg as a$,TBt as a0,_Bt as a1,gWr as a2,uWr as a3,hWr as a4,fWr as a5,lWr as a6,ZBe as a7,pWr as a8,cWr as a9,Fdr as aA,In as aB,nf as aC,wn as aD,Zn as aE,Sd as aF,F as aG,S as aH,y0 as aI,wc as aJ,mC as aK,Is as aL,TFe as aM,DFe as aN,rqn as aO,kx as aP,ef as aQ,QWn as aR,w9 as aS,pJt as aT,V7t as aU,she as aV,cJt as aW,gJt as aX,MFe as aY,Op as aZ,x5 as a_,yP as aa,bWr as ab,mWr as ac,dWr as ad,Xbr as ae,qrn as af,SWr as ag,Ks as ah,bC as ai,Sbr as aj,Rwr as ak,CWr as al,EWr as am,vWr as an,ss as ao,kWr as ap,GBe as aq,Ewr as ar,vwr as as,xwr as at,Cgr as au,t9 as av,S5 as aw,DR as ax,h0e as ay,Bdr as az,nur as b,Cl as b$,Tx as b0,tln as b1,MWr as b2,xg as b3,Qa as b4,NWr as b5,bc as b6,v_r as b7,LUn as b8,RUn as b9,rmr as bA,oY as bB,kD as bC,Kmr as bD,UBt as bE,$9 as bF,smr as bG,oze as bH,nmr as bI,lmr as bJ,NR as bK,Qmr as bL,bwr as bM,kg as bN,vnn as bO,jR as bP,Ytn as bQ,eC as bR,KV as bS,Z1 as bT,Uhr as bU,JBe as bV,etn as bW,iY as bX,rtn as bY,aWr as bZ,Hlr as b_,FUn as ba,FHn as bb,GUn as bc,uqn as bd,sWn as be,tWn as bf,LWn as bg,hUn as bh,iJt as bi,yR as bj,xqn as bk,RWn as bl,San as bm,Jan as bn,wan as bo,kan as bp,dHe as bq,Zd as br,z6r as bs,_0e as bt,s1r as bu,ayr as bv,Zmr as bw,tpe as bx,Qhe as by,imr as bz,Pl as c,xo as d,QQt as e,gg as f,sur as g,V7 as h,d9 as i,Hdr as j,AR as k,Pn as l,Qtn as m,aur as n,our as o,sWr as p,TWr as q,_Wr as r,iur as s,oWr as t,nC as u,tur as v,R1r as w,wdr as x,mwr as y,wWr as z};
|
|
1284
1284
|
function __vite__mapDeps(indexes) {
|
|
1285
1285
|
if (!__vite__mapDeps.viteFileDeps) {
|
|
1286
|
-
__vite__mapDeps.viteFileDeps = ["assets/dagre-4EVJKHTY-
|
|
1286
|
+
__vite__mapDeps.viteFileDeps = ["assets/dagre-4EVJKHTY-BJ50i2_m.js","assets/graph-BlwPajkw.js","assets/layout-Bvwu4dCi.js","assets/c4Diagram-6F5ED5ID-BUe_rR7Y.js","assets/chunk-ASOPGD6M-i8At8zRu.js","assets/flowDiagram-7ASYPVHJ-DlrcDbvp.js","assets/chunk-5HRBRIJM-VWEDho2B.js","assets/channel-Deb-qFqi.js","assets/erDiagram-6RL3IURR-BAhBdC1z.js","assets/gitGraphDiagram-NRZ2UAAF-7ip44CZQ.js","assets/chunk-TMUBEWPD-Q3a3gmJu.js","assets/chunk-KFBOBJHC-CxbLrU0W.js","assets/gitGraph-YCYPL57B-D16xMGK9.js","assets/ganttDiagram-NTVNEXSI-BLSL7dfk.js","assets/linear-Jngh3ocV.js","assets/init-Gi6I4Gst.js","assets/infoDiagram-A4XQUW5V-CT9ls8r5.js","assets/pieDiagram-YF2LJOPJ-CeKkxh4S.js","assets/arc-CFW0t9T4.js","assets/ordinal-Cboi1Yqb.js","assets/quadrantDiagram-OS5C2QUG-BXiERIqS.js","assets/xychartDiagram-6QU3TZC5-BDaatX2I.js","assets/requirementDiagram-MIRIMTAZ-wJozTJV-.js","assets/sequenceDiagram-G6AWOVSC-BiqICp8h.js","assets/classDiagram-LNE6IOMH-4CBrVNwA.js","assets/chunk-T2TOU4HS-C4FogIJY.js","assets/classDiagram-v2-MQ7JQ4JX-4CBrVNwA.js","assets/stateDiagram-MAYHULR4-oVBKhczb.js","assets/chunk-7U56Z5CX-IVaYF1Wj.js","assets/stateDiagram-v2-4JROLMXI-BAEx6L5g.js","assets/journeyDiagram-G5WM74LC-BRE4IIDc.js","assets/timeline-definition-U7ZMHBDA-D6vmf3rm.js","assets/mindmap-definition-GWI6TPTV-BpT7MvEu.js","assets/cytoscape.esm-BiciSPf8.js","assets/sankeyDiagram-Y46BX6SQ-C8AMM3An.js","assets/diagram-QW4FP2JN-0SUZm5X-.js","assets/blockDiagram-ZHA2E4KO-CZynHFsv.js","assets/architectureDiagram-UYN6MBPD-Bg4Tz5B9.js"]
|
|
1287
1287
|
}
|
|
1288
1288
|
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
|
1289
1289
|
}
|