PageSourceSearch

https://askyourvideo.io/_next/static/chunks/21d476b816163c97.js

js askyourvideo.io collected 2026-10-02 01:58:23 UTC 217,509 bytes, 4 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,369090,(e,t,n)=>{"use strict";var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,l=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,c=/^\s+|\s+$/g;function d(e){return e?e.replace(c,""):""}t.exports=function(e,t){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,c=1;function f(e){var t=e.match(i);t&&(n+=t.length);var r=e.lastIndexOf("\n");c=~r?e.length-r:c+e.length}function h(){var e={line:n,column:c};return function(t){return t.position=new p(e),g(l),t}}function p(e){this.start=e,this.end={line:n,column:c},this.source=t.source}function m(r){var i=Error(t.source+":"+n+":"+c+": "+r);if(i.reason=r,i.filename=t.source,i.line=n,i.column=c,i.source=e,t.silent);else throw i}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function x(e){var t;for(e=e||[];t=v();)!1!==t&&e.push(t);return e}function v(){var t=h();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return m("End of comment missing");var r=e.slice(2,n-2);return c+=2,f(r),e=e.slice(n),c+=2,t({type:"comment",comment:r})}}p.prototype.content=e,g(l);var y,b=[];for(x(b);y=function(){var e=h(),t=g(o);if(t){if(v(),!g(a))return m("property missing ':'");var n=g(s),i=e({type:"declaration",property:d(t[0].replace(r,"")),value:n?d(n[0].replace(r,"")):""});return g(u),i}}();)!1!==y&&(b.push(y),x(b));return b}},559596,(e,t,n)=>{"use strict";var r=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;let r=(0,i.default)(e),l="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;let{property:r,value:i}=e;l?t(r,i,e):i&&((n=n||{})[r]=i)}),n};let i=r(e.r(369090))},851521,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,l=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},u=function(e,t){return"".concat(t,"-")};n.camelCase=function(e,t){var n;return(void 0===t&&(t={}),!(n=e)||l.test(n)||r.test(n))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(a,u):e.replace(o,u)).replace(i,s))}},763185,(e,t,n)=>{"use strict";var r=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(559596)),i=e.r(851521);function l(e,t){var n={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}l.default=l,t.exports=l},975609,(e,t,n)=>{"use strict";var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,l=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},s=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),l=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!l)return!1;for(t in e);return void 0===t||r.call(e,t)},u=function(e,t){l&&"__proto__"===t.name?l(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;else if(o)return o(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,l,o,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(t=arguments[f],null!=t)for(n in t)r=c(d,n),d!==(i=c(t,n))&&(p&&i&&(s(i)||(l=a(i)))?(l?(l=!1,o=r&&a(r)?r:[]):o=r&&s(r)?r:{},u(d,{name:n,newValue:e(p,o,i)})):void 0!==i&&u(d,{name:n,newValue:i}));return d}},331830,e=>{"use strict";var t=e.i(898516),n=e.i(306766),r=e.i(25309),i=e.i(853741),l=e.i(508332),o=e.i(685149);function a(){let[e,t]=(0,i.useState)(!1),[n,r]=(0,i.useState)(null);
1return{showModal:e,balanceData:n,openModal:e=>{t(!0),r(e)},closeModal:()=>{t(!1),r(null)},navigateToBilling:()=>{window.location.href=o.ROUTES.BILLING}}}function s(e,t){let n=(0,i.useRef)(e),r=(0,i.useRef)(null);(0,i.useEffect)(()=>{n.current=e},[e]);let l=(0,i.useCallback)(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),o=(0,i.useMemo)(()=>(...e)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{n.current(...e),r.current=null},t)},[t]);return(0,i.useEffect)(()=>l,[l]),{run:o,cancel:l}}var u=e.i(634318),c=e.i(727289),d=e.i(682310),f=e.i(747133),h=e.i(940948),p=e.i(863945),m=e.i(209165),g=e.i(580910);function x(e){let t=(0,n.useRouter)(),r=(0,h.useQueryClient)(),l=(0,g.useUpsertConversation)(),{isProcessing:o,startProcessing:a,fail:s,reset:u,clearController:c}=(0,p.useProcessingStore)();return{isSubmitting:o,analyzeVideo:async(n,i,o)=>{let d=!!o,f=o||crypto.randomUUID();if(!d&&i){let e={id:crypto.randomUUID(),role:"user",content:n,created_at:new Date().toISOString(),isPending:!1},o={id:crypto.randomUUID(),role:"assistant",content:"",created_at:new Date().toISOString(),isPending:!0},a={id:f,user_id:0,video_url:i.url,video_name:i.title,summary:i.title,status:"processing",created_at:e.created_at,updated_at:e.created_at,duration_seconds:i.durationSeconds,messages:[e,o],is_shared:!1,isPending:!0};l({id:f,user_id:0,video_url:i.url,video_name:i.title,summary:i.title??"Processing video...",status:"processing",created_at:e.created_at,updated_at:e.created_at,duration_seconds:i.durationSeconds,message_count:1,is_shared:!1,isPending:!0}),r.setQueryData(g.conversationKeys.detail(f),a),t.push(`/c/${f}`)}if(d){let e={id:crypto.randomUUID(),role:"user",content:n,created_at:new Date().toISOString(),isPending:!1},t={id:crypto.randomUUID(),role:"assistant",content:"",created_at:new Date().toISOString(),isPending:!0};r.setQueryData(g.conversationKeys.detail(o),n=>n?{...n,status:"processing",isPending:!0,messages:[...n.messages,e,t]}:n),r.invalidateQueries({queryKey:g.conversationKeys.lists()})}let h=await e.getToken();if(!h)throw Error("Not authenticated");let p=new AbortController;a(f,p,d);try{let e=new FormData;e.append("question",n),e.append("conversation_id",f),i&&e.append("video_url",i.url),await (0,m.analyzeVideo)(e,p.signal,async()=>h),console.log("[VideoAnalysis] Analysis started successfully",{conversationId:f,question:n.substring(0,50)}),c()}catch(t){if(console.error("[VideoAnalysis] Failed to start analysis:",t),t instanceof Error&&"AbortError"===t.name)return void console.log("[VideoAnalysis] Request aborted (expected)");throw s(t instanceof Error?t.message:"Unknown error"),r.setQueryData(g.conversationKeys.detail(f),e=>e?{...e,status:"failed",error_message:t instanceof Error?t.message:"Unknown error",isPending:!1}:e),e.onError?.(t instanceof Error?t:Error("Unknown error")),u(),t}},cleanup:(0,i.useCallback)(()=>{console.log("[VideoAnalysis] Cleanup - cancelling request via store"),p.useProcessingStore.getState().cancelRequest()},[])}}var v=e.i(712580),y=e.i(346404),b=e.i(403562),k=e.i(375679),w=e.i(152702),j=e.i(754219),S=e.i(3765);let C=(0,i.memo)(function({thumbnail:e,title:n,videoUrl:r,durationSeconds:i,onRemove:l,isLoading:o=!1,videoNotPublicError:a}){if(o)return(0,t.jsx)(N,{});let s=null!=a;return(0,t.jsx)("div",{className:"w-full max-w-2xl animate-video-preview-enter","data-testid":"video-card",children:(0,t.jsxs)("div",{className:`overflow-hidden rounded-2xl border bg-bg-0 shadow-soft ${s?"border-amber-500/40":"border-border"}`,children:[(0,t.jsxs)("div",{className:"relative aspect-video overflow-hidden bg-bg-2",children:[(0,t.jsx)(S.default,{src:e,alt:s?"Private video thumbnail":n,fill:!0,sizes:"(max-width: 768px) 100vw, 640px",className:`object-cover ${s?"opacity-50":""}`}),s&&(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,t.jsx)("svg",{className:"h-16 w-16 text-amber-600 dark:text-amber-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})})}),i&&!s&&(0,t.jsx)("div",{className:"absolute bottom-2 right-2 roun
1ded-md bg-black/80 px-2 py-1 text-xs font-semibold text-white backdrop-blur-sm",children:(0,u.formatDuration)(i)}),(0,t.jsx)("div",{className:"absolute inset-0 cursor-default"})]}),(0,t.jsxs)("div",{className:"p-5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[s?(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("svg",{className:"h-5 w-5 flex-shrink-0 text-amber-600 dark:text-amber-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),(0,t.jsx)("span",{className:"text-lg font-semibold text-amber-600 dark:text-amber-400 md:text-xl",children:a?.isPrivate?"Private video":"Unlisted video"})]}),(0,t.jsx)("p",{className:"mt-2 text-sm text-amber-600/80 dark:text-amber-400/80",children:a?.isPrivate?"This video is private and can't be analyzed. Try a public video instead.":"This video is unlisted and can't be analyzed. Try a public video instead."})]}):(0,t.jsx)("h3",{className:"line-clamp-2 flex-1 text-lg font-semibold text-text-1 md:text-xl",children:n}),l&&(0,t.jsx)("button",{onClick:l,className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full text-text-3 transition-all hover:bg-bg-2 hover:text-text-1 focus:outline-none focus:ring-2 focus:ring-accent",title:"Change video","aria-label":"Change video",children:(0,t.jsx)("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),!s&&(0,t.jsx)("div",{className:"border-border/70 mt-4 border-t pt-4 text-sm text-text-3",children:(0,t.jsxs)("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-accent transition hover:text-accent-hover",children:[(0,t.jsx)("span",{children:"Watch on YouTube"}),(0,t.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})})]})]})})});function N(){return(0,t.jsx)("div",{className:"w-full max-w-2xl animate-pulse",children:(0,t.jsxs)("div",{className:"overflow-hidden rounded-2xl border border-border bg-bg-0 shadow-soft",children:[(0,t.jsx)("div",{className:"aspect-video bg-bg-2"}),(0,t.jsxs)("div",{className:"p-5",children:[(0,t.jsx)("div",{className:"mb-2 h-6 w-3/4 rounded bg-bg-2"}),(0,t.jsx)("div",{className:"h-4 w-1/3 rounded bg-bg-2"})]})]})})}var E=e.i(914984),_=e.i(329410),T=e.i(816941);let A=["user-recommendations"];function L({videoId:e,title:r,thumbnailUrl:i,durationSeconds:o,hook:a,suggestedQuestion:s,conversationId:c,position:d}){let f=(0,n.useRouter)(),h=(0,l.useVideoFlowStore)(e=>e.resetVideoFlow),p=(0,l.useVideoFlowStore)(e=>e.setQuestion);return(0,t.jsxs)("button",{onClick:()=>{(0,k.trackEvent)("recommendation_clicked",{conversation_id:c,recommended_video_id:e,recommended_video_title:r,position:d}),(0,k.setAnalysisSource)({source:"recommendation",recommendation_type:"user-recs"===c?"user_level":"per_conversation",recommended_video_id:e,recommendation_position:d}),h(),s&&p(s),f.push(`/new?v=${e}`)},className:"group relative flex w-full gap-3 rounded-xl border border-border/50 bg-bg-2/50 p-3 text-left transition-all duration-200 hover:border-accent/50 hover:bg-accent/[0.06] dark:hover:bg-accent/[0.04] hover:shadow-md hover:shadow-accent/10",children:[(0,t.jsx)("div",{className:"absolute left-0 top-3 bottom-3 w-0 rounded-full bg-accent transition-all duration-200 group-hover:w-[3px]"}),(0,t.jsxs)("div",{className:"relative h-[4.5rem] w-[6rem] flex-shrink-0 overflow-hidden rounded-lg",children:[(0,t.jsx)(S.default,{src:i,alt:"",fill:!0,className:"object-cover",sizes:"96px",unoptimized:!0}),(0,t.jsx)("span",{className:"absolute bottom-1 right-1 rounded bg-black/75 px-1.5 py-0.5 text-xs font-semibold text-white",children:o>0?(0,u.formatDuration)(o):"--:--"})]}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsx)("h4",{className:"line-clamp-2 text-sm font-semibold leading-snug text-text-1 group-hover:text-accent",children:r}),(0,t.jsx)("p",{className:"line-clamp-2 text-[13px] leading-relaxed text-[#4B5563] dark:text-[#D1D5DB]",children:a})]}),(0,t.jsx)("div",{className:"flex flex-shrink-0 items-center transition-all duration-200 group-hover:translate-x-1",children:(0,t.jsx)("svg",{className:"h-4 w-4 text-text-3 group-hover:text-accent",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",clipRule:"evenodd"})})})]})}function D(){return(0,t.jsx)("div",{className:"space-y-2.5",children:[0,1,2].map(e=>(0,t.jsxs)("div",{className:"flex gap-3 rounded-xl border border-border/30 bg-bg-2/30 p-3",children:[(0,t.jsx)("div",{className:"relative h-[4.5rem] w-[6rem] flex-shrink-0 skeleton-shimmer rounded-lg",children:(0,t.jsx)("div",{className:"absolute bottom-1 right-1 h-4 w-10 rounded bg-black/20"})}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col justify-center gap-1.5",children:[(0,t.jsx)("div",{className:"h-3.5 w-4/5 skeleton-shimmer rounded"}),(0,t.jsx)("div",{className:"h-3.5 w-3/5 skeleton-shimmer rounded"}),(0,t.jsx)("div",{className:"h-3 w-full skeleton-shimmer rounded"})]})]},e))})}function I(){let e=(0,i.useRef)(!1),{data:n,isLoading:l}=function(){let{getToken:e,isLoaded:t,isSignedIn:n}=(0,r.useAuth)();return(0,T.useQuery)({queryKey:A,queryFn:async()=>(0,m.getUserRecommendations)(void 0,e),enabled:t&&!!n,staleTime:36e5,retry:1,refetchOnWindowFocus:!1,refetchOnReconnect:!1})}(),o=n?.recommendations,a=n?.source;if((0,i.useEffect)(()=>{!e.current&&o&&o.length>0&&(e.current=!0,(0,k.trackEvent)("user_recommendations_shown",{count:o.length,source:a??"unknown"}))},[o,a]),!l&&(!o||0===o.length))return null;let s="nux"===a?"Trending Videos":"Recommended for You";return(0,t.jsxs)("div",{className:"mt-8 w-full max-w-prose","data-testid":"user-recommendations",children:[(0,t.jsx)("h3",{className:"mb-3 text-sm font-semibold text-text-2",children:s}),l?(0,t.jsx)(D,{}):(0,t.jsx)("div",{className:"space-y-2.5",children:o.slice(0,3).map((e,n)=>(0,t.jsx)(L,{videoId:e.video_id,title:e.title,thumbnailUrl:e.thumbnail_url,videoUrl:e.video_url,durationSeconds:e.duration_seconds,channelTitle:e.channel_title,hook:e.hook,suggestedQuestion:e.suggested_question,conversationId:"user-recs",position:n},e.video_id))})]})}let P=(0,i.memo)(function(){return(0,t.jsxs)("div",{className:"flex flex-col items-center space-y-4 px-4",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"absolute inset-0 animate-pulse rounded-full bg-accent/20 blur-2xl"}),(0,t.jsx)(E.LogoIcon,{className:"relative h-14 w-14 animate-fade-in sm:h-16 sm:w-16"})]}),(0,t.jsxs)("div",{className:"space-y-2 text-center",children:[(0,t.jsx)("h2",{className:"text-2xl font-semibold text-text-1 sm:text-3xl",children:"Ask Your Video"}),(0,t.jsx)("p",{className:"text-sm text-text-2 sm:text-base",children:"Paste any YouTube link and get answers in seconds"})]}),(0,t.jsx)(_.ExtensionCTA,{placement:"empty_state"}),(0,t.jsx)(I,{})]})});var M=e.i(173209),z=e.i(124083);let R=(0,M.create)()((0,z.persist)((0,z.devtools)((e,t)=>({seenHelp:{},markHelpAsSeen:t=>e(e=>({seenHelp:{...e.seenHelp,[t]:!0}})),resetHelp:t=>e(e=>{let{[t]:n,...r}=e.seenHelp;return{seenHelp:r}}),hasSeenHelp:e=>!0===t().seenHelp[e]}),{name:"UIPreferencesStore"}),{name:"ui-preferences-storage",storage:(0,z.createJSONStorage)(()=>localStorage),partialize:e=>({seenHelp:e.seenHelp})}));function O({isOpen:e,onClose:n,children:r,anchorRef:l,placement:o="top"}){let a=(0,i.useRef)(null);return((0,i.useEffect)(()=>
1{if(!e)return;let t=e=>{"Escape"===e.key&&n()},r=e=>{a.current&&!a.current.contains(e.target)&&l.current&&!l.current.contains(e.target)&&n()};return document.addEventListener("keydown",t),document.addEventListener("mousedown",r),()=>{document.removeEventListener("keydown",t),document.removeEventListener("mousedown",r)}},[e,n,l]),(0,i.useEffect)(()=>{if(!e||!a.current||!l.current)return;let t=a.current,n=l.current.getBoundingClientRect(),r=t.getBoundingClientRect(),i=0,s=0;switch(o){case"top":i=n.top-r.height-8,s=n.left+n.width/2-r.width/2;break;case"right":i=n.top+n.height/2-r.height/2,s=n.right+8;break;case"bottom":i=n.bottom+8,s=n.left+n.width/2-r.width/2;break;case"left":i=n.top+n.height/2-r.height/2,s=n.left-r.width-8}s<16&&(s=16),s+r.width>window.innerWidth-16&&(s=window.innerWidth-r.width-16),i<16&&(i=16),i+r.height>window.innerHeight-16&&(i=window.innerHeight-r.height-16),t.style.top=`${i}px`,t.style.left=`${s}px`},[e,o,l]),e)?(0,t.jsx)("div",{ref:a,role:"tooltip","aria-live":"polite",className:"fixed z-50 animate-in fade-in slide-in-from-top-2 duration-200",style:{maxWidth:"min(320px, calc(100vw - 32px))"},children:(0,t.jsx)("div",{className:"rounded-lg border border-gray-200 bg-white shadow-lg",children:r})}):null}function F({onClose:e}){let[n,r]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let e=()=>{r(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let l=n?o.YOUTUBE_HELP.MOBILE_STEPS:o.YOUTUBE_HELP.DESKTOP_STEPS;return(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-start justify-between",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:o.YOUTUBE_HELP.TITLE}),(0,t.jsx)("button",{onClick:e,className:"ml-2 text-gray-400 hover:text-gray-600 transition-colors","aria-label":"Close help",children:(0,t.jsx)("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,t.jsx)("ol",{className:"mb-4 space-y-2 text-sm text-gray-700",children:l.map((e,n)=>(0,t.jsxs)("li",{className:"flex items-start",children:[(0,t.jsx)("span",{className:"mr-2 flex h-5 w-5 flex-shrink-0 items-center justify-center rounded-full bg-blue-100 text-xs font-medium text-blue-600",children:n+1}),(0,t.jsx)("span",{className:"leading-5",children:e})]},n))}),(0,t.jsxs)("div",{className:"mb-4 rounded-md bg-gray-50 p-3",children:[(0,t.jsx)("p",{className:"mb-1.5 text-xs font-medium text-gray-600",children:"Valid formats:"}),(0,t.jsx)("ul",{className:"space-y-1 text-xs text-gray-600",children:o.YOUTUBE_HELP.VALID_FORMATS.map((e,n)=>(0,t.jsxs)("li",{className:"flex items-start",children:[(0,t.jsx)("span",{className:"mr-1.5 text-gray-400",children:"•"}),(0,t.jsx)("code",{className:"font-mono",children:e})]},n))})]}),(0,t.jsx)("button",{onClick:e,className:"w-full rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",children:"Got it"})]})}let B=(0,i.forwardRef)(function({onClick:e,className:n=""},r){return(0,t.jsx)("button",{ref:r,onClick:e,type:"button",className:`group flex h-8 w-8 items-center justify-center rounded-full text-gray-400 hover:bg-gray-100 hover:text-gray-600 transition-all focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1 ${n}`,"aria-label":"How to copy YouTube URLs",title:"How to copy YouTube URLs",children:(0,t.jsx)("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})})}),U=(0,i.memo)(function({videoUrl:e,urlInputRef:n,onUrlChange:r}){let{paste:l,isPasting:a,isSupported:s}=function(){let[e,t]=(0,i.useState)(!1),[n,r]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{r("undefined"!=typeof navigator&&"clipboard"in navigator&&null!=navigator.clipboard&&"readText"in navigator.clipboard)},[]),{paste:(0,i.useCallback)(async()=>
1{if(!n)return null;t(!0);try{return(await navigator.clipboard.readText()).trim()}catch(e){return console.debug("Clipboard access denied:",e),null}finally{t(!1)}},[n]),isPasting:e,isSupported:n}}(),{hasSeenHelp:u,markHelpAsSeen:c}=R(),d=!u(o.YOUTUBE_HELP.STORAGE_KEY),f=(0,i.useRef)(null),[h,p]=(0,i.useState)(!1);(0,i.useEffect)(()=>{if(!d)return;let e=setTimeout(()=>{p(!0)},500);return()=>clearTimeout(e)},[d]);let m=()=>{p(!1),c(o.YOUTUBE_HELP.STORAGE_KEY)},g=async()=>{let e=await l();e&&r(e)};return(0,t.jsxs)("div",{className:"mx-auto w-full max-w-2xl space-y-3",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(E.VideoIcon,{className:"absolute left-3 top-1/2 h-5 w-5 -translate-y-1/2 text-text-3 sm:left-4"}),(0,t.jsx)("input",{id:"url-input",ref:n,type:"text",value:e,onChange:e=>r(e.target.value),placeholder:"Paste a YouTube video URL...",className:"h-12 w-full rounded-2xl border border-border bg-bg-1 pl-11 pr-20 text-base text-text-1 shadow-[0_8px_30px_rgb(0,0,0,0.12)] outline-none transition-all placeholder:text-text-3 hover:shadow-[0_8px_30px_rgb(0,0,0,0.16)] focus:border-accent focus:shadow-[0_8px_30px_rgb(59,130,246,0.25)] focus:ring-2 focus:ring-accent/50 dark:shadow-[0_8px_30px_rgb(0,0,0,0.3)] dark:hover:shadow-[0_8px_30px_rgb(0,0,0,0.4)] dark:focus:shadow-[0_8px_30px_rgb(59,130,246,0.3)] sm:h-14 sm:pl-12 sm:pr-24","aria-label":"YouTube video URL","aria-describedby":"url-hint","data-testid":"video-url-input"}),(0,t.jsx)("div",{className:"absolute -top-10 right-0",children:(0,t.jsx)(B,{ref:f,onClick:()=>{p(!h)},className:"sm:h-9 sm:w-9"})}),s&&!e&&(0,t.jsxs)("button",{onClick:g,disabled:a,className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm font-medium text-accent hover:bg-accent/10 active:bg-accent/20 transition-colors disabled:opacity-50 focus:outline-none focus:ring-2 focus:ring-accent/50","aria-label":"Paste YouTube URL from clipboard","data-testid":"paste-button",children:[(0,t.jsx)(E.ClipboardIcon,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:a?"Pasting...":"Paste"})]})]}),(0,t.jsx)("p",{id:"url-hint",className:"text-center text-xs text-text-3 py-2 sm:py-1",children:"Public videos only"}),(0,t.jsx)(O,{isOpen:h,onClose:m,anchorRef:f,placement:"top",children:(0,t.jsx)(F,{onClose:m})})]})});function H({videoMetadata:e,maxDurationSeconds:n,isSignedIn:r,onAddCredits:i}){let l=e.durationSeconds>n,o=!1===e.isAffordable,a=Math.floor(e.durationSeconds/60),s=Math.floor(n/60);return l?(0,t.jsx)("div",{"data-testid":"video-too-long-banner",className:"rounded-lg border border-red-300 bg-red-50 p-3 dark:border-red-500/40 dark:bg-red-500/10",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)("svg",{className:"h-5 w-5 text-red-600 dark:text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,"aria-hidden":"true",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"})})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"mb-1 text-sm font-semibold text-red-900 dark:text-red-200",children:"Video Too Long"}),(0,t.jsxs)("div",{className:"space-y-0.5 text-xs text-red-900 opacity-80 dark:text-red-200",children:[(0,t.jsxs)("div",{children:["This video is ",a," minutes long. Videos over"," ",s," minutes cannot be analyzed due to AI processing limits."]}),(0,t.jsxs)("div",{className:"mt-1.5 font-medium",children:["Try a shorter video (under ",s," minutes)."]})]})]})]})}):o&&r&&e.shortfallDisplay&&e.userBalanceDisplay?(0,t.jsxs)("div",{"data-testid":"insufficient-credits-banner",className:"rounded-lg border border-yellow-300 bg-yellow-50 p-4 dark:border-yellow-500/40 dark:bg-yellow-500/10",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)("svg",{className:"h-5 w-5 text-yellow-600 dark:text-yellow-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"mb-1 text-sm font-semibold text-yellow-900 dark:text-yellow-200",children:"Insufficient Credits"}),(0,t.jsxs)("div",{className:"space-y-0.5 text-xs text-yellow-700 dark:text-yellow-300/80",children:[(0,t.jsxs)("div",{children:["Your balance:"," ",(0,t.jsx)("span",{className:"font-mono font-semibold text-yellow-900 dark:text-yellow-200",children:e.userBalanceDisplay})]}),(0,t.jsxs)("div",{children:["Need additional:"," ",(0,t.jsx)("span",{className:"font-mono font-semibold text-yellow-900 dark:text-yellow-200",children:e.shortfallDisplay})]})]})]})]}),(0,t.jsx)("button",{onClick:i,className:"mt-3 w-full rounded-lg bg-yellow-500 px-4 py-2 text-sm font-semibold text-gray-900 transition hover:bg-yellow-400",children:"Add Credits"})]}):null}let V=(0,i.memo)(function({videoMetadata:e,flowState:n,isSubmitting:r,isSignedIn:i,onRemoveVideo:l,onAddCredits:a}){let s;return(0,t.jsxs)("div",{className:"w-full space-y-4",children:[(0,t.jsx)(C,{thumbnail:e.thumbnail,title:e.title,videoUrl:e.url,durationSeconds:e.durationSeconds,onRemove:"video-ready"===n?l:void 0}),(0,t.jsx)(H,{videoMetadata:e,maxDurationSeconds:f.videoLimitsConfig.maxDurationSeconds,isSignedIn:i,onAddCredits:()=>{a?a():window.location.href=o.ROUTES.BILLING}}),"processing-question"===n&&r&&(0,t.jsx)("div",{className:"coral-pulse hidden text-xs font-medium sm:text-sm md:block",children:(s=["Analyzing the video...","Understanding the content...","Processing your question...","Thinking..."])[Math.floor(Math.random()*s.length)]||"Analyzing video..."})]})}),q=(0,i.memo)(function({suggestions:e,onSelect:n,label:l="Ideas",disabled:o=!1,maxVisible:a=3,selectedId:s,hasVideoReady:u=!1}){let{isSignedIn:c}=(0,r.useAuth)(),d=(0,v.useAnalytics)(),f=(0,i.useMemo)(()=>e.slice(0,Math.max(a,0)),[e,a]);return 0===f.length?null:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs uppercase tracking-[0.18em] text-text-3",children:[(0,t.jsx)("span",{"aria-hidden":!0,
1children:"✨"}),(0,t.jsx)("span",{children:l})]}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:f.map(e=>{let r=e.id===s;return(0,t.jsxs)("button",{type:"button",disabled:o,onClick:()=>{d.trackEvent("video_prompt_selected",{suggestion_id:e.id,suggestion_label:e.label,has_video_ready:u,user_state:(0,k.getUserAuthState)(c)}),n(e.value)},className:`inline-flex transform items-center gap-1 rounded-full border px-3 py-1 text-sm leading-6 transition-all hover:-translate-y-0.5 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50 disabled:cursor-not-allowed disabled:opacity-60 ${r?"border-accent bg-accent text-white hover:border-accent hover:bg-accent/90":"border-border/40 bg-bg-2/40 text-text-2 hover:border-accent/60 hover:bg-accent/10 hover:text-text-1"}`,title:e.description||e.value,children:[(0,t.jsx)("span",{"aria-hidden":!0,children:e.icon}),(0,t.jsx)("span",{className:"max-w-[14ch] truncate",children:e.label})]},e.id)})})]})}),Y=o.DEFAULT_SEND_ICON,W=(0,i.memo)(function({isSubmitting:e,disabled:n,size:r="md",icon:i=Y,"data-testid":l}){return(0,t.jsxs)("button",{type:"submit",disabled:n,"aria-label":"Send message",title:"Send message",className:`btn-primary group relative flex items-center justify-center rounded-xl transition-transform focus:outline-none focus:ring-2 focus:ring-accent ${"sm"===r?"h-10 w-10":"lg"===r?"h-12 w-12 md:h-14 md:w-14":"h-12 w-12"} ${e?"cursor-progress":""}`,"data-testid":l,children:[(0,t.jsx)("span",{className:"pointer-events-none absolute inset-0 rounded-xl bg-white/15 opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-active:opacity-0 group-disabled:opacity-0","aria-hidden":"true"}),e?(0,t.jsx)(E.SpinnerIcon,{className:"h-5 w-5 animate-spin text-current"}):(0,t.jsx)(t.Fragment,{children:"plane"===i?(0,t.jsx)(E.PaperPlaneIcon,{className:"h-5 w-5 text-current transition-transform duration-150 ease-out group-hover:-translate-y-0.5 group-active:translate-y-0.5"}):(0,t.jsx)(E.UpArrowIcon,{className:"h-5 w-5 text-current transition-transform duration-150 ease-out group-hover:-translate-y-0.5 group-active:translate-y-0.5"})})]})}),$=(0,i.memo)(function({videoMetadata:e,flowState:n,question:r,isSubmitting:i,isVideoTooLong:l,currentConversationId:a,questionInputRef:s,onQuestionChange:u,onSubmit:c,onSuggestionSelect:d}){let f=!1===e.isAffordable,h=i||f||l;return(0,t.jsx)("form",{onSubmit:c,className:"mx-auto w-full max-w-2xl animate-slide-up-fade","data-testid":"question-form",children:(0,t.jsxs)("div",{className:"space-y-2 sm:space-y-3",children:[null===a&&!i&&(0,t.jsx)(q,{suggestions:o.DEFAULT_PROMPT_SUGGESTIONS,onSelect:d,maxVisible:4}),(0,t.jsxs)("div",{className:"glass-input flex items-center gap-2 rounded-2xl border px-3 py-3 shadow-[0_8px_30px_rgb(0,0,0,0.12)] transition-all hover:shadow-[0_8px_30px_rgb(0,0,0,0.16)] focus-within:shadow-[0_8px_30px_rgb(59,130,246,0.25)] dark:shadow-[0_8px_30px_rgb(0,0,0,0.3)] dark:hover:shadow-[0_8px_30px_rgb(0,0,0,0.4)] dark:focus-within:shadow-[0_8px_30px_rgb(59,130,246,0.3)] sm:gap-3 sm:px-5 sm:py-4",children:[(0,t.jsx)("input",{id:"question-input",ref:s,type:"text",value:r,onChange:e=>u(e.target.value),placeholder:l?"Video too long to analyze...":f?"Add credits to continue...":"Ask a question about this video...",title:l?"This video exceeds the maximum length for analysis.":f?"Insufficient credits. Please add credits to continue.":void 0,className:"flex-1 bg-transparent text-base text-text-1 outline-none transition placeholder:text-text-3 disabled:opacity-50",disabled:h,"data-testid":"question-input"}),(0,t.jsx)(W,{isSubmitting:i,disabled:h||!r.trim(),size:"md","data-testid":"submit-button"})]}),"processing-question"===n&&i&&(0,t.jsx)("div",{className:"coral-pulse text-center text-xs font-medium md:hidden",children:o.THINKING_MESSAGES[Math.floor(Math.random()*o.THINKING_MESSAGES.length)]||"Analyzing video..."})]})})});var K=e.i(29744);let Q=(0,i.memo)(function({context:e="video-analysis",onDismiss:n,videoMetadata:r}){let l=(0,v.useAnalytics)(),o=(0,i.useRef)(null),a={"video-analysis":{title:"Sign in to analyze videos",description:"Create a free account to start analyzing YouTube videos with AI-powered insights.",features:["Ask questions about any YouTube video","Get AI-powered answers in seconds","Save and revisit your conversations"]},conversation:{title:"Sign in to continue",description:"Sign in to access your conversations and analyze videos.",features:[]}}[e];return(0,i.useEffect)(()=>
1{if(!n)return;let e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[n]),(0,i.useEffect)(()=>{o.current?.focus()},[]),(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-bg-0/95 backdrop-blur-sm",onClick:n,role:"presentation",children:(0,t.jsx)("div",{className:"w-full max-w-md animate-fade-in",onClick:e=>e.stopPropagation(),children:(0,t.jsxs)("div",{className:"relative overflow-hidden rounded-2xl border border-border bg-bg-0 shadow-soft",role:"dialog","aria-labelledby":"auth-title","aria-describedby":"auth-description",children:[n&&(0,t.jsx)("button",{onClick:n,className:"absolute right-4 top-4 z-10 flex h-8 w-8 items-center justify-center rounded-lg text-text-3 transition hover:bg-bg-1 hover:text-text-1 focus:outline-none focus:ring-2 focus:ring-accent","aria-label":"Dismiss and browse without signing in",title:"Browse without signing in",children:(0,t.jsx)("svg",{className:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),(0,t.jsxs)("div",{className:"border-b border-border bg-gradient-to-br from-accent/5 to-transparent p-6 text-center",children:[(0,t.jsx)("div",{className:"mx-auto mb-3 flex h-14 w-14 items-center justify-center rounded-full bg-accent/10",children:(0,t.jsx)("svg",{className:"h-7 w-7 text-accent",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})})}),(0,t.jsx)("h2",{id:"auth-title",className:"text-2xl font-semibold text-text-1",children:a.title}),(0,t.jsx)("p",{id:"auth-description",className:"mt-2 text-sm text-text-2",children:a.description})]}),a.features.length>0&&(0,t.jsx)("div",{className:"border-b border-border bg-bg-0 px-6 py-5",children:(0,t.jsx)("ul",{className:"space-y-3",children:a.features.map((e,n)=>(0,t.jsxs)("li",{className:"flex items-start gap-3 text-sm text-text-2",children:[(0,t.jsx)("svg",{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-accent",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),(0,t.jsx)("span",{children:e})]},n))})}),(0,t.jsxs)("div",{className:"space-y-3 p-6",children:[(0,t.jsx)(K.default,{href:"/sign-in?redirect=/new",children:(0,t.jsx)("button",{ref:o,onClick:()=>l.trackEvent("auth_button_clicked",{action:"signin",location:"prompt",prompt_context:e,has_video_ready:!!r,video_duration_seconds:r?.durationSeconds}),className:"w-full rounded-xl bg-accent px-4 py-3 text-sm font-semibold text-white transition hover:bg-accent-hover focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2 focus:ring-offset-bg-0","aria-label":"Sign in to your account",children:"Sign In"})}),(0,t.jsx)(K.default,{href:"/sign-up?redirect=/new",children:(0,t.jsx)("button",{onClick:()=>l.trackEvent("auth_button_clicked",{action:"signup",location:"prompt",prompt_context:e,has_video_ready:!!r}),className:"w-full rounded-xl border border-border bg-bg-1 px-4 py-3 text-sm font-semibold text-text-1 transition hover:bg-bg-2 focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2 focus:ring-offset-bg-0","aria-label":"Create a new account",children:"Create Account"})})]}),(0,t.jsxs)("div",{className:"border-t border-border bg-bg-1 px-6 py-4 text-center",children:[(0,t.jsx)("p",{className:"text-xs text-text-3",children:"Free to use. No credit card required."}),n&&(0,t.jsxs)("p",{className:"mt-2 text-xs text-text-3",children:["You can"," ",(0,t.jsx)("button",{onClick:n,className:"text-accent underline-offset-2 hover:underline focus:outline-none focus:underline",children:"browse videos"})," ","without signing in"]})]})]})})})});var G=e.i(814055);function J({required:e,available:n,shortfall:r,onClose:l,onAddCredits:o}){let a=(0,i.useRef)(null),s=(0,i.useRef)(null);return(0,i.useEffect)(()=>{let e=e=>{"Escape"===e.key&&l()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[l]),(0,i.useEffect)(()=>{s.current?.focus()},[]),(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:l,role:"presentation",children:(0,t.jsxs)("div",{ref:a,className:"w-full max-w-md rounded-lg border border-border bg-bg-1 p-6 shadow-xl",role:"dialog","aria-labelledby":"modal-title","aria-describedby":"modal-description",onClick:e=>e.stopPropagation(),"data-testid":"insufficient-balance-modal",children:[(0,t.jsx)("div",{className:"flex justify-center mb-4",children:(0,t.jsx)("div",{className:"rounded-full bg-yellow-500/10 p-3",children:(0,t.jsx)("svg",{className:"h-8 w-8 text-yellow-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})})}),(0,t.jsx)("h2",{id:"modal-title",className:"text-xl font-semibold text-center text-text-1 mb-2",children:"Insufficient Credits"}),(0,t.jsx)("p",{id:"modal-description",className:"text-sm text-text-3 text-center mb-6",children:"You don't have enough credits to analyze this video"}),(0,t.jsxs)("div",{className:"rounded-lg bg-bg-2 p-4 space-y-2 mb-6",children:[(0,t.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,t.jsx)("span",{className:"text-text-3",children:"Video duration:"}),(0,t.jsx)("span",{className:"font-mono text-text-1",children:(0,G.formatDurationHHMMSS)(e)})]}),(0,t.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,t.jsx)("span",{className:"text-text-3",children:"Your balance:"}),(0,t.jsx)("span",{className:"font-mono text-text-1",children:(0,G.formatDurationHHMMSS)(n)})]}),(0,t.jsx)("div",{className:"h-px bg-border my-2"}),(0,t.jsxs)("div",{className:"flex justify-between text-sm font-semibold",children:[(0,t.jsx)("span",{className:"text-yellow-500",children:"Need additional:"}),(0,t.jsx)("span",{className:"font-mono text-yellow-500",children:(0,G.formatDurationHHMMSS)(r)})]})]}),(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsx)("button",{ref:s,onClick:l,className:"flex-1 rounded-lg border border-border bg-bg-2 px-4 py-2.5 text-sm font-medium text-text-2 hover:bg-bg-3 hover:text-text-1 transition focus:outline-none focus:ring-2 focus:ring-accent","aria-label":"Cancel and close dialog",children:"Cancel"}),(0,t.jsx)("button",{onClick:o,className:"flex-1 rounded-lg bg-accent px-4 py-2.5 text-sm font-semibold text-white hover:bg-accent/90 transition focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2","aria-label":"Add credits to your account",children:"Add Credits"})]})]})})}function X({showAuthPrompt:e,showInsufficientBalanceModal:n,insufficientBalanceData:r,onDismissAuthPrompt:i,onCloseInsufficientBalanceModal:l,onAddCredits:o}){return(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsx)(Q,{context:"video-analysis",onDismiss:i}),n&&r&&(0,t.jsx)(J,{required:r.required,available:r.available,shortfall:r.shortfall,onClose:l,onAddCredits:o})]})}function Z(e){let{videoUrl:n,question:r,videoMetadata:i,flowState:l,error:o,videoNotPublicError:a,isSignedIn:s,showAuthPrompt:d,dismissAuthPrompt:h,showInsufficientBalanceModal:p,insufficientBalanceData:m,closeInsufficientBalanceModal:g,navigateToBilling:x,handleUrlChange:v,handleQuestionChange:y,handleRemoveVideo:b,handleSubmit:k,handleSuggestionSelect:w,urlInputRef:j,questionInputRef:S,isSubmitting:N}=e,E=!!i&&i.durationSeconds>f.videoLimitsConfig.maxDurationSeconds;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,t.jsx)("div",{className:"flex-1 overflow-y-auto overscroll-none",children:(0,t.jsx)("div",{className:`flex flex-col items-center px-3 ${"empty"===l?"min-h-full justify-center aurora-bg":"min-h-full justify-center pb-32"}`,children:(0,t.jsxs)("div",{className:"w-full max-w-2xl space-y-6 py-6 sm:space-y-8",children:[o&&!(0,c.isAuthError)(o)&&(0,t.jsx)("div",{className:"rounded-base border border-red-300 dark:border-red-500/40 bg-red-50 dark:bg-red-500/10 p-4 text-sm text-red-900 dark:text-red-200",children:o}),"empty"===l&&(0,t.jsx)(P,{}),"loading-video"===l&&(0,t.jsx)("div",{className:"flex animate-fade-in flex-col items-center gap-6",children:(0,t.jsx)(C,{thumbnail:"",title:"",videoUrl:"",isLoading:!0})}),"video-unavailable"===l&&a&&(0,t.jsx)("div",{className:"flex animate-fade-in flex-col items-center gap-6",children:(0,t.jsx)(C,{thumbnail:(0,u.getYouTubeThumbn
1ail)(a.videoId),title:"",videoUrl:n,onRemove:b,videoNotPublicError:a})}),("video-ready"===l||"processing-question"===l)&&i&&(0,t.jsx)(V,{videoMetadata:i,flowState:l,isSubmitting:N,isSignedIn:s,onRemoveVideo:b,onAddCredits:x})]})})}),(0,t.jsxs)("div",{className:`fixed bottom-0 left-0 right-0 z-10 p-4 pb-safe-bottom sm:p-6 md:p-8 ${s?"md:left-sidebar":"md:left-0"}`,children:[("empty"===l||"video-unavailable"===l)&&(0,t.jsx)(U,{videoUrl:"video-unavailable"===l?"":n,onUrlChange:v,urlInputRef:j}),("video-ready"===l||"processing-question"===l)&&i&&(0,t.jsx)($,{videoMetadata:i,flowState:l,question:r,isSubmitting:N,isVideoTooLong:E,currentConversationId:null,questionInputRef:S,onQuestionChange:y,onSubmit:k,onSuggestionSelect:w})]})]}),(0,t.jsx)(X,{showAuthPrompt:d,showInsufficientBalanceModal:p,insufficientBalanceData:m,onDismissAuthPrompt:h,onCloseInsufficientBalanceModal:g,onAddCredits:x})]})}let ee=(0,i.memo)(function({url:e,metadata:n,isLoading:r,onStartNewChat:i,onDismiss:l,privateVideoError:o}){if(!e)return null;let a=null!=o,s=o?.isPrivate?"This video is private and can't be analyzed.":"This video is unlisted and can't be analyzed.";return(0,t.jsxs)("div",{className:a?"mb-3 animate-slide-up-fade overflow-hidden rounded-xl border border-amber-500/40 bg-bg-0 shadow-soft":"mb-3 animate-slide-up-fade overflow-hidden rounded-xl border border-border bg-bg-0 shadow-soft","data-testid":"youtube-url-prompt",children:[(0,t.jsxs)("div",{className:a?"flex items-center justify-between border-b border-amber-500/20 bg-amber-500/5 px-4 py-2":"flex items-center justify-between border-b border-border/50 bg-bg-1/50 px-4 py-2",children:[(0,t.jsx)("span",{className:a?"text-sm font-medium text-amber-600 dark:text-amber-400":"text-sm font-medium text-text-2",children:a?"Video unavailable":"New video detected"}),(0,t.jsx)("button",{onClick:l,className:"flex h-6 w-6 items-center justify-center rounded-full text-text-3 transition-colors hover:bg-bg-2 hover:text-text-1","aria-label":"Dismiss",children:(0,t.jsx)("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),(0,t.jsxs)("div",{className:"p-3",children:[r?(0,t.jsx)(et,{}):a&&o?(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsxs)("div",{className:"relative h-16 w-28 flex-shrink-0 overflow-hidden rounded-lg bg-bg-2",children:[(0,t.jsx)(S.default,{src:(0,u.getYouTubeThumbnail)(o.videoId),alt:"Private video thumbnail",fill:!0,sizes:"112px",className:"object-cover opacity-50"}),(0,t.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,t.jsx)("svg",{className:"h-8 w-8 text-amber-600 dark:text-amber-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:1.5,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z"})})})]}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col justify-center",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("svg",{className:"h-4 w-4 flex-shrink-0 text-amber-600 dark:text-amber-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",strokeWidth:2,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),(0,t.jsx)("span",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:o.isPrivate?"Private video":"Unlisted video"})]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-amber-600/80 dark:text-amber-400/80",children:s})]})]}):n?(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsxs)("div",{className:"relative h-16 w-28 flex-shrink-0 overflow-hidden rounded-lg bg-bg-2",children:[(0,t.jsx)(S.default,{src:n.thumbnail,alt:n.title,fill:!0,sizes:"112px",className:"object-cover"}),n.durationSeconds>0&&(0,t.jsx)("div",{className:"absolute bottom-1 right-1 rounded bg-black/80 px-1 py-0.5 text-[10px] font-semibold text-white",children:(0,u.formatDuration)(n.durationSeconds)})]}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col justify-between",children:[(0,t.jsx)("h4",{className:"line-clamp-2 text-sm font-medium text-text-1",children:n.title}),(0,t.jsx)("p",{className:"text-xs text-text-3",children:"Start a new chat to analyze this video"})]})]}):(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"h-16 w-28 flex-shrink-0 rounded-lg bg-bg-2"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm text-text-2",children:"YouTube video detected"}),(0,t.jsx)("p",{className:"text-xs text-text-3",children:"Start a new chat to analyze this video"})]})]}),!a&&(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsx)("button",{onClick:i,className:"w-full rounded-lg bg-accent px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-accent-hover focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2",children:"Start new chat"})})]})]})});function et(){return(0,t.jsxs)("div",{className:"flex animate-pulse gap-3",children:[(0,t.jsx)("div",{className:"h-16 w-28 flex-shrink-0 rounded-lg bg-bg-2"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col justify-between",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("div",{className:"h-4 w-full rounded bg-bg-2"}),(0,t.jsx)("div",{className:"h-4 w-2/3 rounded bg-bg-2"})]}
1),(0,t.jsx)("div",{className:"h-3 w-1/2 rounded bg-bg-2"})]})]})}let en=(0,i.memo)(function({question:e,isSubmitting:n,error:r,questionInputRef:i,onQuestionChange:l,onSubmit:o,youtubeUrlPrompt:a,onStartNewChat:s,isLocked:u=!1}){return(0,t.jsx)("div",{className:"fixed bottom-0 left-0 right-0 md:left-sidebar z-10 p-4 pb-safe-bottom sm:p-6 md:p-8",children:(0,t.jsxs)("div",{className:"mx-auto w-full max-w-3xl",children:[a?.isVisible&&(0,t.jsx)(ee,{url:a.url,metadata:a.metadata,isLoading:a.isLoading,onStartNewChat:()=>{a?.url&&s&&s(a.url)},onDismiss:a.onDismiss,privateVideoError:a.privateVideoError}),(0,t.jsx)("form",{onSubmit:o,children:(0,t.jsxs)("div",{className:"space-y-2 sm:space-y-3",children:[(0,t.jsxs)("div",{className:"glass-input flex gap-2 rounded-2xl border p-3 shadow-[0_8px_30px_rgb(0,0,0,0.12)] backdrop-blur-xl transition-all hover:shadow-[0_8px_30px_rgb(0,0,0,0.16)] focus-within:shadow-[0_8px_30px_rgb(59,130,246,0.25)] dark:shadow-[0_8px_30px_rgb(0,0,0,0.3)] dark:hover:shadow-[0_8px_30px_rgb(0,0,0,0.4)] dark:focus-within:shadow-[0_8px_30px_rgb(59,130,246,0.3)] sm:gap-3 sm:p-4",children:[(0,t.jsx)("input",{id:"question-input",ref:i,type:"text",value:e,onChange:e=>l(e.target.value),placeholder:u?"This conversation is locked (shared publicly)":"Ask a follow-up question...",className:"flex-1 bg-transparent text-base font-medium text-text-1 outline-none placeholder:text-text-2 placeholder:opacity-70 disabled:cursor-not-allowed",disabled:n||u,"aria-label":u?"This conversation is locked":"Ask a follow-up question"}),(0,t.jsx)(W,{isSubmitting:n,disabled:n||u||!e.trim(),size:"sm"})]}),(0,t.jsx)("div",{className:"text-center text-xs text-text-3 py-2 sm:py-1",children:"Ask Your Video can make mistakes. Check important info."})]})})]})})});function er(){let e=(0,n.useParams)(),{getToken:o}=(0,r.useAuth)(),h=e.id??null,p=function(e,t){let[n,r]=(0,i.useState)(""),l=(0,i.useRef)(null),o=(0,v.useAnalytics)(),{data:c}=(0,g.useConversation)(e),h=function(e={}){let{getToken:t,debounceDelay:n=f.timeoutConfig.urlDebounce}=e,[r,l]=(0,i.useState)(null),[o,a]=(0,i.useState)(null),[c,h]=(0,i.useState)(!1),[p,m]=(0,i.useState)(null),[g,x]=(0,i.useState)(null),[v,y]=(0,i.useState)(!1),[b,k]=(0,i.useState)(!1),w=(0,i.useRef)(null),j=(0,i.useRef)(null),S=(0,i.useCallback)(async e=>{h(!0),m(null),x(null),w.current?.abort();let n=new AbortController;w.current=n;try{let r=await (0,u.fetchVideoMetadata)(e,n.signal,t);n.signal.aborted||a({url:e,thumbnail:r.thumbnail,title:r.title,durationSeconds:r.durationSeconds,costSeconds:r.costSeconds,costDisplay:r.costDisplay,userBalanceSeconds:r.userBalanceSeconds,userBalanceDisplay:r.userBalanceDisplay,isAffordable:r.isAffordable,shortfallSeconds:r.shortfallSeconds,shortfallDisplay:r.shortfallDisplay})}catch(e){if(e instanceof Error&&"AbortError"===e.name)return;if(e instanceof d.VideoNotPublicError){x(e),a(null);return}m("Could not load video information"),a(null)}finally{w.current===n&&(w.current=null,h(!1))}},[t]),{run:C,cancel:N}=s((0,i.useCallback)(e=>{let t=(0,u.extractYouTubeUrlFromText)(e);if(k((0,u.containsYouTubeUrl)(e)),!t){l(null),a(null),m(null),x(null),y(!1),j.current=null;return}t!==r&&(l(t),a(null),m(null),x(null),t!==j.current?(y(!1),S(t)):y(!0))},[r,S]),n),E=(0,i.useCallback)(e=>{k((0,u.containsYouTubeUrl)(e)),C(e)},[C]),_=(0,i.useCallback)(()=>{y(!0),j.current=r},[r]);(0,i.useEffect)(()=>()=>{N(),w.current?.abort()},[N]);let T=!!(r&&!v&&(!p||g));return{detectedUrl:r,metadata:o,isLoading:c,error:p,privateVideoError:g,checkText:E,dismiss:_,isPromptVisible:T,hasYouTubeUrl:b}}({getToken:t}),p=x({getToken:t,onSuccess:()=>{},onError:e=>{if(e instanceof d.InsufficientBalanceError){c&&o.trackEvent("video_insufficient_balance",{required_seconds:e.required,available_seconds:e.available,shortfall_seconds:e.shortfall,video_duration_seconds:c.duration_seconds,has_subscription:!1,current_plan_code:void 0}),m.openModal({required:e.required,available:e.available,shortfall:e.shortfall});return}console.error("Follow-up question submission failed:",e)}}),m=a(),y=async t=>{t.preventDefault();let i=n.trim();if(i){if(h.hasYouTubeUrl)return void j.toast.error("Cannot include YouTube URLs",{description:"Please remove the YouTube URL or start a new conversation to analyze a different video.",duration:5e3});r("");try{if(c){let t=Date.now(),n=new Date(c.created_at).getTime(),r=c.messages[c.messages.length-1],l=r?new Date(r.created_at).getTime():n;o.trackEvent("video_message_sent",{conversation_id:e,conversation_age_seconds:Math.floor((t-n)/1e3),message_count:c.messages.length,question_length:i.length,time_since_last_message_seconds:Math.floor((t-l)/1e3)})}await p.analyzeVideo(i,null,e)}catch{r(i)}}};return{question:n,questionInputRef:l,isSubmitting:p.isSubmitting,error:null,onQuestionChange:e=>{r(e),h.checkText(e)},onSubmit:y,youtubeUrlPrompt:{isVisible:h.isPromptVisible,url:h.detectedUrl,metadata:h.metadata,isLoading:h.isLoading,onDismiss:h.dism
1iss,privateVideoError:h.privateVideoError},modalProps:{showInsufficientBalanceModal:m.showModal,insufficientBalanceData:m.balanceData,onCloseInsufficientBalanceModal:m.closeModal,onAddCredits:m.navigateToBilling}}}(h??"",o),m=function(){let{getToken:e,isSignedIn:t}=(0,r.useAuth)(),o=(0,n.useRouter)(),h=(0,w.useIsMobile)(),p=(0,v.useAnalytics)(),{flowState:m,videoMetadata:g,error:j,question:S,videoUrl:C,videoNotPublicError:N,setFlowState:E,setVideoMetadata:_,setError:T,setQuestion:A,setVideoUrl:L,setVideoNotPublicError:D,resetVideoFlow:I}=(0,l.useVideoFlowStore)(),[P,M]=(0,i.useState)(!1),z=(0,i.useRef)(null),R=(0,i.useRef)(null),O=(0,i.useRef)(null),F=(0,i.useRef)(!1),{showModal:B,balanceData:U,openModal:H,closeModal:V,navigateToBilling:q}=a(),{fetchMetadata:Y,cleanup:W}=function(e={}){let[t,n]=(0,i.useState)(!1),[r,l]=(0,i.useState)(null),o=(0,i.useRef)(null),a=(0,i.useRef)(!1),h=async t=>{l(null),n(!0),a.current=!0,e.onStart?.(),o.current?.abort();let r=new AbortController;o.current=r;try{let n=await (0,u.fetchVideoMetadata)(t,r.signal,e.getToken);r.signal.aborted||e.onSuccess?.({url:t,thumbnail:n.thumbnail,title:n.title,durationSeconds:n.durationSeconds,costSeconds:n.costSeconds,costDisplay:n.costDisplay,userBalanceSeconds:n.userBalanceSeconds,userBalanceDisplay:n.userBalanceDisplay,isAffordable:n.isAffordable,shortfallSeconds:n.shortfallSeconds,shortfallDisplay:n.shortfallDisplay})}catch(n){if(n instanceof Error&&"AbortError"===n.name)return;if((0,d.isVideoNotPublicError)(n)&&e.onVideoError)return void e.onVideoError(n);let t=(0,c.getFriendlyErrorMessage)(n);l(t),e.onError?.(t)}finally{o.current===r&&(o.current=null,n(!1),a.current=!1)}},{run:p,cancel:m}=s(async t=>{if((0,u.validateVideoUrl)(t))await h((0,u.normalizeVideoUrl)(t));else if(t.length>10){let t="Please enter a valid YouTube video URL";l(t),e.onError?.(t)}},f.timeoutConfig.urlDebounce),g=()=>{a.current||(m(),o.current?.abort(),o.current&&(o.current=null),n(!1),l(null))};return(0,i.useEffect)(()=>()=>{g()},[]),{isLoading:t,error:r,fetchMetadata:p,cleanup:g}}({getToken:e,onStart:()=>{E("loading-video"),D(null)},onSuccess:e=>{_(e),E("video-ready"),D(null);let n=(0,u.extractYouTubeId)(e.url),r=new URLSearchParams(window.location.search).get("v");n&&r!==n&&o.replace(`/new?v=${n}`,{scroll:!1}),p.trackEvent("video_url_submitted",{video_url:e.url,video_duration_seconds:e.durationSeconds,is_affordable:e.isAffordable??!1,user_state:(0,k.getUserAuthState)(t)})},onVideoError:e=>{D(e),E("video-unavailable"),T(null)},onError:e=>{T(e),E("empty"),L("")}}),$=function(e){let{videoMetadata:t,currentConversationId:n,isSignedIn:r,getToken:i,onInsufficientBalance:l,onAuthRequired:o,onFlowStateChange:a,onRestoreQuestion:s}=e,u=(0,v.useAnalytics)(),f=x({getToken:i,onSuccess:()=>{},onError:e=>{e instanceof d.InsufficientBalanceError?(t&&u.trackEvent("video_insufficient_balance",{required_seconds:e.required,available_seconds:e.available,shortfall_seconds:e.shortfall,video_duration_seconds:t.durationSeconds,has_subscription:!1,current_plan_code:void 0}),l({required:e.required,available:e.available,shortfall:e.shortfall})):(0,c.isAuthError)(e)?o():(0,y.shouldShowInlineBanner)(e)||(0,y.notifyError)(e,{title:"Failed to analyze video",addBillingContext:!0})}}),h=async e=>{let i=e.trim();if(!i)return;if(!r){t&&((0,b.savePendingAnalysis)(t.url,i),u.trackEvent("video_analysis_auth_required",{video_url:t.url,video_duration_seconds:t.durationSeconds,question_length:i.length,user_state:"anonymous"})),o();return}let c=null!==n;if(!c&&!t)throw Error("Please select a video first");if(!c&&t&&!1===t.isAffordable){u.trackEvent("video_insufficient_balance",{required_seconds:t.costSeconds,available_seconds:t.userBalanceSeconds??0,shortfall_seconds:t.shortfallSeconds??t.costSeconds,video_duration_seconds:t.durationSeconds,has_subscription:!1,current_plan_code:void 0}),l({required:t.costSeconds,available:t.userBalanceSeconds??0,shortfall:t.shortfallSeconds??t.costSeconds}),s(i);return}c||a("processing-question");try{if(!c&&t){let e=(0,b.isDeferredAuthFlow)(),r=(0,k.consumeAnalysisSource)();u.trackEvent("video_analysis_started",{question_length:i.length,video_url:t.url,video_duration_seconds:t.durationSeconds,is_new_conversation:!n,user_state:"authenticated",is_deferred_auth:e,...r}),e&&(0,b.clearDeferredAuthFlag)()}
1await f.analyzeVideo(i,t,n)}catch(e){throw e instanceof d.InsufficientBalanceError||s(i),c||a("video-ready"),e}};return{isSubmitting:f.isSubmitting,submitQuestion:h,cleanup:f.cleanup}}({videoMetadata:g,currentConversationId:null,isSignedIn:t??!1,getToken:e,onInsufficientBalance:e=>{H(e)},onAuthRequired:()=>{M(!0)},onFlowStateChange:e=>{E(e)},onRestoreQuestion:e=>{A(e)}}),K=(0,i.useCallback)(async e=>{e.preventDefault();let n=S.trim();if(n){t&&A(""),T(null);try{await $.submitQuestion(n)}catch{t&&A(n)}}},[S,t,A,T,$]);(0,i.useEffect)(()=>{C&&"empty"===m&&!g&&Y(C.trim())},[C,m,g,Y]),(0,i.useEffect)(()=>{F.current=!1},[g?.url]),(0,i.useEffect)(()=>{t&&g&&void 0===g.userBalanceSeconds&&!F.current&&(F.current=!0,Y(g.url))},[t,g,Y]),(0,i.useEffect)(()=>{if("video-ready"===m&&R.current&&!h){let e=setTimeout(()=>{R.current?.focus()},f.timeoutConfig.autoFocusDelay);return()=>clearTimeout(e)}},[m,h]);let Q=(0,i.useRef)({videoMetadata:W,videoSubmission:$.cleanup});return(0,i.useEffect)(()=>{Q.current={videoMetadata:W,videoSubmission:$.cleanup}},[W,$.cleanup]),(0,i.useEffect)(()=>()=>{O.current&&clearTimeout(O.current),Q.current.videoMetadata()},[]),{videoUrl:C,question:S,videoMetadata:g,flowState:m,error:j,videoNotPublicError:N,isSignedIn:t??!1,showAuthPrompt:P,dismissAuthPrompt:()=>{M(!1)},showInsufficientBalanceModal:B,insufficientBalanceData:U,closeInsufficientBalanceModal:V,navigateToBilling:q,handleUrlChange:e=>{L(e),T(null),D(null);let t=e.trim();t&&Y(t)},handleQuestionChange:e=>{A(e)},handleRemoveVideo:()=>{g&&p.trackEvent("video_url_removed",{video_url:g.url,video_duration_seconds:g.durationSeconds,user_state:(0,k.getUserAuthState)(t)}),$.cleanup(),M(!1),I(),o.replace("/new",{scroll:!1}),O.current=setTimeout(()=>{z.current?.focus()},100)},handleSubmit:K,handleSuggestionSelect:e=>{A(e),requestAnimationFrame(()=>{R.current?.focus()})},urlInputRef:z,questionInputRef:R,isLoadingMetadata:"loading-video"===m,isSubmitting:$.isSubmitting}}(),{data:S}=(0,g.useConversation)(h);if(h){let{question:e,questionInputRef:n,isSubmitting:r,error:i,onQuestionChange:l,onSubmit:o,youtubeUrlPrompt:a,modalProps:s}=p;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(en,{question:e,questionInputRef:n,isSubmitting:r,error:i,onQuestionChange:l,onSubmit:o,youtubeUrlPrompt:a,isLocked:S?.is_shared??!1}),s.showInsufficientBalanceModal&&s.insufficientBalanceData&&(0,t.jsx)(J,{required:s.insufficientBalanceData.required,available:s.insufficientBalanceData.available,shortfall:s.insufficientBalanceData.shortfall,onClose:s.onCloseInsufficientBalanceModal,onAddCredits:s.onAddCredits})]})}return(0,t.jsx)(Z,{...m})}var ei=e.i(522967),el=e.i(883227);e.i(461474);var eo=e.i(200105);let ea=(0,i.memo)(function({videoUrl:e,videoName:n,summary:r,sticky:l=!0,conversationId:o,conversationStatus:a,isShared:s,shareToken:c,videoDurationSeconds:d}){let[f,h]=(0,i.useState)(!1),[p,m]=(0,i.useState)(null),g=(0,u.extractYouTubeId)(e),x=(0,u.isYouTubeUrl)(e),v=g?(0,u.getYouTubeThumbnail)(g):null,y=(0,u.extractVideoTitle)(e,n),b=(0,u.getDomainFromUrl)(e),k=x?"Open on YouTube":`Open on ${b}`;return(0,i.useEffect)(()=>{g&&!n&&(0,u.fetchYouTubeTitle)(g).then(e=>{e&&m(e)})},[g,n]),(0,t.jsxs)("div",{className:`
2        md:hidden
3        ${l?"sticky top-0 z-10 bg-bg-0 shadow-sm":"bg-bg-0/80 backdrop-blur-sm"}
4      `,children:[(0,t.jsxs)("div",{className:"flex min-h-[58px] items-center gap-3 border-b border-border px-3 py-3 sm:px-4",children:[v&&(0,t.jsx)("button",{onClick:()=>h(!f),className:"relative h-[34px] w-[60px] flex-shrink-0 overflow-hidden rounded border border-border transition-colors hover:border-text-3",title:f?"Collapse video details":"Expand video details","aria-label":f?"Collapse video details":"Expand video details",children:(0,t.jsx)(S.default,{src:v,alt:"Video thumbnail",fill:!0,sizes:"60px",className:"object-cover"})}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-text-1",children:p||y}),"completed"===a&&o&&(0,t.jsx)(eo.default,{conversationId:o,isShared:s??!1,shareUrl:c?`https://askyourvideo.io/s/${c}`:void 0,shareToken:c,videoDurationSeconds:d??0,compact:!0}),(0,t.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-md text-text-2 transition hover:text-accent focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2 focus:ring-offset-bg-0","aria-label":k,title:k,children:(0,t.jsx)("svg",{"aria-hidden":"true",className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})})})]}),f&&v&&(0,t.jsxs)("div",{className:"border-t border-border px-6 pb-4 pt-4",children:[(0,t.jsx)("div",{className:"relative aspect-video w-full max-w-md overflow-hidden rounded-lg border border-border",children:(0,t.jsx)(S.default,{src:v,alt:"Video preview",fill:!0,sizes:"(max-width: 768px) 100vw, 480px",className:"object-cover"})}),(0,t.jsxs)("div",{className:"mt-3 text-xs text-text-3",children:[(0,t.jsx)("span",{className:"font-medium",children:"Full URL:"})," ",(0,t.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline underline-offset-2 hover:text-accent-hover",children:e})]}),r&&(0,t.jsx)("p",{className:"mt-3 text-sm leading-relaxed text-text-2",children:r})]})]})});function es(){}function eu(){}let ec=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ed=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ef={};function eh(e,t){return((t||ef).jsx?ed:ec).test(e)}let ep=/[ \t\n\f\r]/g;function em(e){return""===e.replace(ep,"")}class eg{constructor(e,t){this.attribute=t,this.property=e}}eg.prototype.attribute="",eg.prototype.booleanish=!1,eg.prototype.boolean=!1,eg.prototype.commaOrSpaceSeparated=!1,eg.prototype.commaSeparated=!1,eg.prototype.defined=!1,eg.prototype.mustUseProperty=!1,eg.prototype.number=!1,eg.prototype.overloadedBoolean=!1,eg.prototype.property="",eg.prototype.spaceSeparated=!1,eg.prototype.space=void 0;let ex=0,ev=eC(),ey=eC(),eb=eC(),ek=eC(),ew=eC(),ej=eC(),eS=eC();function eC(){return 2**++ex}e.s(["boolean",0,ev,"booleanish",0,ey,"commaOrSpaceSeparated",0,eS,"commaSeparated",0,ej,"number",0,ek,"overloadedBoolean",0,eb,"spaceSeparated",0,ew],383954);var eN=e.i(383954);
4let eE=Object.keys(eN);class e_ extends eg{constructor(e,t,n,r){let i=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++i<eE.length;){const e=eE[i];!function(e,t,n){n&&(e[t]=n)}(this,eE[i],(n&eN[e])===eN[e])}}}function eT(e){return e.toLowerCase()}e_.prototype.defined=!0;let eA=/[A-Z]/g,eL=/-[a-z]/g,eD=/^data[-\w.:]+$/i;function eI(e){return"-"+e.toLowerCase()}function eP(e){return e.charAt(1).toUpperCase()}let eM={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class ez{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function eR(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ez(n,r,t)}function eO(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let l=new e_(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[eT(r)]=r,n[eT(l.attribute)]=r}return new ez(t,n,e.space)}ez.prototype.normal={},ez.prototype.property={},ez.prototype.space=void 0;let eF=eO({properties:{ariaActiveDescendant:null,ariaAtomic:ey,ariaAutoComplete:null,ariaBusy:ey,ariaChecked:ey,ariaColCount:ek,ariaColIndex:ek,ariaColSpan:ek,ariaControls:ew,ariaCurrent:null,ariaDescribedBy:ew,ariaDetails:null,ariaDisabled:ey,ariaDropEffect:ew,ariaErrorMessage:null,ariaExpanded:ey,ariaFlowTo:ew,ariaGrabbed:ey,ariaHasPopup:null,ariaHidden:ey,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ew,ariaLevel:ek,ariaLive:null,ariaModal:ey,ariaMultiLine:ey,ariaMultiSelectable:ey,ariaOrientation:null,ariaOwns:ew,ariaPlaceholder:null,ariaPosInSet:ek,ariaPressed:ey,ariaReadOnly:ey,ariaRelevant:null,ariaRequired:ey,ariaRoleDescription:ew,ariaRowCount:ek,ariaRowIndex:ek,ariaRowSpan:ek,ariaSelected:ey,ariaSetSize:ek,ariaSort:null,ariaValueMax:ek,ariaValueMin:ek,ariaValueNow:ek,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function eB(e,t){return t in e?e[t]:t}function eU(e,t){return eB(e,t.toLowerCase())}let eH=eO({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ej,acceptCharset:ew,accessKey:ew,action:null,allow:null,allowFullScreen:ev,allowPaymentRequest:ev,allowUserMedia:ev,alt:null,as:null,async:ev,autoCapitalize:null,autoComplete:ew,autoFocus:ev,autoPlay:ev,blocking:ew,capture:null,charSet:null,checked:ev,cite:null,className:ew,cols:ek,colSpan:null,content:null,contentEditable:ey,controls:ev,controlsList:ew,coords:ek|ej,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ev,defer:ev,dir:null,dirName:null,disabled:ev,download:eb,draggable:ey,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ev,formTarget:null,headers:ew,height:ek,hidden:eb,high:ek,href:null,hrefLang:null,htmlFor:ew,httpEquiv:ew,id:null,imageSizes:null,imageSrcSet:null,inert:ev,inputMode:null,integrity:null,is:null,isMap:ev,itemId:null,itemProp:ew,itemRef:ew,itemScope:ev,itemType:ew,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ev,low:ek,manifest:null,max:null,maxLength:ek,media:null,method:null,min:null,minLength:ek,multiple:ev,muted:ev,name:null,nonce:null,noModule:ev,noValidate:ev,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ev,optimum:ek,pattern:null,ping:ew,placeholder:null,playsInl
4ine:ev,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ev,referrerPolicy:null,rel:ew,required:ev,reversed:ev,rows:ek,rowSpan:ek,sandbox:ew,scope:null,scoped:ev,seamless:ev,selected:ev,shadowRootClonable:ev,shadowRootDelegatesFocus:ev,shadowRootMode:null,shape:null,size:ek,sizes:null,slot:null,span:ek,spellCheck:ey,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ek,step:null,style:null,tabIndex:ek,target:null,title:null,translate:null,type:null,typeMustMatch:ev,useMap:null,value:ey,width:ek,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ew,axis:null,background:null,bgColor:null,border:ek,borderColor:null,bottomMargin:ek,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ev,declare:ev,event:null,face:null,frame:null,frameBorder:null,hSpace:ek,leftMargin:ek,link:null,longDesc:null,lowSrc:null,marginHeight:ek,marginWidth:ek,noResize:ev,noHref:ev,noShade:ev,noWrap:ev,object:null,profile:null,prompt:null,rev:null,rightMargin:ek,rules:null,scheme:null,scrolling:ey,standby:null,summary:null,text:null,topMargin:ek,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ek,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ev,disableRemotePlayback:ev,prefix:null,property:null,results:ek,security:null,unselectable:null},space:"html",transform:eU}),eV=eO({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav
4-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:eS,accentHeight:ek,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ek,amplitude:ek,arabicForm:null,ascent:ek,attributeName:null,attributeType:null,azimuth:ek,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ek,by:null,calcMode:null,capHeight:ek,className:ew,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ek,diffuseConstant:ek,direction:null,display:null,dur:null,divisor:ek,dominantBaseline:null,download:ev,dx:null,dy:null,edgeMode:null,editable:null,elevation:ek,enableBackground:null,end:null,event:null,exponent:ek,externalResourcesRequired:null,fill:null,fillOpacity:ek,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ej,g2:ej,glyphName:ej,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ek,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ek,horizOriginX:ek,horizOriginY:ek,id:null,ideographic:ek,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ek,k:ek,k1:ek,k2:ek,k3:ek,k4:ek,kernelMatrix:eS,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ek,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ek,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,on
4Zoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ek,overlineThickness:ek,paintOrder:null,panose1:null,path:null,pathLength:ek,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ew,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ek,pointsAtY:ek,pointsAtZ:ek,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:eS,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:eS,rev:eS,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:eS,requiredFeatures:eS,requiredFonts:eS,requiredFormats:eS,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ek,specularExponent:ek,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ek,strikethroughThickness:ek,string:null,stroke:null,strokeDashArray:eS,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ek,strokeOpacity:ek,strokeWidth:null,style:null,surfaceScale:ek,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:eS,tabIndex:ek,tableValues:null,target:null,targetX:ek,targetY:ek,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:eS,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ek,underlineThickness:ek,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ek,values:null,vAlphabetic:ek,vMathematical:ek,vectorEffect:null,vHanging:ek,vIdeographic:ek,version:null,vertAdvY:ek,vertOriginX:ek,vertOriginY:ek,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ek,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:eB}),eq=eO({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),eY=eO({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:eU}),eW=eO({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),e$=eR([eF,eH,eq,eY,eW],"html"),eK=eR([eF,eV,eq,eY,eW],"svg");var eQ=e.i(763185);let eG=eX("end"),eJ=eX("start");function eX(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function eZ(e){return e&&"object"==typeof e?"position"in e||"type"in e?e1(e.position):"start"in e||"end"in e?e1(e):"line"in e||"column"in e?e0(e):"":""}function e0(e){return e2(e&&e.line)+":"+e2(e&&e.column)}function e1(e){return e0(e&&e.start)+"-"+e0(e&&e.end)}function e2(e){return e&&"number"==typeof e?e:1}class e3 extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},l=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(l=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=o?o.line:void 0,this.name=eZ(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=l&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}e3.prototype.file="",e3.prototype.name="",e3.prototype.reason="",e3.prototype.message="",e3.prototype.stack="",e3.prototype.column=void 0,e3.prototype.line=void 0,e3.prototype.ancestors=void 0,e3.prototype.cause=void 0,e3.prototype.fatal=void 0,e3.prototype.place=void 0,e3.prototype.ruleId=void 0,e3.prototype.source=void 0;let e4={}.hasOwnProperty,e5=new Map,e6=/[A-Z]/g,e9=new Set(["table","tbody","thead","tfoot","tr"]),e7=new Set(["td","th"]),e8="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function te(e,t,n){var r,i,l,o,a,s,u,c,d;let f,h,p,m,g,x,v,y,b,k,w;return"element"===t.type?(r=e,i=t,l=n,h=f=r.schema,"svg"===i.tagName.toLowerCase()&&"html"===f.space&&(r.schema=eK),r.ancestors.push(i),p=ti(r,
4i.tagName,!1),m=function(e,t){let n,r,i={};for(r in t.properties)if("children"!==r&&e4.call(t.properties,r)){let l=function(e,t,n){let r=function(e,t){let n=eT(t),r=t,i=eg;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&eD.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(eL,eP);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!eL.test(e)){let n=e.replace(eA,eI);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=e_}return new i(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var i;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(i=n)[i.length-1]?[...i,""]:i).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,eQ.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new e3("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=e8+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)e4.call(e,t)&&(n[function(e){let t=e.replace(e6,to);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?eM[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(l){let[r,o]=l;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof o&&e7.has(t.tagName)?n=o:i[r]=o}}return n&&((i.style||(i.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),i}(r,i),g=tr(r,i),e9.has(i.tagName)&&(g=g.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&em(e.value):em(e))})),tt(r,m,p,i),tn(m,g),r.ancestors.pop(),r.schema=f,r.create(i,p,m,l)):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return es("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}tl(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?(o=e,a=t,s=n,v=x=o.schema,"svg"===a.name&&"html"===x.space&&(o.schema=eK),o.ancestors.push(a),y=null===a.name?o.Fragment:ti(o,a.name,!0),b=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];es("ExpressionStatement"===t.type);let i=t.expression;es("ObjectExpression"===i.type);let l=i.properties[0];es("SpreadElement"===l.type),Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else tl(e,t.position);else{let i,l=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];es("ExpressionStatement"===t.type),i=e.evaluater.evaluateExpression(t.expression)}else tl(e,t.position);else i=null===r.value||r.value;n[l]=i}return n}(o,a),k=tr(o,a),tt(o,b,y,a),tn(b,k),o.ancestors.pop(),o.schema=x,o.create(a,y,b,s)):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tl(e,t.position)}(e,t):"root"===t.type?(u=e,c=t,d=n,tn(w={},tr(u,c)),u.create(c,u.Fragment,w,d)):"text"===t.type?t.value:void 0}function tt(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function tn(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function tr(e,t){let n=[],r=-1,i=e.passKeys?new Map:e5;for(;++r<t.children.length;){let l,o=t.children[r];if(e.passKeys){let e="element"===o.type?o.tagName:"mdxJsxFlowElement"===o.type||"mdxJsxTextElement"===o.type?o.name:void 0;if(e){let t=i.get(e)||0;l=e+"-"+t,i.set(e,t+1)}}let a=te(e,o,l);void 0!==a&&n.push(a)}return n}function ti(e,t,n){let r;if(n)if(t.includes(".")){let e,n=t.split("."),i=-1;for(;++i<n.length;){let t=eh(n[i])?{type:"Identifier",name:n[i]}:{type:"Literal",value:n[i]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(i&&"Literal"===t.type),optional:!1}:t}es(e,"always a result"),r=e}else r=eh(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return e4.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);tl(e)}function tl(e,t){let n=new e3("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=e8+"#cannot-handle-mdx-estrees-without-createevaluater",n}function to(e){return"-"+e.toLowerCase()}let ta={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},ts={};function tu(e,t){let n=t||ts;return tc(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}
4function tc(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return td(e.children,t,n)}return Array.isArray(e)?td(e,t,n):""}function td(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=tc(e[i],t,n);return r.join("")}function tf(e,t,n,r){let i,l=e.length,o=0;if(t=t<0?-t>l?0:l+t:t>l?l:t,n=n>0?n:0,r.length<1e4)(i=Array.from(r)).unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);o<r.length;)(i=r.slice(o,o+1e4)).unshift(t,0),e.splice(...i),o+=1e4,t+=1e4}function th(e,t){return e.length>0?(tf(e,e.length,0,t),e):t}let tp={}.hasOwnProperty;function tm(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,i=(tp.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];if(l)for(r in l){tp.call(i,r)||(i[r]=[]);let e=l[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);tf(e,0,0,r)}(i[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}let tg=t_(/[A-Za-z]/),tx=t_(/[\dA-Za-z]/),tv=t_(/[#-'*+\--9=?A-Z^-~]/);function ty(e){return null!==e&&(e<32||127===e)}let tb=t_(/\d/),tk=t_(/[\dA-Fa-f]/),tw=t_(/[!-/:-@[-`{-~]/);function tj(e){return null!==e&&e<-2}function tS(e){return null!==e&&(e<0||32===e)}function tC(e){return -2===e||-1===e||32===e}let tN=t_(/\p{P}|\p{S}/u),tE=t_(/\s/);function t_(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function tT(e,t,n,r){let i=r?r-1:1/0,l=0;return function(r){return tC(r)?(e.enter(n),function r(o){return tC(o)&&l++<i?(e.consume(o),r):(e.exit(n),t(o))}(r)):t(r)}}let tA={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),tT(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let i=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=i),t=i,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return tj(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},tL={tokenize:function(e){let t,n,r,i=this,l=[],o=0;return a;function a(t){if(o<l.length){let n=l[o];return i.containerState=n[1],e.attempt(n[0].continuation,s,u)(t)}return u(t)}function s(e){if(o++,i.containerState._closeFlow){let n;i.containerState._closeFlow=void 0,t&&x();let r=i.events.length,l=r;for(;l--;)if("exit"===i.events[l][0]&&"chunkFlow"===i.events[l][1].type){n=i.events[l][1].end;break}g(o);let a=r;for(;a<i.events.length;)i.events[a][1].end={...n},a++;return tf(i.events,l+1,0,i.events.slice(r)),i.events.length=a,u(e)}return a(e)}function u(n){if(o===l.length){if(!t)return f(n);if(t.currentConstruct&&t.currentConstruct.concrete)return p(n);i.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(tD,c,d)(n)}function c(e){return t&&x(),g(o),f(e)}function d(e){return i.parser.lazy[i.now().line]=o!==l.length,r=i.now().offset,p(e)}function f(t){return i.containerState={},e.attempt(tD,h,p)(t)}function h(e){return o++,l.push([i.currentConstruct,i.containerState]),f(e)}function p(r){if(null===r){t&&x(),g(0),e.consume(r);return}return t=t||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){m(e.exit("chunkFlow"),!0),g(0),e.consume(n);return}return tj(n)?(e.consume(n),m(e.exit("chunkFlow")),o=0,i.interrupt=void 0,a):(e.consume(n),t)}(r)}function m(e,l){let a=i.sliceStream(e);if(l&&a.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(a),i.parser.lazy[e.start.line]){let e,n,l=t.events.length;for(;l--;)if(t.events[l][1].start.offset<r&&(!t.events[l][1].end||t.events[l][1].end.offset>r))return;let a=i.events.length,s=a;for(;s--;)if("exit"===i.events[s][0]&&"chunkFlow"===i.events[s][1].type){if(e){n=i.events[s][1].end;break}e=!0}for(g(o),l=a;l<i.events.length;)i.events[l][1].end={...n},l++;tf(i.events,s+1,0,i.events.slice(a)),i.events.length=l}}function g(t){let n=l.length;for(;n-- >t;){let t=l[n];i.containerState=t[1],t[0].exit.call(i,e)}l.length=t}function x(){t.write([null]),n=void 0,t=void 0,i.containerState._closeFlow=void 0}}},tD={tokenize:function(e,t,n){return tT(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},tI={partial:!0,tokenize:function(e,t,n){return function(t){return tC(t)?tT(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||tj(e)?t(e):n(e)}}};class tP{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&tM(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),tM(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tM(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);tM(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);tM(this.left,t.reverse())}}}function tM(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function tz(e){let t,n,r,i,l,o,a,s={},u=-1,c=new tP(e);for(;++u<c.length;){for(;u in s;)u=s[u];if(t=c.get(u),u&&"chunkFlow"===t[1].type&&"listItemPrefix"===c.get(u-1)[1].type&&((r=0)<(o=t[1]._tokenizer.events).length&&"lineEndingBlank"===o[r][1].type&&(r+=2),r<o.length&&"content"===o[r][1].type))for(;++r<o.length&&"content"!==o[r][1].type;)"chunkText"===o[r][1].type&&(o[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(s,function(e,t){let n,r,i=e.get(t)[1],l=e.get(t)[2],o=t-1,a=[],s=i._tokenizer;!s&&(s=l.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(s._c
4ontentTypeTextTrailing=!0));let u=s.events,c=[],d={},f=-1,h=i,p=0,m=0,g=[0];for(;h;){for(;e.get(++o)[1]!==h;);a.push(o),!h._tokenizer&&(n=l.sliceStream(h),h.next||n.push(null),r&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(n),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),r=h,h=h.next}for(h=i;++f<u.length;)"exit"===u[f][0]&&"enter"===u[f-1][0]&&u[f][1].type===u[f-1][1].type&&u[f][1].start.line!==u[f][1].end.line&&(m=f+1,g.push(m),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):g.pop(),f=g.length;f--;){let t=u.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)d[p+c[f][0]]=p+c[f][1],p+=c[f][1]-c[f][0]-1;return d}(c,u)),u=s[u],a=!0);else if(t[1]._container){for(r=u,n=void 0;r--;)if("lineEnding"===(i=c.get(r))[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(n&&(c.get(n)[1].type="lineEndingBlank"),i[1].type="lineEnding",n=r);else if("linePrefix"===i[1].type||"listItemIndent"===i[1].type);else break;n&&(t[1].end={...c.get(n)[1].start},(l=c.slice(n,u)).unshift(t),c.splice(n,u-n+1,l))}}return tf(e,0,1/0,c.slice(0)),!a}let tR={resolve:function(e){return tz(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):tj(t)?e.check(tO,l,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function l(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},tO={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),tT(e,i,"linePrefix")};function i(i){if(null===i||tj(i))return n(i);let l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}},tF={tokenize:function(e){let t=this,n=e.attempt(tI,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,tT(e,e.attempt(this.parser.constructs.flow,r,e.attempt(tR,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},tB={resolveAll:tq()},tU=tV("string"),tH=tV("text");function tV(e){return{resolveAll:tq("text"===e?tY:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,l,o);return l;function l(e){return s(e)?i(e):o(e)}function o(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),a)}function a(e){return s(e)?(t.exit("data"),i(e)):(t.consume(e),a)}function s(e){if(null===e)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function tq(e){return function(t,n){let r,i=-1;for(;++i<=t.length;)void 0===r?t[i]&&"data"===t[i][1].type&&(r=i,i++):t[i]&&"data"===t[i][1].type||(i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),i=r+2),r=void 0);return e?e(t,n):t}}function tY(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,i=e[n-1][1],l=t.sliceStream(i),o=l.length,a=-1,s=0;for(;o--;){let e=l[o];if("string"==typeof e){for(a=e.length;32===e.charCodeAt(a-1);)s++,a--;if(a)break;a=-1}else if(-2===e)r=!0,s++;else if(-1===e);else{o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let l={type:n===e.length||r||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:i.start._bufferIndex+a,_index:i.start._index+o,line:i.end.line,column:i.end.column-s,offset:i.end.offset-s},end:{...i.end}};i.end={...l.start},i.start.offset===i.end.offset?Object.assign(i,l):(e.splice(n,0,["enter",l,t],["exit",l,t]),n+=2)}n++}return e}function tW(e){return null===e||tS(e)||tE(e)?1:tN(e)?2:void 0}function t$(e,t,n){let r=[],i=-1;for(;++i<e.length;){let l=e[i].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}let tK={name:"attention",resolveAll:function(e,t){let n,r,i,l,o,a,s,u,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close){for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[
4n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;a=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;let d={...e[n][1].end},f={...e[c][1].start};tQ(d,-a),tQ(f,a),l={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},o={type:a>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:f},i={type:a>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:a>1?"strong":"emphasis",start:{...l.start},end:{...o.end}},e[n][1].end={...l.start},e[c][1].start={...o.end},s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=th(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=th(s,[["enter",r,t],["enter",l,t],["exit",l,t],["enter",i,t]]),s=th(s,t$(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),s=th(s,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(u=2,s=th(s,[["enter",e[c][1],t],["exit",e[c][1],t]])):u=0,tf(e,n-1,c-n+3,s),c=n+s.length-u-2;break}}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,i=this.previous,l=tW(i);return function(o){return n=o,e.enter("attentionSequence"),function o(a){if(a===n)return e.consume(a),o;let s=e.exit("attentionSequence"),u=tW(a),c=!u||2===u&&l||r.includes(a),d=!l||2===l&&u||r.includes(i);return s._open=!!(42===n?c:c&&(l||!d)),s._close=!!(42===n?d:d&&(u||!c)),t(a)}(o)}}};function tQ(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let tG={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return tC(t)?tT(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):i(t)};function i(r){return e.attempt(tG,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return tC(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},tJ={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return tw(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},tX=document.createElement("i");function tZ(e){let t="&"+e+";";tX.innerHTML=t;let n=tX.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let t0={name:"characterReference",tokenize:function(e,t,n){let r,i,l=this,o=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),a};function a(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),r=31,i=tx,u(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,i=tk,u):(e.enter("characterReferenceValue"),r=7,i=tb,u(t))}function u(a){if(59===a&&o){let r=e.exit("characterReferenceValue");return i!==tx||tZ(l.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(a),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(a)}return i(a)&&o++<r?(e.consume(a),u):n(a)}}},t1={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},t2={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,i=this,l={partial:!0,tokenize:function(e,t,n){let l=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};
4function o(t){return e.enter("codeFencedFence"),tC(t)?tT(e,s,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):s(t)}function s(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(i){return i===r?(l++,e.consume(i),t):l>=a?(e.exit("codeFencedFenceSequence"),tC(i)?tT(e,u,"whitespace")(i):u(i)):n(i)}(t)):n(t)}function u(r){return null===r||tj(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},o=0,a=0;return function(t){var l;let u;return l=t,o=(u=i.events[i.events.length-1])&&"linePrefix"===u[1].type?u[2].sliceSerialize(u[1],!0).length:0,r=l,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(i){return i===r?(a++,e.consume(i),t):a<3?n(i):(e.exit("codeFencedFenceSequence"),tC(i)?tT(e,s,"whitespace")(i):s(i))}(l)};function s(l){return null===l||tj(l)?(e.exit("codeFencedFence"),i.interrupt?t(l):e.check(t1,c,p)(l)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||tj(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),s(i)):tC(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tT(e,u,"whitespace")(i)):96===i&&i===r?n(i):(e.consume(i),t)}(l))}function u(t){return null===t||tj(t)?s(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||tj(i)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),s(i)):96===i&&i===r?n(i):(e.consume(i),t)}(t))}function c(t){return e.attempt(l,p,d)(t)}function d(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),f}function f(t){return o>0&&tC(t)?tT(e,h,"linePrefix",o+1)(t):h(t)}function h(t){return null===t||tj(t)?e.check(t1,c,p)(t):(e.enter("codeFlowValue"),function t(n){return null===n||tj(n)?(e.exit("codeFlowValue"),h(n)):(e.consume(n),t)}(t))}function p(n){return e.exit("codeFenced"),t(n)}}},t3={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),tT(e,i,"linePrefix",5)(t)};function i(t){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?function t(n){return null===n?l(n):tj(n)?e.attempt(t4,t,l)(n):(e.enter("codeFlowValue"),function n(r){return null===r||tj(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function l(n){return e.exit("codeIndented"),t(n)}}},t4={partial:!0,tokenize:function(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):tj(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):tT(e,l,"linePrefix",5)(t)}function l(e){let l=r.events[r.events.length-1];return l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?t(e):tj(e)?i(e):n(e)}}};function t5(e,t,n,r,i,l,o,a,s){let u=s||1/0,c=0;return function(t){return 60===t?(e.enter(r),e.enter(i),e.enter(l),e.consume(t),e.exit(l),d):null===t||32===t||41===t||ty(t)?n(t):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),p(t))};function d(n){return 62===n?(e.enter(l),e.consume(n),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(n))}function f(t){return 62===t?(e.exit("chunkString"),e.exit(a),d(t)):null===t||60===t||tj(t)?n(t):(e.consume(t),92===t?h:f)}function h(t){return 60===t||62===t||92===t?(e.consume(t),f):f(t)}function p(i){return!c&&(null===i||41===i||tS(i))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(i)):c<u&&40===i?(e.consume(i),c++,p):41===i?(e.consume(i),c--,p):null===i||32===i||40===i||t
vendor: 7,518 bytes, line 4
4y(i)?n(i):(e.consume(i),92===i?m:p)}function m(t){return 40===t||41===t||92===t?(e.consume(t),p):p(t)}}function t6(e,t,n,r,i,l){let o,a=this,s=0;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(l),u};function u(d){return s>999||null===d||91===d||93===d&&!o||94===d&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):93===d?(e.exit(l),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):tj(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(t){return null===t||91===t||93===t||tj(t)||s++>999?(e.exit("chunkString"),u(t)):(e.consume(t),o||(o=!tC(t)),92===t?d:c)}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}}function t9(e,t,n,r,i,l){let o;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=40===t?41:t,a):n(t)};function a(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(l),s(n))}function s(t){return t===o?(e.exit(l),a(o)):null===t?n(t):tj(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),tT(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(t))}function u(t){return t===o||null===t||tj(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?c:u)}function c(t){return t===o||92===t?(e.consume(t),u):u(t)}}function t7(e,t){let n;return function r(i){return tj(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):tC(i)?tT(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function t8(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let ne={partial:!0,tokenize:function(e,t,n){return function(t){return tS(t)?t7(e,r)(t):n(t)};function r(t){return t9(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return tC(t)?tT(e,l,"whitespace")(t):l(t)}function l(e){return null===e||tj(e)?t(e):n(e)}}},nt=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],nn=["pre","script","style","textarea"],nr={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(tI,t,n)}}},ni={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return tj(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},nl={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&tf(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,i,l,o=e.length,a=0;for(;o--;)if(n=e[o][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[o][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(i){if("enter"===e[o][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=o,"labelLink"!==n.type)){a=2;break}}else"labelEnd"===n.type&&(i=o);let s={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[r][1].start},end:{...e[i][1].end}},c={type:"labelText",start:{...e[r+a+2][1].end},end:{...e[i-2][1].start}};return l=th(l=[["enter",s,t],["enter",u,t]],e.slice(r+1,r+a+3)),l=th(l,[["enter",c,t]]),l=th(l,t$(t.parser.constructs.insideSpan.null,e.slice(r+a+4,i-3),t)),l=th(l,[["exit",c,t],e[i-2],e[i-1],["exit",u,t]]),l=th(l,e.slice(i+1)),l=th(l,[["exit",s,t]]),tf(e,r,e.length,l),e},tokenize:function(e,t,n){let r,i,l=this,o=l.events.length;for(;o--;)if(("labelImage"===l.events[o][1].type||"labelLink"===l.events[o][1].type)&&!l.events[o][1]._balanced){r=l.events[o][1];break}return function(t){return r?r._inactive?c(t):(i=l.parser.defined.includes(t8(l.sliceSerialize({start:r.end,end:l.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),a):n(t)};function a(t){return 40===t?e.attempt(no,u,i?u:c)(t):91===t?e.attempt(na,u,i?s:c)(t):i?u(t):c(t)}function s(t){return e.attempt(ns,u,c)(t)}function u(e){return t(e)}function c(e){return r._balanced=!0,n(e)}}},no={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return tS(t)?t7(e,i)(t):i(t)}function i(t){return 41===t?u(t):t5(e,l,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function l(t){return tS(t)?t7(e,a)(t):u(t)}function o(e){return n(e)}function a(t){return 34===t||39===t||40===t?t9(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):u(t)}function s(t){return tS(t)?t7(e,u)(t):u(t)}function u(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},na={tokenize:function(e,t,n){let r=this;return function(t){return t6.call(r,e,i,l,"reference","referenceMarker","referenceString")(t)};function i(e){return r.parser.defined.includes(t8(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function l(e){return n(e)}}},ns={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},nu={name:"labelStartImage",resolveAll:nl.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),i};function i(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),l):n(t)}function l(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},nc={name:"labelStartLink",resolveAll:nl.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),i};function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},nd={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),tT(e,t,"linePrefix")}}},nf={name:"thematicBreak",tokenize:function(e,t,n){let r,i=0;return function(l){var o;return e.enter("thematicBreak"),r=o=l,function l(o){return o===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),i++,t):(e.exit("thematicBreakSequence"),tC(n)?tT(e,l,"whitespace")(n):l(n))}(o)):i>=3&&(null===o||tj(o))?(e.exit("thematicBreak"),t(o)):n(o)}(o)}}},nh={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(tI,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,tT(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!tC(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine
4=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(nm,t,i)(n))});function i(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,tT(e,e.attempt(nh,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,i=r.events[r.events.length-1],l=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,o=0;return function(t){let i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:tb(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(nf,n,a)(t):a(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(i){return tb(i)&&++o<10?(e.consume(i),t):(!r.interrupt||o<2)&&(r.containerState.marker?i===r.containerState.marker:41===i||46===i)?(e.exit("listItemValue"),a(i)):n(i)}(t)}return n(t)};function a(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(tI,r.interrupt?n:s,e.attempt(np,c,u))}
4function s(e){return r.containerState.initialBlankLine=!0,l++,c(e)}function u(t){return tC(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),c):n(t)}function c(n){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},np={partial:!0,tokenize:function(e,t,n){let r=this;return tT(e,function(e){let i=r.events[r.events.length-1];return!tC(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},nm={partial:!0,tokenize:function(e,t,n){let r=this;return tT(e,function(e){let i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},ng={name:"setextUnderline",resolveTo:function(e,t){let n,r,i,l=e.length;for(;l--;)if("enter"===e[l][0]){if("content"===e[l][1].type){n=l;break}"paragraph"===e[l][1].type&&(r=l)}else"content"===e[l][1].type&&e.splice(l,1),i||"definition"!==e[l][1].type||(i=l);let o={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",o,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=o,e.push(["exit",o,t]),e},tokenize:function(e,t,n){let r,i=this;return function(t){var o;let a,s=i.events.length;for(;s--;)if("lineEnding"!==i.events[s][1].type&&"linePrefix"!==i.events[s][1].type&&"content"!==i.events[s][1].type){a="paragraph"===i.events[s][1].type;break}return!i.parser.lazy[i.now().line]&&(i.interrupt||a)?(e.enter("setextHeadingLine"),r=t,o=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),tC(n)?tT(e,l,"lineSuffix")(n):l(n))}(o)):n(t)};function l(r){return null===r||tj(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,i=this;return function(t){var r;return e.enter("definition"),r=t,t6.call(i,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function l(t){return(r=t8(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o):n(t)}function o(t){return tS(t)?t7(e,a)(t):a(t)}function a(t){return t5(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(ne,u,u)(t)}function u(t){return tC(t)?tT(e,c,"whitespace")(t):c(t)}function c(l){return null===l||tj(l)?(e.exit("definition"),i.parser.defined.push(r),t(l)):n(l)}}}},"disable",0,{null:[]},"document",0,{42:nh,43:nh,45:nh,48:nh,49:nh,50:nh,51:nh,52:nh,53:nh,54:nh,55:nh,56:nh,57:nh,62:tG},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,i=e.length-2,l=3;return"whitespace"===e[3][1].type&&(l+=2),i-2>l&&"whitespace"===e[i][1].type&&(i-=2),"atxHeadingSequence"===e[i][1].type&&(l===i-1||i-4>l&&"whitespace"===e[i-2][1].type)&&(i-=l+1===i?2:4),i>l&&(n={type:"atxHeadingText",start:e[l][1].start,end:e[i][1].end},r={type:"chunkText",start:e[l][1].start,end:e[i][1].end,contentType:"text"},tf(e,l,i-l+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(i){var l;return e.enter("atxHeading"),l=i,e.enter("atxHeadingSequence"),function i(l){return 35===l&&r++<6?(e.consume(l),i):null===l||tS(l)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||tj(r)?(e.exit("atxHeading"),t(r)):tC(r)?tT(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||tS(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(l)):n(l)}(l)}}},42:nf,45:[ng,nf],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,i,l,o,a,s=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),u};function u(o){return 33===o?(e.consume(o),c):47===o?(e.consume(o),i=!0,h):63===o?(e.consume(o),r=3,s.interrupt?t:D):tg(o)?(e.consume(o),l=String.fromCharCode(o),p):n(o)}function c(i){return 45===i?(e.consume(i),r=2,d):91===i?(e.consume(i),r=5,o=0,f):tg(i)?(e.consume(i),r=4,s.interrupt?t:D):n(i)}function d(r){return 45===r?(e.consume(r),s.interrupt?t:D):n(r)}function f(r){let i="CDATA[";return r===i.charCodeAt(o++)?(e.consume(r),o===i.length)?s.interrupt?t:S:f:n(r)}function h(t){return tg(t)?(e.consume(t),l=String.fromCharCode(t),p):n(t)}
4function p(o){if(null===o||47===o||62===o||tS(o)){let a=47===o,u=l.toLowerCase();return!a&&!i&&nn.includes(u)?(r=1,s.interrupt?t(o):S(o)):nt.includes(l.toLowerCase())?(r=6,a)?(e.consume(o),m):s.interrupt?t(o):S(o):(r=7,s.interrupt&&!s.parser.lazy[s.now().line]?n(o):i?function t(n){return tC(n)?(e.consume(n),t):w(n)}(o):g(o))}return 45===o||tx(o)?(e.consume(o),l+=String.fromCharCode(o),p):n(o)}function m(r){return 62===r?(e.consume(r),s.interrupt?t:S):n(r)}function g(t){return 47===t?(e.consume(t),w):58===t||95===t||tg(t)?(e.consume(t),x):tC(t)?(e.consume(t),g):w(t)}function x(t){return 45===t||46===t||58===t||95===t||tx(t)?(e.consume(t),x):v(t)}function v(t){return 61===t?(e.consume(t),y):tC(t)?(e.consume(t),v):g(t)}function y(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),a=t,b):tC(t)?(e.consume(t),y):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||tS(n)?v(n):(e.consume(n),t)}(t)}function b(t){return t===a?(e.consume(t),a=null,k):null===t||tj(t)?n(t):(e.consume(t),b)}function k(e){return 47===e||62===e||tC(e)?g(e):n(e)}function w(t){return 62===t?(e.consume(t),j):n(t)}function j(t){return null===t||tj(t)?S(t):tC(t)?(e.consume(t),j):n(t)}function S(t){return 45===t&&2===r?(e.consume(t),_):60===t&&1===r?(e.consume(t),T):62===t&&4===r?(e.consume(t),I):63===t&&3===r?(e.consume(t),D):93===t&&5===r?(e.consume(t),L):tj(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(nr,P,C)(t)):null===t||tj(t)?(e.exit("htmlFlowData"),C(t)):(e.consume(t),S)}function C(t){return e.check(ni,N,P)(t)}function N(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),E}function E(t){return null===t||tj(t)?C(t):(e.enter("htmlFlowData"),S(t))}function _(t){return 45===t?(e.consume(t),D):S(t)}function T(t){return 47===t?(e.consume(t),l="",A):S(t)}function A(t){if(62===t){let n=l.toLowerCase();return nn.includes(n)?(e.consume(t),I):S(t)}return tg(t)&&l.length<8?(e.consume(t),l+=String.fromCharCode(t),A):S(t)}function L(t){return 93===t?(e.consume(t),D):S(t)}function D(t){return 62===t?(e.consume(t),I):45===t&&2===r?(e.consume(t),D):S(t)}function I(t){return null===t||tj(t)?(e.exit("htmlFlowData"),P(t)):(e.consume(t),I)}function P(n){return e.exit("htmlFlow"),t(n)}}},61:ng,95:nf,96:t2,126:t2},"flowInitial",0,{[-2]:t3,[-1]:t3,32:t3},"insideSpan",0,{null:[tK,tB]},"string",0,{38:t0,92:tJ},"text",0,{[-5]:nd,[-4]:nd,[-3]:nd,33:nu,38:t0,42:tK,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i};function i(t){return tg(t)?(e.consume(t),l):64===t?n(t):a(t)}function l(t){return 43===t||45===t||46===t||tx(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,o):(43===n||45===n||46===n||tx(n))&&r++<32?(e.consume(n),t):(r=0,a(n))}(t)):a(t)}function o(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||ty(r)?n(r):(e.consume(r),o)}function a(t){return 64===t?(e.consume(t),s):tv(t)?(e.consume(t),a):n(t)}function s(i){return tx(i)?function i(l){return 46===l?(e.consume(l),r=0,s):62===l?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(l),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(l){if((45===l||tx(l))&&r++<63){let n=45===l?t:i;return e.consume(l),n}return n(l)}(l)}(i):n(i)}}},{name:"htmlText",tokenize:function(e,t,n){let r,i,l,o=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),a};function a(t){return 33===t?(e.consume(t),s):47===t?(e.consume(t),b):63===t?(e.consume(t),v):tg(t)?(e.consume(t),w):n(t)}function s(t){return 45===t?(e.consume(t),u):91===t?(e.consume(t),i=0,h):tg(t)?(e.consume(t),x):n(t)}function u(t){return 45===t?(e.consume(t),f):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),d):tj(t)?(l=c,A(t)):(e.consume(t),c)}function d(t){return 45===t?(e.consume(t),f):c(t)}function f(e){return 62===e?T(e):45===e?d(e):c(e)}function h(t){let r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),i===r.length?p:h):n(t)}function p(t){return null===t?n(t):93===t?(e.consume(t),m):tj(t)?(l=p,A(t)):(e.consume(t),p)}function m(t){return 93===t?(e.consume(t),g):p(t)}function g(t){return 62===t?T(t):93===t?(e.consume(t),g):p(t)}function x(t){return null===t||62===t?T(t):tj(t)?(l=x,A(t)):(e.consume(t),x)}function v(t){return null===t?n(t):63===t?(e.consume(t),y):tj(t)?(l=v,A(t)):(e.consume(t),v)}function y(e){return 62===e?T(e):v(e)}function b(t){return tg(t)?(e.consume(t),k):n(t)}function k(t){return 45===t||tx(t)?(e.consume(t),k):function t(n){return tj(n)?(l=t,A(n)):tC(n)?(e.consume(n),t):T(n)}(t)}function w(t){return 45===t||tx(t)?(e.consume(t),w):47===t||62===t||tS(t)?j(t):n(t)}function j(t){return 47===t?(e.consume(t),T):58===t||95===t||tg(t)?(e.consume(t),S):tj(t)?(l=j,A(t)):tC(t)?(e.consume(t),j):T(t)}function S(t){return 45===t||46===t||58===t||95===t||tx(t)?(e.consume(t),S):function t(n){return 61===n?(e.consume(n),C):tj(n)?(l=t,A(n)):tC(n)?(e.consume(n),t):j(n)}(t)}function C(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,N):tj(t)?(l=C,A(t)):tC(t)?(e.consume(t),C):(e.consume(t),E)}function N(t){return t===r?(e.consume(t),r=void 0,_):null===t?n(t):tj(t)?(l=N,A(t)):(e.consume(t),N)}function E(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||tS(t)?j(t):(e.consume(t),E)}function _(e){return 47===e||62===e||tS(e)?j(e):n(e)}function T(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function A(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),L}function L(t){return tC(t)?tT(e,D,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):D(t)}function D(t){return e.enter("htmlTextData"),l(t)}}}],91:nc,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return tj(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},tJ],93:nl,95:tK,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,i=3;if(("lineEnding"===e[3][1].type||"space"===e[i][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=i;++t<r;)if("codeTextData"===e[t][1].type){e[i][1].type="codeTextPadding",e[r][1].type="codeTextPadding",i+=2,r-=2;break}}for(t=i-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,i,l=0;
4return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),l++,t):(e.exit("codeTextSequence"),o(n))}(t)};function o(s){return null===s?n(s):32===s?(e.enter("space"),e.consume(s),e.exit("space"),o):96===s?(i=e.enter("codeTextSequence"),r=0,function n(o){return 96===o?(e.consume(o),r++,n):r===l?(e.exit("codeTextSequence"),e.exit("codeText"),t(o)):(i.type="codeTextData",a(o))}(s)):tj(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):(e.enter("codeTextData"),a(s))}function a(t){return null===t||32===t||96===t||tj(t)?(e.exit("codeTextData"),o(t)):(e.consume(t),a)}}}}],119210);var nx=e.i(119210);let nv=/[\0\t\n\r]/g;function ny(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let nb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function nk(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return ny(n.slice(t?2:1),t?16:10)}return tZ(n)||e}let nw={}.hasOwnProperty;function nj(e){return{line:e.line,column:e.column,offset:e.offset}}function nS(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+eZ({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+eZ({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+eZ({start:t.start,end:t.end})+") is still open")}function nC(e){let t=this;t.parser=function(n){var r,i;let l,o,a,s;return"string"!=typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(i=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(x),autolinkProtocol:u,autolinkEmail:u,atxHeading:r(p),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:u,characterReference:u,codeFenced:r(h),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:r(h,i),codeText:r(function(){return{type:"inlineCode",value:""}},i),codeTextData:u,data:u,codeFlowValue:u,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(m),hardBreakTrailing:r(m),htmlFlow:r(g,i),htmlFlowData:u,htmlText:r(g,i),htmlTextData:u,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:i,link:r(x),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(v,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(v),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:r(p),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:o(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:o(),autolinkEmail:function(e){c.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){c.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:o(),characterEscapeValue:c,characterReferenceMarkerHexadecimal:f,characterReferenceMarkerNumeric:f,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=ny(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=tZ(n);let i=this.stack[this.stack.length-1];i.value+=t},characterReference:function(e){this.stack.pop().position.end=nj(e.end)},codeFenced:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:c,codeIndented:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:c,data:c,definition:o(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=t8(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:o(),hardBreakEscape:o(d),hardBreakTrailing:o(d),htmlFlow:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:c,htmlText:o(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:c,image:o(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(nb,nk),n.identifier=t8(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=nj(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.t
4ype)&&(u.call(this,e),c.call(this,e))},link:o(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=t8(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:o(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:o(),thematicBreak:o()}};!function e(t,n){let r=-1;for(;++r<n.length;){let i=n[r];Array.isArray(i)?e(t,i):function(e,t){let n;for(n in t)if(nw.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,i)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},o={stack:[r],tokenStack:[],config:t,enter:l,exit:a,buffer:i,resume:s,data:n},u=[],c=-1;for(;++c<e.length;)("listOrdered"===e[c][1].type||"listUnordered"===e[c][1].type)&&("enter"===e[c][0]?u.push(c):c=function(e,t,n){let r,i,l,o,a=t-1,s=-1,u=!1;for(;++a<=n;){let t=e[a];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?s++:s--,o=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||o||s||l||(l=a),o=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:o=void 0}if(!s&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===s&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let o=a;for(i=void 0;o--;){let t=e[o];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;i&&(e[i][1].type="lineEndingBlank",u=!0),t[1].type="lineEnding",i=o}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}l&&(!i||l<i)&&(r._spread=!0),r.end=Object.assign({},i?e[i][1].start:t[1].end),e.splice(i||a,0,["exit",r,t[2]]),a++,n++}if("listItemPrefix"===t[1].type){let i={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=i,e.splice(a,0,["enter",i,t[2]]),a++,n++,l=void 0,o=!0}}}return e[t][1]._spread=u,n}(e,u.pop(),c));for(c=-1;++c<e.length;){let n=t[e[c][0]];nw.call(n,e[c][1].type)&&n[e[c][1].type].call(Object.assign({sliceSerialize:e[c][2].sliceSerialize},o),e[c][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||nS).call(o,void 0,e[0])}for(r.position={start:nj(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:nj(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},c=-1;++c<t.transforms.length;)r=t.transforms[c](r)||r;return r};function r(e,t){return function(n){l.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function l(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:nj(t.start),end:void 0}}function o(e){return function(t){e&&e.call(this,t),a.call(this,t)}}function a(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||nS).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+eZ({start:e.start,end:e.end})+"): it’s not open");n.position.end=nj(e.end)}function s(){return tu(this.stack.pop())}function u(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:nj(e.start),end:void 0},t.push(n)),this.stack.push(n)}function c(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=nj(e.end)}function d(){this.data.atHardBreak=!0}function f(e){this.data.characterReferenceType=e.type}function h(){return{type:"code",lang:null,meta:null,value:""}}function p(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function g(){return{type:"html",value:""}}function x(){return{type:"link",title:null,url:"",children:[]}}function v(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(i)(function(e){for(;!tz(e););return e}((function(e){let t={constructs:tm([nx,...(e||{}).extensions||[]]),content:n(tA),defined:[],document:n(tL),flow:n(tF),lazy:{},string:n(tU),text:n(tH)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,c
4olumn:n&&n.column||1,offset:n&&n.offset||0},i={},l=[],o=[],a=[],s={attempt:p(function(e,t){m(e,t.from)}),check:p(h),consume:function(e){tj(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,g()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=f(),u.events.push(["enter",n,u]),a.push(n),n},exit:function(e){let t=a.pop();return t.end=f(),u.events.push(["exit",t,u]),t},interrupt:p(h,{interrupt:!0})},u={code:null,containerState:{},defineSkip:function(e){i[e.line]=e.column,g()},events:[],now:f,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,i=[];for(;++r<e.length;){let l,o=e[r];if("string"==typeof o)l=o;else switch(o){case -5:l="\r";break;case -4:l="\n";break;case -3:l="\r\n";break;case -2:l=t?" ":"	";break;case -1:if(!t&&n)continue;l=" ";break;default:l=String.fromCharCode(o)}n=-2===o,i.push(l)}return i.join("")}(d(e),t)},sliceStream:d,write:function(e){return(o=th(o,e),function(){let e;for(;r._index<o.length;){let n=o[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),c=c(t)}else c=c(n)}}(),null!==o[o.length-1])?[]:(m(t,0),u.events=t$(l,u.events,u),u.events)}},c=t.tokenize.call(u,s);return t.resolveAll&&l.push(t),u;function d(e){return function(e,t){let n,r=t.start._index,i=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;if(r===l)n=[e[r].slice(i,o)];else{if(n=e.slice(r,l),i>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(i):n.shift()}o>0&&n.push(e[l].slice(0,o))}return n}(o,e)}function f(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:l}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:l}}function h(e,t){t.restore()}function p(e,t){return function(n,i,l){var o;let c,d,h,p;return Array.isArray(n)?m(n):"tokenize"in n?m([n]):(o=n,function(e){let t=null!==e&&o[e],n=null!==e&&o.null;return m([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function m(e){return(c=e,d=0,0===e.length)?l:x(e[d])}function x(e){return function(n){let i,l,o,c,d;return(i=f(),l=u.previous,o=u.currentConstruct,c=u.events.length,d=Array.from(a),p={from:c,restore:function(){r=i,u.previous=l,u.currentConstruct=o,u.events.length=c,a=d,g()}},h=e,e.partial||(u.currentConstruct=e),e.name&&u.parser.constructs.disable.null.includes(e.name))?y(n):e.tokenize.call(t?Object.assign(Object.create(u),t):u,s,v,y)(n)}}function v(t){return e(h,p),i}function y(e){return(p.restore(),++d<c.length)?x(c[d]):l}}}function m(e,t){e.resolveAll&&!l.includes(e)&&l.push(e),e.resolve&&tf(u.events,t,u.events.length-t,e.resolve(u.events.slice(t),u)),e.resolveTo&&(u.events=e.resolveTo(u.events,u))}function g(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}(t,e,n)}}})(i).document().write((o=1,a="",s=!0,function(e,t,n){let r,i,u,c,d,f=[];for(e=a+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),u=0,a="",s&&(65279===e.charCodeAt(0)&&u++,s=void 0);u<e.length;){if(nv.lastIndex=u,c=(r=nv.exec(e))&&void 0!==r.index?r.index:e.length,d=e.charCodeAt(c),!r){a=e.slice(u);break}if(10===d&&u===c&&l)f.push(-3),l=void 0;else switch(l&&(f.push(-5),l=void 0),u<c&&(f.push(e.slice(u,c)),o+=c-u),d){case 0:f.push(65533),o++;break;case 9:for(i=4*Math.ceil(o/4),f.push(-2);o++<i;)f.push(-1);break;case 10:f.push(-4),o=1;break;default:l=!0,o=1}u=c+1}return n&&(l&&f.push(-5),a&&f.push(a),f.push(null)),f})(n,r,!0))))}}let nN="object"==typeof self?self:globalThis,nE=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=i=>{if(t.has(i))return t.get(i);let[l,o]=e[i];switch(l){case 0:case -1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new nN[e](t),i)}case 8:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new nN[l](o),i)})(0)},{toString:n_}={},{keys:nT}=Object,nA=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=n_.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},nL=([e,t])=>0===e&&("function"===t||"symbol"===t),nD=(e,{json:t,lossy:n}={})=>{var r,i,l;let o,a,s=[];return(r=!(t||n),i=!!t,l=new Map,o=(e,t)=>{let n=s.push(e)-1;return l.set(t,n),n},a=e=>{if(l.has(e))return l.get(e);let[t,n]=nA(e);switch(t){case 0:{let i=e;switch(n){case"bigint":t=8,i=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);i=null;break;case"undefined":return o([-1],e)}return o([t,i],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),o([n,[...t]],e)}let r=[],i=o([t,r],e);for(let t of e)r.push(a(t));return i}case 2:{if(n)switch(n){case"BigInt":return o([n,e.toString()],e);case"Boolean":case"Number":case"String":return o([n,e.valueOf()],e)}if(i&&"toJSON"in e)return a(e.toJSON());let l=[],s=o([t,l],e);for(let t of nT(e))(r||!nL(nA(e[t])))&&l.push([a(t),a(e[t])]);return s}case 3:return o([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return o([t,{source:n,flags:r}],e)}case 5:{let n=[],i=o([t,n],e);for(let[t,i]of e)(r||!(nL(nA(t))||nL(nA(i))))&&n.push([a(t),a(i)]);return i}case 6:{let n=[],i=o([t,n],e);for(let t of e)(r||!nL(nA(t)))&&n.push(a(t));return i}}let{message:s}=e;return o([t,{name:n,message:s}],e)})(e),s}
4,nI="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?nE(nD(e,t)):structuredClone(e):(e,t)=>nE(nD(e,t));function nP(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let l=e.charCodeAt(n),o="";if(37===l&&tx(e.charCodeAt(n+1))&&tx(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){let t=e.charCodeAt(n+1);l<56320&&t>56319&&t<57344?(o=String.fromCharCode(l,t),i=1):o="�"}else o=String.fromCharCode(l);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function nM(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function nz(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let nR=function(e){var t,n;if(null==e)return nF;if("function"==typeof e)return nO(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=nR(e[n]);return nO(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,nO(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,nO(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function nO(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function nF(){return!0}let nB=[];function nU(e,t,n,r){let i;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):i=t;let l=nR(i),o=r?-1:1;(function e(i,a,s){let u=i&&"object"==typeof i?i:{};if("string"==typeof u.type){let e="string"==typeof u.tagName?u.tagName:"string"==typeof u.name?u.name:void 0;Object.defineProperty(c,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return c;function c(){var u;let c,d,f,h=nB;if((!t||l(i,a,s[s.length-1]||void 0))&&!1===(h=Array.isArray(u=n(i,s))?u:"number"==typeof u?[!0,u]:null==u?nB:[u])[0])return h;if("children"in i&&i.children&&i.children&&"skip"!==h[0])for(d=(r?i.children.length:-1)+o,f=s.concat(i);d>-1&&d<i.children.length;){if(!1===(c=e(i.children[d],d,f)())[0])return c;d="number"==typeof c[1]?c[1]:d+o}return h}})(e,void 0,[])()}function nH(e,t,n,r){let i,l,o;"function"==typeof t&&"function"!=typeof n?(l=void 0,o=t,i=n):(l=t,o=n,i=r),nU(e,l,function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)},i)}function nV(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let i=e.all(t),l=i[0];l&&"text"===l.type?l.value="["+l.value:i.unshift({type:"text",value:"["});let o=i[i.length-1];return o&&"text"===o.type?o.value+=r:i.push({type:"text",value:r}),i}function nq(e){let t=e.spread;return null==t?e.children.length>1:t}function nY(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;9===t||32===t;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}let nW={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i={type:"element",tagName:"pre",properties:{},children:[i=e.applyData(t,i)]},e.patch(t,i),i},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),l=nP(i.toLowerCase()),o=e.footnoteOrder.indexOf(i),a=e.footnoteCounts.get(i);void 0===a?(a=0,e.footnoteOrder.push(i),n=e.footnoteOrder.length):n=o+1,a+=1,e.footnoteCounts.set(i,a);let s={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+l,id:r+"fnref-"+l+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,s);let u={type:"element",tagName:"sup",properties:{},children:[s]};
4return e.patch(t,u),e.applyData(t,u)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nV(e,t);let i={src:nP(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);let l={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,l),e.applyData(t,l)},image:function(e,t){let n={src:nP(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return nV(e,t);let i={href:nP(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);let l={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)},link:function(e,t){let n={href:nP(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=nq(n[r])}return t}(n):nq(t),l={},o=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let a=-1;for(;++a<r.length;){let e=r[a];(i||0!==a||"element"!==e.type||"p"!==e.tagName)&&o.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||i?o.push(e):o.push(...e.children)}let s=r[r.length-1];s&&(i||"element"!==s.type||"p"!==s.tagName)&&o.push({type:"text",value:"\n"});let u={type:"element",tagName:"li",properties:l,children:o};return e.patch(t,u),e.applyData(t,u)},list:function(e,t){let n={},r=e.all(t),i=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++i<r.length;){let e=r[i];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=eJ(t.children[1]),o=eG(t.children[t.children.length-1]);l&&o&&(r.position={start:l,end:o}),i.push(r)}let l={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,l),e.applyData(t,l)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",l=n&&"table"===n.type?n.align:void 0,o=l?l.length:t.children.length,a=-1,s=[];for(;++a<o;){let n=t.children[a],r={},o=l?l[a]:void 0;o&&(r.align=o);let u={type:"element",tagName:i,properties:r,children:[]};n&&(u.children=e.all(n),e.patch(n,u),u=e.applyData(n,u)),s.push(u)}let u={type:"element",tagName:"tr",properties:{},children:e.wrap(s,!0)};
4return e.patch(t,u),e.applyData(t,u)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,l=[];for(;r;)l.push(nY(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return l.push(nY(t.slice(i),i>0,!1)),l.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:n$,yaml:n$,definition:n$,footnoteDefinition:n$};function n$(){}let nK={}.hasOwnProperty,nQ={};function nG(e,t){e.position&&(t.position=function(e){let t=eJ(e),n=eG(e);if(t&&n)return{start:t,end:n}}(e))}function nJ(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&i&&Object.assign(n.properties,nI(i)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function nX(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function nZ(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function n0(e,t){let n,r,i,l,o=(n=t||nQ,r=new Map,i=new Map,l={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let i=l.one(n[r],e);if(i){if(r&&"break"===n[r-1].type&&(Array.isArray(i)||"text"!==i.type||(i.value=nZ(i.value)),!Array.isArray(i)&&"element"===i.type)){let e=i.children[0];e&&"text"===e.type&&(e.value=nZ(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t},applyData:nJ,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...nW,...n.handlers},one:function(e,t){let n=e.type,r=l.handlers[n];if(nK.call(l.handlers,n)&&r)return r(l,e,t);if(l.options.passThrough&&l.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=nI(n);return r.children=l.all(e),r}return nI(e)}return(l.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(nK.call(n,"hProperties")||nK.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(l,e,t)},options:n,patch:nG,wrap:nX},nH(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),l),a=o.one(e,void 0),s=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||nM,r=e.options.footnoteBackLabel||nz,i=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[],s=-1;for(;++s<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[s]);if(!i)continue;let l=e.all(i),o=String(i.identifier).toUpperCase(),u=nP(o.toLowerCase()),c=0,d=[],f=e.footnoteCounts.get(o);for(;void 0!==f&&++c<=f;){d.length>0&&d.push({type:"text",value:" "});let e="string"==typeof n?n:n(s,c);"string"==typeof e&&(e={type:"text",value:e}),d.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+u+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(s,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let h=l[l.length-1];if(h&&"element"===h.type&&"p"===h.tagName){let e=h.children[h.children.length-1];e&&"text"===e.type?e.value+=" ":h.children.push({type:"text",value:" "}),h.children.push(...d)}else l.push(...d);let p={type:"element",tagName:"li",properties:{id:t+"fn-"+u},children:e.wrap(l,!0)};e.patch(i,p),a.push(p)}if(0!==a.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...nI(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)}
4,{type:"text",value:"\n"}]}}(o),u=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&(es("children"in u),u.children.push({type:"text",value:"\n"},s)),u}function n1(e,t){return e&&"run"in e?async function(n,r){let i=n0(n,{file:r,...t});await e.run(i,r)}:function(n,r){return n0(n,{file:r,...e||t})}}function n2(e){if(e)throw e}var n3=e.i(975609);function n4(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let n5=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');n8(e);let r=0,i=-1,l=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;l--;)if(47===e.codePointAt(l)){if(n){r=l+1;break}}else i<0&&(n=!0,i=l+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let o=-1,a=t.length-1;for(;l--;)if(47===e.codePointAt(l)){if(n){r=l+1;break}}else o<0&&(n=!0,o=l+1),a>-1&&(e.codePointAt(l)===t.codePointAt(a--)?a<0&&(i=l):(a=-1,i=o));return r===i?i=o:i<0&&(i=e.length),e.slice(r,i)},n6=function(e){let t;if(n8(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)}
4,n9=function(e){let t;n8(e);let n=e.length,r=-1,i=0,l=-1,o=0;for(;n--;){let a=e.codePointAt(n);if(47===a){if(t){i=n+1;break}continue}r<0&&(t=!0,r=n+1),46===a?l<0?l=n:1!==o&&(o=1):l>-1&&(o=-1)}return l<0||r<0||0===o||1===o&&l===r-1&&l===i+1?"":e.slice(l,r)},n7=function(...e){var t;let n,r,i,l=-1;for(;++l<e.length;)n8(e[l]),e[l]&&(i=void 0===i?e[l]:i+"/"+e[l]);return void 0===i?".":(n8(t=i),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,i="",l=0,o=-1,a=0,s=-1;for(;++s<=e.length;){if(s<e.length)n=e.codePointAt(s);else if(47===n)break;else n=47;if(47===n){if(o===s-1||1===a);else if(o!==s-1&&2===a){if(i.length<2||2!==l||46!==i.codePointAt(i.length-1)||46!==i.codePointAt(i.length-2)){if(i.length>2){if((r=i.lastIndexOf("/"))!==i.length-1){r<0?(i="",l=0):l=(i=i.slice(0,r)).length-1-i.lastIndexOf("/"),o=s,a=0;continue}}else if(i.length>0){i="",l=0,o=s,a=0;continue}}t&&(i=i.length>0?i+"/..":"..",l=2)}else i.length>0?i+="/"+e.slice(o+1,s):i=e.slice(o+1,s),l=s-o-1;o=s,a=0}else 46===n&&a>-1?a++:a=-1}return i}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function n8(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function re(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let rt=["history","path","basename","stem","extname","dirname"];class rn{constructor(e){let t,n;t=e?re(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<rt.length;){const e=rt[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)rt.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?n5(this.path):void 0}set basename(e){ri(e,"basename"),rr(e,"basename"),this.path=n7(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?n6(this.path):void 0}set dirname(e){rl(this.basename,"dirname"),this.path=n7(e||"",this.basename)}get extname(){return"string"==typeof this.path?n9(this.path):void 0}set extname(e){if(rr(e,"extname"),rl(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=n7(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){re(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!re(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),ri(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?n5(this.path,this.extname):void 0}set stem(e){ri(e,"stem"),rr(e,"stem"),this.path=n7(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new e3(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function rr(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function ri(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function rl(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let ro=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},ra={}.hasOwnProperty;class rs extends ro{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function i(l,...o){let a=e[++n],s=-1;if(l)return void r(l);for(;++s<t.length;)(null===o[s]||void 0===o[s])&&(o[s]=t[s]);t=o,a?(function(e,t){let n;return function(...t){let l,o=e.length>t.length;o&&t.push(r);try{l=e.apply(this,t)}catch(e){if(o&&n)throw e;return r(e)}o||(l&&l.then&&"function"==typeof l.then?l.then(i,r):l instanceof Error?r(l):i(l))};function r(e,...i){n||(n=!0,t(e,...i))}function i(e){r(null,e)}})(a,i)(...o):r(null,...o)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new rs,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,n3.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(rf("data",this.frozen),this.namespace[e]=t,this):ra.call(this.namespace,e)&&this.namespace[e]||void 0:e?(rf("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=rm(e),n=this.parser||this.Parser;return rc("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),rc("process",this.parser||this.Parser),rd("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let l=rm(e),o=n.parse(l);function a(e,n){e||!n?i(e):r?r(n):(es(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(o,l,function(e,t,r){var i,l;if(e||!t||!r)return a(e);let o=n.stringify(t,r);"string"==typeof(i=o)||(l=i)&&"object"==typeof l&&"byteLength"in l&&"byteOffset"in l?r.value=o:r.result=
4o,a(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),rc("processSync",this.parser||this.Parser),rd("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,n2(e),t=r}),rp("processSync","process",n),es(t,"we either bailed on an error or have a tree"),t}run(e,t,n){rh(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,l){es("function"!=typeof t,"`file` can’t be a `done` anymore, we checked");let o=rm(t);r.run(e,o,function(t,r,o){let a=r||e;t?l(t):i?i(a):(es(n,"`done` is defined if `resolve` is not"),n(void 0,a,o))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){n2(e),n=t,r=!0}),rp("runSync","run",r),es(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=rm(t),r=this.compiler||this.Compiler;return rd("stringify",r),rh(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(rf("use",this.frozen),null==e);else if("function"==typeof e)o(e,t);else if("object"==typeof e)Array.isArray(e)?l(e):i(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(e.plugins),e.settings&&(r.settings=(0,n3.default)(!0,r.settings,e.settings))}function l(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)o(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;o(t,n)}else i(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function o(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(-1===i)n.push([e,...t]);else if(t.length>0){let[r,...l]=t,o=n[i][1];n4(o)&&n4(r)&&(r=(0,n3.default)(!0,o,r)),n[i]=[e,r,...l]}}}}let ru=new rs().freeze();function rc(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function rd(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function rf(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function rh(e){if(!n4(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function rp(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function rm(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new rn(e)}let rg=[],rx={allowDangerousHtml:!0},rv=/^(https?|ircs?|mailto|xmpp)$/i,ry=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function rb(e){var n;let r,i,l,o,a,s=(r=(n=e).rehypePlugins||rg,i=n.remarkPlugins||rg,l=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...rx}:rx,ru().use(nC).use(i).use(n1,l).use(r)),u=(o=e.children||"",a=new rn,"string"==typeof o?a.value=o:eu("Unexpected value `"+o+"` for `children` prop, expected `string`"),a);return function(e,n){let r=n.allowedElements,i=n.allowElement,l=n.components,o=n.disallowedElements,a=n.skipHtml,s=n.unwrapDisallowed,u=n.urlTransform||rk;for(let e of ry)Object.hasOwn(n,e.from)&&eu("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&o&&eu("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),nH(e,function(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return a?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in ta)if(Object.hasOwn(ta,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=ta[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=u(String(n||""),t,e))}}if("element"===e.type){let l=r?!r.includes(e.tagName):!!o&&o.includes(e.tagName);if(!l&&i&&"number"==typeof t&&(l=!i(e,t,n)),l&&n&&"number"==typeof t)return s&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}),function(e,t){var n,r,i,l;let o;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let a=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=a,r=t.jsxDEV,o=function(e,t,i,l){let o=Array.isArray(i.children),a=eJ(e);return r(t,i,l,o,{columnNumber:a?a.column-1:void 0,fileName:n,lineNumber:a?a.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");
4if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");i=t.jsx,l=t.jsxs,o=function(e,t,n,r){let o=Array.isArray(n.children)?l:i;return r?o(t,n,r):o(t,n)}}let s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:o,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?eK:e$,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},u=te(s,e,void 0);return u&&"string"!=typeof u?u:s.create(e,s.Fragment,{children:u||void 0},void 0)}(e,{Fragment:t.Fragment,components:l,ignoreInvalidStyle:!0,jsx:t.jsx,jsxs:t.jsxs,passKeys:!0,passNode:!0})}(s.runSync(s.parse(u),u),e)}function rk(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return -1===t||-1!==i&&t>i||-1!==n&&t>n||-1!==r&&t>r||rv.test(e.slice(0,t))?e:""}function rw(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}let rj="phrasing",rS=["autolink","link","image","label"];function rC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function rN(e){this.config.enter.autolinkProtocol.call(this,e)}function rE(e){this.config.exit.autolinkProtocol.call(this,e)}function r_(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];es("link"===t.type),t.url="http://"+this.sliceSerialize(e)}function rT(e){this.config.exit.autolinkEmail.call(this,e)}function rA(e){this.exit(e)}function rL(e){!function(e,t,n){let r=nR((n||{}).ignore||[]),i=function(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){var i;let e=n[r];t.push(["string"==typeof(i=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(i),"g"):i,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return t}(t),l=-1;for(;++l<i.length;)nU(e,"text",o);function o(e,t){let n,o=-1;for(;++o<t.length;){let e=t[o],i=n?n.children:void 0;if(r(e,i?i.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){let n=t[t.length-1],r=i[l][0],o=i[l][1],a=0,s=n.children.indexOf(e),u=!1,c=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},l=o(...d,i);if("string"==typeof l&&(l=l.length>0?{type:"text",value:l}:void 0),!1===l?r.lastIndex=n+1:(a!==n&&c.push({type:"text",value:e.value.slice(a,n)}),Array.isArray(l)?c.push(...l):l&&c.push(l),a=n+d[0].length,u=!0),!r.global)break;d=r.exec(e.value)}return u?(a<e.value.length&&c.push({type:"text",value:e.value.slice(a)}),n.children.splice(s,1,...c)):c=[e],s+c.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,rD],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,rI]],{ignore:["link","linkReference"]})}function rD(e,t,n,r,i){let l,o="";if(!rP(i))return!1;if(/^w/i.test(t)&&(n=t+n,t="",o="http://"),(l=n.split(".")).length<2||l[l.length-1]&&(/_/.test(l[l.length-1])||!/[a-zA-Z\d]/.test(l[l.length-1]))||l[l.length-2]&&(/_/.test(l[l.length-2])||!/[a-zA-Z\d]/.test(l[l.length-2])))return!1;let a=function(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=rw(e,"("),l=rw(e,")");for(;-1!==r&&i>l;)e+=n.slice(0,r+1),r=(n=n.slice(r+1)).indexOf(")"),l++;return[e,n]}(n+r);if(!a[0])return!1;let s={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[s,{type:"text",value:a[1]}]:s}function rI(e,t,n,r){return!(!rP(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function rP(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||tE(n)||tN(n))&&(!t||47!==n)}function rM(){this.buffer()}function rz(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function rR(){this.buffer()}function rO(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function rF(e){let t=this.resume(),n=this.stack[this.stack.length-1];es("footnoteReference"===n.type),n.identifier=t8(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rB(e){this.exit(e)}function rU(e){let t=this.resume(),n=this.stack[this.stack.length-1];es("footnoteDefinition"===n.type),n.identifier=t8(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rH(e){this.exit(e)}function rV(e,t,n,r){let i=n.createTracker(r),l=i.move("[^"),o=n.enter("footnoteReference"),a=n.enter("reference");return l+=i.move(n.safe(n.associationId(e),{after:"]",before:l})),a(),o(),l+=i.move("]")}function rq(e,t,n){return 0===t?e:rY(e,t,n)}function rY(e,t,n){return(n?"":"    ")+e}rV.peek=function(){return"["};let rW=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function r$(e){this.enter({type:"delete",children:[]},e)}function rK(e){this.exit(e)}function rQ(e,t,n,r){let i=n.createTracker(r),l=n.enter("strikethrough"),o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),l(),o}function rG(e){return e.length}function rJ(e){let t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:114*(82===t||114===t)}rQ.peek=function(){return"~"};
4function rX(e,t,n){let r=e.value||"",i="`",l=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){let e,t=n.unsafe[l],i=n.compilePattern(t);if(t.atBreak)for(;e=i.exec(r);){let t=e.index;10===r.charCodeAt(t)&&13===r.charCodeAt(t-1)&&t--,r=r.slice(0,t)+" "+r.slice(e.index+1)}}return i+r+i}rX.peek=function(){return"`"};nR(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let rZ=function(e,t,n,r){let i=function(e){let t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n),l=n.bulletCurrent||function(e){let t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}(n);t&&"list"===t.type&&t.ordered&&(l=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+l);let o=l.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(o=4*Math.ceil(o/4));let a=n.createTracker(r);a.move(l+" ".repeat(o-l.length)),a.shift(o);let s=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),function(e,t,n){return t?(n?"":" ".repeat(o))+e:(n?l:l+" ".repeat(o-l.length))+e});return s(),u};function r0(e){let t=e._align;es(t,"expected `_align` on table"),this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function r1(e){this.exit(e),this.data.inTable=void 0}function r2(e){this.enter({type:"tableRow",children:[]},e)}function r3(e){this.exit(e)}function r4(e){this.enter({type:"tableCell",children:[]},e)}function r5(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,r6));let n=this.stack[this.stack.length-1];es("inlineCode"===n.type),n.value=t,this.exit(e)}function r6(e,t){return"|"===t?t:e}function r9(e){let t=this.stack[this.stack.length-2];es("listItem"===t.type),t.checked="taskListCheckValueChecked"===e.type}function r7(e){let t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){let e=this.stack[this.stack.length-1];es("paragraph"===e.type);let n=e.children[0];if(n&&"text"===n.type){let r,i=t.children,l=-1;for(;++l<i.length;){let e=i[l];if("paragraph"===e.type){r=e;break}}r===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function r8(e,t,n,r){let i=e.children[0],l="boolean"==typeof e.checked&&i&&"paragraph"===i.type,o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);l&&a.move(o);let s=rZ(e,t,n,{...r,...a.current()});return l&&(s=s.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+o})),s}let ie={tokenize:function(e,t,n){let r=0;return function t(l){return(87===l||119===l)&&r<3?(r++,e.consume(l),t):46===l&&3===r?(e.consume(l),i):n(l)};function i(e){return null===e?n(e):t(e)}},partial:!0},it={tokenize:function(e,t,n){let r,i,l;return o;function o(t){return 46===t||95===t?e.check(ii,s,a)(t):null===t||tS(t)||tE(t)||45!==t&&tN(t)?s(t):(l=!0,e.consume(t),o)}function a(t){return 95===t?r=!0:(i=r,r=void 0),e.consume(t),o}function s(e){return i||r||!l?n(e):t(e)}},partial:!0},ir={tokenize:function(e,t){let n=0,r=0;return i;function i(o){return 40===o?(n++,e.consume(o),i):41===o&&r<n?l(o):33===o||34===o||38===o||39===o||41===o||42===o||44===o||46===o||58===o||59===o||60===o||63===o||93===o||95===o||126===o?e.check(ii,t,l)(o):null===o||tS(o)||tE(o)?t(o):(e.consume(o),i)}function l(t){return 41===t&&r++,e.consume(t),i}},partial:!0},ii={tokenize:function(e,t,n){return r;function r(o){return 33===o||34===o||39===o||41===o||42===o||44===o||46===o||58===o||59===o||63===o||95===o||126===o?(e.consume(o),r):38===o?(e.consume(o),l):93===o?(e.consume(o),i):60===o||null===o||tS(o)||tE(o)?t(o):n(o)}function i(e){return null===e||40===e||91===e||tS(e)||tE(e)?t(e):r(e)}function l(t){return tg(t)?function t(i){return 59===i?(e.consume(i),r):tg(i)?(e.consume(i),t):n(i)}(t):n(t)}},partial:!0},il={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return tx(e)?n(e):t(e)}},partial:!0},io={name:"wwwAutolink",tokenize:function(e,t,n){let r=this;return function(t){return 87!==t&&119!==t||!id.call(r,r.previous)||ig(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(ie,e.attempt(it,e.attempt(ir,i),n),n)(t))};function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:id},ia={name:"protocolAutolink",tokenize:function(e,t,n){let r=this,i="",l=!1;return function(t){return(72===t||104===t)&&ih.call(r,r.previous)&&!ig(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(t),e.consume(t),o):n(t)};function o(t){if(tg(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),o;if(58===t){let n=i.toLowerCase();if("http"===n||"https"===n)return e.consume(t),a}return n(t)}function a(t){return 47===t?(e.consume(t),l)?s:(l=!0,a):n(t)}function s(t){return null===t||ty(t)||tS(t)||tE(t)||tN(t)?n(t):e.attempt(it,e.attempt(ir,u),n)(t)}function u(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:ih},is={name:"emailAutolink",tokenize:function(e,t,n){let r,i,l=this;return function(t){return!im(t)||!ip.call(l,l.previous)||ig(l.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function t(r){return im(r)?(e.consume(r),t):64===r?(e.consume(r),o):n(r)}(t))};function o(t){return 46===t?e.check(il,s,a)(t):45===t||95===t||tx(t)?(i=!0,e.consume(t),o):s(t)}function a(t){return e.consume(t),r=!0,o}function s(o){return i&&r&&tg(l.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(o)):n(o)}},previous:ip},iu={},ic=48;
4for(;ic<123;)iu[ic]=is,58==++ic?ic=65:91===ic&&(ic=97);function id(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||tS(e)}function ih(e){return!tg(e)}function ip(e){return!(47===e||im(e))}function im(e){return 43===e||45===e||46===e||95===e||tx(e)}function ig(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}iu[43]=is,iu[45]=is,iu[46]=is,iu[95]=is,iu[72]=[is,ia],iu[104]=[is,ia],iu[87]=[is,io],iu[119]=[is,io];let ix={tokenize:function(e,t,n){let r=this;return tT(e,function(e){let i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function iv(e,t,n){let r,i=this,l=i.events.length,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);for(;l--;){let e=i.events[l][1];if("labelImage"===e.type){r=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(l){if(!r||!r._balanced)return n(l);let a=t8(i.sliceSerialize({start:r.end,end:i.now()}));return 94===a.codePointAt(0)&&o.includes(a.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l)):n(l)}}function iy(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let l={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function ib(e,t,n){let r,i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),o=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),a};function a(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(a){if(o>999||93===a&&!r||null===a||91===a||tS(a))return n(a);if(93===a){e.exit("chunkString");let r=e.exit("gfmFootnoteCallString");return l.includes(t8(i.sliceSerialize(r)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(a)}return tS(a)||(r=!0),o++,e.consume(a),92===a?u:s}function u(t){return 91===t||92===t||93===t?(e.consume(t),o++,s):s(t)}}function ik(e,t,n){let r,i,l=this,o=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]),a=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),s};function s(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(t)}function u(t){if(a>999||93===t&&!i||null===t||91===t||tS(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return r=t8(l.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return tS(t)||(i=!0),a++,e.consume(t),92===t?c:u}function c(t){return 91===t||92===t||93===t?(e.consume(t),a++,u):u(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o.includes(r)||o.push(r),tT(e,f,"gfmFootnoteDefinitionWhitespace")):n(t)}function f(e){return t(e)}}function iw(e,t,n){return e.check(tI,t,e.attempt(ix,t,n))}function ij(e){e.exit("gfmFootnoteDefinition")}class iS{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length,n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}function iC(e,t,n){let r,i=this,l=0,o=0;return function(e){let t=i.events.length-1;for(;t>-1;){let e=i.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let r=t>-1?i.events[t][1].type:null,l="tableHead"===r||"tableRow"===r?v:a;return l===v&&i.parser.lazy[i.now().line]?n(e):l(e)};function a(t){var n;return e.enter("tableHead"),e.enter("tableRow"),124===(n=t)||(r=!0,o+=1),s(n)}function s(t){return null===t?n(t):tj(t)?o>1?(o=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):tC(t)?tT(e,s,"whitespace")(t):(o+=1,r&&(r=!1,l+=1),124
4===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,s):(e.enter("data"),u(t))}function u(t){return null===t||124===t||tS(t)?(e.exit("data"),s(t)):(e.consume(t),92===t?c:u)}function c(t){return 92===t||124===t?(e.consume(t),u):u(t)}function d(t){return(i.interrupt=!1,i.parser.lazy[i.now().line])?n(t):(e.enter("tableDelimiterRow"),r=!1,tC(t))?tT(e,f,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):f(t)}function f(t){return 45===t||58===t?p(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),h):n(t)}function h(t){return tC(t)?tT(e,p,"whitespace")(t):p(t)}function p(t){return 58===t?(o+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(o+=1,m(t)):null===t||tj(t)?x(t):n(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),function t(n){return 45===n?(e.consume(n),t):58===n?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(n),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(n))}(t)):n(t)}function g(t){return tC(t)?tT(e,x,"whitespace")(t):x(t)}function x(i){if(124===i)return f(i);if(null===i||tj(i))return r&&l===o?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(i)):n(i);return n(i)}function v(t){return e.enter("tableRow"),y(t)}function y(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),y):null===n||tj(n)?(e.exit("tableRow"),t(n)):tC(n)?tT(e,y,"whitespace")(n):(e.enter("data"),b(n))}function b(t){return null===t||124===t||tS(t)?(e.exit("data"),y(t)):(e.consume(t),92===t?k:b)}function k(t){return 92===t||124===t?(e.consume(t),b):b(t)}}function iN(e,t){let n,r,i,l=-1,o=!0,a=0,s=[0,0,0,0],u=[0,0,0,0],c=!1,d=0,f=new iS;for(;++l<e.length;){let h=e[l],p=h[1];"enter"===h[0]?"tableHead"===p.type?(c=!1,0!==d&&(i_(f,t,d,n,r),r=void 0,d=0),n={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},f.add(l,0,[["enter",n,t]])):"tableRow"===p.type||"tableDelimiterRow"===p.type?(o=!0,i=void 0,s=[0,0,0,0],u=[0,l+1,0,0],c&&(c=!1,r={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},f.add(l,0,[["enter",r,t]])),a="tableDelimiterRow"===p.type?2:r?3:1):a&&("data"===p.type||"tableDelimiterMarker"===p.type||"tableDelimiterFiller"===p.type)?(o=!1,0===u[2]&&(0!==s[1]&&(u[0]=u[1],i=iE(f,t,s,a,void 0,i),s=[0,0,0,0]),u[2]=l)):"tableCellDivider"===p.type&&(o?o=!1:(0!==s[1]&&(u[0]=u[1],i=iE(f,t,s,a,void 0,i)),u=[(s=u)[1],l,0,0])):"tableHead"===p.type?(c=!0,d=l):"tableRow"===p.type||"tableDelimiterRow"===p.type?(d=l,0!==s[1]?(u[0]=u[1],i=iE(f,t,s,a,l,i)):0!==u[1]&&(i=iE(f,t,u,a,l,i)),a=0):a&&("data"===p.type||"tableDelimiterMarker"===p.type||"tableDelimiterFiller"===p.type)&&(u[3]=l)}for(0!==d&&i_(f,t,d,n,r),f.consume(t.events),l=-1;++l<t.events.length;){let e=t.events[l];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if("enter"===i[0])"tableContent"===i[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===i[1].type){if("tableDelimiterMarker"===e[t-1][1].type){let e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===i[1].type)break}else"enter"===i[0]&&"tableDelimiterRow"===i[1].type&&(n=!0);t+=1}return r}(t.events,l))}return e}function iE(e,t,n,r,i,l){0!==n[0]&&(l.end=Object.assign({},iT(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));let o=iT(t.events,n[1]);if(l={type:1===r?"tableHeader":2===r?"tableDelimiter":"tableData",start:Object.assign({},o),end:Object.assign({},o)},e.add(n[1],0,[["enter",l,t]]),0!==n[2]){let i=iT(t.events,n[2]),l=iT(t.events,n[3]),o={type:"tableContent",start:Object.assign({},i),end:Object.assign({},l)};if(e.add(n[2],0,[["enter",o,t]]),2!==r){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",o,t]])}return void 0!==i&&(l.end=Object.assign({},iT(t.events,i)),e.add(i,0,[["exit",l,t]]),l=void 0),l}function i_(e,t,n,r,i){let l=[],o=iT(t.events,n);i&&(i.end=Object.assign({},o),l.push(["exit",i,t])),r.end=Object.assign({},o),l.push(["exit",r,t]),e.add(n+1,0,l)}function iT(e,t){let n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}let iA={name:"tasklistCheck",tokenize:function(e,t,n){let r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return tS(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),l):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),l):n(t)}function l(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(t)}function o(r){return tj(r)?t(r):tC(r)?e.check({tokenize:iL},t,n)(r):n(r)}}};function iL(e,t,n){return tT(e,function(e){return null===e?n(e):t(e)},"whitespace")}let iD={};function iI(e){let t,n,r,i=e||iD,l=this.data(),o=l.micromarkExtensions||(l.micromarkExtensions=[]),a=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),s=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);o.push(tm([{text:iu},{document:{91:{name:"gfmFootnoteDefinition",tokenize:ik,continuation:{tokenize:iw},exit:ij}},text:{91:{name:"gfmFootnoteCall",tokenize:ib},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:iv,resolveTo:iy}}},(t=(i||{}).singleTilde,n={name:"strikethrough",tokenize:function(e,n,r){let i=this.previous,l=this.events,o=0;return function(a){return 126===i&&"characterEscape"!==l[l.length-1][1].type?r(a):(e.enter("strikethroughSequenceTemporary"),function l(a){let s=tW(i);if(126===a)return o>1?r(a):(e.consume(a),o++,l);if(o<2&&!t)return r(a);let u=e.exit("strikethroughSequenceTemporary"),c=tW(a);return u._open=!c||2===c&&!!s,u._close=!s||2===s&&!!c,n(a)}
4(a))}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";let i={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},l={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[["enter",i,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",l,t]],a=t.parser.constructs.insideSpan.null;a&&tf(o,o.length,0,t$(a,e.slice(r+1,n),t)),tf(o,o.length,0,[["exit",l,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",i,t]]),tf(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}},null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:iC,resolveAll:iN}}},{text:{91:iA}}])),a.push([{transforms:[rL],enter:{literalAutolink:rC,literalAutolinkEmail:rN,literalAutolinkHttp:rN,literalAutolinkWww:rN},exit:{literalAutolink:rA,literalAutolinkEmail:rT,literalAutolinkHttp:rE,literalAutolinkWww:r_}},{enter:{gfmFootnoteCallString:rM,gfmFootnoteCall:rz,gfmFootnoteDefinitionLabelString:rR,gfmFootnoteDefinition:rO},exit:{gfmFootnoteCallString:rF,gfmFootnoteCall:rB,gfmFootnoteDefinitionLabelString:rU,gfmFootnoteDefinition:rH}},{canContainEols:["delete"],enter:{strikethrough:r$},exit:{strikethrough:rK}}
4,{enter:{table:r0,tableData:r4,tableHeader:r4,tableRow:r2},exit:{codeText:r5,table:r1,tableData:r3,tableHeader:r3,tableRow:r3}},{exit:{taskListCheckValueChecked:r9,taskListCheckValueUnchecked:r9,paragraph:r7}}]),s.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:rj,notInConstruct:rS},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:rj,notInConstruct:rS},{character:":",before:"[ps]",after:"\\/",inConstruct:rj,notInConstruct:rS}]},(r=!1,i&&i.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:function(e,t,n,i){let l=n.createTracker(i),o=l.move("[^"),a=n.enter("footnoteDefinition"),s=n.enter("label");return o+=l.move(n.safe(n.associationId(e),{before:o,after:"]"})),s(),o+=l.move("]:"),e.children&&e.children.length>0&&(l.shift(4),o+=l.move((r?"\n":" ")+n.indentLines(n.containerFlow(e,l.current()),r?rY:rq))),a(),o},footnoteReference:rV},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:rW}],handlers:{delete:rQ}},function(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=rX(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return a(function(e,t,n){let r=e.children,i=-1,l=[],o=t.enter("table");for(;++i<r.length;)l[i]=s(r[i],t,n);return o(),l}(e,n,r),e.align)},tableCell:o,tableRow:function(e,t,n,r){let i=a([s(e,n,r)]);return i.slice(0,i.indexOf("\n"))}}};function o(e,t,n,r){let i=n.enter("tableCell"),o=n.enter("phrasing"),a=n.containerPhrasing(e,{...r,before:l,after:l});return o(),i(),a}function a(e,t){return function(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||rG,l=[],o=[],a=[],s=[],u=0,c=-1;for(;++c<e.length;){let t=[],r=[],l=-1;for(e[c].length>u&&(u=e[c].length);++l<e[c].length;){var d;let o=null==(d=e[c][l])?"":String(d);if(!1!==n.alignDelimiters){let e=i(o);r[l]=e,(void 0===s[l]||e>s[l])&&(s[l]=e)}t.push(o)}o[c]=t,a[c]=r}let f=-1;if("object"==typeof r&&"length"in r)for(;++f<u;)l[f]=rJ(r[f]);else{let e=rJ(r);for(;++f<u;)l[f]=e}f=-1;let h=[],p=[];for(;++f<u;){let e=l[f],t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let i=!1===n.alignDelimiters?1:Math.max(1,s[f]-t.length-r.length),o=t+"-".repeat(i)+r;!1!==n.alignDelimiters&&((i=t.length+i+r.length)>s[f]&&(s[f]=i),p[f]=i),h[f]=o}o.splice(1,0,h),a.splice(1,0,p),c=-1;let m=[];for(;++c<o.length;){let e=o[c],t=a[c];f=-1;let r=[];for(;++f<u;){let i=e[f]||"",o="",a="";if(!1!==n.alignDelimiters){let e=s[f]-(t[f]||0),n=l[f];114===n?o=" ".repeat(e):99===n?e%2?(o=" ".repeat(e/2+.5),a=" ".repeat(e/2-.5)):a=o=" ".repeat(e/2):a=" ".repeat(e)}!1===n.delimiterStart||f||r.push("|"),!1!==n.padding&&(!1!==n.alignDelimiters||""!==i)&&(!1!==n.delimiterStart||f)&&r.push(" "),!1!==n.alignDelimiters&&r.push(o),r.push(i),!1!==n.alignDelimiters&&r.push(a),!1!==n.padding&&r.push(" "),(!1!==n.delimiterEnd||f!==u-1)&&r.push("|")}m.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return m.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function s(e,t,n){let r=e.children,i=-1,l=[],a=t.enter("tableRow");for(;++i<r.length;)l[i]=o(r[i],e,t,n);return a(),l}}(i),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:r8}}]})}let iP=(0,i.memo)(function({content:e}){return(0,t.jsx)("div",{className:"text-chat-base",children:(0,t.jsx)(rb,{remarkPlugins:[iI],skipHtml:!0,components:{p:({children:e})=>(0,t.jsx)("p",{className:"mb-3 leading-relaxed last:mb-0",children:e}),strong:({children:e})=>(0,t.jsx)("strong",{className:"font-semibold text-text-1",children:e}),em:({children:e})=>(0,t.jsx)("em",{className:"italic",children:e}),ul:({children:e})=>(0,t.jsx)("ul",{className:"mb-3 list-outside list-disc space-y-2 pl-6",children:e}),ol:({children:e})=>(0,t.jsx)("ol",{className:"mb-3 list-outside list-decimal space-y-2 pl-6",children:e}),li:({children:e})=>(0,t.jsx)("li",{className:"leading-relaxed",children:e}),a:({href:e,children:n})=>{let r=n?.toString()||"";if(/^\[?\d{1,2}:\d{2}(?::\d{2})?\]?$/.test(r.trim())){let n=r.replace(/[\[\]]/g,"");return(0,t.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"border-[var(--coral)]/45 hover:bg-[var(--coral)]/10 inline-flex cursor-pointer items-center gap-1 rounded-full border px-2 py-0.5 text-sm text-[var(--coral)] transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--coral-focus)]","aria-label":`Jump to ${n}`,children:n})}return(0,t.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline underline-offset-2 transition-colors hover:text-accent-hover",children:n})},code:({className:e,children:n})=>e?(0,t.jsx)("code",{className:"my-3 block overflow-x-auto rounded bg-bg-2 p-3 font-mono text-sm",children:n}):(0,t.jsx)("code",{className:"rounded bg-bg-2 px-2 py-0.5 font-mono text-sm",children:n}),h1:({children:e})=>(0,t.jsx)("h1",{className:"mb-3 mt-4 text-xl font-semibold leading-tight first:mt-0",children:e}),h2:({children:e})=>(0,t.jsx)("h2",{className:"mb-3 mt-4 text-lg font-semibold leading-tight first:mt-0",children:e}),h3:({children:e})=>(0,t.jsx)("h3",{className:"mb-2 mt-3 text-base font-semibold leading-tight first:mt-0",children:e}),blockquote:({children:e})=>(0,t.jsx)("blockquote",{className:"my-3 border-l-4 border-border pl-4 italic leading-relaxed",children:e})},children:e})})});function iM(e){if("function"!=typeof window.matchMedia)return()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)");return"function"==typeof t.addEventListener?(t.addEventListener("change",e),()=>t.removeEventListener("change",e)):(t.addListener(e),()=>t.removeListener(e))}function iz(){return"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function iR(){return!1}let iO=["Counting all the pixels…","Asking the frames nicely…","Bribing the algorithm with cookies…","Teaching pixels to tell stories…","Convincing electrons to cooperate…","Untangling the video spaghetti…","Herding digital cats…","Politely requesting insights…","Tickling the timestamps…","Organizing pixel parties…","Negotiating with the frames…","Translating video to human…","Waking up the AI hamsters…","Shaking the magic 8-ball…","Consulting the crystal ball…","Reading the video's palm…","Asking a really smart friend…","Spinning the wheel of answers…","Rolling the analysis dice…","Summoning the answer spirits…","Befriending the bytes…","Convincing bits to behave…","Choreographing the data dance…","Whispering to the wavelengths…","Sweet-talking the servers…"],iF=(0,i.memo)(function(){let e=(0,i.useSyncExternalStore)(iM,iz,iR),[n,r]=(0,i.useState)(0);(0,i.useEffect)(()=>
4{if(e)return;let t=window.setInterval(()=>{r(e=>(e+1)%iO.length)},2600);return()=>window.clearInterval(t)},[e]);let l=e?0:n,o=(0,i.useMemo)(()=>iO[l],[l]);return(0,t.jsx)("div",{className:"flex justify-start","data-testid":"loading-bubble",children:(0,t.jsxs)("div",{role:"status","aria-live":"polite",className:`border-border/60 bg-bg-2/70 inline-flex max-w-prose items-center gap-2 rounded-2xl border px-4 py-3 text-sm text-text-2 shadow-soft backdrop-blur-sm transition ${e?"":"animate-[pulse_3s_ease-in-out_infinite]"}`,children:[(0,t.jsxs)("span",{className:"relative flex h-2 w-2 items-center justify-center",children:[(0,t.jsx)("span",{className:"bg-accent/30 absolute inline-flex h-2 w-2 rounded-full"}),(0,t.jsx)("span",{className:`relative inline-flex h-2 w-2 rounded-full bg-accent ${e?"":"animate-[pulse_1.8s_ease-in-out_infinite]"}`})]}),(0,t.jsx)("span",{className:"font-medium text-text-2 transition-colors duration-300",children:o})]})})});function iB({errorMessage:e,isInsufficientBalanceError:n,balanceDetails:r,onAddCredits:i,onDismiss:l,onRetry:o,isRetrying:a}){return n?(0,t.jsxs)("div",{className:"rounded-lg border border-yellow-300 dark:border-yellow-500/50 bg-yellow-50 dark:bg-yellow-500/10 p-4 sm:p-5",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3 mb-3 sm:mb-4",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)("div",{className:"rounded-full bg-yellow-100 dark:bg-yellow-500/10 p-2",children:(0,t.jsx)("svg",{className:"h-5 w-5 text-yellow-600 dark:text-yellow-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"font-semibold text-yellow-900 dark:text-yellow-200 mb-1 text-base sm:text-sm",children:"Insufficient Credits"}),(0,t.jsx)("div",{className:"text-sm sm:text-xs text-yellow-800 dark:text-yellow-300/90 mb-3",children:"You don't have enough credits to analyze this video"}),r&&(0,t.jsxs)("div",{className:"rounded-md bg-yellow-100 dark:bg-yellow-500/5 border border-yellow-200 dark:border-yellow-500/20 p-3 space-y-1.5 text-sm sm:text-xs",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("span",{className:"text-yellow-700 dark:text-yellow-300/80",children:"Video duration:"}),(0,t.jsx)("span",{className:"font-mono text-yellow-900 dark:text-yellow-100 font-medium",children:(0,G.formatDurationHHMMSS)(r.required)})]}),(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("span",{className:"text-yellow-700 dark:text-yellow-300/80",children:"Your balance:"}),(0,t.jsx)("span",{className:"font-mono text-yellow-900 dark:text-yellow-100 font-medium",children:(0,G.formatDurationHHMMSS)(r.available)})]}),(0,t.jsx)("div",{className:"h-px bg-yellow-200 dark:bg-yellow-500/20 my-1.5"}),(0,t.jsxs)("div",{className:"flex justify-between items-center",children:[(0,t.jsx)("span",{className:"text-yellow-900 dark:text-yellow-200 font-semibold",children:"Need additional:"}),(0,t.jsx)("span",{className:"font-mono text-yellow-900 dark:text-yellow-200 font-semibold",children:(0,G.formatDurationHHMMSS)(r.shortfall)})]})]})]})]}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2 sm:gap-3",children:[i&&(0,t.jsx)("button",{onClick:i,className:"min-h-[44px] flex-1 rounded-lg bg-yellow-500 px-4 py-2.5 text-sm font-semibold text-gray-900 hover:bg-yellow-400 transition-colors",children:"Add Credits"}),l&&(0,t.jsx)("button",{onClick:l,className:"min-h-[44px] flex-1 rounded-lg border border-yellow-400 dark:border-yellow-500/40 bg-yellow-100 dark:bg-yellow-500/20 px-4 py-2.5 text-sm font-medium text-yellow-800 dark:text-yellow-200 hover:bg-yellow-200 dark:hover:bg-yellow-500/30 transition-colors",children:"Try Different Video"})]})]}):(0,t.jsx)("div",{className:"rounded-lg border border-red-300 dark:border-red-500/40 bg-red-50 dark:bg-red-500/10 p-4 sm:p-5",children:(0,t.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("svg",{className:"h-5 w-5 text-red-600 dark:text-red-400 flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("div",{className:"font-semibold text-red-800 dark:text-red-200",children:"Analysis Failed"}),(0,t.jsx)("div",{className:"text-sm text-red-700 dark:text-red-300",children:e})]})]}),o&&(0,t.jsx)("button",{onClick:o,disabled:a,className:"min-h-[44px] flex-shrink-0 rounded-lg bg-red-600 px-4 py-2.5 text-sm font-semibold text-white hover:bg-red-500 disabled:opacity-50 transition-colors",children:a?"Retrying...":"Try Again"})]})})}function iU({status:e,errorMessage:n,onRetry:r,isRetrying:l}){let a=(0,i.useMemo)(()=>{let e;return n?(e=n.match(/need (\d+) seconds, have (\d+) seconds, shortfall (\d+) seconds/))?{required:Number(e[1]),available:Number(e[2]),shortfall:Number(e[3])}:null:null},[n]),s=!!n&&(0,G.isInsufficientBalanceError)(n),u=n?(0,c.getFriendlyErrorMessage)(n):"";return"failed"===e&&n?(0,t.jsx)(iB,{errorMessage:u,isInsufficientBalanceError:s,balanceDetails:a,onAddCredits:()=>{window.location.href=o.ROUTES.BILLING},onDismiss:()=>{window.location.reload()},onRetry:s?void 0:r,isRetrying:l}):null}var iH=e.i(242609);let iV={all:["recommendations"],detail:e=>[...iV.all,e]};function iq({conversationId:e,conversationStatus:n}){let l=(0,i.useRef)(!1),{data:o,isLoading:a}=function(e,t){let{getToken:n,isLoaded:i,isSignedIn:l}=(0,r.useAuth)();return(0,T.useQuery)({queryKey:iV.detail(e),queryFn:async()=>
4{if(!e)throw Error("Conversation ID is required");return(0,m.getRecommendations)(e,void 0,n)},enabled:!!e&&"completed"===t&&i&&l,staleTime:1/0,retry:1,refetchOnWindowFocus:!1,refetchOnReconnect:!1})}(e,n);return((0,i.useEffect)(()=>{!l.current&&o&&o.length>0&&(l.current=!0,(0,k.trackEvent)("recommendation_section_shown",{conversation_id:e,count:o.length}))},[o,e]),a||o&&0!==o.length)?(0,t.jsxs)("div",{className:"mt-8 w-full max-w-prose","data-testid":"recommended-videos",children:[(0,t.jsx)("h3",{className:"mb-3 text-sm font-semibold text-text-2",children:"Watch Next"}),a?(0,t.jsx)(D,{}):(0,t.jsx)("div",{className:"space-y-2.5",children:o.map((n,r)=>(0,t.jsx)(L,{videoId:n.video_id,title:n.title,thumbnailUrl:n.thumbnail_url,videoUrl:n.video_url,durationSeconds:n.duration_seconds,channelTitle:n.channel_title,hook:n.hook,suggestedQuestion:n.suggested_question,conversationId:e,position:r},n.video_id))})]}):null}function iY({content:e,conversationId:n,messageIndex:r,conversationCreatedAt:l}){let[a,s]=(0,i.useState)(!1),u=(0,v.useAnalytics)(),c=async()=>{try{await navigator.clipboard.writeText(e),s(!0),j.toast.success("Copied to clipboard"),u.trackResponseCopied(n,e,r,l),setTimeout(()=>s(!1),o.ANIMATION_DURATION.TOAST_SUCCESS)}catch{j.toast.error("Failed to copy")}};return(0,t.jsx)("button",{onClick:c,className:"flex h-7 w-7 items-center justify-center rounded-md text-text-3 transition-colors hover:bg-bg-2 hover:text-text-1 focus:outline-none focus:ring-2 focus:ring-accent/40",title:"Copy response","aria-label":"Copy response to clipboard",children:a?(0,t.jsx)(E.CheckIcon,{className:"h-3.5 w-3.5"}):(0,t.jsx)(E.CopyIcon,{className:"h-3.5 w-3.5"})})}function iW({conversationId:e}){let{data:n,isLoading:l,error:o}=(0,g.useConversation)(e),a=(0,i.useRef)(null),s=(0,i.useRef)(null),{setVideoData:c,clearVideoData:d}=(0,iH.useHeaderVideoStore)(),m=(0,p.useProcessingStore)(e=>e.startedAt),y=(0,p.useProcessingStore)(e=>e.isProcessing),b=(0,p.useProcessingStore)(e=>e.conversationId),w=(0,p.useProcessingStore)(e=>e.error),S=(0,v.useAnalytics)(),C=(0,h.useQueryClient)(),{getToken:N}=(0,r.useAuth)(),{user:T}=(0,ei.useUser)(),{analyzeVideo:A,isSubmitting:L}=x({getToken:N,onError:e=>j.toast.error(e.message)}),D=(0,i.useCallback)(()=>{if(!n||L)return;let e=(0,u.extractYouTubeId)(n.video_url),t={url:n.video_url,thumbnail:e?(0,u.getYouTubeThumbnail)(e):"",title:n.video_name||"Video",durationSeconds:n.duration_seconds,costSeconds:n.duration_seconds,costDisplay:"",isAffordable:!0,timestamp:Date.now()};A(n.messages[0]?.content||"",t,null)},[n,L,A]);!function(e,t=!0){(0,i.useEffect)(()=>{if(!t||"undefined"==typeof document)return;let n=()=>{document.hidden||e()};return document.addEventListener("visibilitychange",n),()=>{document.removeEventListener("visibilitychange",n)}},[e,t])}(()=>{n?.status==="processing"&&C.invalidateQueries({queryKey:g.conversationKeys.detail(e)})},n?.status==="processing"),(0,i.useEffect)(()=>{if(n?.status!=="processing"||!m)return;let e=()=>{Date.now()-m>f.timeoutConfig.maxPollingDuration&&(console.warn("[ConversationView] Polling timeout exceeded, stopping auto-refresh"),p.useProcessingStore.getState().fail("Timeout"))};e();let t=setInterval(e,5e3);return()=>clearInterval(t)},[n?.status,m,e]),(0,i.useEffect)(()=>{if(n){let e=(0,u.extractYouTubeId)(n.video_url),t=e?(0,u.getYouTubeThumbnail)(e):"";c({videoUrl:n.video_url,videoName:n.video_name,thumbnail:t,durationSeconds:n.duration_seconds,conversationId:n.id,conversationStatus:n.status,isShared:n.is_shared,shareToken:n.share_token})}return()=>{d()}},[n,c,d]),(0,i.useEffect)(()=>{if(n&&(S.trackConversationViewed(n),"processing"!==n.status)){let t=y&&b===e,r=t?{response_time_ms:p.useProcessingStore.getState().getElapsedTime()??0}:void 0;if((0,k.trackAnalysisOutcome)(n,r),"completed"===n.status&&T?.id&&T?.createdAt){let e=C.getQueryData(g.conversationKeys.list()),t=e?.pages?e.pages.reduce((e,t)=>e+t.conversations.length,0):void 0;(0,k.trackFirstAnalysis)(T.id,n.id,n.duration_seconds,new Date(T.createdAt),t)}t&&(p.useProcessingStore.getState().complete(),C.invalidateQueries({queryKey:g.conversationKeys.lists()}))}},[n,T?.id,T?.createdAt,y,b,e,S,C]),(0,i.useEffect)(()=>{s.current&&(s.current.scrollTop=0)},[e]),(0,i.useEffect)(()=>{s.current&&("function"==typeof s.current.scrollTo?s.current.scrollTo({top:s.current.scrollHeight,behavior:"smooth"}):s.current.scrollTop=s.current.scrollHeight)},[n?.messages]);let I=(0,el.useIsConversationLoading)(e,n);return o?(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)("div",{className:"text-text-3",children:"Failed to load conversation"})}):l?(0,t.jsx)("div",{className:"flex h-full items-center justify-center",role:"status","aria-busy":"true",children:(0,t.jsx)("div",{className:"text-text-3",children:"Loading conversation..."})}):n?(0,t.jsx)("div",{className:"flex h-full flex-col",children:(0,t.jsxs)("div",{ref:s,className:"flex-1 overflow-y-auto overscroll-none",children:[(0,t.jsx)(ea,{videoUrl:n.video_url,videoName:n.video_name,summary:n.summary,sticky:!0,conversationId:n.id,conversationStatus:n.status,isShared:n.is_shared,shareToken:n.share_token,videoDurationSeconds:n.duration_seconds}),(0,t.jsx)("div",{className:"px-3 py-4 sm:px-4 sm:py-6 md:px-6",role:"log","aria-live":"polite","aria-relevant":"additions","aria-busy":n.isPending?"true":"false",children:(0,t.jsxs)("div",{className:"mx-auto max-w-3xl space-y-6 pb-16 sm:space-y-8 sm:pb-20 md:pb-24",children:[n.messages.map((r,i)=>{let l="user"===r.role,o=r.content;return l||""!==o?(0,t.jsx)("div",{className:`flex ${l?"justify-end":"justify-start"}`,children:(0,t.jsxs)("div",{className:`flex w-full max-w-prose flex-col gap-1.5 sm:gap-2 ${l?"items-end":"items-start"}`,children:[l?(0,t.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-accent sm:text-xs",children:"You"}):(0,t.jsxs)("div",{className:"inline-flex items-center gap-1.5 rounded-full bg-accent/10 px-2.5 py-1 backdrop-blur-sm",children:[(0,t.jsx)(E.LogoIcon,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"text-[10px] font-semibold text-accent sm:text-xs",children:"Ask Your Video"})]}),(0,t.jsxs)("div",{className:"relative w-full max-w-prose",children:[(0,t.jsx)("div",{className:`rounded-2xl border px-3 py-3 text-left text-sm leading-6 sm:px-4 sm:py-3.5 sm:text-base sm:leading-7 md:px-5 md:py-4 md:leading-8 ${l?"user-message":"assistant-message"}`,children:l?(0,t.jsx)("div",{className:"whitespace-pre-wrap",children:o}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(iP,{content:o}),r.isPending&&""!==o&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-1 text-xs text-accent",children:[(0,t.jsx)("span",{className:"inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-accent"}),(0,t.jsx)("span",{children:"Typing..."})]})]})}),!l&&o&&(0,t.jsx)("div",{className:"absolute right-2 top-2",children:(0,t.jsx)(iY,{content:o,conversationId:e,messageIndex:i,conversationCreatedAt:new Date(n.created_at)})})]})]})},r.id):null}),"completed"===n.status&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex justify-start",children:(0,t.jsx)(iq,{conversationId:n.id,conversationStatus:n.status})}),(0,t.jsx)("div",{className:"flex justify-start mt-6",children:(0,t.jsx)("div",{className:"w-full max-w-prose rounded-xl bg-bg-2/30 p-4",children:(0,t.jsx)(_.ExtensionCTA,{placement:"conversation",conversationId:n.id,messageCount:n.messages.length})})})]}),I&&(0,t.jsx)(iF,{}),I&&"Timeout"===w&&(0,t.jsx)("div",{className:"flex justify-start mt-2",children:(0,t.jsxs)("p",{className:"text-sm text-text-3",children:["Taking longer than expected."," ",(0,t.jsx)("button",{onClick:()=>window.location.reload(),className:"text-accent hover:underline focus:outline-none focus:ring-2 focus:ring-accent/40 rounded",children:"Refresh to check"})]})}),(0,t.jsx)(iU,{status:n.status,errorMessage:n.error_message,onRetry:D,isRetrying:L}),(0,t.jsx)("div",{ref:a})]})})]})}):(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-4",children:[(0,t.jsx)("h2",{className:"text-2xl font-semibold text-text-1",children:"Ask Your Video"}),(0,t.jsx)("p",{className:"text-sm text-text-3",children:"Start a new conversation or select one from the sidebar"})]})}var i$=e.i(984608),iK=e.i(246417);function iQ({conversationId:e}){let r=(0,n.useRouter)(),{resetVideoFlow:i}=(0,l.useVideoFlowStore)();return(0,i$.useKeyboardShortcuts)([{...i$.KEYBOARD_SHORTCUTS.NEW_CONVERSATION,handler:()=>{i(),r.push("/new")}},{...i$.KEYBOARD_SHORTCUTS.FOCUS_INPUT,handler:()=>{let e=document.getElementById("question-input"),t=document.getElementById("url-input");(e||t)?.focus()}}]),(0,t.jsx)("main",{id:"main-content",className:"relative flex w-full min-w-0 flex-1 flex-col overflow-hidden",children:(0,t.jsx)(iK.ErrorBoundary,{level:"page",children:e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(iW,{conversationId:e}),(0,t.jsx)(er,{})]}):(0,t.jsx)(er,{})})})}e.s(["default",()=>iQ],331830)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.