@impakers/debug 1.5.2 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- "use client";import{useEffect as Dt,useState as jt,useCallback as Wt}from"react";var Qt="impakers-debug-token",Yn="impakers-debug-token-data";function en(){if(typeof window>"u")return null;try{let e=localStorage.getItem(Yn);if(!e)return null;let n=JSON.parse(e);return new Date(n.expiresAt)<new Date?(ft(),null):n.token}catch{return null}}function cn(){return en()!==null}function qt(){if(typeof window>"u")return null;try{let e=localStorage.getItem(Yn);return e?JSON.parse(e).serviceName:null}catch{return null}}function _s(e){if(!(typeof window>"u"))try{let n={token:e.token,serviceName:e.serviceName,expiresAt:e.expiresAt};localStorage.setItem(Yn,JSON.stringify(n)),localStorage.setItem(Qt,e.token)}catch{}}function ft(){if(!(typeof window>"u"))try{localStorage.removeItem(Yn),localStorage.removeItem(Qt)}catch{}}async function Gt(e,n){let o=window.location.hostname,t=await fetch(`${e}/auth`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:n,domain:o})});if(!t.ok){let r=await t.json().catch(()=>({message:"\uC778\uC99D \uC2E4\uD328"}));throw new Error(r.message||"\uC778\uC99D \uC2E4\uD328")}let s=await t.json();return _s(s),s}var je=class je{static showAuth(){je._eventTarget?.dispatchEvent(new CustomEvent("impakers-debug:show-auth"))}static isActive(){return cn()}static deactivate(){ft(),je._eventTarget?.dispatchEvent(new CustomEvent("impakers-debug:deactivate"))}static open(){if(!cn()){je.showAuth();return}je._eventTarget?.dispatchEvent(new CustomEvent("impakers-debug:open"))}static _on(n,o){return je._eventTarget?.addEventListener(n,o),()=>je._eventTarget?.removeEventListener(n,o)}};je._eventTarget=typeof EventTarget<"u"?new EventTarget:null;var nn=je;import{useState as G,useCallback as Re,useEffect as De,useRef as Vn,useMemo as si}from"react";import{createPortal as ri}from"react-dom";import{useState as In,useRef as Qn,useEffect as no,useCallback as qn,forwardRef as hs,useImperativeHandle as ys}from"react";var ms=`.styles-module__popup___IhzrD svg[fill=none] {
2
+ "use client";import{useEffect as jt,useState as Wt,useCallback as Ot}from"react";var Qt="impakers-debug-token",Qn="impakers-debug-token-data";function en(){if(typeof window>"u")return null;try{let e=localStorage.getItem(Qn);if(!e)return null;let n=JSON.parse(e);return new Date(n.expiresAt)<new Date?(gt(),null):n.token}catch{return null}}function cn(){return en()!==null}function qt(){if(typeof window>"u")return null;try{let e=localStorage.getItem(Qn);return e?JSON.parse(e).serviceName:null}catch{return null}}function _s(e){if(!(typeof window>"u"))try{let n={token:e.token,serviceName:e.serviceName,expiresAt:e.expiresAt};localStorage.setItem(Qn,JSON.stringify(n)),localStorage.setItem(Qt,e.token)}catch{}}function gt(){if(!(typeof window>"u"))try{localStorage.removeItem(Qn),localStorage.removeItem(Qt)}catch{}}async function Gt(e,n){let o=window.location.hostname,t=await fetch(`${e}/auth`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:n,domain:o})});if(!t.ok){let r=await t.json().catch(()=>({message:"\uC778\uC99D \uC2E4\uD328"}));throw new Error(r.message||"\uC778\uC99D \uC2E4\uD328")}let s=await t.json();return _s(s),s}var We=class We{static showAuth(){We._eventTarget?.dispatchEvent(new CustomEvent("impakers-debug:show-auth"))}static isActive(){return cn()}static deactivate(){gt(),We._eventTarget?.dispatchEvent(new CustomEvent("impakers-debug:deactivate"))}static open(){if(!cn()){We.showAuth();return}We._eventTarget?.dispatchEvent(new CustomEvent("impakers-debug:open"))}static _on(n,o){return We._eventTarget?.addEventListener(n,o),()=>We._eventTarget?.removeEventListener(n,o)}};We._eventTarget=typeof EventTarget<"u"?new EventTarget:null;var nn=We;import{useState as ne,useCallback as Re,useEffect as je,useRef as Vn,useMemo as si}from"react";import{createPortal as ri}from"react-dom";import{useState as In,useRef as qn,useEffect as no,useCallback as Gn,forwardRef as hs,useImperativeHandle as ys}from"react";var ms=`.styles-module__popup___IhzrD svg[fill=none] {
3
3
  fill: none !important;
4
4
  }
5
5
  .styles-module__popup___IhzrD svg[fill=none] :not([fill]) {
@@ -329,11 +329,11 @@
329
329
  .styles-module__light___6AaSQ .styles-module__deleteButton___4VuAE:hover {
330
330
  background-color: color-mix(in srgb, var(--agentation-color-red) 25%, transparent);
331
331
  color: var(--agentation-color-red);
332
- }`,ps={popup:"styles-module__popup___IhzrD",enter:"styles-module__enter___L7U7N",popupEnter:"styles-module__popupEnter___AuQDN",entered:"styles-module__entered___COX-w",exit:"styles-module__exit___5eGjE",popupExit:"styles-module__popupExit___JJKQX",shake:"styles-module__shake___jdbWe",header:"styles-module__header___wWsSi",element:"styles-module__element___fTV2z",headerToggle:"styles-module__headerToggle___WpW0b",chevron:"styles-module__chevron___ZZJlR",expanded:"styles-module__expanded___2Hxgv",stylesWrapper:"styles-module__stylesWrapper___pnHgy",stylesInner:"styles-module__stylesInner___YYZe2",stylesBlock:"styles-module__stylesBlock___VfQKn",styleLine:"styles-module__styleLine___1YQiD",styleProperty:"styles-module__styleProperty___84L1i",styleValue:"styles-module__styleValue___q51-h",timestamp:"styles-module__timestamp___Dtpsv",quote:"styles-module__quote___mcMmQ",textarea:"styles-module__textarea___jrSae",green:"styles-module__green___99l3h",actions:"styles-module__actions___D6x3f",cancel:"styles-module__cancel___hRjnL",submit:"styles-module__submit___K-mIR",shortcutHint:"styles-module__shortcutHint___ihsrd",deleteWrapper:"styles-module__deleteWrapper___oSjdo",deleteButton:"styles-module__deleteButton___4VuAE",light:"styles-module__light___6AaSQ"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-annotation-popup-css-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-annotation-popup-css-styles",document.head.appendChild(e)),e.textContent=ms}var V=ps;import{jsx as Jt,jsxs as Ci}from"react/jsx-runtime";var eo=({size:e=24})=>Jt("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Jt("path",{d:"M13.5 4C14.7426 4 15.75 5.00736 15.75 6.25V7H18.5C18.9142 7 19.25 7.33579 19.25 7.75C19.25 8.16421 18.9142 8.5 18.5 8.5H17.9678L17.6328 16.2217C17.61 16.7475 17.5912 17.1861 17.5469 17.543C17.5015 17.9087 17.4225 18.2506 17.2461 18.5723C16.9747 19.0671 16.5579 19.4671 16.0518 19.7168C15.7227 19.8791 15.3772 19.9422 15.0098 19.9717C14.6514 20.0004 14.2126 20 13.6865 20H10.3135C9.78735 20 9.34856 20.0004 8.99023 19.9717C8.62278 19.9422 8.27729 19.8791 7.94824 19.7168C7.44205 19.4671 7.02532 19.0671 6.75391 18.5723C6.57751 18.2506 6.49853 17.9087 6.45312 17.543C6.40883 17.1861 6.39005 16.7475 6.36719 16.2217L6.03223 8.5H5.5C5.08579 8.5 4.75 8.16421 4.75 7.75C4.75 7.33579 5.08579 7 5.5 7H8.25V6.25C8.25 5.00736 9.25736 4 10.5 4H13.5ZM7.86621 16.1562C7.89013 16.7063 7.90624 17.0751 7.94141 17.3584C7.97545 17.6326 8.02151 17.7644 8.06934 17.8516C8.19271 18.0763 8.38239 18.2577 8.6123 18.3711C8.70153 18.4151 8.83504 18.4545 9.11035 18.4766C9.39482 18.4994 9.76335 18.5 10.3135 18.5H13.6865C14.2367 18.5 14.6052 18.4994 14.8896 18.4766C15.165 18.4545 15.2985 18.4151 15.3877 18.3711C15.6176 18.2577 15.8073 18.0763 15.9307 17.8516C15.9785 17.7644 16.0245 17.6326 16.0586 17.3584C16.0938 17.0751 16.1099 16.7063 16.1338 16.1562L16.4668 8.5H7.5332L7.86621 16.1562ZM9.97656 10.75C10.3906 10.7371 10.7371 11.0626 10.75 11.4766L10.875 15.4766C10.8879 15.8906 10.5624 16.2371 10.1484 16.25C9.73443 16.2629 9.38794 15.9374 9.375 15.5234L9.25 11.5234C9.23706 11.1094 9.56255 10.7629 9.97656 10.75ZM14.0244 10.75C14.4383 10.7635 14.7635 11.1105 14.75 11.5244L14.6201 15.5244C14.6066 15.9384 14.2596 16.2634 13.8457 16.25C13.4317 16.2365 13.1067 15.8896 13.1201 15.4756L13.251 11.4756C13.2645 11.0617 13.6105 10.7366 14.0244 10.75ZM10.5 5.5C10.0858 5.5 9.75 5.83579 9.75 6.25V7H14.25V6.25C14.25 5.83579 13.9142 5.5 13.5 5.5H10.5Z",fill:"currentColor"})});var fs=["data-feedback-toolbar","data-annotation-popup","data-annotation-marker"],Si=fs.flatMap(e=>[`:not([${e}])`,`:not([${e}] *)`]).join("");var gt="__agentation_freeze";function gs(){if(typeof window>"u")return{frozen:!1,installed:!0,origSetTimeout:setTimeout,origSetInterval:setInterval,origRAF:n=>0,pausedAnimations:[],frozenTimeoutQueue:[],frozenRAFQueue:[]};let e=window;return e[gt]||(e[gt]={frozen:!1,installed:!1,origSetTimeout:null,origSetInterval:null,origRAF:null,pausedAnimations:[],frozenTimeoutQueue:[],frozenRAFQueue:[]}),e[gt]}var he=gs();typeof window<"u"&&!he.installed&&(he.origSetTimeout=window.setTimeout.bind(window),he.origSetInterval=window.setInterval.bind(window),he.origRAF=window.requestAnimationFrame.bind(window),window.setTimeout=(e,n,...o)=>typeof e=="string"?he.origSetTimeout(e,n):he.origSetTimeout((...t)=>{he.frozen?he.frozenTimeoutQueue.push(()=>e(...t)):e(...t)},n,...o),window.setInterval=(e,n,...o)=>typeof e=="string"?he.origSetInterval(e,n):he.origSetInterval((...t)=>{he.frozen||e(...t)},n,...o),window.requestAnimationFrame=e=>he.origRAF(n=>{he.frozen?he.frozenRAFQueue.push(e):e(n)}),he.installed=!0);var Ne=he.origSetTimeout,Ni=he.origSetInterval,Li=he.origRAF;import{jsx as Ce,jsxs as tn}from"react/jsx-runtime";function ht(e){if(!e)return;let n=o=>o.stopImmediatePropagation();document.addEventListener("focusin",n,!0),document.addEventListener("focusout",n,!0);try{e.focus()}finally{document.removeEventListener("focusin",n,!0),document.removeEventListener("focusout",n,!0)}}var to=hs(function({element:n,timestamp:o,selectedText:t,placeholder:s="What should change?",initialValue:r="",submitLabel:i="Add",onSubmit:a,onCancel:_,onDelete:k,style:v,accentColor:C="#3c82f7",isExiting:w=!1,lightMode:B=!1,computedStyles:M},D){let[U,ce]=In(r),[ue,se]=In(!1),[F,A]=In("initial"),[X,h]=In(!1),[H,I]=In(!1),_e=Qn(null),E=Qn(null),q=Qn(null),ee=Qn(null);no(()=>{w&&F!=="exit"&&A("exit")},[w,F]),no(()=>{Ne(()=>{A("enter")},0);let x=Ne(()=>{A("entered")},200),p=Ne(()=>{let S=_e.current;S&&(ht(S),S.selectionStart=S.selectionEnd=S.value.length,S.scrollTop=S.scrollHeight)},50);return()=>{clearTimeout(x),clearTimeout(p),q.current&&clearTimeout(q.current),ee.current&&clearTimeout(ee.current)}},[]);let we=qn(()=>{ee.current&&clearTimeout(ee.current),se(!0),ee.current=Ne(()=>{se(!1),ht(_e.current)},250)},[]);ys(D,()=>({shake:we}),[we]);let Me=qn(()=>{A("exit"),q.current=Ne(()=>{_()},150)},[_]),Se=qn(()=>{U.trim()&&a(U.trim())},[U,a]),ne=qn(x=>{x.stopPropagation(),!x.nativeEvent.isComposing&&(x.key==="Enter"&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),Se()),x.key==="Escape"&&Me())},[Se,Me]),b=[V.popup,B?V.light:"",F==="enter"?V.enter:"",F==="entered"?V.entered:"",F==="exit"?V.exit:"",ue?V.shake:""].filter(Boolean).join(" ");return tn("div",{ref:E,className:b,"data-annotation-popup":!0,style:v,onClick:x=>x.stopPropagation(),children:[tn("div",{className:V.header,children:[M&&Object.keys(M).length>0?tn("button",{className:V.headerToggle,onClick:()=>{let x=H;I(!H),x&&Ne(()=>ht(_e.current),0)},type:"button",children:[Ce("svg",{className:`${V.chevron} ${H?V.expanded:""}`,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ce("path",{d:"M5.5 10.25L9 7.25L5.75 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ce("span",{className:V.element,children:n})]}):Ce("span",{className:V.element,children:n}),o&&Ce("span",{className:V.timestamp,children:o})]}),M&&Object.keys(M).length>0&&Ce("div",{className:`${V.stylesWrapper} ${H?V.expanded:""}`,children:Ce("div",{className:V.stylesInner,children:Ce("div",{className:V.stylesBlock,children:Object.entries(M).map(([x,p])=>tn("div",{className:V.styleLine,children:[Ce("span",{className:V.styleProperty,children:x.replace(/([A-Z])/g,"-$1").toLowerCase()}),": ",Ce("span",{className:V.styleValue,children:p}),";"]},x))})})}),t&&tn("div",{className:V.quote,children:["\u201C",t.slice(0,80),t.length>80?"...":"","\u201D"]}),Ce("textarea",{ref:_e,className:V.textarea,style:{borderColor:X?C:void 0},placeholder:s,value:U,onChange:x=>{ce(x.target.value);let p=x.target;p.style.height="auto",p.style.height=`${Math.min(p.scrollHeight,200)}px`},onFocus:()=>h(!0),onBlur:()=>h(!1),rows:4,onKeyDown:ne}),tn("div",{className:V.actions,children:[k&&Ce("div",{className:V.deleteWrapper,children:Ce("button",{className:V.deleteButton,onClick:k,type:"button",children:Ce(eo,{size:22})})}),Ce("button",{className:V.cancel,onClick:Me,children:"Cancel"}),Ce("button",{className:V.submit,style:{backgroundColor:C,opacity:U.trim()?1:.4},onClick:Se,disabled:!U.trim(),children:i})]}),tn("div",{className:V.shortcutHint,children:[navigator?.platform?.includes("Mac")?"\u2318":"Ctrl","+Enter to submit"]})]})});function En(e){if(e.parentElement)return e.parentElement;let n=e.getRootNode();return n instanceof ShadowRoot?n.host:null}function on(e,n){let o=e;for(;o;){if(o.matches(n))return o;o=En(o)}return null}function bs(e,n=4){let o=[],t=e,s=0;for(;t&&s<n;){let r=t.tagName.toLowerCase();if(r==="html"||r==="body")break;let i=r;if(t.id)i=`#${t.id}`;else if(t.className&&typeof t.className=="string"){let _=t.className.split(/\s+/).find(k=>k.length>2&&!k.match(/^[a-z]{1,2}$/)&&!k.match(/[A-Z0-9]{5,}/));_&&(i=`.${_.split("_")[0]}`)}let a=En(t);!t.parentElement&&a&&(i=`\u27E8shadow\u27E9 ${i}`),o.unshift(i),t=a,s++}return o.join(" > ")}function yt(e){let n=bs(e);if(e.dataset.element)return{name:e.dataset.element,path:n};let o=e.tagName.toLowerCase();if(["path","circle","rect","line","g"].includes(o)){let t=on(e,"svg");if(t){let s=En(t);if(s instanceof HTMLElement)return{name:`graphic in ${yt(s).name}`,path:n}}return{name:"graphic element",path:n}}if(o==="svg"){let t=En(e);if(t?.tagName.toLowerCase()==="button"){let s=t.textContent?.trim();return{name:s?`icon in "${s}" button`:"button icon",path:n}}return{name:"icon",path:n}}if(o==="button"){let t=e.textContent?.trim(),s=e.getAttribute("aria-label");return s?{name:`button [${s}]`,path:n}:{name:t?`button "${t.slice(0,25)}"`:"button",path:n}}if(o==="a"){let t=e.textContent?.trim(),s=e.getAttribute("href");return t?{name:`link "${t.slice(0,25)}"`,path:n}:s?{name:`link to ${s.slice(0,30)}`,path:n}:{name:"link",path:n}}if(o==="input"){let t=e.getAttribute("type")||"text",s=e.getAttribute("placeholder"),r=e.getAttribute("name");return s?{name:`input "${s}"`,path:n}:r?{name:`input [${r}]`,path:n}:{name:`${t} input`,path:n}}if(["h1","h2","h3","h4","h5","h6"].includes(o)){let t=e.textContent?.trim();return{name:t?`${o} "${t.slice(0,35)}"`:o,path:n}}if(o==="p"){let t=e.textContent?.trim();return t?{name:`paragraph: "${t.slice(0,40)}${t.length>40?"...":""}"`,path:n}:{name:"paragraph",path:n}}if(o==="span"||o==="label"){let t=e.textContent?.trim();return t&&t.length<40?{name:`"${t}"`,path:n}:{name:o,path:n}}if(o==="li"){let t=e.textContent?.trim();return t&&t.length<40?{name:`list item: "${t.slice(0,35)}"`,path:n}:{name:"list item",path:n}}if(o==="blockquote")return{name:"blockquote",path:n};if(o==="code"){let t=e.textContent?.trim();return t&&t.length<30?{name:`code: \`${t}\``,path:n}:{name:"code",path:n}}if(o==="pre")return{name:"code block",path:n};if(o==="img"){let t=e.getAttribute("alt");return{name:t?`image "${t.slice(0,30)}"`:"image",path:n}}if(o==="video")return{name:"video",path:n};if(["div","section","article","nav","header","footer","aside","main"].includes(o)){let t=e.className,s=e.getAttribute("role"),r=e.getAttribute("aria-label");if(r)return{name:`${o} [${r}]`,path:n};if(s)return{name:`${s}`,path:n};if(typeof t=="string"&&t){let i=t.split(/[\s_-]+/).map(a=>a.replace(/[A-Z0-9]{5,}.*$/,"")).filter(a=>a.length>2&&!/^[a-z]{1,2}$/.test(a)).slice(0,2);if(i.length>0)return{name:i.join(" "),path:n}}return{name:o==="div"?"container":o,path:n}}return{name:o,path:n}}function oo(e){let n=[],o=e.textContent?.trim();o&&o.length<100&&n.push(o);let t=e.previousElementSibling;if(t){let r=t.textContent?.trim();r&&r.length<50&&n.unshift(`[before: "${r.slice(0,40)}"]`)}let s=e.nextElementSibling;if(s){let r=s.textContent?.trim();r&&r.length<50&&n.push(`[after: "${r.slice(0,40)}"]`)}return n.join(" ")}function so(e){let n=e.className;return typeof n!="string"||!n?"":n.split(/\s+/).filter(t=>t.length>0).map(t=>{let s=t.match(/^([a-zA-Z][a-zA-Z0-9_-]*?)(?:_[a-zA-Z0-9]{5,})?$/);return s?s[1]:t}).filter((t,s,r)=>r.indexOf(t)===s).join(", ")}var ro=new Set(["none","normal","auto","0px","rgba(0, 0, 0, 0)","transparent","static","visible"]),xs=new Set(["p","span","h1","h2","h3","h4","h5","h6","label","li","td","th","blockquote","figcaption","caption","legend","dt","dd","pre","code","em","strong","b","i","a","time","cite","q"]),ks=new Set(["input","textarea","select"]),vs=new Set(["img","video","canvas","svg"]),Cs=new Set(["div","section","article","nav","header","footer","aside","main","ul","ol","form","fieldset"]);function io(e){if(typeof window>"u")return{};let n=window.getComputedStyle(e),o={},t=e.tagName.toLowerCase(),s;xs.has(t)?s=["color","fontSize","fontWeight","fontFamily","lineHeight"]:t==="button"||t==="a"&&e.getAttribute("role")==="button"?s=["backgroundColor","color","padding","borderRadius","fontSize"]:ks.has(t)?s=["backgroundColor","color","padding","borderRadius","fontSize"]:vs.has(t)?s=["width","height","objectFit","borderRadius"]:Cs.has(t)?s=["display","padding","margin","gap","backgroundColor"]:s=["color","fontSize","margin","padding","backgroundColor"];for(let r of s){let i=r.replace(/([A-Z])/g,"-$1").toLowerCase(),a=n.getPropertyValue(i);a&&!ro.has(a)&&(o[r]=a)}return o}var ws=["color","backgroundColor","borderColor","fontSize","fontWeight","fontFamily","lineHeight","letterSpacing","textAlign","width","height","padding","margin","border","borderRadius","display","position","top","right","bottom","left","zIndex","flexDirection","justifyContent","alignItems","gap","opacity","visibility","overflow","boxShadow","transform"];function ao(e){if(typeof window>"u")return"";let n=window.getComputedStyle(e),o=[];for(let t of ws){let s=t.replace(/([A-Z])/g,"-$1").toLowerCase(),r=n.getPropertyValue(s);r&&!ro.has(r)&&o.push(`${s}: ${r}`)}return o.join("; ")}function lo(e){let n=[],o=e.getAttribute("role"),t=e.getAttribute("aria-label"),s=e.getAttribute("aria-describedby"),r=e.getAttribute("tabindex"),i=e.getAttribute("aria-hidden");return o&&n.push(`role="${o}"`),t&&n.push(`aria-label="${t}"`),s&&n.push(`aria-describedby="${s}"`),r&&n.push(`tabindex=${r}`),i==="true"&&n.push("aria-hidden"),e.matches("a, button, input, select, textarea, [tabindex]")&&n.push("focusable"),n.join(", ")}function co(e){let n=[],o=e;for(;o&&o.tagName.toLowerCase()!=="html";){let t=o.tagName.toLowerCase(),s=t;if(o.id)s=`${t}#${o.id}`;else if(o.className&&typeof o.className=="string"){let i=o.className.split(/\s+/).map(a=>a.replace(/[_][a-zA-Z0-9]{5,}.*$/,"")).find(a=>a.length>2);i&&(s=`${t}.${i}`)}let r=En(o);!o.parentElement&&r&&(s=`\u27E8shadow\u27E9 ${s}`),n.unshift(s),o=r}return n.join(" > ")}var j={FunctionComponent:0,ClassComponent:1,IndeterminateComponent:2,HostRoot:3,HostPortal:4,HostComponent:5,HostText:6,Fragment:7,Mode:8,ContextConsumer:9,ContextProvider:10,ForwardRef:11,Profiler:12,SuspenseComponent:13,MemoComponent:14,SimpleMemoComponent:15,LazyComponent:16,IncompleteClassComponent:17,DehydratedFragment:18,SuspenseListComponent:19,ScopeComponent:21,OffscreenComponent:22,LegacyHiddenComponent:23,CacheComponent:24,TracingMarkerComponent:25,HostHoistable:26,HostSingleton:27,IncompleteFunctionComponent:28,Throw:29,ViewTransitionComponent:30,ActivityComponent:31},uo=new Set(["Component","PureComponent","Fragment","Suspense","Profiler","StrictMode","Routes","Route","Outlet","Root","ErrorBoundaryHandler","HotReload","Hot"]),_o=[/Boundary$/,/BoundaryHandler$/,/Provider$/,/Consumer$/,/^(Inner|Outer)/,/Router$/,/^Client(Page|Segment|Root)/,/^Segment(ViewNode|Node)$/,/^LayoutSegment/,/^Server(Root|Component|Render)/,/^RSC/,/Context$/,/^Hot(Reload)?$/,/^(Dev|React)(Overlay|Tools|Root)/,/Overlay$/,/Handler$/,/^With[A-Z]/,/Wrapper$/,/^Root$/],Ss=[/Page$/,/View$/,/Screen$/,/Section$/,/Card$/,/List$/,/Item$/,/Form$/,/Modal$/,/Dialog$/,/Button$/,/Nav$/,/Header$/,/Footer$/,/Layout$/,/Panel$/,/Tab$/,/Menu$/];function Ns(e){let n=e?.mode??"filtered",o=uo;if(e?.skipExact){let t=e.skipExact instanceof Set?e.skipExact:new Set(e.skipExact);o=new Set([...uo,...t])}return{maxComponents:e?.maxComponents??6,maxDepth:e?.maxDepth??30,mode:n,skipExact:o,skipPatterns:e?.skipPatterns?[..._o,...e.skipPatterns]:_o,userPatterns:e?.userPatterns??Ss,filter:e?.filter}}function Ls(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase()}function Ts(e,n=10){let o=new Set,t=e,s=0;for(;t&&s<n;)t.className&&typeof t.className=="string"&&t.className.split(/\s+/).forEach(r=>{if(r.length>1){let i=r.replace(/[_][a-zA-Z0-9]{5,}.*$/,"").toLowerCase();i.length>1&&o.add(i)}}),t=t.parentElement,s++;return o}function Is(e,n){let o=Ls(e);for(let t of n){if(t===o)return!0;let s=o.split("-").filter(i=>i.length>2),r=t.split("-").filter(i=>i.length>2);for(let i of s)for(let a of r)if(i===a||i.includes(a)||a.includes(i))return!0}return!1}function Es(e,n,o,t){if(o.filter)return o.filter(e,n);switch(o.mode){case"all":return!0;case"filtered":return!(o.skipExact.has(e)||o.skipPatterns.some(s=>s.test(e)));case"smart":return o.skipExact.has(e)||o.skipPatterns.some(s=>s.test(e))?!1:!!(t&&Is(e,t)||o.userPatterns.some(s=>s.test(e)));default:return!0}}var un=null,Rs=new WeakMap;function bt(e){return Object.keys(e).some(n=>n.startsWith("__reactFiber$")||n.startsWith("__reactInternalInstance$")||n.startsWith("__reactProps$"))}function Ms(){if(un!==null)return un;if(typeof document>"u")return!1;if(document.body&&bt(document.body))return un=!0,!0;let e=["#root","#app","#__next","[data-reactroot]"];for(let n of e){let o=document.querySelector(n);if(o&&bt(o))return un=!0,!0}if(document.body){for(let n of document.body.children)if(bt(n))return un=!0,!0}return un=!1,!1}var Rn={map:Rs};function As(e){return Object.keys(e).find(o=>o.startsWith("__reactFiber$")||o.startsWith("__reactInternalInstance$"))||null}function Ps(e){let n=As(e);return n?e[n]:null}function sn(e){return e?e.displayName?e.displayName:e.name?e.name:null:null}function Fs(e){let{tag:n,type:o,elementType:t}=e;if(n===j.HostComponent||n===j.HostText||n===j.HostHoistable||n===j.HostSingleton||n===j.Fragment||n===j.Mode||n===j.Profiler||n===j.DehydratedFragment||n===j.HostRoot||n===j.HostPortal||n===j.ScopeComponent||n===j.OffscreenComponent||n===j.LegacyHiddenComponent||n===j.CacheComponent||n===j.TracingMarkerComponent||n===j.Throw||n===j.ViewTransitionComponent||n===j.ActivityComponent)return null;if(n===j.ForwardRef){let s=t;if(s?.render){let r=sn(s.render);if(r)return r}return s?.displayName?s.displayName:sn(o)}if(n===j.MemoComponent||n===j.SimpleMemoComponent){let s=t;if(s?.type){let r=sn(s.type);if(r)return r}return s?.displayName?s.displayName:sn(o)}if(n===j.ContextProvider){let s=o;return s?._context?.displayName?`${s._context.displayName}.Provider`:null}if(n===j.ContextConsumer){let s=o;return s?.displayName?`${s.displayName}.Consumer`:null}if(n===j.LazyComponent){let s=t;return s?._status===1&&s._result?sn(s._result):null}return n===j.SuspenseComponent||n===j.SuspenseListComponent?null:n===j.IncompleteClassComponent||n===j.IncompleteFunctionComponent||n===j.FunctionComponent||n===j.ClassComponent||n===j.IndeterminateComponent?sn(o):null}function $s(e){return e.length<=2||e.length<=3&&e===e.toLowerCase()}function mo(e,n){let o=Ns(n),t=o.mode==="all";if(t){let _=Rn.map.get(e);if(_!==void 0)return _}if(!Ms()){let _={path:null,components:[]};return t&&Rn.map.set(e,_),_}let s=o.mode==="smart"?Ts(e):void 0,r=[];try{let _=Ps(e),k=0;for(;_&&k<o.maxDepth&&r.length<o.maxComponents;){let v=Fs(_);v&&!$s(v)&&Es(v,k,o,s)&&r.push(v),_=_.return,k++}}catch{let _={path:null,components:[]};return t&&Rn.map.set(e,_),_}if(r.length===0){let _={path:null,components:[]};return t&&Rn.map.set(e,_),_}let a={path:r.slice().reverse().map(_=>`<${_}>`).join(" "),components:r};return t&&Rn.map.set(e,a),a}import Bs from"react";var Mn={FunctionComponent:0,ClassComponent:1,IndeterminateComponent:2,HostRoot:3,HostPortal:4,HostComponent:5,HostText:6,Fragment:7,Mode:8,ContextConsumer:9,ContextProvider:10,ForwardRef:11,Profiler:12,SuspenseComponent:13,MemoComponent:14,SimpleMemoComponent:15,LazyComponent:16};function Hs(e){if(!e||typeof e!="object")return null;let n=Object.keys(e),o=n.find(r=>r.startsWith("__reactFiber$"));if(o)return e[o]||null;let t=n.find(r=>r.startsWith("__reactInternalInstance$"));if(t)return e[t]||null;let s=n.find(r=>{if(!r.startsWith("__react"))return!1;let i=e[r];return i&&typeof i=="object"&&"_debugSource"in i});return s&&e[s]||null}function An(e){if(!e.type||typeof e.type=="string")return null;if(typeof e.type=="object"||typeof e.type=="function"){let n=e.type;if(n.displayName)return n.displayName;if(n.name)return n.name}return null}function zs(e,n=50){let o=e,t=0;for(;o&&t<n;){if(o._debugSource)return{source:o._debugSource,componentName:An(o)};if(o._debugOwner?._debugSource)return{source:o._debugOwner._debugSource,componentName:An(o._debugOwner)};o=o.return,t++}return null}function Ds(e){let n=e,o=0,t=50;for(;n&&o<t;){let s=n,r=["_debugSource","__source","_source","debugSource"];for(let i of r){let a=s[i];if(a&&typeof a=="object"&&"fileName"in a)return{source:a,componentName:An(n)}}if(n.memoizedProps){let i=n.memoizedProps;if(i.__source&&typeof i.__source=="object"){let a=i.__source;if(a.fileName&&a.lineNumber)return{source:{fileName:a.fileName,lineNumber:a.lineNumber,columnNumber:a.columnNumber},componentName:An(n)}}}n=n.return,o++}return null}var Gn=new Map;function js(e){let n=e.tag,o=e.type,t=e.elementType;if(typeof o=="string"||o==null||typeof o=="function"&&o.prototype?.isReactComponent)return null;if((n===Mn.FunctionComponent||n===Mn.IndeterminateComponent)&&typeof o=="function")return o;if(n===Mn.ForwardRef&&t){let s=t.render;if(typeof s=="function")return s}if((n===Mn.MemoComponent||n===Mn.SimpleMemoComponent)&&t){let s=t.type;if(typeof s=="function")return s}return typeof o=="function"?o:null}function Ws(){let e=Bs,n=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;if(n&&"H"in n)return{get:()=>n.H,set:t=>{n.H=t}};let o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;if(o){let t=o.ReactCurrentDispatcher;if(t&&"current"in t)return{get:()=>t.current,set:s=>{t.current=s}}}return null}function Os(e){let n=e.split(`
333
- `),o=[/source-location/,/\/dist\/index\./,/\/dist\/react\./,/node_modules\//,/react-dom/,/react\.development/,/react\.production/,/chunk-[A-Z0-9]+/i,/react-stack-bottom-frame/,/react-reconciler/,/scheduler/,/at <anonymous>:/],t=/^\s*at\s+(?:.*?\s+\()?(.+?):(\d+):(\d+)\)?$/,s=/^[^@]*@(.+?):(\d+):(\d+)$/,r=0;for(let i of n){let a=i.trim();if(!a||o.some(k=>k.test(a)))continue;let _=t.exec(a)||s.exec(a);if(_&&(r++,r>=3))return{fileName:_[1],line:parseInt(_[2],10),column:parseInt(_[3],10)}}return null}function Vs(e){let n=e;return n=n.replace(/[?#].*$/,""),n=n.replace(/^turbopack:\/\/\/\[project\]\//,""),n=n.replace(/^webpack-internal:\/\/\/\.\//,""),n=n.replace(/^webpack-internal:\/\/\//,""),n=n.replace(/^webpack:\/\/\/\.\//,""),n=n.replace(/^webpack:\/\/\//,""),n=n.replace(/^turbopack:\/\/\//,""),n=n.replace(/^https?:\/\/[^/]+\//,""),n=n.replace(/^file:\/\/\//,"/"),n=n.replace(/^\([^)]+\)\/\.\//,""),n=n.replace(/^\.\//,""),n}function Us(e){let n=js(e);if(!n)return null;if(Gn.has(n))return Gn.get(n);let o=Ws();if(!o)return Gn.set(n,null),null;let t=o.get(),s=null;try{let r=new Proxy({},{get(){throw new Error("probe")}});o.set(r);try{n({})}catch(i){if(i instanceof Error&&i.stack){let a=Os(i.stack);a&&(s={fileName:Vs(a.fileName),lineNumber:a.line,columnNumber:a.column,componentName:An(e)||void 0})}}}finally{o.set(t)}return Gn.set(n,s),s}function Ks(e,n=15){let o=[],t=new Set,s=e,r=0;for(;s&&r<n;){let i=Us(s);i&&!t.has(i.fileName)&&(t.add(i.fileName),o.push(i)),s=s.return,r++}return o}function Pn(e){let n=Hs(e);if(!n)return{found:!1,reason:"no-fiber",isReactApp:!1,isProduction:!1};let o=zs(n);if(o||(o=Ds(n)),o?.source)return{found:!0,source:{fileName:o.source.fileName,lineNumber:o.source.lineNumber,columnNumber:o.source.columnNumber,componentName:o.componentName||void 0},isReactApp:!0,isProduction:!1};let t=Ks(n);return t.length>0?{found:!0,source:t[0],sourceCandidates:t,isReactApp:!0,isProduction:!1}:{found:!1,reason:"no-debug-source",isReactApp:!0,isProduction:!1}}function Jn(e,n="path"){let{fileName:o,lineNumber:t,columnNumber:s}=e,r=`${o}:${t}`;return s!==void 0&&(r+=`:${s}`),n==="vscode"?`vscode://file${o.startsWith("/")?"":"/"}${r}`:r}function xt(e,n=10){let o=e,t=0;for(;o&&t<n;){let s=Pn(o);if(s.found)return s;o=o.parentElement,t++}return Pn(e)}async function et(e,n={}){let{quality:o=.7,maxScale:t=2}=n,s=(await import("html2canvas-pro")).default;return(await s(e,{useCORS:!0,allowTaint:!0,scale:Math.min(window.devicePixelRatio,t),logging:!1})).toDataURL("image/jpeg",o)}async function po(e={}){let{quality:n=.5,hideSelectors:o=[]}=e,s=[...["[data-impakers-debug]","[data-annotation-popup]","[data-annotation-marker]"],...o],r=document.querySelectorAll(s.join(", "));try{r.forEach(_=>_.style.visibility="hidden");let i=(await import("html2canvas-pro")).default;return(await i(document.body,{useCORS:!0,allowTaint:!0,scale:1,logging:!1,width:window.innerWidth,height:window.innerHeight})).toDataURL("image/jpeg",n)}catch{return}finally{r.forEach(i=>i.style.visibility="")}}var Te=[],$n=[],fo=!1;function kt(e){return e.map(n=>{if(n instanceof Error)return`${n.message}
332
+ }`,ps={popup:"styles-module__popup___IhzrD",enter:"styles-module__enter___L7U7N",popupEnter:"styles-module__popupEnter___AuQDN",entered:"styles-module__entered___COX-w",exit:"styles-module__exit___5eGjE",popupExit:"styles-module__popupExit___JJKQX",shake:"styles-module__shake___jdbWe",header:"styles-module__header___wWsSi",element:"styles-module__element___fTV2z",headerToggle:"styles-module__headerToggle___WpW0b",chevron:"styles-module__chevron___ZZJlR",expanded:"styles-module__expanded___2Hxgv",stylesWrapper:"styles-module__stylesWrapper___pnHgy",stylesInner:"styles-module__stylesInner___YYZe2",stylesBlock:"styles-module__stylesBlock___VfQKn",styleLine:"styles-module__styleLine___1YQiD",styleProperty:"styles-module__styleProperty___84L1i",styleValue:"styles-module__styleValue___q51-h",timestamp:"styles-module__timestamp___Dtpsv",quote:"styles-module__quote___mcMmQ",textarea:"styles-module__textarea___jrSae",green:"styles-module__green___99l3h",actions:"styles-module__actions___D6x3f",cancel:"styles-module__cancel___hRjnL",submit:"styles-module__submit___K-mIR",shortcutHint:"styles-module__shortcutHint___ihsrd",deleteWrapper:"styles-module__deleteWrapper___oSjdo",deleteButton:"styles-module__deleteButton___4VuAE",light:"styles-module__light___6AaSQ"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-annotation-popup-css-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-annotation-popup-css-styles",document.head.appendChild(e)),e.textContent=ms}var U=ps;import{jsx as Jt,jsxs as Ci}from"react/jsx-runtime";var eo=({size:e=24})=>Jt("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Jt("path",{d:"M13.5 4C14.7426 4 15.75 5.00736 15.75 6.25V7H18.5C18.9142 7 19.25 7.33579 19.25 7.75C19.25 8.16421 18.9142 8.5 18.5 8.5H17.9678L17.6328 16.2217C17.61 16.7475 17.5912 17.1861 17.5469 17.543C17.5015 17.9087 17.4225 18.2506 17.2461 18.5723C16.9747 19.0671 16.5579 19.4671 16.0518 19.7168C15.7227 19.8791 15.3772 19.9422 15.0098 19.9717C14.6514 20.0004 14.2126 20 13.6865 20H10.3135C9.78735 20 9.34856 20.0004 8.99023 19.9717C8.62278 19.9422 8.27729 19.8791 7.94824 19.7168C7.44205 19.4671 7.02532 19.0671 6.75391 18.5723C6.57751 18.2506 6.49853 17.9087 6.45312 17.543C6.40883 17.1861 6.39005 16.7475 6.36719 16.2217L6.03223 8.5H5.5C5.08579 8.5 4.75 8.16421 4.75 7.75C4.75 7.33579 5.08579 7 5.5 7H8.25V6.25C8.25 5.00736 9.25736 4 10.5 4H13.5ZM7.86621 16.1562C7.89013 16.7063 7.90624 17.0751 7.94141 17.3584C7.97545 17.6326 8.02151 17.7644 8.06934 17.8516C8.19271 18.0763 8.38239 18.2577 8.6123 18.3711C8.70153 18.4151 8.83504 18.4545 9.11035 18.4766C9.39482 18.4994 9.76335 18.5 10.3135 18.5H13.6865C14.2367 18.5 14.6052 18.4994 14.8896 18.4766C15.165 18.4545 15.2985 18.4151 15.3877 18.3711C15.6176 18.2577 15.8073 18.0763 15.9307 17.8516C15.9785 17.7644 16.0245 17.6326 16.0586 17.3584C16.0938 17.0751 16.1099 16.7063 16.1338 16.1562L16.4668 8.5H7.5332L7.86621 16.1562ZM9.97656 10.75C10.3906 10.7371 10.7371 11.0626 10.75 11.4766L10.875 15.4766C10.8879 15.8906 10.5624 16.2371 10.1484 16.25C9.73443 16.2629 9.38794 15.9374 9.375 15.5234L9.25 11.5234C9.23706 11.1094 9.56255 10.7629 9.97656 10.75ZM14.0244 10.75C14.4383 10.7635 14.7635 11.1105 14.75 11.5244L14.6201 15.5244C14.6066 15.9384 14.2596 16.2634 13.8457 16.25C13.4317 16.2365 13.1067 15.8896 13.1201 15.4756L13.251 11.4756C13.2645 11.0617 13.6105 10.7366 14.0244 10.75ZM10.5 5.5C10.0858 5.5 9.75 5.83579 9.75 6.25V7H14.25V6.25C14.25 5.83579 13.9142 5.5 13.5 5.5H10.5Z",fill:"currentColor"})});var fs=["data-feedback-toolbar","data-annotation-popup","data-annotation-marker"],Si=fs.flatMap(e=>[`:not([${e}])`,`:not([${e}] *)`]).join("");var ht="__agentation_freeze";function gs(){if(typeof window>"u")return{frozen:!1,installed:!0,origSetTimeout:setTimeout,origSetInterval:setInterval,origRAF:n=>0,pausedAnimations:[],frozenTimeoutQueue:[],frozenRAFQueue:[]};let e=window;return e[ht]||(e[ht]={frozen:!1,installed:!1,origSetTimeout:null,origSetInterval:null,origRAF:null,pausedAnimations:[],frozenTimeoutQueue:[],frozenRAFQueue:[]}),e[ht]}var ge=gs();typeof window<"u"&&!ge.installed&&(ge.origSetTimeout=window.setTimeout.bind(window),ge.origSetInterval=window.setInterval.bind(window),ge.origRAF=window.requestAnimationFrame.bind(window),window.setTimeout=(e,n,...o)=>typeof e=="string"?ge.origSetTimeout(e,n):ge.origSetTimeout((...t)=>{ge.frozen?ge.frozenTimeoutQueue.push(()=>e(...t)):e(...t)},n,...o),window.setInterval=(e,n,...o)=>typeof e=="string"?ge.origSetInterval(e,n):ge.origSetInterval((...t)=>{ge.frozen||e(...t)},n,...o),window.requestAnimationFrame=e=>ge.origRAF(n=>{ge.frozen?ge.frozenRAFQueue.push(e):e(n)}),ge.installed=!0);var Ne=ge.origSetTimeout,Ni=ge.origSetInterval,Li=ge.origRAF;import{jsx as Ce,jsxs as tn}from"react/jsx-runtime";function yt(e){if(!e)return;let n=o=>o.stopImmediatePropagation();document.addEventListener("focusin",n,!0),document.addEventListener("focusout",n,!0);try{e.focus()}finally{document.removeEventListener("focusin",n,!0),document.removeEventListener("focusout",n,!0)}}var to=hs(function({element:n,timestamp:o,selectedText:t,placeholder:s="What should change?",initialValue:r="",submitLabel:i="Add",onSubmit:a,onCancel:_,onDelete:k,style:v,accentColor:C="#3c82f7",isExiting:w=!1,lightMode:B=!1,computedStyles:R},D){let[K,ce]=In(r),[ue,re]=In(!1),[A,M]=In("initial"),[Y,h]=In(!1),[z,T]=In(!1),_e=qn(null),I=qn(null),J=qn(null),oe=qn(null);no(()=>{w&&A!=="exit"&&M("exit")},[w,A]),no(()=>{Ne(()=>{M("enter")},0);let x=Ne(()=>{M("entered")},200),ee=Ne(()=>{let p=_e.current;p&&(yt(p),p.selectionStart=p.selectionEnd=p.value.length,p.scrollTop=p.scrollHeight)},50);return()=>{clearTimeout(x),clearTimeout(ee),J.current&&clearTimeout(J.current),oe.current&&clearTimeout(oe.current)}},[]);let me=Gn(()=>{oe.current&&clearTimeout(oe.current),re(!0),oe.current=Ne(()=>{re(!1),yt(_e.current)},250)},[]);ys(D,()=>({shake:me}),[me]);let Me=Gn(()=>{M("exit"),J.current=Ne(()=>{_()},150)},[_]),we=Gn(()=>{K.trim()&&a(K.trim())},[K,a]),pe=Gn(x=>{x.stopPropagation(),!x.nativeEvent.isComposing&&(x.key==="Enter"&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),we()),x.key==="Escape"&&Me())},[we,Me]),b=[U.popup,B?U.light:"",A==="enter"?U.enter:"",A==="entered"?U.entered:"",A==="exit"?U.exit:"",ue?U.shake:""].filter(Boolean).join(" ");return tn("div",{ref:I,className:b,"data-annotation-popup":!0,style:v,onClick:x=>x.stopPropagation(),children:[tn("div",{className:U.header,children:[R&&Object.keys(R).length>0?tn("button",{className:U.headerToggle,onClick:()=>{let x=z;T(!z),x&&Ne(()=>yt(_e.current),0)},type:"button",children:[Ce("svg",{className:`${U.chevron} ${z?U.expanded:""}`,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:Ce("path",{d:"M5.5 10.25L9 7.25L5.75 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Ce("span",{className:U.element,children:n})]}):Ce("span",{className:U.element,children:n}),o&&Ce("span",{className:U.timestamp,children:o})]}),R&&Object.keys(R).length>0&&Ce("div",{className:`${U.stylesWrapper} ${z?U.expanded:""}`,children:Ce("div",{className:U.stylesInner,children:Ce("div",{className:U.stylesBlock,children:Object.entries(R).map(([x,ee])=>tn("div",{className:U.styleLine,children:[Ce("span",{className:U.styleProperty,children:x.replace(/([A-Z])/g,"-$1").toLowerCase()}),": ",Ce("span",{className:U.styleValue,children:ee}),";"]},x))})})}),t&&tn("div",{className:U.quote,children:["\u201C",t.slice(0,80),t.length>80?"...":"","\u201D"]}),Ce("textarea",{ref:_e,className:U.textarea,style:{borderColor:Y?C:void 0},placeholder:s,value:K,onChange:x=>{ce(x.target.value);let ee=x.target;ee.style.height="auto",ee.style.height=`${Math.min(ee.scrollHeight,200)}px`},onFocus:()=>h(!0),onBlur:()=>h(!1),rows:4,onKeyDown:pe}),tn("div",{className:U.actions,children:[k&&Ce("div",{className:U.deleteWrapper,children:Ce("button",{className:U.deleteButton,onClick:k,type:"button",children:Ce(eo,{size:22})})}),Ce("button",{className:U.cancel,onClick:Me,children:"Cancel"}),Ce("button",{className:U.submit,style:{backgroundColor:C,opacity:K.trim()?1:.4},onClick:we,disabled:!K.trim(),children:i})]}),tn("div",{className:U.shortcutHint,children:[navigator?.platform?.includes("Mac")?"\u2318":"Ctrl","+Enter to submit"]})]})});function En(e){if(e.parentElement)return e.parentElement;let n=e.getRootNode();return n instanceof ShadowRoot?n.host:null}function on(e,n){let o=e;for(;o;){if(o.matches(n))return o;o=En(o)}return null}function bs(e,n=4){let o=[],t=e,s=0;for(;t&&s<n;){let r=t.tagName.toLowerCase();if(r==="html"||r==="body")break;let i=r;if(t.id)i=`#${t.id}`;else if(t.className&&typeof t.className=="string"){let _=t.className.split(/\s+/).find(k=>k.length>2&&!k.match(/^[a-z]{1,2}$/)&&!k.match(/[A-Z0-9]{5,}/));_&&(i=`.${_.split("_")[0]}`)}let a=En(t);!t.parentElement&&a&&(i=`\u27E8shadow\u27E9 ${i}`),o.unshift(i),t=a,s++}return o.join(" > ")}function bt(e){let n=bs(e);if(e.dataset.element)return{name:e.dataset.element,path:n};let o=e.tagName.toLowerCase();if(["path","circle","rect","line","g"].includes(o)){let t=on(e,"svg");if(t){let s=En(t);if(s instanceof HTMLElement)return{name:`graphic in ${bt(s).name}`,path:n}}return{name:"graphic element",path:n}}if(o==="svg"){let t=En(e);if(t?.tagName.toLowerCase()==="button"){let s=t.textContent?.trim();return{name:s?`icon in "${s}" button`:"button icon",path:n}}return{name:"icon",path:n}}if(o==="button"){let t=e.textContent?.trim(),s=e.getAttribute("aria-label");return s?{name:`button [${s}]`,path:n}:{name:t?`button "${t.slice(0,25)}"`:"button",path:n}}if(o==="a"){let t=e.textContent?.trim(),s=e.getAttribute("href");return t?{name:`link "${t.slice(0,25)}"`,path:n}:s?{name:`link to ${s.slice(0,30)}`,path:n}:{name:"link",path:n}}if(o==="input"){let t=e.getAttribute("type")||"text",s=e.getAttribute("placeholder"),r=e.getAttribute("name");return s?{name:`input "${s}"`,path:n}:r?{name:`input [${r}]`,path:n}:{name:`${t} input`,path:n}}if(["h1","h2","h3","h4","h5","h6"].includes(o)){let t=e.textContent?.trim();return{name:t?`${o} "${t.slice(0,35)}"`:o,path:n}}if(o==="p"){let t=e.textContent?.trim();return t?{name:`paragraph: "${t.slice(0,40)}${t.length>40?"...":""}"`,path:n}:{name:"paragraph",path:n}}if(o==="span"||o==="label"){let t=e.textContent?.trim();return t&&t.length<40?{name:`"${t}"`,path:n}:{name:o,path:n}}if(o==="li"){let t=e.textContent?.trim();return t&&t.length<40?{name:`list item: "${t.slice(0,35)}"`,path:n}:{name:"list item",path:n}}if(o==="blockquote")return{name:"blockquote",path:n};if(o==="code"){let t=e.textContent?.trim();return t&&t.length<30?{name:`code: \`${t}\``,path:n}:{name:"code",path:n}}if(o==="pre")return{name:"code block",path:n};if(o==="img"){let t=e.getAttribute("alt");return{name:t?`image "${t.slice(0,30)}"`:"image",path:n}}if(o==="video")return{name:"video",path:n};if(["div","section","article","nav","header","footer","aside","main"].includes(o)){let t=e.className,s=e.getAttribute("role"),r=e.getAttribute("aria-label");if(r)return{name:`${o} [${r}]`,path:n};if(s)return{name:`${s}`,path:n};if(typeof t=="string"&&t){let i=t.split(/[\s_-]+/).map(a=>a.replace(/[A-Z0-9]{5,}.*$/,"")).filter(a=>a.length>2&&!/^[a-z]{1,2}$/.test(a)).slice(0,2);if(i.length>0)return{name:i.join(" "),path:n}}return{name:o==="div"?"container":o,path:n}}return{name:o,path:n}}function oo(e){let n=[],o=e.textContent?.trim();o&&o.length<100&&n.push(o);let t=e.previousElementSibling;if(t){let r=t.textContent?.trim();r&&r.length<50&&n.unshift(`[before: "${r.slice(0,40)}"]`)}let s=e.nextElementSibling;if(s){let r=s.textContent?.trim();r&&r.length<50&&n.push(`[after: "${r.slice(0,40)}"]`)}return n.join(" ")}function so(e){let n=e.className;return typeof n!="string"||!n?"":n.split(/\s+/).filter(t=>t.length>0).map(t=>{let s=t.match(/^([a-zA-Z][a-zA-Z0-9_-]*?)(?:_[a-zA-Z0-9]{5,})?$/);return s?s[1]:t}).filter((t,s,r)=>r.indexOf(t)===s).join(", ")}var ro=new Set(["none","normal","auto","0px","rgba(0, 0, 0, 0)","transparent","static","visible"]),xs=new Set(["p","span","h1","h2","h3","h4","h5","h6","label","li","td","th","blockquote","figcaption","caption","legend","dt","dd","pre","code","em","strong","b","i","a","time","cite","q"]),ks=new Set(["input","textarea","select"]),vs=new Set(["img","video","canvas","svg"]),Cs=new Set(["div","section","article","nav","header","footer","aside","main","ul","ol","form","fieldset"]);function io(e){if(typeof window>"u")return{};let n=window.getComputedStyle(e),o={},t=e.tagName.toLowerCase(),s;xs.has(t)?s=["color","fontSize","fontWeight","fontFamily","lineHeight"]:t==="button"||t==="a"&&e.getAttribute("role")==="button"?s=["backgroundColor","color","padding","borderRadius","fontSize"]:ks.has(t)?s=["backgroundColor","color","padding","borderRadius","fontSize"]:vs.has(t)?s=["width","height","objectFit","borderRadius"]:Cs.has(t)?s=["display","padding","margin","gap","backgroundColor"]:s=["color","fontSize","margin","padding","backgroundColor"];for(let r of s){let i=r.replace(/([A-Z])/g,"-$1").toLowerCase(),a=n.getPropertyValue(i);a&&!ro.has(a)&&(o[r]=a)}return o}var ws=["color","backgroundColor","borderColor","fontSize","fontWeight","fontFamily","lineHeight","letterSpacing","textAlign","width","height","padding","margin","border","borderRadius","display","position","top","right","bottom","left","zIndex","flexDirection","justifyContent","alignItems","gap","opacity","visibility","overflow","boxShadow","transform"];function ao(e){if(typeof window>"u")return"";let n=window.getComputedStyle(e),o=[];for(let t of ws){let s=t.replace(/([A-Z])/g,"-$1").toLowerCase(),r=n.getPropertyValue(s);r&&!ro.has(r)&&o.push(`${s}: ${r}`)}return o.join("; ")}function lo(e){let n=[],o=e.getAttribute("role"),t=e.getAttribute("aria-label"),s=e.getAttribute("aria-describedby"),r=e.getAttribute("tabindex"),i=e.getAttribute("aria-hidden");return o&&n.push(`role="${o}"`),t&&n.push(`aria-label="${t}"`),s&&n.push(`aria-describedby="${s}"`),r&&n.push(`tabindex=${r}`),i==="true"&&n.push("aria-hidden"),e.matches("a, button, input, select, textarea, [tabindex]")&&n.push("focusable"),n.join(", ")}function co(e){let n=[],o=e;for(;o&&o.tagName.toLowerCase()!=="html";){let t=o.tagName.toLowerCase(),s=t;if(o.id)s=`${t}#${o.id}`;else if(o.className&&typeof o.className=="string"){let i=o.className.split(/\s+/).map(a=>a.replace(/[_][a-zA-Z0-9]{5,}.*$/,"")).find(a=>a.length>2);i&&(s=`${t}.${i}`)}let r=En(o);!o.parentElement&&r&&(s=`\u27E8shadow\u27E9 ${s}`),n.unshift(s),o=r}return n.join(" > ")}var W={FunctionComponent:0,ClassComponent:1,IndeterminateComponent:2,HostRoot:3,HostPortal:4,HostComponent:5,HostText:6,Fragment:7,Mode:8,ContextConsumer:9,ContextProvider:10,ForwardRef:11,Profiler:12,SuspenseComponent:13,MemoComponent:14,SimpleMemoComponent:15,LazyComponent:16,IncompleteClassComponent:17,DehydratedFragment:18,SuspenseListComponent:19,ScopeComponent:21,OffscreenComponent:22,LegacyHiddenComponent:23,CacheComponent:24,TracingMarkerComponent:25,HostHoistable:26,HostSingleton:27,IncompleteFunctionComponent:28,Throw:29,ViewTransitionComponent:30,ActivityComponent:31},uo=new Set(["Component","PureComponent","Fragment","Suspense","Profiler","StrictMode","Routes","Route","Outlet","Root","ErrorBoundaryHandler","HotReload","Hot"]),_o=[/Boundary$/,/BoundaryHandler$/,/Provider$/,/Consumer$/,/^(Inner|Outer)/,/Router$/,/^Client(Page|Segment|Root)/,/^Segment(ViewNode|Node)$/,/^LayoutSegment/,/^Server(Root|Component|Render)/,/^RSC/,/Context$/,/^Hot(Reload)?$/,/^(Dev|React)(Overlay|Tools|Root)/,/Overlay$/,/Handler$/,/^With[A-Z]/,/Wrapper$/,/^Root$/],Ss=[/Page$/,/View$/,/Screen$/,/Section$/,/Card$/,/List$/,/Item$/,/Form$/,/Modal$/,/Dialog$/,/Button$/,/Nav$/,/Header$/,/Footer$/,/Layout$/,/Panel$/,/Tab$/,/Menu$/];function Ns(e){let n=e?.mode??"filtered",o=uo;if(e?.skipExact){let t=e.skipExact instanceof Set?e.skipExact:new Set(e.skipExact);o=new Set([...uo,...t])}return{maxComponents:e?.maxComponents??6,maxDepth:e?.maxDepth??30,mode:n,skipExact:o,skipPatterns:e?.skipPatterns?[..._o,...e.skipPatterns]:_o,userPatterns:e?.userPatterns??Ss,filter:e?.filter}}function Ls(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase()}function Ts(e,n=10){let o=new Set,t=e,s=0;for(;t&&s<n;)t.className&&typeof t.className=="string"&&t.className.split(/\s+/).forEach(r=>{if(r.length>1){let i=r.replace(/[_][a-zA-Z0-9]{5,}.*$/,"").toLowerCase();i.length>1&&o.add(i)}}),t=t.parentElement,s++;return o}function Is(e,n){let o=Ls(e);for(let t of n){if(t===o)return!0;let s=o.split("-").filter(i=>i.length>2),r=t.split("-").filter(i=>i.length>2);for(let i of s)for(let a of r)if(i===a||i.includes(a)||a.includes(i))return!0}return!1}function Es(e,n,o,t){if(o.filter)return o.filter(e,n);switch(o.mode){case"all":return!0;case"filtered":return!(o.skipExact.has(e)||o.skipPatterns.some(s=>s.test(e)));case"smart":return o.skipExact.has(e)||o.skipPatterns.some(s=>s.test(e))?!1:!!(t&&Is(e,t)||o.userPatterns.some(s=>s.test(e)));default:return!0}}var un=null,Rs=new WeakMap;function xt(e){return Object.keys(e).some(n=>n.startsWith("__reactFiber$")||n.startsWith("__reactInternalInstance$")||n.startsWith("__reactProps$"))}function Ms(){if(un!==null)return un;if(typeof document>"u")return!1;if(document.body&&xt(document.body))return un=!0,!0;let e=["#root","#app","#__next","[data-reactroot]"];for(let n of e){let o=document.querySelector(n);if(o&&xt(o))return un=!0,!0}if(document.body){for(let n of document.body.children)if(xt(n))return un=!0,!0}return un=!1,!1}var Rn={map:Rs};function As(e){return Object.keys(e).find(o=>o.startsWith("__reactFiber$")||o.startsWith("__reactInternalInstance$"))||null}function Ps(e){let n=As(e);return n?e[n]:null}function sn(e){return e?e.displayName?e.displayName:e.name?e.name:null:null}function Fs(e){let{tag:n,type:o,elementType:t}=e;if(n===W.HostComponent||n===W.HostText||n===W.HostHoistable||n===W.HostSingleton||n===W.Fragment||n===W.Mode||n===W.Profiler||n===W.DehydratedFragment||n===W.HostRoot||n===W.HostPortal||n===W.ScopeComponent||n===W.OffscreenComponent||n===W.LegacyHiddenComponent||n===W.CacheComponent||n===W.TracingMarkerComponent||n===W.Throw||n===W.ViewTransitionComponent||n===W.ActivityComponent)return null;if(n===W.ForwardRef){let s=t;if(s?.render){let r=sn(s.render);if(r)return r}return s?.displayName?s.displayName:sn(o)}if(n===W.MemoComponent||n===W.SimpleMemoComponent){let s=t;if(s?.type){let r=sn(s.type);if(r)return r}return s?.displayName?s.displayName:sn(o)}if(n===W.ContextProvider){let s=o;return s?._context?.displayName?`${s._context.displayName}.Provider`:null}if(n===W.ContextConsumer){let s=o;return s?.displayName?`${s.displayName}.Consumer`:null}if(n===W.LazyComponent){let s=t;return s?._status===1&&s._result?sn(s._result):null}return n===W.SuspenseComponent||n===W.SuspenseListComponent?null:n===W.IncompleteClassComponent||n===W.IncompleteFunctionComponent||n===W.FunctionComponent||n===W.ClassComponent||n===W.IndeterminateComponent?sn(o):null}function $s(e){return e.length<=2||e.length<=3&&e===e.toLowerCase()}function mo(e,n){let o=Ns(n),t=o.mode==="all";if(t){let _=Rn.map.get(e);if(_!==void 0)return _}if(!Ms()){let _={path:null,components:[]};return t&&Rn.map.set(e,_),_}let s=o.mode==="smart"?Ts(e):void 0,r=[];try{let _=Ps(e),k=0;for(;_&&k<o.maxDepth&&r.length<o.maxComponents;){let v=Fs(_);v&&!$s(v)&&Es(v,k,o,s)&&r.push(v),_=_.return,k++}}catch{let _={path:null,components:[]};return t&&Rn.map.set(e,_),_}if(r.length===0){let _={path:null,components:[]};return t&&Rn.map.set(e,_),_}let a={path:r.slice().reverse().map(_=>`<${_}>`).join(" "),components:r};return t&&Rn.map.set(e,a),a}import Bs from"react";var Mn={FunctionComponent:0,ClassComponent:1,IndeterminateComponent:2,HostRoot:3,HostPortal:4,HostComponent:5,HostText:6,Fragment:7,Mode:8,ContextConsumer:9,ContextProvider:10,ForwardRef:11,Profiler:12,SuspenseComponent:13,MemoComponent:14,SimpleMemoComponent:15,LazyComponent:16};function Hs(e){if(!e||typeof e!="object")return null;let n=Object.keys(e),o=n.find(r=>r.startsWith("__reactFiber$"));if(o)return e[o]||null;let t=n.find(r=>r.startsWith("__reactInternalInstance$"));if(t)return e[t]||null;let s=n.find(r=>{if(!r.startsWith("__react"))return!1;let i=e[r];return i&&typeof i=="object"&&"_debugSource"in i});return s&&e[s]||null}function An(e){if(!e.type||typeof e.type=="string")return null;if(typeof e.type=="object"||typeof e.type=="function"){let n=e.type;if(n.displayName)return n.displayName;if(n.name)return n.name}return null}function zs(e,n=50){let o=e,t=0;for(;o&&t<n;){if(o._debugSource)return{source:o._debugSource,componentName:An(o)};if(o._debugOwner?._debugSource)return{source:o._debugOwner._debugSource,componentName:An(o._debugOwner)};o=o.return,t++}return null}function Ds(e){let n=e,o=0,t=50;for(;n&&o<t;){let s=n,r=["_debugSource","__source","_source","debugSource"];for(let i of r){let a=s[i];if(a&&typeof a=="object"&&"fileName"in a)return{source:a,componentName:An(n)}}if(n.memoizedProps){let i=n.memoizedProps;if(i.__source&&typeof i.__source=="object"){let a=i.__source;if(a.fileName&&a.lineNumber)return{source:{fileName:a.fileName,lineNumber:a.lineNumber,columnNumber:a.columnNumber},componentName:An(n)}}}n=n.return,o++}return null}var Jn=new Map;function js(e){let n=e.tag,o=e.type,t=e.elementType;if(typeof o=="string"||o==null||typeof o=="function"&&o.prototype?.isReactComponent)return null;if((n===Mn.FunctionComponent||n===Mn.IndeterminateComponent)&&typeof o=="function")return o;if(n===Mn.ForwardRef&&t){let s=t.render;if(typeof s=="function")return s}if((n===Mn.MemoComponent||n===Mn.SimpleMemoComponent)&&t){let s=t.type;if(typeof s=="function")return s}return typeof o=="function"?o:null}function Ws(){let e=Bs,n=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;if(n&&"H"in n)return{get:()=>n.H,set:t=>{n.H=t}};let o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;if(o){let t=o.ReactCurrentDispatcher;if(t&&"current"in t)return{get:()=>t.current,set:s=>{t.current=s}}}return null}function Os(e){let n=e.split(`
333
+ `),o=[/source-location/,/\/dist\/index\./,/\/dist\/react\./,/node_modules\//,/react-dom/,/react\.development/,/react\.production/,/chunk-[A-Z0-9]+/i,/react-stack-bottom-frame/,/react-reconciler/,/scheduler/,/at <anonymous>:/],t=/^\s*at\s+(?:.*?\s+\()?(.+?):(\d+):(\d+)\)?$/,s=/^[^@]*@(.+?):(\d+):(\d+)$/,r=0;for(let i of n){let a=i.trim();if(!a||o.some(k=>k.test(a)))continue;let _=t.exec(a)||s.exec(a);if(_&&(r++,r>=3))return{fileName:_[1],line:parseInt(_[2],10),column:parseInt(_[3],10)}}return null}function Vs(e){let n=e;return n=n.replace(/[?#].*$/,""),n=n.replace(/^turbopack:\/\/\/\[project\]\//,""),n=n.replace(/^webpack-internal:\/\/\/\.\//,""),n=n.replace(/^webpack-internal:\/\/\//,""),n=n.replace(/^webpack:\/\/\/\.\//,""),n=n.replace(/^webpack:\/\/\//,""),n=n.replace(/^turbopack:\/\/\//,""),n=n.replace(/^https?:\/\/[^/]+\//,""),n=n.replace(/^file:\/\/\//,"/"),n=n.replace(/^\([^)]+\)\/\.\//,""),n=n.replace(/^\.\//,""),n}function Us(e){let n=js(e);if(!n)return null;if(Jn.has(n))return Jn.get(n);let o=Ws();if(!o)return Jn.set(n,null),null;let t=o.get(),s=null;try{let r=new Proxy({},{get(){throw new Error("probe")}});o.set(r);try{n({})}catch(i){if(i instanceof Error&&i.stack){let a=Os(i.stack);a&&(s={fileName:Vs(a.fileName),lineNumber:a.line,columnNumber:a.column,componentName:An(e)||void 0})}}}finally{o.set(t)}return Jn.set(n,s),s}function Ks(e,n=15){let o=[],t=new Set,s=e,r=0;for(;s&&r<n;){let i=Us(s);i&&!t.has(i.fileName)&&(t.add(i.fileName),o.push(i)),s=s.return,r++}return o}function Pn(e){let n=Hs(e);if(!n)return{found:!1,reason:"no-fiber",isReactApp:!1,isProduction:!1};let o=zs(n);if(o||(o=Ds(n)),o?.source)return{found:!0,source:{fileName:o.source.fileName,lineNumber:o.source.lineNumber,columnNumber:o.source.columnNumber,componentName:o.componentName||void 0},isReactApp:!0,isProduction:!1};let t=Ks(n);return t.length>0?{found:!0,source:t[0],sourceCandidates:t,isReactApp:!0,isProduction:!1}:{found:!1,reason:"no-debug-source",isReactApp:!0,isProduction:!1}}function et(e,n="path"){let{fileName:o,lineNumber:t,columnNumber:s}=e,r=`${o}:${t}`;return s!==void 0&&(r+=`:${s}`),n==="vscode"?`vscode://file${o.startsWith("/")?"":"/"}${r}`:r}function kt(e,n=10){let o=e,t=0;for(;o&&t<n;){let s=Pn(o);if(s.found)return s;o=o.parentElement,t++}return Pn(e)}async function nt(e,n={}){let{quality:o=.7,maxScale:t=2}=n,s=(await import("html2canvas-pro")).default;return(await s(e,{useCORS:!0,allowTaint:!0,scale:Math.min(window.devicePixelRatio,t),logging:!1})).toDataURL("image/jpeg",o)}async function po(e={}){let{quality:n=.5,hideSelectors:o=[]}=e,s=[...["[data-impakers-debug]","[data-annotation-popup]","[data-annotation-marker]"],...o],r=document.querySelectorAll(s.join(", "));try{r.forEach(_=>_.style.visibility="hidden");let i=(await import("html2canvas-pro")).default;return(await i(document.body,{useCORS:!0,allowTaint:!0,scale:1,logging:!1,width:window.innerWidth,height:window.innerHeight})).toDataURL("image/jpeg",n)}catch{return}finally{r.forEach(i=>i.style.visibility="")}}var Te=[],$n=[],fo=!1;function vt(e){return e.map(n=>{if(n instanceof Error)return`${n.message}
334
334
  ${n.stack?.split(`
335
335
  `).slice(0,3).join(`
336
- `)}`;if(typeof n=="object"&&n!==null)try{return JSON.stringify(n).slice(0,300)}catch{return String(n)}return String(n)}).join(" ")}function Fn(e,n){$n.push({level:e,message:n.slice(0,500),timestamp:Date.now()}),$n.length>50&&$n.shift()}function Zs(){if(fo||typeof window>"u")return;fo=!0;let e=console.error,n=console.warn,o=console.log;console.error=(...t)=>{let s=kt(t);Te.push(s.slice(0,500)),Te.length>20&&Te.shift(),Fn("error",s),e.apply(console,t)},console.warn=(...t)=>{let s=kt(t);Te.push(`[warn] ${s}`.slice(0,500)),Te.length>20&&Te.shift(),Fn("warn",s),n.apply(console,t)},console.log=(...t)=>{Fn("log",kt(t)),o.apply(console,t)},window.addEventListener("error",t=>{let s=`${t.message} (${t.filename}:${t.lineno})`;Te.push(s.slice(0,500)),Te.length>20&&Te.shift(),Fn("error",s)}),window.addEventListener("unhandledrejection",t=>{let s=`Unhandled Promise: ${t.reason}`;Te.push(s.slice(0,500)),Te.length>20&&Te.shift(),Fn("error",s)})}Zs();function Xs(e){let n=e.match(/Edg\/(\d+[\d.]*)/);if(n)return`Edge ${n[1]}`;let o=e.match(/Chrome\/(\d+[\d.]*)/);if(o&&!e.includes("Edg/")&&!e.includes("OPR/"))return`Chrome ${o[1]}`;let t=e.match(/Firefox\/(\d+[\d.]*)/);if(t)return`Firefox ${t[1]}`;let s=e.match(/Version\/(\d+[\d.]*).*Safari/);if(s)return`Safari ${s[1]}`;let r=e.match(/OPR\/(\d+[\d.]*)/);return r?`Opera ${r[1]}`:e}var Ys=[/session/i,/csrf/i,/xsrf/i,/secret/i,/password/i,/key/i];function Qs(){if(typeof document>"u")return{};let e={};try{document.cookie.split(";").forEach(n=>{let[o,...t]=n.trim().split("=");if(!o)return;let s=o.trim(),r=Ys.some(i=>i.test(s));e[s]=r?"[masked]":decodeURIComponent(t.join("=")).slice(0,200)})}catch{}return e}function go(e){try{let n=e.split(".");if(n.length!==3)return null;let o=n[1].replace(/-/g,"+").replace(/_/g,"/"),t=o+"==".slice(0,(4-o.length%4)%4);return JSON.parse(atob(t))}catch{return null}}function qs(){if(typeof window>"u")return null;let e=["token","access_token","accessToken","auth_token","authToken","jwt","id_token","idToken"];for(let n of e)try{let o=localStorage.getItem(n);if(o){let t=o.startsWith('"')?JSON.parse(o):o,s=go(t);if(s){let r={},i=["sub","email","name","role","roles","org","iat","exp","aud","iss","user_id","user_role"];for(let a of i)a in s&&(r[a]=s[a]);return Object.keys(r).length>0?r:null}}}catch{continue}try{let n=document.cookie.split(";");for(let o of n){let[,...t]=o.trim().split("="),s=t.join("="),r=go(s);if(r&&r.sub){let i={},a=["sub","email","name","role","roles","org","iat","exp"];for(let _ of a)_ in r&&(i[_]=r[_]);return Object.keys(i).length>0?i:null}}}catch{}return null}function _n(e){let n=Math.round(e);return isNaN(n)||!isFinite(n)?void 0:n}function Gs(){if(typeof performance>"u")return{};let e={};try{let n=performance.getEntriesByType("navigation")[0];if(n){let s=_n(n.loadEventEnd-n.startTime),r=_n(n.domContentLoadedEventEnd-n.startTime),i=_n(n.responseStart-n.requestStart);s&&(e.pageLoadTime=s),r&&(e.domContentLoaded=r),i&&(e.ttfb=i)}let o=performance.getEntriesByName("first-contentful-paint")[0];if(o){let s=_n(o.startTime);s&&(e.firstContentfulPaint=s)}let t=performance.memory;if(t){let s=_n(t.usedJSHeapSize/1024/1024),r=_n(t.totalJSHeapSize/1024/1024);s&&(e.usedJSHeapMB=s),r&&(e.totalJSHeapMB=r)}}catch{}return e}function ho(e){let n={url:window.location.href,timestamp:new Date().toISOString(),browser:Xs(navigator.userAgent),userAgent:navigator.userAgent,viewport:`${window.innerWidth}x${window.innerHeight}`,pixelRatio:window.devicePixelRatio,language:navigator.language,referrer:document.referrer,cookies:Qs(),jwtClaims:qs()??void 0,consoleErrors:Te.length>0?[...Te]:void 0,consoleLogs:$n.length>0?[...$n]:void 0,performance:Gs()};if(e)try{let o=e();o&&(n.user={...o,id:String(o.id),name:String(o.name||"")})}catch{}return n}var Js="/_next/static/chunks/impakers-debug-route-manifest.json",nt=null,tt=!1;function yo(e){return!e||e==="/"?"/":e.endsWith("/")?e.slice(0,-1)||"/":e}function er(e){let n=yo(e);return n==="/"?[]:n.slice(1).split("/").map(o=>decodeURIComponent(o)).filter(Boolean)}function nr(e){return/^\[[^\]]+\]$/.test(e)}function tr(e){return/^\[\.\.\.[^\]]+\]$/.test(e)}function or(e){return/^\[\[\.\.\.[^\]]+\]\]$/.test(e)}function sr(e,n){let o=0,t=0,s=0;for(;o<e.length;){let r=e[o];if(or(r)){s+=1,t=n.length,o+=1;break}if(tr(r)){if(t>=n.length)return null;s+=2,t=n.length,o+=1;break}let i=n[t];if(i===void 0)return null;if(nr(r)){s+=5,o+=1,t+=1;continue}if(r!==i)return null;s+=20,o+=1,t+=1}return o!==e.length||t!==n.length?null:s}async function rr(){return tt?null:nt||(nt=(async()=>{try{let e=await fetch(Js,{cache:"force-cache"});if(!e.ok)return tt=!0,null;let n=await e.json();return!n||typeof n!="object"||!Array.isArray(n.entries)?(tt=!0,null):n}catch{return tt=!0,null}})(),nt)}function ir(e){let n=e.files.find(s=>s.kind==="page"),o=e.files.filter(s=>s.kind==="layout"),t=[];return n&&t.push({kind:"route-page",file:n.file,label:"Current page route",confidence:1,reason:"matched-current-url"}),o.forEach((s,r)=>{t.push({kind:"route-layout",file:s.file,label:r===o.length-1?"Nearest layout":"Ancestor layout",confidence:Math.max(.7,.95-r*.08),reason:"matched-layout-chain"})}),t}async function bo(e){if(typeof window>"u")return null;let n=e??window.location.pathname,o=await rr();if(!o)return null;let t=er(n),s=null,r=-1;for(let i of o.entries){let a=sr(i.segments,t);a!==null&&a>r&&(r=a,s=i)}return s?{targets:ir(s),context:{pathname:yo(n),matchedRoute:s.route,source:"next-route-manifest"}}:null}function xo(...e){let n=[],o=new Set;return e.forEach(t=>{t?.forEach(s=>{let r=`${s.kind}:${s.file}:${s.line??""}:${s.column??""}`;o.has(r)||(o.add(r),n.push(s))})}),n.sort((t,s)=>s.confidence-t.confidence)}function ko(){let e=en();if(!e)throw new Error("\uC778\uC99D\uC774 \uD544\uC694\uD569\uB2C8\uB2E4");return e}async function We(e,n={}){let o=ko(),t=await fetch(e,{...n,headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`,...n.headers}});if(!t.ok){if(t.status===401)throw new Error("\uC778\uC99D\uC774 \uB9CC\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");let s=await t.json().catch(()=>({error:"\uC694\uCCAD \uC2E4\uD328"}));throw new Error(s.error||s.message||"\uC694\uCCAD \uC2E4\uD328")}return t}var ot=new Map,vt=new Map,Bn=new Map,ar=3e4;function Ke(e){return`feedbacks:${e}`}function mn(){return"feedbacks:__all__"}function Xe(e){return`comments:${e}`}function ze(e,n){ot.set(e,{data:n,timestamp:Date.now()});let o=Bn.get(e);o&&o.forEach(t=>t(n))}function Ze(e){return ot.get(e)?.data??null}function lr(e){let n=ot.get(e);return n?Date.now()-n.timestamp<=ar:!1}function wt(e){return Array.from(ot.keys()).filter(n=>n.includes(e))}function dr(e){let n=new Map;for(let o of wt(e)){let t=Ze(o);t!==null&&n.set(o,t)}return n}function cr(e){e.forEach((n,o)=>ze(o,n))}function Ct(e,n){let o=n(Ze(e));return ze(e,o),o}function ur(e,n){for(let o of wt(e)){let t=Ze(o);t!==null&&ze(o,n(t))}}async function Hn(e,n){let o=vt.get(e);if(o)return o;let t=(async()=>{try{let s=await n();return ze(e,s),s}finally{vt.delete(e)}})();return vt.set(e,t),t}async function St(e,n,o={}){let t=Ze(e);return t!==null&&!o.force?((o.staleWhileRevalidate||!lr(e))&&Hn(e,n),t):Hn(e,n)}function zn(e,n){let o=Bn.get(e)||new Set;return o.add(n),Bn.set(e,o),()=>{let t=Bn.get(e);t&&(t.delete(n),t.size===0&&Bn.delete(e))}}function pn(e){return Ze(e)}async function vo(e,n){let o=`temp-task-${Date.now()}`,t=n.feedbackUrl,s=n.feedbackMarker,r=t?Ze(Ke(t))||[]:null,i=Ze(mn()),a=t?{id:o,taskNumber:0,title:n.title,status:"todo",priority:n.priority,feedbackUrl:t,feedbackMarker:s||null,createdAt:new Date().toISOString(),commentCount:0,_optimistic:!0}:null;t&&a&&(ze(Ke(t),[a,...r]),i&&ze(mn(),[a,...i]));try{let k=await(await We(e,{method:"POST",body:JSON.stringify(n)})).json().catch(()=>({}));if(t&&a){let v={...a,id:k.taskId||o,taskNumber:k.taskNumber||0,_optimistic:!1};Ct(Ke(t),C=>(C||[]).map(w=>w.id===o?v:w)),i&&Ct(mn(),C=>(C||[]).map(w=>w.id===o?v:w)),So(e,t).catch(()=>{}),i&&No(e).catch(()=>{})}return k}catch(_){throw t&&r&&ze(Ke(t),r),i&&ze(mn(),i),_}}async function Co(e,n,o={}){let t=Ke(n);return St(t,async()=>(await(await We(`${e}?url=${encodeURIComponent(n)}`)).json()).tasks||[],o)}async function wo(e,n={}){let o=mn();return St(o,async()=>(await(await We(`${e}?url=__all__`)).json()).tasks||[],n)}async function So(e,n){let o=Ke(n);return Hn(o,async()=>(await(await We(`${e}?url=${encodeURIComponent(n)}`)).json()).tasks||[])}async function No(e){let n=mn();return Hn(n,async()=>(await(await We(`${e}?url=__all__`)).json()).tasks||[])}async function st(e,n,o={}){let t=Xe(n);return St(t,async()=>(await(await We(`${e}/${n}/comments`)).json()).comments||[],o)}async function _r(e,n){let o=Xe(n);return Hn(o,async()=>(await(await We(`${e}/${n}/comments`)).json()).comments||[])}function mr(e,n){ur("feedbacks:",o=>o.map(t=>t.id===e?{...t,commentCount:Math.max(0,(t.commentCount||0)+n)}:t))}function pr(e){wt("feedbacks:").forEach(o=>{let t=o.replace("feedbacks:","");t==="__all__"?No(e).catch(()=>{}):So(e,t).catch(()=>{})})}async function rt(e,n,o,t,s,r,i){let a={id:`temp-${Date.now()}`,content:o,authorName:t,authorId:s,imageUrl:r||void 0,fileUrl:i?.url,fileName:i?.fileName,fileType:i?.fileType,fileSize:i?.fileSize,fileSource:i?.fileSource,createdAt:new Date().toISOString()},_=Xe(n),k=Ze(_)||[],v=dr("feedbacks:");ze(_,[...k,a]),mr(n,1);try{let B=(await(await We(`${e}/${n}/comments`,{method:"POST",body:JSON.stringify({content:o,authorName:t,authorId:s,screenshot:r,...i&&{fileUrl:i.url,fileName:i.fileName,fileType:i.fileType,fileSize:i.fileSize,fileSource:i.fileSource}})})).json()).comment;return Ct(_,M=>(M||[]).map(D=>D.id===a.id?B:D)),_r(e,n),pr(e),B}catch(C){throw ze(_,k),cr(v),C}}var fr=4.5*1024*1024;async function it(e,n,o,t){if(n.size>fr)throw new Error(`\uD30C\uC77C \uD06C\uAE30\uAC00 4.5MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4. (${(n.size/1024/1024).toFixed(1)}MB)`);let s=ko(),r=new FormData;r.append("file",n),r.append("context",o),t&&r.append("taskId",t);let i=await fetch(`${e}/upload`,{method:"POST",headers:{Authorization:`Bearer ${s}`},body:r});if(!i.ok){if(i.status===401)throw new Error("\uC778\uC99D\uC774 \uB9CC\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");if(i.status===413)throw new Error("\uD30C\uC77C \uD06C\uAE30\uAC00 4.5MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4.");let a=await i.json().catch(()=>({error:"\uD30C\uC77C \uC5C5\uB85C\uB4DC \uC2E4\uD328"}));throw new Error(a.error||"\uD30C\uC77C \uC5C5\uB85C\uB4DC \uC2E4\uD328")}return i.json()}async function at(e,n={}){let o=new URLSearchParams;n.since&&o.set("since",n.since),n.date&&o.set("date",n.date),n.limit&&o.set("limit",String(n.limit));let t=o.toString(),s=`${e}/history${t?`?${t}`:""}`;return(await(await We(s)).json()).events||[]}import{AnyMap as Lo,originalPositionFor as gr}from"@jridgewell/trace-mapping";var Dn=new Map,To=new Set;async function hr(e){try{let n=await fetch(e,{cache:"force-cache"});if(!n.ok)return null;let t=(await n.text()).match(/\/\/[#@]\s*sourceMappingURL\s*=\s*(\S+)\s*$/m);if(!t)return null;let s=t[1];return s.startsWith("http")?s:e.substring(0,e.lastIndexOf("/")+1)+s}catch{return null}}async function yr(e){if(Dn.has(e))return Dn.get(e)??null;if(To.has(e))return null;let n=e.endsWith(".map")?e:`${e}.map`;try{let t=await fetch(n,{cache:"force-cache"});if(t.ok){let s=await t.json(),r=new Lo(s);return Dn.set(e,r),r}}catch{}let o=await hr(e);if(o)try{let t=await fetch(o,{cache:"force-cache"});if(t.ok){let s=await t.json(),r=new Lo(s);return Dn.set(e,r),r}}catch{}return To.add(e),Dn.set(e,null),null}async function br(e,n,o){let t;try{e.startsWith("http")?t=e:t=new URL(e,window.location.origin).href}catch{return null}let s=await yr(t);if(!s)return null;try{let r=gr(s,{line:n,column:o});if(!r.source)return null;let i=r.source;return i=i.replace(/^webpack:\/\/\//,""),i=i.replace(/^turbopack:\/\/\//,""),i=i.replace(/^\[project\]\//,""),i=i.replace(/^\.\//,""),i.includes("node_modules/")?null:{source:i,line:r.line??0,column:r.column??0,name:r.name??null}}catch{return null}}async function Nt(e){if(!e)return null;let n=e.match(/^(.+):(\d+):(\d+)$/);if(!n)return null;let[,o,t,s]=n,r=parseInt(t,10),i=parseInt(s,10);return isNaN(r)||isNaN(i)?null:br(o,r,i)}var xr=`@keyframes styles-module__markerIn___7B1j9 {
336
+ `)}`;if(typeof n=="object"&&n!==null)try{return JSON.stringify(n).slice(0,300)}catch{return String(n)}return String(n)}).join(" ")}function Fn(e,n){$n.push({level:e,message:n.slice(0,500),timestamp:Date.now()}),$n.length>50&&$n.shift()}function Zs(){if(fo||typeof window>"u")return;fo=!0;let e=console.error,n=console.warn,o=console.log;console.error=(...t)=>{let s=vt(t);Te.push(s.slice(0,500)),Te.length>20&&Te.shift(),Fn("error",s),e.apply(console,t)},console.warn=(...t)=>{let s=vt(t);Te.push(`[warn] ${s}`.slice(0,500)),Te.length>20&&Te.shift(),Fn("warn",s),n.apply(console,t)},console.log=(...t)=>{Fn("log",vt(t)),o.apply(console,t)},window.addEventListener("error",t=>{let s=`${t.message} (${t.filename}:${t.lineno})`;Te.push(s.slice(0,500)),Te.length>20&&Te.shift(),Fn("error",s)}),window.addEventListener("unhandledrejection",t=>{let s=`Unhandled Promise: ${t.reason}`;Te.push(s.slice(0,500)),Te.length>20&&Te.shift(),Fn("error",s)})}Zs();function Xs(e){let n=e.match(/Edg\/(\d+[\d.]*)/);if(n)return`Edge ${n[1]}`;let o=e.match(/Chrome\/(\d+[\d.]*)/);if(o&&!e.includes("Edg/")&&!e.includes("OPR/"))return`Chrome ${o[1]}`;let t=e.match(/Firefox\/(\d+[\d.]*)/);if(t)return`Firefox ${t[1]}`;let s=e.match(/Version\/(\d+[\d.]*).*Safari/);if(s)return`Safari ${s[1]}`;let r=e.match(/OPR\/(\d+[\d.]*)/);return r?`Opera ${r[1]}`:e}var Ys=[/session/i,/csrf/i,/xsrf/i,/secret/i,/password/i,/key/i];function Qs(){if(typeof document>"u")return{};let e={};try{document.cookie.split(";").forEach(n=>{let[o,...t]=n.trim().split("=");if(!o)return;let s=o.trim(),r=Ys.some(i=>i.test(s));e[s]=r?"[masked]":decodeURIComponent(t.join("=")).slice(0,200)})}catch{}return e}function go(e){try{let n=e.split(".");if(n.length!==3)return null;let o=n[1].replace(/-/g,"+").replace(/_/g,"/"),t=o+"==".slice(0,(4-o.length%4)%4);return JSON.parse(atob(t))}catch{return null}}function qs(){if(typeof window>"u")return null;let e=["token","access_token","accessToken","auth_token","authToken","jwt","id_token","idToken"];for(let n of e)try{let o=localStorage.getItem(n);if(o){let t=o.startsWith('"')?JSON.parse(o):o,s=go(t);if(s){let r={},i=["sub","email","name","role","roles","org","iat","exp","aud","iss","user_id","user_role"];for(let a of i)a in s&&(r[a]=s[a]);return Object.keys(r).length>0?r:null}}}catch{continue}try{let n=document.cookie.split(";");for(let o of n){let[,...t]=o.trim().split("="),s=t.join("="),r=go(s);if(r&&r.sub){let i={},a=["sub","email","name","role","roles","org","iat","exp"];for(let _ of a)_ in r&&(i[_]=r[_]);return Object.keys(i).length>0?i:null}}}catch{}return null}function _n(e){let n=Math.round(e);return isNaN(n)||!isFinite(n)?void 0:n}function Gs(){if(typeof performance>"u")return{};let e={};try{let n=performance.getEntriesByType("navigation")[0];if(n){let s=_n(n.loadEventEnd-n.startTime),r=_n(n.domContentLoadedEventEnd-n.startTime),i=_n(n.responseStart-n.requestStart);s&&(e.pageLoadTime=s),r&&(e.domContentLoaded=r),i&&(e.ttfb=i)}let o=performance.getEntriesByName("first-contentful-paint")[0];if(o){let s=_n(o.startTime);s&&(e.firstContentfulPaint=s)}let t=performance.memory;if(t){let s=_n(t.usedJSHeapSize/1024/1024),r=_n(t.totalJSHeapSize/1024/1024);s&&(e.usedJSHeapMB=s),r&&(e.totalJSHeapMB=r)}}catch{}return e}function ho(e){let n={url:window.location.href,timestamp:new Date().toISOString(),browser:Xs(navigator.userAgent),userAgent:navigator.userAgent,viewport:`${window.innerWidth}x${window.innerHeight}`,pixelRatio:window.devicePixelRatio,language:navigator.language,referrer:document.referrer,cookies:Qs(),jwtClaims:qs()??void 0,consoleErrors:Te.length>0?[...Te]:void 0,consoleLogs:$n.length>0?[...$n]:void 0,performance:Gs()};if(e)try{let o=e();o&&(n.user={...o,id:String(o.id),name:String(o.name||"")})}catch{}return n}var Js="/_next/static/chunks/impakers-debug-route-manifest.json",tt=null,ot=!1;function yo(e){return!e||e==="/"?"/":e.endsWith("/")?e.slice(0,-1)||"/":e}function er(e){let n=yo(e);return n==="/"?[]:n.slice(1).split("/").map(o=>decodeURIComponent(o)).filter(Boolean)}function nr(e){return/^\[[^\]]+\]$/.test(e)}function tr(e){return/^\[\.\.\.[^\]]+\]$/.test(e)}function or(e){return/^\[\[\.\.\.[^\]]+\]\]$/.test(e)}function sr(e,n){let o=0,t=0,s=0;for(;o<e.length;){let r=e[o];if(or(r)){s+=1,t=n.length,o+=1;break}if(tr(r)){if(t>=n.length)return null;s+=2,t=n.length,o+=1;break}let i=n[t];if(i===void 0)return null;if(nr(r)){s+=5,o+=1,t+=1;continue}if(r!==i)return null;s+=20,o+=1,t+=1}return o!==e.length||t!==n.length?null:s}async function rr(){return ot?null:tt||(tt=(async()=>{try{let e=await fetch(Js,{cache:"force-cache"});if(!e.ok)return ot=!0,null;let n=await e.json();return!n||typeof n!="object"||!Array.isArray(n.entries)?(ot=!0,null):n}catch{return ot=!0,null}})(),tt)}function ir(e){let n=e.files.find(s=>s.kind==="page"),o=e.files.filter(s=>s.kind==="layout"),t=[];return n&&t.push({kind:"route-page",file:n.file,label:"Current page route",confidence:1,reason:"matched-current-url"}),o.forEach((s,r)=>{t.push({kind:"route-layout",file:s.file,label:r===o.length-1?"Nearest layout":"Ancestor layout",confidence:Math.max(.7,.95-r*.08),reason:"matched-layout-chain"})}),t}async function bo(e){if(typeof window>"u")return null;let n=e??window.location.pathname,o=await rr();if(!o)return null;let t=er(n),s=null,r=-1;for(let i of o.entries){let a=sr(i.segments,t);a!==null&&a>r&&(r=a,s=i)}return s?{targets:ir(s),context:{pathname:yo(n),matchedRoute:s.route,source:"next-route-manifest"}}:null}function xo(...e){let n=[],o=new Set;return e.forEach(t=>{t?.forEach(s=>{let r=`${s.kind}:${s.file}:${s.line??""}:${s.column??""}`;o.has(r)||(o.add(r),n.push(s))})}),n.sort((t,s)=>s.confidence-t.confidence)}function ko(){let e=en();if(!e)throw new Error("\uC778\uC99D\uC774 \uD544\uC694\uD569\uB2C8\uB2E4");return e}async function Oe(e,n={}){let o=ko(),t=await fetch(e,{...n,headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`,...n.headers}});if(!t.ok){if(t.status===401)throw new Error("\uC778\uC99D\uC774 \uB9CC\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");let s=await t.json().catch(()=>({error:"\uC694\uCCAD \uC2E4\uD328"}));throw new Error(s.error||s.message||"\uC694\uCCAD \uC2E4\uD328")}return t}var st=new Map,Ct=new Map,Bn=new Map,ar=3e4;function Ye(e){return`feedbacks:${e}`}function mn(){return"feedbacks:__all__"}function qe(e){return`comments:${e}`}function De(e,n){st.set(e,{data:n,timestamp:Date.now()});let o=Bn.get(e);o&&o.forEach(t=>t(n))}function Qe(e){return st.get(e)?.data??null}function lr(e){let n=st.get(e);return n?Date.now()-n.timestamp<=ar:!1}function St(e){return Array.from(st.keys()).filter(n=>n.includes(e))}function dr(e){let n=new Map;for(let o of St(e)){let t=Qe(o);t!==null&&n.set(o,t)}return n}function cr(e){e.forEach((n,o)=>De(o,n))}function wt(e,n){let o=n(Qe(e));return De(e,o),o}function ur(e,n){for(let o of St(e)){let t=Qe(o);t!==null&&De(o,n(t))}}async function Hn(e,n){let o=Ct.get(e);if(o)return o;let t=(async()=>{try{let s=await n();return De(e,s),s}finally{Ct.delete(e)}})();return Ct.set(e,t),t}async function Nt(e,n,o={}){let t=Qe(e);return t!==null&&!o.force?((o.staleWhileRevalidate||!lr(e))&&Hn(e,n),t):Hn(e,n)}function zn(e,n){let o=Bn.get(e)||new Set;return o.add(n),Bn.set(e,o),()=>{let t=Bn.get(e);t&&(t.delete(n),t.size===0&&Bn.delete(e))}}function pn(e){return Qe(e)}async function vo(e,n){let o=`temp-task-${Date.now()}`,t=n.feedbackUrl,s=n.feedbackMarker,r=t?Qe(Ye(t))||[]:null,i=Qe(mn()),a=t?{id:o,taskNumber:0,title:n.title,status:"todo",priority:n.priority,feedbackUrl:t,feedbackMarker:s||null,createdAt:new Date().toISOString(),commentCount:0,_optimistic:!0}:null;t&&a&&(De(Ye(t),[a,...r]),i&&De(mn(),[a,...i]));try{let k=await(await Oe(e,{method:"POST",body:JSON.stringify(n)})).json().catch(()=>({}));if(t&&a){let v={...a,id:k.taskId||o,taskNumber:k.taskNumber||0,_optimistic:!1};wt(Ye(t),C=>(C||[]).map(w=>w.id===o?v:w)),i&&wt(mn(),C=>(C||[]).map(w=>w.id===o?v:w)),So(e,t).catch(()=>{}),i&&No(e).catch(()=>{})}return k}catch(_){throw t&&r&&De(Ye(t),r),i&&De(mn(),i),_}}async function Co(e,n,o={}){let t=Ye(n);return Nt(t,async()=>(await(await Oe(`${e}?url=${encodeURIComponent(n)}`)).json()).tasks||[],o)}async function wo(e,n={}){let o=mn();return Nt(o,async()=>(await(await Oe(`${e}?url=__all__`)).json()).tasks||[],n)}async function So(e,n){let o=Ye(n);return Hn(o,async()=>(await(await Oe(`${e}?url=${encodeURIComponent(n)}`)).json()).tasks||[])}async function No(e){let n=mn();return Hn(n,async()=>(await(await Oe(`${e}?url=__all__`)).json()).tasks||[])}async function rt(e,n,o={}){let t=qe(n);return Nt(t,async()=>(await(await Oe(`${e}/${n}/comments`)).json()).comments||[],o)}async function _r(e,n){let o=qe(n);return Hn(o,async()=>(await(await Oe(`${e}/${n}/comments`)).json()).comments||[])}function mr(e,n){ur("feedbacks:",o=>o.map(t=>t.id===e?{...t,commentCount:Math.max(0,(t.commentCount||0)+n)}:t))}function pr(e){St("feedbacks:").forEach(o=>{let t=o.replace("feedbacks:","");t==="__all__"?No(e).catch(()=>{}):So(e,t).catch(()=>{})})}async function it(e,n,o,t,s,r,i){let a={id:`temp-${Date.now()}`,content:o,authorName:t,authorId:s,imageUrl:r||void 0,fileUrl:i?.url,fileName:i?.fileName,fileType:i?.fileType,fileSize:i?.fileSize,fileSource:i?.fileSource,createdAt:new Date().toISOString()},_=qe(n),k=Qe(_)||[],v=dr("feedbacks:");De(_,[...k,a]),mr(n,1);try{let B=(await(await Oe(`${e}/${n}/comments`,{method:"POST",body:JSON.stringify({content:o,authorName:t,authorId:s,screenshot:r,...i&&{fileUrl:i.url,fileName:i.fileName,fileType:i.fileType,fileSize:i.fileSize,fileSource:i.fileSource}})})).json()).comment;return wt(_,R=>(R||[]).map(D=>D.id===a.id?B:D)),_r(e,n),pr(e),B}catch(C){throw De(_,k),cr(v),C}}var fr=4.5*1024*1024;async function at(e,n,o,t){if(n.size>fr)throw new Error(`\uD30C\uC77C \uD06C\uAE30\uAC00 4.5MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4. (${(n.size/1024/1024).toFixed(1)}MB)`);let s=ko(),r=new FormData;r.append("file",n),r.append("context",o),t&&r.append("taskId",t);let i=await fetch(`${e}/upload`,{method:"POST",headers:{Authorization:`Bearer ${s}`},body:r});if(!i.ok){if(i.status===401)throw new Error("\uC778\uC99D\uC774 \uB9CC\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");if(i.status===413)throw new Error("\uD30C\uC77C \uD06C\uAE30\uAC00 4.5MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4.");let a=await i.json().catch(()=>({error:"\uD30C\uC77C \uC5C5\uB85C\uB4DC \uC2E4\uD328"}));throw new Error(a.error||"\uD30C\uC77C \uC5C5\uB85C\uB4DC \uC2E4\uD328")}return i.json()}async function lt(e,n={}){let o=new URLSearchParams;n.since&&o.set("since",n.since),n.date&&o.set("date",n.date),n.limit&&o.set("limit",String(n.limit));let t=o.toString(),s=`${e}/history${t?`?${t}`:""}`;return(await(await Oe(s)).json()).events||[]}import{AnyMap as Lo,originalPositionFor as gr}from"@jridgewell/trace-mapping";var Dn=new Map,To=new Set;async function hr(e){try{let n=await fetch(e,{cache:"force-cache"});if(!n.ok)return null;let t=(await n.text()).match(/\/\/[#@]\s*sourceMappingURL\s*=\s*(\S+)\s*$/m);if(!t)return null;let s=t[1];return s.startsWith("http")?s:e.substring(0,e.lastIndexOf("/")+1)+s}catch{return null}}async function yr(e){if(Dn.has(e))return Dn.get(e)??null;if(To.has(e))return null;let n=e.endsWith(".map")?e:`${e}.map`;try{let t=await fetch(n,{cache:"force-cache"});if(t.ok){let s=await t.json(),r=new Lo(s);return Dn.set(e,r),r}}catch{}let o=await hr(e);if(o)try{let t=await fetch(o,{cache:"force-cache"});if(t.ok){let s=await t.json(),r=new Lo(s);return Dn.set(e,r),r}}catch{}return To.add(e),Dn.set(e,null),null}async function br(e,n,o){let t;try{e.startsWith("http")?t=e:t=new URL(e,window.location.origin).href}catch{return null}let s=await yr(t);if(!s)return null;try{let r=gr(s,{line:n,column:o});if(!r.source)return null;let i=r.source;return i=i.replace(/^webpack:\/\/\//,""),i=i.replace(/^turbopack:\/\/\//,""),i=i.replace(/^\[project\]\//,""),i=i.replace(/^\.\//,""),i.includes("node_modules/")?null:{source:i,line:r.line??0,column:r.column??0,name:r.name??null}}catch{return null}}async function Lt(e){if(!e)return null;let n=e.match(/^(.+):(\d+):(\d+)$/);if(!n)return null;let[,o,t,s]=n,r=parseInt(t,10),i=parseInt(s,10);return isNaN(r)||isNaN(i)?null:br(o,r,i)}var xr=`@keyframes styles-module__markerIn___7B1j9 {
337
337
  from {
338
338
  opacity: 0;
339
339
  transform: translate(-50%, -50%) scale(0.3);
@@ -440,7 +440,7 @@ ${n.stack?.split(`
440
440
  margin-top: 2px;
441
441
  overflow: hidden;
442
442
  text-overflow: ellipsis;
443
- }`,kr={marker:"styles-module__marker___7PVX9",enter:"styles-module__enter___V7KfW",markerIn:"styles-module__markerIn___7B1j9",hovered:"styles-module__hovered___ojzb7",done:"styles-module__done___J6WOE",pending:"styles-module__pending___qQbOR",markerTooltip:"styles-module__markerTooltip___ns-gQ",tooltipIn:"styles-module__tooltipIn___3o7t0",markerQuote:"styles-module__markerQuote___1bRQp",markerNote:"styles-module__markerNote___3iWm4"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-annotation-marker-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-annotation-marker-styles",document.head.appendChild(e)),e.textContent=xr}var Be=kr;import{jsx as fn,jsxs as Lt}from"react/jsx-runtime";var vr="#3b82f6",Cr="#9ca3af";function Tt({annotation:e,layerIndex:n,isAnimated:o,isHovered:t,accentColor:s,onHover:r,onHoverEnd:i,onClick:a}){let _=o?"":Be.enter,k=e.status==="done"||e.status==="resolved",v=e.status==="in_progress",C=k?Cr:v?vr:s;return Lt("div",{className:`${Be.marker} ${_} ${t?Be.hovered:""} ${k?Be.done:""}`,"data-annotation-marker":!0,style:{left:`${e.x}%`,top:e.y,backgroundColor:C,animationDelay:`${n*20}ms`},onMouseEnter:r,onMouseLeave:i,onClick:w=>{w.stopPropagation(),a()},children:[fn("span",{children:n+1}),t&&Lt("div",{className:`${Be.markerTooltip} ${Be.enter}`,children:[fn("span",{className:Be.markerQuote,children:e.element}),e.comment&&fn("span",{className:Be.markerNote,children:e.comment})]})]})}function Io({x:e,y:n,accentColor:o}){return fn("div",{className:`${Be.pending} ${Be.enter}`,"data-annotation-marker":!0,style:{left:`${e}%`,top:n,backgroundColor:o},children:Lt("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[fn("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),fn("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})}import{useState as gn,useRef as It,useEffect as Ro,useCallback as rn}from"react";var wr=`@keyframes styles-module__spin___h0C6p {
443
+ }`,kr={marker:"styles-module__marker___7PVX9",enter:"styles-module__enter___V7KfW",markerIn:"styles-module__markerIn___7B1j9",hovered:"styles-module__hovered___ojzb7",done:"styles-module__done___J6WOE",pending:"styles-module__pending___qQbOR",markerTooltip:"styles-module__markerTooltip___ns-gQ",tooltipIn:"styles-module__tooltipIn___3o7t0",markerQuote:"styles-module__markerQuote___1bRQp",markerNote:"styles-module__markerNote___3iWm4"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-annotation-marker-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-annotation-marker-styles",document.head.appendChild(e)),e.textContent=xr}var He=kr;import{jsx as fn,jsxs as Tt}from"react/jsx-runtime";var vr="#3b82f6",Cr="#9ca3af";function It({annotation:e,layerIndex:n,isAnimated:o,isHovered:t,accentColor:s,onHover:r,onHoverEnd:i,onClick:a}){let _=o?"":He.enter,k=e.status==="done"||e.status==="resolved",v=e.status==="in_progress",C=k?Cr:v?vr:s;return Tt("div",{className:`${He.marker} ${_} ${t?He.hovered:""} ${k?He.done:""}`,"data-annotation-marker":!0,style:{left:`${e.x}%`,top:e.y,backgroundColor:C,animationDelay:`${n*20}ms`},onMouseEnter:r,onMouseLeave:i,onClick:w=>{w.stopPropagation(),a()},children:[fn("span",{children:n+1}),t&&Tt("div",{className:`${He.markerTooltip} ${He.enter}`,children:[fn("span",{className:He.markerQuote,children:e.element}),e.comment&&fn("span",{className:He.markerNote,children:e.comment})]})]})}function Io({x:e,y:n,accentColor:o}){return fn("div",{className:`${He.pending} ${He.enter}`,"data-annotation-marker":!0,style:{left:`${e}%`,top:n,backgroundColor:o},children:Tt("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",children:[fn("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),fn("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})}import{useState as gn,useRef as Et,useEffect as Ro,useCallback as rn}from"react";var wr=`@keyframes styles-module__spin___h0C6p {
444
444
  to {
445
445
  transform: rotate(360deg);
446
446
  }
@@ -466,7 +466,7 @@ ${n.stack?.split(`
466
466
  .styles-module__message___70Ayy {
467
467
  font-size: 12px;
468
468
  color: #9ca3af;
469
- }`,Sr={container:"styles-module__container___YKn1h",spinner:"styles-module__spinner___4ELZK",spin:"styles-module__spin___h0C6p",message:"styles-module__message___70Ayy"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-loading-spinner-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-loading-spinner-styles",document.head.appendChild(e)),e.textContent=wr}var lt=Sr;import{jsx as Eo,jsxs as Nr}from"react/jsx-runtime";function dt({message:e="\uB85C\uB529 \uC911..."}){return Nr("div",{className:lt.container,children:[Eo("div",{className:lt.spinner}),Eo("span",{className:lt.message,children:e})]})}var Lr=`@keyframes styles-module__threadIn___pBTFZ {
469
+ }`,Sr={container:"styles-module__container___YKn1h",spinner:"styles-module__spinner___4ELZK",spin:"styles-module__spin___h0C6p",message:"styles-module__message___70Ayy"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-loading-spinner-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-loading-spinner-styles",document.head.appendChild(e)),e.textContent=wr}var dt=Sr;import{jsx as Eo,jsxs as Nr}from"react/jsx-runtime";function ct({message:e="\uB85C\uB529 \uC911..."}){return Nr("div",{className:dt.container,children:[Eo("div",{className:dt.spinner}),Eo("span",{className:dt.message,children:e})]})}var Lr=`@keyframes styles-module__threadIn___pBTFZ {
470
470
  from {
471
471
  opacity: 0;
472
472
  transform: scale(0.96) translateY(4px);
@@ -950,7 +950,7 @@ ${n.stack?.split(`
950
950
  }
951
951
  .styles-module__lightboxClose___tGZlm:hover {
952
952
  background: rgba(255, 255, 255, 0.25);
953
- }`,Tr={thread:"styles-module__thread___ua2EO",threadIn:"styles-module__threadIn___pBTFZ",exiting:"styles-module__exiting___RIPeX",threadOut:"styles-module__threadOut___-ccKh",header:"styles-module__header___GiEBq",avatar:"styles-module__avatar___JElAd",headerInfo:"styles-module__headerInfo___E8809",headerTop:"styles-module__headerTop___eDiCd",authorName:"styles-module__authorName___T1BfB",timestamp:"styles-module__timestamp___WusBf",headerActions:"styles-module__headerActions___8FsMY",headerAction:"styles-module__headerAction___Tinmq",title:"styles-module__title___qkfqY",commentsList:"styles-module__commentsList___kYqAR",comment:"styles-module__comment___pW3IO",commentActions:"styles-module__commentActions___wO0fs",commentHighlight:"styles-module__commentHighlight___EiTmx",commentContent:"styles-module__commentContent___RObGr",commentTop:"styles-module__commentTop___BbTF3",commentAuthor:"styles-module__commentAuthor___tBjpl",commentTime:"styles-module__commentTime___0OLrz",commentText:"styles-module__commentText___ldy2V",screenshot:"styles-module__screenshot___jUqau",screenshotBadge:"styles-module__screenshotBadge___roEqY",fileCard:"styles-module__fileCard___-iOro",fileIcon:"styles-module__fileIcon___dNJMT",fileInfo:"styles-module__fileInfo___dVrLV",fileCardName:"styles-module__fileCardName___SHOj-",fileCardSize:"styles-module__fileCardSize___W53JL",pendingFile:"styles-module__pendingFile___-OSRs",divider:"styles-module__divider___kDjxN",pendingImage:"styles-module__pendingImage___gHaF3",pendingRemove:"styles-module__pendingRemove___FRL4h",replyArea:"styles-module__replyArea___VQn9b",replyInput:"styles-module__replyInput___uZNBW",replyToolbar:"styles-module__replyToolbar___fTFJU",replyTool:"styles-module__replyTool___Ho-Rx",replySend:"styles-module__replySend___e0VSb",active:"styles-module__active___R--Jj",empty:"styles-module__empty___XXGiw",statusBadge:"styles-module__statusBadge___el8ml",todo:"styles-module__todo___rUWBr",inProgress:"styles-module__inProgress___HEWgU",done:"styles-module__done___zC12n",lightbox:"styles-module__lightbox___KoWEF",lightboxClose:"styles-module__lightboxClose___tGZlm"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-comment-thread-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-comment-thread-styles",document.head.appendChild(e)),e.textContent=Lr}var L=Tr;import{Fragment as $o,jsx as R,jsxs as de}from"react/jsx-runtime";function Mo(e){let n=new Date(e),o=Date.now()-n.getTime(),t=_=>String(_).padStart(2,"0"),s=`${n.getMonth()+1}/${n.getDate()} ${t(n.getHours())}:${t(n.getMinutes())}`,r=Math.floor(o/6e4);if(r<1)return`${s} (\uBC29\uAE08)`;if(r<60)return`${s} (${r}\uBD84 \uC804)`;let i=Math.floor(r/60);if(i<24)return`${s} (${i}\uC2DC\uAC04 \uC804)`;let a=Math.floor(i/24);return`${s} (${a}\uC77C \uC804)`}function Ao(e){return e.slice(0,1).toUpperCase()}function Po(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(0)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function Fo(e){return e.includes("pdf")?"PDF":e.includes("spreadsheet")||e.includes("excel")||e.includes("csv")?"XLS":e.includes("presentation")||e.includes("powerpoint")?"PPT":e.includes("document")||e.includes("word")?"DOC":e.includes("zip")||e.includes("compressed")||e.includes("archive")?"ZIP":e.includes("video")?"VID":e.includes("audio")?"AUD":"FILE"}function Bo({task:e,currentUserName:n,currentUserId:o,left:t,top:s,bottom:r,loading:i,onClose:a,onReply:_}){let[k,v]=gn(""),[C,w]=gn(!1),[B,M]=gn(null),[D,U]=gn(null),[ce,ue]=gn(!1),se=It(null),F=It(null),[A,X]=gn(null),h=It(null);Ro(()=>{F.current&&(F.current.scrollTop=F.current.scrollHeight),se.current?.focus()},[e.comments.length]),Ro(()=>{if(ce)return;let b=x=>{let p=x.target;p.closest(`.${L.thread}`)||p.closest("[data-annotation-marker]")||p.closest("[data-impakers-debug]")||H()};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[ce]);let H=rn(()=>{w(!0),setTimeout(()=>a(),120)},[a]),I=rn(()=>{!k.trim()&&!B&&!D||(_(e.id,k.trim(),B||void 0,D||void 0),v(""),M(null),U(null))},[k,B,D,e.id,_]),_e=rn(b=>{b.stopPropagation(),!b.nativeEvent.isComposing&&(b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),I()),b.key==="Escape"&&H())},[H,I]),E=rn(()=>{ue(!0);let b=document.querySelectorAll("[data-impakers-debug], [data-annotation-marker]");b.forEach(P=>P.style.visibility="hidden"),document.documentElement.classList.add("impakers-selecting");let x=null,p=P=>{x||(x=document.createElement("div"),x.style.cssText="position:fixed;border:2px solid #3b82f6;background:rgba(59,130,246,0.05);border-radius:4px;pointer-events:none;z-index:999999;transition:all 0.08s ease",document.body.appendChild(x)),x.style.left=`${P.left}px`,x.style.top=`${P.top}px`,x.style.width=`${P.width}px`,x.style.height=`${P.height}px`},S=()=>{document.removeEventListener("mousemove",z),document.removeEventListener("click",re,!0),document.removeEventListener("keydown",te),document.documentElement.classList.remove("impakers-selecting"),x?.remove(),b.forEach(P=>P.style.visibility=""),ue(!1)},z=P=>{let me=document.elementFromPoint(P.clientX,P.clientY);!me||me===x||p(me.getBoundingClientRect())},te=P=>{P.key==="Escape"&&S()},re=async P=>{P.preventDefault(),P.stopPropagation(),P.stopImmediatePropagation();let me=document.elementFromPoint(P.clientX,P.clientY);if(S(),!!me){try{let ie=await et(me);M(ie)}catch(ie){console.error("[@impakers/debug] DOM \uC2A4\uD06C\uB9B0\uC0F7 \uC2E4\uD328:",ie)}se.current?.focus()}};document.addEventListener("mousemove",z),document.addEventListener("click",re,!0),document.addEventListener("keydown",te)},[]),q=rn(()=>{E()},[E]),ee=rn(()=>{h.current?.click()},[]),we=rn(b=>{let x=b.target.files?.[0];if(x){if(x.size>4.5*1024*1024){console.warn("[@impakers/debug] \uD30C\uC77C \uD06C\uAE30\uAC00 4.5MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4."),b.target.value="";return}if(x.type.startsWith("image/")){U(null);let p=new FileReader;p.onload=()=>{M(p.result)},p.readAsDataURL(x)}else M(null),U(x);b.target.value=""}},[]),Me=e.title.replace(/^\[피드백\]\s*/,""),ne={left:t,...s!==void 0?{top:s}:{},...r!==void 0?{bottom:r}:{},"--thread-top":`${s!==void 0?s:40}px`};return de("div",{className:`${L.thread} ${C?L.exiting:""}`,style:ne,"data-impakers-debug":"",onClick:b=>b.stopPropagation(),children:[de("div",{className:L.header,children:[R("div",{className:L.avatar,children:Ao(e.authorName||n)}),de("div",{className:L.headerInfo,children:[de("div",{className:L.headerTop,children:[R("span",{className:L.authorName,children:e.authorName||n}),R("span",{className:L.timestamp,children:Mo(e.createdAt)})]}),R("div",{className:L.title,children:Me})]}),R("div",{className:L.headerActions,children:R("button",{className:L.headerAction,onClick:H,title:"\uB2EB\uAE30",type:"button",children:R("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:R("path",{d:"M18 6L6 18M6 6l12 12"})})})})]}),i&&e.comments.length===0&&de($o,{children:[R("div",{className:L.divider}),R(dt,{message:"\uB313\uAE00 \uB85C\uB529 \uC911..."})]}),e.comments.length>0&&de($o,{children:[R("div",{className:L.divider}),R("div",{className:L.commentsList,ref:F,children:e.comments.map(b=>de("div",{className:L.comment,children:[R("div",{className:L.avatar,style:{width:22,height:22,fontSize:10},children:Ao(b.authorName)}),de("div",{className:L.commentContent,children:[de("div",{className:L.commentTop,children:[R("span",{className:L.commentAuthor,children:b.authorName}),R("span",{className:L.commentTime,children:Mo(b.createdAt)})]}),b.content&&R("div",{className:L.commentText,children:b.content}),b.imageUrl&&b.imageUrl!=="loading..."&&R("div",{className:L.screenshot,onClick:()=>X(b.imageUrl),style:{cursor:"pointer"},children:R("img",{src:b.imageUrl,alt:"screenshot"})}),b.fileUrl&&de("a",{className:L.fileCard,href:b.fileUrl,target:"_blank",rel:"noopener noreferrer",onClick:x=>x.stopPropagation(),children:[R("span",{className:L.fileIcon,children:Fo(b.fileType||"")}),de("span",{className:L.fileInfo,children:[R("span",{className:L.fileCardName,children:b.fileName||"\uD30C\uC77C"}),b.fileSize!=null&&R("span",{className:L.fileCardSize,children:Po(b.fileSize)})]})]})]})]},b.id))})]}),B&&de("div",{className:L.pendingImage,children:[R("img",{src:B,alt:"pending"}),R("button",{className:L.pendingRemove,onClick:()=>M(null),type:"button",children:"\xD7"})]}),D&&de("div",{className:L.pendingFile,children:[R("span",{className:L.fileIcon,children:Fo(D.type)}),de("span",{className:L.fileInfo,children:[R("span",{className:L.fileCardName,children:D.name}),R("span",{className:L.fileCardSize,children:Po(D.size)})]}),R("button",{className:L.pendingRemove,onClick:()=>U(null),type:"button",children:"\xD7"})]}),R("div",{className:L.replyArea,children:R("textarea",{ref:se,className:L.replyInput,placeholder:"Reply...",value:k,onChange:b=>{v(b.target.value);let x=b.target;x.style.height="auto",x.style.height=`${Math.min(x.scrollHeight,120)}px`},onKeyDown:_e,rows:2})}),de("div",{className:L.replyToolbar,children:[R("button",{className:L.replyTool,onClick:ee,type:"button",title:"\uD30C\uC77C \uCCA8\uBD80",children:de("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[R("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),R("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),R("button",{className:L.replyTool,onClick:q,type:"button",title:"\uC694\uC18C \uC2A4\uD06C\uB9B0\uC0F7",children:de("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[R("path",{d:"M14.5 4h-5L7 7H4a2 2 0 00-2 2v9a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2h-3l-2.5-3z"}),R("circle",{cx:"12",cy:"13",r:"3"})]})}),R("button",{className:`${L.replySend} ${k.trim()||B||D?L.active:""}`,onClick:I,disabled:!k.trim()&&!B&&!D,type:"button",title:"\uC804\uC1A1",children:de("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[R("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),R("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),R("input",{ref:h,type:"file",accept:"*/*",style:{display:"none"},onChange:we}),A&&de("div",{className:L.lightbox,onClick:()=>X(null),"data-impakers-debug":"",children:[R("img",{src:A,alt:"enlarged",onClick:b=>b.stopPropagation()}),R("button",{className:L.lightboxClose,onClick:()=>X(null),type:"button",children:"\xD7"})]})]})}import{useState as ct,useRef as hn,useCallback as jn,useEffect as Rr}from"react";var Ir=`@keyframes styles-module__fabEnter___DMJoo {
953
+ }`,Tr={thread:"styles-module__thread___ua2EO",threadIn:"styles-module__threadIn___pBTFZ",exiting:"styles-module__exiting___RIPeX",threadOut:"styles-module__threadOut___-ccKh",header:"styles-module__header___GiEBq",avatar:"styles-module__avatar___JElAd",headerInfo:"styles-module__headerInfo___E8809",headerTop:"styles-module__headerTop___eDiCd",authorName:"styles-module__authorName___T1BfB",timestamp:"styles-module__timestamp___WusBf",headerActions:"styles-module__headerActions___8FsMY",headerAction:"styles-module__headerAction___Tinmq",title:"styles-module__title___qkfqY",commentsList:"styles-module__commentsList___kYqAR",comment:"styles-module__comment___pW3IO",commentActions:"styles-module__commentActions___wO0fs",commentHighlight:"styles-module__commentHighlight___EiTmx",commentContent:"styles-module__commentContent___RObGr",commentTop:"styles-module__commentTop___BbTF3",commentAuthor:"styles-module__commentAuthor___tBjpl",commentTime:"styles-module__commentTime___0OLrz",commentText:"styles-module__commentText___ldy2V",screenshot:"styles-module__screenshot___jUqau",screenshotBadge:"styles-module__screenshotBadge___roEqY",fileCard:"styles-module__fileCard___-iOro",fileIcon:"styles-module__fileIcon___dNJMT",fileInfo:"styles-module__fileInfo___dVrLV",fileCardName:"styles-module__fileCardName___SHOj-",fileCardSize:"styles-module__fileCardSize___W53JL",pendingFile:"styles-module__pendingFile___-OSRs",divider:"styles-module__divider___kDjxN",pendingImage:"styles-module__pendingImage___gHaF3",pendingRemove:"styles-module__pendingRemove___FRL4h",replyArea:"styles-module__replyArea___VQn9b",replyInput:"styles-module__replyInput___uZNBW",replyToolbar:"styles-module__replyToolbar___fTFJU",replyTool:"styles-module__replyTool___Ho-Rx",replySend:"styles-module__replySend___e0VSb",active:"styles-module__active___R--Jj",empty:"styles-module__empty___XXGiw",statusBadge:"styles-module__statusBadge___el8ml",todo:"styles-module__todo___rUWBr",inProgress:"styles-module__inProgress___HEWgU",done:"styles-module__done___zC12n",lightbox:"styles-module__lightbox___KoWEF",lightboxClose:"styles-module__lightboxClose___tGZlm"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-comment-thread-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-comment-thread-styles",document.head.appendChild(e)),e.textContent=Lr}var N=Tr;import{Fragment as $o,jsx as E,jsxs as de}from"react/jsx-runtime";function Mo(e){let n=new Date(e),o=Date.now()-n.getTime(),t=_=>String(_).padStart(2,"0"),s=`${n.getMonth()+1}/${n.getDate()} ${t(n.getHours())}:${t(n.getMinutes())}`,r=Math.floor(o/6e4);if(r<1)return`${s} (\uBC29\uAE08)`;if(r<60)return`${s} (${r}\uBD84 \uC804)`;let i=Math.floor(r/60);if(i<24)return`${s} (${i}\uC2DC\uAC04 \uC804)`;let a=Math.floor(i/24);return`${s} (${a}\uC77C \uC804)`}function Ao(e){return e.slice(0,1).toUpperCase()}function Po(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(0)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function Fo(e){return e.includes("pdf")?"PDF":e.includes("spreadsheet")||e.includes("excel")||e.includes("csv")?"XLS":e.includes("presentation")||e.includes("powerpoint")?"PPT":e.includes("document")||e.includes("word")?"DOC":e.includes("zip")||e.includes("compressed")||e.includes("archive")?"ZIP":e.includes("video")?"VID":e.includes("audio")?"AUD":"FILE"}function Bo({task:e,currentUserName:n,currentUserId:o,left:t,top:s,bottom:r,loading:i,onClose:a,onReply:_}){let[k,v]=gn(""),[C,w]=gn(!1),[B,R]=gn(null),[D,K]=gn(null),[ce,ue]=gn(!1),re=Et(null),A=Et(null),[M,Y]=gn(null),h=Et(null);Ro(()=>{A.current&&(A.current.scrollTop=A.current.scrollHeight),re.current?.focus()},[e.comments.length]),Ro(()=>{if(ce)return;let b=x=>{let ee=x.target;ee.closest(`.${N.thread}`)||ee.closest("[data-annotation-marker]")||ee.closest("[data-impakers-debug]")||z()};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[ce]);let z=rn(()=>{w(!0),setTimeout(()=>a(),120)},[a]),T=rn(()=>{!k.trim()&&!B&&!D||(_(e.id,k.trim(),B||void 0,D||void 0),v(""),R(null),K(null))},[k,B,D,e.id,_]),_e=rn(b=>{b.stopPropagation(),!b.nativeEvent.isComposing&&(b.key==="Enter"&&!b.shiftKey&&(b.preventDefault(),T()),b.key==="Escape"&&z())},[z,T]),I=rn(()=>{ue(!0);let b=document.querySelectorAll("[data-impakers-debug], [data-annotation-marker]");b.forEach(F=>F.style.visibility="hidden"),document.documentElement.classList.add("impakers-selecting");let x=null,ee=F=>{x||(x=document.createElement("div"),x.style.cssText="position:fixed;border:2px solid #3b82f6;background:rgba(59,130,246,0.05);border-radius:4px;pointer-events:none;z-index:999999;transition:all 0.08s ease",document.body.appendChild(x)),x.style.left=`${F.left}px`,x.style.top=`${F.top}px`,x.style.width=`${F.width}px`,x.style.height=`${F.height}px`},p=()=>{document.removeEventListener("mousemove",P),document.removeEventListener("click",ie,!0),document.removeEventListener("keydown",H),document.documentElement.classList.remove("impakers-selecting"),x?.remove(),b.forEach(F=>F.style.visibility=""),ue(!1)},P=F=>{let Z=document.elementFromPoint(F.clientX,F.clientY);!Z||Z===x||ee(Z.getBoundingClientRect())},H=F=>{F.key==="Escape"&&p()},ie=async F=>{F.preventDefault(),F.stopPropagation(),F.stopImmediatePropagation();let Z=document.elementFromPoint(F.clientX,F.clientY);if(p(),!!Z){try{let te=await nt(Z);R(te)}catch(te){console.error("[@impakers/debug] DOM \uC2A4\uD06C\uB9B0\uC0F7 \uC2E4\uD328:",te)}re.current?.focus()}};document.addEventListener("mousemove",P),document.addEventListener("click",ie,!0),document.addEventListener("keydown",H)},[]),J=rn(()=>{I()},[I]),oe=rn(()=>{h.current?.click()},[]),me=rn(b=>{let x=b.target.files?.[0];if(x){if(x.size>4.5*1024*1024){console.warn("[@impakers/debug] \uD30C\uC77C \uD06C\uAE30\uAC00 4.5MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4."),b.target.value="";return}if(x.type.startsWith("image/")){K(null);let ee=new FileReader;ee.onload=()=>{R(ee.result)},ee.readAsDataURL(x)}else R(null),K(x);b.target.value=""}},[]),Me=e.title.replace(/^\[피드백\]\s*/,""),pe={left:t,...s!==void 0?{top:s}:{},...r!==void 0?{bottom:r}:{},"--thread-top":`${s!==void 0?s:40}px`};return de("div",{className:`${N.thread} ${C?N.exiting:""}`,style:pe,"data-impakers-debug":"",onClick:b=>b.stopPropagation(),children:[de("div",{className:N.header,children:[E("div",{className:N.avatar,children:Ao(e.authorName||n)}),de("div",{className:N.headerInfo,children:[de("div",{className:N.headerTop,children:[E("span",{className:N.authorName,children:e.authorName||n}),E("span",{className:N.timestamp,children:Mo(e.createdAt)})]}),E("div",{className:N.title,children:Me})]}),E("div",{className:N.headerActions,children:E("button",{className:N.headerAction,onClick:z,title:"\uB2EB\uAE30",type:"button",children:E("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:E("path",{d:"M18 6L6 18M6 6l12 12"})})})})]}),i&&e.comments.length===0&&de($o,{children:[E("div",{className:N.divider}),E(ct,{message:"\uB313\uAE00 \uB85C\uB529 \uC911..."})]}),e.comments.length>0&&de($o,{children:[E("div",{className:N.divider}),E("div",{className:N.commentsList,ref:A,children:e.comments.map(b=>de("div",{className:N.comment,children:[E("div",{className:N.avatar,style:{width:22,height:22,fontSize:10},children:Ao(b.authorName)}),de("div",{className:N.commentContent,children:[de("div",{className:N.commentTop,children:[E("span",{className:N.commentAuthor,children:b.authorName}),E("span",{className:N.commentTime,children:Mo(b.createdAt)})]}),b.content&&E("div",{className:N.commentText,children:b.content}),b.imageUrl&&b.imageUrl!=="loading..."&&E("div",{className:N.screenshot,onClick:()=>Y(b.imageUrl),style:{cursor:"pointer"},children:E("img",{src:b.imageUrl,alt:"screenshot"})}),b.fileUrl&&de("a",{className:N.fileCard,href:b.fileUrl,target:"_blank",rel:"noopener noreferrer",onClick:x=>x.stopPropagation(),children:[E("span",{className:N.fileIcon,children:Fo(b.fileType||"")}),de("span",{className:N.fileInfo,children:[E("span",{className:N.fileCardName,children:b.fileName||"\uD30C\uC77C"}),b.fileSize!=null&&E("span",{className:N.fileCardSize,children:Po(b.fileSize)})]})]})]})]},b.id))})]}),B&&de("div",{className:N.pendingImage,children:[E("img",{src:B,alt:"pending"}),E("button",{className:N.pendingRemove,onClick:()=>R(null),type:"button",children:"\xD7"})]}),D&&de("div",{className:N.pendingFile,children:[E("span",{className:N.fileIcon,children:Fo(D.type)}),de("span",{className:N.fileInfo,children:[E("span",{className:N.fileCardName,children:D.name}),E("span",{className:N.fileCardSize,children:Po(D.size)})]}),E("button",{className:N.pendingRemove,onClick:()=>K(null),type:"button",children:"\xD7"})]}),E("div",{className:N.replyArea,children:E("textarea",{ref:re,className:N.replyInput,placeholder:"Reply...",value:k,onChange:b=>{v(b.target.value);let x=b.target;x.style.height="auto",x.style.height=`${Math.min(x.scrollHeight,120)}px`},onKeyDown:_e,rows:2})}),de("div",{className:N.replyToolbar,children:[E("button",{className:N.replyTool,onClick:oe,type:"button",title:"\uD30C\uC77C \uCCA8\uBD80",children:de("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[E("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),E("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),E("button",{className:N.replyTool,onClick:J,type:"button",title:"\uC694\uC18C \uC2A4\uD06C\uB9B0\uC0F7",children:de("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[E("path",{d:"M14.5 4h-5L7 7H4a2 2 0 00-2 2v9a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2h-3l-2.5-3z"}),E("circle",{cx:"12",cy:"13",r:"3"})]})}),E("button",{className:`${N.replySend} ${k.trim()||B||D?N.active:""}`,onClick:T,disabled:!k.trim()&&!B&&!D,type:"button",title:"\uC804\uC1A1",children:de("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[E("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),E("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),E("input",{ref:h,type:"file",accept:"*/*",style:{display:"none"},onChange:me}),M&&de("div",{className:N.lightbox,onClick:()=>Y(null),"data-impakers-debug":"",children:[E("img",{src:M,alt:"enlarged",onClick:b=>b.stopPropagation()}),E("button",{className:N.lightboxClose,onClick:()=>Y(null),type:"button",children:"\xD7"})]})]})}import{useState as ut,useRef as hn,useCallback as jn,useEffect as Rr}from"react";var Ir=`@keyframes styles-module__fabEnter___DMJoo {
954
954
  from {
955
955
  opacity: 0;
956
956
  transform: scale(0.5);
@@ -1143,7 +1143,7 @@ ${n.stack?.split(`
1143
1143
  justify-content: center;
1144
1144
  padding: 0 4px;
1145
1145
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
1146
- }`,Er={fab:"styles-module__fab___wShP-",fabEnter:"styles-module__fabEnter___DMJoo",expanded:"styles-module__expanded___qyto6",menuItems:"styles-module__menuItems___1qNsE",menuItem:"styles-module__menuItem___pB75H",active:"styles-module__active___7ktmc",menuItemIn:"styles-module__menuItemIn___GfmJ3",menuItemClosing:"styles-module__menuItemClosing___m4o-a",menuItemOut:"styles-module__menuItemOut___s0nQD",tooltip:"styles-module__tooltip___Cy6kg",contextMenu:"styles-module__contextMenu___A8fQt",contextMenuItem:"styles-module__contextMenuItem___1u9io",badge:"styles-module__badge___zmiZx"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-fab-menu-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-fab-menu-styles",document.head.appendChild(e)),e.textContent=Ir}var He=Er;import{Fragment as Mr,jsx as Oe,jsxs as Et}from"react/jsx-runtime";function Ho({items:e,onSelect:n,onHide:o,onDoubleTap:t}){let[s,r]=ct(!1),[i,a]=ct(!1),[_,k]=ct({right:24,bottom:24}),[v,C]=ct(null),w=hn(null),B=hn(!1),M=hn({x:0,y:0}),D=hn({x:0,y:0}),U=hn(!1),ce=hn(0),ue=jn(h=>{if(h.button===2)return;B.current=!0,U.current=!1;let H=w.current;if(!H)return;H.setPointerCapture(h.pointerId);let I=H.getBoundingClientRect();M.current={x:h.clientX,y:h.clientY},D.current={x:h.clientX-I.left,y:h.clientY-I.top}},[]),se=jn(h=>{B.current&&((Math.abs(h.clientX-M.current.x)>3||Math.abs(h.clientY-M.current.y)>3)&&(U.current=!0),U.current&&k({right:Math.max(8,Math.min(window.innerWidth-h.clientX-(44-D.current.x),window.innerWidth-52)),bottom:Math.max(8,Math.min(window.innerHeight-h.clientY-(44-D.current.y),window.innerHeight-52))}))},[]),F=jn(h=>{if(B.current&&(w.current?.releasePointerCapture(h.pointerId),B.current=!1,!U.current)){let H=Date.now(),I=H-ce.current<350;if(ce.current=H,I&&t){s&&A(),t();return}s?A():r(!0)}},[s,t]),A=jn(()=>{a(!0),setTimeout(()=>{r(!1),a(!1)},150)},[]),X=jn(h=>{h.preventDefault(),h.stopPropagation(),C({x:h.clientX,y:h.clientY})},[]);return Rr(()=>{if(!s&&!v)return;let h=H=>{if(!H.target.closest("[data-impakers-fab]")){if(v){C(null);return}s&&A()}};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s,v,A]),Et(Mr,{children:[(s||i)&&Oe("div",{className:He.menuItems,style:{position:"fixed",right:_.right+4/2,bottom:_.bottom+44+8},"data-impakers-debug":"","data-impakers-fab":"",children:[...e].reverse().map((h,H)=>Et("button",{className:`${He.menuItem} ${h.active?He.active:""} ${i?He.menuItemClosing:""}`,style:{animationDelay:i?`${H*30}ms`:`${(e.length-1-H)*40}ms`},onClick:I=>{I.stopPropagation(),n(h.id),A()},type:"button","data-impakers-fab":"","data-impakers-debug":"",children:[h.icon,Oe("span",{className:He.tooltip,children:h.label}),h.badge&&h.badge>0?Oe("span",{className:He.badge,children:h.badge>99?"99+":h.badge}):null]},h.id))}),Oe("button",{ref:w,className:`${He.fab} ${s?He.expanded:""}`,style:{position:"fixed",right:_.right,bottom:_.bottom},onPointerDown:ue,onPointerMove:se,onPointerUp:F,onContextMenu:X,type:"button","aria-label":"\uD53C\uB4DC\uBC31 \uBA54\uB274","data-impakers-debug":"","data-impakers-fab":"",children:Et("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Oe("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),Oe("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),v&&Oe("div",{style:{position:"fixed",inset:0,zIndex:2147483647},onMouseDown:()=>C(null),"data-impakers-debug":"","data-impakers-fab":"",children:Oe("div",{className:He.contextMenu,style:{position:"fixed",left:v.x,top:v.y,zIndex:2147483647},onMouseDown:h=>h.stopPropagation(),"data-impakers-fab":"",children:Oe("button",{className:He.contextMenuItem,onMouseDown:h=>{h.stopPropagation(),C(null),o?.()},type:"button",children:"\uC704\uC82F \uC228\uAE30\uAE30"})})})]})}import{useState as Pe,useCallback as Rt,useEffect as bn,useRef as jo}from"react";import{createPortal as zr}from"react-dom";import{useState as ut,useRef as zo,useCallback as Wn}from"react";var Ar=`.styles-module__replyWrapper___wuGqO {
1146
+ }`,Er={fab:"styles-module__fab___wShP-",fabEnter:"styles-module__fabEnter___DMJoo",expanded:"styles-module__expanded___qyto6",menuItems:"styles-module__menuItems___1qNsE",menuItem:"styles-module__menuItem___pB75H",active:"styles-module__active___7ktmc",menuItemIn:"styles-module__menuItemIn___GfmJ3",menuItemClosing:"styles-module__menuItemClosing___m4o-a",menuItemOut:"styles-module__menuItemOut___s0nQD",tooltip:"styles-module__tooltip___Cy6kg",contextMenu:"styles-module__contextMenu___A8fQt",contextMenuItem:"styles-module__contextMenuItem___1u9io",badge:"styles-module__badge___zmiZx"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-fab-menu-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-fab-menu-styles",document.head.appendChild(e)),e.textContent=Ir}var ze=Er;import{Fragment as Mr,jsx as Ve,jsxs as Rt}from"react/jsx-runtime";function Ho({items:e,onSelect:n,onHide:o,onDoubleTap:t}){let[s,r]=ut(!1),[i,a]=ut(!1),[_,k]=ut({right:24,bottom:24}),[v,C]=ut(null),w=hn(null),B=hn(!1),R=hn({x:0,y:0}),D=hn({x:0,y:0}),K=hn(!1),ce=hn(0),ue=jn(h=>{if(h.button===2)return;B.current=!0,K.current=!1;let z=w.current;if(!z)return;z.setPointerCapture(h.pointerId);let T=z.getBoundingClientRect();R.current={x:h.clientX,y:h.clientY},D.current={x:h.clientX-T.left,y:h.clientY-T.top}},[]),re=jn(h=>{B.current&&((Math.abs(h.clientX-R.current.x)>3||Math.abs(h.clientY-R.current.y)>3)&&(K.current=!0),K.current&&k({right:Math.max(8,Math.min(window.innerWidth-h.clientX-(44-D.current.x),window.innerWidth-52)),bottom:Math.max(8,Math.min(window.innerHeight-h.clientY-(44-D.current.y),window.innerHeight-52))}))},[]),A=jn(h=>{if(B.current&&(w.current?.releasePointerCapture(h.pointerId),B.current=!1,!K.current)){let z=Date.now(),T=z-ce.current<350;if(ce.current=z,T&&t){s&&M(),t();return}s?M():r(!0)}},[s,t]),M=jn(()=>{a(!0),setTimeout(()=>{r(!1),a(!1)},150)},[]),Y=jn(h=>{h.preventDefault(),h.stopPropagation(),C({x:h.clientX,y:h.clientY})},[]);return Rr(()=>{if(!s&&!v)return;let h=z=>{if(!z.target.closest("[data-impakers-fab]")){if(v){C(null);return}s&&M()}};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[s,v,M]),Rt(Mr,{children:[(s||i)&&Ve("div",{className:ze.menuItems,style:{position:"fixed",right:_.right+4/2,bottom:_.bottom+44+8},"data-impakers-debug":"","data-impakers-fab":"",children:[...e].reverse().map((h,z)=>Rt("button",{className:`${ze.menuItem} ${h.active?ze.active:""} ${i?ze.menuItemClosing:""}`,style:{animationDelay:i?`${z*30}ms`:`${(e.length-1-z)*40}ms`},onClick:T=>{T.stopPropagation(),n(h.id),M()},type:"button","data-impakers-fab":"","data-impakers-debug":"",children:[h.icon,Ve("span",{className:ze.tooltip,children:h.label}),h.badge&&h.badge>0?Ve("span",{className:ze.badge,children:h.badge>99?"99+":h.badge}):null]},h.id))}),Ve("button",{ref:w,className:`${ze.fab} ${s?ze.expanded:""}`,style:{position:"fixed",right:_.right,bottom:_.bottom},onPointerDown:ue,onPointerMove:re,onPointerUp:A,onContextMenu:Y,type:"button","aria-label":"\uD53C\uB4DC\uBC31 \uBA54\uB274","data-impakers-debug":"","data-impakers-fab":"",children:Rt("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Ve("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),Ve("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),v&&Ve("div",{style:{position:"fixed",inset:0,zIndex:2147483647},onMouseDown:()=>C(null),"data-impakers-debug":"","data-impakers-fab":"",children:Ve("div",{className:ze.contextMenu,style:{position:"fixed",left:v.x,top:v.y,zIndex:2147483647},onMouseDown:h=>h.stopPropagation(),"data-impakers-fab":"",children:Ve("button",{className:ze.contextMenuItem,onMouseDown:h=>{h.stopPropagation(),C(null),o?.()},type:"button",children:"\uC704\uC82F \uC228\uAE30\uAE30"})})})]})}import{useState as Fe,useCallback as Mt,useEffect as bn,useRef as jo}from"react";import{createPortal as zr}from"react-dom";import{useState as _t,useRef as zo,useCallback as Wn}from"react";var Ar=`.styles-module__replyWrapper___wuGqO {
1147
1147
  flex-shrink: 0;
1148
1148
  }
1149
1149
 
@@ -1312,7 +1312,7 @@ ${n.stack?.split(`
1312
1312
  .styles-module__replySend___eTc6O svg {
1313
1313
  width: 16px;
1314
1314
  height: 16px;
1315
- }`,Pr={replyWrapper:"styles-module__replyWrapper___wuGqO",pendingImage:"styles-module__pendingImage___Sc3K4",pendingRemove:"styles-module__pendingRemove___ftBrZ",pendingFile:"styles-module__pendingFile___ss0Dp",fileIcon:"styles-module__fileIcon___lCxGN",fileInfo:"styles-module__fileInfo___WpCET",fileCardName:"styles-module__fileCardName___0idJU",fileCardSize:"styles-module__fileCardSize___b9sJT",replyArea:"styles-module__replyArea___tmywT",replyInput:"styles-module__replyInput___UAMsE",replyToolbar:"styles-module__replyToolbar___c6TcW",replyTool:"styles-module__replyTool___RBxLW",replySend:"styles-module__replySend___eTc6O",active:"styles-module__active___-Ce1c"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-reply-input-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-reply-input-styles",document.head.appendChild(e)),e.textContent=Ar}var be=Pr;import{jsx as ye,jsxs as Ye}from"react/jsx-runtime";function Fr(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(0)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function $r(e){return e.includes("pdf")?"PDF":e.includes("spreadsheet")||e.includes("excel")||e.includes("csv")?"XLS":e.includes("presentation")||e.includes("powerpoint")?"PPT":e.includes("document")||e.includes("word")?"DOC":e.includes("zip")||e.includes("compressed")||e.includes("archive")?"ZIP":e.includes("video")?"VID":e.includes("audio")?"AUD":"FILE"}function Do({onSend:e,onEscape:n,placeholder:o="Reply...",autoFocus:t=!1}){let[s,r]=ut(""),[i,a]=ut(null),[_,k]=ut(null),[v,C]=ut(!1),w=zo(null),B=zo(null),M=s.trim()||i||_,D=Wn(()=>{M&&(e(s.trim(),i||void 0,_||void 0),r(""),a(null),k(null),w.current&&(w.current.style.height="auto"))},[s,i,_,M,e]),U=Wn(F=>{F.stopPropagation(),!F.nativeEvent.isComposing&&(F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),D()),F.key==="Escape"&&n?.())},[D,n]),ce=Wn(()=>{C(!0);let F=document.querySelectorAll("[data-impakers-debug], [data-annotation-marker]");F.forEach(E=>E.style.visibility="hidden"),document.documentElement.classList.add("impakers-selecting");let A=null,X=E=>{A||(A=document.createElement("div"),A.style.cssText="position:fixed;border:2px solid #3b82f6;background:rgba(59,130,246,0.05);border-radius:4px;pointer-events:none;z-index:999999;transition:all 0.08s ease",document.body.appendChild(A)),A.style.left=`${E.left}px`,A.style.top=`${E.top}px`,A.style.width=`${E.width}px`,A.style.height=`${E.height}px`},h=()=>{document.removeEventListener("mousemove",H),document.removeEventListener("click",_e,!0),document.removeEventListener("keydown",I),document.documentElement.classList.remove("impakers-selecting"),A?.remove(),F.forEach(E=>E.style.visibility=""),C(!1)},H=E=>{let q=document.elementFromPoint(E.clientX,E.clientY);!q||q===A||X(q.getBoundingClientRect())},I=E=>{E.key==="Escape"&&h()},_e=async E=>{E.preventDefault(),E.stopPropagation(),E.stopImmediatePropagation();let q=document.elementFromPoint(E.clientX,E.clientY);if(h(),!!q){try{let ee=await et(q);a(ee)}catch(ee){console.error("[@impakers/debug] DOM \uC2A4\uD06C\uB9B0\uC0F7 \uC2E4\uD328:",ee)}w.current?.focus()}};document.addEventListener("mousemove",H),document.addEventListener("click",_e,!0),document.addEventListener("keydown",I)},[]),ue=Wn(()=>{B.current?.click()},[]),se=Wn(F=>{let A=F.target.files?.[0];if(A){if(A.size>4.5*1024*1024){console.warn("[@impakers/debug] \uD30C\uC77C \uD06C\uAE30\uAC00 4.5MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4."),F.target.value="";return}if(A.type.startsWith("image/")){k(null);let X=new FileReader;X.onload=()=>a(X.result),X.readAsDataURL(A)}else a(null),k(A);F.target.value=""}},[]);return Ye("div",{className:be.replyWrapper,"data-impakers-debug":"",children:[i&&Ye("div",{className:be.pendingImage,children:[ye("img",{src:i,alt:"pending"}),ye("button",{className:be.pendingRemove,onClick:()=>a(null),type:"button",children:"\xD7"})]}),_&&Ye("div",{className:be.pendingFile,children:[ye("span",{className:be.fileIcon,children:$r(_.type)}),Ye("span",{className:be.fileInfo,children:[ye("span",{className:be.fileCardName,children:_.name}),ye("span",{className:be.fileCardSize,children:Fr(_.size)})]}),ye("button",{className:be.pendingRemove,onClick:()=>k(null),type:"button",children:"\xD7"})]}),ye("div",{className:be.replyArea,children:ye("textarea",{ref:w,className:be.replyInput,placeholder:o,value:s,onChange:F=>{r(F.target.value);let A=F.target;A.style.height="auto",A.style.height=`${Math.min(A.scrollHeight,120)}px`},onKeyDown:U,rows:2,autoFocus:t})}),Ye("div",{className:be.replyToolbar,children:[ye("button",{className:be.replyTool,onClick:ue,type:"button",title:"\uD30C\uC77C \uCCA8\uBD80",children:Ye("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[ye("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),ye("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),ye("button",{className:be.replyTool,onClick:ce,type:"button",title:"\uC694\uC18C \uC2A4\uD06C\uB9B0\uC0F7",children:Ye("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[ye("path",{d:"M14.5 4h-5L7 7H4a2 2 0 00-2 2v9a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2h-3l-2.5-3z"}),ye("circle",{cx:"12",cy:"13",r:"3"})]})}),ye("button",{className:`${be.replySend} ${M?be.active:""}`,onClick:D,disabled:!M,type:"button",title:"\uC804\uC1A1",children:Ye("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[ye("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),ye("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),ye("input",{ref:B,type:"file",accept:"*/*",style:{display:"none"},onChange:se})]})}var Br=`@keyframes styles-module__slideIn___0o0s- {
1315
+ }`,Pr={replyWrapper:"styles-module__replyWrapper___wuGqO",pendingImage:"styles-module__pendingImage___Sc3K4",pendingRemove:"styles-module__pendingRemove___ftBrZ",pendingFile:"styles-module__pendingFile___ss0Dp",fileIcon:"styles-module__fileIcon___lCxGN",fileInfo:"styles-module__fileInfo___WpCET",fileCardName:"styles-module__fileCardName___0idJU",fileCardSize:"styles-module__fileCardSize___b9sJT",replyArea:"styles-module__replyArea___tmywT",replyInput:"styles-module__replyInput___UAMsE",replyToolbar:"styles-module__replyToolbar___c6TcW",replyTool:"styles-module__replyTool___RBxLW",replySend:"styles-module__replySend___eTc6O",active:"styles-module__active___-Ce1c"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-reply-input-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-reply-input-styles",document.head.appendChild(e)),e.textContent=Ar}var be=Pr;import{jsx as he,jsxs as Ge}from"react/jsx-runtime";function Fr(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(0)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function $r(e){return e.includes("pdf")?"PDF":e.includes("spreadsheet")||e.includes("excel")||e.includes("csv")?"XLS":e.includes("presentation")||e.includes("powerpoint")?"PPT":e.includes("document")||e.includes("word")?"DOC":e.includes("zip")||e.includes("compressed")||e.includes("archive")?"ZIP":e.includes("video")?"VID":e.includes("audio")?"AUD":"FILE"}function Do({onSend:e,onEscape:n,placeholder:o="Reply...",autoFocus:t=!1}){let[s,r]=_t(""),[i,a]=_t(null),[_,k]=_t(null),[v,C]=_t(!1),w=zo(null),B=zo(null),R=s.trim()||i||_,D=Wn(()=>{R&&(e(s.trim(),i||void 0,_||void 0),r(""),a(null),k(null),w.current&&(w.current.style.height="auto"))},[s,i,_,R,e]),K=Wn(A=>{A.stopPropagation(),!A.nativeEvent.isComposing&&(A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),D()),A.key==="Escape"&&n?.())},[D,n]),ce=Wn(()=>{C(!0);let A=document.querySelectorAll("[data-impakers-debug], [data-annotation-marker]");A.forEach(I=>I.style.visibility="hidden"),document.documentElement.classList.add("impakers-selecting");let M=null,Y=I=>{M||(M=document.createElement("div"),M.style.cssText="position:fixed;border:2px solid #3b82f6;background:rgba(59,130,246,0.05);border-radius:4px;pointer-events:none;z-index:999999;transition:all 0.08s ease",document.body.appendChild(M)),M.style.left=`${I.left}px`,M.style.top=`${I.top}px`,M.style.width=`${I.width}px`,M.style.height=`${I.height}px`},h=()=>{document.removeEventListener("mousemove",z),document.removeEventListener("click",_e,!0),document.removeEventListener("keydown",T),document.documentElement.classList.remove("impakers-selecting"),M?.remove(),A.forEach(I=>I.style.visibility=""),C(!1)},z=I=>{let J=document.elementFromPoint(I.clientX,I.clientY);!J||J===M||Y(J.getBoundingClientRect())},T=I=>{I.key==="Escape"&&h()},_e=async I=>{I.preventDefault(),I.stopPropagation(),I.stopImmediatePropagation();let J=document.elementFromPoint(I.clientX,I.clientY);if(h(),!!J){try{let oe=await nt(J);a(oe)}catch(oe){console.error("[@impakers/debug] DOM \uC2A4\uD06C\uB9B0\uC0F7 \uC2E4\uD328:",oe)}w.current?.focus()}};document.addEventListener("mousemove",z),document.addEventListener("click",_e,!0),document.addEventListener("keydown",T)},[]),ue=Wn(()=>{B.current?.click()},[]),re=Wn(A=>{let M=A.target.files?.[0];if(M){if(M.size>4.5*1024*1024){console.warn("[@impakers/debug] \uD30C\uC77C \uD06C\uAE30\uAC00 4.5MB\uB97C \uCD08\uACFC\uD569\uB2C8\uB2E4."),A.target.value="";return}if(M.type.startsWith("image/")){k(null);let Y=new FileReader;Y.onload=()=>a(Y.result),Y.readAsDataURL(M)}else a(null),k(M);A.target.value=""}},[]);return Ge("div",{className:be.replyWrapper,"data-impakers-debug":"",children:[i&&Ge("div",{className:be.pendingImage,children:[he("img",{src:i,alt:"pending"}),he("button",{className:be.pendingRemove,onClick:()=>a(null),type:"button",children:"\xD7"})]}),_&&Ge("div",{className:be.pendingFile,children:[he("span",{className:be.fileIcon,children:$r(_.type)}),Ge("span",{className:be.fileInfo,children:[he("span",{className:be.fileCardName,children:_.name}),he("span",{className:be.fileCardSize,children:Fr(_.size)})]}),he("button",{className:be.pendingRemove,onClick:()=>k(null),type:"button",children:"\xD7"})]}),he("div",{className:be.replyArea,children:he("textarea",{ref:w,className:be.replyInput,placeholder:o,value:s,onChange:A=>{r(A.target.value);let M=A.target;M.style.height="auto",M.style.height=`${Math.min(M.scrollHeight,120)}px`},onKeyDown:K,rows:2,autoFocus:t})}),Ge("div",{className:be.replyToolbar,children:[he("button",{className:be.replyTool,onClick:ue,type:"button",title:"\uD30C\uC77C \uCCA8\uBD80",children:Ge("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[he("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),he("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),he("button",{className:be.replyTool,onClick:ce,type:"button",title:"\uC694\uC18C \uC2A4\uD06C\uB9B0\uC0F7",children:Ge("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[he("path",{d:"M14.5 4h-5L7 7H4a2 2 0 00-2 2v9a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2h-3l-2.5-3z"}),he("circle",{cx:"12",cy:"13",r:"3"})]})}),he("button",{className:`${be.replySend} ${R?be.active:""}`,onClick:D,disabled:!R,type:"button",title:"\uC804\uC1A1",children:Ge("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[he("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),he("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),he("input",{ref:B,type:"file",accept:"*/*",style:{display:"none"},onChange:re})]})}var Br=`@keyframes styles-module__slideIn___0o0s- {
1316
1316
  from {
1317
1317
  transform: translateX(100%);
1318
1318
  }
@@ -2380,7 +2380,7 @@ ${n.stack?.split(`
2380
2380
  white-space: nowrap;
2381
2381
  overflow: hidden;
2382
2382
  text-overflow: ellipsis;
2383
- }`,Hr={backdrop:"styles-module__backdrop___zYhcU",fadeIn:"styles-module__fadeIn___j09Ts",panel:"styles-module__panel___6YS8k",slideIn:"styles-module__slideIn___0o0s-",exiting:"styles-module__exiting___6A-Ag",slideOut:"styles-module__slideOut___nKrBX",header:"styles-module__header___fBbGz",headerLeft:"styles-module__headerLeft___e0YLf",headerTitle:"styles-module__headerTitle___oEPJa",closeBtn:"styles-module__closeBtn___-H8ra",tabs:"styles-module__tabs___nfuX7",tab:"styles-module__tab___Hc-jn",active:"styles-module__active___ZQzA5",tabBadge:"styles-module__tabBadge___IdFDQ",statusFilter:"styles-module__statusFilter___qtBXs",filterChip:"styles-module__filterChip___l2s74",filterCount:"styles-module__filterCount___KukiQ",content:"styles-module__content___L2lRw",card:"styles-module__card___F8qwd",cardHeader:"styles-module__cardHeader___QOVGR",cardAvatar:"styles-module__cardAvatar___FfKmW",cardInfo:"styles-module__cardInfo___BmrdF",cardMeta:"styles-module__cardMeta___7p9KD",cardAuthor:"styles-module__cardAuthor___YvnuR",cardTime:"styles-module__cardTime___N1Png",cardActions:"styles-module__cardActions___7QF72",cardAction:"styles-module__cardAction___t4b3V",cardTitle:"styles-module__cardTitle___xJxDN",cardScreenshot:"styles-module__cardScreenshot___I5-QL",cardRoute:"styles-module__cardRoute___U4gB6",cardRoutePath:"styles-module__cardRoutePath___zP-fh",cardRouteIcon:"styles-module__cardRouteIcon___SBqGj",cardRouteName:"styles-module__cardRouteName___BDH75",cardStatusTime:"styles-module__cardStatusTime___S62W1",cardFooter:"styles-module__cardFooter___wfPa4",cardReplyDot:"styles-module__cardReplyDot___YnqzI",cardReplyCount:"styles-module__cardReplyCount___O1khL",statusDot:"styles-module__statusDot___l4IHG",todo:"styles-module__todo___894P6",inProgress:"styles-module__inProgress___IZ1mJ",done:"styles-module__done___n4cWP",empty:"styles-module__empty___IADrw",emptyIcon:"styles-module__emptyIcon___1x5wT",checkBtn:"styles-module__checkBtn___KjHxm",checked:"styles-module__checked___8pype",cardDone:"styles-module__cardDone___-m4w-",backBtn:"styles-module__backBtn___PTIAl",detailView:"styles-module__detailView___36cvH",detailHeader:"styles-module__detailHeader___Hepgq",detailTitle:"styles-module__detailTitle___7TvrX",detailScreenshot:"styles-module__detailScreenshot___UPF0f",commentsList:"styles-module__commentsList___5Uigg",commentItem:"styles-module__commentItem___5u78u",commentAvatar:"styles-module__commentAvatar___OatKg",commentBody:"styles-module__commentBody___gmv1J",commentMeta:"styles-module__commentMeta___JNJa3",commentAuthorName:"styles-module__commentAuthorName___XNVRk",commentTime:"styles-module__commentTime___CokGf",commentContent:"styles-module__commentContent___yMiLR",loadingComments:"styles-module__loadingComments___zpATD",noComments:"styles-module__noComments___kvl90",replyBox:"styles-module__replyBox___FO-XS",replyInput:"styles-module__replyInput___k8C9e",sendBtn:"styles-module__sendBtn___pBzWa",commentImage:"styles-module__commentImage___LuH8X",commentFileCard:"styles-module__commentFileCard___XE44y",commentFileIcon:"styles-module__commentFileIcon___G58-y",commentFileInfo:"styles-module__commentFileInfo___OFIhR",commentFileName:"styles-module__commentFileName___NUoII",commentFileSize:"styles-module__commentFileSize___sokU8",filePreviewOverlay:"styles-module__filePreviewOverlay___5RxYd",filePreviewModal:"styles-module__filePreviewModal___MGJLW",filePreviewHeader:"styles-module__filePreviewHeader___E9SWJ",filePreviewName:"styles-module__filePreviewName___z8t-L",filePreviewActions:"styles-module__filePreviewActions___weizo",filePreviewOpen:"styles-module__filePreviewOpen___JpaEs",filePreviewClose:"styles-module__filePreviewClose___TFcbr",filePreviewBody:"styles-module__filePreviewBody___gwg1S",filePreviewIframe:"styles-module__filePreviewIframe___OQ3Oo",filePreviewFallback:"styles-module__filePreviewFallback___U1rB2",filePreviewFallbackIcon:"styles-module__filePreviewFallbackIcon___0--41",lightbox:"styles-module__lightbox___8CDdt",lightboxClose:"styles-module__lightboxClose___VGfjh",historyFilter:"styles-module__historyFilter___IoWL4",historyDateWrap:"styles-module__historyDateWrap___reBzb",filterChipClear:"styles-module__filterChipClear___Sx4c3",datePopover:"styles-module__datePopover___AYzLr",dateInput:"styles-module__dateInput___Ofr3Y",historyItem:"styles-module__historyItem___G4kbt",historyDot:"styles-module__historyDot___0z439",historyDot_created:"styles-module__historyDot_created___G-qjM",historyDot_status_changed:"styles-module__historyDot_status_changed___jsanw",historyDot_comment_added:"styles-module__historyDot_comment_added___5-lrl",historyBody:"styles-module__historyBody___i-k1p",historyStatusChange:"styles-module__historyStatusChange___1l8GK",historyStatusBadge:"styles-module__historyStatusBadge___H72NB",status_todo:"styles-module__status_todo___CsneX",status_in_progress:"styles-module__status_in_progress___7-R87",status_done:"styles-module__status_done___0cBE-",historyArrow:"styles-module__historyArrow___gcXso",historyLabel:"styles-module__historyLabel___rfxYN",historyComment:"styles-module__historyComment___U6jkL",historyCommentAuthor:"styles-module__historyCommentAuthor___waQnr",historyCommentContent:"styles-module__historyCommentContent___7hQJ7",historyFooter:"styles-module__historyFooter___RnBO3",historyTime:"styles-module__historyTime___bWpM4",historyRef:"styles-module__historyRef___X8lNJ"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-inbox-panel-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-inbox-panel-styles",document.head.appendChild(e)),e.textContent=Br}var l=Hr;import{Fragment as At,jsx as m,jsxs as y}from"react/jsx-runtime";function Dr({src:e,onClose:n}){return bn(()=>{let o=t=>{t.key==="Escape"&&n()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[n]),y("div",{className:l.lightbox,onClick:n,"data-impakers-debug":"",children:[m("img",{src:e,alt:"enlarged",onClick:o=>o.stopPropagation()}),m("button",{className:l.lightboxClose,onClick:n,type:"button",children:"\xD7"})]})}function jr(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(0)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function Wo(e){return e.includes("pdf")?"PDF":e.includes("spreadsheet")||e.includes("excel")||e.includes("csv")?"XLS":e.includes("presentation")||e.includes("powerpoint")?"PPT":e.includes("document")||e.includes("word")?"DOC":e.includes("zip")||e.includes("compressed")||e.includes("archive")?"ZIP":e.includes("video")?"VID":e.includes("audio")?"AUD":"FILE"}function Wr(e){let n=e.match(/\/d\/([^/]+)/);return n?n[1]:null}function Or(e,n,o){let t=/\.(pptx?|xlsx?|docx?)$/i.test(e)||n.includes("presentation")||n.includes("powerpoint")||n.includes("spreadsheet")||n.includes("excel")||n.includes("document")||n.includes("word")||n.includes("msword");if(o==="google_drive"){let s=Wr(e);if(s)return`https://drive.google.com/file/d/${s}/preview`}return t&&o!=="google_drive"?`https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(e)}`:n.includes("pdf")?e:null}function Vr({fileUrl:e,fileName:n,fileType:o,fileSource:t,onClose:s}){bn(()=>{let i=a=>{a.key==="Escape"&&s()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[s]);let r=Or(e,o,t);return m("div",{className:l.filePreviewOverlay,onClick:s,"data-impakers-debug":"",children:y("div",{className:l.filePreviewModal,onClick:i=>i.stopPropagation(),children:[y("div",{className:l.filePreviewHeader,children:[m("span",{className:l.filePreviewName,children:n}),y("div",{className:l.filePreviewActions,children:[y("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:l.filePreviewOpen,children:[y("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"14",height:"14",children:[m("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),m("polyline",{points:"15 3 21 3 21 9"}),m("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),"\uC5F4\uAE30"]}),m("button",{className:l.filePreviewClose,onClick:s,type:"button",children:"\xD7"})]})]}),m("div",{className:l.filePreviewBody,children:r?m("iframe",{src:r,className:l.filePreviewIframe,title:n}):y("div",{className:l.filePreviewFallback,children:[m("span",{className:l.filePreviewFallbackIcon,children:Wo(o)}),m("span",{children:"\uBBF8\uB9AC\uBCF4\uAE30\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD615\uC2DD\uC785\uB2C8\uB2E4"}),m("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:"\uD30C\uC77C \uC5F4\uAE30"})]})})]})})}function yn(e){let n=new Date(e),o=Date.now()-n.getTime(),t=_=>String(_).padStart(2,"0"),s=`${n.getMonth()+1}/${n.getDate()} ${t(n.getHours())}:${t(n.getMinutes())}`,r=Math.floor(o/6e4);if(r<1)return`${s} (\uBC29\uAE08)`;if(r<60)return`${s} (${r}\uBD84 \uC804)`;let i=Math.floor(r/60);if(i<24)return`${s} (${i}\uC2DC\uAC04 \uC804)`;let a=Math.floor(i/24);return`${s} (${a}\uC77C \uC804)`}function Mt(e){return e.slice(0,1).toUpperCase()}function Oo({pageItems:e,allItems:n,currentPath:o,serviceName:t,endpoint:s,currentUserName:r,currentUserId:i,onClose:a,onHistoryViewed:_,newNotiCount:k}){let[v,C]=Pe("page"),[w,B]=Pe("todo"),[M,D]=Pe(""),[U,ce]=Pe(!1),ue=jo(null),[se,F]=Pe([]),[A,X]=Pe(!1),[h,H]=Pe(!1),[I,_e]=Pe(null),[E,q]=Pe([]),[ee,we]=Pe(!1),[Me,Se]=Pe(null),[ne,b]=Pe(null),x=jo(null),p=Rt(()=>{if(I){_e(null),q([]);return}H(!0),setTimeout(()=>a(),150)},[a,I]),S=Rt(async u=>{_e(u);let K=pn(Xe(u.id));q(K||[]),we(!K)},[s]);bn(()=>{if(!I)return;let u=Xe(I.id),K=pn(u);K&&(q(K),we(!1));let Ae=zn(u,pe=>{q(pe),we(!1)});return st(s,I.id,{staleWhileRevalidate:!0}).then(pe=>{q(pe),we(!1)}).catch(()=>{we(!1)}),Ae},[I,s]),bn(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[E.length]),bn(()=>{if(!U)return;let u=K=>{ue.current&&!ue.current.contains(K.target)&&ce(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[U]);let z=Rt(async(u,K,Ae)=>{if(I)try{let pe;if(Ae)try{pe=await it(s,Ae,"comment",I.id)}catch(Ge){console.error("[@impakers/debug] \uD30C\uC77C \uC5C5\uB85C\uB4DC \uC2E4\uD328:",Ge)}await rt(s,I.id,u,r,i,K,pe)}catch(pe){console.error("[@impakers/debug] \uCF54\uBA58\uD2B8 \uC804\uC1A1 \uC2E4\uD328:",pe)}},[I,s,r,i]),te=v==="page"?e:v==="all"?n:[],re=te.filter(u=>u.status===w),P=te.filter(u=>u.status==="todo").length,me=te.filter(u=>u.status==="in_progress").length,ie=te.filter(u=>u.status==="done").length;return bn(()=>{v==="history"&&(X(!0),at(s,{date:M||void 0,limit:200}).then(F).catch(()=>F([])).finally(()=>X(!1)))},[v,M,s]),typeof document>"u"?null:zr(y("div",{"data-impakers-debug":"",children:[m("div",{className:l.backdrop,onClick:p}),y("div",{className:`${l.panel} ${h?l.exiting:""}`,"data-impakers-debug":"",children:[y("div",{className:l.header,children:[y("div",{className:l.headerLeft,children:[I&&m("button",{className:l.backBtn,onClick:p,type:"button",children:m("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16",children:m("polyline",{points:"15 18 9 12 15 6"})})}),m("span",{className:l.headerTitle,children:I?"\uD53C\uB4DC\uBC31 \uC0C1\uC138":t||"Feedback"})]}),m("button",{className:l.closeBtn,onClick:()=>{H(!0),setTimeout(()=>a(),150)},type:"button",children:m("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:m("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),I?y("div",{className:l.detailView,children:[y("div",{className:l.detailHeader,children:[m("div",{className:l.cardAvatar,children:Mt(I.authorName)}),y("div",{children:[y("div",{className:l.cardMeta,children:[m("span",{className:l.cardAuthor,children:I.authorName}),m("span",{className:l.cardTime,children:yn(I.createdAt)})]}),m("div",{className:l.detailTitle,children:I.title.replace(/^\[피드백\]\s*/,"")})]})]}),I.screenshot&&m("div",{className:l.detailScreenshot,children:m("img",{src:I.screenshot,alt:"screenshot"})}),y("div",{className:l.commentsList,children:[ee&&m(dt,{message:"\uB313\uAE00 \uB85C\uB529 \uC911..."}),!ee&&E.length===0&&m("div",{className:l.noComments,children:"\uC544\uC9C1 \uB313\uAE00\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"}),E.map(u=>y("div",{className:l.commentItem,children:[m("div",{className:l.commentAvatar,style:{width:22,height:22,fontSize:10},children:Mt(u.authorName)}),y("div",{className:l.commentBody,children:[y("div",{className:l.commentMeta,children:[m("span",{className:l.commentAuthorName,children:u.authorName}),m("span",{className:l.commentTime,children:yn(u.createdAt)})]}),u.content&&m("div",{className:l.commentContent,children:u.content}),u.imageUrl&&m("div",{className:l.commentImage,onClick:K=>{K.stopPropagation(),Se(u.imageUrl)},children:m("img",{src:u.imageUrl,alt:"attachment"})}),u.fileUrl&&y("div",{className:l.commentFileCard,onClick:K=>{K.stopPropagation(),b({url:u.fileUrl,name:u.fileName||"\uD30C\uC77C",type:u.fileType||"",source:u.fileSource})},children:[m("span",{className:l.commentFileIcon,children:Wo(u.fileType||"")}),y("span",{className:l.commentFileInfo,children:[m("span",{className:l.commentFileName,children:u.fileName||"\uD30C\uC77C"}),u.fileSize!=null&&m("span",{className:l.commentFileSize,children:jr(u.fileSize)})]})]})]})]},u.id)),m("div",{ref:x})]}),m(Do,{onSend:z,onEscape:p,autoFocus:!0})]}):y(At,{children:[y("div",{className:l.tabs,children:[y("button",{className:`${l.tab} ${v==="page"?l.active:""}`,onClick:()=>C("page"),type:"button",children:["This Page",e.length>0&&m("span",{className:l.tabBadge,children:e.length})]}),y("button",{className:`${l.tab} ${v==="all"?l.active:""}`,onClick:()=>C("all"),type:"button",children:["All",n.length>0&&m("span",{className:l.tabBadge,children:n.length})]}),y("button",{className:`${l.tab} ${v==="history"?l.active:""}`,onClick:()=>{C("history"),_?.()},type:"button",children:["History",k&&k>0?m("span",{className:l.tabBadge,children:k}):null]})]}),v==="history"?y(At,{children:[y("div",{className:l.historyFilter,children:[y("div",{className:l.historyDateWrap,ref:ue,children:[y("button",{className:`${l.filterChip} ${M?l.active:""}`,onClick:()=>ce(u=>!u),type:"button",children:[y("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"13",height:"13",children:[m("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),m("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),m("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),m("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),M?`${new Date(M).getMonth()+1}/${new Date(M).getDate()}`:"\uB0A0\uC9DC"]}),U&&m("div",{className:l.datePopover,children:m("input",{type:"date",value:M,onChange:u=>{D(u.target.value),ce(!1)},className:l.dateInput,autoFocus:!0})})]}),M&&m("button",{className:l.filterChipClear,onClick:()=>D(""),type:"button",title:"\uD544\uD130 \uCD08\uAE30\uD654",children:"\xD7"})]}),m("div",{className:l.content,children:A?m("div",{className:l.empty,children:"\uB85C\uB529 \uC911..."}):se.length===0?y("div",{className:l.empty,children:[m("div",{className:l.emptyIcon,children:y("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[m("circle",{cx:"12",cy:"12",r:"10"}),m("polyline",{points:"12 6 12 12 16 14"})]})}),"\uD788\uC2A4\uD1A0\uB9AC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4"]}):se.map((u,K)=>y("div",{className:l.historyItem,children:[m("div",{className:`${l.historyDot} ${l[`historyDot_${u.action}`]}`}),y("div",{className:l.historyBody,children:[u.action==="status_changed"&&y("div",{className:l.historyStatusChange,children:[m("span",{className:`${l.historyStatusBadge} ${l[`status_${u.fromStatus}`]}`,children:u.fromStatus==="todo"?"\uB300\uAE30":u.fromStatus==="in_progress"?"\uC9C4\uD589\uC911":"\uC644\uB8CC"}),m("span",{className:l.historyArrow,children:"\u2192"}),m("span",{className:`${l.historyStatusBadge} ${l[`status_${u.toStatus}`]}`,children:u.toStatus==="todo"?"\uB300\uAE30":u.toStatus==="in_progress"?"\uC9C4\uD589\uC911":"\uC644\uB8CC"})]}),u.action==="created"&&y("div",{className:l.historyStatusChange,children:[m("span",{className:l.historyLabel,children:"\uC0DD\uC131"}),m("span",{className:`${l.historyStatusBadge} ${l.status_todo}`,children:"\uB300\uAE30"})]}),u.action==="comment_added"&&y("div",{className:l.historyComment,children:[m("span",{className:l.historyCommentAuthor,children:u.actorName||"\uC775\uBA85"}),u.metadata?.content&&m("span",{className:l.historyCommentContent,children:String(u.metadata.content).slice(0,100)})]}),y("div",{className:l.historyFooter,children:[m("span",{className:l.historyTime,children:yn(u.createdAt)}),m("span",{className:l.historyRef,children:(u.taskTitle||"").replace(/^\[피드백\]\s*/,"")})]})]})]},`${u.id}-${u.action}-${K}`))})]}):y(At,{children:[y("div",{className:l.statusFilter,children:[y("button",{className:`${l.filterChip} ${w==="todo"?l.active:""}`,onClick:()=>B("todo"),type:"button",children:["\uC9C4\uD589\uC804",P>0&&m("span",{className:l.filterCount,children:P})]}),y("button",{className:`${l.filterChip} ${w==="in_progress"?l.active:""}`,onClick:()=>B("in_progress"),type:"button",children:["\uC9C4\uD589\uC911",me>0&&m("span",{className:l.filterCount,children:me})]}),y("button",{className:`${l.filterChip} ${w==="done"?l.active:""}`,onClick:()=>B("done"),type:"button",children:["\uC644\uB8CC",ie>0&&m("span",{className:l.filterCount,children:ie})]})]}),m("div",{className:l.content,children:re.length===0?y("div",{className:l.empty,children:[m("div",{className:l.emptyIcon,children:m("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:m("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})})}),v==="page"?"\uC774 \uD398\uC774\uC9C0\uC5D0 \uD53C\uB4DC\uBC31\uC774 \uC5C6\uC2B5\uB2C8\uB2E4":"\uD53C\uB4DC\uBC31\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"]}):re.map(u=>y("div",{className:`${l.card} ${u.status==="done"?l.cardDone:""}`,onClick:()=>S(u),children:[y("div",{className:l.cardHeader,children:[m("div",{className:l.cardAvatar,children:Mt(u.authorName)}),m("div",{className:l.cardInfo,children:y("div",{className:l.cardMeta,children:[m("span",{className:l.cardAuthor,children:u.authorName}),m("span",{className:l.cardTime,children:yn(u.createdAt)})]})})]}),m("div",{className:l.cardTitle,children:u.title.replace(/^\[피드백\]\s*/,"")}),u.screenshot&&m("div",{className:l.cardScreenshot,children:m("img",{src:u.screenshot,alt:"screenshot"})}),v==="all"&&u.feedbackUrl&&y("div",{className:l.cardRoute,onClick:K=>{K.stopPropagation(),window.location.href=u.feedbackUrl},title:"\uD398\uC774\uC9C0\uB85C \uC774\uB3D9",children:[m("span",{className:l.cardRoutePath,children:u.feedbackUrl}),y("svg",{className:l.cardRouteIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"12",height:"12",children:[m("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),m("polyline",{points:"15 3 21 3 21 9"}),m("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})]}),(u.startedAt||u.completedAt)&&y("div",{className:l.cardStatusTime,children:[u.startedAt&&u.status!=="todo"&&y("span",{children:["\uC9C4\uD589 \uC2DC\uC791: ",yn(u.startedAt)]}),u.completedAt&&u.status==="done"&&y("span",{children:["\uC644\uB8CC: ",yn(u.completedAt)]})]}),y("div",{className:l.cardFooter,children:[m("span",{className:l.cardReplyDot}),y("span",{className:l.cardReplyCount,children:[u.commentCount," ",u.commentCount===1?"Reply":"Replies"]})]})]},u.id))})]})]})]}),Me&&m(Dr,{src:Me,onClose:()=>Se(null)}),ne&&m(Vr,{fileUrl:ne.url,fileName:ne.name,fileType:ne.type,fileSource:ne.source,onClose:()=>b(null)})]}),document.body)}import{useState as Ie,useRef as On,useEffect as Pt,useCallback as Qe}from"react";import{createPortal as Zr}from"react-dom";var Ur=`@keyframes styles-module__slideIn___Wx-kZ {
2383
+ }`,Hr={backdrop:"styles-module__backdrop___zYhcU",fadeIn:"styles-module__fadeIn___j09Ts",panel:"styles-module__panel___6YS8k",slideIn:"styles-module__slideIn___0o0s-",exiting:"styles-module__exiting___6A-Ag",slideOut:"styles-module__slideOut___nKrBX",header:"styles-module__header___fBbGz",headerLeft:"styles-module__headerLeft___e0YLf",headerTitle:"styles-module__headerTitle___oEPJa",closeBtn:"styles-module__closeBtn___-H8ra",tabs:"styles-module__tabs___nfuX7",tab:"styles-module__tab___Hc-jn",active:"styles-module__active___ZQzA5",tabBadge:"styles-module__tabBadge___IdFDQ",statusFilter:"styles-module__statusFilter___qtBXs",filterChip:"styles-module__filterChip___l2s74",filterCount:"styles-module__filterCount___KukiQ",content:"styles-module__content___L2lRw",card:"styles-module__card___F8qwd",cardHeader:"styles-module__cardHeader___QOVGR",cardAvatar:"styles-module__cardAvatar___FfKmW",cardInfo:"styles-module__cardInfo___BmrdF",cardMeta:"styles-module__cardMeta___7p9KD",cardAuthor:"styles-module__cardAuthor___YvnuR",cardTime:"styles-module__cardTime___N1Png",cardActions:"styles-module__cardActions___7QF72",cardAction:"styles-module__cardAction___t4b3V",cardTitle:"styles-module__cardTitle___xJxDN",cardScreenshot:"styles-module__cardScreenshot___I5-QL",cardRoute:"styles-module__cardRoute___U4gB6",cardRoutePath:"styles-module__cardRoutePath___zP-fh",cardRouteIcon:"styles-module__cardRouteIcon___SBqGj",cardRouteName:"styles-module__cardRouteName___BDH75",cardStatusTime:"styles-module__cardStatusTime___S62W1",cardFooter:"styles-module__cardFooter___wfPa4",cardReplyDot:"styles-module__cardReplyDot___YnqzI",cardReplyCount:"styles-module__cardReplyCount___O1khL",statusDot:"styles-module__statusDot___l4IHG",todo:"styles-module__todo___894P6",inProgress:"styles-module__inProgress___IZ1mJ",done:"styles-module__done___n4cWP",empty:"styles-module__empty___IADrw",emptyIcon:"styles-module__emptyIcon___1x5wT",checkBtn:"styles-module__checkBtn___KjHxm",checked:"styles-module__checked___8pype",cardDone:"styles-module__cardDone___-m4w-",backBtn:"styles-module__backBtn___PTIAl",detailView:"styles-module__detailView___36cvH",detailHeader:"styles-module__detailHeader___Hepgq",detailTitle:"styles-module__detailTitle___7TvrX",detailScreenshot:"styles-module__detailScreenshot___UPF0f",commentsList:"styles-module__commentsList___5Uigg",commentItem:"styles-module__commentItem___5u78u",commentAvatar:"styles-module__commentAvatar___OatKg",commentBody:"styles-module__commentBody___gmv1J",commentMeta:"styles-module__commentMeta___JNJa3",commentAuthorName:"styles-module__commentAuthorName___XNVRk",commentTime:"styles-module__commentTime___CokGf",commentContent:"styles-module__commentContent___yMiLR",loadingComments:"styles-module__loadingComments___zpATD",noComments:"styles-module__noComments___kvl90",replyBox:"styles-module__replyBox___FO-XS",replyInput:"styles-module__replyInput___k8C9e",sendBtn:"styles-module__sendBtn___pBzWa",commentImage:"styles-module__commentImage___LuH8X",commentFileCard:"styles-module__commentFileCard___XE44y",commentFileIcon:"styles-module__commentFileIcon___G58-y",commentFileInfo:"styles-module__commentFileInfo___OFIhR",commentFileName:"styles-module__commentFileName___NUoII",commentFileSize:"styles-module__commentFileSize___sokU8",filePreviewOverlay:"styles-module__filePreviewOverlay___5RxYd",filePreviewModal:"styles-module__filePreviewModal___MGJLW",filePreviewHeader:"styles-module__filePreviewHeader___E9SWJ",filePreviewName:"styles-module__filePreviewName___z8t-L",filePreviewActions:"styles-module__filePreviewActions___weizo",filePreviewOpen:"styles-module__filePreviewOpen___JpaEs",filePreviewClose:"styles-module__filePreviewClose___TFcbr",filePreviewBody:"styles-module__filePreviewBody___gwg1S",filePreviewIframe:"styles-module__filePreviewIframe___OQ3Oo",filePreviewFallback:"styles-module__filePreviewFallback___U1rB2",filePreviewFallbackIcon:"styles-module__filePreviewFallbackIcon___0--41",lightbox:"styles-module__lightbox___8CDdt",lightboxClose:"styles-module__lightboxClose___VGfjh",historyFilter:"styles-module__historyFilter___IoWL4",historyDateWrap:"styles-module__historyDateWrap___reBzb",filterChipClear:"styles-module__filterChipClear___Sx4c3",datePopover:"styles-module__datePopover___AYzLr",dateInput:"styles-module__dateInput___Ofr3Y",historyItem:"styles-module__historyItem___G4kbt",historyDot:"styles-module__historyDot___0z439",historyDot_created:"styles-module__historyDot_created___G-qjM",historyDot_status_changed:"styles-module__historyDot_status_changed___jsanw",historyDot_comment_added:"styles-module__historyDot_comment_added___5-lrl",historyBody:"styles-module__historyBody___i-k1p",historyStatusChange:"styles-module__historyStatusChange___1l8GK",historyStatusBadge:"styles-module__historyStatusBadge___H72NB",status_todo:"styles-module__status_todo___CsneX",status_in_progress:"styles-module__status_in_progress___7-R87",status_done:"styles-module__status_done___0cBE-",historyArrow:"styles-module__historyArrow___gcXso",historyLabel:"styles-module__historyLabel___rfxYN",historyComment:"styles-module__historyComment___U6jkL",historyCommentAuthor:"styles-module__historyCommentAuthor___waQnr",historyCommentContent:"styles-module__historyCommentContent___7hQJ7",historyFooter:"styles-module__historyFooter___RnBO3",historyTime:"styles-module__historyTime___bWpM4",historyRef:"styles-module__historyRef___X8lNJ"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-inbox-panel-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-inbox-panel-styles",document.head.appendChild(e)),e.textContent=Br}var l=Hr;import{Fragment as Pt,jsx as m,jsxs as y}from"react/jsx-runtime";function Dr({src:e,onClose:n}){return bn(()=>{let o=t=>{t.key==="Escape"&&n()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[n]),y("div",{className:l.lightbox,onClick:n,"data-impakers-debug":"",children:[m("img",{src:e,alt:"enlarged",onClick:o=>o.stopPropagation()}),m("button",{className:l.lightboxClose,onClick:n,type:"button",children:"\xD7"})]})}function jr(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(0)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function Wo(e){return e.includes("pdf")?"PDF":e.includes("spreadsheet")||e.includes("excel")||e.includes("csv")?"XLS":e.includes("presentation")||e.includes("powerpoint")?"PPT":e.includes("document")||e.includes("word")?"DOC":e.includes("zip")||e.includes("compressed")||e.includes("archive")?"ZIP":e.includes("video")?"VID":e.includes("audio")?"AUD":"FILE"}function Wr(e){let n=e.match(/\/d\/([^/]+)/);return n?n[1]:null}function Or(e,n,o){let t=/\.(pptx?|xlsx?|docx?)$/i.test(e)||n.includes("presentation")||n.includes("powerpoint")||n.includes("spreadsheet")||n.includes("excel")||n.includes("document")||n.includes("word")||n.includes("msword");if(o==="google_drive"){let s=Wr(e);if(s)return`https://drive.google.com/file/d/${s}/preview`}return t&&o!=="google_drive"?`https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(e)}`:n.includes("pdf")?e:null}function Vr({fileUrl:e,fileName:n,fileType:o,fileSource:t,onClose:s}){bn(()=>{let i=a=>{a.key==="Escape"&&s()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[s]);let r=Or(e,o,t);return m("div",{className:l.filePreviewOverlay,onClick:s,"data-impakers-debug":"",children:y("div",{className:l.filePreviewModal,onClick:i=>i.stopPropagation(),children:[y("div",{className:l.filePreviewHeader,children:[m("span",{className:l.filePreviewName,children:n}),y("div",{className:l.filePreviewActions,children:[y("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:l.filePreviewOpen,children:[y("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"14",height:"14",children:[m("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),m("polyline",{points:"15 3 21 3 21 9"}),m("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),"\uC5F4\uAE30"]}),m("button",{className:l.filePreviewClose,onClick:s,type:"button",children:"\xD7"})]})]}),m("div",{className:l.filePreviewBody,children:r?m("iframe",{src:r,className:l.filePreviewIframe,title:n}):y("div",{className:l.filePreviewFallback,children:[m("span",{className:l.filePreviewFallbackIcon,children:Wo(o)}),m("span",{children:"\uBBF8\uB9AC\uBCF4\uAE30\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD615\uC2DD\uC785\uB2C8\uB2E4"}),m("a",{href:e,target:"_blank",rel:"noopener noreferrer",children:"\uD30C\uC77C \uC5F4\uAE30"})]})})]})})}function yn(e){let n=new Date(e),o=Date.now()-n.getTime(),t=_=>String(_).padStart(2,"0"),s=`${n.getMonth()+1}/${n.getDate()} ${t(n.getHours())}:${t(n.getMinutes())}`,r=Math.floor(o/6e4);if(r<1)return`${s} (\uBC29\uAE08)`;if(r<60)return`${s} (${r}\uBD84 \uC804)`;let i=Math.floor(r/60);if(i<24)return`${s} (${i}\uC2DC\uAC04 \uC804)`;let a=Math.floor(i/24);return`${s} (${a}\uC77C \uC804)`}function At(e){return e.slice(0,1).toUpperCase()}function Oo({pageItems:e,allItems:n,currentPath:o,serviceName:t,endpoint:s,currentUserName:r,currentUserId:i,onClose:a,onHistoryViewed:_,newNotiCount:k}){let[v,C]=Fe("page"),[w,B]=Fe("todo"),[R,D]=Fe(""),[K,ce]=Fe(!1),ue=jo(null),[re,A]=Fe([]),[M,Y]=Fe(!1),[h,z]=Fe(!1),[T,_e]=Fe(null),[I,J]=Fe([]),[oe,me]=Fe(!1),[Me,we]=Fe(null),[pe,b]=Fe(null),x=jo(null),ee=Mt(()=>{if(T){_e(null),J([]);return}z(!0),setTimeout(()=>a(),150)},[a,T]),p=Mt(async u=>{_e(u);let j=pn(qe(u.id));J(j||[]),me(!j)},[s]);bn(()=>{if(!T)return;let u=qe(T.id),j=pn(u);j&&(J(j),me(!1));let Ae=zn(u,ye=>{J(ye),me(!1)});return rt(s,T.id,{staleWhileRevalidate:!0}).then(ye=>{J(ye),me(!1)}).catch(()=>{me(!1)}),Ae},[T,s]),bn(()=>{x.current?.scrollIntoView({behavior:"smooth"})},[I.length]),bn(()=>{if(!K)return;let u=j=>{ue.current&&!ue.current.contains(j.target)&&ce(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[K]);let P=Mt(async(u,j,Ae)=>{if(T)try{let ye;if(Ae)try{ye=await at(s,Ae,"comment",T.id)}catch(Pe){console.error("[@impakers/debug] \uD30C\uC77C \uC5C5\uB85C\uB4DC \uC2E4\uD328:",Pe)}await it(s,T.id,u,r,i,j,ye)}catch(ye){console.error("[@impakers/debug] \uCF54\uBA58\uD2B8 \uC804\uC1A1 \uC2E4\uD328:",ye)}},[T,s,r,i]),H=v==="page"?e:v==="all"?n:[],ie=H.filter(u=>u.status===w),F=H.filter(u=>u.status==="todo").length,Z=H.filter(u=>u.status==="in_progress").length,te=H.filter(u=>u.status==="done").length;return bn(()=>{v==="history"&&(Y(!0),lt(s,{date:R||void 0,limit:200}).then(A).catch(()=>A([])).finally(()=>Y(!1)))},[v,R,s]),typeof document>"u"?null:zr(y("div",{"data-impakers-debug":"",children:[m("div",{className:l.backdrop,onClick:ee}),y("div",{className:`${l.panel} ${h?l.exiting:""}`,"data-impakers-debug":"",children:[y("div",{className:l.header,children:[y("div",{className:l.headerLeft,children:[T&&m("button",{className:l.backBtn,onClick:ee,type:"button",children:m("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16",children:m("polyline",{points:"15 18 9 12 15 6"})})}),m("span",{className:l.headerTitle,children:T?"\uD53C\uB4DC\uBC31 \uC0C1\uC138":t||"Feedback"})]}),m("button",{className:l.closeBtn,onClick:()=>{z(!0),setTimeout(()=>a(),150)},type:"button",children:m("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:m("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),T?y("div",{className:l.detailView,children:[y("div",{className:l.detailHeader,children:[m("div",{className:l.cardAvatar,children:At(T.authorName)}),y("div",{children:[y("div",{className:l.cardMeta,children:[m("span",{className:l.cardAuthor,children:T.authorName}),m("span",{className:l.cardTime,children:yn(T.createdAt)})]}),m("div",{className:l.detailTitle,children:T.title.replace(/^\[피드백\]\s*/,"")})]})]}),T.screenshot&&m("div",{className:l.detailScreenshot,children:m("img",{src:T.screenshot,alt:"screenshot"})}),y("div",{className:l.commentsList,children:[oe&&m(ct,{message:"\uB313\uAE00 \uB85C\uB529 \uC911..."}),!oe&&I.length===0&&m("div",{className:l.noComments,children:"\uC544\uC9C1 \uB313\uAE00\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"}),I.map(u=>y("div",{className:l.commentItem,children:[m("div",{className:l.commentAvatar,style:{width:22,height:22,fontSize:10},children:At(u.authorName)}),y("div",{className:l.commentBody,children:[y("div",{className:l.commentMeta,children:[m("span",{className:l.commentAuthorName,children:u.authorName}),m("span",{className:l.commentTime,children:yn(u.createdAt)})]}),u.content&&m("div",{className:l.commentContent,children:u.content}),u.imageUrl&&m("div",{className:l.commentImage,onClick:j=>{j.stopPropagation(),we(u.imageUrl)},children:m("img",{src:u.imageUrl,alt:"attachment"})}),u.fileUrl&&y("div",{className:l.commentFileCard,onClick:j=>{j.stopPropagation(),b({url:u.fileUrl,name:u.fileName||"\uD30C\uC77C",type:u.fileType||"",source:u.fileSource})},children:[m("span",{className:l.commentFileIcon,children:Wo(u.fileType||"")}),y("span",{className:l.commentFileInfo,children:[m("span",{className:l.commentFileName,children:u.fileName||"\uD30C\uC77C"}),u.fileSize!=null&&m("span",{className:l.commentFileSize,children:jr(u.fileSize)})]})]})]})]},u.id)),m("div",{ref:x})]}),m(Do,{onSend:P,onEscape:ee,autoFocus:!0})]}):y(Pt,{children:[y("div",{className:l.tabs,children:[y("button",{className:`${l.tab} ${v==="page"?l.active:""}`,onClick:()=>C("page"),type:"button",children:["This Page",e.length>0&&m("span",{className:l.tabBadge,children:e.length})]}),y("button",{className:`${l.tab} ${v==="all"?l.active:""}`,onClick:()=>C("all"),type:"button",children:["All",n.length>0&&m("span",{className:l.tabBadge,children:n.length})]}),y("button",{className:`${l.tab} ${v==="history"?l.active:""}`,onClick:()=>{C("history"),_?.()},type:"button",children:["History",k&&k>0?m("span",{className:l.tabBadge,children:k}):null]})]}),v==="history"?y(Pt,{children:[y("div",{className:l.historyFilter,children:[y("div",{className:l.historyDateWrap,ref:ue,children:[y("button",{className:`${l.filterChip} ${R?l.active:""}`,onClick:()=>ce(u=>!u),type:"button",children:[y("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"13",height:"13",children:[m("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"}),m("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),m("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),m("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),R?`${new Date(R).getMonth()+1}/${new Date(R).getDate()}`:"\uB0A0\uC9DC"]}),K&&m("div",{className:l.datePopover,children:m("input",{type:"date",value:R,onChange:u=>{D(u.target.value),ce(!1)},className:l.dateInput,autoFocus:!0})})]}),R&&m("button",{className:l.filterChipClear,onClick:()=>D(""),type:"button",title:"\uD544\uD130 \uCD08\uAE30\uD654",children:"\xD7"})]}),m("div",{className:l.content,children:M?m("div",{className:l.empty,children:"\uB85C\uB529 \uC911..."}):re.length===0?y("div",{className:l.empty,children:[m("div",{className:l.emptyIcon,children:y("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[m("circle",{cx:"12",cy:"12",r:"10"}),m("polyline",{points:"12 6 12 12 16 14"})]})}),"\uD788\uC2A4\uD1A0\uB9AC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4"]}):re.map((u,j)=>y("div",{className:l.historyItem,children:[m("div",{className:`${l.historyDot} ${l[`historyDot_${u.action}`]}`}),y("div",{className:l.historyBody,children:[u.action==="status_changed"&&y("div",{className:l.historyStatusChange,children:[m("span",{className:`${l.historyStatusBadge} ${l[`status_${u.fromStatus}`]}`,children:u.fromStatus==="todo"?"\uB300\uAE30":u.fromStatus==="in_progress"?"\uC9C4\uD589\uC911":"\uC644\uB8CC"}),m("span",{className:l.historyArrow,children:"\u2192"}),m("span",{className:`${l.historyStatusBadge} ${l[`status_${u.toStatus}`]}`,children:u.toStatus==="todo"?"\uB300\uAE30":u.toStatus==="in_progress"?"\uC9C4\uD589\uC911":"\uC644\uB8CC"})]}),u.action==="created"&&y("div",{className:l.historyStatusChange,children:[m("span",{className:l.historyLabel,children:"\uC0DD\uC131"}),m("span",{className:`${l.historyStatusBadge} ${l.status_todo}`,children:"\uB300\uAE30"})]}),u.action==="comment_added"&&y("div",{className:l.historyComment,children:[m("span",{className:l.historyCommentAuthor,children:u.actorName||"\uC775\uBA85"}),u.metadata?.content&&m("span",{className:l.historyCommentContent,children:String(u.metadata.content).slice(0,100)})]}),y("div",{className:l.historyFooter,children:[m("span",{className:l.historyTime,children:yn(u.createdAt)}),m("span",{className:l.historyRef,children:(u.taskTitle||"").replace(/^\[피드백\]\s*/,"")})]})]})]},`${u.id}-${u.action}-${j}`))})]}):y(Pt,{children:[y("div",{className:l.statusFilter,children:[y("button",{className:`${l.filterChip} ${w==="todo"?l.active:""}`,onClick:()=>B("todo"),type:"button",children:["\uC9C4\uD589\uC804",F>0&&m("span",{className:l.filterCount,children:F})]}),y("button",{className:`${l.filterChip} ${w==="in_progress"?l.active:""}`,onClick:()=>B("in_progress"),type:"button",children:["\uC9C4\uD589\uC911",Z>0&&m("span",{className:l.filterCount,children:Z})]}),y("button",{className:`${l.filterChip} ${w==="done"?l.active:""}`,onClick:()=>B("done"),type:"button",children:["\uC644\uB8CC",te>0&&m("span",{className:l.filterCount,children:te})]})]}),m("div",{className:l.content,children:ie.length===0?y("div",{className:l.empty,children:[m("div",{className:l.emptyIcon,children:m("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:m("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})})}),v==="page"?"\uC774 \uD398\uC774\uC9C0\uC5D0 \uD53C\uB4DC\uBC31\uC774 \uC5C6\uC2B5\uB2C8\uB2E4":"\uD53C\uB4DC\uBC31\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"]}):ie.map(u=>y("div",{className:`${l.card} ${u.status==="done"?l.cardDone:""}`,onClick:()=>p(u),children:[y("div",{className:l.cardHeader,children:[m("div",{className:l.cardAvatar,children:At(u.authorName)}),m("div",{className:l.cardInfo,children:y("div",{className:l.cardMeta,children:[m("span",{className:l.cardAuthor,children:u.authorName}),m("span",{className:l.cardTime,children:yn(u.createdAt)})]})})]}),m("div",{className:l.cardTitle,children:u.title.replace(/^\[피드백\]\s*/,"")}),u.screenshot&&m("div",{className:l.cardScreenshot,children:m("img",{src:u.screenshot,alt:"screenshot"})}),v==="all"&&u.feedbackUrl&&y("div",{className:l.cardRoute,onClick:j=>{j.stopPropagation(),window.location.href=u.feedbackUrl},title:"\uD398\uC774\uC9C0\uB85C \uC774\uB3D9",children:[m("span",{className:l.cardRoutePath,children:u.feedbackUrl}),y("svg",{className:l.cardRouteIcon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"12",height:"12",children:[m("path",{d:"M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"}),m("polyline",{points:"15 3 21 3 21 9"}),m("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]})]}),(u.startedAt||u.completedAt)&&y("div",{className:l.cardStatusTime,children:[u.startedAt&&u.status!=="todo"&&y("span",{children:["\uC9C4\uD589 \uC2DC\uC791: ",yn(u.startedAt)]}),u.completedAt&&u.status==="done"&&y("span",{children:["\uC644\uB8CC: ",yn(u.completedAt)]})]}),y("div",{className:l.cardFooter,children:[m("span",{className:l.cardReplyDot}),y("span",{className:l.cardReplyCount,children:[u.commentCount," ",u.commentCount===1?"Reply":"Replies"]})]})]},u.id))})]})]})]}),Me&&m(Dr,{src:Me,onClose:()=>we(null)}),pe&&m(Vr,{fileUrl:pe.url,fileName:pe.name,fileType:pe.type,fileSource:pe.source,onClose:()=>b(null)})]}),document.body)}import{useState as Ie,useRef as On,useEffect as Ft,useCallback as Ue}from"react";import{createPortal as Zr}from"react-dom";var Ur=`@keyframes styles-module__slideIn___Wx-kZ {
2384
2384
  from {
2385
2385
  transform: translateX(100%);
2386
2386
  }
@@ -3100,15 +3100,15 @@ ${n.stack?.split(`
3100
3100
  }
3101
3101
  .styles-module__sendBtn___WLa8O:disabled {
3102
3102
  cursor: not-allowed;
3103
- }`,Kr={backdrop:"styles-module__backdrop___qExl6",fadeIn:"styles-module__fadeIn___lF-be",panel:"styles-module__panel___ri2CN",slideIn:"styles-module__slideIn___Wx-kZ",exiting:"styles-module__exiting___iE6TS",slideOut:"styles-module__slideOut___1n8cb",resizeHandle:"styles-module__resizeHandle___VGNx4",header:"styles-module__header___gmriy",headerLeft:"styles-module__headerLeft___M17Y1",headerIcon:"styles-module__headerIcon___PsSMZ",headerTitle:"styles-module__headerTitle___Y96x8",headerActions:"styles-module__headerActions___-rG09",headerBtn:"styles-module__headerBtn___eSTQN",body:"styles-module__body___bXbbW",sidebar:"styles-module__sidebar___1NIqu",sidebarHeader:"styles-module__sidebarHeader___aMgpo",sidebarList:"styles-module__sidebarList___Ob-c6",sidebarEmpty:"styles-module__sidebarEmpty___QNq3K",sidebarItem:"styles-module__sidebarItem___T8-S5",sidebarActive:"styles-module__sidebarActive___WVtxJ",sidebarTitle:"styles-module__sidebarTitle___bkPQz",sidebarDate:"styles-module__sidebarDate___QNxsK",messages:"styles-module__messages___Al0UY",welcome:"styles-module__welcome___7MKNO",welcomeIcon:"styles-module__welcomeIcon___gd4O6",welcomeText:"styles-module__welcomeText___-aHqH",welcomeHint:"styles-module__welcomeHint___zUsgp",message:"styles-module__message___-0C3Z",user:"styles-module__user___V0NWN",msgBody:"styles-module__msgBody___YMLmR",msgContent:"styles-module__msgContent___ur5dX",assistant:"styles-module__assistant___sS3g4",msgAvatar:"styles-module__msgAvatar___AAtdS",msgImages:"styles-module__msgImages___xdjr7",msgImage:"styles-module__msgImage___g9UKr",msgMarkdown:"styles-module__msgMarkdown___2bE27",paragraph:"styles-module__paragraph___0db50",heading1:"styles-module__heading1___ObrLl",heading2:"styles-module__heading2___2GDnb",heading3:"styles-module__heading3___dJGMW",inlineCode:"styles-module__inlineCode___fXbsw",codeBlock:"styles-module__codeBlock___77Vmy",codeLang:"styles-module__codeLang___ANUgp",codeCopy:"styles-module__codeCopy___UKHGh",expandBtn:"styles-module__expandBtn___9EdJu",copyBtn:"styles-module__copyBtn___gMgrH",toolCalls:"styles-module__toolCalls___YDi5U",toolCall:"styles-module__toolCall___YG3jW",tool_success:"styles-module__tool_success___-qmku",tool_error:"styles-module__tool_error___tmRla",toolIcon:"styles-module__toolIcon___w-g-Z",toolName:"styles-module__toolName___yBXu6",toolMore:"styles-module__toolMore___MSrrk",subBadge:"styles-module__subBadge___bvbxD",toolCompact:"styles-module__toolCompact___i-o7k",toolCompactToggle:"styles-module__toolCompactToggle___uOgG4",toolCompactIcon:"styles-module__toolCompactIcon___onQV5",toolCompactError:"styles-module__toolCompactError___qcqEZ",toolCompactSub:"styles-module__toolCompactSub___awUyk",toolCompactList:"styles-module__toolCompactList___pumTz",toolCompactItem:"styles-module__toolCompactItem___GN7IT",toolSummary:"styles-module__toolSummary___-ultc",typing:"styles-module__typing___SxFST",typingDot:"styles-module__typingDot___-XQcu",continueBar:"styles-module__continueBar___Ox1ee",imagePreview:"styles-module__imagePreview___69vle",imageThumb:"styles-module__imageThumb___5-tAx",imageRemove:"styles-module__imageRemove___U8lFv",inputArea:"styles-module__inputArea___ySM3W",attachBtn:"styles-module__attachBtn___uvYvg",input:"styles-module__input___UnN4A",sendBtn:"styles-module__sendBtn___WLa8O",active:"styles-module__active___SooZB"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-agent-chat-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-agent-chat-styles",document.head.appendChild(e)),e.textContent=Ur}var f=Kr;import{Fragment as Gr,jsx as g,jsxs as W}from"react/jsx-runtime";function Uo(e){return{github_read_file:"\uD30C\uC77C \uC77D\uAE30",github_search_code:"\uCF54\uB4DC \uAC80\uC0C9",github_grep_code:"\uCF54\uB4DC \uB0B4\uC6A9 \uAC80\uC0C9",github_get_tree:"\uB514\uB809\uD1A0\uB9AC \uAD6C\uC870",github_get_commits:"\uCEE4\uBC0B \uC774\uB825",supabase_query_db:"DB \uC870\uD68C",supabase_list_tables:"\uD14C\uC774\uBE14 \uBAA9\uB85D",supabase_get_api_logs:"API \uB85C\uADF8",vercel_get_runtime_logs:"\uB7F0\uD0C0\uC784 \uB85C\uADF8",vercel_get_deployments:"\uBC30\uD3EC \uC774\uB825",spawn_agent:"\uC11C\uBE0C \uC5D0\uC774\uC804\uD2B8",create_task:"\uD53C\uB4DC\uBC31 \uC0DD\uC131"}[e]||e}function Xr(e){let n=[],o=e.split(`
3104
- `),t=0;for(;t<o.length;){let s=o[t];if(s.startsWith("```")){let r=s.slice(3).trim(),i=[];for(t++;t<o.length&&!o[t].startsWith("```");)i.push(o[t]),t++;t++,n.push(W("div",{className:f.codeBlock,children:[r&&g("div",{className:f.codeLang,children:r}),g("pre",{children:g("code",{children:i.join(`
3103
+ }`,Kr={backdrop:"styles-module__backdrop___qExl6",fadeIn:"styles-module__fadeIn___lF-be",panel:"styles-module__panel___ri2CN",slideIn:"styles-module__slideIn___Wx-kZ",exiting:"styles-module__exiting___iE6TS",slideOut:"styles-module__slideOut___1n8cb",resizeHandle:"styles-module__resizeHandle___VGNx4",header:"styles-module__header___gmriy",headerLeft:"styles-module__headerLeft___M17Y1",headerIcon:"styles-module__headerIcon___PsSMZ",headerTitle:"styles-module__headerTitle___Y96x8",headerActions:"styles-module__headerActions___-rG09",headerBtn:"styles-module__headerBtn___eSTQN",body:"styles-module__body___bXbbW",sidebar:"styles-module__sidebar___1NIqu",sidebarHeader:"styles-module__sidebarHeader___aMgpo",sidebarList:"styles-module__sidebarList___Ob-c6",sidebarEmpty:"styles-module__sidebarEmpty___QNq3K",sidebarItem:"styles-module__sidebarItem___T8-S5",sidebarActive:"styles-module__sidebarActive___WVtxJ",sidebarTitle:"styles-module__sidebarTitle___bkPQz",sidebarDate:"styles-module__sidebarDate___QNxsK",messages:"styles-module__messages___Al0UY",welcome:"styles-module__welcome___7MKNO",welcomeIcon:"styles-module__welcomeIcon___gd4O6",welcomeText:"styles-module__welcomeText___-aHqH",welcomeHint:"styles-module__welcomeHint___zUsgp",message:"styles-module__message___-0C3Z",user:"styles-module__user___V0NWN",msgBody:"styles-module__msgBody___YMLmR",msgContent:"styles-module__msgContent___ur5dX",assistant:"styles-module__assistant___sS3g4",msgAvatar:"styles-module__msgAvatar___AAtdS",msgImages:"styles-module__msgImages___xdjr7",msgImage:"styles-module__msgImage___g9UKr",msgMarkdown:"styles-module__msgMarkdown___2bE27",paragraph:"styles-module__paragraph___0db50",heading1:"styles-module__heading1___ObrLl",heading2:"styles-module__heading2___2GDnb",heading3:"styles-module__heading3___dJGMW",inlineCode:"styles-module__inlineCode___fXbsw",codeBlock:"styles-module__codeBlock___77Vmy",codeLang:"styles-module__codeLang___ANUgp",codeCopy:"styles-module__codeCopy___UKHGh",expandBtn:"styles-module__expandBtn___9EdJu",copyBtn:"styles-module__copyBtn___gMgrH",toolCalls:"styles-module__toolCalls___YDi5U",toolCall:"styles-module__toolCall___YG3jW",tool_success:"styles-module__tool_success___-qmku",tool_error:"styles-module__tool_error___tmRla",toolIcon:"styles-module__toolIcon___w-g-Z",toolName:"styles-module__toolName___yBXu6",toolMore:"styles-module__toolMore___MSrrk",subBadge:"styles-module__subBadge___bvbxD",toolCompact:"styles-module__toolCompact___i-o7k",toolCompactToggle:"styles-module__toolCompactToggle___uOgG4",toolCompactIcon:"styles-module__toolCompactIcon___onQV5",toolCompactError:"styles-module__toolCompactError___qcqEZ",toolCompactSub:"styles-module__toolCompactSub___awUyk",toolCompactList:"styles-module__toolCompactList___pumTz",toolCompactItem:"styles-module__toolCompactItem___GN7IT",toolSummary:"styles-module__toolSummary___-ultc",typing:"styles-module__typing___SxFST",typingDot:"styles-module__typingDot___-XQcu",continueBar:"styles-module__continueBar___Ox1ee",imagePreview:"styles-module__imagePreview___69vle",imageThumb:"styles-module__imageThumb___5-tAx",imageRemove:"styles-module__imageRemove___U8lFv",inputArea:"styles-module__inputArea___ySM3W",attachBtn:"styles-module__attachBtn___uvYvg",input:"styles-module__input___UnN4A",sendBtn:"styles-module__sendBtn___WLa8O",active:"styles-module__active___SooZB"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-agent-chat-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-agent-chat-styles",document.head.appendChild(e)),e.textContent=Ur}var f=Kr;import{Fragment as Gr,jsx as g,jsxs as O}from"react/jsx-runtime";function Uo(e){return{github_read_file:"\uD30C\uC77C \uC77D\uAE30",github_search_code:"\uCF54\uB4DC \uAC80\uC0C9",github_grep_code:"\uCF54\uB4DC \uB0B4\uC6A9 \uAC80\uC0C9",github_get_tree:"\uB514\uB809\uD1A0\uB9AC \uAD6C\uC870",github_get_commits:"\uCEE4\uBC0B \uC774\uB825",supabase_query_db:"DB \uC870\uD68C",supabase_list_tables:"\uD14C\uC774\uBE14 \uBAA9\uB85D",supabase_get_api_logs:"API \uB85C\uADF8",vercel_get_runtime_logs:"\uB7F0\uD0C0\uC784 \uB85C\uADF8",vercel_get_deployments:"\uBC30\uD3EC \uC774\uB825",spawn_agent:"\uC11C\uBE0C \uC5D0\uC774\uC804\uD2B8",create_task:"\uD53C\uB4DC\uBC31 \uC0DD\uC131"}[e]||e}function Xr(e){let n=[],o=e.split(`
3104
+ `),t=0;for(;t<o.length;){let s=o[t];if(s.startsWith("```")){let r=s.slice(3).trim(),i=[];for(t++;t<o.length&&!o[t].startsWith("```");)i.push(o[t]),t++;t++,n.push(O("div",{className:f.codeBlock,children:[r&&g("div",{className:f.codeLang,children:r}),g("pre",{children:g("code",{children:i.join(`
3105
3105
  `)})}),g("button",{className:f.codeCopy,onClick:()=>navigator.clipboard?.writeText(i.join(`
3106
3106
  `)),type:"button",children:"\uBCF5\uC0AC"})]},`code-${t}`));continue}if(/^#{1,3}\s/.test(s)){let r=s.match(/^(#{1,3})/)?.[1].length||1,i=s.replace(/^#{1,3}\s/,"");n.push(g("div",{className:f[`heading${r}`],children:Vo(i)},`h-${t}`)),t++;continue}if(!s.trim()){t++;continue}n.push(g("p",{className:f.paragraph,children:Vo(s)},`p-${t}`)),t++}return n}function Vo(e){let n=[],o=/(\*\*(.+?)\*\*|`([^`]+)`)/g,t=0,s,r=0;for(;(s=o.exec(e))!==null;)s.index>t&&n.push(e.slice(t,s.index)),s[2]?n.push(g("strong",{children:s[2]},r++)):s[3]&&n.push(g("code",{className:f.inlineCode,children:s[3]},r++)),t=s.index+s[0].length;return t<e.length&&n.push(e.slice(t)),n.length===1&&typeof n[0]=="string"?n[0]:g(Gr,{children:n})}function Yr({content:e}){let[n,o]=Ie(!1),t=e.split(`
3107
- `);return t.length>8?W("div",{className:f.msgContent,children:[n?e:t.slice(0,6).join(`
3108
- `)+"...",g("button",{className:f.expandBtn,onClick:()=>o(!n),type:"button",children:n?"\uC811\uAE30":"\uB354\uBCF4\uAE30"})]}):g("div",{className:f.msgContent,children:e})}function Qr({text:e}){let[n,o]=Ie(!1),t=Qe(()=>{navigator.clipboard?.writeText(e),o(!0),setTimeout(()=>o(!1),1500)},[e]);return g("button",{className:f.copyBtn,onClick:t,type:"button",children:n?"\u2713 \uBCF5\uC0AC\uB428":"\uBCF5\uC0AC"})}function qr({calls:e}){let[n,o]=Ie(!1);if(!e.length)return null;let t=e.filter(r=>r.status==="error").length,s=e.filter(r=>r.isSubAgent).length;return W("div",{className:f.toolCompact,children:[W("button",{className:f.toolCompactToggle,onClick:()=>o(!n),type:"button",children:[g("span",{className:f.toolCompactIcon,children:n?"\u25BE":"\u25B8"}),"\uB3C4\uAD6C ",e.length,"\uAC1C \uC0AC\uC6A9",t>0&&W("span",{className:f.toolCompactError,children:[" (",t," \uC2E4\uD328)"]}),s>0&&W("span",{className:f.toolCompactSub,children:[" \xB7 \uC11C\uBE0C ",s]})]}),n&&g("div",{className:f.toolCompactList,children:e.map((r,i)=>W("div",{className:`${f.toolCompactItem} ${f[`tool_${r.status}`]}`,children:[g("span",{children:r.status==="success"?"\u2713":r.status==="error"?"\u2717":"\u23F3"}),g("span",{children:Uo(r.name)}),r.isSubAgent&&g("span",{className:f.subBadge,children:"sub"}),r.summary&&g("span",{className:f.toolSummary,children:r.summary})]},i))})]})}function Ko({endpoint:e,onClose:n}){let[o,t]=Ie([]),[s,r]=Ie(""),[i,a]=Ie(!1),[_,k]=Ie(()=>{try{return localStorage.getItem("impakers-agent-session")||null}catch{return null}}),[v,C]=Ie(!1),[w,B]=Ie(!1),[M,D]=Ie([]),[U,ce]=Ie(420),[ue,se]=Ie(!1),[F,A]=Ie([]),[X,h]=Ie([]),H=On(null),I=On(null),_e=On(null),E=On(null),q=On(!1);Pt(()=>{H.current?.scrollIntoView({behavior:"smooth"})},[o,X]),Pt(()=>{I.current?.focus()},[]),Pt(()=>{let p=en();if(!p)return;let S=e.replace(/\/api\/external\/feedback\/?$/,"");fetch(`${S}/api/agent/sessions?agentId=cs-assistant`,{headers:{Authorization:`Bearer ${p}`}}).then(z=>z.json()).then(z=>A(z.sessions||[])).catch(()=>{})},[e]);let ee=Qe(()=>{C(!0),setTimeout(()=>n(),150)},[n]),we=Qe(p=>{p.preventDefault(),q.current=!0;let S=p.clientX,z=U,te=P=>{if(!q.current)return;let me=S-P.clientX;ce(Math.max(360,Math.min(z+me,window.innerWidth-40)))},re=()=>{q.current=!1,document.removeEventListener("mousemove",te),document.removeEventListener("mouseup",re)};document.addEventListener("mousemove",te),document.addEventListener("mouseup",re)},[U]),Me=Qe(p=>{let S=p.target.files;S&&(Array.from(S).forEach(z=>{if(!z.type.startsWith("image/")||z.size>5*1024*1024)return;let te=new FileReader;te.onload=()=>{let re=te.result.split(",")[1];D(P=>[...P,{base64:re,mediaType:z.type}])},te.readAsDataURL(z)}),p.target.value="")},[]),Se=Qe(async p=>{let S=en();if(!S)return;let z=e.replace(/\/api\/external\/feedback\/?$/,"");try{let re=await(await fetch(`${z}/api/agent/sessions?sessionId=${p}`,{headers:{Authorization:`Bearer ${S}`}})).json();if(re.messages){t(re.messages.map((P,me)=>({id:`loaded-${me}`,role:P.role,content:P.content,createdAt:new Date(P.createdAt||Date.now()).getTime()}))),k(p);try{localStorage.setItem("impakers-agent-session",p)}catch{}se(!1)}}catch{}},[e]),ne=Qe(async p=>{let S=p||s.trim(),z=M;if(!S&&z.length===0||i)return;let te=en();if(!te)return;let re={id:`user-${Date.now()}`,role:"user",content:S||"\uC774\uBBF8\uC9C0\uB97C \uBD84\uC11D\uD574\uC8FC\uC138\uC694.",images:z.length>0?z:void 0,createdAt:Date.now()};t(u=>[...u,re]),r(""),D([]),a(!0),B(!1),h([]),I.current&&(I.current.style.height="auto");let P=`assistant-${Date.now()}`,me={id:P,role:"assistant",content:"",toolCalls:[],createdAt:Date.now()};t(u=>[...u,me]);let ie=!1;try{let u=new AbortController;_e.current=u;let K=e.replace(/\/api\/external\/feedback\/?$/,""),Ae=await fetch(`${K}/api/agent`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${te}`},body:JSON.stringify({message:S||"\uC774\uBBF8\uC9C0\uB97C \uBD84\uC11D\uD574\uC8FC\uC138\uC694.",agentId:"cs-assistant",sessionId:_||void 0,images:z.length>0?z.map(Ue=>({type:"image",...Ue})):void 0}),signal:u.signal});if(!Ae.ok){let Ue=await Ae.json().catch(()=>({error:"\uC694\uCCAD \uC2E4\uD328"}));t(ln=>ln.map($e=>$e.id===P?{...$e,content:`\uC624\uB958: ${Ue.error||"\uC694\uCCAD \uC2E4\uD328"}`}:$e)),a(!1);return}let pe=Ae.body.getReader(),Ge=new TextDecoder,an="";for(;;){let{done:Ue,value:ln}=await pe.read();if(Ue)break;an+=Ge.decode(ln,{stream:!0});let $e=an.split(`
3109
- `);an=$e.pop()||"";for(let Je of $e){if(!Je.startsWith("data: "))continue;let kn=Je.slice(6).trim();if(kn)try{let J=JSON.parse(kn);switch(J.type){case"meta":if(J.conversationId){k(J.conversationId);try{localStorage.setItem("impakers-agent-session",J.conversationId)}catch{}}break;case"content":t(fe=>fe.map(O=>O.id===P?{...O,content:O.content+(J.content||"")}:O));break;case"tool_call":{let fe={name:J.name||"",input:J.input||{},status:"running"};h(O=>[...O,fe]),t(O=>O.map(ke=>ke.id===P?{...ke,toolCalls:[...ke.toolCalls||[],fe]}:ke));break}case"tool_result":h(fe=>fe.map(O=>O.name===J.name&&O.status==="running"?{...O,status:J.result?.success?"success":"error",summary:J.result?.summary}:O)),t(fe=>fe.map(O=>{if(O.id!==P)return O;let ke=[...O.toolCalls||[]],vn=ke.findLastIndex(Cn=>Cn.name===J.name&&Cn.status==="running");return vn>=0&&(ke[vn]={...ke[vn],status:J.result?.success?"success":"error",summary:J.result?.summary}),{...O,toolCalls:ke}}));break;case"sub_agent_tool":{let fe={name:J.toolName||J.agentName||"sub-agent",input:{},status:J.status==="done"?"success":"running",isSubAgent:!0,summary:J.summary};J.status==="running"?h(O=>[...O,fe]):h(O=>O.map(ke=>ke.isSubAgent&&ke.status==="running"?{...ke,status:"success",summary:J.summary}:ke));break}case"error":t(fe=>fe.map(O=>O.id===P?{...O,content:O.content+`
3107
+ `);return t.length>8?O("div",{className:f.msgContent,children:[n?e:t.slice(0,6).join(`
3108
+ `)+"...",g("button",{className:f.expandBtn,onClick:()=>o(!n),type:"button",children:n?"\uC811\uAE30":"\uB354\uBCF4\uAE30"})]}):g("div",{className:f.msgContent,children:e})}function Qr({text:e}){let[n,o]=Ie(!1),t=Ue(()=>{navigator.clipboard?.writeText(e),o(!0),setTimeout(()=>o(!1),1500)},[e]);return g("button",{className:f.copyBtn,onClick:t,type:"button",children:n?"\u2713 \uBCF5\uC0AC\uB428":"\uBCF5\uC0AC"})}function qr({calls:e}){let[n,o]=Ie(!1);if(!e.length)return null;let t=e.filter(r=>r.status==="error").length,s=e.filter(r=>r.isSubAgent).length;return O("div",{className:f.toolCompact,children:[O("button",{className:f.toolCompactToggle,onClick:()=>o(!n),type:"button",children:[g("span",{className:f.toolCompactIcon,children:n?"\u25BE":"\u25B8"}),"\uB3C4\uAD6C ",e.length,"\uAC1C \uC0AC\uC6A9",t>0&&O("span",{className:f.toolCompactError,children:[" (",t," \uC2E4\uD328)"]}),s>0&&O("span",{className:f.toolCompactSub,children:[" \xB7 \uC11C\uBE0C ",s]})]}),n&&g("div",{className:f.toolCompactList,children:e.map((r,i)=>O("div",{className:`${f.toolCompactItem} ${f[`tool_${r.status}`]}`,children:[g("span",{children:r.status==="success"?"\u2713":r.status==="error"?"\u2717":"\u23F3"}),g("span",{children:Uo(r.name)}),r.isSubAgent&&g("span",{className:f.subBadge,children:"sub"}),r.summary&&g("span",{className:f.toolSummary,children:r.summary})]},i))})]})}function Ko({endpoint:e,onClose:n}){let[o,t]=Ie([]),[s,r]=Ie(""),[i,a]=Ie(!1),[_,k]=Ie(()=>{try{return localStorage.getItem("impakers-agent-session")||null}catch{return null}}),[v,C]=Ie(!1),[w,B]=Ie(!1),[R,D]=Ie([]),[K,ce]=Ie(420),[ue,re]=Ie(!1),[A,M]=Ie([]),[Y,h]=Ie([]),z=On(null),T=On(null),_e=On(null),I=On(null),J=On(!1);Ft(()=>{z.current?.scrollIntoView({behavior:"smooth"})},[o,Y]),Ft(()=>{T.current?.focus()},[]);let oe=Ue(()=>{let p=en();if(!p)return;let P=e.replace(/\/api\/external\/feedback\/?$/,"");fetch(`${P}/api/agent/sessions?agentId=cs-assistant`,{headers:{Authorization:`Bearer ${p}`}}).then(H=>H.json()).then(H=>M(H.sessions||[])).catch(()=>{})},[e]);Ft(()=>{oe()},[oe]);let me=Ue(()=>{C(!0),setTimeout(()=>n(),150)},[n]),Me=Ue(p=>{p.preventDefault(),J.current=!0;let P=p.clientX,H=K,ie=Z=>{if(!J.current)return;let te=P-Z.clientX;ce(Math.max(360,Math.min(H+te,window.innerWidth-40)))},F=()=>{J.current=!1,document.removeEventListener("mousemove",ie),document.removeEventListener("mouseup",F)};document.addEventListener("mousemove",ie),document.addEventListener("mouseup",F)},[K]),we=Ue(p=>{let P=p.target.files;P&&(Array.from(P).forEach(H=>{if(!H.type.startsWith("image/")||H.size>5*1024*1024)return;let ie=new FileReader;ie.onload=()=>{let F=ie.result.split(",")[1];D(Z=>[...Z,{base64:F,mediaType:H.type}])},ie.readAsDataURL(H)}),p.target.value="")},[]),pe=Ue(async p=>{let P=en();if(!P)return;let H=e.replace(/\/api\/external\/feedback\/?$/,"");try{let F=await(await fetch(`${H}/api/agent/sessions?sessionId=${p}`,{headers:{Authorization:`Bearer ${P}`}})).json();if(F.messages){t(F.messages.map((Z,te)=>({id:`loaded-${te}`,role:Z.role,content:Z.content,createdAt:new Date(Z.createdAt||Date.now()).getTime()}))),k(p);try{localStorage.setItem("impakers-agent-session",p)}catch{}re(!1)}}catch{}},[e]),b=Ue(async p=>{let P=p||s.trim(),H=R;if(!P&&H.length===0||i)return;let ie=en();if(!ie)return;let F={id:`user-${Date.now()}`,role:"user",content:P||"\uC774\uBBF8\uC9C0\uB97C \uBD84\uC11D\uD574\uC8FC\uC138\uC694.",images:H.length>0?H:void 0,createdAt:Date.now()};t(j=>[...j,F]),r(""),D([]),a(!0),B(!1),h([]),T.current&&(T.current.style.height="auto");let Z=`assistant-${Date.now()}`,te={id:Z,role:"assistant",content:"",toolCalls:[],createdAt:Date.now()};t(j=>[...j,te]);let u=!1;try{let j=new AbortController;_e.current=j;let Ae=e.replace(/\/api\/external\/feedback\/?$/,""),ye=await fetch(`${Ae}/api/agent`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${ie}`},body:JSON.stringify({message:P||"\uC774\uBBF8\uC9C0\uB97C \uBD84\uC11D\uD574\uC8FC\uC138\uC694.",agentId:"cs-assistant",sessionId:_||void 0,images:H.length>0?H.map(Ze=>({type:"image",...Ze})):void 0}),signal:j.signal});if(!ye.ok){let Ze=await ye.json().catch(()=>({error:"\uC694\uCCAD \uC2E4\uD328"}));t(Xe=>Xe.map(Be=>Be.id===Z?{...Be,content:`\uC624\uB958: ${Ze.error||"\uC694\uCCAD \uC2E4\uD328"}`}:Be)),a(!1);return}let Pe=ye.body.getReader(),Un=new TextDecoder,an="";for(;;){let{done:Ze,value:Xe}=await Pe.read();if(Ze)break;an+=Un.decode(Xe,{stream:!0});let Be=an.split(`
3109
+ `);an=Be.pop()||"";for(let kn of Be){if(!kn.startsWith("data: "))continue;let vn=kn.slice(6).trim();if(vn)try{let q=JSON.parse(vn);switch(q.type){case"meta":if(q.conversationId){k(q.conversationId);try{localStorage.setItem("impakers-agent-session",q.conversationId)}catch{}}break;case"content":t(Se=>Se.map(V=>V.id===Z?{...V,content:V.content+(q.content||"")}:V));break;case"tool_call":{let Se={name:q.name||"",input:q.input||{},status:"running"};h(V=>[...V,Se]),t(V=>V.map(ke=>ke.id===Z?{...ke,toolCalls:[...ke.toolCalls||[],Se]}:ke));break}case"tool_result":h(Se=>Se.map(V=>V.name===q.name&&V.status==="running"?{...V,status:q.result?.success?"success":"error",summary:q.result?.summary}:V)),t(Se=>Se.map(V=>{if(V.id!==Z)return V;let ke=[...V.toolCalls||[]],ln=ke.findLastIndex(Cn=>Cn.name===q.name&&Cn.status==="running");return ln>=0&&(ke[ln]={...ke[ln],status:q.result?.success?"success":"error",summary:q.result?.summary}),{...V,toolCalls:ke}}));break;case"sub_agent_tool":{let Se={name:q.toolName||q.agentName||"sub-agent",input:{},status:q.status==="done"?"success":"running",isSubAgent:!0,summary:q.summary};q.status==="running"?h(V=>[...V,Se]):h(V=>V.map(ke=>ke.isSubAgent&&ke.status==="running"?{...ke,status:"success",summary:q.summary}:ke));break}case"error":t(Se=>Se.map(V=>V.id===Z?{...V,content:V.content+`
3110
3110
 
3111
- \uC624\uB958: ${J.error}`}:O));break;case"done":ie=!0;break}}catch{}}}ie||B(!0)}catch(u){if(u?.name!=="AbortError"){t(Ae=>Ae.map(pe=>pe.id===P?{...pe,content:pe.content||"\uC5F0\uACB0\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."}:pe));let K=u?.message||"";(K.includes("timeout")||K.includes("aborted")||K.includes("network"))&&B(!0)}}finally{a(!1),h([]),_e.current=null}},[s,M,i,_,e]),b=Qe(p=>{p.stopPropagation(),!p.nativeEvent.isComposing&&(p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),ne()),p.key==="Escape"&&ee())},[ne,ee]),x=Qe(()=>{t([]),k(null),B(!1),h([]);try{localStorage.removeItem("impakers-agent-session")}catch{}},[]);return typeof document>"u"?null:Zr(W("div",{"data-impakers-debug":"",children:[g("div",{className:f.backdrop,onClick:ee}),W("div",{className:`${f.panel} ${v?f.exiting:""}`,style:{width:U},"data-impakers-debug":"",children:[g("div",{className:f.resizeHandle,onMouseDown:we}),W("div",{className:f.header,children:[W("div",{className:f.headerLeft,children:[g("button",{className:f.headerBtn,onClick:()=>se(!ue),type:"button",title:"\uB300\uD654 \uAE30\uB85D",children:W("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"15",height:"15",children:[g("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),g("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),g("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}),g("span",{className:f.headerIcon,children:"\u2726"}),g("span",{className:f.headerTitle,children:"AI \uC5D0\uC774\uC804\uD2B8"})]}),W("div",{className:f.headerActions,children:[g("button",{className:f.headerBtn,onClick:x,type:"button",title:"\uC0C8 \uB300\uD654",children:W("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"15",height:"15",children:[g("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),g("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),g("button",{className:f.headerBtn,onClick:ee,type:"button",title:"\uB2EB\uAE30",children:g("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"15",height:"15",children:g("path",{d:"M18 6L6 18M6 6l12 12"})})})]})]}),W("div",{className:f.body,children:[ue&&W("div",{className:f.sidebar,children:[g("div",{className:f.sidebarHeader,children:"\uB300\uD654 \uAE30\uB85D"}),W("div",{className:f.sidebarList,children:[F.length===0&&g("div",{className:f.sidebarEmpty,children:"\uAE30\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"}),F.map(p=>W("button",{className:`${f.sidebarItem} ${p.id===_?f.sidebarActive:""}`,onClick:()=>Se(p.id),type:"button",children:[g("div",{className:f.sidebarTitle,children:p.title||"\uC0C8 \uB300\uD654"}),g("div",{className:f.sidebarDate,children:new Date(p.createdAt).toLocaleDateString("ko-KR",{month:"short",day:"numeric"})})]},p.id))]})]}),W("div",{className:f.messages,children:[o.length===0&&W("div",{className:f.welcome,children:[g("div",{className:f.welcomeIcon,children:"\u2726"}),g("div",{className:f.welcomeText,children:"\uBB34\uC5C7\uC744 \uB3C4\uC640\uB4DC\uB9B4\uAE4C\uC694?"}),g("div",{className:f.welcomeHint,children:"\uC0AC\uC6A9 \uC911 \uAD81\uAE08\uD55C \uC810\uC774\uB098 \uBB38\uC81C\uB97C \uBB3C\uC5B4\uBCF4\uC138\uC694"})]}),o.map(p=>W("div",{className:`${f.message} ${f[p.role]}`,children:[p.role==="assistant"&&g("div",{className:f.msgAvatar,children:"\u2726"}),W("div",{className:f.msgBody,children:[p.images&&p.images.length>0&&g("div",{className:f.msgImages,children:p.images.map((S,z)=>g("img",{src:`data:${S.mediaType};base64,${S.base64}`,alt:"",className:f.msgImage},z))}),p.toolCalls&&p.toolCalls.length>0&&!i&&g(qr,{calls:p.toolCalls}),i&&p.id===o[o.length-1]?.id&&X.length>0&&W("div",{className:f.toolCalls,children:[X.slice(-3).map((S,z)=>W("div",{className:`${f.toolCall} ${f[`tool_${S.status}`]}`,children:[g("span",{className:f.toolIcon,children:S.status==="running"?"\u23F3":S.status==="success"?"\u2713":"\u2717"}),g("span",{className:f.toolName,children:Uo(S.name)}),S.isSubAgent&&g("span",{className:f.subBadge,children:"sub"})]},z)),X.length>3&&W("div",{className:f.toolMore,children:["+",X.length-3,"\uAC1C \uC644\uB8CC"]})]}),p.content&&p.role==="assistant"&&g("div",{className:f.msgMarkdown,children:Xr(p.content)}),p.content&&p.role==="user"&&g(Yr,{content:p.content}),p.role==="assistant"&&i&&p.id===o[o.length-1]?.id&&!p.content&&X.length===0&&W("div",{className:f.typing,children:[g("span",{}),g("span",{}),g("span",{})]}),p.role==="assistant"&&p.content&&!i&&g(Qr,{text:p.content})]})]},p.id)),w&&!i&&W("div",{className:f.continueBar,children:[g("span",{children:"\uD0C0\uC784\uC544\uC6C3\uC73C\uB85C \uBA48\uCDC4\uC2B5\uB2C8\uB2E4."}),g("button",{onClick:()=>{B(!1),ne("\uC774\uC5B4\uC11C \uACC4\uC18D \uBD84\uC11D\uD574\uC918")},type:"button",children:"\uACC4\uC18D\uD558\uAE30 \u2192"})]}),g("div",{ref:H})]})]}),M.length>0&&g("div",{className:f.imagePreview,children:M.map((p,S)=>W("div",{className:f.imageThumb,children:[g("img",{src:`data:${p.mediaType};base64,${p.base64}`,alt:""}),g("button",{className:f.imageRemove,onClick:()=>D(z=>z.filter((te,re)=>re!==S)),type:"button",children:"\xD7"})]},S))}),W("div",{className:f.inputArea,children:[g("button",{className:f.attachBtn,onClick:()=>E.current?.click(),type:"button",title:"\uC774\uBBF8\uC9C0 \uCCA8\uBD80",children:W("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16",children:[g("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),g("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),g("polyline",{points:"21 15 16 10 5 21"})]})}),g("textarea",{ref:I,className:f.input,placeholder:"\uBA54\uC2DC\uC9C0\uB97C \uC785\uB825\uD558\uC138\uC694...",value:s,onChange:p=>{r(p.target.value);let S=p.target;S.style.height="auto",S.style.height=`${Math.min(S.scrollHeight,120)}px`},onKeyDown:b,rows:1,disabled:i}),g("button",{className:`${f.sendBtn} ${(s.trim()||M.length>0)&&!i?f.active:""}`,onClick:()=>ne(),disabled:!s.trim()&&M.length===0||i,type:"button",children:W("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16",children:[g("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),g("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),g("input",{ref:E,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",multiple:!0,style:{display:"none"},onChange:Me})]})]}),document.body)}import{useCallback as _t}from"react";import{createPortal as ni}from"react-dom";var Zo="impakers-debug-settings",Ft={markerColor:"#6366f1",markersVisible:!0,hideDoneMarkers:!1,showOnlyMine:!1};function Xo(){try{let e=localStorage.getItem(Zo);return e?{...Ft,...JSON.parse(e)}:{...Ft}}catch{return{...Ft}}}function Yo(e){try{localStorage.setItem(Zo,JSON.stringify(e))}catch{}}var Qo=[{id:"indigo",label:"\uC778\uB514\uACE0",value:"#6366f1"},{id:"blue",label:"\uBE14\uB8E8",value:"#3b82f6"},{id:"red",label:"\uB808\uB4DC",value:"#ef4444"},{id:"green",label:"\uADF8\uB9B0",value:"#16a34a"},{id:"orange",label:"\uC624\uB80C\uC9C0",value:"#f97316"},{id:"pink",label:"\uD551\uD06C",value:"#ec4899"}];var Jr=`@keyframes styles-module__panelIn___SmRh6 {
3111
+ \uC624\uB958: ${q.error}`}:V));break;case"done":u=!0;break}}catch{}}}u||B(!0)}catch(j){if(j?.name!=="AbortError"){t(ye=>ye.map(Pe=>Pe.id===Z?{...Pe,content:Pe.content||"\uC5F0\uACB0\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."}:Pe));let Ae=j?.message||"";(Ae.includes("timeout")||Ae.includes("aborted")||Ae.includes("network"))&&B(!0)}}finally{a(!1),h([]),_e.current=null,oe()}},[s,R,i,_,e,oe]),x=Ue(p=>{p.stopPropagation(),!p.nativeEvent.isComposing&&(p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),b()),p.key==="Escape"&&me())},[b,me]),ee=Ue(()=>{t([]),k(null),B(!1),h([]);try{localStorage.removeItem("impakers-agent-session")}catch{}},[]);return typeof document>"u"?null:Zr(O("div",{"data-impakers-debug":"",children:[g("div",{className:f.backdrop,onClick:me}),O("div",{className:`${f.panel} ${v?f.exiting:""}`,style:{width:K},"data-impakers-debug":"",children:[g("div",{className:f.resizeHandle,onMouseDown:Me}),O("div",{className:f.header,children:[O("div",{className:f.headerLeft,children:[g("button",{className:f.headerBtn,onClick:()=>re(!ue),type:"button",title:"\uB300\uD654 \uAE30\uB85D",children:O("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"15",height:"15",children:[g("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),g("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),g("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}),g("span",{className:f.headerIcon,children:"\u2726"}),g("span",{className:f.headerTitle,children:"AI \uC5D0\uC774\uC804\uD2B8"})]}),O("div",{className:f.headerActions,children:[g("button",{className:f.headerBtn,onClick:ee,type:"button",title:"\uC0C8 \uB300\uD654",children:O("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"15",height:"15",children:[g("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),g("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),g("button",{className:f.headerBtn,onClick:me,type:"button",title:"\uB2EB\uAE30",children:g("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"15",height:"15",children:g("path",{d:"M18 6L6 18M6 6l12 12"})})})]})]}),O("div",{className:f.body,children:[ue&&O("div",{className:f.sidebar,children:[g("div",{className:f.sidebarHeader,children:"\uB300\uD654 \uAE30\uB85D"}),O("div",{className:f.sidebarList,children:[A.length===0&&g("div",{className:f.sidebarEmpty,children:"\uAE30\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"}),A.map(p=>O("button",{className:`${f.sidebarItem} ${p.id===_?f.sidebarActive:""}`,onClick:()=>pe(p.id),type:"button",children:[g("div",{className:f.sidebarTitle,children:p.title||"\uC0C8 \uB300\uD654"}),g("div",{className:f.sidebarDate,children:new Date(p.createdAt).toLocaleDateString("ko-KR",{month:"short",day:"numeric"})})]},p.id))]})]}),O("div",{className:f.messages,children:[o.length===0&&O("div",{className:f.welcome,children:[g("div",{className:f.welcomeIcon,children:"\u2726"}),g("div",{className:f.welcomeText,children:"\uBB34\uC5C7\uC744 \uB3C4\uC640\uB4DC\uB9B4\uAE4C\uC694?"}),g("div",{className:f.welcomeHint,children:"\uC0AC\uC6A9 \uC911 \uAD81\uAE08\uD55C \uC810\uC774\uB098 \uBB38\uC81C\uB97C \uBB3C\uC5B4\uBCF4\uC138\uC694"})]}),o.map(p=>O("div",{className:`${f.message} ${f[p.role]}`,children:[p.role==="assistant"&&g("div",{className:f.msgAvatar,children:"\u2726"}),O("div",{className:f.msgBody,children:[p.images&&p.images.length>0&&g("div",{className:f.msgImages,children:p.images.map((P,H)=>g("img",{src:`data:${P.mediaType};base64,${P.base64}`,alt:"",className:f.msgImage},H))}),p.toolCalls&&p.toolCalls.length>0&&!i&&g(qr,{calls:p.toolCalls}),i&&p.id===o[o.length-1]?.id&&Y.length>0&&O("div",{className:f.toolCalls,children:[Y.slice(-3).map((P,H)=>O("div",{className:`${f.toolCall} ${f[`tool_${P.status}`]}`,children:[g("span",{className:f.toolIcon,children:P.status==="running"?"\u23F3":P.status==="success"?"\u2713":"\u2717"}),g("span",{className:f.toolName,children:Uo(P.name)}),P.isSubAgent&&g("span",{className:f.subBadge,children:"sub"})]},H)),Y.length>3&&O("div",{className:f.toolMore,children:["+",Y.length-3,"\uAC1C \uC644\uB8CC"]})]}),p.content&&p.role==="assistant"&&g("div",{className:f.msgMarkdown,children:Xr(p.content)}),p.content&&p.role==="user"&&g(Yr,{content:p.content}),p.role==="assistant"&&i&&p.id===o[o.length-1]?.id&&!p.content&&Y.length===0&&O("div",{className:f.typing,children:[g("span",{}),g("span",{}),g("span",{})]}),p.role==="assistant"&&p.content&&!i&&g(Qr,{text:p.content})]})]},p.id)),w&&!i&&O("div",{className:f.continueBar,children:[g("span",{children:"\uD0C0\uC784\uC544\uC6C3\uC73C\uB85C \uBA48\uCDC4\uC2B5\uB2C8\uB2E4."}),g("button",{onClick:()=>{B(!1),b("\uC774\uC5B4\uC11C \uACC4\uC18D \uBD84\uC11D\uD574\uC918")},type:"button",children:"\uACC4\uC18D\uD558\uAE30 \u2192"})]}),g("div",{ref:z})]})]}),R.length>0&&g("div",{className:f.imagePreview,children:R.map((p,P)=>O("div",{className:f.imageThumb,children:[g("img",{src:`data:${p.mediaType};base64,${p.base64}`,alt:""}),g("button",{className:f.imageRemove,onClick:()=>D(H=>H.filter((ie,F)=>F!==P)),type:"button",children:"\xD7"})]},P))}),O("div",{className:f.inputArea,children:[g("button",{className:f.attachBtn,onClick:()=>I.current?.click(),type:"button",title:"\uC774\uBBF8\uC9C0 \uCCA8\uBD80",children:O("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16",children:[g("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),g("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),g("polyline",{points:"21 15 16 10 5 21"})]})}),g("textarea",{ref:T,className:f.input,placeholder:"\uBA54\uC2DC\uC9C0\uB97C \uC785\uB825\uD558\uC138\uC694...",value:s,onChange:p=>{r(p.target.value);let P=p.target;P.style.height="auto",P.style.height=`${Math.min(P.scrollHeight,120)}px`},onKeyDown:x,rows:1,disabled:i}),g("button",{className:`${f.sendBtn} ${(s.trim()||R.length>0)&&!i?f.active:""}`,onClick:()=>b(),disabled:!s.trim()&&R.length===0||i,type:"button",children:O("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16",children:[g("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),g("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),g("input",{ref:I,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",multiple:!0,style:{display:"none"},onChange:we})]})]}),document.body)}import{useCallback as mt}from"react";import{createPortal as ni}from"react-dom";var Zo="impakers-debug-settings",$t={markerColor:"#6366f1",markersVisible:!0,hideDoneMarkers:!1,showOnlyMine:!1};function Xo(){try{let e=localStorage.getItem(Zo);return e?{...$t,...JSON.parse(e)}:{...$t}}catch{return{...$t}}}function Yo(e){try{localStorage.setItem(Zo,JSON.stringify(e))}catch{}}var Qo=[{id:"indigo",label:"\uC778\uB514\uACE0",value:"#6366f1"},{id:"blue",label:"\uBE14\uB8E8",value:"#3b82f6"},{id:"red",label:"\uB808\uB4DC",value:"#ef4444"},{id:"green",label:"\uADF8\uB9B0",value:"#16a34a"},{id:"orange",label:"\uC624\uB80C\uC9C0",value:"#f97316"},{id:"pink",label:"\uD551\uD06C",value:"#ec4899"}];var Jr=`@keyframes styles-module__panelIn___SmRh6 {
3112
3112
  from {
3113
3113
  opacity: 0;
3114
3114
  transform: translateY(8px) scale(0.96);
@@ -3237,7 +3237,7 @@ ${n.stack?.split(`
3237
3237
  .styles-module__colorBtn___N7dGu.styles-module__selected___0tVDH {
3238
3238
  border-color: #18181b;
3239
3239
  transform: scale(1.15);
3240
- }`,ei={backdrop:"styles-module__backdrop___--cMp",panel:"styles-module__panel___z6xiJ",panelIn:"styles-module__panelIn___SmRh6",header:"styles-module__header___NkOur",title:"styles-module__title___tsKZw",closeBtn:"styles-module__closeBtn___-OQ4Y",body:"styles-module__body___9pyCP",field:"styles-module__field___vnQMl",fieldLabel:"styles-module__fieldLabel___2WUKB",toggle:"styles-module__toggle___uWsqC",on:"styles-module__on___W27kf",toggleThumb:"styles-module__toggleThumb___wyckC",colors:"styles-module__colors___vgFGZ",colorBtn:"styles-module__colorBtn___N7dGu",selected:"styles-module__selected___0tVDH"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-settings-panel-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-settings-panel-styles",document.head.appendChild(e)),e.textContent=Jr}var Y=ei;import{jsx as xe,jsxs as qe}from"react/jsx-runtime";function qo({settings:e,onChange:n,onClose:o}){let t=_t(()=>{n({...e,markersVisible:!e.markersVisible})},[e,n]),s=_t(()=>{n({...e,hideDoneMarkers:!e.hideDoneMarkers})},[e,n]),r=_t(()=>{n({...e,showOnlyMine:!e.showOnlyMine})},[e,n]),i=_t(a=>{n({...e,markerColor:a})},[e,n]);return typeof document>"u"?null:ni(qe("div",{"data-impakers-debug":"",children:[xe("div",{className:Y.backdrop,onClick:o}),qe("div",{className:Y.panel,"data-impakers-debug":"",children:[qe("div",{className:Y.header,children:[xe("span",{className:Y.title,children:"\uC124\uC815"}),xe("button",{className:Y.closeBtn,onClick:o,type:"button",children:xe("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:xe("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),qe("div",{className:Y.body,children:[qe("div",{className:Y.field,children:[xe("div",{className:Y.fieldLabel,children:"\uB9C8\uCEE4 \uD45C\uC2DC"}),xe("button",{className:`${Y.toggle} ${e.markersVisible?Y.on:""}`,onClick:t,type:"button",children:xe("span",{className:Y.toggleThumb})})]}),qe("div",{className:Y.field,children:[xe("div",{className:Y.fieldLabel,children:"\uC644\uB8CC \uD540 \uC228\uAE30\uAE30"}),xe("button",{className:`${Y.toggle} ${e.hideDoneMarkers?Y.on:""}`,onClick:s,type:"button",children:xe("span",{className:Y.toggleThumb})})]}),qe("div",{className:Y.field,children:[xe("div",{className:Y.fieldLabel,children:"\uB0B4\uAC00 \uCD94\uAC00\uD55C \uAC83\uB9CC"}),xe("button",{className:`${Y.toggle} ${e.showOnlyMine?Y.on:""}`,onClick:r,type:"button",children:xe("span",{className:Y.toggleThumb})})]}),qe("div",{className:Y.field,children:[xe("div",{className:Y.fieldLabel,children:"\uB9C8\uCEE4 \uC0C9\uC0C1"}),xe("div",{className:Y.colors,children:Qo.map(a=>xe("button",{className:`${Y.colorBtn} ${e.markerColor===a.value?Y.selected:""}`,style:{background:a.value},onClick:()=>i(a.value),title:a.label,type:"button"},a.id))})]})]})]})]}),document.body)}var ti=`.styles-module__markersLayer___VR1cD svg[fill=none],
3240
+ }`,ei={backdrop:"styles-module__backdrop___--cMp",panel:"styles-module__panel___z6xiJ",panelIn:"styles-module__panelIn___SmRh6",header:"styles-module__header___NkOur",title:"styles-module__title___tsKZw",closeBtn:"styles-module__closeBtn___-OQ4Y",body:"styles-module__body___9pyCP",field:"styles-module__field___vnQMl",fieldLabel:"styles-module__fieldLabel___2WUKB",toggle:"styles-module__toggle___uWsqC",on:"styles-module__on___W27kf",toggleThumb:"styles-module__toggleThumb___wyckC",colors:"styles-module__colors___vgFGZ",colorBtn:"styles-module__colorBtn___N7dGu",selected:"styles-module__selected___0tVDH"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-settings-panel-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-settings-panel-styles",document.head.appendChild(e)),e.textContent=Jr}var Q=ei;import{jsx as xe,jsxs as Je}from"react/jsx-runtime";function qo({settings:e,onChange:n,onClose:o}){let t=mt(()=>{n({...e,markersVisible:!e.markersVisible})},[e,n]),s=mt(()=>{n({...e,hideDoneMarkers:!e.hideDoneMarkers})},[e,n]),r=mt(()=>{n({...e,showOnlyMine:!e.showOnlyMine})},[e,n]),i=mt(a=>{n({...e,markerColor:a})},[e,n]);return typeof document>"u"?null:ni(Je("div",{"data-impakers-debug":"",children:[xe("div",{className:Q.backdrop,onClick:o}),Je("div",{className:Q.panel,"data-impakers-debug":"",children:[Je("div",{className:Q.header,children:[xe("span",{className:Q.title,children:"\uC124\uC815"}),xe("button",{className:Q.closeBtn,onClick:o,type:"button",children:xe("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:xe("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),Je("div",{className:Q.body,children:[Je("div",{className:Q.field,children:[xe("div",{className:Q.fieldLabel,children:"\uB9C8\uCEE4 \uD45C\uC2DC"}),xe("button",{className:`${Q.toggle} ${e.markersVisible?Q.on:""}`,onClick:t,type:"button",children:xe("span",{className:Q.toggleThumb})})]}),Je("div",{className:Q.field,children:[xe("div",{className:Q.fieldLabel,children:"\uC644\uB8CC \uD540 \uC228\uAE30\uAE30"}),xe("button",{className:`${Q.toggle} ${e.hideDoneMarkers?Q.on:""}`,onClick:s,type:"button",children:xe("span",{className:Q.toggleThumb})})]}),Je("div",{className:Q.field,children:[xe("div",{className:Q.fieldLabel,children:"\uB0B4\uAC00 \uCD94\uAC00\uD55C \uAC83\uB9CC"}),xe("button",{className:`${Q.toggle} ${e.showOnlyMine?Q.on:""}`,onClick:r,type:"button",children:xe("span",{className:Q.toggleThumb})})]}),Je("div",{className:Q.field,children:[xe("div",{className:Q.fieldLabel,children:"\uB9C8\uCEE4 \uC0C9\uC0C1"}),xe("div",{className:Q.colors,children:Qo.map(a=>xe("button",{className:`${Q.colorBtn} ${e.markerColor===a.value?Q.selected:""}`,style:{background:a.value},onClick:()=>i(a.value),title:a.label,type:"button"},a.id))})]})]})]})]}),document.body)}var ti=`.styles-module__markersLayer___VR1cD svg[fill=none],
3241
3241
  .styles-module__fixedMarkersLayer___wBuxm svg[fill=none] {
3242
3242
  fill: none !important;
3243
3243
  }
@@ -3562,5 +3562,5 @@ html.impakers-selecting {
3562
3562
  }
3563
3563
  html.impakers-selecting * {
3564
3564
  cursor: crosshair !important;
3565
- }`,oi={markersLayer:"styles-module__markersLayer___VR1cD",fixedMarkersLayer:"styles-module__fixedMarkersLayer___wBuxm",fab:"styles-module__fab___6FrCF",fabEnter:"styles-module__fabEnter___9koyT",active:"styles-module__active___X5PRD",hoverHighlight:"styles-module__hoverHighlight___9kGLL",enter:"styles-module__enter___jAi-c",hoverHighlightIn:"styles-module__hoverHighlightIn___ljC4F",singleSelectOutline:"styles-module__singleSelectOutline___2meUm",fadeIn:"styles-module__fadeIn___PpRqy",hoverTooltip:"styles-module__hoverTooltip___JE1Bs",hoverTooltipIn:"styles-module__hoverTooltipIn___tncNM",hoverReactPath:"styles-module__hoverReactPath___wPGYi",hoverElementName:"styles-module__hoverElementName___lNqTP",contextMenu:"styles-module__contextMenu___nDXft",contextMenuItem:"styles-module__contextMenuItem___69GKu",toast:"styles-module__toast___gV3Sa",toastIn:"styles-module__toastIn___V382h",toastOut:"styles-module__toastOut___zlqxG",toastError:"styles-module__toastError___Q-8dn",countdownOverlay:"styles-module__countdownOverlay___GruQJ",countdownNumber:"styles-module__countdownNumber___VAmkI",countdownPulse:"styles-module__countdownPulse___ngZrL",countdownLabel:"styles-module__countdownLabel___px-ao",countdownCancel:"styles-module__countdownCancel___8cRgZ",fadeOut:"styles-module__fadeOut___tZb9S"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-debug-widget-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-debug-widget-styles",document.head.appendChild(e)),e.textContent=ti}var ae=oi;import{Fragment as _i,jsx as $,jsxs as Fe}from"react/jsx-runtime";function $t(e,n){let o=document.elementFromPoint(e,n);if(!o)return null;for(;o?.shadowRoot;){let t=o.shadowRoot.elementFromPoint(e,n);if(!t||t===o)break;o=t}return o}function ii(e){let n=e;for(;n&&n!==document.body;){let o=window.getComputedStyle(n);if(o.position==="fixed"||o.position==="sticky")return!0;n=n.parentElement}return!1}function Go(e){let{name:n,path:o}=yt(e),t=mo(e,{mode:"filtered"});return{name:t.path?`${t.path} ${n}`:n,elementName:n,path:o,reactComponents:t.path}}function ai(e){let n=Pn(e),o=n.found?n:xt(e);if(o.found&&o.source)return Jn(o.source,"path")}function li(e){let n=Pn(e),o=n.found?n:xt(e);return o.found&&o.sourceCandidates&&o.sourceCandidates.length>0?o.sourceCandidates.map(t=>Jn(t,"path")):o.found&&o.source?[Jn(o.source,"path")]:[]}function di(e,n){let o=e.match(/^(.+):(\d+)(?::(\d+))?$/);if(!o)return null;let[,t,s,r]=o,i=Number.parseInt(s,10),a=r?Number.parseInt(r,10):void 0;return!t||Number.isNaN(i)?null:{kind:"component",file:t,line:i,column:a,label:n||"Resolved component source",confidence:.98,reason:"resolved-from-source-map"}}var ci="impakers-debug-markers-";function Ht(){return ci+window.location.pathname}function Bt(){try{let e=localStorage.getItem(Ht());return e?JSON.parse(e):[]}catch{return[]}}function Jo(e){try{e.length===0?localStorage.removeItem(Ht()):localStorage.setItem(Ht(),JSON.stringify(e))}catch{}}function ui(e){return e.feedbackMarker?{id:e.id,x:e.feedbackMarker.x,y:e.feedbackMarker.y,comment:e.title.replace(/^\[피드백\]\s*/,""),element:e.feedbackMarker.element||"",elementPath:"",timestamp:new Date(e.createdAt).getTime(),isFixed:e.feedbackMarker.isFixed,boundingBox:e.feedbackMarker.boundingBox,status:e.status}:null}function es({endpoint:e,getUser:n,onHide:o}){let[t,s]=G(!1),[r,i]=G(()=>Bt()),[a,_]=G(null),[k,v]=G(!1),[C,w]=G(null),[B,M]=G({x:0,y:0}),[D,U]=G(new Set),[ce,ue]=G(!1),[se,F]=G(null),[A,X]=G(null),[h,H]=G(!1),[I,_e]=G(null),[E,q]=G(null),[ee,we]=G({}),[Me,Se]=G(!1),[ne,b]=G([]),[x,p]=G([]),[S,z]=G(!1),[te,re]=G(!1),[P,me]=G(!1),[ie,u]=G(()=>Xo()),[K,Ae]=G(()=>window.location.pathname),[pe,Ge]=G(!1),[an,Ue]=G(0),[ln,$e]=G(null),Je=Vn(null),kn=Vn(null),J=Vn(null),fe=Vn(!1),O=Re(()=>{$e(3);let d=3,c=()=>{d-=1,d<=0?($e(null),s(!0),document.documentElement.classList.add("impakers-selecting")):($e(d),Je.current=setTimeout(c,1e3))};Je.current=setTimeout(c,1e3)},[]),ke=Re(d=>{d==="comment"?Cn():d==="delay-capture"?O():d==="agent"?re(!0):d==="inbox"?(z(!0),wo(e,{staleWhileRevalidate:!0}).then(p).catch(()=>{}),t&&(s(!1),document.documentElement.classList.remove("impakers-selecting"),w(null),_(null))):d==="settings"&&me(!0)},[t,O]),vn=Re(d=>{u(d),Yo(d)},[]),Cn=Re(()=>{s(d=>{let c=!d;return c?document.documentElement.classList.add("impakers-selecting"):(document.documentElement.classList.remove("impakers-selecting"),w(null),_(null)),c})},[]);De(()=>()=>{document.documentElement.classList.remove("impakers-selecting")},[]),De(()=>{i(Bt());let d=()=>{Ae(window.location.pathname),i(Bt()),_(null),w(null)};window.addEventListener("popstate",d);let c=history.pushState.bind(history);return history.pushState=(...Z)=>{c(...Z),setTimeout(d,50)},()=>{window.removeEventListener("popstate",d),history.pushState=c}},[]),De(()=>{let d=Ke(K),c=pn(d);c&&(b(c),Ge(!0));let Z=zn(d,T=>{b(T),Ge(!0)});return Co(e,K,{staleWhileRevalidate:!0}).then(T=>{b(T),Ge(!0)}).catch(()=>{}),Z},[e,K]);let Ot="impakers-debug-history-last-seen";De(()=>{let d=localStorage.getItem(Ot)||new Date(0).toISOString();at(e,{since:d,limit:100}).then(c=>Ue(c.length)).catch(()=>{})},[e]);let os=Re(()=>{localStorage.setItem(Ot,new Date().toISOString()),Ue(0)},[]);De(()=>{if(!pe)return;let d=ne.map(ui).filter(c=>c!==null);i(d),Jo(d)},[ne,pe]);let Vt=Vn(!0);De(()=>{if(Vt.current){Vt.current=!1;return}Jo(r)},[r]),De(()=>{let d=c=>{if(c.key==="Escape"){if(S){z(!1);return}if(a){c.preventDefault(),v(!0),Ne(()=>{_(null),v(!1)},150);return}t&&(c.preventDefault(),s(!1),document.documentElement.classList.remove("impakers-selecting"),w(null))}};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[S,a,t]),De(()=>{if(!t||a)return;let d=c=>{let Z=c.composedPath()[0]||c.target;if(on(Z,"[data-impakers-debug]")){w(null);return}let T=$t(c.clientX,c.clientY);if(!T||on(T,"[data-impakers-debug]")){w(null);return}let{name:ge,elementName:Le,path:ve,reactComponents:oe}=Go(T),N=T.getBoundingClientRect();w({element:ge,elementName:Le,elementPath:ve,rect:N,reactComponents:oe}),M({x:c.clientX,y:c.clientY})};return document.addEventListener("mousemove",d),()=>document.removeEventListener("mousemove",d)},[t,a]),De(()=>{if(!t)return;let d=c=>{if(fe.current)return;let Z=c.composedPath()[0]||c.target;if(on(Z,"[data-impakers-debug]")||on(Z,"[data-annotation-popup]")||on(Z,"[data-annotation-marker]"))return;if(a){c.preventDefault(),c.stopPropagation(),kn.current?.shake();return}c.preventDefault(),c.stopPropagation();let T=$t(c.clientX,c.clientY);if(!T)return;let{name:ge,path:Le,reactComponents:ve}=Go(T),oe=T.getBoundingClientRect(),N=c.clientX/window.innerWidth*100,le=ii(T),Kn=le?c.clientY:c.clientY+window.scrollY,Ln=window.getSelection(),dn;Ln&&Ln.toString().trim().length>0&&(dn=Ln.toString().trim().slice(0,500));let Q=io(T),Ee=ao(T);_({x:N,y:Kn,clientY:c.clientY,element:ge,elementPath:Le,selectedText:dn,boundingBox:{x:oe.left,y:le?oe.top:oe.top+window.scrollY,width:oe.width,height:oe.height},nearbyText:oo(T),cssClasses:so(T),isFixed:le,fullPath:co(T),accessibility:lo(T),computedStyles:Ee,computedStylesObj:Q,reactComponents:ve??void 0,sourceFile:ai(T),targetElement:T}),w(null);let Zn=li(T).filter(Tn=>Tn.includes("/chunks/"));Zn.length>0&&(async()=>{for(let Tn of Zn)try{let Xn=await Nt(Tn);if(Xn){_(pt=>pt&&{...pt,resolvedSource:`${Xn.source}:${Xn.line}`,resolvedName:Xn.name??void 0});break}}catch{}})()};return document.addEventListener("click",d,!0),()=>document.removeEventListener("click",d,!0)},[t,a]);let wn=Re(d=>{_e(d),Ne(()=>_e(null),4e3)},[]),ss=Re(async d=>{if(!(!a||ce)){ue(!0);try{let c=ho(n),Z=await po(),T=a.resolvedSource||a.sourceFile||"",ge=a.resolvedName||null;if(!a.resolvedSource&&a.sourceFile?.includes("/chunks/"))try{let Q=await Nt(a.sourceFile);Q&&(T=`${Q.source}:${Q.line}:${Q.column}`,ge=Q.name)}catch{}let Le=await bo(window.location.pathname),ve=T&&!T.includes("/chunks/")?di(T,ge):null,oe=xo(ve?[ve]:void 0,Le?.targets);oe.length>0&&(c.debugTargets=oe),Le?.context&&(c.routeDebug=Le.context);let N=[];N.push(`## \uD53C\uB4DC\uBC31 ${d}`),oe.length>0&&(N.push(""),N.push("---"),N.push(""),N.push("**\uB514\uBC84\uAE45 \uD0C0\uAC9F \uD30C\uC77C**:"),oe.forEach(Q=>{let Ee=Q.line?`:${Q.line}${typeof Q.column=="number"?`:${Q.column}`:""}`:"";N.push(`- [${Q.kind}] \`${Q.file}${Ee}\` (${Q.reason})`)}));let le=[];if(a.element&&le.push(`**\uC120\uD0DD\uB41C \uC694\uC18C**: ${a.element}`),a.elementPath&&le.push(`**DOM \uACBD\uB85C**: \`${a.elementPath}\``),a.selectedText&&le.push(`**\uC120\uD0DD\uB41C \uD14D\uC2A4\uD2B8**: "${a.selectedText}"`),a.reactComponents?.trim()?le.push(`**React \uCEF4\uD3EC\uB10C\uD2B8**: ${a.reactComponents}`):ge&&le.push(`**\uCEF4\uD3EC\uB10C\uD2B8/\uD568\uC218**: ${ge}`),T&&!T.includes("/chunks/")&&le.push(`**\uC18C\uC2A4 \uD30C\uC77C**: \`${T}\``),a.cssClasses&&le.push(`**CSS \uD074\uB798\uC2A4**: \`${a.cssClasses}\``),a.nearbyText&&le.push(`**\uC8FC\uBCC0 \uD14D\uC2A4\uD2B8**: ${a.nearbyText}`),a.accessibility&&le.push(`**\uC811\uADFC\uC131**: ${a.accessibility}`),le.length>0&&(N.push(""),N.push("---"),N.push(""),le.forEach(Q=>N.push(Q))),c.consoleErrors?.length&&(N.push(""),N.push("---"),N.push(""),N.push("**\uCD5C\uADFC \uCF58\uC194 \uC5D0\uB7EC**:"),c.consoleErrors.slice(-10).forEach(Q=>N.push(`- \`${Q.slice(0,200)}\``))),c.consoleLogs?.length){let Q=c.consoleLogs.filter(Ee=>Ee.level==="error"||Ee.level==="warn").slice(-10);Q.length>0&&(N.push(""),N.push("**\uCD5C\uADFC \uCF58\uC194 \uB85C\uADF8**:"),Q.forEach(Ee=>N.push(`- [${Ee.level}] \`${Ee.message.slice(0,200)}\``)))}if(N.push(""),N.push("---"),N.push(""),N.push("## \uD658\uACBD \uC815\uBCF4"),N.push(""),N.push(`- **URL**: ${c.url}`),N.push(`- **\uC2DC\uC810**: ${new Date(c.timestamp).toLocaleString("ko-KR")}`),N.push(`- **\uBE0C\uB77C\uC6B0\uC800**: ${c.browser}`),N.push(`- **\uD654\uBA74**: ${c.viewport} (@${c.pixelRatio}x)`),N.push(`- **\uC5B8\uC5B4**: ${c.language}`),c.user?.name&&N.push(`- **\uC0AC\uC6A9\uC790**: ${c.user.name}`),c.performance&&Object.keys(c.performance).length>0){N.push(""),N.push("---"),N.push(""),N.push("## \uC131\uB2A5"),N.push(""),N.push("| \uD56D\uBAA9 | \uAC12 |"),N.push("|------|-----|");let Q={pageLoadTime:"\uD398\uC774\uC9C0 \uB85C\uB529",domContentLoaded:"DOM \uB85C\uB4DC",ttfb:"TTFB",firstContentfulPaint:"FCP",usedJSHeapMB:"\uBA54\uBAA8\uB9AC \uC0AC\uC6A9",totalJSHeapMB:"\uBA54\uBAA8\uB9AC \uC804\uCCB4"};for(let[Ee,Yt]of Object.entries(c.performance)){let Zn=Q[Ee]||Ee,Tn=Ee.includes("Heap")?"MB":"ms";N.push(`| ${Zn} | ${Yt}${Tn} |`)}}let Kn=N.join(`
3566
- `),Ln=await vo(e,{title:d.slice(0,100),description:"",priority:"medium",metadata:c,debugInfo:Kn,debug_info:Kn,screenshot:Z,feedbackUrl:window.location.pathname,feedbackMarker:{x:a.x,y:a.y,isFixed:a.isFixed||!1,element:a.element,boundingBox:a.boundingBox},authorName:n?.()?.name?String(n().name):void 0});H(!0),Ne(()=>H(!1),3e3);let dn=Ln.taskId||null;J.current=dn,Ne(()=>{J.current=null},300),Ne(()=>{dn&&U(Q=>new Set(Q).add(dn))},250),v(!0),Ne(()=>{_(null),v(!1),s(!1),document.documentElement.classList.remove("impakers-selecting"),fe.current=!0,setTimeout(()=>{fe.current=!1},300)},150),window.getSelection()?.removeAllRanges()}catch(c){let Z=c?.message||"\uD53C\uB4DC\uBC31 \uC804\uC1A1 \uC2E4\uD328";wn(Z),console.error("[@impakers/debug] \uD53C\uB4DC\uBC31 \uC804\uC1A1 \uC2E4\uD328:",c)}finally{ue(!1)}}},[a,ce,e,n,wn]),rs=Re(()=>{v(!0),Ne(()=>{_(null),v(!1),s(!1),document.documentElement.classList.remove("impakers-selecting"),fe.current=!0,setTimeout(()=>{fe.current=!1},300)},150)},[]),Ut=Re(d=>{let c=d.id;q(Z=>Z===c?null:c)},[]);De(()=>{if(!E)return;let d=Xe(E),c=pn(d);c?(we(T=>({...T,[E]:c})),Se(!1)):Se(!0);let Z=zn(d,T=>{we(ge=>({...ge,[E]:T})),Se(!1)});return st(e,E,{staleWhileRevalidate:!0}).then(()=>Se(!1)).catch(()=>Se(!1)),Z},[E,e]);let is=Re(async(d,c,Z,T)=>{let ge=n?.()?.name?String(n().name):"\uC775\uBA85",Le=n?.()?.id?String(n().id):void 0;try{let ve;if(T)try{ve=await it(e,T,"comment",d)}catch(oe){let N=oe?.message||"\uD30C\uC77C \uC5C5\uB85C\uB4DC \uC2E4\uD328";wn(N),console.error("[@impakers/debug] \uD30C\uC77C \uC5C5\uB85C\uB4DC \uC2E4\uD328:",oe)}await rt(e,d,c,ge,Le,Z,ve)}catch(ve){let oe=ve?.message||"\uCF54\uBA58\uD2B8 \uC804\uC1A1 \uC2E4\uD328";wn(oe),console.error("[@impakers/debug] \uCF54\uBA58\uD2B8 \uC804\uC1A1 \uC2E4\uD328:",ve)}},[n,e,wn]),as=Re(()=>{q(null)},[]),Un=Re(d=>{if(!d){F(null),X(null);return}if(F(d.id),d.boundingBox){let c=d.boundingBox,Z=c.x+c.width/2,T=d.isFixed?c.y+c.height/2:c.y+c.height/2-window.scrollY,ge=$t(Z,T);if(ge){let Le=ge.getBoundingClientRect(),ve=Le.width/c.width,oe=Le.height/c.height;if(ve>=.5&&oe>=.5){X(ge);return}}}X(null)},[]),ls=Re(()=>{if(!a)return{left:0,top:0};let d=a.x/100*window.innerWidth,c=a.isFixed?a.y:a.y-window.scrollY,Z=Math.max(160,Math.min(window.innerWidth-160,d));return c>window.innerHeight-290?{left:Z,bottom:window.innerHeight-c+20}:{left:Z,top:c+20}},[a]);if(typeof document>"u")return null;let Sn=ls(),Nn=A?.getBoundingClientRect(),ds=[{id:"comment",label:"\uD53C\uB4DC\uBC31",active:t,icon:$("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:$("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})})},{id:"delay-capture",label:"\uB51C\uB808\uC774 \uCEA1\uCC98",icon:Fe("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[$("circle",{cx:"12",cy:"12",r:"10"}),$("polyline",{points:"12 6 12 12 16 14"})]})},{id:"agent",label:"\uC5D0\uC774\uC804\uD2B8",icon:Fe("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[$("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),$("path",{d:"M2 17l10 5 10-5"}),$("path",{d:"M2 12l10 5 10-5"})]})},{id:"inbox",label:"Inbox",badge:an||void 0,icon:Fe("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[$("polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}),$("path",{d:"M5.45 5.11L2 12v6a2 2 0 002 2h16a2 2 0 002-2v-6l-3.45-6.89A2 2 0 0016.76 4H7.24a2 2 0 00-1.79 1.11z"})]})},{id:"settings",label:"\uC124\uC815",icon:Fe("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[$("circle",{cx:"12",cy:"12",r:"3"}),$("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]})}],Kt=K,mt=n?.()?.name?String(n().name):null,Zt=si(()=>r.filter(d=>{let c=ne.find(Z=>Z.id===d.id);return!(ie.hideDoneMarkers&&(d.status==="done"||d.status==="resolved")||ie.showOnlyMine&&c?.authorName&&mt&&c.authorName!==mt)}),[r,ne,ie.hideDoneMarkers,ie.showOnlyMine,mt]),Xt=(d,c)=>({id:d.id,title:d.title||"\uD53C\uB4DC\uBC31",status:d.status,priority:d.priority,authorName:d.authorName||"\uC775\uBA85",feedbackUrl:d.feedbackUrl||c,createdAt:d.createdAt,startedAt:d.startedAt,completedAt:d.completedAt,commentCount:d.commentCount||0}),cs=ne.map(d=>Xt(d,Kt)),us=x.map(d=>Xt(d,""));return ri(Fe("div",{"data-impakers-debug":"",children:[$(Ho,{items:ds,onSelect:ke,onHide:o,onDoubleTap:Cn}),S&&$(Oo,{pageItems:cs,allItems:us,currentPath:Kt,serviceName:qt()||void 0,endpoint:e,currentUserName:n?.()?.name?String(n().name):"\uC775\uBA85",currentUserId:n?.()?.id?String(n().id):void 0,onClose:()=>z(!1),onHistoryViewed:os,newNotiCount:an}),te&&$(Ko,{endpoint:e,onClose:()=>re(!1)}),P&&$(qo,{settings:ie,onChange:vn,onClose:()=>me(!1)}),t&&Fe(_i,{children:[C?.rect&&!a&&$("div",{className:`${ae.hoverHighlight} ${ae.enter}`,style:{left:C.rect.left,top:C.rect.top,width:C.rect.width,height:C.rect.height}}),C&&!a&&Fe("div",{className:`${ae.hoverTooltip} ${ae.enter}`,style:{left:Math.min(B.x+14,window.innerWidth-200),top:B.y+14},children:[C.reactComponents&&$("div",{className:ae.hoverReactPath,children:C.reactComponents}),$("div",{className:ae.hoverElementName,children:C.elementName})]}),Nn&&se&&$("div",{className:`${ae.singleSelectOutline} ${ae.enter}`,style:{left:Nn.left,top:Nn.top,width:Nn.width,height:Nn.height}}),a?.targetElement&&(()=>{let d=a.targetElement.getBoundingClientRect();return $("div",{className:`${ae.singleSelectOutline} ${ae.enter}`,style:{left:d.left,top:d.top,width:d.width,height:d.height}})})()]}),$("div",{className:ae.markersLayer,"data-impakers-debug":"",style:{display:ie.markersVisible?void 0:"none"},children:Zt.filter(d=>!d.isFixed).map((d,c)=>$(Tt,{annotation:d,layerIndex:c,isAnimated:D.has(d.id),isHovered:se===d.id,isDeleting:!1,markerClickBehavior:"edit",accentColor:ie.markerColor,onHover:()=>Un(d),onHoverEnd:()=>Un(null),onClick:()=>Ut(d),onContextMenu:()=>{}},d.id))}),Fe("div",{className:ae.fixedMarkersLayer,"data-impakers-debug":"",style:{display:ie.markersVisible?void 0:"none"},children:[Zt.filter(d=>d.isFixed).map((d,c)=>$(Tt,{annotation:d,layerIndex:c,isAnimated:D.has(d.id),isHovered:se===d.id,isDeleting:!1,markerClickBehavior:"edit",accentColor:ie.markerColor,onHover:()=>Un(d),onHoverEnd:()=>Un(null),onClick:()=>Ut(d),onContextMenu:()=>{}},d.id)),a&&$(Io,{x:a.x,y:a.clientY,isMultiSelect:!1,accentColor:ie.markerColor})]}),a&&$(to,{ref:kn,element:a.resolvedSource||a.resolvedName||a.element,selectedText:a.selectedText,isExiting:k,style:{position:"fixed",left:Sn.left,..."top"in Sn?{top:Sn.top}:{},..."bottom"in Sn?{bottom:Sn.bottom}:{},transform:"translateX(-50%)",zIndex:100001},onSubmit:ss,onCancel:rs}),E&&(()=>{let d=r.find(le=>le.id===E),c=ne.find(le=>le.id===E);if(!d)return null;let Z=d.x/100*window.innerWidth,T=d.isFixed?d.y:d.y-window.scrollY,ge=Math.max(10,Math.min(Z+20,window.innerWidth-360)),Le=window.innerHeight-T,ve=T,oe=Le>=300?Math.min(T,window.innerHeight-60):Math.max(10,T-Math.min(480,ve-10)),N={id:d.id,title:c?.title||d.comment||"\uD53C\uB4DC\uBC31",status:c?.status||"todo",authorName:c?.authorName||void 0,createdAt:c?.createdAt||new Date(d.timestamp).toISOString(),comments:ee[d.id]||[]};return $(Bo,{task:N,currentUserName:n?.()?.name?String(n().name):"\uC775\uBA85",currentUserId:n?.()?.id?String(n().id):void 0,left:ge,top:oe,loading:Me,onClose:as,onReply:is})})(),ln!==null&&Fe("div",{className:ae.countdownOverlay,"data-impakers-debug":"",children:[$("div",{className:ae.countdownNumber,children:ln}),$("div",{className:ae.countdownLabel,children:"\uD53C\uB4DC\uBC31 \uBAA8\uB4DC \uD65C\uC131\uD654\uAE4C\uC9C0..."}),$("button",{className:ae.countdownCancel,onClick:()=>{Je.current&&clearTimeout(Je.current),$e(null)},type:"button",children:"\uCDE8\uC18C"})]}),h&&Fe("div",{className:ae.toast,"data-impakers-debug":"",children:[$("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#16a34a",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:$("polyline",{points:"20 6 9 17 4 12"})}),$("span",{children:"\uD0DC\uC2A4\uD06C \uC0DD\uC131\uC774 \uC644\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4"})]}),I&&Fe("div",{className:`${ae.toast} ${ae.toastError}`,"data-impakers-debug":"",children:[Fe("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[$("circle",{cx:"12",cy:"12",r:"10"}),$("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),$("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),$("span",{children:I})]})]}),document.body)}import{useState as zt,useCallback as mi}from"react";import{createPortal as pi}from"react-dom";import{jsx as Ve,jsxs as xn}from"react/jsx-runtime";function ns({endpoint:e,onSuccess:n,onClose:o}){let[t,s]=zt(""),[r,i]=zt(!1),[a,_]=zt(null),k=mi(async v=>{if(v.preventDefault(),!(!t.trim()||r)){i(!0),_(null);try{let C=await Gt(e,t.trim().toUpperCase());n(C.serviceName)}catch(C){_(C instanceof Error?C.message:"\uC778\uC99D \uC2E4\uD328")}finally{i(!1)}}},[t,e,r,n]);return typeof document>"u"?null:pi(xn("div",{"data-impakers-debug":"",style:{position:"fixed",inset:0,zIndex:2147483647,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif"},children:[Ve("div",{onClick:o,style:{position:"absolute",inset:0,background:"rgba(0, 0, 0, 0.4)"}}),xn("div",{style:{position:"relative",width:360,background:"white",borderRadius:12,boxShadow:"0 16px 48px rgba(0,0,0,0.16)",overflow:"hidden"},children:[xn("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e5e5"},children:[Ve("h3",{style:{fontSize:15,fontWeight:600,color:"#18181b",margin:0},children:"\uD53C\uB4DC\uBC31 \uC704\uC82F \uC778\uC99D"}),Ve("button",{onClick:o,type:"button",style:{width:28,height:28,border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,color:"#71717a"},children:Ve("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:Ve("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),xn("div",{style:{padding:20},children:[xn("p",{style:{fontSize:13,color:"#71717a",textAlign:"center",marginBottom:16,lineHeight:1.5},children:["\uC11C\uBE44\uC2A4 \uC2DC\uD06C\uB9BF \uCF54\uB4DC\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694.",Ve("br",{}),"\uCF54\uB4DC\uB294 \uC784\uD328\uCEE4\uC2A4 OS\uC5D0\uC11C \uD655\uC778\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),a&&Ve("div",{style:{background:"#fef2f2",border:"1px solid #fecaca",color:"#dc2626",padding:"8px 12px",borderRadius:8,fontSize:13,marginBottom:12},children:a}),xn("form",{onSubmit:k,children:[Ve("input",{type:"text",maxLength:6,placeholder:"A3F9K2",value:t,onChange:v=>s(v.target.value.toUpperCase()),autoFocus:!0,autoComplete:"off",style:{width:"100%",padding:"12px 16px",border:"1px solid #d4d4d8",borderRadius:8,fontSize:24,fontWeight:600,textAlign:"center",letterSpacing:8,textTransform:"uppercase",outline:"none",boxSizing:"border-box",fontFamily:"inherit",color:"#18181b"}}),Ve("button",{type:"submit",disabled:t.trim().length<6||r,style:{width:"100%",marginTop:16,padding:"10px 16px",border:"none",borderRadius:8,fontSize:14,fontWeight:500,cursor:t.trim().length<6||r?"not-allowed":"pointer",background:t.trim().length<6||r?"#a1a1aa":"#18181b",color:"white",fontFamily:"inherit"},children:r?"\uC778\uC99D \uC911...":"\uC778\uC99D\uD558\uAE30"})]})]})]})]}),document.body)}import{Fragment as fi,jsx as ts,jsxs as gi}from"react/jsx-runtime";function Il({endpoint:e,getUser:n}){let[o,t]=jt(!1),[s,r]=jt(!1),[i,a]=jt(()=>{try{return localStorage.getItem("impakers-debug-hidden")==="1"}catch{return!1}});Dt(()=>{t(cn())},[]),Dt(()=>{let C=[nn._on("impakers-debug:show-auth",()=>{r(!0),a(!1);try{localStorage.removeItem("impakers-debug-hidden")}catch{}}),nn._on("impakers-debug:open",()=>{a(!1);try{localStorage.removeItem("impakers-debug-hidden")}catch{}}),nn._on("impakers-debug:deactivate",()=>{t(!1),r(!1)})];return()=>C.forEach(w=>w())},[]),Dt(()=>{function C(w){if((w.ctrlKey||w.metaKey)&&w.shiftKey&&(w.key==="."||w.key===">"||w.code==="Period")){if(w.preventDefault(),i){a(!1);try{localStorage.removeItem("impakers-debug-hidden")}catch{}return}cn()?t(!0):r(B=>!B)}}return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[i]);let _=Wt(C=>{t(!0),r(!1)},[]),k=Wt(()=>{r(!1)},[]),v=Wt(()=>{a(!0);try{localStorage.setItem("impakers-debug-hidden","1")}catch{}},[]);return gi(fi,{children:[o&&!i&&ts(es,{endpoint:e,getUser:n,onHide:v}),s&&!o&&ts(ns,{endpoint:e,onSuccess:_,onClose:k})]})}export{nn as ImpakersDebug,Il as ImpakersDebugProvider};
3565
+ }`,oi={markersLayer:"styles-module__markersLayer___VR1cD",fixedMarkersLayer:"styles-module__fixedMarkersLayer___wBuxm",fab:"styles-module__fab___6FrCF",fabEnter:"styles-module__fabEnter___9koyT",active:"styles-module__active___X5PRD",hoverHighlight:"styles-module__hoverHighlight___9kGLL",enter:"styles-module__enter___jAi-c",hoverHighlightIn:"styles-module__hoverHighlightIn___ljC4F",singleSelectOutline:"styles-module__singleSelectOutline___2meUm",fadeIn:"styles-module__fadeIn___PpRqy",hoverTooltip:"styles-module__hoverTooltip___JE1Bs",hoverTooltipIn:"styles-module__hoverTooltipIn___tncNM",hoverReactPath:"styles-module__hoverReactPath___wPGYi",hoverElementName:"styles-module__hoverElementName___lNqTP",contextMenu:"styles-module__contextMenu___nDXft",contextMenuItem:"styles-module__contextMenuItem___69GKu",toast:"styles-module__toast___gV3Sa",toastIn:"styles-module__toastIn___V382h",toastOut:"styles-module__toastOut___zlqxG",toastError:"styles-module__toastError___Q-8dn",countdownOverlay:"styles-module__countdownOverlay___GruQJ",countdownNumber:"styles-module__countdownNumber___VAmkI",countdownPulse:"styles-module__countdownPulse___ngZrL",countdownLabel:"styles-module__countdownLabel___px-ao",countdownCancel:"styles-module__countdownCancel___8cRgZ",fadeOut:"styles-module__fadeOut___tZb9S"};if(typeof document<"u"){let e=document.getElementById("impakers-debug-styles-debug-widget-styles");e||(e=document.createElement("style"),e.id="impakers-debug-styles-debug-widget-styles",document.head.appendChild(e)),e.textContent=ti}var ae=oi;import{Fragment as _i,jsx as $,jsxs as $e}from"react/jsx-runtime";function Bt(e,n){let o=document.elementFromPoint(e,n);if(!o)return null;for(;o?.shadowRoot;){let t=o.shadowRoot.elementFromPoint(e,n);if(!t||t===o)break;o=t}return o}function ii(e){let n=e;for(;n&&n!==document.body;){let o=window.getComputedStyle(n);if(o.position==="fixed"||o.position==="sticky")return!0;n=n.parentElement}return!1}function Go(e){let{name:n,path:o}=bt(e),t=mo(e,{mode:"filtered"});return{name:t.path?`${t.path} ${n}`:n,elementName:n,path:o,reactComponents:t.path}}function ai(e){let n=Pn(e),o=n.found?n:kt(e);if(o.found&&o.source)return et(o.source,"path")}function li(e){let n=Pn(e),o=n.found?n:kt(e);return o.found&&o.sourceCandidates&&o.sourceCandidates.length>0?o.sourceCandidates.map(t=>et(t,"path")):o.found&&o.source?[et(o.source,"path")]:[]}function di(e,n){let o=e.match(/^(.+):(\d+)(?::(\d+))?$/);if(!o)return null;let[,t,s,r]=o,i=Number.parseInt(s,10),a=r?Number.parseInt(r,10):void 0;return!t||Number.isNaN(i)?null:{kind:"component",file:t,line:i,column:a,label:n||"Resolved component source",confidence:.98,reason:"resolved-from-source-map"}}var ci="impakers-debug-markers-";function zt(){return ci+window.location.pathname}function Ht(){try{let e=localStorage.getItem(zt());return e?JSON.parse(e):[]}catch{return[]}}function Jo(e){try{e.length===0?localStorage.removeItem(zt()):localStorage.setItem(zt(),JSON.stringify(e))}catch{}}function ui(e){return e.feedbackMarker?{id:e.id,x:e.feedbackMarker.x,y:e.feedbackMarker.y,comment:e.title.replace(/^\[피드백\]\s*/,""),element:e.feedbackMarker.element||"",elementPath:"",timestamp:new Date(e.createdAt).getTime(),isFixed:e.feedbackMarker.isFixed,boundingBox:e.feedbackMarker.boundingBox,status:e.status}:null}function es({endpoint:e,getUser:n,onHide:o}){let[t,s]=ne(!1),[r,i]=ne(()=>Ht()),[a,_]=ne(null),[k,v]=ne(!1),[C,w]=ne(null),[B,R]=ne({x:0,y:0}),[D,K]=ne(new Set),[ce,ue]=ne(!1),[re,A]=ne(null),[M,Y]=ne(null),[h,z]=ne(!1),[T,_e]=ne(null),[I,J]=ne(null),[oe,me]=ne({}),[Me,we]=ne(!1),[pe,b]=ne([]),[x,ee]=ne([]),[p,P]=ne(!1),[H,ie]=ne(!1),[F,Z]=ne(!1),[te,u]=ne(()=>Xo()),[j,Ae]=ne(()=>window.location.pathname),[ye,Pe]=ne(!1),[Un,an]=ne(0),[Ze,Xe]=ne(null),Be=Vn(null),kn=Vn(null),vn=Vn(null),q=Vn(!1),Se=Re(()=>{Xe(3);let d=3,c=()=>{d-=1,d<=0?(Xe(null),s(!0),document.documentElement.classList.add("impakers-selecting")):(Xe(d),Be.current=setTimeout(c,1e3))};Be.current=setTimeout(c,1e3)},[]),V=Re(d=>{d==="comment"?ln():d==="delay-capture"?Se():d==="agent"?ie(!0):d==="inbox"?(P(!0),wo(e,{staleWhileRevalidate:!0}).then(ee).catch(()=>{}),t&&(s(!1),document.documentElement.classList.remove("impakers-selecting"),w(null),_(null))):d==="settings"&&Z(!0)},[t,Se]),ke=Re(d=>{u(d),Yo(d)},[]),ln=Re(()=>{s(d=>{let c=!d;return c?document.documentElement.classList.add("impakers-selecting"):(document.documentElement.classList.remove("impakers-selecting"),w(null),_(null)),c})},[]);je(()=>()=>{document.documentElement.classList.remove("impakers-selecting")},[]),je(()=>{i(Ht());let d=()=>{Ae(window.location.pathname),i(Ht()),_(null),w(null)};window.addEventListener("popstate",d);let c=history.pushState.bind(history);return history.pushState=(...X)=>{c(...X),setTimeout(d,50)},()=>{window.removeEventListener("popstate",d),history.pushState=c}},[]),je(()=>{let d=Ye(j),c=pn(d);c&&(b(c),Pe(!0));let X=zn(d,L=>{b(L),Pe(!0)});return Co(e,j,{staleWhileRevalidate:!0}).then(L=>{b(L),Pe(!0)}).catch(()=>{}),X},[e,j]);let Cn="impakers-debug-history-last-seen";je(()=>{let d=localStorage.getItem(Cn)||new Date(0).toISOString();lt(e,{since:d,limit:100}).then(c=>an(c.length)).catch(()=>{})},[e]);let os=Re(()=>{localStorage.setItem(Cn,new Date().toISOString()),an(0)},[]);je(()=>{if(!ye)return;let d=pe.map(ui).filter(c=>c!==null);i(d),Jo(d)},[pe,ye]);let Vt=Vn(!0);je(()=>{if(Vt.current){Vt.current=!1;return}Jo(r)},[r]),je(()=>{let d=c=>{if(c.key==="Escape"){if(p){P(!1);return}if(a){c.preventDefault(),v(!0),Ne(()=>{_(null),v(!1)},150);return}t&&(c.preventDefault(),s(!1),document.documentElement.classList.remove("impakers-selecting"),w(null))}};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[p,a,t]),je(()=>{if(!t||a)return;let d=c=>{let X=c.composedPath()[0]||c.target;if(on(X,"[data-impakers-debug]")){w(null);return}let L=Bt(c.clientX,c.clientY);if(!L||on(L,"[data-impakers-debug]")){w(null);return}let{name:fe,elementName:Le,path:ve,reactComponents:se}=Go(L),S=L.getBoundingClientRect();w({element:fe,elementName:Le,elementPath:ve,rect:S,reactComponents:se}),R({x:c.clientX,y:c.clientY})};return document.addEventListener("mousemove",d),()=>document.removeEventListener("mousemove",d)},[t,a]),je(()=>{if(!t)return;let d=c=>{if(q.current)return;let X=c.composedPath()[0]||c.target;if(on(X,"[data-impakers-debug]")||on(X,"[data-annotation-popup]")||on(X,"[data-annotation-marker]"))return;if(a){c.preventDefault(),c.stopPropagation(),kn.current?.shake();return}c.preventDefault(),c.stopPropagation();let L=Bt(c.clientX,c.clientY);if(!L)return;let{name:fe,path:Le,reactComponents:ve}=Go(L),se=L.getBoundingClientRect(),S=c.clientX/window.innerWidth*100,le=ii(L),Zn=le?c.clientY:c.clientY+window.scrollY,Ln=window.getSelection(),dn;Ln&&Ln.toString().trim().length>0&&(dn=Ln.toString().trim().slice(0,500));let G=io(L),Ee=ao(L);_({x:S,y:Zn,clientY:c.clientY,element:fe,elementPath:Le,selectedText:dn,boundingBox:{x:se.left,y:le?se.top:se.top+window.scrollY,width:se.width,height:se.height},nearbyText:oo(L),cssClasses:so(L),isFixed:le,fullPath:co(L),accessibility:lo(L),computedStyles:Ee,computedStylesObj:G,reactComponents:ve??void 0,sourceFile:ai(L),targetElement:L}),w(null);let Xn=li(L).filter(Tn=>Tn.includes("/chunks/"));Xn.length>0&&(async()=>{for(let Tn of Xn)try{let Yn=await Lt(Tn);if(Yn){_(ft=>ft&&{...ft,resolvedSource:`${Yn.source}:${Yn.line}`,resolvedName:Yn.name??void 0});break}}catch{}})()};return document.addEventListener("click",d,!0),()=>document.removeEventListener("click",d,!0)},[t,a]);let wn=Re(d=>{_e(d),Ne(()=>_e(null),4e3)},[]),ss=Re(async d=>{if(!(!a||ce)){ue(!0);try{let c=ho(n),X=await po(),L=a.resolvedSource||a.sourceFile||"",fe=a.resolvedName||null;if(!a.resolvedSource&&a.sourceFile?.includes("/chunks/"))try{let G=await Lt(a.sourceFile);G&&(L=`${G.source}:${G.line}:${G.column}`,fe=G.name)}catch{}let Le=await bo(window.location.pathname),ve=L&&!L.includes("/chunks/")?di(L,fe):null,se=xo(ve?[ve]:void 0,Le?.targets);se.length>0&&(c.debugTargets=se),Le?.context&&(c.routeDebug=Le.context);let S=[];S.push(`## \uD53C\uB4DC\uBC31 ${d}`),se.length>0&&(S.push(""),S.push("---"),S.push(""),S.push("**\uB514\uBC84\uAE45 \uD0C0\uAC9F \uD30C\uC77C**:"),se.forEach(G=>{let Ee=G.line?`:${G.line}${typeof G.column=="number"?`:${G.column}`:""}`:"";S.push(`- [${G.kind}] \`${G.file}${Ee}\` (${G.reason})`)}));let le=[];if(a.element&&le.push(`**\uC120\uD0DD\uB41C \uC694\uC18C**: ${a.element}`),a.elementPath&&le.push(`**DOM \uACBD\uB85C**: \`${a.elementPath}\``),a.selectedText&&le.push(`**\uC120\uD0DD\uB41C \uD14D\uC2A4\uD2B8**: "${a.selectedText}"`),a.reactComponents?.trim()?le.push(`**React \uCEF4\uD3EC\uB10C\uD2B8**: ${a.reactComponents}`):fe&&le.push(`**\uCEF4\uD3EC\uB10C\uD2B8/\uD568\uC218**: ${fe}`),L&&!L.includes("/chunks/")&&le.push(`**\uC18C\uC2A4 \uD30C\uC77C**: \`${L}\``),a.cssClasses&&le.push(`**CSS \uD074\uB798\uC2A4**: \`${a.cssClasses}\``),a.nearbyText&&le.push(`**\uC8FC\uBCC0 \uD14D\uC2A4\uD2B8**: ${a.nearbyText}`),a.accessibility&&le.push(`**\uC811\uADFC\uC131**: ${a.accessibility}`),le.length>0&&(S.push(""),S.push("---"),S.push(""),le.forEach(G=>S.push(G))),c.consoleErrors?.length&&(S.push(""),S.push("---"),S.push(""),S.push("**\uCD5C\uADFC \uCF58\uC194 \uC5D0\uB7EC**:"),c.consoleErrors.slice(-10).forEach(G=>S.push(`- \`${G.slice(0,200)}\``))),c.consoleLogs?.length){let G=c.consoleLogs.filter(Ee=>Ee.level==="error"||Ee.level==="warn").slice(-10);G.length>0&&(S.push(""),S.push("**\uCD5C\uADFC \uCF58\uC194 \uB85C\uADF8**:"),G.forEach(Ee=>S.push(`- [${Ee.level}] \`${Ee.message.slice(0,200)}\``)))}if(S.push(""),S.push("---"),S.push(""),S.push("## \uD658\uACBD \uC815\uBCF4"),S.push(""),S.push(`- **URL**: ${c.url}`),S.push(`- **\uC2DC\uC810**: ${new Date(c.timestamp).toLocaleString("ko-KR")}`),S.push(`- **\uBE0C\uB77C\uC6B0\uC800**: ${c.browser}`),S.push(`- **\uD654\uBA74**: ${c.viewport} (@${c.pixelRatio}x)`),S.push(`- **\uC5B8\uC5B4**: ${c.language}`),c.user?.name&&S.push(`- **\uC0AC\uC6A9\uC790**: ${c.user.name}`),c.performance&&Object.keys(c.performance).length>0){S.push(""),S.push("---"),S.push(""),S.push("## \uC131\uB2A5"),S.push(""),S.push("| \uD56D\uBAA9 | \uAC12 |"),S.push("|------|-----|");let G={pageLoadTime:"\uD398\uC774\uC9C0 \uB85C\uB529",domContentLoaded:"DOM \uB85C\uB4DC",ttfb:"TTFB",firstContentfulPaint:"FCP",usedJSHeapMB:"\uBA54\uBAA8\uB9AC \uC0AC\uC6A9",totalJSHeapMB:"\uBA54\uBAA8\uB9AC \uC804\uCCB4"};for(let[Ee,Yt]of Object.entries(c.performance)){let Xn=G[Ee]||Ee,Tn=Ee.includes("Heap")?"MB":"ms";S.push(`| ${Xn} | ${Yt}${Tn} |`)}}let Zn=S.join(`
3566
+ `),Ln=await vo(e,{title:d.slice(0,100),description:"",priority:"medium",metadata:c,debugInfo:Zn,debug_info:Zn,screenshot:X,feedbackUrl:window.location.pathname,feedbackMarker:{x:a.x,y:a.y,isFixed:a.isFixed||!1,element:a.element,boundingBox:a.boundingBox},authorName:n?.()?.name?String(n().name):void 0});z(!0),Ne(()=>z(!1),3e3);let dn=Ln.taskId||null;vn.current=dn,Ne(()=>{vn.current=null},300),Ne(()=>{dn&&K(G=>new Set(G).add(dn))},250),v(!0),Ne(()=>{_(null),v(!1),s(!1),document.documentElement.classList.remove("impakers-selecting"),q.current=!0,setTimeout(()=>{q.current=!1},300)},150),window.getSelection()?.removeAllRanges()}catch(c){let X=c?.message||"\uD53C\uB4DC\uBC31 \uC804\uC1A1 \uC2E4\uD328";wn(X),console.error("[@impakers/debug] \uD53C\uB4DC\uBC31 \uC804\uC1A1 \uC2E4\uD328:",c)}finally{ue(!1)}}},[a,ce,e,n,wn]),rs=Re(()=>{v(!0),Ne(()=>{_(null),v(!1),s(!1),document.documentElement.classList.remove("impakers-selecting"),q.current=!0,setTimeout(()=>{q.current=!1},300)},150)},[]),Ut=Re(d=>{let c=d.id;J(X=>X===c?null:c)},[]);je(()=>{if(!I)return;let d=qe(I),c=pn(d);c?(me(L=>({...L,[I]:c})),we(!1)):we(!0);let X=zn(d,L=>{me(fe=>({...fe,[I]:L})),we(!1)});return rt(e,I,{staleWhileRevalidate:!0}).then(()=>we(!1)).catch(()=>we(!1)),X},[I,e]);let is=Re(async(d,c,X,L)=>{let fe=n?.()?.name?String(n().name):"\uC775\uBA85",Le=n?.()?.id?String(n().id):void 0;try{let ve;if(L)try{ve=await at(e,L,"comment",d)}catch(se){let S=se?.message||"\uD30C\uC77C \uC5C5\uB85C\uB4DC \uC2E4\uD328";wn(S),console.error("[@impakers/debug] \uD30C\uC77C \uC5C5\uB85C\uB4DC \uC2E4\uD328:",se)}await it(e,d,c,fe,Le,X,ve)}catch(ve){let se=ve?.message||"\uCF54\uBA58\uD2B8 \uC804\uC1A1 \uC2E4\uD328";wn(se),console.error("[@impakers/debug] \uCF54\uBA58\uD2B8 \uC804\uC1A1 \uC2E4\uD328:",ve)}},[n,e,wn]),as=Re(()=>{J(null)},[]),Kn=Re(d=>{if(!d){A(null),Y(null);return}if(A(d.id),d.boundingBox){let c=d.boundingBox,X=c.x+c.width/2,L=d.isFixed?c.y+c.height/2:c.y+c.height/2-window.scrollY,fe=Bt(X,L);if(fe){let Le=fe.getBoundingClientRect(),ve=Le.width/c.width,se=Le.height/c.height;if(ve>=.5&&se>=.5){Y(fe);return}}}Y(null)},[]),ls=Re(()=>{if(!a)return{left:0,top:0};let d=a.x/100*window.innerWidth,c=a.isFixed?a.y:a.y-window.scrollY,X=Math.max(160,Math.min(window.innerWidth-160,d));return c>window.innerHeight-290?{left:X,bottom:window.innerHeight-c+20}:{left:X,top:c+20}},[a]);if(typeof document>"u")return null;let Sn=ls(),Nn=M?.getBoundingClientRect(),ds=[{id:"comment",label:"\uD53C\uB4DC\uBC31",active:t,icon:$("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:$("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})})},{id:"delay-capture",label:"\uB51C\uB808\uC774 \uCEA1\uCC98",icon:$e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[$("circle",{cx:"12",cy:"12",r:"10"}),$("polyline",{points:"12 6 12 12 16 14"})]})},{id:"agent",label:"\uC5D0\uC774\uC804\uD2B8",icon:$e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[$("path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"}),$("path",{d:"M20 3v4"}),$("path",{d:"M22 5h-4"})]})},{id:"inbox",label:"Inbox",badge:Un||void 0,icon:$e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[$("polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}),$("path",{d:"M5.45 5.11L2 12v6a2 2 0 002 2h16a2 2 0 002-2v-6l-3.45-6.89A2 2 0 0016.76 4H7.24a2 2 0 00-1.79 1.11z"})]})},{id:"settings",label:"\uC124\uC815",icon:$e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[$("circle",{cx:"12",cy:"12",r:"3"}),$("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]})}],Kt=j,pt=n?.()?.name?String(n().name):null,Zt=si(()=>r.filter(d=>{let c=pe.find(X=>X.id===d.id);return!(te.hideDoneMarkers&&(d.status==="done"||d.status==="resolved")||te.showOnlyMine&&c?.authorName&&pt&&c.authorName!==pt)}),[r,pe,te.hideDoneMarkers,te.showOnlyMine,pt]),Xt=(d,c)=>({id:d.id,title:d.title||"\uD53C\uB4DC\uBC31",status:d.status,priority:d.priority,authorName:d.authorName||"\uC775\uBA85",feedbackUrl:d.feedbackUrl||c,createdAt:d.createdAt,startedAt:d.startedAt,completedAt:d.completedAt,commentCount:d.commentCount||0}),cs=pe.map(d=>Xt(d,Kt)),us=x.map(d=>Xt(d,""));return ri($e("div",{"data-impakers-debug":"",children:[$(Ho,{items:ds,onSelect:V,onHide:o,onDoubleTap:ln}),p&&$(Oo,{pageItems:cs,allItems:us,currentPath:Kt,serviceName:qt()||void 0,endpoint:e,currentUserName:n?.()?.name?String(n().name):"\uC775\uBA85",currentUserId:n?.()?.id?String(n().id):void 0,onClose:()=>P(!1),onHistoryViewed:os,newNotiCount:Un}),H&&$(Ko,{endpoint:e,onClose:()=>ie(!1)}),F&&$(qo,{settings:te,onChange:ke,onClose:()=>Z(!1)}),t&&$e(_i,{children:[C?.rect&&!a&&$("div",{className:`${ae.hoverHighlight} ${ae.enter}`,style:{left:C.rect.left,top:C.rect.top,width:C.rect.width,height:C.rect.height}}),C&&!a&&$e("div",{className:`${ae.hoverTooltip} ${ae.enter}`,style:{left:Math.min(B.x+14,window.innerWidth-200),top:B.y+14},children:[C.reactComponents&&$("div",{className:ae.hoverReactPath,children:C.reactComponents}),$("div",{className:ae.hoverElementName,children:C.elementName})]}),Nn&&re&&$("div",{className:`${ae.singleSelectOutline} ${ae.enter}`,style:{left:Nn.left,top:Nn.top,width:Nn.width,height:Nn.height}}),a?.targetElement&&(()=>{let d=a.targetElement.getBoundingClientRect();return $("div",{className:`${ae.singleSelectOutline} ${ae.enter}`,style:{left:d.left,top:d.top,width:d.width,height:d.height}})})()]}),$("div",{className:ae.markersLayer,"data-impakers-debug":"",style:{display:te.markersVisible?void 0:"none"},children:Zt.filter(d=>!d.isFixed).map((d,c)=>$(It,{annotation:d,layerIndex:c,isAnimated:D.has(d.id),isHovered:re===d.id,isDeleting:!1,markerClickBehavior:"edit",accentColor:te.markerColor,onHover:()=>Kn(d),onHoverEnd:()=>Kn(null),onClick:()=>Ut(d),onContextMenu:()=>{}},d.id))}),$e("div",{className:ae.fixedMarkersLayer,"data-impakers-debug":"",style:{display:te.markersVisible?void 0:"none"},children:[Zt.filter(d=>d.isFixed).map((d,c)=>$(It,{annotation:d,layerIndex:c,isAnimated:D.has(d.id),isHovered:re===d.id,isDeleting:!1,markerClickBehavior:"edit",accentColor:te.markerColor,onHover:()=>Kn(d),onHoverEnd:()=>Kn(null),onClick:()=>Ut(d),onContextMenu:()=>{}},d.id)),a&&$(Io,{x:a.x,y:a.clientY,isMultiSelect:!1,accentColor:te.markerColor})]}),a&&$(to,{ref:kn,element:a.resolvedSource||a.resolvedName||a.element,selectedText:a.selectedText,isExiting:k,style:{position:"fixed",left:Sn.left,..."top"in Sn?{top:Sn.top}:{},..."bottom"in Sn?{bottom:Sn.bottom}:{},transform:"translateX(-50%)",zIndex:100001},onSubmit:ss,onCancel:rs}),I&&(()=>{let d=r.find(le=>le.id===I),c=pe.find(le=>le.id===I);if(!d)return null;let X=d.x/100*window.innerWidth,L=d.isFixed?d.y:d.y-window.scrollY,fe=Math.max(10,Math.min(X+20,window.innerWidth-360)),Le=window.innerHeight-L,ve=L,se=Le>=300?Math.min(L,window.innerHeight-60):Math.max(10,L-Math.min(480,ve-10)),S={id:d.id,title:c?.title||d.comment||"\uD53C\uB4DC\uBC31",status:c?.status||"todo",authorName:c?.authorName||void 0,createdAt:c?.createdAt||new Date(d.timestamp).toISOString(),comments:oe[d.id]||[]};return $(Bo,{task:S,currentUserName:n?.()?.name?String(n().name):"\uC775\uBA85",currentUserId:n?.()?.id?String(n().id):void 0,left:fe,top:se,loading:Me,onClose:as,onReply:is})})(),Ze!==null&&$e("div",{className:ae.countdownOverlay,"data-impakers-debug":"",children:[$("div",{className:ae.countdownNumber,children:Ze}),$("div",{className:ae.countdownLabel,children:"\uD53C\uB4DC\uBC31 \uBAA8\uB4DC \uD65C\uC131\uD654\uAE4C\uC9C0..."}),$("button",{className:ae.countdownCancel,onClick:()=>{Be.current&&clearTimeout(Be.current),Xe(null)},type:"button",children:"\uCDE8\uC18C"})]}),h&&$e("div",{className:ae.toast,"data-impakers-debug":"",children:[$("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#16a34a",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:$("polyline",{points:"20 6 9 17 4 12"})}),$("span",{children:"\uD0DC\uC2A4\uD06C \uC0DD\uC131\uC774 \uC644\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4"})]}),T&&$e("div",{className:`${ae.toast} ${ae.toastError}`,"data-impakers-debug":"",children:[$e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#ef4444",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[$("circle",{cx:"12",cy:"12",r:"10"}),$("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),$("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),$("span",{children:T})]})]}),document.body)}import{useState as Dt,useCallback as mi}from"react";import{createPortal as pi}from"react-dom";import{jsx as Ke,jsxs as xn}from"react/jsx-runtime";function ns({endpoint:e,onSuccess:n,onClose:o}){let[t,s]=Dt(""),[r,i]=Dt(!1),[a,_]=Dt(null),k=mi(async v=>{if(v.preventDefault(),!(!t.trim()||r)){i(!0),_(null);try{let C=await Gt(e,t.trim().toUpperCase());n(C.serviceName)}catch(C){_(C instanceof Error?C.message:"\uC778\uC99D \uC2E4\uD328")}finally{i(!1)}}},[t,e,r,n]);return typeof document>"u"?null:pi(xn("div",{"data-impakers-debug":"",style:{position:"fixed",inset:0,zIndex:2147483647,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif"},children:[Ke("div",{onClick:o,style:{position:"absolute",inset:0,background:"rgba(0, 0, 0, 0.4)"}}),xn("div",{style:{position:"relative",width:360,background:"white",borderRadius:12,boxShadow:"0 16px 48px rgba(0,0,0,0.16)",overflow:"hidden"},children:[xn("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e5e5"},children:[Ke("h3",{style:{fontSize:15,fontWeight:600,color:"#18181b",margin:0},children:"\uD53C\uB4DC\uBC31 \uC704\uC82F \uC778\uC99D"}),Ke("button",{onClick:o,type:"button",style:{width:28,height:28,border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,color:"#71717a"},children:Ke("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:Ke("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),xn("div",{style:{padding:20},children:[xn("p",{style:{fontSize:13,color:"#71717a",textAlign:"center",marginBottom:16,lineHeight:1.5},children:["\uC11C\uBE44\uC2A4 \uC2DC\uD06C\uB9BF \uCF54\uB4DC\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694.",Ke("br",{}),"\uCF54\uB4DC\uB294 \uC784\uD328\uCEE4\uC2A4 OS\uC5D0\uC11C \uD655\uC778\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),a&&Ke("div",{style:{background:"#fef2f2",border:"1px solid #fecaca",color:"#dc2626",padding:"8px 12px",borderRadius:8,fontSize:13,marginBottom:12},children:a}),xn("form",{onSubmit:k,children:[Ke("input",{type:"text",maxLength:6,placeholder:"A3F9K2",value:t,onChange:v=>s(v.target.value.toUpperCase()),autoFocus:!0,autoComplete:"off",style:{width:"100%",padding:"12px 16px",border:"1px solid #d4d4d8",borderRadius:8,fontSize:24,fontWeight:600,textAlign:"center",letterSpacing:8,textTransform:"uppercase",outline:"none",boxSizing:"border-box",fontFamily:"inherit",color:"#18181b"}}),Ke("button",{type:"submit",disabled:t.trim().length<6||r,style:{width:"100%",marginTop:16,padding:"10px 16px",border:"none",borderRadius:8,fontSize:14,fontWeight:500,cursor:t.trim().length<6||r?"not-allowed":"pointer",background:t.trim().length<6||r?"#a1a1aa":"#18181b",color:"white",fontFamily:"inherit"},children:r?"\uC778\uC99D \uC911...":"\uC778\uC99D\uD558\uAE30"})]})]})]})]}),document.body)}import{Fragment as fi,jsx as ts,jsxs as gi}from"react/jsx-runtime";function Il({endpoint:e,getUser:n}){let[o,t]=Wt(!1),[s,r]=Wt(!1),[i,a]=Wt(()=>{try{return localStorage.getItem("impakers-debug-hidden")==="1"}catch{return!1}});jt(()=>{t(cn())},[]),jt(()=>{let C=[nn._on("impakers-debug:show-auth",()=>{r(!0),a(!1);try{localStorage.removeItem("impakers-debug-hidden")}catch{}}),nn._on("impakers-debug:open",()=>{a(!1);try{localStorage.removeItem("impakers-debug-hidden")}catch{}}),nn._on("impakers-debug:deactivate",()=>{t(!1),r(!1)})];return()=>C.forEach(w=>w())},[]),jt(()=>{function C(w){if((w.ctrlKey||w.metaKey)&&w.shiftKey&&(w.key==="."||w.key===">"||w.code==="Period")){if(w.preventDefault(),i){a(!1);try{localStorage.removeItem("impakers-debug-hidden")}catch{}return}cn()?t(!0):r(B=>!B)}}return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[i]);let _=Ot(C=>{t(!0),r(!1)},[]),k=Ot(()=>{r(!1)},[]),v=Ot(()=>{a(!0);try{localStorage.setItem("impakers-debug-hidden","1")}catch{}},[]);return gi(fi,{children:[o&&!i&&ts(es,{endpoint:e,getUser:n,onHide:v}),s&&!o&&ts(ns,{endpoint:e,onSuccess:_,onClose:k})]})}export{nn as ImpakersDebug,Il as ImpakersDebugProvider};